1 <?php
2 /**
3 * @package Joomla.Libraries
4 * @subpackage Toolbar
5 *
6 * @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
7 * @license GNU General Public License version 2 or later; see LICENSE.txt
8 */
9
10 defined('JPATH_PLATFORM') or die;
11
12 /**
13 * Renders a custom button
14 *
15 * @since 3.0
16 */
17 class JToolbarButtonCustom extends JToolbarButton
18 {
19 /**
20 * Button type
21 *
22 * @var string
23 */
24 protected $_name = 'Custom';
25
26 /**
27 * Fetch the HTML for the button
28 *
29 * @param string $type Button type, unused string.
30 * @param string $html HTML strng for the button
31 * @param string $id CSS id for the button
32 *
33 * @return string HTML string for the button
34 *
35 * @since 3.0
36 */
37 public function fetchButton($type = 'Custom', $html = '', $id = 'custom')
38 {
39 return $html;
40 }
41
42 /**
43 * Get the button CSS Id
44 *
45 * @param string $type Not used.
46 * @param string $html Not used.
47 * @param string $id The id prefix for the button.
48 *
49 * @return string Button CSS Id
50 *
51 * @since 3.0
52 */
53 public function fetchId($type = 'Custom', $html = '', $id = 'custom')
54 {
55 return $this->_parent->getName() . '-' . $id;
56 }
57 }
58