summaryrefslogtreecommitdiff
path: root/gallery_views/galleriffic/fisheye_galleriffic_inc_1.tpl
blob: 53e6645810f48d9b440c9d4e4071c1c57d11ed11 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
{strip}<div class="galleriffic">

<div class="header">
	{include file="bitpackage:fisheye/gallery_icons_inc.tpl"}
	<h1>{$gContent->getTitle()|escape}</h1>
	<div class="gallerybar">
		<div class="path">
			{assign var=breadCrumbs value=$gContent->getBreadcrumbLinks()}
			{if $gGallery}
				{displayname user=$gGallery->mInfo.creator_user user_id=$gGallery->mInfo.creator_user_id real_name=$gGallery->mInfo.creator_real_name} :: <a href="{$smarty.const.FISHEYE_PKG_URL}?user_id={$gGallery->mInfo.user_id}">{tr}Galleries{/tr}</a> &raquo;{if $breadCrumbs}{$breadCrumbs}{else}{$gGallery->getTitle()}{/if}
			{else}
				{displayname user=$gContent->mInfo.creator_user user_id=$gContent->mInfo.creator_user_id real_name=$gContent->mInfo.creator_real_name} :: <a href="{$smarty.const.FISHEYE_PKG_URL}?user_id={$gContent->mInfo.user_id}">{tr}Galleries{/tr}</a> &raquo; {if $breadCrumbs}{$breadCrumbs}{else}{$gContent->getTitle()}{/if}
			{/if}
		</div>
	</div>
</div>


<!-- Start Advanced Gallery Html Containers -->				
<div class="navigation-container">
	<div id="thumbs" class="navigation">
		<div>
		<ul class="thumbs noscript">
			{foreach from=$gContent->mItems item=galItem}
			<li>
				{if is_a($galItem, 'FisheyeImage')}
					<a class="thumb" name="{$galItem->mImageId}" href="{$galItem->mInfo.thumbnail_url.large}{*$smarty.const.FISHEYE_PKG_URL}view_image.php?image_id={$galItem->mImageId*}" title="{$galItem->mInfo.title|escape}">
						<img src="{$galItem->mInfo.thumbnail_url.avatar}" alt="{$galItem->mInfo.title|escape}" />
					</a>
					<h2 class="heading">
						<div class="image-heading">{biticon iname="image-x-generic" isize="small" iexplain=$galItem->getContentTypeName()|escape}{$galItem->getDisplayLink()}</div>
					</h2>
					<div class="caption">
						<div class="meta floatright">
							{if $galItem->mInfo.event_time}
							<div class="photo-date date">
								{$galItem->mInfo.event_time|bit_short_date}
							</div>
							{/if}
							{if ($galItem->hasUpdatePermission() || $gContent->getPreference('link_original_images')) && $galItem->getDownloadUrl()}
							<div class="download">
								<a href="{$galItem->getDownloadUrl()}">{tr}Download Original{/tr}</a>
								{if $galItem->mInfo.width && $galItem->mInfo.height}
								<div class="photo-date">{$galItem->mInfo.width}x{$galItem->mInfo.height} {tr}pixels{/tr}</div>
								{/if}
							</div>
							{/if}
						</div>
						<div class="image-desc"><p>{$galItem->mInfo.description|escape}</p></div>
					</div>
				{elseif is_a($galItem, 'FisheyeGallery')}
					<a class="thumb" name="{$galItem->mContentId}" href="{$galItem->mPreviewImage->mInfo.thumbnail_url.large}" title="{$galItem->mInfo.title|escape}">
						<img src="{$galItem->mPreviewImage->mInfo.thumbnail_url.avatar}" alt="{$galItem->mInfo.title|escape}"/>
					</a>
					<div class="heading">
						<h2>{booticon iname="icon-picture"   isize="small" iexplain=$galItem->getContentTypeName()|escape}{$galItem->getDisplayLink()}</h2><span class="image-count">({$galItem->getImageCount()} {tr}Items{/tr})</span>
					</div>
					<div class="caption">
						<div class="image-desc">{$galItem->mInfo.description|escape}</div>
						<div class="download">
							
						</div>
					</div>
				{/if}
			</li>
			{/foreach}	
		</ul>			
		</div>
	</div>

	{include file="bitpackage:liberty/services_inc.tpl" serviceLocation='view' serviceHash=$gContent->mInfo}

	{if $gContent->getPreference('allow_comments') eq 'y'}
		{include file="bitpackage:liberty/comments.tpl"}
	{/if}

</div>

<div id="gallery" class="content">
	<div class="slideshow-container">
		<div id="heading" class="heading-container"></div>
		<div id="controls" class="controls"></div>
		<div id="loading" class="loader"></div>
		<div id="slideshow" class="slideshow"></div>
		<div id="imagedetails" class="image-details-container"></div>
	</div>
	<div id="caption" class="caption-container"></div>
