Actions

API16

Difference between revisions of "JExtension/ construct"

From Joomla! Documentation

< API16:JExtension
(New page: <span class="editsection" style="font-size:76%;"> <nowiki>[</nowiki>Edit Descripton<nowiki>]</nowiki> </span> {{Description:JExtension/__cons...)
 
m (removing red link to edit, no existant pages)
 
Line 1: Line 1:
 
 
<span class="editsection" style="font-size:76%;">
 
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>[[Description:JExtension/__construct|Edit Descripton]]<nowiki>]</nowiki>
+
<nowiki>[<! removed edit link to red link >]</nowiki>
 
</span>
 
</span>
  
{{Description:JExtension/__construct}}
+
<! removed transcluded page call, red link never existed >
  
 
===Syntax===
 
===Syntax===
Line 71: Line 70:
  
 
<span class="editsection" style="font-size:76%;">
 
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>[[SeeAlso:JExtension/__construct|Edit See Also]]<nowiki>]</nowiki>
+
<nowiki>[<! removed edit link to red link >]</nowiki>
 
</span>
 
</span>
{{SeeAlso:JExtension/__construct}}
+
<! removed transcluded page call, red link never existed >
  
 
===Examples===
 
===Examples===
Line 86: Line 85:
 
  format= ,,,
 
  format= ,,,
 
</dpl>
 
</dpl>
 +
[[Category:Archived pages API16]]

Latest revision as of 00:06, 13 May 2013

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 />