Probably will not work, because Laravel prepends first line of document with some spaces or what. However maybe its just behavior on my localhost.
277 lines
9.2 KiB
PHP
277 lines
9.2 KiB
PHP
<?php
|
|
|
|
/**
|
|
* This routing groups is used for routing along public part of website
|
|
*/
|
|
|
|
Route::pattern('id', '\d+');
|
|
Route::pattern('url', '[0-9\-a-z]+');
|
|
|
|
/*******************************************************************************/
|
|
|
|
/**
|
|
* This route group serves to handle request in admin
|
|
*/
|
|
Route::group([
|
|
'middleware' => ['web', 'auth', 'adminMenu'],
|
|
'namespace' => 'Admin',
|
|
'prefix' => 'admin'
|
|
], function () {
|
|
|
|
// these routes are available only for user with role admin
|
|
Route::group(['middleware' => 'onlyAdmin'], function () {
|
|
// display form for creating new user
|
|
Route::get('users/new', 'CreateNewUser@getNewUser')
|
|
->name('users.new');
|
|
|
|
// POST methods
|
|
// display form for creating new user
|
|
Route::post('users/new', 'CreateNewUser@postRegistration')
|
|
->name('users.newPost');
|
|
|
|
// display form for edit of existing user
|
|
Route::get('users/edit/{id}', 'EditUser@getEditExistingUser')
|
|
->name('users.edit');
|
|
|
|
// form for adding new custom field
|
|
Route::get('customfields/new', 'CreateNewCustomField@getNew')
|
|
->name('customfields.new');
|
|
|
|
// form for editing custom field
|
|
Route::get('customfields/edit/{id}', 'EditCustomField@getEditCustomField')
|
|
->name('customfields.edit');
|
|
|
|
// form for adding new custom field
|
|
Route::post('customfields/new', 'CreateNewCustomField@postNew')
|
|
->name('customfields.newPost');
|
|
|
|
// form for editing custom field
|
|
Route::post('customfields/edit/{id}', 'EditCustomField@postEditCustomField')
|
|
->name('customfields.editPost');
|
|
|
|
Route::get('customfields/delete/{id}', 'EditCustomField@deleteCustomField')
|
|
->name('customfields.delete');
|
|
|
|
Route::get('templates/overview/path/{id}', 'TemplateOverview@getPath')
|
|
->name('templates.overview');
|
|
|
|
Route::post('templates/copy', 'CopyTemplate@createCopy')
|
|
->name('templates.postCopy');
|
|
|
|
// Route::get('templates/new/{pathId}', 'TemplateOverview@getPath')
|
|
// ->name('templates.new');
|
|
|
|
Route::get('templates/edit/{id}', 'EditTemplate@getEdit')
|
|
->name('templates.edit');
|
|
|
|
Route::post('templates/edit/{id}', 'EditTemplate@postEdit')
|
|
->name('templates.postEdit');
|
|
});
|
|
|
|
// list of all static pages
|
|
Route::get('content/overview/{moduleId?}/{status?}', 'ContentOverview@getOverview')
|
|
->name('content.overview');
|
|
|
|
// form for creating new static page
|
|
Route::get('content/new/{moduleId}', 'CreateNewContent@getNew')
|
|
->name('content.new');
|
|
|
|
// form for editing existing static page
|
|
Route::get('content/edit/{id}', 'EditContent@getEdit')
|
|
->name('content.edit');
|
|
|
|
// post method for creating new static page
|
|
Route::post('content/new/{moduleId}', 'CreateNewContent@postNew')
|
|
->name('content.newPost');
|
|
|
|
// post method for creating new static page
|
|
Route::post('content/edit/{id}', 'EditContent@postEdit')
|
|
->name('content.editPost');
|
|
|
|
// routes for quick actions
|
|
|
|
// change status of page (protected, public or draft)
|
|
Route::get('content/status/{id}/{status}', 'EditContent@changeStatus')
|
|
->name('content.changeStatus');
|
|
|
|
// set homepage
|
|
Route::get('content/homepage/{id}', 'EditContent@setHomepage')
|
|
->name('content.setHomepage');
|
|
|
|
// delete page
|
|
Route::get('content/delete/{id}', 'EditContent@deletePage')
|
|
->name('content.delete');
|
|
|
|
// these routes are available for all logged (authenticated) users
|
|
|
|
// display dashboard with some usefull information
|
|
Route::get('/', 'Dashboard@getIndex')
|
|
->name('admin.dashboard');
|
|
|
|
// display user detail in admin
|
|
Route::get('users/detail/{id?}', 'UserDetail@getDetail')
|
|
->name('users.detail');
|
|
|
|
// method for saving edited data of user
|
|
Route::post('users/edit/{id}', 'EditUser@postEdit')
|
|
->name('users.editPost');
|
|
|
|
// display list of all users registered into our system
|
|
Route::get('users/overview/{state?}/{perPage?}', 'UsersOverview@getOverview')
|
|
->name('users.overview');
|
|
|
|
// history of changes for specified page
|
|
Route::get('history/{id}', 'History@getOverview')
|
|
->name('content.history');
|
|
|
|
// history of changes for specified page
|
|
Route::get('history/{revision}/{id}', 'History@getDiff')
|
|
->name('history.diff');
|
|
|
|
// list of all actions
|
|
Route::get('actions', 'ActionLogOverview@getOverview')
|
|
->name('log.overview');
|
|
|
|
// routes for widget areas
|
|
Route::get('widgets/areas/overview', 'WidgetAreaOverview@getOverview')
|
|
->name('widgetareas.overview');
|
|
|
|
// form for new widget area
|
|
Route::get('widgets/areas/new', 'CreateNewWidgetArea@getNew')
|
|
->name('widgetareas.new');
|
|
|
|
// form for new widget area
|
|
Route::post('widgets/areas/new', 'CreateNewWidgetArea@postNew')
|
|
->name('widgetareas.postNew');
|
|
|
|
// edit form for widget area
|
|
Route::get('widgets/areas/edit/{id}', 'EditWidgetArea@getEdit')
|
|
->name('widgetareas.edit');
|
|
|
|
Route::post('widgets/areas/edit/{id}', 'EditWidgetArea@postEdit')
|
|
->name('widgetareas.postEdit');
|
|
|
|
// edit form for widget area
|
|
Route::get('widgets/areas/delete/{id}', 'EditWidgetArea@deleteArea')
|
|
->name('widgetareas.delete');
|
|
|
|
// list of all installed widget types
|
|
Route::get('widgets/overview', 'WidgetsOverview@getOverview')
|
|
->name('widgets.overview');
|
|
|
|
// create new instance of widget of given type
|
|
Route::get('widgets/new/{type}', 'CreateNewWidget@getNew')
|
|
->name('widgets.new');
|
|
|
|
Route::post('widgets/new/{type}', 'CreateNewWidget@postNew')
|
|
->name('widgets.postNew');
|
|
|
|
// edit widget settings
|
|
Route::get('widgets/edit/{id}', 'EditWidget@getEdit')
|
|
->name('widgets.edit');
|
|
|
|
Route::post('widgets/edit/{id}', 'EditWidget@postEdit')
|
|
->name('widgets.postEdit');
|
|
|
|
// display form for association of widget and widget area
|
|
Route::get('widgets/associate/{widgetArea}', 'AssociateWidget@getList')
|
|
->name('widgets.associate');
|
|
|
|
Route::get('widgets/deassociate/{widgetId}/{widgetArea}', 'AssociateWidget@deleteAssociation')
|
|
->name('widgets.deleteAssociation');
|
|
|
|
Route::get('widgets/associate/{widgetId}/{widgetArea}', 'AssociateWidget@makeAssociation')
|
|
->name('widgets.makeAssociation');
|
|
|
|
// uploader methods
|
|
Route::get('directories/new/{id?}', 'CreateNewDirectory@getNew')
|
|
->name('upload.newDirectory');
|
|
|
|
Route::get('directories/edit/{id}', 'EditDirectory@getEdit')
|
|
->name('upload.editDirectory');
|
|
|
|
Route::post('directories/edit/{id}', 'EditDirectory@postEdit')
|
|
->name('upload.postEditDirectory');
|
|
|
|
Route::get('files/overview/{id?}/{type?}/{subtype?}', 'UploadedFilesOverview@getOverview')
|
|
->name('upload.overview');
|
|
|
|
route::post('directories/new', 'CreateNewDirectory@postNew')
|
|
->name('upload.postNewDirectory');
|
|
|
|
Route::get('upload/detail/{id}', 'EditUploadedFile@getDetail')
|
|
->name('upload.detail');
|
|
|
|
Route::post('upload/detail/{id}', 'EditUploadedFile@postEdit')
|
|
->name('upload.postEdit');
|
|
|
|
Route::get('upload/delete/{id}', 'EditUploadedFile@deleteFile')
|
|
->name('upload.delete');
|
|
|
|
// uploader methods
|
|
Route::post('upload/file', 'UploadFile@postFile')
|
|
->name('upload.postFile');
|
|
|
|
Route::post('upload/image', 'UploadFile@postImage')
|
|
->name('upload.postImage');
|
|
|
|
// form with settings
|
|
Route::get('settings', 'Settings@getOverview')
|
|
->name('settings.overview');
|
|
|
|
Route::post('settings', 'Settings@saveSettings')
|
|
->name('settings.save');
|
|
|
|
Route::get('search', 'Search@getSearch')
|
|
->name('search');
|
|
|
|
// custom fields
|
|
// ------------------------------
|
|
|
|
// list of all custom fields
|
|
Route::get('customfields/overview', 'CustomFieldsOverview@getOverview')
|
|
->name('customfields.overview');
|
|
|
|
// logout method
|
|
Route::get('logout', function () {
|
|
|
|
// remove user information
|
|
\Auth::logout();
|
|
|
|
// redirect to login form with info about successfull logout
|
|
return redirect()
|
|
->route('login')
|
|
->with('success', trans('admin/common.logoutSuccessfull'));
|
|
})
|
|
->name('logout');
|
|
});
|
|
|
|
/**************************************************************************************/
|
|
|
|
/**
|
|
* This section must be specified as last one
|
|
*/
|
|
|
|
Route::group(['middleware' => ['web']], function () {
|
|
|
|
Route::get('/', 'Visitor\Homepage@getIndex')
|
|
->name('page.index');
|
|
|
|
// display login form
|
|
Route::get('admin/login', function () {
|
|
return view('admin.loginForm.form');
|
|
})
|
|
->name('loginForm');
|
|
|
|
// handle login
|
|
Route::post('admin/login', 'Admin\Login@postLogin')
|
|
->name('login');
|
|
|
|
// route for sitemap
|
|
Route::get('sitemap.xml', 'Sitemap@getMap')
|
|
->name('sitemap');
|
|
|
|
// route for all content pages. This rule must be specified last (because it matches every route)
|
|
Route::get('{url}', 'Visitor\ContentPage@getPage')
|
|
->name('page.content');
|
|
}); |