Пример #1
0
function render_submenu($parent, $menu)
{
    $out = '';
    foreach ($menu as $key => $item) {
        $children = isset($item['children']) ? render_submenu("{$parent}::{$key}", $item['children']) : '';
        $out .= render_item($item, "navbar::{$parent}::{$key}", $children);
        //$debug .= "{$parent}::{$key}<br>";
    }
    $out = <<<HTML
\t\t\t<ul>
{$out}
\t\t\t</ul>

HTML;
    return $out;
}
Пример #2
0
function render_menu()
{
    global $CONF, $CUR_TEMPLATE, $MODULES, $MENU, $point, $PAGE;
    //We use default template
    if (isset($_SESSION[cur_templ])) {
        $template = $_SESSION[cur_templ];
    } else {
        $template = $CONF[default_template];
    }
    //Include PHP Layer Menù for Layers configuration
    require_once $CONF[path_base] . $CONF[dir_framework] . "external_lib/phplm/lib/PHPLIB.php";
    require_once $CONF[path_base] . $CONF[dir_framework] . "external_lib/phplm/lib/layersmenu-common.inc.php";
    require_once $CONF[path_base] . $CONF[dir_framework] . "external_lib/phplm/lib/layersmenu.inc.php";
    $CUR_TEMPLATE[JS][count($CUR_TEMPLATE[JS])] = $CONF[url_base] . $CONF[dir_framework] . "external_lib/phplm/libjs/layersmenu-browser_detection.js";
    $CUR_TEMPLATE[JS][count($CUR_TEMPLATE[JS])] = $CONF[url_base] . $CONF[dir_framework] . "external_lib/phplm/libjs/layersmenu-library.js";
    $CUR_TEMPLATE[JS][count($CUR_TEMPLATE[JS])] = $CONF[url_base] . $CONF[dir_framework] . "external_lib/phplm/libjs/layersmenu.js";
    $myDirParh = $CONF[path_base] . $CONF[dir_framework] . "external_lib/phplm/";
    $myWwwPath = $CONF[url_base] . $CONF[dir_framework] . "external_lib/phplm/";
    $mid = new LayersMenu();
    $mid->setDirroot($myDirParh);
    $mid->setLibjsdir($myDirPath . 'libjs/');
    $mid->setImgdir($myDirPath . 'menuimages/');
    $mid->setImgwww($myWwwPath . 'menuimages/');
    $mid->setIcondir($CONF[path_base] . $CONF[dir_template] . $template . "/images/ico/");
    $mid->setIconwww($CONF[url_base] . $CONF[dir_template] . $template . "/images/ico/");
    $mid->setTpldir($CONF[path_base] . $CONF[dir_template] . $template . "/menu_template/");
    $mid->setHorizontalMenuTpl('layersmenu-horizontal_menu.ihtml');
    $mid->setSubMenuTpl('layersmenu-sub_menu.ihtml');
    $pt = ".";
    $temppt = $pt;
    for ($x = 1; $x < 11; $x++) {
        $point[$x] = $temppt;
        $temppt .= $pt;
    }
    $main_level = explode(",", $CONF[menu_order]);
    $level = 1;
    foreach ($main_level as $v) {
        $string_menu2 = "";
        if (isset($MENU[$v][0][title])) {
            foreach ($MENU[$v][0] as $k => $v2) {
                if (is_int($k)) {
                    $string_menu2 .= render_submenu($level + 1, $v2, $v);
                }
            }
            if (strlen($string_menu2) > 1 || $MENU[$v][0][perm] == 1) {
                $string_menu .= $point[$level] . "|" . $MENU[$v][0][title] . "|" . $MENU[$v][0][page] . "||" . $MENU[$v][0][icon] . "\n" . $string_menu2;
            }
        }
    }
    $mid->setMenuStructureString(".|Home|" . $CONF[url_base] . "main.php||ico_home_peq.gif\n" . $string_menu);
    $mid->setIconsize(16, 16);
    $mid->parseStructureForMenu('hormenu1');
    $mid->newHorizontalMenu('hormenu1');
    $PAGE[MENU_HEADER] = $mid->makeHeader();
    $PAGE[MENU_TAB] = $mid->getMenu("hormenu1");
    $PAGE[MENU_FOOTER] = $mid->makeFooter();
}
Пример #3
0
    case 1:
        // Last 10 dated
        render_submenu();
        last10($objDb, true);
        break;
    case 2:
        // Search
        render_submenu();
        render_search();
        if (isset($_GET["keywords"]) && trim($_GET["keywords"]) != "") {
            search($objDb, $_GET["keywords"]);
        }
        break;
    case 3:
        // Category
        render_submenu();
        render_category($objDb);
        if (isset($_GET["category"])) {
            category($objDb, $_GET["category"]);
        } else {
            category($objDb, 0);
        }
        break;
    case 4:
        // Timeline
        // Show a line with graphs indicating amount of data on a date, normalize it by the most found amount
        render_timeline($objDb);
        break;
}
?>
	</body>