2 // PukiWiki - Yet another WikiWikiWeb clone
3 // $Id: links.inc.php,v 1.24 2007/04/08 10:29:24 henoheno Exp $
4 // Copyright (C) 2003-2005, 2007 PukiWiki Developers Team
5 // License: GPL v2 or (at your option) any later version
7 // Update link cache plugin
10 function plugin_links_init()
13 '_links_messages'=>array(
14 'title_update' => 'キャッシュ更新',
15 'msg_adminpass' => '管理者パスワード',
17 'msg_done' => 'キャッシュの更新が完了しました。',
22 全てのページをスキャンし、あるページがどのページからリンクされているかを調査して、キャッシュに記録します。
25 実行には数分かかる場合もあります。実行ボタンを押したあと、しばらくお待ちください。
28 管理者パスワードを入力して、[実行]ボタンをクリックしてください。
32 set_plugin_messages($messages);
35 function plugin_links_action()
37 global $script, $post, $vars, $foot_explain;
38 global $_links_messages;
40 if (PKWK_READONLY) die_message('PKWK_READONLY prohibits this');
43 if (empty($vars['action']) || empty($post['adminpass']) || ! pkwk_login($post['adminpass'])) {
44 $msg = & $_links_messages['title_update'];
45 $body = convert_html($_links_messages['msg_usage']);
47 <form method="post" action="$script">
49 <input type="hidden" name="plugin" value="links" />
50 <input type="hidden" name="action" value="update" />
51 <label for="_p_links_adminpass">{$_links_messages['msg_adminpass']}</label>
52 <input type="password" name="adminpass" id="_p_links_adminpass" size="20" value="" />
53 <input type="submit" value="{$_links_messages['btn_submit']}" />
58 } else if ($vars['action'] == 'update') {
60 $foot_explain = array(); // Exhaust footnotes
61 $msg = & $_links_messages['title_update'];
62 $body = & $_links_messages['msg_done' ];
64 $msg = & $_links_messages['title_update'];
65 $body = & $_links_messages['err_invalid' ];
67 return array('msg'=>$msg, 'body'=>$body);