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