| | |
| | | // subscribe to one or more mailboxes |
| | | if ($RCMAIL->action=='subscribe') |
| | | { |
| | | $mbox = get_input_value('_mbox', RCUBE_INPUT_POST, false, 'UTF7-IMAP'); |
| | | $mbox = get_input_value('_mbox', RCUBE_INPUT_POST, true, 'UTF7-IMAP'); |
| | | if (strlen($mbox)) |
| | | $IMAP->subscribe(array($mbox)); |
| | | } |
| | |
| | | // unsubscribe one or more mailboxes |
| | | else if ($RCMAIL->action=='unsubscribe') |
| | | { |
| | | $mbox = get_input_value('_mbox', RCUBE_INPUT_POST, false, 'UTF7-IMAP'); |
| | | $mbox = get_input_value('_mbox', RCUBE_INPUT_POST, true, 'UTF7-IMAP'); |
| | | if (strlen($mbox)) |
| | | $IMAP->unsubscribe(array($mbox)); |
| | | } |
| | |
| | | // enable threading for one or more mailboxes |
| | | else if ($RCMAIL->action=='enable-threading') |
| | | { |
| | | $mbox = get_input_value('_mbox', RCUBE_INPUT_POST, false, 'UTF7-IMAP'); |
| | | $mbox = get_input_value('_mbox', RCUBE_INPUT_POST, true, 'UTF7-IMAP'); |
| | | if (strlen($mbox)) |
| | | rcube_set_threading($mbox, true); |
| | | } |
| | |
| | | // enable threading for one or more mailboxes |
| | | else if ($RCMAIL->action=='disable-threading') |
| | | { |
| | | $mbox = get_input_value('_mbox', RCUBE_INPUT_POST, false, 'UTF7-IMAP'); |
| | | $mbox = get_input_value('_mbox', RCUBE_INPUT_POST, true, 'UTF7-IMAP'); |
| | | if (strlen($mbox)) |
| | | rcube_set_threading($mbox, false); |
| | | } |
| | |
| | | { |
| | | if (strlen(trim($_POST['_name']))) |
| | | { |
| | | $name = trim(get_input_value('_name', RCUBE_INPUT_POST, FALSE, 'UTF7-IMAP')); |
| | | $name = trim(get_input_value('_name', RCUBE_INPUT_POST, true, 'UTF7-IMAP')); |
| | | $create = $IMAP->create_mailbox($name, TRUE); |
| | | } |
| | | |
| | |
| | | $folderlist = $IMAP->list_unsubscribed(); |
| | | $index = array_search($create, $folderlist); |
| | | $before = $index !== false && isset($folderlist[$index+1]) ? rcube_charset_convert($folderlist[$index+1], 'UTF7-IMAP') : false; |
| | | |
| | | |
| | | $create = rcube_charset_convert($create, 'UTF7-IMAP'); |
| | | $foldersplit = explode($delimiter, $create); |
| | | $display_create = str_repeat(' ', substr_count($create, $delimiter)) . $foldersplit[count($foldersplit)-1]; |
| | | $display_create = str_repeat(' ', substr_count($create, $delimiter)) |
| | | . Q($foldersplit[count($foldersplit)-1]); |
| | | |
| | | $OUTPUT->command('add_folder_row', $create, $display_create, false, $before); |
| | | } |
| | |
| | | { |
| | | 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); |
| | | $name_utf8 = trim(get_input_value('_folder_newname', RCUBE_INPUT_POST, true)); |
| | | $oldname_utf8 = get_input_value('_folder_oldname', RCUBE_INPUT_POST, true); |
| | | $name = rcube_charset_convert($name_utf8, RCMAIL_CHARSET, 'UTF7-IMAP'); |
| | | $oldname = rcube_charset_convert($oldname_utf8, RCMAIL_CHARSET, 'UTF7-IMAP'); |
| | | |
| | |
| | | $oldfolder = $oldname . $delimiter . preg_replace($regexp, '', $folderlist[$x]); |
| | | $foldersplit = explode($delimiter, $folderlist[$x]); |
| | | $level = count($foldersplit) - 1; |
| | | $display_rename = str_repeat(' ', $level) |
| | | . rcube_charset_convert($foldersplit[$level], 'UTF7-IMAP'); |
| | | $display_rename = str_repeat(' ', $level) |
| | | . Q(rcube_charset_convert($foldersplit[$level], 'UTF7-IMAP')); |
| | | |
| | | $before = isset($folderlist[$x+1]) ? rcube_charset_convert($folderlist[$x+1], 'UTF7-IMAP') : false; |
| | | |
| | |
| | | |
| | | $foldersplit = explode($delimiter, $rename); |
| | | $level = count($foldersplit) - 1; |
| | | $display_rename = str_repeat(' ', $level) . rcube_charset_convert($foldersplit[$level], 'UTF7-IMAP'); |
| | | $display_rename = str_repeat(' ', $level) . Q(rcube_charset_convert($foldersplit[$level], 'UTF7-IMAP')); |
| | | $index = array_search($rename, $folderlist); |
| | | $before = $index !== false && isset($folderlist[$index+1]) ? rcube_charset_convert($folderlist[$index+1], 'UTF7-IMAP') : false; |
| | | |
| | |
| | | $a_mboxes = $IMAP->list_unsubscribed(); |
| | | $delimiter = $IMAP->get_hierarchy_delimiter(); |
| | | |
| | | $mboxes_utf8 = get_input_value('_mboxes', RCUBE_INPUT_POST); |
| | | $mboxes_utf8 = get_input_value('_mboxes', RCUBE_INPUT_POST, true); |
| | | $mboxes = rcube_charset_convert($mboxes_utf8, RCMAIL_CHARSET, 'UTF7-IMAP'); |
| | | |
| | | if (strlen($mboxes)) |
| | |
| | | $threaded = $a_threaded[$folder['id']]; |
| | | $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']); |
| | | $folder_js = Q($folder['id']); |
| | | $display_folder = str_repeat(' ', $folder['level']) . Q($protected ? rcmail_localize_foldername($folder['id']) : $folder['name']); |
| | | $folder_utf8 = rcube_charset_convert($folder['id'], 'UTF7-IMAP'); |
| | | |
| | |
| | | $table->add('delete', ' '); |
| | | } |
| | | |
| | | $a_js_folders['rcmrow'.$idx] = array($folder_utf8, $display_folder, $protected || $folder['virtual']); |
| | | $a_js_folders['rcmrow'.$idx] = array($folder_utf8, Q($display_folder), $protected || $folder['virtual']); |
| | | } |
| | | |
| | | rcmail::get_instance()->plugins->exec_hook('folders_list', array('table' => $table)); |