XpressEngine Core  1.11.2
 All Classes Namespaces Files Functions Variables Pages
menu.mobile.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) NAVER <http://www.navercorp.com> */
11 class menuMobile extends moduleObject
12 {
17  var $result = array();
18 
23  function straightenMenu($menu_item, $depth)
24  {
25  if(!$menu_item['link']) return;
26  $obj = new stdClass;
27  $obj->href = $menu_item['href'];
28  $obj->depth = $depth;
29  $obj->text = $menu_item['text'];
30  $obj->open_window = $menu_item['open_window'];
31  $this->result[] = $obj;
32  if(!$menu_item['list']) return;
33  foreach($menu_item['list'] as $item)
34  {
35  $this->straightenMenu($item, $depth+1);
36  }
37  }
38 
43  function dispMenuMenu()
44  {
45  $menu_srl = Context::get('menu_srl');
46  $oAdminModel =& getAdminModel('menu');
47  $menu_info = $oAdminModel->getMenu($menu_srl);
48 
49  if(!$menu_srl)
50  {
52  $homeMenuCacheFile = $oMenuAdminController->getHomeMenuCacheFile();
53 
54  if(file_exists($homeMenuCacheFile))
55  {
56  @include($homeMenuCacheFile);
57  }
58  $menu_info->php_file = './files/cache/menu/'.$homeMenuSrl.'.php';
59  }
60 
61  if(file_exists($menu_info->php_file)) @include($menu_info->php_file);
62  if(is_array($menu->list))
63  {
64  foreach($menu->list as $menu_item)
65  {
66  $this->straightenMenu($menu_item, 0);
67  }
68  }
69 
70  Context::set('menu', $this->result);
71 
72  $this->setTemplatePath(sprintf("%stpl/",$this->module_path));
73  $this->setTemplateFile('menu.html');
74  }
75 }
76 /* End of file menu.mobile.php */
77 /* Location: ./modules/menu/menu.mobile.php */
$oMenuAdminController
Definition: ko.install.php:7
straightenMenu($menu_item, $depth)
Definition: menu.mobile.php:23
$obj
Definition: ko.install.php:262
set($key, $val, $set_to_get_vars=0)
getAdminModel($module_name)
Definition: func.inc.php:156
getAdminController($module_name)
Definition: func.inc.php:101