本文整理汇总了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;
}
}
示例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>