ZenphotoCMS 1.6.3

admin-functions.php

support functions for Admin

Table of Contents

Constants

CUSTOM_OPTION_PREFIX  = '_ZP_CUSTOM_'
EDITOR_SANITIZE_LEVEL  = 1
OPTION_TYPE_CHECKBOX  = 1
OPTION_TYPE_CHECKBOX_ARRAY  = 6
OPTION_TYPE_CHECKBOX_UL  = 7
OPTION_TYPE_CLEARTEXT  = 9
OPTION_TYPE_COLOR_PICKER  = 8
OPTION_TYPE_CUSTOM  = 2
OPTION_TYPE_NOTE  = 10
OPTION_TYPE_PASSWORD  = 11
OPTION_TYPE_RADIO  = 4
OPTION_TYPE_RICHTEXT  = 12
OPTION_TYPE_SELECTOR  = 5
OPTION_TYPE_TEXTAREA  = 3
OPTION_TYPE_TEXTBOX  = 0
Generates the HTML for custom options (e.g. theme options, plugin options, etc.) Note: option names may not contain '.', '+', nor '%' as PHP POST handling will replace these with an underscore.
TEXT_INPUT_SIZE  = 48
TEXT_INPUT_SIZE_SHORT  = 30
TEXTAREA_COLUMNS  = 50
TEXTAREA_COLUMNS_SHORT  = 32

Functions

