Diff for /loncom/interface/courseprefs.pm between versions 1.28.2.12 and 1.49.2.4

version 1.28.2.12, 2012/04/11 13:02:39 version 1.49.2.4, 2012/12/31 14:50:07
Line 215  use Apache::lonnet; Line 215  use Apache::lonnet;
 use Apache::loncommon();  use Apache::loncommon();
 use Apache::lonhtmlcommon();  use Apache::lonhtmlcommon();
 use Apache::lonconfigsettings;  use Apache::lonconfigsettings;
   use Apache::lonparmset;
 use Apache::lonlocal;  use Apache::lonlocal;
 use LONCAPA qw(:DEFAULT :match);  use LONCAPA qw(:DEFAULT :match);
   
Line 267  sub handler { Line 268  sub handler {
     my %lt;      my %lt;
     if ($crstype eq 'Community') {      if ($crstype eq 'Community') {
         %lt = (          %lt = (
                 conf => 'Community Configuration',                  conf => 'Community Settings',
                 edit => 'Edit Community Configuration',                  edit => 'Edit Community Settings',
                 gens => 'General community settings',                  gens => 'General community settings',
                 idnu => 'Community ID or number',                  idnu => 'Community ID or number',
                 desc => 'Community Description',                  desc => 'Community Description',
Line 286  sub handler { Line 287  sub handler {
                 defd => 'Default dates for member access',                  defd => 'Default dates for member access',
                 stuv => 'Member-viewable membership list options',                  stuv => 'Member-viewable membership list options',
                 stul => 'Member agreement needed to be listed',                  stul => 'Member agreement needed to be listed',
                 clas => 'Membership and Facilitator Listing',                  clas => 'Membership and facilitator listing',
                 priv => 'Privileged users (Domain Coordinators) in facilitator listing',                  priv => 'Privileged users (Domain Coordinators) in facilitator listing',
                 defc => 'Default Community Spreadsheet',                  defc => 'Default Community Spreadsheet',
                 defs => 'Default User Spreadsheet',                  defs => 'Default User Spreadsheet',
Line 294  sub handler { Line 295  sub handler {
               );                );
     } else {      } else {
         %lt = (          %lt = (
                 conf => 'Course Configuration',                  conf => 'Course Settings',
                 edit => 'Edit Course Configuration',                  edit => 'Edit Course Settings',
                 gens => 'General course settings',                  gens => 'General course settings',
                 idnu => 'Course ID or number',                  idnu => 'Course ID or number',
                 desc => 'Course Description',                  desc => 'Course Description',
Line 313  sub handler { Line 314  sub handler {
                 defd => 'Default dates for student access',                  defd => 'Default dates for student access',
                 stuv => 'Student-viewable classlist options',                  stuv => 'Student-viewable classlist options',
                 stul => 'Student agreement needed to be listed',                  stul => 'Student agreement needed to be listed',
                 clas => 'Classlists and Staff Listing',                  clas => 'Classlists and staff listing',
                 priv => 'Privileged users (Domain Coordinators) in staff listing',                  priv => 'Privileged users (Domain Coordinators) in staff listing',
                 defc => 'Default Course Spreadsheet',                  defc => 'Default Course Spreadsheet',
                 defs => 'Default Student Spreadsheet',                  defs => 'Default Student Spreadsheet',
Line 338  sub handler { Line 339  sub handler {
   
     if ($phase eq 'releaseinfo') {      if ($phase eq 'releaseinfo') {
         my $loncaparev = $env{'course.'.$cid.'.internal.releaserequired'};          my $loncaparev = $env{'course.'.$cid.'.internal.releaserequired'};
         if ($loncaparev) {          if ($loncaparev) { 
             &display_loncaparev_constraints($r,$navmap,$loncaparev,$crstype);              &display_loncaparev_constraints($r,$navmap,$loncaparev,$crstype);
             return OK;              return OK;
         }          }
Line 352  sub handler { Line 353  sub handler {
     my %prefs = (      my %prefs = (
         'courseinfo' =>          'courseinfo' =>
                    { text => $lt{'gens'},                     { text => $lt{'gens'},
                      help => 'Course_Environment',                       help => 'Course_Prefs_General',
                      header => [{col1 => 'Setting',  
                                  col2 => 'Value'}],  
                      ordered => ['owner','co-owners','loncaparev','description',                       ordered => ['owner','co-owners','loncaparev','description',
                                  'courseid','categories','hidefromcat',                                   'courseid','categories','hidefromcat',
                                  'externalsyllabus','cloners','url','rolenames'],                                   'externalsyllabus','cloners','url','rolenames'],
Line 373  sub handler { Line 372  sub handler {
                                  },                                   },
                     },                      },
         'localization' =>          'localization' =>
                     { text => 'Language and Time Localization',                      { text => 'Language and time localization',
                       help => 'Course_Environment',                        help => 'Course_Prefs_Language',
                       header => [{col1 => 'Setting',  
                                   col2 => 'Value',}],  
                       ordered => ['languages','timezone','datelocale'],                        ordered => ['languages','timezone','datelocale'],
                       itemtext => {                        itemtext => {
                                     languages  => 'Languages used',                                      languages  => 'Languages used',
Line 386  sub handler { Line 383  sub handler {
                     },                      },
         'feedback' =>          'feedback' =>
                     { text => 'Feedback messages',                      { text => 'Feedback messages',
                       help => 'Course_Environment',                        help => 'Course_Prefs_Feedback',
                       header => [{col1 => 'Questions about:',                        header => [{col1 => 'Questions about:',
                                   col2 => 'Recipients'},                                    col2 => 'Recipients'}],
                                  {col1 => 'Questions about:',  
                                   col2 => 'Custom Text'}],  
                       ordered => ['question.email','comment.email','policy.email'],                        ordered => ['question.email','comment.email','policy.email'],
                       itemtext => {                        itemtext => {
                                      'question.email' => 'Resource Content',                                       'question.email' => 'Resource Content',
Line 400  sub handler { Line 395  sub handler {
                     },                      },
         'discussion' =>          'discussion' =>
                     { text => 'Discussion and Chat',                      { text => 'Discussion and Chat',
                       help => 'Course_Environment',                        help => 'Course_Prefs_Discussions',
                       ordered => ['pch.roles.denied','pch.users.denied',                        ordered => ['pch.roles.denied','pch.users.denied',
                                   'plc.roles.denied','plc.users.denied',                                    'plc.roles.denied','plc.users.denied',
                                   'allow_limited_html_in_feedback',                                    'allow_limited_html_in_feedback',
                                   'allow_discussion_post_editing'],                                    'allow_discussion_post_editing',
                                     'discussion_post_fonts'],
                       itemtext => {                        itemtext => {
                          'pch.roles.denied'             => 'No Resource Discussion',                           'pch.roles.denied'             => 'No Resource Discussion',
                          'pch.users.denied'             => 'No Resource Discussion',                           'pch.users.denied'             => 'No Resource Discussion',
Line 412  sub handler { Line 408  sub handler {
                          'plc.users.denied'             => 'No Chat room use',                           'plc.users.denied'             => 'No Chat room use',
                          allow_limited_html_in_feedback => 'Allow limited HTML in discussion',                           allow_limited_html_in_feedback => 'Allow limited HTML in discussion',
                          allow_discussion_post_editing  => 'Users can edit/delete own discussion posts',                           allow_discussion_post_editing  => 'Users can edit/delete own discussion posts',
                            discussion_post_fonts       => 'Discussion post fonts based on likes/unlikes',
                                   },                                    },
                     },                      },
         'classlists' =>          'classlists' =>
                    { text => $lt{'clas'},                     { text => $lt{'clas'},
                      help => 'Course_Environment',                       help => 'Course_Prefs_Classlists',
                      header => [{col1 => 'Type',                       header => [{col1 => 'Type',
                                  col2 => $lt{'defd'}},                                   col2 => $lt{'defd'}},
                                 {col1 => 'Setting',                                  {col1 => 'Setting',
Line 438  sub handler { Line 435  sub handler {
                    },                     },
         'appearance' =>          'appearance' =>
                    { text => 'Display of resources ',                     { text => 'Display of resources ',
                      help => 'Course_Environment',                       help => 'Course_Prefs_Display',
                      header => [{col1 => 'Setting',  
                                  col2 => 'Value',}],  
                      ordered => ['default_xml_style','pageseparators',                       ordered => ['default_xml_style','pageseparators',
                                  'disable_receipt_display','texengine',                                   'disable_receipt_display','texengine',
                                  'tthoptions'],                                   'tthoptions'],
Line 454  sub handler { Line 449  sub handler {
                   },                    },
         'grading' =>          'grading' =>
                   { text => 'Grading',                    { text => 'Grading',
                     help => 'Course_Environment',                      help => 'Course_Prefs_Grading',
                     header => [{col1 => 'Setting',  
                                 col2 => 'Value',}],  
                     ordered => ['grading','rndseed',                      ordered => ['grading','rndseed',
                                 'receiptalg','disablesigfigs'],                                  'receiptalg','disablesigfigs'],
                     itemtext => {                      itemtext => {
Line 469  sub handler { Line 462  sub handler {
                   },                    },
         'printouts' =>          'printouts' =>
                   { text => 'Printout generation',                    { text => 'Printout generation',
                     help => 'Course_Environment',                      help => 'Course_Prefs_Printouts',
                     header => [{col1 => 'Setting',  
                                 col2 => 'Value',}],  
                     ordered => ['problem_stream_switch','suppress_tries',                      ordered => ['problem_stream_switch','suppress_tries',
                                 'default_paper_size','print_header_format',                                  'default_paper_size','print_header_format',
                                 'disableexampointprint'],                                  'disableexampointprint'],
Line 480  sub handler { Line 471  sub handler {
                         suppress_tries        => 'Suppress number of tries in printing',                          suppress_tries        => 'Suppress number of tries in printing',
                         default_paper_size    => 'Default paper type',                          default_paper_size    => 'Default paper type',
                         print_header_format   => 'Print header format',                          print_header_format   => 'Print header format',
                         disableexampointprint => 'Disable automatically printing point values on exams',                          disableexampointprint => 'Disable automatically printing point values on bubblesheet exams',
                         canuse_pdfforms    => 'Users can print problems as PDF forms and upload later for grading',                          canuse_pdfforms    => 'Users can print problems as PDF forms and upload later for grading',
                                 },                                  },
                   },                    },
         'spreadsheet' =>          'spreadsheet' =>
                   { text => 'Spreadsheets',                    { text => 'Spreadsheets',
                     help => 'Course_Environment',                      help => 'Course_Prefs_Spreadsheet',
                     header => [{col1 => 'Setting',  
                                 col2 => 'Value'}],  
                     ordered => ['spreadsheet_default_classcalc',                      ordered => ['spreadsheet_default_classcalc',
                                 'spreadsheet_default_studentcalc',                                  'spreadsheet_default_studentcalc',
                                 'spreadsheet_default_assesscalc','hideemptyrows'],                                  'spreadsheet_default_assesscalc','hideemptyrows'],
Line 501  sub handler { Line 490  sub handler {
                   },                    },
         'bridgetasks' =>          'bridgetasks' =>
                   { text => 'Bridge tasks',                    { text => 'Bridge tasks',
                     help => 'Course_Environment',                      help => 'Course_Prefs_Bridgetasks',
                     header => [{col1 => 'Setting',  
                                 col2 => 'Value'}],  
                     ordered => ['task_messages','task_grading',                      ordered => ['task_messages','task_grading',
                                 'suppress_embed_prompt'],                                  'suppress_embed_prompt'],
                     itemtext => {                      itemtext => {
Line 514  sub handler { Line 501  sub handler {
                   },                    },
         'other' =>          'other' =>
                   { text => 'Other settings',                    { text => 'Other settings',
                     help => 'Course_Environment',                      help => 'Course_Prefs_Other',
                     header => [ {col1 => 'Item',                      header => [ {col1 => 'Item',
                                  col2 => 'Value',                                   col2 => 'Value',
                               }],                                }],
Line 524  sub handler { Line 511  sub handler {
         my @allitems = &get_allitems(%prefs);          my @allitems = &get_allitems(%prefs);
         &Apache::lonconfigsettings::make_changes($r,$cdom,$phase,$context,          &Apache::lonconfigsettings::make_changes($r,$cdom,$phase,$context,
                                                  \@prefs_order,\%prefs,\%values,                                                   \@prefs_order,\%prefs,\%values,
                                                   $cnum,undef,\@allitems);                                                    $cnum,undef,\@allitems,'coursepref');
     } elsif ($phase eq 'display') {      } elsif ($phase eq 'display') {
         my $jscript = &get_jscript($cid,$cdom,$phase,$crstype);          my $jscript = &get_jscript($cid,$cdom,$phase,$crstype);
         my @allitems = &get_allitems(%prefs);          my @allitems = &get_allitems(%prefs);
         &Apache::lonconfigsettings::display_settings($r,$cdom,$phase,$context,          &Apache::lonconfigsettings::display_settings($r,$cdom,$phase,$context,
             \@prefs_order,\%prefs,\%values,undef,$jscript,\@allitems,$crstype);              \@prefs_order,\%prefs,\%values,undef,$jscript,\@allitems,$crstype,'coursepref');
     } else {      } else {
         &Apache::lonconfigsettings::display_choices($r,$phase,$context,          &Apache::lonconfigsettings::display_choices($r,$phase,$context,
                                                     \@prefs_order,\%prefs);                                                      \@prefs_order,\%prefs,'coursepref');
     }      }
     return OK;      return OK;
 }  }
Line 562  sub print_config_box { Line 549  sub print_config_box {
          '<table class="LC_nested_outer">           '<table class="LC_nested_outer">
           <tr>            <tr>
            <th align="left" valign="middle"><span class="LC_nobreak" style="font-size: larger;" >'.             <th align="left" valign="middle"><span class="LC_nobreak" style="font-size: larger;" >'.
            &mt($item->{text}).'&nbsp;'.             &mt($item->{text});
            &Apache::loncommon::help_open_topic($item->{'help'}).'</span></th>'."\n".      if ($item->{'help'}) {
           '</tr>';          $output .= '&nbsp;'.
                      &Apache::loncommon::help_open_topic($item->{'help'});
       }
       $output .= '</span></th>'."\n".
                  '</tr>';
     if (($action eq 'feedback') || ($action eq 'classlists')) {      if (($action eq 'feedback') || ($action eq 'classlists')) {
         $output .= '          $output .= '
           <tr>            <tr>
            <td>             <td>
             <table class="LC_nested">';              <table class="LC_nested">';   
         if (exists $item->{'header'}->[0]->{'col1'} ||           if (exists $item->{'header'}->[0]->{'col1'} || 
             exists $item->{'header'}->[0]->{'col2'}) {              exists $item->{'header'}->[0]->{'col2'}) {
  $output .= '             $output .= '          
Line 589  sub print_config_box { Line 580  sub print_config_box {
           </td>            </td>
          </tr>           </tr>
          <tr>           <tr>
            <td>            <td>
             <table class="LC_nested">              <table class="LC_nested">
              <tr class="LC_info_row">               <tr class="LC_info_row">
               <td class="LC_left_item">'.&mt($item->{'header'}->[1]->{'col1'}).'</td>';                <td class="LC_left_item">'.&mt($item->{'header'}->[1]->{'col1'}).'</td>';
Line 605  sub print_config_box { Line 596  sub print_config_box {
           <tr>            <tr>
            <td>             <td>
             <table class="LC_nested">';              <table class="LC_nested">';
             if (exists $item->{'header'}->[0]->{'col1'} ||               if (exists $item->{'header'}->[2]->{'col1'} || 
             exists $item->{'header'}->[0]->{'col2'}) {              exists $item->{'header'}->[2]->{'col2'}) {
  $output .= '             $output .= '          
  <tr class="LC_info_row">   <tr class="LC_info_row">
   <td class="LC_left_item">'.&mt($item->{'header'}->[0]->{'col1'}).'</td>    <td class="LC_left_item">'.&mt($item->{'header'}->[2]->{'col1'}).'</td>
   <td class="LC_right_item">'.&mt($item->{'header'}->[0]->{'col2'}).'</td>    <td class="LC_right_item">'.&mt($item->{'header'}->[2]->{'col2'}).'</td>
  </tr>';   </tr>';
             }          }
         }          }
     } else {      } else {
         $output .= '          $output .= '
Line 637  sub print_config_box { Line 628  sub print_config_box {
         $output .= &print_feedback('bottom',$cdom,$settings,$ordered,$itemtext,\$rowtotal);          $output .= &print_feedback('bottom',$cdom,$settings,$ordered,$itemtext,\$rowtotal);
     } elsif ($action eq 'discussion') {      } elsif ($action eq 'discussion') {
         $output .= &print_discussion($cdom,$settings,$ordered,$itemtext,\$rowtotal);          $output .= &print_discussion($cdom,$settings,$ordered,$itemtext,\$rowtotal);
     } elsif ($action eq 'classlists') {      } elsif (($action eq 'classlists') || ($action eq 'viewableroster')) {
         $output .= &print_classlists('bottom',$cdom,$settings,$itemtext,\$rowtotal,$crstype);          $output .= &print_classlists('bottom',$cdom,$settings,$itemtext,\$rowtotal,$crstype);
     } elsif ($action eq 'appearance') {      } elsif ($action eq 'appearance') {
         $output .= &print_appearance($cdom,$settings,$ordered,$itemtext,\$rowtotal,$crstype);          $output .= &print_appearance($cdom,$settings,$ordered,$itemtext,\$rowtotal,$crstype);
Line 688  sub process_changes { Line 679  sub process_changes {
                                  (!$can_toggle_cat));                                   (!$can_toggle_cat));
                         next if (($entry eq 'categories') &&                          next if (($entry eq 'categories') &&
                                  (!$can_categorize));                                   (!$can_categorize));
                         next if (($entry eq 'loncaparev') ||                          next if (($entry eq 'loncaparev') || 
                                 ($entry eq 'owner'));                                  ($entry eq 'owner'));
                         push(@ordered,$entry);                          push(@ordered,$entry);
                     }                      }
Line 1002  sub process_changes { Line 993  sub process_changes {
                                 }                                  }
                             }                              }
                             $newvalues{$entry} =~ s/,$//;                              $newvalues{$entry} =~ s/,$//;
                           } elsif ($entry eq 'discussion_post_fonts') {
                               my ($classorder,$classtitles) = &discussion_vote_classes();
                               my $fontchange = 0;
                               foreach my $class (@{$classorder}) {
                                   my $ext_entry = $entry.'_'.$class;
                                   my $size = $env{'form.'.$ext_entry.'_size'};
                                   my $unit = $env{'form.'.$ext_entry.'_unit'};
                                   my $weight = $env{'form.'.$ext_entry.'_weight'};
                                   my $style = $env{'form.'.$ext_entry.'_style'};
                                   my $other = $env{'form.'.$ext_entry.'_other'};
                                   $size =~ s/,//g;
                                   $unit =~ s/,//g;
                                   $weight =~ s/,//g;
                                   $style =~ s/,//g;
                                   $other =~ s/[^\w;:\s\-\%.]//g;
                                   $other =~ s/(^\s+|\s+$)//g;
                                   $newvalues{$ext_entry} = join(',',($size.$unit,$weight,$style,$other));
                                   my $current = $values->{$ext_entry};
                                   if ($values->{$ext_entry} eq '') {
                                       $current = ',,,';
                                   }
                                   if ($newvalues{$ext_entry} ne $current) {
                                       $changes->{$ext_entry} = $newvalues{$ext_entry};
                                       $fontchange ++;
                                   }
                               }
                               if ($fontchange) {
                                   $changes->{$entry} = 1;
                               }
                         } elsif ($entry eq 'nothideprivileged') {                          } elsif ($entry eq 'nothideprivileged') {
                             my @curr_nothide;                              my @curr_nothide;
                             my @new_nothide;                              my @new_nothide;
Line 1105  sub process_changes { Line 1125  sub process_changes {
                         } else {                          } else {
                             $newvalues{$entry} = $env{'form.'.$entry};                              $newvalues{$entry} = $env{'form.'.$entry};
                         }                          }
                         unless ($entry eq 'co-owners') {                          unless (($entry eq 'co-owners') || ($entry eq 'discussion_post_fonts')) {
                             if ($newvalues{$entry} ne $values->{$entry}) {                              if ($newvalues{$entry} ne $values->{$entry}) {
                                 $changes->{$entry} = $newvalues{$entry};                                  $changes->{$entry} = $newvalues{$entry};
                             }                              }
Line 1232  sub store_changes { Line 1252  sub store_changes {
                                     my ($displayname,$text);                                      my ($displayname,$text);
                                     $text = $prefs->{$item}->{'itemtext'}{$key};                                      $text = $prefs->{$item}->{'itemtext'}{$key};
                                     my $displayval;                                      my $displayval;
                                     unless ($key eq 'co-owners') {                                      unless (($key eq 'co-owners') || ($key eq 'discussion_post_fonts')) {
                                         $displayval = $changes->{$item}{$key};                                          $displayval = $changes->{$item}{$key};
                                     }                                      }
                                     if ($item eq 'feedback') {                                      if ($item eq 'feedback') {
Line 1268  sub store_changes { Line 1288  sub store_changes {
                                                     }                                                      }
                                                     $displayval = join(', ',@longroles);                                                      $displayval = join(', ',@longroles);
                                                 }                                                  }
                                               } elsif ($key eq 'discussion_post_fonts') {
                                                   my ($classorder,$classtitles)=&discussion_vote_classes();
                                                   my ($styleorder,$styleitems)=&discussion_vote_styles();
                                                   my $count = 1;
                                                   my $total = scalar(keys(%{$changes->{$item}}));
                                                   foreach my $class (@{$classorder}) {
                                                       $count ++;
                                                       next unless ($changes->{$item}{$key.'_'.$class});
                                                       my @vals = split(/,/,$changes->{$item}{$key.'_'.$class});
                                                       my $showval = '';
                                                       for (my $i=0; $i<@{$styleorder}; $i++) {
                                                           if ($vals[$i] ne '') {
                                                               $showval .= 'font-'.$styleorder->[$i].': '.$vals[$i].'; ';
                                                           }
                                                       }
                                                       if ($vals[3] ne '') {
                                                           $showval .= $vals[3];
                                                       }
                                                       if ($showval ne '') {
                                                           $displayval .= $classtitles->{$class}.':{ '.
                                                                          $showval.'}';
                                                           $storehash{$key.'_'.$class} = $changes->{$item}{$key.'_'.$class};
                                                       } else {
                                                           $displayval .= $classtitles->{$class}.': '.&mt('None');
                                                           push(@delkeys,$key.'_'.$class);
                                                       }
                                                       unless ($count == $total) {
                                                           $displayval .= ('&nbsp;'x2);
                                                       }
                                                   }
                                             }                                              }
                                             $displayname = &mt($text);                                              $displayname = &mt($text);
                                         }                                          }
Line 1367  sub store_changes { Line 1417  sub store_changes {
                                             }                                              }
                                         }                                          }
                                     } else {                                      } else {
                                         $storehash{$key} = $changes->{$item}{$key};                                          unless ($key eq 'discussion_post_fonts') {
                                               $storehash{$key} = $changes->{$item}{$key};
                                           }
                                     }                                      }
                                 }                                  }
                                 if ($key eq 'cloners') {                                  if ($key eq 'cloners') {
Line 1730  sub print_courseinfo { Line 1782  sub print_courseinfo {
                            '</span>',                             '</span>',
                    input => 'textbox',                     input => 'textbox',
                    size  => '40',                     size  => '40',
                      advanced => 1
                  },                   },
         'description'  => {           'description'  => { 
                    text => '<b>'.&mt($itemtext->{'description'}).'</b>',                     text => '<b>'.&mt($itemtext->{'description'}).'</b>',
Line 1752  sub print_courseinfo { Line 1805  sub print_courseinfo {
                    text => '<b>'.&mt($itemtext->{'cloners'}).'</b><br />'.                     text => '<b>'.&mt($itemtext->{'cloners'}).'</b><br />'.
                            &mt('Owner and Coordinators included automatically'),                             &mt('Owner and Coordinators included automatically'),
                    input => 'textbox',                     input => 'textbox',
                    size  => '40',                     size  => '40'
                          },                           },
         'rolenames'  => {           'rolenames'  => { 
                    text  => '<b>'.&mt($itemtext->{'rolenames'}).'</b><br />'.                     text  => '<b>'.&mt($itemtext->{'rolenames'}).'</b><br />'.
                             '('.$replace.')',                              '('.$replace.')',
                    input => 'textbox',                     input => 'textbox',
                    size  => '20',                     size  => '20',
                      advanced => 1
                         },                          },
         'externalsyllabus' => {          'externalsyllabus' => {
                    text => '<b>'.&mt($itemtext->{'externalsyllabus'}).'</b><br />('.                     text => '<b>'.&mt($itemtext->{'externalsyllabus'}).'</b><br />('.
Line 1790  sub print_courseinfo { Line 1844  sub print_courseinfo {
             next if (!$can_categorize);              next if (!$can_categorize);
         }          }
         $count ++;          $count ++;
         $datatable .= &item_table_row_start($items{$item}{text},$count);          if (exists $items{$item}{advanced} && $items{$item}{advanced} == 1) {
           $datatable .= &item_table_row_start($items{$item}{text},$count,"advanced");
           } else {
           $datatable .= &item_table_row_start($items{$item}{text},$count);
           }
         if ($items{$item}{input} eq 'radio') {          if ($items{$item}{input} eq 'radio') {
             $datatable .= &yesno_radio($item,$settings);              $datatable .= &yesno_radio($item,$settings);
         } elsif ($item eq 'cloners') {          } elsif ($item eq 'cloners') {
Line 2139  sub display_loncaparev_constraints { Line 2197  sub display_loncaparev_constraints {
                              if ($key =~ /^\Q$start\E(\[useropt\:($match_username\:$match_domain)\]\.)/) {                               if ($key =~ /^\Q$start\E(\[useropt\:($match_username\:$match_domain)\]\.)/) {
                                  $middle = $1;                                   $middle = $1;
                                  $which = $2;                                   $which = $2;
                                  $scope = 'user';                                   $scope = 'user'; 
                              } elsif ($key =~ /^\Q$start\E(\[(\w+)\]\.)/) {                               } elsif ($key =~ /^\Q$start\E(\[(\w+)\]\.)/) {
                                  $middle = $1;                                   $middle = $1;
                                  $which = $2;                                   $which = $2;
Line 2334  sub display_loncaparev_constraints { Line 2392  sub display_loncaparev_constraints {
     my $mapres_header = '<h4>'.      my $mapres_header = '<h4>'.
                         &mt('Requirements for specific folders or resources').                          &mt('Requirements for specific folders or resources').
                         '</h4>';                          '</h4>';
     if ((keys(%toshow) > 0) || (keys(%byresource) > 0) ||      if ((keys(%toshow) > 0) || (keys(%byresource) > 0) || 
         (keys(%bysubmission) > 0) || (keys(%byresponsetype))) {          (keys(%bysubmission) > 0) || (keys(%byresponsetype))) {
         $output .= $mapres_header;          $output .= $mapres_header;
     }      }
Line 2349  sub display_loncaparev_constraints { Line 2407  sub display_loncaparev_constraints {
             &show_contents_view($r,$navmap,$cid,\%toshow,\%bymap,\%byresource,\%bysubmission,              &show_contents_view($r,$navmap,$cid,\%toshow,\%bymap,\%byresource,\%bysubmission,
                                 \%byresponsetype,\@scopeorder,\%lt);                                  \%byresponsetype,\@scopeorder,\%lt);
         }          }
         $r->print('<br /><br />');          $r->print('<br /><br />'); 
     } else {      } else {
         $r->print('<p class="LC_info">'.          $r->print('<p class="LC_info">'.
                   &mt('No version requirements from resource content or settings.').                    &mt('No version requirements from resource content or settings.').
                   '</p>');                    '</p>'); 
     }      }
     $r->print(&Apache::loncommon::end_page());      $r->print(&Apache::loncommon::end_page());
     return;      return;
Line 2362  sub display_loncaparev_constraints { Line 2420  sub display_loncaparev_constraints {
 sub show_contents_view {  sub show_contents_view {
     my ($r,$navmap,$cid,$toshow,$bymap,$byresource,$bysubmission,$byresponsetype,      my ($r,$navmap,$cid,$toshow,$bymap,$byresource,$bysubmission,$byresponsetype,
         $scopeorder,$lt) = @_;          $scopeorder,$lt) = @_;
     if ((keys(%{$toshow}) > 0) || (keys(%{$byresource}) > 0) ||      if ((keys(%{$toshow}) > 0) || (keys(%{$byresource}) > 0) || 
         (keys(%{$bysubmission}) > 0) || (keys(%{$byresponsetype}) > 0)) {          (keys(%{$bysubmission}) > 0) || (keys(%{$byresponsetype}) > 0)) {
         my $location=&Apache::loncommon::lonhttpdurl("/adm/lonIcons");          my $location=&Apache::loncommon::lonhttpdurl("/adm/lonIcons");
         my $whitespace = '<img src="'.$location.'/whitespace_21.gif" alt="" />';          my $whitespace = '<img src="'.$location.'/whitespace_21.gif" alt="" />';
Line 2806  sub print_feedback { Line 2864  sub print_feedback {
   
     foreach my $item (@{$ordered}) {      foreach my $item (@{$ordered}) {
         $count ++;          $count ++;
         $datatable .= &item_table_row_start($items{$item}{text},$count);          if ($position eq 'top') {
           $datatable .= &item_table_row_start($items{$item}{text},$count);
           } else {
           $datatable .= &item_table_row_start($items{$item}{text}."<br/>(Custom text)",$count, "advanced");
           }
         if ($position eq 'top') {          if ($position eq 'top') {
             my $includeempty = 0;              my $includeempty = 0;
             $datatable .= &user_table($cdom,$item,\@sections,              $datatable .= &user_table($cdom,$item,\@sections,
                                       $settings->{$item},\%lt);                                        $settings->{$item},\%lt);
         } else {          } else {
             $datatable .= &Apache::lonhtmlcommon::textbox($item.'.text',              $datatable .= &Apache::lonhtmlcommon::textbox($item.'.text',
                               $settings->{$item.'.text'},$items{$item}{size});                                $settings->{$item.'.text'},$items{$item}{size});  
         }          }
         $datatable .= &item_table_row_end();          $datatable .= &item_table_row_end();
     }      }
Line 2975  sub print_discussion { Line 3037  sub print_discussion {
                    text => '<b>'.&mt($itemtext->{'allow_discussion_post_editing'}).'</b>',                     text => '<b>'.&mt($itemtext->{'allow_discussion_post_editing'}).'</b>',
                    input => 'checkbox',                     input => 'checkbox',
                  },                   },
           'discussion_post_fonts' => {
                      text => '<b>'.&mt($itemtext->{'discussion_post_fonts'}).'</b>',
                      input => 'textbox',
                      size  => '20',
                    },
     );      );
     my $datatable;      my $datatable;
     my $count;      my $count;
Line 3014  sub print_discussion { Line 3081  sub print_discussion {
                           &Apache::loncommon::end_data_table_row().                            &Apache::loncommon::end_data_table_row().
                           &role_checkboxes($cdom,$cnum,$item,$settings,1).                            &role_checkboxes($cdom,$cnum,$item,$settings,1).
                           &Apache::loncommon::end_data_table();                            &Apache::loncommon::end_data_table();
           } elsif ($item eq 'discussion_post_fonts') {
               $datatable .= &Apache::loncommon::start_data_table().
                             &Apache::loncommon::start_data_table_row().
                             '<th align="center">'.&mt('Sum of likes/dislikes').'</th>'.
                             '<th align="center">'.&mt('font-size').'</th>'.
                             '<th align="center">'.&mt('font-weight').'</th>'.
                             '<th align="center">'.&mt('font-style').'</th>'.
                             '<th align="center">'.&mt('Other css').'</th>'.
                             &Apache::loncommon::end_data_table_row().
                             &set_discussion_fonts($cdom,$cnum,$item,$settings).
                             &Apache::loncommon::end_data_table();
         }          }
         $datatable .= &item_table_row_end();          $datatable .= &item_table_row_end();
     }      }
Line 3135  sub role_checkboxes { Line 3213  sub role_checkboxes {
     return $output;      return $output;
 }  }
   
   sub set_discussion_fonts {
       my ($cdom,$cnum,$item,$settings) = @_;
       my ($classorder,$classtitles) = &discussion_vote_classes();
       my ($styleorder,$styleitems) = &discussion_vote_styles();
       my $output;
       if (ref($classorder) eq 'ARRAY') {
           foreach my $cat (@{$classorder}) {
               my %curr = ();
               ($curr{'size'},$curr{'weight'},$curr{'style'},$curr{'other'}) =
                   split(/,/,$settings->{'discussion_post_fonts_'.$cat});
               $output .= &Apache::loncommon::start_data_table_row().
                          '<td>'.$classtitles->{$cat}.'</td>';
               if (ref($styleorder) eq 'ARRAY') {
                   foreach my $item (@{$styleorder}) {
                       $output .= '<td><span class="LC_nobreak">';
                       my $selitem = $item;
                       if ($item eq 'size') {
                           my ($currsize,$currunit);
                           if ($curr{'size'} =~ /^(\d+)(px|%)$/) {
                               ($currsize,$currunit) = ($1,$2);
                               $curr{'size'} = $currunit;
                           }
                           $output .= '<input type="textbox" name="discussion_post_fonts_'.$cat.'_'.$item.'" value="'.$currsize.'" size="5">'.
                                      '&nbsp;';
                           $selitem = 'unit';
                       }
                       if ((ref($styleitems) eq 'HASH') && (ref($styleitems->{$item}) eq 'ARRAY')) {
                           $output .= '<select name="discussion_post_fonts_'.$cat.'_'.$selitem.'">';
                           foreach my $val (@{$styleitems->{$item}}) {
                               my $sel;
                               if ($val eq $curr{$item}) {
                                   $sel = ' selected="selected"';
                               }
                               $output .= '<option value="'.$val.'"'.$sel.'>'.$val.'</option>';
                           }
                       }
                   }
               }
               $output .= '</span></td><td><input type="textbox" size="10" name="discussion_post_fonts_'.$cat.'_other" value="'.$curr{'other'}.'" /></td>';
          }
          $output .= &Apache::loncommon::end_data_table_row();
       }
       return $output;
   }
   
   sub discussion_vote_classes {
       my $classorder = ['twoplus','oneplus','zero','oneminus','twominus'];
       my %classtitles = &Apache::lonlocal::texthash(
                           'twoplus'  => 'Two sigma above mean',
                           'oneplus'  => 'One sigma above mean',
                           'zero'     => 'Within one sigma of mean',
                           'oneminus' => 'One sigma below mean',
                           'twominus' => 'Two sigma below mean',
                         );
       return ($classorder,\%classtitles);
   }
   
   sub discussion_vote_styles {
       my $styleorder = ['size','weight','style'];
       my $styleitems = {
                            size => ['','px','%','xx-small','x-small','small','medium','large',
                                     'x-large','xx-large','smaller','larger'],
                            weight => ['','normal','bold','bolder','lighter','100','200','300','400',
                                       '500','600','700','800','900'],
                            style => ['','normal','italic','oblique'],
                        };
       return ($styleorder,$styleitems);
   }
   
 sub print_classlists {  sub print_classlists {
     my ($position,$cdom,$settings,$itemtext,$rowtotal,$crstype) = @_;      my ($position,$cdom,$settings,$itemtext,$rowtotal,$crstype) = @_;
     my @ordered;      my @ordered;
Line 3284  sub print_grading { Line 3431  sub print_grading {
                                 '64bit5' => '64bit5',                                  '64bit5' => '64bit5',
                               },                                },
                    order => ['32bit','64bit','64bit2','64bit3','64bit4','64bit5'],                     order => ['32bit','64bit','64bit2','64bit3','64bit4','64bit5'],
                      advanced => 1
                  },                   },
         'receiptalg'  => {          'receiptalg'  => {
                    text => '<b>'.&mt($itemtext->{'receiptalg'}).'</b><br />'.                     text => '<b>'.&mt($itemtext->{'receiptalg'}).'</b><br />'.
Line 3295  sub print_grading { Line 3443  sub print_grading {
                                 receipt3 => 'receipt3',                                  receipt3 => 'receipt3',
                               },                                },
                    order => ['receipt','receipt2','receipt3'],                     order => ['receipt','receipt2','receipt3'],
                      advanced => 1
                  },                   },
         'disablesigfigs' => {          'disablesigfigs' => {
                    text => '<b>'.&mt($itemtext->{'disablesigfigs'}).'</b>',                     text => '<b>'.&mt($itemtext->{'disablesigfigs'}).'</b>',
Line 3474  sub get_other_items { Line 3623  sub get_other_items {
             unless (($parameter =~ m/^internal\./)||($parameter =~ m/^metadata\./) ||              unless (($parameter =~ m/^internal\./)||($parameter =~ m/^metadata\./) ||
                     ($parameter =~ m/^selfenroll_/) || ($parameter =~ /_selfenroll$/)                      ($parameter =~ m/^selfenroll_/) || ($parameter =~ /_selfenroll$/)
                     || ($parameter eq 'type') ||                      || ($parameter eq 'type') ||
                     ($parameter =~ m/^(cc|co|in|ta|ep|ad|st)\.plaintext$/)) {                      ($parameter =~ m/^(cc|co|in|ta|ep|ad|st)\.plaintext$/)
                       || ($parameter =~ m/^discussion_post_fonts/)) {
                 push(@ordered,$parameter);                  push(@ordered,$parameter);
             }              }
         }          }
Line 3566  sub make_item_rows { Line 3716  sub make_item_rows {
         my $count = 0;          my $count = 0;
         foreach my $item (@{$ordered}) {          foreach my $item (@{$ordered}) {
             $count ++;              $count ++;
             $datatable .= &item_table_row_start($items->{$item}{text},$count);              if (exists $items->{$item}{advanced} && $items->{$item}{advanced} == 1) {
                   $datatable .= &item_table_row_start($items->{$item}{text},$count,"advanced");
               } else {
                   $datatable .= &item_table_row_start($items->{$item}{text},$count);
               }
             if ($item eq 'nothideprivileged') {              if ($item eq 'nothideprivileged') {
                 $datatable .= &nothidepriv_row($cdom,$item,$settings,$crstype);                  $datatable .= &nothidepriv_row($cdom,$item,$settings,$crstype);
             } elsif ($item eq 'print_header_format') {              } elsif ($item eq 'print_header_format') {

Removed from v.1.28.2.12  
changed lines
  Added in v.1.49.2.4


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