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

Procedural File: admin-functions.php

Source Location: /admin-functions.php

Page Details

support functions for Admin

Includes
require_once (dirname(__FILE__).'/functions.php') [line 9]
[ Top ]


Constants
CUSTOM_OPTION_PREFIX  [line 484]

CUSTOM_OPTION_PREFIX = '_ZP_CUSTOM_'

[ Top ]

OPTION_TYPE_CHECKBOX  [line 514]

OPTION_TYPE_CHECKBOX = 1

[ Top ]

OPTION_TYPE_CHECKBOX_ARRAY  [line 519]

OPTION_TYPE_CHECKBOX_ARRAY = 6

[ Top ]

OPTION_TYPE_CHECKBOX_UL  [line 520]

OPTION_TYPE_CHECKBOX_UL = 7

[ Top ]

OPTION_TYPE_CLEARTEXT  [line 522]

OPTION_TYPE_CLEARTEXT = 9

[ Top ]

OPTION_TYPE_COLOR_PICKER  [line 521]

OPTION_TYPE_COLOR_PICKER = 8

[ Top ]

OPTION_TYPE_CUSTOM  [line 515]

OPTION_TYPE_CUSTOM = 2

[ Top ]

OPTION_TYPE_NOTE  [line 523]

OPTION_TYPE_NOTE = 10

[ Top ]

OPTION_TYPE_RADIO  [line 517]

OPTION_TYPE_RADIO = 4

[ Top ]

OPTION_TYPE_SELECTOR  [line 518]

OPTION_TYPE_SELECTOR = 5

[ Top ]

OPTION_TYPE_TEXTAREA  [line 516]

OPTION_TYPE_TEXTAREA = 3

[ Top ]

OPTION_TYPE_TEXTBOX  [line 513]

OPTION_TYPE_TEXTBOX = 0

Generates the HTML for custom options (e.g. theme options, plugin options, etc.)


[ Top ]

TEXTAREA_COLUMNS  [line 11]

TEXTAREA_COLUMNS = 50

[ Top ]

TEXTAREA_COLUMNS_SHORT  [line 13]

TEXTAREA_COLUMNS_SHORT = 32

[ Top ]

TEXT_INPUT_SIZE  [line 12]

TEXT_INPUT_SIZE = 48

[ Top ]

TEXT_INPUT_SIZE_SHORT  [line 14]

TEXT_INPUT_SIZE_SHORT = 30

[ Top ]


Functions
adminPageNav  [line 2334]
Parameters:
   $pagenum: 
   $totalpages: 
   $adminpage: 
   $parms: 
   $tab: 


void adminPageNav( $pagenum, $totalpages, $adminpage, $parms, [ $tab = '']  )

[ Top ]
adminPrintImageThumb  [line 205]

Print the thumbnail for a particular Image.

Parameters:
$bg   3: 
$image   $image:  object The Image object whose thumbnail we want to display.
$class   $class:  string Optional class attribute for the hyperlink. Default is NULL.
$id   $id:  string Optional id attribute for the hyperlink. Default is NULL.

Information Tags:
Author:  Todd Papaioannou (lucky@luckyspin.org)
Since:  1.0.0

void adminPrintImageThumb( $image $image, [$class $class = NULL], [$id $id = NULL], $bg 3  )

[ Top ]
admin_album_list  [line 3979]

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

Parameters:
string   $owner: 


string admin_album_list( string $owner  )

[ Top ]
admin_securityChecks  [line 3858]

Standard admin pages checks

Parameters:
bit   $rights: 
string   $return--where:  to go after login
   $return: 


void admin_securityChecks( bit $rights, $return, string $return--where  )

[ Top ]
checked  [line 431]
Parameters:
   $checked: 
   $current: 


void checked( $checked, $current  )

[ Top ]
checkForUpdate  [line 2295]

Searches the zenphoto.org home page for the current zenphoto download locates the version number of the download and compares it to the version we are running.

API Tags:
Return:  If there is a more current version on the WEB, returns its version number otherwise returns FALSE

Information Tags:
Since:  1.1.3

string checkForUpdate( )

[ Top ]
codeblocktabsJS  [line 3832]

Codeblock tabs JavaScript code


void codeblocktabsJS( )

[ Top ]
commentReply  [line 2568]

Takes a comment and makes the body of an email.

Parameters:
string   $str:  comment
string   $name:  author
string   $albumtitle:  album
string   $imagetitle:  image


string commentReply( string $str, string $name, string $albumtitle, string $imagetitle  )

[ Top ]
copyThemeDirectory  [line 2661]

Copy a theme directory to create a new custom theme

Parameters:
$source   $source:  source directory
$target   $target:  target directory
   $newname: 

