phpDocumentor form
[ class tree: form ] [ index: form ] [ all elements ]

Source for file CancelButton.php

Documentation is available at CancelButton.php

  1. <?
  2. /**
  3. * @package form
  4. * @filesource
  5. * @see HTML_FORM_COMPONENT_PATH.'/CancelButton.php'
  6. * @copyright (c) http://Finn-Rasmussen.com
  7. * @license http://Finn-Rasmussen.com/license/ myPHP License conditions
  8. * @author http://Finn-Rasmussen.com
  9. * @version 1.9
  10. * @since 21-oct-2005
  11. */
  12.  
  13. /**
  14. * The required files
  15. */
  16. require_once(HTML_FORM_COMPONENT_PATH.'/Input.php');
  17.  
  18. /**
  19. * Generates an INPUT element for a form, as a Cancel Button
  20. * <code>
  21. * <input type="button" name="$name" value="$value" class="$class"
  22. * title="$title" tabindex="" />
  23. * Usage:
  24. * $button = new CancelButton($name,$value,$class,$onclick,$title,$tabindex);
  25. * print $button->getHtml();
  26. * Or
  27. * CancelButton::display($name,$value,$class,$onclick,$title,$tabindex);
  28. * </code>
  29. * @package form
  30. */
  31.  
  32. class CancelButton extends Input {
  33. /**
  34. * Constructor
  35. * @param String $name The name
  36. * @param String $value The value, if any
  37. * @param String $class The class
  38. * @param String $onclick On click event for javascript
  39. * @param String $title The tooltip
  40. * @param String $tabindex The tabindex
  41. */
  42. function CancelButton($name='',$value='',$class='',$onclick='',$title='',$tabindex='') {
  43. $class = $class!=''?$class:CSS_BUTTON_CANCEL_CLASS;
  44. $onclick = $onclick!=''?$onclick:BUTTON_CANCEL_ONCLICK;
  45. $value = $value!=''?$value:BUTTON_CANCEL_TEXT;
  46. $this->Input('button',$name,$value,$class,'','','','',$onclick,$title,$tabindex);
  47. }
  48.  
  49. /**
  50. * Display html
  51. * <code>
  52. * Usage:
  53. * CancelButton::display($name,$value,$class,$onclick,$title,$tabindex);
  54. * </code>
  55. * @static
  56. * @param String $name The name
  57. * @param String $value The value, if any
  58. * @param String $class The class
  59. * @param String $onclick On click event for javascript
  60. * @param String $title The tooltip
  61. * @param String $tabindex The tabindex
  62. */
  63. function display($name='',$value='',$class='',$onclick='',$title='',$tabindex='') {
  64. $html = new CancelButton($name,$value,$class,$onclick,$title,$tabindex);
  65. $html->addHtml();
  66. }
  67. }
  68. ?>

Documentation generated on Thu, 22 Dec 2005 17:03:10 +0100 by phpDocumentor 1.3.0RC3