ENHANCEMENT: Add ability to change URL for SS logo in CMS Menu

This commit is contained in:
Loz Calver 2012-10-24 14:42:48 +01:00 committed by Ingo Schommer
parent e9a544b719
commit ea2dc9da0e
2 changed files with 25 additions and 1 deletions

View File

@ -1370,6 +1370,30 @@ class LeftAndMain extends Controller implements PermissionProvider {
public function SiteConfig() {
return (class_exists('SiteConfig')) ? SiteConfig::current_site_config() : null;
}
/**
* The href for the anchor on the Silverstripe logo.
* Set by calling LeftAndMain::set_application_link()
*
* @var String
*/
static $application_link = 'http://www.silverstripe.org/';
/**
* Sets the href for the anchor on the Silverstripe logo in the menu
*
* @param String $link
*/
public static function set_application_link($link) {
self::$application_link = $link;
}
/**
* @return String
*/
public function ApplicationLink() {
return self::$application_link;
}
/**
* The application name. Customisable by calling

View File

@ -1,7 +1,7 @@
<div class="cms-menu cms-panel cms-panel-layout west" id="cms-menu" data-layout-type="border">
<div class="cms-logo-header north">
<div class="cms-logo">
<a href="http://www.silverstripe.org/" target="_blank" title="SilverStripe (Version - $CMSVersion)">
<a href="$ApplicationLink" target="_blank" title="SilverStripe (Version - $CMSVersion)">
SilverStripe <% if CMSVersion %><abbr class="version">$CMSVersion</abbr><% end_if %>
</a>
<span><% if SiteConfig %>$SiteConfig.Title<% else %>$ApplicationName<% end_if %></span>