From 3015bea8dceb1c1b345352186ebc19e5bb974be8 Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Tue, 24 Jun 2008 03:22:39 +0000 Subject: [PATCH] ENHANCEMENT Allow subclass of CMSMain to view the SwitchView context for staging/published site links git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@56816 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- code/CMSMain.php | 10 ++++++++++ templates/LeftAndMain.ss | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/code/CMSMain.php b/code/CMSMain.php index be128c2b..8d861fcf 100644 --- a/code/CMSMain.php +++ b/code/CMSMain.php @@ -99,6 +99,16 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr Requirements::javascript("forum/javascript/ForumAccess.js"); Requirements::javascript('gallery/javascript/GalleryPage_CMS.js'); } + + /** + * If this is set to true, the "switchView" context in the + * template is shown, with links to the staging and publish site. + * + * @return boolean + */ + function ShowSwitchView() { + return true; + } //------------------------------------------------------------------------------------------// // Main controllers diff --git a/templates/LeftAndMain.ss b/templates/LeftAndMain.ss index 4e4422c3..883af205 100644 --- a/templates/LeftAndMain.ss +++ b/templates/LeftAndMain.ss @@ -52,7 +52,7 @@
- <% if class = CMSMain %> + <% if ShowSwitchView %>
<% _t('VIEWPAGEIN','Page view:') %>
<% _t('EDIT','Edit') %> | <% _t('DRAFTS','Draft Site') %>