view release on metacpan or search on metacpan
    
3.49 Mon Apr 30 16:45:07 CDT 2007
    - add datetime_now db-agnostic wrapper to Gantry::Utils::DBIxClass
    - add post_body parsing to Plugins::SOAP::Doc
    - modify Gantry handler to work with the PageCache plugin
    - add Gantry::Plugins::PageCache
    - modify cache plugins
    - tie Gantry::Conf into Gantry cache. Specifying a cache plugin will
      enable caching for Gantry::Conf
    - add engine_cycle method to the Gantry object. 
    - add javascript helper for YUI popup calendaring
    - factor out login, logout routines in AuthCookie. AuthCookie now 
      provides login/logout methods that can be called at anytime from 
      anywhere in the app. (think registration form)
    - add add row level error messages to moxie form.tt
    - modify Gantry handler to store action
    - add js_root and js_rootp
	- add search cpan link to pod/doc viewing module
    - patch uninitialized warning in CGI engine 
    - replaced dojo with jquery javascript libraries for the Gantry samples. 
    - patch Gantry::Utils::DBConnHelper::MP20, the server starting test
root/images/tenttut/main_listingout.png
root/images/tenttut/mainlistedit.png
root/images/tenttut/optionsedit.png
root/images/tenttut/quickedit.png
root/images/tenttut/stubmethedit.png
root/images/tenttut/tableedit.png
root/images/tenttut/tentopening.png
root/images/tlc-gray-block.gif
root/images/trc-gray-block.gif
root/js/datePicker.js
root/js/gantry-yui-calendar.js
root/js/gantry.js
root/js/jquery.js
root/login.tt
root/main.tt
root/moxie/delete.tt
root/moxie/form.tt
root/moxie/form_onetomany.tt
root/moxie/gantry_wrapper.tt
root/moxie/results.tt
root/moxie/threeway.tt
t/conf/flat/user.conf
t/conf/flat/user2.conf
t/engine/01engine_mp13.t
t/engine/02engine_mp20.t
t/engine/03engine_cgi.t
t/engine/engine_methods.pm
t/form/01profile.t
t/form/02munger.t
t/plugins/01_autocrud.t
t/plugins/02_crud.t
t/plugins/03_calendar.t
t/plugins/04_validate.t
t/plugins/05_authcookie.t
t/plugins/06_ajaxform.t
t/plugins/07_cache_fastmmap.t
t/plugins/08_cache_storable.t
t/plugins/09_cache_memcached.t
t/plugins/10_pagecache.t
t/plugins/11_session.t
t/template/01template_tt.t
t/template/02template_default.t
lib/Gantry.pm view on Meta::CPAN
Helper for flexible CRUD coding scheme.
=item L<Gantry::Plugins::AutoCRUD>
provides a more automated approach to
CRUD (Create, Retrieve, Update, Delete) support
=item L<Gantry::Plugins::Calendar>
These module creates a couple calendar views that can be used by other
applications and are highly customizeable. 
=item L<Gantry::Engine::MP13>
This module is the binding between the Gantry framework and the mod_perl API.
This particluar module contains the mod_perl 1.0 specific bindings.
See mod_perl documentation for a more detailed description for some of these
bindings.
lib/Gantry/Docs/FAQ.pod view on Meta::CPAN
=item 1.
Name your form by including this key in the returned hash:
 name => 'your_name',
=item 2.
Add a javascript key to the returned hash:
 javascript => $self->calendar_month_js( 'your_name' ),
your_name must match the name from step 1.
=item 3.
Add a date_select_text key to the hash of each date field:
 {
     date_select_text => 'Popup Calendar',
     # ...
lib/Gantry/Docs/Tutorial.pod view on Meta::CPAN
            html_form_type    date;
            date_select_text `Popup Calendar`;
        }
        foreign_display `%name`;
    }
I've chosen to store the actual date of birth (which leads to recording
women's ages, shame on me).  This is to show how date selection works
smoothly for your users.  There are three steps to this process.  The
first one is shown here: use the date_select_text statement.  Its value
becomes the link text the user clicks to popup the calendar selection
mini-window.  See, the controller below for the other two steps.
    controller Birth is AutoCRUD {
        controls_table   birth;
        rel_location     birthday;
        uses             Gantry::Plugins::Calendar;
Step two in easy dates is to use Gantry::Plugins::Calendar which provides
javascript code generation routines.
lib/Gantry/Docs/Tutorial.pod view on Meta::CPAN
        }
