2 // PukiWiki - Yet another WikiWikiWeb clone
4 // Copyright 2003-2017 PukiWiki Development 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 $post, $vars, $foot_explain;
38 global $_links_messages;
40 $script = get_base_uri();
41 if (PKWK_READONLY) die_message('PKWK_READONLY prohibits this');
44 if (empty($vars['action']) || empty($post['adminpass']) || ! pkwk_login($post['adminpass'])) {
45 $msg = & $_links_messages['title_update'];
46 $body = convert_html($_links_messages['msg_usage']);
48 <form method="post" action="$script">
50 <input type="hidden" name="plugin" value="links" />
51 <input type="hidden" name="action" value="update" />
52 <label for="_p_links_adminpass">{$_links_messages['msg_adminpass']}</label>
53 <input type="password" name="adminpass" id="_p_links_adminpass" size="20" value="" />
54 <input type="submit" value="{$_links_messages['btn_submit']}" />
59 } else if ($vars['action'] == 'update') {
61 $foot_explain = array(); // Exhaust footnotes
62 $msg = & $_links_messages['title_update'];
63 $body = & $_links_messages['msg_done' ];
65 $msg = & $_links_messages['title_update'];
66 $body = & $_links_messages['err_invalid' ];
68 return array('msg'=>$msg, 'body'=>$body);