Esempio n. 1
0
<?php

use Avalon\Routing\Router;
$ns = "Traq\\Controllers\\";
Router::addToken('pslug', '(?P<pslug>[^/]*?)');
Router::addExtension('txt');
Router::root("{$ns}Projects::index");
// -----------------------------------------------------------------------------
// User routes
Router::get('register', '/register', "{$ns}Users::new");
Router::post('user_create', '/register', "{$ns}Users::create");
Router::get('login', '/login', "{$ns}Sessions::new");
Router::post('session_create', '/login', "{$ns}Sessions::create");
Router::delete('logout', '/logout', "{$ns}Sessions::destroy");
Router::get('user', '/users/{id}', "{$ns}Users::show");
Router::get('usercp', '/usercp', "{$ns}UserCP::index");
// -----------------------------------------------------------------------------
// Admin routes
require __DIR__ . '/routes/admin.php';
// -----------------------------------------------------------------------------
// Project routes
require __DIR__ . '/routes/projects.php';
// -----------------------------------------------------------------------------
// Project settings routes
require __DIR__ . '/routes/project_settings.php';
Esempio n. 2
0
File: admin.php Progetto: nirix/traq
// -----------------------------------------------------------------------------
// Statuses
Router::get('admin_statuses', '/admin/statuses', "{$ans}Statuses::index");
Router::get('admin_new_status', '/admin/statuses/new', "{$ans}Statuses::new");
Router::post('admin_create_status', '/admin/statuses', "{$ans}Statuses::create");
Router::get('admin_edit_status', '/admin/statuses/{id}/edit', "{$ans}Statuses::edit");
Router::put('admin_save_status', '/admin/statuses/{id}', "{$ans}Statuses::save")->method(['PUT', 'PATCH']);
Router::delete('admin_delete_status', '/admin/statuses/{id}/delete', "{$ans}Statuses::destroy");
// -----------------------------------------------------------------------------
// Priorities
Router::get('admin_priorities', '/admin/priorities', "{$ans}Priorities::index");
Router::get('admin_new_priority', '/admin/priorities/new', "{$ans}Priorities::new");
Router::post('admin_create_priority', '/admin/priorities', "{$ans}Priorities::create");
Router::get('admin_edit_priority', '/admin/priorities/{id}/edit', "{$ans}Priorities::edit");
Router::put('admin_save_priority', '/admin/priorities/{id}', "{$ans}Priorities::save")->method(['PUT', 'PATCH']);
Router::delete('admin_delete_priority', '/admin/priorities/{id}/delete', "{$ans}Priorities::destroy");
// -----------------------------------------------------------------------------
// Severities
Router::get('admin_severities', '/admin/severities', "{$ans}Severities::index");
Router::get('admin_new_severity', '/admin/severities/new', "{$ans}Severities::new");
Router::post('admin_create_severity', '/admin/severities', "{$ans}Severities::create");
Router::get('admin_edit_severity', '/admin/severities/{id}/edit', "{$ans}Severities::edit");
Router::put('admin_save_severity', '/admin/severities/{id}', "{$ans}Severities::save")->method(['PUT', 'PATCH']);
Router::delete('admin_delete_severity', '/admin/severities/{id}/delete', "{$ans}Severities::destroy");
// -----------------------------------------------------------------------------
// Permissions
Router::get('admin_permissions', '/admin/permissions', "{$ans}Permissions::usergroups");
Router::get('admin_permissions_usergroups', '/admin/permissions/usergroups', "{$ans}Permissions::usergroups");
Router::post('admin_permissions_usergroups_save', '/admin/permissions/usergroups', "{$ans}Permissions::saveUsergroups");
Router::get('admin_permissions_roles', '/admin/permissions/roles', "{$ans}Permissions::roles");
Router::post('admin_permissions_roles_save', '/admin/permissions/roles', "{$ans}Permissions::saveRoles");
Esempio n. 3
0
<?php