printAdminFooter()  : mixed
Print the footer <div> for the bottom of all admin pages.
datepickerJS()  : mixed
printAdminHeader()  : mixed
Print the header for all admin pages. Starts at <DOCTYPE> but does not include the </head> tag, in case there is a need to add something further.
printSortableHead()  : mixed
printLogoAndLinks()  : mixed
Print the html required to display the ZP logo and links in the top section of the admin page.
printTabs()  : mixed
Print the nav tabs for the admin section. We determine which tab should be highlighted from the $_GET['page']. If none is set, we default to "home".
getSubtabs()  : mixed
printSubtabs()  : mixed
setAlbumSubtabs()  : mixed
handleDeprecatedMenuGlobals()  : mixed
Roughly fixes outdated usages of old admin "tab" globals and joins them with the actual globals.
checked()  : mixed
Used for checkbox and radiobox form elements to compare the $checked value with the $current.
customOptions()  : mixed
processCustomOptionSave()  : mixed
standardThemeOptions()  : mixed
Set defaults for standard theme options incase the theme has not done so
postIndexEncode()  : mixed
Encodes for use as a $_POST index
postIndexDecode()  : string
Decodes encoded $_POST index
generateRadiobuttonsFromArray()  : mixed
Prints radio buttons from an array
generateUnorderedListFromArray()  : mixed
Creates the body of an unordered list with checkbox label/input fields (scrollable sortables)
tagSelector()  : mixed
Creates an unordered checklist of the tags
printAlbumEditForm()  : mixed
emits the html for editing album information called in edit album and mass edit
printAlbumButtons()  : mixed
puts out the maintenance buttons for an album
printAlbumLegend()  : mixed
printAlbumEditRow()  : mixed
puts out a row in the edit album table
processAlbumEdit()  : string
processes the post from the above
processImageEdit()  : mixed
Process the image edit form posted
adminPageNav()  : mixed
print_language_string_list()  : mixed
Generates an editable list of language strings
process_language_string_save()  : string
process the post of a language string form
getTagOrder()  : int
Returns the desired tagsort order (0 for alphabetic, 1 for most used)
unzip()  : mixed
Unzips an image archive
is_zip()  : bool
Checks for a zip file
isolate()  : string
Extracts and returns a 'statement' from a PHP script so that it may be 'evaled'
listDirectoryFiles()  : array<string|int, mixed>
Return an array of files from a directory and sub directories
themeIsEditable()  : bool
Check if a theme is editable (ie not a bundled theme)
zenPhotoTheme()  : mixed
copyThemeDirectory()  : bool|string
Copy a theme directory to create a new custom theme
deleteThemeDirectory()  : bool
Deletes a theme
currentRelativeURL()  : string
Return URL of current admin page
getParentAlbumsAdmin()  : array<string|int, mixed>
Returns an array of the names of the parents of the current album.
getAlbumBreadcrumbAdmin()  : mixed
removeParentAlbumNames()  : string
Removes the parent album name so that we can print a album breadcrumb with them
printAdminRightsTable()  : mixed
Outputs the rights checkbox table for admin
printManagedObjects()  : mixed
Creates the managed album table for Admin
processRights()  : bit
processes the post of administrator rights
processManagedObjects()  : mixed
getCheckboxState()  : int
Returns the value of a checkbox form item
standardScripts()  : array<string|int, mixed>
Returns an array of "standard" theme scripts. This list is normally used to exclude these scripts form various option seletors.
getWatermarks()  : array<string|int, mixed>
Returns a merged list of available watermarks
processOrder()  : array<string|int, mixed>
Processes the serialized array from tree sort.
postAlbumSort()  : mixed
POST handler for album tree sorts
printNestedAlbumsList()  : bool
Prints the sortable nested albums list returns true if nesting levels exceede the database container
printEditDropdown()  : mixed
Prints the dropdown menu for the nesting level depth for the album sorting
processEditSelection()  : mixed
printBulkActions()  : mixed
Edit tab bulk actions drop-down
bulkActionRedirect()  : mixed
common redirector for bulk action handling return
bulkTags()  : array<string|int, mixed>
Process the bulk tags
processAlbumBulkActions()  : mixed
Processes the check box bulk actions for albums
processImageBulkActions()  : mixed
Handles Image bulk actions
processCommentBulkActions()  : mixed
Processes the check box bulk actions for comments
codeblocktabsJS()  : mixed
Codeblock tabs JavaScript code
printCodeblockEdit()  : mixed
prints codeblock edit boxes
processCodeblockSave()  : string
handles saveing of codeblock edits
admin_securityChecks()  : mixed
Standard admin pages checks
minDiff()  : mixed
getPageSelector "diff" function
fullText()  : string
getPageSelector "diff" function
dateDiff()  : string
getPageSelector "diff" function
getPageSelector()  : array<string|int, mixed>
returns a selector list based on the "names" of the list items
printPageSelector()  : mixed
unQuote()  : mixed
Strips off quotes from the strng
admin_album_list()  : string
Returns an option list of administrators who can own albums or images
getLogTabs()  : array<string|int, mixed>
Returns an array with the logtabs array, the default log tab and an array of log files to the default (current) log tab (for use in the logfile selector)
getDefaultLogTabs()  : array<string|int, mixed>
Gets an array log tab names and localized (gettexted) log titles
getLogFiles()  : array<string|int, mixed>
Gets a nested array with the log type (tab name) and corresponding log files
printLogSelector()  : mixed
Prints the selector for logfiles of the current log tab
getPluginTabs()  : mixed
Figures out which plugin tabs to display
getAdminThumbSizes()  : array<string|int, mixed>
Gets an array with the size values for the admin thumb generation
getAdminThumb()  : string
Gets the URL of the adminthumb
getSizeAdminThumb()  : array<string|int, mixed>
Returns an array with width and height of the resized image
getAdminThumbHTML()  : string
Returns the full HTML element of an admin thumb Applies the filters 'adminthumb_html'
printAdminThumb()  : string
Prints an admin thumb
processCredentials()  : mixed
handles save of user/password
consolidatedEditMessages()  : mixed
getThemeFiles()  : array<string|int, mixed>
returns an array of the theme scripts not in the exclude array
checkAlbumParentid()  : mixed
Checks for bad parentIDs from old move/copy bug
clonedFrom()  : mixed
checkAlbumimagesort()  : string
Make sure the albumimagesort is only an allowed value. Otherwise returns nothing.
printLastChangeInfo()  : mixed
Prints the last change date and last change user notice on backend edit pages Also for albums it prints the updateddate
getSortByOptions()  : array<string|int, mixed>
Returns the option array for the sort by selectors for gallery, albums and images
getSortByStatusOptions()  : array<string|int, mixed>
Returns an array of the status order options for all items
checkSchedulePublishingNotes()  : bool
Helper to check if notes are to be printed (only needed because of the inconvenient legacy table based layout on image edit pages)
printScheduledPublishingNotes()  : mixed
Prints various notes regarding the scheduled publishing status for single edit pages
printStatusNotes()  : mixed
Prints various notes regarding the scheduled publishing status for single edit pages
getStatusNote()  : string
Gets a specific predefined status note for an object (if available) Note: The notes are not status dependend!
getStatusNotes()  : array<string|int, mixed>
Gets an array of all predefined status notes
getStatusNotesByContext()  : array<string|int, mixed>
Gets an array with all status notes that apply to $obj currently
getStatusIcons()  : array<string|int, mixed>
Gets an key => value array of all available object status icons as full <img> elements
getStatusIcon()  : string
Gets the icon img element for a specific status icon
printPublishIconLinkGallery()  : mixed
Prints the publish icon link to change the status on the album and thumb image list
getPublishIcon()  : string
Returns the publish icon for the current status
printPublished()  : string
Prints the scheduled publishing date for items if set. Also prints the date for Zenpage news articles and pages
printExpired()  : string
Prints the expiration or expired date for items
printProtectedIcon()  : mixed
Prints the protected icon if the object is password protected on an edit list
isIncompatibleExtension()  : bool|string
Checks plugin and theme definition for $plugin_disable / $theme_description['disable'] so plugins/themes are deaktivated respectively cannot be activated if they don't match conditions/requirements. See the plugin/theme documentation for info how to define these.
processExtensionVariable()  : string|bool
Processes a plugin or theme definition variable.
printSelectorWithCustomField()  : mixed
Prints a selector (select list) with a custom text field from the values parameter. The following array entries will be created automatically:
getZenpagePagesOptionsArray()  : mixed
Gets an array of Zenpage pages ready for using with selector, radioboxes and checkbox lists
printZenpagePageSelector()  : mixed
Prints an select list option for Zenpage pages
getAdminstratorsOptionsArray()  : type
Gets an array of administrators ready for using with selector, radioboxes and checkbox lists
printUserSelector()  : mixed
Prints an select list option for users
isTextFile()  : type
Helper for the theme editor
getSubalbumImages()  : type
Updates the $_zp_admin_imagelist global used on dynamic album editing
markUpdated()  : mixed
Updates $_zp_admin_user_updated on user editing
printImageRotationSelector()  : mixed
Prints the image EXIF rotation/flipping selector
printDatetimeFormatSelector()  : mixed
Prints option selectors for date and time formats
getDatetimeFormatlistForSelector()  : array<string|int, mixed>
Helper functions for printDatetimeFormatSelector() ot create the format lists for the selector, not intended to be used standalone

