diff options
Diffstat (limited to 'lib/class/preference.class.php')
-rw-r--r-- | lib/class/preference.class.php | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/class/preference.class.php b/lib/class/preference.class.php index ef8a0a05..e2dc57d5 100644 --- a/lib/class/preference.class.php +++ b/lib/class/preference.class.php @@ -217,4 +217,26 @@ class Preference { } // rebuild_preferences + /** + * fix_preferences + * This takes the preferences, explodes what needs to + * become an array and boolean everythings + */ + public static function fix_preferences($results) { + + $results['auth_methods'] = trim($results['auth_methods']) ? explode(",",$results['auth_methods']) : array(); + $results['tag_order'] = trim($results['tag_order']) ? explode(",",$results['tag_order']) : array(); + $results['album_art_order'] = trim($results['album_art_order']) ? explode(",",$results['album_art_order']) : array(); + $results['amazon_base_urls'] = trim($results['amazin_base_urls']) ? explode(",",$results['amazon_base_urls']) : array(); + + foreach ($results as $key=>$data) { + if (strcasecmp($data,"true") == "0") { $results[$key] = 1; } + if (strcasecmp($data,"false") == "0") { $results[$key] = 0; } + } + + return $results; + + } // fix_preferences + + } // end Preference class |