mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-07 02:31:40 +09:00
develop admi bar
git-svn-id: http://xe-core.googlecode.com/svn/branches/maserati@12184 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
58d21502d5
commit
911624b913
2 changed files with 142 additions and 10 deletions
|
|
@ -493,6 +493,11 @@
|
|||
}
|
||||
}
|
||||
|
||||
// If view is not admin display, set admin menu to context in using admin tool bar
|
||||
if($logged_info->is_admin == 'Y' && $kind != 'admin' && $type == 'view')
|
||||
{
|
||||
$this->_setAdminMenuToContext($oModule);
|
||||
}
|
||||
|
||||
// if failed message exists in session, set context
|
||||
$this->_setInputErrorToContext();
|
||||
|
|
@ -924,5 +929,140 @@
|
|||
Context::set('http_status_code', $code);
|
||||
Context::set('http_status_message', $statusMessage);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief set admin menu to context
|
||||
* @developer
|
||||
* @access private
|
||||
* @return array
|
||||
*/
|
||||
private function _setAdminMenuToContext($oModule)
|
||||
{
|
||||
// admin menu setting
|
||||
global $lang;
|
||||
Context::loadLang('./modules/admin/lang');
|
||||
$oAdminClass = &getClass('admin');
|
||||
$adminMenuName = $oAdminClass->getAdminMenuName();
|
||||
|
||||
$oMenuAdminModel = &getAdminModel('menu');
|
||||
$menu_info = $oMenuAdminModel->getMenuByTitle($adminMenuName);
|
||||
|
||||
if(!is_readable($menu_info->php_file)) return;
|
||||
include $menu_info->php_file;
|
||||
Context::set("included_menu", '');
|
||||
|
||||
foreach((array)$menu->list as $parentKey=>$parentMenu)
|
||||
{
|
||||
if(!is_array($parentMenu['list']) || !count($parentMenu['list'])) continue;
|
||||
if($parentMenu['href'] == '#' && count($parentMenu['list'])) {
|
||||
$firstChild = current($parentMenu['list']);
|
||||
$menu->list[$parentKey]['href'] = $firstChild['href'];
|
||||
}
|
||||
|
||||
if($parentMenu['menu_name_key'] == '{$lang->menu_gnb[\'configuration\']}' || $parentMenu['menu_name_key'] == '{$lang->menu_gnb[\'advanced\']}')
|
||||
{
|
||||
unset($menu->list[$parentKey]);
|
||||
}
|
||||
}
|
||||
debugPrint($menu);
|
||||
Context::set('xeAdminMenu', $menu);
|
||||
|
||||
// write, modify url setting
|
||||
$writeUrl = '';
|
||||
$modifyUrl = '';
|
||||
$moduleListForWrite = array('page', 'board', 'forum', 'wiki', 'textyle');
|
||||
if(in_array($oModule->module, $moduleListForWrite))
|
||||
{
|
||||
$this->_makeWriteUrl($oModule, &$writeUrl, &$modifyUrl);
|
||||
}
|
||||
Context::set('xeAdminWriteUrl', $writeUrl);
|
||||
Context::set('xeAdminModifyUrl', $modifyUrl);
|
||||
|
||||
// setup url setting
|
||||
$setupUrl = '';
|
||||
if($oModule->xml_info->setup_index_act || $oModule->module_info->module == 'textyle')
|
||||
{
|
||||
$this->_makeSetupUrl($oModule, &$setupUrl);
|
||||
}
|
||||
Context::set('xeAdminSetupUrl', $setupUrl);
|
||||
|
||||
// layout url setting
|
||||
$layoutUrl = '';
|
||||
if($oModule->module_info->layout_srl)
|
||||
{
|
||||
$oLayoutModel = &getModel('layout');
|
||||
$layoutInfo = $oLayoutModel->getLayout($oModule->module_info->layout_srl);
|
||||
$layoutUrl = getUrl('', 'act', 'dispLayoutAdminModify', 'type', $layoutInfo->layout_type, 'layout', $layoutInfo->layout, 'layout_srl', $layoutInfo->layout_srl);
|
||||
}
|
||||
Context::set('xeAdminLayoutUrl', $layoutUrl);
|
||||
}
|
||||
|
||||
private function _makeWriteUrl($oModule, $writeUrl, $modifyUrl)
|
||||
{
|
||||
switch($oModule->module)
|
||||
{
|
||||
case 'board' :
|
||||
$writeUrl = getUrl('', 'mid', $oModule->mid, 'act', 'dispBoardWrite');
|
||||
if(Context::get('document_srl'))
|
||||
{
|
||||
$modifyUrl = getUrl('', 'mid', $oModule->mid, 'act', 'dispBoardWrite', 'document_srl', Context::get('document_srl'));
|
||||
}
|
||||
break;
|
||||
case 'page':
|
||||
$writeUrl = getUrl('', 'act', 'dispPageAdminInsert');
|
||||
if($oModule->mid)
|
||||
{
|
||||
$modifyUrl = getUrl('', 'mid', $oModule->mid, 'act', 'dispPageAdminContentModify');
|
||||
}
|
||||
break;
|
||||
case 'forum':
|
||||
$writeUrl = getUrl('', 'mid', $oModule->mid, 'category', Context::get('category'), 'act', 'dispForumWrite');
|
||||
if(Context::get('document_srl'))
|
||||
{
|
||||
$modifyUrl = getUrl('', 'mid', $oModule->mid, 'category', Context::get('category'), 'act', 'dispForumWrite', 'document_srl', Context::get('document_srl'));
|
||||
}
|
||||
break;
|
||||
case 'wiki':
|
||||
$writeUrl = getUrl('', 'mid', $oModule->mid, 'act', 'dispWikiEditPage');
|
||||
if(Context::get('entry'))
|
||||
{
|
||||
$modifyUrl = getUrl('', 'mid', $oModule->mid, 'act', 'dispWikiEditPage', 'entry', Context::get('entry'));
|
||||
}
|
||||
break;
|
||||
case 'textyle':
|
||||
$writeUrl = getUrl('', 'vid', Context::get('vid'), 'act', 'dispTextyleToolPostManageWrite');
|
||||
if(Context::get('document_srl'))
|
||||
{
|
||||
$modifyUrl = getUrl('', 'mid', Context::get('mid'), 'vid', Context::get('vid'), 'document_srl', Context::get('document_srl'), 'act', 'dispTextyleToolPostManageWrite');
|
||||
}
|
||||
break;
|
||||
default :
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private function _makeSetupUrl($oModule, $setupUrl)
|
||||
{
|
||||
switch($oModule->module)
|
||||
{
|
||||
case 'board' :
|
||||
$setupUrl = getUrl('', 'mid', $oModule->mid, 'act', $oModule->xml_info->setup_index_act);
|
||||
break;
|
||||
case 'page':
|
||||
$setupUrl = getUrl('', 'act', $oModule->xml_info->setup_index_act, 'module_srl', $oModule->module_info->module_srl);
|
||||
break;
|
||||
case 'forum':
|
||||
$setupUrl = getUrl('', 'act', $oModule->xml_info->setup_index_act, 'module_srl', $oModule->module_info->module_srl);
|
||||
break;
|
||||
case 'wiki':
|
||||
$setupUrl = getUrl('', 'mid', $oModule->mid, 'act', $oModule->xml_info->setup_index_act);
|
||||
break;
|
||||
case 'textyle':
|
||||
$setupUrl = getUrl('', 'mid', $oModule->mid, 'act', 'dispTextyleToolDashboard', 'vid', Context::get('vid'));
|
||||
break;
|
||||
default :
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -1,16 +1,8 @@
|
|||
<nav id="adminBar">
|
||||
<h1><img src="{$favicon_url}" alt="{$lang->cmd_management}" /></h1>
|
||||
<ul class="abGrl">
|
||||
<li><a href="#">{$lang->dashboard}</a></li>
|
||||
<li><a href="#">{$lang->menu}</a></li>
|
||||
<li><a href="#">{$lang->user}</a></li>
|
||||
<li><a href="#">{$lang->content}</a></li>
|
||||
<li loop="$xeAdminMenu->list=>$value"><a href="{$value['href']}">{$value['text']}</a> </li>
|
||||
</ul>
|
||||
<ul class="abCxt">
|
||||
<li><strong>{$current_module_info->module}</strong>:</li>
|
||||
<li><a href="#">{$lang->cmd_write}</a></li><!-- 현재 모듈의 새글쓰기 기능으로 게시판, 페이지, 위키 등 각 모듈의 새글쓰기 페이지로 이동 -->
|
||||
<li><a href="#">{$lang->cmd_modify}</a></li><!-- 현재 모듈의 내용변경 기능으로 게시판, 페이지, 위키 등 각 모듈의 내용변경 페이지로 이동 -->
|
||||
<li><a href="#">{$lang->cmd_setup}</a></li><!-- 현재 모듈의 설정변경 기능으로 게시판, 페이지, 위키 등 각 모듈의 설정변경 페이지로 이동 -->
|
||||
<li><a href="#">{$lang->layout}</a></li><!-- 현재 모듈의 레이아웃 기능으로 게시판, 페이지, 위키 등 각 모듈의 레이아웃 페이지로 이동 -->
|
||||
</ul>
|
||||
</nav>
|
||||
</nav>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue