Пример #1
0
    /**
     * Insert javascript for form of new post
     */
    function call_javascript_form()
    {
        CKunenaTools::addScript(KUNENA_DIRECTURL . 'template/default/plugin/poll/js/kunena.poll-min.js');
        $this->document->addScriptDeclaration('// <![CDATA[
	   var KUNENA_POLL_CATS_NOT_ALLOWED = "' . JText::_('COM_KUNENA_POLL_CATS_NOT_ALLOWED') . '";
	   var KUNENA_EDITOR_HELPLINE_OPTION = "' . JText::_('COM_KUNENA_EDITOR_HELPLINE_OPTION') . '";
	   var KUNENA_POLL_OPTION_NAME = "' . JText::_('COM_KUNENA_POLL_OPTION_NAME') . '";
	   var KUNENA_POLL_NUMBER_OPTIONS_MAX_NOW = "' . JText::_('COM_KUNENA_POLL_NUMBER_OPTIONS_MAX_NOW') . '";
	   var KUNENA_ICON_ERROR = "' . JURI::root() . 'components/com_kunena/template/default/images/icons/publish_x.png' . '";
	   var kunena_ajax_url_poll = "' . CKunenaLink::GetJsonURL('pollcatsallowed') . '";
	// ]]>');
    }
Пример #2
0
 public function loadMootools()
 {
     if (KUNENA_JOOMLA_COMPAT == '1.5') {
         jimport('joomla.plugin.helper');
         $mtupgrade = JPluginHelper::isEnabled('system', 'mtupgrade');
         if (!$mtupgrade) {
             $app = JFactory::getApplication();
             if (!class_exists('JHTMLBehavior')) {
                 if (is_dir(JPATH_PLUGINS . '/system/mtupgrade')) {
                     JHTML::addIncludePath(JPATH_PLUGINS . '/system/mtupgrade');
                 } else {
                     // TODO: translate
                     KunenaError::warning('<em>System - MooTools Upgrade</em> plug-in is not installed into your system. Many features, including the BBCode editor, may be broken.', 'notice');
                 }
             }
         }
         JHTML::_('behavior.mootools');
         // Get the MooTools version string
         $mtversion = preg_replace('/[^\\d\\.]/', '', JFactory::getApplication()->get('MooToolsVersion'));
         if (version_compare($mtversion, '1.2.4', '<')) {
             // TODO: translate
             KunenaError::warning('Your site is not using <em>System - MooTools Upgrade</em> (or compatible) plug-in. Many features, including the BBCode editor, may be broken.');
         }
     } else {
         // Joomla 1.6+
         JHTML::_('behavior.framework', true);
     }
     if (KunenaFactory::getConfig()->debug) {
         // Debugging Mootools issues
         CKunenaTools::addScript(KUNENA_DIRECTURL . 'template/default/js/debug-min.js');
     }
 }
Пример #3
0
$template->addScript('js/default.js');
$rtl = JFactory::getLanguage()->isRTL();
$skinner = $template->params->get('enableSkinner', 0);
// START JoomForest Functions ------------------------------------------------------------------------------
if ($template->params->get('jf-enablejQuery', 0)) {
    CKunenaTools::addScript(KUNENA_DIRECTURL . 'template/jf_corporate/js/jquery_1.5-jquery_ui.min.js');
}
if ($template->params->get('jf-enablejQuery-noConflict', 0)) {
    $document->addCustomTag('<script type="text/javascript">jQuery.noConflict();</script>');
}
if ($template->params->get('jf-enablefont', 0)) {
    CKunenaTools::addStyleSheet('http://fonts.googleapis.com/css?family=Yanone+Kaffeesatz');
}
if ($template->params->get('jf-enablePiroBox', 0)) {
    CKunenaTools::addStyleSheet(KUNENA_DIRECTURL . 'template/jf_corporate/css/jf-pirobox.css');
    CKunenaTools::addScript(KUNENA_DIRECTURL . 'template/jf_corporate/js/pirobox_extended_feb_2011.js');
    $document->addCustomTag('<script type="text/javascript">jQuery(document).ready(function(){jQuery.piroBox_ext({piro_speed:700,bg_alpha:0.5,piro_scroll:true,piro_drag:false,piro_nav_pos:"bottom"})});</script>');
}
// END JoomForest Functions ------------------------------------------------------------------------------
if (file_exists(JPATH_ROOT . "/templates/{$app->getTemplate()}/css/kunena.forum.css")) {
    // Load css from Joomla template
    CKunenaTools::addStyleSheet(JURI::root(true) . "templates/{$app->getTemplate()}/css/kunena.forum.css");
    if ($skinner && file_exists(JPATH_ROOT . "templates/{$app->getTemplate()}/css/kunena.skinner.css")) {
        CKunenaTools::addStyleSheet(JURI::root(true) . "templates/{$app->getTemplate()}/css/kunena.skinner.css");
    } elseif (!$skinner && file_exists(JPATH_ROOT . "templates/{$app->getTemplate()}/css/kunena.default.css")) {
        CKunenaTools::addStyleSheet(JURI::root(true) . "templates/{$app->getTemplate()}/css/kunena.default.css");
    }
} else {
    // Load css from default template
    $template->addStyleSheet('css/kunena.forum.css');
    if ($skinner) {
Пример #4
0
$kunena_config = KunenaFactory::getConfig();
$document = JFactory::getDocument();
$template = KunenaFactory::getTemplate();
$this->params = $template->params;
$rtl = JFactory::getLanguage()->isRTL();
// Template requires Mootools 1.2 framework
$template->loadMootools();
// We load mediaxboxadvanced library only if configuration setting allow it
if ($kunena_config->lightbox == 1) {
    // We load mediaxboxadvanced library
    CKunenaTools::addStyleSheet(KUNENA_DIRECTURL . 'js/mediaboxadvanced/css/mediaboxAdv.css');
    CKunenaTools::addScript(KUNENA_DIRECTURL . 'js/mediaboxadvanced/js/mediaboxAdv.js');
}
// New Kunena JS for default template
// TODO: Need to check if selected template has an override
CKunenaTools::addScript(KUNENA_DIRECTURL . 'template/default/js/default-min.js');
$skinner = $this->params->get('enableSkinner', 0);
if (file_exists(KUNENA_JTEMPLATEPATH . '/css/kunena.forum.css')) {
    // Load css from Joomla template
    CKunenaTools::addStyleSheet(KUNENA_JTEMPLATEURL . 'css/kunena.forum-min.css', $rtl);
    if ($skinner && file_exists(KUNENA_JTEMPLATEPATH . '/css/kunena.skinner.css')) {
        CKunenaTools::addStyleSheet(KUNENA_JTEMPLATEURL . 'css/kunena.skinner-min.css', $rtl);
    } elseif (!$skinner && file_exists(KUNENA_JTEMPLATEPATH . '/css/kunena.default.css')) {
        CKunenaTools::addStyleSheet(KUNENA_JTEMPLATEURL . 'css/kunena.default-min.css', $rtl);
    }
} else {
    if (file_exists(KUNENA_ABSTMPLTPATH . '/css/kunena.forum.css')) {
        // Load css from the current template
        CKunenaTools::addStyleSheet(KUNENA_TMPLTCSSURL, $rtl);
        if ($skinner && file_exists(KUNENA_ABSTMPLTPATH . '/css/kunena.skinner.css')) {
            CKunenaTools::addStyleSheet(KUNENA_TMPLTURL . 'css/kunena.skinner-min.css', $rtl);