public function attach() { if (self::$attached) { return; } parent::attach(); if ($this->environment !== "development") { // Get resources $compiler = new EasyBlogCompiler(); $resource = $compiler->getResources(); // Attach resources if (!empty($resource)) { $scriptTag = $this->createScriptTag($resource["uri"]); $document = JFactory::getDocument(); $document->addCustomTag($scriptTag); } } self::$attached = true; }
/** * Load's foundry's configuration library * * @since 4.0 * @access public * @param string * @return */ public static function configuration($section = 'site') { require_once __DIR__ . '/configuration/configuration.php'; $lib = EasyBlogConfiguration::getInstance($section); return $lib; }
public static function loadHeaders() { $document = JFactory::getDocument(); if ($document->getType() !== 'html') { return; } if (!self::$headersLoaded) { $config = EasyBlogHelper::getConfig(); $enableLightbox = $config->get('main_media_lightbox_preview') ? 'true' : 'false'; $lightboxTitle = $config->get('main_media_show_lightbox_caption') ? 'true' : 'false'; $enforceLightboxSize = $config->get('main_media_lightbox_enforce_size') ? 'true' : 'false'; $lightboxWidth = $config->get('main_media_lightbox_max_width'); $lightboxHeight = $config->get('main_media_lightbox_max_height'); $lightboxStripExtension = $config->get('main_media_lightbox_caption_strip_extension') ? 'true' : 'false'; $lightboxWidth = empty($lightboxWidth) ? '640' : $lightboxWidth; $lightboxHeight = empty($lightboxHeight) ? '480' : $lightboxHeight; $url = EasyBlogHelper::getBaseUrl(); $document = JFactory::getDocument(); // @task: Legacy ejax global variables. $ajaxData = "/*<![CDATA[*/\n\tvar eblog_site \t= '" . $url . "';\n\tvar spinnerPath = '" . EBLOG_SPINNER . "';\n\tvar lang_direction\t= '" . $document->direction . "';\n\tvar eblog_lightbox_title = " . $lightboxTitle . ";\n\tvar eblog_enable_lightbox = " . $enableLightbox . ";\n\tvar eblog_lightbox_enforce_size = " . $enforceLightboxSize . ";\n\tvar eblog_lightbox_width = " . $lightboxWidth . ";\n\tvar eblog_lightbox_height = " . $lightboxHeight . ";\n\tvar eblog_lightbox_strip_extension = " . $lightboxStripExtension . ";\n/*]]>*/"; $document->addScriptDeclaration($ajaxData); EasyBlogHelper::addTemplateCss('common.css'); // Load EasyBlogConfiguration class require_once EBLOG_CLASSES . DIRECTORY_SEPARATOR . 'configuration.php'; // Get configuration instance $configuration = EasyBlogConfiguration::getInstance(); // Attach configuration to headers $configuration->attach(); self::$headersLoaded = true; } return self::$headersLoaded; }
/** * This is where all the javascripts would be attached on the page. * * @since 5.0 * @access public * @param string * @return */ public function attach($section = 'site') { $this->section = $section; if (isset(self::$attached[$section])) { return; } parent::attach(); self::$attached = true; }