--- loncom/interface/londocs.pm 2005/11/04 21:39:26 1.210
+++ loncom/interface/londocs.pm 2006/02/07 19:46:30 1.221
@@ -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.221 2006/02/07 19:46:30 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);
@@ -1401,6 +1401,7 @@ sub entryline {
$foldertitle;
}
$renametitle=~s/\"\;/\\\"/g;
+ $renametitle=~s/\\/\\\\/g;
my $line='
';
# Edit commands
my $container;
@@ -1453,7 +1454,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 +1495,15 @@ sub entryline {
$lt{'ct'}
$lt{'rn'}
-
-$lt{'cp'}
+$copylink
END
} else {
+ unless ($nocopy) {
+ $copylink=(<
+$lt{'cp'}
+ENDCOPY
+ }
$line.=(<
@@ -1503,8 +1526,7 @@ END
$lt{'ct'}
$lt{'rn'}
-
-$lt{'cp'}
+$copylink
END
}
}
@@ -1534,7 +1556,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 +1589,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 +1623,7 @@ END
}
$line.=' | '.
- "$title | ";
+ "$title | ";
if (($allowed) && ($folder!~/^supplemental/)) {
my %lt=&Apache::lonlocal::texthash(
'hd' => 'Hidden',
@@ -1645,6 +1667,7 @@ sub tiehash {
sub untiehash {
if ($hashtied) { untie %hash; }
$hashtied=0;
+ return OK;
}
# --------------------------------------------------------------- check on this
@@ -2242,6 +2265,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) {
@@ -2457,6 +2489,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',
@@ -2509,9 +2542,9 @@ $uploadtag
$help{'Check_Resource_Versions'}
$dumpbut
$exportbut
-
+
ENDCOURSEVERIFY
$r->print(&Apache::loncommon::help_open_topic('Docs_Adding_Course_Doc',
@@ -2613,7 +2646,7 @@ $uploadtag
value="$lt{'extr'}" /> $help{'Adding_External_Resource'}
-