1 package CXGN
::Page
::UserPrefs
;
3 use base qw
/CXGN::Page::Session/;
11 A module for handling user preferences (setting and retrieving) using a long ( <= 4KB ) cookie string in the user table. This module MUST be used BEFORE HTTP Headers are sent to the browser, cuz we got cookies to set, cuz.
13 WARNING: unix epoch time comparison is used, so implementation of this code on a Macintosh server will require some changes!! [search for time()]
15 This module has been re-organized to use CXGN::Page::Session as the base
19 Chris Carpita <ccarpita@gmail.com>
21 =head1 Instance Methods
35 TAIRannotationCollapse
37 last_blast_db_file_base
40 our $COOKIE_NAME = 'user_prefs';
41 our $DB_SCHEMA = 'sgn_people';
42 our $DB_TABLE = 'sp_person';
43 our $DB_COLUMN = 'user_prefs';
44 our $ID_COLUMN = 'sp_person_id';
48 =head2 set_pref($name, $value)
50 Usage: $handle->set_pref('skin', 'aqua'); # not a real setting ;)
51 Sets the proper value in the preferences hash. To actually update this in the database, call $handle->save();
57 my ($name, $value) = @_;
58 $self->alter_setting($name, $value);
61 =head2 get_pref($name)
63 Usage: $handle->get_pref('searchHidden');
64 Returns the preference value. We will use this one a lot ;)
71 $self->get_setting($name);