[ Index ]
 

Code source de eGroupWare 1.2.106-2

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/etemplate/inc/ -> class.date_widget.inc.php (sommaire)

(pas de description)

Poids: 558 lignes (19 kb)
Inclus ou requis:0 fois
Référencé: 0 fois
Nécessite: 0 fichiers

Définit 1 class

date_widget:: (4 méthodes):
  date_widget()
  pre_process()
  pre_process_duration()
  post_process()


Classe: date_widget  - X-Ref

eTemplate extension to input or display date and/or time values

Contains the following widgets: Date, Date+Time, Time, Hour, Duration

Supported attributes: format[,options]
format: ''=timestamp, or eg. 'Y-m-d H:i' for 2002-12-31 23:59
options: &1 = year is int-input not selectbox, &2 = show a [Today] button, (html-UI always uses jscal and dont care for &1+&2)
&4 = 1min steps for time (default is 5min, with fallback to 1min if value is not in 5min-steps),
&8 = dont show time for readonly and type date-time if time is 0:00,
&16 = prefix r/o display with dow

This widget is independent of the UI as it only uses etemplate-widgets and has therefor no render-function.
Uses the adodb datelibary to overcome the windows-limitation to not allow dates before 1970

date_widget($ui)   X-Ref
Constructor of the extension

param: string $ui '' for html

pre_process($name,&$value,&$cell,&$readonlys,&$extension_data,&$tmpl)   X-Ref
pre-processing of the extension

This function is called before the extension gets rendered

param: string $name form-name of the control
param: mixed &$value value / existing content, can be modified
param: array &$cell array with the widget, can be modified for ui-independent widgets
param: array &$readonlys names of widgets as key, to be made readonly
param: mixed &$extension_data data the extension can store persisten between pre- and post-process
param: object &$tmpl reference to the template we belong too
return: boolean true if extra label is allowed, false otherwise

pre_process_duration($name,&$value,&$cell,&$readonlys,&$extension_data,&$tmpl)   X-Ref
pre-processing of the duration extension

Options contain $data_format,$input_format,$hours_per_day,$empty_not_0,$short_labels
1. data_format: d = days, h = hours, m = minutes, default minutes
2. input_format: d = days, h = hours, m = minutes,  default hours+days (selectbox), optional % = allow to enter a percent value (no conversation)
3. hours_per_day: default 8 (workday)
4. should the widget differ between 0 and empty, which get then returned as NULL
5. short_labels use d/h/m instead of day/hour/minute

param: string $name form-name of the control
param: mixed &$value value / existing content, can be modified
param: array &$cell array with the widget, can be modified for ui-independent widgets
param: array &$readonlys names of widgets as key, to be made readonly
param: mixed &$extension_data data the extension can store persisten between pre- and post-process
param: object &$tmpl reference to the template we belong too
return: boolean true if extra label is allowed, false otherwise

post_process($name,&$value,&$extension_data,&$loop,&$tmpl,$value_in)   X-Ref
postprocessing method, called after the submission of the form

It has to copy the allowed/valid data from $value_in to $value, otherwise the widget
will return no data (if it has a preprocessing method). The framework insures that
the post-processing of all contained widget has been done before.

Only used by select-dow so far

param: string $name form-name of the widget
param: mixed &$value the extension returns here it's input, if there's any
param: mixed &$extension_data persistent storage between calls or pre- and post-process
param: boolean &$loop can be set to true to request a re-submision of the form/dialog
param: object &$tmpl the eTemplate the widget belongs too
param: mixed &value_in the posted values (already striped of magic-quotes)
return: boolean true if $value has valid content, on false no content will be returned!



Généré le : Sun Feb 25 17:20:01 2007 par Balluche grâce à PHPXref 0.7