<?php
/*
+--------------------------------------------------------------------+
- | 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$
*
*/
// but that's no longer the canonical store. Re-sync from canonical store to ensure
// that we display that latest data. This is inefficient - at some point, we
// should rewrite this UI.
- CRM_Core_BAO_WordReplacement::rebuild();
+ CRM_Core_BAO_WordReplacement::rebuild(FALSE);
$this->_soInstance = CRM_Utils_Array::value('instance', $_GET);
$this->assign('soInstance', $this->_soInstance);
CRM_Utils_System::appendBreadCrumb($breadCrumb);
}
+ /**
+ * @return array
+ */
public function setDefaultValues() {
if ($this->_defaults !== NULL) {
return $this->_defaults;
/**
* Function to actually build the form
*
- * @return None
+ * @return void
* @access public
*/
public function buildQuickForm() {
if ($this->_soInstance) {
$soInstances = array($this->_soInstance);
}
- elseif (CRM_Utils_Array::value('old', $_POST)) {
+ elseif (!empty($_POST['old'])) {
$soInstances = $stringOverrideInstances = array_keys($_POST['old']);
}
elseif (!empty($this->_defaults) && is_array($this->_defaults)) {
elseif (!$v && $newValues[$k]) {
$errors['old[' . $k . ']'] = ts('Please Enter the value for Original Word');
}
- elseif ((!CRM_Utils_Array::value($k, $newValues) && !CRM_Utils_Array::value($k, $oldValues))
- && (CRM_Utils_Array::value($k, $enabled) || CRM_Utils_Array::value($k, $exactMatch))
+ elseif ((empty($newValues[$k]) && empty($oldValues[$k]))
+ && (!empty($enabled[$k]) || !empty($exactMatch[$k]))
) {
$errors['old[' . $k . ']'] = ts('Please Enter the value for Original Word');
$errors['new[' . $k . ']'] = ts('Please Enter the value for Replacement Word');
*
* @access public
*
- * @return None
+ * @return void
*/
public function postProcess() {
$params = $this->controller->exportValues($this->_name);
$enabled['exactMatch'] = $enabled['wildcardMatch'] = $disabled['exactMatch'] = $disabled['wildcardMatch'] = array();
for ($i = 1; $i <= $this->_numStrings; $i++) {
- if (CRM_Utils_Array::value($i, $params['new']) &&
- CRM_Utils_Array::value($i, $params['old'])
- ) {
- if (isset($params['enabled']) && CRM_Utils_Array::value($i, $params['enabled'])) {
- if (CRM_Utils_Array::value('cb', $params) &&
- CRM_Utils_Array::value($i, $params['cb'])
- ) {
+ if (!empty($params['new'][$i]) && !empty($params['old'][$i])) {
+ if (isset($params['enabled']) && !empty($params['enabled'][$i])) {
+ if (!empty($params['cb']) && !empty($params['cb'][$i])) {
$enabled['exactMatch'] += array($params['old'][$i] => $params['new'][$i]);
}
else {