<?php
$showDatabasesUrl    = $this->url(array('controller'=>'sql','action'=>'show.databases'));
$showTablesUrl       = $this->url(array('controller'=>'sql','action'=>'show.tables'));
$showTableDataUrl    = $this->url(array('controller'=>'sql','action'=>'show.table.data'));
$sqlBoxUrl           = $this->url(array('controller'=>'sql','action'=>'sqlbox'));

// get action name to set the active item in TabBar
$actionName = Zend_Controller_Front::getInstance()->getRequest()->getActionName();

// format action name and escape possible dot in action name
$actionName = str_replace('.', '\\\.', $actionName);
$this->jQuery()->javascriptCaptureStart(); ?>
    // set selected tab
    $(document).ready(function() {
        $('#<?php echo $actionName; ?>').addClass("ui-state-active");
        $('#<?php echo $actionName; ?>').addClass("ui-tabs-selected");
    });
<?php $this->jQuery()->javascriptCaptureEnd(); ?>
<div id="breadcrumb">
    <ul>
        <li>
            <a href="#">
            <?php
                echo $this->getIcon('Server', '', 16)
                     . $this->config->get('config.dbuser.user') .'@'
                     . $this->config->get('config.dbuser.host');
                $port = $this->config->get('config.dbuser.port');
                if ($port > 0) {
                    echo ':' . $port;
                }
                ?>
             </a>
        </li>
        <li>
            <a href="<?php echo $showDatabasesUrl;?>">
                <?php echo$this->getIcon('Database', '', 16);?>
                <?php echo $this->out($this->config->get('dynamic.dbActual'));?>
            </a>
        </li>
        <?php
        $actualTable = $this->config->get('dynamic.tableActual');
        if ($actualTable > '') {
        ?>
            <li>
                <a href="#">
                    <?php echo$this->getIcon('Tables', '', 16);?>
                    <?php echo $this->out($actualTable);?>
                </a>
            </li>
        <?php
        }
        ?>
    </ul>
</div>
<br />

<div id="headnavi" class="ui-tabs ui-widget ui-widget-content ui-corner-all">
    <ul class="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all">
        <li id="show.databases" class="ui-state-default ui-corner-top" onmouseover="tabOver(this)" onmouseout="tabOut(this)">
            <a href="<?php echo $showDatabasesUrl;?>">
                <?php echo$this->getIcon('Database', '', 16);?>
                <?php echo $this->lang->L_DBS;?>
            </a>
        </li>
        <li id="show.tables" class="ui-state-default ui-corner-top" onmouseover="tabOver(this)" onmouseout="tabOut(this)">
            <a href="<?php echo $showTablesUrl;?>">
                <?php echo$this->getIcon('Tables', '', 16);?>
                <?php echo $this->lang->L_TABLES;?>
            </a>
        </li>
        <li id="show.table.data" class="ui-state-default ui-corner-top" onmouseover="tabOver(this)" onmouseout="tabOut(this)">
            <a href="<?php echo $showTableDataUrl;?>">
                <?php echo$this->getIcon('Tabledata', '', 16);?>
                <?php echo $this->lang->L_RECORDS;?>
            </a>
        </li>
        <li id="sqlbox"  class="ui-state-default ui-corner-top" onmouseover="tabOver(this)" onmouseout="tabOut(this)">
            <a href="<?php echo $sqlBoxUrl;?>">
                <?php echo$this->getIcon('SqlBrowser', '', 16);?>
                <?php echo $this->lang->L_SQLBOX;?>
            </a>
        </li>
    </ul>
</div>
