BUG Fix legacy breadcrumbs appearing on page save

Fixes #1358
This commit is contained in:
Damian Mooyman 2016-01-20 15:28:58 +13:00
parent 7c4e6f4b60
commit abc5556520
3 changed files with 6 additions and 24 deletions

View File

@ -409,11 +409,11 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
public function Breadcrumbs($unlinked = false) {
$items = parent::Breadcrumbs($unlinked);
// The root element should point to the pages tree view,
// rather than the actual controller (which would just show an empty edit form)
$defaultTitle = self::menu_title_for_class('CMSPagesController');
$items[0]->Title = _t("{$this->class}.MENUTITLE", $defaultTitle);
$items[0]->Link = singleton('CMSPagesController')->Link();
if($items->count() > 1) {
// Specific to the SiteTree admin section, we never show the cms section and current
// page in the same breadcrumbs block.
$items->shift();
}
return $items;
}

View File

@ -11,10 +11,4 @@ class CMSPageEditController extends CMSMain {
private static $required_permission_codes = 'CMS_ACCESS_CMSMain';
private static $session_namespace = 'CMSMain';
public function Breadcrumbs($unlinked = false) {
$crumbs = parent::Breadcrumbs($unlinked);
$crumbs[0]->Title = _t('CMSPagesController.MENUTITLE');
return $crumbs;
}
}

View File

@ -4,19 +4,7 @@
<div class="cms-content-header-nav">
<div class="breadcrumbs-wrapper" data-pjax-fragment="Breadcrumbs">
<h2 id="page-title-heading">
<% loop $Breadcrumbs %>
<% if $First %>
<% else_if $Last %>
<span class="cms-panel-link crumb last">$Title.XML</span>
<% else %>
<a class="cms-panel-link crumb" href="$Link">$Title.XML</a>
<span class="sep">/</span>
<% end_if %>
<% end_loop %>
</h2>
</div>
<% include CMSBreadcrumbs %>
<div class="cms-content-header-tabs">
<ul class="cms-tabset-nav-primary">