gforge-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gforge-commits] gforge/www/scm scm_utils.php, NONE, 1.1 index.php, 1.20


From: tperdue
Subject: [Gforge-commits] gforge/www/scm scm_utils.php, NONE, 1.1 index.php, 1.20, 1.21
Date: Wed, 19 May 2004 13:16:06 -0500

Update of /cvsroot/gforge/gforge/www/scm
In directory db.perdue.net:/home/tperdue/share/dev.gforge.org/www/scm

Modified Files:
        index.php 
Added Files:
        scm_utils.php 
Log Message:
modifications to scm pluginification effort - scm_utils.php was created

--- NEW FILE: scm_utils.php ---
<?php
/**
 * GForge SCM Library
 *
 * Copyright 2004 (c) GForge LLC
 *
 * @version   $Id: scm_utils.php,v 1.1 2004/05/19 18:16:03 tperdue Exp $
 * @author Tim Perdue address@hidden
 * @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>&nbsp;</p>';
}

function scm_footer() {
        site_project_footer(array());
}

?>

Index: index.php
===================================================================
RCS file: /cvsroot/gforge/gforge/www/scm/index.php,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- a/index.php 16 May 2004 16:54:54 -0000      1.20
+++ b/index.php 19 May 2004 18:16:03 -0000      1.21
@@ -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 address@hidden
+ * @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');
-
-if (!$sys_use_cvs) {
-       exit_disabled();
-}
-
-//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'));
-}
+require_once('www/scm/scm_utils.php');    
 
-site_project_header(array('title'=>$Language->getText('scm_index','cvs_repository'),'group'=>$group_id,'toptab'=>'scm_index','pagename'=>'scm_index','sectionvals'=>array($project->getPublicName())));
+scm_header(array('title'=>$Language->getText('scm_index','cvs_repository'),'group'=>$group_id));
 
 $hook_params = array () ;
 $hook_params['group_id'] = $group_id ;
 plugin_hook ("scm_page", $hook_params) ;
 
-site_project_footer(array()); ?>
+scm_footer(); 
+
+?>





reply via email to

[Prev in Thread] Current Thread [Next in Thread]