Omeka_Controller_Plugin_ViewScripts

Package: Controller\Plugin

class Omeka_Controller_Plugin_ViewScripts

extends Zend_Controller_Plugin_Abstract

Sets up view script search paths on a per-request basis.

property Omeka_Controller_Plugin_ViewScripts::$_view

protected Zend_View

Registered view object.

property Omeka_Controller_Plugin_ViewScripts::$_dbOptions

protected array

List of options from the database.

property Omeka_Controller_Plugin_ViewScripts::$_baseThemePath

protected string

Base path to themes directory.

property Omeka_Controller_Plugin_ViewScripts::$_webBaseThemePath

protected string

Base web-accesible path to themes.

property Omeka_Controller_Plugin_ViewScripts::$_pluginMvc

protected Omeka_Plugin_Mvc

MVC plugin behaviors class.

Omeka_Controller_Plugin_ViewScripts::__construct($options, Omeka_Plugin_Mvc $pluginMvc)
Parameters:
  • $options (array) – List of options.
  • $pluginMvc (Omeka_Plugin_Mvc) – Plugin MVC class.
Omeka_Controller_Plugin_ViewScripts::preDispatch(Zend_Controller_Request_Abstract $request)

Add the appropriate view scripts directories for a given request. This is pretty much the glue between the plugin broker and the View object, since it uses data from the plugin broker to determine what script paths will be available to the view.

Parameters:
  • $request (Zend_Controller_Request_Abstract) – Request object.
Returns:

void

Omeka_Controller_Plugin_ViewScripts::_setupPathsForPlugin($pluginModuleName, $themeType)

Set up the asset paths for a plugin.

If you’re in a plugin, check in this order: 1. plugin view scripts (only for that plugin) 2. plugin view scripts for other plugins 3. theme view scripts

This means that it needs to add the paths in the reverse order of what needs to be checked first, so theme paths first and then plugin paths.

Parameters:
  • $pluginModuleName (string) – The module name for the plugin.
  • $themeType (string) – The type of theme: ‘admin’ or ‘public’.
Returns:

void

Omeka_Controller_Plugin_ViewScripts::_setupPathsForTheme($themeType)

Set up the asset paths for the theme.

If you’re in one of the themes, check in this order: 1. theme view scripts 2. all plugin view scripts

Parameters:
  • $themeType (string) – The type of theme: ‘admin’ or ‘public’.
Returns:

void

Omeka_Controller_Plugin_ViewScripts::_addPluginPaths($themeType, $pluginModuleName = null)

Add asset paths for a plugin.

Parameters:
  • $themeType (string) – The type of theme: ‘admin’ or ‘public’.
  • $pluginModuleName (string) – The module name for the plugin.
Returns:

void

Omeka_Controller_Plugin_ViewScripts::_addPathToView($scriptPath)

Add a new script path for a plugin to the view.

Parameters:
  • $scriptPath (string) – Path from plugins dir to script dir.
Returns:

void

Omeka_Controller_Plugin_ViewScripts::_getView()

Gets the view from the registry.

The initial call to the registry caches the view in this class.

Returns:Zend_View
Omeka_Controller_Plugin_ViewScripts::_addSharedViewsDir()

Add the global views from the view scripts directory to the view.

Returns:void
Omeka_Controller_Plugin_ViewScripts::_addThemePaths($theme)

Add script and asset paths for a theme to the view.

Parameters:
  • $theme (string) – Theme type; either ‘public’ or ‘admin’.
Returns:

void

Omeka_Controller_Plugin_ViewScripts::_addOverridePathForPlugin($theme, $pluginModuleName)

Add theme view path for override views for a given plugin.

Parameters:
  • $theme (string) – Theme type; ‘public’ or ‘admin’
  • $pluginModuleName (string) –
Omeka_Controller_Plugin_ViewScripts::getThemeOption($type)

Retrieve the option from the database that contains the directory of the theme to render.

Parameters:
  • $type (string) – Currently either ‘admin’ or ‘public’.
Returns:

string