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
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. - 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 - 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 - 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() { } ?>
|