ZenphotoCMS 1.6.3

menumanager

Table of Contents

Classes

menu_manager
option handler

Constants

OFFSET_PATH  = 4
OFFSET_PATH  = 4

Functions

updateItemsSortorder()  : mixed
Updates the sortorder of the pages list in the database
printItemsListTable()  : mixed
Prints the table part of a single page item for the sortable pages list
printItemsList()  : bool
Prints the sortable pages list returns true if nesting levels exceede the database container
printItemEditLink()  : mixed
Prints the link to the edit page of a menu item. For gallery and Zenpage items it links to their normal edit pages, for custom pages and custom links to menu specific edit page.
printItemStatusDropdown()  : mixed
Prints the item status selector to choose if all items or only hidden or visible should be listed
getMenuSetSelector()  : mixed
returns the menu set selector
publishItem()  : mixed
Sets a menu item to published/visible
addSubalbumMenus()  : mixed
adds (sub)albums to menu base with their gallery sorting order intact
addalbumsToDatabase()  : int
Adds albums to the menu set. Returns the next sort order base
addPagesToDatabase()  : int
Adds Zenpage pages to the menu set
addCategoriesToDatabase()  : mixed
Adds Zenpage news categories to the menu set
addItem()  : array<string|int, mixed>
Adds an menu item set via POST
updateMenuItem()  : mixed
Updates a menu item (custom link, custom page only) set via POST
deleteItem()  : mixed
Deletes a menu item set via GET
printAlbumsSelector()  : string
Prints all albums of the Zenphoto gallery as a partial drop down menu (<option></option> parts).
printZenpagePagesSelector()  : string
Prints all available pages in Zenpage
printZenpageNewsCategorySelector()  : string
Prints all available articles or categories in Zenpage
printCustomPageSelector()  : string
Prints the selector for custom pages
unpublishedZenphotoItemCheck()  : string
checks if a album or image is un-published and returns a '*'
processMenuBulkActions()  : mixed
Processes the check box bulk actions
menu_admin_toolbox_global()  : mixed
Add menu to the admin toolbox
menu_tabs()  : unknown
Adds menu manager to admin tabs
getMenuItems()  : array<string|int, mixed>
Gets the menu items
getItem()  : array<string|int, mixed>
Gets a menu item by its id
checkChosenMenuset()  : string
Checks which menu set is chosen via $_GET. If none is explicity chosen the "default" one (create initially) is used.
checkChosenItemStatus()  : string
Checks if the menu item is set visible or not
getItemTitleAndURL()  : array<string|int, mixed>
Gets the title, url and name of a menu item
getMenuVisibility()  : string
Gets the menu visibility
inventMenuItem()  : int|array<string|int, mixed>|string
"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
getCurrentMenuItem()  : int|array<string|int, mixed>|string
Returns the data of the current menu item
getMenumanagerPredicessor()  : string
Returns the link to the predicessor of the current menu item
printMenumanagerPrevLink()  : mixed
Prints the previous link of the current menu item
getMenumanagerSuccessor()  : string
Returns the successor link of the current menu item
printMenumanagerNextLink()  : mixed
Gets the link to the next menu item
printMenuemanagerPageListWithNav()  : mixed
Prints a list of all pages.
printMenuemanagerPageList()  : mixed
Prints a full page navigation including previous and next page links with a list of all pages in between.
getParentMenuItems()  : array<string|int, mixed>|false
Gets the parent menu items of the current menu item. Returns the array of the items or false.
printMenumanagerBreadcrumb()  : mixed
Prints the breadcrumbs of the current page
getMenuFromLink()  : array<string|int, mixed>
Returns the menu item corresponding to $link
submenuOf()  : bool
Returns true if the current menu item is a sub item of $link
createMenuIfNotExists()  : mixed
Creates a menu set from the items passed. But only if the menu set does not already exist
getMenuItemChilds()  : array<string|int, mixed>|false
Gets the direct child menu items of the current menu item. Returns the array of the items or false.
isCurrentitemParent()  : bool
Checks if the item $item is a parent item of the current item
isPublicMenuItem()  : bool
Checks if the actual object the menu item represents is actually public
printCustomMenu()  : string
Prints a context sensitive menu of all pages as a unordered html list

