Class TTheme

Description

Implements interfaces:

TTheme class

TTheme represents a particular theme. It is merely a collection of skins that are applicable to the corresponding controls.

Each theme is stored as a directory and files under that directory. The theme name is the directory name. When TTheme is created, the files whose name has the extension ".skin" are parsed and saved as controls skins.

A skin is essentially a list of initial property values that are to be applied to a control when the skin is applied. Each type of control can have multiple skins identified by the SkinID. If a skin does not have SkinID, it is the default skin that will be applied to controls that do not specify particular SkinID.

Whenever possible, TTheme will try to make use of available cache to save the parsing time.

To apply a theme to a particular control, call applySkin.

  • since: 3.0
  • version: $Id: TThemeManager.php 2112 2007-08-06 18:58:55Z xue $
  • author: Qiang Xue <qiang.xue@gmail.com>

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

TComponent
   |
   --TApplicationComponent
      |
      --TTheme
Class Constant Summary
 SKIN_FILE_EXT = '.skin'
 THEME_CACHE_PREFIX = 'prado:theme:'
Method Summary
boolean applySkin (TControl $control)
string getBasePath ()
string getBaseUrl ()
string getName ()
void setBasePath (string $value)
void setBaseUrl (string $value)
void setJavaScriptFiles (array $value)
void setName (string $value)
void setStyleSheetFiles (array $value)
TTheme __construct (string $themePath, string $themeUrl)
Methods
applySkin (line 380)

Applies the theme to a particular control.

The control's class name and SkinID value will be used to identify which skin to be applied. If the control's SkinID is empty, the default skin will be applied.

  • return: if a skin is successfully applied
  • access: public
  • throws: TConfigurationException if any error happened during the skin application
boolean applySkin (TControl $control)
  • TControl $control: the control to be applied with a skin
getBasePath (line 358)
  • return: the file path to the theme folder
  • access: public
string getBasePath ()
getBaseUrl (line 342)
  • return: the URL to the theme folder (without ending slash)
  • access: public
string getBaseUrl ()
getJavaScriptFiles (line 463)
  • return: list of Javascript files (URL) in the theme
  • access: public
array getJavaScriptFiles ()
getName (line 326)
  • return: theme name
  • access: public
string getName ()
getStyleSheetFiles (line 447)
  • return: list of CSS files (URL) in the theme
  • access: public
array getStyleSheetFiles ()
setBasePath (line 366)
  • access: protected
void setBasePath (string $value)
  • string $value: tthe file path to the theme folder
setBaseUrl (line 350)
  • access: protected
void setBaseUrl (string $value)
  • string $value: the URL to the theme folder
setJavaScriptFiles (line 471)
  • access: protected
void setJavaScriptFiles (array $value)
  • array $value: list of Javascript files (URL) in the theme
setName (line 334)
  • access: protected
void setName (string $value)
  • string $value: theme name
setStyleSheetFiles (line 455)
  • access: protected
void setStyleSheetFiles (array $value)
  • array $value: list of CSS files (URL) in the theme
Constructor __construct (line 230)

Constructor.

  • access: public
  • throws: TConfigurationException if theme path does not exist or any parsing error of the skin files
TTheme __construct (string $themePath, string $themeUrl)
  • string $themePath: theme path
  • string $themeUrl: theme URL

Inherited Methods

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::__get()
TComponent::__set()
Class Constants
SKIN_FILE_EXT = '.skin' (line 198)

Extension name of skin files

THEME_CACHE_PREFIX = 'prado:theme:' (line 194)

prefix for cache variable name used to store parsed themes

Documentation generated on Mon, 21 Apr 2008 11:36:36 -0400 by phpDocumentor 1.3.0RC4