[Fusionforge-commits] FusionForge branch master updated. cc0a768306e2ed95b60f2a1e330a5bb7f59cfd2a

Franck Villaume nerville at fusionforge.org
Sat Jul 12 19:27:45 CEST 2014


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "FusionForge".

The branch, master has been updated
       via  cc0a768306e2ed95b60f2a1e330a5bb7f59cfd2a (commit)
      from  16f2679445602ee16ed09f133371f1b8890db6f5 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit cc0a768306e2ed95b60f2a1e330a5bb7f59cfd2a
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Sat Jul 12 19:26:21 2014 +0200

    plugin message: fix html syntax and set feedback message

diff --git a/src/plugins/message/www/index.php b/src/plugins/message/www/index.php
index d1a59da..757179c 100644
--- a/src/plugins/message/www/index.php
+++ b/src/plugins/message/www/index.php
@@ -1,7 +1,7 @@
 <?php
 /**
  * Copyright (C) 2011 Alain Peyrat, Alcatel-Lucent
- * Copyright 2012, Franck Villaume - TrivialDev
+ * Copyright 2012,2014, Franck Villaume - TrivialDev
  *
  * This file is part of FusionForge. FusionForge is free software;
  * you can redistribute it and/or modify it under the terms of the
@@ -45,13 +45,22 @@ require_once dirname(__FILE__)."/../../env.inc.php";
 require_once $gfcommon.'include/pre.php';
 require_once $gfwww.'admin/admin_utils.php';
 
+global $HTML;
+global $feedback;
+
 $message= getStringFromRequest('body');
 if ($_SERVER['REQUEST_METHOD'] == 'POST') {
 	$res = db_query_params('SELECT message FROM plugin_message', array());
 	if (!$res || db_numrows($res)==0) {
 		db_query_params('INSERT INTO plugin_message (message) VALUES ($1)', array($message));
+		$feedback = _('New message available.');
 	} else {
 		db_query_params('UPDATE plugin_message SET message=$1', array($message));
+		if (!empty($message)) {
+			$feedback = _('Message updated.');
+		} else {
+			$feedback = _('Message removed.');
+		}
 	}
 } else {
 	$res = db_query_params('SELECT message FROM plugin_message', array());
@@ -60,12 +69,12 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') {
 	}
 }
 
-site_admin_header(array('title'=>_('Global Message Administration')));
+site_admin_header(array('title' => _('Global Message Administration')));
 
-print _("Edit the message as you want. If you activate the HTML editor, you will be able to use WYSIWYG formatting (bold, colors...)");
+echo html_e('p', array(), _('Edit the message as you want. If you activate the HTML editor, you will be able to use WYSIWYG formatting (bold, colors...)'));
 
-print "<p/><center>";
-print "<form action=\"/plugins/message/\" method=\"post\">";
+print "<center>";
+echo $HTML->openForm(array('action' => '/plugins/message/', 'method' => 'post'));
 
 $params['body'] = $message;
 $params['width'] = "800";
@@ -75,7 +84,7 @@ plugin_hook_by_reference("text_editor", $params);
 echo $params['content'];
 
 print "<br /><br /><input type=\"submit\" value=\"" ._("Save") ."\" />";
-print "</form>";
+echo $HTML->closeForm();
 print "</center>";
 
 site_admin_footer($params);

-----------------------------------------------------------------------

Summary of changes:
 src/plugins/message/www/index.php |   21 +++++++++++++++------
 1 file changed, 15 insertions(+), 6 deletions(-)


hooks/post-receive
-- 
FusionForge



More information about the Fusionforge-commits mailing list