Changeset 1238 in subversion
- Timestamp:
- Apr 2, 2008 1:27:35 PM (5 years ago)
- Location:
- trunk/roundcubemail/program
- Files:
-
- 3 edited
-
include/rcube_imap.inc (modified) (2 diffs)
-
js/app.js (modified) (2 diffs)
-
steps/settings/manage_folders.inc (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/roundcubemail/program/include/rcube_imap.inc
r1219 r1238 1649 1649 * Subscribe to a specific mailbox(es) 1650 1650 * 1651 * @param stringMailbox name(s)1651 * @param array Mailbox name(s) 1652 1652 * @return boolean True on success 1653 1653 */ 1654 function subscribe($mbox_name) 1655 { 1656 if (is_array($mbox_name)) 1657 $a_mboxes = $mbox_name; 1658 else if (is_string($mbox_name) && strlen($mbox_name)) 1659 $a_mboxes = explode(',', $mbox_name); 1660 1654 function subscribe($a_mboxes) 1655 { 1656 if (!is_array($a_mboxes)) 1657 $a_mboxes = array($a_mboxes); 1658 1661 1659 // let this common function do the main work 1662 1660 return $this->_change_subscription($a_mboxes, 'subscribe'); … … 1667 1665 * Unsubscribe mailboxes 1668 1666 * 1669 * @param stringMailbox name(s)1667 * @param array Mailbox name(s) 1670 1668 * @return boolean True on success 1671 1669 */ 1672 function unsubscribe($mbox_name) 1673 { 1674 if (is_array($mbox_name)) 1675 $a_mboxes = $mbox_name; 1676 else if (is_string($mbox_name) && strlen($mbox_name)) 1677 $a_mboxes = (array)$mbox_name; 1670 function unsubscribe($a_mboxes) 1671 { 1672 if (!is_array($a_mboxes)) 1673 $a_mboxes = array($a_mboxes); 1678 1674 1679 1675 // let this common function do the main work -
trunk/roundcubemail/program/js/app.js
r1237 r1238 2826 2826 this.subscribe_folder = function(folder) 2827 2827 { 2828 var form; 2829 if ((form = this.gui_objects.editform) && form.elements['_unsubscribed']) 2830 this.change_subscription('_unsubscribed', '_subscribed', 'subscribe'); 2831 else if (folder) 2832 this.http_post('subscribe', '_mboxes='+urlencode(folder)); 2828 if (folder) 2829 this.http_post('subscribe', '_mbox='+urlencode(folder)); 2833 2830 }; 2834 2831 … … 2836 2833 this.unsubscribe_folder = function(folder) 2837 2834 { 2838 var form; 2839 if ((form = this.gui_objects.editform) && form.elements['_subscribed']) 2840 this.change_subscription('_subscribed', '_unsubscribed', 'unsubscribe'); 2841 else if (folder) 2842 this.http_post('unsubscribe', '_mboxes='+urlencode(folder)); 2843 }; 2844 2845 2846 this.change_subscription = function(from, to, action) 2847 { 2848 var form; 2849 if (form = this.gui_objects.editform) 2850 { 2851 var a_folders = new Array(); 2852 var list_from = form.elements[from]; 2853 2854 for (var i=0; list_from && i<list_from.options.length; i++) 2855 { 2856 if (list_from.options[i] && list_from.options[i].selected) 2857 { 2858 a_folders[a_folders.length] = list_from.options[i].value; 2859 list_from[i] = null; 2860 i--; 2861 } 2862 } 2863 2864 // yes, we have some folders selected 2865 if (a_folders.length) 2866 { 2867 var list_to = form.elements[to]; 2868 var index; 2869 2870 for (var n=0; n<a_folders.length; n++) 2871 { 2872 index = list_to.options.length; 2873 list_to[index] = new Option(a_folders[n]); 2874 } 2875 2876 this.http_post(action, '_mboxes='+urlencode(a_folders.join(','))); 2877 } 2878 } 2879 2880 }; 2835 if (folder) 2836 this.http_post('unsubscribe', '_mbox='+urlencode(folder)); 2837 }; 2838 2881 2839 2882 2840 // helper method to find a specific mailbox row ID -
trunk/roundcubemail/program/steps/settings/manage_folders.inc
r1159 r1238 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) … … 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)
Note: See TracChangeset
for help on using the changeset viewer.
