Class CMS_XMLTag

Description

Class CMS_XMLTag

Represents a XML Tag. Instanciated by the XMLParser.

Located in /automne/classes/pageContent/xmltag.php (line 27)

CMS_grandFather
   |
   --CMS_XMLTag
Direct descendents
Class Description
 class CMS_XMLTag_title Class CMS_XMLTag_title
 class CMS_XMLTag_js_add Class CMS_XMLTag_js_add
 class CMS_XMLTag_edit Class CMS_XMLTag_edit
 class CMS_XMLTag_css_add Class CMS_XMLTag_css_add
 class CMS_XMLTag_redirect Class CMS_XMLTag_redirect
 class CMS_XMLTag_anchor Class CMS_XMLTag_anchor
 class CMS_XMLTag_xml Class CMS_XMLTag_xml
 class CMS_XMLTag_noedit Class CMS_XMLTag_noedit
 class CMS_XMLTag_header Class CMS_XMLTag_header
 class CMS_XMLTag_website Class CMS_XMLTag_website
 class CMS_XMLTag_noadmin Class CMS_XMLTag_noadmin
 class CMS_XMLTag_admin Class CMS_XMLTag_admin
 class CMS_XMLTag_page Class CMS_XMLTag_page
 class CMS_XMLTag_setvar Class CMS_XMLTag_setvar
 class CMS_XMLTag_else Class CMS_XMLTag_else
 class CMS_XMLTag_end Class CMS_XMLTag_end
 class CMS_XMLTag_if Class CMS_XMLTag_if
 class CMS_XMLTag_start Class CMS_XMLTag_start
Class Constant Summary
Method Summary
 static string cleanComputedDefinition (string $definition)
 static string compute ([ $parameters = array()])
 static string getUniqueID ()
 static string indentPHP (string $phpcode)
 static text replaceVars (string $text, [boolean $reverse = false], [boolean $cleanNotMatches = false], [mixed $matchCallback = null], [ $returnMatchedVarsArray = false])
 static string _computeChilds ()
 void __construct (string $name, [array(string) $attributes = array()], [ $children = array()], [array(string) $parameters = array()])
 string checkTagRequirements (array $requirements)
 mixed encloseString (mixed $var, boolean $reverse)
 mixed encloseWithPrepareVar (mixed $var)
 string getAttribute (string $attribute)
 array(string=>string) getAttributes ()
 array(string=>string) getChildren ()
 string getContent ()
 array getHeaderCode ()
 string getInnerContent ()
 string getName ()
 array(string=>string) getParameters ()
 object An getRepresentationInstance ([array(mixed) $args = false])
 string getTagError ()
 array getTagReferences ()
 boolean setAttribute (string $attribute,  $value)
 boolean setTextContent (string $content)
 void _returnComputedDatas ( $datas)
 integer __call ( $name,  $parameters)
Methods
static cleanComputedDefinition (line 704)

Do some replacements to clean produced definition code

  • return: cleaned php code
  • access: public
static string cleanComputedDefinition (string $definition)
  • string $definition: : php code to clean
static compute (line 339)

Compute the current tag according to compute parameters

  • return: the computed tag results
  • access: private
static string compute ([ $parameters = array()])
  • $parameters
static getUniqueID (line 416)

Return an unique ID formatted as id_rand where id is the number of unique ids queried and rand a 6 alphanumerical random characters string

  • return: the unique ID
  • access: public
static string getUniqueID ()
static indentPHP (line 731)

Return well indented php code

  • return: indented php code
  • access: public
static string indentPHP (string $phpcode)
  • string $phpcode: : php code to indent
static replaceVars (line 542)

Replace vars like {object:field:type} or {var|session|request|page:name:type}. Called during definition compilation

  • return: : the text replaced
  • access: public
static text replaceVars (string $text, [boolean $reverse = false], [boolean $cleanNotMatches = false], [mixed $matchCallback = null], [ $returnMatchedVarsArray = false])
  • string $text: : the text which need to be replaced
  • boolean $cleanNotMatches: : remove vars without matches
  • mixed $matchCallback: : function name or array(object classname, object method) which represent a valid callback function to execute on matches
  • boolean $reverse: reverse : reverse single and double quotes useage (default is false : double quotes)
  • $returnMatchedVarsArray
static _computeChilds (line 389)

Use a callback function to compute children tags

  • return: the computed children results
  • access: private
static string _computeChilds ()
Constructor __construct (line 126)

