You are here

public static function GatherContentPages::pageImportForm in GatherContent 7

Generate tableselect rows.

1 call to GatherContentPages::pageImportForm()
gathercontent_import_pages in ./gathercontent.module
Import wizard step 3: Import pages.

File

./gathercontent_pages.inc, line 113
Class to fetch pages from GatherContent and turn them into Drupal nodes.

Class

GatherContentPages
@file Class to fetch pages from GatherContent and turn them into Drupal nodes.

Code

public static function pageImportForm($pages, $options, $index = -1) {
  $index++;
  if (isset($pages)) {
    foreach ($pages as $id => $page) {
      $options['gc_page_id_' . $id] = array(
        'title' => array(
          'data' => array(
            '#markup' => theme('indentation', array(
              'size' => $index,
            )) . $page->name,
            '#title' => check_plain($page->name),
          ),
        ),
      );

      // If the page has children, call this function recursively, so the
      // children are added to the form as well.
      if (isset($page->children) && count($page->children) > 0) {
        $options = GatherContentPages::pageImportForm($page->children, $options, $index);
      }
    }
    return $options;
  }
}