PluginProbe
weForms – Easy Drag & Drop Contact Form Builder For WordPress / 1.6.24
weForms – Easy Drag & Drop Contact Form Builder For WordPress v1.6.24
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.6.24, at includes/fields/class-field-sectionbreak.php

100 lines 3.2 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 $use_theme_css = isset( $form_settings['use_theme_css'] ) ? $form_settings['use_theme_css'] : 'wpuf-style';
26 ?>
27 <li <?php $this->print_list_attributes( $field_settings ); ?>>
28 <div class="wpuf-section-wrap wpuf-fields <?php echo 'section_' . esc_attr( $form_id ); ?><?php echo ' wpuf_' . esc_html( $name ) . '_' . esc_attr( $form_id ); ?>" data-style="<?php echo esc_attr( $use_theme_css ); ?>">
29 <h2 class="wpuf-section-title"><?php echo esc_attr( $field_settings['label'] ); ?></h2>
30 <div class="wpuf-section-details"><?php echo esc_attr( $description ); ?></div>
31 </div>
32
33 </li>
34 <?php
35 }
36
37 /**
38 * It's a full width block
39 *
40 * @return bool
41 */
42 public function is_full_width() {
43 return true;
44 }
45
46 /**
47 * Get field options setting
48 *
49 * @return array
50 */
51 public function get_options_settings() {
52 $options = [
53 [
54 'name' => 'label',
55 'title' => __( 'Title', 'weforms' ),
56 'type' => 'text',
57 'section' => 'basic',
58 'priority' => 10,
59 'help_text' => __( 'Title of the section', 'weforms' ),
60 ],
61 [
62 'name' => 'name',
63 'title' => __( 'Meta Key', 'weforms' ),
64 'type' => 'text-meta',
65 'section' => 'basic',
66 'priority' => 11,
67 'help_text' => __( 'Name of the meta key this field will save to', 'weforms' ),
68 ],
69 [
70 'name' => 'description',
71 'title' => __( 'Description', 'weforms' ),
72 'type' => 'textarea',
73 'section' => 'basic',
74 'priority' => 12,
75 'help_text' => __( 'Some details text about the section', 'weforms' ),
76 ],
77 ];
78
79 return $options;
80 }
81
82 /**
83 * Get the field props
84 *
85 * @return array
86 */
87 public function get_field_props() {
88 $props = [
89 'template' => $this->get_type(),
90 'label' => $this->get_name(),
91 'description' => __( 'Some description about this section', 'weforms' ),
92 'id' => 0,
93 'is_new' => true,
94 'wpuf_cond' => $this->default_conditional_prop(),
95 ];
96
97 return $props;
98 }
99 }
100