Regular page

deprecated 2012-03-10 This class is not longer supported.
author Timo A. Hummel
package Core

 Methods

Constructor Function.

__construct(\obj $object) : void
Inherited
global obj $auth
global string $lang
inherited_from \cPage::__construct()
inherited_from \cPageLeftTop::__construct()

Parameters

$object

\obj

Direct call of object as string will return it's generated markup.

__toString() : string
Inherited
inherited_from \cHTML::__toString()
inherited_from \cPage::__toString()
inherited_from \cPageLeftTop::__toString()

Returns

stringGenerated markup

Adds a required script to the current element.

addRequiredScript(string $script) : \cHTML
Inherited

Anyway, scripts are not included twice.

inherited_from \cHTML::addRequiredScript()
inherited_from \cPage::addRequiredScript()
inherited_from \cPageLeftTop::addRequiredScript()

Parameters

$script

string

the script to include

Returns

\cHTML$this

sets a specific JavaScript for the header Important: The passed script needs to define <script></script> tags.

addScript(string $name, string $script) 
Inherited
inherited_from \cPage::addScript()
inherited_from \cPageLeftTop::addScript()

Parameters

$name

string

a name for internal usage

$script

string

Advances to the next ID available in the system.

advanceID() : \cHTML
Inherited

This function is useful if you need to use HTML elements in a loop, but don't want to re-create new objects each time.

inherited_from \cHTML::advanceID()
inherited_from \cPage::advanceID()
inherited_from \cPageLeftTop::advanceID()

Returns

\cHTML$this

Appends the given style definition to the HTML element.

appendStyleDefinition(string $property, string $value) : \cHTML
Inherited

Example usage: $element->appendStyleDefinition('margin', '5px');

inherited_from \cHTML::appendStyleDefinition()
inherited_from \cPage::appendStyleDefinition()
inherited_from \cPageLeftTop::appendStyleDefinition()

Parameters

$property

string

the property name, e.g. 'margin'

$value

string

the value of the property, e.g. '5px'

Returns

\cHTML$this

Appends the given style definitions to the HTML element.

appendStyleDefinitions(array $styles) : \cHTML
Inherited

Example usage: $element->appendStyleDefinitions(array( 'margin' => '5px', 'padding' => '0' ));

inherited_from \cHTML::appendStyleDefinitions()
inherited_from \cPage::appendStyleDefinitions()
inherited_from \cPageLeftTop::appendStyleDefinitions()

Parameters

$styles

string

the styles to append

Returns

\cHTML$this

Attaches the code for an event

attachEventDefinition(string $name, string $event, string $code) : \cHTML
Inherited

Example to attach an onClick handler: attachEventDefinition('foo', 'onClick', 'alert("foo");');

inherited_from \cHTML::attachEventDefinition()
inherited_from \cPage::attachEventDefinition()
inherited_from \cPageLeftTop::attachEventDefinition()

Parameters

$name

string

Defines the name of the event

$event

string

Defines the event (e.g. onClick)

$code

string

Defines the code

Returns

\cHTML$this

Attaches a style definition.

attachStyleDefinition(string $name, string $definition) : \cHTML
Inherited

This function is not restricted to a single style, e.g. you can set multiple style definitions as-is to the handler.

$example->attachStyle('myIdentifier', 'border: 1px solid black; white-space: nowrap'); $example->attachStyle('myIdentifier2', 'padding: 0px');

Results in:

style="border: 1px solid black; white-space: nowrap; padding: 0px;"

inherited_from \cHTML::attachStyleDefinition()
inherited_from \cPage::attachStyleDefinition()
inherited_from \cPageLeftTop::attachStyleDefinition()

Parameters

$name

string

Name for a style definition

$definition

string

Definition for the given entity

Returns

\cHTML$this

cHTML()

cHTML() 
Inherited
inherited_from \cHTML::cHTML()
inherited_from \cPage::cHTML()
inherited_from \cPageLeftTop::cHTML()

cPage()

cPage($object) 
Inherited
uses \__construct()
inherited_from \cPage::cPage()
inherited_from \cPageLeftTop::cPage()

Parameters

$object

cPageLeftTop()

cPageLeftTop(bool $showCloser) 
Inherited
inherited_from \cPageLeftTop::cPageLeftTop()

Parameters

$showCloser

bool

Constructor Function

cPageLeftTopMultiPane($items) 

The passed array needs to be a multi-array in the following format:

$items = array( array( "image", "description", "link"), array( "image", "description", "link") );

Each sub-array needs to define an image, a description and a link. Note that the images are relative to the current directory, so you should include $cfg["path"]["images"] to retrieve the correct path.

Parameters

$items

array All items passed as multi array (see constructor description)

Outputs the generated markup

