Source for file xhtml.php

Documentation is available at xhtml.php

  1. <?
  2.  
  3. /* Line Break. do i need to say anymore?*/
  4. class newline extends xml_element
  5. {
  6. function newline()
  7. {
  8. $this->xml_element("br");
  9. }
  10. }
  11.  
  12. /* Hr tag*/
  13. class hline extends xml_element
  14. {
  15. function hline($width="100%")
  16. {
  17. $this->xml_element("hr",array("width" => $width));
  18. }
  19. }
  20.  
  21. class head extends xml_element
  22. {
  23. function head($content="",$headnum,$attribs=array())
  24. {
  25. $headnum = (int) $headnum;
  26. $this->xml_element("h".$headnum,$attribs);
  27. $this->add_child($content);
  28. }
  29. }
  30.  
  31. class section_element extends xml_element
  32. {
  33. function section_element($content="",$attribs=array())
  34. {
  35. $this->xml_element($this->tag,$attribs);
  36. $this->add_child($content);
  37. }
  38. }
  39.  
  40. class para extends section_element
  41. {
  42. var $tag="p";
  43. }
  44.  
  45. class div extends section_element
  46. {
  47. var $tag="div";
  48. }
  49.  
  50. class caption extends section_element
  51. {
  52. var $tag="caption";
  53. }
  54.  
  55. /* Images*/
  56. class image extends xml_element
  57. {
  58. var $alt;
  59. function image($url,$alt,$x="auto",$y="auto")
  60. {
  61. if ($alt=="") $alt=$url;
  62. $this->xml_element("img",array("src" => $url,"alt" => $alt));
  63. /* This is an experimental code to figure out width/height automaticly */
  64. if ($x=="auto"|$y=="auto")
  65. {
  66. $img=GetImageSize($url);
  67. if ($x=="auto") $x=$img[0];
  68. if ($y=="auto") $y=$img[1];
  69. }
  70. /* I tried doing width and height using styles, but IE 5.0 didn't like
  71. * it, and NS 4.5 made a total mess with CSS enabled, So until
  72. * Mozilla 1.0/Konqueror become usable and stable, i'll have to give
  73. * up on this issue */
  74. if ($x!="auto") $this->add_attribs(array("width" => $x));
  75. if ($y!="auto") $this->add_attribs(array("height" => $y));
  76. }
  77. }
  78.  
  79. /* We want links, dont we?*/
  80.  
  81. class href extends xml_element
  82. {
  83. function href($url,$desc)
  84. {
  85. $this->xml_element("a",array("href" => $url));
  86. $this->add_child($desc);
  87. }
  88. }

Documentation generated on Tue, 24 May 2005 03:59:15 -0400 by phpDocumentor 1.3.0RC3