You are here

function recipe_import_element_start in Recipe 6

Same name and namespace in other branches
  1. 7.2 modules/recipe_recipeML.module \recipe_import_element_start()
  2. 7 includes/recipe_recipeML.module \recipe_import_element_start()

Call-back function used by the XML parser.

1 string reference to 'recipe_import_element_start'
recipe_recipeML_import_form_submit in plugins/recipe_recipeML.module

File

plugins/recipe_recipeML.module, line 236
recipe_recipeML.module - Enables importing and exporting of recipeML format recipes.

Code

function recipe_import_element_start($parser, $name, $attributes) {
  global $recipe, $yield, $ingredient, $preptime;
  switch ($name) {
    case 'RECIPE':
      $recipe = new stdClass();
      $recipe->type = "recipe";

      // Let's allow comments by default.
      $recipe->comment = 2;
      $recipe->_categories = array();
      break;
    case 'ING':
      $ingredient = array();
      break;
    case 'YIELD':
      $yield = TRUE;
      break;
    case 'PREPTIME':
      $preptime = TRUE;
      break;
  }
}