Example #1
0
 /**
  * Load a theme
  */
 public static function loadTheme()
 {
     require_once L_DIR . "/includes/src/UI/Theme.php";
     require_once THEME_DIR . "/Theme.php";
     $className = "\\Lobby\\UI\\Themes\\" . self::$theme;
     $GLOBALS["THEME_OBJ"] = new $className();
     $GLOBALS["THEME_OBJ"]->init();
     /**
      * Load Panel
      */
     if (\Lobby::status("lobby.admin")) {
         \Lobby::hook("admin.head.begin", function () {
             $GLOBALS["THEME_OBJ"]->panel(true);
             $GLOBALS["THEME_OBJ"]->addStyle("/style.css");
             $GLOBALS["THEME_OBJ"]->addStyle("/admin.style.css");
         });
         \Lobby::hook("admin.body.begin", function () {
             echo $GLOBALS["THEME_OBJ"]->inc("/Panel/load.admin.php");
         });
     } else {
         $GLOBALS["THEME_OBJ"]->addStyle("/style.css");
         \Lobby::hook("head.begin", function () {
             $GLOBALS["THEME_OBJ"]->panel(false);
         });
         \Lobby::hook("body.begin", function () {
             echo $GLOBALS["THEME_OBJ"]->inc("/Panel/load.php");
         });
     }
 }
Example #2
0
 public function init()
 {
     if (!\Lobby::status("lobby.assets-serve")) {
         $this->addScript("filepicker.js");
         $this->addStyle("filepicker.css");
     }
 }
Example #3
0
 public function init()
 {
     if (\Lobby::status("lobby.assets-serve") === false) {
         $this->install();
         $this->routes();
         require_once $this->app->dir . "/src/inc/load.php";
         if (LS::$loggedIn) {
             /**
              * Logged In
              */
             Hooks::addAction("init", function () {
                 /**
                  * Add Change Password Item in Top Panel -> Admin before Log Out item
                  * This is done by first removing the Log Out item, adding the Change
                  * Password item and then adding back the Log Out item
                  */
                 \Lobby\UI\Panel::addTopItem('adminModule', array("text" => "<img src='" . $this->app->srcURL . "/src/image/logo.svg' style='width: 40px;height: 40px;' />", "href" => "/", "position" => "left", "subItems" => array("changePassword" => array("text" => "Change Password", "href" => "/app/admin/change-password"), 'LogOut' => array("text" => "Log Out", "href" => "/app/admin/logout"))));
             });
         } else {
             /**
              * If `indi` module is active, make the index page available to everyone
              */
             if (!Modules::exists("app_indi")) {
                 if (\Lobby::curPage() != "/admin/login" && !\Lobby::status("lobby.install")) {
                     \Response::redirect("/admin/login");
                 }
             } else {
                 Panel::removeTopItem("indiModule", "left");
                 if (\Lobby::curPage() != "/admin/login" && \Lobby::curPage() != "/admin/install.php" && substr(\Lobby::curPage(), 0, 6) == "/admin") {
                     \Response::redirect("/admin/login");
                 }
             }
             Hooks::addFilter("panel.left.items", function ($left) {
                 unset($left["lobbyAdmin"]);
                 if (Modules::exists("app_indi")) {
                     unset($left["indiModule"]);
                 }
                 return $left;
             });
             Assets::removeJS("notify");
             Assets::removeCSS("notify");
         }
     }
 }
Example #4
0
<?php

if (!\Lobby::status("lobby.admin")) {
    \Lobby::addScript("keyring_module", L_URL . "/contents/apps/keyring/module/js/keyring.js");
}
Example #5
0
<?php

