<?php
/**
* @author:  Bunzia Alexander <nifus@mail.ru> <http://www.weblancer.net/users/nifus/>
* @copyright: Copyright (c) 2010, Bunzia Alexander
* @version: 1.0
* @license: http://www.gnu.org/copyleft/gpl.html GNU/GPL
* @package: HiLo CMS
*/


function menu_universal($options){
global $MAIN_DB;

  include_once(MAIN_SOURCE_PATH.'/modules/menu/inc/class.menu.php');
  if ( empty($options) ){
    return false;
  }
  $sql = "
    SELECT c_left,c_right,c_level,tmpl 
    FROM ".$MAIN_DB-> prefix("menu")." 
    WHERE c_id='$options'";
  list($c_left,$c_right,$c_level,$c_tmpl) = $MAIN_DB -> fetch_array($MAIN_DB -> query($sql) );
  
  if ( empty($c_tmpl) ){
    return false;
  }
 
  $p = new menuQuery('f');
 
	$p -> where_more('c_level',$c_level);
	$p -> where_more('c_left',$c_left);
	$p -> where_less('c_right',$c_right);
	$p -> where_lang(MAIN_USER_LANG);
	$p -> order_left('ASC');
	$p -> get('c_level,c_left,c_right,c_id, url,c_name, area as `active` ',false);
	$rows = $p -> rows();


	eval($c_tmpl);
 
 
	return $menu;
}





?>
