<?php
// PukiWiki - Yet another WikiWikiWeb clone
-// $Id: pcomment.inc.php,v 1.36 2005/01/23 07:01:56 henoheno Exp $
+// $Id: pcomment.inc.php,v 1.37 2005/01/30 00:51:51 henoheno Exp $
//
// pcomment plugin - Insetring comment into specified (another) page
list($comments, $digest) = pcmt_get_comments($_page, $count, $dir, $params['reply']);
if (PKWK_READONLY) {
- $form = '';
+ $form_start = $form = $form_end = '';
} else {
// ¥Õ¥©¡¼¥à¤òɽ¼¨
if ($params['noname']) {
$s_nodate = htmlspecialchars($params['nodate']);
$s_count = htmlspecialchars($count);
+ $form_start = '<form action="' . $script . '" method="post">' . "\n";
$form = <<<EOD
-<form action="$script" method="post">
<div>
<input type="hidden" name="digest" value="$digest" />
<input type="hidden" name="plugin" value="pcomment" />
$radio $title $name $comment
<input type="submit" value="{$_pcmt_messages['btn_comment']}" />
</div>
-</form>
EOD;
+ $form_end = '</form>' . "\n";
}
if (! is_page($_page)) {
$recent = ! empty($count) ? sprintf($_pcmt_messages['msg_recent'], $count) : '';
}
- return $dir ?
- '<div><p>' . $recent . ' ' . $link . '</p>' . "\n" . $comments . "\n" . $form . '</div>' . "\n" :
- '<div>' . $form . $comments. "\n" . '<p>' . $recent . ' ' . $link . '</p>' . "\n" . '</div>' . "\n";
+ if ($dir) {
+ return '<div>' .
+ '<p>' . $recent . ' ' . $link . '</p>' . "\n" .
+ $form_start .
+ $comments . "\n" .
+ $form .
+ $form_end .
+ '</div>' . "\n";
+ } else {
+ return '<div>' .
+ $form_start .
+ $form .
+ $comments. "\n" .
+ $form_end .
+ '<p>' . $recent . ' ' . $link . '</p>' . "\n" .
+ '</div>' . "\n";
+ }
+ // TODO: READONLY»þ¤Îradiobox¤Îºï½ü¤ò˺¤ì¤º¤Ë¡£
}
function pcmt_insert()
unset($data);
//¥³¥á¥ó¥È¤Ë¥é¥¸¥ª¥Ü¥¿¥ó¤Î°õ¤ò¤Ä¤±¤ë
- if ($reply) {
+ if ($reply)
$comments = preg_replace("/<li>\x01(\d+)\x02(.*)\x03/",
'<li class="pcmt"><input class="pcmt" type="radio" name="reply" value="$2" tabindex="$1" />',
$comments);
- }
return array($comments, $digest);
}