You are here

function hook_webform_submission_actions in Webform 7.3

Same name and namespace in other branches
  1. 6.3 webform.api.php \hook_webform_submission_actions()
  2. 7.4 webform.api.php \hook_webform_submission_actions()

Provide a list of actions that can be executed on a submission.

Some actions are displayed in the list of submissions such as edit, view, and delete. All other actions are displayed only when viewing the submission. These additional actions may be specified in this hook. Examples included directly in the Webform module include PDF, print, and resend e-mails. Other modules may extend this list by using this hook.

Parameters

$node: The Webform node on which this submission was made.

$submission: The Webform submission on which the actions may be performed.

Related topics

1 function implements hook_webform_submission_actions()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

webform_webform_submission_actions in ./webform.module
Implements hook_webform_webform_submission_actions().
2 invocations of hook_webform_submission_actions()
template_preprocess_webform_submission_information in includes/webform.submissions.inc
Preprocess function for webform-submission-navigation.tpl.php.
webform_submission_page in includes/webform.submissions.inc
Menu callback; Present a Webform submission page for display or editing.

File

./webform.api.php, line 198
Sample hooks demonstrating usage in Webform.

Code

function hook_webform_submission_actions($node, $submission) {
  if (webform_results_access($node)) {
    $actions['myaction'] = array(
      'title' => t('Do my action'),
      'href' => 'node/' . $node->nid . '/submission/' . $submission->sid . '/myaction',
      'query' => drupal_get_destination(),
    );
  }
  return $actions;
}