Calendar DTML Tag

  Renders a calendar user interface.  The template code is executed to
  render the individual day cells. The template is called with several
  predefined variables.

  See author and license information at the end of this file.

  Usage::

    <dtml-calendar [args]>
      template code
    </dtml-calendar>

Variables

  date (date) --
    date to be rendered by the template.

  mode (string 'day', 'week', 'month' or 'year') --
    mode in which the display is currently operating.

  firstday (bool) --
    true if this is the first time the template
    is being rendered for this calendar, false otherwise.

  linkDate(date[, mode])   (callback function) --
    returns a url for the current page with the current calendar set to
    the given date and in the given mode (mode defaults to 'day').
    This is for the convenience of the rendering template for things
    like linking from a given day in the month mode to the day-mode
    display for that day.

  getCalendar(name[, defval]):   (callback function) --
    Returns the given rendering property of the calendar, or defval
    (default NULL) if there is no such property.

  setCalendar(name, val):   (callback function) --
    Sets the given rendering property of the calendar.

Properties

  leftfgcolor --
    color of text in left part of header (where the
    date or date range is shown).  Default is the overall bgcolor.

  leftbgcolor --
    background color on left part of header. Default
    is black ('000000').

  middlebgcolor --
    background color of middle of header (where the
    day/week/month buttons are). Defaults to overall bgcolor.

  rightbgcolor --
    background color of right part of header (where
    arrows are). Defaults to overall bgcolor.

  cellbgcolor --
    background color of current day (defaults to overall
    bgcolor).

  daybgcolor --
    background color of the day headers, in week, month and
    year modes (defaults to overall bgcolor).

  mhbgcolor --
    background color of the month headers, in year mode

  align --
    day's table horizontal cell alignment, default none.

  valign --
    day's table vertical cell alignment, default none.

  left (string) --
    text of left of header. Defaults to date or date range.

  middle (string) --
    text of middle of header. Defaults to the mode
    buttons.

  right (string) --
    text of right of header. Defaults to arrows with
    rightmiddle inbetween.

  rightmiddle (string) --
    text between arrows in right of header.
    Defaults to day buttons, week number, or blank, depending on mode.

  daynames --
    in week, month and year modes, the name of the day headers.
    ignored in day mode. Value is either None (don't display headers),
    a 7 character string (default, value 'SMTWTFS'), or a 7 element
    list or tuple containing string names for the days.

  bordercolor --
    the color of the border and lines drawn around the
    calendar elements.  Defaults to '000000'.

  spacing --
    the spacing between the calendar cells.  This also controls
    the width of the border drawn in 'bordercolor'.  Defaults to 2.

  padding --
    the padding within the calendar cells.  Defaults to 4.

  cellattrs --
    List of attributes for the day cells.
    Example:
      setCalendar('cellattrs', (('CLASS','day'), ('ID','today')))


Arguments

  name (string) --
    name of the calendar instance, used for the query
    string names.  Default is 'calendar'. Two instances on the same
    page may share the same name, but if so their controls will be
    locked together -- they will display the same date and mode always.

  expr (string expr) --
    expression that evaluates to the name of the calendar instance.
    It's used instead of the name argument.

  modes (string) --
    a comma separated list of the allowed modes.
    Default: day,week,month,year

  mode (string 'day', 'week', 'month' or 'year') --
    default mode to display in
    if unspecified by user.

  date (string expr) --
    if supplied, evaluates to the date to show by
    default.

  bgcolor (string) --
    background color. Foreground color is always black.
    Default white ('ffffff').

  bgcolor_expr (string expr) --
    background color. To be used instead of "bgcolor" to set
    the background color dynamically.

  tablewidth (string) --
    specifies the width of the calendar.
    By default, there's no tablewidth

  controls (string 'yes' or 'no') --
    if set to 'yes' (the default) shows a control bar

  weekdays (string) --
    used in week, month and year modes, ignored in day mode. Value
    is a 2 character string (default '07'), the first one specifies
    the first week day to show, the second one specifies the number
    of week days to show. For instance '15' shows "Monday, Tuesday,
    Wednesday, Thursday and Friday".

  lang (string) --
    the language to be used

  lang_expr (string expr) --
    the language to be used

  images (string yes or no)
   if set to yes (the default), shows the control bar with images.
   If set to no, shows the control bar as text in the appropriate
   language.

  theme (string) --
    Uses a different selection of backgrounds
    Optional. Currently only "yb" is valid

Author and License


  Copyright (c) 1998-1999 Endicor Technologies, Inc.
  All rights reserved. Written by Ty Sarna &lt;tsarna@endicor.com&gt;

  Redistribution and use in source and binary forms, with or without
  modification, are permitted provided that the following conditions
  are met:

    1. Redistributions of source code must retain the above copyright
       notice, this list of conditions and the following disclaimer.

    2. Redistributions in binary form must reproduce the above copyright
       notice, this list of conditions and the following disclaimer in the
       documentation and/or other materials provided with the distribution.

    3. The name of the author may not be used to endorse or promote products
       derived from this software without specific prior written permission

  THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
  IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


  The above copyright notice, list of conditions and disclaimer is
  from the version 0.9.0, written by Ty Sarna. The current version
  is a modification of the 0.9.0 version by J. David Ibez and is
  distributed with the same license.


Contact Information

  Feedback is very welcomed, send your comments/patches/... to

  Chui Tey <teyc@cognoware.com>
