version 1.12, 2008/12/19 03:49:56
|
version 1.15, 2014/06/14 19:05:00
|
Line 303 sub startfinish {
|
Line 303 sub startfinish {
|
} |
} |
} |
} |
} |
} |
|
# Make sure this has at least start and finish |
|
if ($#order==-1) { |
|
$resources[&getresidx()]='::false'; |
|
$order[0]=$#resources; |
|
} |
# Put in a start resource |
# Put in a start resource |
my ($name,$url,$ext)=split(/\:/,$resources[$order[0]]); |
my ($name,$url,$ext)=split(/\:/,$resources[$order[0]]); |
$resources[$order[0]]=$name.':'.$url.':'.$ext.':start:res'; |
$resources[$order[0]]=$name.':'.$url.':'.$ext.':start:res'; |
# Make sure this has at least start and finish |
|
if ($#order==0) { |
if ($#order==0) { |
$resources[&getresidx()]='::false'; |
$resources[&getresidx()]='::false'; |
$order[1]=$#resources; |
$order[1]=$#resources; |
Line 319 sub startfinish {
|
Line 323 sub startfinish {
|
# ------------------------------------------------------------------- Store map |
# ------------------------------------------------------------------- Store map |
|
|
sub storemap { |
sub storemap { |
my $realfn=shift; |
my ($realfn,$useorig,$dotimeupdate) = @_; |
my $fn=$realfn; |
my $fn=$realfn; |
# unless this is forced to work from the original file, use a temporary file |
# unless this is forced to work from the original file, use a temporary file |
# instead |
# instead |
unless (shift) { |
unless ($useorig) { |
$fn=$realfn.'.tmp'; |
$fn=$realfn.'.tmp'; |
unless (-e $fn) { |
unless (-e $fn) { |
copy($realfn,$fn); |
copy($realfn,$fn); |
Line 357 sub storemap {
|
Line 361 sub storemap {
|
$output.='<&>objcont<:>'.$i.'<:>'.$zombies[$i]; |
$output.='<&>objcont<:>'.$i.'<:>'.$zombies[$i]; |
} |
} |
} |
} |
$output=~s/https?\&colon\;\/\///g; |
$output=~s/http\&colon\;\/\///g; |
$env{'form.output'}=$output; |
$env{'form.output'}=$output; |
return &loadmap($fn,&savemap($fn,'')); |
return &loadmap($fn,&savemap($fn,'',$dotimeupdate)); |
} |
} |
|
|
# ------------------------------------------ Store and get parameters in global |
# ------------------------------------------ Store and get parameters in global |
Line 583 sub loadmap {
|
Line 587 sub loadmap {
|
# ----------------------------------------------------------- Saves map to disk |
# ----------------------------------------------------------- Saves map to disk |
|
|
sub savemap { |
sub savemap { |
my ($fn,$errtext)=@_; |
my ($fn,$errtext,$dotimeupdate)=@_; |
my $infotext=''; |
my $infotext=''; |
my %alltypes; |
my %alltypes; |
my %allvalues; |
my %allvalues; |
Line 616 sub savemap {
|
Line 620 sub savemap {
|
} |
} |
$comp[1].='" external="true'; |
$comp[1].='" external="true'; |
} else { |
} else { |
if ($comp[1]=~/^https?\:\/\//) { |
if ($comp[1]=~/^http\:\/\//) { |
$comp[1]=~s/^https?\:\/\/[^\/]*\//\//; |
$comp[1]=~s/^http\:\/\/[^\/]*\//\//; |
} |
} |
} |
} |
$outstr.='<resource id="'.$parts[1].'" src="' |
$outstr.='<resource id="'.$parts[1].'" src="' |
Line 689 sub savemap {
|
Line 693 sub savemap {
|
$errtext.='Could not write file '.$fn.'. Map not saved. '; |
$errtext.='Could not write file '.$fn.'. Map not saved. '; |
} |
} |
} |
} |
|
if ($dotimeupdate) { |
|
unless ($errtext) { |
|
if ($env{'request.course.id'}) { |
|
my $now = time; |
|
&Apache::lonnet::put('environment',{'internal.contentchange' => $now}, |
|
$env{'course.'.$env{'request.course.id'}.'.domain'}, |
|
$env{'course.'.$env{'request.course.id'}.'.num'}); |
|
&Apache::lonnet::appenv( |
|
{'course.'.$env{'request.course.id'}.'.internal.contentchange' => $now}); |
|
&Apache::lonnet::do_cache_new('crschange',$env{'request.course.id'},$now,600); |
|
} |
|
} |
|
} |
} else { |
} else { |
# -------------------------------------------- Cannot write to that file, error |
# -------------------------------------------- Cannot write to that file, error |
$errtext.='Map not saved: The specified path does not exist. '; |
$errtext.='Map not saved: The specified path does not exist. '; |