Code cleanup with new html classes

release-0.6
thomascube 17 years ago
parent d224551cfb
commit 6d6e066f23

@ -145,7 +145,7 @@ class html
if (is_string($attr)) { if (is_string($attr)) {
$attr = array('href' => $attr); $attr = array('href' => $attr);
} }
return self::tag('a', $attr, $cont, array_merge(self::$common_attrib, array('href','target','name','onclick','onmouseover','onmouseout'))); return self::tag('a', $attr, $cont, array_merge(self::$common_attrib, array('href','target','name','onclick','onmouseover','onmouseout','onmousedown','onmouseup')));
} }
/** /**

@ -463,9 +463,10 @@ function get_input_value($fname, $source, $allow_html=FALSE, $charset=NULL)
* Remove all non-ascii and non-word chars * Remove all non-ascii and non-word chars
* except . and - * except . and -
*/ */
function asciiwords($str) function asciiwords($str, $css_id = false)
{ {
return preg_replace('/[^a-z0-9._-]/i', '', $str); $allowed = 'a-z0-9\_\-' . (!$css_id ? '\.' : '');
return preg_replace("/[^$allowed]/i", '', $str);
} }
/** /**
@ -887,22 +888,11 @@ function rcmail_mailbox_list($attrib)
// $mboxlist_start = rcube_timer(); // $mboxlist_start = rcube_timer();
$type = $attrib['type'] ? $attrib['type'] : 'ul'; $type = $attrib['type'] ? $attrib['type'] : 'ul';
$add_attrib = $type=='select' ? array('style', 'class', 'id', 'name', 'onchange') : unset($attrib['type']);
array('style', 'class', 'id');
if ($type=='ul' && !$attrib['id']) if ($type=='ul' && !$attrib['id'])
$attrib['id'] = 'rcmboxlist'; $attrib['id'] = 'rcmboxlist';
// allow the following attributes to be added to the <ul> tag
$attrib_str = create_attrib_string($attrib, $add_attrib);
$out = '<' . $type . $attrib_str . ">\n";
// add no-selection option
if ($type=='select' && $attrib['noselection'])
$out .= sprintf('<option value="0">%s</option>'."\n",
rcube_label($attrib['noselection']));
// get mailbox list // get mailbox list
$mbox_name = $IMAP->get_mailbox_name(); $mbox_name = $IMAP->get_mailbox_name();
@ -922,18 +912,25 @@ function rcmail_mailbox_list($attrib)
// var_dump($a_mailboxes); // var_dump($a_mailboxes);
if ($type=='select') if ($type=='select') {
$out .= rcmail_render_folder_tree_select($a_mailboxes, $mbox_name, $attrib['maxlength']); $select = new html_select($attrib);
else
$out .= rcmail_render_folder_tree_html($a_mailboxes, $mbox_name, $attrib['maxlength']);
// rcube_print_time($mboxlist_start, 'render_folder_tree()'); // add no-selection option
if ($attrib['noselection'])
$select->add(rcube_label($attrib['noselection']), '0');
rcmail_render_folder_tree_select($a_mailboxes, $mbox_name, $attrib['maxlength'], $select);
$out = $select->show($mbox_name);
}
else {
$out = html::tag('ul', $attrib, rcmail_render_folder_tree_html($a_mailboxes, $mbox_name, $attrib['maxlength']), html::$common_attrib);
}
if ($type=='ul') if ($type=='ul')
$OUTPUT->add_gui_object('mailboxlist', $attrib['id']); $OUTPUT->add_gui_object('mailboxlist', $attrib['id']);
return $out . "</$type>"; return $out;
} }
@ -961,7 +958,8 @@ function rcmail_build_folder_tree(&$arrFolders, $folder, $delm='/', $path='')
if (!isset($arrFolders[$currentFolder])) if (!isset($arrFolders[$currentFolder]))
{ {
$arrFolders[$currentFolder] = array('id' => $path, $arrFolders[$currentFolder] = array(
'id' => $path,
'name' => rcube_charset_convert($currentFolder, 'UTF-7'), 'name' => rcube_charset_convert($currentFolder, 'UTF-7'),
'folders' => array()); 'folders' => array());
} }
@ -984,7 +982,7 @@ function rcmail_render_folder_tree_html(&$arrFolders, &$mbox_name, $maxlength, $
foreach ($arrFolders as $key => $folder) foreach ($arrFolders as $key => $folder)
{ {
$zebra_class = ($nestLevel*$idx)%2 ? 'even' : 'odd'; $zebra_class = ($nestLevel*$idx)%2 ? 'even' : 'odd';
$title = ''; $title = null;
if ($folder_class = rcmail_folder_classname($folder['id'])) if ($folder_class = rcmail_folder_classname($folder['id']))
$foldername = rcube_label($folder_class); $foldername = rcube_label($folder_class);
@ -997,46 +995,45 @@ function rcmail_render_folder_tree_html(&$arrFolders, &$mbox_name, $maxlength, $
{ {
$fname = abbreviate_string($foldername, $maxlength); $fname = abbreviate_string($foldername, $maxlength);
if ($fname != $foldername) if ($fname != $foldername)
$title = ' title="'.Q($foldername).'"'; $title = $foldername;
$foldername = $fname; $foldername = $fname;
} }
} }
// make folder name safe for ids and class names // make folder name safe for ids and class names
$folder_id = preg_replace('/[^A-Za-z0-9\-_]/', '', $folder['id']); $folder_id = asciiwords($folder['id'], true);
$class_name = preg_replace('/[^a-z0-9\-_]/', '', $folder_class ? $folder_class : strtolower($folder['id'])); $classes = array('mailbox');
// set special class for Sent, Drafts, Trash and Junk // set special class for Sent, Drafts, Trash and Junk
if ($folder['id']==$CONFIG['sent_mbox']) if ($folder['id']==$CONFIG['sent_mbox'])
$class_name = 'sent'; $classes[] = 'sent';
else if ($folder['id']==$CONFIG['drafts_mbox']) else if ($folder['id']==$CONFIG['drafts_mbox'])
$class_name = 'drafts'; $classes[] = 'drafts';
else if ($folder['id']==$CONFIG['trash_mbox']) else if ($folder['id']==$CONFIG['trash_mbox'])
$class_name = 'trash'; $classes[] = 'trash';
else if ($folder['id']==$CONFIG['junk_mbox']) else if ($folder['id']==$CONFIG['junk_mbox'])
$class_name = 'junk'; $classes[] = 'junk';
else
$js_name = htmlspecialchars(JQ($folder['id'])); $classes[] = asciiwords($folder_class ? $folder_class : strtolower($folder['id']), true);
$out .= sprintf('<li id="rcmli%s" class="mailbox %s %s%s"><a href="%s"'.
' onclick="return %s.command(\'list\',\'%s\',this)"'. $classes[] = $zebra_class;
' onmouseover="return %s.focus_folder(\'%s\')"' .
' onmouseout="return %s.unfocus_folder(\'%s\')"' . if ($folder['id'] == $mbox_name)
' onmouseup="return %s.folder_mouse_up(\'%s\')"%s>%s</a>', $classes[] = 'selected';
$folder_id,
$class_name, $js_name = JQ($folder['id']);
$zebra_class, $out .= html::tag('li', array(
$folder['id']==$mbox_name ? ' selected' : '', 'id' => "rcmli".$folder_id,
Q(rcmail_url('', array('_mbox' => $folder['id']))), 'class' => join(' ', $classes),
JS_OBJECT_NAME, 'noclose' => true),
$js_name, html::a(array(
JS_OBJECT_NAME, 'href' => rcmail_url('', array('_mbox' => $folder['id'])),
$js_name, 'onclick' => sprintf("return %s.command('list','%s',this)", JS_OBJECT_NAME, $js_name),
JS_OBJECT_NAME, 'onmouseover' => sprintf("return %s.focus_folder('%s')", JS_OBJECT_NAME, $js_name),
$js_name, 'onmouseout' => sprintf("return %s.unfocus_folder('%s')", JS_OBJECT_NAME, $js_name),
JS_OBJECT_NAME, 'onmouseup' => sprintf("return %s.folder_mouse_up('%s')", JS_OBJECT_NAME, $js_name),
$js_name, 'title' => $title,
$title, ), Q($foldername)));
Q($foldername));
if (!empty($folder['folders'])) if (!empty($folder['folders']))
$out .= "\n<ul>\n" . rcmail_render_folder_tree_html($folder['folders'], $mbox_name, $maxlength, $nestLevel+1) . "</ul>\n"; $out .= "\n<ul>\n" . rcmail_render_folder_tree_html($folder['folders'], $mbox_name, $maxlength, $nestLevel+1) . "</ul>\n";
@ -1053,7 +1050,7 @@ function rcmail_render_folder_tree_html(&$arrFolders, &$mbox_name, $maxlength, $
* Return html for a flat list <select> for the mailbox tree * Return html for a flat list <select> for the mailbox tree
* @access private * @access private
*/ */
function rcmail_render_folder_tree_select(&$arrFolders, &$mbox_name, $maxlength, $nestLevel=0, $selected='') function rcmail_render_folder_tree_select(&$arrFolders, &$mbox_name, $maxlength, &$select, $nestLevel=0)
{ {
global $IMAP, $OUTPUT; global $IMAP, $OUTPUT;
@ -1072,14 +1069,10 @@ function rcmail_render_folder_tree_select(&$arrFolders, &$mbox_name, $maxlength,
$foldername = abbreviate_string($foldername, $maxlength); $foldername = abbreviate_string($foldername, $maxlength);
} }
$out .= sprintf('<option value="%s"%s>%s%s</option>'."\n", $select->add(str_repeat('&nbsp;', $nestLevel*4) . $foldername, $folder['id']);
htmlspecialchars($folder['id']),
($selected == $foldername ? ' selected="selected"' : ''),
str_repeat('&nbsp;', $nestLevel*4),
Q($foldername));
if (!empty($folder['folders'])) if (!empty($folder['folders']))
$out .= rcmail_render_folder_tree_select($folder['folders'], $mbox_name, $maxlength, $nestLevel+1, $selected); $out .= rcmail_render_folder_tree_select($folder['folders'], $mbox_name, $maxlength, $select, $nestLevel+1);
$idx++; $idx++;
} }

