Todo List
This handles all of the preference stuff for ampache it replaces /lib/preference.lib.php
static void clear_from_session( )
This clears the users preferences, this is done whenever modifications are made to the preferences or the admin resets something
static void delete( $preference)
This deletes the specified preference, a name or a ID can be passed
static void exists( $preference)
This just checks to see if a preference currently exists
static void fix_preferences( $results)
This takes the preferences, explodes what needs to become an array and boolean everythings
static void get_all( $user_id)
This returns a nice flat array of all of the possible preferences for the specified user
static void get_catagories( )
This returns an array of the names of the different possible sections it ignores the 'internal' catagory
static void has_access( $preference)
This checks to see if the current user has access to modify this preference as defined by the preference name
static void id_from_name( $name)
This takes a name and returns the id
static void init( )
This grabs the preferences and then loads them into conf it should be run on page load to initialize the needed variables
static void insert( $name, $description, $default, $level, $type, $catagory)
This inserts a new preference into the preference table it does NOT sync up the users, that should be done independtly
static void is_boolean( $key)
This returns true / false if the preference in question is a boolean preference This is currently only used by the debug view, could be used other places.. wouldn't be a half bad idea
static void load_from_session( )
This loads the preferences from the session rather then creating a connection to the database
static void name_from_id( $id)
This returns the name from an id, it's the exact opposite of the function above it, amazing!
static void rebuild_preferences( )
This removes any garbage and then adds back in anything missing preferences wise
static void update( $preference, $user_id, $value, [ $applytoall = ''])
This updates a single preference from the given name or id
static void update_all( $preference_id, $value)
This takes a preference id and a value and updates all users with the new info
static void update_level( $preference, $level)
This takes a preference ID and updates the level required to update it (performed by an admin)