'.&mt('Hotlist options').'
+
'.&mt('Hotlist options').'
'.
&mt('When enabled, the Hotlist keeps track of the last N '.$lc_role.'s visited.').' '.
&mt('Those N '.$lc_role.'s are then shown in a table at the top of the '.$lc_role.'s page.').'
'.
@@ -365,7 +367,7 @@ $options.'
');
if ($roles_check_list) {
$r->print('
-
'.&mt('Freeze Roles').'
+
'.&mt('Freeze Roles').'
'.&mt('The table below can be used to [_1]freeze[_2] '.$lc_role.'s in the Hotlist.','',' ').' '.
&mt('Those '.$lc_role.'s marked frozen will not be removed from the list, even if not recently used.').'
@@ -378,7 +380,7 @@ $options.'
$r->print('
-');
+
');
}
sub rolespref_get_role_text {
@@ -491,24 +493,22 @@ sub screennamechanger {
text => 'Change Screen Name'});
$r->print(Apache::loncommon::start_page('Personal Data'));
$r->print(Apache::lonhtmlcommon::breadcrumbs('Change Screen Name'));
- $r->print('
'
- .&mt('Change the name that is displayed in your posts.')
- .'
'
- );
+ $r->print('
');
+ my $caption = &mt('Name displayed in posts you make').':';
$r->print('
'
+ .'
'
);
}
@@ -556,7 +556,8 @@ sub iconchanger {
{ href => '/adm/preferences?action=changeicons',
text => 'Change Menu Display'});
$r->print(Apache::loncommon::start_page('Page Display Settings'));
- $r->print(Apache::lonhtmlcommon::breadcrumbs('Change Menu Display'));
+ $r->print(Apache::lonhtmlcommon::breadcrumbs('Change Menu Display').
+ '
ENDSCREEN
}
@@ -627,7 +633,7 @@ sub icon_options {
}
sub icon_previews {
- my %icon_text = (
+ my %icon_text = &Apache::lonlocal::texthash (
annotate => 'Notes',
wishlist => 'Stored Links',
catalog => 'Info',
@@ -636,12 +642,12 @@ sub icon_previews {
printout => 'Print',
);
my %inlinetools = (
- 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()&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",
- 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",
- catalog => "s&6&3&catalog.png&$icon_text{'catalog'}&info[_1]&catalog_info()&Show Metadata",
+ printout => "s&8&3&prt.png&$icon_text{'printout'}&printout[_1]&gopost('/adm/printout',currentURL)&".&mt('Prepare a printable document'),
+ wishlist => "s&9&1&wishlist-link.png&$icon_text{'wishlist'}&wishlistlink[_2]&set_wishlistlink()&".&mt('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)&".&mt('Provide my evaluation of this resource'),
+ feedback => "s&8&2&fdbk.png&$icon_text{'feedback'}&discuss[_1]&gopost('/adm/feedback',currentURL,1)&".&mt('Provide feedback messages or contribute to the course discussion about this resource'),
+ annotate => "s&9&3&anot.png&$icon_text{'annotate'}&tations[_1]&annotate()&".&mt('Make notes and annotations about this resource'),
+ catalog => "s&6&3&catalog.png&$icon_text{'catalog'}&info[_1]&catalog_info()&".&mt('Show Metadata'),
);
my @toolsorder = qw(annotate wishlist evaluate feedback printout catalog);
return (\%inlinetools,\@toolsorder);
@@ -657,7 +663,8 @@ sub clickerchanger {
{ href => '/adm/preferences?action=changeclicker',
text => 'Register Clicker'});
$r->print(Apache::loncommon::start_page('Other'));
- $r->print(Apache::lonhtmlcommon::breadcrumbs('Register Clicker'));
+ $r->print(Apache::lonhtmlcommon::breadcrumbs('Register Clicker').
+ '
');
my $user = $env{'user.name'};
my $domain = $env{'user.domain'};
my %userenv = &Apache::lonnet::get
@@ -668,14 +675,17 @@ sub clickerchanger {
my $change=&mt('Save');
my $helplink=&Apache::loncommon::help_open_topic('Clicker_Registration',&mt('Locating your clicker ID'));
$r->print(<
+
ENDSCREEN
}
@@ -683,16 +693,51 @@ sub verify_and_change_clicker {
my $r = shift;
my $user = $env{'user.name'};
my $domain = $env{'user.domain'};
+ my $uhome = $env{'user.home'};
my $newclickers = $env{'form.clickers'};
+ my $message;
$newclickers=~s/[^\w\:\-]+/\,/gs;
$newclickers=~tr/a-z/A-Z/;
$newclickers=~s/[\:\-]+/\-/g;
$newclickers=~s/\,+/\,/g;
$newclickers=~s/^\,//;
$newclickers=~s/\,$//;
- &Apache::lonnet::put('environment',{'clickers' => $newclickers});
- &Apache::lonnet::appenv({'environment.clickers' => $newclickers});
- my $message=&Apache::lonhtmlcommon::confirm_success(&mt('Registering clickers: [_1]',$newclickers));
+ my @oldclickers = split(/,/,$env{'environment.clickers'});
+ my @newclickers = split(/,/,$newclickers);
+ my %newuniq;
+ map { $newuniq{$_} = 1; } @newclickers;
+ @newclickers = sort(keys(%newuniq));
+ my @differences = &Apache::loncommon::compare_arrays(\@oldclickers,\@newclickers);
+ if (@differences) {
+ my $putres = &Apache::lonnet::put('environment',{'clickers' => $newclickers});
+ if ($putres eq 'ok') {
+ my @adds = ();
+ my @dels = ();
+ foreach my $item (@differences) {
+ if (grep(/^\Q$item\E$/,@newclickers)) {
+ push(@adds,$item);
+ } else {
+ push(@dels,$item);
+ }
+ }
+ if (@dels) {
+ my %delclicker;
+ map { $delclicker{$_} = $user; } @dels;
+ my $putresult = &Apache::lonnet::iddel($domain,\%delclicker,$uhome,'clickers');
+ }
+ if (@adds) {
+ my %addclicker;
+ map { $addclicker{$_} = $user; } @adds;
+ my $putresult = &Apache::lonnet::updateclickers($domain,'add',\%addclicker,$uhome,1);
+ }
+ &Apache::lonnet::appenv({'environment.clickers' => $newclickers});
+ $message=&Apache::lonhtmlcommon::confirm_success(&mt('Registering clickers: [_1]',$newclickers));
+ } else {
+ $message=&Apache::lonhtmlcommon::confirm_success(&mt('Error saving clicker ID').1);
+ }
+ } else {
+ $message='
'.&mt('Clicker information unchanged').' ';
+ }
$message=&Apache::loncommon::confirmwrapper($message);
&print_main_menu($r, $message);
}
@@ -813,14 +858,24 @@ sub msgforwardchanger {
notv => 'is not a valid e-mail address',
toen => "To enter multiple addresses, enter one address at a time, click 'Change' and then add the next one",
prme => 'Back',
+ acti => 'Action',
+ type => 'Types of message for which notification is sent',
+ nota => 'Notification address',
+ exce => 'Excerpt retains HTML tags in message',
+ modi => 'Modify',
+ dele => 'Delete',
+ addn => 'Add new address',
+ yes => 'Yes',
+ no => 'No',
);
$lt{'foad_exmpl'} = &mt('e.g. [_1]userA:domain1,userB:domain2,...[_2]','
',' ');
$lt{'mnot_exmpl'} = &mt('e.g. [_1]joe@doe.com[_2]','
',' ');
Apache::lonhtmlcommon::add_breadcrumb(
{ href => '/adm/preferences?action=changemsgforward',
- text => 'Messages & Notifications'});
+ text => 'Messages & Notifications'});
$r->print(Apache::loncommon::start_page('Messages & Notifications'));
- $r->print(Apache::lonhtmlcommon::breadcrumbs('Messages & Notifications'));
+ $r->print(Apache::lonhtmlcommon::breadcrumbs('Messages & Notifications').
+ '
');
my $forwardingHelp = &Apache::loncommon::help_open_topic("Prefs_Forwarding");
my $notificationHelp = &Apache::loncommon::help_open_topic("Prefs_Notification");
my $criticalMessageHelp = &Apache::loncommon::help_open_topic("Course_Critical_Message");
@@ -829,6 +884,7 @@ sub msgforwardchanger {
my $validatescript = &Apache::lonhtmlcommon::javascript_valid_email();
my $jscript = qq|
|;
$r->print(<
$lt{'fwdm'} $forwardingHelp
+$lt{'fwdm'} $forwardingHelp
-$lt{'foad'} ($lt{'foad_exmpl'}):
-
-
-$lt{'noti'} $notificationHelp
-$lt{'mnot'} ($lt{'mnot_exmpl'}):
+$lt{'foad'} ($lt{'foad_exmpl'}):
+
+
+$lt{'noti'} $notificationHelp
+$lt{'mnot'} ($lt{'mnot_exmpl'}):
ENDMSG
- my @sortforwards = sort (keys(%allnot));
+ my @sortnotify = sort (keys(%allnot));
my $output = &Apache::loncommon::start_data_table().
&Apache::loncommon::start_data_table_header_row().
- ' '.
- ''.&mt('Action').' '.
- ''.&mt('Notification address').' '.
- &mt('Types of message for which notification is sent').
+ ' # '.
+ ''.$lt{'acti'}.' '.
+ ''.$lt{'nota'}.' '.
+ $lt{'type'}.
$criticalMessageHelp.' '.
- &mt('Excerpt retains HTML tags in message').' '.
+ $lt{'exce'}.''.
&Apache::loncommon::end_data_table_header_row();
my $num = 0;
my $counter = 1;
- foreach my $item (@sortforwards) {
- $output .= &Apache::loncommon::start_data_table_row().
+ foreach my $item (@sortnotify) {
+ $output .= &Apache::loncommon::start_data_table_row('LC_prefs_row').
''.$counter.' '.
''.
' '.
- &mt('Modify').' '.
+ $lt{'modi'}.' '.(' ' x2).
''.
' '.
- &mt('Delete').' '.
- '';
+ ')" aria-labelledby="LC_email_notify" /> ';
my %chk;
if (defined($allnot{$item}{'crit'})) {
if (defined($allnot{$item}{'reg'})) {
@@ -931,13 +989,15 @@ ENDMSG
} else {
$chk{'reg'} = 'checked="checked" ';
}
+ $output .= ''.$lt{'type'}.' ';
foreach my $type ('all','crit','reg') {
$output .= ''.
' '.
- $lt{$type}.' '.(' ' x4);
+ $lt{$type}.' '.(' ' x2);
}
+ $output .= ' ';
my $htmlon = '';
my $htmloff = '';
if (grep/^\Q$item\E/,@allow_html) {
@@ -945,14 +1005,16 @@ ENDMSG
} else {
$htmloff = 'checked="checked" ';
}
- $output .= ' '.$lt{'exce'}.' '.
+ ' '.
- &mt('Yes').' '.(' ' x3).
+ $lt{'yes'}.' '.(' ' x2).
' '.
- &mt('No').' '.
+ $lt{'no'}.''.
&Apache::loncommon::end_data_table_row();
$num ++;
$counter ++;
@@ -962,24 +1024,27 @@ ENDMSG
crit => '',
reg => '',
);
- $output .= &Apache::loncommon::start_data_table_row().
+ $output .= &Apache::loncommon::start_data_table_row('LC_prefs_row').
''.$counter.' '.
''.
' '.&mt('Add new address').' '.
- '';
+ '" value="1" />'.$lt{'addn'}.' '.
+ '';
+ $output .= ''.$lt{'type'}.' ';
foreach my $type ('all','crit','reg') {
$output .= ''.
' '.
- $lt{$type}.' '.(' ' x4);
+ $lt{$type}.' '.(' ' x2);
}
- $output .= ' '.&mt('Yes').' '.(' ' x3).
+ $output .= ''.
+ ''.$lt{'exce'}.' '.
+ ' '.$lt{'yes'}.' '.(' ' x2).
' '.
- &mt('No').' '.
+ $lt{'no'}.''.
&Apache::loncommon::end_data_table_row().
&Apache::loncommon::end_data_table();
$num ++;
@@ -989,7 +1054,7 @@ ENDMSG
-
+
|);
}
@@ -1123,7 +1188,8 @@ sub colorschanger {
{ href => '/adm/preferences?action=changecolors',
text => 'Change Colors'});
$r->print(Apache::loncommon::start_page('Page Display Settings'));
- $r->print(Apache::lonhtmlcommon::breadcrumbs('Change Colors'));
+ $r->print(Apache::lonhtmlcommon::breadcrumbs('Change Colors').
+ '
');
# figure out colors
my $function=&Apache::loncommon::get_users_function();
my $domain=&Apache::loncommon::determinedomain();
@@ -1137,15 +1203,20 @@ sub colorschanger {
'vlink' => 'Visited Link Color',
'alink' => 'Active Link Color',
);
- my $start_data_table = &Apache::loncommon::start_data_table();
+ my $start_data_table = &Apache::loncommon::start_data_table().
+ &Apache::loncommon::data_table_caption(&mt('Colors for LON-CAPA pages')).
+ &Apache::loncommon::start_data_table_header_row().
+ '
'.&mt('Page Element').' '.&mt('Color').' '.
+ &Apache::loncommon::end_data_table_header_row();
my $chtable='';
foreach my $item (sort(keys(%colortypes))) {
my $curcol=&Apache::loncommon::designparm($function.'.'.$item,$domain);
$chtable.=&Apache::loncommon::start_data_table_row().
- ''.$colortypes{$item}.' '.
- &Apache::loncommon::end_data_table_row()."\n";
+ ''.$colortypes{$item}.' '.
+ ' '.
+ &Apache::loncommon::end_data_table_row()."\n";
}
my $end_data_table = &Apache::loncommon::end_data_table();
my $pjump_def = &Apache::lonhtmlcommon::pjump_javascript_definition();
@@ -1154,7 +1225,8 @@ sub colorschanger {
my $resetbuttondesc = &mt('Reset All Colors to Default');
my $colorchooser=&Apache::lonhtmlcommon::color_picker();
$r->print('
');
$r->print(<
+
$start_data_table
@@ -1174,7 +1247,7 @@ $end_data_table
-
+
ENDCOL
}
@@ -1197,9 +1270,9 @@ sub verify_and_change_colors {
my $message='';
foreach my $item (keys(%colortypes)) {
my $color=$env{'form.'.$item};
- if (!($color =~ /^#/)) {
- $color = '#' . $color;
- }
+ if (!($color =~ /^#/)) {
+ $color = '#' . $color;
+ }
my $entry='color.'.$function.'.'.$item;
if (($color=~/^\#[0-9A-Fa-f]{6}$/) && (!$env{'form.resetall'})) {
&Apache::lonnet::put('environment',{$entry => $color});
@@ -1230,13 +1303,15 @@ sub passwordchanger {
# This function is a bit of a mess....
# Passwords are encrypted using londes.js (DES encryption)
$errormessage = ($errormessage || '');
- my ($user,$domain,$currentpass);
+ my ($user,$domain,$currentpass,$clientip);
+ $clientip = &Apache::lonnet::get_requestor_ip($r);
&Apache::lonhtmlcommon::add_breadcrumb(
{ href => '/adm/preferences?action=changepass',
text => 'Change Password'});
unless ($caller eq 'reset_by_email') {
$r->print(Apache::loncommon::start_page('Personal Data'));
- $r->print(Apache::lonhtmlcommon::breadcrumbs('Change Password'));
+ $r->print(Apache::lonhtmlcommon::breadcrumbs('Change Password').
+ '
');
}
if ((!defined($caller)) || ($caller eq 'preferences')) {
$user = $env{'user.name'};
@@ -1245,9 +1320,9 @@ sub passwordchanger {
$caller = 'preferences';
}
my ($blocked,$blocktext) =
- &Apache::loncommon::blocking_status('passwd');
+ &Apache::loncommon::blocking_status('passwd',$clientip);
if ($blocked) {
- $r->print('
'.$blocktext.'
');
+ $r->print('
'.$blocktext.'
');
return;
}
} elsif ($caller eq 'reset_by_email') {
@@ -1267,7 +1342,7 @@ sub passwordchanger {
$domain = $data{'domain'};
$currentpass = $data{'temppasswd'};
my ($blocked,$blocktext) =
- &Apache::loncommon::blocking_status('passwd',$user,$domain);
+ &Apache::loncommon::blocking_status('passwd',$clientip,$user,$domain);
if ($blocked) {
$r->print('
'.$blocktext.'
');
return;
@@ -1284,9 +1359,9 @@ sub passwordchanger {
} else {
$r->print(
'
'
- .&mt('Sorry, the URL generated when you requested reset of'
- .' your password contained incomplete information.')
- .'
'
+ .&mt('Sorry, the URL generated when you requested reset of'
+ .' your password contained incomplete information.')
+ .''
);
return;
}
@@ -1297,13 +1372,18 @@ sub passwordchanger {
$r->print(
'
'
.&mt('Page requested in unexpected context')
- .'
'
+ .'
'
);
return;
}
my $currentauth=&Apache::lonnet::queryauthenticate($user,$domain);
# Check for authentication types that allow changing of the password.
- return if ($currentauth !~ /^(unix|internal):/);
+ if ($currentauth !~ /^(unix|internal):/) {
+ unless ($caller eq 'reset_by_email') {
+ $r->print('