Stud.IP  3.1 Revision 48552
 All Data Structures Namespaces Files Functions Variables Groups Pages
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= '')

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 (   $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 (   $class)
asDialog (   $state = '')
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 (   $url)
protected
offsetExists (   $offset)
offsetGet (   $offset)
offsetSet (   $offset,
  $value 
)
offsetUnset (   $offset)
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 ( )

Renders the element.

Returns
String The rendered content

Reimplemented from WidgetElement.

setActive (   $active = true)
setTarget (   $target)

Field Documentation

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

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