2 /////////////////////////////////////////////////
3 // PukiWiki - Yet another WikiWikiWeb clone.
5 // $Id: freeze.inc.php,v 1.6 2004/07/18 13:06:24 henoheno Exp $
8 function plugin_freeze_convert()
13 function plugin_freeze_action()
15 global $script, $vars, $function_freeze;
16 global $_title_isfreezed, $_title_freezed, $_title_freeze;
17 global $_msg_invalidpass, $_msg_freezing, $_btn_freeze;
19 $page = isset($vars['page']) ? $vars['page'] : '';
21 if (!$function_freeze or !is_page($page))
22 return array('msg' => '', 'body' => '');
24 $pass = isset($vars['pass']) ? $vars['pass'] : NULL;
25 if (is_freeze($page)) {
27 'msg' => $_title_isfreezed,
28 'body' => str_replace('$1', htmlspecialchars(strip_bracket($page)), $_title_isfreezed)
30 } else if ($pass !== NULL && pkwk_login($pass)) {
31 $postdata = get_source($page);
32 array_unshift($postdata, "#freeze\n");
33 $postdata = join('', $postdata);
35 file_write(DATA_DIR,$page, $postdata, TRUE);
37 $vars['cmd'] = 'read';
38 return array('msg' => $_title_freezed, 'body' => '');
41 $s_page = htmlspecialchars($page);
43 $body = ($pass === NULL) ? '' : "<p><strong>$_msg_invalidpass</strong></p>\n";
46 <form action="$script" method="post">
48 <input type="hidden" name="cmd" value="freeze" />
49 <input type="hidden" name="page" value="$s_page" />
50 <input type="password" name="pass" size="12" />
51 <input type="submit" name="ok" value="$_btn_freeze" />
56 return array('msg'=>$_title_freeze, 'body'=>$body);