Constructor.

  • access: public
void __construct (string $name, [array(string) $attributes = array()], [ $children = array()], [array(string) $parameters = array()])
  • string $name: The name of the tag
  • array(string) $attributes: The tag attributes.
  • array(string) $parameters: The current treatments parameters.
  • $children

Redefined in descendants as:
checkTagRequirements (line 466)

Check tags attributes requirements

  • return: indented php code
  • access: public
string checkTagRequirements (array $requirements)
  • array $requirements: : tag attributes requirements at the following format :
encloseString (line 692)

Enclose a given string with double quotes or single quotes according to reverse value

  • return: : the var enclosed
  • access: public
mixed encloseString (mixed $var, boolean $reverse)
  • mixed $var: : the var to enclose
  • boolean $reverse: : enclose with double or single quotes
encloseWithPrepareVar (line 680)

Enclose a given var with CMS_polymod_definition_parsing::prepareVar method

  • return: : the var enclosed
  • access: public
mixed encloseWithPrepareVar (mixed $var)
  • mixed $var: : the var to enclose
getAttribute (line 186)

Get the value of an attribute.

  • return: The attribute value
  • access: public
string getAttribute (string $attribute)
  • string $attribute: The attribute we want (its the key of the associative array)
getAttributes (line 155)

Get all the tag attributes

  • return: the tag attributes
  • access: public
array(string=>string) getAttributes ()
getChildren (line 165)

Get all the tag children

  • return: the tag children
  • access: public
array(string=>string) getChildren ()
getContent (line 249)

Get the content, which is the text content including the tag definition.

  • return: the XML
  • access: public
string getContent ()
getHeaderCode (line 448)

Return tag header code

  • access: public
array getHeaderCode ()
getInnerContent (line 273)

Get the inner content, which is the text content excluding the tag definition.

  • return: the inner HTML
  • access: public
string getInnerContent ()
getName (line 144)

Get the name of the tag

  • return: the tag name
  • access: public
string getName ()
getParameters (line 175)

Get all the tag parameters

  • return: the tag parameters
  • access: public
array(string=>string) getParameters ()
getRepresentationInstance (line 291)

Get the representation instance, from the tag name

What is needed ?

  • $args = array("template"=>template_db_id) and attributes contain "id" key along with value for client spaces
  • attributes contain "id" and "type" keys along with values for rows
  • attributes contain "id" and "type" keys along with values for blocks

  • return: instanciated object of the correct class.
  • access: public
object An getRepresentationInstance ([array(mixed) $args = false])
  • array(mixed) $args: The arguments needed to instanciate the representation
getTagError (line 428)

Return tag errors founded

  • return: the parsing errors
  • access: public
string getTagError ()
getTagReferences (line 438)

Return tag references founded

  • return: the tag references
  • access: public
array getTagReferences ()
setAttribute (line 201)

Set the value of an attribute.

  • access: public
boolean setAttribute (string $attribute,  $value)
  • string $attribute: The attribute we want (its the key of the associative array)
  • $value
setTextContent (line 231)

Set the text content. This content must include the tag itself.

  • return: true on success, false on failure to set it
  • access: public
boolean setTextContent (string $content)
  • string $content: The tag content including the tag itself
_returnComputedDatas (line 345)
void _returnComputedDatas ( $datas)
  • $datas
__call (line 218)

Get the start byte position offset.

  • return: the start byte
  • access: public
integer __call ( $name,  $parameters)
  • $name
  • $parameters

Redefinition of:
CMS_grandFather::__call()
Unknown method handler

Inherited Methods

Inherited From CMS_grandFather

 CMS_grandFather::autoload()
 CMS_grandFather::hasError()
 CMS_grandFather::log()
 CMS_grandFather::PHPErrorHandler()
 CMS_grandFather::raiseError()
 CMS_grandFather::setDebug()
 CMS_grandFather::setLog()
 CMS_grandFather::_raiseError()
 CMS_grandFather::__call()
Class Constants
HTML_CONTEXT = 1 (line 29)
HTML_TAG_CONTEXT = 3 (line 31)
PHP_CONTEXT = 2 (line 30)

Inherited Constants

Inherited from CMS_grandFather

CMS_grandFather::ERROR_LOG
CMS_grandFather::SYSTEM_LABEL

Documentation generated on Wed, 15 Feb 2012 15:41:17 +0100 by phpDocumentor 1.4.3