Skip to content
Snippets Groups Projects
Commit 83a80047 authored by Jan-Hendrik Willms's avatar Jan-Hendrik Willms Committed by Jan-Hendrik Willms
Browse files

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

Closes #1106

Merge request studip/studip!660
parent d951db97
No related branches found
No related tags found
No related merge requests found
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
*/ */
class TemplateWidget extends SidebarWidget class TemplateWidget extends SidebarWidget
{ {
protected $template; protected $forced_rendering = true;
/** /**
* Constructor of the widget. * Constructor of the widget.
...@@ -26,21 +26,4 @@ class TemplateWidget extends SidebarWidget ...@@ -26,21 +26,4 @@ class TemplateWidget extends SidebarWidget
$this->template = $template; $this->template = $template;
$this->template->set_attributes($variables); $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