| | |
| | | // init IMAP connection |
| | | $RCMAIL->imap_connect(); |
| | | |
| | | function rcube_folder_form($attrib) |
| | | function rcmail_folder_form($attrib) |
| | | { |
| | | global $RCMAIL; |
| | | |
| | |
| | | |
| | | // Get mailbox parameters |
| | | if (strlen($mbox)) { |
| | | $options = rcube_folder_options($mbox_imap); |
| | | $options = rcmail_folder_options($mbox_imap); |
| | | $namespace = $RCMAIL->imap->get_namespace(); |
| | | |
| | | $path = explode($delimiter, $mbox_imap); |
| | |
| | | else { |
| | | $options = array(); |
| | | $path = $parent_imap; |
| | | |
| | | // allow creating subfolders of INBOX folder |
| | | if ($path == 'INBOX') { |
| | | $path = $RCMAIL->imap->mod_mailbox($path, 'in'); |
| | | } |
| | | } |
| | | |
| | | // remove personal namespace prefix |
| | | if (strlen($path)) { |
| | | $path_id = $path; |
| | | $path = $RCMAIL->imap->mod_mailbox($path.$delimiter); |
| | | if ($path[strlen($path)-1] == $delimiter) { |
| | | $path = substr($path, 0, -1); |
| | | } |
| | | } |
| | | |
| | | $form = array(); |
| | |
| | | ); |
| | | |
| | | if (strlen($path)) { |
| | | if ($options['norename'] || $options['namespace'] != 'personal') { |
| | | if (!empty($options) && ($options['norename'] || $options['namespace'] != 'personal')) { |
| | | // prevent user from moving folder |
| | | $hidden_path = new html_hiddenfield(array('name' => '_parent', 'value' => $path)); |
| | | $form['props']['fieldsets']['location']['content']['name']['value'] .= $hidden_path->show(); |
| | | } |
| | | else { |
| | | $radio1 = new html_radiobutton(array('name' => '_parent', 'value' => '')); |
| | | $radio2 = new html_radiobutton(array('name' => '_parent', 'value' => $path)); |
| | | $selected = isset($_POST['_parent']) ? $_POST['_parent'] : $path; |
| | | $radio2 = new html_radiobutton(array('name' => '_parent', 'value' => $path_id)); |
| | | $selected = isset($_POST['_parent']) ? $_POST['_parent'] : $path_id; |
| | | |
| | | $html_path = str_replace($delimiter, ' » ', rcmail_localize_folderpath($path)); |
| | | |
| | |
| | | |
| | | // Allow plugins to modify folder form content |
| | | $plugin = $RCMAIL->plugins->exec_hook('folder_form', |
| | | array('form' => $form, 'options' => $options)); |
| | | array('form' => $form, 'options' => $options, |
| | | 'name' => $mbox_imap, 'parent_name' => $parent_imap)); |
| | | |
| | | $form = $plugin['form']; |
| | | |
| | |
| | | |
| | | // register UI objects |
| | | $OUTPUT->add_handlers(array( |
| | | 'folderdetails' => 'rcube_folder_form', |
| | | 'folderdetails' => 'rcmail_folder_form', |
| | | )); |
| | | |
| | | $OUTPUT->add_label('nonamewarning'); |