alecpl
2011-10-24 b407e797c20f8d06a85fc90a831f9a8ec6237298
program/include/main.inc
@@ -705,13 +705,14 @@
 * @param  int   Source to get value from (GPC)
 * @return array Hash array with all request parameters
 */
function request2param($mode = RCUBE_INPUT_GPC)
function request2param($mode = RCUBE_INPUT_GPC, $ignore = 'task|action')
{
  $out = array();
  $src = $mode == RCUBE_INPUT_GET ? $_GET : ($mode == RCUBE_INPUT_POST ? $_POST : $_REQUEST);
  foreach ($src as $key => $value) {
    $fname = $key[0] == '_' ? substr($key, 1) : $key;
    $out[$fname] = get_input_value($key, $mode);
    if ($ignore && !preg_match("/($ignore)/", $fname))
      $out[$fname] = get_input_value($key, $mode);
  }
  
  return $out;
@@ -771,52 +772,48 @@
 * @return string HTML table code
 */
function rcube_table_output($attrib, $table_data, $a_show_cols, $id_col)
  {
{
  global $RCMAIL;
  $table = new html_table(/*array('cols' => count($a_show_cols))*/);
  // add table header
  if (!$attrib['noheader'])
    foreach ($a_show_cols as $col)
      $table->add_header($col, Q(rcube_label($col)));
  $c = 0;
  if (!is_array($table_data))
  if (!is_array($table_data))
  {
    $db = $RCMAIL->get_dbh();
    while ($table_data && ($sql_arr = $db->fetch_assoc($table_data)))
    {
      $zebra_class = $c % 2 ? 'even' : 'odd';
      $table->add_row(array('id' => 'rcmrow' . html_identifier($sql_arr[$id_col]), 'class' => $zebra_class));
      $table->add_row(array('id' => 'rcmrow' . html_identifier($sql_arr[$id_col])));
      // format each col
      foreach ($a_show_cols as $col)
        $table->add($col, Q($sql_arr[$col]));
      $c++;
    }
  }
  else
  {
  else {
    foreach ($table_data as $row_data)
    {
      $zebra_class = $c % 2 ? 'even' : 'odd';
      if (!empty($row_data['class']))
        $zebra_class .= ' '.$row_data['class'];
      $class = !empty($row_data['class']) ? $row_data['class'] : '';
      $table->add_row(array('id' => 'rcmrow' . html_identifier($row_data[$id_col]), 'class' => $zebra_class));
      $table->add_row(array('id' => 'rcmrow' . html_identifier($row_data[$id_col]), 'class' => $class));
      // format each col
      foreach ($a_show_cols as $col)
        $table->add($col, Q(is_array($row_data[$col]) ? $row_data[$col][0] : $row_data[$col]));
      $c++;
    }
  }
  return $table->show($attrib);
  }
}
/**
@@ -1037,7 +1034,7 @@
  if (empty($ts))
    return '';
  // get user's timezone
  // get user's timezone offset
  $tz = $RCMAIL->config->get_timezone();
  // convert time to user's timezone
@@ -1213,9 +1210,9 @@
    $p['folder_name'] = '*';
  if ($p['unsubscribed'])
    $list = $RCMAIL->imap->list_unsubscribed('', $p['folder_name'], $p['folder_filter']);
    $list = $RCMAIL->imap->list_unsubscribed('', $p['folder_name'], $p['folder_filter'], $p['folder_rights']);
  else
    $list = $RCMAIL->imap->list_mailboxes('', $p['folder_name'], $p['folder_filter']);
    $list = $RCMAIL->imap->list_mailboxes('', $p['folder_name'], $p['folder_filter'], $p['folder_rights']);
  $delimiter = $RCMAIL->imap->get_hierarchy_delimiter();
@@ -1313,7 +1310,6 @@
  $idx = 0;
  $out = '';
  foreach ($arrFolders as $key => $folder) {
    $zebra_class = (($nestLevel+1)*$idx) % 2 == 0 ? 'even' : 'odd';
    $title = null;
    if (($folder_class = rcmail_folder_classname($folder['id'])) && !$realnames) {
@@ -1348,8 +1344,6 @@
      $classes[] = 'inbox';
    else
      $classes[] = '_'.asciiwords($folder_class ? $folder_class : strtolower($folder['id']), true);
    $classes[] = $zebra_class;
    if ($folder['id'] == $mbox_name)
      $classes[] = 'selected';
@@ -2384,5 +2378,5 @@
    $RCMAIL->output->set_env('autocomplete_max', (int)$RCMAIL->config->get('autocomplete_max', 15));
    $RCMAIL->output->set_env('autocomplete_min_length', $RCMAIL->config->get('autocomplete_min_length'));
    $RCMAIL->output->add_label('autocompletechars');
    $RCMAIL->output->add_label('autocompletechars', 'autocompletemore');
}