3 * Copyright (C) 2011 Alain Peyrat, Alcatel-Lucent
4 * Copyright 2012, Franck Villaume - TrivialDev
6 * This file is part of FusionForge. FusionForge is free software;
7 * you can redistribute it and/or modify it under the terms of the
8 * GNU General Public License as published by the Free Software
9 * Foundation; either version 2 of the Licence, or (at your option)
12 * FusionForge is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License along
18 * with FusionForge; if not, write to the Free Software Foundation, Inc.,
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23 * Standard Alcatel-Lucent disclaimer for contributing to open source
25 * "The provided file ("Contribution") has not been tested and/or
26 * validated for release as or in products, combinations with products or
27 * other commercial use. Any use of the Contribution is entirely made at
28 * the user's own responsibility and the user can not rely on any features,
29 * functionalities or performances Alcatel-Lucent has attributed to the
32 * THE CONTRIBUTION BY ALCATEL-LUCENT IS PROVIDED AS IS, WITHOUT WARRANTY
33 * OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
34 * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, COMPLIANCE,
35 * NON-INTERFERENCE AND/OR INTERWORKING WITH THE SOFTWARE TO WHICH THE
36 * CONTRIBUTION HAS BEEN MADE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL
37 * ALCATEL-LUCENT BE LIABLE FOR ANY DAMAGES OR OTHER LIABLITY, WHETHER IN
38 * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
39 * CONTRIBUTION OR THE USE OR OTHER DEALINGS IN THE CONTRIBUTION, WHETHER
40 * TOGETHER WITH THE SOFTWARE TO WHICH THE CONTRIBUTION RELATES OR ON A STAND
44 require_once dirname(__FILE__)."/../../env.inc.php";
45 require_once $gfcommon.'include/pre.php';
46 require_once $gfwww.'admin/admin_utils.php';
48 $message= getStringFromRequest('body');
50 $res = db_query_params('SELECT message FROM plugin_message', array());
51 if (!$res || db_numrows($res)==0) {
52 db_query_params('INSERT INTO plugin_message (message) VALUES ($1)', array($message));
54 db_query_params('UPDATE plugin_message SET message=$1', array($message));
57 $res = db_query_params('SELECT message FROM plugin_message', array());
58 if ($res && db_numrows($res)>0) {
59 $message = db_result($res, 0, 'message');
63 site_admin_header(array('title'=>_('Global Message Administration')));
65 print _("Edit the message as you want. If you activate the HTML editor, you will be able to use WYSIWYG formatting (bold, colors...)");
68 print "<form action=\"/plugins/message/\" method=\"post\">";
70 $params['body'] = $message;
71 $params['width'] = "800";
72 $params['height'] = "300";
73 $params['content'] = '<textarea name="body" rows="20" cols="80">'.$message.'</textarea>';
74 plugin_hook_by_reference("text_editor", $params);
75 echo $params['content'];
77 print "<br /><br /><input type=\"submit\" value=\"" ._("Save") ."\" />";
81 site_admin_footer($params);