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

Source for file Skeleton.php

Documentation is available at Skeleton.php

  1. <?
  2. /**
  3. * @package table
  4. * @filesource
  5. * @see HTML_TABLE_PAGE_PATH.'/Skeleton.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_TABLE_COMPONENT_PATH.'/Table.php');
  17.  
  18. /**
  19. * The skeleton.
  20. * Generates the Skeleton html for a Page built on a Table object
  21. * <code>
  22. * Usage:
  23. * $skeleton = new Skeleton($text,$width,$class,$border,$cellpadding,$cellspacing,$summary,$caption);
  24. * print $skeleton->getHtml(); // See this, for usage
  25. * Or
  26. * Skeleton::display($text,$width,$class,$border,$cellpadding,$cellspacing,$summary,$caption);
  27. * Or
  28. * Skeleton::start($text,$width,$class,$border,$cellpadding,$cellspacing,$summary,$caption);
  29. * </code>
  30. * @package table
  31. */
  32.  
  33. class Skeleton extends Table {
  34. var $contentLeft = '';
  35. var $contentCenter = '';
  36. var $contentRight = '';
  37. var $teaserLeft = '';
  38. var $teaserCenter = '';
  39. var $teaserRight = '';
  40.  
  41. /**
  42. * Constructor
  43. * @param String $text The text header for the table
  44. * @param String $width The width of the table
  45. * @param String $class The class of the table
  46. * @param String $border The border of the table
  47. * @param String $cellpadding The CellSpacing
  48. * @param String $cellspacing The CellPadding
  49. * @param String $summary The Summary
  50. * @param String $caption The Caption
  51. */
  52. function Skeleton($text='',$width='',$class='',$border='',$cellpadding='',$cellspacing='',$summary='',$caption='') {
  53. $theBorder = $border;
  54. $this->Table($text,$width,$class,$border,$cellpadding,$cellspacing,$summary,$caption);
  55. if (defined('LOG_LEVEL') && LOG_LEVEL & LOG_LEVEL_DEBUG) {
  56. $this->contentLeft = "<!-- Skeleton Content Left -->\r\n";
  57. $this->contentCenter = "<!-- Skeleton Content Center -->\r\n";
  58. $this->contentRight = "<!-- Skeleton Content Right -->\r\n";
  59. $this->teaserLeft = "<!-- Skeleton Teaser Left -->\r\n";
  60. $this->teaserCenter = "<!-- Skeleton Teaser Center -->\r\n";
  61. $this->teaserRight = "<!-- Skeleton Teaser Right -->\r\n";
  62. }
  63. }
  64.  
  65. /**
  66. * Returns the html for the skeleton
  67. * @return String the complete html
  68. */
  69. function getHtml() {
  70. $html = '';
  71. if (SKELETON_SHOW & SKELETON_SHOW_LEFT || SKELETON_SHOW & SKELETON_SHOW_CENTER || SKELETON_SHOW & SKELETON_SHOW_RIGHT ||
  72. SKELETON_SHOW & SKELETON_SHOW_TEASER_LEFT || SKELETON_SHOW & SKELETON_SHOW_TEASER_CENTER || SKELETON_SHOW & SKELETON_SHOW_TEASER_RIGHT) {
  73. $html .= $this->getStart(SKELETON_TEXT,SKELETON_WIDTH,SKELETON_CLASS,SKELETON_BORDER,SKELETON_CELL_PADDING,SKELETON_CELL_SPACING);
  74. }
  75. // Content row
  76. if (SKELETON_SHOW & SKELETON_SHOW_LEFT || SKELETON_SHOW & SKELETON_SHOW_CENTER || SKELETON_SHOW & SKELETON_SHOW_RIGHT) {
  77. $html .= $this->getRowStart();
  78. }
  79. // Left
  80. if (SKELETON_SHOW & SKELETON_SHOW_LEFT) {
  81. $html .= $this->getColumnStart(CSS_SKELETON_LEFT.' '.CSS_BORDER_RIGHT);
  82. $html .= $this->contentLeft;
  83. $html .= $this->getColumnEnd();
  84. }
  85. // Center
  86. if (SKELETON_SHOW & SKELETON_SHOW_CENTER) {
  87. $html .= $this->getColumnStart(CSS_SKELETON_CENTER);
  88. $html .= $this->contentCenter;
  89. $html .= $this->getColumnEnd();
  90. }
  91. // Right
  92. if (SKELETON_SHOW & SKELETON_SHOW_RIGHT) {
  93. $html .= $this->getColumnStart(CSS_SKELETON_RIGHT.' '.CSS_BORDER_LEFT);
  94. $html .= $this->contentRight;
  95. $html .= $this->getColumnEnd();
  96. }
  97. if (SKELETON_SHOW & SKELETON_SHOW_LEFT || SKELETON_SHOW & SKELETON_SHOW_CENTER || SKELETON_SHOW & SKELETON_SHOW_RIGHT) {
  98. $html .= $this->getRowEnd();
  99. }
  100.  
  101. // Teaser Row
  102. if (SKELETON_SHOW & SKELETON_SHOW_TEASER_LEFT || SKELETON_SHOW & SKELETON_SHOW_TEASER_CENTER || SKELETON_SHOW & SKELETON_SHOW_TEASER_RIGHT) {
  103. $html .= $this->getRowStart();
  104. }
  105. // Left
  106. if (SKELETON_SHOW & SKELETON_SHOW_TEASER_LEFT) {
  107. $html .= $this->getColumnStart(CSS_SKELETON_LEFT.' '.CSS_BORDER_RIGHT);
  108. $html .= $this->teaserLeft;
  109. $html .= $this->getColumnEnd();
  110. }
  111. // Center
  112. if (SKELETON_SHOW & SKELETON_SHOW_TEASER_CENTER) {
  113. $html .= $this->getColumnStart(CSS_SKELETON_CENTER);
  114. $html .= $this->teaserCenter;
  115. $html .= $this->getColumnEnd();
  116. }
  117. // Right
  118. if (SKELETON_SHOW & SKELETON_SHOW_TEASER_RIGHT) {
  119. $html .= $this->getColumnStart(CSS_SKELETON_RIGHT.' '.CSS_BORDER_LEFT);
  120. $html .= $this->teaserRight;
  121. $html .= $this->getColumnEnd();
  122. }
  123. if (SKELETON_SHOW & SKELETON_SHOW_TEASER_LEFT || SKELETON_SHOW & SKELETON_SHOW_TEASER_CENTER || SKELETON_SHOW & SKELETON_SHOW_TEASER_RIGHT) {
  124. $html .= $this->getRowEnd();
  125. }
  126. if (SKELETON_SHOW & SKELETON_SHOW_LEFT || SKELETON_SHOW & SKELETON_SHOW_CENTER || SKELETON_SHOW & SKELETON_SHOW_RIGHT ||
  127. SKELETON_SHOW & SKELETON_SHOW_TEASER_LEFT || SKELETON_SHOW & SKELETON_SHOW_TEASER_CENTER || SKELETON_SHOW & SKELETON_SHOW_TEASER_RIGHT) {
  128. $html .= $this->getEnd();
  129. }
  130. return $html;
  131. }
  132.  
  133. /**
  134. * Display html
  135. * <code>
  136. * Usage:
  137. * Skeleton::display($text,$width,$class,$border,$cellpadding,$cellspacing,$summary,$caption);
  138. * </code>
  139. * @static
  140. * @param String $text The text header for the table
  141. * @param String $width The width of the table
  142. * @param String $class The class of the table
  143. * @param String $border The border of the table
  144. * @param String $cellpadding The CellSpacing
  145. * @param String $cellspacing The CellPadding
  146. * @param String $summary The Summary
  147. * @param String $caption The Caption
  148. */
  149. function display($text='',$width='',$class='',$border='',$cellpadding='',$cellspacing='',$summary='',$caption='') {
  150. $html = new Skeleton($text,$width,$class,$border,$cellpadding,$cellspacing,$summary,$caption);
  151. $html->addHtml();
  152. }
  153. }
  154. ?>

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