[ class tree: plugins ] [ index: plugins ] [ all elements ]

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!

Classes
Class Description
menu_manager option handler
Includes
require_once (dirname(dirname(__FILE__)).'/template-functions.php') [line 21]
[ Top ]


Constants
MENU_TRUNCATE_INDICATOR  [line 26]

MENU_TRUNCATE_INDICATOR = getOption('menu_truncate_indicator')

[ Top ]

MENU_TRUNCATE_STRING  [line 25]

MENU_TRUNCATE_STRING = getOption('menu_truncate_string')

[ Top ]


Functions
checkChosenItemStatus  [line 165]

Checks if the menu item is set visible or not


string checkChosenItemStatus( )

[ Top ]
checkChosenMenuset  [line 148]

Checks which menu set is chosen via $_GET. If none is explicity chosen the "default" one (create initially) is used.

Parameters:
   $default: 


string checkChosenMenuset( [ $default = 'default']  )

[ Top ]
createMenuIfNotExists  [line 739]

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']  )

[ Top ]
getCurrentMenuItem  [line 391]

Returns the sort_order of the current menu item

Parameters:
string   $menuset:  current menu set


int getCurrentMenuItem( string $menuset  )

[ Top ]
getItem  [line 137]

Gets a menu item by its id

Parameters:
integer   $id:  id of the item


array getItem( integer $id  )

[ Top ]
getItemTitleAndURL  [line 178]

Gets the title, url and name of a menu item

Parameters:
   $item: 


array getItemTitleAndURL( $item  )

[ Top ]
getMenuFromLink  [line 694]

Returns the menu item corresponding to $link

Parameters:
string   $link: 
string   $menuset: 


array getMenuFromLink( string $link, [string $menuset = 'default']  )

[ Top ]
getMenuItems  [line 108]

Gets the menu items

Parameters:
string   $menuset:  the menu tree desired
string   $visible: 


array getMenuItems( string $menuset, string $visible  )

[ Top ]
getMenumanagerPredicessor  [line 443]

Returns the link to the predicessor of the current menu item

Parameters:
string   $menuset:  current menu set


string getMenumanagerPredicessor( [string $menuset = 'default']  )

[ Top ]
getMenumanagerSuccessor  [line 486]

Returns the successor link of the current menu item

Parameters:
string   $menuset: 


string getMenumanagerSuccessor( [string $menuset = 'default']  )

[ Top ]
getMenuVisibility  [line 276]

Gets the menu visibility


string getMenuVisibility( )

[ Top ]
inventMenuItem  [line 294]

"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  )

[ Top ]
menu_tabs  [line 76]

Adds menu manager to admin tabs

Parameters:
string   $current:  current tab
$tabs   $tabs:  array Admin tabs


unknown menu_tabs( $tabs $tabs, string $current  )

[ Top ]
printCustomMenu  [line 909]

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  )

[ Top ]
printMenuemanagerPageList  [line 630]

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  )

[ Top ]
printMenuemanagerPageListWithNav  [line 540]

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]  )

[ Top ]
printMenumanagerBreadcrumb  [line 653]

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 = ' | ']  )

[ Top ]
printMenumanagerNextLink  [line 518]

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]  )

[ Top ]
printMenumanagerPrevLink  [line 471]

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]  )

[ Top ]
submenuOf  [line 711]

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']  )

[ Top ]


Documentation generated on Tue, 20 Dec 2011 16:07:41 +0100 by phpDocumentor 1.4.3