From 605804987ac5d4e4a771025f260746cd35b9cf33 Mon Sep 17 00:00:00 2001
From: arino
Date: Thu, 5 Jun 2003 19:38:03 +0900
Subject: [PATCH] =?utf8?q?=E3=82=B3=E3=83=BC=E3=83=89=E3=82=92=E6=95=B4?=
=?utf8?q?=E7=90=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=utf8
Content-Transfer-Encoding: 8bit
---
plugin/freeze.inc.php | 46 ++++++++++++++++++++--------------------------
plugin/unfreeze.inc.php | 45 +++++++++++++++++++--------------------------
2 files changed, 39 insertions(+), 52 deletions(-)
diff --git a/plugin/freeze.inc.php b/plugin/freeze.inc.php
index 15c9150..526bef5 100644
--- a/plugin/freeze.inc.php
+++ b/plugin/freeze.inc.php
@@ -2,7 +2,7 @@
/////////////////////////////////////////////////
// PukiWiki - Yet another WikiWikiWeb clone.
//
-// $Id: freeze.inc.php,v 1.3 2003/06/05 05:00:45 arino Exp $
+// $Id: freeze.inc.php,v 1.4 2003/06/05 10:38:03 arino Exp $
//
// Åà·ë
function plugin_freeze_convert()
@@ -16,19 +16,22 @@ function plugin_freeze_action()
global $_title_isfreezed,$_title_freezed,$_title_freeze;
global $_msg_invalidpass,$_msg_freezing,$_btn_freeze;
- $msg = $body = '';
-
- if (!$function_freeze or !is_page($vars['page'])) {
- return array('msg'=>$msg,'body'=>$body);
+ if (!$function_freeze or !is_page($vars['page']))
+ {
+ return array('msg'=>'','body'=>'');
}
$pass = array_key_exists('pass',$post) ? $post['pass'] : NULL;
- if (is_freeze($vars['page'])) {
- $msg = $_title_isfreezed;
- $body = str_replace('$1',htmlspecialchars(strip_bracket($vars['page'])),$_title_isfreezed);
+ if (is_freeze($vars['page']))
+ {
+ return array(
+ 'msg' => $_title_isfreezed,
+ 'body' => str_replace('$1',htmlspecialchars(strip_bracket($vars['page'])),$_title_isfreezed)
+ );
}
- else if (md5($pass) == $adminpass) {
+ else if (md5($pass) == $adminpass)
+ {
$postdata = get_source($post['page']);
array_unshift($postdata,"#freeze\n");
$postdata = join('',$postdata);
@@ -36,22 +39,14 @@ function plugin_freeze_action()
file_write(DATA_DIR,$vars['page'],$postdata,TRUE);
$vars['cmd'] = 'read';
- $msg = $_title_freezed;
- $body = '';
+ return array('msg'=>$_title_freezed,'body'=>'');
}
- else {
- $msg = $_title_freeze;
-
- $body = "
\n";
-
- if ($pass !== NULL) {
- $body .= "$_msg_invalidpass
\n";
- }
-
- $body.= "$_msg_freezing
\n";
-
- $s_page = htmlspecialchars($vars['page']);
- $body .= <<$_msg_invalidpass
\n";
+ $body .= <<$_msg_freezing
EOD;
- }
- return array('msg'=>$msg,'body'=>$body);
+ return array('msg'=>$_title_freeze,'body'=>$body);
}
?>
diff --git a/plugin/unfreeze.inc.php b/plugin/unfreeze.inc.php
index 97b8f3a..8430d48 100644
--- a/plugin/unfreeze.inc.php
+++ b/plugin/unfreeze.inc.php
@@ -2,7 +2,7 @@
/////////////////////////////////////////////////
// PukiWiki - Yet another WikiWikiWeb clone.
//
-// $Id: unfreeze.inc.php,v 1.3 2003/06/05 05:00:45 arino Exp $
+// $Id: unfreeze.inc.php,v 1.4 2003/06/05 10:38:03 arino Exp $
//
// Åà·ë²ò½ü
@@ -15,19 +15,19 @@ function plugin_unfreeze_action()
global $_title_isunfreezed,$_title_unfreezed,$_title_unfreeze;
global $_msg_invalidpass,$_msg_unfreezing,$_btn_unfreeze;
- $msg = $body = '';
-
if (!$function_freeze or !is_page($vars['page']))
{
- return array('msg'=>$msg,'body'=>$body);
+ return array('msg'=>'','body'=>'');
}
$pass = array_key_exists('pass',$post) ? $post['pass'] : NULL;
if (!is_freeze($vars['page']))
{
- $msg = $_title_isunfreezed;
- $body = str_replace('$1',htmlspecialchars(strip_bracket($vars['page'])),$_title_isunfreezed);
+ return array(
+ 'msg'=>$_title_isunfreezed,
+ 'body'=>str_replace('$1',htmlspecialchars(strip_bracket($vars['page'])),$_title_isunfreezed)
+ );
}
else if (md5($pass) == $adminpass)
{
@@ -37,29 +37,23 @@ function plugin_unfreeze_action()
file_write(DATA_DIR,$vars['page'],$postdata,TRUE);
- $vars['cmd'] = 'read';
- $msg = $_title_unfreezed;
- $body = '';
-
if (UNFREEZE_EDIT)
{
$vars['cmd'] = 'edit';
- $body = edit_form($vars['page'],$postdata);
+ return array('msg'=>$_title_unfreezed,'body'=>'');
}
+ $vars['cmd'] = 'read';
+ return array(
+ 'msg'=>$_title_unfreezed,
+ 'body'=>edit_form($vars['page'],$postdata)
+ );
}
- else
- {
- $msg = $_title_unfreeze;
-
- $body = "
\n";
-
- if ($pass !== NULL)
- $body .= "$_msg_invalidpass
\n";
-
- $body.= "$_msg_unfreezing
\n";
-
- $s_page = htmlspecialchars($vars['page']);
- $body .= <<$_msg_invalidpass\n";
+ $body .= <<$_msg_unfreezing
EOD;
- }
- return array('msg'=>$msg,'body'=>$body);
+ return array('msg'=>$_title_unfreeze,'body'=>$body);
}
?>
--
2.11.0