Constants

CUSTOM_OPTION_PREFIX

public mixed CUSTOM_OPTION_PREFIX = '_ZP_CUSTOM_'

OPTION_TYPE_CHECKBOX_ARRAY

public mixed OPTION_TYPE_CHECKBOX_ARRAY = 6

OPTION_TYPE_TEXTBOX

Generates the HTML for custom options (e.g. theme options, plugin options, etc.) Note: option names may not contain '.', '+', nor '%' as PHP POST handling will replace these with an underscore.

public mixed OPTION_TYPE_TEXTBOX = 0

Functions

printAdminFooter()

Print the footer <div> for the bottom of all admin pages.

printAdminFooter([string $addl = '' ]) : mixed
Parameters
$addl : string = ''

additional text to output on the footer.

Tags
author

Todd Papaioannou (lucky@luckyspin.org)

since
1.0.0

printAdminHeader()

Print the header for all admin pages. Starts at <DOCTYPE> but does not include the </head> tag, in case there is a need to add something further.

printAdminHeader(string $tab[, string $subtab = NULL ]) : mixed
Parameters
$tab : string

the album page

$subtab : string = NULL

the sub-tab if any

Print the html required to display the ZP logo and links in the top section of the admin page.

printLogoAndLinks() : mixed
Tags
author

Todd Papaioannou (lucky@luckyspin.org)

since
1.0.0

printTabs()

Print the nav tabs for the admin section. We determine which tab should be highlighted from the $_GET['page']. If none is set, we default to "home".

printTabs() : mixed
Tags
author

Todd Papaioannou (lucky@luckyspin.org)

since
1.0.0

setAlbumSubtabs()

setAlbumSubtabs(mixed $album) : mixed
Parameters
$album : mixed

handleDeprecatedMenuGlobals()

Roughly fixes outdated usages of old admin "tab" globals and joins them with the actual globals.

handleDeprecatedMenuGlobals() : mixed

and also throws deprecation notices about this.

Tags
since
1.6
global

type $_zp_admin_menu

global

type $_zp_admin_current_page

global

type $_zp_admin_current_subpage

global

type $_zp_admin_menu

global

type $_zp_admin_current_subpage

global

type $_zp_admin_subtab

checked()

Used for checkbox and radiobox form elements to compare the $checked value with the $current.

checked(mixed $checked, mixed $current) : mixed

Echos the attribute checked="checked

Parameters
$checked : mixed
$current : mixed

customOptions()

customOptions(mixed $optionHandler[, mixed $indent = "" ][, mixed $album = NULL ][, mixed $showhide = false ][, mixed $supportedOptions = NULL ][, mixed $theme = false ][, mixed $initial = 'none' ][, mixed $extension = NULL ]) : mixed
Parameters
$optionHandler : mixed
$indent : mixed = ""
$album : mixed = NULL
$showhide : mixed = false
$supportedOptions : mixed = NULL
$theme : mixed = false
$initial : mixed = 'none'
$extension : mixed = NULL

processCustomOptionSave()

processCustomOptionSave(mixed $returntab[, mixed $themename = NULL ][, mixed $themealbum = NULL ]) : mixed
Parameters
$returntab : mixed
$themename : mixed = NULL
$themealbum : mixed = NULL

standardThemeOptions()

Set defaults for standard theme options incase the theme has not done so

standardThemeOptions(string $theme, mixed $album) : mixed
Parameters
$theme : string
$album : mixed

postIndexEncode()

Encodes for use as a $_POST index

postIndexEncode(string $str) : mixed
Parameters
$str : string

postIndexDecode()

Decodes encoded $_POST index

postIndexDecode(string $str) : string
Parameters
$str : string
Return values
string

generateRadiobuttonsFromArray()

Prints radio buttons from an array

generateRadiobuttonsFromArray(string $currentvalue, string $list, string $option[, bool $behind = false ][, mixed $class = 'checkboxlabel' ][, mixed $disabled = NULL ]) : mixed
Parameters
$currentvalue : string

The current selected value

$list : string

the array of the list items form is localtext => buttonvalue

$option : string

the name of the option for the input field name

$behind : bool = false

set true to have the "text" before the button

$class : mixed = 'checkboxlabel'
$disabled : mixed = NULL

generateUnorderedListFromArray()

Creates the body of an unordered list with checkbox label/input fields (scrollable sortables)

