From 78590d7d512ada604987fdcc9c31a8c74591f64b Mon Sep 17 00:00:00 2001 From: Karl 'vollmerk' Vollmer Date: Mon, 9 Oct 2006 05:46:40 +0000 Subject: fixed a problem with preferences showing disabled localplay modules, included sajax library --- lib/class/localplay.class.php | 10 ++++++++-- lib/init.php | 1 + lib/localplay.lib.php | 5 ++++- lib/preferences.php | 1 + 4 files changed, 14 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/class/localplay.class.php b/lib/class/localplay.class.php index 488714ea..b9f0d8cc 100644 --- a/lib/class/localplay.class.php +++ b/lib/class/localplay.class.php @@ -73,6 +73,8 @@ class Localplay { */ function _load_player() { + if (!$this->type) { return false; } + $filename = conf('prefix') . '/modules/localplay/' . $this->type . '.controller.php'; $include = require_once ($filename); @@ -173,9 +175,13 @@ class Localplay { */ function connect() { - $function = $this->_function_map['connect']; - + + /* This is very bad, that means they don't even + * have a connection function defined + */ + if (!$function) { return false; } + if (!$this->_player->$function()) { debug_event('localplay','Error Unable to connect, check ' . $this->type . ' controller','1'); return false; diff --git a/lib/init.php b/lib/init.php index f76f3eb6..c07df1a8 100644 --- a/lib/init.php +++ b/lib/init.php @@ -158,6 +158,7 @@ require_once(conf('prefix') . "/modules/id3/getid3/getid3.php"); require_once(conf('prefix') . '/modules/id3/vainfo.class.php'); require_once(conf('prefix') . '/modules/amazon/Snoopy.class.php'); require_once(conf('prefix') . '/modules/amazon/AmazonSearchEngine.class.php'); +require_once(conf('prefix') . '/modules/sajax/Sajax.php'); require_once(conf('prefix') . '/lib/xmlrpc.php'); require_once(conf('prefix') . '/modules/xmlrpc/xmlrpc.inc'); diff --git a/lib/localplay.lib.php b/lib/localplay.lib.php index 523a5548..bd73853b 100644 --- a/lib/localplay.lib.php +++ b/lib/localplay.lib.php @@ -160,7 +160,10 @@ function get_localplay_controllers() { if (!is_dir($file)) { /* Get the base name, then get everything before .controller.php */ $filename = basename($file,'.controller.php'); - $results[] = $filename; + /* Make sure that it's currently enabled */ + if (verify_localplay_preferences($filename)) { + $results[] = $filename; + } } } // end while diff --git a/lib/preferences.php b/lib/preferences.php index 48430632..ba28affb 100644 --- a/lib/preferences.php +++ b/lib/preferences.php @@ -305,6 +305,7 @@ function create_preference_input($name,$value) { if ($value == $controller) { $is_selected = 'selected="selected"'; } echo "\t\n"; } // end foreach + echo "\t\n"; echo "\n"; break; case 'localplay_level': -- cgit