Source for file forms.inc.php
Documentation is available at forms.inc.php
* This file is part of the VCL for PHP project
* Copyright (c) 2004-2007 qadram software <support@qadram.com>
* Checkout AUTHORS file for more information on the developers
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 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
* Lesser General Public License for more details.
* You should have received a copy of the GNU Lesser 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
define('dtXHTML_1_0_Strict' ,'XHTML 1.0 Strict');
define('dtXHTML_1_0_Transitional' ,'XHTML 1.0 Transitional');
define('dtXHTML_1_0_Frameset' ,'XHTML 1.0 Frameset');
define('dtHTML_4_01_Strict' ,'HTML 4.01 Strict');
define('dtHTML_4_01_Transitional' ,'HTML 4.01 Transitional');
define('dtHTML_4_01_Frameset' ,'HTML 4.01 Frameset');
define('dtXHTML_1_1' ,'XHTML 1.1');
* Shutdown function, the right moment to serialize all components
//This is the moment to store all properties in the session to retrieve them later
$application->serializeChildren();
//Uncomment this to get what is stored on the session at the last step of your scripts
function getLanguage() { return $this->_language; }
function setLanguage($value) { $this->_language= $value; }
if (isset ($_GET['restore_session']))
while (list ($k,$v)= each($_GET))
if (strpos($k,'.')=== false) $_SESSION[$k]= $v;
* Autodetects the language for the user browser
use_unit("language/php_language_detection.php");
$lang= get_languages('data');
while (list ($k,$v)= each($lang))
* Global $application variable
* Base class for controls with scrolling area
* Base class for Page component
//Calls inherited constructor
parent::__construct($aowner);
$this->ControlStyle= "csAcceptsControls=1";
* DataModule class, basically a non visible holder for direct Component descendants
* Function responsible to dispatch ajax requests to the right events
function ajaxProcess($owner, $sender, $params, $event, $postvars)
$ $owner->$event($ $owner->$sender, $params);
$objResponse = new xajaxResponse();
$objResponse->addScript($ccontents);
$objResponse->addAssign($v->Name. "_outer","innerHTML",$ccontents);
$objResponse->addScript($js[0]);
$response= $objResponse->getXML();
define('rmLazyOpaque','lazyopaque');
define('rmTranslucent','translucent');
define('mmTranslucent','translucent');
* A class to encapsulate a window living on the browser
//Calls inherited constructor
$this->ControlStyle= "csAcceptsControls=1";
$this->ControlStyle= "csSlowRedraw=1";
* Specifies if the window is modal or not
function getModal() { return $this->_modal; }
function setModal($value) { $this->_modal= $value; }
function defaultModal() { return 0; }
* Specifies if the window is visible or not
function getIsVisible() { return $this->_isvisible; }
function setIsVisible($value) { $this->_isvisible= $value; }
function defaultIsVisible() { return true; }
function getCaption() { return $this->readCaption(); }
function setCaption($value) { $this->writeCaption($value); }
* Specifies if the window allows to be resized
function getResizeable() { return $this->_resizeable; }
function setResizeable($value) { $this->_resizeable= $value; }
function defaultResizeable() { return 1; }
* Specifies if the window is modal allows to be moved
function getMoveable() { return $this->_moveable; }
function setMoveable($value) { $this->_moveable= $value; }
function defaultMoveable() { return 1; }
* Specifies if the window shows the minimize button or not
function setShowMinimize($value) { $this->_showminimize= $value; }
function defaultShowMinimize() { return 1; }
* Specifies if the window shows the maximize button or not
function setShowMaximize($value) { $this->_showmaximize= $value; }
function defaultShowMaximize() { return 1; }
* Specifies if the window shows the close button or not
function getShowClose() { return $this->_showclose; }
function setShowClose($value) { $this->_showclose= $value; }
function defaultShowClose() { return 1; }
* Specifies if the window shows the top left icon or not
function getShowIcon() { return $this->_showicon; }
function setShowIcon($value) { $this->_showicon= $value; }
function defaultShowIcon() { return 1; }
* Specifies if the window shows a caption
function setShowCaption($value) { $this->_showcaption= $value; }
function defaultShowCaption() { return 1; }
* Specifies the method used to move the window
function getMoveMethod() { return $this->_movemethod; }
function setMoveMethod($value) { $this->_movemethod= $value; }
function defaultMoveMethod() { return "mmOpaque"; }
* Specifies the method used to resize the window
function setResizeMethod($value) { $this->_resizemethod= $value; }
function defaultResizeMethod() { return "rmFrame"; }
* Specifies if the window shows the status bar or not
function defaultShowStatusBar() { return 0; }
echo "<script type=\"text/javascript\">";
echo "var d = qx.ui.core.ClientDocument.getInstance();\n";
echo " var $this->Name = new qx.ui.window.Window(\"$this->Caption\", \"icon/16/apps/accessories-disk-usage.png\");\n";
echo " $this->Name.setLocation($this->Left, $this->Top);\n";
if ($this->Modal) echo " $this->Name.setModal(true);\n";
else echo " $this->Name.setModal(false);\n";
if ($this->Resizeable) echo " $this->Name.setResizeable(true);\n";
else echo " $this->Name.setResizeable(false);\n";
if ($this->Moveable) echo " $this->Name.setMoveable(true);\n";
else echo " $this->Name.setMoveable(false);\n";
echo " $this->Name.setMoveMethod(\"". constant($this->MoveMethod). "\");\n";
echo " $this->Name.setResizeMethod(\"". constant($this->ResizeMethod). "\");\n";
echo " $this->Name.setLocation(0,0);\n";
if ($this->ShowClose) echo " $this->Name.setShowClose(true);\n";
else echo " $this->Name.setShowClose(false);\n";
if ($this->ShowMinimize) echo " $this->Name.setShowMinimize(true);\n";
else echo " $this->Name.setShowMinimize(false);\n";
if ($this->ShowMaximize) echo " $this->Name.setShowMaximize(true);\n";
else echo " $this->Name.setShowMaximize(false);\n";
if ($this->ShowIcon) echo " $this->Name.setShowIcon(true);\n";
else echo " $this->Name.setShowIcon(false);\n";
if ($this->ShowCaption) echo " $this->Name.setShowCaption(true);\n";
else echo " $this->Name.setShowCaption(false);\n";
if ($this->ShowStatusBar) echo " $this->Name.setShowStatusbar(true);\n";
else echo " $this->Name.setShowStatusbar(false);\n";
echo " $this->Name.setWidth($this->Width);\n";
echo " $this->Name.setHeight($this->Height);\n";
echo " d.add($this->Name)\n";
echo " $this->Name.open();\n";
echo " $this->Name.open();\n";
* A class to encapsulate a web page
* The javascript OnLoad event is called after all nested framesets and
* frames are finished with loading their content.
function getjsOnLoad() { return $this->_jsonload; }
* The javascript OnLoad event is called after all nested framesets and
* frames are finished with loading their content.
function setjsOnLoad($value) { $this->_jsonload= $value; }
function defaultjsOnLoad() { return null; }
* The javascript OnUnload event is called after all nested framesets and
* frames are finished with unloading their content.
function getjsOnUnload() { return $this->_jsonunload; }
* The javascript OnUnload event is called after all nested framesets and
* frames are finished with unloading their content.
function setjsOnUnload($value) { $this->_jsonunload= $value; }
function defaultjsOnUnload() { return null; }
function getLayout() { return $this->readLayout(); }
function setLayout($value) { $this->writeLayout($value); }
* Sets or retrieves the amount of additional space between the frames.
function setFrameSpacing($value) { $this->_framespacing= $value; }
function defaultFrameSpacing() { return 0; }
* String that specifies or receives one of the following values.
* fbDefault Inset border is drawn.
* fbNo No border is drawn.
* fbYes Inset border is drawn.
function setFrameBorder($value) { $this->_frameborder= $value; }
function defaultFrameBorder() { return fbNo; }
* Sets or retrieves the width of the left, right, top, and bottom borders of the object.
function setBorderWidth($value) { $this->_borderwidth= $value; }
function defaultBorderWidth() { return 0; }
protected $_encoding= 'Western European (ISO) |iso-8859-1';
* Specifies the encoding to use for the page
function getEncoding() { return $this->_encoding; }
function setEncoding($value) { $this->_encoding= $value; }
function defaultEncoding() { return "Western European (ISO) |iso-8859-1"; }
* Specifies the doctype to generate, components are responsible to adapt to this property
* and generate valid code
function getDocType() { return $this->_doctype; }
function setDocType($value) { $this->_doctype= $value; }
function defaultDocType() { return dtNone; }
* Specifies the encoding to use for forms
function writeFormEncoding($value) { $this->_formencoding= $value; }
function defaultFormEncoding() { return ""; }
function getAlignment() { return $this->readAlignment(); }
function setAlignment($value) { $this->writeAlignment($value); }
function getColor() { return $this->readColor(); }
function setColor($value) { $this->writeColor($value); }
function getShowHint() { return $this->readShowHint(); }
function setShowHint($value) { $this->writeShowHint($value); }
function getVisible() { return $this->readVisible(); }
function setVisible($value) { $this->writeVisible($value); }
function getCaption() { return $this->readCaption(); }
function setCaption($value) { $this->writeCaption($value); }
function getFont() { return $this->readFont(); }
function setFont($value) { $this->writeFont($value); }
* Specifies the background for the form
function getBackground() { return $this->_background; }
function setBackground($value) { $this->_background= $value; }
* Specifies the engine to be used to render this page using templates
function defaultTemplateEngine() { return ""; }
function getAction() { return $this->_action; }
function setAction($value) { $this->_action= $value; }
function defaultAction() { return ""; }
* Specifies the name of the template to be used to render this page
function defaultTemplateFilename() { return ""; }
* If true, ajax requests will be processed and handled
function getUseAjax() { return $this->_useajax; }
function setUseAjax($value) { $this->_useajax= $value; }
function defaultUseAjax() { return 0; }
* Specifies the language to be used when rendering this page
function getLanguage() { return $this->_language; }
function setLanguage($value)
if ($value== '(default)') $l= "";
$resourcename= str_replace('.php',$l. '.xml.php',$resourcename);
//This is to allow gettext usage
if ($value== '(default)') $l= '';
bindtextdomain($domain, "./locale");
function defaultLanguage() { return "(default)"; }
//Once the component has been loaded, calls the oncreate event, if assigned
* Fired when the page is going to be submitted to the form
function getjsOnSubmit() { return $this->_jsonsubmit; }
function setjsOnSubmit($value) { $this->_jsonsubmit= $value; }
function defaultjsOnSubmit() { return null; }
* Fired when the page is going to be reset
function getjsOnReset() { return $this->_jsonreset; }
function setjsOnReset($value) { $this->_jsonreset= $value; }
function defaultjsOnReset() { return null; }
* Dumps the opening form tag
if (isset ($_SERVER['PHP_SELF'])) $action= $_SERVER['PHP_SELF'];
$formevents.= " onsubmit=\"return $this->_jsonsubmit();\" ";
$formevents.= " onreset=\"return $this->_jsonreset();\" ";
$result= '<form style="margin-bottom: 0" id="'. $this->name. '" name="'. $this->name. '" method="post" '. $formevents. ' action="'. $action. '"'. $enctype. '>';
* Dumps the ending form tag
* Dump the page using a template, it doesn't generate an HTML page, it uses
* the template and tries to insert components inside it
//Check here for templateengine and templatefilename
$template= new $tclassname($this);
$this->callEvent("ontemplate",array("template"=> $template));
$template->assignComponents();
$template->dumpTemplate();
* Fired when the template is about to be rendered
function getOnTemplate() { return $this->_ontemplate; }
function setOnTemplate($value) { $this->_ontemplate= $value; }
function defaultOnTemplate() { return ""; }
$sp= "<script type=\"text/javascript\">\n";
//TODO: Isolate all elements of a page into properties
//Calls beforeshowheader event, if any
// Instantiate the xajax object. No parameters defaults requestURI to this page, method to POST, and debug to off
// $xajax->debugOn(); // Uncomment this line to turn debugging on
// Specify the PHP functions to wrap. The JavaScript wrappers will be named xajax_functionname
$xajax->registerFunction("ajaxProcess");
// Process any requests. Because our requestURI is the same as our html page,
// this must be called before any headers or HTML output have been sent
$xajax->processRequests();
case dtNone: $dtd= ""; $extra= ""; break;
case dtXHTML_1_0_Strict: $dtd= '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">'; $extra= 'xmlns="http://www.w3.org/1999/xhtml"'; break;
case dtXHTML_1_0_Transitional: $dtd= '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'; $extra= 'xmlns="http://www.w3.org/1999/xhtml"'; break;
case dtXHTML_1_0_Frameset: $dtd= '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">'; $extra= 'xmlns="http://www.w3.org/1999/xhtml"'; break;
case dtHTML_4_01_Strict: $dtd= '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">'; break;
case dtHTML_4_01_Transitional: $dtd= '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">'; break;
case dtHTML_4_01_Frameset: $dtd= '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">'; break;
case dtXHTML_1_1: $dtd= '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">'; $extra= 'xmlns="http://www.w3.org/1999/xhtml"'; break;
//Iterates through controls to get the frames
if (($v->inheritsFrom('Frame')) || ($v->inheritsFrom('Frameset')))
//Calls beforeshowheader event, if any
$this->callEvent('onbeforeshowheader',array());
echo "<!-- $this->name begin -->\n";
//If must dump the header
echo "<script type=\"text/javascript\" src=\"". VCL_HTTP_PATH. "/js/common.js\"></script>\n";
$xajax->printJavascript("",VCL_HTTP_PATH. "/xajax/xajax_js/xajax.js");
echo "<title>$title</title>\n";
echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=$cs[1]\" ";
if (($this->DocType!= 'dtHTML_4_01_Strict') && ($this->DocType!= 'dtHTML_4_01_Transitional'))
if ($st!= "") $st= " style=\"$st\" ";
if ($this->color!= "") $attr.= " bgcolor=\"$this->color\" ";
if ($this->Background!= "") $attr.= " background=\"$this->Background\" ";
// add the defined JS events to the body
echo "<body $st $attr>\n";
echo "<script type=\"text/JavaScript\">\n";
if (!$this->hasframes) echo $this->readStartForm();
if (!$this->hasframes) echo $this->readEndForm();
$this->callEvent('onaftershowfooter',array());
//If must dump the footer
echo "<noframes><body>\n";
echo $this->readStartForm();
echo $this->readEndForm();
echo "</body></noframes>\n";
echo "<!-- $this->name end -->\n";
* Dump al children controls
// fixup to allow initialization of visual stuff in case
// if non-visual Q lib classes are used
. "<script type=\"text/javascript\">\n"
. " var d = qx.ui.core.ClientDocument.getInstance();\n"
. " d.setOverflow(\"scrollY\");\n"
. " d.setBackgroundColor(null);\n"
case agNone: $alignment= ""; break;
case agLeft: $alignment= " align=\"Left\" "; break;
case agCenter: $alignment= " align=\"Center\" "; break;
case agRight: $alignment= " align=\"Right\" "; break;
if ($this->Color!= "") $color= " bgcolor=\"$this->Color\" ";
if ($this->Background!= "") $background= " background=\"$this->Background\" ";
if ($this->Width!= "") $width= " width=\"$this->Width\" ";
if ($this->Height!= "") $height= " style=\"height:". $this->Height. "px\" ";
$width= " width=\"100%\" ";
echo "\n<table $width $height border=\"0\" cellpadding=\"0\" cellspacing=\"0\" $color $alignment><tr><td valign=\"top\">\n";
$this->Layout->dumpLayoutContents(array('Frame', 'Frameset'));
echo "</td></tr></table>\n";
if (($v->Visible) && ($v->IsLayer))
* Dump the page using frames
$frameset->FrameSpacing= $this->FrameSpacing;
$frameset->FrameBorder= $this->FrameBorder;
$frameset->BorderWidth= $this->BorderWidth;
* Specifies the top margin spacing
function getTopMargin() { return $this->_topmargin; }
function setTopMargin($value) { $this->_topmargin= $value; }
function defaultTopMargin() { return 0; }
* Specifies the left margin spacing
function getLeftMargin() { return $this->_leftmargin; }
function setLeftMargin($value) { $this->_leftmargin= $value; }
function defaultLeftMargin() { return 0; }
* Specifies the bottom margin spacing
function setBottomMargin($value) { $this->_bottommargin= $value; }
function defaultBottomMargin() { return 0; }
* Specifies the right margin spacing
function setRightMargin($value) { $this->_rightmargin= $value; }
function defaultRightMargin() { return 0; }
* If false, the form doesn't dump any header code
function getShowHeader() { return $this->_showheader; }
function setShowHeader($value) { $this->_showheader= $value; }
function defaultShowHeader() { return 1; }
* If false, the form doesn't generate any <form> tag, but events won't be processed
function getIsForm() { return $this->_isform; }
function setIsForm($value) { $this->_isform= $value; }
function defaultIsForm() { return 1; }
* If true, this page doesn't render itself, but it's meant to be used as base for another forms
function getIsMaster() { return $this->_ismaster; }
function setIsMaster($value) { $this->_ismaster= $value; }
* If false, the form doesn't dump any footer code
function getShowFooter() { return $this->_showfooter; }
function setShowFooter($value) { $this->_showfooter= $value; }
function defaultShowFooter() { return 1; }
* Fired before show the header
function defaultOnBeforeShowHeader() { return ""; }
* Fired after show the footer
function defaultOnAfterShowFooter() { return ""; }
* Fired when showing the header
function setOnShowHeader($value) { $this->_onshowheader= $value; }
function defaultOnShowHeader() { return ""; }
* Fired when showing the body
function setOnStartBody($value) { $this->_onstartbody= $value; }
function defaultOnStartBody() { return ""; }
* Fired when the page is created and all components have been loaded
function getOnCreate() { return $this->_oncreate; }
function setOnCreate($value) { $this->_oncreate= $value; }
function defaultOnCreate() { return ""; }
* A component to generate an html hidden field, useful to send information
* to another script, set the value for it on the Value property.
* The component is only visible at design time.
//Calls inherited constructor
//If there is something posted
$submitted = $this->input->{$this->Name};
$this->_value = $submitted->asString();
$submitted = $this->input->{$this->Name};
// Allow the OnSubmit event to be fired because it is not
// a mouse or keyboard event.
echo "<input type=\"hidden\" id=\"$this->Name\" name=\"$this->Name\" value=\"$this->Value\" />";
echo "<table width=\"$this->width\" cellpadding=\"0\" cellspacing=\"0\" height=\"$this->height\"><tr><td style=\"background-color: #FFFF99; border: 1px solid #666666; font-size:10px; font-family:verdana,tahoma,arial\" align=\"center\">$this->Name=$this->Value</td></tr></table>";
* Publish the events for the component
* Occurs when the form containing the control was submitted.
* @return mixed Returns the event handler or null if no handler is set.
function getOnSubmit() { return $this->_onsubmit; }
* Occurs when the form containing the control was submitted.
* @param mixed Event handler or null if no handler is set.
function setOnSubmit($value) { $this->_onsubmit= $value; }
function defaultOnSubmit() { return null; }
* Publish the JS events for the component
function getjsOnChange () { return $this->readjsOnChange(); }
function setjsOnChange ($value) { $this->writejsOnChange($value); }
* Publish the properties for the component
* Specified the value for the HTML hidden field, and you will be able to
* read this value on the script that receives the information.
function getValue() { return $this->_value; }
* Specified the value for the HTML hidden field, and you will be able to
* read this value on the script that receives the information.
function setValue($value) { $this->_value= $value; }
function defaultValue() { return ""; }
define('fbDefault','fbDefault');
* A class to encapsulate a frame set and generate frames
* This class is also used in the Page component to generate a frameset.
* For further information about HTML framesets and frames please visit following link:
* @link http://www.w3.org/TR/html401/present/frames.html
//Calls inherited constructor
parent::__construct($aowner);
$this->ControlStyle= "csAcceptsControls=1";
* The javascript OnLoad event is called after all nested framesets and
* frames are finished with loading their content.
function getjsOnLoad() { return $this->_jsonload; }
* The javascript OnLoad event is called after all nested framesets and
* frames are finished with loading their content.
function setjsOnLoad($value) { $this->_jsonload= $value; }
function defaultjsOnLoad() { return null; }
* The javascript OnUnload event is called after all nested framesets and
* frames are finished with unloading their content.
function getjsOnUnload() { return $this->_jsonunload; }
* The javascript OnUnload event is called after all nested framesets and
* frames are finished with unloading their content.
function setjsOnUnload($value) { $this->_jsonunload= $value; }
function defaultjsOnUnload() { return null; }
function getAlign() { return $this->_align; }
function setAlign($value) { $this->_align= $value; }
function defaultAlign() { return alClient; }
* Sets or retrieves the amount of additional space between the frames.
* Sets or retrieves the amount of additional space between the frames.
function setFrameSpacing($value) { $this->_framespacing= $value; }
function defaultFrameSpacing() { return 0; }
* String that specifies or receives one of the following values.
* fbDefault Inset border is drawn.
* fbNo No border is drawn.
* fbYes Inset border is drawn.
* String that specifies or receives one of the following values.
* fbDefault Inset border is drawn.
* fbNo No border is drawn.
* fbYes Inset border is drawn.
function setFrameBorder($value) { $this->_frameborder= $value; }
function defaultFrameBorder() { return fbNo; }
* Width of the left, right, top, and bottom borders of the object.
* Width of the left, right, top, and bottom borders of the object.
function setBorderWidth($value) { $this->_borderwidth= $value; }
function defaultBorderWidth() { return 0; }
* Returns the defined JS events for the frameset.
* @return string If empty no JS events are set.
function readFramesetJSEvents()
if ($this->_jsonload!= null) { $event= $this->_jsonload; $result.= " onload=\"return $event(event)\" "; }
parent::dumpJavascript();
* Dump the frames inside the frameset that are aligned to alClient
if (($v->inheritsFrom('Frame')) || ($v->inheritsFrom('Frameset')))
* Dump the frames inside the frameset that are aligned to alLeft or alRight
while(list ($key, $val)= each($hframes))
if ($val->Align== alLeft) $leftwidths.= $val->Width. ",";
if ($val->Align== alRight) $rightwidths.= ",". $val->Width;
// only output events when they have an affect
// (only the most outer frameset will receive the onload event)
$events = ($outputevents) ? $this->readFramesetJSEvents() : "";
$frameborder = ""; // fbDefault
switch ($this->FrameBorder)
case fbNo: $frameborder = "no"; break;
case fbYes: $frameborder = "yes"; break;
echo "<frameset cols=\"$leftwidths*$rightwidths\" rows=\"*\" frameborder=\"$frameborder\" border=\"$this->BorderWidth\" framespacing=\"$this->FrameSpacing\" $events>\n";
while(list ($key, $val)= each($hframes))
if ($val->Align== alLeft) $val->show();
//Dump here the alClient frames
while(list ($key, $val)= each($hframes))
if ($val->Align== alRight) $val->show();
* Dump the whole frameset, with the alignment algorithm
$msg= "$this->Name<br>place Frames inside this Frameset";
$bstyle= " style=\"border: 1px dotted #000000;font-size:10px; font-family:verdana,tahoma,arial\" ";
echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"$this->width\" height=\"$this->height\"><tr><td $bstyle align=\"center\">$msg</td></tr></table>";
if (($v->inheritsFrom('Frame')) || ($v->inheritsFrom('Frameset')))
ksort($vframes,SORT_NUMERIC);
ksort($hframes,SORT_NUMERIC);
while(list ($key, $val)= each($vframes))
if ($val->Align== alTop) $topheights.= $val->Height. ",";
if ($val->Align== alBottom) $bottomheights.= ",". $val->Height;
$events = $this->readFramesetJSEvents();
echo "<frameset rows=\"$topheights*$bottomheights\" cols=\"*\" frameborder=\"$this->FrameBorder\" border=\"$this->BorderWidth\" framespacing=\"$this->FrameSpacing\" $events>\n";
while(list ($key, $val)= each($vframes))
if ($val->Align== alTop) $val->show();
//Dump here the horizontal frameset
//**********************************
//**********************************
while(list ($key, $val)= each($vframes))
if ($val->Align== alBottom) $val->show();
* A frame is a sub-component of a Frameset. It should only be used within a
* For further information about HTML frames please visit following link:
* @link http://www.w3.org/TR/html401/present/frames.html
//Calls inherited constructor
parent::__construct($aowner);
$this->ControlStyle= "csAcceptsControls=1";
* Defines the URL of the file to show in the frame.
function getSource() { return $this->_source; }
* Defines the URL of the file to show in the frame.
function setSource($value) { $this->_source= $value; }
function defaultSource() { return ""; }
* Specifies whether or not to display border around the frame. This
* value should be 0 or 1.
function getBorders() { return $this->_borders; }
* Specifies whether or not to display border around the frame. This
* value should be 0 or 1.
function setBorders($value) { $this->_borders= $value; }
function defaultBorders() { return 1; }
function getAlign() { return $this->_align; }
function setAlign($value) { $this->_align= $value; }
function defaultAlign() { return alLeft; }
* Defines the left and right margins in the frame.
* Defines the left and right margins in the frame.
function setMarginWidth($value) { $this->_marginwidth= $value; }
function defaultMarginWidth() { return 0; }
* Defines the top and bottom margins in the frame.
* Defines the top and bottom margins in the frame.
function setMarginHeight($value) { $this->_marginheight= $value; }
function defaultMarginHeight() { return 0; }
* When set to false the user cannot resize the frame.
function getResizeable() { return $this->_resizeable; }
* When set to false the user cannot resize the frame.
function setResizeable($value) { $this->_resizeable= $value; }
function defaultResizeable() { return 1; }
* Determines scrollbar action.
* @retun enum (fsAuot, fsYes, fsNo)
function getScrolling() { return $this->_scrolling; }
* Determines scrollbar action.
* @param enum (fsAuot, fsYes, fsNo)
function setScrolling($value) { $this->_scrolling= $value; }
function defaultScrolling() { return fsAuto; }
* The javascript OnLoad event is called after all nested framesets and
* frames are finished with loading their content.
function getjsOnLoad() { return $this->_jsonload; }
* The javascript OnLoad event is called after all nested framesets and
* frames are finished with loading their content.
function setjsOnLoad($value) { $this->_jsonload= $value; }
function defaultjsOnLoad() { return null; }
* Returns the defined JS events for the frame.
* @return string If empty no JS events are set.
function readFrameJSEvents()
if ($this->_jsonload!= null) { $event= $this->_jsonload; $result.= " onload=\"return $event(event)\" "; }
parent::dumpJavascript();
if (trim($this->Source)== '')
$msg= "Fill Source property with the URL you want to show on this Frame";
$bstyle= " style=\"border: 1px dotted #000000;font-size:10px; font-family:verdana,tahoma,arial\" ";
echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"$this->width\" height=\"$this->height\"><tr><td $bstyle align=\"center\">$msg</td></tr></table>";
if ($this->Resizeable!= 1)
echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Frameset//EN\" \"http://www.w3.org/TR/html4/frameset.dtd\">\n";
echo "<FRAMESET cols=\"$this->Width\">\n";
$scrolling = "auto"; //fsAuto
switch ($this->Scrolling)
case fsYes: $scrolling = "yes"; break;
case fsNo: $scrolling = "no"; break;
$events = $this->readFrameJSEvents();
echo "<frame src=\"". $this->Source. "\" name=\"". $this->name. "\" scrolling=\"$scrolling\" $resizeable marginwidth=\"$this->MarginWidth\" marginheight=\"$this->MarginHeight\" frameborder=\"$this->Borders\" $events>\n";
|