<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.3 |
+ | CiviCRM version 4.6 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2013 |
+ | Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2013
+ * @copyright CiviCRM LLC (c) 2004-2014
* $Id$
*
*/
class CRM_Contact_Form_Location {
/**
- * Function to set variables up before form is built
+ * Set variables up before form is built
+ *
+ * @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);
}
/**
- * Function to build the form
+ * Build the form object
+ *
+ * @param CRM_Core_Form $form
*
- * @return None
- * @access public
+ * @return void
*/
- static function buildQuickForm(&$form) {
+ public static function buildQuickForm(&$form) {
// required for subsequent AJAX requests.
$ajaxRequestBlocks = array();
$generateAjaxRequest = 0;
$name = strtolower($blockName);
$instances = array(1);
- if (CRM_Utils_Array::value($name, $_POST) && is_array($_POST[$name])) {
+ if (!empty($_POST[$name]) && is_array($_POST[$name])) {
$instances = array_keys($_POST[$name]);
}
- elseif (property_exists($form, '_values') && CRM_Utils_Array::value($name, $form->_values) && is_array($form->_values[$name])) {
+ elseif (property_exists($form, '_values') && !empty($form->_values[$name]) && is_array($form->_values[$name])) {
$instances = array_keys($form->_values[$name]);
}
$form->assign('ajaxRequestBlocks', $ajaxRequestBlocks);
}
}
-