--- loncom/interface/londocs.pm 2004/04/07 20:36:54 1.114 +++ loncom/interface/londocs.pm 2004/04/07 22:32:18 1.116 @@ -1,7 +1,7 @@ # The LearningOnline Network # Documents # -# $Id: londocs.pm,v 1.114 2004/04/07 20:36:54 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 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)}); - } } - return &Apache::lonhtmlcommon::breadcrumbs(); + return &Apache::lonhtmlcommon::breadcrumbs(undef,undef,undef,undef,undef,0); } sub editor { @@ -472,24 +450,23 @@ sub entryline { 'dw' => 'Move Down', 'rm' => 'Remove', 'rn' => 'Rename'); - my ($foldername,$htmlfoldername); - if ($ENV{'form.foldername'}) { - $foldername='&foldername='. - &Apache::lonnet::escape($ENV{'form.foldername'}); - $htmlfoldername=&HTML::Entities::encode($ENV{'form.foldername'},'<>&"'); + my $folderpath; + if ($ENV{'form.folderpath'}) { + $folderpath=&Apache::lonnet::escape($ENV{'form.folderpath'}); + # $htmlfoldername=&HTML::Entities::encode($ENV{'form.foldername'},'<>&"'); } $line.=(<
- + $lt{
- + $lt{
- + $lt{'rm'} - + $lt{'rn'} END } @@ -696,7 +673,6 @@ sub checkversions { foreach (keys %ENV) { if ($_=~/^form\.set_version_(.+)$/) { my $src=$1; - &Apache::lonnet::logthis('Found: '.$1.' '.$ENV{$_}); if (($ENV{$_}) && ($ENV{$_} ne $setversions{$src})) { $newsetversions{$src}=$ENV{$_}; } @@ -956,8 +932,7 @@ sub handler { 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; } @@ -1088,22 +1063,20 @@ function finishpick() { '";this.document.forms.'+form+'.submit();'); } -function changename(folder,index,oldtitle,foldername) { +function changename(folderpath,index,oldtitle) { var title=prompt('New Title',oldtitle); if (title) { this.document.forms.renameform.title.value=title; this.document.forms.renameform.cmd.value='rename_'+index; - this.document.forms.renameform.folder.value=folder; - this.document.forms.renameform.foldername.value=foldername; + this.document.forms.renameform.folderpath.value=folderpath; this.document.forms.renameform.submit(); } } -function removeres(folder,index,oldtitle,foldername) { +function removeres(folderpath,index,oldtitle) { if (confirm('Remove "'+oldtitle+'"?')) { this.document.forms.renameform.cmd.value='del_'+index; - this.document.forms.renameform.folder.value=folder; - this.document.forms.renameform.foldername.value=foldername; + this.document.forms.renameform.folderpath.value=folderpath; this.document.forms.renameform.submit(); } } @@ -1155,13 +1128,11 @@ ENDNEWSCRIPT
- - +
- - +
@@ -1177,14 +1148,16 @@ ENDCOURSEVERIFY &mt('Editing the Table of Contents for your Course'))); } # --------------------------------------------------------- Standard documents - my $htmlfoldername=&HTML::Entities::encode($ENV{'form.foldername'},'<>&"'); + #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 '') { $folder='default'; + $ENV{'form.folderpath'}='default&'.&Apache::lonnet::escape(&mt('Main Course Documents')); } my $postexec=''; if ($folder eq 'default') { @@ -1212,8 +1185,7 @@ $lt{'file'}:

$lt{'title'}:
- - + @@ -1223,13 +1195,10 @@ $lt{'title'}:
- - - + + - + $help{'Importing_LON-CAPA_Resource'}

@@ -1243,8 +1212,7 @@ $help{'Load_Map'}

- - + $help{'Adding_Fold
- - + $help{'Adding_Ext
- - + @@ -1272,8 +1238,7 @@ value="Syllabus=/public/$coursedom/$cour
- - + @@ -1282,8 +1247,7 @@ $help{'Navigate_Content'}
- - + $
- - +
- - +
- - +
- - + @@ -1330,8 +1290,7 @@ $help{'My Personal Info'}
- - +
- +
@@ -1350,11 +1309,14 @@ 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'; + $ENV{'form.folderpath'}='supplemental&'.&Apache::lonnet::escape(&mt('Supplemental Course Documents'));; + } &editor($r,$coursenum,$coursedom,$folder,$allowed); if ($allowed) { my $folderseq= @@ -1372,8 +1334,8 @@ ENDFORM
$lt{'comment'}:
- - +
+ @@ -1383,8 +1345,7 @@ ENDFORM
- - + $help{'Adding_Fol
- - + $help{'Adding_Ext
- - + @@ -1413,8 +1372,7 @@ $help{'Syllabus'}
- - +