\Hooks::addAction("head.begin,admin.head.begin", function () { ?> <script> window.tmp = {}; window.lobbyExtra = { url: "<?php echo L_URL; ?> ", csrfToken: "<?php echo CSRF::get(); ?> ", sysInfo: { os: "<?php echo \Lobby::getSysInfo("os"); ?> " } }; <?php if (\Lobby\Apps::isAppRunning()) { echo 'window.lobbyExtra["app"] = { id: "' . \Lobby\Apps::getInfo("id") . '", url: "' . \Lobby\Apps::getInfo("url") . '", src: "' . \Lobby\Apps::getInfo("srcURL") . '" };'; } ?> </script> <?php });
/** * Load a theme */ public static function loadTheme() { require_once self::$dir . "/Theme.php"; $className = "\\Lobby\\UI\\Themes\\" . self::$themeID; self::$theme = new $className(self::$themeID, self::$dir); self::$theme->init(); self::$theme->addStyle("/src/main/css/style.css"); self::$theme->addStyle("/src/main/css/icons.css"); /** * Load Panel */ if (\Lobby::status("lobby.admin")) { Hooks::addAction("admin.head.begin", function () { self::$theme->panel(true); self::$theme->addStyle("/src/main/css/admin.style.css"); }); \Hooks::addAction("admin.body.begin", function () { echo self::$theme->inc("/src/panel/load.admin.php"); }); } else { \Hooks::addAction("head.begin", function () { self::$theme->panel(false); }); \Hooks::addAction("body.begin", function () { echo self::$theme->inc("/src/panel/load.php"); }); } }