![]() |
FOSSology
4.6.0-rc1
Open Source License Compliance by Open Source Software
|
Common menu functions. More...
Go to the source code of this file.
Classes | |
| class | menu |
| Code for creating a menu list (2D linked list) from a set of plugins. More... | |
Functions | |
| MenuPage ($Page, $TotalPage, $Uri='') | |
| Create a "First Prev 1 2 ... Next Last" page links for paged output. More... | |
| MenuEndlessPage ($Page, $Next=1, $Uri='') | |
| Create a "First Prev 1 2 ... Next" page links for paged output. More... | |
| menu_cmp ($a, $b) | |
| Compare two menu items for sorting. More... | |
| menu_insert_r (&$menuItems, $path, $pathRemainder, $LastOrder, $Target, $URI, $HTML, &$Title) | |
| Given a Path, order level for the last item, and a plugin name, insert the menu item. More... | |
| menu_insert ($Path, $LastOrder=0, $URI=NULL, $Title=NULL, $Target=NULL, $HTML=NULL) | |
| Given a Path, order level for the last item, and optional plugin name, insert the menu item. More... | |
| menu_find ($Name, &$MaxDepth, $Menu=NULL) | |
| Given a top-level menu name, find the list of sub-menus below it and max depth of menu. More... | |
| menu_to_1html ($Menu, $ShowRefresh=1, $ShowTraceback=0, $ShowAll=1) | |
| Take a menu and render it as one HTML line. More... | |
| getFullNameAddition (menu $menu) | |
| menu_to_1list ($Menu, &$Parm, $Pre="", $Post="", $ShowAll=1, $upload_id="") | |
| Take a menu and render it as one HTML line with items in a "[name]" list. More... | |
| menu_print (&$Menu, $Indent) | |
| Debugging code for printing the menu. More... | |
| menu_remove ($Menu, $RmName) | |
| Remove a menu object (based on an object name) from a menu list. More... | |
Variables | |
| const | MENU_PATH_SEPARATOR = "::" |
| Separator used between menu paths. | |
| const | MENU_BREAK = "[BREAK]" |
| Break menu at this. | |
| $MenuList = array() | |
| Global menu list array. | |
| $MenuMaxDepth = 0 | |
| How deep is the tree (for UI display) | |
| $menu_to_1html_counter = 0 | |
| Counter used by menu_to_1html() | |
Common menu functions.
Definition in file common-menu.php.
| getFullNameAddition | ( | menu | $menu | ) |
Get the additional string for menu full name
| menu | $menu | menu |
Definition at line 416 of file common-menu.php.
| menu_cmp | ( | $a, | |
| $b | |||
| ) |
Compare two menu items for sorting.
| &$a | menu a |
| &$b | menu b |
Definition at line 157 of file common-menu.php.
| menu_find | ( | $Name, | |
| & | $MaxDepth, | ||
$Menu = NULL |
|||
| ) |
Given a top-level menu name, find the list of sub-menus below it and max depth of menu.
| string | $Name | Top-level menu name, may be a "::" separated list. | |
| [out] | int | &$MaxDepth | Max depth of menu, returned value |
| menu | $Menu | menu object array (default is global $MenuList) |
Definition at line 291 of file common-menu.php.
| menu_insert | ( | $Path, | |
$LastOrder = 0, |
|||
$URI = NULL, |
|||
$Title = NULL, |
|||
$Target = NULL, |
|||
$HTML = NULL |
|||
| ) |
Given a Path, order level for the last item, and optional plugin name, insert the menu item.
| string | $Path | Path of the new menu item |
| int | $LastOrder | Is used for grouping items in order. |
| string | $URI | URL link of the new menu item |
| string | $Title | Title of the new menu item |
| string | $Target | Target of the new menu item |
| string | $HTML | HTML of the new menu item |
Definition at line 269 of file common-menu.php.
| menu_insert_r | ( | & | $menuItems, |
| $path, | |||
| $pathRemainder, | |||
| $LastOrder, | |||
| $Target, | |||
| $URI, | |||
| $HTML, | |||
| & | $Title | ||
| ) |
Given a Path, order level for the last item, and a plugin name, insert the menu item.
This is VERY recursive and returns the new menu. If $URI is blank, nothing is added.
| [in,out] | array | &$menuItems | Array of menu items. If null is passed, new array is created. |
| array | $path | Path of the menu item | |
| string | $pathRemainder | ||
| int | $LastOrder | Order (position) of last menu item | |
| string | $Target | Name of the Menu target | |
| string | $URI | URI of the menu | |
| string | $HTML | HTML of the menu | |
| string | &$Title | Title of the menu |
Definition at line 187 of file common-menu.php.
| menu_print | ( | & | $Menu, |
| $Indent | |||
| ) |
Debugging code for printing the menu.
| menu | &$Menu | menu list to be printed |
| int | $Indent | Indentations to add |
Definition at line 483 of file common-menu.php.
| menu_remove | ( | $Menu, | |
| $RmName | |||
| ) |
Remove a menu object (based on an object name) from a menu list.
For example,
| menu | $Menu | menu list the menu item remove from |
| string | $RmName | Remove name of menu |
Definition at line 534 of file common-menu.php.
| menu_to_1html | ( | $Menu, | |
$ShowRefresh = 1, |
|||
$ShowTraceback = 0, |
|||
$ShowAll = 1 |
|||
| ) |
Take a menu and render it as one HTML line.
This ignores submenus! This is commonly called the "micro-menu".
| menu | $Menu | menu list need to show as HTML |
| bool | $ShowRefresh | If true, show Refresh |
| bool | $ShowTraceback | If true, show Tracback |
| bool | $ShowAll | If false, then items without hyperlinks are hidden. |
Definition at line 329 of file common-menu.php.
| menu_to_1list | ( | $Menu, | |
| & | $Parm, | ||
$Pre = "", |
|||
$Post = "", |
|||
$ShowAll = 1, |
|||
$upload_id = "" |
|||
| ) |
Take a menu and render it as one HTML line with items in a "[name]" list.
| menu | $Menu | menu list need to show as list |
| string | &$Parm | A list of parameters to add to the URL. |
| string | $Pre | String before "[name]" |
| string | $Post | String after "[name]" |
| bool | $ShowAll | If false, then items without hyperlinks are hidden. |
| int | $upload_id | Upload id |
Definition at line 437 of file common-menu.php.
| MenuEndlessPage | ( | $Page, | |
$Next = 1, |
|||
$Uri = '' |
|||
| ) |
Create a "First Prev 1 2 ... Next" page links for paged output.
| int | $Page | Page number of the current page |
| bool | $Next | True display "Next" and false don't display |
| string | $Uri | URL of the page being displayed. "&page=" will be appended to the URL |
Definition at line 111 of file common-menu.php.
| MenuPage | ( | $Page, | |
| $TotalPage, | |||
$Uri = '' |
|||
| ) |
Create a "First Prev 1 2 ... Next Last" page links for paged output.
| int | $Page | Page number of the current page |
| int | $TotalPage | Last page number |
| string | $Uri | URL of the page being displayed. "&page=" will be appended to the URL |
Definition at line 60 of file common-menu.php.