generateUnorderedListFromArray(array<string|int, mixed> $currentValue, array<string|int, mixed> $list, string $prefix, string $alterrights, bool $sort, bool $localize[, string $class = NULL ][, mixed $extra = NULL ]) : mixed
Parameters
$currentValue : array<string|int, mixed>

list of items to be flagged as checked

$list : array<string|int, mixed>

the elements of the select list

$prefix : string

prefix of the input item

$alterrights : string

are the items changable.

$sort : bool

true for sorted list

$localize : bool

true if the list local key is text for the item

$class : string = NULL

optional class for items

$extra : mixed = NULL

tagSelector()

Creates an unordered checklist of the tags

tagSelector(object $that, string $postit[, bool $showCounts = false ][, mixed $mostused = false ][, mixed $addnew = true ][, mixed $resizeable = false ][, mixed $class = 'checkTagsAuto' ]) : mixed
Parameters
$that : object

Object for which to get the tags

$postit : string

prefix to prepend for posting

$showCounts : bool = false

set to true to get tag count displayed

$mostused : mixed = false
$addnew : mixed = true
$resizeable : mixed = false
$class : mixed = 'checkTagsAuto'

printAlbumEditForm()

emits the html for editing album information called in edit album and mass edit

printAlbumEditForm(string $index, object $album[, bool $buttons = true ]) : mixed
Parameters
$index : string

the index of the entry in mass edit or '0' if single album

$album : object

the album object

$buttons : bool = true

set true for "apply" buttons

Tags
since
1.1.3

printAlbumButtons()

puts out the maintenance buttons for an album

printAlbumButtons(object $album) : mixed
Parameters
$album : object

is the album being emitted

printAlbumEditRow()

puts out a row in the edit album table

printAlbumEditRow(object $album, bool $show_thumb, object $owner) : mixed
Parameters
$album : object

is the album being emitted

$show_thumb : bool

set to false to show thumb standin image rather than album thumb

$owner : object

the parent album (or NULL for gallery)

processAlbumEdit()

processes the post from the above

processAlbumEdit(int $index, object $album, string &$redirectto) : string
Parameters
$index : int

the index of the entry in mass edit or 0 if single album

$album : object

the album object

$redirectto : string

used to redirect page refresh on move/copy/rename

Tags
since
1.1.3
Return values
string

error flag if passwords don't match

processImageEdit()

Process the image edit form posted

processImageEdit(obj $image, type $index[, bool $massedit = true ]) : mixed
Parameters
$image : obj

Image object

$index : type

Index of the image if within the images list or 0 if single image edit

$massedit : bool = true

Whether editing single image (false) or multiple images at once (true). Note: to determine whether to process additional fields in single image edit mode.

adminPageNav()

adminPageNav(mixed $pagenum, mixed $totalpages, mixed $adminpage, mixed $parms[, mixed $tab = '' ]) : mixed
Parameters
$pagenum : mixed
$totalpages : mixed
$adminpage : mixed
$parms : mixed
$tab : mixed = ''

print_language_string_list()

Generates an editable list of language strings

print_language_string_list(string $dbstring, string $name[, bool $textbox = false ][, string $locale = NULL ][, string $edit = '' ][, int $wide = TEXT_INPUT_SIZE ][, string $ulclass = 'language_string_list' ][, int $rows = 6 ]) : mixed
Parameters
$dbstring : string

either a serialized languag string array or a single string

$name : string

the prefix for the label, id, and name tags

$textbox : bool = false

set to true for a textbox rather than a text field

$locale : string = NULL

optional locale of the translation desired

$edit : string = ''

optional class

$wide : int = TEXT_INPUT_SIZE

column size. true or false for the standard or short sizes. Or pass a column size

$ulclass : string = 'language_string_list'

set to the class for the UL element

$rows : int = 6

set to the number of rows to show.

process_language_string_save()

process the post of a language string form

process_language_string_save(string $name[,  $sanitize_level = 3 ]) : string
Parameters
$name : string

the prefix for the label, id, and name tags

$sanitize_level : = 3

the type of sanitization required

Return values
string

getTagOrder()

Returns the desired tagsort order (0 for alphabetic, 1 for most used)

getTagOrder() : int
Return values
int

unzip()

Unzips an image archive

unzip(file $file, string $dir) : mixed
Parameters
$file : file

the archive

$dir : string

where the images go

is_zip()

Checks for a zip file

is_zip(string $filename) : bool
Parameters
$filename : string

name of the file

Return values
bool

isolate()

Extracts and returns a 'statement' from a PHP script so that it may be 'evaled'

isolate(string $target, string $str) : string
Parameters
$target : string

the assignment variable to match on

$str : string

the PHP script

Return values
string

themeIsEditable()

Check if a theme is editable (ie not a bundled theme)

themeIsEditable( $theme) : bool
Parameters
$theme :

theme to check

Tags
since
1.3
Return values
bool

zenPhotoTheme()

zenPhotoTheme(mixed $theme) : mixed
Parameters
$theme : mixed

copyThemeDirectory()

Copy a theme directory to create a new custom theme

copyThemeDirectory( $source,  $target, mixed $newname) : bool|string
Parameters
$source :

source directory

$target :

target directory

$newname : mixed
Tags
author

