Beispiel #1
0
<?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>
Beispiel #2
0
 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']);
Beispiel #3
0
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();
Beispiel #4
0
<?php

if (s::get('messages')) {
    ?>
	<?php 
    echo message::all();
}
Beispiel #5
0
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();