mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
API CHANGE Removed support for CMSTopMenu_alternative template, use CMSMenu.ss in themes or project template folders instead
API CHANGE Renamed LeftAndMain->CMSTopMenu() to CMSMenu() API CHANGE Renamed LeftAndMain->Left() to Menu(), used through LeftAndMain_Menu.ss templates (instead of LeftAndMain_left.ss) - in order to avoid presentational naming API CHANGE Renamed LeftAndMain->Right() to Content(), used through LeftAndMain_Content.ss templates (instead of LeftAndMain_right.ss) - in order to avoid presentational naming
This commit is contained in:
parent
99a68dde75
commit
9da43d139a
@ -392,7 +392,9 @@ class LeftAndMain extends Controller {
|
|||||||
|
|
||||||
$linkingmode = "";
|
$linkingmode = "";
|
||||||
|
|
||||||
if(strpos($this->Link(), $menuItem->url) !== false) {
|
if($menuItem->controller && $this instanceof $menuItem->controller) {
|
||||||
|
$linkingmode = "current";
|
||||||
|
} else if(strpos($this->Link(), $menuItem->url) !== false) {
|
||||||
if($this->Link() == $menuItem->url) {
|
if($this->Link() == $menuItem->url) {
|
||||||
$linkingmode = "current";
|
$linkingmode = "current";
|
||||||
|
|
||||||
@ -430,8 +432,8 @@ class LeftAndMain extends Controller {
|
|||||||
return $menu;
|
return $menu;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function CMSTopMenu() {
|
public function Menu() {
|
||||||
return $this->renderWith(array('CMSTopMenu_alternative','CMSTopMenu'));
|
return $this->renderWith($this->getTemplatesWithSuffix('_Menu'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -446,12 +448,8 @@ class LeftAndMain extends Controller {
|
|||||||
return $templates;
|
return $templates;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function Left() {
|
public function Content() {
|
||||||
return $this->renderWith($this->getTemplatesWithSuffix('_left'));
|
return $this->renderWith($this->getTemplatesWithSuffix('_Content'));
|
||||||
}
|
|
||||||
|
|
||||||
public function Right() {
|
|
||||||
return $this->renderWith($this->getTemplatesWithSuffix('_right'));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getRecord($id) {
|
public function getRecord($id) {
|
||||||
@ -1067,6 +1065,13 @@ class LeftAndMain extends Controller {
|
|||||||
return $nav['items'];
|
return $nav['items'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return SiteConfig
|
||||||
|
*/
|
||||||
|
function SiteConfig() {
|
||||||
|
return SiteConfig::current_site_config();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The application name. Customisable by calling
|
* The application name. Customisable by calling
|
||||||
|
@ -1,31 +0,0 @@
|
|||||||
<div class="cms-logo">
|
|
||||||
<a href="http://www.silverstripe.org/" target="_blank">
|
|
||||||
SilverStripe <% if CMSVersion %><abbr class="version">$CMSVersion</abbr><% end_if %>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
<div class="cms-login-status">
|
|
||||||
<a href="Security/logout" class="logout-link"><% _t('LOGOUT','Log out') %></a>
|
|
||||||
<% control CurrentMember %>
|
|
||||||
<% _t('Hello','Hi') %>
|
|
||||||
<strong>
|
|
||||||
<a href="{$AbsoluteBaseURL}admin/myprofile" class="profile-link">
|
|
||||||
<% if FirstName && Surname %>$FirstName $Surname<% else_if FirstName %>$FirstName<% else %>$Email<% end_if %>
|
|
||||||
</a>
|
|
||||||
</strong>
|
|
||||||
<% end_control %>
|
|
||||||
</div>
|
|
||||||
<ul class="cms-menu-list">
|
|
||||||
<% control MainMenu %>
|
|
||||||
<li class="$LinkingMode" id="Menu-$Code">
|
|
||||||
<a href="$Link">$Title</a>
|
|
||||||
<% if Title == 'Edit Page' %>
|
|
||||||
<ul>
|
|
||||||
<li class="current"><a href="#">Content</a></li>
|
|
||||||
<li><a href="#">Settings</a></li>
|
|
||||||
<li><a href="#">Reports</a></li>
|
|
||||||
<li><a href="#">History</a></li>
|
|
||||||
</ul>
|
|
||||||
<% end_if %>
|
|
||||||
</li>
|
|
||||||
<% end_control %>
|
|
||||||
</ul>
|
|
1
admin/templates/Includes/LeftAndMain_Content.ss
Normal file
1
admin/templates/Includes/LeftAndMain_Content.ss
Normal file
@ -0,0 +1 @@
|
|||||||
|
$EditForm
|
50
admin/templates/Includes/LeftAndMain_Menu.ss
Normal file
50
admin/templates/Includes/LeftAndMain_Menu.ss
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
<div class="cms-menu west">
|
||||||
|
|
||||||
|
<div class="cms-header">
|
||||||
|
<div class="cms-logo">
|
||||||
|
<a href="http://www.silverstripe.org/" target="_blank">
|
||||||
|
SilverStripe <% if CMSVersion %><abbr class="version">$CMSVersion</abbr><% end_if %>
|
||||||
|
</a>
|
||||||
|
<span>$SiteConfig.Title</span>
|
||||||
|
</div>
|
||||||
|
<div class="cms-login-status">
|
||||||
|
<a href="Security/logout" class="logout-link"><% _t('LOGOUT','Log out') %></a>
|
||||||
|
<% control CurrentMember %>
|
||||||
|
<% _t('Hello','Hi') %>
|
||||||
|
<strong>
|
||||||
|
<a href="{$AbsoluteBaseURL}admin/myprofile" class="profile-link">
|
||||||
|
<% if FirstName && Surname %>$FirstName $Surname<% else_if FirstName %>$FirstName<% else %>$Email<% end_if %>
|
||||||
|
</a>
|
||||||
|
</strong>
|
||||||
|
<% end_control %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<ul class="cms-menu-list">
|
||||||
|
<% control MainMenu %>
|
||||||
|
<li class="$LinkingMode" id="Menu-$Code">
|
||||||
|
<a href="$Link">
|
||||||
|
<span class="icon"> </span>
|
||||||
|
<span class="text">$Title</span>
|
||||||
|
</a>
|
||||||
|
<% if Code == 'CMSMain' && LinkingMode == 'current' %>
|
||||||
|
<ul>
|
||||||
|
<li <% if Top.class == 'CMSPageEditController' %>class="current"<% end_if %>><a href="admin/page/edit/show/$Top.CurrentPageID">
|
||||||
|
<span class="text">Content</span>
|
||||||
|
</a></li>
|
||||||
|
<li <% if Top.class == 'CMSPageSettingsController' %>class="current"<% end_if %>><a href="admin/page/settings/show/$Top.CurrentPageID">
|
||||||
|
<span class="text">Settings</span>
|
||||||
|
</a></li>
|
||||||
|
<li <% if Top.class == 'CMSPageReportsController' %>class="current"<% end_if %>><a href="#">
|
||||||
|
<span class="text">Reports</span>
|
||||||
|
</a></li>
|
||||||
|
<li <% if Top.class == 'CMSPageHistoryController' %>class="current"<% end_if %>><a href="#">
|
||||||
|
<span class="text">History</span>
|
||||||
|
</a></li>
|
||||||
|
</ul>
|
||||||
|
<% end_if %>
|
||||||
|
</li>
|
||||||
|
<% end_control %>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
</div>
|
@ -13,9 +13,7 @@
|
|||||||
|
|
||||||
<div class="cms-container {layout: {type: 'border'}}">
|
<div class="cms-container {layout: {type: 'border'}}">
|
||||||
|
|
||||||
<div class="cms-menu west">
|
$Menu
|
||||||
$CMSTopMenu
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="cms-content center {layout: {type: 'border'}}" id="right">
|
<div class="cms-content center {layout: {type: 'border'}}" id="right">
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user