Hi,
noch mal zum Verständnis:
Ich will Werte von Pluginparameter für Komponenten bereitstellen:
Bspl. Auszug Installer-XML:
PHP-Code:
<install version="1.5" type="plugin" group="system">
<name>System - Auswertung</name>
Bspl. (System-Plugin):
PHP-Code:
// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );
// Import library dependencies
jimport('joomla.application.plugin.helper');
class plg_Auswertung extends JPlugin
{
/**
* Constructor
*
* For php4 compatability we must not use the __constructor as a constructor for
* plugins because func_get_args ( void ) returns a copy of all passed arguments
* NOT references. This causes problems with cross-referencing necessary for the
* observer design pattern.
*/
function plg_Auswertung( &$subject )
{
parent::__construct( $subject );
// load plugin parameters
$this->_plugin =& JPluginHelper::getPlugin( 'onBeforeStart', 'plg_Auswertung' );
$this->_params = new JParameter( $this->_plugin->params );
}
/**
* Plugin method with the same name as the event will be called automatically.
*/
function onBeforeStart()
{
global $mainframe;
// Plugin code goes here.
return result;
}
}
Wie übergebe ich jetzt die Pluginparameter einer Komponente, oder mache sie für Komponenten zugängig?
Mein Ziel ist es, über installierbare Plugins verschiedenste Parameter für eine Komponente bereit zu stellen.
Kann ich den Code an der Stelle // Plugin code goes here. return result;
folgenden Code setzen?
PHP-Code:
$pluginvalue = $this->_params[<Parametername>];
return $pluginvalue;
Schema:
PHP-Code:
Plugin
Parameter($a)
|
____________________________
| Komponente
| $x = $a;
| _____________________________
:-) Micha
Lesezeichen