Actions

API16

JExtension/ construct

From Joomla! Documentation

< API16:JExtension
Replacement filing cabinet.png
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.

[<! removed edit link to red link >]

<! removed transcluded page call, red link never existed >

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;
        }
}

[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >

Examples

<CodeExamplesForm />