constants.php 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259
  1. <?php
  2. /**
  3. * constants.php
  4. *
  5. * Loads constants used by the rest of the SquirrelMail source.
  6. *
  7. * Before 1.5.2 script was stored in functions/constants.php
  8. * @copyright &copy; 1999-2007 The SquirrelMail Project Team
  9. * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  10. * @version $Id$
  11. * @package squirrelmail
  12. * @since 1.2.0
  13. */
  14. /** @ignore */
  15. /**
  16. * SquirrelMail version number -- DO NOT CHANGE
  17. * @since 1.5.2
  18. */
  19. define('SM_VERSION', '1.5.2 [SVN]');
  20. /**
  21. * Year interval for copyright notices in the interface
  22. * @since 1.5.2
  23. */
  24. define('SM_COPYRIGHT', '1999-2008');
  25. /**************************************************************/
  26. /* Set values for constants used by SquirrelMail preferences. */
  27. /**************************************************************/
  28. /**
  29. * Define constants for SquirrelMail debug modes.
  30. * Note that these are binary so that modes can be
  31. * mixed and matched, and they are also ordered from
  32. * minor to severe. When adding new modes, please
  33. * order them in a sensical way (MODERATE is the 10th
  34. * bit; ADVANCED is the 20th bit).
  35. * @since 1.5.2
  36. */
  37. define('SM_DEBUG_MODE_OFF', 0); // complete error suppression
  38. define('SM_DEBUG_MODE_SIMPLE', 1); // PHP E_ERROR
  39. define('SM_DEBUG_MODE_MODERATE', 512); // PHP E_ALL
  40. define('SM_DEBUG_MODE_ADVANCED', 524288); // PHP E_ALL plus log errors intentionally suppressed
  41. define('SM_DEBUG_MODE_STRICT', 536870912); // PHP E_STRICT
  42. /**
  43. * Define basic, general purpose preference constants.
  44. * @since 1.2.0
  45. */
  46. define('SMPREF_NO', 0);
  47. define('SMPREF_OFF', 0);
  48. define('SMPREF_YES', 1);
  49. define('SMPREF_ON', 1);
  50. define('SMPREF_NONE', 'none');
  51. /**
  52. * Define constants for location based preferences.
  53. * @since 1.2.0
  54. */
  55. define('SMPREF_LOC_TOP', 'top');
  56. define('SMPREF_LOC_BETWEEN', 'between');
  57. define('SMPREF_LOC_BOTTOM', 'bottom');
  58. define('SMPREF_LOC_LEFT', '');
  59. define('SMPREF_LOC_RIGHT', 'right');
  60. /**
  61. * Define preferences for folder settings.
  62. * @since 1.2.0
  63. */
  64. define('SMPREF_UNSEEN_NONE', 1);
  65. define('SMPREF_UNSEEN_INBOX', 2);
  66. define('SMPREF_UNSEEN_ALL', 3);
  67. define('SMPREF_UNSEEN_SPECIAL', 4); // Only special folders (since 1.2.5)
  68. define('SMPREF_UNSEEN_NORMAL', 5); // Only normal folders (since 1.2.5)
  69. define('SMPREF_UNSEEN_ONLY', 1);
  70. define('SMPREF_UNSEEN_TOTAL', 2);
  71. define('SMPREF_MAILBOX_SELECT_LONG', 0);
  72. define('SMPREF_MAILBOX_SELECT_INDENTED', 1);
  73. define('SMPREF_MAILBOX_SELECT_DELIMITED', 2);
  74. /**
  75. * Define constants for time/date display preferences.
  76. * @since 1.2.0
  77. */
  78. define('SMPREF_TIME_24HR', 1);
  79. define('SMPREF_TIME_12HR', 2);
  80. /**
  81. * Define constants for javascript preferences.
  82. * @since 1.2.0
  83. */
  84. define('SMPREF_JS_OFF', 0);
  85. define('SMPREF_JS_ON', 1);
  86. define('SMPREF_JS_AUTODETECT', 2);
  87. /**
  88. * default value for page_selector_max
  89. * @since 1.5.1
  90. */
  91. define('PG_SEL_MAX', 10);
  92. /**
  93. * The number of pages to cache msg headers
  94. * @since 1.5.1
  95. */
  96. define('SQM_MAX_PAGES_IN_CACHE',5);
  97. /**
  98. * The number of mailboxes to cache msg headers
  99. * @since 1.5.1
  100. */
  101. define('SQM_MAX_MBX_IN_CACHE',3);
  102. /**
  103. * Sort constants used for sorting of messages
  104. * @since 1.5.1
  105. */
  106. define('SQSORT_NONE',0);
  107. define('SQSORT_DATE_ASC',1);
  108. define('SQSORT_DATE_DESC',2);
  109. define('SQSORT_FROM_ASC',3);
  110. define('SQSORT_FROM_DESC',4);
  111. define('SQSORT_SUBJ_ASC',5);
  112. define('SQSORT_SUBJ_DESC',6);
  113. define('SQSORT_SIZE_ASC',7);
  114. define('SQSORT_SIZE_DESC',8);
  115. define('SQSORT_TO_ASC',9);
  116. define('SQSORT_TO_DESC',10);
  117. define('SQSORT_CC_ASC',11);
  118. define('SQSORT_CC_DESC',12);
  119. define('SQSORT_INT_DATE_ASC',13);
  120. define('SQSORT_INT_DATE_DESC',14);
  121. /**
  122. * Special sort constant thread which is added to above sort mode.
  123. * By doing a bitwise check ($sort & SQSORT_THREAD) we know if the mailbox
  124. * is sorted by thread.
  125. * @since 1.5.1
  126. */
  127. define('SQSORT_THREAD',32);
  128. /**
  129. * Mailbox preference array keys
  130. * @since 1.5.1
  131. */
  132. define('MBX_PREF_SORT',0);
  133. define('MBX_PREF_LIMIT',1);
  134. define('MBX_PREF_AUTO_EXPUNGE',2);
  135. define('MBX_PREF_INTERNALDATE',3);
  136. define('MBX_PREF_COLUMNS',4);
  137. // define('MBX_PREF_FUTURE',unique integer key);
  138. /**
  139. * Email address array keys
  140. * @since 1.5.1
  141. */
  142. define('SQM_ADDR_PERSONAL', 0);
  143. define('SQM_ADDR_ADL', 1);
  144. define('SQM_ADDR_MAILBOX', 2);
  145. define('SQM_ADDR_HOST', 3);
  146. /**
  147. * Supported columns to show in a messages list
  148. * The MBX_PREF_COLUMNS contains an ordered array with these columns
  149. * @since 1.5.1
  150. */
  151. define('SQM_COL_CHECK',0);
  152. define('SQM_COL_FROM',1);
  153. define('SQM_COL_DATE', 2);
  154. define('SQM_COL_SUBJ', 3);
  155. define('SQM_COL_FLAGS', 4);
  156. define('SQM_COL_SIZE', 5);
  157. define('SQM_COL_PRIO', 6);
  158. define('SQM_COL_ATTACHMENT', 7);
  159. define('SQM_COL_INT_DATE', 8);
  160. define('SQM_COL_TO', 9);
  161. define('SQM_COL_CC', 10);
  162. define('SQM_COL_BCC', 11);
  163. /**
  164. * Address book field list
  165. * @since 1.4.16 and 1.5.2
  166. */
  167. define('SM_ABOOK_FIELD_NICKNAME', 0);
  168. define('SM_ABOOK_FIELD_FIRSTNAME', 1);
  169. define('SM_ABOOK_FIELD_LASTNAME', 2);
  170. define('SM_ABOOK_FIELD_EMAIL', 3);
  171. define('SM_ABOOK_FIELD_LABEL', 4);
  172. /**
  173. * Generic variable type constants
  174. * @since 1.5.2
  175. */
  176. define('SQ_TYPE_INT', 'int');
  177. define('SQ_TYPE_STRING', 'string');
  178. define('SQ_TYPE_BOOL', 'bool');
  179. define('SQ_TYPE_ARRAY', 'array');
  180. /**
  181. * Template engines supported
  182. * @since 1.5.2
  183. */
  184. define('SQ_PHP_TEMPLATE', 'PHP_');
  185. define('SQ_SMARTY_TEMPLATE', 'Smarty_');
  186. /**
  187. * Used by plugins to indicate an incompatibility with a SM version
  188. * @since 1.5.2
  189. */
  190. define('SQ_INCOMPATIBLE', 'INCOMPATIBLE');
  191. /**
  192. * Define constants used in the options code
  193. */
  194. // Define constants for the various option types
  195. define('SMOPT_TYPE_STRING', 0);
  196. define('SMOPT_TYPE_STRLIST', 1);
  197. define('SMOPT_TYPE_TEXTAREA', 2);
  198. define('SMOPT_TYPE_INTEGER', 3);
  199. define('SMOPT_TYPE_FLOAT', 4);
  200. define('SMOPT_TYPE_BOOLEAN', 5);
  201. define('SMOPT_TYPE_HIDDEN', 6);
  202. define('SMOPT_TYPE_COMMENT', 7);
  203. define('SMOPT_TYPE_FLDRLIST', 8);
  204. define('SMOPT_TYPE_FLDRLIST_MULTI', 9);
  205. define('SMOPT_TYPE_EDIT_LIST', 10);
  206. define('SMOPT_TYPE_STRLIST_MULTI', 11);
  207. define('SMOPT_TYPE_BOOLEAN_CHECKBOX', 12);
  208. define('SMOPT_TYPE_BOOLEAN_RADIO', 13);
  209. define('SMOPT_TYPE_STRLIST_RADIO', 14);
  210. define('SMOPT_TYPE_SUBMIT', 15);
  211. // Define constants for the layout scheme for edit lists
  212. define('SMOPT_EDIT_LIST_LAYOUT_LIST', 0);
  213. define('SMOPT_EDIT_LIST_LAYOUT_SELECT', 1);
  214. // Define constants for the options refresh levels
  215. define('SMOPT_REFRESH_NONE', 0);
  216. define('SMOPT_REFRESH_FOLDERLIST', 1);
  217. define('SMOPT_REFRESH_ALL', 2);
  218. // Define constants for the options size
  219. define('SMOPT_SIZE_TINY', 0);
  220. define('SMOPT_SIZE_SMALL', 1);
  221. define('SMOPT_SIZE_MEDIUM', 2);
  222. define('SMOPT_SIZE_LARGE', 3);
  223. define('SMOPT_SIZE_HUGE', 4);
  224. define('SMOPT_SIZE_NORMAL', 5);
  225. // Define miscellaneous options constants
  226. define('SMOPT_SAVE_DEFAULT', 'save_option');
  227. define('SMOPT_SAVE_NOOP', 'save_option_noop');