';
+ &Apache::lonlocal::locallocaltime($posttime).')';
+ if ($dischash{$toggkey}) {
+ $discussionitems[$idx].='
'.
+ $ctlink.'
';
+ }
+ $discussionitems[$idx].= '
'.$message.'
';
if ($contrib{$idx.':history'}) {
my @postversions = ();
$discussionitems[$idx] .= ' '.&mt('This post has been edited by the author.');
@@ -542,22 +562,31 @@ sub list_discussion {
'cuse' => 'Current discussion settings',
'allposts' => 'All posts',
'unread' => 'New posts only',
+ 'unmark' => 'Unread only',
'ondisp' => 'Once displayed',
- 'onmark' => 'Once marked read',
+ 'onmark' => 'Once marked not NEW',
+ 'toggoff' => 'Off',
+ 'toggon' => 'On',
'disa' => 'Posts to be displayed',
'npce' => 'Posts cease to be marked "NEW"',
+ 'epcb' => 'Each post can be toggled read/unread',
'chgt' => 'Change',
'disp' => 'Display',
'nolo' => 'Not new',
+ 'togg' => 'Toggle read/unread',
);
my $currdisp = $lt{'allposts'};
my $currmark = $lt{'onmark'};
+ my $currtogg = $lt{'toggoff'};
my $dispchange = $lt{'unread'};
my $markchange = $lt{'ondisp'};
+ my $toggchange = $lt{'toggon'};
my $chglink = '/adm/feedback?modifydisp='.$ressymb;
- my $displink = 'onlyunread';
+ my $displinkA = 'onlyunread';
+ my $displinkB = 'onlyunmark';
my $marklink = 'markondisp';
+ my $togglink = 'toggon';
if ($markondisp) {
$currmark = $lt{'ondisp'};
@@ -568,10 +597,24 @@ sub list_discussion {
if ($showonlyunread) {
$currdisp = $lt{'unread'};
$dispchange = $lt{'allposts'};
- $displink = 'allposts';
+ $displinkA = 'allposts';
}
+
+ if ($showunmark) {
+ $currdisp = $lt{'unmark'};
+ $dispchange = $lt{'unmark'};
+ $displinkA='allposts';
+ $displinkB='onlyunread';
+ $showonlyunread = 0;
+ }
+
+ if ($dischash{$toggkey}) {
+ $currtogg = $lt{'toggon'};
+ $toggchange = $lt{'toggoff'};
+ $togglink = 'toggoff';
+ }
- $chglink .= '&changes='.$displink.'_'.$marklink;
+ $chglink .= '&changes='.$displinkA.'_'.$displinkB.'_'.$marklink.'_'.$togglink;
if ($newpostsflag) {
$chglink .= '&previous='.$prevread;
@@ -595,7 +638,7 @@ sub list_discussion {
}
|;
- $discussion.='
';
+ $discussion.='
END
}
}
@@ -1137,7 +1205,7 @@ END
}
sub print_display_options {
- my ($r,$symb,$previous,$dispchg,$markchg,$feedurl) = @_;
+ my ($r,$symb,$previous,$dispchgA,$dispchgB,$markchg,$toggchg,$feedurl) = @_;
# backward compatibility (bulletin boards used to be 'wrapped')
if ($feedurl=~m|^/adm/wrapper/adm/.*/bulletinboard$|) {
$feedurl=~s|^/adm/wrapper||;
@@ -1157,54 +1225,116 @@ sub print_display_options {
'deff' => 'Default for all discussions',
'prca' => 'Preferences can be set for this discussion that determine ....',
'whpo' => 'Which posts are displayed when you display this bulletin board or resource, and',
- 'unwh' => 'Under what circumstances posts are identfied as "New."',
+ 'unwh' => 'Under what circumstances posts are identified as "NEW", and',
+ 'wipa' => 'Whether individual posts can be marked as read/unread',
'allposts' => 'All posts',
'unread' => 'New posts only',
+ 'unmark' => 'Posts not marked read',
'ondisp' => 'Once displayed',
- 'onmark' => 'Once marked as read',
+ 'onmark' => 'Once marked not NEW ',
+ 'toggon' => 'Shown',
+ 'toggoff' => 'Not shown',
'disa' => 'Posts displayed?',
- 'npmr' => 'New posts cease to be identified as "New"?',
+ 'npmr' => 'New posts cease to be identified as "NEW"?',
+ 'dotm' => 'Option to mark each post as read/unread?',
'chgt' => 'Change to ',
'mkdf' => 'Set to ',
- 'yhni' => 'You have not indicated that you wish to change either of the discussion settings',
+ 'yhni' => 'You have not indicated that you wish to change any of the discussion settings',
'ywbr' => 'You will be returned to the previous page if you click OK.'
);
- my $dispchange = $lt{'unread'};
+ my $dispchangeA = $lt{'unread'};
+ my $dispchangeB = $lt{'unmark'};
my $markchange = $lt{'ondisp'};
+ my $toggchange = $lt{'toggon'};
my $currdisp = $lt{'allposts'};
my $currmark = $lt{'onmark'};
my $discdisp = 'allposts';
my $discmark = 'onmark';
+ my $currtogg = $lt{'toggoff'};
+ my $disctogg = 'toggoff';
- if ($dispchg eq 'allposts') {
- $dispchange = $lt{'allposts'};
+ if ($dispchgA eq 'allposts') {
+ $dispchangeA = $lt{'allposts'};
$currdisp = $lt{'unread'};
$discdisp = 'unread';
}
-
+
if ($markchg eq 'markonread') {
$markchange = $lt{'onmark'};
$currmark = $lt{'ondisp'};
$discmark = 'ondisp';
}
+
+ if ($dispchgB eq 'onlyunread') {
+ $dispchangeB = $lt{'unread'};
+ $currdisp = $lt{'unmark'};
+ $discdisp = 'unmark';
+ }
+ if ($toggchg eq 'toggoff') {
+ $toggchange = $lt{'toggoff'};
+ $currtogg = $lt{'toggon'};
+ $disctogg = 'toggon';
+ }
$r->print(<$lt{'dido'}