10 Yii::import(
'booster.widgets.TbCollapse');
88 if ($this->brand !==
false) {
89 if (!isset($this->brand)) {
90 $this->brand = CHtml::encode(Yii::app()->name);
93 if (!isset($this->brandUrl)) {
94 $this->brandUrl = Yii::app()->homeUrl;
97 $this->brandOptions[
'href'] = CHtml::normalizeUrl($this->brandUrl);
99 if (isset($this->brandOptions[
'class'])) {
100 $this->brandOptions[
'class'] .=
' navbar-brand';
102 $this->brandOptions[
'class'] =
'navbar-brand';
106 $classes = array(
'navbar');
108 if (isset($this->type) && in_array($this->type, array(self::TYPE_DEFAULT, self::TYPE_INVERSE))) {
114 if ($this->fixed !==
false && in_array($this->fixed, array(self::FIXED_TOP, self::FIXED_BOTTOM))) {
118 if (!empty($classes)) {
119 $classes = implode(
' ', $classes);
120 if (isset($this->htmlOptions[
'class'])) {
121 $this->htmlOptions[
'class'] .=
' ' . $classes;
123 $this->htmlOptions[
'class'] = $classes;
135 echo CHtml::openTag(
'nav', $this->htmlOptions);
138 echo
'<div class="navbar-header">';
139 if($this->collapse) {
140 $this->controller->widget(
'booster.widgets.TbButton', array(
141 'label' =>
'<span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span>',
142 'encodeLabel' =>
false,
143 'htmlOptions' => array(
144 'class' =>
'navbar-toggle',
145 'data-toggle' =>
'collapse',
146 'data-target' =>
'#'.self::CONTAINER_PREFIX.$this->
id,
151 if ($this->brand !==
false) {
152 if ($this->brandUrl !==
false) {
153 echo CHtml::openTag(
'a', $this->brandOptions) . $this->brand .
'</a>';
155 unset($this->brandOptions[
'href']);
156 echo CHtml::openTag(
'span', $this->brandOptions) . $this->brand .
'</span>';
161 echo
'<div class="collapse navbar-collapse" id="'.self::CONTAINER_PREFIX.$this->id.
'">';
162 foreach ($this->items as $item) {
163 if (is_string($item)) {
166 if (isset($item[
'class'])) {
167 $className = $item[
'class'];
168 unset($item[
'class']);
170 $this->controller->widget($className, $item);
174 echo
'</div></div></nav>';
185 return $this->fluid ?
'container-fluid' :
'container';