[evolvis-commits] r9684: modifications to scm pluginification effort - scm_utils. php was created↵

mirabilos at evolvis.org mirabilos at evolvis.org
Thu Feb 24 17:29:24 CET 2011


Author: mirabilos
Date: 2011-02-24 17:29:24 +0100 (Thu, 24 Feb 2011)
New Revision: 9684

Added:
   trunk/gforge_base/evolvisforge-5.1/gforge/www/scm/scm_utils.php
Modified:
   trunk/gforge_base/evolvisforge-5.1/gforge/www/scm/admin/index.php
   trunk/gforge_base/evolvisforge-5.1/gforge/www/scm/index.php
Log:
modifications to scm pluginification effort - scm_utils.php was created


Modified: trunk/gforge_base/evolvisforge-5.1/gforge/www/scm/admin/index.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/gforge/www/scm/admin/index.php	2011-02-24 16:29:23 UTC (rev 9683)
+++ trunk/gforge_base/evolvisforge-5.1/gforge/www/scm/admin/index.php	2011-02-24 16:29:24 UTC (rev 9684)
@@ -1,32 +1,36 @@
 <?php
 /**
-  *
-  * SourceForge CVS Frontend
-  *
-  * SourceForge: Breaking Down the Barriers to Open Source Development
-  * Copyright 1999-2001 (c) VA Linux Systems
-  * http://sourceforge.net
-  *
-  * @version   $Id$
-  *
-  */
+<<<<<<< index.php
+ * GForge SCM Frontend
+ *
+ * Copyright 2004 (c) Roland Mas, GForge LLC
+ *
+ * @version   $Id$
+ * @author Tim Perdue tim at gforge.org
+ * @date 2004-05-19
+ *
+ * This file is part of GForge.
+ *
+ * GForge is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * GForge is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GForge; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
 
+require_once('pre.php');
+require_once('www/scm/scm_utils.php');
 
-require_once('pre.php');    
-require_once('common/include/account.php');
+scm_header(array('title'=>$Language->getText('scm_index','cvs_repository'),'group'=>$group_id));
 
-//only projects can use cvs, and only if they have it turned on
-$project =& group_get_object($group_id);
-
-if (!$project->isProject()) {
- 	exit_error('Error',$Language->getText('scm_index','error_only_projects_can_use_cvs'));
-}
-if (!$project->usesCVS()) {
-	exit_error('Error',$Language->getText('scm_index','error_this_project_has_turned_off'));
-}
-
-site_project_header(array('title'=>$Language->getText('scm_index','cvs_repository'),'group'=>$group_id,'toptab'=>'scm_index','pagename'=>'scm_index','sectionvals'=>array($project->getPublicName())));
-
 if ($submit) {
 	$hook_params = array () ;
 	$hook_params['group_id'] = $group_id ;
@@ -43,7 +47,7 @@
 }
 
 ?>
-<form action="/scm/admin/index.php?group_id=<?php echo $group_id; ?>">
+<form action="<?php echo $PHP_SELF; ?>">
 <?php
 
 	$hook_params = array () ;
@@ -55,7 +59,7 @@
 </form>
 <?php
 
-site_project_footer(array());
+scm_footer();
 
 // Local Variables:
 // mode: php

Modified: trunk/gforge_base/evolvisforge-5.1/gforge/www/scm/index.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/gforge/www/scm/index.php	2011-02-24 16:29:23 UTC (rev 9683)
+++ trunk/gforge_base/evolvisforge-5.1/gforge/www/scm/index.php	2011-02-24 16:29:24 UTC (rev 9684)
@@ -1,38 +1,39 @@
 <?php
 /**
-  *
-  * SourceForge CVS Frontend
-  *
-  * SourceForge: Breaking Down the Barriers to Open Source Development
-  * Copyright 1999-2001 (c) VA Linux Systems
-  * http://sourceforge.net
-  *
-  * @version   $Id$
-  *
-  */
+ * GForge SCM Frontend
+ *
+ * Copyright 2004 (c) Roland Mas, GForge LLC
+ *
+ * @version   $Id$
+ * @author Tim Perdue tim at gforge.org
+ * @date 2004-05-19
+ *
+ * This file is part of GForge.
+ *
+ * GForge is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * GForge is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GForge; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
 
-
 require_once('pre.php');    
-require_once('common/include/account.php');
+require_once('www/scm/scm_utils.php');    
 
-if (!$sys_use_cvs) {
-	exit_disabled();
-}
+scm_header(array('title'=>$Language->getText('scm_index','cvs_repository'),'group'=>$group_id));
 
-//only projects can use cvs, and only if they have it turned on
-$project =& group_get_object($group_id);
-
-if (!$project->isProject()) {
- 	exit_error('Error',$Language->getText('scm_index','error_only_projects_can_use_cvs'));
-}
-if (!$project->usesCVS()) {
-	exit_error('Error',$Language->getText('scm_index','error_this_project_has_turned_off'));
-}
-
-site_project_header(array('title'=>$Language->getText('scm_index','cvs_repository'),'group'=>$group_id,'toptab'=>'scm_index','pagename'=>'scm_index','sectionvals'=>array($project->getPublicName())));
-
 $hook_params = array () ;
 $hook_params['group_id'] = $group_id ;
 plugin_hook ("scm_page", $hook_params) ;
 
-site_project_footer(array()); ?>
+scm_footer(); 
+
+?>

Added: trunk/gforge_base/evolvisforge-5.1/gforge/www/scm/scm_utils.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/gforge/www/scm/scm_utils.php	                        (rev 0)
+++ trunk/gforge_base/evolvisforge-5.1/gforge/www/scm/scm_utils.php	2011-02-24 16:29:24 UTC (rev 9684)
@@ -0,0 +1,60 @@
+<?php
+/**
+ * GForge SCM Library
+ *
+ * Copyright 2004 (c) GForge LLC
+ *
+ * @version   $Id$
+ * @author Tim Perdue tim at gforge.org
+ * @date 2005-04-16
+ *
+ * This file is part of GForge.
+ *
+ * GForge is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * GForge is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GForge; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+function scm_header($params) {
+	global $DOCUMENT_ROOT, $HTML, $Language, $sys_use_cvs;
+	if (!$sys_use_cvs) {
+		exit_disabled();
+	}
+
+	$project =& group_get_object($params['group']);
+	if (!$project || !is_object($project)) {
+		exit_error('Error','Could Not Get Project');
+	} elseif ($project->isError()) {
+		exit_error('Error',$project->getErrorMessage());
+	}
+
+	if (!$project->usesCVS()) {
+		exit_error('Error',$Language->getText('scm_index','error_this_project_has_turned_off'));
+	}
+	site_project_header(array('title'=>$Language->getText('scm_index','cvs_repository'),'group'=>$params['group'],'toptab'=>'scm',));
+	/*
+		Show horizontal links
+	*/
+	echo '<span style="font-family:arial, helvetica">';
+	echo '<p><strong>';
+	echo '<a href="/scm/">' .$Language->getText('scm_index','title').'</a>
+		 | <a href="/scm/admin/?group_id='.$params['group'].'">' .
+		$Language->getText('project_admin','scm_admin').'</a></strong></p></span>';
+	echo '<p> </p>';
+}
+
+function scm_footer() {
+	site_project_footer(array());
+}
+
+?>



More information about the evolvis-commits mailing list