<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://pkp-www.lib.sfu.ca:8084/wiki/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://pkp-www.lib.sfu.ca:8084/wiki/index.php?title=Writing_a_Block_Plugin&amp;feed=atom&amp;action=history</id>
		<title>Writing a Block Plugin - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://pkp-www.lib.sfu.ca:8084/wiki/index.php?title=Writing_a_Block_Plugin&amp;feed=atom&amp;action=history"/>
		<link rel="alternate" type="text/html" href="http://pkp-www.lib.sfu.ca:8084/wiki/index.php?title=Writing_a_Block_Plugin&amp;action=history"/>
		<updated>2013-05-23T20:11:21Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.20.6</generator>

	<entry>
		<id>http://pkp-www.lib.sfu.ca:8084/wiki/index.php?title=Writing_a_Block_Plugin&amp;diff=2029&amp;oldid=prev</id>
		<title>Jmacgreg: /* A Basic Block Plugin */</title>
		<link rel="alternate" type="text/html" href="http://pkp-www.lib.sfu.ca:8084/wiki/index.php?title=Writing_a_Block_Plugin&amp;diff=2029&amp;oldid=prev"/>
				<updated>2011-05-02T03:39:28Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;A Basic Block Plugin&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr style='vertical-align: top;'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 03:39, 2 May 2011&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 34:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 34:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;#Don't worry about ''settings.xml'', it should be fine as it is.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;#Don't worry about ''settings.xml'', it should be fine as it is.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;#Open up ''plugins/block/myPlugin/block.tpl'' -- This is the Smarty template that will display the content of your plugin.&amp;#160; You can pretty much write straight HTML in here, but you can also harness the power of Smarty (http://www.smarty.net), which is necessary for e.g. localizing the text of the plugin (using the {translate} function).&amp;#160; For any dynamic content, you will have to make use of smarty functions and template variables, and likely also some PHP (introduced in the next section).&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;#Open up ''plugins/block/myPlugin/block.tpl'' -- This is the Smarty template that will display the content of your plugin.&amp;#160; You can pretty much write straight HTML in here, but you can also harness the power of Smarty (http://www.smarty.net), which is necessary for e.g. localizing the text of the plugin (using the {translate} function).&amp;#160; For any dynamic content, you will have to make use of smarty functions and template variables, and likely also some PHP (introduced in the next section).&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;#Open up &amp;quot;plugins/blocl/myPlugin/version.xml&amp;quot;. This file contains version and plugin description information that must be fed into the OJS database. You will wan to change the following: &lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;#* change the &amp;lt;application&amp;gt;...&amp;lt;/application&amp;gt; value from &amp;quot;developedBy&amp;quot; to &amp;quot;myPlugin&amp;quot;; &lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;#* change the &amp;lt;date&amp;gt;...&amp;lt;/date&amp;gt; value from eg. 2009-07-13 to the current date (in YYYY-MM-DD format); &lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;#* change the &amp;lt;class&amp;gt;...&amp;lt;/class&amp;gt; value from developedByBlockPlugin to MyPluginBlockPlugin. &lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;# You will then need to register the plugin in the OJS database. You can do this by running the following from your OJS root directory on your server: &lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt; php tools/upgrade.php upgrade&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Start up OJS, go to Journal Setup Step 5.6, and ensure that your plugin exists in the list and is in the right vertical position.&amp;#160; Behold, your first OJS plugin!&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Start up OJS, go to Journal Setup Step 5.6, and ensure that your plugin exists in the list and is in the right vertical position.&amp;#160; Behold, your first OJS plugin!&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Jmacgreg</name></author>	</entry>

	<entry>
		<id>http://pkp-www.lib.sfu.ca:8084/wiki/index.php?title=Writing_a_Block_Plugin&amp;diff=760&amp;oldid=prev</id>
		<title>Mcrider at 19:06, 3 April 2009</title>
		<link rel="alternate" type="text/html" href="http://pkp-www.lib.sfu.ca:8084/wiki/index.php?title=Writing_a_Block_Plugin&amp;diff=760&amp;oldid=prev"/>
				<updated>2009-04-03T19:06:53Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr style='vertical-align: top;'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 19:06, 3 April 2009&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 41:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 41:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Making dynamic block plugins will require some knowledge of Smarty and also probably some PHP.&amp;#160; Your best source of information is the other block plugins--A good next step is to look at the ''user'' block plugin.&amp;#160; The block.tpl file in that directory provides examples of how to create links to other pages in your system using the Smarty {url} function, and also how to use template variables that have been assigned to the template.&amp;#160; &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Making dynamic block plugins will require some knowledge of Smarty and also probably some PHP.&amp;#160; Your best source of information is the other block plugins--A good next step is to look at the ''user'' block plugin.&amp;#160; The block.tpl file in that directory provides examples of how to create links to other pages in your system using the Smarty {url} function, and also how to use template variables that have been assigned to the template.&amp;#160; &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;For example, a commonly used template variable is ''$isUserLoggedIn''.&amp;#160; This variable is global, or assigned to all templates in the constructor function of ''classes/template/TemplateManger.inc.php''.&amp;#160; You can look through &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;that function &lt;/del&gt;to find other global template variables by looking at other assigned variables in that function.&amp;#160; &amp;#160; &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;For example, a commonly used template variable is ''$isUserLoggedIn''.&amp;#160; This variable is global, or assigned to all templates in the constructor function of ''classes/template/TemplateManger.inc.php''.&amp;#160; You can look through &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;here &lt;/ins&gt;to find other global template variables by looking at other assigned variables in that function.&amp;#160; &amp;#160; &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Non-global variables are assigned to the plugin in the ''getContents()'' function of the plugin's class file.&amp;#160; Your myPlugin class does not have one, so you'll have to create one to be able to assign &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;plugins &lt;/del&gt;to your plugin.&amp;#160; Here is a basic example:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Non-global variables are assigned to the plugin in the ''getContents()'' function of the plugin's class file.&amp;#160; Your myPlugin class does not have one, so you'll have to create one to be able to assign &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;variables &lt;/ins&gt;to your plugin.&amp;#160; Here is a basic example:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;function getContents(&amp;amp;$templateMgr) {&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;function getContents(&amp;amp;$templateMgr) {&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Mcrider</name></author>	</entry>

	<entry>
		<id>http://pkp-www.lib.sfu.ca:8084/wiki/index.php?title=Writing_a_Block_Plugin&amp;diff=759&amp;oldid=prev</id>
		<title>Mcrider at 19:05, 3 April 2009</title>
		<link rel="alternate" type="text/html" href="http://pkp-www.lib.sfu.ca:8084/wiki/index.php?title=Writing_a_Block_Plugin&amp;diff=759&amp;oldid=prev"/>
				<updated>2009-04-03T19:05:21Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr style='vertical-align: top;'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 19:05, 3 April 2009&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 39:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 39:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;===Advanced Block Plugins===&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;===Advanced Block Plugins===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Making dynamic block plugins will require some knowledge of Smarty and also probably some PHP.&amp;#160; Your best source of information is the other block plugins--A good next step is to look at the user block plugin.&amp;#160; The block.tpl file in that directory provides examples of how to create links to other pages in your system using the Smarty {url} function, and also how to use template variables that have been assigned to the template.&amp;#160; &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Making dynamic block plugins will require some knowledge of Smarty and also probably some PHP.&amp;#160; Your best source of information is the other block plugins--A good next step is to look at the &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;''&lt;/ins&gt;user&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;'' &lt;/ins&gt;block plugin.&amp;#160; The block.tpl file in that directory provides examples of how to create links to other pages in your system using the Smarty {url} function, and also how to use template variables that have been assigned to the template.&amp;#160; &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;For example, a commonly used template variable is ''$isUserLoggedIn''.&amp;#160; This variable is global, or assigned to all templates in the constructor function of ''classes/template/TemplateManger.inc.php''.&amp;#160; You can look through that function to find other global template variables by looking at other assigned variables in that function.&amp;#160; &amp;#160; &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;For example, a commonly used template variable is ''$isUserLoggedIn''.&amp;#160; This variable is global, or assigned to all templates in the constructor function of ''classes/template/TemplateManger.inc.php''.&amp;#160; You can look through that function to find other global template variables by looking at other assigned variables in that function.&amp;#160; &amp;#160; &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Mcrider</name></author>	</entry>

	<entry>
		<id>http://pkp-www.lib.sfu.ca:8084/wiki/index.php?title=Writing_a_Block_Plugin&amp;diff=758&amp;oldid=prev</id>
		<title>Mcrider at 19:02, 3 April 2009</title>
		<link rel="alternate" type="text/html" href="http://pkp-www.lib.sfu.ca:8084/wiki/index.php?title=Writing_a_Block_Plugin&amp;diff=758&amp;oldid=prev"/>
				<updated>2009-04-03T19:02:36Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr style='vertical-align: top;'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 19:02, 3 April 2009&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;===Introduction===&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;===Introduction===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;In recent versions of OJS and OCS, the content in the sidebars of each page is comprised of block plugins, allowing users to move each block around the page using the setup interface (instead of having to modify the template code).&amp;#160; Each block, or piece of content, exists as its own directory in the plugins/blocks/ directory, and creating a new block is as easy as duplicating an existing directory and customizing its contents.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;In recent versions of OJS and OCS, the content in the sidebars of each page is comprised of block plugins, allowing users to move each block around the page using the setup interface (instead of having to modify the template code).&amp;#160; Each block, or piece of content, exists as its own directory in the &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;''&lt;/ins&gt;plugins/blocks/&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;'' &lt;/ins&gt;directory, and creating a new block is as easy as duplicating an existing directory and customizing its contents.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;For simple block plugins that only contain HTML and images, we recommend using Juan Pablo Alperin's excellent [http://pkp.sfu.ca/support/forum/viewtopic.php?f=28&amp;amp;t=3459&amp;amp;p=12801&amp;amp;hilit=blocks#p12801 Custom Block Manager] that automates the process of creating simple block plugins.&amp;#160; For educational purposes, this guide will continue to describe how to create a simple block plugin by hand, then give some tips on making your block more dynamic and powerful.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;For simple block plugins that only contain HTML and images, we recommend using Juan Pablo Alperin's excellent [http://pkp.sfu.ca/support/forum/viewtopic.php?f=28&amp;amp;t=3459&amp;amp;p=12801&amp;amp;hilit=blocks#p12801 Custom Block Manager] that automates the process of creating simple block plugins.&amp;#160; For educational purposes, this guide will continue to describe how to create a simple block plugin by hand, then give some tips on making your block more dynamic and powerful.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 10:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 10:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;The simplest block plugin to start off with is the ''developedBy'' plugin.&amp;#160; To create your new block, duplicate the developedBy directory in ''plugins/blocks/'' and rename it to whatever you like (let's call it ''myPlugin'').&amp;#160; Then make the following modifications:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;The simplest block plugin to start off with is the ''developedBy'' plugin.&amp;#160; To create your new block, duplicate the developedBy directory in ''plugins/blocks/'' and rename it to whatever you like (let's call it ''myPlugin'').&amp;#160; Then make the following modifications:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;# Rename ''DevelopedByBlockPlugin.inc.php'' to ''&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;MyPlugin&lt;/del&gt;.inc.php''.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;# Rename ''DevelopedByBlockPlugin.inc.php'' to ''&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;MyPluginBlockPlugin&lt;/ins&gt;.inc.php''.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;# Open ''MyPluginBlockPlugin.inc.php'' and make the following adjustments:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;# Open ''MyPluginBlockPlugin.inc.php'' and make the following adjustments:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;#* Edit the comments at the top of the file to reflect your new plugin name, e.g.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;#* Edit the comments at the top of the file to reflect your new plugin name, e.g.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Mcrider</name></author>	</entry>

	<entry>
		<id>http://pkp-www.lib.sfu.ca:8084/wiki/index.php?title=Writing_a_Block_Plugin&amp;diff=757&amp;oldid=prev</id>
		<title>Mcrider at 18:40, 3 April 2009</title>
		<link rel="alternate" type="text/html" href="http://pkp-www.lib.sfu.ca:8084/wiki/index.php?title=Writing_a_Block_Plugin&amp;diff=757&amp;oldid=prev"/>
				<updated>2009-04-03T18:40:44Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr style='vertical-align: top;'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 18:40, 3 April 2009&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 13:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 13:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;# Open ''MyPluginBlockPlugin.inc.php'' and make the following adjustments:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;# Open ''MyPluginBlockPlugin.inc.php'' and make the following adjustments:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;#* Edit the comments at the top of the file to reflect your new plugin name, e.g.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;#* Edit the comments at the top of the file to reflect your new plugin name, e.g.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;#:&amp;lt;pre&amp;gt;@file MyPluginBlockPlugin.inc.php&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;#:&amp;lt;pre&amp;gt; &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;#160; &lt;/ins&gt;@file MyPluginBlockPlugin.inc.php&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;#:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;#:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;#:Copyright (c) 2009 George Clinton&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;#:Copyright (c) 2009 George Clinton&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 32:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 32:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;#* Change the ''displayName'' and ''description'' values as appropriate.&amp;#160; If you want to add new text to your plugin, you can add new message keys and values here, and reference them in your templates using the Smarty {translate} function.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;#* Change the ''displayName'' and ''description'' values as appropriate.&amp;#160; If you want to add new text to your plugin, you can add new message keys and values here, and reference them in your templates using the Smarty {translate} function.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;#* Repeat the process for any other languages you can translate to.&amp;#160; If you can't translate the plugin to a particular language, it is best to delete the directory for that language so that users of that language will not see incorrect information.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;#* Repeat the process for any other languages you can translate to.&amp;#160; If you can't translate the plugin to a particular language, it is best to delete the directory for that language so that users of that language will not see incorrect information.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;#Don't worry about &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;'&lt;/del&gt;''settings.xml&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;'&lt;/del&gt;'', it should be fine as it is.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;#Don't worry about ''settings.xml'', it should be fine as it is.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;#Open up ''plugins/block/myPlugin/block.tpl'' -- This is the Smarty template that will display the content of your plugin.&amp;#160; You can pretty much write straight HTML in here, but you can also harness the power of Smarty (http://www.smarty.net), which is necessary for e.g. localizing the text of the plugin (using the {translate} function).&amp;#160; For any dynamic content, you will have to make use of smarty functions and template variables, and likely also some PHP (introduced in the next section).&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;#Open up ''plugins/block/myPlugin/block.tpl'' -- This is the Smarty template that will display the content of your plugin.&amp;#160; You can pretty much write straight HTML in here, but you can also harness the power of Smarty (http://www.smarty.net), which is necessary for e.g. localizing the text of the plugin (using the {translate} function).&amp;#160; For any dynamic content, you will have to make use of smarty functions and template variables, and likely also some PHP (introduced in the next section).&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Mcrider</name></author>	</entry>

	<entry>
		<id>http://pkp-www.lib.sfu.ca:8084/wiki/index.php?title=Writing_a_Block_Plugin&amp;diff=756&amp;oldid=prev</id>
		<title>Mcrider at 17:48, 3 April 2009</title>
		<link rel="alternate" type="text/html" href="http://pkp-www.lib.sfu.ca:8084/wiki/index.php?title=Writing_a_Block_Plugin&amp;diff=756&amp;oldid=prev"/>
				<updated>2009-04-03T17:48:53Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr style='vertical-align: top;'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 17:48, 3 April 2009&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 20:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 20:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;#:@class MyPluginBlockPlugin&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;#:@class MyPluginBlockPlugin&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;#:@ingroup plugins_blocks_myPlugin&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;#:@ingroup plugins_blocks_myPlugin&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;#:&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;#:@brief Class for &amp;quot;myPlugin&amp;quot; block plugin&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;#:@brief Class for &amp;quot;myPlugin&amp;quot; block plugin&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;#*Change the class name from ''DevelopedByBlockPlugin'' to ''MyPluginBlockPlugin''&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;#*Change the class name from ''DevelopedByBlockPlugin'' to ''MyPluginBlockPlugin''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Mcrider</name></author>	</entry>

	<entry>
		<id>http://pkp-www.lib.sfu.ca:8084/wiki/index.php?title=Writing_a_Block_Plugin&amp;diff=755&amp;oldid=prev</id>
		<title>Mcrider at 17:27, 3 April 2009</title>
		<link rel="alternate" type="text/html" href="http://pkp-www.lib.sfu.ca:8084/wiki/index.php?title=Writing_a_Block_Plugin&amp;diff=755&amp;oldid=prev"/>
				<updated>2009-04-03T17:27:52Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr style='vertical-align: top;'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 17:27, 3 April 2009&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;=&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;OJS Block Plugin Development Guide&lt;/del&gt;=&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;==&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;=&lt;/ins&gt;Introduction&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;===&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;'''&lt;/del&gt;Introduction&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;'''&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;In recent versions of OJS and OCS, the content in the sidebars of each page is comprised of block plugins, allowing users to move each block around the page using the setup interface (instead of having to modify the template code).&amp;#160; Each block, or piece of content, exists as its own directory in the plugins/blocks/ directory, and creating a new block is as easy as duplicating an existing directory and customizing its contents.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;In recent versions of OJS and OCS, the content in the sidebars of each page is comprised of block plugins, allowing users to move each block around the page using the setup interface (instead of having to modify the template code).&amp;#160; Each block, or piece of content, exists as its own directory in the plugins/blocks/ directory, and creating a new block is as easy as duplicating an existing directory and customizing its contents.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 9:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 7:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Note: These instructions reference OJS, but are just as applicable to OCS and Harvester.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Note: These instructions reference OJS, but are just as applicable to OCS and Harvester.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;'''&lt;/del&gt;A Basic Block Plugin&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;'''&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;===&lt;/ins&gt;A Basic Block Plugin&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;===&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;The simplest block plugin to start off with is the ''developedBy'' plugin.&amp;#160; To create your new block, duplicate the developedBy directory in ''plugins/blocks/'' and rename it to whatever you like (let's call it ''myPlugin'').&amp;#160; Then make the following modifications:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;The simplest block plugin to start off with is the ''developedBy'' plugin.&amp;#160; To create your new block, duplicate the developedBy directory in ''plugins/blocks/'' and rename it to whatever you like (let's call it ''myPlugin'').&amp;#160; Then make the following modifications:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 40:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 38:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Start up OJS, go to Journal Setup Step 5.6, and ensure that your plugin exists in the list and is in the right vertical position.&amp;#160; Behold, your first OJS plugin!&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Start up OJS, go to Journal Setup Step 5.6, and ensure that your plugin exists in the list and is in the right vertical position.&amp;#160; Behold, your first OJS plugin!&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;'''&lt;/del&gt;Advanced Block Plugins&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;'''&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;===&lt;/ins&gt;Advanced Block Plugins&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;===&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Making dynamic block plugins will require some knowledge of Smarty and also probably some PHP.&amp;#160; Your best source of information is the other block plugins--A good next step is to look at the user block plugin.&amp;#160; The block.tpl file in that directory provides examples of how to create links to other pages in your system using the Smarty {url} function, and also how to use template variables that have been assigned to the template.&amp;#160; &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Making dynamic block plugins will require some knowledge of Smarty and also probably some PHP.&amp;#160; Your best source of information is the other block plugins--A good next step is to look at the user block plugin.&amp;#160; The block.tpl file in that directory provides examples of how to create links to other pages in your system using the Smarty {url} function, and also how to use template variables that have been assigned to the template.&amp;#160; &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Mcrider</name></author>	</entry>

	<entry>
		<id>http://pkp-www.lib.sfu.ca:8084/wiki/index.php?title=Writing_a_Block_Plugin&amp;diff=754&amp;oldid=prev</id>
		<title>Mcrider: New page: =OJS Block Plugin Development Guide=  '''Introduction'''  In recent versions of OJS and OCS, the content in the sidebars of each page is comprised of block plugins, allowing users to move ...</title>
		<link rel="alternate" type="text/html" href="http://pkp-www.lib.sfu.ca:8084/wiki/index.php?title=Writing_a_Block_Plugin&amp;diff=754&amp;oldid=prev"/>
				<updated>2009-04-03T17:27:09Z</updated>
		
		<summary type="html">&lt;p&gt;New page: =OJS Block Plugin Development Guide=  &amp;#039;&amp;#039;&amp;#039;Introduction&amp;#039;&amp;#039;&amp;#039;  In recent versions of OJS and OCS, the content in the sidebars of each page is comprised of block plugins, allowing users to move ...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;=OJS Block Plugin Development Guide=&lt;br /&gt;
