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...
 
m preparing for archive only
 
(2 intermediate revisions by 2 users not shown)
Line 3: Line 3:


<span class="editsection" style="font-size:76%;">
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>[[Description:JComponentHelper/isEnabled|Edit Descripton]]<nowiki>]</nowiki>
<nowiki>[<! removed edit link to red link >]</nowiki>
</span>
</span>


{{Description:JComponentHelper/isEnabled}}
<! removed transcluded page call, red link never existed >


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


<span class="editsection" style="font-size:76%;">
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>[[SeeAlso:JComponentHelper/isEnabled|Edit See Also]]<nowiki>]</nowiki>
<nowiki>[<! removed edit link to red link >]</nowiki>
</span>
</span>
{{SeeAlso:JComponentHelper/isEnabled}}
<! removed transcluded page call, red link never existed >


===Examples===
===Examples===
<CodeExamplesForm />
=== Code Examples ===
<dpl>
<dpl>
  noresultsheader=\n
  noresultsheader=\n
  category=isEnabled
  category=isEnabled
  category=JComponentHelper
  category=JComponentHelper
  category=CodeExample
  namespace=CodeExample
  category=MethodExample
  category=MethodExample
  include=*
  include=*
  format= ,,,
  format= ,,,
</dpl>
</dpl>
[[Category:Archived pages API15]]

Latest revision as of 00:24, 25 March 2017

Description

Checks if the component is enabled

[<! removed edit link to red link >]

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

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

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

Examples

Code Examples