7af66ce4e83320fed705dfeb513e4164a1a64254
[squirrelmail.git] / functions / constants.php
1 <?php
2
3 /**
4 * constants.php
5 *
6 * Loads constants used by the rest of the SquirrelMail source.
7 * This file is include by src/login.php, src/redirect.php and
8 * src/load_prefs.php.
9 *
10 * @copyright &copy; 1999-2006 The SquirrelMail Project Team
11 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
12 * @version $Id$
13 * @package squirrelmail
14 */
15
16 /** Need to enable plugin functions for a hook */
17 require_once(SM_PATH . 'functions/plugin.php'); /* Required for the hook */
18
19 /**************************************************************/
20 /* Set values for constants used by SquirrelMail preferences. */
21 /**************************************************************/
22
23 /* Define basic, general purpose preference constants. */
24 define('SMPREF_NO', 0);
25 define('SMPREF_OFF', 0);
26 define('SMPREF_YES', 1);
27 define('SMPREF_ON', 1);
28 define('SMPREF_NONE', 'none');
29
30 /* Define constants for location based preferences. */
31 define('SMPREF_LOC_TOP', 'top');
32 define('SMPREF_LOC_BETWEEN', 'between');
33 define('SMPREF_LOC_BOTTOM', 'bottom');
34 define('SMPREF_LOC_LEFT', '');
35 define('SMPREF_LOC_RIGHT', 'right');
36
37 /* Define preferences for folder settings. */
38 define('SMPREF_UNSEEN_NONE', 1);
39 define('SMPREF_UNSEEN_INBOX', 2);
40 define('SMPREF_UNSEEN_ALL', 3);
41 define('SMPREF_UNSEEN_SPECIAL', 4); // Only special folders
42 define('SMPREF_UNSEEN_NORMAL', 5); // Only normal folders
43 define('SMPREF_UNSEEN_ONLY', 1);
44 define('SMPREF_UNSEEN_TOTAL', 2);
45
46 /* Define constants for time/date display preferences. */
47 define('SMPREF_TIME_24HR', 1);
48 define('SMPREF_TIME_12HR', 2);
49
50 /* Define constants for javascript preferences. */
51 define('SMPREF_JS_OFF', 0);
52 define('SMPREF_JS_ON', 1);
53 define('SMPREF_JS_AUTODETECT', 2);
54
55 /**
56 * default value for page_selector_max
57 */
58 define('PG_SEL_MAX', 10);
59
60
61 /**
62 * The number of pages to cache msg headers
63 */
64 define('SQM_MAX_PAGES_IN_CACHE',5);
65
66 /**
67 * The number of mailboxes to cache msg headers
68 */
69 define('SQM_MAX_MBX_IN_CACHE',3);
70
71 /**
72 * Sort constants used for sorting of messages
73 */
74 define('SQSORT_NONE',0);
75 define('SQSORT_DATE_ASC',1);
76 define('SQSORT_DATE_DESC',2);
77 define('SQSORT_FROM_ASC',3);
78 define('SQSORT_FROM_DESC',4);
79 define('SQSORT_SUBJ_ASC',5);
80 define('SQSORT_SUBJ_DESC',6);
81 define('SQSORT_SIZE_ASC',7);
82 define('SQSORT_SIZE_DESC',8);
83 define('SQSORT_TO_ASC',9);
84 define('SQSORT_TO_DESC',10);
85 define('SQSORT_CC_ASC',11);
86 define('SQSORT_CC_DESC',12);
87 define('SQSORT_INT_DATE_ASC',13);
88 define('SQSORT_INT_DATE_DESC',14);
89
90 /**
91 * Special sort constant thread which is added to above sort mode.
92 * By doing a bitwise check ($sort & SQSORT_THREAD) we know if the mailbox
93 * is sorted by thread.
94 */
95 define('SQSORT_THREAD',32);
96
97 /**
98 * Mailbox preference array keys
99 */
100 define('MBX_PREF_SORT',0);
101 define('MBX_PREF_LIMIT',1);
102 define('MBX_PREF_AUTO_EXPUNGE',2);
103 define('MBX_PREF_INTERNALDATE',3);
104 define('MBX_PREF_COLUMNS',4);
105 // define('MBX_PREF_FUTURE',unique integer key);
106
107 /**
108 * Email address array keys
109 */
110 define('SQM_ADDR_PERSONAL', 0);
111 define('SQM_ADDR_ADL', 1);
112 define('SQM_ADDR_MAILBOX', 2);
113 define('SQM_ADDR_HOST', 3);
114
115 /**
116 * Supported columns to show in a messages list
117 * The MBX_PREF_COLUMNS contains an ordered array with these columns
118 */
119 define('SQM_COL_CHECK',0);
120 define('SQM_COL_FROM',1);
121 define('SQM_COL_DATE', 2);
122 define('SQM_COL_SUBJ', 3);
123 define('SQM_COL_FLAGS', 4);
124 define('SQM_COL_SIZE', 5);
125 define('SQM_COL_PRIO', 6);
126 define('SQM_COL_ATTACHMENT', 7);
127 define('SQM_COL_INT_DATE', 8);
128 define('SQM_COL_TO', 9);
129 define('SQM_COL_CC', 10);
130 define('SQM_COL_BCC', 11);
131
132
133 do_hook('loading_constants');
134
135 ?>