You are here

function video_preset_export_form in Video 7

Same name and namespace in other branches
  1. 7.2 modules/video_ui/video.preset.inc \video_preset_export_form()

The preset export form.

1 string reference to 'video_preset_export_form'
video_ui_menu in modules/video_ui/video_ui.module
Implementation of hook_menu().

File

modules/video_ui/video.preset.inc, line 590

Code

function video_preset_export_form($form, &$form_state, $preset) {

  // Unset the unnecessary elements.
  unset($preset['pid']);
  unset($preset['default']);

  // Get the code string representation.
  $code = var_export($preset, TRUE);

  // Make sure to format the arrays like drupal.
  $code = str_replace("=> \n  ", '=> ', $code);

  // Add the preset variable.
  $code = '$preset = ' . $code . ';';
  $lines = substr_count($code, "\n");
  $form['export'] = array(
    '#title' => t('Export Preset'),
    '#type' => 'textarea',
    '#value' => $code,
    '#rows' => $lines,
    '#description' => t('Copy the export text and paste it into another preset using the import function.'),
  );

  // Return the form.
  return $form;
}