Пример #1
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";
    });
}
Пример #2
0
     * "Update Available" icon on the right side of panel
     */
    $AppUpdates = json_decode(getOption("app_updates"), true);
    $lobby_version = getOption("lobby_version");
    $latestVersion = getOption("lobby_latest_version");
    if (\Lobby\FS::exists("/upgrade.lobby")) {
        require_once L_DIR . "/includes/src/Update.php";
        $l_info = json_decode(\Lobby\FS::get("/lobby.json"));
        if ($lobby_version != $l_info->version) {
            saveOption("lobby_latest_version", $l_info->version);
            saveOption("lobby_latest_version_release", $l_info->released);
        }
        \Lobby\Update::finish_software_update();
    }
    if (count($AppUpdates) != 0 || $latestVersion && $lobby_version != $latestVersion) {
        \Lobby\Panel::addTopItem("updateNotify", array("html" => \Lobby::l("/admin/update.php", "<span id='update' title='An Update Is Available'></span>"), "position" => "right"));
    }
}
if (\Lobby::status("lobby.install")) {
    \Lobby::addStyle("admin", "/includes/lib/core/CSS/admin.css");
}
if (\Lobby::status("lobby.admin")) {
    /**
     * Add Admin Pages' stylesheet
     */
    \Lobby::addStyle("admin", "/includes/lib/core/CSS/admin.css");
    /**
     * Check For New Versions (Apps & Core)
     */
    if (\Lobby::$config['server_check'] === true && !isset($_SESSION['checkedForLatestVersion'])) {
        \Lobby\Server::check();
Пример #3
0
<div class="panel top">
  <ul class="left">
    <?php 
\Lobby\Panel::panelItems("left");
?>
  </ul>
  <ul class="right">
    <?php 
\Lobby\Panel::panelItems("right");
?>
  </ul>
</div>
Пример #4
0
 /**
  * Define some pages by default
  */
 public static function defaults()
 {
     /**
      * Route App Pages (/app/{appname}/{page}) to according apps
      */
     self::route("/app/[:appID]?/[**:page]?", function ($request) {
         $AppID = $request->appID;
         $GLOBALS['AppID'] = $AppID;
         $page = $request->page != "" ? "/{$request->page}" : "/";
         /**
          * Check if App exists
          */
         $App = new \Lobby\Apps($AppID);
         if ($App->exists && $App->isEnabled() && substr($page, 0, 7) != "/Admin/") {
             $class = $App->run();
             $AppInfo = $App->info;
             /**
              * Set the title
              */
             \Lobby::setTitle($AppInfo['name']);
             /**
              * Add the App item to the navbar
              */
             \Lobby\Panel::addTopItem("lobbyApp{$AppID}", array("text" => $AppInfo['name'], "href" => APP_URL, "position" => "left"));
             $page_response = $class->page($page);
             if ($page_response == "auto") {
                 if ($page == "/") {
                     $page = "/index";
                 }
                 $GLOBALS['workspaceHTML'] = $class->inc("/src/Page{$page}.php");
             } else {
                 $GLOBALS['workspaceHTML'] = $page_response;
             }
             if ($GLOBALS['workspaceHTML'] == null) {
                 ser();
             }
         } else {
             ser();
         }
     });
     /**
      * Dashboard Page
      * The main Page. Add CSS & JS accordingly
      */
     self::route("/", function () {
         \Lobby::addScript("metrojs", "/includes/lib/metrojs/metrojs.js");
         \Lobby::addStyle("metrojs", "/includes/lib/metrojs/metrojs.css");
         \Lobby::addScript("dynscroll", "/includes/lib/scrollbar/scrollbar.js");
         \Lobby::addStyle("dynscroll", "/includes/lib/scrollbar/scrollbar.css");
         \Lobby::addScript("jquery.contextmenu", "/includes/lib/jquery/jquery.contextmenu.js");
         \Lobby::addStyle("jquery.contextmenu", "/includes/lib/jquery/jquery.contextmenu.css");
         \Lobby::addScript("dashboard", "/includes/lib/core/JS/dashboard.js");
         \Lobby::addStyle("dashboard", "/includes/lib/core/CSS/dashboard.css");
         \Lobby::setTitle("Dashboard");
         $GLOBALS['workspaceHTML'] = array("/includes/lib/core/Inc/main.php");
     });
     /**
      * Administration
      */
     self::route("/admin/app/[:appID]?/[**:page]?", function ($request) {
         $AppID = $request->appID;
         $GLOBALS['AppID'] = $AppID;
         $page = $request->page != "" ? "/Admin/{$request->page}" : "/Admin/index";
         /**
          * Check if App exists
          */
         $App = new \Lobby\Apps($AppID);
         if ($App->exists && $App->isEnabled()) {
             /**
              * Redirect /src/ files to App's Source in /contents folder
              */
             $class = $App->run();
             $AppInfo = $App->info;
             /**
              * Set the title
              */
             \Lobby::setTitle($AppInfo['name']);
             /**
              * Add the App item to the navbar
              */
             \Lobby\Panel::addTopItem("lobbyApp{$AppID}", array("text" => "Admin > " . $AppInfo['name'], "href" => "/admin/app/{$AppID}", "position" => "left"));
             $page_response = $class->page($page);
             if ($page_response == "auto") {
                 if ($page == "/") {
                     $page = "/index";
                 }
                 $GLOBALS['workspaceHTML'] = $class->inc("/src/Page{$page}.php");
             } else {
                 $GLOBALS['workspaceHTML'] = $page_response;
             }
             if ($GLOBALS['workspaceHTML'] === false || $GLOBALS['workspaceHTML'] == null) {
                 ob_start();
                 ser("Error", "The app '<strong>{$AppID}</strong>' does not have an Admin Page");
                 $error = ob_get_contents();
                 ob_end_clean();
                 $GLOBALS['workspaceHTML'] = "<div class='contents'>" . $error . "</div>";
             }
         }
     });
 }