这是本文档旧的修订版!
后台左侧栏菜单输出接口
可通过该接口添加后台左侧栏菜单项。
Add_Filter_Plugin('Filter_Plugin_Admin_LeftMenu','demo_addleft');
参数类型 | 参数 | 描述 |
---|---|---|
Array | $leftmenus | 左侧栏菜单数组 |
$leftmenus
数组中键值是通过makeleftmenu构建的字符串,类似这样
$leftmenus['nav_plugin']=MakeLeftMenu("PluginMng",$zbp->lang['msg']['plugin_manage'],$zbp->host . "zb_system/cmd.php?act=PluginMng","nav_plugin","aPluginMng","");最后输出$leftmenus['nav_plugin']的结果是这样的
<li id="nav_plugin"><a id="aPluginMng" href="http://localhost/zbp/zb_system/cmd.php?act=PluginMng" title="插件管理"><span>插件管理</span></a></li>
无
在插件的include.php中插入以下代码,将在后台左侧栏新增一菜单项
RegisterPlugin("demo_leftmenu","ActivePlugin_demo_leftmenu");//注册插件 function ActivePlugin_demo_leftmenu() { Add_Filter_Plugin('Filter_Plugin_Edit_Response','demo_addleft'); } function demo_addleft(&$m){ global $zbp; //MakeLeftMenu中的参数分别为 目标页面请求权限,链接文字,链接URL地址,构造的li标签id,构造的a标签id,菜单项图标地址 $m['demo_leftmenu']=MakeLeftMenu("root",$zbp->lang['demo_leftmenu']['name'],$zbp->host . "zb_users/plugin/demo_leftmenu/main.php","nav_demo_leftmenu","aDemo_leftmenu",$zbp->host . "zb_users/plugin/demo_leftmenu/images/icon.png"); }上述代码中使用的
$zbp→lang['demo_leftmenu']['name']
为引用插件语言包内容,你可以直接用文字串替代。