Diff for /loncom/interface/domainprefs.pm between versions 1.429 and 1.431

version 1.429, 2023/09/06 13:57:05 version 1.431, 2023/11/07 11:50:56
Line 2425  sub print_quotas { Line 2425  sub print_quotas {
         @options = ('norequest','approval','automatic');          @options = ('norequest','approval','automatic');
         %titles = &authorrequest_titles();          %titles = &authorrequest_titles();
     } else {      } else {
         @usertools = ('aboutme','blog','portfolio','timezone');          @usertools = ('aboutme','blog','portfolio','portaccess','timezone');
         %titles = &tool_titles();          %titles = &tool_titles();
     }      }
     if (ref($types) eq 'ARRAY') {      if (ref($types) eq 'ARRAY') {
Line 9652  sub tool_titles { Line 9652  sub tool_titles {
                      aboutme    => 'Personal web page',                       aboutme    => 'Personal web page',
                      blog       => 'Blog',                       blog       => 'Blog',
                      portfolio  => 'Portfolio',                       portfolio  => 'Portfolio',
                        portaccess => 'Share portfolio files',
                      timezone   => 'Can set time zone',                       timezone   => 'Can set time zone',
                      official   => 'Official courses (with institutional codes)',                       official   => 'Official courses (with institutional codes)',
                      unofficial => 'Unofficial courses',                       unofficial => 'Unofficial courses',
Line 13391  sub modify_authordefaults { Line 13392  sub modify_authordefaults {
     my $resulttext;      my $resulttext;
     if ($putresult eq 'ok') {      if ($putresult eq 'ok') {
         if (keys(%changes)) {          if (keys(%changes)) {
               my %domdefaults = &Apache::lonnet::get_domain_defaults($dom);
             if ((exists($changes{'authorquota'})) || (exists($changes{'webdav'})) ||              if ((exists($changes{'authorquota'})) || (exists($changes{'webdav'})) ||
                 ($changes{'webdav_LC_adv'})) {                   ($changes{'webdav_LC_adv'})) { 
                 my %domdefaults = &Apache::lonnet::get_domain_defaults($dom,1);  
                 if ((exists($changes{'authorquota'})) && (ref($save_quotas{'authorquota'}) eq 'HASH')) {                  if ((exists($changes{'authorquota'})) && (ref($save_quotas{'authorquota'}) eq 'HASH')) {
                     $domdefaults{'authorquota'} = $save_quotas{'authorquota'};                      $domdefaults{'authorquota'} = $save_quotas{'authorquota'};
                 }                  }
Line 13401  sub modify_authordefaults { Line 13402  sub modify_authordefaults {
                     (ref($save_quotas{'webdav'}) eq 'HASH')) {                      (ref($save_quotas{'webdav'}) eq 'HASH')) {
                     $domdefaults{'webdav'} = $save_quotas{'webdav'};                      $domdefaults{'webdav'} = $save_quotas{'webdav'};
                 }                  }
                 my $cachetime = 24*60*60;  
                 &Apache::lonnet::do_cache_new('domdefaults',$dom,\%domdefaults,$cachetime);  
                 if (ref($lastactref) eq 'HASH') {  
                     $lastactref->{'domdefaults'} = 1;  
                 }  
             }              }
             $resulttext = &mt('Changes made:').'<ul>';              $resulttext = &mt('Changes made:').'<ul>';
             my $authoroverride;              my $authoroverride;
             foreach my $key ('nocodemirror','domcoordacc','copyright','sourceavail') {              foreach my $key ('nocodemirror','domcoordacc','copyright','sourceavail') {
                 if (exists($changes{$key})) {                  if (exists($changes{$key})) {
                       $domdefaults{$key} = $confhash{$key};
                     my $shown;                      my $shown;
                     unless ($authoroverride) {                      unless ($authoroverride) {
                         $resulttext .= '<li>'.&mt('Defaults which can be overridden by Author').'<ul>';                          $resulttext .= '<li>'.&mt('Defaults which can be overridden by Author').'<ul>';
Line 13438  sub modify_authordefaults { Line 13435  sub modify_authordefaults {
                         $domcoordoverride = 1;                          $domcoordoverride = 1;
                     }                      }
                     if ($key eq 'editors') {                      if ($key eq 'editors') {
                         if (@{$confhash{'editors'}}) {                          if (ref($confhash{'editors'}) eq 'ARRAY') {
                             $shown = join(', ', map { $titles{$_} } @{$confhash{'editors'}});                              $domdefaults{'editors'} = join(',',@{$confhash{'editors'}});
                         } else {                              if (@{$confhash{'editors'}}) {
                             $shown = &mt('None');                                  $shown = join(', ', map { $titles{$_} } @{$confhash{'editors'}});
                               } else {
                                   $shown = &mt('None');
                               }
                         }                          }
                     } elsif ($key eq 'authorquota') {                      } elsif ($key eq 'authorquota') {
                         foreach my $type (@insttypes) {                          foreach my $type (@insttypes) {
Line 13466  sub modify_authordefaults { Line 13466  sub modify_authordefaults {
             if ($domcoordoverride) {              if ($domcoordoverride) {
                 $resulttext .= '</ul></li>';                  $resulttext .= '</ul></li>';
             }              }
               my $cachetime = 24*60*60;
               &Apache::lonnet::do_cache_new('domdefaults',$dom,\%domdefaults,$cachetime);
               if (ref($lastactref) eq 'HASH') {
                   $lastactref->{'domdefaults'} = 1;
               }
         } else {          } else {
             $resulttext = &mt('No changes made to Authoring Space defaults');              $resulttext = &mt('No changes made to Authoring Space defaults');
         }          }
Line 14046  sub modify_quotas { Line 14051  sub modify_quotas {
         @usertools = ('author');          @usertools = ('author');
         %titles = &authorrequest_titles();          %titles = &authorrequest_titles();
     } else {      } else {
         @usertools = ('aboutme','blog','portfolio','timezone');          @usertools = ('aboutme','blog','portfolio','portaccess','timezone');
         %titles = &tool_titles();          %titles = &tool_titles();
     }      }
     my %domdefaults = &Apache::lonnet::get_domain_defaults($dom,1);      my %domdefaults = &Apache::lonnet::get_domain_defaults($dom,1);

Removed from v.1.429  
changed lines
  Added in v.1.431


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