mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
BUGFIX: Only show live link when page has been published (from r97839) (from r99089)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@102844 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
676fc61421
commit
14fb2a387f
@ -123,8 +123,11 @@ class SilverStripeNavigatorItem_LiveLink extends SilverStripeNavigatorItem {
|
||||
if(Versioned::current_stage() == 'Live') {
|
||||
return "<a class=\"current\">". _t('ContentController.PUBLISHEDSITE', 'Published Site') ."</a>";
|
||||
} else {
|
||||
$thisPage = $page->AbsoluteLink();
|
||||
return "<a href=\"$thisPage?stage=Live\" class=\"newWindow\" target=\"site\" style=\"left : -3px;\">". _t('ContentController.PUBLISHEDSITE', 'Published Site') ."</a>";
|
||||
$livePage = Versioned::get_one_by_stage('SiteTree', 'Live', '"SiteTree"."ID" = ' . $page->ID);
|
||||
if($livePage) {
|
||||
$thisPage = $livePage->AbsoluteLink();
|
||||
return "<a href=\"$thisPage?stage=Live\" class=\"newWindow\" target=\"site\" style=\"left : -3px;\">". _t('ContentController.PUBLISHEDSITE', 'Published Site') ."</a>";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user