File: menu.php3

package info (click to toggle)
imp 3%3A2.2.6-5.2
  • links: PTS
  • area: main
  • in suites: woody
  • size: 5,476 kB
  • ctags: 766
  • sloc: php: 4,253; sh: 831; makefile: 98; perl: 50; pascal: 15
file content (89 lines) | stat: -rw-r--r-- 2,775 bytes parent folder | download | duplicates (2)
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
<?php

/*
  
  File: menu.php3
  $Author: rkrusty $
  $Revision: 2.9.2.19 $
  $Date: 2000/11/20 10:44:18 $
  
  IMP: Copyright 1998, 1999, 2000 Charles J. Hagenbuch <chuck@horde.org>
  
  You should have received a copy of the GNU Public
  License along with this package; if not, write to the
  Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  Boston, MA 02111-1307, USA.
  
*/

function set_menu ($text) {
	global $default;
  
	/* skip any comment lines */
	if (preg_match("|([^#]*)#.*|", $text, $regs)) {
		$text = $regs[1];
    
		/* If there was something before the comment, make it a complete line */
		if (strlen($text) > 0) {
			$text = $text . "\n";
		}
	}
	if (strstr($text, '<SEPERATOR>')) {
		$text = '<tr><td colspan="2">&nbsp;</td></tr>' . "\n";
	} elseif (preg_match("|(.*)<(.*)>(.*)\n|", $text, $regs)) {
		$text = '<tr bgcolor="' . $default->dark_bg. '"><td valign="top"><a class="menuitem" href="' . $regs[1]. '" target="_blank"><img border="0" align="top" src="' . $default->graphics_url . '/' . $regs[3] . '" width="18" height="18" alt="' . $regs[2] . '"></a></td><td><a class="menuitem" href="' . $regs[1]. '" target="_blank"><font size="' . $default->font->size . '" face="' . $default->font->face. '">' . $regs[2] . '</font></a></td></tr>' . "\n";
	}
	return $text;
}


require '../lib/horde.lib';
require './lib/imp.lib';           /* IMPlib is the IMP function library  */
require '../config/horde.php3';
require './config/defaults.php3';  /* Defaults configuration file */
require './config/html.php3';
require './config/lang.php3';

$language = select_lang();
require './lib/postconf.php3';
require "./locale/$language/menu.lang";
require './locale/local/menu.lang';
require './config/lang.php3';

$this_client = new WebClient;

error_reporting($default->error_level);  /* set error level from imp.lib   */

/* if there is an existing session, display the full menu */
page_open(array('sess' => 'HordeSession'));
page_close();
if (isset($imp)) {
    $menu = IMPMENU_MAIN;
    $imp->unpickle();
}

$extra_menus = '';
$menu_array = @file('./config/menu.txt');
if (@count($menu_array) > 0) {
	$extra_menus .= "<tr><td>&nbsp;</td></tr>\n";
}
for ($j = 0; $j < count($menu_array); $j++) {
	$extra_menus .= set_menu($menu_array[$j]);
}

if (!isset($menu)) $menu = IMPMENU_DORMANT;
if ($menu == IMPMENU_DORMANT) $title = $lang->login_again;

$sidebar = true;
require "$default->include_dir/doctype.inc";
require "$default->include_dir/generic-header.inc";
if (!$default->minimum_popups && !$this_client->rather_not_popup) {
	include './lib/js/open_compose_win.js';
}
require './lib/js/open_contacts.js';
if ($menu != IMPMENU_BLANK) {
	include "$default->include_dir/menu/menu.inc";
}
require "$default->include_dir/generic-footer.inc";

?>