X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FAdmin%2FForm%2FPreferences.php;h=55578d404a53b8e100da67c2b20cc08469638c1a;hb=0d48f1cc2cefd21e794aa0c2750f328eebff80ba;hp=ad9053ccba636f4161fdf6e9eede0c7f374450ee;hpb=cc35b65e11b91686e2ea4d99ca18ac7f77232f07;p=civicrm-core.git
diff --git a/CRM/Admin/Form/Preferences.php b/CRM/Admin/Form/Preferences.php
index ad9053ccba..55578d404a 100644
--- a/CRM/Admin/Form/Preferences.php
+++ b/CRM/Admin/Form/Preferences.php
@@ -3,7 +3,7 @@
+--------------------------------------------------------------------+
| CiviCRM version 5 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2018 |
+ | Copyright CiviCRM LLC (c) 2004-2019 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
@@ -28,7 +28,7 @@
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2018
+ * @copyright CiviCRM LLC (c) 2004-2019
*/
/**
@@ -104,7 +104,7 @@ class CRM_Admin_Form_Preferences extends CRM_Core_Form {
* @return array
*/
public function setDefaultValues() {
- $this->_defaults = array();
+ $this->_defaults = [];
$this->setDefaultsForMetadataDefinedFields();
foreach ($this->_varNames as $groupName => $settings) {
@@ -135,7 +135,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 +157,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 +166,10 @@ class CRM_Admin_Form_Preferences extends CRM_Core_Form {
$this->addElement('text',
$fieldName,
$fieldValue['title'],
- array(
+ [
'maxlength' => 64,
'size' => 32,
- )
+ ]
);
break;
@@ -187,12 +187,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 +200,7 @@ class CRM_Admin_Form_Preferences extends CRM_Core_Form {
$fieldValue['title'],
$newOptions,
NULL, NULL, NULL, NULL,
- array(' ', ' ', '
')
+ [' ', ' ', '
']
);
break;
@@ -218,7 +218,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 +227,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 +302,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;