| | |
| | | function rcmail_user_prefs_form($attrib) |
| | | { |
| | | global $RCMAIL; |
| | | $config = $RCMAIL->config->all(); |
| | | |
| | | $no_override = is_array($config['dont_override']) ? array_flip($config['dont_override']) : array(); |
| | | $no_override = array_flip($RCMAIL->config->get('dont_override', array())); |
| | | $blocks = $attrib['parts'] ? preg_split('/[\s,;]+/', strip_quotes($attrib['parts'])) : array('general','mailbox','compose','mailview','folders','server'); |
| | | |
| | | // add some labels to client |
| | | $RCMAIL->output->add_label('nopagesizewarning'); |
| | |
| | | unset($attrib['form']); |
| | | |
| | | $out = $form_start; |
| | | |
| | | foreach ($blocks as $part) |
| | | $out .= rcmail_user_prefs_block($part, $no_override, $attrib); |
| | | |
| | | return $out . $form_end; |
| | | } |
| | | |
| | | function rcmail_user_prefs_block($part, $no_override, $attrib) |
| | | { |
| | | global $RCMAIL; |
| | | $config = $RCMAIL->config->all(); |
| | | |
| | | switch ($part) |
| | | { |
| | | // General UI settings |
| | | case 'general': |
| | | $table = new html_table(array('cols' => 2)); |
| | | |
| | | // show language selection |
| | |
| | | $table->add('title', html::label($field_id, Q(rcube_label('language')))); |
| | | $table->add(null, $select_lang->show($RCMAIL->user->language)); |
| | | } |
| | | |
| | | |
| | | // show page size selection |
| | | if (!isset($no_override['timezone'])) { |
| | |
| | | } |
| | | } |
| | | |
| | | $out .= html::tag('fieldset', null, html::tag('legend', null, Q(rcube_label('uisettings'))) . $table->show($attrib)); |
| | | if ($table->size()) |
| | | $out = html::tag('fieldset', null, html::tag('legend', null, Q(rcube_label('uisettings'))) . $table->show($attrib)); |
| | | break; |
| | | |
| | | |
| | | // Mailbox view (mail screen) |
| | | case 'mailbox': |
| | | $table = new html_table(array('cols' => 2)); |
| | | |
| | | if (!isset($no_override['focus_on_new_message'])) { |
| | |
| | | $table->add(null, $input_check_all->show($config['check_all_folders']?1:0)); |
| | | } |
| | | |
| | | $out .= html::tag('fieldset', null, html::tag('legend', null, Q(rcube_label('mailboxview'))) . $table->show($attrib)); |
| | | if ($table->size()) |
| | | $out = html::tag('fieldset', null, html::tag('legend', null, Q(rcube_label('mailboxview'))) . $table->show($attrib)); |
| | | break; |
| | | |
| | | |
| | | // Message viewing |
| | | case 'mailview': |
| | | $table = new html_table(array('cols' => 2)); |
| | | |
| | | // show checkbox for HTML/plaintext messages |
| | |
| | | $table->add(null, $input_inline_images->show($config['inline_images']?1:0)); |
| | | } |
| | | |
| | | $out .= html::tag('fieldset', null, html::tag('legend', null, Q(rcube_label('messagesdisplaying'))) . $table->show($attrib)); |
| | | if ($table->size()) |
| | | $out = html::tag('fieldset', null, html::tag('legend', null, Q(rcube_label('messagesdisplaying'))) . $table->show($attrib)); |
| | | break; |
| | | |
| | | |
| | | // Mail composition |
| | | case 'compose': |
| | | $table = new html_table(array('cols' => 2)); |
| | | |
| | | // Show checkbox for HTML Editor |
| | |
| | | $table->add(null, $select_param_folding->show($config['mime_param_folding'])); |
| | | } |
| | | |
| | | $out .= html::tag('fieldset', null, html::tag('legend', null, Q(rcube_label('messagescomposition'))) . $table->show($attrib)); |
| | | if ($table->size()) |
| | | $out = html::tag('fieldset', null, html::tag('legend', null, Q(rcube_label('messagescomposition'))) . $table->show($attrib)); |
| | | break; |
| | | |
| | | |
| | | // Special IMAP folders |
| | | case 'folders': |
| | | // Configure special folders |
| | | if (!isset($no_override['default_imap_folders'])) { |
| | | $RCMAIL->imap_init(true); |
| | |
| | | $table->add(null, $select->show($config['trash_mbox'], array('name' => "_trash_mbox"))); |
| | | } |
| | | |
| | | $out .= html::tag('fieldset', null, html::tag('legend', null, Q(rcube_label('specialfolders'))) . $table->show($attrib)); |
| | | $out = html::tag('fieldset', null, html::tag('legend', null, Q(rcube_label('specialfolders'))) . $table->show($attrib)); |
| | | } |
| | | break; |
| | | |
| | | |
| | | // Server settings |
| | | case 'server': |
| | | $table = new html_table(array('cols' => 2)); |
| | | |
| | | if (!isset($no_override['read_when_deleted'])) { |
| | |
| | | $table->add(null, $input_expunge->show($config['logout_expunge']?1:0)); |
| | | } |
| | | |
| | | $out .= html::tag('fieldset', null, html::tag('legend', null, Q(rcube_label('serversettings'))) . $table->show($attrib)); |
| | | if ($table->size()) |
| | | $out = html::tag('fieldset', null, html::tag('legend', null, Q(rcube_label('serversettings'))) . $table->show($attrib)); |
| | | break; |
| | | |
| | | return $out . $form_end; |
| | | |
| | | default: |
| | | $out = ''; |
| | | } |
| | | |
| | | return $out; |
| | | } |
| | | |
| | | |
| | | function rcmail_identities_list($attrib) |