Ozh

since
1.3
Return values
bool|string

either true or an error message

deleteThemeDirectory()

Deletes a theme

deleteThemeDirectory(string $source) : bool
Parameters
$source : string

Full serverpath of the theme

Return values
bool

currentRelativeURL()

Return URL of current admin page

currentRelativeURL() : string
Tags
author

Ozh

since
1.3
Return values
string

current URL

getParentAlbumsAdmin()

Returns an array of the names of the parents of the current album.

getParentAlbumsAdmin(object $album) : array<string|int, mixed>
Parameters
$album : object

optional album object to use inseted of the current album

Return values
array<string|int, mixed>

getAlbumBreadcrumbAdmin()

getAlbumBreadcrumbAdmin(mixed $album) : mixed
Parameters
$album : mixed

removeParentAlbumNames()

Removes the parent album name so that we can print a album breadcrumb with them

removeParentAlbumNames(object $album) : string
Parameters
$album : object

Object of the album

Return values
string

printAdminRightsTable()

Outputs the rights checkbox table for admin

printAdminRightsTable( $id, string $background, string $alterrights, bit $rights) : mixed
Parameters
$id :

int record id for the save

$background : string

background color

$alterrights : string

are the items changable

$rights : bit

rights of the admin

printManagedObjects()

Creates the managed album table for Admin

printManagedObjects(string $type, array<string|int, mixed> $objlist, string $alterrights, object $userobj, mixed $prefix_id, string $kind, mixed $flag) : mixed
Parameters
$type : string

the kind of list

$objlist : array<string|int, mixed>

list of objects

$alterrights : string

are the items changable

$userobj : object

the user

$prefix_id : mixed
$kind : string

user, group, or template

$flag : mixed

processRights()

processes the post of administrator rights

processRights(int $i) : bit
Parameters
$i : int

the admin row number

Return values
bit

processManagedObjects()

processManagedObjects(mixed $i, mixed &$rights) : mixed
Parameters
$i : mixed
$rights : mixed

getCheckboxState()

Returns the value of a checkbox form item

getCheckboxState(string $id) : int
Parameters
$id : string

the $_REQUEST index

Return values
int

(0 or 1)

standardScripts()

Returns an array of "standard" theme scripts. This list is normally used to exclude these scripts form various option seletors.

standardScripts() : array<string|int, mixed>
Return values
array<string|int, mixed>

getWatermarks()

Returns a merged list of available watermarks

getWatermarks() : array<string|int, mixed>
Return values
array<string|int, mixed>

processOrder()

Processes the serialized array from tree sort.

processOrder( $orderstr) : array<string|int, mixed>

Returns an array in the form [$id=>array(sort orders), $id=>array(sort orders),...]

Parameters
$orderstr :

the serialzied tree sort order

Return values
array<string|int, mixed>

postAlbumSort()

POST handler for album tree sorts

postAlbumSort(int $parentid) : mixed
Parameters
$parentid : int

id of owning album

printNestedAlbumsList()

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

printNestedAlbumsList(mixed $albums, bool $show_thumb, object $owner) : bool
Parameters
$albums : mixed
$show_thumb : bool

set false to use thumb standin image.

$owner : object

the album object of the owner or NULL for the gallery

Return values
bool

printEditDropdown()

Prints the dropdown menu for the nesting level depth for the album sorting

printEditDropdown(mixed $subtab, mixed $nestinglevels, mixed $nesting) : mixed
Parameters
$subtab : mixed
$nestinglevels : mixed
$nesting : mixed

processEditSelection()

processEditSelection(mixed $subtab) : mixed
Parameters
$subtab : mixed

printBulkActions()

Edit tab bulk actions drop-down

printBulkActions(array<string|int, mixed> $checkarray[, bool $checkAll = false ]) : mixed
Parameters
$checkarray : array<string|int, mixed>

the list of actions

$checkAll : bool = false

set true to include check all box

bulkActionRedirect()

common redirector for bulk action handling return

bulkActionRedirect(string $action) : mixed
Parameters
$action : string

bulkTags()

Process the bulk tags

bulkTags() : array<string|int, mixed>
Return values
array<string|int, mixed>

processAlbumBulkActions()

Processes the check box bulk actions for albums

processAlbumBulkActions() : mixed

processImageBulkActions()

Handles Image bulk actions

processImageBulkActions( $album) : mixed
Parameters
$album :

processCommentBulkActions()

Processes the check box bulk actions for comments

processCommentBulkActions() : mixed

codeblocktabsJS()

Codeblock tabs JavaScript code

codeblocktabsJS() : mixed

printCodeblockEdit()

prints codeblock edit boxes

printCodeblockEdit(object $obj, int $id) : mixed
Parameters
$obj : object
$id : int

processCodeblockSave()

handles saveing of codeblock edits

processCodeblockSave(int $id) : string
Parameters
$id : int
Return values
string

admin_securityChecks()

Standard admin pages checks

admin_securityChecks(bit $rights, mixed $return) : mixed
Parameters
$rights : bit
$return : mixed

minDiff()

getPageSelector "diff" function

minDiff(string $string1, string2 $string2) : mixed

