API16:JExtension/ construct
From Joomla! Documentation
<! removed transcluded page call, red link never existed >
Syntax
__construct(JXMLElement $element=null)
| Parameter Name | Default Value | Description |
|---|---|---|
| null |
Defined in
libraries/joomla/installer/extension.php
Importing
jimport( 'joomla.installer.extension' );
Source Body
function __construct(JXMLElement $element = null)
{
if ($element && is_a($element, 'JXMLElement'))
{
$this->type = (string)$element->attributes()->type;
$this->id = (string)$element->attributes()->id;
switch($this->type)
{
case 'component':
// by default a component doesn't have anything
break;
case 'module':
case 'template':
case 'language':
$this->client = (string)$element->attributes()->client;
$this->client_id = JApplicationHelper::getClientInfo($this->client, 1);
$this->client_id = $this->client_id->id;
break;
case 'plugin':
$this->group = (string)$element->attributes()->group;
break;
default:
// catch all
// get and set client and group if we don't recognise the extension
if ($client = (string)$element->attributes()->client)
{
$this->client_id = JApplicationHelper::getClientInfo($this->client, 1);
$this->client_id = $this->client_id->id;
}
if ($group = (string)$element->attributes()->group) {
$this->group = (string)$element->attributes()->group;
}
break;
}
$this->filename = (string)$element;
}
}
<! removed transcluded page call, red link never existed >
Examples
Code Examples