| Matte Edens 2004-06-28, 8:58 am |
| I have thrown together two functions and a tweak of the toHtml() =
function. These are from the CVS files but I don't have CVS access so =
they are the straight code, not a diff. Sorry. If it isn't up to PEAR =
code requirements I again apologize.
// {HTML/Page2/Frameset.php} --------<snip snip>--------------
function setBorder($border)
{
$this->_border =3D $border;
} // end func setBorder
=20
function getBorder()
{
if ($this->_border >=3D 0)
{
return ' border=3D"' . $this->_border . '" frameborder=3D"' . =
$this->_border . '"';
}
} // end func setBorder
=20
function toHTML()
{
// get line endings
$lnEnd =3D $this->_getLineEnd();
$tab =3D $this->_getTab();
$tabs =3D $this->_getTabs();
$offset =3D $this->getTabOffset();
=20
if ($this->xhtml =3D=3D=3D true) {
$tagEnd =3D ' />';
} else {
$tagEnd =3D '>';
}
=20
if (count($this->_rows) > 0) {
$type =3D 'rows';
$sizesStr =3D implode(', ', $this->_rows);
} else {
$type =3D 'cols';
$sizesStr =3D implode(', ', $this->_cols);
}
=20
$strHtml =3D $tabs . '<frameset ' . $type . '=3D"' . $sizesStr =
.. '"' . $this->getBorder() . '>' . $lnEnd;
=20
$type =3D '_' . $type;
foreach (array_keys($this->$type) as $name) {
if(strtolower(get_class($this->$name)) =3D=3D =
'html_page2_frameset') {
$this->$name->setTabOffset($offset + 1);
$this->$name->setTab($tab);
$this->$name->setLineEnd($lnEnd);
$this->$name->xhtml =3D $this->xhtml;
// fetch the
$strHtml .=3D $this->$name->toHtml();
} else {
$this->$name->xhtml =3D $this->xhtml;
$strHtml .=3D $tabs . $tab . $this->$name->toHtml() . =
$lnEnd;
}
}
if (!$this->_master) {
$strHtml .=3D $tabs . '</frameset>' . $lnEnd;
}
=20
return $strHtml;
=20
} // end func toHtml
// {HTML/Page2/Frameset.php} --------<snip snip>--------------
-----Original Message-----
From: Klaus Guenther [mailto:klaus@capitalfocus.org]
Sent: Thu 6/24/2004 10:23 AM
To: Matte Edens
Cc: pear-general@lists.php.net
Subject: Re: [PEAR] HTML_Page (or Page2) and framesets
Klaus Guenther wrote:
> Matte Edens wrote:
>
>
>
> Today I'll try to write HTML_Page2_Frameset, an instance of which will =
> be located at $page->frameset, and it can be nested at will.
Check out CVS. There is an example in there, too.
Klaus
|