Diff for /loncom/interface/lonconfigsettings.pm between versions 1.21.4.6 and 1.22

version 1.21.4.6, 2014/04/23 10:26:37 version 1.22, 2012/10/30 10:39:02
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,$container) = @_;      my ($r,$phase,$context,$jscript,$container) = @_;
     my ($pagetitle,$brcrumtitle,$action,$call_category_check,$crstype);      my ($pagetitle,$brcrumtitle,$action,$call_category_check);
     if ($context eq 'domain') {      if ($context eq 'domain') {
         ($pagetitle, $brcrumtitle) = ('View/Modify Domain Settings','View/Modify Domain Settings');          ($pagetitle, $brcrumtitle) = ('View/Modify Domain Settings','View/Modify Domain Settings');
         $action = '/adm/domainprefs';          $action = '/adm/domainprefs';
Line 55  sub print_header { Line 56  sub print_header {
             }              }
         }          }
     } else {      } else {
         $crstype = &Apache::loncommon::course_type();          if (&Apache::loncommon::course_type() eq 'Community') {
         if ($crstype eq 'Community') {  
             ($pagetitle,$brcrumtitle) = ('Community Configuration','Community Configuration');              ($pagetitle,$brcrumtitle) = ('Community Configuration','Community Configuration');
         } else {          } else {
             ($pagetitle,$brcrumtitle) = ('Course Configuration','Course Configuration');              ($pagetitle,$brcrumtitle) = ('Course Configuration','Course Configuration');
Line 94  function changePage(formname,newphase) { Line 94  function changePage(formname,newphase) {
     formname.submit();      formname.submit();
 }'."\n";  }'."\n";
     if ($phase eq 'pickactions') {      if ($phase eq 'pickactions') {
         $js .= &Apache::lonhtmlcommon::color_picker();   $js .= &Apache::lonhtmlcommon::color_picker();
         $js .=          $js .=
             &Apache::lonhtmlcommon::set_form_elements({actions => 'checkbox'})."\n";              &Apache::lonhtmlcommon::set_form_elements({actions => 'checkbox'})."\n";
     } elsif ($phase eq 'display') {      } elsif ($phase eq 'display') {
         $js .= &Apache::lonhtmlcommon::color_picker();   $js .= &Apache::lonhtmlcommon::color_picker();
         $js .= &color_pick_js()."\n";          $js .= &color_pick_js()."\n";
     }      }
     $js .= &Apache::loncommon::viewport_size_js().'      $js .= &Apache::loncommon::viewport_size_js().'
Line 129  $jscript Line 129  $jscript
 <input type="hidden" name="pres_value" />  <input type="hidden" name="pres_value" />
 </form>  </form>
 ');  ');
       if ($container) {
          &Apache::lonparmset::startSettingsScreen($r,$container);
       }
     $r->print('<form method="post" name="'.$phase.'" action="'.$action.'"'.      $r->print('<form method="post" name="'.$phase.'" action="'.$action.'"'.
               ' enctype="multipart/form-data">');                ' enctype="multipart/form-data">');
     return;      return;
Line 150  sub print_footer { Line 153  sub print_footer {
     }      }
     my $dest='"javascript:changePage(document.'.$phase.','."'$newphase'".')"';      my $dest='"javascript:changePage(document.'.$phase.','."'$newphase'".')"';
     if ($phase eq 'process') {      if ($phase eq 'process') {
         $r->print(          $r->print('<p><a href='.$dest.'>'.$button_text.'</a></p>');
             &Apache::lonhtmlcommon::actionbox(  
                 ['<a href='.$dest.'>'.$button_text.'</a>']));  
     } else {      } else {
         my $onclick;          my $onclick;
         if ($phase eq 'display') {          if ($phase eq 'display') {
Line 165  sub print_footer { Line 166  sub print_footer {
     }      }
     if ($phase eq 'process') {      if ($phase eq 'process') {
         $r->print('</form>');          $r->print('</form>');
           if ($container) {
              &Apache::lonparmset::endSettingsScreen($r);
           }
         $r->print(&Apache::loncommon::end_page());          $r->print(&Apache::loncommon::end_page());
     }      }
     return;      return;
Line 181  sub make_changes { Line 185  sub make_changes {
        {href=>"javascript:changePage(document.$phase,'$phase')",         {href=>"javascript:changePage(document.$phase,'$phase')",
         text=>"Updated"});          text=>"Updated"});
     &print_header($r,$phase,$context,undef,$container);      &print_header($r,$phase,$context,undef,$container);
     my ($crstype,%lastact);      my $crstype;
     if ($context eq 'course') {      if ($context eq 'course') {
         $crstype = &Apache::loncommon::course_type();          $crstype = &Apache::loncommon::course_type();
     }      }
Line 192  sub make_changes { Line 196  sub make_changes {
                 if ($context eq 'domain') {                  if ($context eq 'domain') {
                     $r->print('<h3>'.&mt($prefs->{$item}{'text'}).'</h3>'.                      $r->print('<h3>'.&mt($prefs->{$item}{'text'}).'</h3>'.
                               &Apache::domainprefs::process_changes($r,$dom,                                &Apache::domainprefs::process_changes($r,$dom,
                                           $confname,$item,$roles,$values,\%lastact));                                            $confname,$item,$roles,$values));
                 } else {                  } else {
                     $changes{$item} = {};                      $changes{$item} = {};
                     &Apache::courseprefs::process_changes($dom,$item,$values,                      &Apache::courseprefs::process_changes($dom,$item,$values,
Line 237  sub make_changes { Line 241  sub make_changes {
     }      }
     &print_footer($r,$phase,'display',$footer_text,\@actions,$container);      &print_footer($r,$phase,'display',$footer_text,\@actions,$container);
     $r->print('</p>');      $r->print('</p>');
     return \%lastact;  
 }  }
   
 sub display_settings {  sub display_settings {
Line 258  sub display_settings { Line 261  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') {
                         my $settings;  
                         if (ref($values) eq 'HASH') {  
                             $settings = $values->{$item};  
                         }  
                         if ($item eq 'usersessions') {                          if ($item eq 'usersessions') {
                             $r->print('<script type="text/javascript">'."\n".                              $r->print('<script type="text/javascript">'."\n".
                                       '// <![CDATA['."\n".                                        '// <![CDATA['."\n".
                                       &Apache::loncommon::check_uncheck_jscript()."\n".                                        &Apache::loncommon::check_uncheck_jscript()."\n".
                                       '// ]]>'."\n".                                        '// ]]>'."\n".
                                       '</script>'."\n");                                        '</script>'."\n");
                         } elsif ($item eq 'selfcreation') {  
                             if (ref($values) eq 'HASH') {  
                                 $settings = $values->{'usercreation'};  
                             }  
                         } elsif ($item eq 'defaults') {  
                             if (ref($values->{'inststatus'}) eq 'HASH') {  
                                 if (ref($values->{'defaults'}) eq 'HASH') {  
                                     $settings = {%{$values->{'inststatus'}},%{$values->{'defaults'}}};  
                                 } else {  
                                     $settings = $values->{'inststatus'};  
                                 }  
                             } else {  
                                 my ($othertitle,$usertypes,$types) = &Apache::loncommon::sorted_inst_types($dom);  
                                 my $inststatus = {  
                                                    inststatustypes => $usertypes,  
                                                    inststatusorder => $types,  
                                                    inststatusguest => [],  
                                                  };  
                                 if (ref($values->{defaults}) eq 'HASH') {  
                                     $settings = {%{$inststatus},%{$values->{'defaults'}}};  
                                 } else {  
                                     $settings = $inststatus;  
                                 }  
                             }  
                         }                          }
                         ($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},$settings);                                  $phase,$item,$prefs->{$item},$values->{$item});
                     } else {                      } else {
                         ($output{$item},$rowtotal{$item}) =                          ($output{$item},$rowtotal{$item}) =
                             &Apache::courseprefs::print_config_box($r,$dom,$phase,                              &Apache::courseprefs::print_config_box($r,$dom,$phase,

Removed from v.1.21.4.6  
changed lines
  Added in v.1.22


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