The main listing is just like the one for the address table, except for
the names of the displayed fields.
        method form is AutoCRUD_form {
            form_name        birthday_form;
            all_fields_but   id;
            extra_keys
                legend     => `$self->path_info =~ /edit/i ? 'Edit' : 'Add'`,
                javascript => `$self->calendar_month_js( 'birthday_form' )`;
        }
    }
Now the name of the form becomes important.  The calendar_month_js
method (mixed in by Gantry::Plugins::Calendar) generates the javascript
for the popup and its callback, which populates the date fields.
Note that we don't tell it which fields to handle.  It will work on
all fields that have date_select_text statements.
Once these changes are made, we can regenerate the application:
    bigtop docs/address.bigtop all
Execute this command while in the build directory (the one with the Changes
lib/Gantry/Docs/Tutorial.pod view on Meta::CPAN
             title `Birth Day`;
             cols name, family, birthday;
             header_options Add;
             row_options Edit, Delete;
         }
         method form is AutoCRUD_form {
             form_name birthday_form;
             all_fields_but id;
             extra_keys
                 legend => `$self->path_info =~ /edit/i ? 'Edit' : 'Add'`,
                 javascript => `$self->calendar_month_js( 'birthday_form' )`;
         }
     }
 }
=head1 Summary
In this document we have seen how a simple Gantry app can be written
and deployed.  While building a simple app with bigtop can take just
a few minutes, interesting parts can be fleshed out as needed.  Our
goal is to provide a framework that automates the 50-80% of most apps
lib/Gantry/Plugins/Calendar.pm view on Meta::CPAN
                    Day_of_Week
                    Day_of_Week_Abbreviation
                    Day_of_Week_to_Text 
                    Days_in_Month 
                    Month_to_Text
                    check_date  );
