version 1.65, 2006/03/06 23:35:43
|
version 1.67, 2006/03/19 23:06:00
|
Line 84 sub hash_src {
|
Line 84 sub hash_src {
|
return ($hash{'src_'.$id},$symb); |
return ($hash{'src_'.$id},$symb); |
} |
} |
|
|
|
# Inputs are a url, adn a hash ref of |
|
# form name => value pairs |
|
# takes care of properly adding the form name elements and values to the |
|
# the url doing proper escaping of the values and joining with ? or & as |
|
# needed |
|
|
|
sub add_get_param { |
|
my ($url,$form_data) = @_; |
|
my $needs_question_mark = ($url !~ /\?/); |
|
|
|
while (my ($name,$value) = each(%$form_data)) { |
|
if ($needs_question_mark) { |
|
$url.='?'; |
|
$needs_question_mark = 0; |
|
} else { |
|
$url.='&'; |
|
} |
|
$url.=$name.'='.&Apache::lonnet::escape($form_data->{$name}); |
|
} |
|
return $url; |
|
} |
|
|
sub move { |
sub move { |
my ($rid,$mapurl,$direction)=@_; |
my ($rid,$mapurl,$direction)=@_; |
my $startoutrid=$rid; |
my $startoutrid=$rid; |
Line 185 sub navlaunch {
|
Line 207 sub navlaunch {
|
&Apache::loncommon::content_type($r,'text/html'); |
&Apache::loncommon::content_type($r,'text/html'); |
&Apache::loncommon::no_cache($r); |
&Apache::loncommon::no_cache($r); |
$r->send_http_header; |
$r->send_http_header; |
my $html=&Apache::lonxml::xmlbegin(); |
$r->print(&Apache::loncommon::start_page('Launched')); |
$r->print("$html<head>\n"); |
|
$r->print('</head>'. |
|
&Apache::loncommon::bodytag('Launched')); |
|
$r->print(<<ENDNAV); |
$r->print(<<ENDNAV); |
<p><a href="/adm/flip?postdata=firstres%3a">Goto first resource</a></p> |
<p><a href="/adm/flip?postdata=firstres%3a">Goto first resource</a></p> |
<script type="text/javascript"> |
<script type="text/javascript"> |
Line 200 sub navlaunch {
|
Line 219 sub navlaunch {
|
</script> |
</script> |
<p><a href="javascript:collapse();">Collapse external navigation window</a></p> |
<p><a href="javascript:collapse();">Collapse external navigation window</a></p> |
ENDNAV |
ENDNAV |
$r->print(&Apache::loncommon::endbodytag().'</html>'); |
$r->print(&Apache::loncommon::end_page()); |
} |
} |
# ================================================================ Main Handler |
# ================================================================ Main Handler |
|
|
Line 399 sub handler {
|
Line 418 sub handler {
|
|
|
&Apache::loncommon::content_type($r,'text/html'); |
&Apache::loncommon::content_type($r,'text/html'); |
my $url='http://'.$ENV{'HTTP_HOST'}.$redirecturl; |
my $url='http://'.$ENV{'HTTP_HOST'}.$redirecturl; |
if ($redirectsymb ne '') { $url.=($url=~/\?/?'&':'?').'symb='.&Apache::lonnet::escape($redirectsymb); } |
$url = &add_get_param($url, { 'symb' => $redirectsymb}); |
$r->header_out(Location => $url); |
$r->header_out(Location => $url); |
return REDIRECT; |
return REDIRECT; |
} else { |
} else { |
Line 418 sub handler {
|
Line 437 sub handler {
|
'titleheader' => 'Title', |
'titleheader' => 'Title', |
'type' => 'Type'); |
'type' => 'Type'); |
if ($#possibilities>0) { |
if ($#possibilities>0) { |
my $bodytag= |
my $start_page= |
&Apache::loncommon::bodytag('Multiple Resources'); |
&Apache::loncommon::start_page('Multiple Resources'); |
$r->print(<<ENDSTART); |
$r->print(<<ENDSTART); |
<head><title>Choose Next Location</title></head> |
$start_page |
$bodytag |
|
<h3>$lt{'wherenext'}</h3> |
<h3>$lt{'wherenext'}</h3> |
<p> |
<p> |
$lt{'pick'}: |
$lt{'pick'}: |
Line 433 ENDSTART
|
Line 451 ENDSTART
|
foreach my $id (@possibilities) { |
foreach my $id (@possibilities) { |
$r->print( |
$r->print( |
'<tr><td><a href="'. |
'<tr><td><a href="'. |
$multichoicehash{'src_'.$id}.($multichoicehash{'src_'.$id}=~/\?/?'&':'?').'symb=' . |
&add_get_param($multichoicehash{'src_'.$id}, |
Apache::lonnet::escape($multichoicehash{'symb_'.$id}).'">'. |
{'symb' => |
|
$multichoicehash{'symb_'.$id}, |
|
}).'">'. |
$multichoicehash{'title_'.$id}. |
$multichoicehash{'title_'.$id}. |
'</a></td><td>'.$multichoicehash{'type_'.$id}. |
'</a></td><td>'.$multichoicehash{'type_'.$id}. |
'</td></tr>'); |
'</td></tr>'); |
} |
} |
$r->print('</table>'); |
$r->print('</table>'); |
} else { |
} else { |
my $bodytag=&Apache::loncommon::bodytag('No Resource'); |
my $start_page= |
|
&Apache::loncommon::start_page('No Resource'); |
$r->print(<<ENDNONE); |
$r->print(<<ENDNONE); |
<head><title>No Resource</title></head> |
$start_page |
$bodytag |
|
<h3>$lt{'title'}</h3> |
<h3>$lt{'title'}</h3> |
<p>$lt{'explain'}</p> |
<p>$lt{'explain'}</p> |
ENDNONE |
ENDNONE |
Line 453 ENDNONE
|
Line 473 ENDNONE
|
<ul> |
<ul> |
<li><a href="/adm/flip?postdata=return:">$lt{'back'}</a></li> |
<li><a href="/adm/flip?postdata=return:">$lt{'back'}</a></li> |
<li><a href="/adm/navmaps">$lt{'nav'}</a></li> |
<li><a href="/adm/navmaps">$lt{'nav'}</a></li> |
</ul></body></html> |
</ul> |
ENDMENU |
ENDMENU |
|
$r->print(&Apache::loncommon::end_page()); |
return OK; |
return OK; |
} |
} |
} else { |
} else { |