本文整理汇总了PHP中Lobby::hook方法的典型用法代码示例。如果您正苦于以下问题:PHP Lobby::hook方法的具体用法?PHP Lobby::hook怎么用?PHP Lobby::hook使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Lobby
的用法示例。
在下文中一共展示了Lobby::hook方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: loadTheme
/**
* 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");
});
}
}
示例2: array
<?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";
});
}
示例3: function
});
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']);
});
}
示例4: function
<canvas id="monthChart" width="400" height="400"></canvas>
<p>Users Registered Per Month</p>
</div>
<div clear class='chartbox'>
<canvas id="dayChart" width="600" height="400"></canvas>
<p>Users Registered Per Day In This Month</p>
</div>
<style>
.chartbox{
display: inline-block;
text-align:center;
width: 400px;
height: 400px;
}
</style>
<?php
\Lobby::hook("head.end", function () use($perMonth, $perDay) {
echo '<script>lobby.load(function(){lobby.app.stats(' . json_encode(array_values($perMonth)) . ', ' . json_encode(array_values($perDay)) . ', ' . json_encode(array_keys($perDay)) . ');});</script>';
});
} else {
?>
<a href='<?php
echo $this->url;
?>
/admin/config' class='btn red'>Setup logSys Admin</a>
<?php
}
?>
</div>
<?php
require_once $this->dir . "/src/inc/partial/layout_footer.php";
示例5: function
<?php
\Lobby::hook("panel.end", function () {
?>
<a href="#" data-activates="slide-out" class="button-collapse"><i class="mdi-navigation-menu"></i></a>
<?php
});
?>
<ul id="slide-out" class="side-nav fixed">
<form method="POST" action="<?php
echo $su;
?>
" id="generate">
<button name="generate" class="btn orange">Generate Site</button>
</form>
<li><a href="<?php
echo $su;
?>
">Home</a></li>
<li><a class="waves-effect waves-teal" href="<?php
echo $su . "/pages";
?>
">Pages</a></li>
<li><a href="<?php
echo $su . "/settings";
?>
">Settings</a></li>
</ul>