For use in the new RPC interface to edit comments, the form shouldn't
always print a header. Make this conditional.

Signed-off-by: Marcel Korpel <[email protected]>
---
Change since v1:
* Include the <form> element in the markup when using the RPC
  interface. This is necessary to use normal form submission to save
  an edited comment.

 web/template/pkg_comment_form.php | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/web/template/pkg_comment_form.php 
b/web/template/pkg_comment_form.php
index 16a92b1..24eb908 100644
--- a/web/template/pkg_comment_form.php
+++ b/web/template/pkg_comment_form.php
@@ -1,5 +1,8 @@
+<?php /* $no_header will be set when called from aurjson.class.php */
+if (!isset($no_header)): ?>
 <div id="generic-form" class="box">
        <h2><?= (isset($comment_id)) ? __('Edit comment for: %s', 
htmlspecialchars($pkgbase_name)) : __("Add Comment"); ?></h2>
+<?php endif; ?>
        <form action="<?= get_pkgbase_uri($pkgbase_name) ?>" method="post">
                <fieldset>
 <?php
@@ -23,5 +26,7 @@ if (isset($_REQUEST['comment']) && check_token()) {
                        </p>
                </fieldset>
        </form>
+<?php if (isset($no_header)): ?>
 </div>
+<?php endif;
 
-- 
2.4.6

Reply via email to