phpDocumentor GalleryCore
Classes
[ class tree: GalleryCore ] [ index: GalleryCore ] [ all elements ]

Class: GalleryTheme

Source Location: /modules/core/classes/GalleryTheme.class

Class GalleryTheme

Direct descendents
Child Class Description
RatingTestTheme Test theme
ShowItemTestTheme Test theme
TestThemeId1Theme Test Theme that fails to validate settings
TestThemeId2Theme Test Theme that successfully validates settings
ThemeTestTheme Test theme
ConfirmImportControllerTestTheme Test theme
KeyAlbumTestTheme Test theme
DynamicAlbumTestTheme Test theme
ClassicTheme Theme with columns for thumbnails, item info and subalbum links
HybridTheme Theme combining thumb-view, image-view and slideshow into a single dynamic page
SliderTheme Theme with combined image view, scrollable thumbnails and slideshow.
SiriuxTheme Siriux.net Gallery theme
MatrixTheme Standard gallery theme
FloatrixTheme Variable column theme based on Matrix
AjaxianTheme DHTML-enabled slideshow theme
TileTheme Theme with a tiled background image and image thumbnails on top of it.
CarbonTheme Carbon theme

[ Top ]
Inherited Properties, Constants, and Methods
Inherited Properties Inherited Methods Inherited Constants

Inherited From GalleryPlugin

GalleryPlugin::$_description
GalleryPlugin::$_id
GalleryPlugin::$_l10Domain
GalleryPlugin::$_name
GalleryPlugin::$_requiredCoreApi
GalleryPlugin::$_version

Inherited From GalleryPlugin

GalleryPlugin::activate()
Activate this plugin
GalleryPlugin::deactivate()
Deactivate this plugin.
GalleryPlugin::fetchParameters()
Fetch all plugin specific parameters for the given item. The results will contain a mixture of global parameters and item specific parameters, where the item specific ones ones override the global ones.
GalleryPlugin::getDescription()
GalleryPlugin::getId()
GalleryPlugin::getL10Domain()
GalleryPlugin::getName()
GalleryPlugin::getParameter()
Convenience method to get a plugin parameter
GalleryPlugin::getPluginType()
GalleryPlugin::getRequiredCoreApi()
GalleryPlugin::getVersion()
GalleryPlugin::installOrUpgrade()
Perform the plugin installation or upgrade, whatever is required.
GalleryPlugin::isActive()
Is this plugin active?
GalleryPlugin::reactivate()
Reactivate this plugin. The plugin is already active, so call deactivate() and then activate(). Perform the deactivation without sending an event because the activation will immediately follow and we don't want other plugins to sense this deactivation and deactivate themselves. If the plugin isn't currently active, don't do anything.
GalleryPlugin::removeParameter()
Convenience method to remove a plugin parameter
GalleryPlugin::setDescription()
GalleryPlugin::setId()
GalleryPlugin::setName()
GalleryPlugin::setParameter()
Convenience method to set a plugin parameter
GalleryPlugin::setRequiredCoreApi()
GalleryPlugin::setVersion()
GalleryPlugin::translate()
Localize the given content.
GalleryPlugin::uninstall()
Remove this plugin's parameters
GalleryPlugin::upgrade()
Perform any upgrade tasks required at this point. This method is called
GalleryPlugin::_flushPluginCache()
Flush plugin-related caches.
GalleryPlugin::_postDeactivationEvent()
Post a deactivation event for this plugin. Used by deactivate and reactivate.

[ Top ]
Property Summary
boolean   $_cacheablePage   Is the page we're rendering cacheable?
array   $_requiredThemeApi   The version of the GalleryTheme API required by this theme.
array   $_standardSettings   Which of the standard theme settings this theme supports.

