OSDN Git Service

PKWK_READONLY prohibits this
[pukiwiki/pukiwiki.git] / plugin / links.inc.php
1 <?php
2 // PukiWiki - Yet another WikiWikiWeb clone
3 // $Id: links.inc.php,v 1.22 2005/01/23 07:48:55 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         if (PKWK_READONLY) die_message('PKWK_READONLY prohibits this');
39
40         $msg = $body = '';
41         if (empty($vars['action']) || empty($post['adminpass']) || ! pkwk_login($post['adminpass'])) {
42                 $msg   = & $_links_messages['title_update'];
43                 $body  = convert_html($_links_messages['msg_usage']);
44                 $body .= <<<EOD
45 <form method="POST" action="$script">
46  <div>
47   <input type="hidden" name="plugin" value="links" />
48   <input type="hidden" name="action" value="update" />
49   {$_links_messages['msg_adminpass']}
50   <input type="password" name="adminpass" size="20" value="" />
51   <input type="submit" value="{$_links_messages['btn_submit']}" />
52  </div>
53 </form>
54 EOD;
55
56         } else if ($vars['action'] == 'update') {
57                 links_init();
58                 $foot_explain = array(); // Exhaust footnotes
59                 $msg  = & $_links_messages['title_update'];
60                 $body = & $_links_messages['msg_done'    ];
61         } else {
62                 $msg  = & $_links_messages['title_update'];
63                 $body = & $_links_messages['err_invalid' ];
64         }
65         return array('msg'=>$msg, 'body'=>$body);
66 }
67 ?>