aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-06-03 18:16:00 -0700
committerfriendica <info@friendica.com>2013-06-03 18:16:00 -0700
commitb866cc26fa95c6fc1df98bef2994350b9eb07231 (patch)
tree3d25070e6dca73adc5b2430f61aca013c9cc970b
parent1f94429b2cbfd5f86074c671f5293d09bddb7eaa (diff)
downloadvolse-hubzilla-b866cc26fa95c6fc1df98bef2994350b9eb07231.tar.gz
volse-hubzilla-b866cc26fa95c6fc1df98bef2994350b9eb07231.tar.bz2
volse-hubzilla-b866cc26fa95c6fc1df98bef2994350b9eb07231.zip
templatise alt_pager
-rwxr-xr-xinclude/text.php22
-rwxr-xr-xindex.php2
-rw-r--r--mod/directory.php2
-rw-r--r--view/tpl/alt_pager.tpl4
4 files changed, 15 insertions, 15 deletions
diff --git a/include/text.php b/include/text.php
index 9f32959b2..ba2f1209c 100755
--- a/include/text.php
+++ b/include/text.php
@@ -334,20 +334,16 @@ function alt_pager(&$a, $i, $more = '', $less = '') {
$pagenum = $a->pager['page'];
$url = $a->get_baseurl() . '/' . $stripped;
- $o .= '<div class="pager">';
-
- if($a->pager['page'] > 1)
- $o .= "<a href=\"$url"."&page=".($a->pager['page'] - 1).'">' . $less . '</a>';
- if($i > 0 && $i == $a->pager['itemspage']) {
- if($a->pager['page']>1)
- $o .= " | ";
- $o .= "<a href=\"$url"."&page=".($a->pager['page'] + 1).'">' . $more . '</a>';
- }
-
-
- $o .= '</div>'."\r\n";
+ return replace_macros(get_markup_template('alt_pager.tpl'),array(
+ '$has_less' => (($a->pager['page'] > 1) ? true : false),
+ '$has_more' => (($i > 0 && $i == $a->pager['itemspage']) ? true : false),
+ '$less' => $less,
+ '$more' => $more,
+ '$url' => $url,
+ '$prevpage' => $a->pager['page'] - 1,
+ '$nextpage' => $a->pager['page'] + 1,
+ ));
- return $o;
}
// Turn user/group ACLs stored as angle bracketed text into arrays
diff --git a/index.php b/index.php
index 7e3fd0ef1..cf9262bf7 100755
--- a/index.php
+++ b/index.php
@@ -2,7 +2,7 @@
/**
*
- * Friendica Red
+ * Red Matrix
*
*/
diff --git a/mod/directory.php b/mod/directory.php
index 7aeba3504..46fc34e16 100644
--- a/mod/directory.php
+++ b/mod/directory.php
@@ -166,7 +166,7 @@ function directory_content(&$a) {
));
- $o .= alt_pager($a,$j['records'], t('more'), t('back'));
+ $o .= alt_pager($a,$j['records'], t('next page'), t('previous page'));
}
else {
diff --git a/view/tpl/alt_pager.tpl b/view/tpl/alt_pager.tpl
new file mode 100644
index 000000000..140255eca
--- /dev/null
+++ b/view/tpl/alt_pager.tpl
@@ -0,0 +1,4 @@
+<div class="pager">
+{{if $has_less}}<a href="{{$url}}&page={{$prevpage}}" class="pager-prev">{{$less}}</a>{{/if}}
+{{if $has_more}}{{$if $has_less}}&nbsp;|&nbsp;{{/if}}<a href="{{$url}}&page={{$nextpage}}" class="pager-next">{{$more}}</a>{{/if}}
+</div>