--- loncom/interface/londocs.pm 2003/09/08 21:19:44 1.76 +++ loncom/interface/londocs.pm 2003/09/15 15:24:18 1.78 @@ -1,7 +1,7 @@ # The LearningOnline Network # Documents # -# $Id: londocs.pm,v 1.76 2003/09/08 21:19:44 www Exp $ +# $Id: londocs.pm,v 1.78 2003/09/15 15:24:18 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -162,15 +162,25 @@ sub dumpcourse { $title=~s/\W//gs; $r->print('

Folder in Construction Space


'); &tiehash(); + $r->print('

Filenames in Construction Space

'); foreach (&Apache::loncreatecourse::crsdirlist($origcrsid,'userfiles')) { - $r->print("\n
".$_.' '. - $hash{'title_'.$hash{ -'ids_/uploaded/'.$origcrsdata{'domain'}.'/'.$origcrsdata{'num'}.'/'.$_}} - ); + $r->print(''); + my ($ext)=($_=~/\.(\w+)$/); + my $title=$hash{'title_'.$hash{ + 'ids_/uploaded/'.$origcrsdata{'domain'}.'/'.$origcrsdata{'num'}.'/'.$_}}; + $r->print(''); + unless ($title) { + $title=$_; + } + $title=~s/\.(\w+)$//; + $title=~s/\W+/\_/gs; + $title.='.'.$ext; + $r->print("\n\n"); } + $r->print("
Internal FilenameTitleSave as ...
'.$_.''.($title?$title:' ').'
\n"); &untiehash(); $r->print( - ''); + '

'); } } @@ -658,7 +668,7 @@ sub handler { $forcesupplement=($ENV{'form.folder'}=~/^supplemental_/); # does this user have privileges to post, etc? - $allowed=&Apache::lonnet::allowed('srm',$ENV{'request.course.id'}); + $allowed=&Apache::lonnet::allowed('mdc',$ENV{'request.course.id'}); if ($allowed) { &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['cmd']); $script=&Apache::lonratedt::editscript('simple');