--- loncom/interface/londocs.pm 2005/11/14 13:56:58 1.211 +++ loncom/interface/londocs.pm 2006/03/06 17:15:29 1.223 @@ -1,7 +1,7 @@ # The LearningOnline Network # Documents # -# $Id: londocs.pm,v 1.211 2005/11/14 13:56:58 www Exp $ +# $Id: londocs.pm,v 1.223 2006/03/06 17:15:29 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1190,22 +1190,25 @@ sub editor { } } # Loading a complete map - if (($env{'form.importmap'}) && ($env{'form.loadmap'})) { - foreach (&Apache::lonsequence::attemptread(&Apache::lonnet::filelocation('',$env{'form.importmap'}))) { - my ($title,$url,$ext,$type)=split(/\:/,$_); - my $idx=&Apache::lonratedt::getresidx($url); - $Apache::lonratedt::resources[$idx]=$_; - $Apache::lonratedt::order - [$#Apache::lonratedt::order+1]=$idx; - } - + if ($env{'form.loadmap'}) { + if ($env{'form.importmap'}=~/\w/) { + foreach (&Apache::lonsequence::attemptread(&Apache::lonnet::filelocation('',$env{'form.importmap'}))) { + my ($title,$url,$ext,$type)=split(/\:/,$_); + my $idx=&Apache::lonratedt::getresidx($url); + $Apache::lonratedt::resources[$idx]=$_; + $Apache::lonratedt::order + [$#Apache::lonratedt::order+1]=$idx; + } # Store the changed version - ($errtext,$fatal)=&storemap($coursenum,$coursedom, + ($errtext,$fatal)=&storemap($coursenum,$coursedom, $folder.'.'.$container); - if ($fatal) { - $r->print('

'.$errtext.'

'); - return; - } + if ($fatal) { + $r->print('

'.$errtext.'

'); + return; + } + } else { + $r->print('

'.&mt('No map selected.').'

'); + } } } # ---------------------------------------------------------------- End commands @@ -1373,7 +1376,7 @@ sub process_secondary_uploads { if (($folder eq 'default') || ($folder eq 'supplemental')) { $destination .= 'default/'; } elsif ($folder =~ /^(default|supplemental)_(\d+)$/) { - $destination .= $1.'/'; + $destination .= $2.'/'; } $destination .= $newidx; my ($url,$filename); @@ -1400,6 +1403,7 @@ sub entryline { &Apache::loncommon::plainname($2,$3).':
'. $foldertitle; } + $renametitle=~s/\\/\\\\/g; $renametitle=~s/\"\;/\\\"/g; my $line=''; # Edit commands @@ -1555,7 +1559,7 @@ END &Apache::lonnet::allowuploaded('/adm/coursedoc',$url); } } - $url=~s/^http\&colon\;\/\//\/adm\/wrapper\/ext\//; + $url=~s-^http(\&colon\;|:)//-/adm/wrapper/ext/-; if ((!$isfolder) && ($residx) && ($folder!~/supplemental/) && (!$ispage)) { my $symb=&Apache::lonnet::symbclean( &Apache::lonnet::declutter('uploaded/'. @@ -1588,7 +1592,7 @@ END } } my $parameterset=' '; - if ($isfolder) { + if ($isfolder || $extension eq 'sequence') { my $foldername=&Apache::lonnet::escape($foldertitle); my $folderpath=$env{'form.folderpath'}; if ($folderpath) { $folderpath.='&' }; @@ -1622,7 +1626,7 @@ END } $line.=''. - "$title"; + "$title"; if (($allowed) && ($folder!~/^supplemental/)) { my %lt=&Apache::lonlocal::texthash( 'hd' => 'Hidden', @@ -1666,6 +1670,7 @@ sub tiehash { sub untiehash { if ($hashtied) { untie %hash; } $hashtied=0; + return OK; } # --------------------------------------------------------------- check on this @@ -2263,6 +2268,15 @@ function makesmpproblem() { } } +function makedropbox() { + var title=prompt('Listed Title for the Drop Box'); + if (title) { + this.document.forms.newdropbox.importdetail.value= + title+'=/res/lib/templates/DropBox.problem'; + this.document.forms.newdropbox.submit(); + } +} + function makebulboard() { var title=prompt('Listed Title for the Bulletin Board'); if (title) { @@ -2478,6 +2492,7 @@ ENDNEWSCRIPT 'navc' => 'Navigate Contents', 'sipa' => 'Simple Page', 'sipr' => 'Simple Problem', + 'drbx' => 'Drop Box', 'scuf' => 'Score Upload Form', 'bull' => 'Bulletin Board', 'mypi' => 'My Personal Info', @@ -2530,9 +2545,9 @@ $uploadtag $help{'Check_Resource_Versions'} $dumpbut $exportbut - + ENDCOURSEVERIFY $r->print(&Apache::loncommon::help_open_topic('Docs_Adding_Course_Doc', @@ -2634,7 +2649,7 @@ $uploadtag value="$lt{'extr'}" /> $help{'Adding_External_Resource'} -
+
@@ -2644,7 +2659,7 @@ ENDFORM $r->print(''); unless ($env{'form.pagepath'}) { $r->print(< +
@@ -2653,7 +2668,7 @@ onClick="javascript:makenewfolder(this.f value="$lt{'newf'}" />$help{'Adding_Folders'} -
+
@@ -2662,7 +2677,7 @@ onClick="javascript:makenewpage(this.for value="$lt{'newp'}" />$help{'Adding_Pages'}
-
+
$uploadtag @@ -2671,7 +2686,7 @@ value="Syllabus=/public/$coursedom/$cour $help{'Syllabus'}
-
+
$uploadtag @@ -2680,7 +2695,7 @@ value="Navigate Content=/adm/navmaps"> $help{'Navigate_Content'}
-
+
$uploadtag @@ -2688,7 +2703,7 @@ $uploadtag onClick="javascript:makesmppage();" /> $help{'Simple Page'}
-
+
$uploadtag @@ -2696,7 +2711,15 @@ $uploadtag onClick="javascript:makesmpproblem();" />$help{'Simple Problem'}
-
+
+$uploadtag + + + + +
+
$uploadtag @@ -2705,7 +2728,7 @@ onClick="javascript:makeexamupload();" / $help{'Score_Upload_Form'}
-
+
$uploadtag @@ -2714,7 +2737,7 @@ onClick="javascript:makebulboard();" /> $help{'Bulletin Board'}
-
+
$uploadtag @@ -2723,7 +2746,7 @@ value="$plainname=/adm/$udom/$uname/abou $help{'My Personal Info'}
-
+
$uploadtag @@ -2743,7 +2766,7 @@ $uploadtag onClick="javascript:makesmpproblem();" />$help{'Simple Problem'}
-
+
$uploadtag @@ -2816,7 +2839,7 @@ onClick="javascript:makenewfolder(this.f value="$lt{'newf'}" /> $help{'Adding_Folders'}
-
+
@@ -2825,7 +2848,7 @@ onClick="javascript:makenewext('supnewex value="$lt{'extr'}" /> $help{'Adding_External_Resource'}
-
+
@@ -2834,7 +2857,7 @@ value="Syllabus=/public/$coursedom/$cour $help{'Syllabus'}
-
+