Sitellite Application Framework
Class Tree         Index         All Elements

Class: MF_Widget_calendar

Source Location: Program_Root/MailForm/Widget/Calendar.php

Class Overview

MF_Widget
   |
   --MF_Widget_calendar

Calendar widget. Displays a text box with a Javascript calendar popup to select dates. The format of the date can also be specified, but the default is YYYY-MM-DD.


Author(s)

Version

  • 1.2, 2003-11-06, $Id: Calendar.php,v 1.3 2007/01/17 21:08:26 lux Exp $

Copyright

  • Copyright (C) 2001-2003, Simian Systems Inc.

Variables

Methods


Inherited Variables

Inherited Methods

Class: MF_Widget

MF_Widget::MF_Widget()
Constructor Method.
MF_Widget::addRule()
Adds a validation rule to the list of $rules.
MF_Widget::attr()
This is the accessor method for setting and getting the value of
MF_Widget::changeType()
MF_Widget::display()
Returns the display HTML for this widget. The optional parameter determines whether or not to automatically display the widget nicely, or whether to simply return the widget (for use in a template).
MF_Widget::getAttrs()
Returns a list of all of the attributes of this object's HTML tag in a string ready to be concatenated into the actual rendered tag output.
MF_Widget::getValue()
Fetches the actual value for this widget.
MF_Widget::invalid()
Returns a ' class="invalid"' string if the widget's $invalid property is set to true, or an empty string otherwise.
MF_Widget::setDefault()
Sets the default value for the widget.
MF_Widget::setValue()
Sets the *ACTUAL* value for this widget. An optional second parameter can be passed, which is unused here, but can be used in complex widget types to assign parts of a value and piece it together from multiple physical form fields.
MF_Widget::setValues()
Sets the *POSSIBLE* values for this widget. If $value is given, sets $this->value as a hash, otherwise, as a string.
MF_Widget::unsetAttr()
Use this method to remove an attribute from the tag
MF_Widget::validate()
Validates the widget against its set of $rules. Returns false on failure to pass any rule.
MF_Widget::validation()
Sets the validation $rule for this widget. Note: This method is deprecated and only wraps around the addRule() method anyway. Please use addRule() instead, since this method will be removed in a near-future release.

Class Details

[line 54]
Calendar widget. Displays a text box with a Javascript calendar popup to select dates. The format of the date can also be specified, but the default is YYYY-MM-DD.

The Javascript from this widget is based on the DHTML Calendar project at http://students.infoiasi.ro/~mishoo/site/calendar.epl

New in 1.2:

  • Updated to work with the DHTML Calendar version 0.9.4 and up.

1 <?php
2
3 $widget = new MF_Widget_calendar ('name');
4 $widget->setFormat ('y/m/d');
5 echo $widget->display ();
6
7 ? >




Tags:

access:  public
version:  1.2, 2003-11-06, $Id: Calendar.php,v 1.3 2007/01/17 21:08:26 lux Exp $
license:  http://www.sitellite.org/index/license
copyright:  Copyright (C) 2001-2003, Simian Systems Inc.
author:  John Luxford <mailto:lux@simian.ca>


[ Top ]


Class Variables

$displayFormat =  '%a, %e %b, %Y'

[line 88]

This determines the format of the date displayed to the user.



Tags:

access:  public

Type:   mixed


[ Top ]

$extra =  ''

[line 62]

A way to pass extra parameters to the HTML form tag, for example 'enctype="multipart/formdata"'.



Tags:

access:  public

Type:   mixed


[ Top ]

$format =  '%Y-%m-%d'

[line 80]

This determines the format of the date stored in the hidden field, and also the format submitted by the form widget.



Tags:

access:  public

Type:   mixed


[ Top ]

$lang =  'en'

[line 98]

This determines the language file to load for the calendar user interface. See the folder /js/calendar/lang for a list of available languages.



Tags:

access:  public

Type:   mixed


[ Top ]

$showsTime =  false

[line 118]

Determines whether to show the time selection options under the calendar.



Tags:

access:  public

Type:   mixed


[ Top ]

$style =  'sitellite'

[line 109]

This determines the stylesheet to load for the calendar user interface. See the CSS files in the folder /js/calendar for a list of available stylesheets, or information on writing your own.



Tags:

access:  public

Type:   mixed


[ Top ]

$timeFormat =  '12'

[line 127]

Sets the display time to 24 hours, or 12 hours with AM/PM option.

The default is 12 hours.




Tags:

access:  public

Type:   mixed


[ Top ]

$type =  'calendar'

[line 71]

This is the short name for this widget. The short name is the class name minus the 'MF_Widget_' prefix.



Tags:

access:  public

Type:   mixed
Overrides:   Array


[ Top ]



Class Methods


constructor MF_Widget_calendar [line 136]

MF_Widget_calendar MF_Widget_calendar( string $name)

Constructor Method.



Tags:

access:  public


Parameters:

string   $name  

[ Top ]

method display [line 226]

string display( [boolean $generate_html = 0])

Returns the display HTML for this widget. The optional parameter determines whether or not to automatically display the widget nicely, or whether to simply return the widget (for use in a template).



Tags:

access:  public


Overrides MF_Widget::display() (Returns the display HTML for this widget. The optional parameter determines whether or not to automatically display the widget nicely, or whether to simply return the widget (for use in a template).)

Parameters:

boolean   $generate_html  

[ Top ]

method displayValue [line 141]

void displayValue( )



[ Top ]

method js2phpFormat [line 150]

void js2phpFormat( mixed $date)



[ Top ]


Copyright © 2007, SIMIAN systems Inc.
All rights reserved. Privacy policy
Documentation generated on Tue, 13 Feb 2007 17:17:01 -0600 by Sitellite AppDoc and phpDocumentor 1.2.2