Constants

Functions

printItemsListTable()

Prints the table part of a single page item for the sortable pages list

printItemsListTable(mixed $item, bool $flag) : mixed
Parameters
$item : mixed
$flag : bool

set to true to flag the element as having a problem with nesting level

printItemsList()

Prints the sortable pages list returns true if nesting levels exceede the database container

printItemsList(mixed $items) : bool
Parameters
$items : mixed
Return values
bool

Prints the link to the edit page of a menu item. For gallery and Zenpage items it links to their normal edit pages, for custom pages and custom links to menu specific edit page.

printItemEditLink(array<string|int, mixed> $item) : mixed
Parameters
$item : array<string|int, mixed>

Array of the menu item

printItemStatusDropdown()

Prints the item status selector to choose if all items or only hidden or visible should be listed

printItemStatusDropdown() : mixed

getMenuSetSelector()

returns the menu set selector

getMenuSetSelector(string $active) : mixed
Parameters
$active : string

true if changing the selection shuld reload to the new selection

publishItem()

Sets a menu item to published/visible

publishItem(int $id, string $show, string $menuset) : mixed
Parameters
$id : int

id of the item

$show : string

published status.

$menuset : string

chosen menu set

addSubalbumMenus()

adds (sub)albums to menu base with their gallery sorting order intact

addSubalbumMenus(string $menuset, int $id, string $link, string $sort) : mixed
Parameters
$menuset : string

chosen menu set

$id : int

table id of the parent.

$link : string

folder name of the album

$sort : string

xxx-xxx-xxx style sort order for album

addalbumsToDatabase()

Adds albums to the menu set. Returns the next sort order base

addalbumsToDatabase(string $menuset[, string $base = NULL ]) : int
Parameters
$menuset : string

current menu set

$base : string = NULL

starting "sort order"

Return values
int

addPagesToDatabase()

Adds Zenpage pages to the menu set

addPagesToDatabase(string $menuset[, mixed $base = NULL ]) : int
Parameters
$menuset : string

current menu set

$base : mixed = NULL
Return values
int

addCategoriesToDatabase()

Adds Zenpage news categories to the menu set

addCategoriesToDatabase(string $menuset[, mixed $base = NULL ]) : mixed
Parameters
$menuset : string

chosen menu set

$base : mixed = NULL

addItem()

Adds an menu item set via POST

addItem(mixed &$reports) : array<string|int, mixed>
Parameters
$reports : mixed
Return values
array<string|int, mixed>

updateMenuItem()

Updates a menu item (custom link, custom page only) set via POST

updateMenuItem(mixed &$reports) : mixed
Parameters
$reports : mixed

printAlbumsSelector()

Prints all albums of the Zenphoto gallery as a partial drop down menu (<option></option> parts).

printAlbumsSelector(string $current) : string
Parameters
$current : string

set to the album name selected (if any)

Return values
string

printZenpagePagesSelector()

Prints all available pages in Zenpage

printZenpagePagesSelector(string $current) : string
Parameters
$current : string

set to the page selected (if any)

Return values
string

printZenpageNewsCategorySelector()

Prints all available articles or categories in Zenpage

printZenpageNewsCategorySelector(string $current) : string
Parameters
$current : string

set to category selected (if any)

Return values
string

printCustomPageSelector()

Prints the selector for custom pages

printCustomPageSelector(mixed $current) : string
Parameters
$current : mixed
Return values
string

unpublishedZenphotoItemCheck()

checks if a album or image is un-published and returns a '*'

unpublishedZenphotoItemCheck(mixed $obj[, mixed $dropdown = true ]) : string
Parameters
$obj : mixed
$dropdown : mixed = true
Return values
string

menu_admin_toolbox_global()

Add menu to the admin toolbox

menu_admin_toolbox_global(mixed $zf) : mixed
Parameters
$zf : mixed

