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

version 1.424, 2009/01/20 18:37:30 version 1.434, 2009/02/19 10:19:49
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 972  sub print_row { Line 973  sub print_row {
     if ($parmlev eq 'full') {      if ($parmlev eq 'full') {
         $r->print('<td style="background-color:'.$defbgtwo.';" align="center">'          $r->print('<td style="background-color:'.$defbgtwo.';" align="center">'
                   .$$part{$which}.'</td>');                    .$$part{$which}.'</td>');
     } else {          } else {
         $parm=~s|\[.*\]\s||g;          $parm=~s|\[.*\]\s||g;
     }      }
     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 1182  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 1322  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 1969  ENDTABLEHEADFOUR Line 1976  ENDTABLEHEADFOUR
                         if (grep $_ eq $tempkeyp, @catmarker) {                          if (grep $_ eq $tempkeyp, @catmarker) {
                           $part{$_}=&Apache::lonnet::metadata($uri,$_.'.part');                            $part{$_}=&Apache::lonnet::metadata($uri,$_.'.part');
                           $name{$_}=&Apache::lonnet::metadata($uri,$_.'.name');                            $name{$_}=&Apache::lonnet::metadata($uri,$_.'.name');
                           $display{$_}=&Apache::lonnet::metadata($uri,$_.'.display');                            my $parmdis=&Apache::lonnet::metadata($uri,$_.'.display');
                             if ($allparms{$name{$_}} ne '') {
                                 my $identifier;
                                 if ($parmdis =~ /(\s*\[Part.*)$/) {
                                     $identifier = $1;
                                 }
                                 $display{$_} = $allparms{$name{$_}}.$identifier;
                             } else {
                                 $display{$_} = $parmdis;
                             }
                           unless ($display{$_}) { $display{$_}=''; }                            unless ($display{$_}) { $display{$_}=''; }
                           $display{$_}.=' ('.$name{$_}.')';                            $display{$_}.=' ('.$name{$_}.')';
                           $default{$_}=&Apache::lonnet::metadata($uri,$_);                            $default{$_}=&Apache::lonnet::metadata($uri,$_);
Line 2076  ENDTABLEHEADFOUR Line 2092  ENDTABLEHEADFOUR
                       if ((grep $_ eq $fullkeyp, @catmarker) &&(!$name{$tempkeyp})) {                        if ((grep $_ eq $fullkeyp, @catmarker) &&(!$name{$tempkeyp})) {
                         $part{$tempkeyp}="0";                          $part{$tempkeyp}="0";
                         $name{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp.'.name');                          $name{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp.'.name');
                         $display{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp.'.display');                          my $parmdis=&Apache::lonnet::metadata($uri,$fullkeyp.'.display');
                           if ($allparms{$name{$tempkeyp}} ne '') {
                               my $identifier;
                               if ($parmdis =~ /(\s*\[Part.*)$/) {
                                   $identifier = $1;
                               }
                               $display{$tempkeyp} = $allparms{$name{$tempkeyp}}.$identifier;
                           } else {
                               $display{$tempkeyp} = $parmdis;
                           }
                         unless ($display{$tempkeyp}) { $display{$tempkeyp}=''; }                          unless ($display{$tempkeyp}) { $display{$tempkeyp}=''; }
                         $display{$tempkeyp}.=' ('.$name{$tempkeyp}.')';                          $display{$tempkeyp}.=' ('.$name{$tempkeyp}.')';
                         $display{$tempkeyp} =~ s/_\w+_/_0_/;                          $display{$tempkeyp} =~ s/_\w+_/_0_/;
Line 2169  ENDTABLEHEADFOUR Line 2194  ENDTABLEHEADFOUR
                   if ((grep $_ eq $fullkeyp, @catmarker) &&(!$name{$tempkeyp})) {                    if ((grep $_ eq $fullkeyp, @catmarker) &&(!$name{$tempkeyp})) {
                     $part{$tempkeyp}="0";                      $part{$tempkeyp}="0";
                     $name{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp.'.name');                      $name{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp.'.name');
                     $display{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp.'.display');                      my $parmdis=&Apache::lonnet::metadata($uri,$fullkeyp.'.display');
                       if ($allparms{$name{$tempkeyp}} ne '') {
                           my $identifier;
                           if ($parmdis =~ /(\s*\[Part.*)$/) {
                               $identifier = $1;
                           }
                           $display{$tempkeyp} = $allparms{$name{$tempkeyp}}.$identifier;
                       } else {
                           $display{$tempkeyp} = $parmdis;
                       }
                     unless ($display{$tempkeyp}) { $display{$tempkeyp}=''; }                      unless ($display{$tempkeyp}) { $display{$tempkeyp}=''; }
                     $display{$tempkeyp}.=' ('.$name{$tempkeyp}.')';                      $display{$tempkeyp}.=' ('.$name{$tempkeyp}.')';
                     $display{$tempkeyp} =~ s/_\w+_/_0_/;                      $display{$tempkeyp} =~ s/_\w+_/_0_/;
Line 2294  sub crsenv { Line 2328  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 2546  sub crsenv { Line 2580  sub crsenv {
              'externalsyllabus'               'externalsyllabus'
                  => '<b>'.&mt('URL of Syllabus (not using internal handler)').'</b>',                   => '<b>'.&mt('URL of Syllabus (not using internal handler)').'</b>',
      'tthoptions'       'tthoptions'
          => '<b>'.&mt('Default set of options to pass to tth/m when converting tex').'</b>',           => '<b>'.&mt('Default set of options to pass to tth/m when converting TeX').'</b>',
   
      'texengine'       'texengine'
          => '<b>'.&mt('Force all students in the course to use a specific math rendering engine.').'</b><br />'           => '<b>'.&mt('Force all students in the course to use a specific math rendering engine.').'</b><br />'
Line 3453  ENDOVER Line 3487  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 4361  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.434


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