[ Top ]
Method Summary
GalleryTheme   GalleryTheme()   Constructor to prevent PHP Notices in upgrader and AdminThemes.inc when old themes with a theme.inc are still in the themes folder. The old themes call $this->GalleryTheme() in their constructor.
void   activate()  
void   deactivate()  
array   getApiVersion()   Return the major and minor version of the GalleryTheme API.
int   getPageSize()   Return the number of items per page, or 0 if there is no pagination in this theme.
void   getPluginType()  
void   getRequiredThemeApi()  
array   getSettings()   Return the possible settings that a theme can specify on a global or per item basis. Used for theme with simple settings (@see isAdvancedSettings)
void   getStandardSettings()  
array   handleSettingsRequest()   Let the theme handle the incoming request. Used for theme with advanced settings.
GalleryStatus   installOrUpgrade()   Perform the module installation or upgrade, whatever is required. It will do the following:
  1. Get the current version of the theme (if its already installed)
  2. Let the theme perform any necessary upgrade tasks.
boolean   isAdvancedSettings()   Return whether the theme uses simple or advanced settings. To support simple settings the theme needs to implement getSettings and validateSettings To support advanced settings the theme must implement loadSettingsTemplate and handleSettingsRequest.
GalleryStatus   loadCommonTemplateData()   Load commonly used data into theme template.
array   loadSettingsTemplate()   Load the template with data to define the theme settings. Used for theme with advanced settings.
array   loadTemplate()   Load the template with data from this view.
mixed   packSetting()   Convert a setting from a string format into a PHP native format. The string format is
GalleryStatus   preloadBlock()   Call preload for given block if the module is active and a preload exists.
void   setRequiredThemeApi()  
void   setStandardSettings()  
array   showAdminPage()   Load all the necessary template data to render a page for an administrative (or other) view.
array   showAlbumPage()   Load all the necessary template data to render a page for an album.
array   showErrorPage()   Load all the necessary template data to render an error page.
array   showModulePage()   Load all the necessary template data to render a page for a module view (any views that aren't user, site, or item admin eg slideshow or members list).
array   showPhotoPage()   Load all the necessary template data to render a page for a single item.
array   showProgressBarPage()   Load all the necessary template data to render a progress bar page.
array('headHtml'   splitHtml()   Split the HTML content into its various component pieces.
GalleryStatus   uninstall()   Remove this theme from all albums.
string   unpackSetting()   Unpack a packed setting.
array   validateSettings()   Check the values of the settings for legality. If there are errors, return an array of localized error messages to display for each invalid setting. Used for theme with simple settings (@see isAdvancedSettings)
void   _sortItemLinks()   Sort an array of associative arrays on the 'text' key.

[ Top ]
Properties
boolean   $_cacheablePage = false [line 61]

Is the page we're rendering cacheable?

API Tags:
Access:  private


[ Top ]
array   $_requiredThemeApi [line 47]

The version of the GalleryTheme API required by this theme.

API Tags:
Access:  private


[ Top ]
array   $_standardSettings = array() [line 54]

Which of the standard theme settings this theme supports.

API Tags:
Access:  private


[ Top ]
Methods
Constructor GalleryTheme  [line 69]

  GalleryTheme GalleryTheme( )

Constructor to prevent PHP Notices in upgrader and AdminThemes.inc when old themes with a theme.inc are still in the themes folder. The old themes call $this->GalleryTheme() in their constructor.



[ Top ]
activate  [line 507]

  void activate( [ $postActivationEvent = true]  )

Parameters:
   $postActivationEvent: 

API Tags:
See:  GalleryPlugin::activate


Redefinition of:
GalleryPlugin::activate()
Activate this plugin

[ Top ]
deactivate  [line 699]

  void deactivate( [ $postDeactivationEvent = true]  )

Parameters:
   $postDeactivationEvent: 

API Tags:
See:  GalleryPlugin::deactivate


Redefinition of:
GalleryPlugin::deactivate()
Deactivate this plugin.

[ Top ]
getApiVersion  [line 82]

  array getApiVersion( )

Return the major and minor version of the GalleryTheme API.

This follows the same rules as the core API


API Tags:
Return:  major number, minor number
See:  GalleryCoreApi::getApiVersion

Information Tags:
Todo:  On the next major API bump:
  • Remove backwards compatible CSS from lib/javascript/AutoComplete.js

[ Top ]
getPageSize  [line 1867]

  int getPageSize( array $params  )

Return the number of items per page, or 0 if there is no pagination in this theme.

Parameters:
array   $params:  the theme parameters


Redefined in descendants as:

[ Top ]
getPluginType  [line 2011]

  void getPluginType( )


API Tags:
See:  GalleryPlugin::getPluginType


Redefinition of:
GalleryPlugin::getPluginType()

[ Top ]
getRequiredThemeApi  [line 2019]

  void getRequiredThemeApi( )



[ Top ]
getSettings  [line 116]

  array getSettings( [int $itemId = null]  )

Return the possible settings that a theme can specify on a global or per item basis. Used for theme with simple settings (@see isAdvancedSettings)

Each setting contains: key: a unique identifier name: a localized, displayable text string type: single-select, multiple-select, text-field choices: [only valid for single-select, multiple-select type] array of: keys: unique identifier within this set of choices values: localized displayable text string value: the current value for this setting

Parameters:
int   $itemId:  (optional)

API Tags:
Return:  GalleryStatus a status code settings array params array (useful for a theme overriding this function)


Redefined in descendants as:

[ Top ]
getStandardSettings  [line 2027]

  void getStandardSettings( )



[ Top ]
handleSettingsRequest  [line 500]

  array handleSettingsRequest( array $form, [int $itemId = null]  )

Let the theme handle the incoming request. Used for theme with advanced settings.

Parameters:
array   $form:  the form values
int   $itemId:  the item id or null for site wide settings

API Tags:
Return:  GalleryStatus a status code array error messages string status message (itemId!=null) or status key (itemId==null)
See:  GalleryController::handleRequest
See:  GalleryTheme::isAdvancedSettings()


Redefined in descendants as:

[ Top ]
installOrUpgrade  [line 562]

  GalleryStatus installOrUpgrade( )

Perform the module installation or upgrade, whatever is required. It will do the following:

  1. Get the current version of the theme (if its already installed)
  2. Let the theme perform any necessary upgrade tasks.

3. Set the new theme version and api requirements into the database

Themes should not need to override this method. Instead they should override the upgrade method and put all their theme specific logic there


API Tags:
Return:  a status code


Redefinition of:
GalleryPlugin::installOrUpgrade()
Perform the plugin installation or upgrade, whatever is required.

[ Top ]
isAdvancedSettings  [line 93]

  boolean isAdvancedSettings( )

Return whether the theme uses simple or advanced settings. To support simple settings the theme needs to implement getSettings and validateSettings To support advanced settings the theme must implement loadSettingsTemplate and handleSettingsRequest.


API Tags:
Return:  true for advanced settings, false for simple


Redefined in descendants as:

[ Top ]
loadCommonTemplateData  [line 1130]

  GalleryStatus loadCommonTemplateData( &$template, GalleryItem $item, array $params, array $dataToLoad, [array $childIds = array()], [boolean $useCache = true], GalleryTemplate $template  )

Load commonly used data into theme template.

Always loaded: item item data children array of child item data Available keys to include in $dataToLoad parameter: owner = item owner data ^if childIds non-empty also fill ownerMap with array of ownerId => owner data viewCount = number of views for item ^if childIds non-empty also set viewCount on each child item childCount = number of children for item ^if childIds non-empty also set childCount on each child item that canContainChildren descendentCount = number of descendents for item ^if childIds non-empty also set descendentCount on each child that canContainChildren parents = array of ancestor data; also set parent key (direct parent data) systemLinks = array of array('text'=>.., 'params'=>.., 'moduleId'=>..) itemLinks = array of id => array('text'=>.., 'params'=>.., 'moduleId'=>..) ^if childIds non-empty also set itemLinks on each child item childItemLinksDetailed = boolean. true if you want detailed item links for children. you always get detailed item links for the current item itemSummaries = set itemSummaries (array of moduleId => html) on each child item thumbnails = if childIds non-empty then set thumbnail on each child item pageNavigator = calculate URLs for first/back/next/last links for album page navigation itemNavigator = calculate URLs for first/back/next/last links for photo navigation navThumbnails = load the thumbnails for itemNavigator items jumpRange = calculate page URLs for inter-album navigation (eg, "page: 1, 2 .. 7, 8") Include 'pageWindowSize'=># in $params to override default of 6 imageViews = loads entity data for resizes and source images, suitable for display when viewing a single image: 'imageViews' => derivatives, 'sourceImage' => data item, ^ contains 'viewInline' boolean, specifying if it can be displayed inline ^ contains 'itemTypeName' string, the type of item ^ contains 'isSource' member 'imageViewsIndex' => index to the resize currently displayed 'sourceImageViewIndex' => index to the source currently displayed 'fullSizeDimensions' => a string with dimensions of the orig. (eg, "640x480") permissions array of item permissions, respecting the guest mode flag. Periods in permissions have been converted to underscores to make them more Smarty friendly, so if you want to check a permission in smarty you'd do: {if isset($theme.permissions.core_addDataItem)}

Parameters:
GalleryTemplate   $template: 
GalleryItem   $item:  the item to display
array   $params:  theme parameters
array   $dataToLoad:  (string data key, ..) data to load into template
array   $childIds:  (optional) ids of child items to display
boolean   $useCache:  (optional)
   &$template: 

API Tags:
Return:  a status code


[ Top ]
loadSettingsTemplate  [line 484]

  array loadSettingsTemplate( &$template, &$form, [int $itemId = null], GalleryTemplate $template, array $form  )

Load the template with data to define the theme settings. Used for theme with advanced settings.

Parameters:
GalleryTemplate   $template: 
array   $form:  array the form values
int   $itemId:  the item id or null for site wide settings
   &$template: 
   &$form: 

API Tags:
Return:  GalleryStatus a status code string path to the body template
See:  GalleryTheme::isAdvancedSettings()


Redefined in descendants as:

[ Top ]
loadTemplate  [line 735]

  array loadTemplate( GalleryView $view, &$template, GalleryItem $item, array $params, array $viewResults, GalleryTemplate $template  )

Load the template with data from this view.

Parameters:
GalleryView   $view: 
GalleryTemplate   $template: 
GalleryItem   $item:  the item to display
array   $params:  theme parameters
array   $viewResults:  results from the view
   &$template: 

API Tags:
Return:  GalleryStatus a status code array ('body' => string template or 'redirect' => array)


[ Top ]
packSetting  [line 369]

  mixed packSetting( string $packType, string $value  )

Convert a setting from a string format into a PHP native format. The string format is

something that could be passed to the browser, like: [I like [eggs bacon]] The packed format might be: array("I like", array("eggs", "bacon"))

The specific packing depends on the packType variable.

Parameters:
string   $packType: 
string   $value:  the input value

API Tags:
Return:  the packed form


[ Top ]
preloadBlock  [line 1050]

  GalleryStatus preloadBlock( &$template, string $blockId, [array $blockParams = array()], GalleryTemplate $template  )

Call preload for given block if the module is active and a preload exists.

Parameters:
GalleryTemplate   $template: 
string   $blockId:  (module.blockName)
array   $blockParams:  (optional) block parameters
   &$template: 

API Tags:
Return:  a status code


Redefined in descendants as:

[ Top ]
setRequiredThemeApi  [line 2015]

  void setRequiredThemeApi( $requirement  )

Parameters:
   $requirement: 


[ Top ]
setStandardSettings  [line 2023]

  void setStandardSettings( $standardSettings  )

Parameters:
   $standardSettings: 


[ Top ]
showAdminPage  [line 1919]

  array showAdminPage( &$template, GalleryItem $item, array $params, string $templateFile, GalleryTemplate $template  )

Load all the necessary template data to render a page for an administrative (or other) view.

Parameters:
GalleryTemplate   $template: 
GalleryItem   $item:  the item to render
array   $params:  the theme parameters
string   $templateFile:  the body template file from the view
   &$template: 

API Tags:
Return:  GalleryStatus a status code string path to a template file or array(html/redirect)
Access:  private


Redefined in descendants as:

[ Top ]
showAlbumPage  [line 1890]

  array showAlbumPage( &$template, GalleryAlbumItem $item, array $params, int $childIds, GalleryTemplate $template  )

Load all the necessary template data to render a page for an album.

Parameters:
GalleryTemplate   $template: 
GalleryAlbumItem   $item:  the album item to render
array   $params:  the theme parameters
int   $childIds:  the child item ids
   &$template: 

API Tags:
Return:  GalleryStatus a status code string path to a template file or array(html/redirect)
Access:  private


Redefined in descendants as:

[ Top ]
showErrorPage  [line 1947]

  array showErrorPage( &$template, GalleryTemplate $template  )

Load all the necessary template data to render an error page.

Parameters:
GalleryTemplate   $template: 
   &$template: 

API Tags:
Return:  GalleryStatus a status code string path to a template file or array(html/redirect)
Access:  private


Redefined in descendants as:

[ Top ]
showModulePage  [line 1935]

  array showModulePage( &$template, GalleryItem $item, array $params, string $templateFile, GalleryTemplate $template  )

Load all the necessary template data to render a page for a module view (any views that aren't user, site, or item admin eg slideshow or members list).

Parameters:
GalleryTemplate   $template: 
GalleryItem   $item:  the item to render
array   $params:  the theme parameters
string   $templateFile:  the body template file from the view
   &$template: 

API Tags:
Return:  GalleryStatus a status code string path to a template file or array(html/redirect)
Access:  private


Redefined in descendants as:

[ Top ]
showPhotoPage  [line 1904]

  array showPhotoPage( &$template, GalleryItem $item, array $params, GalleryTemplate $template  )

Load all the necessary template data to render a page for a single item.

Parameters:
GalleryTemplate   $template: 
GalleryItem   $item:  the item to render, can be any subclass of GalleryItem
array   $params:  the theme parameters
   &$template: 

API Tags:
Return:  GalleryStatus a status code string path to a template file or array(html/redirect)
Access:  private


Redefined in descendants as:

[ Top ]
showProgressBarPage  [line 1961]

  array showProgressBarPage( &$template, GalleryItem $item, array $params, GalleryTemplate $template  )

Load all the necessary template data to render a progress bar page.

Parameters:
GalleryTemplate   $template: 
GalleryItem   $item:  the item to render
array   $params:  the theme parameters
   &$template: 

API Tags:
Return:  GalleryStatus a status code string path to a template file or array(html/redirect)
Access:  private


Redefined in descendants as:

[ Top ]
splitHtml  [line 1972]

  array('headHtml' splitHtml( string $mainHtml, array $extraHtml  )

Split the HTML content into its various component pieces.

Parameters:
string   $mainHtml:  the main html (<head>, <body>, etc)
array   $extraHtml:  any extra html that we've generated, like sidebar HTML

API Tags:
Return:  => ..., 'bodyHtml' => ...)


[ Top ]
uninstall  [line 644]

  GalleryStatus uninstall( )

Remove this theme from all albums.


API Tags:
Return:  a status code


Redefinition of:
GalleryPlugin::uninstall()
Remove this plugin's parameters

[ Top ]
unpackSetting  [line 427]

  string unpackSetting( string $packType, mixed $value  )

Unpack a packed setting.

Parameters:
string   $packType: 
mixed   $value:  the packed value

API Tags:
Return:  the unpacked value
See:  GalleryTheme::packSetting


[ Top ]
validateSettings  [line 308]

  array validateSettings( array $settings  )

Check the values of the settings for legality. If there are errors, return an array of localized error messages to display for each invalid setting. Used for theme with simple settings (@see isAdvancedSettings)

Parameters:
array   $settings:  array('key' => array(value, ...), ...)

API Tags:
Return:  errors in the form of array('key' => 'translated text', ...)


Redefined in descendants as:

[ Top ]
_sortItemLinks  [line 1857]

  void _sortItemLinks( $a, $b  )

Sort an array of associative arrays on the 'text' key.

Parameters:
   $a: 
   $b: 

API Tags:
Access:  private


[ Top ]

Documentation generated on Fri, 08 Oct 2010 05:05:50 -0700 by phpDocumentor 1.3.0RC6