--- loncom/interface/londocs.pm 2004/04/07 21:40:21 1.115 +++ loncom/interface/londocs.pm 2004/04/24 23:03:49 1.119 @@ -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.119 2004/04/24 23:03:49 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -261,45 +261,25 @@ sub group_import { 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)}); + 'text'=>''. + &Apache::lonnet::unescape($foldername).'' + }); - } } - return &Apache::lonhtmlcommon::breadcrumbs(); + return &Apache::lonhtmlcommon::breadcrumbs(undef,undef,undef,undef,undef,0); } sub editor { @@ -468,7 +448,8 @@ sub entryline { my $line=''; # Edit commands if ($allowed) { - my %lt=('up' => 'Move Up', + my %lt=&Apache::lonlocal::texthash( + 'up' => 'Move Up', 'dw' => 'Move Down', 'rm' => 'Remove', 'rn' => 'Rename'); @@ -505,9 +486,7 @@ END $url='/adm/coursedocs?'; $folderarg=$1; $isfolder=1; - } else { - $url=&Apache::lonnet::tokenwrapper($url); - } + } } $url=~s/^http\&colon\;\/\//\/adm\/wrapper\/ext\//; if ((!$isfolder) && ($residx) && ($folder!~/supplemental/)) { @@ -522,16 +501,26 @@ END $url=&Apache::lonnet::clutter($url); $url.=(($url=~/\?/)?'&':'?').'symb='.&Apache::lonnet::escape($symb); } + my $parameterset=''; 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); + $parameterset=''; } $line.=''. - "$title"; + "$title"; + if ($allowed) { + my %lt=&Apache::lonlocal::texthash( + 'hd' => 'Hidden', + 'ec' => 'URL hidden', + 'rp' => 'Randomly Pick Number of Resources', + 'sp' => 'Store Parameters'); + } + $line.=""; return $line; } @@ -896,7 +885,9 @@ sub changewarning { $r->print( ''. '
'. -'

'. +'

'. &mt('Changes will become active for your current session after'). ' @@ -1155,7 +1154,7 @@ ENDNEWSCRIPT
- +
@@ -1171,20 +1170,21 @@ ENDCOURSEVERIFY &mt('Editing the Table of Contents for your Course'))); } # --------------------------------------------------------- Standard documents - #my $htmlfoldername=&HTML::Entities::encode($ENV{'form.foldername'},'<>&"'); $r->print('
'); if (($standard) && ($allowed) && (!$forcesupplement)) { - $r->print('

'.&mt('Main Course Documents'). - ($allowed?' '.$help{'Main_Course_Documents'}:'').'

'); + $r->print('
'); +# '

'.&mt('Main Course Documents'). +# ($allowed?' '.$help{'Main_Course_Documents'}:'').'

'); my $folder=$ENV{'form.folder'}; - if ($folder eq '') { + if ($folder eq '' || $folder eq 'supplemental') { $folder='default'; + $ENV{'form.folderpath'}='default&'.&Apache::lonnet::escape(&mt('Main Course Documents')); } my $postexec=''; if ($folder eq 'default') { $r->print(''); } else { - $postexec='self.close();'; + #$postexec='self.close();'; } $hadchanges=0; &editor($r,$coursenum,$coursedom,$folder,$allowed); @@ -1319,7 +1319,7 @@ onClick="javascript:makeabout();" />
- +
@@ -1330,11 +1330,18 @@ ENDFORM } # ----------------------------------------------------- Supplemental documents if (!$forcestandard) { - $r->print( - '

'.&mt('Supplemental Course Documents'). - ($allowed?' '.$help{'Supplemental'}:'').'

'); + $r->print('
'); +# '

'.&mt('Supplemental Course Documents'). +# ($allowed?' '.$help{'Supplemental'}:'').'

'); my $folder=$ENV{'form.folder'}; - unless ($folder=~/supplemental/) { $folder='supplemental'; } + unless ($folder=~/^supplemental/) { + $folder='supplemental'; + } + if ($folder =~ /^supplemental$/ && + $ENV{'form.folderpath'} =~ /^default\&/) { + $ENV{'form.folderpath'}='supplemental&'. + &Apache::lonnet::escape(&mt('Supplemental Course Documents')); + } &editor($r,$coursenum,$coursedom,$folder,$allowed); if ($allowed) { my $folderseq=