You are here

function data_ui_compare in Data 7

Same name and namespace in other branches
  1. 6 data_ui/data_ui.admin.inc \data_ui_compare()

Comparison page.

1 string reference to 'data_ui_compare'
data_ui_menu in data_ui/data_ui.module
Implements hook_menu().

File

data_ui/data_ui.admin.inc, line 92
Admin UI functions.

Code

function data_ui_compare() {
  $rows = array();
  $tables = data_get_all_tables();
  foreach ($tables as $table) {
    $row = array();
    $comp = $table
      ->compareSchema();
    $row[] = check_plain($table
      ->get('name'));
    $status = $comp['status'];
    if ($status != 'same') {
      $status .= ' - ' . l(t('adjust'), 'admin/structure/data/compare/' . $table
        ->get('name'));
    }
    $row[] = $status;
    $row[] = empty($comp['warning']) ? '-' : $comp['warning'];
    $rows[] = $row;
  }
  $header = array(
    t('Name'),
    t('Status'),
    t('Warnings'),
  );
  return theme('table', array(
    'header' => $header,
    'rows' => $rows,
  ));
}