mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
SiteConfig load/save with ID in CMS
Allow loading a SiteConfig by ID (by specifying $tree_class), and pass the ID through with the form data. Unifies processing with SiteTree, and allows the Translatable module to use the same logic for interacting with the load/save process.
This commit is contained in:
parent
9076286162
commit
671c7daa4c
@ -5,6 +5,7 @@ class CMSSettingsController extends LeftAndMain {
|
|||||||
static $url_rule = '/$Action/$ID/$OtherID';
|
static $url_rule = '/$Action/$ID/$OtherID';
|
||||||
static $menu_priority = -1;
|
static $menu_priority = -1;
|
||||||
static $menu_title = 'Settings';
|
static $menu_title = 'Settings';
|
||||||
|
static $tree_class = 'SiteConfig';
|
||||||
|
|
||||||
public function getResponseNegotiator() {
|
public function getResponseNegotiator() {
|
||||||
$neg = parent::getResponseNegotiator();
|
$neg = parent::getResponseNegotiator();
|
||||||
|
@ -65,7 +65,8 @@ class SiteConfig extends DataObject implements PermissionProvider {
|
|||||||
$topLevelCreatorsGroupsField = ListboxField::create("CreateTopLevelGroups", _t('SiteTree.TOPLEVELCREATORGROUPS', "Top level creators"))
|
$topLevelCreatorsGroupsField = ListboxField::create("CreateTopLevelGroups", _t('SiteTree.TOPLEVELCREATORGROUPS', "Top level creators"))
|
||||||
->setMultiple(true)->setSource($groupsMap)
|
->setMultiple(true)->setSource($groupsMap)
|
||||||
)
|
)
|
||||||
)
|
),
|
||||||
|
new HiddenField('ID')
|
||||||
);
|
);
|
||||||
|
|
||||||
$themeDropdownField->setEmptyString(_t('SiteConfig.DEFAULTTHEME', '(Use default theme)'));
|
$themeDropdownField->setEmptyString(_t('SiteConfig.DEFAULTTHEME', '(Use default theme)'));
|
||||||
|
Loading…
Reference in New Issue
Block a user