summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2007-09-28 04:34:02 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2007-09-28 04:34:02 +0000
commit79ca59df627660d635a9373bfeb293592c173793 (patch)
treedee673409ee084f47f2121ff049f2bdd859fb057 /lib
parent705fba8f49faa42ed7f004f67b74a996c29ddb3d (diff)
downloadampache-79ca59df627660d635a9373bfeb293592c173793.tar.gz
ampache-79ca59df627660d635a9373bfeb293592c173793.tar.bz2
ampache-79ca59df627660d635a9373bfeb293592c173793.zip
fixed some localplay issues, now correctly shows the active instance at least for the MPD module
Diffstat (limited to 'lib')
-rw-r--r--lib/class/localplay.abstract.php2
-rw-r--r--lib/class/localplay.class.php22
-rw-r--r--lib/class/user.class.php15
-rw-r--r--lib/ui.lib.php9
4 files changed, 31 insertions, 17 deletions
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
@@ -544,6 +544,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
*/
@@ -554,6 +566,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 "<div class=\"alphabet\">";
foreach ($list as $l) {
$style_name = "style_" . strtolower($l);
@@ -142,10 +139,6 @@ function show_alphabet_list () {
if ($l==$selected) $class .=" active";
echo "<span class=\"" . $class . "\" onclick=\"ajaxPut('". Config::get('ajax_url') ."?action=browse&amp;key=alpha_match&amp;value=$l');return true;\">" .
$l . "</span>\n";
- /* without this, it also works and breaks line when needed only
- $i++;
- if ($i/5 == intval($i/5)) { echo "<br />"; }
- */
}
echo "</div>";