alecpl
2011-12-25 672dc411f9d26f557dbab0de4056714274a8fe92
program/include/main.inc
@@ -839,11 +839,11 @@
function rcmail_get_edit_field($col, $value, $attrib, $type='text')
{
  static $colcounts = array();
  $fname = '_'.$col;
  $attrib['name'] = $fname . ($attrib['array'] ? '[]' : '');
  $attrib['class'] = trim($attrib['class'] . ' ff_' . $col);
  if ($type == 'checkbox') {
    $attrib['value'] = '1';
    $input = new html_checkbox($attrib);
@@ -856,6 +856,9 @@
    $input = new html_select($attrib);
    $input->add('---', '');
    $input->add(array_values($attrib['options']), array_keys($attrib['options']));
  }
  else if ($attrib['type'] == 'password') {
    $input = new html_passwordfield($attrib);
  }
  else {
    if ($attrib['type'] != 'text' && $attrib['type'] != 'hidden')
@@ -1170,7 +1173,7 @@
  global $RCMAIL;
  static $a_mailboxes;
  $attrib += array('maxlength' => 100, 'realnames' => false);
  $attrib += array('maxlength' => 100, 'realnames' => false, 'unreadwrap' => ' (%s)');
  // add some labels to client
  $RCMAIL->output->add_label('purgefolderconfirm', 'deletemessagesconfirm');
@@ -1217,6 +1220,7 @@
    $RCMAIL->output->add_gui_object('mailboxlist', $attrib['id']);
    $RCMAIL->output->set_env('mailboxes', $js_mailboxlist);
    $RCMAIL->output->set_env('unreadwrap', $attrib['unreadwrap']);
    $RCMAIL->output->set_env('collapsed_folders', (string)$RCMAIL->config->get('collapsed_folders'));
  }
@@ -1372,7 +1376,7 @@
      $classes[] = 'unread';
    $js_name = JQ($folder['id']);
    $html_name = Q($foldername) . ($unread ? html::span('unreadcount', " ($unread)") : '');
    $html_name = Q($foldername) . ($unread ? html::span('unreadcount', sprintf($attrib['unreadwrap'], $unread)) : '');
    $link_attrib = $folder['virtual'] ? array() : array(
      'href' => rcmail_url('', array('_mbox' => $folder['id'])),
      'onclick' => sprintf("return %s.command('list','%s',this)", JS_OBJECT_NAME, $js_name),
@@ -1607,6 +1611,26 @@
/**
 * Generate CSS classes from mimetype and filename extension
 *
 * @param string Mimetype
 * @param string The filename
 * @return string CSS classes separated by space
 */
function rcmail_filetype2classname($mimetype, $filename)
{
  list($primary, $secondary) = explode('/', $mimetype);
  $classes = array($primary ? $primary : 'unknown');
  if ($secondary)
    $classes[] = $secondary;
  if (preg_match('/\.([a-z0-9]+)$/', $filename, $m))
    $classes[] = $m[1];
  return join(" ", $classes);
}
/**
 * Output HTML editor scripts
 *
 * @param string Editor mode