2009-01-17 00:52:50 +00:00
|
|
|
<?php defined("SYSPATH") or die("No direct script access.") ?>
|
2009-02-13 03:21:19 +00:00
|
|
|
<? // @todo Set hover on AlbumGrid list items ?>
|
2009-10-16 00:00:52 -06:00
|
|
|
<form action="<?= url::site("/search") ?>" id="g-search-form" class="g-short-form">
|
2009-02-13 03:21:19 +00:00
|
|
|
<fieldset>
|
|
|
|
|
<legend>
|
|
|
|
|
<?= t("Search") ?>
|
|
|
|
|
</legend>
|
|
|
|
|
<ul>
|
|
|
|
|
<li>
|
2013-02-18 18:55:03 +01:00
|
|
|
<? if ($album->id == item::root()->id): ?>
|
|
|
|
|
<label for="q"><?= t("Search the gallery") ?></label>
|
|
|
|
|
<? else: ?>
|
|
|
|
|
<label for="q"><?= t("Search this album") ?></label>
|
|
|
|
|
<? endif; ?>
|
2012-12-14 17:34:26 +00:00
|
|
|
<input name="album" type="hidden" value="<?= html::clean_attribute($album->id) ?>" />
|
2010-08-16 22:39:54 -06:00
|
|
|
<input name="q" id="q" type="text" value="<?= html::clean_attribute($q) ?>" class="text" />
|
2009-02-13 03:21:19 +00:00
|
|
|
</li>
|
|
|
|
|
<li>
|
2010-08-16 22:39:54 -06:00
|
|
|
<input type="submit" value="<?= t("Search")->for_html_attr() ?>" class="submit" />
|
2009-02-13 03:21:19 +00:00
|
|
|
</li>
|
|
|
|
|
</ul>
|
|
|
|
|
</fieldset>
|
|
|
|
|
</form>
|
2009-01-17 00:52:50 +00:00
|
|
|
|
2009-10-04 00:27:22 -06:00
|
|
|
<div id="g-search-results">
|
2009-10-28 12:15:52 -07:00
|
|
|
<h1><?= t("Search results") ?></h1>
|
2009-02-13 03:21:19 +00:00
|
|
|
|
2012-12-14 17:34:26 +00:00
|
|
|
<? if ($album->id == item::root()->id): ?>
|
|
|
|
|
<div>
|
|
|
|
|
<?= t("Searched the whole gallery.") ?>
|
|
|
|
|
</div>
|
|
|
|
|
<? else: ?>
|
|
|
|
|
<div>
|
|
|
|
|
<?= t("Searched within album <b>%album</b>.", array("album" => html::purify($album->title))) ?>
|
|
|
|
|
<a href="<?= url::site(url::merge(array("album" => item::root()->id))) ?>"><?= t("Search whole gallery") ?></a>
|
|
|
|
|
</div>
|
|
|
|
|
<? endif; ?>
|
|
|
|
|
|
2009-02-13 03:21:19 +00:00
|
|
|
<? if (count($items)): ?>
|
2009-10-25 23:46:09 -06:00
|
|
|
<ul id="g-album-grid" class="ui-helper-clearfix">
|
2009-01-17 00:52:50 +00:00
|
|
|
<? foreach ($items as $item): ?>
|
2009-11-21 10:58:26 -08:00
|
|
|
<? $item_class = $item->is_album() ? "g-album" : "g-photo" ?>
|
|
|
|
|
<li class="g-item <?= $item_class ?>">
|
2009-09-08 13:44:52 -07:00
|
|
|
<a href="<?= $item->url() ?>">
|
2012-06-05 11:20:31 +08:00
|
|
|
<?= $item->thumb_img(array("class" => "g-thumbnail")) ?>
|
2012-06-05 13:57:45 -07:00
|
|
|
<p>
|
|
|
|
|
<span class="<?= $item_class ?>"></span>
|
2009-11-21 10:58:26 -08:00
|
|
|
<?= html::purify(text::limit_chars($item->title, 32, "…")) ?>
|
2012-06-05 13:57:45 -07:00
|
|
|
</p>
|
|
|
|
|
<div>
|
2009-11-21 10:58:26 -08:00
|
|
|
<?= nl2br(html::purify(text::limit_chars($item->description, 64, "…"))) ?>
|
2009-02-13 03:21:19 +00:00
|
|
|
</div>
|
2009-01-17 00:52:50 +00:00
|
|
|
</a>
|
|
|
|
|
</li>
|
|
|
|
|
<? endforeach ?>
|
|
|
|
|
</ul>
|
2009-11-14 16:18:49 -08:00
|
|
|
<?= $theme->paginator() ?>
|
2009-02-13 03:21:19 +00:00
|
|
|
|
|
|
|
|
<? else: ?>
|
2009-05-31 00:11:48 -07:00
|
|
|
<p>
|
2009-08-29 12:48:40 -07:00
|
|
|
<?= t("No results found for <b>%term</b>", array("term" => $q)) ?>
|
2009-05-31 00:11:48 -07:00
|
|
|
</p>
|
2009-02-13 03:21:19 +00:00
|
|
|
|
|
|
|
|
<? endif; ?>
|
2009-01-17 00:52:50 +00:00
|
|
|
</div>
|