Source code for file /joomla/html/pane.php
Documentation is available at pane.php
* @version $Id: pane.php 6691 2007-02-21 10:00:43Z louis $
* @package Joomla.Framework
* @copyright Copyright (C) 2005 - 2007 Open Source Matters. All rights reserved.
* @license GNU/GPL, see LICENSE.php
* Joomla! is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
// Check to ensure this file is within the rest of the framework
* @package Joomla.Framework
* @param array $params Associative array of values
* Returns a reference to a JPanel object
* @param string $behavior The behavior to use
* @param boolean $useCookies Use cookies to remember the state of the panel
* @param array $params Associative array of values
function &getInstance( $behavior =
'Tabs', $params =
array())
$classname =
'JPane'.
$behavior;
$instance =
new $classname($params);
* Creates a pane and creates the javascript object for it
* @param string The pane identifier
* Creates a panel with title text and starts that panel
* @param text - The panel name and/or title
* @param id - The panel identifer
* Load the javascript behavior and attach it to the document
* JPanelTabs class to to draw parameter panes
* @package Joomla.Framework
* @param array $params Associative array of values
parent::__construct($params);
* Creates a pane and creates the javascript object for it
* @param string The pane identifier
return '<dl class="tabs" id="'.
$id.
'">';
* Creates a tab panel with title text and starts that panel
* @param text - The name of the tab
* @param id - The tab identifier
return '<dt id="'.
$id.
'">'.
$text.
'</dt><dd>';
* Load the javascript behavior and attach it to the document
* @param array $params Associative array of values
$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 ;
foreach ($opt as $k =>
$v)
$options .=
$k.
': '.
$v.
',';
if (substr($options, -
1) ==
',') {
$options =
substr($options, 0, -
1);
$js =
' Window.onDomReady(function(){ $$(\'dl.tabs\').each(function(tabs){ new JTabs(tabs, '.
$options.
'); }); });';
$document->addScriptDeclaration( $js );
$url =
$mainframe->isAdmin() ?
$mainframe->getSiteURL() :
JURI::base();
$document->addScript( $url.
'includes/js/joomla/tabs.js' );
* JPanelSliders class to to draw parameter panes
* @package Joomla.Framework
* @param int useCookies, if set to 1 cookie will hold last used tab between page refreshes
parent::__construct($params);
* Creates a pane and creates the javascript object for it
* @param string The pane identifier
return '<div id="'.
$id.
'" class="pane-sliders">';
* Creates a tab panel with title text and starts that panel
* @param text - The name of the tab
* @param id - The tab identifier
return '<div class="panel">'
.
'<h3 class="jpane-toggler title" id="'.
$id.
'"><span>'.
$text.
'</span></h3>'
.
'<div class="jpane-slider content">';
* Load the javascript behavior and attach it to the document
* @param array $params Associative array of values
$opt['onActive'] =
'function(toggler, i) { toggler.addClass(\'jpane-toggler-down\'); toggler.removeClass(\'jpane-toggler\'); }';
$opt['onBackground']=
'function(toggler, i) { toggler.addClass(\'jpane-toggler\'); toggler.removeClass(\'jpane-toggler-down\'); }';
$opt['duration'] =
(isset
($params['duration'])) ? (int)
$params['duration'] :
300;
$opt['display'] =
(isset
($params['startOffset']) &&
($params['startTransition'])) ? (int)
$params['startOffset'] :
null ;
$opt['show'] =
(isset
($params['startOffset']) &&
(!$params['startTransition'])) ? (int)
$params['startOffset'] :
null ;
$opt['opacity'] =
(isset
($params['opacityTransition']) &&
($params['opacityTransition'])) ?
'true' :
'false' ;
$opt['alwaysHide'] =
(isset
($params['allowAllClose']) &&
($params['allowAllClose'])) ?
'true' :
null ;
foreach ($opt as $k =>
$v)
$options .=
$k.
': '.
$v.
',';
if (substr($options, -
1) ==
',') {
$options =
substr($options, 0, -
1);
$js =
' Window.onDomReady(function(){ new Accordion($$(\'.panel h3.jpane-toggler\'), $$(\'.panel div.jpane-slider\'), '.
$options.
'); });';
$document->addScriptDeclaration( $js );