PluginProbe
weForms – Easy Drag & Drop Contact Form Builder For WordPress / 1.4.8
weForms – Easy Drag & Drop Contact Form Builder For WordPress v1.4.8
1.6.7 1.6.8 1.6.9 1.6.12 1.6.13 1.6.14 1.6.15 1.6.16 1.6.17 1.6.18 1.6.19 1.6.2 1.6.20 1.6.21 1.6.22 1.6.23 1.6.24 1.6.25 1.6.26 1.6.27 1.6.28 1.6.3 1.6.4 1.6.5 1.6.6 All 74 releases
weforms / includes / fields / class-field-sectionbreak.php

class-field-sectionbreak.php in weForms – Easy Drag & Drop Contact Form Builder For WordPress 1.4.8, at includes/fields/class-field-sectionbreak.php

98 lines 3.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * Text Field Class
5 */
6 class WeForms_Form_Field_SectionBreak extends WeForms_Field_Contract {
7
8 public function __construct() {
9 $this->name = __( 'Section Break', 'weforms' );
10 $this->input_type = 'section_break';
11 $this->icon = 'columns';
12 }
13
14 /**
15 * Render the text field
16 *
17 * @param array $field_settings
18 * @param int $form_id
19 *
20 * @return void
21 */
22 public function render( $field_settings, $form_id ) {
23 $description = isset( $field_settings['description'] ) ? $field_settings['description'] : '';
24 $name = isset( $field_settings['name'] ) ? $field_settings['name'] : ''; ?>
25 <li <?php $this->print_list_attributes( $field_settings ); ?>>
26 <div class="wpuf-section-wrap wpuf-fields <?php echo 'section_' . esc_attr( $form_id ); ?><?php echo ' wpuf_' . esc_html( $name ) . '_' . esc_attr( $form_id ); ?>">
27 <h2 class="wpuf-section-title"><?php echo esc_attr( $field_settings['label'] ); ?></h2>
28 <div class="wpuf-section-details"><?php echo esc_attr( $description ); ?></div>
29 </div>
30
31 </li>
32 <?php
33 }
34
35 /**
36 * It's a full width block
37 *
38 * @return bool
39 */
40 public function is_full_width() {
41 return true;
42 }
43
44 /**
45 * Get field options setting
46 *
47 * @return array
48 */
49 public function get_options_settings() {
50 $options = [
51 [
52 'name' => 'label',
53 'title' => __( 'Title', 'weforms' ),
54 'type' => 'text',
55 'section' => 'basic',
56 'priority' => 10,
57 'help_text' => __( 'Title of the section', 'weforms' ),
58 ],
59 [
60 'name' => 'name',
61 'title' => __( 'Meta Key', 'weforms' ),
62 'type' => 'text-meta',
63 'section' => 'basic',
64 'priority' => 11,
65 'help_text' => __( 'Name of the meta key this field will save to', 'weforms' ),
66 ],
67 [
68 'name' => 'description',
69 'title' => __( 'Description', 'weforms' ),
70 'type' => 'textarea',
71 'section' => 'basic',
72 'priority' => 12,
73 'help_text' => __( 'Some details text about the section', 'weforms' ),
74 ],
75 ];
76
77 return $options;
78 }
79
80 /**
81 * Get the field props
82 *
83 * @return array
84 */
85 public function get_field_props() {
86 $props = [
87 'template' => $this->get_type(),
88 'label' => $this->get_name(),
89 'description' => __( 'Some description about this section', 'weforms' ),
90 'id' => 0,
91 'is_new' => true,
92 'wpuf_cond' => $this->default_conditional_prop(),
93 ];
94
95 return $props;
96 }
97 }
98