API16:JExtension/ construct
From Joomla! Documentation
This Namespace has been archived - Please Do Not Edit or Create Pages in this namespace. Pages contain information for a Joomla! version which is no longer supported. It exists only as a historical reference, will not be improved and its content may be incomplete.
Description:JExtension/ construct
Contents |
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; } }
[Edit See Also] SeeAlso:JExtension/ construct
Examples
<CodeExamplesForm />
