You are here

function recipe_import_form_build_preview in Recipe 6

Same name and namespace in other branches
  1. 7.2 recipe.admin.inc \recipe_import_form_build_preview()
  2. 7 recipe.module \recipe_import_form_build_preview()

Import preview routine that allows that users to see what actually will be imported before doing so.

1 string reference to 'recipe_import_form_build_preview'
recipe_import_form in ./recipe.module
Form recipe_import_form

File

./recipe.module, line 1462
recipe.module - share recipes

Code

function recipe_import_form_build_preview($form, &$form_state) {
  drupal_add_css(drupal_get_path('module', 'recipe') . '/recipe.css');
  $parsed_recipe_object = recipe_import_parse($form, $form_state);
  if ($parsed_recipe_object != FALSE) {

    //$node = node_form_submit_build_node($form, $form_state);
    $node = recipe_import_get_node($parsed_recipe_object);
    $cloned_node = drupal_clone($node);
    $cloned_node->build_mode = NODE_BUILD_PREVIEW;
    $form_state['node_preview'] = theme('node_preview', $cloned_node);
    $form_state['rebuild'] = TRUE;
    drupal_set_title(t('Preview'));
  }
}