[Fusionforge-commits] r15466 - in trunk/src: plugins/scmgit/common www/scm

Franck VILLAUME nerville at fusionforge.org
Sat May 5 17:41:09 CEST 2012


Author: nerville
Date: 2012-05-05 17:41:07 +0200 (Sat, 05 May 2012)
New Revision: 15466

Modified:
   trunk/src/plugins/scmgit/common/GitPlugin.class.php
   trunk/src/www/scm/browser.php
Log:
new feature : browsing user personal git repository

Modified: trunk/src/plugins/scmgit/common/GitPlugin.class.php
===================================================================
--- trunk/src/plugins/scmgit/common/GitPlugin.class.php	2012-05-05 15:38:45 UTC (rev 15465)
+++ trunk/src/plugins/scmgit/common/GitPlugin.class.php	2012-05-05 15:41:07 UTC (rev 15466)
@@ -99,7 +99,7 @@
 				$user_id = db_result($result,$i,'user_id');
 				$user_name = db_result($result,$i,'user_name');
 				$real_name = db_result($result,$i,'realname');
-				$b .= '<tt>git clone '.util_make_url('/anonscm/git/'.$project->getUnixName().'/users/'.$user_name.'.git').'</tt> ('.util_make_link_u ($user_name, $user_id, $real_name).')<br />';
+				$b .= '<tt>git clone '.util_make_url('/anonscm/git/'.$project->getUnixName().'/users/'.$user_name.'.git').'</tt> ('.util_make_link_u ($user_name, $user_id, $real_name).') ['.util_make_link('/scm/browser.php?group_id='.$project->getID().'&user_id='.$user_id, _('Browse Git Repository')).']<br />';
 			}
 			$b .= '</p>';
 		}
@@ -212,7 +212,11 @@
 		}
 
 		if ($project->usesPlugin($this->name)) {
-			if ($this->browserDisplayable($project)) {
+			if ($params['user_id']) {
+				$user = user_get_object($params['user_id']);
+				echo $project->getUnixName().'/users/'.$user->getUnixName();
+				print '<iframe src="'.util_make_url("/plugins/scmgit/cgi-bin/gitweb.cgi?p=".$project->getUnixName().'/users/'.$user->getUnixName().'.git').'" frameborder="0" width=100% height=700></iframe>' ;
+			} else if ($this->browserDisplayable($project)) {
 				print '<iframe src="'.util_make_url("/plugins/scmgit/cgi-bin/gitweb.cgi?p=".$project->getUnixName().'/'.$project->getUnixName().'.git').'" frameborder="0" width=100% height=700></iframe>' ;
 			}
 		}

Modified: trunk/src/www/scm/browser.php
===================================================================
--- trunk/src/www/scm/browser.php	2012-05-05 15:38:45 UTC (rev 15465)
+++ trunk/src/www/scm/browser.php	2012-05-05 15:41:07 UTC (rev 15466)
@@ -4,6 +4,7 @@
  *
  * Copyright 2004, Tim Perdue -GForge LLC
  * Copyright 2004-2009, Roland Mas
+ * Copyright 2012, Franck Villaume - TrivialDev
  * http://fusionforge.org
  *
  * This file is part of FusionForge. FusionForge is free software;
@@ -30,11 +31,13 @@
 scm_header(array('title'=>_('SCM Repository'),'group'=>$group_id));
 
 $repo_name = getStringFromRequest("repo_name", "none");
+$user_id = getIntFromRequest("user_id");
 
-$hook_params = array () ;
-$hook_params['group_id'] = $group_id ;
-$hook_params['repo_name'] = $repo_name ;
-plugin_hook ("scm_browser_page", $hook_params) ;
+$hook_params = array();
+$hook_params['group_id'] = $group_id;
+$hook_params['repo_name'] = $repo_name;
+$hook_params['user_id'] = $user_id;
+plugin_hook ("scm_browser_page", $hook_params);
 
 scm_footer();
 




More information about the Fusionforge-commits mailing list