From 4825a91918796fdb70968d7fc18cdacad85116fd Mon Sep 17 00:00:00 2001 From: henoheno Date: Sat, 20 Nov 2004 15:38:32 +0900 Subject: [PATCH] Show unfreeze icon. Added secret option 'paraedit' to avoid showing unfreeze icon --- plugin/edit.inc.php | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/plugin/edit.inc.php b/plugin/edit.inc.php index 7808595..79feda5 100644 --- a/plugin/edit.inc.php +++ b/plugin/edit.inc.php @@ -2,7 +2,7 @@ ///////////////////////////////////////////////// // PukiWiki - Yet another WikiWikiWeb clone. // -// $Id: edit.inc.php,v 1.21 2004/11/20 05:12:01 henoheno Exp $ +// $Id: edit.inc.php,v 1.22 2004/11/20 06:38:32 henoheno Exp $ // // Edit plugin @@ -89,15 +89,17 @@ function plugin_edit_inline() $s_label = array_pop($args); // {label} $page = array_shift($args); if($page == NULL) $page = ''; - $_noicon = $_nolabel = FALSE; + $_noicon = $_nolabel = $_paraedit = FALSE; foreach($args as $arg){ switch($arg){ case '': break; - case 'noicon': $_noicon = TRUE; break; - case 'nolabel': $_nolabel = TRUE; break; + case 'noicon': $_noicon = TRUE; break; + case 'nolabel': $_nolabel = TRUE; break; + case 'paraedit': $_paraedit = TRUE; break; // Paragraph-edit default: return $usage; } } + if($_paraedit) $_nolabel = TRUE; // Separate a page-name and a fixed anchor list($s_page, $id, $editable) = anchor_explode($page, TRUE); @@ -109,22 +111,31 @@ function plugin_edit_inline() // Paragraph edit enabled or not $short = htmlspecialchars('Edit'); - if ($fixed_heading_anchor_edit && $editable === TRUE && $ispage === TRUE) { - $title = htmlspecialchars(sprintf('Edit %s', $page)); + if ($fixed_heading_anchor_edit && $editable && $ispage && ! $isfreeze) { + // Paragraph editing $id = rawurlencode($id); + $title = htmlspecialchars(sprintf('Edit %s', $page)); $icon = '' .
 			$short . ' '; $class = 'anchor_super'; } else { - $title = htmlspecialchars(sprintf('Edit %s', $s_page)); + // Normal editing / unfreeze $id = ''; - $icon = '' .
 			$short . ''; $class = ''; } - if ($_noicon || $isfreeze) $icon = ''; // No more icon + if ($_noicon || $_paraedit) $icon = ''; // No more icon if ($_nolabel) { if (!$_noicon) { $s_label = ''; // No label with an icon @@ -135,9 +146,8 @@ function plugin_edit_inline() if ($s_label == '') $s_label = $title; // Rich label with an icon } - // Anchor tag + // URL if ($isfreeze) { - $title = htmlspecialchars(sprintf('Unfreeze %s', $page)); $url = $script . '?cmd=unfreeze&page=' . rawurlencode($s_page); } else { if ($id != '') { -- 2.11.0