overview.php 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  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 is-half">
  132. <?php if($displayEditButton === true) { ?>
  133. <div class="column">
  134. <div class="content">
  135. <a href="index.php?p=edittags" class="button is-small is-danger">
  136. <span class="icon"><i class="ion-md-create"></i></span>
  137. <span><?php echo $T->t('view.edit.tags'); ?></span>
  138. </a>
  139. </div>
  140. </div>
  141. <?php } ?>
  142. <div class="column">
  143. <table class="table">
  144. <tr>
  145. <th><?php echo $T->t('view.name'); ?></th>
  146. <th><?php echo $T->t('view.num.links'); ?></th>
  147. </tr>
  148. <?php foreach ($tagCollection as $k=>$v) { ?>
  149. <tr>
  150. <td><a href="index.php?p=overview&m=tag&id=<?php echo urlencode($k); ?>"><?php echo $v['name']; ?></a></td>
  151. <td><?php echo $v['amount']; ?></td>
  152. </tr>
  153. <?php } ?>
  154. </table>
  155. </div>
  156. </div>
  157. <div class="column is-half">
  158. <?php if(!empty($colInfo)) { ?>
  159. <?php echo $T->t('view.tag.topcombination'); ?>
  160. <table class="table">
  161. <tr>
  162. <th>#</th>
  163. <th><?php echo $T->t('view.tags'); ?></th>
  164. </tr>
  165. <?php foreach ($colInfo as $k=>$v) { ?>
  166. <tr>
  167. <td><?php echo $v['amount']; ?></td>
  168. <td>
  169. <?php foreach ($v['rel'] as $tid=>$tname) { ?>
  170. <a href="index.php?p=overview&m=tag&id=<?php echo urlencode($tid); ?>"><?php echo $tname; ?></a>
  171. <?php } ?>
  172. </td>
  173. </tr>
  174. <?php } ?>
  175. </table>
  176. <?php } ?>
  177. </div>
  178. </div>
  179. <?php } if(!empty($categoryCollection)) { ?>
  180. <div class="columns">
  181. <div class="column is-half">
  182. <?php if($displayEditButton === true) { ?>
  183. <div class="column">
  184. <div class="content">
  185. <a href="index.php?p=editcategories" class="button is-small is-danger">
  186. <span class="icon"><i class="ion-md-create"></i></span>
  187. <span><?php echo $T->t('view.edit.categories'); ?></span>
  188. </a>
  189. </div>
  190. </div>
  191. <?php } ?>
  192. <div class="column">
  193. <table class="table">
  194. <tr>
  195. <th><?php echo $T->t('view.name'); ?></th>
  196. <th><?php echo $T->t('view.num.links'); ?></th>
  197. </tr>
  198. <?php foreach ($categoryCollection as $k=>$v) { ?>
  199. <tr>
  200. <td><a href="index.php?p=overview&m=category&id=<?php echo urlencode($k); ?>"><?php echo $v['name']; ?></a></td>
  201. <td><?php echo $v['amount']; ?></td>
  202. </tr>
  203. <?php } ?>
  204. </table>
  205. </div>
  206. </div>
  207. <div class="column is-half">
  208. <?php if(!empty($colInfo)) { ?>
  209. <?php echo $T->t('view.category.topcombination'); ?>
  210. <table class="table">
  211. <tr>
  212. <th>#</th>
  213. <th><?php echo $T->t('view.categories'); ?></th>
  214. </tr>
  215. <?php foreach ($colInfo as $k=>$v) { ?>
  216. <tr>
  217. <td><?php echo $v['amount']; ?></td>
  218. <td>
  219. <?php foreach ($v['rel'] as $cid=>$cname) { ?>
  220. <a href="index.php?p=overview&m=category&id=<?php echo urlencode($cid); ?>"><?php echo $cname; ?></a>
  221. <?php } ?>
  222. </td>
  223. </tr>
  224. <?php } ?>
  225. </table>
  226. <?php } ?>
  227. </div>
  228. </div>
  229. <?php } ?>
  230. </section>