45 lines
1.7 KiB
PHP
Executable File
45 lines
1.7 KiB
PHP
Executable File
<?php
|
|
|
|
/**
|
|
* SysCMS - Content Management System
|
|
*
|
|
* Copyright (c) 2025 Marco Costa
|
|
* All rights reserved.
|
|
*
|
|
* Author: Marco Costa
|
|
* Email: contato@syspanel.com.br
|
|
* Project: SysCMS
|
|
*
|
|
* This software is licensed, not sold.
|
|
* Permission is granted to use this software
|
|
* subject to the terms of the SysCMS Commercial License.
|
|
*
|
|
* Redistribution, sublicensing, resale, or
|
|
* disclosure of this software, in whole or in part,
|
|
* is strictly prohibited without prior written permission.
|
|
*
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
|
|
*/
|
|
|
|
use Kernel\Application;
|
|
|
|
/**
|
|
* Register contact module routes
|
|
*
|
|
* @param Application $app
|
|
* @return void
|
|
*/
|
|
return function (Application $app) {
|
|
// Public contact form
|
|
$app->addRoute('GET', '/contact', [\Modules\Contact\Controllers\ContactController::class, 'index']);
|
|
$app->addRoute('POST', '/contact/submit', [\Modules\Contact\Controllers\ContactController::class, 'submit']);
|
|
|
|
// Admin contact management
|
|
$app->addRoute('GET', '/admin/contacts', [\Modules\Contact\Controllers\ContactController::class, 'list']);
|
|
$app->addRoute('GET', '/admin/contacts/{id}', [\Modules\Contact\Controllers\ContactController::class, 'show']);
|
|
$app->addRoute('POST', '/admin/contacts/{id}/status', [\Modules\Contact\Controllers\ContactController::class, 'updateStatus']);
|
|
$app->addRoute('POST', '/admin/contacts/{id}/response', [\Modules\Contact\Controllers\ContactController::class, 'updateResponse']);
|
|
$app->addRoute('POST', '/admin/contacts/{id}/toggle-read', [\Modules\Contact\Controllers\ContactController::class, 'toggleRead']);
|
|
$app->addRoute('DELETE', '/admin/contacts/{id}', [\Modules\Contact\Controllers\ContactController::class, 'delete']);
|
|
};
|