From: henoheno Date: Sat, 14 Aug 2004 23:52:18 +0000 (+0900) Subject: Simplify. Get error messages together X-Git-Tag: r1_5_0_rc1~1083 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=a73cd00a57a61842d6530e8c751f890f93ce08a1;p=pukiwiki%2Fpukiwiki.git Simplify. Get error messages together --- diff --git a/plugin/attach.inc.php b/plugin/attach.inc.php index a075dd4..94d2e31 100644 --- a/plugin/attach.inc.php +++ b/plugin/attach.inc.php @@ -2,7 +2,7 @@ ///////////////////////////////////////////////// // PukiWiki - Yet another WikiWikiWeb clone. // -// $Id: attach.inc.php,v 1.58 2004/08/14 23:12:18 henoheno Exp $ +// $Id: attach.inc.php,v 1.59 2004/08/14 23:52:18 henoheno Exp $ // /* @@ -50,9 +50,6 @@ function plugin_attach_convert() { global $vars; - if (! ini_get('file_uploads')) - return '#attach(): file_uploads disabled'; - $page = isset($vars['page']) ? $vars['page'] : ''; $nolist = $noform = FALSE; @@ -277,22 +274,14 @@ function attach_list() return array('msg'=>$msg, 'body'=>$body); } -// ¥¢¥Ã¥×¥í¡¼¥É¥Õ¥©¡¼¥à¤òɽ¼¨ +// ¥¢¥Ã¥×¥í¡¼¥É¥Õ¥©¡¼¥à¤òɽ¼¨ (action»þ) function attach_showform() { global $vars, $_attach_messages; $page = isset($vars['page']) ? $vars['page'] : ''; - $vars['refer'] = $page; - - if (! ini_get('file_uploads')) { - $body = '#attach(): file_uploads disabled.'; - } else if (! is_page($page)) { - $body = '#attach(): No such page'; - } else { - $body = attach_form($page); - } + $body = attach_form($page); return array('msg'=>$_attach_messages['msg_upload'], 'body'=>$body); } @@ -337,7 +326,7 @@ function attach_mime_content_type($filename) return $type; } -// ¥¢¥Ã¥×¥í¡¼¥É¥Õ¥©¡¼¥à +// ¥¢¥Ã¥×¥í¡¼¥É¥Õ¥©¡¼¥à¤Î½ÐÎÏ function attach_form($page) { global $script, $vars, $_attach_messages; @@ -351,7 +340,8 @@ function attach_form($page)
EOD; - if (! (bool)ini_get('file_uploads')) return $navi; + if (! ini_get('file_uploads')) return '#attach(): file_uploads disabled
' . $navi; + if (! is_page($page)) return '#attach(): No such page
' . $navi; $maxsize = MAX_FILESIZE; $msg_maxsize = sprintf($_attach_messages['msg_maxsize'], number_format($maxsize/1024) . 'KB'); @@ -462,7 +452,7 @@ class AttachFile $info = $count = ''; if ($showinfo) { $_title = str_replace('$1', rawurlencode($this->file), $_attach_messages['msg_info']); - $info = "\n[{$_attach_messages['btn_info']}]"; + $info = "\n[{$_attach_messages['btn_info']}]
\n"; $count = ($showicon && ! empty($this->status['count'][$this->age])) ? sprintf($_attach_messages['msg_count'], $this->status['count'][$this->age]) : ''; }