You are here

function theme_migrate_dashboard in Migrate 6

Theme function for dashboard page

1 string reference to 'theme_migrate_dashboard'
migrate_theme in ./migrate.module
Implementation of hook_theme().

File

./migrate_pages.inc, line 307

Code

function theme_migrate_dashboard($form) {
  $output = drupal_render($form['description']);
  if (isset($form['data']) && is_array($form['data'])) {
    foreach (element_children($form['data']) as $rownum) {
      $row = array();
      foreach (element_children($form['data'][$rownum]) as $colname) {
        if ($colname == 'clearing' || $colname == 'importing') {
          $row[] = drupal_render($form[$colname][$form['data'][$rownum]['mcsid']['#value']]);

          // Throw out the column contents
          drupal_render($form['data'][$rownum][$colname]);
          drupal_render($form['data'][$rownum]['mcsid']);
        }
        elseif ($colname == 'status' || $colname == 'mcsid') {
          drupal_render($form['data'][$rownum][$colname]);
        }
        else {
          $row[] = drupal_render($form['data'][$rownum][$colname]);
        }
      }

      // Highlight any process currently running
      if ($form['data'][$rownum]['status']['#value']) {
        $rows[] = array(
          'data' => $row,
          'class' => 'migrate-running',
        );
      }
      else {
        $rows[] = $row;
      }
    }
  }
  $header = $form['header']['#value'];
  if (empty($rows)) {
    $rows[] = array(
      array(
        'data' => t('No data in the table.'),
        'colspan' => count($header),
      ),
    );
  }
  $output .= theme('table', $header, $rows, array(
    'class' => 'migrate-dashboard',
  ));
  $output .= drupal_render($form);
  return $output;
}