You are here

function recipe_recipeML_export_multi in Recipe 7.2

Same name and namespace in other branches
  1. 6 plugins/recipe_recipeML.module \recipe_recipeML_export_multi()
  2. 7 includes/recipe_recipeML.module \recipe_recipeML_export_multi()
1 string reference to 'recipe_recipeML_export_multi'
recipe_recipeML_recipeio in modules/recipe_recipeML.module
Implements hook_recipeio().

File

modules/recipe_recipeML.module, line 37
Enables importing and exporting of recipeML format recipes.

Code

function recipe_recipeML_export_multi() {
  $o = '<?xml version="1.0" encoding="UTF-8"?>' . "\n" . '<!DOCTYPE recipeml PUBLIC "-//FormatData//DTD RecipeML 0.5//EN" "http://www.formatdata.com/recipeml/recipeml.dtd">' . "\n" . '<recipeml version="0.5" generator="http://drupal.org/project/recipe">' . "\n";

  // you should not be able to export unpublished recipes
  $result = db_query("SELECT n.nid from {node} n WHERE n.type='recipe' and n.status>0 ORDER BY n.title");
  foreach ($result as $record) {
    $o .= recipe_recipeML_export_single($record->nid, NULL, FALSE);
  }
  $o .= '</recipeml>';
  drupal_add_http_header('Content-type', 'text/xml; charset=utf-8');
  print $o;
}