diff options
| author | Tristan Zur <tzur@webserver.ccwn.org> | 2015-06-10 20:55:53 +0200 |
|---|---|---|
| committer | Tristan Zur <tzur@webserver.ccwn.org> | 2015-06-10 20:55:53 +0200 |
| commit | 406abd7c4df1ace2cd3e4e17159e8941a2e8c0c4 (patch) | |
| tree | a324be16021f44f2fd6d55e609f47024e945b1db /modules/search/views | |
Initial import
Diffstat (limited to 'modules/search/views')
| -rw-r--r-- | modules/search/views/search.html.php | 65 | ||||
| -rw-r--r-- | modules/search/views/search_link.html.php | 22 |
2 files changed, 87 insertions, 0 deletions
diff --git a/modules/search/views/search.html.php b/modules/search/views/search.html.php new file mode 100644 index 0000000..a42c31d --- /dev/null +++ b/modules/search/views/search.html.php @@ -0,0 +1,65 @@ +<?php defined("SYSPATH") or die("No direct script access.") ?> +<? // @todo Set hover on AlbumGrid list items ?> +<form action="<?= url::site("/search") ?>" id="g-search-form" class="g-short-form"> + <fieldset> + <legend> + <?= t("Search") ?> + </legend> + <ul> + <li> + <? if ($album->id == item::root()->id): ?> + <label for="q"><?= t("Search the gallery") ?></label> + <? else: ?> + <label for="q"><?= t("Search this album") ?></label> + <? endif; ?> + <input name="album" type="hidden" value="<?= html::clean_attribute($album->id) ?>" /> + <input name="q" id="q" type="text" value="<?= html::clean_attribute($q) ?>" class="text" /> + </li> + <li> + <input type="submit" value="<?= t("Search")->for_html_attr() ?>" class="submit" /> + </li> + </ul> + </fieldset> +</form> + +<div id="g-search-results"> + <h1><?= t("Search results") ?></h1> + + <? 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; ?> + + <? if (count($items)): ?> + <ul id="g-album-grid" class="ui-helper-clearfix"> + <? foreach ($items as $item): ?> + <? $item_class = $item->is_album() ? "g-album" : "g-photo" ?> + <li class="g-item <?= $item_class ?>"> + <a href="<?= $item->url() ?>"> + <?= $item->thumb_img(array("class" => "g-thumbnail")) ?> + <p> + <span class="<?= $item_class ?>"></span> + <?= html::purify(text::limit_chars($item->title, 32, "…")) ?> + </p> + <div> + <?= nl2br(html::purify(text::limit_chars($item->description, 64, "…"))) ?> + </div> + </a> + </li> + <? endforeach ?> + </ul> + <?= $theme->paginator() ?> + + <? else: ?> + <p> + <?= t("No results found for <b>%term</b>", array("term" => $q)) ?> + </p> + + <? endif; ?> +</div> diff --git a/modules/search/views/search_link.html.php b/modules/search/views/search_link.html.php new file mode 100644 index 0000000..4f9abc1 --- /dev/null +++ b/modules/search/views/search_link.html.php @@ -0,0 +1,22 @@ +<?php defined("SYSPATH") or die("No direct script access.") ?> +<form action="<?= url::site("search") ?>" id="g-quick-search-form" class="g-short-form"> + <? if (isset($item)): ?> + <? $album_id = $item->is_album() ? $item->id : $item->parent_id; ?> + <? else: ?> + <? $album_id = item::root()->id; ?> + <? endif; ?> + <ul> + <li> + <? if ($album_id == item::root()->id): ?> + <label for="g-search"><?= t("Search the gallery") ?></label> + <? else: ?> + <label for="g-search"><?= t("Search this album") ?></label> + <? endif; ?> + <input type="hidden" name="album" value="<?= $album_id ?>" /> + <input type="text" name="q" id="g-search" class="text" /> + </li> + <li> + <input type="submit" value="<?= t("Go")->for_html_attr() ?>" class="submit" /> + </li> + </ul> +</form> |
