Changeset 1618 in subversion


Ignore:
Timestamp:
Jul 31, 2008 12:40:09 PM (5 years ago)
Author:
thomasb
Message:

Code cleanup with new html classes

Location:
trunk/roundcubemail/program
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/roundcubemail/program/include/html.php

    r1615 r1618  
    146146            $attr = array('href' => $attr); 
    147147        } 
    148         return self::tag('a', $attr, $cont, array_merge(self::$common_attrib, array('href','target','name','onclick','onmouseover','onmouseout'))); 
     148        return self::tag('a', $attr, $cont, array_merge(self::$common_attrib, array('href','target','name','onclick','onmouseover','onmouseout','onmousedown','onmouseup'))); 
    149149    } 
    150150 
  • trunk/roundcubemail/program/include/main.inc

    r1601 r1618  
    464464 * except . and - 
    465465 */ 
    466 function asciiwords($str) 
     466function asciiwords($str, $css_id = false) 
    467467{ 
    468   return preg_replace('/[^a-z0-9._-]/i', '', $str); 
     468  $allowed = 'a-z0-9\_\-' . (!$css_id ? '\.' : ''); 
     469  return preg_replace("/[^$allowed]/i", '', $str); 
    469470} 
    470471 
     
    888889   
    889890  $type = $attrib['type'] ? $attrib['type'] : 'ul'; 
    890   $add_attrib = $type=='select' ? array('style', 'class', 'id', 'name', 'onchange') : 
    891                                   array('style', 'class', 'id'); 
    892                                    
     891  unset($attrib['type']); 
     892 
    893893  if ($type=='ul' && !$attrib['id']) 
    894894    $attrib['id'] = 'rcmboxlist'; 
    895895 
    896   // allow the following attributes to be added to the <ul> tag 
    897   $attrib_str = create_attrib_string($attrib, $add_attrib); 
    898   
    899   $out = '<' . $type . $attrib_str . ">\n"; 
    900    
    901   // add no-selection option 
    902   if ($type=='select' && $attrib['noselection']) 
    903     $out .= sprintf('<option value="0">%s</option>'."\n", 
    904                     rcube_label($attrib['noselection'])); 
    905    
    906896  // get mailbox list 
    907897  $mbox_name = $IMAP->get_mailbox_name(); 
     
    923913// var_dump($a_mailboxes); 
    924914 
    925   if ($type=='select') 
    926     $out .= rcmail_render_folder_tree_select($a_mailboxes, $mbox_name, $attrib['maxlength']); 
    927    else 
    928     $out .= rcmail_render_folder_tree_html($a_mailboxes, $mbox_name, $attrib['maxlength']); 
    929  
    930 // rcube_print_time($mboxlist_start, 'render_folder_tree()'); 
     915  if ($type=='select') { 
     916    $select = new html_select($attrib); 
     917     
     918    // add no-selection option 
     919    if ($attrib['noselection']) 
     920      $select->add(rcube_label($attrib['noselection']), '0'); 
     921     
     922    rcmail_render_folder_tree_select($a_mailboxes, $mbox_name, $attrib['maxlength'], $select); 
     923    $out = $select->show($mbox_name); 
     924  } 
     925  else { 
     926    $out = html::tag('ul', $attrib, rcmail_render_folder_tree_html($a_mailboxes, $mbox_name, $attrib['maxlength']), html::$common_attrib); 
     927  } 
    931928 
    932929 
     
    934931    $OUTPUT->add_gui_object('mailboxlist', $attrib['id']); 
    935932 
    936   return $out . "</$type>"; 
     933  return $out; 
    937934  } 
    938935 
     
    962959  if (!isset($arrFolders[$currentFolder])) 
    963960    { 
    964     $arrFolders[$currentFolder] = array('id' => $path, 
    965                                         'name' => rcube_charset_convert($currentFolder, 'UTF-7'), 
    966                                         'folders' => array()); 
     961    $arrFolders[$currentFolder] = array( 
     962      'id' => $path, 
     963      'name' => rcube_charset_convert($currentFolder, 'UTF-7'), 
     964      'folders' => array()); 
    967965    } 
    968966 
     
    985983    { 
    986984    $zebra_class = ($nestLevel*$idx)%2 ? 'even' : 'odd'; 
    987     $title = ''; 
     985    $title = null; 
    988986 
    989987    if ($folder_class = rcmail_folder_classname($folder['id'])) 
     
    998996        $fname = abbreviate_string($foldername, $maxlength); 
    999997        if ($fname != $foldername) 
    1000           $title = ' title="'.Q($foldername).'"'; 
     998          $title = $foldername; 
    1001999        $foldername = $fname; 
    10021000        } 
     
    10041002 
    10051003    // make folder name safe for ids and class names 
    1006     $folder_id = preg_replace('/[^A-Za-z0-9\-_]/', '', $folder['id']); 
    1007     $class_name = preg_replace('/[^a-z0-9\-_]/', '', $folder_class ? $folder_class : strtolower($folder['id'])); 
     1004    $folder_id = asciiwords($folder['id'], true); 
     1005    $classes = array('mailbox'); 
    10081006 
    10091007    // set special class for Sent, Drafts, Trash and Junk 
    10101008    if ($folder['id']==$CONFIG['sent_mbox']) 
    1011       $class_name = 'sent'; 
     1009      $classes[] = 'sent'; 
    10121010    else if ($folder['id']==$CONFIG['drafts_mbox']) 
    1013       $class_name = 'drafts'; 
     1011      $classes[] = 'drafts'; 
    10141012    else if ($folder['id']==$CONFIG['trash_mbox']) 
    1015       $class_name = 'trash'; 
     1013      $classes[] = 'trash'; 
    10161014    else if ($folder['id']==$CONFIG['junk_mbox']) 
    1017       $class_name = 'junk'; 
    1018  
    1019     $js_name = htmlspecialchars(JQ($folder['id'])); 
    1020     $out .= sprintf('<li id="rcmli%s" class="mailbox %s %s%s"><a href="%s"'. 
    1021                     ' onclick="return %s.command(\'list\',\'%s\',this)"'. 
    1022                     ' onmouseover="return %s.focus_folder(\'%s\')"' . 
    1023                     ' onmouseout="return %s.unfocus_folder(\'%s\')"' . 
    1024                     ' onmouseup="return %s.folder_mouse_up(\'%s\')"%s>%s</a>', 
    1025                     $folder_id, 
    1026                     $class_name, 
    1027                     $zebra_class, 
    1028                     $folder['id']==$mbox_name ? ' selected' : '', 
    1029                     Q(rcmail_url('', array('_mbox' => $folder['id']))), 
    1030                     JS_OBJECT_NAME, 
    1031                     $js_name, 
    1032                     JS_OBJECT_NAME, 
    1033                     $js_name, 
    1034                     JS_OBJECT_NAME, 
    1035                     $js_name, 
    1036                     JS_OBJECT_NAME, 
    1037                     $js_name, 
    1038                     $title, 
    1039                     Q($foldername)); 
    1040  
     1015      $classes[] = 'junk'; 
     1016    else 
     1017      $classes[] = asciiwords($folder_class ? $folder_class : strtolower($folder['id']), true); 
     1018       
     1019    $classes[] = $zebra_class; 
     1020     
     1021    if ($folder['id'] == $mbox_name) 
     1022      $classes[] = 'selected'; 
     1023 
     1024    $js_name = JQ($folder['id']); 
     1025    $out .= html::tag('li', array( 
     1026        'id' => "rcmli".$folder_id, 
     1027        'class' => join(' ', $classes), 
     1028        'noclose' => true), 
     1029      html::a(array( 
     1030        'href' => rcmail_url('', array('_mbox' => $folder['id'])), 
     1031        'onclick' => sprintf("return %s.command('list','%s',this)", JS_OBJECT_NAME, $js_name), 
     1032        'onmouseover' => sprintf("return %s.focus_folder('%s')", JS_OBJECT_NAME, $js_name), 
     1033        'onmouseout' => sprintf("return %s.unfocus_folder('%s')", JS_OBJECT_NAME, $js_name), 
     1034        'onmouseup' => sprintf("return %s.folder_mouse_up('%s')", JS_OBJECT_NAME, $js_name), 
     1035        'title' => $title, 
     1036      ), Q($foldername))); 
     1037     
    10411038    if (!empty($folder['folders'])) 
    10421039      $out .= "\n<ul>\n" . rcmail_render_folder_tree_html($folder['folders'], $mbox_name, $maxlength, $nestLevel+1) . "</ul>\n"; 
     
    10541051 * @access private 
    10551052 */ 
    1056 function rcmail_render_folder_tree_select(&$arrFolders, &$mbox_name, $maxlength, $nestLevel=0, $selected='') 
     1053function rcmail_render_folder_tree_select(&$arrFolders, &$mbox_name, $maxlength, &$select, $nestLevel=0) 
    10571054  { 
    10581055  global $IMAP, $OUTPUT; 
     
    10731070      } 
    10741071 
    1075     $out .= sprintf('<option value="%s"%s>%s%s</option>'."\n", 
    1076                     htmlspecialchars($folder['id']), 
    1077                     ($selected == $foldername ? ' selected="selected"' : ''), 
    1078                     str_repeat('&nbsp;', $nestLevel*4), 
    1079                     Q($foldername)); 
     1072    $select->add(str_repeat('&nbsp;', $nestLevel*4) . $foldername, $folder['id']); 
    10801073 
    10811074    if (!empty($folder['folders'])) 
    1082       $out .= rcmail_render_folder_tree_select($folder['folders'], $mbox_name, $maxlength, $nestLevel+1, $selected); 
     1075      $out .= rcmail_render_folder_tree_select($folder['folders'], $mbox_name, $maxlength, $select, $nestLevel+1); 
    10831076 
    10841077    $idx++; 
  • trunk/roundcubemail/program/steps/settings/func.inc

    r1540 r1618  
    2525 
    2626function rcmail_user_prefs_form($attrib) 
    27   { 
     27{ 
    2828  global $RCMAIL; 
    2929  $config = $RCMAIL->config->all(); 
     
    3737  unset($attrib['form']); 
    3838 
    39   // allow the following attributes to be added to the <table> tag 
    40   $attrib_str = create_attrib_string($attrib, array('style', 'class', 'id', 'cellpadding', 'cellspacing', 'border', 'summary')); 
    41  
    42   // return the complete edit form as tables 
    43   $out = "$form_start<fieldset><legend>" . Q(rcube_label('uisettings')) . "</legend>\n<table" . $attrib_str . ">\n\n"; 
     39  $out = $form_start; 
     40  $table = new html_table(array('cols' => 2)); 
    4441 
    4542  // show language selection 
    46   if (!isset($no_override['language'])) 
    47     { 
     43  if (!isset($no_override['language'])) { 
    4844    $a_lang = $RCMAIL->list_languages(); 
    4945    asort($a_lang); 
     
    5349    $select_lang->add(array_values($a_lang), array_keys($a_lang)); 
    5450   
    55     $out .= sprintf("<tr><td class=\"title\"><label for=\"%s\">%s</label></td><td>%s</td></tr>\n", 
    56                     $field_id, 
    57                     Q(rcube_label('language')), 
    58                     $select_lang->show($_SESSION['language'])); 
    59     } 
     51    $table->add('title', html::label($field_id, Q(rcube_label('language')))); 
     52    $table->add(null, $select_lang->show($_SESSION['language'])); 
     53  } 
    6054 
    6155 
    6256  // show page size selection 
    63   if (!isset($no_override['timezone'])) 
    64     { 
     57  if (!isset($no_override['timezone'])) { 
    6558    $field_id = 'rcmfd_timezone'; 
    6659    $select_timezone = new html_select(array('name' => '_timezone', 'id' => $field_id)); 
     
    10598    $select_timezone->add('(GMT +14:00) Kiribati', '14'); 
    10699   
    107     $out .= sprintf("<tr><td class=\"title\"><label for=\"%s\">%s</label></td><td>%s</td></tr>\n", 
    108                     $field_id, 
    109                     Q(rcube_label('timezone')), 
    110                     $select_timezone->show((string)$config['timezone'])); 
    111     } 
     100    $table->add('title', html::label($field_id, Q(rcube_label('timezone')))); 
     101    $table->add(null, $select_timezone->show((string)$config['timezone'])); 
     102  } 
    112103 
    113104  // daylight savings 
    114   if (!isset($no_override['dst_active'])) 
    115     { 
     105  if (!isset($no_override['dst_active'])) { 
    116106    $field_id = 'rcmfd_dst'; 
    117107    $input_dst = new html_checkbox(array('name' => '_dst_active', 'id' => $field_id, 'value' => 1)); 
    118     $out .= sprintf("<tr><td class=\"title\"><label for=\"%s\">%s</label></td><td>%s</td></tr>\n", 
    119                     $field_id, 
    120                     Q(rcube_label('dstactive')), 
    121                     $input_dst->show($config['dst_active'])); 
    122     } 
     108     
     109    $table->add('title', html::label($field_id, Q(rcube_label('dstactive')))); 
     110    $table->add(null, $input_dst->show($config['dst_active'])); 
     111  } 
    123112 
    124113  // MM: Show checkbox for toggling 'pretty dates'  
    125   if (!isset($no_override['prettydate'])) 
    126     { 
     114  if (!isset($no_override['prettydate'])) { 
    127115    $field_id = 'rcmfd_prettydate'; 
    128116    $input_prettydate = new html_checkbox(array('name' => '_pretty_date', 'id' => $field_id, 'value' => 1)); 
    129117 
    130     $out .= sprintf("<tr><td class=\"title\"><label for=\"%s\">%s</label></td><td>%s</td></tr>\n", 
    131                     $field_id, 
    132                     Q(rcube_label('prettydate')), 
    133                     $input_prettydate->show($config['prettydate']?1:0)); 
    134     } 
     118    $table->add('title', html::label($field_id, Q(rcube_label('prettydate')))); 
     119    $table->add(null, $input_prettydate->show($config['prettydate']?1:0)); 
     120  } 
    135121 
    136122  // show page size selection 
    137   if (!isset($no_override['pagesize'])) 
    138     { 
     123  if (!isset($no_override['pagesize'])) { 
    139124    $field_id = 'rcmfd_pgsize'; 
    140125    $input_pagesize = new html_inputfield(array('name' => '_pagesize', 'id' => $field_id, 'size' => 5)); 
    141126 
    142     $out .= sprintf("<tr><td class=\"title\"><label for=\"%s\">%s</label></td><td>%s</td></tr>\n", 
    143                     $field_id, 
    144                     Q(rcube_label('pagesize')), 
    145                     $input_pagesize->show($config['pagesize'])); 
    146     } 
     127    $table->add('title', html::label($field_id, Q(rcube_label('pagesize')))); 
     128    $table->add(null, $input_pagesize->show($config['pagesize'])); 
     129  } 
    147130 
    148131  // show drop-down for available skins 
    149   if (!isset($no_override['skin'])) 
    150     { 
     132  if (!isset($no_override['skin'])) { 
    151133    $skins = rcmail_get_skins(); 
    152134 
    153     if (count($skins) > 1) 
    154       { 
     135    if (count($skins) > 1) { 
    155136      $field_id = 'rcmfd_skin'; 
    156137      $input_skin = new html_select(array('name'=>'_skin', 'id'=>$field_id)); 
     
    159140        $input_skin->add($skin, $skin); 
    160141 
    161       $out .= sprintf("<tr><td class=\"title\"><lable for=\"%s\">%s</label></td><td>%s</td></tr>\n", 
    162                     $field_id, 
    163                     Q(rcube_label('skin')), 
    164                     $input_skin->show($config['skin'])); 
    165       } 
     142      $table->add('title', html::label($field_id, Q(rcube_label('skin')))); 
     143      $table->add(null, $input_skin->show($config['skin'])); 
    166144    } 
    167  
    168   $out .= "</table></fieldset>\n<fieldset><legend>" . Q(rcube_label('mailboxview')) . "</legend>\n<table" . $attrib_str . ">\n\n"; 
     145  } 
     146 
     147  $out .= html::tag('fieldset', null, html::tag('legend', null, Q(rcube_label('uisettings'))) . $table->show($attrib)); 
     148   
     149  $table = new html_table(array('cols' => 2)); 
    169150 
    170151  // show config parameter for preview pane 
    171   if (!isset($no_override['preview_pane'])) 
    172     { 
     152  if (!isset($no_override['preview_pane'])) { 
    173153    $field_id = 'rcmfd_preview'; 
    174154    $input_preview = new html_checkbox(array('name' => '_preview_pane', 'id' => $field_id, 'value' => 1)); 
    175     $out .= sprintf("<tr><td class=\"title\"><label for=\"%s\">%s</label></td><td>%s</td></tr>\n", 
    176                     $field_id, 
    177                     Q(rcube_label('previewpane')), 
    178                     $input_preview->show($config['preview_pane']?1:0)); 
    179     } 
    180  
    181   if (!isset($no_override['mdn_requests'])) 
    182     { 
     155     
     156    $table->add('title', html::label($field_id, Q(rcube_label('previewpane')))); 
     157    $table->add(null, $input_preview->show($config['preview_pane']?1:0)); 
     158  } 
     159 
     160  if (!isset($no_override['mdn_requests'])) { 
    183161    $field_id = 'rcmfd_mdn_requests'; 
    184162    $select_mdn_requests = new html_select(array('name' => '_mdn_requests', 'id' => $field_id)); 
     
    187165    $select_mdn_requests->add(rcube_label('ignore'), 2); 
    188166 
    189     $out .= sprintf("<tr><td class=\"title\"><label for=\"%s\">%s</label></td><td>%s</td></tr>\n", 
    190                     $field_id, 
    191                     Q(rcube_label('mdnrequests')), 
    192                     $select_mdn_requests->show($config['mdn_requests'])); 
    193     } 
    194  
    195   $out .= "</table></fieldset>\n<fieldset><legend>" . Q(rcube_label('messagesdisplaying')) . "</legend>\n<table" . $attrib_str . ">\n\n"; 
     167    $table->add('title', html::label($field_id, Q(rcube_label('mdnrequests')))); 
     168    $table->add(null, $select_mdn_requests->show($config['mdn_requests'])); 
     169  } 
     170 
     171  $out .= html::tag('fieldset', null, html::tag('legend', null, Q(rcube_label('mailboxview'))) . $table->show($attrib)); 
     172 
     173  $table = new html_table(array('cols' => 2)); 
    196174 
    197175  // show checkbox for HTML/plaintext messages 
    198   if (!isset($no_override['prefer_html'])) 
    199     { 
     176  if (!isset($no_override['prefer_html'])) { 
    200177    $field_id = 'rcmfd_htmlmsg'; 
    201178    $input_preferhtml = new html_checkbox(array('name' => '_prefer_html', 'id' => $field_id, 'value' => 1, 
    202         'onchange' => JS_OBJECT_NAME.'.toggle_prefer_html(this)')); 
    203  
    204     $out .= sprintf("<tr><td class=\"title\"><label for=\"%s\">%s</label></td><td>%s</td></tr>\n", 
    205                     $field_id, 
    206                     Q(rcube_label('preferhtml')), 
    207                     $input_preferhtml->show($config['prefer_html']?1:0)); 
    208     } 
     179      'onchange' => JS_OBJECT_NAME.'.toggle_prefer_html(this)')); 
     180 
     181    $table->add('title', html::label($field_id, Q(rcube_label('preferhtml')))); 
     182    $table->add(null, $input_preferhtml->show($config['prefer_html']?1:0)); 
     183  } 
    209184 
    210185  // show checkbox for displaying images from people in the addressbook 
    211   if (!isset($no_override['addrbook_show_images'])) 
    212     { 
     186  if (!isset($no_override['addrbook_show_images'])) { 
    213187    $field_id = 'rcmfd_addrbook_show_images'; 
    214     $input_addrbook_show_images = new html_checkbox(array('name' => '_addrbook_show_images', 'id' => $field_id,  
    215         'value' => 1, 'disabled' => $config['prefer_html']?0:1)); 
    216  
    217     $out .= sprintf("<tr><td class=\"title\"><label for=\"%s\">%s</label></td><td>%s</td></tr>\n", 
    218                     $field_id, 
    219                     Q(rcube_label('showknownimages')), 
    220                     $input_addrbook_show_images->show($config['addrbook_show_images']?1:0)); 
    221     } 
    222  
    223   if (!isset($no_override['inline_images'])) 
    224     { 
     188    $input_addrbook_show_images = new html_checkbox(array('name' => '_addrbook_show_images', 'id' => $field_id, 
     189      'value' => 1, 'disabled' => $config['prefer_html']?0:1)); 
     190 
     191    $table->add('title', html::label($field_id, Q(rcube_label('showknownimages')))); 
     192    $table->add(null, $input_addrbook_show_images->show($config['addrbook_show_images']?1:0)); 
     193  } 
     194 
     195  if (!isset($no_override['inline_images'])) { 
    225196    $field_id = 'rcmfd_inline_images'; 
    226197    $input_inline_images = new html_checkbox(array('name' => '_inline_images', 'id' => $field_id, 'value' => 1)); 
    227198 
    228     $out .= sprintf("<tr><td class=\"title\"><label for=\"%s\">%s</label></td><td>%s</td></tr>\n", 
    229                     $field_id, 
    230                     Q(rcube_label('showinlineimages')), 
    231                     $input_inline_images->show($config['inline_images']?1:0)); 
    232     } 
    233  
    234   $out .= "</table></fieldset>\n<fieldset><legend>" . Q(rcube_label('messagescomposition')) . "</legend>\n<table" . $attrib_str . ">\n\n"; 
     199    $table->add('title', html::label($field_id, Q(rcube_label('showinlineimages')))); 
     200    $table->add(null, $input_inline_images->show($config['inline_images']?1:0)); 
     201  } 
     202 
     203  $out .= html::tag('fieldset', null, html::tag('legend', null, Q(rcube_label('messagesdisplaying'))) . $table->show($attrib)); 
     204   
     205  $table = new html_table(array('cols' => 2)); 
    235206 
    236207  // Show checkbox for HTML Editor 
    237   if (!isset($no_override['htmleditor'])) 
    238     { 
     208  if (!isset($no_override['htmleditor'])) { 
    239209    $field_id = 'rcmfd_htmleditor'; 
    240210    $input_htmleditor = new html_checkbox(array('name' => '_htmleditor', 'id' => $field_id, 'value' => 1)); 
    241     $out .= sprintf("<tr><td class=\"title\"><label for=\"%s\">%s</label></td><td>%s</td></tr>\n", 
    242                     $field_id, 
    243                     Q(rcube_label('htmleditor')), 
    244                     $input_htmleditor->show($config['htmleditor']?1:0)); 
    245     } 
     211     
     212    $table->add('title', html::label($field_id, Q(rcube_label('htmleditor')))); 
     213    $table->add(null, $input_htmleditor->show($config['htmleditor']?1:0)); 
     214  } 
    246215                   
    247   if (!empty($config['drafts_mbox']) && !isset($no_override['draft_autosave'])) 
    248     { 
     216  if (!empty($config['drafts_mbox']) && !isset($no_override['draft_autosave'])) { 
    249217    $field_id = 'rcmfd_autosave'; 
    250218    $select_autosave = new html_select(array('name' => '_draft_autosave', 'id' => $field_id)); 
     
    253221      $select_autosave->add(rcube_label(array('name' => 'everynminutes', 'vars' => array('n' => $min))), $min*60); 
    254222 
    255     $out .= sprintf("<tr><td class=\"title\"><label for=\"%s\">%s</label></td><td>%s</td></tr>\n", 
    256                     $field_id, 
    257                     Q(rcube_label('autosavedraft')), 
    258                     $select_autosave->show($config['draft_autosave'])); 
    259     } 
    260  
    261   $out .= "</table></fieldset>\n<fieldset><legend>" . Q(rcube_label('serversettings')) . "</legend>\n<table" . $attrib_str . ">\n\n"; 
    262  
    263   if (!isset($no_override['read_when_deleted'])) 
    264     { 
     223    $table->add('title', html::label($field_id, Q(rcube_label('autosavedraft')))); 
     224    $table->add(null, $select_autosave->show($config['draft_autosave'])); 
     225  } 
     226 
     227  $out .= html::tag('fieldset', null, html::tag('legend', null, Q(rcube_label('messagescomposition'))) . $table->show($attrib)); 
     228 
     229  $table = new html_table(array('cols' => 2)); 
     230 
     231  if (!isset($no_override['read_when_deleted'])) { 
    265232    $field_id = 'rcmfd_read_deleted'; 
    266233    $input_readdeleted = new html_checkbox(array('name' => '_read_when_deleted', 'id' => $field_id, 'value' => 1)); 
    267     $out .= sprintf("<tr><td class=\"title\"><label for=\"%s\">%s</label></td><td>%s</td></tr>\n", 
    268                     $field_id, 
    269                     Q(rcube_label('readwhendeleted')), 
    270                     $input_readdeleted->show($config['read_when_deleted']?1:0)); 
    271     } 
    272  
    273   if (!isset($no_override['flag_for_deletion'])) 
    274     { 
     234     
     235    $table->add('title', html::label($field_id, Q(rcube_label('readwhendeleted')))); 
     236    $table->add(null, $input_readdeleted->show($config['read_when_deleted']?1:0)); 
     237  } 
     238 
     239  if (!isset($no_override['flag_for_deletion'])) { 
    275240    $field_id = 'rcmfd_flag_for_deletion'; 
    276241    $input_flagfordeletion = new html_checkbox(array('name' => '_flag_for_deletion', 'id' => $field_id, 'value' => 1)); 
    277     $out .= sprintf("<tr><td class=\"title\"><label for=\"%s\">%s</label></td><td>%s</td></tr>\n", 
    278                     $field_id, 
    279                     Q(rcube_label('flagfordeletion')), 
    280                     $input_flagfordeletion->show($config['flag_for_deletion']?1:0)); 
    281     } 
     242     
     243    $table->add('title', html::label($field_id, Q(rcube_label('flagfordeletion')))); 
     244    $table->add(null, $input_flagfordeletion->show($config['flag_for_deletion']?1:0)); 
     245  } 
    282246 
    283247  // Trash purging on logout 
    284   if (!isset($no_override['logout_purge'])) 
    285     { 
     248  if (!isset($no_override['logout_purge'])) { 
    286249    $field_id = 'rcmfd_logout_purge'; 
    287250    $input_purge = new html_checkbox(array('name' => '_logout_purge', 'id' => $field_id, 'value' => 1)); 
    288     $out .= sprintf("<tr><td class=\"title\"><label for=\"%s\">%s</label></td><td>%s</td></tr>\n", 
    289                     $field_id, 
    290                     Q(rcube_label('logoutclear')), 
    291                     $input_purge->show($config['logout_purge']?1:0)); 
    292     } 
     251     
     252    $table->add('title', html::label($field_id, Q(rcube_label('logoutclear')))); 
     253    $table->add(null, $input_purge->show($config['logout_purge']?1:0)); 
     254  } 
    293255 
    294256  // INBOX compacting on logout 
    295   if (!isset($no_override['logout_expunge'])) 
    296     { 
     257  if (!isset($no_override['logout_expunge'])) { 
    297258    $field_id = 'rcmfd_logout_expunge'; 
    298259    $input_expunge = new html_checkbox(array('name' => '_logout_expunge', 'id' => $field_id, 'value' => 1)); 
    299     $out .= sprintf("<tr><td class=\"title\"><label for=\"%s\">%s</label></td><td>%s</td></tr>\n", 
    300                     $field_id, 
    301                     Q(rcube_label('logoutcompact')), 
    302                     $input_expunge->show($config['logout_expunge']?1:0)); 
    303     } 
    304  
    305   $out .= "\n</table></fieldset>$form_end"; 
    306  
    307   return $out;   
     260 
     261    $table->add('title', html::label($field_id, Q(rcube_label('logoutcompact')))); 
     262    $table->add(null, $input_expunge->show($config['logout_expunge']?1:0)); 
     263  } 
     264 
     265  $out .= html::tag('fieldset', null, html::tag('legend', null, Q(rcube_label('serversettings'))) . $table->show($attrib)); 
     266 
     267  return $out . $form_end; 
    308268  } 
    309269 
Note: See TracChangeset for help on using the changeset viewer.