File: menu.php

package info (click to toggle)
horde2 2.2.8-1sarge3
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 3,832 kB
  • ctags: 2,897
  • sloc: php: 12,784; sh: 954; sql: 149; makefile: 104; perl: 97; xml: 24; pascal: 6
file content (52 lines) | stat: -rw-r--r-- 1,844 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php
/*
 * $Horde: horde/menu.php,v 2.14.2.15 2005/01/03 11:25:44 jan Exp $
 *
 * Copyright 1999-2005 Charles J. Hagenbuch <chuck@horde.org>
 * Copyright 1999-2005 Jon Parise <jon@horde.org>
 *
 * See the enclosed file COPYING for license information (LGPL).  If you
 * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
 */

define('HORDE_BASE', dirname(__FILE__));
require_once HORDE_BASE . '/lib/base.php';
require_once HORDE_BASE . '/lib/Menu.php';

/* Define target */
$opener = false;
if ($conf['menu']['floating_bar'] && (!$browser->hasQuirk('avoid_popup_windows'))) {
    $opener = true;
    $title = _("Horde System");
}

$js_onLoad = null;
require HORDE_TEMPLATES . '/common-header.inc';

/* Build the menu out of the modules array */
$moduletext = '';

/*
 * Now print a link for each module (no links are fine since there
 * will be other stuff here)
 */
foreach ($registry->applications as $service => $params) {
    if ($params['status'] == 'active') {
        if (!$opener) {
            $moduletext .= Menu::createItem(Horde::url($params['webroot'] . '/' . (isset($params['initial_page']) ? $params['initial_page'] : '')),
                                            gettext($params['name']), $params['icon'], '', 'horde_main');
        } else {
            $moduletext .= Menu::createItem('', gettext($params['name']), $params['icon'],
                                            '', 'horde_main',
                                            'window.opener.location.href=\'' . Horde::url($params['webroot']) . '\'; return false;');
        }
    }
}

/* Add a logout link */
$moduletext .= Menu::createItem(Horde::applicationUrl('login.php?reason=logout'), _("Log out"), 'logout.gif', null, 'horde_main');

require HORDE_TEMPLATES . '/horde/modules.inc';
require HORDE_TEMPLATES . '/common-footer.inc';

?>