added sol100 and chado cvterm pages to validate_all.t
[sgn.git] / lib / CXGN / Page / UserPrefs.pm
blob41c357d6ee813bc9f4337dfa50b48632ab83688f
1 package CXGN::Page::UserPrefs;
2 use strict;
3 use base qw/CXGN::Page::Session/;
5 =head1 NAME
7 CXGN::Page::UserPrefs
9 =head1 Description
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
17 =head1 AUTHOR
19 Chris Carpita <ccarpita@gmail.com>
21 =head1 Instance Methods
23 =cut
25 our @VALID_KEYS = qw/
26 cdsSeqDisp
27 cdsSpaceSwap
28 genomicSeqDisp
29 GOcollapse
30 propertiesCollapse
31 proteinInfoCollapse
32 protSeqDisp
33 searchHighlight
34 sp_person_id
35 TAIRannotationCollapse
36 timestamp
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';
45 our $ID = undef;
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();
53 =cut
55 sub set_pref {
56 my $self = shift;
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 ;)
66 =cut
68 sub get_pref {
69 my $self = shift;
70 my $name = shift;
71 $self->get_setting($name);
74 ####
75 1;###
76 ####