Source code for file /joomla/application/component/helper.php
Documentation is available at helper.php
* @version $Id: helper.php 6688 2007-02-21 08:36:39Z louis $
* @package Joomla.Framework
* @subpackage Application
* @copyright Copyright (C) 2005 - 2007 Open Source Matters. All rights reserved.
* @license GNU/GPL, see LICENSE.php
* Joomla! is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
* @package Joomla.Framework
* @subpackage Application
* @param string $name The component name
* @return object A JComponent object
if (!isset
( $instances[$name] ))
$instances =
$db->loadObjectList( 'option' );
if (isset
( $instances[$name] ))
$result =
&$instances[$name];
$result =
new stdClass();
* Checks if the component is enabled
* @param string $name The component name
return ($component->enabled |
$mainframe->isAdmin());
* Gets the parameter object for the component
* @param string $name The component name
* @return object A JParameter object
if (!isset
( $instances[$name] ))
$instances[$name] =
new JParameter($component->params);
return $instances[$name];
global $mainframe, $option;
// Build the component path
define( 'JPATH_COMPONENT', JPATH_BASE.
DS.
'components'.
DS.
$name);
define( 'JPATH_COMPONENT_SITE', JPATH_SITE.
DS.
'components'.
DS.
$name);
define( 'JPATH_COMPONENT_ADMINISTRATOR', JPATH_ADMINISTRATOR.
DS.
'components'.
DS.
$name);
if ( $mainframe->isAdmin() &&
file_exists(JPATH_COMPONENT.
DS.
'admin.'.
$file.
'.php') ) {
$path =
JPATH_COMPONENT.
DS.
'admin.'.
$file.
'.php';
$path =
JPATH_COMPONENT.
DS.
$file.
'.php';
// If component disabled throw error
// Handle legacy globals if enabled
if ($mainframe->getCfg('legacy'))
// Include legacy globals
global $my, $database, $id, $acl, $task;
// For backwards compatibility extract the config vars as globals
$varname =
'mosConfig_'.
$k;
$varname =
'mosConfig_'.
$k;
$varname =
'mosConfig_'.
$k;
// Load common language files
// Handle template preview outlining
// Build the component toolbar
jimport( 'joomla.application.helper' );
// Get the task again, in case it has changed
require_once( JPATH_ADMINISTRATOR .
'/includes/menubar.html.php' );