|
| __construct ($url='') |
|
| setMethod ($method) |
|
| getMethod () |
|
| addNeedle ($label, $name, $placeholder=false, SearchType $quick_search=null, $js_func=null, $value=null, array $attributes=[]) |
|
| addFilter ($label, $key) |
|
| hasElements () |
|
| setOnSubmitHandler ($onsubmit) |
|
| setOnClearHandler (string $onclear) |
|
| render ($variables=[]) |
|
| 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) |
|
This class provides a generic search widget for the sidebar.
- Author
- Jan-Hendrik Willms tleil.nosp@m.ax+s.nosp@m.tudip.nosp@m.@gma.nosp@m.il.co.nosp@m.m
- Since
- 3.1 GPL2 or any later version
- Copyright
- Stud.IP Core Group
◆ __construct()
Constructor for the widget.
- Parameters
-
String | $url | URL to send the search to |
◆ addFilter()
addFilter |
( |
|
$label, |
|
|
|
$key |
|
) |
| |
Add a filter option. This will create a checkbox with the given key as the name attribute.
- Parameters
-
String | $label | Label of the filter |
String | $key | Key/name of the filter (this will be the name attribute) |
◆ addNeedle()
addNeedle |
( |
|
$label, |
|
|
|
$name, |
|
|
|
$placeholder = false , |
|
|
SearchType |
$quick_search = null , |
|
|
|
$js_func = null , |
|
|
|
$value = null , |
|
|
array |
$attributes = [] |
|
) |
| |
Add a needle to search (optionally as quick search)
- Parameters
-
String | $label | Label for the input element |
String | $name | Name of the input (which will be the transmitted name attribute) |
bool | $placeholder | Use label as placeholder (this will hide the associated label) |
mixed | $quick_search | An optional SearchType object if quick search should be used |
mixed | $js_func | Optional name of a js function or a js function itself that's executed when an entry of the found elements is selected |
array | $attributes | An array with optional HTML attributes that shall be attached to the input element that is constructed when rendering this "needle". The array keys specify the attribute names while the array values specify the attribute values. Note that this parameter is ignored when a quick search object is provided! |
◆ getMethod()
Returns the request method used for the form.
- Returns
- string containing the chosen request method.
◆ hasData()
Returns whether the widget has any data. The widget has data if it was submitted and any of the needles or needles has been filled out.
- Returns
- bool indicating whether the request method matches and any element has data.
◆ hasElements()
Returns whether the widgets has any elements. Since this widget uses a special template, not all elements are "real" SidebarElements.
- Returns
- bool If widget has any element.
◆ render()
render |
( |
|
$variables = [] | ) |
|
Renders the widget.
- Parameters
-
Array | $variables | Unused variables parameter |
- Returns
- String containing the html output of the widget
◆ setMethod()
Sets the request method used for the form.
◆ setOnClearHandler()
setOnClearHandler |
( |
string |
$onclear | ) |
|
◆ setOnSubmitHandler()
setOnSubmitHandler |
( |
|
$onsubmit | ) |
|
◆ $filters
◆ $id
◆ $method
◆ $needles
◆ $onclear
◆ $onsubmit
◆ $url
◆ INDEX
The documentation for this class was generated from the following file: