Adds a hook to load plugin assets

main
Yasen Pramatarov 2025-11-28 18:44:39 +02:00
parent 06ddd768aa
commit 9485cd0769
2 changed files with 5 additions and 1 deletions

View File

@ -53,6 +53,10 @@
}); });
</script> </script>
<?php } ?> <?php } ?>
<?php
// hook for loading plugin assets (css, images, etc.)
do_hook('page_head_assets', ['page' => $page ?? null, 'action' => $_GET['action'] ?? null, 'app_root' => $app_root ?? '']);
?>
<title><?= htmlspecialchars($config['site_name']) ?></title> <title><?= htmlspecialchars($config['site_name']) ?></title>
<link rel="icon" type="image/x-icon" href="<?= htmlspecialchars($app_root) ?>static/favicon.ico"> <link rel="icon" type="image/x-icon" href="<?= htmlspecialchars($app_root) ?>static/favicon.ico">
</head> </head>

View File

@ -108,7 +108,7 @@ if (!isset($page)) {
} }
// List of pages that don't require authentication // List of pages that don't require authentication
$public_pages = ['login', 'help', 'about']; $public_pages = ['login', 'help', 'about', 'theme-asset', 'plugin-asset'];
// Let plugins filter/extend public_pages // Let plugins filter/extend public_pages
$public_pages = filter_public_pages($public_pages); $public_pages = filter_public_pages($public_pages);