Skip to content

Commit 3428ad9

Browse files
committed
Standalone - enable inheritLocale setting, remove "CMS" from wording
1 parent 2387bbf commit 3428ad9

File tree

1 file changed

+12
-16
lines changed

1 file changed

+12
-16
lines changed

ext/standaloneusers/standaloneusers.php

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,6 @@ function standaloneusers_civicrm_alterBundle(CRM_Core_Resources_Bundle $bundle)
1717
$bundle->addStyleFile('standaloneusers', 'css/standalone.css');
1818
}
1919

20-
/**
21-
* Hide the inherit CMS language on the Settings - Localization form.
22-
*
23-
* Implements hook_civicrm_buildForm().
24-
*
25-
* @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_buildForm/
26-
*/
27-
function standaloneusers_civicrm_buildForm($formName, CRM_Core_Form $form) {
28-
// Administer / Localization / Languages, Currency, Locations
29-
if ($formName == 'CRM_Admin_Form_Setting_Localization') {
30-
if ($inheritLocaleElement = $form->getElement('inheritLocale')) {
31-
$inheritLocaleElement->freeze();
32-
}
33-
}
34-
}
35-
3620
/**
3721
* Implements hook_civicrm_config().
3822
*
@@ -130,3 +114,15 @@ function standaloneusers_civicrm_searchKitTasks(array &$tasks, bool $checkPermis
130114
],
131115
];
132116
}
117+
118+
/**
119+
* Alter settings meta where the Standalone meaning is different from CMS meaning
120+
*
121+
* @todo more settings that could use this. Also some settings that might be best removed?
122+
*
123+
* Implements hook_civicrm_alterSettingsMetaData.
124+
*/
125+
function standaloneusers_civicrm_alterSettingsMetaData(&$settings) {
126+
$settings['inheritLocale']['title'] = E::ts('Use User Language');
127+
$settings['inheritLocale']['description'] = E::ts('If Yes, the system will use the Language set on the logged-in user\'s record. This can be changed later if using the CiviCRM language switcher.');
128+
}

0 commit comments

Comments
 (0)