Logo Search packages:      
Sourcecode: nag2 version File versions  Download package

Nag::getMenu ( returnType = 'object' )

Build Nag's list of menu items.

Definition at line 399 of file Nag.php.

References getDefaultTasklist().

    {
        global $conf, $registry, $browser, $print_link;

        require_once 'Horde/Menu.php';

        $menu = &new Menu();
        $menu->add(Horde::applicationUrl('list.php'), _("_List Tasks"), 'nag.png', null, null, null, basename($_SERVER['PHP_SELF']) == 'index.php' ? 'current' : null);
        if (Nag::getDefaultTasklist(PERMS_EDIT)) {
            $menu->add(Horde::applicationUrl(Util::addParameter('task.php', 'actionID', 'add_task')), _("_New Task"), 'add.png', null, null, null, Util::getFormData('task') ? '__noselection' : null);
        }
        $menu->add(Horde::applicationUrl('search.php'), _("_Search"), 'search.png', $registry->getImageDir('horde'));

        if (Auth::getAuth()) {
            $menu->add(Horde::applicationUrl('tasklists.php'), _("_My Tasklists"), 'tasklists.png');
        }

        /* Import/Export. */
        if ($conf['menu']['import_export']) {
            $menu->add(Horde::applicationUrl('data.php'), _("_Import/Export"), 'data.png', $registry->getImageDir('horde'));
        }

        /* Print. */
        if ($conf['menu']['print'] && isset($print_link) && $browser->hasFeature('javascript')) {
            $menu->add('#', _("_Print"), 'print.png', $registry->getImageDir('horde'), '', "popup('$print_link'); return false;");
        }

        if ($returnType == 'object') {
            return $menu;
        } else {
            return $menu->render();
        }
    }

Here is the call graph for this function:


Generated by  Doxygen 1.6.0   Back to index