WordPress Download Manager - Version 3.2.47

Version Description

  • 2022.06.30 =
  • Fixed input filtering issue with the Insert URL option
Download this release

Release Info

Developer codename065
Plugin Icon 128x128 WordPress Download Manager
Version 3.2.47
Comparing to
See all releases

Code changes from version 3.2.46 to 3.2.47

download-manager.php CHANGED
@@ -5,7 +5,7 @@ Plugin URI: https://www.wpdownloadmanager.com/purchases/
5
  Description: Manage, Protect and Track file downloads, and sell digital products from your WordPress site. A complete digital asset management solution.
6
  Author: W3 Eden, Inc.
7
  Author URI: https://www.wpdownloadmanager.com/
8
- Version: 3.2.46
9
  Text Domain: download-manager
10
  Domain Path: /languages
11
  */
@@ -39,7 +39,7 @@ use WPDM\Widgets\WidgetController;
39
 
40
  global $WPDM;
41
 
42
- define('WPDM_VERSION','3.2.46');
43
 
44
  define('WPDM_TEXT_DOMAIN','download-manager');
45
 
5
  Description: Manage, Protect and Track file downloads, and sell digital products from your WordPress site. A complete digital asset management solution.
6
  Author: W3 Eden, Inc.
7
  Author URI: https://www.wpdownloadmanager.com/
8
+ Version: 3.2.47
9
  Text Domain: download-manager
10
  Domain Path: /languages
11
  */
39
 
40
  global $WPDM;
41
 
42
+ define('WPDM_VERSION','3.2.47');
43
 
44
  define('WPDM_TEXT_DOMAIN','download-manager');
45
 
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: download manager, document management, file manager, digital store, ecomme
5
  Requires at least: 5.3
6
  Tested up to: 6.0
7
  License: GPLv2 or later
8
- Stable tag: 3.2.46
9
 
10
 
11
  This File Management & Digital Store plugin will help you to control file downloads & sell digital products from your WP site.
@@ -181,6 +181,9 @@ Check download stats and get a push notification when someone downloads, install
181
 
182
  == Changelog ==
183
 
 
 
 
184
  = 3.2.46 - 2022.06.29 =
185
  * Fixed input filtering issue with the Insert URL option
186
 
5
  Requires at least: 5.3
6
  Tested up to: 6.0
7
  License: GPLv2 or later
8
+ Stable tag: 3.2.47
9
 
10
 
11
  This File Management & Digital Store plugin will help you to control file downloads & sell digital products from your WP site.
181
 
182
  == Changelog ==
183
 
184
+ = 3.2.47 - 2022.06.30 =
185
+ * Fixed input filtering issue with the Insert URL option
186
+
187
  = 3.2.46 - 2022.06.29 =
188
  * Fixed input filtering issue with the Insert URL option
189
 
