API15

Difference between revisions of "JPluginHelper/importPlugin"

From Joomla! Documentation

< API15:JPluginHelper
(New page: ===Description=== Loads all the plugin files for a particular type if no specific plugin is specified otherwise only the specific pugin is loaded. <span class="editsection" style="font-...)
 
m (removing red link to edit, no existant pages)
Line 3: Line 3:
  
 
<span class="editsection" style="font-size:76%;">
 
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>[[Description:JPluginHelper/importPlugin|Edit Descripton]]<nowiki>]</nowiki>
+
<nowiki>[<! removed edit link to red link >]</nowiki>
 
</span>
 
</span>
  
{{Description:JPluginHelper/importPlugin}}
+
<! removed transcluded page call, red link never existed >
  
 
===Syntax===
 
===Syntax===
Line 63: Line 63:
  
 
<span class="editsection" style="font-size:76%;">
 
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>[[SeeAlso:JPluginHelper/importPlugin|Edit See Also]]<nowiki>]</nowiki>
+
<nowiki>[<! removed edit link to red link >]</nowiki>
 
</span>
 
</span>
{{SeeAlso:JPluginHelper/importPlugin}}
+
<! removed transcluded page call, red link never existed >
  
 
===Examples===
 
===Examples===
Line 78: Line 78:
 
  format= ,,,
 
  format= ,,,
 
</dpl>
 
</dpl>
 +
[[Category:Archived pages API15]]

Revision as of 13:41, 12 May 2013

The "API15" namespace is an archived namespace. This page contains information for a Joomla! version which is no longer supported. It exists only as a historical reference, it will not be improved and its content may be incomplete and/or contain broken links.

Description[edit]

Loads all the plugin files for a particular type if no specific plugin is specified otherwise only the specific pugin is loaded.

[<! removed edit link to red link >]

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

Syntax[edit]

importPlugin($type, $plugin=null, $autocreate=true, $dispatcher=null)
Parameter Name Default Value Description
$type $type The plugin type, relates to the sub-directory in the plugins directory
$plugin null $plugin The plugin name
$autocreate true
$dispatcher null

Returns[edit]

boolean True if success

Defined in[edit]

libraries/joomla/plugin/helper.php

Importing[edit]

jimport( 'joomla.plugin.helper' );

Source Body[edit]

function importPlugin($type, $plugin = null, $autocreate = true, $dispatcher = null)
{
        $result = false;

        $plugins = JPluginHelper::_load();

        $total = count($plugins);
        for($i = 0; $i < $total; $i++) {
                if($plugins[$i]->type == $type && ($plugins[$i]->name == $plugin ||  $plugin === null)) {
                        JPluginHelper::_import( $plugins[$i], $autocreate, $dispatcher );
                        $result = true;
                }
        }

        return $result;
}

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

Examples[edit]

<CodeExamplesForm />