display() 
Inherited
inherited_from \cHTML::display()
inherited_from \cPage::display()
inherited_from \cPageLeftTop::display()

Fills the close skeleton

fillCloseSkeleton() : string
Inherited
inherited_from \cHTML::fillCloseSkeleton()
inherited_from \cPage::fillCloseSkeleton()
inherited_from \cPageLeftTop::fillCloseSkeleton()

Returns

stringfilled SGML closer skeleton

Fills the open SGML tag skeleton

fillSkeleton(string $attributes) : string
Inherited

fillSkeleton fills the SGML opener tag with the specified attributes. Attributes need to be passed in the stringyfied variant.

inherited_from \cHTML::fillSkeleton()
inherited_from \cPage::fillSkeleton()
inherited_from \cPageLeftTop::fillSkeleton()

Parameters

$attributes

string

Attributes to set

Returns

stringfilled SGML opener skeleton

Returns the value of the given attribute.

getAttribute(string $attributeName) : string
Inherited
inherited_from \cHTML::getAttribute()
inherited_from \cPage::getAttribute()
inherited_from \cPageLeftTop::getAttribute()

Parameters

$attributeName

string

Attribute name

Returns

stringnull value or null if the attribute does not exist

Returns the assoc array(default) or string of attributes

getAttributes(bool $returnAsString) : array
Inherited
inherited_from \cHTML::getAttributes()
inherited_from \cPage::getAttributes()
inherited_from \cPageLeftTop::getAttributes()

Parameters

$returnAsString

bool

Whether to return the attributes as string

Returns

arraystring

Returns the current ID

getID() : string
Inherited
inherited_from \cHTML::getID()
inherited_from \cPage::getID()
inherited_from \cPageLeftTop::getID()

Returns

stringcurrent ID

Removes an attribute

removeAttribute(string $attributeName) : \cHTML
Inherited
inherited_from \cHTML::removeAttribute()
inherited_from \cPage::removeAttribute()
inherited_from \cPageLeftTop::removeAttribute()

Parameters

$attributeName

string

Attribute name

Returns

\cHTML$this

render

render(\type $print) : string

Parameters

$print

\type

Returns

stringor nothing if print

Sets the alt and title attributes

setAlt(string $alt) : \cHTML
Inherited

Sets the "alt" and "title" tags. Usually, "alt" is used for accessibility and "title" for mouse overs.

To set the text for all browsers for mouse over, set "alt" and "title". IE behaves incorrectly and shows "alt" on mouse over. Mozilla browsers only show "title" as mouse over.

inherited_from \cHTML::setAlt()
inherited_from \cPage::setAlt()
inherited_from \cPageLeftTop::setAlt()

Parameters

$alt

string

Text to set as the "alt" and "title" attribute

Returns

\cHTML$this

Sets a specific attribute

setAttribute(string $attributeName, string $value) : \cHTML
Inherited
inherited_from \cHTML::setAttribute()
inherited_from \cPage::setAttribute()
inherited_from \cPageLeftTop::setAttribute()

Parameters

$attributeName

string

Name of the attribute

$value

string

Value of the attribute

Returns

\cHTML$this

Sets the HTML attributes

setAttributes(array $attributes) : \cHTML
Inherited
inherited_from \cHTML::setAttributes()
inherited_from \cPage::setAttributes()
inherited_from \cPageLeftTop::setAttributes()

Parameters

$attributes

array

Associative array with attributes

Returns

\cHTML$this

Sets the CSS class

setClass(string $class) : \cHTML
Inherited
inherited_from \cHTML::setClass()
inherited_from \cPage::setClass()
inherited_from \cPageLeftTop::setClass()

Parameters

$class

string

Text to set as the "class" attribute

Returns

\cHTML$this

Sets the content for the page

setContent(mixed $content) : void
Inherited
inherited_from \cPage::setContent()
inherited_from \cPageLeftTop::setContent()

Parameters

$content

mixed

Object with a render method or a string containing the content

Contentless tag setter

setContentlessTag(bool $contentlessTag) : \cHTML
Inherited
inherited_from \cHTML::setContentlessTag()
inherited_from \cPage::setContentlessTag()
inherited_from \cPageLeftTop::setContentlessTag()

Parameters

$contentlessTag

bool

Returns

\cHTML$this

set encoding

setEncoding(string $encoding) 
Inherited
inherited_from \cPage::setEncoding()
inherited_from \cPageLeftTop::setEncoding()

Parameters

$encoding

string

Adds an "on???" javascript event handler

setEvent(string $event, string $action) : \cHTML
Inherited

example: $item->setEvent('change','document.forms[0].submit');

inherited_from \cHTML::setEvent()
inherited_from \cPage::setEvent()
inherited_from \cPageLeftTop::setEvent()

