Project

General

Profile

Revision 389fb945

Added by Assos Assos over 4 years ago

Weekly update of contrib modules

View differences:

drupal7/sites/all/modules/webform/webform.module
2188 2188
    $message = t('Submissions for this form are closed.');
2189 2189
  }
2190 2190
  elseif ($node->webform['confidential'] && user_is_logged_in()) {
2191
    $message = t('This form is confidential. You must <a href="!url">Log out</a> to submit it.', array('!url' => url('/user/logout', array('query' => array('destination' => request_uri())))));
2191
    $message = t('This form is confidential. You must <a href="!url">Log out</a> to submit it.', array('!url' => url('user/logout', array('query' => drupal_get_destination()))));
2192 2192
  }
2193 2193
  // If open and not allowed to submit the form, give an explanation.
2194 2194
  elseif (array_search(TRUE, $allowed_roles) === FALSE && $user->uid != 1) {
......
3271 3271
  // Merge any stored submission data for multistep forms.
3272 3272
  $original_values = is_array($form_state['values']['submitted']) ? $form_state['values']['submitted'] : array();
3273 3273
  if (isset($form_state['storage']['submitted'])) {
3274
    // Array + operator keeps all elements of left operand and discards any duplicate elements in right operand.
3274
    // Array + operator keeps all elements of left operand and discards any
3275
    // duplicate elements in right operand.
3275 3276
    $original_values += $form_state['storage']['submitted'];
3276 3277
  }
3277 3278

  
......
3754 3755
    $variables['element']['#id'] = NULL;
3755 3756
  }
3756 3757

  
3758
  // Determine whether or not this element has form control children. If so and
3759
  // if webform_fieldset_wrap is TRUE, wrap them in a fieldset and use legend
3760
  // instead of label.
3761
  $has_element_children = FALSE;
3762
  if (webform_variable_get('webform_fieldset_wrap')) {
3763
    foreach (array_keys($element) as $key) {
3764
      if (substr($key, 0, 1) !== '#') {
3765
        $has_element_children = TRUE;
3766
        break;
3767
      }
3768
    }
3769
  }
3770

  
3771
  if ($has_element_children) {
3772
    $output .= '<fieldset class="fieldset-invisible">';
3773
  }
3774

  
3757 3775
  switch ($element['#title_display']) {
3758 3776
    case 'inline':
3759 3777
      $output .= $description[$above];
......
3761 3779
    case 'before':
3762 3780
    case 'invisible':
3763 3781
    case 'after':
3764
      $title = ' ' . theme('form_element_label', $variables);
3782
      if ($has_element_children) {
3783
        $title = '<legend>' . $element['#title'];
3784

  
3785
        if ($element['#required']) {
3786
          $title .= ' ' . theme('form_required_marker', $variables);
3787
        }
3788

  
3789
        $title .= '</legend>';
3790
      }
3791
      else {
3792
        $title = ' ' . theme('form_element_label', $variables);
3793
      }
3765 3794
      break;
3766 3795
  }
3767 3796

  
......
3788 3817
  $output .= "\n";
3789 3818

  
3790 3819
  $output .= $description[!$above];
3820

  
3821
  if ($has_element_children) {
3822
    $output .= '</fieldset>';
3823
  }
3824

  
3791 3825
  $output .= "</div>\n";
3792 3826

  
3793 3827
  return $output;
......
3997 4031
}
3998 4032

  
3999 4033
/**
4000
 * This function is deprecated! Use webform_replace_tokens() instead.
4034
 * Wrapper for webform_replace_tokens().
4001 4035
 *
4002
 * @deprecated
4036
 * @deprecated in webform:7.x-4.0 and is removed from webform:7.x-5.0. Use
4037
 * webform_replace_tokens().
4038
 * @see https://www.drupal.org/project/webform/issues/2038199
4003 4039
 */
4004 4040
function _webform_filter_values($string, $node = NULL, $submission = NULL, $email = NULL, $strict = TRUE) {
4005 4041
  $output = webform_replace_tokens($string, $node, $submission, $email, $strict);
......
4122 4158
    }
4123 4159
  }
4124 4160
  $parsed_redirect_url['fragment'] = webform_replace_tokens($parsed_redirect_url['fragment'], $node, $submission);
4125
  // Determine whether the path is internal or external. Paths which contain the site's
4126
  // base url are still considered internal. #webform_external is private to webform.
4161
  // Determine whether the path is internal or external. Paths which contain the
4162
  // site's base url are still considered internal. #webform_external is private
4163
  // to webform.
4127 4164
  $parsed_redirect_url['#webform_external'] = url_is_external($parsed_redirect_url['path']);
