home/wuectly/www/plugins/system/ic_library/ic_library.php000060400000004660152456133530020001 0ustar00. *---------------------------------------------------------------------------- */ // No direct access to this file defined('_JEXEC') or die(); /** * iC Library plugin class. * * @package Joomla.plugin * @subpackage System.iClib */ class plgSystemiC_library extends JPlugin { /** * Method to register iC library. * * return void */ public function onAfterInitialise() { if (is_dir(JPATH_LIBRARIES . '/ic_library')) { JLoader::registerPrefix('iC', JPATH_LIBRARIES . '/ic_library'); // Test if translation is missing, set to en-GB by default $language = JFactory::getLanguage(); $language->load('lib_ic_library', JPATH_SITE, 'en-GB', true); $language->load('lib_ic_library', JPATH_SITE, null, true); } } /** * Method to load Custom CSS from Component Config. * NOTE: To be moved to a separate system plugin - iCagenda */ public function onAfterDispatch() { // Check if component is installed if ( file_exists(JPATH_ADMINISTRATOR . '/components/com_icagenda/icagenda.php') ) { // Custom CSS loading $customCSS_activation = JComponentHelper::getParams('com_icagenda')->get('customCSS_activation', '0'); $customCSS = JComponentHelper::getParams('com_icagenda')->get('customCSS', ''); if (!empty($customCSS_activation) && $customCSS) { JFactory::getDocument()->addStyleDeclaration( $customCSS ); } } } }