| Server IP : 104.21.84.107 / Your IP : 104.23.243.197 Web Server : Apache/2.4.63 (Ubuntu) System : Linux adminpruebas-Virtual-Machine 6.14.0-37-generic #37-Ubuntu SMP PREEMPT_DYNAMIC Fri Nov 14 22:10:32 UTC 2025 x86_64 User : www-data ( 33) PHP Version : 8.4.5 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /var/www/biblioteca/includes/ |
Upload File : |
<?php
declare(strict_types=1);
$documentosApoyo = require __DIR__ . '/../data/documentos_apoyo.php';
function renderDocumentosApoyoIcon(string $icono): string
{
$icons = [
'reglamento' => '<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M7 3h7l5 5v13H7z"/><path d="M14 3v6h6"/><path d="M10 13h6"/><path d="M10 17h6"/></svg>',
'multas' => '<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 1v22"/><path d="M17 5H9.5a3.5 3.5 0 0 0 0 7H14.5a3.5 3.5 0 0 1 0 7H6"/></svg>',
'autor' => '<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 4.5 7 7v4.5c0 3.2 2.1 6.2 5 7 2.9-.8 5-3.8 5-7V7l-5-2.5Z"/><path d="m10.5 12 1.2 1.2 2.8-3"/></svg>',
];
return $icons[$icono] ?? $icons['reglamento'];
}
function documentosApoyoAbreNuevaPestana(string $url): bool
{
if (str_starts_with($url, 'http://') || str_starts_with($url, 'https://')) {
return true;
}
$path = (string) parse_url($url, PHP_URL_PATH);
return str_ends_with(strtolower($path), '.pdf');
}
?>
<?php if ($documentosApoyo): ?>
<aside class="mas-servicios mas-servicios--right mas-servicios--docs" id="inicio-documentos-apoyo" aria-label="Documentos de apoyo a la academia">
<details class="mas-servicios__dock">
<summary class="mas-servicios__trigger">
<span class="mas-servicios__trigger-icon" aria-hidden="true">
<svg viewBox="0 0 24 24" aria-hidden="true">
<path d="M7 3h7l5 5v13H7z"/>
<path d="M14 3v6h6"/>
</svg>
</span>
<span class="mas-servicios__trigger-text">Documentos</span>
</summary>
<div class="mas-servicios__panel">
<div class="mas-servicios__header">
<p class="mas-servicios__eyebrow">Apoyo a la academia</p>
<h2 class="mas-servicios__title">Documentos y formatos</h2>
</div>
<div class="mas-servicios__list">
<?php foreach ($documentosApoyo as $documento): ?>
<?php
$url = (string) ($documento['url'] ?? '');
$icono = (string) ($documento['icono'] ?? 'reglamento');
$abreNuevaPestana = documentosApoyoAbreNuevaPestana($url);
?>
<a
class="mas-servicios__item mas-servicios__item--<?= htmlspecialchars($icono, ENT_QUOTES, 'UTF-8') ?>"
href="<?= htmlspecialchars($url, ENT_QUOTES, 'UTF-8') ?>"
<?php if ($abreNuevaPestana): ?>
target="_blank" rel="noopener noreferrer"
<?php endif; ?>
>
<span class="mas-servicios__item-icon">
<?= renderDocumentosApoyoIcon($icono) ?>
</span>
<span class="mas-servicios__item-copy">
<strong><?= htmlspecialchars((string) ($documento['titulo'] ?? ''), ENT_QUOTES, 'UTF-8') ?></strong>
<span><?= htmlspecialchars((string) ($documento['descripcion'] ?? ''), ENT_QUOTES, 'UTF-8') ?></span>
</span>
<span class="mas-servicios__item-arrow" aria-hidden="true">
<svg viewBox="0 0 24 24" aria-hidden="true">
<path d="m9 6 6 6-6 6"/>
</svg>
</span>
</a>
<?php endforeach; ?>
</div>
</div>
</details>
</aside>
<?php endif; ?>