[Fusionforge-commits] (no subject)

Roland Mas lolando at libremir.placard.fr.eu.org
Tue Jun 16 17:16:04 CEST 2015


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, feature/twig-template-engine has been updated
       via  d01165c14bc1e57c1499ad040c9f1359a1a6b30f (commit)
      from  47df70a4b95dbb7edb8d9e13a03f212e03e973a4 (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 -----------------------------------------------------------------
https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=d01165c14bc1e57c1499ad040c9f1359a1a6b30f

commit d01165c14bc1e57c1499ad040c9f1359a1a6b30f
Author: Roland Mas <lolando at debian.org>
Date:   Tue Jun 16 17:15:46 2015 +0200

    Handle message hook/plugin with Twig

diff --git a/src/plugins/message/common/messagePlugin.class.php b/src/plugins/message/common/messagePlugin.class.php
index edff0bb..0f0d8de 100644
--- a/src/plugins/message/common/messagePlugin.class.php
+++ b/src/plugins/message/common/messagePlugin.class.php
@@ -54,9 +54,11 @@ on all pages, e.g. for maintenance announcements.");
 		return util_make_link ('/plugins/message/index.php', _('Configure Message'));
 	}
 
-	function message() {
+	function message($params) {
 		$res = db_query_params('SELECT message FROM plugin_message', array());
 		if ($res && db_numrows($res)>0 && $message=db_result($res, 0, 'message')) {
+			$params['message'] = $message;
+		}
 			echo '<div id="message_box">';
 			echo html_image("ic/close.png", '', '', array('alt'=>_('Close'), 'id'=>'message_close', 'style'=>'float:right;cursor:pointer'));
 			echo $message;
diff --git a/src/www/themes/funky-twig/Theme.class.php b/src/www/themes/funky-twig/Theme.class.php
index a7754d0..03993dd 100644
--- a/src/www/themes/funky-twig/Theme.class.php
+++ b/src/www/themes/funky-twig/Theme.class.php
@@ -47,6 +47,8 @@ class Theme_Funky_Twig extends Theme_Funky {
 
 		$vars['use_tooltips'] = $use_tooltips;
 		$vars['session_loggedin'] = session_loggedin();
+		$vars['theme_url'] = $this->themeurl;
+		$vars['image_url'] = $this->imgbaseurl;
 		
 		$t = $this->twig->loadTemplate($file);
 
@@ -275,6 +277,13 @@ class Theme_Funky_Twig extends Theme_Funky {
 			$vars['title'] = forge_get_config('forge_name');
 		}
 
+		// Message plugin
+		$params = array();
+		plugin_hook_by_reference('message', $params);
+		if (isset ($params['message'])) {
+			$vars['message'] = $params['message'];
+		}
+
 		// User links (login, logout, my account, etc.)
 		$cells = array();
 		$cells[] = array('text' => util_make_link('/', html_image('/header/top-logo.png', null, null, array('alt'=>'FusionForge Home'))),
diff --git a/src/www/themes/funky-twig/templates/bodyHeader.html b/src/www/themes/funky-twig/templates/bodyHeader.html
index 79c5c35..5c3b67c 100644
--- a/src/www/themes/funky-twig/templates/bodyHeader.html
+++ b/src/www/themes/funky-twig/templates/bodyHeader.html
@@ -52,6 +52,14 @@
 
 
 <div id="maindiv">
+
+  {% if message %}
+  <div id="message_box">
+    <img src="{{ image_url }}/ic/close.png" alt="Close id="message_close" style="float:right;cursor:pointer">
+    {{ message }}
+  </div>
+  {% endif %}
+
   {% include 'errorMessage.html' %}
   {% include 'warningMessage.html' %}
   {% include 'feedback.html' %}
diff --git a/src/www/themes/funky/Theme.class.php b/src/www/themes/funky/Theme.class.php
index 6c74b4e..cd817de 100644
--- a/src/www/themes/funky/Theme.class.php
+++ b/src/www/themes/funky/Theme.class.php
@@ -76,7 +76,14 @@ class Theme_Funky extends Layout {
 		echo html_ac(html_ap() -1);
 		echo html_ao('div', array('id' => 'maindiv'));
 
-		plugin_hook('message');
+		$params = array();
+		plugin_hook_by_reference('message', $params);
+		if (isset ($params['message'])) {
+			echo '<div id="message_box">';
+			echo html_image("ic/close.png", '', '', array('alt'=>_('Close'), 'id'=>'message_close', 'style'=>'float:right;cursor:pointer'));
+			echo $params['message'];
+			echo '</div>';
+		}
 
 		if(isset($GLOBALS['error_msg']) && $GLOBALS['error_msg']) {
 			echo $this->error_msg($GLOBALS['error_msg']);

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

Summary of changes:
 src/plugins/message/common/messagePlugin.class.php  | 4 +++-
 src/www/themes/funky-twig/Theme.class.php           | 9 +++++++++
 src/www/themes/funky-twig/templates/bodyHeader.html | 8 ++++++++
 src/www/themes/funky/Theme.class.php                | 9 ++++++++-
 4 files changed, 28 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
FusionForge



More information about the Fusionforge-commits mailing list