print_album_menu.php
Prints a list of all albums context sensitive.
Menu types:
- list for HTML list
- list-top for only the top level albums
- omit-top same as list, but the first level of albums is omitted
- list-sub lists the offspring level of subalbums for the current album
- jump dropdown menu of all albums(not context sensitive)
Call the function printAlbumMenu() at the point where you want the menu to appear.
Tags
Table of Contents
Classes
- print_album_menu
- Plugin option handling class
Constants
- ALBUM_MENU_COUNT = \getOption('print_album_menu_count')
- ALBUM_MENU_SHOWSUBS = \getOption('print_album_menu_showsubs')
Functions
- printAlbumMenu() : mixed
- Prints a list of all albums context sensitive.
- printAlbumMenuList() : html
- Prints a nested html list of all albums context sensitive.
- printAlbumMenuListAlbum() : mixed
- Handles an album for printAlbumMenuList
- printAlbumMenuJump() : mixed
- Prints a dropdown menu of all albums(not context sensitive) Is used by the wrapper function printAlbumMenu() if the options "jump" is choosen. For standalone use, too.
- checkSelectedAlbum() : string
- A printAlbumMenu() helper function for the jump menu mode of printAlbumMenu() that only checks which the current album so that the entry in the in the dropdown jump menu can be selected Not for standalone use.
Constants
ALBUM_MENU_COUNT
public
mixed
ALBUM_MENU_COUNT
= \getOption('print_album_menu_count')
ALBUM_MENU_SHOWSUBS
public
mixed
ALBUM_MENU_SHOWSUBS
= \getOption('print_album_menu_showsubs')
Functions
printAlbumMenu()
Prints a list of all albums context sensitive.
printAlbumMenu(string $option[, bool $showcount = NULL ][, string $css_id = '' ][, string $css_class_topactive = '' ][, string $css_class = '' ][, string $css_class_active = '' ][, string $indexname = "Gallery Index" ][, int $showsubs = NULL ][, bool $firstimagelink = false ][, bool $keeptopactive = false ]) : mixed
Since 1.4.3 this is a wrapper function for the separate functions printAlbumMenuList() and printAlbumMenuJump(). that was included to remain compatiblility with older installs of this menu.
Usage: add the following to the php page where you wish to use these menus: enable this extension on the zenphoto admin plugins tab. Call the function printAlbumMenu() at the point where you want the menu to appear.
Parameters
- $option : string
-
"list" for html list, "list-top" for only the top level albums, "omit-top" same as list, but the first level of albums is omitted "list-sub" lists the offspring level of subalbums for the current album "jump" dropdown menu of all albums(not context sensitive)
- $showcount : bool = NULL
-
true for a image counter or subalbum count in brackets behind the album name, false for no image numbers or leave blank
- $css_id : string = ''
-
insert css id for the main album list, leave empty if you don't use (only list mode)
- $css_class_topactive : string = ''
-
insert css class for the active link in the main album list (only list mode)
- $css_class : string = ''
-
insert css class for the sub album lists (only list mode)
- $css_class_active : string = ''
-
insert css class for the active link in the sub album lists (only list mode)
- $indexname : string = "Gallery Index"
-
insert the name how you want to call the link to the gallery index (insert "" if you don't use it, it is not printed then)
- $showsubs : int = NULL
-
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".
- $firstimagelink : bool = false
-
If set to TRUE and if the album has images the link will point to page of the first image instead the album thumbnail page
- $keeptopactive : bool = false
-
If set to TRUE the toplevel album entry will stay marked as active if within its subalbums ("list" only)
Tags
printAlbumMenuList()
Prints a nested html list of all albums context sensitive.
printAlbumMenuList(string $option[, bool $showcount = NULL ][, string $css_id = '' ][, mixed $css_class_topactive = '' ][, string $css_class = '' ][, string $css_class_active = '' ][, string $indexname = "Gallery Index" ][, int $showsubs = NULL ][, bool $firstimagelink = false ][, bool $keeptopactive = false ][, bool $startlist = true ][, int $limit = NULL ]) : html
Usage: add the following to the php page where you wish to use these menus: enable this extension on the zenphoto admin plugins tab; Call the function printAlbumMenuList() at the point where you want the menu to appear.
Parameters
- $option : string
-
"list" for html list, "list-top" for only the top level albums, "omit-top" same as list, but the first level of albums is omitted "list-sub" lists the offspring level of subalbums for the current album
- $showcount : bool = NULL
-
true for a image counter in brackets behind the album name, false for no image numbers or leave empty
- $css_id : string = ''
-
insert css id for the main album list, leave empty if you don't use (only list mode)
- $css_class_topactive : mixed = ''
- $css_class : string = ''
-
insert css class for the sub album lists (only list mode)
- $css_class_active : string = ''
-
insert css class for the active link in the sub album lists (only list mode)
- $indexname : string = "Gallery Index"
-
insert the name (default "Gallery Index") how you want to call the link to the gallery index, insert "" if you don't use it, it is not printed then.
- $showsubs : int = NULL
-
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".
- $firstimagelink : bool = false
-
If set to TRUE and if the album has images the link will point to page of the first image instead the album thumbnail page
- $keeptopactive : bool = false
-
If set to TRUE the toplevel album entry will stay marked as active if within its subalbums ("list" only)
- $startlist : bool = true
-
set to true to output the UL tab (false automatically if you use 'omit-top' or 'list-sub')
- $limit : int = NULL
-
truncation of display text
Return values
html —list of the albums
printAlbumMenuListAlbum()
Handles an album for printAlbumMenuList
printAlbumMenuListAlbum(array<string|int, mixed> $albums, string $folder, string $option, string $showcount, int $showsubs, string $css_class, string $css_class_topactive, string $css_class_active, bool $firstimagelink, bool $keeptopactive[, int $limit = NULL ]) : mixed
Parameters
- $albums : array<string|int, mixed>
-
albums array
- $folder : string
- $option : string
-
see printAlbumMenuList
- $showcount : string
-
see printAlbumMenuList
- $showsubs : int
-
see printAlbumMenuList
- $css_class : string
-
see printAlbumMenuList
- $css_class_topactive : string
-
see printAlbumMenuList
- $css_class_active : string
-
see printAlbumMenuList
- $firstimagelink : bool
-
If set to TRUE and if the album has images the link will point to page of the first image instead the album thumbnail page
- $keeptopactive : bool
-
If set to TRUE the toplevel album entry will stay marked as active if within its subalbums ("list" only)
- $limit : int = NULL
-
truncation of display text
printAlbumMenuJump()
Prints a dropdown menu of all albums(not context sensitive) Is used by the wrapper function printAlbumMenu() if the options "jump" is choosen. For standalone use, too.
printAlbumMenuJump([string $option = "count" ][, string $indexname = "Gallery Index" ][, bool $firstimagelink = false ][, mixed $showsubs = NULL ][, bool $skipform = false ]) : mixed
Usage: add the following to the php page where you wish to use these menus: enable this extension on the zenphoto admin plugins tab; Call the function printAlbumMenuJump() at the point where you want the menu to appear.
Parameters
- $option : string = "count"
-
"count" for a image counter in brackets behind the album name, "" = for no image numbers
- $indexname : string = "Gallery Index"
-
insert the name (default "Gallery Index") how you want to call the link to the gallery index, insert "" if you don't use it, it is not printed then.
- $firstimagelink : bool = false
-
If set to TRUE and if the album has images the link will point to page of the first image instead the album thumbnail page
- $showsubs : mixed = NULL
- $skipform : bool = false
-
If set to false this prints a full form option select list (default), if set to true it will only print the options
checkSelectedAlbum()
A printAlbumMenu() helper function for the jump menu mode of printAlbumMenu() that only checks which the current album so that the entry in the in the dropdown jump menu can be selected Not for standalone use.
checkSelectedAlbum(string $checkalbum, string $option) : string
Parameters
- $checkalbum : string
-
The album folder name to check
- $option : string
-
"index" for index level, "album" for album level
Return values
string —returns nothing or "selected"