Support Joomla!

Joomla! 1.5 Documentation

Packages

Package: Joomla-Framework

Developer Network License

The Joomla! Developer Network content is © copyright 2006 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution- NonCommercial- ShareAlike 2.5
Source code for file /joomla/html/toolbar/button.php

Documentation is available at button.php

  1. <?php
  2. /**
  3. @version        $Id: button.php 6472 2007-02-03 10:47:26Z pasamio $
  4. @package        Joomla.Framework
  5. @subpackage    HTML
  6. @copyright    Copyright (C) 2005 - 2007 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.  * @author         Louis Landry <[email protected]
  25.  * @package     Joomla.Framework
  26.  * @subpackage        HTML
  27.  * @since        1.5
  28.  */
  29. class JButton extends JObject
  30. {
  31.     /**
  32.      * element name
  33.      *
  34.      * This has to be set in the final renderer classes.
  35.      *
  36.      * @access    protected
  37.      * @var        string 
  38.      */
  39.     var $_name = null;
  40.  
  41.     /**
  42.      * reference to the object that instantiated the element
  43.      *
  44.      * @access    protected
  45.      * @var        object 
  46.      */
  47.     var $_parent = null;
  48.  
  49.     /**
  50.      * Constructor
  51.      *
  52.      * @access protected
  53.      */
  54.     function __construct($parent null)
  55.     {
  56.         $this->_parent = $parent;
  57.     }
  58.  
  59.     /**
  60.      * get the element name
  61.      *
  62.      * @access    public
  63.      * @return    string    type of the parameter
  64.      */
  65.     function getName()
  66.     {
  67.         return $this->_name;
  68.     }
  69.  
  70.     function render&$definition )
  71.     {
  72.         /*
  73.          * Initialize some variables
  74.          */
  75.         $html    null;
  76.         $id        call_user_func_array(array(&$this'fetchId')$definition);
  77.         $action    call_user_func_array(array(&$this'fetchButton')$definition);
  78.  
  79.         // Build id attribute
  80.         if ($id)
  81.         {
  82.             $id "id=\"$id\"";
  83.         }
  84.  
  85.         // Build the HTML Button
  86.         $html    .= "<td class=\"button\" $id>\n";
  87.         $html    .= $action;
  88.         $html    .= "</td>\n";
  89.  
  90.         return $html;
  91.     }
  92.  
  93.     /**
  94.      * Method to get the CSS class name for an icon identifier
  95.      *
  96.      * Can be redefined in the final class
  97.      *
  98.      * @access    public
  99.      * @param    string    $identifier    Icon identification string
  100.      * @return    string    CSS class name
  101.      * @since    1.5
  102.      */
  103.     function fetchIconClass($identifier)
  104.     {
  105.         return "icon-32-$identifier";
  106.     }
  107.  
  108.     /**
  109.      * Get the button id
  110.      *
  111.      * Can be redefined in the final button class
  112.      *
  113.      * @access        public
  114.      * @since        1.5
  115.      */
  116.     function fetchId()
  117.     {
  118.         return;
  119.     }
  120.  
  121.     /**
  122.      * Get the button
  123.      *
  124.      * Defined in the final button class
  125.      *
  126.      * @abstract
  127.      * @access        public
  128.      * @since        1.5
  129.      */
  130.     function fetchButton()
  131.     {
  132.         return;
  133.     }
  134. }
  135. ?>

Documentation generated on Mon, 05 Mar 2007 20:53:32 +0000 by phpDocumentor 1.3.1