Files
fitme3070.pt/config/functions_icons.php
andre 18676ad6d0 feat(icons): load Bootstrap Icons and Font Awesome from the shared platform-tools packs
Register the icons packs in platform_connect, add fit_icon_assets() with local
fallback, and add a sysadmin 'Pacotes de icones' link to platform?tool=icons.
2026-10-13 18:55:12 +01:00

19 lines
772 B
PHP

<?php
// Ícones: pacotes partilhados do platform-tools (pt_icon_assets()) com as cópias
// locais como recurso quando o submódulo ainda não os tem (produção com o
// submódulo antigo). Registo dos pacotes: config/db.php ('icons').
//
// $packs : ids dos pacotes a carregar (ex.: ['fontawesome'])
// $localHrefs: <link> locais de recurso, caminhos para link_tag()/base_url()
function fit_icon_assets(array $packs, array $localHrefs): string {
if (function_exists('pt_icon_assets')) {
$html = pt_icon_assets($packs);
if ($html !== '') return $html;
}
$out = '';
foreach ($localHrefs as $href) {
$out .= '<link href="' . htmlspecialchars(base_url($href), ENT_QUOTES) . '" rel="stylesheet">' . "\n";
}
return $out;
}