alecpl
2011-11-20 b1867b8f198374d26e1bfdfeaeac16971608b551
program/include/main.inc
@@ -1281,11 +1281,6 @@
  $path .= $prefix.$currentFolder;
  if (!isset($arrFolders[$currentFolder])) {
    // Check \Noselect attribute (if attributes are in cache)
    if (!$virtual && ($attrs = $RCMAIL->imap->mailbox_attributes($path))) {
      $virtual = in_array('\\Noselect', $attrs);
    }
    $arrFolders[$currentFolder] = array(
      'id' => $path,
      'name' => rcube_charset_convert($currentFolder, 'UTF7-IMAP'),
@@ -1313,12 +1308,14 @@
  $realnames = (bool)$attrib['realnames'];
  $msgcounts = $RCMAIL->imap->get_cache('messagecount');
  $idx = 0;
  $out = '';
  foreach ($arrFolders as $key => $folder) {
    $title = null;
    $title        = null;
    $folder_class = rcmail_folder_classname($folder['id']);
    $collapsed    = strpos($CONFIG['collapsed_folders'], '&'.rawurlencode($folder['id']).'&') !== false;
    $unread       = $msgcounts ? intval($msgcounts[$folder['id']]['UNSEEN']) : 0;
    if (($folder_class = rcmail_folder_classname($folder['id'])) && !$realnames) {
    if ($folder_class && !$realnames) {
      $foldername = rcube_label($folder_class);
    }
    else {
@@ -1338,24 +1335,11 @@
    $classes = array('mailbox');
    // set special class for Sent, Drafts, Trash and Junk
    if ($folder['id'] == $CONFIG['sent_mbox'])
      $classes[] = 'sent';
    else if ($folder['id'] == $CONFIG['drafts_mbox'])
      $classes[] = 'drafts';
    else if ($folder['id'] == $CONFIG['trash_mbox'])
      $classes[] = 'trash';
    else if ($folder['id'] == $CONFIG['junk_mbox'])
      $classes[] = 'junk';
    else if ($folder['id'] == 'INBOX')
      $classes[] = 'inbox';
    else
      $classes[] = '_'.asciiwords($folder_class ? $folder_class : strtolower($folder['id']), true);
    if ($folder_class)
      $classes[] = $folder_class;
    if ($folder['id'] == $mbox_name)
      $classes[] = 'selected';
    $collapsed = strpos($CONFIG['collapsed_folders'], '&'.rawurlencode($folder['id']).'&') !== false;
    $unread = $msgcounts ? intval($msgcounts[$folder['id']]['UNSEEN']) : 0;
    if ($folder['virtual'])
      $classes[] = 'virtual';
@@ -1390,7 +1374,6 @@
    }
    $out .= "</li>\n";
    $idx++;
  }
  return $out;
@@ -1606,7 +1589,7 @@
 */
function rcube_html_editor($mode='')
{
  global $RCMAIL, $CONFIG;
  global $RCMAIL;
  $hook = $RCMAIL->plugins->exec_hook('html_editor', array('mode' => $mode));
@@ -1615,8 +1598,11 @@
  $lang = strtolower($_SESSION['language']);
  // TinyMCE uses 'tw' for zh_TW (which is wrong, because tw is a code of Twi language)
  $lang = ($lang == 'zh_tw') ? 'tw' : substr($lang, 0, 2);
  // TinyMCE uses two-letter lang codes, with exception of Chinese
  if (strpos($lang, 'zh_') === 0)
    $lang = str_replace('_', '-', $lang);
  else
    $lang = substr($lang, 0, 2);
  if (!file_exists(INSTALL_PATH . 'program/js/tiny_mce/langs/'.$lang.'.js'))
    $lang = 'en';
@@ -1628,8 +1614,8 @@
        'mode'       => $mode,
        'skin_path'  => '$__skin_path',
        'lang'       => $lang,
        'spellcheck' => intval($CONFIG['enable_spellcheck']),
        'spelldict'  => intval($CONFIG['spellcheck_dictionary']),
        'spellcheck' => intval($RCMAIL->config->get('enable_spellcheck')),
        'spelldict'  => intval($RCMAIL->config->get('spellcheck_dictionary')),
    ))), 'foot');
}