aboutsummaryrefslogtreecommitdiff
path: root/lib/classes/sidebar/RoomSearchTreeWidget.php
diff options
context:
space:
mode:
authorPhilipp Schüttlöffel <schuettloeffel@zqs.uni-hannover.de>2024-09-24 10:53:31 +0200
committerPhilipp Schüttlöffel <schuettloeffel@zqs.uni-hannover.de>2024-09-24 10:53:31 +0200
commit4459dd7917f4d1c34f40bb68f0e991e9c3d53e4c (patch)
tree5c07151ae61276d334e88f6309c30d439a85c12e /lib/classes/sidebar/RoomSearchTreeWidget.php
parentda0022e5c1abbf9825ae76debaabdff7e8623bb4 (diff)
parent97a188592c679890a25c37ab78463add76a52ff7 (diff)
Merge branch 'main' into issue-3911issue-3911
Diffstat (limited to 'lib/classes/sidebar/RoomSearchTreeWidget.php')
-rw-r--r--lib/classes/sidebar/RoomSearchTreeWidget.php41
1 files changed, 41 insertions, 0 deletions
diff --git a/lib/classes/sidebar/RoomSearchTreeWidget.php b/lib/classes/sidebar/RoomSearchTreeWidget.php
new file mode 100644
index 0000000..c3aaa07
--- /dev/null
+++ b/lib/classes/sidebar/RoomSearchTreeWidget.php
@@ -0,0 +1,41 @@
+<?php
+
+/**
+ * This class provides a resource tree view for the room search sidebar.
+ *
+ * @author Timo Hartge <hartge@data-quest.de>
+ * @license GNU General Public License v2 or later.
+ * @since 4.5
+ */
+class RoomSearchTreeWidget extends ResourceTreeWidget
+{
+ /**
+ * This widget must be initialised by providing at least one
+ * Resource object in an array.
+ *
+ * @param array $root_resources The root resource objects which will be
+ * displayed by this tree view.
+ * @param string $title The title of this widget.
+ * @param string|null $parameter_name The 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.
+ */
+ public function __construct(
+ array $root_resources = [],
+ $title = '',
+ $parameter_name = null
+ )
+ {
+ parent::__construct($root_resources, $title, $parameter_name);
+ $this->addLayoutCSSClass('room-search-tree-widget');
+ $this->template = 'sidebar/room-search-tree-widget';
+
+ if ($title) {
+ $this->title = $title;
+ } else {
+ $this->title = _('Ressourcenbaum');
+ }
+ }
+
+}