more comment fixes
[civicrm-core.git] / CRM / Contact / Form / Location.php
index 8c2f938740bd1af5b62e08199f44cc8561960386..260d072ccb123cd6461ec0901b533658779e373d 100644 (file)
@@ -1,9 +1,9 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.6                                                |
+ | CiviCRM version 4.7                                                |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2014                                |
+ | Copyright CiviCRM LLC (c) 2004-2015                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
  | GNU Affero General Public License or the licensing of CiviCRM,     |
  | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
  +--------------------------------------------------------------------+
-*/
+ */
 
 /**
  *
  * @package CRM
- * @copyright CiviCRM LLC (c) 2004-2014
- * $Id$
- *
+ * @copyright CiviCRM LLC (c) 2004-2015
  */
 class CRM_Contact_Form_Location {
 
   /**
-   * Set variables up before form is built
+   * Set variables up before form is built.
    *
    * @param CRM_Core_Form $form
-   *
-   * @return void
    */
   public static function preProcess(&$form) {
     $form->_addBlockName = CRM_Utils_Request::retrieve('block', 'String', CRM_Core_DAO::$_nullObject);
@@ -53,11 +49,8 @@ class CRM_Contact_Form_Location {
       $form->set($form->_addBlockName . '_Block_Count', $additionalblockCount);
     }
 
-    $className = CRM_Utils_System::getClassName($form);
-    if (in_array($className, array(
-      'CRM_Event_Form_ManageEvent_Location',
-      'CRM_Contact_Form_Domain',
-    ))) {
+    if (is_a($form, 'CRM_Event_Form_ManageEvent_Location')
+    || is_a($form, 'CRM_Contact_Form_Domain')) {
       $form->_blocks = array(
         'Address' => ts('Address'),
         'Email' => ts('Email'),
@@ -66,7 +59,7 @@ class CRM_Contact_Form_Location {
     }
 
     $form->assign('blocks', $form->_blocks);
-    $form->assign('className', $className);
+    $form->assign('className', CRM_Utils_System::getClassName($form));
 
     // get address sequence.
     if (!$addressSequence = $form->get('addressSequence')) {
@@ -77,11 +70,9 @@ class CRM_Contact_Form_Location {
   }
 
   /**
-   * Build the form object
+   * Build the form object.
    *
    * @param CRM_Core_Form $form
-   *
-   * @return void
    */
   public static function buildQuickForm(&$form) {
     // required for subsequent AJAX requests.
@@ -122,4 +113,5 @@ class CRM_Contact_Form_Location {
     $form->assign('generateAjaxRequest', $generateAjaxRequest);
     $form->assign('ajaxRequestBlocks', $ajaxRequestBlocks);
   }
+
 }