diff --git a/app/webroot/css/cake.generic.css b/app/webroot/css/cake.generic.css
index 77ca75e80..3de408a0c 100644
--- a/app/webroot/css/cake.generic.css
+++ b/app/webroot/css/cake.generic.css
@@ -1,6 +1,6 @@
/**
*
- * PHP versions 4 and 5
+ * Generic CSS for CakePHP
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
@@ -21,7 +21,7 @@
padding:0;
}
-/* General Style Info */
+/** General Style Info **/
body {
background: #003d4c;
color: #fff;
@@ -30,14 +30,12 @@ body {
margin: 0;
}
a {
- background:#fff;
color: #003d4c;
text-decoration: underline;
font-weight: bold;
}
a:hover {
- background:#fff;
- color: #003d4c;
+ color: #367889;
text-decoration:none;
}
a img {
@@ -45,37 +43,33 @@ a img {
}
h1, h2, h3, h4 {
font-weight: normal;
+ margin-bottom:0.5em;
}
h1 {
background:#fff;
color: #003d4c;
font-size: 100%;
- margin: 0.1em 0;
}
h2 {
background:#fff;
color: #e32;
- font-family:'Gill Sans','lucida grande',helvetica, arial, sans-serif;
+ font-family:'Gill Sans','lucida grande', helvetica, arial, sans-serif;
font-size: 190%;
- margin: 0.3em 0;
- padding-top: 0.8em;
}
h3 {
color: #993;
- font-family:'Gill Sans','lucida grande',helvetica, arial, sans-serif;
+ font-family:'Gill Sans','lucida grande', helvetica, arial, sans-serif;
font-size: 165%;
- padding-top: 1.5em;
}
h4 {
color: #993;
font-weight: normal;
- padding-top: 0.5em;
}
ul, li {
margin: 0 12px;
}
-/* Layout */
+/** Layout **/
#container {
text-align: left;
}
@@ -84,7 +78,8 @@ ul, li {
padding: 10px 20px;
}
#header h1 {
- background: #003d4c url('../img/cake.icon.gif') no-repeat left;
+ line-height:20px;
+ background: #003d4c url('../img/cake.icon.png') no-repeat left;
color: #fff;
padding: 0px 30px;
}
@@ -112,10 +107,29 @@ ul, li {
text-align: right;
}
-/* Tables */
+/** containers **/
+div.form,
+div.index,
+div.view {
+ float:right;
+ width:76%;
+ border-left:1px solid #666;
+ padding:10px 2%;
+}
+div.actions {
+ float:left;
+ width:16%;
+ padding:10px 1.5%;
+}
+div.actions h3 {
+ padding-top:0;
+ color:#777;
+}
+
+
+/** Tables **/
table {
background: #fff;
- border:1px solid #ccc;
border-right:0;
clear: both;
color: #333;
@@ -123,39 +137,42 @@ table {
width: 100%;
}
th {
- background: #f2f2f2;
- border:1px solid #bbb;
- border-top: 1px solid #fff;
- border-left: 1px solid #fff;
- text-align: center;
+ border:0;
+ border-bottom:2px solid #555;
+ text-align: left;
+ padding:4px;
}
th a {
- background:#f2f2f2;
display: block;
padding: 2px 4px;
text-decoration: none;
}
-th a:hover {
- background: #ccc;
- color: #333;
- text-decoration: none;
+th a.asc:after {
+ content: ' ⇣';
+}
+th a.desc:after {
+ content: ' ⇡';
}
table tr td {
background: #fff;
- border-right: 1px solid #ccc;
- padding: 4px;
- text-align: center;
+ padding: 6px;
+ text-align: left;
vertical-align: top;
+ border-bottom:1px solid #ddd;
}
-table tr.altrow td {
- background: #f4f4f4;
+table tr:nth-child(2n) td {
+ background: #f5f5f5;
+}
+table .altrow td {
+ background: #f5f5f5;
}
td.actions {
text-align: center;
white-space: nowrap;
}
-td.actions a {
+table td.actions a {
margin: 0px 6px;
+ padding:2px 5px;
}
.cake-sql-log table {
background: #f4f4f4;
@@ -163,27 +180,30 @@ td.actions a {
.cake-sql-log td {
padding: 4px 8px;
text-align: left;
+ font-family: Monaco, Consolas, "Courier New", monospaced;
+}
+.cake-sql-log caption {
+ color:#fff;
}
-/* Paging */
+/** Paging **/
div.paging {
background:#fff;
color: #ccc;
- margin-bottom: 2em;
+ margin-top: 1em;
+ clear:both;
}
-div.paging div.disabled {
+div.paging span.disabled {
color: #ddd;
display: inline;
}
-div.paging span {
-}
div.paging span.current {
- color: #000;
+ color: #c73e14;
}
div.paging span a {
}
-/* Scaffold View */
+/** Scaffold View **/
dl {
line-height: 2em;
margin: 0em 0em;
@@ -203,16 +223,16 @@ dd {
vertical-align: top;
}
-/* Forms */
+/** Forms **/
form {
clear: both;
margin-right: 20px;
padding: 0;
- width: 80%;
+ width: 95%;
}
fieldset {
border: 1px solid #ccc;
- margin-top: 30px;
+ margin-bottom: 1em;
padding: 16px 20px;
}
fieldset legend {
@@ -240,30 +260,33 @@ form div {
padding: .5em;
vertical-align: text-top;
}
-form div.input {
+form .input {
color: #444;
}
-form div.required {
- color: #333;
+form .required {
font-weight: bold;
}
+form .required label:after {
+ color: #e32;
+ content: '*';
+ display:inline;
+}
form div.submit {
border: 0;
clear: both;
margin-top: 10px;
- margin-left: 140px;
}
label {
display: block;
font-size: 110%;
- padding-right: 20px;
+ margin-bottom:3px;
}
input, textarea {
clear: both;
font-size: 140%;
font-family: "frutiger linotype", "lucida grande", "verdana", sans-serif;
- padding: 2px;
- width: 100%;
+ padding: 1%;
+ width:98%;
}
select {
clear: both;
@@ -283,6 +306,9 @@ input[type=checkbox] {
margin: 0px 6px 7px 2px;
width: auto;
}
+div.checkbox label {
+ display: inline;
+}
input[type=radio] {
float:left;
width:auto;
@@ -294,23 +320,37 @@ div.radio label {
input[type=submit] {
display: inline;
font-size: 110%;
- padding: 2px 5px;
width: auto;
- vertical-align: bottom;
+}
+form .submit input[type=submit] {
+ background:#62af56;
+ background: -webkit-gradient(linear, left top, left bottom, from(#a8ea9c), to(#62af56));
+ background-image: -moz-linear-gradient(top, #a8ea9c, #62af56);
+ border-color: #2d6324;
+ color: #000;
+ text-shadow: #8cee7c 0px 1px 0px;
+}
+form .submit input[type=submit]:hover {
+ background:#4ca83d;
+ background: -webkit-gradient(linear, left top, left bottom, from(#85e573), to(#4ca83d));
+ background-image: -moz-linear-gradient(top, #85e573, #4ca83d);
}
-/* Notices and Errors */
+/** Notices and Errors **/
div.message {
clear: both;
- color: #900;
+ color: #fff;
font-size: 140%;
font-weight: bold;
- margin: 1em 0;
+ margin: 0 0 1em 0;
+ background: #c73e14;
+ padding: 5px;
}
div.error-message {
clear: both;
- color: #900;
+ color: #fff;
font-weight: bold;
+ background: #c73e14;
}
p.error {
background-color: #e32;
@@ -341,35 +381,57 @@ p.error em {
color: #fff;
}
-/* Actions */
+/** Actions **/
div.actions ul {
- margin: 0px 0;
+ margin: 0;
padding: 0;
}
div.actions li {
- display: inline;
+ margin:0 0 0.5em 0;
list-style-type: none;
- line-height: 2em;
- margin: 0 2em 0 0;
white-space: nowrap;
+ padding: 0;
}
div.actions ul li a {
- background:#fff;
- color: #003d4c;
- text-decoration: none;
+ font-weight: normal;
+ display: block;
+ clear: both;
}
div.actions ul li a:hover {
- color: #333;
text-decoration: underline;
}
-/* Related */
+input[type=submit],
+div.actions ul li a,
+td.actions a {
+ font-weight:normal;
+ padding: 4px 8px;
+ background:#e6e49f;
+ background: -webkit-gradient(linear, left top, left bottom, from(#f1f1d4), to(#e6e49f));
+ background-image: -moz-linear-gradient(top, #f1f1d4, #e6e49f);
+ color:#333;
+ border:1px solid #aaac62;
+ -webkit-border-radius:8px;
+ -moz-border-radius:8px;
+ border-radius:8px;
+ text-decoration:none;
+ text-shadow: #fff 0px 1px 0px;
+ min-width: 0;
+}
+input[type=submit]:hover,
+div.actions ul li a:hover,
+td.actions a:hover {
+ background: #f0f09a;
+ background: -webkit-gradient(linear, left top, left bottom, from(#f7f7e1), to(#eeeca9));
+}
+
+/** Related **/
div.related {
clear: both;
display: block;
}
-/* Debugging */
+/** Debugging **/
pre {
color: #000;
background: #f0f0f0;
@@ -385,7 +447,6 @@ pre.cake-debug {
}
div.cake-stack-trace {
background: #fff;
- border: 4px dotted #ffcc00;
color: #333;
margin: 0px;
padding: 6px;
diff --git a/app/webroot/img/cake.icon.gif b/app/webroot/img/cake.icon.gif
deleted file mode 100644
index f29f72ebe..000000000
Binary files a/app/webroot/img/cake.icon.gif and /dev/null differ
diff --git a/app/webroot/img/cake.icon.png b/app/webroot/img/cake.icon.png
new file mode 100644
index 000000000..394fa42d5
Binary files /dev/null and b/app/webroot/img/cake.icon.png differ
diff --git a/app/webroot/test.php b/app/webroot/test.php
index b87686602..2e0aacb49 100644
--- a/app/webroot/test.php
+++ b/app/webroot/test.php
@@ -18,7 +18,6 @@
* @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License
*/
set_time_limit(0);
-ini_set('memory_limit','128M');
ini_set('display_errors', 1);
/**
* Use the DS to separate the directories in other defines
@@ -85,89 +84,13 @@ if (isset($corePath[0])) {
define('TEST_CAKE_CORE_INCLUDE_PATH', CAKE_CORE_INCLUDE_PATH);
}
-require_once CAKE_TESTS_LIB . 'test_manager.php';
-
if (Configure::read('debug') < 1) {
die(__('Debug setting does not allow access to this url.', true));
}
-if (!isset($_SERVER['SERVER_NAME'])) {
- $_SERVER['SERVER_NAME'] = '';
-}
-if (empty( $_GET['output'])) {
- $_GET['output'] = 'html';
-}
-/**
- *
- * Used to determine output to display
- */
-define('CAKE_TEST_OUTPUT_HTML', 1);
-define('CAKE_TEST_OUTPUT_TEXT', 2);
+require_once CAKE_TESTS_LIB . 'cake_test_suite_dispatcher.php';
-if (isset($_GET['output']) && $_GET['output'] == 'html') {
- define('CAKE_TEST_OUTPUT', CAKE_TEST_OUTPUT_HTML);
-} else {
- Debugger::output('txt');
- define('CAKE_TEST_OUTPUT', CAKE_TEST_OUTPUT_TEXT);
-}
+$Dispatcher = new CakeTestSuiteDispatcher();
+$Dispatcher->dispatch();
-if (!App::import('Vendor', 'simpletest' . DS . 'reporter')) {
- CakePHPTestHeader();
- include CAKE_TESTS_LIB . 'simpletest.php';
- CakePHPTestSuiteFooter();
- exit();
-}
-
-$analyzeCodeCoverage = false;
-if (isset($_GET['code_coverage'])) {
- $analyzeCodeCoverage = true;
- require_once CAKE_TESTS_LIB . 'code_coverage_manager.php';
- if (!extension_loaded('xdebug')) {
- CakePHPTestHeader();
- include CAKE_TESTS_LIB . 'xdebug.php';
- CakePHPTestSuiteFooter();
- exit();
- }
-}
-
-CakePHPTestHeader();
-CakePHPTestSuiteHeader();
-define('RUN_TEST_LINK', $_SERVER['PHP_SELF']);
-
-if (isset($_GET['group'])) {
- if ('all' == $_GET['group']) {
- TestManager::runAllTests(CakeTestsGetReporter());
- } else {
- if ($analyzeCodeCoverage) {
- CodeCoverageManager::start($_GET['group'], CakeTestsGetReporter());
- }
- TestManager::runGroupTest(ucfirst($_GET['group']), CakeTestsGetReporter());
- if ($analyzeCodeCoverage) {
- CodeCoverageManager::report();
- }
- }
-
- CakePHPTestRunMore();
- CakePHPTestAnalyzeCodeCoverage();
-} elseif (isset($_GET['case'])) {
- if ($analyzeCodeCoverage) {
- CodeCoverageManager::start($_GET['case'], CakeTestsGetReporter());
- }
-
- TestManager::runTestCase($_GET['case'], CakeTestsGetReporter());
-
- if ($analyzeCodeCoverage) {
- CodeCoverageManager::report();
- }
-
- CakePHPTestRunMore();
- CakePHPTestAnalyzeCodeCoverage();
-} elseif (isset($_GET['show']) && $_GET['show'] == 'cases') {
- CakePHPTestCaseList();
-} else {
- CakePHPTestGroupTestList();
-}
-CakePHPTestSuiteFooter();
-$output = ob_get_clean();
-echo $output;
?>
\ No newline at end of file
diff --git a/cake/console/libs/tasks/fixture.php b/cake/console/libs/tasks/fixture.php
index 82dec5869..195392d1c 100644
--- a/cake/console/libs/tasks/fixture.php
+++ b/cake/console/libs/tasks/fixture.php
@@ -54,6 +54,7 @@ class FixtureTask extends Shell {
* The db connection being used for baking
*
* @var string
+ * @access public
*/
var $connection = null;
@@ -61,6 +62,7 @@ class FixtureTask extends Shell {
* Schema instance
*
* @var object
+ * @access protected
*/
var $_Schema = null;
@@ -140,6 +142,7 @@ class FixtureTask extends Shell {
*
* @param string $modelName Name of model you are dealing with.
* @return array Array of import options.
+ * @access public
*/
function importOptions($modelName) {
$options = array();
@@ -167,8 +170,8 @@ class FixtureTask extends Shell {
* @param string $model Name of model to bake.
* @param string $useTable Name of table to use.
* @param array $importOptions Options for var $import
- * @return string Baked fixture
- * @access private
+ * @return string Baked fixture content
+ * @access public
*/
function bake($model, $useTable = false, $importOptions = array()) {
if (!class_exists('CakeSchema')) {
@@ -228,8 +231,8 @@ class FixtureTask extends Shell {
*
* @param string $model name of the model being generated
* @param string $fixture Contents of the fixture file.
+ * @return string Content saved into fixture file.
* @access public
- * @return void
*/
function generateFixtureFile($model, $otherVars) {
$defaults = array('table' => null, 'schema' => null, 'records' => null, 'import' => null, 'fields' => null);
@@ -255,6 +258,7 @@ class FixtureTask extends Shell {
*
* @param array $table Table schema array
* @return string fields definitions
+ * @access protected
*/
function _generateSchema($tableInfo) {
$schema = $this->_Schema->generateTable('f', $tableInfo);
@@ -266,6 +270,7 @@ class FixtureTask extends Shell {
*
* @param array $table Table schema array
* @return array Array of records to use in the fixture.
+ * @access protected
*/
function _generateRecords($tableInfo, $recordCount = 1) {
$records = array();
@@ -337,6 +342,7 @@ class FixtureTask extends Shell {
*
* @param array $records Array of records to be converted to string
* @return string A string value of the $records array.
+ * @access protected
*/
function _makeRecordString($records) {
$out = "array(\n";
@@ -360,6 +366,7 @@ class FixtureTask extends Shell {
* @param string $modelName name of the model to take records from.
* @param string $useTable Name of table to use.
* @return array Array of records.
+ * @access protected
*/
function _getRecordsFromTable($modelName, $useTable = null) {
if ($this->interactive) {
@@ -378,7 +385,7 @@ class FixtureTask extends Shell {
'recursive' => -1
));
$db =& ConnectionManager::getDataSource($modelObject->useDbConfig);
- $schema = $modelObject->schema();
+ $schema = $modelObject->schema(true);
$out = array();
foreach ($records as $record) {
$row = array();
diff --git a/cake/console/libs/tasks/model.php b/cake/console/libs/tasks/model.php
index 9be466056..08ddb3b97 100644
--- a/cake/console/libs/tasks/model.php
+++ b/cake/console/libs/tasks/model.php
@@ -186,7 +186,7 @@ class ModelTask extends Shell {
if (in_array($useTable, $this->__tables)) {
$tempModel = new Model(array('name' => $currentModelName, 'table' => $useTable, 'ds' => $this->connection));
- $fields = $tempModel->schema();
+ $fields = $tempModel->schema(true);
if (!array_key_exists('id', $fields)) {
$primaryKey = $this->findPrimaryKey($fields);
}
@@ -447,7 +447,7 @@ class ModelTask extends Shell {
$this->out(__('One moment while the associations are detected.', true));
}
- $fields = $model->schema();
+ $fields = $model->schema(true);
if (empty($fields)) {
return false;
}
@@ -487,7 +487,7 @@ class ModelTask extends Shell {
* @return array $associations with belongsTo added in.
*/
function findBelongsTo(&$model, $associations) {
- $fields = $model->schema();
+ $fields = $model->schema(true);
foreach ($fields as $fieldName => $field) {
$offset = strpos($fieldName, '_id');
if ($fieldName != $model->primaryKey && $fieldName != 'parent_id' && $offset !== false) {
@@ -562,7 +562,7 @@ class ModelTask extends Shell {
$foreignKey = $this->_modelKey($model->name);
foreach ($this->__tables as $otherTable) {
$tempOtherModel = $this->_getModelObject($this->_modelName($otherTable), $otherTable);
- $modelFieldsTemp = $tempOtherModel->schema();
+ $modelFieldsTemp = $tempOtherModel->schema(true);
$offset = strpos($otherTable, $model->table . '_');
$otherOffset = strpos($otherTable, '_' . $model->table);
@@ -695,7 +695,7 @@ class ModelTask extends Shell {
$possible = array();
foreach ($this->__tables as $otherTable) {
$tempOtherModel = & new Model(array('table' => $otherTable, 'ds' => $this->connection));
- $modelFieldsTemp = $tempOtherModel->schema();
+ $modelFieldsTemp = $tempOtherModel->schema(true);
foreach ($modelFieldsTemp as $fieldName => $field) {
if ($field['type'] == 'integer' || $field['type'] == 'string') {
$possible[$otherTable][] = $fieldName;
@@ -821,6 +821,7 @@ class ModelTask extends Shell {
$tables = array();
$db =& ConnectionManager::getDataSource($useDbConfig);
+ $db->cacheSources = false;
$usePrefix = empty($db->config['prefix']) ? '' : $db->config['prefix'];
if ($usePrefix) {
foreach ($db->listSources() as $table) {
diff --git a/cake/console/libs/tasks/test.php b/cake/console/libs/tasks/test.php
index 06cf9c5bb..5c1cb7e1c 100644
--- a/cake/console/libs/tasks/test.php
+++ b/cake/console/libs/tasks/test.php
@@ -46,6 +46,7 @@ class TestTask extends Shell {
* Tasks used.
*
* @var array
+ * @access public
*/
var $tasks = array('Template');
@@ -53,6 +54,7 @@ class TestTask extends Shell {
* class types that methods can be generated for
*
* @var array
+ * @access public
*/
var $classTypes = array('Model', 'Controller', 'Component', 'Behavior', 'Helper');
@@ -60,6 +62,7 @@ class TestTask extends Shell {
* Internal list of fixtures that have been added so far.
*
* @var string
+ * @access protected
*/
var $_fixtures = array();
@@ -164,6 +167,7 @@ class TestTask extends Shell {
* Interact with the user and get their chosen type. Can exit the script.
*
* @return string Users chosen type.
+ * @access public
*/
function getObjectType() {
$this->hr();
@@ -188,6 +192,7 @@ class TestTask extends Shell {
*
* @param string $objectType Type of object to list classes for i.e. Model, Controller.
* @return string Class name the user chose.
+ * @access public
*/
function getClassName($objectType) {
$options = App::objects(strtolower($objectType));
@@ -207,8 +212,11 @@ class TestTask extends Shell {
/**
* Checks whether the chosen type can find its own fixtures.
* Currently only model, and controller are supported
- *
+ *
+ * @param string $type The Type of object you are generating tests for eg. controller
+ * @param string $className the Classname of the class the test is being generated for.
* @return boolean
+ * @access public
*/
function typeCanDetectFixtures($type) {
$type = strtolower($type);
@@ -218,7 +226,10 @@ class TestTask extends Shell {
/**
* Check if a class with the given type is loaded or can be loaded.
*
+ * @param string $type The Type of object you are generating tests for eg. controller
+ * @param string $className the Classname of the class the test is being generated for.
* @return boolean
+ * @access public
*/
function isLoadableClass($type, $class) {
return App::import($type, $class);
@@ -228,7 +239,10 @@ class TestTask extends Shell {
* Construct an instance of the class to be tested.
* So that fixtures can be detected
*
- * @return object
+ * @param string $type The Type of object you are generating tests for eg. controller
+ * @param string $class the Classname of the class the test is being generated for.
+ * @return object And instance of the class that is going to be tested.
+ * @access public
*/
function &buildTestSubject($type, $class) {
ClassRegistry::flush();
@@ -245,7 +259,10 @@ class TestTask extends Shell {
/**
* Gets the real class name from the cake short form.
*
+ * @param string $type The Type of object you are generating tests for eg. controller
+ * @param string $class the Classname of the class the test is being generated for.
* @return string Real classname
+ * @access public
*/
function getRealClassName($type, $class) {
if (strtolower($type) == 'model') {
@@ -260,6 +277,7 @@ class TestTask extends Shell {
*
* @param string $className Name of class to look at.
* @return array Array of method names.
+ * @access public
*/
function getTestableMethods($className) {
$classMethods = get_class_methods($className);
@@ -278,8 +296,9 @@ class TestTask extends Shell {
* Generate the list of fixtures that will be required to run this test based on
* loaded models.
*
- * @param object The object you want to generate fixtures for.
+ * @param object $subject The object you want to generate fixtures for.
* @return array Array of fixtures to be included in the test.
+ * @access public
*/
function generateFixtureList(&$subject) {
$this->_fixtures = array();
@@ -295,6 +314,7 @@ class TestTask extends Shell {
* Process a model recursively and pull out all the
* model names converting them to fixture names.
*
+ * @param Model $subject A Model class to scan for associations and pull fixtures off of.
* @return void
* @access protected
*/
@@ -319,6 +339,7 @@ class TestTask extends Shell {
* Process all the models attached to a controller
* and generate a fixture list.
*
+ * @param Controller $subject A controller to pull model names off of.
* @return void
* @access protected
*/
@@ -337,6 +358,7 @@ class TestTask extends Shell {
* Add classname to the fixture list.
* Sets the app. or plugin.plugin_name. prefix.
*
+ * @param string $name Name of the Model class that a fixture might be required for.
* @return void
* @access protected
*/
@@ -354,7 +376,8 @@ class TestTask extends Shell {
/**
* Interact with the user to get additional fixtures they want to use.
*
- * @return void
+ * @return array Array of fixtures the user wants to add.
+ * @access public
*/
function getUserFixtures() {
$proceed = $this->in(__('Bake could not detect fixtures, would you like to add some?', true), array('y','n'), 'n');
@@ -372,7 +395,9 @@ class TestTask extends Shell {
* Is a mock class required for this type of test?
* Controllers require a mock class.
*
+ * @param string $type The type of object tests are being generated for eg. controller.
* @return boolean
+ * @access public
*/
function hasMockClass($type) {
$type = strtolower($type);
@@ -382,7 +407,10 @@ class TestTask extends Shell {
/**
* Generate a constructor code snippet for the type and classname
*
+ * @param string $type The Type of object you are generating tests for eg. controller
+ * @param string $className the Classname of the class the test is being generated for.
* @return string Constructor snippet for the thing you are building.
+ * @access public
*/
function generateConstructor($type, $fullClassName) {
$type = strtolower($type);
@@ -397,10 +425,13 @@ class TestTask extends Shell {
}
/**
- * make the filename for the test case. resolve the suffixes for controllers
+ * Make the filename for the test case. resolve the suffixes for controllers
* and get the plugin path if needed.
*
- * @return string filename the test should be created on
+ * @param string $type The Type of object you are generating tests for eg. controller
+ * @param string $className the Classname of the class the test is being generated for.
+ * @return string filename the test should be created on.
+ * @access public
*/
function testCaseFileName($type, $className) {
$path = $this->path;
@@ -418,6 +449,7 @@ class TestTask extends Shell {
* Show help file.
*
* @return void
+ * @access public
*/
function help() {
$this->hr();
diff --git a/cake/console/libs/tasks/view.php b/cake/console/libs/tasks/view.php
index 62cb1c82c..fc0a69e42 100644
--- a/cake/console/libs/tasks/view.php
+++ b/cake/console/libs/tasks/view.php
@@ -283,7 +283,7 @@ class ViewTask extends Shell {
$displayField = $modelObj->displayField;
$singularVar = Inflector::variable($modelClass);
$singularHumanName = $this->_singularHumanName($modelClass);
- $schema = $modelObj->schema();
+ $schema = $modelObj->schema(true);
$fields = array_keys($schema);
$associations = $this->__associations($modelObj);
} else {
@@ -469,7 +469,7 @@ class ViewTask extends Shell {
$associations[$type][$assocKey]['displayField'] = $model->{$assocKey}->displayField;
$associations[$type][$assocKey]['foreignKey'] = $assocData['foreignKey'];
$associations[$type][$assocKey]['controller'] = Inflector::pluralize(Inflector::underscore($assocData['className']));
- $associations[$type][$assocKey]['fields'] = array_keys($model->{$assocKey}->schema());
+ $associations[$type][$assocKey]['fields'] = array_keys($model->{$assocKey}->schema(true));
}
}
return $associations;
diff --git a/cake/console/libs/testsuite.php b/cake/console/libs/testsuite.php
index d2856e84d..e9a3c30ba 100644
--- a/cake/console/libs/testsuite.php
+++ b/cake/console/libs/testsuite.php
@@ -69,14 +69,6 @@ class TestSuiteShell extends Shell {
*/
var $doCoverage = false;
-/**
- * The headline for the test output
- *
- * @var string
- * @access public
- */
- var $headline = 'CakePHP Test Shell';
-
/**
* Initialization method installs Simpletest and loads all plugins
*
@@ -94,12 +86,60 @@ class TestSuiteShell extends Shell {
$this->__installSimpleTest();
require_once CAKE . 'tests' . DS . 'lib' . DS . 'test_manager.php';
- require_once CAKE . 'tests' . DS . 'lib' . DS . 'cli_reporter.php';
+ require_once CAKE . 'tests' . DS . 'lib' . DS . 'reporter' . DS . 'cake_cli_reporter.php';
$plugins = App::objects('plugin');
foreach ($plugins as $p) {
$this->plugins[] = Inflector::underscore($p);
}
+ $this->parseArgs();
+ $this->getManager();
+ }
+
+/**
+ * Parse the arguments given into the Shell object properties.
+ *
+ * @return void
+ * @access public
+ */
+ function parseArgs() {
+ if (empty($this->args)) {
+ return;
+ }
+ $this->category = $this->args[0];
+
+ if (!in_array($this->category, array('app', 'core'))) {
+ $this->isPluginTest = true;
+ }
+
+ if (isset($this->args[1])) {
+ $this->type = $this->args[1];
+ }
+
+ if (isset($this->args[2])) {
+ if ($this->args[2] == 'cov') {
+ $this->doCoverage = true;
+ } else {
+ $this->file = Inflector::underscore($this->args[2]);
+ }
+ }
+
+ if (isset($this->args[3]) && $this->args[3] == 'cov') {
+ $this->doCoverage = true;
+ }
+ }
+
+/**
+ * Gets a manager instance, and set the app/plugin properties.
+ *
+ * @return void
+ */
+ function getManager() {
+ $this->Manager = new TestManager();
+ $this->Manager->appTest = ($this->category === 'app');
+ if ($this->isPluginTest) {
+ $this->Manager->pluginTest = $this->category;
+ }
}
/**
@@ -109,46 +149,24 @@ class TestSuiteShell extends Shell {
* @access public
*/
function main() {
- $this->out($this->headline);
+ $this->out(__('CakePHP Test Shell', true));
$this->hr();
- if (count($this->args) > 0) {
- $this->category = $this->args[0];
-
- if (!in_array($this->category, array('app', 'core'))) {
- $this->isPluginTest = true;
- }
-
- if (isset($this->args[1])) {
- $this->type = $this->args[1];
- }
-
- if (isset($this->args[2])) {
- if ($this->args[2] == 'cov') {
- $this->doCoverage = true;
- } else {
- $this->file = Inflector::underscore($this->args[2]);
- }
- }
-
- if (isset($this->args[3]) && $this->args[3] == 'cov') {
- $this->doCoverage = true;
- }
- } else {
- $this->err('Sorry, you did not pass any arguments!');
+ if (count($this->args) == 0) {
+ $this->error(__('Sorry, you did not pass any arguments!', true));
}
if ($this->__canRun()) {
- $this->out('Running '.$this->category.' '.$this->type.' '.$this->file);
+ $message = sprintf(__('Running %s %s %s', true), $this->category, $this->type, $this->file);
+ $this->out($message);
$exitCode = 0;
if (!$this->__run()) {
$exitCode = 1;
}
- exit($exitCode);
+ $this->_stop($exitCode);
} else {
- $this->err('Sorry, the tests could not be found.');
- exit(1);
+ $this->error(__('Sorry, the tests could not be found.', true));
}
}
@@ -201,50 +219,37 @@ class TestSuiteShell extends Shell {
$isPlugin = in_array(Inflector::underscore($this->category), $this->plugins);
if ($isNeitherAppNorCore && !$isPlugin) {
- $this->err($this->category.' is an invalid test category (either "app", "core" or name of a plugin)');
+ $message = sprintf(
+ __('%s is an invalid test category (either "app", "core" or name of a plugin)', true),
+ $this->category
+ );
+ $this->error($message);
return false;
}
$folder = $this->__findFolderByCategory($this->category);
if (!file_exists($folder)) {
- $this->err($folder . ' not found');
+ $this->err(sprintf(__('%s not found', true), $folder));
return false;
}
if (!in_array($this->type, array('all', 'group', 'case'))) {
- $this->err($this->type.' is invalid. Should be case, group or all');
+ $this->err(sprintf(__('%s is invalid. Should be case, group or all', true), $this->type));
return false;
}
- switch ($this->type) {
- case 'all':
- return true;
- break;
- case 'group':
- if (file_exists($folder.DS.'groups'.DS.$this->file.'.group.php')) {
- return true;
- }
- break;
- case 'case':
- if ($this->category == 'app' && file_exists($folder.DS.'cases'.DS.$this->file.'.test.php')) {
- return true;
- }
- $coreCaseExists = file_exists($folder.DS.'cases'.DS.$this->file.'.test.php');
- $coreLibCaseExists = file_exists($folder.DS.'cases'.DS.'libs'.DS.$this->file.'.test.php');
- if ($this->category == 'core' && ($coreCaseExists || $coreLibCaseExists)) {
- return true;
- }
-
- if ($isPlugin && file_exists($folder.DS.'cases'.DS.$this->file.'.test.php')) {
- return true;
- }
- break;
+ $fileName = $this->__getFileName($folder, $this->isPluginTest);
+ if ($fileName === true || file_exists($folder . $fileName)) {
+ return true;
}
- $this->err($this->category.' '.$this->type.' '.$this->file.' is an invalid test identifier');
+ $message = sprintf(
+ __('%s %s %s is an invalid test identifier', true),
+ $this->category, $this->type, $this->file
+ );
+ $this->err($message);
return false;
}
-
/**
* Executes the tests depending on our settings
*
@@ -252,69 +257,82 @@ class TestSuiteShell extends Shell {
* @access private
*/
function __run() {
- $reporter = new CLIReporter();
- $this->__setGetVars();
+ $Reporter = new CakeCliReporter('utf-8', array(
+ 'app' => $this->Manager->appTest,
+ 'plugin' => $this->Manager->pluginTest,
+ 'group' => ($this->type === 'group'),
+ 'codeCoverage' => $this->doCoverage
+ ));
if ($this->type == 'all') {
- return TestManager::runAllTests($reporter);
+ return $this->Manager->runAllTests($Reporter);
}
if ($this->doCoverage) {
if (!extension_loaded('xdebug')) {
- $this->out('You must install Xdebug to use the CakePHP(tm) Code Coverage Analyzation. Download it from http://www.xdebug.org/docs/install');
- exit(0);
+ $this->out(__('You must install Xdebug to use the CakePHP(tm) Code Coverage Analyzation. Download it from http://www.xdebug.org/docs/install', true));
+ $this->_stop(0);
}
}
if ($this->type == 'group') {
$ucFirstGroup = ucfirst($this->file);
-
- $path = CORE_TEST_GROUPS;
- if ($this->category == 'app') {
- $path = APP_TEST_GROUPS;
- } elseif ($this->isPluginTest) {
- $path = APP.'plugins'.DS.$this->category.DS.'tests'.DS.'groups';
- }
-
if ($this->doCoverage) {
require_once CAKE . 'tests' . DS . 'lib' . DS . 'code_coverage_manager.php';
- CodeCoverageManager::start($ucFirstGroup, $reporter);
- }
- $result = TestManager::runGroupTest($ucFirstGroup, $reporter);
- if ($this->doCoverage) {
- CodeCoverageManager::report();
+ CodeCoverageManager::init($ucFirstGroup, $Reporter);
+ CodeCoverageManager::start();
}
+ $result = $this->Manager->runGroupTest($ucFirstGroup, $Reporter);
return $result;
}
- if ($this->category === 'core') {
- $coreCaseExists = file_exists(CORE_TEST_CASES.DS.$this->file.'.test.php');
- if ($coreCaseExists) {
- $case = $this->file . '.test.php';
- } else {
- $case = 'libs' . DS . $this->file . '.test.php';
- }
- } elseif ($this->category === 'app') {
- $case = $this->file.'.test.php';
- } elseif ($this->isPluginTest) {
- $case = $this->file.'.test.php';
- }
+
+ $folder = $folder = $this->__findFolderByCategory($this->category);
+ $case = $this->__getFileName($folder, $this->isPluginTest);
if ($this->doCoverage) {
require_once CAKE . 'tests' . DS . 'lib' . DS . 'code_coverage_manager.php';
- CodeCoverageManager::start($case, $reporter);
+ CodeCoverageManager::init($case, $Reporter);
+ CodeCoverageManager::start();
}
-
- $result = TestManager::runTestCase($case, $reporter);
- if ($this->doCoverage) {
- CodeCoverageManager::report();
- }
-
+ $result = $this->Manager->runTestCase($case, $Reporter);
return $result;
}
/**
- * Finds the correct folder to look for tests for based on the input category
+ * Gets the concrete filename for the inputted test name and category/type
*
+ * @param string $folder Folder name to look for files in.
+ * @param boolean $isPlugin If the test case is a plugin.
+ * @return mixed Either string filename or boolean false on failure. Or true if the type is 'all'
+ * @access private
+ */
+ function __getFileName($folder, $isPlugin) {
+ $ext = $this->Manager->getExtension($this->type);
+ switch ($this->type) {
+ case 'all':
+ return true;
+ case 'group':
+ return $this->file . $ext;
+ case 'case':
+ if ($this->category == 'app' || $isPlugin) {
+ return $this->file . $ext;
+ }
+ $coreCase = $this->file . $ext;
+ $coreLibCase = 'libs' . DS . $this->file . $ext;
+
+ if ($this->category == 'core' && file_exists($folder . DS . $coreCase)) {
+ return $coreCase;
+ } elseif ($this->category == 'core' && file_exists($folder . DS . $coreLibCase)) {
+ return $coreLibCase;
+ }
+ }
+ return false;
+ }
+
+/**
+ * Finds the correct folder to look for tests for based on the input category and type.
+ *
+ * @param string $category The category of the test. Either 'app', 'core' or a plugin name.
* @return string the folder path
* @access private
*/
@@ -322,44 +340,21 @@ class TestSuiteShell extends Shell {
$folder = '';
$paths = array(
'core' => CAKE,
- 'app' => APP
+ 'app' => APP
);
+ $typeDir = $this->type === 'group' ? 'groups' : 'cases';
if (array_key_exists($category, $paths)) {
- $folder = $paths[$category] . 'tests';
+ $folder = $paths[$category] . 'tests' . DS . $typeDir . DS;
} else {
- $scoredCategory = Inflector::underscore($category);
- $folder = APP . 'plugins' . DS . $scoredCategory . DS;
- $pluginPaths = App::path('plugins');
- foreach ($pluginPaths as $path) {
- if (file_exists($path . $scoredCategory . DS . 'tests')) {
- $folder = $path . $scoredCategory . DS . 'tests';
- break;
- }
+ $pluginPath = App::pluginPath($category);
+ if (is_dir($pluginPath . 'tests')) {
+ $folder = $pluginPath . 'tests' . DS . $typeDir . DS;
}
}
return $folder;
}
-/**
- * Sets some get vars needed for TestManager
- *
- * @return void
- * @access private
- */
- function __setGetVars() {
- if (in_array($this->category, $this->plugins)) {
- $_GET['plugin'] = $this->category;
- } elseif (in_array(Inflector::Humanize($this->category), $this->plugins)) {
- $_GET['plugin'] = Inflector::Humanize($this->category);
- } elseif ($this->category == 'app') {
- $_GET['app'] = true;
- }
- if ($this->type == 'group') {
- $_GET['group'] = true;
- }
- }
-
/**
* tries to install simpletest and exits gracefully if it is not there
*
@@ -368,7 +363,7 @@ class TestSuiteShell extends Shell {
*/
function __installSimpleTest() {
if (!App::import('Vendor', 'simpletest' . DS . 'reporter')) {
- $this->err('Sorry, Simpletest could not be found. Download it from http://simpletest.org and install it to your vendors directory.');
+ $this->err(__('Sorry, Simpletest could not be found. Download it from http://simpletest.org and install it to your vendors directory.', true));
exit;
}
}
diff --git a/cake/console/templates/default/views/form.ctp b/cake/console/templates/default/views/form.ctp
index a86f034cc..1f445f2a3 100644
--- a/cake/console/templates/default/views/form.ctp
+++ b/cake/console/templates/default/views/form.ctp
@@ -43,6 +43,7 @@
?>
+
"; ?>
- Html->link(__('Delete', true), array('action' => 'delete', \$this->Form->value('{$modelClass}.{$primaryKey}')), null, sprintf(__('Are you sure you want to delete # %s?', true), \$this->Form->value('{$modelClass}.{$primaryKey}'))); ?>";?>
diff --git a/cake/console/templates/default/views/index.ctp b/cake/console/templates/default/views/index.ctp
index a539c57e5..35e059b8c 100644
--- a/cake/console/templates/default/views/index.ctp
+++ b/cake/console/templates/default/views/index.ctp
@@ -18,30 +18,23 @@
*/
?>
-
";?>
-
-Paginator->counter(array(
-'format' => __('Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%', true)
-));
-?>";?>
-
-
-
-
- Paginator->sort('{$field}');?>";?> |
-
- ";?> |
-
-\n";
+ ";?>
+
+
+
+ Paginator->sort('{$field}');?>";?> |
+
+ ";?> |
+
+ \n";
echo "\t>\n";
foreach ($fields as $field) {
$isKey = false;
@@ -55,7 +48,7 @@ foreach (\${$pluralVar} as \${$singularVar}):
}
}
if ($isKey !== true) {
- echo "\t\t\n\t\t\t\n\t\t | \n";
+ echo "\t\t | \n";
}
}
@@ -66,16 +59,25 @@ foreach (\${$pluralVar} as \${$singularVar}):
echo "\t\t\n";
echo "\t
\n";
-echo "\n";
-?>
-
-
-
-Paginator->prev('<< '.__('previous', true), array(), null, array('class'=>'disabled'));?>\n";?>
- | Paginator->numbers();?>\n"?>
-Paginator->next(__('next', true).' >>', array(), null, array('class' => 'disabled'));?>\n";?>
+ echo "\n";
+ ?>
+
+
+ Paginator->counter(array(
+ 'format' => __('Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%', true)
+ ));
+ ?>";?>
+
+
+
+ Paginator->prev('<< '.__('previous', true), array(), null, array('class'=>'disabled'));?>\n";?>
+ | Paginator->numbers();?>\n"?> |
+ Paginator->next(__('next', true).' >>', array(), null, array('class' => 'disabled'));?>\n";?>
+
+
"; ?>
- Html->link(sprintf(__('New %s', true), __('{$singularHumanName}', true)), array('action' => 'add')); ?>";?>
+
"; ?>
Html->link(sprintf(__('Edit %s', true), __('{$singularHumanName}', true)), array('action' => 'edit', \${$singularVar}['{$modelClass}']['{$primaryKey}'])); ?> \n";
diff --git a/cake/console/templates/skel/config/sql/db_acl.php b/cake/console/templates/skel/config/schema/db_acl.php
similarity index 100%
rename from cake/console/templates/skel/config/sql/db_acl.php
rename to cake/console/templates/skel/config/schema/db_acl.php
diff --git a/cake/console/templates/skel/config/sql/db_acl.sql b/cake/console/templates/skel/config/schema/db_acl.sql
similarity index 100%
rename from cake/console/templates/skel/config/sql/db_acl.sql
rename to cake/console/templates/skel/config/schema/db_acl.sql
diff --git a/cake/console/templates/skel/config/sql/i18n.php b/cake/console/templates/skel/config/schema/i18n.php
similarity index 100%
rename from cake/console/templates/skel/config/sql/i18n.php
rename to cake/console/templates/skel/config/schema/i18n.php
diff --git a/cake/console/templates/skel/config/sql/i18n.sql b/cake/console/templates/skel/config/schema/i18n.sql
similarity index 100%
rename from cake/console/templates/skel/config/sql/i18n.sql
rename to cake/console/templates/skel/config/schema/i18n.sql
diff --git a/cake/console/templates/skel/config/sql/sessions.php b/cake/console/templates/skel/config/schema/sessions.php
similarity index 100%
rename from cake/console/templates/skel/config/sql/sessions.php
rename to cake/console/templates/skel/config/schema/sessions.php
diff --git a/cake/console/templates/skel/config/sql/sessions.sql b/cake/console/templates/skel/config/schema/sessions.sql
similarity index 100%
rename from cake/console/templates/skel/config/sql/sessions.sql
rename to cake/console/templates/skel/config/schema/sessions.sql
diff --git a/cake/console/templates/skel/webroot/css/cake.generic.css b/cake/console/templates/skel/webroot/css/cake.generic.css
index 6c68821e9..3de408a0c 100644
--- a/cake/console/templates/skel/webroot/css/cake.generic.css
+++ b/cake/console/templates/skel/webroot/css/cake.generic.css
@@ -1,6 +1,6 @@
/**
*
- * PHP versions 4 and 5
+ * Generic CSS for CakePHP
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
@@ -16,13 +16,12 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-
* {
margin:0;
padding:0;
}
-/* General Style Info */
+/** General Style Info **/
body {
background: #003d4c;
color: #fff;
@@ -31,14 +30,12 @@ body {
margin: 0;
}
a {
- background:#fff;
color: #003d4c;
text-decoration: underline;
font-weight: bold;
}
a:hover {
- background:#fff;
- color: #003d4c;
+ color: #367889;
text-decoration:none;
}
a img {
@@ -46,37 +43,33 @@ a img {
}
h1, h2, h3, h4 {
font-weight: normal;
+ margin-bottom:0.5em;
}
h1 {
background:#fff;
color: #003d4c;
font-size: 100%;
- margin: 0.1em 0;
}
h2 {
background:#fff;
color: #e32;
- font-family:'Gill Sans','lucida grande',helvetica, arial, sans-serif;
+ font-family:'Gill Sans','lucida grande', helvetica, arial, sans-serif;
font-size: 190%;
- margin: 0.3em 0;
- padding-top: 0.8em;
}
h3 {
color: #993;
- font-family:'Gill Sans','lucida grande',helvetica, arial, sans-serif;
+ font-family:'Gill Sans','lucida grande', helvetica, arial, sans-serif;
font-size: 165%;
- padding-top: 1.5em;
}
h4 {
color: #993;
font-weight: normal;
- padding-top: 0.5em;
}
ul, li {
margin: 0 12px;
}
-/* Layout */
+/** Layout **/
#container {
text-align: left;
}
@@ -85,7 +78,8 @@ ul, li {
padding: 10px 20px;
}
#header h1 {
- background: #003d4c url('../img/cake.icon.gif') no-repeat left;
+ line-height:20px;
+ background: #003d4c url('../img/cake.icon.png') no-repeat left;
color: #fff;
padding: 0px 30px;
}
@@ -113,10 +107,29 @@ ul, li {
text-align: right;
}
-/* Tables */
+/** containers **/
+div.form,
+div.index,
+div.view {
+ float:right;
+ width:76%;
+ border-left:1px solid #666;
+ padding:10px 2%;
+}
+div.actions {
+ float:left;
+ width:16%;
+ padding:10px 1.5%;
+}
+div.actions h3 {
+ padding-top:0;
+ color:#777;
+}
+
+
+/** Tables **/
table {
background: #fff;
- border:1px solid #ccc;
border-right:0;
clear: both;
color: #333;
@@ -124,39 +137,42 @@ table {
width: 100%;
}
th {
- background: #f2f2f2;
- border:1px solid #bbb;
- border-top: 1px solid #fff;
- border-left: 1px solid #fff;
- text-align: center;
+ border:0;
+ border-bottom:2px solid #555;
+ text-align: left;
+ padding:4px;
}
th a {
- background:#f2f2f2;
display: block;
padding: 2px 4px;
text-decoration: none;
}
-th a:hover {
- background: #ccc;
- color: #333;
- text-decoration: none;
+th a.asc:after {
+ content: ' ⇣';
+}
+th a.desc:after {
+ content: ' ⇡';
}
table tr td {
background: #fff;
- border-right: 1px solid #ccc;
- padding: 4px;
- text-align: center;
+ padding: 6px;
+ text-align: left;
vertical-align: top;
+ border-bottom:1px solid #ddd;
}
-table tr.altrow td {
- background: #f4f4f4;
+table tr:nth-child(2n) td {
+ background: #f5f5f5;
+}
+table .altrow td {
+ background: #f5f5f5;
}
td.actions {
text-align: center;
white-space: nowrap;
}
-td.actions a {
+table td.actions a {
margin: 0px 6px;
+ padding:2px 5px;
}
.cake-sql-log table {
background: #f4f4f4;
@@ -164,27 +180,30 @@ td.actions a {
.cake-sql-log td {
padding: 4px 8px;
text-align: left;
+ font-family: Monaco, Consolas, "Courier New", monospaced;
+}
+.cake-sql-log caption {
+ color:#fff;
}
-/* Paging */
+/** Paging **/
div.paging {
background:#fff;
color: #ccc;
- margin-bottom: 2em;
+ margin-top: 1em;
+ clear:both;
}
-div.paging div.disabled {
+div.paging span.disabled {
color: #ddd;
display: inline;
}
-div.paging span {
-}
div.paging span.current {
- color: #000;
+ color: #c73e14;
}
div.paging span a {
}
-/* Scaffold View */
+/** Scaffold View **/
dl {
line-height: 2em;
margin: 0em 0em;
@@ -204,16 +223,16 @@ dd {
vertical-align: top;
}
-/* Forms */
+/** Forms **/
form {
clear: both;
margin-right: 20px;
padding: 0;
- width: 80%;
+ width: 95%;
}
fieldset {
border: 1px solid #ccc;
- margin-top: 30px;
+ margin-bottom: 1em;
padding: 16px 20px;
}
fieldset legend {
@@ -241,30 +260,33 @@ form div {
padding: .5em;
vertical-align: text-top;
}
-form div.input {
+form .input {
color: #444;
}
-form div.required {
- color: #333;
+form .required {
font-weight: bold;
}
+form .required label:after {
+ color: #e32;
+ content: '*';
+ display:inline;
+}
form div.submit {
border: 0;
clear: both;
margin-top: 10px;
- margin-left: 140px;
}
label {
display: block;
font-size: 110%;
- padding-right: 20px;
+ margin-bottom:3px;
}
input, textarea {
clear: both;
font-size: 140%;
font-family: "frutiger linotype", "lucida grande", "verdana", sans-serif;
- padding: 2px;
- width: 100%;
+ padding: 1%;
+ width:98%;
}
select {
clear: both;
@@ -284,6 +306,9 @@ input[type=checkbox] {
margin: 0px 6px 7px 2px;
width: auto;
}
+div.checkbox label {
+ display: inline;
+}
input[type=radio] {
float:left;
width:auto;
@@ -295,23 +320,37 @@ div.radio label {
input[type=submit] {
display: inline;
font-size: 110%;
- padding: 2px 5px;
width: auto;
- vertical-align: bottom;
+}
+form .submit input[type=submit] {
+ background:#62af56;
+ background: -webkit-gradient(linear, left top, left bottom, from(#a8ea9c), to(#62af56));
+ background-image: -moz-linear-gradient(top, #a8ea9c, #62af56);
+ border-color: #2d6324;
+ color: #000;
+ text-shadow: #8cee7c 0px 1px 0px;
+}
+form .submit input[type=submit]:hover {
+ background:#4ca83d;
+ background: -webkit-gradient(linear, left top, left bottom, from(#85e573), to(#4ca83d));
+ background-image: -moz-linear-gradient(top, #85e573, #4ca83d);
}
-/* Notices and Errors */
+/** Notices and Errors **/
div.message {
clear: both;
- color: #900;
+ color: #fff;
font-size: 140%;
font-weight: bold;
- margin: 1em 0;
+ margin: 0 0 1em 0;
+ background: #c73e14;
+ padding: 5px;
}
div.error-message {
clear: both;
- color: #900;
+ color: #fff;
font-weight: bold;
+ background: #c73e14;
}
p.error {
background-color: #e32;
@@ -342,35 +381,57 @@ p.error em {
color: #fff;
}
-/* Actions */
+/** Actions **/
div.actions ul {
- margin: 0px 0;
+ margin: 0;
padding: 0;
}
div.actions li {
- display: inline;
+ margin:0 0 0.5em 0;
list-style-type: none;
- line-height: 2em;
- margin: 0 2em 0 0;
white-space: nowrap;
+ padding: 0;
}
div.actions ul li a {
- background:#fff;
- color: #003d4c;
- text-decoration: none;
+ font-weight: normal;
+ display: block;
+ clear: both;
}
div.actions ul li a:hover {
- color: #333;
text-decoration: underline;
}
-/* Related */
+input[type=submit],
+div.actions ul li a,
+td.actions a {
+ font-weight:normal;
+ padding: 4px 8px;
+ background:#e6e49f;
+ background: -webkit-gradient(linear, left top, left bottom, from(#f1f1d4), to(#e6e49f));
+ background-image: -moz-linear-gradient(top, #f1f1d4, #e6e49f);
+ color:#333;
+ border:1px solid #aaac62;
+ -webkit-border-radius:8px;
+ -moz-border-radius:8px;
+ border-radius:8px;
+ text-decoration:none;
+ text-shadow: #fff 0px 1px 0px;
+ min-width: 0;
+}
+input[type=submit]:hover,
+div.actions ul li a:hover,
+td.actions a:hover {
+ background: #f0f09a;
+ background: -webkit-gradient(linear, left top, left bottom, from(#f7f7e1), to(#eeeca9));
+}
+
+/** Related **/
div.related {
clear: both;
display: block;
}
-/* Debugging */
+/** Debugging **/
pre {
color: #000;
background: #f0f0f0;
@@ -386,7 +447,6 @@ pre.cake-debug {
}
div.cake-stack-trace {
background: #fff;
- border: 4px dotted #ffcc00;
color: #333;
margin: 0px;
padding: 6px;
diff --git a/cake/console/templates/skel/webroot/index.php b/cake/console/templates/skel/webroot/index.php
index ebb3c6c72..5935a869c 100644
--- a/cake/console/templates/skel/webroot/index.php
+++ b/cake/console/templates/skel/webroot/index.php
@@ -1,6 +1,8 @@
dispatch();
-if (!App::import('Vendor', 'simpletest' . DS . 'reporter')) {
- CakePHPTestHeader();
- include CAKE_TESTS_LIB . 'simpletest.php';
- CakePHPTestSuiteFooter();
- exit();
-}
-
-$analyzeCodeCoverage = false;
-if (isset($_GET['code_coverage'])) {
- $analyzeCodeCoverage = true;
- require_once CAKE_TESTS_LIB . 'code_coverage_manager.php';
- if (!extension_loaded('xdebug')) {
- CakePHPTestHeader();
- include CAKE_TESTS_LIB . 'xdebug.php';
- CakePHPTestSuiteFooter();
- exit();
- }
-}
-
-CakePHPTestHeader();
-CakePHPTestSuiteHeader();
-define('RUN_TEST_LINK', $_SERVER['PHP_SELF']);
-
-if (isset($_GET['group'])) {
- if ('all' == $_GET['group']) {
- TestManager::runAllTests(CakeTestsGetReporter());
- } else {
- if ($analyzeCodeCoverage) {
- CodeCoverageManager::start($_GET['group'], CakeTestsGetReporter());
- }
- TestManager::runGroupTest(ucfirst($_GET['group']), CakeTestsGetReporter());
- if ($analyzeCodeCoverage) {
- CodeCoverageManager::report();
- }
- }
-
- CakePHPTestRunMore();
- CakePHPTestAnalyzeCodeCoverage();
-} elseif (isset($_GET['case'])) {
- if ($analyzeCodeCoverage) {
- CodeCoverageManager::start($_GET['case'], CakeTestsGetReporter());
- }
-
- TestManager::runTestCase($_GET['case'], CakeTestsGetReporter());
-
- if ($analyzeCodeCoverage) {
- CodeCoverageManager::report();
- }
-
- CakePHPTestRunMore();
- CakePHPTestAnalyzeCodeCoverage();
-} elseif (isset($_GET['show']) && $_GET['show'] == 'cases') {
- CakePHPTestCaseList();
-} else {
- CakePHPTestGroupTestList();
-}
-CakePHPTestSuiteFooter();
-$output = ob_get_clean();
-echo $output;
?>
\ No newline at end of file
diff --git a/cake/libs/controller/component.php b/cake/libs/controller/component.php
index 6c26a9ddd..b6e3a2c93 100644
--- a/cake/libs/controller/component.php
+++ b/cake/libs/controller/component.php
@@ -185,9 +185,6 @@ class Component extends Object {
function _loadComponents(&$object, $parent = null) {
$base = $this->__controllerVars['base'];
$normal = Set::normalize($object->components);
- if ($parent == null) {
- $normal = Set::merge(array('Session' => null), $normal);
- }
foreach ((array)$normal as $component => $config) {
$plugin = isset($this->__controllerVars['plugin']) ? $this->__controllerVars['plugin'] . '.' : null;
list($plugin, $component) = pluginSplit($component, true, $plugin);
diff --git a/cake/libs/controller/components/auth.php b/cake/libs/controller/components/auth.php
index 13a6fb29a..b391b972b 100644
--- a/cake/libs/controller/components/auth.php
+++ b/cake/libs/controller/components/auth.php
@@ -337,7 +337,7 @@ class AuthComponent extends Object {
if ($loginAction == $url) {
$model =& $this->getModel();
if (empty($controller->data) || !isset($controller->data[$model->alias])) {
- if (!$this->Session->check('Auth.redirect') && env('HTTP_REFERER')) {
+ if (!$this->Session->check('Auth.redirect') && !$this->loginRedirect && env('HTTP_REFERER')) {
$this->Session->write('Auth.redirect', $controller->referer(null, true));
}
return false;
diff --git a/cake/libs/controller/components/request_handler.php b/cake/libs/controller/components/request_handler.php
index 70ef9b20c..fbbf01afa 100644
--- a/cake/libs/controller/components/request_handler.php
+++ b/cake/libs/controller/components/request_handler.php
@@ -219,10 +219,10 @@ class RequestHandlerComponent extends Object {
}
$xml = new Xml(trim(file_get_contents('php://input')));
- if (is_object($xml->child('data')) && count($xml->children) == 1) {
- $controller->data = $xml->child('data');
+ if (count($xml->children) == 1 && is_object($dataNode = $xml->child('data'))) {
+ $controller->data = $dataNode->toArray();
} else {
- $controller->data = $xml;
+ $controller->data = $xml->toArray();
}
}
}
diff --git a/cake/libs/controller/controller.php b/cake/libs/controller/controller.php
index 6f12da1e4..98e1b3a6c 100644
--- a/cake/libs/controller/controller.php
+++ b/cake/libs/controller/controller.php
@@ -93,7 +93,7 @@ class Controller extends Object {
* @access protected
* @link http://book.cakephp.org/view/53/components-helpers-and-uses
*/
- var $helpers = array('Html', 'Form');
+ var $helpers = array('Session', 'Html', 'Form');
/**
* Parameters received in the current request: GET and POST data, information
@@ -229,7 +229,7 @@ class Controller extends Object {
* @access public
* @link http://book.cakephp.org/view/53/components-helpers-and-uses
*/
- var $components = array();
+ var $components = array('Session');
/**
* The name of the View class this controller sends output to.
diff --git a/cake/libs/l10n.php b/cake/libs/l10n.php
index 20064c83f..cff50caba 100644
--- a/cake/libs/l10n.php
+++ b/cake/libs/l10n.php
@@ -76,6 +76,14 @@ class L10n extends Object {
*/
var $charset = 'utf-8';
+/**
+ * Text direction for current locale
+ *
+ * @var string
+ * @access public
+ */
+ var $direction = 'ltr';
+
/**
* Set to true if a locale is found
*
@@ -176,145 +184,145 @@ class L10n extends Object {
* @var array
* @access private
*/
- var $__l10nCatalog = array('af' => array('language' => 'Afrikaans', 'locale' => 'afr', 'localeFallback' => 'afr', 'charset' => 'utf-8'),
- 'ar' => array('language' => 'Arabic', 'locale' => 'ara', 'localeFallback' => 'ara', 'charset' => 'utf-8'),
- 'ar-ae' => array('language' => 'Arabic (U.A.E.)', 'locale' => 'ar_ae', 'localeFallback' => 'ara', 'charset' => 'utf-8'),
- 'ar-bh' => array('language' => 'Arabic (Bahrain)', 'locale' => 'ar_bh', 'localeFallback' => 'ara', 'charset' => 'utf-8'),
- 'ar-dz' => array('language' => 'Arabic (Algeria)', 'locale' => 'ar_dz', 'localeFallback' => 'ara', 'charset' => 'utf-8'),
- 'ar-eg' => array('language' => 'Arabic (Egypt)', 'locale' => 'ar_eg', 'localeFallback' => 'ara', 'charset' => 'utf-8'),
- 'ar-iq' => array('language' => 'Arabic (Iraq)', 'locale' => 'ar_iq', 'localeFallback' => 'ara', 'charset' => 'utf-8'),
- 'ar-jo' => array('language' => 'Arabic (Jordan)', 'locale' => 'ar_jo', 'localeFallback' => 'ara', 'charset' => 'utf-8'),
- 'ar-kw' => array('language' => 'Arabic (Kuwait)', 'locale' => 'ar_kw', 'localeFallback' => 'ara', 'charset' => 'utf-8'),
- 'ar-lb' => array('language' => 'Arabic (Lebanon)', 'locale' => 'ar_lb', 'localeFallback' => 'ara', 'charset' => 'utf-8'),
- 'ar-ly' => array('language' => 'Arabic (Libya)', 'locale' => 'ar_ly', 'localeFallback' => 'ara', 'charset' => 'utf-8'),
- 'ar-ma' => array('language' => 'Arabic (Morocco)', 'locale' => 'ar_ma', 'localeFallback' => 'ara', 'charset' => 'utf-8'),
- 'ar-om' => array('language' => 'Arabic (Oman)', 'locale' => 'ar_om', 'localeFallback' => 'ara', 'charset' => 'utf-8'),
- 'ar-qa' => array('language' => 'Arabic (Qatar)', 'locale' => 'ar_qa', 'localeFallback' => 'ara', 'charset' => 'utf-8'),
- 'ar-sa' => array('language' => 'Arabic (Saudi Arabia)', 'locale' => 'ar_sa', 'localeFallback' => 'ara', 'charset' => 'utf-8'),
- 'ar-sy' => array('language' => 'Arabic (Syria)', 'locale' => 'ar_sy', 'localeFallback' => 'ara', 'charset' => 'utf-8'),
- 'ar-tn' => array('language' => 'Arabic (Tunisia)', 'locale' => 'ar_tn', 'localeFallback' => 'ara', 'charset' => 'utf-8'),
- 'ar-ye' => array('language' => 'Arabic (Yemen)', 'locale' => 'ar_ye', 'localeFallback' => 'ara', 'charset' => 'utf-8'),
- 'be' => array('language' => 'Byelorussian', 'locale' => 'bel', 'localeFallback' => 'bel', 'charset' => 'utf-8'),
- 'bg' => array('language' => 'Bulgarian', 'locale' => 'bul', 'localeFallback' => 'bul', 'charset' => 'utf-8'),
- 'bs' => array('language' => 'Bosnian', 'locale' => 'bos', 'localeFallback' => 'bos', 'charset' => 'utf-8'),
- 'ca' => array('language' => 'Catalan', 'locale' => 'cat', 'localeFallback' => 'cat', 'charset' => 'utf-8'),
- 'cs' => array('language' => 'Czech', 'locale' => 'cze', 'localeFallback' => 'cze', 'charset' => 'utf-8'),
- 'da' => array('language' => 'Danish', 'locale' => 'dan', 'localeFallback' => 'dan', 'charset' => 'utf-8'),
- 'de' => array('language' => 'German (Standard)', 'locale' => 'deu', 'localeFallback' => 'deu', 'charset' => 'utf-8'),
- 'de-at' => array('language' => 'German (Austria)', 'locale' => 'de_at', 'localeFallback' => 'deu', 'charset' => 'utf-8'),
- 'de-ch' => array('language' => 'German (Swiss)', 'locale' => 'de_ch', 'localeFallback' => 'deu', 'charset' => 'utf-8'),
- 'de-de' => array('language' => 'German (Germany)', 'locale' => 'de_de', 'localeFallback' => 'deu', 'charset' => 'utf-8'),
- 'de-li' => array('language' => 'German (Liechtenstein)', 'locale' => 'de_li', 'localeFallback' => 'deu', 'charset' => 'utf-8'),
- 'de-lu' => array('language' => 'German (Luxembourg)', 'locale' => 'de_lu', 'localeFallback' => 'deu', 'charset' => 'utf-8'),
- 'e' => array('language' => 'Greek', 'locale' => 'gre', 'localeFallback' => 'gre', 'charset' => 'utf-8'),
- 'el' => array('language' => 'Greek', 'locale' => 'gre', 'localeFallback' => 'gre', 'charset' => 'utf-8'),
- 'en' => array('language' => 'English', 'locale' => 'eng', 'localeFallback' => 'eng', 'charset' => 'utf-8'),
- 'en-au' => array('language' => 'English (Australian)', 'locale' => 'en_au', 'localeFallback' => 'eng', 'charset' => 'utf-8'),
- 'en-bz' => array('language' => 'English (Belize)', 'locale' => 'en_bz', 'localeFallback' => 'eng', 'charset' => 'utf-8'),
- 'en-ca' => array('language' => 'English (Canadian)', 'locale' => 'en_ca', 'localeFallback' => 'eng', 'charset' => 'utf-8'),
- 'en-gb' => array('language' => 'English (British)', 'locale' => 'en_gb', 'localeFallback' => 'eng', 'charset' => 'utf-8'),
- 'en-ie' => array('language' => 'English (Ireland)', 'locale' => 'en_ie', 'localeFallback' => 'eng', 'charset' => 'utf-8'),
- 'en-jm' => array('language' => 'English (Jamaica)', 'locale' => 'en_jm', 'localeFallback' => 'eng', 'charset' => 'utf-8'),
- 'en-nz' => array('language' => 'English (New Zealand)', 'locale' => 'en_nz', 'localeFallback' => 'eng', 'charset' => 'utf-8'),
- 'en-tt' => array('language' => 'English (Trinidad)', 'locale' => 'en_tt', 'localeFallback' => 'eng', 'charset' => 'utf-8'),
- 'en-us' => array('language' => 'English (United States)', 'locale' => 'en_us', 'localeFallback' => 'eng', 'charset' => 'utf-8'),
- 'en-za' => array('language' => 'English (South Africa)', 'locale' => 'en_za', 'localeFallback' => 'eng', 'charset' => 'utf-8'),
- 'es' => array('language' => 'Spanish (Spain - Traditional)', 'locale' => 'spa', 'localeFallback' => 'spa', 'charset' => 'utf-8'),
- 'es-ar' => array('language' => 'Spanish (Argentina)', 'locale' => 'es_ar', 'localeFallback' => 'spa', 'charset' => 'utf-8'),
- 'es-bo' => array('language' => 'Spanish (Bolivia)', 'locale' => 'es_bo', 'localeFallback' => 'spa', 'charset' => 'utf-8'),
- 'es-cl' => array('language' => 'Spanish (Chile)', 'locale' => 'es_cl', 'localeFallback' => 'spa', 'charset' => 'utf-8'),
- 'es-co' => array('language' => 'Spanish (Colombia)', 'locale' => 'es_co', 'localeFallback' => 'spa', 'charset' => 'utf-8'),
- 'es-cr' => array('language' => 'Spanish (Costa Rica)', 'locale' => 'es_cr', 'localeFallback' => 'spa', 'charset' => 'utf-8'),
- 'es-do' => array('language' => 'Spanish (Dominican Republic)', 'locale' => 'es_do', 'localeFallback' => 'spa', 'charset' => 'utf-8'),
- 'es-ec' => array('language' => 'Spanish (Ecuador)', 'locale' => 'es_ec', 'localeFallback' => 'spa', 'charset' => 'utf-8'),
- 'es-es' => array('language' => 'Spanish (Spain)', 'locale' => 'es_es', 'localeFallback' => 'spa', 'charset' => 'utf-8'),
- 'es-gt' => array('language' => 'Spanish (Guatemala)', 'locale' => 'es_gt', 'localeFallback' => 'spa', 'charset' => 'utf-8'),
- 'es-hn' => array('language' => 'Spanish (Honduras)', 'locale' => 'es_hn', 'localeFallback' => 'spa', 'charset' => 'utf-8'),
- 'es-mx' => array('language' => 'Spanish (Mexican)', 'locale' => 'es_mx', 'localeFallback' => 'spa', 'charset' => 'utf-8'),
- 'es-ni' => array('language' => 'Spanish (Nicaragua)', 'locale' => 'es_ni', 'localeFallback' => 'spa', 'charset' => 'utf-8'),
- 'es-pa' => array('language' => 'Spanish (Panama)', 'locale' => 'es_pa', 'localeFallback' => 'spa', 'charset' => 'utf-8'),
- 'es-pe' => array('language' => 'Spanish (Peru)', 'locale' => 'es_pe', 'localeFallback' => 'spa', 'charset' => 'utf-8'),
- 'es-pr' => array('language' => 'Spanish (Puerto Rico)', 'locale' => 'es_pr', 'localeFallback' => 'spa', 'charset' => 'utf-8'),
- 'es-py' => array('language' => 'Spanish (Paraguay)', 'locale' => 'es_py', 'localeFallback' => 'spa', 'charset' => 'utf-8'),
- 'es-sv' => array('language' => 'Spanish (El Salvador)', 'locale' => 'es_sv', 'localeFallback' => 'spa', 'charset' => 'utf-8'),
- 'es-uy' => array('language' => 'Spanish (Uruguay)', 'locale' => 'es_uy', 'localeFallback' => 'spa', 'charset' => 'utf-8'),
- 'es-ve' => array('language' => 'Spanish (Venezuela)', 'locale' => 'es_ve', 'localeFallback' => 'spa', 'charset' => 'utf-8'),
- 'et' => array('language' => 'Estonian', 'locale' => 'est', 'localeFallback' => 'est', 'charset' => 'utf-8'),
- 'eu' => array('language' => 'Basque', 'locale' => 'baq', 'localeFallback' => 'baq', 'charset' => 'utf-8'),
- 'fa' => array('language' => 'Farsi', 'locale' => 'per', 'localeFallback' => 'per', 'charset' => 'utf-8'),
- 'fi' => array('language' => 'Finnish', 'locale' => 'fin', 'localeFallback' => 'fin', 'charset' => 'utf-8'),
- 'fo' => array('language' => 'Faeroese', 'locale' => 'fao', 'localeFallback' => 'fao', 'charset' => 'utf-8'),
- 'fr' => array('language' => 'French (Standard)', 'locale' => 'fre', 'localeFallback' => 'fre', 'charset' => 'utf-8'),
- 'fr-be' => array('language' => 'French (Belgium)', 'locale' => 'fr_be', 'localeFallback' => 'fre', 'charset' => 'utf-8'),
- 'fr-ca' => array('language' => 'French (Canadian)', 'locale' => 'fr_ca', 'localeFallback' => 'fre', 'charset' => 'utf-8'),
- 'fr-ch' => array('language' => 'French (Swiss)', 'locale' => 'fr_ch', 'localeFallback' => 'fre', 'charset' => 'utf-8'),
- 'fr-fr' => array('language' => 'French (France)', 'locale' => 'fr_fr', 'localeFallback' => 'fre', 'charset' => 'utf-8'),
- 'fr-lu' => array('language' => 'French (Luxembourg)', 'locale' => 'fr_lu', 'localeFallback' => 'fre', 'charset' => 'utf-8'),
- 'ga' => array('language' => 'Irish', 'locale' => 'gle', 'localeFallback' => 'gle', 'charset' => 'utf-8'),
- 'gd' => array('language' => 'Gaelic (Scots)', 'locale' => 'gla', 'localeFallback' => 'gla', 'charset' => 'utf-8'),
- 'gd-ie' => array('language' => 'Gaelic (Irish)', 'locale' => 'gd_ie', 'localeFallback' => 'gla', 'charset' => 'utf-8'),
- 'gl' => array('language' => 'Galician', 'locale' => 'glg', 'localeFallback' => 'glg', 'charset' => 'utf-8'),
- 'he' => array('language' => 'Hebrew', 'locale' => 'heb', 'localeFallback' => 'heb', 'charset' => 'utf-8'),
- 'hi' => array('language' => 'Hindi', 'locale' => 'hin', 'localeFallback' => 'hin', 'charset' => 'utf-8'),
- 'hr' => array('language' => 'Croatian', 'locale' => 'hrv', 'localeFallback' => 'hrv', 'charset' => 'utf-8'),
- 'hu' => array('language' => 'Hungarian', 'locale' => 'hun', 'localeFallback' => 'hun', 'charset' => 'utf-8'),
- 'hy' => array('language' => 'Armenian - Armenia', 'locale' => 'hye', 'localeFallback' => 'hye', 'charset' => 'utf-8'),
- 'id' => array('language' => 'Indonesian', 'locale' => 'ind', 'localeFallback' => 'ind', 'charset' => 'utf-8'),
- 'in' => array('language' => 'Indonesian', 'locale' => 'ind', 'localeFallback' => 'ind', 'charset' => 'utf-8'),
- 'is' => array('language' => 'Icelandic', 'locale' => 'ice', 'localeFallback' => 'ice', 'charset' => 'utf-8'),
- 'it' => array('language' => 'Italian', 'locale' => 'ita', 'localeFallback' => 'ita', 'charset' => 'utf-8'),
- 'it-ch' => array('language' => 'Italian (Swiss) ', 'locale' => 'it_ch', 'localeFallback' => 'ita', 'charset' => 'utf-8'),
- 'ja' => array('language' => 'Japanese', 'locale' => 'jpn', 'localeFallback' => 'jpn', 'charset' => 'utf-8'),
- 'ko' => array('language' => 'Korean', 'locale' => 'kor', 'localeFallback' => 'kor', 'charset' => 'kr'),
- 'ko-kp' => array('language' => 'Korea (North)', 'locale' => 'ko_kp', 'localeFallback' => 'kor', 'charset' => 'kr'),
- 'ko-kr' => array('language' => 'Korea (South)', 'locale' => 'ko_kr', 'localeFallback' => 'kor', 'charset' => 'kr'),
- 'koi8-r' => array('language' => 'Russian', 'locale' => 'koi8_r', 'localeFallback' => 'rus', 'charset' => 'koi8-r'),
- 'lt' => array('language' => 'Lithuanian', 'locale' => 'lit', 'localeFallback' => 'lit', 'charset' => 'utf-8'),
- 'lv' => array('language' => 'Latvian', 'locale' => 'lav', 'localeFallback' => 'lav', 'charset' => 'utf-8'),
- 'mk' => array('language' => 'FYRO Macedonian', 'locale' => 'mk', 'localeFallback' => 'mac', 'charset' => 'utf-8'),
- 'mk-mk' => array('language' => 'Macedonian', 'locale' => 'mk_mk', 'localeFallback' => 'mac', 'charset' => 'utf-8'),
- 'ms' => array('language' => 'Malaysian', 'locale' => 'may', 'localeFallback' => 'may', 'charset' => 'utf-8'),
- 'mt' => array('language' => 'Maltese', 'locale' => 'mlt', 'localeFallback' => 'mlt', 'charset' => 'utf-8'),
- 'n' => array('language' => 'Dutch (Standard)', 'locale' => 'dut', 'localeFallback' => 'dut', 'charset' => 'utf-8'),
- 'nb' => array('language' => 'Norwegian Bokmal', 'locale' => 'nob', 'localeFallback' => 'nor', 'charset' => 'utf-8'),
- 'nl' => array('language' => 'Dutch (Standard)', 'locale' => 'dut', 'localeFallback' => 'dut', 'charset' => 'utf-8'),
- 'nl-be' => array('language' => 'Dutch (Belgium)', 'locale' => 'nl_be', 'localeFallback' => 'dut', 'charset' => 'utf-8'),
- 'nn' => array('language' => 'Norwegian Nynorsk', 'locale' => 'nno', 'localeFallback' => 'nor', 'charset' => 'utf-8'),
- 'no' => array('language' => 'Norwegian', 'locale' => 'nor', 'localeFallback' => 'nor', 'charset' => 'utf-8'),
- 'p' => array('language' => 'Polish', 'locale' => 'pol', 'localeFallback' => 'pol', 'charset' => 'utf-8'),
- 'pl' => array('language' => 'Polish', 'locale' => 'pol', 'localeFallback' => 'pol', 'charset' => 'utf-8'),
- 'pt' => array('language' => 'Portuguese (Portugal)', 'locale' => 'por', 'localeFallback' => 'por', 'charset' => 'utf-8'),
- 'pt-br' => array('language' => 'Portuguese (Brazil)', 'locale' => 'pt_br', 'localeFallback' => 'por', 'charset' => 'utf-8'),
- 'rm' => array('language' => 'Rhaeto-Romanic', 'locale' => 'roh', 'localeFallback' => 'roh', 'charset' => 'utf-8'),
- 'ro' => array('language' => 'Romanian', 'locale' => 'rum', 'localeFallback' => 'rum', 'charset' => 'utf-8'),
- 'ro-mo' => array('language' => 'Romanian (Moldavia)', 'locale' => 'ro_mo', 'localeFallback' => 'rum', 'charset' => 'utf-8'),
- 'ru' => array('language' => 'Russian', 'locale' => 'rus', 'localeFallback' => 'rus', 'charset' => 'utf-8'),
- 'ru-mo' => array('language' => 'Russian (Moldavia)', 'locale' => 'ru_mo', 'localeFallback' => 'rus', 'charset' => 'utf-8'),
- 'sb' => array('language' => 'Sorbian', 'locale' => 'wen', 'localeFallback' => 'wen', 'charset' => 'utf-8'),
- 'sk' => array('language' => 'Slovak', 'locale' => 'slo', 'localeFallback' => 'slo', 'charset' => 'utf-8'),
- 'sl' => array('language' => 'Slovenian', 'locale' => 'slv', 'localeFallback' => 'slv', 'charset' => 'utf-8'),
- 'sq' => array('language' => 'Albanian', 'locale' => 'alb', 'localeFallback' => 'alb', 'charset' => 'utf-8'),
- 'sr' => array('language' => 'Serbian', 'locale' => 'scc', 'localeFallback' => 'scc', 'charset' => 'utf-8'),
- 'sv' => array('language' => 'Swedish', 'locale' => 'swe', 'localeFallback' => 'swe', 'charset' => 'utf-8'),
- 'sv-fi' => array('language' => 'Swedish (Findland)', 'locale' => 'sv_fi', 'localeFallback' => 'swe', 'charset' => 'utf-8'),
- 'sx' => array('language' => 'Sutu', 'locale' => 'sx', 'localeFallback' => 'sx', 'charset' => 'utf-8'),
- 'sz' => array('language' => 'Sami (Lappish)', 'locale' => 'smi', 'localeFallback' => 'smi', 'charset' => 'utf-8'),
- 'th' => array('language' => 'Thai', 'locale' => 'tha', 'localeFallback' => 'tha', 'charset' => 'utf-8'),
- 'tn' => array('language' => 'Tswana', 'locale' => 'tsn', 'localeFallback' => 'tsn', 'charset' => 'utf-8'),
- 'tr' => array('language' => 'Turkish', 'locale' => 'tur', 'localeFallback' => 'tur', 'charset' => 'utf-8'),
- 'ts' => array('language' => 'Tsonga', 'locale' => 'tso', 'localeFallback' => 'tso', 'charset' => 'utf-8'),
- 'uk' => array('language' => 'Ukrainian', 'locale' => 'ukr', 'localeFallback' => 'ukr', 'charset' => 'utf-8'),
- 'ur' => array('language' => 'Urdu', 'locale' => 'urd', 'localeFallback' => 'urd', 'charset' => 'utf-8'),
- 've' => array('language' => 'Venda', 'locale' => 'ven', 'localeFallback' => 'ven', 'charset' => 'utf-8'),
- 'vi' => array('language' => 'Vietnamese', 'locale' => 'vie', 'localeFallback' => 'vie', 'charset' => 'utf-8'),
- 'xh' => array('language' => 'Xhosa', 'locale' => 'xho', 'localeFallback' => 'xho', 'charset' => 'utf-8'),
- 'yi' => array('language' => 'Yiddish', 'locale' => 'yid', 'localeFallback' => 'yid', 'charset' => 'utf-8'),
- 'zh' => array('language' => 'Chinese', 'locale' => 'chi', 'localeFallback' => 'chi', 'charset' => 'utf-8'),
- 'zh-cn' => array('language' => 'Chinese (PRC)', 'locale' => 'zh_cn', 'localeFallback' => 'chi', 'charset' => 'GB2312'),
- 'zh-hk' => array('language' => 'Chinese (Hong Kong)', 'locale' => 'zh_hk', 'localeFallback' => 'chi', 'charset' => 'utf-8'),
- 'zh-sg' => array('language' => 'Chinese (Singapore)', 'locale' => 'zh_sg', 'localeFallback' => 'chi', 'charset' => 'utf-8'),
- 'zh-tw' => array('language' => 'Chinese (Taiwan)', 'locale' => 'zh_tw', 'localeFallback' => 'chi', 'charset' => 'utf-8'),
- 'zu' => array('language' => 'Zulu', 'locale' => 'zul', 'localeFallback' => 'zul', 'charset' => 'utf-8'));
+ var $__l10nCatalog = array('af' => array('language' => 'Afrikaans', 'locale' => 'afr', 'localeFallback' => 'afr', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'ar' => array('language' => 'Arabic', 'locale' => 'ara', 'localeFallback' => 'ara', 'charset' => 'utf-8', 'direction' => 'rtl'),
+ 'ar-ae' => array('language' => 'Arabic (U.A.E.)', 'locale' => 'ar_ae', 'localeFallback' => 'ara', 'charset' => 'utf-8', 'direction' => 'rtl'),
+ 'ar-bh' => array('language' => 'Arabic (Bahrain)', 'locale' => 'ar_bh', 'localeFallback' => 'ara', 'charset' => 'utf-8', 'direction' => 'rtl'),
+ 'ar-dz' => array('language' => 'Arabic (Algeria)', 'locale' => 'ar_dz', 'localeFallback' => 'ara', 'charset' => 'utf-8', 'direction' => 'rtl'),
+ 'ar-eg' => array('language' => 'Arabic (Egypt)', 'locale' => 'ar_eg', 'localeFallback' => 'ara', 'charset' => 'utf-8', 'direction' => 'rtl'),
+ 'ar-iq' => array('language' => 'Arabic (Iraq)', 'locale' => 'ar_iq', 'localeFallback' => 'ara', 'charset' => 'utf-8', 'direction' => 'rtl'),
+ 'ar-jo' => array('language' => 'Arabic (Jordan)', 'locale' => 'ar_jo', 'localeFallback' => 'ara', 'charset' => 'utf-8', 'direction' => 'rtl'),
+ 'ar-kw' => array('language' => 'Arabic (Kuwait)', 'locale' => 'ar_kw', 'localeFallback' => 'ara', 'charset' => 'utf-8', 'direction' => 'rtl'),
+ 'ar-lb' => array('language' => 'Arabic (Lebanon)', 'locale' => 'ar_lb', 'localeFallback' => 'ara', 'charset' => 'utf-8', 'direction' => 'rtl'),
+ 'ar-ly' => array('language' => 'Arabic (Libya)', 'locale' => 'ar_ly', 'localeFallback' => 'ara', 'charset' => 'utf-8', 'direction' => 'rtl'),
+ 'ar-ma' => array('language' => 'Arabic (Morocco)', 'locale' => 'ar_ma', 'localeFallback' => 'ara', 'charset' => 'utf-8', 'direction' => 'rtl'),
+ 'ar-om' => array('language' => 'Arabic (Oman)', 'locale' => 'ar_om', 'localeFallback' => 'ara', 'charset' => 'utf-8', 'direction' => 'rtl'),
+ 'ar-qa' => array('language' => 'Arabic (Qatar)', 'locale' => 'ar_qa', 'localeFallback' => 'ara', 'charset' => 'utf-8', 'direction' => 'rtl'),
+ 'ar-sa' => array('language' => 'Arabic (Saudi Arabia)', 'locale' => 'ar_sa', 'localeFallback' => 'ara', 'charset' => 'utf-8', 'direction' => 'rtl'),
+ 'ar-sy' => array('language' => 'Arabic (Syria)', 'locale' => 'ar_sy', 'localeFallback' => 'ara', 'charset' => 'utf-8', 'direction' => 'rtl'),
+ 'ar-tn' => array('language' => 'Arabic (Tunisia)', 'locale' => 'ar_tn', 'localeFallback' => 'ara', 'charset' => 'utf-8', 'direction' => 'rtl'),
+ 'ar-ye' => array('language' => 'Arabic (Yemen)', 'locale' => 'ar_ye', 'localeFallback' => 'ara', 'charset' => 'utf-8', 'direction' => 'rtl'),
+ 'be' => array('language' => 'Byelorussian', 'locale' => 'bel', 'localeFallback' => 'bel', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'bg' => array('language' => 'Bulgarian', 'locale' => 'bul', 'localeFallback' => 'bul', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'bs' => array('language' => 'Bosnian', 'locale' => 'bos', 'localeFallback' => 'bos', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'ca' => array('language' => 'Catalan', 'locale' => 'cat', 'localeFallback' => 'cat', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'cs' => array('language' => 'Czech', 'locale' => 'cze', 'localeFallback' => 'cze', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'da' => array('language' => 'Danish', 'locale' => 'dan', 'localeFallback' => 'dan', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'de' => array('language' => 'German (Standard)', 'locale' => 'deu', 'localeFallback' => 'deu', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'de-at' => array('language' => 'German (Austria)', 'locale' => 'de_at', 'localeFallback' => 'deu', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'de-ch' => array('language' => 'German (Swiss)', 'locale' => 'de_ch', 'localeFallback' => 'deu', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'de-de' => array('language' => 'German (Germany)', 'locale' => 'de_de', 'localeFallback' => 'deu', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'de-li' => array('language' => 'German (Liechtenstein)', 'locale' => 'de_li', 'localeFallback' => 'deu', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'de-lu' => array('language' => 'German (Luxembourg)', 'locale' => 'de_lu', 'localeFallback' => 'deu', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'e' => array('language' => 'Greek', 'locale' => 'gre', 'localeFallback' => 'gre', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'el' => array('language' => 'Greek', 'locale' => 'gre', 'localeFallback' => 'gre', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'en' => array('language' => 'English', 'locale' => 'eng', 'localeFallback' => 'eng', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'en-au' => array('language' => 'English (Australian)', 'locale' => 'en_au', 'localeFallback' => 'eng', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'en-bz' => array('language' => 'English (Belize)', 'locale' => 'en_bz', 'localeFallback' => 'eng', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'en-ca' => array('language' => 'English (Canadian)', 'locale' => 'en_ca', 'localeFallback' => 'eng', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'en-gb' => array('language' => 'English (British)', 'locale' => 'en_gb', 'localeFallback' => 'eng', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'en-ie' => array('language' => 'English (Ireland)', 'locale' => 'en_ie', 'localeFallback' => 'eng', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'en-jm' => array('language' => 'English (Jamaica)', 'locale' => 'en_jm', 'localeFallback' => 'eng', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'en-nz' => array('language' => 'English (New Zealand)', 'locale' => 'en_nz', 'localeFallback' => 'eng', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'en-tt' => array('language' => 'English (Trinidad)', 'locale' => 'en_tt', 'localeFallback' => 'eng', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'en-us' => array('language' => 'English (United States)', 'locale' => 'en_us', 'localeFallback' => 'eng', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'en-za' => array('language' => 'English (South Africa)', 'locale' => 'en_za', 'localeFallback' => 'eng', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'es' => array('language' => 'Spanish (Spain - Traditional)', 'locale' => 'spa', 'localeFallback' => 'spa', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'es-ar' => array('language' => 'Spanish (Argentina)', 'locale' => 'es_ar', 'localeFallback' => 'spa', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'es-bo' => array('language' => 'Spanish (Bolivia)', 'locale' => 'es_bo', 'localeFallback' => 'spa', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'es-cl' => array('language' => 'Spanish (Chile)', 'locale' => 'es_cl', 'localeFallback' => 'spa', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'es-co' => array('language' => 'Spanish (Colombia)', 'locale' => 'es_co', 'localeFallback' => 'spa', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'es-cr' => array('language' => 'Spanish (Costa Rica)', 'locale' => 'es_cr', 'localeFallback' => 'spa', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'es-do' => array('language' => 'Spanish (Dominican Republic)', 'locale' => 'es_do', 'localeFallback' => 'spa', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'es-ec' => array('language' => 'Spanish (Ecuador)', 'locale' => 'es_ec', 'localeFallback' => 'spa', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'es-es' => array('language' => 'Spanish (Spain)', 'locale' => 'es_es', 'localeFallback' => 'spa', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'es-gt' => array('language' => 'Spanish (Guatemala)', 'locale' => 'es_gt', 'localeFallback' => 'spa', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'es-hn' => array('language' => 'Spanish (Honduras)', 'locale' => 'es_hn', 'localeFallback' => 'spa', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'es-mx' => array('language' => 'Spanish (Mexican)', 'locale' => 'es_mx', 'localeFallback' => 'spa', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'es-ni' => array('language' => 'Spanish (Nicaragua)', 'locale' => 'es_ni', 'localeFallback' => 'spa', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'es-pa' => array('language' => 'Spanish (Panama)', 'locale' => 'es_pa', 'localeFallback' => 'spa', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'es-pe' => array('language' => 'Spanish (Peru)', 'locale' => 'es_pe', 'localeFallback' => 'spa', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'es-pr' => array('language' => 'Spanish (Puerto Rico)', 'locale' => 'es_pr', 'localeFallback' => 'spa', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'es-py' => array('language' => 'Spanish (Paraguay)', 'locale' => 'es_py', 'localeFallback' => 'spa', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'es-sv' => array('language' => 'Spanish (El Salvador)', 'locale' => 'es_sv', 'localeFallback' => 'spa', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'es-uy' => array('language' => 'Spanish (Uruguay)', 'locale' => 'es_uy', 'localeFallback' => 'spa', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'es-ve' => array('language' => 'Spanish (Venezuela)', 'locale' => 'es_ve', 'localeFallback' => 'spa', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'et' => array('language' => 'Estonian', 'locale' => 'est', 'localeFallback' => 'est', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'eu' => array('language' => 'Basque', 'locale' => 'baq', 'localeFallback' => 'baq', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'fa' => array('language' => 'Farsi', 'locale' => 'per', 'localeFallback' => 'per', 'charset' => 'utf-8', 'direction' => 'rtl'),
+ 'fi' => array('language' => 'Finnish', 'locale' => 'fin', 'localeFallback' => 'fin', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'fo' => array('language' => 'Faeroese', 'locale' => 'fao', 'localeFallback' => 'fao', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'fr' => array('language' => 'French (Standard)', 'locale' => 'fre', 'localeFallback' => 'fre', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'fr-be' => array('language' => 'French (Belgium)', 'locale' => 'fr_be', 'localeFallback' => 'fre', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'fr-ca' => array('language' => 'French (Canadian)', 'locale' => 'fr_ca', 'localeFallback' => 'fre', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'fr-ch' => array('language' => 'French (Swiss)', 'locale' => 'fr_ch', 'localeFallback' => 'fre', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'fr-fr' => array('language' => 'French (France)', 'locale' => 'fr_fr', 'localeFallback' => 'fre', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'fr-lu' => array('language' => 'French (Luxembourg)', 'locale' => 'fr_lu', 'localeFallback' => 'fre', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'ga' => array('language' => 'Irish', 'locale' => 'gle', 'localeFallback' => 'gle', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'gd' => array('language' => 'Gaelic (Scots)', 'locale' => 'gla', 'localeFallback' => 'gla', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'gd-ie' => array('language' => 'Gaelic (Irish)', 'locale' => 'gd_ie', 'localeFallback' => 'gla', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'gl' => array('language' => 'Galician', 'locale' => 'glg', 'localeFallback' => 'glg', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'he' => array('language' => 'Hebrew', 'locale' => 'heb', 'localeFallback' => 'heb', 'charset' => 'utf-8', 'direction' => 'rtl'),
+ 'hi' => array('language' => 'Hindi', 'locale' => 'hin', 'localeFallback' => 'hin', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'hr' => array('language' => 'Croatian', 'locale' => 'hrv', 'localeFallback' => 'hrv', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'hu' => array('language' => 'Hungarian', 'locale' => 'hun', 'localeFallback' => 'hun', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'hy' => array('language' => 'Armenian - Armenia', 'locale' => 'hye', 'localeFallback' => 'hye', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'id' => array('language' => 'Indonesian', 'locale' => 'ind', 'localeFallback' => 'ind', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'in' => array('language' => 'Indonesian', 'locale' => 'ind', 'localeFallback' => 'ind', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'is' => array('language' => 'Icelandic', 'locale' => 'ice', 'localeFallback' => 'ice', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'it' => array('language' => 'Italian', 'locale' => 'ita', 'localeFallback' => 'ita', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'it-ch' => array('language' => 'Italian (Swiss) ', 'locale' => 'it_ch', 'localeFallback' => 'ita', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'ja' => array('language' => 'Japanese', 'locale' => 'jpn', 'localeFallback' => 'jpn', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'ko' => array('language' => 'Korean', 'locale' => 'kor', 'localeFallback' => 'kor', 'charset' => 'kr', 'direction' => 'ltr'),
+ 'ko-kp' => array('language' => 'Korea (North)', 'locale' => 'ko_kp', 'localeFallback' => 'kor', 'charset' => 'kr', 'direction' => 'ltr'),
+ 'ko-kr' => array('language' => 'Korea (South)', 'locale' => 'ko_kr', 'localeFallback' => 'kor', 'charset' => 'kr', 'direction' => 'ltr'),
+ 'koi8-r' => array('language' => 'Russian', 'locale' => 'koi8_r', 'localeFallback' => 'rus', 'charset' => 'koi8-r', 'direction' => 'ltr'),
+ 'lt' => array('language' => 'Lithuanian', 'locale' => 'lit', 'localeFallback' => 'lit', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'lv' => array('language' => 'Latvian', 'locale' => 'lav', 'localeFallback' => 'lav', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'mk' => array('language' => 'FYRO Macedonian', 'locale' => 'mk', 'localeFallback' => 'mac', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'mk-mk' => array('language' => 'Macedonian', 'locale' => 'mk_mk', 'localeFallback' => 'mac', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'ms' => array('language' => 'Malaysian', 'locale' => 'may', 'localeFallback' => 'may', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'mt' => array('language' => 'Maltese', 'locale' => 'mlt', 'localeFallback' => 'mlt', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'n' => array('language' => 'Dutch (Standard)', 'locale' => 'dut', 'localeFallback' => 'dut', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'nb' => array('language' => 'Norwegian Bokmal', 'locale' => 'nob', 'localeFallback' => 'nor', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'nl' => array('language' => 'Dutch (Standard)', 'locale' => 'dut', 'localeFallback' => 'dut', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'nl-be' => array('language' => 'Dutch (Belgium)', 'locale' => 'nl_be', 'localeFallback' => 'dut', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'nn' => array('language' => 'Norwegian Nynorsk', 'locale' => 'nno', 'localeFallback' => 'nor', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'no' => array('language' => 'Norwegian', 'locale' => 'nor', 'localeFallback' => 'nor', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'p' => array('language' => 'Polish', 'locale' => 'pol', 'localeFallback' => 'pol', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'pl' => array('language' => 'Polish', 'locale' => 'pol', 'localeFallback' => 'pol', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'pt' => array('language' => 'Portuguese (Portugal)', 'locale' => 'por', 'localeFallback' => 'por', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'pt-br' => array('language' => 'Portuguese (Brazil)', 'locale' => 'pt_br', 'localeFallback' => 'por', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'rm' => array('language' => 'Rhaeto-Romanic', 'locale' => 'roh', 'localeFallback' => 'roh', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'ro' => array('language' => 'Romanian', 'locale' => 'rum', 'localeFallback' => 'rum', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'ro-mo' => array('language' => 'Romanian (Moldavia)', 'locale' => 'ro_mo', 'localeFallback' => 'rum', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'ru' => array('language' => 'Russian', 'locale' => 'rus', 'localeFallback' => 'rus', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'ru-mo' => array('language' => 'Russian (Moldavia)', 'locale' => 'ru_mo', 'localeFallback' => 'rus', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'sb' => array('language' => 'Sorbian', 'locale' => 'wen', 'localeFallback' => 'wen', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'sk' => array('language' => 'Slovak', 'locale' => 'slo', 'localeFallback' => 'slo', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'sl' => array('language' => 'Slovenian', 'locale' => 'slv', 'localeFallback' => 'slv', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'sq' => array('language' => 'Albanian', 'locale' => 'alb', 'localeFallback' => 'alb', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'sr' => array('language' => 'Serbian', 'locale' => 'scc', 'localeFallback' => 'scc', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'sv' => array('language' => 'Swedish', 'locale' => 'swe', 'localeFallback' => 'swe', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'sv-fi' => array('language' => 'Swedish (Findland)', 'locale' => 'sv_fi', 'localeFallback' => 'swe', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'sx' => array('language' => 'Sutu', 'locale' => 'sx', 'localeFallback' => 'sx', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'sz' => array('language' => 'Sami (Lappish)', 'locale' => 'smi', 'localeFallback' => 'smi', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'th' => array('language' => 'Thai', 'locale' => 'tha', 'localeFallback' => 'tha', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'tn' => array('language' => 'Tswana', 'locale' => 'tsn', 'localeFallback' => 'tsn', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'tr' => array('language' => 'Turkish', 'locale' => 'tur', 'localeFallback' => 'tur', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'ts' => array('language' => 'Tsonga', 'locale' => 'tso', 'localeFallback' => 'tso', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'uk' => array('language' => 'Ukrainian', 'locale' => 'ukr', 'localeFallback' => 'ukr', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'ur' => array('language' => 'Urdu', 'locale' => 'urd', 'localeFallback' => 'urd', 'charset' => 'utf-8', 'direction' => 'rtl'),
+ 've' => array('language' => 'Venda', 'locale' => 'ven', 'localeFallback' => 'ven', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'vi' => array('language' => 'Vietnamese', 'locale' => 'vie', 'localeFallback' => 'vie', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'xh' => array('language' => 'Xhosa', 'locale' => 'xho', 'localeFallback' => 'xho', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'yi' => array('language' => 'Yiddish', 'locale' => 'yid', 'localeFallback' => 'yid', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'zh' => array('language' => 'Chinese', 'locale' => 'chi', 'localeFallback' => 'chi', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'zh-cn' => array('language' => 'Chinese (PRC)', 'locale' => 'zh_cn', 'localeFallback' => 'chi', 'charset' => 'GB2312', 'direction' => 'ltr'),
+ 'zh-hk' => array('language' => 'Chinese (Hong Kong)', 'locale' => 'zh_hk', 'localeFallback' => 'chi', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'zh-sg' => array('language' => 'Chinese (Singapore)', 'locale' => 'zh_sg', 'localeFallback' => 'chi', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'zh-tw' => array('language' => 'Chinese (Taiwan)', 'locale' => 'zh_tw', 'localeFallback' => 'chi', 'charset' => 'utf-8', 'direction' => 'ltr'),
+ 'zu' => array('language' => 'Zulu', 'locale' => 'zul', 'localeFallback' => 'zul', 'charset' => 'utf-8', 'direction' => 'ltr'));
/**
* Class constructor
@@ -368,6 +376,7 @@ class L10n extends Object {
$this->lang = $language;
$this->locale = $this->__l10nCatalog[$langKey]['locale'];
$this->charset = $this->__l10nCatalog[$langKey]['charset'];
+ $this->direction = $this->__l10nCatalog[$langKey]['direction'];
} else {
$this->lang = $language;
$this->languagePath = array($language);
diff --git a/cake/libs/model/behaviors/acl.php b/cake/libs/model/behaviors/acl.php
index 8bc2c3969..a103c5008 100644
--- a/cake/libs/model/behaviors/acl.php
+++ b/cake/libs/model/behaviors/acl.php
@@ -53,7 +53,11 @@ class AclBehavior extends ModelBehavior {
if (!class_exists('AclNode')) {
require LIBS . 'model' . DS . 'db_acl.php';
}
- $model->{$type} =& ClassRegistry::init($type);
+ if (PHP5) {
+ $model->{$type} = ClassRegistry::init($type);
+ } else {
+ $model->{$type} =& ClassRegistry::init($type);
+ }
if (!method_exists($model, 'parentNode')) {
trigger_error("Callback parentNode() not defined in {$model->alias}", E_USER_WARNING);
}
diff --git a/cake/libs/model/datasources/datasource.php b/cake/libs/model/datasources/datasource.php
index f016e2d18..99d3e8568 100644
--- a/cake/libs/model/datasources/datasource.php
+++ b/cake/libs/model/datasources/datasource.php
@@ -123,9 +123,9 @@ class DataSource extends Object {
var $_queriesLog = array();
/**
- * Maximum number of items in query log, to prevent query log taking over
- * too much memory on large amounts of queries -- I we've had problems at
- * >6000 queries on one system.
+ * Maximum number of items in query log
+ *
+ * This is to prevent query log taking over too much memory.
*
* @var int Maximum number of queries in the queries log.
* @access protected
@@ -270,7 +270,8 @@ class DataSource extends Object {
if ($this->cacheSources === false) {
return null;
}
- $table = $this->fullTableName($model, false);
+ $table = $model->tablePrefix . $model->table;
+
if (isset($this->__descriptions[$table])) {
return $this->__descriptions[$table];
}
@@ -374,7 +375,7 @@ class DataSource extends Object {
* To-be-overridden in subclasses.
*
* @param Model $model The model class having record(s) deleted
- * @param mixed $id Primary key of the model
+ * @param mixed $id Primary key of the model
* @access public
*/
function delete(&$model, $id = null) {
@@ -489,7 +490,7 @@ class DataSource extends Object {
* @param array $data Array of data with values that will be inserted in placeholders.
* @param string $association Name of association model being replaced
* @param unknown_type $assocData
- * @param Model $model Instance of the model to replace $__cakeID__$
+ * @param Model $model Instance of the model to replace $__cakeID__$
* @param Model $linkModel Instance of model to replace $__cakeForeignKey__$
* @param array $stack
* @return string String of query data with placeholders replaced.
diff --git a/cake/libs/model/model.php b/cake/libs/model/model.php
index 6cdd3ad8c..37b81245e 100644
--- a/cake/libs/model/model.php
+++ b/cake/libs/model/model.php
@@ -387,9 +387,34 @@ class Model extends Overloadable {
/**
* Constructor. Binds the model's database table to the object.
*
- * @param integer $id Set this ID for this model on startup
+ * If `$id` is an array it can be used to pass several options into the model.
+ *
+ * - id - The id to start the model on.
+ * - table - The table to use for this model.
+ * - ds - The connection name this model is connected to.
+ * - name - The name of the model eg. Post.
+ * - alias - The alias of the model, this is used for registering the instance in the `ClassRegistry`.
+ * eg. `ParentThread`
+ *
+ * ### Overriding Model's __construct method.
+ *
+ * When overriding Model::__construct() be careful to include and pass in all 3 of the
+ * arguments to `parent::__construct($id, $table, $ds);`
+ *
+ * ### Dynamically creating models
+ *
+ * You can dynamically create model instances using the the $id array syntax.
+ *
+ * {{{
+ * $Post = new Model(array('table' => 'posts', 'name' => 'Post', 'ds' => 'connection2'));
+ * }}}
+ *
+ * Would create a model attached to the posts table on connection2. Dynamic model creation is useful
+ * when you want a model object that contains no associations or attached behaviors.
+ *
+ * @param mixed $id Set this ID for this model on startup, can also be an array of options, see above.
* @param string $table Name of database table to use.
- * @param object $ds DataSource connection object.
+ * @param string $ds DataSource connection name.
*/
function __construct($id = false, $table = null, $ds = null) {
parent::__construct();
@@ -462,9 +487,6 @@ class Model extends Overloadable {
if ($this->useTable === null) {
$this->useTable = Inflector::tableize($this->name);
}
- if (method_exists($this, 'setTablePrefix')) {
- $this->setTablePrefix();
- }
$this->setSource($this->useTable);
if ($this->displayField == null) {
diff --git a/cake/libs/router.php b/cake/libs/router.php
index 61b5b2a77..92193b429 100644
--- a/cake/libs/router.php
+++ b/cake/libs/router.php
@@ -981,6 +981,27 @@ class Router {
return $out;
}
+/**
+ * Reverses a parsed parameter array into a string. Works similarily to Router::url(), but
+ * Since parsed URL's contain additional 'pass' and 'named' as well as 'url.url' keys.
+ * Those keys need to be specially handled in order to reverse a params array into a string url.
+ *
+ * @param array $param The params array that needs to be reversed.
+ * @return string The string that is the reversed result of the array
+ * @access public
+ */
+ function reverse($params) {
+ $pass = $params['pass'];
+ $named = $params['named'];
+ $url = $params['url'];
+ unset($params['pass'], $params['named'], $params['paging'], $params['models'], $params['url'], $url['url']);
+ $params = array_merge($params, $pass, $named);
+ if (!empty($url)) {
+ $params['?'] = $url;
+ }
+ return Router::url($params);
+ }
+
/**
* Normalizes a URL for purposes of comparison
*
diff --git a/cake/libs/sanitize.php b/cake/libs/sanitize.php
index ef3d7dbaf..9492acbdb 100644
--- a/cake/libs/sanitize.php
+++ b/cake/libs/sanitize.php
@@ -35,6 +35,7 @@ class Sanitize {
* Removes any non-alphanumeric characters.
*
* @param string $string String to sanitize
+ * @param array $allowed An array of additional characters that are not to be removed.
* @return string Sanitized string
* @access public
* @static
@@ -79,22 +80,39 @@ class Sanitize {
/**
* Returns given string safe for display as HTML. Renders entities.
+ *
+ * strip_tags() does not validating HTML syntax or structure, so it might strip whole passages
+ * with broken HTML.
+ *
+ * ### Options:
+ *
+ * - remove (boolean) if true strips all HTML tags before encoding
+ * - charset (string) the charset used to encode the string
+ * - quotes (int) see http://php.net/manual/en/function.htmlentities.php
*
* @param string $string String from where to strip tags
- * @param boolean $remove If true, the string is stripped of all HTML tags
+ * @param array $options Array of options to use.
* @return string Sanitized string
* @access public
* @static
*/
- function html($string, $remove = false) {
- if ($remove) {
+ function html($string, $options = array()) {
+ $default = array(
+ 'remove' => false,
+ 'charset' => 'UTF-8',
+ 'quotes' => ENT_QUOTES
+ );
+
+ $options = array_merge($default, $options);
+
+ if ($options['remove']) {
$string = strip_tags($string);
- } else {
- $patterns = array("/\&/", "/%/", "/", "/>/", '/"/', "/'/", "/\(/", "/\)/", "/\+/", "/-/");
- $replacements = array("&", "%", "<", ">", """, "'", "(", ")", "+", "-");
- $string = preg_replace($patterns, $replacements, $string);
}
- return $string;
+ $encoding = Configure::read('App.encoding');
+ if (empty($encoding)) {
+ $encoding = $options['charset'];
+ }
+ return htmlentities($string, $options['quotes'], $encoding);
}
/**
@@ -155,6 +173,10 @@ class Sanitize {
* Strips the specified tags from output. First parameter is string from
* where to remove tags. All subsequent parameters are tags.
*
+ * Ex.`$clean = Sanitize::stripTags($dirty, 'b', 'p', 'div');`
+ *
+ * Will remove all ``, ``, and `
` tags from the $dirty string.
+ *
* @param string $str String to sanitize
* @param string $tag Tag to remove (add more parameters as needed)
* @return string sanitized String
@@ -175,8 +197,16 @@ class Sanitize {
/**
* Sanitizes given array or value for safe input. Use the options to specify
* the connection to use, and what filters should be applied (with a boolean
- * value). Valid filters: odd_spaces, encode, dollar, carriage, unicode,
- * escape, backslash.
+ * value). Valid filters:
+ *
+ * - odd_spaces - removes any non space whitespace characters
+ * - encode - Encode any html entities. Encode must be true for the `remove_html` to work.
+ * - dollar - Escape `$` with `\$`
+ * - carriage - Remove `\r`
+ * - unicode -
+ * - escape - Should the string be SQL escaped.
+ * - backslash -
+ * - remove_html - Strip HTML with strip_tags. `encode` must be true for this option to work.
*
* @param mixed $data Data to sanitize
* @param mixed $options If string, DB connection being used, otherwise set of options
@@ -198,6 +228,7 @@ class Sanitize {
$options = array_merge(array(
'connection' => 'default',
'odd_spaces' => true,
+ 'remove_html' => false,
'encode' => true,
'dollar' => true,
'carriage' => true,
@@ -216,7 +247,7 @@ class Sanitize {
$data = str_replace(chr(0xCA), '', str_replace(' ', ' ', $data));
}
if ($options['encode']) {
- $data = Sanitize::html($data);
+ $data = Sanitize::html($data, array('remove' => $options['remove_html']));
}
if ($options['dollar']) {
$data = str_replace("\\\$", "$", $data);
diff --git a/cake/libs/validation.php b/cake/libs/validation.php
index 22eb09911..eeb23030f 100644
--- a/cake/libs/validation.php
+++ b/cake/libs/validation.php
@@ -501,8 +501,13 @@ class Validation extends Object {
}
if ($return === true && preg_match('/@(' . $_this->__pattern['hostname'] . ')$/i', $_this->check, $regs)) {
- $host = gethostbynamel($regs[1]);
- return is_array($host);
+ if (function_exists('getmxrr')) {
+ return getmxrr($regs[1], $mxhosts);
+ }
+ if (function_exists('checkdnsrr')) {
+ return checkdnsrr($regs[1], 'MX');
+ }
+ return is_array(gethostbynamel($regs[1]));
}
return false;
}
@@ -833,6 +838,20 @@ class Validation extends Object {
return $_this->_check();
}
+/**
+ * Checks that a value is a valid uuid - http://tools.ietf.org/html/rfc4122
+ *
+ * @param string $check Value to check
+ * @return boolean Success
+ * @access public
+ */
+ function uuid($check) {
+ $_this =& Validation::getInstance();
+ $_this->check = $check;
+ $_this->regex = '/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/i';
+ return $_this->_check();
+ }
+
/**
* Checks that a value is a valid URL according to http://www.w3.org/Addressing/URL/url-spec.txt
*
diff --git a/cake/libs/view/helpers/cache.php b/cake/libs/view/helpers/cache.php
index 718784a27..0d8357ae9 100644
--- a/cake/libs/view/helpers/cache.php
+++ b/cake/libs/view/helpers/cache.php
@@ -67,68 +67,34 @@ class CacheHelper extends AppHelper {
$cacheTime = 0;
$useCallbacks = false;
if (is_array($this->cacheAction)) {
- $controller = Inflector::underscore($this->controllerName);
- $controllerAlternate = Inflector::variable($this->controllerName);
-
- $check = str_replace('/', '_', $this->here);
- $basePath = str_replace('/', '_', $this->base);
-
- $match = str_replace($this->base, '', $this->here);
- $match = str_replace('//', '/', $match);
- $match = str_replace('/' . $controller . '/', '', $match);
- $match = str_replace('/' . $controllerAlternate . '/', '', $match);
- $match = str_replace('/' . $this->controllerName . '/', '', $match);
-
- $check = str_replace($basePath, '', $check);
- $check = str_replace('_' . $controller . '_', '', $check);
- $check = str_replace('_' . $this->controllerName . '_', '', $check);
- $check = str_replace('_' . $controllerAlternate . '_', '', $match);
-
- $check = Inflector::slug($check);
- $check = trim($check, '_');
-
- $keys = str_replace('/', '_', array_keys($this->cacheAction));
- $found = array_keys($this->cacheAction);
+ $keys = array_keys($this->cacheAction);
$index = null;
- $count = 0;
- foreach ($keys as $key => $value) {
- if (strpos($check, rtrim($value, '_')) === 0) {
- $index = $found[$count];
+ foreach ($keys as $action) {
+ if ($action == $this->params['action']) {
+ $index = $action;
break;
}
- $count++;
}
- if (isset($index)) {
- $pos1 = strrpos($match, '/');
- $char = strlen($match) - 1;
-
- if ($pos1 == $char) {
- $match = substr($match, 0, $char);
- }
-
- $key = $match;
- } elseif ($this->action == 'index') {
+ if (!isset($index) && $this->action == 'index') {
$index = 'index';
}
$options = $this->cacheAction;
if (isset($this->cacheAction[$index])) {
if (is_array($this->cacheAction[$index])) {
- $options = array_merge(array('duration'=> 0, 'callbacks' => false), $this->cacheAction[$index]);
+ $options = array_merge(array('duration' => 0, 'callbacks' => false), $this->cacheAction[$index]);
} else {
$cacheTime = $this->cacheAction[$index];
}
}
-
- if (array_key_exists('duration', $options)) {
+ if (isset($options['duration'])) {
$cacheTime = $options['duration'];
}
- if (array_key_exists('callbacks', $options)) {
+ if (isset($options['callbacks'])) {
$useCallbacks = $options['callbacks'];
}
-
} else {
$cacheTime = $this->cacheAction;
}
@@ -263,8 +229,6 @@ class CacheHelper extends AppHelper {
$controller->layout = $this->layout = \'' . $this->layout. '\';
$controller->webroot = $this->webroot = \'' . $this->webroot . '\';
$controller->here = $this->here = \'' . $this->here . '\';
- $controller->namedArgs = $this->namedArgs = \'' . $this->namedArgs . '\';
- $controller->argSeparator = $this->argSeparator = \'' . $this->argSeparator . '\';
$controller->params = $this->params = unserialize(stripslashes(\'' . addslashes(serialize($this->params)) . '\'));
$controller->action = $this->action = unserialize(\'' . serialize($this->action) . '\');
$controller->data = $this->data = unserialize(stripslashes(\'' . addslashes(serialize($this->data)) . '\'));
@@ -286,6 +250,7 @@ class CacheHelper extends AppHelper {
$camelBackedHelper = Inflector::variable($helper);
${$camelBackedHelper} =& $loadedHelpers[$helper];
$this->loaded[$camelBackedHelper] =& ${$camelBackedHelper};
+ $this->{$helper} =& $loadedHelpers[$helper];
}
?>';
$content = preg_replace("/(<\\?xml)/", "",$content);
diff --git a/cake/libs/view/helpers/form.php b/cake/libs/view/helpers/form.php
index 69c207db2..e8023ba96 100755
--- a/cake/libs/view/helpers/form.php
+++ b/cake/libs/view/helpers/form.php
@@ -661,9 +661,7 @@ class FormHelper extends AppHelper {
$this->_introspectModel($modelKey);
}
- $userType = isset($options['type']) ? true : false;
-
- if (!$userType) {
+ if (!isset($options['type'])) {
$options['type'] = 'text';
$fieldDef = array();
if (isset($options['options'])) {
@@ -693,6 +691,9 @@ class FormHelper extends AppHelper {
$options['type'] = 'hidden';
}
}
+ if (preg_match('/_id$/', $fieldKey)) {
+ $options['type'] = 'select';
+ }
if ($modelKey === $fieldKey) {
$options['type'] = 'select';
@@ -701,18 +702,15 @@ class FormHelper extends AppHelper {
}
}
}
- $types = array('text', 'checkbox', 'radio', 'select');
+ $types = array('checkbox', 'radio', 'select');
- if (!isset($options['options']) && in_array($options['type'], $types) && !$userType) {
+ if (!isset($options['options']) && in_array($options['type'], $types)) {
$view =& ClassRegistry::getObject('view');
$varName = Inflector::variable(
Inflector::pluralize(preg_replace('/_id$/', '', $fieldKey))
);
$varOptions = $view->getVar($varName);
if (is_array($varOptions)) {
- if ($options['type'] !== 'radio') {
- $options['type'] = 'select';
- }
$options['options'] = $varOptions;
}
}
@@ -1312,7 +1310,12 @@ class FormHelper extends AppHelper {
$style = ($attributes['multiple'] === 'checkbox') ? 'checkbox' : null;
$template = ($style) ? 'checkboxmultiplestart' : 'selectmultiplestart';
$tag = $this->Html->tags[$template];
- $select[] = $this->hidden(null, array('value' => '', 'id' => null, 'secure' => false));
+ $hiddenAttributes = array(
+ 'value' => '',
+ 'id' => $attributes['id'] . ($style ? '' : '_'),
+ 'secure' => false
+ );
+ $select[] = $this->hidden(null, $hiddenAttributes);
} else {
$tag = $this->Html->tags['selectstart'];
}
diff --git a/cake/libs/view/scaffolds/edit.ctp b/cake/libs/view/scaffolds/edit.ctp
index 0faa8c591..3bbaa3291 100644
--- a/cake/libs/view/scaffolds/edit.ctp
+++ b/cake/libs/view/scaffolds/edit.ctp
@@ -25,6 +25,7 @@
?>
+
action != 'add'):?>
- Html->link(__('Delete', true), array('action' => 'delete', $this->Form->value($modelClass.'.'.$primaryKey)), null, __('Are you sure you want to delete', true).' #' . $this->Form->value($modelClass.'.'.$primaryKey)); ?>
diff --git a/cake/libs/view/scaffolds/index.ctp b/cake/libs/view/scaffolds/index.ctp
index d38bd9738..b94cc9110 100644
--- a/cake/libs/view/scaffolds/index.ctp
+++ b/cake/libs/view/scaffolds/index.ctp
@@ -19,11 +19,6 @@
?>
-
Paginator->counter(array(
- 'format' => __('Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%', true)
-));
-?>
@@ -67,13 +62,19 @@ endforeach;
echo "\n";
?>
-
-
-Paginator->prev('<< ' . __('previous', true), array(), null, array('class' => 'disabled')) . "\n";?>
- | Paginator->numbers() . "\n"?>
-Paginator->next(__('next', true) .' >>', array(), null, array('class' => 'disabled')) . "\n";?>
+
Paginator->counter(array(
+ 'format' => __('Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%', true)
+ ));
+ ?>
+
+ Paginator->prev('<< ' . __('previous', true), array(), null, array('class' => 'disabled')) . "\n";?>
+ | Paginator->numbers() . "\n"?>
+ Paginator->next(__('next', true) .' >>', array(), null, array('class' => 'disabled')) . "\n";?>
+
+
- Html->link(sprintf(__('New %s', true), $singularHumanName), array('action' => 'add')); ?>
+
" .$this->Html->link(sprintf(__('Edit %s', true), $singularHumanName), array('action' => 'edit', ${$singularVar}[$modelClass][$primaryKey])). " \n";
diff --git a/cake/libs/view/view.php b/cake/libs/view/view.php
index e435eb23b..05917c107 100644
--- a/cake/libs/view/view.php
+++ b/cake/libs/view/view.php
@@ -732,10 +732,6 @@ class View extends Object {
* @return array
*/
function &_loadHelpers(&$loaded, $helpers, $parent = null) {
- if (empty($loaded)) {
- $helpers[] = 'Session';
- }
-
foreach ($helpers as $i => $helper) {
$options = array();
diff --git a/cake/tests/cases/dispatcher.test.php b/cake/tests/cases/dispatcher.test.php
index 0d9e86235..2b99cd827 100644
--- a/cake/tests/cases/dispatcher.test.php
+++ b/cake/tests/cases/dispatcher.test.php
@@ -449,8 +449,9 @@ class TestCachedPagesController extends AppController {
* @access public
*/
var $cacheAction = array(
- 'index'=> '+2 sec', 'test_nocache_tags'=>'+2 sec',
- 'view/' => '+2 sec'
+ 'index' => '+2 sec',
+ 'test_nocache_tags' => '+2 sec',
+ 'view' => '+2 sec'
);
/**
@@ -2097,9 +2098,8 @@ class DispatcherTest extends CakeTestCase {
$filename = $this->__cachePath($dispatcher->here);
$this->assertTrue(file_exists($filename));
unlink($filename);
-
- $url = 'TestCachedPages/test_nocache_tags';
}
+
/**
* test that cached() registers a view and un-registers it. Tests
* that helpers using ClassRegistry::getObject('view'); don't fail
@@ -2139,7 +2139,6 @@ class DispatcherTest extends CakeTestCase {
$this->assertEqual($result, $expected);
$filename = $this->__cachePath($dispatcher->here);
- unlink($filename);
ClassRegistry::flush();
}
diff --git a/cake/tests/cases/libs/code_coverage_manager.test.php b/cake/tests/cases/libs/code_coverage_manager.test.php
index cfc5968b2..a2e730c60 100644
--- a/cake/tests/cases/libs/code_coverage_manager.test.php
+++ b/cake/tests/cases/libs/code_coverage_manager.test.php
@@ -18,8 +18,7 @@
* @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License
*/
require_once CAKE . 'tests' . DS . 'lib' . DS . 'code_coverage_manager.php';
-require_once CAKE . 'tests' . DS . 'lib' . DS . 'cli_reporter.php';
-require_once CAKE . 'tests' . DS . 'lib' . DS . 'cake_reporter.php';
+require_once CAKE . 'tests' . DS . 'lib' . DS . 'reporter' . DS . 'cake_cli_reporter.php';
/**
* CodeCoverageManagerTest class
@@ -65,12 +64,13 @@ class CodeCoverageManagerTest extends CakeTestCase {
*/
function testNoTestCaseSupplied() {
if (PHP_SAPI != 'cli') {
- unset($_GET['group']);
- CodeCoverageManager::start(substr(md5(microtime()), 0, 5), new CakeHtmlReporter());
+ $reporter =& new CakeHtmlReporter(null, array('group' => false, 'app' => false, 'plugin' => false));
+
+ CodeCoverageManager::init(substr(md5(microtime()), 0, 5), $reporter);
CodeCoverageManager::report(false);
$this->assertError();
- CodeCoverageManager::start('tests' . DS . 'lib' . DS . basename(__FILE__), new CakeHtmlReporter());
+ CodeCoverageManager::init('tests' . DS . 'lib' . DS . basename(__FILE__), $reporter);
CodeCoverageManager::report(false);
$this->assertError();
@@ -96,7 +96,7 @@ class CodeCoverageManagerTest extends CakeTestCase {
$contents[1] = array_filter($contents[1], "remove");
foreach ($contents[1] as $file) {
- CodeCoverageManager::start('libs'.DS.$file, new CakeHtmlReporter());
+ CodeCoverageManager::init('libs'.DS.$file, $reporter);
CodeCoverageManager::report(false);
$this->assertNoErrors('libs'.DS.$file);
}
diff --git a/cake/tests/cases/libs/controller/component.test.php b/cake/tests/cases/libs/controller/component.test.php
index eaa19895f..50e63d9b9 100644
--- a/cake/tests/cases/libs/controller/component.test.php
+++ b/cake/tests/cases/libs/controller/component.test.php
@@ -452,7 +452,7 @@ class ComponentTest extends CakeTestCase {
$this->assertTrue(is_a($Controller->ParamTest, 'ParamTestComponent'));
$this->assertTrue(is_a($Controller->ParamTest->Banana, 'BananaComponent'));
$this->assertTrue(is_a($Controller->Orange, 'OrangeComponent'));
- $this->assertTrue(is_a($Controller->Session, 'SessionComponent'));
+ $this->assertFalse(isset($Controller->Session));
$this->assertEqual($Controller->Orange->settings, array('colour' => 'blood orange'));
$this->assertEqual($Controller->ParamTest->test, 'value');
$this->assertEqual($Controller->ParamTest->flag, true);
diff --git a/cake/tests/cases/libs/controller/components/auth.test.php b/cake/tests/cases/libs/controller/components/auth.test.php
index 202c53043..9f819fd01 100644
--- a/cake/tests/cases/libs/controller/components/auth.test.php
+++ b/cake/tests/cases/libs/controller/components/auth.test.php
@@ -237,7 +237,7 @@ class AuthTestController extends Controller {
* @var array
* @access public
*/
- var $components = array('Auth', 'Acl');
+ var $components = array('Session', 'Auth', 'Acl');
/**
* testUrl property
@@ -382,7 +382,7 @@ class AjaxAuthController extends Controller {
* @var array
* @access public
*/
- var $components = array('TestAuth');
+ var $components = array('Session', 'TestAuth');
/**
* uses property
@@ -514,6 +514,7 @@ class AuthTest extends CakeTestCase {
$_ENV = $this->_env;
Configure::write('Acl', $this->_acl);
Configure::write('Security.salt', $this->_securitySalt);
+
$this->Controller->Session->delete('Auth');
$this->Controller->Session->delete('Message.auth');
ClassRegistry::flush();
@@ -623,6 +624,31 @@ class AuthTest extends CakeTestCase {
$this->Controller->Session->delete('Auth');
}
+/**
+ * test that being redirected to the login page, with no post data does
+ * not set the session value. Saving the session value in this circumstance
+ * can cause the user to be redirected to an already public page.
+ *
+ * @return void
+ */
+ function testLoginActionNotSettingAuthRedirect() {
+ $_referer = $_SERVER['HTTP_REFERER'];
+ $_SERVER['HTTP_REFERER'] = '/pages/display/about';
+
+ $this->Controller->data = array();
+ $this->Controller->params = Router::parse('auth_test/login');
+ $this->Controller->params['url']['url'] = 'auth_test/login';
+ $this->Controller->Session->delete('Auth');
+
+ $this->Controller->Auth->loginRedirect = '/users/dashboard';
+ $this->Controller->Auth->loginAction = 'auth_test/login';
+ $this->Controller->Auth->userModel = 'AuthUser';
+
+ $this->Controller->Auth->startup($this->Controller);
+ $redirect = $this->Controller->Session->read('Auth.redirect');
+ $this->assertNull($redirect);
+ }
+
/**
* testAuthorizeFalse method
*
@@ -1514,7 +1540,8 @@ class AuthTest extends CakeTestCase {
'loginAction' => array('controller' => 'people', 'action' => 'login'),
'userModel' => 'AuthUserCustomField',
'sessionKey' => 'AltAuth.AuthUserCustomField'
- )
+ ),
+ 'Session'
);
$this->Controller->Component->init($this->Controller);
$this->Controller->Component->initialize($this->Controller);
diff --git a/cake/tests/cases/libs/controller/components/email.test.php b/cake/tests/cases/libs/controller/components/email.test.php
index 073d120db..8c86600f4 100644
--- a/cake/tests/cases/libs/controller/components/email.test.php
+++ b/cake/tests/cases/libs/controller/components/email.test.php
@@ -150,7 +150,7 @@ class EmailTestController extends Controller {
* @var array
* @access public
*/
- var $components = array('EmailTest');
+ var $components = array('Session', 'EmailTest');
/**
* pageTitle property
diff --git a/cake/tests/cases/libs/controller/components/request_handler.test.php b/cake/tests/cases/libs/controller/components/request_handler.test.php
index 9f979c323..a05bd2177 100644
--- a/cake/tests/cases/libs/controller/components/request_handler.test.php
+++ b/cake/tests/cases/libs/controller/components/request_handler.test.php
@@ -241,8 +241,8 @@ class RequestHandlerComponentTest extends CakeTestCase {
$_SERVER['REQUEST_METHOD'] = 'PUT';
$_SERVER['CONTENT_TYPE'] = 'application/xml';
$this->RequestHandler->startup($this->Controller);
- $this->assertTrue(is_object($this->Controller->data));
- $this->assertEqual(strtolower(get_class($this->Controller->data)), 'xml');
+ $this->assertTrue(is_array($this->Controller->data));
+ $this->assertFalse(is_object($this->Controller->data));
}
/**
@@ -254,8 +254,8 @@ class RequestHandlerComponentTest extends CakeTestCase {
$_SERVER['REQUEST_METHOD'] = 'PUT';
$_SERVER['CONTENT_TYPE'] = 'application/xml; charset=UTF-8';
$this->RequestHandler->startup($this->Controller);
- $this->assertTrue(is_object($this->Controller->data));
- $this->assertEqual(strtolower(get_class($this->Controller->data)), 'xml');
+ $this->assertTrue(is_array($this->Controller->data));
+ $this->assertFalse(is_object($this->Controller->data));
}
/**
diff --git a/cake/tests/cases/libs/controller/components/security.test.php b/cake/tests/cases/libs/controller/components/security.test.php
index 6f5976d6f..cb83f947c 100644
--- a/cake/tests/cases/libs/controller/components/security.test.php
+++ b/cake/tests/cases/libs/controller/components/security.test.php
@@ -60,7 +60,7 @@ class SecurityTestController extends Controller {
* @var array
* @access public
*/
- var $components = array('TestSecurity');
+ var $components = array('Session', 'TestSecurity');
/**
* failed property
diff --git a/cake/tests/cases/libs/controller/controller.test.php b/cake/tests/cases/libs/controller/controller.test.php
index d07930815..1bbd3c6f8 100644
--- a/cake/tests/cases/libs/controller/controller.test.php
+++ b/cake/tests/cases/libs/controller/controller.test.php
@@ -318,7 +318,7 @@ class TestController extends AppController {
* @var array
* @access public
*/
- var $helpers = array('Xml');
+ var $helpers = array('Session', 'Xml');
/**
* components property
@@ -1077,7 +1077,7 @@ class ControllerTest extends CakeTestCase {
$Controller->uses = array();
$Controller->constructClasses();
- $this->assertTrue(isset($Controller->Session));
+ $this->assertFalse(isset($Controller->Session));
}
/**
diff --git a/cake/tests/cases/libs/controller/controller_merge_vars.test.php b/cake/tests/cases/libs/controller/controller_merge_vars.test.php
index 9009f00f6..200ce40f9 100644
--- a/cake/tests/cases/libs/controller/controller_merge_vars.test.php
+++ b/cake/tests/cases/libs/controller/controller_merge_vars.test.php
@@ -233,6 +233,6 @@ class ControllerMergeVarsTestCase extends CakeTestCase {
$Controller->uses = array();
$Controller->constructClasses();
- $this->assertTrue(isset($Controller->Session));
+ $this->assertFalse(isset($Controller->Session));
}
}
\ No newline at end of file
diff --git a/cake/tests/cases/libs/controller/pages_controller.test.php b/cake/tests/cases/libs/controller/pages_controller.test.php
index a1b5f5a87..7e24151ad 100644
--- a/cake/tests/cases/libs/controller/pages_controller.test.php
+++ b/cake/tests/cases/libs/controller/pages_controller.test.php
@@ -53,21 +53,21 @@ class PagesControllerTest extends CakeTestCase {
return;
}
- App::build(array('views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS, TEST_CAKE_CORE_INCLUDE_PATH . 'libs' . DS . 'view' . DS)));
+ App::build(array(
+ 'views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS, TEST_CAKE_CORE_INCLUDE_PATH . 'libs' . DS . 'view' . DS)
+ ));
$Pages =& new PagesController();
$Pages->viewPath = 'posts';
$Pages->display('index');
$this->assertPattern('/posts index/', $Pages->output);
$this->assertEqual($Pages->viewVars['page'], 'index');
- $this->assertEqual($Pages->pageTitle, 'Index');
$Pages->viewPath = 'themed';
$Pages->display('test_theme', 'posts', 'index');
$this->assertPattern('/posts index themed view/', $Pages->output);
$this->assertEqual($Pages->viewVars['page'], 'test_theme');
$this->assertEqual($Pages->viewVars['subpage'], 'posts');
- $this->assertEqual($Pages->pageTitle, 'Index');
}
}
?>
\ No newline at end of file
diff --git a/cake/tests/cases/libs/controller/scaffold.test.php b/cake/tests/cases/libs/controller/scaffold.test.php
index a7d1fe1f3..7604792b2 100644
--- a/cake/tests/cases/libs/controller/scaffold.test.php
+++ b/cake/tests/cases/libs/controller/scaffold.test.php
@@ -495,11 +495,12 @@ class ScaffoldViewTest extends CakeTestCase {
$this->assertPattern('/