| | |
| | | { |
| | | global $DB, $CONFIG, $sess_user_lang; |
| | | |
| | | $no_override = is_array($CONFIG['dont_override']) ? array_flip($CONFIG['dont_override']) : array(); |
| | | |
| | | // add some labels to client |
| | | rcube_add_label('nopagesizewarning'); |
| | | |
| | |
| | | // return the complete edit form as table |
| | | $out = "$form_start<table" . $attrib_str . ">\n\n"; |
| | | |
| | | $a_show_cols = array( |
| | | 'language' => array('type' => 'text'), |
| | | 'pagesize' => array('type' => 'text'), |
| | | 'timezone' => array('type' => 'text'), |
| | | 'prettydate' => array('type' => 'text'), |
| | | 'draft_autosave' => array('type' => 'text') |
| | | ); |
| | | |
| | | // show language selection |
| | | if (!isset($no_override['language'])) |
| | | { |
| | | $a_lang = rcube_list_languages(); |
| | | asort($a_lang); |
| | | |
| | |
| | | $select_lang = new select(array('name' => '_language', 'id' => $field_id)); |
| | | $select_lang->add(array_values($a_lang), array_keys($a_lang)); |
| | | |
| | | |
| | | $out .= sprintf("<tr><td class=\"title\"><label for=\"%s\">%s</label></td><td>%s</td></tr>\n", |
| | | $field_id, |
| | | rep_specialchars_output(rcube_label('language')), |
| | | $select_lang->show($sess_user_lang)); |
| | | } |
| | | |
| | | |
| | | // show page size selection |
| | | if (!isset($no_override['timezone'])) |
| | | { |
| | | $field_id = 'rcmfd_timezone'; |
| | | $select_timezone = new select(array('name' => '_timezone', 'id' => $field_id)); |
| | | $select_timezone->add('(GMT -11:00) Midway Island, Samoa', '-11'); |
| | |
| | | $field_id, |
| | | rep_specialchars_output(rcube_label('timezone')), |
| | | $select_timezone->show($CONFIG['timezone'])); |
| | | } |
| | | |
| | | |
| | | // daylight savings |
| | | if (!isset($no_override['dst_active'])) |
| | | { |
| | | $field_id = 'rcmfd_dst'; |
| | | $input_dst = new checkbox(array('name' => '_dst_active', 'id' => $field_id, 'value' => 1)); |
| | | $out .= sprintf("<tr><td class=\"title\"><label for=\"%s\">%s</label></td><td>%s</td></tr>\n", |
| | | $field_id, |
| | | rep_specialchars_output(rcube_label('dstactive')), |
| | | $input_dst->show($CONFIG['dst_active'])); |
| | | |
| | | } |
| | | |
| | | // show page size selection |
| | | if (!isset($no_override['pagesize'])) |
| | | { |
| | | $field_id = 'rcmfd_pgsize'; |
| | | $input_pagesize = new textfield(array('name' => '_pagesize', 'id' => $field_id, 'size' => 5)); |
| | | |
| | |
| | | $field_id, |
| | | rep_specialchars_output(rcube_label('pagesize')), |
| | | $input_pagesize->show($CONFIG['pagesize'])); |
| | | |
| | | // show checkbox for HTML/plaintext messages |
| | | $field_id = 'rcmfd_htmlmsg'; |
| | | $input_pagesize = new checkbox(array('name' => '_prefer_html', 'id' => $field_id, 'value' => 1)); |
| | | |
| | | $out .= sprintf("<tr><td class=\"title\"><label for=\"%s\">%s</label></td><td>%s</td></tr>\n", |
| | | $field_id, |
| | | rep_specialchars_output(rcube_label('preferhtml')), |
| | | $input_pagesize->show($CONFIG['prefer_html']?1:0)); |
| | | } |
| | | |
| | | // MM: Show checkbox for toggling 'pretty dates' |
| | | if (!isset($no_override['prettydate'])) |
| | | { |
| | | $field_id = 'rcmfd_prettydate'; |
| | | $input_prettydate = new checkbox(array('name' => '_pretty_date', 'id' => $field_id, 'value' => 1)); |
| | | |
| | |
| | | $field_id, |
| | | rep_specialchars_output(rcube_label('prettydate')), |
| | | $input_prettydate->show($CONFIG['prettydate']?1:0)); |
| | | } |
| | | |
| | | // show checkbox for HTML/plaintext messages |
| | | if (!isset($no_override['prefer_html'])) |
| | | { |
| | | $field_id = 'rcmfd_htmlmsg'; |
| | | $input_pagesize = new checkbox(array('name' => '_prefer_html', 'id' => $field_id, 'value' => 1)); |
| | | |
| | | $out .= sprintf("<tr><td class=\"title\"><label for=\"%s\">%s</label></td><td>%s</td></tr>\n", |
| | | $field_id, |
| | | rep_specialchars_output(rcube_label('preferhtml')), |
| | | $input_pagesize->show($CONFIG['prefer_html']?1:0)); |
| | | } |
| | | |
| | | // Show checkbox for HTML Editor |
| | | if (!isset($no_override['htmleditor'])) |
| | | { |
| | | $field_id = 'rcmfd_htmleditor'; |
| | | $input_htmleditor = new checkbox(array('name' => '_htmleditor', 'id' => $field_id, 'value' => 1)); |
| | | $out .= sprintf("<tr><td class=\"title\"><label for=\"%s\">%s</label></td><td>%s</td></tr>\n", |
| | | $field_id, |
| | | rep_specialchars_output(rcube_label('htmleditor')), |
| | | $input_htmleditor->show($CONFIG['htmleditor']?1:0)); |
| | | } |
| | | |
| | | if (!empty($CONFIG['drafts_mbox'])) |
| | | // show config parameter for preview pane |
| | | if (!isset($no_override['preview_pane'])) |
| | | { |
| | | $field_id = 'rcmfd_preview'; |
| | | $input_preview = new checkbox(array('name' => '_preview_pane', 'id' => $field_id, 'value' => 1)); |
| | | $out .= sprintf("<tr><td class=\"title\"><label for=\"%s\">%s</label></td><td>%s</td></tr>\n", |
| | | $field_id, |
| | | rep_specialchars_output(rcube_label('previewpane')), |
| | | $input_preview->show($CONFIG['preview_pane']?1:0)); |
| | | } |
| | | |
| | | if (!empty($CONFIG['drafts_mbox']) && !isset($no_override['preview_pane'])) |
| | | { |
| | | $field_id = 'rcmfd_autosave'; |
| | | $select_autosave = new select(array('name' => '_draft_autosave', 'id' => $field_id)); |