123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124 |
- <?php if(!empty($TemplateData['pagination']) && $TemplateData['pagination']['pages'] > 1) { ?>
- <?php require Summoner::themefile('collections/collections_pagination.html', UI_THEME); ?>
- <?php if(!isset($TemplateData['pagination']['hideSort'])) { ?>
- <form method="get" action="index.php">
- <?php
- foreach($TemplateData['pagination']['currentGetParameters'] as $ck=>$cp) {
- echo '<input type="hidden" name="'.$ck.'" value="'.$cp.'" />';
- }
- ?>
- <select name="s">
- <?php if(!empty($TemplateData['defaultSortField'])) { ?>
- <option value="<?php echo $TemplateData['defaultSortField']; ?>"><?php echo $I18n->t('pagination.select.sort.default'); ?></option>
- <?php } else { ?>
- <option value=""><?php echo $I18n->t('pagination.select.sort.latest'); ?></option>
- <?php } ?>
- <?php
- if(!empty($TemplateData['simpleSearchFields'])) {
- foreach($TemplateData['simpleSearchFields'] as $k=>$v) {
- ?>
- <option value="<?php echo $k; ?>" <?php if(isset($v['selected'])) echo 'selected' ?> ><?php echo $I18n->t($v['displayname']); ?></option>
- <?php
- }
- }
- ?>
- </select>
- <select name="sd">
- <option value="ASC" <?php echo ($TemplateData['pagination']['currentGetParameters']['sd'] ?? '') == 'ASC' ? 'selected' : '' ?>><?php echo $I18n->t('global.ascending'); ?></option>
- <option value="DESC" <?php echo ($TemplateData['pagination']['currentGetParameters']['sd'] ?? '') == 'DESC' ? 'selected' : '' ?>><?php echo $I18n->t('global.descending'); ?></option>
- </select>
- <input type="submit" value="<?php echo $I18n->t('global.sort'); ?>" />
- </form>
- <?php } ?>
- <?php } ?>
- <?php if(!empty($TemplateData['search'])) { ?>
- <div class="window">
- <div class="title-bar">
- <div class="title-bar-text"><?php echo $I18n->t('global.search'); ?></div>
- <div class="title-bar-controls">
- <button aria-label="Close" id="searchNoteWindowCloseButton"></button>
- </div>
- </div>
- <div class="window-body">
- <p><?php echo $I18n->t('global.search.resultfor', $TemplateData['search'] ?? ''); ?></p>
- </div>
- </div>
- <script>
- const searchNoteWindowCloseButton = document.getElementById('searchNoteWindowCloseButton');
- searchNoteWindowCloseButton.addEventListener('click', () => {
- window.location.href="index.php?p=collections&collection=<?php echo $TemplateData['loadedCollection']['id']; ?>";
- });
- </script>
- <?php } ?>
- <?php if(!empty($TemplateData['entries'])) { ?>
- <h3><?php echo $TemplateData['loadedCollection']['name'] ?? ''; ?></h3>
- <div class="sunken-panel">
- <table width="100%">
- <thead>
- <tr>
- <th width="60px"><?php echo $I18n->t('global.image'); ?></th>
- <th width="300px"><?php echo $I18n->t('global.title'); ?></th>
- <th><?php echo $I18n->t('global.description'); ?></th>
- <th width="60px"><?php echo $I18n->t('global.sort'); ?></th>
- </tr>
- </thead>
- <tbody>
- <?php foreach($TemplateData['entries']['results'] as $entryK=>$entry) { ?>
- <tr>
- <td>
- <?php if(isset($entry['fields']['coverimage'])) { ?>
- <a href="<?php echo $TemplateData['entryLinkPrefix']; ?>&id=<?php echo $entryK; ?>">
- <img src="<?php echo $TemplateData['storagePath'].'/'.$entryK.'/'.$entry['fields']['coverimage']['value']; ?>"
- alt="<?php echo $I18n->t($entry['fields']['coverimage']['displayname']); ?>"
- width="50px">
- </a>
- <?php } ?>
- </td>
- <td>
- <?php if(isset($entry['fields']['title'])) {
- echo $entry['fields']['title']['value'];
- } ?>
- </td>
- <td>
- <?php if(isset($entry['fields']['description']['value'])) {
- echo $entry['fields']['description']['value'];
- } ?>
- </td>
- <td>
- <a href="<?php echo $TemplateData['entryLinkPrefix']; ?>&id=<?php echo $entryK; ?>"><?php echo $I18n->t('global.view'); ?></a>
- </td>
- </tr>
- <?php } ?>
- </tbody>
- </table>
- </div>
- <?php } elseif(!empty($TemplateData['collections'])) { ?>
- <h3><?php echo $I18n->t('global.collection.select.notice'); ?></h3>
- <div class="sunken-panel">
- <table width="100%">
- <thead>
- <tr>
- <th width="100px"><?php echo $I18n->t('global.name'); ?></th>
- <th><?php echo $I18n->t('global.description'); ?></th>
- </tr>
- </thead>
- <tbody>
- <?php foreach($TemplateData['collections'] as $k=>$v) { ?>
- <tr>
- <td><a href="index.php?p=collections&collection=<?php echo $k; ?>"><?php echo $v['name']; ?></a></td>
- <td><?php echo $v['description']; ?></td>
- <tr>
- <?php } ?>
- </tbody>
- </table>
- </div>
- <?php } ?>
- <?php if(!empty($TemplateData['pagination']) && $TemplateData['pagination']['pages'] > 1) { ?>
- <?php require Summoner::themefile('collections/collections_pagination.html', UI_THEME); ?>
- <?php } ?>
|