API15

JComponentHelper/isEnabled: Difference between revisions

From Joomla! Documentation

Doxiki (talk | contribs)
New page: ===Description=== Checks if the component is enabled <span class="editsection" style="font-size:76%;"> <nowiki>[</nowiki>Edit Descripton<now...
 
Doxiki (talk | contribs)
No edit summary
Line 9: Line 9:


===Syntax===
===Syntax===
<source lang="php">static isEnabled($option, $strict=false)</source>
<source lang="php">isEnabled($component, $strict=false)</source>


  {| class="wikitable"
  {| class="wikitable"
Line 17: Line 17:
!Description
!Description
|-
|-
| $option
| $component
|  
|  
|  $option The component option.
|  $component The component name
|-
|-
| $strict
| $strict
Line 36: Line 36:
===Source Body===
===Source Body===
<source lang="php">
<source lang="php">
public static function isEnabled($option, $strict = false)
function isEnabled( $component, $strict = false )
{
{
         $result = &self::getComponent($option, $strict);
        global $mainframe;
         return ($result->enabled | JFactory::getApplication()->isAdmin());
 
         $result = &JComponentHelper::getComponent( $component, $strict );
         return ($result->enabled | $mainframe->isAdmin());
}
}
</source>
</source>

Revision as of 22:09, 22 March 2010

Description

Checks if the component is enabled

[Edit Descripton]

Template:Description:JComponentHelper/isEnabled

Syntax

isEnabled($component, $strict=false)
Parameter Name Default Value Description
$component $component The component name
$strict false $string If set and a component does not exist, false will be returned

Returns

boolean

Defined in

libraries/joomla/application/component/helper.php

Importing

jimport( 'joomla.application.component.helper' );

Source Body

function isEnabled( $component, $strict = false )
{
        global $mainframe;

        $result = &JComponentHelper::getComponent( $component, $strict );
        return ($result->enabled | $mainframe->isAdmin());
}

[Edit See Also] Template:SeeAlso:JComponentHelper/isEnabled

Examples

<CodeExamplesForm />