Well, that was an interesting day... A couple of grey hairs more I have to say. I am still struggling a lot to actually write a plugin in the object orientated fashion which is described here. http://dev.joomla.org/component/option, ... te_plugin/
Triggering the event works fine (or this is what I believe):
Code: Select all
JPluginHelper::importPlugin('search');
$result = $mainframe->triggerEvent('onSearchSuccesFull',array(&$sResult));
Listening for the event is the core issue for me:
The 'legacy' way works fine:
Code: Select all
<?php
// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );
$mainframe->registerEvent( 'onSearchSuccesFull', 'plgPopulateModule' );
function plgPopulateModule ($param) {
return $param;
}
Code: Select all
<?php
defined('_JEXEC') or die();
jimport('joomla.event.plugin');
class plgSearchBar extends JPlugin{
var $param = null;
function plgSearchBar(& $subject) {
parent::__construct($subject);
$this->_plugin = JPluginHelper::getPlugin( 'search', 'plgEHiveSearchBar' );
$this->_params = new JParameter( $this->_plugin->params );
}
function onSearchSuccesFull ($param) {
$param = "testPluginEhive";
return $param;
}
}
Thanks for your help and sorry for starting a new post but the other one became a bit messy.
Thanks,
Uwe