Diff for /loncom/interface/lonpreferences.pm between versions 1.131 and 1.144

version 1.131, 2008/12/08 23:09:26 version 1.144, 2009/02/23 20:25:44
Line 126  $warning Line 126  $warning
 <label><input type="radio" name="wysiwyg" value="off" $onselect /> $switchoff</label><br />  <label><input type="radio" name="wysiwyg" value="off" $onselect /> $switchoff</label><br />
 <label><input type="radio" name="wysiwyg" value="on" $offselect /> $switchon</label>  <label><input type="radio" name="wysiwyg" value="on" $offselect /> $switchon</label>
 ENDLSCREEN  ENDLSCREEN
     $r->print('<br /><input type="submit" value="'.&mt('Change').'" />');      $r->print('<br /><input type="submit" value="'.&mt('Save').'" />');
 }  }
   
   
Line 172  sub languagechanger { Line 172  sub languagechanger {
 <input type="hidden" name="action" value="verify_and_change_languages" />  <input type="hidden" name="action" value="verify_and_change_languages" />
 <br />$pref: $selectionbox  <br />$pref: $selectionbox
 ENDLSCREEN  ENDLSCREEN
     $r->print('<br /><input type="submit" value="'.&mt('Change').'" />');      $r->print('<br /><input type="submit" value="'.&mt('Save').'" />');
 }  }
   
   
Line 190  sub verify_and_change_languages { Line 190  sub verify_and_change_languages {
         $message=&mt('Set new preferred languages to ').'<tt>"'.$newlanguage.'"</tt>.';          $message=&mt('Set new preferred languages to ').'<tt>"'.$newlanguage.'"</tt>.';
     } else {      } else {
         &Apache::lonnet::del('environment',['languages']);          &Apache::lonnet::del('environment',['languages']);
         &Apache::lonnet::delenv('environment\.languages');          &Apache::lonnet::delenv('environment.languages');
         $message=&mt('Reset preferred language.');          $message=&mt('Reset preferred language.');
     }      }
       &Apache::loncommon::flush_langs_cache($user,$domain);
     print_main_menu($r, $message);      print_main_menu($r, $message);
 #    $r->print(<<ENDVCSCREEN);  #    $r->print(<<ENDVCSCREEN);
 #$message  #$message
Line 226  sub texenginechanger { Line 227  sub texenginechanger {
     my %lt=&Apache::lonlocal::texthash(      my %lt=&Apache::lonlocal::texthash(
       'headline' => 'Change Math Preferences',        'headline' => 'Change Math Preferences',
       'preftxt'  => 'Preferred method to display Math',        'preftxt'  => 'Preferred method to display Math',
       'change'   => 'Change',        'change'   => 'Save',
       'exmpl'    => 'Examples',        'exmpl'    => 'Examples',
       'jsmath'   => 'jsMath:',        'jsmath'   => 'jsMath:',
       'tth'      => 'tth (TeX to HTML):',        'tth'      => 'tth (TeX to HTML):',
Line 238  sub texenginechanger { Line 239  sub texenginechanger {
 <form name="prefs" action="/adm/preferences" method="post">  <form name="prefs" action="/adm/preferences" method="post">
 <input type="hidden" name="action" value="verify_and_change_texengine" />  <input type="hidden" name="action" value="verify_and_change_texengine" />
 <p>  <p>
 $lt{'preftxt'}:<br />  $lt{'preftxt'}: $selectionbox 
 $selectionbox <input type="submit" value="$lt{'change'}" />  <br />
   <input type="submit" value="$lt{'change'}" />
 </p>  </p>
 </form>  </form>
 <br />  <br />
Line 305  sub verify_and_change_texengine { Line 307  sub verify_and_change_texengine {
         $message=&mt('Set new preferred math display to ').'<tt>"'.$newtexengine.'"</tt>.';          $message=&mt('Set new preferred math display to ').'<tt>"'.$newtexengine.'"</tt>.';
     } else {      } else {
         &Apache::lonnet::del('environment',['texengine']);          &Apache::lonnet::del('environment',['texengine']);
         &Apache::lonnet::delenv('environment\.texengine');          &Apache::lonnet::delenv('environment.texengine');
         $message=&mt('Reset preferred math display.');          $message=&mt('Reset preferred math display.');
     }      }
   
Line 401  sub rolesprefchanger { Line 403  sub rolesprefchanger {
 </p>  </p>
 '.$roles_check_list.'  '.$roles_check_list.'
 <br />  <br />
 <input type="submit" value="'.&mt('Change').'" />  <input type="submit" value="'.&mt('Save').'" />
 </form>');  </form>');
 }  }
   
Line 450  sub verify_and_change_rolespref { Line 452  sub verify_and_change_rolespref {
         $message=&mt('Recent '.$role.'s Hotlist is Enabled');          $message=&mt('Recent '.$role.'s Hotlist is Enabled');
     } else {      } else {
         &Apache::lonnet::del('environment',['recentroles']);          &Apache::lonnet::del('environment',['recentroles']);
         &Apache::lonnet::delenv('environment\.recentroles');          &Apache::lonnet::delenv('environment.recentroles');
         $message=&mt('Recent '.$role.'s Hotlist is Disabled');          $message=&mt('Recent '.$role.'s Hotlist is Disabled');
     }      }
     if ($hotlist_n) {      if ($hotlist_n) {
Line 514  sub screennamechanger { Line 516  sub screennamechanger {
         ('environment',['screenname','nickname']);          ('environment',['screenname','nickname']);
     my $screenname=$userenv{'screenname'};      my $screenname=$userenv{'screenname'};
     my $nickname=$userenv{'nickname'};      my $nickname=$userenv{'nickname'};
     my %lt = &Apache::lonlocal::texthash(  
                                           text_screenname  => 'New screenname (shown if you post anonymously):',  
                                           text_nickname  => 'New nickname (shown if you post non-anonymously):',  
                                           text_submit => 'Change',  
                                         );  
     Apache::lonhtmlcommon::add_breadcrumb(      Apache::lonhtmlcommon::add_breadcrumb(
  { href => '/adm/preferences?action=changescreenname',   { href => '/adm/preferences?action=changescreenname',
                   text => 'Change Screen Name'});                    text => 'Change Screen Name'});
     $r->print(Apache::loncommon::start_page('Change Screen Name'));      $r->print(Apache::loncommon::start_page('Change Screen Name'));
     $r->print(Apache::lonhtmlcommon::breadcrumbs('Change Screen Name'));      $r->print(Apache::lonhtmlcommon::breadcrumbs('Change Screen Name'));
     $r->print(<<ENDSCREEN);      $r->print('<p>'
 <form name="prefs" action="/adm/preferences" method="post">               .&mt('Change the name that is displayed in your posts.')
 <input type="hidden" name="action" value="verify_and_change_screenname" />               .'</p>'
 <br />$lt{'text_screenname'}      );
 <input type="text" size="20" value="$screenname" name="screenname" />      $r->print('<form name="prefs" action="/adm/preferences" method="post">'
 <br />$lt{'text_nickname'}               .'<input type="hidden" name="action" value="verify_and_change_screenname" />'
 <input type="text" size="20" value="$nickname" name="nickname" />               .&Apache::lonhtmlcommon::start_pick_box()
 <br />               .&Apache::lonhtmlcommon::row_title(&mt('New screenname (shown if you post anonymously)'))
 <input type="submit" value="$lt{'text_submit'}" />               .'<input type="text" size="20" value="'.$screenname.'" name="screenname" />'
 </form>               .&Apache::lonhtmlcommon::row_closure()
 ENDSCREEN               .&Apache::lonhtmlcommon::row_title(&mt('New nickname (shown if you post non-anonymously)'))
                .'<input type="text" size="20" value="'.$nickname.'" name="nickname" />'
                .&Apache::lonhtmlcommon::row_closure()
                .&Apache::lonhtmlcommon::row_title()
                .'<input type="submit" value="'.&mt('Save').'" />'
                .&Apache::lonhtmlcommon::row_closure(1)
                .&Apache::lonhtmlcommon::end_pick_box()
                .'</form>'
       );
 }  }
   
 sub verify_and_change_screenname {  sub verify_and_change_screenname {
Line 551  sub verify_and_change_screenname { Line 556  sub verify_and_change_screenname {
         $message=&mt('Set new screenname to ').'<tt>"'.$newscreen.'."</tt>.';          $message=&mt('Set new screenname to ').'<tt>"'.$newscreen.'."</tt>.';
     } else {      } else {
         &Apache::lonnet::del('environment',['screenname']);          &Apache::lonnet::del('environment',['screenname']);
         &Apache::lonnet::delenv('environment\.screenname');          &Apache::lonnet::delenv('environment.screenname');
         $message=&mt('Reset screenname.');          $message=&mt('Reset screenname.');
     }      }
 # Nickname  # Nickname
Line 564  sub verify_and_change_screenname { Line 569  sub verify_and_change_screenname {
         $message.=&mt('Set new nickname to ').'<tt>"'.$newscreen.'"</tt>.';          $message.=&mt('Set new nickname to ').'<tt>"'.$newscreen.'"</tt>.';
     } else {      } else {
         &Apache::lonnet::del('environment',['nickname']);          &Apache::lonnet::del('environment',['nickname']);
         &Apache::lonnet::delenv('environment\.nickname');          &Apache::lonnet::delenv('environment.nickname');
         $message.=&mt('Reset nickname.');          $message.=&mt('Reset nickname.');
     }      }
     &Apache::lonnet::devalidate_cache_new('namescache',$user.':'.$domain);      &Apache::lonnet::devalidate_cache_new('namescache',$user.':'.$domain);
Line 603  sub iconchanger { Line 608  sub iconchanger {
     my $useicons=&mt('Use icons and text');      my $useicons=&mt('Use icons and text');
     my $usebuttons=&mt('Use buttons and text');      my $usebuttons=&mt('Use buttons and text');
     my $useicononly=&mt('Use icons only');      my $useicononly=&mt('Use icons only');
     my $change=&mt('Change');      my $change=&mt('Save');
     $r->print(<<ENDSCREEN);      $r->print(<<ENDSCREEN);
 <form name="prefs" action="/adm/preferences" method="post">  <form name="prefs" action="/adm/preferences" method="post">
 <input type="hidden" name="action" value="verify_and_change_icons" />  <input type="hidden" name="action" value="verify_and_change_icons" />
Line 696  sub domcoordchanger { Line 701  sub domcoordchanger {
     }      }
     my $text=&mt('By default, the Domain Coordinator can enter your construction space.');      my $text=&mt('By default, the Domain Coordinator can enter your construction space.');
     my $construction=&mt('Block access to construction space');      my $construction=&mt('Block access to construction space');
     my $change=&mt('Change');      my $change=&mt('Save');
     $r->print(<<ENDSCREEN);      $r->print(<<ENDSCREEN);
 <form name="prefs" action="/adm/preferences" method="post">  <form name="prefs" action="/adm/preferences" method="post">
 <input type="hidden" name="action" value="verify_and_change_domcoord" />  <input type="hidden" name="action" value="verify_and_change_domcoord" />
Line 775  sub msgforwardchanger { Line 780  sub msgforwardchanger {
                                           mnot  => 'E-mail Address(es) which should be notified about new LON-CAPA messages',                                            mnot  => 'E-mail Address(es) which should be notified about new LON-CAPA messages',
  # old: 'Message Notification Email Address(es)',   # old: 'Message Notification Email Address(es)',
                                           mnot_exmpl => 'e.g. <tt>joe@doe.com</tt>',                                            mnot_exmpl => 'e.g. <tt>joe@doe.com</tt>',
                                           chg   => 'Change',                                            chg   => 'Save',
                                           email => 'The e-mail address entered in row ',                                            email => 'The e-mail address entered in row ',
                                           notv => 'is not a valid e-mail address',                                            notv => 'is not a valid e-mail address',
                                           toen => "To enter multiple addresses, enter one address at a time, click 'Change' and then add the next one",                                             toen => "To enter multiple addresses, enter one address at a time, click 'Change' and then add the next one", 
                                           prme => 'Back to preferences menu',                                            prme => 'Back',
                                         );                                          );
     Apache::lonhtmlcommon::add_breadcrumb(      Apache::lonhtmlcommon::add_breadcrumb(
     { href => '/adm/preferences?action=changemsgforward',      { href => '/adm/preferences?action=changemsgforward',
Line 951  ENDMSG Line 956  ENDMSG
     $r->print(qq|      $r->print(qq|
 <br /><hr />  <br /><hr />
 <input type="hidden" name="numnotify" value="$num" />  <input type="hidden" name="numnotify" value="$num" />
 <input type="button" value="$lt{'chg'}" onclick="javascript:validate()" />  
 <input type="button" value="$lt{'prme'}" onclick="location.href='/adm/preferences'" />  <input type="button" value="$lt{'prme'}" onclick="location.href='/adm/preferences'" />
   <input type="button" value="$lt{'chg'}" onclick="javascript:validate()" />
 </form>  </form>
 |);  |);
   
Line 998  sub verify_and_change_msgforward { Line 1003  sub verify_and_change_msgforward {
                     .'<br />';                      .'<br />';
     } else {      } else {
         &Apache::lonnet::del('environment',['msgforward']);          &Apache::lonnet::del('environment',['msgforward']);
         &Apache::lonnet::delenv('environment\.msgforward');          &Apache::lonnet::delenv('environment.msgforward');
         $message.= &mt("Set message forwarding to 'off'.").'<br />';          $message.= &mt("Set message forwarding to 'off'.").'<br />';
     }      }
     my $critnotification;      my $critnotification;
Line 1038  sub verify_and_change_msgforward { Line 1043  sub verify_and_change_msgforward {
         $message.=&mt('Set non-critical message notification address(es) to ').'<tt>"'.$notification.'"</tt>.<br />';          $message.=&mt('Set non-critical message notification address(es) to ').'<tt>"'.$notification.'"</tt>.<br />';
     } else {      } else {
         &Apache::lonnet::del('environment',['notification']);          &Apache::lonnet::del('environment',['notification']);
         &Apache::lonnet::delenv('environment\.notification');          &Apache::lonnet::delenv('environment.notification');
         $message.=&mt("Set non-critical message notification to 'off'.").'<br />';          $message.=&mt("Set non-critical message notification to 'off'.").'<br />';
     }      }
     if ($critnotification) {      if ($critnotification) {
Line 1047  sub verify_and_change_msgforward { Line 1052  sub verify_and_change_msgforward {
         $message.=&mt('Set critical message notification address(es) to ').'<tt>"'.$critnotification.'"</tt>.<br />';          $message.=&mt('Set critical message notification address(es) to ').'<tt>"'.$critnotification.'"</tt>.<br />';
     } else {      } else {
         &Apache::lonnet::del('environment',['critnotification']);          &Apache::lonnet::del('environment',['critnotification']);
         &Apache::lonnet::delenv('environment\.critnotification');          &Apache::lonnet::delenv('environment.critnotification');
         $message.=&mt("Set critical message notification to 'off'.").'<br />';          $message.=&mt("Set critical message notification to 'off'.").'<br />';
     }      }
     if ($critnotification || $notification) {      if ($critnotification || $notification) {
Line 1057  sub verify_and_change_msgforward { Line 1062  sub verify_and_change_msgforward {
             $message.=&mt('Set address(es) to receive excerpts with html retained ').'<tt>"'.$notify_with_html.'"</tt>.';              $message.=&mt('Set address(es) to receive excerpts with html retained ').'<tt>"'.$notify_with_html.'"</tt>.';
         } else {          } else {
             &Apache::lonnet::del('environment',['notifywithhtml']);              &Apache::lonnet::del('environment',['notifywithhtml']);
             &Apache::lonnet::delenv('environment\.notifywithhtml');              &Apache::lonnet::delenv('environment.notifywithhtml');
             if ($totaladdresses == 1) {              if ($totaladdresses == 1) {
                 $message.=&mt("Set notification address to receive excerpts with html stripped.");                  $message.=&mt("Set notification address to receive excerpts with html stripped.");
             } else {              } else {
Line 1066  sub verify_and_change_msgforward { Line 1071  sub verify_and_change_msgforward {
         }          }
     } else {      } else {
         &Apache::lonnet::del('environment',['notifywithhtml']);          &Apache::lonnet::del('environment',['notifywithhtml']);
         &Apache::lonnet::delenv('environment\.notifywithhtml');          &Apache::lonnet::delenv('environment.notifywithhtml');
     }      }
     if ($message) {      if ($message) {
         $message .= '<br /><hr />';          $message .= '<br /><hr />';
Line 1111  sub colorschanger { Line 1116  sub colorschanger {
     }      }
     my $end_data_table = &Apache::loncommon::end_data_table();      my $end_data_table = &Apache::loncommon::end_data_table();
     my $pjump_def = &Apache::lonhtmlcommon::pjump_javascript_definition();      my $pjump_def = &Apache::lonhtmlcommon::pjump_javascript_definition();
       my $save = &mt('Save');
       my $rstall = &mt('Reset All');
       my $resetdefault = &mt('Reset All Colors to Default');
     $r->print(<<ENDCOL);      $r->print(<<ENDCOL);
 <script type="text/javascript">  <script type="text/javascript">
   
Line 1149  $start_data_table Line 1157  $start_data_table
 $chtable  $chtable
 $end_data_table  $end_data_table
 </table>  </table>
 <input type="submit" value="Change Custom Colors" />  <input type="submit" value="$save" />
 <input type="submit" name="resetall" value="Reset All Colors to Default" />  <input type="submit" name="resetall" value="$rstall" title="$resetdefault" />
 </form>  </form>
 ENDCOL  ENDCOL
 }  }
Line 1178  sub verify_and_change_colors { Line 1186  sub verify_and_change_colors {
     $message.=&mt('Set '.$colortypes{$item}.' to ').'<tt>"'.$color.'"</tt>.<br />';      $message.=&mt('Set '.$colortypes{$item}.' to ').'<tt>"'.$color.'"</tt>.<br />';
  } else {   } else {
     &Apache::lonnet::del('environment',[$entry]);      &Apache::lonnet::del('environment',[$entry]);
     &Apache::lonnet::delenv('environment\.'.$entry);      &Apache::lonnet::delenv('environment.'.$entry);
     $message.=&mt('Reset '.$colortypes{$item}.'.').'<br />';      $message.=&mt('Reset '.$colortypes{$item}.'.').'<br />';
  }   }
     }      }
Line 1207  sub passwordchanger { Line 1215  sub passwordchanger {
     Apache::lonhtmlcommon::add_breadcrumb(      Apache::lonhtmlcommon::add_breadcrumb(
  { href => '/adm/preferences?action=changepass',   { href => '/adm/preferences?action=changepass',
                   text => 'Change Password'});                    text => 'Change Password'});
     $r->print(Apache::loncommon::start_page('Change Password'));      unless ($caller eq 'reset_by_email') {
     $r->print(Apache::lonhtmlcommon::breadcrumbs('Change Password'));          $r->print(Apache::loncommon::start_page('Change Password'));
           $r->print(Apache::lonhtmlcommon::breadcrumbs('Change Password'));
       }
     if ((!defined($caller)) || ($caller eq 'preferences')) {      if ((!defined($caller)) || ($caller eq 'preferences')) {
         $user = $env{'user.name'};          $user = $env{'user.name'};
         $domain = $env{'user.domain'};          $domain = $env{'user.domain'};
Line 1334  sub client_form { Line 1344  sub client_form {
                 'currentpass' => 'Current Password',                  'currentpass' => 'Current Password',
                 'newpass' => 'New Password',                  'newpass' => 'New Password',
                 'confirmpass' => 'Confirm Password',                  'confirmpass' => 'Confirm Password',
                 'changepass' => 'Change Password');                  'changepass' => 'Save');
   
     my $output = qq|      my $output = qq|
 <form name="client" >  <form name="client" >
Line 1544  ENDERROR Line 1554  ENDERROR
     # Inform the user the password has (not?) been changed      # Inform the user the password has (not?) been changed
     my $message;      my $message;
     if ($result =~ /^ok$/) {      if ($result =~ /^ok$/) {
         $message = &mt('The password for [_1] was successfully changed',$user);          $message = &mt('The password for [_1] was successfully changed.',$user);
         print_main_menu($r, $message);          if ($caller eq 'reset_by_email') {
               $r->print($message.'<br />');
           } else {
               &print_main_menu($r, $message);
           }
 # $r->print("<h3>".&mt('The password for [_1] was successfully changed',$user)."</h3>");  # $r->print("<h3>".&mt('The password for [_1] was successfully changed',$user)."</h3>");
     } else {      } else {
  # error error: run in circles, scream and shout   # error error: run in circles, scream and shout
         $message = &mt("The password for [_1] was not changed",$user)          $message = &mt("The password for [_1] was not changed.",$user).' '.
  .&mt('Please make sure your old password was entered correctly.');   .&mt('Please make sure your old password was entered correctly.');
         print_main_menu($r, $message);          unless ($caller eq 'reset_by_email') {
               &print_main_menu($r, $message);
           }
 #        $r->print("<h3><span class='LC_error'>".&mt("The password for [_1] was not changed",$user)."</span></h3>".  #        $r->print("<h3><span class='LC_error'>".&mt("The password for [_1] was not changed",$user)."</span></h3>".
 #                  &mt('Please make sure your old password was entered correctly.'));  #                  &mt('Please make sure your old password was entered correctly.'));
         return 1;          return 1;
Line 1597  sub discussionchanger { Line 1613  sub discussionchanger {
         'pref' => 'Display Preference',          'pref' => 'Display Preference',
         'curr' => 'Current setting ',          'curr' => 'Current setting ',
         'actn' => 'Action',          'actn' => 'Action',
         'sdpf' => 'Set display preferences for discussion posts for both bulletin boards and individual resources in all your courses.',          'sdpf' => 'Set display preferences for discussion posts for both discussion boards and individual resources in all your courses.',
         'prca' => 'Preferences can be set that determine',          'prca' => 'Preferences can be set that determine',
         'whpo' => 'Which posts are displayed when you display a bulletin board or resource, and',          'whpo' => 'Which posts are displayed when you display a discussion board or resource, and',
         'unwh' => 'Under what circumstances posts are identfied as "New"',          'unwh' => 'Under what circumstances posts are identfied as "New"',
         'allposts' => 'All posts',          'allposts' => 'All posts',
         'unread' => 'New posts only',          'unread' => 'New posts only',
Line 1659  END Line 1675  END
 END  END
     $r->print(&Apache::loncommon::end_data_table_row().      $r->print(&Apache::loncommon::end_data_table_row().
       &Apache::loncommon::end_data_table());        &Apache::loncommon::end_data_table());
     $r->print(<<"END");  
 <br />      $r->print('<br /><br /><input type="submit" name="sub" value="'.&mt('Save').'" /><br /><br />'.&mt('Note').': '.$lt{'thde'}.'</form>');
 <br />  
 <input type="submit" name="sub" value="Save Changes" />  
 <br />  
 <br />  
 Note: $lt{'thde'}  
 </form>  
 END  
 }  }
                                                                                                                                                                                                                                   
 sub verify_and_change_discussion {  sub verify_and_change_discussion {
Line 1684  sub verify_and_change_discussion { Line 1693  sub verify_and_change_discussion {
         } else {          } else {
             $message .= &mt('In discussions: all posts will be displayed.').'<br />';              $message .= &mt('In discussions: all posts will be displayed.').'<br />';
             &Apache::lonnet::del('environment',['discdisplay']);              &Apache::lonnet::del('environment',['discdisplay']);
             &Apache::lonnet::delenv('environment\.discdisplay');              &Apache::lonnet::delenv('environment.discdisplay');
         }          }
     }      }
     if (defined($env{'form.discmark'}) ) {      if (defined($env{'form.discmark'}) ) {
Line 1696  sub verify_and_change_discussion { Line 1705  sub verify_and_change_discussion {
         } else {          } else {
             $message.=&mt('In discussions: posts will be identified as "NEW" until marked as read by the reader.').'<br />';              $message.=&mt('In discussions: posts will be identified as "NEW" until marked as read by the reader.').'<br />';
             &Apache::lonnet::del('environment',['discmarkread']);              &Apache::lonnet::del('environment',['discmarkread']);
             &Apache::lonnet::delenv('environment\.discmarkread');              &Apache::lonnet::delenv('environment.discmarkread');
         }          }
     }      }
 #    $r->print(<<ENDVCSCREEN);  #    $r->print(<<ENDVCSCREEN);
Line 1728  sub coursedisplaychanger { Line 1737  sub coursedisplaychanger {
     $whatsnewselect = '';      $whatsnewselect = '';
         }          }
     }      }
     my %pagenames = (      my %pagenames = &Apache::lonlocal::texthash(
                        firstres => 'First resource',                         firstres => 'First resource',
                        whatsnew => "What's new page",                         whatsnew => "What's New Page",
                     );                      );
     my $whatsnew_off=&mt('Display the [_1] in the course.','<b>first resource</b>');      my $whatsnew_off=&mt('Display the [_1]first resource[_2] in the course.','<b>','</b>');
     my $whatsnew_on=&mt('Display the "[_1]" page - a summary of items in the course which require attention.',"<b>What's New</b>");      my $whatsnew_on=&mt("Display the [_1]What's New Page[_2] - a summary of items in the course which require attention.",'<b>','</b>');
   
     $r->print('<br /><b>'.&mt('Set the default page to be displayed when you select a course role').'</b>&nbsp;'.&mt('(Currently: [_1])',$pagenames{$currvalue}).'<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('<br /><b>'
                .&mt('Set the default page to be displayed when you select a course role')
                .'</b>&nbsp;'
                .&mt('(Currently: [_1])',$pagenames{$currvalue})
                .'<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]What's New Page[_2] in the course.",'<i>','</i>')
                .'<br /><br />'
       );
     $r->print(<<ENDLSCREEN);      $r->print(<<ENDLSCREEN);
 <form name="prefs" action="/adm/preferences" method="post">  <form name="prefs" 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" />
Line 1743  sub coursedisplaychanger { Line 1759  sub coursedisplaychanger {
 <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><input type="hidden" name="refpage" value="$env{'form.refpage'}" />  <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 /><br /><input type="submit" value="'.&mt('Change').'" />      $r->print('<br /><br /><input type="submit" value="'.&mt('Save').'" />
 </form>');  </form>');
 }  }
   
Line 1756  sub verify_and_change_coursepage { Line 1772  sub verify_and_change_coursepage {
         '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 the What's New 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'}.', ';      $message = '<b>'.$lt{'defs'}.'</b>: '.$lt{'when'}.', ';
Line 1767  sub verify_and_change_coursepage { Line 1783  sub verify_and_change_coursepage {
     } else {      } else {
         $message .= $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'};      my $refpage = $env{'form.refpage'};
     if (($env{'request.course.fn'}) && ($env{'request.course.id'})) {      if (($env{'request.course.fn'}) && ($env{'request.course.id'})) {
Line 1806  if (&Apache::lonnet::usertools_access($u Line 1822  if (&Apache::lonnet::usertools_access($u
 my @menu=  my @menu=
     ({ categorytitle=>'Personal Data',      ({ categorytitle=>'Personal Data',
  items =>[   items =>[
     { linktext => 'About Me',      { linktext => 'Personal Information Page',
  url => $aboutmeurl,   url => $aboutmeurl,
  permission => $permissions{'aboutme'},   permission => $permissions{'aboutme'},
  #help => 'Prefs_About_Me',   #help => 'Prefs_About_Me',
Line 1887  my @menu= Line 1903  my @menu=
  permission => 'F',   permission => 'F',
  #help => 'Change_Discussion_Display',   #help => 'Change_Discussion_Display',
  icon => 'mail-message-new.png',   icon => 'mail-message-new.png',
  linktitle => 'Set display preferences for discussion posts for both bulletin boards and individual resources in all your courses.'   linktitle => 'Set display preferences for discussion posts for both discussion boards and individual resources in all your courses.'
     },      },
  ]   ]
     },      },
Line 2143  sub handler2 { Line 2159  sub handler2 {
         '/adm/'.$env{'user.domain'}.'/'.$env{'user.name'}.'/aboutme';          '/adm/'.$env{'user.domain'}.'/'.$env{'user.name'}.'/aboutme';
     push (@Options,{ action => 'none',       push (@Options,{ action => 'none', 
                      linktext =>                       linktext =>
                          q{Edit the 'About Me' Personal Information Screen},                           q{Edit the Personal Information Page},
      help => 'Prefs_About_Me',       help => 'Prefs_About_Me',
                      href => $aboutmeaction});                       href => $aboutmeaction});
     push (@Options,({ action => 'changecolors',      push (@Options,({ action => 'changecolors',
Line 2420  sub handler2 { Line 2436  sub handler2 {
   
 sub toggle_debug {  sub toggle_debug {
     if ($env{'user.debug'}) {      if ($env{'user.debug'}) {
         &Apache::lonnet::delenv('user\.debug');          &Apache::lonnet::delenv('user.debug');
     } else {      } else {
         &Apache::lonnet::appenv({'user.debug' => 1});          &Apache::lonnet::appenv({'user.debug' => 1});
     }      }

Removed from v.1.131  
changed lines
  Added in v.1.144


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