- md5
- bd28ea0c91bc8ccc2290423bcb915396
- sha1
- 96ea720fa723504601fcb1c2bc4ef306905c832e
- sha256
- 371eb449a4aae4bf89e2bdc3e1a4dd19f21b860c1d1623a0e95dea60c015a19b
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
<?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;
/**
* Button base class
*
* The JButton is the base class for all JButton types
*
* @package Joomla.Libraries
* @subpackage Toolbar
* @since 3.0
*/
abstract class JToolbarButton
{
/**
* element name
*
* This has to be set in the final renderer classes.
*
* @var string
*/
protected $_name = null;
/**
* reference to the object that instantiated the element
*
* @var JButton
*/
protected $_parent = null;
/**
* Constructor
*
* @param object $parent The parent
*/
public function __construct($parent = null)
{
$this->_parent = $parent;
}
/**
* Get the element name
*
* @return string type of the parameter
*
* @since 3.0
*/
public function getName()
{
return $this->_name;
}
/**
* Get the HTML to render the button
*
* @param array &$definition Parameters to be passed
*
* @return string
*
* @since 3.0
*/
public function render(&$definition)
{
/*
* Initialise some variables
*/
$html = null;
$id = call_user_func_array(array(&$this, 'fetchId'), $definition);
$action = call_user_func_array(array(&$this, 'fetchButton'), $definition);
// Build id attribute
if ($id)
{
$id = "id=\"$id\"";
}
// Build the HTML Button
$html .= "<div class=\"btn-group\" $id>\n";
$html .= $action;
$html .= "</div>\n";
return $html;
}
/**
* Method to get the CSS class name for an icon identifier
*
* Can be redefined in the final class
*
* @param string $identifier Icon identification string
*
* @return string CSS class name
*
* @since 3.0
*/
public function fetchIconClass($identifier)
{
return "icon-$identifier";
}
/**
* Get the button
*
* Defined in the final button class
*
* @return string
*
* @since 3.0
*/
abstract public function fetchButton();
}
/**
* Deprecated class placeholder. You should use JToolbarButton instead.
*
* @package Joomla.Legacy
* @subpackage Toolbar
* @since 1.5
* @deprecated 4.0 Use JToolbarButton instead.
* @codeCoverageIgnore
*/
abstract class JButton extends JToolbarButton
{
/**
* Constructor
*
* @param object $parent The parent
*
* @deprecated 4.0 Use JToolbarButton instead.
*/
public function __construct($parent = null)
{
JLog::add('JButton is deprecated. Use JToolbarButton instead.', JLog::WARNING, 'deprecated');
parent::__construct($parent);
}
}
The same content is in 3 releases, Joomla 3.0.0 to 3.0.2. See them all, or every version of this file.