[Fusionforge-commits] FusionForge branch master updated. v6.0.3-412-ga68292a

Franck Villaume nerville at libremir.placard.fr.eu.org
Thu Mar 17 23:12:51 CET 2016


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  a68292ae652c7f41b299f7d1114769b05a571ebf (commit)
       via  4f9c5325b11b261f95dbcf8f6c901b60fb0d74ec (commit)
       via  4965a88bb61152b3076693f7f3c15a4fb7255c1f (commit)
       via  695eafcba9eb980be3533f41ec1f30abb74e9132 (commit)
       via  aae21a7b16b90367e723dc2057fedde9d03eeab8 (commit)
       via  3852e38bbeb32f0f16b4b40083d7970aa956a6b6 (commit)
       via  ec6ce0af2f0680389d51b5bd201dddaa6de42d26 (commit)
      from  2dfef63e86e075a197b55972da29642623bf320f (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=a68292ae652c7f41b299f7d1114769b05a571ebf

commit a68292ae652c7f41b299f7d1114769b05a571ebf
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Thu Mar 17 23:01:33 2016 +0100

    Forge Home Page: support widget system. To enable: set forge_homepage_widget to yes in your ini config file

diff --git a/src/CHANGES b/src/CHANGES
index a1531e1..d76ba4f 100644
--- a/src/CHANGES
+++ b/src/CHANGES
@@ -2,6 +2,7 @@ FusionForge 6.X:
 * Accounts: minimum password length is now 8
 * Spellcheck (Anders Jonsson)
 * Site Admin: add paging system in userlist page [#799] (TrivialDev)
+* Site Admin: support widgets for forge home page (TrivialDev)
 * Projects Page: add paging system in full_list and tag_cloud subpages (TrivialDev)
 * SearchEngine: support only FTI queries (TrivialDev)
 * Docman: limit number of returned documents on search query. Use paging system [#794] (TrivialDev)
diff --git a/src/common/widget/Rule_Widget.class.php b/src/common/widget/Rule_Widget.class.php
index cb13014..2798661 100644
--- a/src/common/widget/Rule_Widget.class.php
+++ b/src/common/widget/Rule_Widget.class.php
@@ -25,9 +25,8 @@ require_once 'common/valid/Rule.class.php';
 /**
  * Check that value match widget owner format
  */
-class Rule_Widget_Owner
-extends Rule {
-    function isValid($val) {
-        return (preg_match('/^([a-z][0-9]+)$/', $val) === 1);
-    }
+class Rule_Widget_Owner extends Rule {
+	function isValid($val) {
+		return (preg_match('/^([a-z][0-9]+)$/', $val) === 1);
+	}
 }
diff --git a/src/common/widget/Valid_Widget.class.php b/src/common/widget/Valid_Widget.class.php
index 1d2cd0b..88b9679 100644
--- a/src/common/widget/Valid_Widget.class.php
+++ b/src/common/widget/Valid_Widget.class.php
@@ -26,10 +26,9 @@ require_once 'Rule_Widget.class.php';
 /**
  * Valid that widget is a valid string and a valid widget owner.
  */
-class Valid_Widget_Owner
-extends Valid_String {
-    function validate($value) {
-        $this->addRule(new Rule_Widget_Owner());
-        return parent::validate($value);
-    }
+class Valid_Widget_Owner extends Valid_String {
+	function validate($value) {
+		$this->addRule(new Rule_Widget_Owner());
+		return parent::validate($value);
+	}
 }
diff --git a/src/common/widget/Widget.class.php b/src/common/widget/Widget.class.php
index bf8af51..b5dbce3 100644
--- a/src/common/widget/Widget.class.php
+++ b/src/common/widget/Widget.class.php
@@ -55,6 +55,9 @@ require_once $gfcommon.'widget/Widget_ProjectLatestCommits.class.php';
 //require_once 'common/widget/Widget_ProjectSvnStats.class.php';
 require_once $gfcommon.'widget/Widget_MyMonitoredDocuments.class.php';
 
+require_once $gfcommon.'widget/Widget_HomeTagCloud.class.php';
+require_once $gfcommon.'widget/Widget_HomeVersion.class.php';
+
 /**
 * "Codendi" Layout Widget
 *
@@ -172,6 +175,12 @@ require_once $gfcommon.'widget/Widget_MyMonitoredDocuments.class.php';
 	static  function & getInstance($widget_name) {
 		$o = null;
 		switch($widget_name) {
+			case 'hometagcloud':
+				$o = new Widget_HomeTagCloud();
+				break;
+			case 'homeversion':
+				$o = new Widget_HomeVersion();
+				break;
 			case 'mysurveys':
 				$o = new Widget_MySurveys();
 				break;
@@ -306,7 +315,7 @@ require_once $gfcommon.'widget/Widget_MyMonitoredDocuments.class.php';
 						);
 				break;
 			case WidgetLayoutManager::OWNER_TYPE_HOME:
-				$widgets = array();
+				$widgets = array('hometagcloud', 'homeversion');
 				break;
 			default:
 				$widgets = array();
diff --git a/src/common/widget/WidgetLayoutManager.class.php b/src/common/widget/WidgetLayoutManager.class.php
index 89c42db..a9c3869 100644
--- a/src/common/widget/WidgetLayoutManager.class.php
+++ b/src/common/widget/WidgetLayoutManager.class.php
@@ -53,9 +53,12 @@ class WidgetLayoutManager {
 			if($owner_type == self::OWNER_TYPE_USER) {
 				$this->createDefaultLayoutForUser($owner_id);
 				$this->displayLayout($owner_id,$owner_type);
-			} else {
-				$this->createDefaultLayoutForProject($owner_id,1);
+			} elseif ($owner_type == self::OWNER_TYPE_GROUP) {
+				$this->createDefaultLayoutForProject($owner_id, 1);
 				$this->displayLayout($owner_id,$owner_type);
+			} elseif ($owner_type == self::OWNER_TYPE_HOME) {
+				$this->createDefaultLayoutForForge($owner_id);
+				$this->displayLayout($owner_id, $owner_type);
 			}
 		} else {
 			$sql = "SELECT l.*
@@ -119,7 +122,9 @@ class WidgetLayoutManager {
 				}
 				break;
 			case self::OWNER_TYPE_HOME:
-				//Only site admin
+				if (forge_check_global_perm('forge_admin')) { //Only site admin
+					$readonly = false;
+				}
 				break;
 			default:
 				break;
@@ -179,6 +184,36 @@ class WidgetLayoutManager {
 		db_commit();
 	}
 
+	function createDefaultLayoutForForge($owner_id) {
+		db_begin();
+		$success = true;
+		$sql = "INSERT INTO owner_layouts (owner_id, owner_type, layout_id, is_default) values ($1, $2, $3, $4)";
+		if (db_query_params($sql, array($owner_id, self::OWNER_TYPE_HOME, 1, 1))) {
+
+			$sql = "INSERT INTO layouts_contents(owner_id, owner_type, layout_id, column_id, name, rank) VALUES ";
+
+			$args[] = "($1, $2, 1, 2, 'hometagcloud', 0)";
+			$args[] = "($1, $2, 1, 2, 'homestats', 1)";
+			$args[] = "($1, $2, 1, 2, 'homeversion', 2)";
+			$args[] = "($1, $2, 1, 1, 'homewelcome', 0)";
+			$args[] = "($1, $2, 1, 1, 'homelatestnews', 1)";
+
+			foreach($args as $a) {
+				if (!db_query_params($sql.$a,array(0, self::OWNER_TYPE_HOME))) {
+					$success = false;
+					break;
+				}
+			}
+		} else
+			$success = false;
+		if (!$success) {
+			$success = db_error();
+			db_rollback();
+			exit_error(sprintf(_('DB Error: %s'), $success), 'widgets');
+		}
+		db_commit();
+	}
+
 	/**
 	 * createDefaultLayoutForProject
 	 *
@@ -665,6 +700,8 @@ class WidgetLayoutManager {
 			}
 		} elseif ($owner_type == self::OWNER_TYPE_USER) {
 			$link = util_make_uri('/my/');
+		} elseif ($owner_type == self::OWNER_TYPE_HOME) {
+			$link = util_make_uri('/');
 		}
 		$feedback .= _('Your dashboard has been updated.');
 	}
diff --git a/src/common/widget/Rule_Widget.class.php b/src/common/widget/Widget_HomeTagCloud.class.php
similarity index 60%
copy from src/common/widget/Rule_Widget.class.php
copy to src/common/widget/Widget_HomeTagCloud.class.php
index cb13014..09d32ca 100644
--- a/src/common/widget/Rule_Widget.class.php
+++ b/src/common/widget/Widget_HomeTagCloud.class.php
@@ -1,9 +1,6 @@
 <?php
 /**
- * Copyright (c) STMicroelectronics, 2008. All Rights Reserved.
- *
- * Originally written by Manuel VACELET, 2008.
- *
+ * Copyright 2016, Franck Villaume - TrivialDev
  * This file is a part of Fusionforge.
  *
  * Fusionforge is free software; you can redistribute it and/or modify
@@ -17,17 +14,20 @@
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with Codendi. If not, see <http://www.gnu.org/licenses/>.
+ * along with Fusionforge. If not, see <http://www.gnu.org/licenses/>.
  */
 
-require_once 'common/valid/Rule.class.php';
+require_once 'Widget.class.php';
+require_once $gfcommon.'include/tag_cloud.php';
 
-/**
- * Check that value match widget owner format
- */
-class Rule_Widget_Owner
-extends Rule {
-    function isValid($val) {
-        return (preg_match('/^([a-z][0-9]+)$/', $val) === 1);
-    }
+class Widget_HomeTagCloud extends Widget {
+	function __construct() {
+		$this->Widget('hometagcloud');
+	}
+	function getTitle() {
+		return _('Tag Cloud');
+	}
+	function getContent() {
+		return tag_cloud();
+	}
 }
diff --git a/src/common/widget/Rule_Widget.class.php b/src/common/widget/Widget_HomeVersion.class.php
similarity index 53%
copy from src/common/widget/Rule_Widget.class.php
copy to src/common/widget/Widget_HomeVersion.class.php
index cb13014..8cf8ea4 100644
--- a/src/common/widget/Rule_Widget.class.php
+++ b/src/common/widget/Widget_HomeVersion.class.php
@@ -1,9 +1,6 @@
 <?php
 /**
- * Copyright (c) STMicroelectronics, 2008. All Rights Reserved.
- *
- * Originally written by Manuel VACELET, 2008.
- *
+ * Copyright 2016, Franck Villaume - TrivialDev
  * This file is a part of Fusionforge.
  *
  * Fusionforge is free software; you can redistribute it and/or modify
@@ -17,17 +14,21 @@
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with Codendi. If not, see <http://www.gnu.org/licenses/>.
+ * along with Fusionforge. If not, see <http://www.gnu.org/licenses/>.
  */
 
-require_once 'common/valid/Rule.class.php';
+require_once 'Widget.class.php';
+require_once $gfcommon.'include/tag_cloud.php';
 
-/**
- * Check that value match widget owner format
- */
-class Rule_Widget_Owner
-extends Rule {
-    function isValid($val) {
-        return (preg_match('/^([a-z][0-9]+)$/', $val) === 1);
-    }
+class Widget_HomeVersion extends Widget {
+	function __construct() {
+		$this->Widget('homeversion');
+	}
+	function getTitle() {
+		return _('System Information');
+	}
+	function getContent() {
+		$ff = FusionForge::getInstance();
+		return sprintf(_('%s is running %s version %s'), forge_get_config('forge_name'), $ff->software_name, $ff->software_version);
+	}
 }
diff --git a/src/etc/config.ini.d/defaults.ini b/src/etc/config.ini.d/defaults.ini
index 8e0e0a9..c1818ab 100644
--- a/src/etc/config.ini.d/defaults.ini
+++ b/src/etc/config.ini.d/defaults.ini
@@ -88,6 +88,7 @@ allow_project_without_template = yes
 use_webdav = no
 user_default_shell = "/bin/bash"
 user_display_contact_info = yes
+forge_homepage_widget = no
 
 scm_single_host = yes
 system_user=fusionforge
diff --git a/src/www/index.php b/src/www/index.php
index f21f47e..fd7d553 100644
--- a/src/www/index.php
+++ b/src/www/index.php
@@ -6,6 +6,7 @@
  * The rest Copyright 2002-2004 (c) GForge Team
  * Copyright 2008-2010 (c) FusionForge Team
  * Copyright (C) 2010 Alain Peyrat - Alcatel-Lucent
+ * Copyright 2016, Franck Villaume - TrivialDev
  * http://fusionforge.org/
  *
  * This file is part of FusionForge. FusionForge is free software;
@@ -29,12 +30,50 @@ require_once $gfcommon.'include/pre.php';
 require_once $gfwww.'news/news_utils.php';
 require_once $gfcommon.'forum/Forum.class.php';
 require_once $gfwww.'include/features_boxes.php';
+require_once $gfcommon.'widget/WidgetLayoutManager.class.php';
 
-$HTML->header(array('title'=>_('Welcome'), 'h1' => ''));
+if (!forge_get_config('forge_homepage_widget')) {
+	$HTML->header(array('title'=>_('Welcome'), 'h1' => ''));
 
-// Main page content is now themeable (see www/include/Layout.class.php);
-// Default is index_std.php;
-include ($HTML->getRootIndex());
+	// Main page content is now themeable (see www/include/Layout.class.php);
+	// Default is index_std.php;
+	include ($HTML->getRootIndex());
+} else {
+
+	$params = array('submenu' => null);
+	if (session_loggedin() && forge_check_global_perm('forge_admin')) {
+
+		// Display with the preferred layout/theme of the user (if logged-in)
+		$sql = "SELECT l.*
+				FROM layouts AS l INNER JOIN owner_layouts AS o ON(l.id = o.layout_id)
+				WHERE o.owner_type = $1
+				AND o.owner_id = $2
+				AND o.is_default = 1
+				";
+		$res = db_query_params($sql,array('h', 0));
+		if($res && db_numrows($res)<1) {
+			$lm = new WidgetLayoutManager();
+			$lm->createDefaultLayoutForForge(0);
+			$res = db_query_params($sql,array('h', 0));
+		}
+		$id = db_result($res, 0 , 'id');
+		$params['submenu'] = $HTML->subMenu(
+					array(_("Add widgets"),
+						_("Customize Layout")),
+					array('/widgets/widgets.php?owner=h0&layout_id='.$id,
+						'/widgets/widgets.php?owner=h0&layout_id='.$id.'&update=layout'),
+					array(array('title' => _('Select new widgets to display on the forge home page.')),
+					array('title' => _('Modify the layout: one column, multiple columns or build your own layout.'))));
+	}
+
+	html_use_jqueryui();
+	site_header(array('title'=> _('Welcome'), 'h1' => '', 'toptab' => 'home',
+		'submenu' => $params['submenu']));
+
+	plugin_hook('message');
+	$lm = new WidgetLayoutManager();
+	$lm->displayLayout(0, WidgetLayoutManager::OWNER_TYPE_HOME);
+}
 
 $HTML->footer();
 
diff --git a/src/www/widgets/updatelayout.php b/src/www/widgets/updatelayout.php
index 6ce9600..1cf2952 100644
--- a/src/www/widgets/updatelayout.php
+++ b/src/www/widgets/updatelayout.php
@@ -1,6 +1,7 @@
 <?php
 /**
  * Copyright (c) Xerox Corporation, Codendi Team, 2001-2009. All rights reserved
+ * Copyright 2016, Franck Villaume - TrivialDev
  * http://fusionforge.org
  *
  * This file is part of FusionForge. FusionForge is free software;
@@ -57,6 +58,13 @@ if ($owner) {
 				$good = true;
 			}
 			break;
+		case WidgetLayoutManager::OWNER_TYPE_HOME:
+			$redirect = '/';
+			if (!forge_check_global_perm('forge_admin')) {
+				$GLOBALS['Response']->redirect($redirect);
+			}
+			$good = true;
+			break;
 		default:
 			break;
 	}
@@ -83,6 +91,10 @@ if ($owner) {
 											if (forge_check_perm ('project_admin', $owner_id, NULL)) {
 												$lm->removeWidget($owner_id, $owner_type, $layout_id, $name, $instance_id, $widget);
 											}
+										} elseif ($owner_type == WidgetLayoutManager::OWNER_TYPE_HOME) {
+											if (forge_check_global_perm('forge_admin')) {
+												$lm->removeWidget($owner_id, $owner_type, $layout_id, $name, $instance_id, $widget);
+											}
 										} else {
 											$lm->removeWidget($owner_id, $owner_type, $layout_id, $name, $instance_id, $widget);
 										}
diff --git a/src/www/widgets/widgets.php b/src/www/widgets/widgets.php
index 13c7b8d..63865c4 100644
--- a/src/www/widgets/widgets.php
+++ b/src/www/widgets/widgets.php
@@ -1,7 +1,7 @@
 <?php
 /**
  *
- * Copyright 2011-2014, Franck Villaume - TrivialDev
+ * Copyright 2011-2014,2016, Franck Villaume - TrivialDev
  * http://fusionforge.org
  *
  * This file is part of FusionForge. FusionForge is free software;
@@ -31,7 +31,8 @@ html_use_jquery();
 use_javascript('/widgets/scripts/LayoutController.js');
 
 $hp = Codendi_HTMLPurifier::instance();
-if (isLogged()) {
+
+if (session_loggedin()) {
 
 	$request =& HTTPRequest::instance();
 	$lm = new WidgetLayoutManager();
@@ -39,7 +40,6 @@ if (isLogged()) {
 	$vLayoutId->required();
 	if ($request->valid($vLayoutId)) {
 		$layout_id = $request->get('layout_id');
-
 		$vOwner = new Valid_Widget_Owner('owner');
 		$vOwner->required();
 		if ($request->valid($vOwner)) {
@@ -76,6 +76,20 @@ if (isLogged()) {
 						}
 					}
 					break;
+				case WidgetLayoutManager::OWNER_TYPE_HOME:
+					if (forge_check_global_perm('forge_admin')) {
+						if (HTTPRequest::instance()->get('update') == 'layout') {
+							$title = _('Customize Layout');
+						} else {
+							$title = _('Add widgets');
+						}
+						site_header(array('title'=>$title, 'toptab'=>'home'));
+						$lm->displayAvailableWidgets(0, WidgetLayoutManager::OWNER_TYPE_HOME, $layout_id);
+						site_footer();
+					} else {
+						$GLOBALS['Response']->redirect('/');
+					}
+					break;
 				default:
 					break;
 			}

https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=4f9c5325b11b261f95dbcf8f6c901b60fb0d74ec

commit 4f9c5325b11b261f95dbcf8f6c901b60fb0d74ec
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Wed Mar 16 21:07:02 2016 +0100

    fix public-area-box link

diff --git a/src/plugins/mediawiki/common/mediawikiPlugin.class.php b/src/plugins/mediawiki/common/mediawikiPlugin.class.php
index 6a9aa84..58eec58 100644
--- a/src/plugins/mediawiki/common/mediawikiPlugin.class.php
+++ b/src/plugins/mediawiki/common/mediawikiPlugin.class.php
@@ -115,7 +115,7 @@ _("This plugin allows each project to embed Mediawiki under a tab.");
 			if ( $project->usesPlugin ( $this->name ) ) {
 				$params['result'] .= '<div class="public-area-box">';
 				$params['result'] .= util_make_link('/plugins/mediawiki/wiki/'.$project->getUnixName().'/index.php',
-							html_abs_image(util_make_url('/plugins/mediawiki/wiki/'.$project->getUnixName().'/skins/monobook/wiki.png'),'20','20',array('alt'=>'Mediawiki')),
+							html_abs_image(util_make_url('/plugins/mediawiki/wiki/'.$project->getUnixName().'/skins/monobook/wiki.png'),'20','20',array('alt'=>'Mediawiki')).
 							' '.'Mediawiki');
 				$params['result'] .= '</div>';
 			}
diff --git a/src/plugins/moinmoin/common/MoinMoinPlugin.class.php b/src/plugins/moinmoin/common/MoinMoinPlugin.class.php
index 2bfa388..e8c78e2 100644
--- a/src/plugins/moinmoin/common/MoinMoinPlugin.class.php
+++ b/src/plugins/moinmoin/common/MoinMoinPlugin.class.php
@@ -117,7 +117,7 @@ _("This plugin allows each project to embed MoinMoinWiki under a tab.");
 			}
 			if ( $project->usesPlugin ( $this->name ) ) {
 				$params['result'] .= '<div class="public-area-box">';
-				$params['result'] .= util_make_link($this->getWikiUrl($project), 'MoinMoin', array(), true);
+				$params['result'] .= util_make_link($this->getWikiUrl($project), html_image('ic/wiki20g.png', 20, 20, array('alt' => 'Wiki')).' '.'MoinMoin', array(), true);
 				$params['result'] .= '</div>';
 			}
 		} elseif ($hookname == "role_get") {
diff --git a/src/plugins/wiki/common/WikiPlugin.class.php b/src/plugins/wiki/common/WikiPlugin.class.php
index a9dc7ce..6c38a9a 100644
--- a/src/plugins/wiki/common/WikiPlugin.class.php
+++ b/src/plugins/wiki/common/WikiPlugin.class.php
@@ -134,7 +134,7 @@ page edits displayed on activity tab, and multi-project wiki preferences.");
 			if ($project->usesPlugin($this->name)) {
 				$params['result'] .= '<div class="public-area-box">';
 				$params['result'] .= util_make_link('/wiki/g/'.$project->getUnixName().'/HomePage',
-									html_image('ic/wiki20g.png', 20, 20, array('alt' => 'Wiki')),
+									html_image('ic/wiki20g.png', 20, 20, array('alt' => 'Wiki')).
 									' '.'Wiki');
 				$params['result'] .= '</div>';
 			}

https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=4965a88bb61152b3076693f7f3c15a4fb7255c1f

commit 4965a88bb61152b3076693f7f3c15a4fb7255c1f
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Wed Mar 16 20:59:53 2016 +0100

    tab vs. space

diff --git a/src/plugins/wiki/common/WikiPlugin.class.php b/src/plugins/wiki/common/WikiPlugin.class.php
index cc30a53..a9dc7ce 100644
--- a/src/plugins/wiki/common/WikiPlugin.class.php
+++ b/src/plugins/wiki/common/WikiPlugin.class.php
@@ -156,7 +156,7 @@ page edits displayed on activity tab, and multi-project wiki preferences.");
 
 					$pat = '_g'.$group_id.'_';
 					$len = strlen($pat)+1;
-                    $encoding = pg_client_encoding();
+					$encoding = pg_client_encoding();
 					// @ToDo: to remove after wiki tables convert
 					pg_set_client_encoding("iso-8859-1");
 					$wres = db_query_params ("SELECT plugin_wiki_page.id AS id,

https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=695eafcba9eb980be3533f41ec1f30abb74e9132

commit 695eafcba9eb980be3533f41ec1f30abb74e9132
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Wed Mar 16 20:59:15 2016 +0100

    use HTML helpers

diff --git a/src/plugins/wiki/common/WikiPlugin.class.php b/src/plugins/wiki/common/WikiPlugin.class.php
index 0280905..cc30a53 100644
--- a/src/plugins/wiki/common/WikiPlugin.class.php
+++ b/src/plugins/wiki/common/WikiPlugin.class.php
@@ -75,7 +75,7 @@ page edits displayed on activity tab, and multi-project wiki preferences.");
 			$group_id = $params['group_id'];
 			$group = group_get_object($group_id);
 			if ($group->usesPlugin($this->name)) {
-				echo '<p><a href="/wiki/wikiadmin.php?group_id=' . $group->getID() . '&type=admin&pluginname=' . $this->name . '">' . _('Wiki Admin') . '</a></p>';
+				echo html_e('p', array(), util_make_link('/wiki/wikiadmin.php?group_id='.$group->getID().'&type=admin&pluginname='.$this->name, _('Wiki Admin')));
 			}
 		} elseif ($hookname == 'search_engines') {
 			// FIXME: when the hook is called, the group_id is not set.

https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=aae21a7b16b90367e723dc2057fedde9d03eeab8

commit aae21a7b16b90367e723dc2057fedde9d03eeab8
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Wed Mar 16 20:52:21 2016 +0100

    fix Public Area Widget, hook project_public_area

diff --git a/src/plugins/mediawiki/common/mediawikiPlugin.class.php b/src/plugins/mediawiki/common/mediawikiPlugin.class.php
index 1828bbd..6a9aa84 100644
--- a/src/plugins/mediawiki/common/mediawikiPlugin.class.php
+++ b/src/plugins/mediawiki/common/mediawikiPlugin.class.php
@@ -3,7 +3,7 @@
  * MediaWikiPlugin Class
  *
  * Copyright 2000-2011, Fusionforge Team
- * Copyright 2012,2014 Franck Villaume - TrivialDev
+ * Copyright 2012,2014,2016, Franck Villaume - TrivialDev
  * http://fusionforge.org
  *
  * This file is part of FusionForge.
@@ -61,7 +61,7 @@ _("This plugin allows each project to embed Mediawiki under a tab.");
 		$this->_addHook("clone_project_from_template") ;
 		$this->_addHook('group_delete');
 	}
-	
+
 	function process() {
 		echo '<h1>Mediawiki</h1>';
 		echo $this->getPluginInfo()->getpropVal('answer');
@@ -113,12 +113,11 @@ _("This plugin allows each project to embed Mediawiki under a tab.");
 				return;
 			}
 			if ( $project->usesPlugin ( $this->name ) ) {
-				echo '<div class="public-area-box">';
-				print '<a href="'. util_make_url ('/plugins/mediawiki/wiki/'.$project->getUnixName().'/index.php').'">';
-				print html_abs_image(util_make_url ('/plugins/mediawiki/wiki/'.$project->getUnixName().'/skins/monobook/wiki.png'),'20','20',array('alt'=>'Mediawiki'));
-				print ' Mediawiki';
-				print '</a>';
-				echo '</div>';
+				$params['result'] .= '<div class="public-area-box">';
+				$params['result'] .= util_make_link('/plugins/mediawiki/wiki/'.$project->getUnixName().'/index.php',
+							html_abs_image(util_make_url('/plugins/mediawiki/wiki/'.$project->getUnixName().'/skins/monobook/wiki.png'),'20','20',array('alt'=>'Mediawiki')),
+							' '.'Mediawiki');
+				$params['result'] .= '</div>';
 			}
 		} elseif ($hookname == "role_get") {
 			$role =& $params['role'] ;
diff --git a/src/plugins/moinmoin/common/MoinMoinPlugin.class.php b/src/plugins/moinmoin/common/MoinMoinPlugin.class.php
index 0479b01..2bfa388 100644
--- a/src/plugins/moinmoin/common/MoinMoinPlugin.class.php
+++ b/src/plugins/moinmoin/common/MoinMoinPlugin.class.php
@@ -116,11 +116,9 @@ _("This plugin allows each project to embed MoinMoinWiki under a tab.");
 				return;
 			}
 			if ( $project->usesPlugin ( $this->name ) ) {
-				echo '<div class="public-area-box">';
-				print '<a href="'. $this->getWikiUrl($project).'">';
-				print 'MoinMoin';
-				print '</a>';
-				echo '</div>';
+				$params['result'] .= '<div class="public-area-box">';
+				$params['result'] .= util_make_link($this->getWikiUrl($project), 'MoinMoin', array(), true);
+				$params['result'] .= '</div>';
 			}
 		} elseif ($hookname == "role_get") {
 			$role =& $params['role'] ;
diff --git a/src/plugins/wiki/common/WikiPlugin.class.php b/src/plugins/wiki/common/WikiPlugin.class.php
index 7e46639..0280905 100644
--- a/src/plugins/wiki/common/WikiPlugin.class.php
+++ b/src/plugins/wiki/common/WikiPlugin.class.php
@@ -4,6 +4,7 @@
  * Wiki Search Engine for Fusionforge
  *
  * Copyright 2006 (c) Alain Peyrat
+ * Copyright 2016, Franck Villaume - TrivialDev
  *
  * This file is part of Fusionforge.
  *
@@ -131,12 +132,11 @@ page edits displayed on activity tab, and multi-project wiki preferences.");
 				return;
 			}
 			if ($project->usesPlugin($this->name)) {
-				echo '<div class="public-area-box">';
-				print '<a href="'. util_make_url ('/wiki/g/'.$project->getUnixName().'/HomePage').'">';
-				print html_image("ic/wiki20g.png","20","20",array("alt"=>"Wiki"));
-				print ' Wiki';
-				print '</a>';
-				echo '</div>';
+				$params['result'] .= '<div class="public-area-box">';
+				$params['result'] .= util_make_link('/wiki/g/'.$project->getUnixName().'/HomePage',
+									html_image('ic/wiki20g.png', 20, 20, array('alt' => 'Wiki')),
+									' '.'Wiki');
+				$params['result'] .= '</div>';
 			}
 		} elseif ($hookname == 'activity') {
 			$group = group_get_object($params['group']);

https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=3852e38bbeb32f0f16b4b40083d7970aa956a6b6

commit 3852e38bbeb32f0f16b4b40083d7970aa956a6b6
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Wed Mar 16 20:21:04 2016 +0100

    tab vs. space

diff --git a/src/plugins/wiki/common/WikiPlugin.class.php b/src/plugins/wiki/common/WikiPlugin.class.php
index cec35b3..7e46639 100644
--- a/src/plugins/wiki/common/WikiPlugin.class.php
+++ b/src/plugins/wiki/common/WikiPlugin.class.php
@@ -114,8 +114,7 @@ page edits displayed on activity tab, and multi-project wiki preferences.");
 			if (defined('PHPWIKI_BASE_URL')) {
 				use_stylesheet('/wiki/themes/fusionforge/fusionforge.css');
 				use_stylesheet('/wiki/themes/fusionforge/fusionforge-print.css', 'print');
-                use_stylesheet('/wiki/highlight.js/styles/github.css');
-
+				use_stylesheet('/wiki/highlight.js/styles/github.css');
 				echo '    <link rel="alternate" type="application/x-wiki" title="Edit this page!" href="'.$_SERVER['PHP_SELF'].'?action=edit" />';
 				echo "\n".'    <link rel="alternate stylesheet" type="text/css" href="/wiki/themes/fusionforge/fusionforge-fullscreen.css" media="screen" title="Fullscreen" />';
 				echo "\n".'    <link rel="alternate stylesheet" type="text/css" href="/wiki/themes/fusionforge/fusionforge-autonumbering.css" title="Autonumbering" />';

https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=ec6ce0af2f0680389d51b5bd201dddaa6de42d26

commit ec6ce0af2f0680389d51b5bd201dddaa6de42d26
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Wed Mar 16 20:12:18 2016 +0100

    fix Widget Public Area display for scm_stat hook

diff --git a/src/common/widget/Widget_ProjectPublicAreas.class.php b/src/common/widget/Widget_ProjectPublicAreas.class.php
index 405cd35..9edb50b 100644
--- a/src/common/widget/Widget_ProjectPublicAreas.class.php
+++ b/src/common/widget/Widget_ProjectPublicAreas.class.php
@@ -1,7 +1,7 @@
 <?php
 /**
  * Copyright (c) Xerox Corporation, Codendi Team, 2001-2009. All rights reserved
- * Copyright 2012,2014 Franck Villaume - TrivialDev
+ * Copyright 2012,2014,2016, Franck Villaume - TrivialDev
  * http://fusionforge.org
  *
  * This file is a part of Fusionforge.
@@ -197,6 +197,7 @@ class Widget_ProjectPublicAreas extends Widget {
 
 			$hook_params = array () ;
 			$hook_params['group_id'] = $group_id ;
+			$hook_params['result'] = &$result;
 			plugin_hook ("scm_stats", $hook_params) ;
 			$result .= "\n</div>\n";
 		}
@@ -205,6 +206,7 @@ class Widget_ProjectPublicAreas extends Widget {
 
 		$hook_params = array ();
 		$hook_params['group_id'] = $group_id;
+		$hook_params['result'] = &$result;
 		plugin_hook ("project_public_area", $hook_params);
 
 		// ######################## AnonFTP
diff --git a/src/plugins/scmbzr/common/BzrPlugin.class.php b/src/plugins/scmbzr/common/BzrPlugin.class.php
index b500b43..fb0f78d 100644
--- a/src/plugins/scmbzr/common/BzrPlugin.class.php
+++ b/src/plugins/scmbzr/common/BzrPlugin.class.php
@@ -73,7 +73,7 @@ over it to the project's administrator.");
 			if (!$add_num) {
 				$add_num=0;
 			}
-			echo ' (Bazaar: '.sprintf(_('<strong>%1$s</strong> updates, <strong>%2$s</strong> adds'), number_format($commit_num, 0), number_format($add_num, 0)).")";
+			$params['result'] .= ' (Bazaar: '.sprintf(_('<strong>%1$s</strong> updates, <strong>%2$s</strong> adds'), number_format($commit_num, 0), number_format($add_num, 0)).")";
 		}
 	}
 
diff --git a/src/plugins/scmcvs/common/CVSPlugin.class.php b/src/plugins/scmcvs/common/CVSPlugin.class.php
index 422051c..485c223 100644
--- a/src/plugins/scmcvs/common/CVSPlugin.class.php
+++ b/src/plugins/scmcvs/common/CVSPlugin.class.php
@@ -67,7 +67,7 @@ over it to the project's administrator.");
 			if (!$add_num) {
 				$add_num=0;
 			}
-			echo ' (CVS: '.sprintf(_('<strong>%1$s</strong> commits, <strong>%2$s</strong> adds'), number_format($commit_num, 0), number_format($add_num, 0)).")";
+			$params['result'] .= ' (CVS: '.sprintf(_('<strong>%1$s</strong> commits, <strong>%2$s</strong> adds'), number_format($commit_num, 0), number_format($add_num, 0)).")";
 		}
 	}
 
diff --git a/src/plugins/scmdarcs/common/DarcsPlugin.class.php b/src/plugins/scmdarcs/common/DarcsPlugin.class.php
index a8968d0..a9cdd59 100644
--- a/src/plugins/scmdarcs/common/DarcsPlugin.class.php
+++ b/src/plugins/scmdarcs/common/DarcsPlugin.class.php
@@ -3,7 +3,7 @@
  * FusionForge Darcs plugin
  *
  * Copyright 2009, Roland Mas
- * Copyright 2013-2014, Franck Villaume - TrivialDev
+ * Copyright 2013-2014,2016, Franck Villaume - TrivialDev
  *
  * This file is part of FusionForge.
  *
@@ -87,7 +87,7 @@ over it to the project's administrator.");
 			if (!$add_num) {
 				$add_num=0;
 			}
-			echo ' (Darcs: '.sprintf(_('<strong>%1$s</strong> updates, <strong>%2$s</strong> adds'), number_format($commit_num, 0), number_format($add_num, 0)).")";
+			$params['result'] .= ' (Darcs: '.sprintf(_('<strong>%1$s</strong> updates, <strong>%2$s</strong> adds'), number_format($commit_num, 0), number_format($add_num, 0)).")";
 		}
 	}
 
diff --git a/src/plugins/scmgit/common/GitPlugin.class.php b/src/plugins/scmgit/common/GitPlugin.class.php
index 30faa03..f272985 100644
--- a/src/plugins/scmgit/common/GitPlugin.class.php
+++ b/src/plugins/scmgit/common/GitPlugin.class.php
@@ -4,7 +4,7 @@
  *
  * Copyright 2009, Roland Mas
  * Copyright 2009, Mehdi Dogguy <mehdi at debian.org>
- * Copyright 2012-2014, Franck Villaume - TrivialDev
+ * Copyright 2012-2014,2016, Franck Villaume - TrivialDev
  * Copyright © 2013
  *	Thorsten Glaser <t.glaser at tarent.de>
  * http://fusionforge.org
@@ -81,7 +81,7 @@ control over it to the project's administrator.");
 			if (!$add_num) {
 				$add_num = 0;
 			}
-			echo ' (Git: '.sprintf(_('<strong>%1$s</strong> updates, <strong>%2$s</strong> adds'), number_format($commit_num, 0), number_format($add_num, 0)).')';
+			$params['result'] .= ' (Git: '.sprintf(_('<strong>%1$s</strong> updates, <strong>%2$s</strong> adds'), number_format($commit_num, 0), number_format($add_num, 0)).')';
 		}
 	}
 
diff --git a/src/plugins/scmhg/common/HgPlugin.class.php b/src/plugins/scmhg/common/HgPlugin.class.php
index 3c626c7..e251f30 100644
--- a/src/plugins/scmhg/common/HgPlugin.class.php
+++ b/src/plugins/scmhg/common/HgPlugin.class.php
@@ -186,7 +186,7 @@ Offer DAV or SSH access.");
 			if (!$add_num) {
 				$add_num=0;
 			}
-			echo ' (Mercurial: '.sprintf(_('<strong>%1$s</strong> updates, <strong>%2$s</strong> adds'), number_format($update_num, 0), number_format($add_num, 0)).")";
+			$params['result'] .= ' (Mercurial: '.sprintf(_('<strong>%1$s</strong> updates, <strong>%2$s</strong> adds'), number_format($update_num, 0), number_format($add_num, 0)).")";
 		}
 	}
 
diff --git a/src/plugins/scmsvn/common/SVNPlugin.class.php b/src/plugins/scmsvn/common/SVNPlugin.class.php
index 04ce267..a87d8e1 100644
--- a/src/plugins/scmsvn/common/SVNPlugin.class.php
+++ b/src/plugins/scmsvn/common/SVNPlugin.class.php
@@ -84,7 +84,7 @@ some control over it to the project's administrator.");
 			if (!$add_num) {
 				$add_num=0;
 			}
-			echo ' (Subversion: '.sprintf(_('<strong>%1$s</strong> updates, <strong>%2$s</strong> adds'), number_format($commit_num, 0), number_format($add_num, 0)).")";
+			$params['result'] .= ' (Subversion: '.sprintf(_('<strong>%1$s</strong> updates, <strong>%2$s</strong> adds'), number_format($commit_num, 0), number_format($add_num, 0)).")";
 		}
 	}
 

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

Summary of changes:
 src/CHANGES                                        |  1 +
 src/common/widget/Rule_Widget.class.php            |  9 ++---
 src/common/widget/Valid_Widget.class.php           | 11 +++--
 src/common/widget/Widget.class.php                 | 11 ++++-
 src/common/widget/WidgetLayoutManager.class.php    | 43 ++++++++++++++++++--
 .../widget/Widget_HomeTagCloud.class.php}          | 19 +++++----
 .../widget/Widget_HomeVersion.class.php}           | 20 +++++----
 .../widget/Widget_ProjectPublicAreas.class.php     |  4 +-
 src/etc/config.ini.d/defaults.ini                  |  1 +
 .../mediawiki/common/mediawikiPlugin.class.php     | 15 ++++---
 .../moinmoin/common/MoinMoinPlugin.class.php       |  8 ++--
 src/plugins/scmbzr/common/BzrPlugin.class.php      |  2 +-
 src/plugins/scmcvs/common/CVSPlugin.class.php      |  2 +-
 src/plugins/scmdarcs/common/DarcsPlugin.class.php  |  4 +-
 src/plugins/scmgit/common/GitPlugin.class.php      |  4 +-
 src/plugins/scmhg/common/HgPlugin.class.php        |  2 +-
 src/plugins/scmsvn/common/SVNPlugin.class.php      |  2 +-
 src/plugins/wiki/common/WikiPlugin.class.php       | 19 +++++----
 src/www/index.php                                  | 47 ++++++++++++++++++++--
 src/www/widgets/updatelayout.php                   | 12 ++++++
 src/www/widgets/widgets.php                        | 20 +++++++--
 21 files changed, 188 insertions(+), 68 deletions(-)
 copy src/{plugins/hudson/include/HudsonOverviewWidget.class.php => common/widget/Widget_HomeTagCloud.class.php} (67%)
 copy src/{plugins/hudson/include/HudsonOverviewWidget.class.php => common/widget/Widget_HomeVersion.class.php} (59%)


hooks/post-receive
-- 
FusionForge



More information about the Fusionforge-commits mailing list