Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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.
  • Loading branch information...
commit 671c7daa4c13532bfb8f6ab5c6ff7446548b515a 1 parent 9076286
@chillu chillu authored
View
1  code/controllers/CMSSettingsController.php
@@ -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
3  code/model/SiteConfig.php
@@ -65,7 +65,8 @@ function getCMSFields() {
$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)'));
Please sign in to comment.
Something went wrong with that request. Please try again.