--- loncom/interface/lonwhatsnew.pm 2007/03/02 20:58:32 1.69
+++ loncom/interface/lonwhatsnew.pm 2008/03/18 22:00:28 1.76
@@ -1,5 +1,5 @@
#
-# $Id: lonwhatsnew.pm,v 1.69 2007/03/02 20:58:32 raeburn Exp $
+# $Id: lonwhatsnew.pm,v 1.76 2008/03/18 22:00:28 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -99,28 +99,28 @@ sub handler {
text=>"Display Action Items"});
if (($command eq 'chgthreshold') && $checkallowed{'abovethreshold'}) {
&Apache::lonhtmlcommon::add_breadcrumb
- ({href=>'/adm/whatsnew?command=chgthreshold&refpage='.$refpage,
+ ({href=>'/adm/whatsnew?command=chgthreshold&refpage='.$refpage,
text=>"Change thresholds"});
$r->print(&Apache::lonhtmlcommon::breadcrumbs
("What's New?",#'Course_Action_Items_Thresholds'
));
} elsif (($command eq 'chginterval') && $checkallowed{'versionchanges'} ) {
&Apache::lonhtmlcommon::add_breadcrumb
- ({href=>'/adm/whatsnew?command=chginterval&refpage='.$refpage,
+ ({href=>'/adm/whatsnew?command=chginterval&refpage='.$refpage,
text=>"Change interval"});
$r->print(&Apache::lonhtmlcommon::breadcrumbs
("What's New?",#'Course_Action_Items_Intervals'
));
} elsif (($command eq 'chgdisc') && $checkallowed{'coursediscussion'}) {
&Apache::lonhtmlcommon::add_breadcrumb
- ({href=>'/adm/whatsnew?command=chgdisc&refpage='.$refpage,
+ ({href=>'/adm/whatsnew?command=chgdisc&refpage='.$refpage,
text=>"Change discussion display"});
$r->print(&Apache::lonhtmlcommon::breadcrumbs
("What's New?",#'Course_Action_Items_Intervals'
));
} elsif ($command eq 'courseinit') {
&Apache::lonhtmlcommon::add_breadcrumb
- ({href=>'/adm/whatsnew?command=courseinit&refpage='.$refpage,
+ ({href=>'/adm/whatsnew?command=courseinit&refpage='.$refpage,
text=>"Course initialization preference"});
$r->print(&Apache::lonhtmlcommon::breadcrumbs
("What's New?",#'Course_Action_Items_Initialization'
@@ -295,7 +295,7 @@ sub display_actions_box {
my $currinit = $pagedesc{$initdisp}.' ('.$pagedesc{$initcontrol}.')';
unless ($cid) {
- $r->print('
'.$lt{'yacc'}.' ');
+ $r->print(''.$lt{'yacc'}.'
');
return;
}
@@ -304,14 +304,22 @@ sub display_actions_box {
&GDBM_READER(),0640)) {
my $furl=$bighash{'first_url'};
untie(%bighash);
- $r->print(''.$lt{'gtfr'}.
- ' ');
+ $r->print(''.$lt{'gtfr'}.
+ ' ');
}
}
- $r->print(&mt('Page set to be displayed after you have selected a role in this '.$lctype).
- '. '.&mt('Currently: [_1] ',$currinit).'. '.
- &mt('Change for just this '.$lctype.' ',$refpage).' '.
- &mt('or for all your courses ',$refpage).' ');
+ $r->print(&mt('Page set to be displayed after you have selected a role in this '.$lctype).'.'
+ .' '
+ .&mt('Currently: [_1] ',$currinit)
+ .'. '
+# &mt('Change for just this '.$lctype.' ',$refpage).' '.
+# &mt('or for all your courses .',$refpage).' ');
+ .&mt('Change for just [_1]this course[_2]'
+ .' or for all [_3]your courses[_2].'
+ ,''
+ ,' '
+ ,'')
+ .' ');
if ($command eq 'reset') {
$result = &process_reset($cdom,$crs);
@@ -326,9 +334,9 @@ sub display_actions_box {
my $store_result=&store_display_settings($uname,$udom,$cid,$checkallowed);
unless ($store_result eq 'ok') {
- &Apache::lonnet::logthis('Error storing whatsnew settings: '.
+ &Apache::lonnet::logthis('Error saving whatsnew settings: '.
$store_result.' for '.'user '.$uname.':'.$udom.' in '.$lctype.' '.$cid);
- $result .= &mt('Unable to store visibility settings due to [_1]',
+ $result .= &mt('Unable to save visibility settings due to [_1]',
$store_result);
}
@@ -411,7 +419,7 @@ sub display_actions_box {
}
}
- $r->print(' ');
+ $r->print('');
my $displayed = 0;
my $totalboxes = 0;
@@ -426,20 +434,17 @@ sub display_actions_box {
foreach my $actionitem (@actionorder) {
if ($$checkallowed{$actionitem}) {
if ($displayed == $halfway) {
- $r->print(' ');
+ $r->print(' ');
}
&display_launcher($r,$actionitem,$refpage,$checkallowed,\%show,\%headings,\%res_title,\@tograde,\%ungraded,\@bombs,\%bombed,\%changed,\@warnings,\%triggered,\@newdiscussions,\%unread,$msgcount,\@newmsgs,$critmsgcount,\@critmsgs,$interval,$countunread);
$displayed ++;
}
}
$r->print('
-
-
-
-
- ');
+
+');
}
#-------------------------------
@@ -470,9 +475,9 @@ sub display_threshold_config {
$r->print(' ');
@@ -509,10 +514,10 @@ sub display_interval_config {
my $lctype = lc(&Apache::loncommon::course_type());
my $current = &get_current($env{'user.name'},$env{'user.domain'},
$env{'request.course.id'},'interval');
- $r->print(' '.&mt('Choose the time window to use for display of version changes for resources in the '.$lctype.'.'));
+ $r->print(' '.&mt('Choose the time window to use for display of version changes for resources in the '.$lctype.'.').' ');
unless ($current eq '') {
- $r->print(' '.&mt('Current value is [_1]',''.
- $$interval_titles{$current}.' .'));
+ $r->print(' '.&mt('Current value is [_1].',''.
+ $$interval_titles{$current}.' '));
}
$r->print('
');
@@ -869,10 +874,10 @@ sub check_thresholds {
my $resettitle = 'title_'.&escape($symb."\0".$part);
if (@parts > 1) {
$$triggered{$symb}{text}[$partcount] = '
- part - '.$part.' ';
+ '.&mt('part - ').$part.' ';
} else {
$$triggered{$symb}{text}[$partcount] = '
- single part ';
+ '.&mt('single part').' ';
}
$$triggered{$symb}{text}[$partcount] .= '
'.$stats{$part}{users}.'
@@ -982,7 +987,7 @@ sub process_reset {
sub process_update {
my ($uname,$udom,$threshold_titles) = @_;
- my $setoutput = 'Changes to threshold(s) for problem tracking: ';
+ my $setoutput = ''.&mt('Changes to threshold(s) for problem tracking:').' ';
foreach (keys %env) {
next if ($_!~/^form\.(.+)\_setparmval$/);
my $name = $1;
@@ -1302,7 +1307,7 @@ sub display_coursediscussion {
my $css_class = $rowNum%2?' class="LC_odd_row"':'';
my $lastpost = &Apache::lonnavmaps::timeToHumanString(
$$unread{$ressymb}{'lastpost'});
- $r->print(''.$forum_title.' '.$type.' ');
+ $r->print(''.$forum_title.' '.&mt($type).' ');
if ($countunread eq 'on') {
my $unreadnum = $$unread{$ressymb}{'unreadcount'};
$r->print(''.$lastpost.' '.
@@ -1329,11 +1334,12 @@ sub display_coursenormalmail {
foreach my $msg (@{$newmsgs}) {
$mailcount ++;
my $css_class = $mailcount%2?' class="LC_odd_row"':'';
- $r->print(' '.$mailcount.
- '. '.
- $msg->{'shortsub'}.' '.
- $msg->{'from'}.'@'.$msg->{'fromdom'}.' '.
- $msg->{'sendtime'}.' ');
+ $r->print(''.$mailcount
+ .'. '
+ .$msg->{'shortsub'}.' '
+ .$msg->{'from'}.':'.$msg->{'fromdom'}.' '
+ .$msg->{'sendtime'}.' ');
}
} else {
$r->print(''.
@@ -1356,7 +1362,7 @@ sub display_coursecritmail {
$r->print(' '.$mailcount.
'. '.
$msg->{'shortsub'}.' '.
- $msg->{'from'}.'@'.$msg->{'fromdom'}.' '.
+ $msg->{'from'}.':'.$msg->{'fromdom'}.' '.
$msg->{'sendtime'}.' ');
}
} else {
@@ -1420,11 +1426,11 @@ sub store_interval_setting {
\%interval_settings,$udom,$uname);
if ($outcome eq 'ok') {
$result = &mt('Interval set to version changes [_1]',
- ''.$$interval_titles{$env{'form.interval'}}.' ');
+ ''.$$interval_titles{$env{'form.interval'}}.' ').' ';
} else {
my $lctype = lc(&Apache::loncommon::course_type());
- &Apache::lonnet::logthis('Error storing whatsnew interval setting'.
+ &Apache::lonnet::logthis('Error saving whatsnew interval setting'.
' '.$outcome.' for '.$uname.':'.$udom.' in '.$lctype.' '.$cid);
$result = &mt('Unable to set interval to [_1] due to [_2].',
''.$$interval_titles{$env{'form.interval'}}.' ',
@@ -1444,15 +1450,15 @@ sub store_discussion_setting {
\%discussion_settings,$udom,$uname);
if ($outcome eq 'ok') {
$result = &mt('Count unread posts in discussions display set to [_1]',
- ''.$env{'form.countunread'}.' ');
+ ''.&mt($env{'form.countunread'}).' ').' ';
} else {
my $lctype = lc(&Apache::loncommon::course_type());
- &Apache::lonnet::logthis('Error storing whatsnew countunread setting'.
+ &Apache::lonnet::logthis('Error saving whatsnew countunread setting'.
' '.$outcome.' for '.$uname.':'.$udom.' in '.$lctype.' '.$cid);
$result = &mt('Unable to set "number unread posts display" to [_1]'.
' due to [_2].',
- ''.$env{'form.countunread'}.' ',
+ ''.&mt($env{'form.countunread'}).' ',
''.$outcome.' . ');
}
}
@@ -1486,7 +1492,7 @@ sub store_courseinit_setting {
$result = &mt('Page displayed after role selection in this '.$lctype.' set to [_2] ',$lctype,$$initpage{$env{'form.courseinit_page'}});
}
} else {
- &Apache::lonnet::logthis('Error storing whatsnew courseinit '.
+ &Apache::lonnet::logthis('Error saving whatsnew courseinit '.
'setting: '.$outcome.' for '.$uname.
':'.$udom.' in '.$lctype.' '.$cid);
if ($page_control eq 'global preferences') {
@@ -1514,17 +1520,19 @@ sub start_box {
my $showhide;
if ($$show{$caller}) {
$showhide = 'Hide ';
+ 'display_'.$caller.",'hide'".');">'.
+ &mt('Hide').'';
} else {
$showhide = 'Show ';
+ 'display_'.$caller.",'show'".');">'.
+ &mt('Show').'';
}
$r->print('
- '.$$heading{$caller}.'
+ '.$$heading{$caller}.'
'.$showhide.'
');
if (($caller eq 'abovethreshold') && ($$show{$caller})) {