PageRenderTime 43ms CodeModel.GetById 22ms RepoModel.GetById 0ms app.codeStats 0ms

/content/code/trunk/administrator/components/com_artofcontent/libraries/jxtended/form/fields/radio.php

https://bitbucket.org/eddieajau/the-art-of-joomla-archive
PHP | 48 lines | 16 code | 6 blank | 26 comment | 0 complexity | e35aa3f8953631ef098c28c4a411d42c MD5 | raw file
  1. <?php
  2. /**
  3. * @version $Id: radio.php 484 2010-12-20 23:40:27Z eddieajau $
  4. * @package JXtended.Libraries
  5. * @subpackage Form
  6. * @copyright Copyright 2005 - 2010 New Life in IT Pty Ltd. All rights reserved.
  7. * @license GNU General Public License
  8. * @link http://www.theartofjoomla.com
  9. */
  10. defined('JPATH_BASE') or die;
  11. jimport('joomla.html.html');
  12. juimport('jxtended.form.formfield');
  13. /**
  14. * Form Field class for JXtended Libraries.
  15. *
  16. * @package JXtended.Libraries
  17. * @subpackage Form
  18. * @since 1.1
  19. */
  20. class JFormFieldRadio extends JFormField
  21. {
  22. /**
  23. * The field type.
  24. *
  25. * @var string
  26. */
  27. protected $type = 'Radio';
  28. /**
  29. * Method to get the field input.
  30. *
  31. * @return string The field input.
  32. */
  33. protected function _getInput()
  34. {
  35. $options = array();
  36. // Get the options for the radio list.
  37. foreach ($this->_element->children() as $option) {
  38. $options[] = JHtml::_('select.option', $option->attributes('value'), JText::_($option->data()));
  39. }
  40. return JHtml::_('select.radiolist', $options, $this->inputName, '', 'value', 'text', $this->value, $this->inputId);
  41. }
  42. }