コード例 #1
0
ファイル: Apps.php プロジェクト: LobbyOS/server
 /**
  * Get the manifest info of app as array
  */
 private function setInfo()
 {
     $manifest = FS::exists($this->dir . "/manifest.json") ? FS::get($this->dir . "/manifest.json") : false;
     if ($manifest) {
         $details = json_decode($manifest, true);
         $details = array_replace_recursive(self::$manifestConfig, $details);
         /**
          * Add extra info with the manifest info
          */
         $details['id'] = $this->app;
         $details['dir'] = $this->dir;
         $details['url'] = Lobby::getURL() . "/app/{$this->app}";
         $details['srcURL'] = Lobby::getURL() . "/contents/apps/{$this->app}";
         $details['adminURL'] = Lobby::getURL() . "/admin/app/{$this->app}";
         /**
          * Prefer SVG over PNG
          */
         $details['logo'] = $details['logo'] !== false ? FS::exists($this->dir . "/src/image/logo.svg") ? self::$appsURL . "/{$this->app}/src/image/logo.svg" : self::$appsURL . "/{$this->app}/src/image/logo.png" : Themes::getThemeURL() . "/src/main/image/app-logo.png";
         $details["latestVersion"] = isset(self::$appUpdates[$this->app]) ? self::$appUpdates[$this->app] : null;
         $details = \Hooks::applyFilters("app.manifest", $details);
         /**
          * Insert the info as a property
          */
         $this->info = $details;
         /**
          * Whether app is enabled
          */
         $this->enabled = in_array($this->app, self::getEnabledApps(), true);
         return $details;
     } else {
         return false;
     }
 }
コード例 #2
0
ファイル: sidebar.php プロジェクト: LobbyOS/server
<div class="side-nav fixed" id="slide-out">
  <a target="_blank" href="http://lobby.subinsb.com" class="lobby-link">Lobby <?php 
echo \Lobby::getVersion(true);
?>
</a>
  <?php 
$links = array("/admin/index.php" => "Dashboard", "/admin/apps.php" => "Apps", "/admin/lobby-store.php" => "Lobby Store", "/admin/modules.php" => "Modules", "/admin/settings.php" => "Settings");
$links = Hooks::applyFilters("admin.view.sidebar", $links);
$curPage = \Lobby::curPage();
foreach ($links as $link => $text) {
    if (substr($curPage, 0, strlen($link)) === $link || $curPage == "/admin/update.php" && $text == "Settings" || $curPage == "/admin/install-app.php" && $text == "Apps") {
        echo \Lobby::l($link, $text, "class='link active'");
    } else {
        echo \Lobby::l($link, $text, "class='link'");
    }
}
?>
</div>