Move some config options to new and collapsible 'advanced' blocks

pull/121/merge
Thomas Bruederli 11 years ago
parent a315bf2dda
commit 7be8a9134c

@ -40,14 +40,11 @@ function rcmail_user_prefs_form($attrib)
$out = $form_start;
foreach ($SECTIONS[$CURR_SECTION]['blocks'] as $block) {
foreach ($SECTIONS[$CURR_SECTION]['blocks'] as $class => $block) {
if (!empty($block['options'])) {
$table = new html_table(array('cols' => 2));
foreach ($block['options'] as $option) {
if ($option['advanced'])
$table->set_row_attribs('advanced');
if (isset($option['title'])) {
$table->add('title', $option['title']);
$table->add(null, $option['content']);
@ -57,7 +54,7 @@ function rcmail_user_prefs_form($attrib)
}
}
$out .= html::tag('fieldset', null, html::tag('legend', null, $block['name']) . $table->show($attrib));
$out .= html::tag('fieldset', $class, html::tag('legend', null, $block['name']) . $table->show($attrib));
}
else if (!empty($block['content'])) {
$out .= html::tag('fieldset', null, html::tag('legend', null, $block['name']) . $block['content']);

@ -158,6 +158,7 @@ function rcmail_user_prefs($current = null)
'main' => array('name' => Q(rcube_label('mainoptions'))),
'skin' => array('name' => Q(rcube_label('skin'))),
'browser' => array('name' => Q(rcube_label('browseroptions'))),
'advanced'=> array('name' => Q(rcube_label('advancedoptions'))),
);
// language selection
@ -367,6 +368,7 @@ function rcmail_user_prefs($current = null)
$blocks = array(
'main' => array('name' => Q(rcube_label('mainoptions'))),
'new_message' => array('name' => Q(rcube_label('newmessage'))),
'advanced' => array('name' => Q(rcube_label('advancedoptions'))),
);
// show config parameter for preview pane
@ -488,6 +490,7 @@ function rcmail_user_prefs($current = null)
case 'mailview':
$blocks = array(
'main' => array('name' => Q(rcube_label('mainoptions'))),
'advanced' => array('name' => Q(rcube_label('advancedoptions'))),
);
// show checkbox to open message view in new window
@ -543,7 +546,7 @@ function rcmail_user_prefs($current = null)
$field_id = 'rcmfd_default_charset';
$blocks['main']['options']['default_charset'] = array(
$blocks['advanced']['options']['default_charset'] = array(
'title' => html::label($field_id, Q(rcube_label('defaultcharset'))),
'content' => $RCMAIL->output->charset_selector(array(
'id' => $field_id, 'name' => '_default_charset', 'selected' => $config['default_charset']
@ -605,6 +608,7 @@ function rcmail_user_prefs($current = null)
'main' => array('name' => Q(rcube_label('mainoptions'))),
'sig' => array('name' => Q(rcube_label('signatureoptions'))),
'spellcheck' => array('name' => Q(rcube_label('spellcheckoptions'))),
'advanced' => array('name' => Q(rcube_label('advancedoptions'))),
);
// show checkbox to compose messages in a new window
@ -673,8 +677,7 @@ function rcmail_user_prefs($current = null)
$select->add(rcube_label('miscfolding'), 1);
$select->add(rcube_label('2047folding'), 2);
$blocks['main']['options']['mime_param_folding'] = array(
'advanced' => true,
$blocks['advanced']['options']['mime_param_folding'] = array(
'title' => html::label($field_id, Q(rcube_label('mimeparamfolding'))),
'content' => $select->show($config['mime_param_folding']),
);
@ -688,8 +691,7 @@ function rcmail_user_prefs($current = null)
$field_id = 'rcmfd_force_7bit';
$input = new html_checkbox(array('name' => '_force_7bit', 'id' => $field_id, 'value' => 1));
$blocks['main']['options']['force_7bit'] = array(
'advanced' => true,
$blocks['advanced']['options']['force_7bit'] = array(
'title' => html::label($field_id, Q(rcube_label('force7bit'))),
'content' => $input->show($config['force_7bit']?1:0),
);
@ -867,6 +869,7 @@ function rcmail_user_prefs($current = null)
case 'addressbook':
$blocks = array(
'main' => array('name' => Q(rcube_label('mainoptions'))),
'advanced' => array('name' => Q(rcube_label('advancedoptions'))),
);
if (!isset($no_override['default_addressbook'])
@ -963,6 +966,7 @@ function rcmail_user_prefs($current = null)
case 'folders':
$blocks = array(
'main' => array('name' => Q(rcube_label('mainoptions'))),
'advanced' => array('name' => Q(rcube_label('advancedoptions'))),
);
if (!isset($no_override['show_real_foldernames'])) {
@ -1043,6 +1047,7 @@ function rcmail_user_prefs($current = null)
$blocks = array(
'main' => array('name' => Q(rcube_label('mainoptions'))),
'maintenance' => array('name' => Q(rcube_label('maintenance'))),
'advanced' => array('name' => Q(rcube_label('advancedoptions'))),
);
if (!isset($no_override['read_when_deleted'])) {

@ -48,6 +48,26 @@
border-radius: 4px 4px 0 0;
}
#preferences-details fieldset.advanced legend {
position: relative;
display: block;
width: 100%;
cursor: pointer;
}
#preferences-details fieldset.advanced .propform {
display: none;
}
#preferences-details fieldset.advanced .advanced-toggle {
position: absolute;
top: 2px;
right: 6px;
text-decoration: none;
color: #666;
font-size: 11px;
}
#sections-table tbody td.section,
#settings-sections span.listitem a,
#settings-sections span.tablink a {

@ -195,6 +195,19 @@ function rcube_mail_ui()
new rcube_splitter({ id:'prefviewsplitter', p1:'#sectionslist', p2:'#preferences-box',
orientation:'v', relative:true, start:266, min:180, size:12 }).init();
}
else if (rcmail.env.action == 'edit-prefs') {
$('<a href="#toggle">&#9660;</a>')
.addClass('advanced-toggle')
.appendTo('#preferences-details fieldset.advanced legend');
$('#preferences-details fieldset.advanced legend').click(function(e){
var collapsed = $(this).hasClass('collapsed'),
toggle = $('.advanced-toggle', this).html(collapsed ? '&#9650;' : '&#9660;');
$(this)
.toggleClass('collapsed')
.closest('fieldset').children('.propform').toggle()
}).addClass('collapsed')
}
}
/*** addressbook task ***/
else if (rcmail.env.task == 'addressbook') {

Loading…
Cancel
Save