Révision 8c72e82a
Ajouté par Assos Assos il y a environ 7 ans
drupal7/sites/all/modules/webform/includes/webform.submissions.inc | ||
---|---|---|
15 | 15 |
* The node object containing the current webform. |
16 | 16 |
* @param $submitted |
17 | 17 |
* The submitted user values from the webform. |
18 |
* @return |
|
18 |
* |
|
19 |
* @return array |
|
19 | 20 |
* An array suitable for use in the 'data' property of a $submission object. |
20 | 21 |
*/ |
21 | 22 |
function webform_submission_data($node, $submitted) { |
... | ... | |
54 | 55 |
*/ |
55 | 56 |
function webform_submission_create($node, $account, $form_state, $is_preview = FALSE, $prototype = NULL) { |
56 | 57 |
$data = webform_submission_data($node, $form_state['values']['submitted']); |
57 |
if ($prototype) {
|
|
58 |
if (is_object($prototype)) {
|
|
58 | 59 |
$submission = clone $prototype; |
59 | 60 |
$submission->preview = $is_preview; |
60 | 61 |
$submission->data = $data; |
... | ... | |
222 | 223 |
* @param $emails |
223 | 224 |
* (optional) An array of specific e-mail settings to be used. If omitted, all |
224 | 225 |
* e-mails in $node->webform['emails'] will be sent. |
226 |
* |
|
227 |
* @return int |
|
228 |
* Number of mail sent. |
|
225 | 229 |
*/ |
226 | 230 |
function webform_submission_send_mail($node, $submission, $emails = NULL) { |
227 | 231 |
global $user; |
... | ... | |
321 | 325 |
foreach ($addresses_final as $address) { |
322 | 326 |
if (_webform_submission_spam_check($address, $email['subject'], $email['from'], $email['headers'])) { |
323 | 327 |
watchdog('webform', 'Possible spam attempt from @remote !message', |
324 |
array('@remote' => ip_address(), '!message'=> "<br />\n" . nl2br(htmlentities($email['message']))));
|
|
328 |
array('@remote' => ip_address(), '!message' => "<br />\n" . nl2br(htmlentities($email['message']))));
|
|
325 | 329 |
drupal_set_message(t('Illegal information. Data not submitted.'), 'error'); |
326 | 330 |
return FALSE; |
327 | 331 |
} |
... | ... | |
429 | 433 |
webform_submission_delete($node, $submission); |
430 | 434 |
drupal_set_message(t('Submission deleted.')); |
431 | 435 |
|
432 |
// If no destination query was supplied in the URL (e.g. Edit tab), redirect
|
|
433 |
// to the most-privledged destination. |
|
436 |
// If no destination query was supplied in the URL (for example, Edit tab),
|
|
437 |
// redirect to the most-privledged destination.
|
|
434 | 438 |
$form_state['redirect'] = 'node/' . $node->nid . |
435 | 439 |
(webform_results_access($node) ? '/webform-results' : '/submissions'); |
436 | 440 |
} |
... | ... | |
588 | 592 |
/** |
589 | 593 |
* Theme the node components form. Use a table to organize the components. |
590 | 594 |
* |
591 |
* @param $form |
|
592 |
* The form array. |
|
593 |
* @return |
|
595 |
* @param array $variables |
|
596 |
* Array with key "form" containing the form array. |
|
597 |
* |
|
598 |
* @return string |
|
594 | 599 |
* Formatted HTML form, ready for display. |
600 |
* |
|
601 |
* @throws Exception |
|
595 | 602 |
*/ |
596 | 603 |
function theme_webform_submission_resend($variables) { |
597 | 604 |
$form = $variables['form']; |
... | ... | |
683 | 690 |
* table, pass the array header of the table. |
684 | 691 |
* @param $pager_count |
685 | 692 |
* Optional. The number of submissions to include in the results. |
693 |
* |
|
694 |
* @return array |
|
695 |
* Array of submission data for a particular node. |
|
686 | 696 |
*/ |
687 | 697 |
function webform_get_submissions($filters = array(), $header = NULL, $pager_count = 0) { |
688 | 698 |
return webform_get_submissions_load(webform_get_submissions_query($filters, $header, $pager_count)); |
... | ... | |
703 | 713 |
* table, pass the array header of the table. |
704 | 714 |
* @param $pager_count |
705 | 715 |
* Optional. The number of submissions to include in the results. |
716 |
* |
|
717 |
* @return QueryExtendableInterface|SelectQueryInterface |
|
706 | 718 |
*/ |
707 | 719 |
function webform_get_submissions_query($filters = array(), $header = NULL, $pager_count = 0) { |
708 | 720 |
if (!is_array($filters)) { |
... | ... | |
945 | 957 |
* Optional parameter. Specify the account you want to check the limit |
946 | 958 |
* against. |
947 | 959 |
* |
948 |
* @return |
|
960 |
* @return bool
|
|
949 | 961 |
* Boolean TRUE if the user has exceeded their limit. FALSE otherwise. |
950 | 962 |
*/ |
951 | 963 |
function webform_submission_user_limit_check($node, $account = NULL) { |
... | ... | |
1022 | 1034 |
* |
1023 | 1035 |
* @param $node |
1024 | 1036 |
* The webform node to be checked. |
1025 |
* @return |
|
1037 |
* |
|
1038 |
* @return bool |
|
1026 | 1039 |
* Boolean TRUE if the form has exceeded it's limit. FALSE otherwise. |
1027 | 1040 |
*/ |
1028 | 1041 |
function webform_submission_total_limit_check($node) { |
Formats disponibles : Unified diff
Weekly update of contrib modules