returns the shortest string difference

Parameters
$string1 : string
$string2 : string2

fullText()

getPageSelector "diff" function

fullText(string $string1, string $string2) : string

Used when you want getPgeSelector to show the full text of the items

Parameters
$string1 : string
$string2 : string
Return values
string

dateDiff()

getPageSelector "diff" function

dateDiff(string $date1, string $date2) : string

returns the shortest "date" difference

Parameters
$date1 : string
$date2 : string
Return values
string

getPageSelector()

returns a selector list based on the "names" of the list items

getPageSelector(array<string|int, mixed> $list, int $itmes_per_page[, string $diff = 'fullText' ]) : array<string|int, mixed>
Parameters
$list : array<string|int, mixed>
$itmes_per_page : int
$diff : string = 'fullText'

"fullText" for the complete names "minDiff" for a truncated string showing just the unique characters of the names "dateDiff" it the "names" are really dates.

Return values
array<string|int, mixed>

printPageSelector()

printPageSelector(mixed $pagenumber, mixed $rangeset, mixed $script, mixed $queryParams) : mixed
Parameters
$pagenumber : mixed
$rangeset : mixed
$script : mixed
$queryParams : mixed

unQuote()

Strips off quotes from the strng

unQuote( $string) : mixed
Parameters
$string :

admin_album_list()

Returns an option list of administrators who can own albums or images

admin_album_list(string $owner) : string
Parameters
$owner : string
Return values
string

getLogTabs()

Returns an array with the logtabs array, the default log tab and an array of log files to the default (current) log tab (for use in the logfile selector)

getLogTabs() : array<string|int, mixed>
Tags
since
1.6.1
  • Reworked for displaying only tabs for log types
Return values
array<string|int, mixed>

getDefaultLogTabs()

Gets an array log tab names and localized (gettexted) log titles

getDefaultLogTabs() : array<string|int, mixed>
Tags
since
1.6.1
Return values
array<string|int, mixed>

getLogFiles()

Gets a nested array with the log type (tab name) and corresponding log files

getLogFiles() : array<string|int, mixed>
Tags
since
1.6.1
Return values
array<string|int, mixed>

printLogSelector()

Prints the selector for logfiles of the current log tab

printLogSelector([string $currentlogtab = '' ][, string $currentlogfile = '' ][, array<string|int, mixed> $logfiles = array() ]) : mixed
Parameters
$currentlogtab : string = ''

Current log tab

$currentlogfile : string = ''

Current log file selected

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

Array of logfiles

Tags
since
1.6.1

getPluginTabs()

Figures out which plugin tabs to display

getPluginTabs() : mixed

getAdminThumbSizes()

Gets an array with the size values for the admin thumb generation

getAdminThumbSizes(obj $imageobj[, string $size = 'small' ]) : array<string|int, mixed>
Parameters
$imageobj : obj

The image object

$size : string = 'small'

Adminthumb sizeame: 'large', 'small', 'large-uncropped', 'small-uncropped'

Tags
since
1.6.3
Return values
array<string|int, mixed>

getAdminThumb()

Gets the URL of the adminthumb

getAdminThumb(obj $imageobj[, string $size = 'small' ]) : string
Parameters
$imageobj : obj

The image object

$size : string = 'small'

Adminthumb sizeame: 'large', 'small', 'large-uncropped', 'small-uncropped'

Return values
string

getSizeAdminThumb()

Returns an array with width and height of the resized image

getSizeAdminThumb(obj $imageobj[, string $size = 'small' ]) : array<string|int, mixed>
Parameters
$imageobj : obj

The image object

$size : string = 'small'

Adminthumb sizeame: 'large', 'small', 'large-uncropped', 'small-uncropped'

Tags
since
1.6.3
Return values
array<string|int, mixed>

getAdminThumbHTML()

Returns the full HTML element of an admin thumb Applies the filters 'adminthumb_html'

getAdminThumbHTML(obj $imageobj[, string $size = 'small' ][, string $class = null ][, string $id = null ][, string $alt = null ][, string $title = null ]) : string
Parameters
$imageobj : obj

The image object

$size : string = 'small'

Adminthumb sizeame: 'large', 'small', 'large-uncropped', 'small-uncropped'

$class : string = null

Class name(s) to attach

$id : string = null

ID to attach

$alt : string = null

Alt attribute

$title : string = null

Title attribute

Tags
since
1.5.8
Return values
string

printAdminThumb()

Prints an admin thumb

printAdminThumb(obj $imageobj[, string $size = 'small' ][, string $class = null ][, string $id = null ][, string $alt = null ][, string $title = null ]) : string
Parameters
$imageobj : obj

The image object

$size : string = 'small'

Adminthumb sizeame: 'large', 'small', 'large-uncropped', 'small-uncropped'

$class : string = null

Class name(s) to attach

$id : string = null

ID to attach

$alt : string = null

Alt attribute

$title : string = null

Title attribute

Tags
since
1.5.8
Return values
string

processCredentials()

handles save of user/password

processCredentials(object $object[, mixed $suffix = '' ]) : mixed
Parameters
$object : object
$suffix : mixed = ''

