package WebGUI::Asset::Wobject::Carousel; $VERSION = "1.0.0"; #------------------------------------------------------------------- # WebGUI is Copyright 2001-2008 Plain Black Corporation. #------------------------------------------------------------------- # Please read the legal notices (docs/legal.txt) and the license # (docs/license.txt) that came with this distribution before using # this software. #------------------------------------------------------------------- # http://www.plainblack.com info@plainblack.com #------------------------------------------------------------------- use strict; use JSON; use WebGUI::International; use Moose; use WebGUI::Definition::Asset; extends 'WebGUI::Asset::Wobject'; define assetName => [ 'assetName', 'Asset_Carousel' ]; define icon => 'Carousel.png'; define tableName => 'Carousel'; property templateId => ( fieldType => "template", default => 'CarouselTmpl0000000001', tab => "display", noFormPost => 0, namespace => "Carousel", hoverHelp => [ 'carousel template description', 'Asset_Carousel' ], label => [ 'carousel template label', 'Asset_Carousel' ], ); property slideWidth => ( fieldType => "integer", default => 0, tab => "display", hoverHelp => [ 'carousel slideWidth description', 'Asset_Carousel' ], label => [ 'carousel slideWidth label', 'Asset_Carousel' ], ); property slideHeight => ( fieldType => "integer", default => 0, tab => "display", hoverHelp => ['carousel slideHeight description', 'Asset_Carousel' ], label => ['carousel slideHeight label', 'Asset_Carousel' ], ); property items => ( noFormPost => 1, fieldType => 'text', ); property autoPlay => ( fieldType => 'yesNo', defaultValue => 0, tab => "properties", hoverHelp => ['carousel autoPlay description', 'Asset_Carousel' ], label => ['carousel autoPlay label', 'Asset_Carousel' ], ); property autoPlayInterval => ( fieldType => 'Integer', defaultValue => 4, tab => 'properties', hoverHelp => ['carousel autoPlayInterval description', 'Asset_Carousel'], label => ['carousel autoPlayInterval label', 'Asset_Carousel'], ); #------------------------------------------------------------------- =head2 getEditForm ( ) returns the tabform object that will be used in generating the edit page for New Wobjects. This method is optional if you set autoGenerateForms=1 in the definition. =cut override getEditForm => sub { my $self = shift; my $tabform = super(); my $i18n = WebGUI::International->new($self->session, "Asset_Carousel"); $self->session->style->setScript($self->session->url->extras('yui/build/yahoo-dom-event/yahoo-dom-event.js'), {type => 'text/javascript'}); $self->session->style->setScript($self->session->url->extras('yui/build/element/element-min.js'), {type => 'text/javascript'}); $self->session->style->setScript($self->session->url->extras('yui/build/tabview/tabview-min.js'), {type => 'text/javascript'}); $self->session->style->setScript($self->session->url->extras('yui/build/editor/editor-min.js'), {type => 'text/javascript'}); $self->session->style->setScript($self->session->url->extras('yui/build/json/json-min.js'), {type => 'text/javascript'}); $self->session->style->setLink($self->session->url->extras('yui/build/editor/assets/skins/sam/editor.css'), {type =>'text/css', rel=>'stylesheet'}); $self->session->style->setLink($self->session->url->extras('yui/build/tabview/assets/skins/sam/tabview.css'), {type =>'text/css', rel=>'stylesheet'}); $self->session->style->setScript($self->session->url->extras('wobject/Carousel/carousel.js'), {type => 'text/javascript'}); my $tableRowStart = '