ZenphotoCMS 1.6.2

multiple_layouts.php

Provides functionality to select different templates for the standard theme pages <i>album.php</i>, <i>image.php</i> and for Zenpage <i>pages.php</i> and <i>news.php</i>.

The additional template files have to be clones of the standard theme pages which must be kept as default ones. The file names of these additional template files must match these patterns and should not include special characters or characters with diacritical marks:

Zenphoto gallery items:

  • For albums: albumcustomname.php
  • For images : imagecustomname.php

"Select album layout" checkbox: If you want to avoid to manually select a specific layout for all images in an album you can check this option on the album's edit page. Then a layout is assigned to the images automatically as well.

Example: You select an album layout page named "album_test.php" for an album. If you select that option mentioned above an image layout named "image_test.php" will be used for the direct images of this album if it exists. Otherwise the standard image.php is used or if set an individual image layout page. Selecting this option will not clear already individually set image layouts!

Zenpage CMS items:


For Zenpage pages: pagescustomname.php
For Zenpage news articles and news categories: newscustomname.php.

The main news page and the news archive can't be assigned to layout pages.

Layout selection inheritance:


The layout selection of a parent album (images see above), page or category is inherited by its sub items on all levels without their own db entry if no specific layout is seleced. News articles don't inherit anything because they don't directly belong to any parent item.
Tags
author

Malte Müller (acrylian), Stephen Billard (sbillard)

Table of Contents

Classes

multipleLayoutOptions
Plugin option handling class

Functions

getSelectedLayout()  : string|false
Gets the selected layout page for this item. Returns false if nothing is selected.
checkParentLayouts()  : array<string|int, mixed>|false
Checks if there is a layout inherited from a parent items (album, page or category) and returns it. Returns false otherwise.
checkLayoutUseForImages()  : array<string|int, mixed>|false
Gets the selected layout page for images if the album option to use the equivalent of their album layout is seleted.
layoutSelector()  : string
returns the layout selector for an object.
layoutSelector_album()  : string
returns the layout selectors for an album.
getLayoutSelector()  : string
Worker function for creating layout selectors. Returns the HTML
getLayout()  : string
Gets the select layout page and returns it to the load_theme_script filter
saveLayoutSelection()  : string
Saves the layout page assignment via filter on the backend
saveZenphotoLayoutSelection()  : string
Saves the layout page assignment via filter on the backend for images and albums
deleteLayoutSelection()  : bool
processes object removals if they have been assigned layouts
copyLayoutSelection()  : mixed
Copies the layout selection

Functions

getSelectedLayout()

Gets the selected layout page for this item. Returns false if nothing is selected.

getSelectedLayout(object $obj, string $type) : string|false
Parameters
$obj : object

the object being selected

$type : string

For Zenphoto gallery items "multiple_layouts_albums", 'multiple_layouts_albums_images', 'multiple_layouts_images' For Zenpage CMS items , "multiple_layouts_pages", , "multiple_layouts_news" , "multiple_layouts_news_categories"

Return values
string|false

checkParentLayouts()

Checks if there is a layout inherited from a parent items (album, page or category) and returns it. Returns false otherwise.

checkParentLayouts(object $obj, string $type) : array<string|int, mixed>|false
Parameters
$obj : object

the object being selected

$type : string

For Zenphoto gallery items "multiple_layouts_albums", 'multiple_layouts_albums_images', 'multiple_layouts_images' For Zenpage CMS items , "multiple_layouts_pages", , "multiple_layouts_news" , "multiple_layouts_news_categories"

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

checkLayoutUseForImages()

Gets the selected layout page for images if the album option to use the equivalent of their album layout is seleted.

checkLayoutUseForImages(object $obj) : array<string|int, mixed>|false
Parameters
$obj : object

the album

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

layoutSelector()

returns the layout selector for an object.

layoutSelector(mixed $html, object $obj[, mixed $prefix = '' ]) : string
Parameters
$html : mixed
$obj : object
$prefix : mixed = ''
Return values
string

layoutSelector_album()

returns the layout selectors for an album.

layoutSelector_album(mixed $html, object $obj[, mixed $prefix = '' ]) : string
Parameters
$html : mixed
$obj : object
$prefix : mixed = ''
Tags
parem

string $prefix

Return values
string

getLayoutSelector()

Worker function for creating layout selectors. Returns the HTML

getLayoutSelector(object $obj, string $type, string $text[, string $prefix = '' ][, bool $secondary = false ]) : string
Parameters
$obj : object
$type : string
$text : string
$prefix : string = ''

Default empty

$secondary : bool = false

Default false

Return values
string

getLayout()

Gets the select layout page and returns it to the load_theme_script filter

getLayout(string $path) : string
Parameters
$path : string

Path of the layout file

Return values
string

saveLayoutSelection()

Saves the layout page assignment via filter on the backend

saveLayoutSelection(string $message, object $obj) : string
Parameters
$message : string

Message (not used)

$obj : object

Object of the item to assign the layout

Return values
string

saveZenphotoLayoutSelection()

Saves the layout page assignment via filter on the backend for images and albums

saveZenphotoLayoutSelection(object $obj, string $prefix) : string
Parameters
$obj : object

Object of the item to assign the layout

$prefix : string
Return values
string

deleteLayoutSelection()

processes object removals if they have been assigned layouts

deleteLayoutSelection(bool $allow, object $obj) : bool
Parameters
$allow : bool

we just return this since we have no need to abort the remove

$obj : object

the object being removed

Return values
bool

copyLayoutSelection()

Copies the layout selection

copyLayoutSelection(int $newid, obj $obj) : mixed
Parameters
$newid : int

ID of the item to copy to

$obj : obj

Object of the original item return int


        
On this page

Search results