Source for file tabs.php
Documentation is available at tabs.php
* @package Joomla.Libraries
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
* Utility class for Tabs elements.
* @package Joomla.Libraries
* Creates a panes and creates the JavaScript object for it.
* @param string $group The pane identifier.
* @param array $params An array of option.
public static function start($group =
'tabs', $params =
array())
static::loadBehavior($group, $params);
return '<dl class="tabs" id="' .
$group .
'"><dt style="display:none;"></dt><dd style="display:none;">';
* @return string HTML to close the pane
public static function end()
* Begins the display of a new panel.
* @param string $text Text to display.
* @param string $id Identifier of the panel.
* @return string HTML to start a new panel
public static function panel($text, $id)
return '</dd><dt class="tabs ' .
$id .
'"><span><h3><a href="javascript:void(0);">' .
$text .
'</a></h3></span></dt><dd class="tabs">';
* Load the JavaScript behavior.
* @param string $group The pane identifier.
* @param array $params Array of options.
protected static function loadBehavior($group, $params =
array())
static $loaded =
array();
if (!array_key_exists((string)
$group, $loaded))
// Include MooTools framework
JHtml::_('behavior.framework', true);
$opt['onActive'] =
(isset
($params['onActive'])) ?
'\\' .
$params['onActive'] :
null;
$opt['onBackground'] =
(isset
($params['onBackground'])) ?
'\\' .
$params['onBackground'] :
null;
$opt['display'] =
(isset
($params['startOffset'])) ? (int)
$params['startOffset'] :
null;
$opt['useStorage'] =
(isset
($params['useCookie']) &&
$params['useCookie']) ?
'true' :
'false';
$opt['titleSelector'] =
"dt.tabs";
$opt['descriptionSelector'] =
"dd.tabs";
$options =
JHtml::getJSObject($opt);
$js =
' window.addEvent(\'domready\', function(){
$$(\'dl#' .
$group .
'.tabs\').each(function(tabs){
new JTabs(tabs, ' .
$options .
');
$document->addScriptDeclaration($js);
JHtml::_('script', 'system/tabs.js', false, true);
$loaded[(string)
$group] =
true;
Documentation generated on Tue, 19 Nov 2013 15:15:03 +0100 by phpDocumentor 1.4.3