You are here

function recipe_mastercook4_recipeio in Recipe 6

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

Implementation of hook_recipeio($type).

File

plugins/recipe_mastercook4.module, line 12
recipe_mastercook4.module - Enables importing and exporting of MasterCook4 format recipes.

Code

function recipe_mastercook4_recipeio($type) {
  $supported = array(
    'import_single' => array(
      'format_name' => t('MasterCook4'),
      'callback' => 'recipe_mastercook4_import_single',
      'format_help' => '',
    ),
    'export_single' => array(
      'format_name' => t('MasterCook4'),
      'callback' => 'recipe_mastercook4_export_single',
      'format_help' => t('Export to a recipe to a MasterCook(1-4 .mxp) based text format.'),
    ),
    'export_multi' => array(
      'format_name' => t('MasterCook4'),
      'callback' => 'recipe_mastercook4_export_multi',
      'format_help' => t('Export all recipes to a MasterCook(1-4 .mxp) based text format.'),
    ),
    'import_multi' => array(
      'format_name' => t('MasterCook4'),
      'callback' => 'recipe_mastercook4_import_multi',
      'format_help' => t('Import recipes from a MasterCook(1-4 .mxp) based text file.'),
    ),
  );
  if (isset($supported[$type])) {
    return array(
      'mastercook4' => $supported[$type],
    );
  }
  else {
    return FALSE;
  }
}