Parameters

$event

string

Type of the event, e. g. "change" for "onchange"

$action

string

Function or action to call (JavaScript Code)

Returns

\cHTML$this

setExtra()

setExtra(string $extra) 
Inherited
inherited_from \cPage::setExtra()
inherited_from \cPageLeftTop::setExtra()

Parameters

$extra

string

Setter for static $_generateXHTML property

setGenerateXHTML(bool $value) 
InheritedStatic
inherited_from \cHTML::setGenerateXHTML()
inherited_from \cPage::setGenerateXHTML()
inherited_from \cPageLeftTop::setGenerateXHTML()

Parameters

$value

bool

Sets the ID class

setID(string $id) : \cHTML
Inherited
inherited_from \cHTML::setID()
inherited_from \cPage::setID()
inherited_from \cPageLeftTop::setID()

Parameters

$id

string

Text to set as the "id"

Returns

\cHTML$this

set the margin width (pixels)

setMargin(\type $margin) 
Inherited
inherited_from \cPage::setMargin()
inherited_from \cPageLeftTop::setMargin()

Parameters

$margin

\type

set JS for markup of a menu item

setMarkScript(string $item) 
Inherited
inherited_from \cPage::setMarkScript()
inherited_from \cPageLeftTop::setMarkScript()

Parameters

$item

string

id of item

setMessageBox()

setMessageBox() 
Inherited
see \setMessageBoxScript()
inherited_from \cPage::setMessageBox()
inherited_from \cPageLeftTop::setMessageBox()

setMessageBoxScript()

setMessageBoxScript() 
Inherited
inherited_from \cPage::setMessageBoxScript()
inherited_from \cPageLeftTop::setMessageBoxScript()

adds the default script to reload the left pane (frame 2)

setReload(string $location) 
Inherited
inherited_from \cPage::setReload()
inherited_from \cPageLeftTop::setReload()

Parameters

$location

string

default = false

Sets the CSS style

setStyle(string $style) : \cHTML
Inherited
inherited_from \cHTML::setStyle()
inherited_from \cPage::setStyle()
inherited_from \cPageLeftTop::setStyle()

Parameters

$style

string

Text to set as the "style" attribute

Returns

\cHTML$this

setStyleDefinition()

setStyleDefinition(string $entity, string $definition) : \cHTML
Inherited
inherited_from \cHTML::setStyleDefinition()
inherited_from \cPage::setStyleDefinition()
inherited_from \cPageLeftTop::setStyleDefinition()

Parameters

$entity

string

Entity to define

$definition

string

Definition for the given entity

Returns

\cHTML$this

sets the link to the subnavigation.

setSubnav(string $append, string $marea) 
Inherited

Should be set on the first page only.

global string $area
inherited_from \cPage::setSubnav()
inherited_from \cPageLeftTop::setSubnav()

Parameters

$append

string

$marea

string

Sets the HTML tag to $tag

setTag(string $tag) : \cHTML
Inherited
inherited_from \cHTML::setTag()
inherited_from \cPage::setTag()
inherited_from \cPageLeftTop::setTag()

Parameters

$tag

string

The new tag

Returns

\cHTML$this

set wether the closer should be shown.

showCloser($show) 

Parameters

$show

boolean True if the closer should be shown (default)

Generates the markup of the element

toHTML() : string
Inherited
inherited_from \cHTML::toHTML()
inherited_from \cPage::toHTML()
inherited_from \cPageLeftTop::toHTML()

Returns

stringGenerated markup

Removes an event handler

unsetEvent(string $event) : \cHTML
Inherited

example: $item->unsetEvent('change');

inherited_from \cHTML::unsetEvent()
inherited_from \cPage::unsetEvent()
inherited_from \cPageLeftTop::unsetEvent()

Parameters

$event

string

Type of the event

Returns

\cHTML$this

Updates the passed attribute without changing the other existing attributes

updateAttribute(string $name, string $value) : \cHTML
Inherited
inherited_from \cHTML::updateAttribute()
inherited_from \cPage::updateAttribute()
inherited_from \cPageLeftTop::updateAttribute()

Parameters

$name

string

the name of the attribute

$value

string

the value of the attribute with the given name

Returns

\cHTML$this

Updates the passed attributes without changing the other existing attributes

updateAttributes(array $attributes) : \cHTML
Inherited
inherited_from \cHTML::updateAttributes()
inherited_from \cPage::updateAttributes()
inherited_from \cPageLeftTop::updateAttributes()

Parameters

$attributes

array

Associative array with attributes

Returns

\cHTML$this

Adds the given content to the already existing content of this object.

