| 1 |
<?php |
| 2 |
/** |
| 3 |
* Render the Modules option for the Plugin options |
| 4 |
* |
| 5 |
* @var array $modules_options The options for the modules |
| 6 |
* @var array $modules_options_selected The selected modules |
| 7 |
*/ |
| 8 |
|
| 9 |
// show a warning if no modules are selected |
| 10 |
if ( empty( $modules_options_selected ) ) : |
| 11 |
?> |
| 12 |
<div class="message error"> |
| 13 |
<p class="description"> |
| 14 |
<?php esc_html_e( 'No modules selected.', 'image-source-control-isc' ); ?> |
| 15 |
</p> |
| 16 |
</div> |
| 17 |
<?php |
| 18 |
endif; |
| 19 |
?> |
| 20 |
<div id="isc-settings-plugin-modules" class="isc-settings-highlighted"> |
| 21 |
<?php |
| 22 |
foreach ( $modules_options as $key => $_options ) : |
| 23 |
$is_pro = ! empty( $_options['is_pro'] ); |
| 24 |
?> |
| 25 |
<label> |
| 26 |
<input type="checkbox" name="isc_options[modules][]" value="<?php echo esc_attr( $key ); ?>" |
| 27 |
<?php checked( in_array( $key, $modules_options_selected, true ) ); ?> |
| 28 |
<?php echo $is_pro ? 'disabled="disabled" class="is-pro"' : ''; ?> |
| 29 |
/> |
| 30 |
<?php |
| 31 |
if ( $is_pro ) : |
| 32 |
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 33 |
echo ISC\Admin_Utils::get_pro_link( 'plugin-modules-' . sanitize_title( $_options['label'] ) ); |
| 34 |
endif; |
| 35 |
?> |
| 36 |
<?php echo isset( $_options['label'] ) ? esc_html( $_options['label'] ) : ''; ?> |
| 37 |
</label><br/> |
| 38 |
<?php |
| 39 |
if ( isset( $_options['description'] ) ) : |
| 40 |
?> |
| 41 |
<p class="description"> |
| 42 |
<?php |
| 43 |
echo esc_html( $_options['description'] ); |
| 44 |
?> |
| 45 |
</p> |
| 46 |
<?php |
| 47 |
endif; |
| 48 |
endforeach; |
| 49 |
?> |
| 50 |
</div> |
| 51 |
|