function tablesort_header

cis7 tablesort.inc tablesort_header($cell, $header, $ts)
cle7 tablesort.inc tablesort_header($cell, $header, $ts)
elmsmedia7 tablesort.inc tablesort_header($cell, $header, $ts)
icor7 tablesort.inc tablesort_header($cell, $header, $ts)
meedjum_blog7 tablesort.inc tablesort_header($cell, $header, $ts)
mooc7 tablesort.inc tablesort_header($cell, $header, $ts)

Formats a column header.

If the cell in question is the column header for the current sort criterion, it gets special formatting. All possible sort criteria become links.

Parameters

$cell: The cell to format.

$header: An array of column headers in the format described in theme_table().

$ts: The current table sort context as returned from tablesort_init().

Return value

A properly formatted cell, ready for _theme_table_cell().

4 calls to tablesort_header()
responsive_tables_theme_table in sites/all/modules/local_contrib/responsive_tables/responsive_tables.module
Overrides theme_table() with responsive support.
template_preprocess_forum_topic_list in modules/forum/forum.module
Preprocesses variables for forum-topic-list.tpl.php.
template_preprocess_views_data_export_msoffice_header in sites/all/modules/local_contrib/views_data_export/theme/views_data_export.theme.inc
theme_table in includes/theme.inc
Returns HTML for a table.

File

includes/tablesort.inc, line 133
Functions to aid in the creation of sortable tables.

Code

function tablesort_header($cell, $header, $ts) {
  // Special formatting for the currently sorted column header.
  if (is_array($cell) && isset($cell['field'])) {
    $title = t('sort by @s', array('@s' => $cell['data']));
    if ($cell['data'] == $ts['name']) {
      $ts['sort'] = (($ts['sort'] == 'asc') ? 'desc' : 'asc');
      $cell['class'][] = 'active';
      $image = theme('tablesort_indicator', array('style' => $ts['sort']));
    }
    else {
      // If the user clicks a different header, we want to sort ascending initially.
      $ts['sort'] = 'asc';
      $image = '';
    }
    $cell['data'] = l($cell['data'] . $image, $_GET['q'], array('attributes' => array('title' => $title), 'query' => array_merge($ts['query'], array('sort' => $ts['sort'], 'order' => $cell['data'])), 'html' => TRUE));

    unset($cell['field'], $cell['sort']);
  }
  return $cell;
}
Error | ELMSLN API

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.