public static function load() { if (self::$loaded) { return; } self::$loaded = true; include_once JPATH_ROOT . '/administrator/components/com_eventgallery/version.php'; $document = JFactory::getDocument(); //JHtml::_('behavior.framework', true); JHtml::_('behavior.formvalidation'); $params = JComponentHelper::getParams('com_eventgallery'); $doDebug = $params->get('debug', 0) == 1; $doManualDebug = JRequest::getString('debug', '') == 'true'; $CSSs = array(); $JSs = array(); if (version_compare(JVERSION, '3.0', 'gt')) { JHtml::_('jquery.framework'); } else { $JSs[] = 'common/js/jquery/jquery.min.js'; $JSs[] = 'common/js/jquery/jquery-migrate-1.2.1.min.js'; } $JSs[] = 'common/js/jquery/namespace.js'; // load script and styles in debug mode or compressed if ($doDebug || $doManualDebug) { $CSSs[] = 'frontend/css/eventgallery.css'; $CSSs[] = 'frontend/css/colorbox.css'; $joomlaVersion = new JVersion(); if (!$joomlaVersion->isCompatible('3.0')) { $CSSs[] = 'frontend/css/legacy.css'; } $JSs = array_merge($JSs, array('frontend/js/EventgalleryTools.js', 'frontend/js/EventgalleryTouch.js', 'frontend/js/jquery.colorbox.js', 'frontend/js/jquery.colorbox.init.js', 'frontend/js/EventgallerySizeCalculator.js', 'frontend/js/EventgalleryImage.js', 'frontend/js/EventgalleryRow.js', 'frontend/js/EventgalleryImageList.js', 'frontend/js/EventgalleryEventsList.js', 'frontend/js/EventgalleryEventsTiles.js', 'frontend/js/EventgalleryGridCollection.js', 'frontend/js/EventgalleryTilesCollection.js', 'frontend/js/EventgalleryCart.js', 'frontend/js/EventgallerySocialShareButton.js', 'frontend/js/EventgalleryJSGallery2.js', 'frontend/js/EventgalleryLazyload.js', 'frontend/js/EventgalleryBehavior.js')); } else { $joomlaVersion = new JVersion(); if (!$joomlaVersion->isCompatible('3.0')) { $CSSs[] = 'frontend/css/eg-l-compressed.css'; } else { $CSSs[] = 'frontend/css/eg-compressed.css'; } $JSs[] = 'frontend/js/eg-compressed.js'; } foreach ($CSSs as $css) { $script = JUri::root(true) . '/media/com_eventgallery/' . $css . '?v=' . EVENTGALLERY_VERSION; $document->addStyleSheet($script); } foreach ($JSs as $js) { $script = JUri::root(true) . '/media/com_eventgallery/' . $js . '?v=' . EVENTGALLERY_VERSION; $document->addScript($script); } /* * Let's add a global configuration object for the color box slideshow. */ $slideshowConfiguration = array(); $slideshowConfiguration['slideshow'] = $params->get('use_lightbox_slideshow', 0) == 1 ? true : false; $slideshowConfiguration['slideshowAuto'] = $params->get('use_lightbox_slideshow_autoplay', 0) == 1 ? true : false; $slideshowConfiguration['slideshowSpeed'] = $params->get('lightbox_slideshow_speed', 3000); $slideshowConfiguration['slideshowStart'] = JText::_('COM_EVENTGALLERY_LIGHTBOX_SLIDESHOW_START'); $slideshowConfiguration['slideshowStop'] = JText::_('COM_EVENTGALLERY_LIGHTBOX_SLIDESHOW_STOP'); $slideshowConfiguration['slideshowRightClickProtection'] = $params->get('lightbox_prevent_right_click', 0) == 1 ? true : false; $document->addScriptDeclaration("EventGallerySlideShowConfiguration=" . json_encode($slideshowConfiguration) . ";"); }
defined('_JEXEC') or die('Restricted access'); include_once JPATH_COMPONENT_ADMINISTRATOR . '/version.php'; //load tables JTable::addIncludePath(JPATH_ADMINISTRATOR . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_eventgallery' . DIRECTORY_SEPARATOR . 'tables'); // load forms JForm::addFormPath(JPATH_COMPONENT . '/models/forms'); //load fields JForm::addFieldPath(JPATH_COMPONENT . '/models/fields'); //load classes JLoader::registerPrefix('Eventgallery', JPATH_COMPONENT); // load plugins JLoader::discover('EventgalleryPluginsShipping', JPATH_PLUGINS . DIRECTORY_SEPARATOR . 'eventgallery_ship', true, true); JLoader::discover('EventgalleryPluginsSurcharge', JPATH_PLUGINS . DIRECTORY_SEPARATOR . 'eventgallery_sur', true, true); JLoader::discover('EventgalleryPluginsPayment', JPATH_PLUGINS . DIRECTORY_SEPARATOR . 'eventgallery_pay', true, true); // Load necessary media files EventgalleryHelpersMedialoader::load(); $language = JFactory::getLanguage(); $language->load('com_eventgallery', JPATH_BASE . DIRECTORY_SEPARATOR . 'language' . DIRECTORY_SEPARATOR . 'overrides', $language->getTag(), true); $controller = JControllerLegacy::getInstance('Eventgallery'); $view = JFactory::getApplication()->input->get('view', 'null'); $controllerFile = JPATH_COMPONENT . DIRECTORY_SEPARATOR . 'controllers' . DIRECTORY_SEPARATOR . ucfirst($view) . '.php'; if ($view != null && file_exists($controllerFile)) { require_once $controllerFile; $controllerClass = 'EventgalleryController' . ucfirst($view); $controller = new $controllerClass(); } /** * @var JControllerLegacy $controller */ $controller->execute(JFactory::getApplication()->input->get('task')); $controller->redirect();