-
-
+
- '.$lt{'fold'}.' '."\n".
- &Apache::loncommon::select_form($folder,'folder',%formhash).'
+ | '.$lt{'fold'}.' '."\n".
+ &Apache::loncommon::select_form($folder,'folder',\%formhash).'
|
- '.$lt{'show'}.' '."\n".
+ | '.$lt{'show'}.' '."\n".
&Apache::loncommon::select_form($env{'form.interdis'},'interdis',
- %show).'
+ \%show).'
|
- '.$lt{'status'}.' '."\n".
- &Apache::loncommon::select_form($msgstatus,'msgstatus',%statushash).'
+ | '.$lt{'status'}.' '."\n".
+ &Apache::loncommon::select_form($msgstatus,'msgstatus',\%statushash).'
|
- '.$lt{'actn'}.' '.
- &Apache::loncommon::select_form('view','folderaction',%actions).'
- | '.
- '
+ | '.$lt{'actn'}.' '."\n".'
+ '.
+ &Apache::loncommon::select_form('view','folderaction',\%actions).
+ '
+
+ |
+ '.&mt('New Folder').' '."\n".'
+
+
+
+
|
- | | | |
-
-
- |
-
- '."\n".
+'."\n".
''.
''.
($folder=~/^critical/?'':'');
@@ -271,12 +268,13 @@ sub get_permanent_folders {
}
sub get_msgstatus_types {
- my %statushash = &Apache::lonlocal::texthash(
- '' => 'Any',
- new => 'Unread',
- read => 'Read',
- replied => 'Replied to',
- forwarded => 'Forwarded',
+ # Don't translate here!
+ my %statushash = (
+ '' => 'Any',
+ 'new' => 'Unread',
+ 'read' => 'Read',
+ 'replied' => 'Replied to',
+ 'forwarded' => 'Forwarded',
);
return %statushash;
}
@@ -289,18 +287,31 @@ sub scrollbuttons {
my %statushash = &get_msgstatus_types();
my $status;
if ($msgstatus eq '') {
- $status = &mt('All');
+ $status = 'All'; # Don't translate here!
} else {
$status = $statushash{$msgstatus};
}
- return
- ''.&mt('Page').': '.
- ''.
- ''.
- ' of '.$maxdis.
- ''.
- ' '.
- &mt('[_1] messages: showing messages [_2] through [_3] of [_4].',$status,$first,$finish,$total).'';
+ my $output = ''.&mt('Page:').' ';
+ if ($maxdis == 1) {
+ # No buttons if only one page is displayed
+ $output .= '1/1';
+ } else {
+ $output .=
+ ''.
+ ''.
+ ' / '.$maxdis.' '.
+ ''.
+ '';
+ }
+ $output .=
+ ''
+ .''.&mt($status.' messages:').' '
+ .&mt('showing messages [_1] through [_2] of [_3].',
+ $first,$finish,$total)
+ .' '
+ .'';
+
+ return $output;
}
# =============================================================== Status Change
@@ -367,7 +378,7 @@ sub deletefolder {
my ($folder)=@_;
my %permfolders = &get_permanent_folders();
if (defined($permfolders{$folder})) {
- return &mt('The folder "[_1]" may not be deleted',$folder);
+ return &mt('The folder "[_1]" may not be deleted.',$folder);
}
my %userfolders = &Apache::lonmsg::get_user_folders();
if (!defined($userfolders{$folder})) {
@@ -507,6 +518,7 @@ sub movemsg {
sub discourse {
my ($statushash) = @_;
my ($result,$active,$previous,$future);
+ my $crstype = &Apache::loncommon::course_type();
my ($course_personnel,
$current_members,
$expired_members,
@@ -522,8 +534,14 @@ sub discourse {
\%defaultUsers,
1,"selectedusers",1,'email')
) {
+ my $bcc_curr_hdr;
+ if ($crstype eq 'Community') {
+ $bcc_curr_hdr = &mt('Bcc: community participants with current access');
+ } else {
+ $bcc_curr_hdr = &mt('Bcc: course members with current access');
+ }
$result .= ' ';
@@ -537,8 +555,14 @@ sub discourse {
\%defaultUsers,
1, "selectedusers",0,'email')
) {
+ my $bcc_prev_hdr;
+ if ($crstype eq 'Community') {
+ $bcc_prev_hdr = &mt('Bcc: community participants with expired access');
+ } else {
+ $bcc_prev_hdr = &mt('Bcc: course members with expired access');
+ }
$result .= ' ';
@@ -553,10 +577,17 @@ sub discourse {
\%defaultUsers,
1, "selectedusers",0,'email')
) {
+ my $bcc_future_hdr;
+ if ($crstype eq 'Community') {
+ $bcc_future_hdr = &mt('Bcc: community participants with future access');
+ } else {
+ $bcc_future_hdr = &mt('Bcc: course members with future access');
+ }
+
$result .= '';
if (ref($statushash) eq 'HASH') {
$statushash->{'future'} = 1;
@@ -595,9 +626,7 @@ sub disgroup {
return;
} else {
$hasfloat = 1;
- unless($env{'environment.wysiwygeditor'} eq 'on') {
- $r->print('');
- }
+ $r->print(' ');
my %Sortby = (
active => {},
previous => {},
@@ -670,9 +699,7 @@ sub disgroup {
}
}
}
- unless($env{'environment.wysiwygeditor'} eq 'on') {
- $r->print(' ');
- }
+ $r->print(' ');
}
return $hasfloat;
}
@@ -680,6 +707,7 @@ sub disgroup {
sub group_check_uncheck {
my $output = qq|
|;
}
@@ -726,10 +755,16 @@ sub groupmail_header {
}
&Apache::lonhtmlcommon::clear_breadcrumbs();
if ($refarg) {
+ my $brtitle;
+ if (&Apache::loncommon::course_type() eq 'Community') {
+ $brtitle = 'View community groups';
+ } else {
+ $brtitle = 'View course groups';
+ }
&Apache::lonhtmlcommon::add_breadcrumb
({href=>"/adm/coursegroups",
text=>"Groups",
- title=>"View course groups"});
+ title=>$brtitle});
}
&Apache::lonhtmlcommon::add_breadcrumb
({href=>"/adm/$cdom/$cnum/$group/smppg?$refarg",
@@ -779,6 +814,15 @@ sub discrit {
foreach my $key (sort(keys(%what))) {
my %content=&Apache::lonmsg::unpackagemsg($what{$key});
next if ($content{'senderdomain'} eq '');
+ my $description;
+ if ($content{'courseid'} ne '') {
+ if ($content{'courseid'} =~ m{/^$match_domain\_$match_courseid$}) {
+ my %courseinfo=&Apache::lonnet::coursedescription($content{'courseid'},{'one_time' => 1});
+ if ($courseinfo{'description'} ne '') {
+ $description = $courseinfo{'description'};
+ }
+ }
+ }
$result .= &Apache::lonhtmlcommon::start_pick_box()
.&Apache::lonhtmlcommon::row_title(&mt('From'),undef,'LC_oddrow_value')
.''.&Apache::loncommon::aboutmewrapper(
@@ -790,8 +834,13 @@ sub discrit {
.&Apache::lonhtmlcommon::row_closure(1)
.&Apache::lonhtmlcommon::row_title(&mt('Subject'),undef,'LC_oddrow_value')
.$content{'subject'}
- .&Apache::lonhtmlcommon::row_closure(1)
- .&Apache::lonhtmlcommon::row_title(&mt('Message'),undef,'LC_evenrow_value')
+ .&Apache::lonhtmlcommon::row_closure(1);
+ if ($description ne '') {
+ $result .= &Apache::lonhtmlcommon::row_title(&mt('Course'),undef,'LC_oddrow_value')
+ .$description
+ .&Apache::lonhtmlcommon::row_closure(1);
+ }
+ $result .= &Apache::lonhtmlcommon::row_title(&mt('Message'),undef,'LC_evenrow_value')
.''.&Apache::lontexconvert::msgtexconverted($content{'message'}).' '
.&Apache::lonhtmlcommon::row_closure()
.&Apache::lonhtmlcommon::row_title('',undef,'LC_oddrow_value')
@@ -824,8 +873,11 @@ sub discrit {
}
# Check to see if there were any messages.
if ($result eq '') {
- $result = "".&mt('You have no critical messages.')."".
- ''.&mt('Select a course').' '.
+ $result =
+ ''.
+ &mt('You have no critical messages.').
+ ' '.
+ ''.&mt('Select a course').' '.
''.&mt('Communicate').'';
} else {
$r->print($header);
@@ -943,10 +995,15 @@ sub get_course_desc {
if (defined($env{'course.'.$fromcid.'.description'})) {
$description = $env{'course.'.$fromcid.'.description'};
} else {
- my %courseinfo=&Apache::lonnet::coursedescription($fromcid);
- $description = $courseinfo{'description'};
+ if ($fromcid =~ m{/^$match_domain\_$match_courseid$}) {
+ my %courseinfo=&Apache::lonnet::coursedescription($fromcid,
+ {'one_time' => 1});
+ $description = $courseinfo{'description'};
+ }
+ }
+ if ($description ne '') {
+ $$descriptions{$fromcid} = $description;
}
- $$descriptions{$fromcid} = $description;
}
return $description;
}
@@ -985,12 +1042,13 @@ sub disfolder {
my ($startblock,$endblock) = &Apache::loncommon::blockcheck(\%setters,'com');
my %lt = &Apache::lonlocal::texthash(
sede => 'Select a destination folder to which the messages will be moved.',
- nome => 'No messages have been selected to apply ths action to.',
+ nome => 'No messages have been selected to apply this action to.',
chec => 'Check the checkbox for at least one message.',
);
my $jscript = &Apache::loncommon::check_uncheck_jscript();
$r->print(<
+//
ENDDISHEADER
- my $fsqs='&folder='.$folder;
+ my $fsqs='&folder='.$folder;
my @temp=&sortedmessages(\%blocked,$startblock,$endblock,\$numblocked,$folder,$msgstatus);
my $totalnumber=$#temp+1;
if ($totalnumber < 1) {
+ $r->print('');
if ($msgstatus eq '') {
- $r->print(' '.&mt('Empty Folder').'');
+ $r->print(&mt('There are no messages in this folder.'));
} elsif ($msgstatus eq 'replied') {
- $r->print(''.&mt('You have not replied to any messages in this folder.').'');
- } else {
- $r->print(''.&mt('There are no '.lc($statushash{$msgstatus}).' messages in this folder.').'');
+ $r->print(&mt('You have not replied to any messages in this folder.'));
+ } else {
+ $r->print(&mt('There are no '.lc($statushash{$msgstatus}).' messages in this folder.'));
}
+ $r->print('');
if ($numblocked > 0) {
$r->print(&blocked_in_folder($numblocked,$startblock,$endblock,
\%setters));
}
- return;
+ return;
}
my $interdis = $env{'form.interdis'};
my $number=int($totalnumber/$interdis);
@@ -1053,61 +1113,65 @@ ENDDISHEADER
if ($lastdis>$#temp) { $lastdis=$#temp; }
$r->print(&scrollbuttons($startdis,$number,$firstdis,$lastdis,$totalnumber,$msgstatus));
$r->print('');
if ($hasfloat) {
- unless($env{'environment.wysiwygeditor'} eq 'on') {
- $r->print('');
- }
+ $r->print('');
}
$r->print(&generate_preview_form);
}
@@ -1772,8 +1869,10 @@ sub retrieve_instructor_comments {
}
sub disfacetoface {
- my ($r,$user,$domain)=@_;
- my $target=$env{'form.grade_target'};
+ my ($r,$user,$domain,$target)=@_;
+ if ($target eq '') {
+ $target=$env{'form.grade_target'};
+ }
unless ($env{'request.course.id'}) { return; }
if (!&Apache::lonnet::allowed('dff',$env{'request.course.id'})
&& ! &Apache::lonnet::allowed('dff',$env{'request.course.id'}.
@@ -1785,11 +1884,13 @@ sub disfacetoface {
$env{'course.'.$env{'request.course.id'}.'.domain'},
$env{'course.'.$env{'request.course.id'}.'.num'},
'%255b'.$user.'%253a'.$domain.'%255d');
- my $result='';
+ my $result='';
foreach my $key (sort(keys(%records))) {
my %content=&Apache::lonmsg::unpackagemsg($records{$key});
next if ($content{'senderdomain'} eq '');
- &Apache::lonfeedback::newline_to_br(\$content{'message'});
+ if (!&Apache::lonfeedback::contains_block_html($content{'message'})) {
+ &Apache::lonfeedback::newline_to_br(\$content{'message'});
+ }
if ($content{'subject'}=~/^Record/) {
$result.=' '.&mt('Record').'';
} elsif ($content{'subject'}=~/^Broadcast/) {
@@ -1849,9 +1950,11 @@ $content{'sendername'}.':'.
} else {
$r->print('\textbf{'.&mt('No notes, face-to-face discussion records, critical messages or broadcast messages in this [_1].',$lctype).'}\\\\');
}
+ } elsif ($target ne 'tex') {
+ $r->print($result.'');
} else {
- $r->print($result);
- }
+ $r->print(&Apache::lonxml::xmlparse($r, 'tex', $result));
+ }
}
sub general_message {
@@ -1877,8 +1980,8 @@ sub facetoface {
return;
}
my $crstype = &Apache::loncommon::course_type();
- my $leaders = ($crstype eq 'Group') ? 'coordinators and leaders'
- : 'faculty and staff';
+ my $leaders = ($crstype eq 'Community') ? 'coordinators and leaders'
+ : 'faculty and staff';
&printheader($r,
'/adm/email?recordftf=query',
"User Notes, Face-to-Face, Critical Messages, Broadcast Messages, Archived Messages");
@@ -1915,6 +2018,7 @@ sub facetoface {
.&Apache::lonhtmlcommon::end_pick_box()
.' '
.''
+ .''
);
if (($stage ne 'query') &&
@@ -1964,12 +2068,18 @@ sub examblock {
$r->print('Not allowed');
return;
}
- my $usertype = (&Apache::loncommon::course_type() eq 'Group') ? 'members'
- : 'students';
+ my $usertype;
+ my $crstype = &Apache::loncommon::course_type();
+ if ($crstype eq 'Community') {
+ $usertype = 'members';
+ } else {
+ $usertype = 'students';
+ }
+ my $lctype = lc($crstype);
my %lt=&Apache::lonlocal::texthash(
'comb' => 'Communication Blocking',
'cbds' => 'Communication blocking during scheduled exams',
- 'desc' => "You can use communication blocking to prevent $usertype enrolled in this course from displaying LON-CAPA messages sent by other $usertype during an online exam. As blocking of communication could potentially interrupt legitimate communication between $usertype who are also both enrolled in a different LON-CAPA course, please be careful that you select the correct start and end times for your scheduled exam when setting or modifying these parameters.",
+ 'desc' => "You can use communication blocking to prevent $usertype enrolled in this $lctype from displaying LON-CAPA messages sent by other $usertype during an online exam. As blocking of communication could potentially interrupt legitimate communication between $usertype who are also both enrolled in a different LON-CAPA course or community, please be careful that you select the correct start and end times for your scheduled exam when setting or modifying these parameters.",
'mecb' => 'Modify existing communication blocking periods',
'ncbc' => 'No communication blocks currently saved',
'stor' => 'Save',
@@ -2146,7 +2256,7 @@ sub display_blocker_status {
$ltext->{'setb'} |
$ltext->{'even'} |
$ltext->{'blck'} |
- $ltext->{'actn'}? |
+ $ltext->{'actn'} |
|
END
foreach my $record (sort(keys(%{$records}))) {
@@ -2166,7 +2276,7 @@ END
$setuname,$setudom);
$r->print(&Apache::loncommon::start_data_table_row());
$r->print(<<"END");
- '
- .&Apache::lontemplate::start_functionslist($legendtext)
- );
- foreach my $item (@functionlist) {
- $r->print(&Apache::lontemplate::item_functionslist($item));
- }
- $r->print(&Apache::lontemplate::end_functionslist()
- .'
'
- );
# Prepare available actions
my $symb;
@@ -2354,8 +2459,8 @@ sub displaymessage {
} elsif (defined($content{'baseurl'})) {
$symb=&Apache::lonnet::symbread($content{'baseurl'});
}
- if ($env{'user.adv'}) {
my @actionlist;
+ if ($env{'user.adv'}) {
if (&Apache::lonnet::allowed('vgr',$env{'request.course.id'})) {
push(@actionlist,&Apache::loncommon::track_student_link(
@@ -2380,22 +2485,31 @@ sub displaymessage {
,$symb
,'check'));
}
+ }
+
+# Print functionlist and actionlist in page header
+ my $functions='
+//
ENDJS
@@ -2822,10 +2947,10 @@ sub header {
if ($baseurl) {
$extra .= "";
}
- $r->print(&Apache::loncommon::start_page('Communication',
+ $r->print(&Apache::loncommon::start_page('Messages',
$extra));
$r->print(&Apache::lonhtmlcommon::breadcrumbs
- (($title?$title:'Send and Receive Messages')));
+ (($title?$title:'Send and display messages')));
}
# ---------------------------------------------------------------- Print header
@@ -3078,7 +3203,7 @@ sub sendoffmail {
my ($recuname,$recdomain)=split(/\:/,$address);
my $msgtxt = $savemsg;
if ($toaddr{$address}) {
- $msgtxt.='
'.$toaddr{$address};
+ $msgtxt.="\n".'
'."\n".$toaddr{$address};
}
my @thismsg;
if ($msgtype eq 'critical') {
@@ -3183,10 +3308,11 @@ sub sendoffmail {
'','','','',$recipid);
}
}
- if (!$env{'form.multiforward'}) {
+ if (!$env{'form.multiforward'}) {
if ($sendstatus=~/^(\s*(?:ok|con_delayed)\s*)*$/) {
- $r->print('
'.&mt('Completed.').
- '');
+ my $message = &Apache::lonhtmlcommon::confirm_success(&mt('Completed.'));
+ $message = &Apache::loncommon::confirmwrapper($message);
+ $r->print($message);
if ($env{'form.displayedcrit'}) {
&discrit($r);
}
@@ -3196,10 +3322,15 @@ sub sendoffmail {
&Apache::loncommunicate::menu($r);
}
} else {
- $r->print(''.&Apache::lonhtmlcommon::confirm_success(&mt('Could not deliver message'),1).'
'.
- &mt('Please use the browser "Back" button and correct the recipient addresses ([_1]).',$sendstatus).'
');
+ my $message = &Apache::lonhtmlcommon::confirm_success(&mt('Could not deliver message'),1);
+ $message .= '
'.&mt('Please use the browser "Back" button and correct the recipient addresses ([_1]).',$sendstatus);
+ $message = &Apache::loncommon::confirmwrapper($message);
+ $r->print($message);
}
}
+ } else {
+ &printheader($r,'','Messages cancelled.');
+ return 'cancelled';
}
return $sendstatus;
}
@@ -3223,7 +3354,7 @@ sub handler {
'recordftf','sortedby','block','folder','startdis','interdis',
'showcommentbaseurl','dismode','group','subject','text','ref',
'msgstatus']);
- $sqs='&sortedby='.$env{'form.sortedby'};
+ $sqs='&sortedby='.$env{'form.sortedby'};
# ------------------------------------------------------ They checked for email
unless ($env{'form.block'}) {
@@ -3235,7 +3366,7 @@ sub handler {
&Apache::lonhtmlcommon::clear_breadcrumbs();
&Apache::lonhtmlcommon::add_breadcrumb
({href=>"/adm/communicate",
- text=>"Communication/Messages",
+ text=>"Messages",
faq=>12,bug=>'Communication Tools',});
# ------------------------------------------------------------------ Get Folder
@@ -3244,7 +3375,7 @@ sub handler {
unless ($folder) {
$folder='';
} else {
- $sqs.='&folder='.&escape($folder);
+ $sqs.='&folder='.&escape($folder);
}
# ------------------------------------------------------------ Get Display Mode
@@ -3276,7 +3407,7 @@ sub handler {
$startdis++;
}
my $postedstartdis=$startdis+1;
- $sqs.='&startdis='.$postedstartdis;
+ $sqs.='&startdis='.$postedstartdis;
# --------------------------------------------------------------- Render Output
@@ -3316,9 +3447,10 @@ sub handler {
my ($result,$msg) =
&statuschange($env{'form.markdel'},'deleted',$folder);
if (!$result) {
- $r->print(''.
- &mt('Failed to delete the message.').'
'.
- ''.$msg."
\n");
+ my $message = &Apache::lonhtmlcommon::confirm_success(&mt('Failed to delete the message.'),1);
+ $message .= ''.$msg.'
';
+ $message = &Apache::loncommon::confirmwrapper($message);
+ $r->print($message);
}
&Apache::loncommunicate::menu($r);
&disall($r,($folder?$folder:$dismode),$msgstatus);
@@ -3340,7 +3472,10 @@ sub handler {
$total ++;
}
&printheader($r,'','Marked Messages Read');
- $r->print(&mt('Marked [_1] message(s) read',$total).'');
+ my $message = &Apache::lonhtmlcommon::confirm_success(&mt('Marked [quant,_1,message] read',$total));
+ $message = &Apache::loncommon::confirmwrapper($message);
+ $r->print($message);
+ # $r->print('
');
&Apache::loncommunicate::menu($r);
&disall($r,($folder?$folder:$dismode),$msgstatus);
} elsif ($env{'form.markedaction'} eq 'markedunread') {
@@ -3351,7 +3486,10 @@ sub handler {
$total ++;
}
&printheader($r,'','Marked Messages Unread');
- $r->print(&mt('Marked [_1] message(s) unread',$total).'
');
+ my $message = &Apache::lonhtmlcommon::confirm_success(&mt('Marked [quant,_1,message] unread',$total));
+ $message = &Apache::loncommon::confirmwrapper($message);
+ $r->print($message);
+ # $r->print('
');
&Apache::loncommunicate::menu($r);
&disall($r,($folder?$folder:$dismode),$msgstatus);
} elsif ($env{'form.markedaction'} eq 'markedmove') {
@@ -3360,7 +3498,7 @@ sub handler {
&printheader($r,'','Moved Messages');
if (!defined($gotfolders{$destfolder})) {
$r->print(&mt('Destination folder [_1] is not a valid folder',
- $destfolder));
+ ''.$destfolder.''));
} else {
my ($total,$failed,@failed_msg)=(0,0);
my @to_move = &Apache::loncommon::get_env_multiple('form.delmark');
@@ -3374,15 +3512,17 @@ sub handler {
push(@failed_msg,$msg);
}
}
- if ($failed) {
- $r->print('
- '.&mt('Failed to move [_1] message(s)',$failed).
- '
');
- $r->print(''.
- join("
\n",@failed_msg).
- "
\n");
- }
- $r->print(&mt('Moved [_1] message(s)',$total).'');
+ my $message = '';
+ if ($failed) {
+ $message .= &Apache::lonhtmlcommon::confirm_success(&mt('Failed to move [quant,_1,message]',$failed),1);
+ $message .= '
'.
+ join("
\n",@failed_msg).
+ "
\n";
+ }
+ $message .= &Apache::lonhtmlcommon::confirm_success(&mt('Moved [quant,_1,message]',$total));
+ $message = &Apache::loncommon::confirmwrapper($message);
+ $r->print($message);
+ # $r->print('');
}
&Apache::loncommunicate::menu($r);
&disall($r,($folder?$folder:$dismode),$msgstatus);
@@ -3400,15 +3540,17 @@ sub handler {
}
}
&printheader($r,'','Deleted Messages');
+ my $message = '';
if ($failed) {
- $r->print('
- '.&mt('Failed to delete [_1] message(s)',$failed).
- '
');
- $r->print(''.
- join("
\n",@failed_msg).
- "
\n");
- }
- $r->print(&mt('Deleted [_1] message(s)',$total).'');
+ $message .= &Apache::lonhtmlcommon::confirm_success(&mt('Failed to delete [quant,_1,message]',$failed),1);
+ $message .= '
'.
+ join("
\n",@failed_msg).
+ "
\n";
+ }
+ $message .= &Apache::lonhtmlcommon::confirm_success(&mt('Deleted [quant,_1,message]',$total));
+ $message = &Apache::loncommon::confirmwrapper($message);
+ $r->print($message);
+ # $r->print('');
&Apache::loncommunicate::menu($r);
&disall($r,($folder?$folder:$dismode),$msgstatus);
} elsif ($env{'form.markunread'}) {
@@ -3464,19 +3606,19 @@ sub handler {
}
if (keys(%forwardok) > 0) {
my $count = keys(%forwardok);
- $r->print('
'.
- &mt('[quant,_1,message] forwarded.',$count).
- '');
+ my $message = &Apache::lonhtmlcommon::confirm_success(&mt('[quant,_1,message] forwarded.',$count));
+ $message = &Apache::loncommon::confirmwrapper($message);
+ $r->print($message);
}
if (keys(%forwardfail) > 0) {
my $count = keys(%forwardfail);
- $r->print('
'.
- &mt('Could not forward [quant,_1,message].',$count).
- ' ');
+ my $message = &Apache::lonhtmlcommon::confirm_success(&mt('Could not forward [quant,_1,message].',$count),1);
foreach my $key (keys(%forwardfail)) {
- $r->print(&mt('Could not deliver forwarded message.').' '.
- &mt('The recipient addresses may need to be corrected').' ('.$forwardfail{$key}.').
');
+ $message .= '
'.&mt('Could not deliver forwarded message.').' '.
+ &mt('The recipient addresses may need to be corrected').' ('.$forwardfail{$key}.')';
}
+ $message = &Apache::loncommon::confirmwrapper($message);
+ $r->print($message);
}
&Apache::loncommunicate::menu($r);
} else {
@@ -3500,10 +3642,13 @@ sub handler {
my $showfolder = $env{'form.newfolder'};
my ($makeresult,$warning) = &makefolder($env{'form.newfolder'});
if ($makeresult eq 'ok') {
- $r->print(&mt('Folder "[_1]" created.',$showfolder).'
');
+ my $message = &Apache::lonhtmlcommon::confirm_success(&mt('Folder "[_1]" created.',$showfolder));
+ $message = &Apache::loncommon::confirmwrapper($message);
+ $r->print($message);
} else {
- $r->print(&mt('Creation failed.').' '.$makeresult.'
'.
- $warning);
+ my $message = &Apache::lonhtmlcommon::confirm_success(&mt('Creation failed.').' '.$makeresult.'
'.$warning,1);
+ $message = &Apache::loncommon::confirmwrapper($message);
+ $r->print($message);
$showfolder = $folder;
}
&Apache::loncommunicate::menu($r);
@@ -3515,10 +3660,14 @@ sub handler {
my $showfolder = '';
my $delresult = &deletefolder($folder);
if ($delresult eq 'ok') {
- $r->print(&mt('Folder "[_1]" deleted.',$folder).'
');
+ my $message = &Apache::lonhtmlcommon::confirm_success(&mt('Folder "[_1]" deleted.',$folder));
+ $message = &Apache::loncommon::confirmwrapper($message);
+ $r->print($message);
$env{'form.folder'} = '';
} else {
- $r->print(&mt('Deletion failed.').' '.$delresult.'
');
+ my $message = &Apache::lonhtmlcommon::confirm_success(&mt('Deletion failed.').' '.$delresult,1);
+ $message = &Apache::loncommon::confirmwrapper($message);
+ $r->print($message);
$showfolder = $folder;
}
&Apache::loncommunicate::menu($r);
@@ -3528,9 +3677,13 @@ sub handler {
my $showfolder = $env{'form.renamed'};
my $renresult = &renamefolder($folder);
if ($renresult eq 'ok') {
- $r->print(&mt('Folder "[_1]" renamed to "[_2]".',$folder,$showfolder).'
');
+ my $message = &Apache::lonhtmlcommon::confirm_success(&mt('Folder "[_1]" renamed to "[_2]".',$folder,$showfolder));
+ $message = &Apache::loncommon::confirmwrapper($message);
+ $r->print($message);
} else {
- $r->print(&mt('Renaming failed.').' '.$renresult.'
');
+ my $message = &Apache::lonhtmlcommon::confirm_success(&mt('Renaming failed.').' '.$renresult,1);
+ $message = &Apache::loncommon::confirmwrapper($message);
+ $r->print($message);
$showfolder = $folder;
}
&Apache::loncommunicate::menu($r);