Commit 2f51a462 authored by Nigel McNie's avatar Nigel McNie
Browse files

Fix a problem I introduced while improving the appearance of feedback on...

Fix a problem I introduced while improving the appearance of feedback on views, where marking feedback private was broken.

All the language strings are now done by $getstring rather than getting strings on the javascript side, and marking feedback private now displays the correct message after the update has been done.
parent 8ef3cc5d
......@@ -102,7 +102,8 @@ $getstring = quotestrings(array(
'view' => array('makepublic', 'placefeedback', 'complaint',
'feedbackonthisartefactwillbeprivate', 'notifysiteadministrator',
'nopublicfeedback', 'reportobjectionablematerial', 'print',
'thisfeedbackispublic', 'thisfeedbackisprivate', 'attachment')
'thisfeedbackispublic', 'thisfeedbackisprivate', 'attachment',
'makeprivate')
));
$getstring['feedbackattachmessage'] = "'(" . get_string('feedbackattachmessage', 'view', get_string('feedbackattachdirname', 'view')) . ")'";
......@@ -266,22 +267,22 @@ feedbacklist.rowfunction = function(r, n, d) {
if (r.ispublic == 1) {
var makePrivate = null;
if (r.ownedbythisuser) {
makePrivate = A({'href': ''}, get_string('makeprivate'));
connect(makePrivate, 'onclick', function (e) {
makePrivateLink = A({'href': ''}, {$getstring['makeprivate']});
connect(makePrivateLink, 'onclick', function (e) {
sendjsonrequest(
'changefeedback.json.php',
r,
'POST',
function (data) {
if (!data.error) {
replaceChildNodes(makePrivate.parentNode, '(' + {$getstring['private']} + ')');
replaceChildNodes(makePrivateLink.parentNode, {$getstring['thisfeedbackisprivate']});
}
}
);
e.stop();
});
makePrivate = [' - ', makePrivate];
makePrivate = [' - ', makePrivateLink];
}
publicPrivate = SPAN(null, {$getstring['thisfeedbackispublic']}, makePrivate);
}
......@@ -307,13 +308,7 @@ EOF;
$smarty = smarty(
array('tablerenderer'),
array('<link rel="stylesheet" type="text/css" href="' . get_config('wwwroot') . 'theme/views.css">'),
array(
'view' => array(
'public',
'private',
'makeprivate',
),
),
array(),
array(
'stylesheets' => array('style/views.css')
)
......
......@@ -71,7 +71,8 @@ $getstring = quotestrings(array(
'view' => array('makepublic', 'placefeedback', 'complaint',
'feedbackonthisartefactwillbeprivate', 'notifysiteadministrator',
'nopublicfeedback', 'reportobjectionablematerial', 'print',
'thisfeedbackispublic', 'thisfeedbackisprivate', 'attachment')
'thisfeedbackispublic', 'thisfeedbackisprivate', 'attachment',
'makeprivate')
));
$getstring['addtowatchlist'] = json_encode(get_string('addtowatchlist', 'view'));
......@@ -212,22 +213,22 @@ feedbacklist.rowfunction = function(r, n, d) {
if (r.ispublic == 1) {
var makePrivate = null;
if (r.ownedbythisuser) {
makePrivate = A({'href': ''}, get_string('makeprivate'));
connect(makePrivate, 'onclick', function (e) {
makePrivateLink = A({'href': ''}, {$getstring['makeprivate']});
connect(makePrivateLink, 'onclick', function (e) {
sendjsonrequest(
'changefeedback.json.php',
r,
'POST',
function (data) {
if (!data.error) {
replaceChildNodes(makePrivate.parentNode, '(' + {$getstring['private']} + ')');
replaceChildNodes(makePrivateLink.parentNode, {$getstring['thisfeedbackisprivate']});
}
}
);
e.stop();
});
makePrivate = [' - ', makePrivate];
makePrivate = [' - ', makePrivateLink];
}
publicPrivate = SPAN(null, {$getstring['thisfeedbackispublic']}, makePrivate);
}
......@@ -256,13 +257,7 @@ EOF;
$smarty = smarty(
array('tablerenderer'),
array('<link rel="stylesheet" type="text/css" href="' . get_config('wwwroot') . 'theme/views.css">'),
array(
'view' => array(
'public',
'private',
'makeprivate',
),
),
array(),
array(
'stylesheets' => array('style/views.css'),
)
......
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