<?php
/**
 * 模塊菜單
 *
 * @version        $Id: inc_menu_module.php 1 10:32 2010年7月21日Z tianya $
 * @package        DedeCMS.Administrator
 * @copyright      Copyright (c) 2007 - 2010, DesDev, Inc.
 * @license        http://help.dedecms.com/usersguide/license.html
 * @link           http://www.dedecms.com
 */
require_once(dirname(__FILE__)."/../config.php");

/*
模塊菜單一般在不要直接改此文件，直接保存在#@__sys_module表即可，格式為
<m:top name='問答模塊管理' c='6,' display='block' rank=''>
<m:item name='問答欄目管理' link='ask_type.php' rank='' target='main' />
<m:item name='問答問題管理' link='ask_admin.php' rank='' target='main' />
<m:item name='問答答案管理' link='ask_answer.php' rank='' target='main' />
</m:top>
這個菜單可在生成模塊時指定
*/

//載入模塊菜單
$moduleset = '';
$dsql->SetQuery("SELECT * FROM `#@__sys_module` ORDER BY id DESC");
$dsql->Execute();
while($row = $dsql->GetObject()) 
{
    $moduleset .= $row->menustring."\r\n";
}

//載入插件菜單
$plusset = '';
$dsql->SetQuery("SELECT * FROM `#@__plus` WHERE isshow=1 ORDER BY aid ASC");
$dsql->Execute();
while($row = $dsql->GetObject()) {
    $row->menustring = str_replace('plus_友情鏈接', 'plus_友情鏈接模塊', $row->menustring);
    $plusset .= $row->menustring."\r\n";
}

$adminMenu = '';
if($cuserLogin->getUserType() >= 10)
{
    $adminMenu = "<m:top name='模塊管理' c='6,' display='block'>
    <m:item name='模塊管理' link='module_main.php' rank='sys_module' target='main' />
    <m:item name='上傳新模塊' link='module_upload.php' rank='sys_module' target='main' />
    <m:item name='模塊生成嚮導' link='module_make.php' rank='sys_module' target='main' />
    </m:top>";
}

$menusMoudle = "
-----------------------------------------------
$adminMenu
<m:top item='7' name='輔助插件' display='block'>
  <m:item name='插件管理器' link='plus_main.php' rank='10' target='main' />
  $plusset
</m:top>

$moduleset
-----------------------------------------------
";