version 1.232, 2006/12/08 20:09:29
|
version 1.235, 2006/12/11 04:10:35
|
Line 90 sub list_discussion {
|
Line 90 sub list_discussion {
|
} |
} |
if (not &discussion_visible($status)) { |
if (not &discussion_visible($status)) { |
if ($mode ne 'board') { |
if ($mode ne 'board') { |
my $encsymb=&Apache::lonenc::check_encrypt($ressymb); |
&Apache::lonenc::check_encrypt(\$ressymb); |
return &send_message_link($encsymb); |
return &send_message_link($ressymb); |
} |
} |
} |
} |
if ($group ne '' && $mode eq 'board') { |
if ($group ne '' && $mode eq 'board') { |
Line 100 sub list_discussion {
|
Line 100 sub list_discussion {
|
} |
} |
} |
} |
|
|
my ($blocked,$blocktext) = &blocking_posts('boards',1); |
my ($blocked,$blocktext) = |
|
&Apache::loncommon::blocking_status('boards'); |
if ($blocked) { |
if ($blocked) { |
|
&Apache::lonenc::check_encrypt(\$ressymb); |
if ($mode ne 'board') { |
if ($mode ne 'board') { |
my $encsymb=&Apache::lonenc::check_encrypt($ressymb); |
$blocktext.='<br />'.&send_message_link($ressymb); |
return $blocktext.'<br />'.&send_message_link($encsymb); |
|
} |
} |
|
return $blocktext; |
} |
} |
|
|
my @bgcols = ("#cccccc","#eeeeee"); |
my @bgcols = ("#cccccc","#eeeeee"); |
Line 822 sub action_links_bar {
|
Line 824 sub action_links_bar {
|
return $discussion; |
return $discussion; |
} |
} |
|
|
sub blocking_posts { |
|
my ($type,$showstatus) = @_; |
|
my %setters; |
|
my ($blocked,$output); |
|
my ($startblock,$endblock) = |
|
&Apache::loncommon::blockcheck(\%setters,$type); |
|
if ($startblock && $endblock) { |
|
$blocked = 1; |
|
if ($showstatus) { |
|
my $showstart = &Apache::lonlocal::locallocaltime($startblock); |
|
my $showend = &Apache::lonlocal::locallocaltime($endblock); |
|
$output = &mt('Discussion postings will not be viewable for resources in this course between [_1] and [_2] because communication is being blocked.',$showstart, $showend).'<br />'. |
|
&Apache::loncommon::build_block_table($startblock,$endblock, |
|
\%setters); |
|
} |
|
} |
|
return ($blocked,$output); |
|
} |
|
|
|
sub postingform_display { |
sub postingform_display { |
my ($mode,$ressymb,$now,$subject,$comment,$outputtarget,$attachnum, |
my ($mode,$ressymb,$now,$subject,$comment,$outputtarget,$attachnum, |
$currnewattach,$currdelold,$group) = @_; |
$currnewattach,$currdelold,$group) = @_; |
Line 877 ENDDISCUSS
|
Line 860 ENDDISCUSS
|
if ($group ne '') { |
if ($group ne '') { |
$postingform .='<input type="hidden" name="group" value="'.$group.'" />'; |
$postingform .='<input type="hidden" name="group" value="'.$group.'" />'; |
} |
} |
my ($blockblog) = &blocking_posts('blogs'); |
my $blockblog = &Apache::loncommon::blocking_status('blogs'); |
if (!$blockblog) { |
if (!$blockblog) { |
$postingform .= &add_blog_checkbox(); |
$postingform .= &add_blog_checkbox(); |
} |
} |
Line 1755 END
|
Line 1738 END
|
if ($env{'form.editdisc'} || $env{'form.replydisc'}) { |
if ($env{'form.editdisc'} || $env{'form.replydisc'}) { |
my $now = time; |
my $now = time; |
my $ressymb = $symb; |
my $ressymb = $symb; |
|
&Apache::lonenc::check_encrypt(\$ressymb); |
my $postidx = ''; |
my $postidx = ''; |
if ($env{'form.editdisc'}) { |
if ($env{'form.editdisc'}) { |
$postidx = $idx; |
$postidx = $idx; |
Line 1762 END
|
Line 1746 END
|
if (@currnewattach > 0) { |
if (@currnewattach > 0) { |
$attachnum += @currnewattach; |
$attachnum += @currnewattach; |
} |
} |
my ($blockblog) = &blocking_posts('blogs'); |
my $blockblog = &Apache::loncommon::blocking_status('blogs'); |
$r->print(&generate_attachments_button($postidx,$attachnum,$ressymb,$now,\@currnewattach,\@currdelold,$numoldver,'',$blockblog)); |
$r->print(&generate_attachments_button($postidx,$attachnum,$ressymb,$now,\@currnewattach,\@currdelold,$numoldver,'',$blockblog)); |
if ($attachnum > 0) { |
if ($attachnum > 0) { |
if (@currnewattach > 0) { |
if (@currnewattach > 0) { |
Line 2498 sub redirect_back {
|
Line 2482 sub redirect_back {
|
$feedurl .= '?group='.$group.$refarg; |
$feedurl .= '?group='.$group.$refarg; |
} |
} |
} |
} |
$feedurl=&Apache::lonenc::check_encrypt($feedurl); |
&Apache::lonenc::check_encrypt(\$feedurl); |
my $logo=&Apache::loncommon::lonhttpdurl('/adm/lonIcons/lonlogos.gif'); |
my $logo=&Apache::loncommon::lonhttpdurl('/adm/lonIcons/lonlogos.gif'); |
my %onload; |
my %onload; |
if ($env{'environment.remote'} ne 'off') { |
if ($env{'environment.remote'} ne 'off') { |
Line 2555 sub no_redirect_back {
|
Line 2539 sub no_redirect_back {
|
|
|
my $end_page = &Apache::loncommon::end_page(); |
my $end_page = &Apache::loncommon::end_page(); |
|
|
$feedurl=&Apache::lonenc::check_encrypt($feedurl); |
&Apache::lonenc::check_encrypt(\$feedurl); |
my $logo=&Apache::loncommon::lonhttpdurl('/adm/lonIcons/lonlogos.gif'); |
my $logo=&Apache::loncommon::lonhttpdurl('/adm/lonIcons/lonlogos.gif'); |
$r->print (<<ENDNOREDIRTWO); |
$r->print (<<ENDNOREDIRTWO); |
$start_page |
$start_page |
Line 2599 sub screen_header {
|
Line 2583 sub screen_header {
|
&Apache::lonnet::allowed('pch', |
&Apache::lonnet::allowed('pch', |
$env{'request.course.id'}. |
$env{'request.course.id'}. |
($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:''))) { |
($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:''))) { |
my ($blocked) = &blocking_posts('boards'); |
$discussoptions='<label><input type="radio" name="discuss" value="nonanon" checked="checked" /> '. |
if (!$blocked) { |
&mt('Contribution to course discussion of resource'); |
$discussoptions='<label><input type="radio" name="discuss" value="nonanon" checked="checked" /> '. |
|
&mt('Contribution to course discussion of resource'); |
|
$discussoptions.='</label><br /><label><input type="radio" name="discuss" value="anon" /> '. |
$discussoptions.='</label><br /><label><input type="radio" name="discuss" value="anon" /> '. |
&mt('Anonymous contribution to course discussion of resource'). |
&mt('Anonymous contribution to course discussion of resource'). |
' <i>('.&mt('name only visible to course faculty').')</i></label> '. |
' <i>('.&mt('name only visible to course faculty').')</i></label> '. |
'<a href="/adm/preferences?action=changescreenname">'.&mt('Change Screenname').'</a>'; |
'<a href="/adm/preferences?action=changescreenname">'.&mt('Change Screenname').'</a>'; |
} |
|
} |
} |
my ($blockblog) = &blocking_posts('blogs'); |
my $blockblog = &Apache::loncommon::blocking_status('blogs'); |
if (!$blockblog) { |
if (!$blockblog) { |
$discussoptions.= &add_blog_checkbox(); |
$discussoptions.= &add_blog_checkbox(); |
} |
} |
Line 3782 ENDREDIR
|
Line 3763 ENDREDIR
|
&Apache::loncommon::content_type($r,'text/html'); |
&Apache::loncommon::content_type($r,'text/html'); |
$r->send_http_header; |
$r->send_http_header; |
# Unable to give feedback |
# Unable to give feedback |
|
&Apache::lonenc::check_encrypt(\$feedurl); |
&no_redirect_back($r,$feedurl); |
&no_redirect_back($r,$feedurl); |
return OK; |
return OK; |
} |
} |
# --------------------------------------------------- Print login screen header |
# --------------------------------------------------- Print login screen header |
unless ($env{'form.sendit'}) { |
unless ($env{'form.sendit'}) { |
|
&Apache::lonenc::check_encrypt(\$feedurl); |
&Apache::loncommon::content_type($r,'text/html'); |
&Apache::loncommon::content_type($r,'text/html'); |
$r->send_http_header; |
$r->send_http_header; |
|
if (($env{'form.replydisc'}) || ($env{'form.editdisc'})) { |
|
my ($blocked,$blocktext) = |
|
&Apache::loncommon::blocking_status('boards'); |
|
if ($blocked) { |
|
$r->print(&blocked_reply_or_edit($blocktext)); |
|
return OK; |
|
} |
|
} |
my $options=&screen_header($feedurl,$symb); |
my $options=&screen_header($feedurl,$symb); |
if ($options) { |
if ($options) { |
&mail_screen($r,$feedurl,$options); |
&mail_screen($r,$feedurl,$options); |
Line 3880 ENDREDIR
|
Line 3871 ENDREDIR
|
&redirect_back($r,$feedurl,$typestyle,$numsent,$numpost,$blog,$status,$env{'form.previous'},undef,undef,undef,undef,undef,undef,$group); |
&redirect_back($r,$feedurl,$typestyle,$numsent,$numpost,$blog,$status,$env{'form.previous'},undef,undef,undef,undef,undef,undef,$group); |
} |
} |
return OK; |
return OK; |
|
} |
|
|
|
sub blocked_reply_or_edit { |
|
my ($blocktext) = @_; |
|
return |
|
&Apache::loncommon::start_page('Resource Feedback and Discussion'). |
|
$blocktext.'<br /><br /><a href="javascript:history.go(-1)">'. |
|
&mt('Back to previous page'). |
|
&Apache::loncommon::end_page(); |
} |
} |
|
|
sub wrap_symb { |
sub wrap_symb { |