Changeset 337 in subversion


Ignore:
Timestamp:
Sep 7, 2006 2:51:16 PM (7 years ago)
Author:
thomasb
Message:

Made automatic draft saving configurable

Location:
trunk/roundcubemail
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/roundcubemail/config/main.inc.php.dist

    r321 r337  
    196196 */ 
    197197 
     198// list of configuration option names that need to be available in Javascript. 
     199$rcmail_config['javascript_config'] = array('read_when_deleted', 'flag_for_deletion'); 
     200 
    198201// try to load host-specific configuration 
    199202$rcmail_config['include_host_config'] = FALSE; 
     
    223226$rcmail_config['message_sort_order'] = 'DESC'; 
    224227 
    225 // list of configuration option names that need to be available in Javascript. 
    226 $rcmail_config['javascript_config'] = array('read_when_deleted', 'flag_for_deletion'); 
    227  
     228// save compose message every 300 seconds (5min) 
     229$rcmail_config['draft_autosave'] = 300; 
    228230 
    229231// end of config file 
  • trunk/roundcubemail/program/localization/de_CH/labels.inc

    r282 r337  
    201201$labels['dstactive']  = 'Sommerzeit'; 
    202202 
     203$labels['autosavedraft']  = 'Entwurf autom. speichern'; 
     204$labels['everynminutes']  = 'alle $n Minuten'; 
     205$labels['never']  = 'nie'; 
     206 
    203207$labels['folder']  = 'Ordner'; 
    204208$labels['folders']  = 'Ordner'; 
  • trunk/roundcubemail/program/localization/de_DE/labels.inc

    r282 r337  
    202202$labels['dstactive']  = 'Sommerzeit'; 
    203203 
     204$labels['autosavedraft']  = 'Entwurf autom. speichern'; 
     205$labels['everynminutes']  = 'alle $n Minuten'; 
     206$labels['never']  = 'nie'; 
     207 
    204208$labels['folder']  = 'Ordner'; 
    205209$labels['folders']  = 'Ordner'; 
  • trunk/roundcubemail/program/localization/en_US/labels.inc

    r313 r337  
    203203$labels['dstactive']  = 'Daylight savings'; 
    204204 
     205$labels['autosavedraft']  = 'Automatically save draft'; 
     206$labels['everynminutes']  = 'every $n minutes'; 
     207$labels['never']  = 'never'; 
     208 
    205209$labels['folder']  = 'Folder'; 
    206210$labels['folders']  = 'Folders'; 
  • trunk/roundcubemail/program/steps/mail/compose.inc

    r322 r337  
    5555// add some labels to client 
    5656rcube_add_label('nosubject', 'norecipientwarning', 'nosubjectwarning', 'nobodywarning', 'notsentwarning', 'savingmessage', 'sendingmessage', 'messagesaved'); 
     57 
     58// add config parameter to client script 
     59$OUTPUT->add_script(sprintf("%s.set_env('draft_autosave', %d);", $JS_OBJECT_NAME, !empty($CONFIG['drafts_mbox']) ? $CONFIG['draft_autosave'] : 0)); 
    5760 
    5861 
  • trunk/roundcubemail/program/steps/settings/func.inc

    r171 r337  
    4747  $out = "$form_start<table" . $attrib_str . ">\n\n"; 
    4848 
    49   $a_show_cols = array('language'   => array('type' => 'text'), 
    50                        'pagesize'   => array('type' => 'text'), 
    51                        'timezone'   => array('type' => 'text'), 
    52                        'prettydate' => array('type' => 'text')); 
     49  $a_show_cols = array( 
     50          'language'   => array('type' => 'text'), 
     51    'pagesize'   => array('type' => 'text'), 
     52    'timezone'   => array('type' => 'text'), 
     53    'prettydate' => array('type' => 'text'), 
     54    'draft_autosave' => array('type' => 'text') 
     55  ); 
    5356                        
    5457  // show language selection 
     
    145148                  $input_prettydate->show($CONFIG['prettydate']?1:0)); 
    146149 
     150  if (!empty($CONFIG['drafts_mbox'])) 
     151    { 
     152    $field_id = 'rcmfd_autosave'; 
     153    $select_autosave = new select(array('name' => '_draft_autosave', 'id' => $field_id)); 
     154    $select_autosave->add(rcube_label('never'), 0); 
     155    foreach (array(3, 5, 10) as $i => $min) 
     156      $select_autosave->add(rcube_label(array('name' => 'everynminutes', 'vars' => array('n' => $min))), $min*60); 
     157 
     158    $out .= sprintf("<tr><td class=\"title\"><label for=\"%s\">%s</label></td><td>%s</td></tr>\n", 
     159                    $field_id, 
     160                    rep_specialchars_output(rcube_label('autosavedraft')), 
     161                    $select_autosave->show($CONFIG['draft_autosave'])); 
     162    } 
    147163 
    148164  $out .= "\n</table>$form_end"; 
  • trunk/roundcubemail/program/steps/settings/save_prefs.inc

    r194 r337  
    2929$a_user_prefs['pagesize'] = is_numeric($_POST['_pagesize']) ? (int)$_POST['_pagesize'] : $CONFIG['pagesize']; 
    3030$a_user_prefs['prefer_html'] = isset($_POST['_prefer_html']) ? TRUE : FALSE; 
     31$a_user_prefs['draft_autosave'] = isset($_POST['_draft_autosave']) ? intval($_POST['_draft_autosave']) : 0; 
    3132 
    3233// MM: Date format toggle (Pretty / Standard) 
     
    3536if (isset($_POST['_language'])) 
    3637  { 
    37   $sess_user_lang = $_SESSION['user_lang'] = $_POST['_language']; 
     38  $sess_user_lang = $_SESSION['user_lang'] = get_input_value('_language', RCUBE_INPUT_POST); 
    3839  rcmail_set_locale($sess_user_lang); 
    3940  } 
Note: See TracChangeset for help on using the changeset viewer.