1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* ownCloud - Tasks |
4
|
|
|
* |
5
|
|
|
* @author Raimund Schlüßler |
6
|
|
|
* @copyright 2015 Raimund Schlüßler [email protected] |
7
|
|
|
* |
8
|
|
|
* This library is free software; you can redistribute it and/or |
9
|
|
|
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE |
10
|
|
|
* License as published by the Free Software Foundation; either |
11
|
|
|
* version 3 of the License, or any later version. |
12
|
|
|
* |
13
|
|
|
* This library is distributed in the hope that it will be useful, |
14
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
15
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16
|
|
|
* GNU AFFERO GENERAL PUBLIC LICENSE for more details. |
17
|
|
|
* |
18
|
|
|
* You should have received a copy of the GNU Affero General Public |
19
|
|
|
* License along with this library. If not, see <http://www.gnu.org/licenses/>. |
20
|
|
|
* |
21
|
|
|
*/ |
22
|
|
|
|
23
|
|
|
namespace OCA\Tasks\Controller; |
24
|
|
|
|
25
|
|
|
use \OCP\AppFramework\Controller; |
26
|
|
|
use \OCP\AppFramework\Http\TemplateResponse; |
27
|
|
|
|
28
|
|
|
/** |
29
|
|
|
* Controller class for main page. |
30
|
|
|
*/ |
31
|
|
|
class PageController extends Controller { |
32
|
|
|
|
33
|
|
|
/** |
34
|
|
|
* @param string $appName |
35
|
|
|
* @param IConfig $config |
36
|
|
|
*/ |
37
|
|
|
public function __construct($appName, IRequest $request, |
38
|
|
|
$userId, IConfig $config) { |
39
|
|
|
parent::__construct($appName, $request); |
40
|
|
|
$this->config = $config; |
41
|
|
|
$this->userId = $userId; |
42
|
|
|
$this->userSession = $userSession; |
|
|
|
|
43
|
|
|
} |
44
|
|
|
|
45
|
|
|
|
46
|
|
|
/** |
47
|
|
|
* @NoAdminRequired |
48
|
|
|
* @NoCSRFRequired |
49
|
|
|
*/ |
50
|
|
|
public function index() { |
51
|
|
|
if (defined('DEBUG') && DEBUG) { |
52
|
|
|
script('tasks', 'vendor/angular/angular'); |
53
|
|
|
script('tasks', 'vendor/angular-route/angular-route'); |
54
|
|
|
script('tasks', 'vendor/angular-animate/angular-animate'); |
55
|
|
|
script('tasks', 'vendor/angular-sanitize/angular-sanitize'); |
56
|
|
|
script('tasks', 'vendor/angular-draganddrop/angular-drag-and-drop-lists'); |
57
|
|
|
script('tasks', 'vendor/angular-ui-select/dist/select'); |
58
|
|
|
script('tasks', 'vendor/jstzdetect/jstz'); |
59
|
|
|
} else { |
60
|
|
|
script('tasks', 'vendor/angular/angular.min'); |
61
|
|
|
script('tasks', 'vendor/angular-route/angular-route.min'); |
62
|
|
|
script('tasks', 'vendor/angular-animate/angular-animate.min'); |
63
|
|
|
script('tasks', 'vendor/angular-sanitize/angular-sanitize.min'); |
64
|
|
|
script('tasks', 'vendor/angular-draganddrop/angular-drag-and-drop-lists.min'); |
65
|
|
|
script('tasks', 'vendor/angular-ui-select/dist/select.min'); |
66
|
|
|
script('tasks', 'vendor/jstzdetect/jstz.min'); |
67
|
|
|
} |
68
|
|
|
script('tasks', 'public/app'); |
69
|
|
|
script('tasks', 'vendor/jquery-timepicker/jquery.ui.timepicker'); |
70
|
|
|
script('tasks', 'vendor/davclient.js/lib/client'); |
71
|
|
|
script('tasks', 'vendor/ical.js/build/ical'); |
72
|
|
|
style('tasks', 'style'); |
73
|
|
|
style('tasks', 'vendor/angularui/ui-select/select2'); |
74
|
|
|
|
75
|
|
|
$day = new \DateTime('today'); |
76
|
|
|
$day = $day->format('d'); |
|
|
|
|
77
|
|
|
|
78
|
|
|
$appVersion = $this->config->getAppValue($this->appName, 'installed_version'); |
79
|
|
|
$response = new TemplateResponse('tasks', 'main'); |
80
|
|
|
$response->setParams(array( |
81
|
|
|
'appVersion' => $appVersion |
82
|
|
|
)); |
83
|
|
|
|
84
|
|
|
return $response; |
85
|
|
|
} |
86
|
|
|
} |
87
|
|
|
|
This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.