git.shiar.nl
/
minimedit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
issue: message editing feature
[minimedit.git]
/
widget
/
reply.php
diff --git
a/widget/reply.php
b/widget/reply.php
index 010b1de4dcb90e9e1c0179a7e9da608797917b0e..f9248512105bda05860bf691d212bbf7d1e0e3b3 100644
(file)
--- a/
widget/reply.php
+++ b/
widget/reply.php
@@
-6,7
+6,7
@@
require_once 'upload.inc.php';
if ($_POST) {
try {
$newcomment = createcomment($_POST, $Issue);
if ($_POST) {
try {
$newcomment = createcomment($_POST, $Issue);
- $target = "/{$Page->link}
/
$newcomment#$newcomment";
+ $target = "/{$Page->link}
?last=
$newcomment#$newcomment";
abort($target, ($Page->api ? 200 : 303) . ' reply success');
$_POST['reply'] = NULL;
}
abort($target, ($Page->api ? 200 : 303) . ' reply success');
$_POST['reply'] = NULL;
}
@@
-14,11
+14,13
@@
if ($_POST) {
if ($Page->api) {
abort(ucfirst($e->getMessage()), '500 reply error');
}
if ($Page->api) {
abort(ucfirst($e->getMessage()), '500 reply error');
}
- print "<p class=warn>Antwoord niet opgeslagen: {$e->getMessage()}.</p>\n\n";
+ printf("<p class=warn>Antwoord niet opgeslagen: %s.</p>\n\n",
+ nl2br(htmlspecialchars($e->getMessage()))
+ );
}
}
}
}
-$cols =
'*, (SELECT json_agg(journal.*) FROM journal WHERE comment_id = comments.id) AS journal'
;
+$cols =
"*, (SELECT json_agg(journal.*) FROM journal WHERE comment_id = comments.id AND property = 'attr') AS journal"
;
$query = $Db->query("SELECT $cols FROM comments WHERE page = ? ORDER BY created", [$Page->link]);
if ($row = $query->fetch()) {
$query = $Db->query("SELECT $cols FROM comments WHERE page = ? ORDER BY created", [$Page->link]);
if ($row = $query->fetch()) {
@@
-69,6
+71,17
@@
if ($User->login) {
print '<li>';
print '<form method="post" action="" enctype="multipart/form-data">';
if (isset($Issue) and $User->admin("edit {$Page->link}")) {
print '<li>';
print '<form method="post" action="" enctype="multipart/form-data">';
if (isset($Issue) and $User->admin("edit {$Page->link}")) {
+ print "<aside>\n";
+ print '<p>';
+ printf(
+ '<label for="%s">%s:</label> '
+ . '<input id="%1$s" name="%1$s" value="%s" />'."\n",
+ 'subject',
+ $journalcol['subject'],
+ htmlspecialchars($Issue->subject ?? '')
+ );
+ print "</p>\n";
+
print '<p>';
printf(
'<label for="%s">%s:</label> '
print '<p>';
printf(
'<label for="%s">%s:</label> '
@@
-87,6
+100,7
@@
if ($User->login) {
'Gesloten'
);
print "</p>\n";
'Gesloten'
);
print "</p>\n";
+ print "</aside>\n";
}
{
print '<p>';
}
{
print '<p>';