| @@ -6,37 +6,31 @@ | ||
| 6 | 6 | use FloatMenuLite\Admin\CreateFields; |
| 7 | 7 | |
| 8 | 8 | defined( 'ABSPATH' ) || exit; |
| 9 | 9 | |
| 10 | -$data = include( 'options/menu.php' ); | |
| 10 | +$page_opt = include( 'options/menu.php' ); | |
| 11 | 11 | |
| 12 | -$field = new CreateFields( $options, $data['opt'] ); | |
| 12 | +$field = new CreateFields( $options, $page_opt ); | |
| 13 | 13 | |
| 14 | 14 | $count = ( ! empty( $options['menu_1']['item_type'] ) ) ? count( $options['menu_1']['item_type'] ) : '0'; |
| 15 | 15 | ?> |
| 16 | 16 | <div class="wpie-items__list" id="wpie-items-list"> |
| 17 | - <?php if ( $count > 0 ) : | |
| 17 | + <?php | |
| 18 | + if ( $count > 0 ) : | |
| 18 | 19 | for ( $i = 0; $i < $count; $i ++ ): |
| 19 | 20 | $order = $i + 1; |
| 20 | 21 | $item_order = ! empty( $options['item_order'][ $i ] ) ? 1 : 0; |
| 21 | 22 | $open = ! empty( $item_order ) ? ' open' : ''; |
| 22 | - $item_parent = $options['menu_1']['item_sub'][ $i ] ?? 0; | |
| 23 | - $item_class = ''; | |
| 24 | - if ( absint( $item_parent ) === 1 ) { | |
| 25 | - $item_class = ' shifted-right'; | |
| 26 | - } | |
| 27 | 23 | ?> |
| 28 | - <details | |
| 29 | - class="wpie-item menu-item<?php echo esc_attr( $item_class ); ?>"<?php echo esc_attr( $open ); ?>> | |
| 30 | - <input type="hidden" name="param[item_order][]" class="wpie-item__toggle" | |
| 31 | - value="<?php echo absint( $item_order ); ?>"> | |
| 32 | - <input type="hidden" name="param[menu_1][item_sub][]" class="wpie-item__parent" | |
| 33 | - value="<?php echo absint( $item_parent ); ?>"> | |
| 24 | + <details class="wpie-item"<?php | |
| 25 | + echo esc_attr( $open ); ?>> | |
| 26 | + <input type="hidden" name="item_order[]" class="wpie-item__toggle" value="<?php | |
| 27 | + echo absint( $item_order ); ?>"> | |
| 34 | 28 | <summary class="wpie-item_heading"> |
| 35 | 29 | <span class="wpie-item_heading_icon"></span> |
| 36 | 30 | <span class="wpie-item_heading_label"></span> |
| 37 | 31 | <span class="wpie-item_heading_type"></span> |
| 38 | - <span class="wpie-icon wpie_icon-copy"></span> | |
| 32 | + <span class="wpie-item_heading_sub"></span> | |
| 39 | 33 | <span class="wpie-icon wpie_icon-chevron-expand-y"></span> |
| 40 | 34 | <span class="wpie-icon wpie_icon-trash"></span> |
| 41 | 35 | <span class="wpie-item_heading_toogle"> |
| 42 | 36 | <span class="wpie-icon wpie_icon-chevron-down"></span> |
| @@ -44,52 +38,92 @@ | ||
| 44 | 38 | </span> |
| 45 | 39 | </summary> |
| 46 | 40 | <div class="wpie-item_content"> |
| 47 | 41 | |
| 42 | + <div class="wpie-fieldset"> | |
| 43 | + <div class="wpie-fields"> | |
| 44 | + <?php | |
| 45 | + $field->create( 'menu_1-item_tooltip', $i ); ?> | |
| 46 | + </div> | |
| 47 | + </div> | |
| 48 | + | |
| 48 | 49 | <div class="wpie-tabs-wrapper"> |
| 49 | 50 | |
| 50 | 51 | <div class="wpie-tabs-link"> |
| 51 | - <?php | |
| 52 | - $tab_i = 1; | |
| 53 | - foreach ( $data['tabs'] as $tab ) { | |
| 54 | - $active = $tab_i === 1 ? ' is-active' : ''; | |
| 55 | - echo '<a class="wpie-tab__link' . esc_attr( $active ) . '">' . esc_html( ucfirst( $tab ) ) . '</a>'; | |
| 56 | - $tab_i ++; | |
| 57 | - } | |
| 58 | - ?> | |
| 52 | + <a class="wpie-tab__link is-active"><?php | |
| 53 | + esc_html_e( 'Type', 'float-menu' ); ?></a> | |
| 54 | + <a class="wpie-tab__link"><?php | |
| 55 | + esc_html_e( 'Icon', 'float-menu' ); ?></a> | |
| 56 | + <a class="wpie-tab__link"><?php | |
| 57 | + esc_html_e( 'Style', 'float-menu' ); ?></a> | |
| 58 | + <a class="wpie-tab__link"><?php | |
| 59 | + esc_html_e( 'Attributes', 'float-menu' ); ?></a> | |
| 59 | 60 | </div> |
| 60 | 61 | |
| 61 | - <?php | |
| 62 | - $tabs_i = 1; | |
| 63 | - foreach ( $data['args'] as $tabs ) { | |
| 64 | - $active = $tabs_i === 1 ? ' is-active' : ''; | |
| 65 | - echo '<div class="wpie-tab-settings' . esc_attr( $active ) . '">'; | |
| 66 | - echo '<div class="wpie-fieldset">'; | |
| 62 | + <div class="wpie-tab-settings is-active"> | |
| 63 | + <div class="wpie-fieldset"> | |
| 64 | + <div class="wpie-fields"> | |
| 65 | + <?php | |
| 66 | + $field->create( 'menu_1-item_type', $i ); ?><?php | |
| 67 | + $field->create( 'menu_1-item_link', $i ); ?><?php | |
| 68 | + $field->create( 'menu_1-new_tab', $i ); ?> | |
| 69 | + </div> | |
| 70 | + </div> | |
| 67 | 71 | |
| 68 | - foreach ( $tabs as $tab ) { | |
| 69 | - echo '<div class="wpie-fields">'; | |
| 70 | 72 | |
| 71 | - foreach ( $tab as $option => $optionVal ) { | |
| 72 | - $field->create( 'menu_1-' . $option, $i ); | |
| 73 | - } | |
| 74 | - echo '</div>'; | |
| 75 | - } | |
| 73 | + </div> | |
| 76 | 74 | |
| 77 | - echo '</div>'; | |
| 78 | - echo '</div>'; | |
| 75 | + <div class="wpie-tab-settings"> | |
| 76 | + <div class="wpie-fieldset"> | |
| 77 | + <div class="wpie-fields"> | |
| 78 | + <?php | |
| 79 | + $field->create( 'menu_1-item_icon', $i ); ?> | |
| 80 | + </div> | |
| 81 | + </div> | |
| 79 | 82 | |
| 80 | - $tabs_i ++; | |
| 81 | - } | |
| 82 | - ?> | |
| 83 | + </div> | |
| 84 | + | |
| 85 | + <div class="wpie-tab-settings"> | |
| 86 | + | |
| 87 | + <div class="wpie-fieldset"> | |
| 88 | + <div class="wpie-fields"> | |
| 89 | + <?php | |
| 90 | + $field->create( 'menu_1-color', $i ); ?><?php | |
| 91 | + $field->create( 'menu_1-hcolor', $i ); ?><?php | |
| 92 | + $field->create( 'menu_1-bcolor', $i ); ?><?php | |
| 93 | + $field->create( 'menu_1-hbcolor', $i ); ?> | |
| 94 | + </div> | |
| 95 | + </div> | |
| 96 | + | |
| 97 | + </div> | |
| 98 | + | |
| 99 | + <div class="wpie-tab-settings"> | |
| 100 | + <div class="wpie-fieldset"> | |
| 101 | + <div class="wpie-legend"><?php | |
| 102 | + esc_html_e( 'Attributes', 'float-menu' ); ?></div> | |
| 103 | + <div class="wpie-fields"> | |
| 104 | + <?php | |
| 105 | + $field->create( 'menu_1-button_id', $i ); | |
| 106 | + $field->create( 'menu_1-button_class', $i ); | |
| 107 | + $field->create( 'menu_1-link_rel', $i ); | |
| 108 | + $field->create( 'menu_1-aria_label', $i ); | |
| 109 | + ?> | |
| 110 | + </div> | |
| 111 | + </div> | |
| 112 | + </div> | |
| 113 | + | |
| 83 | 114 | </div> |
| 115 | + | |
| 116 | + | |
| 84 | 117 | </div> |
| 85 | 118 | </details> |
| 86 | - <?php endfor; endif; ?> | |
| 119 | + <?php | |
| 120 | + endfor; endif; ?> | |
| 87 | 121 | |
| 88 | 122 | <hr class="wpie-buttons__hr"> |
| 89 | 123 | <div class="wpie-fields"> |
| 90 | - <button class="button button-primary wpie-add-button" | |
| 91 | - type="button"><?php esc_html_e( 'Add Button', 'float-menu' ); ?></button> | |
| 124 | + <button class="button button-primary wpie-add-button" type="button"><?php | |
| 125 | + esc_html_e( 'Add Button', 'float-menu' ); ?></button> | |
| 92 | 126 | </div> |
| 93 | 127 | |
| 94 | 128 | </div> |
| 95 | 129 | |
| @@ -95,60 +129,93 @@ | ||
| 95 | 129 | |
| 96 | 130 | |
| 97 | 131 | <template id="template-button"> |
| 98 | 132 | <details class="wpie-item" open> |
| 99 | - <input type="hidden" name="param[item_order][]" class="wpie-item__toggle" value="1"> | |
| 100 | - <input type="hidden" name="param[menu_1][item_sub][]" class="wpie-item__parent" | |
| 101 | - value="0"> | |
| 133 | + <input type="hidden" name="item_order[]" class="wpie-item__toggle" value="1"> | |
| 102 | 134 | <summary class="wpie-item_heading"> |
| 103 | 135 | <span class="wpie-item_heading_icon"></span> |
| 104 | 136 | <span class="wpie-item_heading_label"></span> |
| 105 | 137 | <span class="wpie-item_heading_type"></span> |
| 106 | - <span class="wpie-icon wpie_icon-copy"></span> | |
| 138 | + <span class="wpie-item_heading_sub"></span> | |
| 107 | 139 | <span class="wpie-icon wpie_icon-chevron-expand-y"></span> |
| 108 | 140 | <span class="wpie-icon wpie_icon-trash"></span> |
| 109 | 141 | <span class="wpie-item_heading_toogle"> |
| 110 | 142 | <span class="wpie-icon wpie_icon-chevron-down"></span> |
| 111 | 143 | <span class="wpie-icon wpie_icon-chevron-up "></span> |
| 112 | - </span> | |
| 144 | + </span> | |
| 113 | 145 | </summary> |
| 114 | 146 | <div class="wpie-item_content"> |
| 115 | 147 | |
| 148 | + <div class="wpie-fieldset"> | |
| 149 | + <div class="wpie-fields"> | |
| 150 | + <?php | |
| 151 | + $field->create( 'menu_1-item_tooltip', - 1 ); ?> | |
| 152 | + </div> | |
| 153 | + </div> | |
| 154 | + | |
| 116 | 155 | <div class="wpie-tabs-wrapper"> |
| 117 | 156 | |
| 118 | 157 | <div class="wpie-tabs-link"> |
| 119 | - <?php | |
| 120 | - $tab_i = 1; | |
| 121 | - foreach ( $data['tabs'] as $tab ) { | |
| 122 | - $active = $tab_i === 1 ? ' is-active' : ''; | |
| 123 | - echo '<a class="wpie-tab__link' . esc_attr( $active ) . '">' . esc_html( ucfirst( $tab ) ) . '</a>'; | |
| 124 | - $tab_i ++; | |
| 125 | - } | |
| 126 | - ?> | |
| 158 | + <a class="wpie-tab__link is-active"><?php | |
| 159 | + esc_html_e( 'Type', 'float-menu' ); ?></a> | |
| 160 | + <a class="wpie-tab__link"><?php | |
| 161 | + esc_html_e( 'Icon', 'float-menu' ); ?></a> | |
| 162 | + <a class="wpie-tab__link"><?php | |
| 163 | + esc_html_e( 'Style', 'float-menu' ); ?></a> | |
| 164 | + <a class="wpie-tab__link"><?php | |
| 165 | + esc_html_e( 'Attributes', 'float-menu' ); ?></a> | |
| 127 | 166 | </div> |
| 128 | 167 | |
| 129 | - <?php | |
| 130 | - $tabs_i = 1; | |
| 131 | - foreach ( $data['args'] as $tabs ) { | |
| 132 | - $active = $tabs_i === 1 ? ' is-active' : ''; | |
| 133 | - echo '<div class="wpie-tab-settings' . esc_attr( $active ) . '">'; | |
| 134 | - echo '<div class="wpie-fieldset">'; | |
| 168 | + <div class="wpie-tab-settings is-active"> | |
| 169 | + <div class="wpie-fieldset"> | |
| 170 | + <div class="wpie-fields"> | |
| 171 | + <?php | |
| 172 | + $field->create( 'menu_1-item_type', - 1 ); ?><?php | |
| 173 | + $field->create( 'menu_1-item_link', - 1 ); ?><?php | |
| 174 | + $field->create( 'menu_1-new_tab', - 1 ); ?> | |
| 175 | + </div> | |
| 176 | + </div> | |
| 135 | 177 | |
| 136 | - foreach ( $tabs as $tab ) { | |
| 137 | - echo '<div class="wpie-fields">'; | |
| 138 | 178 | |
| 139 | - foreach ( $tab as $option => $optionVal ) { | |
| 140 | - $field->create( 'menu_1-' . $option, -1 ); | |
| 141 | - } | |
| 142 | - echo '</div>'; | |
| 143 | - } | |
| 179 | + </div> | |
| 144 | 180 | |
| 145 | - echo '</div>'; | |
| 146 | - echo '</div>'; | |
| 181 | + <div class="wpie-tab-settings"> | |
| 182 | + <div class="wpie-fieldset"> | |
| 183 | + <div class="wpie-fields"> | |
| 184 | + <?php | |
| 185 | + $field->create( 'menu_1-item_icon', - 1 ); ?> | |
| 186 | + </div> | |
| 187 | + </div> | |
| 147 | 188 | |
| 148 | - $tabs_i ++; | |
| 149 | - } | |
| 150 | - ?> | |
| 189 | + </div> | |
| 190 | + | |
| 191 | + <div class="wpie-tab-settings"> | |
| 192 | + | |
| 193 | + <div class="wpie-fieldset"> | |
| 194 | + <div class="wpie-fields"> | |
| 195 | + <?php | |
| 196 | + $field->create( 'menu_1-color', - 1 ); ?><?php | |
| 197 | + $field->create( 'menu_1-hcolor', - 1 ); ?><?php | |
| 198 | + $field->create( 'menu_1-bcolor', - 1 ); ?><?php | |
| 199 | + $field->create( 'menu_1-hbcolor', - 1 ); ?> | |
| 200 | + </div> | |
| 201 | + </div> | |
| 202 | + </div> | |
| 203 | + | |
| 204 | + <div class="wpie-tab-settings"> | |
| 205 | + <div class="wpie-fieldset"> | |
| 206 | + <div class="wpie-legend"><?php | |
| 207 | + esc_html_e( 'Attributes', 'float-menu' ); ?></div> | |
| 208 | + <div class="wpie-fields"> | |
| 209 | + <?php | |
| 210 | + $field->create( 'menu_1-button_id', - 1 ); | |
| 211 | + $field->create( 'menu_1-button_class', - 1 ); | |
| 212 | + $field->create( 'menu_1-aria_label', - 1 ); ?> | |
| 213 | + </div> | |
| 214 | + </div> | |
| 215 | + | |
| 216 | + </div> | |
| 217 | + | |
| 151 | 218 | </div> |
| 152 | 219 | |
| 153 | 220 | |
| 154 | 221 | </div> |
| @@ -155,5 +222,4 @@ | ||
| 155 | 222 | </details> |
| 156 | 223 | </template> |
| 157 | 224 | |
| 158 | 225 | <?php |
| 159 | - | |