page: api attribute indicate index requests
[minimedit.git] / issue / index.php
index 41d37491378b22eac9d670ab7dbb8cf4dfb355f6..87b22a39d876ac8774a1a1a512e52e025e9176b0 100644 (file)
@@ -11,10 +11,11 @@ if ($id and ctype_digit($id)) {
        )->fetch();
        if (!$Issue) throw new Exception('Issuenummer niet gevonden');
 
-       $replies = placeholder_include('reply');  # handle updates
+       $replies = $Page->widget('reply');  # handle updates
 
        $Page->title .= ': '.htmlspecialchars($Issue->subject);
        $Page->teaser = $Issue->body;
+       if ($Page->api) return;
        $Page->body = $replies;  # find image
 
        print "<h2>{$Page->title}</h2>\n";
@@ -54,6 +55,7 @@ if ($_POST) {
                }
                $_POST = [];
 }
+if ($Page->api) return;
 
 $subsql = "SELECT count(*) FROM comments WHERE page=i.page||'/'||i.id";
 $cols = "*, ($subsql AND message IS NOT NULL) AS replycount";
@@ -97,4 +99,4 @@ while ($row = $query->fetch()) {
        print "</a></div></li>\n";
 }
 print "</ul>\n";
-$Place['issuelist'] = ob_get_clean();
+$Page->place['issuelist'] = ob_get_clean();