alecpl
2010-11-12 44840971e8e405cc41f923eaff0a32d7accb496c
program/steps/settings/manage_folders.inc
@@ -27,35 +27,39 @@
// subscribe to one or more mailboxes
if ($RCMAIL->action=='subscribe')
  {
  if ($mbox = get_input_value('_mbox', RCUBE_INPUT_POST, false, 'UTF7-IMAP'))
  $mbox = get_input_value('_mbox', RCUBE_INPUT_POST, false, 'UTF7-IMAP');
  if (strlen($mbox))
    $IMAP->subscribe(array($mbox));
  }
// unsubscribe one or more mailboxes
else if ($RCMAIL->action=='unsubscribe')
  {
  if ($mbox = get_input_value('_mbox', RCUBE_INPUT_POST, false, 'UTF7-IMAP'))
  $mbox = get_input_value('_mbox', RCUBE_INPUT_POST, false, 'UTF7-IMAP');
  if (strlen($mbox))
    $IMAP->unsubscribe(array($mbox));
  }
// enable threading for one or more mailboxes
else if ($RCMAIL->action=='enable-threading')
  {
  if ($mbox = get_input_value('_mbox', RCUBE_INPUT_POST, false, 'UTF7-IMAP'))
  $mbox = get_input_value('_mbox', RCUBE_INPUT_POST, false, 'UTF7-IMAP');
  if (strlen($mbox))
    rcube_set_threading($mbox, true);
  }
// enable threading for one or more mailboxes
else if ($RCMAIL->action=='disable-threading')
  {
  if ($mbox = get_input_value('_mbox', RCUBE_INPUT_POST, false, 'UTF7-IMAP'))
  $mbox = get_input_value('_mbox', RCUBE_INPUT_POST, false, 'UTF7-IMAP');
  if (strlen($mbox))
    rcube_set_threading($mbox, false);
  }
// create a new mailbox
else if ($RCMAIL->action=='create-folder')
  {
  if (!empty($_POST['_name']))
  if (strlen(trim($_POST['_name'])))
    {
    $name = trim(get_input_value('_name', RCUBE_INPUT_POST, FALSE, 'UTF7-IMAP'));
    $create = $IMAP->create_mailbox($name, TRUE);
@@ -83,7 +87,7 @@
// rename a mailbox
else if ($RCMAIL->action=='rename-folder')
  {
  if (!empty($_POST['_folder_oldname']) && !empty($_POST['_folder_newname']))
  if (strlen(trim($_POST['_folder_oldname'])) && strlen(trim($_POST['_folder_newname'])))
    {
    $name_utf8 = trim(get_input_value('_folder_newname', RCUBE_INPUT_POST));
    $oldname_utf8 = get_input_value('_folder_oldname', RCUBE_INPUT_POST);
@@ -163,7 +167,7 @@
  $mboxes_utf8 = get_input_value('_mboxes', RCUBE_INPUT_POST);
  $mboxes = rcube_charset_convert($mboxes_utf8, RCMAIL_CHARSET, 'UTF7-IMAP');
  if ($mboxes)
  if (strlen($mboxes))
    $deleted = $IMAP->delete_mailbox(array($mboxes));
  if ($OUTPUT->ajax_call && $deleted)
@@ -284,7 +288,7 @@
    $protected = ($CONFIG['protect_default_folders'] == true && in_array($folder['id'], $CONFIG['default_imap_folders']));
    $classes = array($i%2 ? 'even' : 'odd');
    $folder_js = JQ($folder['id']);
    $display_folder = str_repeat('    ', $folder['level']) . ($protected ? rcmail_localize_foldername($folder['id']) : $folder['name']);
    $display_folder = str_repeat('    ', $folder['level']) . Q($protected ? rcmail_localize_foldername($folder['id']) : $folder['name']);
    $folder_utf8 = rcube_charset_convert($folder['id'], 'UTF7-IMAP');
    
    if ($folder['virtual']) {
@@ -298,7 +302,7 @@
    $table->add_row(array('id' => 'rcmrow'.$idx, 'class' => join(' ', $classes)));
    
    $table->add('name', Q($display_folder));
    $table->add('name', $display_folder);
    $table->add('msgcount', (($folder['virtual'] || $noselect) ? '' : $IMAP->messagecount($folder['id'], 'ALL', false, false)));
    $table->add('subscribed', $checkbox_subscribe->show(($subscribed ? $folder_utf8 : ''),
      array('value' => $folder_utf8, 'disabled' => ($protected || $noselect) ? 'disabled' : '')));