<?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</title>
	<atom:link href="http://www.dwightjack.com/diary/tag/joomla/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>Enable global checkin for managers in Joomla 1.5</title>
		<link>http://www.dwightjack.com/diary/2008/12/22/enable-global-check-in-for-managers-in-joomla-15/</link>
		<comments>http://www.dwightjack.com/diary/2008/12/22/enable-global-check-in-for-managers-in-joomla-15/#comments</comments>
		<pubDate>Mon, 22 Dec 2008 13:51:52 +0000</pubDate>
		<dc:creator>Dwight Jack</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[ACL]]></category>
		<category><![CDATA[com_checkin]]></category>
		<category><![CDATA[global check-in]]></category>
		<category><![CDATA[joomla]]></category>

		<guid isPermaLink="false">http://www.dwightjack.com/diary/?p=47</guid>
		<description><![CDATA[Here is a quick hack to allow global check-in action for manager user level in Joomla 1.5]]></description>
			<content:encoded><![CDATA[<p>One of the most common problems in a multi-user Joomla environment is content&#8217;s locking due to an incorrect end of editing session. The main issue is that only the user who locked the content is allowed to unlock it.</p>
<p>To overcome this problem, users usually rely on an (super) administrator user action, since it&#8217;s the only user level who can access the <strong>Global Chek-in</strong> tool in the backend panel.</p>
<p>The main concern in this ACL rule on Joomla is that most of the times users who manage the website contents have a <strong><em>manager</em></strong> access level, since this user level is much more restricted on technical configuration&#8217;s options.</p>
<p>To allow Global Check-in action for managers, just edit the core file located at <strong><code>/libraries/joomla/users/authorization.php</code></strong> adding below line <strong>91</strong> the following code:</p>
<pre><code>$this-&gt;addACL( "com_checkin", "manage", "users", "manager" );
</code></pre>
<p><strong>Important</strong>: Since this is a core hack, keep in mind that it could be overwritten on further upgrades!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dwightjack.com/diary/2008/12/22/enable-global-check-in-for-managers-in-joomla-15/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
