Index: convert_html.php
===================================================================
RCS file: /cvsroot/pukiwiki/pukiwiki/convert_html.php,v
retrieving revision 1.62
diff -u -r1.62 convert_html.php
--- convert_html.php	18 Mar 2004 09:52:52 -0000	1.62
+++ convert_html.php	23 Jun 2004 10:58:12 -0000
@@ -860,9 +860,13 @@
 	function getAnchor($text,$level)
 	{
 		global $top,$_symbol_anchor;
+		global $fixed_heading_edited, $fixed_heading_anchor;
 		
 		$anchor = (($id = make_heading($text,FALSE)) == '') ?
-			'' : " &aname($id,super,full)\{$_symbol_anchor};";
+			'' : ((($fixed_heading_edited == 1) and ($fixed_heading_anchor == 1)) ? 
+				  " &aname($id,super,full)\{$_symbol_anchor}; &edit(,$id);"
+				: " &aname($id,super,full)\{$_symbol_anchor};"
+			     );
 		$text = ' '.$text;
 		$id = "content_{$this->id}_{$this->count}";
 		$this->count++;
Index: en.lng
===================================================================
RCS file: /cvsroot/pukiwiki/pukiwiki/en.lng,v
retrieving revision 1.26
diff -u -r1.26 en.lng
--- en.lng	3 Apr 2004 15:27:07 -0000	1.26
+++ en.lng	23 Jun 2004 10:58:12 -0000
@@ -49,6 +49,7 @@
 // symbols
 $_symbol_anchor = '&dagger;';
 $_symbol_noexists = '?';
+$_symbol_paraedit ='<img src="./image/edit.png" width="16" height="16" alt="Edit" title="Edit" />';
 
 ///////////////////////////////////////
 // form buttons
Index: ja.lng
===================================================================
RCS file: /cvsroot/pukiwiki/pukiwiki/ja.lng,v
retrieving revision 1.25
diff -u -r1.25 ja.lng
--- ja.lng	3 Apr 2004 15:27:07 -0000	1.25
+++ ja.lng	23 Jun 2004 10:58:13 -0000
@@ -50,6 +50,7 @@
 // symbols
 $_symbol_anchor = '&dagger;';
 $_symbol_noexists = '?';
+$_symbol_paraedit ='<img src="./image/edit.png" width="16" height="16" alt="Edit" title="Edit" />';
 
 ///////////////////////////////////////
 // form buttons
Index: html.php
===================================================================
RCS file: /cvsroot/pukiwiki/pukiwiki/html.php,v
retrieving revision 1.99
diff -u -r1.99 html.php
--- html.php	3 Apr 2004 15:33:26 -0000	1.99
+++ html.php	23 Jun 2004 10:58:14 -0000
@@ -175,6 +175,7 @@
 	$s_digest = htmlspecialchars($digest);
 	$s_postdata = htmlspecialchars($refer.$postdata);
 	$s_original = array_key_exists('original',$vars) ? htmlspecialchars($vars['original']) : $s_postdata;
+	$s_id = array_key_exists('id',$vars) ? htmlspecialchars($vars['id']) : '';
 	$b_preview = array_key_exists('preview',$vars); // ƒvƒŒƒrƒ…�[’†TRUE
 	$btn_preview = $b_preview ? $_btn_repreview : $_btn_preview;
 	
@@ -186,6 +187,7 @@
   <input type="hidden" name="cmd" value="edit" />
   <input type="hidden" name="page" value="$s_page" />
   <input type="hidden" name="digest" value="$s_digest" />
+  <input type="hidden" name="id" value="$s_id" />
   <textarea name="msg" rows="$rows" cols="$cols">$s_postdata</textarea>
   <br />
   <input type="submit" name="preview" value="$btn_preview" accesskey="p" />
Index: pukiwiki.ini.php
===================================================================
RCS file: /cvsroot/pukiwiki/pukiwiki/pukiwiki.ini.php,v
retrieving revision 1.55
diff -u -r1.55 pukiwiki.ini.php
--- pukiwiki.ini.php	3 Apr 2004 15:56:08 -0000	1.55
+++ pukiwiki.ini.php	23 Jun 2004 10:58:14 -0000
@@ -281,6 +281,9 @@
 /////////////////////////////////////////////////
 // Œ©�o‚µ�s‚ÉŒÅ—L‚ÌƒAƒ“ƒJ�[‚ðŽ©“®‘}“ü‚·‚é
 $fixed_heading_anchor = 0;
+// Œ©�o‚µ�s‚Ì‚ÌŒÅ—L‚ÌƒAƒ“ƒJ�[‚ð‚à‚Æ‚É�AŒ©�o‚µ’PˆÊ•Ò�W‚ð‰Â”\‚É‚·‚é
+$fixed_heading_edited = 0;
+
 /////////////////////////////////////////////////
 // <pre>‚Ì�s“ªƒXƒy�[ƒX‚ð‚Ð‚Æ‚ÂŽæ‚è�œ‚­
 $preformat_ltrim = 0;
Index: plugin/edit.inc.php
===================================================================
RCS file: /cvsroot/pukiwiki/pukiwiki/plugin/edit.inc.php,v
retrieving revision 1.11
diff -u -r1.11 edit.inc.php
--- plugin/edit.inc.php	22 Jun 2003 06:37:18 -0000	1.11
+++ plugin/edit.inc.php	23 Jun 2004 10:58:15 -0000
@@ -9,6 +9,7 @@
 function plugin_edit_action()
 {
 	global $vars,$_title_edit;
+	global $fixed_heading_edited, $fixed_heading_anchor;
 	
 	check_editable($vars['page'], true, true);
 	
@@ -18,8 +19,23 @@
 	else if (array_key_exists('write',$vars)) {
 		return plugin_edit_write();
 	}
-	
-	$postdata = @join('',get_source($vars['page']));
+	// Œ©�o‚µ•Ò�W‰Â”\�^Œ©�o‚µŒÅ—LƒAƒ“ƒJ�[Ž©“®‘}“ü‚ª‹¤‚É—LŒø‚ÈŽž�AŒ©�o‚µ’PˆÊ•Ò�W�ˆ—�‚ð�s‚È‚¤
+	if ($fixed_heading_edited == 1 and $fixed_heading_anchor == 1)
+	{
+		$source = get_source($vars['page']);
+		$postdata = $vars['original'] = join('',$source);
+		if (!empty($vars['id']))
+		{
+			$postdata = plugin_edit_parts($vars['id'],$source);
+			if ($postdata === FALSE)
+			{
+				unset($vars['id']); // ¤Ê¤«¤Ã¤¿¤³¤È¤Ë :)
+				$postdata = $vars['original'];
+			}
+		}
+	} else {
+		$postdata = @join('',get_source($vars['page']));
+	}
 	if ($postdata == '') {
 		$postdata = auto_template($vars['page']);
 	}
@@ -82,11 +98,37 @@
 	return array('msg'=>$_title_preview,'body'=>$body);
 }
 
+function plugin_edit_inline()
+{
+	global $script,$vars;
+	global $_symbol_paraedit;
+	
+	$args = func_get_args();
+	
+	$s_label = array_pop($args);
+	if ($s_label == '')
+	{
+		$s_label = $_symbol_paraedit;
+	}
+	
+	list($page,$id) = array_pad($args,2,'');
+	if (!is_page($page))
+	{
+		$page = $vars['page'];
+	}
+	if ($id != '')
+	{
+		$id = '&amp;id='.rawurlencode($id);
+	}
+	$r_page = rawurlencode($page);
+	return "<a class=\"anchor_super\" href=\"$script?cmd=edit&amp;page=$r_page$id\" title=\"Edit\">$s_label</a>";
+}
 // �‘‚«�ž‚Ý‚à‚µ‚­‚Í’Ç‰Á‚à‚µ‚­‚ÍƒRƒ�ƒ“ƒg‚Ì‘}“ü
 function plugin_edit_write()
 {
 	global $script,$post,$vars;
 	global $_title_collided,$_msg_collided_auto,$_msg_collided,$_title_deleted;
+	global $fixed_heading_edited;
 	
 	$retvars = array();
 	
@@ -109,6 +151,19 @@
 	}
 	else {
 		$postdata = $post['msg'];
+		if (!empty($post['id']) or ($fixed_heading_edited !== 1))
+		{
+			$source = preg_split('/([^\n]*\n)/',$post['original'],-1,PREG_SPLIT_NO_EMPTY|PREG_SPLIT_DELIM_CAPTURE);
+			if (plugin_edit_parts($post['id'],$source,$post['msg']) !== FALSE)
+			{
+				$postdata = $postdata_input = join('',$source);
+			}
+			else
+			{
+				// $post['msg']‚¾‚¯‚ªƒy�[ƒW‚É�‘‚«�ž‚Ü‚ê‚Ä‚µ‚Ü‚¤‚Ì‚ð–h‚®�B
+				$postdata = $postdata_input = rtrim($post['original'])."\n\n".$post['msg'];
+			}
+		}
 	}
 	
 	$oldpagesrc = join('',get_source($post['page']));
@@ -126,7 +181,7 @@
 			global $do_update_diff_table;
 			$retvars['body'] .= $do_update_diff_table;
 		}
