blob: ba3cd05f4f01529534341999fa3d61f9aafc55d7 (
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
71
72
73
74
|
<?php
/**
* ownCloud - gallery
*
* This file is licensed under the Affero General Public License version 3 or
* later. See the COPYING file.
*
* @author Olivier Paroz <owncloud@interfasys.ch>
*
* @copyright Olivier Paroz 2015
*/
namespace OCA\Gallery\Controller;
use OCP\IRequest;
use OCP\ILogger;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http;
use OCA\Gallery\Service\ConfigService;
use OCA\Gallery\Service\PreviewService;
/**
* Class ConfigController
*
* @package OCA\Gallery\Controller
*/
class ConfigController extends Controller {
use Config;
use HttpError;
/**
* Constructor
*
* @param string $appName
* @param IRequest $request
* @param ConfigService $configService
* @param PreviewService $previewService
* @param ILogger $logger
*/
public function __construct(
$appName,
IRequest $request,
ConfigService $configService,
PreviewService $previewService,
ILogger $logger
) {
parent::__construct($appName, $request);
$this->configService = $configService;
$this->previewService = $previewService;
$this->logger = $logger;
}
/**
* @NoAdminRequired
*
* Returns an app configuration array
*
* @param bool $extramediatypes
*
* @return array <string,null|array>
*/
public function get($extramediatypes = false) {
try {
return $this->getConfig($extramediatypes);
} catch (\Exception $exception) {
return $this->jsonError($exception);
}
}
}
|