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
This commit is contained in:
Sean Harvey 2008-06-24 03:22:39 +00:00
parent a75fadda1b
commit 3015bea8dc
2 changed files with 11 additions and 1 deletions

View File

@ -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

View File

@ -52,7 +52,7 @@
</div>
<div id="switchView" class="bottomTabs">
<% if class = CMSMain %>
<% if ShowSwitchView %>
<div class="blank"> <% _t('VIEWPAGEIN','Page view:') %> </div>
<span class="current" title="<% _t('EDITINCMS', 'Edit this page in the CMS') %>"><% _t('EDIT','Edit') %></span>
| <a id="viewStageSite" title="<% _t('VIEWINDRAFT', 'View the Page in the Draft Site') %>" href="home/?stage=Stage"><% _t('DRAFTS','Draft Site') %></a>