Project

General

Profile

Feature #773

CODE for remove unnecesary menu items for users with restrictions.

Added by Angel Sandoval over 7 years ago. Updated 9 months ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
Web Interface
Target version:
Start date:
07/30/2010
Due date:
% Done:

0%


Description

I know this is not the best (or correct) method to give feedback or code but maybe you can find this useful

I wrote a little function in the line 229 of fbegin.inc file, with de purpose of remove unnecesary menu items, when some configured users are not allowed to enter such pages on the webgui, personally I suggest it for aestethics improvement, hope this one could help to ohters.

Regards

/* REMOVE UNNECESARY MENU ITEMS CODE by Angel Sandoval (oilop9000) */
function removeNotAllowedItems (&$menuArray,$menuAllowedItems){
global $_SESSION;
if (!is_array($menuArray))
$menuArray = array();
foreach ($menuArray as $itemIndex => $item) {
$itemBaseName = basename($item[1]);
//Remove unnecesary Items from menu
if (!cmp_page_matches($itemBaseName,$_SESSION['page-match']))
unset($menuArray[$itemIndex]);
}
}

// Example of use: removeNotAllowedItems($services_menu,$menuAllowedItems);

History

#1 Updated by Ermal Lu├ži about 7 years ago

  • Target version changed from 2.0 to Future
  • Affected Version changed from 2.0 to All

#2 Updated by Jim Pingle over 5 years ago

See also #1740

#3 Updated by Kill Bill 9 months ago

Long done, can be closed.

#4 Updated by Jim Pingle 9 months ago

  • Status changed from New to Resolved

Also available in: Atom PDF