Overview

Classes

  • _zp_captcha
  • _zp_HTML_cache
  • admin_approval
  • Album
  • AlbumBase
  • AlbumZip
  • AMFReader
  • AMFStream
  • AnyFile
  • AnyFile_Options
  • auto_backup
  • AVCSequenceParameterSetReader
  • bxslider
  • cacheManager
  • cachemanager_internal_deprecations
  • cacheManagerFeed
  • CI_jsmin
  • CI_load
  • cloneZenphoto
  • codeIgniter_kludge
  • colorbox
  • Combi
  • Comment
  • comment_form
  • contactformOptions
  • cookieConsent
  • crop_image
  • cycle
  • defaultCodeblocks
  • deprecated_functions
  • DownloadList
  • dynamic_locale
  • dynamicAlbum
  • elFinder
  • elFinder_options
  • elFinderConnector
  • elFinderEditor
  • elFinderEditorOnlineConvert
  • elFinderEditorZipArchive
  • elFinderEditorZohoOffice
  • elFinderLibGdBmp
  • elFinderPlugin
  • elFinderPluginAutoResize
  • elFinderPluginAutoRotate
  • elFinderPluginNormalizer
  • elFinderPluginSanitizer
  • elFinderPluginWatermark
  • elFinderSession
  • elFinderVolumeBox
  • elFinderVolumeDriver
  • elFinderVolumeDropbox
  • elFinderVolumeDropbox2
  • elFinderVolumeFlysystemGoogleDriveCache
  • elFinderVolumeFlysystemGoogleDriveNetmount
  • elFinderVolumeFTP
  • elFinderVolumeGoogleDrive
  • elFinderVolumeGroup
  • elFinderVolumeLocalFileSystem
  • elFinderVolumeMySQL
  • elFinderVolumeOneDrive
  • elFinderVolumeTrash
  • elFinderVolumeTrashMySQL
  • email_new_user
  • exampleMacros
  • external_auth
  • favorites
  • favoritesOptions
  • feed
  • fieldExtender
  • flag_thumbnail
  • Gallery
  • galleryArticles
  • getID3
  • getid3_aac
  • getid3_apetag
  • getid3_flv
  • getid3_handler
  • getid3_id3v1
  • getid3_id3v2
  • getid3_lib
  • getid3_lyrics3
  • getid3_mp3
  • getid3_mpeg
  • getid3_quicktime
  • getid3_swf
  • GoogleMap
  • Googlemaps
  • hitcounter
  • htmlmetatags
  • Image
  • internal_deprecations
  • ipBlocker
  • jPlayer
  • jplayer_options
  • jquery_rating
  • JSMin
  • lazyload
  • lib_GD_Options
  • lib_Imagick_Options
  • lib_NoGraphics
  • matomoStats
  • MediaObject
  • menu_manager
  • MergedRSS
  • MergedRSSOptions
  • mobile
  • Mobile_Detect
  • mobileTheme
  • multipleLayoutOptions
  • null_seo
  • OAuthConsumer
  • OAuthDataStore
  • OAuthRequest
  • OAuthServer
  • OAuthSignatureMethod
  • OAuthSignatureMethod_HMAC_SHA1
  • OAuthSignatureMethod_PLAINTEXT
  • OAuthSignatureMethod_RSA_SHA1
  • OAuthToken
  • OAuthUtil
  • openStreetMap
  • openStreetMapOptions
  • pagedThumbsNav
  • pagedthumbsOptions
  • PersistentObject
  • PHPMailer\PHPMailer\PHPMailer
  • PHPMailer\PHPMailer\POP3
  • PHPMailer\PHPMailer\SMTP
  • print_album_menu
  • pseudoPlayer
  • publishContent
  • quota_manager
  • reCaptcha
  • RecursiveCallbackFilterIterator
  • redirector
  • redirectorOptions
  • register_user
  • rewriteRules
  • rewriteTokens
  • RSS
  • rss_options
  • scriptlessSocialsharing
  • scriptlessSocialsharingOptions
  • search_statistics
  • SearchEngine
  • security_logger
  • securityHeaders
  • securityheadersOptions
  • seo_locale
  • Services_JSON
  • Services_JSON_Error
  • setup
  • setupMutex
  • setupRSS
  • show_not_loggedin
  • sitemap
  • sitemapOptions
  • static_html_cache
  • staticHTMLCacheOptions
  • tagsuggest
  • TextObject
  • TextObject_Options
  • ThemeObject
  • themeSwitcher
  • tinymce4Options
  • tinyURL
  • Transientimage
  • UploadHandler
  • user_expiry
  • user_groups
  • user_logout_options
  • userAddressFields
  • userDataExport
  • utf8
  • Video
  • VideoObject_Options
  • WEBdocs
  • WEBdocs_Options
  • xmpMetadata
  • Zenpage
  • Zenpage_internal_deprecations
  • ZenpageCategory
  • zenpagecms
  • ZenpageItems
  • ZenpageNews
  • ZenpagePage
  • ZenpageRoot
  • Zenphoto_Administrator
  • Zenphoto_Authority
  • zenphoto_org_news
  • zenphoto_seo
  • zenphotoDonate
  • ZipStream
  • zp_PHPMailer
  • zpFunctions
  • zpMutex
  • zpSimpleSpam
  • zpTrivialSpam

Interfaces

  • elFinderSessionInterface

Exceptions

  • elFinderAbortException
  • elFinderTriggerException
  • getid3_exception
  • JSMin_UnterminatedCommentException
  • JSMin_UnterminatedRegExpException
  • JSMin_UnterminatedStringException
  • OAuthExcept
  • PHPMailer\PHPMailer\Exception

