Advertisement
Guest User

Untitled

a guest
Mar 21st, 2019
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.71 KB | None | 0 0
  1. <?php
  2. /* CSS for the frontend-output */
  3. //$GLOBALS['TL_CSS'][] = 'bundles/markocupicgallerycreator/css/gallery_creator_fe.css';
  4. ?>
  5.  
  6. <?php if (!\Input::get('items')): ?>
  7. <!-- gallery_creator - album list -->
  8. <div class="<?= $this->class ?> gallery_creator block"<?= $this->cssID ?><?php if ($this->style): ?> style="<?= $this->style ?>"<?php endif; ?>>
  9. <?php if ($this->headline): ?>
  10. <<?= $this->hl ?>><?= $this->headline ?></<?= $this->hl ?>>
  11. <?php endif; ?>
  12.  
  13. <?= $this->pagination ?>
  14. <?php if (count($this->arrAlbums)>0): ?>
  15.  
  16. <ul class="list_albums row">
  17. <?php foreach ($this->arrAlbums as $Album): ?>
  18. <li class=" col-md-6 col-lg-4 level_1 <?= $Album['cssClass'] ?> clearfix block"<?= $this->imagemargin ? 'style="'.$this->imagemargin.'"' : '' ?>>
  19. <div class="tstamp block"><p>[<?= $Album['event_date'] ?>]</p></div>
  20. <div class="col_1">
  21. <figure class="image_container" onmouseover="<?= $Album['thumbMouseover'] ?>">
  22. <?php if ($Album['href']): ?>
  23. <a href="<?= $Album['href'] ?>" title="<?= $Album['title'] ?>">
  24. <?php endif; ?>
  25. <?php $this->insert('picture_default', $Album['picture']); ?>
  26. <?php if ($Album['href']): ?>
  27. </a>
  28. <?php endif; ?>
  29. </figure>
  30. </div>
  31. <div class="col_2">
  32. <?php if ($Album['href']): ?>
  33. <a href="<?= $Album['href'] ?>" title="<?= $Album['title'] ?>">
  34. <?php endif; ?>
  35. <h2><?= $Album['name'] ?></h2>
  36. <?php if ($Album['href']): ?>
  37. </a>
  38. <?php endif; ?>
  39.  
  40. <?php if ($Album['count']): ?>
  41. <p class="count_pics"><?= $Album['count'] ?> <?= $GLOBALS['TL_LANG']['gallery_creator']['pictures'] ?></p>
  42. <p class="visitors"><?= $Album['visitors'] ?> <?= $GLOBALS['TL_LANG']['gallery_creator']['visitors'] ?></p>
  43.  
  44. <?php endif; ?>
  45. <?php if ($Album['count_subalbums']): ?>
  46. <p class="count_pics"><?= $Album['count_subalbums'] ?> <?= $GLOBALS['TL_LANG']['gallery_creator']['subalbums'] ?></p>
  47. <?php endif; ?>
  48. <?php if ($Album['comment']): ?>
  49. <div class="album_comment"><?= $Album['comment'] ?></div>
  50. <?php endif; ?>
  51. </div>
  52. </li>
  53. <?php endforeach; ?>
  54. </ul>
  55. <?php endif; ?>
  56. </div>
  57. <?php endif; ?>
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64. <?php if (\Input::get('items')): ?>
  65. <!-- gallery_creator - album preview -->
  66. <div class="<?= $this->class ?> gallery_creator block"<?= $this->cssID ?><?php if ($this->style): ?> style="<?= $this->style ?>"<?php endif; ?>>
  67.  
  68. <?php if ($this->insertArticlePre):?>
  69. <!-- articleBoxPre-->
  70. <div id="articleBoxPre" class="block">
  71. <?= $this->insertArticlePre ?>
  72. </div>
  73. <!-- end articleBoxPre-->
  74. <?php endif; ?>
  75.  
  76. <?php if ($this->headline): ?>
  77. <<?= $this->hl ?>><?= $this->headline ?></<?= $this->hl ?>>
  78. <?php endif; ?>
  79.  
  80. <?php if ($this->backLink): ?>
  81. <div class="backLink"><a href="<?= $this->backLink ?>" title="zurück"><?= $GLOBALS['TL_LANG']['gallery_creator']['back_to_general_view'] ?></a></div>
  82. <?php endif; ?>
  83.  
  84. <?php if ($this->Albumname): ?>
  85. <h2><?= $this->Albumname ?></h2>
  86. <?php endif; ?>
  87.  
  88. <?php if ($this->subalbums): ?>
  89. <div class="subalbums">
  90. <h3><?= $GLOBALS['TL_LANG']['gallery_creator']['subalbums_of'] ?>: <?= $this->Albumname ?></h3>
  91.  
  92. <ul class="list_albums">
  93. <?php foreach ($this->subalbums as $Subalbum): ?>
  94. <li class="level_1 <?= $Subalbum['cssClass'] ?> clearfix block"<?= $this->imagemargin ? 'style="'.$this->imagemargin.'"' : '' ?>>
  95. <div class="tstamp block"><p>[<?= $Subalbum['event_date'] ?>]</p></div>
  96. <div class="col_1">
  97. <figure class="image_container" onmouseover="<?= $Subalbum['thumbMouseover'] ?>">
  98. <?php if ($Subalbum['href']): ?>
  99. <a href="<?= $Subalbum['href'] ?>" title="<?= $Subalbum['title'] ?>">
  100. <?php endif; ?>
  101. <?php $this->insert('picture_default', $Subalbum['picture']); ?>
  102. <?php if ($Subalbum['href']): ?>
  103. </a>
  104. <?php endif; ?>
  105. </figure>
  106. </div>
  107. <div class="col_2">
  108. <h2><?= $Subalbum['name'] ?></h2>
  109. <?php if ($Subalbum['count']): ?>
  110. <p class="count_pics"><?= $Subalbum['count'] ?> <?= $GLOBALS['TL_LANG']['gallery_creator']['pictures'] ?></p>
  111. <p class="visitors"><?= $Subalbum['visitors'] ?> <?= $GLOBALS['TL_LANG']['gallery_creator']['visitors'] ?></p>
  112. <?php endif; ?>
  113. <?php if ($Subalbum['count_subalbums']): ?>
  114. <p class="count_pics"><?= $Subalbum['count_subalbums'] ?> <?= $GLOBALS['TL_LANG']['gallery_creator']['subalbums'] ?></p>
  115. <?php endif; ?>
  116. <?php if ($Subalbum['comment']): ?>
  117. <div class="album_comment"><?= $Subalbum['comment'] ?></div>
  118. <?php endif; ?>
  119. </div>
  120. </li>
  121. <?php endforeach; ?>
  122. </ul>
  123. </div>
  124. <?php endif; ?>
  125.  
  126.  
  127. <?php if ($this->albumComment): ?>
  128. <div class="album_comment">
  129. <?= $this->albumComment ?>
  130. </div>
  131. <?php endif; ?>
  132.  
  133. <?= $this->pagination ?>
  134. <?php $col=0; ?>
  135. <?php if ($this->arrPictures): ?>
  136. <div id="galleryContainer" class="block">
  137. <ul class="album_preview row">
  138. <?php foreach ($this->arrPictures as $Picture): ?>
  139. <li class="col-md-4 col-lg-3 col_<?= $col ?><?= ($col == 0 ? ' col_first' : '') ?><?= ($col == $this->colsPerRow - 1 ? ' col_last' : '') ?>">
  140. <figure<?= (strlen($Picture['cssID']) ? ' id="' . $Picture['cssID'] . '"' : '') ?> class="image_container<?= strlen($Picture['cssClass']) ? ' ' . $Picture['cssClass'] : '' ?>"<?= $this->imagemargin ? ' style="'.$this->imagemargin.'"' : '' ?>>
  141. <?php if ($Picture['href']): ?>
  142. <a href="<?= $Picture['href'] ?>" <?= $Picture['lightbox'] ?> title="<?= $Picture['comment'] ? $Picture['comment'] : ($Picture['title'] ? $Picture['title'] : $Picture['filename']) ?>" data-config="<?php echo $Picture['album_id']; ?>,<?php echo $Picture['id']; ?>">
  143. <?php endif; ?>
  144. <?php $this->insert('picture_default', $Picture['picture']); ?>
  145. <?php if ($Picture['href'] != ''): ?>
  146. </a>
  147. <?php endif; ?>
  148. </figure>
  149. </li>
  150. <?php $col++;?>
  151. <?php if ($col == $this->colsPerRow) $col=0; ?>
  152. <?php endforeach;?>
  153. </ul>
  154. </div>
  155. <?php endif;?>
  156.  
  157. <?php if ($this->insertArticlePost):?>
  158. <!-- articleBoxPre-->
  159. <div id="articleBoxPost" class="block">
  160. <?= $this->insertArticlePost ?>
  161. </div>
  162. <!-- end articleBoxPost-->
  163. <?php endif; ?>
  164.  
  165. </div>
  166. <div id="hiddenLinks" style="display:none"></div>
  167. <script>
  168. $(document).ready(function() {
  169. if(jQuery('.album_preview a[data-config]').length < 1)
  170. {
  171. return;
  172. }
  173.  
  174. // Remove lightbox attribute
  175. jQuery(".album_preview a").removeAttr('data-lightbox');
  176.  
  177. // Prevent default
  178. jQuery(".album_preview a").click(function(event) {
  179. event.preventDefault();
  180. event.stopPropagation();
  181. });
  182.  
  183. var elFirst = jQuery('.album_preview a[data-config]').first();
  184. var arrData = jQuery(elFirst).data('config').split(',');
  185. var albumId = arrData[0];
  186. var href = location.pathname.substring(1) + '?isAjax=1&getImagesByPid=true&pid=' + albumId;
  187. $.getJSON(href, function(data) {
  188. if (data.src.length < 1) {
  189. return;
  190. }
  191.  
  192. jQuery.each(data.src, function(index, value) {
  193. // Add hidden links
  194. $('#hiddenLinks').append('<a href="' + value["href"] + '" title="' + value["caption"] + '" data-image-id="' + value["id"] + '" data-lightbox="xhrLb' + value["pid"] + '"></a>');
  195. if (index + 1 === data.src.length) {
  196. jQuery(".album_preview a[data-config]").click(function(event) {
  197. var arrConfig = jQuery(this).data('config').split(',');
  198. var imageId = arrConfig[1];
  199. // Bypass lightbox trigger
  200. jQuery('#hiddenLinks a[data-image-id="' + imageId + '"]').trigger('click');
  201. });
  202. // Colorbox
  203. $('#hiddenLinks a[data-lightbox]').map(function() {
  204. $(this).colorbox({
  205. // Put custom options here
  206. loop: false,
  207. rel: $(this).attr('data-lightbox'),
  208. maxWidth: '95%',
  209. maxHeight: '95%'
  210. });
  211. });
  212. }
  213. });
  214. });
  215. });
  216.  
  217. </script>
  218. <?php endif; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement