PluginProbe
Float menu – awesome floating side menu / 6.1
Float menu – awesome floating side menu v6.1
7.2.5 trunk 2.1 2.2 3.0.1 3.1 3.2.2 3.3.1 3.5 3.5.1 3.5.2 3.5.3. 3.5.4 4.0 4.1 4.1.1 4.2 4.3 4.3.1 4.3.2 5.0 5.0.1 5.0.2 5.0.3 5.1 All 57 releases
← All changes | admin/settings/options/menu.php +89 -120 5.0.36.1 View file →
@@ -1,147 +1,116 @@
1 1 <?php
2 -/**
3 - * Settings
4 - *
5 - * @package Wow_Plugin
6 - * @copyright Copyright (c) 2018, Dmytro Lobov
7 - * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
8 - * @since 1.0
9 - */
10 2
11 -if ( ! defined( 'ABSPATH' ) ) {
12 - exit;
13 -}
3 +use FloatMenuLite\Settings_Helper;
14 4
15 -include_once( 'icons.php' );
16 -$icons_new = array();
17 -foreach ( $icons as $key => $value ) {
18 - $icons_new[ $value ] = $value;
19 -}
5 +defined( 'ABSPATH' ) || exit;
20 6
21 -$count_i = ( ! empty( $param['menu_1']['item_type'] ) ) ? count( $param['menu_1']['item_type'] ) : '0';
22 -if ( $count_i > 0 ) {
23 - for ( $i = 0; $i < $count_i; $i ++ ) {
7 +$args = [
8 + 'item_tooltip' => [
9 + 'type' => 'text',
10 + 'title' => __( 'Label Text', 'float-menu' ),
11 + ],
24 12
25 - // Icon
26 - $item_icon_[ $i ] = array(
27 - 'name' => 'param[menu_1][item_icon][]',
28 - 'class' => 'icons',
29 - 'type' => 'select',
30 - 'val' => isset( $param['menu_1']['item_icon'][ $i ] ) ? $param['menu_1']['item_icon'][ $i ]
31 - : 'fas fa-hand-point-up',
32 - 'option' => $icons_new,
33 - );
34 13
35 - // Label for item
36 - $item_tooltip_[ $i ] = array(
37 - 'name' => 'param[menu_1][item_tooltip][]',
38 - 'class' => 'item-tooltip',
39 - 'type' => 'text',
40 - 'val' => isset( $param['menu_1']['item_tooltip'][ $i ] ) ? $param['menu_1']['item_tooltip'][ $i ] : '',
41 - );
14 + 'item_type' => [
15 + 'type' => 'select',
16 + 'title' => __( 'Type', 'float-menu' ),
17 + 'atts' => Settings_Helper::item_type(),
18 + ],
42 19
43 - // Type of the item
44 - $item_type_[ $i ] = array(
45 - 'name' => 'param[menu_1][item_type][]',
46 - 'type' => 'select',
47 - 'class' => 'item-type',
48 - 'val' => isset( $param['menu_1']['item_type'][ $i ] ) ? $param['menu_1']['item_type'][ $i ] : 'link',
49 - 'option' => array(
50 - 'link' => esc_attr__( 'Link', $this->plugin['text'] ),
51 - ),
20 + 'item_link' => [
21 + 'type' => 'text',
22 + 'title' => __( 'Link', 'float-menu' ),
23 + 'class' => 'is-hidden',
24 + ],
52 25
53 - );
26 + 'new_tab' => [
27 + 'type' => 'checkbox',
28 + 'title' => __( 'Open in new Window', 'float-menu' ),
29 + 'label' => __( 'Enable', 'float-menu' ),
30 + 'class' => 'is-hidden',
31 + ],
54 32
55 33
56 - // Link URL
57 - $item_link_[ $i ] = array(
58 - 'name' => 'param[menu_1][item_link][]',
59 - 'type' => 'text',
60 - 'val' => isset( $param['menu_1']['item_link'][ $i ] ) ? $param['menu_1']['item_link'][ $i ] : '',
61 - );
62 34
35 + // Icons
36 + 'item_icon' => [
37 + 'type' => 'select',
38 + 'title' => __( 'Icon', 'float-menu' ),
39 + 'atts' => Settings_Helper::icons(),
40 + ],
63 41
64 - // Open link in a new window
65 - $new_tab_[ $i ] = array(
66 - 'name' => 'param[menu_1][new_tab][]',
67 - 'class' => '',
68 - 'type' => 'checkbox',
69 - 'val' => isset( $param['menu_1']['new_tab'][ $i ] ) ? $param['menu_1']['new_tab'][ $i ] : 0,
70 - 'func' => '',
71 - 'sep' => '',
72 - );
73 42
74 - // Font color
75 - $color_[ $i ] = array(
76 - 'name' => 'param[menu_1][color][]',
77 - 'type' => 'color',
78 - 'val' => isset( $param['menu_1']['color'][ $i ] ) ? $param['menu_1']['color'][ $i ] : '#ffffff',
79 - );
43 + // Style
44 + 'color' => [
45 + 'type' => 'text',
46 + 'val' => '#ffffff',
47 + 'atts' => [
48 + 'class' => 'wpie-color',
49 + 'data-alpha-enabled' => 'true',
50 + ],
51 + 'title' => __( 'Color', 'float-menu' ),
52 + ],
80 53
81 - $hcolor_default = isset( $param['menu_1']['color'][ $i ] ) ? $param['menu_1']['color'][ $i ] : '#ffffff';
54 + 'hcolor' => [
55 + 'type' => 'text',
56 + 'val' => '#ffffff',
57 + 'atts' => [
58 + 'class' => 'wpie-color',
59 + 'data-alpha-enabled' => 'true',
60 + ],
61 + 'title' => __( 'Hover Color', 'float-menu' ),
62 + ],
82 63
83 - // Font hover color
84 - $hcolor_[ $i ] = array(
85 - 'name' => 'param[menu_1][hcolor][]',
86 - 'type' => 'color',
87 - 'val' => isset( $param['menu_1']['hcolor'][ $i ] ) ? $param['menu_1']['hcolor'][ $i ] : $hcolor_default,
88 - );
64 + 'bcolor' => [
65 + 'type' => 'text',
66 + 'val' => '#184c72',
67 + 'atts' => [
68 + 'class' => 'wpie-color',
69 + 'data-alpha-enabled' => 'true',
70 + ],
71 + 'title' => __( 'Background', 'float-menu' ),
72 + ],
89 73
74 + 'hbcolor' => [
75 + 'type' => 'text',
76 + 'val' => '#184c72',
77 + 'atts' => [
78 + 'class' => 'wpie-color',
79 + 'data-alpha-enabled' => 'true',
80 + ],
81 + 'title' => __( 'Hover Background', 'float-menu' ),
82 + ],
90 83
91 - // Background
92 - $bcolor_[ $i ] = array(
93 - 'name' => 'param[menu_1][bcolor][]',
94 - 'type' => 'color',
95 - 'val' => isset( $param['menu_1']['bcolor'][ $i ] ) ? $param['menu_1']['bcolor'][ $i ] : '#128be0',
96 - );
97 84
98 - $hbcolor_default = isset( $param['menu_1']['bcolor'][ $i ] ) ? $param['menu_1']['bcolor'][ $i ] : '#128be0';
99 - // Hover Background
100 - $hbcolor_[ $i ] = array(
101 - 'name' => 'param[menu_1][hbcolor][]',
102 - 'type' => 'color',
103 - 'val' => isset( $param['menu_1']['hbcolor'][ $i ] ) ? $param['menu_1']['hbcolor'][ $i ] : $hbcolor_default,
104 - );
85 + // Attributes
86 + 'button_id' => [
87 + 'type' => 'text',
88 + 'title' => __( 'ID for element', 'float-menu' ),
89 + ],
105 90
91 + 'button_class' => [
92 + 'type' => 'text',
93 + 'title' => __( 'Class for element', 'float-menu' ),
94 + ],
106 95
107 - $button_id_[ $i ] = array(
108 - 'name' => 'param[menu_1][button_id][]',
109 - 'type' => 'text',
110 - 'val' => isset( $param['menu_1']['button_id'][ $i ] ) ? $param['menu_1']['button_id'][ $i ] : '',
111 - );
96 + 'link_rel' => [
97 + 'type' => 'text',
98 + 'title' => __( 'Attribute: rel', 'float-menu' ),
99 + ],
112 100
113 - $button_class_[ $i ] = array(
114 - 'name' => 'param[menu_1][button_class][]',
115 - 'type' => 'text',
116 - 'val' => isset( $param['menu_1']['button_class'][ $i ] ) ? $param['menu_1']['button_class'][ $i ] : '',
117 - );
101 + 'aria_label' => [
102 + 'type' => 'text',
103 + 'title' => __( 'Aria label', 'float-menu' ),
104 + ],
118 105
119 - $link_rel_[ $i ] = array(
120 - 'name' => 'param[menu_1][link_rel][]',
121 - 'type' => 'text',
122 - 'val' => isset( $param['menu_1']['link_rel'][ $i ] ) ? $param['menu_1']['link_rel'][ $i ] : '',
123 - );
124 106
107 +];
125 108
126 - }
109 +$prefix = 'menu_1-';
110 +$newArgs = [];
127 111
112 +foreach ( $args as $key => $value ) {
113 + $newArgs[ $prefix . $key ] = $value;
128 114 }
129 115
130 -$item_tooltip_help = array(
131 - 'text' => esc_attr__( 'Set the text for menu item.', $this->plugin['text'] ),
132 -);
133 -
134 -$item_type_help = array(
135 - 'title' => esc_attr__( 'Types of the button which can be select', $this->plugin['text'] ),
136 - 'ul' => array(
137 - esc_attr__( 'Link - insert any link', $this->plugin['text'] ),
138 - ),
139 -);
140 -
141 -$button_id_help = array(
142 - 'text' => esc_attr__( 'Set the attribute ID for the menu item or left empty.', $this->plugin['text'] ),
143 -);
144 -
145 -$button_class_help = array(
146 - 'text' => esc_attr__( 'Set the attribute CLASS for the menu item or left empty.', $this->plugin['text'] ),
147 -);
116 +return $newArgs;