- md5
- a332a55e7355047cf24fa481263a2921
- sha1
- abbb67b43700f3a21953b2ab1bbc23d58744420c
- sha256
- 3db7c2ebc26bd694493cf452e2810bf630b114c4eaa96fed2b7d3982b4fe6cad
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
<?php
/**
* @package Joomla.Libraries
* @subpackage Toolbar
*
* @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
*/
defined('JPATH_PLATFORM') or die;
/**
* Renders a button to render an HTML element in a slider container
*
* @package Joomla.Libraries
* @subpackage Toolbar
* @since 3.0
*/
class JToolbarButtonSlider extends JToolbarButton
{
/**
* Button type
*
* @var string
*/
protected $_name = 'Slider';
/**
* Fetch the HTML for the button
*
* @param string $type Unused string, formerly button type.
* @param string $name Button name
* @param string $text The link text
* @param string $url URL for popup
* @param integer $width Width of popup
* @param integer $height Height of popup
* @param string $onClose JavaScript for the onClose event.
*
* @return string HTML string for the button
*
* @since 3.0
*/
public function fetchButton($type = 'Slider', $name = '', $text = '', $url = '', $width = 640, $height = 480, $onClose = '')
{
JHtml::script('jui/cms.js', false, true);
$text = JText::_($text);
$class = 'cog';
$doTask = $this->_getCommand($url);
$html = "<button class=\"btn btn-small\" data-toggle=\"collapse\" data-target=\"#collapse-" . $name . "\" rel=\"{onClose: function() {" . $onClose
. "}}\" onClick=\"Joomla.setcollapse('$doTask', '$name', '$height');\">\n";
$html .= "<i class=\"icon-$class\">\n";
$html .= "</i>\n";
$html .= "$text\n";
$html .= "</button>\n";
return $html;
}
/**
* Get the button id
*
* @param string $type Button type
* @param string $name Button name
*
* @return string Button CSS Id
*
* @since 3.0
*/
public function fetchId($type, $name)
{
return $this->_parent->getName() . '-' . 'slider-' . $name;
}
/**
* Get the JavaScript command for the button
*
* @param string $url URL for popup
*
* @return string JavaScript command string
*
* @since 3.0
*/
private function _getCommand($url)
{
if (substr($url, 0, 4) !== 'http')
{
$url = JURI::base() . $url;
}
return $url;
}
}
The same content is in 3 releases, Joomla 3.0.0 to 3.0.2. See them all, or every version of this file.