X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FAdmin%2FForm%2FPreferences.php;h=f0dc5c9a364f5dd932ab8a072dbd0b36fdec4f39;hb=5ec753e358cd1692934daa7f5bd99384097fdf8c;hp=4585b4e926b5c08611c89ca39a11935ac9583225;hpb=8b9a8f4abb25cfa7a498eaaa3e459e4d313e350a;p=civicrm-core.git
diff --git a/CRM/Admin/Form/Preferences.php b/CRM/Admin/Form/Preferences.php
index 4585b4e926..f0dc5c9a36 100644
--- a/CRM/Admin/Form/Preferences.php
+++ b/CRM/Admin/Form/Preferences.php
@@ -1,34 +1,18 @@
_defaults = array();
+ $this->_defaults = [];
$this->setDefaultsForMetadataDefinedFields();
foreach ($this->_varNames as $groupName => $settings) {
@@ -135,7 +119,7 @@ class CRM_Admin_Form_Preferences extends CRM_Core_Form {
substr($this->_config->$settingName, 1, -1)
);
if (!empty($value)) {
- $defaults[$settingName] = array();
+ $defaults[$settingName] = [];
foreach ($value as $n => $v) {
$defaults[$settingName][$v] = 1;
}
@@ -157,7 +141,7 @@ class CRM_Admin_Form_Preferences extends CRM_Core_Form {
foreach ($this->_varNames as $groupName => $groupValues) {
$formName = CRM_Utils_String::titleToVar($groupName);
$this->assign('formName', $formName);
- $fields = array();
+ $fields = [];
foreach ($groupValues as $fieldName => $fieldValue) {
$fields[$fieldName] = $fieldValue;
@@ -166,10 +150,10 @@ class CRM_Admin_Form_Preferences extends CRM_Core_Form {
$this->addElement('text',
$fieldName,
$fieldValue['title'],
- array(
+ [
'maxlength' => 64,
'size' => 32,
- )
+ ]
);
break;
@@ -187,12 +171,12 @@ class CRM_Admin_Form_Preferences extends CRM_Core_Form {
break;
case 'YesNo':
- $this->addRadio($fieldName, $fieldValue['title'], array(0 => 'No', 1 => 'Yes'), NULL, ' ');
+ $this->addRadio($fieldName, $fieldValue['title'], [0 => 'No', 1 => 'Yes'], NULL, ' ');
break;
case 'checkboxes':
$options = array_flip(CRM_Core_OptionGroup::values($fieldName, FALSE, FALSE, TRUE));
- $newOptions = array();
+ $newOptions = [];
foreach ($options as $key => $val) {
$newOptions[$key] = $val;
}
@@ -200,7 +184,7 @@ class CRM_Admin_Form_Preferences extends CRM_Core_Form {
$fieldValue['title'],
$newOptions,
NULL, NULL, NULL, NULL,
- array(' ', ' ', '
')
+ [' ', ' ', '
']
);
break;
@@ -218,7 +202,7 @@ class CRM_Admin_Form_Preferences extends CRM_Core_Form {
break;
case 'entity_reference':
- $this->addEntityRef($fieldName, $fieldValue['title'], CRM_Utils_Array::value('options', $fieldValue, array()));
+ $this->addEntityRef($fieldName, $fieldValue['title'], CRM_Utils_Array::value('options', $fieldValue, []));
}
}
@@ -227,18 +211,17 @@ class CRM_Admin_Form_Preferences extends CRM_Core_Form {
}
}
- $this->addButtons(array(
- array(
- 'type' => 'next',
- 'name' => ts('Save'),
- 'isDefault' => TRUE,
- ),
- array(
- 'type' => 'cancel',
- 'name' => ts('Cancel'),
- ),
- )
- );
+ $this->addButtons([
+ [
+ 'type' => 'next',
+ 'name' => ts('Save'),
+ 'isDefault' => TRUE,
+ ],
+ [
+ 'type' => 'cancel',
+ 'name' => ts('Cancel'),
+ ],
+ ]);
if ($this->_action == CRM_Core_Action::VIEW) {
$this->freeze();
@@ -303,7 +286,7 @@ class CRM_Admin_Form_Preferences extends CRM_Core_Form {
$value = CRM_Utils_Array::value($settingName, $this->_params);
if ($value) {
$value = trim($value);
- $value = str_replace(array("\r\n", "\r"), "\n", $value);
+ $value = str_replace(["\r\n", "\r"], "\n", $value);
}
$this->_config->$settingName = $value;
break;