當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Hooks::applyFilters方法代碼示例

本文整理匯總了PHP中Hooks::applyFilters方法的典型用法代碼示例。如果您正苦於以下問題:PHP Hooks::applyFilters方法的具體用法?PHP Hooks::applyFilters怎麽用?PHP Hooks::applyFilters使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Hooks的用法示例。


在下文中一共展示了Hooks::applyFilters方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: setInfo

 /**
  * 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;
     }
 }
開發者ID:LobbyOS,項目名稱:server,代碼行數:36,代碼來源:Apps.php

示例2: array

<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>
開發者ID:LobbyOS,項目名稱:server,代碼行數:18,代碼來源:sidebar.php


注:本文中的Hooks::applyFilters方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。