Source for file compose.php

Documentation is available at compose.php

  1. <?php
  2. /**
  3. * options_compose.php
  4. *
  5. * Displays all options concerning composing of new messages
  6. *
  7. * @copyright 1999-2020 The SquirrelMail Project Team
  8. * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  9. * @version $Id: compose.php 14845 2020年01月07日 08:09:34Z pdontthink $
  10. * @package squirrelmail
  11. */
  12. /** Define the group constants for this options page. */
  13. define ('SMOPT_GRP_COMPOSE', 0);
  14. define ('SMOPT_GRP_COMPOSE_REPLY', 1);
  15. /**
  16. * This function builds an array with all the information about
  17. * the options available to the user, and returns it. The options
  18. * are grouped by the groups in which they are displayed.
  19. * For each option, the following information is stored:
  20. * - name: the internal (variable) name
  21. * - caption: the description of the option in the UI
  22. * - type: one of SMOPT_TYPE_*
  23. * - refresh: one of SMOPT_REFRESH_*
  24. * - size: one of SMOPT_SIZE_*
  25. * - save: the name of a function to call when saving this option
  26. * @return array all option information
  27. */
  28. /* Build a simple array into which we will build options. */
  29. $optgrps = array();
  30. $optvals = array();
  31. /******************************************************/
  32. /* LOAD EACH GROUP OF OPTIONS INTO THE OPTIONS ARRAY. */
  33. /******************************************************/
  34. /*** Load the General Compose Options into the array ***/
  35. $optgrps[SMOPT_GRP_COMPOSE ] = _ ("General Message Composition");
  36. $optvals[SMOPT_GRP_COMPOSE ] = array();
  37. $optvals[SMOPT_GRP_COMPOSE ][] = array(
  38. 'name' => 'editor_size',
  39. 'caption' => _ ("Width of Editor Window"),
  40. 'type' => SMOPT_TYPE_INTEGER ,
  41. 'refresh' => SMOPT_REFRESH_NONE ,
  42. 'size' => SMOPT_SIZE_TINY
  43. );
  44. $optvals[SMOPT_GRP_COMPOSE ][] = array(
  45. 'name' => 'editor_height',
  46. 'caption' => _ ("Height of Editor Window"),
  47. 'type' => SMOPT_TYPE_INTEGER ,
  48. 'refresh' => SMOPT_REFRESH_NONE ,
  49. 'size' => SMOPT_SIZE_TINY
  50. );
  51. $optvals[SMOPT_GRP_COMPOSE ][] = array(
  52. 'name' => 'location_of_buttons',
  53. 'caption' => _ ("Location of Buttons when Composing"),
  54. 'type' => SMOPT_TYPE_STRLIST ,
  55. 'refresh' => SMOPT_REFRESH_NONE ,
  56. 'posvals' => array(SMPREF_LOC_TOP => _ ("Before headers"),
  57. SMPREF_LOC_BETWEEN => _ ("Between headers and message body"),
  58. SMPREF_LOC_BOTTOM => _ ("After message body"))
  59. );
  60. $optvals[SMOPT_GRP_COMPOSE ][] = array(
  61. 'name' => 'use_javascript_addr_book',
  62. 'caption' => _ ("Address Book Display Format"),
  63. 'type' => SMOPT_TYPE_STRLIST ,
  64. 'refresh' => SMOPT_REFRESH_NONE ,
  65. 'posvals' => array('1' => _ ("Pop-up window"),
  66. '0' => _ ("In-page"))
  67. );
  68. $optvals[SMOPT_GRP_COMPOSE ][] = array(
  69. 'name' => 'addrsrch_fullname',
  70. 'caption' => _ ("Format of Addresses Added From Address Book"),
  71. 'type' => SMOPT_TYPE_STRLIST ,
  72. 'refresh' => SMOPT_REFRESH_NONE ,
  73. 'posvals' => array('noprefix' => _ ("No prefix/Address only"),
  74. 'nickname' => _ ("Nickname and address"),
  75. 'fullname' => _ ("Full name and address"))
  76. );
  77. $optvals[SMOPT_GRP_COMPOSE ][] = array(
  78. 'name' => 'compose_new_win',
  79. 'caption' => _ ("Compose Messages in New Window"),
  80. 'type' => SMOPT_TYPE_BOOLEAN ,
  81. 'refresh' => SMOPT_REFRESH_ALL
  82. );
  83. $optvals[SMOPT_GRP_COMPOSE ][] = array(
  84. 'name' => 'compose_width',
  85. 'caption' => _ ("Width of Compose Window"),
  86. 'type' => SMOPT_TYPE_INTEGER ,
  87. 'refresh' => SMOPT_REFRESH_ALL ,
  88. 'size' => SMOPT_SIZE_TINY
  89. );
  90. $optvals[SMOPT_GRP_COMPOSE ][] = array(
  91. 'name' => 'compose_height',
  92. 'caption' => _ ("Height of Compose Window"),
  93. 'type' => SMOPT_TYPE_INTEGER ,
  94. 'refresh' => SMOPT_REFRESH_ALL ,
  95. 'size' => SMOPT_SIZE_TINY
  96. );
  97. /*** Load the General Options into the array ***/
  98. $optgrps[SMOPT_GRP_COMPOSE_REPLY ] = _ ("Replying and Forwarding Messages");
  99. $optvals[SMOPT_GRP_COMPOSE_REPLY ] = array();
  100. $optvals[SMOPT_GRP_COMPOSE_REPLY ][] = array(
  101. 'name' => 'do_not_reply_to_self',
  102. 'caption' => _ ("Send Replies To My Own Messages To Previous Recipient"),
  103. 'type' => SMOPT_TYPE_BOOLEAN ,
  104. 'refresh' => SMOPT_REFRESH_NONE
  105. );
  106. $optvals[SMOPT_GRP_COMPOSE_REPLY ][] = array(
  107. 'name' => 'include_self_reply_all',
  108. 'caption' => _ ("Include Me in CC when I Reply All"),
  109. 'type' => SMOPT_TYPE_BOOLEAN ,
  110. 'refresh' => SMOPT_REFRESH_NONE
  111. );
  112. $optvals[SMOPT_GRP_COMPOSE_REPLY ][] = array(
  113. 'name' => 'return_to_message_after_reply',
  114. 'caption' => _ ("Return to Original Message After Replying"),
  115. 'type' => SMOPT_TYPE_BOOLEAN ,
  116. 'refresh' => SMOPT_REFRESH_NONE
  117. );
  118. $optvals[SMOPT_GRP_COMPOSE_REPLY ][] = array(
  119. 'name' => 'sig_first',
  120. 'caption' => _ ("Prepend Signature before Reply/Forward Text"),
  121. 'type' => SMOPT_TYPE_BOOLEAN ,
  122. 'refresh' => SMOPT_REFRESH_NONE
  123. );
  124. $optvals[SMOPT_GRP_COMPOSE_REPLY ][] = array(
  125. 'name' => 'body_quote',
  126. 'caption' => _ ("Prefix for Original Message when Replying"),
  127. 'type' => SMOPT_TYPE_STRING ,
  128. 'refresh' => SMOPT_REFRESH_NONE ,
  129. 'size' => SMOPT_SIZE_TINY ,
  130. 'save' => 'save_option_reply_prefix'
  131. );
  132. $optvals[SMOPT_GRP_COMPOSE_REPLY ][] = array(
  133. 'name' => 'reply_focus',
  134. 'caption' => _ ("Cursor Position when Replying"),
  135. 'type' => SMOPT_TYPE_STRLIST ,
  136. 'refresh' => SMOPT_REFRESH_NONE ,
  137. 'posvals' => array('' => _ ("To: field"),
  138. 'focus' => _ ("Focus in body"),
  139. 'select' => _ ("Select body"),
  140. 'none' => _ ("No focus"))
  141. );
  142. $optvals[SMOPT_GRP_COMPOSE_REPLY ][] = array(
  143. 'name' => 'strip_sigs',
  144. 'caption' => _ ("Strip signature when replying"),
  145. 'type' => SMOPT_TYPE_BOOLEAN ,
  146. 'refresh' => SMOPT_REFRESH_NONE
  147. );
  148. /* Assemble all this together and return it as our result. */
  149. $result = array(
  150. 'grps' => $optgrps,
  151. 'vals' => $optvals
  152. );
  153. return ($result);
  154. }
  155. /******************************************************************/
  156. /** Define any specialized save functions for this option page. ***/
  157. /** ***/
  158. /** You must add every function that is set in save parameter ***/
  159. /******************************************************************/
  160. /**
  161. * This function saves the reply prefix (body_quote) character(s)
  162. * @param object $option
  163. */
  164. function save_option_reply_prefix ($option) {
  165. // save as "NONE" if it was blanked out
  166. //
  167. if (empty($option->new_value)) $option->new_value = 'NONE';
  168. // Save the option like normal.
  169. //
  170. save_option ($option);
  171. }

Documentation generated on 2020年1月13日 04:22:09 +0100 by phpDocumentor 1.4.3

AltStyle によって変換されたページ (->オリジナル) /