nieuws: apply tag changes to article links in edit mode
[minimedit.git] / nieuws / index.php
index 73973574629bce60a06b8eb8a640cf37a39d43ad..ad85011716c9825248995d28d4573d12ac67a5c8 100644 (file)
@@ -4,6 +4,10 @@ include 'nieuws.inc.php';
 $replyform = $Page == 'melding' && !empty($User);
 @list ($year, $page) = explode('/', trim($Args, '/'));
 
+if (!empty($User['admin'])) {
+       print '<script src="/nieuws/edit.js"></script>'."\n";
+}
+
 if ($page and !is_numeric($page)) {
        $edit = !empty($User['admin']) ? htmlspecialchars(@$_GET['edit']) : NULL;
        $article = new ArchiveArticle("$Page$Args.html");
@@ -20,14 +24,14 @@ if ($page and !is_numeric($page)) {
                        $tagtarget = is_writable($tagpath);
                        $taglist[] = sprintf(
                                '<input type="checkbox" name="%s" value="%s" id="%s"%s%s />' .
-                               '<label for="%2$s"> %s</label>',
+                               '<label for="%3$s"> %s</label>',
                                "tags[$tagname]", $tagname, "tag-$tagname",
                                $tagvalue ? ' checked' : '',
-                               ' onclick="return false"',
+                               ' disabled',
                                ucfirst($tagname)
                        );
                }
-               printf("<p><strong>Tags:</strong> %s</p>\n",
+               printf('<p class="tags"><strong>Tags:</strong> %s</p>'."\n",
                        implode("\n\t", $taglist)
                );
        }
@@ -62,7 +66,3 @@ if ($year) {
        print placeholder_include('nieuws', [$match]);
        return 1;
 }
-
-if (!empty($User['admin'])) {
-       print '<script src="/nieuws/edit.js"></script>'."\n";
-}