Joomla CMS  3.8.5 (avec JPlatform 13.1 inclus)
Documentation des API du CMS Joomla en version 3.8.5 et du framework Joomla Platform intégré
Référence de la classe JHtmlBehavior

Fonctions membres publiques statiques

static framework ($extras=false, $debug=null)
 
static core ()
 
static caption ($selector='img.caption')
 
static formvalidation ()
 
static formvalidator ()
 
static switcher ()
 
static combobox ()
 
static tooltip ($selector='.hasTip', $params=array())
 
static modal ($selector='a.modal', $params=array())
 
static multiselect ($id='adminForm')
 
static tree ($id, $params=array(), $root=array())
 
static calendar ()
 
static colorpicker ()
 
static simplecolorpicker ()
 
static keepalive ()
 
static highlighter (array $terms, $start='highlighter-start', $end='highlighter-end', $className='highlight', $tag='span')
 
static noframes ()
 
static tabstate ()
 
static polyfill ($polyfillTypes=null, $conditionalBrowser=null)
 

Fonctions membres protégées statiques

static _getJSObject ($array=array())
 
static calendartranslation ()
 

Attributs protégés statiques

static $loaded = array()
 

Description détaillée

Utility class for JavaScript behaviors

Depuis
1.5

Documentation des fonctions membres

◆ _getJSObject()

static _getJSObject (   $array = array())
staticprotected

Internal method to get a JavaScript object notation string from an array

Paramètres
array$arrayThe array to convert to JavaScript object notation
Renvoie
string JavaScript object notation representation of the array
Depuis
1.5
Obsolète:
13.3 (Platform) & 4.0 (CMS) - Use JHtml::getJSObject() instead.

◆ calendar()

static calendar ( )
static

Add unobtrusive JavaScript support for a calendar control.

Renvoie
void
Depuis
1.5
Obsolète:
4.0

◆ calendartranslation()

static calendartranslation ( )
staticprotected

Internal method to translate the JavaScript Calendar

Renvoie
string JavaScript that translates the object
Depuis
1.5

Références $text, et json_encode.

◆ caption()

static caption (   $selector = 'img.caption')
static

Add unobtrusive JavaScript support for image captions.

Paramètres
string$selectorThe selector for which a caption behaviour is to be applied.
Renvoie
void
Depuis
1.5

Références $selector, et getDocument.

◆ colorpicker()

static colorpicker ( )
static

Add unobtrusive JavaScript support for a color picker.

Renvoie
void
Depuis
1.7
Obsolète:
4.0 Use directly the field or the layout

◆ combobox()

static combobox ( )
static

Add unobtrusive JavaScript support for a combobox effect.

Note that this control is only reliable in absolutely positioned elements. Avoid using a combobox in a slider or dynamic pane.

Renvoie
void
Depuis
1.5

◆ core()

static core ( )
static

Method to load core.js into the document head.

Core.js defines the 'Joomla' namespace and contains functions which are used across extensions

Renvoie
void
Depuis
3.3

Références getDocument.

◆ formvalidation()

static formvalidation ( )
static

Add unobtrusive JavaScript support for form validation.

To enable form validation the form tag must have class="form-validate". Each field that needs to be validated needs to have class="validate". Additional handlers can be added to the handler for username, password, numeric and email. To use these add class="validate-email" and so on.

Renvoie
void
Depuis
1.5

3.4 Use formvalidator instead

◆ formvalidator()

static formvalidator ( )
static

Add unobtrusive JavaScript support for form validation.

To enable form validation the form tag must have class="form-validate". Each field that needs to be validated needs to have class="validate". Additional handlers can be added to the handler for username, password, numeric and email. To use these add class="validate-email" and so on.

Renvoie
void
Depuis
3.4

◆ framework()

static framework (   $extras = false,
  $debug = null 
)
static

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ètres
boolean$extrasFlag to determine whether to load MooTools More in addition to Core
mixed$debugIs debugging mode on? [optional]
Renvoie
void
Depuis
1.6
Obsolète:
4.0 Update scripts to jquery

Références $type, JDEBUG, et null.

◆ highlighter()

static highlighter ( array  $terms,
  $start = 'highlighter-start',
  $end = 'highlighter-end',
  $className = 'highlight',
  $tag = 'span' 
)
static

Highlight some words via Javascript.

