mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
Compiler: added the flag enable_admin_only for the menus
SVN:trunk[1944]
This commit is contained in:
@@ -868,7 +868,21 @@ EOF;
|
||||
$sNewMenu = "new MenuGroup('$sMenuId', $fRank);";
|
||||
}
|
||||
}
|
||||
$sPHP = "\$__comp_menus__['$sMenuId'] = $sNewMenu\n";
|
||||
$sIndent = ' ';
|
||||
$sPHPMenu = "\$__comp_menus__['$sMenuId'] = $sNewMenu";
|
||||
|
||||
$oAdminOnly = $this->GetOptionalElement($oMenu, 'enable_admin_only');
|
||||
if ($oAdminOnly && $oAdminOnly->GetAttribute('value') == '1')
|
||||
{
|
||||
$sPHP = $sIndent."if (UserRights::IsAdministrator())\n";
|
||||
$sPHP .= $sIndent."{\n";
|
||||
$sPHP .= $sIndent." $sPHPMenu\n";
|
||||
$sPHP .= $sIndent."}\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
$sPHP = $sIndent."$sPHPMenu\n";
|
||||
}
|
||||
|
||||
file_put_contents($sResFile, $sPHP, FILE_APPEND);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user