jilo-web/plugins/register/bootstrap.php

27 lines
1.0 KiB
PHP
Raw Normal View History

2025-04-17 07:29:31 +00:00
<?php
// Register plugin bootstrap
// (here we add any plugin autoloader, if needed)
// List here all the controllers in "/controllers/" that we need as pages
$GLOBALS['plugin_controllers']['register'] = [
'register'
];
2025-04-17 07:29:31 +00:00
// Add to publicly accessible pages
register_hook('filter_public_pages', function($pages) {
$pages[] = 'register';
return $pages;
});
// Configuration for main menu injection
define('REGISTRATIONS_MAIN_MENU_SECTION', 'main');
define('REGISTRATIONS_MAIN_MENU_POSITION', 30);
register_hook('main_public_menu', function($ctx) {
$section = defined('REGISTRATIONS_MAIN_MENU_SECTION') ? REGISTRATIONS_MAIN_MENU_SECTION : 'main';
$position = defined('REGISTRATIONS_MAIN_MENU_POSITION') ? REGISTRATIONS_MAIN_MENU_POSITION : 100;
2025-11-19 19:43:30 +00:00
echo " <button class=\"btn modern-header-btn\" onclick=\"window.location.href='" . htmlspecialchars($app_root) . "?page=register'\">
<i class=\"fas fa-user-edit me-2\"></i>Register
</button>";
2025-04-17 07:29:31 +00:00
});