PageRenderTime 53ms CodeModel.GetById 28ms RepoModel.GetById 1ms app.codeStats 0ms

/campsite/src/include/pear/HTML/QuickForm/image.php

https://github.com/joechrysler/Campsite
PHP | 127 lines | 28 code | 14 blank | 85 comment | 0 complexity | 09da0f48a2d9e83f390569fdbcceff33 MD5 | raw file
Possible License(s): BSD-3-Clause, AGPL-1.0, LGPL-2.1, Apache-2.0
  1. <?php
  2. /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
  3. /**
  4. * HTML class for an <input type="image" /> 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: image.php,v 1.6 2009/04/04 21:34:03 avb Exp $
  21. * @link http://pear.php.net/package/HTML_QuickForm
  22. */
  23. /**
  24. * Base class for <input /> form elements
  25. */
  26. require_once 'HTML/QuickForm/input.php';
  27. /**
  28. * HTML class for an <input type="image" /> element
  29. *
  30. * @category HTML
  31. * @package HTML_QuickForm
  32. * @author Adam Daniel <adaniel1@eesus.jnj.com>
  33. * @author Bertrand Mansion <bmansion@mamasam.com>
  34. * @version Release: 3.2.11
  35. * @since 1.0
  36. */
  37. class HTML_QuickForm_image extends HTML_QuickForm_input
  38. {
  39. // {{{ constructor
  40. /**
  41. * Class constructor
  42. *
  43. * @param string $elementName (optional)Element name attribute
  44. * @param string $src (optional)Image source
  45. * @param mixed $attributes (optional)Either a typical HTML attribute string
  46. * or an associative array
  47. * @since 1.0
  48. * @access public
  49. * @return void
  50. */
  51. function HTML_QuickForm_image($elementName=null, $src='', $attributes=null)
  52. {
  53. HTML_QuickForm_input::HTML_QuickForm_input($elementName, null, $attributes);
  54. $this->setType('image');
  55. $this->setSource($src);
  56. } // end class constructor
  57. // }}}
  58. // {{{ setSource()
  59. /**
  60. * Sets source for image element
  61. *
  62. * @param string $src source for image element
  63. * @since 1.0
  64. * @access public
  65. * @return void
  66. */
  67. function setSource($src)
  68. {
  69. $this->updateAttributes(array('src' => $src));
  70. } // end func setSource
  71. // }}}
  72. // {{{ setBorder()
  73. /**
  74. * Sets border size for image element
  75. *
  76. * @param string $border border for image element
  77. * @since 1.0
  78. * @access public
  79. * @return void
  80. */
  81. function setBorder($border)
  82. {
  83. $this->updateAttributes(array('border' => $border));
  84. } // end func setBorder
  85. // }}}
  86. // {{{ setAlign()
  87. /**
  88. * Sets alignment for image element
  89. *
  90. * @param string $align alignment for image element
  91. * @since 1.0
  92. * @access public
  93. * @return void
  94. */
  95. function setAlign($align)
  96. {
  97. $this->updateAttributes(array('align' => $align));
  98. } // end func setAlign
  99. // }}}
  100. // {{{ freeze()
  101. /**
  102. * Freeze the element so that only its value is returned
  103. *
  104. * @access public
  105. * @return void
  106. */
  107. function freeze()
  108. {
  109. return false;
  110. } //end func freeze
  111. // }}}
  112. } // end class HTML_QuickForm_image
  113. ?>