summaryrefslogtreecommitdiff
path: root/modules/search/views/search.html.php
blob: fb1fd8a901548e969e4ed80e00bf32a0faee9908 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php defined("SYSPATH") or die("No direct script access.") ?>
<? // @todo Set hover on AlbumGrid list items ?>
<form action="<?= url::site("/search") ?>" id="gSearchForm">
  <fieldset>
    <legend>
      <?= t("Search") ?>
    </legend>
    <ul>
      <li>
        <label for="q"><?= t("Search the gallery") ?></label>
        <input name="q" id="q" type="text" value="<?= $q ?>"/>
      </li>
      <li>
        <input type="submit" value="<?= t("Search") ?>" />
      </li>
    </ul>
  </fieldset>
</form>

<div id="gSearchResults">
  <h1><?= t("Search Results") ?></h1>

  <? if (count($items)): ?>
  <ul id="gAlbumGrid">
    <? foreach ($items as $item): ?>
      <? $item_class = "gPhoto"; ?>
      <? if ($item->is_album()): ?>
        <? $item_class = "gAlbum"; ?>
      <? endif ?>
   <li class="gItem <?= $item_class ?>">
      <a href="<?= url::site("items/$item->id") ?>">
        <?= $item->thumb_tag() ?>
        <p>
          <?= $item->title ?>
        </p>
        <div>
          <?= $item->description ?>
        </div>
      </a>
    </li>
    <? endforeach ?>
  </ul>
  <?= $theme->pager() ?>

  <? else: ?>
  <p><?= t("No results found for '") . $q . "'" ?></p>

  <? endif; ?>
</div>