summaryrefslogtreecommitdiffstats
path: root/templates/list_header.inc.php
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2007-08-09 06:17:37 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2007-08-09 06:17:37 +0000
commit796c2692d0cfa4641e0c47700371c24a01412ed1 (patch)
tree33d8921798b9603c177a0dd2a025e09f3f32691f /templates/list_header.inc.php
parent905d434c669b634c6e070c60811a4a5ecfc1c67a (diff)
downloadampache-796c2692d0cfa4641e0c47700371c24a01412ed1.tar.gz
ampache-796c2692d0cfa4641e0c47700371c24a01412ed1.tar.bz2
ampache-796c2692d0cfa4641e0c47700371c24a01412ed1.zip
fixed lower paging horn, tweaked css for page-a-nation, added paging to playlists, genres and radio strations, added detection of purchase urls to find missing tracks on albums
Diffstat (limited to 'templates/list_header.inc.php')
-rw-r--r--templates/list_header.inc.php37
1 files changed, 14 insertions, 23 deletions
diff --git a/templates/list_header.inc.php b/templates/list_header.inc.php
index 8146261d..99589ae6 100644
--- a/templates/list_header.inc.php
+++ b/templates/list_header.inc.php
@@ -27,9 +27,13 @@
*/
// Pull these variables out to allow shorthand (easier for lazy programmers)
-$limit = $GLOBALS['user']->prefs['offset_limit'] ? $GLOBALS['user']->prefs['offset_limit'] : '25';
-$start = Browse::$start;
-$total = Browse::$total_objects;
+$limit = $GLOBALS['user']->prefs['offset_limit'] ? $GLOBALS['user']->prefs['offset_limit'] : '25';
+$start = Browse::$start;
+$total = Browse::$total_objects;
+$uid = Config::get('list_header_uid');
+
+// ++ the uid
+Config::set('list_header_uid',$uid+1);
// Next
$next_offset = $start + $limit;
@@ -59,7 +63,7 @@ $page = $current_page;
$i = 0;
/* While we have pages left */
while ($page > 0) {
- if ($i == '15') { $page_data['down'][1] = '...'; $page_data['down'][0] = '0'; break; }
+ if ($i == '10') { $page_data['down'][1] = '...'; $page_data['down'][0] = '0'; break; }
$i++;
$page = $page - 1;
$page_data['down'][$page] = $page * $limit;
@@ -71,7 +75,7 @@ $i = 0;
/* While we have pages left */
while ($page <= $pages) {
if ($page * $limit > $total) { break; }
- if ($i == '15') {
+ if ($i == '10') {
$key = $pages - 1;
if (!$page_data['up'][$key]) { $page_data['up'][$key] = '...'; }
$page_data['up'][$pages] = ($pages-1) * $limit;
@@ -86,26 +90,13 @@ while ($page <= $pages) {
ksort($page_data['up']);
ksort($page_data['down']);
-/* Detect the current script, this take a little work because we have to
- * account for FastCGI
- */
-preg_match("/.*\/(.+\.php)$/", $_SERVER['SCRIPT_NAME'], $matches);
-// Must be running Fast CGI or something similar
-if (!isset($matches['1'])) {
- // Try PHP_SELF
- preg_match("/.*\/(.+\.php)$/",$_SERVER['PHP_SELF'],$matches);
-}
-
-$action = "action=" . scrub_in($_REQUEST['action']);
-$script = Config::get('web_path') . "/" . $admin_menu . $matches[1];
-
// are there enough items to even need this view?
if ($pages > 1) {
?>
<table class="list-header" cellpadding="1" cellspacing="0" width="100%">
<tr>
<td valign="top">
- <?php echo Ajax::text('?action=page&start=' . $prev_offset,'[' . _('Prev') . ']','browse_prev','','list-header'); ?>
+ <?php echo Ajax::text('?action=page&start=' . $prev_offset,_('Prev'),'browse_' . $uid . 'prev','','list-header'); ?>
</td>
<td align="center">
<?php
@@ -115,27 +106,27 @@ if ($pages > 1) {
else {
// Hack Alert
$page++;
- echo Ajax::text('?action=page&start=' . $offset,$page,'browse_page_' . $page,'','list-header');
+ echo Ajax::text('?action=page&start=' . $offset,$page,'browse_' . $uid . 'page_' . $page,'','list-header');
}
} // end foreach down
/* Echo Out current Page */
$current_page = $current_page +1;
?>
- <span class="list-header"><strong><?php echo $current_page; ?></strong></span>&nbsp;
+ <span class="list-header-selected"><?php echo $current_page; ?></span>
<?php
/* Echo Out Everything Above Us */
foreach ($page_data['up'] as $page=>$offset) {
if ($offset === '...') { echo '...&nbsp;'; }
else {
- echo Ajax::text('?action=page&start=' . $offset,$page,'browse_page_' . $page,'','list-header');
+ echo Ajax::text('?action=page&start=' . $offset,$page,'browse_' . $uid . 'page_' . $page,'','list-header');
} // end else
} // end foreach up
?>
</td>
<td valign="top">
- <?php echo Ajax::text('?action=page&start=' . $next_offset,'[' . _('Next') . ']','browse_next','','list-header'); ?>
+ <?php echo Ajax::text('?action=page&start=' . $next_offset,_('Next'),'browse_' . $uid . 'next','','list-header'); ?>
</td>
</tr>
</table>