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

version 1.424, 2009/01/20 18:37:30 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 2294  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 3453  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 4327  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.424  
changed lines
  Added in v.1.432


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