本文整理汇总了PHP中PluginManager::enableNotifications方法的典型用法代码示例。如果您正苦于以下问题:PHP PluginManager::enableNotifications方法的具体用法?PHP PluginManager::enableNotifications怎么用?PHP PluginManager::enableNotifications使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PluginManager
的用法示例。
在下文中一共展示了PluginManager::enableNotifications方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: shutdown
<?php
//#!/usr/bin/env php
define('WEBSOCKET', '1');
require_once dirname(__FILE__) . '/includes/LoginManager.php';
require_once dirname(__FILE__) . '/includes/DatabaseManager.php';
require_once dirname(__FILE__) . '/includes/PluginManager.php';
require_once dirname(__FILE__) . '/includes/AsyncManager.php';
require_once dirname(__FILE__) . '/websockets/websockets.php';
require_once dirname(__FILE__) . '/config.php';
$pluginManager = new PluginManager();
$pluginManager->enableNotifications(true);
require_once $pluginManager->getController('plg_serversettings', 'servertools');
function shutdown()
{
exec('sudo /var/www/sh/wsrestart.sh');
echo 'Script executed with success', PHP_EOL;
}
function myErrorHandler($fehlercode, $fehlertext, $fehlerdatei, $fehlerzeile)
{
echo $fehlertext . ' (' . $fehlercode . ') in ' . $fehlerdatei . ' on line ' . $fehlerzeile;
return true;
}
function triggerhourly()
{
global $pluginManager;
$pluginManager->triggerHourly();
}
function triggerminutely()
{
global $pluginManager;
示例2: PluginManager
$fgcolor = $conf['fgcolor'];
}
$output['fgcolor'] = $fgcolor;
$bgcolor = $loginManager->getUserPreference("bgcolor", null);
if (empty($bgcolor)) {
$bgcolor = $conf['bgcolor'];
}
$output['bgcolor'] = $bgcolor;
echo json_encode($output);
}
} else {
if (!empty($_POST['username']) and !empty($_POST['password'])) {
$authtoken = $loginManager->loginUserByPassword($_POST['username'], $_POST['password'], 'Webinterface');
if (!empty($authtoken)) {
$pluginManager = new PluginManager();
$pluginManager->enableNotifications(TRUE);
$notificationManager = $pluginManager->getNotificationManager();
$notification = new Notification("Sie haben sich mit ihrem Benutzerkonto auf einem neuen Endgerät angemeldet.", "Neue Anmeldung", time() + 86400);
$notification->addReaded($authtoken);
$notification->setActionOpenPlugin("plg_user");
$notification->setIcon(FileManager::getImageHashByPath('images/user-add.png'));
$notificationManager->addNotification($notification, $loginManager->getId());
echo '{"token":' . json_encode($authtoken) . ',"username":"' . $_POST['username'] . '",';
echo '"mainplugins":' . $pluginManager->getMainPlugins();
/* TODO */
if (!$loginManager->getShareManager()->isShared()) {
$seamless = $loginManager->getUserPreference("seamless");
if (!empty($seamless) && strtoupper($seamless) == "TRUE") {
$seamlessString = $loginManager->getUserPreference("seamless-current");
if (!empty($seamlessString)) {
echo ',"seamless":' . $seamlessString;