1 | <?php |
||
36 | class Template extends \OC_Defaults { |
||
37 | /** @var IConfig */ |
||
38 | private $config; |
||
39 | /** @var IL10N */ |
||
40 | private $l; |
||
|
|||
41 | /** @var IURLGenerator */ |
||
42 | private $urlGenerator; |
||
43 | /** @var string */ |
||
44 | private $name; |
||
45 | /** @var string */ |
||
46 | private $url; |
||
47 | /** @var string */ |
||
48 | private $slogan; |
||
49 | /** @var string */ |
||
50 | private $color; |
||
51 | |||
52 | /** |
||
53 | * Template constructor. |
||
54 | * |
||
55 | * @param IConfig $config |
||
56 | * @param IL10N $l |
||
57 | * @param IURLGenerator $urlGenerator |
||
58 | * @param \OC_Defaults $defaults |
||
59 | */ |
||
60 | public function __construct(IConfig $config, |
||
61 | IL10N $l, |
||
62 | IURLGenerator $urlGenerator, |
||
63 | \OC_Defaults $defaults |
||
64 | ) { |
||
65 | parent::__construct(); |
||
66 | $this->config = $config; |
||
67 | $this->l = $l; |
||
68 | $this->urlGenerator = $urlGenerator; |
||
69 | |||
70 | $this->name = $defaults->getName(); |
||
71 | $this->url = $defaults->getBaseUrl(); |
||
72 | $this->slogan = $defaults->getSlogan(); |
||
73 | $this->color = $defaults->getMailHeaderColor(); |
||
74 | } |
||
75 | |||
76 | public function getName() { |
||
77 | return $this->config->getAppValue('theming', 'name', $this->name); |
||
78 | } |
||
79 | |||
80 | public function getEntity() { |
||
83 | |||
84 | public function getBaseUrl() { |
||
87 | |||
88 | public function getSlogan() { |
||
89 | return $this->config->getAppValue('theming', 'slogan', $this->slogan); |
||
90 | } |
||
91 | |||
92 | /** |
||
93 | * Color that is used for the header as well as for mail headers |
||
94 | * |
||
95 | * @return string |
||
96 | */ |
||
97 | public function getMailHeaderColor() { |
||
100 | |||
101 | /** |
||
102 | * Increases the cache buster key |
||
103 | */ |
||
104 | private function increaseCacheBuster() { |
||
108 | |||
109 | /** |
||
110 | * Update setting in the database |
||
111 | * |
||
112 | * @param string $setting |
||
113 | * @param string $value |
||
114 | */ |
||
115 | public function set($setting, $value) { |
||
119 | |||
120 | /** |
||
121 | * Revert settings to the default value |
||
122 | * |
||
123 | * @param string $setting setting which should be reverted |
||
124 | * @return string default value |
||
125 | */ |
||
126 | public function undo($setting) { |
||
150 | } |
||
151 |