Diff for /loncom/interface/lonpreferences.pm between versions 1.197 and 1.198

version 1.197, 2012/05/15 01:41:27 version 1.198, 2012/08/16 17:02:55
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 2176  sub handler { Line 2212  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.197  
changed lines
  Added in v.1.198


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