Diff for /loncom/interface/loncommon.pm between versions 1.909 and 1.910

version 1.909, 2009/11/04 14:08:36 version 1.910, 2009/11/04 17:42:17
Line 1942  sub select_level_form { Line 1942  sub select_level_form {
   
 =pod  =pod
   
 =item * &select_dom_form($defdom,$name,$includeempty,$showdomdesc,$onchange)  =item * &select_dom_form($defdom,$name,$includeempty,$showdomdesc,$onchange,$incdoms)
   
 Returns a string containing a <select name='$name' size='1'> form to   Returns a string containing a <select name='$name' size='1'> form to 
 allow a user to select the domain to preform an operation in.    allow a user to select the domain to preform an operation in.  
Line 1953  selected"); Line 1953  selected");
   
 If the $showdomdesc flag is set, the domain name is followed by the domain description.  If the $showdomdesc flag is set, the domain name is followed by the domain description.
   
 The optional $onchange argumnet specifies what should occur if the domain selector is changed, e.g., 'this.form.submit()' if the form is to be automatically submitted.    The optional $onchange argument specifies what should occur if the domain selector is changed, e.g., 'this.form.submit()' if the form is to be automatically submitted.
   
   The optional $incdoms is a reference to an array of domains which will be the only available options. 
   
 =cut  =cut
   
 #-------------------------------------------  #-------------------------------------------
 sub select_dom_form {  sub select_dom_form {
     my ($defdom,$name,$includeempty,$showdomdesc,$onchange) = @_;      my ($defdom,$name,$includeempty,$showdomdesc,$onchange,$incdoms) = @_;
     if ($onchange) {      if ($onchange) {
         $onchange = ' onchange="'.$onchange.'"';          $onchange = ' onchange="'.$onchange.'"';
     }      }
     my @domains = sort {lc($a) cmp lc($b)} (&Apache::lonnet::all_domains());      my @domains;
       if (ref($incdoms) eq 'ARRAY') {
           @domains = sort {lc($a) cmp lc($b)} (@{$incdoms});
       } else {
           @domains = sort {lc($a) cmp lc($b)} (&Apache::lonnet::all_domains());
       }
     if ($includeempty) { @domains=('',@domains); }      if ($includeempty) { @domains=('',@domains); }
     my $selectdomain = "<select name=\"$name\" size=\"1\"$onchange>\n";      my $selectdomain = "<select name=\"$name\" size=\"1\"$onchange>\n";
     foreach my $dom (@domains) {      foreach my $dom (@domains) {

Removed from v.1.909  
changed lines
  Added in v.1.910


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>