Functions

  • access
  • accessAlbums
  • accessAllAlbums
  • accessImage
  • add_context
  • addalbumsToDatabase
  • addCategoriesToDatabase
  • addDateToTitlelink
  • addGeoCoord
  • addItem
  • addMissingDefaultRewriteTokens
  • addPagesToDatabase
  • addReconfigureNote
  • addSubalbumMenus
  • addWatermark
  • admin_album_list
  • admin_securityChecks
  • admin_showupdate
  • adminPageNav
  • adminToolbox
  • albumNumber
  • applyMacros
  • authorSelector
  • bind_textdomain_codeset
  • bindtextdomain
  • build_query
  • build_url
  • bulkActionRedirect
  • bulkTags
  • byteConvert
  • cacheImage
  • checkAccess
  • checkAlbumForImages
  • checkAlbumimagesort
  • checkAlbumParentid
  • checkAlbumPassword
  • checkChosenItemStatus
  • checkChosenMenuset
  • checked
  • checkFolder
  • checkForEmptyTitle
  • checkForGuest
  • checkForPage
  • checkForUpdate
  • checkHitcounterDisplay
  • checkIfChecked
  • checkIfLockedNews
  • checkIfLockedPage
  • checkIfNew
  • checkInstall
  • checkLayoutUseForImages
  • checkObjectsThumb
  • checkPageValidity
  • checkParentLayouts
  • checkPublishDates
  • checkRequiredField
  • checkSchedulePublishingNotes
  • checkSelectedAlbum
  • checkSignature
  • checkTitlelinkDuplicate
  • cleanAlbum
  • cleanHTML
  • clonedFrom
  • codeblocktabsJS
  • comment_form_addComment
  • comment_form_handle_comment
  • comment_form_PaginationJS
  • comment_form_postcomment
  • comment_form_print10Most
  • comment_form_visualEditor
  • commentFormUseCaptcha
  • commentReply
  • commentsAllowed
  • compressRow
  • consolidatedEditMessages
  • copyLayoutSelection
  • copyThemeDirectory
  • createMenuIfNotExists
  • createRelatedItemsResultArray
  • createTitlelink
  • cron_starter
  • curlRequest
  • currentRelativeURL
  • customOptions
  • dateDiff
  • datepickerJS
  • dateTimeConvert
  • db_affected_rows
  • db_close
  • db_collation
  • db_connect
  • db_count
  • db_create
  • db_create_table
  • db_error
  • db_fetch_assoc
  • db_fetch_row
  • db_free_result
  • db_getClientInfo
  • db_getServerInfo
  • db_getSQLmode
  • db_getVersion
  • db_insert_id
  • db_isMariaDB
  • db_LIKE_escape
  • db_list_fields
  • db_name
  • db_num_rows
  • db_permissions
  • db_quote
  • db_setSQLmode
  • db_show
  • db_software
  • db_table_update
  • db_truncate_table
  • debug404
  • debugLog
  • debugLogBacktrace
  • debuglogReconfigureNote
  • debugLogVar
  • decompressField
  • decompressRow
  • defaultCodeblocks_codebox
  • deleteArticle
  • deleteCategory
  • deleteItem
  • deleteLayoutSelection
  • deletePage
  • deleteThemeDirectory
  • dircopy
  • disableExtension
  • elFinder_admin_tabs
  • elFinder_tinymce
  • elFinderAutoloader
  • enableExtension
  • executeRSS
  • exitZP
  • exposeZenPhotoInformations
  • extendExecution
  • extensionEnabled
  • fetchComments
  • filesystemToInternal
  • fillbuffer
  • filterImageQuery
  • fix_path_redirect
  • formatList
  • fullText
  • galleryAlbumsPerPage
  • gallerystats_filesize_r
  • genAlbumList
  • generateAttributesFromArray
  • generateImageCacheFile
  • generateLanguageList
  • generateListFromArray
  • generateListFromFiles
  • generateRadiobuttonsFromArray
  • generateUnorderedListFromArray
  • get_AnyFile_suffixes
  • get_context
  • get_filterScript
  • get_instance
  • get_language_string
  • getAdminstratorsOptionsArray
  • getAdminThumb
  • getAdminThumbHTML
  • getAlbumArray
  • getAlbumBreadcrumb
  • getAlbumBreadcrumbAdmin
  • getAlbumCustomData
  • getAlbumData
  • getAlbumDate
  • getAlbumDesc
  • getAlbumFolder
  • getAlbumGeodata
  • getAlbumInherited
  • getAlbumLocation
  • getAlbumPage
  • getAlbumStatistic
  • getAlbumThumb
  • getAlbumTitle
  • getAlbumURL
  • getAllAccessibleAlbums
  • getAllAlbums
  • getAllDates
  • getAllowedTags
  • getAllSubAlbumIDs
  • getAllTagsCount
  • getAllTagsFromAlbum
  • getAllTagsFromAlbum_multi_unique
  • getAllTagsFromZenpage
  • getAllTagsUnique
  • getAllTranslations
  • getAnnotatedAlbumTitle
  • getAnnotatedImageTitle
  • getAnonymIP
  • getAuthor
  • getBare
  • getBareAlbumDesc
  • getBareAlbumTitle
  • getBareGalleryDesc
  • getBareGalleryTitle
  • getBareImageDesc
  • getBareImageTitle
  • getBareNewsTitle
  • getBarePageTitle
  • getCheckboxState
  • getCodeblock
  • getCommentAddress
  • getCommentAuthorEmail
  • getCommentAuthorLink
  • getCommentAuthorName
  • getCommentAuthorSite
  • getCommentBody
  • getCommentCount
  • getCommentDateTime
  • getCommentErrors
  • getCommentStored
  • getContactFormMacros
  • getContentShorten
  • getCookieInfoData
  • getCookieInfoHTML
  • getCookieInfoMacro
  • getCurrentMenuItem
  • getCurrentNewsArchive
  • getCurrentPage
  • getCurrentTheme
  • getCustomAlbumThumb
  • getCustomAlbumThumbMaxSpace
  • getCustomGalleryIndexPage
  • getCustomGalleryIndexURL
  • getCustomImageURL
  • getCustomPageURL
  • getCustomSizedImageMaxSpace
  • getCustomSizedImageThumbMaxSpace
  • getDataUsageNotice
  • getDefaultHeight
  • getDefaultRewriteTokens
  • getDefaultSizedImage
  • getDefaultWidth
  • getdownloadList
  • getDownloadURL
  • getE
  • getEnabledPlugins
  • getExpiryDatePost
  • getFavoritesURL
  • getField
  • getFullHeight
  • getFullImageFilesize
  • getFullImageURL
  • getFullWidth
  • getGalleryDesc
  • getGalleryIndexURL
  • getGalleryTitle
  • getGeoCoord
  • getHeadTitle
  • getHitcounter
  • getImageArgs
  • getImageCacheFilename
  • getImageCachePostfix
  • getImageCity
  • getImageCountry
  • getImageCustomData
  • getImageData
  • getImageDate
  • getImageDesc
  • getImageGeodata
  • getImageLocation
  • getImageMetaData
  • getImageParameters
  • getImageProcessorURI
  • getImageProcessorURIFromCacheName
  • getImageRotation
  • getImageState
  • getImageStatistic
  • getImageThumb
  • getImageTitle
  • getImageType
  • getImageURI
  • getImageURL
  • getItem
  • getItemByID
  • getItemTitleAndURL
  • getjPlayerSkinCSS
  • getjPlayerSkins
  • getLangAttributeLocale
  • getLanguageArray
  • getLanguageDisplayName
  • getLanguageFlag
  • getLanguageSubdomains
  • getLanguageText
  • getLatestComments
  • getLatestNews
  • getLatestZenpageComments
  • getLayout
  • getLayoutSelector
  • getLinkHTML
  • getLogTabs
  • getMacros
  • getMainSiteName
  • getMainSiteURL
  • getManagedAlbumList
  • getMaxSpaceContainer
  • getMenuFromLink
  • getMenuItemChilds
  • getMenuItems
  • getMenumanagerPredicessor
  • getMenumanagerSuccessor
  • getMenuSetSelector
  • getMenuVisibility
  • getMimeString
  • getNestedAlbumList
  • getNewsAdminOption
  • getNewsAdminOptionPath
  • getNewsArchivePath
  • getNewsArchiveURL
  • getNewsAuthor
  • getNewsCategories
  • getNewsCategoryCustomData
  • getNewsCategoryDesc
  • getNewsCategoryURL
  • getNewsContent
  • getNewsCustomData
  • getNewsDate
  • getNewsExtraContent
  • getNewsID
  • getNewsIndexURL
  • getNewsPagesStatistic
  • getNewsPathNav
  • getNewsReadMore
  • getNewsTitle
  • getNewsURL
  • getNextAlbum
  • getNextAlbumURL
  • getNextImageThumb
  • getNextImageURL
  • getNextNewsPageURL
  • getNextNewsURL
  • getNextPageURL
  • getNextPrevNews
  • getNotViewableAlbums
  • getNotViewableImages
  • getNumAlbums
  • getNumAllSubalbums
  • getNumImages
  • getNumNews
  • getNumPages
  • getOption
  • getOptionFromDB
  • getOptionList
  • getOwnerAuthor
  • getOwnerAuthorURL
  • getPageAuthor
  • getPageContent
  • getPageCustomData
  • getPageDate
  • getPageExtraContent
  • getPageID
  • getPageLastChangeDate
  • getPageNavList
  • getPageNumURL
  • getPageParentID
  • getPageRedirect
  • getPageSelector
  • getPageSortorder
  • getPageTitle
  • getPageTitleLink
  • getPageURL
  • getParentAlbums
  • getParentAlbumsAdmin
  • getParentBreadcrumb
  • getParentMenuItems
  • getPasswordProtectImage
  • getPHPFiles
  • getPictureOfTheDay
  • getPlugin
  • getPluginFiles
  • getPluginTabs
  • getPrevAlbum
  • getPrevAlbumURL
  • getPrevImageThumb
  • getPrevImageURL
  • getPrevNewsPageURL
  • getPrevNewsURL
  • getPrevPageURL
  • getProtectedImageURL
  • getRandomImages
  • getRandomImagesAlbum
  • getRating
  • getReconfigureNote
  • getRelatedItems
  • getRequestURI
  • getrow
  • getRSSLink
  • getRules
  • getSearchDate
  • getSearchURL
  • getSearchWords
  • getSelectedLayout
  • getSerializedArray
  • getSetClause
  • getSiteHomeURL
  • getSizeCustomImage
  • getSizeDefaultImage
  • getSizeDefaultThumb
  • getSizedImageURL
  • getSizeFullImage
  • getSortByOptions
  • getSortByStatusOptions
  • getStandardGalleryIndexURL
  • getSubtabs
  • getSuffix
  • getSystemLocales
  • getTagCountByAccess
  • getTagOrder
  • getTags
  • gettext
  • gettext_pl
  • gettext_th
  • getThemeFiles
  • getThemeOption
  • getTimezones
  • getTinyMCE4ConfigFiles
  • getTitle
  • getTotalHitcounter
  • getTotalImagesIn
  • getTotalNewsPages
  • getTotalPages
  • getUnprotectedImageURL
  • getUrAlbum
  • getUserIP
  • getUserLocale
  • getUserURL
  • getVersion
  • getWatermarkParam
  • getWatermarkPath
  • getWatermarks
  • getWhereClause
  • getXSRFToken
  • getZenpagePagesOptionsArray
  • getZenpageStatistic
  • handleSearchParms
  • hasDynamicAlbumSuffix
  • hasNextImage
  • hasNextNewsPage
  • hasNextPage
  • hasPrevImage
  • hasPrevNewsPage
  • hasPrevPage
  • hasPrimaryScripts
  • hl_attrval
  • hl_bal
  • hl_cmtcd
  • hl_ent
  • hl_prot
  • hl_regex
  • hl_spec
  • hl_tag
  • hl_tag2
  • hl_tidy
  • hl_version
  • html_decode
  • html_encode
  • html_encodeTagged
  • html_pathurlencode
  • htmLawed
  • httpsRedirect
  • httpUploadHandler
  • httpUploadHandler_admin_tabs
  • i18nSetLocale
  • ignoreSetupRunRequest
  • imageBlurGD
  • imagecreatefrombmp
  • imageDebug
  • imageError
  • imageNumber
  • imgSrcURI
  • in_context
  • installSignature
  • instrument
  • internalToFilesystem
  • inventMenuItem
  • iptc_make_tag
  • is_AdminEditPage
  • is_connected
  • is_News
  • is_NewsArchive
  • is_NewsArticle
  • is_NewsCategory
  • is_NewsPage
  • is_Pages
  • is_valid_email_zp
  • is_zip
  • isAlbumClass
  • isAlbumPage
  • isArchive
  • isCurrentitemParent
  • isHandledAlbum
  • isImageClass
  • isImagePage
  • isImagePhoto
  • isImageVideo
  • isIncompatibleExtension
  • isLandscape
  • isolate
  • isSetupProtected
  • isValidEmail
  • isValidURL
  • jQueryUpload_head
  • jQueryUpload_headers
  • jQueryUploadHandler
  • jQueryUploadHandler_admin_tabs
  • js_encode
  • json_decode
  • json_encode
  • kses
  • kses_array_lc
  • kses_attr
  • kses_bad_protocol
  • kses_bad_protocol_once
  • kses_bad_protocol_once2
  • kses_check_attr_val
  • kses_decode_entities
  • kses_hair
  • kses_hook
  • kses_html_error
  • kses_js_entities
  • kses_no_null
  • kses_normalize_entities
  • kses_normalize_entities2
  • kses_split
  • kses_split2
  • kses_stripslashes
  • kses_version
  • ksesProcess
  • layoutSelector
  • layoutSelector_album
  • listDBUses
  • listDirectoryFiles
  • listUses
  • load_zenpage_news
  • load_zenpage_pages
  • loadLocalOptions
  • log_message
  • lookupSortKey
  • macro_admin_tabs
  • macroList_show
  • makeAlbumCurrent
  • makeImageCurrent
  • makeSpecialImageName
  • markRelease_button
  • mb_strlen
  • mb_strpos
  • mb_strrpos
  • mb_strtolower
  • mb_strtoupper
  • mb_substr
  • mb_substr_count
  • menu_admin_toolbox_global
  • menu_tabs
  • minDiff
  • mkdir_recursive
  • myts_date
  • newAlbum
  • newImage
  • next_album
  • next_comment
  • next_image
  • next_news
  • next_page
  • ngettext
  • ngettext_pl
  • ngettext_th
  • omsAdditions
  • parse_query
  • parse_size
  • parseAllowedTags
  • parseHttpAcceptLanguage
  • pathurlencode
  • pluginDebug
  • populateManagedObjectsList
  • postAlbumSort
  • postIndexDecode
  • postIndexEncode
  • prefix
  • prepareAlbumPage
  • prepareCustomPage
  • prepareImagePage
  • prepareIndexPage
  • print404status
  • print_language_string_list
  • printAddToFavorites
  • printAdminFooter
  • printAdminHeader
  • printAdminRightsTable
  • printAdminThumb
  • printAlbumBreadcrumb
  • printAlbumButtons
  • printAlbumCustomData
  • printAlbumData
  • printAlbumDate
  • printAlbumDesc
  • printAlbumEditForm
  • printAlbumEditRow
  • printAlbumLegend
  • printAlbumLocation
  • printAlbumMenu
  • printAlbumMenuJump
  • printAlbumMenuList
  • printAlbumMenuListAlbum
  • printAlbumsSelector
  • printAlbumStatistic
  • printAlbumStatisticItem
  • printAlbumThumbImage
  • printAlbumTitle
  • printAlbumURL
  • printAllDates
  • printAllNestedList
  • printAllNewsCategories
  • printAllTags
  • printAllTagsAs
  • printAllTagsFromAlbum
  • printAllTagsFromZenpage
  • printAnnotatedAlbumTitle
  • printAnnotatedImageTitle
  • printArticleCategories
  • printArticleDatesDropdown
  • printArticlesPerPageDropdown
  • printAuthorDropdown
  • printBareAlbumDesc
  • printBareAlbumTitle
  • printBareGalleryDesc
  • printBareGalleryTitle
  • printBareImageDesc
  • printBareImageTitle
  • printBareNewsTitle
  • printBarePageTitle
  • printBarGraph
  • printBulkActions
  • printCategoriesStatistic
  • printCategoryCheckboxListEntry
  • printCategoryDropdown
  • printCategoryListSortableTable
  • printCategorySelection
  • printCodeblock
  • printCodeblockEdit
  • printCommentAuthorLink
  • printCommentErrors
  • printCommentForm
  • printContactForm
  • printContactFormMacro
  • printCookieInfo
  • printCopyrightNotice
  • printCurrentNewsArchive
  • printCurrentNewsCategory
  • printCustomAlbumThumbImage
  • printCustomAlbumThumbMaxSpace
  • printCustomMenu
  • printCustomPageSelector
  • printCustomPageURL
  • printCustomSizedImage
  • printCustomSizedImageMaxSpace
  • printCustomSizedImageThumbMaxSpace
  • printDataUsageNotice
  • printDefaultSizedImage
  • printDownloadAlbumZipURL
  • printdownloadList
  • printDownloadURL
  • printEditCommentLink
  • printEditDropdown
  • printExpired
  • printFavoritesURL
  • printFullAlbumsList
  • printFullImageDownloadURL
  • printGalleryDesc
  • printGalleryIndexURL
  • printGalleryTitle
  • printGoogleMap
  • printHeadTitle
  • printHomeLink
  • printImageCustomData
  • printImageData
  • printImageDate
  • printImageDesc
  • printImageMetadata
  • printImageslist
  • printImageStatistic
  • printImageThumb
  • printImageTitle
  • printImageURL
  • printItemEditLink
  • printItemsList
  • printItemsListTable
  • printItemStatusDropdown
  • printjPlayerPlaylist
  • printLangAttribute
  • printLanguageSelector
  • printLastChangeInfo
  • printLatestAlbums
  • printLatestComments
  • printLatestImages
  • printLatestImagesByDate
  • printLatestImagesByMtime
  • printLatestNews
  • printLatestUpdatedAlbums
  • printLinkHTML
  • printLogoAndLinks
  • printManagedObjects
  • printMenuemanagerPageList
  • printMenuemanagerPageListWithNav
  • printMenumanagerBreadcrumb
  • printMenumanagerNextLink
  • printMenumanagerPrevLink
  • printMostPopularItems
  • printMostRatedAlbums
  • printMostRatedImages
  • printMostRatedItems
  • printNestedAlbumsList
  • printNestedItemsList
  • printNestedMenu
  • printNews
  • printNewsArchive
  • printNewsArticlesList
  • printNewsAuthor
  • printNewsCategories
  • printNewsCategoryCustomData
  • printNewsCategoryDesc
  • printNewsCategoryURL
  • printNewsContent
  • printNewsCustomData
  • printNewsDate
  • printNewsExtraContent
  • printNewsIndexURL
  • printNewsPageList
  • printNewsPageListWithNav
  • printNewsStatistic
  • printNewsTitle
  • printNewsURL
  • printNextNewsLink
  • printNextNewsPageLink
  • printNextPageURL
  • printOpenStreetMap
  • printOwnerAuthor
  • printOwnerAuthorURL
  • printPageArticleTags
  • printPageAuthor
  • printPageContent
  • printPageCustomData
  • printPageDate
  • printPagedThumbsNav
  • printPageExtraContent
  • printPageID
  • printPageLastChangeDate
  • printPageList
  • printPageListWithNav
  • printPageMenu
  • printPageNav
  • printPageSelector
  • printPagesListTable
  • printPagesStatistic
  • printPageTitle
  • printPageTitleLink
  • printPageURL
  • printParentBreadcrumb
  • printPasswordForm
  • printPopularAlbums
  • printPopularImages
  • printPrevNewsLink
  • printPrevNewsPageLink
  • printPrevPageURL
  • printPrivacyPageLink
  • printPublished
  • printPublishIconLink
  • printPublishIconLinkGallery
  • printRandomImages
  • printRating
  • printReconfigureError
  • printReconfigureNote
  • printRegisterURL
  • printRegistrationForm
  • printRelatedItems
  • printRSSHeaderLink
  • printRSSLink
  • printScheduledPublishingNotes
  • printSearchBreadcrumb
  • printSearchForm
  • printSelectorWithCustomField
  • printSiteHomeURL
  • printSizedImageURL
  • printSlideShow
  • printSlideShowLink
  • printSortableHead
  • printSortOrderDropdown
  • printSubLevelAlbums
  • printSubPagesExcerpts
  • printSubtabs
  • printTabs
  • printTags
  • printThumbNav
  • printTinyPageNav
  • printTinyZenpageCategorySelector
  • printTopRatedAlbums
  • printTopRatedImages
  • printTopRatedItems
  • printUnpublishedDropdown
  • printUserLogin_out
  • printUserSelector
  • printUserURL
  • printVersion
  • printZenJavascripts
  • printZenpageIconLegend
  • printZenpageItems
  • printZenpageItemsBreadcrumb
  • printZenpageNewsCategorySelector
  • printZenpagePageSelector
  • printZenpagePagesSelector
  • printZenpageStatistic
  • printZenphotoLink
  • process_language_string_save
  • processAlbumBulkActions
  • processAlbumEdit
  • processCodeblockSave
  • processCommentBulkActions
  • processCredentials
  • processCustomOptionSave
  • processEditSelection
  • processExtensionVariable
  • processImageBulkActions
  • processImageEdit
  • processManagedObjects
  • processMenuBulkActions
  • processOrder
  • processRights
  • processTags
  • processZenpageBulkActions
  • propSizes
  • protectSetupFiles
  • publishItem
  • purgeOption
  • purgeThemeOption
  • query
  • query_full_array
  • query_single_row
  • rc4
  • read_exif_data_protected
  • readTags
  • reconfigureAction
  • reconfigureCSS
  • recordMissing
  • redirectionHandler
  • redirectURL
  • rem_context
  • removeDir
  • removeParentAlbumNames
  • removeTrailingSlash
  • renameOption
  • replaceOption
  • replaceThemeOption
  • restore_context
  • reveal
  • rewrite_get_album_image
  • rewrite_path
  • rewriteHandler
  • RSS_Channel
  • RSS_Retrieve
  • RSS_Tags
  • rulesList
  • safe_fnmatch
  • safe_glob
  • sanitize
  • sanitize_numeric
  • sanitize_path
  • sanitize_script
  • sanitize_string
  • sanitizeRedirect
  • save_context
  • saveLayoutSelection
  • saveZenphotoLayoutSelection
  • search_quote
  • secureServer
  • seo_cleanup_button
  • seoFriendly
  • seoFriendlyJS
  • set_context
  • setAlbumSubtabs
  • setexifvars
  • setMainDomain
  • setOption
  • setOptionDefault
  • setSiteState
  • setThemeColumns
  • setThemeOption
  • setThemeOptionDefault
  • setTinyZenpageLocale
  • setupCurrentLocale
  • setupDomain
  • setupTheme
  • shortenContent
  • shortentitle
  • showOrNotShowField
  • showZenphotoOptions
  • shuffle_assoc
  • signatureChange
  • site_upgrade_button
  • site_upgrade_status
  • skipScheduledPublishing
  • sortArray
  • sortByKey
  • sortByMultilingual
  • sortMultiArray
  • standardScripts
  • standardThemeOptions
  • stickyNews
  • storeConfig
  • storeTags
  • stripSuffix
  • submenuOf
  • switchLog
  • tagSelector
  • tagSuggestJS
  • tagSuggestJS_admin
  • tagSuggestJS_frontend
  • tagURLs
  • textdomain
  • themeIsEditable
  • themeSetup
  • tidyHTML
  • timezoneDiff
  • tinymce4ConfigJS
  • truncate_string
  • unprotectSetupFiles
  • unpublishedZenpageItemCheck
  • unpublishedZenphotoItemCheck
  • unpublishSubalbums
  • unQuote
  • unTagURLs
  • unzip
  • updateArticle
  • updateCacheName
  • updateCategory
  • updateConfigItem
  • updateImageProcessorLink
  • updateItemSortorder
  • updateItemsSortorder
  • updateMenuItem
  • updatePage
  • upload_extra
  • upload_form
  • upload_head
  • user_mailing_list_button
  • validateLocale
  • writeHeader
  • XSRFdefender
  • XSRFToken
  • zenpageAlbumImage
  • zenpageBulkActionMessage
  • zenpageJSCSS
  • zenpagePublish
  • zenphoto_PHPMailer
  • zenphoto_sendmail
  • zenPhotoTheme
  • zp_apply_filter
  • zp_clearCookie
  • zp_colorAllocate
  • zp_cookieEncode
  • zp_copyCanvas
  • zp_createImage
  • zp_drawRectangle
  • zp_error
  • zp_filter_slot
  • zp_filter_unique_id
  • zp_getCookie
  • zp_getFonts
  • zp_graphicsLibInfo
  • zp_handle_password
  • zp_handle_password_single
  • zp_has_filter
  • zp_image_types
  • zp_imageCanRotate
  • zp_imageColorTransparent
  • zp_imageDims
  • zp_imageFill
  • zp_imageFontHeight
  • zp_imageFontWidth
  • zp_imageFromString
  • zp_imageGet
  • zp_imageGray
  • zp_imageHeight
  • zp_imageIPTC
  • zp_imageKill
  • zp_imageLoadFont
  • zp_imageMerge
  • zp_imageOutput
  • zp_imageResizeAlpha
  • zp_imageResizeTransparent
  • zp_imageUnsharpMask
  • zp_imageWidth
  • zp_load_album
  • zp_load_gallery
  • zp_load_image
  • zp_load_page
  • zp_load_request
  • zp_load_search
  • zp_loggedin
  • zp_mail
  • zp_register_filter
  • zp_remove_filter
  • zp_resampleImage
  • zp_rotateImage
  • zp_session_destroy
  • zp_session_start
  • zp_setCookie
  • zp_writeString
  • zpErrorHandler
  • zpFormattedDate
  • zpRewriteURL
  • Overview
  • Class
  • Tree
  • Package
  • Deprecated
   1:    2:    3:    4:    5:    6:    7:    8:    9:   10:   11:   12:   13:   14:   15:   16:   17:   18:   19:   20:   21:   22:   23:   24:   25:   26:   27:   28:   29:   30:   31:   32:   33:   34:   35:   36:   37:   38:   39:   40:   41:   42:   43:   44:   45:   46:   47:   48:   49:   50:   51:   52:   53:   54:   55:   56:   57:   58:   59:   60:   61:   62:   63:   64:   65:   66:   67:   68:   69:   70:   71:   72:   73:   74:   75:   76:   77:   78:   79:   80:   81:   82:   83:   84:   85:   86:   87:   88:   89:   90:   91:   92:   93:   94:   95:   96:   97:   98:   99:  100:  101:  102:  103:  104:  105:  106:  107:  108:  109:  110:  111:  112:  113:  114:  115:  116:  117:  118:  119:  120:  121:  122:  123:  124:  125:  126:  127:  128:  129:  130:  131:  132:  133:  134:  135:  136:  137:  138:  139:  140:  141:  142:  143:  144:  145:  146:  147:  148:  149:  150:  151:  152:  153:  154:  155:  156:  157:  158:  159:  160:  161:  162:  163:  164:  165:  166:  167:  168:  169:  170:  171:  172:  173:  174:  175:  176:  177:  178:  179:  180:  181:  182:  183:  184:  185:  186:  187:  188:  189:  190:  191:  192:  193:  194:  195:  196:  197:  198:  199:  200:  201:  202:  203:  204:  205:  206:  207:  208:  209:  210:  211:  212:  213:  214:  215:  216:  217:  218:  219:  220:  221:  222:  223:  224:  225:  226:  227:  228:  229:  230:  231:  232:  233:  234:  235:  236:  237:  238:  239:  240:  241:  242:  243:  244:  245:  246:  247:  248:  249:  250:  251:  252:  253:  254:  255:  256:  257:  258:  259:  260:  261:  262:  263:  264:  265:  266:  267:  268:  269:  270:  271:  272:  273:  274:  275:  276:  277:  278:  279:  280:  281:  282:  283:  284:  285:  286:  287:  288:  289:  290:  291:  292:  293:  294:  295:  296:  297:  298:  299:  300:  301:  302:  303:  304:  305:  306:  307:  308:  309:  310:  311:  312:  313:  314:  315:  316:  317:  318:  319:  320:  321:  322:  323:  324:  325:  326:  327:  328:  329:  330:  331:  332:  333:  334:  335:  336:  337:  338:  339:  340:  341:  342:  343:  344:  345:  346:  347:  348:  349:  350:  351:  352:  353:  354:  355:  356:  357:  358:  359:  360:  361:  362:  363:  364:  365:  366:  367:  368:  369:  370:  371:  372:  373:  374:  375:  376:  377:  378:  379:  380:  381:  382:  383:  384:  385:  386:  387:  388:  389:  390:  391:  392:  393:  394:  395:  396:  397:  398:  399:  400:  401:  402:  403:  404:  405:  406:  407:  408:  409:  410:  411:  412:  413:  414:  415:  416:  417:  418:  419:  420:  421:  422:  423:  424:  425:  426:  427:  428:  429:  430:  431:  432:  433:  434:  435:  436:  437:  438:  439:  440:  441:  442:  443:  444:  445:  446:  447:  448:  449:  450:  451:  452:  453:  454:  455:  456:  457:  458:  459:  460:  461:  462:  463:  464:  465:  466:  467:  468:  469:  470:  471:  472:  473:  474:  475:  476:  477:  478:  479:  480:  481:  482:  483:  484:  485:  486:  487:  488:  489:  490:  491:  492:  493:  494:  495:  496:  497:  498:  499:  500:  501:  502:  503:  504:  505:  506:  507:  508:  509:  510:  511:  512:  513:  514:  515:  516:  517:  518:  519:  520:  521:  522:  523:  524:  525:  526:  527:  528:  529:  530:  531:  532:  533:  534:  535:  536:  537:  538:  539:  540:  541:  542:  543:  544:  545:  546:  547:  548:  549:  550:  551:  552:  553:  554:  555:  556:  557:  558:  559:  560:  561:  562:  563:  564:  565:  566:  567:  568:  569:  570:  571:  572:  573:  574:  575:  576:  577:  578:  579:  580:  581:  582:  583:  584:  585:  586:  587:  588:  589:  590:  591:  592:  593:  594:  595:  596:  597:  598:  599:  600:  601:  602:  603:  604:  605:  606:  607:  608:  609:  610:  611:  612:  613:  614:  615:  616:  617:  618:  619:  620:  621:  622:  623:  624:  625:  626:  627:  628:  629:  630:  631:  632:  633:  634:  635:  636:  637:  638:  639:  640:  641:  642:  643:  644:  645:  646:  647:  648:  649:  650:  651:  652:  653:  654:  655:  656:  657:  658:  659:  660:  661:  662:  663:  664:  665:  666:  667:  668:  669:  670:  671:  672:  673:  674:  675:  676:  677:  678:  679:  680:  681:  682:  683:  684:  685:  686:  687:  688:  689:  690:  691:  692:  693:  694:  695:  696:  697:  698:  699:  700:  701:  702:  703:  704:  705:  706:  707:  708:  709:  710:  711:  712:  713:  714:  715:  716:  717:  718:  719:  720:  721:  722:  723:  724:  725:  726:  727:  728:  729:  730:  731:  732:  733:  734:  735:  736:  737:  738:  739:  740:  741:  742:  743:  744:  745:  746:  747:  748:  749:  750:  751:  752:  753:  754:  755:  756:  757:  758:  759:  760:  761:  762:  763:  764:  765:  766:  767:  768:  769:  770:  771:  772:  773:  774:  775:  776:  777:  778:  779:  780:  781:  782:  783:  784:  785:  786:  787:  788:  789:  790:  791:  792:  793:  794:  795:  796:  797:  798:  799:  800:  801:  802:  803:  804:  805:  806:  807:  808:  809:  810:  811:  812:  813:  814:  815:  816:  817:  818:  819:  820:  821:  822:  823:  824:  825:  826:  827:  828:  829:  830:  831:  832:  833:  834:  835:  836:  837:  838:  839:  840:  841:  842:  843:  844:  845:  846:  847:  848:  849:  850:  851:  852:  853:  854:  855:  856:  857:  858:  859:  860:  861:  862:  863:  864:  865:  866:  867:  868:  869:  870:  871:  872:  873:  874:  875:  876:  877:  878:  879:  880:  881:  882:  883:  884:  885:  886:  887:  888:  889:  890:  891:  892:  893:  894:  895:  896:  897:  898:  899:  900:  901:  902:  903:  904:  905:  906:  907:  908:  909:  910:  911:  912:  913:  914:  915:  916:  917:  918:  919:  920:  921:  922:  923:  924:  925:  926:  927:  928:  929:  930:  931:  932:  933:  934:  935:  936:  937:  938:  939:  940:  941:  942:  943:  944:  945:  946:  947:  948:  949:  950:  951:  952:  953:  954:  955:  956:  957:  958:  959:  960:  961:  962:  963:  964:  965:  966:  967:  968:  969:  970:  971:  972:  973:  974:  975:  976:  977:  978:  979:  980:  981:  982:  983:  984:  985:  986:  987:  988:  989:  990:  991:  992:  993:  994:  995:  996:  997:  998:  999: 1000: 
