Packageindex Classtrees Modulegroups Elementlist Report XML Files
 
File: c:/www/apache/doc2//form/form_element_date.inc
PHPLib Form Rewrite 2001/03/01 - Form

form_element_date

form_commonobject
   |
  +-- form_element
     |
    +-- form_element_date

Takes a date() format string and renders several select boxes to enter a date and/or time

 

private class form_element_date extends form_element

Takes a date() format string and renders several select boxes to enter a date and/or time
Use this meta element to make sure that the user enters a valid date.

AuthorsUlf Wendel <uw@netuse.de>
Version$Id: $

 

Methods inherited from form_element

form_element, checkconfiguration, gettype, isbutton, getvalidator, setvalidator, freeze, unfreeze, thawout, getfrozen, show, validate, validatelength, validateregex, dovalidation, react, setvalue, getcommonhtmlattributes, getfrozenhiddenelement, getfrozentable, getjs, getname, ishidden

Methods inherited from form_commonobject

introspection

Private Method Summary

void

setup()

Initializes $max_year_long and $max_year_short.Warning: documentation is missing.
array

getValue()

Returns an array with the values of the selected date.Warning: documentation is missing.
string

generateSelect(string $name)

Generates a select box.
void

getJSonActivation(string $name)

Warning: documentation is missing.
void

get([ string $value ])

Returns the HTML code of the element.Warning: documentation is missing.
void

generateButton()

Warning: documentation is missing.
void

getPreloadValue( $name)

Warning: documentation is missing.
void

getJSvalue()

JavaScript function used to get the value of the element.Warning: documentation is missing.
void

form_date()

Warning: documentation is missing.
void

getExtraJS()

Returns additional JavaScript required by some complex form elements.Warning: documentation is missing.
void

form_date_now()

Warning: documentation is missing.

Fields inherited from form_element

$flag_config_ok, $elname, $name, $value, $additional_html, $frozen, $class, $id, $style, $shared_required_fields, $shared_optional_fields, $method, $val_events, $js_mode, $form_name, $validator, $js_validator

Fields inherited from form_commonobject

$cr_html, $exceptions

Private Field Summary

string

$format

String describing the format of the date/time that you can enter.
string

$language

Language used in the generated select boxes.
integer

$min_year_long

First year of a date("Y") selector.
integer

$max_year_long

Last year of a date("Y") selector.
integer

$min_year_short

First year of a date("y") selector.
integer

$max_year_short

Last year of a date("y") selector.
string

$intro

Intro option.
string

$intro_e

Intro option error message.
boolean

$preload

Preload selectors with the current date?
string

$now

Add a Submit button that allows the user to preload with the current date?
array

$options

Word translation mapping.
array

$required_fields

List of required fields provided by a derived class.
array

$optional_fields

List of optional fields provided by a derived class.

Private Method Details

setup

private void setup( )

  Initializes $max_year_long and $max_year_short.

Warning: documentation is missing.

Returns void

See Also $max_year_long, $max_year_short

getValue

private array getValue( )

  Returns an array with the values of the selected date.
The assoziative array is indexed by the format string characters.

Warning: documentation is missing.

Returns array


generateSelect

private string generateSelect( string $name )

  Generates a select box.

Parameter
string $name
select tag name attribute
Returns string

HTML


getJSonActivation

private void getJSonActivation( string $name )

 

Warning: documentation is missing.

Parameter
string $name
Suffix
Returns void


get

private void get( [ string $value ] )

  Returns the HTML code of the element.

Warning: documentation is missing.

Parameter
string $value = >>""<<
The value is only used with radio buttons.
If the given value is equal to the value of the
element when it was defined, the radio gets selected.
Returns void

See Also getfrozen(), show()

generateButton

private void generateButton( )

 

Warning: documentation is missing.

Returns void


getPreloadValue

private void getPreloadValue( $name )

 

Warning: documentation is missing.

Parameter
$name
Warning: documentation is missing.
Returns void


getJSvalue

private void getJSvalue( )

  JavaScript function used to get the value of the element.
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 "form_elmenttype",e.g. "form_select". 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.

Warning: documentation is missing.

Returns void


form_date

private void form_date( )

 

Warning: documentation is missing.

Returns void


getExtraJS

private void getExtraJS( )

  Returns additional JavaScript required by some complex form elements.
Some elements need extra JavaScript functionality to befull featured. Date for example is able to draw a "now" button. When theuser clicks this button, the date selectors change their values to thecurrent date. An additional JavaScript function "form_date_now" 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.

Warning: documentation is missing.

Returns void


form_date_now

private void form_date_now( )

 

Warning: documentation is missing.

Returns void


Private Field Details

$format

private string $format

>>""<<

String describing the format of the date/time that you can enter.
The format string implements most of the features date() offers.


$language

private string $language

>>"en"<<

Language used in the generated select boxes.


$min_year_long

private integer $min_year_long

>>1990<<

First year of a date("Y") selector.

See Also setup()

$max_year_long

private integer $max_year_long

>>2010<<

Last year of a date("Y") selector.


$min_year_short

private integer $min_year_short

>>90<<

First year of a date("y") selector.

See Also setup()

$max_year_short

private integer $max_year_short

>>10<<

Last year of a date("y") selector.


$intro

private string $intro

>>""<<

Intro option.


$intro_e

private string $intro_e

>>""<<

Intro option error message.


$preload

private boolean $preload

>>false<<

Preload selectors with the current date?


$now

private string $now

>>""<<

Add a Submit button that allows the user to preload with the current date?


$options

private array $options

>>array ( "en" => array ( "weekdays_short" => array ("Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun" ), "weekdays_long" => array( "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"), "months_short" => array ( "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ), "months_long" => array( "January", "February", "March", "April", "May", "June", "Juli", "August", "September", "October", "November", "December" ) ), "de" => array ( "weekdays_short" => array ( "Mon", "Di", "Mi", "Do", "Fr", "Sa", "So"), "weekdays_long" => array ( "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag", "Sonntag"), "months_short" => array ( "Jan", "Feb", "März", "April", "Mai", "Juni", "Juli", "Aug", "Sept", "Okt", "Nov", "Dez"), "months_long" => array( "Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember" ) ) )<<

Word translation mapping.


$required_fields

private array $required_fields

>>array ( "format" => "string" )<<

List of required fields provided by a derived class.

See Also $shared_required_fields, $optional_fields

$optional_fields

private array $optional_fields

>>array ( "now" => "string", "preload" => "boolean", "language" => "string", "intro" => "string", "intro_e" => "string", "min_year_long" => "integer", "max_year_long" => "integer", "min_year_short" => "integer", "max_year_short" => "integer" )<<

List of optional fields provided by a derived class.

See Also $shared_optional_fields, $required_fields


Packageindex Classtrees Modulegroups Elementlist Report XML Files
PHPDoc 1.0beta