Browse Source

doc update

euromark 13 years ago
parent
commit
11d070f802

+ 19 - 13
Model/Behavior/ConfirmableBehavior.php

@@ -1,16 +1,14 @@
 <?php
 <?php
 App::uses('ModelBehavior', 'Model');
 App::uses('ModelBehavior', 'Model');
 /**
 /**
- * ConfirmableBehavior allows forms to easily require a checkbox toggled (confirmed)
- * example: terms of use on registration
+ * ConfirmableBehavior allows forms to easily require a checkbox toggled (confirmed).
+ * Example: Terms of use on registration forms or some "confirm delete checkbox"
  *
  *
  * Copyright 2011, dereuromark (http://www.dereuromark.de)
  * Copyright 2011, dereuromark (http://www.dereuromark.de)
  *
  *
- * @link          http://github.com/dereuromark/
- * @license       http://www.opensource.org/licenses/mit-license.php The MIT License
- */
-
-/**
+ * @link http://github.com/dereuromark/
+ * @license http://www.opensource.org/licenses/mit-license.php The MIT License
+ * @link http://www.dereuromark.de/2011/07/05/introducing-two-cakephp-behaviors/
  * 2011-07-05 ms
  * 2011-07-05 ms
  */
  */
 class ConfirmableBehavior extends ModelBehavior {
 class ConfirmableBehavior extends ModelBehavior {
@@ -32,7 +30,12 @@ class ConfirmableBehavior extends ModelBehavior {
 		$this->settings[$Model->alias] = array_merge($this->settings[$Model->alias], is_array($settings) ? $settings : array());
 		$this->settings[$Model->alias] = array_merge($this->settings[$Model->alias], is_array($settings) ? $settings : array());
 	}
 	}
 
 
-
+	/**
+	 * ConfirmableBehavior::beforeValidate()
+	 * 
+	 * @param mixed $Model
+	 * @return bool $success
+	 */
 	public function beforeValidate(Model $Model) {
 	public function beforeValidate(Model $Model) {
 		$return = parent::beforeValidate($Model);
 		$return = parent::beforeValidate($Model);
 
 
@@ -45,6 +48,12 @@ class ConfirmableBehavior extends ModelBehavior {
 		return $return;
 		return $return;
 	}
 	}
 
 
+	/**
+	 * ConfirmableBehavior::beforeSave()
+	 * 
+	 * @param mixed $Model
+	 * @return mixed
+	 */
 	public function beforeSave(Model $Model) {
 	public function beforeSave(Model $Model) {
 		$return = parent::beforeSave($Model);
 		$return = parent::beforeSave($Model);
 
 
@@ -55,9 +64,8 @@ class ConfirmableBehavior extends ModelBehavior {
 		return $return;
 		return $return;
 	}
 	}
 
 
-
 	/**
 	/**
-	 * Run before a model is saved, used...
+	 * The actual logic
 	 *
 	 *
 	 * @param object $Model Model about to be saved.
 	 * @param object $Model Model about to be saved.
 	 * @return boolean true if save should proceed, false otherwise
 	 * @return boolean true if save should proceed, false otherwise
@@ -75,6 +83,4 @@ class ConfirmableBehavior extends ModelBehavior {
 		return $return;
 		return $return;
 	}
 	}
 
 
-
-}
-
+}

+ 3 - 6
Model/Behavior/JsonableBehavior.php

@@ -1,6 +1,4 @@
 <?php
 <?php
-App::uses('ModelBehavior', 'Model');
-
 /**
 /**
  * Copyright 2011, PJ Hile (http://www.pjhile.com)
  * Copyright 2011, PJ Hile (http://www.pjhile.com)
  *
  *
@@ -10,6 +8,7 @@ App::uses('ModelBehavior', 'Model');
  * @version    0.1
  * @version    0.1
  * @license    http://www.opensource.org/licenses/mit-license.php The MIT License
  * @license    http://www.opensource.org/licenses/mit-license.php The MIT License
  */
  */
+App::uses('ModelBehavior', 'Model');
 
 
 /**
 /**
  * A behavior that will json_encode (and json_decode) fields if they contain an array or specific pattern.
  * A behavior that will json_encode (and json_decode) fields if they contain an array or specific pattern.
@@ -17,9 +16,6 @@ App::uses('ModelBehavior', 'Model');
  * Requres: PHP 5 >= 5.2.0 or PECL json >= 1.2.0
  * Requres: PHP 5 >= 5.2.0 or PECL json >= 1.2.0
  *
  *
  * This is a port of the Serializeable behavior by Matsimitsu (http://www.matsimitsu.nl)
  * This is a port of the Serializeable behavior by Matsimitsu (http://www.matsimitsu.nl)
- */
-
-/**
  * Modified by Mark Scherer (http://www.dereuromark.de)
  * Modified by Mark Scherer (http://www.dereuromark.de)
  *
  *
  * Now supports different input/output formats:
  * Now supports different input/output formats:
@@ -28,7 +24,8 @@ App::uses('ModelBehavior', 'Model');
  * - can be used to create dynamic forms (and tables)
  * - can be used to create dynamic forms (and tables)
  *
  *
  * Also automatically cleans lists and works with custom separators etc
  * Also automatically cleans lists and works with custom separators etc
- *
+ * 
+ * @link http://www.dereuromark.de/2011/07/05/introducing-two-cakephp-behaviors/
  * 2011-07-04 ms
  * 2011-07-04 ms
  */
  */
 class JsonableBehavior extends ModelBehavior {
 class JsonableBehavior extends ModelBehavior {

+ 3 - 1
Model/Behavior/TypographicBehavior.php

@@ -21,9 +21,11 @@ App::uses('ModelBehavior', 'Model');
  * TODOS:
  * TODOS:
  * - respect primary and secondary quotations marks as well as alternatives
  * - respect primary and secondary quotations marks as well as alternatives
  *
  *
- * @link http://en.wikipedia.org/wiki/Non-English_usage_of_quotation_marks
+ * @author Mark Scherer
  * @cakephp 2.x
  * @cakephp 2.x
  * @license MIT
  * @license MIT
+ * @link http://www.dereuromark.de/2012/08/12/typographic-behavior-and-typography-helper/
+ * @link http://en.wikipedia.org/wiki/Non-English_usage_of_quotation_marks
  * 2011-01-13 ms
  * 2011-01-13 ms
  */
  */
 class TypographicBehavior extends ModelBehavior {
 class TypographicBehavior extends ModelBehavior {

+ 2 - 7
View/Helper/TypographyHelper.php

@@ -1,6 +1,4 @@
 <?php
 <?php
-App::uses('AppHelper', 'View/Helper');
-
 /**
 /**
  * CodeIgniter
  * CodeIgniter
  *
  *
@@ -14,18 +12,15 @@ App::uses('AppHelper', 'View/Helper');
  * @since		Version 1.0
  * @since		Version 1.0
  * @filesource
  * @filesource
  */
  */
+App::uses('AppHelper', 'View/Helper');
 
 
 /**
 /**
  * Typography Class converted to Cake Helper
  * Typography Class converted to Cake Helper
  *
  *
- * @access		private
- * @category	Helpers
- * @author		ExpressionEngine Dev Team
- * @link		http://codeigniter.com/user_guide/helpers/
- *
  * @modified Mark Scherer
  * @modified Mark Scherer
  * @cakephp 2.x
  * @cakephp 2.x
  * @php 5
  * @php 5
+ * @link http://www.dereuromark.de/2012/08/12/typographic-behavior-and-typography-helper/
  */
  */
 class TypographyHelper extends AppHelper {
 class TypographyHelper extends AppHelper {