From 670bd4bce4f982a235c3e20d91f9fef7c5af73cf Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Mon, 12 Apr 2010 01:44:06 +0000 Subject: [PATCH] MINOR changed the method to get a page's siteconfig, it is now subsite aware. (from r89870) (from r96710) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@102335 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- core/model/SiteConfig.php | 2 +- core/model/SiteTree.php | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/core/model/SiteConfig.php b/core/model/SiteConfig.php index ab2931886..c5ed09a09 100644 --- a/core/model/SiteConfig.php +++ b/core/model/SiteConfig.php @@ -53,7 +53,7 @@ class SiteConfig extends DataObject implements PermissionProvider { $editorsOptionsSource["OnlyTheseUsers"] = _t('SiteTree.EDITONLYTHESE', "Only these people (choose from list)"); $editorsOptionsField->setSource($editorsOptionsSource); - if (!Permission::check('ADMIN') && !Permission::check('EDIT_SITECONFIG')) { + if (!Permission::check('EDIT_SITECONFIG')) { $fields->makeFieldReadonly($viewersOptionsField); $fields->makeFieldReadonly($viewerGroupsField); $fields->makeFieldReadonly($editorsOptionsField); diff --git a/core/model/SiteTree.php b/core/model/SiteTree.php index 2a0abe6fc..7f4a8c6a8 100755 --- a/core/model/SiteTree.php +++ b/core/model/SiteTree.php @@ -904,6 +904,14 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid // Normal case return $this->canEdit($member); } + + /** + * Stub method to get the site config, provided so it's easy to override + */ + function getSiteConfig() { + if ($this->hasMethod('alternateSiteConfig')) return $this->alternateSiteConfig(); + return SiteConfig::current_site_config(); + } /**