blob: ce5fa1cfb9f44f0a17037fcf5e8b8b4ed9612296 (
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
|
<?php
namespace JsonApi\Models;
class Studip
{
public function getId()
{
return 'studip';
}
public function getProperties()
{
$properties = [
new StudipProperty('studip-version', 'Stud.IP-Version', $GLOBALS['SOFTWARE_VERSION']),
];
$copyrightDialog = self::getConfigOption('COPYRIGHT_DIALOG_ON_UPLOAD');
if ($copyrightDialog) {
$properties[] = $copyrightDialog;
}
return $properties;
}
private static function getConfigOption($field)
{
$config = \Config::get();
if (!isset($config[$field])) {
return null;
}
$description = $config->getMetadata($field)['description'];
$value = $config->getValue($field);
return new StudipProperty($field, $description, $value);
}
}
|