Changeset b190970 in github


Ignore:
Timestamp:
Dec 1, 2006 1:06:16 PM (7 years ago)
Author:
thomascube <thomas@…>
Branches:
master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
Children:
53ed1e3
Parents:
740e9ec
Message:

Introducing preview pane and conditional skin tags

Files:
1 added
18 edited

Legend:

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

    rd656f1c rb190970  
    196196 */ 
    197197 
     198// don't allow these settings to be overriden by the user 
     199$rcmail_config['dont_override'] = array(); 
     200 
    198201// list of configuration option names that need to be available in Javascript. 
    199202$rcmail_config['javascript_config'] = array('read_when_deleted', 'flag_for_deletion'); 
     
    217220$rcmail_config['prefer_html'] = TRUE; 
    218221 
     222// compose html formatted messages by default 
     223$rcmail_config['htmleditor'] = TRUE; 
     224 
    219225// show pretty dates as standard 
    220226$rcmail_config['prettydate'] = TRUE; 
     
    229235$rcmail_config['draft_autosave'] = 300; 
    230236 
     237// default setting if preview pane is enabled 
     238$rcmail_config['preview_pane'] = FALSE; 
     239 
    231240// end of config file 
    232241?> 
  • index.php

    r0a020ca rb190970  
    33 +-----------------------------------------------------------------------+ 
    44 | RoundCube Webmail IMAP Client                                         | 
    5  | Version 0.1-20061122                                                  | 
     5 | Version 0.1-20061201                                                  | 
    66 |                                                                       | 
    77 | Copyright (C) 2005-2006, RoundCube Dev. - Switzerland                 | 
     
    4141*/ 
    4242 
    43 define('RCMAIL_VERSION', '0.1-20061122'); 
     43define('RCMAIL_VERSION', '0.1-20061201'); 
    4444 
    4545// define global vars 
     
    265265  include_once('program/steps/mail/func.inc'); 
    266266   
    267   if ($_action=='show' || $_action=='print') 
     267  if ($_action=='show' || $_action=='preview' || $_action=='print') 
    268268    include('program/steps/mail/show.inc'); 
    269269 
  • program/include/main.inc

    r0a020ca rb190970  
    11431143 
    11441144  // parse for specialtags 
    1145   $output = parse_rcube_xml($templ); 
    1146    
     1145  $output = parse_rcube_xml(parse_rcube_conditions($templ)); 
     1146   
     1147  // add debug console 
     1148  if ($CONFIG['debug_level'] & 8) 
     1149    $OUTPUT->footer = '<div style="position:absolute;top:5px;left:5px;width:400px;opacity:0.8;z-index:9000;"><form name="debugform"><textarea name="console" rows="15" cols="40" style="width:400px;border:none;font-size:x-small"></textarea></form>'; 
     1150 
    11471151  $OUTPUT->write(trim(parse_with_globals($output)), $skin_path); 
    11481152 
     
    11621166 
    11631167 
     1168// parse conditional code 
     1169function parse_rcube_conditions($input) 
     1170  { 
     1171  if (($matches = preg_split('/<roundcube:(if|elseif|else|endif)\s+([^>]+)>/is', $input, 2, PREG_SPLIT_DELIM_CAPTURE)) && count($matches)==4) 
     1172    { 
     1173    if (preg_match('/^(else|endif)$/i', $matches[1])) 
     1174      return $matches[0] . parse_rcube_conditions($matches[3]); 
     1175    else 
     1176      { 
     1177      $attrib = parse_attrib_string($matches[2]); 
     1178      if (isset($attrib['condition'])) 
     1179        { 
     1180        $condmet = rcube_xml_condition($attrib['condition']); 
     1181        $submatches = preg_split('/<roundcube:(elseif|else|endif)\s+([^>]+)>/is', $matches[3], 2, PREG_SPLIT_DELIM_CAPTURE); 
     1182 
     1183                    if ($condmet) 
     1184                            $result = $submatches[0] . preg_replace('/.*<roundcube:endif\s+[^>]+>/is', '', $submatches[3]); 
     1185        else 
     1186          $result = "<roundcube:$submatches[1] $submatches[2]>" . $submatches[3]; 
     1187           
     1188        return $matches[0] . parse_rcube_conditions($result); 
     1189        } 
     1190      else 
     1191        { 
     1192        raise_error(array('code' => 500, 'type' => 'php', 'line' => __LINE__, 'file' => __FILE__, 
     1193                          'message' => "Unable to parse conditional tag " . $matches[2]), TRUE, FALSE); 
     1194        } 
     1195      } 
     1196    } 
     1197 
     1198  return $input; 
     1199  } 
     1200 
     1201  
     1202/** 
     1203 * Determines if a given condition is met 
     1204 * 
     1205 * @return True if condition is valid, False is not 
     1206 */ 
     1207function rcube_xml_condition($condition) 
     1208  { 
     1209  $condition = preg_replace( 
     1210      array('/session:([a-z0-9_]+)/i', '/config:([a-z0-9_]+)/i', '/request:([a-z0-9_]+)/ie'), 
     1211      array("\$_SESSION['\\1']", "\$GLOBALS['CONFIG']['\\1']", "get_input_value('\\1', RCUBE_INPUT_GPC)"), 
     1212      $condition); 
     1213 
     1214  return @eval("return (".$condition.");"); 
     1215  } 
     1216 
    11641217 
    11651218function parse_rcube_xml($input) 
     
    11701223 
    11711224 
     1225/** 
     1226 * Convert a xml command tag into real content 
     1227 */ 
    11721228function rcube_xml_command($command, $str_attrib, $add_attrib=array()) 
    11731229  { 
     
    11761232  $command = strtolower($command); 
    11771233  $attrib = parse_attrib_string($str_attrib) + $add_attrib; 
     1234   
     1235  // empty output if required condition is not met 
     1236  if (!empty($attrib['condition']) && !rcube_xml_condition($attrib['condition'])) 
     1237    return ''; 
    11781238 
    11791239  // execute command 
  • program/include/rcube_shared.inc

    r4ec0e7a rb190970  
    170170    if (strlen($this->scripts['foot'])) 
    171171      $__page_footer .= sprintf($this->script_tag, $this->scripts['foot']); 
     172       
     173    if ($this->footer) 
     174      $__page_footer .= "\n" . $this->footer; 
    172175 
    173176    $__page_header .= $this->css->show(); 
  • program/js/app.js

    r086377c rb190970  
    3333  
    3434  // webmail client settings 
    35   this.dblclick_time = 600; 
     35  this.dblclick_time = 500; 
    3636  this.message_time = 5000; 
    3737   
     
    138138        this.enable_command('list', 'checkmail', 'compose', 'add-contact', 'search', 'reset-search', true); 
    139139         
    140         if (this.env.action=='show') 
     140        if (this.env.action=='show' || this.env.action=='preview') 
    141141          { 
    142142          this.enable_command('show', 'reply', 'reply-all', 'forward', 'moveto', 'delete', 'viewsource', 'print', 'load-attachment', true); 
     
    152152            } 
    153153          } 
    154  
    155         if (this.env.action=='show' && this.env.blockedobjects) 
     154         
     155        // make preview/message frame visible 
     156        if (this.env.action == 'preview' && this.env.framed && parent.rcmail) 
     157          { 
     158          this.enable_command('compose', 'add-contact', false); 
     159          parent.rcmail.show_messageframe(true); 
     160          } 
     161 
     162        if ((this.env.action=='show' || this.env.action=='preview') && this.env.blockedobjects) 
    156163          { 
    157164          if (this.gui_objects.remoteobjectsmsg) 
     
    638645      case 'load-images': 
    639646        if (this.env.uid) 
    640           this.show_message(this.env.uid, true); 
     647          this.show_message(this.env.uid, true, this.env.action=='preview'); 
    641648        break; 
    642649 
     
    647654        if (this.env.uid && props.mimetype && find_in_array(props.mimetype, this.mimetypes)>=0) 
    648655          { 
    649           this.attachment_win = window.open(this.env.comm_path+'&_action=get'+url+'&_frame=1', 'rcubemailattachment'); 
     656          this.attachment_win = window.open(this.env.comm_path+'&_action=get&'+qstring+'&_frame=1', 'rcubemailattachment'); 
    650657          if (this.attachment_win) 
    651658            { 
     
    668675      case 'nextmessage': 
    669676        if (this.env.next_uid) 
    670           this.show_message(this.env.next_uid); 
     677          this.show_message(this.env.next_uid, false, this.env.action=='preview'); 
    671678        break; 
    672679 
     
    678685      case 'previousmessage': 
    679686        if (this.env.prev_uid) 
    680           this.show_message(this.env.prev_uid); 
     687          this.show_message(this.env.prev_uid, false, this.env.action=='preview'); 
    681688        break; 
    682689 
     
    10531060  this.msglist_select = function(list) 
    10541061    { 
     1062    if (this.preview_timer) 
     1063      clearTimeout(this.preview_timer); 
     1064 
    10551065    var selected = list.selection.length==1; 
    10561066    if (this.env.mailbox == this.env.drafts_mailbox) 
     
    10631073      this.enable_command('show', 'reply', 'reply-all', 'forward', 'print', selected); 
    10641074      this.enable_command('delete', 'moveto', list.selection.length>0 ? true : false); 
    1065       } 
    1066    }; 
     1075 
     1076      // start timer for message preview (wait for double click) 
     1077      if (selected && this.env.contentframe) 
     1078        this.preview_timer = setTimeout(this.ref+'.msglist_get_preview()', this.dblclick_time + 10); 
     1079      else if (this.env.contentframe) 
     1080        this.show_messageframe(false); 
     1081      } 
     1082    }; 
    10671083 
    10681084 
    10691085  this.msglist_dbl_click = function(list) 
    10701086    { 
     1087      if (this.preview_timer) 
     1088        clearTimeout(this.preview_timer); 
     1089 
    10711090    var uid = list.get_single_selection(); 
    10721091    if (uid && this.env.mailbox == this.env.drafts_mailbox) 
    10731092      this.goto_url('compose', '_draft_uid='+uid+'&_mbox='+urlencode(this.env.mailbox), true); 
    10741093    else if (uid) 
    1075       this.show_message(uid); 
     1094      this.show_message(uid, false, false); 
    10761095    }; 
    10771096 
     
    10861105 
    10871106 
     1107  this.msglist_get_preview = function() 
     1108  { 
     1109    var uid = this.get_single_uid(); 
     1110    if (uid && this.env.contentframe) 
     1111      this.show_message(uid, false, true); 
     1112    else if (this.env.contentframe) 
     1113      this.show_messageframe(false); 
     1114  }; 
     1115 
    10881116 
    10891117  /*********************************************************/ 
     
    10931121 
    10941122  // when user doble-clicks on a row 
    1095   this.show_message = function(id, safe) 
     1123  this.show_message = function(id, safe, preview) 
    10961124    { 
    10971125    var add_url = ''; 
     1126    var action = preview ? 'preview': 'show'; 
    10981127    var target = window; 
    1099     if (this.env.contentframe && window.frames && window.frames[this.env.contentframe]) 
     1128    if (preview && this.env.contentframe && window.frames && window.frames[this.env.contentframe]) 
    11001129      { 
    11011130      target = window.frames[this.env.contentframe]; 
     
    11081137    if (id) 
    11091138      { 
    1110       this.set_busy(true, 'loading'); 
    1111       target.location.href = this.env.comm_path+'&_action=show&_uid='+id+'&_mbox='+urlencode(this.env.mailbox)+add_url; 
    1112       } 
    1113     }; 
    1114  
     1139      var url = '&_action='+action+'&_uid='+id+'&_mbox='+urlencode(this.env.mailbox)+add_url; 
     1140      if (action == 'preview' && String(target.location.href).indexOf(url) >= 0) 
     1141        this.show_messageframe(true); 
     1142      else 
     1143        { 
     1144        this.set_busy(true, 'loading'); 
     1145        target.location.href = this.env.comm_path+url; 
     1146        } 
     1147      } 
     1148    }; 
     1149 
     1150 
     1151  this.show_messageframe = function(show) 
     1152    { 
     1153    var frm; 
     1154    if (this.env.contentframe && (frm = rcube_find_object(this.env.contentframe))) 
     1155      { 
     1156      if (window.frames[this.env.contentframe] && !show) 
     1157        window.frames[this.env.contentframe].location.href = 'program/blank.gif'; 
     1158      frm.style.display = show ? 'block' : 'none'; 
     1159      } 
     1160       
     1161    if (!show && this.busy) 
     1162      this.set_busy(false); 
     1163    }; 
    11151164 
    11161165 
     
    13741423    { 
    13751424    var a_uids = new Array(); 
    1376     var selection = this.message_list.get_selection(); 
     1425    var selection = this.message_list ? this.message_list.get_selection() : new Array(); 
    13771426     
    13781427    if (uid) 
     
    31033152    { 
    31043153    var request_obj = this.get_request_obj(); 
    3105     querystring += '&_remote=1'; 
     3154    querystring += (querystring ? '&' : '') + '_remote=1'; 
    31063155     
    31073156    // add timestamp to request url to avoid cacheing problems in Safari 
     
    31523201        if (this.env.action=='show') 
    31533202          this.command('list'); 
     3203        else if (this.message_list) 
     3204          this.message_list.init(); 
    31543205        break; 
    31553206 
  • program/localization/de_CH/labels.inc

    rd656f1c rb190970  
    200200$labels['signature'] = 'Signatur'; 
    201201$labels['dstactive']  = 'Sommerzeit'; 
     202$labels['htmleditor'] = 'HTML-Nachrichten verfassen'; 
     203$labels['htmlsignature'] = 'HTML-Signatur'; 
     204$labels['previewpane'] = 'Nachrichtenvorschau anzeigen'; 
    202205 
    203206$labels['autosavedraft']  = 'Entwurf autom. speichern'; 
  • program/localization/de_CH/messages.inc

    rf9c107a rb190970  
    105105$messages['folderdeleted'] = 'Ordner erfolgreich gelöscht'; 
    106106 
     107$messages['deletedsuccessfully'] = "Erfolgreich gelöscht"; 
     108 
     109$messages['converting'] = 'Entferne Formatierungen...'; 
     110 
     111$messages['messageopenerror'] = 'Die Nachricht konnte nicht vom Server geladen werden'; 
    107112 
    108113?> 
  • program/localization/de_DE/messages.inc

    rf9c107a rb190970  
    107107$messages['folderdeleted'] = 'Ordner erfolgreich gelöscht'; 
    108108 
     109$messages['messageopenerror'] = 'Die Nachricht konnte nicht vom Server geladen werden'; 
     110 
    109111?> 
  • program/localization/en_US/labels.inc

    rd170085 rb190970  
    212212$labels['htmleditor'] = 'Compose HTML messages'; 
    213213$labels['htmlsignature'] = 'HTML signature'; 
     214$labels['previewpane'] = 'Show preview pane'; 
    214215 
    215216$labels['autosavedraft']  = 'Automatically save draft'; 
  • program/localization/en_US/messages.inc

    r31c1718 rb190970  
    109109$messages['folderdeleted'] = 'Folder successfully deleted'; 
    110110 
     111$messages['deletedsuccessfully'] = "Successfully deleted"; 
     112 
    111113$messages['converting'] = 'Removing formatting from message...'; 
    112114 
     115$messages['messageopenerror'] = 'Could not load message from server'; 
     116 
    113117?> 
  • program/steps/mail/func.inc

    r31c1718 rb190970  
    559559 
    560560 
     561// return an HTML iframe for loading mail content 
     562function rcmail_messagecontent_frame($attrib) 
     563  { 
     564  global $OUTPUT, $JS_OBJECT_NAME; 
     565   
     566  if (empty($attrib['id'])) 
     567    $attrib['id'] = 'rcmailcontentwindow'; 
     568 
     569  // allow the following attributes to be added to the <iframe> tag 
     570  $attrib_str = create_attrib_string($attrib, array('id', 'class', 'style', 'src', 'width', 'height', 'frameborder')); 
     571  $framename = $attrib['id']; 
     572 
     573  $out = sprintf('<iframe name="%s"%s></iframe>'."\n", 
     574         $framename, 
     575         $attrib_str); 
     576 
     577  $OUTPUT->add_script("$JS_OBJECT_NAME.set_env('contentframe', '$framename');"); 
     578 
     579  return $out; 
     580  } 
     581 
    561582// return code for search function 
    562583function rcmail_search_form($attrib) 
  • program/steps/mail/move_del.inc

    r646cebd rb190970  
    2525if ($_action=='moveto' && $_GET['_uid'] && $_GET['_target_mbox']) 
    2626  { 
    27   $count = sizeof(explode(',', $_GET['_uid']));   
     27  $count = sizeof(explode(',', $_GET['_uid'])); 
    2828  $moved = $IMAP->move_message($_GET['_uid'], $_GET['_target_mbox'], $_GET['_mbox']); 
    2929   
     
    6363// update message count display 
    6464$pages = ceil($IMAP->messagecount()/$IMAP->page_size); 
    65 $commands = "if (this.message_list) this.message_list.init();\n"; 
    66 $commands .= sprintf("this.set_rowcount('%s');\n", rcmail_get_messagecount_text()); 
     65$commands = sprintf("this.set_rowcount('%s');\n", rcmail_get_messagecount_text()); 
    6766$commands .= sprintf("this.set_env('pagecount', %d);\n", $pages); 
    6867 
  • program/steps/mail/show.inc

    rd170085 rb190970  
    3131  $MESSAGE['headers'] = $IMAP->get_headers($MESSAGE['UID']); 
    3232  $MESSAGE['structure'] = $IMAP->get_structure($MESSAGE['UID']); 
    33      
     33   
    3434  // go back to list if message not found (wrong UID) 
    3535  if (!$MESSAGE['headers'] || !$MESSAGE['structure']) 
    3636    { 
    37     $_action = 'list'; 
    38     return; 
     37    show_message('messageopenerror', 'error'); 
     38    if ($_action=='preview' && template_exists('messagepreview')) 
     39        parse_template('messagepreview'); 
     40    else 
     41      { 
     42      $_action = 'list'; 
     43      return; 
     44      } 
    3945    } 
    4046 
     
    132138 
    133139 
    134 // return an HTML iframe for loading mail content 
    135 function rcmail_messagecontent_frame($attrib) 
    136   { 
    137   global $COMM_PATH, $OUTPUT, $GET_URL, $JS_OBJECT_NAME; 
    138    
    139   // allow the following attributes to be added to the <iframe> tag 
    140   $attrib_str = create_attrib_string($attrib); 
    141   $framename = 'rcmailcontentwindow'; 
    142    
    143   $out = sprintf('<iframe src="%s" name="%s"%s>%s</iframe>'."\n", 
    144          $GET_URL, 
    145          $framename, 
    146          $attrib_str, 
    147          rcube_label('loading')); 
    148  
    149  
    150   $OUTPUT->add_script("$JS_OBJECT_NAME.set_env('contentframe', '$framename');"); 
    151  
    152   return $out; 
    153   } 
    154  
    155  
    156140function rcmail_remote_objects_msg($attrib) 
    157141  { 
     
    178162 
    179163 
    180 if ($_action=='print') 
     164if ($_action=='print' && template_exists('printmessage')) 
    181165  parse_template('printmessage'); 
     166else if ($_action=='preview' && template_exists('messagepreview')) 
     167    parse_template('messagepreview'); 
    182168else 
    183169  parse_template('message'); 
  • program/steps/settings/func.inc

    ra0109c4 rb190970  
    3535  global $DB, $CONFIG, $sess_user_lang; 
    3636 
     37  $no_override = is_array($CONFIG['dont_override']) ? array_flip($CONFIG['dont_override']) : array(); 
     38 
    3739  // add some labels to client 
    3840  rcube_add_label('nopagesizewarning'); 
     
    4749  $out = "$form_start<table" . $attrib_str . ">\n\n"; 
    4850 
    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   ); 
    56                         
    5751  // show language selection 
    58   $a_lang = rcube_list_languages(); 
    59   asort($a_lang); 
    60    
    61   $field_id = 'rcmfd_lang'; 
    62   $select_lang = new select(array('name' => '_language', 'id' => $field_id)); 
    63   $select_lang->add(array_values($a_lang), array_keys($a_lang)); 
    64    
    65  
    66   $out .= sprintf("<tr><td class=\"title\"><label for=\"%s\">%s</label></td><td>%s</td></tr>\n", 
    67                   $field_id, 
    68                   rep_specialchars_output(rcube_label('language')), 
    69                   $select_lang->show($sess_user_lang)); 
     52  if (!isset($no_override['language'])) 
     53    { 
     54    $a_lang = rcube_list_languages(); 
     55    asort($a_lang); 
     56   
     57    $field_id = 'rcmfd_lang'; 
     58    $select_lang = new select(array('name' => '_language', 'id' => $field_id)); 
     59    $select_lang->add(array_values($a_lang), array_keys($a_lang)); 
     60   
     61    $out .= sprintf("<tr><td class=\"title\"><label for=\"%s\">%s</label></td><td>%s</td></tr>\n", 
     62                    $field_id, 
     63                    rep_specialchars_output(rcube_label('language')), 
     64                    $select_lang->show($sess_user_lang)); 
     65    } 
    7066 
    7167 
    7268  // show page size selection 
    73   $field_id = 'rcmfd_timezone'; 
    74   $select_timezone = new select(array('name' => '_timezone', 'id' => $field_id)); 
    75   $select_timezone->add('(GMT -11:00) Midway Island, Samoa', '-11'); 
    76   $select_timezone->add('(GMT -10:00) Hawaii', '-10'); 
    77   $select_timezone->add('(GMT -9:00) Alaska', '-9'); 
    78   $select_timezone->add('(GMT -8:00) Pacific Time (US/Canada)', '-8'); 
    79   $select_timezone->add('(GMT -7:00) Mountain Time (US/Canada)', '-7'); 
    80   $select_timezone->add('(GMT -6:00) Central Time (US/Canada), Mexico City', '-6'); 
    81   $select_timezone->add('(GMT -5:00) Eastern Time (US/Canada), Bogota, Lima', '-5'); 
    82   $select_timezone->add('(GMT -4:00) Atlantic Time (Canada), Caracas, La Paz', '-4'); 
    83   $select_timezone->add('(GMT -3:00) Brazil, Buenos Aires, Georgetown', '-3'); 
    84   $select_timezone->add('(GMT -3:30) Nfld Time (Canada), Nfld, S. Labador', '-3.5'); 
    85   $select_timezone->add('(GMT -2:00) Mid-Atlantic', '-2'); 
    86   $select_timezone->add('(GMT -1:00) Azores, Cape Verde Islands', '-1'); 
    87   $select_timezone->add('(GMT) Western Europe, London, Lisbon, Casablanca', '0'); 
    88   $select_timezone->add('(GMT +1:00) Central European Time', '1'); 
    89   $select_timezone->add('(GMT +2:00) EET: Kaliningrad, South Africa', '2'); 
    90   $select_timezone->add('(GMT +3:00) Baghdad, Kuwait, Riyadh, Moscow, Nairobi', '3'); 
    91   $select_timezone->add('(GMT +3:30) Tehran', '3.5'); 
    92   $select_timezone->add('(GMT +4:00) Abu Dhabi, Muscat, Baku, Tbilisi', '4'); 
    93   $select_timezone->add('(GMT +4:30) Kabul', '4.5'); 
    94   $select_timezone->add('(GMT +5:00) Ekaterinburg, Islamabad, Karachi', '5'); 
    95   $select_timezone->add('(GMT +5:30) Chennai, Kolkata, Mumbai, New Delhi', '5.5'); 
    96   $select_timezone->add('(GMT +5:45) Kathmandu', '5.75'); 
    97   $select_timezone->add('(GMT +6:00) Almaty, Dhaka, Colombo', '6'); 
    98   $select_timezone->add('(GMT +7:00) Bangkok, Hanoi, Jakarta', '7'); 
    99   $select_timezone->add('(GMT +8:00) Beijing, Perth, Singapore, Taipei', '8'); 
    100   $select_timezone->add('(GMT +9:00) Tokyo, Seoul, Yakutsk', '9'); 
    101   $select_timezone->add('(GMT +9:30) Adelaide, Darwin', '9.5'); 
    102   $select_timezone->add('(GMT +10:00) EAST/AEST: Guam, Vladivostok', '10'); 
    103   $select_timezone->add('(GMT +11:00) Magadan, Solomon Islands', '11'); 
    104   $select_timezone->add('(GMT +12:00) Auckland, Wellington, Kamchatka', '12'); 
    105   $select_timezone->add('(GMT +13:00) Tonga, Pheonix Islands', '13'); 
    106   $select_timezone->add('(GMT +14:00) Kiribati', '14'); 
    107    
    108    
    109   $out .= sprintf("<tr><td class=\"title\"><label for=\"%s\">%s</label></td><td>%s</td></tr>\n", 
    110                   $field_id, 
    111                   rep_specialchars_output(rcube_label('timezone')), 
    112                   $select_timezone->show($CONFIG['timezone'])); 
    113  
    114  
    115   $field_id = 'rcmfd_dst'; 
    116   $input_dst = new checkbox(array('name' => '_dst_active', 'id' => $field_id, 'value' => 1)); 
    117   $out .= sprintf("<tr><td class=\"title\"><label for=\"%s\">%s</label></td><td>%s</td></tr>\n", 
    118                   $field_id, 
    119                   rep_specialchars_output(rcube_label('dstactive')), 
    120                   $input_dst->show($CONFIG['dst_active'])); 
    121  
     69  if (!isset($no_override['timezone'])) 
     70    { 
     71    $field_id = 'rcmfd_timezone'; 
     72    $select_timezone = new select(array('name' => '_timezone', 'id' => $field_id)); 
     73    $select_timezone->add('(GMT -11:00) Midway Island, Samoa', '-11'); 
     74    $select_timezone->add('(GMT -10:00) Hawaii', '-10'); 
     75    $select_timezone->add('(GMT -9:00) Alaska', '-9'); 
     76    $select_timezone->add('(GMT -8:00) Pacific Time (US/Canada)', '-8'); 
     77    $select_timezone->add('(GMT -7:00) Mountain Time (US/Canada)', '-7'); 
     78    $select_timezone->add('(GMT -6:00) Central Time (US/Canada), Mexico City', '-6'); 
     79    $select_timezone->add('(GMT -5:00) Eastern Time (US/Canada), Bogota, Lima', '-5'); 
     80    $select_timezone->add('(GMT -4:00) Atlantic Time (Canada), Caracas, La Paz', '-4'); 
     81    $select_timezone->add('(GMT -3:00) Brazil, Buenos Aires, Georgetown', '-3'); 
     82    $select_timezone->add('(GMT -3:30) Nfld Time (Canada), Nfld, S. Labador', '-3.5'); 
     83    $select_timezone->add('(GMT -2:00) Mid-Atlantic', '-2'); 
     84    $select_timezone->add('(GMT -1:00) Azores, Cape Verde Islands', '-1'); 
     85    $select_timezone->add('(GMT) Western Europe, London, Lisbon, Casablanca', '0'); 
     86    $select_timezone->add('(GMT +1:00) Central European Time', '1'); 
     87    $select_timezone->add('(GMT +2:00) EET: Kaliningrad, South Africa', '2'); 
     88    $select_timezone->add('(GMT +3:00) Baghdad, Kuwait, Riyadh, Moscow, Nairobi', '3'); 
     89    $select_timezone->add('(GMT +3:30) Tehran', '3.5'); 
     90    $select_timezone->add('(GMT +4:00) Abu Dhabi, Muscat, Baku, Tbilisi', '4'); 
     91    $select_timezone->add('(GMT +4:30) Kabul', '4.5'); 
     92    $select_timezone->add('(GMT +5:00) Ekaterinburg, Islamabad, Karachi', '5'); 
     93    $select_timezone->add('(GMT +5:30) Chennai, Kolkata, Mumbai, New Delhi', '5.5'); 
     94    $select_timezone->add('(GMT +5:45) Kathmandu', '5.75'); 
     95    $select_timezone->add('(GMT +6:00) Almaty, Dhaka, Colombo', '6'); 
     96    $select_timezone->add('(GMT +7:00) Bangkok, Hanoi, Jakarta', '7'); 
     97    $select_timezone->add('(GMT +8:00) Beijing, Perth, Singapore, Taipei', '8'); 
     98    $select_timezone->add('(GMT +9:00) Tokyo, Seoul, Yakutsk', '9'); 
     99    $select_timezone->add('(GMT +9:30) Adelaide, Darwin', '9.5'); 
     100    $select_timezone->add('(GMT +10:00) EAST/AEST: Guam, Vladivostok', '10'); 
     101    $select_timezone->add('(GMT +11:00) Magadan, Solomon Islands', '11'); 
     102    $select_timezone->add('(GMT +12:00) Auckland, Wellington, Kamchatka', '12'); 
     103    $select_timezone->add('(GMT +13:00) Tonga, Pheonix Islands', '13'); 
     104    $select_timezone->add('(GMT +14:00) Kiribati', '14'); 
     105   
     106   
     107    $out .= sprintf("<tr><td class=\"title\"><label for=\"%s\">%s</label></td><td>%s</td></tr>\n", 
     108                    $field_id, 
     109                    rep_specialchars_output(rcube_label('timezone')), 
     110                    $select_timezone->show($CONFIG['timezone'])); 
     111    } 
     112 
     113  // daylight savings 
     114  if (!isset($no_override['dst_active'])) 
     115    { 
     116    $field_id = 'rcmfd_dst'; 
     117    $input_dst = new checkbox(array('name' => '_dst_active', 'id' => $field_id, 'value' => 1)); 
     118    $out .= sprintf("<tr><td class=\"title\"><label for=\"%s\">%s</label></td><td>%s</td></tr>\n", 
     119                    $field_id, 
     120                    rep_specialchars_output(rcube_label('dstactive')), 
     121                    $input_dst->show($CONFIG['dst_active'])); 
     122    } 
    122123 
    123124  // show page size selection 
    124   $field_id = 'rcmfd_pgsize'; 
    125   $input_pagesize = new textfield(array('name' => '_pagesize', 'id' => $field_id, 'size' => 5)); 
    126  
    127   $out .= sprintf("<tr><td class=\"title\"><label for=\"%s\">%s</label></td><td>%s</td></tr>\n", 
    128                   $field_id, 
    129                   rep_specialchars_output(rcube_label('pagesize')), 
    130                   $input_pagesize->show($CONFIG['pagesize'])); 
     125  if (!isset($no_override['pagesize'])) 
     126    { 
     127    $field_id = 'rcmfd_pgsize'; 
     128    $input_pagesize = new textfield(array('name' => '_pagesize', 'id' => $field_id, 'size' => 5)); 
     129 
     130    $out .= sprintf("<tr><td class=\"title\"><label for=\"%s\">%s</label></td><td>%s</td></tr>\n", 
     131                    $field_id, 
     132                    rep_specialchars_output(rcube_label('pagesize')), 
     133                    $input_pagesize->show($CONFIG['pagesize'])); 
     134    } 
     135 
     136  // MM: Show checkbox for toggling 'pretty dates'  
     137  if (!isset($no_override['prettydate'])) 
     138    { 
     139    $field_id = 'rcmfd_prettydate'; 
     140    $input_prettydate = new checkbox(array('name' => '_pretty_date', 'id' => $field_id, 'value' => 1)); 
     141 
     142    $out .= sprintf("<tr><td class=\"title\"><label for=\"%s\">%s</label></td><td>%s</td></tr>\n", 
     143                    $field_id, 
     144                    rep_specialchars_output(rcube_label('prettydate')), 
     145                    $input_prettydate->show($CONFIG['prettydate']?1:0)); 
     146    } 
    131147 
    132148  // show checkbox for HTML/plaintext messages 
    133   $field_id = 'rcmfd_htmlmsg'; 
    134   $input_pagesize = new checkbox(array('name' => '_prefer_html', 'id' => $field_id, 'value' => 1)); 
    135  
    136   $out .= sprintf("<tr><td class=\"title\"><label for=\"%s\">%s</label></td><td>%s</td></tr>\n", 
    137                   $field_id, 
    138                   rep_specialchars_output(rcube_label('preferhtml')), 
    139                   $input_pagesize->show($CONFIG['prefer_html']?1:0)); 
    140  
    141   // MM: Show checkbox for toggling 'pretty dates'  
    142   $field_id = 'rcmfd_prettydate'; 
    143   $input_prettydate = new checkbox(array('name' => '_pretty_date', 'id' => $field_id, 'value' => 1)); 
    144  
    145   $out .= sprintf("<tr><td class=\"title\"><label for=\"%s\">%s</label></td><td>%s</td></tr>\n", 
    146                   $field_id, 
    147                   rep_specialchars_output(rcube_label('prettydate')), 
    148                   $input_prettydate->show($CONFIG['prettydate']?1:0)); 
     149  if (!isset($no_override['prefer_html'])) 
     150    { 
     151    $field_id = 'rcmfd_htmlmsg'; 
     152    $input_pagesize = new checkbox(array('name' => '_prefer_html', 'id' => $field_id, 'value' => 1)); 
     153 
     154    $out .= sprintf("<tr><td class=\"title\"><label for=\"%s\">%s</label></td><td>%s</td></tr>\n", 
     155                    $field_id, 
     156                    rep_specialchars_output(rcube_label('preferhtml')), 
     157                    $input_pagesize->show($CONFIG['prefer_html']?1:0)); 
     158    } 
    149159 
    150160  // Show checkbox for HTML Editor 
    151   $field_id = 'rcmfd_htmleditor'; 
    152   $input_htmleditor = new checkbox(array('name' => '_htmleditor', 'id' => $field_id, 'value' => 1)); 
    153   $out .= sprintf("<tr><td class=\"title\"><label for=\"%s\">%s</label></td><td>%s</td></tr>\n", 
    154                   $field_id, 
    155                   rep_specialchars_output(rcube_label('htmleditor')), 
    156                   $input_htmleditor->show($CONFIG['htmleditor']?1:0)); 
    157  
    158   if (!empty($CONFIG['drafts_mbox'])) 
     161  if (!isset($no_override['htmleditor'])) 
     162    { 
     163    $field_id = 'rcmfd_htmleditor'; 
     164    $input_htmleditor = new checkbox(array('name' => '_htmleditor', 'id' => $field_id, 'value' => 1)); 
     165    $out .= sprintf("<tr><td class=\"title\"><label for=\"%s\">%s</label></td><td>%s</td></tr>\n", 
     166                    $field_id, 
     167                    rep_specialchars_output(rcube_label('htmleditor')), 
     168                    $input_htmleditor->show($CONFIG['htmleditor']?1:0)); 
     169    } 
     170 
     171  // show config parameter for preview pane 
     172  if (!isset($no_override['preview_pane'])) 
     173    { 
     174    $field_id = 'rcmfd_preview'; 
     175    $input_preview = new checkbox(array('name' => '_preview_pane', 'id' => $field_id, 'value' => 1)); 
     176    $out .= sprintf("<tr><td class=\"title\"><label for=\"%s\">%s</label></td><td>%s</td></tr>\n", 
     177                    $field_id, 
     178                    rep_specialchars_output(rcube_label('previewpane')), 
     179                    $input_preview->show($CONFIG['preview_pane']?1:0)); 
     180    } 
     181                   
     182  if (!empty($CONFIG['drafts_mbox']) && !isset($no_override['preview_pane'])) 
    159183    { 
    160184    $field_id = 'rcmfd_autosave'; 
  • program/steps/settings/save_prefs.inc

    ra0109c4 rb190970  
    2020*/ 
    2121 
    22 $a_user_prefs = $_SESSION['user_prefs']; 
    23 if (!is_array($a_user_prefs)) 
    24   $a_user_prefs = array(); 
     22$a_user_prefs = array( 
     23  'timezone'     => isset($_POST['_timezone']) ? floatval($_POST['_timezone']) : $CONFIG['timezone'], 
     24  'dst_active'   => isset($_POST['_dst_active']) ? TRUE : FALSE, 
     25  'pagesize'     => is_numeric($_POST['_pagesize']) ? intval($_POST['_pagesize']) : $CONFIG['pagesize'], 
     26  'prettydate'   => isset($_POST['_pretty_date']) ? TRUE : FALSE, 
     27  'prefer_html'  => isset($_POST['_prefer_html']) ? TRUE : FALSE, 
     28  'htmleditor'   => isset($_POST['_htmleditor']) ? TRUE : FALSE, 
     29  'preview_pane' => isset($_POST['_preview_pane']) ? TRUE : FALSE, 
     30  'draft_autosave' => isset($_POST['_draft_autosave']) ? intval($_POST['_draft_autosave']) : 0 
     31  ); 
     32 
     33// don't override these parameters 
     34foreach ((array)$CONFIG['dont_override'] as $p) 
     35  $a_user_prefs[$p] = $CONFIG[$p]; 
    2536 
    2637 
    27 $a_user_prefs['timezone'] = isset($_POST['_timezone']) ? floatval($_POST['_timezone']) : $CONFIG['timezone']; 
    28 $a_user_prefs['dst_active'] = isset($_POST['_dst_active']) ? TRUE : FALSE; 
    29 $a_user_prefs['pagesize'] = is_numeric($_POST['_pagesize']) ? (int)$_POST['_pagesize'] : $CONFIG['pagesize']; 
    30 $a_user_prefs['prefer_html'] = isset($_POST['_prefer_html']) ? TRUE : FALSE; 
    31 $a_user_prefs['htmleditor'] = isset($_POST['_htmleditor']) ? TRUE : FALSE; 
    32 $a_user_prefs['draft_autosave'] = isset($_POST['_draft_autosave']) ? intval($_POST['_draft_autosave']) : 0; 
    33  
    34 // MM: Date format toggle (Pretty / Standard) 
    35 $a_user_prefs['prettydate'] = isset($_POST['_pretty_date']) ? TRUE : FALSE; 
    36  
     38// switch UI language 
    3739if (isset($_POST['_language'])) 
    3840  { 
  • skins/default/mail.css

    rfda695f rb190970  
    121121} 
    122122 
     123#mailpreviewframe 
     124{ 
     125  position: absolute; 
     126  top: 300px; 
     127  left: 200px; 
     128  right: 40px; 
     129  bottom: 40px; 
     130  border: 1px solid #999999; 
     131  background-color: #F9F9F9; 
     132  /* css hack for IE */ 
     133  width: expression((parseInt(document.documentElement.clientWidth)-240)+'px'); 
     134  height: expression((parseInt(document.documentElement.clientHeight)-340)+'px'); 
     135} 
     136 
     137#messagecontframe 
     138{ 
     139  width: 100%; 
     140  height: 100%; 
     141  border: 0; 
     142} 
     143 
     144/*\*/ 
     145html>body*#messagecontframe 
     146{ 
     147  height: 40%; 
     148} 
     149/**/ 
    123150 
    124151#messagepartframe 
     
    386413#messagelist tbody tr td 
    387414{ 
    388   height: 16px !important; 
    389   height: 20px; 
     415  height: 16px; 
    390416  padding: 2px; 
    391417  padding-right: 4px; 
     
    460486  color: #FFFFFF; 
    461487  background-color: #CC3333; 
    462 } 
    463  
    464 #messagelist tr.focused td 
    465 { 
    466   border-bottom: thin dotted; 
    467   border-top: thin dotted; 
    468488} 
    469489 
     
    576596{ 
    577597  position: absolute; 
    578   top: 85px; 
     598  top: 95px; 
    579599  left: 200px; 
    580600  right: 40px; 
     
    589609} 
    590610 
     611div.messageheaderbox 
     612{ 
     613  margin: 6px 8px 0px 8px; 
     614  border: 1px solid #ccc; 
     615} 
     616 
    591617table.headers-table 
    592618{ 
  • skins/default/settings.css

    r24053e0 rb190970  
    5050  top: 95px; 
    5151  left: 20px; 
    52   width: 550px; 
     52  width: 600px; 
    5353  border: 1px solid #999999;   
    5454} 
     
    7979#identities-table 
    8080{ 
    81   width: 500px; 
     81  width: 600px; 
    8282  border: 1px solid #999999; 
    8383  background-color: #F9F9F9; 
  • skins/default/templates/mail.html

    rd170085 rb190970  
    5555</div> 
    5656 
     57<roundcube:if condition="config:preview_pane == true" /> 
     58<div id="mailpreviewframe"> 
     59<roundcube:object name="messagecontentframe" id="messagecontframe" width="100%" height="100%" frameborder="0" src="/watermark.html" /> 
     60</div> 
     61 
     62<style type="text/css"> 
     63#mailcontframe { 
     64  bottom: auto; 
     65  height: 210px; 
     66} 
     67</style> 
     68<roundcube:endif /> 
     69 
    5770<div id="listcontrols"> 
    5871<roundcube:label name="select" />:&nbsp; 
Note: See TracChangeset for help on using the changeset viewer.