API Tags:
Return:  either true or an error message

Information Tags:
Author:  Ozh
Since:  1.3

bool|string copyThemeDirectory( $source $source, $target $target, $newname  )

[ Top ]
currentRelativeURL  [line 2829]

Return URL of current admin page

Parameters:
string   $source:  the script file incase REQUEST_URI is not available

API Tags:
Return:  current URL

Information Tags:
Author:  Ozh
Since:  1.3

string currentRelativeURL( string $source  )

[ Top ]
customOptions  [line 525]
Parameters:
   $optionHandler: 
   $indent: 
   $album: 
   $showhide: 
   $supportedOptions: 
   $theme: 
   $initial: 


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

[ Top ]
datepickerJS  [line 43]

void datepickerJS( )

[ Top ]
deleteThemeDirectory  [line 2796]
Parameters:
   $source: 


void deleteThemeDirectory( $source  )

[ Top ]
displayDeleted  [line 461]

void displayDeleted( )

[ Top ]
genAlbumUploadList  [line 436]
Parameters:
   &$list: 
   $curAlbum: 


void genAlbumUploadList( &$list, [ $curAlbum = NULL]  )

[ Top ]
generateRadiobuttonsFromArray  [line 854]

Prints radio buttons from an array

Parameters:
string   $currentvalue:  The current selected value
string   $list:  the array of the list items form is localtext => buttonvalue
string   $option:  the name of the option for the input field name
bool   $behind:  set true to have the "text" before the button
   $class: 


void generateRadiobuttonsFromArray( string $currentvalue, string $list, string $option, [bool $behind = false], [ $class = 'checkboxlabel']  )

[ Top ]
generateUnorderedListFromArray  [line 881]

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

Parameters:
array   $currentValue:  list of items to be flagged as checked
array   $list:  the elements of the select list
string   $prefix:  prefix of the input item
string   $alterrights:  are the items changable.
bool   $sort:  true for sorted list
string   $class:  optional class for items
bool   $localize:  true if the list local key is text for the item
   $extra: 


void generateUnorderedListFromArray( array $currentValue, array $list, string $prefix, string $alterrights, bool $sort, bool $localize, [string $class = NULL], [ $extra = NULL]  )

[ Top ]
getAlbumBreadcrumbAdmin  [line 2856]
Parameters:
   $album: 


void getAlbumBreadcrumbAdmin( $album  )

[ Top ]
getCheckboxState  [line 3174]

Returns the value of a checkbox form item

Parameters:
string   $id:  the $_REQUEST index

API Tags:
Return:  (0 or 1)


int getCheckboxState( string $id  )

[ Top ]
getLocaleForTinyMCEandAFM  [line 3820]

Extracs the first two characters from the Zenphoto locale names like 'de_DE' so that TinyMCE and the Ajax File Manager who use two character locales like 'de' can set their language packs


string getLocaleForTinyMCEandAFM( )

[ Top ]
getLogTabs  [line 3995]

void getLogTabs( )

[ Top ]
getMagickConstants  [line 3939]

Returns Magick (Gmagick/Imagick) constants that begin with $filter and removes the constant of the form $filter . 'UNDEFINED' if it exists.

The returned array will be an associative array in which the keys and values are identical strings sorted in alphabetical order.

Parameters:
string   $class:  The class to reflect
string   $filter:  The string to delimit constants


array getMagickConstants( string $class, string $filter  )

[ Top ]
getNestedAlbumList  [line 3314]

generates a nested list of albums for the album tab sorting

Returns an array of "albums" each element contains: 'name' which is the folder name 'album' which is an album object for the album 'sort_order' which is an array of the sort order set

Parameters:
$subalbum   $subalbum:  root level album (NULL is the gallery)
$levels   $levels:  how far to nest
$level   $level:  internal for keeping the sort order elements


array getNestedAlbumList( $subalbum $subalbum, $levels $levels, [$level $level = array()]  )

[ Top ]
getParentAlbumsAdmin  [line 2848]

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

Parameters:
object   $album:  optional album object to use inseted of the current album


array getParentAlbumsAdmin( object $album  )

[ Top ]
getTagOrder  [line 2494]

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


int getTagOrder( )

[ Top ]
getWatermarks  [line 3195]

Returns a merged list of available watermarks


array getWatermarks( )

[ Top ]
isolate  [line 2583]

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

Parameters:
string   $target:  the assignment variable to match on
string   $str:  the PHP script


string isolate( string $target, string $str  )

[ Top ]
isTextFile  [line 2632]

Check if a file is a text file

Parameters:
string   $file: 
array   $ok_extensions:  array of file extensions that are OK to edit (ie text files)

Information Tags:
Author:  Ozh
Since:  1.3