src/Admin/views/metaboxes/attach-file-datatable.php DELETED
@@ -1,181 +0,0 @@
1
- <div id="ftabs">
2
- <ul>
3
- <li><a href="#upload"><?php echo __( "Upload" , "download-manager" ); ?></a></li>
4
- <?php if(current_user_can('access_server_browser')){ ?>
5
- <li><a href="#browse"><?php echo __( "Browse" , "download-manager" ); ?></a></li>
6
- <?php } ?>
7
- <li><a href="#remote"><?php echo __( "URL" , "download-manager" ); ?></a></li>
8
- </ul>
9
-
10
- <div id="upload">
11
- <div id="plupload-upload-ui" class="hide-if-no-js">
12
- <div id="drag-drop-area">
13
- <div class="drag-drop-inside">
14
- <p class="drag-drop-info"><?php _e('Drop files here'); ?></p>
15
- <p><?php _ex('or', 'Uploader: Drop files here - or - Select Files'); ?></p>
16
- <p class="drag-drop-buttons"><input id="plupload-browse-button" type="button" value="<?php esc_attr_e('Select Files'); ?>" class="button" /></p>
17
- </div>
18
- </div>
19
- </div>
20
-
21
- <?php
22
-
23
- $plupload_init = array(
24
- 'runtimes' => 'html5,silverlight,flash,html4',
25
- 'browse_button' => 'plupload-browse-button',
26
- 'container' => 'plupload-upload-ui',
27
- 'drop_element' => 'drag-drop-area',
28
- 'file_data_name' => 'package_file',
29
- 'multiple_queues' => true,
30
- 'max_file_size' => wp_max_upload_size().'b',
31
- 'url' => admin_url('admin-ajax.php'),
32
- 'flash_swf_url' => includes_url('js/plupload/plupload.flash.swf'),
33
- 'silverlight_xap_url' => includes_url('js/plupload/plupload.silverlight.xap'),
34
- 'filters' => array(array('title' => __('Allowed Files'), 'extensions' => '*')),
35
- 'multipart' => true,
36
- 'urlstream_upload' => true,
37
-
38
- // additional post data to send to our ajax hook
39
- 'multipart_params' => array(
40
- '_ajax_nonce' => wp_create_nonce('wpdm_admin_upload_file'),
41
- 'action' => 'wpdm_admin_upload_file', // the ajax action name
42
- ),
43
- );
44
-
45
- // we should probably not apply this filter, plugins may expect wp's media uploader...
46
- $plupload_init = apply_filters('plupload_init', $plupload_init); ?>
47
-
48
- <script type="text/javascript">
49
-
50
- jQuery(document).ready(function($){
51
-
52
- // create the uploader and pass the config from above
53
- var uploader = new plupload.Uploader(<?php echo json_encode($plupload_init); ?>);
54
-
55
- // checks if browser supports drag and drop upload, makes some css adjustments if necessary
56
- uploader.bind('Init', function(up){
57
- var uploaddiv = jQuery('#plupload-upload-ui');
58
-
59
- if(up.features.dragdrop){
60
- uploaddiv.addClass('drag-drop');
61
- jQuery('#drag-drop-area')
62
- .bind('dragover.wp-uploader', function(){ uploaddiv.addClass('drag-over'); })
63
- .bind('dragleave.wp-uploader, drop.wp-uploader', function(){ uploaddiv.removeClass('drag-over'); });
64
-
65
- }else{
66
- uploaddiv.removeClass('drag-drop');
67
- jQuery('#drag-drop-area').unbind('.wp-uploader');
68
- }
69
- });
70
-
71
- uploader.init();
72
-
73
- // a file was added in the queue
74
- uploader.bind('FilesAdded', function(up, files){
75
- //var hundredmb = 100 * 1024 * 1024, max = parseInt(up.settings.max_file_size, 10);
76
-
77
-
78
-
79
- plupload.each(files, function(file){
80
- jQuery('#filelist').append(
81
- '<div class="file" id="' + file.id + '"><b>' +
82
-
83
- file.name + '</b> (<span>' + plupload.formatSize(0) + '</span>/' + plupload.formatSize(file.size) + ') ' +
84
- '<div class="progress progress-success progress-striped active"><div class="bar fileprogress"></div></div></div>');
85
- });
86
-
87
- up.refresh();
88
- up.start();
89
- });
90
-
91
- uploader.bind('UploadProgress', function(up, file) {
92
-
93
- jQuery('#' + file.id + " .fileprogress").width(file.percent + "%");
94
- jQuery('#' + file.id + " span").html(plupload.formatSize(parseInt(file.size * file.percent / 100)));
95
- });
96
-
97
-
98
- // a file was uploaded
99
- uploader.bind('FileUploaded', function(up, file, response) {
100
-
101
- // this is your ajax response, update the DOM with it or something...
102
- //console.log(response);
103
- //response
104
- jQuery('#' + file.id ).remove();
105
- var d = new Date();
106
- var ID = d.getTime();
107
- response = response.response;
108
- var nm = response;
109
- if(response.length>20) nm = response.substring(0,7)+'...'+response.substring(response.length-10);
110
- //jQuery('#currentfiles table.widefat').append("<tr id='"+ID+"' class='cfile'><td><input type='hidden' id='in_"+ID+"' name='files[]' value='"+response+"' /><img id='del_"+ID+"' src='<?php echo plugins_url(); ?>/download-manager/images/minus.png' rel='del' align=left /></td><td>"+response+"</td><td width='40%'><input style='width:99%' type='text' name='file[fileinfo]["+response+"][title]' value='"+response+"' onclick='this.select()'></td><td><input size='10' type='text' id='indpass_"+ID+"' name='file[fileinfo]["+response+"][password]' value=''> <img style='cursor: pointer;float: right;margin-top: -3px' class='genpass' onclick=\"return generatepass('indpass_"+ID+"')\" title='Generate Password' src=\"<?php echo plugins_url('download-manager/images/generate-pass.png'); ?>\" /></td></tr>");
111
- jQuery('#wpdm-files').dataTable().fnAddData( [
112
- "<input type='hidden' id='in_"+ID+"' name='file[files]["+ID+"]' value='"+response+"' /><i id='del_"+ID+"' class='fa fa-trash-o action-ico text-danger' rel='del'></i>",
113
- response,
114
- "<input class='form-control input-sm' type='text' name='file[fileinfo]["+ID+"][title]' value='"+response+"' onclick='this.select()'>",
115
- "<div class='input-group'><input size='10' class='form-control input-sm' type='text' id='indpass_"+ID+"' name='file[fileinfo]["+ID+"][password]' value=''><span class='input-group-btn'><button class='genpass btn btn-secondary btn-sm' type='button' onclick=\"return generatepass('indpass_"+ID+"')\" title='Generate Password'><i class='fa fa-key'></i></button>"
116
- ] );
117
-
118
-
119
-
120
- jQuery('#wpdm-files tbody tr:last-child').attr('id',ID).addClass('cfile');
121
-
122
- jQuery("#wpdm-files tbody").sortable();
123
-
124
- jQuery('#'+ID).fadeIn();
125
-
126
-
127
-
128
-
129
- });
130
-
131
- });
132
-
133
- </script>
134
- <div id="filelist"></div>
135
-
136
- <div class="clear"></div>
137
- </div>
138
-
139
- <div id="browse">
140
- <?php if(current_user_can('access_server_browser')) wpdm_file_browser(); ?>
141
- </div>
142
- <div id="remote" class="w3eden">
143
- <div class="input-group"><input type="url" id="rurl" class="form-control" placeholder="Insert URL"><span class="input-group-btn"><button type="button" id="rmta" class="btn btn-secondary"><i class="fa fa-plus-circle"></i></button></span></div>
144
- </div>
145
- </div>
146
-
147
- <script>
148
- jQuery(function(){
149
- jQuery( "#ftabs" ).tabs();
150
-
151
- jQuery('#rmta').click(function(){
152
- var d = new Date();
153
- var ID = d.getTime();
154
- var file = jQuery('#rurl').val();
155
- var filename = file;
156
- jQuery('#rurl').val('');
157
- if(file == ''){
158
- alert("Invalid url");
159
- return false;
160
- }
161
-
162
- jQuery('#wpdm-files').dataTable().fnAddData( [
163
- "<input type='hidden' id='in_"+ID+"' class='fa' name='file[files]["+ID+"]' value='"+file+"' /><i id='del_"+ID+"' class='fa fa-trash-o action-ico text-danger' rel='del'></i>",
164
- file,
165
- "<input class='form-control input-sm' type='text' name='file[fileinfo]["+ID+"][title]' value='"+file+"' onclick='this.select()'>",
166
- "<div class='input-group'><input size='10' class='form-control input-sm' type='text' id='indpass_"+ID+"' name='file[fileinfo]["+ID+"][password]' value=''><span class='input-group-btn'><button class='genpass btn btn-secondary btn-sm' type='button' onclick=\"return generatepass('indpass_"+ID+"')\" title='Generate Password'><i class='fa fa-key'></i></button>"
167
- ] );
168
- jQuery('#wpdm-files tbody tr:not(.dfile):not(.cfile)').attr('id',ID).addClass('cfile');
169
-
170
-
171
- jQuery("#wpdm-files tbody").sortable();
172
-
173
- jQuery('#'+ID).fadeIn();
174
-
175
-
176
-
177
- });
178
-
179
- });
180
-
181
- </script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Admin/views/metaboxes/attach-file/remote-url.php CHANGED
@@ -6,15 +6,16 @@ if(!defined("ABSPATH")) die("Shit happens!");
6
  </div>
