- <?
- /**
- * @package table
- * @filesource
- * @see HTML_TABLE_PAGE_PATH.'/Skeleton.php'
- * @copyright (c) http://Finn-Rasmussen.com
- * @license http://Finn-Rasmussen.com/license/ myPHP License conditions
- * @author http://Finn-Rasmussen.com
- * @version 1.9
- * @since 21-oct-2005
- */
-
- /**
- * The required files
- */
- require_once(HTML_TABLE_COMPONENT_PATH.'/Table.php');
-
- /**
- * The skeleton.
- * Generates the Skeleton html for a Page built on a Table object
- * <code>
- * Usage:
- * $skeleton = new Skeleton($text,$width,$class,$border,$cellpadding,$cellspacing,$summary,$caption);
- * print $skeleton->getHtml(); // See this, for usage
- * Or
- * Skeleton::display($text,$width,$class,$border,$cellpadding,$cellspacing,$summary,$caption);
- * Or
- * Skeleton::start($text,$width,$class,$border,$cellpadding,$cellspacing,$summary,$caption);
- * </code>
- * @package table
- */
-
- class Skeleton extends Table {
- var $contentLeft = '';
- var $contentCenter = '';
- var $contentRight = '';
- var $teaserLeft = '';
- var $teaserCenter = '';
- var $teaserRight = '';
-
- /**
- * Constructor
- * @param String $text The text header for the table
- * @param String $width The width of the table
- * @param String $class The class of the table
- * @param String $border The border of the table
- * @param String $cellpadding The CellSpacing
- * @param String $cellspacing The CellPadding
- * @param String $summary The Summary
- * @param String $caption The Caption
- */
- function Skeleton($text='',$width='',$class='',$border='',$cellpadding='',$cellspacing='',$summary='',$caption='') {
- $theBorder = $border;
- $this->Table($text,$width,$class,$border,$cellpadding,$cellspacing,$summary,$caption);
- if (defined('LOG_LEVEL') && LOG_LEVEL & LOG_LEVEL_DEBUG) {
- $this->contentLeft = "<!-- Skeleton Content Left -->\r\n";
- $this->contentCenter = "<!-- Skeleton Content Center -->\r\n";
- $this->contentRight = "<!-- Skeleton Content Right -->\r\n";
- $this->teaserLeft = "<!-- Skeleton Teaser Left -->\r\n";
- $this->teaserCenter = "<!-- Skeleton Teaser Center -->\r\n";
- $this->teaserRight = "<!-- Skeleton Teaser Right -->\r\n";
- }
- }
-
- /**
- * Returns the html for the skeleton
- * @return String the complete html
- */
- function getHtml() {
- $html = '';
- if (SKELETON_SHOW & SKELETON_SHOW_LEFT || SKELETON_SHOW & SKELETON_SHOW_CENTER || SKELETON_SHOW & SKELETON_SHOW_RIGHT ||
- SKELETON_SHOW & SKELETON_SHOW_TEASER_LEFT || SKELETON_SHOW & SKELETON_SHOW_TEASER_CENTER || SKELETON_SHOW & SKELETON_SHOW_TEASER_RIGHT) {
- $html .= $this->getStart(SKELETON_TEXT,SKELETON_WIDTH,SKELETON_CLASS,SKELETON_BORDER,SKELETON_CELL_PADDING,SKELETON_CELL_SPACING);
- }
- // Content row
- if (SKELETON_SHOW & SKELETON_SHOW_LEFT || SKELETON_SHOW & SKELETON_SHOW_CENTER || SKELETON_SHOW & SKELETON_SHOW_RIGHT) {
- $html .= $this->getRowStart();
- }
- // Left
- if (SKELETON_SHOW & SKELETON_SHOW_LEFT) {
- $html .= $this->getColumnStart(CSS_SKELETON_LEFT.' '.CSS_BORDER_RIGHT);
- $html .= $this->contentLeft;
- $html .= $this->getColumnEnd();
- }
- // Center
- if (SKELETON_SHOW & SKELETON_SHOW_CENTER) {
- $html .= $this->getColumnStart(CSS_SKELETON_CENTER);
- $html .= $this->contentCenter;
- $html .= $this->getColumnEnd();
- }
- // Right
- if (SKELETON_SHOW & SKELETON_SHOW_RIGHT) {
- $html .= $this->getColumnStart(CSS_SKELETON_RIGHT.' '.CSS_BORDER_LEFT);
- $html .= $this->contentRight;
- $html .= $this->getColumnEnd();
- }
- if (SKELETON_SHOW & SKELETON_SHOW_LEFT || SKELETON_SHOW & SKELETON_SHOW_CENTER || SKELETON_SHOW & SKELETON_SHOW_RIGHT) {
- $html .= $this->getRowEnd();
- }
-
- // Teaser Row
- if (SKELETON_SHOW & SKELETON_SHOW_TEASER_LEFT || SKELETON_SHOW & SKELETON_SHOW_TEASER_CENTER || SKELETON_SHOW & SKELETON_SHOW_TEASER_RIGHT) {
- $html .= $this->getRowStart();
- }
- // Left
- if (SKELETON_SHOW & SKELETON_SHOW_TEASER_LEFT) {
- $html .= $this->getColumnStart(CSS_SKELETON_LEFT.' '.CSS_BORDER_RIGHT);
- $html .= $this->teaserLeft;
- $html .= $this->getColumnEnd();
- }
- // Center
- if (SKELETON_SHOW & SKELETON_SHOW_TEASER_CENTER) {
- $html .= $this->getColumnStart(CSS_SKELETON_CENTER);
- $html .= $this->teaserCenter;
- $html .= $this->getColumnEnd();
- }
- // Right
- if (SKELETON_SHOW & SKELETON_SHOW_TEASER_RIGHT) {
- $html .= $this->getColumnStart(CSS_SKELETON_RIGHT.' '.CSS_BORDER_LEFT);
- $html .= $this->teaserRight;
- $html .= $this->getColumnEnd();
- }
- if (SKELETON_SHOW & SKELETON_SHOW_TEASER_LEFT || SKELETON_SHOW & SKELETON_SHOW_TEASER_CENTER || SKELETON_SHOW & SKELETON_SHOW_TEASER_RIGHT) {
- $html .= $this->getRowEnd();
- }
- if (SKELETON_SHOW & SKELETON_SHOW_LEFT || SKELETON_SHOW & SKELETON_SHOW_CENTER || SKELETON_SHOW & SKELETON_SHOW_RIGHT ||
- SKELETON_SHOW & SKELETON_SHOW_TEASER_LEFT || SKELETON_SHOW & SKELETON_SHOW_TEASER_CENTER || SKELETON_SHOW & SKELETON_SHOW_TEASER_RIGHT) {
- $html .= $this->getEnd();
- }
- return $html;
- }
-
- /**
- * Display html
- * <code>
- * Usage:
- * Skeleton::display($text,$width,$class,$border,$cellpadding,$cellspacing,$summary,$caption);
- * </code>
- * @static
- * @param String $text The text header for the table
- * @param String $width The width of the table
- * @param String $class The class of the table
- * @param String $border The border of the table
- * @param String $cellpadding The CellSpacing
- * @param String $cellspacing The CellPadding
- * @param String $summary The Summary
- * @param String $caption The Caption
- */
- function display($text='',$width='',$class='',$border='',$cellpadding='',$cellspacing='',$summary='',$caption='') {
- $html = new Skeleton($text,$width,$class,$border,$cellpadding,$cellspacing,$summary,$caption);
- $html->addHtml();
- }
- }
- ?>