--- loncom/interface/londocs.pm 2004/04/06 23:05:29 1.113
+++ loncom/interface/londocs.pm 2004/04/07 20:36:54 1.114
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Documents
#
-# $Id: londocs.pm,v 1.113 2004/04/06 23:05:29 albertel Exp $
+# $Id: londocs.pm,v 1.114 2004/04/07 20:36:54 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -258,11 +258,54 @@ sub group_import {
return &storemap($coursenum, $coursedom, $folder.'.sequence');
}
-sub editor {
- my ($r,$coursenum,$coursedom,$folder,$allowed)=@_;
+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'}) {
- $r->print('
Folder: '.$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);
+ &Apache::lonhtmlcommon::add_breadcrumb(
+ {'href'=>$url,
+ 'title'=>&Apache::lonnet::unescape($foldername),
+ 'text'=>&Apache::lonnet::unescape($foldername)});
+
+
+ }
}
+ return &Apache::lonhtmlcommon::breadcrumbs();
+}
+
+sub editor {
+ my ($r,$coursenum,$coursedom,$folder,$allowed)=@_;
+
+ $r->print(&breadcrumbs($folder));
my $errtext='';
my $fatal=0;
($errtext,$fatal)=
@@ -455,11 +498,13 @@ END
my $uploaded=($url=~/^\/*uploaded\//);
my $icon=&Apache::loncommon::icon($url);
my $isfolder=0;
+ my $folderarg;
if ($uploaded) {
if ($extension eq 'sequence') {
$icon=$iconpath.'/folder_closed.gif';
$url=~/$coursenum\/([\/\w]+)\.sequence$/;
- $url='/adm/coursedocs?folder='.$1;
+ $url='/adm/coursedocs?';
+ $folderarg=$1;
$isfolder=1;
} else {
$url=&Apache::lonnet::tokenwrapper($url);
@@ -478,8 +523,13 @@ END
$url=&Apache::lonnet::clutter($url);
$url.=(($url=~/\?/)?'&':'?').'symb='.&Apache::lonnet::escape($symb);
}
- if ($isfolder) { $url.='&foldername='.
- &Apache::lonnet::escape($foldertitle); }
+ if ($isfolder) {
+ my $foldername=&Apache::lonnet::escape($foldertitle);
+ my $folderpath=$ENV{'form.folderpath'};
+ if ($folderpath) { $folderpath.='&' };
+ $folderpath.=$folderarg.'&'.$foldername;
+ $url.='folderpath='.&Apache::lonnet::escape($folderpath);
+ }
$line.=' | '.
"$title | ";
@@ -901,7 +951,13 @@ sub handler {
my $events='';
my $showdoc=0;
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
- ['folder','foldername']);
+ ['folderpath']);
+ if ($ENV{'form.folderpath'}) {
+ 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;
}