| | |
| | | case 'compose': |
| | | |
| | | $blocks = array( |
| | | 'main' => array('name' => Q(rcube_label('mainoptions'))), |
| | | 'sig' => array('name' => Q(rcube_label('signatureoptions'))), |
| | | 'main' => array('name' => Q(rcube_label('mainoptions'))), |
| | | 'spellcheck' => array('name' => Q(rcube_label('spellcheckoptions'))), |
| | | 'sig' => array('name' => Q(rcube_label('signatureoptions'))), |
| | | ); |
| | | |
| | | // Show checkbox for HTML Editor |
| | |
| | | $field_id = 'rcmfd_spellcheck_before_send'; |
| | | $input_spellcheck = new html_checkbox(array('name' => '_spellcheck_before_send', 'id' => $field_id, 'value' => 1)); |
| | | |
| | | $blocks['main']['options']['spellcheck_before_send'] = array( |
| | | $blocks['spellcheck']['options']['spellcheck_before_send'] = array( |
| | | 'title' => html::label($field_id, Q(rcube_label('spellcheckbeforesend'))), |
| | | 'content' => $input_spellcheck->show($config['spellcheck_before_send']?1:0), |
| | | ); |
| | | } |
| | | |
| | | if ($config['enable_spellcheck']) { |
| | | foreach (array('syms', 'nums', 'caps') as $key) { |
| | | $key = 'spellcheck_ignore_'.$key; |
| | | if (!isset($no_override[$key])) { |
| | | $input_spellcheck = new html_checkbox(array('name' => '_'.$key, 'id' => 'rcmfd_'.$key, 'value' => 1)); |
| | | |
| | | $blocks['spellcheck']['options'][$key] = array( |
| | | 'title' => html::label($field_id, Q(rcube_label(str_replace('_', '', $key)))), |
| | | 'content' => $input_spellcheck->show($config[$key]?1:0), |
| | | ); |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (!isset($no_override['show_sig'])) { |
| | |
| | | { |
| | | global $RCMAIL; |
| | | |
| | | $acl = $RCMAIL->imap->get_capability('ACL'); |
| | | $default_folders = (array) $RCMAIL->config->get('default_imap_folders'); |
| | | $delimiter = $RCMAIL->imap->get_hierarchy_delimiter(); |
| | | $namespace = $RCMAIL->imap->get_namespace(); |
| | | $options = array(); |
| | | |
| | | // check if the folder is a namespace prefix |
| | | if (!empty($namespace)) { |
| | | $mbox = $mailbox . $delimiter; |
| | | foreach ($namespace as $ns) { |
| | | foreach ($ns as $item) { |
| | | if ($item[0] === $mbox) { |
| | | $options['is_root'] = true; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | $options['name'] = $mailbox; |
| | | $options['options'] = $RCMAIL->imap->mailbox_options($mailbox, true); |
| | | $options['namespace'] = $RCMAIL->imap->mailbox_namespace($mailbox); |
| | | $options['rights'] = $acl && !$options['is_root'] ? (array)$RCMAIL->imap->my_rights($mailbox) : array(); |
| | | $options['special'] = in_array($mailbox, $default_folders); |
| | | $options = $RCMAIL->imap->mailbox_info($mailbox); |
| | | $options['protected'] = $options['is_root'] || ($options['special'] && $RCMAIL->config->get('protect_default_folders')); |
| | | |
| | | if (is_array($options['options'])) { |
| | | foreach ($options['options'] as $opt) { |
| | | $opt = strtolower($opt); |
| | | if ($opt == '\noselect' || $opt == '\nonexistent') { |
| | | $options['noselect'] = true; |
| | | } |
| | | } |
| | | } |
| | | else { |
| | | $options['noselect'] = true; |
| | | } |
| | | |
| | | if (!empty($options['rights'])) { |
| | | $options['norename'] = !in_array('x', $options['rights']) && |
| | | (!in_array('c', $options['rights']) || !in_array('d', $options['rights'])); |
| | | if (!$options['noselect']) { |
| | | $options['noselect'] = !in_array('r', $options['rights']); |
| | | } |
| | | } |
| | | |
| | | return $options; |
| | | } |