menu_tabs()

Adds menu manager to admin tabs

menu_tabs( $tabs) : unknown
Parameters
$tabs :

array Admin tabs

Return values
unknown

getMenuItems()

Gets the menu items

getMenuItems(string $menuset, string $visible) : array<string|int, mixed>
Parameters
$menuset : string

the menu tree desired

$visible : string
Return values
array<string|int, mixed>

getItem()

Gets a menu item by its id

getItem(int $id) : array<string|int, mixed>
Parameters
$id : int

id of the item

Return values
array<string|int, mixed>

checkChosenMenuset()

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

checkChosenMenuset([mixed $default = 'default' ]) : string
Parameters
$default : mixed = 'default'
Return values
string

checkChosenItemStatus()

Checks if the menu item is set visible or not

checkChosenItemStatus() : string
Return values
string

getItemTitleAndURL()

Gets the title, url and name of a menu item

getItemTitleAndURL(mixed $item) : array<string|int, mixed>
Parameters
$item : mixed
Return values
array<string|int, mixed>

getMenuVisibility()

Gets the menu visibility

getMenuVisibility() : string
Return values
string

inventMenuItem()

"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

inventMenuItem(string $menuset, string $visibility[, string $field = 'sort_order' ]) : int|array<string|int, mixed>|string

returns a contrived sort_order for the item.

Parameters
$menuset : string
$visibility : string
$field : string = 'sort_order'

The field of the array item to get, "all" for the full item array, "key" for the array index of the item within the items array (old default value)

Return values
int|array<string|int, mixed>|string

getCurrentMenuItem()

Returns the data of the current menu item

getCurrentMenuItem(string $menuset[, string $field = 'sort_order' ]) : int|array<string|int, mixed>|string
Parameters
$menuset : string

current menu set

$field : string = 'sort_order'

The field of the array item to get, "all" for the full item array, "key" for the array index of the item within the items array (old default value). Default 'sort_order'

Tags
since
1.5.7

Return values changed to match function name and doc, parameter $field added to help

Return values
int|array<string|int, mixed>|string

getMenumanagerPredicessor()

Returns the link to the predicessor of the current menu item

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

current menu set

Return values
string

Prints the previous link of the current menu item

printMenumanagerPrevLink(string $text[, string $menuset = 'default' ][, string $title = NULL ][, string $class = NULL ][, string $id = NULL ]) : mixed
Parameters
$text : string
$menuset : string = 'default'
$title : string = NULL
$class : string = NULL
$id : string = NULL

getMenumanagerSuccessor()

Returns the successor link of the current menu item

getMenumanagerSuccessor([string $menuset = 'default' ]) : string
Parameters
$menuset : string = 'default'
Return values
string

Gets the link to the next menu item

printMenumanagerNextLink(string $text[, string $menuset = 'default' ][, string $title = NULL ][, string $class = NULL ][, string $id = NULL ]) : mixed
Parameters
$text : string
$menuset : string = 'default'

current menu set

$title : string = NULL
$class : string = NULL
$id : string = NULL

printMenuemanagerPageListWithNav()

Prints a list of all pages.

printMenuemanagerPageListWithNav(string $prevtext, mixed $nexttext[, string $menuset = 'default' ][, string $class = 'pagelist' ][, string $nextprev = true ][, string $id = NULL ][, bool $firstlast = true ][, int $navlen = 9 ]) : mixed
Parameters
$prevtext : string

Insert here the linktext like 'previous page'

$nexttext : mixed
$menuset : string = 'default'

current menu set

$class : string = 'pagelist'

the css class to use, "pagelist" by default

$nextprev : string = true

set to true to get the 'next' and 'prev' links printed

$id : string = NULL

the css id to use

$firstlast : bool = true

Add links to the first and last pages of you gallery

$navlen : int = 9

Number of navigation links to show (0 for all pages). Works best if the number is odd.

printMenuemanagerPageList()

Prints a full page navigation including previous and next page links with a list of all pages in between.

