Location: PHPKode > projects > phlyMail Lite > phlymail/config/lib/menu.php
<?php
/**
 * @package phlyMail Nahariya 4.0+
 * @subpackage Config
 * @copyright 2003-2010 phlyLabs, Berlin (http://phlylabs.de)
 * @version 4.0.6mod1 2010-09-08
 */
// Only valid within phlyMail
if (!defined('_IN_PHM_')) die();

$global_menu_itms = array
        (0  => array('name' => $WP_msg['MenuHome'],     'action' => 'home',                   'type' => 'i')
        ,1  => array('name' => $WP_msg['setgen'],       'action' => 'general',                'type' => 'i')
        ,2  => array('name' => $WP_msg['setadv'],       'action' => 'advanced',               'type' => 'i')
        ,3  => array('name' => $WP_msg['setplugs'],     'action' => 'handlers',               'type' => 'i')
        ,4  => array('name' => $WP_msg['setquota'],     'action' => 'quotas',                 'type' => 'i')
        ,5  => array('name' => $WP_msg['setuser'],      'action' => 'users',                  'type' => 'i')
        ,6  => array('name' => $WP_msg['setSec'],       'action' => 'security',               'type' => 'i')
        ,7  => array('name' => $WP_msg['setJunk'],      'action' => 'junk',                   'type' => 'i')
        ,8  => array('name' => $WP_msg['setDB'],        'action' => 'driver',                 'type' => 'i')
        ,9  => array('name' => $WP_msg['setAU'],        'action' => 'AU',                     'type' => 'i')
        ,15 => array('name' => $WP_msg['diagnosis'],    'action' => 'diag',                   'type' => 'i')
        ,16 => array('name' => $WP_msg['MenuConfig'],   'action' => '-',                      'type' => 'm')
        ,17 => array('name' => $WP_msg['MenuSettings'], 'action' => 'config',                 'type' => 's')
        ,18 => array('name' => $WP_msg['MenuAdmins'],   'action' => 'config.users',           'type' => 's')
        ,19 => array('name' => 'SMS + Fax',             'action' => 'sms',                    'type' => 'i')
        ,25 => array('name' => 'Upgrade',               'action' => 'upgrade',                'type' => 'i')
        );
$types = array('i' => 'item', 's' => 'subitem', 'm' => 'menu');
$Menu = new fxl_template(CONFIGPATH.'/templates/menu.tpl');
$L = $Menu->get_block('line');

foreach ($global_menu_itms as $k) {
    if (!isset($k['action'])) $k['action'] = '';
	if (!isset($k['screen'])) $k['screen'] = '';
    $C = $L->get_block($types[$k['type']]);
    $C->assign(array('link_target' => htmlspecialchars($link_base.$k['action'].($k['screen'] != '' ? '&screen='.$k['screen'] : '')), 'msg_line' => $k['name']));
    if ($action == $k['action'] && $screen == $k['screen']) {
        $C->assign_block('active_'.$k['type']);
    } else {
        $C->assign_block('inactive_'.$k['type']);
    }
    $L->assign($types[$k['type']], $C);
    $L->assign('confpath', CONFIGPATH);
    $Menu->assign('line', $L);
    $L->clear();
}

$moddir = CONFIGPATH.'/modules';

// Nothing more to do - no additional modules here
if (!file_exists($moddir) && !is_dir($moddir)) return;

$M = opendir($moddir);
while (false !== ($sub = readdir($M))) {
    if ('.' == $sub) continue;
    if ('..' == $sub) continue;
	if (!is_dir($moddir.'/'.$sub)) continue;
	if (file_exists($moddir.'/'.$sub.'/menu.ini.php')
	       && is_readable($moddir.'/'.$sub.'/menu.ini.php')) {
	    $submen = parse_ini_file($moddir.'/'.$sub.'/menu.ini.php', true);
	    if (isset($submen['main']['active']) && $submen['main']['active'] != 1) continue;
	    if (file_exists($moddir.'/'.$sub.'/lang.'.$WP_conf['language'].'.php')) {
	        require_once($moddir.'/'.$sub.'/lang.'.$WP_conf['language'].'.php');
	    } else {
	        require_once($moddir.'/'.$sub.'/lang.en.php');
	    }
	    foreach ($submen as $k) {
            $k['name'] = $modmsg[$k['name']];
	        if (!isset($k['action'])) $k['action'] = '';
	        if (!isset($k['screen'])) $k['screen'] = '';
	        $C = $L->get_block($types[$k['type']]);
	        $C->assign(array
	               ('link_target' => htmlspecialchars($link_base.$k['action'].($k['screen'] != '' ? '&screen='.$k['screen'] : '').'&module='.$sub)
	               ,'msg_line' => $k['name']
	               ));
	        if (isset($_REQUEST['module']) && $_REQUEST['module'] == $sub && $screen == $k['screen']) {
	            $C->assign_block('active_'.$k['type']);
	        } else {
	            $C->assign_block('inactive_'.$k['type']);
	        }
	        $L->assign($types[$k['type']], $C);
	        $L->assign('confpath', CONFIGPATH);
	        $Menu->assign('line', $L);
	        $L->clear();
	        if (isset($k['usermod'])) {
	            $_PM_['useredit'][] = array($modmsg[$k['usermod']], $link_base.'view&module='.$sub.'&whattodo=edituser');
	        }
	    }
	}
}
closedir($M);
?>
Return current item: phlyMail Lite