<?php
/**
 *
 * This plugin is the centralized Cache manager for Zenphoto.
 *
 * It provides:
 * <ul>
 *      <li>Options to purge the HTML and RSS caches on publish state changes of:
 *          <ul>
 *              <li>albums</li>
 *              <li>images</li>
 *              <li>news articles</li>
 *              <li>pages</li>
 *          </ul>
 *      </li>
 *      <li><i>pre-creating</i> the Image cache images</li>
 *      <li>utilities for purging Image, HTML, and RSS caches</li>
 * </ul>
 *
 * Image cache <i>pre-creating</i> will examine the gallery and make image references to any images which have not
 * already been cached. Your browser will then request these images causing the caching process to be
 * executed.
 *
 * The Zenphoto distributed themes have created <i>Caching</i> size options
 * for the images sizes they use.
 *
 *
 * <b>Notes:</b>
 * <ul>
 *      <li>
 *          Setting theme options or installing a new version of Zenphoto will re-create these caching sizes.
 *          Use a different <i>theme name</i> for custom versions that you create. If you set image options that
 *          impact the default caching you will need to re-create these caching sizes by one of the above methods.
 *      </li>
 *      <li>
 *          The <i>pre-creating</i> process will cause your browser to display each and every image that has not
 *          been previously cached. If your server does not do a good job of thread management this may swamp
 *          it! You should probably also clear your browser cache before using this utility. Otherwise
 *          your browser may fetch the images locally rendering the above process useless.
 *      </li>
 *      <li>
 *          You may have to refresh the page multiple times until the report of the number of images cached is zero.
 *          If some images seem to never be rendered you may be experiencing memory limit or other graphics processor
 *          errors. You can click on the image that does not render to get the <var>i.php</var> debug screen for the
 *          image. This may help in figuring out what has gone wrong.
 *      </li>
 *      <li>
 *          Caching sizes shown on the <var>cache images</var> tab will be identified
 *          with the same post-fixes as the image names in your cache folders. Some examples
 *          are shown below:
 *          <ul>
 *                  <li>
 *                  <var>_595</var>: sized to 595 pixels
 *              </li>
 *              <li>
 *                  <var>_w180_cw180_ch80_thumb</var>: a size of 180px wide and 80px high
 *                          and it is a thumbnail (<var>thumb</var>)
 *              </li>
 *              <li>
 *                  <var>_85_cw72_ch72_thumb_copyright_gray</var>: sized 85px cropped at about
 *                          7.6% (one half of 72/85) from the horizontal and vertical sides with a
 *                          watermark (<var>copyright</var>) and rendered in grayscale (<var>gray</var>)
 *              </li>
 *              <li>
 *                  <var>_w85_h85_cw350_ch350_cx43_cy169_thumb_copyright</var>: a custom cropped 85px
 *                      thumbnail with watermark.
 *              </li>
 *          </ul>
 *
 *          If a field is not represented in the cache size, it is not applied.
 *
 *          Custom crops (those with cx and cy)
 *          really cannot be cached easily since each image has unique values. See the
 *          <i>template-functions</i>::<var>getCustomImageURL()</var> comment block
 *          for details on these fields.
 *      </li>
 * </ul>
 *
 *
 * @package plugins
 * @subpackage cachemanager
 * @author Stephen Billard (sbillard), Malte Müller (acrylian)
 */
