<?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>Dwight Jack Diary &#187; Joomla 1.5</title>
	<atom:link href="http://www.dwightjack.com/diary/tag/joomla-15/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dwightjack.com/diary</link>
	<description>Diary of music, design and code</description>
	<lastBuildDate>Tue, 13 Jul 2010 20:46:53 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Using multiple templates&#8217; overrides in Joomla 1.5 modules</title>
		<link>http://www.dwightjack.com/diary/2009/09/20/multiple-templates-overrides-joomla-modules/</link>
		<comments>http://www.dwightjack.com/diary/2009/09/20/multiple-templates-overrides-joomla-modules/#comments</comments>
		<pubDate>Sun, 20 Sep 2009 18:00:48 +0000</pubDate>
		<dc:creator>Dwight Jack</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[joomla]]></category>
		<category><![CDATA[Joomla 1.5]]></category>
		<category><![CDATA[modules]]></category>
		<category><![CDATA[template override]]></category>

		<guid isPermaLink="false">http://www.dwightjack.com/diary/?p=227</guid>
		<description><![CDATA[Step by step tutorial on adding a custom joomla module parameter type to apply different template's overrides on a module in a per-instance style with minumum hacks.]]></description>
			<content:encoded><![CDATA[<p>One of most usefull feature in Joomla 1.5 is the ability to quickly customize the HTML output of a module by using <strong>template overrides</strong> (see <a href="http://docs.joomla.org/How_to_override_the_output_from_the_Joomla!_core" target="_blank">here</a> for details).</p>
<p>The only problem is that, once you have coded an override for a module, it&#8217;ll be used for all module&#8217;s instances within the CMS. The issue here is that you might want to output one module in a column as just a simple list of links AND in the main body as a content-rich table.</p>
<p>This problem can be addressed <strong>with a module hack and the addition of a new backend parameter type</strong> (for 1.5 native modules only), both in a system wide or module specific way . Here is a step by step tutorial:</p>
<h3>Adding a new parameter to the module</h3>
<p>Joomla 1.5 features a native way to add backend parameter types beside the <a href="http://docs.joomla.org/Standard_parameter_types" target="_blank">native ones</a>. In our case i&#8217;ve realized a new element (parameter) file which will look if a template override folder exists for the spefic module and, if found, will list all PHP files whose name is prefixed with &#8220;<code>custom_</code>&#8221; . You can download the file <a href=http://www.dwightjack.com/diary/wp-content/plugins/download-monitor/download.php?id=14>here</a>.</p>
<p>Now you&#8217;ll need to place this file inside a folder called element, then open the .xml configuration file of the module and search for the <code>&lt;params&gt;</code> opening tag. Replace it with the following code (<code>YOURMODULENAME</code> is the module name):</p>
<pre><code>&lt;params addpath="/modules/mod_YOURMODULENAME/element"&gt;</code></pre>
<p>Now place the new parameter as the last child of the <code>&lt;params&gt;</code> tag:</p>
<pre><code>&lt;param name="template" type="customtemplates" modulename="mod_YOURMODULENAME" default="default" label="Custom template" description="Use this custom template file" /&gt;</code></pre>
<h3>Hacking the main PHP module file</h3>
<p>To make the module fully aware of the new template you choose, you need to pass the customtemplates paramenter to the static method which retrieves the template. For instance let&#8217;s say your <code>mod_mymodule.php</code> file has a line like this:</p>
<pre><code>require( JModuleHelper::getLayoutPath( 'mod_mymodule') );</code></pre>
<p>Now provide the <code>customtemplates</code> parameter by changing the line to:</p>
<pre><code>require( JModuleHelper::getLayoutPath( 'mod_mymodule',<span style="color: #ff0000;">$params-&gt;get('template','default')</span> ) );</code></pre>
<h3>Done!</h3>
<p>Untill no custom template&#8217;s overrides are found, the default template (default for the module or the default override if present) will be used. Once you&#8217;ll create a <code>custom_whatever.php</code> template file it&#8217;ll show up in the select list.</p>
<h3>Adding the new parameter system-wide</h3>
<p>By adding the parameter as a native-like parameter, you&#8217;ll be able to use it on all module without calling it in the &lt;params&gt; tag.</p>
<p>To add the paramenter system-wide you just have to place the <code>customtemplates.php</code> element in the /libraries/joomla/html/parameter/element folder. Since this is a custom element you shouldn&#8217;t have any problem on CMS upgrades.</p>
<h3>The drawback</h3>
<p>There&#8217;s a major drawback for this solution: since you are going to modify some module&#8217;s file you&#8217;ll need to keep a copy of them to prevent future upgrades from removing your changes (and breaking your template).</p>
<h3>Further readings</h3>
<p>Joomla has a really flexible parameter system, underused by many developers. Here are a couple of further reading to understand how parameters can help your everyday Joomla coding:</p>
<ul>
<li><a href="http://docs.joomla.org/Component_parameters#Types_of_Component_parameter" target="_blank">Joomla Docs: Component parameters</a></li>
<li><a href="http://www.teachmejoomla.net/code/joomla-1.5/joomla-php-developer-extending-config.xml-with-plugins.html" target="_blank">Joomla PHP: extending config.xml with plugins</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.dwightjack.com/diary/2009/09/20/multiple-templates-overrides-joomla-modules/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Update: Use MooTools v1.2.x in Joomla! 1.5</title>
		<link>http://www.dwightjack.com/diary/2009/06/07/use-mootools-122-in-joomla-15/</link>
		<comments>http://www.dwightjack.com/diary/2009/06/07/use-mootools-122-in-joomla-15/#comments</comments>
		<pubDate>Sun, 07 Jun 2009 14:39:40 +0000</pubDate>
		<dc:creator>Dwight Jack</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[joomla]]></category>
		<category><![CDATA[Joomla 1.5]]></category>
		<category><![CDATA[Mootools]]></category>

		<guid isPermaLink="false">http://www.dwightjack.com/diary/?p=167</guid>
		<description><![CDATA[This is an updated version of the code to switch Mootools from 1.11 to 1.2 in Joomla 1.5]]></description>
			<content:encoded><![CDATA[<p>Since i&#8217;ve fixed some bugs and issues on the files to switch core MooTools v1.11 to v1.2.x and following the release of version <span style="text-decoration: line-through;">1.2.2</span> 1.2.3 of <strong>MooTools Core and More</strong>, i&#8217;m posting here an updated version of<a title="Upgrade Mootools to v1.2.x in Joomla! 1.5" href="http://www.dwightjack.com/diary/2009/02/23/upgrade-mootools-to-v12x-in-joomla-15/"> <strong>this workaround</strong></a> to which you could refer for details on how this code works.</p>
<p>Changes in this new version are:</p>
<ol>
<li>Updated MooTools Core to<span style="text-decoration: line-through;"> <strong>1.2.2</strong></span><strong> 1.2.3</strong> and MooTools More to<span style="text-decoration: line-through;"> </span><strong><span style="text-decoration: line-through;">1.2.2.2</span> 1.2.3.1<br />
 </strong></li>
<li>Added <code>.getValue()</code> to the compatibility file</li>
<li>Added <code>.getSelected()</code> to the compatibility file to fix some issues under IE</li>
<li>Added <code>Json</code> support to the compatibility file</li>
<li>Added <code>window.onDomReady</code> shortcut for DOM ready event</li>
<li>Changed <code class="php">MY_Behavior::mootoolsFix();</code> to handle new MooTools files <code class="php"></code></li>
<li>Changed <code class="php">MY_Behavior::mootoolsFix();</code> to correctly render old tooltips format <code>title::text</code> for items with <code>hasTip</code> class (anyway, remember that classes to style the tooltip <a href="http://mootools.net/docs/more/Interface/Tips#Tips:constructor" target="_blank">have changed</a>!)</li>
<li><span style="text-decoration: line-through;">Added a <strong>validate.js</strong> replacement to fix an issue with <a href="http://www.dwightjack.com/diary/2009/02/23/upgrade-mootools-to-v12x-in-joomla-15/comment-page-1/#comment-167" target="_blank">changed namespaces</a>.</span> ( this replacement is no more needed)<span style="text-decoration: line-through;"><br />
 </span></li>
</ol>
<p>The source code is released in the form of patch: unzip it and upload files in your Joomla root, eventually overwriting files. MooTools library is uncompressed to allow for a quicker debug. Anyway you may minify it with your tool of choice.</p>
<p><span style="text-decoration: line-through;">Here is the code: <a href=http://www.dwightjack.com/diary/wp-content/plugins/download-monitor/download.php?id=10>Mootools 1.11 to 1.2.2 (71.68 kB)</a></span></p>
<p><strong>Update (again):</strong> Sometimes i can&#8217;t get if MooTools team is too vital or library milestones are not well defined&#8230; anyway here is an update to use <strong>latest MooTools</strong><strong> 1.2.3</strong>. No major changes have been made to the fix library, anyway keep reporting compatibility issues. Here is the zipped  file: <span style="text-decoration: line-through;"><a href=http://www.dwightjack.com/diary/wp-content/plugins/download-monitor/download.php?id=13>Mootools 1.11 to 1.2.3 for Joomla 1.5 (72.06 kB)</a></span></p>
<p><strong>Update (09/20/09): </strong>New version available. Corrected some bugs in the compatibility file and added a loop check to replace MooTools 1.11 when called from a component as custom script. Now the validation core script doesn&#8217;t need to be replaced. Get source here (carries the original validate.js as in Joomla 1.5.14:  <a href=http://www.dwightjack.com/diary/wp-content/plugins/download-monitor/download.php?id=15>MooTools 1.11 to 1.2.x (72.88 kB)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dwightjack.com/diary/2009/06/07/use-mootools-122-in-joomla-15/feed/</wfw:commentRss>
		<slash:comments>62</slash:comments>
		</item>
		<item>
		<title>Joomla 1.5: Filter mambots and plugins&#8217; codes in PDF and print view</title>
		<link>http://www.dwightjack.com/diary/2009/05/19/joomla-filter-mambots-and-plugins-codes-in-pdf-print-view/</link>
		<comments>http://www.dwightjack.com/diary/2009/05/19/joomla-filter-mambots-and-plugins-codes-in-pdf-print-view/#comments</comments>
		<pubDate>Tue, 19 May 2009 19:28:36 +0000</pubDate>
		<dc:creator>Dwight Jack</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[com_content]]></category>
		<category><![CDATA[joomla]]></category>
		<category><![CDATA[Joomla 1.5]]></category>
		<category><![CDATA[joomla plugin]]></category>

		<guid isPermaLink="false">http://www.dwightjack.com/diary/?p=156</guid>
		<description><![CDATA[Here is an effective and hack-free way to remove mambots and plugins' codes from your content in PDF and print view.]]></description>
			<content:encoded><![CDATA[<p>One of the coolest feature in Joomla content editor is the ability to insert specific modules&#8217; position whereaver you want. This is particularly usefull to load  inline banners or to add quick polls to an article/page just by inserting <code>{loadposition mypostion}</code> in your editor textarea.</p>
<p>In Joomla 1.5.x everything works fine when viewing the page as HTML, but in <strong>PDF and print friendly format</strong> view these shortcodes aren&#8217;t converted nor removed. Moreover displaying these contents could be unnecessary or unwanted.</p>
<p>This problem arise because in pdf and print view files in Joomla <code>com_content</code> component not all content plugins (those addons called <em>mambots</em>) are loaded. In PDF view file <code>components/com_content/views/article/view.pdf.php</code> there&#8217;s just one plugin (called <em>image</em>) loaded before the content is outputted (lines 68 -69):</p>
<pre><code>JPluginHelper::importPlugin('content', 'image');
$dispatcher-&gt;trigger('onPrepareContent', array (&amp; $article, &amp; $params, 0));</code></pre>
<h3>The (dirty) solution</h3>
<p>From a quick glance in the <code>plugins/content</code> folder i&#8217;ve noticed that there&#8217;s no any <code>image.php</code> plugin  file in a clean Joomla 1.5.10 installation. So i&#8217;ve decided to use this <em>hole</em> and create a custom plugin to clean my content without messing up the core <code>com_content</code> code.</p>
<p>After installing the plugin and activating it you are given (at the moment) two options:</p>
<ul>
<li> a radio to clean loadposition code (defaults to <code>Yes</code>)</li>
<li>a textarea for typing custom regular expressions (one per line).</li>
</ul>
<p>In this last field remember to omit backslashes (/) instead write curly brackets, for example <code>{code\s*[a-zA-Z]}</code></p>
<p>Here is the package for download: <a href=http://www.dwightjack.com/diary/wp-content/plugins/download-monitor/download.php?id=8>plg_image (clean plugins code) (1.79 kB)</a></p>
<p>As always feedbacks and suggestions are welcome.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dwightjack.com/diary/2009/05/19/joomla-filter-mambots-and-plugins-codes-in-pdf-print-view/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Fixing PDF button error with SEF in Joomla 1.5</title>
		<link>http://www.dwightjack.com/diary/2009/04/17/fixing-pdf-button-error-sef-joomla/</link>
		<comments>http://www.dwightjack.com/diary/2009/04/17/fixing-pdf-button-error-sef-joomla/#comments</comments>
		<pubDate>Fri, 17 Apr 2009 15:59:43 +0000</pubDate>
		<dc:creator>Dwight Jack</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[joomla]]></category>
		<category><![CDATA[Joomla 1.5]]></category>
		<category><![CDATA[SH404SEF]]></category>

		<guid isPermaLink="false">http://www.dwightjack.com/diary/?p=143</guid>
		<description><![CDATA[One of the weirdest error in Joomla 1.5 is that just turning SEF on makes PDF button stop working in content articles.
This happens with both system and 3rd party components.]]></description>
			<content:encoded><![CDATA[<p>One of the weirdest error in Joomla 1.5 is that just turning SEF on makes PDF button stop working in content articles.<br />
This happens with both system and 3rd party components.</p>
<p>I&#8217;ve recently digged the problem and found that this could be related (kinda randomly) to a bunch of problems and conflicts with other Joomla feature (such as system cache).</p>
<p>In my own projects im using right now <strong>SH404SEF</strong> as SEF component and i&#8217;ve found it&#8217;s a really good piece of software, so here is a recap of the fix/patch for the problem.</p>
<p>First of all <a href="http://extensions.siliana.com/en/Table/sh404SEF-and-url-rewriting/" target="_blank">upgrade SH404</a> to the latest release by downloading it from <a href="http://joomlacode.org/gf/project/sh404sef/frs/" target="_blank">JoomlaCode</a>.</p>
<p>Now open <code>custom.sef.php</code> in <code>administrator/components/com_sh404sef/</code> and search for a line containing:</p>
<pre><code>$shDefaultParams['sh404SEF_PROTECT_AGAINST_DOCUMENT_TYPE_ERROR'] = 0;</code></pre>
<p>and set the paramenter to 1:</p>
<pre><code>$shDefaultParams['sh404SEF_PROTECT_AGAINST_DOCUMENT_TYPE_ERROR'] = 1;</code></pre>
<p>If this line is not present then add it at the end of the file.</p>
<p>Now go to the backend panel in Joomla and purge all SEF url by<em><strong>:</strong></em><strong><em><br />
Components -&gt; SH404SEF -&gt; Purge SEF Urls<br />
</em></strong>then clear the cache by:<br />
<strong><em>Tools -&gt; Clean Cache</em></strong></p>
<p>This will clear all current URLs, so that SH404SEF has to recreate them, anyway your PDF button should work again and the PDF URLs should be as the HTML one with an ending parameter <code>?format=pdf</code>.</p>
<p>Source: <a href="http://extensions.siliana.com/forums/index.php?topic=9509.0" target="_blank">http://extensions.siliana.com/forums/index.php?topic=9509.0</a></p>
<p><em>Note: As a side effect you shouldn&#8217;t problably be able to use the pdf folder feature to store custom PDFs!</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dwightjack.com/diary/2009/04/17/fixing-pdf-button-error-sef-joomla/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Upgrade Mootools to v1.2.x  in Joomla! 1.5</title>
		<link>http://www.dwightjack.com/diary/2009/02/23/upgrade-mootools-to-v12x-in-joomla-15/</link>
		<comments>http://www.dwightjack.com/diary/2009/02/23/upgrade-mootools-to-v12x-in-joomla-15/#comments</comments>
		<pubDate>Mon, 23 Feb 2009 21:10:21 +0000</pubDate>
		<dc:creator>Dwight Jack</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Joomla 1.5]]></category>
		<category><![CDATA[Mootools]]></category>

		<guid isPermaLink="false">http://www.dwightjack.com/diary/?p=101</guid>
		<description><![CDATA[A test case on adding Mootools 1.2 support to current Joomla 1.5.9 release.]]></description>
			<content:encoded><![CDATA[<p>Joomla 1.5 is for sure a great CMS: it features lot of extensions, a rather clean XHTML output and its framework API is really powerfull. Moreover it&#8217;s built with MVC logic in mind, enabling web designers to use template overrides in their themes.</p>
<p>Despite all these advanced features Joomla 1.5 is still stuck at JS framework <strong>Mootools 1.11</strong>. The latest version of this framework, 1.2.x, introduced many new features and a complete re-engineered code. Due to these changes, Joomla developers plan to upgrade Mootools in the 1.6 release, to be able to spread code changes to all plugins, modules and components. Until that release we&#8217;ll be stuck at outdated, unsupported and often undocumented code.</p>
<p>This is an attempt to add <strong><a href="http://mootools.net/">Mootools 1.2</a></strong> support to current Joomla 1.5.9 release. Let&#8217;s start:</p>
<p><strong>Update:</strong> A new version of files presented in this post is available <strong><a href="http://www.dwightjack.com/diary/2009/06/07/use-mootools-122-in-joomla-15/" target="_blank">here</a></strong>!</p>
<h3>Requirements:</h3>
<ol>
<li>Nearly full compatibility with Mootools 1.11 to avoid errors</li>
<li>Upgrade of Mootools plugins where possibile</li>
<li>None or minimal Joomla core hacks</li>
<li>Implementation of Mootools in legacy (1.0.x) components</li>
</ol>
<h3>1. Smooth Mootools upgrade.</h3>
<p>First of all let&#8217;s download the latest version of <strong>Mootools Core and Mootools More</strong> (right now 1.2.1):<a href=http://www.dwightjack.com/diary/wp-content/plugins/download-monitor/download.php?id=4>Mootools 1.2.1 Full (28.51 kB)</a></p>
<p>Unzip the archive and place the two files in <code>media/system/js/</code></p>
<p>Then download this compatibility file, which will make old 1.11 scripts work rather smoothly with the new framework, and place it in the same folder as above (<em>update 05/22/09 added getValue, Json and window.onDomReady compatibility, thanx <a href="http://www.dwightjack.com/diary/2009/02/23/upgrade-mootools-to-v12x-in-joomla-15/comment-page-1/#comment-163">Toopixel</a></em>):</p>
<a href=http://www.dwightjack.com/diary/wp-content/plugins/download-monitor/download.php?id=9>Mootools 1.11 to 1.2.1 Compatibility File (1.97 kB)</a>
<h3>2. Plugins Upgrade.</h3>
<p>One of the more usefull plugin shipped with Mootools is <strong><a href="http://digitarald.de/project/squeezebox/">Squeezebox</a></strong>, used for the modal windows, here is the 1.2 Compatible version, ready to be placed in the above mentioned folder <code>media/system/js/</code>:</p>
<a href=http://www.dwightjack.com/diary/wp-content/plugins/download-monitor/download.php?id=6>Sqeezebox for Mootools 1.2.x (3.37 kB)</a>
<h3>3-4. Let&#8217;s try some PHP</h3>
<p>Since i want to touch Joomla Core files as less as possible, im going to use some little tricks to be able to <strong>use Mootools 1.2 just in the Frontend</strong> and <em>on-demand</em> from the template&#8217;s main <code>index.php</code> file.</p>
<p>Joomla is based on several PHP libraries placed in the <code>libraries/</code> folder; one of them is the <strong>Joomla API</strong>, but we can find <strong>ezSQL</strong> (a database lib), <strong>PHPMailer</strong> (a mailing system) and <strong>phpgacl</strong> (an access list system). To take advantage of Joomla&#8217;s built-in libraries loading system and, at the same time, prevent overwrites by future releases, i created a folder called <code>my_libs</code> in <code>libraries/</code> containing a class file: <a href=http://www.dwightjack.com/diary/wp-content/plugins/download-monitor/download.php?id=7>my_behavior class for Joomla 1.5.9 (1.13 kB)</a></p>
<p>Basically the class provides a static function which recalls the head part of Joomla document object, looks for Mootools and replaces it with the 1.2 version we uploaded before.</p>
<p>If Mootools is not found, then it&#8217;s simply loaded, extending it&#8217;s presence in the head of legacy 1.0.x components.</p>
<p>You can call this newly added class in your Joomla theme <code>index.php</code> by placing these lines of code before the head template tag:</p>
<pre><code>&lt;?php
JLoader::import( 'my_libs.behavior' );
MY_Behavior::mootoolsFix();
?&gt;
&lt;jdoc:include type="head" /&gt;</code></pre>
<p>If you need to switch back to v1.11 you can pass <code>false</code> as first argument to the function like this:</p>
<pre><code>MY_Behavior::mootoolsFix(false);</code></pre>
<h3>Note this!</h3>
<p>This is just a test, <strong>it should work on a basic Joomla installation</strong>, anyway feel free to report errors and issues to improve the code.</p>
<p>Untill now, I&#8217;ve experienced that <strong>Virtuemart</strong> uses it&#8217;s own logic to load libraries, so it&#8217;s <strong>excluded by default</strong>.</p>
<p>Optionally you can exclude specific components by passing an array with their option value as second argument:</p>
<pre><code>MY_Behavior::mootoolsFix(true,array("com_sobi2","com_comprofiler"));</code></pre>
<p>In <strong>SOBI2</strong> an error will be issued on search form unless you set the registry option <code>use_own_mootools</code> to <code>0</code>.</p>
<pre></pre>
]]></content:encoded>
			<wfw:commentRss>http://www.dwightjack.com/diary/2009/02/23/upgrade-mootools-to-v12x-in-joomla-15/feed/</wfw:commentRss>
		<slash:comments>53</slash:comments>
		</item>
	</channel>
</rss>
