Commit 192897d5 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Disable public feedback for blogs and blogposts with comments turned off

parent b1e8b783
......@@ -375,6 +375,7 @@ $string['feedbackattachdirname'] = 'assessmentfiles';
$string['feedbackattachdirdesc'] = 'Files attached to view assessments';
$string['feedbackattachmessage'] = 'The attached file has been added to your %s folder';
$string['feedbackmadeprivate'] = 'Feedback changed to private';
$string['feedbackonthisartefactwillbeprivate'] = 'Feedback on this artefact will only be visible to the owner.';
$string['feedbackonviewbytutorofcommunity'] = 'Feedback on %s by %s of %s';
$string['feedbacksubmitted'] = 'Feedback submitted';
$string['makepublic'] = 'Make public';
......
......@@ -41,6 +41,7 @@ if ($artefactid) {
if (!artefact_in_view($artefactid, $viewid)) {
throw new AccessDeniedException("Artefact $artefactid not in View $viewid");
}
$feedbackisprivate = !$artefact->public_feedback_allowed();
$options = array('viewid' => $viewid);
if (in_array(FORMAT_ARTEFACT_RENDERFULL, $artefact->get_render_list())) {
$content = $artefact->render(FORMAT_ARTEFACT_RENDERFULL, $options);
......@@ -88,7 +89,8 @@ if (empty($tutorfilefeedbackformrow)) {
}
$getstring = quotestrings(array('mahara' => array(
'message', 'makepublic', 'placefeedback', 'cancel', 'complaint', 'notifysiteadministrator',
'message', 'makepublic', 'placefeedback', 'cancel', 'complaint',
'feedbackonthisartefactwillbeprivate', 'notifysiteadministrator',
'nopublicfeedback', 'reportobjectionablematerial', 'print',
)));
......@@ -97,6 +99,16 @@ $getstring['addtowatchlist'] = "'" . get_string('addtowatchlist', 'mahara', get_
$getstring['addtowatchlistwithchildren'] = "'" . get_string('addtowatchlistwithchildren', 'mahara', ucfirst(get_string($thing))) . "'";
$getstring['feedbackattachmessage'] = "'(" . get_string('feedbackattachmessage', 'mahara', get_string('feedbackattachdirname')) . ")'";
if (!empty($feedbackisprivate)) {
$makepublic = "TR(null, INPUT({'type':'hidden','name':'public','value':false}), TD({'colspan':2}, "
. $getstring['feedbackonthisartefactwillbeprivate'] . ")),";
}
else {
$makepublic = "TR(null, TH(null, LABEL(null, " . $getstring['makepublic'] . " ), "
. "INPUT({'type':'checkbox', 'class':'checkbox', 'name':'public'}))),";
}
log_debug($makepublic);
$javascript = <<<EOF
var view = {$viewid};
......@@ -136,8 +148,7 @@ function feedbackform() {
TBODY(null,
TR(null, TH(null, LABEL(null, {$getstring['message']}))),
TR(null, TD(null, TEXTAREA({'rows':5, 'cols':80, 'name':'message'}))),
TR(null, TH(null, LABEL(null, {$getstring['makepublic']}),
INPUT({'type':'checkbox', 'class':'checkbox', 'name':'public'}))),
{$makepublic}
{$tutorfilefeedbackformrow}
TR(null, TD(null,
INPUT({'type':'button', 'class':'button',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment