<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>logIt &#187; mind map</title>
	<atom:link href="https://lakm.us/logit/tag/mind-map/feed/" rel="self" type="application/rss+xml" />
	<link>https://lakm.us/logit</link>
	<description>Log Around The Clock</description>
	<lastBuildDate>Sat, 06 Jun 2015 14:17:37 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Write WordPress Plugins to Play Freemind Mind-Map File</title>
		<link>https://lakm.us/logit/2010/01/write-wordpress-plugins-play-freemind-mind-map-file/</link>
		<comments>https://lakm.us/logit/2010/01/write-wordpress-plugins-play-freemind-mind-map-file/#comments</comments>
		<pubDate>Sat, 16 Jan 2010 15:14:15 +0000</pubDate>
		<dc:creator>Arif</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[Freemind]]></category>
		<category><![CDATA[mind map]]></category>
		<category><![CDATA[OOP]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://localhost/it/?p=104</guid>
		<description><![CDATA[The first version main goal is to embed the *.mm file which is a Freemind file. I found similarity of embedding this kind of file in flash-video-player plugins (I used version 3.1.8). So, I tried to reverse engineer by mind-mapping how it works first and how to hook plugins to WordPress. Here is version 1.1 [...]]]></description>
				<content:encoded><![CDATA[<p>The first version main goal is to embed the <code>*.mm</code> file which is a <a href="http://freemind.sourceforge.net" title="Freemind SourceForge" target="_blank">Freemind</a> file. I found similarity of embedding this kind of file in <a href="http://wordpress.org/extend/plugins/flash-video-player/">flash-video-player</a> plugins (I used version 3.1.8). So, I tried to reverse engineer by mind-mapping how it works first and how to hook plugins to WordPress. Here is version 1.1 of the <a href="../../../../upload/freemind-wp-browser.1.1.zip" title="freemind-wp-browser.1.1.zip" target="_blank">fremind-wp-browser</a>. The final mind-map and plugin in-use in this post looks crowded, but you can find highlighted pointers below the mind-map.  </p>
<p></p>
<h4>Embedding with SWFObject</h4>
<p>The *.mm file is projected over <a href="http://freemind.sourceforge.net/wiki/index.php/Flash_browser">visorFreemind.swf</a> player with the help of javascript.</p>
<p>Using javascript from <a href="http://blog.deconcept.com/swfobject/">SWFObject</a>, the idea of flash embedding is to create an <code>SWFObject</code> and then <code>write()</code> that inside certain part of page body, i.e. <code>div</code>.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span> 
   <span style="color: #003366; font-weight: bold;">var</span> s0 <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> SWFObject<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;visorFreemind.swf&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;n0&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;800&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;400&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;7&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   s0.<span style="color: #000066; font-weight: bold;">write</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;video0&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">;</span>
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></div></div>

<h4>Parsing a Post</h4>
<p>In general, the plugins will parse a post content to find <code>&#91;freemind file="path-to.mm" /&#93;</code> shortcode that will finally be replaced by the above javascript with respect to <code>*.mm</code> file that will be played over <code>visorFreemind.swf</code>.</p>
<h4>Hooking the Plugins to WordPress</h4>
<p>The above javascript needs to be loaded in every <code>head</code> part of each WordPress page, this action will call a function that will insert that script</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>163
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">add_action<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'wp_head'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'FreemindMap_head'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Hence, we get</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;script type=&quot;text/javascript&quot; src=&quot;http://lakm.us/logit/wp-content/plugins/freemind-wp-browser/swfobject.js&quot;&gt;&lt;/script&gt;</pre></div></div>

<p>on the header source of every page.</p>
<p>To deal with content parsing looking for the shortcode, add the following filter</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>166
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">add_filter<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'the_content'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'FreemindMap_Parse'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Activation/deactivation of the plugin is via the hook registration where it also create an option panel when activated by adding</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>99
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">add_options_page<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Freemind Options'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Freemind'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'8'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'freemind-wp-browser.php'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'FreemindOptions'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>This initial version has limited options though; enough to set the width and height of the mind-map projection.</p>
]]></content:encoded>
			<wfw:commentRss>https://lakm.us/logit/2010/01/write-wordpress-plugins-play-freemind-mind-map-file/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
