| GNU Affero General Public License or the licensing of CiviCRM, |
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
-*/
+ */
/**
*
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
$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);
}
* 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);
}
}
/**
* 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) {
/**
* 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++) {
CRM_Core_Session::setStatus("", ts("Settings Saved"), "success");
CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/admin/options/wordreplacements',
- "reset=1"
- ));
+ "reset=1"
+ ));
}
}
-}
+}