Browse Source

Merge branch '2.0' of github.com:cakephp/cakephp into 2.0

Jose Lorenzo Rodriguez 14 years ago
parent
commit
17963e980b

+ 6 - 0
app/webroot/css/cake.generic.css

@@ -354,6 +354,7 @@ input[type=submit] {
 }
 form .submit input[type=submit] {
 	background:#62af56;
+	background-image: -webkit-gradient(linear, left top, left bottom, from(#76BF6B), to(#3B8230));
 	background-image: -webkit-linear-gradient(top, #76BF6B, #3B8230);
 	background-image: -moz-linear-gradient(top, #76BF6B, #3B8230);
 	border-color: #2d6324;
@@ -414,6 +415,7 @@ p.error,
 	background-repeat: repeat-x;
 	background-image: -moz-linear-gradient(top, #ffcc00, #E6B800);
 	background-image: -ms-linear-gradient(top, #ffcc00, #E6B800);
+	background-image: -webkit-gradient(linear, left top, left bottom, from(#ffcc00), to(#E6B800));
 	background-image: -webkit-linear-gradient(top, #ffcc00, #E6B800);
 	background-image: -o-linear-gradient(top, #ffcc00, #E6B800);
 	background-image: linear-gradient(top, #ffcc00, #E6B800);
@@ -442,6 +444,7 @@ p.error,
 	background-repeat: repeat-x;
 	background-image: -moz-linear-gradient(top, #ee5f5b, #c43c35);
 	background-image: -ms-linear-gradient(top, #ee5f5b, #c43c35);
+	background-image: -webkit-gradient(linear, left top, left bottom, from(#ee5f5b), to(#c43c35));
 	background-image: -webkit-linear-gradient(top, #ee5f5b, #c43c35);
 	background-image: -o-linear-gradient(top, #ee5f5b, #c43c35);
 	background-image: linear-gradient(top, #ee5f5b, #c43c35);
@@ -453,6 +456,7 @@ p.error,
 	border: 1px solid rgba(0, 0, 0, 0.5);
 	background: #3B8230;
 	background-repeat: repeat-x;
+	background-image: -webkit-gradient(linear, left top, left bottom, from(#76BF6B), to(#3B8230));
 	background-image: -webkit-linear-gradient(top, #76BF6B, #3B8230);
 	background-image: -moz-linear-gradient(top, #76BF6B, #3B8230);
 	background-image: -ms-linear-gradient(top, #76BF6B, #3B8230);
@@ -505,6 +509,7 @@ input[type=submit],
 	font-weight:normal;
 	padding: 4px 8px;
 	background: #dcdcdc;
+	background-image: -webkit-gradient(linear, left top, left bottom, from(#fefefe), to(#dcdcdc));
 	background-image: -webkit-linear-gradient(top, #fefefe, #dcdcdc);
 	background-image: -moz-linear-gradient(top, #fefefe, #dcdcdc);
 	background-image: -ms-linear-gradient(top, #fefefe, #dcdcdc);
@@ -534,6 +539,7 @@ input[type=submit]:active,
 .actions ul li a:active,
 .actions a:active {
 	background: #eee;
+	background-image: -webkit-gradient(linear, left top, left bottom, from(#dfdfdf), to(#eee));
 	background-image: -webkit-linear-gradient(top, #dfdfdf, #eee);
 	background-image: -moz-linear-gradient(top, #dfdfdf, #eee);
 	background-image: -ms-linear-gradient(top, #dfdfdf, #eee);

+ 6 - 0
lib/Cake/Console/Templates/skel/webroot/css/cake.generic.css

@@ -354,6 +354,7 @@ input[type=submit] {
 }
 form .submit input[type=submit] {
 	background:#62af56;
+	background-image: -webkit-gradient(linear, left top, left bottom, from(#76BF6B), to(#3B8230));
 	background-image: -webkit-linear-gradient(top, #76BF6B, #3B8230);
 	background-image: -moz-linear-gradient(top, #76BF6B, #3B8230);
 	border-color: #2d6324;
@@ -414,6 +415,7 @@ p.error,
 	background-repeat: repeat-x;
 	background-image: -moz-linear-gradient(top, #ffcc00, #E6B800);
 	background-image: -ms-linear-gradient(top, #ffcc00, #E6B800);
+	background-image: -webkit-gradient(linear, left top, left bottom, from(#ffcc00), to(#E6B800));
 	background-image: -webkit-linear-gradient(top, #ffcc00, #E6B800);
 	background-image: -o-linear-gradient(top, #ffcc00, #E6B800);
 	background-image: linear-gradient(top, #ffcc00, #E6B800);
@@ -442,6 +444,7 @@ p.error,
 	background-repeat: repeat-x;
 	background-image: -moz-linear-gradient(top, #ee5f5b, #c43c35);
 	background-image: -ms-linear-gradient(top, #ee5f5b, #c43c35);
+	background-image: -webkit-gradient(linear, left top, left bottom, from(#ee5f5b), to(#c43c35));
 	background-image: -webkit-linear-gradient(top, #ee5f5b, #c43c35);
 	background-image: -o-linear-gradient(top, #ee5f5b, #c43c35);
 	background-image: linear-gradient(top, #ee5f5b, #c43c35);
@@ -453,6 +456,7 @@ p.error,
 	border: 1px solid rgba(0, 0, 0, 0.5);
 	background: #3B8230;
 	background-repeat: repeat-x;
+	background-image: -webkit-gradient(linear, left top, left bottom, from(#76BF6B), to(#3B8230));
 	background-image: -webkit-linear-gradient(top, #76BF6B, #3B8230);
 	background-image: -moz-linear-gradient(top, #76BF6B, #3B8230);
 	background-image: -ms-linear-gradient(top, #76BF6B, #3B8230);
@@ -505,6 +509,7 @@ input[type=submit],
 	font-weight:normal;
 	padding: 4px 8px;
 	background: #dcdcdc;
+	background-image: -webkit-gradient(linear, left top, left bottom, from(#fefefe), to(#dcdcdc));
 	background-image: -webkit-linear-gradient(top, #fefefe, #dcdcdc);
 	background-image: -moz-linear-gradient(top, #fefefe, #dcdcdc);
 	background-image: -ms-linear-gradient(top, #fefefe, #dcdcdc);
@@ -534,6 +539,7 @@ input[type=submit]:active,
 .actions ul li a:active,
 .actions a:active {
 	background: #eee;
+	background-image: -webkit-gradient(linear, left top, left bottom, from(#dfdfdf), to(#eee));
 	background-image: -webkit-linear-gradient(top, #dfdfdf, #eee);
 	background-image: -moz-linear-gradient(top, #dfdfdf, #eee);
 	background-image: -ms-linear-gradient(top, #dfdfdf, #eee);

+ 4 - 2
lib/Cake/Core/Object.php

@@ -65,8 +65,10 @@ class Object {
 			return false;
 		}
 		App::uses('Dispatcher', 'Routing');
-		if (in_array('return', $extra, true)) {
-			$extra = array_merge($extra, array('return' => 0, 'autoRender' => 1));
+		if (($index = array_search('return', $extra)) !== false) {
+			$extra['return'] = 0;
+			$extra['autoRender'] = 1;
+			unset($extra[$index]);
 		}
 		if (is_array($url) && !isset($extra['url'])) {
 			$extra['url'] = array();

+ 3 - 3
lib/Cake/Model/Model.php

@@ -177,12 +177,12 @@ class Model extends Object {
  * public $validate = array(
  *     'login' => array(
  *         array(
- *             'role' => 'alphaNumeric',
+ *             'rule' => 'alphaNumeric',
  *             'message' => 'Only alphabets and numbers allowed',
  *             'last' => true
  *         ),
  *         array(
- *             'role' => array('minLength', 8),
+ *             'rule' => array('minLength', 8),
  *             'message' => array('Minimum length of %d characters')
  *         )
  *     )
@@ -191,7 +191,7 @@ class Model extends Object {
  *
  * ### Valid keys in validations
  *
- * - `role`: String with method name, regular expression (started by slash) or array with method and parameters
+ * - `rule`: String with method name, regular expression (started by slash) or array with method and parameters
  * - `message`: String with the message or array if have multiple parameters. See http://php.net/sprintf
  * - `last`: Boolean value to indicate if continue validating the others rules if the current fail [Default: true]
  * - `required`: Boolean value to indicate if the field must be present on save

+ 22 - 10
lib/Cake/Test/Case/Core/ObjectTest.php

@@ -124,7 +124,16 @@ class RequestActionController extends Controller {
  * @return array
  */
 	public function params_pass() {
-		return $this->params;
+		return $this->request;
+	}
+
+	public function param_check() {
+		$this->autoRender = false;
+		$content = '';
+		if (isset($this->request->params[0])) {
+			$content = 'return found';
+		}
+		$this->response->body($content);
 	}
 }
 
@@ -565,6 +574,18 @@ class ObjectTest extends CakeTestCase {
 	}
 
 /**
+ * Test that requestAction() does not forward the 0 => return value.
+ *
+ * @return void
+ */
+	public function testRequestActionRemoveReturnParam() {
+		$result = $this->object->requestAction(
+			'/request_action/param_check', array('return')
+		);
+		$this->assertEquals('', $result, 'Return key was found');
+	}
+
+/**
  * Test that requestAction() is populating $this->params properly
  *
  * @return void
@@ -615,13 +636,4 @@ class ObjectTest extends CakeTestCase {
 
 		$_POST = $_tmp;
 	}
-
-/**
- * testCakeError
- *
- * @return void
- */
-	public function testCakeError() {
-
-	}
 }

+ 1 - 1
lib/Cake/View/Errors/missing_helper_class.ctp

@@ -33,7 +33,7 @@ class <?php echo $class;?> extends AppHelper {
 </pre>
 <p class="notice">
 	<strong><?php echo __d('cake_dev', 'Notice'); ?>: </strong>
-	<?php __d('cake_dev', 'If you want to customize this error message, create %s', APP_DIR . DS . 'View' . DS . 'Errors' . DS . 'missing_helper_class.ctp'); ?>
+	<?php echo __d('cake_dev', 'If you want to customize this error message, create %s', APP_DIR . DS . 'View' . DS . 'Errors' . DS . 'missing_helper_class.ctp'); ?>
 </p>
 
 <?php echo $this->element('exception_stack_trace'); ?>