OSDN Git Service

add error check and messages.
authorpanda <panda>
Thu, 13 Mar 2003 06:00:23 +0000 (15:00 +0900)
committerpanda <panda>
Thu, 13 Mar 2003 06:00:23 +0000 (15:00 +0900)
plugin/source.inc.php

index f6cdf01..a4d8b07 100644 (file)
@@ -2,7 +2,7 @@
 /////////////////////////////////////////////////
 // PukiWiki - Yet another WikiWikiWeb clone.
 //
-// $Id: source.inc.php,v 1.7 2003/03/13 05:31:16 panda Exp $
+// $Id: source.inc.php,v 1.8 2003/03/13 06:00:23 panda Exp $
 //
 // ¥Ú¡¼¥¸¥½¡¼¥¹¤òɽ¼¨
 
@@ -10,7 +10,9 @@ function plugin_source_init()
 {
        $messages = array(
                '_source_messages'=>array(
-               'msg_title' => '$1¤Î¥½¡¼¥¹'
+                       'msg_title' => '$1¤Î¥½¡¼¥¹',
+                       'msg_notfound' => '$1¤¬¸«¤Ä¤«¤ê¤Þ¤»¤ó',
+                       'err_notfound' => '¥Ú¡¼¥¸¤Î¥½¡¼¥¹¤òɽ¼¨¤Ç¤­¤Þ¤»¤ó¡£'
                )
        );
        set_plugin_messages($messages);
@@ -21,6 +23,15 @@ function plugin_source_action()
        global $vars;
        global $_source_messages;
        
+       $vars['refer'] = $vars['page'];
+       
+       if (!is_page($vars['page']))
+       {
+               return array(
+                       'msg'=>$_source_messages['msg_notfound'],
+                       'body'=>$_source_messages['err_notfound']
+               );
+       }
        return array(
                'msg'=>$_source_messages['msg_title'],
                'body' =>