Stud.IP  4.0
 All Data Structures Namespaces Files Functions Variables Groups
SelectWidget Class Reference
Inheritance diagram for SelectWidget:
SidebarWidget Widget CourseManagementSelectWidget InstituteSelectWidget SemesterSelectorWidget

Public Member Functions

 __construct ($title, $url, $name, $method= 'get', $multiple=false)
 
 setUrl ($url)
 
 setMaxLength ($length)
 
 setSelectParameterName ($name)
 
 setSelection ($value)
 
 setRequestMethod ($method)
 
 setDropdownAutoWidth ($dropdownAutoWidth)
 
 setMultiple ($multiple)
 
 setOptions (array $options, $selected=false)
 
 render ($variables=[])
 
- Public Member Functions inherited from SidebarWidget
 __construct ()
 
 setId (string $id)
 
 getId ()
 
 setTitle ($title)
 
 getTitle ()
 
 removeTitle ()
 
 setExtra ($extra)
 
 getExtra ()
 
 removeExtra ()
 
 setAdditionalAttribute (string $key, $value)
 
 setAdditionalAttributes (array $attributes)
 
 removeAdditionalAttribute (string $key)
 
 render ($variables=[])
 
- Public Member Functions inherited from Widget
 addElement (WidgetElement $element, $index=null)
 
 insertElement (WidgetElement $element, $before_index, $index=null)
 
 getElement ($index)
 
 getElements ()
 
 removeElement ($index)
 
 hasElements ()
 
 hasElement ($index)
 
 forceRendering ($state=true)
 
 addLayoutCSSClass ($css_class)
 
 removeLayoutCSSClass ($css_class)
 
 render ($variables=[])
 
 __isset ($offset)
 
 __get ($offset)
 
 __set ($offset, $value)
 
 __unset ($offset)
 

Static Public Member Functions

static arrayToHiddenInput (array $array, $prefix= '')
 

Protected Member Functions

 hasNestedElements ()
 
- Protected Member Functions inherited from Widget
 guessIndex (WidgetElement $element)
 

Additional Inherited Members

- Protected Attributes inherited from SidebarWidget
 $additional_attributes = []
 
- Protected Attributes inherited from Widget
 $elements = []
 
 $template = 'widgets/widget'
 
 $template_variables = []
 
 $layout = 'widgets/widget-layout'
 
 $forced_rendering = false
 
 $layout_css_classes = []
 

Detailed Description

Sidebar widget for lists of selectable items.

Author
Jan-Hendrik Willms tleil.nosp@m.ax+s.nosp@m.tudip.nosp@m.@gma.nosp@m.il.co.nosp@m.m GPL 2 or later
Since
3.1

Constructor & Destructor Documentation

__construct (   $title,
  $url,
  $name,
  $method = 'get',
  $multiple = false 
)

Constructs the widget by defining a special template.

Parameters
string$titleDiplayed title
string$urlTarget url
string$nameName of the input element
string$methodRequest method
boolean$multipleDefines whether selecting multiple values is allowed

Member Function Documentation

static arrayToHiddenInput ( array  $array,
  $prefix = '' 
)
static

Converts the given array to a list of hidden inputs FIXME this duplicates what addHiddenFields() does.

Parameters
array$arrayArray to convert
string$prefixOptional prefix for the input name
Returns
string list of hidden inputs as html
hasNestedElements ( )
protected

Returns whether this element has nested subelements

Returns
boolean true if element has nested subelements
render (   $variables = [])

Renders the select widget

Parameters
array$variablesAdditional vaiarbles
Returns
string rendered widget as ghtml
setDropdownAutoWidth (   $dropdownAutoWidth)

set the dropdown auto width (default: false)

Parameters
$dropdownAutoWidth
Returns
void
setMaxLength (   $length)

Sets the maximum length of the input

Parameters
int$lengthMaximum length
setMultiple (   $multiple)

Sets whether selecting multiple values is allowed or not

Parameters
bool$multipletrue if selection multiple values should be allowed
setOptions ( array  $options,
  $selected = false 
)

Sets the options for the select element

Parameters
array$optionsOptions as associative array (value => label)
mixed$selectedThe initially selected value
setRequestMethod (   $method)

Sets the request method

Parameters
string$method[description]
setSelection (   $value)

Sets the selected value.

Parameters
mixed$valueSelected value
setSelectParameterName (   $name)

Sets the name of the select input element

Parameters
String$nameName of the input element
setUrl (   $url)

Sets the target url

Parameters
string$urlTarget url

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