Source for file display.php
Documentation is available at display.php
* Displays all optinos about display preferences
* @copyright 1999-2020 The SquirrelMail Project Team
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @version $Id: display.php 14840 2020-01-07 07:42:38Z pdontthink $
/** Define the group constants for the display options page. */
define('SMOPT_GRP_GENERAL', 0);
define('SMOPT_GRP_MAILBOX', 1);
define('SMOPT_GRP_MESSAGE', 2);
* This function builds an array with all the information about
* the options available to the user, and returns it. The options
* are grouped by the groups in which they are displayed.
* For each option, the following information is stored:
* - name: the internal (variable) name
* - caption: the description of the option in the UI
* - type: one of SMOPT_TYPE_*
* - refresh: one of SMOPT_REFRESH_*
* - size: one of SMOPT_SIZE_*
* - save: the name of a function to call when saving this option
* @return array all option information
/* Build a simple array into which we will build options. */
/******************************************************/
/* LOAD EACH GROUP OF OPTIONS INTO THE OPTIONS ARRAY. */
/******************************************************/
/*** Load the General Options into the array ***/
/* Load the theme option. */
foreach ($theme as $theme_key =>
$theme_attributes) {
$theme_values[$theme_attributes['NAME']] =
$theme_attributes['PATH'];
'name' =>
'chosen_theme',
'posvals' =>
$theme_values,
'save' =>
'save_option_theme'
$css_values =
array( 'none' =>
_("Default" ) );
while ($file =
readdir($handle) ) {
if ( substr( $file, -
4 ) ==
'.css' ) {
$css_values[$file] =
substr( $file, 0, strlen( $file ) -
4 );
if ( count( $css_values ) >
1 ) {
'caption' =>
_("Custom Stylesheet"),
$language_values =
array();
foreach ($languages as $lang_key =>
$lang_attributes) {
if (isset
($lang_attributes['NAME'])) {
$language_values[$lang_key] =
$lang_attributes['NAME'];
$language =
$squirrelmail_language;
'caption' =>
_("Language"),
'posvals' =>
$language_values,
/* Set values for the "use javascript" option. */
'name' =>
'javascript_setting',
'caption' =>
_("Use Javascript"),
if ($optmode !=
'submit')
// FIXME: our form is named "f" - why? let's use something better
$onLoadScript =
'document.f.new_js_autodetect_results.value = \'' .
SMPREF_JS_ON .
'\'';
'name' =>
'js_autodetect_results',
//'post_script' => $js_autodetect_script,
'save' =>
'save_option_javascript_autodetect'
/*** Load the General Options into the array ***/
'caption' =>
_("Number of Messages per Page"),
'name' =>
'alt_index_colors',
'caption' =>
_("Enable Alternating Row Colors"),
'name' =>
'page_selector',
'caption' =>
_("Enable Page Selector"),
'name' =>
'page_selector_max',
'caption' =>
_("Maximum Number of Pages to Show"),
'name' =>
'show_full_date',
'caption' =>
_("Always Show Full Date"),
'name' =>
'truncate_sender',
'caption' =>
_("Length of From/To Field (0 for full)"),
'name' =>
'truncate_subject',
'caption' =>
_("Length of Subject Field (0 for full)"),
/*** Load the General Options into the array ***/
'caption' =>
_("Wrap Incoming Text At"),
'caption' =>
_("Width of Editor Window"),
'name' =>
'editor_height',
'caption' =>
_("Height of Editor Window"),
'name' =>
'location_of_buttons',
'caption' =>
_("Location of Buttons when Composing"),
'name' =>
'use_javascript_addr_book',
'caption' =>
_("Address Book Display Format"),
'posvals' =>
array('1' =>
_("Javascript"),
'name' =>
'addrsrch_fullname',
'caption' =>
_("Format of Addresses Added From Address Book"),
'posvals' =>
array('noprefix' =>
_("No prefix/Address only"),
'nickname' =>
_("Nickname and address"),
'fullname' =>
_("Full name and address"))
'name' =>
'show_html_default',
'caption' =>
_("Show HTML Version by Default"),
'name' =>
'enable_forward_as_attachment',
'caption' =>
_("Enable Forward as Attachment"),
'name' =>
'do_not_reply_to_self',
'caption' =>
_("Send Replies To My Own Messages To Previous Recipient"),
'name' =>
'include_self_reply_all',
'caption' =>
_("Include Me in CC when I Reply All"),
'name' =>
'return_to_message_after_reply',
'caption' =>
_("Return to Original Message After Replying"),
'name' =>
'show_xmailer_default',
'caption' =>
_("Enable Mailer Display"),
'name' =>
'attachment_common_show_images',
'caption' =>
_("Display Attached Images with Message"),
'name' =>
'pf_cleandisplay',
'caption' =>
_("Enable Printer Friendly Clean Display"),
'name' =>
'mdn_user_support',
'caption' =>
_("Enable Mail Delivery Notification"),
'name' =>
'compose_new_win',
'caption' =>
_("Compose Messages in New Window"),
'name' =>
'compose_width',
'caption' =>
_("Width of Compose Window"),
'name' =>
'compose_height',
'caption' =>
_("Height of Compose Window"),
'caption' =>
_("Prepend Signature before Reply/Forward Text"),
'caption' =>
_("Strip signature when replying"),
'caption' =>
_("Prefix for Original Message when Replying"),
'save' =>
'save_option_reply_prefix'
'caption' =>
_("Cursor Position when Replying"),
'posvals' =>
array('' =>
_("To: field"),
'focus' =>
_("Focus in body"),
'select' =>
_("Select body"),
'name' =>
'internal_date_sort',
'caption' =>
_("Sort by Received Date"),
if ($allow_thread_sort ==
TRUE) {
'caption' =>
_("Enable Thread Sort by References Header"),
/* Assemble all this together and return it as our result. */
/******************************************************************/
/** Define any specialized save functions for this option page. ***/
/******************************************************************/
* This function saves a new theme setting.
* It updates the theme array.
/* Do checking to make sure $new_theme is in the array. */
for ($i =
0; $i <
count($theme); ++
$i) {
if ($theme[$i]['PATH'] ==
$option->new_value) {
/* Save the option like normal. */
* This function saves the javascript detection option.
sqGetGlobalVar('new_javascript_setting', $new_javascript_setting);
// Set javascript either on or off.
setPref($data_dir, $username, 'javascript_on', $new_javascript_setting);
global $data_dir, $username, $new_javascript_setting;
// save as "NONE" if it was blanked out
if (empty($option->new_value)) $option->new_value =
'NONE';
// Save the option like normal.
Documentation generated on Mon, 13 Jan 2020 04:24:33 +0100 by phpDocumentor 1.4.3