Ampache
[ class tree: Ampache ] [ index: Ampache ] [ all elements ]

Class: Preference

Source Location: /lib/class/preference.class.php

Class Overview


preference Class


Methods



Class Details

[line 28]
preference Class

This handles all of the preference stuff for ampache it replaces /lib/preference.lib.php




[ Top ]


Class Methods


static method clear_from_session [line 351]

static void clear_from_session( )

clear_from_session

This clears the users preferences, this is done whenever modifications are made to the preferences or the admin resets something




Tags:

access:  public


[ Top ]

static method delete [line 271]

static void delete( $preference)

delete

This deletes the specified preference, a name or a ID can be passed




Tags:

access:  public


Parameters:

   $preference  

[ Top ]

static method exists [line 123]

static void exists( $preference)

exists

This just checks to see if a preference currently exists




Tags:

access:  public


Parameters:

   $preference  

[ Top ]

static method fix_preferences [line 310]

static void fix_preferences( $results)

fix_preferences

This takes the preferences, explodes what needs to become an array and boolean everythings




Tags:

access:  public


Parameters:

   $results  

[ Top ]

static method get_all [line 219]

static void get_all( $user_id)

get_all

This returns a nice flat array of all of the possible preferences for the specified user




Tags:

access:  public


Parameters:

   $user_id  

[ Top ]

static method get_catagories [line 198]

static void get_catagories( )

get_catagories

This returns an array of the names of the different possible sections it ignores the 'internal' catagory




Tags:

access:  public


[ Top ]

static method has_access [line 139]

static void has_access( $preference)

has_access

This checks to see if the current user has access to modify this preference as defined by the preference name




Tags:

access:  public


Parameters:

   $preference  

[ Top ]

static method id_from_name [line 162]

static void id_from_name( $name)

id_from_name

This takes a name and returns the id




Tags:

access:  public


Parameters:

   $name  

[ Top ]

static method init [line 390]

static void init( )

init

This grabs the preferences and then loads them into conf it should be run on page load to initialize the needed variables




Tags:

access:  public


[ Top ]

static method insert [line 247]

static void insert( $name, $description, $default, $level, $type, $catagory)

insert

This inserts a new preference into the preference table it does NOT sync up the users, that should be done independtly




Tags:

access:  public


Parameters:

   $name  
   $description  
   $default  
   $level  
   $type  
   $catagory  

[ Top ]

static method is_boolean [line 363]

static void is_boolean( $key)

is_boolean

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




Tags:

access:  public


Parameters:

   $key  

[ Top ]

static method load_from_session [line 335]

static void load_from_session( )

load_from_session

This loads the preferences from the session rather then creating a connection to the database




Tags:

access:  public


[ Top ]

static method name_from_id [line 180]

static void name_from_id( $id)

name_from_id

This returns the name from an id, it's the exact opposite of the function above it, amazing!




Tags:

access:  public


Parameters:

   $id  

[ Top ]

static method rebuild_preferences [line 293]

static void rebuild_preferences( )

rebuild_preferences

This removes any garbage and then adds back in anything missing preferences wise




Tags:

access:  public


[ Top ]

static method update [line 44]

static void update( $preference, $user_id, $value, [ $applytoall = ''])

update

This updates a single preference from the given name or id




Tags:

access:  public


Parameters:

   $preference  
   $user_id  
   $value  
   $applytoall  

[ Top ]

static method update_all [line 107]

static void update_all( $preference_id, $value)

update_all

This takes a preference id and a value and updates all users with the new info




Tags:

access:  public


Parameters:

   $preference_id  
   $value  

[ Top ]

static method update_level [line 83]

static void update_level( $preference, $level)

update_level

This takes a preference ID and updates the level required to update it (performed by an admin)




Tags:

access:  public


Parameters:

   $preference  
   $level  

[ Top ]


Documentation generated on Thu, 12 Feb 2009 08:00:05 +0900 by phpDocumentor 1.4.2