<?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);
$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'),
}
$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')) {
}
/**
- * 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.
$form->assign('generateAjaxRequest', $generateAjaxRequest);
$form->assign('ajaxRequestBlocks', $ajaxRequestBlocks);
}
+
}