<?xml version="1.0"?><phpdoc><class name="form_element" extends="form_commonobject" undoc="false" access="public" abstract="true" package="Form"><file>c:/www/apache/doc2//form/form_element.inc</file><doc><author email="uw@netuse.de">Ulf Wendel</author><inherited src="Array"/><description/><shortdescription>Superclass of all form elements.</shortdescription><version>$Id: form_element.inc,v 1.5 2000/12/12 01:37:33 uw Exp $</version></doc><function name="form_element" undoc="false" access="public"><doc><parameter name="$element_data" type="array">Array describing the form element</parameter><parameter name="$method" type="int">erpreted as &amp;quot;GET&amp;quot;.</parameter><parameter name="$form_name" default="&amp;quot;&amp;quot;" type="string">HTML name attribute of the form tag.</parameter><parameter name="$js_mode" default="&amp;quot;&amp;quot;" type="string">Optional, JavaScript validation mode. If set to&#x0a;&amp;quot;strong&amp;quot; (case insensitive) each element gets checked&#x0a;when changed (onChange/onClick) and when the form gets submitted (onSubmit).&#x0a;All other values start JavaScript validation with &amp;quot;onSubmit&amp;quot;.</parameter><return type="void"/><description>The form object uses this constructor to setup any form element.Derived constructurs are not called by the form object. If you needsome kind of setup in any of the derived form element classes overridesetup(). Setup() gets always called by form_element().</description><shortdescription>Creates a new form element.</shortdescription></doc></function><function name="setup" undoc="false" access="private"><doc><see type="function">form_element()</see><return type="void"/><description>The form objects expects one constructor form_element()to setup all form element object. So the constructorof every derived class gets never called. To to setupany object that&amp;apos;s derived from form_element the derivedobject has to override this method. It&amp;apos;s always calledby form_element.</description><shortdescription>Kind of a constructor of a derived form element.</shortdescription></doc></function><function name="checkConfiguration" undoc="false" access="private"><doc><parameter name="$element_data" type="array">Data used in form::add_element()</parameter><return name="$ok" type="boolean"/><throws>form_error</throws><description>You should call this function if you&amp;apos;re newto the form stuff or debugging complex forms.If there&amp;apos;s a problem the function might &amp;quot;throw&amp;quot;several exceptions. The function will notstop work when it finds an error but continue.That means that you can&amp;apos;t &amp;quot;catch&amp;quot; the exceptions.Make sure that exception::$AUTO_HANDLE_ERRORSis set to true so that every error messages will beprinted.</description><shortdescription>Checks the data used to initialize the element.</shortdescription></doc></function><function name="getValue" undoc="false" access="public"><doc><return name="$value" type="mixed"/><description/><shortdescription>Returns the value of an element.</shortdescription></doc></function><function name="getType" undoc="false" access="public"><doc><return name="$type" type="string"/><description/><shortdescription>Returns the type of this element.</shortdescription></doc></function><function name="isButton" undoc="false" access="public"><doc><return name="$is_button" type="boolean"/><description/><shortdescription>Returns true if the element is a button, otherwise false</shortdescription></doc></function><function name="getValidator" undoc="false" access="public"><doc><see type="function">setValidator()</see><return name="$validator" type="string"/><description/><shortdescription>Returns the name of the custom validation function.</shortdescription></doc></function><function name="setValidator" undoc="false" access="public"><doc><see type="function">getValidator()</see><parameter name="$validator" type="string"/><return name="$ok" type="boolean"/><throws>form_error</throws><description/><shortdescription>Sets the name of the custom validation function.</shortdescription></doc></function><function name="freeze" undoc="false" access="public"><doc><return type="void"/><description/><shortdescription>Freeze the form element.</shortdescription></doc></function><function name="unfreeze" undoc="false" access="public"><doc><return type="void"/><description/><shortdescription>Thaw out the object</shortdescription></doc></function><function name="thawout" undoc="false" access="private"><doc><return type="void"/><description/><shortdescription>Alias for unfreeze().</shortdescription><brother>unfreeze</brother></doc></function><function name="get" undoc="false" access="public" abstract="true"><doc><see type="function">getfrozen()</see><see type="function">show()</see><parameter name="$value" default="&amp;quot;&amp;quot;" type="string">The value is only used with radio buttons.&#x0a;If the given value is equal to the value of the&#x0a;element when it was defined, the radio gets selected.</parameter><return name="$html" type="string"> HTML code of the element.</return><description/><shortdescription>Returns the HTML code of the element.</shortdescription></doc></function><function name="getfrozen" undoc="false" access="private" abstract="true"><doc><see type="function">get()</see><see type="function">show()</see><parameter name="$value" default="&amp;quot;&amp;quot;" type="string">The value is only used with radio buttons.&#x0a;If the given value is equal to the value of the&#x0a;element when it was defined, the radio gets selected.</parameter><return name="$html" type="string"> HTML code of the frozen element.</return><description/><shortdescription>Returns thr HTML code of the frozen element.</shortdescription><brother>get</brother></doc></function><function name="show" undoc="false" access="private" abstract="true"><doc><see type="function">getfrozen()</see><see type="function">show()</see><parameter name="$value" default="&amp;quot;&amp;quot;" type="string">The value is only used with radio buttons.&#x0a;If the given value is equal to the value of the&#x0a;element when it was defined, the radio gets selected.</parameter><return type="void"/><description/><shortdescription>Print version of get().</shortdescription><brother>get</brother></doc></function><function name="validate" undoc="false" access="public" abstract="true"><doc><see type="function">validateLength()</see><see type="function">validateRegEx()</see><see type="function">doValidation()</see><return name="" type="string">Error message if there is an error</return><description/><shortdescription>Returns the result of the (serverside) validation.</shortdescription></doc></function><function name="validateLength" undoc="false" access="private"><doc><parameter name="$value" default="&amp;quot;&amp;quot;" type="mixed">Optional value, if not specified $this-&amp;gt;value gets used.</parameter><return name="$errormessage" type="string"/><description/><shortdescription>Validate the length of the input value.</shortdescription></doc></function><function name="validateRegEx" undoc="false" access="private"><doc><see type="function">validateLength()</see><parameter name="$value" default="&amp;quot;&amp;quot;" type="mixed">Optional value, if not specified $this-&amp;gt;value gets used.</parameter><return name="$errormessage" type="string"/><description/><shortdescription>Compare the element value with the specified RegExp.</shortdescription></doc></function><function name="doValidation" undoc="false" access="private"><doc><parameter name="$event" type="string"/><return name="$ok" type="boolean"/><throws>form_error</throws><description/><shortdescription>Validate this event?</shortdescription></doc></function><function name="react" undoc="false" access="public"><doc><see type="var">$val_events</see><parameter name="$events" type="mixed">Eighter a string with the name&#x0a;of one &amp;quot;event&amp;quot; or an array of &amp;quot;events&amp;quot;.&#x0a;Known &amp;quot;events&amp;quot; are: all, length, valid, intro,&#x0a;js_onsubmit, js_onchange. &amp;quot;length&amp;quot; controls&#x0a;length_e, minlength and maxlength, &amp;quot;valid&amp;quot; controls&#x0a;valid_e and valid_regexp and &amp;quot;intro&amp;quot; controls &amp;quot;intro&amp;quot;, &amp;quot;intro_e&amp;quot;.&#x0a;&amp;quot;js_onsubmit&amp;quot; and &amp;quot;js_onchange&amp;quot; referr to the JavaScript&#x0a;event handler.</parameter><parameter name="$status" default="true" type="boolean">Optional, if set to true the specified &amp;quot;events&amp;quot; will be validated,&#x0a;otherwise validation is turned off (default: true = on)</parameter><return name="$ok" type="boolean"> Returns false if no valid events where found.</return><throws>form_error</throws><description>You can tell every (default) validator which &amp;quot;events&amp;quot;will be validated. This gives you detailed controlon a default validator in you dependencie validators.&amp;quot;Event&amp;quot; stands for some properties of an element (length, valid, intro)as well as the used JavaScript event handler (js_onsubmit,js_onchange) for the element.Using react() you can for example switch off the validationof the RegExp (valid_e, valid_regexp) writing:$formelement-&amp;gt;react(&amp;quot;valid&amp;quot;, false);</description><shortdescription>Defines the events that will be validated.</shortdescription></doc></function><function name="setValue" undoc="false" access="public"><doc><parameter name="$value" type="mixed"/><return type="void"/><description/><shortdescription>Sets the value of the form element.</shortdescription></doc></function><function name="getJSonActivation" undoc="false" access="private"><doc><return name="" type="string"/><description/><shortdescription>Return a JavaScript onChange attribute if strong Javascript validation is active</shortdescription></doc></function><function name="getCommonHTMLAttributes" undoc="false" access="private"><doc><return name="$html" type="string"/><description/><shortdescription>Returns a HTML string with the html attributes shared by all element.</shortdescription></doc></function><function name="getFrozenHiddenElement" undoc="false" access="private"><doc><see type="function">get()</see><parameter name="$value" default="&amp;quot;&amp;quot;" type="mixed">value of the hidden field. If left out $this-&amp;gt;value get used.</parameter><return name="" type="string">HTML hidden field</return><description/><shortdescription>Returns the element as a HTML hidden field.</shortdescription></doc></function><function name="getFrozenTable" undoc="false" access="private"><doc><see type="function">get()</see><parameter name="$border" default="false" type="boolean">&amp;quot;border = 1&amp;quot; to the table?</parameter><parameter name="$value" default="&amp;quot;&amp;quot;" type="mixed">value of the hidden field. If left out $this-&amp;gt;value get used.</parameter><return name="" type="string">HTML table</return><description/><shortdescription>Returns the elements as a HTML table.</shortdescription></doc></function><function name="getJS" undoc="false" access="public"><doc><parameter name="$complex" default="false" type="boolean">JS for form_js_complex.js?</parameter><return name="" type="array"/><description>See form_js_simple.js and form_js_complex.js for details on the JavaScriptvalidation code. This function build a record to &amp;quot;feed&amp;quot; the JavaScript formobject.</description><shortdescription>Returns JavaScript validation code.</shortdescription></doc></function><function name="getJSvalue" undoc="false" access="private"><doc><return name="" type="array"> [JavaScript function code, JavaScript function name]</return><description>Most elements can use document.forms[..].elements[...].value to get thevalue of an element but some need a more sophisticated function. Theseelements must override this function.The JavaScript function provided by this elements should be names &amp;quot;form_elmenttype&amp;quot;,e.g. &amp;quot;form_select&amp;quot;. The (JS) function gets called with two arguments:string formname, string elementname. It returns the value of the element, seeform_element_select for an example.The function returns the JavaScript code itself and a name for the codesnippet that allows the form object to avoid sending the code twice.</description><shortdescription>JavaScript function used to get the value of the element.</shortdescription></doc></function><function name="getExtraJS" undoc="false" access="private"><doc><return name="" type="array"> [JavaScript code, JavaScript code snippet name]</return><description>Some elements need extra JavaScript functionality to befull featured. Date for example is able to draw a &amp;quot;now&amp;quot; button. When theuser clicks this button, the date selectors change their values to thecurrent date. An additional JavaScript function &amp;quot;form_date_now&amp;quot; handles the clickon the button.The function returns the JavaScript code itself and a name for the codesnippet that allows the form object to avoid sending the code twice.</description><shortdescription>Returns additional JavaScript required by some complex form elements.</shortdescription></doc></function><function name="getName" undoc="false" access="public"><doc><return name="$name" type="string"/><description/><shortdescription>Returns the HTML/JavaScript name of the element.</shortdescription></doc></function><function name="isHidden" undoc="false" access="public"><doc><return name="" type="bool"/><description/><shortdescription>Is this a hidden element?</shortdescription></doc></function><variable name="$flag_config_ok" access="public" type="boolean">true<doc><see type="function">checkConfiguration()</see><description/><shortdescription/></doc></variable><variable name="$elname" access="private" type="string">&amp;quot;&amp;quot;<doc><description>Every element can have two names. One &amp;quot;name&amp;quot; usedin the generated HTML and one &amp;quot;alias&amp;quot; &amp;quot;elname&amp;quot;.&amp;quot;elname&amp;quot; was introduced to access a singleradio element in a group of radio elements.Each element of that group has the same &amp;quot;name&amp;quot; (HTML)an can have a unique (form wide) &amp;quot;alias&amp;quot; elname.</description><shortdescription>Alias name of the element.</shortdescription></doc></variable><variable name="$name" access="private" type="string">&amp;quot;&amp;quot;<doc><description>Make sure that the name of select multipleelements end with a pair of empty square brackets &amp;quot;[]&amp;quot;.</description><shortdescription>HTML name attribute of the element.</shortdescription></doc></variable><variable name="$value" access="private" type="string">&amp;quot;&amp;quot;<doc><description/><shortdescription>Value of the element.</shortdescription></doc></variable><variable name="$additional_html" access="private" type="string">&amp;quot;&amp;quot;<doc><description>The string will be added to the generated HTML without any validation.</description><shortdescription>Additional HTML attributes.</shortdescription></doc></variable><variable name="$frozen" access="private" type="boolean">false<doc><description/><shortdescription>Is the element frozen?</shortdescription></doc></variable><variable name="$class" access="private" type="string">&amp;quot;&amp;quot;<doc><description/><shortdescription>HTML/CSS class attribute.</shortdescription></doc></variable><variable name="$id" access="private" type="string">&amp;quot;&amp;quot;<doc><description/><shortdescription>HTML/CSS id attribute.</shortdescription></doc></variable><variable name="$style" access="private" type="string">&amp;quot;&amp;quot;<doc><description/><shortdescription>HTML/CSS style attribute</shortdescription></doc></variable><variable name="$shared_required_fields" access="private" type="array">array ( &#x0a;																				&amp;quot;type&amp;quot; 	=&amp;gt; &amp;quot;string&amp;quot;,&#x0a;																				&amp;quot;name&amp;quot;	=&amp;gt; &amp;quot;string&amp;quot;&#x0a;																		)<doc><see type="var">$required_fields</see><see type="var">$shared_optional_fields</see><see type="function">checkConfiguration()</see><description>Have a look at checkConfiguration() for more informationon debugging form elements.</description><shortdescription>List of required fields every element needs and their type.</shortdescription></doc></variable><variable name="$required_fields" access="private" type="array">array()<doc><see type="var">$shared_required_fields</see><see type="var">$optional_fields</see><description/><shortdescription>List of required fields provided by a derived class.</shortdescription></doc></variable><variable name="$shared_optional_fields" access="private" type="array">array (&#x0a;																				&amp;quot;value&amp;quot; 					=&amp;gt; &amp;quot;mixed&amp;quot;,&#x0a;																				&amp;quot;elname&amp;quot;					=&amp;gt; &amp;quot;string&amp;quot;,&#x0a;																				&amp;quot;additional_html&amp;quot;	=&amp;gt; &amp;quot;string&amp;quot;,&#x0a;																				&#x0a;																				&amp;quot;validator&amp;quot;				=&amp;gt; &amp;quot;string&amp;quot;,&#x0a;																				&amp;quot;js_validator&amp;quot;		=&amp;gt; &amp;quot;string&amp;quot;,&#x0a;																				&#x0a;																				&amp;quot;frozen&amp;quot;					=&amp;gt; &amp;quot;boolean&amp;quot;,&#x0a;																				&#x0a;																				&amp;quot;class&amp;quot;						=&amp;gt; &amp;quot;string&amp;quot;,&#x0a;																				&amp;quot;id&amp;quot;							=&amp;gt; &amp;quot;string&amp;quot;,&#x0a;																				&amp;quot;style&amp;quot;						=&amp;gt; &amp;quot;string&amp;quot;										&#x0a;																)<doc><see type="var">$optional_fields</see><see type="var">$shared_required_fields</see><see type="function">checkConfiguration()</see><description>Have a look at checkConfiguration() for more informationon debugging form elements.</description><shortdescription>List of optional fields and their type.</shortdescription></doc></variable><variable name="$optional_fields" access="private" type="array">array()<doc><see type="var">$shared_optional_fields</see><see type="var">$required_fields</see><description/><shortdescription>List of optional fields provided by a derived class.</shortdescription></doc></variable><variable name="$method" access="private" type="string">&amp;quot;&amp;quot;<doc><description/><shortdescription>Method (POST|GET) used in the form.</shortdescription></doc></variable><variable name="$val_events" access="private" type="array">array(	&#x0a;												&amp;quot;length&amp;quot;			=&amp;gt; true, &#x0a;												&amp;quot;valid&amp;quot;				=&amp;gt; true, &#x0a;												&amp;quot;intro&amp;quot;				=&amp;gt; true&#x0a;											)<doc><description/><shortdescription>Check for ... errors.</shortdescription></doc></variable><variable name="$js_mode" access="private" type="string">&amp;quot;&amp;quot;<doc><description>&amp;quot;weak&amp;quot; =&amp;gt; onSubmit or &amp;quot;strong&amp;quot; =&amp;gt; onChange/onClick.</description><shortdescription>JavaScript validation mode.</shortdescription></doc></variable><variable name="$form_name" access="private" type="string">&amp;quot;&amp;quot;<doc><description/><shortdescription>Name of the form that contains the element.</shortdescription></doc></variable><variable name="$validator" access="private" type="string">&amp;quot;&amp;quot;<doc><description>The function is part of MyForm.</description><shortdescription>Name of a custom validation function provided by the user.</shortdescription></doc></variable><variable name="$js_validator" access="private" type="string">&amp;quot;&amp;quot;<doc><description/><shortdescription>Custom JavaScript validator.</shortdescription></doc></variable><inherited src="form_commonobject" type="functions"><element>introspection</element></inherited><inherited src="form_commonobject" type="variables"><element>$cr_html</element><element>$exceptions</element></inherited><path><parent>form_commonobject</parent></path><baseclass>form_commonobject</baseclass><subclasses><subclass>form_element_buttonobject</subclass><subclass>form_element_checkobject</subclass><subclass>form_element_selectobject</subclass><subclass>form_element_date</subclass><subclass>form_element_hidden</subclass><subclass>form_element_textobject</subclass><subclass>form_element_tree</subclass></subclasses></class></phpdoc>