PluginProbe
Form data to kintone / trunk
Form data to kintone vtrunk
trunk 1.0 1.0.1 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.15 1.0.16 1.0.17 1.0.18 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.10.0 1.10.1 1.10.2 2.0.0 2.0.1 All 109 releases
kintone-form / modules / multiLineText.php

multiLineText.php in Form data to kintone trunk, at modules/multiLineText.php

75 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Multi Line Text
4 *
5 * @package kintone-form
6 */
7
8 /**
9 * KintoneFormMultiLineText
10 */
11 class KintoneFormMultiLineText {
12
13 /**
14 * Get instance
15 */
16 public static function get_instance() {
17 /**
18 * A variable that keeps the sole instance.
19 */
20 static $instance;
21
22 if ( ! isset( $instance ) ) {
23 $instance = new KintoneFormMultiLineText();
24 }
25
26 return $instance;
27 }
28
29 /**
30 * Format for kintone data.
31 *
32 * @param array $kintone_form_data .
33 * @param array $cf7_send_data .
34 * @param string $cf7_mail_tag .
35 * @param WP_Error $e .
36 *
37 * @return array An array of image URLs.
38 */
39 public static function format_to_kintone_data( $kintone_form_data, $cf7_send_data, $cf7_mail_tag, $e ) {
40
41 $return_data = array();
42
43 $value = '';
44 if ( in_array( $cf7_mail_tag, Kintone_Form::get_cf7_special_tags(), true ) ) {
45
46 $mail_tag = new WPCF7_MailTag(
47 sprintf( '[%s]', $cf7_mail_tag ), $cf7_mail_tag, ''
48 );
49
50 $value = apply_filters( 'wpcf7_special_mail_tags', null, $cf7_mail_tag, false, $mail_tag );
51
52 } else {
53 if ( isset( $cf7_send_data[ $cf7_mail_tag ] ) ) {
54 $value = $cf7_send_data[ $cf7_mail_tag ];
55 }
56 }
57
58 //
59 // Check Acceptance.
60 //
61 $value = kintone_form_check_acceptance( $value, $cf7_mail_tag );
62
63 if ( is_array( $value ) ) {
64 $value = implode( "\n", $value );
65 }
66
67 $return_data['value'] = $value;
68
69 return $return_data;
70
71 }
72 }
73
74
75