You are here

function spaces_preset_export in Spaces 6

Same name and namespace in other branches
  1. 6.3 spaces.module \spaces_preset_export()
  2. 6.2 spaces_admin.inc \spaces_preset_export()
  3. 7.3 spaces.module \spaces_preset_export()
  4. 7 spaces.module \spaces_preset_export()

Form for exporting a spaces preset.

1 string reference to 'spaces_preset_export'
spaces_menu in ./spaces.module
Implementation of hook_menu().

File

./spaces_admin.inc, line 324

Code

function spaces_preset_export(&$form_state, $type, $id) {

  // Get the preset definition
  $presets = spaces_presets($type);
  $preset = $presets[$id];
  $preset['type'] = $type;
  unset($preset['disabled']);

  // Do some niceties to the export
  $export = var_export($preset, true);
  $export = '$items[\'' . $id . '\'] = ' . $export . ';';

  // Build the form
  $form = array();
  $form['export'] = array(
    '#type' => 'textarea',
    '#rows' => 20,
    '#default_value' => $export,
  );
  return $form;
}