/** * * @access private * @return string */ function getCSS($isRTL = false, $template = '') { global $mainframe; if (empty($template)) { $config =& JCommentsCfg::getInstance(); $template = $config->get('template'); } $cssName = $isRTL ? 'style_rtl.css' : 'style.css'; $cssFile = $cssName . '?v=12'; if (JCOMMENTS_JVERSION == '1.0') { global $mosConfig_live_site, $mosConfig_absolute_path; $cssUrl = $mosConfig_live_site . '/components/com_jcomments/tpl/' . $template . '/' . $cssFile; } else { $cssPath = JPATH_SITE . DS . 'templates' . DS . $mainframe->getTemplate() . DS . 'html' . DS . 'com_jcomments' . DS . $template . DS . $cssName; $cssUrl = JURI::root(true) . '/templates/' . $mainframe->getTemplate() . '/html/com_jcomments/' . $template . '/' . $cssFile; if (!is_file($cssPath)) { $cssPath = JPATH_SITE . DS . 'components' . DS . 'com_jcomments' . DS . 'tpl' . DS . $template . DS . $cssName; $cssUrl = JURI::root(true) . '/components/com_jcomments/tpl/' . $template . '/' . $cssFile; if ($isRTL && !is_file($cssPath)) { $cssUrl = ''; } } } return $cssUrl; }
public static function getCSS($isRTL = false, $template = '') { $app = JFactory::getApplication('site'); if (empty($template)) { $config = JCommentsCfg::getInstance(); $template = $config->get('template'); } $cssName = $isRTL ? 'style_rtl.css' : 'style.css'; $cssFile = $cssName . '?v=30'; $cssPath = JPATH_SITE . '/templates/' . $app->getTemplate() . '/html/com_jcomments/' . $template . '/' . $cssName; $cssUrl = JURI::root(true) . '/templates/' . $app->getTemplate() . '/html/com_jcomments/' . $template . '/' . $cssFile; if (!is_file($cssPath)) { $cssPath = JPATH_SITE . '/components/com_jcomments/tpl/' . $template . '/' . $cssName; $cssUrl = JURI::root(true) . '/components/com_jcomments/tpl/' . $template . '/' . $cssFile; if ($isRTL && !is_file($cssPath)) { $cssUrl = ''; } } return $cssUrl; }
public static function getCSS($isRTL = false, $template = '') { if (empty($template)) { $config = JCommentsCfg::getInstance(); $template = $config->get('template'); } $cssName = $isRTL ? 'style_rtl.css' : 'style.css'; $cssFile = $cssName . '?v=21'; if (JCOMMENTS_JVERSION == '1.0') { $cssUrl = JCommentsSystemPluginHelper::getBaseUrl() . '/components/com_jcomments/tpl/' . $template . '/' . $cssFile; } else { $app = JCommentsFactory::getApplication('site'); $cssPath = JPATH_SITE . '/templates/' . $app->getTemplate() . '/html/com_jcomments/' . $template . '/' . $cssName; $cssUrl = JURI::root(true) . '/templates/' . $app->getTemplate() . '/html/com_jcomments/' . $template . '/' . $cssFile; if (!is_file($cssPath)) { $cssPath = JPATH_SITE . '/components/com_jcomments/tpl/' . $template . '/' . $cssName; $cssUrl = JURI::root(true) . '/components/com_jcomments/tpl/' . $template . '/' . $cssFile; if ($isRTL && !is_file($cssPath)) { $cssUrl = ''; } } } return $cssUrl; }
/** * Returns a reference to the global {@link JCommentsCfg} object, * only creating it if it doesn't already exist. * * @param $language string Language * @return JCommentsCfg */ public static function getConfig($language = '') { return JCommentsCfg::getInstance($language); }
function onAfterRoute() { include_once JPATH_ROOT . DS . 'components' . DS . 'com_jcomments' . DS . 'jcomments.legacy.php'; $mainframe =& JFactory::getApplication('site'); $mainframe->getRouter(); $document =& JFactory::getDocument(); if ($document->getType() == 'pdf') { return; } if ($mainframe->isAdmin()) { $document->addStyleSheet(JURI::base() . 'components/com_jcomments/assets/icon.css?v=2'); $option = JAdministratorHelper::findOption(); $task = JRequest::getCmd('task'); $type = JRequest::getCmd('type', '', 'post'); // remove comments if content item deleted from trash if ($option == 'com_trash' && $task == 'delete' && $type == 'content') { $cid = JRequest::getVar('cid', array(0), 'post', 'array'); JArrayHelper::toInteger($cid, array(0)); include_once JPATH_ROOT . DS . 'components' . DS . 'com_jcomments' . DS . 'jcomments.php'; JComments::deleteComments($cid, 'com_content'); } } else { $option = JRequest::getCmd('option'); if ($option == 'com_content' || $option == 'com_alphacontent') { include_once JCOMMENTS_BASE . DS . 'jcomments.class.php'; include_once JCOMMENTS_BASE . DS . 'jcomments.config.php'; include_once JCOMMENTS_HELPERS . DS . 'system.php'; // include JComments CSS if ($this->params->get('disable_template_css', 0) == 0) { $document->addStyleSheet(JCommentsSystemPluginHelper::getCSS()); $language =& JFactory::getLanguage(); if ($language->isRTL()) { $rtlCSS = JCommentsSystemPluginHelper::getCSS(true); if ($rtlCSS != '') { $document->addStyleSheet($rtlCSS); } } } if (!defined('JCOMMENTS_CSS')) { define('JCOMMENTS_CSS', 1); } $config =& JCommentsCfg::getInstance(); // include JComments JavaScript library $document->addScript(JCommentsSystemPluginHelper::getCoreJS()); if (!defined('JOOMLATUNE_AJAX_JS')) { $document->addScript(JCommentsSystemPluginHelper::getAjaxJS()); define('JOOMLATUNE_AJAX_JS', 1); } if (!defined('JCOMMENTS_JS')) { define('JCOMMENTS_JS', 1); } } } }
/** * Returns a reference to the global {@link JCommentsCfg} object, * only creating it if it doesn't already exist. * * @static * @access public * @param $language string Language * @return JCommentsCfg */ function &getConfig($language = '') { return JCommentsCfg::getInstance($language); }