Stud.IP  4.0
 All Data Structures Namespaces Files Functions Variables Groups
ResourceTreeWidget Class Reference
Inheritance diagram for ResourceTreeWidget:
SidebarWidget Widget RoomSearchTreeWidget

Public Member Functions

 __construct (array $root_resources=[], $title= '', $parameter_name= 'tree_selected_resource')
 render ($variables=[])
 setCurrentResource (Resource $resource)
 setCurrentResourceId ($resource_id=null)
 setFoldable ($foldable=false)
 isFoldable ()
- 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)

Protected Attributes

 $root_resources = []
 $parameter_name = ''
 $foldable = false
 $current_resource_id = null
- 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 = []

Additional Inherited Members

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

Constructor & Destructor Documentation

__construct ( array  $root_resources = [],
  $title = '',
  $parameter_name = 'tree_selected_resource' 

This widget must be initialised by providing at least one Resource object in an array.

array$root_resourcesThe root resource objects which will be displayed by this tree view.
string$titleThe title of this widget.
string | null$parameter_nameThe name of the URL parameter which will be set when one of the resources in the tree is selected. If parameter_name is set to null the items in the resource tree widget will link to the resource's details page.

Member Function Documentation

isFoldable ( )
render (   $variables = [])

The render method will attach the root resource of this object to the set of variables which is passed to the template.

setCurrentResource ( Resource  $resource)
setCurrentResourceId (   $resource_id = null)
setFoldable (   $foldable = false)

Field Documentation

$current_resource_id = null
$foldable = false
$parameter_name = ''
$root_resources = []

$root_resource is the resource whose resource tree shall be displayed by this widget. The resource itself and all its children are displayed.

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