PageRenderTime 47ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/include/HTML/QuickForm/image.php

https://github.com/radicaldesigns/amp
PHP | 119 lines | 28 code | 12 blank | 79 comment | 0 complexity | 53f22cdfdcc0d946fb68f971f72c4935 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: image.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 image 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_image extends HTML_QuickForm_input
  32. {
  33. // {{{ constructor
  34. /**
  35. * Class constructor
  36. *
  37. * @param string $elementName (optional)Element name attribute
  38. * @param string $src (optional)Image source
  39. * @param mixed $attributes (optional)Either a typical HTML attribute string
  40. * or an associative array
  41. * @since 1.0
  42. * @access public
  43. * @return void
  44. */
  45. function HTML_QuickForm_image($elementName=null, $src='', $attributes=null)
  46. {
  47. HTML_QuickForm_input::HTML_QuickForm_input($elementName, null, $attributes);
  48. $this->setType('image');
  49. $this->setSource($src);
  50. } // end class constructor
  51. // }}}
  52. // {{{ setSource()
  53. /**
  54. * Sets source for image element
  55. *
  56. * @param string $src source for image element
  57. * @since 1.0
  58. * @access public
  59. * @return void
  60. */
  61. function setSource($src)
  62. {
  63. $this->updateAttributes(array('src' => $src));
  64. } // end func setSource
  65. // }}}
  66. // {{{ setBorder()
  67. /**
  68. * Sets border size for image element
  69. *
  70. * @param string $border border for image element
  71. * @since 1.0
  72. * @access public
  73. * @return void
  74. */
  75. function setBorder($border)
  76. {
  77. $this->updateAttributes(array('border' => $border));
  78. } // end func setBorder
  79. // }}}
  80. // {{{ setAlign()
  81. /**
  82. * Sets alignment for image element
  83. *
  84. * @param string $align alignment for image element
  85. * @since 1.0
  86. * @access public
  87. * @return void
  88. */
  89. function setAlign($align)
  90. {
  91. $this->updateAttributes(array('align' => $align));
  92. } // end func setAlign
  93. // }}}
  94. // {{{ freeze()
  95. /**
  96. * Freeze the element so that only its value is returned
  97. *
  98. * @access public
  99. * @return void
  100. */
  101. function freeze()
  102. {
  103. return false;
  104. } //end func freeze
  105. // }}}
  106. } // end class HTML_QuickForm_image
  107. ?>