<?xml version="1.0"?><phpdoc><class name="Bs_Form" extends="Bs_Object" undoc="false" access="public" package="Form"><file>C:/usr/local/lib/php/blueshoes-4.2/core/html/form/Bs_Form.class.php</file><doc><author email="andrej@arn.li">andrej arn</author><inherited src="Array"/><overriden src="Array"/><description>implementation of an html form. holds (uses) instances of FormElement.this flowchart shows how records can be added/editedusing this form class. the delete mode works slightlydifferent (there is no validation).+---------------------------+|                           ||      +----------------+   |   +--------------+|      |                |   |   |              ||      |        +----------------------+       ||      |        |        FORM          |       ||      |        |                      |       ||      |        |  &amp;lt;preview&amp;gt;   &amp;lt;save&amp;gt;  |       ||    error      +----------------------+     error|   occured          |            |         occured|      |             |            |            ||      +---- &amp;lt; validate &amp;gt;      &amp;lt; validate &amp;gt; ---+|                    |            ||                    |            ||       +--------------------+    ||       |      PREVIEW       |    ||       |                    |    ||       |  &amp;lt;edit&amp;gt;    &amp;lt;save&amp;gt;  |    ||       +--------------------+    ||           |           |         |+-----------+           |         ||         |+--------------------+|        DONE        ||                    ||      thank you     |+--------------------+the hash &amp;apos;bs_form&amp;apos; including the following hidden vars is submitted alongwith the form all the time:NAME             VALUE                      DESCRIPTIONname             the name of this form      (see var $internalName)mode             add|edit|delete|view       (see var $mode)step             2                          (see var $step)recordId         5541                       (see var $recordId)viewCount        int                        (see var $viewCount)startTimestamp   unix timestamp             (see var $startTimestamp)language         de|en|fr...                (see var $language)state            form|preview|done          (see var $state)user             &amp;apos;&amp;apos;|guest|member|root|...   (see var $user)avoid cheating and the use of templates:with most forms you can cheat in that you save the form on your harddisk,change hidden and default values, and submit it from your disk.you could check the http_referer to see if the request comes from yourserver, but this is a bad idea. you&amp;apos;d block out users with old/strangeclients that don&amp;apos;t send the http_referer, ppl using anomyzers/firewalls,and then a cheater could send a modified http_referer anyway.now with form templates thing is that not all form fields may be used.how does the validater know which fields have been in the form, andthus which fields he has to validate? we could loop $HTTP_POST_VARSbecause every submitted field has a key in this array. but again,we get the *submitted* fields, and not those which someone has removedwith the save-to-disc cheat.so the only secure way is to send a cryptified list of fields as ahidden input. we&amp;apos;d need to crypt hidden values also, but let&amp;apos;s notget paranoid at the moment.also the use of the preview mode might be a risk. when submitting thepreview page, the inputs are not checked again. good place to cheat...features:o) multilevel forms (yah! :)o) templates (for the form AND for containers)o) multilingualo) very strong on input validationo) can deal with hitting enter in text fieldso) offers some nice domapi form element implementationso) and some more ready-to-use out-of-the-box special fields.o) can deal with include-once and onLoad javascript stufffeatures to add: (wishlist)o) cache the form (html output) for each language. then spit this outinstead of generating the form on every (first) request. the cacheneeds to be updated if someone makes changes to form/elements. thiswill make the forms load alot faster on the first request, take someload from the cpu, and prolly give a headache to someone findinga bug cause there was a cached not-up-to-date form. especially ifthe form depends on realtime data. but for simple forms this mightbe neat.o) prolly lots of documentation.o) encryption of hidden inputs so they are not seen in plaintext.o) some sort of hash to make sure the unchangeable (hidden) valueshave not been tricked by the user. (saved the form to his harddisk,...). checking the http_referer doesn&amp;apos;t do it, of course.o) if possible, detect if the user changed something at all (in editmode). this could be useful to not update the data on the server.an update often starts a chain of human work. and if nothing changedanyway this only confuses ppl. hrm. mysql only updates the fieldsthat you set to a different value anyway. but does it also not toucha timestamp if nothing changed? this would help... but doesn&amp;apos;t helpif you&amp;apos;re going to update a datetime field yourself.todo:o) problem with valueDefault in multi-level forms. after level 1 itis not used anymore. step is 2 then, crap. recode a bit. 2002/05/06 --andrejo) on the server side, only validate the real inputs, not the hiddenfields, this is a waste of time.o) write a nice tutorial. document all the features. ppl don&amp;apos;t wantto read the phpdoc :( especially step-by-step examples are needed.note: after  the &amp;lt;form&amp;gt;  tag there is the tag &amp;lt;bs_after_formopen_tag/&amp;gt;before the &amp;lt;/form&amp;gt; tag there is the tag &amp;lt;bs_before_formclose_tag/&amp;gt;feel free to replace them with anything you want. eg add in somehidden fields, some html text, whatever.dependencies: Bs_FormContainer, Bs_ObjPersisterForMySql, Bs_FormTemplateParser,Bs_Db (for the saveToDb option), Bs_Array, Bs_HtmlUtil, $APP,Bs_Url, Bs_TextUtil, Bs_LanguageHandler</description><shortdescription>Form Class</shortdescription><version>4.0.$id$</version><copyright>blueshoes.org</copyright></doc><function name="Bs_Form" undoc="false" access="public"><doc><return type="void"/><description/><shortdescription>Constructor.</shortdescription></doc></function><function name="&amp;getForm" undoc="false" access="public"><doc><see type="function">getIncludeOnce()</see><see type="function">getOnLoadCode()</see><parameter name="$withErrorTable" default="FALSE" type="string">(if the error table should automatically come with it if errors occured. default is FALSE.)</parameter><return name="" type="string"> (html code)</return><description>with all its form fields.</description><shortdescription>Returns html code to send to the browser which will display the web form</shortdescription></doc></function><function name="getFormTag" undoc="false" access="public"><doc><return name="" type="string">some html code.</return><description/><shortdescription>returns the form tag.</shortdescription></doc></function><function name="getFormHead" undoc="false" access="public"><doc><return name="" type="string">some html code.</return><description>and hidden/internal fields.</description><shortdescription>returns the &amp;apos;form head&amp;apos; which includes the &amp;lt;form&amp;gt; tag, [javascripts]</shortdescription></doc></function><function name="getFormFoot" undoc="false" access="public"><doc><return name="" type="string">some html code.</return><description/><shortdescription>returns the &amp;apos;form foot&amp;apos; which includes the &amp;lt;/form&amp;gt; tag and the used fields (hidden).</shortdescription></doc></function><function name="getUsedFields" undoc="false" access="public"><doc><return type="void"/><description>it has 2 hidden fields, one for the fields used, one md5 to avoid cheating.you have to call this method after doing the $this-&amp;gt;elementContainer-&amp;gt;getElement()because otherwise the fields don&amp;apos;t know yet if they will be used or not.does not move the pointer of $this-&amp;gt;clearingHouse.</description><shortdescription>returns an html string that will be sent to the client inside the form.</shortdescription></doc></function><function name="_getButtonString" undoc="false" access="private"><doc><see type="var">$buttons</see><return name="" type="string"/><description>the return value depends on the mode we&amp;apos;re in.</description><shortdescription>returns a html string with the buttons to use.</shortdescription></doc></function><function name="isMultiLevel" undoc="false" access="public"><doc><see type="var">$this</see><return name="" type="bool"/><description/><shortdescription>tells if this form is a multilevel form.</shortdescription></doc></function><function name="getNumbersOfLevels" undoc="false" access="public"><doc><see type="var">$level</see><return name="" type="int"/><description>if it&amp;apos;s not a multilevel form then 1 is returned.a simple form can be seen as a 1-level form.</description><shortdescription>returns the number of levels used in that form.</shortdescription></doc></function><function name="isFirstLevel" undoc="false" access="public"><doc><see type="var">$level</see><return name="" type="bool"/><description>note: also returns TRUE if it&amp;apos;s not a multilevel form causethen it&amp;apos;s the first level aswell.</description><shortdescription>tells if we&amp;apos;re in the first level of a multilevel form.</shortdescription></doc></function><function name="isLastLevel" undoc="false" access="public"><doc><see type="var">$level</see><return name="" type="bool"/><description>note: also returns TRUE if it&amp;apos;s not a multilevel form causethen it&amp;apos;s the last level aswell.</description><shortdescription>tells if we&amp;apos;re in the last level of a multilevel form.</shortdescription></doc></function><function name="isMultipart" undoc="false" access="public"><doc><see type="var">$this</see><return name="" type="bool">true if it&amp;apos;s a multipart form, false if not.</return><description>a multipart form is one with at least one &amp;lt;input type=file&amp;gt; field.the form turns into a multipart form when one of these conditions is true:1) the user set $this-&amp;gt;encType to &amp;apos;multipart/form-data&amp;apos;2) the form has at least one file field which is in use.</description><shortdescription>Tells whether this form is (or has to be treated as) a multipart form.</shortdescription></doc></function><function name="getMode" undoc="false" access="public"><doc><see type="var">$this</see><return name="" type="string">one of &amp;apos;add&amp;apos;, &amp;apos;edit&amp;apos;, &amp;apos;delete&amp;apos;, &amp;apos;view&amp;apos;. the mode that is set, or &amp;apos;&amp;apos; if nothing is set.</return><description/><shortdescription>returns the form mode we&amp;apos;re in.</shortdescription></doc></function><function name="hasJavascript" undoc="false" access="public"><doc><see type="var">$hasJavascript</see><return name="" type="bool">TRUE if the client has javascript, FALSE if not.&#x0a;@throw NULL if we don&amp;apos;t know</return><description/><shortdescription>tells whether the client browser has javascript support or not.</shortdescription></doc></function><function name="getElement" undoc="false" access="public"><doc><parameter name="$elementName" type="string">(the name of the form field or element)</parameter><parameter name="$what" default="&amp;apos;element&amp;apos;" type="string">one of &amp;apos;element&amp;apos; (default), &amp;apos;caption&amp;apos;, &amp;apos;text&amp;apos;, &amp;apos;error&amp;apos;, &amp;apos;help&amp;apos;.</parameter><parameter name="$optionList" default="null" type="string">(used to return just some of the radio options.)</parameter><return name="" type="string"> (text or html)</return><throws>empty string &amp;apos;&amp;apos; if no such element.</throws><description>caution: moves the pointer of $this-&amp;gt;clearingHouse.</description><shortdescription>returns the element of one of the elements of this form.</shortdescription></doc></function><function name="validate" undoc="false" access="public"><doc><see type="var">$this</see><return name="" type="bool"/><description>changes $this-&amp;gt;state, $this-&amp;gt;step and $this-&amp;gt;level if needed.sets $this-&amp;gt;usedTime if needed.caution: moves the pointer of $this-&amp;gt;clearingHouse.</description><shortdescription>validates the inputs of all fields that were sent. fills $this-&amp;gt;errors if needed.</shortdescription></doc></function><function name="getErrorTable" undoc="false" access="public"><doc><parameter name="$title" default="NULL," type="string">a string (may include html) that is set above of the html table.&#x0a;$param  string $style default is &amp;apos;default&amp;apos;, nothing available yet.</parameter><parameter name="$style" type="string" undoc="true"/><return name="" type="string">an html string.</return><throws>string an empty string if no errors occured.</throws><description>to display on the website.</description><shortdescription>returns a basic html string (html table) filled with the error messages</shortdescription></doc></function><function name="addError" undoc="false" access="public"><doc><see type="var">$this</see><parameter name="$errorMsg" type="string"/><parameter name="$fieldName" default="NULL," type="string"/><parameter name="$fieldCaption" default="NULL" type="string"/><return type="void"/><description>if $fieldName is NULL it is considered a vector element. see $this-&amp;gt;errors.</description><shortdescription>adds an error to this form.</shortdescription></doc></function><function name="isFieldFilledIn" undoc="false" access="public"><doc><parameter name="$fieldName" type="string"/><return name="" type="bool"/><throws>NULL if no such field</throws><throws>not a field</throws><throws>or not capable to tell.</throws><description>input was ok/accepted.does not move the pointer of $this-&amp;gt;clearingHouse.</description><shortdescription>tells if the user filled in the given field *somehow*. does not tell if the</shortdescription></doc></function><function name="getFieldValue" undoc="false" access="public"><doc><parameter name="$fieldName" type="string"/><parameter name="$valueType" default="&amp;apos;internal&amp;apos;" type="string">one of &amp;apos;internal&amp;apos; (default), &amp;apos;default&amp;apos;, &amp;apos;received&amp;apos;, &amp;apos;display&amp;apos;.</parameter><return name="" type="array">a vector with exactly one element (key = 0) that holds the field value. this way of returning is needed to make a difference to &amp;apos;dunno&amp;apos;.</return><throws>NULL if no such field</throws><throws>not a field</throws><throws>or not capable to tell.</throws><description>does not move the pointer of $this-&amp;gt;clearingHouse.</description><shortdescription>returns the field value you want.</shortdescription></doc></function><function name="setValuesToDefault" undoc="false" access="public"><doc><return type="void"/><description>caution: moves the pointer of $this-&amp;gt;clearingHouse.</description><shortdescription>sets the fields valueInternal and valueDisplay to the same value as valueDefault is.</shortdescription></doc></function><function name="setReceivedValues" undoc="false" access="public"><doc><parameter name="&amp;$array" type="array"/><return name="" type="bool">TRUE </return><throws>bs_exception</throws><description>also calls setBsFormData() if needed.!!! does not modify $step any more. 2002/05/07 --andrejcaution: moves the pointer of $this-&amp;gt;clearingHouse.</description><shortdescription>Sets the received values to the form fields of this form.</shortdescription></doc></function><function name="setLoadedValues" undoc="false" access="public"><doc><parameter name="&amp;$array" type="array">(hash where key=fieldname and value=value.)</parameter><return type="void"/><description>also sets $step to 1. call setBsFormData() yourself if you need it.caution: moves the pointer of $this-&amp;gt;clearingHouse.</description><shortdescription>Sets the loaded values to the form fields of this form.</shortdescription></doc></function><function name="postLoadTrigger" undoc="false" access="public"><doc><return type="void"/><description>caution: moves the pointer of $this-&amp;gt;clearingHouse.</description><shortdescription>calls the post load triggers of the fields of this form.</shortdescription></doc></function><function name="setBsFormData" undoc="false" access="private"><doc><parameter name="&amp;$hash" type="array">(see class description for details)</parameter><return name="" type="bool">TRUE on success, FALSE if there&amp;apos;s a problem with the md5 stuff. (cheater)</return><description>so if you want to use different values, have this method be called first,then change what you want.</description><shortdescription>sets the appropriate bs_form vars.</shortdescription></doc></function><function name="seedClearingHouse" undoc="false" access="public"><doc><see type="var">$clearingHouse</see><parameter name="$onlyIfNotSet" default="TRUE" type="string">default is TRUE. if set to true it will only be done if $clearingHouse is not set yet.</parameter><return type="void"/><description/><shortdescription>seeds the var $clearingHouse.</shortdescription></doc></function><function name="addIncludeOnce" undoc="false" access="public"><doc><see type="var">$_includeOnce</see><see type="function">getIncludeOnce()</see><parameter name="$scriptUrl" undoc="true"/><return name="" type="bool"> (TRUE if the script was added, FALSE if it was already there.)</return><description>it&amp;apos;s a good practise to write them the same way all the time (relative/absolute)to avoid problems.</description><shortdescription>adds a javascript source file to the include-once todo list.</shortdescription></doc></function><function name="getIncludeOnce" undoc="false" access="public"><doc><see type="var">$_includeOnce</see><see type="function">addIncludeOnce()</see><parameter name="$how" default="&amp;apos;array&amp;apos;" type="string">(see above)</parameter><return name="" type="mixed"> (array or string, see param $how)</return><description>param $how: can be &amp;apos;array&amp;apos; (default) or &amp;apos;string&amp;apos;.for &amp;apos;array&amp;apos; you get a vector with all script url&amp;apos;s (empty array if none).for &amp;apos;string&amp;apos; you get an html string with the script tags to echoto your browser (empty string if none).</description><shortdescription>returns the include-once script files.</shortdescription></doc></function><function name="addOnLoadCode" undoc="false" access="public"><doc><see type="var">$_onLoad</see><see type="function">getOnLoadCode()</see><parameter name="$code" type="string">(javascript code)</parameter><return name="" type="bool">TRUE .</return><description/><shortdescription>javascript code that needs to be executed in the onLoad event of the page.</shortdescription></doc></function><function name="getOnLoadCode" undoc="false" access="public"><doc><see type="var">$_onLoad</see><see type="function">addOnLoadCode()</see><parameter name="$withCodeTags" default="TRUE" type="string">(default is TRUE, see above.)</parameter><return name="" type="string"/><description>of the page.if param $withCodeTags is TRUE then you&amp;apos;ll get script tags wrapped around,everything is prepared to paste it into the html-document. example:&amp;lt;script type=&amp;apos;text/javascript&amp;apos;&amp;gt;&amp;lt;!--onload=function() {//javascript code is here}// --&amp;gt;&amp;lt;/script&amp;gt;</description><shortdescription>returns the javascript code that needs to be executed in the onLoad event</shortdescription></doc></function><function name="addIntoHead" undoc="false" access="private"><doc><see type="var">$_inHead</see><parameter name="$code" undoc="true"/><return type="void"/><description>document head.</description><shortdescription>adds some code into the _inHead array that can later be included in the</shortdescription></doc></function><function name="getInHeadCode" undoc="false" access="public"><doc><see type="var">$_inHead</see><return name="" type="string"/><description/><shortdescription>returns the code that should be added in the document head.</shortdescription></doc></function><function name="setPersisterID" undoc="false" access="public"><doc><see type="var">$persisterID</see><parameter name="$persisterID" type="int"/><return type="void"/><description>special method for the persister. rtfm.</description><shortdescription>set the form id for all elements.</shortdescription></doc></function><function name="persist" undoc="true" access="private"><doc><see type="function">unpersist()</see><parameter name="$withElements" default="TRUE" type="string">default is TRUE</parameter><return name="" type="bool">true on success&#x0a;@throw bs_exception on error (db exception)</return><overriden src="Bs_Object"/><description/><shortdescription>persist the form settings (with the attached form elements by default).</shortdescription></doc></function><function name="unPersist" undoc="true" access="private"><doc><see type="function">persist()</see><parameter name="$internalName" default="NULL," type="string">the internally used form name. if not set, $this-&amp;gt;persisterID is used. so set it before!</parameter><parameter name="$withElements" default="TRUE" type="string">default is TRUE</parameter><return name="" type="bool">true on success, false on failure&#x0a;@throw bs_exception on error (db exception)</return><overriden src="Bs_Object"/><description/><shortdescription>unpersist (load) the form settings (with the attached form elements by default).</shortdescription></doc></function><function name="saveToDb" undoc="false" access="public"><doc><see type="var">$saveToDb</see><see type="var">$dbTableName</see><return name="" type="mixed"> (bool FALSE if nothing had to be saved, bool TRUE on a successful update, int &amp;gt;=1 on a successful insert (=the new record id))&#x0a;@throw bs_exception if something should have been saved but failed somewhere.</return><description>if the db table doesn&amp;apos;t exist yet, it will be created automatically.if it exists and problems occure while inserting, the table structurewill be updated.on an insert, $this-&amp;gt;recordId will be set.</description><shortdescription>saves the received form inputs according to the settings.</shortdescription></doc></function><function name="getDbTableName" undoc="false" access="private"><doc><see type="var">$saveToDb</see><see type="var">$dbTableName</see><see type="var">$this</see><return name="" type="bool">TRUE if it exists, FALSE if not&#x0a;@throw Bs_Exception</return><description>values should get persisted.</description><shortdescription>tells if the db table exists. i mean the db table where the submitted</shortdescription></doc></function><function name="doesDbTableExist" undoc="false" access="public"><doc><see type="var">$this</see><see type="var">$saveToDb</see><see type="var">$dbTableName</see><parameter name="$dbTableName" default="NULL," type="string">default is NULL which means get it yourself. you may pass it here if you already have it as optimization.</parameter><parameter name="$useCache" default="TRUE" type="string">default is TRUE. if the table could have been created lately you better set it to FALSE.</parameter><return name="" type="bool">TRUE if it exists, FALSE if not&#x0a;@throw Bs_Exception</return><description>values should get persisted.</description><shortdescription>tells if the db table exists. i mean the db table where the submitted</shortdescription></doc></function><function name="createDbTable" undoc="false" access="public"><doc><see type="var">$this</see><see type="var">$this</see><parameter name="$dbTableName" default="NULL," type="string">default is NULL which means get it yourself. you may pass it here if you already have it as optimization.</parameter><parameter name="&amp;$saveToDbArray" type="array">the output of $this-&amp;gt;getSaveToDbArray().</parameter><return name="" type="bool">TRUE on success&#x0a;@throw Bs_Exception</return><description/><shortdescription>creates the db table. i mean the db table where the submitted values should get persisted.</shortdescription></doc></function><function name="_alterTableLineHelper" undoc="false" access="private"><doc><see type="function">createDbTable()</see><see type="function">updateDbTableStructure()</see><parameter name="$fieldName" undoc="true"/><parameter name="$dataType" undoc="true"/><return name="" type="string"/><description>moved here so it can be used from createDbTable() and updateDbTableStructure().</description><shortdescription>returns an sql fragment that can be used in create/alter table queries.</shortdescription></doc></function><function name="updateDbTableStructure" undoc="false" access="public"><doc><parameter name="$dbTableName" default="NULL," type="string">default is NULL which means get it yourself. you may pass it here if you already have it as optimization.</parameter><parameter name="&amp;$saveToDbArray" type="array">the output of $this-&amp;gt;getSaveToDbArray().</parameter><parameter name="$checkOnly" default="FALSE" type="string">default is FALSE. if set to true, no changes will be made.</parameter><return name="" type="bool">TRUE if we have made changes, FALSE if not&#x0a;@throw bs_exception</return><description/><shortdescription>checks if the db table structure is up-to-date and updates what&amp;apos;s needed.</shortdescription></doc></function><function name="getSaveToDbArray" undoc="false" access="public"><doc><return name="" type="array"> (hash, see above)</return><description>the scructure looks like this:$hash[&amp;apos;fieldName&amp;apos;] = array(&amp;apos;valueInternal&amp;apos;     =&amp;gt;&amp;apos;something&amp;apos;,&amp;apos;neededDataType&amp;apos;    =&amp;gt;&amp;apos;varchar&amp;apos;,&amp;apos;neededIndex&amp;apos;       =&amp;gt;FALSE,&amp;apos;availableDataType&amp;apos; =&amp;gt;&amp;apos;varchar&amp;apos;,&amp;apos;availableIndex&amp;apos;    =&amp;gt;FALSE,&amp;apos;shouldModifyType&amp;apos;  =&amp;gt;FALSE,&amp;apos;shouldAddIndex&amp;apos;    =&amp;gt;FALSE,&amp;apos;shouldPersist&amp;apos;     =&amp;gt;TRUE);so the key of the hash is the fieldname (as it should be in the db).valueInternal      is what we got from the browser. mostly a string, buttake care, it might be an array (explodable fields,select fields with property &amp;apos;multiple&amp;apos;).it is a reference, so don&amp;apos;t fuck with it.neededDataType     is $dbDataType of the field, or if not set then it&amp;apos;swhat we made up for it. the the received value doesn&amp;apos;tfit into that, then we might have to use some imagination.neededIndex        is TRUE if the field is set to mustBeUnique, FALSE otherwise.availableDataType  is the field type that we currently have in the db.availableIndex     is if there&amp;apos;s currently an index set in the db.shouldModifyType   is true if we should convert the field type. we neverdownsize anything. a few notes:char is always converted to varchar. varchar always usesthe max (255) as size. int is never downsized to tinyint, etc.shouldAddIndex     as you can see, the var name is shouldADD not shouldMODIFY.we never &amp;apos;downsize&amp;apos; here also. someone could have gone intothe db directly and set an index, so we will never remove one.all we do is add it if the field has become mutBeUniquesuddenly.shouldPersist      tells us if we should persist the data we got this time.for example in edit mode we don&amp;apos;t update some things.</description><shortdescription>creates a hash with the information about which data to persist, and how.</shortdescription></doc></function><function name="getValuesArray" undoc="false" access="public"><doc><parameter name="$shouldUseOnly" default="TRUE," type="string">default is TRUE. if set to true, only the fields are returned that should be used/persisted on the serverside.</parameter><parameter name="$valueType" default="&amp;apos;valueDisplay&amp;apos;" type="string">one of &amp;apos;valueInternal&amp;apos;, &amp;apos;valueDisplay&amp;apos; (default), &amp;apos;valueReceived&amp;apos;, &amp;apos;valueDefault&amp;apos;</parameter><parameter name="$withCaption" default="FALSE," type="string">(default is FALSE. would return a hash holding vectors where element 0 is the value and element 1 is the caption (in the current language).)</parameter><parameter name="$captionLang" default="null," type="string">(default is null. if not given then the lang setting of the form is used.)</parameter><parameter name="$printable" default="FALSE," type="string">(if you want nice human-readable output for values, set this to true. eg checkboxes return &amp;apos;yes/no&amp;apos; instead of 0/1 values.)</parameter><parameter name="$useLevels" default="null" type="string">(vector filled with integers, null means all steps.)</parameter><return name="" type="array"> (hash where key is the internally used field name, value the value or a hash (see param $withCaption). may be an empty array if nothing is available.)</return><description>does not move the pointer of $this-&amp;gt;clearingHouse.</description><shortdescription>returns the desired values of the submitted fields (that we should use).</shortdescription></doc></function><function name="getInterfaceText" undoc="false" access="public"><doc><see type="function">_loadInterfaceLanguage()</see><see type="var">$_guiLangHash</see><parameter name="$key" type="string"/><parameter name="$lang" default="null" type="string"/><return name="" type="string"/><throws>empty string &amp;apos;&amp;apos; if a key is not defined or a language can in no way be loaded.</throws><description/><shortdescription>returns a text string.</shortdescription></doc></function><function name="_loadInterfaceLanguage" undoc="false" access="private"><doc><see type="function">getInterfaceText()</see><see type="var">$_guiLangHash</see><parameter name="$wantLang" default="null" type="string">(what lang you want to load, if not specified then the lang of this form will be loaded.)</parameter><return name="" type="bool"> (TRUE on success, FALSE on failure. also TRUE if already loaded.)</return><description>desired language.it is possible that we need to load more than one language for a form,for example if the customer fills in the form in german, but the webmasterwants the results by email in english. at least with field captions that&amp;apos;sthe case, not sure here. but it could be possible, so we code it that way.if the lang is already loaded, it won&amp;apos;t be done again.</description><shortdescription>loads a language file to be able to communicate with the user in the</shortdescription></doc></function><function name="_evalWrap" undoc="false" access="private"><doc><parameter name="$string" undoc="true"/><parameter name="$security" type="string" undoc="true"/><parameter name="$suppressErrors" type="string" undoc="true"/><parameter name="$params" type="array" undoc="true"/><return type="void"/><description>we have it wrapped here so we are in the scope of this call and thuscan use $this-&amp;gt; things.</description><shortdescription>evaluate code in it&amp;apos;s own scope and return what the eval&amp;apos;d code returns.</shortdescription></doc></function><function name="jumpToFirstError" undoc="true" access="private"><doc><parameter name="$useJsFile" undoc="true"/><parameter name="$useJsFile" undoc="true"/><parameter name="$useJsFile" undoc="true"/><parameter name="$useJsFile" undoc="true"/><parameter name="$useJsFile" undoc="true"/><parameter name="$useJsFile" undoc="true"/><parameter name="$jumpToFirstError" undoc="true"/><parameter name="$jumpToFirstError" undoc="true"/><parameter name="$useJsFile" undoc="true"/><parameter name="$useJsFile" undoc="true"/><parameter name="$useJsFile" undoc="true"/><parameter name="$useJsFile" undoc="true"/><parameter name="$useJsFile" undoc="true"/><parameter name="$jumpToFirstError" type="string" undoc="true"/><return type="void"/></doc></function><variable name="$persister" access="private" type="string">NULL<doc><description/><shortdescription>instance of Bs_ObjPersisterForMySql to persist the settings.</shortdescription></doc></variable><variable name="$persisterID" access="private" type="int"><doc><see type="var">$this</see><description/><shortdescription>reserved var for the persister. don&amp;apos;t fuck with this.</shortdescription></doc></variable><variable name="$bsDb" access="public" type="object [unknown]"><doc><description>used for the saveToDb option.</description><shortdescription>reference to the globally used db object.</shortdescription></doc></variable><variable name="$_Bs_Array" access="private" type="object [unknown]"><doc><description/><shortdescription>reference to the global pseudostatic Bs_Array.</shortdescription></doc></variable><variable name="$_Bs_HtmlUtil" access="private" type="object [unknown]"><doc><description/><shortdescription>reference to the global pseudostatic Bs_HtmlUtil.</shortdescription></doc></variable><variable name="$Bs_TextUtil" access="public" type="object [unknown]"><doc><description/><shortdescription>reference to the global pseudostatic Bs_TextUtil.</shortdescription></doc></variable><variable name="$_APP" access="private" type="array"><doc><description/><shortdescription>reference to the global settings array $APP.</shortdescription></doc></variable><variable name="$name" access="private" type="string"><doc><description>if not set, it&amp;apos;s omitted.</description><shortdescription>the form name, as in &amp;lt;form name=$name&amp;gt;.</shortdescription></doc></variable><variable name="$action" access="private" type="string"><doc><description>if not set or an empty string, we submit to the user-requested page.note: we don&amp;apos;t submit to $_SERVER[&amp;apos;PHP_SELF&amp;apos;] but use Bs_Url::getUrlJunk(&amp;apos;8&amp;apos;) instead. rtfm.</description><shortdescription>where to submit the form to, as in &amp;lt;form action=$action&amp;gt;.</shortdescription></doc></variable><variable name="$method" access="private" type="string"><doc><description>one of get or post. if not set to &amp;apos;get&amp;apos; exactly, post is used.</description><shortdescription>what submit method to use, as in &amp;lt;form method=$method&amp;gt;.</shortdescription></doc></variable><variable name="$encType" access="private" type="string"><doc><see type="var">$this</see><description>one ofapplication/x-www-form-urlencoded  =&amp;gt; defaultmultipart/form-data                =&amp;gt; required for INPUT TYPE=FILEtext/plain                         =&amp;gt; for mailto: onlyif not set, it&amp;apos;s omitted. it is the recommended way not to add theenctype=$enctype to the form tag if it&amp;apos;s the default.if there is an &amp;lt;input type=file&amp;gt; used in the form, this var isautomatically set to &amp;apos;multipart/form-data&amp;apos; no matter what you setit to.</description><shortdescription>what encryption type to use, as in &amp;lt;form enctype=$enctype&amp;gt;.</shortdescription></doc></variable><variable name="$target" access="private" type="string"><doc><description>you can name a real target, or use one of the html values &amp;apos;_top&amp;apos;, &amp;apos;_parent&amp;apos;,&amp;apos;_self&amp;apos;, &amp;apos;_blank&amp;apos;.if not set, it&amp;apos;s omitted, which means send to the current target.</description><shortdescription>to which target should the form be submitted to? as in &amp;lt;form target=$target&amp;gt;</shortdescription></doc></variable><variable name="$styles" access="private" type="array"><doc><description>- string class- string id- string style- (*1) mixed title[]a string or an associative array cause it&amp;apos;s language dependant.appears as a tool tip over input fields if they don&amp;apos;t have a title specified.(*1) = i have removed this from the feature list. no support until further notice.check your html documentation for details.</description><shortdescription>hash with style information. these keys can be used:</shortdescription></doc></variable><variable name="$advancedStyles" access="private" type="array"><doc><description>the facts if the fields need to be filled out and if the input was ok. that&amp;apos;s whatthis var is for.hash with the following keys:captionMustcaptionMustOkaycaptionMustWrongcaptionMaycaptionMayOkaycaptionMayWrongfieldMustfieldMustOkayfieldMustWrongfieldMayfieldMayOkayfieldMayWrongcaption: the caption for a field.field  : the field itself.must   : the field is a must field.may    : the field is not a must field.: the form is displayed for the first time. (not okay nor wrong, just nothing)okay   : the form has been submitted and the input (if any) was accepted.wrong  : the form has been submitted and the input (if any) was not accepted.the values for your keys are the class names (not style definitions themself, actually).if a key is not set or empty, it is not used at all.</description><shortdescription>you may want to display the input fields and their captions differently based on</shortdescription></doc></variable><variable name="$useAccessKeys" access="private" type="bool"><doc><see type="var">$accessKeyTags</see><description>has no special setting for it. then the first letter will be used.</description><shortdescription>if set to true, access keys will be used for the fields even if the field</shortdescription></doc></variable><variable name="$accessKeyTags" access="private" type="array"><doc><see type="var">$useAccessKeys</see><description>user? the key usually has an underscore in the caption. so $accessKeyTagswould be array(&amp;apos;&amp;lt;u&amp;gt;&amp;apos;, &amp;apos;&amp;lt;/u&amp;gt;&amp;apos;) but it can be anything you like.example:$accessKeyTags = array(&amp;apos;&amp;lt;u&amp;gt;&amp;apos;, &amp;apos;&amp;lt;/u&amp;gt;&amp;apos;);$caption       = &amp;quot;Firstname&amp;quot;;$accessKey     = &amp;quot;r&amp;quot;;=&amp;gt; &amp;quot;Fi&amp;lt;u&amp;gt;r&amp;lt;/u&amp;gt;stname&amp;quot;if it&amp;apos;s not set [correctly], and there are accessKey&amp;apos;s set, array(&amp;apos;&amp;lt;u&amp;gt;&amp;apos;, &amp;apos;&amp;lt;/u&amp;gt;&amp;apos;)will be used.</description><shortdescription>if a form field uses the accessKey setting, how should it be visible to the</shortdescription></doc></variable><variable name="$direction" access="private" type="string"><doc><description>the direction in which the text is written.one of ltr (left to right) &amp;lt;= defaultrtl (right to left)ie5+</description><shortdescription>dir=&amp;quot;rtl&amp;quot;</shortdescription></doc></variable><variable name="$events" access="private" type="array"><doc><description>the currently (2001/04/27) available events are:- onSubmit   - onDblClick     - onMouseOver   - onKeyPress- onRest     - onMouseDown    - onMouseMove   - onKeyDown- onClick    - onMouseUp      - onMouseOut    - onKeyUpset the keys exactly like written above (case). otherwise we get in troublewhen merging more events into one, and there may be bugs.</description><shortdescription>(javascript) events like onSubmit, ...</shortdescription></doc></variable><variable name="$onEnter" access="private" type="string"><doc><description>usually the form gets submitted immediatly. this behavior may notbe desired. details can be found here:http://ppewww.ph.gla.ac.uk/~flavell/www/formquestion.htmlhttp://www.cs.tut.fi/~jkorpela/forms/enter.htmlhttp://www.google.com :)possible values:&amp;apos;ignore&amp;apos;  =&amp;gt; ignores the hit of enter. does not submit the form.&amp;apos;tab&amp;apos;     =&amp;gt; enter acts like the tab key. the cursor/focus jumps into/to the next field.&amp;apos;submit&amp;apos;  =&amp;gt; submits the form.&amp;apos;nothing&amp;apos; =&amp;gt; ignores this option. sends nothing to the browser.this all works by adding javascript events to the code. you need to havethe js file included (see var $useJsFile). if you don&amp;apos;t set anything, nojavascript will be set, nothing will be done.</description><shortdescription>browsers act differently when one hits enter in an input field.</shortdescription></doc></variable><variable name="$disabledMode" access="public" type="int"><doc><description>1 =&amp;gt; (default) internet explorer style with the properties &amp;apos;disabled&amp;apos; and &amp;apos;readonly&amp;apos;depending on the tag.2 =&amp;gt; javascript; javascript prevents the user from making changes.3 =&amp;gt; html; type=text will be sent as plain text, for radio/checkboxes images are sent...</description><shortdescription>how disabled fields should be sent to the client. one of:</shortdescription></doc></variable><variable name="$mustFieldsVisualMode" access="public" type="string">&amp;apos;starLeft&amp;apos;<doc><description>one of &amp;apos;none&amp;apos;, &amp;apos;starLeft&amp;apos;, &amp;apos;starRight&amp;apos;. (i hope &amp;apos;star&amp;apos; is the right word for a &amp;apos;*&amp;apos;.)if nothing is set, &amp;apos;starLeft&amp;apos; is used (so it&amp;apos;s the default).</description><shortdescription>how must fields should be &amp;apos;highlighted&amp;apos; in the browser.</shortdescription></doc></variable><variable name="$useTemplate" access="public" type="bool"><doc><see type="var">$templatePath</see><description>set to TRUE.to see how templates are named see the phpdoc of Bs_FormTemplateParser-&amp;gt;loadTemplate().note: containers can now have their own templates.</description><shortdescription>if we should use a template when an appropriate one is available. false unless</shortdescription></doc></variable><variable name="$templatePath" access="public" type="string"><doc><see type="var">$useTemplate</see><description>getAbsolutePath() . &amp;apos;../templates/&amp;apos;will be used which kinda sucks. so you better set that...</description><shortdescription>the absolute path to the template(s). if not given then</shortdescription></doc></variable><variable name="$buttons" access="public" type="mixed"><doc><see type="function">_getButtonString()</see><description>we change the form mode, we need to be able to define differentbuttons for each mode.you can - for example for a contact form where you need no editmode - define a &amp;quot;submit&amp;quot; button and use that one. and ignore thisvar. but if you want to use debedoo, you certainly want this option.data structure:one ofbuttons[mode][button]       = caption  //all languages use the same captionbuttons[mode][button][lang] = caption  //language dependant$buttons = array(&amp;apos;view&amp;apos;      =&amp;gt; array(&amp;apos;edit&amp;apos;      =&amp;gt; array(&amp;apos;en&amp;apos;=&amp;gt;&amp;apos;edit&amp;apos;,     &amp;apos;de&amp;apos;=&amp;gt;&amp;apos;bearbeiten&amp;apos;),&amp;apos;delete&amp;apos;    =&amp;gt; array(&amp;apos;en&amp;apos;=&amp;gt;&amp;apos;delete&amp;apos;,   &amp;apos;de&amp;apos;=&amp;gt;&amp;apos;löschen&amp;apos;),&amp;apos;cancel&amp;apos;    =&amp;gt; array(&amp;apos;en&amp;apos;=&amp;gt;&amp;apos;overview&amp;apos;, &amp;apos;de&amp;apos;=&amp;gt;&amp;apos;übersicht&amp;apos;)),&amp;apos;edit&amp;apos;      =&amp;gt; array(&amp;apos;save&amp;apos;      =&amp;gt; array(&amp;apos;en&amp;apos;=&amp;gt;&amp;apos;save&amp;apos;,     &amp;apos;de&amp;apos;=&amp;gt;&amp;apos;speichern&amp;apos;),&amp;apos;cancel&amp;apos;    =&amp;gt; array(&amp;apos;en&amp;apos;=&amp;gt;&amp;apos;cancel&amp;apos;,   &amp;apos;de&amp;apos;=&amp;gt;&amp;apos;abbrechen&amp;apos;),&amp;apos;next&amp;apos;      =&amp;gt; array(&amp;apos;en&amp;apos;=&amp;gt;&amp;apos;next&amp;apos;,     &amp;apos;de&amp;apos;=&amp;gt;&amp;apos;weiter&amp;apos;),&amp;apos;back&amp;apos;      =&amp;gt; array(&amp;apos;en&amp;apos;=&amp;gt;&amp;apos;back&amp;apos;,     &amp;apos;de&amp;apos;=&amp;gt;&amp;apos;zurück&amp;apos;)),&amp;apos;add&amp;apos;       =&amp;gt; array(&amp;apos;save&amp;apos;      =&amp;gt; array(&amp;apos;en&amp;apos;=&amp;gt;&amp;apos;add&amp;apos;,      &amp;apos;de&amp;apos;=&amp;gt;&amp;apos;hinzufügen&amp;apos;),&amp;apos;cancel&amp;apos;    =&amp;gt; array(&amp;apos;en&amp;apos;=&amp;gt;&amp;apos;cancel&amp;apos;,   &amp;apos;de&amp;apos;=&amp;gt;&amp;apos;abbrechen&amp;apos;),&amp;apos;next&amp;apos;      =&amp;gt; array(&amp;apos;en&amp;apos;=&amp;gt;&amp;apos;next&amp;apos;,     &amp;apos;de&amp;apos;=&amp;gt;&amp;apos;weiter&amp;apos;),&amp;apos;back&amp;apos;      =&amp;gt; array(&amp;apos;en&amp;apos;=&amp;gt;&amp;apos;back&amp;apos;,     &amp;apos;de&amp;apos;=&amp;gt;&amp;apos;zurück&amp;apos;)),&amp;apos;delete&amp;apos;    =&amp;gt; array(&amp;apos;save&amp;apos;      =&amp;gt; array(&amp;apos;en&amp;apos;=&amp;gt;&amp;apos;delete&amp;apos;,   &amp;apos;de&amp;apos;=&amp;gt;&amp;apos;löschen&amp;apos;),&amp;apos;cancel&amp;apos;    =&amp;gt; array(&amp;apos;en&amp;apos;=&amp;gt;&amp;apos;cancel&amp;apos;,   &amp;apos;de&amp;apos;=&amp;gt;&amp;apos;abbrechen&amp;apos;)),&amp;apos;search&amp;apos;    =&amp;gt; array(&amp;apos;go&amp;apos;      =&amp;gt; array(&amp;apos;en&amp;apos;=&amp;gt;&amp;apos;search&amp;apos;,     &amp;apos;de&amp;apos;=&amp;gt;&amp;apos;suchen&amp;apos;)));what you can do is set the caption of the buttons. define your language.if a button caption is not defined at all, the button won&amp;apos;t be used.example: $buttons[&amp;apos;view&amp;apos;][&amp;apos;cancel&amp;apos;] = null;special case:maybe you&amp;apos;re happy with default captions (although i bet most clientswant different captions 5 minutes before going live).if so, you can set $buttons to string &amp;apos;default&amp;apos;. in that case the $buttonsvar will be used like what you see in the definiton above.if you don&amp;apos;t want this at all set it to FALSE or don&amp;apos;t set it at all.</description><shortdescription>we always need buttons to submit a form. because they change when</shortdescription></doc></variable><variable name="$internalName" access="public" type="string"><doc><description>because of javascripts that depend on a name.</description><shortdescription>the name of this form in the database. may be different than $this-&amp;gt;name</shortdescription></doc></variable><variable name="$saveToDb" access="public" type="bool"><doc><see type="var">$dbTableName</see><description/><shortdescription>save the values of this form to the db or not?</shortdescription></doc></variable><variable name="$dbDsn" access="public" type="array"><doc><description>then you can give the db information here. it&amp;apos;s a dsn as always:KEYS:&amp;apos;host&amp;apos;&amp;apos;port&amp;apos;&amp;apos;syntax&amp;apos;&amp;apos;type&amp;apos;&amp;apos;user&amp;apos;&amp;apos;pass&amp;apos;be aware of the fact that this data has to be stored along with theform settings, and that isn&amp;apos;t very secure. although it&amp;apos;s set tobe cryptified. a stackdump could be dangerous.</description><shortdescription>if the form has to be saved to another database/server/whatever</shortdescription></doc></variable><variable name="$dbName" access="public" type="string"><doc><see type="var">$saveToDb</see><see type="var">$dbTableName</see><description>if not given, the currently used db (global db) will be used.</description><shortdescription>the db where the data should be stored automatically.</shortdescription></doc></variable><variable name="$dbTableName" access="public" type="string"><doc><see type="var">$saveToDb</see><see type="var">$dbName</see><description>is allowed, no underscore, no &amp;apos;minus&amp;apos; (_-). it has to start with thestring &amp;apos;form&amp;apos;.if not given, the var $internalName is used with the prefix &amp;apos;form&amp;apos;.</description><shortdescription>the table where the data should be stored autmatically. only a-z A-Z 0-9</shortdescription></doc></variable><variable name="$additionalParams" access="public" type="array"><doc><description>you may need to store data into the db that does not come from the user input.it may be computed from some user input, for example.the key is the field name, the value needs to be a vector with exactly 3 elements.element[0] tells the type (&amp;apos;text&amp;apos; (default) or &amp;apos;code&amp;apos;),element[1] is the mode (one of &amp;apos;add&amp;apos;, &amp;apos;edit&amp;apos;, &amp;apos;both&amp;apos;, &amp;apos;none&amp;apos;), andelement[2] is the value.for &amp;apos;code&amp;apos; the value is treated as php code and thus evaluated (in $this-&amp;gt;_evalWrap()).it is only done if the mode matches, of course. invalid mode is treated as &amp;apos;none&amp;apos;.</description><shortdescription>hash holding additional data that needs to be persisted in the db.</shortdescription></doc></variable><variable name="$sendMailRaw" access="public" type="bool"><doc><description/><shortdescription>should we send the submitted data in an autogenerated email to somewhere?</shortdescription></doc></variable><variable name="$mailRawTo" access="private" type="string"><doc><see type="var">$sendMailRaw</see><description/><shortdescription>email to address</shortdescription></doc></variable><variable name="$mailRawCc" access="private" type="string"><doc><see type="var">$sendMailRaw</see><description/><shortdescription>email cc address</shortdescription></doc></variable><variable name="$mailRawBcc" access="private" type="string"><doc><see type="var">$sendMailRaw</see><description/><shortdescription>email bcc address</shortdescription></doc></variable><variable name="$mailRawSubject" access="private" type="string"><doc><see type="var">$sendMailRaw</see><description/><shortdescription>email subject</shortdescription></doc></variable><variable name="$sendMailNice1" access="private" type="bool"><doc><description/><shortdescription>should we send the submitted data using a template by email to somewhere?</shortdescription></doc></variable><variable name="$mailNice1To" access="private" type="string"><doc><see type="var">$sendMailNice1</see><description/><shortdescription>email to address</shortdescription></doc></variable><variable name="$mailNice1Cc" access="private" type="string"><doc><see type="var">$sendMailNice1</see><description/><shortdescription>email cc address</shortdescription></doc></variable><variable name="$mailNice1Bcc" access="private" type="string"><doc><see type="var">$sendMailNice1</see><description/><shortdescription>email bcc address</shortdescription></doc></variable><variable name="$mailNice1Subject" access="private" type="string"><doc><see type="var">$sendMailNice1</see><description/><shortdescription>email subject</shortdescription></doc></variable><variable name="$mailNice1Template" access="private" type="string"><doc><see type="var">$sendMailNice1</see><description/><shortdescription>email template</shortdescription></doc></variable><variable name="$_guiLangHash" access="private" type="array"><doc><see type="function">_loadInterfaceLanguage()</see><see type="function">getInterfaceText()</see><description>note: this var is static, so all instances of Bs_Form share the same!we need to specify that in the constructor.</description><shortdescription>language strings loaded from files.</shortdescription></doc></variable><variable name="$clearingHouse" access="public" type="array"><doc><see type="var">$this</see><description>construct. normally the form wouldn&amp;apos;t know directly which elements(and fields) are attached to it. it only knows about$elementContainer, which knows its elements including othercontainers, which again only knows about its elements.with this clearing house we have a reference to every element object.</description><shortdescription>this is something between a hack, an optimization and a needed</shortdescription></doc></variable><variable name="$fieldsUsed" access="private" type="array"><doc><see type="function">setBsFormData()</see><see type="function">getUsedFields()</see><description>information about which fields have been sent to the client. so weonly work with these fields. gets set in setBsFormData().</description><shortdescription>when the form has been submitted, there is a hidden field with the</shortdescription></doc></variable><variable name="$serializeType" access="public" type="string">&amp;apos;php&amp;apos;<doc><description>old comment:i have used php (serialize()) before, until unserialize() just did not work onone windows machine in php406. so i had to switch.new comment 2002/04/08:have switched back to default = &amp;apos;php&amp;apos; cause wddx is not installed on all systemsby default (linux). --andrej</description><shortdescription>one of &amp;apos;wddx&amp;apos; or &amp;apos;php&amp;apos; (default).</shortdescription></doc></variable><variable name="$md5Key" access="public" type="string"><doc><description>by default $APP[&amp;apos;forms&amp;apos;][&amp;apos;md5Key&amp;apos;] is used. and if that is not available or empty,this var will be initialized with the string: &amp;quot;Von der Wiege bis zur Bahre: Formulare&amp;quot;(which is the same as the default value of the $APP[&amp;apos;forms&amp;apos;][&amp;apos;md5Key&amp;apos;] var).</description><shortdescription>the md5 key to use to make sure the user did not cheat when submitting the form.</shortdescription></doc></variable><variable name="$elementContainer" access="public" type="object [unknown]"><doc><description>this is a pseudo container to make things easier.</description><shortdescription>an instance of Bs_FormContainer to keep track of all form elements.</shortdescription></doc></variable><variable name="$hasJavascript" access="private" type="bool"><doc><see type="var">$this</see><description/><shortdescription>cached information if the client browser has javascript support.</shortdescription></doc></variable><variable name="$errors" access="private" type="array"><doc><description>usually it&amp;apos;s just a hash holding another hash, where the key of the firsthash is the fieldname, the key/value of the 2nd hash is the field captionand error message. it may have vector elements with just a string as text.example:$errors[&amp;apos;0&amp;apos;]        = &amp;quot;some error text&amp;quot;;$errors[&amp;apos;username&amp;apos;] = array(&amp;apos;Username&amp;apos; =&amp;gt; &amp;apos;too short&amp;apos;);$errors[&amp;apos;password&amp;apos;] = array(&amp;apos;Password&amp;apos; =&amp;gt; &amp;apos;may not be equal to username&amp;apos;);if not set, no errors occured and everything is fine.</description><shortdescription>holds the errors that occured during the validating of the form fields.</shortdescription></doc></variable><variable name="$mode" access="private" type="string"><doc><see type="var">$this</see><description>if not set then an unknown mode is choosen. you may get strangefrom output in that case (fields not seen/not editable). an unknownmode may be desired for a search or login form or so.</description><shortdescription>the form mode we&amp;apos;re in. one of &amp;apos;add&amp;apos;, &amp;apos;edit&amp;apos;, &amp;apos;delete&amp;apos; and &amp;apos;view&amp;apos;.</shortdescription></doc></variable><variable name="$level" access="public" type="int"><doc><see type="function">isMultiLevel()</see><see type="function">isFirstLevel()</see><see type="function">isLastLevel()</see><see type="var">$_prevLevel</see><see type="var">$_nextLevel</see><description>multi-step form. (the name &amp;apos;step&amp;apos; was already reserved, thereis already such a var for another thing. don&amp;apos;t mix them.)imo a multi-level form can do more than a multi-step form, sothe name is even more accurate. multi-level means that we don&amp;apos;thave to follow step 1-2-3-4-5, it can be different.lemme give you an example:a client wants to order something in your shop.+----------------------------------------------------------------------+| LEVEL | COMMENT     | USER INPUT (SELECT OPTION OR FILL IN)          |+----------------------------------------------------------------------+| 1) choose products              5x redbull, 2x wodka red :)          ||                                        |                             ||                       -----------------------------------------------||                                        |                             || 2) how to get it         a) pickup          b) send by mail          ||                               \                |                     || 3)                             \            fill in address          ||                                 \              |                     ||                       -----------------------------------------------|| 4) payment            a) credit card      b) bill            c) cash ||                              |               |                   |   || 5)                    give card info    give bill address        |   ||                                         or select that it&amp;apos;s      |   ||                                         the same as delivery.    |   ||                              \               |                   /   ||                       -----------------------------------------------|| 6) done                      THANK    YOU    FOR    YOUR    ORDER.   ||                                                                      |+----------------------------------------------------------------------+comments (about the example):- if you choose a) pickup in level 2) you will directly go to 4).- if you go back in 4) you may go directly to 2) if you came fromthere.- in level 4) the c) cash option is only there if the client picksup the goods (in step 2) the option a) was selected).- in level 5) the option to select &amp;quot;same as delivery&amp;quot; is onlyavailable if the goods are sent by mail.note that the vars $viewCount, $startTimestamp, $usedTime and maybe othersdon&amp;apos;t care about the level. they are here once for all levels together.note also that only containers can be assigned to levels. so put everythingof each level into a separate pseudocontainer. that makes our live mucheasier. we have to deal with girlfriends, that&amp;apos;s enough trouble.</description><shortdescription>this form class is multi-level capable. think about it like a</shortdescription></doc></variable><variable name="$_prevLevel" access="private" type="int"><doc><see type="var">$level</see><description/><shortdescription>hrm.</shortdescription></doc></variable><variable name="$_nextLevel" access="private" type="int"><doc><see type="var">$level</see><description/><shortdescription>hrm.</shortdescription></doc></variable><variable name="$step" access="private" type="integer">1<doc><description>if the form is displayed for the first time, the step is 1. if theform has been submitted by the user incorrectly (data missing or so)we&amp;apos;re in step 2 (no matter how many times the user submits the form).if it&amp;apos;s a multilevel form and for example the form level 3 is displayedfor the first time, step is 1.</description><shortdescription>the form step we&amp;apos;re in. default is 1, can be 2.</shortdescription></doc></variable><variable name="$state" access="private" type="string">&amp;apos;form&amp;apos;<doc><description>&amp;apos;form&amp;apos;, &amp;apos;preview&amp;apos;, &amp;apos;done&amp;apos;.i don&amp;apos;t think this one is in use/coded yet.</description><shortdescription>the form state we&amp;apos;re in. default is &amp;apos;form&amp;apos;, one of</shortdescription></doc></variable><variable name="$viewCount" access="private" type="integer">1<doc><description>filled out correctly.this is not the same as step, and they should not be mixed or put together.</description><shortdescription>counts the number of times the form was displayed to the client until it was</shortdescription></doc></variable><variable name="$startTimestamp" access="private" type="mixed"><doc><see type="var">$usedTime</see><description>datatype: not sure if that&amp;apos;s an int or double for php, but when it comesfrom a submitted form it&amp;apos;s a string.</description><shortdescription>the timestamp when the form was sent to the browser for the first time.</shortdescription></doc></variable><variable name="$usedTime" access="private" type="int"><doc><see type="var">$startTimestamp</see><description/><shortdescription>once the form is &amp;apos;done&amp;apos; this is set to the used time. (actual time - $startTimestamp)</shortdescription></doc></variable><variable name="$language" access="private" type="string"><doc><description/><shortdescription>the language we use for that form.</shortdescription></doc></variable><variable name="$recordId" access="private" type="int"><doc><description/><shortdescription>usually the form is here to edit data from a database. which record? this one.</shortdescription></doc></variable><variable name="$user" access="private" type="string"><doc><see type="var">$accessRights</see><description>something like &amp;apos;guest&amp;apos;, &amp;apos;member&amp;apos;, &amp;apos;admin&amp;apos;, ...i think that you prolly want to store a group name in here, rather than a user.if this var is not set or empty, everyone can do everything.</description><shortdescription>the user/group (based on a session?) that is using the form.</shortdescription></doc></variable><variable name="$accessRights" access="private" type="array"><doc><see type="var">$user</see><description>KEY       DATA TYPE    EXAMPLE      DESCRIPTION&amp;apos;group&amp;apos;   string       &amp;apos;admin&amp;apos;      user or group, whatever. just a name to identify the ppl.&amp;apos;view&amp;apos;    bool         TRUE|FALSE   if the user may view the form in view mode.&amp;apos;add&amp;apos;     bool         TRUE|FALSE   if the user may view the form in add mode (and add records).&amp;apos;edit&amp;apos;    bool         TRUE|FALSE   if the user may view the form in edit mode (and edit records).&amp;apos;delete&amp;apos;  bool         TRUE|FALSE   if the user may view the form in delete mode (and delete records).&amp;apos;alter&amp;apos;   bool         TRUE|FALSE   if the user may view the form in alter mode (and alter the structure).</description><shortdescription>the vector holds hashes with these keys:</shortdescription></doc></variable><variable name="$useJsFile" access="private" type="string">FALSE<doc><description>it&amp;apos;s a problem if it&amp;apos;s not linked in the &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt; for ns 4.x. :/now because of those browser problems we don&amp;apos;t include the js filebefore the body tag anymore. that js call goes into the $_includeOncearray. some user code may have to be updated. sorry. 2002/04/29 --andrej</description><shortdescription>use the externally linked js file? (Bs_FormUtil.lib.js)</shortdescription></doc></variable><variable name="$_includeOnce" access="private" type="array"><doc><see type="var">$_onLoad</see><see type="function">addIncludeOnce()</see><see type="function">getIncludeOnce()</see><description>it&amp;apos;s a good practise to write them the same way all the time (relative/absolute,upper/lowercase) to avoid problems.</description><shortdescription>javascript source files that need to be included - but only once for that page.</shortdescription></doc></variable><variable name="$_onLoad" access="private" type="array"><doc><see type="var">$_includeOnce</see><see type="function">addOnLoadCode()</see><see type="function">getOnLoadCode()</see><description/><shortdescription>javascript code that needs to be executed in the onLoad event of the page.</shortdescription></doc></variable><variable name="$_inHead" access="private" type="array"><doc><see type="var">$_includeOnce</see><see type="var">$_onLoad</see><see type="function">addIntoHead()</see><see type="function">getInHeadCode()</see><description/><shortdescription>stuff (html/javascript/...) to put into the document head.</shortdescription></doc></variable><variable name="$jumpToFirstError" access="private" type="string">FALSE<doc><see type="var">$useJsFile</see><description>field that was filled in incorrectly/left out (must field).the javascript function jumpToFirstError() is needed, it is locatedin the js file. see var $useJsFile.</description><shortdescription>if we should insert the javascript trigger to jump into the first</shortdescription></doc></variable><variable name="$persisterVarSettings" access="private" type="array">array(&amp;apos;internalName&amp;apos;         =&amp;gt; array(&amp;apos;mode&amp;apos;=&amp;gt;&amp;apos;lonely&amp;apos;,        &amp;apos;metaType&amp;apos;=&amp;gt;&amp;apos;string&amp;apos;,      &amp;apos;index&amp;apos;=&amp;gt;TRUE), &#x0a;                                    &amp;apos;name&amp;apos;                 =&amp;gt; array(&amp;apos;mode&amp;apos;=&amp;gt;&amp;apos;stream&amp;apos;), &#x0a;                                    &amp;apos;action&amp;apos;               =&amp;gt; array(&amp;apos;mode&amp;apos;=&amp;gt;&amp;apos;stream&amp;apos;), &#x0a;                                    &amp;apos;method&amp;apos;               =&amp;gt; array(&amp;apos;mode&amp;apos;=&amp;gt;&amp;apos;stream&amp;apos;), &#x0a;                                    &amp;apos;encType&amp;apos;              =&amp;gt; array(&amp;apos;mode&amp;apos;=&amp;gt;&amp;apos;stream&amp;apos;), &#x0a;                                    &amp;apos;target&amp;apos;               =&amp;gt; array(&amp;apos;mode&amp;apos;=&amp;gt;&amp;apos;stream&amp;apos;), &#x0a;                                    &amp;apos;styles&amp;apos;               =&amp;gt; array(&amp;apos;mode&amp;apos;=&amp;gt;&amp;apos;stream&amp;apos;), &#x0a;                                    &amp;apos;advancedStyles&amp;apos;       =&amp;gt; array(&amp;apos;mode&amp;apos;=&amp;gt;&amp;apos;stream&amp;apos;), &#x0a;                                    &amp;apos;useAccessKeys&amp;apos;        =&amp;gt; array(&amp;apos;mode&amp;apos;=&amp;gt;&amp;apos;stream&amp;apos;), &#x0a;                                    &amp;apos;accessKeyTags&amp;apos;        =&amp;gt; array(&amp;apos;mode&amp;apos;=&amp;gt;&amp;apos;stream&amp;apos;), &#x0a;                                    &amp;apos;direction&amp;apos;            =&amp;gt; array(&amp;apos;mode&amp;apos;=&amp;gt;&amp;apos;stream&amp;apos;), &#x0a;                                    &amp;apos;events&amp;apos;               =&amp;gt; array(&amp;apos;mode&amp;apos;=&amp;gt;&amp;apos;stream&amp;apos;), &#x0a;                                    &amp;apos;onEnter&amp;apos;              =&amp;gt; array(&amp;apos;mode&amp;apos;=&amp;gt;&amp;apos;stream&amp;apos;), &#x0a;                                    &amp;apos;disabledMode&amp;apos;         =&amp;gt; array(&amp;apos;mode&amp;apos;=&amp;gt;&amp;apos;stream&amp;apos;), &#x0a;                                    &amp;apos;mustFieldsVisualMode&amp;apos; =&amp;gt; array(&amp;apos;mode&amp;apos;=&amp;gt;&amp;apos;stream&amp;apos;), &#x0a;                                    &amp;apos;useTemplate&amp;apos;          =&amp;gt; array(&amp;apos;mode&amp;apos;=&amp;gt;&amp;apos;stream&amp;apos;), &#x0a;                                    &amp;apos;templatePath&amp;apos;         =&amp;gt; array(&amp;apos;mode&amp;apos;=&amp;gt;&amp;apos;stream&amp;apos;), &#x0a;                                    &amp;apos;buttons&amp;apos;              =&amp;gt; array(&amp;apos;mode&amp;apos;=&amp;gt;&amp;apos;stream&amp;apos;), &#x0a;                                    &amp;apos;useJsFile&amp;apos;            =&amp;gt; array(&amp;apos;mode&amp;apos;=&amp;gt;&amp;apos;stream&amp;apos;), &#x0a;                                    &amp;apos;jumpToFirstError&amp;apos;     =&amp;gt; array(&amp;apos;mode&amp;apos;=&amp;gt;&amp;apos;stream&amp;apos;), &#x0a;                                    &amp;apos;saveToDb&amp;apos;             =&amp;gt; array(&amp;apos;mode&amp;apos;=&amp;gt;&amp;apos;stream&amp;apos;), &#x0a;                                    &amp;apos;dbDsn&amp;apos;                =&amp;gt; array(&amp;apos;mode&amp;apos;=&amp;gt;&amp;apos;stream&amp;apos;,      &amp;apos;crypt&amp;apos;=&amp;gt;TRUE), &#x0a;                                    &amp;apos;dbName&amp;apos;               =&amp;gt; array(&amp;apos;mode&amp;apos;=&amp;gt;&amp;apos;stream&amp;apos;), &#x0a;                                    &amp;apos;dbTableName&amp;apos;          =&amp;gt; array(&amp;apos;mode&amp;apos;=&amp;gt;&amp;apos;stream&amp;apos;), &#x0a;                                    &amp;apos;additionalParams&amp;apos;     =&amp;gt; array(&amp;apos;mode&amp;apos;=&amp;gt;&amp;apos;stream&amp;apos;), &#x0a;                                    &amp;apos;sendMailRaw&amp;apos;          =&amp;gt; array(&amp;apos;mode&amp;apos;=&amp;gt;&amp;apos;stream&amp;apos;), &#x0a;                                    &amp;apos;mailRawTo&amp;apos;            =&amp;gt; array(&amp;apos;mode&amp;apos;=&amp;gt;&amp;apos;stream&amp;apos;), &#x0a;                                    &amp;apos;mailRawCc&amp;apos;            =&amp;gt; array(&amp;apos;mode&amp;apos;=&amp;gt;&amp;apos;stream&amp;apos;), &#x0a;                                    &amp;apos;mailRawBcc&amp;apos;           =&amp;gt; array(&amp;apos;mode&amp;apos;=&amp;gt;&amp;apos;stream&amp;apos;), &#x0a;                                    &amp;apos;mailRawSubject&amp;apos;       =&amp;gt; array(&amp;apos;mode&amp;apos;=&amp;gt;&amp;apos;stream&amp;apos;), &#x0a;                                    &amp;apos;sendMailNice1&amp;apos;        =&amp;gt; array(&amp;apos;mode&amp;apos;=&amp;gt;&amp;apos;stream&amp;apos;), &#x0a;                                    &amp;apos;mailNice1To&amp;apos;          =&amp;gt; array(&amp;apos;mode&amp;apos;=&amp;gt;&amp;apos;stream&amp;apos;), &#x0a;                                    &amp;apos;mailNice1Cc&amp;apos;          =&amp;gt; array(&amp;apos;mode&amp;apos;=&amp;gt;&amp;apos;stream&amp;apos;), &#x0a;                                    &amp;apos;mailNice1Bcc&amp;apos;         =&amp;gt; array(&amp;apos;mode&amp;apos;=&amp;gt;&amp;apos;stream&amp;apos;), &#x0a;                                    &amp;apos;mailNice1Subject&amp;apos;     =&amp;gt; array(&amp;apos;mode&amp;apos;=&amp;gt;&amp;apos;stream&amp;apos;), &#x0a;                                    &amp;apos;mailNice1Template&amp;apos;    =&amp;gt; array(&amp;apos;mode&amp;apos;=&amp;gt;&amp;apos;stream&amp;apos;)&#x0a;                                    )<doc></doc></variable><variable name="$this" access="private" type="unknown"><doc></doc></variable><constant name="BS_FORM_VERSION" undoc="true" access="private" case="default: case sensitive">4.0.$x$<doc></doc></constant><inherited src="Bs_Object" type="functions"><element>isex</element><element>isexception</element><element>tostring</element><element>tohtml</element><element>bs_object</element><element>bbsetoutput</element><element>bbawake</element><element>bbisawake</element><element>bbxmsg</element><element>bbxfunctionstart</element><element>bbxfunctionend</element><element>bbxecho</element><element>bbxvar</element><element>bbxvardump</element><element>bbforcetrace</element><element>bbbufferstart</element><element>bbbufferget</element><element>bbbufferendflush</element><element>bbbufferendclean</element></inherited><inherited src="Bs_Object" type="consts"><element>bs_object_version</element></inherited><path><parent>Bs_Object</parent></path><baseclass>Bs_Object</baseclass></class></phpdoc>