--- loncom/interface/londocs.pm 2004/09/18 17:03:25 1.144 +++ loncom/interface/londocs.pm 2004/11/11 22:47:55 1.149 @@ -1,7 +1,7 @@ # The LearningOnline Network # Documents # -# $Id: londocs.pm,v 1.144 2004/09/18 17:03:25 albertel Exp $ +# $Id: londocs.pm,v 1.149 2004/11/11 22:47:55 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -989,15 +989,17 @@ sub editor { # ---------------------------------------------------------------- End commands # ---------------------------------------------------------------- Print screen my $idx=0; + my $shown=0; $r->print(''); foreach (@Apache::lonratedt::order) { my ($name,$url)=split(/\:/,$Apache::lonratedt::resources[$_]); unless ($name) { $name=(split(/\//,$url))[-1]; } - unless ($name) { next; } + unless ($name) { $idx++; next; } $r->print(&entryline($idx,$name,$url,$folder,$allowed,$_,$coursenum)); $idx++; + $shown++; } - unless ($idx) { + unless ($shown) { $r->print(''); } $r->print('
'.&mt('Currently no documents.').'
'); @@ -1147,6 +1149,8 @@ END } elsif ($url!~/\.(sequence|page)$/) { $url='/adm/coursedocs/showdoc'.$url; } + } elsif ($url=~m|^/ext/|) { + $url='/adm/wrapper'.$url; } unless ($container eq 'page') { $url.=(($url=~/\?/)?'&':'?').'symb='.&Apache::lonnet::escape($symb); @@ -1159,9 +1163,12 @@ END if ($folderpath) { $folderpath.='&' }; $folderpath.=$folderarg.'&'.$foldername; $url.='folderpath='.&Apache::lonnet::escape($folderpath); - $parameterset=&mt('Randomly Pick: '). + $parameterset=''; + } if ($ispage) { my $pagename=&Apache::lonnet::escape($pagetitle); @@ -1185,9 +1192,9 @@ END ((&Apache::lonratedt::getparameter($orderidx,'parameter_hiddenresource'))[0]=~/^yes$/i?' checked="1"':''); $line.=(< - $lt{'hd'} - + + + $parameterset @@ -1203,24 +1210,33 @@ ENDPARMS sub tiehash { my ($mode)=@_; $hashtied=0; + &Apache::lonnet::logthis(" tiehash1 -- $hashtied "); if ($ENV{'request.course.fn'}) { + &Apache::lonnet::logthis(" tiehash2 -- $hashtied "); if ($mode eq 'write') { + &Apache::lonnet::logthis(" tiehash3 -- $hashtied "); if (tie(%hash,'GDBM_File',$ENV{'request.course.fn'}.".db", &GDBM_WRCREAT(),0640)) { $hashtied=2; + &Apache::lonnet::logthis(" tiehash4 -- $hashtied "); } } else { + &Apache::lonnet::logthis(" tiehash5 -- $hashtied "); if (tie(%hash,'GDBM_File',$ENV{'request.course.fn'}.".db", &GDBM_READER(),0640)) { $hashtied=1; + &Apache::lonnet::logthis(" tiehash6 -- $hashtied "); } } } + &Apache::lonnet::logthis(" tiehash7 -- $hashtied "); } sub untiehash { + &Apache::lonnet::logthis(" untiehash1 -- $hashtied "); if ($hashtied) { untie %hash; } $hashtied=0; + &Apache::lonnet::logthis(" untiehash2 -- $hashtied "); } # --------------------------------------------------------------- check on this @@ -1576,14 +1592,21 @@ ENDHEADERS sub mark_hash_old { my $retie_hash=0; + &Apache::lonnet::logthis(" markold1 -- $hashtied $retie_hash "); if ($hashtied) { $retie_hash=1; + &Apache::lonnet::logthis(" markold2 -- $hashtied $retie_hash "); &untiehash(); + &Apache::lonnet::logthis(" markold3 -- $hashtied $retie_hash "); } &tiehash('write'); + &Apache::lonnet::logthis(" markold4 -- $hashtied $retie_hash "); $hash{'old'}=1; + &Apache::lonnet::logthis(" markold5 -- $hashtied $retie_hash "); &untiehash(); + &Apache::lonnet::logthis(" markold6 -- $hashtied $retie_hash "); if ($retie_hash) { &tiehash(); } + &Apache::lonnet::logthis(" markold7 -- $hashtied $retie_hash "); } sub is_hash_old {