itop扩展添加菜单功能
https://www.itophub.io/wiki/page?id=3_0_0%3Acustomization%3Adatamodel#creating_a_module
yle="max-width:100%;">
生成新的扩展,
在新扩展的
model.itop-*-.php 新添加代码如下:
yle="max-width:100%;overflow-x:auto;">class ReportMenusHandler extends ModuleHandlerAPI
{
/**
* iTop Hub menus are defined in PHP instead of xml to avoid people overloading them through a delta.
* Do NOT refactor them to the xml.
*
* @throws \Exception
*/
public static function OnMenuCreation()
{
// Add the admin menus
if (UserRights::IsAdministrator())
{
$data = UserRights::GetUserId();
$rdpurl = metaModel::GetConfig()->Get('export.rdpurl');//取RDP报表URL地址
$sRootUrl = $rdpurl.'login.html';
$oHubMenu = new MenuGroup('ReportUrl' 998 /* fRank */ 'fc fc-itophub-icon fc-1-5x');
$fRank = 1;
new WebPageMenuNode('ReportUrl:Login' $sRootUrl $oHubMenu->GetIndex() $fRank++ nullnullUR_ALLOWED_YESnulltrue);
}
}
}
zh_cn.dict.itop-*-.php里添加中文
yle="max-width:100%;overflow-x:auto;">Dict::Add('ZH CN' 'Chinese' '简体中文' array(
'Menu:ReportUrl' => '报表管理'
'Menu:ReportUrl+' => ''
'Menu:ReportUrl:Login' => '打开报表平台'
// Dictionary entries go here
));
在setup重新安装这个插件就可以了
发表评论