$plugin_is_filter = 5 | ADMIN_PLUGIN;
$plugin_description = gettext("Provides cache management utilities for Image, HTML, and RSS caches.");
$plugin_author = "Stephen Billard (sbillard), Malte Müller (acrylian)";
$plugin_category = gettext('Admin');

$option_interface = 'cacheManager';

require_once(SERVERPATH . '/' . ZENFOLDER . '/class-feed.php');

zp_register_filter('admin_utilities_buttons', 'cacheManager::overviewbutton');
zp_register_filter('edit_album_utilities', 'cacheManager::albumbutton', -9999);
zp_register_filter('show_change', 'cacheManager::published');

$_zp_cached_feeds = array('RSS'); //    Add to this array any feed classes that need cache clearing

/**
 * Fake feed descendent class so we can use the feed::clearCache()
 */
class cacheManagerFeed extends feed {

    protected $feed = NULL;

    function __construct($feed) {
        $this->feed = $feed;
    }

}

/**
 *
 * Standard options interface
 * @author Stephen
 *
 */
class cacheManager {
    public static $sizes = array();
    public static $enabledsizes = array();
    public static $albums_cached = 0;
    public static $images_cached = 0;
    public static $imagesizes_total = 0;
    public static $starttime = 0;
    public static $imagesizes_cached = 0;
    public static $imagesizes_failed = 0;
    
