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

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

Closes #1106

Merge request studip/studip!660
parent 8c5fbb98
No related branches found
No related tags found
No related merge requests found
......@@ -9,7 +9,7 @@
*/
class TemplateWidget extends SidebarWidget
{
protected $template;
protected $forced_rendering = true;
/**
* Constructor of the widget.
......@@ -26,21 +26,4 @@ class TemplateWidget extends SidebarWidget
$this->template = $template;
$this->template->set_attributes($variables);
}
/**
* Renders the template and widget.
*
* @param array $variables Additional variables for rendering
* @return string containing the rendered widget as html
*/
public function render($variables = [])
{
$this->template->set_attributes($variables);
$layout = $GLOBALS['template_factory']->open($this->layout);
$layout->layout_css_classes = $this->layout_css_classes;
return $this->template->render(
$this->template_variables,
$layout
);
}
}
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