Permalink
Browse files

Add option to specify the name of Backstage to appear on the top left…

… hand corner of the global nav menu.
  • Loading branch information...
1 parent 7b667b8 commit 3a44048c979919ab3ac8c40219a9a2e2a6c45126 @kahwee committed Mar 5, 2012
View
@@ -37,6 +37,7 @@ return array(
'backstage' => array(
'class' => 'application.modules.backstage.BackstageModule',
#'autoloadModels' => false,
+ 'name' => 'Backstage',
'models' => array(
'Tag' => array(
'id' => array(
@@ -66,4 +67,4 @@ return array(
Issues?
-------
-If you have any issues, please highlight them in [Backstage's GitHub issues](https://github.com/kahwee/backstage/issues).
+If you have any issues, please highlight them in [Backstage's GitHub issues](https://github.com/kahwee/backstage/issues).
@@ -29,6 +29,7 @@
'backstage' => array(
'class' => 'application.modules.backstage.BackstageModule',
#'autoloadModels' => false,
+ 'name' => 'Backstage 2',
'models' => array(
'Tag' => array(
'id' => array(
@@ -3,6 +3,7 @@
class BackstageModule extends CWebModule {
public $models = array();
+ public $name = null;
/**
* @var models that are present in the ./protected/models directory
@@ -17,6 +18,10 @@ public function init() {
'application.models.*',
'backstage.components.*',
));
+ #Set the name of Backstage, defaults the name of the Yii application.
+ if (is_null($this->name)) {
+ $this->name = Yii::app()->name;
+ }
#Init models.
$this->buildModelsOptions();
try {
@@ -19,7 +19,7 @@
<div class="container-fluid">
<div class="nav-collapse row-fluid">
<div class="span2" style='position:fixed'>
- <?php echo CHtml::link(Yii::app()->name, array('default/index'), array('class' => 'brand')); ?>
+ <?php echo CHtml::link($this->module->name, array('default/index'), array('class' => 'brand')); ?>
</div><!-- span2 -->
<div class='span10' style='padding-left: 14.89361702%; margin-left:-14px'>
<?php

0 comments on commit 3a44048

Please sign in to comment.