if (!\Lobby::status("lobby.serve")) {
    /**
     * For enabling access by \Lobby\Panel
     */
    require __DIR__ . "/class.panel.php";
    /**
     * Panel UI
     */
    if (!\Lobby::status("lobby.install")) {
        \Lobby::addScript("superfish", "/includes/lib/modules/panel/lib/superfish.js");
        \Lobby::addStyle("panel", "/includes/lib/modules/panel/lib/panel.css");
        \Lobby::addScript("panel", "/includes/lib/modules/panel/lib/panel.js");
    }
    if (\Lobby::$config['server_check'] === true) {
        /**
         * Default Items provided by the module
         */
        \Lobby\Panel::addTopItem("netStatus", array("html" => "<span id='net' title='Online'></span>", "position" => "right"));
        \Lobby::addScript("panel-item-connection", "/includes/lib/modules/panel/connection/connection.js");
    }
    \Lobby::hook("body.begin", function () {
        include __DIR__ . "/panel.ui.php";
    });
    \Lobby::hook("admin.body.begin", function () {
        include __DIR__ . "/panel.ui.php";
    });
}
Example #6
0
});
if (\Fr\LS::$loggedIn) {
    /**
     * Logged In
     */
    \Lobby::hook("init", function () {
        /**
         * Add Change Password Item in Top Panel -> Admin before Log Out item
         * This is done by first removing the Log Out item, adding the Change
         * Password item and then adding back the Log Out item
         */
        \Lobby\Panel::$top_items['left']['lobbyAdmin']['subItems']['ChangePassword'] = array("text" => "Change Password", "href" => "/admin/ChangePassword");
        \Lobby\Panel::$top_items['left']['lobbyAdmin']['subItems']['LogOut'] = array("text" => "Log Out", "href" => "/admin/login?logout");
    });
} else {
    /**
     * Not logged in
     */
    if (\Lobby\Modules::exists("indi") === false) {
        if (\Lobby::curPage() != "/admin/login" && !\Lobby::status("lobby.install")) {
            \Lobby::redirect("/admin/login");
        }
    } else {
        if (\Lobby::curPage() != "/admin/login" && \Lobby::curPage() != "/admin/install.php" && substr(\Lobby::curPage(), 0, 6) == "/admin") {
            \Lobby::redirect("/admin/login");
        }
    }
    \Lobby::hook("init", function () {
        unset(\Lobby\Panel::$top_items['left']['lobbyAdmin']);
    });
}
Example #7
0
/* The Core */
require_once L_DIR . "/includes/src/Database.php";
/* The Database Class */
require_once L_DIR . "/includes/src/Query.php";
/* The Database Class */
require_once L_DIR . "/includes/src/Apps.php";
/* The App Class */
require_once L_DIR . "/includes/src/Router.php";
/* The Router Class */
require_once L_DIR . "/includes/src/Server.php";
/* The File System Class */
require_once L_DIR . "/includes/functions.php";
/* Non class functions */
require_once L_DIR . "/includes/extra.php";
/* Define extra variables or constants */
/**
 * Run not on CDN files serving
 */
if (!\Lobby::status("lobby.serve")) {
    /**
     * Init the page setup
     */
    require_once L_DIR . "/includes/init.php";
    /**
     * Is Lobby Installed ?
     */
    if (!\Lobby::$installed && !\Lobby::status("lobby.install")) {
        \Lobby::redirect("/admin/install.php");
    }
}
\Lobby::doHook("init");
Example #8
0
 /**
  * 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");
         });
     }
 }
Example #9
0
 /**
  * Get status
  */
 public static function status($val)
 {
     $status = "";
     if (self::$status != null) {
         $status = self::$status;
     } else {
         self::$statuses[] = function ($path) {
             if ($path == "/admin/install.php") {
                 $status = "lobby.install";
             } elseif (substr($path, 0, 6) == "/admin") {
                 $status = "lobby.admin";
             } elseif ($path == "/includes/serve.php") {
                 $status = "lobby.serve";
             }
             return isset($status) ? $status : false;
         };
         foreach (self::$statuses as $func) {
             $return = $func(\Lobby::curPage());
             if ($return != false) {
                 $status = $return;
             }
         }
         self::$status = $status;
     }
     return $status == $val;
 }