7
 
8
  <script>
9
- jQuery(function(){
 
10
  //jQuery( "#ftabs" ).tabs();
11
 
12
- jQuery('#rmta').click(function(){
13
  var d = new Date();
14
  var ID = d.getTime();
15
- var file = jQuery('#rurl').val();
16
  var filename = file;
17
- jQuery('#rurl').val('');
18
 
19
  let regex = new RegExp("^(ftp:\/\/|http:\/\/|https:\/\/)[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(:[0-9]{1,5})?(\/.*)?$");
20
  if(!regex.test(file)){
@@ -34,8 +35,8 @@ if(!defined("ABSPATH")) die("Shit happens!");
34
  title = title[title.length - 1];
35
 
36
  var _file = {};
37
- _file.filetitle = title;
38
- _file.filepath = file;
39
  _file.fileindex = ID;
40
  _file.preview = icon;
41
  wpdm_attach_file(_file);
6
  </div>
7
 
8
  <script>
9
+
10
+ jQuery(function($){
11
  //jQuery( "#ftabs" ).tabs();
12
 
13
+ $('#rmta').click(function(){
14
  var d = new Date();
15
  var ID = d.getTime();
16
+ var file = $('#rurl').val().replace(/[\<\>]/g, '');
17
  var filename = file;
18
+ $('#rurl').val('');
19
 
20
  let regex = new RegExp("^(ftp:\/\/|http:\/\/|https:\/\/)[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(:[0-9]{1,5})?(\/.*)?$");
21
  if(!regex.test(file)){
35
  title = title[title.length - 1];
36
 
37
  var _file = {};
38
+ _file.filetitle = (title);
39
+ _file.filepath = encodeURI(file);
40
  _file.fileindex = ID;
41
  _file.preview = icon;
42
  wpdm_attach_file(_file);
src/Admin/views/metaboxes/attach-file/upload-file.php CHANGED
@@ -37,7 +37,7 @@ $afile = wpdm_valueof($afiles, 0);
37
  <a href="#" id="dcf" title="Delete Current File" class="pull-right" style="font-size:24px">
38
  <i class="fa fa-trash color-red"></i>
39
  </a>
40
- <div class="media-body"><strong><?php echo basename($afile); ?></strong><br><span class="text-success"><?php echo $filesize; ?></span></div>
41
  </div>
42
 
43
  <?php } else echo "<span style='font-weight:bold;color:#ddd'>". __('No file uploaded yet!', 'download-manager')."</span>"; ?>
37
  <a href="#" id="dcf" title="Delete Current File" class="pull-right" style="font-size:24px">
38
  <i class="fa fa-trash color-red"></i>
39
  </a>
40
+ <div class="media-body"><strong><?php echo esc_html(basename(urldecode($afile))); ?></strong><br><span class="text-success"><?php echo $filesize; ?></span></div>
41
  </div>
42
 
43
  <?php } else echo "<span style='font-weight:bold;color:#ddd'>". __('No file uploaded yet!', 'download-manager')."</span>"; ?>
src/Admin/views/metaboxes/attached-files.php DELETED
@@ -1,254 +0,0 @@
1
- <?php
2
-
3
- $files = maybe_unserialize(get_post_meta($post->ID, '__wpdm_files', true));
4
-
5
- if (!is_array($files)) $files = array();
6
-
7
- $fileinfo = get_post_meta($post->ID, '__wpdm_fileinfo', true);
8
-
9
-
10
- ?>
11
-
12
- <style>
13
- #wpdm-attached-files .inside{
14
- padding: 0;
15
- margin: 0;
16
- }
17
- .wpdm-split-container{
18
- display: flex;
19
- min-height: 60px;
20
- }
21
-
22
- .wpdm-split-container .wpdm-sidebar{
23
- border-right: 1px solid #ccd0d4;
24
- background: #fafafa;
25
- width: 40%;
26
- }
27
-
28
- .wpdm-split-container .wpdm-content{
29
- width: 60%;
30
- }
31
-
32
- .wpdm-split-container .wpdm-content .tab-pane{
33
- padding: 30px;
34
- }
35
-
36
- .wpdm-split-container .wpdm-sidebar .wpdm-list-item:not(:last-child){
37
- border-bottom: 1px solid #ccd0d4;
38
- }
39
- .wpdm-split-container .wpdm-sidebar .wpdm-list-item{
40
- padding: 20px;
41
- cursor: pointer;
42
- }
43
- .wpdm-split-container .wpdm-sidebar .wpdm-list-item.active{
44
- background: #eef4f7 !important;
45
- color: #0e6c9b;
46
- }
47
- .wpdm-split-container .wpdm-sidebar .wpdm-list-item.ui-sortable-placeholder{
48
- background: #ccd0d4 !important;
49
- height: 40px;
50
- visibility: visible !important;
51
- }
52
- .wpdm-split-container .wpdm-sidebar .wpdm-list-item.ui-sortable-helper{
53
- border: 1px solid #ccd0d4;
54
- background: #e8eef3;
55
- }
56
- .wpdm-split-container .wpdm-sidebar .wpdm-list-item:hover{
57
- background: rgba(255,255,255,0.3);
58
- }
59
-
60
- #wpdm-attach-files{
61
- max-height: 500px;
62
- overflow: auto;
63
- }
64
- .d-block{
65
- display: block;
66
- }
67
- .switch {
68
- position: relative;
69
- display: inline-block;
70
- width: 28px;
71
- height: 16px;
72
- }
73
-
74
- .switch input {
75
- opacity: 0;
76
- width: 0;
77
- height: 0;
78
- }
79
-
80
- .slider {
81
- position: absolute;
82
- cursor: pointer;
83
- top: 0;
84
- left: 0;
85
- right: 0;
86
- bottom: 0;
87
- background-color: #ccc;
88
- -webkit-transition: .4s;
89
- transition: .4s;
90
- border-radius: 500px;
91
- }
92
-
93
- .slider:before {
94
- position: absolute;
95
- content: "";
96
- height: 10px;
97
- width: 10px;
98
- left: 3px;
99
- bottom: 3px;
100
- background-color: white;
101
- -webkit-transition: .4s;
102
- transition: .4s;
103
- border-radius: 500px;
104
- }
105
-
106
- input:checked + .slider {
107
- background-color: #2196F3;
108
- }
109
-
110
- input:focus + .slider {
111
- box-shadow: 0 0 1px #2196F3;
112
- }
113
-
114
- input:checked + .slider:before {
115
- -webkit-transform: translateX(12px);
116
- -ms-transform: translateX(12px);
117
- transform: translateX(12px);
118
- }
119
-
120
- .wpdm-split-container .wpdm-sidebar .wpdm-list-item.to-delete{
121
- background: #f7eef1 !important;
122
- color: #c33455;
123
- border-bottom: 1px solid #e25c7c;
124
- }
125
-
126
- </style>
127
-
128
- <div class="w3eden">
129
- <div class="wpdm-split-container">
130
- <div class="wpdm-sidebar">
131
- <input type="text" style="border: 0;border-radius: 0;border-bottom: 1px solid #ccd0d4;" class="form-control input-lg" id="searchfile" placeholder="<?php echo __( 'Search in Attached Files...', 'download-manager' ); ?>" />
132
- <div id="wpdm-attach-files">
133
- <?php foreach ($files as $file_id => $file) { ?>
134
- <div class="wpdm-list-item" style="position: relative" data-target="#file_info_<?php echo $file_id ?>">
135
- <button type="button" class="btn btn-sm btn-danger show-on-hover" style="position: absolute;right: 20px" rel="del"><i class="fas fa-trash"></i></button>
136
- <div>
137
- <input class="faz" type="hidden" value="<?php echo $file ?>" name="file[files][<?php echo $file_id ?>]" />
138
- <strong class="d-block"><?php echo wpdm_valueof($fileinfo, "{$file_id}/title"); ?></strong>
139
- <?php echo $file ?>
140
- </div>
141
- </div>
142
- <?php } ?>
143
- </div>
144
- </div>
145
- <div class="wpdm-content">
146
- <div id="wpdm-file-info">
147
- <?php
148
-
149
- foreach ($files as $id => $value) {
150
- $file_index = $id;
151
- $svalue = $value;
152
- if (strlen($value) > 50) {
153
- $svalue = substr($value, 0, 23) . "..." . substr($value, strlen($value) - 27);
154
- }
155
- $imgext = array('png', 'jpg', 'jpeg', 'gif');
156
- $ext = explode(".", $value);
157
- $ext = end($ext);
158
- $ext = strtolower($ext);
159
-
160
- $filepath = WPDM()->fileSystem->absPath($value, $post->ID);
161
-
162
- $thumb = $url = "";
163
-
164
- if ($filepath) {
165
- if (in_array($ext, $imgext)) {
166
- if (WPDM\__\__::is_url($filepath)) {
167
- $url = $filepath;
168
- $filepath = str_replace(home_url(), ABSPATH, $filepath);
169
- } else {
170
-
171
- if ($filepath !== $url)
172
- $thumb = wpdm_dynamic_thumb($filepath, array(48, 48), true);
173
- }
174
- }
175
-
176
- if ($ext == '')
177
- $ext = '_blank';
178
- } else {
179
- $ext = '_blank';
180
- }
181
-
182
- include __DIR__.'/file-info.php';
183
-
184
- }
185
- ?>
186
- </div>
187
- </div>
188
- </div>
189
- </div>
190
- <script>
191
-
192
- jQuery(function ($){
193
- $('body').on('click', '.wpdm-list-item', function (){
194
- $('#wpdm-attached-files .tab-pane').addClass('hide');
195
- $($(this).data('target')).removeClass('hide').removeAttr('style');
196
- $('.wpdm-list-item').removeClass('active');
197
- $(this).addClass('active');
198
- });
199
-
200
- $('body').on('click','button[rel=del], button[rel=undo]', function () {
201
-
202
- if ($(this).attr('rel') == 'del') {
203
- $(this).parent('.wpdm-list-item').addClass('to-delete');
204
- var fld = $(this).parents('div.wpdm-list-item').find('input.faz');
205
- fld.data('oldname', fld.attr('name')).attr('name', 'del[]');
206
- $(this).attr('rel', 'undo').html('<i class="fa fa-undo"></i>');
207
-
208
- } else {
209
- $(this).parent('.wpdm-list-item').removeClass('to-delete');
210
- var fld = $(this).parents('div.wpdm-list-item').find('input.faz');
211
- fld.attr('name', fld.data('oldname'));
212
- $(this).attr('rel', 'del').html('<i class="fas fa-trash"></i>');
213
-
214
-
215
- }
216
-
217
- return false;
218
- });
219
-
220
- $('#searchfile').on('keyup', function (){
221
- var input, filter, ul, li, a, i, txtValue;
222
- input = document.getElementById("searchfile");
223
- filter = input.value.toUpperCase();
224
- ul = document.getElementById("wpdm-attach-files");
225
- li = ul.getElementsByClassName("wpdm-list-item");
226
- for (i = 0; i < li.length; i++) {
227
- /*a = li[i].getElementsByTagName("a")[0];*/
228
- txtValue = li[i].textContent || li[i].innerText;
229
- if (txtValue.toUpperCase().indexOf(filter) > -1) {
230
- li[i].style.display = "";
231
- } else {
232
- li[i].style.display = "none";
233
- }
234
- }
235
- });
236
-
237
- $('#wpdm-attach-files .wpdm-list-item:first-child').trigger('click');
238
- $('#wpdm-attach-files').sortable();
239
-
240
- });
241
- </script>
242
-
243
- <script type="text/wpdm-template" id="wpdm-file-item-template" style="display:none;">
244
- <div class="wpdm-list-item" data-target="#file_info_{{fileindex}}">
245
- <input class="faz" type="hidden" value="{{filepath}}" name="file[files][{{fileindex}}]" />
246
- <strong class="d-block">{{filetitle}}</strong>
247
- {{filepath}}
248
- </div>
249
- </script>
250
- <script type="text/wpdm-template" id="wpdm-file-info-template" style="display:none;">
251
- <?php
252
- include __DIR__.'/file-info.tpl.php';
253
- ?>
254
- </script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Admin/views/metaboxes/file-info.php DELETED
@@ -1,138 +0,0 @@
1
- <?php
2
-
3
- use WPDM\__\__;
4
- use WPDM\__\FileSystem;
5
-
6
- if(!defined("ABSPATH")) die("Shit happens!");
7
- ?>
8
-
9
- <div class="tab-pane hide" id="file_info_<?php echo $id ?>">
10
- <div class="form-group">
11
- <div class="media">
12
- <div class="pull-left">
13
- <img class="file-ico"
14
- onerror="this.src='<?php echo FileSystem::fileTypeIcon($ext); ?>';"
15
- src="<?php echo $thumb && __::is_url($thumb) ? $thumb : FileSystem::fileTypeIcon($ext); ?>"/>
16
- </div>
17
- <div class="media-body">
18
- <input placeholder="<?php _e("File Title", "download-manager"); ?>"
19
- title="<?php _e("File Title", "download-manager"); ?>"
20
- class="form-control" type="text"
21
- name='file[fileinfo][<?php echo $id; ?>][title]'
22
- value="<?php echo !isset($fileinfo[$id], $fileinfo[$id]['title']) ? __::valueof($fileinfo, "{$value}/title", ["validate" => "esc_html"]) : __::valueof($fileinfo, "{$id}/title", ["validate" => "esc_html"]); ?>"/><br/>
23
- <div class="row">
24
- <div class="col-lg-6">
25
- <div class="input-group">
26
- <span class="input-group-addon">
27
- ID:
28
- </span>
29
- <input readonly="readonly" class="form-control"
30
- type="text" value="<?php echo $id; ?>">
31
- <span class="input-group-btn">
32
- <button type="button" class="btn btn-secondary"
33
- onclick="__showDownloadLink(<?php the_ID(); ?>, '<?php echo $id; ?>')"><i
34
- class="fa fa-link"></i></button>
35
- </span>
36
- </div>
37
- </div>
38
- <div class="col-lg-6">
39
- <div class="input-group">
40
- <input placeholder="<?php _e("File Password", "download-manager"); ?>"
41
- title="<?php _e("File Password", "download-manager"); ?>"
42
- class="form-control" type="text"
43
- id="indpass_<?php echo $file_index; ?>"
44
- name='file[fileinfo][<?php echo $id; ?>][password]'
45
- value="<?php echo __::valueof($fileinfo, "{$id}/password"); ?>">
46
- <span class="input-group-btn">
47
- <button type="button" class="btn btn-secondary genpass"
48
- title='Generate Password'
49
- onclick="return generatepass('indpass_<?php echo $file_index; ?>')"><i
50
- class="fa fa-ellipsis-h"></i></button>
51
- </span>
52
- </div>
53
- </div>
54
-
55
- </div>
56
- <div class="row" style="margin-top: 10px">
57
- <div class="col-lg-6">
58
- <label><?php echo __( 'File Version', 'download-manager' ); ?>:</label>
59
- <input type="text" class="form-control" placeholder="1.0.0" name="file[fileinfo][<?php echo $id; ?>][version]" value="<?php echo __::valueof($fileinfo, "{$id}/version"); ?>" />
60
- </div>
61
- <div class="col-lg-6">
62
- <label><?php echo __( 'Update Date', 'download-manager' ); ?>:</label>
63
- <input type="date" style="padding: 0 15px" class="form-control" name="file[fileinfo][<?php echo $id; ?>][update_date]" value="<?php echo __::valueof($fileinfo, "{$id}/update_date"); ?>" />
64
- </div>
65
-
66
- </div>
67
- <?php do_action("wpdm_attached_file", $post->ID, $id); ?>
68
- </div>
69
- </div>
70
- </div>
71
- <?php if (class_exists('\WPDMPP\WPDMPremiumPackage')) { ?>
72
- <div class="form-group">
73
- <div class="file-access-settings"
74
- id="file-access-settings-<?php echo $id; ?>">
75
-
76
- <?php
77
- $license_req = get_post_meta($post->ID, "__wpdm_enable_license", true);
78
- $license_pack = get_post_meta($post->ID, "__wpdm_license_pack", true);
79
-
80
- $pre_licenses = wpdmpp_get_licenses();
81
- $license_infs = get_post_meta($post->ID, "__wpdm_license", true);
82
- $license_infs = maybe_unserialize($license_infs);
83
- $zl = 0;
84
- ?>
85
- <table class="table table-v table-bordered file-price-data file-price-table" <?php if ($license_req != 1) echo "style='display:none;'"; ?>>
86
- <tr>
87
- <?php foreach ($pre_licenses as $licid => $lic) {
88
- echo "<th>{$lic['name']}</th>";
89
- } ?>
90
- </tr>
91
- <tr>
92
- <td colspan="<?php echo count($pre_licenses); ?>"><?php _e('License specific file price:', 'download-manager'); ?></td>
93
- </tr>
94
- <tr>
95
- <?php foreach ($pre_licenses as $licid => $pre_license) { ?>
96
- <td><input min="0"
97
- name="file[fileinfo][<?php echo $id; ?>][license_price][<?php echo $licid; ?>]"
98
- class="form-control lic-file-price-<?php echo $licid; ?>"
99
- id="lic-file-price-<?php echo $licid; ?>"
100
- placeholder="Price"
101
- value="<?php echo !isset($fileinfo[$id]['license_price']) || !isset($fileinfo[$id]['license_price'][$licid]) || $fileinfo[$id]['license_price'][$licid] == '' ? (isset($fileinfo[$id]['price']) && $zl == 0 ? (double)$fileinfo[$id]['price'] : '') : (double)$fileinfo[$id]['license_price'][$licid]; ?>"
102
- type="text"></td>
103
- <?php $zl++;
104
- } ?>
105
- </tr>
106
- <tr>
107
- <td colspan="<?php echo count($pre_licenses); ?>"><?php _e('File availability with license pack:', 'download-manager'); ?></td>
108
- </tr>
109
- <tr>
110
- <?php
111
- foreach ($pre_licenses as $licid => $pre_license) {
112
- $_license_pack = __::valueof($license_pack, $licid);
113
- $_license_pack = is_array($_license_pack) ? $_license_pack : [];
114
- ?>
115
- <td>
116
- <label>
117
- <label class="switch">
118
- <input name="file[license_pack][<?php echo $licid; ?>][]" value="<?php echo $id; ?>" type="checkbox" <?php checked(in_array($id, $_license_pack)) ?> />
119
- <span class="slider"></span>
120
- </label>
121
- <?php _e('Available', 'download-manager'); ?>
122
- </label>
123
- </td>
124
- <?php $zl++;
125
- } ?>
126
- </tr>
127
-
128
- </tbody></table>
129
-
130
- <div class="input-group file-price-data file-price-field" <?php if ($license_req == 1) echo "style='display:none;'"; ?>>
131
- <span class="input-group-addon"><?php _e('Price:', 'wpdmpo'); ?></span>
132
- <input class="form-control" type="text" name="file[fileinfo][<?php echo $id; ?>][price]" value="<?php echo __::valueof($fileinfo, "{$id}/price", ["validate" => "double", "default" => 0]); ?>" />
133
- </div>
134
-
135
- </div>
136
- </div>
137
- <?php } ?>
138
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/Admin/views/metaboxes/file-info.tpl.php DELETED
@@ -1,123 +0,0 @@
1
- <?php
2
- if(!defined("ABSPATH")) die("Shit happens!");
3
- ?>
4
-
5
- <div class="tab-pane hide" id="file_info_{{fileindex}}">
6
- <div class="form-group">
7
- <div class="media">
8
- <div class="pull-left">
9
- <img class="file-ico" src="<?php echo \WPDM\__\FileSystem::fileTypeIcon('_blank'); ?>"/>
10
- </div>
11
- <div class="media-body">
12
- <input placeholder="<?php _e("File Title", "download-manager"); ?>"
13
- title="<?php _e("File Title", "download-manager"); ?>"
14
- class="form-control" type="text"
15
- name='file[fileinfo][{{fileindex}}][title]'
16
- value="{{filetitle}}"/><br/>
17
- <div class="row">
18
- <div class="col-md-5">
19
- <div class="input-group">
20
- <span class="input-group-addon">
21
- ID:
22
- </span>
23
- <input readonly="readonly" class="form-control"
24
- type="text" value="{{fileindex}}">
25
- <span class="input-group-btn">
26
- <button type="button" class="btn btn-secondary"
27
- onclick="__showDownloadLink(<?php the_ID(); ?>, '{{fileindex}}')"><i
28
- class="fa fa-link"></i></button>
29
- </span>
30
- </div>
31
- </div>
32
- <div class="col-md-7">
33
- <div class="input-group">
34
- <input placeholder="<?php _e("File Password", "download-manager"); ?>"
35
- title="<?php _e("File Password", "download-manager"); ?>"
36
- class="form-control" type="text"
37
- id="indpass_{{fileindex}}"
38
- name='file[fileinfo][{{fileindex}}][password]'
39
- value="">
40
- <span class="input-group-btn">
41
- <button type="button" class="btn btn-secondary" class="genpass"
42
- title='Generate Password'
43
- onclick="return generatepass('indpass_{{fileindex}}')"><i
44
- class="fa fa-ellipsis-h"></i></button>
45
- </span>
46
- </div>
47
- </div>
48
-
49
- </div>
50
- <?php do_action("wpdm_attached_file", $post->ID, 0); ?>
51
- </div>
52
- </div>
53
- </div>
54
- <?php if (class_exists('\WPDMPP\WPDMPremiumPackage')) { ?>
55
- <div class="form-group">
56
- <div class="file-access-settings"
57
- id="file-access-settings-{{fileindex}}">
58
-
59
- <?php
60
- $license_req = get_post_meta($post->ID, "__wpdm_enable_license", true);
61
- $license_pack = get_post_meta($post->ID, "__wpdm_license_pack", true);
62
-
63
- $pre_licenses = wpdmpp_get_licenses();
64
- $license_infs = get_post_meta($post->ID, "__wpdm_license", true);
65
- $license_infs = maybe_unserialize($license_infs);
66
- $zl = 0;
67
- ?>
68
- <table class="table table-v table-bordered file-price-data file-price-table" <?php if ($license_req != 1) echo "style='display:none;'"; ?>>
69
- <tr>
70
- <?php foreach ($pre_licenses as $licid => $lic) {
71
- echo "<th>{$lic['name']}</th>";
72
- } ?>
73
- </tr>
74
- <tr>
75
- <td colspan="<?php echo count($pre_licenses); ?>"><?php _e('License specific file price:', 'download-manager'); ?></td>
76
- </tr>
77
- <tr>
78
- <?php foreach ($pre_licenses as $licid => $pre_license) { ?>
79
- <td><input min="0"
80
- name="file[fileinfo][{{fileindex}}][license_price][<?php echo $licid; ?>]"
81
- class="form-control lic-file-price-<?php echo $licid; ?>"
82
- id="lic-file-price-<?php echo $licid; ?>"
83
- placeholder="Price"
84
- value=""
85
- type="text" /></td>
86
- <?php $zl++;
87
- } ?>
88
- </tr>
89
- <tr>
90
- <td colspan="<?php echo count($pre_licenses); ?>"><?php _e('File availability with license pack:', 'download-manager'); ?></td>
91
- </tr>
92
- <tr>
93
- <?php
94
- foreach ($pre_licenses as $licid => $pre_license) {
95
- $_license_pack = wpdm_valueof($license_pack, $licid);
96
- $_license_pack = is_array($_license_pack) ? $_license_pack : [];
97
- ?>
98
- <td>
99
- <label>
100
- <label class="switch">
101
- <input name="file[license_pack][<?php echo $licid; ?>][]" value="{{fileindex}}" type="checkbox" />
102
- <span class="slider"></span>
103
- </label>
104
- <?php _e('Available', 'download-manager'); ?>
105
- </label>
106
- </td>
107
- <?php $zl++;
108
- } ?>
109
- </tr>
110
-
111
- </tbody></table>
112
-
113
- <div class="input-group file-price-data file-price-field" <?php if ($license_req == 1) echo "style='display:none;'"; ?>>
114
- <span class="input-group-addon"><?php _e('Price:', 'wpdmpo'); ?></span><input
115
- class="form-control" type="text"
116
- name="file[fileinfo][{{fileindex}}][price]"
117
- value=""/>
118
- </div>
119
-
120
- </div>
121
- </div>
122
- <?php } ?>
123
- </div>