123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149 |
- <?php if(!empty($TemplateData['loadedCollection'])) { ?>
- <form method="post">
- <div class="field-row">
- <label for="search"><?php echo $I18n->t('advsearch.input.search.label'); ?></label>
- <input id="search" type="text" autocomplete="off" name="fdata[search]"
- placeholder="<?php echo $I18n->t('advsearch.input.search.placeholder'); ?>" size="50" />
- </div>
- <div class="field-row">
- <p><?php echo $I18n->t('advsearch.input.description'); ?></p>
- </div>
- <div class="field-row">
- <input type="submit" name="submitForm" value="<?php echo $I18n->t('global.search'); ?>" />
- </div>
- </form>
- <h4><?php echo $I18n->t('advsearch.headline.syntax'); ?></h4>
- <p><?php echo $I18n->t('advsearch.help.1'); ?></p>
- <p><?php echo $I18n->t('advsearch.help.2'); ?></p>
- <pre>title: bourne</pre>
- <p><?php echo $I18n->t('advsearch.explain.fields', $TemplateData['loadedCollection']['name'] ?? ''); ?></p>
- <pre style="white-space: normal">
- <?php foreach($TemplateData['collectionFields'] as $k=>$v) {
- echo $v['identifier']." ";
- } ?>
- </pre>
- <p><?php echo $I18n->t('advsearch.operators'); ?></p>
- <dl>
- <dt>*</dt>
- <dd><?php echo $I18n->t('advsearch.operators.asterisk'); ?></dd>
- <dt>+</dt>
- <dd><?php echo $I18n->t('advsearch.operators.plus'); ?></dd>
- <dt>−</dt>
- <dd><?php echo $I18n->t('advsearch.operators.minus'); ?></dd>
- <dt>"</dt>
- <dd><?php echo $I18n->t('advsearch.operators.quote'); ?></dd>
- <dt>></dt>
- <dd><?php echo $I18n->t('advsearch.operators.greater'); ?></dd>
- <dt><</dt>
- <dd><?php echo $I18n->t('advsearch.operators.less'); ?></dd>
- </dl>
- <?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('advsearch.result', $TemplateData['search'] ?? ''); ?></p>
- </div>
- </div>
- <script>
- const searchNoteWindowCloseButton = document.getElementById('searchNoteWindowCloseButton');
- searchNoteWindowCloseButton.addEventListener('click', () => {
- window.location.href="index.php?p=advancedsearch&collection=<?php echo $TemplateData['loadedCollection']['id']; ?>";
- });
- </script>
- <?php } ?>
- <?php if(!empty($TemplateData['entries'])) { ?>
- <form method="post" action="index.php?p=bulkedit&collection=<?php echo $TemplateData['loadedCollection']['id']; ?>">
- <?php foreach($TemplateData['entries']['ids'] as $f) { ?>
- <input type="hidden" name="bulkedit[]" value="<?php echo $f; ?>" />
- <?php } ?>
- <div class="field-row">
- <input type="submit" value="<?php echo $I18n->t('advsearch.submit.bulkedit'); ?>">
- </div>
- </form>
- <div class="sunken-panel">
- <table width="100%">
- <thead>
- <tr>
- <th width="60px"><?php echo $I18n->t('global.view'); ?></th>
- <?php
- foreach($TemplateData['collectionFields'] as $f) {
- if(in_array($f['id'],$TemplateData['loadedCollection']['advancedSearchTableFields'])) {
- echo '<th>'.$f['displayname'].'</th>';
- }
- }
- ?>
- </tr>
- </thead>
- <tbody>
- <?php foreach($TemplateData['entries']['results'] as $entryK=>$entry) { ?>
- <tr>
- <td>
- <a href="<?php echo $TemplateData['entryLinkPrefix']; ?>&id=<?php echo $entryK; ?>"><?php echo $I18n->t('global.view'); ?></a>
- </td>
- <?php
- foreach($entry['fields'] as $f) {
- if(in_array($f['id'],$TemplateData['loadedCollection']['advancedSearchTableFields'])) {
- ?>
- <td>
- <?php
- if(isset($f['value'])) {
- if(is_array($f['value'])) {
- echo Summoner::limitWithDots(implode(', ',$f['value']),100,'...');
- }
- else {
- echo Summoner::limitWithDots($f['value'],100,'...');
- }
- }
- ?>
- </td>
- <?php
- }
- }
- ?>
- </tr>
- <?php } ?>
- </tbody>
- </table>
- </div>
- <?php }
- } else { ?>
- <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=advancedsearch&collection=<?php echo $k; ?>"><?php echo $v['name']; ?></a></td>
- <td><?php echo $v['description']; ?></td>
- <tr>
- <?php } ?>
- </tbody>
- </table>
- </div>
- <?php } ?>
|