use Avalon\Routing\Router;
Router::root('Dreamer\\Controllers\\Articles::index');
Router::set404('Dreamer\\Controllers\\Errors::notFound');
Router::post('login', '/login', 'Dreamer\\Controllers\\Sessions::new');
Router::post('register', '/users', 'Dreamer\\Controllers\\Users::new');
Router::delete('logout', '/logout', 'Dreamer\\Controllers\\Sessions::destroy');
Router::get('admin_current_user', '/admin/current-user', 'Dreamer\\Controllers\\Admin\\Catchall::currentUser');
Router::get('admin', '/admin.*', 'Dreamer\\Controllers\\Admin\\Catchall::index');
Esempio n. 4
0
Router::delete('timeline_delete_event', '/{pslug}/timeline/{id}', "{$ns}Timeline::deleteEvent");
// Roadmap
Router::get('roadmap', '/{pslug}/roadmap', "{$ns}Roadmap::index");
Router::get('roadmap_all', '/{pslug}/roadmap/all', "{$ns}Roadmap::index", ['filter' => 'all']);
Router::get('roadmap_completed', '/{pslug}/roadmap/completed', "{$ns}Roadmap::index", ['filter' => 'completed']);
Router::get('roadmap_cancelled', '/{pslug}/roadmap/cancelled', "{$ns}Roadmap::index", ['filter' => 'cancelled']);
Router::get('milestone', '/{pslug}/milestone/{slug}', "{$ns}Roadmap::show");
// Tickets
Router::get('tickets', '/{pslug}/tickets', "{$ns}TicketListing::index");
Router::get('ticket', '/{pslug}/tickets/{id}', "{$ns}Tickets::show");
Router::get('new_ticket', '/{pslug}/tickets/new', "{$ns}Tickets::new");
Router::post('create_ticket', '/{pslug}/tickets', "{$ns}Tickets::create");
Router::post('tickets_set_columns', '/{pslug}/tickets/set-columns', "{$ns}TicketListing::setColumns");
Router::post('tickets_set_filters', '/{pslug}/tickets/set-filters', "{$ns}TicketListing::setFilters");
Router::put('update_ticket', '/{pslug}/tickets/{id}', "{$ns}Tickets::update")->method(['PUT', 'PATCH']);
Router::get('ticket_edit_description', '/{pslug}/tickets/{id}/edit-description', "{$ns}Tickets::editDescription");
Router::post('ticket_save_description', '/{pslug}/tickets/{id}/edit-description', "{$ns}Tickets::saveDescription");
Router::get('ticket_edit_comment', '/{pslug}/tickets/history/{id}/edit', "{$ns}TicketHistory::edit");
Router::delete('ticket_delete_comment', '/{pslug}/tickets/history/{id}', "{$ns}TicketHistory::destroy");
// Wiki
Router::get('wiki', '/{pslug}/wiki', "{$ns}Wiki::show", ['slug' => 'main']);
Router::get('wiki_pages', '/{pslug}/wiki/_pages', "{$ns}Wiki::pages");
Router::get('wiki_new', '/{pslug}/wiki/_new', "{$ns}Wiki::new");
Router::post('wiki_create', '/{pslug}/wiki', "{$ns}Wiki::create");
Router::get('wiki_page', '/{pslug}/wiki/{slug}', "{$ns}Wiki::show");
Router::get('wiki_revisions', '/{pslug}/wiki/{slug}/_revisions', "{$ns}Wiki::revisions");
Router::get('wiki_revision', '/{pslug}/wiki/{slug}/_revisions/{id}', "{$ns}Wiki::revision");
Router::get('wiki_edit', '/{pslug}/wiki/{slug}/_edit', "{$ns}Wiki::edit");
Router::put('wiki_save', '/{pslug}/wiki/{slug}', "{$ns}Wiki::save")->method(['PUT', 'PATCH']);
Router::delete('wiki_delete', '/{pslug}/wiki/{slug}', "{$ns}Wiki::destroy");
Esempio n. 5
0
// -----------------------------------------------------------------------------
// Milestones
Router::get("{$pn}milestones", "{$purl}/milestones", "{$pns}Milestones::index");
Router::get("{$pn}new_milestone", "{$purl}/milestones/new", "{$pns}Milestones::new");
Router::post("{$pn}create_milestone", "{$purl}/milestones", "{$pns}Milestones::create");
Router::get("{$pn}edit_milestone", "{$purl}/milestones/{id}/edit", "{$pns}Milestones::edit");
Router::put("{$pn}save_milestone", "{$purl}/milestones/{id}", "{$pns}Milestones::save")->method(['PUT', 'PATCH']);
Router::get("{$pn}delete_milestone", "{$purl}/milestones/{id}/delete", "{$pns}Milestones::delete");
// -----------------------------------------------------------------------------
// Components
Router::get("{$pn}components", "{$purl}/components", "{$pns}Components::index");
Router::get("{$pn}new_component", "{$purl}/components/new", "{$pns}Components::new");
Router::post("{$pn}create_component", "{$purl}/components", "{$pns}Components::create");
Router::get("{$pn}edit_component", "{$purl}/components/{id}/edit", "{$pns}Components::edit");
Router::put("{$pn}save_component", "{$purl}/components/{id}", "{$pns}Components::save")->method(['PUT', 'PATCH']);
Router::delete("{$pn}delete_component", "{$purl}/components/{id}/delete", "{$pns}Components::destroy");
// -----------------------------------------------------------------------------
// Members
Router::get("{$pn}members", "{$purl}/members", "{$pns}Members::index");
Router::post("{$pn}create_member", "{$purl}/members", "{$pns}Members::create");
Router::put("{$pn}save_members", "{$purl}/members", "{$pns}Members::saveAll");
Router::delete("{$pn}delete_member", "{$purl}/members/{id}", "{$pns}Members::destroy");
// -----------------------------------------------------------------------------
// Custom fields
Router::get("{$pn}custom_fields", "{$purl}/custom-fields", "{$pns}CustomFields::index");
Router::get("{$pn}new_custom_field", "{$purl}/custom-fields/new", "{$pns}CustomFields::new");
Router::post("{$pn}create_custom_field", "{$purl}/custom-fields", "{$pns}CustomFields::create");
Router::get("{$pn}edit_custom_field", "{$purl}/custom-fields/{id}/edit", "{$pns}CustomFields::edit");
Router::put("{$pn}save_custom_field", "{$purl}/custom-fields/{id}", "{$pns}CustomFields::save");
Router::delete("{$pn}delete_custom_field", "{$purl}/custom-fields/{id}", "{$pns}CustomFields::destroy");