You are here

function theme_feeds_ui_overview_form in Feeds 7.2

Same name and namespace in other branches
  1. 8.2 feeds_ui/feeds_ui.admin.inc \theme_feeds_ui_overview_form()
  2. 6 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 912
Contains all page callbacks, forms and theming functions for Feeds administrative pages.

Code

function theme_feeds_ui_overview_form($variables) {
  $form = $variables['form'];
  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' => array(
              $type,
            ),
          );
        }
        $rows[] = array(
          'data' => $row,
          'class' => array(
            $type,
          ),
        );
      }
    }
  }
  $output = theme('table', array(
    'header' => $form['#header'],
    'rows' => $rows,
    'attributes' => array(
      'class' => array(
        'feeds-admin-importers',
      ),
    ),
    'empty' => t('No importers available.'),
  ));
  if (!empty($rows)) {
    $output .= drupal_render_children($form);
  }
  return $output;
}