mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-14 00:39:57 +09:00
issue 70 admin menu make with reference 'module.xml'
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@8596 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
c9bf633b95
commit
d9d8a12755
5 changed files with 82 additions and 9 deletions
|
|
@ -54,6 +54,10 @@
|
|||
|
||||
if(is_readable($menu_info->php_file))
|
||||
include $menu_info->php_file;
|
||||
else {
|
||||
header('location:'.getNotEncodedUrl('', 'module', 'admin'));
|
||||
return;
|
||||
}
|
||||
|
||||
Context::set('gnbUrlList', $menu->list);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -90,8 +90,15 @@
|
|||
'lnbList'=>array('userList'=>$adminUrl, 'setting'=>$adminUrl, 'point'=>$adminUrl)
|
||||
),
|
||||
'content'=>array(
|
||||
'url'=>$adminUrl,
|
||||
'lnbList'=>array('document'=>$adminUrl, 'comment'=>$adminUrl, 'trackback'=>$adminUrl, 'file'=>$adminUrl, 'poll'=>$adminUrl, 'dataMigration'=>$adminUrl)
|
||||
'url'=>getUrl('', 'module', 'admin', 'act', 'dispDocumentAdminList'),
|
||||
'lnbList'=>array(
|
||||
'document'=>getUrl('', 'module', 'admin', 'act', 'dispDocumentAdminList'),
|
||||
'comment'=>$adminUrl,
|
||||
'trackback'=>$adminUrl,
|
||||
'file'=>$adminUrl,
|
||||
'poll'=>$adminUrl,
|
||||
'dataMigration'=>$adminUrl
|
||||
)
|
||||
),
|
||||
'theme'=>array(
|
||||
'url'=>$adminUrl,
|
||||
|
|
|
|||
|
|
@ -30,11 +30,11 @@
|
|||
<div class="gnb jx">
|
||||
<ul>
|
||||
<!--@foreach($gnbUrlList AS $key=>$value)-->
|
||||
<li <!--@if($category == $key)-->class="activeOn"<!--@end-->><a href="{$value['href']}">{$value['text']}</a>
|
||||
<li <!--@if($category == $key)-->class="activeOn"<!--@end-->><a href="{html_entity_decode($value['href'])}">{$value['text']}</a>
|
||||
<!--@if(count($gnbUrlList[$key]['list']) > 0)-->
|
||||
<ul>
|
||||
<!--@foreach($gnbUrlList[$key]['list'] AS $key2=>$value2)-->
|
||||
<li><a href="{$value2['href']}">{$value2['text']}</a></li>
|
||||
<li><a href="{html_entity_decode($value2['href'])}">{$value2['text']}</a></li>
|
||||
<!--@end-->
|
||||
</ul>
|
||||
<!--@end-->
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@
|
|||
<module>
|
||||
<grants />
|
||||
<permissions>
|
||||
<permission action="dispDocumentAdminList" target="manager" />
|
||||
|
||||
<permission action="dispDocumentManageDocument" target="member" />
|
||||
<permission action="getDocumentCategories" target="member" />
|
||||
<permission action="getDocumentCategoryTplInfo" target="member" />
|
||||
|
|
@ -29,11 +31,11 @@
|
|||
<action name="procDocumentManageCheckedDocument" type="controller" standalone="true" />
|
||||
<action name="procDocumentInsertModuleConfig" type="controller" standalone="true" />
|
||||
|
||||
<action name="dispDocumentAdminList" type="view" admin_index="true" standalone="true" />
|
||||
<action name="dispDocumentAdminConfig" type="view" standalone="true" />
|
||||
<action name="dispDocumentAdminAlias" type="view" standalone="true" />
|
||||
<action name="dispDocumentAdminDeclared" type="view" standalone="true" />
|
||||
<action name="dispDocumentAdminTrashList" type="view" standalone="true" />
|
||||
<action name="dispDocumentAdminList" type="view" admin_index="true" standalone="true" menu_name="document" menu_index="true" />
|
||||
<action name="dispDocumentAdminConfig" type="view" standalone="true" menu_name="configuration" menu_index="true" />
|
||||
<action name="dispDocumentAdminAlias" type="view" standalone="true" menu_name="document" />
|
||||
<action name="dispDocumentAdminDeclared" type="view" standalone="true" menu_name="document" />
|
||||
<action name="dispDocumentAdminTrashList" type="view" standalone="true" menu_name="document" />
|
||||
|
||||
<action name="getDocumentCategoryTplInfo" type="model" standalone="true" />
|
||||
<action name="getDocumentVotedMemberList" type="model" standalone="true" />
|
||||
|
|
@ -57,4 +59,32 @@
|
|||
<action name="procDocumentAdminCancelDeclare" type="controller" standalone="true" />
|
||||
|
||||
</actions>
|
||||
<menus>
|
||||
<menu name="document">
|
||||
<title xml:lang="en">Document</title>
|
||||
<title xml:lang="ko">문서</title>
|
||||
<title xml:lang="zh-CN">Document</title>
|
||||
<title xml:lang="jp">Document</title>
|
||||
<title xml:lang="es">Document</title>
|
||||
<title xml:lang="ru">Document</title>
|
||||
<title xml:lang="fr">Document</title>
|
||||
<title xml:lang="zh-TW">Document</title>
|
||||
<title xml:lang="vi">Document</title>
|
||||
<title xml:lang="mn">Document</title>
|
||||
<title xml:lang="tr">Document</title>
|
||||
</menu>
|
||||
<menu name="configuration">
|
||||
<title xml:lang="en">Configuration</title>
|
||||
<title xml:lang="ko">설정</title>
|
||||
<title xml:lang="zh-CN">Configuration</title>
|
||||
<title xml:lang="jp">Configuration</title>
|
||||
<title xml:lang="es">Configuration</title>
|
||||
<title xml:lang="ru">Configuration</title>
|
||||
<title xml:lang="fr">Configuration</title>
|
||||
<title xml:lang="zh-TW">Configuration</title>
|
||||
<title xml:lang="vi">Configuration</title>
|
||||
<title xml:lang="mn">Configuration</title>
|
||||
<title xml:lang="tr">Configuration</title>
|
||||
</menu>
|
||||
</menus>
|
||||
</module>
|
||||
|
|
|
|||
|
|
@ -484,6 +484,7 @@
|
|||
|
||||
$grants = $xml_obj->module->grants->grant; // /< Permission information
|
||||
$permissions = $xml_obj->module->permissions->permission; // /< Acting permission
|
||||
$menus = $xml_obj->module->menus->menu;
|
||||
$actions = $xml_obj->module->actions->action; // /< Action list (required)
|
||||
|
||||
$default_index = $admin_index = '';
|
||||
|
|
@ -518,6 +519,23 @@
|
|||
$buff .= sprintf('$info->permission->%s = \'%s\';', $action, $target);
|
||||
}
|
||||
}
|
||||
// for admin menus
|
||||
if($menus)
|
||||
{
|
||||
if(is_array($menus)) $menu_list = $menus;
|
||||
else $menu_list[] = $menus;
|
||||
|
||||
foreach($menu_list as $menu) {
|
||||
$menu_name = $menu->attrs->name;
|
||||
$menu_title = is_array($menu->title) ? $menu->title[0]->body : $menu->title->body;
|
||||
|
||||
$info->menu->{$menu_name}->title = $menu_title;
|
||||
$info->menu->{$menu_name}->acts = array();
|
||||
|
||||
$buff .= sprintf('$info->menu->%s->title=\'%s\';', $menu_name, $menu_title);
|
||||
}
|
||||
}
|
||||
|
||||
// actions
|
||||
if($actions) {
|
||||
if(is_array($actions)) $action_list = $actions;
|
||||
|
|
@ -534,6 +552,7 @@
|
|||
$index = $action->attrs->index;
|
||||
$admin_index = $action->attrs->admin_index;
|
||||
$setup_index = $action->attrs->setup_index;
|
||||
$menu_index = $action->attrs->menu_index;
|
||||
|
||||
$output->action->{$name}->type = $type;
|
||||
$output->action->{$name}->grant = $grant;
|
||||
|
|
@ -543,6 +562,19 @@
|
|||
$info->action->{$name}->grant = $grant;
|
||||
$info->action->{$name}->standalone = $standalone=='true'?true:false;
|
||||
$info->action->{$name}->ruleset = $ruleset;
|
||||
if($action->attrs->menu_name)
|
||||
{
|
||||
if($menu_index == 'true')
|
||||
{
|
||||
$info->menu->{$action->attrs->menu_name}->index = $name;
|
||||
$buff .= sprintf('$info->menu->%s->index=\'%s\';', $action->attrs->menu_name, $name);
|
||||
}
|
||||
array_push($info->menu->{$action->attrs->menu_name}->acts, $name);
|
||||
$currentKey = array_search($name, $info->menu->{$action->attrs->menu_name}->acts);
|
||||
|
||||
$buff .= sprintf('$info->menu->%s->acts[%d]=\'%s\';', $action->attrs->menu_name, $currentKey, $name);
|
||||
$i++;
|
||||
}
|
||||
|
||||
$buff .= sprintf('$info->action->%s->type=\'%s\';', $name, $type);
|
||||
$buff .= sprintf('$info->action->%s->grant=\'%s\';', $name, $grant);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue