Diff for /loncom/interface/lonpreferences.pm between versions 1.196 and 1.196.4.6

version 1.196, 2011/12/08 21:52:32 version 1.196.4.6, 2012/12/10 20:55:44
Line 227  sub texenginechanger { Line 227  sub texenginechanger {
      'tth' => 'tth (TeX to HTML)',       'tth' => 'tth (TeX to HTML)',
      #'ttm' => 'TeX to MathML',       #'ttm' => 'TeX to MathML',
      'jsMath' => 'jsMath',       'jsMath' => 'jsMath',
      'MathJax' => 'MathJax',                       'MathJax' => 'MathJax',
      'mimetex' => 'mimetex (Convert to Images)',       'mimetex' => 'mimetex (Convert to Images)',
                      'raw' => 'Raw (Screen Reader)'                       'raw' => 'Raw (Screen Reader)'
                      );                       );
Line 354  sub rolesprefchanger { Line 354  sub rolesprefchanger {
     my $domain     = $env{'user.domain'};      my $domain     = $env{'user.domain'};
     my %userenv = &Apache::lonnet::get      my %userenv = &Apache::lonnet::get
         ('environment',['recentroles','recentrolesn']);          ('environment',['recentroles','recentrolesn']);
       my $brtext = 'Change '.$role.' Page Pref';
       my $brtitle;
       if ($env{'form.returnurl'} eq '/adm/roles') {
           $brtext = 'Configure Hotlist';
       } else {
           $brtitle = $brtext;
       }
     Apache::lonhtmlcommon::add_breadcrumb(      Apache::lonhtmlcommon::add_breadcrumb(
     { href => '/adm/preferences?action=changerolespref',      { href => '/adm/preferences?action=changerolespref',
                 text => 'Change '.$role.' Page Pref'});                  text => $brtext});
     $r->print(Apache::loncommon::start_page('Content Display Settings'));      $r->print(Apache::loncommon::start_page('Content Display Settings'));
     $r->print(Apache::lonhtmlcommon::breadcrumbs('Change '.$role.' Page Pref'));      $r->print(Apache::lonhtmlcommon::breadcrumbs($brtitle));
     my $hotlist_flag=$userenv{'recentroles'};      my $hotlist_flag=$userenv{'recentroles'};
     my $hotlist_n=$userenv{'recentrolesn'};      my $hotlist_n=$userenv{'recentrolesn'};
     my $checked;      my ($checkedon,$checkedoff);
     if ($hotlist_flag) {      if ($hotlist_flag) {
  $checked = 'checked="checked"';          $checkedon = 'checked="checked"'; 
       } else {
           $checkedoff = 'checked="checked"';
     }      }
           
     if (!$hotlist_n) { $hotlist_n=3; }      if (!$hotlist_n) { $hotlist_n=3; }
Line 390  sub rolesprefchanger { Line 399  sub rolesprefchanger {
     &Apache::loncommon::start_data_table().      &Apache::loncommon::start_data_table().
     &Apache::loncommon::start_data_table_header_row().      &Apache::loncommon::start_data_table_header_row().
     "<th>".&mt('Freeze '.$role)."</th>".      "<th>".&mt('Freeze '.$role)."</th>".
     "<th>".&mt($role)."</td>".      "<th>".&mt($role)."</th>".
     &Apache::loncommon::end_data_table_header_row().      &Apache::loncommon::end_data_table_header_row().
     "\n";      "\n";
  my $count;   my $count;
Line 413  sub rolesprefchanger { Line 422  sub rolesprefchanger {
         $roles_check_list .= "</table>\n";          $roles_check_list .= "</table>\n";
     }      }
   
       my $actionurl = '/adm/preferences';
       if ($env{'form.returnurl'} eq '/adm/roles') {
           $actionurl = '/adm/roles';
       }
       $r->print('<h3>'.&mt('Recent Roles Hotlist').'</h3>');
       unless ($checkedon) {
           $r->print(&mt('LON-CAPA users with several '.$lc_role.'s may wish to enable the Hotlist.').'<br />');
       }
     $r->print('      $r->print('
 <p>'.&mt('Some LON-CAPA users have a long list of '.$lc_role.'s. The Recent '.$role.'s Hotlist feature keeps track of the last N '.$lc_role.'s which have been visited and places a table of these at the top of the '.$lc_role.'s page. People with very few '.$lc_role.'s should leave this feature disabled.').'  <form name="prefs" action="'.$actionurl.'" method="post">
 </p>  
 <form name="prefs" action="/adm/preferences" method="post">  
 <input type="hidden" name="action" value="verify_and_change_rolespref" />  <input type="hidden" name="action" value="verify_and_change_rolespref" />
 <br />'.  <input type="hidden" name="returnurl" value="'.$env{'form.returnurl'}.'" />
 '<h2>'.&mt('Recent '.$role.'s Hotlist').'</h2>'.  <div class="LC_left_float"><h4>'.&mt('Hotlist options').'</h4>
   <p>'.
   &mt('When enabled, the Hotlist keeps track of the last N '.$lc_role.'s visited.').'<br />'.
   &mt('Those N '.$lc_role.'s are then shown in a table at the top of the '.$lc_role.'s page.').'</p>'.
 &Apache::lonhtmlcommon::start_pick_box().  &Apache::lonhtmlcommon::start_pick_box().
 &Apache::lonhtmlcommon::row_title('<label for="Hotlist">'.&mt('Enable Recent '.$role.'s Hotlist').'</label>').  &Apache::lonhtmlcommon::row_title(&mt('Use Recent '.$role.'s Hotlist')).
 '<input id="Hotlist" type="checkbox"'.$checked.' name="recentroles" value="true" />'.  '<span class="LC_nobreak">
   <label><input id="Hotliston" type="radio" '.$checkedon.' name="recentroles" value="1" />'.&mt('Yes').'</label>'.
   ('&nbsp;'x2).
   '<label><input id="Hotlistoff" type="radio" '.$checkedoff.' name="recentroles" value="0" />'.&mt('No').'</label>
   </span>'.
 &Apache::lonhtmlcommon::row_closure().  &Apache::lonhtmlcommon::row_closure().
 &Apache::lonhtmlcommon::row_title('<label for="NumberOfRoles">'.&mt('Number of '.$role.'s in Hotlist').'</label>').  &Apache::lonhtmlcommon::row_title('<label for="NumberOfRoles">'.&mt('Number of '.$role.'s in Hotlist').'</label>').
 '<select name="recentrolesn" size="1" id ="NumberOfRoles">'.  '<select name="recentrolesn" size="1" id ="NumberOfRoles">'.
 $options.  $options.'
 '</select>'.  </select>'.
 &Apache::lonhtmlcommon::row_closure(1).  &Apache::lonhtmlcommon::row_closure(1).
 &Apache::lonhtmlcommon::end_pick_box().  &Apache::lonhtmlcommon::end_pick_box().'
 '<br/><h2>'.&mt('Freeze Roles').'</h2>'.  </div>');
 '<p>'.&mt('This list below can be used to <q>freeze</q> '.$lc_role.'s on your screen. Those marked as frozen will not be removed from the list, even if they have not been used recently.').'      if ($roles_check_list) {
           $r->print('<div class="LC_left_float">
   <h4>'.&mt('Freeze Roles').'</h4>
   <p>'.&mt('The table below can be used to [_1]freeze[_2] '.$lc_role.'s in the Hotlist.','<q>','</q>').'<br />'.
   &mt('Those marked frozen will not be removed from the list, even if not recently used.').'
 </p>  </p>
 '.$roles_check_list.'  '.$roles_check_list.'
 <br />  </div>');
        } else {
            $r->print('<br clear="all" />'.
                      &mt('Once the Hotlist contains recently visited '.$lc_role.'s, you can return to this page to also set frozen roles.'));
        }
        $r->print('
   <br clear="all" />
 <input type="submit" value="'.&mt('Save').'" />  <input type="submit" value="'.&mt('Save').'" />
 </form>');  </form>');
 }  }
Line 525  sub verify_and_change_rolespref { Line 557  sub verify_and_change_rolespref {
         }          }
     }      }
     $message=&Apache::loncommon::confirmwrapper($message);      $message=&Apache::loncommon::confirmwrapper($message);
     &print_main_menu($r, $message);      if ($env{'form.returnurl'} eq '/adm/roles') {
           return $message;
       } else {
           &print_main_menu($r, $message);
       }
 }  }
   
   
Line 684  sub icon_options { Line 720  sub icon_options {
 sub icon_previews {  sub icon_previews {
      my %icon_text = (       my %icon_text = (
                       annotate => 'Notes',                        annotate => 'Notes',
                       wishlist => 'Wishlist',                        wishlist => 'Stored Links',
                       catalog  => 'Info',                        catalog  => 'Info',
                       evaluate => 'Evaluate',                        evaluate => 'Evaluate',
                       feedback => 'Communicate',                        feedback => 'Communicate',
Line 692  sub icon_previews { Line 728  sub icon_previews {
                      );                       );
     my %inlinetools = (      my %inlinetools = (
         printout => "s&8&3&prt.png&$icon_text{'printout'}&printout[_1]&gopost('/adm/printout',currentURL)&Prepare a printable document",          printout => "s&8&3&prt.png&$icon_text{'printout'}&printout[_1]&gopost('/adm/printout',currentURL)&Prepare a printable document",
         wishlist => "s&9&1&wishlist-link.png&$icon_text{'wishlist'}&wishlistlink[_2]&set_wishlistlink()&Set a link for this resource to wishlist",          wishlist => "s&9&1&wishlist-link.png&$icon_text{'wishlist'}&wishlistlink[_2]&set_wishlistlink()&Save a link for this resource in your personal Stored Links repository",
         evaluate => "s&8&1&eval.png&$icon_text{'evaluate'}&this[_1]&gopost('/adm/evaluate',currentURL,1)&Provide my evaluation of this resource",          evaluate => "s&8&1&eval.png&$icon_text{'evaluate'}&this[_1]&gopost('/adm/evaluate',currentURL,1)&Provide my evaluation of this resource",
         feedback => "s&8&2&fdbk.png&$icon_text{'feedback'}&discuss[_1]&gopost('/adm/feedback',currentURL,1)&Provide feedback messages or contribute to the course discussion about this resource",          feedback => "s&8&2&fdbk.png&$icon_text{'feedback'}&discuss[_1]&gopost('/adm/feedback',currentURL,1)&Provide feedback messages or contribute to the course discussion about this resource",
         annotate => "s&9&3&anot.png&$icon_text{'annotate'}&tations[_1]&annotate()&Make notes and annotations about this resource",          annotate => "s&9&3&anot.png&$icon_text{'annotate'}&tations[_1]&annotate()&Make notes and annotations about this resource",
Line 1310  sub passwordchanger { Line 1346  sub passwordchanger {
     } elsif ($caller eq 'reset_by_email') {      } elsif ($caller eq 'reset_by_email') {
             my %data = &Apache::lonnet::tmpget($mailtoken);              my %data = &Apache::lonnet::tmpget($mailtoken);
             if (keys(%data) == 0) {              if (keys(%data) == 0) {
                 $r->print(&mt('Sorry, the URL you provided to complete the reset of your password was invalid. Either the token included in the URL has been deleted or the URL you provided was invalid. Please submit a [_1]new request[_2] for a password reset, and follow the link to the new URL included in the e-mail that will be sent to you, to allow you to enter a new password.'                  $r->print(
                       '<p class="LC_warning">'
                      .&mt('Sorry, the URL you provided to complete the reset of your password was invalid. Either the token included in the URL has been deleted or the URL you provided was invalid. Please submit a [_1]new request[_2] for a password reset, and follow the link to the new URL included in the e-mail that will be sent to you, to allow you to enter a new password.'
                              ,'<a href="/adm/resetpw">','</a>')                               ,'<a href="/adm/resetpw">','</a>')
                      .'</p>'
                 );                  );
                 return;                  return;
             }              }
Line 1321  sub passwordchanger { Line 1360  sub passwordchanger {
                     $domain = $data{'domain'};                      $domain = $data{'domain'};
                     $currentpass = $data{'temppasswd'};                      $currentpass = $data{'temppasswd'};
                 } else {                  } else {
                     $r->print(&mt('Sorry, the token generated when you requested a password reset has expired.').'<br />');                      $r->print(
                           '<p class="LC_warning">'
                          .&mt('Sorry, the token generated when you requested'
                              .' a password reset has expired.')
                          .'</p>'
                       );
                     return;                      return;
                 }                  }
             } else {              } else {
                 $r->print(&mt('Sorry, the URL generated when you requested reset of your password contained incomplete information.').'<br />');                  $r->print(
                      '<p class="LC_warning">'
                     .&mt('Sorry, the URL generated when you requested reset of'
                         .' your password contained incomplete information.')
                      .'</p>'
                   );
                 return;                  return;
             }              }
             if (&Apache::lonnet::domain($domain) eq '') {              if (&Apache::lonnet::domain($domain) eq '') {
                 $domain = $r->dir_config('lonDefDomain');                  $domain = $r->dir_config('lonDefDomain');
             }              }
     } else {      } else {
         $r->print(&mt('Page requested in unexpected context').'<br />');          $r->print(
               '<p class="LC_error">'
              .&mt('Page requested in unexpected context')
              .'</p>'
           );
         return;          return;
     }      }
     my $currentauth=&Apache::lonnet::queryauthenticate($user,$domain);      my $currentauth=&Apache::lonnet::queryauthenticate($user,$domain);
Line 1604  ENDERROR Line 1657  ENDERROR
     }       } 
     if ($newpass1 ne $newpass2) {      if ($newpass1 ne $newpass2) {
  &passwordchanger($r,   &passwordchanger($r,
  '<span class="LC_error">'.   '<span class="LC_warning">'.
  &mt('The new passwords you entered do not match.').'  '.   &mt('The new passwords you entered do not match.').'  '.
  &mt('Please try again.').'</span>',$caller,$mailtoken);   &mt('Please try again.').'</span>',$caller,$mailtoken);
  return 1;   return 1;
     }      }
     if (length($newpass1) < 7) {      if (length($newpass1) < 7) {
  &passwordchanger($r,   &passwordchanger($r,
  '<span class="LC_error">'.   '<span class="LC_warning">'.
  &mt('Passwords must be a minimum of 7 characters long.').'  '.   &mt('Passwords must be a minimum of 7 characters long.').'  '.
  &mt('Please try again.').'</span>',$caller,$mailtoken);   &mt('Please try again.').'</span>',$caller,$mailtoken);
  return 1;   return 1;
Line 1624  ENDERROR Line 1677  ENDERROR
     }      }
     if ($badpassword) {      if ($badpassword) {
  # I can't figure out how to enter bad characters on my browser.   # I can't figure out how to enter bad characters on my browser.
  my $errormessage ='<span class="LC_error">'.   my $errormessage ='<span class="LC_warning">'.
            &mt('The password you entered contained illegal characters.').'<br />'.             &mt('The password you entered contained illegal characters.').'<br />'.
            &mt('Valid characters are').(<<"ENDERROR");             &mt('Valid characters are').(<<"ENDERROR");
 : space and <br />  : space and <br />
Line 2102  push(@{ $menu[0]->{items} }, { Line 2155  push(@{ $menu[0]->{items} }, {
  linktitle => 'Change your password.',   linktitle => 'Change your password.',
  });   });
     }      }
       if ($env{'environment.remote'} eq 'off') {
   push(@{ $menu[1]->{items} }, {
           linktext => 'Launch Remote Control',
           url => '/adm/remote?url=/adm/preferences&amp;action=launch',
           permission => 'F',
           #help => '',
           icon => 'remotecontrol.png',
           linktitle => 'Launch the remote control for LON-CAPA.',
           });
       }else{
   push(@{ $menu[1]->{items} }, {
           linktext => 'Collapse Remote Control',
           url => '/adm/remote?url=/adm/preferences&amp;action=collapse',
           permission => 'F',
           #help => '',
           icon => 'remotecontrol.png',
           linktitle => 'Collapse the remote control for LON-CAPA.',
           });
       }
   
     if (&can_toggle_namelocking()) {      if (&can_toggle_namelocking()) {
         push(@{ $menu[0]->{items} }, {          push(@{ $menu[0]->{items} }, {
Line 2176  sub handler { Line 2248  sub handler {
                                    ['action','wysiwyg','returnurl','refpage']);                                     ['action','wysiwyg','returnurl','refpage']);
     #      #
     Apache::lonhtmlcommon::clear_breadcrumbs();      Apache::lonhtmlcommon::clear_breadcrumbs();
       my ($brlink,$brtxt,$brhelp);
       if (($env{'form.action'} eq 'changerolespref') && ($env{'form.returnurl'} eq '/adm/roles')) {
           $brlink ='/adm/roles';
           $brtxt = 'User Roles';
       } else {
           $brlink ='/adm/preferences';
           $brtxt = 'Set User Preferences';
           $brhelp = 'Prefs_About_Me,Prefs_Language,Prefs_Screen_Name_Nickname,Change_Colors,Change_Password,Prefs_Messages,Change_Discussion_Display';
       }
     Apache::lonhtmlcommon::add_breadcrumb      Apache::lonhtmlcommon::add_breadcrumb
         ({href => '/adm/preferences',          ({href => $brlink,
           text => 'Set User Preferences',            text => $brtxt,
           help =>            help => $brhelp,});
           'Prefs_About_Me,Prefs_Language,Prefs_Screen_Name_Nickname,Change_Colors,Change_Password,Prefs_Messages,Change_Discussion_Display'});  
     if(!exists $env{'form.action'}) {      if(!exists $env{'form.action'}) {
     &print_main_menu($r);      &print_main_menu($r);
     }elsif($env{'form.action'} eq 'changepass'){      }elsif($env{'form.action'} eq 'changepass'){

Removed from v.1.196  
changed lines
  Added in v.1.196.4.6


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