| 1 |
<?php |
| 2 |
|
| 3 |
class WeForms_Builder_Field_Settings extends WPUF_Form_Builder_Field_Settings { |
| 4 |
|
| 5 |
public static function get_field_settings() { |
| 6 |
return array( |
| 7 |
'name_field' => self::name_field(), |
| 8 |
); |
| 9 |
} |
| 10 |
|
| 11 |
/** |
| 12 |
* Name field settings |
| 13 |
* |
| 14 |
* @return array |
| 15 |
*/ |
| 16 |
public static function name_field() { |
| 17 |
$settings = self::get_common_properties(); |
| 18 |
|
| 19 |
$name_settings = array( |
| 20 |
array( |
| 21 |
'name' => 'format', |
| 22 |
'title' => __( 'Format', 'weforms' ), |
| 23 |
'type' => 'radio', |
| 24 |
'options' => array( |
| 25 |
'first-last' => __( 'First and Last name', 'weforms' ), |
| 26 |
'first-middle-last' => __( 'First, Middle and Last name', 'weforms' ) |
| 27 |
), |
| 28 |
'selected' => 'first-last', |
| 29 |
'section' => 'advanced', |
| 30 |
'priority' => 20, |
| 31 |
'help_text' => __( 'Select format to use for the name field', 'weforms' ), |
| 32 |
), |
| 33 |
array( |
| 34 |
'name' => 'sub-labels', |
| 35 |
'title' => __( 'Label', 'weforms' ), |
| 36 |
'type' => 'name', |
| 37 |
'section' => 'advanced', |
| 38 |
'priority' => 21, |
| 39 |
'help_text' => __( 'Select format to use for the name field', 'weforms' ), |
| 40 |
), |
| 41 |
array( |
| 42 |
'name' => 'hide_subs', |
| 43 |
'title' => '', |
| 44 |
'type' => 'checkbox', |
| 45 |
'is_single_opt' => true, |
| 46 |
'options' => array( |
| 47 |
'true' => __( 'Hide Sub Labels', 'weforms' ) |
| 48 |
), |
| 49 |
'section' => 'advanced', |
| 50 |
'priority' => 23, |
| 51 |
'help_text' => '', |
| 52 |
), |
| 53 |
); |
| 54 |
|
| 55 |
$settings = array_merge( $name_settings, $settings ); |
| 56 |
|
| 57 |
return array( |
| 58 |
'template' => 'name_field', |
| 59 |
'title' => __( 'Name', 'weforms' ), |
| 60 |
'icon' => 'user', |
| 61 |
'settings' => $settings, |
| 62 |
'field_props' => array( |
| 63 |
'input_type' => 'name', |
| 64 |
'template' => 'name_field', |
| 65 |
'required' => 'yes', |
| 66 |
'label' => __( 'Name', 'weforms' ), |
| 67 |
'name' => '', |
| 68 |
'is_meta' => 'yes', |
| 69 |
'format' => 'first-last', |
| 70 |
'first_name' => array( |
| 71 |
'placeholder' => '', |
| 72 |
'default' => '', |
| 73 |
'sub' => __( 'First', 'weforms' ) |
| 74 |
), |
| 75 |
'middle_name' => array( |
| 76 |
'placeholder' => '', |
| 77 |
'default' => '', |
| 78 |
'sub' => __( 'Middle', 'weforms' ) |
| 79 |
), |
| 80 |
'last_name' => array( |
| 81 |
'placeholder' => '', |
| 82 |
'default' => '', |
| 83 |
'sub' => __( 'Last', 'weforms' ) |
| 84 |
), |
| 85 |
'hide_subs' => false, |
| 86 |
'help' => '', |
| 87 |
'css' => '', |
| 88 |
'id' => 0, |
| 89 |
'is_new' => true, |
| 90 |
'wpuf_cond' => self::get_wpuf_cond_prop() |
| 91 |
) |
| 92 |
); |
| 93 |
} |
| 94 |
} |