| @@ -6,11 +6,11 @@ | ||
| 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"> |
| @@ -18,70 +18,89 @@ | ||
| 18 | 18 | for ( $i = 0; $i < $count; $i ++ ): |
| 19 | 19 | $order = $i + 1; |
| 20 | 20 | $item_order = ! empty( $options['item_order'][ $i ] ) ? 1 : 0; |
| 21 | 21 | $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 | 22 | ?> |
| 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" | |
| 23 | + <details class="wpie-item"<?php echo esc_attr( $open ); ?>> | |
| 24 | + <input type="hidden" name="item_order[]" class="wpie-item__toggle" | |
| 31 | 25 | 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 ); ?>"> | |
| 34 | 26 | <summary class="wpie-item_heading"> |
| 35 | 27 | <span class="wpie-item_heading_icon"></span> |
| 36 | 28 | <span class="wpie-item_heading_label"></span> |
| 37 | 29 | <span class="wpie-item_heading_type"></span> |
| 38 | - <span class="wpie-icon wpie_icon-copy"></span> | |
| 39 | - <span class="wpie-icon wpie_icon-chevron-expand-y"></span> | |
| 40 | - <span class="wpie-icon wpie_icon-trash"></span> | |
| 30 | + <span class="wpie-item_heading_sub"></span> | |
| 31 | + <span class="dashicons dashicons-move"></span> | |
| 32 | + <span class="dashicons dashicons-trash"></span> | |
| 41 | 33 | <span class="wpie-item_heading_toogle"> |
| 42 | - <span class="wpie-icon wpie_icon-chevron-down"></span> | |
| 43 | - <span class="wpie-icon wpie_icon-chevron-up "></span> | |
| 34 | + <span class="dashicons dashicons-arrow-down"></span> | |
| 35 | + <span class="dashicons dashicons-arrow-up "></span> | |
| 44 | 36 | </span> |
| 45 | 37 | </summary> |
| 46 | 38 | <div class="wpie-item_content"> |
| 47 | 39 | |
| 40 | + <div class="wpie-fieldset"> | |
| 41 | + <div class="wpie-fields"> | |
| 42 | + <?php $field->create( 'menu_1-item_tooltip', $i ); ?> | |
| 43 | + </div> | |
| 44 | + </div> | |
| 45 | + | |
| 48 | 46 | <div class="wpie-tabs-wrapper"> |
| 49 | 47 | |
| 50 | 48 | <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 | - ?> | |
| 49 | + <a class="wpie-tab__link is-active"><?php esc_html_e( 'Type', 'float-menu' ); ?></a> | |
| 50 | + <a class="wpie-tab__link"><?php esc_html_e( 'Icon', 'float-menu' ); ?></a> | |
| 51 | + <a class="wpie-tab__link"><?php esc_html_e( 'Style', 'float-menu' ); ?></a> | |
| 52 | + <a class="wpie-tab__link"><?php esc_html_e( 'Attributes', 'float-menu' ); ?></a> | |
| 59 | 53 | </div> |
| 60 | 54 | |
| 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">'; | |
| 55 | + <div class="wpie-tab-settings is-active"> | |
| 56 | + <div class="wpie-fieldset"> | |
| 57 | + <div class="wpie-fields"> | |
| 58 | + <?php $field->create( 'menu_1-item_type', $i ); ?> | |
| 59 | + <?php $field->create( 'menu_1-item_link', $i ); ?> | |
| 60 | + <?php $field->create( 'menu_1-new_tab', $i ); ?> | |
| 61 | + </div> | |
| 62 | + </div> | |
| 67 | 63 | |
| 68 | - foreach ( $tabs as $tab ) { | |
| 69 | - echo '<div class="wpie-fields">'; | |
| 70 | 64 | |
| 71 | - foreach ( $tab as $option => $optionVal ) { | |
| 72 | - $field->create( 'menu_1-' . $option, $i ); | |
| 73 | - } | |
| 74 | - echo '</div>'; | |
| 75 | - } | |
| 65 | + </div> | |
| 76 | 66 | |
| 77 | - echo '</div>'; | |
| 78 | - echo '</div>'; | |
| 67 | + <div class="wpie-tab-settings"> | |
| 68 | + <div class="wpie-fieldset"> | |
| 69 | + <div class="wpie-fields"> | |
| 70 | + <?php $field->create( 'menu_1-item_icon', $i ); ?> | |
| 71 | + </div> | |
| 72 | + </div> | |
| 79 | 73 | |
| 80 | - $tabs_i ++; | |
| 81 | - } | |
| 82 | - ?> | |
| 74 | + </div> | |
| 75 | + | |
| 76 | + <div class="wpie-tab-settings"> | |
| 77 | + | |
| 78 | + <div class="wpie-fieldset"> | |
| 79 | + <div class="wpie-fields"> | |
| 80 | + <?php $field->create( 'menu_1-color', $i ); ?> | |
| 81 | + <?php $field->create( 'menu_1-hcolor', $i ); ?> | |
| 82 | + <?php $field->create( 'menu_1-bcolor', $i ); ?> | |
| 83 | + <?php $field->create( 'menu_1-hbcolor', $i ); ?> | |
| 84 | + </div> | |
| 85 | + </div> | |
| 86 | + | |
| 87 | + </div> | |
| 88 | + | |
| 89 | + <div class="wpie-tab-settings"> | |
| 90 | + <div class="wpie-fieldset"> | |
| 91 | + <div class="wpie-legend"><?php esc_html_e( 'Attributes', 'float-menu' ); ?></div> | |
| 92 | + <div class="wpie-fields"> | |
| 93 | + <?php $field->create( 'menu_1-button_id', $i ); ?> | |
| 94 | + <?php $field->create( 'menu_1-button_class', $i ); ?> | |
| 95 | + <?php $field->create( 'menu_1-link_rel', $i ); ?> | |
| 96 | + </div> | |
| 97 | + </div> | |
| 98 | + </div> | |
| 99 | + | |
| 83 | 100 | </div> |
| 101 | + | |
| 102 | + | |
| 84 | 103 | </div> |
| 85 | 104 | </details> |
| 86 | 105 | <?php endfor; endif; ?> |
| 87 | 106 | |
| @@ -95,60 +114,83 @@ | ||
| 95 | 114 | |
| 96 | 115 | |
| 97 | 116 | <template id="template-button"> |
| 98 | 117 | <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"> | |
| 118 | + <input type="hidden" name="item_order[]" class="wpie-item__toggle" value="1"> | |
| 102 | 119 | <summary class="wpie-item_heading"> |
| 103 | 120 | <span class="wpie-item_heading_icon"></span> |
| 104 | 121 | <span class="wpie-item_heading_label"></span> |
| 105 | 122 | <span class="wpie-item_heading_type"></span> |
| 106 | - <span class="wpie-icon wpie_icon-copy"></span> | |
| 107 | - <span class="wpie-icon wpie_icon-chevron-expand-y"></span> | |
| 108 | - <span class="wpie-icon wpie_icon-trash"></span> | |
| 123 | + <span class="wpie-item_heading_sub"></span> | |
| 124 | + <span class="dashicons dashicons-move"></span> | |
| 125 | + <span class="dashicons dashicons-trash"></span> | |
| 109 | 126 | <span class="wpie-item_heading_toogle"> |
| 110 | - <span class="wpie-icon wpie_icon-chevron-down"></span> | |
| 111 | - <span class="wpie-icon wpie_icon-chevron-up "></span> | |
| 127 | + <span class="dashicons dashicons-arrow-down"></span> | |
| 128 | + <span class="dashicons dashicons-arrow-up "></span> | |
| 112 | 129 | </span> |
| 113 | 130 | </summary> |
| 114 | 131 | <div class="wpie-item_content"> |
| 115 | 132 | |
| 133 | + <div class="wpie-fieldset"> | |
| 134 | + <div class="wpie-fields"> | |
| 135 | + <?php $field->create( 'menu_1-item_tooltip', - 1 ); ?> | |
| 136 | + </div> | |
| 137 | + </div> | |
| 138 | + | |
| 116 | 139 | <div class="wpie-tabs-wrapper"> |
| 117 | 140 | |
| 118 | 141 | <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 | - ?> | |
| 142 | + <a class="wpie-tab__link is-active"><?php esc_html_e( 'Type', 'float-menu' ); ?></a> | |
| 143 | + <a class="wpie-tab__link"><?php esc_html_e( 'Icon', 'float-menu' ); ?></a> | |
| 144 | + <a class="wpie-tab__link"><?php esc_html_e( 'Style', 'float-menu' ); ?></a> | |
| 145 | + <a class="wpie-tab__link"><?php esc_html_e( 'Attributes', 'float-menu' ); ?></a> | |
| 127 | 146 | </div> |
| 128 | 147 | |
| 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">'; | |
| 148 | + <div class="wpie-tab-settings is-active"> | |
| 149 | + <div class="wpie-fieldset"> | |
| 150 | + <div class="wpie-fields"> | |
| 151 | + <?php $field->create( 'menu_1-item_type', - 1 ); ?> | |
| 152 | + <?php $field->create( 'menu_1-item_link', - 1 ); ?> | |
| 153 | + <?php $field->create( 'menu_1-new_tab', - 1 ); ?> | |
| 154 | + </div> | |
| 155 | + </div> | |
| 135 | 156 | |
| 136 | - foreach ( $tabs as $tab ) { | |
| 137 | - echo '<div class="wpie-fields">'; | |
| 138 | 157 | |
| 139 | - foreach ( $tab as $option => $optionVal ) { | |
| 140 | - $field->create( 'menu_1-' . $option, -1 ); | |
| 141 | - } | |
| 142 | - echo '</div>'; | |
| 143 | - } | |
| 158 | + </div> | |
| 144 | 159 | |
| 145 | - echo '</div>'; | |
| 146 | - echo '</div>'; | |
| 160 | + <div class="wpie-tab-settings"> | |
| 161 | + <div class="wpie-fieldset"> | |
| 162 | + <div class="wpie-fields"> | |
| 163 | + <?php $field->create( 'menu_1-item_icon', - 1 ); ?> | |
| 164 | + </div> | |
| 165 | + </div> | |
| 147 | 166 | |
| 148 | - $tabs_i ++; | |
| 149 | - } | |
| 150 | - ?> | |
| 167 | + </div> | |
| 168 | + | |
| 169 | + <div class="wpie-tab-settings"> | |
| 170 | + | |
| 171 | + <div class="wpie-fieldset"> | |
| 172 | + <div class="wpie-fields"> | |
| 173 | + <?php $field->create( 'menu_1-color', - 1 ); ?> | |
| 174 | + <?php $field->create( 'menu_1-hcolor', - 1 ); ?> | |
| 175 | + <?php $field->create( 'menu_1-bcolor', - 1 ); ?> | |
| 176 | + <?php $field->create( 'menu_1-hbcolor', - 1 ); ?> | |
| 177 | + </div> | |
| 178 | + </div> | |
| 179 | + </div> | |
| 180 | + | |
| 181 | + <div class="wpie-tab-settings"> | |
| 182 | + <div class="wpie-fieldset"> | |
| 183 | + <div class="wpie-legend"><?php esc_html_e( 'Attributes', 'float-menu' ); ?></div> | |
| 184 | + <div class="wpie-fields"> | |
| 185 | + <?php $field->create( 'menu_1-button_id', - 1 ); ?> | |
| 186 | + <?php $field->create( 'menu_1-button_class', - 1 ); ?> | |
| 187 | + <?php $field->create( 'menu_1-link_rel', - 1 ); ?> | |
| 188 | + </div> | |
| 189 | + </div> | |
| 190 | + | |
| 191 | + </div> | |
| 192 | + | |
| 151 | 193 | </div> |
| 152 | 194 | |
| 153 | 195 | |
| 154 | 196 | </div> |
| @@ -155,5 +197,4 @@ | ||
| 155 | 197 | </details> |
| 156 | 198 | </template> |
| 157 | 199 | |
| 158 | 200 | <?php |
| 159 | - | |