You are here

function webform_menu_email_load in Webform 6.3

Same name and namespace in other branches
  1. 7.4 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 396

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'];
      }
    }
  }
  return $email;
}