Diff for /loncom/interface/lonwhatsnew.pm between versions 1.93 and 1.98

version 1.93, 2009/05/06 19:25:56 version 1.98, 2009/11/24 02:43:45
Line 42  use Time::Local; Line 42  use Time::Local;
 use GDBM_File;  use GDBM_File;
 use lib '/home/httpd/lib/perl/';  use lib '/home/httpd/lib/perl/';
 use LONCAPA;  use LONCAPA;
   use HTML::Entities;
   
 #----------------------------  #----------------------------
 # handler  # handler
Line 288  sub display_actions_box { Line 289  sub display_actions_box {
     my $lctype = lc($crstype);      my $lctype = lc($crstype);
     my %stulabel = (      my %stulabel = (
                     'Course' => 'students',                      'Course' => 'students',
                     'Group' => 'members',                      'Community' => 'members',
                    );                     );
     my %lt = &Apache::lonlocal::texthash(      my %lt = &Apache::lonlocal::texthash(
                  'yacc' => 'You are accessing an invalid course',                   'yacc' => 'You are accessing an invalid course',
Line 341  sub display_actions_box { Line 342  sub display_actions_box {
         return;          return;
     }      }
   
       my $header = '';
     if ($refpage eq 'start') {      if ($refpage eq 'start') {
         if (tie(my %bighash,'GDBM_File',$env{'request.course.fn'}.'.db',          if (tie(my %bighash,'GDBM_File',$env{'request.course.fn'}.'.db',
             &GDBM_READER(),0640)) {              &GDBM_READER(),0640)) {
             my $furl=$bighash{'first_url'};              my $furl=&HTML::Entities::encode($bighash{'first_url'},'"<>&');
             untie(%bighash);              untie(%bighash);
             $r->print('<span style="font-size: larger;"><a href="'.$furl.'">'.$lt{'gtfr'}.              $header .= '<b><a href="'.$furl.'">'.$lt{'gtfr'}.
                   '</a></span><br />');                    '</a></b><br />';
         }          }
     }      }
     $r->print(&mt('Page set to be displayed after you have selected a role in this '.$lctype).'.'      $header .= &mt('Page set to be displayed after you have selected a role in this '.$lctype).'.'
               .' <span class="LC_nobreak">'                .' <span class="LC_nobreak">'
               .&mt('Currently: [_1].','<i>'.$currinit.'</i>')                .&mt('Currently: [_1].','<i>'.$currinit.'</i>')
               .'&nbsp;&nbsp;'                .'&nbsp;&nbsp;'
               .&mt('[_1]Change[_2] for just [_3]this course[_4] or for all [_5]your courses[_6].'                .&mt('[_1]Change[_2] for just [_3]this '.$lctype.'[_4] or for [_5]all your courses/communities[_6].'
                   ,'<b>'                    ,'<b>'
                   ,'</b>'                    ,'</b>'
                   ,'<a href="/adm/whatsnew?command=courseinit&amp;refpage='.$refpage.'">'                    ,'<a href="/adm/whatsnew?command=courseinit&amp;refpage='.$refpage.'">'
                   ,'</a>'                    ,'</a>'
                   ,'<a href="/adm/preferences?action=changecourseinit&amp;refpage='.$refpage.'">'                    ,'<a href="/adm/preferences?action=changecourseinit&amp;refpage='.$refpage.'">'
                   ,'</a>')                    ,'</a>')
               .' </span><br /><hr />');                .' </span>';
   
       $r->print(&Apache::loncommon::head_subbox($header));
   
     if ($command eq 'reset') {      if ($command eq 'reset') {
         $result = &process_reset($cdom,$crs);          $result = &process_reset($cdom,$crs);
Line 378  sub display_actions_box { Line 382  sub display_actions_box {
     unless ($store_result eq 'ok') {       unless ($store_result eq 'ok') { 
         &Apache::lonnet::logthis('Error saving whatsnew settings: '.          &Apache::lonnet::logthis('Error saving whatsnew settings: '.
             $store_result.' for '.'user '.$uname.':'.$udom.' in '.$lctype.' '.$cid);              $store_result.' for '.'user '.$uname.':'.$udom.' in '.$lctype.' '.$cid);
         $result .= &mt('Unable to save visibility settings due to [_1]',          $result .= '<span class="LC_error">'
                        $store_result);                     .&mt('Unable to save visibility settings due to [_1]',
                          $store_result)
                     .'</span>';
     }      }
   
     if ($result) {      if ($result) {
         $r->print($result.'<hr width="100%" />');          $r->print($result.'<hr />');
     }      }
     $r->rflush();      $r->rflush();
   
Line 1952  sub start_box { Line 1958  sub start_box {
          if ($$show{$caller}) {           if ($$show{$caller}) {
              $r->print('               $r->print('
               <tr>                <tr>
                 <td class="LC_subheader" colspan="2"><a href="/adm/whatsnew?command=chgthreshold&refpage='.$refpage.'">'.$lt{'chth'}.'</a></td>                  <td class="LC_subheader" colspan="2"><a href="/adm/whatsnew?command=chgthreshold&amp;refpage='.$refpage.'">'.$lt{'chth'}.'</a></td>
               </tr>');                </tr>');
          }           }
      } elsif (($caller eq 'versionchanges') && ($$show{$caller})) {       } elsif (($caller eq 'versionchanges') && ($$show{$caller})) {
          if ($$show{$caller}) {           if ($$show{$caller}) {
              $r->print('               $r->print('
               <tr>                <tr>
                 <td class="LC_subheader" colspan="2"><a href="/adm/whatsnew?command=chginterval&refpage='.$refpage.'">'.$lt{'chin'}.'</a></td>                  <td class="LC_subheader" colspan="2"><a href="/adm/whatsnew?command=chginterval&amp;refpage='.$refpage.'">'.$lt{'chin'}.'</a></td>
               </tr>');                </tr>');
          }           }
      } elsif ($caller eq 'coursediscussion') {       } elsif ($caller eq 'coursediscussion') {
          if ($$show{$caller}) {           if ($$show{$caller}) {
              $r->print('               $r->print('
               <tr>                <tr>
                 <td class="LC_subheader" colspan="2"><a href="/adm/whatsnew?command=chgdisc&refpage='.$refpage.'">'.$lt{'chop'}.'</a></td>                  <td class="LC_subheader" colspan="2"><a href="/adm/whatsnew?command=chgdisc&amp;refpage='.$refpage.'">'.$lt{'chop'}.'</a></td>
               </tr>');                </tr>');
          }           }
      } elsif (($caller eq 'newroles') && ($$show{$caller})) {       } elsif (($caller eq 'newroles') && ($$show{$caller})) {
          if ($$show{$caller}) {           if ($$show{$caller}) {
              $r->print('               $r->print('
               <tr>                <tr>
                 <td class="LC_subheader" colspan="2"><a href="/adm/whatsnew?command=chgnewroleinterval&refpage='.$refpage.'">'.$lt{'chin'}.'</a></td>                  <td class="LC_subheader" colspan="2"><a href="/adm/whatsnew?command=chgnewroleinterval&amp;refpage='.$refpage.'">'.$lt{'chin'}.'</a></td>
               </tr>');                </tr>');
          }           }
      } elsif (($caller eq 'oldroles') && ($$show{$caller})) {       } elsif (($caller eq 'oldroles') && ($$show{$caller})) {
          if ($$show{$caller}) {           if ($$show{$caller}) {
              $r->print('               $r->print('
               <tr>                <tr>
                 <td class="LC_subheader" colspan="2"><a href="/adm/whatsnew?command=chgoldroleinterval&refpage='.$refpage.'">'.$lt{'chin'}.'</a></td>                  <td class="LC_subheader" colspan="2"><a href="/adm/whatsnew?command=chgoldroleinterval&amp;refpage='.$refpage.'">'.$lt{'chin'}.'</a></td>
               </tr>');                </tr>');
          }           }
      }       }

Removed from v.1.93  
changed lines
  Added in v.1.98


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