Diff for /loncom/interface/lonparmset.pm between versions 1.422 and 1.432

version 1.422, 2009/01/20 18:05:55 version 1.432, 2009/02/15 17:19:39
Line 848  sub plink { Line 848  sub plink {
     my ($hour,$min,$sec,$val)=&preset_defaults($parmname);      my ($hour,$min,$sec,$val)=&preset_defaults($parmname);
     unless (defined($winvalue)) { $winvalue=$val; }      unless (defined($winvalue)) { $winvalue=$val; }
     my $valout = &valout($value,$type,1);      my $valout = &valout($value,$type,1);
       my $unencmarker = $marker;
     foreach my $item (\$type, \$dis, \$winvalue, \$marker, \$return, \$call,      foreach my $item (\$type, \$dis, \$winvalue, \$marker, \$return, \$call,
       \$hour, \$min, \$sec) {        \$hour, \$min, \$sec) {
  $$item = &HTML::Entities::encode($$item,'"<>&');   $$item = &HTML::Entities::encode($$item,'"<>&');
  $$item =~ s/\'/\\\'/g;   $$item =~ s/\'/\\\'/g;
     }      }
     return '<table width="100%"><tr valign="top" align="right"><td><a name="'.$marker.'" /></td></tr><tr><td align="center">'.      return '<table width="100%"><tr valign="top" align="right"><td><a name="'.$unencmarker.'" /></td></tr><tr><td align="center">'.
  '<a href="javascript:pjump('."'".$type."','".$dis."','".$winvalue."','"   '<a href="javascript:pjump('."'".$type."','".$dis."','".$winvalue."','"
     .$marker."','".$return."','".$call."','".$hour."','".$min."','".$sec."'".');">'.      .$marker."','".$return."','".$call."','".$hour."','".$min."','".$sec."'".');">'.
     $valout.'</a></td></tr></table>';      $valout.'</a></td></tr></table>';
Line 974  sub print_row { Line 975  sub print_row {
                   .$$part{$which}.'</td>');                    .$$part{$which}.'</td>');
     } else {          } else {    
         $parm=~s|\[.*\]\s||g;          $parm=~s|\[.*\]\s||g;
           $parm=&mt($parm);
     }      }
     my $automatic=&rulescache(($which=~/\_([^\_]+)$/)[0].'_triggers');      my $automatic=&rulescache(($which=~/\_([^\_]+)$/)[0].'_triggers');
     if ($automatic) {      if ($automatic) {
  $parm.='<span class="LC_warning"><br />'.&mt('Automatically sets').' '.join(', ',split(/\:/,$automatic)).'</span>';   $parm.='<span class="LC_warning"><br />'.&mt('Automatically sets').' '.join(', ',split(/\:/,$automatic)).'</span>';
     }      }
     $r->print('<td style="background-color:'.$defbgone.';">'.$parm.'</td>');      $r->print('<td>'.$parm.'</td>');
         
     my $thismarker=$which;      my $thismarker=$which;
     $thismarker=~s/^parameter\_//;      $thismarker=~s/^parameter\_//;
