[ Index ]

PHP Cross Reference of Joomla 1.5.26 DE

title

Body

[close]

/libraries/joomla/html/parameter/ -> element.php (source)

   1  <?php
   2  /**
   3  * @version        $Id: element.php 14401 2010-01-26 14:10:00Z louis $
   4  * @package        Joomla.Framework
   5  * @subpackage    Parameter
   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   * Parameter base class
  20   *
  21   * The JElement is the base class for all JElement types
  22   *
  23   * @abstract
  24   * @package     Joomla.Framework
  25   * @subpackage        Parameter
  26   * @since        1.5
  27   */
  28  class JElement extends JObject
  29  {
  30      /**
  31      * element name
  32      *
  33      * This has to be set in the final
  34      * 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          $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          return $this->_name;
  66      }
  67  
  68  	function render(&$xmlElement, $value, $control_name = 'params')
  69      {
  70          $name    = $xmlElement->attributes('name');
  71          $label    = $xmlElement->attributes('label');
  72          $descr    = $xmlElement->attributes('description');
  73          //make sure we have a valid label
  74          $label = $label ? $label : $name;
  75          $result[0] = $this->fetchTooltip($label, $descr, $xmlElement, $control_name, $name);
  76          $result[1] = $this->fetchElement($name, $value, $xmlElement, $control_name);
  77          $result[2] = $descr;
  78          $result[3] = $label;
  79          $result[4] = $value;
  80          $result[5] = $name;
  81  
  82          return $result;
  83      }
  84  
  85  	function fetchTooltip($label, $description, &$xmlElement, $control_name='', $name='')
  86      {
  87          $output = '<label id="'.$control_name.$name.'-lbl" for="'.$control_name.$name.'"';
  88          if ($description) {
  89              $output .= ' class="hasTip" title="'.JText::_($label).'::'.JText::_($description).'">';
  90          } else {
  91              $output .= '>';
  92          }
  93          $output .= JText::_( $label ).'</label>';
  94  
  95          return $output;
  96      }
  97  
  98  	function fetchElement($name, $value, &$xmlElement, $control_name) {
  99          return;
 100      }
 101  }


Generated: Wed Mar 28 15:54:07 2012 Cross-referenced by PHPXref 0.7.1