use Exporter;
our @ISA    = qw( Exporter );
our @EXPORT = qw(
    do_calendar_month
    calendar_month_js
);
############################################################
# Functions                                                #
############################################################
#-------------------------------------------------
# $site->do_calendar_month( $r, @p ) 
#-------------------------------------------------
sub do_calendar_month {
    my ( $site, $name, $year, $month ) = @_;
    
    my $chk = Gantry::Utils::Validate->new();
    
    $site->template_disable( 1 );
    $name   = ''                            if ( ! $chk->is_text( $name ) );
    $year   = ( 1900 + ( localtime() )[5] ) if ( ! $chk->is_number( $year ) );
    $month  = ( 1 + ( localtime() )[4] )    if ( ! $chk->is_number( $month ) );
    
lib/Gantry/Plugins/Calendar.pm view on Meta::CPAN
        '<html><head></head><body>',
        '<script type="text/javascript">',
        '<!--',
        '   window.focus(); ',
        '   function SendDate(d) { ',
        qq!     window.opener.SetDate("$name",d); window.close(); !,
        '   } ',
        '//--> ',
        '</script>',
        _calendar_month( 
            $site->r,
            ( $site->location . "/calendar_month/$name" ), 
            $month, 
            $year, 
            1, 
            \&_calendar_day 
        ),
        '</body></html>',
    );
    return( join "\n", @output );
} # END $site->do_calendar
#-------------------------------------------------
# _calendar_day( $year, $month, $day )
#-------------------------------------------------
sub _calendar_day {
    my ( $year, $month, $day ) = @_;
    return( ht_a(   'javascript://', "$day", 
                    "onClick=\"SendDate('$month-$day-$year')\"" ) );
} # END calendar_day
#-------------------------------------------------
# $site->calendar_month_js( $form_id )
#-------------------------------------------------
sub calendar_month_js {
    my( $site, $form_id ) = @_;
    
    # prepend document. to form_id id is not specified
    if ( $form_id !~ /^document\./i ) {
        $form_id = 'document.' . $form_id;
    }
    
    my $popup_url = $site->location . "/calendar_month/";   
    
    return( qq!
        <script type="text/javascript">
            function SetDate(field, date) {
                eval( '${form_id}.' + field + '.value = date;' );
            }
    
            function datepopup(name) { 
                window.open('$popup_url'+name, 'Shortcut',
                            'height=250,width=250' + 
                            ',screenX=' + (window.screenX+150) + 
                            ',screenY=' + (window.screenY+100) + 
                            ',scrollbars,resizable' );
            }
        </script>
    ! );
} # end: calendar_month_js
#-------------------------------------------------
# _calendar_month( $r, etc... )
#-------------------------------------------------
sub _calendar_month {
    my ( $r, $root, $month, $year, $select, $function, @params ) = @_;
    my $chk = Gantry::Utils::Validate->new();
    
    if ( ( ! $chk->is_integer( $month ) ) 
                || ( $month > 13 ) || ( $month < 1 ) ) {
        return( 'Malformed month.' );
    }
    if ( ( ! $chk->is_integer( $year ) ) || ( length( $year ) != 4) ) {
lib/Gantry/Plugins/Calendar.pm view on Meta::CPAN
                                    &$function( $year, $month, $k, @params )) );
            }
            else {
                push( @lines, ht_td( { class => 'day' }, ' ' ) );
            }
        }
        push( @lines, ht_utr() );
    }
    
    return( @lines, ht_utable() );
} # END _calendar_month
#-------------------------------------------------
# _cal_week( $r, etc... )
#-------------------------------------------------
# Draws one full week. $function is what you want
# it to do for each day in the week.
#-------------------------------------------------
sub _calendar_week {
    my ( $r, $root, $day, $month, $year, $function, @params ) = @_;
    my $chk = Gantry::Utils::Validate->new();
    
    # Validate our input.
    return( 'Malformed day.' )  if ( ! $chk->is_number( $day ) );
    return( 'Malformed month' ) if ( ! $chk->is_number( $month ) );
    return( 'Malformed year' )  if ( ! $chk->is_number( $year ) );
    return( 'Bad Date' )        if ( ! check_date( $year, $month, $day ) );
lib/Gantry/Plugins/Calendar.pm view on Meta::CPAN
    for ( -3..3 ) {
        push( @lines, ht_td( { class => 'day' },    
                             &$function( $syear, $smonth, $sday, @params ) ) );
        ( $syear, $smonth, $sday ) = 
                            Add_Delta_YMD( $syear, $smonth, $sday, 0, 0, 1);
    }
    return( @lines, ht_utr(), ht_utable() );
} # END _calendar_week
#-------------------------------------------------
# _calendar_year( $r, etc... )
#-------------------------------------------------
# Draws one full year. Function is what you want
# it to do for every day in the year.
#-------------------------------------------------
sub _calendar_year {
    my ( $r, $root, $year, $function, @params ) = @_;
    my $chk = Gantry::Utils::Validate->new();
    
    if ( ( ! $chk->is_number( $year ) ) || ( length( $year ) != 4 ) ) {
        return ( 'Malformed Year.' );
    }
    $root =~ s/\/$//;
lib/Gantry/Plugins/Calendar.pm view on Meta::CPAN
                    ht_a( "$root/". ( $year - 1 ), '<<' ) ),
            ht_td(  { align => 'center' },
                    qq!<big><strong>$year</strong</big>! ),
            
            ht_td(  { align => 'right' },
                    ht_a( "$root/". ( $year + 1 ), '>>' ) ),
            ht_utr(),
            ht_utable() );
} # END _calendar_year
# EOF
1;
__END__
=head1 NAME
Gantry::Plugins::Calendar - Calendar 
lib/Gantry/Plugins/Calendar.pm view on Meta::CPAN
or
    use Gantry qw/... Calendar/;
=head1 DESCRIPTION
If you have a date field on a web form, which the user must supply,
you can use this module to help them.  When you've got it set up,
your form will have a link sitting next to the date's text entry box.
If the user clicks the link, a calendar pops up.  It allows for
navigation by time period.  Each date is just linked text.  When the user
presses one of the links, that date is entered into the text field
as if they had typed it.
To make this happen do the following.
=over 4
=item 1.
Add Calendar to the list in the use statement for Gantry in your
application's base module.  For example:
    use Gantry qw/... Calendar/;
=item 2.
In your module's _form method, add the following to the form hash:
    javascript => $site->calendar_month_js( 'your_form_name' );
where your_form_name must match the name entry in the hash.
=item 3.
Add the following to the hash for your date fields:
    date_select => 'User Label',
