You are here

function spaces_preset_export in Spaces 6.2

Same name and namespace in other branches
  1. 6.3 spaces.module \spaces_preset_export()
  2. 6 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 273

Code

function spaces_preset_export(&$form_state, $type, $id) {
  module_load_include('inc', 'features', 'features.export');

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

  // Clear out extraneous flags
  unset($preset['disabled']);
  unset($preset['storage']);

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

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