From ed71153466518ca1bfd582e10c2615345b2f48c4 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Tue, 19 Jan 2010 02:49:01 +0000 Subject: [PATCH] MINOR Reverted 'single instance only' feature from r79868, delayed until later release (see #4277) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@97182 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- core/model/SiteTree.php | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/core/model/SiteTree.php b/core/model/SiteTree.php index 9b8c7ce68..90b957fa8 100755 --- a/core/model/SiteTree.php +++ b/core/model/SiteTree.php @@ -141,16 +141,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid */ static $can_create = true; - /** - * If this is true, users can create only one instance of this class in the CMS. - */ - static $single_instance_only = false; - - /** - * This is used as a CSS class to indicate a sitetree node is a single_instance_only page type - */ - static $single_instance_only_css_class = 'singleinstanceonly'; - + /** * Icon to use in the CMS * @@ -817,8 +808,6 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid * @return boolean True if the current user can create pages on this class. */ public function canCreate($member = null) { - if($this->stat('single_instance_only') && DataObject::get_one($this->class)) return false; - if(!$member || !(is_a($member, 'Member')) || is_numeric($member)) { $member = Member::currentUserID(); } @@ -832,6 +821,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid return $this->stat('can_create') != false || Director::isDev(); } + /** * This function should return true if the current user can edit this * page. It can be overloaded to customise the security model for an @@ -2301,9 +2291,6 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid if(!$this->ShowInMenus) $classes .= " notinmenu"; - if($this->stat('single_instance_only')) - $classes .= " " . $this->stat('single_instance_only_css_class'); - //TODO: Add integration /* if($this->hasExtension('Translatable') && $controller->Locale != Translatable::default_locale() && !$this->isTranslation())