JSCalendar Class Reference

List of all members.

Public Member Functions

 JSCalendar ()
getInstance ()
 render ($value, $name= '', $calImg= '', $helpImg= '')
 renderImages ($calImg= '', $helpImg= '')
 setConfigOption ($option, $value, $nonString=false)
 setInputField ($field)
 getInputField ()
 setLanguage ($lang='')
 setCSS ($calendarCSS= 'aqua')
 setNLP ($mode)
 setDateFormat ($time=false)
 getConfigJS ()
 getMainJS ()
 languageCheck ($lang)

Public Attributes

 $config = array()
 $jsSent = false
 $lang = null


Detailed Description

JSCalendar Widget

Author:
Stefan Galinski <stefan.galinski@gmail.com>

Definition at line 30 of file class.jscalendar.php.


Member Function Documentation

JSCalendar.JSCalendar (  ) 

Constructor

Todo:
the natural language parser should be rewritten for i18n, time support and readability

the problem with nlp and irre needs to be fixed

Returns:
void

Definition at line 49 of file class.jscalendar.php.

References setConfigOption(), setCSS(), setDateFormat(), setLanguage(), and setNLP().

Referenced by getInstance().

& JSCalendar.getInstance (  ) 

Creates a singleton instance of JSCalendar. Its important to use only this funcion than a direct initialization of the class! You can use this method via a static call.

Returns:
object instance of JSCalendar

Definition at line 74 of file class.jscalendar.php.

References JSCalendar().

Referenced by tx_date2cal_wizard.renderWizard().

JSCalendar.render ( value,
name = '',
calImg = '',
helpImg = '' 
)

Renders an whole calendar input element. The name and id of the checkbox will be prefixed with _cb. The id of the input field will be prefixed with _hr. If you haven't defined the input field then it will be named "date". Please define the input field if you have multiple calendars on the page.

See also:
renderImage()
Parameters:
string $value default value of the input field element
string $name name (default is inputField coniguration setting) of the input and checkbox field (prefixed with _cb)
string $calImg calendar image (optional)
string $helpImg help image (optional)
Returns:
string generated calendar images

Definition at line 94 of file class.jscalendar.php.

References renderImages(), and setInputField().

JSCalendar.renderImages ( calImg = '',
helpImg = '' 
)

Renders the image buttons of the calendar (= trigger) and the help button. Both images values can fallback to the default ones if you don't want to define them.

Parameters:
string $calImg calendar image (optional)
string $helpImg help image (optional)
Returns:
string generated calendar images

Definition at line 125 of file class.jscalendar.php.

References getConfigJS().

Referenced by render().

JSCalendar.setConfigOption ( option,
value,
nonString = false 
)

Sets a config option of the calendar.

Official documentation of the JSCalendar options: http://www.dynarch.com/demos/jscalendar/doc/html/reference.html#node_sec_2.3

Parameters:
string $option name of the option
string $value value of the option
bool $nonString set this option if you want to set a boolean or integer
Returns:
void

Definition at line 166 of file class.jscalendar.php.

Referenced by JSCalendar(), setDateFormat(), and setInputField().

JSCalendar.setInputField ( field  ) 

Sets the input field of the calendar. You doesn't need to set an input id if you want an automatic generation of the input field via the render function. Please don't try this for multiple instances on the same page!

Parameters:
string $field special input field (will be prefixed with _hr)
Returns:
void

Definition at line 178 of file class.jscalendar.php.

References setConfigOption().

Referenced by render().

JSCalendar.getInputField (  ) 

Returns the input field.

Returns:
string input field

Definition at line 189 of file class.jscalendar.php.

JSCalendar.setLanguage ( lang = ''  ) 

Sets the language of the calendar. Includes availability checks and fallback modes for frontend and backend.

Parameters:
string $lang language (let it empty for automatic detection)
Returns:
void

Definition at line 200 of file class.jscalendar.php.

References $lang, and languageCheck().

Referenced by JSCalendar().

JSCalendar.setCSS ( calendarCSS = 'aqua'  ) 

Sets the calendar css. Includes an availability check with a fallback to the aqua theme.

Parameters:
string $calendarCSS calendar css file (default: aqua)
Returns:
void

Definition at line 219 of file class.jscalendar.php.

Referenced by JSCalendar().

JSCalendar.setNLP ( mode  ) 

Sets the natural language parser mode. Additionaly it checks the TYPO3 version, because the feature can only be used with TYPO3 >= 4.1.

Parameters:
bool $mode calendar with natural language parser mode (true)
Returns:
void

Definition at line 232 of file class.jscalendar.php.

Referenced by JSCalendar().

JSCalendar.setDateFormat ( time = false  ) 

Sets the date format of the calendar. You can't influence the format at the moment. It will be automatically created to the value "%d-%m-%Y" or "%m-%d-%y" with the US setting of TYPO3.

Parameters:
bool $time set this option if you want to define the time
Returns:
void

Definition at line 246 of file class.jscalendar.php.

References setConfigOption().

Referenced by JSCalendar().

JSCalendar.getConfigJS (  ) 

Returns the javascript configuration code for a single calendar instance.

Returns:
string javascript code

Definition at line 262 of file class.jscalendar.php.

References $config.

Referenced by renderImages().

JSCalendar.getMainJS (  ) 

Returns the shared javascript code for all calendar instances. The function can only be called once!

Returns:
string javascript code

Definition at line 301 of file class.jscalendar.php.

JSCalendar.languageCheck ( lang  ) 

Checks the availability of a language file. The functions attends utf8 compatibility in the backend.

Note that the language code would be transformed into an iso code if possible. If no translation file matches than the function returns english as fallback.

Parameters:
string $lang language code
Returns:
string language (appended with -utf8, fallback or same as input)

Definition at line 345 of file class.jscalendar.php.

References $lang.

Referenced by setLanguage().


Member Data Documentation

JSCalendar.$config = array()

array configuration

Definition at line 33 of file class.jscalendar.php.

Referenced by getConfigJS().

JSCalendar.$jsSent = false

bool prevents the object to generate the initialization javascript twice

Definition at line 36 of file class.jscalendar.php.

JSCalendar.$lang = null

object holds the language object

Definition at line 39 of file class.jscalendar.php.

Referenced by languageCheck(), and setLanguage().


The documentation for this class was generated from the following file:
Generated on Thu Mar 20 21:55:20 2008 for date2cal by  doxygen 1.5.3