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 1538 2006-12-01 21:39:16Z 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
TTheme __construct (string $themePath, string $themeUrl)
boolean applySkin (TControl $control)
string getBasePath ()
string getBaseUrl ()
string getName ()
Methods
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
applySkin (line 356)

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 342)
  • return: the file path to the theme folder
  • access: public
string getBasePath ()
getBaseUrl (line 334)
  • return: the URL to the theme folder (without ending slash)
  • access: public
string getBaseUrl ()
getJavaScriptFiles (line 431)
  • 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 423)
  • return: list of CSS files (URL) in the theme
  • access: public
array getStyleSheetFiles ()

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 Sun, 14 Jan 2007 21:44:49 -0500 by phpDocumentor 1.3.0RC4