From b2795fbaa4084657879404eed80de92a50e55dfb Mon Sep 17 00:00:00 2001 From: haneul Date: Tue, 22 Jun 2010 08:56:36 +0000 Subject: [PATCH] #18959053 : added menu mobile view git-svn-id: http://xe-core.googlecode.com/svn/sandbox@7539 201d5d3c-b55e-5fd7-737f-ddc643e51545 --- modules/menu/conf/module.xml | 2 ++ modules/menu/menu.mobile.php | 37 ++++++++++++++++++++++++++++++++++++ modules/menu/tpl/menu.html | 27 ++++++++++++++++++++++++++ 3 files changed, 66 insertions(+) create mode 100644 modules/menu/menu.mobile.php create mode 100644 modules/menu/tpl/menu.html diff --git a/modules/menu/conf/module.xml b/modules/menu/conf/module.xml index c940f7f52..f9311eb0f 100644 --- a/modules/menu/conf/module.xml +++ b/modules/menu/conf/module.xml @@ -20,5 +20,7 @@ + + diff --git a/modules/menu/menu.mobile.php b/modules/menu/menu.mobile.php new file mode 100644 index 000000000..23bb7aa20 --- /dev/null +++ b/modules/menu/menu.mobile.php @@ -0,0 +1,37 @@ +href = $menu_item['href']; + $obj->depth = $depth; + $obj->link = $menu_item['link']; + $this->result[] = $obj; + if(!$menu_item['list']) return; + foreach($menu_item['list'] as $item) + { + $this->straightenMenu($item, $depth+1); + } + } + + function dispMenuMenu() { + $menu_srl = Context::get('menu_srl'); + $oAdminModel =& getAdminModel('menu'); + $menu_info = $oAdminModel->getMenu($menu_srl); + if(file_exists($menu_info->php_file)) @include($menu_info->php_file); + + foreach($menu->list as $menu_item) + { + $this->straightenMenu($menu_item, 0); + } + + Context::set('menu', $this->result); + + $this->setTemplatePath(sprintf("%stpl/",$this->module_path)); + $this->setTemplateFile('menu.html'); + + } +} +?> diff --git a/modules/menu/tpl/menu.html b/modules/menu/tpl/menu.html new file mode 100644 index 000000000..f4d00c92d --- /dev/null +++ b/modules/menu/tpl/menu.html @@ -0,0 +1,27 @@ +
    + {@ $start = true } + {@ $depth = 0 } + + + + + +
      + + + +
    + {@ $depth -= 1} + + +
  • » {$val->link} + {@ $start = false } + {@ $depth = $val->depth } + + +
  • +
+ {@ $depth -= 1} + + +