Hermes::tabs PHP Method

tabs() public static method

public static tabs ( )
    public static function tabs()
    {
        /* Build search mode tabs. */
        $sUrl = Horde::selfUrl();
        $tabs = new Horde_Core_Ui_Tabs('search_mode', Horde_Variables::getDefaultVariables());
        $tabs->addTab(_("Summary"), $sUrl, 'summary');
        $tabs->addTab(_("By Date"), $sUrl, 'date');
        $tabs->addTab(_("By Employee"), $sUrl, 'employee');
        $tabs->addTab(_("By Client"), $sUrl, 'client');
        $tabs->addTab(_("By Job Type"), $sUrl, 'jobtype');
        $tabs->addTab(_("By Cost Object"), $sUrl, 'costobject');
        if ($mode = Horde_Util::getFormData('search_mode')) {
            $GLOBALS['session']->set('hermes', 'search_mode', $mode);
        } elseif (!$GLOBALS['session']->exists('hermes', 'search_mode')) {
            $GLOBALS['session']->set('hermes', 'search_mode', 'summary');
        }
        return $tabs->render($GLOBALS['session']->get('hermes', 'search_mode'));
    }

Usage Example

Ejemplo n.º 1
0
Archivo: time.php Proyecto: horde/horde
        $item = $vars->get('item');
        if (is_null($item) || !count($item)) {
            $notification->push(_("No timeslices were selected to submit."), 'horde.error');
        } else {
            foreach (array_keys($item) as $id) {
                $time[] = array('id' => $id);
            }
            try {
                $GLOBALS['injector']->getInstance('Hermes_Driver')->markAs('submitted', $time);
                $notification->push(_("Your time was successfully submitted."), 'horde.success');
                $vars = new Horde_Variables();
            } catch (Horde_Exception $e) {
                $notification->push(sprintf(_("There was an error submitting your time: %s"), $e->getMessage()), 'horde.error');
            }
        }
        break;
}
// We are displaying all time.
$tabs = Hermes::tabs();
$criteria = array('employee' => $GLOBALS['registry']->getAuth(), 'submitted' => false, 'link_page' => 'time.php');
$table = new Hermes_Table('week', $vars, array('title' => _("My Unsubmitted Time"), 'name' => 'hermes/hours', 'params' => $criteria));
$template = new Horde_Template();
$template->setOption('gettext', true);
$template->set('postUrl', Horde::url('time.php', false, -1));
$template->set('sessionId', Horde_Util::formInput());
$template->set('table', $table->render());
$page_output->header(array('title' => _("My Time")));
$notification->notify(array('listeners' => 'status'));
echo $tabs;
echo $template->fetch(HERMES_TEMPLATES . '/time/form.html');
$page_output->footer();
All Usage Examples Of Hermes::tabs