1 | <?php |
||
24 | class SettingsController extends Controller{ |
||
25 | |||
26 | private $userId; |
||
27 | private $l10n; |
||
28 | private $appConfig; |
||
29 | |||
30 | public function __construct($appName, IRequest $request, IL10N $l10n, AppConfig $appConfig, $userId){ |
||
31 | parent::__construct($appName, $request); |
||
32 | $this->userId = $userId; |
||
33 | $this->l10n = $l10n; |
||
34 | $this->appConfig = $appConfig; |
||
35 | } |
||
36 | |||
37 | /** |
||
38 | * @NoAdminRequired |
||
39 | */ |
||
40 | public function getSupportedMimes(){ |
||
46 | |||
47 | /** |
||
48 | * @NoAdminRequired |
||
49 | * @NoCSRFRequired |
||
50 | */ |
||
51 | public function personalIndex(){ |
||
52 | return new TemplateResponse( |
||
53 | $this->appName, |
||
54 | 'personal', |
||
55 | [ 'save_path' => $this->appConfig->getUserValue($this->userId, 'save_path') ], |
||
56 | 'blank' |
||
57 | ); |
||
58 | } |
||
59 | |||
60 | /** |
||
61 | * @NoCSRFRequired |
||
62 | */ |
||
63 | public function settingsIndex(){ |
||
64 | return new TemplateResponse( |
||
65 | $this->appName, |
||
66 | 'settings', |
||
67 | [ 'unstable' => $this->appConfig->getAppValue('unstable') ], |
||
68 | 'blank' |
||
69 | ); |
||
70 | } |
||
71 | |||
72 | /** |
||
73 | * @NoCSRFRequired |
||
74 | */ |
||
75 | public function adminIndex(){ |
||
76 | return new TemplateResponse( |
||
77 | $this->appName, |
||
78 | 'admin', |
||
79 | [ |
||
80 | 'converter' => $this->appConfig->getAppValue('converter'), |
||
81 | 'converter_url' => $this->appConfig->getAppValue('converter_url'), |
||
82 | ], |
||
83 | 'blank' |
||
84 | ); |
||
85 | } |
||
86 | |||
87 | /** |
||
88 | * @NoAdminRequired |
||
89 | */ |
||
90 | public function savePersonal($savePath){ |
||
115 | |||
116 | public function setUnstable($unstable){ |
||
122 | |||
123 | public function setConverter($converter, $url){ |
||
124 | if (!is_null($converter)){ |
||
125 | $this->appConfig->setAppValue('converter', $converter); |
||
126 | } |
||
169 | } |
||
170 |