Diff for /loncom/interface/lonpreferences.pm between versions 1.176 and 1.179.2.3

version 1.176, 2009/10/16 23:52:20 version 1.179.2.3, 2010/09/19 14:00:49
Line 166  sub languagechanger { Line 166  sub languagechanger {
                = &Apache::loncommon::plainlanguagedescription($_);                 = &Apache::loncommon::plainlanguagedescription($_);
  }   }
     }      }
     my $selectionbox=&Apache::loncommon::select_form($language,'language',      my $selectionbox=
      %langchoices);             &Apache::loncommon::select_form(
                  $language,
                  'language',
                  &Apache::lonlocal::texthash(%langchoices));
     $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_languages" />  <input type="hidden" name="action" value="verify_and_change_languages" />
Line 206  sub texenginechanger { Line 209  sub texenginechanger {
     my $r = shift;      my $r = shift;
     Apache::lonhtmlcommon::add_breadcrumb(      Apache::lonhtmlcommon::add_breadcrumb(
     { href => '/adm/preferences?action=changetexenginepref',      { href => '/adm/preferences?action=changetexenginepref',
                 text => 'Change How Math Equations Are Displayed'});                  text => 'Math display settings'});
     $r->print(Apache::loncommon::start_page('Content Display Settings'));      $r->print(Apache::loncommon::start_page('Content Display Settings'));
     $r->print(Apache::lonhtmlcommon::breadcrumbs('Change How Math Equations Are Displayed'));      $r->print(Apache::lonhtmlcommon::breadcrumbs('Math display settings'));
     my $user       = $env{'user.name'};      my $user       = $env{'user.name'};
     my $domain     = $env{'user.domain'};      my $domain     = $env{'user.domain'};
     my %userenv = &Apache::lonnet::get('environment',['texengine']);      my %userenv = &Apache::lonnet::get('environment',['texengine']);
Line 221  sub texenginechanger { Line 224  sub texenginechanger {
      'mimetex' => 'mimetex (Convert to Images)',       'mimetex' => 'mimetex (Convert to Images)',
                      'raw' => 'Raw (Screen Reader)'                       'raw' => 'Raw (Screen Reader)'
                      );                       );
     my $selectionbox=&Apache::loncommon::select_form($texengine,'texengine',      my $selectionbox=
      %mathchoices);             &Apache::loncommon::select_form(
                  $texengine,
                  'texengine',
                  &Apache::lonlocal::texthash(%mathchoices));
     my $jsMath_start=&Apache::lontexconvert::jsMath_header();      my $jsMath_start=&Apache::lontexconvert::jsMath_header();
     my %lt=&Apache::lonlocal::texthash(      my %lt=&Apache::lonlocal::texthash(
       'headline' => 'Change Math Preferences',        'headline' => 'Change how math is displayed',
       'preftxt'  => 'Preferred method to display Math',        'preftxt'  => 'Preferred method to display math',
       'change'   => 'Save',        'change'   => 'Save',
       'exmpl'    => 'Examples',        'exmpl'    => 'Examples',
       'jsmath'   => 'jsMath:',        'jsmath'   => 'jsMath:',
Line 281  if (jsMath.nofonts == 1) { Line 287  if (jsMath.nofonts == 1) {
   
 <h3>$lt{'tth'}</h3>  <h3>$lt{'tth'}</h3>
 <p>  <p>
 <iframe src="/res/adm/pages/math_example.tex?inhibitmenu=yes&texengine=tth" width="400" height="200"></iframe>  <iframe src="/res/adm/pages/math_example.tex?inhibitmenu=yes&texengine=tth" width="400" height="220"></iframe>
 </p>  </p>
 ENDLSCREEN  ENDLSCREEN
     if ($env{'environment.texengine'} ne 'jsMath') {      if ($env{'environment.texengine'} ne 'jsMath') {
Line 794  sub msgforwardchanger { Line 800  sub msgforwardchanger {
     Apache::lonhtmlcommon::add_breadcrumb(      Apache::lonhtmlcommon::add_breadcrumb(
     { href => '/adm/preferences?action=changemsgforward',      { href => '/adm/preferences?action=changemsgforward',
  text => 'Messages & Notifications'});   text => 'Messages & Notifications'});
     $r->print(Apache::loncommon::start_page('Message Management'));      $r->print(Apache::loncommon::start_page('Messages &amp; Notifications'));
     $r->print(Apache::lonhtmlcommon::breadcrumbs('Change Message Forwarding/Notification'));      $r->print(Apache::lonhtmlcommon::breadcrumbs('Messages &amp; Notifications'));
     my $forwardingHelp = &Apache::loncommon::help_open_topic("Prefs_Forwarding");      my $forwardingHelp = &Apache::loncommon::help_open_topic("Prefs_Forwarding");
     my $notificationHelp = &Apache::loncommon::help_open_topic("Prefs_Notification");      my $notificationHelp = &Apache::loncommon::help_open_topic("Prefs_Notification");
     my $criticalMessageHelp = &Apache::loncommon::help_open_topic("Course_Critical_Message");      my $criticalMessageHelp = &Apache::loncommon::help_open_topic("Course_Critical_Message");
Line 989  sub verify_and_change_msgforward { Line 995  sub verify_and_change_msgforward {
     my $domain     = $env{'user.domain'};      my $domain     = $env{'user.domain'};
     my $newscreen  = '';      my $newscreen  = '';
     my $message='';      my $message='';
     foreach (split(/\,/,$env{'form.msgforward'})) {      foreach my $recip (split(/\,/,$env{'form.msgforward'})) {
  my ($msuser,$msdomain)=split(/[\@\:]/,$_);          my ($msuser,$msdomain);
           if ($recip =~ /:/) {
               ($msuser,$msdomain)=split(':',$recip);
           } else {
               ($msuser,$msdomain)=split(/\@/,$recip);
           }
         $msuser = &LONCAPA::clean_username($msuser);          $msuser = &LONCAPA::clean_username($msuser);
         $msdomain = &LONCAPA::clean_domain($msdomain);          $msdomain = &LONCAPA::clean_domain($msdomain);
         if (($msuser) && ($msdomain)) {          if (($msuser) && ($msdomain)) {
     if (&Apache::lonnet::homeserver($msuser,$msdomain) ne 'no_host') {              if (&Apache::lonnet::homeserver($msuser,$msdomain) ne 'no_host') {
                $newscreen.=$msuser.':'.$msdomain.',';                 $newscreen.=$msuser.':'.$msdomain.',';
    } else {             } else {
                $message.= &mt('No such user: ').'<tt>'.$msuser.':'.$msdomain.'</tt><br />';                 $message.= &mt('No such user: ').'<tt>'.$msuser.':'.$msdomain.'</tt><br />';
            }             }
         }          }
Line 1603  sub discussionchanger { Line 1614  sub discussionchanger {
     Apache::lonhtmlcommon::add_breadcrumb(      Apache::lonhtmlcommon::add_breadcrumb(
     { href => '/adm/preferences?action=changediscussions',      { href => '/adm/preferences?action=changediscussions',
                 text => 'Change Discussion Preferences'});                  text => 'Change Discussion Preferences'});
     $r->print(Apache::loncommon::start_page('Message Management'));      $r->print(Apache::loncommon::start_page('Change Discussion Preferences'));
     $r->print(Apache::lonhtmlcommon::breadcrumbs('Change Discussion Preferences'));      $r->print(Apache::lonhtmlcommon::breadcrumbs('Change Discussion Preferences'));
     my $user       = $env{'user.name'};      my $user       = $env{'user.name'};
     my $domain     = $env{'user.domain'};      my $domain     = $env{'user.domain'};
Line 1839  if (&Apache::lonnet::usertools_access($u Line 1850  if (&Apache::lonnet::usertools_access($u
 }  }
 my @menu=  my @menu=
     ({ categorytitle=>'Personal Data',      ({ categorytitle=>'Personal Data',
  items =>[          items =>[]
     { linktext => 'Personal Information Page',       },
  url => $aboutmeurl,  
  permission => $permissions{'aboutme'},  
  #help => 'Prefs_About_Me',  
  icon => 'system-users.png',  
  linktitle => 'Edit information about yourself that should be displayed on your public profile.'  
     },  
     { linktext => 'Screen Name',  
  url => '/adm/preferences?action=changescreenname',  
  permission => 'F',  
  #help => 'Prefs_Screen_Name_Nickname',  
  icon => 'preferences-desktop-font.png',  
  linktitle => 'Change the name that is displayed in your posts.'  
     },  
  ]  
     },  
     { categorytitle=>'Page Display Settings',      { categorytitle=>'Page Display Settings',
  items =>[   items =>[
     { linktext => 'Color Scheme',      { linktext => 'Color Scheme',
Line 1865  my @menu= Line 1861  my @menu=
  icon => 'preferences-desktop-theme.png',   icon => 'preferences-desktop-theme.png',
  linktitle => 'Change LON-CAPA default colors.'   linktitle => 'Change LON-CAPA default colors.'
     },      },
     { linktext => 'Menu Display',  
  url => '/adm/preferences?action=changeicons',  
  permission => 'F',  
  #help => '',  
  icon => 'preferences-system-windows.png',  
  linktitle => 'Change whether the menus are displayed with buttons, icons or icons and text.'  
     }  
   
  ]   ]
     },      },
     { categorytitle=>'Content Display Settings',      { categorytitle=>'Content Display Settings',
  items =>[   items =>[
     { linktext => 'Language',  
  url => '/adm/preferences?action=changelanguages',  
  permission => 'F',  
  #help => 'Prefs_Language',  
  icon => 'preferences-desktop-locale.png',  
  linktitle => 'Choose the default language for this user.'  
     },  
     { linktext => 'WYSIWYG Editor',      { linktext => 'WYSIWYG Editor',
  url => '/adm/preferences?action=changewysiwyg',   url => '/adm/preferences?action=changewysiwyg',
  permission => 'F',   permission => 'F',
Line 1891  my @menu= Line 1872  my @menu=
  icon => 'edit-select-all.png',   icon => 'edit-select-all.png',
  linktitle => 'Enable or disable the WYSIWYG-Editor.'   linktitle => 'Enable or disable the WYSIWYG-Editor.'
     },      },
     { linktext => $role.' Page',      { linktext => 'Math display settings',
  url => '/adm/preferences?action=changerolespref',  
  permission => 'F',  
  #help => '',  
  icon => 'sctr.png',  
  linktitle => 'Configure the roles hotlist.'  
     },  
     { linktext => 'Display of Scientific Equations',  
  url => '/adm/preferences?action=changetexenginepref',   url => '/adm/preferences?action=changetexenginepref',
  permission => 'F',   permission => 'F',
  #help => '',   #help => '',
  icon => 'stat.png',   icon => 'stat.png',
  linktitle => 'Change how Scientific Equations are displayed.'   linktitle => 'Change how math is displayed.'
     },      },
  ]   ]
     },      },
     { categorytitle=>'Message Management',      { categorytitle=>'Messages &amp; Notifications',
  items =>[   items =>[
     { linktext => 'Messages &amp; Notifications',      { linktext => 'Messages &amp; Notifications',
  url => '/adm/preferences?action=changemsgforward',   url => '/adm/preferences?action=changemsgforward',
Line 1916  my @menu= Line 1890  my @menu=
  icon => 'mail-reply-all.png',   icon => 'mail-reply-all.png',
  linktitle => 'Change messageforwarding or notifications settings.'   linktitle => 'Change messageforwarding or notifications settings.'
     },      },
     { linktext => 'Discussion Display',  
  url => '/adm/preferences?action=changediscussions',  
  permission => 'F',  
  #help => 'Change_Discussion_Display',  
  icon => 'mail-message-new.png',  
  linktitle => 'Set display preferences for discussion posts for both discussion boards and individual resources in all your courses.'  
     },  
  ]   ]
     },      },
     { categorytitle=>'Other',      { categorytitle=>'Other',
  items =>[   items =>[]
     { linktext => 'Register Response Devices (&quot;Clickers&quot;)',  
  url => '/adm/preferences?action=changeclicker',  
  permission => 'F',  
  #help => '',  
  icon => 'network-workgroup.png',  
  linktitle => 'Register your clicker.'  
     },  
  ]  
     },      },
     );      );
   
       if (&Apache::lonnet::usertools_access($env{'user.name'},
                                             $env{'user.domain'},'aboutme')) {
           push(@{ $menu[0]->{items} },
                   {   linktext   => 'Personal Information Page',
                       url        => $aboutmeurl,
                       permission => $permissions{'aboutme'},
                       #help      => 'Prefs_About_Me',
                       icon       => 'system-users.png',
                       linktitle  => 'Edit information about yourself that should be displayed on your public profile.'
                   });
       }
   
       unless ($env{'user.domain'} eq 'gcitest') {
           push(@{ $menu[0]->{items} },
               {   linktext => 'Screen Name',
                   url => '/adm/preferences?action=changescreenname',
                   permission => 'F',
                   #help => 'Prefs_Screen_Name_Nickname',
                   icon => 'preferences-desktop-font.png',
                   linktitle => 'Change the name that is displayed in your posts.'
               });
       }
   
     if ($currentauth =~ /^(unix|internal):/) {      if ($currentauth =~ /^(unix|internal):/) {
 push(@{ $menu[0]->{items} }, {  push(@{ $menu[0]->{items} }, {
  linktext => 'Password',   linktext => 'Password',
Line 1948  push(@{ $menu[0]->{items} }, { Line 1930  push(@{ $menu[0]->{items} }, {
  linktitle => 'Change your password.',   linktitle => 'Change your password.',
  });   });
     }      }
     if ($env{'environment.remote'} eq 'off') {  
 push(@{ $menu[1]->{items} }, {      unless ((&Apache::loncommon::needs_gci_custom()) || ($env{'user.domain'} eq 'gcitest')) {
  linktext => 'Launch Remote Control',          push(@{ $menu[1]->{items} },
  url => '/adm/remote?url=/adm/preferences&amp;action=launch',            {   linktext => 'Menu Display',
  permission => 'F',                url => '/adm/preferences?action=changeicons',
  #help => '',                permission => 'F',
  icon => 'remotecontrol.png',                #help => '',
  linktitle => 'Launch the remote control for LON-CAPA.',                icon => 'preferences-system-windows.png',
  });                linktitle => 'Change whether the menus are displayed with buttons, icons or icons and text.'
     }else{            });
 push(@{ $menu[1]->{items} }, {      }
  linktext => 'Collapse Remote Control',  
  url => '/adm/remote?url=/adm/preferences&amp;action=collapse',      unless ($env{'user.domain'} eq 'gcitest') {
  permission => 'F',          push(@{ $menu[3]->{items} },
  #help => '',              {   linktext => 'Discussion Display',
  icon => 'remotecontrol.png',                  url => '/adm/preferences?action=changediscussions',
  linktitle => 'Collapse the remote control for LON-CAPA.',                  permission => 'F',
  });                  #help => 'Change_Discussion_Display',
                   icon => 'mail-message-new.png',
                   linktitle => 'Set display preferences for discussion posts for both discussion boards and individual resources in all your courses.'
               });
     }      }
   
     my %author_roles = &Apache::lonnet::get_my_roles($user,$domain,'userroles','',['au']);      my %author_roles = &Apache::lonnet::get_my_roles($user,$domain,'userroles','',['au']);
     if (keys(%author_roles) > 0) {      if (keys(%author_roles) > 0) {
 push(@{ $menu[4]->{items} }, {  push(@{ $menu[4]->{items} }, {
Line 1979  push(@{ $menu[4]->{items} }, { Line 1965  push(@{ $menu[4]->{items} }, {
  });   });
     }      }
   
     if (&Apache::lonnet::allowed('whn',$env{'request.course.id'})      unless ((&Apache::loncommon::needs_gci_custom()) || ($env{'user.domain'} eq 'gcitest')) { 
  || &Apache::lonnet::allowed('whn',$env{'request.course.id'}.'/'          if (&Apache::lonnet::allowed('whn',$env{'request.course.id'})
     .$env{'request.course.sec'})) {      || &Apache::lonnet::allowed('whn',$env{'request.course.id'}.'/'
             .$env{'request.course.sec'})) {
 push(@{ $menu[4]->{items} }, {  push(@{ $menu[4]->{items} }, {
  linktext => 'Course Initialization',   linktext => 'Course Initialization',
  url => '/adm/preferences?action=changecourseinit',   url => '/adm/preferences?action=changecourseinit',
Line 1991  push(@{ $menu[4]->{items} }, { Line 1978  push(@{ $menu[4]->{items} }, {
  linktitle => 'Set the default page to be displayed when you select a course role.',   linktitle => 'Set the default page to be displayed when you select a course role.',
  });   });
   
           }
     }      }
     if (&can_toggle_debug()) {      if (&can_toggle_debug()) {
 push(@{ $menu[4]->{items} }, {  push(@{ $menu[4]->{items} }, {
Line 2001  push(@{ $menu[4]->{items} }, { Line 1989  push(@{ $menu[4]->{items} }, {
  icon => 'blog.png',   icon => 'blog.png',
  linktitle => 'Toggle Debug Messages.',   linktitle => 'Toggle Debug Messages.',
  });   });
     }         }
   
     $r->print(&Apache::loncommon::start_page('My Space'));      $r->print(&Apache::loncommon::start_page('My Space'));
     $r->print(Apache::lonhtmlcommon::breadcrumbs('Change Preferences'));      $r->print(Apache::lonhtmlcommon::breadcrumbs('Change Preferences'));

Removed from v.1.176  
changed lines
  Added in v.1.179.2.3


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