alecpl
2011-06-14 ecf295f6ef2b83c5e51cc74adf833fd8e18b6cfb
program/include/main.inc
@@ -867,8 +867,7 @@
  // use value from post
  if (isset($_POST[$fname])) {
    $postvalue = get_input_value($fname, RCUBE_INPUT_POST,
      $type == 'textarea' && strpos($attrib['class'], 'mce_editor')!==false ? true : false);
    $postvalue = get_input_value($fname, RCUBE_INPUT_POST, true);
    $value = $attrib['array'] ? $postvalue[intval($colcounts[$col]++)] : $postvalue;
  }
@@ -1091,28 +1090,28 @@
  // an alternative would be to convert the date() format string to fit with strftime()
  $out = '';
  for($i=0; $i<strlen($format); $i++) {
    if ($format{$i}=='\\')  // skip escape chars
    if ($format[$i]=='\\')  // skip escape chars
      continue;
    // write char "as-is"
    if ($format{$i}==' ' || $format{$i-1}=='\\')
      $out .= $format{$i};
    if ($format[$i]==' ' || $format{$i-1}=='\\')
      $out .= $format[$i];
    // weekday (short)
    else if ($format{$i}=='D')
    else if ($format[$i]=='D')
      $out .= rcube_label(strtolower(date('D', $timestamp)));
    // weekday long
    else if ($format{$i}=='l')
    else if ($format[$i]=='l')
      $out .= rcube_label(strtolower(date('l', $timestamp)));
    // month name (short)
    else if ($format{$i}=='M')
    else if ($format[$i]=='M')
      $out .= rcube_label(strtolower(date('M', $timestamp)));
    // month name (long)
    else if ($format{$i}=='F')
    else if ($format[$i]=='F')
      $out .= rcube_label('long'.strtolower(date('M', $timestamp)));
    else if ($format{$i}=='x')
    else if ($format[$i]=='x')
      $out .= strftime('%x %X', $timestamp);
    else
      $out .= date($format{$i}, $timestamp);
      $out .= date($format[$i], $timestamp);
  }
  if ($today) {
@@ -1206,7 +1205,7 @@
    $RCMAIL->output->add_gui_object('mailboxlist', $attrib['id']);
    $RCMAIL->output->set_env('mailboxes', $js_mailboxlist);
    $RCMAIL->output->set_env('collapsed_folders', $RCMAIL->config->get('collapsed_folders'));
    $RCMAIL->output->set_env('collapsed_folders', (string)$RCMAIL->config->get('collapsed_folders'));
  }
  return $out;
@@ -1353,15 +1352,15 @@
    $classes = array('mailbox');
    // set special class for Sent, Drafts, Trash and Junk
    if ($folder['id']==$CONFIG['sent_mbox'])
    if ($folder['id'] == $CONFIG['sent_mbox'])
      $classes[] = 'sent';
    else if ($folder['id']==$CONFIG['drafts_mbox'])
    else if ($folder['id'] == $CONFIG['drafts_mbox'])
      $classes[] = 'drafts';
    else if ($folder['id']==$CONFIG['trash_mbox'])
    else if ($folder['id'] == $CONFIG['trash_mbox'])
      $classes[] = 'trash';
    else if ($folder['id']==$CONFIG['junk_mbox'])
    else if ($folder['id'] == $CONFIG['junk_mbox'])
      $classes[] = 'junk';
    else if ($folder['id']=='INBOX')
    else if ($folder['id'] == 'INBOX')
      $classes[] = 'inbox';
    else
      $classes[] = '_'.asciiwords($folder_class ? $folder_class : strtolower($folder['id']), true);
@@ -1371,7 +1370,7 @@
    if ($folder['id'] == $mbox_name)
      $classes[] = 'selected';
    $collapsed = preg_match('/&'.rawurlencode($folder['id']).'&/', $RCMAIL->config->get('collapsed_folders'));
    $collapsed = strpos($CONFIG['collapsed_folders'], '&'.rawurlencode($folder['id']).'&') !== false;
    $unread = $msgcounts ? intval($msgcounts[$folder['id']]['UNSEEN']) : 0;
    if ($folder['virtual'])
@@ -1810,6 +1809,10 @@
  $domain = $is_utf ? idn_to_ascii($domain) : idn_to_utf8($domain);
  if ($domain === false) {
    return '';
  }
  return $at ? $user . '@' . $domain : $domain;
}