<?php
/*
*******************************************************************************
FiForms -- A collection of PHP classes designed
to facilitate rapid development of web-database software
Copyright (C) 2003-2008 Daniel McFeeters
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
The original author of this library can be contacted at the following
address:
Daniel McFeeters
182 Baker Rd.
Faubush, KY 42544-6526
email:databases [at] fiforms [dot] org
http://www.fiforms.org/
Project Started May 4, 2003
*******************************************************************************
FiForms_iContainer.inc.php
iTabGroup class Definition
iTabGroup collects together a group of iTabPage elements, implemting a
multi-tabbed form
*******************************************************************************
*/
if(!isset($FIFORMS_CONFIG))
{
die('No Configuration found. Did you perhaps call an include file' .
' directly instead of calling it as part of the FiForms' .
' application?');
}
require_once("FiForms_iContainer.inc.php");
/* ?><code><?php */
$FIFORM_XML_INPUTS[] = 'f:iTabGroup';
class iTabGroup extends iContainer
{
public $width;
public $height;
function iTabGroup()
// class constructor
{
$this->iInput(func_get_args());
$this->width = 600;
$this->height = 400;
// assign a generic table wrapper to the format array.
} // function iContainer
function drawBody()
{
$this->captionOutput .=
'<div class="'.
($this->cCount < 1 ? 'tabgrouptabcurrent' : 'tabgrouptabother').
'" id="'.htmlentities($thisKey).
'_tab" onclick="showTab(\''.
htmlentities($thisKey)."','".
htmlentities($this->keyPrefix).'\');\">';
$this->captionOutput .=
"<a href=\"javascript:showTab('".
htmlentities($thisKey)."','".htmlentities($this->keyPrefix).'\');"
>'.$this->drawCaption.'</a></div>';
return("<div class=\"".
($this->cCount++ < 1 ? 'visibletabpage' : 'hiddentabpage').
"\" id=\"".htmlentities($thisKey)."\">$this->drawInput</div>\n");
} // function drawBody
function drawInput()
{
if(!$this->visible)
{
return '';
}
$output = '<div class="tabgroup"><div class="tabgroupcaptions" id="'.htmlentities($this->keyPrefix).'captions">';
$this->captionOutput = '';
$bodyOutput .= $this->outputRow($this,true);
$output .= $this->captionOutput;
$output .= '</div><div class="tabgrouparea" style="width:'.
$this->width.'px; height:'.$this->height.'px;" id="'.htmlentities($this->keyPrefix).'area">';
$output .= $bodyOutput;
$output .= '</div></div>';
return($output);
} // function drawInput
function buildFromXML($input)
{
if($input->attributes->getNamedItem('width'))
{
$this->width = $input->attributes->getNamedItem('width')->nodeValue;
}
if($input->attributes->getNamedItem('height'))
{
$this->height = $input->attributes->getNamedItem('height')->nodeValue;
}
parent::buildFromXML($input);
} // function buildFromXML
} // class iContainer
/* ?></code><?php */
?>