You are here

function webform_menu_email_load in Webform 7.4

Same name and namespace in other branches
  1. 6.3 webform.module \webform_menu_email_load()
  2. 7.3 webform.module \webform_menu_email_load()

Menu loader callback. Load a webform e-mail if the given eid is a valid.

File

./webform.module, line 520
This module provides a simple way to create forms and questionnaires.

Code

function webform_menu_email_load($eid, $nid) {
  module_load_include('inc', 'webform', 'includes/webform.emails');
  $node = node_load($nid);
  $email = webform_email_load($eid, $nid);
  if ($eid == 'new') {
    if (isset($_GET['option']) && isset($_GET['email'])) {
      $type = $_GET['option'];
      if ($type == 'custom') {
        $email['email'] = $_GET['email'];
      }
      elseif ($type == 'component' && isset($node->webform['components'][$_GET['email']])) {
        $email['email'] = $_GET['email'];
      }
    }
    if (isset($_GET['status'])) {
      $email['status'] = $_GET['status'];
    }
  }
  return $email;
}