PageRenderTime 32ms CodeModel.GetById 12ms RepoModel.GetById 1ms app.codeStats 0ms

/templates/view_gallery_images_inc.tpl

https://github.com/tekimaki/fisheye
Smarty Template | 176 lines | 171 code | 5 blank | 0 comment | 16 complexity | e21d8837e500090762ea3de9c1ee34c4 MD5 | raw file
  1. {strip}
  2. {if $gContent->getLayout() == 'auto_flow'}
  3. {if $gBrowserInfo.browser eq 'ie'}
  4. <!-- we need this friggin table for MSIE that images don't float outside of the designated area - once again a hack for our favourite browser - grrr -->
  5. <table style="border:0;border-collapse:collapse;border-spacing:0; width:auto;"><tr><td>
  6. {/if}
  7. <div class="thumbnailblock">
  8. {foreach from=$gContent->mItems item=galItem key=itemContentId}
  9. {box class="box `$gContent->mInfo.thumbnail_size`-thmb `$galItem->mInfo.content_type_guid`"}
  10. {include file="bitpackage:liberty/services_inc.tpl" serviceLocation='body' serviceHash=$galItem->mInfo type=mini}
  11. {include file=$gLibertySystem->getMimeTemplate('inline',$galItem->mInfo.attachment_plugin_guid) attachment=$galItem->getPreviewHash()}
  12. {if $gBitSystem->isFeatureActive( 'fisheye_gallery_list_image_titles' )}
  13. <h2>{$galItem->getTitle()|escape}</h2>
  14. {/if}
  15. {if $gBitSystem->isFeatureActive( 'fisheye_gallery_list_image_descriptions' )}
  16. <p>{$galItem->mInfo.data|escape}</p>
  17. {/if}
  18. {/box}
  19. {foreachelse}
  20. <div class="norecords">{tr}This gallery is empty{/tr}. <a href="{$smarty.const.FISHEYE_PKG_URL}upload.php?gallery_id={$gContent->mGalleryId}">Upload pictures!</a></div>
  21. {/foreach}
  22. </div>
  23. {if $gBrowserInfo.browser eq 'ie'}
  24. </td></tr></table>
  25. {/if}
  26. <div class="clear"></div>
  27. {elseif $gContent->getLayout() == 'simple_list'}
  28. {assign var=thumbsize value='small'}
  29. <table class="data">
  30. <caption>{tr}List of files{/tr} <span class="total">[ {$galInfo.total_records|default:0} ]</span></caption>
  31. <tr>
  32. {if $thumbsize}
  33. <th style="width:1%"></th>
  34. {/if}
  35. <th style="width:60%">
  36. {smartlink ititle=Name isort=title icontrol=$galInfo}
  37. </th>
  38. {if $gBitSystem->isFeatureActive( 'fisheye_item_list_date' ) || $gBitSystem->isFeatureActive( 'fisheye_item_list_creator' )}
  39. <th style="width:10%">
  40. {smartlink ititle=Uploaded isort=created iorder=desc idefault=1 icontrol=$galInfo}
  41. </th>
  42. {/if}
  43. {if $gBitSystem->isFeatureActive( 'fisheye_item_list_size' )}
  44. <th style="width:10%">{tr}Size{/tr} /<br />{tr}Duration{/tr}</th>
  45. {/if}
  46. {if $gBitSystem->isFeatureActive( 'fisheye_item_list_hits' )}
  47. <th style="width:10%">
  48. {smartlink ititle=Downloads isort="lch.hits" icontrol=$galInfo}
  49. </th>
  50. {/if}
  51. <th style="width:20%">{tr}Actions{/tr}</th>
  52. </tr>
  53. {foreach from=$gContent->mItems item=galItem}
  54. <tr class="{cycle values="odd,even"}">
  55. {if $thumbsize}
  56. <td style="text-align:center;">
  57. {if $galItem->mInfo.content_type_guid != 'fisheyegallery' }
  58. {if $gBitSystem->isFeatureActive( 'site_fancy_zoom' )}
  59. {if $gContent->hasUpdatePermission() || $gGallery && $gGallery->getPreference( 'link_original_images' )}
  60. <a href="{$galItem->mInfo.source_url|escape}">
  61. {else}
  62. <a href="{$galItem->mInfo.thumbnail_url.large}">
  63. {/if}
  64. {/if}
  65. <img src="{$galItem->mInfo.thumbnail_url.$thumbsize}" alt="{$galItem->getTitle()|escape}" title="{$galItem->getTitle()|escape}" />
  66. {if $gBitSystem->isFeatureActive( 'site_fancy_zoom' )}
  67. </a>
  68. {/if}
  69. {else}
  70. <a href="{$galItem->getDisplayUrl()|escape}">
  71. <img class="thumb" src="{$galItem->getThumbnailUri()}" alt="{$galItem->getTitle()|escape|default:'image'}" />
  72. </a>
  73. {/if}
  74. </td>
  75. {/if}
  76. <td>
  77. <h3><a href="{$galItem->getDisplayUrl()}">{$galItem->getTitle()|escape}</a></h3>
  78. {if $gBitSystem->isFeatureActive( 'fisheye_item_list_desc' ) && $galItem->mInfo.data}
  79. {$galItem->mInfo.parsed_data}
  80. {/if}
  81. {if $gBitSystem->isFeatureActive( 'fisheye_item_list_attid' )}
  82. <small>{$galItem->mInfo.wiki_plugin_link}</small>
  83. {assign var=br value=1}
  84. {/if}
  85. {if $gBitSystem->isFeatureActive( 'fisheye_item_list_name' )}
  86. {if $br}<br />{/if}
  87. {if $gBitUser->hasPermission( 'p_treasury_view_item' )}
  88. <a href="{$galItem->getDisplayUrl()}">
  89. {/if}
  90. {$galItem->mInfo.filename} <small>({$galItem->mInfo.mime_type})</small>
  91. {if $gBitUser->hasPermission( 'p_treasury_view_item' )}
  92. </a>
  93. {/if}
  94. {/if}
  95. </td>
  96. {if $gBitSystem->isFeatureActive( 'fisheye_item_list_date' ) || $gBitSystem->isFeatureActive( 'fisheye_item_list_creator' )}
  97. <td>
  98. {if $gBitSystem->isFeatureActive( 'fisheye_item_list_date' )}
  99. {$galItem->mInfo.created|bit_short_date}<br />
  100. {/if}
  101. {if $gBitSystem->isFeatureActive( 'fisheye_item_list_creator' )}
  102. {tr}by{/tr}: {displayname hash=$galItem->mInfo}
  103. {/if}
  104. </td>
  105. {/if}
  106. {if $gBitSystem->isFeatureActive( 'fisheye_item_list_size' )}
  107. <td style="text-align:right;">
  108. {if $galItem->mInfo.download_url}
  109. {$galItem->mInfo.file_size|display_bytes}
  110. {/if}
  111. {if $galItem->mInfo.prefs.duration}
  112. {if $galItem->mInfo.download_url} / {/if}{$galItem->mInfo.prefs.duration|display_duration}
  113. {/if}
  114. </td>
  115. {/if}
  116. {if $gBitSystem->isFeatureActive( 'fisheye_item_list_hits' )}
  117. <td style="text-align:right;">
  118. {$galItem->mInfo.hits|default:"{tr}none{/tr}"}
  119. </td>
  120. {/if}
  121. <td class="actionicon">
  122. {if $galItem->mInfo.content_type_guid != 'fisheyegallery' }
  123. {if $gBitUser->hasPermission( 'p_treasury_download_item' ) && $galItem->mInfo.download_url}
  124. <a href="{$galItem->mInfo.download_url}">{biticon ipackage="icons" iname="emblem-downloads" iexplain="Download File"}</a>
  125. {/if}
  126. {if $gBitUser->hasPermission( 'p_treasury_view_item' )}
  127. <a href="{$galItem->getDisplayUrl()}">{biticon ipackage="icons" iname="document-open" iexplain="View File"}</a>
  128. {/if}
  129. {if $gContent->isOwner( $galItem->mInfo ) || $gBitUser->isAdmin()}
  130. <a href="{$smarty.const.FISHEYE_PKG_URL}edit_image.php?content_id={$galItem->mInfo.content_id}&amp;action=edit">{biticon ipackage="icons" iname="accessories-text-editor" iexplain="Edit File"}</a>
  131. <a href="{$smarty.const.FISHEYE_PKG_URL}edit_image.php?content_id={$galItem->mInfo.content_id}&amp;delete=1">{biticon ipackage="icons" iname="edit-delete" iexplain="Remove File"}</a>
  132. {/if}
  133. {/if}
  134. </td>
  135. </tr>
  136. {/foreach}
  137. </table>
  138. {else}
  139. <table class="thumbnailblock">
  140. {counter assign="imageCount" start="0" print=false}
  141. {assign var="max" value=100}
  142. {assign var="tdWidth" value="`$max/$cols_per_page`"}
  143. {foreach from=$gContent->mItems item=galItem key=itemContentId}
  144. {if $imageCount % $cols_per_page == 0}
  145. <tr > <!-- Begin Image Row -->
  146. {/if}
  147. <td style="width:{$tdWidth}%; vertical-align:top;"> <!-- Begin Image Cell -->
  148. {include file="bitpackage:liberty/services_inc.tpl" serviceLocation='body' serviceHash=$galItem->mInfo type=mini}
  149. {box class="box `$galItem->mInfo.content_type_guid`"}
  150. {if $gBitSystem->isFeatureActive( 'fisheye_gallery_list_image_titles' )}
  151. <h2>{$galItem->getTitle()|escape}</h2>
  152. {/if}
  153. <a href="{$galItem->getDisplayUrl()|escape}">
  154. <img class="thumb" src="{$galItem->getThumbnailUri()}" alt="{$galItem->getTitle()|escape|default:'image'}" />
  155. </a>
  156. {if $gBitSystem->isFeatureActive( 'fisheye_gallery_list_image_descriptions' )}
  157. <p>{$galItem->mInfo.data|escape}</p>
  158. {/if}
  159. {/box}
  160. </td> <!-- End Image Cell -->
  161. {counter}
  162. {if $imageCount % $cols_per_page == 0}
  163. </tr> <!-- End Image Row -->
  164. {/if}
  165. {foreachelse}
  166. <tr><td class="norecords">{tr}This gallery is empty{/tr}. <a href="{$smarty.const.FISHEYE_PKG_URL}upload.php?gallery_id={$gContent->mGalleryId}">Upload pictures!</a></td></tr>
  167. {/foreach}
  168. {if $imageCount % $cols_per_page != 0}</tr>{/if}
  169. </table>
  170. {/if}
  171. {/strip}