html-admin-dashboard-setup.php
1 month ago
html-admin-page-addons-category-nav.php
4 years ago
html-admin-page-product-export.php
1 year ago
html-admin-page-reports.php
2 years ago
html-admin-page-status-logs-db.php
2 years ago
html-admin-page-status-logs.php
2 years ago
html-admin-page-status-report.php
2 months ago
html-admin-page-status-tools.php
1 month ago
html-admin-page-status.php
8 years ago
html-admin-settings.php
2 weeks ago
html-bulk-edit-product.php
1 year ago
html-email-template-preview.php
1 year ago
html-notice-custom.php
8 years ago
html-notice-update.php
6 months ago
html-notice-updated.php
7 years ago
html-notice-updating.php
6 years ago
html-quick-edit-product.php
2 weeks ago
html-report-by-date.php
5 years ago
html-admin-page-status-tools.php
73 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Admin View: Page - Status Tools |
| 4 | * |
| 5 | * @package WooCommerce |
| 6 | */ |
| 7 | |
| 8 | use Automattic\WooCommerce\Utilities\ArrayUtil; |
| 9 | |
| 10 | if ( ! defined( 'ABSPATH' ) ) { |
| 11 | exit; |
| 12 | } |
| 13 | |
| 14 | foreach ( $tools as $action_name => $tool ) { |
| 15 | ?> |
| 16 | <form id="<?php echo esc_attr( 'form_' . $action_name ); ?>" method="GET" action="<?php echo esc_attr( esc_url( admin_url( 'admin.php?foo=bar' ) ) ); ?>"> |
| 17 | <?php wp_nonce_field( 'debug_action', '_wpnonce', false ); ?> |
| 18 | <input type="hidden" name="page" value="wc-status"/> |
| 19 | <input type="hidden" name="tab" value="tools"/> |
| 20 | <input type="hidden" name="action" value="<?php echo esc_attr( $action_name ); ?>"/> |
| 21 | </form> |
| 22 | <?php |
| 23 | } |
| 24 | ?> |
| 25 | |
| 26 | <table class="wc_status_table wc_status_table--tools widefat" cellspacing="0"> |
| 27 | <tbody class="tools"> |
| 28 | <?php foreach ( $tools as $action_name => $tool ) : ?> |
| 29 | <?php |
| 30 | $row_classes = array( sanitize_html_class( $action_name ) ); |
| 31 | if ( ArrayUtil::is_truthy( $tool, 'requires_refresh' ) ) { |
| 32 | $row_classes[] = 'requires-refresh'; |
| 33 | } |
| 34 | ?> |
| 35 | <tr class="<?php echo esc_attr( implode( ' ', $row_classes ) ); ?>" data-tool-action="<?php echo esc_attr( $action_name ); ?>"> |
| 36 | <th> |
| 37 | <strong class="name"><?php echo esc_html( $tool['name'] ); ?></strong> |
| 38 | <p class="description"> |
| 39 | <?php |
| 40 | echo wp_kses_post( $tool['desc'] ); |
| 41 | if ( ! is_null( ArrayUtil::get_value_or_default( $tool, 'selector' ) ) ) { |
| 42 | $selector = $tool['selector']; |
| 43 | if ( isset( $selector['description'] ) ) { |
| 44 | echo '</p><p class="description">'; |
| 45 | echo wp_kses_post( $selector['description'] ); |
| 46 | } |
| 47 | printf( |
| 48 | ' <select style="width: 300px;" form="%1$s" id="%2$s" data-allow_clear="true" class="%3$s" name="%4$s" data-placeholder="%5$s" data-action="%6$s"></select>', |
| 49 | esc_attr( 'form_' . $action_name ), |
| 50 | esc_attr( 'selector_' . $action_name ), |
| 51 | esc_attr( $selector['class'] ), |
| 52 | esc_attr( $selector['name'] ), |
| 53 | esc_attr( $selector['placeholder'] ), |
| 54 | esc_attr( $selector['search_action'] ) |
| 55 | ); |
| 56 | } |
| 57 | ?> |
| 58 | </p> |
| 59 | </th> |
| 60 | <td class="run-tool"> |
| 61 | <span class="run-tool-actions"> |
| 62 | <input <?php disabled( ArrayUtil::is_truthy( $tool, 'disabled' ) ); ?> type="submit" form="<?php echo esc_attr( 'form_' . $action_name ); ?>" class="button button-large" value="<?php echo esc_attr( $tool['button'] ); ?>" /> |
| 63 | |
| 64 | <?php if ( ! empty( $tool['status_text'] ) ) : ?> |
| 65 | <span class="run-tool-status"><?php echo wp_kses_post( $tool['status_text'] ); ?></span> |
| 66 | <?php endif; ?> |
| 67 | </span> |
| 68 | </td> |
| 69 | </tr> |
| 70 | <?php endforeach; ?> |
| 71 | </tbody> |
| 72 | </table> |
| 73 |