    public static $missingimages = null;

    function __construct() {
        self::deleteCacheSizes('admin');
        self::addCacheSize('admin', 40, NULL, NULL, 40, 40, NULL, NULL, -1);
        self::addCacheSize('admin', 80, NULL, NULL, 80, 80, NULL, NULL, -1);
        setOptionDefault('cachemanager_defaultthumb', 1);
        setOptionDefault('cachemanager_defaultsizedimage', 1);
        setOptionDefault('cachemanager_generationmode', 'classic');
    }

    /**
     *
     * supported options
     */
    function getOptionsSupported() {
        $options = array(
                gettext('Image caching sizes') => array(
                        'key' => 'cropImage_list',
                        'type' => OPTION_TYPE_CUSTOM,
                        'order' => 1,
                        'desc' => '<p>' .
                        gettext('Cropped images will be made in these parameters if the <em>Create image</em> box is checked. Un-check to box to remove the settings.' .
                                        'You can determine the values for these fields by examining your cached images. The file names will look something like these:') .
                        '<ul>' .
                        '<li>' . gettext('<code>photo_595.jpg</code>: sized to 595 pixels') . '</li>' .
                        '<li>' . gettext('<code>photo_w180_cw180_ch80_thumb.jpg</code>: a size of 180px wide and 80px high and it is a thumbnail (<code>thumb</code>)') . '</li>' .
                        '<li>' . gettext('<code>photo_85_cw72_ch72_thumb_copyright_gray.jpg</code>: sized 85px cropped at about 7.6% (one half of 72/85) from the horizontal and vertical sides with a watermark (<code>copyright</code>) and rendered in grayscale (<code>gray</code>).') . '</li>' .
                        '<li>' . gettext('<code>photo_w85_h85_cw350_ch350_cx43_cy169_thumb_copyright.jpg</code>: a custom cropped 85px thumbnail with watermark.') . '</li>' .
                        '</ul>' .
                        '</p>' .
                        '<p>' .
                        gettext('If a field is not represented in the cached name, leave the field blank. Custom crops (those with cx and cy) really cannot be cached easily since each image has unique values. ' .
                                        'See the <em>template-functions</em>::<code>getCustomImageURL()</code> comment block for details on these fields.') .
                        '</p>' .
                        '<p>' .
                        gettext('Some themes use <em>MaxSpace</em> image functions. To cache images referenced by these functions set the <em>width</em> and <em>height</em> parameters to the <em>MaxSpace</em> container size and check the <code>MaxSpace</code> checkbox.') .
                        '</p>'
                )
        );
        $list = array(
                '<em>' . gettext('Albums') . '</em>' => 'cacheManager_albums',
                '<em>' . gettext('Images') . '</em>' => 'cacheManager_images');
        if (extensionEnabled('zenpage')) {
            $list['<em>' . gettext('News') . '</em>'] = 'cacheManager_news';
            $list['<em>' . gettext('Pages') . '</em>'] = 'cacheManager_pages';
        } else {
            setOption('cacheManager_news', 0);
            setOption('cacheManager_pages', 0);
        }
        $options[gettext('Purge cache files')] = array(
                'key' => 'cacheManager_items',
                'type' => OPTION_TYPE_CHECKBOX_ARRAY,
                'order' => 0,
                'checkboxes' => $list,
                'desc' => gettext('If a <em>type</em> is checked, the HTML and RSS caches for the item will be purged when the published state of an item of <em>type</em> changes.') .
                '<div class="notebox">' . gettext('<strong>NOTE:</strong> The entire cache is cleared since there is no way to ascertain if a gallery page contains dependencies on the item.') . '</div>'
        );
        $options[gettext('Cache default sizes')] = array(
                'key' => 'cachemanager_defaultsizes',
                'type' => OPTION_TYPE_CHECKBOX_ARRAY,
                'order' => 0,
                'checkboxes' => array(
                        gettext('Default thumb size') => 'cachemanager_defaultthumb',
                        gettext('Default sized image') => 'cachemanager_defaultsizedimage'
                ),
                'desc' => gettext('If enabled the default thumb size (or if set a manual crop) and/or the default sized image as set on the theme options are enabled for caching. Themes or plugins can request to override this option being disabled by defining <code>addThemeDefaultThumbSize()</code> and/or <code>addThemeDefaultSizedImageSize()</code> on their option definitions.')
        );
        $options[gettext('Pre-caching generation mode')] = array(
                'key' => 'cachemanager_generationmode',
                'type' => OPTION_TYPE_RADIO,
                'order' => 0,
                'buttons' => array(
                        gettext('Classic') => 'classic',
                        gettext('cURL') => 'curl'
                ),
                'desc' => gettext('Choose the way how the cachemanager generates the cache sizes via its utility.')
                . '<ul>'
                . '<li>' . gettext('<em>Classic</em> (default) outputs the image sizes to generate directly. This is faster and works basically on all servers but is not always creating all sizes reliably so the process may have to be repeated.') . '</li>'
                . '<li>' . gettext('<em>cURL</em> uses PHP cURL requests to generate the images without output. Although processing time and server load is similar to the classic mode, it is actually more reliable in creating the sizes, especially if you have lots of images and albums. However this does not work properly on all servers.') . '</li>'
                . '</ul>'
        );

        return $options;
    }

