--- loncom/interface/lonpreferences.pm 2008/12/02 20:10:27 1.127
+++ loncom/interface/lonpreferences.pm 2009/05/05 11:40:51 1.157
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Preferences
#
-# $Id: lonpreferences.pm,v 1.127 2008/12/02 20:10:27 droeschl Exp $
+# $Id: lonpreferences.pm,v 1.157 2009/05/05 11:40:51 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,8 @@ 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).'
');
+ &print_main_menu($r,''.&Apache::lonhtmlcommon::confirm_success(&mt('Setting WYSIWYG editor to:').' '
+ .&mt($newsetting)).'
');
}
################################################################
@@ -149,7 +148,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 +171,7 @@ sub languagechanger {
$pref: $selectionbox
ENDLSCREEN
- $r->print('
');
+ $r->print('
');
}
@@ -187,16 +186,14 @@ 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 new preferred languages to ').'"'.$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 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 +223,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 +235,9 @@ sub texenginechanger {
@@ -249,7 +247,7 @@ $lt{'exmpl'}
$lt{'jsmath'}
$jsMath_start
-');
+ $r->print('');
}
}
@@ -302,18 +300,13 @@ 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 new preferred math display to ').'"'.$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 preferred math display.'));
}
-
-
-# $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'};
@@ -401,7 +394,7 @@ sub rolesprefchanger {
'.$roles_check_list.'
-
+
');
}
@@ -450,7 +443,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 +473,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}))."\n";
&Apache::lonhtmlcommon::store_recent('roles',$role_key,' ',0);
}
}
@@ -488,17 +481,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}))."\n";
&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 +541,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 new screenname to ').'"'.$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 screenname.'));
}
# Nickname
$message.='
';
@@ -561,17 +554,14 @@ 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 new nickname to ').'"'.$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 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 +593,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(<
@@ -623,8 +613,7 @@ sub verify_and_change_icons {
&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));
+ &print_main_menu($r, &Apache::lonhtmlcommon::confirm_success(&mt('Set menu mode to [_1].',$newicons)));
}
################################################################
@@ -633,10 +622,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 +634,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(<
-