'fieldset', '#title' => 'Migrate to Tripal v3', '#description' => t('The following Tripal v2 content types are available. Select the content type to migrate.'), ); // Migrate all checkbox $form['field']['all'] = array( '#type' => 'checkbox', '#title' => 'All', '#description' => 'All of the following content types' ); // Get all available Tripal v2 chado tables $sql = "SELECT table_name FROM information_schema.tables WHERE table_schema = 'public' AND table_name LIKE 'chado_%'"; $result = db_query($sql); $tables = array(); while ($field = $result->fetchField()) { array_push($tables, $field); } // List all available Tripal v2 content types $result = db_select('node_type', 'nt') ->fields('nt', array('type', 'name', 'description')) ->condition('type', 'chado_%', 'LIKE') ->execute(); while ($obj = $result->fetchObject()) { if (in_array($obj->type, $tables)) { $form['field'][$obj->type] = array( '#type' => 'checkbox', '#title' => $obj->name, '#description' => $obj->description, ); } } $form['migrate_btn'] = array( '#type' => 'submit', '#name' => 'migrate_btn', '#value' => 'migrate', ); $form['#prefix'] = '