function plugin_news_uninstall() { if (!PluginNewsAlert::dropTable() || !PluginNewsProfile::dropTable()) { Session::addMessageAfterRedirect('Uninstallation failed'); return false; } PluginNewsProfile::uninstallProfile(); return true; }
the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Plugin GLPI News is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Plugin GLPI News. If not, see <http://www.gnu.org/licenses/>. -------------------------------------------------------------------------- */ include "../../../inc/includes.php"; $plugin = new Plugin(); if (!$plugin->isInstalled("news") || !$plugin->isActivated("news")) { Html::displayNotFoundError(); } $alert = new PluginNewsAlert(); if (isset($_POST['update'])) { $alert->update($_POST); Html::back(); } elseif (isset($_POST['add'])) { $alert->add($_POST); Html::back(); } elseif (isset($_POST['delete'])) { $alert->delete($_POST); $alert->redirectToList(); } elseif (isset($_POST['restore'])) { $alert->restore($_POST); Html::back(); } elseif (isset($_POST['purge'])) { $alert->delete($_POST, 1); $alert->redirectToList();
public static function getMenuContent() { global $CFG_GLPI; $menu = parent::getMenuContent(); $menu['links']['search'] = PluginNewsAlert::getSearchURL(false); return $menu; }
Plugin GLPI News is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Plugin GLPI News is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Plugin GLPI News. If not, see <http://www.gnu.org/licenses/>. -------------------------------------------------------------------------- */ define('GLPI_ROOT', '../../..'); include GLPI_ROOT . "/inc/includes.php"; header("Content-type: application/javascript"); if ($alerts = PluginNewsAlert::findAllToNotify()) { ?> $(function(){ <?php foreach ($alerts as $alert) { ?> $('#page').prepend('<table class="plugin_news_alert"><tr><th><?php echo Toolbox::addslashes_deep($alert['name']); ?> </th></tr><tr><td><?php echo str_replace(chr(13) . chr(10), '', Html::entity_decode_deep(Toolbox::addslashes_deep($alert['message']))); ?> </td></tr></table><br />');