Added newmail dropdowns, and preparing for special folders only count mails.
[squirrelmail.git] / plugins / administrator / defines.php
index c22002b098bd996d98f7d9fc748b95dec193111b..c9abb7fbf03872f654cffe4a92981eee6a3b7111 100644 (file)
@@ -11,6 +11,7 @@
  * $Id$
  */
 
+require_once( '../functions/constants.php' );
 
 /* Define constants for the various option types. */
 define('SMOPT_TYPE_UNDEFINED', -1);
@@ -23,33 +24,21 @@ define('SMOPT_TYPE_BOOLEAN', 5);
 define('SMOPT_TYPE_HIDDEN', 6);
 define('SMOPT_TYPE_COMMENT', 7);
 define('SMOPT_TYPE_NUMLIST', 8);
-define('SMOPT_TYPE_TITLE', 128);
-
-/* Define constants for the options refresh levels. */
-define('SMOPT_REFRESH_NONE', 0);
-define('SMOPT_REFRESH_FOLDERLIST', 1);
-define('SMOPT_REFRESH_ALL', 2);
-
-/* Define constants for the options size. */
-define('SMOPT_SIZE_TINY', 0);
-define('SMOPT_SIZE_SMALL', 1);
-define('SMOPT_SIZE_MEDIUM', 2);
-define('SMOPT_SIZE_LARGE', 3);
-define('SMOPT_SIZE_HUGE', 4);
-
-define('SMOPT_SAVE_DEFAULT', 'save_option');
-define('SMOPT_SAVE_NOOP', 'save_option_noop');
+define('SMOPT_TYPE_TITLE', 9);
+define('SMOPT_TYPE_THEME', 10);
+define('SMOPT_TYPE_PLUGINS', 11);
+define('SMOPT_TYPE_LDAP', 12);
 
 global $languages;
 
-$language_values = array();
+$language_values = array( );
 foreach ($languages as $lang_key => $lang_attributes) {
     if (isset($lang_attributes['NAME'])) {
         $language_values[$lang_key] = $lang_attributes['NAME'];
     }
 }
 asort( $language_values );