</div>

<script type="text/javascript">/*<![CDATA[*/
{literal}
jQuery(document).ready(function($) {
	// We only want these styles applied when javascript is enabled
	$('div.content').css('display', 'block');

	// Initially set opacity on thumbs and add
	// additional styling for hover effect on thumbs
	var onMouseOutOpacity = 0.67;
	$('#thumbs ul.thumbs li').opacityrollover({
		mouseOutOpacity:   onMouseOutOpacity,
		mouseOverOpacity:  1.0,
		fadeSpeed:         'fast',
		exemptionSelector: '.selected'
	});
	
	// Initialize Advanced Galleriffic Gallery
	var gallery = $('#thumbs').galleriffic({
		delay:                     2500,
		numThumbs:                 30,
		preloadAhead:              10,
		enableTopPager:            true,
		enableBottomPager:         true,
		maxPagesToShow:            6,
		imageContainerSel:         '#slideshow',
		controlsContainerSel:      '#controls',
		headingContainerSel:       '#heading',
		captionContainerSel:       '#caption',
		loadingContainerSel:       '#loading',
		renderSSControls:          true,
		renderNavControls:         true,
		playLinkText:              '',
		playLinkImage:             '{/literal}{biticon iname="media-playback-start" isize="small" iexplain="Play Slideshow"}{literal}',
		pauseLinkText:             '',
		pauseLinkImage:            '{/literal}{biticon iname="media-playback-pause" isize="small" iexplain="Pause Slideshow"}{literal}',
		prevLinkText:              '&laquo;',
		nextLinkText:              '&raquo;',
		nextPageLinkText:          'Next &rsaquo;',
		prevPageLinkText:          '&lsaquo; Prev',
		enableHistory:             true,
		autoStart:                 false,
		syncTransitions:           false,
		defaultTransitionDuration: 250,
		onSlideChange:             function(prevIndex, currentIndex) {
			// 'this' refers to the gallery, which is an extension of $('#thumbs')
			this.find('ul.thumbs').children()
				.eq(prevIndex).fadeTo('fast', onMouseOutOpacity).end()
				.eq(currentIndex).fadeTo('fast', 1.0);

			// Update the photo index display
			$('.photo-index').html( (currentIndex+1) +' of '+ this.data.length);
		},
//      onTransitionOut:           function(slide, caption, isSync, callback) { },
//      onTransitionIn:            function(slide, caption, isSync) { },
		onImageLoadFinish:			function(pImageData) {
			jQuery.ajax({
				url: '{/literal}{$smarty.const.FISHEYE_PKG_URL}view_image_details.php?image_id={literal}'+pImageData.hash,
				success: function(data) {
					$('#imagedetails').html(data);
				}
			});
		},
		onPageTransitionOut:       function(callback) {
			this.fadeTo('fast', 0.0, callback);
		},
		onPageTransitionIn:        function() {
			var prevPageLink = this.find('a.prev').css('visibility', 'hidden');
			var nextPageLink = this.find('a.next').css('visibility', 'hidden');
			
			// Show appropriate next / prev page links
			if (this.displayedPage > 0)
				prevPageLink.css('visibility', 'visible');

			var lastPage = this.getNumPages() - 1;
			if (this.displayedPage < lastPage)
				nextPageLink.css('visibility', 'visible');

			this.fadeTo('fast', 1.0);
		}
	});

	/**************** Event handlers for custom next / prev page links **********************/

	gallery.find('a.prev').click(function(e) {
		gallery.previousPage();
		e.preventDefault();
	});

	gallery.find('a.next').click(function(e) {
		gallery.nextPage();
		e.preventDefault();
	});

	/**** Functions to support integration of galleriffic with the jquery.history plugin ****/

	// PageLoad function
	// This function is called when:
	// 1. after calling $.historyInit();
	// 2. after calling $.historyLoad();
	// 3. after pushing "Go Back" button of a browser
	function pageload(hash) {
		// alert("pageload: " + hash);
		// hash doesn't contain the first # character.
		if(hash) {
			$.galleriffic.gotoImage(hash);
		} else {
			gallery.gotoIndex(0);
		}
	}

	// Initialize history plugin.
	// The callback is called at once by present location.hash. 
	$.historyInit(pageload, "advanced.html");

	// set onlick event for buttons using the jQuery 1.3 live method
	$("a[rel='history']").live('click', function(e) {
		if (e.button != 0) return true;

		var hash = this.href;
		hash = hash.replace(/^.*#/, '');

		// moves to a new page. 
		// pageload is called at once. 
		// hash don't contain "#", "?"
		$.historyLoad(hash);

		return false;
	});

	/****************************************************************************************/
});
{/literal}
/*]]>*/</script>

</div>{/strip}