@ -24,7 +24,7 @@ if (!$OUTPUT->ajax_call)
function rcmail_user_prefs_form($attrib) function rcmail_user_prefs_form($attrib)
{ {
global $RCMAIL; global $RCMAIL;
$config = $RCMAIL->config->all(); $config = $RCMAIL->config->all();
@ -36,15 +36,11 @@ function rcmail_user_prefs_form($attrib)
list($form_start, $form_end) = get_form_tags($attrib, 'save-prefs'); list($form_start, $form_end) = get_form_tags($attrib, 'save-prefs');
unset($attrib['form']); unset($attrib['form']);
// allow the following attributes to be added to the <table> tag $out = $form_start;
$attrib_str = create_attrib_string($attrib, array('style', 'class', 'id', 'cellpadding', 'cellspacing', 'border', 'summary')); $table = new html_table(array('cols' => 2));
// return the complete edit form as tables
$out = "$form_start<fieldset><legend>" . Q(rcube_label('uisettings')) . "</legend>\n<table" . $attrib_str . ">\n\n";
// show language selection // show language selection
if (!isset($no_override['language'])) if (!isset($no_override['language'])) {
{
$a_lang = $RCMAIL->list_languages(); $a_lang = $RCMAIL->list_languages();
asort($a_lang); asort($a_lang);
@ -52,16 +48,13 @@ function rcmail_user_prefs_form($attrib)
$select_lang = new html_select(array('name' => '_language', 'id' => $field_id)); $select_lang = new html_select(array('name' => '_language', 'id' => $field_id));
$select_lang->add(array_values($a_lang), array_keys($a_lang)); $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", $table->add('title', html::label($field_id, Q(rcube_label('language'))));
$field_id, $table->add(null, $select_lang->show($_SESSION['language']));
Q(rcube_label('language')),
$select_lang->show($_SESSION['language']));
} }
// show page size selection // show page size selection
if (!isset($no_override['timezone'])) if (!isset($no_override['timezone'])) {
{
$field_id = 'rcmfd_timezone'; $field_id = 'rcmfd_timezone';
$select_timezone = new html_select(array('name' => '_timezone', 'id' => $field_id)); $select_timezone = new html_select(array('name' => '_timezone', 'id' => $field_id));
$select_timezone->add('(GMT -11:00) Midway Island, Samoa', '-11'); $select_timezone->add('(GMT -11:00) Midway Island, Samoa', '-11');
@ -104,207 +97,174 @@ function rcmail_user_prefs_form($attrib)
$select_timezone->add('(GMT +13:00) Tonga, Pheonix Islands', '13'); $select_timezone->add('(GMT +13:00) Tonga, Pheonix Islands', '13');
$select_timezone->add('(GMT +14:00) Kiribati', '14'); $select_timezone->add('(GMT +14:00) Kiribati', '14');
$out .= sprintf("<tr><td class=\"title\"><label for=\"%s\">%s</label></td><td>%s</td></tr>\n", $table->add('title', html::label($field_id, Q(rcube_label('timezone'))));
$field_id, $table->add(null, $select_timezone->show((string)$config['timezone']));
Q(rcube_label('timezone')),
$select_timezone->show((string)$config['timezone']));
} }
// daylight savings // daylight savings
if (!isset($no_override['dst_active'])) if (!isset($no_override['dst_active'])) {
{
$field_id = 'rcmfd_dst'; $field_id = 'rcmfd_dst';
$input_dst = new html_checkbox(array('name' => '_dst_active', 'id' => $field_id, 'value' => 1)); $input_dst = new html_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, $table->add('title', html::label($field_id, Q(rcube_label('dstactive'))));
Q(rcube_label('dstactive')), $table->add(null, $input_dst->show($config['dst_active']));
$input_dst->show($config['dst_active']));
} }
// MM: Show checkbox for toggling 'pretty dates' // MM: Show checkbox for toggling 'pretty dates'
if (!isset($no_override['prettydate'])) if (!isset($no_override['prettydate'])) {
{
$field_id = 'rcmfd_prettydate'; $field_id = 'rcmfd_prettydate';
$input_prettydate = new html_checkbox(array('name' => '_pretty_date', 'id' => $field_id, 'value' => 1)); $input_prettydate = new html_checkbox(array('name' => '_pretty_date', 'id' => $field_id, 'value' => 1));
$out .= sprintf("<tr><td class=\"title\"><label for=\"%s\">%s</label></td><td>%s</td></tr>\n", $table->add('title', html::label($field_id, Q(rcube_label('prettydate'))));
$field_id, $table->add(null, $input_prettydate->show($config['prettydate']?1:0));
Q(rcube_label('prettydate')),
$input_prettydate->show($config['prettydate']?1:0));
} }
// show page size selection // show page size selection
if (!isset($no_override['pagesize'])) if (!isset($no_override['pagesize'])) {
{
$field_id = 'rcmfd_pgsize'; $field_id = 'rcmfd_pgsize';
$input_pagesize = new html_inputfield(array('name' => '_pagesize', 'id' => $field_id, 'size' => 5)); $input_pagesize = new html_inputfield(array('name' => '_pagesize', 'id' => $field_id, 'size' => 5));
$out .= sprintf("<tr><td class=\"title\"><label for=\"%s\">%s</label></td><td>%s</td></tr>\n", $table->add('title', html::label($field_id, Q(rcube_label('pagesize'))));
$field_id, $table->add(null, $input_pagesize->show($config['pagesize']));
Q(rcube_label('pagesize')),
$input_pagesize->show($config['pagesize']));
} }
// show drop-down for available skins // show drop-down for available skins
if (!isset($no_override['skin'])) if (!isset($no_override['skin'])) {
{
$skins = rcmail_get_skins(); $skins = rcmail_get_skins();
if (count($skins) > 1) if (count($skins) > 1) {
{
$field_id = 'rcmfd_skin'; $field_id = 'rcmfd_skin';
$input_skin = new html_select(array('name'=>'_skin', 'id'=>$field_id)); $input_skin = new html_select(array('name'=>'_skin', 'id'=>$field_id));
foreach($skins as $skin) foreach($skins as $skin)
$input_skin->add($skin, $skin); $input_skin->add($skin, $skin);
$out .= sprintf("<tr><td class=\"title\"><lable for=\"%s\">%s</label></td><td>%s</td></tr>\n", $table->add('title', html::label($field_id, Q(rcube_label('skin'))));
$field_id, $table->add(null, $input_skin->show($config['skin']));
Q(rcube_label('skin')),
$input_skin->show($config['skin']));
} }
} }
$out .= "</table></fieldset>\n<fieldset><legend>" . Q(rcube_label('mailboxview')) . "</legend>\n<table" . $attrib_str . ">\n\n"; $out .= html::tag('fieldset', null, html::tag('legend', null, Q(rcube_label('uisettings'))) . $table->show($attrib));
$table = new html_table(array('cols' => 2));
// show config parameter for preview pane // show config parameter for preview pane
if (!isset($no_override['preview_pane'])) if (!isset($no_override['preview_pane'])) {
{
$field_id = 'rcmfd_preview'; $field_id = 'rcmfd_preview';
$input_preview = new html_checkbox(array('name' => '_preview_pane', 'id' => $field_id, 'value' => 1)); $input_preview = new html_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, $table->add('title', html::label($field_id, Q(rcube_label('previewpane'))));
Q(rcube_label('previewpane')), $table->add(null, $input_preview->show($config['preview_pane']?1:0));
$input_preview->show($config['preview_pane']?1:0));
} }
if (!isset($no_override['mdn_requests'])) if (!isset($no_override['mdn_requests'])) {
{
$field_id = 'rcmfd_mdn_requests'; $field_id = 'rcmfd_mdn_requests';
$select_mdn_requests = new html_select(array('name' => '_mdn_requests', 'id' => $field_id)); $select_mdn_requests = new html_select(array('name' => '_mdn_requests', 'id' => $field_id));
$select_mdn_requests->add(rcube_label('askuser'), 0); $select_mdn_requests->add(rcube_label('askuser'), 0);
$select_mdn_requests->add(rcube_label('autosend'), 1); $select_mdn_requests->add(rcube_label('autosend'), 1);
$select_mdn_requests->add(rcube_label('ignore'), 2); $select_mdn_requests->add(rcube_label('ignore'), 2);
$out .= sprintf("<tr><td class=\"title\"><label for=\"%s\">%s</label></td><td>%s</td></tr>\n", $table->add('title', html::label($field_id, Q(rcube_label('mdnrequests'))));
$field_id, $table->add(null, $select_mdn_requests->show($config['mdn_requests']));
Q(rcube_label('mdnrequests')),
$select_mdn_requests->show($config['mdn_requests']));
} }
$out .= "</table></fieldset>\n<fieldset><legend>" . Q(rcube_label('messagesdisplaying')) . "</legend>\n<table" . $attrib_str . ">\n\n"; $out .= html::tag('fieldset', null, html::tag('legend', null, Q(rcube_label('mailboxview'))) . $table->show($attrib));
$table = new html_table(array('cols' => 2));
// show checkbox for HTML/plaintext messages // show checkbox for HTML/plaintext messages
if (!isset($no_override['prefer_html'])) if (!isset($no_override['prefer_html'])) {
{
$field_id = 'rcmfd_htmlmsg'; $field_id = 'rcmfd_htmlmsg';
$input_preferhtml = new html_checkbox(array('name' => '_prefer_html', 'id' => $field_id, 'value' => 1, $input_preferhtml = new html_checkbox(array('name' => '_prefer_html', 'id' => $field_id, 'value' => 1,
'onchange' => JS_OBJECT_NAME.'.toggle_prefer_html(this)')); 'onchange' => JS_OBJECT_NAME.'.toggle_prefer_html(this)'));
$out .= sprintf("<tr><td class=\"title\"><label for=\"%s\">%s</label></td><td>%s</td></tr>\n", $table->add('title', html::label($field_id, Q(rcube_label('preferhtml'))));
$field_id, $table->add(null, $input_preferhtml->show($config['prefer_html']?1:0));
Q(rcube_label('preferhtml')),
$input_preferhtml->show($config['prefer_html']?1:0));
} }
// show checkbox for displaying images from people in the addressbook // show checkbox for displaying images from people in the addressbook
if (!isset($no_override['addrbook_show_images'])) if (!isset($no_override['addrbook_show_images'])) {
{
$field_id = 'rcmfd_addrbook_show_images'; $field_id = 'rcmfd_addrbook_show_images';
$input_addrbook_show_images = new html_checkbox(array('name' => '_addrbook_show_images', 'id' => $field_id, $input_addrbook_show_images = new html_checkbox(array('name' => '_addrbook_show_images', 'id' => $field_id,
'value' => 1, 'disabled' => $config['prefer_html']?0:1)); 'value' => 1, 'disabled' => $config['prefer_html']?0:1));
$out .= sprintf("<tr><td class=\"title\"><label for=\"%s\">%s</label></td><td>%s</td></tr>\n", $table->add('title', html::label($field_id, Q(rcube_label('showknownimages'))));
$field_id, $table->add(null, $input_addrbook_show_images->show($config['addrbook_show_images']?1:0));
Q(rcube_label('showknownimages')),
$input_addrbook_show_images->show($config['addrbook_show_images']?1:0));
} }
if (!isset($no_override['inline_images'])) if (!isset($no_override['inline_images'])) {
{
$field_id = 'rcmfd_inline_images'; $field_id = 'rcmfd_inline_images';
$input_inline_images = new html_checkbox(array('name' => '_inline_images', 'id' => $field_id, 'value' => 1)); $input_inline_images = new html_checkbox(array('name' => '_inline_images', 'id' => $field_id, 'value' => 1));
$out .= sprintf("<tr><td class=\"title\"><label for=\"%s\">%s</label></td><td>%s</td></tr>\n", $table->add('title', html::label($field_id, Q(rcube_label('showinlineimages'))));
$field_id, $table->add(null, $input_inline_images->show($config['inline_images']?1:0));
Q(rcube_label('showinlineimages')),
$input_inline_images->show($config['inline_images']?1:0));
} }
$out .= "</table></fieldset>\n<fieldset><legend>" . Q(rcube_label('messagescomposition')) . "</legend>\n<table" . $attrib_str . ">\n\n"; $out .= html::tag('fieldset', null, html::tag('legend', null, Q(rcube_label('messagesdisplaying'))) . $table->show($attrib));
$table = new html_table(array('cols' => 2));
// Show checkbox for HTML Editor // Show checkbox for HTML Editor
if (!isset($no_override['htmleditor'])) if (!isset($no_override['htmleditor'])) {
{
$field_id = 'rcmfd_htmleditor'; $field_id = 'rcmfd_htmleditor';
$input_htmleditor = new html_checkbox(array('name' => '_htmleditor', 'id' => $field_id, 'value' => 1)); $input_htmleditor = new html_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, $table->add('title', html::label($field_id, Q(rcube_label('htmleditor'))));
Q(rcube_label('htmleditor')), $table->add(null, $input_htmleditor->show($config['htmleditor']?1:0));
$input_htmleditor->show($config['htmleditor']?1:0));
} }
if (!empty($config['drafts_mbox']) && !isset($no_override['draft_autosave'])) if (!empty($config['drafts_mbox']) && !isset($no_override['draft_autosave'])) {
{
$field_id = 'rcmfd_autosave'; $field_id = 'rcmfd_autosave';
$select_autosave = new html_select(array('name' => '_draft_autosave', 'id' => $field_id)); $select_autosave = new html_select(array('name' => '_draft_autosave', 'id' => $field_id));
$select_autosave->add(rcube_label('never'), 0); $select_autosave->add(rcube_label('never'), 0);
foreach (array(3, 5, 10) as $i => $min) foreach (array(3, 5, 10) as $i => $min)
$select_autosave->add(rcube_label(array('name' => 'everynminutes', 'vars' => array('n' => $min))), $min*60); $select_autosave->add(rcube_label(array('name' => 'everynminutes', 'vars' => array('n' => $min))), $min*60);
$out .= sprintf("<tr><td class=\"title\"><label for=\"%s\">%s</label></td><td>%s</td></tr>\n", $table->add('title', html::label($field_id, Q(rcube_label('autosavedraft'))));
$field_id, $table->add(null, $select_autosave->show($config['draft_autosave']));
Q(rcube_label('autosavedraft')),
$select_autosave->show($config['draft_autosave']));
} }
$out .= "</table></fieldset>\n<fieldset><legend>" . Q(rcube_label('serversettings')) . "</legend>\n<table" . $attrib_str . ">\n\n"; $out .= html::tag('fieldset', null, html::tag('legend', null, Q(rcube_label('messagescomposition'))) . $table->show($attrib));
if (!isset($no_override['read_when_deleted'])) $table = new html_table(array('cols' => 2));
{
if (!isset($no_override['read_when_deleted'])) {
$field_id = 'rcmfd_read_deleted'; $field_id = 'rcmfd_read_deleted';
$input_readdeleted = new html_checkbox(array('name' => '_read_when_deleted', 'id' => $field_id, 'value' => 1)); $input_readdeleted = new html_checkbox(array('name' => '_read_when_deleted', 'id' => $field_id, 'value' => 1));
$out .= sprintf("<tr><td class=\"title\"><label for=\"%s\">%s</label></td><td>%s</td></tr>\n",
$field_id, $table->add('title', html::label($field_id, Q(rcube_label('readwhendeleted'))));
Q(rcube_label('readwhendeleted')), $table->add(null, $input_readdeleted->show($config['read_when_deleted']?1:0));
$input_readdeleted->show($config['read_when_deleted']?1:0));
} }
if (!isset($no_override['flag_for_deletion'])) if (!isset($no_override['flag_for_deletion'])) {
{
$field_id = 'rcmfd_flag_for_deletion'; $field_id = 'rcmfd_flag_for_deletion';
$input_flagfordeletion = new html_checkbox(array('name' => '_flag_for_deletion', 'id' => $field_id, 'value' => 1)); $input_flagfordeletion = new html_checkbox(array('name' => '_flag_for_deletion', 'id' => $field_id, 'value' => 1));
$out .= sprintf("<tr><td class=\"title\"><label for=\"%s\">%s</label></td><td>%s</td></tr>\n",
$field_id, $table->add('title', html::label($field_id, Q(rcube_label('flagfordeletion'))));
Q(rcube_label('flagfordeletion')), $table->add(null, $input_flagfordeletion->show($config['flag_for_deletion']?1:0));
$input_flagfordeletion->show($config['flag_for_deletion']?1:0));
} }
// Trash purging on logout // Trash purging on logout
if (!isset($no_override['logout_purge'])) if (!isset($no_override['logout_purge'])) {
{
$field_id = 'rcmfd_logout_purge'; $field_id = 'rcmfd_logout_purge';
$input_purge = new html_checkbox(array('name' => '_logout_purge', 'id' => $field_id, 'value' => 1)); $input_purge = new html_checkbox(array('name' => '_logout_purge', 'id' => $field_id, 'value' => 1));
$out .= sprintf("<tr><td class=\"title\"><label for=\"%s\">%s</label></td><td>%s</td></tr>\n",
$field_id, $table->add('title', html::label($field_id, Q(rcube_label('logoutclear'))));
Q(rcube_label('logoutclear')), $table->add(null, $input_purge->show($config['logout_purge']?1:0));
$input_purge->show($config['logout_purge']?1:0));
} }
// INBOX compacting on logout // INBOX compacting on logout
if (!isset($no_override['logout_expunge'])) if (!isset($no_override['logout_expunge'])) {
{
$field_id = 'rcmfd_logout_expunge'; $field_id = 'rcmfd_logout_expunge';
$input_expunge = new html_checkbox(array('name' => '_logout_expunge', 'id' => $field_id, 'value' => 1)); $input_expunge = new html_checkbox(array('name' => '_logout_expunge', 'id' => $field_id, 'value' => 1));
$out .= sprintf("<tr><td class=\"title\"><label for=\"%s\">%s</label></td><td>%s</td></tr>\n",
$field_id, $table->add('title', html::label($field_id, Q(rcube_label('logoutcompact'))));
Q(rcube_label('logoutcompact')), $table->add(null, $input_expunge->show($config['logout_expunge']?1:0));
$input_expunge->show($config['logout_expunge']?1:0));
} }
$out .= "\n</table></fieldset>$form_end"; $out .= html::tag('fieldset', null, html::tag('legend', null, Q(rcube_label('serversettings'))) . $table->show($attrib));
return $out; return $out . $form_end;
} }

Loading…
Cancel
Save