Omeka_Controller_Plugin_ViewScripts

class Omeka_Controller_Plugin_ViewScripts

Package: Controller\Plugin

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

property _view

Registered view object.

property _dbOptions

List of options from the database.

property _baseThemePath

Base path to themes directory.

property _webBaseThemePath

Base web-accesible path to themes.

property _pluginMvc

MVC plugin behaviors class.

__construct(array $options, Omeka_Plugin_Mvc $pluginMvc)
Parameters:
  • $options (array) – List of options.
  • $pluginMvc (Omeka_Plugin_Mvc) – Plugin MVC class.
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

_setupPathsForPlugin(string $pluginModuleName, string $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 needsto 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

_setupPathsForTheme(string $themeType)

Set up the asset paths for the theme.

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

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

void

_addPluginPaths(string $themeType, string $pluginModuleName)

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

_addPathToView(string $scriptPath)

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

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

void

_getView()

Gets the view from the registry.

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

Returns:Zend_View
_addSharedViewsDir()

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

Returns:void
_addThemePaths(string $theme)

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

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

void

_addOverridePathForPlugin(string $theme, string $pluginModuleName)

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

Parameters:
  • $theme (string) – Theme type; ‘public’ or ‘admin’
  • $pluginModuleName (string) –
getThemeOption(string $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

Project Versions

Previous topic

Omeka_Controller_Plugin_Upgrade

Next topic

Libraries/Omeka/Db

This Page