version 1.178, 2005/06/08 17:42:01
|
version 1.181, 2005/06/08 20:44:54
|
Line 1020 sub editor {
|
Line 1020 sub editor {
|
if ($url=~/^http\:\/\//) { $ext='true'; } |
if ($url=~/^http\:\/\//) { $ext='true'; } |
$url=~s/\:/\:/g; |
$url=~s/\:/\:/g; |
# Now insert the URL at the bottom |
# Now insert the URL at the bottom |
my $newidx=1+$#Apache::lonratedt::resources; |
my $newidx=&Apache::lonratedt::getresidx($url); |
$Apache::lonratedt::resources[$newidx]= |
$Apache::lonratedt::resources[$newidx]= |
$title.':'.$url.':'.$ext.':normal:res'; |
$title.':'.$url.':'.$ext.':normal:res'; |
$Apache::lonratedt::order[1+$#Apache::lonratedt::order]=$newidx; |
$Apache::lonratedt::order[1+$#Apache::lonratedt::order]=$newidx; |
Line 1036 sub editor {
|
Line 1036 sub editor {
|
if (($env{'form.uploaddoc.filename'}) && |
if (($env{'form.uploaddoc.filename'}) && |
($env{'form.cmd'}=~/^upload_(\w+)/)) { |
($env{'form.cmd'}=~/^upload_(\w+)/)) { |
if ( ($folder=~/^$1/) || ($1 eq 'default') ) { |
if ( ($folder=~/^$1/) || ($1 eq 'default') ) { |
|
my $destination = 'docs/'; |
|
if ($folder eq 'default') { |
|
$destination .= 'default/'; |
|
} elsif ($folder =~ /^default_(\d+)$/) { |
|
$destination .= $1.'/'; |
|
} |
# this is for a course, not a user, so set coursedoc flag |
# this is for a course, not a user, so set coursedoc flag |
# probably the only place in the system where this should be "1" |
# probably the only place in the system where this should be "1" |
my $newidx=$#Apache::lonratedt::resources+1; |
|
my $url=&Apache::lonnet::userfileupload('uploaddoc',1,'docs/'.$newidx); |
my $newidx=&Apache::lonratedt::getresidx(); |
|
$destination .= $newidx; |
|
my $url=&Apache::lonnet::userfileupload('uploaddoc',1,$destination); |
|
|
my $ext='false'; |
my $ext='false'; |
if ($url=~/^http\:\/\//) { $ext='true'; } |
if ($url=~/^http\:\/\//) { $ext='true'; } |
$url=~s/\:/\:/g; |
$url=~s/\:/\:/g; |
Line 1070 sub editor {
|
Line 1079 sub editor {
|
if ($url=~m|/+uploaded/\Q$coursedom\E/\Q$coursenum\E/|) { |
if ($url=~m|/+uploaded/\Q$coursedom\E/\Q$coursenum\E/|) { |
&Apache::lonnet::removeuploadedurl($url); |
&Apache::lonnet::removeuploadedurl($url); |
} |
} |
|
&Apache::lonratedt::makezombie($Apache::lonratedt::order[$idx]); |
for (my $i=$idx;$i<$#Apache::lonratedt::order;$i++) { |
for (my $i=$idx;$i<$#Apache::lonratedt::order;$i++) { |
$Apache::lonratedt::order[$i]= |
$Apache::lonratedt::order[$i]= |
$Apache::lonratedt::order[$i+1]; |
$Apache::lonratedt::order[$i+1]; |
Line 1077 sub editor {
|
Line 1087 sub editor {
|
$#Apache::lonratedt::order--; |
$#Apache::lonratedt::order--; |
} elsif ($cmd eq 'cut') { |
} elsif ($cmd eq 'cut') { |
my (undef,$url)=split(':',$Apache::lonratedt::resources[$Apache::lonratedt::order[$idx]]); |
my (undef,$url)=split(':',$Apache::lonratedt::resources[$Apache::lonratedt::order[$idx]]); |
|
&Apache::lonratedt::makezombie($Apache::lonratedt::order[$idx]); |
for (my $i=$idx;$i<$#Apache::lonratedt::order;$i++) { |
for (my $i=$idx;$i<$#Apache::lonratedt::order;$i++) { |
$Apache::lonratedt::order[$i]= |
$Apache::lonratedt::order[$i]= |
$Apache::lonratedt::order[$i+1]; |
$Apache::lonratedt::order[$i+1]; |
Line 1142 sub editor {
|
Line 1153 sub editor {
|
# Loading a complete map |
# Loading a complete map |
if (($env{'form.importmap'}) && ($env{'form.loadmap'})) { |
if (($env{'form.importmap'}) && ($env{'form.loadmap'})) { |
foreach (&Apache::lonsequence::attemptread(&Apache::lonnet::filelocation('',$env{'form.importmap'}))) { |
foreach (&Apache::lonsequence::attemptread(&Apache::lonnet::filelocation('',$env{'form.importmap'}))) { |
my $idx=$#Apache::lonratedt::resources; |
my ($title,$url,$ext,$type)=split(/\:/,$_); |
$idx++; |
my $idx=&Apache::lonratedt::getresidx($url); |
$Apache::lonratedt::resources[$idx]=$_; |
$Apache::lonratedt::resources[$idx]=$_; |
$Apache::lonratedt::order |
$Apache::lonratedt::order |
[$#Apache::lonratedt::order+1]=$idx; |
[$#Apache::lonratedt::order+1]=$idx; |
Line 2149 ENDNEWSCRIPT
|
Line 2160 ENDNEWSCRIPT
|
'upls' => 'Upload a new supplemental course document', |
'upls' => 'Upload a new supplemental course document', |
'impp' => 'Import a document', |
'impp' => 'Import a document', |
'pubd' => 'Published documents', |
'pubd' => 'Published documents', |
'copm' => 'All documents out of a published map', |
'copm' => 'All documents out of a published map into this folder', |
'spec' => 'Special documents', |
'spec' => 'Special documents', |
'upld' => 'Upload Document', |
'upld' => 'Upload Document', |
'srch' => 'Search', |
'srch' => 'Search', |
Line 2279 $help{'Importing_LON-CAPA_Resource'}
|
Line 2290 $help{'Importing_LON-CAPA_Resource'}
|
</nobr> |
</nobr> |
<p> |
<p> |
<hr /> |
<hr /> |
$lt{'copm'} |
$lt{'copm'}<br /> |
<input type="text" size="20" name="importmap"><br /> |
<input type="text" size="40" name="importmap"><br /> |
<nobr><input type=button |
<nobr><input type=button |
onClick="javascript:openbrowser('simpleeditdefault','importmap','sequence,page','')" |
onClick="javascript:openbrowser('simpleeditdefault','importmap','sequence,page','')" |
value="$lt{'selm'}"> <input type="submit" name="loadmap" value="$lt{'load'}"> |
value="$lt{'selm'}"> <input type="submit" name="loadmap" value="$lt{'load'}"> |