You are here

function theme_feeds_ui_overview_form in Feeds 6

Same name and namespace in other branches
  1. 8.2 feeds_ui/feeds_ui.admin.inc \theme_feeds_ui_overview_form()
  2. 7.2 feeds_ui/feeds_ui.admin.inc \theme_feeds_ui_overview_form()
  3. 7 feeds_ui/feeds_ui.admin.inc \theme_feeds_ui_overview_form()

Theme feeds_ui_overview_form().

File

feeds_ui/feeds_ui.admin.inc, line 652
Contains all page callbacks, forms and theming functions for Feeds administrative pages.

Code

function theme_feeds_ui_overview_form($form) {
  drupal_add_js(drupal_get_path('module', 'feeds_ui') . '/feeds_ui.js');
  drupal_add_css(drupal_get_path('module', 'feeds_ui') . '/feeds_ui.css');

  // Iterate through all importers and build a table.
  $rows = array();
  foreach (array(
    'enabled',
    'disabled',
  ) as $type) {
    if (isset($form[$type])) {
      foreach (element_children($form[$type]) as $id) {
        $row = array();
        foreach (element_children($form[$type][$id]) as $col) {
          $row[$col] = array(
            'data' => drupal_render($form[$type][$id][$col]),
            'class' => $type,
          );
        }
        $rows[] = array(
          'data' => $row,
          'class' => $type,
        );
      }
    }
  }
  $is_empty = empty($rows);
  if ($is_empty) {
    $rows[] = array(
      array(
        'data' => t('No importers available.'),
        'colspan' => 6,
      ),
    );
  }
  $output = theme('table', $form['#header'], $rows, array(
    'class' => 'feeds-admin-importers',
  ));
  if (!$is_empty) {
    $output .= drupal_render($form);
  }
  return $output;
}