mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX: Only show live link when page has been published (from r97839)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@99089 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
bb58914bb0
commit
1014bb6ef5
@ -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…
Reference in New Issue
Block a user