Core Settings
Adding a new Setting to CiviCRM Core.¶
- Add metadata to the appropriate
.setting.php
file about the new setting - Add it to the appropriate setting page per below
'settings_pages' => ['event' => ['weight' => 10]]
- Your setting will not be active until you run flush all caches (e.g
cv flush
ordrush cvapi System.flush
)
Warning
Do not use the "URL Preferences" group to store any setting that is not a url string.
Legacy method Adding Setting Config to Admin Forms.¶
/**
* This class generates form components for Miscellaneous
*
*/
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,
'versionAlert' => CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME,
'versionCheck' => CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME,
'empoweredBy' => CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME,
'maxFileSize' => CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME,
'doNotAttachPDFReceipt' => CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME,
'secondDegRelPermissions' => CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME,
'checksumTimeout' => CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME,
);
}