Class TThemeManager

Description

TThemeManager class

TThemeManager manages the themes used in a Prado application.

Themes are stored under the directory specified by the BasePath property. The themes can be accessed via URL BaseUrl. Each theme is represented by a subdirectory and all the files under that directory. The name of a theme is the name of the corresponding subdirectory. By default, the base path of all themes is a directory named "themes" under the directory containing the application entry script. To get a theme (normally you do not need to), call getTheme.

TThemeManager may be configured within page service tag in application configuration file as follows, <module id="themes" class="System.Web.UI.TThemeManager" BasePath="Application.themes" BaseUrl="/themes" /> where getCacheExpire, getCacheControl and getBufferOutput are configurable properties of THttpResponse.

  • author: Qiang Xue <qiang.xue@gmail.com>
  • version: $Id: TThemeManager.php 3035 2011-08-30 13:58:52Z GODZilla0480@gmail.com $
  • since: 3.0

Located in /Web/UI/TThemeManager.php (line 41)

TComponent
   |
   --TApplicationComponent
      |
      --TModule
         |
         --TThemeManager
Class Constant Summary
 DEFAULT_BASEPATH = 'themes'
 DEFAULT_THEMECLASS = 'TTheme'
Method Summary
string getBasePath ()
string getBaseUrl ()
TTheme getTheme (string $name)
string getThemeClass ()
void init (TXmlElement $config)
void setBasePath (string $value)
void setBaseUrl (string $value)
void setThemeClass (string|null $class)
Methods
getAvailableThemes (line 114)
  • return: list of available theme names
  • access: public
array getAvailableThemes ()
getBasePath (line 132)
  • return: the base path for all themes. It is returned as an absolute path.
  • throws: TConfigurationException if base path is not set and "themes" directory does not exist.
  • access: public
string getBasePath ()
getBaseUrl (line 164)
  • return: the base URL for all themes.
  • throws: TConfigurationException If base URL is not set and a correct one cannot be determined by Prado.
  • access: public
string getBaseUrl ()
getTheme (line 90)
  • return: the theme retrieved
  • access: public
TTheme getTheme (string $name)
  • string $name: name of the theme to be retrieved
getThemeClass (line 107)
  • return: Theme class name in namespace format. Defaults to DEFAULT_THEMECLASS.
  • access: public
string getThemeClass ()
init (line 76)

Initializes the module.

This method is required by IModule and is invoked by application.

  • access: public
void init (TXmlElement $config)

Redefinition of:
TModule::init()
Initializes the module.
setBasePath (line 148)
  • throws: TInvalidDataValueException if the base path is not a proper namespace.
  • access: public
void setBasePath (string $value)
  • string $value: the base path for all themes. It must be in the format of a namespace.
setBaseUrl (line 181)
  • access: public
void setBaseUrl (string $value)
  • string $value: the base URL for all themes.
setThemeClass (line 100)
  • access: public
void setThemeClass (string|null $class)
  • string|null $class: Theme class name in namespace format

Inherited Methods

Inherited From TModule

TModule::getID()
TModule::init()
TModule::setID()

Inherited From TApplicationComponent

TApplicationComponent::getApplication()
TApplicationComponent::getRequest()
TApplicationComponent::getResponse()
TApplicationComponent::getService()
TApplicationComponent::getSession()
TApplicationComponent::getUser()
TApplicationComponent::publishAsset()
TApplicationComponent::publishFilePath()

Inherited From TComponent

TComponent::addParsedObject()
TComponent::attachEventHandler()
TComponent::canGetProperty()
TComponent::canSetProperty()
TComponent::createdOnTemplate()
TComponent::detachEventHandler()
TComponent::evaluateExpression()
TComponent::evaluateStatements()
TComponent::getEventHandlers()
TComponent::getSubProperty()
TComponent::hasEvent()
TComponent::hasEventHandler()
TComponent::hasProperty()
TComponent::raiseEvent()
TComponent::setSubProperty()
TComponent::__call()
TComponent::__get()
TComponent::__set()
TComponent::__sleep()
TComponent::__wakeup()
Class Constants
DEFAULT_BASEPATH = 'themes' (line 46)

default themes base path

DEFAULT_THEMECLASS = 'TTheme' (line 51)

default theme class

Documentation generated on Mon, 25 Jun 2012 14:39:30 +0200 by phpDocumentor 1.4.3