You are here

function template_preprocess_webform_form in Webform 6.3

Same name and namespace in other branches
  1. 6.2 webform.module \template_preprocess_webform_form()
  2. 7.4 webform.module \template_preprocess_webform_form()
  3. 7.3 webform.module \template_preprocess_webform_form()

Prepare for theming of the webform form.

File

./webform.module, line 2524

Code

function template_preprocess_webform_form(&$vars) {
  drupal_add_css(drupal_get_path('module', 'webform') . '/css/webform.css');
  drupal_add_js(drupal_get_path('module', 'webform') . '/js/webform.js');
  if (isset($vars['form']['details']['nid']['#value'])) {
    $vars['nid'] = $vars['form']['details']['nid']['#value'];
  }
  elseif (isset($vars['form']['submission']['#value'])) {
    $vars['nid'] = $vars['form']['submission']['#value']->nid;
  }
}