| [ Index ] |
PHP Cross Reference of Joomla 1.5.26 DE |
[Summary view] [Print] [Text view]
1 <?php 2 /** 3 * @version $Id: button.php 14401 2010-01-26 14:10:00Z louis $ 4 * @package Joomla.Framework 5 * @subpackage HTML 6 * @copyright Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved. 7 * @license GNU/GPL, see LICENSE.php 8 * Joomla! is free software. This version may have been modified pursuant 9 * to the GNU General Public License, and as distributed it includes or 10 * is derivative of works licensed under the GNU General Public License or 11 * other free or open source software licenses. 12 * See COPYRIGHT.php for copyright notices and details. 13 */ 14 15 // Check to ensure this file is within the rest of the framework 16 defined('JPATH_BASE') or die(); 17 18 /** 19 * Button base class 20 * 21 * The JButton is the base class for all JButton types 22 * 23 * @abstract 24 * @package Joomla.Framework 25 * @subpackage HTML 26 * @since 1.5 27 */ 28 class JButton extends JObject 29 { 30 /** 31 * element name 32 * 33 * This has to be set in the final renderer classes. 34 * 35 * @access protected 36 * @var string 37 */ 38 var $_name = null; 39 40 /** 41 * reference to the object that instantiated the element 42 * 43 * @access protected 44 * @var object 45 */ 46 var $_parent = null; 47 48 /** 49 * Constructor 50 * 51 * @access protected 52 */ 53 function __construct($parent = null) 54 { 55 $this->_parent = $parent; 56 } 57 58 /** 59 * get the element name 60 * 61 * @access public 62 * @return string type of the parameter 63 */ 64 function getName() 65 { 66 return $this->_name; 67 } 68 69 function render( &$definition ) 70 { 71 /* 72 * Initialize some variables 73 */ 74 $html = null; 75 $id = call_user_func_array(array(&$this, 'fetchId'), $definition); 76 $action = call_user_func_array(array(&$this, 'fetchButton'), $definition); 77 78 // Build id attribute 79 if ($id) { 80 $id = "id=\"$id\""; 81 } 82 83 // Build the HTML Button 84 $html .= "<td class=\"button\" $id>\n"; 85 $html .= $action; 86 $html .= "</td>\n"; 87 88 return $html; 89 } 90 91 /** 92 * Method to get the CSS class name for an icon identifier 93 * 94 * Can be redefined in the final class 95 * 96 * @access public 97 * @param string $identifier Icon identification string 98 * @return string CSS class name 99 * @since 1.5 100 */ 101 function fetchIconClass($identifier) 102 { 103 return "icon-32-$identifier"; 104 } 105 106 /** 107 * Get the button id 108 * 109 * Can be redefined in the final button class 110 * 111 * @access public 112 * @since 1.5 113 */ 114 function fetchId() 115 { 116 return; 117 } 118 119 /** 120 * Get the button 121 * 122 * Defined in the final button class 123 * 124 * @abstract 125 * @access public 126 * @since 1.5 127 */ 128 function fetchButton() 129 { 130 return; 131 } 132 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated: Wed Mar 28 15:54:07 2012 | Cross-referenced by PHPXref 0.7.1 |