本文整理汇总了PHP中message::all方法的典型用法代码示例。如果您正苦于以下问题:PHP message::all方法的具体用法?PHP message::all怎么用?PHP message::all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类message
的用法示例。
在下文中一共展示了message::all方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Exception
<?php
if (!hasRight('messageview')) {
throw new Exception('{{401 - Accès non autorisé}}');
}
$selectPlugin = init('plugin');
if ($selectPlugin != '') {
$listMessage = message::byPlugin($selectPlugin);
} else {
$listMessage = message::all();
}
?>
<a class="btn btn-danger pull-right" id="bt_clearMessage"><i class="fa fa-trash-o icon-white"></i> {{Vider}}</a>
<select id="sel_plugin" class="form-control" style="width: 200px;">
<option value="" selected>{{Tout}}</option>
<?php
foreach (message::listPlugin() as $plugin) {
if ($selectPlugin == $plugin['plugin']) {
echo '<option value="' . $plugin['plugin'] . '" selected>' . $plugin['plugin'] . '</option>';
} else {
echo '<option value="' . $plugin['plugin'] . '">' . $plugin['plugin'] . '</option>';
}
}
?>
</select>
<table class="table table-condensed table-bordered tablesorter" id="table_message" style="margin-top: 5px;">
<thead>
<tr>
<th data-sorter="false" data-filter="false"></th><th>{{Date et heure}}</th><th>{{Plugin}}</th><th>{{Description}}</th><th data-sorter="false" data-filter="false">{{Action}}</th>
</tr>
示例2: isset
if ($jsonrpc->getMethod() == 'log::list') {
$jsonrpc->makeSuccess(log::liste());
}
if ($jsonrpc->getMethod() == 'log::empty') {
$jsonrpc->makeSuccess(log::clear($params['log']));
}
if ($jsonrpc->getMethod() == 'log::remove') {
$jsonrpc->makeSuccess(log::remove($params['log']));
}
/* * ************************Messages*************************** */
if ($jsonrpc->getMethod() == 'message::removeAll') {
message::removeAll();
$jsonrpc->makeSuccess('ok');
}
if ($jsonrpc->getMethod() == 'message::all') {
$jsonrpc->makeSuccess(utils::o2a(message::all()));
}
/* * ************************Interact*************************** */
if ($jsonrpc->getMethod() == 'interact::tryToReply') {
$jsonrpc->makeSuccess(interactQuery::tryToReply($params['query']));
}
/* * ************************USB mapping*************************** */
if ($jsonrpc->getMethod() == 'jeedom::getUsbMapping') {
$name = isset($params['name']) ? $params['name'] : '';
$gpio = isset($params['gpio']) ? $params['gpio'] : false;
$jsonrpc->makeSuccess(jeedom::getUsbMapping($name, $gpio));
}
/* * ************************Plugin*************************** */
if ($jsonrpc->getMethod() == 'plugin::install') {
try {
$market = market::byId($params['plugin_id']);
示例3: foreach
echo "\n**************************************************\n";
echo "* DATE *";
echo "\n**************************************************\n";
echo "Check if Jeedom date's is good...";
if (jeedom::isDateOk()) {
echo "OK";
} else {
echo "NOK";
}
$cache = cache::byKey('jeedom::lastDate');
echo " (" . $cache->getValue() . ")\n";
echo "\n**************************************************\n";
echo "* MESSAGE *";
echo "\n**************************************************\n";
echo "DATE | PLUGIN | LOGICALID | MESSAGE\n";
foreach (message::all() as $message) {
echo $message->getDate();
echo " | ";
echo $message->getPlugin();
echo " | ";
echo $message->getLogicalId();
echo " | ";
echo $message->getMessage();
echo "\n";
}
echo "\n**************************************************\n";
echo "* PLUGIN *";
echo "\n**************************************************\n";
echo "ID | NAME | STATE\n";
foreach (plugin::listPlugin() as $plugin) {
echo $plugin->getId();
示例4:
<?php
if (s::get('messages')) {
?>
<?php
echo message::all();
}
示例5: dirname
try {
require_once dirname(__FILE__) . '/../../core/php/core.inc.php';
include_file('core', 'authentification', 'php');
if (!isConnect()) {
throw new Exception(__('401 - Accès non autorisé', __FILE__));
}
if (init('action') == 'clearMessage') {
message::removeAll(init('plugin'));
ajax::success();
}
if (init('action') == 'nbMessage') {
ajax::success(message::nbMessage());
}
if (init('action') == 'all') {
if (init('plugin') == '') {
$messages = utils::o2a(message::all());
} else {
$messages = utils::o2a(message::byPlugin(init('plugin')));
}
foreach ($messages as &$message) {
$message['message'] = htmlentities($message['message']);
}
ajax::success($messages);
}
if (init('action') == 'removeMessage') {
$message = message::byId(init('id'));
if (!is_object($message)) {
throw new Exception(__('Message inconnu verifié l\'id', __FILE__));
}
$message->remove();
ajax::success();