X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FAdmin%2FForm%2FWordReplacements.php;h=009060b42ee8446dcd93f400fbd44ca1f892c2bc;hb=d25dd0ee5e47188c3ea9ad2918f627cfac97ddbd;hp=bc3f1121745b4667fde5622965daae82e8a02542;hpb=39de6fd54b9843705d13cb9f70fbcc6296103670;p=civicrm-core.git diff --git a/CRM/Admin/Form/WordReplacements.php b/CRM/Admin/Form/WordReplacements.php index bc3f112174..009060b42e 100644 --- a/CRM/Admin/Form/WordReplacements.php +++ b/CRM/Admin/Form/WordReplacements.php @@ -23,7 +23,7 @@ | GNU Affero General Public License or the licensing of CiviCRM, | | see the CiviCRM license FAQ at http://civicrm.org/licensing | +--------------------------------------------------------------------+ -*/ + */ /** * @@ -39,7 +39,7 @@ class CRM_Admin_Form_WordReplacements extends CRM_Core_Form { protected $_defaults = NULL; - function preProcess() { + public function preProcess() { // This controller was originally written to CRUD $config->locale_custom_strings, // 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 @@ -51,9 +51,12 @@ class CRM_Admin_Form_WordReplacements extends CRM_Core_Form { $breadCrumbUrl = CRM_Utils_System::url('civicrm/admin/options/wordreplacements', "reset=1" ); - $breadCrumb = array(array('title' => ts('Word Replacements'), + $breadCrumb = array( + array( + 'title' => ts('Word Replacements'), 'url' => $breadCrumbUrl, - )); + ), + ); CRM_Utils_System::appendBreadCrumb($breadCrumb); } @@ -114,16 +117,15 @@ class CRM_Admin_Form_WordReplacements extends CRM_Core_Form { * Build the form object * * @return void - * @access public */ public function buildQuickForm() { - $config = CRM_Core_Config::singleton(); - $values = $config->localeCustomStrings[$config->lcMessages]; + $config = CRM_Core_Config::singleton(); + $values = $config->localeCustomStrings[$config->lcMessages]; //CRM-14179 $instances = 0; - foreach ( $values as $valMatchType ) { - foreach ( $valMatchType as $valPairs ) { + foreach ($values as $valMatchType) { + foreach ($valMatchType as $valPairs) { $instances += count($valPairs); } } @@ -177,18 +179,18 @@ class CRM_Admin_Form_WordReplacements extends CRM_Core_Form { /** * Global validation rules for the form * - * @param array $values posted values of the form + * @param array $values + * Posted values of the form. * - * @return array list of errors to be posted back to the form - * @static - * @access public + * @return array + * list of errors to be posted back to the form */ - static function formRule($values) { + public static function formRule($values) { $errors = array(); - $oldValues = CRM_Utils_Array::value('old', $values); - $newValues = CRM_Utils_Array::value('new', $values); - $enabled = CRM_Utils_Array::value('enabled', $values); + $oldValues = CRM_Utils_Array::value('old', $values); + $newValues = CRM_Utils_Array::value('new', $values); + $enabled = CRM_Utils_Array::value('enabled', $values); $exactMatch = CRM_Utils_Array::value('cb', $values); foreach ($oldValues as $k => $v) { @@ -212,13 +214,12 @@ class CRM_Admin_Form_WordReplacements extends CRM_Core_Form { /** * Process the form submission * - * @access public * * @return void */ public function postProcess() { $params = $this->controller->exportValues($this->_name); - $this->_numStrings = sizeof($params['old']); + $this->_numStrings = count($params['old']); $enabled['exactMatch'] = $enabled['wildcardMatch'] = $disabled['exactMatch'] = $disabled['wildcardMatch'] = array(); for ($i = 1; $i <= $this->_numStrings; $i++) { @@ -276,9 +277,9 @@ class CRM_Admin_Form_WordReplacements extends CRM_Core_Form { CRM_Core_Session::setStatus("", ts("Settings Saved"), "success"); CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/admin/options/wordreplacements', - "reset=1" - )); + "reset=1" + )); } } -} +}