/**
* The required files
*/
require_once(HTML_TABLE_COMPONENT_PATH.'/TableDataReader.php');
/**
* Generates a Top banner with image links
* <code>
* +-+-----------------------------+-------------------------------+
* |>| Copyright by Finn Rasmussen | Powered by myPHP Version 1.10 |
* +-+-----------------------------+-------------------------------+
*
* Usage:
* $rows = array(
* array(
* KEY_LINK=>LINK_COPYRIGHT,
* KEY_POWERED=>LINK_POWERED_BY,
* KEY_VERSION=>CURRENT_VERSION,
* ),
* );
* $datareader = DataReaderFactory::newDataReader($rows);
* $html = new Top($datareader,$text,$width,$class,$border,$cellPadding,$cellSpacing);
* print $html->getHtml();
* Or
* Top::display($datareader,$text,$width,$class,$border,$cellPadding,$cellSpacing);
* </code>
* @package layout
*/
class Top extends TableDataReader {
/**
* Constructor
* @param DataReader $datareader The Data Reader object
* @param String $text The text header for the table
* @param String $width The width of the table, default 100%
* @param String $class The css class to use
* @param String $border The table border
* @param String $cellPadding
* @param String $cellSpacing
*/
function Top($datareader='',$text='',$width='',$class='',$border='',$cellPadding='',$cellSpacing='') {
$theText = $text!=''?$text:'';
$theWidth = $width!=''?$width:TOP_VIEW_WIDTH;
$theClass = $class!=''?$class:TOP_VIEW_CLASS;
$theBorder = $border!=''?$border:TOP_VIEW_BORDER;
$theCellPadding = $cellPadding!=''?$cellPadding:TOP_VIEW_CELLPADDING;
$theCellSpacing = $cellSpacing!=''?$cellSpacing:TOP_VIEW_CELLSPACING;
$this->layout = LINK_LAYOUT_TRIANGLE | LINK_LAYOUT_BR;
$this->TableDataReader($datareader,$theText,$theWidth,$theClass,$theBorder,$theCellPadding,$theCellSpacing);
}
/**
* Get the CSS class Name for this component
* @return String The CSS class name
*/
function getCssClass() {
return CSS_TOP;
}
/**
* Toogle the request parameters which will minimize or maximize this component
* @return array The array of key=>value pair
*/
function getMinimize() {
return $this->getToogle(REQUEST_LAYOUT_SHOW, LAYOUT_SHOW, LAYOUT_SHOW_TOP);
}
/**
* Builds the html for a Top Banner, and return it
* @return String The html
*/
function getHtml() {
$html = $this->html;
if (LAYOUT_SHOW & LAYOUT_SHOW_TOP) {
if (CACHE_LAYOUT && $this->getCacheFileName(CACHE_LAYOUT_PATH)!='' && file_exists($this->getCacheFileName(CACHE_LAYOUT_PATH))) {
$html .= $this->content($this->getCacheFileName(CACHE_LAYOUT_PATH));
} else {
$html .= $this->getColumns();
if (CACHE_LAYOUT) {
$this->save($html, CACHE_LAYOUT_PATH);
}
}
} else {
$html .= $this->getMaximize();
}
return $html;
}
/**
* Display html
* <code>
* Usage:
* Top::display($datareader,$text,$width,$class,$border,$cellPadding,$cellSpacing);
* </code>
* @static
* @param DataReader $datareader The Data Reader object
* @param String $text The text header for the table
* @param String $width The width of the table, default 100%
* @param String $class The css class to use
* @param String $border The table border
* @param String $cellPadding The Cell Padding
* @param String $cellSpacing The Cell Spacing
*/
function display($datareader='',$text='',$width='',$class='',$border='',$cellPadding='',$cellSpacing='') {
$html = new Top($datareader,$text,$width,$class,$border,$cellPadding,$cellSpacing);
$html->addHtml();
}
}
?>
</td>
<td class="layoutTop" valign="middle"><!-- Kontakt --><a id="Link42" class="layoutTop" href="http://www.hvepseeksperten.dk/FormMail/" title="Kontakt"><img src="/images/mail.gif" alt="Kontakt via email
" class="layoutTop" />
<br />Kontakt</a><br />
</td>
<td class="layoutTop" valign="middle"><!-- Klik her --><a id="Link43" class="layoutTop" href="/rejseplanen/" title="Klik her"><img src="/images/rejseplanen.gif" alt="Klik her for at planlægge din rejse" class="layoutTop" />
<br />Klik her</a><br />
</td>
<td class="layoutTop" valign="middle"><!-- Kontakt --><a id="Link46" class="layoutTop" href="http://www.hvepseeksperten.dk/FormMail/" title="Kontakt"><img src="/images/mail.gif" alt="Kontakt via email
" class="layoutTop" />
<br />Kontakt</a><br />
</td>
<td class="layoutTop" valign="middle"><!-- Klik her --><a id="Link47" class="layoutTop" href="/rejseplanen/" title="Klik her"><img src="/images/rejseplanen.gif" alt="Klik her for at planlægge din rejse" class="layoutTop" />
<br />Klik her</a><br />
</td>
</tr>
</table>
?>
Class methods
Her er 'klasse metoderne' for Top klassen:
top
getcssclass
getminimize
gethtml
display
object
getclassname
getmsg
addhtml
tostring
getcachefilename
save
content
stop
html
setobject
set
get
getattribute
gettag
add
getsizeof
getelement
getelements
gettoogle
getmaximize
newtriangle
showsource
table
newtextrow
gettableheader
getstart
getend
start
end
tabledatareader
getdatareader
newdata
newcolumn
isactive
isactivetab
isactiveindex
newcolumns
adjustcolumns
newcorner
getcolumns
Object vars
Her er 'objekt variable' for Top klassen:
html =>
sql =>
elements => Array
sizeof => 2
text =>
width => 100%
class => tableBorderLeft tableBorderRight basePrinter