Permalink
Browse files

API CHANGE Removed support for CMSTopMenu_alternative template, use C…

…MSMenu.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
  • Loading branch information...
1 parent 99a68dd commit 9da43d139afcd1b9eacc7a892c056871f85a3df6 @chillu chillu committed Apr 15, 2011
View
@@ -392,7 +392,9 @@ public function MainMenu() {
$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) {
$linkingmode = "current";
@@ -430,8 +432,8 @@ public function MainMenu() {
return $menu;
}
- public function CMSTopMenu() {
- return $this->renderWith(array('CMSTopMenu_alternative','CMSTopMenu'));
+ public function Menu() {
+ return $this->renderWith($this->getTemplatesWithSuffix('_Menu'));
}
/**
@@ -446,12 +448,8 @@ protected function getTemplatesWithSuffix($suffix) {
return $templates;
}
- public function Left() {
- return $this->renderWith($this->getTemplatesWithSuffix('_left'));
- }
-
- public function Right() {
- return $this->renderWith($this->getTemplatesWithSuffix('_right'));
+ public function Content() {
+ return $this->renderWith($this->getTemplatesWithSuffix('_Content'));
}
public function getRecord($id) {
@@ -1067,6 +1065,13 @@ function SwitchView() {
return $nav['items'];
}
}
+
+ /**
+ * @return SiteConfig
+ */
+ function SiteConfig() {
+ return SiteConfig::current_site_config();
+ }
/**
* 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>
@@ -0,0 +1 @@
+$EditForm
@@ -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">&nbsp;</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-menu west">
- $CMSTopMenu
- </div>
+ $Menu
<div class="cms-content center {layout: {type: 'border'}}" id="right">

0 comments on commit 9da43d1

Please sign in to comment.