--- loncom/interface/londocs.pm 2004/12/10 20:46:38 1.152 +++ loncom/interface/londocs.pm 2004/12/14 21:10:58 1.156 @@ -1,7 +1,7 @@ # The LearningOnline Network # Documents # -# $Id: londocs.pm,v 1.152 2004/12/10 20:46:38 albertel Exp $ +# $Id: londocs.pm,v 1.156 2004/12/14 21:10:58 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1034,10 +1034,11 @@ sub entryline { $folderpath=&Apache::lonnet::escape($ENV{'form.folderpath'}); # $htmlfoldername=&HTML::Entities::encode($ENV{'form.foldername'},'<>&"'); } - my $pagepath; + my ($pagepath,$pagesymb); if ($ENV{'form.pagepath'}) { $container = 'page'; $pagepath=&Apache::lonnet::escape($ENV{'form.pagepath'}); + $pagesymb=&Apache::lonnet::escape($ENV{'form.pagesymb'}); } if ($allowed) { my $incindex=$index+1; @@ -1064,20 +1065,21 @@ sub entryline { $line.=(< +
- + $lt{
- + $lt{
$selectbox - + $lt{'rm'} - + $lt{'rn'} END } else { @@ -1175,7 +1177,6 @@ END } if ($ispage) { - &Apache::lonnet::logthis(" in ispage "); my $pagename=&Apache::lonnet::escape($pagetitle); my $pagepath; my $folderpath=$ENV{'form.folderpath'}; @@ -1190,11 +1191,9 @@ END $residx, $path.$pagearg.'.page'); } - #(undef,undef,$url)=&Apache::lonnet::decode_symb($symb); $url.='pagepath='.&Apache::lonnet::escape($pagepath). '&pagesymb='.&Apache::lonnet::escape($symb); } - &Apache::lonnet::logthis(" link \n$url"); $line.=''. "$title"; @@ -1629,6 +1628,7 @@ sub changewarning { if (defined($ENV{'form.pagepath'})) { $pathvar='pagepath'; $path=&Apache::lonnet::escape($ENV{'form.pagepath'}); + $path.='&symb='.&Apache::lonnet::escape($ENV{'form.pagesymb'}); } $r->print( ''. @@ -1684,7 +1684,7 @@ sub handler { # is this a standard course? my $standard=($ENV{'request.course.uri'}=~/^\/uploaded\//); - my $forcestandard; + my $forcestandard = 0; my $forcesupplement; my $script=''; my $allowed; @@ -1703,14 +1703,19 @@ sub handler { my (@pagepath)=split('&',$ENV{'form.pagepath'}); $ENV{'form.pagename'}=&Apache::lonnet::unescape(pop(@pagepath)); $ENV{'form.folder'}=pop(@pagepath); - $containertag = ''; - $uploadtag = ''; + $containertag = ''. + ''; + $uploadtag = ''. + ''; } if ($r->uri=~/^\/adm\/coursedocs\/showdoc\/(.*)$/) { $showdoc='/'.$1; } unless ($showdoc) { # got called from remote - $forcestandard=($ENV{'form.folder'}=~/^default_/); + if (($ENV{'form.folder'}=~/^default_/) || + ($ENV{'form.folder'} =~ m#^\d+/(pages|sequences)/#)) { + $forcestandard = 1; + } $forcesupplement=($ENV{'form.folder'}=~/^supplemental_/); # does this user have privileges to post, etc? @@ -1844,7 +1849,7 @@ function finishpick() { '";this.document.forms.'+form+'.submit();'); } -function changename(folderpath,index,oldtitle,container) { +function changename(folderpath,index,oldtitle,container,pagesymb) { var title=prompt('New Title',oldtitle); if (title) { this.document.forms.renameform.title.value=title; @@ -1854,12 +1859,13 @@ function changename(folderpath,index,old } if (container == 'page') { this.document.forms.renameform.pagepath.value=folderpath; + this.document.forms.renameform.pagesymb.value=pagesymb; } this.document.forms.renameform.submit(); } } -function removeres(folderpath,index,oldtitle,container) { +function removeres(folderpath,index,oldtitle,container,pagesymb) { if (confirm('Remove "'+oldtitle+'"?')) { this.document.forms.renameform.cmd.value='del_'+index; if (container == 'sequence') { @@ -1867,6 +1873,7 @@ function removeres(folderpath,index,oldt } if (container == 'page') { this.document.forms.renameform.pagepath.value=folderpath; + this.document.forms.renameform.pagesymb.value=pagesymb; } this.document.forms.renameform.submit(); }