CRM-15626 fixes - Relationship Create Widget Not always showing the correct available...
[civicrm-core.git] / CRM / Core / Controller.php
index e9c7b031be5463f23f1e6d7b1e2335fbc4eefd75..d9715e457fc1757e4ec311cab118f1e2960747b3 100644 (file)
@@ -52,7 +52,7 @@ require_once 'HTML/QuickForm/Action/Direct.php';
 class CRM_Core_Controller extends HTML_QuickForm_Controller {
 
   /**
-   * the title associated with this controller
+   * The title associated with this controller
    *
    * @var string
    */
@@ -66,14 +66,14 @@ class CRM_Core_Controller extends HTML_QuickForm_Controller {
   public $_key;
 
   /**
-   * the name of the session scope where values are stored
+   * The name of the session scope where values are stored
    *
    * @var object
    */
   protected $_scope;
 
   /**
-   * the state machine associated with this controller
+   * The state machine associated with this controller
    *
    * @var object
    */
@@ -121,14 +121,14 @@ class CRM_Core_Controller extends HTML_QuickForm_Controller {
   public $_QFResponseType = 'html';
 
   /**
-   * cache the smarty template for efficiency reasons
+   * Cache the smarty template for efficiency reasons
    *
    * @var CRM_Core_Smarty
    */
   static protected $_template;
 
   /**
-   * cache the session for efficiency reasons
+   * Cache the session for efficiency reasons
    *
    * @var CRM_Core_Session
    */
@@ -159,22 +159,16 @@ class CRM_Core_Controller extends HTML_QuickForm_Controller {
   /**
    * All CRM single or multi page pages should inherit from this class.
    *
-   * @param null $title
-   * @param bool $modal
+   * @param string $title descriptive title of the controller
+   * @param bool $modal whether controller is modal
    * @param null $mode
-   * @param null $scope
-   * @param bool $addSequence
-   * @param bool $ignoreKey
-   *
-   * @internal param \title $string descriptive title of the controller
-   * @internal param \whether $boolean controller is modal
-   * @internal param \scope $string name of session if we want unique scope, used only by Controller_Simple
-   * @internal param \addSequence $boolean should we add a unique sequence number to the end of the key
-   * @internal param \ignoreKey $boolean should we not set a qfKey for this controller (for standalone forms)
+   * @param string $scope name of session if we want unique scope, used only by Controller_Simple
+   * @param bool $addSequence should we add a unique sequence number to the end of the key
+   * @param bool $ignoreKey should we not set a qfKey for this controller (for standalone forms)
    *
    * @access public
    *
-   * @return \CRM_Core_Controller
+   * @return CRM_Core_Controller
    */
   function __construct(
     $title = NULL,
@@ -239,8 +233,8 @@ class CRM_Core_Controller extends HTML_QuickForm_Controller {
         $this->_generateQFKey = FALSE;
       }
       elseif ($snippet == 5) {
-        // this is used for popups and inlined ajax forms
-        // also used for the various tabs via TabHeader
+        // mode deprecated in favor of json
+        // still used by dashlets, probably nothing else
         $this->_print = CRM_Core_Smarty::PRINT_NOFORM;
       }
       // Respond with JSON if in AJAX context (also support legacy value '6')
@@ -290,7 +284,7 @@ class CRM_Core_Controller extends HTML_QuickForm_Controller {
   }
 
   /**
-   * @param $name
+   * @param string $name
    * @param bool $addSequence
    * @param bool $ignoreKey
    *
@@ -413,9 +407,9 @@ class CRM_Core_Controller extends HTML_QuickForm_Controller {
   }
 
   /**
-   * getter method for stateMachine
+   * Getter method for stateMachine
    *
-   * @return object
+   * @return CRM_Core_StateMachine
    * @access public
    */
   function getStateMachine() {
@@ -423,9 +417,9 @@ class CRM_Core_Controller extends HTML_QuickForm_Controller {
   }
 
   /**
-   * setter method for stateMachine
+   * Setter method for stateMachine
    *
-   * @param object a stateMachineObject
+   * @param CRM_Core_StateMachine $stateMachine
    *
    * @return void
    * @access public
@@ -435,10 +429,10 @@ class CRM_Core_Controller extends HTML_QuickForm_Controller {
   }
 
   /**
-   * add pages to the controller. Note that the controller does not really care
+   * Add pages to the controller. Note that the controller does not really care
    * the order in which the pages are added
    *
-   * @param object $stateMachine the state machine object
+   * @param CRM_Core_StateMachine $stateMachine
    * @param \const|int $action the mode in which the state machine is operating
    *                              typicaly this will be add/view/edit
    *
@@ -500,7 +494,7 @@ class CRM_Core_Controller extends HTML_QuickForm_Controller {
   }
 
   /**
-   * function to destroy all the session state of the controller.
+   * Destroy all the session state of the controller.
    *
    * @access public
    *
@@ -512,7 +506,7 @@ class CRM_Core_Controller extends HTML_QuickForm_Controller {
   }
 
   /**
-   * virtual function to do any processing of data.
+   * Virtual function to do any processing of data.
    * Sometimes it is useful for the controller to actually process data.
    * This is typically used when we need the controller to figure out
    * what pages are potentially involved in this wizard. (this is dynamic
@@ -541,7 +535,7 @@ class CRM_Core_Controller extends HTML_QuickForm_Controller {
   /**
    * Get the variable from the form scope
    *
-   * @param  string name  : name  of the variable
+   * @param  string $name  : name  of the variable
    *
    * @access public
 
@@ -595,7 +589,7 @@ class CRM_Core_Controller extends HTML_QuickForm_Controller {
   }
 
   /**
-   * @param $wizard
+   * @param array $wizard
    */
   function addWizardStyle(&$wizard) {
     $wizard['style'] = array(
@@ -611,12 +605,11 @@ class CRM_Core_Controller extends HTML_QuickForm_Controller {
   }
 
   /**
-   * assign value to name in template
+   * Assign value to name in template
    *
-   * @param $var
+   * @param string $var
    * @param mixed $value value of varaible
    *
-   * @internal param array|string $name name  of variable
    * @return void
    * @access public
    */
@@ -625,12 +618,11 @@ class CRM_Core_Controller extends HTML_QuickForm_Controller {
   }
 
   /**
-   * assign value to name in template by reference
+   * Assign value to name in template by reference
    *
-   * @param $var
+   * @param string $var
    * @param mixed $value (reference) value of varaible
    *
-   * @internal param array|string $name name  of variable
    * @return void
    * @access public
    */
@@ -639,7 +631,7 @@ class CRM_Core_Controller extends HTML_QuickForm_Controller {
   }
 
   /**
-   * appends values to template variables
+   * Appends values to template variables
    *
    * @param array|string $tpl_var the template variable name(s)
    * @param mixed $value the value to append
@@ -654,7 +646,6 @@ class CRM_Core_Controller extends HTML_QuickForm_Controller {
    *
    * @param string $name
    *
-   * @internal param string $type
    * @return array
    */
   function get_template_vars($name=null) {
@@ -662,7 +653,7 @@ class CRM_Core_Controller extends HTML_QuickForm_Controller {
   }
 
   /**
-   * setter for embedded
+   * Setter for embedded
    *
    * @param boolean $embedded
    *
@@ -674,7 +665,7 @@ class CRM_Core_Controller extends HTML_QuickForm_Controller {
   }
 
   /**
-   * getter for embedded
+   * Getter for embedded
    *
    * @return boolean return the embedded value
    * @access public
@@ -684,7 +675,7 @@ class CRM_Core_Controller extends HTML_QuickForm_Controller {
   }
 
   /**
-   * setter for skipRedirection
+   * Setter for skipRedirection
    *
    * @param boolean $skipRedirection
    *
@@ -696,7 +687,7 @@ class CRM_Core_Controller extends HTML_QuickForm_Controller {
   }
 
   /**
-   * getter for skipRedirection
+   * Getter for skipRedirection
    *
    * @return boolean return the skipRedirection value
    * @access public
@@ -735,7 +726,7 @@ class CRM_Core_Controller extends HTML_QuickForm_Controller {
   }
 
   /**
-   * setter for print
+   * Setter for print
    *
    * @param boolean $print
    *
@@ -753,7 +744,7 @@ class CRM_Core_Controller extends HTML_QuickForm_Controller {
   }
 
   /**
-   * getter for print
+   * Getter for print
    *
    * @return boolean return the print value
    * @access public