overview.php 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. <?php
  2. /**
  3. * Insipid
  4. * Personal web-bookmark-system
  5. *
  6. * Copyright 2016-2021 Johannes Keßler
  7. *
  8. * Development starting from 2011: Johannes Keßler
  9. * https://www.bananas-playground.net/projekt/insipid/
  10. *
  11. * creator:
  12. * Luke Reeves <luke@neuro-tech.net>
  13. *
  14. * This program is free software: you can redistribute it and/or modify
  15. * it under the terms of the GNU General Public License as published by
  16. * the Free Software Foundation, either version 3 of the License, or
  17. * (at your option) any later version.
  18. *
  19. * This program is distributed in the hope that it will be useful,
  20. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  21. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  22. * GNU General Public License for more details.
  23. *
  24. * You should have received a copy of the GNU General Public License
  25. * along with this program. If not, see http://www.gnu.org/licenses/gpl-3.0.
  26. *
  27. */
  28. ?>
  29. <section class="section">
  30. <div class="columns">
  31. <?php require('_headNavIcons.inc.php'); ?>
  32. </div>
  33. <div class="columns">
  34. <div class="column">
  35. <?php if(!empty($subHeadline)) { ?>
  36. <h2 class="is-size-2"><?php echo $subHeadline; ?></h2>
  37. <?php } ?>
  38. </div>
  39. </div>
  40. <div class="columns">
  41. <div class="column is-half">
  42. <?php if($pagination['pages'] > 1) { ?>
  43. <nav class="pagination is-small" role="navigation" aria-label="pagination">
  44. <?php if($pagination['curPage'] > 1) {
  45. echo '<a href="index.php?'.Summoner::createFromParameterLinkQuery($currentGetParameters,array('page'=>($pagination['curPage']-1))).'"
  46. class="pagination-previous">'.$T->t('view.previous').'</a>';
  47. }
  48. if($pagination['curPage'] < $pagination['pages']) {
  49. echo '<a href="index.php?'.Summoner::createFromParameterLinkQuery($currentGetParameters,array('page'=>($pagination['curPage']+1))).'"
  50. class="pagination-next">'.$T->t('view.next').'</a>';
  51. }
  52. ?>
  53. <ul class="pagination-list">
  54. <?php
  55. $ellipsisShown = 0;
  56. for($i=1;$i<=$pagination['pages'];$i++) {
  57. $active = '';
  58. if($i == $pagination['curPage']) $active = 'is-current';
  59. if(in_array($i,$pagination['visibleRange'])) {
  60. echo '<li><a href="index.php?'.Summoner::createFromParameterLinkQuery($currentGetParameters,array('page'=>$i)).'"
  61. class="pagination-link '.$active.'"
  62. aria-label="Goto page '.$i.'">'. $i.'</a></li>';
  63. }
  64. else {
  65. if($i < $pagination['currentRangeStart'] && $ellipsisShown == 0) {
  66. echo '<li><span class="pagination-ellipsis">&hellip;</span></li>';
  67. $ellipsisShown = 1;
  68. }
  69. if($i > $pagination['currentRangeEnd'] && ($ellipsisShown == 0 || $ellipsisShown == 1)) {
  70. echo '<li><span class="pagination-ellipsis">&hellip;</span></li>';
  71. $ellipsisShown = 2;
  72. }
  73. }
  74. }
  75. ?>
  76. </ul>
  77. </nav>
  78. <?php } ?>
  79. </div>
  80. <div class="column is-half">
  81. <?php if(!empty($linkCollection['results'])) { ?>
  82. <div class="is-pulled-right">
  83. <a href="index.php?<?php echo $sortLink['default']; ?>"
  84. class="button is-small <?php if($sortLink['active'] === 'default') { ?>is-link<?php } ?>"><?php echo $T->t('view.sort.default'); ?></a>
  85. <a href="index.php?<?php echo $sortLink['name']; ?>"
  86. class="button is-small <?php if($sortLink['active'] === 'title') { ?>is-link<?php } ?>"><?php echo $T->t('view.sort.title'); ?></a>
  87. <a href="index.php?<?php echo $sortLink['direction']; ?>"
  88. class="button is-small <?php if($sortLink['activeDirection'] === true) { ?>is-link<?php } ?>"><span class="icon"><i class="ion-md-arrow-dropup"></i></span></a>
  89. </div>
  90. <?php } ?>
  91. </div>
  92. </div>
  93. </section>
  94. <section class="section">
  95. <?php if(!empty($linkCollection['results'])) { ?>
  96. <div class="columns is-multiline">
  97. <?php foreach ($linkCollection['results'] as $link) { ?>
  98. <div class="column is-one-quarter">
  99. <div class="card">
  100. <div class="card-image">
  101. <figure class="image is-4by3">
  102. <a href="<?php echo $link['link']; ?>" target="_blank">
  103. <?php if(!empty($link['image'])) { ?>
  104. <img class="linkthumbnail" src= "<?php echo $link['imageToShow']; ?>">
  105. <?php } else { ?>
  106. <img class="" src= "asset/img/no-link-picture.png">
  107. <?php } ?>
  108. </a>
  109. </figure>
  110. </div>
  111. <div class="card-content">
  112. <div class="content">
  113. <h4><a href="<?php echo $link['link']; ?>" target="_blank"><?php echo $link['title']; ?></a></h4>
  114. <p><?php echo $link['description']; ?></p>
  115. </div>
  116. </div>
  117. <footer class="card-footer">
  118. <a href="<?php echo $link['link']; ?>" target="_blank" class="card-footer-item"><?php echo $T->t('view.visit.link'); ?></a>
  119. <?php if($isAwm === true) { ?>
  120. <a href="index.php?p=editlink&id=<?php echo $link['hash']; ?>&awm=1" class="card-footer-item"><?php echo $T->t('view.edit'); ?></a>
  121. <?php } else { ?>
  122. <a href="index.php?p=linkinfo&id=<?php echo $link['hash']; ?>" class="card-footer-item"><?php echo $T->t('view.more.details'); ?></a>
  123. <?php } ?>
  124. </footer>
  125. </div>
  126. </div>
  127. <?php } ?>
  128. </div>
  129. <?php } if(!empty($tagCollection)) { ?>
  130. <div class="columns">
  131. <div class="column">
  132. <table class="table">
  133. <tr>
  134. <th><?php echo $T->t('view.name'); ?></th>
  135. <th><?php echo $T->t('view.num.links'); ?></th>
  136. </tr>
  137. <?php foreach ($tagCollection as $k=>$v) { ?>
  138. <tr>
  139. <td><a href="index.php?p=overview&m=tag&id=<?php echo urlencode($k); ?>"><?php echo $v['name']; ?></a></td>
  140. <td><?php echo $v['amount']; ?></td>
  141. </tr>
  142. <?php } ?>
  143. </table>
  144. </div>
  145. <?php if($displayEditButton === true) { ?>
  146. <div class="column">
  147. <div class="content">
  148. <a href="index.php?p=edittags" class="button is-small is-danger">
  149. <span class="icon"><i class="ion-md-create"></i></span>
  150. <span><?php echo $T->t('view.edit.tags'); ?></span>
  151. </a>
  152. </div>
  153. </div>
  154. <?php } ?>
  155. </div>
  156. <?php } if(!empty($categoryCollection)) { ?>
  157. <div class="columns">
  158. <div class="column">
  159. <table class="table">
  160. <tr>
  161. <th><?php echo $T->t('view.name'); ?></th>
  162. <th><?php echo $T->t('view.num.links'); ?></th>
  163. </tr>
  164. <?php foreach ($categoryCollection as $k=>$v) { ?>
  165. <tr>
  166. <td><a href="index.php?p=overview&m=category&id=<?php echo urlencode($k); ?>"><?php echo $v['name']; ?></a></td>
  167. <td><?php echo $v['amount']; ?></td>
  168. </tr>
  169. <?php } ?>
  170. </table>
  171. </div>
  172. <?php if($displayEditButton === true) { ?>
  173. <div class="column">
  174. <div class="content">
  175. <a href="index.php?p=editcategories" class="button is-small is-danger">
  176. <span class="icon"><i class="ion-md-create"></i></span>
  177. <span><?php echo $T->t('view.edit.categories'); ?></span>
  178. </a>
  179. </div>
  180. </div>
  181. <?php } ?>
  182. </div>
  183. <?php } ?>
  184. </section>