You are here

function macro_get_macro_yaml in Macro 7

As macro_get_macro, but the output is a YAML file

Return value

YAML string representation of the recorded macro.

File

./macro.module, line 303
allow administrators to record (export) form submissions allow administrators to replay (import) form submissions

Code

function macro_get_macro_yaml() {
  $subs = variable_get('macro_submissions', array());
  include_once libraries_get_path('spyc') . '/spyc.php';
  $yaml = '';
  $Spyc = new Spyc();

  // Create a String from the YAML array
  foreach ($subs as $sub) {
    if (!empty($sub['values'])) {
      $yaml .= $Spyc
        ->dump($sub['values'], 2, 60);
      $yaml .= '---';
    }
  }
  return $yaml;
}