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

Public Member Functions

 __construct ($id, $label, $active=false)
 
 setId ($id)
 
 setLabel ($label)
 
 getId ()
 
 getLabel ()
 
 setActive ($active=true)
 
 isActive ()
 
 getIndentLevel ()
 
 render ()
 
- Public Member Functions inherited from WidgetElement
 __construct ($content='')
 
 render ()
 

Protected Attributes

 $id
 
 $label
 
 $active
 
- Protected Attributes inherited from WidgetElement
 $content
 

Detailed Description

Model for a select element of the select widget.

Author
Jan-Hendrik Willms tleil.nosp@m.ax+s.nosp@m.tudip.nosp@m.@gma.nosp@m.il.co.nosp@m.m @license GPL2 or any later version
Since
Stud.IP 3.1

Constructor & Destructor Documentation

◆ __construct()

__construct (   $id,
  $label,
  $active = false 
)

Constructs the element with an id (value of the according option element) and a label (text content of the according option element).

Parameters
String$idId of the element
String$labelLabel/text content of the element
bool$activeIndicates whether the element is active

Member Function Documentation

◆ getId()

getId ( )

Returns the id of the element.

Returns
String Id of the element

◆ getIndentLevel()

getIndentLevel ( )

Returns the indentation level of the element based on the number of leading whitespace characters. This is used to indent the label in the according option element.

Returns
int Indentation level

◆ getLabel()

getLabel ( )

Returns the label/text content of the element. The label is stripped of all leading whitespace.

Returns
String Label/text content of the element
See also
SelectElement::getIndentLevel
Here is the caller graph for this function:

◆ isActive()

isActive ( )

Returns whether the element is active.

Returns
bool indicating whether the element is active

◆ render()

render ( )

Renders the element (well, not really - this returns it's label).

Returns
String The label/text content of the element
Todo:
What should this method actually do?

Reimplemented from WidgetElement.

Here is the call graph for this function:

◆ setActive()

setActive (   $active = true)

Sets the activate of the element.

Parameters
bool$activeIndicates whether the element is active (optional, defaults to true)

◆ setId()

setId (   $id)

Sets the id of the element.

Parameters
String$idId of the element

◆ setLabel()

setLabel (   $label)

Sets the label/text content of the element.

Parameters
String$labelLabel/text content of the element

Field Documentation

◆ $active

$active
protected

◆ $id

$id
protected

◆ $label

$label
protected

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