blob: 1957eda7598560b037bd44c9abde9c95f957f8e9 (
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
|
<?php
/**
* A widget for the sidebar.
*
* @author Jan-Hendrik Willms <tleilax+studip@gmail.com>
* @license GPL 2 or later
* @since 3.1
* @see Sidebar
*/
class SidebarWidget extends Widget
{
public function __construct()
{
$this->layout = 'sidebar/widget-layout.php';
}
/**
* Sets the title of the widget.
*
* @param String $title The title of the widget
*/
public function setTitle($title)
{
$this->title = $title;
}
/**
* Returns the title of the widget
*
* @return mixed The title of the widget of false if no title has been set
*/
public function getTitle()
{
return $this->title;
}
/**
* Removes the title of the widget.
*/
public function removeTitle()
{
$this->title = false;
}
public function setExtra($extra)
{
$this->extra = $extra;
}
public function getExtra()
{
return $this->extra;
}
public function removeExtra()
{
$this->extra = false;
}
/**
* Renders the widget.
* The widget will only be rendered if it contains at least one element.
*
* @return String The THML code of the rendered sidebar widget
*/
public function render($variables = [])
{
return parent::render($variables);
}
}
|