constants.php 3.5 KB

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