You are here

function webform_results in Webform 5

Same name and namespace in other branches
  1. 5.2 webform.module \webform_results()

Menu callback for all content under admin/content/webform.

1 string reference to 'webform_results'
webform_menu in ./webform.module
Implementation of hook_menu().

File

./webform.module, line 1794

Code

function webform_results() {
  include_once drupal_get_path('module', 'webform') . "/webform.inc";
  include_once drupal_get_path('module', 'webform') . "/webform_report.inc";
  $nid = arg(1);
  $node = node_load($nid);
  drupal_set_title(check_plain($node->title));
  if (arg(2) == 'results') {
    switch (arg(3)) {
      case 'analysis':
        $content = _webform_results_analysis($nid);
        break;
      case 'clear':
        $content = drupal_get_form('_webform_results_clear', $nid);
        break;
      case 'delete':
        $sid = arg(4);
        $content = drupal_get_form('_webform_submission_delete', $nid, $sid);
        break;
      case 'table':
        $content = _webform_results_table($nid);
        break;
      case 'download':
        $content = _webform_results_download($nid);
        break;
      case 'edit':
        $sid = arg(4);
        $content = webform_submission_edit($node, $sid);
        break;
      case 'view':
        $sid = arg(4);
        $content = webform_submission_view($node, $sid);
        break;
      case 'submissions':
      default:
        $content = _webform_results_submissions($nid);
        break;
    }
    return $content;
  }
}