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

Source for file CssForm.php

Documentation is available at CssForm.php

  1. <?
  2. /**
  3. * @package form
  4. * @filesource
  5. * @see HTML_FORM_PAGE_PATH.'/CssForm.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_BASE_PAGE_PATH.'/Css.php');
  17.  
  18. /**
  19. * Generates the Form CSS
  20. * <code>
  21. * Usage:
  22. * $css = new CssForm($href);
  23. * print $css->getHtml();
  24. * Or:
  25. * CssForm::display($href);
  26. * </code>
  27. * @package form
  28. */
  29.  
  30. class CssForm extends Css {
  31. /**
  32. * Constructor
  33. * @param String $href The url to the css filename (i.e. /css/my.css)
  34. */
  35. function CssForm($href='') {
  36. $this->Css($href!=''?$href:CSS_FILE_NAME_FORM);
  37. }
  38.  
  39. /**
  40. * Returns the css Form components
  41. * @return String the complete css
  42. */
  43. function getCustom() {
  44. $html = '';
  45. $html .= $this->getHeader($this->getClassName());
  46. // input tag
  47. $html .= $this->getTag('input,select,option,textarea',CSS_BODY_COLOR,CSS_BODY_BACKGROUND, CSS_FONT_FAMILY, CSS_FONT_SIZE, CSS_TEXT_ALIGN);
  48.  
  49. // The width of the html elements
  50. $html .= $this->getWidth('.'.CSS_XXX_SMALL,CSS_WIDTH_XXX_SMALL);
  51. $html .= $this->getWidth('.'.CSS_XX_SMALL ,CSS_WIDTH_XX_SMALL);
  52. $html .= $this->getWidth('.'.CSS_X_SMALL ,CSS_WIDTH_X_SMALL);
  53. $html .= $this->getWidth('.'.CSS_SMALL ,CSS_WIDTH_SMALL);
  54. $html .= $this->getWidth('.'.CSS_MEDIUM ,CSS_WIDTH_MEDIUM);
  55. $html .= $this->getWidth('.'.CSS_LARGE ,CSS_WIDTH_LARGE);
  56. $html .= $this->getWidth('.'.CSS_X_LARGE ,CSS_WIDTH_X_LARGE);
  57. $html .= $this->getWidth('.'.CSS_XX_LARGE ,CSS_WIDTH_XX_LARGE);
  58. $html .= $this->getWidth('.'.CSS_XXX_LARGE,CSS_WIDTH_XXX_LARGE);
  59. //
  60. // Buttons
  61. $html .= $this->getButton('.'.CSS_BUTTON.','.
  62. '.'.CSS_BUTTON_DELETE.','.
  63. '.'.CSS_BUTTON_BGN.','.
  64. '.'.CSS_BUTTON_DBN.','.
  65. '.'.CSS_BUTTON_DANKORT.','.
  66. '.'.CSS_BUTTON_BEE.','.
  67. '.'.CSS_BUTTON_SMS,
  68. CSS_BUTTON_COLOR,CSS_BUTTON_BACKGROUND);
  69. // Border
  70. $html .= $this->getBorder('.'.CSS_BUTTON.','.
  71. '.'.CSS_BUTTON_DELETE.','.
  72. '.'.CSS_BUTTON_BGN.','.
  73. '.'.CSS_BUTTON_DBN.','.
  74. '.'.CSS_BUTTON_DANKORT.','.
  75. '.'.CSS_BUTTON_BEE.','.
  76. '.'.CSS_BUTTON_SMS);
  77. //
  78. $css_path = CSS_PATH.CSS_IMAGES; //
  79. $ButtonBackgroundImage = "bar3.gif";
  80. $deleteBackgroundImage = "delete.gif";
  81. $bgbankBackgroundImage = "payment/bgbank.gif";
  82. $danskebankBackgroundImage = "payment/danskebank.gif";
  83. $dankortBackgroundImage = "payment/dankort.gif";
  84. $aniBeeBackgroundImage = "aniBee.gif";
  85. $searchxBackgroundImage = "searchx.gif";
  86. //
  87. $html .= $this->getImage ('.'.CSS_BUTTON,"$css_path/$ButtonBackgroundImage",CSS_NO_REPEAT);
  88. $html .= $this->getImage ('.'.CSS_BUTTON_DELETE,"$css_path/$deleteBackgroundImage",CSS_NO_REPEAT);
  89. $html .= $this->getImage ('.'.CSS_BUTTON_BGN,"$css_path/$bgbankBackgroundImage",CSS_NO_REPEAT);
  90. $html .= $this->getImage ('.'.CSS_BUTTON_DBN,"$css_path/$danskebankBackgroundImage",CSS_NO_REPEAT);
  91. $html .= $this->getImage ('.'.CSS_BUTTON_DANKORT,"$css_path/$dankortBackgroundImage",CSS_NO_REPEAT);
  92. $html .= $this->getImage ('.'.CSS_BUTTON_BEE,"$css_path/$aniBeeBackgroundImage",CSS_NO_REPEAT);
  93. $html .= $this->getImage ('.'.CSS_BUTTON_SMS,"$css_path/$searchxBackgroundImage",CSS_NO_REPEAT);
  94. $html .= $this->getImage('.'.CSS_SEARCH_SUBMIT,"$css_path/$searchxBackgroundImage",CSS_NO_REPEAT);
  95. return $html;
  96. }
  97.  
  98. /**
  99. * Display html
  100. * <code>
  101. * Usage:
  102. * CssForm::display($href);
  103. * </code>
  104. * @static
  105. * @param String $href The url to the css file (i.e. /css/my.css)
  106. */
  107. function display($href='') {
  108. $html = new CssForm($href);
  109. $html->addHtml();
  110. }
  111. }
  112. ?>

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