/**
* The required files
*/
require_once(HTML_TABLE_COMPONENT_PATH.'/TableTag.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 TableTag {
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->TableTag($text,$width,$class,$border,$cellpadding,$cellspacing,$summary,$caption);
if (defined('DEBUG_LEVEL') && DEBUG_LEVEL & DEBUG_LEVEL_SHOW_INFO) {
$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();
}
/**
* 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();
}
}
?>