From bb3bb499e60729865c84ad70993dce0f5d31a56e Mon Sep 17 00:00:00 2001 From: Phillip Ball Date: Wed, 6 Jul 2011 13:20:25 -0700 Subject: [PATCH] Showcase view and configuration for File Displayer [#136 state:resolved] --- .../modules/common/views/file/Showcase.tpl | 51 +++++++++++++++++++ .../common/views/file/configure/Showcase.tpl | 24 +++++++++ 2 files changed, 75 insertions(+) create mode 100644 framework/modules/common/views/file/Showcase.tpl create mode 100644 framework/modules/common/views/file/configure/Showcase.tpl diff --git a/framework/modules/common/views/file/Showcase.tpl b/framework/modules/common/views/file/Showcase.tpl new file mode 100644 index 0000000000..ed12d8a7aa --- /dev/null +++ b/framework/modules/common/views/file/Showcase.tpl @@ -0,0 +1,51 @@ +{css unique="files-showcase" link="`$smarty.const.PATH_RELATIVE`framework/modules/common/assets/css/filedisplayer.css"} + +{/css} + +{if $config.floatthumb!="No Float" && !$config.lightbox} + {capture assign="imgflot"} + float:{$config.floatthumb|lower}; + {/capture} + + {capture assign="spacing"} + margin:{$config.spacing}px; + {/capture} +{/if} + +{assign var=quality value=$config.quality|default:$smarty.const.THUMB_QUALITY} +
+
+ {if $config.pio && $params.is_listing} + {assign var=miw value=$config.listingwidth} + {else} + {assign var=miw value=$config.piwidth} + {/if} + {img file_id=$files[0]->id w=$miw alt="`$files[0]->alt`" class="mainimg `$config.tclass`"} +
+ {if ($config.pio && !$params.is_listing) || !$config.pio} + + {/if} +
+ +{if ($config.pio && !$params.is_listing) || !$config.pio} +{script unique="showcase" yui3mods=1} +{literal} +YUI(EXPONENT.YUI3_CONFIG).use('node','event', function(Y) { + var thumbs = Y.all('.thumb-imgs .image-link'); + + thumbs.on('click',function(e){ + e.halt(); + }); + thumbs.on('{/literal}{if $config.hoverorclick==1}click{else}mouseenter{/if}{literal}',function(e){ + e.halt(); + var mainimg = e.currentTarget.ancestor('.showcase').one('.main-img img'); + var newid = e.currentTarget.getAttribute('rel').replace('showcase-',''); + mainimg.setAttribute('src',EXPONENT.URL_FULL+"thumb.php?id="+newid+"&w=500&q=75"); + }); + //Y.Lightbox.init(); +}); +{/literal} +{/script} +{/if} \ No newline at end of file diff --git a/framework/modules/common/views/file/configure/Showcase.tpl b/framework/modules/common/views/file/configure/Showcase.tpl new file mode 100644 index 0000000000..85c4b0caf5 --- /dev/null +++ b/framework/modules/common/views/file/configure/Showcase.tpl @@ -0,0 +1,24 @@ +{css unique="gallery-config"} +{literal} +small { + display:block; +} +{/literal} +{/css} + + +

{"Image ShowcaseConfiguration"|gettext}

+

{"Portolio listing page"|gettext}

+ +{control type="checkbox" label="Only show primary image on listing pages" name="pio" value=1 checked=$config.pio} +{control type="text" label="Listing page image width" name="listingwidth" value=$config.listingwidth|default:100 size=5} + +

{"Portolio landing page"|gettext}

+{control type="dropdown" name="lpfloat" label="File Display Box Float" items="No Float,Left,Right" value=$config.lpfloat} +{control type="text" label="Width of Landing Page File Display Box" name="lpfwidth" value=$config.lpfwidth size=5} +{control type="text" label="Width of main image" name="piwidth" value=$config.piwidth|default:100 size=5} +{control type="text" name="thumb" label="Thumbnail Box Size"|gettext value=$config.thumb|default:100 size=5} +{control type="radiogroup" columns=2 name="hoverorclick" label="Replace main image on click or hover?" items="Click,Hover" values="1,2" default=$config.hoverorclick|default:"1"} +{control type="text" name="spacing" label="Thumbnail Spacing"|gettext value=$config.spacing|default:10 size=5} +{control type=text name="quality" label="Thumbnail JPEG Quality 0 - 99. 100 will use actual image without thumbnailing" value=$config.quality|default:$smarty.const.THUMB_QUALITY size="5"} +{control type="text" name="tclass" label="Stylesheet class to apply to images"|gettext value=$config.tclass} \ No newline at end of file