Line 1181  sub extractResourceInformation { Line 1183  sub extractResourceInformation {
 #  #
     my $name=&Apache::lonnet::metadata($srcf,$key.'.name');      my $name=&Apache::lonnet::metadata($srcf,$key.'.name');
     if (!exists($$allparms{$name}) || $$allparms{$name} =~ m/^\s*$/ ) {      if (!exists($$allparms{$name}) || $$allparms{$name} =~ m/^\s*$/ ) {
  my $display= &Apache::lonnet::metadata($srcf,$key.'.display');   my ($display,$parmdis);
  my $parmdis = $display;   $display = &standard_parameter_names($name);
  $parmdis =~ s/\s*\[Part.*$//g;   if ($display eq '') {
       $display= &Apache::lonnet::metadata($srcf,$key.'.display');
       $parmdis = $display;
       $parmdis =~ s/\s*\[Part.*$//g;
    } else {
       $parmdis = $display;
    }
  $$allparms{$name}=$parmdis;   $$allparms{$name}=$parmdis;
  if (ref($defkeytype)) {   if (ref($defkeytype)) {
     $$defkeytype{$name}=      $$defkeytype{$name}=
Line 1315  ENDSCRIPT Line 1323  ENDSCRIPT
  if ($$pscat[0] eq "all" || grep $_ eq $tempkey, @{$pscat}) {   if ($$pscat[0] eq "all" || grep $_ eq $tempkey, @{$pscat}) {
     $r->print(' checked="checked"');      $r->print(' checked="checked"');
  }   }
  $r->print('>'.($$allparms{$tempkey}=~/\S/ ? &mt($$allparms{$tempkey})          $r->print(' />'.($$allparms{$tempkey}=~/\S/ ? $$allparms{$tempkey}
                                   : &mt($tempkey))                                                    : $tempkey)
   .'</label></td>');                    .'</label></td>');
   $cnt++;    $cnt++;
         if ($cnt==3) {          if ($cnt==3) {
     $r->print("</tr>\n<tr>");      $r->print("</tr>\n<tr>");
Line 1816  sub assessparms { Line 1824  sub assessparms {
     if (!$pssymb) {      if (!$pssymb) {
         $r->print('<table border="1"><tr><td>');          $r->print('<table border="1"><tr><td>');
         &levelmenu($r,\%alllevs,$parmlev);          &levelmenu($r,\%alllevs,$parmlev);
           $r->print('</td>');
  if ($parmlev ne 'general') {   if ($parmlev ne 'general') {
             $r->print('<td>');              $r->print('<td>');
     &mapmenu($r,\%allmaps,$pschp,\%maptitles);      &mapmenu($r,\%allmaps,$pschp,\%maptitles);
     $r->print('</td>');      $r->print('</td>');
  }   }
         $r->print('</td></tr></table>');          $r->print('</tr></table>');
  &displaymenu($r,\%allparms,\%allparts,\@pscat,\@psprt,\%keyorder);   &displaymenu($r,\%allparms,\%allparts,\@pscat,\@psprt,\%keyorder);
     } else {      } else {
         my ($map,$id,$resource)=&Apache::lonnet::decode_symb($pssymb);          my ($map,$id,$resource)=&Apache::lonnet::decode_symb($pssymb);
Line 2293  sub crsenv { Line 2302  sub crsenv {
  my ($name,$domain) = split(':',$user);   my ($name,$domain) = split(':',$user);
  if (!defined($user) || !defined($domain)) {   if (!defined($user) || !defined($domain)) {
     $setoutput.= '<br /> <span class="LC_error">'.      $setoutput.= '<br /> <span class="LC_error">'.
  &mt("Invalid email address specified, address must be of the form username:domain what was specified was ([_1])",$user).   &mt("Invalid e-mail address specified, address must be of the form username:domain what was specified was ([_1])",$user).
  '</span>';   '</span>';
     undef($value);      undef($value);
  } elsif (&Apache::lonnet::homeserver($user,$domain) eq 'no_host') {   } elsif (&Apache::lonnet::homeserver($user,$domain) eq 'no_host') {
     $setoutput.= '<br /> <span class="LC_error">'.      $setoutput.= '<br /> <span class="LC_error">'.
  &mt("Invalid email address specified, user [_1] is unknown.",$name).   &mt("Invalid e-mail address specified, user [_1] is unknown.",$name).
  '</span>';   '</span>';
     undef($value);      undef($value);
  }   }
Line 3140  sub listdata { Line 3149  sub listdata {
  $r->print(&default_selector($thiskey,$$resourcedata{$thiskey}));   $r->print(&default_selector($thiskey,$$resourcedata{$thiskey}));
     }      }
     $r->print('<input type="hidden" name="typeof_'.$thiskey.'" value="'.      $r->print('<input type="hidden" name="typeof_'.$thiskey.'" value="'.
       $thistype.'">');        $thistype.'" />');
     $r->print('</td>'.&Apache::loncommon::end_data_table_row());      $r->print('</td>'.&Apache::loncommon::end_data_table_row());
  }   }
     }      }
Line 3452  ENDOVER Line 3461  ENDOVER
     my $foundkeys=&listdata($r,$resourcedata,$resourcedata,$sortorder);      my $foundkeys=&listdata($r,$resourcedata,$resourcedata,$sortorder);
   
     $r->print(&tableend().'<p>'.      $r->print(&tableend().'<p>'.
  ($foundkeys?'<input type="submit" value="'.&mt('Modify Parameters').'" />':&mt('There are no parameters.')).'</p></form>'.   ($foundkeys?'<input type="submit" value="'.&mt('Save').'" />':&mt('There are no parameters.')).'</p></form>'.
       &Apache::loncommon::end_page());        &Apache::loncommon::end_page());
 }  }
   
Line 3885  sub output_row { Line 3894  sub output_row {
         my $single_checked;          my $single_checked;
         if ($options =~ m/onlyone/) {          if ($options =~ m/onlyone/) {
             $multiple_checked = '';              $multiple_checked = '';
             $single_checked = ' checked="checked" ';              $single_checked = ' checked="checked"';
         } else {          } else {
             $multiple_checked = ' checked="checked" ';              $multiple_checked = ' checked="checked"';
             $single_checked = '';              $single_checked = '';
         }          }
  $output .= &Apache::loncommon::continue_data_table_row();   $output .= &Apache::loncommon::continue_data_table_row();
  $output .= '<td>'.('&nbsp;' x 10).'<span class="LC_metadata">   $output .= '<td>'.('&nbsp;' x 10).'<span class="LC_metadata">
             <input type="radio" name="'.$field_name.'_onlyone" value="multiple" '.$multiple_checked .'/>              <input type="radio" name="'.$field_name.'_onlyone" value="multiple"'.$multiple_checked .' />
             '.&mt('Student may select multiple choices from list').'</span></td>';              '.&mt('Student may select multiple choices from list').'</span></td>';
  $output .= &Apache::loncommon::end_data_table_row();   $output .= &Apache::loncommon::end_data_table_row();
  $output .= &Apache::loncommon::continue_data_table_row();   $output .= &Apache::loncommon::continue_data_table_row();
  $output .= '<td>'.('&nbsp;' x 10).'<span class="LC_metadata">   $output .= '<td>'.('&nbsp;' x 10).'<span class="LC_metadata">
             <input type="radio" name="'.$field_name.'_onlyone"  value="single" '.$single_checked.'/>              <input type="radio" name="'.$field_name.'_onlyone"  value="single"'.$single_checked.' />
             '.&mt('Student may select only one choice from list').'</span></td>';              '.&mt('Student may select only one choice from list').'</span></td>';
  $output .= &Apache::loncommon::end_data_table_row();   $output .= &Apache::loncommon::end_data_table_row();
     }      }
Line 4326  ENDYESNO Line 4335  ENDYESNO
     }      }
     $r->print(&Apache::loncommon::end_data_table().      $r->print(&Apache::loncommon::end_data_table().
       "\n".'<input type="submit" name="storerules" value="'.        "\n".'<input type="submit" name="storerules" value="'.
       &mt('Save Rules').'" /></form>'."\n".        &mt('Save').'" /></form>'."\n".
       &Apache::loncommon::end_page());        &Apache::loncommon::end_page());
     return;      return;
 }  }

Removed from v.1.422  
changed lines
  Added in v.1.432


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