constants.php 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  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. /* Set values for constants used by SquirrelMail preferences. */
  17. /**************************************************************/
  18. /**
  19. * Define basic, general purpose preference constants.
  20. * @since 1.2.0
  21. */
  22. define('SMPREF_NO', 0);
  23. define('SMPREF_OFF', 0);
  24. define('SMPREF_YES', 1);
  25. define('SMPREF_ON', 1);
  26. define('SMPREF_NONE', 'none');
  27. /**
  28. * Define constants for location based preferences.
  29. * @since 1.2.0
  30. */
  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. * @since 1.2.0
  39. */
  40. define('SMPREF_UNSEEN_NONE', 1);
  41. define('SMPREF_UNSEEN_INBOX', 2);
  42. define('SMPREF_UNSEEN_ALL', 3);
  43. define('SMPREF_UNSEEN_SPECIAL', 4); // Only special folders (since 1.2.5)
  44. define('SMPREF_UNSEEN_NORMAL', 5); // Only normal folders (since 1.2.5)
  45. define('SMPREF_UNSEEN_ONLY', 1);
  46. define('SMPREF_UNSEEN_TOTAL', 2);
  47. /**
  48. * Define constants for time/date display preferences.
  49. * @since 1.2.0
  50. */
  51. define('SMPREF_TIME_24HR', 1);
  52. define('SMPREF_TIME_12HR', 2);
  53. /**
  54. * Define constants for javascript preferences.
  55. * @since 1.2.0
  56. */
  57. define('SMPREF_JS_OFF', 0);
  58. define('SMPREF_JS_ON', 1);
  59. define('SMPREF_JS_AUTODETECT', 2);
  60. /**
  61. * default value for page_selector_max
  62. * @since 1.5.1
  63. */
  64. define('PG_SEL_MAX', 10);
  65. /**
  66. * The number of pages to cache msg headers
  67. * @since 1.5.1
  68. */
  69. define('SQM_MAX_PAGES_IN_CACHE',5);
  70. /**
  71. * The number of mailboxes to cache msg headers
  72. * @since 1.5.1
  73. */
  74. define('SQM_MAX_MBX_IN_CACHE',3);
  75. /**
  76. * Sort constants used for sorting of messages
  77. * @since 1.5.1
  78. */
  79. define('SQSORT_NONE',0);
  80. define('SQSORT_DATE_ASC',1);
  81. define('SQSORT_DATE_DESC',2);
  82. define('SQSORT_FROM_ASC',3);
  83. define('SQSORT_FROM_DESC',4);
  84. define('SQSORT_SUBJ_ASC',5);
  85. define('SQSORT_SUBJ_DESC',6);
  86. define('SQSORT_SIZE_ASC',7);
  87. define('SQSORT_SIZE_DESC',8);
  88. define('SQSORT_TO_ASC',9);
  89. define('SQSORT_TO_DESC',10);
  90. define('SQSORT_CC_ASC',11);
  91. define('SQSORT_CC_DESC',12);
  92. define('SQSORT_INT_DATE_ASC',13);
  93. define('SQSORT_INT_DATE_DESC',14);
  94. /**
  95. * Special sort constant thread which is added to above sort mode.
  96. * By doing a bitwise check ($sort & SQSORT_THREAD) we know if the mailbox
  97. * is sorted by thread.
  98. * @since 1.5.1
  99. */
  100. define('SQSORT_THREAD',32);
  101. /**
  102. * Mailbox preference array keys
  103. * @since 1.5.1
  104. */
  105. define('MBX_PREF_SORT',0);
  106. define('MBX_PREF_LIMIT',1);
  107. define('MBX_PREF_AUTO_EXPUNGE',2);
  108. define('MBX_PREF_INTERNALDATE',3);
  109. define('MBX_PREF_COLUMNS',4);
  110. // define('MBX_PREF_FUTURE',unique integer key);
  111. /**
  112. * Email address array keys
  113. * @since 1.5.1
  114. */
  115. define('SQM_ADDR_PERSONAL', 0);
  116. define('SQM_ADDR_ADL', 1);
  117. define('SQM_ADDR_MAILBOX', 2);
  118. define('SQM_ADDR_HOST', 3);
  119. /**
  120. * Supported columns to show in a messages list
  121. * The MBX_PREF_COLUMNS contains an ordered array with these columns
  122. * @since 1.5.1
  123. */
  124. define('SQM_COL_CHECK',0);
  125. define('SQM_COL_FROM',1);
  126. define('SQM_COL_DATE', 2);
  127. define('SQM_COL_SUBJ', 3);
  128. define('SQM_COL_FLAGS', 4);
  129. define('SQM_COL_SIZE', 5);
  130. define('SQM_COL_PRIO', 6);
  131. define('SQM_COL_ATTACHMENT', 7);
  132. define('SQM_COL_INT_DATE', 8);
  133. define('SQM_COL_TO', 9);
  134. define('SQM_COL_CC', 10);
  135. define('SQM_COL_BCC', 11);
  136. /**
  137. * Generic variable type constants
  138. * @since 1.5.2
  139. */
  140. define('SQ_TYPE_INT', 'int');
  141. define('SQ_TYPE_STRING', 'string');
  142. define('SQ_TYPE_BOOL', 'bool');
  143. define('SQ_TYPE_ARRAY', 'array');
  144. /**
  145. * Template engines supported
  146. * @since 1.5.2
  147. */
  148. define('SQ_PHP_TEMPLATE', 'PHP_');
  149. define('SQ_SMARTY_TEMPLATE', 'Smarty_');