登录

itop菜单栏处理不用改源码,修改扩展类

itop开发内容
1 1648

修改扩展类里边的

model.itop-service-extension.php


添加到

model.itop-service-extension.php

文件代码如下:

class ItopHubMenusShow 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()
    {
        $oUserProfile = metaModel::Getobject('URP_UserProfile' UserRights::GetUserId());
        if (is_object($oUserProfile)){
            if ($oUserProfile->Get("profileid") == 5)
            {
                $oHubMenu = ApplicationMenu::$aRootMenus;
                unset($oHubMenu[9]);
                ApplicationMenu::$aRootMenus = array_values($oHubMenu);
            }
        }
    }
}

感谢大神:性本善良 我愿平凡


发表评论

1 个回复