bool isTextFile( string $file, [array $ok_extensions = array('css','php','js','txt','inc')]  )

[ Top ]
is_zip  [line 2554]

Checks for a zip file

Parameters:
string   $filename:  name of the file


bool is_zip( string $filename  )

[ Top ]
listDirectoryFiles  [line 2601]

Return an array of files from a directory and sub directories

This is a non recursive function that digs through a directory. More info here:

Parameters:
string   $dir:  directory

Information Tags:
Author:  Ozh
Link:  http://planetozh.com/blog/2005/12/php-non-recursive-function-through-directories/
Since:  1.3

array listDirectoryFiles( string $dir  )

[ Top ]
minDiff  [line 3910]

returns the shortest version of string2 that is different from string1

Parameters:
string   $string1: 
string2   $string2: 


void minDiff( string $string1, string2 $string2  )

[ Top ]
postAlbumSort  [line 3253]

POST handler for album tree sorts

Parameters:
int   $parentid:  id of owning album


void postAlbumSort( int $parentid  )

[ Top ]
postIndexDecode  [line 841]

Decodes encoded $_POST index

Parameters:
string   $str: 


string postIndexDecode( string $str  )

[ Top ]
postIndexEncode  [line 831]

Encodes for use as a $_POST index

Parameters:
string   $str: 


void postIndexEncode( string $str  )

[ Top ]
printAdminFooter  [line 23]

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

Parameters:
string   $addl:  additional text to output on the footer.

Information Tags:
Author:  Todd Papaioannou (lucky@luckyspin.org)
Since:  1.0.0

void printAdminFooter( [string $addl = '']  )

[ Top ]
printAdminHeader  [line 72]

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.

Parameters:
string   $tab:  the album page
string   $subtab:  the sub-tab if any


void printAdminHeader( string $tab, [string $subtab = NULL]  )

[ Top ]
printAdminRightsTable  [line 2900]

Outputs the rights checkbox table for admin

Parameters:
string   $background:  background color
string   $alterrights:  are the items changable
bit   $rights:  rights of the admin
$id   $id:  int record id for the save


void printAdminRightsTable( $id $id, string $background, string $alterrights, bit $rights  )

[ Top ]
printAlbumBreadcrumbAdmin  [line 2870]

prints the album breadcrumb for the album edit page

Parameters:
object   $album:  Object of the album


void printAlbumBreadcrumbAdmin( object $album  )

[ Top ]
printAlbumButtons  [line 1815]

puts out the maintenance buttons for an album

Parameters:
object   $album:  is the album being emitted


void printAlbumButtons( object $album  )

[ Top ]
printAlbumEditForm  [line 1053]

emits the html for editing album information

called in edit album and mass edit

Parameters:
string   $index:  the index of the entry in mass edit or '0' if single album
object   $album:  the album object
bool   $collapse_tags:  set true to initially hide tab list

Information Tags:
Since:  1.1.3

void printAlbumEditForm( string $index, object $album, bool $collapse_tags  )

[ Top ]
printAlbumEditRow  [line 1893]

puts out a row in the edit album table

Parameters:
object   $album:  is the album being emitted
bool   $show_thumb:  set to false to show thumb standin image rather than album thumb


void printAlbumEditRow( object $album, bool $show_thumb  )

[ Top ]
printAlbumLedgend  [line 1860]

void printAlbumLedgend( )

[ Top ]
printBulkActions  [line 3501]

Edit tab bulk actions drop-down

Parameters:
array   $checkarray:  the list of actions
bool   $checkAll:  set true to include check all box


void printBulkActions( array $checkarray, [bool $checkAll = false]  )

[ Top ]
printEditDropdown  [line 3407]

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

Parameters:
   $subtab: 
   $nestinglevels: 


void printEditDropdown( $subtab, [ $nestinglevels = array('1','2','3','4','5')]  )

[ Top ]
printLogoAndLinks  [line 219]

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

Information Tags:
Author:  Todd Papaioannou (lucky@luckyspin.org)
Since:  1.0.0

void printLogoAndLinks( )

[ Top ]
printManagedObjects  [line 2952]

Creates the managed album table for Admin

Parameters:
string   $type:  the kind of list
array   $objlist:  list of objects
string   $alterrights:  are the items changable
int   $adminid:  ID of the admin
int   $prefix:  the admin row
bit   $rights:  the privileges of the user
   $kind: 
   $flag: 


void printManagedObjects( string $type, array $objlist, string $alterrights, int $adminid, int $prefix, bit $rights, $kind, $flag  )

[ Top ]
printNestedAlbumsList  [line 3346]

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

Parameters:
array   $pages:  The array containing all pages
bool   $show_thumb:  set false to use thumb standin image.
   $albums: 


