Source for file compose.php

Documentation is available at compose.php

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

Documentation generated on Mon, 13 Jan 2020 04:22:09 +0100 by phpDocumentor 1.4.3