You are here

function library_get_table_header in Library 7

Same name and namespace in other branches
  1. 5.2 library.module \library_get_table_header()
  2. 6.2 library.module \library_get_table_header()
  3. 6 library.module \library_get_table_header()

Builds a table header for a list of items.

Return value

array Array containing title, header, quantity and status if globally set.

1 call to library_get_table_header()
library_display_items in ./library.pages.inc
Display all library items.

File

./library.module, line 1281

Code

function library_get_table_header() {
  $results = array();
  $display_cat_var = FALSE;
  foreach (variable_get('library_taxonomy_display', array()) as $key => $vocab) {
    if ($vocab) {
      $display_cat_var = TRUE;
    }
  }
  $results['display_categories'] = module_exists('taxonomy') && $display_cat_var;
  $results['display_status'] = variable_get('library_list_status_display', 0) == 1;
  $results['display_quantity'] = variable_get('library_quantity_display', 0) == 1;
  $header[]['data'] = t('Title');
  if ($results['display_categories']) {
    $header[]['data'] = t('Categories');
  }
  if ($results['display_quantity']) {
    $header[]['data'] = t('Quantity');
  }
  if ($results['display_status']) {
    $header[]['data'] = t('Status');
  }
  $results['header'] = $header;
  return $results;
}