version 1.355, 2012/05/28 19:03:03
|
version 1.369, 2014/02/11 18:04:47
|
Line 468 imscp_v1p1.xsd http://www.imsglobal.org/
|
Line 468 imscp_v1p1.xsd http://www.imsglobal.org/
|
my $numhidden = keys(%notshown); |
my $numhidden = keys(%notshown); |
if ($numhidden > 0) { |
if ($numhidden > 0) { |
my $colspan = $maxdepth+1; |
my $colspan = $maxdepth+1; |
$discussion.="\n".'<tr><td bgcolor="#CCCCCC" colspan="'.$colspan.'">'. |
$discussion.="\n".'<tr><td bgcolor="#CCCCCC" colspan="'.$colspan.'">'; |
'<a href="/adm/feedback?allposts=1&symb='.$escsymb; |
my $href = '/adm/feedback?allposts=1&symb='.$escsymb; |
if ($newpostsflag) { |
if ($newpostsflag) { |
$discussion .= '&previous='.$prevread; |
$href .= '&previous='.$prevread; |
} |
} |
$discussion .= &group_args($group); |
$href .= &group_args($group); |
$discussion .= '">'.&mt('Show all posts').'</a> '.&mt('to display').' '. |
|
$numhidden.' '; |
|
if ($showunmark) { |
if ($showunmark) { |
$discussion .= &mt('posts previously marked read'); |
$discussion .= &mt('[_1]Show all posts[_2] to display [quant,_3,post] previously marked read', |
|
'<a href="'.$href.'">','</a>',$numhidden); |
} else { |
} else { |
$discussion .= &mt('previously viewed posts'); |
$discussion .= &mt('[_1]Show all posts[_2] to display [quant,_3,post] previously viewed', |
|
'<a href="'.$href.'">','</a>',$numhidden); |
} |
} |
$discussion .= '<br/></td></tr>'; |
$discussion .= '<br/></td></tr>'; |
} |
} |
Line 562 imscp_v1p1.xsd http://www.imsglobal.org/
|
Line 562 imscp_v1p1.xsd http://www.imsglobal.org/
|
my $postingfile; |
my $postingfile; |
my $postingfilename = $tempexport.'/'.$postfilename; |
my $postingfilename = $tempexport.'/'.$postfilename; |
if ($postingfile = Apache::File->new('>'.$postingfilename)) { |
if ($postingfile = Apache::File->new('>'.$postingfilename)) { |
print $postingfile '<html><head><title>Discussion Post</title></head><body>'. |
print $postingfile '<html><head><title>'.&mt('Discussion Post').'</title></head><body>'. |
$imsitems{$alldiscussion{$post}}{'title'}.' '. |
$imsitems{$alldiscussion{$post}}{'title'}.' '. |
$imsitems{$alldiscussion{$post}}{'sender'}. |
$imsitems{$alldiscussion{$post}}{'sender'}. |
$imsitems{$alldiscussion{$post}}{'timestamp'}.'<br /><br />'. |
$imsitems{$alldiscussion{$post}}{'timestamp'}.'<br /><br />'. |
Line 702 END
|
Line 702 END
|
open(OUTPUT, "zip -r $imszip * 2> /dev/null |"); |
open(OUTPUT, "zip -r $imszip * 2> /dev/null |"); |
close(OUTPUT); |
close(OUTPUT); |
chdir $cwd; |
chdir $cwd; |
$discussion .= &mt('Download the zip file from [_1]Discussion Posting Archive','<a href="'.$imszipfile.'">').'</a><br />'; |
$discussion .= &mt('Download the zip file from [_1]Discussion Posting Archive[_2]', |
|
'<a href="'.$imszipfile.'">','</a>').'<br />'; |
if ($copyresult) { |
if ($copyresult) { |
$discussion .= &mt('The following errors occurred during export').' - <br />'.$copyresult; |
$discussion .= '<span class="LC_error">'. |
|
&mt('The following errors occurred during export:'). |
|
'</span><br />'.$copyresult; |
} |
} |
} |
} |
} else { |
} else { |
$discussion .= '<br />'.&mt('Unfortunately you will not be able to retrieve an archive of the discussion posts at this time, because there was a problem creating a manifest file.').'<br />'; |
$discussion .= '<p class="LC_error">'. |
|
&mt('Unfortunately you will not be able to retrieve an archive of the discussion posts at this time, because there was a problem creating a manifest file.').'</p>'; |
} |
} |
return $discussion; |
return $discussion; |
} |
} |
Line 1056 sub build_posting_display {
|
Line 1060 sub build_posting_display {
|
&filter_regexp($rolefilter,$sectionpick,$statusfilter); |
&filter_regexp($rolefilter,$sectionpick,$statusfilter); |
$rolematch = $roleregexp.':'.$secregexp.':'.$statusregexp; |
$rolematch = $roleregexp.':'.$secregexp.':'.$statusregexp; |
} |
} |
|
my %votestyle; |
if ($seeid || $canvote) { |
if ($seeid || $canvote) { |
# We need to go through this twice, first to get the likes/dislikes, then to actually build the display |
# We need to go through this twice, first to get the likes/dislikes, then to actually build the display |
for (my $id=1;$id<=$contrib{'version'};$id++) { |
for (my $id=1;$id<=$contrib{'version'};$id++) { |
Line 1063 sub build_posting_display {
|
Line 1068 sub build_posting_display {
|
next if ($contrib{$idx.':deleted'}); |
next if ($contrib{$idx.':deleted'}); |
next if ($contrib{$idx.':hidden'}); |
next if ($contrib{$idx.':hidden'}); |
unless ((($hiddens{$idx}) && (!$seehidden)) || ($deletions{$idx}) || (!$contrib{$idx.':message'})) { |
unless ((($hiddens{$idx}) && (!$seehidden)) || ($deletions{$idx}) || (!$contrib{$idx.':message'})) { |
|
push(@theselikes,$likes{$symb.':'.$idx.':likes'}); |
if ($likes{$symb.':'.$idx.':likes'} ne '') { |
if ($likes{$symb.':'.$idx.':likes'} ne '') { |
push(@theselikes,$likes{$symb.':'.$idx.':likes'}); |
|
if (ref($likes{$symb.':'.$idx.':likers'}) eq 'HASH') { |
if (ref($likes{$symb.':'.$idx.':likers'}) eq 'HASH') { |
if (exists($likes{$symb.':'.$idx.':likers'}{$thisuser})) { |
if (exists($likes{$symb.':'.$idx.':likers'}{$thisuser})) { |
$userlikes{$idx} = 1; |
$userlikes{$idx} = 1; |
Line 1101 sub build_posting_display {
|
Line 1106 sub build_posting_display {
|
$twoplus=$ave+2.*$stddev; |
$twoplus=$ave+2.*$stddev; |
$oneminus=$ave-$stddev; |
$oneminus=$ave-$stddev; |
$twominus=$ave-2.*$stddev; |
$twominus=$ave-2.*$stddev; |
|
if ($#theselikes>1) { |
|
foreach my $class ('twoplus','oneplus','zero','oneminus','twominus') { |
|
my $fontstyle = $env{'course.'.$env{'request.course.id'}.'.discussion_post_fonts_'.$class}; |
|
if ($fontstyle ne '') { |
|
my ($size,$weight,$style,$other) = split(/,/,$fontstyle); |
|
if ($size ne '') { |
|
$votestyle{$class} .= 'font-size: '.$size.';'; |
|
} |
|
if ($weight ne '') { |
|
$votestyle{$class} .= 'font-weight: '.$weight.';'; |
|
} |
|
if ($style ne '') { |
|
$votestyle{$class} .= 'font-style: '.$style.';'; |
|
} |
|
if ($other ne '') { |
|
$votestyle{$class} .= $other; |
|
} |
|
if ($votestyle{$class} ne '') { |
|
$votestyle{$class} = 'style="'.$votestyle{$class}.'"'; |
|
} |
|
} |
|
} |
|
} |
} |
} |
# |
# |
# This is now the real loop. Go through all entries, pick up what we need |
# This is now the real loop. Go through all entries, pick up what we need |
Line 1436 sub build_posting_display {
|
Line 1464 sub build_posting_display {
|
$$discussionitems[$idx].=' '.$ctlink; |
$$discussionitems[$idx].=' '.$ctlink; |
} |
} |
my $thislikes=$likes{$symb.':'.$idx.':likes'}; |
my $thislikes=$likes{$symb.':'.$idx.':likes'}; |
my $likesize="100"; |
my $likestyle; |
if ($seeid || $canvote) { |
if ($seeid || $canvote) { |
# Figure out size based on likes |
# Figure out size based on likes |
|
my $class = 'zero'; |
my $thislikes=$likes{$symb.':'.$idx.':likes'}; |
my $thislikes=$likes{$symb.':'.$idx.':likes'}; |
if ($thislikes>$twoplus) { |
if ($thislikes>$twoplus) { |
$likesize="200"; |
$class = 'twoplus'; |
} elsif ($thislikes>$oneplus) { |
} elsif ($thislikes>$oneplus) { |
$likesize="150"; |
$class = 'oneplus'; |
} |
} |
if ($thislikes<$twominus) { |
if ($thislikes<$twominus) { |
$likesize="50"; |
$class = 'twominus'; |
} elsif ($thislikes<$oneminus) { |
} elsif ($thislikes<$oneminus) { |
$likesize="75"; |
$class = 'oneminus'; |
} |
} |
|
$likestyle = $votestyle{$class}; |
} |
} |
# Actually glue in the message itself |
# Actually glue in the message itself |
$$discussionitems[$idx].= '<br /><blockquote>'. |
$$discussionitems[$idx].= '<br /><blockquote>'. |
"<div style='font-size:$likesize%'>". |
"<div $likestyle>". |
$message. |
$message. |
'</div></blockquote>'; |
'</div></blockquote>'; |
if ($canvote) { |
if ($canvote) { |
Line 1926 END
|
Line 1956 END
|
|
|
my %onload = ('onload' => 'window.focus();setposttype();'); |
my %onload = ('onload' => 'window.focus();setposttype();'); |
my %parms=('add_entries' => \%onload); |
my %parms=('add_entries' => \%onload); |
if ($env{'form.modal'} ne 'yes') { 'bread_crumbs' => $brcrum } |
if ($env{'form.modal'} ne 'yes') { $parms{'bread_crumbs'} = $brcrum; } |
my $start_page= |
my $start_page= |
&Apache::loncommon::start_page('Resource Feedback and Discussion',$js,\%parms); |
&Apache::loncommon::start_page('Resource Feedback and Discussion',$js,\%parms); |
|
|
Line 1967 END
|
Line 1997 END
|
} |
} |
$r->print(<<END); |
$r->print(<<END); |
$options |
$options |
<br> |
<br /> |
END |
END |
$r->print(&Apache::lonhtmlcommon::start_pick_box()); |
$r->print(&Apache::lonhtmlcommon::start_pick_box()); |
$r->print(<<END); |
$r->print(<<END); |
Line 1987 END
|
Line 2017 END
|
$subject.'" /></p>'); |
$subject.'" /></p>'); |
$r->print(&Apache::lonhtmlcommon::row_closure()); |
$r->print(&Apache::lonhtmlcommon::row_closure()); |
$r->print(&Apache::lonhtmlcommon::row_title(&mt('Message'))); |
$r->print(&Apache::lonhtmlcommon::row_title(&mt('Message'))); |
$r->print('<textarea name="comment" id="comment" cols="60" rows="10" '. |
$r->print('<textarea name="comment" id="comment" cols="55" rows="10" '. |
$textareaclass.'>'.$comment. |
$textareaclass.'>'.$comment. |
'</textarea>'); |
'</textarea>'); |
$r->print(&Apache::lonhtmlcommon::row_closure(1)); |
$r->print(&Apache::lonhtmlcommon::row_closure(1)); |
Line 2556 sub print_showposters {
|
Line 2586 sub print_showposters {
|
my $table_start =&Apache::loncommon::start_data_table(); |
my $table_start =&Apache::loncommon::start_data_table(); |
$r->print(<<END); |
$r->print(<<END); |
$start_page |
$start_page |
<form name="pickpostersform" method="post"> |
<form name="pickpostersform" method="post" action=""> |
<br /> |
<br /> |
$table_start |
$table_start |
<tr> |
<tr> |
Line 2672 sub fail_redirect {
|
Line 2702 sub fail_redirect {
|
'only_body' => 1,})); |
'only_body' => 1,})); |
$r->print(<<ENDFAILREDIR); |
$r->print(<<ENDFAILREDIR); |
<img align="right" src="$logo" /> |
<img align="right" src="$logo" /> |
<b>$lt{'sorr'}</b> |
<p class="LC_warning">$lt{'sorr'}</p> |
ENDFAILREDIR |
ENDFAILREDIR |
$r->print(&Apache::loncommon::end_page()); |
$r->print(&Apache::loncommon::end_page()); |
} |
} |
Line 3464 END
|
Line 3494 END
|
my $brcrum = [{'href' => '', |
my $brcrum = [{'href' => '', |
'text' => 'Discussion Post Attachments'}]; |
'text' => 'Discussion Post Attachments'}]; |
my %parms=('only_body' => 1); |
my %parms=('only_body' => 1); |
if ($env{'form.modal'} ne 'yes') { 'bread_crumbs' => $brcrum } |
if ($env{'form.modal'} ne 'yes') { $parms{'bread_crumbs'} = $brcrum; } |
|
|
my $start_page = |
my $start_page = |
&Apache::loncommon::start_page('Discussion Post Attachments',$js,\%parms); |
&Apache::loncommon::start_page('Discussion Post Attachments',$js,\%parms); |
Line 3882 sub handler {
|
Line 3912 sub handler {
|
'text' => 'Discussion Post Versions'}]; |
'text' => 'Discussion Post Versions'}]; |
|
|
my %parms=(); |
my %parms=(); |
if ($env{'form.modal'} ne 'yes') { 'bread_crumbs' => $brcrum } |
if ($env{'form.modal'} ne 'yes') { $parms{'bread_crumbs'} = $brcrum; } |
|
|
$r->print(&Apache::loncommon::start_page('Discussion Post Versions',undef,\%parms)); |
$r->print(&Apache::loncommon::start_page('Discussion Post Versions',undef,\%parms)); |
|
|
Line 3955 sub handler {
|
Line 3985 sub handler {
|
my $feedurl = '/adm/navmaps'; |
my $feedurl = '/adm/navmaps'; |
if ($env{'form.navurl'}) { $feedurl .= '?'.$env{'form.navurl'}; } |
if ($env{'form.navurl'}) { $feedurl .= '?'.$env{'form.navurl'}; } |
my %lt = &Apache::lonlocal::texthash( |
my %lt = &Apache::lonlocal::texthash( |
'mnpa' => 'Marked "New" posts as read in a total of', |
|
'robb' => 'resources/bulletin boards.', |
|
'twnp' => 'There are currently no resources or discussion boards with unread discussion postings.' |
'twnp' => 'There are currently no resources or discussion boards with unread discussion postings.' |
); |
); |
foreach my $res (@resources) { |
foreach my $res (@resources) { |
Line 3965 sub handler {
|
Line 3993 sub handler {
|
my $lastkey = $ressymb.'_lastread'; |
my $lastkey = $ressymb.'_lastread'; |
$discinfo{$lastkey} = $env{'form.navtime'}; |
$discinfo{$lastkey} = $env{'form.navtime'}; |
} |
} |
my $textline = "<b>$lt{'mnpa'} $numitems $lt{'robb'}</b>"; |
my $textline = '<b>'. |
|
&mt('Marked "New" posts as read in a total of [_1] resources/discussion boards.', |
|
$numitems). |
|
'</b>'; |
if ($numitems > 0) { |
if ($numitems > 0) { |
&Apache::lonnet::put('nohist_'.$env{'request.course.id'}.'_discuss', |
&Apache::lonnet::put('nohist_'.$env{'request.course.id'}.'_discuss', |
\%discinfo,$env{'user.domain'},$env{'user.name'}); |
\%discinfo,$env{'user.domain'},$env{'user.name'}); |
Line 4396 ENDREDIR
|
Line 4427 ENDREDIR
|
$cdom,$cnum); |
$cdom,$cnum); |
$contrib{'deleted'} =~ s/^\.//; |
$contrib{'deleted'} =~ s/^\.//; |
$contrib{'deleted'} =~ s/\.$//; |
$contrib{'deleted'} =~ s/\.$//; |
|
my $confirm_msg; |
if ($contrib{'deleted'} ne '') { |
if ($contrib{'deleted'} ne '') { |
if (&Apache::lonnet::store({'deleted' => ''},$symb,$env{'request.course.id'}, |
if (&Apache::lonnet::store({'deleted' => ''},$symb,$env{'request.course.id'}, |
$cdom,$cnum) eq 'ok') { |
$cdom,$cnum) eq 'ok') { |
Line 4423 ENDREDIR
|
Line 4455 ENDREDIR
|
$uname,$udom,$env{'request.course.id'}, |
$uname,$udom,$env{'request.course.id'}, |
'undelete'); |
'undelete'); |
} |
} |
$r->print(&Apache::lonhtmlcommon::confirm_success(&mt("Undeleted all entries"))); |
$confirm_msg = &Apache::lonhtmlcommon::confirm_success(&mt("Undeleted all entries")); |
} else { |
} else { |
$r->print(&Apache::lonhtmlcommon::confirm_success(&mt("Failed to undelete entries"),1)); |
$confirm_msg = &Apache::lonhtmlcommon::confirm_success(&mt("Failed to undelete entries"),1); |
} |
} |
} else { |
} else { |
$r->print(&Apache::lonhtmlcommon::confirm_success(&mt("No entries to undelete"),1)); |
$confirm_msg = &Apache::lonhtmlcommon::confirm_success(&mt("No entries to undelete"),1); |
} |
} |
$r->print("<br /><a href='$feedurl'>".&mt("Return and reload")."</a>"); |
$r->print( |
|
'<br />' |
|
.&Apache::loncommon::confirmwrapper($confirm_msg) |
|
.&Apache::lonhtmlcommon::actionbox( |
|
["<a href='$feedurl'>".&mt("Return and reload")."</a>"]) |
|
); |
} |
} |
$r->print(&Apache::loncommon::end_page()); |
$r->print(&Apache::loncommon::end_page()); |
return OK; |
return OK; |