Diff for /loncom/interface/lonconfigsettings.pm between versions 1.8.2.2 and 1.17

version 1.8.2.2, 2010/03/23 20:53:09 version 1.17, 2011/01/13 22:49:47
Line 35  use Apache::lonnet; Line 35  use Apache::lonnet;
 use Apache::loncommon();  use Apache::loncommon();
 use Apache::lonhtmlcommon();  use Apache::lonhtmlcommon();
 use Apache::lonlocal;  use Apache::lonlocal;
   use Apache::lonparmset();
   
 sub print_header {  sub print_header {
     my ($r,$phase,$context,$jscript) = @_;      my ($r,$phase,$context,$jscript) = @_;
Line 119  $jscript Line 120  $jscript
     }      }
     $r->print(&Apache::loncommon::start_page($pagetitle,$js,$additem));      $r->print(&Apache::loncommon::start_page($pagetitle,$js,$additem));
     $r->print(&Apache::lonhtmlcommon::breadcrumbs($brcrumtitle));      $r->print(&Apache::lonhtmlcommon::breadcrumbs($brcrumtitle));
       &Apache::lonparmset::startSettingsScreen($r,'coursepref');
     $r->print('      $r->print('
 <form name="parmform" action="">  <form name="parmform" action="">
 <input type="hidden" name="pres_marker" />  <input type="hidden" name="pres_marker" />
Line 141  sub print_footer { Line 143  sub print_footer {
     if (($phase eq 'display') || ($phase eq 'process')) {      if (($phase eq 'display') || ($phase eq 'process')) {
         if (ref($actions) eq 'ARRAY') {          if (ref($actions) eq 'ARRAY') {
             foreach my $item (@{$actions}) {              foreach my $item (@{$actions}) {
                 $r->print('<input type="hidden" name="actions" value="'.$item.'" />')."\n";                  $r->print('<input type="hidden" name="actions" value="'.$item.'" />'."\n");
             }              }
         }          }
     }      }
Line 159  sub print_footer { Line 161  sub print_footer {
                   $button_text.'" onclick='.$onclick.' /></p>');                    $button_text.'" onclick='.$onclick.' /></p>');
     }      }
     if ($phase eq 'process') {      if ($phase eq 'process') {
         $r->print('</form>'.&Apache::loncommon::end_page());          $r->print('</form>');
           &Apache::lonparmset::endSettingsScreen($r);
           $r->print(&Apache::loncommon::end_page());
     }      }
     return;      return;
 }  }
