Location: PHPKode > projects > Basic Announce > Basic Announce Version 4.0/system/left_menu.php
<?php
// *** Make sure the file isn't accessed directly
defined('APPHP_EXEC') or die('Restricted Access');
//--------------------------------------------------------------------------

if($adm_logged){	
?>
	<table celppadding="0" cellspacing="0" border="0" width="100%">
	<tr>
		<td>			
		<div dir="<?php echo $SETTINGS['language_dir'];?>" class="curtainBox maximized menu_block_container">
			<div class="header switch menu_block_header">
				<strong>Menus: </b>
					(<span style='cursor:pointer;' onclick="toggleMenu('expand');" title="<?php echo lang("expand_all_menus");?>">+</span> <font style="font-size:9px;">/</font> <span style='cursor:pointer;' onclick="toggleMenu('collapse');" title="<?php echo lang("collapse_all_menus");?>">-</span>)
				</strong>
			</div>
		</div>
		<div dir="<?php echo $SETTINGS['language_dir'];?>" id='textfilters' style='border:0px;<?php echo (($SETTINGS['left_panel_scrolling']) ? "height:512px; width:162px; overflow-y:auto;" : ""); ?>'>
		<?php
		if($adm_status == "main admin" || $adm_status == "admin"){
			while($r__ = $res1->fetch()){
		?>	    	
			<div class="curtainBox <?php echo $FilterCatIds[$menu_group_index]; ?> menu_block_container" id="filter<?php echo $menu_group_index;?>">
				<div onclick="toggleMenu('', <?php echo $menu_group_index;?>);" class="header switch menu_block_header" >
					<span class="expand_<?php echo $SETTINGS['language_dir']; ?>" id='plusbox<?php echo $menu_group_index;?>'><img class="plusbox_img" alt="(+)" src="images/expand.gif"></span> 
					<span class="collapse_<?php echo $SETTINGS['language_dir']; ?>" id='minusbox<?php echo $menu_group_index;?>'><img class="minusbox_img" alt="(-)" src="images/collapse.gif"></span> 
					<strong><?php echo lang(str_replace(" ", "_", $r__['name']), false);?></strong>					
				</div>
				<div class="toggleBox curtain filterValues" id="filterPopularFilterValues<?php echo $menu_group_index;?>">
				<ul class="case1 popularFilterValues <?php echo $SETTINGS['language_dir'];?>">
				<?php  
				
					if($adm_status == "main admin"){
						$sql = "SELECT *						
							FROM ".TABLE_MENU."
							WHERE is_menu_group = 0 AND
								  is_hidden = 0 AND
								  is_menu_item = 1 AND
								  parent_id = ".(int)$r__['id']."
							ORDER BY order_index ASC";
					}else if($adm_status == "admin"){
						$sql = "SELECT ".TABLE_MENU.".*						
							FROM ".TABLE_MENU."
								INNER JOIN ".TABLE_MENU_ACCESS_RIGHTS." ON ".TABLE_MENU.".id = ".TABLE_MENU_ACCESS_RIGHTS.".menu_id
								INNER JOIN ".TABLE_ADMINS." ON ".TABLE_MENU_ACCESS_RIGHTS.".admin_id = ".TABLE_ADMINS.".id    
							WHERE
								  ".TABLE_ADMINS.".id = ".(int)$_SESSION['adm_user_id']." AND
								  ".TABLE_MENU_ACCESS_RIGHTS.".is_accessible = 1 AND
								  ".TABLE_MENU.".is_menu_group = 0 AND
								  ".TABLE_MENU.".is_hidden = 0 AND
								  ".TABLE_MENU.".is_menu_item = 1 AND
								  ".TABLE_MENU.".parent_id = ".(int)$r__['id']." 
							ORDER BY order_index ASC";							
					}
					$res2 = $db->Query($sql);
					while($r__ = $res2->fetch()){
						if($r__['file_type_id'] == "0"){ 		// system pages
							$page_name = "system/".$r__['page_name'];
						}else if($r__['file_type_id'] == "1"){ 	// static_page
							$page_name = "system/static_pages.php?page=".$r__['id'];
						}else if($r__['file_type_id'] == "4"){ 	// link
							$page_name = $r__['page_name'];
						}else{
							$page_name = "pages/".$r__['page_name'];
						}
						echo "<li><a target='frameMain' href='".$page_name."' onclick='resetSessionTimeout(); prepareFilterBlocks()'>".lang(str_replace(" ", "_", $r__['name']), false)."</a></li>";	
					}								
				?>
				</ul>
				</div>
			</div>
			<?php $menu_group_index++; ?>			
		<?php
			}
		}else{
		?>
			<div class="curtainBox <?php echo $FilterCatIds[$menu_group_index]; ?> menu_block_container" id="filter<?php echo $menu_group_index;?>">
				<div onclick="toggleMenu('', <?php echo $menu_group_index;?>);" class="header switch menu_block_header">
					<span class="expand_<?php echo $SETTINGS['language_dir']; ?>" id='plusbox<?php echo $menu_group_index;?>'><img class="plusbox_img" alt="(+)" src="images/expand.gif"></span> 
					<span class="collapse_<?php echo $SETTINGS['language_dir']; ?>" id='minusbox<?php echo $menu_group_index;?>'><img class="minusbox_img" alt="(-)" src="images/collapse.gif"></span> 
					<strong><?php echo lang('general');?></strong>
				</div>
				<div class="toggleBox curtain filterValues" id="filterPopularFilterValues<?php echo $menu_group_index;?>">
				<ul class="case1 popularFilterValues <?php echo $SETTINGS['language_dir'];?>">
					<li><a target='frameMain' href='system/user_home.php' onclick='resetSessionTimeout(); prepareFilterBlocks()'><?php echo lang('home'); ?></a></li>
					<li><a target='frameMain' href='system/user_edit_account.php' onclick='resetSessionTimeout(); prepareFilterBlocks()'><?php echo lang('edit_account'); ?></a></li>			
				</ul>
				</div>
			</div>

			<?php if($menu_group_count > 1){			
				$menu_group_index++; 
				$sql = "SELECT ".TABLE_MENU.".*
						FROM ".TABLE_MENU_ACCESS_RIGHTS."
							INNER JOIN ".TABLE_MENU." ON ".TABLE_MENU_ACCESS_RIGHTS.".menu_id = ".TABLE_MENU.".id
							INNER JOIN ".TABLE_USERS." ON ".TABLE_MENU_ACCESS_RIGHTS.".user_id = ".TABLE_USERS.".id
						WHERE
							".TABLE_MENU_ACCESS_RIGHTS.".user_id = '".(int)$_SESSION['adm_user_id']."' AND
							".TABLE_MENU_ACCESS_RIGHTS.".is_accessible = 1 AND
							".TABLE_MENU.".is_menu_group = 0 AND
							(".TABLE_MENU.".file_type_id = 1 OR ".TABLE_MENU.".file_type_id = 2)";
				$res2 = $db->Query($sql);
				if($db->RowCount() > 0){
					echo "<div class='curtainBox ".$FilterCatIds[$menu_group_index]." menu_block_container' id='filter".$menu_group_index."'>
						<div onclick=\"toggleMenu('', ".$menu_group_index.");\" class='header switch menu_block_header'>
							<span class='expand_".$SETTINGS['language_dir']."' id='plusbox".$menu_group_index."'><img class='plusbox_img' alt='(+)' src='images/expand.gif'></span> 
							<span class='collapse_".$SETTINGS['language_dir']."' id='minusbox".$menu_group_index."'><img class='minusbox_img' alt='(-)' src='images/collapse.gif'></span> 
							<strong>".lang('pages')."</strong>
						</div>
						<div class='toggleBox curtain filterValues' id='filterPopularFilterValues".$menu_group_index."'>
						<ul class='case1 popularFilterValues ".$SETTINGS['language_dir']."'>";								
				}							
				while($r__ = $res2->fetch()){
					if($r__['file_type_id'] == "2"){
						$page_name = "pages/".$r__['page_name'];
						echo "<li><a target='frameMain' href='".$page_name."' onclick='resetSessionTimeout(); prepareFilterBlocks()'>".$r__['name']."</a></li>";										
					}else{
						$page_name = "system/static_pages.php?page=".$r__['id'];
						echo "<li><a target='frameMain' href='".$page_name."' onclick='resetSessionTimeout(); prepareFilterBlocks()'>".$r__['name']."</a></li>";	
					}
				}
				if($db->RowCount() > 0){
					echo "</ul></div>";
				}
			}			
		} ?>
		</div>
		</td>
	</tr>				
	</table>		
<?php } ?>
Return current item: Basic Announce