1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* Circles - Bring cloud-users closer together. |
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\Circles\Controller; |
28
|
|
|
|
29
|
|
|
use \OCA\Circles\Model\Circle; |
30
|
|
|
use OCP\AppFramework\Http\TemplateResponse; |
31
|
|
|
|
32
|
|
|
class NavigationController extends BaseController { |
33
|
|
|
|
34
|
|
|
|
35
|
|
|
/** |
36
|
|
|
* @NoCSRFRequired |
37
|
|
|
* @NoAdminRequired |
38
|
|
|
* @NoSubAdminRequired |
39
|
|
|
* |
40
|
|
|
* @return TemplateResponse |
41
|
|
|
*/ |
42
|
|
|
public function navigate() { |
43
|
|
|
|
44
|
|
|
$data = [ |
45
|
|
|
'allowed_circles' => array( |
46
|
|
|
Circle::CIRCLES_PERSONAL => $this->configService->isCircleAllowed( |
47
|
|
|
Circle::CIRCLES_PERSONAL |
48
|
|
|
), |
49
|
|
|
Circle::CIRCLES_HIDDEN => $this->configService->isCircleAllowed( |
50
|
|
|
Circle::CIRCLES_HIDDEN |
51
|
|
|
), |
52
|
|
|
Circle::CIRCLES_PRIVATE => $this->configService->isCircleAllowed( |
53
|
|
|
Circle::CIRCLES_PRIVATE |
54
|
|
|
), |
55
|
|
|
Circle::CIRCLES_PUBLIC => $this->configService->isCircleAllowed( |
56
|
|
|
Circle::CIRCLES_PUBLIC |
57
|
|
|
), |
58
|
|
|
) |
59
|
|
|
]; |
60
|
|
|
|
61
|
|
|
|
62
|
|
|
return new TemplateResponse( |
63
|
|
|
'circles', 'navigate', $data |
64
|
|
|
); |
65
|
|
|
} |
66
|
|
|
|
67
|
|
|
|
68
|
|
|
} |