Diff for /loncom/interface/lonparmset.pm between versions 1.317 and 1.323

version 1.317, 2006/06/23 05:56:35 version 1.323, 2006/07/14 18:49:06
Line 508  sub storeparm_by_symb_inner { Line 508  sub storeparm_by_symb_inner {
   
 Format a value for output.  Format a value for output.
   
 Inputs:  $value, $type  Inputs:  $value, $type, $editable
   
 Returns: $value, formatted for output.  If $type indicates it is a date,  Returns: $value, formatted for output.  If $type indicates it is a date,
 localtime($value) is returned.  localtime($value) is returned.
   $editable will return an icon to click on
   
 =cut  =cut
   
 ##################################################  ##################################################
 ##################################################  ##################################################
 sub valout {  sub valout {
     my ($value,$type)=@_;      my ($value,$type,$editable)=@_;
     my $result = '';      my $result = '';
     # Values of zero are valid.      # Values of zero are valid.
     if (! $value && $value ne '0') {      if (! $value && $value ne '0') {
  $result = '  ';   if ($editable) {
       $result = '<img src="/adm/lonIcons/clickhere.gif" border="0" />';
    } else {
       $result='&nbsp;';
    }
     } else {      } else {
         if ($type eq 'date_interval') {          if ($type eq 'date_interval') {
             my ($sec,$min,$hour,$mday,$mon,$year)=gmtime($value);              my ($sec,$min,$hour,$mday,$mon,$year)=gmtime($value);
Line 590  sub plink { Line 595  sub plink {
     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="'.$marker.'" /></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($value,$type).'</a></td></tr></table>';   &valout($value,$type,1).'</a></td></tr></table>';
 }  }
   
 sub page_js {  sub page_js {
Line 655  sub startpage { Line 660  sub startpage {
        &page_js(),         &page_js(),
        {'add_entries' => \%loaditems,});         {'add_entries' => \%loaditems,});
     my $breadcrumbs =       my $breadcrumbs = 
  &Apache::lonhtmlcommon::breadcrumbs('Table Mode Parameter Setting');   &Apache::lonhtmlcommon::breadcrumbs('Table Mode Parameter Setting','Table_Mode');
     $r->print(<<ENDHEAD);      $r->print(<<ENDHEAD);
 $start_page  $start_page
 $breadcrumbs  $breadcrumbs
Line 2187  sub crsenv { Line 2192  sub crsenv {
                     ' ('.&mt('supported types').': Letter [8 1/2x11 in], Legal [8 1/2x14 in],'.                       ' ('.&mt('supported types').': Letter [8 1/2x11 in], Legal [8 1/2x14 in],'. 
                     ' Tabloid [11x17 in], Executive [7 1/2x10 in], A2 [420x594 mm],'.                       ' Tabloid [11x17 in], Executive [7 1/2x10 in], A2 [420x594 mm],'. 
                     ' A3 [297x420 mm], A4 [210x297 mm], A5 [148x210 mm], A6 [105x148 mm])',                      ' A3 [297x420 mm], A4 [210x297 mm], A5 [148x210 mm], A6 [105x148 mm])',
        'print_header_format'
            => '<b>Print header format; substitutions:  %n student name %c course id %a assignment',
              'anonymous_quiz'               'anonymous_quiz'
                  => '<b>'.&mt('Anonymous quiz/exam').'</b><br />'.                   => '<b>'.&mt('Anonymous quiz/exam').'</b><br />'.
                     ' (<tt><b>'.&mt('yes').'</b> '.&mt('to avoid print students names').' </tt>)',                      ' (<tt><b>'.&mt('yes').'</b> '.&mt('to avoid print students names').' </tt>)',
Line 2227  sub crsenv { Line 2234  sub crsenv {
                              'problem_stream_switch',                               'problem_stream_switch',
      'suppress_tries',       'suppress_tries',
                              'default_paper_size',                               'default_paper_size',
        'print_header_format',
                              'disable_receipt_display',                               'disable_receipt_display',
                              'spreadsheet_default_classcalc',                               'spreadsheet_default_classcalc',
                              'spreadsheet_default_studentcalc',                               'spreadsheet_default_studentcalc',
Line 2302  sub crsenv { Line 2310  sub crsenv {
  '</script>';   '</script>';
           
     my $start_page =       my $start_page = 
  &Apache::loncommon::start_page('Set Course Environment Parameters',   &Apache::loncommon::start_page('Set Course Environment',
        $browse_js);         $browse_js);
     my $end_page =       my $end_page = 
  &Apache::loncommon::end_page();   &Apache::loncommon::end_page();
Line 3000  ENDMAINFORMHEAD Line 3008  ENDMAINFORMHEAD
     my $vgr  = &Apache::lonnet::allowed('vgr',$env{'request.course.id'});      my $vgr  = &Apache::lonnet::allowed('vgr',$env{'request.course.id'});
   
     my @menu =      my @menu =
         (          ( { divider=>'Settings for Your Course',
           { text => 'Set Course Environment Parameters',    },
             { text => 'Set Course Environment',
     action => 'crsenv',      action => 'crsenv',
             permission => $parm_permission,              permission => $parm_permission,
             },              },
Line 3013  ENDMAINFORMHEAD Line 3022  ENDMAINFORMHEAD
     url => '/adm/slotrequest?command=showslots',      url => '/adm/slotrequest?command=showslots',
     permission => $vgr,      permission => $vgr,
             },              },
   { divider => 1,            { text => 'Set Parameter Setting Default Actions',
               action => 'setdefaults',
               permission => $parm_permission,
               },          
     { divider => 'New and Existing Parameter Settings for Your Resources',
     },      },
           { text => 'Set/Modify Resource Parameters - Helper Mode',            { text => 'Set/Modify Resource Parameters - Helper Mode',
             url => '/adm/helper/parameter.helper',              url => '/adm/helper/parameter.helper',
             permission => $parm_permission,              permission => $parm_permission,
             },              },
           { text => 'Modify Resource Parameters - Overview Mode',     { text => 'Set/Modify Resource Parameters - Overview Mode',
             action => 'setoverview',  
             permission => $parm_permission,  
             },            
   { text => 'Set Resource Parameters - Overview Mode',  
             action => 'newoverview',              action => 'newoverview',
             permission => $parm_permission,              permission => $parm_permission,
             },              },
Line 3032  ENDMAINFORMHEAD Line 3041  ENDMAINFORMHEAD
             permission => $parm_permission,              permission => $parm_permission,
             help => 'Cascading_Parameters',              help => 'Cascading_Parameters',
             },              },
           { text => 'Set Parameter Setting Default Actions',             { divider => 'Existing Parameter Settings for Your Resources',
             action => 'setdefaults',    },
     { text => 'Modify Resource Parameters - Overview Mode',
               action => 'setoverview',
             permission => $parm_permission,              permission => $parm_permission,
             },                 },          
   { text => 'Parameter Change Log and Course Blog Posting/User Notification',    { text => 'Parameter Change Log and Course Blog Posting/User Notification',
             action => 'parameterchangelog',              action => 'parameterchangelog',
             permission => $parm_permission,              permission => $parm_permission,
Line 3044  ENDMAINFORMHEAD Line 3055  ENDMAINFORMHEAD
     my $menu_html = '';      my $menu_html = '';
     foreach my $menu_item (@menu) {      foreach my $menu_item (@menu) {
  if ($menu_item->{'divider'}) {   if ($menu_item->{'divider'}) {
     $menu_html .= '<hr />';      $menu_html .= '<h3>'.&mt($menu_item->{'divider'}).'</h3>';
     next;      next;
  }   }
         next if (! $menu_item->{'permission'});          next if (! $menu_item->{'permission'});
Line 3245  ENDDEFHEAD Line 3256  ENDDEFHEAD
     }      }
 $r->print(&mt('Manual setting rules apply to all interfaces.').'<br />'.  $r->print(&mt('Manual setting rules apply to all interfaces.').'<br />'.
   &mt('Automatic setting rules apply to table mode interfaces only.'));    &mt('Automatic setting rules apply to table mode interfaces only.'));
     $r->print("\n<table border='1'><tr><th>".&mt('Rule for parameter').'</th><th>'.      $r->print("\n".&Apache::loncommon::start_data_table().
       &mt('Action').'</th><th>'.&mt('Value').'</th></tr>');        &Apache::loncommon::start_data_table_header_row().
         "<th>".&mt('Rule for parameter').'</th><th>'.
         &mt('Action').'</th><th>'.&mt('Value').'</th>'.
         &Apache::loncommon::end_data_table_header_row());
     foreach my $tempkey (&keysindisplayorder(\%allparms,\%keyorder)) {      foreach my $tempkey (&keysindisplayorder(\%allparms,\%keyorder)) {
  unless ($tempkey) { next; }   unless ($tempkey) { next; }
  $r->print("\n<tr><td>".$allparms{$tempkey}."\n<br />(".$tempkey.')</td><td>');   $r->print("\n".&Apache::loncommon::start_data_table_row().
     "<td>".$allparms{$tempkey}."\n<br />(".$tempkey.')</td><td>');
  my $action=&rulescache($tempkey.'_action');   my $action=&rulescache($tempkey.'_action');
  $r->print('<select name="'.$tempkey.'_action">');   $r->print('<select name="'.$tempkey.'_action">');
  if (&isdateparm($defkeytype{$tempkey})) {   if (&isdateparm($defkeytype{$tempkey})) {
Line 3298  ENDYESNO Line 3313  ENDYESNO
         } else {          } else {
     $r->print('<input type="text" size="20" name="'.$tempkey.'_value" value="'.&rulescache($tempkey.'_value').'" />');      $r->print('<input type="text" size="20" name="'.$tempkey.'_value" value="'.&rulescache($tempkey.'_value').'" />');
  }   }
         $r->print('</td></tr>');          $r->print('</td>'.&Apache::loncommon::end_data_table_row());
     }      }
     $r->print("</table>\n<input type='submit' name='storerules' value='".      $r->print(&Apache::loncommon::end_data_table().
         "\n<input type='submit' name='storerules' value='".
       &mt('Store Rules')."' /></form>\n".        &mt('Store Rules')."' /></form>\n".
       &Apache::loncommon::end_page());        &Apache::loncommon::end_page());
     return;      return;

Removed from v.1.317  
changed lines
  Added in v.1.323


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