Procedural File: menu_manager.php
Source Location: /zp-extensions/menu_manager.php
Page Details
Lets you create arbitrary menus and place them on your theme pages.
Use the Menu tab to create your menus. Use printCustomMenu() to place them on your pages. This plugin is recommend for customized themes only that do not use the standard Zenphoto display structure. Standard Zenphoto functions like the breadcrumb functions or the next_album() loop for example will NOT take care of this menu's structure!
| Author: | Stephen Billard (sbillard), Malte Müller (acrylian) |
Includes
require_once
(dirname(dirname(__FILE__)).'/template-functions.php')
[line 22]
Lets you create arbitrary menus and place them on your theme pages.
Use the Menu tab to create your menus. Use printCustomMenu() to place them on your pages. This plugin is recommend for customized themes only that do not use the standard Zenphoto display structure. Standard Zenphoto functions like the breadcrumb functions or the next_album() loop for example will NOT take care of this menu's structure!
Information Tags:
| Author: | Stephen Billard (sbillard), Malte Müller (acrylian) |
Constants
MENU_TRUNCATE_INDICATOR [line 29]
MENU_TRUNCATE_INDICATOR = getOption('menu_truncate_indicator')
|
|
MENU_TRUNCATE_STRING [line 28]
MENU_TRUNCATE_STRING = getOption('menu_truncate_string')
|
|
Functions
checkChosenItemStatus [line 186]
Checks if the menu item is set visible or not
string checkChosenItemStatus(
)
|
|
checkChosenMenuset [line 169]
Checks which menu set is chosen via $_GET. If none is explicity chosen the "default" one (create initially) is used.
Parameters:
string checkChosenMenuset(
[ $default = 'default']
)
|
|
createMenuIfNotExists [line 765]
Creates a menu set from the items passed. But only if the menu set does not already exist
Parameters:
|
array |
$menuitems: |
items for the menuset array elements: 'type'=>menuset type 'title'=>title for the menu item 'link'=>URL or other data for the item link 'show'=>set to 1:"visible" or 0:"hidden", 'nesting'=>nesting level of this item in the menu heirarchy |
|
string |
$menuset: |
current menuset |
void createMenuIfNotExists(
array $menuitems, [string $menuset = 'default']
)
|
|
getCurrentMenuItem [line 412]
Returns the sort_order of the current menu item
Parameters:
|
string |
$menuset: |
current menu set |
int getCurrentMenuItem(
string $menuset
)
|
|
getItem [line 158]
Gets a menu item by its id
Parameters:
|
integer |
$id: |
id of the item |
array getItem(
integer $id
)
|
|
getItemTitleAndURL [line 199]
Gets the title, url and name of a menu item
Parameters:
array getItemTitleAndURL(
$item
)
|
|
getMenuFromLink [line 721]
Returns the menu item corresponding to $link
Parameters:
|
string |
$link: |
|
|
string |
$menuset: |
|
array getMenuFromLink(
string $link, [string $menuset = 'default']
)
|
|
getMenuItems [line 129]
Gets the menu items
Parameters:
|
string |
$menuset: |
the menu tree desired |
|
string |
$visible: |
|
array getMenuItems(
string $menuset, string $visible
)
|
|
getMenumanagerPredicessor [line 463]
Returns the link to the predicessor of the current menu item
Parameters:
|
string |
$menuset: |
current menu set |
string getMenumanagerPredicessor(
[string $menuset = 'default']
)
|
|
getMenumanagerSuccessor [line 506]
Returns the successor link of the current menu item
Parameters:
string getMenumanagerSuccessor(
[string $menuset = 'default']
)
|
|
getMenuVisibility [line 297]
Gets the menu visibility
string getMenuVisibility(
)
|
|
inventMenuItem [line 315]
"invents" a menu item for the current page (for when one does not exist) Adds the item to the current menuset and modifies its "parent" as needed
returns a contrived sort_order for the item.
Parameters:
|
string |
$menuset: |
|
|
string |
$visibility: |
return string |
void inventMenuItem(
string $menuset, string $visibility
)
|
|
menu_admin_toolbox_global [line 83]
Add menu to the admin toolbox
Parameters:
void menu_admin_toolbox_global(
$zf
)
|
|
menu_tabs [line 97]
Adds menu manager to admin tabs
Parameters:
|
string |
$current: |
current tab |
|
$tabs |
$tabs: |
array Admin tabs |
unknown menu_tabs(
$tabs $tabs, string $current
)
|
|
printCustomMenu [line 935]
Prints a context sensitive menu of all pages as a unordered html list
Parameters:
|
string |
$menuset: |
the menu tree to output |
|
string |
$option: |
The mode for the menu: "list" context sensitive toplevel plus sublevel pages, "list-top" only top level pages, "omit-top" only sub level pages "list-sub" lists only the current pages direct offspring |
|
string |
$css_id: |
CSS id of the top level list |
|
string |
$css_class_topactive: |
class of the active item in the top level list |
|
string |
$css_class: |
CSS class of the sub level list(s) |
|
string |
$css_class_active: |
CSS class of the sub level list(s) |
|
string |
$indexname: |
insert the name (default "Gallery Index") how you want to call the link to the gallery index, insert "" (default) if you don't use it, it is not printed then. |
|
int |
$showsubs: |
Set to depth of sublevels that should be shown always. 0 by default. To show all, set to a true! Only valid if option=="list". |
|
bool |
$counter: |
TRUE (FALSE default) if you want the count of articles for Zenpage news categories or images/subalbums for albums. |
string printCustomMenu(
[string $menuset = 'default'], [string $option = 'list'], [string $css_id = ''], [string $css_class_topactive = ''], [string $css_class = ''], [string $css_class_active = ''], [int $showsubs = 0], [bool $counter = false], string $indexname
)
|
|
printMenuemanagerPageList [line 650]
Prints a full page navigation including previous and next page links with a list of all pages in between.
Parameters:
|
string |
$nexttext: |
Insert here the linktext like 'next page' |
|
string |
$class: |
Insert here the CSS-class name you want to style the link with (default is "pagelist") |
|
string |
$id: |
Insert here the CSS-ID name if you want to style the link with this |
|
bool |
$firstlast: |
Add links to the first and last pages of you gallery |
|
int |
$navlen: |
Number of navigation links to show (0 for all pages). Works best if the number is odd. |
|
|
$menuset: |
|
void printMenuemanagerPageList(
[ $menuset = 'default'], [string $class = 'pagelist'], [string $id = NULL], [bool $firstlast = true], [int $navlen = 9], string $nexttext
)
|
|
printMenuemanagerPageListWithNav [line 560]
Prints a list of all pages.
Parameters:
|
string |
$prevtext: |
Insert here the linktext like 'previous page' |
|
string |
$menuset: |
current menu set |
|
string |
$class: |
the css class to use, "pagelist" by default |
|
string |
$nextprev: |
set to true to get the 'next' and 'prev' links printed |
|
string |
$id: |
the css id to use |
|
bool |
$firstlast: |
Add links to the first and last pages of you gallery |
|
int |
$navlen: |
Number of navigation links to show (0 for all pages). Works best if the number is odd. |
|
|
$nexttext: |
|
void printMenuemanagerPageListWithNav(
string $prevtext, $nexttext, [string $menuset = 'default'], [string $class = 'pagelist'], [string $nextprev = true], [string $id = NULL], [bool $firstlast = true], [int $navlen = 9]
)
|
|
printMenumanagerBreadcrumb [line 673]
Prints the breadcrumbs of the current page
NOTE: this function is entirely dependedn on the menu tree you have generated. It will work only with static menu trees. That is, if the page upon which you call this function is not present in your menu tree it will not have any parent pages. Thus, menu items generated for instance by function calls cannot have parents in the printMenumanagerBreadcrumb sense. Likewise if you have non exclusive menu links to a page the parentage of that page with respect to breadcrumbs may not reflect on the menu transitions that the user used to arrive on the page.
Parameters:
|
string |
$menuset: |
current menu set |
|
string |
$before: |
before text |
|
string |
$between: |
between text |
|
string |
$after: |
after text |
void printMenumanagerBreadcrumb(
[string $menuset = 'default'], [string $before = ''], [string $between = ' | '], [string $after = ' | ']
)
|
|
printMenumanagerNextLink [line 538]
Gets the link to the next menu item
Parameters:
|
string |
$text: |
|
|
string |
$menuset: |
current menu set |
|
string |
$title: |
|
|
string |
$class: |
|
|
string |
$id: |
|
void printMenumanagerNextLink(
string $text, [string $menuset = 'default'], [string $title = NULL], [string $class = NULL], [string $id = NULL]
)
|
|
printMenumanagerPrevLink [line 491]
Prints the previous link of the current menu item
Parameters:
|
string |
$text: |
|
|
string |
$menuset: |
|
|
string |
$title: |
|
|
string |
$class: |
|
|
string |
$id: |
|
void printMenumanagerPrevLink(
string $text, [string $menuset = 'default'], [string $title = NULL], [string $class = NULL], [string $id = NULL]
)
|
|
submenuOf [line 737]
Returns true if the current menu item is a sub item of $link
Parameters:
|
string |
$link: |
possible parent |
|
string |
$menuset: |
current menuset |
bool submenuOf(
string $link, [string $menuset = 'default']
)
|
|
|
|