From: Tim Otten Date: Tue, 8 Sep 2015 01:30:23 +0000 (-0700) Subject: CRM-16373 - CRM_Admin_Form_Setting_Misc - Don't save through ConfigSetting::add() X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=53b0f6c3e765834de348801fc7eb20bf67af71e0;p=civicrm-core.git CRM-16373 - CRM_Admin_Form_Setting_Misc - Don't save through ConfigSetting::add() --- diff --git a/CRM/Admin/Form/Setting/Miscellaneous.php b/CRM/Admin/Form/Setting/Miscellaneous.php index 215bc86344..6daba5212b 100644 --- a/CRM/Admin/Form/Setting/Miscellaneous.php +++ b/CRM/Admin/Form/Setting/Miscellaneous.php @@ -39,6 +39,7 @@ class CRM_Admin_Form_Setting_Miscellaneous extends CRM_Admin_Form_Setting { protected $_settings = array( 'max_attachments' => CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'contact_undelete' => CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, + 'dashboardCacheTimeout' => CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'versionAlert' => CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'securityUpdateAlert' => CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'versionCheck' => CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, @@ -49,6 +50,10 @@ class CRM_Admin_Form_Setting_Miscellaneous extends CRM_Admin_Form_Setting { 'doNotAttachPDFReceipt' => CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'secondDegRelPermissions' => CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'checksum_timeout' => CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, + 'recaptchaOptions' => CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, + 'recaptchaPublicKey' => CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, + 'recaptchaPrivateKey' => CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, + 'wkhtmltopdfPath' => CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, ); public $_uploadMaxSize; @@ -71,35 +76,11 @@ class CRM_Admin_Form_Setting_Miscellaneous extends CRM_Admin_Form_Setting { $this->assign('validTriggerPermission', CRM_Core_DAO::checkTriggerViewPermission(FALSE)); - $this->addElement( - 'text', - 'wkhtmltopdfPath', ts('Path to wkhtmltopdf executable'), - array('size' => 64, 'maxlength' => 256) - ); - - $this->addElement( - 'text', 'recaptchaPublicKey', ts('Public Key'), - array('size' => 64, 'maxlength' => 64) - ); - $this->addElement( - 'text', 'recaptchaPrivateKey', ts('Private Key'), - array('size' => 64, 'maxlength' => 64) - ); - - $this->addElement( - 'text', 'dashboardCacheTimeout', ts('Dashboard cache timeout'), - array('size' => 3, 'maxlength' => 5) - ); - - $this->addElement( - 'text', 'recaptchaOptions', ts('Recaptcha Options'), - array('size' => 64, 'maxlength' => 64) - ); - $this->addFormRule(array('CRM_Admin_Form_Setting_Miscellaneous', 'formRule'), $this); parent::buildQuickForm(); $this->addRule('checksum_timeout', ts('Value should be a positive number'), 'positiveInteger'); + $this->addRule('dashboardCacheTimeout', ts('Value should be a positive number'), 'positiveInteger'); } /** diff --git a/settings/Core.setting.php b/settings/Core.setting.php index a81f287158..8edc5c20eb 100644 --- a/settings/Core.setting.php +++ b/settings/Core.setting.php @@ -434,8 +434,6 @@ return array( 'name' => 'wkhtmltopdfPath', 'prefetch' => 1, // prefetch causes it to be cached in config settings. Usually this is a transitional setting. Some things like urls are permanent. Remove this comment if you have assessed & it should be permanent - 'config_only' => 1, - //@todo - see https://wiki.civicrm.org/confluence/display/CRMDOC/Settings+Reference#SettingsReference-Convertingaconfigobjecttoasetting on removing this deprecated value 'type' => 'String', 'quick_form_type' => 'Element', 'html_attributes' => array( @@ -451,14 +449,33 @@ return array( 'description' => NULL, 'help_text' => NULL, ), + 'recaptchaOptions' => array( + 'group_name' => 'CiviCRM Preferences', + 'group' => 'core', + 'name' => 'recaptchaOptions', + 'prefetch' => 1, + // prefetch causes it to be cached in config settings. Usually this is a transitional setting. Some things like urls are permanent. Remove this comment if you have assessed & it should be permanent + 'type' => 'String', + 'quick_form_type' => 'Element', + 'html_attributes' => array( + 'size' => 64, + 'maxlength' => 64, + ), + 'html_type' => 'Text', + 'default' => NULL, + 'add' => '4.3', + 'title' => 'Recaptcha Options', + 'is_domain' => 1, + 'is_contact' => 0, + 'description' => 'You can specify the reCAPTCHA theme options as comma separated data.(eg: theme:\'blackglass\', lang : \'fr\' ). Check the available options at Customizing the Look and Feel of reCAPTCHA.', + 'help_text' => NULL, + ), 'recaptchaPublicKey' => array( 'group_name' => 'CiviCRM Preferences', 'group' => 'core', 'name' => 'recaptchaPublicKey', 'prefetch' => 1, // prefetch causes it to be cached in config settings. Usually this is a transitional setting. Some things like urls are permanent. Remove this comment if you have assessed & it should be permanent - 'config_only' => 1, - //@todo - see https://wiki.civicrm.org/confluence/display/CRMDOC/Settings+Reference#SettingsReference-Convertingaconfigobjecttoasetting on removing this deprecated value 'type' => 'String', 'quick_form_type' => 'Element', 'html_attributes' => array( @@ -480,8 +497,6 @@ return array( 'name' => 'recaptchaPrivateKey', 'prefetch' => 1, // prefetch causes it to be cached in config settings. Usually this is a transitional setting. Some things like urls are permanent. Remove this comment if you have assessed & it should be permanent - 'config_only' => 1, - //@todo - see https://wiki.civicrm.org/confluence/display/CRMDOC/Settings+Reference#SettingsReference-Convertingaconfigobjecttoasetting on removing this deprecated value 'type' => 'String', 'quick_form_type' => 'Element', 'html_attributes' => array( @@ -503,8 +518,6 @@ return array( 'name' => 'dashboardCacheTimeout', 'prefetch' => 1, // prefetch causes it to be cached in config settings. Usually this is a transitional setting. Some things like urls are permanent. Remove this comment if you have assessed & it should be permanent - 'config_only' => 1, - //@todo - see https://wiki.civicrm.org/confluence/display/CRMDOC/Settings+Reference#SettingsReference-Convertingaconfigobjecttoasetting on removing this deprecated value 'type' => 'Integer', 'quick_form_type' => 'Element', 'html_attributes' => array(