User Label will be the link text, so make it something like 'Select'
lib/Gantry/Plugins/Calendar.pm view on Meta::CPAN
That's all.
=head1 HOW IT WORKS
The three steps above are simple, but they conceal quite a bit of careful
Perl and Javascript code.  This section explains what is actually
happening behind the scenes.
When you use the Calendar template, methods are exported into the site
object.  The important ones are calendar_month_js and do_calendar_month.
The global handler will call do_calendar_month for you.
calendar_month_js creates two Javascript functions:
=over 4
=item datepopup(form_name)
makes the calendar window popup.
=item SetDate(field_name, date)
sets the date when the user clicks on a date in the popup window.
=back
You must pass the name of the form to calendar_month_js, otherwise
its Javascript won't be able to tell the name to the popup window,
which will then be unable to set any dates on your form.
do_calendar_month is the method called by the handler when the window
pops up.  It generates the calendar and manages user interaction with
it.  It relies on the internal _calendar_month to make the actual
output.  When the user clicks on a date, its Javascript first
calls SetDate with the field name and the date value
and then closes the popup window.
=head1 FUNCTIONS 
The other functions are not directly useful to normal callers
but here is a complete list.
=head2 Method you call
=over 4
=item calendar_month_js
See above.
=back
=head2 Methods called by global handler
=over 4
=item do_calendar_month( $site, ... )
This is the only do_* method we currently use.
=item do_calendar_week( $site ... )
Might not work, not tested.  Meant to display weeks with time slots.
=item do_calendar_year( $site ... )
Might not work, not tested.  Meant to display a whole year at a time.
=back
=head2 Functions used internatlly
=over 4
=item @month = _calendar_month( $r, $root, $month, $year, $select, \&function, @param )
This function creates a month in html for display. C<$r> is the apache
request object. C<$root> is the uri root of the calendar, this is used
for paging. C<$month> and C<$year> are the month and year to show.
C<$select> should be a boolean value, true if the month select is to be
shown, false otherwise. C<\&function> is a function referenc for the
day. C<@params> are any params that need to be passed to C<\&function>
=item @week = _calendar_week( $r, $root, $day, $month, $year, \&function, @param )
This function creates a week in html for display. C<$r> is the apache
request object. C<$root> is the uri root of the week, this is used for
paging. C<$day>, C<$month>, and C<$year> are the day, month, and year of
the Wednesday of the week. C<\&function> should be a function reference
for the day function. C<@param> is for the parameters for the day
function that will be passed through.
=item @year = _calendar_year( $r, $root, $year, \&function, @param )
This function creates a year in html for display. C<$r> is the apache
request object. C<$root> is the uri root of the year, this is used for
paging. C<$year> is the year to show. C<\&function> is the day function
to be used. C<@param> are any other params to pass into the day
function. This function uses the cal_month function to create it's
month.
=item @day = \&function( $year, $month, $day, @params)
lib/Gantry/Plugins/Calendar.pm view on Meta::CPAN
be passed into the cal_* params.
=back
=head1 SEE ALSO
Gantry(3)
=head1 LIMITATIONS and BUGS
Only do_calendary_month has been tested, the other do_* methods are
unlikely to work.
=head1 AUTHOR
Tim Keefer <tkeefer@gmail.com>
Phil Crow <philcrow2000@yahoo.com>
Nicholas Studt <nstudt@angrydwarf.org>
=head1 COPYRIGHT and LICENSE
root/css/gantry_datepicker.css view on Meta::CPAN
a.date-picker {	width: 16px;	height: 16px;	border: none;	color: #fff;	padding: 0;	margin: 0;	float: left;	overflow: hidden;	cursor: pointer;	background: url(calendar.png) no-repeat;}
a.date-picker span {	margin: 0 0 0 -2000px;}
div.date-picker-holder, div.date-picker-holder * {	margin: 0;	padding: 0;}
div.date-picker-holder {	position: relative;}
div.date-picker-holder input {	float: left;}
div.popup-calendar {	display: none;	position: absolute;	z-index: 2;	top: 0;    font-size: 9px;	left: -16px; /* value for IE */	padding: 4px;	border: 2px solid #000;	background: #fff;	color: #000;	overflow:hidden;	width: 163px;}
html>body div.popup-calendar {	left: 99px; /* value for decent browsers */}
div.popup-calendar div.link-close {	float: right;}
div.popup-calendar div.link-prev {	float: left;}
div.popup-calendar h3 {	font-size: 1.3em;	margin: 2px 0 5px 3px;}
div.popup-calendar div.link-next {	float: right;}
div.popup-calendar div a {	padding: 1px 2px;	color: #000;}
div.popup-calendar div a:hover {	background-color: #000;	color: #fff;}
div.popup-calendar table {	margin: 0;}
* html div.popup-calendar table {	display: inline;}
div.popup-calendar table th, div.popup-calendar table td {	background: #eee;	width: 21px;	height: 17px;	text-align: center;}
div.popup-calendar table td.inactive {	color: #aaa;	padding: 1px 0 0;}
div.popup-calendar table th.weekend, div.popup-calendar table td.weekend {	background: #f6f6f6;}
div.popup-calendar table td a {	display: block;	border: 1px solid #eee;	width: 19px;	height: 15px;	text-decoration: none;	color: #333;}
div.popup-calendar table td.today a {	border-color: #aaa;}
div.popup-calendar table td a.selected, div.popup-calendar table td a:hover {	background: #333;	color: #fff;}
root/css/gantry_layout.css view on Meta::CPAN
/* Group4 */  .group4 .unit {    width: 25%;  }
.group4 .first {    width: 24%;  }
/* Basic tabs-------------------------------------------------------------------------------- */
.tabs ul {  margin: 0;  padding: 0;}
.tabs li {  float: left;  margin: 0;  padding: 0;}
.tabs li a {  float: left;  display: block;}
/* Calendar-------------------------------------------------------------------------------- */
.calendar table {  width: 100%;  border-collapse: collapse;}
.calendar table caption {  text-align: center;}
.calendar td, .calendar th {  border: 1px solid #CCC;  font-size: 1.1em;  text-align: center;}
/* Tricks and Hacks-------------------------------------------------------------------------------- */
#body:after,.group2:after,.group3:after,.group4:after,.tabs:after {  content:  ".";  display: block;  height: 0;  clear: both;  visibility: hidden;}
#body,.group2,.group3,.group4,.tabs {  zoom: 1;}
/* IE */
html {  font-size: 100%; /* IE Hack */}
table, input, select, textarea {  font-size: 100%; /* IE Hack */}
root/form.tt view on Meta::CPAN
    self       - the site object (if self has a params hash values shown on
                 the form are taken from it)
    view.title - thr browser window title
    view.form  - a hash with these keys:
        method      - POST or GET (defaults to POST)
        action      - url of page to process form (defaults to self.uri)
        name        - the name of the form (useful for javascript references)
        row         - the current row object from the table (if available)
        javascript  - javascript code the form needs (like for date popups.
                      Consider using Gantry::Plugins::Calendar and calling
                      its calendar_month_js.
                      (This could actually be anything, it just gets copied to
                      the output immediately after the form opening tag)
        legend      - The title for the legend box wrapping the form.
        change_log  - An array of change_log entries (optional).  Each entry
                      is a hash with these keys:
                          date    - the date the change happened
                          by      - the name of the person making the change
                          message - what happened
        results     - the return value from Data::FormValidator->check
        cellspacing - becomes the cellspacing parameter of the form's table
root/js/datePicker.js view on Meta::CPAN
 * http://kelvinluck.com/assets/jquery/datePicker
 *
 * Copyright (c) 2006 Kelvin Luck (kelvinluck.com)
 * Licensed under the MIT License:
 *   http://www.opensource.org/licenses/mit-license.php
 *
 * $LastChangedDate: 2007-02-14 12:01:15 +0000 (Wed, 14 Feb 2007) $
 * $Rev: 1342 $
 */
eval(function(p,a,c,k,e,d){e=function(c){return(c<a?"":e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};whi...
root/js/gantry-yui-calendar.js view on Meta::CPAN
Synopsis 
<script type="text/javascript" 
    src="[% self.doc_rootp %]/js/yui/build/yahoo/yahoo.js"></script>
<script type="text/javascript" 
    src="[% self.doc_rootp %]/js/yui/build/event/event.js" ></script>
<script type="text/javascript" 
    src="[% self.doc_rootp %]/js/yui/build/dom/dom.js" ></script>
<script type="text/javascript" 
    src="[% self.doc_rootp %]/js/yui/build/calendar/calendar.js"></script>
<link type="text/css" rel="stylesheet" 
    href="[% self.doc_rootp %]/js/yui/build/calendar/assets/calendar.css">
<script type="text/javascript">
function init() {
    
    YAHOO.gantry.calendar.helper.init( 'date1', 
        {   fieldId: 'date1',
            mindate: "1/1/2001", 
            maxdate: "12/31/2020",
            title: 'date1',
            containerClass: 'date-container', 
            iframe: false 
        }    
    );
    YAHOO.gantry.calendar.helper.init( 'date1', 
        {   fieldId: 'date1',
            mindate: "1/1/2001", 
            maxdate: "12/31/2020",
            title: 'date1',
            containerClass: 'date-container', 
            iframe: false 
        }    
    );
    
}
root/js/gantry-yui-calendar.js view on Meta::CPAN
</body>
Requires
The YAHOO javascript libraries
http://developer.yahoo.com/yui
*/
YAHOO.namespace("gantry.calendar");
YAHOO.namespace("gantry.calendar.helper");
YAHOO.gantry.calendar.helper.show = function ( e, obj ) {
    
    var tg;    
    if ( e.target ) {        
        tg = e.target;    
    }    
    else {        
        tg = e.srcElement;    
    }
    
    YAHOO.gantry.calendar.helper.updateCal( 
        YAHOO.gantry.calendar[tg.id] 
    );
    
    YAHOO.gantry.calendar[tg.id].show();
}
YAHOO.gantry.calendar.helper.createHelperNodes = function ( obj ) {
    
    var fieldNode     = document.getElementById( obj.fieldId );
    var containerNode = document.getElementById( obj.containerId );
    
    if ( ! containerNode ) {
        var container = document.createElement('div');
        container.setAttribute( 'id', obj.containerId );
        container.setAttribute( 'class', obj.containerClass );
        fieldNode.parentNode.appendChild( container );
root/js/gantry-yui-calendar.js view on Meta::CPAN
            YAHOO.util.Dom.setStyle( container, 'position', 'absolute' );
            YAHOO.util.Dom.setStyle( container, 'top', '-16px' );
            YAHOO.util.Dom.setStyle( container, 'z-index', '2' );
            YAHOO.util.Dom.setStyle( container, 'left', '15px' );
            YAHOO.util.Dom.setStyle( container, 'overflow', 'hidden' );
    	}
    }
}
YAHOO.gantry.calendar.helper.updateCal = function ( obj ) {
	var txtDate1 = document.getElementById( obj.fieldId );
	if (txtDate1.value != "") {
		obj.select(txtDate1.value);
		var firstDate = obj.getSelectedDates()[0];
		obj.cfg.setProperty(
		    "pagedate", 
		    (firstDate.getMonth()+1) + "/" + firstDate.getFullYear()
		);
		obj.render();
	}
} 
YAHOO.gantry.calendar.helper.handleSelect = function (type,args,obj) {
	var dates   = args[0]; 
	var date    = dates[0];
	var year    = date[0], month = date[1], day = date[2];
    var txtDate1 = document.getElementById( obj.fieldId );
	txtDate1.value = month + "/" + day + "/" + year;
    YAHOO.util.Dom.setStyle(obj.containerId, 'display', 'none' );
}
YAHOO.gantry.calendar.helper.init = function ( field, opts ) {
    this.fieldId    = field;
    this.mindate    = '1/1/2002';
    this.maxdate    = '12/31/2020';
    this.close      = true;
    this.containerId    = this.fieldId + "-container";
    this.containerClass = '';
    this.containerStyle = '';
    this.buttonId     = this.fieldId + "-button";
    this.title      = 'select a date';
    this.iframe     = false;
    this.pages      = 1;
    
    if (opts) {
        for(var param in opts) {
            this[param] = opts[param];
        }
    }
     
    YAHOO.gantry.calendar.helper.createHelperNodes( this );
    
    var calWidget = this.pages > 1 ? 'CalendarGroup' : 'Calendar';
    YAHOO.gantry.calendar[this.fieldId] = new YAHOO.widget[calWidget](
	    this.buttonId, this.containerId, 
	    { 
	        mindate: this.mindate,
			maxdate: this.maxdate,
			close:   this.close, 
	        iframe:  this.iframe,
	        title:   this.title,
	        pages:   this.pages
		}
	);        
	YAHOO.gantry.calendar[this.fieldId].fieldId     = this.fieldId;
	YAHOO.gantry.calendar[this.fieldId].containerId = this.containerId;
	YAHOO.gantry.calendar[this.fieldId].buttonId    = this.buttonId;
 
    // why is there a scoping problem with this ? alway contains the last prop 
    // YAHOO.gantry.calendar[this.fieldId].prop = this;
    
	YAHOO.gantry.calendar[this.fieldId].selectEvent.subscribe(
	    YAHOO.gantry.calendar.helper.handleSelect, 
	    YAHOO.gantry.calendar[this.fieldId]
	);
	
	YAHOO.gantry.calendar[this.fieldId].render();
    
    YAHOO.util.Event.addListener(
        document.getElementById( this.fieldId ), 
        "click", 
        YAHOO.gantry.calendar.helper.show,
        YAHOO.gantry.calendar[this.fieldId]
    );	
}