Ticket #1484681: #1484681.200711301604.patch
| File #1484681.200711301604.patch, 4.1 kB (added by robin, 12 months ago) |
|---|
-
program/include/rcube_imap.inc
1622 1622 * @param string Mailbox name(s) 1623 1623 * @return boolean True on success 1624 1624 */ 1625 function subscribe($ mbox_name)1625 function subscribe($a_mboxes) 1626 1626 { 1627 if (is_array($mbox_name))1628 $a_mboxes = $mbox_name;1629 else if (is_string($mbox_name) && strlen($mbox_name))1630 $a_mboxes = explode(',', $mbox_name);1631 1632 1627 // let this common function do the main work 1633 1628 return $this->_change_subscription($a_mboxes, 'subscribe'); 1634 1629 } … … 1640 1635 * @param string Mailbox name(s) 1641 1636 * @return boolean True on success 1642 1637 */ 1643 function unsubscribe($ mbox_name)1638 function unsubscribe($a_mboxes) 1644 1639 { 1645 if (is_array($mbox_name))1646 $a_mboxes = $mbox_name;1647 else if (is_string($mbox_name) && strlen($mbox_name))1648 $a_mboxes = explode(',', $mbox_name);1649 1650 1640 // let this common function do the main work 1651 1641 return $this->_change_subscription($a_mboxes, 'unsubscribe'); 1652 1642 } -
program/js/app.js
2766 2766 2767 2767 this.subscribe_folder = function(folder) 2768 2768 { 2769 var form; 2770 if ((form = this.gui_objects.editform) && form.elements['_unsubscribed']) 2771 this.change_subscription('_unsubscribed', '_subscribed', 'subscribe'); 2772 else if (folder) 2773 this.http_post('subscribe', '_mboxes='+urlencode(folder)); 2769 if (folder) 2770 this.http_post('subscribe', '_mbox='+urlencode(folder)); 2774 2771 }; 2775 2772 2776 2773 2777 2774 this.unsubscribe_folder = function(folder) 2778 2775 { 2779 var form; 2780 if ((form = this.gui_objects.editform) && form.elements['_subscribed']) 2781 this.change_subscription('_subscribed', '_unsubscribed', 'unsubscribe'); 2782 else if (folder) 2783 this.http_post('unsubscribe', '_mboxes='+urlencode(folder)); 2776 if (folder) 2777 this.http_post('unsubscribe', '_mbox='+urlencode(folder)); 2784 2778 }; 2785 2779 2786 2780 2787 this.change_subscription = function(from, to, action)2788 {2789 var form;2790 if (form = this.gui_objects.editform)2791 {2792 var a_folders = new Array();2793 var list_from = form.elements[from];2794 2795 for (var i=0; list_from && i<list_from.options.length; i++)2796 {2797 if (list_from.options[i] && list_from.options[i].selected)2798 {2799 a_folders[a_folders.length] = list_from.options[i].value;2800 list_from[i] = null;2801 i--;2802 }2803 }2804 2805 // yes, we have some folders selected2806 if (a_folders.length)2807 {2808 var list_to = form.elements[to];2809 var index;2810 2811 for (var n=0; n<a_folders.length; n++)2812 {2813 index = list_to.options.length;2814 list_to[index] = new Option(a_folders[n]);2815 }2816 2817 this.http_post(action, '_mboxes='+urlencode(a_folders.join(',')));2818 }2819 }2820 2821 };2822 2823 2781 // helper method to find a specific mailbox row ID 2824 2782 this.get_folder_row_id = function(folder) 2825 2783 { -
program/steps/settings/manage_folders.inc
28 28 // subscribe to one or more mailboxes 29 29 if ($_action=='subscribe') 30 30 { 31 if ($mbox es = get_input_value('_mboxes', RCUBE_INPUT_POST))32 $IMAP->subscribe( $mboxes);31 if ($mbox = get_input_value('_mbox', RCUBE_INPUT_POST)) 32 $IMAP->subscribe(array($mbox)); 33 33 34 34 if ($OUTPUT->ajax_call) 35 35 $OUTPUT->remote_response('// subscribed'); … … 38 38 // unsubscribe one or more mailboxes 39 39 else if ($_action=='unsubscribe') 40 40 { 41 if ($mbox es = get_input_value('_mboxes', RCUBE_INPUT_POST))42 $IMAP->unsubscribe( $mboxes);41 if ($mbox = get_input_value('_mbox', RCUBE_INPUT_POST)) 42 $IMAP->unsubscribe(array($mbox)); 43 43 44 44 if ($OUTPUT->ajax_call) 45 45 $OUTPUT->remote_response('// unsubscribed');
