<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><!-- generator="Joomla! 1.5 - Open Source Content Management" --><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">
	<channel>
		<title>The Fabrik Blog</title>
		<description>Fabrik - Joomla Application Builder. Create forms, databases, export to csv, rss, all without touching code!</description>
		<link>http://fabrikar.com/blog</link>
		<lastBuildDate>Mon, 20 Jul 2009 16:08:55 +0000</lastBuildDate>
		<generator>Joomla! 1.5 - Open Source Content Management</generator>
       		<language>en-gb</language>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/fabrik" type="application/rss+xml" /><item>
			<title>Fabrik 2.0rc3 released</title>
			<link>http://feedproxy.google.com/~r/fabrik/~3/HFiOAsenQ_0/57-fabrik-20rc3-released</link>
			<description><![CDATA[<p>Fabrik 2.0rc3 has now been released and is available in the <a href="http://fabrikar.com/project/downloads/doc_download/38-fabrik-20rc3">downloads section</a></p>
<p>This is pretty much a bug fix release, and will be the last release candidate before a final 2.0 release.</p>
<h2>What is Fabrik?</h2>
<p>Fabrik is THE open source Joomla application builder component. Fabrik gives you the power to create forms and tables that run inside Joomla without requiring knowledge of MySQL and PHP. Then feed your data into Google Maps, Charts or an AJAX based calendar With Fabrik you can create applications that range in complexity from simple contact forms to complex applications such as a job application site or bug tracking systems.
]]></description>
			<author>rob@pollen-8.co.uk (Administrator)</author>
			<category>Blog</category>
			<pubDate>Wed, 20 May 2009 10:15:34 +0000</pubDate>
		<feedburner:origLink>http://fabrikar.com/blog/57-fabrik-20rc3-released</feedburner:origLink></item>
		<item>
			<title>Making an article slider from your Joomla homepage</title>
			<link>http://feedproxy.google.com/~r/fabrik/~3/2TG5yl2AIXg/56-making-an-article-slider-from-your-joomla-homepage</link>
			<description><![CDATA[<p>As part of the last fabrikar.com site redesign we created an article slider widget for our Joomla homepage. In this blog post I'm going to go over how I created this.</p>
<p>My aim was to use Joomla's front page layout as the basis for the content and use Joomla's template override features to alter the mark up and add javascript to produce the slider features.</p>
<p> </p>
]]></description>
			<author>rob@pollen-8.co.uk (Administrator)</author>
			<category>Blog</category>
			<pubDate>Mon, 11 May 2009 09:20:02 +0000</pubDate>
		<feedburner:origLink>http://fabrikar.com/blog/56-making-an-article-slider-from-your-joomla-homepage</feedburner:origLink></item>
		<item>
			<title>Merge Fabrik and Joomla articles</title>
			<link>http://feedproxy.google.com/~r/fabrik/~3/o1UIpGZeRDk/55-cck-video</link>
			<description><![CDATA[<p>There's been quiet a buzz in the forums recently about combining the flexibilty of Fabrik into Joomla's article system. That, combined with the release of Joomla works <a href="http://k2.joomlaworks.gr/">K2</a>, and Yootheme's <a href="http://zoo.yootheme.com/">zoo</a> have relaunched the debate about creating customizable content in Joomla.</p>
]]></description>
			<author>rob@pollen-8.co.uk (Administrator)</author>
			<category>Blog</category>
			<pubDate>Fri, 10 Apr 2009 12:45:39 +0000</pubDate>
		<feedburner:origLink>http://fabrikar.com/blog/55-cck-video</feedburner:origLink></item>
		<item>
			<title>Fabrik 2.0rc2 releases</title>
			<link>http://feedproxy.google.com/~r/fabrik/~3/_hb29RtJJrQ/54-fabrik-20rc2-releases</link>
			<description><![CDATA[<p>Fabrik 2.0rc2 has now been released and is available in the <a href="http://fabrikar.com/project/downloads/cat_view/6-fabrik-20">downloads section</a></p><p>The main reason for this release is to address an issue with installation on Joomla 1.5.10. If you are using Joomla 1.5.10 then we strongly recommend you update to this version.</p>]]></description>
			<author>rob@pollen-8.co.uk (Administrator)</author>
			<category>Blog</category>
			<pubDate>Tue, 31 Mar 2009 12:59:16 +0000</pubDate>
		<feedburner:origLink>http://fabrikar.com/blog/54-fabrik-20rc2-releases</feedburner:origLink></item>
		<item>
			<title>New Site</title>
			<link>http://feedproxy.google.com/~r/fabrik/~3/erxxSjWW2V8/53-new-site</link>
			<description><![CDATA[<p>Welcome to the new fabrikar.com site!</p><p>We have finally migrated from Joomla 1.0.x to Joomla 1.5.10 and have updated the components we use to in the site. So a big thanks to to the following components:</p><p><a href="http://valanx.org/" title="AEC subscripton component">AEC Subscription component</a></p><p><a href="http://www.joomlatools.eu/products/docman.html" title="docman">Docman - file management </a></p><p><a href="http://www.jfusion.org/" title="jfusion">JFusion </a>- sync between Joomla and Vbulletin </p><p>Oh and we've used a smattering of Fabrik here and there!</p><p>We have a new <a href="http://fabrikar.com/wiki">WIKI</a>, which is separate to the main site, so of the old wiki content still needs to be moved over, we will be working on that as and when we can. This requires a separate account to log into (no medai wiki adaptor available fo JFusion at this date)</p><p>Please <a href="http://fabrikar.com/contact-us">contact us</a> if you have any queries regarding your account on the new site </p><p>{rokintensedebate} </p>]]></description>
			<author>rob@pollen-8.co.uk (Administrator)</author>
			<category>Blog</category>
			<pubDate>Mon, 30 Mar 2009 16:40:44 +0000</pubDate>
		<feedburner:origLink>http://fabrikar.com/blog/53-new-site</feedburner:origLink></item>
		<item>
			<title>Fabrik 2.0rc1 Released</title>
			<link>http://feedproxy.google.com/~r/fabrik/~3/spQ6GB_9EQs/15-Fabrik%202.0rc1%20Released</link>
			<description><![CDATA[The Fabrik team are proud to announce the release of Fabrik 2.0rc1 - THE Joomla application builder.
Again a special thanks to everyone that has helped make this possible - especially those of you who provide translation files, this is an often un-thanked task but a vital one in enabling Fabrik for as many people as possible!

<h2>What is Fabrik?</h2>

Fabrik is THE open source Joomla application builder component.

Fabrik gives you the power to create forms and tables that run inside Joomla without requiring knowledge of MySQL and PHP. Then feed your data into Google Maps, Charts or an AJAX based calendar

With Fabrik you can create applications that range in complexity from simple contact forms to complex applications such as a job application site or bug tracking systems. 

<a href="http://fabrikar.com/index.php?option=com_docman&task=cat_view&gid=5&Itemid=29">Download Fabrik 2.0rc1 now</a>

<h2>Release statistics since Fabrik2.0b3</h2>

<ul>
<li>529 Commits</li>
<li>An average of 5 commits a day since 12th Nov 2008 (the beta 3 release date)</li>
<li>1154 New threads on the forum</li>
<li>6710 posts</li>
<li>Average of 5.8 posts per thread.</li>
</ul>

<h2>New Features</h2>

<h3>General</h3>
Implemented caching - allows for large speed increases when Joomla cache is turned on
New icon set
Improved installer

<h3>Tables</h3>
Dramatic speed improvements with the auto creaton of Indexes
You can clear table filters from the URL by entering tablename___elementname=_clear_
Added a 'group by template' feature, if you tables' are grouped on a given value, then this template is rendered at the top of the grouped data. Useful when showing data which is replicated
Added 'require filter feature' - table data is only rendered if a specified filter is present

<h3>Elements</h3>
Fileupload element - New crop feature. Allows you to create a cropped version of the uploaded image
Added Is not validation rule

<h3>Forms</h3>
Email notifications: Added a conditional feature which defines if the email is sent or not


<h3>Calendar visualization</h3>
New options:
 - Define which day is the first day of the week
 - Grey scale weekends
 - 

<h3>Scheduled Tasks</h3>
- these can be run from within the admin page with a simple press of a button
- Added the option for the scheduled task to update the record it is processing. This allows you, for example, to mark records as processed by the plugin


<h3>Joomla plug-in</h3>
You can now insert specific fields' data into your Joomla content with the code:{fabrik view=element table=11 rowid=239 element=element_test___checkbox} 

<h2>Nightlies available as well!</h2>

Whilst working on the new installer code we have had to make the creation of the component zip file more complex than before. To this end we are starting to provide nightly builds (or new builds when new code is added or bugs fixed) which can be downloaded at <a href="http://fabrikar.com/nightlies/">http://fabrikar.com/nightlies/</a>

<h2>New documentation for Subscribers</h2>

Subscribers can now download the first release of our Fabrik 2.0 documentation here 
http://fabrikar.com/index.php?option=com_docman&task=cat_view&gid=4&Itemid=46


<h2>So what's next?</h2>

As always we will be helping you out in the forums, and fixing any issues arising from this release, working towards a final stable release in the not too distant future.
However, we will now be focusing on improving subscriber documentation and some spanky new tutorials which should get you up to speed with the main themes when using Fabrik.

<a href="http://fabrikar.com/index.php?option=com_docman&task=cat_view&gid=5&Itemid=29">Download Fabrik 2.0rc1 now</a>]]></description>
			<author>rob@pollen-8.co.uk (Administrator)</author>
			<category>Blog</category>
			<pubDate>Tue, 24 Feb 2009 12:43:19 +0000</pubDate>
		<feedburner:origLink>http://fabrikar.com/blog/15-Fabrik%202.0rc1%20Released</feedburner:origLink></item>
		<item>
			<title>Ajax templating within Joomla</title>
			<link>http://feedproxy.google.com/~r/fabrik/~3/4qhk7uEhNKU/51-Ajax%20templating%20within%20Joomla</link>
			<description><![CDATA[First of all this post isnâ€™t really anything to do with Fabrik, but Iâ€™m going to expand the blog to talk about various Joomla 1.5 coding problems, solutions and best practices. Please feel free to correct, contradict and eventually even concur with what Iâ€™m saying in the comments!</p>
<p>These posts wonâ€™t be about how to start coding Joomla components, thereâ€™s lots of tutorials and documentation out there to get you started. </p>
<p>So this first post will address an issue that I have constantly struggled with and until today have never had a solution that I felt was totally acceptable. </p>
<p>Imagine, if you will, that we have a component with a list of items and that you want to create some neat little Ajax code to scroll through that list. </p>
<p>We also want the code to degrade nicely so that if the user doesnâ€™t have JavaScript enabled they can still scroll the list. Finally, and here is the part that took me a while to find what I consider an elegant solution we want to ensure that there is no duplication of code used to create the updated list items. In other words there is only one place in which the listâ€™s html is generated, regardless of whether we are calling the code via Ajax or not.</p>
<p>The component name that Iâ€™m basing this demo on is called â€˜Fabbleâ€™ obviously where ever â€˜fabbleâ€™ appears you would need to replace that with your own component name. Within the â€˜Fabbleâ€™ component weâ€™re going to be displaying a list of groups</p>
<p>To ensure the degradation we will build the code in the usual fashion. </p>

<h2>The Controller</h2>
<p>First of all weâ€™ll need to create a controller class in components/com_fabble/controllers/groups.php</p>
<pre>defined('_JEXEC') or die();
 jimport( â€˜joomla.application.component.controllerâ€™ );
 class FabbleControllerGroups extends JController{
     	function display(){
         	$document =&#038; JFactory::getDocument();
         	$viewName    = JRequest::getVar( â€˜viewâ€™, â€˜homeâ€™, â€˜defaultâ€™, â€˜cmdâ€™ );
         	$modelName = $viewName;
	        $viewType    = $document-&gt;getType();
        	// Set the default view name from the Request
		$view = &#038;$this-&gt;getView( $viewName, $viewType );
	         // Push a model into the view
	         $model    = &#038;$this-&gt;getModel( $modelName );
	         if (!JError::isError( $model ) &#038;&#038; is_object( $model)) {
	              $view-&gt;setModel( $model, true );
	         }
	         // Display the view
	         $view-&gt;assign( 'error', $this-&gt;getError() );
	         return $view-&gt;display();
      }
 } ?&gt;</pre>

<p>This is pretty standard code for a controller class, where it sets up the model, creates the view and assigns the model to the view. Iâ€™ve come to the conclusion that its clearer to create a controller per section of your site rather than making on large controller for the entire component.</p>
<h2>The view</h2>
<p>Next we will create an empty view class in components/com_fabble/views/groups.html.php and get a reference to the document:</p>
<pre>// Check to ensure this file is included in Joomla!
  defined('_JEXEC') or die();
 jimport('joomla.application.component.view');
 class fabbleViewGroups extends JView {
     function display($tpl = null)     {
         $document           =&#038; JFactory::getDocument();
      }
 } ?&gt;
</pre>
<p>Now, inside the display method, weâ€™re going to get some variables from the group model:</p>
<pre>$nav     =&#038; $this-&gt;get( 'nav' );
 $groups =&#038; $this-&gt;get( 'Data' );
 </pre>

<p>The viewâ€™s get function maps to the corresponding groups model we assigned in the controller. The model file should be located in  </p>
<p>components/com_fabble/models/groups.php and will look like this:</p>
<pre>class FabbleModelGroups extends JModel {

     /**@var array group objects */
     var $groups = null;

     /** @var int default num of groups to show per page */
     var $_navLimit = 5;

      /**
      * get a list of groups
      *      * @return array group objects
      */

     function getData()
      {
         if (!isset( $this-&gt;groups )) {
             $query         = $this-&gt;_buildQuery();
             $limit        = JRequest::getVar( 'limit', $this-&gt;_navLimit, '', 'int' );
             $limitstart    = JRequest::getVar( 'limitstart', 0, '', 'int' );
              $this-&gt;groups = $this-&gt;_getList( $query, $limitstart, $limit );
         }
         return $this-&gt;groups;
     }

     /**
       * build the query to get the list of groups
      *
      * @return string query
      */

     function _buildQuery()     {
          return "SELECT *, g.id AS id, (SELECT COUNT(id) FROM #__fabble_person_groups\n".
             " AS pg where pg.group_id = g.id) AS member_count, p.displayName as created_by_name\n".
             " FROM #__fabble_groups AS g LEFT JOIN #__fabble_people AS p ON p.user_id = g.created_by ";
     }

     /**
      * get the navigation for the group list
       *
      * @return object navigation
      */

     function getNav()     {
         jimport('joomla.html.pagination');
          $db         =&#038; JFactory::getDBO();
         $db-&gt;setQuery( "SELECT count(*) FROM #__fabble_groups" );
         $limit        = JRequest::getVar( 'limit', $this-&gt;_navLimit, '', 'int' );
         $limitstart    = JRequest::getVar( 'limitstart', 0, '', 'int' );
         $total         = $db-&gt;loadResult();
         return new JPagination( $total, $limitstart, $limit );
     }
 }</pre>

<p>So, when the view calls $this-&gt;get( â€˜navâ€™ ); it is in fact calling the models getNav() function, likewise the $this-&gt;get( â€˜Dataâ€™ ) calls the models getData() function.</p>
<p>Now, back in the view, lets assign those variables to the view so they can be used within our template. As they are both objects we need to use the â€˜assignRefâ€™ method:</p>
<pre>$this-&gt;assignRef( 'groups', $groups );
 $this-&gt;assignRef( 'nav', $nav ); </pre>
<p>We also need to include the JavaScript classes we want to use:</p>
<pre>    JHTML::script('groups.js', 'media/com_fabble/js/');
     JHTML::script('ajaxnav.js', 'media/com_fabble/js/');
 </pre>
<p>Then create an instance of our JavaScript class that is going to observe the navigation controls and manage the Ajax call to the server when the user interacts with those controls:</p>

<pre>
     $opts            = new stdClass();
     $opts-&gt;nav        = $nav-&gt;getProperties();
     $opts-&gt;livesite        = JURI::base();
     $opts-&gt;page         = JURI::current() . "?" . $_SERVER['QUERY_STRING'];
     $opts            = json_encode($opts);
     $script = "window.addEvent('domready', function(){".
     "  new FabbleGroups($opts, {});".     "});";
     $document-&gt;addScriptDeclaration($script);
</pre>
<p>Iâ€™m presuming you have a recent version of PHP5 here that includes the json_encode function. Its best to make your json object in this fashion rather </p>
<p>than creating it by hand as itâ€™s less error prone. The last three lines add a script to the documentâ€™s head which waits for the DOM to be ready before </p>
<p>creating an instance of our FabbleGroup JavaScript class (thatâ€™s going to be in the file media/com_fabble/js/groups.js)</p>
<p>Finally we want to display our template:</p>

<pre>parent::display($tpl);</pre>
<p>So, just to recap, hereâ€™s the full view:</p>
<pre>// Check to ensure this file is included in Joomla!
  defined('_JEXEC') or die();
 jimport('joomla.application.component.view');
 class fabbleViewGroups extends JView {
     function display($tpl = null)     {
         $document           =&#038; JFactory::getDocument();
         $nav     =&#038; $this-&gt;get( 'nav' );
         $groups =&#038; $this-&gt;get( 'Data' );
         $this-&gt;assignRef( 'groups', $groups );
         $this-&gt;assignRef( 'nav', $nav );
         JHTML::script('groups.js', 'media/com_fabble/js/');
         JHTML::script('ajaxnav.js', 'media/com_fabble/js/');
         $opts            = new stdClass();
         $opts-&gt;nav        = $nav-&gt;getProperties();
         $opts-&gt;livesite     = JURI::base();
         $opts-&gt;page         = JURI::current() . "?" . $_SERVER['QUERY_STRING'];
         $opts            = json_encode($opts);
         $script = "window.addEvent('domready', function(){".
         "  new FabbleGroups($opts, {});".
         "});";
         $document-&gt;addScriptDeclaration($script);
          parent::display($tpl);     }
 }
 ?&gt;</pre>

<p>&nbsp;</p>
<h2> The template code</h2>
<p>Now lets move on to the template itself. Iâ€™m going to create two template files, you will see why I donâ€™t merge them into one file later on. The files are </p>
<p>components/com_fabble/views/group/tmpl/default.php <br />components/com_fabble/views/group/tmpl/default_items.php </p>
<p>Hereâ€™s default.phpâ€™s content:</p>
<pre>&lt;h1&gt;&lt;?php echo JText::_('Groups') ?&gt;&lt;/h1&gt;
&lt;div id=&#8221;fabble-groups&#8221;&gt;
	&lt;?php
 	$user =&#038; JFactory::getUser();
	if ($this-&gt;userid != 0) { ?&gt;
		&lt;a class=&#8221;fabble-add&#8221; href=&#8221;index.php?option=com_fabrik&#038;view=form&#038;fabrik=&lt;?php echo $this-&gt;groupFormid ?&gt;&#8221;&gt;
			&lt;?php echo JText::_(&#8217;Add group&#8217;); ?&gt;
		&lt;/a&gt;
	&lt;?php }
 ?&gt;
	&lt;ul class=&#8221;fabble-list&#8221;&gt;
		&lt;?php echo $this-&gt;loadTemplate(&#8217;items&#8217;) ?&gt;
	&lt;/ul&gt;
	&lt;div class=&#8221;fabble-nav&#8221;&gt;
		&lt;?php print_r( $this-&gt;nav-&gt;getPagesLinks())?&gt;
	&lt;/div&gt;
&lt;/div&gt;)?&gt;
</pre>
Pretty straight forward right? The only interesting bit here is where we output the html generated from â€˜default_itemsâ€™ template with the code:
<pre>
 &lt;?php echo $this-&gt;loadTemplate(&#8217;items&#8217;) ?&gt;
</pre>
Now onto the meat of the template found in default_items.php
<pre>&lt;?phpforeach($this-&gt;groups as $group){
	?&gt;
	&lt;li&gt;
		&lt;h2&gt;&lt;a href=&#8221;index.php?option=com_fabble&#038;controller=group&#038;id=&lt;?php echo $group-&gt;id ?&gt;&#8221;&gt;&lt;?php echo $group-&gt;label ?&gt;&lt;/a&gt;&lt;/h2&gt;

		&lt;div&gt;
		&lt;p&gt;&lt;?php echo JText::_(&#8217;Owner&#8217;) ?&gt;: &lt;?php echo $group-&gt;created_by_name  ?&gt;&lt;/p&gt;
		&lt;img src=&#8221;media/com_fabble/images/group.png&#8221; alt=&#8221;&lt;?php echo JText::_(&#8217;Members&#8217;) ?&gt;&#8221; /&gt;
		&lt;?php echo $group-&gt;member_count . &#8221; &#8221; . JText::_(&#8217;Members&#8217;);?&gt;
		&lt;/div&gt;
	&lt;/li&gt;
	&lt;?php }?&gt;
</pre>
<p>This will iterate over our group list and output a series of  items.  </p>
<p>At this point if you went to index.php?option=com_fabble&#038;controller=groups you would see a list of groups which you could navigate through, but there would be no Ajax navigation. As our JavaScript will run on top of this, in a manner which is called progressive enhancement, and thus meets our initial requirement that the page should degrade correctly with JavaScript turned off. </p>
<p>&nbsp;</p>
<h2>A sprinkling of JavaScript magic</h2>
<p>Now to add the JavaScript to control the page, weâ€™ll start by looking at media/com_fabble/js/groups.js</p>
<pre>var FabbleGroups = new Class({
  getOptions: function(){
         return {
             'nav':{},
              'livesite':'',
             'page':''
         };
     },
     initialize: function(options){
             this.setOptions(this.getOptions(), options);
              this.showGroups = new Ajax('index.php?option=com_fabble&#038;controller=groups&#038;format=raw',
            {
                'data':{
                },
                'onComplete':function(d){
                     $('fabble-groups').getElement('ul').setHTML(d);
                    this.nav.updateNav();
                }.bind(this)
            });
             this.nav = new AjaxNav('fabble-groups', {
                 'ajax':this.showGroups,
                  'nav':this.options.nav,
                 'page':this.options.page,
                 'livesite':this.options.livesite
             });
     } });
  FabbleGroups.implement(new Events);
 FabbleGroups.implement(new Options);
</pre>
<p>The initialize() function is called automatically when an instance of the class is created, which we have already done from within the view. The setOptions call will assign the json object we passed in from the view to the class instanceâ€™s â€˜this.optionsâ€™ variable.</p>

<p>Next we create our Ajax object and assign it the this.showGroups variable. When triggered it will call the url â€˜index.php?option=com_fabble&#038;controller=groups&#038;format=rawâ€™ and once the Ajax request has completed it will run the â€˜onCompleteâ€™ function.</p>
<p>Finally we create an instance of the navigation class. This is separate from the FabbleGroup class so that you can reuse it in other places within your component.</p>
<p>So, with no further ado, lets take a look at how it looks (it should be placed in /media/com_fabble/js/ajaxnav.js</p>
<pre>/** *    observes the standard Joomla pagenavigation
  and replaces its events with ajax loading events */
 var AjaxNav = new Class({
  getOptions: function(){
          return {
             'livesite':'',     //live site url
                   'nav':{},             // the ajax function to run when the navigation is run
                   'total':0,             //total number of records for the nav
             'page':''
         };
      },

     initialize: function(element, options){
              this.setOptions(this.getOptions(), options);
              this.element = $(element);
             this._addSpinner();
             this.watchNav();
      },

     _addSpinner: function()     {
         if(!this._getNav()){
             return false;
         }
          if($type(this.navspinner) !== false){
             return;
         }
         this.navspinner = new Element('img', {'styles':{'display':'none'}, 'src':this.options.livesite+'/media/com_fabble/images/ajax-loader.gif'});
         new Element('li').adopt(this.navspinner).injectInside(this._getNav());
     },

      _getNav: function()     {
         return this.element.getElement('.pagination');
     },

     watchNav: function()     {
         var nav = this._getNav();
        var jnav = this.options.nav;
         if(!this._getNav()){
            return;
        }
        var total = nav.getElements('li').length;
         nav.getElements('li').each(function(li, x){
            li.addEvent('click', function(e){
                new Event(e).stop();
                this._addSpinner();
                this.navspinner.setStyle(â€™displayâ€™,'inlineâ€™);
                 if(li.getElement('a')){
                    switch(x){
                     case 1: //first ??
                         this.options.jnav.limitstart = 0
                         break;
                     case 2: //second??
                          jnav.limitstart = jnav.limitstart - jnav.limit;
                         break;
                    case total -4: //next
                         jnav.limitstart = jnav.limitstart + jnav.limit;
                         break;
                     case total - 3: //end
			jnav.limitstart = jnav.total - jnav.total % jnav.limit;
                         break;
                     case total - 1: //spinner
                         return;
                         break;
                      default:
                         jnav.limitstart = ((x - 3) * jnav.limit);
                         break;
                    }
                 this.options.ajax.options.data.limitstart = jnav.limitstart;
                 this.options.ajax.request();
              }
            }.bind(this))
        }.bind(this));
    },
     updateNav: function(){
        var nav = this._getNav();
         var jnav = this.options.nav;
         this.navspinner.setStyle('display','none');
        var total = nav.getElements('li').length;
        nav.getElements('li').each(function(li, x){
            switch(x){
                case 0:
                 case total -1:
                case total -2:
                    //ignore 
                   break;
                case 1:
                case 2:
                     if(jnav.limitstart != 0){
                        if(!li.getElement('a')){
                            var span = li.getElement('span');
                            var title = span.getText();
                            li.empty();
                            if(x == 1){ s = 0;}else{ s = jnav.limitstart - jnav.limit;}
                             new Element('strong').adopt(
                            new Element('a', {'title':title, 'href':this.options.page + '&#038;start='+s}).setText(title)).injectInside(li);
                        }
                    }else{

                        if(li.getElement('a')){
                            var title = li.getElement('a').getText();
                             li.empty();
                            new Element('span').setText(title).injectInside(li);
                        }

                    }
                    break;
                    case total -4:
                 case total -3:
                    if(jnav.limitstart != jnav.total - jnav.total % jnav.limit){
                        if(!li.getElement('a')){
                            var span = li.getElement('span');
                            var title = span.getText();
                            li.empty();
                             if(x == 1){ s = 0;}else{ s = jnav.limitstart - jnav.limit;}
                            new Element('strong').adopt(
                            new Element('a', {'title':title, 'href':this.options.page + '&#038;start='+s}).setText(title)).injectInside(li);
                        }                    }else{
                        if(li.getElement('a')){
                             var title = li.getElement('a').getText();
                            li.empty();
                            new Element('span').setText(title).injectInside(li);
                        }
                    }
                    break;
                     default:
                        if(jnav.limitstart == (x-3) * jnav.limit){
                            if(li.getElement('a')){
                             var title = li.getElement('a').getText();
                             li.empty();
                             new Element('span').setText(title).injectInside(li);
                          }
                        }else{
                            if(!li.getElement('a')){
                             var span = li.getElement('span');
                             var title = span.getText();
                             li.empty();
                              if(x == 1){ s = 0;}else{ s = jnav.limitstart - jnav.limit;}
                             new Element('strong').adopt(
                             new Element('a', {'title':title, 'href':this.options.page + '&#038;start='+s}).setText(title)).injectInside(li);
                         }
                       }
                    break;
             }
        }.bind(this))
     } });
 AjaxNav.implement(new Events);
 AjaxNav.implement(new Options);</pre>

<p>Wow, slighlty longer this class isnâ€™t it?</p>
<p>Lets discet the watchNav function, whose purpose is to override the standard navigation events with out own:</p>
<pre>var nav = this._getNav();</pre>
<p>Will get a refernence to the standard Joomla navigation list controls we added in the template. </p>
<pre>
 nav.getElements(&#8217;li&#8217;).each(function(li, x){ &#8230;. }
</pre>
<p>will get every &lt;li&gt; inside the navigation and iterate over each of those liâ€™s   </p>

<p>&nbsp;</p>
<pre>li.addEvent('click', function(e){</pre>
<p>Assigns a new event to each of the liâ€™s.</p>
<pre>new Event(e).stop();</pre>
<p>this will stop the event from bubbling, which in turn means that the navigationâ€™s standard code will not be run.<br />The following switch statement, whilst long winded, simply works out which button has been pressed and updates the jnav objects limistart value</p>
<p>We then update the ajax objectâ€™s limitstart value we passed in from the FabbleGroup class to the new limitstart value</p>
<p>this.options.ajax.options.data.limitstart = jnav.limitstart;</p>
<p>and finally fire off the request</p>
<pre>this.options.ajax.request();</pre>

<h2>A raw view</h2>
<p>Remember that in the FabbleGroup Javascript class we had set the Ajaxâ€™s objectâ€™s url to:<br />â€˜index.php?option=com_fabble&#038;controller=groups&#038;format=rawâ€™</p>
<p>This will tell Joomla to render a raw view of the page we are currently on.<br />So we need to create a new file: components/com_fabble/views/groups/view.raw.php - note the â€˜rawâ€™ in the file name, this is the view that Joomla looks for as we passed in â€˜&#038;format=rawâ€™ in the Ajax requestâ€™s querystring.</p>
<p>Hereâ€™s the content of the file:</p>
<pre>/**  * @package Joomla
  * @subpackage Fabble
  * @copyright Copyright (C) 2005 Rob Clayburn. All rights reserved.
  * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php   */
 // Check to ensure this file is included in Joomla!
 defined('_JEXEC') or die();
 jimport('joomla.application.component.view');
 class fabbleViewGroups extends JView {
     function display($tpl = null)     {
          // Initialize variables
         $this-&gt;assignRef( 'groups', $this-&gt;get( 'Data' ) );

         parent::display(&#8217;items&#8217;);
     }
 } ?&gt;
</pre>
<p>So again, we are getting the list of groups. As we have updated the limistart varaible when sending the Ajax request the data returned from this function will reflect the current page you have navigated to.</p>
<p>Then, instead of calling the main template (â€™default.phpâ€™) we call â€˜default_items.phpâ€™ with the function:</p>
<pre>parent::display('items');</pre>
<p>This has the effect of returning to the Ajax objectâ€™s onComplete function only the updated &lt;li&gt;â€™s, precisely the content we are after.</p>
<p>The last step in updating the list is in the FabbleGroup Javascript classâ€™s this.shoWGroups onComplete function:  </p>

<p>&nbsp;</p>
<pre>'onComplete':function(d){
                $('fabble-groups').getElement('ul').setHTML(d);
                    this.nav.updateNav();
                }.bind(this)
</pre>
<p>So we update the &lt;li&gt;â€™s html with that returned from the raw view and then tell the navigation object to update itself, basically this invloves iterating over all of the navigation lists  items and setting or removing their links. </p>
<p>&nbsp;</p>
<h2>Other methods I considered</h2>
<h3>Sending JSON</h3>
<p>I have to say that I didnâ€™t start out doing things in this manner. My first idea was to make the ajax call get a json object directly from the group controller, once the json data received the FabbleGroup JavaScript class would build the required elements and insert them into the list. </p>
<p>I liked this to start off with because the data passed back to the page was smaller in size. However, as soon as the content inside the list becomes complex its was quiet hard to write the javascript to create it, and if the template changed then I would need to update the javascript code to reflect those changes, so all in all a very brittle solution.</p>
<h3>Javascript Agogo</h3>

<p>So I knew that I had to have the html generated in one place, my first thought was that I could do it all within the javascript classes. This would involve passing pure json to the scripts which would then build the pages. Somewhere my love of JavaScript made me really consider this for a moment, then I realised that it would mean my users would have to have Javascript enabled and it would make adjusting the templates harder.</p>
<p>So to summarise Iâ€™m pretty darned happy with the soluton I have now. It degrades beautifully whilst still being flexible and robust.]]></description>
			<author>rob@pollen-8.co.uk (Administrator)</author>
			<category>Blog</category>
			<pubDate>Thu, 04 Dec 2008 17:00:12 +0000</pubDate>
		<feedburner:origLink>http://fabrikar.com/blog/51-Ajax%20templating%20within%20Joomla</feedburner:origLink></item>
		<item>
			<title>Fabrik 2.0b3 released</title>
			<link>http://feedproxy.google.com/~r/fabrik/~3/DKTUzNke3VA/50-Fabrik%202.0b3%20released</link>
			<description><![CDATA[<p>We are proud to release the next and hopefully last beta version
of Fabrik, <a href="http://fabrikar.com/index.php?option=com_docman&task=cat_view&gid=5&Itemid=29">Fabrik
2.0b3</a>. This release contains a large number of bug fixes (over 470
commits since the second beta) from the previous 2.0b2 release from
June.</p>

<p>This release would not have been possible without the communities
help in reporting bugs, suggesting fixes, posting translations and
general inspiration! I encourage you all to continue helping us so we
can quickly move towards release candidates and then a final version</p>

<h2>Installation instructions</h2>

<h3>Clean installation</h3>

<a href="http://fabrikar.com/index.php?option=com_docman&task=cat_view&gid=5&Itemid=29">Download
com_fabrik2.0b3.zip</a>
from the downloads site. Log into your site's administration section and
select Extensions->Install/Uninstall. In the 'Upload Package File'
section press the 'browse' button to locate the downloaded zip file.
Once selected press 'Upload file and Install'. Fabrik is a large package
and the installation may time out with this method. An alternative way
is to create a folder called 'com_fabrik2.0b3' on your server in its tmp
directory (e.g. /location/of/mysite/tmp/com_fabrik2.0b3) and upload the
files contained within com_fabrik2.0b3.zip to this folder. Once
uploaded, naviagate to Joomla's installation page as before, but this
time enter the path to the uploaded files in the 'Install from
Directory' section (e.g. /location/of/mysite/tmp/com_fabrik2.0b3) and
press the 'Install' button.

<h3>Upgrading</h3>

<p><strong>First of all make a back up of all your current Fabrik
files and database tables</strong>, if anything goes wrong in the upgrade process you will always be able
to revert to your old files.</p>
<p>Now install Fabrik as if it was a new
component. Your data won't be overwritten but Fabrik's files will be
updated.</p>
<p>There are no database changes to be made.</p>
<p>You may have to
re-edit and save date and user elements. Please note that date
formatting now uses <a href="http://fr3.php.net/manual/en/function.strftime.php">php's strftime</a> formatting method. 
</p>

<h2>Release Notes</h2>
<ul>
	<li>Faster, stronger, better ! There has been a concerted effort
	to reduce the number of queries and memory usage. Queries have been cut
	down by up to 400% in certain places.
	<li>GEORSS output in RSS feeds</li>
	<li>JACL+ integration - use groups created by JACL+ to increase
	the granularity of access control within Fabrik.
	<li>Experimental option to combine and compress all your fabrik
	javascript files into single files.</li>
</ul>

<h3>Tables</h3>
<ul>
	<li>Improved administration delete table options - thanks to Cyber
	Fabrik</li>
	<li>Copy row table plug-in - This simple plug-in allows your users
	to select and duplicate records.</li>
	<li>Option to have a single search field that will search all of
	the table's data.</li>
</ul>


<h3>Forms</h3>
<ul>
	<li>New group setting allowing their elements to be rendered in
	columns</li>
	<li>New 'labels above' form template</li>
	<li>Create simple interactions on your forms without knowing
	Javascript, e.g. fade out this group when this elements value is true.</li>
	<li>The regex validation from Fabrik 1.0.x has been ported over,
	also allowing for the replacement of posted data with specified regex/text.</li>
</ul>

<h3>Visualization plug-ins</h3>
<ul>
	<li>Most plug-ins have been refractored to use the MVC layout</li>
	<li>Clustering options in the google Map visualization</li>
	<li>Calendar - events can now have start and end dates (thx
	Barbara!)</li>
</ul>

<h3>CSV Export</h3>
<ul>
	<li>Choose whether to apply the table's filters to the CSV data</li>
	<li>In addition choose which fields to export</li>
</ul>

<p>
<a href="http://fabrikar.com/media/changelogs/fabrik20b3.txt">Download
the full SVN log here</a>
</p>
<p>
<a href="http://fabrikar.com/index.php?option=com_docman&task=cat_view&gid=5&Itemid=29">Download Fabrik 2.0b3</a>
</p>


]]></description>
			<author>rob@pollen-8.co.uk (Administrator)</author>
			<category>Blog</category>
			<pubDate>Tue, 11 Nov 2008 15:40:51 +0000</pubDate>
		<feedburner:origLink>http://fabrikar.com/blog/50-Fabrik%202.0b3%20released</feedburner:origLink></item>
		<item>
			<title>Protonotes annotation plugin released</title>
			<link>http://feedproxy.google.com/~r/fabrik/~3/ATajgv7Ja9A/49-Protonotes%20annotation%20plugin%20released</link>
			<description><![CDATA[Need a quick way to annotate your Joomla and Fabrik pages, during the development phase?

If so then look no further, I've just released a small Joomla 1.5 plug-in that allows you to use the <a href="http://www.protonotes.com/">Protonotes</a> service to annotate your web pages.

Notes can be dragged, hidden, marked as reviewed and completed.

To get started, <a href="http://joomlacode.org/gf/project/protonote/frs/">dowload the protonotes plug-in from Joomlacode</a> and create an account on the <a href="http://www.protonotes.com/">protonotes site</a>.]]></description>
			<author>rob@pollen-8.co.uk (Administrator)</author>
			<category>Blog</category>
			<pubDate>Thu, 06 Nov 2008 10:47:21 +0000</pubDate>
		<feedburner:origLink>http://fabrikar.com/blog/49-Protonotes%20annotation%20plugin%20released</feedburner:origLink></item>
		<item>
			<title>See Fabrik @ linux exop, London Olympia</title>
			<link>http://feedproxy.google.com/~r/fabrik/~3/hbn5a7XZTAI/48-See%20Fabrik%20@%20linux%20exop,%20London%20Olympia</link>
			<description><![CDATA[<img src="http://www.linuxexpolive.co.uk/images/stories/linux08-sm.jpg">
I will be exhibiting Fabrik at London Linux Expo Live from Thursday the 23rd October to Saturday the 25th.

Fabrik will be in the .ORG Village, sharing a stand with Joomla tools, right next door to the Joomla stand, so if you can please come along for a chat

I know that its rather short notice, I only got the go ahead for this yesterday and have since been running around trying to get flyers. business cards and t-shirts printed

I hope to see some of you there!
]]></description>
			<author>rob@pollen-8.co.uk (Administrator)</author>
			<category>Blog</category>
			<pubDate>Fri, 17 Oct 2008 15:07:54 +0000</pubDate>
		<feedburner:origLink>http://fabrikar.com/blog/48-See%20Fabrik%20@%20linux%20exop,%20London%20Olympia</feedburner:origLink></item>
	</channel>
</rss>
