Group settings boxes together in floating blocks for better layout

release-0.6
thomascube 16 years ago
parent 58687d011f
commit 35c31ed638

@ -669,6 +669,16 @@ class html_table extends html
unset($this->attrib['cols'], $this->attrib['rowsonly']);
return parent::show();
}
/**
* Count number of rows
*
* @return The number of rows
*/
public function size()
{
return count($this->rows);
}
}
?>

@ -25,9 +25,9 @@ if (!$OUTPUT->ajax_call)
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');
@ -36,6 +36,22 @@ function rcmail_user_prefs_form($attrib)
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
@ -51,7 +67,6 @@ function rcmail_user_prefs_form($attrib)
$table->add(null, $select_lang->show($RCMAIL->user->language));
}
// show page size selection
if (!isset($no_override['timezone'])) {
$field_id = 'rcmfd_timezone';
@ -144,8 +159,13 @@ function rcmail_user_prefs_form($attrib)
}
}
$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'])) {
@ -196,8 +216,13 @@ function rcmail_user_prefs_form($attrib)
$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
@ -229,8 +254,13 @@ function rcmail_user_prefs_form($attrib)
$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
@ -265,8 +295,13 @@ function rcmail_user_prefs_form($attrib)
$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);
@ -294,9 +329,13 @@ function rcmail_user_prefs_form($attrib)
$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'])) {
@ -342,11 +381,17 @@ function rcmail_user_prefs_form($attrib)
$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)

@ -58,13 +58,6 @@ span.tablink-selected a
width: expression((parseInt(document.documentElement.clientWidth)-40)+'px');
}
#userprefs-box fieldset
{
float: left;
margin-right: 14px;
width: 520px;
}
#userprefs-box table td.title
{
color: #666666;
@ -77,6 +70,13 @@ span.tablink-selected a
display: none;
}
.userprefs-block
{
float: left;
margin-right: 14px;
width: 520px;
}
#identities-list,
#folder-manager
{

@ -12,11 +12,18 @@
<roundcube:include file="/includes/header.html" />
<roundcube:include file="/includes/settingstabs.html" />
<form name="form" action="./" method="post">
<div id="userprefs-box">
<div id="userprefs-title"><roundcube:label name="userpreferences" /></div>
<div style="padding:15px 0 15px 15px">
<roundcube:object name="userprefs">
<div class="userprefs-block">
<roundcube:object name="userprefs" form="form" parts="general,mailbox,mailview" />
</div>
<div class="userprefs-block">
<roundcube:object name="userprefs" form="form" parts="compose,folders,server" />
</div>
<div style="clear:left"></div>
</div>
</div>
@ -25,6 +32,8 @@
<roundcube:button command="save" type="input" class="button mainaction" label="save" />
</p>
</form>
<div class="advswitch">
<label for="advswitch"><roundcube:label name="advancedoptions"></label>
<input type="checkbox" id="advswitch" name="_advanced" value="0" onclick="rcube_show_advanced(this.checked)" />

Loading…
Cancel
Save