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/parameter/element.php

Documentation is available at element.php

  1. <?php
  2. /**
  3. @version        $Id: element.php 6472 2007-02-03 10:47:26Z pasamio $
  4. @package        Joomla.Framework
  5. @subpackage    Parameter
  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.  * Parameter base class
  20.  *
  21.  * The JElement is the base class for all JElement types
  22.  *
  23.  * @abstract
  24.  * @author         Johan Janssens <[email protected]>
  25.  * @package     Joomla.Framework
  26.  * @subpackage        Parameter
  27.  * @since        1.5
  28.  */
  29.  
  30. class JElement extends JObject
  31. {
  32.    /**
  33.     * element name
  34.     *
  35.     * This has to be set in the final
  36.     * renderer classes.
  37.     *
  38.     * @access    protected
  39.     * @var        string 
  40.     */
  41.     var    $_name = null;
  42.  
  43.    /**
  44.     * reference to the object that instantiated the element
  45.     *
  46.     * @access    protected
  47.     * @var        object 
  48.     */
  49.     var    $_parent = null;
  50.  
  51.     /**
  52.      * Constructor
  53.      *
  54.      * @access protected
  55.      */
  56.     function __construct($parent null{
  57.         $this->_parent = $parent;
  58.     }
  59.  
  60.    /**
  61.     * get the element name
  62.     *
  63.     * @access    public
  64.     * @return    string    type of the parameter
  65.     */
  66.     function getName({
  67.         return $this->_name;
  68.     }
  69.  
  70.     function render(&$xmlElement$value$control_name 'params')
  71.     {
  72.         $name    $xmlElement->attributes('name');
  73.         $label    $xmlElement->attributes('label');
  74.         $descr    $xmlElement->attributes('description');
  75.  
  76.         //make sure we have a valid label
  77.         $label $label $label $name;
  78.  
  79.         $result[0$this->fetchTooltip($label$descr$xmlElement$control_name$name);
  80.         $result[1$this->fetchElement($name$value$xmlElement$control_name);
  81.         $result[2$descr;
  82.         $result[3$label;
  83.         $result[4$value;
  84.         $result[5$name;
  85.  
  86.         return $result;
  87.     }
  88.  
  89.     function fetchTooltip($label$description&$xmlElement$control_name=''$name='')
  90.     {
  91.         $output '<label id="'.$control_name.$name.'-lbl" for="'.$control_name.$name.'"';
  92.         if ($description{
  93.             $output .= ' class="hasTip" title="'.JText::_($label).'::'.JText::_($description).'">';
  94.         else {
  95.             $output .= '>';
  96.         }
  97.         $output .= JText::_$label ).'</label>';
  98.  
  99.         return $output;
  100.     }
  101.  
  102.     function fetchElement($name$value&$xmlElement$control_name{
  103.         return;
  104.     }
  105. }
  106. ?>

Documentation generated on Mon, 05 Mar 2007 20:57:21 +0000 by phpDocumentor 1.3.1