PluginProbe ʕ •ᴥ•ʔ
Download Manager / 3.3.63
Download Manager v3.3.63
3.3.63 3.3.62 3.3.61 3.3.60 3.3.59 3.3.58 3.3.57 3.3.56 trunk 2.1.3 2.3.0 2.5.96 2.5.97 2.6.2 2.6.96 2.8.3 2.9.99 3.0.4 3.1.05 3.1.07 3.1.08 3.1.11 3.1.12 3.1.14 3.1.17 3.1.18 3.1.22 3.1.23 3.1.24 3.1.25 3.1.26 3.1.27 3.1.28 3.2.04 3.2.13 3.2.14 3.2.16 3.2.18 3.2.19 3.2.21 3.2.22 3.2.23 3.2.24 3.2.25 3.2.27 3.2.28 3.2.29 3.2.30 3.2.31 3.2.32 3.2.33 3.2.34 3.2.35 3.2.37 3.2.38 3.2.39 3.2.40 3.2.41 3.2.42 3.2.43 3.2.44 3.2.45 3.2.46 3.2.47 3.2.48 3.2.49 3.2.50 3.2.51 3.2.52 3.2.53 3.2.54 3.2.55 3.2.56 3.2.57 3.2.58 3.2.59 3.2.60 3.2.61 3.2.63 3.2.64 3.2.65 3.2.66 3.2.67 3.2.68 3.2.69 3.2.70 3.2.71 3.2.72 3.2.73 3.2.74 3.2.75 3.2.76 3.2.77 3.2.78 3.2.79 3.2.80 3.2.81 3.2.82 3.2.83 3.2.84 3.2.85 3.2.86 3.2.87 3.2.88 3.2.89 3.2.90 3.2.91 3.2.92 3.2.93 3.2.94 3.2.95 3.2.96 3.2.97 3.2.98 3.2.99 3.3.00 3.3.01 3.3.02 3.3.03 3.3.04 3.3.05 3.3.06 3.3.07 3.3.08 3.3.09 3.3.10 3.3.11 3.3.12 3.3.13 3.3.14 3.3.15 3.3.16 3.3.17 3.3.18 3.3.19 3.3.20 3.3.21 3.3.22 3.3.23 3.3.24 3.3.25 3.3.26 3.3.27 3.3.28 3.3.29 3.3.30 3.3.31 3.3.32 3.3.33 3.3.34 3.3.35 3.3.36 3.3.37 3.3.38 3.3.39 3.3.40 3.3.41 3.3.42 3.3.43 3.3.44 3.3.45 3.3.46 3.3.47 3.3.48 3.3.49 3.3.50 3.3.51 3.3.52 3.3.53 3.3.54 3.3.55
download-manager / src / Admin / views / metaboxes / icons.php
download-manager / src / Admin / views / metaboxes Last commit date
attach-file 7 months ago additional-preview-images.php 4 years ago attach-file.php 6 months ago changelog.php 6 months ago icons.php 1 week ago lock-options.php 1 week ago package-settings.php 1 week ago
icons.php
253 lines
1
2
3
4 <div id="package-icons" class="tab-pane">
5 <?php /* if(current_user_can('manage_options')){ ?>
6 <div id="icon-plupload-upload-ui" class="hide-if-no-js">
7 <div id="icon-drag-drop-area">
8 <div class="icon-drag-drop-inside">
9 <input id="icon-plupload-browse-button" type="button" class="button-secondary" value="<?php echo __( "Upload New Icon" , "download-manager" ); ?>" class="btn" />
10 </div>
11 </div>
12 </div>
13
14 <?php
15
16 $plupload_init = array(
17 'runtimes' => 'html5,silverlight,flash,html4',
18 'browse_button' => 'icon-plupload-browse-button',
19 'container' => 'icon-plupload-upload-ui',
20 'drop_element' => 'icon-drag-drop-area',
21 'file_data_name' => 'icon-async-upload',
22 'multiple_queues' => true,
23 'url' => admin_url('admin-ajax.php'),
24 'flash_swf_url' => includes_url('js/plupload/plupload.flash.swf'),
25 'silverlight_xap_url' => includes_url('js/plupload/plupload.silverlight.xap'),
26 'filters' => array(array('title' => __( "Allowed Files" , "download-manager" ), 'extensions' => 'png, jpg, gif')),
27 'multipart' => true,
28 'urlstream_upload' => true,
29
30 // additional post data to send to our ajax hook
31 'multipart_params' => array(
32 '_ajax_nonce' => wp_create_nonce('icon-upload'),
33 'action' => 'icon_upload', // the ajax action name
34 ),
35 );
36
37 // we should probably not apply this filter, plugins may expect wp's media uploader...
38 $plupload_init = apply_filters('plupload_init', $plupload_init);
39
40 ?>
41
42 <script type="text/javascript">
43
44 jQuery(document).ready(function($){
45
46 // create the uploader and pass the config from above
47 var uploader = new plupload.Uploader(<?php echo json_encode($plupload_init); ?>);
48
49 // checks if browser supports drag and drop upload, makes some css adjustments if necessary
50 uploader.bind('Init', function(up){
51 var uploaddiv = jQuery('#icon-plupload-upload-ui');
52
53 if(up.features.dragdrop){
54 uploaddiv.addClass('drag-drop');
55 jQuery('#icon-drag-drop-area')
56 .bind('dragover.wp-uploader', function(){ uploaddiv.addClass('drag-over'); })
57 .bind('dragleave.wp-uploader, drop.wp-uploader', function(){ uploaddiv.removeClass('drag-over'); });
58
59 }else{
60 uploaddiv.removeClass('drag-drop');
61 jQuery('#icon-drag-drop-area').unbind('.wp-uploader');
62 }
63 });
64
65 uploader.init();
66
67 // a file was added in the queue
68 uploader.bind('FilesAdded', function(up, files){
69 //var hundredmb = 100 * 1024 * 1024, max = parseInt(up.settings.max_file_size, 10);
70
71 jQuery('#icon-loading').slideDown();
72
73
74 plupload.each(files, function(file){
75 jQuery('#icon-filelist').html(
76 '<div class="file" id="' + file.id + '"><b>' +
77
78 file.name + '</b> (<span>' + plupload.formatSize(0) + '</span>/' + plupload.formatSize(file.size) + ') ' +
79 '<div class="fileprogress"></div></div>');
80 });
81
82 up.refresh();
83 up.start();
84 });
85
86 uploader.bind('UploadProgress', function(up, file) {
87 jQuery('#' + file.id + " .fileprogress").width(file.percent + "%");
88 jQuery('#' + file.id + " span").html(plupload.formatSize(parseInt(file.size * file.percent / 100)));
89 });
90
91
92 // a file was uploaded
93 uploader.bind('FileUploaded', function(up, file, response) {
94
95 // this is your ajax response, update the DOM with it or something...
96 var jres = jQuery.parseJSON(response.response);
97 console.log(jres);
98 //response
99 jQuery('#' + file.id ).remove();
100 var d = new Date();
101 var ID = d.getTime();
102 jQuery('#icon-loading').hide();
103 jQuery('#w-icons').prepend("<img class='wdmiconfile' id='"+jres.fid+"' src='"+jres.url+"' style='padding:5px; margin:1px; float:left; border:#fff 2px solid;height: 32px;width:auto; ' /><input rel='wdmiconfile' style='display:none' type='radio' name='file[icon]' class='checkbox' value='"+jres.rpath+"' ></label>");
104
105
106 });
107
108 });
109
110 </script>
111 <?php } */ ?>
112 <div class="w3eden">
113 <div class="input-group input-group-lg">
114 <input style="background: url(<?php echo esc_url(get_post_meta($post->ID,'__wpdm_icon', true)); ?>) no-repeat;background-size: 24px;padding-left: 40px;background-position:8px center;" id="wpdmiconurl" placeholder="<?php _e( "Icon URL" , "download-manager" ); ?>" value="<?php echo esc_url(get_post_meta($post->ID,'__wpdm_icon', true)); ?>" type="text" name="file[icon]" class="form-control input-lg" >
115 <div class="input-group-btn">
116 <button type="button" class="btn btn-secondary wpdm-iconfinder">IconFinder</button>
117 </div>
118 </div>
119
120 <script type="text/template" id="searchiconsmodal-tpl">
121 <div class="modal-body">
122 <div class="input-group input-group-lg">
123 <input type="text" name="kw" id="sikw" class="form-control" placeholder="Type Something..."/>
124 <div class="input-group-btn">
125 <button type="button" id="srci" class="btn btn-secondary">Search</button>
126 </div>
127 </div>
128
129 <div id="srcdicons" style="margin-top: 20px">
130 <div style="padding: 50px;text-align: center;color: #b7bdc9">&mdash; <?= __('Type Something & Search', 'download-manager'); ?> &mdash;</div>
131 </div>
132 </div>
133 <div class="text-muted" style="margin-top: 12px;font-size: 12px">
134 <?= sprintf(__('Powered by %s', 'download-manager'), '<a target="_blank" href="https://www.iconfinder.com?ref=shaon">IconFinnder.com</a>'); ?>
135 </div>
136 </script>
137
138 <script>
139 jQuery(function ($) {
140 $('body').on('click', '.wpdm-iconfinder', function (e) {
141 e.preventDefault();
142 WPDM.dialog.show({
143 title: '<?php echo esc_js(__('Search Icon', 'download-manager')); ?>',
144 content: document.getElementById('searchiconsmodal-tpl').innerHTML,
145 size: 'lg', icon: false
146 });
147 });
148
149 function wpdmIconFinderSearch() {
150 WPDM.blockUI('#srcdicons');
151 $.get(ajaxurl + '?action=wpdm_iconFinder&kw=' + $('#sikw').val(), function (res) {
152 $('#srcdicons').html(res);
153 WPDM.unblockUI('#srcdicons');
154 });
155 }
156
157 $('body').on('keypress', '#sikw', function (e) {
158 if (e.keyCode === 13) { e.preventDefault(); wpdmIconFinderSearch(); return false; }
159 });
160 $('body').on('click', '#srci', function (e) {
161 e.preventDefault(); wpdmIconFinderSearch(); return false;
162 });
163 $('body').on('click', '.iconres', function () {
164 $('#wpdmiconurl').val($(this).data('icon'));
165 $('#wpdmiconurl').css('background-image', `url('${$(this).data('icon')}')`);
166 $(this).closest('.wpdm-dialog-wrapper').find('.wpdm-dialog__close').trigger('click');
167 });
168 });
169 </script>
170
171 </div>
172 <br clear="all" />
173 <?php
174 $path = WPDM_BASE_DIR."assets/file-type-icons/";
175 $_upload_dir = wp_upload_dir();
176 $_upload_basedir = $_upload_dir['basedir'];
177 $c_path = $_upload_basedir.'/wpdm-file-type-icons/';
178 $c_url = $_upload_dir['baseurl'].'/wpdm-file-type-icons/';
179 $scan = scandir( $path );
180 $k = 0;
181 $fileinfo = array();
182 foreach( $scan as $v )
183 {
184 if( $v=='.' or $v=='..' or is_dir($path.$v) ) continue;
185
186 $fileinfo[$k]['file'] = 'download-manager/assets/file-type-icons/'.$v;
187 $fileinfo[$k]['name'] = $v;
188 $k++;
189 }
190
191 if(file_exists($c_path)) {
192 $c_scan = scandir( $c_path );
193 if(is_array($c_scan)) {
194 foreach ($c_scan as $v) {
195 if ($v == '.' or $v == '..' or is_dir($path . $v)) continue;
196
197 $fileinfo[$k]['file'] = $c_url . $v;
198 $fileinfo[$k]['name'] = $v;
199 $k++;
200 }
201 }
202 }
203
204
205
206 ?>
207 <div id="w-icons">
208
209 <?php
210 $img = array('jpg','gif','jpeg','png', 'svg');
211 foreach($fileinfo as $index=>$value): $tmpvar = explode(".",$value['file']); $ext = strtolower(end($tmpvar)); if(in_array($ext,$img)): ?>
212 <label>
213 <img class="wdmiconfile" id="<?php echo !strstr($value['file'], '://')?md5(plugins_url().'/'.$value['file']):md5($value['file']); ?>" src="<?php echo !strstr($value['file'], '://')?plugins_url().'/'.esc_attr($value['file']):esc_url($value['file']); ?>" alt="<?php echo $value['name'] ?>" style="padding:5px; margin:1px; float:left; border:#fff 2px solid;height: 32px;width:auto; " />
214 </label>
215 <?php endif; endforeach; ?>
216 </div>
217 <script type="text/javascript">
218 //border:#CCCCCC 2px solid
219
220 <?php if(isset($_GET['action'])&&$_GET['action']=='edit'){ ?>
221 jQuery('#<?php echo md5(get_post_meta($post->ID,'__wpdm_icon', true)) ?>').addClass("iactive");
222 <?php } ?>
223 jQuery('body').on('click', 'img.wdmiconfile',function(){
224 jQuery('#wpdmiconurl').val(jQuery(this).attr('src'));
225 jQuery('#wpdmiconurl').css('background-image','url('+jQuery(this).attr('src')+')');
226 jQuery('img.wdmiconfile').removeClass('iactive');
227 jQuery(this).addClass('iactive');
228
229
230
231 });
232 jQuery('#wpdmiconurl').on('change', function(){
233 jQuery('#wpdmiconurl').css('background-image','url('+jQuery(this).val()+')');
234 });
235
236
237
238
239 </script>
240 <style>
241
242 .iactive{
243 -moz-box-shadow: inset 0 0 10px #5FAC4F;
244 -webkit-box-shadow: inset 0 0 10px #5FAC4F;
245 box-shadow: inset 0 0 10px #5FAC4F;
246 background: #D9FCD1;
247 }
248 </style>
249
250 <div class="clear"></div>
251 </div>
252
253