Update of /cvsroot/sandweb/sandweb/bin
In directory usw-pr-cvs1:/tmp/cvs-serv28024
Modified Files:
sandweb.cgi
Log Message:
* merged module_* menus and sandbox_* menus together, removed all
extra stuff.
Index: sandweb.cgi
===================================================================
RCS file: /cvsroot/sandweb/sandweb/bin/sandweb.cgi,v
retrieving revision 1.231
retrieving revision 1.232
diff -U2 -r1.231 -r1.232
--- sandweb.cgi 28 Feb 2002 05:10:49 -0000 1.231
+++ sandweb.cgi 28 Feb 2002 06:14:20 -0000 1.232
@@ -155,8 +155,20 @@
$location = "";
}
- sandbox_menu(
- ck_auth => $ck_auth,
- location => $location,
- );
+
+ if ($submit) {
+ # called checkout commit
+ sandbox_commit(
+ ck_auth => $ck_auth,
+ repo_name => $repo_name,
+ module_name => $module_name,
+ module_description => $module_description,
+ submit => $submit,
+ );
+ } else {
+ sandbox_menu(
+ ck_auth => $ck_auth,
+ location => $location,
+ );
+ }
}
elsif ( $action eq 'browse_module' ) {
@@ -192,20 +204,4 @@
);
}
- elsif ( $action eq 'module_checkout' ) {
- if ($submit) {
- # called checkout commit
- module_checkout_commit(
- ck_auth => $ck_auth,
- repo_name => $repo_name,
- module_name => $module_name,
- module_description => $module_description,
- );
- } else {
- # called checkout menu
- module_checkout_menu(
- ck_auth => $ck_auth,
- );
- }
- }
elsif ( $action eq 'view_file' ) {
# called file viewer
@@ -345,6 +341,5 @@
} else {
# called an invalid page
- my $page = $action;
- my $msg = "Invalid page - $page!";
+ my $msg = "Invalid page - $action!";
$log->error("$msg");
set_message("$msg");
@@ -449,4 +444,18 @@
load_config(1);
+ my @repos = $user->get_repo_list();
+ my @existing_repos = ();
+
+ my $i = 0;
+ foreach my $repo (@repos) {
+ my %entry;
+ $entry{'REPO_NAME'} = $repo;
+ if ($i == 0) {
+ $entry{'SELECTED'} = 1;
+ }
+ push @existing_repos, \%entry;
+ $i++;
+ }
+
my @repo_list = $user->get_repo_list();
my @module_list = ();
@@ -475,4 +484,5 @@
NO_MODULES => ($no_modules) ? "No exisiting modules.\n" : "",
MODULE_LOOP => \@module_loop,
+ REPO_LIST => \@existing_repos,
);
@@ -870,44 +880,4 @@
-sub module_checkout_menu {
- my %args = @_;
- my $ck_auth = $args{'ck_auth'};
- if (! load_config()) {
- # no existing user config, forward to prefs menu
- preferences_menu( ck_auth => $ck_auth );
- }
-
- my @repos = $user->get_repo_list();
- my @repo_list = ();
-
- my $i = 0;
- foreach my $repo (@repos) {
- my %entry;
- $entry{'REPO_NAME'} = $repo;
- if ($i == 0) {
- $entry{'SELECTED'} = 1;
- }
- push @repo_list, \%entry;
- $i++;
- }
-
- my $content = $ui->get_menu(
- MENU => 'module_checkout',
- PROGNAME => $progname,
- REPO_LIST => \@repo_list,
- );
-
- print CGI::header( -cookie => $ck_auth );
- $ui->print_screen(
- TITLE=> 'SandWeb : module checkout',
- MENU_TITLE => 'SandWeb',
- SUBMENU_TITLE => 'module checkout',
- FOOTER => '',
- CONTENT => $content,
- MESSAGE => $message,
- );
- exit 0;
-}
-
###############################################################################
# view file menu
@@ -1789,7 +1759,7 @@
###############################################################################
-# module checkout commit
+# sandbox commit
#
-# Uses the Repository object to do a checkout of specified module
+# Uses the Repository object to do actions to sandbox modules
#
# args:
@@ -1799,5 +1769,5 @@
###############################################################################
-sub module_checkout_commit {
+sub sandbox_commit {
my %args = @_;
my $ck_auth = $args{'ck_auth'};
@@ -1806,4 +1776,5 @@
my $repo_name = $args{'repo_name'};
my $module_description = $args{'module_description'};
+ my $submit = $args{'submit'};
my $repo_server = $user->get_repo_server(repo => $repo_name);
|