wordpress-popup
/
views
/
admin
/
commons
/
sui-listing
/
dialogs
/
import-module-settings-section.php
create-module
2 years ago
create-module.php
5 years ago
delete-module.php
6 years ago
import-module-settings-section.php
6 years ago
import-module.php
5 months ago
manage-tracking.php
6 years ago
import-module-settings-section.php
70 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Template used by the "Import" dialog (./import-module.php). |
| 4 | * |
| 5 | * Used to display the checkboxes for selecting the module's meta to be imported. |
| 6 | * |
| 7 | * @package Hustle |
| 8 | * @since 4.0.0 |
| 9 | */ |
| 10 | |
| 11 | ?> |
| 12 | <label class="sui-label"><?php esc_html_e( 'Settings to import', 'hustle' ); ?></label> |
| 13 | |
| 14 | <ul class="hui-inputs-list"> |
| 15 | |
| 16 | <li><label for="hustle-import-<?php echo esc_attr( $id ); ?>--all" class="sui-checkbox sui-checkbox-stacked sui-checkbox-sm"> |
| 17 | <input |
| 18 | class="hustle-import-check-all-checkbox" |
| 19 | type="checkbox" |
| 20 | id="hustle-import-<?php echo esc_attr( $id ); ?>--all" |
| 21 | name="<?php echo esc_attr( $id ); ?>_metas[]" |
| 22 | value="all" |
| 23 | checked |
| 24 | /> |
| 25 | <span aria-hidden="true"></span> |
| 26 | <span><?php esc_html_e( 'All', 'hustle' ); ?></span> |
| 27 | </label> |
| 28 | |
| 29 | <ul> |
| 30 | |
| 31 | <?php |
| 32 | // Don't print in the default order to follow the design. |
| 33 | $half = ceil( count( $metas ) / 2 ); |
| 34 | $chunks = array_chunk( $metas, $half ); |
| 35 | |
| 36 | for ( $i = 0; $i <= $half; $i++ ) { |
| 37 | |
| 38 | foreach ( $chunks as $chunk => $data ) { |
| 39 | |
| 40 | if ( isset( $data[ $i ] ) ) : |
| 41 | $name = $data[ $i ]['name']; |
| 42 | $label = $data[ $i ]['label']; |
| 43 | |
| 44 | ?> |
| 45 | |
| 46 | <li><label for="hustle-import-<?php echo esc_attr( $id ); ?>--<?php echo esc_attr( $name ); ?>" class="sui-checkbox sui-checkbox-stacked sui-checkbox-sm"> |
| 47 | <input |
| 48 | type="checkbox" |
| 49 | class="hustle-module-meta-checkbox" |
| 50 | id="hustle-import-<?php echo esc_attr( $id ); ?>--<?php echo esc_attr( $name ); ?>" |
| 51 | name="<?php echo esc_attr( $id ); ?>_metas[]" |
| 52 | value="<?php echo esc_attr( $name ); ?>" |
| 53 | checked |
| 54 | /> |
| 55 | <span aria-hidden="true"></span> |
| 56 | <span><?php echo esc_html( $label ); ?></span> |
| 57 | </label></li> |
| 58 | |
| 59 | <?php |
| 60 | endif; |
| 61 | } |
| 62 | } |
| 63 | ?> |
| 64 | |
| 65 | </ul> |
| 66 | |
| 67 | </li> |
| 68 | |
| 69 | </ul> |
| 70 |