mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-12 23:14:18 +01:00
N°7194 - Add link to datamodel class schema on object details (#613)
This commit is contained in:
@@ -125,9 +125,7 @@ class ApplicationMenu
|
||||
*/
|
||||
public static function CheckMenuIdEnabled($sMenuId)
|
||||
{
|
||||
self::LoadAdditionalMenus();
|
||||
$oMenuNode = self::GetMenuNode(self::GetMenuIndexById($sMenuId));
|
||||
if (is_null($oMenuNode) || !$oMenuNode->IsEnabled())
|
||||
if (self::IsMenuIdEnabled($sMenuId) === false)
|
||||
{
|
||||
require_once(APPROOT.'/setup/setuppage.class.inc.php');
|
||||
$oP = new ErrorPage(Dict::S('UI:PageTitle:FatalError'));
|
||||
@@ -138,6 +136,19 @@ class ApplicationMenu
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $sMenuId
|
||||
*
|
||||
* @return bool true if the menu exists and current user is allowed to see the menu
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public static function IsMenuIdEnabled($sMenuId):bool
|
||||
{
|
||||
self::LoadAdditionalMenus();
|
||||
$oMenuNode = self::GetMenuNode(self::GetMenuIndexById($sMenuId));
|
||||
return is_null($oMenuNode) === false && $oMenuNode->IsEnabled();
|
||||
}
|
||||
|
||||
/**
|
||||
* Main function to add a menu entry into the application, can be called during the definition
|
||||
* of the data model objects
|
||||
|
||||
Reference in New Issue
Block a user