NAME

Liz::UserPreferences - UserPreferences module


SYNOPSIS

 use Liz::UserPreferences;

 $userpreferences = new Liz::UserPreferences;


EXAMPLES

 #!/usr/local/bin/perl

 use Liz::UserPreferences;


DESCRIPTION

The Liz::UserPreferences allows for maintaining user settings in different contexts of a site.


CLASS METHODS

The following methods can be called without an object specification, but as a class method such as Liz::UserPreferences->method().


new

Open the preferences of a user for a specific context, if no context is given, the standard global context is used

Input Parameters

 1 existing object
 2 context 
 3 username, if there is no record for the user, it is created on the fly 
Output Parameters

 1 instantiated object
Example

 $pref = new Liz::UserPreferences( $client,'',$ENV{'REMOTE_USER'} );
 $pref = new Liz::UserPreferences( $client,'',$ENV{'REMOTE_USER'} );


update

Update UserPreferences object in the database.

Example

 $pref->update;


delete

Delete the Liz::UserPreferences object from the database.


CONTENT METHODS

The following methods allow changes to information that is associated with an entire userpreferences.


Clear

Set one of more flags in the preferences field

Input Parameters

 1 new value for the options string
Example

# Set the A, B, G, X and z - flags in the preferences field of this context # Set the C flag

 $pref->Set( 'ABGX' );
 $pref->Set( 'C' );


Data

Return or set the Data field

Input Parameters

 1 new value for the Data field 
Output Parameters

 1 current/old value of the Data field


Set

Set one of more flags in the preferences field

Input Parameters

 1 new value to be added to the options string
 2 Flags to be affected if absent (optional) 
Example

# Set the A, B, G, X and z - flags in the preferences field of this context # Set the C flag # Set the flags in $options, flags 'ABCDEFGabc' are used here...

 $pref->Set( 'ABGX' );
 $pref->Set( 'C' );
 $pref->Set( $options,'ABCDEFGabc' );


Test

See if flags in the preferences field is set

Input Parameters

 1 The flags to be tested 
Example


Options

Return or set the options string for this user for this context

Input Parameters

 1 new value for the options string
Output Parameters

 1 current/old  value of the options string
Example

 $pref->Options( $options );
 $options = $pref->Options;


AUTHOR

Sjoerd Lawende ( sjoerd@xxLINK.nl )


COPYRIGHT

(C) 1999 International Network Consultants


HISTORY

Version 0.15, 30 September 1999

Now no longer puts Exporter in ISA: it was not needed.

Version 0.14, 9 July 1999

Changed CREATE TABLE to new Liz::SQL 'create' method format.

Version 0.13, 23 June 1999

Changed from using method ``Exists'' to ``Count'' in method new to allow for a much quicker check on the existence of a table.

Version 0.12, 27 April 1999

Fixed problem in method update which would not return the ID of the object if the object was not changed.

Version 0.11, March 24, 1999

Options and Data now allowed...

Version 0.1, March 23, 1999

First version of this true Perl module.