Skip to content
Snippets Groups Projects
Commit c662a4c6 authored by David Siegfried's avatar David Siegfried Committed by Jan-Hendrik Willms
Browse files

render template widget correctly, fixes #1115, re #1102

Merge request studip/studip!666
parent 98231d32
No related branches found
No related tags found
No related merge requests found
......@@ -116,12 +116,7 @@ class ResourceTreeWidget extends SidebarWidget
$variables['max_open_depth'] = 0;
$variables['layout_css_classes'] = $this->layout_css_classes;
$template = $GLOBALS['template_factory']->open(
$this->template
);
$template->set_attributes($variables);
$template->set_layout('sidebar/widget-layout');
return $template->render();
return parent::render($variables);
}
public function setCurrentResource(Resource $resource)
......
......@@ -9,16 +9,13 @@
*/
class SidebarWidget extends Widget
{
protected $id = '';
protected $additional_attributes = [];
public function __construct()
{
$this->layout = 'sidebar/widget-layout.php';
}
/**
* Sets the ID of the HTML element that represents the widget.
*
......@@ -30,7 +27,6 @@ class SidebarWidget extends Widget
$this->id = $id;
}
/**
* Returns the ID of this widget, if it is set.
*
......@@ -38,7 +34,7 @@ class SidebarWidget extends Widget
*/
public function getId() : string
{
return $this->id;
return $this->id ?? '';
}
/**
......@@ -101,7 +97,6 @@ class SidebarWidget extends Widget
unset($this->additional_attributes[$key]);
}
/**
* Renders the widget.
* The widget will only be rendered if it contains at least one element.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment