/libraries/joomla/form/fields/hidden.php

https://gitlab.com/vitaliylukin91/alex-lavka · PHP · 48 lines · 14 code · 5 blank · 29 comment · 0 complexity · f0faba3fb05ab9e72effb467dc0b6001 MD5 · raw file

  1. <?php
  2. /**
  3. * @package Joomla.Platform
  4. * @subpackage Form
  5. *
  6. * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.
  7. * @license GNU General Public License version 2 or later; see LICENSE
  8. */
  9. defined('JPATH_PLATFORM') or die;
  10. /**
  11. * Form Field class for the Joomla Platform.
  12. * Provides a hidden field
  13. *
  14. * @link http://www.w3.org/TR/html-markup/input.hidden.html#input.hidden
  15. * @since 11.1
  16. */
  17. class JFormFieldHidden extends JFormField
  18. {
  19. /**
  20. * The form field type.
  21. *
  22. * @var string
  23. * @since 11.1
  24. */
  25. protected $type = 'Hidden';
  26. /**
  27. * Method to get the field input markup.
  28. *
  29. * @return string The field input markup.
  30. *
  31. * @since 11.1
  32. */
  33. protected function getInput()
  34. {
  35. // Initialize some field attributes.
  36. $class = !empty($this->class) ? ' class="' . $this->class . '"' : '';
  37. $disabled = $this->disabled ? ' disabled' : '';
  38. // Initialize JavaScript field attributes.
  39. $onchange = $this->onchange ? ' onchange="' . $this->onchange . '"' : '';
  40. return '<input type="hidden" name="' . $this->name . '" id="' . $this->id . '" value="'
  41. . htmlspecialchars($this->value, ENT_COMPAT, 'UTF-8') . '"' . $class . $disabled . $onchange . ' />';
  42. }
  43. }