Packages:
default
System
System.Caching
System.Collections
System.Data
System.Data.ActiveRecord
System.Data.ActiveRecord.Relations
System.Data.ActiveRecord.Scaffold
System.Data.ActiveReecord.Scaffold.InputBuilder
System.Data.Commom.Sqlite
System.Data.Common
System.Data.Common.Mssql
System.Data.Common.Mysql
System.Data.Common.Oracle
System.Data.Common.Pgsql
System.Data.Common.Sqlite
System.Data.DataGateway
System.Data.SqlMap
System.Data.SqlMap.Configuration
System.Data.SqlMap.Statements
System.Exceptions
System.I18N
System.IO
System.Security
System.Util
System.Web
System.Web.Services
System.Web.UI
System.Web.UI.ActiveControls
System.Web.UI.WebControls
System.Web.UI.WebControls.assets
System.Xml


Classes:
Keyword

Class TThemeManager

TComponent
   |
   --TApplicationComponent
      |
      --TModule
         |
         --TThemeManager

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.

Since: 3.0
Author: Qiang Xue <qiang.xue@gmail.com>

Method Summary
array
string
string
TTheme
getTheme ( string $name)
void
init ( TXmlElement $config)
Initializes the module.
void
setBasePath ( string $value)
void
setBaseUrl ( string $value)
Methods Inherited From TModule
TModule::getID(), TModule::init(), TModule::setID()
Methods Inherited From TApplicationComponent
TApplicationComponent::getApplication(), TApplicationComponent::getRequest(), TApplicationComponent::getResponse(), TApplicationComponent::getService(), TApplicationComponent::getSession(), TApplicationComponent::getUser(), TApplicationComponent::publishAsset(), TApplicationComponent::publishFilePath()
Methods 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::__get(), TComponent::__set()

Constant Summary
string DEFAULT_BASEPATH default themes base path

Method Details

getAvailableThemes

public array getAvailableThemes ()

Output
array list of available theme names
Exception

getBasePath

public string getBasePath ()

Output
string the base path for all themes. It is returned as an absolute path.
Exception
throwsTConfigurationException if base path is not set and "themes" directory does not exist.

getBaseUrl

public string getBaseUrl ()

Output
string the base URL for all themes.
Exception
throwsTConfigurationException If base URL is not set and a correct one cannot be determined by Prado.

getTheme

public TTheme getTheme (string $name )

Input
string$namename of the theme to be retrieved
Output
TTheme the theme retrieved
Exception

init

public void init (TXmlElement $config )

Initializes the module.

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

Input
TXmlElement$configmodule configuration
Output
Exception

setBasePath

public void setBasePath (string $value )

Input
string$valuethe base path for all themes. It must be in the format of a namespace.
Output
Exception
throwsTInvalidDataValueException if the base path is not a proper namespace.

setBaseUrl

public void setBaseUrl (string $value )

Input
string$valuethe base URL for all themes.
Output
Exception


Constant Details

DEFAULT_BASEPATH

default themes base path

Type:

string

Value:

'themes'