You are here

function ctools_export_form in Chaos Tool Suite (ctools) 7

Same name and namespace in other branches
  1. 6 includes/export.inc \ctools_export_form()

Provide a form for displaying an export.

This is a simple form that should be invoked like this:

$output = drupal_get_form('ctools_export_form', $code, $object_title);
2 string references to 'ctools_export_form'
bulk_export_export in bulk_export/bulk_export.module
FAPI gateway to the bulk exporter.
ctools_export_ui::export_page in plugins/export_ui/ctools_export_ui.class.php
Page callback to display export information for an exportable item.

File

includes/export.inc, line 1138
Contains code to make it easier to have exportable objects.

Code

function ctools_export_form($form, &$form_state, $code, $title = '') {
  $lines = substr_count($code, "\n");
  $form['code'] = array(
    '#type' => 'textarea',
    '#title' => $title,
    '#default_value' => $code,
    '#rows' => $lines,
  );
  return $form;
}