version 1.68, 2011/07/04 09:24:58
|
version 1.68.6.6, 2013/08/08 12:08:01
|
Line 37 use GDBM_File;
|
Line 37 use GDBM_File;
|
use Apache::loncommon; |
use Apache::loncommon; |
use Apache::lonlocal; |
use Apache::lonlocal; |
use Apache::lonnet; |
use Apache::lonnet; |
use LONCAPA; |
use LONCAPA qw(:DEFAULT :match); |
|
|
my $iconpath; # variable to be accessible to multiple subroutines |
my $iconpath; # variable to be accessible to multiple subroutines |
my %hash; # variable to tie to user specific database |
my %hash; # variable to tie to user specific database |
Line 152 sub readfromfile {
|
Line 152 sub readfromfile {
|
&Apache::lonnet::filelocation('',$env{'form.readfile'})); |
&Apache::lonnet::filelocation('',$env{'form.readfile'})); |
} else { |
} else { |
my $parser = HTML::TokeParser->new(\$cont); |
my $parser = HTML::TokeParser->new(\$cont); |
my $token; |
my ($token,$donechk,$allmaps); |
|
$allmaps = {}; |
while ($token = $parser->get_token) { |
while ($token = $parser->get_token) { |
if ($token->[0] eq 'S') { |
if ($token->[0] eq 'S') { |
if ($token->[1] eq 'resource') { |
if ($token->[1] eq 'resource') { |
if ($env{'form.recover'}) { |
if ($env{'form.recover'}) { |
if ($token->[2]->{'type'} ne 'zombie') { next; } |
if ($token->[2]->{'type'} ne 'zombie') { next; } |
|
if ($token->[2]->{'src'} =~ /\.(page|sequence)$/) { |
|
if (($env{'request.course.id'}) && |
|
($env{'form.readfile'} =~ m{/default(|_\d+)\.(page|sequence)$})) { |
|
unless ($donechk) { |
|
$allmaps = &Apache::loncommon::allmaps_incourse(); |
|
$donechk = 1; |
|
} |
|
} |
|
if ($allmaps->{$token->[2]->{'src'}}) { next; } |
|
} |
} else { |
} else { |
if ($token->[2]->{'type'} eq 'zombie') { next; } |
if ($token->[2]->{'type'} eq 'zombie') { next; } |
} |
} |
Line 181 sub readfromfile {
|
Line 192 sub readfromfile {
|
} |
} |
} |
} |
|
|
|
|
# ---------------------------------------------------------------- Main Handler |
# ---------------------------------------------------------------- Main Handler |
sub handler { |
sub handler { |
my $r = shift; |
my $r = shift; |
Line 329 END
|
Line 339 END
|
if ($env{'form.recover'}) { |
if ($env{'form.recover'}) { |
$r->print(<<END); |
$r->print(<<END); |
<input type="button" name="alter" value="$buttontext" |
<input type="button" name="alter" value="$buttontext" |
onClick="finish_import()" /> |
onclick="finish_import()" /> |
<input type="button" name="alter" value="$lt{'ca'}" onClick="self.close()" /> |
<input type="button" name="alter" value="$lt{'ca'}" onclick="self.close()" /> |
END |
END |
} else { |
} else { |
# --- Continue Buttons |
# --- Continue Buttons |
Line 340 END
|
Line 350 END
|
<h2>$lt{'fin'}</h2> |
<h2>$lt{'fin'}</h2> |
<div> |
<div> |
<input type="button" name="alter" value="$lt{'ci'}" |
<input type="button" name="alter" value="$lt{'ci'}" |
onClick="window.location='$resurl?inhibitmenu=yes&catalogmode=import'" /> |
onclick="window.location='$resurl?inhibitmenu=yes&catalogmode=import'" /> |
<input type="button" name="altersearch" value="$lt{'cs'}" |
<input type="button" name="altersearch" value="$lt{'cs'}" |
onClick="window.location='/adm/searchcat?inhibitmenu=yes&catalogmode=import'" /> |
onclick="window.location='/adm/searchcat?inhibitmenu=yes&catalogmode=import'" /> |
<input type="button" name="alter" value="$lt{'fi'}" |
<input type="button" name="alter" value="$lt{'fi'}" |
onClick="finish_import()" /> |
onclick="finish_import()" /> |
<input type="button" name="alter" value="$lt{'ca'}" onClick="self.close()" /> |
<input type="button" name="alter" value="$lt{'ca'}" onclick="self.close()" /> |
</div> |
</div> |
<br /> |
<br /> |
END |
END |
Line 411 END
|
Line 421 END
|
$r->print("<td>"); |
$r->print("<td>"); |
$r->print("<img src='$iconname' />"); |
$r->print("<img src='$iconname' />"); |
$r->print("</td><td>"); |
$r->print("</td><td>"); |
$r->print($resource->{'title'}.$resource->{'notes'}."</td><td>\n"); |
if (($env{'form.recover'}) && |
|
($resource->{'url'} =~ m{/uploaded/$match_domain/$match_courseid/supplemental/})) { |
|
my $title = &Apache::loncommon::parse_supplemental_title($resource->{'title'}); |
|
$r->print($title); |
|
} else { |
|
$r->print($resource->{'title'}); |
|
} |
|
$r->print($resource->{'notes'}."</td><td>\n"); |
$r->print($resource->{'url'}."</td>" |
$r->print($resource->{'url'}."</td>" |
.&Apache::loncommon::end_data_table_row() |
.&Apache::loncommon::end_data_table_row() |
."\n"); |
."\n"); |
Line 471 sub select_box {
|
Line 488 sub select_box {
|
my ($total,$sel) = @_; |
my ($total,$sel) = @_; |
my $string; |
my $string; |
$string = '<select name="alt'.$sel.'"'; |
$string = '<select name="alt'.$sel.'"'; |
$string .= " onChange='selectchange($sel)'>"; |
$string .= " onchange='selectchange($sel)'>"; |
$string .= "<option name='o0' value='0'>".&mt('discard')."</option>"; |
$string .= "<option name='o0' value='0'>".&mt('discard')."</option>"; |
for my $cur (1..$total) { |
for my $cur (1..$total) { |
$string .= "<option name='o$cur' value='$cur'"; |
$string .= "<option name='o$cur' value='$cur'"; |