-
+$language_values = array_merge(array('' => _("Default")), $language_values);
 $left_size_values = array();
 for ($lsv = 100; $lsv <= 300; $lsv += 10) {
     $left_size_values[$lsv] = "$lsv " . _("pixels");
@@ -79,7 +68,8 @@ $defcfg = array( '$config_version' => array( 'name' => _("Config File Version"),
                                                             'posvals' => $language_values ),
                  '$frame_top' => array( 'name' => _("Top Frame"),
                                         'type' => SMOPT_TYPE_STRING,
-                                        'size' => 40 ),
+                                        'size' => 40,
+                                        'default' => '_top' ),
                  /* --------------------------------------------------------*/
                  'Group2' => array( 'name' => _("Server Settings"),
                                     'type' => SMOPT_TYPE_TITLE ),
@@ -100,7 +90,9 @@ $defcfg = array( '$config_version' => array( 'name' => _("Config File Version"),
                                                                    'other' => _("Not one of the above servers") ) ),
                  '$optional_delimiter' => array( 'name' => _("IMAP Folder Delimiter"),
                                                  'type' => SMOPT_TYPE_STRING,
-                                                 'size' => 2 ),
+                                                 'comment' => _("Use \"detect\" to auto-detect."),
+                                                 'size' => 10,
+                                                 'default' => 'detect' ),
                  '$useSendmail' => array( 'name' => _("Use Sendmail"),
                                           'type' => SMOPT_TYPE_BOOLEAN ),
                  '$sendmail_path' => array( 'name' => _("Sendmail Path"),
@@ -149,17 +141,32 @@ $defcfg = array( '$config_version' => array( 'name' => _("Config File Version"),
                  '$show_contain_subfolders_option' => array( 'name' => _("Show 'Contain Sub.' Option"),
                                                              'type' => SMOPT_TYPE_BOOLEAN ),
                  '$default_unseen_notify' => array( 'name' => _("Default Unseen Notify"),
-                                                    'type' => SMOPT_TYPE_INTEGER ),
+                                                    'type' => SMOPT_TYPE_NUMLIST,
+                                                    'posvals' => array( SMPREF_UNSEEN_NONE  => _("No Notification"),
+                                                                        SMPREF_UNSEEN_INBOX => _("Only INBOX"),
+                                                                        SMPREF_UNSEEN_ALL   => _("All Folders")) ),
                  '$default_unseen_type'  => array( 'name' => _("Default Unseen Type"),
-                                                   'type' => SMOPT_TYPE_INTEGER ),
+                                                   'type' => SMOPT_TYPE_NUMLIST ,
+                                                   'posvals' => array( SMPREF_UNSEEN_ONLY  => _("Only Unseen"),
+                                                                       SMPREF_UNSEEN_TOTAL => _("Unseen and Total") ) ),
                  '$auto_create_special' => array( 'name' => _("Auto Create Special Folders"),
                                                   'type' => SMOPT_TYPE_BOOLEAN ),
+                 '$default_use_javascript_addr_book' => array( 'name' => _("Default Javascript Adrressbook"),
+                                                  'type' => SMOPT_TYPE_BOOLEAN ),
                  /* --------------------------------------------------------*/
-                 'Group4' => array( 'name' => _("General OPtions"),
+                 'Group4' => array( 'name' => _("General Options"),
                                     'type' => SMOPT_TYPE_TITLE ),
                  '$default_charset' => array( 'name' => _("Default Charset"),
-                                              'type' => SMOPT_TYPE_STRING,
-                                              'size' => 10 ),
+                                              'type' => SMOPT_TYPE_STRLIST,
+                                              'posvals' => array( 'iso_8859_1' => 'iso_8859_1',
+                                                                  'iso_8859_2' => 'iso_8859_2',
+                                                                  'iso_8859_7' => 'iso_8859_7',
+                                                                  'iso_8859_15' => 'iso_8859_15',
+                                                                  'iso_8859_15' => 'iso_8859_15',
+                                                                  'ns_4551_1' => 'ns_4551_1',
+                                                                  'koi8-r' => 'koi8-r',
+                                                                  'euc-KR' => 'euc-KR',
+                                                                  'windows-1251' => 'windows-1251' ) ),
                  '$data_dir' => array( 'name' => _("Data Directory"),
                                        'type' => SMOPT_TYPE_STRING,
                                        'size' => 40 ),
@@ -173,7 +180,7 @@ $defcfg = array( '$config_version' => array( 'name' => _("Config File Version"),
                                                                  2 => _("Moderate"),
                                                                  3 => _("Medium"),
                                                                  4 => _("High") ) ),
-                 '$default_left_size' => array( 'name' => _("Hash Level"),
+                 '$default_left_size' => array( 'name' => _("Default Left Size"),
                                                 'type' => SMOPT_TYPE_NUMLIST,
                                                 'posvals' => $left_size_values ),
                  '$force_username_lowercase' => array( 'name' => _("Usernames in Lowercase"),
@@ -183,13 +190,31 @@ $defcfg = array( '$config_version' => array( 'name' => _("Config File Version"),
                  '$hide_sm_attributions' => array( 'name' => _("Hide SM attributions"),
                                                    'type' => SMOPT_TYPE_BOOLEAN ),
                  /* --------------------------------------------------------*/
-                 'Group5' => array( 'name' => _("Themes"),
-                                    'type' => SMOPT_TYPE_TITLE )
-               );
-
+                 'Group5' => array( 'name' => _("Message of the Day"),
+                                    'type' => SMOPT_TYPE_TITLE ),
+                 '$motd' => array( 'name' => _("Message of the Day"),
+                                   'type' => SMOPT_TYPE_TEXTAREA,
+                                   'size' => 40 ),
+                 /* --------------------------------------------------------*/
+                 'Group6' => array( 'name' => _("Database"),
+                                    'type' => SMOPT_TYPE_TITLE ),
+                 '$addrbook_dsn' => array( 'name' => _("Address book DSN"),
+                                           'type' => SMOPT_TYPE_STRING,
+                                           'size' => 40 ), 
+                 '$addrbook_table' => array( 'name' => _("Address book table"),
+                                             'type' => SMOPT_TYPE_STRING,
+                                             'size' => 40,
+                                             'default' => 'address' ),
+                 /* --------------------------------------------------------*/
+                 'Group7' => array( 'name' => _("Themes"),
+                                    'type' => SMOPT_TYPE_TITLE ),
+                 '$theme_css' => array( 'name' => _("Style Sheet URL (css)"),
+                                        'type' => SMOPT_TYPE_STRING,
+                                        'size' => 40 ),
+                 /* --------------------------------------------------------*/
+                 '$config_use_color' => array( 'type' => SMOPT_TYPE_HIDDEN )
+                 /* --------------------------------------------------------*/
 
-$defcfg['$motd'] = array( 'name' => _("Message of the Day"),
-                          'type' => SMOPT_TYPE_STRING,
-                          'size' => 40 );
+               );
 
-?>
\ No newline at end of file
+?>