| 1 |
<?php if (!defined('ABSPATH')) die('No direct access allowed'); ?> |
| 2 |
<div id="wpo_logging_settings"> |
| 3 |
<h3><?php esc_html_e('Logging settings', 'wp-optimize'); ?></h3> |
| 4 |
|
| 5 |
<div id="wp-optimize-logger-settings" class="wpo-fieldgroup"> |
| 6 |
<p> |
| 7 |
<a href="#" id="wpo_add_logger_link" class="wpo-repeater__add"><span class="dashicons dashicons-plus"></span> <?php esc_html_e('Add logging destination', 'wp-optimize'); ?></a> |
| 8 |
|
| 9 |
</p> |
| 10 |
|
| 11 |
<div class="save_settings_reminder"><?php esc_html_e('Remember to save your settings so that your changes take effect.', 'wp-optimize'); ?></div> |
| 12 |
|
| 13 |
<?php |
| 14 |
|
| 15 |
$loggers = $loggers_data['existing_loggers']; |
| 16 |
|
| 17 |
if (count($loggers) > 0) { |
| 18 |
|
| 19 |
?> |
| 20 |
<div id="wp-optimize-logging-options"> |
| 21 |
<div class="wpo_logging_header"> |
| 22 |
<div class="wpo_logging_logger_title"><?php esc_html_e('Destination', 'wp-optimize'); ?></div> |
| 23 |
<div class="wpo_logging_options_title"><?php esc_html_e('Options', 'wp-optimize'); ?></div> |
| 24 |
<div class="wpo_logging_status_title"><?php esc_html_e('Status', 'wp-optimize'); ?></div> |
| 25 |
<div class="wpo_logging_actions_title"><?php esc_html_e('Actions', 'wp-optimize'); ?></div> |
| 26 |
</div> |
| 27 |
<?php |
| 28 |
|
| 29 |
foreach ($loggers as $logger) { |
| 30 |
$logger_id = $logger['id']; |
| 31 |
|
| 32 |
?> |
| 33 |
|
| 34 |
<div class="wpo_logging_row" data-id="<?php echo esc_attr($logger_id); ?>"> |
| 35 |
<div class="wpo_logging_logger_row"><span |
| 36 |
class="dashicons dashicons-arrow-right"></span><?php echo esc_html($logger['description']); ?> |
| 37 |
</div> |
| 38 |
<div class="wpo_logging_options_row"><?php echo esc_html($logger['options_text']); ?></div> |
| 39 |
|
| 40 |
<div class="wpo_logging_status_row <?php echo esc_attr($logger['status']); ?>"><?php echo esc_html($logger['status_text']); ?></div> |
| 41 |
|
| 42 |
<div class="wpo_logging_actions_row"> |
| 43 |
<span class="wpo_edit_logger" title="<?php esc_attr_e('Edit', 'wp-optimize'); ?>"><?php esc_html_e('Edit', 'wp-optimize'); ?></span> |
| 44 |
<span class="wpo_delete_logger" title="<?php esc_attr_e('Delete', 'wp-optimize'); ?>"><?php esc_html_e('Delete', 'wp-optimize'); ?></span> |
| 45 |
</div> |
| 46 |
|
| 47 |
<div class="wpo_logging_edit_row"> |
| 48 |
<span class="wpo_cancel_logging button button-secondary" title="<?php esc_attr_e('Cancel', 'wp-optimize'); ?>"><?php esc_html_e('Cancel', 'wp-optimize'); ?></span> |
| 49 |
<span class="wpo_save_logging button button-primary" title="<?php esc_attr_e('Apply', 'wp-optimize'); ?>"><?php esc_html_e('Apply', 'wp-optimize'); ?></span> |
| 50 |
</div> |
| 51 |
|
| 52 |
<div class="wpo_additional_logger_options wpo_hidden"> |
| 53 |
<input class="wpo_hidden" type="hidden" name="wpo-logger-type[]" |
| 54 |
value="<?php echo esc_attr($logger_id); ?>" /> |
| 55 |
|
| 56 |
<?php |
| 57 |
$options_list = $logger['options_list']; |
| 58 |
|
| 59 |
if (!empty($options_list)) { |
| 60 |
foreach ($options_list as $option) { |
| 61 |
|
| 62 |
?> |
| 63 |
<input class="wpo_logger_addition_option" type="text" |
| 64 |
name="wpo-logger-options[<?php echo esc_attr($option['name']); ?>][]" |
| 65 |
value="<?php echo esc_attr($option['value']); ?>" |
| 66 |
placeholder="<?php echo esc_attr($option['placeholder']); ?>" |
| 67 |
<?php echo $option['data_validate_attr']; // phpcs:ignore WordPress.Security.EscapeOutput -- Output is already escaped |
| 68 |
?>/> |
| 69 |
<?php |
| 70 |
} |
| 71 |
} |
| 72 |
?> |
| 73 |
<label> |
| 74 |
<input class=" wpo_logger_active_checkbox" |
| 75 |
type="checkbox" <?php checked($logger['is_enabled'] && $logger['is_available']); ?> <?php disabled($logger['is_available'], false); ?>> |
| 76 |
<input type="hidden" name="wpo-logger-options[active][]" |
| 77 |
value="<?php echo $logger['is_enabled'] ? '1' : '0'; ?>" /> |
| 78 |
<?php esc_html_e('Active', 'wp-optimize'); ?> |
| 79 |
</label> |
| 80 |
</div> |
| 81 |
|
| 82 |
</div> |
| 83 |
<?php |
| 84 |
} |
| 85 |
?> |
| 86 |
</div><!-- End #wp-optimize-logging-options --> |
| 87 |
<?php |
| 88 |
} |
| 89 |
?> |
| 90 |
</div><!-- End #wp-optimize-logger-settings --> |
| 91 |
</div> |