Class CMS_href

Description

Class Href

Manage and serialize/unserialize an Hypertext reference Give a fully formated XHTML A tag when asked.

Located in /automne/classes/common/href.php (line 30)

CMS_grandFather
   |
   --CMS_href
Method Summary
 void __construct ([ $textDefinition = ''], string $textDefinition,)
 string, getAttribute ( $k, string $k,)
 array(key=>value) getAttributes ()
 string getExternalLink ()
 string getFileLink ([boolean $withPath = false], [string $module = MOD_STANDARD_CODENAME], [string $dataLocation = RESOURCE_DATA_LOCATION_EDITED], [integer $relativeTo = PATH_RELATIVETO_WEBROOT], [boolean $withFilename = true])
 string, getHTML ([ $label = false], [string $module = MOD_STANDARD_CODENAME], [string $dataLocation = RESOURCE_DATA_LOCATION_EDITED], [ $attrs = false], [ $hrefOnly = false], string $attrs,)
 integer getInternalLink ()
 string getLabel ()
 string getLinkType ()
 array() getPopup ()
 string getSeparator ()
 string getTarget ()
 string getTextDefinition ()
 boolean hasValidHREF ()
 boolean setAttribute ( $k,  $v, string $k,, string $v,)
 boolean setAttributes (array(key=>value) $attrs)
 boolean setExternalLink (string $url)
 boolean setFileLink ( $s, [ $module = ''], string $s,, string $module,)
 boolean setInternalLink (integer $pageID)
 boolean setLabel ( $s, string $s,)
 boolean setLinkType (integer $type)
 boolean setPopup ( $width,  $height, integer $width,, integer $height,)
 boolean setTarget ( $s, string $s,)
Methods
Constructor __construct (line 123)

Get the text definition.

  • access: public
void __construct ([ $textDefinition = ''], string $textDefinition,)
  • string $textDefinition,: teh full definition for this Link format : linkType|internalLink|externalLink|target|use-pop-up|Link label;
  • $textDefinition
getAttribute (line 484)

Get : an attribute from array

  • return: the value corresponding to key
  • access: public
string, getAttribute ( $k, string $k,)
  • string $k,: The key of wanted attribute
  • $k
getAttributes (line 437)

Get : All the attributes

  • access: public
array(key=>value) getAttributes ()
getAttributesString (line 448)

Get all attributes as a string

  • return: all attribute ready to be inserted int oa A XHTML tag
  • access: public
string getAttributesString ()
getExternalLink (line 332)

Gets the URL of the external link

  • return: The URL
  • access: public
string getExternalLink ()
getFileLink (line 377)

Gets the URL of a link towards a file managed by this application

  • return: The file
  • access: public
string getFileLink ([boolean $withPath = false], [string $module = MOD_STANDARD_CODENAME], [string $dataLocation = RESOURCE_DATA_LOCATION_EDITED], [integer $relativeTo = PATH_RELATIVETO_WEBROOT], [boolean $withFilename = true])
  • boolean $withPath: If false, only returns the filename
  • string $module: If false, only returns the filename
  • string $dataLocation: Where does the data lies ? See CMS_resource constants
  • integer $relativeTo: Can be web root or filesystem relative, see base constants
  • boolean $withFilename: Should the function return the filename too or only the path ?
getHTML (line 539)

Get : a full XHTML a tag

  • return: the XHTML Tag
  • access: public
string, getHTML ([ $label = false], [string $module = MOD_STANDARD_CODENAME], [string $dataLocation = RESOURCE_DATA_LOCATION_EDITED], [ $attrs = false], [ $hrefOnly = false], string $attrs,)
  • string $module: If false, only returns the filename
  • string $dataLocation: Where does the data lies ? @see CMS_resource constants
  • string $attrs,: any attributes to append into A tag
  • $label
  • $attrs
  • $hrefOnly
getInternalLink (line 289)

Gets the internal link (a page ID)

  • access: public
integer getInternalLink ()
getInternalLinkPage (line 300)

Gets the internal link (a page or false if no link)

  • access: public
CMS_page getInternalLinkPage ()
getLabel (line 226)

Get : The label

  • return: the label
  • access: public
string getLabel ()
getLinkType (line 261)

Gets the type of the link

  • return: The link type
  • access: public
string getLinkType ()
getPopup (line 510)

Get : an attribute from array

  • access: public
array() getPopup ()
getSeparator (line 237)

Get : The separator

  • return: the separator
  • access: public
string getSeparator ()
getTarget (line 202)

Get : The target

  • return: the target
  • access: public
string getTarget ()
getTextDefinition (line 169)

Returns the String definition well formatted format : {{lynkType}}{{sep}}{{internalLink}}{{sep}}{{externalLink}}{{sep}}{{fileLink}}{{sep}}{{attributes}}{{sep}}{{pop-width}},{{pop-height}}{{sep}}

  • return: The text definition based on the current elements
  • access: public
string getTextDefinition ()
hasValidHREF (line 612)

Checks the presence of a valid HREF in this link definition

  • return: true if good href founded
  • access: public
boolean hasValidHREF ()
setAttribute (line 497)

Set : an attribute

  • return: true on success, false on failure
  • access: public
boolean setAttribute ( $k,  $v, string $k,, string $v,)
  • string $k,: The key of wanted attribute
  • string $v,: the value corresponding to key
  • $k
  • $v
setAttributes (line 467)

Set : The attributes

  • return: true on success, false on failure
  • access: public
boolean setAttributes (array(key=>value) $attrs)
  • array(key=>value) $attrs
setExternalLink (line 345)

Sets the external link Reset the target to "_blank"

  • return: true on success, false on failure
  • access: public
boolean setExternalLink (string $url)
  • string $url: The url to set
setFileLink (line 419)

Sets the link to a file Reset the target to "_blank"

  • return: true on success, false on failure
  • access: public
boolean setFileLink ( $s, [ $module = ''], string $s,, string $module,)
  • string $s,: The link to set (filename only or full location)
  • string $module,: the module codename owning this file
  • $s
  • $module
setInternalLink (line 317)

Sets the internal link Reset the target to "_top"

  • return: true on success, false on failure
  • access: public
boolean setInternalLink (integer $pageID)
  • integer $pageID: The DB ID of the page linked
setLabel (line 249)

Set : The label

  • return: true on success, false on failure
  • access: public
boolean setLabel ( $s, string $s,)
  • string $s,: the label to set
  • $s
setLinkType (line 273)

Sets the type of link

  • return: true on success, false on failure
  • access: public
boolean setLinkType (integer $type)
  • integer $type: The type to set
setPopup (line 523)

Set : an attribute

  • return: true on success, false on failure
  • access: public
boolean setPopup ( $width,  $height, integer $width,, integer $height,)
  • integer $width,: window width to open
  • integer $height,: window height to open
  • $width
  • $height
setTarget (line 214)

Set : The target

  • return: true on success, false on failure
  • access: public
boolean setTarget ( $s, string $s,)
  • string $s,: the target
  • $s

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

Documentation generated on Wed, 15 Feb 2012 15:30:55 +0100 by phpDocumentor 1.4.3