<?php
// PukiWiki - Yet another WikiWikiWeb clone.
-// $Id: vote.inc.php,v 1.21 2005/01/06 13:44:00 henoheno Exp $
+// $Id: vote.inc.php,v 1.22 2005/01/23 09:43:06 henoheno Exp $
//
-// Vote plugin
+// Vote box plugin
function plugin_vote_action()
{
global $_title_collided, $_msg_collided, $_title_updated;
global $_vote_plugin_votes;
+ if (PKWK_READONLY) die_message('PKWK_READONLY prohibits editing');
+
$postdata_old = get_source($vars['refer']);
$vote_no = 0;
if (! func_num_args()) return '#vote(): No arguments<br/>' . "\n";
+ if (PKWK_READONLY) {
+ $_script = '';
+ $_submit = 'hidden';
+ } else {
+ $_script = $script;
+ $_submit = 'submit';
+ }
+
$args = func_get_args();
$s_page = htmlspecialchars($page);
$s_digest = htmlspecialchars($digest);
$body = <<<EOD
-<form action="$script" method="post">
+<form action="$_script" method="post">
<table cellspacing="0" cellpadding="2" class="style_table" summary="vote">
<tr>
<td align="left" class="vote_label" style="padding-left:1em;padding-right:1em"><strong>$_vote_plugin_choice</strong>
<tr>
<td align="left" class="$cls" style="padding-left:1em;padding-right:1em;">$link</td>
<td align="right" class="$cls">$cnt
- <input type="submit" name="vote_$e_arg" value="$_vote_plugin_votes" class="submit" />
+ <input type="$_submit" name="vote_$e_arg" value="$_vote_plugin_votes" class="submit" />
</td>
</tr>