Line 251  sub display_settings { Line 255  sub display_settings {
                 if (grep(/^\Q$item\E$/,@actions)) {                  if (grep(/^\Q$item\E$/,@actions)) {
                     push(@items,$item);                      push(@items,$item);
                     if ($context eq 'domain') {                      if ($context eq 'domain') {
                           if ($item eq 'usersessions') {
                               $r->print('<script type="text/javascript">'."\n".
                                         '// <![CDATA['."\n".
                                         &Apache::loncommon::check_uncheck_jscript()."\n".
                                         '// ]]>'."\n".
                                         '</script>'."\n");
                           }
                         ($output{$item},$rowtotal{$item}) =                          ($output{$item},$rowtotal{$item}) =
                             &Apache::domainprefs::print_config_box($r,$dom,$confname,                              &Apache::domainprefs::print_config_box($r,$dom,$confname,
                                 $phase,$item,$prefs->{$item},$values->{$item});                                  $phase,$item,$prefs->{$item},$values->{$item});
Line 267  sub display_settings { Line 278  sub display_settings {
                 $r->print($output{$items[$i]});                  $r->print($output{$items[$i]});
             }              }
             $r->print('</div>');              $r->print('</div>');
             $r->print(&print_footer($r,$phase,'process','Save',\@actions));              $r->print(&print_footer($r,$phase,'process','Save Changes',\@actions));
         } else {          } else {
             $r->print('<input type="hidden" name="phase" value="" />'.              $r->print('<input type="hidden" name="phase" value="" />'.
                       '<span class="LC_error">'.&mt('No settings chosen').                        '<span class="LC_error">'.&mt('No settings chosen').
Line 275  sub display_settings { Line 286  sub display_settings {
         }          }
         $r->print('</form>');          $r->print('</form>');
     }      }
       if ($context eq 'course') {
       $r->print('
   <script type="text/javascript">
    $(document).ready(function(){
    $("#prefs").accordion({
    autoHeight: false
    });
    if ($(".LC_nested tr.advanced").get(0)) {
    $(".LC_nested tr.advanced").each(function() {
    $(this).hide();
    p = $(this).parents("div.ui-accordion-content")
    if (p.find(".LC_advanced_toggle").length) {
    return;
    }
    p.prepend("<span class=\'LC_advanced_toggle\'><input type=\"checkbox\"/>Show advanced options</span>");
    });
    $(".LC_advanced_toggle input").change(function() {
    if($(this).is(":checked")) {
    $(this).parents("div.ui-accordion-content").find("tr.advanced").fadeIn("normal");
    } else {
    $(this).parents("div.ui-accordion-content").find("tr.advanced").fadeOut("normal");
    }
    });
    }
    });
   </script>
   ');
       }
     $r->print(&Apache::loncommon::end_page());      $r->print(&Apache::loncommon::end_page());
     return;      return;
 }  }
Line 291  sub display_choices { Line 330  sub display_choices {
               &Apache::loncommon::check_uncheck_jscript()."\n".                &Apache::loncommon::check_uncheck_jscript()."\n".
               '// ]]>'."\n".                '// ]]>'."\n".
               '</script>'."\n");                '</script>'."\n");
     $r->print('<h3>'.&mt('Settings to display/modify').'</h3>'."\n".      $r->print('<h3>'.&mt('Settings to display/modify').'</h3>'.
               '<div><input type="button" value="'.&mt('check all').'" '.                '<div><input type="button" value="'.&mt('check all').'" '.
               'onclick="javascript:checkAll(document.pickactions.actions)"'.                'onclick="javascript:checkAll(document.pickactions.actions)"'.
               ' />'.('&nbsp;'x2).                ' />'.('&nbsp;'x2).
               '<input type="button" value="'.&mt('uncheck all').'" '.                '<input type="button" value="'.&mt('uncheck all').'" '.
               'onclick="javascript:uncheckAll(document.pickactions.actions)" />'.                'onclick="javascript:uncheckAll(document.pickactions.actions)" />'.
               '</div><br />'."\n".                "\n".
               '<div class="LC_left_float">');                '</div><div class="LC_left_float">');
     my ($numitems,$maxincol,$firstthird,$secondthird,$seconddiv,$thirddiv,$count);      my ($numitems,$maxincol,$firstthird,$secondthird,$seconddiv,$thirddiv,$count);
     if (ref($prefs_order) eq 'ARRAY') {      if (ref($prefs_order) eq 'ARRAY') {
         $numitems = @{$prefs_order};          $numitems = @{$prefs_order};
Line 308  sub display_choices { Line 347  sub display_choices {
     if ($numitems%$numcols) {      if ($numitems%$numcols) {
         $maxincol ++;          $maxincol ++;
     }      }
     my $firstthird = $maxincol;      $firstthird = $maxincol;
     my $secondthird = $firstthird + $maxincol;      $secondthird = $firstthird + $maxincol;
     $count = 0;      $count = 0;
     if ((ref($prefs_order) eq 'ARRAY') && (ref($prefs) eq 'HASH')) {      if ((ref($prefs_order) eq 'ARRAY') && (ref($prefs) eq 'HASH')) {
         foreach my $item (@{$prefs_order}) {          foreach my $item (@{$prefs_order}) {
             $r->print(&Apache::loncommon::help_open_topic($prefs->{$item}->{'help'}).              $r->print('<h4>'.
                         &Apache::loncommon::help_open_topic($prefs->{$item}->{'help'}).
                       '<label><input type="checkbox" name="actions" value="'.$item.                        '<label><input type="checkbox" name="actions" value="'.$item.
                       '" />&nbsp;'.&mt($prefs->{$item}->{'text'}).'</label><br />');                        '" />&nbsp;'.&mt($prefs->{$item}->{'text'}).'</label></h4>');
             $count ++;              $count ++;
             if ((!$seconddiv) && ($count >= $firstthird)) {              if ((!$seconddiv) && ($count >= $firstthird)) {
                 $r->print('</div>'."\n".'<div class="LC_left_float">'."\n");                  $r->print('</div>'."\n".'<div class="LC_left_float">'."\n");

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


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