--- loncom/interface/lonfeedback.pm 2010/01/24 02:39:35 1.273.4.2
+++ loncom/interface/lonfeedback.pm 2009/08/12 16:03:58 1.276
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Feedback
#
-# $Id: lonfeedback.pm,v 1.273.4.2 2010/01/24 02:39:35 raeburn Exp $
+# $Id: lonfeedback.pm,v 1.276 2009/08/12 16:03:58 bisitz Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -91,7 +91,7 @@ sub list_discussion {
if (not &discussion_visible($status)) {
if ($mode ne 'board') {
&Apache::lonenc::check_encrypt(\$ressymb);
- return ' '.&send_message_link($ressymb);
+ return '
'.&send_message_link($ressymb)."
";
}
}
if ($group ne '' && $mode eq 'board') {
@@ -103,9 +103,12 @@ sub list_discussion {
my ($blocked,$blocktext) =
&Apache::loncommon::blocking_status('boards');
if ($blocked) {
+ $blocktext = ''.$blocktext." ";
&Apache::lonenc::check_encrypt(\$ressymb);
if ($mode ne 'board') {
- $blocktext.=' '.&send_message_link($ressymb);
+ $blocktext.=&send_message_link($ressymb).'
';
+ }else{
+ $blocktext.="";
}
return $blocktext;
}
@@ -169,8 +172,6 @@ sub list_discussion {
my $cdom = $env{'course.'.$cid.'.domain'};
my $cnum = $env{'course.'.$cid.'.num'};
- my $crstype = &Apache::loncommon::course_type();
-
# Get information about students and non-students in course for filtering display of posts
my %roleshash = ();
@@ -599,7 +600,7 @@ END
my %sort_types = ();
my %role_types = ();
my %status_types = ();
- &sort_filter_names(\%sort_types,\%role_types,\%status_types,$crstype);
+ &sort_filter_names(\%sort_types,\%role_types,\%status_types);
$discussion .= ''.&mt('Sorted by').' : '.$sort_types{$sortposts}.' ';
if (defined($env{'form.totposters'})) {
@@ -725,13 +726,13 @@ END
&postingform_display($mode,$ressymb,$now,$subject,
$comment,$outputtarget,$attachnum,
$currnewattach,$currdelold,
- $group,$crstype);
+ $group);
}
} else {
$discussion.=
&postingform_display($mode,$ressymb,$now,$subject,
$comment,$outputtarget,$attachnum,
- $currnewattach,$currdelold,'',$crstype);
+ $currnewattach,$currdelold);
}
}
} else {
@@ -757,9 +758,9 @@ sub send_feedback_link {
my $output = ''.
' '.
- ' '.&mt('Post Discussion').' ';
+ '" border="0" />';
return $output;
}
@@ -767,20 +768,20 @@ sub send_message_link {
my ($ressymb) = @_;
my $output = ''.
' '.&mt('Send Feedback').' ';
+ '" border="0" />';
return $output;
}
sub action_links_bar {
my ($colspan,$ressymb,$visible,$newpostsflag,$group,$prevread,$markondisp) = @_;
my $discussion = ''.
- ''.
- '';
+ '';
my $escsymb=&escape($ressymb);
if ($visible>2) {
- $discussion .= ''.
+ ' '.&mt('Sorting/Filtering options').' '.(' ' x2);
+ } else {
+ $discussion .= ' 'Note: in anonymous discussion, your name is visible only to course faculty',
@@ -835,9 +838,6 @@ sub postingform_display {
'poan' => 'Post Anonymous Discussion',
'newa' => 'New attachments',
);
- if ($crstype eq 'Community') {
- $lt{'note'} = &mt('Note: in anonymous discussion, your name is visible only to community facilitators');
- }
my $postingform = (<
@@ -865,7 +865,7 @@ ENDDISCUSS
}
my $blockblog = &Apache::loncommon::blocking_status('blogs');
if (!$blockblog) {
- $postingform .= &add_blog_checkbox($crstype);
+ $postingform .= &add_blog_checkbox();
}
$postingform .= "\n";
if ($outputtarget ne 'tex') {
@@ -1170,7 +1170,7 @@ sub build_posting_display {
$$imsitems{$idx}{'attach'}=$attachtxt{$numoldver};
$$imsitems{$idx}{'timestamp'}=$contrib{$idx.':timestamp'};
$$imsitems{$idx}{'sender'}=$plainname.' ('.
- $contrib{$idx.':sendername'}.' at '.
+ $contrib{$idx.':sendername'}.':'.
$contrib{$idx.':senderdomain'}.')';
$$imsitems{$idx}{'isanonymous'}='false';
if ($contrib{$idx.':anonymous'}) {
@@ -1367,7 +1367,7 @@ sub get_post_contents {
$$plainname,
$$contrib{$idx.':sendername'},
$$contrib{$idx.':senderdomain'}).' ('.
- $$contrib{$idx.':sendername'}.' at '.
+ $$contrib{$idx.':sendername'}.':'.
$$contrib{$idx.':senderdomain'}.')';
my $attachmenturls = $$contrib{$idx.':attachmenturl'};
my @postversions = ();
@@ -1664,10 +1664,15 @@ END
END
+ # Breadcrumbs
+ my $brcrum = [{'href' => '',
+ 'text' => 'Resource Feedback and Discussion'}];
+
my %onload = ('onload' => 'window.focus();setposttype();');
my $start_page=
&Apache::loncommon::start_page('Resource Feedback and Discussion',$js,
- {'add_entries' => \%onload});
+ {'add_entries' => \%onload,
+ 'bread_crumbs' => $brcrum,});
if ($quote ne '') {
&newline_to_br(\$quote);
@@ -2009,13 +2014,6 @@ sub print_sortfilter_options {
my $group_sel = '';
my $numgroupvis = 5;
my %sectioncount = &Apache::loncommon::get_sections();
- my @courseroles = qw(st ad ep ta in);
- my $crstype = &Apache::loncommon::course_type();
- my $ccrole = 'cc';
- if ($crstype eq 'Community') {
- $ccrole = 'co';
- }
- push(@courseroles,$ccrole);
if ($env{'request.course.sec'} !~ /^\s*$/) { #Restrict section choice to current section
@sections = ('all',$env{'request.course.sec'});
@@ -2079,7 +2077,7 @@ sub print_sortfilter_options {
my %sort_types = ();
my %role_types = ();
my %status_types = ();
- &sort_filter_names(\%sort_types,\%role_types,\%status_types,$crstype);
+ &sort_filter_names(\%sort_types,\%role_types,\%status_types);
my $js = <
@@ -2168,11 +2166,10 @@ $start_page
$role_types{'all'}
$role_types{'st'}
- $role_types{$ccrole}
+ $role_types{'cc'}
$role_types{'in'}
$role_types{'ta'}
$role_types{'ep'}
- $role_types{'ad'}
$role_types{'cr'}
@@ -2572,22 +2569,6 @@ ENDNOREDIRTWO
sub screen_header {
my ($feedurl,$symb) = @_;
- my $crscontent = &mt('Question/Comment/Feedback about course content');
- my $crspolicy = &mt('Question/Comment/Feedback about course policy');
- my $contribdisc = &mt('Contribution to course discussion of resource');
- my $anoncontrib = &mt('Anonymous contribution to course discussion of resource');
- my $namevis = &mt('name only visible to course faculty');
- my $crstype;
- if ($env{'request.course.id'}) {
- $crstype = &Apache::loncommon::course_type();
- if ($crstype eq 'Community') {
- $crscontent = &mt('Question/Comment/Feedback about community content');
- $crspolicy = &mt('Question/Comment/Feedback about community policy');
- $contribdisc = &mt('Contribution to community discussion of resource');
- $anoncontrib = &mt('Anonymous contribution to community discussion of resource');
- $namevis = &mt('name only visible to community facilitators');
- }
- }
my $msgoptions='';
my $discussoptions='';
unless (($env{'form.replydisc'}) || ($env{'form.editdisc'})) {
@@ -2608,13 +2589,13 @@ sub screen_header {
if (&feedback_available(0,1)) {
$msgoptions.=
' '.
- ($optionhash{'comment'}?$optionhash{'comment'}:$crscontent).
+ ($optionhash{'comment'}?$optionhash{'comment'}:&mt('Question/Comment/Feedback about course content')).
'
';
}
if (&feedback_available(0,0,1)) {
$msgoptions.=
' '.
- ($optionhash{'policy'}?$optionhash{'policy'}:$crspolicy).
+ ($optionhash{'policy'}?$optionhash{'policy'}:&mt('Question/Comment/Feedback about course policy')).
'
';
}
}
@@ -2625,15 +2606,14 @@ sub screen_header {
$env{'request.course.id'}.
($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:''))) {
$discussoptions=' '.
- $contribdisc.
- ' '.
- $anoncontrib.
- ' ('.$namevis.') '.
-
+ &mt('Contribution to course discussion of resource');
+ $discussoptions.=' '.
+ &mt('Anonymous contribution to course discussion of resource').
+ ' ('.&mt('name only visible to course faculty').') '.
''.&mt('Change Screenname').' ';
my $blockblog = &Apache::loncommon::blocking_status('blogs');
if (!$blockblog) {
- $discussoptions.= &add_blog_checkbox($crstype);
+ $discussoptions.= &add_blog_checkbox();
}
}
}
@@ -3001,8 +2981,12 @@ sub modify_attachments {
END
+ # Breadcrumbs
+ my $brcrum = [{'href' => '',
+ 'text' => 'Discussion Post Attachments'}];
my $start_page =
- &Apache::loncommon::start_page('Discussion Post Attachments',$js);
+ &Apache::loncommon::start_page('Discussion Post Attachments',$js,
+ {'bread_crumbs' => $brcrum,});
my $orig_subject = &unescape($env{'form.subject'});
my $subject=&clear_out_html($orig_subject,undef,1);
@@ -3273,8 +3257,7 @@ sub construct_attachmenturl {
}
sub add_blog_checkbox {
- my ($crstype) = @_;
- my $checkstatus;
+ my ($checkstatus);
if ($env{'form.blog'}) {
$checkstatus = 'checked="checked"';
}
@@ -3288,13 +3271,8 @@ function setblogvalue() {
}
}
- ';
- if ($crstype eq 'Community') {
- $output .= &mt('Add to my public community blog');
- } else {
- $output .= &mt('Add to my public course blog');
- }
- $output .= ' '."\n";
+ '.
+&mt('Add to my public course blog').' '."\n";
return $output;
}
@@ -3318,9 +3296,8 @@ sub has_discussion {
}
sub sort_filter_names {
- my ($sort_types,$role_types,$status_types,$crstype) = @_;
- if (ref($sort_types) eq 'HASH') {
- %{$sort_types} = (
+ my ($sort_types,$role_types,$status_types) = @_;
+ %{$sort_types} = (
ascdate => 'Date order - oldest first',
descdate => 'Date order - newest first',
thread => 'Threaded',
@@ -3328,30 +3305,24 @@ sub sort_filter_names {
username => 'By domain and username',
lastfirst => 'By last name, first name'
);
- }
- my @courseroles = qw(st in ta ep ad);
- if ($crstype eq 'Community') {
- push(@courseroles,'co');
- } else {
- push(@courseroles,'cc');
- }
- if (ref($role_types) eq 'HASH') {
- foreach my $role (@courseroles) {
- $role_types->{$role} = &Apache::lonnet::plaintext($role,$crstype);
- }
- $role_types->{'all'} = 'All roles';
- $role_types->{'cr'} = 'Custom role';
- }
- if (ref($status_types) eq 'HASH') {
- %{$status_types} = (
- all => 'Roles of any status',
- Active => 'Only active roles',
- Expired => 'Only past roles',
- Future => 'Only future roles',
- );
- }
+ %{$role_types} = (
+ all => 'All roles',
+ st => 'Students',
+ cc => 'Course Coordinators',
+ in => 'Instructors',
+ ta => 'TAs',
+ ep => 'Exam proctors',
+ ad => 'Administrators',
+ cr => 'Custom roles'
+ );
+ %{$status_types} = (
+ all => 'Roles of any status',
+ Active => 'Only active roles',
+ Expired => 'Only past roles',
+ Future => 'Only future roles',
+ );
}
-
+
sub handler {
my $r = shift;
if ($r->header_only) {
@@ -3411,7 +3382,13 @@ sub handler {
&Apache::loncommon::no_cache($r);
$r->send_http_header;
- $r->print(&Apache::loncommon::start_page('Discussion Post Versions'));
+ # Breadcrumbs
+ my $brcrum = [{'href' => '',
+ 'text' => 'Discussion Post Versions'}];
+
+ $r->print(&Apache::loncommon::start_page('Discussion Post Versions',undef,
+ {'bread_crumbs' => $brcrum,})
+ );
my $crs='/'.$env{'request.course.id'};
if ($env{'request.course.sec'}) {
@@ -3877,11 +3854,7 @@ ENDREDIR
$env{'user.domain'},
'CourseBlog_'.$env{'request.course.id'},
$subject,$message,$feedurl,'public');
- if (&Apache::loncommon::course_type() eq 'Community') {
- $blog=' '.&mt('Added to my community blog').' ';
- } else {
- $blog=' '.&mt('Added to my course blog').' ';
- }
+ $blog=' '.&mt('Added to my course blog').' ';
}
# Receipt screen and redirect back to where came from