[LON-CAPA-cvs] cvs: loncom /interface londocs.pm

albertel lon-capa-cvs@mail.lon-capa.org
Wed, 07 Apr 2004 22:32:20 -0000


albertel		Wed Apr  7 18:32:20 2004 EDT

  Modified files:              
    /loncom/interface	londocs.pm 
  Log:
  - supplemental is still dysfunctional, but Main Course Docs looks and acts correctly
  
  
Index: loncom/interface/londocs.pm
diff -u loncom/interface/londocs.pm:1.115 loncom/interface/londocs.pm:1.116
--- loncom/interface/londocs.pm:1.115	Wed Apr  7 17:40:21 2004
+++ loncom/interface/londocs.pm	Wed Apr  7 18:32:18 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Documents
 #
-# $Id: londocs.pm,v 1.115 2004/04/07 21:40:21 albertel Exp $
+# $Id: londocs.pm,v 1.116 2004/04/07 22:32:18 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -261,45 +261,23 @@
 sub breadcrumbs {
     my ($where)=@_;
     &Apache::lonhtmlcommon::clear_breadcrumbs();
-    if ($where =~ /^default/) {
-	&Apache::lonhtmlcommon::add_breadcrumb({'href'=>'/adm/coursedocs',
-				    'title'=>'Main Course Documents',
-				    'text' =>'Main Course Documents'});
-    } elsif ($where =~ /^supplemental/) {
-	&Apache::lonhtmlcommon::add_breadcrumb({'href'=>'/adm/coursedocs',
-				    'title'=>'Supplemental Course Documents',
-				    'text' =>'Supplemental Course Documents'});
-
-    } else {
-	&Apache::lonhtmlcommon::add_breadcrumb({'href'=>'/adm/coursedocs',
-						'title'=>$where,
-						'text' =>$where});
-    }
-    if ($ENV{'form.foldername'}) {
-	my @folders;
-	if (defined($ENV{'form.folders'})) {
-	    @folders=@{$ENV{'form.folders'}};
-	}
-	@folders=(@folders,$ENV{'form.folder'},
-		  &Apache::lonnet::escape($ENV{'form.foldername'}));
-
-	my $folderpath;
-	while (@folders) {
-	    my $folder=shift(@folders);
-	    my $foldername=shift(@folders);
-	    if ($folderpath) {$folderpath.='&';}
-	    $folderpath.=$folder.'&'.$foldername;
-	    my $url='/adm/coursedocs?folderpath='.
-		&Apache::lonnet::escape($folderpath);
+    my (@folders)=split('&',$ENV{'form.folderpath'});
+    my $folderpath;
+    while (@folders) {
+	my $folder=shift(@folders);
+	my $foldername=shift(@folders);
+	if ($folderpath) {$folderpath.='&';}
+	$folderpath.=$folder.'&'.$foldername;
+	my $url='/adm/coursedocs?folderpath='.
+	    &Apache::lonnet::escape($folderpath);
 	    &Apache::lonhtmlcommon::add_breadcrumb(
 		      {'href'=>$url,
 		       'title'=>&Apache::lonnet::unescape($foldername),
 		       'text'=>&Apache::lonnet::unescape($foldername)});
 		       
 						 
-	}
     }
-    return &Apache::lonhtmlcommon::breadcrumbs();
+    return &Apache::lonhtmlcommon::breadcrumbs(undef,undef,undef,undef,undef,0);
 }
 
 sub editor {
@@ -954,8 +932,7 @@
 	my (@folderpath)=split('&',$ENV{'form.folderpath'});
 	$ENV{'form.foldername'}=&Apache::lonnet::unescape(pop(@folderpath));
 	$ENV{'form.folder'}=pop(@folderpath);
-	$ENV{'form.folders'}=\@folderpath;
-    }
+    } 
     if ($r->uri=~/^\/adm\/coursedocs\/showdoc\/(.*)$/) {
        $showdoc=$1;
     }
@@ -1174,11 +1151,13 @@
     #my $htmlfoldername=&HTML::Entities::encode($ENV{'form.foldername'},'<>&"');
     $r->print('<table border=2 cellspacing=4 cellpadding=4>');
     if (($standard) && ($allowed) && (!$forcesupplement)) {
-       $r->print('<tr><td bgcolor="#BBBBBB"><h2>'.&mt('Main Course Documents').
-  ($allowed?' '.$help{'Main_Course_Documents'}:'').'</h2>');
+	$r->print('<tr><td bgcolor="#BBBBBB">');
+#  '<h2>'.&mt('Main Course Documents').
+#  ($allowed?' '.$help{'Main_Course_Documents'}:'').'</h2>');
        my $folder=$ENV{'form.folder'};
        if ($folder eq '') {
            $folder='default';
+	   $ENV{'form.folderpath'}='default&'.&Apache::lonnet::escape(&mt('Main Course Documents'));
        }
        my $postexec='';
        if ($folder eq 'default') {
@@ -1330,11 +1309,14 @@
     }
 # ----------------------------------------------------- Supplemental documents
     if (!$forcestandard) {
-       $r->print(
-  '<tr><td bgcolor="#BBBBBB"><h2>'.&mt('Supplemental Course Documents').
-  ($allowed?' '.$help{'Supplemental'}:'').'</h2>');
+       $r->print('<tr><td bgcolor="#BBBBBB">');
+# '<h2>'.&mt('Supplemental Course Documents').
+#  ($allowed?' '.$help{'Supplemental'}:'').'</h2>');
        my $folder=$ENV{'form.folder'};
-       unless ($folder=~/supplemental/) { $folder='supplemental'; }
+       unless ($folder=~/supplemental/) {
+	   $folder='supplemental';
+	   $ENV{'form.folderpath'}='supplemental&'.&Apache::lonnet::escape(&mt('Supplemental Course Documents'));;
+       }
        &editor($r,$coursenum,$coursedom,$folder,$allowed);
        if ($allowed) {
        my $folderseq=