Diff for /loncom/interface/courseprefs.pm between versions 1.6 and 1.8.2.2

version 1.6, 2009/08/19 19:35:00 version 1.8.2.2, 2010/01/03 00:07:02
Line 554  sub process_changes { Line 554  sub process_changes {
                                 if ($newvalues{$ext_entry} ne $values->{$stdrole.'.plaintext'}) {                                  if ($newvalues{$ext_entry} ne $values->{$stdrole.'.plaintext'}) {
                                     my $dupname = 0;                                      my $dupname = 0;
                                     if ($newvalues{$ext_entry} ne '') {                                      if ($newvalues{$ext_entry} ne '') {
                                         my $dupname = 0;  
                                         if (grep(/^\Q$newvalues{$ext_entry}\E$/,@replacements)) {                                          if (grep(/^\Q$newvalues{$ext_entry}\E$/,@replacements)) {
                                             $dupname = 1;                                              $dupname = 1;
                                             push(@{$disallowed->{'rolenames'}{'replacements'}},$newvalues{$ext_entry});                                              push(@{$disallowed->{'rolenames'}{'replacements'}},$newvalues{$ext_entry});
Line 655  sub process_changes { Line 654  sub process_changes {
                             }                              }
                             foreach my $key (keys(%env)) {                              foreach my $key (keys(%env)) {
                                 if ($key =~ /^form\.\Q$entry\E_($match_username:$match_domain)$/) {                                  if ($key =~ /^form\.\Q$entry\E_($match_username:$match_domain)$/) {
                                     if ($env{'form.'.$key}) {                                      if ($env{$key}) {
                                        my $nothide = $1;                                         my $nothide = $1;
                                        if (!grep(/^\Q$nothide\E$/,@new_nothide)) {                                         if (!grep(/^\Q$nothide\E$/,@new_nothide)) {
                                            push(@new_nothide,$nothide);                                              push(@new_nothide,$nothide); 
Line 1641  sub user_table { Line 1640  sub user_table {
     } else {      } else {
         my $num = 0;          my $num = 0;
         my @curr = split(/,/,$currvalue);          my @curr = split(/,/,$currvalue);
         $output .= &Apache::loncommon::start_data_table();          $output .= '<table class="LC_nested_outer">';
         my ($currusers);          my ($currusers);
         foreach my $val (@curr) {          foreach my $val (@curr) {
             next if ($val eq '');              next if ($val eq '');
Line 1672  sub user_table { Line 1671  sub user_table {
             $num ++;              $num ++;
         }          }
         if ($num) {          if ($num) {
             $output .= &Apache::loncommon::start_data_table_row().              $output .= '<tr>'.
                        '<td align="left"><i>';                         '<td align="left"><i>';
             if ($num > 1) {              if ($num > 1) {
                 $output .= $lt->{'currone'};                  $output .= $lt->{'currone'};
Line 1681  sub user_table { Line 1680  sub user_table {
             }              }
             $output .= '</i><br />'.              $output .= '</i><br />'.
                           '<table>'.$currusers.'</table></td>'.                            '<table>'.$currusers.'</table></td>'.
                           &Apache::loncommon::end_data_table_row();                            '</tr>';
         }          }
         $output .= &Apache::loncommon::start_data_table_row().          $output .= '<tr>'.
                   '<td align="left"><span class="LC_nobreak"><i>'.                    '<td align="left"><span class="LC_nobreak"><i>'.
                   $lt->{'add'}.'</i></span><br />'.                    $lt->{'add'}.'</i></span><br />'.
                   &select_recipient($item,$num,$cdom,$sections).                    &select_recipient($item,$num,$cdom,$sections).
                   '<input type="hidden" name="'.$item.'_total" value="'.$num.'" />'.                    '<input type="hidden" name="'.$item.'_total" value="'.$num.'" />'.
                   '</td>'.&Apache::loncommon::end_data_table_row().                    '</td></tr></table>';
                   &Apache::loncommon::end_data_table();  
     }      }
     return $output;      return $output;
 }  }
Line 1700  sub select_recipient { Line 1698  sub select_recipient {
     my $selectlink =      my $selectlink =
         &Apache::loncommon::selectstudent_link('display',$item.'_uname_'.$num,          &Apache::loncommon::selectstudent_link('display',$item.'_uname_'.$num,
                                                $item.'_udom_'.$num,1);                                                 $item.'_udom_'.$num,1);
     my $css_class = ($num % 2)?'LC_even_row':'LC_odd_row';  
     my $output =       my $output = 
         '<table><tr class="'.$css_class.'"><td align="center">'.&mt('Username').'<br />'.          '<table><tr><td align="center">'.&mt('Username').'<br />'.
         '<input type="text" name="'.$item.'_uname_'.$num.'" value="" /></td>'.          '<input type="text" name="'.$item.'_uname_'.$num.'" value="" /></td>'.
         '<td align="center">'.&mt('Domain').'<br />'.$domform.'</td>';          '<td align="center">'.&mt('Domain').'<br />'.$domform.'</td>';
     if (ref($sections) eq 'ARRAY') {      if (ref($sections) eq 'ARRAY') {
Line 1756  sub print_discussion { Line 1753  sub print_discussion {
     }      }
     my %items = (      my %items = (
         'plc.roles.denied' => {          'plc.roles.denied' => {
                    text => '<b>'.&mt($itemtext->{'plc.roles.denied'}).'</b>'.                     text => '<span class="LC_nobreak"><b>'.
                            &Apache::loncommon::help_open_topic("Course_Disable_Discussion").                             &mt($itemtext->{'plc.roles.denied'}).'</b>'.
                              &Apache::loncommon::help_open_topic("Course_Disable_Discussion").'</span><br />'.
                            &mt('(role-based)'),                             &mt('(role-based)'),
                    input => 'checkbox',                     input => 'checkbox',
                  },                   },
Line 1769  sub print_discussion { Line 1767  sub print_discussion {
                  },                   },
   
         'pch.roles.denied'   => {          'pch.roles.denied'   => {
                    text => '<b>'.&mt($itemtext->{'pch.roles.denied'}).'</b>'.                     text => '<span class="LC_nobreak"><b>'.
                            &Apache::loncommon::help_open_topic("Course_Disable_Discussion").'<br />'.                             &mt($itemtext->{'pch.roles.denied'}).'</b>'.
                              &Apache::loncommon::help_open_topic("Course_Disable_Discussion").'</span><br />'.
                            &mt('(role-based)'),                             &mt('(role-based)'),
                    input => 'checkbox',                     input => 'checkbox',
                  },                   },
Line 2053  sub print_grading { Line 2052  sub print_grading {
                    input => 'selectbox',                     input => 'selectbox',
                    options => {                     options => {
                                 standard => &mt('Standard: shows points'),                                  standard => &mt('Standard: shows points'),
                                 external => &mt('External: shows number of completed parts'),                                  external => &mt('External: shows number of completed parts and totals'),
                                   externalnototals => &mt('External: shows only number of completed parts'),
                                 spreadsheet => &mt('Spreadsheet: (with link to detailed scores)'),                                   spreadsheet => &mt('Spreadsheet: (with link to detailed scores)'), 
                               },                                },
                    order => ['standard','external','spreadsheet'],                     order => ['standard','external','externalnototals','spreadsheet'],
                  },                   },
         'rndseed' => {          'rndseed' => {
                    text => '<b>'.&mt($itemtext->{'rndseed'}).'</b>'.                     text => '<b>'.&mt($itemtext->{'rndseed'}).'</b>'.
Line 2411  sub nothidepriv_row { Line 2411  sub nothidepriv_row {
             }              }
         }          }
         if (exists($privileged{$udom}{$uname})) {          if (exists($privileged{$udom}{$uname})) {
             push(@privusers,$user);              unless (grep(/^\Q$user\E$/,@privusers)) {
                   push(@privusers,$user);
               }
         }          }
     }      }
     if (@privusers) {      if (@privusers) {
Line 2431  sub nothidepriv_row { Line 2433  sub nothidepriv_row {
                           '</td><td align="left">'.                            '</td><td align="left">'.
                           '<span class="LC_nobreak"><label>'.                            '<span class="LC_nobreak"><label>'.
                           '<input type="radio" name="'.$item.'_'.$user.'"'.                            '<input type="radio" name="'.$item.'_'.$user.'"'.
                           $hideon.' value="yes" />'.&mt('Hidden').'</label>&nbsp;'.                            $hideon.' value="" />'.&mt('Hidden').'</label>&nbsp;'.
                           '<label><input type="radio" name="'.$item.'_'.$user.'"'.                          $hideoff.' value="" />'.&mt('Shown').'</label></span></td>'.                            '<label><input type="radio" name="'.$item.'_'.$user.'"'.                          $hideoff.' value="yes" />'.&mt('Shown').'</label></span></td>'.
                           '</tr>';                            '</tr>';
         }          }
         $datatable .= '</table>';          $datatable .= '</table>';
Line 2514  function getIndexByName(item) { Line 2516  function getIndexByName(item) {
 </script>  </script>
   
 ENDJS  ENDJS
     $output .= $currstr.&Apache::loncommon::start_data_table();      $output .= $currstr.'<table class="LC_nested_outer">';
     if (@curr > 0) {      if (@curr > 0) {
         for (my $i=0; $i<@curr; $i++) {          for (my $i=0; $i<@curr; $i++) {
             my $pos = $i+1;              my $pos = $i+1;
             $output .= &Apache::loncommon::start_data_table_row().              $output .= '<tr>'.
                        '<td align="left"><span class="LC_nobreak">'.                         '<td align="left"><span class="LC_nobreak">'.
                        &position_selector($pos,$i,$maxnum).&mt('Delete:').                         &position_selector($pos,$i,$maxnum).&mt('Delete:').
                        '<input type="checkbox" name="printfmthdr_del_'.$i.                         '<input type="checkbox" name="printfmthdr_del_'.$i.
Line 2532  ENDJS Line 2534  ENDJS
                            '<input type="textbox" name="printfmthdr_text_'.$i.'"'.                             '<input type="textbox" name="printfmthdr_text_'.$i.'"'.
                            ' value="'.$curr[$i].'" size="25" /></td>';                             ' value="'.$curr[$i].'" size="25" /></td>';
             }              }
             $output .= &Apache::loncommon::end_data_table_row();              $output .= '</tr>';
         }          }
     }      }
     my $pos = $currnum+1;       my $pos = $currnum+1; 
     $output .= &Apache::loncommon::start_data_table_row().      $output .= '<tr>'.
                '<td align="left"><span class="LC_nobreak">'.                 '<td align="left"><span class="LC_nobreak">'.
                &position_selector($pos,$currnum,$maxnum).                 &position_selector($pos,$currnum,$maxnum).
                '<b>'.&mt('New').'</b></span></td><td align="left">'.                 '<b>'.&mt('New').'</b></span></td><td align="left">'.
                &substitution_selector($currnum).'</td>'.                 &substitution_selector($currnum).'</td>'.
                &Apache::loncommon::end_data_table_row();                 '</tr>';
     $pos ++;      $pos ++;
     $currnum ++;      $currnum ++;
     $output .= &Apache::loncommon::start_data_table_row().      $output .= '<tr>'.
                '<td align="left"><span class="LC_nobreak">'.                 '<td align="left"><span class="LC_nobreak">'.
                &position_selector($pos,$currnum,$maxnum).                 &position_selector($pos,$currnum,$maxnum).
                '<b>'.&mt('New').'</b></span></td>'.                 '<b>'.&mt('New').'</b></span></td>'.
Line 2553  ENDJS Line 2555  ENDJS
                '" value="" size ="25" />'.                 '" value="" size ="25" />'.
                '<input type="hidden" name="printfmthdr_maxnum" value="'.                 '<input type="hidden" name="printfmthdr_maxnum" value="'.
                 $maxnum.'" /></td>'.                  $maxnum.'" /></td>'.
                &Apache::loncommon::end_data_table_row().                 '</tr>'.
                &Apache::loncommon::end_data_table();                  '</table>';
     return $output;      return $output;
 }  }
   

Removed from v.1.6  
changed lines
  Added in v.1.8.2.2


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