Login Form






Lost Password?
No account yet? Register

Syndicate

Get latest news from us

VivoCiti - Latest Added Component
VivoCiti.com - Monthly Newsletter
Please register to the site before you can sign for a list.
No account yet? Register

Subscribe to RSS through Email:

Enter your email address:



Home
Using Joomla Plugin Wizard to speed up your plugins development PDF Print E-mail

Views : 2983    

Favoured : 65

Published in : Articles & Tutorials, YouCMSAndBlog


Tag it:
Delicious
Digg
RedDot
Spurl
Reddit
YahooMyWeb
Technorati
Stumble
Furl it!
Mister.Wong
Joomla Mambot & Plugin Wizard or Generator release is another sequel release after Joomla Module Wizard or Generator I have promised. With this free wizard / generator running under YouCMSAndBlog IDE, development of Joomla mambots / plugins can be increased significantly and  especially apart from helping you to generate its XML configuration, it will help by auto generating all Joomla plugins' group type's PHP function signatures (Events), i.e:
  • System (onAfterInitialise, onAfterRoute, onAfterDispatch, onAfterRender, onGetWebServices)
  • Content (onPrepareContent, onAfterDisplayTitle, onBeforeDisplayContent, onAfterDisplayContent)
  • Search (onSearch, onSearchAreas)
  • Editor (onInit, onDisplay, onGetContent, onSetContent, onSave, onGetInsertMethod)
  • and many other more Joomla plugins Group Events which can be handled & generated automatically by this wizard / generator

Using Joomla Plugin Wizard to speed up your plugins development screenshots 1
Using Joomla Plugin Wizard to speed up your plugins development screenshots 1

I will spent some time to write up a tutorial with concrete example how to create Joomla plugins by using this wizard / generator in another session especially for newbie.

And as for now let's briefly looking through the features so for you who get used to with Joomla plugin development, can take advantages immediately by downloading and start to use it.

  1. This wizard can be used to generate automatically plugin (mambot) for Joomla 1.0 and Joomla 1.5. As you can see from following screenshot, you can select 1.0.x or 1.5.x directly from Joomla Version listbox selection
    Using Joomla Plugin Wizard to speed up your plugins development screenshots 2
    Using Joomla Plugin Wizard to speed up your plugins development screenshots 2

  2. As mentioned above as well that in Joomla extension development for Plugins (Mambots), it has been divided into several categories / groups of Events. I will not explain the functionalities of each of them and save it for next tutorial that I am going to write. For you who have basic understanding about Joomla plugin, basically this wizard / generator will help you generate all of their events on the fly. (For this version, it will generate all their event and register for you but you can remove unnecessaries events from the generated source as you want to)
    Using Joomla Plugin Wizard to speed up your plugins development screenshots 3
    Using Joomla Plugin Wizard to speed up your plugins development screenshots 3
  3. For File List and Admin Params section, you may want to read through a tutorial about Developing Module extension for Joomla 1.0.x & 1.5 with Joomla Module Wizard / Generator first.

Below is the example of code snippet generated by selecting Joomla Version 1.5.x and Group : Content

<?php
/*
* @author Sunento
* Email :
* URL : http://vivociti.com
* Description : Demonstration of simple plugin generation with Joomla Mambot & Plugin Wizard / Generator
*
***/
/// no direct access
defined('_JEXEC') or die('Restricted access');


$mainframe->registerEvent( 'onPrepareContent', 'plugin_sample1_onPrepareContent');
$mainframe->registerEvent( 'onAfterDisplayTitle', 'plugin_sample1_onAfterDisplayTitle');
$mainframe->registerEvent( 'onBeforeDisplayContent', 'plugin_sample1_onBeforeDisplayContent');
$mainframe->registerEvent( 'onAfterDisplayContent', 'plugin_sample1_onAfterDisplayContent');


/** before any output occurs  */
function plugin_sample1_onPrepareContent($published, &$row, &$params, $page=0) {
    //Remove unnecessaries generated code as you want
    // Get DB Object
    $db         = & JFactory::getDBO();
    // Get User Object
    $user        = & JFactory::getUser();
    //Get Config
    $config     = & JFactory::getConfig();
    // Get Plugin info
    $plugin =& JPluginHelper::getPlugin('plugin_sample1', 'content');
    // Get the plugin parameters
    $pluginParams = new JParameter( $plugin->params );
    //Get parameters
    //
    $param1 = $pluginParams->get('param1');
    //
    $param2 = $pluginParams->get('param2');
 
    return true;
}


/** just after article title is displayed */
function plugin_sample1_onAfterDisplayTitle() {
    return true;
}


/** just before content is output, returns output to be displayed */
function plugin_sample1_onBeforeDisplayContent(&$row, &$params, $page=0) {
    return true;
}


/** just after content is output, returns output to be displayed */
function plugin_sample1_onAfterDisplayContent(&$row, &$params, $page=0 ) {
    return true;
}
?>

And this is another example of code snippet generated by selecting Joomla Version 1.0.x and Group: Search
 

<?php
/*
* @author Sunento
* Email :
* URL : http://vivociti.com
* Description : Demonstration of simple plugin generation with Joomla Mambot & Plugin Wizard / Generator
*
***/
/// no direct access
defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );


$_MAMBOTS->registerFunction( 'onSearch', 'plugin_sample2_onSearch');
$_MAMBOTS->registerFunction( 'onSearchAreas', 'plugin_sample2_onSearchAreas');


/** when search is performed */
function plugin_sample2_onSearch($text, $phrase='', $ordering='') {
    //Remove unnecessaries generated code as you want
    global $database;   
    // Get  Mambot Info 
    $query = "SELECT id FROM #__mambots WHERE element = 'plugin_sample2' AND folder = 'search'";
    $database->setQuery( $query );
    $id = $database->loadResult();
    $mambot = new mosMambot( $database );
    $mambot->load( $id );
    $botParams = new mosParameters( $mambot->params );
    //Get parameters
    //
    $param1 = $botParams->def('param1');
    //
    $param2 = $botParams->def('param2');
 
}


/** when the search component requests a list of valid search areas */
function plugin_sample2_onSearchAreas() {
}
?>


   
Quote this article in website
Favoured
Print
Send to friend
Related articles
Save this to del.icio.us

Keywords : Joomla Plugin Mambot Wizard Generator


Users' Comments  RSS feed comment
 

Average user rating

   (0 vote)

 


Add your comment
Only registered users can comment an article. Please login or register.

No comment posted



mXcomment 1.0.4 © 2007-2008 - visualclinic.fr
License Creative Commons - Some rights reserved
  No Comments.

Discuss...
Next >

Who's Online

We have 5 guests online

Member Statistics

We have 7483 members and 415 new members for this month

iBook Network

Recommended Book




Latest Post