aboutsummaryrefslogtreecommitdiff
path: root/templates/bookmarks.tpl.php
diff options
context:
space:
mode:
authormensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f>2009-05-19 15:59:55 +0000
committermensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f>2009-05-19 15:59:55 +0000
commit1eca2d231c79c046a3c122a09bd761fa8f641a6e (patch)
tree7584daebb596d852e1d1a813a90bba5686925de3 /templates/bookmarks.tpl.php
parent01c62e34fcd095e583f00a1890e6f311fbcb47dd (diff)
downloadsemanticscuttle-1eca2d231c79c046a3c122a09bd761fa8f641a6e.tar.gz
semanticscuttle-1eca2d231c79c046a3c122a09bd761fa8f641a6e.tar.bz2
Many interface changes: add 'back to the top links', a variable to display more bookmarks for admins...
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@329 b3834d28-1941-0410-a4f8-b48e95affb8f
Diffstat (limited to 'templates/bookmarks.tpl.php')
-rw-r--r--templates/bookmarks.tpl.php107
1 files changed, 59 insertions, 48 deletions
diff --git a/templates/bookmarks.tpl.php b/templates/bookmarks.tpl.php
index 5aefc82..5820a4b 100644
--- a/templates/bookmarks.tpl.php
+++ b/templates/bookmarks.tpl.php
@@ -133,6 +133,60 @@ if($currenttag!= '') {
}
?></p>
+<?php
+ // PAGINATION
+
+ // Ordering
+ $sortOrder = '';
+ if (GET_SORT != '') {
+ $sortOrder = 'sort='. GET_SORT;
+ }
+
+ $sortAmp = (($sortOrder) ? '&amp;'. $sortOrder : '');
+ $sortQue = (($sortOrder) ? '?'. $sortOrder : '');
+
+ // Previous
+ $perpage = getPerPageCount($currentUser);
+ if (!$page || $page < 2) {
+ $page = 1;
+ $start = 0;
+ $bfirst = '<span class="disable">'. T_('First') .'</span>';
+ $bprev = '<span class="disable">'. T_('Previous') .'</span>';
+ } else {
+ $prev = $page - 1;
+ $prev = 'page='. $prev;
+ $start = ($page - 1) * $perpage;
+ $bfirst= '<a href="'. sprintf($nav_url, $user, $currenttag, '') . $sortQue .'">'. T_('First') .'</a>';
+ $bprev = '<a href="'. sprintf($nav_url, $user, $currenttag, '?') . $prev . $sortAmp .'">'. T_('Previous') .'</a>';
+ }
+
+ // Next
+ $next = $page + 1;
+ $totalpages = ceil($total / $perpage);
+ if (count($bookmarks) < $perpage || $perpage * $page == $total) {
+ $bnext = '<span class="disable">'. T_('Next') .'</span>';
+ $blast = '<span class="disable">'. T_('Last') ."</span>\n";
+ } else {
+ $bnext = '<a href="'. sprintf($nav_url, $user, $currenttag, '?page=') . $next . $sortAmp .'">'. T_('Next') .'</a>';
+ $blast = '<a href="'. sprintf($nav_url, $user, $currenttag, '?page=') . $totalpages . $sortAmp .'">'. T_('Last') ."</a>\n";
+ }
+
+ // RSS
+ $brss = '';
+ $size = count($rsschannels);
+ for ($i = 0; $i < $size; $i++) {
+ $brss = '<a style="background:#FFFFFF" href="'. $rsschannels[$i][1] .'" title="'. $rsschannels[$i][0] .'"><img src="'. ROOT .'images/rss.gif" width="16" height="16" alt="'. $rsschannels[$i][0] .'" /></a>';
+ }
+
+ $pagesBanner = '<p class="paging">'. $bfirst .'<span> / </span>'. $bprev .'<span> / </span>'. $bnext .'<span> / </span>'. $blast .'<span> / </span>'. sprintf(T_('Page %d of %d'), $page, $totalpages) ." ". $brss ." </p>\n";
+
+ if(getPerPageCount($currentUser) > 10) {
+ echo $pagesBanner; // display a page banner if too many bookmarks to manage
+ }
+
+
+?>
+
<ol <?php echo ($start > 0 ? ' start="'. ++$start .'"' : ''); ?>
@@ -204,7 +258,7 @@ if($currenttag!= '') {
if ($userservice->isLoggedOn()
&& ($currentUser->getId() != $row['uId'])
&& !$bookmarkservice->bookmarkExists($row['bAddress'], $currentUser->getId())) {
- $copy .= ' - <a href="'. createURL('bookmarks', $currentUser->getUsername() .'?action=add&amp;copyOf='. $row['bId']) .'">'. T_('Copy') .'</a>';
+ $copy .= ' - <a href="'. createURL('bookmarks', $currentUser->getUsername() .'?action=add&amp;copyOf='. $row['bId']) .'" title="'.T_('Copy this bookmark to YOUR bookmarks.').'">'. T_('Copy') .'</a>';
}
// Nofollow option
@@ -272,54 +326,11 @@ if($currenttag!= '') {
</ol>
<?php
- // PAGINATION
-
- // Ordering
- $sortOrder = '';
- if (GET_SORT != '') {
- $sortOrder = 'sort='. GET_SORT;
- }
-
- $sortAmp = (($sortOrder) ? '&amp;'. $sortOrder : '');
- $sortQue = (($sortOrder) ? '?'. $sortOrder : '');
-
- // Previous
- $perpage = getPerPageCount();
- if (!$page || $page < 2) {
- $page = 1;
- $start = 0;
- $bfirst = '<span class="disable">'. T_('First') .'</span>';
- $bprev = '<span class="disable">'. T_('Previous') .'</span>';
- } else {
- $prev = $page - 1;
- $prev = 'page='. $prev;
- $start = ($page - 1) * $perpage;
- $bfirst= '<a href="'. sprintf($nav_url, $user, $currenttag, '') . $sortQue .'">'. T_('First') .'</a>';
- $bprev = '<a href="'. sprintf($nav_url, $user, $currenttag, '?') . $prev . $sortAmp .'">'. T_('Previous') .'</a>';
- }
-
- // Next
- $next = $page + 1;
- $totalpages = ceil($total / $perpage);
- if (count($bookmarks) < $perpage || $perpage * $page == $total) {
- $bnext = '<span class="disable">'. T_('Next') .'</span>';
- $blast = '<span class="disable">'. T_('Last') ."</span>\n";
- } else {
- $bnext = '<a href="'. sprintf($nav_url, $user, $currenttag, '?page=') . $next . $sortAmp .'">'. T_('Next') .'</a>';
- $blast = '<a href="'. sprintf($nav_url, $user, $currenttag, '?page=') . $totalpages . $sortAmp .'">'. T_('Last') ."</a>\n";
+ if(getPerPageCount($currentUser)>7) {
+ echo '<p class="backToTop"><a href="#header" title="'.T_('Come back to the top of this page.').'">'.T_('Top of the page').'</a></p>';
}
-
- // RSS
- $brss = '';
- $size = count($rsschannels);
- for ($i = 0; $i < $size; $i++) {
- $brss = '<a style="background:#FFFFFF" href="'. $rsschannels[$i][1] .'" title="'. $rsschannels[$i][0] .'"><img src="'. ROOT .'images/rss.gif" width="16" height="16" alt="'. $rsschannels[$i][0] .'" /></a>';
- }
-
- echo '<p class="paging">'. $bfirst .'<span> / </span>'. $bprev .'<span> / </span>'. $bnext .'<span> / </span>'. $blast .'<span> / </span>'. sprintf(T_('Page %d of %d'), $page, $totalpages) ." ". $brss ." </p>\n";
-
-
-
+ echo $pagesBanner; // display previous and next links pages + RSS link
+
} else {
echo '<p class="error">'.T_('No bookmarks available').'</p>';