&lt;br /&gt;
'''Introduction'''&lt;br /&gt;
&lt;br /&gt;
In recent versions of OJS and OCS, the content in the sidebars of each page is comprised of block plugins, allowing users to move each block around the page using the setup interface (instead of having to modify the template code).  Each block, or piece of content, exists as its own directory in the plugins/blocks/ directory, and creating a new block is as easy as duplicating an existing directory and customizing its contents.&lt;br /&gt;
&lt;br /&gt;
For simple block plugins that only contain HTML and images, we recommend using Juan Pablo Alperin's excellent [http://pkp.sfu.ca/support/forum/viewtopic.php?f=28&amp;amp;t=3459&amp;amp;p=12801&amp;amp;hilit=blocks#p12801 Custom Block Manager] that automates the process of creating simple block plugins.  For educational purposes, this guide will continue to describe how to create a simple block plugin by hand, then give some tips on making your block more dynamic and powerful.&lt;br /&gt;
&lt;br /&gt;
Note: These instructions reference OJS, but are just as applicable to OCS and Harvester.&lt;br /&gt;
&lt;br /&gt;
'''A Basic Block Plugin'''&lt;br /&gt;
&lt;br /&gt;
The simplest block plugin to start off with is the ''developedBy'' plugin.  To create your new block, duplicate the developedBy directory in ''plugins/blocks/'' and rename it to whatever you like (let's call it ''myPlugin'').  Then make the following modifications:&lt;br /&gt;
# Rename ''DevelopedByBlockPlugin.inc.php'' to ''MyPlugin.inc.php''.&lt;br /&gt;
# Open ''MyPluginBlockPlugin.inc.php'' and make the following adjustments:&lt;br /&gt;
#* Edit the comments at the top of the file to reflect your new plugin name, e.g.&lt;br /&gt;
#:&amp;lt;pre&amp;gt;@file MyPluginBlockPlugin.inc.php&lt;br /&gt;
#:&lt;br /&gt;
#:Copyright (c) 2009 George Clinton&lt;br /&gt;
#:Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.&lt;br /&gt;
#:&lt;br /&gt;
#:@class MyPluginBlockPlugin&lt;br /&gt;
#:@ingroup plugins_blocks_myPlugin&lt;br /&gt;
#:&lt;br /&gt;
#:@brief Class for &amp;quot;myPlugin&amp;quot; block plugin&amp;lt;/pre&amp;gt;&lt;br /&gt;
#*Change the class name from ''DevelopedByBlockPlugin'' to ''MyPluginBlockPlugin''&lt;br /&gt;
#*Change the return value of the ''getName()'' function from ''DevelopedByBlockPlugin'' to ''MyPluginBlockPlugin''&lt;br /&gt;
#*Change the return value of the ''getDisplayName()'' and ''getDescription()'' functions from ''plugins.block.developedBy.x'' to ''plugins.block.myPlugin.x''&lt;br /&gt;
# Modify ''plugins/blocks/myPlugin/index.php''&lt;br /&gt;
#* Change the comments so they reflect the modifications in ''MyPluginBlockPlugin.inc.php''&lt;br /&gt;
#* Change ''require_once('DevelopedByBlockPlugin.inc.php');'' to ''require_once('MyPluginBlockPlugin.inc.php');''&lt;br /&gt;
#* Change ''return new DevelopedByBlockPlugin();'' to ''return new MyPluginBlockPlugin();'''&lt;br /&gt;
# Change the locale files for the plugin.  Assuming you want it in English, open ''plugins/block/myPlugin/locale/en_US/locale.xml''&lt;br /&gt;
#* Change the locale keys from ''plugins.block.developedBy.x'' to ''plugins.block.myPlugin.x''&lt;br /&gt;
#* Change the ''displayName'' and ''description'' values as appropriate.  If you want to add new text to your plugin, you can add new message keys and values here, and reference them in your templates using the Smarty {translate} function.&lt;br /&gt;
#* Repeat the process for any other languages you can translate to.  If you can't translate the plugin to a particular language, it is best to delete the directory for that language so that users of that language will not see incorrect information.&lt;br /&gt;
#Don't worry about '''settings.xml''', it should be fine as it is.&lt;br /&gt;
#Open up ''plugins/block/myPlugin/block.tpl'' -- This is the Smarty template that will display the content of your plugin.  You can pretty much write straight HTML in here, but you can also harness the power of Smarty (http://www.smarty.net), which is necessary for e.g. localizing the text of the plugin (using the {translate} function).  For any dynamic content, you will have to make use of smarty functions and template variables, and likely also some PHP (introduced in the next section).&lt;br /&gt;
&lt;br /&gt;
Start up OJS, go to Journal Setup Step 5.6, and ensure that your plugin exists in the list and is in the right vertical position.  Behold, your first OJS plugin!&lt;br /&gt;
&lt;br /&gt;
'''Advanced Block Plugins'''&lt;br /&gt;
&lt;br /&gt;
Making dynamic block plugins will require some knowledge of Smarty and also probably some PHP.  Your best source of information is the other block plugins--A good next step is to look at the user block plugin.  The block.tpl file in that directory provides examples of how to create links to other pages in your system using the Smarty {url} function, and also how to use template variables that have been assigned to the template.  &lt;br /&gt;
&lt;br /&gt;
For example, a commonly used template variable is ''$isUserLoggedIn''.  This variable is global, or assigned to all templates in the constructor function of ''classes/template/TemplateManger.inc.php''.  You can look through that function to find other global template variables by looking at other assigned variables in that function.    &lt;br /&gt;
&lt;br /&gt;
Non-global variables are assigned to the plugin in the ''getContents()'' function of the plugin's class file.  Your myPlugin class does not have one, so you'll have to create one to be able to assign plugins to your plugin.  Here is a basic example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;function getContents(&amp;amp;$templateMgr) {&lt;br /&gt;
	$templateMgr-&amp;gt;assign('isAdmin', Validation::isSiteAdmin());&lt;br /&gt;
	return parent::getContents($templateMgr);&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
You can now call the ''$isAdmin'' variable anywhere in your block.tpl template, for example&lt;br /&gt;
&amp;lt;pre&amp;gt;{if $isAdmin}&lt;br /&gt;
	&amp;lt;h1&amp;gt;Smile, you're an admin!&amp;lt;/h1&amp;gt;&lt;br /&gt;
{/if}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
More complex assignments will require a deeper knowledge of OJS.  Consult the various technical guides, API references, and source code for more information on that.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We hope that you will choose to share your plugin with the rest of the community--Please upload them to the [http://pkp.sfu.ca/support/forum/viewforum.php?f=28 plugin gallery]!&lt;/div&gt;</summary>
		<author><name>Mcrider</name></author>	</entry>

	</feed>