tasks/appinfo/routes.php

212 lines
4.9 KiB
PHP
Raw Normal View History

2014-03-28 19:11:56 +00:00
<?php
/**
* ownCloud - Tasks
*
* @author Raimund Schlüßler
2014-04-05 23:09:35 +00:00
* @copyright 2014 Raimund Schlüßler raimund.schluessler@googlemail.com
2014-03-28 19:11:56 +00:00
*
* 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/>.
*
*/
namespace OCA\Tasks_enhanced;
2014-04-05 23:09:35 +00:00
use OCA\Tasks_enhanced\Dispatcher;
2014-03-28 19:11:56 +00:00
2014-04-05 23:09:35 +00:00
//define the routes
$this->create('tasks_enhanced_index', '/')
->get()
->action(
function($params){
2014-04-09 19:30:53 +00:00
session_write_close();
2014-04-05 23:09:35 +00:00
$dispatcher = new Dispatcher($params);
$dispatcher->dispatch('PageController', 'index');
}
);
2014-03-28 19:11:56 +00:00
/*
* Lists
*/
2014-04-05 23:09:35 +00:00
$this->create('getLists', '/lists')
->get()
->action(
function($params){
2014-04-09 19:30:53 +00:00
session_write_close();
2014-04-05 23:09:35 +00:00
$dispatcher = new Dispatcher($params);
$dispatcher->dispatch('ListsController', 'getLists');
}
);
$this->create('list_add', '/lists/add')
2014-04-05 23:09:35 +00:00
->post()
->action(
function($params){
2014-04-09 19:30:53 +00:00
session_write_close();
2014-04-05 23:09:35 +00:00
$dispatcher = new Dispatcher($params);
$dispatcher->dispatch('ListsController', 'addList');
}
);
$this->create('list_delete', '/lists/{listID}/delete')
->post()
->action(
function($params){
2014-04-09 19:30:53 +00:00
session_write_close();
2014-04-05 23:09:35 +00:00
$dispatcher = new Dispatcher($params);
$dispatcher->dispatch('ListsController', 'deleteList');
}
);
$this->create('list_name', '/lists/{listID}/name')
->post()
->action(
function($params){
2014-04-09 19:30:53 +00:00
session_write_close();
2014-04-05 23:09:35 +00:00
$dispatcher = new Dispatcher($params);
$dispatcher->dispatch('ListsController', 'setListName');
}
);
2014-03-28 19:11:56 +00:00
/*
* Tasks
*/
2014-04-05 23:09:35 +00:00
$this->create('getTasks', '/tasks')
->get()
->action(
function($params){
2014-04-09 19:30:53 +00:00
session_write_close();
2014-04-05 23:09:35 +00:00
$dispatcher = new Dispatcher($params);
$dispatcher->dispatch('TasksController', 'getTasks');
}
);
$this->create('task_star', '/tasks/{taskID}/star')
->post()
->action(
function($params){
2014-04-09 19:30:53 +00:00
session_write_close();
2014-04-05 23:09:35 +00:00
$dispatcher = new Dispatcher($params);
$dispatcher->dispatch('TasksController', 'starTask');
}
);
$this->create('task_unstar', '/tasks/{taskID}/unstar')
->post()
->action(
function($params){
2014-04-09 19:30:53 +00:00
session_write_close();
2014-04-05 23:09:35 +00:00
$dispatcher = new Dispatcher($params);
$dispatcher->dispatch('TasksController', 'unstarTask');
}
);
$this->create('task_complete', '/tasks/{taskID}/complete')
->post()
->action(
function($params){
2014-04-09 19:30:53 +00:00
session_write_close();
2014-04-05 23:09:35 +00:00
$dispatcher = new Dispatcher($params);
$dispatcher->dispatch('TasksController', 'completeTask');
}
);
$this->create('task_uncomplete', '/tasks/{taskID}/uncomplete')
->post()
->action(
function($params){
2014-04-09 19:30:53 +00:00
session_write_close();
2014-04-05 23:09:35 +00:00
$dispatcher = new Dispatcher($params);
$dispatcher->dispatch('TasksController', 'uncompleteTask');
}
);
$this->create('task_add', '/tasks/add')
2014-04-05 23:09:35 +00:00
->post()
->action(
function($params){
2014-04-09 19:30:53 +00:00
session_write_close();
2014-04-05 23:09:35 +00:00
$dispatcher = new Dispatcher($params);
$dispatcher->dispatch('TasksController', 'addTask');
}
);
$this->create('task_delete', '/tasks/{taskID}/delete')
->post()
->action(
function($params){
2014-04-09 19:30:53 +00:00
session_write_close();
2014-04-05 23:09:35 +00:00
$dispatcher = new Dispatcher($params);
$dispatcher->dispatch('TasksController', 'deleteTask');
}
);
$this->create('task_name', '/tasks/{taskID}/name')
->post()
->action(
function($params){
2014-04-09 19:30:53 +00:00
session_write_close();
2014-04-05 23:09:35 +00:00
$dispatcher = new Dispatcher($params);
$dispatcher->dispatch('TasksController', 'setTaskName');
}
);
$this->create('task_calendar', '/tasks/{taskID}/calendar')
->post()
->action(
function($params){
2014-04-09 19:30:53 +00:00
session_write_close();
2014-04-05 23:09:35 +00:00
$dispatcher = new Dispatcher($params);
$dispatcher->dispatch('TasksController', 'setTaskCalendar');
}
);
$this->create('task_note', '/tasks/{taskID}/note')
->post()
->action(
function($params){
2014-04-09 19:30:53 +00:00
session_write_close();
2014-04-05 23:09:35 +00:00
$dispatcher = new Dispatcher($params);
$dispatcher->dispatch('TasksController', 'setTaskNote');
}
);
$this->create('task_due', '/tasks/{taskID}/due')
->post()
->action(
function($params){
2014-04-09 19:30:53 +00:00
session_write_close();
2014-04-05 23:09:35 +00:00
$dispatcher = new Dispatcher($params);
$dispatcher->dispatch('TasksController', 'setDueDate');
}
);
$this->create('task_start', '/tasks/{taskID}/start')
->post()
->action(
function($params){
session_write_close();
$dispatcher = new Dispatcher($params);
$dispatcher->dispatch('TasksController', 'setStartDate');
}
);
2014-04-05 23:09:35 +00:00
$this->create('task_reminder', '/tasks/{taskID}/reminder')
->post()
->action(
function($params){
2014-04-09 19:30:53 +00:00
session_write_close();
2014-04-05 23:09:35 +00:00
$dispatcher = new Dispatcher($params);
$dispatcher->dispatch('TasksController', 'setReminderDate');
}
);