Attaches to the Theme a style collection that will have a global effect on the page look and feel. For example, this could be a style collection affecting the
- body
HTML element.
void
addGlobalStyle
(ref $styleCollection)
-
ref
$styleCollection: object styleCollection The style collection to attach.
Redefined in descendants as:
-
Theme::addGlobalStyle()
: Attaches to the Theme a style collection that will have a global effect on the page look and feel. For example, this could be a style collection affecting the
- body
HTML element.
Registers the specified style collection with the given component type.
void
addStyleForComponentType
(ref $styleCollection, integer $type, integer $index)
-
ref
$styleCollection: object styleCollection The style collection to add.
-
integer
$type: type The type of the component. One of BLANK, HEADING, FOOTER, BLOCK, MENU, MENU_ITEM_LINK_UNSELECTED, MENU_ITEM_LINK_SELECTED, MENU_ITEM_HEADING, OTHER.
-
integer
$index: index The index with which to register the style collection. For a description of the role of indices, see the documentation of
- getStylesForComponentType()
.
Redefined in descendants as:
This method is like
- exportRegisteredSP
but exports all registered stlye properties at the same time. The output is an array whose elements are the inividual export data as returned by
- exportRegisteredSP
.
array
exportAllRegisteredSPs
()
Redefined in descendants as:
-
Theme::exportAllRegisteredSPs()
: This method is like
- exportRegisteredSP
but exports all registered stlye properties at the same time. The output is an array whose elements are the inividual export data as returned by - exportRegisteredSP
.
This methods exports the content of a registered style property object. The output is implementation specific. The only requirement is that if the output of this method is passed as an input to
- importRegisteredSP()
, then the contents of the
- StyleProperty
should not change.
mixed
exportRegisteredSP
(integer $id)
Redefined in descendants as:
-
Theme::exportRegisteredSP()
: This methods exports the content of a registered style property object. The output is implementation specific. The only requirement is that if the output of this method is passed as an input to
- importRegisteredSP()
, then the contents of the - StyleProperty
should not change.
Returns all registered mutable style properties in an array whose indexes are the ids of the style properties (as returned by
- registerSP()
).
ref
getAllRegisteredSPs
()
Redefined in descendants as:
-
Theme::getAllRegisteredSPs()
: Returns all registered mutable style properties in an array whose indexes are the ids of the style properties (as returned by
- registerSP()
).
Returns the component of this
- Theme
.
ref
getComponent
()
Redefined in descendants as:
Returns all CSS code: The CSS code for the Theme, the various component types, the theme component and all sub-components (if any). Theme styles should come first, followed by individual component's styles to allow the latter to take precedence.
string
getCSS
([string $tabs = ""])
-
string
$tabs: tabs This is a string (normally a bunch of tabs) that will be prepended to each text line. This argument is optional but its usage is highly recommended in order to produce a nicely formatted HTML output.
Redefined in descendants as:
-
Theme::getCSS()
: Returns all CSS code: The CSS code for the Theme, the various component types, the theme component and all sub-components (if any). Theme styles should come first, followed by individual component's styles to allow the latter to take precedence.
Returns the description of this Theme.
string
getDescription
()
Redefined in descendants as:
Returns the display name of this Theme.
string
getDisplayName
()
Redefined in descendants as:
Answers the Style Collection that has global effects.
void
getGlobalStyle
(ref 0)
-
ref
0: object styleCollection The style collection to attach.
Returns the HTML string that needs to be printed after successful rendering of components of the given type and index. Note: use of the PreHTML and PostHTML get/set methods is discouraged - use styles instead: see
- addStyleForComponentType()
and
- getStylesForComponentType()
.
string
getPostHTMLForComponentType
(integer $type, integer $index)
-
integer
$type: type The type of the component. One of BLANK, HEADING, FOOTER, BLOCK, MENU, MENU_ITEM_LINK_UNSELECTED, MENU_ITEM_LINK_SELECTED, MENU_ITEM_HEADING, OTHER.
-
integer
$index: index The index that will determine which HTML string to return If the given index is greater than the maximal registered index for the given component type, then the highest index availible will be used.
Redefined in descendants as:
Returns the HTML string that needs to be printed before an attempt is made to render components of the given type and index. Note: use of the PreHTML and PostHTML get/set methods is discouraged - use styles instead: see
- addStyleForComponentType()
and
- getStylesForComponentType()
.
string
getPreHTMLForComponentType
(integer $type, integer $index)
-
integer
$type: type The type of the component. One of BLANK, HEADING, FOOTER, BLOCK, MENU, MENU_ITEM_LINK_UNSELECTED, MENU_ITEM_LINK_SELECTED, MENU_ITEM_HEADING, OTHER.
-
integer
$index: index The index that will determine which HTML string to return If the given index is greater than the maximal registered index for the given component type, then the highest index availible will be used.
Redefined in descendants as:
Returns a
previously registered by
- registerSP()
for the given id.
ref
getRegisteredSP
(integer $id)
-
integer
$id: id The id identifying which StyleProperty to return; as returned by
- registerSP()
.
Redefined in descendants as:
This method returns all style collections for the given component type and the given numeric index.
Each
- Theme
has a set of style collections that correspond to a combination of a component type and a numeric index. For example, the user can define two style collections for components of type BLOCK and index 1 and a totally different set of three style collections for componets of type MENU and index 2.
The index has no semantic meaning: you can think of the index as 'level' of the component. Alternatively, the index could serve as means of distinguishing between components with the same type. For example, a BLOCK component with index 2 will normally have a different set of style collections than a BLOCK component with index 1.
Another way of interpreting the index is drawing a parallel to the HTML headings <h1>, <h2>, <h3>, ..., where the lower the index, the more "prominent" the look of the component.
The style collections would be normally set by the
- setStyleForComponentType()
method in the Theme constructor.
ref
getStylesForComponentType
(integer $type, integer $index)
-
integer
$type: type The type of the component. One of BLANK, HEADING, FOOTER, BLOCK, MENU, MENU_ITEM_LINK_UNSELECTED, MENU_ITEM_LINK_SELECTED, MENU_ITEM_HEADING, OTHER.
-
integer
$index: index The index that will determine which style collections to return. If the given index is greater than the maximal registered index for the given component type, then the highest index availible will be used.
Redefined in descendants as:
Imports the contents of a registered mutable
- StyleProperty
.
The input to this method should be an output obtained from calling
- exportRegisteredSP
on the same
- StyleProperty
.
ref
importRegisteredSP
(integer $id, mixed $importData)
Redefined in descendants as:
Prints the HTML page.
void
printPage
()
Redefined in descendants as:
Adds the given StyleProperty to the internally maintained list of mutable
(updateable) style properties and assigns it an id. This method and the
- getRegisteredSP
method enable the user to quickly change the values of key Theme settings. For example, let us assume that Bob has created his own theme and he has added a global style collection for the main content block. Bob would like to allow the user to change the width property of that collection. In order to do so, Bob needs to call
- registerSP()
and pass the WidthSP object accordingly. This WidthSP object must be the same object that had been added to the aforementioned global style collection. The user now can call
- getRegisteredSP
with the id that was returned by
- registerSP
and access/modify the
- WidthSP
object.
integer
registerSP
(ref $sp, string $postImportMethod)
-
ref
$sp: object sp The StyleProperty object that will be registered as mutable within this Theme.
-
string
$postImportMethod: postImportMethod This is the name of the method that will be called after this SP is imported. This can be useful in case other properties depend on the content of this property, but the user does not to export all of them.
Redefined in descendants as:
-
Theme::registerSP()
: Adds the given StyleProperty to the internally maintained list of mutable
Sets the component of this
- Theme
.
void
setComponent
(ref $component)
-
ref
$component: object A component.
Redefined in descendants as:
Sets the description of this Theme.
void
setDescription
(string $description)
-
string
$description: description The new description of this Theme.
Redefined in descendants as:
Sets the display name of this Theme.
void
setDisplayName
(string $displayName)
-
string
$displayName: displayName The new display name of this Theme.
Redefined in descendants as:
Sets the HTML string that needs to be printed after successful rendering of components of the given type and index. Note: use of the PreHTML and PostHTML get/set methods is discouraged - use styles instead: see
- addStyleForComponentType()
and
- getStylesForComponentType()
.
void
setPostHTMLForComponentType
(string $html, integer $type, integer $index)
-
string
$html: html The HTML code to use.
-
integer
$type: type The type of the component. One of BLANK, HEADING, FOOTER, BLOCK, MENU, MENU_ITEM_LINK_UNSELECTED, MENU_ITEM_LINK_SELECTED, MENU_ITEM_HEADING, OTHER.
-
integer
$index: index The index with which to register the HTML string. For a description of the role of indices, see the documentation of
- getStylesForComponentType()
.
Redefined in descendants as:
Sets the HTML string that needs to be printed before an attempt is made to render components of the given type and index. Note: use of the PreHTML and PostHTML get/set methods is discouraged - use styles instead: see
- addStyleForComponentType()
and
- getStylesForComponentType()
.
void
setPreHTMLForComponentType
(string $html, integer $type, integer $index)
-
string
$html: html The HTML code to use.
-
integer
$type: type The type of the component. One of BLANK, HEADING, FOOTER, BLOCK, MENU, MENU_ITEM_LINK_UNSELECTED, MENU_ITEM_LINK_SELECTED, MENU_ITEM_HEADING, OTHER.
-
integer
$index: index The index with which to register the HTML string. For a description of the role of indices, see the documentation of
- getStylesForComponentType()
.
Redefined in descendants as: