--- loncom/interface/lonfeedback.pm 2012/01/06 01:59:53 1.323
+++ loncom/interface/lonfeedback.pm 2012/01/07 20:01:16 1.328
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Feedback
#
-# $Id: lonfeedback.pm,v 1.323 2012/01/06 01:59:53 www Exp $
+# $Id: lonfeedback.pm,v 1.328 2012/01/07 20:01:16 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -787,10 +787,12 @@ sub send_feedback_link {
sub send_message_link {
my ($ressymb) = @_;
my $output = ''.
- '
';
+ &discussion_link($ressymb,
+ '
',
+ 'sendmessageonly').
+ '';
return $output;
}
@@ -827,7 +829,17 @@ sub action_links_bar {
$discussion .= '&previous='.$prevread;
}
$discussion .= &group_args($group);
- $discussion .= '">'.&mt('Export').'';
+ $discussion .= '">'.&mt('Export').'';
+ if (&Apache::lonnet::allowed('rin',$env{'request.course.id'})) {
+ $discussion .= ' ';
+ $discussion .=''.&mt('Undelete all deleted entries').'';
+ }
+ $discussion.='';
if ($newpostsflag) {
if (!$markondisp) {
$discussion .='
$twoplus) {
+ $likesize="200";
+ } elsif ($thislikes>$oneplus) {
+ $likesize="150";
+ }
+ if ($thislikes<$twominus) {
+ $likesize="50";
+ } elsif ($thislikes<$oneminus) {
+ $likesize="75";
+ }
$$discussionitems[$idx].= '
'.
- $message.' ';
+ "".
+ $message.
+ ' ';
if ($contrib{$idx.':history'}) {
my @postversions = ();
$$discussionitems[$idx] .= &mt('This post has been edited by the author.');
@@ -1319,12 +1385,19 @@ sub build_posting_display {
$$discussionitems[$idx] .= ''.$version.'. - '.&Apache::lonlocal::locallocaltime($postversions[$i]).' ';
}
}
+# end of unless ($$notshown ...)
}
+# end of if ($message) ...
}
+# end of the else-branch of target being export
}
+# end of unless hidden or deleted
}
+# end of the loop over all discussion entries
}
+# end of "if there actually are any discussions
}
+# end of subroutine "build_posting_display"
}
sub filter_regexp {
@@ -3581,7 +3654,7 @@ sub handler {
# --------------------------- Get query string for limited number of parameters
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
- ['like','unlike','modal','hide','unhide','deldisc','postdata','preview','replydisc','editdisc','cmd','symb','onlyunread','allposts','onlyunmark','previous','markread','markonread','markondisp','toggoff','toggon','modifydisp','changes','navtime','navmaps','navurl','sortposts','applysort','rolefilter','statusfilter','sectionpick','groupick','posterlist','userpick','attach','origpage','currnewattach','deloldattach','keepold','allversions','export','sendmessageonly','group','ref']);
+ ['like','unlike','modal','hide','unhide','deldisc','undeleteall','postdata','preview','replydisc','editdisc','cmd','symb','onlyunread','allposts','onlyunmark','previous','markread','markonread','markondisp','toggoff','toggon','modifydisp','changes','navtime','navmaps','navurl','sortposts','applysort','rolefilter','statusfilter','sectionpick','groupick','posterlist','userpick','attach','origpage','currnewattach','deloldattach','keepold','allversions','export','sendmessageonly','group','ref']);
my $group = $env{'form.group'};
my %attachmax = (
text => &mt('(128 KB max size)'),
@@ -4014,6 +4087,24 @@ ENDREDIR
&Apache::loncommon::end_page();
$r->print($start_page.$discussion.$end_page);
return OK;
+
+ } elsif ($env{'form.undeleteall'}) {
+ &Apache::loncommon::content_type($r,'text/html');
+ $r->send_http_header;
+ my ($symb,$feedurl) = &get_feedurl_and_clean_symb($env{'form.undeleteall'});
+ $r->print(&Apache::loncommon::start_page('Undelete all deleted discussion entries'));
+ if (&Apache::lonnet::allowed('rin',$env{'request.course.id'})) {
+ if (&Apache::lonnet::store({'deleted' => ''},$symb,$env{'request.course.id'},
+ $env{'course.'.$env{'request.course.id'}.'.domain'},
+ $env{'course.'.$env{'request.course.id'}.'.num'}) eq 'ok') {
+ $r->print(&Apache::lonhtmlcommon::confirm_success(&mt("Undeleted all entries")));
+ } else {
+ $r->print(&Apache::lonhtmlcommon::confirm_success(&mt("Failed to undelete entries"),1));
+ }
+ $r->print(" ".&mt("Return and reload")."");
+ }
+ $r->print(&Apache::loncommon::end_page());
+ return OK;
} else {
# ------------------------------------------------------------- Normal feedback
my $feedurl=$env{'form.postdata'};
@@ -4029,6 +4120,8 @@ ENDREDIR
$symb=(split(/\:\:\:/,$env{'form.editdisc'}))[0];
} elsif ($env{'form.origpage'}) {
$symb="";
+ } elsif ($env{'form.sendmessageonly'}) {
+ $symb=(split(/\:\:\:/,$env{'form.sendmessageonly'}))[0];
} else {
$symb=&Apache::lonnet::symbread($feedurl);
}
|