Paramètres
array$termsArray of words that should be highlighted.
string$startID of the element that marks the begin of the section in which words should be highlighted. Note this element will be removed from the DOM.
string$endID of the element that end this section. Note this element will be removed from the DOM.
string$classNameClass name of the element highlights are wrapped in.
string$tagTag that will be used to wrap the highlighted words.
Renvoie
void
Depuis
2.5

◆ keepalive()

static keepalive ( )
static

Keep session alive, for example, while editing or creating an article.

Renvoie
void
Depuis
1.5

◆ modal()

static modal (   $selector = 'a.modal',
  $params = array() 
)
static

Add unobtrusive JavaScript support for modal links.

Paramètres
string$selectorThe selector for which a modal behaviour is to be applied.
array$paramsAn array of parameters for the modal behaviour. Options for the modal behaviour can be:
  • ajaxOptions
  • size
  • shadow
  • overlay
  • onOpen
  • onClose
  • onUpdate
  • onResize
  • onShow
  • onHide
Renvoie
void
Depuis
1.5
Obsolète:
4.0 Use the modal equivalent from bootstrap

Références $document, $options, $params, $selector, getDocument, et null.

◆ multiselect()

static multiselect (   $id = 'adminForm')
static

JavaScript behavior to allow shift select in grids

Paramètres
string$idThe id of the form for which a multiselect behaviour is to be applied.
Renvoie
void
Depuis
1.7

Références $id, et getDocument.

◆ noframes()

static noframes ( )
static

Break us out of any containing iframes

Renvoie
void
Depuis
1.5
Obsolète:
4.0 Add a X-Frame-Options HTTP Header with the SAMEORIGIN value instead.

Références jQuery.

◆ polyfill()

static polyfill (   $polyfillTypes = null,
  $conditionalBrowser = null 
)
static

Add javascript polyfills.

Paramètres
string | array$polyfillTypesThe polyfill type(s). Examples: event, array('event', 'classlist').
string$conditionalBrowserAn IE conditional expression. Example: lt IE 9 (lower than IE 9).
Renvoie
void
Depuis
3.7.0

Références null.

◆ simplecolorpicker()

static simplecolorpicker ( )
static

Add unobtrusive JavaScript support for a simple color picker.

Renvoie
void
Depuis
3.1
Obsolète:
4.0 Use directly the field or the layout

◆ switcher()

static switcher ( )
static

Add unobtrusive JavaScript support for submenu switcher support

Renvoie
void
Depuis
1.5

Références $script, et getDocument.

◆ tabstate()

static tabstate ( )
static

Add unobtrusive JavaScript support to keep a tab state.

Note that keeping tab state only works for inner tabs if in accordance with the following example:

parent tab = permissions
child tab = permission-<identifier>

Each tab header <a> tag also should have a unique href attribute

Renvoie
void
Depuis
3.2

◆ tooltip()

static tooltip (   $selector = '.hasTip',
  $params = array() 
)
static

Add unobtrusive JavaScript support for a hover tooltips.

Add a title attribute to any element in the form title="title::text"

Uses the core Tips class in MooTools.

Paramètres
string$selectorThe class selector for the tooltip.
array$paramsAn array of options for the tooltip. Options for the tooltip can be:
  • maxTitleChars integer The maximum number of characters in the tooltip title (defaults to 50).
  • offsets object The distance of your tooltip from the mouse (defaults to {'x': 16, 'y': 16}).
  • showDelay integer The millisecond delay the show event is fired (defaults to 100).
  • hideDelay integer The millisecond delay the hide hide is fired (defaults to 100).
  • className string The className your tooltip container will get.
  • fixed boolean If set to true, the toolTip will not follow the mouse.
  • onShow function The default function for the show event, passes the tip element and the currently hovered element.
  • onHide function The default function for the hide event, passes the currently hovered element.
Renvoie
void
Depuis
1.5

Références $options, $params, $selector, getDocument, et null.

◆ tree()

static tree (   $id,
  $params = array(),
  $root = array() 
)
static

Add unobtrusive javascript support for a collapsible tree.

Paramètres
string$idAn index
array$paramsAn array of options.
array$rootThe root node
Renvoie
void
Depuis
1.5

Références $id, $js, $options, $params, $root, et null.

Documentation des champs

◆ $loaded

$loaded = array()
staticprotected

La documentation de cette classe a été générée à partir du fichier suivant :