| 1 |
<?php |
| 2 |
// phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-scope variables; file is included inside a function scope and variables are used immediately. |
| 3 |
|
| 4 |
if ( ! defined( 'ABSPATH' ) ) { |
| 5 |
exit; // Exit if accessed directly. |
| 6 |
} |
| 7 |
|
| 8 |
/** |
| 9 |
* Provide a admin area view for the plugin |
| 10 |
* |
| 11 |
* This file is used to markup the admin-facing aspects of the plugin. |
| 12 |
* |
| 13 |
* @link https://catchplugins.com |
| 14 |
* @since 1.0.0 |
| 15 |
* |
| 16 |
* @package Essential_Widgets |
| 17 |
* @subpackage Essential_Widgets/admin/partials |
| 18 |
*/ |
| 19 |
?> |
| 20 |
|
| 21 |
<!-- This file should primarily consist of HTML with a little bit of PHP. --> |
| 22 |
|
| 23 |
<div id="essential-widgets" class="ew-main"> |
| 24 |
<div class="content-wrapper"> |
| 25 |
<div class="header"> |
| 26 |
<h2><?php esc_html_e( 'Settings', 'essential-widgets' ); ?></h2> |
| 27 |
</div> <!-- .Header --> |
| 28 |
<div class="content"> |
| 29 |
|
| 30 |
<p class="info"> |
| 31 |
<span class="dashicons dashicons-info"></span> <?php esc_html_e( 'Switch the widgets On/Off as necessary in the section below.', 'essential-widgets' ); ?> <br /> |
| 32 |
<a class="" href="<?php echo esc_url( admin_url( 'widgets.php' ) ); ?>"><?php esc_html_e( 'Click here to manage the widgets', 'essential-widgets' ); ?></a> |
| 33 |
</p> |
| 34 |
|
| 35 |
<div class="module-container ew-options"> |
| 36 |
<?php |
| 37 |
$options = essential_widgets_get_options( 'essential_widgets_options' ); |
| 38 |
$widget_list = essential_widgets_list(); |
| 39 |
foreach ( $widget_list as $key => $value ) : |
| 40 |
$is_active = ! empty( $options[ $key ] ); |
| 41 |
?> |
| 42 |
<div id="module-<?php echo esc_attr( $key ); ?>" class="catch-modules"> |
| 43 |
<div class="module-header <?php echo $is_active ? 'active' : 'inactive'; ?>"> |
| 44 |
<h3 class="module-title"><?php echo esc_html( $value ); ?></h3> |
| 45 |
<div class="switch"> |
| 46 |
<input type="hidden" name="ew_nonce" id="ew_nonce" value="<?php echo esc_attr( wp_create_nonce( 'ew_nonce' ) ); ?>" /> |
| 47 |
<input type="checkbox" id="<?php echo esc_attr( $key ); ?>" class="input-switch" rel="<?php echo esc_attr( $key ); ?>" <?php checked( true, $is_active ); ?> > |
| 48 |
<label for="<?php echo esc_attr( $key ); ?>"></label> |
| 49 |
</div> |
| 50 |
<div class="loader"></div> |
| 51 |
</div><!-- .module-header --> |
| 52 |
</div><!-- .catch-modules --> |
| 53 |
<?php endforeach; ?> |
| 54 |
</div><!-- .module-container --> |
| 55 |
</div><!-- .content --> |
| 56 |
</div><!-- .content-wrapper --> |
| 57 |
</div> <!-- .ect-main--> |
| 58 |
|