array( 'name'=>'Новости', 'title'=>'Новости сети', ), 'connect'=>array( 'name'=>'Подключение к сети', 'title'=>'Подключитесь к сети прямо сейчас!', 'submenu'=>array( 'map'=>array( 'name'=>'Зона обслуживания', 'title'=>'Зона обслуживания абонентов', ), 'wifi'=>array( 'name'=>'Wi-Fi зоны', 'title'=>'Бесплатные Wi-Fi зоны г. Кириши', ), 'docs'=>array( 'name'=>'Документы', 'title'=>'Документы' ) ) ), */ class Menu { public $html=array(); public $title=''; //'Error'; public $first_key=array(); private $_public_pages_path=''; function __construct(Localization $lang, $uri_chunks, $public_pages_path) { $menu_config = Config::$menu; $this->first_key = array_key_first($menu_config); $this->_public_pages_path=$public_pages_path; $titles=[]; $translate_path=$this->_public_pages_path.'_translate.cache/'; $translate_file=$translate_path.$lang->get_lang().'.menu.php'; #echo $translate_path."\n"; #echo getcwd()."\n"; if(!is_dir($translate_path)) { mkdir($translate_path); } if(file_exists($translate_file)) { $this->html=file_get_contents($translate_file); if(getenv('APPLICATION_ENV') != 'development') { $this->html=preg_replace('#\t
  • \n#','',$this->html); } return; } //var_dump($this->_public_pages_path);exit; if(getenv('APPLICATION_ENV') != 'development'){ unset($menu_config['sqlite']); } $this->html=' '."\n"; /* if($this->title=='Error'){ $other_titles = Config::$other_titles; if(isset($other_titles[$qstr])){ $this->title=$lang->translate($other_titles[$qstr]); } } */ $other_titles = Config::$other_titles; $titles=array_merge($titles,$other_titles); $this->html.=' '.PHP_EOL; file_put_contents($translate_file,$this->html); } }