JHTMLBehavior/mootools: Difference between revisions
From Joomla! Documentation
m removing red link to edit, no existant pages |
m preparing for archive only |
||
| Line 66: | Line 66: | ||
===Examples=== | ===Examples=== | ||
=== Code Examples === | |||
<dpl> | <dpl> | ||
noresultsheader=\n | noresultsheader=\n | ||
category=mootools | category=mootools | ||
category=JHTMLBehavior | category=JHTMLBehavior | ||
namespace=CodeExample | |||
category=MethodExample | category=MethodExample | ||
include=* | include=* | ||
Latest revision as of 00:39, 25 March 2017
Description
Method to load the mootools framework into the document head
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
mootools($debug=null)
| Parameter Name | Default Value | Description |
|---|---|---|
| $debug | null | $debug Is debugging mode on? [optional] |
Returns
void
Defined in
libraries/joomla/html/html/behavior.php
Importing
jimport( 'joomla.html.html.behavior' );
Source Body
function mootools($debug = null)
{
static $loaded;
// Only load once
if ($loaded) {
return;
}
// 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;
if ($debug || $konkcheck) {
JHTML::script('mootools-uncompressed.js', 'media/system/js/', false);
} else {
JHTML::script('mootools.js', 'media/system/js/', false);
}
$loaded = true;
return;
}
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
Code Examples
A typical example of loading MooTools
Chris Davenport 01:07, 22 April 2010 (EDT) Edit comment