212 lines
8.6 KiB
PHP
Executable File
212 lines
8.6 KiB
PHP
Executable File
<?php
|
|
require_once __DIR__ . '/../shared/bootstrap.php';
|
|
|
|
// El bootstrap.php ya maneja la autenticación y carga $userData
|
|
// $userData está disponible globalmente a través de JWTAuth::getUserData() si se necesita de nuevo
|
|
?>
|
|
<!DOCTYPE html>
|
|
<html lang="<?php echo $userData->idioma ?? 'es'; ?>">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title><?php echo __('telegram_dashboard_title'); ?></title>
|
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
|
<style>
|
|
:root {
|
|
--telegram-color: #0088cc;
|
|
--telegram-dark: #006699;
|
|
}
|
|
|
|
* {
|
|
margin: 0;
|
|
padding: 0;
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
body {
|
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
|
background: linear-gradient(135deg, var(--telegram-color) 0%, var(--telegram-dark) 100%);
|
|
min-height: 100vh;
|
|
padding: 20px;
|
|
}
|
|
|
|
.header {
|
|
background: white;
|
|
border-radius: 15px;
|
|
padding: 20px 30px;
|
|
margin-bottom: 30px;
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
|
|
}
|
|
|
|
.header h1 {
|
|
color: var(--telegram-color);
|
|
font-size: 24px;
|
|
}
|
|
|
|
.btn-back {
|
|
background: #6c757d;
|
|
color: white;
|
|
padding: 10px 20px;
|
|
border-radius: 8px;
|
|
text-decoration: none;
|
|
transition: transform 0.2s;
|
|
}
|
|
|
|
.btn-back:hover {
|
|
transform: translateY(-2px);
|
|
}
|
|
|
|
.container {
|
|
max-width: 1400px;
|
|
margin: 0 auto;
|
|
}
|
|
|
|
.modules-grid {
|
|
display: grid;
|
|
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
|
|
gap: 20px;
|
|
}
|
|
|
|
.module-card {
|
|
background: white;
|
|
border-radius: 15px;
|
|
padding: 30px;
|
|
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
|
|
transition: all 0.3s;
|
|
cursor: pointer;
|
|
text-decoration: none;
|
|
color: inherit;
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
}
|
|
|
|
.module-card:hover {
|
|
transform: translateY(-5px);
|
|
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
|
|
}
|
|
|
|
.module-icon {
|
|
font-size: 48px;
|
|
margin-bottom: 15px;
|
|
color: var(--telegram-color);
|
|
}
|
|
|
|
.module-title {
|
|
font-size: 18px;
|
|
font-weight: 700;
|
|
margin-bottom: 10px;
|
|
text-align: center;
|
|
color: #333;
|
|
}
|
|
|
|
.module-description {
|
|
font-size: 14px;
|
|
color: #666;
|
|
text-align: center;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="header">
|
|
<h1><i class="fab fa-telegram"></i> <?php echo __('telegram_dashboard_header'); ?></h1>
|
|
<a href="/index.php" class="btn-back">← <?php echo __('back_to_main_dashboard'); ?></a>
|
|
</div>
|
|
|
|
<div class="container">
|
|
<div class="modules-grid">
|
|
<?php if (hasPermission('manage_templates', 'telegram')): ?>
|
|
<a href="/telegram/views/templates/list.php" class="module-card">
|
|
<div class="module-icon"><i class="fas fa-file-alt"></i></div>
|
|
<div class="module-title"><?php echo __('templates_module_title'); ?></div>
|
|
<div class="module-description"><?php echo __('templates_module_description'); ?></div>
|
|
</a>
|
|
<?php endif; ?>
|
|
|
|
<?php if (hasPermission('send_messages', 'telegram')): ?>
|
|
<a href="/telegram/views/messages/create.php" class="module-card">
|
|
<div class="module-icon"><i class="fas fa-paper-plane"></i></div>
|
|
<div class="module-title"><?php echo __('create_message_module_title'); ?></div>
|
|
<div class="module-description"><?php echo __('create_message_module_description', 'Enviar mensajes a Telegram'); ?></div>
|
|
</a>
|
|
<?php endif; ?>
|
|
|
|
<?php if (hasPermission('view_sent_messages', 'telegram')): ?>
|
|
<a href="/telegram/views/messages/sent.php" class="module-card">
|
|
<div class="module-icon"><i class="fas fa-history"></i></div>
|
|
<div class="module-title"><?php echo __('sent_messages_module_title'); ?></div>
|
|
<div class="module-description"><?php echo __('sent_messages_module_description'); ?></div>
|
|
</a>
|
|
<?php endif; ?>
|
|
|
|
<?php if (hasPermission('manage_recipients', 'telegram')): ?>
|
|
<a href="/telegram/views/recipients/list.php" class="module-card">
|
|
<div class="module-icon"><i class="fas fa-users"></i></div>
|
|
<div class="module-title"><?php echo __('recipients_module_title'); ?></div>
|
|
<div class="module-description"><?php echo __('recipients_module_description_telegram'); ?></div>
|
|
</a>
|
|
<?php endif; ?>
|
|
|
|
<?php if (hasPermission('manage_commands', 'telegram')): ?>
|
|
<a href="/telegram/views/commands/list.php" class="module-card">
|
|
<div class="module-icon"><i class="fas fa-terminal"></i></div>
|
|
<div class="module-title"><?php echo __('commands_module_title'); ?></div>
|
|
<div class="module-description"><?php echo __('commands_module_description'); ?></div>
|
|
</a>
|
|
<?php endif; ?>
|
|
|
|
<?php if (hasPermission('manage_welcome', 'telegram')): ?>
|
|
<a href="/telegram/views/welcome/config.php" class="module-card">
|
|
<div class="module-icon"><i class="fas fa-handshake"></i></div>
|
|
<div class="module-title"><?php echo __('welcome_message_module_title'); ?></div>
|
|
<div class="module-description"><?php echo __('welcome_message_module_description'); ?></div>
|
|
</a>
|
|
<?php endif; ?>
|
|
|
|
<?php if (hasPermission('view_logs', 'telegram')): ?>
|
|
<a href="/telegram/views/logs/list.php" class="module-card">
|
|
<div class="module-icon"><i class="fas fa-list-alt"></i></div>
|
|
<div class="module-title"><?php echo __('system_logs_module_title'); ?></div>
|
|
<div class="module-description"><?php echo __('system_logs_module_description'); ?></div>
|
|
</a>
|
|
<?php endif; ?>
|
|
|
|
<?php if (hasPermission('view_gallery')): ?>
|
|
<a href="/gallery/index.php" class="module-card">
|
|
<div class="module-icon"><i class="fas fa-images"></i></div>
|
|
<div class="module-title"><?php echo __('gallery_module_title'); ?></div>
|
|
<div class="module-description"><?php echo __('gallery_module_description'); ?></div>
|
|
</a>
|
|
<?php endif; ?>
|
|
|
|
<?php if (hasPermission('manage_languages')): ?>
|
|
<a href="/shared/languages/manager.php" class="module-card">
|
|
<div class="module-icon"><i class="fas fa-language"></i></div>
|
|
<div class="module-title"><?php echo __('languages_module_title'); ?></div>
|
|
<div class="module-description"><?php echo __('languages_module_description'); ?></div>
|
|
</a>
|
|
<?php endif; ?>
|
|
|
|
<?php if (hasPermission('test_connection', 'telegram')): ?>
|
|
<a href="/telegram/test_connection.php" class="module-card">
|
|
<div class="module-icon"><i class="fas fa-plug"></i></div>
|
|
<div class="module-title"><?php echo __('connection_test_module_title'); ?></div>
|
|
<div class="module-description"><?php echo __('connection_test_module_description_telegram'); ?></div>
|
|
</a>
|
|
<?php endif; ?>
|
|
|
|
<?php if (hasPermission('view_logs', 'telegram')): ?>
|
|
<a href="/telegram/views/features.php" class="module-card">
|
|
<div class="module-icon"><i class="fas fa-robot"></i></div>
|
|
<div class="module-title">Funciones del Bot</div>
|
|
<div class="module-description">Documentación de las funciones automáticas y comandos del bot.</div>
|
|
</a>
|
|
<?php endif; ?>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html>
|