PageRenderTime 42ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 1ms

/include/HTML/QuickForm/submit.php

https://github.com/radicaldesigns/amp
PHP | 82 lines | 20 code | 8 blank | 54 comment | 0 complexity | 6c24a6dada4a435c7829143bd53c333c MD5 | raw file
Possible License(s): LGPL-2.1, GPL-2.0, BSD-3-Clause, LGPL-2.0, CC-BY-SA-3.0, AGPL-1.0
  1. <?php
  2. /* vim: set expandtab tabstop=4 shiftwidth=4: */
  3. // +----------------------------------------------------------------------+
  4. // | PHP version 4.0 |
  5. // +----------------------------------------------------------------------+
  6. // | Copyright (c) 1997, 1998, 1999, 2000, 2001 The PHP Group |
  7. // +----------------------------------------------------------------------+
  8. // | This source file is subject to version 2.0 of the PHP license, |
  9. // | that is bundled with this package in the file LICENSE, and is |
  10. // | available at through the world-wide-web at |
  11. // | http://www.php.net/license/2_02.txt. |
  12. // | If you did not receive a copy of the PHP license and are unable to |
  13. // | obtain it through the world-wide-web, please send a note to |
  14. // | license@php.net so we can mail you a copy immediately. |
  15. // +----------------------------------------------------------------------+
  16. // | Authors: Adam Daniel <adaniel1@eesus.jnj.com> |
  17. // | Bertrand Mansion <bmansion@mamasam.com> |
  18. // +----------------------------------------------------------------------+
  19. //
  20. // $Id: submit.php,v 1.4 2003/06/18 19:36:20 avb Exp $
  21. require_once("HTML/QuickForm/input.php");
  22. /**
  23. * HTML class for a submit type element
  24. *
  25. * @author Adam Daniel <adaniel1@eesus.jnj.com>
  26. * @author Bertrand Mansion <bmansion@mamasam.com>
  27. * @version 1.0
  28. * @since PHP4.04pl1
  29. * @access public
  30. */
  31. class HTML_QuickForm_submit extends HTML_QuickForm_input
  32. {
  33. // {{{ constructor
  34. /**
  35. * Class constructor
  36. *
  37. * @param string Input field name attribute
  38. * @param string Input field value
  39. * @param mixed Either a typical HTML attribute string or an associative array
  40. * @since 1.0
  41. * @access public
  42. * @return void
  43. */
  44. function HTML_QuickForm_submit($elementName=null, $value=null, $attributes=null)
  45. {
  46. HTML_QuickForm_input::HTML_QuickForm_input($elementName, null, $attributes);
  47. $this->setValue($value);
  48. $this->setType('submit');
  49. } //end constructor
  50. // }}}
  51. // {{{ freeze()
  52. /**
  53. * Freeze the element so that only its value is returned
  54. *
  55. * @access public
  56. * @return void
  57. */
  58. function freeze()
  59. {
  60. return false;
  61. } //end func freeze
  62. // }}}
  63. // {{{ exportValue()
  64. /**
  65. * Only return the value if it is found within $submitValues (i.e. if
  66. * this particular submit button was clicked)
  67. */
  68. function exportValue(&$submitValues, $assoc = false)
  69. {
  70. return $this->_prepareValue($this->_findValue($submitValues), $assoc);
  71. }
  72. // }}}
  73. } //end class HTML_QuickForm_submit
  74. ?>