FIXED: Coding style inconsistencies

This commit is contained in:
Damian Mooyman 2012-08-24 08:25:14 +12:00
parent 6395f9030e
commit 715b60387c
2 changed files with 22 additions and 24 deletions

View File

@ -50,25 +50,25 @@ class SiteConfig extends DataObject implements PermissionProvider {
asort($groupsMap); asort($groupsMap);
$fields = new FieldList( $fields = new FieldList(
new TabSet("Root", new TabSet("Root",
$tabMain = new Tab('Main', $tabMain = new Tab('Main',
$titleField = new TextField("Title", _t('SiteConfig.SITETITLE', "Site title")), $titleField = new TextField("Title", _t('SiteConfig.SITETITLE', "Site title")),
$taglineField = new TextField("Tagline", _t('SiteConfig.SITETAGLINE', "Site Tagline/Slogan")), $taglineField = new TextField("Tagline", _t('SiteConfig.SITETAGLINE', "Site Tagline/Slogan")),
$themeDropdownField = new DropdownField("Theme", _t('SiteConfig.THEME', 'Theme'), $this->getAvailableThemes()) $themeDropdownField = new DropdownField("Theme", _t('SiteConfig.THEME', 'Theme'), $this->getAvailableThemes())
), ),
$tabAccess = new Tab('Access', $tabAccess = new Tab('Access',
$viewersOptionsField = new OptionsetField("CanViewType", _t('SiteConfig.VIEWHEADER', "Who can view pages on this site?")), $viewersOptionsField = new OptionsetField("CanViewType", _t('SiteConfig.VIEWHEADER', "Who can view pages on this site?")),
$viewerGroupsField = ListboxField::create("ViewerGroups", _t('SiteTree.VIEWERGROUPS', "Viewer Groups")) $viewerGroupsField = ListboxField::create("ViewerGroups", _t('SiteTree.VIEWERGROUPS', "Viewer Groups"))
->setMultiple(true)->setSource($groupsMap), ->setMultiple(true)->setSource($groupsMap),
$editorsOptionsField = new OptionsetField("CanEditType", _t('SiteConfig.EDITHEADER', "Who can edit pages on this site?")), $editorsOptionsField = new OptionsetField("CanEditType", _t('SiteConfig.EDITHEADER', "Who can edit pages on this site?")),
$editorGroupsField = ListboxField::create("EditorGroups", _t('SiteTree.EDITORGROUPS', "Editor Groups")) $editorGroupsField = ListboxField::create("EditorGroups", _t('SiteTree.EDITORGROUPS', "Editor Groups"))
->setMultiple(true)->setSource($groupsMap), ->setMultiple(true)->setSource($groupsMap),
$topLevelCreatorsOptionsField = new OptionsetField("CanCreateTopLevelType", _t('SiteConfig.TOPLEVELCREATE', "Who can create pages in the root of the site?")), $topLevelCreatorsOptionsField = new OptionsetField("CanCreateTopLevelType", _t('SiteConfig.TOPLEVELCREATE', "Who can create pages in the root of the site?")),
$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') new HiddenField('ID')
); );
$themeDropdownField->setEmptyString(_t('SiteConfig.DEFAULTTHEME', '(Use default theme)')); $themeDropdownField->setEmptyString(_t('SiteConfig.DEFAULTTHEME', '(Use default theme)'));
@ -159,9 +159,8 @@ class SiteConfig extends DataObject implements PermissionProvider {
* @return SiteConfig * @return SiteConfig
*/ */
static function current_site_config() { static function current_site_config() {
if ($siteConfig = DataObject::get_one('SiteConfig')) if ($siteConfig = DataObject::get_one('SiteConfig')) return $siteConfig;
return $siteConfig;
return self::make_site_config(); return self::make_site_config();
} }

View File

@ -994,8 +994,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
if($this->hasMethod('alternateSiteConfig')) { if($this->hasMethod('alternateSiteConfig')) {
$altConfig = $this->alternateSiteConfig(); $altConfig = $this->alternateSiteConfig();
if($altConfig) if($altConfig) return $altConfig;
return $altConfig;
} }
return SiteConfig::current_site_config(); return SiteConfig::current_site_config();