2014-04-05 23:09:35 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* @author Thomas Tanghus
|
|
|
|
* @copyright 2014 Thomas Tanghus (thomas@tanghus.net)
|
|
|
|
*
|
|
|
|
* This file is licensed under the Affero General Public License version 3 or
|
|
|
|
* later.
|
|
|
|
* See the COPYING-README file.
|
|
|
|
*/
|
|
|
|
|
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 {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @NoAdminRequired
|
|
|
|
* @NoCSRFRequired
|
|
|
|
*/
|
|
|
|
public function index() {
|
|
|
|
if (defined('DEBUG') && DEBUG) {
|
2014-07-30 19:03:54 +00:00
|
|
|
\OCP\Util::addScript('tasks', 'vendor/angularjs/angular');
|
|
|
|
\OCP\Util::addScript('tasks', 'vendor/angularjs/angular-route');
|
|
|
|
\OCP\Util::addScript('tasks', 'vendor/angularjs/angular-animate');
|
2015-05-24 10:09:05 +00:00
|
|
|
\OCP\Util::addScript('tasks', 'vendor/angularjs/angular-sanitize');
|
|
|
|
\OCP\Util::addScript('tasks', 'vendor/angularui/ui-select/select');
|
2014-07-30 19:03:54 +00:00
|
|
|
\OCP\Util::addScript('tasks', 'vendor/bootstrap/ui-bootstrap-custom-tpls-0.10.0');
|
2014-04-05 23:09:35 +00:00
|
|
|
} else {
|
2014-07-30 19:03:54 +00:00
|
|
|
\OCP\Util::addScript('tasks', 'vendor/angularjs/angular.min');
|
|
|
|
\OCP\Util::addScript('tasks', 'vendor/angularjs/angular-route.min');
|
|
|
|
\OCP\Util::addScript('tasks', 'vendor/angularjs/angular-animate.min');
|
2015-05-24 10:09:05 +00:00
|
|
|
\OCP\Util::addScript('tasks', 'vendor/angularjs/angular-sanitize.min');
|
|
|
|
\OCP\Util::addScript('tasks', 'vendor/angularui/ui-select/select.min');
|
2014-07-30 19:03:54 +00:00
|
|
|
\OCP\Util::addScript('tasks', 'vendor/bootstrap/ui-bootstrap-custom-tpls-0.10.0.min');
|
2014-04-05 23:09:35 +00:00
|
|
|
}
|
2014-07-30 19:03:54 +00:00
|
|
|
\OCP\Util::addScript('tasks', 'public/app');
|
|
|
|
\OCP\Util::addScript('tasks', 'vendor/appframework/app');
|
|
|
|
\OCP\Util::addScript('tasks', 'vendor/timepicker/jquery.ui.timepicker');
|
|
|
|
\OCP\Util::addStyle('tasks', 'style');
|
|
|
|
\OCP\Util::addStyle('tasks', 'vendor/bootstrap/bootstrap');
|
2015-05-24 10:09:05 +00:00
|
|
|
\OCP\Util::addStyle('tasks', 'vendor/angularui/ui-select/select2');
|
2014-04-05 23:09:35 +00:00
|
|
|
|
2014-04-19 18:28:22 +00:00
|
|
|
$date = new \DateTimeZone(\OC_Calendar_App::getTimezone());
|
|
|
|
$day = new \DateTime('today', $date);
|
|
|
|
$day = $day->format('d');
|
|
|
|
|
2014-04-05 23:09:35 +00:00
|
|
|
// TODO: Make a HTMLTemplateResponse class
|
2014-07-30 19:03:54 +00:00
|
|
|
$response = new TemplateResponse('tasks', 'main');
|
2014-04-19 18:28:22 +00:00
|
|
|
$response->setParams(array(
|
|
|
|
'DOM' => $day
|
|
|
|
));
|
2014-04-05 23:09:35 +00:00
|
|
|
|
|
|
|
return $response;
|
|
|
|
}
|
|
|
|
}
|