/** * Method to load the MooTools framework into the document head * * If debugging mode is on an uncompressed version of MooTools is included for easier debugging. * * @param string $extras MooTools file to load * @param boolean $debug Is debugging mode on? [optional] * * @return void * * @since 11.1 */ public static function framework($extras = false, $debug = null) { // $$$ rob this is to stop mootools from being re-loaded when in an ajax loaded page, as that // resets the window events, stopping Fabriks mediator js system from working (e.g. fabrik.form.submitted will not // fire the events added when the url initially loads.) if (FabrikHelperHTML::inAjaxLoadedPage()) { return; } static $loaded = array(); $type = $extras ? 'more' : 'core'; // Only load once if (!empty($loaded[$type])) { return; } JHtml::core($debug); // If no debugging value is set, use the configuration setting if ($debug === null) { $config = JFactory::getConfig(); $debug = $config->get('debug'); } $uncompressed = $debug ? '-uncompressed' : ''; if ($type != 'core' && empty($loaded['core'])) { self::framework(false, $debug); } JHtml::_('script', 'system/mootools-' . $type . $uncompressed . '.js', false, true, false, false); $loaded[$type] = true; return; }
/** * Method to load the MooTools framework into the document head * * If debugging mode is on an uncompressed version of MooTools is included for easier debugging. * * @param string $extras MooTools file to load * @param boolean $debug Is debugging mode on? [optional] * * @return void * * @since 11.1 */ public static function framework($extras = false, $debug = null) { static $loaded = array(); $type = $extras ? 'more' : 'core'; // Only load once if (!empty($loaded[$type])) { return; } JHtml::core($debug); // If no debugging value is set, use the configuration setting if ($debug === null) { $config = JFactory::getConfig(); $debug = $config->get('debug'); } $uncompressed = $debug ? '-uncompressed' : ''; if ($type != 'core' && empty($loaded['core'])) { self::framework(false, $debug); } JHtml::_('script', 'system/mootools-' . $type . $uncompressed . '.js', false, true, false, false); $loaded[$type] = true; return; }
/** * Custom Constructor */ function __construct($default = array()) { parent::__construct($default); $view = JRequest::getWord('view', 'cpanel'); $this->registerTask('apply', 'save'); $this->registerTask('unpublish', 'publish'); // load classes wfimport('admin.classes.installer'); // load helpers wfimport('admin.helpers.parameter'); wfimport('admin.helpers.extension'); wfimport('admin.helpers.xml'); $document = JFactory::getDocument(); $document->setTitle(WFText::_('WF_ADMINISTRATION') . ' :: ' . WFText::_('WF_' . strtoupper($view))); $language = JFactory::getLanguage(); $language->load('com_jce', JPATH_ADMINISTRATOR); $model = $this->getModel($view); // jquery versions $document->addScript(JURI::root(true) . '/components/com_jce/editor/libraries/js/jquery/jquery-' . WF_JQUERY . '.min.js?version=' . $model->getVersion()); $document->addScript(JURI::root(true) . '/components/com_jce/editor/libraries/js/jquery/jquery-ui-' . WF_JQUERYUI . '.custom.min.js?version=' . $model->getVersion()); // jQuery noConflict $document->addScriptDeclaration('jQuery.noConflict();'); $scripts = array(); switch ($view) { case 'help': $scripts[] = 'help.js'; break; default: // load Joomla! core javascript if (method_exists('JHtml', 'core')) { JHtml::core(); } require_once JPATH_ADMINISTRATOR . DS . 'includes' . DS . 'toolbar.php'; JToolBarHelper::title(WFText::_('WF_ADMINISTRATION') . ' ›› ' . WFText::_('WF_' . strtoupper($view)), 'logo.png'); $params = WFParameterHelper::getComponentParams(); $theme = $params->get('preferences.theme', 'jce'); $scripts = array_merge(array('tips.js', 'html5.js')); // Load admin scripts $document->addScript(JURI::root(true) . '/administrator/components/com_jce/media/js/jce.js?version=' . $model->getVersion()); $options = array('labels' => array('ok' => WFText::_('WF_LABEL_OK'), 'cancel' => WFText::_('WF_LABEL_CANCEL'), 'select' => WFText::_('WF_LABEL_SELECT'), 'save' => WFText::_('WF_LABEL_SAVE'), 'saveclose' => WFText::_('WF_LABEL_SAVECLOSE'), 'alert' => WFText::_('WF_LABEL_ALERT'), 'required' => WFText::_('WF_MESSAGE_REQUIRED'))); $document->addScriptDeclaration('jQuery(document).ready(function($){$.jce.init(' . json_encode($options) . ');});'); $installer = WFInstaller::getInstance(); $installer->check(); break; } // Load site scripts foreach ($scripts as $script) { $document->addScript(JURI::root(true) . '/components/com_jce/editor/libraries/js/' . $script . '?version=' . $model->getVersion()); } require_once dirname(__FILE__) . DS . 'helpers' . DS . 'system.php'; $app = JFactory::getApplication(); $app->registerEvent('onAfterRender', 'WFSystemHelper'); }
/** * Method to load the mootools framework into the document head * * - If debugging mode is on an uncompressed version of mootools is included for easier debugging. * * @static * @param string $type Mootools file to load * @param boolean $debug Is debugging mode on? [optional] * @return void * @since 1.6 */ public static function framework($extras = false, $debug = null) { static $loaded = array(); $type = $extras ? 'more' : 'core'; // Only load once if (!empty($loaded[$type])) { return; } JHtml::core($debug); // If no debugging value is set, use the configuration setting if ($debug === null) { $config =& JFactory::getConfig(); $debug = $config->getValue('config.debug'); } // TODO NOTE: Here we are checking for Konqueror - If they fix thier issue with compressed, we will need to update this $konkcheck = isset($_SERVER['HTTP_USER_AGENT']) ? strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'konqueror') : null; $uncompressed = $debug || $konkcheck ? '-uncompressed' : ''; if ($type != 'core' && empty($loaded['core'])) { self::framework(false); } JHtml::script('mootools-' . $type . $uncompressed . '.js', 'media/system/js/', false); $loaded[$type] = true; return; }
/** * @version $Id: blog_item.php 20488 2011-01-30 18:56:00Z dextercowley $ * @package Joomla.Site * @subpackage com_content * @copyright Copyright (C) 2005 - 2011 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // no direct access defined('_JEXEC') or die; // Create a shortcut for params. $params =& $this->item->params; $canEdit = $this->item->params->get('access-edit'); JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html'); JHtml::_('behavior.tooltip'); JHtml::core(); ?> <?php if ($this->item->state == 0) { ?> <div class="system-unpublished"> <?php } if ($params->get('show_title')) { ?> <h2> <?php if ($params->get('link_titles') && $params->get('access-view')) { ?> <a href="<?php
/** * Write a <script></script> element * @param string path to file * @param boolean load the JS framework * @param boolean path to file is relative to /media folder * @param boolean return the path to the file only * @param boolean detect browser to include specific browser js files * @return mixed nothing if $path_only is false, null, path or array of path if specific js browser files were detected * @see JHtml::stylesheet * @since 1.6 */ public static function script($file, $framework = false, $relative = false, $path_only = false, $detect_browser = true) { JHtml::core(); // Need to adjust for the change in API from 1.5 to 1.6. // function script($filename, $path = 'media/system/js/', $mootools = true) if (is_string($framework)) { // Assume this was the old $path variable. $file = $framework . $file; $framework = $relative; } // Include mootools framework if ($framework) { JHtml::_('behavior.framework'); } $includes = self::_includeRelativeFiles($file, $relative, $detect_browser, 'js'); // if only path is required if ($path_only) { if (count($includes) == 0) { return null; } elseif (count($includes) == 1) { return $includes[0]; } else { return $includes; } } else { $document = JFactory::getDocument(); foreach ($includes as $include) { $document->addScript($include); } } }
/** * Create the View. * This is an overloaded function of JController::getView * and includes addition of the JDocument Object with required scripts and styles * @return object */ public function getView($name = '', $type = '', $prefix = '', $config = array()) { $language = JFactory::getLanguage(); $language->load('com_jce', JPATH_ADMINISTRATOR); $document = JFactory::getDocument(); if (!$name) { $name = JRequest::getWord('view', 'cpanel'); } if (!$type) { $type = $document->getType(); } if (empty($config)) { $config = array('base_path' => dirname(__FILE__)); } $view = parent::getView($name, $type, $prefix, $config); $document = JFactory::getDocument(); $document->setTitle(WFText::_('WF_ADMINISTRATION') . ' :: ' . WFText::_('WF_' . strtoupper($name))); $model = $this->getModel($name); // jquery versions $document->addScript(JURI::root(true) . '/components/com_jce/editor/libraries/js/jquery/jquery-' . WF_JQUERY . '.min.js?version=' . $model->getVersion()); $document->addScript(JURI::root(true) . '/components/com_jce/editor/libraries/js/jquery/jquery-ui-' . WF_JQUERYUI . '.custom.min.js?version=' . $model->getVersion()); // jQuery noConflict $document->addScriptDeclaration('jQuery.noConflict();'); $scripts = array(); switch ($name) { case 'help': $scripts[] = 'help.js'; break; default: // load Joomla! core javascript if (method_exists('JHtml', 'core')) { JHtml::core(); } require_once JPATH_ADMINISTRATOR . DS . 'includes' . DS . 'toolbar.php'; JToolBarHelper::title(WFText::_('WF_ADMINISTRATION') . ' ›› ' . WFText::_('WF_' . strtoupper($name)), 'logo.png'); $params = WFParameterHelper::getComponentParams(); $theme = $params->get('preferences.theme', 'jce'); $scripts = array_merge(array('tips.js', 'html5.js')); // Load admin scripts $document->addScript(JURI::root(true) . '/administrator/components/com_jce/media/js/jce.js?version=' . $model->getVersion()); $options = array('labels' => array('ok' => WFText::_('WF_LABEL_OK'), 'cancel' => WFText::_('WF_LABEL_CANCEL'), 'select' => WFText::_('WF_LABEL_SELECT'), 'save' => WFText::_('WF_LABEL_SAVE'), 'saveclose' => WFText::_('WF_LABEL_SAVECLOSE'), 'alert' => WFText::_('WF_LABEL_ALERT'), 'required' => WFText::_('WF_MESSAGE_REQUIRED'))); $document->addScriptDeclaration('jQuery(document).ready(function($){$.jce.init(' . json_encode($options) . ');});'); $view->addHelperPath(dirname(__FILE__) . DS . 'helpers'); $this->addModelPath(dirname(__FILE__) . DS . 'models'); $view->loadHelper('toolbar'); $view->loadHelper('tools'); $view->loadHelper('xml'); $view->loadHelper($name); $this->loadMenu(); break; } if ($model = $this->getModel($name)) { $view->setModel($model, true); } // Load site scripts foreach ($scripts as $script) { $document->addScript(JURI::root(true) . '/components/com_jce/editor/libraries/js/' . $script . '?version=' . $model->getVersion()); } require_once dirname(__FILE__) . DS . 'helpers' . DS . 'system.php'; $app = JFactory::getApplication(); $app->registerEvent('onAfterRender', 'WFSystemHelper'); $view->assignRef('document', $document); return $view; }
/** * Create the View. * This is an overloaded function of JController::getView * and includes addition of the JDocument Object with required scripts and styles * @return object */ public function getView($name = '', $type = '', $prefix = '', $config = array()) { $language = JFactory::getLanguage(); $language->load('com_jce', JPATH_ADMINISTRATOR); $document = JFactory::getDocument(); if (!$name) { $name = JRequest::getWord('view', 'cpanel'); } if (!$type) { $type = $document->getType(); } if (empty($config)) { $config = array('base_path' => dirname(__FILE__)); } $model = $this->getModel($name); $view = parent::getView($name, $type, $prefix, $config); $document = JFactory::getDocument(); $bootstrap = class_exists('JHtmlBootstrap'); $jquery = class_exists('JHtmlJquery'); $view->addStyleSheet(JURI::root(true) . '/administrator/components/com_jce/media/css/global.css?version=' . $model->getVersion()); // using JUI... if (!$bootstrap || !$jquery) { // set device-width meta $document->setMetaData('meta', 'width=device-width, initial-scale=1.0'); $view->addStyleSheet(JURI::root(true) . '/administrator/components/com_jce/media/css/styles-ui.css?version=' . $model->getVersion()); // JQuery UI $view->addScript(JURI::root(true) . '/components/com_jce/editor/libraries/jquery/js/jquery-' . WF_JQUERY . '.min.js?version=' . $model->getVersion()); // jQuery noConflict $view->addScriptDeclaration('jQuery.noConflict();'); } // JQuery UI $view->addScript(JURI::root(true) . '/components/com_jce/editor/libraries/jquery/js/jquery-ui-' . WF_JQUERYUI . '.custom.min.js?version=' . $model->getVersion()); // JQuery Touch Punch $view->addScript(JURI::root(true) . '/components/com_jce/editor/libraries/jquery/js/jquery.ui.touch-punch.min.js?version=' . $model->getVersion()); $scripts = array(); switch ($name) { case 'help': $view->addScript(JURI::root(true) . '/components/com_jce/editor/libraries/js/help.js?version=' . $model->getVersion()); break; default: // load Joomla! core javascript if (method_exists('JHtml', 'core')) { JHtml::core(); } require_once JPATH_ADMINISTRATOR . '/includes/toolbar.php'; JToolBarHelper::title(WFText::_('WF_ADMINISTRATION') . ' ›› ' . WFText::_('WF_' . strtoupper($name)), 'logo.png'); $params = WFParameterHelper::getComponentParams(); $theme = $params->get('preferences.theme', 'jce'); $view->addScript(JURI::root(true) . '/components/com_jce/editor/libraries/js/tips.js'); $view->addScript(JURI::root(true) . '/components/com_jce/editor/libraries/js/html5.js'); $view->addScript(JURI::root(true) . '/administrator/components/com_jce/media/js/jce.js'); $options = array('labels' => array('ok' => WFText::_('WF_LABEL_OK'), 'cancel' => WFText::_('WF_LABEL_CANCEL'), 'select' => WFText::_('WF_LABEL_SELECT'), 'save' => WFText::_('WF_LABEL_SAVE'), 'saveclose' => WFText::_('WF_LABEL_SAVECLOSE'), 'alert' => WFText::_('WF_LABEL_ALERT'), 'required' => WFText::_('WF_MESSAGE_REQUIRED')), 'bootstrap' => $bootstrap); $view->addScriptDeclaration('jQuery(document).ready(function($){$.jce.init(' . json_encode($options) . ');});'); //$document->addCustomTag('<script type="text/javascript">jQuery(document).ready(function($){$.jce.init(' . json_encode($options) . ');});</script>'); $view->addHelperPath(dirname(__FILE__) . '/helpers'); $this->addModelPath(dirname(__FILE__) . '/models'); $view->loadHelper('toolbar'); $view->loadHelper('tools'); $view->loadHelper('xml'); $view->loadHelper($name); $this->loadMenu(); break; } if ($model = $this->getModel($name)) { $view->setModel($model, true); } $view->assignRef('document', $document); return $view; }
/** * Write a <script></script> element * * @access public * @param string The name of the script file * * @param string The relative or absolute path of the script file * @param boolean If true, the mootools library will be loaded * @since 1.5 */ public static function script($filename, $path = 'media/system/js/', $framework = false) { JHtml::core(); // Include mootools framework if ($framework) { JHtml::_('behavior.framework'); } if (strpos($path, 'http') !== 0) { $path = JURI::root(true) . '/' . $path; } $document =& JFactory::getDocument(); $document->addScript($path . $filename); return; }
/** * Create the View. * This is an overloaded function of JController::getView * and includes addition of the JDocument Object with required scripts and styles * @return object */ public function getView($name = '', $type = '', $prefix = '', $config = array()) { $language = JFactory::getLanguage(); $language->load('com_jce', JPATH_ADMINISTRATOR); $document = JFactory::getDocument(); if (!$name) { $name = JRequest::getWord('view', 'cpanel'); } if (!$type) { $type = $document->getType(); } if (empty($config)) { $config = array('base_path' => dirname(__FILE__)); } $model = $this->getModel($name); $view = parent::getView($name, $type, $prefix, $config); $document = JFactory::getDocument(); // set device-width meta $document->setMetaData('meta', 'width=device-width, initial-scale=1.0'); $version = new JVersion(); if ($version->isCompatible('3.0')) { // Include jQuery JHtml::_('jquery.framework'); } else { // JQuery $view->addScript(JURI::root(true) . '/components/com_jce/editor/libraries/jquery/js/jquery.min.js'); // jQuery noConflict $view->addScriptDeclaration('jQuery.noConflict();'); } // JQuery UI $view->addScript(JURI::root(true) . '/components/com_jce/editor/libraries/jquery/js/jquery-ui.min.js'); $scripts = array(); switch ($name) { case 'help': $view->addScript(JURI::root(true) . '/components/com_jce/editor/libraries/js/help.js'); break; default: $view->addStyleSheet(JURI::root(true) . '/administrator/components/com_jce/media/css/global.css'); // load Joomla! core javascript if (method_exists('JHtml', 'core')) { JHtml::core(); } require_once JPATH_ADMINISTRATOR . '/includes/toolbar.php'; JToolBarHelper::title(WFText::_('WF_ADMINISTRATION') . ' :: ' . WFText::_('WF_' . strtoupper($name)), 'logo.png'); $params = WFParameterHelper::getComponentParams(); $theme = $params->get('preferences.theme', 'jce'); $view->addScript(JURI::root(true) . '/administrator/components/com_jce/media/js/core.js'); $options = array('labels' => array('ok' => WFText::_('WF_LABEL_OK'), 'cancel' => WFText::_('WF_LABEL_CANCEL'), 'select' => WFText::_('WF_LABEL_SELECT'), 'save' => WFText::_('WF_LABEL_SAVE'), 'saveclose' => WFText::_('WF_LABEL_SAVECLOSE'), 'alert' => WFText::_('WF_LABEL_ALERT'), 'required' => WFText::_('WF_MESSAGE_REQUIRED'))); $view->addScriptDeclaration('jQuery.jce.options = ' . json_encode($options) . ';'); $view->addHelperPath(dirname(__FILE__) . '/helpers'); $this->addModelPath(dirname(__FILE__) . '/models'); $view->loadHelper('toolbar'); $view->loadHelper('xml'); $view->loadHelper($name); $this->loadMenu(); break; } if ($model = $this->getModel($name)) { $view->setModel($model, true); } $view->assignRef('document', $document); return $view; }