/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.4 |
+ | CiviCRM version 4.5 |
+--------------------------------------------------------------------+
- | 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$
*
*/
);
foreach ($this->_fields as $name => $field) {
- if ((substr($name, 0, 6) == 'custom') && CRM_Utils_Array::value('is_search_range', $field)) {
+ if ((substr($name, 0, 6) == 'custom') && !empty($field['is_search_range'])) {
$from = CRM_Utils_Request::retrieve($name . '_from', 'String',
$this, FALSE, NULL, 'REQUEST'
);
$customField = CRM_Utils_Array::value($name, $this->_customFields);
- if (!empty($_POST) && !CRM_Utils_Array::value($name, $_POST)) {
+ if (!empty($_POST) && empty($_POST[$name])) {
if ($customField) {
// reset checkbox/radio because a form does not send null checkbox values
if (in_array($customField['html_type'],
$this->assign('search', $this->_search);
// search if search returned a form error?
- if ((!CRM_Utils_Array::value('reset', $_GET) ||
- CRM_Utils_Array::value('force', $_GET)
- ) &&
+ if ((empty($_GET['reset']) || !empty($_GET['force'])) &&
!$searchError
) {
$this->assign('isReset', FALSE);
)
);
}
- if (CRM_Utils_Array::value('group', $this->_params)) {
+ if (!empty($this->_params['group'])) {
foreach ($this->_params['group'] as $key => $val) {
if (!$val) {
unset($this->_params['group'][$key]);
/**
* Function to get the list of contacts for a profile
*
- * @param $form object
+ * @param $gid
+ *
+ * @return array
+ * @internal param object $form
*
* @access public
*/
// add group id to params if a uf group belong to a any group
if ($groupId) {
- if (CRM_Utils_Array::value('group', $params)) {
+ if (!empty($params['group'])) {
$params['group'][$groupId] = 1;
}
else {
return $contactIds;
}
+ /**
+ * @param string $suffix
+ *
+ * @return null|string
+ */
function checkTemplateFileExists($suffix = '') {
if ($this->_gid) {
$templateFile = "CRM/Profile/Page/{$this->_gid}/Listings.{$suffix}tpl";
return NULL;
}
+ /**
+ * Use the form name to create the tpl file name
+ *
+ * @return string
+ * @access public
+ */
+ /**
+ * @return string
+ */
function getTemplateFileName() {
$fileName = $this->checkTemplateFileExists();
return $fileName ? $fileName : parent::getTemplateFileName();
}
+ /**
+ * Default extra tpl file basically just replaces .tpl with .extra.tpl
+ * i.e. we dont override
+ *
+ * @return string
+ * @access public
+ */
+ /**
+ * @return string
+ */
function overrideExtraTemplateFileName() {
$fileName = $this->checkTemplateFileExists('extra.');
return $fileName ? $fileName : parent::overrideExtraTemplateFileName();