bool printNestedAlbumsList( $albums, bool $show_thumb, array $pages  )

[ Top ]
printSortableHead  [line 159]

void printSortableHead( )

[ Top ]
printSubtabs  [line 320]

void printSubtabs( )

[ Top ]
printTabs  [line 265]

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

Information Tags:
Author:  Todd Papaioannou (lucky@luckyspin.org)
Since:  1.0.0

void printTabs( )

[ Top ]
print_language_string_list  [line 2380]

Generates an editable list of language strings

Parameters:
string   $dbstring:  either a serialized languag string array or a single string
string   $name:  the prefix for the label, id, and name tags
bool   $textbox:  set to true for a textbox rather than a text field
string   $locale:  optional locale of the translation desired
string   $edit:  optional class
int   $wide:  column size. true or false for the standard or short sizes. Or pass a column size
string   $ulclass:  set to the class for the UL element
int   $rows:  set to the number of rows to show.


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

[ Top ]
processAlbumBulkActions  [line 3619]

Processes the check box bulk actions for albums


void processAlbumBulkActions( )

[ Top ]
processAlbumEdit  [line 2107]

processes the post from the above

Parameters:
int   $index:  the index of the entry in mass edit or 0 if single album
object   $album:  the album object
string   $redirectto:  used to redirect page refresh on move/copy/rename
   &$redirectto: 

API Tags:
Return:  error flag if passwords don't match

Information Tags:
Since:  1.1.3

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

[ Top ]
processCommentBulkActions  [line 3780]

Processes the check box bulk actions for comments


void processCommentBulkActions( )

[ Top ]
processCustomOptionSave  [line 785]
Parameters:
   $returntab: 
   $themename: 
   $themealbum: 


void processCustomOptionSave( $returntab, [ $themename = NULL], [ $themealbum = NULL]  )

[ Top ]
processEditSelection  [line 3463]
Parameters:
   $subtab: 


void processEditSelection( $subtab  )

[ Top ]
processImageBulkActions  [line 3700]

Handles Image bulk actions

Parameters:
$album   $album: 


void processImageBulkActions( $album $album  )

[ Top ]
processManagedObjects  [line 3082]
Parameters:
   $i: 
   &$rights: 


void processManagedObjects( $i, &$rights  )

[ Top ]
processOrder  [line 3223]

Processes the serialized array from tree sort.

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

Parameters:
$orderstr   $orderstr:  the serialzied tree sort order


array processOrder( $orderstr $orderstr  )

[ Top ]
processRights  [line 3058]

processes the post of administrator rights

Parameters:
int   $i:  the admin row number


bit processRights( int $i  )

[ Top ]
process_language_string_save  [line 2462]

process the post of a language string form

Parameters:
string   $name:  the prefix for the label, id, and name tags
bool   $cleanup:  set to true to clean up after the TinyMCE editor
$sanitize_level   $sanitize_level:  the type of sanitization required


string process_language_string_save( string $name, [$sanitize_level $sanitize_level = 3], bool $cleanup  )

[ Top ]
removeParentAlbumNames  [line 2880]

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

Parameters:
object   $album:  Object of the album


string removeParentAlbumNames( object $album  )

[ Top ]
setAlbumSubtabs  [line 391]
Parameters:
   $album: 


void setAlbumSubtabs( $album  )

[ Top ]
standardScripts  [line 3184]

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


array standardScripts( )

[ Top ]
tagSelector  [line 950]

Creates an unordered checklist of the tags

Parameters:
object   $that:  Object for which to get the tags
string   $postit:  prefix to prepend for posting
bool   $showCounts:  set to true to get tag count displayed
   $mostused: 
   $addnew: 
   $resizeable: 


void tagSelector( object $that, string $postit, [bool $showCounts = false], [ $mostused = false], [ $addnew = true], [ $resizeable = false]  )

[ Top ]
themeIsEditable  [line 2646]

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

Parameters:
$theme   $theme:  theme to check
$themes   $themes:  array of installed themes (eg result of getThemes())

Information Tags:
Since:  1.3

bool themeIsEditable( $theme $theme, $themes $themes  )

[ Top ]
unQuote  [line 3965]

Strips off quotes from the strng

Parameters:
$string   $string: 


void unQuote( $string $string  )

[ Top ]
unzip  [line 2510]

Unzips an image archive

Parameters:
file   $file:  the archive
string   $dir:  where the images go


void unzip( file $file, string $dir  )

[ Top ]
XSRFdefender  [line 3886]

Checks for Cross Site Request Forgeries

Parameters:
string   $action: 


void XSRFdefender( string $action  )

[ Top ]


Documentation generated on Tue, 20 Dec 2011 16:06:30 +0100 by phpDocumentor 1.4.3