consolidatedEditMessages()

consolidatedEditMessages(mixed $subtab) : mixed
Parameters
$subtab : mixed

getThemeFiles()

returns an array of the theme scripts not in the exclude array

getThemeFiles(array<string|int, mixed> $exclude) : array<string|int, mixed>
Parameters
$exclude : array<string|int, mixed>

those scripts to ignore

Return values
array<string|int, mixed>

checkAlbumParentid()

Checks for bad parentIDs from old move/copy bug

checkAlbumParentid(unknown_type $albumname, unknown_type $id, mixed $recorder) : mixed
Parameters
$albumname : unknown_type
$id : unknown_type
$recorder : mixed

checkAlbumimagesort()

Make sure the albumimagesort is only an allowed value. Otherwise returns nothing.

checkAlbumimagesort(string $val[, string $type = 'albumimagesort' ]) : string
Parameters
$val : string
$type : string = 'albumimagesort'

'albumimagesort' or 'albumimagesort_status'

Return values
string

printLastChangeInfo()

Prints the last change date and last change user notice on backend edit pages Also for albums it prints the updateddate

printLastChangeInfo(obj $obj) : mixed
Parameters
$obj : obj

Object of any item type

Tags
since
1.5.2

getSortByOptions()

Returns the option array for the sort by selectors for gallery, albums and images

getSortByOptions(string $type) : array<string|int, mixed>
Parameters
$type : string

"albums" (also for gallery), "albums-dynamic", 'images' "image-edit" (the images edit tab backend only ordering) "pages" and "news" for Zenpage items

Tags
since
1.5.5

Replaces the global $_zp_sortby

Return values
array<string|int, mixed>

getSortByStatusOptions()

Returns an array of the status order options for all items

getSortByStatusOptions() : array<string|int, mixed>
Tags
since
1.5.5

Replaces the global $_zp_sortby_status

Return values
array<string|int, mixed>

checkSchedulePublishingNotes()

Helper to check if notes are to be printed (only needed because of the inconvenient legacy table based layout on image edit pages)

checkSchedulePublishingNotes(obj $obj) : bool
Parameters
$obj : obj

Image, album, news article or page object

Tags
since
1.5.7
Return values
bool

printScheduledPublishingNotes()

Prints various notes regarding the scheduled publishing status for single edit pages

printScheduledPublishingNotes(obj $obj) : mixed
Parameters
$obj : obj

Image, album, news article or page object

Tags
since
1.5.7
deprecated
2.0
  • Use printStatusNotes() instead

printStatusNotes()

Prints various notes regarding the scheduled publishing status for single edit pages

printStatusNotes(obj $obj) : mixed
Parameters
$obj : obj

Image, album, news article, new category or page object

Tags
since
1.6.1

Replaces printScheduledPublishingNotes()

getStatusNote()

Gets a specific predefined status note for an object (if available) Note: The notes are not status dependend!

getStatusNote([string $name = '' ]) : string
Parameters
$name : string = ''

Name of the note

Return values
string

getStatusNotes()

Gets an array of all predefined status notes

getStatusNotes() : array<string|int, mixed>
Tags
since
1.6.1
Return values
array<string|int, mixed>

getStatusNotesByContext()

Gets an array with all status notes that apply to $obj currently

getStatusNotesByContext(string $obj) : array<string|int, mixed>
Parameters
$obj : string
Tags
since
1.6.1
Return values
array<string|int, mixed>

getStatusIcons()

Gets an key => value array of all available object status icons as full <img> elements

getStatusIcons() : array<string|int, mixed>
Tags
since
1.6.1
Return values
array<string|int, mixed>

getStatusIcon()

Gets the icon img element for a specific status icon

getStatusIcon([string $name = '' ]) : string
Parameters
$name : string = ''

(Internal) Name of the icon

Tags
since
1.6.1
Return values
string

printPublishIconLinkGallery()

Prints the publish icon link to change the status on the album and thumb image list

printPublishIconLinkGallery(object $obj[, bool $enableedit = false ][, string $owner = null ]) : mixed
Parameters
$obj : object

Image or album object

$enableedit : bool = false

true if allowed to use

$owner : string = null

User name of the owner

Tags
since
1.5.7

getPublishIcon()

Returns the publish icon for the current status

getPublishIcon(obj $obj) : string
Parameters
$obj : obj

Object of the page or news article to check

Tags
since
1.6.1
Return values
string

printPublished()

Prints the scheduled publishing date for items if set. Also prints the date for Zenpage news articles and pages

printPublished(string $obj) : string
Parameters
$obj : string

image, albun, news article or page object

Tags
since
1.5.7

moved from Zenpage plugin to generel admin functions

Return values
string

printExpired()

Prints the expiration or expired date for items

printExpired(string $obj) : string
Parameters
$obj : string

image, albun, news article or page object

Tags
since
1.5.7

moved from Zenpage plugin to generel admin functions

Return values
string

printProtectedIcon()

Prints the protected icon if the object is password protected on an edit list

printProtectedIcon(obj $obj) : mixed
Parameters
$obj : obj
Tags
since
1.6.1

