blob: 2ca2d704c44bd12f9e9377411e851b425b5b0337 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
<?php
/**
* This widget type consists of a template and associated variables and will
* render the template content as the widget content.
*
* @author Jan-Hendrik Willms <tleilax+studip@gmail.com>
* @license GPL2 or any later version
* @since Stud.IP 4.0
*/
class TemplateWidget extends SidebarWidget
{
protected $forced_rendering = true;
/**
* Constructor of the widget.
*
* @param String $title Title of the widget
* @param Flexi\Template $template Template for the widget
* @param array $variables Associated variables for the template
*/
public function __construct($title, Flexi\Template $template, array $variables = [])
{
parent::__construct();
$this->title = $title;
$this->template = $template;
$this->template->set_attributes($variables);
}
}
|