[art-web] Remember search terms from page to page and when changing sort options
- From: Thomas Wood <thos src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [art-web] Remember search terms from page to page and when changing sort options
- Date: Sat, 28 Nov 2009 15:03:05 +0000 (UTC)
commit 247c3dbfd4c723c7c8a398bb33150d2add005fea
Author: Thomas Wood <thos gnome org>
Date: Sat Nov 28 15:02:58 2009 +0000
Remember search terms from page to page and when changing sort options
lib/pagination.php | 16 +++++++++++-----
views/backgrounds.php | 4 ++++
views/themes.php | 3 +++
3 files changed, 18 insertions(+), 5 deletions(-)
---
diff --git a/lib/pagination.php b/lib/pagination.php
index 9211643..b677a9c 100644
--- a/lib/pagination.php
+++ b/lib/pagination.php
@@ -47,10 +47,16 @@ class Paginator
$cur_page = ceil ($this->start / $this->limit);
$prev_page = $cur_page - 1;
+
+ if ($search = GET ('text'))
+ $get_params = "&text=$search";
+ else
+ $get_params = '';
+
if ($cur_page > 1)
{
- print ("<a href=\"?page=1\">First</a> · ");
- print ("<a href=\"?page=$prev_page\">Previous</a>");
+ print ("<a href=\"?page=1$get_params\">First</a> · ");
+ print ("<a href=\"?page=$prev_page$get_params\">Previous</a>");
}
else
{
@@ -69,15 +75,15 @@ class Paginator
if ($i == $cur_page)
print (" · $i ");
else
- print (" · <a href=\"?page=$i\">$i</a>");
+ print (" · <a href=\"?page=$i$get_params\">$i</a>");
}
$next_page = $cur_page + 1;
if ($cur_page < $num_pages)
{
- print (" · <a href=\"?page=${next_page}\">Next</a>");
- print (" · <a href=\"?page=${num_pages}\">Last</a>");
+ print (" · <a href=\"?page=${next_page}$get_params\">Next</a>");
+ print (" · <a href=\"?page=${num_pages}$get_params\">Last</a>");
}
else
{
diff --git a/views/backgrounds.php b/views/backgrounds.php
index b86143d..262e6db 100644
--- a/views/backgrounds.php
+++ b/views/backgrounds.php
@@ -91,6 +91,10 @@ function selected ($a, $b)
</select>
</label>
+ <?php if ($search_text): ?>
+ <input type="hidden" name="text" value="<?php echo $search_text ?>">
+ <?php endif ?>
+
<noscript>
<input type="submit" value="Go" style="font-size: small;">
</noscript>
diff --git a/views/themes.php b/views/themes.php
index 6459517..42dcae1 100644
--- a/views/themes.php
+++ b/views/themes.php
@@ -99,6 +99,9 @@ String.prototype.rot13 = rot13 = function(s)
<noscript>
<input type="submit" value="Go" style="font-size: small;">
</noscript>
+ <?php if ($search_text): ?>
+ <input type="hidden" name="text" value="<?php echo $search_text ?>">
+ <?php endif ?>
</label>
</form>
<br>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]