diff --git a/docs/upgrades/packages-7.7.0/matrix-default-detailed-listing.wgpkg b/docs/upgrades/packages-7.7.0/matrix-default-detailed-listing.wgpkg index e0df045a6..6b9905fac 100644 Binary files a/docs/upgrades/packages-7.7.0/matrix-default-detailed-listing.wgpkg and b/docs/upgrades/packages-7.7.0/matrix-default-detailed-listing.wgpkg differ diff --git a/docs/upgrades/packages-7.7.0/matrix-default-screenshots-config.wgpkg b/docs/upgrades/packages-7.7.0/matrix-default-screenshots-config.wgpkg new file mode 100644 index 000000000..c461d01b3 Binary files /dev/null and b/docs/upgrades/packages-7.7.0/matrix-default-screenshots-config.wgpkg differ diff --git a/docs/upgrades/packages-7.7.0/matrix-default-screenshots.wgpkg b/docs/upgrades/packages-7.7.0/matrix-default-screenshots.wgpkg new file mode 100644 index 000000000..9f8239915 Binary files /dev/null and b/docs/upgrades/packages-7.7.0/matrix-default-screenshots.wgpkg differ diff --git a/docs/upgrades/upgrade_7.6.14-7.7.0.pl b/docs/upgrades/upgrade_7.6.14-7.7.0.pl index 1f480ada3..65e25aa6c 100644 --- a/docs/upgrades/upgrade_7.6.14-7.7.0.pl +++ b/docs/upgrades/upgrade_7.6.14-7.7.0.pl @@ -33,6 +33,7 @@ my $session = start(); # this line required # upgrade functions go here addGroupToAddToMatrix( $session ); +addScreenshotTemplatesToMatrix( $session ); finish($session); # this line required @@ -47,6 +48,19 @@ sub addGroupToAddToMatrix { print "Done.\n" unless $quiet; } +#---------------------------------------------------------------------------- +sub addScreenshotTemplatesToMatrix { + my $session = shift; + print "\tAdding screenshot templates to Matrix table \n" unless $quiet; + + $session->db->write("alter table Matrix add screenshotsConfigTemplateId char(22);"); + $session->db->write("update Matrix set screenshotsConfigTemplateId = 'matrixtmpl000000000007';"); + $session->db->write("alter table Matrix add screenshotsTemplateId char(22);"); + $session->db->write("update Matrix set screenshotsTemplateId = 'matrixtmpl000000000006';"); + + print "Done.\n" unless $quiet; +} + #---------------------------------------------------------------------------- # Describe what our function does #sub exampleFunction { diff --git a/lib/WebGUI/Asset/MatrixListing.pm b/lib/WebGUI/Asset/MatrixListing.pm index 511f5dbc6..eaf913ee7 100644 --- a/lib/WebGUI/Asset/MatrixListing.pm +++ b/lib/WebGUI/Asset/MatrixListing.pm @@ -692,33 +692,10 @@ sub view { my $storage = $file->getStorageLocation; my @files; @files = @{ $storage->getFiles } if (defined $storage); - - $var->{screenshots} = qq| - - -
- - - - - - - - - Get Adobe
-Flash player - - - - - -
-|; + $var->{screenshotsUrl} = $self->getUrl('func=viewScreenshots'); + $var->{screenshotThumbnail} = $storage->getUrl('thumb-'.$files[0]); } - + # Rating form my %rating; @@ -977,9 +954,7 @@ sub www_getScreenshots { my $thumb = 'thumb-'.$file; $xml .= " - 400 - 300 - <![CDATA[<b>Slide</b> One]]> + ".$storage->getUrl($file)." 5 @@ -1007,56 +982,14 @@ Returns the xml config file for the ukplayer that displays the screenshots. =cut sub www_getScreenshotsConfig { - my $self = shift; + my $self = shift; + my $var = $self->get; return $self->session->privilege->noAccess() unless $self->canView; $self->session->http->setMimeType('text/xml'); - my $xml = qq| - - - ?func=getScreenshots - - 400 - 300 - 0xDDDDEE - 20 - 100 - 100 - - Verdana - 12 - 0xCCCCCC - 0xCCCCCC - 0x000000 - true - - 0xCCCCCC - 0xCCCCCC - 0x000000 - false - - 48 - 36 - 0x000000 - true - 100 - 5 - - false - true - false - false - - - - -|; - - return $xml; + return $self->processTemplate($var,$self->getParent->get("screenshotsConfigTemplateId")); } #------------------------------------------------------------------- @@ -1164,7 +1097,24 @@ sub www_view { return $self->view; } +#------------------------------------------------------------------- +=head2 www_viewScreenshots ( ) + +Returns this listing's screenshots in a ukplayer. + +=cut + +sub www_viewScreenshots { + my $self = shift; + my $var = $self->get; + + $var->{configUrl} = 'config='.$self->getUrl("func=getScreenshotsConfig"); + + return $self->session->privilege->noAccess() unless $self->canView; + + return $self->processTemplate($var,$self->getParent->get("screenshotsTemplateId")); +} 1; #vim:ft=perl diff --git a/lib/WebGUI/Asset/Wobject/Matrix.pm b/lib/WebGUI/Asset/Wobject/Matrix.pm index 355e65698..4e4075dfe 100644 --- a/lib/WebGUI/Asset/Wobject/Matrix.pm +++ b/lib/WebGUI/Asset/Wobject/Matrix.pm @@ -130,6 +130,22 @@ sub definition { hoverHelp =>$i18n->get('edit listing template description'), label =>$i18n->get('edit listing template label'), }, + screenshotsTemplateId=>{ + defaultValue =>"matrixtmpl000000000006", + fieldType =>"template", + tab =>"display", + namespace =>"Matrix/Screenshots", + hoverHelp =>$i18n->get('screenshots template description'), + label =>$i18n->get('screenshots template label'), + }, + screenshotsConfigTemplateId=>{ + defaultValue =>"matrixtmpl000000000007", + fieldType =>"template", + tab =>"display", + namespace =>"Matrix/ScreenshotsConfig", + hoverHelp =>$i18n->get('screenshots config template description'), + label =>$i18n->get('screenshots config template label'), + }, defaultSort=>{ fieldType =>"selectBox", tab =>"display", diff --git a/lib/WebGUI/i18n/English/Asset_Matrix.pm b/lib/WebGUI/i18n/English/Asset_Matrix.pm index 3a02c1826..f7ace67ae 100644 --- a/lib/WebGUI/i18n/English/Asset_Matrix.pm +++ b/lib/WebGUI/i18n/English/Asset_Matrix.pm @@ -481,6 +481,16 @@ listing,|, message => q|Select a template to be used to show the listing edit screen.|, lastUpdated => 0, }, + + 'screenshots template description' => { + message => q|Select a template to be used to show a listing's screenshots.|, + lastUpdated => 0, + }, + + 'screenshots config template description' => { + message => q|Select a template for a listing's screenshots configuration.|, + lastUpdated => 0, + }, 'categories label' => { message => q|Categories|, @@ -612,6 +622,16 @@ listing,|, lastUpdated => 0, }, + 'screenshots template label' => { + message => q|Listing Screenshots Template|, + lastUpdated => 0, + }, + + 'screenshots config template label' => { + message => q|Listing Screenshots Config Template|, + lastUpdated => 0, + }, + 'edit listing template label' => { message => q|Edit Listing Template|, lastUpdated => 0,