--- loncom/interface/lonpreferences.pm 2008/12/06 20:34:09 1.129
+++ loncom/interface/lonpreferences.pm 2009/05/06 16:19:34 1.159
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Preferences
#
-# $Id: lonpreferences.pm,v 1.129 2008/12/06 20:34:09 schafran Exp $
+# $Id: lonpreferences.pm,v 1.159 2009/05/06 16:19:34 bisitz Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -101,7 +101,7 @@ sub wysiwygchanger {
Apache::lonhtmlcommon::add_breadcrumb(
{ href => '/adm/preferences?action=changewysiwyg',
text => 'Change WYSIWYG Preferences'});
- $r->print(Apache::loncommon::start_page('Change WYSIWYG Preferences'));
+ $r->print(Apache::loncommon::start_page('Content Display Settings'));
$r->print(Apache::lonhtmlcommon::breadcrumbs('Change WYSIWYG Preferences'));
my %userenv = &Apache::lonnet::get
@@ -126,7 +126,7 @@ $warning
ENDLSCREEN
- $r->print('
');
+ $r->print('
');
}
@@ -135,9 +135,9 @@ sub verify_and_change_wysiwyg {
my $newsetting=$env{'form.wysiwyg'};
&Apache::lonnet::put('environment',{'wysiwygeditor' => $newsetting});
&Apache::lonnet::appenv({'environment.wysiwygeditor' => $newsetting});
-# $r->print('
'.&mt('Setting WYSIWYG editor to:').' '.&mt($newsetting).'
');
- print_main_menu($r,''.&mt('Setting WYSIWYG editor to:').' '
- .&mt($newsetting).'
');
+ my $message=&Apache::lonhtmlcommon::confirm_success(&mt('Set [_1] to [_2]',''.&mt('WYSIWYG Editor').'',''.&mt($newsetting).''));
+ $message=&Apache::loncommon::confirmwrapper($message);
+ &print_main_menu($r,$message);
}
################################################################
@@ -149,7 +149,7 @@ sub languagechanger {
Apache::lonhtmlcommon::add_breadcrumb(
{ href => '/adm/preferences?action=changelanguages',
text => 'Change Language'});
- $r->print(Apache::loncommon::start_page('Change Language'));
+ $r->print(Apache::loncommon::start_page('Content Display Settings'));
$r->print(Apache::lonhtmlcommon::breadcrumbs('Change Language'));
my $user = $env{'user.name'};
my $domain = $env{'user.domain'};
@@ -172,7 +172,7 @@ sub languagechanger {
$pref: $selectionbox
ENDLSCREEN
- $r->print('
');
+ $r->print('
');
}
@@ -187,16 +187,15 @@ sub verify_and_change_languages {
if ($newlanguage) {
&Apache::lonnet::put('environment',{'languages' => $newlanguage});
&Apache::lonnet::appenv({'environment.languages' => $newlanguage});
- $message=&mt('Set new preferred languages to ').'"'.$newlanguage.'".';
+ $message=&Apache::lonhtmlcommon::confirm_success(&mt('Set [_1] to [_2]',''.&mt('Preferred language').'','"'.$newlanguage.'".'));
} else {
&Apache::lonnet::del('environment',['languages']);
- &Apache::lonnet::delenv('environment\.languages');
- $message=&mt('Reset preferred language.');
+ &Apache::lonnet::delenv('environment.languages');
+ $message=&Apache::lonhtmlcommon::confirm_success(&mt('Reset [_1]',''.&mt('Preferred language').''));
}
- print_main_menu($r, $message);
-# $r->print(< '/adm/preferences?action=changetexenginepref',
text => 'Change How Math Equations Are Displayed'});
- $r->print(Apache::loncommon::start_page('Change How Math Equations Are Displayed'));
+ $r->print(Apache::loncommon::start_page('Content Display Settings'));
$r->print(Apache::lonhtmlcommon::breadcrumbs('Change How Math Equations Are Displayed'));
my $user = $env{'user.name'};
my $domain = $env{'user.domain'};
@@ -226,7 +225,7 @@ sub texenginechanger {
my %lt=&Apache::lonlocal::texthash(
'headline' => 'Change Math Preferences',
'preftxt' => 'Preferred method to display Math',
- 'change' => 'Change',
+ 'change' => 'Save',
'exmpl' => 'Examples',
'jsmath' => 'jsMath:',
'tth' => 'tth (TeX to HTML):',
@@ -238,8 +237,9 @@ sub texenginechanger {
@@ -249,7 +249,7 @@ $lt{'exmpl'}
$lt{'jsmath'}
$jsMath_start
-');
+ $r->print('');
}
}
@@ -302,18 +302,14 @@ sub verify_and_change_texengine {
if ($newtexengine) {
&Apache::lonnet::put('environment',{'texengine' => $newtexengine});
&Apache::lonnet::appenv({'environment.texengine' => $newtexengine});
- $message=&mt('Set new preferred math display to ').'"'.$newtexengine.'".';
+ $message=&Apache::lonhtmlcommon::confirm_success(&mt('Set [_1] to [_2]',''.&mt('Preferred method to display Math').'','"'.$newtexengine.'"'));
} else {
&Apache::lonnet::del('environment',['texengine']);
- &Apache::lonnet::delenv('environment\.texengine');
- $message=&mt('Reset preferred math display.');
+ &Apache::lonnet::delenv('environment.texengine');
+ $message=&Apache::lonhtmlcommon::confirm_success(&mt('Reset [_1]',''.&mt('Preferred method to display Math').''));
}
-
-
-# $r->print(< '/adm/preferences?action=changerolespref',
text => 'Change '.$role.' Page Pref'});
- $r->print(Apache::loncommon::start_page('Change '.$role.' Page Pref'));
+ $r->print(Apache::loncommon::start_page('Content Display Settings'));
$r->print(Apache::lonhtmlcommon::breadcrumbs('Change '.$role.' Page Pref'));
my $hotlist_flag=$userenv{'recentroles'};
my $hotlist_n=$userenv{'recentrolesn'};
@@ -371,13 +367,13 @@ sub rolesprefchanger {
my $checked = "";
my $value = $recent_roles{$role_key};
if ($frozen_roles{$role_key}) {
- $checked = "checked=\"checked\"";
+ $checked = ' checked="checked"';
}
$count++;
$roles_check_list .=
&Apache::loncommon::start_data_table_row().
''.
- " | ".
" | ".
@@ -392,7 +388,7 @@ sub rolesprefchanger {
'.$roles_check_list.'
-
+
');
}
@@ -450,7 +446,7 @@ sub verify_and_change_rolespref {
$message=&mt('Recent '.$role.'s Hotlist is Enabled');
} else {
&Apache::lonnet::del('environment',['recentroles']);
- &Apache::lonnet::delenv('environment\.recentroles');
+ &Apache::lonnet::delenv('environment.recentroles');
$message=&mt('Recent '.$role.'s Hotlist is Disabled');
}
if ($hotlist_n) {
@@ -480,7 +476,7 @@ sub verify_and_change_rolespref {
# Unset any roles that were previously frozen but aren't in list
foreach my $role_key (sort(keys(%recent_roles))) {
if (($frozen_roles{$role_key}) && (!exists($freeze{$role_key}))) {
- $message .= "
".&mt('Unfreezing '.$role.': [_1]',$role_text{$role_key})."\n";
+ $message .= "
".&Apache::lonhtmlcommon::confirm_success(&mt('Unfreezing '.$role.': [_1]',''.$role_text{$role_key}.''));
&Apache::lonhtmlcommon::store_recent('roles',$role_key,' ',0);
}
}
@@ -488,17 +484,14 @@ sub verify_and_change_rolespref {
# Freeze selected roles
foreach my $role_key (@freeze_list) {
if (!$frozen_roles{$role_key}) {
- $message .= "
".&mt('Freezing '.$role.': [_1]',$role_text{$role_key})."\n";
+ $message .= "
".
+ &Apache::lonhtmlcommon::confirm_success(&mt('Freezing '.$role.': [_1]',''.$role_text{$role_key}.''));
&Apache::lonhtmlcommon::store_recent('roles',
$role_key,' ',1);
}
}
- $message .= "
\n";
-
-# $r->print(< 'New screenname (shown if you post anonymously):',
- text_nickname => 'New nickname (shown if you post non-anonymously):',
- text_submit => 'Change',
- );
Apache::lonhtmlcommon::add_breadcrumb(
{ href => '/adm/preferences?action=changescreenname',
text => 'Change Screen Name'});
- $r->print(Apache::loncommon::start_page('Change Screen Name'));
+ $r->print(Apache::loncommon::start_page('Personal Data'));
$r->print(Apache::lonhtmlcommon::breadcrumbs('Change Screen Name'));
- $r->print(<
-
-
$lt{'text_screenname'}
-
-
$lt{'text_nickname'}
-
-
-
-
-ENDSCREEN
+ $r->print(''
+ .&mt('Change the name that is displayed in your posts.')
+ .'
'
+ );
+ $r->print(''
+ );
}
sub verify_and_change_screenname {
@@ -548,11 +544,11 @@ sub verify_and_change_screenname {
if ($newscreen) {
&Apache::lonnet::put('environment',{'screenname' => $newscreen});
&Apache::lonnet::appenv({'environment.screenname' => $newscreen});
- $message=&mt('Set new screenname to ').'"'.$newscreen.'.".';
+ $message=&Apache::lonhtmlcommon::confirm_success(&mt('Set [_1] to [_2]',''.&mt('Screenname').'','"'.$newscreen.'."'));
} else {
&Apache::lonnet::del('environment',['screenname']);
- &Apache::lonnet::delenv('environment\.screenname');
- $message=&mt('Reset screenname.');
+ &Apache::lonnet::delenv('environment.screenname');
+ $message=&Apache::lonhtmlcommon::confirm_success(&mt('Reset [_1]',''.&mt('Screenname').''));
}
# Nickname
$message.='
';
@@ -561,17 +557,15 @@ sub verify_and_change_screenname {
if ($newscreen) {
&Apache::lonnet::put('environment',{'nickname' => $newscreen});
&Apache::lonnet::appenv({'environment.nickname' => $newscreen});
- $message.=&mt('Set new nickname to ').'"'.$newscreen.'".';
+ $message.=&Apache::lonhtmlcommon::confirm_success(&mt('Set [_1] to [_2]',''.&mt('Nickname').'','"'.$newscreen.'".'));
} else {
&Apache::lonnet::del('environment',['nickname']);
- &Apache::lonnet::delenv('environment\.nickname');
- $message.=&mt('Reset nickname.');
+ &Apache::lonnet::delenv('environment.nickname');
+ $message.=&Apache::lonhtmlcommon::confirm_success(&mt('Reset [_1]',''.&mt('Nickname').''));
}
&Apache::lonnet::devalidate_cache_new('namescache',$user.':'.$domain);
-# $r->print(< '/adm/preferences?action=changeicons',
text => 'Change Main Menu'});
- $r->print(Apache::loncommon::start_page('Change Main Menu'));
+ $r->print(Apache::loncommon::start_page('Page Display Settings'));
$r->print(Apache::lonhtmlcommon::breadcrumbs('Change Main Menu'));
my $user = $env{'user.name'};
@@ -603,7 +597,7 @@ sub iconchanger {
my $useicons=&mt('Use icons and text');
my $usebuttons=&mt('Use buttons and text');
my $useicononly=&mt('Use icons only');
- my $change=&mt('Change');
+ my $change=&mt('Save');
$r->print(<
@@ -619,12 +613,13 @@ sub verify_and_change_icons {
my $r = shift;
my $user = $env{'user.name'};
my $domain = $env{'user.domain'};
- my $newicons = $env{'form.menumode'};
+ my $newicons = $env{'form.menumode'};
&Apache::lonnet::put('environment',{'icons' => $newicons});
&Apache::lonnet::appenv({'environment.icons' => $newicons});
-# $r->print(&mt('Set menu mode to [_1].',$newicons));
- print_main_menu($r, &mt('Set menu mode to [_1].',$newicons));
+ my $message=&Apache::lonhtmlcommon::confirm_success(&mt('Set [_1] to [_2]',''.&mt('Menu Display').'',''.$newicons.''));
+ $message=&Apache::loncommon::confirmwrapper($message);
+ &print_main_menu($r, $message);
}
################################################################
@@ -633,10 +628,10 @@ sub verify_and_change_icons {
sub clickerchanger {
my $r = shift;
- Apache::lonhtmlcommon::add_breadcrumb(
+ &Apache::lonhtmlcommon::add_breadcrumb(
{ href => '/adm/preferences?action=changeclicker',
text => 'Register Clicker'});
- $r->print(Apache::loncommon::start_page('Register Clicker'));
+ $r->print(Apache::loncommon::start_page('Other'));
$r->print(Apache::lonhtmlcommon::breadcrumbs('Register Clicker'));
my $user = $env{'user.name'};
my $domain = $env{'user.domain'};
@@ -645,14 +640,15 @@ sub clickerchanger {
my $clickers=$userenv{'clickers'};
$clickers=~s/\,/\n/gs;
my $text=&mt('Enter response device ("clicker") numbers');
- my $change=&mt('Register');
+ my $change=&mt('Save');
my $helplink=&Apache::loncommon::help_open_topic('Clicker_Registration',&mt('Locating your clicker ID'));
$r->print(<
-