[ Index ]

PHP Cross Reference of Joomla 2.5.4 DE

title

Body

[close]

/administrator/components/com_installer/models/fields/ -> type.php (source)

   1  <?php
   2  /**
   3   * @package        Joomla.Administrator
   4   * @subpackage    com_installer
   5   * @copyright    Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
   6   * @license        GNU General Public License, see LICENSE.php
   7   */
   8  
   9  // No direct access.
  10  defined('_JEXEC') or die;
  11  
  12  /**
  13   * Form Field Place class.
  14   *
  15   * @package        Joomla.Administrator
  16   * @subpackage    com_installer
  17   * @since        1.6
  18   */
  19  class JFormFieldType extends JFormField
  20  {
  21      /**
  22       * The field type.
  23       *
  24       * @var        string
  25       */
  26      protected $type = 'Type';
  27  
  28      /**
  29       * Method to get the field input.
  30       *
  31       * @return    string        The field input.
  32       * @since    1.6
  33       */
  34  	protected function getInput()
  35      {
  36          $onchange    = $this->element['onchange'] ? ' onchange="'.(string) $this->element['onchange'].'"' : '';
  37          $options = array();
  38          foreach ($this->element->children() as $option) {
  39              $options[] = JHtml::_('select.option', $option->attributes('value'), JText::_(trim((string) $option)));
  40          }
  41  
  42          $db = JFactory::getDBO();
  43          $query = $db->getQuery(true);
  44          $query->select('type')->from('#__extensions');
  45          $db->setQuery($query);
  46          $types = array_unique($db->loadColumn());
  47          foreach($types as $type)
  48          {
  49              $options[] = JHtml::_('select.option', $type, JText::_('COM_INSTALLER_TYPE_'. strtoupper($type)));
  50          }
  51  
  52          $return = JHtml::_('select.genericlist', $options, $this->name, $onchange, 'value', 'text', $this->value, $this->id);
  53  
  54          return $return;
  55      }
  56  }


Generated: Tue Apr 3 11:40:28 2012 Cross-referenced by PHPXref 0.7.1