Diff for /loncom/interface/lonpreferences.pm between versions 1.69.2.1 and 1.70

version 1.69.2.1, 2005/12/28 21:40:25 version 1.70, 2005/12/19 21:39:37
Line 989  sub coursedisplaychanger { Line 989  sub coursedisplaychanger {
         $firstselect='';          $firstselect='';
         $whatsnewselect='checked="checked"';          $whatsnewselect='checked="checked"';
     }      }
     my $whatsnew_off=&mt('Display the first resource in the course.');      my $whatsnew_off=&mt('Display the [_1] in the course.','<b>first resource</b>');
     my $whatsnew_on=&mt('Display a summary of items in the course which require action from the course coordinator.');      my $whatsnew_on=&mt('Display the "[_1]" page - a summary of items in the course which require attention.',"<b>What's New</b>");
   
     $r->print('<br /><b>'.&mt('Set the page to be displayed when you select the role of Course Coordinator').':</b>');      $r->print('<br /><b>'.&mt('Set the default page to be displayed when you select a course role other than student or TA').':</b><br />'.&mt('The global user preference you set for your courses can be overridden in an individual course by setting a course specific setting via the "[_1]" page in the course',"<i>What's New</i>").'<br /><br />');
     $r->print(<<ENDLSCREEN);      $r->print(<<ENDLSCREEN);
 <form name="server" action="/adm/preferences" method="post">  <form name="server" action="/adm/preferences" method="post">
 <input type="hidden" name="action" value="verify_and_change_coursepage" />  <input type="hidden" name="action" value="verify_and_change_coursepage" />
 <br />  
 <label><input type="radio" name="newdisp" value="firstres" $firstselect /> $whatsnew_off</label><br />  <label><input type="radio" name="newdisp" value="firstres" $firstselect /> $whatsnew_off</label><br />
 <label><input type="radio" name="newdisp" value="whatsnew" $whatsnewselect /> $whatsnew_on</label>  <label><input type="radio" name="newdisp" value="whatsnew" $whatsnewselect /> $whatsnew_on</label><input type="hidden" name="refpage" value="$env{'form.refpage'}" />
 ENDLSCREEN  ENDLSCREEN
     $r->print('<br /><input type="submit" value="'.&mt('Change').'" />      $r->print('<br /><br /><input type="submit" value="'.&mt('Change').'" />
 </form>');  </form>');
 }  }
   
Line 1008  sub verify_and_change_coursepage { Line 1007  sub verify_and_change_coursepage {
     my $r = shift;      my $r = shift;
     my $message='';      my $message='';
     my %lt = &Apache::lonlocal::texthash(      my %lt = &Apache::lonlocal::texthash(
         'when' => 'Whenever you select the Course Coordinator role from the roles screen',          'defs' => 'Default now set',
           'when' => 'when selecting a course role other than student or TA from the roles screen',
         'ywbt' => 'you will be taken to the start of the course.',          'ywbt' => 'you will be taken to the start of the course.',
         'apwb' => 'a page will be displayed that lists items in the course that may require action from you.',          'apwb' => 'a page will be displayed that lists items in the course that may require action from you.',
         'gtts' => 'Go to the start of the course',          'gtts' => 'Go to the start of the course',
         'dasp' => 'Display a summary page listing course action items',           'dasp' => "Display the What's New page listing course action items", 
     );      );
     my $newdisp  = $env{'form.newdisp'};      my $newdisp  = $env{'form.newdisp'};
       $message = '<b>'.$lt{'defs'}.'</b>: '.$lt{'when'}.', ';
     if ($newdisp eq 'firstres') {      if ($newdisp eq 'firstres') {
         $message .= $lt{'when'}.', '.$lt{'ywbt'}.'<br/>';          $message .= $lt{'ywbt'}.'<br/>';
         &Apache::lonnet::put('environment',{'course_init_display' => $newdisp});          &Apache::lonnet::put('environment',{'course_init_display' => $newdisp});
         &Apache::lonnet::appenv('environment.course_init_display' => $newdisp);          &Apache::lonnet::appenv('environment.course_init_display' => $newdisp);
     } else {      } else {
         $message .= $lt{'when'}.', '.$lt{'apwb'}.'<br/>';          $message .= $lt{'apwb'}.'<br/>';
         &Apache::lonnet::del('environment',['course_init_display']);          &Apache::lonnet::del('environment',['course_init_display']);
         &Apache::lonnet::delenv('environment\.course_init_display');          &Apache::lonnet::delenv('environment\.course_init_display');
     }      }
       my $refpage = $env{'form.refpage'};
     if (($env{'request.course.fn'}) && ($env{'request.course.id'})) {      if (($env{'request.course.fn'}) && ($env{'request.course.id'})) {
         if ($newdisp eq 'firstres') {          if ($newdisp eq 'firstres') {
             my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'};              my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'};
Line 1032  sub verify_and_change_coursepage { Line 1034  sub verify_and_change_coursepage {
                 &Apache::lonuserstate::readmap($cdom.'/'.$cnum);                  &Apache::lonuserstate::readmap($cdom.'/'.$cnum);
             $message .= '<br /><font size="+1"><a href="'.$furl.'">'.$lt{'gtts'}.' <i>'.&mt('now').'</i></a></font>';              $message .= '<br /><font size="+1"><a href="'.$furl.'">'.$lt{'gtts'}.' <i>'.&mt('now').'</i></a></font>';
         } else {          } else {
             $message .= '<br /><font size="+1"><a href="/adm/whatsnew">'.$lt{'dasp'}.'</a></font>';              $message .= '<br /><font size="+1"><a href="/adm/whatsnew?refpage='.
                           $refpage.'">'.$lt{'dasp'}.'</a></font>';
         }          }
     }      }
     $r->print(<<ENDVCSCREEN);      $r->print(<<ENDVCSCREEN);
Line 1060  sub handler { Line 1063  sub handler {
     return OK if $r->header_only;      return OK if $r->header_only;
     #      #
     &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},      &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
                                             ['action','wysiwyg','returnurl']);                                     ['action','wysiwyg','returnurl','refpage']);
     #      #
     &Apache::lonhtmlcommon::clear_breadcrumbs();      &Apache::lonhtmlcommon::clear_breadcrumbs();
     &Apache::lonhtmlcommon::add_breadcrumb      &Apache::lonhtmlcommon::add_breadcrumb

Removed from v.1.69.2.1  
changed lines
  Added in v.1.70


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