<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.5 |
+ | CiviCRM version 4.6 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
| GNU Affero General Public License or the licensing of CiviCRM, |
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
-*/
+ */
/**
*
class CRM_Contact_Form_Location {
/**
- * Function to set variables up before form is built
+ * Set variables up before form is built
*
- * @param $form
+ * @param CRM_Core_Form $form
*
* @return void
*/
- static function preProcess(&$form) {
+ public static function preProcess(&$form) {
$form->_addBlockName = CRM_Utils_Request::retrieve('block', 'String', CRM_Core_DAO::$_nullObject);
$additionalblockCount = CRM_Utils_Request::retrieve('count', 'Positive', CRM_Core_DAO::$_nullObject);
$className = CRM_Utils_System::getClassName($form);
if (in_array($className, array(
- 'CRM_Event_Form_ManageEvent_Location', 'CRM_Contact_Form_Domain'))) {
- $form->_blocks = array('Address' => ts('Address'),
+ 'CRM_Event_Form_ManageEvent_Location',
+ 'CRM_Contact_Form_Domain',
+ ))) {
+ $form->_blocks = array(
+ 'Address' => ts('Address'),
'Email' => ts('Email'),
'Phone' => ts('Phone'),
);
}
/**
- * Function to build the form
+ * Build the form object
*
- * @param $form
+ * @param CRM_Core_Form $form
*
* @return void
- * @access public
*/
- static function buildQuickForm(&$form) {
+ public static function buildQuickForm(&$form) {
// required for subsequent AJAX requests.
$ajaxRequestBlocks = array();
$generateAjaxRequest = 0;
//build 1 instance of all blocks, without using ajax ...
foreach ($form->_blocks as $blockName => $label) {
- require_once (str_replace('_', DIRECTORY_SEPARATOR, 'CRM_Contact_Form_Edit_' . $blockName) . '.php');
+ require_once str_replace('_', DIRECTORY_SEPARATOR, 'CRM_Contact_Form_Edit_' . $blockName) . '.php';
$name = strtolower($blockName);
$instances = array(1);
$form->set($blockName . '_Block_Count', $instance);
$formName = 'CRM_Contact_Form_Edit_' . $blockName;
- $formName::buildQuickForm( $form );
+ $formName::buildQuickForm($form);
}
}
$form->assign('generateAjaxRequest', $generateAjaxRequest);
$form->assign('ajaxRequestBlocks', $ajaxRequestBlocks);
}
-}
+}