--- loncom/interface/londocs.pm 2005/11/04 21:39:26 1.210 +++ loncom/interface/londocs.pm 2006/01/16 23:42:39 1.218 @@ -1,7 +1,7 @@ # The LearningOnline Network # Documents # -# $Id: londocs.pm,v 1.210 2005/11/04 21:39:26 albertel Exp $ +# $Id: londocs.pm,v 1.218 2006/01/16 23:42:39 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1373,7 +1373,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); @@ -1453,7 +1453,24 @@ sub entryline { 'ct' => 'Cut', 'rn' => 'Rename', 'cp' => 'Copy'); + my $nocopy=0; + if ($url=~/\.(page|sequence)$/) { + foreach (&Apache::lonsequence::attemptread(&Apache::lonnet::filelocation('',$url))) { + my ($title,$url,$ext,$type)=split(/\:/,$_); + if (($url=~/\.(page|sequence)/) && ($type ne 'zombie')) { + $nocopy=1; + last; + } + } + } + my $copylink=' '; if ($env{'form.pagepath'}) { + unless ($nocopy) { + $copylink=(< +$lt{'cp'} +ENDCOPY + } $line.=(< @@ -1477,10 +1494,15 @@ sub entryline { $lt{'ct'} $lt{'rn'} - -$lt{'cp'} +$copylink END } else { + unless ($nocopy) { + $copylink=(< +$lt{'cp'} +ENDCOPY + } $line.=(< @@ -1503,8 +1525,7 @@ END $lt{'ct'} $lt{'rn'} - -$lt{'cp'} +$copylink END } } @@ -1534,7 +1555,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/'. @@ -1567,7 +1588,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.='&' }; @@ -1601,7 +1622,7 @@ END } $line.=''. - "$title"; + "$title"; if (($allowed) && ($folder!~/^supplemental/)) { my %lt=&Apache::lonlocal::texthash( 'hd' => 'Hidden', @@ -2509,9 +2530,9 @@ $uploadtag $help{'Check_Resource_Versions'} $dumpbut $exportbut - + ENDCOURSEVERIFY $r->print(&Apache::loncommon::help_open_topic('Docs_Adding_Course_Doc', @@ -2613,7 +2634,7 @@ $uploadtag value="$lt{'extr'}" /> $help{'Adding_External_Resource'} -
+
@@ -2623,7 +2644,7 @@ ENDFORM $r->print(''); unless ($env{'form.pagepath'}) { $r->print(< +
@@ -2632,7 +2653,7 @@ onClick="javascript:makenewfolder(this.f value="$lt{'newf'}" />$help{'Adding_Folders'} -
+
@@ -2641,7 +2662,7 @@ onClick="javascript:makenewpage(this.for value="$lt{'newp'}" />$help{'Adding_Pages'}
-
+
$uploadtag @@ -2650,7 +2671,7 @@ value="Syllabus=/public/$coursedom/$cour $help{'Syllabus'}
-
+
$uploadtag @@ -2659,7 +2680,7 @@ value="Navigate Content=/adm/navmaps"> $help{'Navigate_Content'}
-
+
$uploadtag @@ -2667,7 +2688,7 @@ $uploadtag onClick="javascript:makesmppage();" /> $help{'Simple Page'}
-
+
$uploadtag @@ -2675,7 +2696,7 @@ $uploadtag onClick="javascript:makesmpproblem();" />$help{'Simple Problem'}
-
+
$uploadtag @@ -2684,7 +2705,7 @@ onClick="javascript:makeexamupload();" / $help{'Score_Upload_Form'}
-
+
$uploadtag @@ -2693,7 +2714,7 @@ onClick="javascript:makebulboard();" /> $help{'Bulletin Board'}
-
+
$uploadtag @@ -2702,7 +2723,7 @@ value="$plainname=/adm/$udom/$uname/abou $help{'My Personal Info'}
-
+
$uploadtag @@ -2722,7 +2743,7 @@ $uploadtag onClick="javascript:makesmpproblem();" />$help{'Simple Problem'}
-
+
$uploadtag @@ -2795,7 +2816,7 @@ onClick="javascript:makenewfolder(this.f value="$lt{'newf'}" /> $help{'Adding_Folders'}
-
+
@@ -2804,7 +2825,7 @@ onClick="javascript:makenewext('supnewex value="$lt{'extr'}" /> $help{'Adding_External_Resource'}
-
+
@@ -2813,7 +2834,7 @@ value="Syllabus=/public/$coursedom/$cour $help{'Syllabus'}
-
+