    /**
     *
     * custom option handler
     * @param string $option
     * @param mixed $currentValue
     */
    function handleOption($option, $currentValue) {
        global $_zp_gallery;
        $currenttheme = $_zp_gallery->getCurrentTheme();
        $custom = array();
        $result = query('SELECT * FROM ' . prefix('plugin_storage') . ' WHERE `type`="cacheManager" ORDER BY `aux`');
        $key = 0;
        while ($row = db_fetch_assoc($result)) {
            $theme = $row['aux'];
            $data = getSerializedArray($row['data']);
            $custom[$theme][] = $data;
        }
        ksort($custom, SORT_LOCALE_STRING);
        $custom[''] = array(array());
        $c = 0;
        self::printJS();
        foreach ($custom as $theme => $themedata) {
            $themedata = sortMultiArray($themedata, array('thumb', 'image_size', 'image_width', 'image_height'));
            ?>
            <span class="icons" id="<?php echo $theme; ?>_arrow">
                <?php
                if ($theme) {
                    $inputclass = 'hidden';
                    echo '<em>' . $theme . '</em> (' . count($themedata) . ')';
                } else {
                    $inputclass = 'textbox';
                    echo '<br />' . gettext('add');
                }
                ?>
                <a href="javascript:showTheme('<?php echo $theme; ?>');" title="<?php echo gettext('Show'); ?>">
                    <img class="icon-position-top4" src="<?php echo WEBPATH . '/' . ZENFOLDER . '/images/arrow_down.png'; ?>" alt="" />
                </a>
            </span>
            <br />
            <div id="<?php echo $theme; ?>_list" style="display:none">
                <br />
                <?php
                foreach ($themedata as $cache) {
                    $key++;
                    if ($c % 2) {
                        $class = 'boxb';
                    } else {
                        $class = 'box';
                    }
                    ?>
                    <div>
                        <?php
                        $c++;
                        if (isset($cache['enable']) && $cache['enable']) {
                            $allow = ' checked="checked"';
                        } else {
                            $allow = '';
                        }
                        ?>
                        <div class="<?php echo $class; ?>">
                            <input type="<?php echo $inputclass; ?>" size="25" name="cacheManager_theme_<?php echo $key; ?>" value="<?php echo $theme; ?>" />
                            <?php
                            if ($theme) {
                                ?>
                                <span class="displayinlineright"><?php echo gettext('Delete'); ?> <input type="checkbox" name="cacheManager_delete_<?php echo $key; ?>" value="1" /></span>
                                <input type="hidden" name="cacheManager_valid_<?php echo $key; ?>" value="1" />
                                <?php
                            }
                            ?>
                            <br />
                            <?php
                            foreach (array('image_size' => gettext('Size'), 'image_width' => gettext('Width'), 'image_height' => gettext('Height'),
                    'crop_width' => gettext('Crop width'), 'crop_height' => gettext('Crop height'), 'crop_x' => gettext('Crop X axis'),
                    'crop_y' => gettext('Crop Y axis')) as $what => $display) {
                                if (isset($cache[$what])) {
                                    $v = $cache[$what];
                                } else {
                                    $v = '';
                                }
                                ?>
                                <span class="nowrap"><?php echo $display; ?> <input type="textbox" size="2" name="cacheManager_<?php echo $what; ?>_<?php echo $key; ?>" value="<?php echo $v; ?>" /></span>
                                <?php
                            }
                            if (isset($cache['wmk'])) {
                                $wmk = $cache['wmk'];
                            } else {
                                $wmk = '';
                            }
                            ?>
                            <span class="nowrap"><?php echo gettext('Watermark'); ?> <input type="textbox" size="20" name="cacheManager_wmk_<?php echo $key; ?>" value="<?php echo $wmk; ?>" /></span>
                            <br />
                            <span class="nowrap"><?php echo gettext('MaxSpace'); ?><input type="checkbox"  name="cacheManager_maxspace_<?php echo $key; ?>" value="1"<?php if (isset($cache['maxspace']) && $cache['maxspace']) echo ' checked="checked"'; ?> /></span>
                            <span class="nowrap"><?php echo gettext('Thumbnail'); ?><input type="checkbox"  name="cacheManager_thumb_<?php echo $key; ?>" value="1"<?php if (isset($cache['thumb']) && $cache['thumb']) echo ' checked="checked"'; ?> /></span>
                            <span class="nowrap"><?php echo gettext('Grayscale'); ?><input type="checkbox"  name="cacheManager_gray_<?php echo $key; ?>" value="gray"<?php if (isset($cache['gray']) && $cache['gray']) echo ' checked="checked"'; ?> /></span>
                        </div>
                        <br />
                    </div>
                    <?php
                }
                ?>
            </div><!-- <?php echo $theme; ?>_list -->
            <?php
        }
    }

