PluginProbe ʕ •ᴥ•ʔ
WP All Export – Drag & Drop Export to Any Custom CSV, XML & Excel / trunk
WP All Export – Drag & Drop Export to Any Custom CSV, XML & Excel vtrunk
trunk 0.9.0 0.9.1 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.2.0 1.2.1 1.2.10 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.3.8 1.3.9 1.4.0 1.4.1 1.4.10 1.4.11 1.4.12 1.4.13 1.4.14 1.4.15 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.4.8 1.4.9 1.5.0
wp-all-export / src / Scheduling / views / SchedulingUI.php
wp-all-export / src / Scheduling / views Last commit date
ConnectionIcon.php 3 weeks ago ManualScheduling.php 3 weeks ago SaveSchedulingButton.php 3 weeks ago SchedulingActiveSitesLimitUI.php 3 weeks ago SchedulingSubscribeUI.php 3 weeks ago SchedulingUI.php 3 weeks ago
SchedulingUI.php
158 lines
1 <?php
2
3 defined( 'ABSPATH' ) || exit;
4
5 // phpcs:ignoreFile WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- variables in template files inherited from controller render() scope
6 $scheduling = \Wpae\Scheduling\Scheduling::create();
7 $hasActiveLicense = $scheduling->checkLicense()['success'] ?? false;
8 $cron_job_key = PMXE_Plugin::getInstance()->getOption('cron_job_key');
9 $options = PMXE_Plugin::getInstance()->getOption();
10 $export_id = $export->id;
11 $schedulingExportOptions = $export->options;
12 ?>
13
14 <div class="wpallexport-preview-content" style="max-height: 950px; overflow: visible;">
15 <input type="hidden" id="scheduling_export_id" value="<?php echo esc_attr($export_id); ?>"/>
16 <div style="margin-bottom: 20px;">
17 <label>
18 <input type="radio" name="scheduling_enable"
19 value="0" <?php if ((isset($post['scheduling_enable']) && $post['scheduling_enable'] == 0) || !isset($post['scheduling_enable'])) { ?> checked="checked" <?php } ?>/>
20 <h4 style="margin:0; display: inline-block;"><?php esc_html_e( 'Do Not Schedule', 'wp-all-export' ); ?></h4>
21 </label>
22 </div>
23 <div>
24 <label>
25 <input type="radio" name="scheduling_enable"
26 value="1" <?php if ($post['scheduling_enable'] == 1) { ?> checked="checked" <?php } ?>/>
27 <h4 style="margin: 0; display: inline-flex; align-items: center;"><?php esc_html_e('Automatic Scheduling', 'wp-all-export'); ?>
28 <span class="connection-icon" id="scheduling-connection-icon" style="margin-left: 8px; height: 16px;">
29 <?php include_once(PMXE_Plugin::ROOT_DIR . '/src/Scheduling/views/ConnectionIcon.php'); ?>
30 </span>
31 </h4>
32 </label>
33 </div>
34 <<?php echo !empty($is_dialog_context) ? 'form' : 'div';?> id="scheduling-form">
35 <div style="margin-bottom: 10px; margin-left:26px;">
36 <label style="font-size: 13px;">
37 <?php printf(
38 /* translators: 1: Export ID */
39 esc_html__('Run export ID %d on a schedule.', 'wp-all-export'),
40 (int)$export_id
41 ); ?>
42 </label>
43 </div>
44 <div id="automatic-scheduling"
45 style="margin-left: 21px; <?php if ($post['scheduling_enable'] != 1) { ?> display: none; <?php } ?>">
46 <div>
47 <div class="scheduling-schedule-input" id="scheduling-schedule-input">
48 <div class="input">
49 <label style="color: rgb(68,68,68);">
50 <input type="radio" <?php if (isset($post['scheduling_run_on']) && $post['scheduling_run_on'] != 'monthly') { ?> checked="checked" <?php } ?> name="scheduling_run_on" value="weekly" checked="checked"/>
51 <?php esc_html_e('Every week on...', 'wp-all-export'); ?>
52 </label>
53 </div>
54 <input type="hidden" style="width: 500px;" name="scheduling_weekly_days" value="<?php echo esc_attr($post['scheduling_weekly_days']); ?>" id="weekly_days"/>
55 <?php if (isset($post['scheduling_weekly_days'])) {
56 $weeklyArray = explode(',', $post['scheduling_weekly_days']);
57 } else {
58 $weeklyArray = array();
59 } ?>
60 <ul class="days-of-week" id="weekly" style="<?php if ($post['scheduling_run_on'] == 'monthly') { ?> display: none; <?php } ?>">
61 <li data-day="0" <?php if (in_array('0', $weeklyArray)) { ?> class="selected" <?php } ?>><?php esc_html_e('Mon', 'wp-all-export'); ?></li>
62 <li data-day="1" <?php if (in_array('1', $weeklyArray)) { ?> class="selected" <?php } ?>><?php esc_html_e('Tue', 'wp-all-export'); ?></li>
63 <li data-day="2" <?php if (in_array('2', $weeklyArray)) { ?> class="selected" <?php } ?>><?php esc_html_e('Wed', 'wp-all-export'); ?></li>
64 <li data-day="3" <?php if (in_array('3', $weeklyArray)) { ?> class="selected" <?php } ?>><?php esc_html_e('Thu', 'wp-all-export'); ?></li>
65 <li data-day="4" <?php if (in_array('4', $weeklyArray)) { ?> class="selected" <?php } ?>><?php esc_html_e('Fri', 'wp-all-export'); ?></li>
66 <li data-day="5" <?php if (in_array('5', $weeklyArray)) { ?> class="selected" <?php } ?>><?php esc_html_e('Sat', 'wp-all-export'); ?></li>
67 <li data-day="6" <?php if (in_array('6', $weeklyArray)) { ?> class="selected" <?php } ?>><?php esc_html_e('Sun', 'wp-all-export'); ?></li>
68 </ul>
69 <div style="clear: both;"></div>
70 <div>
71 <div class="input every-month">
72 <label style="color: rgb(68,68,68); margin-top: 5px;">
73 <input type="radio" <?php if (isset($post['scheduling_run_on']) && $post['scheduling_run_on'] == 'monthly') { ?> checked="checked" <?php } ?> name="scheduling_run_on" value="monthly"/>
74 <?php esc_html_e('Every month on the first...', 'wp-all-export'); ?>
75 </label>
76 </div>
77 <input type="hidden" name="scheduling_monthly_days" value="<?php echo isset($post['scheduling_monthly_days']) ? esc_attr($post['scheduling_monthly_days']) : ''; ?>" id="monthly_days"/>
78 <?php if (isset($post['scheduling_monthly_days'])) {
79 $monthlyArray = explode(',', $post['scheduling_monthly_days']);
80 } else {
81 $monthlyArray = array();
82 } ?>
83 <ul class="days-of-week" id="monthly" style="<?php if ($post['scheduling_run_on'] != 'monthly') { ?> display: none; <?php } ?>">
84 <li data-day="0" <?php if (in_array('0', $monthlyArray)) { ?> class="selected" <?php } ?>><?php esc_html_e('Mon', 'wp-all-export'); ?></li>
85 <li data-day="1" <?php if (in_array('1', $monthlyArray)) { ?> class="selected" <?php } ?>><?php esc_html_e('Tue', 'wp-all-export'); ?></li>
86 <li data-day="2" <?php if (in_array('2', $monthlyArray)) { ?> class="selected" <?php } ?>><?php esc_html_e('Wed', 'wp-all-export'); ?></li>
87 <li data-day="3" <?php if (in_array('3', $monthlyArray)) { ?> class="selected" <?php } ?>><?php esc_html_e('Thu', 'wp-all-export'); ?></li>
88 <li data-day="4" <?php if (in_array('4', $monthlyArray)) { ?> class="selected" <?php } ?>><?php esc_html_e('Fri', 'wp-all-export'); ?></li>
89 <li data-day="5" <?php if (in_array('5', $monthlyArray)) { ?> class="selected" <?php } ?>><?php esc_html_e('Sat', 'wp-all-export'); ?></li>
90 <li data-day="6" <?php if (in_array('6', $monthlyArray)) { ?> class="selected" <?php } ?>><?php esc_html_e('Sun', 'wp-all-export'); ?></li>
91 </ul>
92 </div>
93 <div style="clear: both;"></div>
94 <div id="times-container" style="margin-left: 5px;">
95 <div style="margin-top: 10px; margin-bottom: 5px;">
96 <?php esc_html_e('What times do you want this export to run?', 'wp-all-export'); ?>
97 </div>
98 <div id="times" style="margin-bottom: 10px;">
99 <?php if (isset($post['scheduling_times']) && is_array($post['scheduling_times'])) {
100 foreach ($post['scheduling_times'] as $time) { ?>
101 <?php if ($time) { ?>
102 <input class="timepicker" type="text" name="scheduling_times[]" value="<?php echo esc_attr($time); ?>"/>
103 <?php } ?>
104 <?php } ?>
105 <input class="timepicker" type="text" name="scheduling_times[]"/>
106 <?php } ?>
107 </div>
108 <div style="clear: both;"></div>
109 <div class="timezone-select" style="position:absolute; margin-top: 10px;">
110 <?php
111 $timezoneValue = $schedulingExportOptions['scheduling_timezone'] ?? false;
112 $timezoneSelect = new \Wpae\Scheduling\Timezone\TimezoneSelect();
113 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- TimezoneSelect builds a <select> from PHP's hardcoded timezone identifier list
114 echo $timezoneSelect->getTimezoneSelect($timezoneValue);
115 ?>
116 </div>
117 </div>
118 </div>
119 <div style="height: 35px; margin-top: 30px;" id="subscribe-filler">&nbsp;</div>
120 <?php if (!$hasActiveLicense) {
121 require_once(PMXE_Plugin::ROOT_DIR . '/src/Scheduling/views/SchedulingSubscribeUI.php');
122 require_once(PMXE_Plugin::ROOT_DIR . '/src/Scheduling/views/SchedulingActiveSitesLimitUI.php');
123 } ?>
124 </div>
125 </div>
126 </<?php echo !empty($is_dialog_context) ? 'form' : 'div';?>>
127 <?php require PMXE_Plugin::ROOT_DIR . '/src/Scheduling/views/ManualScheduling.php'; ?>
128
129 <script type="text/javascript">
130 jQuery(document).ready(function ($) {
131 let $timezone = $('#timezone');
132
133 $timezone.chosen({width: '320px'});
134
135 <?php if($schedulingExportOptions['scheduling_timezone'] == 'UTC') {?>
136 var timeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;
137
138 if($timezone.find("option:contains('"+ timeZone +"')").length != 0){
139
140 $timezone.val(timeZone);
141 $timezone.trigger("chosen:updated");
142
143 }else{
144
145 var parts = timeZone.split('/');
146 var lastPart = parts[parts.length-1];
147
148 var opt = $timezone.find("option:contains('"+ lastPart +"')");
149
150 $timezone.val(opt.val());
151 $timezone.trigger("chosen:updated");
152
153 }
154 <?php
155 }
156 ?>
157 });
158 </script>