Stud.IP  jlu_3.3 Revision
LinkElement Class Reference
Inheritance diagram for LinkElement:
Inheritance graph
Collaboration diagram for LinkElement:
Collaboration graph

Public Member Functions

 __construct ($label, $url, $icon=null, $attributes=array())
 
 setActive ($active=true)
 
 asDialog ($state='')
 
 setTarget ($target)
 
 addClass ($class)
 
 render ()
 
 offsetExists ($offset)
 
 offsetGet ($offset)
 
 offsetSet ($offset, $value)
 
 offsetUnset ($offset)
 
- Public Member Functions inherited from WidgetElement
 __construct ($content='')
 
 render ()
 

Static Public Member Functions

static fromHTML ($html, $icon=null)
 

Data Fields

 $url
 
 $label
 
 $icon
 
 $active = false
 
 $attributes = array()
 

Protected Member Functions

 isURL ($url)
 

Static Protected Member Functions

static parseAttributes ($text)
 

Additional Inherited Members

- Protected Attributes inherited from WidgetElement
 $content
 

Constructor & Destructor Documentation

◆ __construct()

__construct (   $label,
  $url,
  $icon = null,
  $attributes = array() 
)

create a link for a widget

Parameters
String$labelLabel/content of the link
String$urlURL/Location of the link
String$iconIcon for the link, defaults to blank.gif
array$attributesHTML-attributes for the a-tag in an associative array.

Member Function Documentation

◆ addClass()

addClass (   $class)

◆ asDialog()

asDialog (   $state = '')

◆ fromHTML()

static fromHTML (   $html,
  $icon = null 
)
static

Create link by parsing a html chunk.

Parameters
String$htmlHTML chunk to parse
mixed$iconOptional icon
Returns
LinkElement Link element from parsed html
Exceptions
Exceptionif html can not be parsed
Here is the call graph for this function:
Here is the caller graph for this function:

◆ isURL()

isURL (   $url)
protected

◆ offsetExists()

offsetExists (   $offset)

◆ offsetGet()

offsetGet (   $offset)

◆ offsetSet()

offsetSet (   $offset,
  $value 
)

◆ offsetUnset()

offsetUnset (   $offset)

◆ parseAttributes()

static parseAttributes (   $text)
staticprotected

Parse a string of html attributes into an associative array.

Parameters
String$textString of html attributes
Returns
Array parsed attributes as key => value pairs
See also
https://gist.github.com/rodneyrehm/3070128
Here is the caller graph for this function:

◆ render()

render ( )

Renders the element.

Returns
String The rendered content

Reimplemented from WidgetElement.

◆ setActive()

setActive (   $active = true)

◆ setTarget()

setTarget (   $target)

Field Documentation

◆ $active

$active = false

◆ $attributes

$attributes = array()

◆ $icon

$icon

◆ $label

$label

◆ $url

$url

The documentation for this class was generated from the following file: