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:
Ingo Schommer 2012-08-06 09:36:25 +02:00
parent 9076286162
commit 671c7daa4c
2 changed files with 3 additions and 1 deletions

View File

@ -5,6 +5,7 @@ class CMSSettingsController extends LeftAndMain {
static $url_rule = '/$Action/$ID/$OtherID';
static $menu_priority = -1;
static $menu_title = 'Settings';
static $tree_class = 'SiteConfig';
public function getResponseNegotiator() {
$neg = parent::getResponseNegotiator();

View File

@ -65,7 +65,8 @@ class SiteConfig extends DataObject implements PermissionProvider {
$topLevelCreatorsGroupsField = ListboxField::create("CreateTopLevelGroups", _t('SiteTree.TOPLEVELCREATORGROUPS', "Top level creators"))
->setMultiple(true)->setSource($groupsMap)
)
)
),
new HiddenField('ID')
);
$themeDropdownField->setEmptyString(_t('SiteConfig.DEFAULTTHEME', '(Use default theme)'));