OSDN Git Service

c3007ff4c9db59eaaa6e388f1fb9e2b49d388ab8
[pukiwiki/pukiwiki.git] / plugin / links.inc.php
1 <?php
2 // PukiWiki - Yet another WikiWikiWeb clone
3 // $Id: links.inc.php,v 1.21 2005/01/23 07:47:48 henoheno Exp $
4 //
5 // Update link cache plugin
6
7 // Message setting
8 function plugin_links_init()
9 {
10         $messages = array(
11                 '_links_messages'=>array(
12                         'title_update'  => '¥­¥ã¥Ã¥·¥å¹¹¿·',
13                         'msg_adminpass' => '´ÉÍý¼Ô¥Ñ¥¹¥ï¡¼¥É',
14                         'btn_submit'    => '¼Â¹Ô',
15                         'msg_done'      => '¥­¥ã¥Ã¥·¥å¤Î¹¹¿·¤¬´°Î»¤·¤Þ¤·¤¿¡£',
16                         'msg_usage'     => "
17 * ½èÍýÆâÍÆ
18
19 :¥­¥ã¥Ã¥·¥å¤ò¹¹¿·|
20 Á´¤Æ¤Î¥Ú¡¼¥¸¤ò¥¹¥­¥ã¥ó¤·¡¢¤¢¤ë¥Ú¡¼¥¸¤¬¤É¤Î¥Ú¡¼¥¸¤«¤é¥ê¥ó¥¯¤µ¤ì¤Æ¤¤¤ë¤«¤òÄ´ºº¤·¤Æ¡¢¥­¥ã¥Ã¥·¥å¤Ëµ­Ï¿¤·¤Þ¤¹¡£
21
22 * Ãí°Õ
23 ¼Â¹Ô¤Ë¤Ï¿ôʬ¤«¤«¤ë¾ì¹ç¤â¤¢¤ê¤Þ¤¹¡£¼Â¹Ô¥Ü¥¿¥ó¤ò²¡¤·¤¿¤¢¤È¡¢¤·¤Ð¤é¤¯¤ªÂÔ¤Á¤¯¤À¤µ¤¤¡£
24
25 * ¼Â¹Ô
26 ´ÉÍý¼Ô¥Ñ¥¹¥ï¡¼¥É¤òÆþÎϤ·¤Æ¡¢[¼Â¹Ô]¥Ü¥¿¥ó¤ò¥¯¥ê¥Ã¥¯¤·¤Æ¤¯¤À¤µ¤¤¡£
27 "
28                 )
29         );
30         set_plugin_messages($messages);
31 }
32
33 function plugin_links_action()
34 {
35         global $script, $post, $vars, $foot_explain;
36         global $_links_messages;
37
38         $msg = $body = '';
39         if (empty($vars['action']) || empty($post['adminpass']) || ! pkwk_login($post['adminpass'])) {
40                 $msg   = & $_links_messages['title_update'];
41                 $body  = convert_html($_links_messages['msg_usage']);
42                 $body .= <<<EOD
43 <form method="POST" action="$script">
44  <div>
45   <input type="hidden" name="plugin" value="links" />
46   <input type="hidden" name="action" value="update" />
47   {$_links_messages['msg_adminpass']}
48   <input type="password" name="adminpass" size="20" value="" />
49   <input type="submit" value="{$_links_messages['btn_submit']}" />
50  </div>
51 </form>
52 EOD;
53
54         } else if ($vars['action'] == 'update') {
55                 links_init();
56                 $foot_explain = array(); // Exhaust footnotes
57                 $msg  = & $_links_messages['title_update'];
58                 $body = & $_links_messages['msg_done'    ];
59         } else {
60                 $msg  = & $_links_messages['title_update'];
61                 $body = & $_links_messages['err_invalid' ];
62         }
63         return array('msg'=>$msg, 'body'=>$body);
64 }
65 ?>