Class TimeField

Description

a textfield widget designed to handle time date

Located in /inc/formslib/timefield.php (line 37)

Field
   |
   --TimeField
Variable Summary
Method Summary
TimeField TimeField (string $name, [string $longname = ''], [string $description = ''])
void displayInTable ([ $cols = 3])
string getDisplay ()
void isValid ()
void selectable ()
void set ( $value)
void setDateTime (string $time)
void setManualRepresentation (integer $flag)
void setSlots (TimeSlotRule $list)
void setSlotStart (string $date)
void setTime (string $time)
string sqlSetStr ([ $name = ''], [ $force = false])
boolean update (array $data)
void _findExactSlot ()
void _fixedTimeSlots ()
string _makeHiddenSwitch (string $id1, string $id2)
string _prepareFreeField ([string $append = ''], [string $hidden = false])
Variables
DropList $droplist (line 53)
  • var: DropList object for dropdown list representation of the field
boolean $editableOutput = 1 (line 55)
  • var: is the time *really* editable ... ?? FIXME
boolean $extendDropDown = true (line 59)
  • var: go beyond the end of the slots that are part of a group for booking
boolean $isStart (line 43)
  • var: field is the start time of a slot object
TimeSlotRule $list (line 41)
  • var: rules for the times that are permitted
SimpleDate $maxDateDropDown = null (line 63)
  • var: max date for the dropdown to go to
integer $maxPeriodDropDown = 86400 (line 61)
  • var: max period to be included in the dropdown in seconds
integer $maxSlotsDropDown = 20 (line 57)
  • var: maximum number of booking slots to include in the dropdown
integer $representation (line 49)
  • var: how this field is to be rendered (see TF_* options)
TimeSlot $slot (line 47)
  • var: the actual time slot to which this time is associated
SimpleDate $slotStart (line 45)
  • var: the date on which this time is located
SimpleTime $time (line 39)
  • var: time object for this field
integer $_manualRepresentation = TF_AUTO (line 51)
  • var: force this field to be rendered in a particular way (see TF_* options)

Inherited Variables

Inherited from Field

Field::$attr
Field::$changed
Field::$DEBUG
Field::$defaultValue
Field::$description
Field::$duplicateName
Field::$editable
Field::$errorclass
Field::$hidden
Field::$isValid
Field::$isValidTest
Field::$longname
Field::$name
Field::$namebase
Field::$notifyIdChange
Field::$oob_errorMessage
Field::$oob_status
Field::$ovalue
Field::$required
Field::$requiredTwoStage
Field::$sqlHidden
Field::$suppressValidation
Field::$useNullValues
Field::$value
Field::$valueCleaner
Methods
Constructor TimeField (line 72)

Create a new field object, designed to be superclasses

TimeField TimeField (string $name, [string $longname = ''], [string $description = ''])
  • string $name: the name of the field (db name, and html field name
  • string $longname: long name to be used in the label of the field in display
  • string $description: used in the html title or longdesc for the field
displayInTable (line 79)
void displayInTable ([ $cols = 3])
  • $cols

Redefinition of:
Field::displayInTable()
render this form widget in an html table
getDisplay (line 97)

render the HTML version of the widget

string getDisplay ()
isValid (line 403)

isValid test (extend Field::isValid), looking at whether the string parsed OK

void isValid ()

Redefinition of:
Field::isValid()
Check the validity of the current data value.
selectable (line 112)
void selectable ()

Redefinition of:
Field::selectable()
return an html representation of the widget
set (line 319)

overload the parent's set() method as we need to do some extra processing

void set ( $value)
  • $value

Redefinition of:
Field::set()
set the value of this field
setDateTime (line 350)

Set the time (and value) from a Date-Time string

void setDateTime (string $time)
  • string $time: a date-time string (YYYY-MM-DD HH:MM:SS)
setManualRepresentation (line 155)

set the representation of this field

void setManualRepresentation (integer $flag)
  • integer $flag: (TF_* types from class TimeField constants)
setSlots (line 373)

associate a TimeSlotRule for validation of the times that we are using

void setSlots (TimeSlotRule $list)
setSlotStart (line 383)

set the appropriate date that we are refering to for the timeslot rule validation

void setSlotStart (string $date)
  • string $date: passed to the TimeSlotRule
setTime (line 362)

Set the time (and value)

void setTime (string $time)
  • string $time: a time string (HH:MM)
sqlSetStr (line 415)

return a SQL-injection-cleansed string that can be used in an SQL UPDATE or INSERT statement. i.e. "name='Stuart'".

  • return: in SQL assignable form
string sqlSetStr ([ $name = ''], [ $force = false])
  • $name
  • $force

Redefinition of:
Field::sqlSetStr()
create an SQL-injection-cleansed string for db statements
update (line 335)

overload the parent's update method so that local calculations can be performed

  • return: the value was updated
boolean update (array $data)
  • array $data: html_name => value pairs

Redefinition of:
Field::update()
update the value of the object with the user-supplied data in $data
_determineRepresentation (line 163)

Determine what sort of representation is appropriate

void _determineRepresentation ()
_findExactSlot (line 387)
void _findExactSlot ()
_fixedTimeSlots (line 304)

determine if a dropdown list appropriate here?

  • access: private
void _fixedTimeSlots ()
_makeHiddenSwitch (line 281)

Convert a string into a js link that controls the behaviour of another div

  • return: html for js link
  • access: private
string _makeHiddenSwitch (string $id1, string $id2)
  • string $id1: default shown element
  • string $id2: default hidden element
_prepareDropDown (line 201)

Calculate data for the dropdown list of permissible times

  • access: private
void _prepareDropDown ()
_prepareFreeField (line 263)

Free-form field entry

  • return: html for field
  • access: private
string _prepareFreeField ([string $append = ''], [string $hidden = false])
  • string $append: append this to the name of the input (optional)
  • string $hidden: show this as hidden by default

Inherited Methods

Inherited From Field

Field::Field()
Field::display()
Field::displayInTable()
Field::getValue()
Field::hidden()
Field::isValid()
Field::log()
Field::selectable()
Field::selectedValue()
Field::set()
Field::setattr()
Field::setEditable()
Field::setNamebase()
Field::sqlSetStr()
Field::text_dump()
Field::update()
Field::__clone()

Documentation generated on Tue, 06 Mar 2007 10:02:02 +0000 by phpDocumentor 1.3.0