[LON-CAPA-cvs] cvs: loncom /interface lonfeedback.pm
www
www at source.lon-capa.org
Sat Dec 10 17:54:34 EST 2011
www Sat Dec 10 22:54:34 2011 EDT
Modified files:
/loncom/interface lonfeedback.pm
Log:
Reply uses modal link, less copy/paste
Index: loncom/interface/lonfeedback.pm
diff -u loncom/interface/lonfeedback.pm:1.306 loncom/interface/lonfeedback.pm:1.307
--- loncom/interface/lonfeedback.pm:1.306 Sat Dec 10 01:45:36 2011
+++ loncom/interface/lonfeedback.pm Sat Dec 10 22:54:34 2011
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Feedback
#
-# $Id: lonfeedback.pm,v 1.306 2011/12/10 01:45:36 www Exp $
+# $Id: lonfeedback.pm,v 1.307 2011/12/10 22:54:34 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -771,17 +771,25 @@
return $discussion;
}
+
+sub discussion_link {
+ my ($ressymb,$linktext,$cmd,$item,$flag,$prev,$adds)=@_;
+ my $link='/adm/feedback?inhibitmenu=yes&modal=yes&'.$cmd.'='.&escape($ressymb).':::'.$item;
+ if ($flag) { $link .= '&previous='.$prev; }
+ if ($adds) { $link .= $adds; }
+ return &Apache::loncommon::modal_link($link,$linktext,600,400);
+}
+
+
sub send_feedback_link {
my ($ressymb) = @_;
- my $output = '<span class="LC_feedback_link">'.
- &Apache::loncommon::modal_link(
- '/adm/feedback?inhibitmenu=yes&modal=yes&replydisc='.&escape($ressymb).':::',
+ return '<span class="LC_feedback_link">'.
+ &discussion_link($ressymb,
'<img alt="" class="LC_noBorder" src="'.
&Apache::loncommon::lonhttpdurl('/adm/lonMisc/chat.gif').
'" border="0" /><span class="LC_menubuttons_inline_text">'.&mt('Post Discussion').'</span>',
- 600,400).
- '</span>';
- return $output;
+ 'replydisc').
+ '</span>';
}
sub send_message_link {
@@ -1166,23 +1174,14 @@
if (&discussion_open($status)) {
if (($group ne '') &&
(&check_group_priv($group,'pgd') eq 'ok')) {
- $sender.=' <a href="/adm/feedback?replydisc='.
- $escsymb.':::'.$idx;
- if ($$newpostsflag) {
- $sender .= '&previous='.$prevread;
- }
- $sender .= &group_args($group);
- $sender .= '">'.&mt('Reply').'</a>';
+ $sender.=' '.
+ &discussion_link($symb,&mt('Reply'),'replydisc',$idx,$$newpostsflag,$prevread,&group_args($group));
} elsif (&Apache::lonnet::allowed('pch',
$env{'request.course.id'}.
($env{'request.course.sec'}?'/'.
$env{'request.course.sec'}:''))) {
- $sender.=' <a href="/adm/feedback?replydisc='.
- $escsymb.':::'.$idx;
- if ($$newpostsflag) {
- $sender .= '&previous='.$prevread;
- }
- $sender .= '">'.&mt('Reply').'</a>';
+ $sender.=' '.
+ &discussion_link($symb,&mt('Reply'),'replydisc',$idx,$$newpostsflag,$prevread);
}
}
if ($viewgrades) {
More information about the LON-CAPA-cvs
mailing list