From 79ca59df627660d635a9373bfeb293592c173793 Mon Sep 17 00:00:00 2001 From: Karl 'vollmerk' Vollmer Date: Fri, 28 Sep 2007 04:34:02 +0000 Subject: fixed some localplay issues, now correctly shows the active instance at least for the MPD module --- lib/class/localplay.abstract.php | 2 +- lib/class/localplay.class.php | 22 ++++++++++++++++++++++ lib/class/user.class.php | 15 +++++++-------- lib/ui.lib.php | 9 +-------- 4 files changed, 31 insertions(+), 17 deletions(-) (limited to 'lib') diff --git a/lib/class/localplay.abstract.php b/lib/class/localplay.abstract.php index d66750a7..12df43cb 100644 --- a/lib/class/localplay.abstract.php +++ b/lib/class/localplay.abstract.php @@ -60,7 +60,7 @@ abstract class localplay_controller { case 'radio': case 'song': default: - $url = $object->get_url(Stream::$session); + $url = $object->get_url(Stream::get_session()); break; } // end switch on objecttype diff --git a/lib/class/localplay.class.php b/lib/class/localplay.class.php index c5b16fd3..dc367b28 100644 --- a/lib/class/localplay.class.php +++ b/lib/class/localplay.class.php @@ -543,6 +543,18 @@ class Localplay { } // get_instances + /** + * current_instance + * This returns the UID of the current Instance + */ + public function current_instance() { + + $data = $this->_player->get_instance(); + + return $data['id']; + + } // current_instance + /** * add_instance * This adds a new instance for the current controller type @@ -553,6 +565,16 @@ class Localplay { } // add_instance + /** + * set_active_instance + * This sets the active instance of the localplay controller + */ + public function set_active_instance($instance) { + + $this->_player->set_active_instance($instance); + + } // set_active_instance + /** * delete * This removes songs from the players playlist as defined get function diff --git a/lib/class/user.class.php b/lib/class/user.class.php index 9ecc247a..2fc8412e 100644 --- a/lib/class/user.class.php +++ b/lib/class/user.class.php @@ -56,7 +56,7 @@ class User { $this->$key = $value; } - // Set the preferences for thsi user + // Set the preferences for this user $this->set_preferences(); // Make sure the Full name is always filled @@ -157,12 +157,11 @@ class User { } // get_preferences - /*! - @function set_preferences - @discussion sets the prefs for this specific - user - */ - function set_preferences() { + /** + * set_preferences + * sets the prefs for this specific user + */ + public function set_preferences() { $sql = "SELECT preference.name,user_preference.value FROM preference,user_preference WHERE user_preference.user='$this->id' " . "AND user_preference.preference=preference.id AND preference.type != 'system'"; @@ -172,7 +171,7 @@ class User { $key = $r['name']; $this->prefs[$key] = $r['value']; } - } // get_preferences + } // set_preferences /** * get_favorites diff --git a/lib/ui.lib.php b/lib/ui.lib.php index d0ae5bcb..859f90f3 100644 --- a/lib/ui.lib.php +++ b/lib/ui.lib.php @@ -130,11 +130,8 @@ function show_alphabet_list () { $list = array(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,1,2,3,4,5,6,7,8,9,"0",_('All')); - $selected = $_SESSION['browse']['filter']['alpha_match']; + $selected = $_SESSION['browse']['filter']['alpha_match']; - //$style_name = "style_" . strtolower($selected); - //${$style_name} = "style=\"font-weight:bold;\""; - echo "
"; foreach ($list as $l) { $style_name = "style_" . strtolower($l); @@ -142,10 +139,6 @@ function show_alphabet_list () { if ($l==$selected) $class .=" active"; echo "" . $l . "\n"; - /* without this, it also works and breaks line when needed only - $i++; - if ($i/5 == intval($i/5)) { echo "
"; } - */ } echo "
"; -- cgit