submit.php 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <?php
  2. /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
  3. /**
  4. * HTML class for a submit type element
  5. *
  6. * PHP versions 4 and 5
  7. *
  8. * LICENSE: This source file is subject to version 3.01 of the PHP license
  9. * that is available through the world-wide-web at the following URI:
  10. * http://www.php.net/license/3_01.txt If you did not receive a copy of
  11. * the PHP License and are unable to obtain it through the web, please
  12. * send a note to license@php.net so we can mail you a copy immediately.
  13. *
  14. * @category HTML
  15. * @package HTML_QuickForm
  16. * @author Adam Daniel <adaniel1@eesus.jnj.com>
  17. * @author Bertrand Mansion <bmansion@mamasam.com>
  18. * @copyright 2001-2009 The PHP Group
  19. * @license http://www.php.net/license/3_01.txt PHP License 3.01
  20. * @version CVS: $Id: submit.php,v 1.6 2009/04/04 21:34:04 avb Exp $
  21. * @link http://pear.php.net/package/HTML_QuickForm
  22. */
  23. /**
  24. * HTML class for a submit type element
  25. *
  26. * @category HTML
  27. * @package HTML_QuickForm
  28. * @author Adam Daniel <adaniel1@eesus.jnj.com>
  29. * @author Bertrand Mansion <bmansion@mamasam.com>
  30. * @version Release: 3.2.11
  31. * @since 1.0
  32. */
  33. class HTML_QuickForm_submit extends HTML_QuickForm_input
  34. {
  35. // {{{ constructor
  36. /**
  37. * Class constructor
  38. *
  39. * @param string Input field name attribute
  40. * @param string Input field value
  41. * @param mixed Either a typical HTML attribute string or an associative array
  42. * @since 1.0
  43. * @access public
  44. * @return void
  45. */
  46. public function __construct($elementName=null, $value=null, $attributes=null)
  47. {
  48. parent::__construct($elementName, null, $attributes);
  49. $this->setValue($value);
  50. $this->setType('submit');
  51. } //end constructor
  52. // }}}
  53. // {{{ freeze()
  54. /**
  55. * Freeze the element so that only its value is returned
  56. *
  57. * @access public
  58. * @return void
  59. */
  60. function freeze()
  61. {
  62. return false;
  63. } //end func freeze
  64. // }}}
  65. // {{{ exportValue()
  66. /**
  67. * Only return the value if it is found within $submitValues (i.e. if
  68. * this particular submit button was clicked)
  69. */
  70. function exportValue(&$submitValues, $assoc = false)
  71. {
  72. return $this->_prepareValue($this->_findValue($submitValues), $assoc);
  73. }
  74. // }}}
  75. } //end class HTML_QuickForm_submit
  76. ?>