diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 2497b0595..a0b6f66b4 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -1,4 +1,5 @@ 7.10.13 + - added #12079: Carousel Auto Play 7.10.12 - fixed #12072: Product, related and accessory assets diff --git a/docs/upgrades/upgrade_7.10.12-7.10.13.pl b/docs/upgrades/upgrade_7.10.12-7.10.13.pl index 2e493b252..35af14a75 100644 --- a/docs/upgrades/upgrade_7.10.12-7.10.13.pl +++ b/docs/upgrades/upgrade_7.10.12-7.10.13.pl @@ -31,6 +31,7 @@ my $quiet; # this line required my $session = start(); # this line required # upgrade functions go here +addAutoPlayToCarousel( $session ); finish($session); # this line required @@ -44,6 +45,16 @@ finish($session); # this line required # print "DONE!\n" unless $quiet; #} +#---------------------------------------------------------------------------- +# Add AutoPlay fields to the Carousel +sub addAutoPlayToCarousel { + my $session = shift; + print "\tAdding Auto Play to Carousel... " unless $quiet; + $session->db->write( + "ALTER TABLE Carousel ADD COLUMN autoPlay INT, ADD COLUMN autoPlayInterval INT" + ); + print "DONE!\n" unless $quiet; +} # -------------- DO NOT EDIT BELOW THIS LINE -------------------------------- diff --git a/lib/WebGUI/Asset/Wobject/Carousel.pm b/lib/WebGUI/Asset/Wobject/Carousel.pm index 0e1e67951..c5c48407d 100644 --- a/lib/WebGUI/Asset/Wobject/Carousel.pm +++ b/lib/WebGUI/Asset/Wobject/Carousel.pm @@ -65,6 +65,21 @@ sub definition { fieldType =>'text', autoGenerate =>0, }, + autoPlay => { + fieldType => 'yesNo', + defaultValue => 0, + tab => "properties", + hoverHelp => $i18n->get('carousel autoPlay description'), + label => $i18n->get('carousel autoPlay label'), + }, + autoPlayInterval => { + fieldType => 'Integer', + defaultValue => 4, + tab => 'properties', + hoverHelp => $i18n->get('carousel autoPlayInterval description'), + label => $i18n->get('carousel autoPlayInterval label'), + }, + ); push(@{$definition}, { assetName=>$i18n->get('assetName'), diff --git a/lib/WebGUI/i18n/English/Asset_Carousel.pm b/lib/WebGUI/i18n/English/Asset_Carousel.pm index 890de2666..4413256d4 100644 --- a/lib/WebGUI/i18n/English/Asset_Carousel.pm +++ b/lib/WebGUI/i18n/English/Asset_Carousel.pm @@ -115,7 +115,31 @@ our $I18N = { message => q|This carousel item's sequenceNumber.|, lastUpdated => 0, context => q|Description of the sequenceNumber tmpl_var for the template help.| - } + }, + + 'carousel autoPlay description' => { + message => q{Should this carousel automatically scroll through its items?}, + lastUpdated => 0, + context => 'Description of asset property', + }, + + 'carousel autoPlay label' => { + message => q{Auto Play}, + lastUpdated => 0, + context => 'Label for asset property', + }, + + 'carousel autoPlayInterval label' => { + message => q{Auto Play Interval}, + lastUpdated => 0, + context => 'Label for asset property', + }, + + 'carousel autoPlayInterval description' => { + message => q{Length of time in seconds between carousel slides}, + lastUpdated => 0, + context => 'Description of asset property', + }, }; 1;