summaryrefslogtreecommitdiff
path: root/modules/search
diff options
context:
space:
mode:
authorshadlaws <shad@shadlaws.com>2013-02-18 18:55:03 +0100
committershadlaws <shad@shadlaws.com>2013-02-18 18:55:03 +0100
commit58c137c98183377c8bacaad83c9b32caa9925fa2 (patch)
tree1a1536de4a303818cf4df908f064341b8fc5b399 /modules/search
parentafa61f9d0d551bc2a0c4fa903eb3f55742720c8d (diff)
#2007 - Change search box text when only looking in the current album.
- search.html.php - updated to use new labels. - search_link.html.php - updated to use new labels. Moved code that determines current album to top, then used it for both the new label and the hidden album input. Resulting form code looks more symmetric to search.html.php.
Diffstat (limited to 'modules/search')
-rw-r--r--modules/search/views/search.html.php6
-rw-r--r--modules/search/views/search_link.html.php19
2 files changed, 16 insertions, 9 deletions
diff --git a/modules/search/views/search.html.php b/modules/search/views/search.html.php
index f1906744..a42c31dd 100644
--- a/modules/search/views/search.html.php
+++ b/modules/search/views/search.html.php
@@ -7,7 +7,11 @@
</legend>
<ul>
<li>
- <label for="q"><?= t("Search the gallery") ?></label>
+ <? 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>
diff --git a/modules/search/views/search_link.html.php b/modules/search/views/search_link.html.php
index be3305b7..4f9abc1a 100644
--- a/modules/search/views/search_link.html.php
+++ b/modules/search/views/search_link.html.php
@@ -1,19 +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>
- <label for="g-search"><?= t("Search the gallery") ?></label>
+ <? 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>
- <? if (isset($item) && $item instanceof Item_Model_Core): ?>
- <? if ($item->is_album()): ?>
- <input type="hidden" name="album" value="<?= $item->id ?>" />
- <? else: ?>
- <input type="hidden" name="album" value="<?= $item->parent_id ?>" />
- <? endif; ?>
- <? endif; ?>
</form>