Révision 8c72e82a
Ajouté par Assos Assos il y a environ 7 ans
drupal7/sites/all/modules/webform/includes/webform.conditionals.inc | ||
---|---|---|
90 | 90 |
$cid = $action['target']; |
91 | 91 |
if ($action['action'] == 'require' && !$components[$cid]['required']) { |
92 | 92 |
drupal_set_message(t('Component %title must be configured as Required for Webform to conditionally change its required status. <a href="!url">Configure %title.</a>', |
93 |
array('%title' => $components[$cid]['name'],
|
|
94 |
'!url' => url("node/{$node->nid}/webform/components/$cid", array('query' => array('destination' => "node/{$node->nid}/webform/conditionals"))))
|
|
95 |
), 'error');
|
|
93 |
array('%title' => $components[$cid]['name'], |
|
94 |
'!url' => url("node/{$node->nid}/webform/components/$cid", array('query' => array('destination' => "node/{$node->nid}/webform/conditionals")))) |
|
95 |
), 'error'); |
|
96 | 96 |
} |
97 | 97 |
} |
98 | 98 |
$form['conditionals'][$rgid]['weight'] = array( |
... | ... | |
209 | 209 |
$target_id = $action['target']['#value']; |
210 | 210 |
if (isset($targets[$target_id][$operation])) { |
211 | 211 |
form_set_error('conditionals][' . $conditional_key . '][actions][' . $action_key . '][target', |
212 |
t('A operation %op cannot be made for a component more than once. (%target).',
|
|
213 |
array('%op' => $action['action']['#options'][$operation],
|
|
214 |
'%target' => $components[$action['target']['#value']]['name'])));
|
|
212 |
t('A operation %op cannot be made for a component more than once. (%target).', |
|
213 |
array('%op' => $action['action']['#options'][$operation], |
|
214 |
'%target' => $components[$action['target']['#value']]['name']))); |
|
215 | 215 |
} |
216 | 216 |
$component_type = $node->webform['components'][$action['target']['#value']]['type']; |
217 | 217 |
if (!webform_conditional_action_able($component_type, $action['action']['#value'])) { |
218 | 218 |
form_set_error('conditionals][' . $conditional_key . '][actions][' . $action_key . '][action', |
219 |
t('A component of type %type can\'t be %action. (%target)',
|
|
220 |
array(
|
|
221 |
'%action' => $action['action']['#options'][$action['action']['#value']],
|
|
222 |
'%type' => $component_options[$component_type],
|
|
223 |
'%target' => $components[$action['target']['#value']]['name'])));
|
|
219 |
t('A component of type %type can\'t be %action. (%target)', |
|
220 |
array( |
|
221 |
'%action' => $action['action']['#options'][$action['action']['#value']], |
|
222 |
'%type' => $component_options[$component_type], |
|
223 |
'%target' => $components[$action['target']['#value']]['name']))); |
|
224 | 224 |
} |
225 | 225 |
$targets[$target_id][$operation] = $target_id; |
226 | 226 |
} |
... | ... | |
229 | 229 |
// Validate component rules, but not conditional_start/end rules. |
230 | 230 |
if (is_numeric($rule_key) && $rule['source_type']['#value'] == 'component' && isset($targets[$rule['source']['#value']])) { |
231 | 231 |
form_set_error('conditionals][' . $conditional_key . '][rules][' . $rule_key . '][source', |
232 |
t('The subject of the conditional cannot be the same as the component that is changed (%target).',
|
|
233 |
array('%target' => $components[$rule['source']['#value']]['name'])));
|
|
232 |
t('The subject of the conditional cannot be the same as the component that is changed (%target).', |
|
233 |
array('%target' => $components[$rule['source']['#value']]['name']))); |
|
234 | 234 |
} |
235 | 235 |
} |
236 | 236 |
} |
... | ... | |
458 | 458 |
'#submit' => array('webform_conditional_element_add'), |
459 | 459 |
'#subconditional' => $subconditional, |
460 | 460 |
'#name' => implode('_', $element['#parents']) . '_rules_' . $rid . |
461 |
($subconditional ? '_add_subconditional' : '_add'),
|
|
461 |
($subconditional ? '_add_subconditional' : '_add'), |
|
462 | 462 |
'#attributes' => array('class' => array('webform-conditional-rule-add')), |
463 | 463 |
'#ajax' => array( |
464 | 464 |
'progress' => 'none', |
... | ... | |
653 | 653 |
* The starting rule id for the search |
654 | 654 |
* @param integer $target_delta_level |
655 | 655 |
* The level that is sought. 0 for current left. -1 for parent. |
656 |
* |
|
656 | 657 |
* @return integer |
657 | 658 |
* The rid of the found rule, or -1 if none. Note that NULL is not used as a |
658 | 659 |
* semaphore for "not found" because it casts to 0, which is a valid rule id. |
... | ... | |
681 | 682 |
/** |
682 | 683 |
* Helper. Find the matching start or end of a given subconditional. |
683 | 684 |
* |
684 |
* @see _webform_conditional_find_end().
|
|
685 |
* @see _webform_conditional_find_end() |
|
685 | 686 |
*/ |
686 | 687 |
function _webform_conditional_find_start($rules, $origin_rid, $target_delta_level = 0) { |
687 | 688 |
$rids = array_keys($rules); |
... | ... | |
999 | 1000 |
} |
1000 | 1001 |
|
1001 | 1002 |
/** |
1002 |
* Internal implementation of hook_webform_conditional_operator_info().
|
|
1003 |
* Implements hook_webform_conditional_operator_info().
|
|
1003 | 1004 |
* |
1004 | 1005 |
* Called from webform.module's webform_webform_conditional_operator_info(). |
1005 | 1006 |
*/ |
... | ... | |
1682 | 1683 |
*/ |
1683 | 1684 |
function webform_conditional_operator_datetime_after_equal($input_values, $rule_value) { |
1684 | 1685 |
return webform_conditional_operator_datetime_after($input_values, $rule_value) || |
1685 |
webform_conditional_operator_datetime_equal($input_values, $rule_value);
|
|
1686 |
webform_conditional_operator_datetime_equal($input_values, $rule_value); |
|
1686 | 1687 |
} |
1687 | 1688 |
|
1688 | 1689 |
/** |
... | ... | |
1698 | 1699 |
*/ |
1699 | 1700 |
function webform_conditional_operator_datetime_before_equal($input_values, $rule_value) { |
1700 | 1701 |
return webform_conditional_operator_datetime_before($input_values, $rule_value) || |
1701 |
webform_conditional_operator_datetime_equal($input_values, $rule_value);
|
|
1702 |
webform_conditional_operator_datetime_equal($input_values, $rule_value); |
|
1702 | 1703 |
} |
1703 | 1704 |
|
1704 | 1705 |
/** |
Formats disponibles : Unified diff
Weekly update of contrib modules