INFRA-132 - Remove @static annotation
[civicrm-core.git] / CRM / Contact / Form / Search.php
index 077acf7c8a2be318980e36966e8331d1e197880a..a0f849701eb4cc961f5ab7b589860ebd60a73bad 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.5                                                |
+ | CiviCRM version 4.6                                                |
  +--------------------------------------------------------------------+
  | Copyright CiviCRM LLC (c) 2004-2014                                |
  +--------------------------------------------------------------------+
  */
 class CRM_Contact_Form_Search extends CRM_Core_Form_Search {
 
-  /*
+  /**
    * list of valid contexts
    *
    * @var array
-   * @static
    */
   static $_validContext = NULL;
 
   /**
-   * list of values used when we want to display other objects
+   * List of values used when we want to display other objects
    *
    * @var array
-   * @static
    */
   static $_modeValues = NULL;
 
@@ -63,50 +61,44 @@ class CRM_Contact_Form_Search extends CRM_Core_Form_Search {
    * The contextMenu
    *
    * @var array
-   * @access protected
    */
   protected $_contextMenu;
 
   /**
-   * the groupId retrieved from the GET vars
+   * The groupId retrieved from the GET vars
    *
    * @var int
-   * @access public
    */
   public $_groupID;
 
   /**
-   * the Group ID belonging to Add Member to group ID
+   * The Group ID belonging to Add Member to group ID
    * retrieved from the GET vars
    *
    * @var int
-   * @access protected
    */
   protected $_amtgID;
 
   /**
-   * the saved search ID retrieved from the GET vars
+   * The saved search ID retrieved from the GET vars
    *
    * @var int
-   * @access protected
    */
   protected $_ssID;
 
   /**
-   * the group elements
+   * The group elements
    *
    * @var array
-   * @access public
    */
   public $_group;
   public $_groupElement;
   public $_groupIterator;
 
   /**
-   * the tag elements
+   * The tag elements
    *
    * @var array
-   * @access protected
    */
   public $_tag;
   public $_tagElement;
@@ -115,7 +107,6 @@ class CRM_Contact_Form_Search extends CRM_Core_Form_Search {
    * The params used for search
    *
    * @var array
-   * @access protected
    */
   protected $_params;
 
@@ -123,7 +114,6 @@ class CRM_Contact_Form_Search extends CRM_Core_Form_Search {
    * The return properties used for search
    *
    * @var array
-   * @access protected
    */
   protected $_returnProperties;
 
@@ -131,7 +121,6 @@ class CRM_Contact_Form_Search extends CRM_Core_Form_Search {
    * The sort by character
    *
    * @var string
-   * @access protected
    */
   protected $_sortByCharacter;
 
@@ -139,16 +128,13 @@ class CRM_Contact_Form_Search extends CRM_Core_Form_Search {
    * The profile group id used for display
    *
    * @var integer
-   * @access protected
    */
   protected $_ufGroupID;
 
   /**
-   * csv - common search values
+   * Csv - common search values
    *
    * @var array
-   * @access protected
-   * @static
    */
   static $csv = array('contact_type', 'group', 'tag');
 
@@ -166,7 +152,7 @@ class CRM_Contact_Form_Search extends CRM_Core_Form_Search {
   protected $_modeValue;
 
   /**
-   * name of the selector to use
+   * Name of the selector to use
    */
   static $_selectorName = 'CRM_Contact_Selector';
   protected $_customSearchID = NULL;
@@ -175,13 +161,12 @@ class CRM_Contact_Form_Search extends CRM_Core_Form_Search {
   protected $_openedPanes = array();
 
   /**
-   * define the set of valid contexts that the search form operates on
+   * Define the set of valid contexts that the search form operates on
    *
-   * @return array the valid context set and the titles
-   * @access protected
-   * @static
+   * @return array
+   *   the valid context set and the titles
    */
-  static function &validContext() {
+  public static function &validContext() {
     if (!(self::$_validContext)) {
       self::$_validContext = array(
         'smog' => 'Show members of group',
@@ -201,12 +186,12 @@ class CRM_Contact_Form_Search extends CRM_Core_Form_Search {
    *
    * @return bool
    */
-  static function isSearchContext($context) {
+  public static function isSearchContext($context) {
     $searchContext = CRM_Utils_Array::value($context, self::validContext());
     return $searchContext ? TRUE : FALSE;
   }
 
-  static function setModeValues() {
+  public static function setModeValues() {
     if (!self::$_modeValues) {
       self::$_modeValues = array(
         1 => array(
@@ -290,7 +275,7 @@ class CRM_Contact_Form_Search extends CRM_Core_Form_Search {
    *
    * @return mixed
    */
-  static function getModeValue($mode = 1) {
+  public static function getModeValue($mode = 1) {
     self::setModeValues();
 
     if (!array_key_exists($mode, self::$_modeValues)) {
@@ -303,7 +288,7 @@ class CRM_Contact_Form_Search extends CRM_Core_Form_Search {
   /**
    * @return array
    */
-  static function getModeSelect() {
+  public static function getModeSelect() {
     self::setModeValues();
 
     $select = array();
@@ -330,11 +315,10 @@ class CRM_Contact_Form_Search extends CRM_Core_Form_Search {
   /**
    * Build the common elements between the search/advanced form
    *
-   * @access public
    *
    * @return void
    */
-  function buildQuickForm() {
+  public function buildQuickForm() {
     parent::buildQuickForm();
     CRM_Core_Resources::singleton()
       // jsTree is needed for tags popup
@@ -350,7 +334,7 @@ class CRM_Contact_Form_Search extends CRM_Core_Form_Search {
     }
     else {
       $className = $this->_modeValue['taskClassName'];
-      $tasks += $className::permissionedTaskTitles($permission, false);
+      $tasks += $className::permissionedTaskTitles($permission, FALSE);
     }
 
     if (isset($this->_ssID)) {
@@ -429,8 +413,8 @@ class CRM_Contact_Form_Search extends CRM_Core_Form_Search {
 
     // add the go button for the action form, note it is of type 'next' rather than of type 'submit'
     if ($this->_context === 'amtg') {
-        // check if _groupID exists, it might not if
-        // we are displaying a hidden group
+      // check if _groupID exists, it might not if
+      // we are displaying a hidden group
       if (!isset($this->_group[$this->_amtgID])) {
         $this->assign('permissionedForGroup', FALSE);
         $this->_group[$this->_amtgID] =
@@ -478,12 +462,11 @@ class CRM_Contact_Form_Search extends CRM_Core_Form_Search {
   }
 
   /**
-   * processing needed for buildForm and later
+   * Processing needed for buildForm and later
    *
    * @return void
-   * @access public
    */
-  function preProcess() {
+  public function preProcess() {
     // set the various class variables
 
     $this->_group = CRM_Core_PseudoConstant::group();
@@ -547,8 +530,8 @@ class CRM_Contact_Form_Search extends CRM_Core_Form_Search {
 
     // get user submitted values
     // get it from controller only if form has been submitted, else preProcess has set this
-    // $this->controller->isModal( ) returns true if page is
-    // valid, i.e all the validations are true
+    // $this->controller->isModal( ) returns TRUE if page is
+    // valid, i.e all the validations are TRUE
 
     if (!empty($_POST) && !$this->controller->isModal()) {
       $this->_formValues = $this->controller->exportValues($this->_name);
@@ -616,11 +599,17 @@ class CRM_Contact_Form_Search extends CRM_Core_Form_Search {
         // FIXME: we should generalise in a way that components could inject url-filters
         // just like they build their own form elements
         foreach (array(
-          'mailing_id', 'mailing_delivery_status', 'mailing_open_status',
-          'mailing_click_status', 'mailing_reply_status', 'mailing_optout',
-          'mailing_forward', 'mailing_unsubscribe', 'mailing_date_low',
-          'mailing_date_high',
-          ) as $mailingFilter) {
+                   'mailing_id',
+                   'mailing_delivery_status',
+                   'mailing_open_status',
+                   'mailing_click_status',
+                   'mailing_reply_status',
+                   'mailing_optout',
+                   'mailing_forward',
+                   'mailing_unsubscribe',
+                   'mailing_date_low',
+                   'mailing_date_high',
+                 ) as $mailingFilter) {
           $type = 'String';
           if ($mailingFilter == 'mailing_id' &&
             $filterVal = CRM_Utils_Request::retrieve('mailing_id', 'Positive', $this)
@@ -672,7 +661,7 @@ class CRM_Contact_Form_Search extends CRM_Core_Form_Search {
         $this->_params,
         $this->_returnProperties,
         $this->_action,
-        false, true,
+        FALSE, TRUE,
         $this->_context,
         $this->_contextMenu
       );
@@ -682,7 +671,7 @@ class CRM_Contact_Form_Search extends CRM_Core_Form_Search {
       $selector = new self::$_selectorName(
         $this->_params,
         $this->_action,
-        null, false, null,
+        NULL, FALSE, NULL,
         "search", "advanced"
       );
     }
@@ -729,7 +718,7 @@ class CRM_Contact_Form_Search extends CRM_Core_Form_Search {
   /**
    * @return array
    */
-  function &getFormValues() {
+  public function &getFormValues() {
     return $this->_formValues;
   }
 
@@ -737,9 +726,8 @@ class CRM_Contact_Form_Search extends CRM_Core_Form_Search {
    * Common post processing
    *
    * @return void
-   * @access public
    */
-  function postProcess() {
+  public function postProcess() {
     /*
      * sometime we do a postProcess early on, so we dont need to repeat it
      * this will most likely introduce some more bugs :(
@@ -754,7 +742,8 @@ class CRM_Contact_Form_Search extends CRM_Core_Form_Search {
     $crmPID = CRM_Utils_Request::retrieve('crmPID', 'Integer', CRM_Core_DAO::$_nullObject);
 
     if (array_key_exists($this->_searchButtonName, $_POST) ||
-      ($this->_force && !$crmPID)) {
+      ($this->_force && !$crmPID)
+    ) {
       //reset the cache table for new search
       $cacheKey = "civicrm search {$this->controller->_key}";
       CRM_Core_BAO_PrevNextCache::deleteItem(NULL, $cacheKey);
@@ -814,7 +803,7 @@ class CRM_Contact_Form_Search extends CRM_Core_Form_Search {
           $this->_params,
           $this->_returnProperties,
           $this->_action,
-          false,
+          FALSE,
           $searchChildGroups,
           $this->_context,
           $this->_contextMenu
@@ -822,12 +811,12 @@ class CRM_Contact_Form_Search extends CRM_Core_Form_Search {
         $setDynamic = TRUE;
       }
       else {
-        $selector = new  self::$_selectorName (
+        $selector = new self::$_selectorName(
           $this->_params,
           $this->_action,
-          null,
-          false,
-          null,
+          NULL,
+          FALSE,
+          NULL,
           "search",
           "advanced"
         );
@@ -866,9 +855,9 @@ class CRM_Contact_Form_Search extends CRM_Core_Form_Search {
   }
 
   /**
-   * @return null
+   * @return NULL
    */
-  function &returnProperties() {
+  public function &returnProperties() {
     return CRM_Core_DAO::$_nullObject;
   }
 
@@ -876,10 +865,8 @@ class CRM_Contact_Form_Search extends CRM_Core_Form_Search {
    * Return a descriptive name for the page, used in wizard header
    *
    * @return string
-   * @access public
    */
-  function getTitle() {
+  public function getTitle() {
     return ts('Search');
   }
 }
-