Skip to content
This repository
Browse code

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
Ingo Schommer authored August 06, 2012
1  code/controllers/CMSSettingsController.php
@@ -5,6 +5,7 @@ class CMSSettingsController extends LeftAndMain {
5 5
 	static $url_rule = '/$Action/$ID/$OtherID';
6 6
 	static $menu_priority = -1;
7 7
 	static $menu_title = 'Settings';
  8
+	static $tree_class = 'SiteConfig';
8 9
 
9 10
 	public function getResponseNegotiator() {
10 11
 		$neg = parent::getResponseNegotiator();
3  code/model/SiteConfig.php
@@ -65,7 +65,8 @@ function getCMSFields() {
65 65
 					$topLevelCreatorsGroupsField = ListboxField::create("CreateTopLevelGroups", _t('SiteTree.TOPLEVELCREATORGROUPS', "Top level creators"))
66 66
 						->setMultiple(true)->setSource($groupsMap)
67 67
 				)
68  
-			)
  68
+			),
  69
+			new HiddenField('ID')
69 70
 		);
70 71
 
71 72
 		$themeDropdownField->setEmptyString(_t('SiteConfig.DEFAULTTHEME', '(Use default theme)'));

0 notes on commit 671c7da

Please sign in to comment.
Something went wrong with that request. Please try again.