Example #1
0
	function menu_build($items){
		foreach($items as $item){
			$js = (empty($item['module_controller']))?'javascript: return false;':'';
			if($item['childNodes']){
				echo '<li>';
				echo anchor($item['module_controller'], $item['item_name'].' ยป', "title=\"{$item['descr']}\" onclick=\"{$js}\"");
					echo '<ul>';
						menu_build($item['childNodes']);
					echo '</ul>';
				echo '</li>'; 
			} else {
				echo '<li>'.anchor($item['module_controller'], $item['item_name'], "title=\"{$item['descr']}\" onclick=\"{$js}\"").'</li>';
			}
		}
	}
Example #2
0
<?php

include_once "includes/common.inc";
drupal_page_header();
check_php_setting("magic_quotes_gpc", 0);
menu_build("system");
$mod = arg(0);
if (isset($mod) && module_hook($mod, "page")) {
    module_invoke($mod, "page");
} else {
    if (module_hook(variable_get("site_frontpage", "node"), "page")) {
        module_invoke(variable_get("site_frontpage", "node"), "page");
    } else {
        theme("header");
        theme("footer");
    }
}
drupal_page_footer();
function menu_build($id_menu, $i = 0)
{
    global $db, $lang, $id;
    $i++;
    $and = null;
    //$and=$id_menu==0?"AND `type`<>'project'":null;
    $query = $db->query("SELECT * FROM " . TABLE_PAGES . " WHERE `sub_id`={$id_menu} AND `lang_id`='{$lang}' {$and} AND `visibility`='visible' ORDER BY `ordering`");
    //$attr=$i==1?'id="menu"':'';
    $attr = '';
    echo "<ul {$attr}>";
    while ($inf = $db->fetchArray($query)) {
        $inf[link] = explode('##', $inf[link]);
        $target = $inf[link][1] ? $inf[link][1] : 'self';
        $url = array("content" => "?options=content&id={$inf['id']}", "link" => 'http://' . $inf[link][0], "news" => "?options=news&id={$inf['id']}", "project" => "?options=project&id={$inf['id']}", "photo" => "?options=photo&id={$inf['id']}", "video" => "?options=video&id={$inf['id']}");
        $type = $inf['type'];
        $query2 = $db->query("SELECT * FROM " . TABLE_PAGES . " WHERE `sub_id`={$inf[id]} AND `lang_id`='{$lang}' AND `visibility`='visible' ORDER BY `ordering`");
        $num = $db->num($query2);
        $class = $inf['id'] == $id ? 'class=active' : '';
        if ($num > 0) {
            echo "<li><a {$class} href=\"#\">{$inf[pagename]}</a>";
        } else {
            echo "<li><a {$class} target=\"_{$target}\" href=\"{$url[$type]}\">{$inf[pagename]}</a>";
        }
        if ($num > 0) {
            $inf2 = $db->fetchArray($query2);
            $id_menu = $inf['id'];
            menu_build($id_menu, $i++);
        }
        echo "</li>";
    }
    echo "</ul>";
}
Example #4
0
require_once "classes/season.php";
if (!valid_input_data($_REQUEST)) {
    die("terminated request due to suspicious input data");
}
require_once "Handler.php";
// configure sessions
lr_configure_sessions();
/* TODO Hack! */
$smarty->assign('session_valid', $lr_session->is_valid());
$smarty->assign('session_fullname', $lr_session->attr_get('fullname'));
$smarty->assign('session_userid', $lr_session->attr_get('user_id'));
// Headers have not been sent yet
global $headers_sent;
$headers_sent = 0;
/* Build menus */
menu_build();
if (array_key_exists('q', $_GET)) {
    $q = $_GET['q'];
} else {
    $q = 'login';
}
$dispatch_path = explode('/', $q);
$handler_dir = 'Handler';
$handler_class = null;
$handler_args = array();
while (count($dispatch_path) > 0) {
    $possible = join('/', $dispatch_path);
    # Skip it if path contains anything other than lowercase alpha characters and /
    if (!preg_match('/[^a-z0-9\\/]/', $possible)) {
        $handler_file = "{$handler_dir}/{$possible}.php";
        if (file_exists($handler_file)) {
Example #5
0
					</object>
					<!--<![endif]-->
				</object>
			</div>
			<a href="/"><img src="img/logo.png" alt="Logo <?php 
echo TITLE;
?>
"/></a>
			<img src="img/header_img.png" alt="header <?php 
echo TITLE;
?>
"/>
		</div>
		<div id="menu">
			<?php 
menu_build(0);
?>
			<span class="jlang">
				<a <?php 
echo $lang == 'az' ? 'class="active"' : null;
?>
 tabindex="az" href="?language=az">az</a>
				<a <?php 
echo $lang == 'en' ? 'class="active"' : null;
?>
 tabindex="en" href="?language=en">en</a>
				<a <?php 
echo $lang == 'ru' ? 'class="active"' : null;
?>
 tabindex="ru" href="?language=ru">ru</a>
			</span>
Example #6
0
		</div>
	</div>
	<div id="links_outer">
		<div id="links"><?php 
menu_build(9);
?>
</div>
		<div class="shadow"></div>
	</div>