当前位置: 首页>>代码示例>>PHP>>正文


PHP JHtml::core方法代码示例

本文整理汇总了PHP中JHtml::core方法的典型用法代码示例。如果您正苦于以下问题:PHP JHtml::core方法的具体用法?PHP JHtml::core怎么用?PHP JHtml::core使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在JHtml的用法示例。


在下文中一共展示了JHtml::core方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: framework

 /**
  * 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;
 }
开发者ID:rogeriocc,项目名称:fabrik,代码行数:40,代码来源:behavior.php

示例2: framework

	/**
	 * 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;
	}
开发者ID:nikosdion,项目名称:Akeeba-Example,代码行数:45,代码来源:behavior.php

示例3: __construct

 /**
  * 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');
 }
开发者ID:andreassetiawanhartanto,项目名称:PDKKI,代码行数:56,代码来源:controller.php

示例4: framework

 /**
  * 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;
 }
开发者ID:joebushi,项目名称:joomla,代码行数:35,代码来源:behavior.php

示例5: defined

/**
 * @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 
开发者ID:reechalee,项目名称:joomla1.6,代码行数:30,代码来源:blog_item.php

示例6: script

 /**
  * 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);
         }
     }
 }
开发者ID:akksi,项目名称:jcg,代码行数:42,代码来源:html.php

示例7: getView

 /**
  * 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') . ' &rsaquo;&rsaquo; ' . 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;
 }
开发者ID:srbsnkr,项目名称:sellingonlinemadesimple,代码行数:70,代码来源:controller.php

示例8: getView

 /**
  * 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') . ' &rsaquo;&rsaquo; ' . 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;
 }
开发者ID:01J,项目名称:bealtine,代码行数:75,代码来源:controller.php

示例9: script

 /**
  * 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;
 }
开发者ID:joebushi,项目名称:joomla,代码行数:23,代码来源:html.php

示例10: getView

 /**
  * 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;
 }
开发者ID:grlf,项目名称:eyedock,代码行数:69,代码来源:controller.php


注:本文中的JHtml::core方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。