2014-04-05 23:09:35 +00:00
|
|
|
<?php
|
|
|
|
/**
|
2015-07-19 12:05:29 +00:00
|
|
|
* ownCloud - Tasks
|
|
|
|
*
|
|
|
|
* @author Raimund Schlüßler
|
|
|
|
* @copyright 2015 Raimund Schlüßler raimund.schluessler@googlemail.com
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 3 of the License, or any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Affero General Public
|
|
|
|
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
2014-04-05 23:09:35 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2014-07-30 19:03:54 +00:00
|
|
|
namespace OCA\Tasks\Controller;
|
2014-04-05 23:09:35 +00:00
|
|
|
|
2014-08-17 20:35:34 +00:00
|
|
|
use \OCP\AppFramework\Controller;
|
|
|
|
use \OCP\AppFramework\Http\TemplateResponse;
|
2014-04-05 23:09:35 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Controller class for main page.
|
|
|
|
*/
|
|
|
|
class PageController extends Controller {
|
|
|
|
|
2016-03-01 20:48:25 +00:00
|
|
|
/**
|
|
|
|
* @param string $appName
|
|
|
|
* @param IConfig $config
|
|
|
|
*/
|
|
|
|
public function __construct($appName, IRequest $request,
|
|
|
|
$userId, IConfig $config) {
|
|
|
|
parent::__construct($appName, $request);
|
|
|
|
$this->config = $config;
|
|
|
|
$this->userId = $userId;
|
|
|
|
$this->userSession = $userSession;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-04-05 23:09:35 +00:00
|
|
|
/**
|
|
|
|
* @NoAdminRequired
|
|
|
|
* @NoCSRFRequired
|
|
|
|
*/
|
|
|
|
public function index() {
|
|
|
|
if (defined('DEBUG') && DEBUG) {
|
2016-02-13 13:42:14 +00:00
|
|
|
script('tasks', 'vendor/angular/angular');
|
|
|
|
script('tasks', 'vendor/angular-route/angular-route');
|
|
|
|
script('tasks', 'vendor/angular-animate/angular-animate');
|
|
|
|
script('tasks', 'vendor/angular-sanitize/angular-sanitize');
|
|
|
|
script('tasks', 'vendor/angular-draganddrop/angular-drag-and-drop-lists');
|
|
|
|
script('tasks', 'vendor/angular-ui-select/dist/select');
|
|
|
|
script('tasks', 'vendor/jstzdetect/jstz');
|
2014-04-05 23:09:35 +00:00
|
|
|
} else {
|
2016-02-13 13:42:14 +00:00
|
|
|
script('tasks', 'vendor/angular/angular.min');
|
|
|
|
script('tasks', 'vendor/angular-route/angular-route.min');
|
|
|
|
script('tasks', 'vendor/angular-animate/angular-animate.min');
|
|
|
|
script('tasks', 'vendor/angular-sanitize/angular-sanitize.min');
|
|
|
|
script('tasks', 'vendor/angular-draganddrop/angular-drag-and-drop-lists.min');
|
|
|
|
script('tasks', 'vendor/angular-ui-select/dist/select.min');
|
|
|
|
script('tasks', 'vendor/jstzdetect/jstz.min');
|
2014-04-05 23:09:35 +00:00
|
|
|
}
|
2016-02-13 13:42:14 +00:00
|
|
|
script('tasks', 'public/app');
|
|
|
|
script('tasks', 'vendor/jquery-timepicker/jquery.ui.timepicker');
|
|
|
|
script('tasks', 'vendor/davclient.js/lib/client');
|
|
|
|
script('tasks', 'vendor/ical.js/build/ical');
|
|
|
|
style('tasks', 'style');
|
|
|
|
style('tasks', 'vendor/angularui/ui-select/select2');
|
2014-04-05 23:09:35 +00:00
|
|
|
|
2016-02-13 13:38:27 +00:00
|
|
|
$day = new \DateTime('today');
|
2014-04-19 18:28:22 +00:00
|
|
|
$day = $day->format('d');
|
|
|
|
|
2016-03-01 20:48:25 +00:00
|
|
|
$appVersion = $this->config->getAppValue($this->appName, 'installed_version');
|
2014-07-30 19:03:54 +00:00
|
|
|
$response = new TemplateResponse('tasks', 'main');
|
2014-04-19 18:28:22 +00:00
|
|
|
$response->setParams(array(
|
2016-03-01 20:48:25 +00:00
|
|
|
'appVersion' => $appVersion
|
2014-04-19 18:28:22 +00:00
|
|
|
));
|
2014-04-05 23:09:35 +00:00
|
|
|
|
|
|
|
return $response;
|
|
|
|
}
|
2015-07-13 11:55:35 +00:00
|
|
|
}
|