登录

itop扩展添加菜单功能

itop开发内容 热门
0 1669

https://www.itophub.io/wiki/page?id=3_0_0%3Acustomization%3Adatamodel#creating_a_module

微信图片_20220222091421yle="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重新安装这个插件就可以了

发表评论

0 个回复