You are here

function theme_gathercontent_pages_import_form in GatherContent 7.2

Form theme handler for gathercontent_pages_import_form().

File

includes/pages_import.inc, line 111
Contains page field mapping form.

Code

function theme_gathercontent_pages_import_form($variables) {
  $obj = gathercontent_get_obj();
  $form = $variables['form'];
  $rows = array();
  foreach (element_children($form['page_list']) as $id) {
    $rows[] = array(
      'data' => array(
        drupal_render($form['page_list'][$id]['page_state']),
        array(
          'data' => drupal_render($form['page_list'][$id]['page_name']),
          'class' => 'page-name',
        ),
        array(
          'data' => drupal_render($form['pages'][$id]),
          'class' => 'gc_checkbox',
        ),
      ),
      'no_striping' => TRUE,
    );
    $class = '';
    if (isset($form['settings'][$id]['fields'])) {
      $class = 'gc_settings_container';
    }
    $rows[] = array(
      'data' => array(
        array(
          'data' => drupal_render($form['settings'][$id]),
          'colspan' => 3,
          'class' => array(
            $class,
          ),
        ),
      ),
      'no_striping' => TRUE,
      'data-page-id' => $id,
      'data-parent-id' => $obj
        ->getParentId($id),
    );
  }
  $header = array(
    array(
      'data' => '',
      'class' => 'page-state',
    ),
    array(
      'data' => t('Pages'),
      'class' => 'page-name',
    ),
    '<input type="checkbox" class="gc_toggle_all" />',
  );
  $output = drupal_render($form['modals']);
  $output .= drupal_render($form['page_header']);
  $output .= drupal_render($form['page_options']);
  $output .= theme('table', array(
    'header' => $header,
    'rows' => $rows,
    'attributes' => array(
      'id' => 'gc_pagelist',
    ),
    'empty' => t('No pages available.'),
  ));
  $output .= drupal_render_children($form);
  return $output;
}