version 1.151, 2011/08/09 12:16:41
|
version 1.152, 2011/08/10 14:54:42
|
Line 375 sub handler {
|
Line 375 sub handler {
|
], |
], |
}, |
}, |
); |
); |
my $js; |
|
if (keys(%servers) > 1) { |
if (keys(%servers) > 1) { |
$prefs{'login'} = { text => 'Log-in page options', |
$prefs{'login'} = { text => 'Log-in page options', |
help => 'Domain_Configuration_Login_Page', |
help => 'Domain_Configuration_Login_Page', |
Line 384 sub handler {
|
Line 383 sub handler {
|
{col1 => 'Log-in Page Items', |
{col1 => 'Log-in Page Items', |
col2 => ''}], |
col2 => ''}], |
}; |
}; |
my ($othertitle,$usertypes,$types) = |
|
&Apache::loncommon::sorted_inst_types($dom); |
|
|
|
$js = &lonbalance_targets_js($dom,$types,\%servers); |
|
} |
} |
my @roles = ('student','coordinator','author','admin'); |
my @roles = ('student','coordinator','author','admin'); |
my @actions = &Apache::loncommon::get_env_multiple('form.actions'); |
my @actions = &Apache::loncommon::get_env_multiple('form.actions'); |
Line 398 sub handler {
|
Line 393 sub handler {
|
if ($phase eq 'process') { |
if ($phase eq 'process') { |
&Apache::lonconfigsettings::make_changes($r,$dom,$phase,$context,\@prefs_order,\%prefs,\%domconfig,$confname,\@roles); |
&Apache::lonconfigsettings::make_changes($r,$dom,$phase,$context,\@prefs_order,\%prefs,\%domconfig,$confname,\@roles); |
} elsif ($phase eq 'display') { |
} elsif ($phase eq 'display') { |
|
my $js; |
|
if (keys(%servers) > 1) { |
|
my ($othertitle,$usertypes,$types) = |
|
&Apache::loncommon::sorted_inst_types($dom); |
|
$js = &lonbalance_targets_js($dom,$types,\%servers). |
|
&new_spares_js(). |
|
&common_domprefs_js(); |
|
} |
&Apache::lonconfigsettings::display_settings($r,$dom,$phase,$context,\@prefs_order,\%prefs,\%domconfig,$confname,$js); |
&Apache::lonconfigsettings::display_settings($r,$dom,$phase,$context,\@prefs_order,\%prefs,\%domconfig,$confname,$js); |
} else { |
} else { |
if (keys(%domconfig) == 0) { |
if (keys(%domconfig) == 0) { |
Line 2336 sub print_usersessions {
|
Line 2339 sub print_usersessions {
|
&build_location_hashes(\@intdoms,\%by_ip,\%by_location); |
&build_location_hashes(\@intdoms,\%by_ip,\%by_location); |
|
|
my @alldoms = &Apache::lonnet::all_domains(); |
my @alldoms = &Apache::lonnet::all_domains(); |
my %uniques = &Apache::lonnet::get_unique_servers(\@alldoms); |
my %serverhomes = %Apache::lonnet::serverhomeIDs; |
my %servers = &Apache::lonnet::internet_dom_servers($dom); |
my %servers = &Apache::lonnet::internet_dom_servers($dom); |
|
my %altids = &id_for_thisdom(%servers); |
my $itemcount = 1; |
my $itemcount = 1; |
if ($position eq 'top') { |
if ($position eq 'top') { |
if (keys(%uniques) > 1) { |
if (keys(%serverhomes) > 1) { |
my %spareid = ¤t_offloads_to($dom,$settings,\%servers); |
my %spareid = ¤t_offloads_to($dom,$settings,\%servers); |
$datatable .= &spares_row(\%servers,\%spareid,\%uniques,$rowtotal); |
$datatable .= &spares_row($dom,\%servers,\%spareid,\%serverhomes,\%altids,$rowtotal); |
} else { |
} else { |
$datatable .= '<tr'.$css_class.'><td colspan="2">'. |
$datatable .= '<tr'.$css_class.'><td colspan="2">'. |
&mt('Nothing to set here, as the cluster to which this domain belongs only contains one server.'); |
&mt('Nothing to set here, as the cluster to which this domain belongs only contains one server.'); |
Line 2515 sub build_location_hashes {
|
Line 2519 sub build_location_hashes {
|
sub current_offloads_to { |
sub current_offloads_to { |
my ($dom,$settings,$servers) = @_; |
my ($dom,$settings,$servers) = @_; |
my (%spareid,%otherdomconfigs); |
my (%spareid,%otherdomconfigs); |
if ((ref($settings) eq 'HASH') && (ref($servers) eq 'HASH')) { |
if (ref($servers) eq 'HASH') { |
foreach my $lonhost (sort(keys(%{$servers}))) { |
foreach my $lonhost (sort(keys(%{$servers}))) { |
my $gotspares; |
my $gotspares; |
if (ref($settings->{'spares'}) eq 'HASH') { |
if (ref($settings) eq 'HASH') { |
if (ref($settings->{'spares'}{$lonhost}) eq 'HASH') { |
if (ref($settings->{'spares'}) eq 'HASH') { |
$spareid{$lonhost}{'primary'} = $settings->{'spares'}{$lonhost}{'primary'}; |
if (ref($settings->{'spares'}{$lonhost}) eq 'HASH') { |
$spareid{$lonhost}{'default'} = $settings->{'spares'}{$lonhost}{'default'}; |
$spareid{$lonhost}{'primary'} = $settings->{'spares'}{$lonhost}{'primary'}; |
$gotspares = 1; |
$spareid{$lonhost}{'default'} = $settings->{'spares'}{$lonhost}{'default'}; |
|
$gotspares = 1; |
|
} |
} |
} |
} |
} |
unless ($gotspares) { |
unless ($gotspares) { |
Line 2590 sub current_offloads_to {
|
Line 2596 sub current_offloads_to {
|
} |
} |
|
|
sub spares_row { |
sub spares_row { |
my ($servers,$spareid,$uniques,$rowtotal) = @_; |
my ($dom,$servers,$spareid,$serverhomes,$altids,$rowtotal) = @_; |
my $css_class; |
my $css_class; |
my $numinrow = 4; |
my $numinrow = 4; |
my $itemcount = 1; |
my $itemcount = 1; |
my $datatable; |
my $datatable; |
if ((ref($servers) eq 'HASH') && (ref($spareid) eq 'HASH')) { |
my %typetitles = &sparestype_titles(); |
|
if ((ref($servers) eq 'HASH') && (ref($spareid) eq 'HASH') && (ref($altids) eq 'HASH')) { |
foreach my $server (sort(keys(%{$servers}))) { |
foreach my $server (sort(keys(%{$servers}))) { |
|
my $serverhome = &Apache::lonnet::get_server_homeID($servers->{$server}); |
|
my ($othercontrol,$serverdom); |
|
if ($serverhome ne $server) { |
|
$serverdom = &Apache::lonnet::host_domain($serverhome); |
|
$othercontrol = &mt('Session offloading controlled by domain: [_1]','<b>'.$serverdom.'</b>'); |
|
} else { |
|
$serverdom = &Apache::lonnet::host_domain($server); |
|
if ($serverdom ne $dom) { |
|
$othercontrol = &mt('Session offloading controlled by domain: [_1]','<b>'.$serverdom.'</b>'); |
|
} |
|
} |
|
next unless (ref($spareid->{$server}) eq 'HASH'); |
$css_class = $itemcount%2 ? ' class="LC_odd_row"' : ''; |
$css_class = $itemcount%2 ? ' class="LC_odd_row"' : ''; |
$datatable .= '<tr'.$css_class.'> |
$datatable .= '<tr'.$css_class.'> |
<td rowspan="2"> |
<td rowspan="2"> |
<span class="LC_nobreak"><b>'.$server.'</b> when busy, offloads to:</span></td>'; |
<span class="LC_nobreak"><b>'.$server.'</b> when busy, offloads to:</span></td>'."\n"; |
my (%current,%canselect); |
my (%current,%canselect); |
if (ref($spareid->{$server}) eq 'HASH') { |
my @choices = |
foreach my $type ('primary','default') { |
&possible_newspares($server,$spareid->{$server},$serverhomes,$altids); |
|
foreach my $type ('primary','default') { |
|
if (ref($spareid->{$server}) eq 'HASH') { |
if (ref($spareid->{$server}{$type}) eq 'ARRAY') { |
if (ref($spareid->{$server}{$type}) eq 'ARRAY') { |
my @spares = @{$spareid->{$server}{$type}}; |
my @spares = @{$spareid->{$server}{$type}}; |
if (@spares > 0) { |
if (@spares > 0) { |
$current{$type} .= '<table>'; |
if ($othercontrol) { |
for (my $i=0; $i<@spares; $i++) { |
$current{$type} = join(', ',@spares); |
my $rem = $i%($numinrow); |
} else { |
if ($rem == 0) { |
$current{$type} .= '<table>'; |
if ($i > 0) { |
my $numspares = scalar(@spares); |
$current{$type} .= '</tr>'; |
for (my $i=0; $i<@spares; $i++) { |
|
my $rem = $i%($numinrow); |
|
if ($rem == 0) { |
|
if ($i > 0) { |
|
$current{$type} .= '</tr>'; |
|
} |
|
$current{$type} .= '<tr>'; |
} |
} |
$current{$type} .= '<tr>'; |
$current{$type} .= '<td><label><input type="checkbox" name="spare_'.$type.'_'.$server.'" id="spare_'.$type.'_'.$server.'_'.$i.'" checked="checked" value="'.$spareid->{$server}{$type}[$i].'" onclick="updateNewSpares(this.form,'."'$server'".');" /> '. |
|
$spareid->{$server}{$type}[$i]. |
|
'</label></td>'."\n"; |
|
} |
|
my $rem = @spares%($numinrow); |
|
my $colsleft = $numinrow - $rem; |
|
if ($colsleft > 1 ) { |
|
$current{$type} .= '<td colspan="'.$colsleft. |
|
'" class="LC_left_item">'. |
|
' </td>'; |
|
} elsif ($colsleft == 1) { |
|
$current{$type} .= '<td class="LC_left_item"> </td>'."\n"; |
} |
} |
$current{$type} .= '<td><label><input type="checkbox" name="spare_'.$type.'_'.$server.'" checked="checked" value="'.$spareid->{$server}{$type}[$i].'" /> '. |
$current{$type} .= '</tr></table>'; |
$spareid->{$server}{$type}[$i]. |
|
'</label></td>'; |
|
} |
|
my $rem = @spares%($numinrow); |
|
my $colsleft = $numinrow - $rem; |
|
if ($colsleft > 1 ) { |
|
$current{$type} .= '<td colspan="'.$colsleft. |
|
'" class="LC_left_item">'. |
|
' </td>'; |
|
} elsif ($colsleft == 1) { |
|
$current{$type} .= '<td class="LC_left_item"> </td>'; |
|
} |
} |
} |
} |
$current{$type} .= '</tr></table>'; |
|
} |
} |
if ($current{$type} eq '') { |
if ($current{$type} eq '') { |
$current{$type} = &mt('None specified'); |
$current{$type} = &mt('None specified'); |
} |
} |
$canselect{$type} = |
if ($othercontrol) { |
&newspare_select($server,$type,$spareid->{$server}{$type},$uniques); |
if ($type eq 'primary') { |
|
$canselect{$type} = $othercontrol; |
|
} |
|
} else { |
|
$canselect{$type} = |
|
&mt('Add new [_1]'.$type.'[_2]:','<i>','</i>').' '. |
|
'<select name="newspare_'.$type.'_'.$server.'" '. |
|
'id="newspare_'.$type.'_'.$server.'" onchange="checkNewSpares('."'$server','$type'".');">'."\n". |
|
'<option value="" selected ="selected">'.&mt('Select').'</option>'."\n"; |
|
if (@choices > 0) { |
|
foreach my $lonhost (@choices) { |
|
$canselect{$type} .= '<option value="'.$lonhost.'">'.$lonhost.'</option>'."\n"; |
|
} |
|
} |
|
$canselect{$type} .= '</select>'."\n"; |
|
} |
|
} else { |
|
$current{$type} = &mt('Could not be determined'); |
|
if ($type eq 'primary') { |
|
$canselect{$type} = $othercontrol; |
|
} |
} |
} |
|
if ($type eq 'default') { |
|
$datatable .= '<tr'.$css_class.'>'; |
|
} |
|
$datatable .= '<td><i>'.$typetitles{$type}.'</i></td>'."\n". |
|
'<td>'.$current{$type}.'</td>'."\n". |
|
'<td>'.$canselect{$type}.'</td></tr>'."\n"; |
} |
} |
$datatable .= '<td><i>'.&mt('primary').'</i><td>'.$current{'primary'}.'</td>'. |
|
'<td>'.&mt('Add new [_1]primary[_2]:','<i>','</i>').' '. |
|
$canselect{'primary'}.'</td></tr>'. |
|
'<tr'.$css_class.'>'. |
|
'<td><i>'.&mt('default').'</i></td>'. |
|
'<td>'.$current{'default'}.'</td>'. |
|
'<td>'.&mt('Add new [_1]default[_2]:','<i>','</i>').' '. |
|
$canselect{'default'}.'</td></tr>'; |
|
$itemcount ++; |
$itemcount ++; |
} |
} |
} |
} |
Line 2654 sub spares_row {
|
Line 2698 sub spares_row {
|
return $datatable; |
return $datatable; |
} |
} |
|
|
sub newspare_select { |
sub possible_newspares { |
my ($server,$type,$currspares,$uniques) = @_; |
my ($server,$currspares,$serverhomes,$altids) = @_; |
my $output; |
my $serverhostname = &Apache::lonnet::hostname($server); |
if (ref($uniques) eq 'HASH') { |
my %excluded; |
if (keys(%{$uniques}) > 1) { |
if ($serverhostname ne '') { |
$output = '<select name="newspare_'.$type.'_'.$server.'">'."\n". |
%excluded = ( |
'<option value="" selected ="selected">'.&mt('Select').'</option>'."\n"; |
$serverhostname => 1, |
foreach my $lonhost (sort(keys(%{$uniques}))) { |
); |
next if ($lonhost eq $server); |
} |
if (ref($currspares) eq 'ARRAY') { |
if (ref($currspares) eq 'HASH') { |
if (@{$currspares} > 0) { |
foreach my $type (keys(%{$currspares})) { |
next if (grep(/^\Q$lonhost\E$/,@{$currspares})); |
if (ref($currspares->{$type}) eq 'ARRAY') { |
|
if (@{$currspares->{$type}} > 0) { |
|
foreach my $curr (@{$currspares->{$type}}) { |
|
my $hostname = &Apache::lonnet::hostname($curr); |
|
$excluded{$hostname} = 1; |
} |
} |
} |
} |
$output .= '<option value="'.$lonhost.'">'.$lonhost.'</option>'."\n"; |
|
} |
} |
$output .= '<select>'; |
|
} |
} |
} |
} |
return $output; |
my @choices; |
|
if ((ref($serverhomes) eq 'HASH') && (ref($altids) eq 'HASH')) { |
|
if (keys(%{$serverhomes}) > 1) { |
|
foreach my $name (sort(keys(%{$serverhomes}))) { |
|
unless ($excluded{$name}) { |
|
if (exists($altids->{$serverhomes->{$name}})) { |
|
push(@choices,$altids->{$serverhomes->{$name}}); |
|
} else { |
|
push(@choices,$serverhomes->{$name}); |
|
} |
|
} |
|
} |
|
} |
|
} |
|
return sort(@choices); |
} |
} |
|
|
sub print_loadbalancing { |
sub print_loadbalancing { |
Line 7342 sub modify_usersessions {
|
Line 7402 sub modify_usersessions {
|
} |
} |
|
|
my @alldoms = &Apache::lonnet::all_domains(); |
my @alldoms = &Apache::lonnet::all_domains(); |
my %uniques = &Apache::lonnet::get_unique_servers(\@alldoms); |
|
my %servers = &Apache::lonnet::internet_dom_servers($dom); |
my %servers = &Apache::lonnet::internet_dom_servers($dom); |
my %spareid = ¤t_offloads_to($dom,$domconfig{'usersessions'},\%servers); |
my %spareid = ¤t_offloads_to($dom,$domconfig{'usersessions'},\%servers); |
my $savespares; |
my $savespares; |
Line 7350 sub modify_usersessions {
|
Line 7409 sub modify_usersessions {
|
foreach my $lonhost (sort(keys(%servers))) { |
foreach my $lonhost (sort(keys(%servers))) { |
my $serverhomeID = |
my $serverhomeID = |
&Apache::lonnet::get_server_homeID($servers{$lonhost}); |
&Apache::lonnet::get_server_homeID($servers{$lonhost}); |
|
my $serverhostname = &Apache::lonnet::hostname($lonhost); |
$defaultshash{'usersessions'}{'spares'}{$lonhost} = {}; |
$defaultshash{'usersessions'}{'spares'}{$lonhost} = {}; |
my %spareschg; |
my %spareschg; |
foreach my $type (@{$types{'spares'}}) { |
foreach my $type (@{$types{'spares'}}) { |
my @okspares; |
my @okspares; |
my @checked = &Apache::loncommon::get_env_multiple('form.spare_'.$type.'_'.$lonhost); |
my @checked = &Apache::loncommon::get_env_multiple('form.spare_'.$type.'_'.$lonhost); |
foreach my $server (@checked) { |
foreach my $server (@checked) { |
unless (($server eq $lonhost) || ($server eq $serverhomeID)) { |
if (&Apache::lonnet::hostname($server) ne '') { |
if ($uniques{$server}) { |
unless (&Apache::lonnet::hostname($server) eq $serverhostname) { |
push(@okspares,$server); |
unless (grep(/^\Q$server\E$/,@okspares)) { |
|
push(@okspares,$server); |
|
} |
} |
} |
} |
} |
} |
} |
my $new = $env{'form.newspare_'.$type.'_'.$lonhost}; |
my $new = $env{'form.newspare_'.$type.'_'.$lonhost}; |
my $newspare; |
my $newspare; |
if (($new ne '') && ($uniques{$new})) { |
if (($new ne '') && (&Apache::lonnet::hostname($new))) { |
unless (($new eq $lonhost) || ($new eq $serverhomeID)) { |
unless (&Apache::lonnet::hostname($new) eq $serverhostname) { |
$newspare = $new; |
$newspare = $new; |
$spareschg{$type} = 1; |
|
} |
|
} |
|
if (ref($spareid{$lonhost}) eq 'HASH') { |
|
if (ref($spareid{$lonhost}{$type}) eq 'ARRAY') { |
|
my @diffs = &Apache::loncommon::compare_arrays($domconfig{'usersessions'}{'spares'}{$lonhost}{$type},\@okspares); |
|
if (@diffs > 0) { |
|
$spareschg{$type} = 1; |
|
} elsif ($new ne '') { |
|
$spareschg{$type} = 1; |
|
} |
|
} |
} |
} |
} |
my @spares; |
my @spares; |
Line 7387 sub modify_usersessions {
|
Line 7438 sub modify_usersessions {
|
@spares = sort(@okspares); |
@spares = sort(@okspares); |
} |
} |
$defaultshash{'usersessions'}{'spares'}{$lonhost}{$type} = \@spares; |
$defaultshash{'usersessions'}{'spares'}{$lonhost}{$type} = \@spares; |
|
if (ref($spareid{$lonhost}) eq 'HASH') { |
|
if (ref($spareid{$lonhost}{$type}) eq 'ARRAY') { |
|
my @diffs = &Apache::loncommon::compare_arrays($spareid{$lonhost}{$type},\@spares); |
|
if (@diffs > 0) { |
|
$spareschg{$type} = 1; |
|
} |
|
} |
|
} |
} |
} |
if (keys(%spareschg) > 0) { |
if (keys(%spareschg) > 0) { |
$changes{'spares'}{$lonhost} = \%spareschg; |
$changes{'spares'}{$lonhost} = \%spareschg; |
Line 7813 sub usersession_titles {
|
Line 7872 sub usersession_titles {
|
); |
); |
} |
} |
|
|
|
sub id_for_thisdom { |
|
my (%servers) = @_; |
|
my %altids; |
|
foreach my $server (keys(%servers)) { |
|
my $serverhome = &Apache::lonnet::get_server_homeID($servers{$server}); |
|
if ($serverhome ne $server) { |
|
$altids{$serverhome} = $server; |
|
} |
|
} |
|
return %altids; |
|
} |
|
|
sub count_servers { |
sub count_servers { |
my ($currbalancer,%servers) = @_; |
my ($currbalancer,%servers) = @_; |
my (@spares,$numspares); |
my (@spares,$numspares); |
Line 7875 function showSpares(balancer,ishomedom)
|
Line 7946 function showSpares(balancer,ishomedom)
|
|
|
document.getElementById('loadbalancing_targets').style.display='block'; |
document.getElementById('loadbalancing_targets').style.display='block'; |
document.getElementById('loadbalancing_disabled').style.display='none'; |
document.getElementById('loadbalancing_disabled').style.display='none'; |
|
|
for (var i=0; i<offloadtypes.length; i++) { |
for (var i=0; i<offloadtypes.length; i++) { |
var count = 0; |
var count = 0; |
for (var j=0; j<alltargets.length; j++) { |
for (var j=0; j<alltargets.length; j++) { |
Line 7998 function balanceruleChange(formname,type
|
Line 8069 function balanceruleChange(formname,type
|
return; |
return; |
} |
} |
|
|
|
// ]]> |
|
</script> |
|
|
|
END |
|
} |
|
|
|
sub new_spares_js { |
|
my @sparestypes = ('primary','default'); |
|
my $types = join("','",@sparestypes); |
|
my $select = &mt('Select'); |
|
return <<"END"; |
|
|
|
<script type="text/javascript"> |
|
// <![CDATA[ |
|
|
|
function updateNewSpares(formname,lonhost) { |
|
var types = new Array('$types'); |
|
var include = new Array(); |
|
var exclude = new Array(); |
|
for (var i=0; i<types.length; i++) { |
|
var spareboxes = getIndicesByName(formname,'spare_'+types[i]+'_'+lonhost); |
|
for (var j=0; j<spareboxes.length; j++) { |
|
if (formname.elements[spareboxes[j]].checked) { |
|
exclude.push(formname.elements[spareboxes[j]].value); |
|
} else { |
|
include.push(formname.elements[spareboxes[j]].value); |
|
} |
|
} |
|
} |
|
for (var i=0; i<types.length; i++) { |
|
var newSpare = document.getElementById('newspare_'+types[i]+'_'+lonhost); |
|
var selIdx = newSpare.selectedIndex; |
|
var currnew = newSpare.options[selIdx].value; |
|
var okSpares = new Array(); |
|
for (var j=0; j<newSpare.options.length; j++) { |
|
var possible = newSpare.options[j].value; |
|
if (possible != '') { |
|
if (exclude.indexOf(possible) == -1) { |
|
okSpares.push(possible); |
|
} else { |
|
if (currnew == possible) { |
|
selIdx = 0; |
|
} |
|
} |
|
} |
|
} |
|
for (var k=0; k<include.length; k++) { |
|
if (okSpares.indexOf(include[k]) == -1) { |
|
okSpares.push(include[k]); |
|
} |
|
} |
|
okSpares.sort(); |
|
newSpare.options.length = 0; |
|
if (selIdx == 0) { |
|
newSpare.options[0] = new Option("$select","",true,true); |
|
} else { |
|
newSpare.options[0] = new Option("$select","",false,false); |
|
} |
|
for (var m=0; m<okSpares.length; m++) { |
|
var idx = m+1; |
|
var selThis = 0; |
|
if (selIdx != 0) { |
|
if (okSpares[m] == currnew) { |
|
selThis = 1; |
|
} |
|
} |
|
if (selThis == 1) { |
|
newSpare.options[idx] = new Option(okSpares[m],okSpares[m],true,true); |
|
} else { |
|
newSpare.options[idx] = new Option(okSpares[m],okSpares[m],false,false); |
|
} |
|
} |
|
} |
|
return; |
|
} |
|
|
|
function checkNewSpares(lonhost,type) { |
|
var newSpare = document.getElementById('newspare_'+type+'_'+lonhost); |
|
var chosen = newSpare.options[newSpare.selectedIndex].value; |
|
if (chosen != '') { |
|
var othertype; |
|
var othernewSpare; |
|
if (type == 'primary') { |
|
othernewSpare = document.getElementById('newspare_default_'+lonhost); |
|
} |
|
if (type == 'default') { |
|
othernewSpare = document.getElementById('newspare_primary_'+lonhost); |
|
} |
|
if (othernewSpare.options[othernewSpare.selectedIndex].value == chosen) { |
|
othernewSpare.selectedIndex = 0; |
|
} |
|
} |
|
return; |
|
} |
|
|
|
// ]]> |
|
</script> |
|
|
|
END |
|
|
|
} |
|
|
|
sub common_domprefs_js { |
|
return <<"END"; |
|
|
|
<script type="text/javascript"> |
|
// <![CDATA[ |
|
|
function getIndicesByName(formname,item) { |
function getIndicesByName(formname,item) { |
var radiogroup = new Array(); |
var group = new Array(); |
for (var i=0;i<formname.elements.length;i++) { |
for (var i=0;i<formname.elements.length;i++) { |
if (formname.elements[i].name == item) { |
if (formname.elements[i].name == item) { |
radiogroup.push(formname.elements[i].id); |
group.push(formname.elements[i].id); |
} |
} |
} |
} |
return radiogroup; |
return group; |
} |
} |
|
|
// ]]> |
// ]]> |
</script> |
</script> |
|
|
END |
END |
|
|
} |
} |
|
|
1; |
1; |