PageRenderTime 70ms CodeModel.GetById 21ms RepoModel.GetById 2ms app.codeStats 0ms

/contentmanager/code/trunk/administrator/components/com_contentmanager/libraries/jxtended/form/fields/text.php

https://bitbucket.org/eddieajau/the-art-of-joomla-archive
PHP | 42 lines | 16 code | 5 blank | 21 comment | 1 complexity | 40ac602fa09a81332f55db47a41b5ed2 MD5 | raw file
  1. <?php
  2. /**
  3. * @version $Id: text.php 160 2009-07-09 00:06:09Z eddieajau $
  4. * @package JXtended.Libraries
  5. * @subpackage Form
  6. * @copyright Copyright (C) 2008 - 2009 JXtended, LLC. All rights reserved.
  7. * @license GNU General Public License <http://www.gnu.org/copyleft/gpl.html>
  8. * @link http://jxtended.com
  9. */
  10. defined('JPATH_BASE') or die;
  11. jximport2('jxtended.form.field');
  12. /**
  13. * JXtended Form Field Type Class for a text input.
  14. *
  15. * @package JXtended.Libraries
  16. * @subpackage Form
  17. * @version 1.0
  18. */
  19. class JXFieldTypeText extends JXFieldType
  20. {
  21. /**
  22. * Field type
  23. *
  24. * @access protected
  25. * @var string
  26. */
  27. var $_type = 'Text';
  28. function fetchField($name, $value, &$node, $controlName)
  29. {
  30. $id = str_replace(']', '', str_replace('[', '_', $controlName.'_'.$name));
  31. $size = ($node->attributes('size') ? ' size="'.$node->attributes('size').'"' : '');
  32. $class = ($node->attributes('class') ? 'class="'.$node->attributes('class').'"' : 'class="text_area"');
  33. $readonly = ($node->attributes('readonly') == 'true' ? ' readonly="readonly"' : '');
  34. $onchange = ($node->attributes('onchange') ? ' onchange="'.$node->attributes('onchange').'"' : '');
  35. return '<input type="text" name="'.$controlName.'['.$name.']" id="'.$id.'" value="'.htmlspecialchars($value).'" '.$class.$size.$readonly.$onchange.' />';
  36. }
  37. }