thomascube
2008-12-16 35c31ed638d2b7d9b1c803e5a47aab7771cfe730
Group settings boxes together in floating blocks for better layout

4 files modified
100 ■■■■ changed files
program/include/html.php 10 ●●●●● patch | view | raw | blame | history
program/steps/settings/func.inc 65 ●●●● patch | view | raw | blame | history
skins/default/settings.css 14 ●●●● patch | view | raw | blame | history
skins/default/templates/settings.html 11 ●●●●● patch | view | raw | blame | history
program/include/html.php
@@ -669,6 +669,16 @@
        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);
    }
}
?>
program/steps/settings/func.inc
@@ -25,9 +25,9 @@
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 @@
  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
@@ -50,7 +66,6 @@
    $table->add('title', html::label($field_id, Q(rcube_label('language'))));
    $table->add(null, $select_lang->show($RCMAIL->user->language));
  }
  // show page size selection
  if (!isset($no_override['timezone'])) {
@@ -144,8 +159,13 @@
    }
  }
  $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 @@
    $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 @@
    $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 @@
    $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 @@
      $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 @@
    $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)
skins/default/settings.css
@@ -58,13 +58,6 @@
  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 @@
  display: none;
}
.userprefs-block
{
  float: left;
  margin-right: 14px;
  width: 520px;
}
#identities-list,
#folder-manager
{
skins/default/templates/settings.html
@@ -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)" />