+ $Page->place[1] = '';
+ }
+ print preg_replace('{(?<=<h2>)(.*?)(?=</h2>)}', ($edit ?: '\1').' [[1]]', $Page->raw);
+ if ($User->admin("edit {$Page->link}")) {
+ $taglist = [];
+ foreach (glob("{$Page->handler}/.tags/*") as $tagpath) {
+ $tagname = pathinfo($tagpath, PATHINFO_BASENAME);
+ $tagvalue = file_exists("$tagpath/$year-$page.html");
+ $tagtarget = is_writable($tagpath);
+ $taglist[] = sprintf(
+ '<input type="checkbox" name="%s" value="%s" id="%s"%s%s />' .
+ '<label for="%3$s"> %s</label>',
+ "tags[$tagname]", $tagname, "tag-$tagname",
+ $tagvalue ? ' checked' : '',
+ ' disabled',
+ ucfirst($tagname)
+ );
+ }
+ if ($taglist) {
+ printf('<p class="tags"><strong>Tags:</strong> %s</p>'."\n",
+ implode("\n\t", $taglist)
+ );
+ }
+ }
+ if ($replyform) {
+ print $Page->widget('reply');