本文整理汇总了PHP中message::byPlugin方法的典型用法代码示例。如果您正苦于以下问题:PHP message::byPlugin方法的具体用法?PHP message::byPlugin怎么用?PHP message::byPlugin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类message
的用法示例。
在下文中一共展示了message::byPlugin方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: include_file
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();
}
throw new Exception(__('Aucune methode correspondante à : ', __FILE__) . init('action'));