- Add PublicCampaignsController for public campaign analytics
- Add public routes for /public/analytics/{slug} and /api/campaigns/{slug}
- Add public campaign analytics view with charts and KPIs
- Support for campaign sharing via custom slugs
- Real-time analytics with ApexCharts integration
78 lines
2.6 KiB
PHP
78 lines
2.6 KiB
PHP
<?php
|
|
namespace App\Modules\Redirects;
|
|
|
|
use App\Core\MenuManager;
|
|
use App\Core\View;
|
|
|
|
class Module
|
|
{
|
|
public static function getConfig(): array
|
|
{
|
|
return [
|
|
'name' => 'Redirects',
|
|
'version' => '1.0.0',
|
|
'description' => 'Sistema de redirects inteligentes com targeting server-side',
|
|
'author' => 'BitReport Unip. LDA',
|
|
'enabled' => true,
|
|
'dependencies' => ['Core', 'Analytics'],
|
|
'features' => [
|
|
'redirect_management' => true,
|
|
'server_side_targeting' => true,
|
|
'geo_targeting' => true,
|
|
'device_targeting' => true,
|
|
'browser_targeting' => true,
|
|
'time_targeting' => true,
|
|
'analytics_tracking' => true,
|
|
'performance_optimization' => true
|
|
]
|
|
];
|
|
}
|
|
|
|
public static function registerRoutes($router): void
|
|
{
|
|
require __DIR__ . '/Routes/web.php';
|
|
require __DIR__ . '/Routes/api.php';
|
|
require __DIR__ . '/Routes/public.php';
|
|
}
|
|
|
|
public static function registerServices(): void
|
|
{
|
|
// Registar namespace das views do módulo
|
|
View::addNamespace('redirects', __DIR__ . '/Views');
|
|
|
|
// Registar serviços do módulo no ServiceContainer
|
|
$container = \App\Core\ServiceContainer::getInstance();
|
|
|
|
// Registar modelos
|
|
$container->registerModuleService('Redirects', 'model.RedirectModel', function() {
|
|
return new \App\Modules\Redirects\Models\RedirectModel();
|
|
}, true);
|
|
|
|
$container->registerModuleService('Redirects', 'model.RedirectFilterModel', function() {
|
|
return new \App\Modules\Redirects\Models\RedirectFilterModel();
|
|
}, true);
|
|
|
|
$container->registerModuleService('Redirects', 'model.RedirectStatsModel', function() {
|
|
return new \App\Modules\Redirects\Models\RedirectStatsModel();
|
|
}, true);
|
|
|
|
// Registar serviços
|
|
if (file_exists(__DIR__ . '/Services/RedirectProcessor.php')) {
|
|
require_once __DIR__ . '/Services/RedirectProcessor.php';
|
|
$container->registerModuleService('Redirects', 'RedirectProcessor', function() {
|
|
return new \App\Modules\Redirects\Services\RedirectProcessor();
|
|
}, true);
|
|
}
|
|
|
|
|
|
}
|
|
|
|
public static function registerMenu(): void
|
|
{
|
|
// Carregar ficheiro de menu do módulo
|
|
$menuFile = __DIR__ . '/menu.php';
|
|
if (file_exists($menuFile)) {
|
|
require $menuFile;
|
|
}
|
|
}
|
|
}
|