PageRenderTime 49ms CodeModel.GetById 24ms RepoModel.GetById 1ms app.codeStats 0ms

/redirect/code/trunk/administrator/components/com_redirect/libraries/jxtended/form/fields/text.php

https://bitbucket.org/eddieajau/the-art-of-joomla-archive
PHP | 46 lines | 16 code | 5 blank | 25 comment | 1 complexity | 04692bcadbf71ada2c49a98dea4c3371 MD5 | raw file
  1. <?php
  2. /**
  3. * @version $Id: text.php 390 2010-11-05 11:35:33Z 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. juimport('jxtended.form.formfield');
  12. /**
  13. * Form Field class for JXtended Libraries.
  14. *
  15. * @package JXtended.Libraries
  16. * @subpackage Form
  17. * @since 1.1
  18. */
  19. class JFormFieldText extends JFormField
  20. {
  21. /**
  22. * The field type.
  23. *
  24. * @var string
  25. */
  26. protected $type = 'Text';
  27. /**
  28. * Method to get the field input.
  29. *
  30. * @return string The field input.
  31. */
  32. protected function _getInput()
  33. {
  34. $size = ($v = $this->_element->attributes('size')) ? ' size="'.$v.'"' : '';
  35. $class = ($v = $this->_element->attributes('class')) ? 'class="'.$v.'"' : 'class="text_area"';
  36. $readonly = $this->_element->attributes('readonly') == 'true' ? ' readonly="readonly"' : '';
  37. $onchange = ($v = $this->_element->attributes('onchange')) ? ' onchange="'.$v.'"' : '';
  38. $maxLength = ($v = $this->_element->attributes('maxlength')) ? ' maxlength="'.$v.'"' : '';
  39. return '<input type="text" name="'.$this->inputName.'" id="'.$this->inputId.'" value="'.htmlspecialchars($this->value).'" '.$class.$size.$readonly.$onchange.$maxLength.' />';
  40. }
  41. }