1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* CMS Pico - Integration of Pico within your files to create websites. |
4
|
|
|
* |
5
|
|
|
* This file is licensed under the Affero General Public License version 3 or |
6
|
|
|
* later. See the COPYING file. |
7
|
|
|
* |
8
|
|
|
* @author Maxence Lange <[email protected]> |
9
|
|
|
* @copyright 2017 |
10
|
|
|
* @license GNU AGPL version 3 or any later version |
11
|
|
|
* |
12
|
|
|
* This program is free software: you can redistribute it and/or modify |
13
|
|
|
* it under the terms of the GNU Affero General Public License as |
14
|
|
|
* published by the Free Software Foundation, either version 3 of the |
15
|
|
|
* License, or (at your option) any later version. |
16
|
|
|
* |
17
|
|
|
* This program is distributed in the hope that it will be useful, |
18
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
19
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
20
|
|
|
* GNU Affero General Public License for more details. |
21
|
|
|
* |
22
|
|
|
* You should have received a copy of the GNU Affero General Public License |
23
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
24
|
|
|
* |
25
|
|
|
*/ |
26
|
|
|
|
27
|
|
|
namespace OCA\CMSPico\Controller; |
28
|
|
|
|
29
|
|
|
use OCA\CMSPico\AppInfo\Application; |
30
|
|
|
use OCA\CMSPico\Service\ConfigService; |
31
|
|
|
use OCA\CMSPico\Service\MiscService; |
32
|
|
|
use OCA\CMSPico\Service\TemplatesService; |
33
|
|
|
use OCP\AppFramework\Controller; |
34
|
|
|
use OCP\AppFramework\Http\TemplateResponse; |
35
|
|
|
use OCP\IRequest; |
36
|
|
|
use OCP\IURLGenerator; |
|
|
|
|
37
|
|
|
|
38
|
|
|
class NavigationController extends Controller { |
39
|
|
|
|
40
|
|
|
/** @var IURLGenerator */ |
41
|
|
|
private $urlGenerator; |
42
|
|
|
|
43
|
|
|
/** @var ConfigService */ |
44
|
|
|
private $configService; |
45
|
|
|
|
46
|
|
|
/** @var TemplatesService */ |
47
|
|
|
private $templatesService; |
48
|
|
|
|
49
|
|
|
/** @var MiscService */ |
50
|
|
|
private $miscService; |
51
|
|
|
|
52
|
|
|
|
53
|
|
|
/** |
54
|
|
|
* NavigationController constructor. |
55
|
|
|
* |
56
|
|
|
* @param IRequest $request |
57
|
|
|
* @param IURLGenerator $urlGenerator |
58
|
|
|
* @param ConfigService $configService |
59
|
|
|
* @param TemplatesService $templatesService |
60
|
|
|
* @param MiscService $miscService |
61
|
|
|
*/ |
62
|
|
View Code Duplication |
function __construct( |
|
|
|
|
63
|
|
|
IRequest $request, IURLGenerator $urlGenerator, ConfigService $configService, |
64
|
|
|
TemplatesService $templatesService, MiscService $miscService |
65
|
|
|
) { |
66
|
|
|
parent::__construct(Application::APP_NAME, $request); |
67
|
|
|
$this->urlGenerator = $urlGenerator; |
68
|
|
|
$this->configService = $configService; |
69
|
|
|
$this->templatesService = $templatesService; |
70
|
|
|
$this->miscService = $miscService; |
71
|
|
|
} |
72
|
|
|
|
73
|
|
|
|
74
|
|
|
/** |
75
|
|
|
* @NoCSRFRequired |
76
|
|
|
* |
77
|
|
|
* @return TemplateResponse |
78
|
|
|
*/ |
79
|
|
|
public function admin() { |
80
|
|
|
$data = [ |
81
|
|
|
'nchost' => $this->urlGenerator->getBaseUrl(), |
82
|
|
|
'templates_new' => $this->templatesService->getNewTemplatesList() |
83
|
|
|
]; |
84
|
|
|
|
85
|
|
|
return new TemplateResponse(Application::APP_NAME, 'settings.admin', $data, 'blank'); |
86
|
|
|
} |
87
|
|
|
|
88
|
|
|
|
89
|
|
|
/** |
90
|
|
|
* @NoAdminRequired |
91
|
|
|
* @NoCSRFRequired |
92
|
|
|
* |
93
|
|
|
* @return TemplateResponse |
94
|
|
|
*/ |
95
|
|
|
public function personal() { |
96
|
|
|
$data = [ |
97
|
|
|
'templates' => $this->templatesService->getTemplatesList() |
98
|
|
|
]; |
99
|
|
|
\OC::$server->getLogger() |
100
|
|
|
->log(4, '____' . json_encode($data)); |
101
|
|
|
|
102
|
|
|
return new TemplateResponse(Application::APP_NAME, 'settings.personal', $data, 'blank'); |
103
|
|
|
} |
104
|
|
|
|
105
|
|
|
|
106
|
|
|
} |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths