Stud.IP  6.0
SelectElement Class Reference
Inheritance diagram for SelectElement:
WidgetElement SelectGroupElement

Public Member Functions

 __construct ($id, $label, $active=false, $tooltip=null)
 
 setId ($id)
 
 setLabel ($label)
 
 getId ()
 
 getLabel ()
 
 getTooltip ()
 
 setActive ($active=true)
 
 isActive ()
 
 setAsHeader ($is_header=true)
 
 isHeader ()
 
 setIndentLevel ($level)
 
 getIndentLevel ()
 
 render ()
 
- Public Member Functions inherited from WidgetElement
 __construct ($content='')
 
 render ()
 

Protected Attributes

 $id
 
 $label
 
 $active
 
 $tooltip
 
 $is_header = false
 
 $indent_level = null
 
- 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 GPL2 or any later version
Since
Stud.IP 3.1

Constructor & Destructor Documentation

◆ __construct()

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

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
String | null$tooltipOptional Title attribute for the element

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. If the level has not been set explicitely, it is calculated 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

◆ getTooltip()

getTooltip ( )

Returns the tooltip content of the element. It is stripped of all leading whitespace.

Returns
String tooltip content of the element
See also
SelectElement::getIndentLevel

◆ isActive()

isActive ( )

Returns whether the element is active.

Returns
bool indicating whether the element is active

◆ isHeader()

isHeader ( )

Returns whether the elements should be displayed as a header element.

Returns
bool indicating whether the element should be displayed as a header element

◆ render()

render ( )

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

Returns
String The label/text content of the element

◆ setActive()

setActive (   $active = true)

Sets the activate of the element.

Parameters
bool$activeIndicates whether the element is active (optional, defaults to true)
Returns
SelectElement instance to allow chaining

◆ setAsHeader()

setAsHeader (   $is_header = true)

Sets the flag indicating whether this element should be displayed as a header element.

Parameters
bool$is_header"Is header" flag
Returns
SelectElement instance to allow chaining

◆ setId()

setId (   $id)

Sets the id of the element.

Parameters
String$idId of the element
Returns
SelectElement instance to allow chaining

◆ setIndentLevel()

setIndentLevel (   $level)

Sets the indentation level of the element.

Parameters
int$levelIndentation level
Returns
SelectElement instance to allow chaining

◆ setLabel()

setLabel (   $label)

Sets the label/text content of the element.

Parameters
String$labelLabel/text content of the element
Returns
SelectElement instance to allow chaining

Field Documentation

◆ $active

$active
protected

◆ $id

$id
protected

◆ $indent_level

$indent_level = null
protected

◆ $is_header

$is_header = false
protected

◆ $label

$label
protected

◆ $tooltip

$tooltip
protected

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