version 1.2, 2006/12/04 14:59:55
|
version 1.5, 2007/01/16 21:18:08
|
Line 29
|
Line 29
|
package LONCAPA::map; |
package LONCAPA::map; |
|
|
use HTML::TokeParser; |
use HTML::TokeParser; |
|
use HTML::Entities(); |
use Apache::lonnet; |
use Apache::lonnet; |
use Apache::lonlocal; |
use Apache::lonlocal; |
use File::Copy; |
use File::Copy; |
Line 476 sub loadmap {
|
Line 477 sub loadmap {
|
if ($instr eq -2) { |
if ($instr eq -2) { |
$errtext.='Map not loaded: An error occured while trying to load the map.'; |
$errtext.='Map not loaded: An error occured while trying to load the map.'; |
} elsif ($instr eq '-1') { |
} elsif ($instr eq '-1') { |
$errtext.=&mt('Map not loaded: The file [_1] does not exist.',$fn); |
# Map doesn't exist |
} elsif ($instr) { |
} elsif ($instr) { |
my $parser = HTML::TokeParser->new(\$instr); |
my $parser = HTML::TokeParser->new(\$instr); |
my $token; |
my $token; |
Line 643 sub savemap {
|
Line 644 sub savemap {
|
$outstr.=' type="'.$comp[3].'"'; |
$outstr.=' type="'.$comp[3].'"'; |
} |
} |
if ($comp[0] ne '') { |
if ($comp[0] ne '') { |
$outstr.=' title="'.$comp[0].'"'; |
$outstr.=' title="'.&HTML::Entities::encode($comp[0]).'"'; |
} |
} |
$outstr.=" />\n"; |
$outstr.=" />\n"; |
} elsif ($comp[$#comp] eq 'cond') { |
} elsif ($comp[$#comp] eq 'cond') { |
Line 690 sub savemap {
|
Line 691 sub savemap {
|
} |
} |
} |
} |
$outstr.="</map>\n"; |
$outstr.="</map>\n"; |
if ($fn=~/^\/*uploaded\/(\w+)\/(\w+)\/(.*)$/) { |
if ($fn=~m{^/*uploaded/($LONCAPA::domain_re)/($LONCAPA::courseid_re)/(.*)$}) { |
$env{'form.output'}=$outstr; |
$env{'form.output'}=$outstr; |
my $result=&Apache::lonnet::finishuserfileupload($2,$1, |
my $result=&Apache::lonnet::finishuserfileupload($2,$1, |
'output',$3); |
'output',$3); |