-		
+		unset($vars['id']);// �X�V‚ª�Õ“Ë‚µ‚½‚ç‘S•¶•Ò�W‚É�Ø‚è‘Ö‚¦
 		$retvars['body'] .= edit_form($post['page'],$postdata_input,$oldpagemd5,FALSE);
 	}
 	else {
@@ -145,5 +200,21 @@
 	
 	return $retvars;
 }
+// ƒ\�[ƒX‚Ìˆê•”‚ð’Š�o/’uŠ·‚·‚é
+function plugin_edit_parts($id,&$source,$postdata='')
+{
+	$postdata = rtrim($postdata)."\n";
+	$heads = preg_grep('/^\*{1,3}.+$/',$source);
+	$heads[count($source)] = ''; // sentinel
+	while (list($start,$line) = each($heads))
+	{
+		if (preg_match("/\[#$id\]/",$line))
+		{
+			list($end,$line) = each($heads);
+			return join('',array_splice($source,$start,$end - $start,$postdata));
+		}
+	}
+	return FALSE;
+}
 
 ?>
Index: plugin/include.inc.php
===================================================================
RCS file: /cvsroot/pukiwiki/pukiwiki/plugin/include.inc.php,v
retrieving revision 1.8
diff -u -r1.8 include.inc.php
--- plugin/include.inc.php	3 Jul 2003 06:12:17 -0000	1.8
+++ plugin/include.inc.php	23 Jun 2004 10:58:15 -0000
@@ -14,6 +14,7 @@
 {
 	global $script,$vars,$get,$post,$hr,$WikiName,$BracketName;
 	global $_msg_include_restrict;
+	global $fixed_heading_edited,$fixed_heading_anchor, $_symbol_paraedit;
 	static $include_list = array(); //�ˆ—��Ïƒy�[ƒW–¼‚Ì”z—ñ
 	
 	if (func_num_args() == 0)
@@ -47,6 +48,13 @@
 	$s_page = htmlspecialchars($page);
 	$r_page = rawurlencode($page);
 	$link = "<a href=\"$script?cmd=edit&amp;page=$r_page\">$s_page</a>";
+	// Œ©�o‚µ•Ò�W ‚©‚Â ŒÅ—LŒ©�o‚µŽ©“®‘}“ü‚ª—LŒø‚ÈŽž�AŒ©�o‚µ•Ò�WƒAƒ“ƒJ�[‚ð•\Ž¦
+	if ($fixed_heading_edited == 1 and $fixed_heading_anchor == 1)
+	{
+		$head .= "<h3>$link <a class=\"anchor_super\" href=\"$script?$r_page\">$_symbol_anchor</a>&nbsp;<a class=\"anchor_super\" href=\"$script?cmd=edit&amp;page=$r_page\" title=\"Edit\">$symbol_paraedit</a></h3>\n";
+	}
+	
+	
 	if ($page == 'MenuBar')
 	{
 		$body = <<<EOD
Index: plugin/menu.inc.php
===================================================================
RCS file: /cvsroot/pukiwiki/pukiwiki/plugin/menu.inc.php,v
retrieving revision 1.2
diff -u -r1.2 menu.inc.php
--- plugin/menu.inc.php	22 Jul 2003 06:00:23 -0000	1.2
+++ plugin/menu.inc.php	23 Jun 2004 10:58:16 -0000
@@ -11,6 +11,7 @@
 function plugin_menu_convert()
 {
 	global $script,$vars,$menubar;
+	global $fixed_heading_edited, $fixed_heading_anchor;
 	static $menu = NULL;
 	
 	if (func_num_args())
@@ -42,6 +43,14 @@
 	{
 		return '';
 	}
-	return preg_replace('/<ul[^>]*>/','<ul>',convert_html(get_source($page)));
+
+	// Œ©‚¾‚µ•Ò�W‹@”\‚Å�AƒTƒCƒhƒ�ƒjƒ…�[ƒo�[‚ÉŒ©�o‚µ•Ò�WƒAƒ“ƒJ�[‚ª‚Â‚©‚È‚¢ˆ×‚Ìƒpƒbƒ`
+	if (($fixed_heading_edited == 1) and ($fixed_heading_anchor == 1))
+	{
+	        $menutext = preg_replace('/^(\*{1,3}.*)\[#[A-Za-z][\w-]+\](.*)$/m','$1$2',get_source($page));
+	        return preg_replace('/<ul[^>]*>/','<ul>',convert_html($menutext));
+	}else{
+		return preg_replace('/<ul[^>]*>/','<ul>',convert_html(get_source($page)));
+	}
 }
 ?>
