constants.php 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  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. /* Set values for constants used by SquirrelMail preferences. */
  22. /**************************************************************/
  23. /**
  24. * Define constants for SquirrelMail debug modes.
  25. * Note that these are binary so that modes can be
  26. * mixed and matched, and they are also ordered from
  27. * minor to severe. When adding new modes, please
  28. * order them in a sensical way (MODERATE is the 10th
  29. * bit; ADVANCED is the 20th bit).
  30. * @since 1.5.2
  31. */
  32. define('SM_DEBUG_MODE_OFF', 0); // complete error suppression
  33. define('SM_DEBUG_MODE_SIMPLE', 1); // PHP E_ERROR
  34. define('SM_DEBUG_MODE_MODERATE', 512); // PHP E_ALL
  35. define('SM_DEBUG_MODE_ADVANCED', 524288); // PHP E_ALL plus log errors intentionally suppressed
  36. define('SM_DEBUG_MODE_STRICT', 536870912); // PHP E_STRICT
  37. /**
  38. * Define basic, general purpose preference constants.
  39. * @since 1.2.0
  40. */
  41. define('SMPREF_NO', 0);
  42. define('SMPREF_OFF', 0);
  43. define('SMPREF_YES', 1);
  44. define('SMPREF_ON', 1);
  45. define('SMPREF_NONE', 'none');
  46. /**
  47. * Define constants for location based preferences.
  48. * @since 1.2.0
  49. */
  50. define('SMPREF_LOC_TOP', 'top');
  51. define('SMPREF_LOC_BETWEEN', 'between');
  52. define('SMPREF_LOC_BOTTOM', 'bottom');
  53. define('SMPREF_LOC_LEFT', '');
  54. define('SMPREF_LOC_RIGHT', 'right');
  55. /**
  56. * Define preferences for folder settings.
  57. * @since 1.2.0
  58. */
  59. define('SMPREF_UNSEEN_NONE', 1);
  60. define('SMPREF_UNSEEN_INBOX', 2);
  61. define('SMPREF_UNSEEN_ALL', 3);
  62. define('SMPREF_UNSEEN_SPECIAL', 4); // Only special folders (since 1.2.5)
  63. define('SMPREF_UNSEEN_NORMAL', 5); // Only normal folders (since 1.2.5)
  64. define('SMPREF_UNSEEN_ONLY', 1);
  65. define('SMPREF_UNSEEN_TOTAL', 2);
  66. define('SMPREF_MAILBOX_SELECT_LONG', 0);
  67. define('SMPREF_MAILBOX_SELECT_INDENTED', 1);
  68. define('SMPREF_MAILBOX_SELECT_DELIMITED', 2);
  69. /**
  70. * Define constants for time/date display preferences.
  71. * @since 1.2.0
  72. */
  73. define('SMPREF_TIME_24HR', 1);
  74. define('SMPREF_TIME_12HR', 2);
  75. /**
  76. * Define constants for javascript preferences.
  77. * @since 1.2.0
  78. */
  79. define('SMPREF_JS_OFF', 0);
  80. define('SMPREF_JS_ON', 1);
  81. define('SMPREF_JS_AUTODETECT', 2);
  82. /**
  83. * default value for page_selector_max
  84. * @since 1.5.1
  85. */
  86. define('PG_SEL_MAX', 10);
  87. /**
  88. * The number of pages to cache msg headers
  89. * @since 1.5.1
  90. */
  91. define('SQM_MAX_PAGES_IN_CACHE',5);
  92. /**
  93. * The number of mailboxes to cache msg headers
  94. * @since 1.5.1
  95. */
  96. define('SQM_MAX_MBX_IN_CACHE',3);
  97. /**
  98. * Sort constants used for sorting of messages
  99. * @since 1.5.1
  100. */
  101. define('SQSORT_NONE',0);
  102. define('SQSORT_DATE_ASC',1);
  103. define('SQSORT_DATE_DESC',2);
  104. define('SQSORT_FROM_ASC',3);
  105. define('SQSORT_FROM_DESC',4);
  106. define('SQSORT_SUBJ_ASC',5);
  107. define('SQSORT_SUBJ_DESC',6);
  108. define('SQSORT_SIZE_ASC',7);
  109. define('SQSORT_SIZE_DESC',8);
  110. define('SQSORT_TO_ASC',9);
  111. define('SQSORT_TO_DESC',10);
  112. define('SQSORT_CC_ASC',11);
  113. define('SQSORT_CC_DESC',12);
  114. define('SQSORT_INT_DATE_ASC',13);
  115. define('SQSORT_INT_DATE_DESC',14);
  116. /**
  117. * Special sort constant thread which is added to above sort mode.
  118. * By doing a bitwise check ($sort & SQSORT_THREAD) we know if the mailbox
  119. * is sorted by thread.
  120. * @since 1.5.1
  121. */
  122. define('SQSORT_THREAD',32);
  123. /**
  124. * Mailbox preference array keys
  125. * @since 1.5.1
  126. */
  127. define('MBX_PREF_SORT',0);
  128. define('MBX_PREF_LIMIT',1);
  129. define('MBX_PREF_AUTO_EXPUNGE',2);
  130. define('MBX_PREF_INTERNALDATE',3);
  131. define('MBX_PREF_COLUMNS',4);
  132. // define('MBX_PREF_FUTURE',unique integer key);
  133. /**
  134. * Email address array keys
  135. * @since 1.5.1
  136. */
  137. define('SQM_ADDR_PERSONAL', 0);
  138. define('SQM_ADDR_ADL', 1);
  139. define('SQM_ADDR_MAILBOX', 2);
  140. define('SQM_ADDR_HOST', 3);
  141. /**
  142. * Supported columns to show in a messages list
  143. * The MBX_PREF_COLUMNS contains an ordered array with these columns
  144. * @since 1.5.1
  145. */
  146. define('SQM_COL_CHECK',0);
  147. define('SQM_COL_FROM',1);
  148. define('SQM_COL_DATE', 2);
  149. define('SQM_COL_SUBJ', 3);
  150. define('SQM_COL_FLAGS', 4);
  151. define('SQM_COL_SIZE', 5);
  152. define('SQM_COL_PRIO', 6);
  153. define('SQM_COL_ATTACHMENT', 7);
  154. define('SQM_COL_INT_DATE', 8);
  155. define('SQM_COL_TO', 9);
  156. define('SQM_COL_CC', 10);
  157. define('SQM_COL_BCC', 11);
  158. /**
  159. * Generic variable type constants
  160. * @since 1.5.2
  161. */
  162. define('SQ_TYPE_INT', 'int');
  163. define('SQ_TYPE_STRING', 'string');
  164. define('SQ_TYPE_BOOL', 'bool');
  165. define('SQ_TYPE_ARRAY', 'array');
  166. /**
  167. * Template engines supported
  168. * @since 1.5.2
  169. */
  170. define('SQ_PHP_TEMPLATE', 'PHP_');
  171. define('SQ_SMARTY_TEMPLATE', 'Smarty_');
  172. /**
  173. * Used by plugins to indicate an incompatibility with a SM version
  174. * @since 1.5.2
  175. */
  176. define('SQ_INCOMPATIBLE', 'INCOMPATIBLE');