| 1 |
<?php |
| 2 |
|
| 3 |
use FloatingButton\Dashboard\FieldHelper; |
| 4 |
|
| 5 |
defined( 'ABSPATH' ) || exit; |
| 6 |
|
| 7 |
$icon_type = ( ! empty( $default['param']['custom_icon'] ) ) ? 'img' : 'default'; |
| 8 |
|
| 9 |
$main_type = [ |
| 10 |
'main' => __( 'Main Button', 'floating-button' ), |
| 11 |
]; |
| 12 |
$def_type = array_merge( $main_type, FieldHelper::item_type() ); |
| 13 |
|
| 14 |
return [ |
| 15 |
// Tooltip options |
| 16 |
'label' => [ |
| 17 |
'type' => 'text', |
| 18 |
'name' => '[item_tooltip]', |
| 19 |
'title' => __( 'Label Text', 'floating-button' ), |
| 20 |
'class' => 'label-text', |
| 21 |
], |
| 22 |
|
| 23 |
'label_on' => [ |
| 24 |
'type' => 'checkbox', |
| 25 |
'name' => '[item_tooltip_include]', |
| 26 |
'title' => __( 'Tooltip', 'floating-button' ), |
| 27 |
'class' => 'tooltip-checkbox', |
| 28 |
'text' => __( 'Enable', 'floating-button' ), |
| 29 |
], |
| 30 |
|
| 31 |
'label_open' => [ |
| 32 |
'type' => 'checkbox', |
| 33 |
'name' => '[item_tooltip_open]', |
| 34 |
'title' => __( 'Hold open', 'floating-button' ), |
| 35 |
'class' => 'tooltip-open', |
| 36 |
'text' => __( 'Enable', 'floating-button' ), |
| 37 |
], |
| 38 |
|
| 39 |
// Type options |
| 40 |
'btn_type' => [ |
| 41 |
'type' => 'select', |
| 42 |
'name' => '[item_type]', |
| 43 |
'title' => __( 'Button type', 'floating-button' ), |
| 44 |
'class' => 'button-type', |
| 45 |
'options' => $def_type, |
| 46 |
], |
| 47 |
|
| 48 |
'btn_open' => [ |
| 49 |
'type' => 'checkbox', |
| 50 |
'name' => '[hold_buttons_open]', |
| 51 |
'title' => __( 'Hold open', 'floating-button' ), |
| 52 |
'class' => 'button-type-main', |
| 53 |
'text' => __( 'Enable', 'floating-button' ), |
| 54 |
], |
| 55 |
|
| 56 |
'link' => [ |
| 57 |
'type' => 'text', |
| 58 |
'name' => '[item_link]', |
| 59 |
'title' => __( 'Link', 'floating-button' ), |
| 60 |
'class' => 'button-type-link', |
| 61 |
], |
| 62 |
|
| 63 |
'share' => [ |
| 64 |
'type' => 'select', |
| 65 |
'name' => '[item_share]', |
| 66 |
'title' => __( 'Social Networks', 'floating-button' ), |
| 67 |
'class' => 'button-type-share', |
| 68 |
'options' => FieldHelper::share_services(), |
| 69 |
], |
| 70 |
|
| 71 |
'link_open' => [ |
| 72 |
'type' => 'checkbox', |
| 73 |
'name' => '[new_tab]', |
| 74 |
'title' => __( 'Open in a new tab', 'floating-button' ), |
| 75 |
'class' => 'button-type-link-open', |
| 76 |
'text' => __( 'Enable', 'floating-button' ), |
| 77 |
], |
| 78 |
|
| 79 |
'translate' => [ |
| 80 |
'type' => 'select', |
| 81 |
'name' => '[gtranslate]', |
| 82 |
'title' => __( 'Select Language', 'floating-button' ), |
| 83 |
'class' => 'button-type-gtranslate', |
| 84 |
'options' => FieldHelper::gtranslate(), |
| 85 |
], |
| 86 |
|
| 87 |
'menu' => [ |
| 88 |
'type' => 'select', |
| 89 |
'name' => '[item_menu]', |
| 90 |
'title' => __( 'Menus', 'floating-button' ), |
| 91 |
'class' => 'button-type-menus', |
| 92 |
'options' => FieldHelper::site_menus(), |
| 93 |
], |
| 94 |
|
| 95 |
// Icon options |
| 96 |
'icon_type' => [ |
| 97 |
'type' => 'select', |
| 98 |
'name' => '[button_icon_type]', |
| 99 |
'title' => __( 'Icon type', 'floating-button' ), |
| 100 |
'class' => 'icon-type', |
| 101 |
'default' => 'default', |
| 102 |
'options' => FieldHelper::icon_type(), |
| 103 |
], |
| 104 |
|
| 105 |
'btn_icon' => [ |
| 106 |
'type' => 'select', |
| 107 |
'name' => '[button_icon]', |
| 108 |
'title' => __( 'Icon', 'floating-button' ), |
| 109 |
'class' => 'icon-type-default choose-icon', |
| 110 |
'default' => 'fas fa-hand-point-up', |
| 111 |
'options' => FieldHelper::icons(), |
| 112 |
], |
| 113 |
|
| 114 |
'btn_animation' => [ |
| 115 |
'type' => 'select', |
| 116 |
'name' => '[button_icon_anomate]', |
| 117 |
'title' => __( 'Animation', 'floating-button' ), |
| 118 |
'class' => 'icon-type-default', |
| 119 |
'options' => FieldHelper::btn_self_anim(), |
| 120 |
], |
| 121 |
|
| 122 |
'img_url' => [ |
| 123 |
'type' => 'url', |
| 124 |
'name' => '[custom_icon_url]', |
| 125 |
'title' => __( 'Image URL', 'floating-button' ), |
| 126 |
'class' => 'icon-type-img icon-type-img-url', |
| 127 |
], |
| 128 |
|
| 129 |
'img_alt' => [ |
| 130 |
'type' => 'text', |
| 131 |
'name' => '[custom_icon_alt]', |
| 132 |
'title' => __( 'Image Alt', 'floating-button' ), |
| 133 |
'class' => 'icon-type-img icon-type-img-alt', |
| 134 |
], |
| 135 |
|
| 136 |
'emoji' => [ |
| 137 |
'type' => 'text', |
| 138 |
'name' => '[custom_icon_emoji]', |
| 139 |
'title' => __( 'Emoji, Symbol', 'floating-button' ), |
| 140 |
'class' => 'icon-type-emoji', |
| 141 |
], |
| 142 |
|
| 143 |
'icon_class' => [ |
| 144 |
'type' => 'text', |
| 145 |
'name' => '[custom_icon_class]', |
| 146 |
'title' => __( 'Set Class', 'floating-button' ), |
| 147 |
'class' => 'icon-type-class', |
| 148 |
], |
| 149 |
|
| 150 |
'icon_close_on' => [ |
| 151 |
'type' => 'checkbox', |
| 152 |
'name' => '[close_button_enable]', |
| 153 |
'title' => __( 'Close Icon', 'floating-button' ), |
| 154 |
'class' => 'icon-type-close', |
| 155 |
'text' => __( 'Enable', 'floating-button' ), |
| 156 |
], |
| 157 |
|
| 158 |
'icon_close' => [ |
| 159 |
'type' => 'select', |
| 160 |
'name' => '[close_button_icon]', |
| 161 |
'title' => __( 'Icon', 'floating-button' ), |
| 162 |
'class' => 'icon-type-close-choose', |
| 163 |
'default' => 'fas fa-xmark', |
| 164 |
'options' => FieldHelper::icons(), |
| 165 |
], |
| 166 |
|
| 167 |
// Style options |
| 168 |
'button_animation' => [ |
| 169 |
'type' => 'select', |
| 170 |
'name' => '[button_animation]', |
| 171 |
'title' => __( 'Button animation', 'floating-button' ), |
| 172 |
'options' => FieldHelper::btn_self_animation(), |
| 173 |
], |
| 174 |
|
| 175 |
'btn_anim_count' => [ |
| 176 |
'type' => 'number', |
| 177 |
'name' => '[btn_anim_count]', |
| 178 |
'title' => __( 'Animation count', 'floating-button' ), |
| 179 |
'default' => '0', |
| 180 |
'class' => 'has-addon-right has-background btn-animation', |
| 181 |
'addon' => 'num', |
| 182 |
], |
| 183 |
|
| 184 |
'btn_anim_delay' => [ |
| 185 |
'type' => 'number', |
| 186 |
'name' => '[btn_anim_delay]', |
| 187 |
'title' => __( 'Animation delay', 'floating-button' ), |
| 188 |
'default' => '0', |
| 189 |
'class' => 'has-addon-right has-background btn-animation', |
| 190 |
'addon' => 'ms', |
| 191 |
], |
| 192 |
|
| 193 |
|
| 194 |
'btn_color' => [ |
| 195 |
'type' => 'color', |
| 196 |
'name' => '[button_color]', |
| 197 |
'title' => __( 'Button color', 'floating-button' ), |
| 198 |
'default' => '#009688', |
| 199 |
'class' => 'item-icon-bg', |
| 200 |
], |
| 201 |
|
| 202 |
'btn_hover_color' => [ |
| 203 |
'type' => 'color', |
| 204 |
'name' => '[button_hcolor]', |
| 205 |
'title' => __( 'Button hover color', 'floating-button' ), |
| 206 |
'default' => '#009688', |
| 207 |
], |
| 208 |
|
| 209 |
'icon_color' => [ |
| 210 |
'type' => 'color', |
| 211 |
'name' => '[icon_color]', |
| 212 |
'title' => __( 'Icon color', 'floating-button' ), |
| 213 |
'class' => 'item-icon-color', |
| 214 |
'default' => '#ffffff', |
| 215 |
], |
| 216 |
|
| 217 |
'icon_hover_color' => [ |
| 218 |
'type' => 'color', |
| 219 |
'name' => '[icon_hcolor]', |
| 220 |
'title' => __( 'Icon hover color', 'floating-button' ), |
| 221 |
'default' => '#ffffff', |
| 222 |
], |
| 223 |
|
| 224 |
// Attributes |
| 225 |
'btn_class' => [ |
| 226 |
'type' => 'text', |
| 227 |
'name' => '[main_button_class]', |
| 228 |
'title' => __( 'Class for element', 'floating-button' ), |
| 229 |
], |
| 230 |
|
| 231 |
'link_rel' => [ |
| 232 |
'type' => 'text', |
| 233 |
'name' => '[link_rel]', |
| 234 |
'title' => __( 'Attribute: rel', 'floating-button' ), |
| 235 |
], |
| 236 |
|
| 237 |
'extra_class' => [ |
| 238 |
'type' => 'text', |
| 239 |
'name' => '[extra_checkbox_class]', |
| 240 |
'title' => __( 'Extra class', 'floating-button' ), |
| 241 |
], |
| 242 |
|
| 243 |
]; |