compose.php 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. <?php
  2. /**
  3. * options_compose.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. * Displays all options concerning composing of new messages
  9. *
  10. * @version $Id$
  11. * @package squirrelmail
  12. */
  13. /** Define the group constants for this options page. */
  14. define('SMOPT_GRP_COMPOSE', 0);
  15. define('SMOPT_GRP_COMPOSE_REPLY', 1);
  16. /**
  17. * This function builds an array with all the information about
  18. * the options available to the user, and returns it. The options
  19. * are grouped by the groups in which they are displayed.
  20. * For each option, the following information is stored:
  21. * - name: the internal (variable) name
  22. * - caption: the description of the option in the UI
  23. * - type: one of SMOPT_TYPE_*
  24. * - refresh: one of SMOPT_REFRESH_*
  25. * - size: one of SMOPT_SIZE_*
  26. * - save: the name of a function to call when saving this option
  27. * @return array all option information
  28. */
  29. function load_optpage_data_compose() {
  30. /* Build a simple array into which we will build options. */
  31. $optgrps = array();
  32. $optvals = array();
  33. /******************************************************/
  34. /* LOAD EACH GROUP OF OPTIONS INTO THE OPTIONS ARRAY. */
  35. /******************************************************/
  36. /*** Load the General Compose Options into the array ***/
  37. $optgrps[SMOPT_GRP_COMPOSE] = _("General Message Composition");
  38. $optvals[SMOPT_GRP_COMPOSE] = array();
  39. $optvals[SMOPT_GRP_COMPOSE][] = array(
  40. 'name' => 'editor_size',
  41. 'caption' => _("Width of Editor Window"),
  42. 'type' => SMOPT_TYPE_INTEGER,
  43. 'refresh' => SMOPT_REFRESH_NONE,
  44. 'size' => SMOPT_SIZE_TINY
  45. );
  46. $optvals[SMOPT_GRP_COMPOSE][] = array(
  47. 'name' => 'editor_height',
  48. 'caption' => _("Height of Editor Window"),
  49. 'type' => SMOPT_TYPE_INTEGER,
  50. 'refresh' => SMOPT_REFRESH_NONE,
  51. 'size' => SMOPT_SIZE_TINY
  52. );
  53. $optvals[SMOPT_GRP_COMPOSE][] = array(
  54. 'name' => 'location_of_buttons',
  55. 'caption' => _("Location of Buttons when Composing"),
  56. 'type' => SMOPT_TYPE_STRLIST,
  57. 'refresh' => SMOPT_REFRESH_NONE,
  58. 'posvals' => array(SMPREF_LOC_TOP => _("Before headers"),
  59. SMPREF_LOC_BETWEEN => _("Between headers and message body"),
  60. SMPREF_LOC_BOTTOM => _("After message body"))
  61. );
  62. $optvals[SMOPT_GRP_COMPOSE][] = array(
  63. 'name' => 'use_javascript_addr_book',
  64. 'caption' => _("Addressbook Display Format"),
  65. 'type' => SMOPT_TYPE_STRLIST,
  66. 'refresh' => SMOPT_REFRESH_NONE,
  67. 'posvals' => array('1' => _("Javascript"),
  68. '0' => _("HTML"))
  69. );
  70. $optvals[SMOPT_GRP_COMPOSE][] = array(
  71. 'name' => 'compose_new_win',
  72. 'caption' => _("Compose Messages in New Window"),
  73. 'type' => SMOPT_TYPE_BOOLEAN,
  74. 'refresh' => SMOPT_REFRESH_ALL
  75. );
  76. $optvals[SMOPT_GRP_COMPOSE][] = array(
  77. 'name' => 'compose_width',
  78. 'caption' => _("Width of Compose Window"),
  79. 'type' => SMOPT_TYPE_INTEGER,
  80. 'refresh' => SMOPT_REFRESH_ALL,
  81. 'size' => SMOPT_SIZE_TINY
  82. );
  83. $optvals[SMOPT_GRP_COMPOSE][] = array(
  84. 'name' => 'compose_height',
  85. 'caption' => _("Height of Compose Window"),
  86. 'type' => SMOPT_TYPE_INTEGER,
  87. 'refresh' => SMOPT_REFRESH_ALL,
  88. 'size' => SMOPT_SIZE_TINY
  89. );
  90. /*** Load the General Options into the array ***/
  91. $optgrps[SMOPT_GRP_COMPOSE_REPLY] = _("Replying and Forwarding Messages");
  92. $optvals[SMOPT_GRP_COMPOSE_REPLY] = array();
  93. $optvals[SMOPT_GRP_COMPOSE_REPLY][] = array(
  94. 'name' => 'forward_cc',
  95. 'caption' => _("Include CCs when Forwarding Messages"),
  96. 'type' => SMOPT_TYPE_BOOLEAN,
  97. 'refresh' => SMOPT_REFRESH_NONE
  98. );
  99. $optvals[SMOPT_GRP_COMPOSE_REPLY][] = array(
  100. 'name' => 'include_self_reply_all',
  101. 'caption' => _("Include Me in CC when I Reply All"),
  102. 'type' => SMOPT_TYPE_BOOLEAN,
  103. 'refresh' => SMOPT_REFRESH_NONE
  104. );
  105. $optvals[SMOPT_GRP_COMPOSE_REPLY][] = array(
  106. 'name' => 'sig_first',
  107. 'caption' => _("Append Signature before Reply/Forward Text"),
  108. 'type' => SMOPT_TYPE_BOOLEAN,
  109. 'refresh' => SMOPT_REFRESH_NONE
  110. );
  111. $optvals[SMOPT_GRP_COMPOSE_REPLY][] = array(
  112. 'name' => 'body_quote',
  113. 'caption' => _("Prefix for Original Message when Replying"),
  114. 'type' => SMOPT_TYPE_STRING,
  115. 'refresh' => SMOPT_REFRESH_NONE,
  116. 'size' => SMOPT_SIZE_TINY,
  117. 'save' => 'save_option_reply_prefix'
  118. );
  119. $optvals[SMOPT_GRP_COMPOSE_REPLY][] = array(
  120. 'name' => 'reply_focus',
  121. 'caption' => _("Cursor Position when Replying"),
  122. 'type' => SMOPT_TYPE_STRLIST,
  123. 'refresh' => SMOPT_REFRESH_NONE,
  124. 'posvals' => array('' => _("To: field"),
  125. 'focus' => _("Focus in body"),
  126. 'select' => _("Select body"),
  127. 'none' => _("No focus"))
  128. );
  129. $optvals[SMOPT_GRP_COMPOSE_REPLY][] = array(
  130. 'name' => 'strip_sigs',
  131. 'caption' => _("Strip signature when replying"),
  132. 'type' => SMOPT_TYPE_BOOLEAN,
  133. 'refresh' => SMOPT_REFRESH_NONE
  134. );
  135. /* Assemble all this together and return it as our result. */
  136. $result = array(
  137. 'grps' => $optgrps,
  138. 'vals' => $optvals
  139. );
  140. return ($result);
  141. }
  142. /******************************************************************/
  143. /** Define any specialized save functions for this option page. ***/
  144. /******************************************************************/
  145. function save_option_header($option) {
  146. }
  147. ?>