<?php

/**
 * TbGridView class file.
 * @author Christoffer Niska <ChristofferNiska@gmail.com>
 * @copyright Copyright &copy; Christoffer Niska 2011-
 * @license http://www.opensource.org/licenses/bsd-license.php New BSD License
 * @package bootstrap.widgets
 */
Yii::import('bootstrap.widgets.TbNavbar');

/**
 * Bootstrap Zii grid view.
 */
class PlNavbar extends TbNavbar
{

    public $brandUrl = false;
    public $fixed = false;
    public $summary = '&nbsp;';
    public $enableHelpBtn = true;
    public $helpBtnUrl = null;

    public function run()
    {
        $helpTitleTranslations = '';
        $helpLink = '';
        
        if ($this->enableHelpBtn) {
            $helpTitleTranslations = 'title="' . __('GLOBAL_HELP_BTN') . '" data-translation-id="GLOBAL_HELP_BTN"';
            $helpLink = Yii::app()->controller->getHelpLink($this->helpBtnUrl);
        }

        array_unshift(
                $this->items, '<div class="pull-right" ' . $helpTitleTranslations . '><div class="summary">' . $this->summary . '</div>' . $helpLink . '</div>'
        );
        parent::run();
    }
}
