@@ -88,7 +88,7 @@ protected function _renderSidebarContent() {
88
88
</form>
89
89
</div>
90
90
</li>
91
- <li class="group">
91
+ <li class="group visualizer-import-url ">
92
92
<h2 class="group-title sub-group visualizer-src-tab"><?php _e ( 'Import data from URL ' , 'visualizer ' ); ?> </h2>
93
93
<ul class="group-content">
94
94
<li class="subsection">
@@ -111,33 +111,43 @@ class="visualizer-input">
111
111
</form>
112
112
</div>
113
113
</li>
114
- <li class="subsection <?php echo apply_filters ( 'visualizer_pro_upsell_class ' ,'only-pro-feature ' ); ?> ">
115
- <span class="section-title"><?php _e ( 'Schedule Import ' , 'visualizer ' ); ?> <span
114
+ <li class="subsection <?php echo apply_filters ( 'visualizer_pro_upsell_class ' ,'only-pro-feature ' , ' schedule-chart ' ); ?> ">
115
+ <span class="section-title visualizer-import-url-schedule "><?php _e ( 'Schedule Import ' , 'visualizer ' ); ?> <span
116
116
class="dashicons dashicons-lock"></span></span>
117
117
<div class="section-items">
118
118
<p class="group-description"><?php _e ( 'You can choose here to synchronize your chart data with a remote CSV file. ' , 'visualizer ' ); ?> </p>
119
119
<p class="group-description"> <?php _e ( 'You can also synchronize with your Google Spreadsheet file, for more info check <a href="https://github.com/Codeinwp/visualizer/wiki/How-can-I-populate-data-from-Google-Spreadsheet%3F" target="_blank" >this</a> tutorial ' , 'visualizer ' ); ?> </p>
120
120
<p class="group-description"> <?php _e ( 'We will update the chart data based on your time interval preference by overwritting the current data with the one from the URL. ' , 'visualizer ' ); ?> </p>
121
- <form id="vz-schedule-import" action=" " method="post"
121
+ <form id="vz-schedule-import" action="<?php echo $ upload_link ?> " method="post"
122
122
target="thehole" enctype="multipart/form-data">
123
123
<div class="remote-file-section">
124
- <input type="url" id="vz-schedule-url" name="remote_data"
124
+ <input type="url" id="vz-schedule-url" name="remote_data" value=" <?php echo get_post_meta ( $ this -> chart -> ID , Visualizer_Plugin:: CF_CHART_URL , true ); ?> "
125
125
placeholder="<?php esc_html_e ( 'Please enter the URL of CSV file ' , 'visualizer ' ); ?> "
126
- class="visualizer-input">
126
+ class="visualizer-input visualizer-remote-url ">
127
127
<p class="group-description"><?php _e ( 'How often do you want to check the url ' , 'visualizer ' ); ?> </p>
128
- <select name="vz-import-time" id="vz-import-time"
129
- class="visualizer-select">
130
- <option value="3600"><?php _e ( 'Each hour ' , 'visualizer ' ); ?> </option>
131
- <option value="43200"><?php _e ( 'Each 12 hours ' , 'visualizer ' ); ?> </option>
132
- <option value="86400"><?php _e ( 'Each day ' , 'visualizer ' ); ?> </option>
133
- <option value="259200"><?php _e ( 'Each 3 days ' , 'visualizer ' ); ?> </option>
128
+ <select name="vz-import-time" id="vz-import-time" class="visualizer-select">
129
+ <?php
130
+ $ hours = get_post_meta ( $ this ->chart ->ID , Visualizer_Plugin::CF_CHART_SCHEDULE , true );
131
+ $ schedules = array (
132
+ '1 ' => __ ( 'Each hour ' , 'visualizer ' ),
133
+ '12 ' => __ ( 'Each 12 hours ' , 'visualizer ' ),
134
+ '24 ' => __ ( 'Each day ' , 'visualizer ' ),
135
+ '36 ' => __ ( 'Each 3 days ' , 'visualizer ' ),
136
+ );
137
+ foreach ( $ schedules as $ num => $ name ) {
138
+ $ extra = $ num == $ hours ? 'selected ' : '' ;
139
+ ?>
140
+ <option value="<?php echo $ num ;?> " <?php echo $ extra ;?> ><?php echo $ name ;?> </option>
141
+ <?php
142
+ }
143
+ ?>
134
144
</select>
135
145
</div>
136
146
<input type="button" id="vz-save-schedule" class="button button-primary"
137
147
value="<?php _e ( 'Save schedule ' , 'visualizer ' ); ?> ">
138
148
139
149
140
- <?php echo apply_filters ( 'visualizer_pro_upsell ' , '' ); ?>
150
+ <?php echo apply_filters ( 'visualizer_pro_upsell ' , '' , ' schedule-chart ' ); ?>
141
151
</form>
142
152
</div>
143
153
</li>
0 commit comments