| 1 |
<?php |
| 2 |
/* |
| 3 |
* Page Name: Menu |
| 4 |
*/ |
| 5 |
|
| 6 |
use FloatMenuLite\Admin\CreateFields; |
| 7 |
|
| 8 |
defined( 'ABSPATH' ) || exit; |
| 9 |
|
| 10 |
$data = include( 'options/menu.php' ); |
| 11 |
|
| 12 |
$field = new CreateFields( $options, $data['opt'] ); |
| 13 |
|
| 14 |
$count = ( ! empty( $options['menu_1']['item_type'] ) ) ? count( $options['menu_1']['item_type'] ) : '0'; |
| 15 |
?> |
| 16 |
<div class="wpie-items__list" id="wpie-items-list"> |
| 17 |
<?php if ( $count > 0 ) : |
| 18 |
for ( $i = 0; $i < $count; $i ++ ): |
| 19 |
$order = $i + 1; |
| 20 |
$item_order = ! empty( $options['item_order'][ $i ] ) ? 1 : 0; |
| 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 |
?> |
| 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 ); ?>"> |
| 34 |
<summary class="wpie-item_heading"> |
| 35 |
<span class="wpie-item_heading_icon"></span> |
| 36 |
<span class="wpie-item_heading_label"></span> |
| 37 |
<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> |
| 41 |
<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> |
| 44 |
</span> |
| 45 |
</summary> |
| 46 |
<div class="wpie-item_content"> |
| 47 |
|
| 48 |
<div class="wpie-tabs-wrapper"> |
| 49 |
|
| 50 |
<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 |
?> |
| 59 |
</div> |
| 60 |
|
| 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">'; |
| 67 |
|
| 68 |
foreach ( $tabs as $tab ) { |
| 69 |
echo '<div class="wpie-fields">'; |
| 70 |
|
| 71 |
foreach ( $tab as $option => $optionVal ) { |
| 72 |
$field->create( 'menu_1-' . $option, $i ); |
| 73 |
} |
| 74 |
echo '</div>'; |
| 75 |
} |
| 76 |
|
| 77 |
echo '</div>'; |
| 78 |
echo '</div>'; |
| 79 |
|
| 80 |
$tabs_i ++; |
| 81 |
} |
| 82 |
?> |
| 83 |
</div> |
| 84 |
</div> |
| 85 |
</details> |
| 86 |
<?php endfor; endif; ?> |
| 87 |
|
| 88 |
<hr class="wpie-buttons__hr"> |
| 89 |
<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> |
| 92 |
</div> |
| 93 |
|
| 94 |
</div> |
| 95 |
|
| 96 |
|
| 97 |
<template id="template-button"> |
| 98 |
<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"> |
| 102 |
<summary class="wpie-item_heading"> |
| 103 |
<span class="wpie-item_heading_icon"></span> |
| 104 |
<span class="wpie-item_heading_label"></span> |
| 105 |
<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> |
| 109 |
<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> |
| 112 |
</span> |
| 113 |
</summary> |
| 114 |
<div class="wpie-item_content"> |
| 115 |
|
| 116 |
<div class="wpie-tabs-wrapper"> |
| 117 |
|
| 118 |
<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 |
?> |
| 127 |
</div> |
| 128 |
|
| 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">'; |
| 135 |
|
| 136 |
foreach ( $tabs as $tab ) { |
| 137 |
echo '<div class="wpie-fields">'; |
| 138 |
|
| 139 |
foreach ( $tab as $option => $optionVal ) { |
| 140 |
$field->create( 'menu_1-' . $option, -1 ); |
| 141 |
} |
| 142 |
echo '</div>'; |
| 143 |
} |
| 144 |
|
| 145 |
echo '</div>'; |
| 146 |
echo '</div>'; |
| 147 |
|
| 148 |
$tabs_i ++; |
| 149 |
} |
| 150 |
?> |
| 151 |
</div> |
| 152 |
|
| 153 |
|
| 154 |
</div> |
| 155 |
</details> |
| 156 |
</template> |
| 157 |
|
| 158 |
<?php |
| 159 |
|
| 160 |
|