Horde_Core_Ui_Tabs::render PHP Method

render() public method

Renders the tabs.
public render ( string $active_tab = null, string $class = 'tabset' )
$active_tab string If specified, the name of the active tab. If not, the active tab is determined automatically.
$class string The CSS class of the tabset.
    public function render($active_tab = null, $class = 'tabset')
    {
        $html = "<div class=\"{$class}\"><ul>\n";
        $active = $_SERVER['PHP_SELF'] . $this->_vars->get($this->_name);
        foreach ($this->_tabs as $tab) {
            $link = $this->_addPreserved($tab['link']);
            if (!is_null($this->_name) && !is_null($tab['tabname'])) {
                $link->add($this->_name, $tab['tabname']);
            }
            $classes = array();
            if (isset($tab['class'])) {
                $classes[] = $tab['class'];
            }
            if (!is_null($active_tab) && (string) $active_tab == (string) $tab['tabname'] || $active == $tab['link'] . $tab['tabname']) {
                $classes[] = 'horde-active';
            }
            $class = $classes ? ' class="' . implode(' ', $classes) . '"' : '';
            $id = '';
            if (!empty($tab['id'])) {
                $id = ' id="' . htmlspecialchars($tab['id']) . '"';
            }
            if (!isset($tab['target'])) {
                $tab['target'] = '';
            }
            if (!isset($tab['onclick'])) {
                $tab['onclick'] = '';
            }
            $accesskey = Horde::getAccessKey($tab['title']);
            if (!empty($tab['img'])) {
                $img = Horde_Themes_Image::tag($tab['img']);
            } else {
                $img = '';
            }
            $html .= '<li' . $class . $id . '>' . $link->link(array('target' => $tab['target'], 'onclick' => $tab['onclick'], 'accesskey' => $accesskey)) . $img . Horde::highlightAccessKey(str_replace(' ', '&nbsp;', $tab['title']), $accesskey) . "</a> </li>\n";
        }
        return $html . "</ul></div><br class=\"clear\" />\n";
    }

Usage Example

Example #1
0
        $title = _("Advanced Search");
        if (isset($results)) {
            $page_output->addInlineJsVars(array('TurbaSearch.advanced' => true));
        }
        $page_output->addInlineScript(array('$("name").focus()'), true);
        break;
    case 'duplicate':
        $title = _("Duplicate Search");
        break;
}
$page_output->addScriptFile('search.js');
$page_output->addScriptFile('quickfinder.js', 'horde');
$page_output->addScriptFile('scriptaculous/effects.js', 'horde');
$page_output->addScriptFile('redbox.js', 'horde');
if (isset($view) && is_object($view)) {
    Turba::addBrowseJs();
}
$page_output->header(array('title' => $title));
$notification->notify(array('listeners' => 'status'));
echo $tabs->render($search_mode);
echo $headerView->render('header');
echo $searchView->render($search_mode);
if (!empty($vbookView)) {
    echo $vbookView->render('vbook');
}
echo $searchView->render('footer');
if (isset($view) && is_object($view)) {
    require TURBA_TEMPLATES . '/browse/header.inc';
    $view->display();
}
$page_output->footer();
All Usage Examples Of Horde_Core_Ui_Tabs::render