isIncompatibleExtension()

Checks plugin and theme definition for $plugin_disable / $theme_description['disable'] so plugins/themes are deaktivated respectively cannot be activated if they don't match conditions/requirements. See the plugin/theme documentation for info how to define these.

isIncompatibleExtension(string|array<string|int, mixed> $disable) : bool|string

Returns either the message why incompatible or false if not.

Parameters
$disable : string|array<string|int, mixed>

One string or serveral as an array. Not false means incompatible

Tags
since
1.5.8
Return values
bool|string

processExtensionVariable()

Processes a plugin or theme definition variable.

processExtensionVariable(string|array<string|int, mixed> $var) : string|bool

If a string or boolean it is returned as it is. If it is an array each entry is enclosed with an HTML paragraph and returned as a string

Parameters
$var : string|array<string|int, mixed>

A plugin or theme definition variable

Tags
since
1.5.8
Return values
string|bool

printSelectorWithCustomField()

Prints a selector (select list) with a custom text field from the values parameter. The following array entries will be created automatically:

printSelectorWithCustomField(string $optionname[, array<string|int, mixed> $list = array() ][, string $optionlabel = null ][, string $optionname_customfield = null ][, string $optionlabel_customfield = nulll ][, bool $is_galleryoption = false ]) : mixed
  • gettext('Custom') = 'custom'

If "custom" is selected the custom text field will be shown.

Parameters
$optionname : string

The option name of the select list

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

Key value array where key is the display value (gettext generally)

$optionlabel : string = null

The label text for the select list

$optionname_customfield : string = null

The option name of the custom field

$optionlabel_customfield : string = nulll

THe label text for the custom field

$is_galleryoption : bool = false

Set to true if this is a special gallery class option

Tags
since
1.5.8
global

obj $_zp_gallery Gallery object

getZenpagePagesOptionsArray()

Gets an array of Zenpage pages ready for using with selector, radioboxes and checkbox lists

getZenpagePagesOptionsArray([bool $published = false ]) : mixed
Parameters
$published : bool = false

true for only published, default false for all.

Tags
since
1.5.8

printZenpagePageSelector()

Prints an select list option for Zenpage pages

printZenpagePageSelector(string $optionname[, string $optionname_custom = null ][, bool $published = false ][, bool $is_galleryoption = false ]) : mixed

it additionally prints a text field for a custom page URL.

Parameters
$optionname : string

Name of the option, sued for the selector and the current selection

$optionname_custom : string = null

If defined this will be used for the custom url option, if null (default) the option name will be used with "_custom" appended

$published : bool = false

If the pages should include only published ones

$is_galleryoption : bool = false

Set to true if this is a special gallery class option

Tags
since
1.5.8

getAdminstratorsOptionsArray()

Gets an array of administrators ready for using with selector, radioboxes and checkbox lists

getAdminstratorsOptionsArray([string $type = 'users' ]) : type
Parameters
$type : string = 'users'

'users', 'groups', 'allusers'

Tags
since
1.5.8
global

object $_zp_authority

Return values
type

printUserSelector()

Prints an select list option for users

printUserSelector(string $optionname, string $optionname_custom[, bool $type = 'users' ][, bool $is_galleryoption = false ]) : mixed

it additionally prints a text field for a custom name

Parameters
$optionname : string

Name of the option, sued for the selector and the current selection

$optionname_custom : string

If defined this will be used for the custom url option, if null (default) the option name will be used with "_custom" appended

$type : bool = 'users'

'users', 'groups', 'allusers'

$is_galleryoption : bool = false

Set to true if this is a special gallery class option

Tags
since
1.5.8

isTextFile()

Helper for the theme editor

isTextFile(type $file) : type
Parameters
$file : type
Return values
type

getSubalbumImages()

Updates the $_zp_admin_imagelist global used on dynamic album editing

getSubalbumImages(type $folder) : type
Parameters
$folder : type
Tags
global

string $_zp_admin_imagelist

global

obj $_zp_gallery

Return values
type

markUpdated()

Updates $_zp_admin_user_updated on user editing

markUpdated() : mixed
Tags
global

boolean $_zp_admin_user_updated

printImageRotationSelector()

Prints the image EXIF rotation/flipping selector

printImageRotationSelector(obj $imageobj, int $currentimage) : mixed
Parameters
$imageobj : obj

Object of the current image

$currentimage : int

ID of the current image

Tags
since
1.6.1

printDatetimeFormatSelector()

Prints option selectors for date and time formats

printDatetimeFormatSelector() : mixed
Tags
since
1.6.1

getDatetimeFormatlistForSelector()

Helper functions for printDatetimeFormatSelector() ot create the format lists for the selector, not intended to be used standalone

getDatetimeFormatlistForSelector([array<string|int, mixed> $formats = array() ][, bool $use_localized_date = false ]) : array<string|int, mixed>
Parameters
$formats : array<string|int, mixed> = array()

Array as created by array_keys(getStandardDateFormats($type);

$use_localized_date : bool = false

Default false, set to true to use localized datees

Tags
since
1.6.1
Return values
array<string|int, mixed>

        
On this page

Search results