1
0
Fork 0
mirror of https://github.com/Yetangitu/ampache synced 2025-10-05 02:39:47 +02:00

added paging to the localplay playlist, fixed some preferences issues I introduced with the form register and caching

This commit is contained in:
Karl 'vollmerk' Vollmer 2008-08-05 01:46:01 +00:00
parent f3b10721ac
commit 0dbace41fe
6 changed files with 35 additions and 12 deletions

View file

@ -196,6 +196,7 @@ class Browse {
case 'album':
case 'artist':
case 'tag':
case 'playlist_localplay':
case 'shoutbox':
case 'live_stream':
// Set it
@ -215,7 +216,6 @@ class Browse {
// Rien a faire
break;
} // end type whitelist
} // set_type
/**
@ -790,10 +790,10 @@ class Browse {
* and requires the correct template based on the
* type that we are currently browsing
*/
public static function show_objects($object_ids='', $ajax=false) {
public static function show_objects($object_ids=false, $ajax=false) {
$object_ids = $object_ids ? $object_ids : self::get_saved();
// Reset the total items
self::$total_objects = count($object_ids);
@ -818,7 +818,7 @@ class Browse {
Ajax::start_container('browse_content');
// Switch on the type of browsing we're doing
switch ($_SESSION['browse']['type']) {
switch (self::$type) {
case 'song':
show_box_top(_('Songs') . $match, $class);
Song::build_cache($object_ids);
@ -857,6 +857,11 @@ class Browse {
require_once Config::get('prefix') . '/templates/show_playlist_songs.inc.php';
show_box_bottom();
break;
case 'playlist_localplay':
show_box_top(_('Current Playlist'));
require_once Config::get('prefix') . '/templates/show_localplay_playlist.inc.php';
show_box_bottom();
break;
case 'catalog':
show_box_top(_('Catalogs'), $class);
require_once Config::get('prefix') . '/templates/show_catalogs.inc.php';

View file

@ -66,6 +66,7 @@ class Preference {
$sql = "UPDATE `user_preference` SET `value`='$value' " .
"WHERE `preference`='$id'$user_check";
$db_results = Dba::query($sql);
Preference::clear_from_session();
return true;
}
else {
@ -337,6 +338,17 @@ class Preference {
} // load_from_session
/**
* clear_from_session
* This clears the users preferences, this is done whenever modifications are made to the preferences
* or the admin resets something
*/
public static function clear_from_session() {
unset($_SESSION['userdata']['preferences']);
} // clear_from_session
/**
* init
* This grabs the preferences and then loads them into conf it should be run on page load