_appendContent(string | object | array $content) : \cHTML
Inherited
inherited_from \cHTML::_appendContent()
inherited_from \cPage::_appendContent()
inherited_from \cPageLeftTop::_appendContent()

Parameters

$content

stringobjectarray

String with the content or an object to render or an array of strings/objects.

Returns

\cHTML$this

Returns an HTML formatted attribute string

_getAttrString(array $attributes) : string
Inherited
inherited_from \cHTML::_getAttrString()
inherited_from \cPage::_getAttrString()
inherited_from \cPageLeftTop::_getAttrString()

Parameters

$attributes

array

Associative array with attributes

Returns

stringAttribute string in HTML format

Returns a valid atrributes array.

_parseAttributes(array $attributes) : array
Inherited
inherited_from \cHTML::_parseAttributes()
inherited_from \cPage::_parseAttributes()
inherited_from \cPageLeftTop::_parseAttributes()

Parameters

$attributes

array

Associative array with attributes

Returns

arraythe parsed attributes

Sets the content of the object

_setContent(string | object | array $content) : \cHTML
Inherited
inherited_from \cHTML::_setContent()
inherited_from \cPage::_setContent()
inherited_from \cPageLeftTop::_setContent()

Parameters

$content

stringobjectarray

String with the content or a cHTML object to render or an array of strings / objects.

Returns

\cHTML$this

 Properties

 

$_items : array
access private
 

$_attributes : array
Inherited
inherited_from \cHTML::$$_attributes
inherited_from \cPage::$$_attributes
inherited_from \cPageLeftTop::$$_attributes
 

$_content : string
Inherited
inherited_from \cHTML::$$_content
inherited_from \cPage::$$_content
inherited_from \cPageLeftTop::$$_content
 

$_contentlessTag : bool
Inherited
inherited_from \cHTML::$$_contentlessTag
inherited_from \cPage::$$_contentlessTag
inherited_from \cPageLeftTop::$$_contentlessTag
 

$_encoding : string
Inherited
inherited_from \cPage::$$_encoding
inherited_from \cPageLeftTop::$$_encoding
 

$_eventDefinitions : array
Inherited
inherited_from \cHTML::$$_eventDefinitions
inherited_from \cPage::$$_eventDefinitions
inherited_from \cPageLeftTop::$$_eventDefinitions
 

$_generateXHTML : bool
Inherited
inherited_from \cHTML::$$_generateXHTML
inherited_from \cPage::$$_generateXHTML
inherited_from \cPageLeftTop::$$_generateXHTML
 

$_idCounter : int
Inherited
inherited_from \cHTML::$$_idCounter
inherited_from \cPage::$$_idCounter
inherited_from \cPageLeftTop::$$_idCounter
 

$_margin : int
Inherited
inherited_from \cPage::$$_margin
inherited_from \cPageLeftTop::$$_margin
 

$_requiredScripts : array
Inherited
inherited_from \cHTML::$$_requiredScripts
inherited_from \cPage::$$_requiredScripts
inherited_from \cPageLeftTop::$$_requiredScripts
 

$_scripts : array
Inherited
inherited_from \cPage::$$_scripts
inherited_from \cPageLeftTop::$$_scripts
 

$_showCloser : bool
Inherited
inherited_from \cPageLeftTop::$$_showCloser
 

$_skeletonClose : string
Inherited
inherited_from \cHTML::$$_skeletonClose
inherited_from \cPage::$$_skeletonClose
inherited_from \cPageLeftTop::$$_skeletonClose
 

$_skeletonOpen : string
Inherited
inherited_from \cHTML::$$_skeletonOpen
inherited_from \cPage::$$_skeletonOpen
inherited_from \cPageLeftTop::$$_skeletonOpen
 

$_skeletonSingle : string
Inherited
inherited_from \cHTML::$$_skeletonSingle
inherited_from \cPage::$$_skeletonSingle
inherited_from \cPageLeftTop::$$_skeletonSingle
 

$_styleDefinitions : array
Inherited
inherited_from \cHTML::$$_styleDefinitions
inherited_from \cPage::$$_styleDefinitions
inherited_from \cPageLeftTop::$$_styleDefinitions
 

$_styleDefs : array
Inherited
inherited_from \cHTML::$$_styleDefs
inherited_from \cPage::$$_styleDefs
inherited_from \cPageLeftTop::$$_styleDefs
 

$_subnav : string
Inherited
inherited_from \cPage::$$_subnav
inherited_from \cPageLeftTop::$$_subnav
 

$_tag : string
Inherited
inherited_from \cHTML::$$_tag
inherited_from \cPage::$$_tag
inherited_from \cPageLeftTop::$$_tag
 

$extra : string
Inherited
inherited_from \cPage::$$extra
inherited_from \cPageLeftTop::$$extra