You are here

function webform_get_view in Webform 7.4

Returns the most appropriate view for this webform node.

Site builders can customize the view that webform uses by webform node id or by webform content type. For example, use webform_results_123 to for node id 123 or webform_results_my_content_type for a node of type my_content_type.

Parameters

object $node: Loaded webform node.

string $view_id: The machine_id of the view, such as webform_results or webform_submissions.

Return value

object|null The loaded view.

3 calls to webform_get_view()
webform_results_analysis in includes/webform.report.inc
Provides a simple analysis of all submissions to a webform.
webform_results_submissions in includes/webform.report.inc
Retrieve lists of submissions for a given webform.
webform_results_table in includes/webform.report.inc
Create a table containing all submitted values for a webform node.

File

includes/webform.report.inc, line 121
This file includes helper functions for creating reports for webform.module.

Code

function webform_get_view($node, $view_id) {
  foreach (array(
    "{$view_id}_{$node->nid}",
    "{$view_id}_{$node->type}",
    $view_id,
  ) as $id) {
    $view = views_get_view($id);
    if ($view) {
      return $view;
    }
  }
}