3 * FusionForge Plugin Message Class
5 * Copyright 2009, 2012 Alain Peyrat - Alcatel-Lucent
6 * Copyright 2012,2017, Franck Villaume - TrivialDev
8 * This file is part of FusionForge. FusionForge is free software;
9 * you can redistribute it and/or modify it under the terms of the
10 * GNU General Public License as published by the Free Software
11 * Foundation; either version 2 of the Licence, or (at your option)
14 * FusionForge is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License along
20 * with FusionForge; if not, write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
25 * The messagePlugin class.
29 class messagePlugin extends Plugin {
31 function __construct() {
32 parent::__construct();
33 $this->name = 'message';
34 $this->text = _('Message');
36 _("This plugin allows the site administrator to display a message banner
37 on all pages, e.g. for maintenance announcements.");
38 $this->hooks[] = 'message';
39 $this->hooks[] = 'htmlhead';
40 $this->hooks[] = 'site_admin_option_hook';
45 use_javascript('/plugins/message/js/message.js');
48 function site_admin_option_hook() {
49 echo html_e('li', array(), util_make_link('/plugins/message/index.php', _('Configure Global Message')));
52 function getAdminOptionLink() {
53 return util_make_link('/plugins/message/index.php', _('Configure Message'));
57 $res = db_query_params('SELECT message FROM plugin_message', array());
58 if ($res && db_numrows($res) > 0 && $message = db_result($res, 0, 'message')) {
59 echo html_e('div', array('id' => 'message_box'),
60 html_image("ic/close.png", '', '', array('alt'=>_('Close'), 'id'=>'message_close', 'style'=>'float:right; cursor:pointer;')).
68 // c-file-style: "bsd"