printMenuemanagerPageList([mixed $menuset = 'default' ][, string $class = 'pagelist' ][, string $id = NULL ][, bool $firstlast = true ][, int $navlen = 9 ]) : mixed
Parameters
$menuset : mixed = 'default'
$class : string = 'pagelist'

Insert here the CSS-class name you want to style the link with (default is "pagelist")

$id : string = NULL

Insert here the CSS-ID name if you want to style the link with this

$firstlast : bool = true

Add links to the first and last pages of you gallery

$navlen : int = 9

Number of navigation links to show (0 for all pages). Works best if the number is odd.

getParentMenuItems()

Gets the parent menu items of the current menu item. Returns the array of the items or false.

getParentMenuItems([string $menuset = 'default' ][, array<string|int, mixed> $currentitem = null ]) : array<string|int, mixed>|false
Parameters
$menuset : string = 'default'

current menu set

$currentitem : array<string|int, mixed> = null

Optional array of the menu item to get parents of. Default null for the current item

Return values
array<string|int, mixed>|false

printMenumanagerBreadcrumb()

Prints the breadcrumbs of the current page

printMenumanagerBreadcrumb([string $menuset = 'default' ][, string $before = '' ][, string $between = ' | ' ][, string $after = ' | ' ]) : mixed

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
$menuset : string = 'default'

current menu set

$before : string = ''

before text

$between : string = ' | '

between text

$after : string = ' | '

after text

Returns the menu item corresponding to $link

getMenuFromLink(string $link[, string $menuset = 'default' ]) : array<string|int, mixed>
Parameters
$link : string
$menuset : string = 'default'
Return values
array<string|int, mixed>

submenuOf()

Returns true if the current menu item is a sub item of $link

submenuOf(string $link[, string $menuset = 'default' ]) : bool
Parameters
$link : string

possible parent

$menuset : string = 'default'

current menuset

Return values
bool

createMenuIfNotExists()

Creates a menu set from the items passed. But only if the menu set does not already exist

createMenuIfNotExists(array<string|int, mixed> $menuitems[, string $menuset = 'default' ]) : mixed
Parameters
$menuitems : array<string|int, mixed>

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

$menuset : string = 'default'

current menuset

getMenuItemChilds()

Gets the direct child menu items of the current menu item. Returns the array of the items or false.

getMenuItemChilds([string $menuset = 'default' ][, bool $allchilds = false ][, mixed $currentitem = null ]) : array<string|int, mixed>|false
Parameters
$menuset : string = 'default'

current menu set

$allchilds : bool = false

Set to false (default) for the next level childs, true for childs of all further levels

$currentitem : mixed = null
Return values
array<string|int, mixed>|false

isCurrentitemParent()

Checks if the item $item is a parent item of the current item

isCurrentitemParent([string $menuset = 'default' ][, array<string|int, mixed> $item = array() ]) : bool
Parameters
$menuset : string = 'default'

Name of the menuset to use

$item : array<string|int, mixed> = array()

Array of the item to check

Return values
bool

isPublicMenuItem()

Checks if the actual object the menu item represents is actually public

isPublicMenuItem(string $menuset, array<string|int, mixed> $item, array<string|int, mixed> $itemarray) : bool
Parameters
$menuset : string
$item : array<string|int, mixed>

The menu item array of the menu item to check

$itemarray : array<string|int, mixed>

The item array of the menu item to check as returned by getItemTitleAndURL()

Tags
since
1.6.1
Return values
bool

printCustomMenu()

Prints a context sensitive menu of all pages as a unordered html list

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
Parameters
$menuset : string = 'default'

the menu tree to output

$option : string = 'list'

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

$css_id : string = ''

CSS id of the top level list

$css_class_topactive : string = ''

class of the active item in the top level list

$css_class : string = ''

CSS class of the sub level list(s)

$css_class_active : string = ''

CSS class of the sub level list(s)

$showsubs : int = 0

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

$counter : bool = false

TRUE (FALSE default) if you want the count of articles for Zenpage news categories or images/subalbums for albums.

Return values
string

        
On this page

Search results