4128 4165
  foreach (array(NULL, TRUE, FALSE) as $https) {
4129 4166
    if (stripos($parsed_redirect_url['path'], url('', array('absolute' => TRUE, 'https' => $https))) === 0) {
......
4142 4179
}
4143 4180

  
4144 4181
/**
4145
 * Deprecated! Use webform_filter_descriptions() instead.
4182
 * Duplicates webform_filter_descriptions().
4146 4183
 *
4147
 * @deprecated
4184
 * @deprecated in webform:7.x-4.0 and is removed from webform:7.x-5.0. Use
4185
 * webform_filter_descriptions().
4186
 * @see https://www.drupal.org/project/webform/issues/2038199
4148 4187
 */
4149 4188
function _webform_filter_descriptions($string, $node = NULL, $submission = NULL) {
4150 4189
  return webform_filter_descriptions($string, $node, $submission);
......
4160 4199
}
4161 4200

  
4162 4201
/**
4163
 * Deprecated! Use webform_filter_xss() instead!
4202
 * Duplicates webform_filter_xss().
4164 4203
 *
4165
 * @deprecated
4204
 * @deprecated in webform:7.x-4.0 and is removed from webform:7.x-5.0. Use
4205
 * webform_filter_xss().
4206
 * @see https://www.drupal.org/project/webform/issues/2038199
4166 4207
 */
4167 4208
function _webform_filter_xss($string) {
4168 4209
  return webform_filter_xss($string);
......
4414 4455
    case 'webform_disabled_components':
4415 4456
      $result = variable_get('webform_disabled_components', array());
4416 4457
      break;
4458

  
4459
    case 'webform_fieldset_wrap':
4460
      $result = variable_get('webform_fieldset_wrap', FALSE);
4461
      break;
4417 4462
  }
4418 4463
  return $result;
4419 4464
}
......
4584 4629
  }
4585 4630

  
4586 4631
  foreach ($address as $key => $individual_address) {
4632
    $individual_address = trim($individual_address);
4587 4633
    $individual_address = webform_replace_tokens($individual_address, $node, $submission);
4588 4634
    $email_parts = webform_parse_email_address($individual_address);
4589 4635
    if ($format == 'long' && !empty($name[$key]) && !strlen($email_parts['name'])) {
......
4967 5013
  if ($submission) {
4968 5014
    $breadcrumb = menu_get_active_breadcrumb();
4969 5015

  
4970
    // Append the node title (or its menu name), in case it isn't in the path already.
5016
    // Append the node title (or its menu name), in case it isn't in the path
5017
    // already.
4971 5018
    $active_trail = menu_get_active_trail();
4972 5019
    $last_active = end($active_trail);
4973 5020
    $breadcrumb[] = $last_active['href'] === $node_path && !empty($last_active['in_active_trail'])
......
5120 5167

  
5121 5168
    // Date/Time formatting characters
5122 5169
    // WHAT           REQUIRED (at least 1) OPTIONAL (allowed but insufficient)
5123
    // ---------------------------------------------------------------------------
5170
    // -------------------------------------------------------------------------
5124 5171
    // Day-of-week                          DlNw
5125 5172
    // Day            dj                    Stz
5126 5173
    // Month          FmMn
5127 5174
    // Year           oYy                   L
5128 5175
    //
5129 5176
    //                NOT ALLOWED
5130
    // --------------------------------------------------------------------------
5177
    // -------------------------------------------------------------------------
5131 5178
    // Time           aABgGhHisueIOPTZ
5132 5179
    // Special        /.,-: <space>
5133 5180
    //
......
5303 5350
  // a transaction. The return value of db_transaction() must be assigned or the
5304 5351
  // transaction will commit immediately. The transaction will commit when $txn
5305 5352
  // goes out-of-scope.
5306
  $txn = db_transaction();
5353
  $transaction = db_transaction();
5307 5354

  
5308 5355
  // Get the next_serial value.
5309 5356
  $next_serial = db_select('webform', 'w')
......
5392 5439
    $form['#input_var_waring_parent'] = $parent_key;
5393 5440
  }
5394 5441
  if (!empty($form_state['input']) && array_key_exists($detect_key, $form_state['input']) && !array_key_exists('form_id', $form_state['input'])) {
5395
    // A form was submitted with POST, but the form_id was missing. The most likely cause of this
5396
    // is that the POST was truncated because PHP exceeded its max_input_vars limit.
5442
    // A form was submitted with POST, but the form_id was missing. The most
5443
    // likely cause of this is that the POST was truncated because PHP exceeded
5444
    // its max_input_vars limit.
5397 5445
    $subs = array(
5398 5446
      '@count' => webform_count_terminals($_POST),
5399 5447
      '@limit' => (int) ini_get('max_input_vars'),
......
5420 5468
  // Determine the limit on input vars for this server configuration.
5421 5469
  $limit = ini_get('max_input_vars');
5422 5470
  if ($limit) {
5423
    // Estimate the number of input vars needed to see if the PHP limit has been exceeded.
5424
    // Additional input_vars: op.
5471
    // Estimate the number of input vars needed to see if the PHP limit has been
5472
    // exceeded. Additional input_vars: op.
5425 5473
    $count = 1 + webform_count_input_vars($element);
5426 5474
    if ($count > $limit * 0.95) {
5427 5475
      $subs = array(

Also available in: Unified diff