Unverified Commit 37f058e6 authored by eileen's avatar eileen 🎱 Committed by GitHub

Merge pull request #11680 from jitendrapurohit/setting

CRM-21777 - Set readonly for the fields initialised in civicrm_settings.php
parents d8c5e9b2 f6c21a43
......@@ -105,6 +105,11 @@ class CRM_Admin_Form_Setting extends CRM_Core_Form {
else {
$options = NULL;
}
//Load input as readonly whose values are overridden in civicrm.settings.php.
if (Civi::settings()->getMandatory($setting)) {
$props['html_attributes']['readonly'] = TRUE;
$setStatus = TRUE;
}
$add = 'add' . $props['quick_form_type'];
if ($add == 'addElement') {
......@@ -147,6 +152,9 @@ class CRM_Admin_Form_Setting extends CRM_Core_Form {
}
}
if (!empty($setStatus)) {
CRM_Core_Session::setStatus("Some fields are loaded as 'readonly' as they have been set (overridden) in civicrm.settings.php.", '', 'info', array('expires' => 0));
}
// setting_description should be deprecated - see Mail.tpl for metadata based tpl.
$this->assign('setting_descriptions', $descriptions);
$this->assign('settings_fields', $settingMetaData);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment