You are here

function feeds_tamper_export in Feeds Tamper 7

Exports a list of Feeds Tamper plugins to code.

Parameters

string $importer_id: The id of the importer to export plugins for.

string $indent: The level of indentation. Defaults to no indentation.

Return value

string An exported list of plugins.

1 call to feeds_tamper_export()
feeds_tamper_ui_export_form in feeds_tamper_ui/feeds_tamper_ui.admin.inc
Export form.

File

./feeds_tamper.module, line 163
Feeds Tamper - basic API functions and hook implementations.

Code

function feeds_tamper_export($importer_id, $indent = '') {
  ctools_include('export');
  $result = ctools_export_load_object('feeds_tamper', 'conditions', array(
    'importer' => $importer_id,
  ));
  if (!empty($result)) {
    $output = array(
      '$export = array();' . "\n",
    );
    foreach ($result as $object) {
      $output[] = ctools_export_object('feeds_tamper', $object, $indent);
      $output[] = '$export[$feeds_tamper->id] = $feeds_tamper;' . "\n";
    }
    return trim(implode("\n", $output));
  }
}