    static function printJS() {
        ?>
        <script type="text/javascript">
            function checkTheme(theme) {
                $('.' + theme).prop('checked', $('#' + theme).prop('checked'));
            }
            function showTheme(theme) {
                html = $('#' + theme + '_arrow').html();
                if (html.match(/down/)) {
                    html = html.replace(/_down/, '_up');
                    html = html.replace(/title = "<?php echo gettext('Show'); ?>/, 'title="<?php echo gettext('Hide');
        ?>"');
                    $('#' + theme + '_list').show();
                } else {
                    html = html.replace(/_up/, '_down');
                    html = html.replace(/title="<?php echo gettext('Hide'); ?>/, 'title="<?php echo gettext('Show'); ?>"');
                    $('#' + theme + '_list').hide();
                }
                $('#' + theme + '_arrow').html(html);
            }

        </script>
        <?php
    }

    /**
     *
     * process custom option saves
     * @param string $themename
     * @param string $themealbum
     * @return string
     */
    function handleOptionSave($themename, $themealbum) {
        $cache = array();
        foreach ($_POST as $key => $value) {
            preg_match('/^cacheManager_(.*)_(.*)/', $key, $matches);
            if ($value && !empty($matches)) {
                $cache[$matches[2]][$matches[1]] = sanitize(trim($value));
            }
        }
        query('DELETE FROM ' . prefix('plugin_storage') . ' WHERE `type`="cacheManager"');
        foreach ($cache as $cacheimage) {
            if (!isset($cacheimage['delete']) && count($cacheimage) > 1) {
                $cacheimage['theme'] = preg_replace("/[\s\"\']+/", "-", $cacheimage['theme']);
                $sql = 'INSERT INTO ' . prefix('plugin_storage') . ' (`type`, `aux`,`data`) VALUES ("cacheManager",' . db_quote($cacheimage['theme']) . ',' . db_quote(serialize($cacheimage)) . ')';
                query($sql);
            }
        }
        return false;
    }

    /**
     * Adds a custom image cache size for themes and – despite the method name – also for plugins
     * 
     * @param string $owner Name of the theme (or plugin) this belongs to
     * @param int $size
     * @param int $width
     * @param int $height
     * @param int $cw crop width
     * @param int $ch crop height
     * @param int $cx crop x
     * @param int $cy crop y
     * @param bool $thumb
     * @param bool $watermark
     * @param string $effects
     * @param bool $maxspace
     */
    static function addCacheSize($owner, $size, $width, $height, $cw, $ch, $cx, $cy, $thumb, $watermark = NULL, $effects = NULL, $maxspace = false) {
        $cacheSize = serialize(array(
                'theme' => $owner,
                'apply' => false,
                'image_size' => $size,
                'image_width' => $width,
                'image_height' => $height,
                'crop_width' => $cw,
                'crop_height' => $ch,
                'crop_x' => $cx,
                'crop_y' => $cy,
                'thumb' => $thumb,
                'wmk' => $watermark,
                'gray' => $effects,
                'maxspace' => $maxspace,
                'valid' => 1));
        $sql = 'INSERT INTO ' . prefix('plugin_storage') . ' (`type`, `aux`,`data`) VALUES ("cacheManager",' . db_quote($owner) . ',' . db_quote($cacheSize) . ')';
        query($sql);
    }

    /**
     * Adds a custom image cache size for themes and – despite the method name – also for plugins
     * 
     * @deprecated Zenphoto 1.6 - Use cacheManager::addCacheSize() instead
     * @since Zenphoto 1.5.1
     */
    static function addThemeCacheSize($theme, $size, $width, $height, $cw, $ch, $cx, $cy, $thumb, $watermark = NULL, $effects = NULL, $maxspace = false) {
        if (class_exists('cachemanager_internal_deprecations'))
            cachemanager_internal_deprecations::addThemeCacheSize();
        self::addCacheSize($theme, $size, $width, $height, $cw, $ch, $cx, $cy, $thumb, $watermark, $effects, $maxspace);
    }

    /**
     * Adds the default theme thumb cache size
     */
    static function addDefaultThumbSize() {
        setOption('cachemanager_defaultthumb', 1);
    }

    /**
     * Adds the default theme thumb cache size
     * @deprecated Zenphoto 1.6 - Better use cacheManager::addDefaultThumbSize();
     * @since Zenphoto 1.5.1
     */
    static function addThemeDefaultThumbSize() {
        if (class_exists('cachemanager_internal_deprecations'))
            cachemanager_internal_deprecations::addThemeDefaultThumbSize();
        cacheManager::addDefaultThumbSize();
    }

    /**
     * Adds default sized image size for the cachemanger
     */
    static function addDefaultSizedImageSize() {
        setOption('cachemanager_defaultsizedimage', 1);
    }

    /**
     * @deprecated Zenphoto 1.6 - Better use cacheManager::addDefaultSizedImageSize();
     * @since Zenphoto 1.5.1
     */
    static function addThemeDefaultSizedImageSize() {
        if (class_exists('cachemanager_internal_deprecations'))
            cachemanager_internal_deprecations::addThemeDefaultSizedImageSize();
        cacheManager::addDefaultSizedImageSize();
        ;
    }

    /**
     *
     * filter for the setShow() methods
     * @param object $obj
     */
    static function published($obj) {
        global $_zp_HTML_cache, $_zp_cached_feeds;
        if (getOption('cacheManager_' . $obj->table)) {
            $_zp_HTML_cache->clearHTMLCache();
            foreach ($_zp_cached_feeds as $feed) {
                $feeder = new cacheManagerFeed($feed);
                $feeder->clearCache();
            }
        }
        return $obj;
    }

    /**
     * 
     * @param string $table
     * @param string $row
     * @return string
     */
    static function getTitle($table, $row) {
        switch ($table) {
            case 'images':
                $album = query_single_row('SELECT `folder` FROM ' . prefix('albums') . ' WHERE `id`=' . $row['albumid']);
                $title = gettext('Missing album');
                if ($album) {
                    $title = sprintf(gettext('%1$s: image %2$s'), $album['folder'], $row['filename']);
                }
                break;
            case 'albums':
                $title = sprintf(gettext('album %s'), $row['folder']);
                break;
            case 'news':
            case 'pages':
                $title = sprintf(gettext('%1$s: %2$s'), $table, $row['titlelink']);
                break;
        }
        return $title;
    }

    /**
     * Updates an global array variable with missing images
     * 
     * @param string $table
     * @param string $row
     * @param string $image
     */
    static function recordMissing($table, $row, $image) {
        $obj = getItemByID($table, $row['id']);
        if ($obj) { // just to be sure
            cacheManager::$missingimages[] = '<a href="' . $obj->getLink() . '">' . $obj->getTitle() . '</a> (' . html_encode($image) . ')<br />';
        }
    }

    /**
     * Updates the path to the cache folder
     * 
     * @param mixed $text
     * @param string $target
     * @param string $update
     * @return mixed
     */
    static function updateCacheName($text, $target, $update) {
        if (is_string($text) && preg_match('/^a:[0-9]+:{/', $text)) { //    serialized array
            $text = getSerializedArray($text);
            $serial = true;
        } else {
            $serial = false;
        }
        if (is_array($text)) {
            foreach ($text as $key => $textelement) {
                $text[$key] = self::updateCacheName($textelement, $target, $update);
            }
            if ($serial) {
                $text = serialize($text);
            }
        } else {
            $text = str_replace($target, $update, $text);
        }
        return $text;
    }

    /**
     * Returns an array with the stored sizes to cache
     * 
     * Note: The default thumb and sized image sizes are not included even if set
     * @param string $mode "all" for all sizes stored, "inactive' or "active"
     * @return array
     */
    static function getSizes($mode = 'all') {
        $result = query('SELECT * FROM ' . prefix('plugin_storage') . ' WHERE `type` = "cacheManager" ORDER BY `aux`');
        while ($row = db_fetch_assoc($result)) {
            $sizes[] = getSerializedArray($row['data']);
        }
        $sizes = sortMultiArray($sizes, array('theme', 'thumb', 'image_size', 'image_width', 'image_height'));
        $sizes_filtered = array();
        if ($mode == 'active' || $mode == 'inactive') {
            foreach ($sizes as $size) {
                if ($mode == 'active') {
                    if (cacheManager::isValid($size['theme'])) {
                        $sizes_filtered[] = $size;
                    }
                }
                if ($mode == 'inactive') {
                    if (!cacheManager::isValid($size['theme'])) {
                        $sizes_filtered[] = $size;
                    }
                }
            }
            $sizes = $sizes_filtered;
        }
        return $sizes;
    }

    /**
     * Processes an album and recursively its subalbums
     * @param type $albumobj
     * @return type
     */
    static function loadAlbums($albumobj) {
        cachemanager::loadAlbum($albumobj);
        $subalbums = $albumobj->getAlbums();
        foreach ($subalbums as $folder) {
            $subalbum = newAlbum($folder);
            if (!$subalbum->isDynamic()) {
                cachemanager::loadAlbums($subalbum);
            }
        }
    }

    /**
     * Processes a single album to cache its images
     * 
     * @global obj $_zp_gallery
     * @param obj $album Object of the album to cache the images
     */
    static function loadAlbum($albumobj) {
        global $_zp_gallery;
        $theme = $_zp_gallery->getCurrentTheme();
        $id = 0;
        $parent = getUrAlbum($albumobj);
        $albumtheme = $parent->getAlbumTheme();
        if (!empty($albumtheme)) {
            $theme = $albumtheme;
            $id = $parent->getID();
        }
        loadLocalOptions($id, $theme);
        echo '<li><strong>' . html_encode($albumobj->getTitle()) . '</strong> (' . html_encode($albumobj->name) . ')<ul>';
        cacheManager::loadImages($albumobj);
        echo '</ul></li>';
        cacheManager::$albums_cached++;
        ?>
        <script>
            $('.imagecaching_albumcount').text(<?php echo cacheManager::$albums_cached; ?>);
        </script>
        <?php
    }

    /**
     * Processes the images of an album
     * 
     * @global obj $_zp_gallery
     * @param type $albumobj
     * @return int
     */
    static function loadImages($albumobj) {
        $images = $albumobj->getImages(0);
        if (is_array($images) && count($images) > 0) {
            foreach ($images as $image) {
                $sizes_count = 0;
                $sizeuris = array();
                $results = array();
                $imageobj = newImage($albumobj, $image);
                if (isImagePhoto($imageobj)) {
                    if (array_key_exists('*', cachemanager::$enabledsizes)) {
                        $uri = getFullImageURL($imageobj);
                        if (strpos($uri, 'full-image.php?') !== false) {
                            $sizes_count++;
                            $sizeuris[] = $uri;
                        }
                    }
                    if (array_key_exists('defaultthumb', cachemanager::$enabledsizes)) {
                        $thumb = $imageobj->getThumb();
                        if (strpos($thumb, 'i.php?') !== false) {
                            $sizes_count++;
                            $sizeuris[] = $thumb;
                        }
                    }
                    if (array_key_exists('defaultsizedimage', cachemanager::$enabledsizes)) {
                        $defaultimage = $imageobj->getSizedImage(getOption('image_size'));
                        if (strpos($defaultimage, 'i.php?') !== false) {
                            $sizes_count++;
                            $sizeuris[] = $defaultimage;
                        }
                    }
                    foreach (cacheManager::$sizes as $key => $cacheimage) {
                        if (array_key_exists($key, cacheManager::$enabledsizes)) {
                            $size = isset($cacheimage['image_size']) ? $cacheimage['image_size'] : NULL;
                            $width = isset($cacheimage['image_width']) ? $cacheimage['image_width'] : NULL;
                            $height = isset($cacheimage['image_height']) ? $cacheimage['image_height'] : NULL;
                            $thumbstandin = isset($cacheimage['thumb']) ? $cacheimage['thumb'] : NULL;
                            if ($special = ($thumbstandin === true)) {
                                list($special, $cw, $ch, $cx, $cy) = $imageobj->getThumbCropping($size, $width, $height);
                            }
                            if (!$special) {
                                $cw = isset($cacheimage['crop_width']) ? $cacheimage['crop_width'] : NULL;
                                $ch = isset($cacheimage['crop_height']) ? $cacheimage['crop_height'] : NULL;
                                $cx = isset($cacheimage['crop_x']) ? $cacheimage['crop_x'] : NULL;
                                $cy = isset($cacheimage['crop_y']) ? $cacheimage['crop_y'] : NULL;
                            }
                            $effects = isset($cacheimage['gray']) ? $cacheimage['gray'] : NULL;
                            if (isset($cacheimage['wmk'])) {
                                $passedWM = $cacheimage['wmk'];
                            } else {
                                if ($thumbstandin) {
                                    $passedWM = getWatermarkParam($imageobj, WATERMARK_THUMB);
                                } else {
                                    $passedWM = getWatermarkParam($imageobj, WATERMARK_IMAGE);
                                }
                            }
                            if (isset($cacheimage['maxspace'])) {
                                getMaxSpaceContainer($width, $height, $imageobj, $thumbstandin);
                            }
                            $args = array($size, $width, $height, $cw, $ch, $cx, $cy, NULL, $thumbstandin, NULL, $thumbstandin, $passedWM, NULL, $effects);
                            $args = getImageParameters($args, $albumobj->name);
                            if ($albumobj->isDynamic()) {
                                $folder = $imageobj->album->name;
                            } else {
                                $folder = $albumobj->name;
                            }
                            $uri = getImageURI($args, $folder, $imageobj->filename, $imageobj->filemtime);
                            if (strpos($uri, 'i.php?') !== false) {
                                $sizes_count++;
                                $sizeuris[] = $uri;
                            }
                        }
                    }
                    $imagetitle = html_encode($imageobj->getTitle()) . ' (' . html_encode($imageobj->filename) . '): ';
                    echo '<li>';
                    if ($sizes_count == 0) {
                        echo $imagetitle;
                        ?>
                        <em style="color:green"><?php echo gettext('All already cached.'); ?></em>
                        <?php
                    } else {
                        cacheManager::$images_cached++;
                        echo $imagetitle;
                        foreach ($sizeuris as $sizeuri) {
                            cacheManager::generateImage($sizeuri);
                            $endtime_temp = time();
                            $time_total_temp = ($endtime_temp - cacheManager::$starttime) / 60;
                            ?>
                            <script>
                                $('.imagecaching_imagecount').text(<?php echo cacheManager::$images_cached; ?>);
                                $('.imagecaching_imagesizes').text(<?php echo cacheManager::$imagesizes_cached; ?>);
                                $('.imagecaching_imagesizes_failed').text(<?php echo cacheManager::$imagesizes_failed; ?>);
                                $('.imagecaching_time').text(<?php echo round($time_total_temp, 2); ?>);
                            </script>
                            <?php
                        }
                    }
                    echo '</li>';
                }
            }
        } else {
            ?>
            <li><p class="notebox"><em><?php echo gettext('This album does not have any images.'); ?></p></li>
            <?php
        }
    }

    /**
     * Sends a single cURL request to i.php to generate the image size requested if curl is available, otherwise requests the image size directly by printing it.
     * 
     * @param string $imageuri The image processor uri to this image
     * @return mixed
     */
    static function generateImage($imageuri) {
        if (function_exists('curl_init') && getOption('cachemanager_generationmode') == 'curl') {
            $success = generateImageCacheFile($imageuri);
            if ($success) {
                echo '<a href="' . html_encode(pathurlencode($imageuri)) . '&amp;debug"><img class="icon-position-top4" src="' . WEBPATH . '/' . ZENFOLDER . '/images/pass.png" alt="" title="' . html_encode($imageuri) . '"></a>';
                cacheManager::$imagesizes_cached++;
            } else {
                echo '<a href="' . html_encode(pathurlencode($imageuri)) . '&amp;debug"><img src="' . WEBPATH . '/' . ZENFOLDER . '/images/fail.png" alt=""></a>';
                cacheManager::$imagesizes_failed++;
            }
        } else {
            ?>
            <a href="<?php echo html_encode(pathurlencode($imageuri)); ?>&amp;debug"><img src="<?php echo html_encode(pathurlencode($imageuri)); ?>" height="25" alt="x" /></a>';
            <?php
            cacheManager::$imagesizes_cached++;
        }
    }

    /**
     * Used to check and skip cachemanager sizes if 
     * - their owner (theme or extension) isn't existing or not enabled.
     * Also used to sort our default thumb/default sized image
     * 
     * - Checks if this is from an existing theme ("admin" sizes are always valid)
     * - Checks if this is from an enabeled extension
     * - Checks if this is a custom size (e.g. not one of the non active plugins)
     * 
     * @param string $owner
     * @return boolean
     */
    static function isValid($owner) {
        global $_zp_gallery;
        if ($owner == 'admin') {
            return true;
        }
        //allow sizes of all themes in case we use an album theme somewhere
        //The list to select will also filter
        $themes = $_zp_gallery->getThemes();
        foreach($themes as $theme) {
            if (strtolower($theme['name']) == strtolower($owner)) {
                return true;
            }
        }
        //allow only sizes from active plugins
        if (extensionEnabled($owner)) {
            return true;
        }
        //Sizes that don't apply above and are not from an inactive plugin 
        //are most certainly custom sizes set via cachemanager itself so better allow them
        $allplugins = array_keys(getPluginFiles('*.php'));
        if (!in_array($owner, $allplugins)) {
            return true;
        }
        return false;
    }

    /**
     * Prints the form elements to select a cache size to process
     * 
     * @param string $value
     * @param string $checked
     * @param string $text
     * @param string $class
     */
    static function printSizesListEntry($value, $checked, $text, $class = null) {
        $arrayindex = $value;
        if (in_array($value, array('*', 'defaultthumb', 'defaultsizedimage'))) {
            $arrayindex = $value;
        }
        if (!is_null($class)) {
            $class = '  class="' . html_encode($class) . '"';
        }
        if (!empty(cacheManager::$enabledsizes)) {
            ?>
            <input type="hidden" name="enable[<?php echo $arrayindex; ?>]" value="<?php echo $value; ?>" />
            <?php
        }
        ?>
        <li>
            <label>
                <input type="checkbox" name="enable[<?php echo $arrayindex; ?>]"<?php echo $class; ?> value="<?php echo $value; ?>"<?php echo $checked; ?> />
                <?php echo gettext('Apply'); ?> <code><?php echo $text; ?></code>
            </label>
        </li>
        <?php
    }

    static function overviewbutton($buttons) {
        if (query_single_row('SELECT * FROM ' . prefix('plugin_storage') . ' WHERE `type`="cacheManager" LIMIT 1')) {
            $enable = true;
            $title = gettext('Finds images that have not been cached and creates the cached versions.');
        } else {
            $enable = false;
            $title = gettext('You must first set the plugin options for cached image parameters.');
        }

        $buttons[] = array(
                'category' => gettext('Cache'),
                'enable' => $enable,
                'button_text' => gettext('Cache manager'),
                'formname' => 'cacheManager_button',
                'action' => FULLWEBPATH . '/' . ZENFOLDER . '/' . PLUGIN_FOLDER . '/cacheManager/cacheImages.php?page=overview&tab=images',
                'icon' => 'images/cache.png',
                'alt' => '',
                'hidden' => '',
                'rights' => ADMIN_RIGHTS,
                'title' => $title
        );
        if (class_exists('RSS')) {
            $buttons[] = array(
                    'XSRFTag' => 'clear_cache',
                    'category' => gettext('Cache'),
                    'enable' => true,
                    'button_text' => gettext('Purge RSS cache'),
                    'formname' => 'purge_rss_cache.php',
                    'action' => FULLWEBPATH . '/' . ZENFOLDER . '/admin.php?action=clear_rss_cache',
                    'icon' => 'images/edit-delete.png',
                    'alt' => '',
                    'title' => gettext('Delete all files from the RSS cache'),
                    'hidden' => '<input type="hidden" name="action" value="clear_rss_cache" />',
                    'rights' => ADMIN_RIGHTS
            );
        }
        $buttons[] = array(
                'XSRFTag' => 'clear_cache',
                'category' => gettext('Cache'),
                'enable' => true,
                'button_text' => gettext('Purge Image cache'),
                'formname' => 'purge_image_cache.php',
                'action' => FULLWEBPATH . '/' . ZENFOLDER . '/admin.php?action=action=clear_cache',
                'icon' => 'images/edit-delete.png',
                'alt' => '',
                'title' => gettext('Delete all files from the Image cache'),
                'hidden' => '<input type="hidden" name="action" value="clear_cache" />',
                'rights' => ADMIN_RIGHTS
        );
        $buttons[] = array(
                'category' => gettext('Cache'),
                'enable' => true,
                'button_text' => gettext('Purge HTML cache'),
                'formname' => 'clearcache_button',
                'action' => FULLWEBPATH . '/' . ZENFOLDER . '/admin.php?action=clear_html_cache',
                'icon' => 'images/edit-delete.png',
                'title' => gettext('Clear the static HTML cache. HTML pages will be re-cached as they are viewed.'),
                'alt' => '',
                'hidden' => '<input type="hidden" name="action" value="clear_html_cache">',
                'rights' => ADMIN_RIGHTS,
                'XSRFTag' => 'ClearHTMLCache'
        );

        $buttons[] = array(
                'category' => gettext('Cache'),
                'enable' => true,
                'button_text' => gettext('Purge search cache'),
                'formname' => 'clearcache_button',
                'action' => FULLWEBPATH . '/' . ZENFOLDER . '/admin.php?action=clear_search_cache',
                'icon' => 'images/edit-delete.png',
                'title' => gettext('Clear the static search cache.'),
                'alt' => '',
                'hidden' => '<input type="hidden" name="action" value="clear_search_cache">',
                'rights' => ADMIN_RIGHTS,
                'XSRFTag' => 'ClearSearchCache'
        );
        $buttons[] = array(
                'category' => gettext('Cache'),
                'enable' => true,
                'button_text' => gettext('Cleanup image cache sizes'),
                'formname' => 'clearcache_button',
                'action' => FULLWEBPATH . '/' . ZENFOLDER . '/' . PLUGIN_FOLDER . '/cacheManager/cacheImages.php?action=cleanup_cache_sizes',
                'icon' => 'images/edit-delete.png',
                'title' => gettext('Removes old stored image cache sizes of themes and plugins not existing on this site. It also removes sizes from inactive plugins.'),
                'alt' => '',
                'hidden' => '<input type="hidden" name="action" value="cleanup_cache_sizes">',
                'rights' => ADMIN_RIGHTS,
                'XSRFTag' => 'CleanupCacheSizes'
        );
        return $buttons;
    }

    static function albumbutton($html, $object, $prefix) {
        $html .= '<hr />';
        if (query_single_row('SELECT * FROM ' . prefix('plugin_storage') . ' WHERE `type`="cacheManager" LIMIT 1')) {
            $disable = '';
            $title = gettext('Finds images that have not been cached and creates the cached versions.');
        } else {
            $disable = ' disabled="disabled"';
            $title = gettext("You must first set the plugin options for cached image parameters.");
        }
        $html .= '<div class="button buttons tooltip" title="' . $title . '"><a href="' . WEBPATH . '/' . ZENFOLDER . '/' . PLUGIN_FOLDER . '/cacheManager/cacheImages.php?album=' . html_encode($object->name) . '&amp;XSRFToken=' . getXSRFToken('cacheImages') . '"' . $disable . '><img src="images/cache.png" />' . gettext('Cache album images') . '</a><br class="clearall" /></div>';
        return $html;
    }

    /**
     * Deletes theme cache sizes of the owner 
     * @param string $owner) Owner of the cache size (theme or extension)
     */
    static function deleteCacheSizes($owner) {
        query('DELETE FROM ' . prefix('plugin_storage') . ' WHERE `type`="cacheManager" AND `aux`=' . db_quote($owner));
    }

    /**
     * @deprecated Zenphoto 1.6 - Use cachemanager::deleteCacheSizes() instead
     * @since Zenphoto 1.5.1
     * @param string $owner Owner of the cache size (theme or extension)
     */
    static function deleteThemeCacheSizes($owner) {
        if (class_exists('cachemanager_internal_deprecations'))
            cachemanager_internal_deprecations::deleteThemeCacheSizes();
        self::deleteCacheSizes($owner);
    }

    /**
     * Removes up all sizes by non existing themes and non active plugins on this install
     */
    static function cleanupCacheSizes() {
        $sizes = cacheManager::getSizes('inactive');
        $sizes_delete = array();
        foreach ($sizes as $size) {
            if (!cacheManager::isValid($size['theme'])) {
                $sizes_delete[] = "'" . $size['theme'] . "'";
            }
        }
        if (!empty($sizes_delete)) {
            $delete = implode(',', $sizes_delete);
            $query = query('DELETE FROM ' . prefix('plugin_storage') . ' WHERE `type`="cacheManager" AND `aux` IN (' . $delete . ')');
        }
    }

    /**
     * Just prints a note if the PHP extension cURL is not available
     */
    static function printCurlNote() {
        if (!function_exists('curl_init') && getOption('cachemanager_generationmode') == 'curl') {
            ?>
            <p class='warningbox'><?php echo gettext('Your server does not support the native PHP extension <code>cURL</code>. Pre-caching images is much more effective using it.'); ?></p>
            <?php
        }
    }

    /**
     * Prints the buttons after you cached image sizes
     * 
     * @param string $returnpage Pageurl to return to
     * @param string $alb Name of the album if caching from an album page
     * @param bool $hidden True if the buttons should be hidden via the css class "hidden" initially.
     */
    static function printButtons($returnpage, $alb = '', $hidden = false) {
        $class = '';
        if ($hidden) {
            $class = ' hidden';
        }
        ?>
        <p class="buttons buttons_cachefinished clearfix<?php echo $class; ?>">
            <a title="<?php echo gettext('Back to the overview'); ?>" href="<?php echo WEBPATH . '/' . ZENFOLDER . $returnpage; ?>"> <img src="<?php echo FULLWEBPATH . '/' . ZENFOLDER; ?>/images/cache.png" alt="" />
                <strong><?php echo gettext("Back"); ?> </strong>
            </a>
            <?php if (is_array(cacheManager::$enabledsizes)) { ?>
                <a title="<?php echo gettext('New cache size selection'); ?>" href="<?php echo WEBPATH . '/' . ZENFOLDER . '/' . PLUGIN_FOLDER; ?>/cacheManager/cacheImages.php?page=overview&tab=images&album=<?php echo $alb; ?>"> <img src="<?php echo FULLWEBPATH . '/' . ZENFOLDER; ?>/images/pass.png" alt="" />
                    <strong><?php echo gettext("New cache size selection"); ?> </strong>
                </a>
            <?php } ?>
        </p>
        <?php
    }

}
ZenphotoCMS 1.5.x API documentation generated by ApiGen