3 * FusionForge Plugin Message Class
5 * Copyright 2009 (c) Alain Peyrat <alain.peyrat@alcatel-lucent.com>
6 * Copyright (C) 2012 Alain Peyrat - Alcatel-Lucent
7 * Copyright 2012, Franck Villaume - TrivialDev
9 * This file is part of FusionForge. FusionForge is free software;
10 * you can redistribute it and/or modify it under the terms of the
11 * GNU General Public License as published by the Free Software
12 * Foundation; either version 2 of the Licence, or (at your option)
15 * FusionForge is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License along
21 * with FusionForge; if not, write to the Free Software Foundation, Inc.,
22 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
26 * The messagePlugin class.
30 class messagePlugin extends Plugin {
32 function __construct() {
34 $this->name = "message" ;
35 $this->text = _('Message');
36 $this->hooks[] = 'message';
37 $this->hooks[] = 'htmlhead';
38 $this->hooks[] = 'site_admin_option_hook';
43 use_javascript('/plugins/message/js/message.js');
46 function site_admin_option_hook() {
47 echo '<li>' . util_make_link ('/plugins/message/index.php', _('Configure Global Message')) . '</li>';
50 function getAdminOptionLink() {
51 return util_make_link ('/plugins/message/index.php', _('Configure Message'));
55 $res = db_query_params('SELECT message FROM plugin_message', array());
56 if ($res && db_numrows($res)>0) {
57 echo '<div id="message_box">';
58 echo html_image("ic/close.png", '', '', array('alt'=>_('Close'), 'id'=>'message_close', 'style'=>'float:right;cursor:pointer'));
59 echo db_result($res, 0, 'message');
67 // c-file-style: "bsd"