You are here

function _webform2pdf_list_template_vars in Webform2PDF 6.2

Same name and namespace in other branches
  1. 6 webform2pdf.module \_webform2pdf_list_template_vars()
2 calls to _webform2pdf_list_template_vars()
webform2pdf_edit_form in includes/webform2pdf.settings.inc
Overview form of all components for this webform.
_webform2pdf_get_template_vars in ./webform2pdf.module

File

./webform2pdf.module, line 231

Code

function _webform2pdf_list_template_vars($node) {
  $tokens = array();
  foreach ($node->webform['components'] as $component) {
    switch ($component['type']) {
      case 'select':
        $tokens[] = '%' . $component['form_key'];
        $tokens[] = '%' . $component['form_key'] . '-all';
        $tokens[] = '%' . $component['form_key'] . '-nl';
        $tokens[] = '%' . $component['form_key'] . '-all-nl';
        break;
      case 'number':
      case 'email':
      case 'date':
      case 'time':
      case 'hidden':
      case 'textarea':
      case 'textfield':
      case 'grid':
        $tokens[] = '%' . $component['form_key'];
        break;

      // markup', 'pagebreak', etc.
      default:

        // calling _hook_webform2pdf_list_template_vars hivas, support of extra types
        foreach (module_list() as $module) {
          $function = '_' . $module . '_webform2pdf_list_template_vars';
          if (function_exists($function)) {
            $function($component, $tokens);
          }
        }
        break;
    }
  }
  $tokens[] = '%nid';
  $tokens[] = '%sid';
  return $tokens;
}