NAME

Krang::Widget - interface widgets for use by Krang::CGI modules


SYNOPSIS

  use Krang::ClassLoader Widget => qw(category_chooser date_chooser decode_date);
  $chooser = category_chooser(name => 'category_id',
                              query => $query);
  $date_chooser = date_chooser(name => 'cover_date',
                               date=>$date_obj);
  $date_obj = decode_date(name => 'cover_date',
                          query => $query);
  # event handler as HTML attribute is deprecated
  $url_html = format_url(url => 'http://my.host/some/long/url.html',
                         linkto => "javascript:Krang.preview('media','" . $id . "')");
  # make DOM2 event handler instead, see the behaviors
  # 'media-preview-link' and 'story-preview-link' in
  # F<htdocs/js/krang.js>
  #
  # For media
  $url_html = format_url(url   => 'http://my.host/some/long/media.html',
                         class => 'media-preview-link',
                         name  => 'media_$id');
  # For stories
  $url_html = format_url(url   => 'http://my.host/some/long/media.html',
                         class => 'story-preview-link',
                         name  => 'story_$id');


DESCRIPTION

This modules exports a set of generally useful CGI widgets.


INTERFACE