Gallery – Flagallery Photo Portfolio - Version 6.0.0

Version Description

Download this release

Release Info

Developer pasyuk
Plugin Icon 128x128 Gallery – Flagallery Photo Portfolio
Version 6.0.0
Comparing to
See all releases

Code changes from version 5.4.0 to 6.0.0

Files changed (84) hide show
  1. admin/addgallery.php +379 -373
  2. admin/admin.php +395 -438
  3. admin/ajax.php +485 -456
  4. admin/banner.functions.php +13 -12
  5. admin/blocks/assets/icon-128x128.png +0 -0
  6. admin/blocks/dist/blocks.build.js +1 -0
  7. admin/blocks/dist/blocks.build.style.css +4 -0
  8. admin/blocks/init.php +87 -0
  9. admin/css/flagadmin.css +641 -599
  10. admin/css/flagallery-block.css +7 -0
  11. admin/flag_install.php +332 -319
  12. admin/flagframe-tool.php +360 -278
  13. admin/functions.php +1459 -1458
  14. admin/images/woowbox-promote.png +0 -0
  15. admin/js/Jcrop/js/jquery.Jcrop.js +3 -4
  16. admin/js/flagallery-block.js +54 -3
  17. admin/js/jquery.tablesorter.js +231 -238
  18. admin/js/plupload/Moxie.swf +0 -0
  19. admin/js/plupload/Moxie.xap +0 -0
  20. admin/js/plupload/i18n/ar.js +1 -1
  21. admin/js/plupload/i18n/az.js +2 -0
  22. admin/js/plupload/i18n/bg.js +2 -0
  23. admin/js/plupload/i18n/bs.js +1 -1
  24. admin/js/plupload/i18n/ca.js +1 -1
  25. admin/js/plupload/i18n/cs.js +1 -1
  26. admin/js/plupload/i18n/cy.js +1 -1
  27. admin/js/plupload/i18n/da.js +1 -1
  28. admin/js/plupload/i18n/de.js +1 -1
  29. admin/js/plupload/i18n/el.js +1 -1
  30. admin/js/plupload/i18n/en.js +1 -1
  31. admin/js/plupload/i18n/es.js +1 -1
  32. admin/js/plupload/i18n/et.js +1 -1
  33. admin/js/plupload/i18n/fa.js +1 -1
  34. admin/js/plupload/i18n/fi.js +1 -1
  35. admin/js/plupload/i18n/fr.js +1 -1
  36. admin/js/plupload/i18n/he.js +1 -1
  37. admin/js/plupload/i18n/hr.js +1 -1
  38. admin/js/plupload/i18n/hu.js +1 -1
  39. admin/js/plupload/i18n/hy.js +1 -1
  40. admin/js/plupload/i18n/id.js +1 -1
  41. admin/js/plupload/i18n/it.js +1 -1
  42. admin/js/plupload/i18n/ja.js +1 -1
  43. admin/js/plupload/i18n/ka.js +1 -1
  44. admin/js/plupload/i18n/kk.js +1 -1
  45. admin/js/plupload/i18n/km.js +2 -0
  46. admin/js/plupload/i18n/ko.js +1 -1
  47. admin/js/plupload/i18n/ku_IQ.js +2 -0
  48. admin/js/plupload/i18n/lt.js +1 -1
  49. admin/js/plupload/i18n/lv.js +1 -1
  50. admin/js/plupload/i18n/ms.js +2 -0
  51. admin/js/plupload/i18n/nl.js +1 -1
  52. admin/js/plupload/i18n/pl.js +1 -1
  53. admin/js/plupload/i18n/pt.js +2 -0
  54. admin/js/plupload/i18n/pt_BR.js +1 -1
  55. admin/js/plupload/i18n/ro.js +1 -1
  56. admin/js/plupload/i18n/ru.js +1 -1
  57. admin/js/plupload/i18n/sk.js +1 -1
  58. admin/js/plupload/i18n/sl.js +2 -0
  59. admin/js/plupload/i18n/sq.js +2 -0
  60. admin/js/plupload/i18n/sr.js +1 -1
  61. admin/js/plupload/i18n/sv.js +1 -1
  62. admin/js/plupload/i18n/th_TH.js +1 -1
  63. admin/js/plupload/i18n/tr.js +1 -1
  64. admin/js/plupload/i18n/uk_UA.js +1 -1
  65. admin/js/plupload/i18n/vi.js +2 -0
  66. admin/js/plupload/i18n/zh_CN.js +1 -1
  67. admin/js/plupload/i18n/zh_TW.js +1 -1
  68. admin/js/plupload/jquery.plupload.queue/css/jquery.plupload.queue.css +185 -0
  69. admin/js/plupload/jquery.plupload.queue/img/backgrounds.gif +0 -0
  70. admin/js/plupload/jquery.plupload.queue/img/buttons-disabled.png +0 -0
  71. admin/js/plupload/jquery.plupload.queue/img/buttons.png +0 -0
  72. admin/js/plupload/jquery.plupload.queue/img/delete.gif +0 -0
  73. admin/js/plupload/jquery.plupload.queue/img/done.gif +0 -0
  74. admin/js/plupload/jquery.plupload.queue/img/error.gif +0 -0
  75. admin/js/plupload/jquery.plupload.queue/img/throbber.gif +0 -0
  76. admin/js/plupload/jquery.plupload.queue/img/transp50.png +0 -0
  77. admin/js/plupload/jquery.plupload.queue/jquery.plupload.queue.js +433 -0
  78. admin/js/plupload/jquery.plupload.queue/jquery.plupload.queue.min.js +1 -0
  79. admin/js/plupload/jquery.ui.plupload/css/jquery.ui.plupload.css +51 -34
  80. admin/js/plupload/jquery.ui.plupload/img/plupload.png +0 -0
  81. admin/js/plupload/jquery.ui.plupload/jquery.ui.plupload.js +337 -286
  82. admin/js/plupload/jquery.ui.plupload/jquery.ui.plupload.min.js +1 -1
  83. admin/js/plupload/moxie.js +11714 -0
  84. admin/js/plupload/moxie.min.js +3 -5
admin/addgallery.php CHANGED
@@ -1,373 +1,379 @@
1
- <?php
2
- if ( preg_match( '#' . basename( __FILE__ ) . '#', $_SERVER['PHP_SELF'] ) ) {
3
- die( 'You are not allowed to call this page directly.' );
4
- }
5
-
6
- // sometimes a error feedback is better than a white screen
7
- @ini_set( 'error_reporting', E_ALL ^ E_NOTICE );
8
-
9
- function flag_admin_add_gallery() {
10
-
11
- global $wpdb, $flagdb, $flag;
12
-
13
- // same as $_SERVER['REQUEST_URI'], but should work under IIS 6.0
14
- $filepath = admin_url() . 'admin.php?page=' . urlencode( $_GET['page'] );
15
-
16
- // check for the max image size
17
- $maxsize = flagGallery::check_memory_limit();
18
-
19
- $defaultpath = $flag->options['galleryPath'];
20
-
21
- if ( $_POST['addgallery'] ) {
22
- check_admin_referer( 'flag_addgallery' );
23
- $newgallery = trim( $_POST['galleryname'] );
24
- if ( ! empty( $newgallery ) ) {
25
- flagAdmin::create_gallery( $newgallery, $defaultpath );
26
- }
27
- }
28
- if ( $_POST['uploadimage'] ) {
29
- check_admin_referer( 'flag_upload' );
30
-
31
- $flag->options['thumbWidth'] = intval( $_POST['thumbWidth'] ) ? intval( $_POST['thumbWidth'] ) : 300;
32
- $flag->options['thumbHeight'] = intval( $_POST['thumbHeight'] ) ? intval( $_POST['thumbHeight'] ) : 300;
33
- update_option( 'flag_options', $flag->options );
34
-
35
- if ( $_FILES['MF__F_0_0']['error'] == 0 ) {
36
- flagAdmin::upload_images();
37
- } else {
38
- flagGallery::show_error( __( 'Upload failed!', 'flash-album-gallery' ) );
39
- }
40
- }
41
- if ( $_POST['importfolder'] ) {
42
- check_admin_referer( 'flag_addgallery' );
43
- $galleryfolder = $_POST['galleryfolder'];
44
- if ( ( ! empty( $galleryfolder ) ) AND ( $defaultpath != $galleryfolder ) AND false === strpos( $galleryfolder, '..' ) ) {
45
- flagAdmin::import_gallery( $galleryfolder );
46
- }
47
- }
48
-
49
-
50
- if ( isset( $_POST['disable_flash'] ) ) {
51
- check_admin_referer( 'flag_upload' );
52
- $flag->options['swfUpload'] = false;
53
- update_option( 'flag_options', $flag->options );
54
- }
55
-
56
- if ( isset( $_POST['enable_flash'] ) ) {
57
- check_admin_referer( 'flag_upload' );
58
- $flag->options['swfUpload'] = true;
59
- update_option( 'flag_options', $flag->options );
60
- }
61
-
62
- //get all galleries (after we added new ones)
63
- $gallerylist = $flagdb->find_all_galleries( $flag->options['albSort'], $flag->options['albSortDir'], false, 0, 0, 0, true );
64
-
65
- ?>
66
-
67
- <?php if ( ! IS_WPMU || current_user_can( 'FlAG Import folder' ) ) { ?>
68
- <link rel="stylesheet" type="text/css" href="<?php echo FLAG_URLPATH; ?>admin/js/jqueryFileTree/jqueryFileTree.css"/>
69
- <script type="text/javascript" src="<?php echo FLAG_URLPATH; ?>admin/js/jqueryFileTree/jqueryFileTree.js"></script>
70
- <script type="text/javascript">
71
- /* <![CDATA[ */
72
- jQuery(function(){
73
- jQuery("span.browsefiles").show().click(function(){
74
- jQuery("#file_browser").fileTree({
75
- script: "admin-ajax.php?action=flag_file_browser&nonce=<?php echo wp_create_nonce( 'flag-ajax' ) ;?>",
76
- root: jQuery("#galleryfolder").val()
77
- }, function(file){
78
- //var path = file.replace("<?php echo WINABSPATH; ?>", "");
79
- jQuery("#galleryfolder").val(file);
80
- });
81
-
82
- jQuery("#file_browser").show("slide");
83
- });
84
- });
85
- /* ]]> */
86
- </script>
87
- <?php }
88
- if ( ! is_plugin_active( 'woowbox/woowbox.php' ) ){
89
- ?>
90
- <div class="promote-woowbox" style="padding-top:10px"><a href="http://bit.ly/2J0eBeb" target="_blank"><img src="<?php echo plugins_url('/flash-album-gallery/admin/images/woowbox-promote.png') ?>" alt="Try WoowBox Gallery plugin" /></a></div>
91
- <?php
92
- }
93
- ?>
94
- <div id="slider" class="flag-wrap">
95
-
96
- <ul id="tabs" class="tabs">
97
- <li class="selected"><a href="#" rel="addgallery"><?php _e( 'Add new gallery', 'flash-album-gallery' ); ?></a></li>
98
- <li><a href="#" rel="uploadimage"><?php _e( 'Upload Images', 'flash-album-gallery' ); ?></a></li>
99
- <?php if ( ! IS_WPMU || current_user_can( 'FlAG Import folder' ) ) { ?>
100
- <li><a href="#" rel="importfolder"><?php _e( 'Import image folder', 'flash-album-gallery' ); ?></a></li>
101
- <?php } ?>
102
- </ul>
103
-
104
- <!-- create gallery -->
105
- <div id="addgallery" class="cptab">
106
- <h2><?php _e( 'Create a new gallery', 'flash-album-gallery' ); ?></h2>
107
-
108
- <form name="addgallery" id="addgallery_form" method="POST" action="<?php echo $filepath; ?>" accept-charset="utf-8">
109
- <?php wp_nonce_field( 'flag_addgallery' ); ?>
110
- <table class="form-table" style="width: auto;">
111
- <tr>
112
- <th scope="col" colspan="2" style="padding-bottom: 0;">
113
- <strong><?php _e( 'New Gallery', 'flash-album-gallery' ); ?></strong></th>
114
- </tr>
115
- <tr valign="top">
116
- <td><input type="text" size="65" name="galleryname" value=""/><br/>
117
- <?php if ( ! IS_WPMU ) { ?>
118
- <?php _e( 'Create a new , empty gallery below the folder', 'flash-album-gallery' ); ?>
119
- <strong><?php echo $defaultpath; ?></strong><br/>
120
- <?php } ?>
121
- <i>( <?php _e( 'Allowed characters for file and folder names are', 'flash-album-gallery' ); ?>: a-z, A-Z, 0-9, -, _ )</i>
122
- </td>
123
- <?php do_action( 'flag_add_new_gallery_form' ); ?>
124
- <td style="vertical-align:top;">
125
- <div class="submit" style="margin: 0; padding: 0;">
126
- <input class="button-primary" type="submit" name="addgallery" value="<?php _e( 'Add gallery', 'flash-album-gallery' ); ?>"/>
127
- </div>
128
- </td>
129
- </tr>
130
- </table>
131
- <p>&nbsp;</p>
132
- </form>
133
- </div>
134
- <!-- upload images -->
135
- <div id="uploadimage" class="cptab">
136
- <h2><?php _e( 'Upload images', 'flash-album-gallery' ); ?></h2>
137
-
138
- <form name="uploadimage" id="gmUpload" method="POST" enctype="multipart/form-data" action="<?php echo $filepath; ?>" accept-charset="utf-8">
139
- <?php wp_nonce_field( 'flag_upload' ); ?>
140
- <table class="flag-form-table">
141
- <tr valign="top">
142
- <td style="width: 216px;">
143
- <label for="galleryselect"><?php _e( 'Upload images in', 'flash-album-gallery' ); ?> *</label>
144
- <select name="galleryselect" id="galleryselect" style="width: 200px">
145
- <option value="0"><?php _e( 'Choose gallery', 'flash-album-gallery' ); ?></option>
146
- <?php $ingallery = isset( $_GET['gid'] ) ? (int) $_GET['gid'] : '';
147
- foreach ( $gallerylist as $gallery ) {
148
- if ( ! flagAdmin::can_manage_this_gallery( $gallery->author ) ) {
149
- continue;
150
- }
151
- $name = ( empty( $gallery->title ) ) ? $gallery->name : esc_html( stripslashes( $gallery->title ) );
152
- if ( $flag->options['albSort'] == 'gid' ) {
153
- $name = '#' . $gallery->gid . ' - ' . $name;
154
- }
155
- if ( $flag->options['albSort'] == 'title' ) {
156
- $name = $name . ' (#' . $gallery->gid . ')';
157
- }
158
- $sel = ( $ingallery == $gallery->gid ) ? 'selected="selected" ' : '';
159
- echo '<option ' . $sel . 'value="' . $gallery->gid . '" >' . $name . '</option>' . "\n";
160
- } ?>
161
- </select>
162
- <?php echo $maxsize; ?>
163
- <br/><?php if ( ( IS_WPMU ) && flagGallery::flag_wpmu_enable_function( 'wpmuQuotaCheck' ) ) {
164
- display_space_usage();
165
- } ?>
166
- <br/>
167
-
168
- <p><?php _e( 'Thumbnail WIDTH x HEIGHT (in pixel)', 'flash-album-gallery' ); ?> *
169
- <br/><input type="number" size="5" maxlength="5" min="300" max="800" name="thumbWidth" id="thumbWidth" value="<?php echo $flag->options['thumbWidth']; ?>"/> x
170
- <input type="number" size="5" maxlength="5" min="300" max="800" name="thumbHeight" id="thumbHeight" value="<?php echo $flag->options['thumbHeight']; ?>"/>
171
- <br/>
172
- <small><?php _e( 'These values are maximum values ', 'flash-album-gallery' ); ?></small>
173
- </p>
174
-
175
- <div class="submit">
176
- <span class="useflashupload">
177
- <?php if ( $flag->options['swfUpload'] ) { ?>
178
- <input type="submit" class="button-secondary" name="disable_flash" id="disable_flash" title="<?php _e( 'The batch upload via Plupload, disable it if you have problems', 'flash-album-gallery' ); ?>" value="<?php _e( 'Switch to Browser Upload', 'flash-album-gallery' ); ?>"/>
179
- <?php } else { ?>
180
- <input type="submit" class="button-secondary" name="enable_flash" id="enable_flash" title="<?php _e( 'Upload multiple files at once by ctrl/shift-selecting in dialog', 'flash-album-gallery' ); ?>" value="<?php _e( 'Switch to Plupload based Upload', 'flash-album-gallery' ); ?>"/>
181
- <?php } ?>
182
- </span>
183
-
184
- <div class="clear"></div>
185
- </div>
186
-
187
- </td>
188
-
189
- <td>
190
- <div id="pluploadUploader">
191
- <?php if ( ! $flag->options['swfUpload']) { ?>
192
- <strong><?php _e( 'Upload image(s):', 'flash-album-gallery' ); ?></strong><br>
193
- <input type="file" name="imagefiles[]" id="imagefiles" size="35" class="imagefiles"/>
194
- </div>
195
- <span id="choosegalfirst">
196
- <input class="button-primary" type="submit" name="uploadimage" id="uploadimage_btn" value="<?php _e( 'Upload images', 'flash-album-gallery' ); ?>"/>
197
- <span class="disabledbut" style="display: none;"></span>
198
- </span>
199
- <?php } ?>
200
- </td>
201
- </tr>
202
- </table>
203
- <div id="pl-message"></div>
204
- </form>
205
- <?php if ( $flag->options['swfUpload'] ) {
206
- $nonce = wp_create_nonce( 'flag_upload' );
207
- ?>
208
- <script type="text/javascript">
209
- // Convert divs to queue widgets when the DOM is ready
210
- jQuery(function($){
211
- var files_remaining = 0;
212
- $("#pluploadUploader").plupload({
213
- runtimes: 'html5,flash,html4',
214
- url: '<?php echo str_replace( '&#038;', '&', wp_nonce_url( admin_url('admin-ajax.php?action=plupload_uploader'), 'flag_upload' ) ); ?>',
215
- multipart: true,
216
- multipart_params: {postData: '', pluploadimage: 1},
217
- max_file_size: '<?php echo (floor( wp_max_upload_size() * 0.99 / 1024 / 1024 ) - 1); ?>Mb',
218
- unique_names: false,
219
- rename: true,
220
- chunk_size: '<?php echo min((floor( wp_max_upload_size() * 0.99 / 1024 / 1024 ) - 1), 6); ?>Mb',
221
- max_retries: 2,
222
- sortable: true,
223
- dragdrop: true,
224
- views: {
225
- list: true,
226
- thumbs: true,
227
- active: 'thumbs'
228
- },
229
- filters: [{title: "Images", extensions: "jpg,gif,png"}],
230
- flash_swf_url: '<?php echo plugins_url( FLAGFOLDER. '/admin/js/plupload/plupload.flash.swf'); ?>'
231
-
232
- });
233
-
234
- var uploader = $("#pluploadUploader").plupload('getUploader');
235
- uploader.bind('QueueChanged StateChanged', function(up){
236
- if(up.state == plupload.QUEUED){
237
- files_remaining = up.files.length;
238
- }
239
- if(up.state == plupload.STARTED){
240
- up.settings.multipart_params = {
241
- galleryselect: jQuery('#galleryselect').val(),
242
- thumbw: jQuery('#thumbWidth').val(),
243
- thumbh: jQuery('#thumbHeight').val(),
244
- last: files_remaining,
245
- action: 'flag_plupload_uploader',
246
- _wpnonce: '<?php echo $nonce; ?>'
247
- };
248
- }
249
- if($("#galleryselect").val() == 0){
250
- $("#pluploadUploader_start").addClass('ui-button-disabled ui-state-disabled');
251
- }
252
- console.log('[StateChanged]', up.state, up.settings.multipart_params);
253
- });
254
- uploader.bind('ChunkUploaded', function(up, file, info){
255
- console.log('[ChunkUploaded] File:', file, "Info:", info);
256
- var response = jQuery.parseJSON(info.response);
257
- if(response && response.error){
258
- up.stop();
259
- file.status = plupload.FAILED;
260
- console.log(response.error);
261
- up.trigger('QueueChanged StateChanged');
262
- up.trigger('UploadProgress', file);
263
- up.start();
264
- }
265
- });
266
- uploader.bind('FileUploaded', function(up, file, info){
267
- console.log('[FileUploaded] File:', file, "Info:", info);
268
- files_remaining--;
269
- if(info.response){
270
- file.status = plupload.FAILED;
271
- jQuery('<div/>').addClass('error').html('<span><u><em>' + file.name + ':</em></u> ' + info.response + '</span>').appendTo('#pl-message');
272
- }
273
- });
274
- uploader.bind('UploadProgress', function(up, file){
275
- var percent = uploader.total.percent;
276
- $('#total-progress-info .progress-bar').css('width', percent + "%").attr('aria-valuenow', percent);
277
- });
278
- uploader.bind('Error', function(up, args){
279
- jQuery('<div/>').addClass('error').html('<span><u><em>' + args.file.name + ':</em></u> ' + args.message + ' ' + args.status + '</span>').appendTo('#pl-message');
280
- console.log('[error] ', args);
281
- });
282
- uploader.bind('UploadComplete', function(up, files){
283
- console.log('[UploadComplete]', files);
284
- jQuery('<div/>').addClass('success').html('<?php _e('Done!', 'flash-album-gallery'); ?> <a href="<?php echo wp_nonce_url( $flag->manage_page->base_page . "&mode=edit", 'flag_editgallery'); ?>&gid=' + jQuery("#galleryselect").val() + '">Open Gallery</a>').appendTo('#pl-message');
285
- });
286
-
287
- jQuery("#gmUpload").on('click', '.ui-button-disabled', function(){
288
- if(files_remaining){
289
- alert("Choose gallery, please.")
290
- }
291
- });
292
- jQuery("#galleryselect").change(function(){
293
- if(jQuery(this).val() == 0){
294
- jQuery("#pluploadUploader_start").addClass('ui-button-disabled ui-state-disabled');
295
- } else{
296
- if(files_remaining){
297
- jQuery("#pluploadUploader_start").removeClass('ui-button-disabled ui-state-disabled');
298
- }
299
- }
300
- });
301
-
302
- });
303
- </script>
304
- <?php } else { ?>
305
- <!-- MultiFile script -->
306
- <script type="text/javascript">
307
- /* <![CDATA[ */
308
- jQuery(document).ready(function(){
309
- jQuery('#imagefiles').MultiFile({
310
- STRING: {
311
- remove: '<?php _e('remove', 'flash-album-gallery'); ?>'
312
- }
313
- });
314
-
315
- if(jQuery("#galleryselect").val() == 0){
316
- jQuery("#choosegalfirst").animate({opacity: "0.5"}, 600);
317
- jQuery("#choosegalfirst .disabledbut").show();
318
- }
319
- jQuery("#choosegalfirst .disabledbut").click(function(){
320
- alert("Choose gallery, please.")
321
- });
322
- jQuery("#galleryselect").change(function(){
323
- if(jQuery(this).val() == 0){
324
- jQuery("#choosegalfirst .disabledbut").show();
325
- jQuery("#choosegalfirst").animate({opacity: "0.5"}, 600);
326
- } else{
327
- jQuery("#choosegalfirst .disabledbut").hide();
328
- jQuery("#choosegalfirst").animate({opacity: "1"}, 600);
329
- }
330
- });
331
- });
332
- /* ]]> */
333
- </script>
334
-
335
- <?php } ?>
336
- </div>
337
- <?php if ( ! IS_WPMU || current_user_can( 'FlAG Import folder' ) ) { ?>
338
- <!-- import folder -->
339
- <div id="importfolder" class="cptab">
340
- <h2><?php _e( 'Import image folder', 'flash-album-gallery' ); ?></h2>
341
-
342
- <form name="importfolder" id="importfolder_form" method="POST" action="<?php echo $filepath; ?>" accept-charset="utf-8">
343
- <?php wp_nonce_field( 'flag_addgallery' ); ?>
344
- <table class="form-table">
345
- <tr valign="top">
346
- <th scope="row"><?php _e( 'Import from Server path:', 'flash-album-gallery' ); ?></th>
347
- <td>
348
- <input type="text" size="35" id="galleryfolder" name="galleryfolder" value="<?php echo $defaultpath; ?>"/><span class="browsefiles button" style="display:none"><?php _e( 'Browse...', "flash-album-gallery" ); ?></span>
349
-
350
- <div id="file_browser"></div>
351
- <div><?php echo $maxsize; ?>
352
- <?php if ( FLAG_SAFE_MODE ) { ?>
353
- <br/><?php _e( ' Please note : For safe-mode = ON you need to add the subfolder thumbs manually', 'flash-album-gallery' ); ?><?php }; ?>
354
- </div>
355
- </td>
356
- </tr>
357
- </table>
358
- <div class="submit">
359
- <input class="button-primary" type="submit" name="importfolder" value="<?php _e( 'Import folder', 'flash-album-gallery' ); ?>"/>
360
- </div>
361
- </form>
362
- </div>
363
- <?php } ?>
364
-
365
- <script type="text/javascript">
366
- var cptabs = new ddtabcontent("tabs");
367
- cptabs.setpersist(true);
368
- cptabs.setselectedClassTarget("linkparent");
369
- cptabs.init();
370
- </script>
371
- </div>
372
- <?php
373
- }
 
 
 
 
 
 
1
+ <?php
2
+ if ( preg_match( '#' . basename( __FILE__ ) . '#', $_SERVER['PHP_SELF'] ) ) {
3
+ die( 'You are not allowed to call this page directly.' );
4
+ }
5
+
6
+ // sometimes a error feedback is better than a white screen
7
+ @ini_set( 'error_reporting', E_ALL ^ E_NOTICE );
8
+
9
+ function flag_admin_add_gallery() {
10
+
11
+ global $wpdb, $flagdb, $flag;
12
+
13
+ // same as $_SERVER['REQUEST_URI'], but should work under IIS 6.0
14
+ $filepath = admin_url() . 'admin.php?page=' . urlencode( $_GET['page'] );
15
+
16
+ // check for the max image size
17
+ $maxsize = flagGallery::check_memory_limit();
18
+
19
+ $defaultpath = $flag->options['galleryPath'];
20
+
21
+ if ( $_POST['addgallery'] ) {
22
+ check_admin_referer( 'flag_addgallery' );
23
+ $newgallery = trim( $_POST['galleryname'] );
24
+ if ( ! empty( $newgallery ) ) {
25
+ flagAdmin::create_gallery( $newgallery, $defaultpath );
26
+ }
27
+ }
28
+ if ( $_POST['uploadimage'] ) {
29
+ check_admin_referer( 'flag_upload' );
30
+
31
+ $flag->options['thumbWidth'] = intval( $_POST['thumbWidth'] ) ? intval( $_POST['thumbWidth'] ) : 300;
32
+ $flag->options['thumbHeight'] = intval( $_POST['thumbHeight'] ) ? intval( $_POST['thumbHeight'] ) : 300;
33
+ update_option( 'flag_options', $flag->options );
34
+
35
+ if ( $_FILES['MF__F_0_0']['error'] == 0 ) {
36
+ flagAdmin::upload_images();
37
+ } else {
38
+ flagGallery::show_error( __( 'Upload failed!', 'flash-album-gallery' ) );
39
+ }
40
+ }
41
+ if ( $_POST['importfolder'] ) {
42
+ check_admin_referer( 'flag_addgallery' );
43
+ $galleryfolder = $_POST['galleryfolder'];
44
+ if ( ( ! empty( $galleryfolder ) ) AND ( $defaultpath != $galleryfolder ) AND false === strpos( $galleryfolder, '..' ) ) {
45
+ flagAdmin::import_gallery( $galleryfolder );
46
+ }
47
+ }
48
+
49
+
50
+ if ( isset( $_POST['disable_flash'] ) ) {
51
+ check_admin_referer( 'flag_upload' );
52
+ $flag->options['swfUpload'] = false;
53
+ update_option( 'flag_options', $flag->options );
54
+ }
55
+
56
+ if ( isset( $_POST['enable_flash'] ) ) {
57
+ check_admin_referer( 'flag_upload' );
58
+ $flag->options['swfUpload'] = true;
59
+ update_option( 'flag_options', $flag->options );
60
+ }
61
+
62
+ //get all galleries (after we added new ones)
63
+ $gallerylist = $flagdb->find_all_galleries( $flag->options['albSort'], $flag->options['albSortDir'], false, 0, 0, 0, true );
64
+
65
+ ?>
66
+
67
+ <?php if ( ! IS_WPMU || current_user_can( 'FlAG Import folder' ) ) { ?>
68
+ <link rel="stylesheet" type="text/css" href="<?php echo FLAG_URLPATH; ?>admin/js/jqueryFileTree/jqueryFileTree.css"/>
69
+ <script type="text/javascript" src="<?php echo FLAG_URLPATH; ?>admin/js/jqueryFileTree/jqueryFileTree.js"></script>
70
+ <script type="text/javascript">
71
+ /* <![CDATA[ */
72
+ jQuery(function(){
73
+ jQuery("span.browsefiles").show().click(function(){
74
+ jQuery("#file_browser").fileTree({
75
+ script: "admin-ajax.php?action=flag_file_browser&nonce=<?php echo wp_create_nonce( 'flag-ajax' ) ;?>",
76
+ root: jQuery("#galleryfolder").val()
77
+ }, function(file){
78
+ //var path = file.replace("<?php echo WINABSPATH; ?>", "");
79
+ jQuery("#galleryfolder").val(file);
80
+ });
81
+
82
+ jQuery("#file_browser").show("slide");
83
+ });
84
+ });
85
+ /* ]]> */
86
+ </script>
87
+ <?php }
88
+ if ( ! ( is_plugin_active( 'woowgallery/woowgallery.php' ) || ! empty( $flag->options['hide_woow'] ) ) ){
89
+ ?>
90
+ <div class="promote-woowbox" style="padding-top:10px"><a href="https://bit.ly/flag-woowgallery" target="_blank"><img src="<?php echo plugins_url('/flash-album-gallery/admin/images/woowbox-promote.png') ?>" alt="Try WoowGallery plugin" /></a></div>
91
+ <?php
92
+ }
93
+ ?>
94
+ <div id="slider" class="flag-wrap">
95
+
96
+ <ul id="tabs" class="tabs">
97
+ <li class="selected"><a href="#" rel="addgallery"><?php _e( 'Add new gallery', 'flash-album-gallery' ); ?></a></li>
98
+ <li><a href="#" rel="uploadimage"><?php _e( 'Upload Images', 'flash-album-gallery' ); ?></a></li>
99
+ <?php if ( ! IS_WPMU || current_user_can( 'FlAG Import folder' ) ) { ?>
100
+ <li><a href="#" rel="importfolder"><?php _e( 'Import image folder', 'flash-album-gallery' ); ?></a></li>
101
+ <?php } ?>
102
+ </ul>
103
+
104
+ <!-- create gallery -->
105
+ <div id="addgallery" class="cptab">
106
+ <h2><?php _e( 'Create a new gallery', 'flash-album-gallery' ); ?></h2>
107
+
108
+ <form name="addgallery" id="addgallery_form" method="POST" action="<?php echo $filepath; ?>" accept-charset="utf-8">
109
+ <?php wp_nonce_field( 'flag_addgallery' ); ?>
110
+ <table class="form-table" style="width: auto;">
111
+ <tr>
112
+ <th scope="col" colspan="2" style="padding-bottom: 0;">
113
+ <strong><?php _e( 'New Gallery', 'flash-album-gallery' ); ?></strong></th>
114
+ </tr>
115
+ <tr valign="top">
116
+ <td><input type="text" size="65" name="galleryname" value=""/><br/>
117
+ <?php if ( ! IS_WPMU ) { ?>
118
+ <?php _e( 'Create a new , empty gallery below the folder', 'flash-album-gallery' ); ?>
119
+ <strong><?php echo $defaultpath; ?></strong><br/>
120
+ <?php } ?>
121
+ <i>( <?php _e( 'Allowed characters for file and folder names are', 'flash-album-gallery' ); ?>: a-z, A-Z, 0-9, -, _ )</i>
122
+ </td>
123
+ <?php do_action( 'flag_add_new_gallery_form' ); ?>
124
+ <td style="vertical-align:top;">
125
+ <div class="submit" style="margin: 0; padding: 0;">
126
+ <input class="button-primary" type="submit" name="addgallery" value="<?php _e( 'Add gallery', 'flash-album-gallery' ); ?>"/>
127
+ </div>
128
+ </td>
129
+ </tr>
130
+ </table>
131
+ <p>&nbsp;</p>
132
+ </form>
133
+ </div>
134
+ <!-- upload images -->
135
+ <div id="uploadimage" class="cptab">
136
+ <h2><?php _e( 'Upload images', 'flash-album-gallery' ); ?></h2>
137
+
138
+ <form name="uploadimage" id="gmUpload" method="POST" enctype="multipart/form-data" action="<?php echo $filepath; ?>" accept-charset="utf-8">
139
+ <?php wp_nonce_field( 'flag_upload' ); ?>
140
+ <table class="flag-form-table">
141
+ <tr valign="top">
142
+ <td style="width: 216px;">
143
+ <label for="galleryselect"><?php _e( 'Upload images in', 'flash-album-gallery' ); ?> *</label>
144
+ <select name="galleryselect" id="galleryselect" style="width: 200px">
145
+ <option value="0"><?php _e( 'Choose gallery', 'flash-album-gallery' ); ?></option>
146
+ <?php $ingallery = isset( $_GET['gid'] ) ? (int) $_GET['gid'] : '';
147
+ foreach ( $gallerylist as $gallery ) {
148
+ if ( ! flagAdmin::can_manage_this_gallery( $gallery->author ) ) {
149
+ continue;
150
+ }
151
+ $name = ( empty( $gallery->title ) ) ? $gallery->name : esc_html( stripslashes( $gallery->title ) );
152
+ if ( $flag->options['albSort'] == 'gid' ) {
153
+ $name = '#' . $gallery->gid . ' - ' . $name;
154
+ }
155
+ if ( $flag->options['albSort'] == 'title' ) {
156
+ $name = $name . ' (#' . $gallery->gid . ')';
157
+ }
158
+ $sel = ( $ingallery == $gallery->gid ) ? 'selected="selected" ' : '';
159
+ echo '<option ' . $sel . 'value="' . $gallery->gid . '" >' . $name . '</option>' . "\n";
160
+ } ?>
161
+ </select>
162
+ <?php echo $maxsize; ?>
163
+ <br/><?php if ( ( IS_WPMU ) && flagGallery::flag_wpmu_enable_function( 'wpmuQuotaCheck' ) ) {
164
+ display_space_usage();
165
+ } ?>
166
+ <br/>
167
+
168
+ <p><?php _e( 'Thumbnail WIDTH x HEIGHT (in pixel)', 'flash-album-gallery' ); ?> *
169
+ <br/><input type="number" size="5" maxlength="5" min="300" max="800" name="thumbWidth" id="thumbWidth" value="<?php echo $flag->options['thumbWidth']; ?>"/> x
170
+ <input type="number" size="5" maxlength="5" min="300" max="800" name="thumbHeight" id="thumbHeight" value="<?php echo $flag->options['thumbHeight']; ?>"/>
171
+ <br/>
172
+ <small><?php _e( 'These values are maximum values ', 'flash-album-gallery' ); ?></small>
173
+ </p>
174
+
175
+ <div class="submit">
176
+ <span class="useflashupload">
177
+ <?php if ( $flag->options['swfUpload'] ) { ?>
178
+ <input type="submit" class="button-secondary" name="disable_flash" id="disable_flash" title="<?php _e( 'The batch upload via Plupload, disable it if you have problems', 'flash-album-gallery' ); ?>" value="<?php _e( 'Switch to Browser Upload', 'flash-album-gallery' ); ?>"/>
179
+ <?php } else { ?>
180
+ <input type="submit" class="button-secondary" name="enable_flash" id="enable_flash" title="<?php _e( 'Upload multiple files at once by ctrl/shift-selecting in dialog', 'flash-album-gallery' ); ?>" value="<?php _e( 'Switch to Plupload based Upload', 'flash-album-gallery' ); ?>"/>
181
+ <?php } ?>
182
+ </span>
183
+
184
+ <div class="clear"></div>
185
+ </div>
186
+
187
+ </td>
188
+
189
+ <td>
190
+ <div id="pluploadUploader">
191
+ <?php if ( ! $flag->options['swfUpload']) { ?>
192
+ <strong><?php _e( 'Upload image(s):', 'flash-album-gallery' ); ?></strong><br>
193
+ <input type="file" name="imagefiles[]" id="imagefiles" size="35" class="imagefiles"/>
194
+ </div>
195
+ <span id="choosegalfirst">
196
+ <input class="button-primary" type="submit" name="uploadimage" id="uploadimage_btn" value="<?php _e( 'Upload images', 'flash-album-gallery' ); ?>"/>
197
+ <span class="disabledbut" style="display: none;"></span>
198
+ </span>
199
+ <?php } ?>
200
+ </td>
201
+ </tr>
202
+ </table>
203
+ <div id="pl-message"></div>
204
+ </form>
205
+ <?php if ( $flag->options['swfUpload'] ) {
206
+ $nonce = wp_create_nonce( 'flag_upload' );
207
+ ?>
208
+ <script type="text/javascript">
209
+ // Convert divs to queue widgets when the DOM is ready
210
+ jQuery(function($){
211
+ var files_remaining = 0;
212
+ $("#pluploadUploader").plupload({
213
+ runtimes: 'html5,flash,html4',
214
+ url: '<?php echo str_replace( '&#038;', '&', wp_nonce_url( admin_url('admin-ajax.php?action=plupload_uploader'), 'flag_upload' ) ); ?>',
215
+ multipart: true,
216
+ multipart_params: {postData: '', pluploadimage: 1},
217
+ max_file_size: '<?php echo (floor( wp_max_upload_size() * 0.99 / 1024 / 1024 ) - 1); ?>Mb',
218
+ unique_names: false,
219
+ rename: true,
220
+ chunk_size: 0,
221
+ max_retries: 2,
222
+ sortable: true,
223
+ dragdrop: true,
224
+ views: {
225
+ list: true,
226
+ thumbs: true,
227
+ active: 'thumbs'
228
+ },
229
+ filters: [{title: "Images", extensions: "jpeg,jpg,gif,png"}],
230
+ flash_swf_url: '<?php echo plugins_url( FLAGFOLDER. '/admin/js/plupload/plupload.flash.swf'); ?>'
231
+
232
+ });
233
+
234
+ var uploader = $("#pluploadUploader").plupload('getUploader');
235
+ uploader.bind('QueueChanged StateChanged', function(up){
236
+ if(up.state == plupload.QUEUED){
237
+ files_remaining = up.files.length;
238
+ }
239
+ if(up.state == plupload.STARTED){
240
+ up.settings.multipart_params = {
241
+ galleryselect: jQuery('#galleryselect').val(),
242
+ thumbw: jQuery('#thumbWidth').val(),
243
+ thumbh: jQuery('#thumbHeight').val(),
244
+ last: files_remaining,
245
+ action: 'flag_plupload_uploader',
246
+ _wpnonce: '<?php echo $nonce; ?>'
247
+ };
248
+ }
249
+ if($("#galleryselect").val() == 0){
250
+ $("#pluploadUploader_start").addClass('ui-button-disabled ui-state-disabled');
251
+ }
252
+ console.log('[StateChanged]', up.state, up.settings.multipart_params);
253
+ });
254
+ uploader.bind('ChunkUploaded', function(up, file, info){
255
+ console.log('[ChunkUploaded] File:', file, "Info:", info);
256
+ var response = {};
257
+ try {
258
+ response = jQuery.parseJSON(info.response);
259
+ } catch(e) {
260
+ response.error = info.response;
261
+ }
262
+ if(response && response.error){
263
+ up.stop();
264
+ file.status = plupload.FAILED;
265
+ jQuery('<div/>').addClass('error').html('<span><u><em>' + file.name + ':</em></u> ' + response.error + '</span>').appendTo('#pl-message');
266
+ console.log(response.error);
267
+ up.trigger('QueueChanged StateChanged');
268
+ up.trigger('UploadProgress', file);
269
+ up.start();
270
+ }
271
+ });
272
+ uploader.bind('FileUploaded', function(up, file, info){
273
+ console.log('[FileUploaded] File:', file, "Info:", info);
274
+ files_remaining--;
275
+ if(info.response){
276
+ file.status = plupload.FAILED;
277
+ jQuery('<div/>').addClass('error').html('<span><u><em>' + file.name + ':</em></u> ' + info.response + '</span>').appendTo('#pl-message');
278
+ }
279
+ });
280
+ uploader.bind('UploadProgress', function(up, file){
281
+ var percent = uploader.total.percent;
282
+ $('#total-progress-info .progress-bar').css('width', percent + "%").attr('aria-valuenow', percent);
283
+ });
284
+ uploader.bind('Error', function(up, args){
285
+ jQuery('<div/>').addClass('error').html('<span><u><em>' + args.file.name + ':</em></u> ' + args.message + ' ' + args.status + '</span>').appendTo('#pl-message');
286
+ console.log('[error] ', args);
287
+ });
288
+ uploader.bind('UploadComplete', function(up, files){
289
+ console.log('[UploadComplete]', files);
290
+ jQuery('<div/>').addClass('success').html('<?php _e('Done!', 'flash-album-gallery'); ?> <a href="<?php echo wp_nonce_url( $flag->manage_page->base_page . "&mode=edit", 'flag_editgallery'); ?>&gid=' + jQuery("#galleryselect").val() + '">Open Gallery</a>').appendTo('#pl-message');
291
+ });
292
+
293
+ jQuery("#gmUpload").on('click', '.ui-button-disabled', function(e){
294
+ if(files_remaining){
295
+ alert("Choose gallery, please.")
296
+ }
297
+ });
298
+ jQuery("#galleryselect").change(function(){
299
+ if(jQuery(this).val() == 0){
300
+ jQuery("#pluploadUploader_start").addClass('ui-button-disabled ui-state-disabled');
301
+ } else{
302
+ if(files_remaining){
303
+ jQuery("#pluploadUploader_start").removeClass('ui-button-disabled ui-state-disabled');
304
+ }
305
+ }
306
+ });
307
+
308
+ });
309
+ </script>
310
+ <?php } else { ?>
311
+ <!-- MultiFile script -->
312
+ <script type="text/javascript">
313
+ /* <![CDATA[ */
314
+ jQuery(document).ready(function(){
315
+ jQuery('#imagefiles').MultiFile({
316
+ STRING: {
317
+ remove: '<?php _e('remove', 'flash-album-gallery'); ?>'
318
+ }
319
+ });
320
+
321
+ if(jQuery("#galleryselect").val() == 0){
322
+ jQuery("#choosegalfirst").animate({opacity: "0.5"}, 600);
323
+ jQuery("#choosegalfirst .disabledbut").show();
324
+ }
325
+ jQuery("#choosegalfirst .disabledbut").click(function(){
326
+ alert("Choose gallery, please.")
327
+ });
328
+ jQuery("#galleryselect").change(function(){
329
+ if(jQuery(this).val() == 0){
330
+ jQuery("#choosegalfirst .disabledbut").show();
331
+ jQuery("#choosegalfirst").animate({opacity: "0.5"}, 600);
332
+ } else{
333
+ jQuery("#choosegalfirst .disabledbut").hide();
334
+ jQuery("#choosegalfirst").animate({opacity: "1"}, 600);
335
+ }
336
+ });
337
+ });
338
+ /* ]]> */
339
+ </script>
340
+
341
+ <?php } ?>
342
+ </div>
343
+ <?php if ( ! IS_WPMU || current_user_can( 'FlAG Import folder' ) ) { ?>
344
+ <!-- import folder -->
345
+ <div id="importfolder" class="cptab">
346
+ <h2><?php _e( 'Import image folder', 'flash-album-gallery' ); ?></h2>
347
+
348
+ <form name="importfolder" id="importfolder_form" method="POST" action="<?php echo $filepath; ?>" accept-charset="utf-8">
349
+ <?php wp_nonce_field( 'flag_addgallery' ); ?>
350
+ <table class="form-table">
351
+ <tr valign="top">
352
+ <th scope="row"><?php _e( 'Import from Server path:', 'flash-album-gallery' ); ?></th>
353
+ <td>
354
+ <input type="text" size="35" id="galleryfolder" name="galleryfolder" value="<?php echo $defaultpath; ?>"/><span class="browsefiles button" style="display:none"><?php _e( 'Browse...', "flash-album-gallery" ); ?></span>
355
+
356
+ <div id="file_browser"></div>
357
+ <div><?php echo $maxsize; ?>
358
+ <?php if ( FLAG_SAFE_MODE ) { ?>
359
+ <br/><?php _e( ' Please note : For safe-mode = ON you need to add the subfolder thumbs manually', 'flash-album-gallery' ); ?><?php }; ?>
360
+ </div>
361
+ </td>
362
+ </tr>
363
+ </table>
364
+ <div class="submit">
365
+ <input class="button-primary" type="submit" name="importfolder" value="<?php _e( 'Import folder', 'flash-album-gallery' ); ?>"/>
366
+ </div>
367
+ </form>
368
+ </div>
369
+ <?php } ?>
370
+
371
+ <script type="text/javascript">
372
+ var cptabs = new ddtabcontent("tabs");
373
+ cptabs.setpersist(true);
374
+ cptabs.setselectedClassTarget("linkparent");
375
+ cptabs.init();
376
+ </script>
377
+ </div>
378
+ <?php
379
+ }
admin/admin.php CHANGED
@@ -1,438 +1,395 @@
1
- <?php
2
-
3
- /**
4
- * flagAdminPanel - Admin Section for FlaGallery
5
- *
6
- */
7
- class flagAdminPanel {
8
-
9
- // constructor
10
- function __construct() {
11
-
12
- // Add the admin menu
13
- add_action( 'admin_menu', array( &$this, 'add_menu' ) );
14
- add_action( 'init', array( &$this, 'wp_flag_check_options' ), 2 );
15
-
16
- // Add the script and style files
17
- add_action('admin_enqueue_scripts', array(&$this, 'enqueue_scripts'), 20);
18
-
19
- // Add the script and style files
20
- add_action( 'admin_print_scripts', array( &$this, 'load_scripts' ) );
21
- add_action( 'admin_print_styles', array( &$this, 'load_styles' ) );
22
-
23
- add_action( 'enqueue_block_editor_assets', array( &$this, 'gutenberg_assets' ) );
24
-
25
- add_filter( 'contextual_help', array( &$this, 'show_help' ), 10, 2 );
26
- add_filter( 'screen_meta_screen', array( &$this, 'edit_screen_meta' ) );
27
-
28
- add_filter('admin_head', array (&$this, 'wp_flag_ins_button' ), 5);
29
-
30
- }
31
-
32
- function wp_flag_check_options() {
33
- global $flag;
34
- require_once( dirname( __FILE__ ) . '/flag_install.php' );
35
-
36
- if (isset($_GET['page']) && 'flag-overview' === $_GET['page'] && isset($_POST['uninstall'])) {
37
- check_admin_referer('flag_uninstall');
38
- flag_uninstall();
39
- }
40
-
41
-
42
- $default_options = flag_list_options();
43
- $flag_db_options = get_option( 'flag_options' );
44
- if ( $flag_db_options ) {
45
- if ( function_exists( 'array_diff_key' ) ) {
46
- $flag_new_options = array_diff_key( $default_options, $flag_db_options );
47
- } else {
48
- $flag_new_options = $this->PHP4_array_diff_key( $default_options, $flag_db_options );
49
- }
50
- $flag_options = array_merge( $flag_db_options, $flag_new_options );
51
- update_option( 'flag_options', $flag_options );
52
- } else {
53
- update_option( 'flag_options', $default_options );
54
- }
55
- }
56
-
57
- function PHP4_array_diff_key() {
58
- $arrs = func_get_args();
59
- $result = array_shift( $arrs );
60
- foreach ( $arrs as $array ) {
61
- foreach ( $result as $key => $v ) {
62
- if ( array_key_exists( $key, $array ) ) {
63
- unset( $result[ $key ] );
64
- }
65
- }
66
- }
67
-
68
- return $result;
69
- }
70
-
71
- // integrate the menu
72
- function add_menu() {
73
-
74
- add_menu_page( __( 'GRAND FlaGallery overview', 'flash-album-gallery' ), __( 'FlAGallery' ), 'FlAG overview', 'flag-overview', array(
75
- &$this,
76
- 'show_menu'
77
- ), FLAG_URLPATH . 'admin/images/flag.png' );
78
- add_submenu_page( 'flag-overview', __( 'GRAND FlaGallery overview', 'flash-album-gallery' ), __( 'Overview', 'flash-album-gallery' ), 'FlAG overview', 'flag-overview', array(
79
- &$this,
80
- 'show_menu'
81
- ) );
82
- add_submenu_page( 'flag-overview', __( 'FlAG Manage gallery', 'flash-album-gallery' ), __( 'Manage Galleries', 'flash-album-gallery' ), 'FlAG Manage gallery', 'flag-manage-gallery', array(
83
- &$this,
84
- 'show_menu'
85
- ) );
86
- add_submenu_page( 'flag-overview', __( 'FlAG Music Box', 'flash-album-gallery' ), __( 'Music Box', 'flash-album-gallery' ), 'FlAG Manage music', 'flag-music-box', array(
87
- &$this,
88
- 'show_menu'
89
- ) );
90
- add_submenu_page( 'flag-overview', __( 'FlAG Video Box', 'flash-album-gallery' ), __( 'Video Box', 'flash-album-gallery' ), 'FlAG Manage video', 'flag-video-box', array(
91
- &$this,
92
- 'show_menu'
93
- ) );
94
- add_submenu_page( 'flag-overview', __( 'FlAG Banner Box', 'flash-album-gallery' ), __( 'Banner Box', 'flash-album-gallery' ), 'FlAG Manage banners', 'flag-banner-box', array(
95
- &$this,
96
- 'show_menu'
97
- ) );
98
- add_submenu_page( 'flag-overview', __( 'FlAG Manage skins', 'flash-album-gallery' ), __( 'Skins', 'flash-album-gallery' ), 'FlAG Change skin', 'flag-skins', array(
99
- &$this,
100
- 'show_menu'
101
- ) );
102
- add_submenu_page( 'flag-overview', __( 'FlAG Change options', 'flash-album-gallery' ), __( 'Options', 'flash-album-gallery' ), 'FlAG Change options', 'flag-options', array(
103
- &$this,
104
- 'show_menu'
105
- ) );
106
- add_submenu_page( 'flag-overview', __( 'Flagallery in iframe', 'flash-album-gallery' ), __( 'Iframe', 'flash-album-gallery' ), 'FlAG iFrame page', 'flag-iframe', array(
107
- &$this,
108
- 'show_menu'
109
- ) );
110
- if ( flag_wpmu_site_admin() ) {
111
- add_submenu_page( 'wpmu-admin.php', __( 'GRAND FlaGallery', 'flash-album-gallery' ), __( 'Grand Flagallery', 'flash-album-gallery' ), 'activate_plugins', 'flag-wpmu', array(
112
- &$this,
113
- 'show_menu'
114
- ) );
115
- }
116
-
117
- //register the column fields
118
- $this->register_columns();
119
-
120
- }
121
-
122
- // load the script for the defined page and load only this code
123
- function show_menu() {
124
-
125
- global $flag;
126
-
127
- // Set installation date
128
- if ( empty( $flag->options['installDate'] ) ) {
129
- $flag->options['installDate'] = time();
130
- update_option( 'flag_options', $flag->options );
131
- }
132
-
133
- switch ( $_GET['page'] ) {
134
- case "flag-manage-gallery" :
135
- include_once( dirname( __FILE__ ) . '/functions.php' ); // admin functions
136
- include_once( dirname( __FILE__ ) . '/manage.php' ); // flag_admin_manage_gallery
137
- // Initate the Manage Gallery page
138
- $flag->manage_page = new flagManageGallery();
139
- // Render the output now, because you cannot access a object during the constructor is not finished
140
- $flag->manage_page->controller();
141
-
142
- break;
143
- case "flag-music-box" :
144
- include_once( dirname( __FILE__ ) . '/music-box.php' ); // flag_music_box
145
- flag_music_controler();
146
- break;
147
- case "flag-video-box" :
148
- include_once( dirname( __FILE__ ) . '/video-box.php' ); // flag_video_box
149
- flag_video_controler();
150
- break;
151
- case "flag-banner-box" :
152
- include_once( dirname( __FILE__ ) . '/banner-box.php' ); // flag_banner_box
153
- flag_banner_controler();
154
- break;
155
- case "flag-options" :
156
- include_once( dirname( __FILE__ ) . '/settings.php' ); // flag_admin_options
157
- flag_admin_options();
158
- break;
159
- case "flag-skins" :
160
- include_once( dirname( __FILE__ ) . '/skins.php' ); // flag_manage_skins
161
- break;
162
- case "flag-iframe" :
163
- include_once( dirname( __FILE__ ) . '/flagframe-tool.php' ); // flagframe-tool
164
- break;
165
- case "flag-wpmu" :
166
- include_once( dirname( __FILE__ ) . '/wpmu.php' ); // flag_wpmu_admin
167
- flag_wpmu_setup();
168
- break;
169
- default :
170
- include_once( dirname( __FILE__ ) . '/overview.php' ); // flag_admin_overview
171
- flag_admin_overview();
172
- break;
173
- }
174
- }
175
-
176
- function enqueue_scripts($hook) {
177
- // no need to go on if it's not a plugin page
178
- if('admin.php' != $hook && isset($_GET['page']) && in_array($_GET['page'], array('flag-overview', 'flag-manage-gallery', 'flag-music-box', 'flag-video-box', 'flag-banner-box', 'flag-skins', 'flag-options', 'flag-iframe'))){
179
- global $wp_scripts, $wp_styles;
180
- foreach($wp_scripts->registered as $handle => $wp_script){
181
- if(((false !== strpos($wp_script->src, '/plugins/')) || (false !== strpos($wp_script->src, '/themes/'))) && (false === strpos($wp_script->src, 'flash-album-gallery'))){
182
- if(in_array($handle, $wp_scripts->queue)){
183
- wp_dequeue_script($handle);
184
- }
185
- wp_deregister_script($handle);
186
- }
187
- }
188
- foreach($wp_styles->registered as $handle => $wp_style){
189
- if(((false !== strpos($wp_style->src, '/plugins/')) || (false !== strpos($wp_style->src, '/themes/'))) && (false === strpos($wp_style->src, 'flash-album-gallery'))){
190
- if(in_array($handle, $wp_styles->queue)){
191
- wp_dequeue_style($handle);
192
- }
193
- wp_deregister_style($handle);
194
- }
195
- }
196
- }
197
-
198
- }
199
-
200
- /**
201
- * Enqueue the block's assets for the gutenberg editor.
202
- */
203
- function gutenberg_assets() {
204
- global $flagdb, $flag;
205
- wp_enqueue_style( 'flagallery-block-editor', FLAG_URLPATH . 'admin/css/flagallery-block.css' );
206
- wp_register_script(
207
- 'flagallery-block-editor',
208
- FLAG_URLPATH . 'admin/js/flagallery-block.js',
209
- array( 'wp-blocks', 'wp-element' )
210
- );
211
-
212
- require_once ( dirname(__FILE__) . '/get_skin.php');
213
- $flag_options = get_option('flag_options');
214
- $all_skins = get_skins();
215
- $skins = array();
216
- foreach ($all_skins as $skin_file => $skin_data) {
217
- $id = dirname($skin_file);
218
- $is_default = ($id == $flag_options['flashSkin']);
219
- $skins[$id] = array(
220
- 'id' => $id,
221
- 'name' => $skin_data['Name'],
222
- 'is_default' => $is_default,
223
- 'screenshot' => WP_PLUGIN_URL . '/flagallery-skins/' . $id . '/screenshot.png',
224
- );
225
- }
226
- $data = array(
227
- 'default_skin'=> $flag_options['flashSkin'],
228
- 'skins' => $skins,
229
- 'galleries' => $flagdb->find_all_galleries($flag->options['albSort'], $flag->options['albSortDir']),
230
- 'albums' => $flagdb->find_all_albums('id', 'ASC'),
231
- );
232
-
233
- wp_localize_script( 'flagallery-block-editor', 'flagallery_data', $data );
234
- wp_enqueue_script( 'flagallery-block-editor' );
235
- }
236
-
237
- function load_scripts() {
238
-
239
- wp_register_script( 'flag-ajax', FLAG_URLPATH . 'admin/js/flag.ajax.js', array( 'jquery' ), '1.4.1' );
240
- wp_localize_script( 'flag-ajax', 'flagAjaxSetup', array(
241
- 'url' => admin_url( 'admin-ajax.php' ),
242
- 'action' => 'flag_ajax_operation',
243
- 'operation' => '',
244
- 'nonce' => wp_create_nonce( 'flag-ajax' ),
245
- 'ids' => '',
246
- 'permission' => __( 'You do not have the correct permission', 'flash-album-gallery' ),
247
- 'error' => __( 'Unexpected Error', 'flash-album-gallery' ),
248
- 'failure' => __( 'A failure occurred', 'flash-album-gallery' )
249
- ) );
250
- wp_register_script( 'flag-progressbar', FLAG_URLPATH . 'admin/js/flag.progressbar.js', array( 'jquery' ), '1.0.1' );
251
-
252
- if ( isset( $_GET['page'] ) ) {
253
- switch ( $_GET['page'] ) {
254
- case 'flag-overview' :
255
- wp_enqueue_script( 'postbox' );
256
- case "flag-manage-gallery" :
257
- print "<script type='text/javascript' src='" . FLAG_URLPATH . "admin/js/tabs.js'></script>\n";
258
-
259
- wp_enqueue_style( 'jquery-ui-smoothness', '//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/themes/smoothness/jquery-ui.min.css', array(), '1.10.4', 'screen' );
260
- wp_enqueue_script( 'jquery-ui-full', '//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/jquery-ui.min.js', array( 'jquery' ), '1.10.4' );
261
-
262
- wp_enqueue_script( 'jquery-ui-droppable' );
263
-
264
- wp_enqueue_script( 'multifile', FLAG_URLPATH . 'admin/js/jquery.MultiFile.js', array( 'jquery' ), '1.4.6' );
265
-
266
- wp_enqueue_script( 'flag-plupload', FLAG_URLPATH . 'admin/js/plupload/plupload.full.min.js', array(
267
- 'jquery',
268
- 'jquery-ui-full'
269
- ), '2.1.1' );
270
-
271
- wp_enqueue_style( 'jquery.ui.plupload', FLAG_URLPATH . 'admin/js/plupload/jquery.ui.plupload/css/jquery.ui.plupload.css', array( 'jquery-ui-smoothness' ), '2.1.1', 'screen' );
272
- wp_enqueue_script( 'jquery.ui.plupload', FLAG_URLPATH . 'admin/js/plupload/jquery.ui.plupload/jquery.ui.plupload.min.js', array(
273
- 'flag-plupload',
274
- 'jquery-ui-full'
275
- ), '2.1.1' );
276
-
277
-
278
- wp_enqueue_script( 'dataset', FLAG_URLPATH . 'admin/js/jquery.dataset.js', array( 'jquery' ), '0.1.0' );
279
- wp_enqueue_script( 'postbox' );
280
- wp_enqueue_script( 'flag-ajax' );
281
- wp_enqueue_script( 'flag-progressbar' );
282
- add_thickbox();
283
- break;
284
- case "flag-music-box" :
285
- wp_enqueue_script( 'swfobject' );
286
- wp_enqueue_script( 'thickbox' );
287
- break;
288
- case "flag-video-box" :
289
- wp_enqueue_script( 'swfobject' );
290
- wp_enqueue_script( 'thickbox' );
291
- break;
292
- case "flag-banner-box" :
293
- wp_enqueue_script( 'thickbox' );
294
- break;
295
- case "flag-options" :
296
- print "<script type='text/javascript' src='" . FLAG_URLPATH . "admin/js/tabs.js'></script>\n";
297
- break;
298
- case "flag-skins" :
299
- wp_enqueue_script( 'thickbox' );
300
- print "<script type='text/javascript' src='" . FLAG_URLPATH . "admin/js/tabs.js'></script>\n";
301
- break;
302
- }
303
- }
304
- }
305
-
306
- function load_styles() {
307
-
308
- if ( isset( $_GET['page'] ) ) {
309
- switch ( $_GET['page'] ) {
310
- case 'flag-overview' :
311
- wp_enqueue_style( 'flagadmin', FLAG_URLPATH . 'admin/css/flagadmin.css', false, '5.0.0', 'screen' );
312
- wp_admin_css( 'css/dashboard' );
313
- break;
314
- case "flag-options" :
315
- case "flag-manage-gallery" :
316
- wp_enqueue_style( 'flagtabs', FLAG_URLPATH . 'admin/css/tabs.css', false, '5.0.0', 'screen' );
317
- case "flag-music-box" :
318
- case "flag-video-box" :
319
- case "flag-banner-box" :
320
- wp_enqueue_style( 'thickbox' );
321
- wp_enqueue_style( 'flagadmin', FLAG_URLPATH . 'admin/css/flagadmin.css', false, '5.0.0', 'screen' );
322
- break;
323
- case "flag-skins" :
324
- wp_enqueue_style( 'thickbox' );
325
- wp_enqueue_style( 'flagtabs', FLAG_URLPATH . 'admin/css/tabs.css', false, '5.0.0', 'screen' );
326
- wp_enqueue_style( 'flagadmin', FLAG_URLPATH . 'admin/css/flagadmin.css', false, '5.0.0', 'screen' );
327
- wp_admin_css( 'css/dashboard' );
328
- break;
329
- }
330
- }
331
- }
332
-
333
- function show_help( $help, $screen ) {
334
-
335
- $link = '';
336
- // menu title is localized...
337
- $i18n = strtolower( _n( 'Gallery', 'Galleries', 1, 'flash-album-gallery' ) );
338
-
339
- switch ( $screen ) {
340
- case 'toplevel_page_' . 'flag-overview' :
341
- case "{$i18n}_page_flag-manage-gallery" :
342
- case "flag-manage-gallery":
343
- case "flag-manage-images":
344
- case "{$i18n}_page_flag-skins" :
345
- case "{$i18n}_page_flag-options" :
346
- $link = '<a href="http://codeasily.com/wordpress-plugins/flag/" target="_blank">CodEasily.com</a>';
347
- break;
348
- }
349
-
350
- if ( ! empty( $link ) ) {
351
- $help = '<h5>' . __( 'Get help with Grand Flagallery', 'flash-album-gallery' ) . '</h5>';
352
- $help .= '<div class="metabox-prefs">';
353
- $help .= $link;
354
- $help .= "</div>\n";
355
- $help .= '<h5>' . __( 'More Help & Info', 'flash-album-gallery' ) . '</h5>';
356
- $help .= '<div class="metabox-prefs">';
357
- $help .= '<a href="http://codeasily.com/community/topic/video-tutorials/" target="_blank">' . __( 'Grand Flagallery Video Tutorial', 'flash-album-gallery' ) . '</a>';
358
- $help .= ' | <a href="http://codeasily.com/community/forum/flagallery-wordpress-plugin/" target="_blank">' . __( 'Forum', 'flash-album-gallery' ) . '</a>';
359
- $help .= ' | <a href="http://codeasily.com/community/topic/language-files/" target="_blank">' . __( 'Get your language pack', 'flash-album-gallery' ) . '</a>';
360
- $help .= ' | <a href="http://codeasily.com/portfolio/grand-flagallery-skins/" target="_blank">' . __( 'Skins for Grand Flagallery', 'flash-album-gallery' ) . '</a>';
361
- $help .= "</div>\n";
362
- }
363
-
364
- return $help;
365
- }
366
-
367
- function edit_screen_meta( $screen ) {
368
-
369
- // menu title is localized, so we need to change the toplevel name
370
- $i18n = strtolower( _n( 'Gallery', 'Galleries', 1, 'flash-album-gallery' ) );
371
-
372
- switch ( $screen ) {
373
- case "{$i18n}_page_flag-manage-gallery" :
374
- // we would like to have screen option only at the manage images / gallery page
375
- if ( isset ( $_POST['sortGallery'] ) ) {
376
- //$screen = $screen;
377
- } else if ( ( $_GET['mode'] == 'edit' ) || isset ( $_POST['backToGallery'] ) ) {
378
- $screen = 'flag-manage-images';
379
- } else if ( ( $_GET['mode'] == 'sort' ) ) {
380
- //$screen = $screen;
381
- } else {
382
- $screen = 'flag-manage-gallery';
383
- }
384
- break;
385
- }
386
-
387
- return $screen;
388
- }
389
-
390
- function register_column_headers( $screen, $columns ) {
391
- global $_wp_column_headers;
392
-
393
- if ( ! isset( $_wp_column_headers ) ) {
394
- $_wp_column_headers = array();
395
- }
396
-
397
- $_wp_column_headers[ $screen ] = $columns;
398
- }
399
-
400
- function register_columns() {
401
- include_once( dirname( __FILE__ ) . '/manage-images.php' );
402
- $this->register_column_headers( 'flag-manage-images', flag_manage_gallery_columns() );
403
- }
404
-
405
- function wp_flag_ins_button() {
406
-
407
- if( strpos($_SERVER['REQUEST_URI'], 'post.php')
408
- || strstr($_SERVER['PHP_SELF'], 'page-new.php')
409
- || strstr($_SERVER['PHP_SELF'], 'page.php')
410
- || strstr($_SERVER['PHP_SELF'], 'post-new.php') )
411
- {
412
- ?>
413
- <script type="text/javascript">
414
- <!--
415
- function bind_resize() {
416
- if(!window.flag_bind_resize){
417
- jQuery(window).bind("resize", tb_position);
418
- }
419
- window.flag_bind_resize = true;
420
- }
421
- //-->
422
- </script>
423
- <?php
424
- }
425
- }
426
-
427
- }
428
-
429
- function flag_wpmu_site_admin() {
430
- // Check for site admin
431
- if ( function_exists( 'is_site_admin' ) ) {
432
- if ( is_super_admin() ) {
433
- return true;
434
- }
435
- }
436
-
437
- return false;
438
- }
1
+ <?php
2
+
3
+ /**
4
+ * flagAdminPanel - Admin Section for FlaGallery
5
+ *
6
+ */
7
+ class flagAdminPanel {
8
+
9
+ // constructor
10
+ function __construct() {
11
+
12
+ // Add the admin menu
13
+ add_action( 'admin_menu', [ &$this, 'add_menu' ] );
14
+ add_action( 'init', [ &$this, 'wp_flag_check_options' ], 2 );
15
+
16
+ // Add the script and style files
17
+ add_action( 'admin_enqueue_scripts', [ &$this, 'enqueue_scripts' ], 20 );
18
+
19
+ // Add the script and style files
20
+ add_action( 'admin_print_scripts', [ &$this, 'load_scripts' ] );
21
+ add_action( 'admin_print_styles', [ &$this, 'load_styles' ] );
22
+
23
+ add_filter( 'screen_meta_screen', [ &$this, 'edit_screen_meta' ] );
24
+
25
+ add_filter( 'admin_head', [ &$this, 'wp_flag_ins_button' ], 5 );
26
+ }
27
+
28
+ function wp_flag_check_options() {
29
+ global $flag;
30
+ require_once( dirname( __FILE__ ) . '/flag_install.php' );
31
+
32
+ if ( isset( $_GET['page'] ) && 'flag-overview' === $_GET['page'] && isset( $_POST['uninstall'] ) ) {
33
+ check_admin_referer( 'flag_uninstall' );
34
+ flag_uninstall();
35
+ }
36
+
37
+
38
+ $default_options = flag_list_options();
39
+ $flag_db_options = get_option( 'flag_options' );
40
+ if ( $flag_db_options ) {
41
+ if ( function_exists( 'array_diff_key' ) ) {
42
+ $flag_new_options = array_diff_key( $default_options, $flag_db_options );
43
+ } else {
44
+ $flag_new_options = $this->PHP4_array_diff_key( $default_options, $flag_db_options );
45
+ }
46
+ $flag_options = array_merge( $flag_db_options, $flag_new_options );
47
+ update_option( 'flag_options', $flag_options );
48
+ } else {
49
+ update_option( 'flag_options', $default_options );
50
+ }
51
+ }
52
+
53
+ function PHP4_array_diff_key() {
54
+ $arrs = func_get_args();
55
+ $result = array_shift( $arrs );
56
+ foreach ( $arrs as $array ) {
57
+ foreach ( $result as $key => $v ) {
58
+ if ( array_key_exists( $key, $array ) ) {
59
+ unset( $result[ $key ] );
60
+ }
61
+ }
62
+ }
63
+
64
+ return $result;
65
+ }
66
+
67
+ // integrate the menu
68
+ function add_menu() {
69
+
70
+ $count = '';
71
+ $flag_options = get_option( 'flag_options' );
72
+ if ( current_user_can( 'FlAG Add skins' ) ) {
73
+
74
+ $update_skins = ! empty( $flag_options['update_skins'] ) ? count( $flag_options['update_skins'] ) : 0;
75
+ $new_skins = ! empty( $flag_options['new_skins'] ) ? count( $flag_options['new_skins'] ) : 0;
76
+
77
+ if ( $update_skins ) {
78
+ $count .= " <span class='update-plugins count-{$update_skins}' style='background-color: #bb391b;'><span class='plugin-count flag-skins-count flag-skins-update-count' title='" . __( 'Skins Updates', 'flash-album-gallery' ) . "'>{$update_skins}</span></span>";
79
+ }
80
+ if ( $new_skins ) {
81
+ $count .= " <span class='update-plugins count-{$new_skins}' style='background-color: #367236;'><span class='plugin-count flag-skins-count flag-skins-new-count' title='" . __( 'New Skins', 'flash-album-gallery' ) . "'>{$new_skins}</span></span>";
82
+ }
83
+ }
84
+
85
+ add_menu_page( __( 'GRAND FlaGallery overview', 'flash-album-gallery' ), "FlAGallery$count", 'FlAG overview', 'flag-overview', [
86
+ &$this,
87
+ 'show_menu',
88
+ ], FLAG_URLPATH . 'admin/images/flag.png' );
89
+ add_submenu_page( 'flag-overview', __( 'GRAND FlaGallery overview', 'flash-album-gallery' ), __( 'Overview', 'flash-album-gallery' ), 'FlAG overview', 'flag-overview', [
90
+ &$this,
91
+ 'show_menu',
92
+ ] );
93
+ add_submenu_page( 'flag-overview', __( 'FlAG Manage gallery', 'flash-album-gallery' ), __( 'Manage Galleries', 'flash-album-gallery' ), 'FlAG Manage gallery', 'flag-manage-gallery', [
94
+ &$this,
95
+ 'show_menu',
96
+ ] );
97
+ if ( ! empty( $flag_options['show_music_box'] ) ) {
98
+ add_submenu_page( 'flag-overview', __( 'FlAG Music Box', 'flash-album-gallery' ), __( 'Music Box', 'flash-album-gallery' ), 'FlAG Manage music', 'flag-music-box', [
99
+ &$this,
100
+ 'show_menu',
101
+ ] );
102
+ }
103
+ if ( ! empty( $flag_options['show_video_box'] ) ) {
104
+ add_submenu_page( 'flag-overview', __( 'FlAG Video Box', 'flash-album-gallery' ), __( 'Video Box', 'flash-album-gallery' ), 'FlAG Manage video', 'flag-video-box', [
105
+ &$this,
106
+ 'show_menu',
107
+ ] );
108
+ }
109
+ if ( ! empty( $flag_options['show_banner_box'] ) ) {
110
+ add_submenu_page( 'flag-overview', __( 'FlAG Banner Box', 'flash-album-gallery' ), __( 'Banner Box', 'flash-album-gallery' ), 'FlAG Manage banners', 'flag-banner-box', [
111
+ &$this,
112
+ 'show_menu',
113
+ ] );
114
+ }
115
+ add_submenu_page( 'flag-overview', __( 'FlAG Manage skins', 'flash-album-gallery' ), __( 'Skins', 'flash-album-gallery' ) . $count, 'FlAG Change skin', 'flag-skins', [
116
+ &$this,
117
+ 'show_menu',
118
+ ] );
119
+ add_submenu_page( 'flag-overview', __( 'FlAG Change options', 'flash-album-gallery' ), __( 'Options', 'flash-album-gallery' ), 'FlAG Change options', 'flag-options', [
120
+ &$this,
121
+ 'show_menu',
122
+ ] );
123
+ add_submenu_page( 'flag-overview', __( 'Flagallery Shortcode Generator', 'flash-album-gallery' ), __( 'Shortcode Generator', 'flash-album-gallery' ), 'FlAG Manage gallery', 'flag-shortcode-generator', [
124
+ &$this,
125
+ 'show_menu',
126
+ ] );
127
+ add_submenu_page( 'flag-overview', __( 'Flagallery in iframe', 'flash-album-gallery' ), __( 'Iframe', 'flash-album-gallery' ), 'FlAG iFrame page', 'flag-iframe', [
128
+ &$this,
129
+ 'show_menu',
130
+ ] );
131
+ if ( flag_wpmu_site_admin() ) {
132
+ add_submenu_page( 'wpmu-admin.php', __( 'GRAND FlaGallery', 'flash-album-gallery' ), __( 'Grand Flagallery', 'flash-album-gallery' ), 'activate_plugins', 'flag-wpmu', [
133
+ &$this,
134
+ 'show_menu',
135
+ ] );
136
+ }
137
+
138
+ //register the column fields
139
+ $this->register_columns();
140
+ }
141
+
142
+ // load the script for the defined page and load only this code
143
+
144
+ function register_columns() {
145
+ include_once( dirname( __FILE__ ) . '/manage-images.php' );
146
+ $this->register_column_headers( 'flag-manage-images', flag_manage_gallery_columns() );
147
+ }
148
+
149
+ function register_column_headers( $screen, $columns ) {
150
+ global $_wp_column_headers;
151
+
152
+ if ( ! isset( $_wp_column_headers ) ) {
153
+ $_wp_column_headers = [];
154
+ }
155
+
156
+ $_wp_column_headers[ $screen ] = $columns;
157
+ }
158
+
159
+ function show_menu() {
160
+
161
+ global $flag;
162
+
163
+ // Set installation date
164
+ if ( empty( $flag->options['installDate'] ) ) {
165
+ $flag->options['installDate'] = time();
166
+ update_option( 'flag_options', $flag->options );
167
+ }
168
+
169
+ switch ( $_GET['page'] ) {
170
+ case "flag-manage-gallery":
171
+ include_once( dirname( __FILE__ ) . '/functions.php' ); // admin functions
172
+ include_once( dirname( __FILE__ ) . '/manage.php' ); // flag_admin_manage_gallery
173
+ // Initate the Manage Gallery page
174
+ $flag->manage_page = new flagManageGallery();
175
+ // Render the output now, because you cannot access a object during the constructor is not finished
176
+ $flag->manage_page->controller();
177
+
178
+ break;
179
+ case "flag-music-box":
180
+ include_once( dirname( __FILE__ ) . '/music-box.php' ); // flag_music_box
181
+ flag_music_controler();
182
+ break;
183
+ case "flag-video-box":
184
+ include_once( dirname( __FILE__ ) . '/video-box.php' ); // flag_video_box
185
+ flag_video_controler();
186
+ break;
187
+ case "flag-banner-box":
188
+ include_once( dirname( __FILE__ ) . '/banner-box.php' ); // flag_banner_box
189
+ flag_banner_controler();
190
+ break;
191
+ case "flag-options":
192
+ include_once( dirname( __FILE__ ) . '/settings.php' ); // flag_admin_options
193
+ flag_admin_options();
194
+ break;
195
+ case "flag-skins":
196
+ include_once( dirname( __FILE__ ) . '/skins.php' ); // flag_manage_skins
197
+ break;
198
+ case "flag-shortcode-generator":
199
+ include_once( dirname( __FILE__ ) . '/shortcode-tool.php' ); // shortcode-tool
200
+ break;
201
+ case "flag-iframe":
202
+ include_once( dirname( __FILE__ ) . '/flagframe-tool.php' ); // flagframe-tool
203
+ break;
204
+ case "flag-wpmu":
205
+ include_once( dirname( __FILE__ ) . '/wpmu.php' ); // flag_wpmu_admin
206
+ flag_wpmu_setup();
207
+ break;
208
+ default:
209
+ include_once( dirname( __FILE__ ) . '/overview.php' ); // flag_admin_overview
210
+ flag_admin_overview();
211
+ break;
212
+ }
213
+ }
214
+
215
+ function enqueue_scripts( $hook ) {
216
+ // no need to go on if it's not a plugin page
217
+ if ( 'admin.php' != $hook && isset( $_GET['page'] ) && in_array( $_GET['page'], [ 'flag-overview', 'flag-manage-gallery', 'flag-music-box', 'flag-video-box', 'flag-banner-box', 'flag-skins', 'flag-options', 'flag-iframe' ] ) ) {
218
+ global $wp_scripts, $wp_styles;
219
+ foreach ( $wp_scripts->registered as $handle => $wp_script ) {
220
+ if ( ( ( false !== strpos( $wp_script->src, '/plugins/' ) ) || ( false !== strpos( $wp_script->src, '/themes/' ) ) ) && ( false === strpos( $wp_script->src, 'flash-album-gallery' ) ) ) {
221
+ if ( in_array( $handle, $wp_scripts->queue ) ) {
222
+ wp_dequeue_script( $handle );
223
+ }
224
+ wp_deregister_script( $handle );
225
+ }
226
+ }
227
+ foreach ( $wp_styles->registered as $handle => $wp_style ) {
228
+ if ( ( ( false !== strpos( $wp_style->src, '/plugins/' ) ) || ( false !== strpos( $wp_style->src, '/themes/' ) ) ) && ( false === strpos( $wp_style->src, 'flash-album-gallery' ) ) ) {
229
+ if ( in_array( $handle, $wp_styles->queue ) ) {
230
+ wp_dequeue_style( $handle );
231
+ }
232
+ wp_deregister_style( $handle );
233
+ }
234
+ }
235
+ }
236
+ }
237
+
238
+ function load_scripts() {
239
+
240
+ wp_register_script( 'flag-ajax', FLAG_URLPATH . 'admin/js/flag.ajax.js', [ 'jquery' ], '1.4.1' );
241
+ wp_localize_script( 'flag-ajax', 'flagAjaxSetup', [
242
+ 'url' => admin_url( 'admin-ajax.php' ),
243
+ 'action' => 'flag_ajax_operation',
244
+ 'operation' => '',
245
+ 'nonce' => wp_create_nonce( 'flag-ajax' ),
246
+ 'ids' => '',
247
+ 'permission' => __( 'You do not have the correct permission', 'flash-album-gallery' ),
248
+ 'error' => __( 'Unexpected Error', 'flash-album-gallery' ),
249
+ 'failure' => __( 'A failure occurred', 'flash-album-gallery' ),
250
+ ] );
251
+ wp_register_script( 'flag-progressbar', FLAG_URLPATH . 'admin/js/flag.progressbar.js', [ 'jquery' ], '1.0.1' );
252
+
253
+ if ( isset( $_GET['page'] ) ) {
254
+ switch ( $_GET['page'] ) {
255
+ case 'flag-overview':
256
+ wp_enqueue_script( 'postbox' );
257
+ case "flag-manage-gallery":
258
+ print "<script type='text/javascript' src='" . FLAG_URLPATH . "admin/js/tabs.js'></script>\n";
259
+
260
+ wp_enqueue_style( 'jquery-ui-smoothness', '//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/themes/smoothness/jquery-ui.min.css', [], '1.10.4', 'screen' );
261
+ wp_enqueue_script( 'jquery-ui-full', '//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/jquery-ui.min.js', [ 'jquery' ], '1.10.4' );
262
+
263
+ wp_enqueue_script( 'jquery-ui-droppable' );
264
+
265
+ wp_enqueue_script( 'multifile', FLAG_URLPATH . 'admin/js/jquery.MultiFile.js', [ 'jquery' ], '1.4.6' );
266
+
267
+ wp_enqueue_script( 'flag-plupload', FLAG_URLPATH . 'admin/js/plupload/plupload.full.min.js', [
268
+ 'jquery',
269
+ 'jquery-ui-full',
270
+ ], '2.3.6' );
271
+
272
+ wp_enqueue_style( 'jquery.ui.plupload', FLAG_URLPATH . 'admin/js/plupload/jquery.ui.plupload/css/jquery.ui.plupload.css', [ 'jquery-ui-smoothness' ], '2.3.6', 'screen' );
273
+ wp_enqueue_script( 'jquery.ui.plupload', FLAG_URLPATH . 'admin/js/plupload/jquery.ui.plupload/jquery.ui.plupload.min.js', [
274
+ 'flag-plupload',
275
+ 'jquery-ui-full',
276
+ ], '2.3.6' );
277
+
278
+
279
+ wp_enqueue_script( 'dataset', FLAG_URLPATH . 'admin/js/jquery.dataset.js', [ 'jquery' ], '0.1.0' );
280
+ wp_enqueue_script( 'postbox' );
281
+ wp_enqueue_script( 'flag-ajax' );
282
+ wp_enqueue_script( 'flag-progressbar' );
283
+ add_thickbox();
284
+ break;
285
+ case "flag-music-box":
286
+ wp_enqueue_script( 'swfobject' );
287
+ wp_enqueue_script( 'thickbox' );
288
+ break;
289
+ case "flag-video-box":
290
+ wp_enqueue_script( 'swfobject' );
291
+ wp_enqueue_script( 'thickbox' );
292
+ break;
293
+ case "flag-banner-box":
294
+ wp_enqueue_script( 'thickbox' );
295
+ break;
296
+ case "flag-options":
297
+ print "<script type='text/javascript' src='" . FLAG_URLPATH . "admin/js/tabs.js'></script>\n";
298
+ break;
299
+ case "flag-skins":
300
+ wp_enqueue_script( 'thickbox' );
301
+ print "<script type='text/javascript' src='" . FLAG_URLPATH . "admin/js/tabs.js'></script>\n";
302
+ break;
303
+ case "flag-shortcode-generator":
304
+ wp_enqueue_script( 'jquery-ui-sortable' );
305
+ break;
306
+ }
307
+ }
308
+ }
309
+
310
+ function load_styles() {
311
+
312
+ if ( isset( $_GET['page'] ) ) {
313
+ switch ( $_GET['page'] ) {
314
+ case 'flag-overview':
315
+ wp_enqueue_style( 'flagadmin', FLAG_URLPATH . 'admin/css/flagadmin.css', false, '5.0.0', 'screen' );
316
+ wp_admin_css( 'css/dashboard' );
317
+ break;
318
+ case "flag-options":
319
+ case "flag-manage-gallery":
320
+ wp_enqueue_style( 'flagtabs', FLAG_URLPATH . 'admin/css/tabs.css', false, '5.0.0', 'screen' );
321
+ case "flag-music-box":
322
+ case "flag-video-box":
323
+ case "flag-banner-box":
324
+ wp_enqueue_style( 'thickbox' );
325
+ wp_enqueue_style( 'flagadmin', FLAG_URLPATH . 'admin/css/flagadmin.css', false, '5.0.0', 'screen' );
326
+ break;
327
+ case "flag-skins":
328
+ wp_enqueue_style( 'thickbox' );
329
+ wp_enqueue_style( 'flagtabs', FLAG_URLPATH . 'admin/css/tabs.css', false, '5.0.0', 'screen' );
330
+ wp_enqueue_style( 'flagadmin', FLAG_URLPATH . 'admin/css/flagadmin.css', false, '5.0.0', 'screen' );
331
+ wp_admin_css( 'css/dashboard' );
332
+ break;
333
+ }
334
+ }
335
+ }
336
+
337
+ function edit_screen_meta( $screen ) {
338
+
339
+ // menu title is localized, so we need to change the toplevel name
340
+ $i18n = strtolower( _n( 'Gallery', 'Galleries', 1, 'flash-album-gallery' ) );
341
+
342
+ switch ( $screen ) {
343
+ case "{$i18n}_page_flag-manage-gallery":
344
+ // we would like to have screen option only at the manage images / gallery page
345
+ if ( isset( $_POST['sortGallery'] ) ) {
346
+ //$screen = $screen;
347
+ } elseif ( ( $_GET['mode'] == 'edit' ) || isset( $_POST['backToGallery'] ) ) {
348
+ $screen = 'flag-manage-images';
349
+ } elseif ( ( $_GET['mode'] == 'sort' ) ) {
350
+ //$screen = $screen;
351
+ } else {
352
+ $screen = 'flag-manage-gallery';
353
+ }
354
+ break;
355
+ }
356
+
357
+ return $screen;
358
+ }
359
+
360
+ function wp_flag_ins_button() {
361
+
362
+ if (
363
+ strpos( $_SERVER['REQUEST_URI'], 'post.php' )
364
+ || strstr( $_SERVER['PHP_SELF'], 'page-new.php' )
365
+ || strstr( $_SERVER['PHP_SELF'], 'page.php' )
366
+ || strstr( $_SERVER['PHP_SELF'], 'post-new.php' )
367
+ ) {
368
+ ?>
369
+ <script type="text/javascript">
370
+ <!--
371
+ function bind_resize() {
372
+ if (!window.flag_bind_resize) {
373
+ jQuery(window).bind('resize', tb_position);
374
+ }
375
+ window.flag_bind_resize = true;
376
+ }
377
+
378
+ //
379
+ -->
380
+ </script>
381
+ <?php
382
+ }
383
+ }
384
+ }
385
+
386
+ function flag_wpmu_site_admin() {
387
+ // Check for site admin
388
+ if ( function_exists( 'is_site_admin' ) ) {
389
+ if ( is_super_admin() ) {
390
+ return true;
391
+ }
392
+ }
393
+
394
+ return false;
395
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/ajax.php CHANGED
@@ -1,456 +1,485 @@
1
- <?php
2
-
3
- add_action( 'wp_ajax_flag_ajax_operation', 'flag_ajax_operation' );
4
-
5
- function flag_ajax_operation() {
6
- global $wpdb;
7
- // if nonce is not correct it returns -1
8
- check_ajax_referer( "flag-ajax" );
9
- // check for correct capability
10
- if ( ! is_user_logged_in() ) {
11
- die( '-1' );
12
- }
13
- // check for correct FlAG capability
14
- if ( ! current_user_can( 'FlAG Upload images' ) || ! current_user_can( 'FlAG Manage gallery' ) ) {
15
- die( '-1' );
16
- }
17
- // include the flag function
18
- include_once( dirname( __FILE__ ) . '/functions.php' );
19
- // Get the image id
20
- if ( isset( $_POST['image'] ) ) {
21
- $id = (int) $_POST['image'];
22
- // let's get the image data
23
- $picture = flagdb::find_image( $id );
24
- // what do you want to do ?
25
- switch ( $_POST['operation'] ) {
26
- case 'create_thumbnail' :
27
- $result = flagAdmin::create_thumbnail( $picture );
28
- break;
29
- case 'resize_image' :
30
- $result = flagAdmin::resize_image( $picture );
31
- break;
32
- case 'webview_image' :
33
- $result = flagAdmin::webview_image( $picture );
34
- break;
35
- case 'import_metadata' :
36
- $result = flagAdmin::import_MetaData( $id );
37
- break;
38
- case 'copy_metadata' :
39
- $result = flagAdmin::copy_MetaData( $id );
40
- break;
41
- case 'get_image_ids' :
42
- $result = flagAdmin::get_image_ids( $id );
43
- break;
44
- default :
45
- do_action( 'flag_ajax_' . sanitize_key( $_POST['operation'] ) );
46
- die( '-1' );
47
- break;
48
- }
49
- // A success should return a '1'
50
- die ( $result );
51
- }
52
- // The script should never stop here
53
- die( '0' );
54
- }
55
-
56
- add_action( 'wp_ajax_flagCreateNewThumb', 'flagCreateNewThumb' );
57
-
58
- function flagCreateNewThumb() {
59
-
60
- global $wpdb;
61
-
62
- // check for correct capability
63
- if ( ! is_user_logged_in() ) {
64
- die( '-1' );
65
- }
66
- // check for correct FlAG capability
67
- if ( ! current_user_can( 'FlAG Manage gallery' ) ) {
68
- die( '-1' );
69
- }
70
-
71
- require_once( dirname( dirname( __FILE__ ) ) . '/flag-config.php' );
72
- include_once( flagGallery::graphic_library() );
73
-
74
- $flag_options = get_option( 'flag_options' );
75
-
76
- $id = (int) $_POST['id'];
77
- $picture = flagdb::find_image( $id );
78
-
79
- $x = round( $_POST['x'] * $_POST['rr'], 0 );
80
- $y = round( $_POST['y'] * $_POST['rr'], 0 );
81
- $w = round( $_POST['w'] * $_POST['rr'], 0 );
82
- $h = round( $_POST['h'] * $_POST['rr'], 0 );
83
-
84
- $thumb = new flag_Thumbnail( $picture->imagePath, true );
85
-
86
- $thumb->crop( $x, $y, $w, $h );
87
-
88
- $thumb->resize( $flag_options['thumbWidth'], $flag_options['thumbHeight'] );
89
-
90
- if ( $thumb->save( $picture->thumbPath, 100 ) ) {
91
- //read the new sizes
92
- $new_size = @getimagesize( $picture->thumbPath );
93
- $size['width'] = $new_size[0];
94
- $size['height'] = $new_size[1];
95
-
96
- // add them to the database
97
- flagdb::update_image_meta( $picture->pid, array( 'thumbnail' => $size ) );
98
-
99
- echo "OK";
100
- } else {
101
- header( 'HTTP/1.1 500 Internal Server Error' );
102
- echo "KO";
103
- }
104
-
105
- exit();
106
-
107
- }
108
-
109
- add_action( 'wp_ajax_flag_save_album', 'flag_save_album' );
110
-
111
- function flag_save_album() {
112
-
113
- global $wpdb;
114
-
115
- // check for correct capability
116
- if ( ! is_user_logged_in() ) {
117
- die( '-1' );
118
- }
119
- // check for correct FlAG capability
120
- if ( ! current_user_can( 'FlAG Manage others gallery' ) ) {
121
- die( '-1' );
122
- }
123
-
124
- if ( isset( $_POST['form'] ) ) {
125
- parse_str( $_POST['form'], $output );
126
- }
127
- $result = false;
128
- $album_id = isset($output['album_id'])? intval( $output['album_id'] ) : 0;
129
- $album_name = wp_check_invalid_utf8(wp_strip_all_tags( $output['album_name'] ));
130
- $g = isset($output['g'])? (array) $output['g'] : array();
131
- if ( $album_name && $album_id ) {
132
- if ( count( $g ) ) {
133
- $galstring = implode( ',', $g );
134
- } else {
135
- $galstring = '';
136
- }
137
- $result = $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->flagalbum} SET name = %s, categories = %s WHERE id = %s", $album_name, $galstring, $album_id ) );
138
- }
139
-
140
- if ( $result ) {
141
- _e( 'Success', 'flash-album-gallery' );
142
- }
143
-
144
- exit();
145
-
146
- }
147
-
148
- add_action( 'wp_ajax_flag_delete_album', 'flag_delete_album' );
149
-
150
- function flag_delete_album() {
151
-
152
- global $wpdb;
153
-
154
- // check for correct capability
155
- if ( ! is_user_logged_in() ) {
156
- die( '-1' );
157
- }
158
- // check for correct FlAG capability
159
- if ( ! current_user_can( 'FlAG Manage gallery' ) ) {
160
- die( '-1' );
161
- }
162
-
163
- $result = false;
164
- if ( isset( $_POST['post'] ) ) {
165
- $result = $wpdb->query( $wpdb->prepare( "DELETE FROM {$wpdb->flagalbum} WHERE id = %d", $_POST['post'] ) );
166
- }
167
-
168
- if ( $result ) {
169
- _e( 'Success', 'flash-album-gallery' );
170
- }
171
-
172
- exit();
173
-
174
- }
175
-
176
- add_action( 'wp_ajax_flag_banner_crunch', 'flag_banner_crunch' );
177
-
178
- function flag_banner_crunch() {
179
-
180
- // check for correct capability
181
- if ( ! is_user_logged_in() ) {
182
- die( '-1' );
183
- }
184
- // check for correct FlAG capability
185
- if ( ! current_user_can( 'FlAG Manage gallery' ) ) {
186
- die( '-1' );
187
- }
188
-
189
- if ( isset( $_POST['path'] ) ) {
190
- include_once( dirname( __FILE__ ) . '/functions.php' );
191
- $id = flagAdmin::handle_import_file( $_POST['path'] );
192
- $file = basename( $_POST['path'] );
193
- if ( is_wp_error( $id ) ) {
194
- echo '<p class="error">' . sprintf( __( '<em>%s</em> was <strong>not</strong> imported due to an error: %s', 'flash-album-gallery' ), $file, $id->get_error_message() ) . '</p>';
195
- } else {
196
- echo '<p class="success">' . sprintf( __( '<em>%s</em> has been added to Media library', 'flash-album-gallery' ), $file ) . '</p>';
197
- }
198
- }
199
-
200
- exit();
201
- }
202
-
203
- add_action( 'wp_ajax_flag_file_browser', 'flag_ajax_file_browser' );
204
-
205
- /**
206
- * jQuery File Tree PHP Connector
207
- * @author Cory S.N. LaViska - A Beautiful Site (http://abeautifulsite.net/)
208
- * @version 1.0.1
209
- *
210
- * @return string folder content
211
- */
212
- function flag_ajax_file_browser() {
213
-
214
- // check for correct NextGEN capability
215
- if ( ! current_user_can( 'FlAG Import folder' ) ) {
216
- die( 'No access' );
217
- }
218
-
219
- if ( ! defined( 'ABSPATH' ) ) {
220
- die( 'No access' );
221
- }
222
-
223
- // if nonce is not correct it returns -1
224
- check_ajax_referer( 'flag-ajax', 'nonce' );
225
-
226
- //PHP4 compat script
227
- if ( ! function_exists( 'scandir' ) ) {
228
- function scandir( $dir, $listDirectories = false, $skipDots = true ) {
229
- $dirArray = array();
230
- if ( $handle = opendir( $dir ) ) {
231
- while( false !== ( $file = readdir( $handle ) ) ){
232
- if ( ( $file != '.' && $file != '..' ) || $skipDots == true ) {
233
- if ( $listDirectories == false ) {
234
- if ( is_dir( $file ) ) {
235
- continue;
236
- }
237
- }
238
- array_push( $dirArray, basename( $file ) );
239
- }
240
- }
241
- closedir( $handle );
242
- }
243
-
244
- return $dirArray;
245
- }
246
- }
247
-
248
- // start from the default path
249
- $root = trailingslashit( WINABSPATH );
250
- // get the current directory
251
- $dir = trailingslashit( urldecode( $_POST['dir'] ) );
252
-
253
- if ( file_exists( $root . $dir ) && false === strpos( $dir, '..' ) ) {
254
- $files = scandir( $root . $dir );
255
- natcasesort( $files );
256
-
257
- // The 2 counts for . and ..
258
- if ( count( $files ) > 2 ) {
259
- echo "<ul class=\"jqueryDirTree\" style=\"display: none;\">";
260
-
261
- // return only directories
262
- foreach ( $files as $file ) {
263
-
264
- //reserved name for the thumnbnails, don't use it as folder name
265
- if ( $file == 'thumbs' ) {
266
- continue;
267
- }
268
-
269
- if ( file_exists( $root . $dir . $file ) && $file != '.' && $file != '..' && is_dir( $root . $dir . $file ) ) {
270
- echo "<li class=\"directory collapsed\"><a href=\"#\" rel=\"" . esc_html( $dir . $file ) . "/\">" . esc_html( $file ) . "</a></li>";
271
- }
272
- }
273
-
274
- echo "</ul>";
275
- }
276
- }
277
-
278
- die();
279
- }
280
-
281
- add_action( 'wp_ajax_flag_plupload_uploader', 'flag_ajax_plupload_uploader' );
282
- function flag_ajax_plupload_uploader() {
283
- global $flag;
284
-
285
- //check for correct capability
286
- if ( ! is_user_logged_in() ) {
287
- die( 'Login failure. -1' );
288
- }
289
- //check for correct capability
290
- if ( ! current_user_can( 'FlAG Upload images' ) ) {
291
- die( 'You do not have permission to upload files. -2' );
292
- }
293
- //check for correct nonce
294
- check_ajax_referer( 'flag_upload' );
295
-
296
- include_once( FLAG_ABSPATH . 'admin/functions.php' );
297
- // get the gallery
298
- $galleryID = (int) $_POST['galleryselect'];
299
-
300
- echo flagAdmin::swfupload_image( $galleryID );
301
- die();
302
- }
303
-
304
- add_action( 'wp_ajax_flag_shortcode_helper', 'flag_ajax_shortcode_helper' );
305
- function flag_ajax_shortcode_helper() {
306
- //check for correct capability
307
- if ( ! is_user_logged_in() ) {
308
- die( 'Login failure. -1' );
309
- }
310
- //check for correct capability
311
- if ( ! current_user_can( 'FlAG Use TinyMCE' ) ) {
312
- die( 'You do not have permission to upload files. -2' );
313
- }
314
-
315
- $media_button = isset($_GET['media_button']) && $_GET['media_button'] == 'true'? true : false;
316
- $riched = isset($_GET['riched']) && $_GET['riched'] == 'true'? true : false;
317
-
318
- include_once( FLAG_ABSPATH . 'admin/tinymce/window.php' );
319
-
320
- die();
321
- }
322
-
323
- add_action('wp_ajax_flagallery_skin_interaction', 'flagallery_skin_interaction');
324
- add_action('wp_ajax_nopriv_flagallery_skin_interaction', 'flagallery_skin_interaction');
325
- add_action('wp_ajax_flagallery_module_interaction', 'flagallery_module_interaction');
326
- add_action('wp_ajax_nopriv_flagallery_module_interaction', 'flagallery_module_interaction');
327
- function flagallery_module_interaction(){
328
- global $wpdb;
329
-
330
- if(empty($_SERVER['HTTP_REFERER'])){
331
- header($_SERVER['SERVER_PROTOCOL'] . ' 400 Bad Request');
332
- die();
333
- }
334
-
335
- $ref = $_SERVER['HTTP_REFERER'];
336
- //$uip = str_replace('.', '', $_SERVER['REMOTE_ADDR'])
337
- if((false === strpos($ref, get_home_url())) && (false === strpos($ref, get_site_url()))){
338
- header($_SERVER['SERVER_PROTOCOL'] . ' 400 Bad Request');
339
- die();
340
- }
341
- if(('POST' !== $_SERVER['REQUEST_METHOD']) || !isset($_SERVER['HTTP_HOST']) || !strpos(get_home_url(), $_SERVER['HTTP_HOST'])){
342
- header($_SERVER['SERVER_PROTOCOL'] . ' 400 Bad Request');
343
- die();
344
- }
345
-
346
- $upd = array('pid'=>false,'vote'=>false,'hit'=>false,'reset'=>false);
347
-
348
- if(($pid = intval($_POST['hit']))){
349
- $upd['pid'] = $pid;
350
- $upd['hit'] = isset($_POST['hit']);
351
- $upd['vote'] = isset($_POST['vote']);
352
-
353
- flag_update_counter($upd);
354
-
355
- $result = $wpdb->get_results( "SELECT hitcounter, total_votes FROM $wpdb->flagpictures WHERE `pid` = $pid" );
356
-
357
- $meta['views'] = intval($result[0]->hitcounter);
358
- $meta['likes'] = intval($result[0]->total_votes);
359
- $meta = array_map('intval', $meta);
360
-
361
- header('Content-Type: application/json; charset=' . get_option('blog_charset'), true);
362
- echo json_encode($meta);
363
- die();
364
- }
365
-
366
- die();
367
- }
368
-
369
- /**
370
- * Update image hitcounter in the database
371
- *
372
- * @param $upd
373
- */
374
- function flag_update_counter($upd) {
375
- global $wpdb;
376
-
377
- if ( $pid = abs( intval($upd['pid']) ) ){
378
- if($upd['reset'] == false){
379
- if( $upd['hit'] ){
380
- $wpdb->query( "UPDATE $wpdb->flagpictures SET `hitcounter` = `hitcounter`+1 WHERE pid = $pid" );
381
- }
382
- if( $upd['vote'] ){
383
- $wpdb->query( "UPDATE $wpdb->flagpictures SET `total_votes` = IF(hitcounter > total_votes, total_votes+1, hitcounter) WHERE pid = $pid" );
384
- }
385
- } else {
386
- if( $upd['hit'] ){
387
- $hit = abs( intval($upd['hit']) );
388
- $wpdb->query( "UPDATE $wpdb->flagpictures SET `hitcounter` = $hit WHERE pid = $pid" );
389
- }
390
- if( $upd['vote'] == 1 ){
391
- $vote = abs( intval($upd['vote']) );
392
- $wpdb->query( "UPDATE $wpdb->flagpictures SET `total_votes` = IF(hitcounter > $vote, $vote, hitcounter) WHERE pid = $pid" );
393
- }
394
- }
395
- }
396
-
397
- }
398
-
399
- add_action('wp_ajax_flagallery_update_counters', 'flagallery_update_counters');
400
- add_action('wp_ajax_nopriv_flagallery_update_counters', 'flagallery_update_counters');
401
- function flagallery_update_counters(){
402
- global $wpdb;
403
-
404
- if(empty($_SERVER['HTTP_REFERER'])){
405
- header($_SERVER['SERVER_PROTOCOL'] . ' 400 Bad Request');
406
- die();
407
- }
408
-
409
- $ref = $_SERVER['HTTP_REFERER'];
410
- //$uip = str_replace('.', '', $_SERVER['REMOTE_ADDR'])
411
- if((false === strpos($ref, get_home_url())) && (false === strpos($ref, get_site_url()))){
412
- header($_SERVER['SERVER_PROTOCOL'] . ' 400 Bad Request');
413
- die();
414
- }
415
- if(('POST' !== $_SERVER['REQUEST_METHOD']) || !isset($_SERVER['HTTP_HOST']) || !strpos(get_home_url(), $_SERVER['HTTP_HOST'])){
416
- header($_SERVER['SERVER_PROTOCOL'] . ' 400 Bad Request');
417
- die();
418
- }
419
-
420
- $json = (array) json_decode(stripslashes($_POST['json']));
421
- //$upd = array('pid'=>false,'vote'=>false,'hit'=>false,'reset'=>false);
422
- $upd_array = array();
423
- if(is_array($json)){
424
- if(isset($json['views']) && is_array($json['views'])){
425
- foreach($json['views'] as $id){
426
- if((int)$id){
427
- $upd_array[ $id ] = array('pid' => $id, 'hit' => 1, 'vote' => false, 'reset' => false);
428
- }
429
- }
430
- }
431
- if(isset($json['likes']) && is_array($json['likes'])){
432
- foreach($json['likes'] as $id){
433
- if(isset($upd_array[$id])){
434
- $upd_array[ $id ]['vote'] = 1;
435
- }
436
- }
437
- }
438
- }
439
-
440
- $meta = array();
441
- foreach($upd_array as $upd){
442
- $pid = (int)$upd['pid'];
443
- flag_update_counter($upd);
444
- $result = $wpdb->get_results( "SELECT hitcounter, total_votes FROM $wpdb->flagpictures WHERE `pid` = $pid" );
445
- if($result){
446
- $meta[$pid] = array(
447
- 'views' => intval($result[0]->hitcounter),
448
- 'likes' => intval($result[0]->total_votes),
449
- );
450
- }
451
- }
452
-
453
- header('Content-Type: application/json; charset=' . get_option('blog_charset'), true);
454
- echo json_encode($meta);
455
- die();
456
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ add_action( 'wp_ajax_flag_ajax_operation', 'flag_ajax_operation' );
4
+
5
+ function flag_ajax_operation() {
6
+ global $wpdb;
7
+ // if nonce is not correct it returns -1
8
+ check_ajax_referer( "flag-ajax" );
9
+ // check for correct capability
10
+ if ( ! is_user_logged_in() ) {
11
+ die( '-1' );
12
+ }
13
+ // check for correct FlAG capability
14
+ if ( ! current_user_can( 'FlAG Upload images' ) || ! current_user_can( 'FlAG Manage gallery' ) ) {
15
+ die( '-1' );
16
+ }
17
+ // include the flag function
18
+ include_once( dirname( __FILE__ ) . '/functions.php' );
19
+ // Get the image id
20
+ if ( isset( $_POST['image'] ) ) {
21
+ $id = (int) $_POST['image'];
22
+ // let's get the image data
23
+ $picture = flagdb::find_image( $id );
24
+ // what do you want to do ?
25
+ switch ( $_POST['operation'] ) {
26
+ case 'create_thumbnail' :
27
+ $result = flagAdmin::create_thumbnail( $picture );
28
+ break;
29
+ case 'resize_image' :
30
+ $result = flagAdmin::resize_image( $picture );
31
+ break;
32
+ case 'webview_image' :
33
+ $result = flagAdmin::webview_image( $picture );
34
+ break;
35
+ case 'import_metadata' :
36
+ $result = flagAdmin::import_MetaData( $id );
37
+ break;
38
+ case 'copy_metadata' :
39
+ $result = flagAdmin::copy_MetaData( $id );
40
+ break;
41
+ case 'get_image_ids' :
42
+ $result = flagAdmin::get_image_ids( $id );
43
+ break;
44
+ default :
45
+ do_action( 'flag_ajax_' . sanitize_key( $_POST['operation'] ) );
46
+ die( '-1' );
47
+ break;
48
+ }
49
+ // A success should return a '1'
50
+ die ( $result );
51
+ }
52
+ // The script should never stop here
53
+ die( '0' );
54
+ }
55
+
56
+ add_action( 'wp_ajax_flagCreateNewThumb', 'flagCreateNewThumb' );
57
+
58
+ function flagCreateNewThumb() {
59
+
60
+ global $wpdb;
61
+
62
+ // check for correct capability
63
+ if ( ! is_user_logged_in() ) {
64
+ die( '-1' );
65
+ }
66
+ // check for correct FlAG capability
67
+ if ( ! current_user_can( 'FlAG Manage gallery' ) ) {
68
+ die( '-1' );
69
+ }
70
+
71
+ require_once( dirname( dirname( __FILE__ ) ) . '/flag-config.php' );
72
+ include_once( flagGallery::graphic_library() );
73
+
74
+ $flag_options = get_option( 'flag_options' );
75
+
76
+ $id = (int) $_POST['id'];
77
+ $picture = flagdb::find_image( $id );
78
+
79
+ $x = round( $_POST['x'] * $_POST['rr'], 0 );
80
+ $y = round( $_POST['y'] * $_POST['rr'], 0 );
81
+ $w = round( $_POST['w'] * $_POST['rr'], 0 );
82
+ $h = round( $_POST['h'] * $_POST['rr'], 0 );
83
+
84
+ $thumb = new flag_Thumbnail( $picture->imagePath, true );
85
+
86
+ $thumb->crop( $x, $y, $w, $h );
87
+
88
+ $thumb->resize( $flag_options['thumbWidth'], $flag_options['thumbHeight'] );
89
+
90
+ if ( $thumb->save( $picture->thumbPath, 100 ) ) {
91
+ //read the new sizes
92
+ $new_size = @getimagesize( $picture->thumbPath );
93
+ $size['width'] = $new_size[0];
94
+ $size['height'] = $new_size[1];
95
+
96
+ // add them to the database
97
+ flagdb::update_image_meta( $picture->pid, [ 'thumbnail' => $size ] );
98
+
99
+ echo "OK";
100
+ } else {
101
+ header( 'HTTP/1.1 500 Internal Server Error' );
102
+ echo "KO";
103
+ }
104
+
105
+ exit();
106
+
107
+ }
108
+
109
+ add_action( 'wp_ajax_flag_save_album', 'flag_save_album' );
110
+
111
+ function flag_save_album() {
112
+
113
+ global $wpdb;
114
+
115
+ // check for correct capability
116
+ if ( ! is_user_logged_in() ) {
117
+ die( '-1' );
118
+ }
119
+ // check for correct FlAG capability
120
+ if ( ! current_user_can( 'FlAG Manage others gallery' ) ) {
121
+ die( '-1' );
122
+ }
123
+
124
+ if ( isset( $_POST['form'] ) ) {
125
+ parse_str( $_POST['form'], $output );
126
+ }
127
+ $result = false;
128
+ $album_id = isset( $output['album_id'] ) ? intval( $output['album_id'] ) : 0;
129
+ $album_name = wp_check_invalid_utf8( wp_strip_all_tags( $output['album_name'] ) );
130
+ $g = isset( $output['g'] ) ? (array) $output['g'] : [];
131
+ if ( $album_name && $album_id ) {
132
+ if ( count( $g ) ) {
133
+ $galstring = implode( ',', $g );
134
+ } else {
135
+ $galstring = '';
136
+ }
137
+ $result = $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->flagalbum} SET name = %s, categories = %s WHERE id = %s", $album_name, $galstring, $album_id ) );
138
+ }
139
+
140
+ if ( $result ) {
141
+ _e( 'Success', 'flash-album-gallery' );
142
+ }
143
+
144
+ exit();
145
+
146
+ }
147
+
148
+ add_action( 'wp_ajax_flag_delete_album', 'flag_delete_album' );
149
+
150
+ function flag_delete_album() {
151
+
152
+ global $wpdb;
153
+
154
+ // check for correct capability
155
+ if ( ! is_user_logged_in() ) {
156
+ die( '-1' );
157
+ }
158
+ // check for correct FlAG capability
159
+ if ( ! current_user_can( 'FlAG Manage gallery' ) ) {
160
+ die( '-1' );
161
+ }
162
+
163
+ $result = false;
164
+ if ( isset( $_POST['post'] ) ) {
165
+ $result = $wpdb->query( $wpdb->prepare( "DELETE FROM {$wpdb->flagalbum} WHERE id = %d", $_POST['post'] ) );
166
+ }
167
+
168
+ if ( $result ) {
169
+ _e( 'Success', 'flash-album-gallery' );
170
+ }
171
+
172
+ exit();
173
+
174
+ }
175
+
176
+ add_action( 'wp_ajax_flag_banner_crunch', 'flag_banner_crunch' );
177
+
178
+ function flag_banner_crunch() {
179
+
180
+ // check for correct capability
181
+ if ( ! is_user_logged_in() ) {
182
+ die( '-1' );
183
+ }
184
+ // check for correct FlAG capability
185
+ if ( ! current_user_can( 'FlAG Manage gallery' ) ) {
186
+ die( '-1' );
187
+ }
188
+
189
+ if ( isset( $_POST['path'] ) ) {
190
+ include_once( dirname( __FILE__ ) . '/functions.php' );
191
+ $id = flagAdmin::handle_import_file( $_POST['path'] );
192
+ $file = basename( $_POST['path'] );
193
+ if ( is_wp_error( $id ) ) {
194
+ echo '<p class="error">' . sprintf( __( '<em>%s</em> was <strong>not</strong> imported due to an error: %s', 'flash-album-gallery' ), $file, $id->get_error_message() ) . '</p>';
195
+ } else {
196
+ echo '<p class="success">' . sprintf( __( '<em>%s</em> has been added to Media library', 'flash-album-gallery' ), $file ) . '</p>';
197
+ }
198
+ }
199
+
200
+ exit();
201
+ }
202
+
203
+ add_action( 'wp_ajax_flag_file_browser', 'flag_ajax_file_browser' );
204
+
205
+ /**
206
+ * jQuery File Tree PHP Connector
207
+ *
208
+ * @author Cory S.N. LaViska - A Beautiful Site (http://abeautifulsite.net/)
209
+ * @version 1.0.1
210
+ *
211
+ * @return string folder content
212
+ */
213
+ function flag_ajax_file_browser() {
214
+
215
+ // check for correct NextGEN capability
216
+ if ( ! current_user_can( 'FlAG Import folder' ) ) {
217
+ die( 'No access' );
218
+ }
219
+
220
+ if ( ! defined( 'ABSPATH' ) ) {
221
+ die( 'No access' );
222
+ }
223
+
224
+ // if nonce is not correct it returns -1
225
+ check_ajax_referer( 'flag-ajax', 'nonce' );
226
+
227
+ //PHP4 compat script
228
+ if ( ! function_exists( 'scandir' ) ) {
229
+ function scandir( $dir, $listDirectories = false, $skipDots = true ) {
230
+ $dirArray = [];
231
+ if ( $handle = opendir( $dir ) ) {
232
+ while ( false !== ( $file = readdir( $handle ) ) ) {
233
+ if ( ( $file != '.' && $file != '..' ) || $skipDots == true ) {
234
+ if ( $listDirectories == false ) {
235
+ if ( is_dir( $file ) ) {
236
+ continue;
237
+ }
238
+ }
239
+ array_push( $dirArray, basename( $file ) );
240
+ }
241
+ }
242
+ closedir( $handle );
243
+ }
244
+
245
+ return $dirArray;
246
+ }
247
+ }
248
+
249
+ // start from the default path
250
+ $root = trailingslashit( WINABSPATH );
251
+ // get the current directory
252
+ $dir = trailingslashit( urldecode( $_POST['dir'] ) );
253
+
254
+ if ( file_exists( $root . $dir ) && false === strpos( $dir, '..' ) ) {
255
+ $files = scandir( $root . $dir );
256
+ natcasesort( $files );
257
+
258
+ // The 2 counts for . and ..
259
+ if ( count( $files ) > 2 ) {
260
+ echo "<ul class=\"jqueryDirTree\" style=\"display: none;\">";
261
+
262
+ // return only directories
263
+ foreach ( $files as $file ) {
264
+
265
+ //reserved name for the thumnbnails, don't use it as folder name
266
+ if ( $file == 'thumbs' ) {
267
+ continue;
268
+ }
269
+
270
+ if ( file_exists( $root . $dir . $file ) && $file != '.' && $file != '..' && is_dir( $root . $dir . $file ) ) {
271
+ echo "<li class=\"directory collapsed\"><a href=\"#\" rel=\"" . esc_html( $dir . $file ) . "/\">" . esc_html( $file ) . "</a></li>";
272
+ }
273
+ }
274
+
275
+ echo "</ul>";
276
+ }
277
+ }
278
+
279
+ die();
280
+ }
281
+
282
+ add_action( 'wp_ajax_flag_plupload_uploader', 'flag_ajax_plupload_uploader' );
283
+ function flag_ajax_plupload_uploader() {
284
+ global $flag;
285
+
286
+ //check for correct capability
287
+ if ( ! is_user_logged_in() ) {
288
+ die( 'Login failure. -1' );
289
+ }
290
+ //check for correct capability
291
+ if ( ! current_user_can( 'FlAG Upload images' ) ) {
292
+ die( 'You do not have permission to upload files. -2' );
293
+ }
294
+ //check for correct nonce
295
+ check_ajax_referer( 'flag_upload' );
296
+
297
+ include_once( FLAG_ABSPATH . 'admin/functions.php' );
298
+ // get the gallery
299
+ $galleryID = (int) $_POST['galleryselect'];
300
+
301
+ echo flagAdmin::swfupload_image( $galleryID );
302
+ die();
303
+ }
304
+
305
+ add_action( 'wp_ajax_flagallery_shortcode_html', 'flagallery_ajax_shortcode_html' );
306
+ function flagallery_ajax_shortcode_html() {
307
+
308
+ //check for correct capability.
309
+ if ( ! is_user_logged_in() ) {
310
+ die( 'Login failure. -1' );
311
+ }
312
+
313
+ check_ajax_referer( 'FlaGallery' );
314
+
315
+ if ( isset( $_POST['shortcode'] ) ) {
316
+ global $flag;
317
+ require_once (dirname (dirname (__FILE__) ) . '/lib/skinobject.php');
318
+ require_once (dirname (dirname (__FILE__) ) . '/lib/shortcodes.php');
319
+
320
+ // Compatibilbity.
321
+ add_filter( 'jetpack_lazy_images_skip_image_with_attributes', array( $flag, 'jetpack_no_lazy_src' ), 10, 2 );
322
+ add_filter( 'jetpack_lazy_images_blacklisted_classes', array( $flag, 'jetpack_no_lazy_classes' ), 10 );
323
+ add_filter( 'a3_lazy_load_skip_images_classes', array( $flag, 'a3_no_lazy' ), 10 );
324
+
325
+ $shortcode = sanitize_text_field( $_POST['shortcode'] );
326
+ echo do_shortcode( $shortcode );
327
+
328
+ print_late_styles();
329
+ }
330
+ die();
331
+ }
332
+
333
+ add_action( 'wp_ajax_flag_shortcode_helper', 'flag_ajax_shortcode_helper' );
334
+ function flag_ajax_shortcode_helper() {
335
+ //check for correct capability
336
+ if ( ! is_user_logged_in() ) {
337
+ die( 'Login failure. -1' );
338
+ }
339
+ //check for correct capability
340
+ if ( ! current_user_can( 'FlAG Use TinyMCE' ) ) {
341
+ die( 'You do not have permission to upload files. -2' );
342
+ }
343
+
344
+ $media_button = isset( $_GET['media_button'] ) && $_GET['media_button'] == 'true' ? true : false;
345
+ $riched = isset( $_GET['riched'] ) && $_GET['riched'] == 'true' ? true : false;
346
+
347
+ include_once( FLAG_ABSPATH . 'admin/tinymce/window.php' );
348
+
349
+ die();
350
+ }
351
+
352
+ add_action( 'wp_ajax_flagallery_skin_interaction', 'flagallery_skin_interaction' );
353
+ add_action( 'wp_ajax_nopriv_flagallery_skin_interaction', 'flagallery_skin_interaction' );
354
+ add_action( 'wp_ajax_flagallery_module_interaction', 'flagallery_module_interaction' );
355
+ add_action( 'wp_ajax_nopriv_flagallery_module_interaction', 'flagallery_module_interaction' );
356
+ function flagallery_module_interaction() {
357
+ global $wpdb;
358
+
359
+ if ( empty( $_SERVER['HTTP_REFERER'] ) ) {
360
+ header( $_SERVER['SERVER_PROTOCOL'] . ' 400 Bad Request' );
361
+ die();
362
+ }
363
+
364
+ $ref = $_SERVER['HTTP_REFERER'];
365
+ //$uip = str_replace('.', '', $_SERVER['REMOTE_ADDR'])
366
+ if ( ( false === strpos( $ref, get_home_url() ) ) && ( false === strpos( $ref, get_site_url() ) ) ) {
367
+ header( $_SERVER['SERVER_PROTOCOL'] . ' 400 Bad Request' );
368
+ die();
369
+ }
370
+ if ( ( 'POST' !== $_SERVER['REQUEST_METHOD'] ) || ! isset( $_SERVER['HTTP_HOST'] ) || ! strpos( get_home_url(), $_SERVER['HTTP_HOST'] ) ) {
371
+ header( $_SERVER['SERVER_PROTOCOL'] . ' 400 Bad Request' );
372
+ die();
373
+ }
374
+
375
+ $upd = [ 'pid' => false, 'vote' => false, 'hit' => false, 'reset' => false ];
376
+
377
+ if ( ( $pid = intval( $_POST['hit'] ) ) ) {
378
+ $upd['pid'] = $pid;
379
+ $upd['hit'] = isset( $_POST['hit'] );
380
+ $upd['vote'] = isset( $_POST['vote'] );
381
+
382
+ flag_update_counter( $upd );
383
+
384
+ $result = $wpdb->get_results( "SELECT hitcounter, total_votes FROM $wpdb->flagpictures WHERE `pid` = $pid" );
385
+
386
+ $meta['views'] = intval( $result[0]->hitcounter );
387
+ $meta['likes'] = intval( $result[0]->total_votes );
388
+ $meta = array_map( 'intval', $meta );
389
+
390
+ header( 'Content-Type: application/json; charset=' . get_option( 'blog_charset' ), true );
391
+ echo json_encode( $meta );
392
+ die();
393
+ }
394
+
395
+ die();
396
+ }
397
+
398
+ /**
399
+ * Update image hitcounter in the database
400
+ *
401
+ * @param $upd
402
+ */
403
+ function flag_update_counter( $upd ) {
404
+ global $wpdb;
405
+
406
+ if ( $pid = abs( intval( $upd['pid'] ) ) ) {
407
+ if ( $upd['reset'] == false ) {
408
+ if ( $upd['hit'] ) {
409
+ $wpdb->query( "UPDATE $wpdb->flagpictures SET `hitcounter` = `hitcounter`+1 WHERE pid = $pid" );
410
+ }
411
+ if ( $upd['vote'] ) {
412
+ $wpdb->query( "UPDATE $wpdb->flagpictures SET `total_votes` = IF(hitcounter > total_votes, total_votes+1, hitcounter) WHERE pid = $pid" );
413
+ }
414
+ } else {
415
+ if ( $upd['hit'] ) {
416
+ $hit = abs( intval( $upd['hit'] ) );
417
+ $wpdb->query( "UPDATE $wpdb->flagpictures SET `hitcounter` = $hit WHERE pid = $pid" );
418
+ }
419
+ if ( $upd['vote'] == 1 ) {
420
+ $vote = abs( intval( $upd['vote'] ) );
421
+ $wpdb->query( "UPDATE $wpdb->flagpictures SET `total_votes` = IF(hitcounter > $vote, $vote, hitcounter) WHERE pid = $pid" );
422
+ }
423
+ }
424
+ }
425
+
426
+ }
427
+
428
+ add_action( 'wp_ajax_flagallery_update_counters', 'flagallery_update_counters' );
429
+ add_action( 'wp_ajax_nopriv_flagallery_update_counters', 'flagallery_update_counters' );
430
+ function flagallery_update_counters() {
431
+ global $wpdb;
432
+
433
+ if ( empty( $_SERVER['HTTP_REFERER'] ) ) {
434
+ header( $_SERVER['SERVER_PROTOCOL'] . ' 400 Bad Request' );
435
+ die();
436
+ }
437
+
438
+ $ref = $_SERVER['HTTP_REFERER'];
439
+ //$uip = str_replace('.', '', $_SERVER['REMOTE_ADDR'])
440
+ if ( ( false === strpos( $ref, get_home_url() ) ) && ( false === strpos( $ref, get_site_url() ) ) ) {
441
+ header( $_SERVER['SERVER_PROTOCOL'] . ' 400 Bad Request' );
442
+ die();
443
+ }
444
+ if ( ( 'POST' !== $_SERVER['REQUEST_METHOD'] ) || ! isset( $_SERVER['HTTP_HOST'] ) || ! strpos( get_home_url(), $_SERVER['HTTP_HOST'] ) ) {
445
+ header( $_SERVER['SERVER_PROTOCOL'] . ' 400 Bad Request' );
446
+ die();
447
+ }
448
+
449
+ $json = (array) json_decode( stripslashes( $_POST['json'] ) );
450
+ //$upd = array('pid'=>false,'vote'=>false,'hit'=>false,'reset'=>false);
451
+ $upd_array = [];
452
+ if ( is_array( $json ) ) {
453
+ if ( isset( $json['views'] ) && is_array( $json['views'] ) ) {
454
+ foreach ( $json['views'] as $id ) {
455
+ if ( (int) $id ) {
456
+ $upd_array[ $id ] = [ 'pid' => $id, 'hit' => 1, 'vote' => false, 'reset' => false ];
457
+ }
458
+ }
459
+ }
460
+ if ( isset( $json['likes'] ) && is_array( $json['likes'] ) ) {
461
+ foreach ( $json['likes'] as $id ) {
462
+ if ( isset( $upd_array[ $id ] ) ) {
463
+ $upd_array[ $id ]['vote'] = 1;
464
+ }
465
+ }
466
+ }
467
+ }
468
+
469
+ $meta = [];
470
+ foreach ( $upd_array as $upd ) {
471
+ $pid = (int) $upd['pid'];
472
+ flag_update_counter( $upd );
473
+ $result = $wpdb->get_results( "SELECT hitcounter, total_votes FROM $wpdb->flagpictures WHERE `pid` = $pid" );
474
+ if ( $result ) {
475
+ $meta[ $pid ] = [
476
+ 'views' => intval( $result[0]->hitcounter ),
477
+ 'likes' => intval( $result[0]->total_votes ),
478
+ ];
479
+ }
480
+ }
481
+
482
+ header( 'Content-Type: application/json; charset=' . get_option( 'blog_charset' ), true );
483
+ echo json_encode( $meta );
484
+ die();
485
+ }
admin/banner.functions.php CHANGED
@@ -132,8 +132,7 @@ function flagSave_bPlaylist($title, $descr, $data, $file = '', $skinaction = '')
132
  }
133
  $properties = json_encode($settings);
134
 
135
- if(count($data)){
136
- $content = '<gallery>
137
  <settings><![CDATA[' . $properties . ']]></settings>
138
  <category id="' . $file . '">
139
  <properties>
@@ -143,6 +142,7 @@ function flagSave_bPlaylist($title, $descr, $data, $file = '', $skinaction = '')
143
  </properties>
144
  <items>';
145
 
 
146
  foreach((array) $data as $id){
147
  $ban = get_post($id);
148
  if($ban->ID){
@@ -159,20 +159,21 @@ function flagSave_bPlaylist($title, $descr, $data, $file = '', $skinaction = '')
159
  </item>';
160
  }
161
  }
162
- $content .= '
 
 
163
  </items>
164
  </category>
165
  </gallery>';
166
- //$content = str_replace(array('\\\'','\"'), array('\'','"'), $content);
167
- // Save options
168
- $flag_options = get_option('flag_options');
169
- if(wp_mkdir_p(ABSPATH . $flag_options['galleryPath'] . 'playlists/banner/')){
170
- if(flagGallery::saveFile($playlistPath, $content, 'w')){
171
- flagGallery::show_message(__('Playlist Saved Successfully', 'flash-album-gallery'));
172
- }
173
- } else{
174
- flagGallery::show_message(__('Create directory please:', 'flash-album-gallery') . '"/' . $flag_options['galleryPath'] . 'playlists/banner/"');
175
  }
 
 
176
  }
177
  }
178
 
132
  }
133
  $properties = json_encode($settings);
134
 
135
+ $content = '<gallery>
 
136
  <settings><![CDATA[' . $properties . ']]></settings>
137
  <category id="' . $file . '">
138
  <properties>
142
  </properties>
143
  <items>';
144
 
145
+ if(count($data)){
146
  foreach((array) $data as $id){
147
  $ban = get_post($id);
148
  if($ban->ID){
159
  </item>';
160
  }
161
  }
162
+ }
163
+
164
+ $content .= '
165
  </items>
166
  </category>
167
  </gallery>';
168
+ //$content = str_replace(array('\\\'','\"'), array('\'','"'), $content);
169
+ // Save options
170
+ $flag_options = get_option('flag_options');
171
+ if(wp_mkdir_p(ABSPATH . $flag_options['galleryPath'] . 'playlists/banner/')){
172
+ if(flagGallery::saveFile($playlistPath, $content, 'w')){
173
+ flagGallery::show_message(__('Playlist Saved Successfully', 'flash-album-gallery'));
 
 
 
174
  }
175
+ } else{
176
+ flagGallery::show_message(__('Create directory please:', 'flash-album-gallery') . '"/' . $flag_options['galleryPath'] . 'playlists/banner/"');
177
  }
178
  }
179
 
admin/blocks/assets/icon-128x128.png ADDED
Binary file
admin/blocks/dist/blocks.build.js ADDED
@@ -0,0 +1 @@
 
1
+ !function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=2)}([function(e,t,n){},function(e,t,n){},function(e,t,n){"use strict";n.r(t);var r={};n.r(r),n.d(r,"name",(function(){return Je})),n.d(r,"title",(function(){return Ke})),n.d(r,"icon",(function(){return Qe})),n.d(r,"settings",(function(){return et}));n(0);function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function i(e,t){return(i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function c(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=u(e);if(t){var o=u(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return s(this,n)}}function s(e,t){return!t||"object"!==o(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function u(e){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var f=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&i(e,t)}(s,e);var t,n,r,o=c(s);function s(){return l(this,s),o.apply(this,arguments)}return t=s,(n=[{key:"render",value:function(){var e=this.props.attributes;return""===e.id?"":wp.element.createElement("div",{className:"flagallery-shortcode"},e.shortcode)}}])&&a(t.prototype,n),r&&a(t,r),s}(wp.element.Component);function p(e){return(p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function y(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function m(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function b(e,t){return(b=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function d(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=g(e);if(t){var o=g(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return h(this,n)}}function h(e,t){return!t||"object"!==p(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function g(e){return(g=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var w=wp.element.Component,v=window.FlaGallery,O=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&b(e,t)}(l,e);var t,n,r,o=d(l);function l(){return y(this,l),o.apply(this,arguments)}return t=l,(n=[{key:"createShortCode",value:function(e){var t,n=e.id,r=e.type,o=e.galleryname||"",l=e.skin||"",a=e.preset||"",i=e.align||"",c=e.width||"",s="",u="",f="";return t="gallery"===r?" gid=".concat(n):" album=".concat(n),o&&o.indexOf(" ")>=0&&(o="'".concat(o,"'")),o&&(o=" name=".concat(o)),f=c?" w=".concat(c):"",l?s=" skin=".concat(l):(s="",l=v.default_skin),a?u=a.indexOf(" ")>=0?" preset='".concat(a,"'"):" preset=".concat(a):(u="",a=""),i=i?" align=".concat(i):"","[flagallery".concat(t).concat(o).concat(f).concat(s).concat(u).concat(i,"]")}},{key:"render",value:function(){return""===this.props.attributes.id?"":wp.element.createElement("div",{className:"flagallery-shortcode"},this.createShortCode(this.props.attributes))}}])&&m(t.prototype,n),r&&m(t,r),l}(w);function k(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function R(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?k(Object(n),!0).forEach((function(t){P(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):k(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function P(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var j=console.log,E={amron:!0,albumnavigator:!0,albumwiz:!0,horizon:!0,paginator:!0};function S(e){var t=window.FlaGallery,n=""===e?t.default_skin:e;return!!t.skins[n]&&E[n]}function _(e){var t=function(e){var t="".concat("gallery"===e.type?" gid=":" album=").concat(e.id.split("-").pop());""===e.id&&(t="");var n=""!==e.galleryname?" name=".concat(e.galleryname):"",r=""===e.skin?"":" skin=".concat(e.skin),o=""!==e.preset?" preset=".concat(e.preset):"";return""===t?"":"[flagallery".concat(t+n+r+o,"]")}(R(R({},this.props.attributes),e));e=R(R({},e),{shortcode:t}),this.props.setAttributes(e)}function A(e){var t=window.FlaGallery;if(S(e))if(t||t.skins){e=""===e?t.default_skin:e;var n="".concat(t.skins[e].screenshot.split("screenshot.png")[0],"js/").concat(e,".js");if(!function(e,t){var n=window.FlaGallery;if(t&&n&&n.skins&&n.skins[t].js)return!0;for(var r=new URL(e).pathname,o=document.getElementsByTagName("script"),l=0;l<o.length;l+=1){var a=o[l];if(a.src)if(new URL(a.src).pathname===r)return l=o.length,!0}return!1}(n,e)){var r=document.createElement("script");r.setAttribute("type","text/javascript"),r.src=n,r.async=!0,document.body.appendChild(r),j("Plug start load Script",e||"")}t.skins[e]?t.skins[e].js=!0:j("Unable to load script - missing FlaGallery")}else j("Unable to load script - missing FlaGallery")}n(1);function C(e){return(C="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function x(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function D(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function G(e,t){return(G=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function W(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=L(e);if(t){var o=L(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return N(this,n)}}function N(e,t){return!t||"object"!==C(t)&&"function"!=typeof t?T(e):t}function T(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function L(e){return(L=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var M=wp.element,F=M.Component,B=M.createRef,U=wp.components,H=U.SelectControl,q=U.TextControl,I="flag-sh-code-bilder-",V=window.FlaGallery,Z=V.skins,z=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&G(e,t)}(l,e);var t,n,r,o=W(l);function l(){var e;if(x(this,l),(e=o.apply(this,arguments)).setSomeAttributes=_.bind(T(e)),e.panelRef=B(),e.panel=void 0,e.albumsAndGalleries=[{value:"",label:"- Select your album / gallery -"}],e.albums=[{value:null,label:"Albums",disabled:!0}],Object.keys(V.albums).length>0)for(var t in V.albums)if(V.albums.hasOwnProperty(t)){var n=V.albums[t];e.albums.push({value:"album-".concat(n.id),label:n.name})}if(e.galleries=[{value:null,label:"Galleries",disabled:!0},{value:"gallery-all",label:"Show All Galleries"}],Object.keys(V.galleries).length>0)for(var r in V.galleries)if(V.galleries.hasOwnProperty(r)){var a=V.galleries[r];e.galleries.push({value:"gallery-".concat(a.gid),label:a.title})}e.albums.length>1&&(e.albumsAndGalleries=e.albumsAndGalleries.concat(e.albums)),e.albumsAndGalleries=e.albumsAndGalleries.concat(e.galleries);var i=V.skins[V.default_skin].name;if(e.skins=[{label:"".concat(i," - Default Skin"),value:""}],Object.keys(V.skins).length>0)for(var c in V.skins)if(V.skins.hasOwnProperty(c)){var s=V.skins[c],u={value:s.id,label:s.name};e.skins.push(u)}return e}return t=l,(n=[{key:"componentDidMount",value:function(){if(!this.panel&&this.panelRef&&this.panelRef.current){this.panel=this.panelRef.current;var e=document.createElement("style");this.panel.appendChild(e);var t="";for(var n in E)Object.prototype.hasOwnProperty.call(E,n)&&(t+='select option[value="'.concat(n,'"] { font-weight: 600;\tcolor: #007cba;}'));e.innerHTML=t}}},{key:"getPresetsBySkins",value:function(e){var t=[{label:"Default preset",value:""}];if(Object.keys(V.presets).length>0)for(var n in V.presets)if(V.presets.hasOwnProperty(n)){var r=V.presets[n];r.id===e&&t.push({value:r.name,label:r.name})}return t}},{key:"render",value:function(){var e=this,t=this.props.attributes,n=""===t.skin?V.default_skin:t.skin,r=Z&&Z[n]?Z[n]:void 0,o=this.getPresetsBySkins(t.skin);return wp.element.createElement("div",{className:"".concat(I,"gallery-tool")},wp.element.createElement("div",{className:"".concat(I,"skin-img")},r&&wp.element.createElement("img",{width:"320px",height:"240px",alt:r.name,src:r.screenshot})),wp.element.createElement("div",{ref:this.panelRef,className:"".concat(I,"panel")},wp.element.createElement(H,{options:this.albumsAndGalleries,value:t.id,onChange:function(t){var n=t.split("-")[0];e.setSomeAttributes({id:t,type:n,galleryRAW:"",loadingRAW:!1})}}),wp.element.createElement(H,{disabled:""===t.id,label:"Choose skin",options:this.skins,value:t.skin,onChange:function(t){A(""===t?V.default_skin:t);var n={skin:t,galleryRAW:"",loadingRAW:!1};""===t&&(n.preset=""),e.setSomeAttributes(n)}}),wp.element.createElement(H,{disabled:1===o.length||""===t.id,label:"Choose preset for gallery",options:o,onChange:function(t){e.setSomeAttributes({preset:t,galleryRAW:"",loadingRAW:!1})}}),wp.element.createElement(q,{disabled:""===t.id,label:"Gallery Title (optional)",value:t.galleryname,onChange:function(t){return e.setSomeAttributes({galleryname:t})}})),wp.element.createElement("div",{className:"".concat(I,"gallery-srtcode")},""===t.id?"":t.shortcode))}}])&&D(t.prototype,n),r&&D(t,r),l}(F);function X(e){return(X="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Y(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function J(e,t){return(J=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function K(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=ee(e);if(t){var o=ee(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Q(this,n)}}function Q(e,t){return!t||"object"!==X(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function ee(e){return(ee=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var te=window.FlaGallery,ne=wp.element,re=ne.Component,oe=ne.Fragment,le=wp.blockEditor.InspectorControls,ae=wp.components,ie=ae.PanelBody,ce=ae.Button,se=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&J(e,t)}(l,e);var t,n,r,o=K(l);function l(){return Y(this,l),o.apply(this,arguments)}return t=l,(n=[{key:"componentDidUpdate",value:function(){var e=this;this.props.isSelected&&(window.tb_showIframe=function(){var t=document.getElementById("TB_iframeContent"),n=(t.contentDocument?t.contentDocument:t.contentWindow.document).getElementById("message");if(n){var r=n.getElementsByTagName("P")[0].textContent;r&&"Update Successfully"===r&&(window.tb_remove&&window.tb_remove(),e.props.setAttributes({galleryRAW:""}))}})}},{key:"render",value:function(){var e=this,t=this.props.attributes,n=new URL("".concat(te.assets.split("flash-album-gallery/")[0],"flash-album-gallery/admin/skin_options.php"));return n.searchParams.set("show_options","1"),n.searchParams.set("skin",""===t.skin?te.default_skin:t.skin),""!==t.preset&&n.searchParams.set("preset",t.preset),n.searchParams.set("TB_iframe","1"),n.searchParams.set("width","753"),n.searchParams.set("height","700"),wp.element.createElement(le,null,wp.element.createElement(oe,null,t.previewMode&&wp.element.createElement(oe,null,wp.element.createElement(ie,{className:"flag-inspector",title:"Gallery Picker"},wp.element.createElement(z,this.props)),wp.element.createElement("div",{className:"flag-sub-menu"},wp.element.createElement(ce,{isPrimary:!0,disabled:""===t.id,className:"thickbox",href:n},"Edit Skin Preset"),S(t.skin)&&wp.element.createElement(oe,null,wp.element.createElement(ce,{isSecondary:!0,onClick:function(){e.props.setAttributes({galleryRAW:"",loadingRAW:!1})}},"Refresh Preview"),wp.element.createElement("div",{className:"flag-notification"},"* In some cases, only part of the images will be shown in preview mode. But on the published page everything will be displayed in full."))))))}}])&&$(t.prototype,n),r&&$(t,r),l}(re);function ue(e){return(ue="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function fe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function pe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ye(e,t){return(ye=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function me(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=de(e);if(t){var o=de(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return be(this,n)}}function be(e,t){return!t||"object"!==ue(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function de(e){return(de=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var he=window.FlaGallery,ge=wp.element,we=ge.Component,ve=ge.Fragment,Oe=wp.components.Button,ke="wp-block-flagallery-",Re=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ye(e,t)}(l,e);var t,n,r,o=me(l);function l(){return fe(this,l),o.apply(this,arguments)}return t=l,(n=[{key:"render",value:function(){var e=this,t=this.props.attributes,n=""!==he.license&&""!==he.pack;return wp.element.createElement("div",{className:"".concat(ke,"placeholder")},wp.element.createElement("img",{className:"".concat(ke,"logo"),width:"128px",height:"128px",src:"".concat(he.assets,"/icon-128x128.png"),alt:"flagallery logo"}),wp.element.createElement("h3",{className:"".concat(ke,"title")},"FLAGallery Photo Portfolio"),!n&&wp.element.createElement(ve,null,wp.element.createElement("div",{className:"".concat(ke,"get-premium")},wp.element.createElement("div",{className:"".concat(ke,"description")},"Help make the plugin better - become a member of our",wp.element.createElement("span",null," Premium Club "),"and get all our best solutions for your website."),wp.element.createElement("div",{className:"".concat(ke,"promo")},"You can use this promo code",wp.element.createElement("span",null," 30OFF "),"to get 30% discount and save $9. It’s a limited time offer."),wp.element.createElement(Oe,{className:"".concat(ke,"button-premium"),isPrimary:!0,href:"http://bit.ly/2jPNRB0",target:"_blank"},"Get Premium"))),n&&wp.element.createElement(ve,null,wp.element.createElement("div",{className:"flag-support"},wp.element.createElement(Oe,{isSecondary:!0,href:"https://mypgc.co/contact-fm/"},"Support for Premium Members"))),wp.element.createElement("h5",{className:"".concat(ke,"title")},"Gallery Picker"),wp.element.createElement(z,this.props),""!==t.id&&!t.previewMode&&S(t.skin)&&wp.element.createElement(Oe,{isPrimary:!0,style:{margin:"0 0 0 auto"},onClick:function(){return e.props.setAttributes({previewMode:!t.previewMode})}},"Preview Gallery"))}}])&&pe(t.prototype,n),r&&pe(t,r),l}(we);function Pe(e){return(Pe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function je(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ee(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Se(e,t){return(Se=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function _e(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Ce(e);if(t){var o=Ce(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Ae(this,n)}}function Ae(e,t){return!t||"object"!==Pe(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Ce(e){return(Ce=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var xe=wp.element,De=xe.Component,Ge=xe.RawHTML,We=xe.createRef,Ne=wp.components.Spinner,Te=window.FlaGallery,Le=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Se(e,t)}(l,e);var t,n,r,o=_e(l);function l(){var e;return je(this,l),(e=o.apply(this,arguments)).galleryRef=We(),e.galleryVp=void 0,e}return t=l,(n=[{key:"componentDidMount",value:function(){!this.galleryVp&&this.galleryRef&&this.galleryRef.current&&(this.galleryVp=this.galleryRef.current)}},{key:"componentDidUpdate",value:function(){var e=this.props.attributes,t=""===e.skin?Te.default_skin:e.skin;if(""!==e.galleryRAW){var n=this.galleryVp.getElementsByClassName("".concat(t,"_skin"))[0],r=n?n.id:void 0;if(!r)return;window["fla_module_".concat(t)]&&window["fla_module_".concat(t)].initVPbyID(r)}}},{key:"render",value:function(){var e=this.props.attributes;return wp.element.createElement("div",{ref:this.galleryRef,className:"flagallery-block-raw-wrap"},""===e.galleryRAW&&wp.element.createElement("div",{className:"flag-preloader"},wp.element.createElement(Ne,null)),""!==e.galleryRAW&&wp.element.createElement(Ge,{key:"html".concat(e.is).concat(e.skin),className:"flag-block-raw"},e.galleryRAW))}}])&&Ee(t.prototype,n),r&&Ee(t,r),l}(De);function Me(e){return(Me="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Fe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Be(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Ue(e,t){return(Ue=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function He(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Ve(e);if(t){var o=Ve(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return qe(this,n)}}function qe(e,t){return!t||"object"!==Me(t)&&"function"!=typeof t?Ie(e):t}function Ie(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ve(e){return(Ve=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Ze=wp.element,ze=Ze.Component,Xe=Ze.Fragment,Ye=window.FlaGallery,$e=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ue(e,t)}(l,e);var t,n,r,o=He(l);function l(){var e;return Fe(this,l),(e=o.apply(this,arguments)).setSomeAttributes=_.bind(Ie(e)),e.requestGalleryRAWHndler=e.requestGalleryRAWHndler.bind(Ie(e)),e.props.attributes.galleryRAW="",e.props.attributes.loadingRAW=!1,""!==e.props.attributes.id&&1===e.props.attributes.id.split("-").length&&e.setSomeAttributes({id:"".concat(e.props.attributes.type,"-").concat(e.props.attributes.id)}),e}return t=l,(n=[{key:"componentDidMount",value:function(){var e=this.props.attributes;e.skin,A(e.skin),e.previewMode&&S(e.skin)&&""===e.galleryRAW&&!e.loadingRAW&&this.getRAWforShortcode()}},{key:"componentDidUpdate",value:function(){var e=this.props.attributes;""!==e.shortcode&&e.previewMode&&S(e.skin)&&""===e.galleryRAW&&!e.loadingRAW&&this.getRAWforShortcode()}},{key:"getRAWforShortcode",value:function(){var e=this.props.attributes;""!==e.shortcode&&(this.props.setAttributes({loadingRAW:!0}),function(e,t,n,r,o){var l=new URL(e),a=new XMLHttpRequest;a.open("POST",l,!0),a.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8"),a.onreadystatechange=function(){if(4===a.readyState){var e={};200!==a.status?e.error=a.statusText:e.data=a.responseText,r&&(e.params=r),o&&"function"==typeof o&&o(e)}},a.onerror=function(){j("An error occurred while transferring the file.")};try{j("request=".concat(n)),a.send("action=flagallery_shortcode_html&_wpnonce=".concat(t,"&shortcode=").concat(n))}catch(e){j(e)}}(Ye.ajaxurl,Ye.nonce,e.shortcode,null,this.requestGalleryRAWHndler))}},{key:"requestGalleryRAWHndler",value:function(e){this.props.setAttributes({loadingRAW:!1,galleryRAW:e.data?e.data:"ERROR"})}},{key:"render",value:function(){var e=this.props.attributes;return wp.element.createElement(Xe,null,wp.element.createElement(se,this.props),wp.element.createElement("div",{className:this.props.className},wp.element.createElement(Xe,null,(!e.previewMode||!S(e.skin))&&wp.element.createElement(Re,this.props),e.previewMode&&S(e.skin)&&wp.element.createElement(Le,this.props))))}}])&&Be(t.prototype,n),r&&Be(t,r),l}(ze),Je="gallery",Ke="GRAND FlAGallery",Qe={foreground:"#007cba",src:wp.element.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",version:"1.1",viewBox:"0 0 24 24",width:"24px"},wp.element.createElement("title",null),wp.element.createElement("desc",null),wp.element.createElement("defs",null),wp.element.createElement("g",{fillRule:"evenodd",id:"miu",stroke:"none",strokeWidth:"1"},wp.element.createElement("g",{id:"Artboard-1",transform:"translate(-395.000000, -299.000000)"},wp.element.createElement("g",{id:"slice",transform:"translate(215.000000, 119.000000)"}),wp.element.createElement("path",{d:"M396.140488,305 C396.062898,305 396,305.057936 396,305.128791 L396,320.871209 C396,320.942338 396.06311,321 396.140488,321 L417.859512,321 C417.937102,321 418,320.942064 418,320.871209 L418,305.128791 C418,305.057662 417.93689,305 417.859512,305 L396.140488,305 Z M404.311468,308.965573 L407.568023,314.589603 C407.608096,314.658809 407.694647,314.676887 407.758887,314.631708 L410.521394,312.688868 C410.650699,312.59793 410.822887,312.629655 410.909233,312.764808 L415.929855,318.623341 C416.014748,318.75622 415.953368,318.863939 415.803474,318.863939 L398.147227,318.863939 C397.992123,318.863939 397.924733,318.751431 397.997976,318.6102 L404.035029,308.969159 C404.107704,308.829023 404.232913,308.829911 404.311468,308.965573 Z M413.5,310 C414.328427,310 415,309.328427 415,308.5 C415,307.671573 414.328427,307 413.5,307 C412.671573,307 412,307.671573 412,308.5 C412,309.328427 412.671573,310 413.5,310 Z M398,301 L398,302 L416,302 L416,301 L398,301 Z M397,303 L397,304 L417,304 L417,303 L397,303 Z",id:"editor-images-pictures-photos-collection-glyph"}))))},et={title:Ke,description:"Displaying GRAND FLA Galleries or FLA Albums",keywords:["lightbox","gallery","fla","images","youtube","vimeo","album","slider","grand"],attributes:{galleryname:{type:"string",default:""},id:{type:"string",default:""},type:{type:"string",default:"gallery"},skin:{type:"string",default:""},preset:{type:"string",default:""},shortcode:{type:"string",default:""},previewMode:{type:"boolean",default:!1}},supports:{align:["wide","full"],html:!1},deprecated:[{attributes:{galleryname:{type:"string",default:""},id:{type:"string",default:""},type:{type:"string",default:"gallery"},skin:{type:"string",default:""},preset:{type:"string",default:""},align:{type:"string",default:"none"},width:{type:"string",default:"100%"}},save:O}],edit:$e,save:f};function tt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function nt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var rt=wp.blocks.registerBlockType,ot=(0,wp.blocks.getCategories)().some((function(e){return"media"===e.slug}));[r].forEach((function(e){if(e){var t=e.name,n=e.icon,r=e.settings;rt("flagallery/".concat(t),function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?tt(Object(n),!0).forEach((function(t){nt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({category:ot?"media":"common",icon:n},r))}}))}]);
admin/blocks/dist/blocks.build.style.css ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ .wp-block-flagallery-gallery{min-height:200px}.wp-block-flagallery-gallery .wp-block-flagallery-placeholder{display:flex;flex-direction:column;box-shadow:-2px 2px 10px 0px rgba(68,68,68,0.4);background:white;padding:20px}.wp-block-flagallery-gallery .wp-block-flagallery-placeholder .wp-block-flagallery-logo{margin:15px auto;width:70px;height:70px}.wp-block-flagallery-gallery .wp-block-flagallery-placeholder .wp-block-flagallery-title{margin:10px auto}.wp-block-flagallery-gallery .wp-block-flagallery-placeholder .flag-support{display:flex;justify-content:center;margin:0 auto 15px}.wp-block-flagallery-gallery .wp-block-flagallery-placeholder .flag-support a{margin:9 10px}.wp-block-flagallery-gallery .wp-block-flagallery-placeholder .wp-block-flagallery-get-premium{max-width:570px;display:flex;flex-direction:column;margin:0 auto}.wp-block-flagallery-gallery .wp-block-flagallery-placeholder .wp-block-flagallery-description{font-size:17px;font-family:system-ui;margin:7px;color:#ffffff;text-align:center;background-color:#007cba;border-radius:3px;line-height:1.4;padding:10px}.wp-block-flagallery-gallery .wp-block-flagallery-placeholder .wp-block-flagallery-description span{font-weight:500}.wp-block-flagallery-gallery .wp-block-flagallery-placeholder .wp-block-flagallery-promo{font-size:14px;padding:0 20px;font-style:italic}.wp-block-flagallery-gallery .wp-block-flagallery-placeholder .wp-block-flagallery-promo span{font-weight:700}.wp-block-flagallery-gallery .wp-block-flagallery-placeholder .wp-block-flagallery-button-premium{margin:5px auto;padding:20px 50px;font-size:16px;background-color:#eb4c48;font-weight:600}.flag-notification{font-style:italic;color:#007cba}.flag-sub-menu{display:flex;flex-direction:column;padding:0 15px 15px}.flag-sub-menu *{margin:5px auto}.flagallery-block-raw-wrap{position:relative}.flagallery-block-raw-wrap .flag-preloader{min-height:670px}.flagallery-block-raw-wrap .flag-preloader span{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%)}.flag-block-raw{pointer-events:none}.is-selected .flag-block-raw{pointer-events:unset}
2
+
3
+ .flag-sh-code-bilder-gallery-tool{max-width:570px;display:flex;flex-direction:row;flex-wrap:wrap;justify-content:space-around;margin:10px auto}.flag-sh-code-bilder-gallery-tool .flag-sh-code-bilder-title{text-align:center;margin:20px 0 !important;width:100%}.flag-sh-code-bilder-gallery-tool .flag-sh-code-bilder-gallery-srtcode{width:100%;font-size:13px;font-family:monospace;background-color:aliceblue;line-height:2;padding:0 10px}.flag-sh-code-bilder-panel select option:disabled{background-color:#eae9e9 !important;font-weight:600 !important}.wp-block-flagallery-placeholder .flag-sh-code-bilder-gallery-tool .flag-sh-code-bilder-skin-img{min-width:200px;max-width:40%}.wp-block-flagallery-placeholder .flag-sh-code-bilder-gallery-tool .flag-sh-code-bilder-panel{padding:0 0 0 10px;max-width:60%}.wp-block-flagallery-placeholder .flag-sh-code-bilder-gallery-tool .flag-sh-code-bilder-panel label{font-weight:unset !important;margin-bottom:2px !important}.flag-inspector .flag-sh-code-bilder-gallery-tool .flag-sh-code-bilder-skin-img{width:100%;margin-bottom:18px}.flag-inspector .flag-sh-code-bilder-gallery-tool .flag-sh-code-bilder-panel{width:100%}.flag-inspector .flag-sh-code-bilder-gallery-tool .flag-sh-code-bilder-gallery-srtcode{font-size:11px}.flag-inspector .flag-sh-code-bilder-gallery-tool .components-base-control{margin-bottom:0}
4
+
admin/blocks/init.php ADDED
@@ -0,0 +1,87 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Gutenberg block init.
5
+ *
6
+ */
7
+ class flagGutenberg
8
+ {
9
+
10
+ // constructor.
11
+ public function __construct()
12
+ {
13
+ add_action('enqueue_block_editor_assets', [$this, 'gutenberg_assets']);
14
+ }
15
+
16
+ /**
17
+ * Enqueue the block's assets for the gutenberg editor.
18
+ */
19
+ public function gutenberg_assets()
20
+ {
21
+ global $flagdb, $flag;
22
+ $flag_version = $flag->version;
23
+ wp_register_style(
24
+ 'flagallery-block-editor',
25
+ plugins_url('blocks/dist/blocks.build.style.css', dirname(__FILE__)),
26
+ [],
27
+ $flag_version
28
+ );
29
+
30
+ require_once(dirname(dirname(__FILE__)) . '/get_skin.php');
31
+
32
+ $flag_options = get_option('flag_options');
33
+ $all_skins = get_skins();
34
+ $skins = [];
35
+ $presets = [];
36
+ foreach ($all_skins as $skin_file => $skin_data) {
37
+ $id = dirname($skin_file);
38
+ $is_default = ($id == $flag_options['flashSkin']);
39
+ $skins[$id] = [
40
+ 'id' => $id,
41
+ 'name' => $skin_data['Name'],
42
+ 'is_default' => $is_default,
43
+ 'screenshot' => WP_PLUGIN_URL . '/flagallery-skins/' . $id . '/screenshot.png',
44
+ ];
45
+ if (empty($flag_options["{$id}_options"]['presets'])) {
46
+ continue;
47
+ }
48
+ foreach ($flag_options["{$id}_options"]['presets'] as $preset_name => $settings) {
49
+ $key = $id . ' ' . $preset_name;
50
+ $presets[$key] = [
51
+ 'id' => $id,
52
+ 'name' => $preset_name,
53
+ ];
54
+ }
55
+ }
56
+ $data = [
57
+ 'default_skin' => $flag_options['flashSkin'],
58
+ 'skins' => (object) $skins,
59
+ 'presets' => (object) $presets,
60
+ 'galleries' => $flagdb->find_all_galleries($flag->options['albSort'], $flag->options['albSortDir']),
61
+ 'albums' => $flagdb->find_all_albums('id', 'ASC'),
62
+ 'assets' => FLAG_URLPATH . 'admin/blocks/assets',
63
+ 'ajaxurl' => admin_url('admin-ajax.php'),
64
+ 'nonce' => wp_create_nonce('FlaGallery'),
65
+ 'license' => strtolower($flag_options['license_key']),
66
+ 'pack' => $flag_options['license_name'],
67
+ ];
68
+ wp_register_script(
69
+ 'flagallery-blocks-script',
70
+ plugins_url('blocks/dist/blocks.build.js', dirname(__FILE__)),
71
+ ['wp-blocks', 'wp-element', 'wp-editor'],
72
+ $flag_version,
73
+ false
74
+ );
75
+
76
+ wp_localize_script('flagallery-blocks-script', 'FlaGallery', $data);
77
+ add_thickbox();
78
+
79
+ register_block_type(
80
+ 'flagallery/gallery',
81
+ [
82
+ 'editor_script' => 'flagallery-blocks-script',
83
+ 'editor_style' => 'flagallery-block-editor',
84
+ ]
85
+ );
86
+ }
87
+ }
admin/css/flagadmin.css CHANGED
@@ -1,599 +1,641 @@
1
- /*
2
- ** FlaGallery Admin StyleSheet
3
- */
4
-
5
- /* SETTINGS FOR SKIN PAGE */
6
- .skins .inactive,
7
- .skins .inactive th,
8
- .skins .inactive td {
9
- background-color: #ebeeef;
10
- }
11
- .skins .active,
12
- .skins .active th,
13
- .skins .active td {
14
- color: #000;
15
- }
16
- .skins .inactive a:not(.button) {
17
- color: #557799;
18
- }
19
- .skins .inactive a:not(.button):hover {
20
- color: #d54e21;
21
- }
22
- .skins tr.first td {border-bottom:1px solid #F9F9F9;}
23
- .skins tr.second td {border-top:none; border-bottom: 30px solid #f1f1f1;}
24
- .skins td img { max-width:300px;}
25
-
26
- fieldset {
27
- padding: 0;
28
- margin: 0;
29
- border: 0;
30
- min-width: 0;
31
- }
32
- legend {
33
- display: block;
34
- width: 100%;
35
- padding: 0;
36
- margin-bottom: 20px;
37
- font-size: 21px;
38
- line-height: inherit;
39
- color: #333333;
40
- border: 0;
41
- border-bottom: 1px solid #e5e5e5;
42
- }
43
- label {
44
- display: inline-block;
45
- max-width: 100%;
46
- margin-bottom: 5px;
47
- font-weight: bold;
48
- }
49
- .form-control {
50
- display: block;
51
- width: 100%;
52
- height: 34px;
53
- padding: 6px 12px;
54
- font-size: 14px;
55
- line-height: 1.42857143;
56
- color: #555555;
57
- background-color: #ffffff;
58
- background-image: none;
59
- border: 1px solid #cccccc;
60
- border-radius: 4px;
61
- box-sizing: border-box;
62
- -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
63
- box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
64
- -webkit-transition: border-color ease-in-out .15s, -webkit-box-shadow ease-in-out .15s;
65
- -o-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
66
- transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
67
- }
68
- .form-control:focus {
69
- border-color: #66afe9;
70
- outline: 0;
71
- -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6);
72
- box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6);
73
- }
74
- .form-control::-moz-placeholder {
75
- color: #999999;
76
- opacity: 1;
77
- }
78
- .form-control:-ms-input-placeholder {
79
- color: #999999;
80
- }
81
- .form-control::-webkit-input-placeholder {
82
- color: #999999;
83
- }
84
- .form-control::-ms-expand {
85
- border: 0;
86
- background-color: transparent;
87
- }
88
- .form-control[disabled],
89
- .form-control[readonly],
90
- fieldset[disabled] .form-control {
91
- background-color: #eeeeee;
92
- opacity: 1;
93
- }
94
- .form-control[disabled],
95
- fieldset[disabled] .form-control {
96
- cursor: not-allowed;
97
- }
98
- textarea.form-control {
99
- height: auto;
100
- }
101
- .form-group {
102
- margin-bottom: 15px;
103
- }
104
- .radio,
105
- .checkbox {
106
- position: relative;
107
- display: block;
108
- margin-top: 10px;
109
- margin-bottom: 10px;
110
- }
111
- .radio label,
112
- .checkbox label {
113
- min-height: 20px;
114
- padding-left: 20px;
115
- margin-bottom: 0;
116
- font-weight: normal;
117
- cursor: pointer;
118
- }
119
- .radio input[type="radio"],
120
- .radio-inline input[type="radio"],
121
- .checkbox input[type="checkbox"],
122
- .checkbox-inline input[type="checkbox"] {
123
- position: absolute;
124
- margin: 0 0 0 -20px;
125
- margin-top: 4px \9;
126
- width:16px;
127
- height:16px;
128
- }
129
- .radio + .radio,
130
- .checkbox + .checkbox {
131
- margin-top: -5px;
132
- }
133
- .radio-inline,
134
- .checkbox-inline {
135
- position: relative;
136
- display: inline-block;
137
- padding-left: 20px;
138
- margin-bottom: 0;
139
- vertical-align: middle;
140
- font-weight: normal;
141
- cursor: pointer;
142
- }
143
- .radio-inline + .radio-inline,
144
- .checkbox-inline + .checkbox-inline {
145
- margin-top: 0;
146
- margin-left: 10px;
147
- }
148
- input[type="radio"][disabled],
149
- input[type="checkbox"][disabled],
150
- input[type="radio"].disabled,
151
- input[type="checkbox"].disabled,
152
- fieldset[disabled] input[type="radio"],
153
- fieldset[disabled] input[type="checkbox"] {
154
- cursor: not-allowed;
155
- }
156
- .radio-inline.disabled,
157
- .checkbox-inline.disabled,
158
- fieldset[disabled] .radio-inline,
159
- fieldset[disabled] .checkbox-inline {
160
- cursor: not-allowed;
161
- }
162
- .radio.disabled label,
163
- .checkbox.disabled label,
164
- fieldset[disabled] .radio label,
165
- fieldset[disabled] .checkbox label {
166
- cursor: not-allowed;
167
- }
168
- .form-control-static {
169
- padding-top: 7px;
170
- padding-bottom: 7px;
171
- margin-bottom: 0;
172
- min-height: 34px;
173
- }
174
- .form-control-static.input-lg,
175
- .form-control-static.input-sm {
176
- padding-left: 0;
177
- padding-right: 0;
178
- }
179
- .input-sm {
180
- height: 30px;
181
- padding: 5px 10px;
182
- font-size: 12px;
183
- line-height: 1.5;
184
- border-radius: 3px;
185
- box-sizing:border-box;
186
- }
187
- select.input-sm {
188
- height: 30px;
189
- line-height: 30px;
190
- }
191
- textarea.input-sm,
192
- select[multiple].input-sm {
193
- height: auto;
194
- }
195
- .form-group-sm .form-control {
196
- height: 30px;
197
- padding: 5px 10px;
198
- font-size: 12px;
199
- line-height: 1.5;
200
- border-radius: 3px;
201
- }
202
- .form-group-sm select.form-control {
203
- height: 30px;
204
- line-height: 30px;
205
- }
206
- .form-group-sm textarea.form-control,
207
- .form-group-sm select[multiple].form-control {
208
- height: auto;
209
- }
210
- .form-group-sm .form-control-static {
211
- height: 30px;
212
- min-height: 32px;
213
- padding: 6px 10px;
214
- font-size: 12px;
215
- line-height: 1.5;
216
- }
217
- .input-lg {
218
- height: 46px;
219
- padding: 10px 16px;
220
- font-size: 18px;
221
- line-height: 1.3333333;
222
- border-radius: 6px;
223
- }
224
- select.input-lg {
225
- height: 46px;
226
- line-height: 46px;
227
- }
228
- textarea.input-lg,
229
- select[multiple].input-lg {
230
- height: auto;
231
- }
232
- .form-group-lg .form-control {
233
- height: 46px;
234
- padding: 10px 16px;
235
- font-size: 18px;
236
- line-height: 1.3333333;
237
- border-radius: 6px;
238
- }
239
- .form-group-lg select.form-control {
240
- height: 46px;
241
- line-height: 46px;
242
- }
243
- .form-group-lg textarea.form-control,
244
- .form-group-lg select[multiple].form-control {
245
- height: auto;
246
- }
247
- .form-group-lg .form-control-static {
248
- height: 46px;
249
- min-height: 38px;
250
- padding: 11px 16px;
251
- font-size: 18px;
252
- line-height: 1.3333333;
253
- }
254
- .has-feedback {
255
- position: relative;
256
- }
257
- .has-feedback .form-control {
258
- padding-right: 42.5px;
259
- }
260
- .form-control-feedback {
261
- position: absolute;
262
- top: 0;
263
- right: 0;
264
- z-index: 2;
265
- display: block;
266
- width: 34px;
267
- height: 34px;
268
- line-height: 34px;
269
- text-align: center;
270
- pointer-events: none;
271
- }
272
- .input-lg + .form-control-feedback,
273
- .input-group-lg + .form-control-feedback,
274
- .form-group-lg .form-control + .form-control-feedback {
275
- width: 46px;
276
- height: 46px;
277
- line-height: 46px;
278
- }
279
- .input-sm + .form-control-feedback,
280
- .input-group-sm + .form-control-feedback,
281
- .form-group-sm .form-control + .form-control-feedback {
282
- width: 30px;
283
- height: 30px;
284
- line-height: 30px;
285
- }
286
- .help-block {
287
- display: block;
288
- margin-top: 5px;
289
- margin-bottom: 10px;
290
- color: #737373;
291
- }
292
- .form-horizontal .radio,
293
- .form-horizontal .checkbox,
294
- .form-horizontal .radio-inline,
295
- .form-horizontal .checkbox-inline {
296
- margin-top: 0;
297
- margin-bottom: 0;
298
- padding-top: 7px;
299
- }
300
- .form-horizontal .radio,
301
- .form-horizontal .checkbox {
302
- min-height: 27px;
303
- }
304
- .form-horizontal .form-group {
305
- margin-left: -15px;
306
- margin-right: -15px;
307
- }
308
- .clearfix:before,
309
- .clearfix:after,
310
- .form-horizontal .form-group:before,
311
- .form-horizontal .form-group:after {
312
- content: " ";
313
- display: table;
314
- }
315
- .clearfix:after,
316
- .form-horizontal .form-group:after {
317
- clear: both;
318
- }
319
- .center-block {
320
- display: block;
321
- margin-left: auto;
322
- margin-right: auto;
323
- }
324
- #skinOptions .wp-picker-container, #skinOptions .wp-picker-container:active {
325
- display:block;
326
- }
327
- #skinOptions .wp-picker-container input[type="text"].wp-color-picker {
328
- float: left;
329
- height: 25px;
330
- }
331
-
332
- /* SETTINGS FOR Overview Gallery */
333
- .flag-wrap {margin:20px 20px 0 2px}
334
- .flag-wrap h2.overview-title {margin:0}
335
- .has-sidebar {
336
- clear:left;
337
- float:left;
338
- width:100%;
339
- }
340
- .has-sidebar .has-sidebar-content {
341
- padding-right:300px;
342
- }
343
-
344
- .postbox .misc-pub-section .icon { background-position:left top;background-repeat:no-repeat;padding-left:18px;}
345
- #plugin-home {background-image:url(../images/browser.png)}
346
- #plugin-comments {background-image:url(../images/notes.png)}
347
- #rate-plugin {background-image:url(../images/wallpaper.png)}
348
- #my-plugins {background-image:url(../images/map.png)}
349
- #contact-me {background-image:url(../images/mail.png)}
350
-
351
- #dashboard_server_settings ul.settings span {
352
- padding-left : 10px;
353
- color:#2583AD;
354
- font-weight:bold;
355
- }
356
-
357
- .flag-overview .postbox .handlediv {
358
- float:right;
359
- height:24px;
360
- width:24px;
361
- }
362
-
363
- #dashboard_primary .inside { margin: 0; }
364
-
365
- #photogallerycreator .theme > p { margin: 0; padding: 0; }
366
- #photogallerycreator .theme { overflow: hidden; padding: 7px 0; border-bottom: 1px solid #000000; }
367
- #photogallerycreator .theme .img { margin-top: 25px; }
368
- #photogallerycreator .theme .txt > *:first-child { display: block; margin: 0 0 -20px; padding: 0; text-align: center; position: relative; top: -204px; }
369
-
370
- /* SETTING FOR UPLOAD PAGE */
371
- .flag-form-table {
372
- border-collapse: collapse;
373
- clear: both;
374
- margin-top: 0.5em;
375
- width: 100%;
376
- }
377
- .useflashupload {float:left;}
378
- .swfupload {
379
- position:absolute;
380
- z-index:1;
381
- vertical-align:top;
382
- }
383
- #uploadQueue {}
384
- #choosegalfirst {display:block; position:relative; margin:20px 0; overflow:hidden;}
385
- #choosegalfirst .disabledbut {position:absolute; top:0; left:0; right:0; bottom:0; width:100%; height:100%;}
386
-
387
- /* SETTINGS FOR THE OPTIONS TABLE */
388
- .flag-options th {
389
- width:30%;
390
- }
391
- .cptab h3 {margin-top:0; padding-top:20px;}
392
-
393
- /* SETTINGS FOR MANAGE TABLE */
394
- .flag_draft, .alt.flag_draft {background-color: #FFEBE8;}
395
-
396
- p#flag-inlinebutton {
397
- float:right;
398
- margin:0pt;
399
- position:relative;
400
- top:-25pt;
401
- }
402
-
403
- .flag-tablenav .button-secondary {
404
- padding:2px 8px;
405
- vertical-align: top;
406
- }
407
-
408
- #flag-listitems td, #flag-listitems th {
409
-
410
- }
411
-
412
- .fixed tbody th.column-cb {
413
- padding:7px 0 22px;
414
- }
415
- .fixed .column-cb {
416
- padding:0;
417
- width:2.2em;
418
- }
419
-
420
- .fixed .column-thumbnail{
421
- width:80px;
422
- }
423
-
424
- .fixed .column-thumbnail img{
425
- height:auto;
426
- width: 100%;
427
- max-width:80px;
428
- }
429
-
430
- .fixed .column-id {
431
- width: 3em;
432
- }
433
-
434
- .fixed .column-rating { width:100px; text-align: center; }
435
- .fixed td.column-rating { background-color: #CCFFCC; }
436
- .fixed .column-views_likes { width:150px; padding-left: 0; padding-right: 0; }
437
- .fixed .column-views_likes input { width:45px; font-size: 10px; }
438
-
439
- .fixed .column-alt_title_desc {
440
-
441
- }
442
-
443
- .fixed .column-exclude, .fixed .column-action, .fixed .column-delete {
444
- width: 2.2em; text-align: center;
445
- }
446
- .fixed .column-exclude { width: 70px; white-space: nowrap; }
447
- .fixed th.column-exclude img { vertical-align: text-top; }
448
- .fixed .column-exclude input {
449
- margin-top:4px;
450
- }
451
- .fixed .column-views {
452
- width: 4em; text-align: center;
453
- }
454
- .flag-table tr > * {
455
- border-bottom:1px solid #ddd;
456
- }
457
- .flag-table td,
458
- .flag-table th {padding:4px 7px; text-align:left;}
459
- .flag-table th {font-weight:bold; padding:6px 7px; vertical-align:top;}
460
- .flag-table th p {margin:0;}
461
-
462
- #flag-listmusic tbody td { height: 50px; }
463
-
464
- .albums_table { width: 600px; position: relative; background: #ffffff; border: 1px solid #cccccc; border-radius: 4px; margin: 7px 0; padding: 1px 3px; float: left; max-height: 550px; overflow: auto; }
465
- .albums_table .album { position: relative; background: #f8f8f8; border: 1px solid #cccccc; border-radius: 4px; margin:2px 0; padding: 3px 3px 3px 36px; }
466
- .albums_table .album form { margin: 0; padding: 0; display: inline; }
467
- .albums_table .albID { position: absolute; display: block; width: 30px; top: 6px; left: 0px; text-align: right; }
468
- .albums_table .album_actions { position: absolute; display: block; top: 3px; right: 3px; text-align: right; }
469
- .albums_table .album_categoties { background: #fefefe; border: 1px solid #cccccc; margin:1px 0; padding: 0px; min-height: 14px; }
470
- .albums_table .album_categoties .acat { border-top: 1px solid #cccccc; padding: 3px 6px; cursor: move; position: relative; }
471
- .albums_table .album_categoties .acat .drop { display: none; position: absolute; right: 3px; top: 1px; font-size: 18px; line-height: 100%; color: #ff0000; cursor: pointer; }
472
- .albums_table .album_categoties .acat:hover { background-color: #FFFFEE; }
473
- .albums_table .album_categoties .acat:hover .drop { display: block; }
474
- .albums_table .album_categoties .acat:first-child { border-top: none; }
475
-
476
- .alb_msg { font-size: 10px; color: #006600; }
477
- .flag-ajax-post { cursor: pointer; text-decoration: underline; }
478
- .flag-ajax-post:hover { color: #ff0000; }
479
-
480
- .all_galleries { float: left; white-space: nowrap; margin: 0 0 0px 50px; max-height: 550px; overflow: auto; padding-right: 20px; min-width:30%; }
481
- .all_galleries .acat { border: 1px solid #cccccc; padding: 3px 6px; margin: 3px 0; background: #fefefe; cursor: move; min-width:15%; }
482
- .all_galleries .acat .drop { display: none; }
483
- .all_galleries .acat:hover { background-color: #FFFFEE; }
484
-
485
- .floatholder { overflow: hidden; }
486
- /* SETTINGS FOR PROGRESS BAR */
487
-
488
- div .progressborder {
489
- border: 1px inset ;
490
- display: block;
491
- height: 20px;
492
- background-color: #464646;
493
- width: 100%;
494
- margin-top: 15px;
495
- margin-bottom: 15px;
496
- }
497
-
498
- div .progressbar {
499
- border: medium none ;
500
- display: block;
501
- height: 20px;
502
- background-color: #D54E21;
503
- width: 0%;
504
- }
505
-
506
- div .progressbar span {
507
- display: inline;
508
- position: relative;
509
- color: white;
510
- font-weight: bold;
511
- padding-left: 5px;
512
- }
513
-
514
-
515
- .show_details
516
- {
517
- height: 16px;
518
- line-height: 20px;
519
- overflow: hidden;
520
- min-width: 8em;
521
- padding: 3px;
522
- cursor:pointer;
523
- }
524
-
525
- .show_details span
526
- {
527
- border-bottom:1px solid #999;
528
- white-space:pre;
529
- }
530
- .show_details:hover
531
- {
532
- height: auto;
533
- overflow: visible;
534
- border: 1px solid #999;
535
- }
536
-
537
- /* SETTINGS FOR SORT GALLERY */
538
- #flag-listitems .header p {
539
- background-image:url(../images/sortbg.gif);
540
- background-position:right center;
541
- background-repeat:no-repeat;
542
- cursor:pointer;
543
- margin:0;
544
- }
545
- #flag-listitems .headerSortDown p {
546
- background-image:url(../images/desc.gif) !important;
547
- background-position:right center;
548
- background-repeat:no-repeat;
549
- cursor:pointer;
550
- margin:0;
551
- }
552
- #flag-listitems .headerSortUp p {
553
- background-image:url(../images/asc.gif) !important;
554
- background-position:right center;
555
- background-repeat:no-repeat;
556
- cursor:pointer;
557
- margin:0;
558
- }
559
-
560
- /* UPGRADE PAGE */
561
-
562
- .error_inline {
563
- background:#FFEBE8 none repeat scroll 0%;
564
- border:1px solid #CC0000;
565
- margin:5px auto;
566
- padding:10px;
567
- }
568
-
569
- /* MEDIA BOX */
570
-
571
- p.row-actions {
572
- margin:0px;
573
- padding:10px 4px 0;
574
- }
575
-
576
- div#TB_window iframe#TB_iframeContent { width: 100% !important; }
577
- div.message { background: #ffffee; border: 1px solid #cccccc; border-radius: 4px; padding: 1px 10px; margin: 24px 20px 10px 0; font-size: 12px; }
578
- div.message .flag_progress { position: relative; height: 18px; width: 400px; border: 1px solid #0066FF; background-color: #ffffff; margin: 7px 0; }
579
- div.message .flag_progress .txt { position: absolute; left: 10px; top: 0; line-height: 18px; font-weight: bold; height: 18px; z-index: 10; }
580
- div.message .flag_progress .flag_complete { position: absolute; left: 0; top: 0; height: 18px; width: 0px; overflow: hidden; background: #00FFB7; z-index: 5; }
581
- div#license div p { font-size: 13px; }
582
- .highlight_new { background-color: #E4F2FD; color: #000000; font-weight: bold; }
583
- .success { background-color: #CCFFCC; border: 1px solid darkgreen; border-radius: 3px; margin: 5px 15px; padding: 3px 7px; }
584
-
585
- #gmUpload { padding-top:10px }
586
- #gmUpload table td { font-size: 11px !important; }
587
-
588
- .already-added {background-color:#DDFFBB;}
589
-
590
- a.button.button-primary.button-red {
591
- background: red;
592
- border-color: darkred;
593
- text-shadow: 0 -1px 1px darkred, 1px 0 1px darkred, 0 1px 1px darkred, -1px 0 1px darkred;
594
- }
595
-
596
- a.button.button-primary.button-red:hover {
597
- background: orangered;
598
- border-color: darkred;
599
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ ** FlaGallery Admin StyleSheet
3
+ */
4
+
5
+ /* SETTINGS FOR SKIN PAGE */
6
+ .skins .inactive,
7
+ .skins .inactive th,
8
+ .skins .inactive td {
9
+ background-color: #ebeeef;
10
+ }
11
+ .skins .active,
12
+ .skins .active th,
13
+ .skins .active td {
14
+ color: #000;
15
+ }
16
+ .skins .inactive a:not(.button) {
17
+ color: #557799;
18
+ }
19
+ .skins .inactive a:not(.button):hover {
20
+ color: #d54e21;
21
+ }
22
+ .skins tr.first td {border-bottom:1px solid #F9F9F9;}
23
+ .skins tr.second td {border-top:none; border-bottom: 30px solid #f1f1f1;}
24
+ .skins td img { max-width:250px;}
25
+
26
+ fieldset {
27
+ padding: 0;
28
+ margin: 0;
29
+ border: 0;
30
+ min-width: 0;
31
+ }
32
+ legend {
33
+ display: block;
34
+ width: 100%;
35
+ padding: 0;
36
+ margin-bottom: 20px;
37
+ font-size: 21px;
38
+ line-height: inherit;
39
+ color: #333333;
40
+ border: 0;
41
+ border-bottom: 1px solid #e5e5e5;
42
+ }
43
+ label {
44
+ display: inline-block;
45
+ max-width: 100%;
46
+ margin-bottom: 5px;
47
+ font-weight: bold;
48
+ }
49
+ .form-control {
50
+ display: block;
51
+ width: 100%;
52
+ height: 34px;
53
+ padding: 6px 12px;
54
+ font-size: 14px;
55
+ line-height: 1.42857143;
56
+ color: #555555;
57
+ background-color: #ffffff;
58
+ background-image: none;
59
+ border: 1px solid #cccccc;
60
+ border-radius: 4px;
61
+ box-sizing: border-box;
62
+ -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
63
+ box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
64
+ -webkit-transition: border-color ease-in-out .15s, -webkit-box-shadow ease-in-out .15s;
65
+ -o-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
66
+ transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
67
+ }
68
+ .form-control:focus {
69
+ border-color: #66afe9;
70
+ outline: 0;
71
+ -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6);
72
+ box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6);
73
+ }
74
+ .form-control::-moz-placeholder {
75
+ color: #999999;
76
+ opacity: 1;
77
+ }
78
+ .form-control:-ms-input-placeholder {
79
+ color: #999999;
80
+ }
81
+ .form-control::-webkit-input-placeholder {
82
+ color: #999999;
83
+ }
84
+ .form-control::-ms-expand {
85
+ border: 0;
86
+ background-color: transparent;
87
+ }
88
+ .form-control[disabled],
89
+ .form-control[readonly],
90
+ fieldset[disabled] .form-control {
91
+ background-color: #eeeeee;
92
+ opacity: 1;
93
+ }
94
+ .form-control[disabled],
95
+ fieldset[disabled] .form-control {
96
+ cursor: not-allowed;
97
+ }
98
+ textarea.form-control {
99
+ height: auto;
100
+ }
101
+ .form-group {
102
+ margin-bottom: 15px;
103
+ }
104
+ .radio,
105
+ .checkbox {
106
+ position: relative;
107
+ display: block;
108
+ margin-top: 10px;
109
+ margin-bottom: 10px;
110
+ }
111
+ .radio label,
112
+ .checkbox label {
113
+ min-height: 20px;
114
+ padding-left: 20px;
115
+ margin-bottom: 0;
116
+ font-weight: bold;
117
+ cursor: pointer;
118
+ }
119
+ .radio input[type="radio"],
120
+ .radio-inline input[type="radio"],
121
+ .checkbox input[type="checkbox"],
122
+ .checkbox-inline input[type="checkbox"] {
123
+ position: absolute;
124
+ margin: 0 0 0 -20px;
125
+ margin-top: 4px \9;
126
+ width:16px;
127
+ height:16px;
128
+ }
129
+ .radio + .radio,
130
+ .checkbox + .checkbox {
131
+ margin-top: -5px;
132
+ }
133
+ .radio-inline,
134
+ .checkbox-inline {
135
+ position: relative;
136
+ display: inline-block;
137
+ padding-left: 20px;
138
+ margin-bottom: 0;
139
+ vertical-align: middle;
140
+ font-weight: normal;
141
+ cursor: pointer;
142
+ }
143
+ .radio-inline + .radio-inline,
144
+ .checkbox-inline + .checkbox-inline {
145
+ margin-top: 0;
146
+ margin-left: 10px;
147
+ }
148
+ input[type="radio"][disabled],
149
+ input[type="checkbox"][disabled],
150
+ input[type="radio"].disabled,
151
+ input[type="checkbox"].disabled,
152
+ fieldset[disabled] input[type="radio"],
153
+ fieldset[disabled] input[type="checkbox"] {
154
+ cursor: not-allowed;
155
+ }
156
+ .radio-inline.disabled,
157
+ .checkbox-inline.disabled,
158
+ fieldset[disabled] .radio-inline,
159
+ fieldset[disabled] .checkbox-inline {
160
+ cursor: not-allowed;
161
+ }
162
+ .radio.disabled label,
163
+ .checkbox.disabled label,
164
+ fieldset[disabled] .radio label,
165
+ fieldset[disabled] .checkbox label {
166
+ cursor: not-allowed;
167
+ }
168
+ .form-control-static {
169
+ padding-top: 7px;
170
+ padding-bottom: 7px;
171
+ margin-bottom: 0;
172
+ min-height: 34px;
173
+ }
174
+ .form-control-static.input-lg,
175
+ .form-control-static.input-sm {
176
+ padding-left: 0;
177
+ padding-right: 0;
178
+ }
179
+ .input-sm {
180
+ height: 30px;
181
+ padding: 5px 10px;
182
+ font-size: 12px;
183
+ line-height: 1.5;
184
+ border-radius: 3px;
185
+ box-sizing:border-box;
186
+ }
187
+ select.input-sm {
188
+ height: 30px;
189
+ line-height: 30px;
190
+ }
191
+ textarea.input-sm,
192
+ select[multiple].input-sm {
193
+ height: auto;
194
+ }
195
+ .form-group-sm .form-control {
196
+ height: 30px;
197
+ padding: 5px 10px;
198
+ font-size: 12px;
199
+ line-height: 1.5;
200
+ border-radius: 3px;
201
+ }
202
+ .form-group-sm select.form-control {
203
+ height: 30px;
204
+ line-height: 30px;
205
+ }
206
+ .form-group-sm textarea.form-control,
207
+ .form-group-sm select[multiple].form-control {
208
+ height: auto;
209
+ }
210
+ .form-group-sm .form-control-static {
211
+ height: 30px;
212
+ min-height: 32px;
213
+ padding: 6px 10px;
214
+ font-size: 12px;
215
+ line-height: 1.5;
216
+ }
217
+ .input-lg {
218
+ height: 46px;
219
+ padding: 10px 16px;
220
+ font-size: 18px;
221
+ line-height: 1.3333333;
222
+ border-radius: 6px;
223
+ }
224
+ select.input-lg {
225
+ height: 46px;
226
+ line-height: 46px;
227
+ }
228
+ textarea.input-lg,
229
+ select[multiple].input-lg {
230
+ height: auto;
231
+ }
232
+ .form-group-lg .form-control {
233
+ height: 46px;
234
+ padding: 10px 16px;
235
+ font-size: 18px;
236
+ line-height: 1.3333333;
237
+ border-radius: 6px;
238
+ }
239
+ .form-group-lg select.form-control {
240
+ height: 46px;
241
+ line-height: 46px;
242
+ }
243
+ .form-group-lg textarea.form-control,
244
+ .form-group-lg select[multiple].form-control {
245
+ height: auto;
246
+ }
247
+ .form-group-lg .form-control-static {
248
+ height: 46px;
249
+ min-height: 38px;
250
+ padding: 11px 16px;
251
+ font-size: 18px;
252
+ line-height: 1.3333333;
253
+ }
254
+ .has-feedback {
255
+ position: relative;
256
+ }
257
+ .has-feedback .form-control {
258
+ padding-right: 42.5px;
259
+ }
260
+ .form-control-feedback {
261
+ position: absolute;
262
+ top: 0;
263
+ right: 0;
264
+ z-index: 2;
265
+ display: block;
266
+ width: 34px;
267
+ height: 34px;
268
+ line-height: 34px;
269
+ text-align: center;
270
+ pointer-events: none;
271
+ }
272
+ .input-lg + .form-control-feedback,
273
+ .input-group-lg + .form-control-feedback,
274
+ .form-group-lg .form-control + .form-control-feedback {
275
+ width: 46px;
276
+ height: 46px;
277
+ line-height: 46px;
278
+ }
279
+ .input-sm + .form-control-feedback,
280
+ .input-group-sm + .form-control-feedback,
281
+ .form-group-sm .form-control + .form-control-feedback {
282
+ width: 30px;
283
+ height: 30px;
284
+ line-height: 30px;
285
+ }
286
+ .help-block {
287
+ display: block;
288
+ margin-top: 5px;
289
+ margin-bottom: 10px;
290
+ color: #007cba;
291
+ font-style: italic;
292
+ }
293
+ .form-horizontal .radio,
294
+ .form-horizontal .checkbox,
295
+ .form-horizontal .radio-inline,
296
+ .form-horizontal .checkbox-inline {
297
+ margin-top: 0;
298
+ margin-bottom: 0;
299
+ padding-top: 7px;
300
+ }
301
+ .form-horizontal .radio,
302
+ .form-horizontal .checkbox {
303
+ min-height: 27px;
304
+ }
305
+ .form-horizontal .form-group {
306
+ margin-left: -15px;
307
+ margin-right: -15px;
308
+ }
309
+ .clearfix:before,
310
+ .clearfix:after,
311
+ .form-horizontal .form-group:before,
312
+ .form-horizontal .form-group:after {
313
+ content: " ";
314
+ display: table;
315
+ }
316
+ .clearfix:after,
317
+ .form-horizontal .form-group:after {
318
+ clear: both;
319
+ }
320
+ .center-block {
321
+ display: block;
322
+ margin-left: auto;
323
+ margin-right: auto;
324
+ }
325
+ #skinOptions .wp-picker-container, #skinOptions .wp-picker-container:active {
326
+ display:block;
327
+ }
328
+ #skinOptions .wp-picker-container input[type="text"].wp-color-picker {
329
+ float: left;
330
+ height: 25px;
331
+ }
332
+
333
+ .premium-only {
334
+ color: #ff0000;
335
+ font-size: 110%;
336
+ font-style: italic;
337
+ font-weight: bold;
338
+ }
339
+
340
+ /* SETTINGS FOR Overview Gallery */
341
+ .flag-wrap {margin:20px 20px 0 2px}
342
+ .flag-wrap h2.overview-title {margin:0}
343
+ .has-sidebar {
344
+ clear:left;
345
+ float:left;
346
+ width:100%;
347
+ }
348
+ .has-sidebar .has-sidebar-content {
349
+ padding-right:300px;
350
+ }
351
+
352
+ .postbox .misc-pub-section .icon { background-position:left top;background-repeat:no-repeat;padding-left:18px;}
353
+ #plugin-home {background-image:url(../images/browser.png)}
354
+ #plugin-comments {background-image:url(../images/notes.png)}
355
+ #rate-plugin {background-image:url(../images/wallpaper.png)}
356
+ #my-plugins {background-image:url(../images/map.png)}
357
+ #contact-me {background-image:url(../images/mail.png)}
358
+
359
+ #dashboard_server_settings ul.settings span {
360
+ padding-left : 10px;
361
+ color:#2583AD;
362
+ font-weight:bold;
363
+ }
364
+
365
+ .flag-overview .postbox .handlediv {
366
+ float:right;
367
+ height:24px;
368
+ width:24px;
369
+ }
370
+
371
+ #dashboard_primary .inside { margin: 0; }
372
+
373
+ #photogallerycreator .theme > p { margin: 0; padding: 0; }
374
+ #photogallerycreator .theme { overflow: hidden; padding: 7px 0; border-bottom: 1px solid #000000; }
375
+ #photogallerycreator .theme .img { margin-top: 25px; }
376
+ #photogallerycreator .theme .txt > *:first-child { display: block; margin: 0 0 -20px; padding: 0; text-align: center; position: relative; top: -204px; }
377
+
378
+ /* SETTING FOR UPLOAD PAGE */
379
+ .flag-form-table {
380
+ border-collapse: collapse;
381
+ clear: both;
382
+ margin-top: 0.5em;
383
+ width: 100%;
384
+ }
385
+ .useflashupload {float:left;}
386
+ .swfupload {
387
+ position:absolute;
388
+ z-index:1;
389
+ vertical-align:top;
390
+ }
391
+ #uploadQueue {}
392
+ #choosegalfirst {display:block; position:relative; margin:20px 0; overflow:hidden;}
393
+ #choosegalfirst .disabledbut {position:absolute; top:0; left:0; right:0; bottom:0; width:100%; height:100%;}
394
+
395
+ /* SETTINGS FOR THE OPTIONS TABLE */
396
+ .flag-options th {
397
+ width:30%;
398
+ }
399
+ .cptab h3 {margin-top:0; padding-top:20px;}
400
+
401
+ /* SETTINGS FOR MANAGE TABLE */
402
+ .flag_draft, .alt.flag_draft {background-color: #FFEBE8;}
403
+
404
+ p#flag-inlinebutton {
405
+ float:right;
406
+ margin:0pt;
407
+ position:relative;
408
+ top:-25pt;
409
+ }
410
+
411
+ .flag-tablenav .button-secondary {
412
+ padding:2px 8px;
413
+ vertical-align: top;
414
+ }
415
+
416
+ #flag-listitems td, #flag-listitems th {
417
+
418
+ }
419
+
420
+ .fixed tbody th.column-cb {
421
+ padding:7px 0 22px;
422
+ }
423
+ .fixed .column-cb {
424
+ padding:0;
425
+ width:2.2em;
426
+ }
427
+
428
+ .fixed .column-thumbnail{
429
+ width:80px;
430
+ }
431
+
432
+ .fixed .column-thumbnail img{
433
+ height:auto;
434
+ width: 100%;
435
+ max-width:80px;
436
+ }
437
+
438
+ .fixed .column-id {
439
+ width: 3em;
440
+ }
441
+
442
+ .fixed .column-rating { width:100px; text-align: center; }
443
+ .fixed td.column-rating { background-color: #CCFFCC; }
444
+ .fixed .column-views_likes { width:150px; padding-left: 0; padding-right: 0; }
445
+ .fixed .column-views_likes input { width:45px; font-size: 10px; }
446
+
447
+ .fixed .column-alt_title_desc {
448
+
449
+ }
450
+
451
+ .fixed .column-exclude, .fixed .column-action, .fixed .column-delete {
452
+ width: 2.2em; text-align: center;
453
+ }
454
+ .fixed .column-exclude { width: 70px; white-space: nowrap; }
455
+ .fixed th.column-exclude img { vertical-align: text-top; }
456
+ .fixed .column-exclude input {
457
+ margin-top:4px;
458
+ }
459
+ .fixed .column-views {
460
+ width: 4em; text-align: center;
461
+ }
462
+ .flag-table tr > * {
463
+ border-bottom:1px solid #ddd;
464
+ }
465
+ .flag-table td,
466
+ .flag-table th {padding:4px 7px; text-align:left;}
467
+ .flag-table th {font-weight:bold; padding:6px 7px; vertical-align:top;}
468
+ .flag-table th p {margin:0;}
469
+
470
+ #flag-listmusic tbody td { height: 50px; }
471
+
472
+ .albums_table { width: 600px; position: relative; background: #ffffff; border: 1px solid #cccccc; border-radius: 4px; margin: 7px 0; padding: 1px 3px; float: left; max-height: 550px; overflow: auto; }
473
+ .albums_table .album { position: relative; background: #f8f8f8; border: 1px solid #cccccc; border-radius: 4px; margin:2px 0; padding: 3px 3px 3px 36px; }
474
+ .albums_table .album form { margin: 0; padding: 0; display: inline; }
475
+ .albums_table .albID { position: absolute; display: block; width: 30px; top: 6px; left: 0px; text-align: right; }
476
+ .albums_table .album_actions { position: absolute; display: block; top: 3px; right: 3px; text-align: right; }
477
+ .albums_table .album_categoties { background: #fefefe; border: 1px solid #cccccc; margin:1px 0; padding: 0px; min-height: 14px; }
478
+ .albums_table .album_categoties .acat { border-top: 1px solid #cccccc; padding: 3px 6px; cursor: move; position: relative; }
479
+ .albums_table .album_categoties .acat .drop { display: none; position: absolute; right: 3px; top: 1px; font-size: 18px; line-height: 100%; color: #ff0000; cursor: pointer; }
480
+ .albums_table .album_categoties .acat:hover { background-color: #FFFFEE; }
481
+ .albums_table .album_categoties .acat:hover .drop { display: block; }
482
+ .albums_table .album_categoties .acat:first-child { border-top: none; }
483
+
484
+ .alb_msg { font-size: 10px; color: #006600; }
485
+ .flag-ajax-post { cursor: pointer; text-decoration: underline; }
486
+ .flag-ajax-post:hover { color: #ff0000; }
487
+
488
+ .all_galleries { float: left; white-space: nowrap; margin: 0 0 0px 50px; max-height: 550px; overflow: auto; padding-right: 20px; min-width:30%; }
489
+ .all_galleries .acat { border: 1px solid #cccccc; padding: 3px 6px; margin: 3px 0; background: #fefefe; cursor: move; min-width:15%; }
490
+ .all_galleries .acat .drop { display: none; }
491
+ .all_galleries .acat:hover { background-color: #FFFFEE; }
492
+
493
+ .floatholder { overflow: hidden; }
494
+ /* SETTINGS FOR PROGRESS BAR */
495
+
496
+ div .progressborder {
497
+ border: 1px inset ;
498
+ display: block;
499
+ height: 20px;
500
+ background-color: #464646;
501
+ width: 100%;
502
+ margin-top: 15px;
503
+ margin-bottom: 15px;
504
+ }
505
+
506
+ div .progressbar {
507
+ border: medium none ;
508
+ display: block;
509
+ height: 20px;
510
+ background-color: #D54E21;
511
+ width: 0%;
512
+ }
513
+
514
+ div .progressbar span {
515
+ display: inline;
516
+ position: relative;
517
+ color: white;
518
+ font-weight: bold;
519
+ padding-left: 5px;
520
+ }
521
+
522
+
523
+ .show_details
524
+ {
525
+ height: 16px;
526
+ line-height: 20px;
527
+ overflow: hidden;
528
+ min-width: 8em;
529
+ padding: 3px;
530
+ cursor:pointer;
531
+ }
532
+
533
+ .show_details span
534
+ {
535
+ border-bottom:1px solid #999;
536
+ white-space:pre;
537
+ }
538
+ .show_details:hover
539
+ {
540
+ height: auto;
541
+ overflow: visible;
542
+ border: 1px solid #999;
543
+ }
544
+
545
+ /* SETTINGS FOR SORT GALLERY */
546
+ #flag-listitems .header p {
547
+ background-image:url(../images/sortbg.gif);
548
+ background-position:right center;
549
+ background-repeat:no-repeat;
550
+ cursor:pointer;
551
+ margin:0;
552
+ }
553
+ #flag-listitems .headerSortDown p {
554
+ background-image:url(../images/desc.gif) !important;
555
+ background-position:right center;
556
+ background-repeat:no-repeat;
557
+ cursor:pointer;
558
+ margin:0;
559
+ }
560
+ #flag-listitems .headerSortUp p {
561
+ background-image:url(../images/asc.gif) !important;
562
+ background-position:right center;
563
+ background-repeat:no-repeat;
564
+ cursor:pointer;
565
+ margin:0;
566
+ }
567
+
568
+ /* UPGRADE PAGE */
569
+
570
+ .error_inline {
571
+ background:#FFEBE8 none repeat scroll 0%;
572
+ border:1px solid #CC0000;
573
+ margin:5px auto;
574
+ padding:10px;
575
+ }
576
+
577
+ /* MEDIA BOX */
578
+
579
+ p.row-actions {
580
+ margin:0px;
581
+ padding:10px 4px 0;
582
+ }
583
+
584
+ div#TB_window iframe#TB_iframeContent { width: 100% !important; }
585
+ div.message { background: #ffffee; border: 1px solid #cccccc; border-radius: 4px; padding: 1px 10px; margin: 24px 20px 10px 0; font-size: 12px; }
586
+ div.message .flag_progress { position: relative; height: 18px; width: 400px; border: 1px solid #0066FF; background-color: #ffffff; margin: 7px 0; }
587
+ div.message .flag_progress .txt { position: absolute; left: 10px; top: 0; line-height: 18px; font-weight: bold; height: 18px; z-index: 10; }
588
+ div.message .flag_progress .flag_complete { position: absolute; left: 0; top: 0; height: 18px; width: 0px; overflow: hidden; background: #00FFB7; z-index: 5; }
589
+ div#license div p { font-size: 13px; }
590
+ .highlight_new { background-color: #E4F2FD; color: #000000; font-weight: bold; }
591
+ .success { background-color: #CCFFCC; border: 1px solid darkgreen; border-radius: 3px; margin: 5px 15px; padding: 3px 7px; }
592
+
593
+ #gmUpload { padding-top:10px }
594
+ #gmUpload table td { font-size: 11px !important; }
595
+
596
+ .already-added {background-color:#DDFFBB;}
597
+
598
+ a.button.button-primary.button-red {
599
+ background: red;
600
+ border-color: darkred;
601
+ text-shadow: 0 -1px 1px darkred, 1px 0 1px darkred, 0 1px 1px darkred, -1px 0 1px darkred;
602
+ }
603
+
604
+ a.button.button-primary.button-red:hover {
605
+ background: orangered;
606
+ border-color: darkred;
607
+ }
608
+
609
+ .skin-delete.action-links a {
610
+ white-space: nowrap;
611
+ }
612
+ .flag-options-footer {
613
+ padding: 10px 30px 5px;
614
+ position: fixed;
615
+ left: 0;
616
+ bottom: 0;
617
+ width: 100%;
618
+ box-sizing: border-box;
619
+ background-color: #fcfcfc;
620
+ border-top: 1px solid #bbb;
621
+ }
622
+
623
+ form.addnewpreset {
624
+ display: flex;
625
+ }
626
+
627
+ form.addnewpreset button {
628
+ border: none;
629
+ background: transparent;
630
+ cursor: pointer;
631
+ padding: 3px 6px !important;
632
+ height: 26px !important;
633
+ }
634
+
635
+ .ui-button-disabled {
636
+ pointer-events: none;
637
+ }
638
+
639
+ #flag-overview .handle-actions {
640
+ display: none;
641
+ }
admin/css/flagallery-block.css CHANGED
@@ -16,6 +16,13 @@ form.flagallery-preview select {
16
  box-sizing: border-box;
17
  }
18
 
 
 
 
 
 
 
 
19
  .flagallery-required {
20
  border-color: red !important;
21
  }
16
  box-sizing: border-box;
17
  }
18
 
19
+ form.flagallery-preview select.flagallery-preset option {
20
+ display: none;
21
+ }
22
+ form.flagallery-preview select.flagallery-preset option.default-preset {
23
+ display: initial !important;
24
+ }
25
+
26
  .flagallery-required {
27
  border-color: red !important;
28
  }
admin/flag_install.php CHANGED
@@ -1,319 +1,332 @@
1
- <?php
2
- // Stop direct call
3
- if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])){
4
- die('You are not allowed to call this page directly.');
5
- }
6
-
7
- /**
8
- * creates all tables for the gallery
9
- * called during register_activation hook
10
- *
11
- * @access internal
12
- * @return void
13
- **/
14
-
15
- function flag_install(){
16
- global $wpdb, $wp_version;
17
-
18
- // Check for capability
19
- if( !current_user_can('activate_plugins')){
20
- return;
21
- }
22
-
23
- flag_capabilities();
24
-
25
- // upgrade function changed in WordPress 2.3
26
- require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
27
-
28
- // add charset & collate like wp core
29
- $charset_collate = '';
30
-
31
- if($wpdb->has_cap('collation')){
32
- if( !empty($wpdb->charset)){
33
- $charset_collate = "DEFAULT CHARACTER SET $wpdb->charset";
34
- }
35
- if( !empty($wpdb->collate)){
36
- $charset_collate .= " COLLATE $wpdb->collate";
37
- }
38
- }
39
-
40
- $flagpictures = $wpdb->prefix . 'flag_pictures';
41
- $flaggallery = $wpdb->prefix . 'flag_gallery';
42
- $flagcomments = $wpdb->prefix . 'flag_comments';
43
- $flagalbum = $wpdb->prefix . 'flag_album';
44
-
45
- if($wpdb->get_var("show tables like '$flagpictures'") != $flagpictures){
46
-
47
- $sql = "CREATE TABLE " . $flagpictures . " (
48
- pid BIGINT(20) NOT NULL AUTO_INCREMENT ,
49
- galleryid BIGINT(20) DEFAULT '0' NOT NULL ,
50
- filename VARCHAR(255) NOT NULL ,
51
- description MEDIUMTEXT NULL ,
52
- alttext MEDIUMTEXT NULL ,
53
- link TEXT NULL ,
54
- imagedate DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
55
- modified TIMESTAMP NOT NULL ON UPDATE CURRENT_TIMESTAMP,
56
- exclude TINYINT NULL DEFAULT '0',
57
- sortorder BIGINT(20) DEFAULT '0' NOT NULL ,
58
- location TEXT,
59
- city TINYTEXT,
60
- state TINYTEXT,
61
- country TINYTEXT,
62
- credit TEXT,
63
- copyright TEXT,
64
- commentson INT(1) UNSIGNED NOT NULL DEFAULT '1',
65
- hitcounter INT(11) UNSIGNED DEFAULT '0',
66
- total_value INT(11) UNSIGNED DEFAULT '0',
67
- total_votes INT(11) UNSIGNED DEFAULT '0',
68
- used_ips LONGTEXT,
69
- meta_data LONGTEXT,
70
- PRIMARY KEY pid (pid)
71
- ) $charset_collate;";
72
-
73
- dbDelta($sql);
74
- }
75
-
76
-
77
- if($wpdb->get_var("show tables like '$flaggallery'") != $flaggallery){
78
-
79
- $sql = "CREATE TABLE " . $flaggallery . " (
80
- gid BIGINT(20) NOT NULL AUTO_INCREMENT ,
81
- name VARCHAR(255) NOT NULL ,
82
- path MEDIUMTEXT NULL ,
83
- title MEDIUMTEXT NULL ,
84
- galdesc MEDIUMTEXT NULL ,
85
- previewpic BIGINT(20) NULL DEFAULT '0' ,
86
- sortorder BIGINT(20) DEFAULT '0' NOT NULL ,
87
- author BIGINT(20) NOT NULL DEFAULT '0' ,
88
- status TINYINT NULL DEFAULT '0' ,
89
- PRIMARY KEY gid (gid)
90
- ) $charset_collate;";
91
-
92
- dbDelta($sql);
93
- }
94
-
95
- if($wpdb->get_var("show tables like '$flagcomments'") != $flagcomments){
96
- $sql = "CREATE TABLE " . $flagcomments . " (
97
- cid int(11) unsigned NOT NULL auto_increment,
98
- ownerid int(11) unsigned NOT NULL default '0',
99
- name varchar(255) NOT NULL default '',
100
- email varchar(255) NOT NULL default '',
101
- website varchar(255) default NULL,
102
- date datetime default NULL,
103
- comment text,
104
- inmoderation int(1) unsigned NOT NULL default '0',
105
- PRIMARY KEY (cid),
106
- KEY ownerid (ownerid)
107
- ) $charset_collate;";
108
-
109
- dbDelta($sql);
110
- }
111
-
112
- if( !$wpdb->get_var("SHOW TABLES LIKE '$flagalbum'")){
113
-
114
- $sql = "CREATE TABLE " . $flagalbum . " (
115
- id BIGINT(20) NOT NULL AUTO_INCREMENT ,
116
- name VARCHAR(255) NOT NULL ,
117
- previewpic BIGINT(20) DEFAULT '0' NOT NULL ,
118
- albumdesc MEDIUMTEXT NULL ,
119
- categories LONGTEXT NOT NULL,
120
- PRIMARY KEY id (id)
121
- ) $charset_collate;";
122
-
123
- dbDelta($sql);
124
- }
125
-
126
-
127
- // check one table again, to be sure
128
- if( !$wpdb->get_var("SHOW TABLES LIKE '$flagpictures'")){
129
- update_option("flag_init_check", __('FlaGallery : Tables could not created, please check your database settings', 'flash-album-gallery'));
130
-
131
- return;
132
- }
133
-
134
- $options = get_option('flag_options');
135
- // set the default settings, if we didn't upgrade
136
- if(empty($options)){
137
- flag_default_options();
138
- }
139
-
140
-
141
- delete_transient('flagallery_uninstalled');
142
- // if all is passed , save the VERSIONs
143
- add_option("flag_db_version", FLAG_DBVERSION);
144
- add_option("flagVersion", FLAGVERSION);
145
-
146
- include_once(dirname(__FILE__) . '/tuning.php');
147
- flag_tune(false);
148
- }
149
-
150
- function flag_capabilities(){
151
- global $wp_roles;
152
-
153
- // Set the capabilities for the administrator
154
- $role = get_role('administrator');
155
- // We need this role, no other chance
156
- if(empty($role)){
157
- update_option("flag_init_check", __('Sorry, FlaGallery works only with a role called administrator', 'flash-album-gallery'));
158
-
159
- return;
160
- }
161
-
162
- $role->add_cap('FlAG overview');
163
- $role->add_cap('FlAG Use TinyMCE');
164
- $role->add_cap('FlAG Upload images');
165
- $role->add_cap('FlAG Import folder');
166
- $role->add_cap('FlAG Manage gallery');
167
- $role->add_cap('FlAG Manage others gallery');
168
- $role->add_cap('FlAG Change skin');
169
- $role->add_cap('FlAG Add skins');
170
- $role->add_cap('FlAG Delete skins');
171
- $role->add_cap('FlAG Change options');
172
- $role->add_cap('FlAG Manage music');
173
- $role->add_cap('FlAG Manage video');
174
- $role->add_cap('FlAG Manage banners');
175
- $role->add_cap('FlAG iFrame page');
176
-
177
- }
178
-
179
- /**
180
- * Setup the default option array for the gallery
181
- *
182
- * @access internal
183
- * @return void
184
- */
185
- function flag_default_options(){
186
-
187
- global $blog_id, $flag;
188
-
189
- $flag_options = flag_list_options();
190
- // special overrides for WPMU
191
- if(IS_WPMU){
192
- // get the site options
193
- $flag_wpmu_options = get_site_option('flag_options');
194
- // get the default value during installation
195
- //if (!is_array($flag_wpmu_options)) {
196
- //$flag_wpmu_options['galleryPath'] = 'wp-content/blogs.dir/%BLOG_ID%/files/';
197
- update_site_option('flag_options', $flag_wpmu_options);
198
- //}
199
- //$flag_options['galleryPath'] = str_replace("%BLOG_ID%", $blog_id , $flag_wpmu_options['galleryPath']);
200
- }
201
-
202
- update_option('flag_options', $flag_options);
203
-
204
- }
205
-
206
- function flag_list_options(){
207
- $wp_content = basename(WP_CONTENT_DIR);
208
- $flag_options['galleryPath'] = $wp_content . '/flagallery/'; // set default path to the gallery
209
- $flag_options['swfUpload'] = true; // activate the batch upload
210
- $flag_options['deleteImg'] = true; // delete Images
211
- $flag_options['deepLinks'] = true;
212
- $flag_options['access_key'] = '';
213
- $flag_options['license_key'] = '';
214
- $flag_options['license_name'] = '';
215
- $flag_options['useMediaRSS'] = false; // activate the global Media RSS file
216
-
217
- $flag_options['gp_jscode'] = ''; // GRAND Pages: google analytics code
218
-
219
- // Sort Settings
220
- $flag_options['albSort'] = 'title'; // Galleries Sort order
221
- $flag_options['albSortDir'] = 'ASC'; // Galleries Sort dir
222
- $flag_options['albPerPage'] = '50'; // Galleries per page
223
- $flag_options['galSort'] = 'sortorder'; // Images Sort order
224
- $flag_options['galSortDir'] = 'ASC'; // Images Sort direction
225
-
226
- // Flash settings
227
- $flag_options['skinsDirABS'] = str_replace("\\", "/", WP_PLUGIN_DIR . '/flagallery-skins/');
228
- $flag_options['skinsDirURL'] = WP_PLUGIN_URL . '/flagallery-skins/';
229
- $flag_options['flashSkin'] = 'amron';
230
- $flag_options['flashWidth'] = '100%';
231
- $flag_options['flashHeight'] = '500';
232
-
233
- // Image Settings
234
- $flag_options['imgWidth'] = 2200; // Image Width
235
- $flag_options['imgHeight'] = 2200; // Image height
236
- $flag_options['imgQuality'] = 87; // Image Quality
237
-
238
- // Thumbnail Settings
239
- $flag_options['thumbWidth'] = 400; // Thumb Width
240
- $flag_options['thumbHeight'] = 400; // Thumb height
241
- $flag_options['thumbQuality'] = 100; // Thumb Quality
242
-
243
- $flag_options['mpAutoplay'] = 'false';
244
- $flag_options['vmAutoplay'] = 'false';
245
- $flag_options['vmWidth'] = '640';
246
- $flag_options['vmHeight'] = '480';
247
-
248
- $flag_options['advanced'] = false; // Advanced options
249
-
250
- return $flag_options;
251
- }
252
-
253
- /**
254
- * Deregister a capability from all classic roles
255
- *
256
- * @access internal
257
- *
258
- * @param string $capability name of the capability which should be deregister
259
- *
260
- * @return void
261
- */
262
- function flag_remove_capability($capability){
263
- // this function remove the $capability only from the classic roles
264
- $check_order = array("subscriber", "contributor", "author", "editor", "administrator");
265
-
266
- foreach($check_order as $role){
267
-
268
- $role = get_role($role);
269
- $role->remove_cap($capability);
270
- }
271
-
272
- }
273
-
274
- /**
275
- * Uninstall all settings and tables
276
- * Called via Setup and register_unstall hook
277
- *
278
- * @access internal
279
- * @return void
280
- */
281
- function flag_uninstall(){
282
- global $wpdb;
283
-
284
- // first remove all tables
285
- $wpdb->query("DROP TABLE IF EXISTS {$wpdb->prefix}flag_pictures");
286
- $wpdb->query("DROP TABLE IF EXISTS {$wpdb->prefix}flag_gallery");
287
- $wpdb->query("DROP TABLE IF EXISTS {$wpdb->prefix}flag_comments");
288
- $wpdb->query("DROP TABLE IF EXISTS {$wpdb->prefix}flag_album");
289
-
290
- // then remove all options
291
- delete_option('flag_options');
292
- delete_option('flag_db_version');
293
- delete_option('flagVersion');
294
- delete_option('flag_plugin_error');
295
-
296
- // now remove the capability
297
- flag_remove_capability("FlAG overview");
298
- flag_remove_capability("FlAG Use TinyMCE");
299
- flag_remove_capability("FlAG Upload images");
300
- flag_remove_capability("FlAG Import folder");
301
- flag_remove_capability("FlAG Manage gallery");
302
- flag_remove_capability('FlAG Manage others gallery');
303
- flag_remove_capability("FlAG Change skin");
304
- flag_remove_capability('FlAG Add skins');
305
- flag_remove_capability('FlAG Delete skins');
306
- flag_remove_capability("FlAG Change options");
307
- flag_remove_capability("FlAG Manage music");
308
- flag_remove_capability("FlAG Manage video");
309
- flag_remove_capability("FlAG Manage banners");
310
- flag_remove_capability("FlAG iFrame page");
311
-
312
- if(is_plugin_active(FLAGFOLDER . '/flag.php')) {
313
- // Deactivate plugin
314
- deactivate_plugins(FLAGFOLDER . '/flag.php');
315
- $plugins_url = admin_url('plugins.php');
316
- wp_redirect($plugins_url);
317
- exit();
318
- }
319
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ // Stop direct call
3
+ if ( preg_match( '#' . basename( __FILE__ ) . '#', $_SERVER['PHP_SELF'] ) ) {
4
+ die( 'You are not allowed to call this page directly.' );
5
+ }
6
+
7
+ /**
8
+ * creates all tables for the gallery
9
+ *
10
+ * @access internal
11
+ * @return void
12
+ **/
13
+
14
+ function flag_create_tables() {
15
+ global $wpdb;
16
+
17
+ // upgrade function changed in WordPress 2.3
18
+ require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
19
+
20
+ // add charset & collate like wp core
21
+ $charset_collate = '';
22
+
23
+ if ( $wpdb->has_cap( 'collation' ) ) {
24
+ if ( ! empty( $wpdb->charset ) ) {
25
+ $charset_collate = "DEFAULT CHARACTER SET $wpdb->charset";
26
+ }
27
+ if ( ! empty( $wpdb->collate ) ) {
28
+ $charset_collate .= " COLLATE $wpdb->collate";
29
+ }
30
+ }
31
+
32
+ $flagpictures = $wpdb->prefix . 'flag_pictures';
33
+ $flaggallery = $wpdb->prefix . 'flag_gallery';
34
+ $flagcomments = $wpdb->prefix . 'flag_comments';
35
+ $flagalbum = $wpdb->prefix . 'flag_album';
36
+
37
+ if ( $wpdb->get_var( "show tables like '$flagpictures'" ) != $flagpictures ) {
38
+
39
+ $sql = "CREATE TABLE " . $flagpictures . " (
40
+ pid BIGINT(20) NOT NULL AUTO_INCREMENT ,
41
+ galleryid BIGINT(20) DEFAULT '0' NOT NULL ,
42
+ filename VARCHAR(255) NOT NULL ,
43
+ description MEDIUMTEXT NULL ,
44
+ alttext MEDIUMTEXT NULL ,
45
+ link TEXT NULL ,
46
+ imagedate DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
47
+ modified TIMESTAMP NOT NULL ON UPDATE CURRENT_TIMESTAMP,
48
+ exclude TINYINT NULL DEFAULT '0',
49
+ sortorder BIGINT(20) DEFAULT '0' NOT NULL ,
50
+ location TEXT,
51
+ city TINYTEXT,
52
+ state TINYTEXT,
53
+ country TINYTEXT,
54
+ credit TEXT,
55
+ copyright TEXT,
56
+ commentson INT(1) UNSIGNED NOT NULL DEFAULT '1',
57
+ hitcounter INT(11) UNSIGNED DEFAULT '0',
58
+ total_value INT(11) UNSIGNED DEFAULT '0',
59
+ total_votes INT(11) UNSIGNED DEFAULT '0',
60
+ used_ips LONGTEXT,
61
+ meta_data LONGTEXT,
62
+ PRIMARY KEY pid (pid)
63
+ ) $charset_collate;";
64
+
65
+ dbDelta( $sql );
66
+ }
67
+
68
+
69
+ if ( $wpdb->get_var( "show tables like '$flaggallery'" ) != $flaggallery ) {
70
+
71
+ $sql = "CREATE TABLE " . $flaggallery . " (
72
+ gid BIGINT(20) NOT NULL AUTO_INCREMENT ,
73
+ name VARCHAR(255) NOT NULL ,
74
+ path MEDIUMTEXT NULL ,
75
+ title MEDIUMTEXT NULL ,
76
+ galdesc MEDIUMTEXT NULL ,
77
+ previewpic BIGINT(20) NULL DEFAULT '0' ,
78
+ sortorder BIGINT(20) DEFAULT '0' NOT NULL ,
79
+ author BIGINT(20) NOT NULL DEFAULT '0' ,
80
+ status TINYINT NULL DEFAULT '0' ,
81
+ PRIMARY KEY gid (gid)
82
+ ) $charset_collate;";
83
+
84
+ dbDelta( $sql );
85
+ }
86
+
87
+ if ( $wpdb->get_var( "show tables like '$flagcomments'" ) != $flagcomments ) {
88
+ $sql = "CREATE TABLE " . $flagcomments . " (
89
+ cid int(11) unsigned NOT NULL auto_increment,
90
+ ownerid int(11) unsigned NOT NULL default '0',
91
+ name varchar(255) NOT NULL default '',
92
+ email varchar(255) NOT NULL default '',
93
+ website varchar(255) default NULL,
94
+ date datetime default NULL,
95
+ comment text,
96
+ inmoderation int(1) unsigned NOT NULL default '0',
97
+ PRIMARY KEY (cid),
98
+ KEY ownerid (ownerid)
99
+ ) $charset_collate;";
100
+
101
+ dbDelta( $sql );
102
+ }
103
+
104
+ if ( ! $wpdb->get_var( "SHOW TABLES LIKE '$flagalbum'" ) ) {
105
+
106
+ $sql = "CREATE TABLE " . $flagalbum . " (
107
+ id BIGINT(20) NOT NULL AUTO_INCREMENT ,
108
+ name VARCHAR(255) NOT NULL ,
109
+ previewpic BIGINT(20) DEFAULT '0' NOT NULL ,
110
+ albumdesc MEDIUMTEXT NULL ,
111
+ categories LONGTEXT NOT NULL,
112
+ PRIMARY KEY id (id)
113
+ ) $charset_collate;";
114
+
115
+ dbDelta( $sql );
116
+ }
117
+
118
+
119
+ // check one table again, to be sure
120
+ if ( ! $wpdb->get_var( "SHOW TABLES LIKE '$flagpictures'" ) ) {
121
+ update_option( "flag_init_check", __( 'FlaGallery : Tables could not created, please check your database settings', 'flash-album-gallery' ) );
122
+
123
+ return;
124
+ }
125
+
126
+ }
127
+
128
+ /**
129
+ * creates all tables for the gallery
130
+ * called during register_activation hook
131
+ *
132
+ * @access internal
133
+ * @return void
134
+ **/
135
+
136
+ function flag_install() {
137
+
138
+ flag_capabilities();
139
+
140
+ flag_create_tables();
141
+
142
+ $options = get_option( 'flag_options' );
143
+ // set the default settings, if we didn't upgrade
144
+ if ( empty( $options ) ) {
145
+ flag_default_options();
146
+ }
147
+
148
+
149
+ delete_transient( 'flagallery_uninstalled' );
150
+ // if all is passed , save the VERSIONs
151
+ add_option( "flag_db_version", FLAG_DBVERSION );
152
+ add_option( "flagVersion", FLAGVERSION );
153
+
154
+ include_once( dirname( __FILE__ ) . '/tuning.php' );
155
+ flag_tune( false );
156
+ }
157
+
158
+ function flag_capabilities() {
159
+ global $wp_roles;
160
+
161
+ // Set the capabilities for the administrator
162
+ $role = get_role( 'administrator' );
163
+ // We need this role, no other chance
164
+ if ( empty( $role ) ) {
165
+ update_option( "flag_init_check", __( 'Sorry, FlaGallery works only with a role called administrator', 'flash-album-gallery' ) );
166
+
167
+ return;
168
+ }
169
+
170
+ $role->add_cap( 'FlAG overview' );
171
+ $role->add_cap( 'FlAG Use TinyMCE' );
172
+ $role->add_cap( 'FlAG Upload images' );
173
+ $role->add_cap( 'FlAG Import folder' );
174
+ $role->add_cap( 'FlAG Manage gallery' );
175
+ $role->add_cap( 'FlAG Manage others gallery' );
176
+ $role->add_cap( 'FlAG Change skin' );
177
+ $role->add_cap( 'FlAG Add skins' );
178
+ $role->add_cap( 'FlAG Delete skins' );
179
+ $role->add_cap( 'FlAG Change options' );
180
+ $role->add_cap( 'FlAG Manage music' );
181
+ $role->add_cap( 'FlAG Manage video' );
182
+ $role->add_cap( 'FlAG Manage banners' );
183
+ $role->add_cap( 'FlAG iFrame page' );
184
+
185
+ }
186
+
187
+ /**
188
+ * Setup the default option array for the gallery
189
+ *
190
+ * @access internal
191
+ * @return void
192
+ */
193
+ function flag_default_options() {
194
+
195
+ global $blog_id, $flag;
196
+
197
+ $flag_options = flag_list_options();
198
+ // special overrides for WPMU
199
+ if ( IS_WPMU ) {
200
+ // get the site options
201
+ $flag_wpmu_options = get_site_option( 'flag_options' );
202
+ // get the default value during installation
203
+ //if (!is_array($flag_wpmu_options)) {
204
+ //$flag_wpmu_options['galleryPath'] = 'wp-content/blogs.dir/%BLOG_ID%/files/';
205
+ update_site_option( 'flag_options', $flag_wpmu_options );
206
+ //}
207
+ //$flag_options['galleryPath'] = str_replace("%BLOG_ID%", $blog_id , $flag_wpmu_options['galleryPath']);
208
+ }
209
+
210
+ update_option( 'flag_options', $flag_options );
211
+
212
+ }
213
+
214
+ function flag_list_options() {
215
+ $wp_content = basename( WP_CONTENT_DIR );
216
+ $flag_options['galleryPath'] = $wp_content . '/flagallery/'; // set default path to the gallery
217
+ $flag_options['swfUpload'] = true; // activate the batch upload
218
+ $flag_options['deleteImg'] = true; // delete Images
219
+ $flag_options['deepLinks'] = true;
220
+ $flag_options['access_key'] = '';
221
+ $flag_options['license_key'] = '';
222
+ $flag_options['license_name'] = '';
223
+ $flag_options['useMediaRSS'] = false; // activate the global Media RSS file
224
+
225
+ $flag_options['gp_jscode'] = ''; // GRAND Pages: google analytics code
226
+
227
+ // Sort Settings
228
+ $flag_options['albSort'] = 'title'; // Galleries Sort order
229
+ $flag_options['albSortDir'] = 'ASC'; // Galleries Sort dir
230
+ $flag_options['albPerPage'] = '50'; // Galleries per page
231
+ $flag_options['galSort'] = 'sortorder'; // Images Sort order
232
+ $flag_options['galSortDir'] = 'ASC'; // Images Sort direction
233
+
234
+ // Flash settings
235
+ $flag_options['skinsDirABS'] = str_replace( "\\", "/", WP_PLUGIN_DIR . '/flagallery-skins/' );
236
+ $flag_options['skinsDirURL'] = WP_PLUGIN_URL . '/flagallery-skins/';
237
+ $flag_options['flashSkin'] = 'amron';
238
+ $flag_options['flashWidth'] = '100%';
239
+ $flag_options['flashHeight'] = '500';
240
+
241
+ // Image Settings
242
+ $flag_options['imgWidth'] = 2200; // Image Width
243
+ $flag_options['imgHeight'] = 2200; // Image height
244
+ $flag_options['imgQuality'] = 87; // Image Quality
245
+
246
+ // Thumbnail Settings
247
+ $flag_options['thumbWidth'] = 400; // Thumb Width
248
+ $flag_options['thumbHeight'] = 400; // Thumb height
249
+ $flag_options['thumbQuality'] = 100; // Thumb Quality
250
+
251
+ $flag_options['mpAutoplay'] = 'false';
252
+ $flag_options['vmAutoplay'] = 'false';
253
+ $flag_options['vmWidth'] = '640';
254
+ $flag_options['vmHeight'] = '480';
255
+
256
+ $flag_options['advanced'] = false; // Advanced options
257
+ $flag_options['hide_woow'] = '0';
258
+ $flag_options['show_music_box'] = '0';
259
+ $flag_options['show_video_box'] = '0';
260
+ $flag_options['show_banner_box'] = '0';
261
+
262
+ return $flag_options;
263
+ }
264
+
265
+ /**
266
+ * Deregister a capability from all classic roles
267
+ *
268
+ * @access internal
269
+ *
270
+ * @param string $capability name of the capability which should be deregister
271
+ *
272
+ * @return void
273
+ */
274
+ function flag_remove_capability( $capability ) {
275
+ // this function remove the $capability only from the classic roles
276
+ $check_order = [ "subscriber", "contributor", "author", "editor", "administrator" ];
277
+
278
+ foreach ( $check_order as $role ) {
279
+
280
+ $role = get_role( $role );
281
+ $role->remove_cap( $capability );
282
+ }
283
+
284
+ }
285
+
286
+ /**
287
+ * Uninstall all settings and tables
288
+ * Called via Setup and register_unstall hook
289
+ *
290
+ * @access internal
291
+ * @return void
292
+ */
293
+ function flag_uninstall() {
294
+ global $wpdb;
295
+
296
+ // first remove all tables
297
+ $wpdb->query( "DROP TABLE IF EXISTS {$wpdb->prefix}flag_pictures" );
298
+ $wpdb->query( "DROP TABLE IF EXISTS {$wpdb->prefix}flag_gallery" );
299
+ $wpdb->query( "DROP TABLE IF EXISTS {$wpdb->prefix}flag_comments" );
300
+ $wpdb->query( "DROP TABLE IF EXISTS {$wpdb->prefix}flag_album" );
301
+
302
+ // then remove all options
303
+ delete_option( 'flag_options' );
304
+ delete_option( 'flag_db_version' );
305
+ delete_option( 'flagVersion' );
306
+ delete_option( 'flag_plugin_error' );
307
+
308
+ // now remove the capability
309
+ flag_remove_capability( "FlAG overview" );
310
+ flag_remove_capability( "FlAG Use TinyMCE" );
311
+ flag_remove_capability( "FlAG Upload images" );
312
+ flag_remove_capability( "FlAG Import folder" );
313
+ flag_remove_capability( "FlAG Manage gallery" );
314
+ flag_remove_capability( 'FlAG Manage others gallery' );
315
+ flag_remove_capability( "FlAG Change skin" );
316
+ flag_remove_capability( 'FlAG Add skins' );
317
+ flag_remove_capability( 'FlAG Delete skins' );
318
+ flag_remove_capability( "FlAG Change options" );
319
+ flag_remove_capability( "FlAG Manage music" );
320
+ flag_remove_capability( "FlAG Manage video" );
321
+ flag_remove_capability( "FlAG Manage banners" );
322
+ flag_remove_capability( "FlAG iFrame page" );
323
+
324
+ require_once ABSPATH . '/wp-admin/includes/plugin.php';
325
+ if ( is_plugin_active( FLAGFOLDER . '/flag.php' ) ) {
326
+ // Deactivate plugin
327
+ deactivate_plugins( FLAGFOLDER . '/flag.php' );
328
+ $plugins_url = admin_url( 'plugins.php' );
329
+ wp_redirect( $plugins_url );
330
+ exit();
331
+ }
332
+ }
admin/flagframe-tool.php CHANGED
@@ -1,278 +1,360 @@
1
- <?php if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You are not allowed to call this page directly.'); }
2
-
3
- // check for correct capability
4
- if ( !is_user_logged_in() )
5
- die('-1');
6
-
7
- // check for correct FlAG capability
8
- if ( !current_user_can('FlAG iFrame page') )
9
- die('-1');
10
-
11
- if(isset($_POST['copy_file'])) {
12
- if(copy(FLAG_ABSPATH.'flagframe.php',ABSPATH.'flagframe.php')) {
13
- flagGallery::show_message(__('Success','flash-album-gallery'));
14
- } else {
15
- flagGallery::show_error(__('Failure','flash-album-gallery'));
16
- }
17
- }
18
- global $flag, $flagdb;
19
- require_once (dirname(__FILE__) . '/get_skin.php');
20
- require_once (dirname(__FILE__) . '/playlist.functions.php');
21
- require_once (dirname(__FILE__) . '/video.functions.php');
22
- require_once (dirname(__FILE__) . '/banner.functions.php');
23
- $i_skins = get_skins();
24
- $all_m_playlists = get_playlists();
25
- $all_v_playlists = get_v_playlists();
26
- $all_b_playlists = get_b_playlists();
27
- $fb_url = plugins_url().'/flash-album-gallery/flagframe.php';
28
- if(file_exists(ABSPATH.'flagframe.php')) {
29
- $fb_url = home_url().'/flagframe.php';
30
- }
31
- ?>
32
- <script type="text/javascript">/*<![CDATA[*/
33
- var url = '<?php echo $fb_url; ?>';
34
- jQuery(document).ready(function() {
35
- jQuery('#galleries input[value="all"]').attr('checked','checked').parent().siblings('.row').find('input').removeAttr('checked');
36
- jQuery('#items_array').val('all');
37
- var galleries = '?i='+jQuery('#items_array').val().split(',').join('_');
38
- var skin = jQuery('#skinname option:selected').val();
39
- if(skin) skin = '&f='+skin; else skin = '';
40
- var w = jQuery('#gallerywidth').val();
41
- var h = jQuery('#galleryheight').val();
42
- fb_url(galleries,skin,w,h);
43
- jQuery('#galleries :checkbox').click(function(){
44
- var cur, arr, del;
45
- if(jQuery(this).is(':checked')){
46
- cur = jQuery(this).val();
47
- if(cur == 'all') {
48
- jQuery(this).parent().siblings('.row').find('input').removeAttr('checked');
49
- jQuery('#items_array').val(cur);
50
- } else {
51
- jQuery('#galleries input[value="all"]').removeAttr('checked');
52
- arr = jQuery('#items_array').val();
53
- if(arr && arr != 'all') { del = ','; } else { arr = ''; del = ''; }
54
- jQuery('#items_array').val(arr+del+cur);
55
- }
56
- } else {
57
- cur = jQuery(this).val();
58
- arr = jQuery('#items_array').val().split(',');
59
- arr = jQuery.grep(arr, function(a){ return a != cur; }).join(',');
60
- if(arr) {
61
- jQuery('#items_array').val(arr);
62
- } else {
63
- jQuery('#galleries input[value="all"]').attr('checked','checked');
64
- jQuery('#items_array').val('all');
65
- }
66
- }
67
- galleries = '?i='+jQuery('#items_array').val().split(',').join('_');
68
- skin = jQuery('#skinname option:selected').val(); if(skin) skin = '&f='+skin; else skin = '';
69
- w = jQuery('#gallerywidth').val();
70
- h = jQuery('#galleryheight').val();
71
- fb_url(galleries,skin,w,h);
72
- });
73
- jQuery('#skinname').change(function(){
74
- var skin = jQuery(this).val();
75
- if(skin) {
76
- skin = '&f='+skin;
77
- } else {
78
- skin = '';
79
- }
80
- galleries = '?i='+jQuery('#items_array').val().split(',').join('_');
81
- w = jQuery('#gallerywidth').val();
82
- h = jQuery('#galleryheight').val();
83
- fb_url(galleries,skin,w,h);
84
- });
85
- jQuery('#gallerywidth, #galleryheight').bind('keyup',function(){
86
- var w = jQuery('#gallerywidth').val();
87
- var h = jQuery('#galleryheight').val();
88
- galleries = '?i='+jQuery('#items_array').val().split(',').join('_');
89
- skin = jQuery('#skinname option:selected').val(); if(skin) skin = '&f='+skin; else skin = '';
90
- fb_url(galleries,skin,w,h);
91
- });
92
- jQuery('#m_playlist, #gallerywidth2, #galleryheight2').change(function(){
93
- var playlist = jQuery('#m_playlist').val();
94
- if(playlist) {
95
- playlist = '?m='+playlist;
96
- } else {
97
- playlist = '';
98
- }
99
- fb_url2(playlist,2);
100
- });
101
- jQuery('#v_playlist, #gallerywidth3, #galleryheight3').change(function(){
102
- var playlist = jQuery('#v_playlist').val();
103
- if(playlist) {
104
- playlist = '?v='+playlist;
105
- } else {
106
- playlist = '';
107
- }
108
- fb_url2(playlist,3);
109
- });
110
- jQuery('#b_playlist, #gallerywidth4, #galleryheight4').change(function(){
111
- var playlist = jQuery('#b_playlist').val();
112
- if(playlist) {
113
- playlist = '?b='+playlist;
114
- } else {
115
- playlist = '';
116
- }
117
- fb_url2(playlist,4);
118
- });
119
- });
120
- function fb_url(galleries,skin,w,h) {
121
- jQuery('#fb1_url0').val(url+galleries+skin);
122
- jQuery('#fb1_ifr0').val('<iframe src="' + url+galleries+skin + '" allowfullscreen allowtransparency frameborder="0" width="' + w + '" height="' + h + '"></iframe>');
123
- }
124
- function fb_url2(playlist,fieldset_id) {
125
- if(playlist){
126
- var w = jQuery('#gallerywidth' + fieldset_id).val();
127
- var h = jQuery('#galleryheight' + fieldset_id).val();
128
- jQuery('#fb' + fieldset_id + '_url0').val(url + playlist);
129
- jQuery('#fb' + fieldset_id + '_ifr0').val('<iframe src="' + url + playlist + '" allowfullscreen allowtransparency frameborder="0" width="' + w + '" height="' + h + '"></iframe>');
130
- } else{
131
- jQuery('#fb' + fieldset_id + '_url0').val(url);
132
- jQuery('#fb' + fieldset_id + '_ifr0').val('');
133
- }
134
- }
135
- /*]]>*/</script>
136
- <div class="flag-wrap">
137
- <h2><?php _e('Flagallery iFrame', 'flash-album-gallery'); ?></h2>
138
- <form id="flagframe_copy" name="flagframe_copy" method="POST" class="alignright">
139
- <p>Optional: &nbsp; <input type="submit" name="copy_file" class="button-primary" value="<?php _e('Copy flagframe.php file to root directory', 'flash-album-gallery'); ?>" /><br />
140
- (makes iframe url shorter)</p>
141
- </form>
142
- <form id="generator1"><fieldset style="clear:both; margin:0 0 20px 0; padding: 20px; border: 1px solid #888888;"><legend style="font-size: 18px; padding: 0 5px;"><?php _e("Photo Gallery iFrame Generator", 'flash-album-gallery'); ?></legend>
143
- <table border="0" cellpadding="4" cellspacing="0">
144
- <tr>
145
- <td nowrap="nowrap" valign="top"><div><?php _e("Select galleries", 'flash-album-gallery'); ?>:<span style="color:red;"> *</span><br /><small><?php _e("(album categories)", 'flash-album-gallery'); ?></small></div></td>
146
- <td valign="top"><div id="galleries" style="width: 214px; height: 160px; overflow: auto; white-space: nowrap;">
147
- <div class="row"><input type="checkbox" value="all" checked="checked" /> <strong><span style="display:inline-block; width:3em;">*</span> - <?php _e("all galleries", 'flash-album-gallery'); ?></strong></div>
148
- <?php
149
- $gallerylist = $flagdb->find_all_galleries($flag->options['albSort'], $flag->options['albSortDir']);
150
- if(is_array($gallerylist)) {
151
- foreach($gallerylist as $gallery) {
152
- $name = ( empty($gallery->title) ) ? $gallery->name : esc_html(stripslashes($gallery->title));
153
- echo '<div class="row"><input type="checkbox" value="' . $gallery->gid . '" /> <span><span style="display:inline-block; width:3em;">' . $gallery->gid . '</span> - ' . $name . '</span></div>' . "\n";
154
- }
155
- }
156
- ?>
157
- </div></td>
158
- </tr>
159
- <tr>
160
- <td nowrap="nowrap" valign="top"><p style="padding-top:3px;"><?php _e("Galleries order", 'flash-album-gallery'); ?>: &nbsp; </p></td>
161
- <td valign="top"><p><input readonly="readonly" type="text" id="items_array" value="all" style="width: 214px;" /></p></td>
162
- </tr>
163
- <tr>
164
- <td nowrap="nowrap" valign="top"><p style="padding-top:3px;"><label for="skinname"><?php _e("Choose skin", 'flash-album-gallery'); ?>:</label></p></td>
165
- <td valign="top"><p><select id="skinname" name="skinname" style="width: 214px;">
166
- <option value="" selected="selected"><?php _e("skin active by default", 'flash-album-gallery'); ?></option>
167
- <?php
168
- foreach ( (array)$i_skins as $skin_file => $skin_data) {
169
- echo '<option value="'.dirname($skin_file).'">'.$skin_data['Name'].'</option>'."\n";
170
- }
171
- ?>
172
- </select></p></td>
173
- </tr>
174
- <tr>
175
- <td valign="top"><p style="padding-top:3px;"><?php _e("iFrame size", 'flash-album-gallery'); ?>:<br /><span style="font-size:9px">(<?php _e("blank for default", 'flash-album-gallery'); ?>)</span></p></td>
176
- <td valign="top"><p><?php _e("width", 'flash-album-gallery'); ?>: <input id="gallerywidth" type="text" style="width: 50px" value="100%" /> &nbsp; <?php _e("height", 'flash-album-gallery'); ?>: <input id="galleryheight" type="text" style="width: 50px" value="500" /></p></td>
177
- </tr>
178
- <tr>
179
- <td valign="top"><div style="padding-top:3px;"><strong><?php _e("iFrame Url", 'flash-album-gallery'); ?>: &nbsp; </strong></div></td>
180
- <td valign="top"><input id="fb1_url0" type="text" style="width: 780px; font-size: 10px;" value="<?php echo $fb_url.'?i=all'; ?>" readonly /></td>
181
- </tr>
182
- <tr>
183
- <td valign="top"><div style="padding-top:3px;"><strong><?php _e("Embed iFrame code", 'flash-album-gallery'); ?>: &nbsp; </strong></div></td>
184
- <td valign="top"><textarea id="fb1_ifr0" style="width: 600px; height:60px; font-size: 12px;" readonly></textarea></td>
185
- </tr>
186
- </table>
187
- </fieldset></form>
188
- <form id="generator2"><fieldset style="padding: 20px; margin:0 0 20px 0; border: 1px solid #888888;"><legend style="font-size: 18px; padding: 0 5px;"><?php _e("mp3 Gallery iFrame Generator", 'flash-album-gallery'); ?></legend>
189
- <table border="0" cellpadding="4" cellspacing="0">
190
- <tr>
191
- <td nowrap="nowrap" valign="top"><p style="padding-top:3px;"><label><?php _e("Choose playlist", 'flash-album-gallery'); ?>:</label></p></td>
192
- <td valign="top"><p><select id="m_playlist" style="width: 214px;">
193
- <option value="" selected="selected"><?php _e('Choose playlist', 'flash-album-gallery'); ?></option>
194
- <?php
195
- foreach((array)$all_m_playlists as $playlist_file => $playlist_data) {
196
- $playlist_name = basename($playlist_file, '.xml');
197
- ?>
198
- <option value="<?php echo $playlist_name; ?>"><?php echo esc_html(stripslashes($playlist_data['title'])); ?></option>
199
- <?php
200
- }
201
- ?>
202
- </select></p></td>
203
- </tr>
204
- <tr>
205
- <td valign="top"><p style="padding-top:3px;"><?php _e("iFrame size", 'flash-album-gallery'); ?>:<br /><span style="font-size:9px">(<?php _e("blank for default", 'flash-album-gallery'); ?>)</span></p></td>
206
- <td valign="top"><p><?php _e("width", 'flash-album-gallery'); ?>: <input id="gallerywidth2" type="text" style="width: 50px" value="100%" /> &nbsp; <?php _e("height", 'flash-album-gallery'); ?>: <input id="galleryheight2" type="text" style="width: 50px" value="500" /></p></td>
207
- </tr>
208
- <tr>
209
- <td valign="top"><div style="padding-top:3px;"><strong><?php _e("iFrame Url", 'flash-album-gallery'); ?>: &nbsp; </strong></div></td>
210
- <td valign="top"><input id="fb2_url0" type="text" style="width: 600px; font-size: 10px;" value="<?php echo $fb_url.'?m='; ?>" readonly /></td>
211
- </tr>
212
- <tr>
213
- <td valign="top"><div style="padding-top:3px;"><strong><?php _e("Embed iFrame code", 'flash-album-gallery'); ?>: &nbsp; </strong></div></td>
214
- <td valign="top"><textarea id="fb2_ifr0" style="width: 600px; height:60px; font-size: 12px;" readonly></textarea></td>
215
- </tr>
216
- </table>
217
- </fieldset></form>
218
- <form id="generator3"><fieldset style="padding: 20px; margin:0 0 20px 0; border: 1px solid #888888;"><legend style="font-size: 18px; padding: 0 5px;"><?php _e("Video Blog Gallery iFrame Generator", 'flash-album-gallery'); ?></legend>
219
- <table border="0" cellpadding="4" cellspacing="0">
220
- <tr>
221
- <td nowrap="nowrap" valign="top"><p style="padding-top:3px;"><label><?php _e("Choose playlist", 'flash-album-gallery'); ?>:</label></p></td>
222
- <td valign="top"><p><select id="v_playlist" style="width: 214px;">
223
- <option value="" selected="selected"><?php _e('Choose playlist', 'flash-album-gallery'); ?></option>
224
- <?php
225
- foreach((array)$all_v_playlists as $playlist_file => $playlist_data) {
226
- $playlist_name = basename($playlist_file, '.xml');
227
- ?>
228
- <option value="<?php echo $playlist_name; ?>"><?php echo esc_html(stripslashes($playlist_data['title'])); ?></option>
229
- <?php
230
- }
231
- ?>
232
- </select></p></td>
233
- </tr>
234
- <tr>
235
- <td valign="top"><p style="padding-top:3px;"><?php _e("iFrame size", 'flash-album-gallery'); ?>:<br /><span style="font-size:9px">(<?php _e("blank for default", 'flash-album-gallery'); ?>)</span></p></td>
236
- <td valign="top"><p><?php _e("width", 'flash-album-gallery'); ?>: <input id="gallerywidth3" type="text" style="width: 50px" value="100%" /> &nbsp; <?php _e("height", 'flash-album-gallery'); ?>: <input id="galleryheight3" type="text" style="width: 50px" value="500" /></p></td>
237
- </tr>
238
- <tr>
239
- <td valign="top"><div style="padding-top:3px;"><strong><?php _e("iFrame Url", 'flash-album-gallery'); ?>: &nbsp; </strong></div></td>
240
- <td valign="top"><input id="fb3_url0" type="text" style="width: 600px; font-size: 10px;" value="<?php echo $fb_url.'?v='; ?>" readonly /></td>
241
- </tr>
242
- <tr>
243
- <td valign="top"><div style="padding-top:3px;"><strong><?php _e("Embed iFrame code", 'flash-album-gallery'); ?>: &nbsp; </strong></div></td>
244
- <td valign="top"><textarea id="fb3_ifr0" style="width: 600px; height:60px; font-size: 12px;" readonly</textarea></td>
245
- </tr>
246
- </table>
247
- </fieldset></form>
248
- <form id="generator4"><fieldset style="padding: 20px; margin:0 0 20px 0; border: 1px solid #888888;"><legend style="font-size: 18px; padding: 0 5px;"><?php _e("Banner Box iFrame Generator", 'flash-album-gallery'); ?></legend>
249
- <table border="0" cellpadding="4" cellspacing="0">
250
- <tr>
251
- <td nowrap="nowrap" valign="top"><p style="padding-top:3px;"><label><?php _e("Choose xml", 'flash-album-gallery'); ?>:</label></p></td>
252
- <td valign="top"><p><select id="b_playlist" style="width: 214px;">
253
- <option value="" selected="selected"><?php _e('Choose XML', 'flash-album-gallery'); ?></option>
254
- <?php
255
- foreach((array)$all_b_playlists as $playlist_file => $playlist_data) {
256
- $playlist_name = basename($playlist_file, '.xml');
257
- ?>
258
- <option value="<?php echo $playlist_name; ?>"><?php echo esc_html(stripslashes($playlist_data['title'])); ?></option>
259
- <?php
260
- }
261
- ?>
262
- </select></p></td>
263
- </tr>
264
- <tr>
265
- <td valign="top"><p style="padding-top:3px;"><?php _e("iFrame size", 'flash-album-gallery'); ?>:<br /><span style="font-size:9px">(<?php _e("blank for default", 'flash-album-gallery'); ?>)</span></p></td>
266
- <td valign="top"><p><?php _e("width", 'flash-album-gallery'); ?>: <input id="gallerywidth4" type="text" style="width: 50px" value="100%" /> &nbsp; <?php _e("height", 'flash-album-gallery'); ?>: <input id="galleryheight4" type="text" style="width: 50px" value="500" /></p></td>
267
- </tr>
268
- <tr>
269
- <td valign="top"><div style="padding-top:3px;"><strong><?php _e("iFrame Url", 'flash-album-gallery'); ?>: &nbsp; </strong></div></td>
270
- <td valign="top"><input id="fb4_url0" type="text" style="width: 600px; font-size: 10px;" value="<?php echo $fb_url.'?b='; ?>" readonly /></td>
271
- </tr>
272
- <tr>
273
- <td valign="top"><div style="padding-top:3px;"><strong><?php _e("Embed iFrame code", 'flash-album-gallery'); ?>: &nbsp; </strong></div></td>
274
- <td valign="top"><textarea id="fb4_ifr0" style="width: 600px; height:60px; font-size: 12px;" readonly></textarea></td>
275
- </tr>
276
- </table>
277
- </fieldset></form>
278
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if ( preg_match( '#' . basename( __FILE__ ) . '#', $_SERVER['PHP_SELF'] ) ) {
2
+ die( 'You are not allowed to call this page directly.' );
3
+ }
4
+
5
+ // check for correct capability
6
+ if ( ! is_user_logged_in() ) {
7
+ die( '-1' );
8
+ }
9
+
10
+ // check for correct FlAG capability
11
+ if ( ! current_user_can( 'FlAG iFrame page' ) ) {
12
+ die( '-1' );
13
+ }
14
+
15
+ if ( isset( $_POST['copy_file'] ) ) {
16
+ if ( copy( FLAG_ABSPATH . 'flagframe.php', ABSPATH . 'flagframe.php' ) ) {
17
+ flagGallery::show_message( __( 'Success', 'flash-album-gallery' ) );
18
+ } else {
19
+ flagGallery::show_error( __( 'Failure', 'flash-album-gallery' ) );
20
+ }
21
+ }
22
+ global $flag, $flagdb;
23
+ require_once( dirname( __FILE__ ) . '/get_skin.php' );
24
+ require_once( dirname( __FILE__ ) . '/playlist.functions.php' );
25
+ require_once( dirname( __FILE__ ) . '/video.functions.php' );
26
+ require_once( dirname( __FILE__ ) . '/banner.functions.php' );
27
+ $i_skins = get_skins();
28
+ $all_m_playlists = get_playlists();
29
+ $all_v_playlists = get_v_playlists();
30
+ $all_b_playlists = get_b_playlists();
31
+ $fb_url = plugins_url() . '/flash-album-gallery/flagframe.php';
32
+ if ( file_exists( ABSPATH . 'flagframe.php' ) ) {
33
+ $fb_url = home_url() . '/flagframe.php';
34
+ }
35
+ ?>
36
+ <script type="text/javascript">/*<![CDATA[*/
37
+ var url = '<?php echo $fb_url; ?>';
38
+ jQuery(document).ready(function() {
39
+ jQuery('#galleries input[value="all"]').attr('checked', 'checked').parent().siblings('.row').find('input').removeAttr('checked');
40
+ jQuery('#items_array').val('all');
41
+ var galleries = '?i=' + jQuery('#items_array').val().split(',').join('_');
42
+ var skin = jQuery('#skinname option:selected').val();
43
+ if (skin) {
44
+ skin = '&f=' + skin;
45
+ }
46
+ else {
47
+ skin = '';
48
+ }
49
+ var w = jQuery('#gallerywidth').val();
50
+ var h = jQuery('#galleryheight').val();
51
+ fb_url(galleries, skin, w, h);
52
+ jQuery('#galleries :checkbox').click(function() {
53
+ var cur, arr, del;
54
+ if (jQuery(this).is(':checked')) {
55
+ cur = jQuery(this).val();
56
+ if (cur == 'all') {
57
+ jQuery(this).parent().siblings('.row').find('input').removeAttr('checked');
58
+ jQuery('#items_array').val(cur);
59
+ }
60
+ else {
61
+ jQuery('#galleries input[value="all"]').removeAttr('checked');
62
+ arr = jQuery('#items_array').val();
63
+ if (arr && arr != 'all') { del = ','; }
64
+ else {
65
+ arr = '';
66
+ del = '';
67
+ }
68
+ jQuery('#items_array').val(arr + del + cur);
69
+ }
70
+ }
71
+ else {
72
+ cur = jQuery(this).val();
73
+ arr = jQuery('#items_array').val().split(',');
74
+ arr = jQuery.grep(arr, function(a) { return a != cur; }).join(',');
75
+ if (arr) {
76
+ jQuery('#items_array').val(arr);
77
+ }
78
+ else {
79
+ jQuery('#galleries input[value="all"]').attr('checked', 'checked');
80
+ jQuery('#items_array').val('all');
81
+ }
82
+ }
83
+ galleries = '?i=' + jQuery('#items_array').val().split(',').join('_');
84
+ skin = jQuery('#skinname option:selected').val();
85
+ if (skin) {
86
+ skin = '&f=' + skin;
87
+ }
88
+ else {
89
+ skin = '';
90
+ }
91
+ w = jQuery('#gallerywidth').val();
92
+ h = jQuery('#galleryheight').val();
93
+ fb_url(galleries, skin, w, h);
94
+ });
95
+ jQuery('#skinname').change(function() {
96
+ var skin = jQuery(this).val();
97
+ if (skin) {
98
+ skin = '&f=' + skin;
99
+ }
100
+ else {
101
+ skin = '';
102
+ }
103
+ galleries = '?i=' + jQuery('#items_array').val().split(',').join('_');
104
+ w = jQuery('#gallerywidth').val();
105
+ h = jQuery('#galleryheight').val();
106
+ fb_url(galleries, skin, w, h);
107
+ });
108
+ jQuery('#gallerywidth, #galleryheight').bind('keyup', function() {
109
+ var w = jQuery('#gallerywidth').val();
110
+ var h = jQuery('#galleryheight').val();
111
+ galleries = '?i=' + jQuery('#items_array').val().split(',').join('_');
112
+ skin = jQuery('#skinname option:selected').val();
113
+ if (skin) {
114
+ skin = '&f=' + skin;
115
+ }
116
+ else {
117
+ skin = '';
118
+ }
119
+ fb_url(galleries, skin, w, h);
120
+ });
121
+ jQuery('#m_playlist, #gallerywidth2, #galleryheight2').change(function() {
122
+ var playlist = jQuery('#m_playlist').val();
123
+ if (playlist) {
124
+ playlist = '?m=' + playlist;
125
+ }
126
+ else {
127
+ playlist = '';
128
+ }
129
+ fb_url2(playlist, 2);
130
+ });
131
+ jQuery('#v_playlist, #gallerywidth3, #galleryheight3').change(function() {
132
+ var playlist = jQuery('#v_playlist').val();
133
+ if (playlist) {
134
+ playlist = '?v=' + playlist;
135
+ }
136
+ else {
137
+ playlist = '';
138
+ }
139
+ fb_url2(playlist, 3);
140
+ });
141
+ jQuery('#b_playlist, #gallerywidth4, #galleryheight4').change(function() {
142
+ var playlist = jQuery('#b_playlist').val();
143
+ if (playlist) {
144
+ playlist = '?b=' + playlist;
145
+ }
146
+ else {
147
+ playlist = '';
148
+ }
149
+ fb_url2(playlist, 4);
150
+ });
151
+ });
152
+
153
+ function fb_url(galleries, skin, w, h) {
154
+ jQuery('#fb1_url0').val(url + galleries + skin);
155
+ jQuery('#fb1_ifr0').val('<iframe src="' + url + galleries + skin + '" allowfullscreen allowtransparency frameborder="0" width="' + w + '" height="' + h + '"></iframe>');
156
+ }
157
+
158
+ function fb_url2(playlist, fieldset_id) {
159
+ if (playlist) {
160
+ var w = jQuery('#gallerywidth' + fieldset_id).val();
161
+ var h = jQuery('#galleryheight' + fieldset_id).val();
162
+ jQuery('#fb' + fieldset_id + '_url0').val(url + playlist);
163
+ jQuery('#fb' + fieldset_id + '_ifr0').val('<iframe src="' + url + playlist + '" allowfullscreen allowtransparency frameborder="0" width="' + w + '" height="' + h + '"></iframe>');
164
+ }
165
+ else {
166
+ jQuery('#fb' + fieldset_id + '_url0').val(url);
167
+ jQuery('#fb' + fieldset_id + '_ifr0').val('');
168
+ }
169
+ }
170
+
171
+ /*]]>*/</script>
172
+ <div class="flag-wrap">
173
+ <h2><?php _e( 'Flagallery iFrame', 'flash-album-gallery' ); ?></h2>
174
+ <form id="flagframe_copy" name="flagframe_copy" method="POST" class="alignright">
175
+ <p>Optional: &nbsp; <input type="submit" name="copy_file" class="button-primary" value="<?php _e( 'Copy flagframe.php file to root directory', 'flash-album-gallery' ); ?>"/><br/>
176
+ (makes iframe url shorter)</p>
177
+ </form>
178
+ <form id="generator1">
179
+ <fieldset style="clear:both; margin:0 0 20px 0; padding: 20px; border: 1px solid #888888;">
180
+ <legend style="font-size: 18px; padding: 0 5px;"><?php _e( "Photo Gallery iFrame Generator", 'flash-album-gallery' ); ?></legend>
181
+ <table border="0" cellpadding="4" cellspacing="0">
182
+ <tr>
183
+ <td nowrap="nowrap" valign="top">
184
+ <div><?php _e( "Select galleries", 'flash-album-gallery' ); ?>:<span style="color:red;"> *</span><br/><small><?php _e( "(album categories)", 'flash-album-gallery' ); ?></small></div>
185
+ </td>
186
+ <td valign="top">
187
+ <div id="galleries" style="width: 214px; height: 160px; overflow: auto; white-space: nowrap;">
188
+ <div class="row"><input type="checkbox" value="all" checked="checked"/> <strong><span style="display:inline-block; width:3em;">*</span> - <?php _e( "all galleries", 'flash-album-gallery' ); ?></strong></div>
189
+ <?php
190
+ $gallerylist = $flagdb->find_all_galleries( $flag->options['albSort'], $flag->options['albSortDir'] );
191
+ if ( is_array( $gallerylist ) ) {
192
+ foreach ( $gallerylist as $gallery ) {
193
+ $name = ( empty( $gallery->title ) ) ? $gallery->name : esc_html( stripslashes( $gallery->title ) );
194
+ echo '<div class="row"><input type="checkbox" value="' . $gallery->gid . '" /> <span><span style="display:inline-block; width:3em;">' . $gallery->gid . '</span> - ' . $name . '</span></div>' . "\n";
195
+ }
196
+ }
197
+ ?>
198
+ </div>
199
+ </td>
200
+ </tr>
201
+ <tr>
202
+ <td nowrap="nowrap" valign="top"><p style="padding-top:3px;"><?php _e( "Galleries order", 'flash-album-gallery' ); ?>: &nbsp; </p></td>
203
+ <td valign="top"><p><input readonly="readonly" type="text" id="items_array" value="all" style="width: 214px;"/></p></td>
204
+ </tr>
205
+ <tr>
206
+ <td nowrap="nowrap" valign="top"><p style="padding-top:3px;"><label for="skinname"><?php _e( "Choose skin", 'flash-album-gallery' ); ?>:</label></p></td>
207
+ <td valign="top">
208
+ <p><select id="skinname" name="skinname" style="width: 214px;">
209
+ <option value="" selected="selected"><?php _e( "skin active by default", 'flash-album-gallery' ); ?></option>
210
+ <?php
211
+ foreach ( (array) $i_skins as $skin_file => $skin_data ) {
212
+ echo '<option value="' . dirname( $skin_file ) . '">' . $skin_data['Name'] . '</option>' . "\n";
213
+ }
214
+ ?>
215
+ </select></p>
216
+ </td>
217
+ </tr>
218
+ <tr>
219
+ <td valign="top"><p style="padding-top:3px;"><?php _e( "iFrame size", 'flash-album-gallery' ); ?>:<br/><span style="font-size:9px">(<?php _e( "blank for default", 'flash-album-gallery' ); ?>)</span></p></td>
220
+ <td valign="top"><p><?php _e( "width", 'flash-album-gallery' ); ?>: <input id="gallerywidth" type="text" style="width: 50px" value="100%"/> &nbsp; <?php _e( "height", 'flash-album-gallery' ); ?>: <input id="galleryheight" type="text" style="width: 50px" value="500"/></p></td>
221
+ </tr>
222
+ <tr>
223
+ <td valign="top">
224
+ <div style="padding-top:3px;"><strong><?php _e( "iFrame Url", 'flash-album-gallery' ); ?>: &nbsp; </strong></div>
225
+ </td>
226
+ <td valign="top"><input id="fb1_url0" type="text" style="width: 780px; font-size: 10px;" value="<?php echo $fb_url . '?i=all'; ?>" readonly/></td>
227
+ </tr>
228
+ <tr>
229
+ <td valign="top">
230
+ <div style="padding-top:3px;"><strong><?php _e( "Embed iFrame code", 'flash-album-gallery' ); ?>: &nbsp; </strong></div>
231
+ </td>
232
+ <td valign="top"><textarea id="fb1_ifr0" style="width: 600px; height:60px; font-size: 12px;" readonly></textarea></td>
233
+ </tr>
234
+ </table>
235
+ </fieldset>
236
+ </form>
237
+ <?php if ( ! empty( $flag->options['show_music_box'] ) ) { ?>
238
+ <form id="generator2">
239
+ <fieldset style="padding: 20px; margin:0 0 20px 0; border: 1px solid #888888;">
240
+ <legend style="font-size: 18px; padding: 0 5px;"><?php _e( "mp3 Gallery iFrame Generator", 'flash-album-gallery' ); ?></legend>
241
+ <table border="0" cellpadding="4" cellspacing="0">
242
+ <tr>
243
+ <td nowrap="nowrap" valign="top"><p style="padding-top:3px;"><label><?php _e( "Choose playlist", 'flash-album-gallery' ); ?>:</label></p></td>
244
+ <td valign="top">
245
+ <p><select id="m_playlist" style="width: 214px;">
246
+ <option value="" selected="selected"><?php _e( 'Choose playlist', 'flash-album-gallery' ); ?></option>
247
+ <?php
248
+ foreach ( (array) $all_m_playlists as $playlist_file => $playlist_data ) {
249
+ $playlist_name = basename( $playlist_file, '.xml' );
250
+ ?>
251
+ <option value="<?php echo $playlist_name; ?>"><?php echo esc_html( stripslashes( $playlist_data['title'] ) ); ?></option>
252
+ <?php
253
+ }
254
+ ?>
255
+ </select></p>
256
+ </td>
257
+ </tr>
258
+ <tr>
259
+ <td valign="top"><p style="padding-top:3px;"><?php _e( "iFrame size", 'flash-album-gallery' ); ?>:<br/><span style="font-size:9px">(<?php _e( "blank for default", 'flash-album-gallery' ); ?>)</span></p></td>
260
+ <td valign="top"><p><?php _e( "width", 'flash-album-gallery' ); ?>: <input id="gallerywidth2" type="text" style="width: 50px" value="100%"/> &nbsp; <?php _e( "height", 'flash-album-gallery' ); ?>: <input id="galleryheight2" type="text" style="width: 50px" value="500"/></p></td>
261
+ </tr>
262
+ <tr>
263
+ <td valign="top">
264
+ <div style="padding-top:3px;"><strong><?php _e( "iFrame Url", 'flash-album-gallery' ); ?>: &nbsp; </strong></div>
265
+ </td>
266
+ <td valign="top"><input id="fb2_url0" type="text" style="width: 600px; font-size: 10px;" value="<?php echo $fb_url . '?m='; ?>" readonly/></td>
267
+ </tr>
268
+ <tr>
269
+ <td valign="top">
270
+ <div style="padding-top:3px;"><strong><?php _e( "Embed iFrame code", 'flash-album-gallery' ); ?>: &nbsp; </strong></div>
271
+ </td>
272
+ <td valign="top"><textarea id="fb2_ifr0" style="width: 600px; height:60px; font-size: 12px;" readonly></textarea></td>
273
+ </tr>
274
+ </table>
275
+ </fieldset>
276
+ </form>
277
+ <?php } ?>
278
+ <?php if ( ! empty( $flag->options['show_video_box'] ) ) { ?>
279
+ <form id="generator3">
280
+ <fieldset style="padding: 20px; margin:0 0 20px 0; border: 1px solid #888888;">
281
+ <legend style="font-size: 18px; padding: 0 5px;"><?php _e( "Video Blog Gallery iFrame Generator", 'flash-album-gallery' ); ?></legend>
282
+ <table border="0" cellpadding="4" cellspacing="0">
283
+ <tr>
284
+ <td nowrap="nowrap" valign="top"><p style="padding-top:3px;"><label><?php _e( "Choose playlist", 'flash-album-gallery' ); ?>:</label></p></td>
285
+ <td valign="top">
286
+ <p><select id="v_playlist" style="width: 214px;">
287
+ <option value="" selected="selected"><?php _e( 'Choose playlist', 'flash-album-gallery' ); ?></option>
288
+ <?php
289
+ foreach ( (array) $all_v_playlists as $playlist_file => $playlist_data ) {
290
+ $playlist_name = basename( $playlist_file, '.xml' );
291
+ ?>
292
+ <option value="<?php echo $playlist_name; ?>"><?php echo esc_html( stripslashes( $playlist_data['title'] ) ); ?></option>
293
+ <?php
294
+ }
295
+ ?>
296
+ </select></p>
297
+ </td>
298
+ </tr>
299
+ <tr>
300
+ <td valign="top"><p style="padding-top:3px;"><?php _e( "iFrame size", 'flash-album-gallery' ); ?>:<br/><span style="font-size:9px">(<?php _e( "blank for default", 'flash-album-gallery' ); ?>)</span></p></td>
301
+ <td valign="top"><p><?php _e( "width", 'flash-album-gallery' ); ?>: <input id="gallerywidth3" type="text" style="width: 50px" value="100%"/> &nbsp; <?php _e( "height", 'flash-album-gallery' ); ?>: <input id="galleryheight3" type="text" style="width: 50px" value="500"/></p></td>
302
+ </tr>
303
+ <tr>
304
+ <td valign="top">
305
+ <div style="padding-top:3px;"><strong><?php _e( "iFrame Url", 'flash-album-gallery' ); ?>: &nbsp; </strong></div>
306
+ </td>
307
+ <td valign="top"><input id="fb3_url0" type="text" style="width: 600px; font-size: 10px;" value="<?php echo $fb_url . '?v='; ?>" readonly/></td>
308
+ </tr>
309
+ <tr>
310
+ <td valign="top">
311
+ <div style="padding-top:3px;"><strong><?php _e( "Embed iFrame code", 'flash-album-gallery' ); ?>: &nbsp; </strong></div>
312
+ </td>
313
+ <td valign="top"><textarea id="fb3_ifr0" style="width: 600px; height:60px; font-size: 12px;" readonly</textarea></td>
314
+ </tr>
315
+ </table>
316
+ </fieldset>
317
+ </form>
318
+ <?php } ?>
319
+ <?php if ( ! empty( $flag->options['show_banner_box'] ) ) { ?>
320
+ <form id="generator4">
321
+ <fieldset style="padding: 20px; margin:0 0 20px 0; border: 1px solid #888888;">
322
+ <legend style="font-size: 18px; padding: 0 5px;"><?php _e( "Banner Box iFrame Generator", 'flash-album-gallery' ); ?></legend>
323
+ <table border="0" cellpadding="4" cellspacing="0">
324
+ <tr>
325
+ <td nowrap="nowrap" valign="top"><p style="padding-top:3px;"><label><?php _e( "Choose xml", 'flash-album-gallery' ); ?>:</label></p></td>
326
+ <td valign="top">
327
+ <p><select id="b_playlist" style="width: 214px;">
328
+ <option value="" selected="selected"><?php _e( 'Choose XML', 'flash-album-gallery' ); ?></option>
329
+ <?php
330
+ foreach ( (array) $all_b_playlists as $playlist_file => $playlist_data ) {
331
+ $playlist_name = basename( $playlist_file, '.xml' );
332
+ ?>
333
+ <option value="<?php echo $playlist_name; ?>"><?php echo esc_html( stripslashes( $playlist_data['title'] ) ); ?></option>
334
+ <?php
335
+ }
336
+ ?>
337
+ </select></p>
338
+ </td>
339
+ </tr>
340
+ <tr>
341
+ <td valign="top"><p style="padding-top:3px;"><?php _e( "iFrame size", 'flash-album-gallery' ); ?>:<br/><span style="font-size:9px">(<?php _e( "blank for default", 'flash-album-gallery' ); ?>)</span></p></td>
342
+ <td valign="top"><p><?php _e( "width", 'flash-album-gallery' ); ?>: <input id="gallerywidth4" type="text" style="width: 50px" value="100%"/> &nbsp; <?php _e( "height", 'flash-album-gallery' ); ?>: <input id="galleryheight4" type="text" style="width: 50px" value="500"/></p></td>
343
+ </tr>
344
+ <tr>
345
+ <td valign="top">
346
+ <div style="padding-top:3px;"><strong><?php _e( "iFrame Url", 'flash-album-gallery' ); ?>: &nbsp; </strong></div>
347
+ </td>
348
+ <td valign="top"><input id="fb4_url0" type="text" style="width: 600px; font-size: 10px;" value="<?php echo $fb_url . '?b='; ?>" readonly/></td>
349
+ </tr>
350
+ <tr>
351
+ <td valign="top">
352
+ <div style="padding-top:3px;"><strong><?php _e( "Embed iFrame code", 'flash-album-gallery' ); ?>: &nbsp; </strong></div>
353
+ </td>
354
+ <td valign="top"><textarea id="fb4_ifr0" style="width: 600px; height:60px; font-size: 12px;" readonly></textarea></td>
355
+ </tr>
356
+ </table>
357
+ </fieldset>
358
+ </form>
359
+ <?php } ?>
360
+ </div>
admin/functions.php CHANGED
@@ -1,1458 +1,1459 @@
1
- <?php
2
-
3
- if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You are not allowed to call this page directly.'); }
4
-
5
- /**
6
- * flagAdmin - Class for admin operation
7
- */
8
- if ( ! class_exists( 'flagAdmin' ) ) {
9
- class flagAdmin{
10
-
11
- /**
12
- * create a new gallery & folder
13
- *
14
- * @class flagAdmin
15
- * @param string $gallery
16
- * @param string $defaultpath
17
- * @param bool $output if the function should show an error messsage or not
18
- * @return bool|int
19
- */
20
- public static function create_gallery($gallery, $defaultpath, $output = true) {
21
- global $wpdb, $user_ID;
22
-
23
- // get the current user ID
24
- wp_get_current_user();
25
-
26
- $description = '';
27
- $status = 0;
28
- if(is_array($gallery)){
29
- $gallerytitle = $gallery['title'];
30
- $description = $gallery['description'];
31
- $status = intval($gallery['status']);
32
- } else {
33
- $gallerytitle = $gallery;
34
- }
35
- //cleanup pathname
36
- $galleryname = sanitize_flagname( $gallerytitle );
37
- $galleryname = apply_filters('flag_gallery_name', $galleryname);
38
- $galleryname = preg_replace('/[^\w\._-]+/', '', $galleryname);
39
- if(!$galleryname) $galleryname = date('y-m-j_h-i-s');
40
-
41
- $flagpath = $defaultpath . $galleryname;
42
- $flagpath = trim($flagpath, '/');
43
- $flagRoot = WINABSPATH . $defaultpath;
44
- $txt = '';
45
-
46
- // No gallery name ?
47
- if (empty($galleryname)) {
48
- if ($output) flagGallery::show_error( __('No valid gallery name!', 'flash-album-gallery') );
49
- return false;
50
- }
51
-
52
- // check for main folder
53
- if ( !is_dir($flagRoot) ) {
54
- if ( !wp_mkdir_p( $flagRoot ) ) {
55
- $txt = __('Directory', 'flash-album-gallery').' <strong>' . $defaultpath . '</strong> '.__('didn\'t exist. Please create first the main gallery folder ', 'flash-album-gallery').'!<br />';
56
- $txt .= __('Check this link, if you didn\'t know how to set the permission :', 'flash-album-gallery').' <a href="http://codex.wordpress.org/Changing_File_Permissions">http://codex.wordpress.org/Changing_File_Permissions</a> ';
57
- if ($output) flagGallery::show_error($txt);
58
- return false;
59
- }
60
- }
61
-
62
- // check for permission settings, Safe mode limitations are not taken into account.
63
- if ( !is_writeable( $flagRoot ) ) {
64
- $txt = __('Directory', 'flash-album-gallery').' <strong>' . $defaultpath . '</strong> '.__('is not writeable !', 'flash-album-gallery').'<br />';
65
- $txt .= __('Check this link, if you didn\'t know how to set the permission :', 'flash-album-gallery').' <a href="http://codex.wordpress.org/Changing_File_Permissions">http://codex.wordpress.org/Changing_File_Permissions</a> ';
66
- if ($output) flagGallery::show_error($txt);
67
- return false;
68
- }
69
-
70
- // 1. Create new gallery folder
71
- if ( !is_dir(WINABSPATH . $flagpath) ) {
72
- if ( !wp_mkdir_p (WINABSPATH . $flagpath) )
73
- $txt = __('Unable to create directory ', 'flash-album-gallery').$flagpath.'!<br />';
74
- }
75
-
76
- // 2. Check folder permission
77
- if ( !is_writeable(WINABSPATH . $flagpath ) )
78
- $txt .= __('Directory', 'flash-album-gallery').' <strong>'.$flagpath.'</strong> '.__('is not writeable !', 'flash-album-gallery').'<br />';
79
-
80
- // 3. Now create "thumbs" folder inside
81
- if ( !is_dir(WINABSPATH . $flagpath . '/thumbs') ) {
82
- if ( !wp_mkdir_p ( WINABSPATH . $flagpath . '/thumbs') )
83
- $txt .= __('Unable to create directory ', 'flash-album-gallery').' <strong>' . $flagpath . '/thumbs !</strong>';
84
- }
85
-
86
- // 4. Now create "webview" folder inside
87
- if ( !is_dir(WINABSPATH . $flagpath . '/webview') ) {
88
- if ( !wp_mkdir_p ( WINABSPATH . $flagpath . '/webview') )
89
- $txt .= __('Unable to create directory ', 'flash-album-gallery').' <strong>' . $flagpath . '/webview !</strong>';
90
- }
91
-
92
- if (FLAG_SAFE_MODE) {
93
- $help = __('The server setting Safe-Mode is on !', 'flash-album-gallery');
94
- $help .= '<br />'.__('If you have problems, please create directory', 'flash-album-gallery').' <strong>' . $flagpath . '</strong> ';
95
- $help .= __('and the thumbnails directory', 'flash-album-gallery').' <strong>' . $flagpath . '/thumbs</strong> '.__('with permission 777 manually !', 'flash-album-gallery');
96
- if ($output) flagGallery::show_message($help);
97
- }
98
-
99
- // show an error message
100
- if ( !empty($txt) ) {
101
- if (FLAG_SAFE_MODE) {
102
- // for safe_mode , better delete folder, both folder must be created manually
103
- @rmdir(WINABSPATH . $flagpath . '/thumbs');
104
- @rmdir(WINABSPATH . $flagpath);
105
- }
106
- if ($output) flagGallery::show_error($txt);
107
- return false;
108
- }
109
-
110
- $result = $wpdb->get_var($wpdb->prepare("SELECT `name` FROM `{$wpdb->flaggallery}` WHERE `name` = '%s' ", $galleryname));
111
-
112
- if ($result) {
113
- if ($output) flagGallery::show_error( _n( 'Gallery', 'Galleries', 1, 'flash-album-gallery' ) .' <strong>' . $galleryname . '</strong> '.__('already exists', 'flash-album-gallery'));
114
- return true;
115
- } else {
116
- if(empty($user_ID)){
117
- $user_ID = $wpdb->get_var("SELECT ID FROM $wpdb->users ORDER BY ID");
118
- }
119
- $result = $wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->flaggallery (name, path, title, galdesc, author, status) VALUES (%s, %s, %s, %s, %s, %d)", $galleryname, $flagpath, $gallerytitle, $description, $user_ID, $status) );
120
- // and give me the new id
121
- $gallery_id = (int) $wpdb->insert_id;
122
- // here you can inject a custom function
123
- do_action('flag_created_new_gallery', $gallery_id);
124
-
125
- if ($result) {
126
- $message = __('Gallery \'%1$s\' successfully created.<br/>You can show this gallery with the tag %2$s.<br/>','flash-album-gallery');
127
- $message = sprintf($message, esc_html(stripcslashes($gallerytitle)), '[flagallery gid=' . $gallery_id . ']');
128
- $message .= '<a href="' . admin_url() . 'admin.php?page=flag-manage-gallery&mode=edit&gid=' . $gallery_id . '" >';
129
- $message .= __('Edit gallery','flash-album-gallery');
130
- $message .= '</a>';
131
-
132
- if ($output) flagGallery::show_message($message);
133
- }
134
- // return only the id if defined
135
- if ($gallery_id)
136
- return $gallery_id;
137
-
138
- return true;
139
- }
140
- }
141
-
142
- /**
143
- * flagAdmin::import_gallery()
144
- * TODO: Check permission of existing thumb folder & images
145
- *
146
- * @class flagAdmin
147
- * @param string $galleryfolder contains relative path
148
- * @return void
149
- */
150
- public static function import_gallery($galleryfolder) {
151
-
152
- global $wpdb, $user_ID;
153
-
154
- // get the current user ID
155
- wp_get_current_user();
156
-
157
- $created_msg = '';
158
-
159
- // remove trailing slashes, if somebody use it
160
- $galleryfolder = str_replace('../','', $galleryfolder );
161
- $galleryfolder = trim($galleryfolder, '/');
162
- $gallerypath = WINABSPATH . $galleryfolder;
163
-
164
- if (!is_dir($gallerypath)) {
165
- flagGallery::show_error(__('Directory', 'flash-album-gallery').' <strong>'.esc_html($gallerypath).'</strong> '.__('doesn&#96;t exist!', 'flash-album-gallery').' '.__('Or imported folder name contains special characters.', 'flash-album-gallery'));
166
- return ;
167
- }
168
-
169
- // read list of images
170
- $new_imageslist = flagAdmin::scandir($gallerypath);
171
- if (empty($new_imageslist)) {
172
- flagGallery::show_message(__('Directory', 'flash-album-gallery').' <strong>'.esc_html($gallerypath).'</strong> '.__('contains no pictures', 'flash-album-gallery'));
173
- return;
174
- }
175
-
176
- // check & create thumbnail folder
177
- if ( !flagGallery::create_thumbnail_folder($gallerypath) )
178
- return;
179
-
180
- // take folder name as gallery name
181
- $galleryname = basename($galleryfolder);
182
-
183
- // check for existing gallery folder
184
- $gallery_id = $wpdb->get_var($wpdb->prepare("SELECT gid FROM {$wpdb->flaggallery} WHERE path = '%s' ", $galleryfolder));
185
-
186
- if (!$gallery_id) {
187
- $result = $wpdb->query( $wpdb->prepare("INSERT INTO {$wpdb->flaggallery} (name, path, title, author) VALUES (%s, %s, %s, %s)", $galleryname, $galleryfolder, $galleryname , $user_ID) );
188
- if (!$result) {
189
- flagGallery::show_error(__('Database error. Could not add gallery!','flash-album-gallery'));
190
- return;
191
- }
192
- $created_msg = _n( 'Gallery', 'Galleries', 1, 'flash-album-gallery' ) . ' <strong>' . $galleryname . '</strong> ' . __('successfully created!','flash-album-gallery') . '<br />';
193
- $gallery_id = $wpdb->insert_id; // get index_id
194
- }
195
-
196
- // Look for existing image list
197
- $old_imageslist = $wpdb->get_col($wpdb->prepare("SELECT filename FROM {$wpdb->flagpictures} WHERE galleryid = %d ", $gallery_id));
198
-
199
- // if no images are there, create empty array
200
- if ($old_imageslist == NULL)
201
- $old_imageslist = array();
202
-
203
- // check difference
204
- $new_images = array_diff($new_imageslist, $old_imageslist);
205
-
206
- // all images must be valid files
207
- foreach($new_images as $key => $picture) {
208
- if (!@getimagesize($gallerypath . '/' . $picture) ) {
209
- unset($new_images[$key]);
210
- @unlink($gallerypath . '/' . $picture);
211
- }
212
- }
213
-
214
- // add images to database
215
- $image_ids = flagAdmin::add_Images($gallery_id, $new_images);
216
-
217
- //add the preview image if needed
218
- flagAdmin::set_gallery_preview ( $gallery_id );
219
-
220
- // now create thumbnails
221
- flagAdmin::do_ajax_operation( 'create_thumbnail' , $image_ids, __('Create new thumbnails','flash-album-gallery') );
222
-
223
- //TODO:Message will not shown, because AJAX routine require more time, message should be passed to AJAX
224
- flagGallery::show_message( $created_msg . count($image_ids) .__(' picture(s) successfully added','flash-album-gallery') );
225
-
226
- return;
227
-
228
- }
229
-
230
- /**
231
- * flagAdmin::import_video()
232
- *
233
- * @class flagAdmin
234
- * @param string $folder contains relative path
235
- * @return void
236
- */
237
- public static function import_video($folder) {
238
-
239
-
240
- $created_msg = '';
241
- // remove trailing slash at the end, if somebody use it
242
- $folder = str_replace(array('../','\'','"','<','>','$','%','='),'', $folder);
243
- $folder = rtrim($folder, '/');
244
- $path = WINABSPATH . $folder;
245
- if (!is_dir($path)) {
246
- echo '<p class="message">'.__('Directory', 'flash-album-gallery').' <strong>'.$path.'</strong> '.__('doesn&#96;t exist!', 'flash-album-gallery').' '.__('Or imported folder name contains special characters.', 'flash-album-gallery').'</p>';
247
- return ;
248
- }
249
- // read list of files
250
- $ext = array('mp4','ogg','webm','flv');
251
- $new_filelist = flagAdmin::scandir($path, $ext);
252
- if (empty($new_filelist)) {
253
- echo '<p class="message">'.__('Directory', 'flash-album-gallery').' <strong>'.$path.'</strong> '.__('does not contain video files', 'flash-album-gallery').'</p>';
254
- return;
255
- }
256
- $i=0;
257
- foreach($new_filelist as $key => $file) {
258
- //$new_filelist[$key] = $path . '/' . $file;
259
- $filename = $path . '/' . $file;
260
- $id = flagAdmin::handle_import_file($filename);
261
- if ( is_wp_error($id) ) {
262
- $created_msg .= '<p>' . sprintf(__('<em>%s</em> was <strong>not</strong> imported due to an error: %s', 'flash-album-gallery'), $file, $id->get_error_message() ) . '</p>';
263
- } else {
264
- $i++;
265
- $created_msg .= '<p>' . sprintf(__('<em>%s</em> has been added to Media library', 'flash-album-gallery'), $file) . '</p>';
266
- }
267
- }
268
- $created_msg .= '<p class="message">'.$i.__(' file(s) successfully added','flash-album-gallery').'</p><div class="hidden">'.$created_msg.'</div>';
269
- echo $created_msg;
270
- }
271
-
272
- /**
273
- * flagAdmin::import_mp3()
274
- *
275
- * @class flagAdmin
276
- * @param string $folder contains relative path
277
- * @return void
278
- */
279
- public static function import_mp3($folder) {
280
-
281
- $created_msg = '';
282
- // remove trailing slash at the end, if somebody use it
283
- $folder = str_replace(array('../','\'','"','<','>','$','%','='),'', $folder);
284
- $folder = rtrim($folder, '/');
285
- $path = WINABSPATH . $folder;
286
- if (!is_dir($path)) {
287
- echo '<p class="message">'.__('Directory', 'flash-album-gallery').' <strong>'.$path.'</strong> '.__('doesn&#96;t exist!', 'flash-album-gallery').' '.__('Or imported folder name contains special characters.', 'flash-album-gallery').'</p>';
288
- return ;
289
- }
290
- // read list of files
291
- $ext = array('mp3', 'ogg', 'wav');
292
- $new_filelist = flagAdmin::scandir($path, $ext);
293
- if (empty($new_filelist)) {
294
- echo '<p class="message">'.__('Directory', 'flash-album-gallery').' <strong>'.$path.'</strong> '.__('does not contain audio files', 'flash-album-gallery').'</p>';
295
- return;
296
- }
297
- $i=0;
298
- foreach($new_filelist as $key => $file) {
299
- //$new_filelist[$key] = $path . '/' . $file;
300
- $filename = $path . '/' . $file;
301
- $id = flagAdmin::handle_import_file($filename);
302
- if ( is_wp_error($id) ) {
303
- $created_msg .= '<p>' . sprintf(__('<em>%s</em> was <strong>not</strong> imported due to an error: %s', 'flash-album-gallery'), $file, $id->get_error_message() ) . '</p>';
304
- } else {
305
- $i++;
306
- $created_msg .= '<p>' . sprintf(__('<em>%s</em> has been added to Media library', 'flash-album-gallery'), $file) . '</p>';
307
- }
308
- }
309
- $created_msg .= '<p class="message">'.$i.__(' file(s) successfully added','flash-album-gallery').'</p><div class="hidden">'.$created_msg.'</div>';
310
- echo $created_msg;
311
- }
312
-
313
- /**
314
- * flagAdmin::import_banner()
315
- *
316
- * @class flagAdmin
317
- * @param string $folder contains relative path
318
- * @return array
319
- */
320
- public static function import_banner($folder) {
321
-
322
- $created_msg = '';
323
- // remove trailing slash at the end, if somebody use it
324
- $folder = str_replace(array('../','\'','"','<','>','$','%','='),'', $folder);
325
- $folder = rtrim($folder, '/');
326
- $path = WINABSPATH . $folder;
327
- if (!is_dir($path)) {
328
- echo '<p class="message">'.__('Directory', 'flash-album-gallery').' <strong>'.$path.'</strong> '.__('doesn&#96;t exist!', 'flash-album-gallery').' '.__('Or imported folder name contains special characters.', 'flash-album-gallery').'</p>';
329
- return false;
330
- }
331
- // read list of files
332
- $new_filelist = flagAdmin::scandir($path);
333
- if (empty($new_filelist)) {
334
- echo '<p class="message">'.__('Directory', 'flash-album-gallery').' <strong>'.$path.'</strong> '.__('does not contain image files', 'flash-album-gallery').'</p>';
335
- return false;
336
- }
337
- $created_msg .= '<div class="message"><p>'.count($new_filelist).' '.__('image(s) in the folder','flash-album-gallery').':</p><div class="flag_crunching"><div class="flag_progress"><span class="flag_complete"></span><span class="txt">'.__('Crunching...','flash-album-gallery').'</span></div></div></div>';
338
- echo $created_msg;
339
- return $new_filelist;
340
- }
341
-
342
- //Handle an individual file import.
343
- public static function handle_import_file($file, $post_id = 0) {
344
- set_time_limit(120);
345
- $time = current_time('mysql');
346
- if ( $post = get_post($post_id) ) {
347
- if ( substr( $post->post_date, 0, 4 ) > 0 )
348
- $time = $post->post_date;
349
- }
350
-
351
- // A writable uploads dir will pass this test. Again, there's no point overriding this one.
352
- if ( ! ( ( $uploads = wp_upload_dir($time) ) && false === $uploads['error'] ) )
353
- return new WP_Error($uploads['error']);
354
-
355
- $wp_filetype = wp_check_filetype( $file, null );
356
-
357
- /** @var $type
358
- * @var $ext */
359
- extract( $wp_filetype );
360
-
361
- if ( ( !$type || !$ext ) && !current_user_can( 'unfiltered_upload' ) )
362
- return new WP_Error('wrong_file_type', __( 'File type does not meet security guidelines. Try another.' ) ); //A WP-core string..
363
-
364
- $match = preg_match('|^' . preg_quote(str_replace('\\', '/', $uploads['basedir'])) . '(.*)$|i', $file, $mat);
365
- //Is the file allready in the uploads folder?
366
- if( $match ) {
367
-
368
- $filename = basename($file);
369
- $new_file = $file;
370
-
371
- $url = $uploads['baseurl'] . $mat[1];
372
-
373
- $attachment = get_posts(array( 'post_type' => 'attachment', 'meta_key' => '_wp_attached_file', 'meta_value' => $uploads['subdir'] . '/' . $filename ));
374
- if ( !empty($attachment) )
375
- return $attachment[0]->ID;
376
-
377
- //Ok, Its in the uploads folder, But NOT in WordPress's media library.
378
- if ( preg_match("|(\d+)/(\d+)|", $mat[1], $datemat) ) //So lets set the date of the import to the date folder its in, IF its in a date folder.
379
- $time = mktime(0, 0, 0, $datemat[2], 1, $datemat[1]);
380
- else //Else, set the date based on the date of the files time.
381
- $time = @filemtime($file);
382
-
383
- if ( $time ) {
384
- $post_date = date( 'Y-m-d H:i:s', $time);
385
- $post_date_gmt = gmdate( 'Y-m-d H:i:s', $time);
386
- }
387
- } else {
388
- $filename = wp_unique_filename( $uploads['path'], basename($file));
389
-
390
- // copy the file to the uploads dir
391
- $new_file = $uploads['path'] . '/' . $filename;
392
- if ( false === @copy( $file, $new_file ) ){
393
- wp_die(sprintf(__('The selected file could not be copied to %s.', 'flash-album-gallery'), $uploads['path']));
394
- }
395
-
396
- // Set correct file permissions
397
- $stat = stat( dirname( $new_file ));
398
- $perms = $stat['mode'] & 0000666;
399
- @ chmod( $new_file, $perms );
400
- // Compute the URL
401
- $url = $uploads['url'] . '/' . rawurlencode($filename);
402
- }
403
-
404
- // Compute the URL
405
- //Apply upload filters
406
- $return = apply_filters( 'wp_handle_upload', array( 'file' => $new_file, 'url' => $url, 'type' => $type ) );
407
- $new_file = $return['file'];
408
- $url = $return['url'];
409
- $type = $return['type'];
410
-
411
- $title = preg_replace('!\.[^.]+$!', '', basename($file));
412
- $content = '';
413
-
414
- // use image exif/iptc data for title and caption defaults if possible
415
- if ( $image_meta = @wp_read_image_metadata($new_file) ) {
416
- if ( '' != trim($image_meta['title']) )
417
- $title = trim($image_meta['title']);
418
- if ( '' != trim($image_meta['caption']) )
419
- $content = trim($image_meta['caption']);
420
- }
421
-
422
- if ( empty($post_date) )
423
- $post_date = current_time('mysql');
424
- if ( empty($post_date_gmt) )
425
- $post_date_gmt = current_time('mysql', 1);
426
-
427
- // Construct the attachment array
428
- $attachment = array(
429
- 'post_mime_type' => $type,
430
- 'guid' => $url,
431
- 'post_parent' => $post_id,
432
- 'post_title' => $title,
433
- 'post_name' => $title,
434
- 'post_content' => $content,
435
- 'post_date' => $post_date,
436
- 'post_date_gmt' => $post_date_gmt
437
- );
438
-
439
- // Save the data
440
- $id = wp_insert_attachment($attachment, $new_file, $post_id);
441
- if ( !is_wp_error($id) ) {
442
- $data = wp_generate_attachment_metadata( $id, $new_file );
443
- wp_update_attachment_metadata( $id, $data );
444
- if( !$match && isset($_POST['delete_files']) ) {
445
- @unlink($file);
446
- }
447
- }
448
-
449
- return $id;
450
- }
451
-
452
- /**
453
- * flagAdmin::scandir()
454
- *
455
- * @class flagAdmin
456
- * @param string $dirname
457
- * @param array $ext
458
- * @return array
459
- */
460
- public static function scandir($dirname = '.', $ext = array()) {
461
- // thx to php.net :-)
462
- if(empty($ext))
463
- $ext = array('jpeg', 'jpg', 'png', 'gif');
464
- $files = array();
465
- if($handle = opendir($dirname)) {
466
- while(false !== ($file = readdir($handle)))
467
- for($i=0;$i<sizeof($ext);$i++)
468
- if(stristr($file, '.' . $ext[$i]))
469
- $files[] = utf8_encode($file);
470
- closedir($handle);
471
- }
472
- sort($files);
473
- return ($files);
474
- }
475
-
476
- /**
477
- * flagAdmin::createThumbnail() - function to create or recreate a thumbnail
478
- *
479
- * @param object | int $image contain all information about the image or the id
480
- * @return string result code
481
- */
482
- public static function create_thumbnail($image) {
483
-
484
- global $flag;
485
-
486
- if ( is_numeric($image) )
487
- $image = flagdb::find_image( $image );
488
-
489
- if ( !is_object($image) )
490
- return __('Object didn\'t contain correct data','flash-album-gallery');
491
-
492
- $dest_path = dirname($image->webimagePath);
493
- if(!is_dir($dest_path)){
494
- flagGallery::create_webview_folder(dirname($image->imagePath));
495
- @chmod( $dest_path, 0755 );
496
- }
497
-
498
- if(! class_exists('flag_Thumbnail'))
499
- require_once( flagGallery::graphic_library() );
500
-
501
- // check for existing thumbnail
502
- if (file_exists($image->thumbPath))
503
- if (!is_writable($image->thumbPath))
504
- return $image->filename . __(' is not writeable ','flash-album-gallery');
505
-
506
- $thumb = new flag_Thumbnail($image->imagePath, TRUE);
507
- $img_size = @getimagesize ( $image->imagePath );
508
-
509
- // skip if file is not there
510
- if (!$thumb->error) {
511
- $thumb->resize($flag->options['thumbWidth'],$flag->options['thumbHeight']);
512
-
513
- // save the new thumbnail
514
- $thumb->save($image->thumbPath, $flag->options['thumbQuality']);
515
- flagAdmin::chmod ($image->thumbPath);
516
-
517
- //read the new sizes
518
- $new_size = @getimagesize ( $image->thumbPath );
519
- $size['width'] = $new_size[0];
520
- $size['height'] = $new_size[1];
521
-
522
- // add them to the database
523
- flagdb::update_image_meta($image->pid, array( 'thumbnail' => $size) );
524
- }
525
-
526
- $thumb->destruct();
527
-
528
- if ( !empty($thumb->errmsg) )
529
- return $image->filename . ' (Error : '.$thumb->errmsg .')';
530
-
531
- do_action('flag_thumbnail_created', $image);
532
-
533
- flagAdmin::webview_image($image);
534
-
535
- // success
536
- return '1';
537
- }
538
-
539
- /**
540
- * flagAdmin::resize_image() - create a new image, based on the height /width
541
- *
542
- * @class flagAdmin
543
- * @param object | int $image contain all information about the image or the id
544
- * @param integer $width optional
545
- * @param integer $height optional
546
- * @return string result code
547
- */
548
- public static function resize_image($image, $width = 0, $height = 0) {
549
-
550
- global $flag;
551
-
552
- if(! class_exists('flag_Thumbnail'))
553
- require_once( flagGallery::graphic_library() );
554
-
555
- if ( is_numeric($image) )
556
- $image = flagdb::find_image( $image );
557
-
558
- if ( !is_object($image) )
559
- return __('Object didn\'t contain correct data','flash-album-gallery');
560
-
561
- // before we start we import the meta data to database (required for uploads before V0.40)
562
- flagAdmin::maybe_import_meta( $image->pid );
563
-
564
- // if no parameter is set, take global settings
565
- $width = ($width == 0) ? $flag->options['imgWidth'] : $width;
566
- $height = ($height == 0) ? $flag->options['imgHeight'] : $height;
567
-
568
- if (!is_writable($image->imagePath))
569
- return ' <strong>' . $image->filename . __(' is not writeable','flash-album-gallery') . '</strong>';
570
-
571
- $file = new flag_Thumbnail($image->imagePath, TRUE);
572
-
573
- // skip if file is not there
574
- if (!$file->error) {
575
- $file->resize($width, $height, 4);
576
- $file->save($image->imagePath, $flag->options['imgQuality']);
577
- // read the new sizes
578
- $size = @getimagesize ( $image->imagePath );
579
- // add them to the database
580
- flagdb::update_image_meta($image->pid, array( 'width' => $size[0], 'height' => $size[1] ) );
581
- $file->destruct();
582
- } else {
583
- $file->destruct();
584
- return ' <strong>' . $image->filename . ' (Error : ' . $file->errmsg . ')</strong>';
585
- }
586
-
587
- do_action('flag_image_resized', $image);
588
-
589
- return '1';
590
- }
591
-
592
- /**
593
- * flagAdmin::webview_image() - create a new image, based on the height /width
594
- *
595
- * @class flagAdmin
596
- *
597
- * @param object | int $image contain all information about the image or the id
598
- * @param bool $return_size
599
- *
600
- * @return string result code
601
- */
602
- public static function webview_image($image, $return_size = false) {
603
-
604
- global $flag;
605
-
606
- if ( is_numeric($image) )
607
- $image = flagdb::find_image( $image );
608
-
609
- if ( !is_object($image) )
610
- return __('Object didn\'t contain correct data','flash-album-gallery');
611
-
612
- $img_size = @getimagesize ( $image->imagePath );
613
- $webviewsize = '0';
614
- $dest_path = dirname($image->webimagePath);
615
- if(flagGallery::create_webview_folder(dirname($image->imagePath))){
616
- if (! is_writable( $dest_path ) ) {
617
- @chmod( $dest_path, 0755 );
618
- }
619
-
620
- if (file_exists($image->webimagePath)){
621
- $webviewsize = @getimagesize ( $image->webimagePath );
622
- flagdb::update_image_meta($image->pid, array( 'webview' => $webviewsize) );
623
- if($return_size){
624
- return $webviewsize;
625
- } else {
626
- return '1';
627
- }
628
- }
629
-
630
- $imgquality = $flag->options['imgQuality'];
631
- $max_width = ($img_size[0] < 2000)? $img_size[0] : 2000;
632
- $max_height = ($img_size[1] < 2000)? $img_size[1] : 2000;
633
- if( function_exists('wp_get_image_editor') ) {
634
- $editor = wp_get_image_editor( $image->imagePath );
635
- if ( ! is_wp_error( $editor ) ) {
636
- $editor->set_quality( $imgquality );
637
- $editor->resize( $max_width, $max_height, 0 );
638
- $saved = $editor->save( $image->webimagePath );
639
- if($saved['path'] !== $image->webimagePath) {
640
- @rename($saved['path'], $image->webimagePath);
641
- }
642
- if(@filesize($image->webimagePath) > @filesize($image->imagePath)) {
643
- @copy($image->imagePath, $image->webimagePath);
644
- }
645
- $webviewsize = @getimagesize ( $image->webimagePath );
646
- flagdb::update_image_meta($image->pid, array( 'webview' => $webviewsize) );
647
-
648
- do_action('flag_image_optimized', $image);
649
- }
650
- }
651
- }
652
-
653
- if($return_size){
654
- return $webviewsize;
655
- } else {
656
- return '1';
657
- }
658
- }
659
-
660
- /**
661
- * Add images to database
662
- *
663
- * @class flagAdmin
664
- * @param int $galleryID
665
- * @param array $imageslist
666
- * @param bool $name2alt
667
- * @return array $image_ids Id's which are sucessful added
668
- */
669
- public static function add_Images($galleryID, $imageslist, $name2alt = false) {
670
- global $wpdb;
671
-
672
- $alttext = '';
673
- $image_ids = array();
674
-
675
- if ( is_array($imageslist) ) {
676
- foreach($imageslist as $picture) {
677
- if($name2alt) {
678
- // strip off the extension of the filename
679
- $path_parts = pathinfo( $picture );
680
- $alttext = ( !isset($path_parts['filename']) ) ? substr($path_parts['basename'], 0,strpos($path_parts['basename'], '.')) : $path_parts['filename'];
681
- }
682
- // save it to the database
683
- $result = $wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->flagpictures (galleryid, filename, alttext, exclude) VALUES (%s, %s, %s, 0)", $galleryID, $picture, $alttext) );
684
- // and give me the new id
685
- $pic_id = (int) $wpdb->insert_id;
686
- if ($result)
687
- $image_ids[] = $pic_id;
688
-
689
- // add the metadata
690
- flagAdmin::import_MetaData($pic_id);
691
-
692
- // action hook for post process after the image is added to the database
693
- $image = array( 'id' => $pic_id, 'filename' => $picture, 'galleryID' => $galleryID);
694
- do_action('flag_added_new_image', $image);
695
-
696
- }
697
- } // is_array
698
-
699
- return $image_ids;
700
-
701
- }
702
-
703
- /**
704
- * Import some metadata into the database (if avialable)
705
- *
706
- * @class flagAdmin
707
- * @param array|int $imagesIds
708
- * @return bool
709
- */
710
- public static function import_MetaData($imagesIds) {
711
-
712
- global $wpdb;
713
-
714
- require_once(FLAG_ABSPATH . 'lib/image.php');
715
-
716
- if (!is_array($imagesIds))
717
- $imagesIds = array($imagesIds);
718
-
719
- foreach($imagesIds as $imageID) {
720
- $image = flagdb::find_image($imageID);
721
- if (!$image->error) {
722
-
723
- $meta = flagAdmin::get_MetaData($image->pid);
724
-
725
- // get the title
726
- $alttext = empty( $meta['title'] ) ? $image->alttext : $meta['title'];
727
- // get the caption / description field
728
- $description = empty( $meta['caption'] ) ? $image->description : $meta['caption'];
729
- // get the file date/time from exif
730
- $timestamp = $meta['timestamp'];
731
- // update database
732
- $result = $wpdb->query( $wpdb->prepare("UPDATE $wpdb->flagpictures SET alttext = %s, description = %s, imagedate = %s WHERE pid = %d", $alttext, $description, $timestamp, $image->pid) );
733
- if ($result === false)
734
- return ' <strong>' . $image->filename . ' ' . __('(Error : Couldn\'t not update data base)', 'flash-album-gallery') . '</strong>';
735
-
736
- //this flag will inform us the import is already one time performed
737
- $meta['common']['saved'] = true;
738
- $result = flagdb::update_image_meta($image->pid, $meta['common']);
739
-
740
- if ($result === false)
741
- return ' <strong>' . $image->filename . ' ' . __('(Error : Couldn\'t not update meta data)', 'flash-album-gallery') . '</strong>';
742
- } else
743
- return ' <strong>' . $image->filename . ' ' . __('(Error : Couldn\'t not find image)', 'flash-album-gallery') . '</strong>';// error check
744
- }
745
-
746
- return '1';
747
-
748
- }
749
-
750
- /**
751
- * Copy some metadata into the image description (if avialable)
752
- *
753
- * @class flagAdmin
754
- * @param array|int $imagesIds
755
- * @return bool
756
- */
757
- public static function copy_MetaData($imagesIds) {
758
-
759
- global $wpdb;
760
-
761
- /** @var $meta */
762
- require_once(FLAG_ABSPATH . 'lib/meta.php');
763
- require_once(FLAG_ABSPATH . 'lib/image.php');
764
-
765
- if (!is_array($imagesIds))
766
- $imagesIds = array($imagesIds);
767
-
768
- foreach($imagesIds as $imageID) {
769
-
770
- $image = flagdb::find_image($imageID);
771
- if (!$image->error) {
772
- /** @var $makedescription
773
- * @var $timestamp */
774
- require_once(FLAG_ABSPATH . 'admin/grab_meta.php');
775
-
776
- // get the title
777
- $alttext = empty( $alttext ) ? $image->alttext : $meta['title'];
778
- if($alttext) $alttext = '<font size="16"><b>'.$alttext."</b></font>\n";
779
- // get the caption / description field
780
- $description = empty($description ) ? $image->description : $meta['caption'];
781
- if($description) $description = $description."<br>\n";
782
- // get the file date/time from exif
783
- $makedescription = $alttext.$description.$makedescription;
784
- // update database
785
- $result = $wpdb->query( $wpdb->prepare("UPDATE $wpdb->flagpictures SET alttext = %s, description = %s, imagedate = %s WHERE pid = %d", '', $makedescription, $timestamp, $image->pid) );
786
- if ($result === false)
787
- return ' <strong>' . $image->filename . ' ' . __('(Error : Couldn\'t not update data base)', 'flash-album-gallery') . '</strong>';
788
-
789
- } else
790
- return ' <strong>' . $image->filename . ' ' . __('(Error : Couldn\'t not find image)', 'flash-album-gallery') . '</strong>';// error check
791
- }
792
-
793
- return '1';
794
-
795
- }
796
-
797
- /**
798
- * flagAdmin::get_MetaData()
799
- *
800
- * @class flagAdmin
801
- * @require Meta class
802
- * @param $id
803
- * @return array metadata
804
- */
805
- public static function get_MetaData($id) {
806
-
807
- require_once(FLAG_ABSPATH . 'lib/meta.php');
808
-
809
- $meta = array();
810
-
811
- $pdata = new flagMeta( $id );
812
-
813
- $meta['title'] = trim ( $pdata->get_META('title') );
814
- $meta['caption'] = trim ( $pdata->get_META('caption') );
815
- $meta['keywords'] = trim ( $pdata->get_META('keywords') );
816
- $meta['timestamp'] = $pdata->get_date_time();
817
- // this contain other useful meta information
818
- $meta['common'] = $pdata->get_common_meta();
819
-
820
- return $meta;
821
-
822
- }
823
-
824
- /**
825
- * Maybe import some meta data to the database. The functions checks the flag 'saved'
826
- * and if based on compat reason (pre V0.40) we save then some meta datas to the database
827
- *
828
- * @param int $id
829
- * @return mixed result
830
- */
831
- public static function maybe_import_meta( $id ) {
832
-
833
- require_once(FLAG_ABSPATH . 'lib/meta.php');
834
-
835
- $meta_obj = new flagMeta( $id );
836
-
837
- if ( $meta_obj->image->meta_data['saved'] != true ) {
838
- $common = $meta_obj->get_common_meta();
839
- //this flag will inform us that the import is already one time performed
840
- $common['saved'] = true;
841
- $result = flagdb::update_image_meta($id, $common);
842
- } else
843
- return false;
844
-
845
- return $result;
846
-
847
- }
848
-
849
- /**
850
- * flagAdmin::getOnlyImages()
851
- *
852
- * @class flagAdmin
853
- * @param mixed $p_event
854
- * @param mixed $p_header
855
- * @return bool
856
- */
857
- public static function getOnlyImages($p_event, $p_header) {
858
-
859
- $info = pathinfo($p_header['filename']);
860
- // check for extension
861
- $ext = array('jpeg', 'jpg', 'png', 'gif');
862
- if ( in_array( strtolower($info['extension']), $ext) ) {
863
- // For MAC skip the ".image" files
864
- if ($info['basename']{0} == '.' )
865
- return 0;
866
- else
867
- return 1;
868
- }
869
- // ----- all other files are skipped
870
- else {
871
- return 0;
872
- }
873
- }
874
-
875
- /**
876
- * Function for uploading of images via the upload form
877
- *
878
- * @class flagAdmin
879
- * @return void
880
- */
881
- public static function upload_images() {
882
-
883
- global $wpdb;
884
-
885
- // WPMU action
886
- if (flagAdmin::check_quota())
887
- return;
888
-
889
- // Images must be an array
890
- $imageslist = array();
891
-
892
- // get selected gallery
893
- $galleryID = (int) $_POST['galleryselect'];
894
-
895
- if ($galleryID == 0) {
896
- flagGallery::show_error(__('No gallery selected !','flash-album-gallery'));
897
- return;
898
- }
899
-
900
- // get the path to the gallery
901
- $gallery = flagdb::find_gallery($galleryID);
902
-
903
- if ( empty($gallery->path) ){
904
- flagGallery::show_error(__('Failure in database, no gallery path set !','flash-album-gallery'));
905
- return;
906
- }
907
-
908
- // read list of images
909
- $dirlist = flagAdmin::scandir(WINABSPATH.$gallery->path);
910
-
911
- $imagefiles = $_FILES['imagefiles'];
912
-
913
- if (is_array($imagefiles)) {
914
- foreach ($imagefiles['name'] as $key => $value) {
915
-
916
- // look only for uploded files
917
- if ($imagefiles['error'][$key] == 0) {
918
-
919
- $temp_file = $imagefiles['tmp_name'][$key];
920
-
921
- //clean filename and extract extension
922
- $filepart = flagGallery::fileinfo( $imagefiles['name'][$key] );
923
- $filename = sanitize_title($filepart['filename']) . '.' . $filepart['extension'];
924
-
925
- // check for allowed extension and if it's an image file
926
- $ext = array('jpg', 'jpeg', 'png', 'gif');
927
- if ( !in_array(strtolower($filepart['extension']), $ext) || !@getimagesize($temp_file) ){
928
- flagGallery::show_error('<strong>' . $imagefiles['name'][$key] . ' </strong>' . __('is no valid image file!','flash-album-gallery'));
929
- continue;
930
- }
931
-
932
- // check if this filename already exist in the folder
933
- $i = 0;
934
- while ( in_array( $filename, $dirlist ) ) {
935
- $filename = $filepart['filename'] . '_' . $i++ . '.' .$filepart['extension'];
936
- }
937
-
938
- $dest_file = $gallery->abspath . '/' . $filename;
939
-
940
- //check for folder permission
941
- if ( !is_writeable($gallery->abspath) ) {
942
- $message = sprintf(__('Unable to write to directory %s. Is this directory writable by the server?', 'flash-album-gallery'), $gallery->abspath);
943
- flagGallery::show_error($message);
944
- return;
945
- }
946
-
947
- // save temp file to gallery
948
- if ( !@move_uploaded_file($temp_file, $dest_file) ){
949
- if( !file_exists($dest_file)){
950
- flagGallery::show_error(__('Error, the file could not moved to : ','flash-album-gallery') . $dest_file);
951
- flagAdmin::check_safemode( $gallery->abspath );
952
- continue;
953
- }
954
- }
955
- if ( !flagAdmin::chmod($dest_file) ) {
956
- flagGallery::show_error(__('Error, the file permissions could not set','flash-album-gallery'));
957
- continue;
958
- }
959
-
960
- // add to imagelist & dirlist
961
- $imageslist[] = $filename;
962
- $dirlist[] = $filename;
963
- }
964
- }
965
- }
966
-
967
- if (count($imageslist) > 0) {
968
-
969
- // add images to database
970
- $image_ids = flagAdmin::add_Images($galleryID, $imageslist);
971
-
972
- //create thumbnails
973
- flagAdmin::do_ajax_operation( 'create_thumbnail' , $image_ids, __('Create new thumbnails','flash-album-gallery') );
974
- //add the preview image if needed
975
- flagAdmin::set_gallery_preview ( $galleryID );
976
-
977
- flagGallery::show_message( count($image_ids) . __(' Image(s) successfully added','flash-album-gallery'));
978
- }
979
-
980
- return;
981
-
982
- } // end function
983
-
984
- /**
985
- * Upload function will be called via the Flash uploader
986
- *
987
- * @class flagAdmin
988
- * @param integer $galleryID
989
- * @return string $result
990
- */
991
- static function swfupload_image($galleryID = 0) {
992
-
993
- global $wpdb, $flag;
994
-
995
- if ($galleryID == 0) {
996
- //@unlink($temp_file);
997
- return __('No gallery selected!','flash-album-gallery');
998
- }
999
-
1000
- // WPMU action
1001
- if (flagAdmin::check_quota())
1002
- return '0';
1003
-
1004
- // Check the upload
1005
- if (!isset($_FILES['file']) || !is_uploaded_file($_FILES["file"]["tmp_name"]) || $_FILES["file"]["error"] === UPLOAD_ERR_OK)
1006
- flagAdmin::file_upload_error_message($_FILES['file']['error']);
1007
-
1008
- // get the filename and extension
1009
- $temp_file = $_FILES["file"]['tmp_name'];
1010
-
1011
- $filepart = flagGallery::fileinfo( $_FILES['file']['name'] );
1012
- $filename = sanitize_title($filepart['filename']) . '.' . $filepart['extension'];
1013
-
1014
- // check for allowed extension
1015
- $ext = array('jpeg', 'jpg', 'png', 'gif');
1016
- if (!in_array(strtolower($filepart['extension']), $ext)){
1017
- if(!@getimagesize($temp_file))
1018
- return $filename . ' '. __('is no valid image file!','flash-album-gallery');
1019
- }
1020
-
1021
- // get the path to the gallery
1022
- $gallerypath = $wpdb->get_var($wpdb->prepare("SELECT path FROM {$wpdb->flaggallery} WHERE gid = %d ", $galleryID));
1023
- if (!$gallerypath){
1024
- @unlink($temp_file);
1025
- return __('Failure in database, no gallery path set !','flash-album-gallery');
1026
- }
1027
-
1028
- // read list of images
1029
- $imageslist = flagAdmin::scandir( WINABSPATH.$gallerypath );
1030
-
1031
- // check if this filename already exist
1032
- $i = 0;
1033
- while (in_array($filename,$imageslist)) {
1034
- $filename = sanitize_title($filepart['filename']) . '_' . $i++ . '.' . $filepart['extension'];
1035
- }
1036
-
1037
- $dest_file = WINABSPATH . $gallerypath . '/' . $filename;
1038
-
1039
- // save temp file to gallery
1040
- if ( !@move_uploaded_file($temp_file, $dest_file) ){
1041
- if( !file_exists($dest_file)){
1042
- flagAdmin::check_safemode(WINABSPATH.$gallerypath);
1043
- return __('Error, the file could not moved to : ','flash-album-gallery').$dest_file;
1044
- }
1045
- }
1046
-
1047
- if ( !flagAdmin::chmod($dest_file) )
1048
- return __('Error, the file permissions could not set','flash-album-gallery');
1049
-
1050
- require_once(ABSPATH . 'wp-admin/includes/image.php');
1051
- $angle = 0;
1052
- $image_meta = wp_read_image_metadata($dest_file);
1053
- if(!empty($image_meta['orientation'])){
1054
- switch($image_meta['orientation']){
1055
- case 3:
1056
- $angle = 180;
1057
- break;
1058
- case 6:
1059
- $angle = 270;
1060
- break;
1061
- case 8:
1062
- $angle = 90;
1063
- break;
1064
- }
1065
- }
1066
- if($angle){
1067
- $editor = wp_get_image_editor($dest_file);
1068
- if(!is_wp_error($editor)){
1069
- $editor->rotate($angle);
1070
- $editor->set_quality(90);
1071
- $editor->save($dest_file);
1072
- }
1073
- }
1074
-
1075
- // add images to database
1076
- $image_ids = flagAdmin::add_Images($galleryID, array($filename));
1077
- $return = '';
1078
- //create thumbnails
1079
-
1080
- //save the thumb size values
1081
- $flag->options['thumbWidth'] = intval($_POST['thumbw'])? intval($_POST['thumbw']) : 300;
1082
- $flag->options['thumbHeight'] = intval($_POST['thumbh'])? intval($_POST['thumbh']) : 300;
1083
- update_option('flag_options', $flag->options);
1084
-
1085
- foreach($image_ids as $picture){
1086
- $return = flagAdmin::create_thumbnail($picture);
1087
- }
1088
- //add the preview image if needed
1089
- if(intval($_POST['last']) == 1)
1090
- flagAdmin::set_gallery_preview ( $galleryID );
1091
-
1092
- return (intval($return) == 1)? '' : $return;
1093
-
1094
- }
1095
-
1096
- /**
1097
- * File upload error message
1098
- *
1099
- * @class flagAdmin
1100
- * @param $error_code
1101
- * @return string $result
1102
- */
1103
- public static function file_upload_error_message($error_code) {
1104
- switch ($error_code) {
1105
- case UPLOAD_ERR_INI_SIZE:
1106
- return __('The uploaded file exceeds the upload_max_filesize directive in php.ini','flash-album-gallery');
1107
- case UPLOAD_ERR_FORM_SIZE:
1108
- return __('The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form','flash-album-gallery');
1109
- case UPLOAD_ERR_PARTIAL:
1110
- return __('The uploaded file was only partially uploaded','flash-album-gallery');
1111
- case UPLOAD_ERR_NO_FILE:
1112
- return __('No file was uploaded','flash-album-gallery');
1113
- case UPLOAD_ERR_NO_TMP_DIR:
1114
- return __('Missing a temporary folder','flash-album-gallery');
1115
- case UPLOAD_ERR_CANT_WRITE:
1116
- return __('Failed to write file to disk','flash-album-gallery');
1117
- case UPLOAD_ERR_EXTENSION:
1118
- return __('File upload stopped by extension','flash-album-gallery');
1119
- default:
1120
- return __('Unknown upload error','flash-album-gallery');
1121
- }
1122
- }
1123
-
1124
- /**
1125
- * Check the Quota under WPMU. Only needed for this case
1126
- *
1127
- * @class flagAdmin
1128
- * @return bool $result
1129
- */
1130
- public static function check_quota() {
1131
-
1132
- if ( (IS_WPMU) && flagGallery::flag_wpmu_enable_function('wpmuQuotaCheck'))
1133
- if( $error = upload_is_user_over_quota( false ) ) {
1134
- flagGallery::show_error( __( 'Sorry, you have used your space allocation. Please delete some files to upload more files.','flash-album-gallery' ) );
1135
- return true;
1136
- }
1137
- return false;
1138
- }
1139
-
1140
- /**
1141
- * Set correct file permissions (taken from wp core)
1142
- *
1143
- * @class flagAdmin
1144
- * @param string $filename
1145
- * @return bool $result
1146
- */
1147
- public static function chmod($filename = '') {
1148
-
1149
- $stat = @ stat(dirname($filename));
1150
- $perms = $stat['mode'] & 0007777;
1151
- $perms = $perms & 0000666;
1152
- if ( @chmod($filename, $perms) )
1153
- return true;
1154
-
1155
- return false;
1156
- }
1157
-
1158
- /**
1159
- * Check UID in folder and Script
1160
- * Read http://www.php.net/manual/en/features.safe-mode.php to understand safe_mode
1161
- *
1162
- * @class flagAdmin
1163
- * @param string $foldername
1164
- * @return bool $result
1165
- */
1166
- public static function check_safemode($foldername) {
1167
-
1168
- if ( FLAG_SAFE_MODE ) {
1169
-
1170
- //$script_uid = ( ini_get('safe_mode_gid') ) ? getmygid() : getmyuid();
1171
- $script_uid = getmyuid();
1172
- $folder_uid = fileowner($foldername);
1173
-
1174
- if ($script_uid != $folder_uid) {
1175
- $message = sprintf(__('SAFE MODE Restriction in effect! You need to create the folder <strong>%s</strong> manually','flash-album-gallery'), $foldername);
1176
- $message .= '<br />' . sprintf(__('When safe_mode is on, PHP checks to see if the owner (%s) of the current script matches the owner (%s) of the file to be operated on by a file function or its directory','flash-album-gallery'), $script_uid, $folder_uid );
1177
- flagGallery::show_error($message);
1178
- return false;
1179
- }
1180
- }
1181
-
1182
- return true;
1183
- }
1184
-
1185
- /**
1186
- * Capability check. Check is the ID fit's to the user_ID
1187
- *
1188
- * @class flagAdmin
1189
- * @param int $check_ID is the user_id
1190
- * @return bool $result
1191
- */
1192
- public static function can_manage_this_gallery($check_ID) {
1193
-
1194
- global $user_ID, $wp_roles;
1195
-
1196
- if ( !current_user_can('FlAG Manage others gallery') ) {
1197
- // get the current user ID
1198
- wp_get_current_user();
1199
-
1200
- if ( $user_ID != $check_ID)
1201
- return false;
1202
- }
1203
- return true;
1204
- }
1205
-
1206
- /**
1207
- * Move images from one folder to another
1208
- *
1209
- * @param array|int $pic_ids ID's of the images
1210
- * @param int $dest_gid destination gallery
1211
- * @return void
1212
- */
1213
- public static function move_images($pic_ids, $dest_gid) {
1214
-
1215
- $errors = '';
1216
- $count = 0;
1217
-
1218
- if (!is_array($pic_ids))
1219
- $pic_ids = array($pic_ids);
1220
-
1221
- // Get destination gallery
1222
- $destination = flagdb::find_gallery( $dest_gid );
1223
- $dest_abspath = WINABSPATH . $destination->path;
1224
-
1225
- if ( $destination == null ) {
1226
- flagGallery::show_error(__('The destination gallery does not exist','flash-album-gallery'));
1227
- return;
1228
- }
1229
-
1230
- // Check for folder permission
1231
- if ( !is_writeable( $dest_abspath ) ) {
1232
- $message = sprintf(__('Unable to write to directory %s. Is this directory writable by the server?', 'flash-album-gallery'), $dest_abspath );
1233
- flagGallery::show_error($message);
1234
- return;
1235
- }
1236
-
1237
- // Get pictures
1238
- $images = flagdb::find_images_in_list($pic_ids);
1239
-
1240
- foreach ($images as $image) {
1241
-
1242
- $i = 0;
1243
- $tmp_prefix = '';
1244
-
1245
- $destination_file_name = $image->filename;
1246
- // check if the filename already exist, then we add a copy_ prefix
1247
- while (file_exists( $dest_abspath . '/' . $destination_file_name)) {
1248
- $tmp_prefix = 'copy_' . ($i++) . '_';
1249
- $destination_file_name = $tmp_prefix . $image->filename;
1250
- }
1251
-
1252
- $destination_path = $dest_abspath . '/' . $destination_file_name;
1253
- $destination_thumbnail = $dest_abspath . '/thumbs/thumbs_' . $destination_file_name;
1254
-
1255
- // Move files
1256
- if ( !@rename($image->imagePath, $destination_path) ) {
1257
- $errors .= sprintf(__('Failed to move image %1$s to %2$s','flash-album-gallery'),
1258
- '<strong>' . $image->filename . '</strong>', $destination_path) . '<br />';
1259
- continue;
1260
- }
1261
-
1262
- // Move the thumbnail, if possible
1263
- @rename($image->thumbPath, $destination_thumbnail);
1264
-
1265
- // Change the gallery id in the database , maybe the filename
1266
- if ( flagdb::update_image($image->pid, $dest_gid, $destination_file_name) )
1267
- $count++;
1268
-
1269
- }
1270
-
1271
- if ( $errors != '' )
1272
- flagGallery::show_error($errors);
1273
-
1274
- $link = '<a href="' . admin_url() . 'admin.php?page=flag-manage-gallery&mode=edit&gid=' . $destination->gid . '" >' . $destination->title . '</a>';
1275
- $messages = sprintf(__('Moved %1$s picture(s) to gallery : %2$s .','flash-album-gallery'), $count, $link);
1276
- flagGallery::show_message($messages);
1277
-
1278
- return;
1279
- }
1280
-
1281
- /**
1282
- * Copy images to another gallery
1283
- *
1284
- * @class flagAdmin
1285
- * @param array|int $pic_ids ID's of the images
1286
- * @param int $dest_gid destination gallery
1287
- * @return void
1288
- */
1289
- public static function copy_images($pic_ids, $dest_gid) {
1290
-
1291
- $errors = $messages = '';
1292
-
1293
- if (!is_array($pic_ids))
1294
- $pic_ids = array($pic_ids);
1295
-
1296
- // Get destination gallery
1297
- $destination = flagdb::find_gallery( $dest_gid );
1298
- if ( $destination == null ) {
1299
- flagGallery::show_error(__('The destination gallery does not exist','flash-album-gallery'));
1300
- return;
1301
- }
1302
-
1303
- // Check for folder permission
1304
- if (!is_writeable(WINABSPATH.$destination->path)) {
1305
- $message = sprintf(__('Unable to write to directory %s. Is this directory writable by the server?', 'flash-album-gallery'), WINABSPATH.$destination->path);
1306
- flagGallery::show_error($message);
1307
- return;
1308
- }
1309
-
1310
- // Get pictures
1311
- $images = flagdb::find_images_in_list($pic_ids);
1312
- $destination_path = WINABSPATH . $destination->path;
1313
-
1314
- foreach ($images as $image) {
1315
- // WPMU action
1316
- if ( flagAdmin::check_quota() )
1317
- return;
1318
-
1319
- $i = 0;
1320
- $tmp_prefix = '';
1321
- $destination_file_name = $image->filename;
1322
- while (file_exists($destination_path . '/' . $destination_file_name)) {
1323
- $tmp_prefix = 'copy_' . ($i++) . '_';
1324
- $destination_file_name = $tmp_prefix . $image->filename;
1325
- }
1326
-
1327
- $destination_file_path = $destination_path . '/' . $destination_file_name;
1328
- $destination_thumb_file_path = $destination_path . '/' . $image->thumbFolder . $image->thumbPrefix . $destination_file_name;
1329
-
1330
- // Copy files
1331
- if ( !@copy($image->imagePath, $destination_file_path) ) {
1332
- $errors .= sprintf(__('Failed to copy image %1$s to %2$s','flash-album-gallery'),
1333
- $image->filename, $destination_file_path) . '<br />';
1334
- continue;
1335
- }
1336
-
1337
- // Copy the thumbnail if possible
1338
- @copy($image->thumbPath, $destination_thumb_file_path);
1339
-
1340
- // Create new database entry for the image
1341
- $new_pid = flagdb::insert_image( $destination->gid, $destination_file_name, $image->alttext, $image->description, $image->exclude);
1342
-
1343
- if (!isset($new_pid)) {
1344
- $errors .= sprintf(__('Failed to copy database row for picture %s','flash-album-gallery'), $image->pid) . '<br />';
1345
- continue;
1346
- }
1347
-
1348
- if ( $tmp_prefix != '' ) {
1349
- $messages .= sprintf(__('Image %1$s (%2$s) copied as image %3$s (%4$s) &raquo; The file already existed in the destination gallery.','flash-album-gallery'),
1350
- $image->pid, $image->filename, $new_pid, $destination_file_name) . '<br />';
1351
- } else {
1352
- $messages .= sprintf(__('Image %1$s (%2$s) copied as image %3$s (%4$s)','flash-album-gallery'),
1353
- $image->pid, $image->filename, $new_pid, $destination_file_name) . '<br />';
1354
- }
1355
-
1356
- }
1357
-
1358
- // Finish by showing errors or success
1359
- if ( $errors == '' ) {
1360
- $link = '<a href="' . admin_url() . 'admin.php?page=flag-manage-gallery&mode=edit&gid=' . $destination->gid . '" >' . $destination->title . '</a>';
1361
- $messages .= '<hr />' . sprintf(__('Copied %1$s picture(s) to gallery: %2$s .','flash-album-gallery'), count($images), $link);
1362
- }
1363
-
1364
- if ( $messages != '' )
1365
- flagGallery::show_message($messages);
1366
-
1367
- if ( $errors != '' )
1368
- flagGallery::show_error($errors);
1369
-
1370
- return;
1371
- }
1372
-
1373
- /**
1374
- * Initate the Ajax operation
1375
- *
1376
- * @class flagAdmin
1377
- * @param string $operation name of the function which should be executed
1378
- * @param array $image_array
1379
- * @param string $title name of the operation
1380
- * @return string the javascript output
1381
- */
1382
- public static function do_ajax_operation( $operation, $image_array, $title = '' ) {
1383
-
1384
- if ( !is_array($image_array) || empty($image_array) )
1385
- return;
1386
-
1387
- $js_array = implode('","', $image_array);
1388
-
1389
- // send out some JavaScript, which initate the ajax operation
1390
- ?>
1391
- <script type="text/javascript">
1392
-
1393
- Images = new Array("<?php echo $js_array; ?>");
1394
-
1395
- flagAjaxOptions = {
1396
- operation: "<?php echo $operation; ?>",
1397
- ids: Images,
1398
- header: "<?php echo $title; ?>",
1399
- maxStep: Images.length
1400
- };
1401
-
1402
- jQuery(document).ready( function(){
1403
- flagProgressBar.init( flagAjaxOptions );
1404
- flagAjax.init( flagAjaxOptions );
1405
- } );
1406
- </script>
1407
-
1408
- <div id="progressbar_container" class="wrap"></div>
1409
-
1410
- <?php
1411
- }
1412
-
1413
- /**
1414
- * flagAdmin::set_gallery_preview() - define a preview pic after the first upload, can be changed in the gallery settings
1415
- *
1416
- * @class flagAdmin
1417
- * @param int $galleryID
1418
- * @return void
1419
- */
1420
- public static function set_gallery_preview( $galleryID ) {
1421
- global $wpdb;
1422
-
1423
- $galleryID = intval($galleryID);
1424
- $gallery = flagdb::find_gallery( $galleryID );
1425
-
1426
- // in the case no preview image is setup, we do this now
1427
- if ($gallery->previewpic == 0) {
1428
- $firstImage = $wpdb->get_var($wpdb->prepare("SELECT `pid` FROM `{$wpdb->flagpictures}` WHERE `exclude` != 1 AND `galleryid` = '%d' ORDER by `pid` DESC limit 0,1", $galleryID));
1429
- if ($firstImage) {
1430
- $wpdb->query($wpdb->prepare("UPDATE `{$wpdb->flaggallery}` SET `previewpic` = '%s' WHERE `gid` = '%d'", $firstImage, $galleryID));
1431
- wp_cache_delete($galleryID, 'flag_gallery');
1432
- }
1433
- }
1434
-
1435
- return;
1436
- }
1437
-
1438
- /**
1439
- * Return a JSON coded array of Image ids for a requested gallery
1440
- *
1441
- * @param int $galleryID
1442
- * @return array (JSON)
1443
- */
1444
- public static function get_image_ids( $galleryID ) {
1445
-
1446
- if ( !function_exists('json_encode') )
1447
- return(-2);
1448
-
1449
- $gallery = flagdb::get_ids_from_gallery($galleryID, 'pid', 'ASC', false);
1450
-
1451
- header('Content-Type: text/plain; charset=' . get_option('blog_charset'), true);
1452
- $output = json_encode($gallery);
1453
-
1454
- return $output;
1455
- }
1456
-
1457
- } // END class flagAdmin
1458
- }
 
1
+ <?php
2
+
3
+ if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You are not allowed to call this page directly.'); }
4
+
5
+ /**
6
+ * flagAdmin - Class for admin operation
7
+ */
8
+ if ( ! class_exists( 'flagAdmin' ) ) {
9
+ class flagAdmin{
10
+
11
+ /**
12
+ * create a new gallery & folder
13
+ *
14
+ * @class flagAdmin
15
+ * @param string $gallery
16
+ * @param string $defaultpath
17
+ * @param bool $output if the function should show an error messsage or not
18
+ * @return bool|int
19
+ */
20
+ public static function create_gallery($gallery, $defaultpath, $output = true) {
21
+ global $wpdb, $user_ID;
22
+
23
+ // get the current user ID
24
+ wp_get_current_user();
25
+
26
+ $description = '';
27
+ $status = 0;
28
+ if(is_array($gallery)){
29
+ $gallerytitle = $gallery['title'];
30
+ $description = $gallery['description'];
31
+ $status = intval($gallery['status']);
32
+ } else {
33
+ $gallerytitle = $gallery;
34
+ }
35
+ //cleanup pathname
36
+ $galleryname = sanitize_flagname( $gallerytitle );
37
+ $galleryname = apply_filters('flag_gallery_name', $galleryname);
38
+ $galleryname = preg_replace('/[^\w\._-]+/', '', $galleryname);
39
+ if(!$galleryname) $galleryname = date('y-m-j_h-i-s');
40
+
41
+ $flagpath = $defaultpath . $galleryname;
42
+ $flagpath = trim($flagpath, '/');
43
+ $flagRoot = WINABSPATH . $defaultpath;
44
+ $txt = '';
45
+
46
+ // No gallery name ?
47
+ if (empty($galleryname)) {
48
+ if ($output) flagGallery::show_error( __('No valid gallery name!', 'flash-album-gallery') );
49
+ return false;
50
+ }
51
+
52
+ // check for main folder
53
+ if ( !is_dir($flagRoot) ) {
54
+ if ( !wp_mkdir_p( $flagRoot ) ) {
55
+ $txt = __('Directory', 'flash-album-gallery').' <strong>' . $defaultpath . '</strong> '.__('didn\'t exist. Please create first the main gallery folder ', 'flash-album-gallery').'!<br />';
56
+ $txt .= __('Check this link, if you didn\'t know how to set the permission :', 'flash-album-gallery').' <a href="http://codex.wordpress.org/Changing_File_Permissions">http://codex.wordpress.org/Changing_File_Permissions</a> ';
57
+ if ($output) flagGallery::show_error($txt);
58
+ return false;
59
+ }
60
+ }
61
+
62
+ // check for permission settings, Safe mode limitations are not taken into account.
63
+ if ( !is_writeable( $flagRoot ) ) {
64
+ $txt = __('Directory', 'flash-album-gallery').' <strong>' . $defaultpath . '</strong> '.__('is not writeable !', 'flash-album-gallery').'<br />';
65
+ $txt .= __('Check this link, if you didn\'t know how to set the permission :', 'flash-album-gallery').' <a href="http://codex.wordpress.org/Changing_File_Permissions">http://codex.wordpress.org/Changing_File_Permissions</a> ';
66
+ if ($output) flagGallery::show_error($txt);
67
+ return false;
68
+ }
69
+
70
+ // 1. Create new gallery folder
71
+ if ( !is_dir(WINABSPATH . $flagpath) ) {
72
+ if ( !wp_mkdir_p (WINABSPATH . $flagpath) )
73
+ $txt = __('Unable to create directory ', 'flash-album-gallery').$flagpath.'!<br />';
74
+ }
75
+
76
+ // 2. Check folder permission
77
+ if ( !is_writeable(WINABSPATH . $flagpath ) )
78
+ $txt .= __('Directory', 'flash-album-gallery').' <strong>'.$flagpath.'</strong> '.__('is not writeable !', 'flash-album-gallery').'<br />';
79
+
80
+ // 3. Now create "thumbs" folder inside
81
+ if ( !is_dir(WINABSPATH . $flagpath . '/thumbs') ) {
82
+ if ( !wp_mkdir_p ( WINABSPATH . $flagpath . '/thumbs') )
83
+ $txt .= __('Unable to create directory ', 'flash-album-gallery').' <strong>' . $flagpath . '/thumbs !</strong>';
84
+ }
85
+
86
+ // 4. Now create "webview" folder inside
87
+ if ( !is_dir(WINABSPATH . $flagpath . '/webview') ) {
88
+ if ( !wp_mkdir_p ( WINABSPATH . $flagpath . '/webview') )
89
+ $txt .= __('Unable to create directory ', 'flash-album-gallery').' <strong>' . $flagpath . '/webview !</strong>';
90
+ }
91
+
92
+ if (FLAG_SAFE_MODE) {
93
+ $help = __('The server setting Safe-Mode is on !', 'flash-album-gallery');
94
+ $help .= '<br />'.__('If you have problems, please create directory', 'flash-album-gallery').' <strong>' . $flagpath . '</strong> ';
95
+ $help .= __('and the thumbnails directory', 'flash-album-gallery').' <strong>' . $flagpath . '/thumbs</strong> '.__('with permission 777 manually !', 'flash-album-gallery');
96
+ if ($output) flagGallery::show_message($help);
97
+ }
98
+
99
+ // show an error message
100
+ if ( !empty($txt) ) {
101
+ if (FLAG_SAFE_MODE) {
102
+ // for safe_mode , better delete folder, both folder must be created manually
103
+ @rmdir(WINABSPATH . $flagpath . '/thumbs');
104
+ @rmdir(WINABSPATH . $flagpath);
105
+ }
106
+ if ($output) flagGallery::show_error($txt);
107
+ return false;
108
+ }
109
+
110
+ $result = $wpdb->get_var($wpdb->prepare("SELECT `name` FROM `{$wpdb->flaggallery}` WHERE `name` = '%s' ", $galleryname));
111
+
112
+ if ($result) {
113
+ if ($output) flagGallery::show_error( _n( 'Gallery', 'Galleries', 1, 'flash-album-gallery' ) .' <strong>' . $galleryname . '</strong> '.__('already exists', 'flash-album-gallery'));
114
+ return true;
115
+ } else {
116
+ if(empty($user_ID)){
117
+ $user_ID = $wpdb->get_var("SELECT ID FROM $wpdb->users ORDER BY ID");
118
+ }
119
+ $result = $wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->flaggallery (name, path, title, galdesc, author, status) VALUES (%s, %s, %s, %s, %s, %d)", $galleryname, $flagpath, $gallerytitle, $description, $user_ID, $status) );
120
+ // and give me the new id
121
+ $gallery_id = (int) $wpdb->insert_id;
122
+ // here you can inject a custom function
123
+ do_action('flag_created_new_gallery', $gallery_id);
124
+
125
+ if ($result) {
126
+ $message = __('Gallery \'%1$s\' successfully created.<br/>You can show this gallery with the tag %2$s.<br/>','flash-album-gallery');
127
+ $message = sprintf($message, esc_html(stripcslashes($gallerytitle)), '[flagallery gid=' . $gallery_id . ']');
128
+ $message .= '<a href="' . admin_url() . 'admin.php?page=flag-manage-gallery&mode=edit&gid=' . $gallery_id . '" >';
129
+ $message .= __('Edit gallery','flash-album-gallery');
130
+ $message .= '</a>';
131
+
132
+ if ($output) flagGallery::show_message($message);
133
+ }
134
+ // return only the id if defined
135
+ if ($gallery_id)
136
+ return $gallery_id;
137
+
138
+ return true;
139
+ }
140
+ }
141
+
142
+ /**
143
+ * flagAdmin::import_gallery()
144
+ * TODO: Check permission of existing thumb folder & images
145
+ *
146
+ * @class flagAdmin
147
+ * @param string $galleryfolder contains relative path
148
+ * @return void
149
+ */
150
+ public static function import_gallery($galleryfolder) {
151
+
152
+ global $wpdb, $user_ID;
153
+
154
+ // get the current user ID
155
+ wp_get_current_user();
156
+
157
+ $created_msg = '';
158
+
159
+ // remove trailing slashes, if somebody use it
160
+ $galleryfolder = str_replace('../','', $galleryfolder );
161
+ $galleryfolder = trim($galleryfolder, '/');
162
+ $gallerypath = WINABSPATH . $galleryfolder;
163
+
164
+ if (!is_dir($gallerypath)) {
165
+ flagGallery::show_error(__('Directory', 'flash-album-gallery').' <strong>'.esc_html($gallerypath).'</strong> '.__('doesn&#96;t exist!', 'flash-album-gallery').' '.__('Or imported folder name contains special characters.', 'flash-album-gallery'));
166
+ return ;
167
+ }
168
+
169
+ // read list of images
170
+ $new_imageslist = flagAdmin::scandir($gallerypath);
171
+ if (empty($new_imageslist)) {
172
+ flagGallery::show_message(__('Directory', 'flash-album-gallery').' <strong>'.esc_html($gallerypath).'</strong> '.__('contains no pictures', 'flash-album-gallery'));
173
+ return;
174
+ }
175
+
176
+ // check & create thumbnail folder
177
+ if ( !flagGallery::create_thumbnail_folder($gallerypath) )
178
+ return;
179
+
180
+ // take folder name as gallery name
181
+ $galleryname = basename($galleryfolder);
182
+
183
+ // check for existing gallery folder
184
+ $gallery_id = $wpdb->get_var($wpdb->prepare("SELECT gid FROM {$wpdb->flaggallery} WHERE path = '%s' ", $galleryfolder));
185
+
186
+ if (!$gallery_id) {
187
+ $result = $wpdb->query( $wpdb->prepare("INSERT INTO {$wpdb->flaggallery} (name, path, title, author) VALUES (%s, %s, %s, %s)", $galleryname, $galleryfolder, $galleryname , $user_ID) );
188
+ if (!$result) {
189
+ flagGallery::show_error(__('Database error. Could not add gallery!','flash-album-gallery'));
190
+ return;
191
+ }
192
+ $created_msg = _n( 'Gallery', 'Galleries', 1, 'flash-album-gallery' ) . ' <strong>' . $galleryname . '</strong> ' . __('successfully created!','flash-album-gallery') . '<br />';
193
+ $gallery_id = $wpdb->insert_id; // get index_id
194
+ }
195
+
196
+ // Look for existing image list
197
+ $old_imageslist = $wpdb->get_col($wpdb->prepare("SELECT filename FROM {$wpdb->flagpictures} WHERE galleryid = %d ", $gallery_id));
198
+
199
+ // if no images are there, create empty array
200
+ if ($old_imageslist == NULL)
201
+ $old_imageslist = array();
202
+
203
+ // check difference
204
+ $new_images = array_diff($new_imageslist, $old_imageslist);
205
+
206
+ // all images must be valid files
207
+ foreach($new_images as $key => $picture) {
208
+ if (!@getimagesize($gallerypath . '/' . $picture) ) {
209
+ unset($new_images[$key]);
210
+ @unlink($gallerypath . '/' . $picture);
211
+ }
212
+ }
213
+
214
+ // add images to database
215
+ $image_ids = flagAdmin::add_Images($gallery_id, $new_images);
216
+
217
+ //add the preview image if needed
218
+ flagAdmin::set_gallery_preview ( $gallery_id );
219
+
220
+ // now create thumbnails
221
+ flagAdmin::do_ajax_operation( 'create_thumbnail' , $image_ids, __('Create new thumbnails','flash-album-gallery') );
222
+
223
+ //TODO:Message will not shown, because AJAX routine require more time, message should be passed to AJAX
224
+ flagGallery::show_message( $created_msg . count($image_ids) .__(' picture(s) successfully added','flash-album-gallery') );
225
+
226
+ return;
227
+
228
+ }
229
+
230
+ /**
231
+ * flagAdmin::import_video()
232
+ *
233
+ * @class flagAdmin
234
+ * @param string $folder contains relative path
235
+ * @return void
236
+ */
237
+ public static function import_video($folder) {
238
+
239
+
240
+ $created_msg = '';
241
+ // remove trailing slash at the end, if somebody use it
242
+ $folder = str_replace(array('../','\'','"','<','>','$','%','='),'', $folder);
243
+ $folder = rtrim($folder, '/');
244
+ $path = WINABSPATH . $folder;
245
+ if (!is_dir($path)) {
246
+ echo '<p class="message">'.__('Directory', 'flash-album-gallery').' <strong>'.$path.'</strong> '.__('doesn&#96;t exist!', 'flash-album-gallery').' '.__('Or imported folder name contains special characters.', 'flash-album-gallery').'</p>';
247
+ return ;
248
+ }
249
+ // read list of files
250
+ $ext = array('mp4','ogg','webm','flv');
251
+ $new_filelist = flagAdmin::scandir($path, $ext);
252
+ if (empty($new_filelist)) {
253
+ echo '<p class="message">'.__('Directory', 'flash-album-gallery').' <strong>'.$path.'</strong> '.__('does not contain video files', 'flash-album-gallery').'</p>';
254
+ return;
255
+ }
256
+ $i=0;
257
+ foreach($new_filelist as $key => $file) {
258
+ //$new_filelist[$key] = $path . '/' . $file;
259
+ $filename = $path . '/' . $file;
260
+ $id = flagAdmin::handle_import_file($filename);
261
+ if ( is_wp_error($id) ) {
262
+ $created_msg .= '<p>' . sprintf(__('<em>%s</em> was <strong>not</strong> imported due to an error: %s', 'flash-album-gallery'), $file, $id->get_error_message() ) . '</p>';
263
+ } else {
264
+ $i++;
265
+ $created_msg .= '<p>' . sprintf(__('<em>%s</em> has been added to Media library', 'flash-album-gallery'), $file) . '</p>';
266
+ }
267
+ }
268
+ $created_msg .= '<p class="message">'.$i.__(' file(s) successfully added','flash-album-gallery').'</p><div class="hidden">'.$created_msg.'</div>';
269
+ echo $created_msg;
270
+ }
271
+
272
+ /**
273
+ * flagAdmin::import_mp3()
274
+ *
275
+ * @class flagAdmin
276
+ * @param string $folder contains relative path
277
+ * @return void
278
+ */
279
+ public static function import_mp3($folder) {
280
+
281
+ $created_msg = '';
282
+ // remove trailing slash at the end, if somebody use it
283
+ $folder = str_replace(array('../','\'','"','<','>','$','%','='),'', $folder);
284
+ $folder = rtrim($folder, '/');
285
+ $path = WINABSPATH . $folder;
286
+ if (!is_dir($path)) {
287
+ echo '<p class="message">'.__('Directory', 'flash-album-gallery').' <strong>'.$path.'</strong> '.__('doesn&#96;t exist!', 'flash-album-gallery').' '.__('Or imported folder name contains special characters.', 'flash-album-gallery').'</p>';
288
+ return ;
289
+ }
290
+ // read list of files
291
+ $ext = array('mp3', 'ogg', 'wav');
292
+ $new_filelist = flagAdmin::scandir($path, $ext);
293
+ if (empty($new_filelist)) {
294
+ echo '<p class="message">'.__('Directory', 'flash-album-gallery').' <strong>'.$path.'</strong> '.__('does not contain audio files', 'flash-album-gallery').'</p>';
295
+ return;
296
+ }
297
+ $i=0;
298
+ foreach($new_filelist as $key => $file) {
299
+ //$new_filelist[$key] = $path . '/' . $file;
300
+ $filename = $path . '/' . $file;
301
+ $id = flagAdmin::handle_import_file($filename);
302
+ if ( is_wp_error($id) ) {
303
+ $created_msg .= '<p>' . sprintf(__('<em>%s</em> was <strong>not</strong> imported due to an error: %s', 'flash-album-gallery'), $file, $id->get_error_message() ) . '</p>';
304
+ } else {
305
+ $i++;
306
+ $created_msg .= '<p>' . sprintf(__('<em>%s</em> has been added to Media library', 'flash-album-gallery'), $file) . '</p>';
307
+ }
308
+ }
309
+ $created_msg .= '<p class="message">'.$i.__(' file(s) successfully added','flash-album-gallery').'</p><div class="hidden">'.$created_msg.'</div>';
310
+ echo $created_msg;
311
+ }
312
+
313
+ /**
314
+ * flagAdmin::import_banner()
315
+ *
316
+ * @class flagAdmin
317
+ * @param string $folder contains relative path
318
+ * @return array
319
+ */
320
+ public static function import_banner($folder) {
321
+
322
+ $created_msg = '';
323
+ // remove trailing slash at the end, if somebody use it
324
+ $folder = str_replace(array('../','\'','"','<','>','$','%','='),'', $folder);
325
+ $folder = rtrim($folder, '/');
326
+ $path = WINABSPATH . $folder;
327
+ if (!is_dir($path)) {
328
+ echo '<p class="message">'.__('Directory', 'flash-album-gallery').' <strong>'.$path.'</strong> '.__('doesn&#96;t exist!', 'flash-album-gallery').' '.__('Or imported folder name contains special characters.', 'flash-album-gallery').'</p>';
329
+ return false;
330
+ }
331
+ // read list of files
332
+ $new_filelist = flagAdmin::scandir($path);
333
+ if (empty($new_filelist)) {
334
+ echo '<p class="message">'.__('Directory', 'flash-album-gallery').' <strong>'.$path.'</strong> '.__('does not contain image files', 'flash-album-gallery').'</p>';
335
+ return false;
336
+ }
337
+ $created_msg .= '<div class="message"><p>'.count($new_filelist).' '.__('image(s) in the folder','flash-album-gallery').':</p><div class="flag_crunching"><div class="flag_progress"><span class="flag_complete"></span><span class="txt">'.__('Crunching...','flash-album-gallery').'</span></div></div></div>';
338
+ echo $created_msg;
339
+ return $new_filelist;
340
+ }
341
+
342
+ //Handle an individual file import.
343
+ public static function handle_import_file($file, $post_id = 0) {
344
+ set_time_limit(120);
345
+ $time = current_time('mysql');
346
+ if ( $post = get_post($post_id) ) {
347
+ if ( substr( $post->post_date, 0, 4 ) > 0 )
348
+ $time = $post->post_date;
349
+ }
350
+
351
+ // A writable uploads dir will pass this test. Again, there's no point overriding this one.
352
+ if ( ! ( ( $uploads = wp_upload_dir($time) ) && false === $uploads['error'] ) )
353
+ return new WP_Error($uploads['error']);
354
+
355
+ $wp_filetype = wp_check_filetype( $file, null );
356
+
357
+ /** @var $type
358
+ * @var $ext */
359
+ extract( $wp_filetype );
360
+
361
+ if ( ( !$type || !$ext ) && !current_user_can( 'unfiltered_upload' ) )
362
+ return new WP_Error('wrong_file_type', __( 'File type does not meet security guidelines. Try another.' ) ); //A WP-core string..
363
+
364
+ $match = preg_match('|^' . preg_quote(str_replace('\\', '/', $uploads['basedir'])) . '(.*)$|i', $file, $mat);
365
+ //Is the file allready in the uploads folder?
366
+ if( $match ) {
367
+
368
+ $filename = basename($file);
369
+ $new_file = $file;
370
+
371
+ $url = $uploads['baseurl'] . $mat[1];
372
+
373
+ $attachment = get_posts(array( 'post_type' => 'attachment', 'meta_key' => '_wp_attached_file', 'meta_value' => $uploads['subdir'] . '/' . $filename ));
374
+ if ( !empty($attachment) )
375
+ return $attachment[0]->ID;
376
+
377
+ //Ok, Its in the uploads folder, But NOT in WordPress's media library.
378
+ if ( preg_match("|(\d+)/(\d+)|", $mat[1], $datemat) ) //So lets set the date of the import to the date folder its in, IF its in a date folder.
379
+ $time = mktime(0, 0, 0, $datemat[2], 1, $datemat[1]);
380
+ else //Else, set the date based on the date of the files time.
381
+ $time = @filemtime($file);
382
+
383
+ if ( $time ) {
384
+ $post_date = date( 'Y-m-d H:i:s', $time);
385
+ $post_date_gmt = gmdate( 'Y-m-d H:i:s', $time);
386
+ }
387
+ } else {
388
+ $filename = wp_unique_filename( $uploads['path'], basename($file));
389
+
390
+ // copy the file to the uploads dir
391
+ $new_file = $uploads['path'] . '/' . $filename;
392
+ if ( false === @copy( $file, $new_file ) ){
393
+ wp_die(sprintf(__('The selected file could not be copied to %s.', 'flash-album-gallery'), $uploads['path']));
394
+ }
395
+
396
+ // Set correct file permissions
397
+ $stat = stat( dirname( $new_file ));
398
+ $perms = $stat['mode'] & 0000666;
399
+ @ chmod( $new_file, $perms );
400
+ // Compute the URL
401
+ $url = $uploads['url'] . '/' . rawurlencode($filename);
402
+ }
403
+
404
+ // Compute the URL
405
+ //Apply upload filters
406
+ $return = apply_filters( 'wp_handle_upload', array( 'file' => $new_file, 'url' => $url, 'type' => $type ) );
407
+ $new_file = $return['file'];
408
+ $url = $return['url'];
409
+ $type = $return['type'];
410
+
411
+ $title = preg_replace('!\.[^.]+$!', '', basename($file));
412
+ $content = '';
413
+
414
+ // use image exif/iptc data for title and caption defaults if possible
415
+ if ( $image_meta = @wp_read_image_metadata($new_file) ) {
416
+ if ( '' != trim($image_meta['title']) )
417
+ $title = trim($image_meta['title']);
418
+ if ( '' != trim($image_meta['caption']) )
419
+ $content = trim($image_meta['caption']);
420
+ }
421
+
422
+ if ( empty($post_date) )
423
+ $post_date = current_time('mysql');
424
+ if ( empty($post_date_gmt) )
425
+ $post_date_gmt = current_time('mysql', 1);
426
+
427
+ // Construct the attachment array
428
+ $attachment = array(
429
+ 'post_mime_type' => $type,
430
+ 'guid' => $url,
431
+ 'post_parent' => $post_id,
432
+ 'post_title' => $title,
433
+ 'post_name' => $title,
434
+ 'post_content' => $content,
435
+ 'post_date' => $post_date,
436
+ 'post_date_gmt' => $post_date_gmt
437
+ );
438
+
439
+ // Save the data
440
+ $id = wp_insert_attachment($attachment, $new_file, $post_id);
441
+ if ( !is_wp_error($id) ) {
442
+ $data = wp_generate_attachment_metadata( $id, $new_file );
443
+ wp_update_attachment_metadata( $id, $data );
444
+ if( !$match && isset($_POST['delete_files']) ) {
445
+ @unlink($file);
446
+ }
447
+ }
448
+
449
+ return $id;
450
+ }
451
+
452
+ /**
453
+ * flagAdmin::scandir()
454
+ *
455
+ * @class flagAdmin
456
+ * @param string $dirname
457
+ * @param array $ext
458
+ * @return array
459
+ */
460
+ public static function scandir($dirname = '.', $ext = array()) {
461
+ // thx to php.net :-)
462
+ if(empty($ext))
463
+ $ext = array('jpeg', 'jpg', 'png', 'gif');
464
+ $files = array();
465
+ if($handle = opendir($dirname)) {
466
+ while(false !== ($file = readdir($handle)))
467
+ for($i=0;$i<sizeof($ext);$i++)
468
+ if(stristr($file, '.' . $ext[$i]))
469
+ $files[] = utf8_encode($file);
470
+ closedir($handle);
471
+ }
472
+ sort($files);
473
+ return ($files);
474
+ }
475
+
476
+ /**
477
+ * flagAdmin::createThumbnail() - function to create or recreate a thumbnail
478
+ *
479
+ * @param object | int $image contain all information about the image or the id
480
+ * @return string result code
481
+ */
482
+ public static function create_thumbnail($image) {
483
+
484
+ global $flag;
485
+
486
+ if ( is_numeric($image) )
487
+ $image = flagdb::find_image( $image );
488
+
489
+ if ( !is_object($image) )
490
+ return __('Object didn\'t contain correct data','flash-album-gallery');
491
+
492
+ $dest_path = dirname($image->webimagePath);
493
+ if(!is_dir($dest_path)){
494
+ flagGallery::create_webview_folder(dirname($image->imagePath));
495
+ @chmod( $dest_path, 0755 );
496
+ }
497
+
498
+ if(! class_exists('flag_Thumbnail'))
499
+ require_once( flagGallery::graphic_library() );
500
+
501
+ // check for existing thumbnail
502
+ if (file_exists($image->thumbPath))
503
+ if (!is_writable($image->thumbPath))
504
+ return $image->filename . __(' is not writeable ','flash-album-gallery');
505
+
506
+ $thumb = new flag_Thumbnail($image->imagePath, TRUE);
507
+ $img_size = @getimagesize ( $image->imagePath );
508
+
509
+ // skip if file is not there
510
+ if (!$thumb->error) {
511
+ $thumb->resize($flag->options['thumbWidth'],$flag->options['thumbHeight']);
512
+
513
+ // save the new thumbnail
514
+ $thumb->save($image->thumbPath, $flag->options['thumbQuality']);
515
+ flagAdmin::chmod ($image->thumbPath);
516
+
517
+ //read the new sizes
518
+ $new_size = @getimagesize ( $image->thumbPath );
519
+ $size['width'] = $new_size[0];
520
+ $size['height'] = $new_size[1];
521
+
522
+ // add them to the database
523
+ flagdb::update_image_meta($image->pid, array( 'thumbnail' => $size) );
524
+ }
525
+
526
+ $thumb->destruct();
527
+
528
+ if ( !empty($thumb->errmsg) )
529
+ return $image->filename . ' (Error : '.$thumb->errmsg .')';
530
+
531
+ do_action('flag_thumbnail_created', $image);
532
+
533
+ flagAdmin::webview_image($image);
534
+
535
+ // success
536
+ return '1';
537
+ }
538
+
539
+ /**
540
+ * flagAdmin::resize_image() - create a new image, based on the height /width
541
+ *
542
+ * @class flagAdmin
543
+ * @param object | int $image contain all information about the image or the id
544
+ * @param integer $width optional
545
+ * @param integer $height optional
546
+ * @return string result code
547
+ */
548
+ public static function resize_image($image, $width = 0, $height = 0) {
549
+
550
+ global $flag;
551
+
552
+ if(! class_exists('flag_Thumbnail'))
553
+ require_once( flagGallery::graphic_library() );
554
+
555
+ if ( is_numeric($image) )
556
+ $image = flagdb::find_image( $image );
557
+
558
+ if ( !is_object($image) )
559
+ return __('Object didn\'t contain correct data','flash-album-gallery');
560
+
561
+ // before we start we import the meta data to database (required for uploads before V0.40)
562
+ flagAdmin::maybe_import_meta( $image->pid );
563
+
564
+ // if no parameter is set, take global settings
565
+ $width = ($width == 0) ? $flag->options['imgWidth'] : $width;
566
+ $height = ($height == 0) ? $flag->options['imgHeight'] : $height;
567
+
568
+ if (!is_writable($image->imagePath))
569
+ return ' <strong>' . $image->filename . __(' is not writeable','flash-album-gallery') . '</strong>';
570
+
571
+ $file = new flag_Thumbnail($image->imagePath, TRUE);
572
+
573
+ // skip if file is not there
574
+ if (!$file->error) {
575
+ $file->resize($width, $height, 4);
576
+ $file->save($image->imagePath, $flag->options['imgQuality']);
577
+ // read the new sizes
578
+ $size = @getimagesize ( $image->imagePath );
579
+ // add them to the database
580
+ flagdb::update_image_meta($image->pid, array( 'width' => $size[0], 'height' => $size[1] ) );
581
+ $file->destruct();
582
+ } else {
583
+ $file->destruct();
584
+ return ' <strong>' . $image->filename . ' (Error : ' . $file->errmsg . ')</strong>';
585
+ }
586
+
587
+ do_action('flag_image_resized', $image);
588
+
589
+ return '1';
590
+ }
591
+
592
+ /**
593
+ * flagAdmin::webview_image() - create a new image, based on the height /width
594
+ *
595
+ * @class flagAdmin
596
+ *
597
+ * @param object | int $image contain all information about the image or the id
598
+ * @param bool $return_size
599
+ *
600
+ * @return string result code
601
+ */
602
+ public static function webview_image($image, $return_size = false) {
603
+
604
+ global $flag;
605
+
606
+ if ( is_numeric($image) )
607
+ $image = flagdb::find_image( $image );
608
+
609
+ if ( !is_object($image) )
610
+ return __('Object didn\'t contain correct data','flash-album-gallery');
611
+
612
+ $img_size = @getimagesize ( $image->imagePath );
613
+ $webviewsize = '0';
614
+ $dest_path = dirname($image->webimagePath);
615
+ if(flagGallery::create_webview_folder(dirname($image->imagePath))){
616
+ if (! is_writable( $dest_path ) ) {
617
+ @chmod( $dest_path, 0755 );
618
+ }
619
+
620
+ if (file_exists($image->webimagePath)){
621
+ $webviewsize = @getimagesize ( $image->webimagePath );
622
+ flagdb::update_image_meta($image->pid, array( 'webview' => $webviewsize) );
623
+ if($return_size){
624
+ return $webviewsize;
625
+ } else {
626
+ return '1';
627
+ }
628
+ }
629
+
630
+ $imgquality = $flag->options['imgQuality'];
631
+ $max_width = ($img_size[0] < 2000)? $img_size[0] : 2000;
632
+ $max_height = ($img_size[1] < 2000)? $img_size[1] : 2000;
633
+ if( function_exists('wp_get_image_editor') ) {
634
+ $editor = wp_get_image_editor( $image->imagePath );
635
+ if ( ! is_wp_error( $editor ) ) {
636
+ $editor->set_quality( $imgquality );
637
+ $editor->resize( $max_width, $max_height, 0 );
638
+ $saved = $editor->save( $image->webimagePath );
639
+ if($saved['path'] !== $image->webimagePath) {
640
+ @rename($saved['path'], $image->webimagePath);
641
+ }
642
+ if(@filesize($image->webimagePath) > @filesize($image->imagePath)) {
643
+ @copy($image->imagePath, $image->webimagePath);
644
+ }
645
+ $webviewsize = @getimagesize ( $image->webimagePath );
646
+ flagdb::update_image_meta($image->pid, array( 'webview' => $webviewsize) );
647
+
648
+ do_action('flag_image_optimized', $image);
649
+ }
650
+ }
651
+ }
652
+
653
+ if($return_size){
654
+ return $webviewsize;
655
+ } else {
656
+ return '1';
657
+ }
658
+ }
659
+
660
+ /**
661
+ * Add images to database
662
+ *
663
+ * @class flagAdmin
664
+ * @param int $galleryID
665
+ * @param array $imageslist
666
+ * @param bool $name2alt
667
+ * @return array $image_ids Id's which are sucessful added
668
+ */
669
+ public static function add_Images($galleryID, $imageslist, $name2alt = false) {
670
+ global $wpdb;
671
+
672
+ $alttext = '';
673
+ $image_ids = array();
674
+
675
+ if ( is_array($imageslist) ) {
676
+ foreach($imageslist as $picture) {
677
+ if($name2alt) {
678
+ // strip off the extension of the filename
679
+ $path_parts = pathinfo( $picture );
680
+ $alttext = ( !isset($path_parts['filename']) ) ? substr($path_parts['basename'], 0,strpos($path_parts['basename'], '.')) : $path_parts['filename'];
681
+ }
682
+ // save it to the database
683
+ $result = $wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->flagpictures (galleryid, filename, alttext, exclude) VALUES (%s, %s, %s, 0)", $galleryID, $picture, $alttext) );
684
+ // and give me the new id
685
+ $pic_id = (int) $wpdb->insert_id;
686
+ if ($result)
687
+ $image_ids[] = $pic_id;
688
+
689
+ // add the metadata
690
+ flagAdmin::import_MetaData($pic_id);
691
+
692
+ // action hook for post process after the image is added to the database
693
+ $image = array( 'id' => $pic_id, 'filename' => $picture, 'galleryID' => $galleryID);
694
+ do_action('flag_added_new_image', $image);
695
+
696
+ }
697
+ } // is_array
698
+
699
+ return $image_ids;
700
+
701
+ }
702
+
703
+ /**
704
+ * Import some metadata into the database (if avialable)
705
+ *
706
+ * @class flagAdmin
707
+ * @param array|int $imagesIds
708
+ * @return bool
709
+ */
710
+ public static function import_MetaData($imagesIds) {
711
+
712
+ global $wpdb;
713
+
714
+ require_once(FLAG_ABSPATH . 'lib/image.php');
715
+
716
+ if (!is_array($imagesIds))
717
+ $imagesIds = array($imagesIds);
718
+
719
+ foreach($imagesIds as $imageID) {
720
+ $image = flagdb::find_image($imageID);
721
+ if (!$image->error) {
722
+
723
+ $meta = flagAdmin::get_MetaData($image->pid);
724
+
725
+ // get the title
726
+ $alttext = empty( $meta['title'] ) ? $image->alttext : $meta['title'];
727
+ // get the caption / description field
728
+ $description = empty( $meta['caption'] ) ? $image->description : $meta['caption'];
729
+ // get the file date/time from exif
730
+ $timestamp = $meta['timestamp'];
731
+ // update database
732
+ $result = $wpdb->query( $wpdb->prepare("UPDATE $wpdb->flagpictures SET alttext = %s, description = %s, imagedate = %s WHERE pid = %d", $alttext, $description, $timestamp, $image->pid) );
733
+ if ($result === false)
734
+ return ' <strong>' . $image->filename . ' ' . __('(Error : Couldn\'t not update data base)', 'flash-album-gallery') . '</strong>';
735
+
736
+ //this flag will inform us the import is already one time performed
737
+ $meta['common']['saved'] = true;
738
+ $result = flagdb::update_image_meta($image->pid, $meta['common']);
739
+
740
+ if ($result === false)
741
+ return ' <strong>' . $image->filename . ' ' . __('(Error : Couldn\'t not update meta data)', 'flash-album-gallery') . '</strong>';
742
+ } else
743
+ return ' <strong>' . $image->filename . ' ' . __('(Error : Couldn\'t not find image)', 'flash-album-gallery') . '</strong>';// error check
744
+ }
745
+
746
+ return '1';
747
+
748
+ }
749
+
750
+ /**
751
+ * Copy some metadata into the image description (if avialable)
752
+ *
753
+ * @class flagAdmin
754
+ * @param array|int $imagesIds
755
+ * @return bool
756
+ */
757
+ public static function copy_MetaData($imagesIds) {
758
+
759
+ global $wpdb;
760
+
761
+ /** @var $meta */
762
+ require_once(FLAG_ABSPATH . 'lib/meta.php');
763
+ require_once(FLAG_ABSPATH . 'lib/image.php');
764
+
765
+ if (!is_array($imagesIds))
766
+ $imagesIds = array($imagesIds);
767
+
768
+ foreach($imagesIds as $imageID) {
769
+
770
+ $image = flagdb::find_image($imageID);
771
+ if (!$image->error) {
772
+ /** @var $makedescription
773
+ * @var $timestamp */
774
+ require_once(FLAG_ABSPATH . 'admin/grab_meta.php');
775
+
776
+ // get the title
777
+ $alttext = empty( $alttext ) ? $image->alttext : $meta['title'];
778
+ if($alttext) $alttext = '<font size="16"><b>'.$alttext."</b></font>\n";
779
+ // get the caption / description field
780
+ $description = empty($description ) ? $image->description : $meta['caption'];
781
+ if($description) $description = $description."<br>\n";
782
+ // get the file date/time from exif
783
+ $makedescription = $alttext.$description.$makedescription;
784
+ // update database
785
+ $result = $wpdb->query( $wpdb->prepare("UPDATE $wpdb->flagpictures SET alttext = %s, description = %s, imagedate = %s WHERE pid = %d", '', $makedescription, $timestamp, $image->pid) );
786
+ if ($result === false)
787
+ return ' <strong>' . $image->filename . ' ' . __('(Error : Couldn\'t not update data base)', 'flash-album-gallery') . '</strong>';
788
+
789
+ } else
790
+ return ' <strong>' . $image->filename . ' ' . __('(Error : Couldn\'t not find image)', 'flash-album-gallery') . '</strong>';// error check
791
+ }
792
+
793
+ return '1';
794
+
795
+ }
796
+
797
+ /**
798
+ * flagAdmin::get_MetaData()
799
+ *
800
+ * @class flagAdmin
801
+ * @require Meta class
802
+ * @param $id
803
+ * @return array metadata
804
+ */
805
+ public static function get_MetaData($id) {
806
+
807
+ require_once(FLAG_ABSPATH . 'lib/meta.php');
808
+
809
+ $meta = array();
810
+
811
+ $pdata = new flagMeta( $id );
812
+
813
+ $meta['title'] = trim ( $pdata->get_META('title') );
814
+ $meta['caption'] = trim ( $pdata->get_META('caption') );
815
+ $meta['keywords'] = trim ( $pdata->get_META('keywords') );
816
+ $meta['timestamp'] = $pdata->get_date_time();
817
+ // this contain other useful meta information
818
+ $meta['common'] = $pdata->get_common_meta();
819
+
820
+ return $meta;
821
+
822
+ }
823
+
824
+ /**
825
+ * Maybe import some meta data to the database. The functions checks the flag 'saved'
826
+ * and if based on compat reason (pre V0.40) we save then some meta datas to the database
827
+ *
828
+ * @param int $id
829
+ * @return mixed result
830
+ */
831
+ public static function maybe_import_meta( $id ) {
832
+
833
+ require_once(FLAG_ABSPATH . 'lib/meta.php');
834
+
835
+ $meta_obj = new flagMeta( $id );
836
+
837
+ if ( $meta_obj->image->meta_data['saved'] != true ) {
838
+ $common = $meta_obj->get_common_meta();
839
+ //this flag will inform us that the import is already one time performed
840
+ $common['saved'] = true;
841
+ $result = flagdb::update_image_meta($id, $common);
842
+ } else
843
+ return false;
844
+
845
+ return $result;
846
+
847
+ }
848
+
849
+ /**
850
+ * flagAdmin::getOnlyImages()
851
+ *
852
+ * @class flagAdmin
853
+ * @param mixed $p_event
854
+ * @param mixed $p_header
855
+ * @return bool
856
+ */
857
+ public static function getOnlyImages($p_event, $p_header) {
858
+
859
+ $info = pathinfo($p_header['filename']);
860
+ // check for extension
861
+ $ext = array('jpeg', 'jpg', 'png', 'gif');
862
+ if ( in_array( strtolower($info['extension']), $ext) ) {
863
+ // For MAC skip the ".image" files
864
+ if ($info['basename']{0} == '.' )
865
+ return 0;
866
+ else
867
+ return 1;
868
+ }
869
+ // ----- all other files are skipped
870
+ else {
871
+ return 0;
872
+ }
873
+ }
874
+
875
+ /**
876
+ * Function for uploading of images via the upload form
877
+ *
878
+ * @class flagAdmin
879
+ * @return void
880
+ */
881
+ public static function upload_images() {
882
+
883
+ global $wpdb;
884
+
885
+ // WPMU action
886
+ if (flagAdmin::check_quota())
887
+ return;
888
+
889
+ // Images must be an array
890
+ $imageslist = array();
891
+
892
+ // get selected gallery
893
+ $galleryID = (int) $_POST['galleryselect'];
894
+
895
+ if ($galleryID == 0) {
896
+ flagGallery::show_error(__('No gallery selected !','flash-album-gallery'));
897
+ return;
898
+ }
899
+
900
+ // get the path to the gallery
901
+ $gallery = flagdb::find_gallery($galleryID);
902
+
903
+ if ( empty($gallery->path) ){
904
+ flagGallery::show_error(__('Failure in database, no gallery path set !','flash-album-gallery'));
905
+ return;
906
+ }
907
+
908
+ // read list of images
909
+ $dirlist = flagAdmin::scandir(WINABSPATH.$gallery->path);
910
+
911
+ $imagefiles = $_FILES['imagefiles'];
912
+
913
+ if (is_array($imagefiles)) {
914
+ foreach ($imagefiles['name'] as $key => $value) {
915
+
916
+ // look only for uploded files
917
+ if ($imagefiles['error'][$key] == 0) {
918
+
919
+ $temp_file = $imagefiles['tmp_name'][$key];
920
+
921
+ //clean filename and extract extension
922
+ $filepart = flagGallery::fileinfo( $imagefiles['name'][$key] );
923
+ $filename = sanitize_title($filepart['filename']) . '.' . $filepart['extension'];
924
+
925
+ // check for allowed extension and if it's an image file
926
+ $ext = array('jpg', 'jpeg', 'png', 'gif');
927
+ if ( !in_array(strtolower($filepart['extension']), $ext) || !@getimagesize($temp_file) ){
928
+ flagGallery::show_error('<strong>' . $imagefiles['name'][$key] . ' </strong>' . __('is no valid image file!','flash-album-gallery'));
929
+ continue;
930
+ }
931
+
932
+ // check if this filename already exist in the folder
933
+ $i = 0;
934
+ while ( in_array( $filename, $dirlist ) ) {
935
+ $filename = $filepart['filename'] . '_' . $i++ . '.' .$filepart['extension'];
936
+ }
937
+
938
+ $dest_file = $gallery->abspath . '/' . $filename;
939
+
940
+ //check for folder permission
941
+ if ( !is_writeable($gallery->abspath) ) {
942
+ $message = sprintf(__('Unable to write to directory %s. Is this directory writable by the server?', 'flash-album-gallery'), $gallery->abspath);
943
+ flagGallery::show_error($message);
944
+ return;
945
+ }
946
+
947
+ // save temp file to gallery
948
+ if ( !@move_uploaded_file($temp_file, $dest_file) ){
949
+ if( !file_exists($dest_file)){
950
+ flagGallery::show_error(__('Error, the file could not moved to : ','flash-album-gallery') . $dest_file);
951
+ flagAdmin::check_safemode( $gallery->abspath );
952
+ continue;
953
+ }
954
+ }
955
+ if ( !flagAdmin::chmod($dest_file) ) {
956
+ flagGallery::show_error(__('Error, the file permissions could not set','flash-album-gallery'));
957
+ continue;
958
+ }
959
+
960
+ // add to imagelist & dirlist
961
+ $imageslist[] = $filename;
962
+ $dirlist[] = $filename;
963
+ }
964
+ }
965
+ }
966
+
967
+ if (count($imageslist) > 0) {
968
+
969
+ // add images to database
970
+ $image_ids = flagAdmin::add_Images($galleryID, $imageslist);
971
+
972
+ //create thumbnails
973
+ flagAdmin::do_ajax_operation( 'create_thumbnail' , $image_ids, __('Create new thumbnails','flash-album-gallery') );
974
+ //add the preview image if needed
975
+ flagAdmin::set_gallery_preview ( $galleryID );
976
+
977
+ flagGallery::show_message( count($image_ids) . __(' Image(s) successfully added','flash-album-gallery'));
978
+ }
979
+
980
+ return;
981
+
982
+ } // end function
983
+
984
+ /**
985
+ * Upload function will be called via the Flash uploader
986
+ *
987
+ * @class flagAdmin
988
+ * @param integer $galleryID
989
+ * @return string $result
990
+ */
991
+ static function swfupload_image($galleryID = 0) {
992
+
993
+ global $wpdb, $flag;
994
+
995
+ if ($galleryID == 0) {
996
+ //@unlink($temp_file);
997
+ return __('No gallery selected!','flash-album-gallery');
998
+ }
999
+
1000
+ // WPMU action
1001
+ if (flagAdmin::check_quota())
1002
+ return '0';
1003
+
1004
+ // Check the upload
1005
+ if (!isset($_FILES['file']) || !is_uploaded_file($_FILES["file"]["tmp_name"]) || $_FILES["file"]["error"] !== UPLOAD_ERR_OK) {
1006
+ return flagAdmin::file_upload_error_message( $_FILES['file']['error'] );
1007
+ }
1008
+
1009
+ // get the filename and extension
1010
+ $temp_file = $_FILES["file"]['tmp_name'];
1011
+
1012
+ $filepart = flagGallery::fileinfo( $_FILES['file']['name'] );
1013
+ $filename = sanitize_title($filepart['filename']) . '.' . $filepart['extension'];
1014
+
1015
+ // check for allowed extension
1016
+ $ext = array('jpeg', 'jpg', 'png', 'gif');
1017
+ if (!in_array(strtolower($filepart['extension']), $ext)){
1018
+ if(!@getimagesize($temp_file))
1019
+ return $filename . ' '. __('is no valid image file!','flash-album-gallery');
1020
+ }
1021
+
1022
+ // get the path to the gallery
1023
+ $gallerypath = $wpdb->get_var($wpdb->prepare("SELECT path FROM {$wpdb->flaggallery} WHERE gid = %d ", $galleryID));
1024
+ if (!$gallerypath){
1025
+ @unlink($temp_file);
1026
+ return __('Failure in database, no gallery path set !','flash-album-gallery');
1027
+ }
1028
+
1029
+ // read list of images
1030
+ $imageslist = flagAdmin::scandir( WINABSPATH.$gallerypath );
1031
+
1032
+ // check if this filename already exist
1033
+ $i = 0;
1034
+ while (in_array($filename,$imageslist)) {
1035
+ $filename = sanitize_title($filepart['filename']) . '_' . $i++ . '.' . $filepart['extension'];
1036
+ }
1037
+
1038
+ $dest_file = WINABSPATH . $gallerypath . '/' . $filename;
1039
+
1040
+ // save temp file to gallery
1041
+ if ( !@move_uploaded_file($temp_file, $dest_file) ){
1042
+ if( !file_exists($dest_file)){
1043
+ flagAdmin::check_safemode(WINABSPATH.$gallerypath);
1044
+ return __('Error, the file could not moved to : ','flash-album-gallery').$dest_file;
1045
+ }
1046
+ }
1047
+
1048
+ if ( !flagAdmin::chmod($dest_file) )
1049
+ return __('Error, the file permissions could not set','flash-album-gallery');
1050
+
1051
+ require_once(ABSPATH . 'wp-admin/includes/image.php');
1052
+ $angle = 0;
1053
+ $image_meta = wp_read_image_metadata($dest_file);
1054
+ if(!empty($image_meta['orientation'])){
1055
+ switch($image_meta['orientation']){
1056
+ case 3:
1057
+ $angle = 180;
1058
+ break;
1059
+ case 6:
1060
+ $angle = 270;
1061
+ break;
1062
+ case 8:
1063
+ $angle = 90;
1064
+ break;
1065
+ }
1066
+ }
1067
+ if($angle){
1068
+ $editor = wp_get_image_editor($dest_file);
1069
+ if(!is_wp_error($editor)){
1070
+ $editor->rotate($angle);
1071
+ $editor->set_quality(90);
1072
+ $editor->save($dest_file);
1073
+ }
1074
+ }
1075
+
1076
+ // add images to database
1077
+ $image_ids = flagAdmin::add_Images($galleryID, array($filename));
1078
+ $return = '';
1079
+ //create thumbnails
1080
+
1081
+ //save the thumb size values
1082
+ $flag->options['thumbWidth'] = intval($_POST['thumbw'])? intval($_POST['thumbw']) : 300;
1083
+ $flag->options['thumbHeight'] = intval($_POST['thumbh'])? intval($_POST['thumbh']) : 300;
1084
+ update_option('flag_options', $flag->options);
1085
+
1086
+ foreach($image_ids as $picture){
1087
+ $return = flagAdmin::create_thumbnail($picture);
1088
+ }
1089
+ //add the preview image if needed
1090
+ if(intval($_POST['last']) == 1)
1091
+ flagAdmin::set_gallery_preview ( $galleryID );
1092
+
1093
+ return (intval($return) == 1)? '' : $return;
1094
+
1095
+ }
1096
+
1097
+ /**
1098
+ * File upload error message
1099
+ *
1100
+ * @class flagAdmin
1101
+ * @param $error_code
1102
+ * @return string $result
1103
+ */
1104
+ public static function file_upload_error_message($error_code) {
1105
+ switch ($error_code) {
1106
+ case UPLOAD_ERR_INI_SIZE:
1107
+ return __('The uploaded file exceeds the upload_max_filesize directive in php.ini','flash-album-gallery');
1108
+ case UPLOAD_ERR_FORM_SIZE:
1109
+ return __('The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form','flash-album-gallery');
1110
+ case UPLOAD_ERR_PARTIAL:
1111
+ return __('The uploaded file was only partially uploaded','flash-album-gallery');
1112
+ case UPLOAD_ERR_NO_FILE:
1113
+ return __('No file was uploaded','flash-album-gallery');
1114
+ case UPLOAD_ERR_NO_TMP_DIR:
1115
+ return __('Missing a temporary folder','flash-album-gallery');
1116
+ case UPLOAD_ERR_CANT_WRITE:
1117
+ return __('Failed to write file to disk','flash-album-gallery');
1118
+ case UPLOAD_ERR_EXTENSION:
1119
+ return __('File upload stopped by extension','flash-album-gallery');
1120
+ default:
1121
+ return __('Unknown upload error','flash-album-gallery');
1122
+ }
1123
+ }
1124
+
1125
+ /**
1126
+ * Check the Quota under WPMU. Only needed for this case
1127
+ *
1128
+ * @class flagAdmin
1129
+ * @return bool $result
1130
+ */
1131
+ public static function check_quota() {
1132
+
1133
+ if ( (IS_WPMU) && flagGallery::flag_wpmu_enable_function('wpmuQuotaCheck'))
1134
+ if( $error = upload_is_user_over_quota( false ) ) {
1135
+ flagGallery::show_error( __( 'Sorry, you have used your space allocation. Please delete some files to upload more files.','flash-album-gallery' ) );
1136
+ return true;
1137
+ }
1138
+ return false;
1139
+ }
1140
+
1141
+ /**
1142
+ * Set correct file permissions (taken from wp core)
1143
+ *
1144
+ * @class flagAdmin
1145
+ * @param string $filename
1146
+ * @return bool $result
1147
+ */
1148
+ public static function chmod($filename = '') {
1149
+
1150
+ $stat = @ stat(dirname($filename));
1151
+ $perms = $stat['mode'] & 0007777;
1152
+ $perms = $perms & 0000666;
1153
+ if ( @chmod($filename, $perms) )
1154
+ return true;
1155
+
1156
+ return false;
1157
+ }
1158
+
1159
+ /**
1160
+ * Check UID in folder and Script
1161
+ * Read http://www.php.net/manual/en/features.safe-mode.php to understand safe_mode
1162
+ *
1163
+ * @class flagAdmin
1164
+ * @param string $foldername
1165
+ * @return bool $result
1166
+ */
1167
+ public static function check_safemode($foldername) {
1168
+
1169
+ if ( FLAG_SAFE_MODE ) {
1170
+
1171
+ //$script_uid = ( ini_get('safe_mode_gid') ) ? getmygid() : getmyuid();
1172
+ $script_uid = getmyuid();
1173
+ $folder_uid = fileowner($foldername);
1174
+
1175
+ if ($script_uid != $folder_uid) {
1176
+ $message = sprintf(__('SAFE MODE Restriction in effect! You need to create the folder <strong>%s</strong> manually','flash-album-gallery'), $foldername);
1177
+ $message .= '<br />' . sprintf(__('When safe_mode is on, PHP checks to see if the owner (%s) of the current script matches the owner (%s) of the file to be operated on by a file function or its directory','flash-album-gallery'), $script_uid, $folder_uid );
1178
+ flagGallery::show_error($message);
1179
+ return false;
1180
+ }
1181
+ }
1182
+
1183
+ return true;
1184
+ }
1185
+
1186
+ /**
1187
+ * Capability check. Check is the ID fit's to the user_ID
1188
+ *
1189
+ * @class flagAdmin
1190
+ * @param int $check_ID is the user_id
1191
+ * @return bool $result
1192
+ */
1193
+ public static function can_manage_this_gallery($check_ID) {
1194
+
1195
+ global $user_ID, $wp_roles;
1196
+
1197
+ if ( !current_user_can('FlAG Manage others gallery') ) {
1198
+ // get the current user ID
1199
+ wp_get_current_user();
1200
+
1201
+ if ( $user_ID != $check_ID)
1202
+ return false;
1203
+ }
1204
+ return true;
1205
+ }
1206
+
1207
+ /**
1208
+ * Move images from one folder to another
1209
+ *
1210
+ * @param array|int $pic_ids ID's of the images
1211
+ * @param int $dest_gid destination gallery
1212
+ * @return void
1213
+ */
1214
+ public static function move_images($pic_ids, $dest_gid) {
1215
+
1216
+ $errors = '';
1217
+ $count = 0;
1218
+
1219
+ if (!is_array($pic_ids))
1220
+ $pic_ids = array($pic_ids);
1221
+
1222
+ // Get destination gallery
1223
+ $destination = flagdb::find_gallery( $dest_gid );
1224
+ $dest_abspath = WINABSPATH . $destination->path;
1225
+
1226
+ if ( $destination == null ) {
1227
+ flagGallery::show_error(__('The destination gallery does not exist','flash-album-gallery'));
1228
+ return;
1229
+ }
1230
+
1231
+ // Check for folder permission
1232
+ if ( !is_writeable( $dest_abspath ) ) {
1233
+ $message = sprintf(__('Unable to write to directory %s. Is this directory writable by the server?', 'flash-album-gallery'), $dest_abspath );
1234
+ flagGallery::show_error($message);
1235
+ return;
1236
+ }
1237
+
1238
+ // Get pictures
1239
+ $images = flagdb::find_images_in_list($pic_ids);
1240
+
1241
+ foreach ($images as $image) {
1242
+
1243
+ $i = 0;
1244
+ $tmp_prefix = '';
1245
+
1246
+ $destination_file_name = $image->filename;
1247
+ // check if the filename already exist, then we add a copy_ prefix
1248
+ while (file_exists( $dest_abspath . '/' . $destination_file_name)) {
1249
+ $tmp_prefix = 'copy_' . ($i++) . '_';
1250
+ $destination_file_name = $tmp_prefix . $image->filename;
1251
+ }
1252
+
1253
+ $destination_path = $dest_abspath . '/' . $destination_file_name;
1254
+ $destination_thumbnail = $dest_abspath . '/thumbs/thumbs_' . $destination_file_name;
1255
+
1256
+ // Move files
1257
+ if ( !@rename($image->imagePath, $destination_path) ) {
1258
+ $errors .= sprintf(__('Failed to move image %1$s to %2$s','flash-album-gallery'),
1259
+ '<strong>' . $image->filename . '</strong>', $destination_path) . '<br />';
1260
+ continue;
1261
+ }
1262
+
1263
+ // Move the thumbnail, if possible
1264
+ @rename($image->thumbPath, $destination_thumbnail);
1265
+
1266
+ // Change the gallery id in the database , maybe the filename
1267
+ if ( flagdb::update_image($image->pid, $dest_gid, $destination_file_name) )
1268
+ $count++;
1269
+
1270
+ }
1271
+
1272
+ if ( $errors != '' )
1273
+ flagGallery::show_error($errors);
1274
+
1275
+ $link = '<a href="' . admin_url() . 'admin.php?page=flag-manage-gallery&mode=edit&gid=' . $destination->gid . '" >' . $destination->title . '</a>';
1276
+ $messages = sprintf(__('Moved %1$s picture(s) to gallery : %2$s .','flash-album-gallery'), $count, $link);
1277
+ flagGallery::show_message($messages);
1278
+
1279
+ return;
1280
+ }
1281
+
1282
+ /**
1283
+ * Copy images to another gallery
1284
+ *
1285
+ * @class flagAdmin
1286
+ * @param array|int $pic_ids ID's of the images
1287
+ * @param int $dest_gid destination gallery
1288
+ * @return void
1289
+ */
1290
+ public static function copy_images($pic_ids, $dest_gid) {
1291
+
1292
+ $errors = $messages = '';
1293
+
1294
+ if (!is_array($pic_ids))
1295
+ $pic_ids = array($pic_ids);
1296
+
1297
+ // Get destination gallery
1298
+ $destination = flagdb::find_gallery( $dest_gid );
1299
+ if ( $destination == null ) {
1300
+ flagGallery::show_error(__('The destination gallery does not exist','flash-album-gallery'));
1301
+ return;
1302
+ }
1303
+
1304
+ // Check for folder permission
1305
+ if (!is_writeable(WINABSPATH.$destination->path)) {
1306
+ $message = sprintf(__('Unable to write to directory %s. Is this directory writable by the server?', 'flash-album-gallery'), WINABSPATH.$destination->path);
1307
+ flagGallery::show_error($message);
1308
+ return;
1309
+ }
1310
+
1311
+ // Get pictures
1312
+ $images = flagdb::find_images_in_list($pic_ids);
1313
+ $destination_path = WINABSPATH . $destination->path;
1314
+
1315
+ foreach ($images as $image) {
1316
+ // WPMU action
1317
+ if ( flagAdmin::check_quota() )
1318
+ return;
1319
+
1320
+ $i = 0;
1321
+ $tmp_prefix = '';
1322
+ $destination_file_name = $image->filename;
1323
+ while (file_exists($destination_path . '/' . $destination_file_name)) {
1324
+ $tmp_prefix = 'copy_' . ($i++) . '_';
1325
+ $destination_file_name = $tmp_prefix . $image->filename;
1326
+ }
1327
+
1328
+ $destination_file_path = $destination_path . '/' . $destination_file_name;
1329
+ $destination_thumb_file_path = $destination_path . '/' . $image->thumbFolder . $image->thumbPrefix . $destination_file_name;
1330
+
1331
+ // Copy files
1332
+ if ( !@copy($image->imagePath, $destination_file_path) ) {
1333
+ $errors .= sprintf(__('Failed to copy image %1$s to %2$s','flash-album-gallery'),
1334
+ $image->filename, $destination_file_path) . '<br />';
1335
+ continue;
1336
+ }
1337
+
1338
+ // Copy the thumbnail if possible
1339
+ @copy($image->thumbPath, $destination_thumb_file_path);
1340
+
1341
+ // Create new database entry for the image
1342
+ $new_pid = flagdb::insert_image( $destination->gid, $destination_file_name, $image->alttext, $image->description, $image->exclude);
1343
+
1344
+ if (!isset($new_pid)) {
1345
+ $errors .= sprintf(__('Failed to copy database row for picture %s','flash-album-gallery'), $image->pid) . '<br />';
1346
+ continue;
1347
+ }
1348
+
1349
+ if ( $tmp_prefix != '' ) {
1350
+ $messages .= sprintf(__('Image %1$s (%2$s) copied as image %3$s (%4$s) &raquo; The file already existed in the destination gallery.','flash-album-gallery'),
1351
+ $image->pid, $image->filename, $new_pid, $destination_file_name) . '<br />';
1352
+ } else {
1353
+ $messages .= sprintf(__('Image %1$s (%2$s) copied as image %3$s (%4$s)','flash-album-gallery'),
1354
+ $image->pid, $image->filename, $new_pid, $destination_file_name) . '<br />';
1355
+ }
1356
+
1357
+ }
1358
+
1359
+ // Finish by showing errors or success
1360
+ if ( $errors == '' ) {
1361
+ $link = '<a href="' . admin_url() . 'admin.php?page=flag-manage-gallery&mode=edit&gid=' . $destination->gid . '" >' . $destination->title . '</a>';
1362
+ $messages .= '<hr />' . sprintf(__('Copied %1$s picture(s) to gallery: %2$s .','flash-album-gallery'), count($images), $link);
1363
+ }
1364
+
1365
+ if ( $messages != '' )
1366
+ flagGallery::show_message($messages);
1367
+
1368
+ if ( $errors != '' )
1369
+ flagGallery::show_error($errors);
1370
+
1371
+ return;
1372
+ }
1373
+
1374
+ /**
1375
+ * Initate the Ajax operation
1376
+ *
1377
+ * @class flagAdmin
1378
+ * @param string $operation name of the function which should be executed
1379
+ * @param array $image_array
1380
+ * @param string $title name of the operation
1381
+ * @return string the javascript output
1382
+ */
1383
+ public static function do_ajax_operation( $operation, $image_array, $title = '' ) {
1384
+
1385
+ if ( !is_array($image_array) || empty($image_array) )
1386
+ return;
1387
+
1388
+ $js_array = implode('","', $image_array);
1389
+
1390
+ // send out some JavaScript, which initate the ajax operation
1391
+ ?>
1392
+ <script type="text/javascript">
1393
+
1394
+ Images = new Array("<?php echo $js_array; ?>");
1395
+
1396
+ flagAjaxOptions = {
1397
+ operation: "<?php echo $operation; ?>",
1398
+ ids: Images,
1399
+ header: "<?php echo $title; ?>",
1400
+ maxStep: Images.length
1401
+ };
1402
+
1403
+ jQuery(document).ready( function(){
1404
+ flagProgressBar.init( flagAjaxOptions );
1405
+ flagAjax.init( flagAjaxOptions );
1406
+ } );
1407
+ </script>
1408
+
1409
+ <div id="progressbar_container" class="wrap"></div>
1410
+
1411
+ <?php
1412
+ }
1413
+
1414
+ /**
1415
+ * flagAdmin::set_gallery_preview() - define a preview pic after the first upload, can be changed in the gallery settings
1416
+ *
1417
+ * @class flagAdmin
1418
+ * @param int $galleryID
1419
+ * @return void
1420
+ */
1421
+ public static function set_gallery_preview( $galleryID ) {
1422
+ global $wpdb;
1423
+
1424
+ $galleryID = intval($galleryID);
1425
+ $gallery = flagdb::find_gallery( $galleryID );
1426
+
1427
+ // in the case no preview image is setup, we do this now
1428
+ if ($gallery->previewpic == 0) {
1429
+ $firstImage = $wpdb->get_var($wpdb->prepare("SELECT `pid` FROM `{$wpdb->flagpictures}` WHERE `exclude` != 1 AND `galleryid` = '%d' ORDER by `pid` DESC limit 0,1", $galleryID));
1430
+ if ($firstImage) {
1431
+ $wpdb->query($wpdb->prepare("UPDATE `{$wpdb->flaggallery}` SET `previewpic` = '%s' WHERE `gid` = '%d'", $firstImage, $galleryID));
1432
+ wp_cache_delete($galleryID, 'flag_gallery');
1433
+ }
1434
+ }
1435
+
1436
+ return;
1437
+ }
1438
+
1439
+ /**
1440
+ * Return a JSON coded array of Image ids for a requested gallery
1441
+ *
1442
+ * @param int $galleryID
1443
+ * @return array (JSON)
1444
+ */
1445
+ public static function get_image_ids( $galleryID ) {
1446
+
1447
+ if ( !function_exists('json_encode') )
1448
+ return(-2);
1449
+
1450
+ $gallery = flagdb::get_ids_from_gallery($galleryID, 'pid', 'ASC', false);
1451
+
1452
+ header('Content-Type: text/plain; charset=' . get_option('blog_charset'), true);
1453
+ $output = json_encode($gallery);
1454
+
1455
+ return $output;
1456
+ }
1457
+
1458
+ } // END class flagAdmin
1459
+ }
admin/images/woowbox-promote.png CHANGED
Binary file
admin/js/Jcrop/js/jquery.Jcrop.js CHANGED
@@ -44,9 +44,8 @@ btndown=true;docOffset=getPos($img);Selection.disableHandles();Tracker.setCursor
44
  function selectDrag(pos)
45
  {Coords.setCurrent(pos);Selection.update();}
46
  function newTracker()
47
- {var trk=$('<div></div>').addClass(cssClass('tracker'));if($.browser.msie){trk.css({opacity:0,backgroundColor:'white'});}
48
  return trk;}
49
- if($.browser.msie&&($.browser.version.split('.')[0]==='6')){ie6mode=true;}
50
  if(typeof(obj)!=='object'){obj=$(obj)[0];}
51
  if(typeof(opt)!=='object'){opt={};}
52
  setOptions(opt);var img_css={border:'none',margin:0,padding:0,position:'absolute'};var $origimg=$(obj);var $img=$origimg.clone().removeAttr('id').css(img_css);$img.width($origimg.width());$img.height($origimg.height());$origimg.after($img).hide();presize($img,options.boxWidth,options.boxHeight);var boundx=$img.width(),boundy=$img.height(),$div=$('<div />').width(boundx).height(boundy).addClass(cssClass('holder')).css({position:'relative',backgroundColor:options.bgColor}).insertAfter($origimg).append($img);if(options.addClass){$div.addClass(options.addClass);}
@@ -244,7 +243,7 @@ Shade.refresh();if(options.bgColor!=bgcolor){colorChangeMacro(options.shade?Shad
244
  if(bgopacity!=options.bgOpacity){bgopacity=options.bgOpacity;if(options.shade)Shade.refresh();else Selection.setBgOpacity(bgopacity);}
245
  xlimit=options.maxSize[0]||0;ylimit=options.maxSize[1]||0;xmin=options.minSize[0]||0;ymin=options.minSize[1]||0;if(options.hasOwnProperty('outerImage')){$img.attr('src',options.outerImage);delete(options.outerImage);}
246
  Selection.refresh();}
247
- if(Touch.support)$trk.bind('touchstart',Touch.newSelection);$hdl_holder.hide();interfaceUpdate(true);var api={setImage:setImage,animateTo:animateTo,setSelect:setSelect,setOptions:setOptionsNew,tellSelect:tellSelect,tellScaled:tellScaled,setClass:setClass,disable:disableCrop,enable:enableCrop,cancel:cancelCrop,release:Selection.release,destroy:destroy,focus:KeyManager.watchKeys,getBounds:function(){return[boundx*xscale,boundy*yscale];},getWidgetSize:function(){return[boundx,boundy];},getScaleFactor:function(){return[xscale,yscale];},ui:{holder:$div,selection:$sel}};if($.browser.msie){$div.bind('selectstart',function(){return false;});}
248
  $origimg.data('Jcrop',api);return api;};$.fn.Jcrop=function(options,callback)
249
  {function attachWhenDone(from)
250
  {var opt=(typeof(options)==='object')?options:{};var loadsrc=opt.useImg||from.src;var img=new Image();img.onload=function(){function attachJcrop(){var api=$.Jcrop(from,opt);if(typeof(callback)==='function'){callback.call(api);}}
@@ -252,4 +251,4 @@ function attachAttempt(){if(!img.width||!img.height){window.setTimeout(attachAtt
252
  window.setTimeout(attachAttempt,50);};img.src=loadsrc;}
253
  this.each(function(){if($(this).data('Jcrop')){if(options==='api'){return $(this).data('Jcrop');}
254
  else{$(this).data('Jcrop').setOptions(options);}}
255
- else{attachWhenDone(this);}});return this;};$.Jcrop.defaults={allowSelect:true,allowMove:true,allowResize:true,trackDocument:true,baseClass:'jcrop',addClass:null,bgColor:'black',bgOpacity:0.6,bgFade:false,borderOpacity:0.4,handleOpacity:0.5,handleSize:7,handleOffset:5,aspectRatio:0,keySupport:true,cornerHandles:true,sideHandles:true,drawBorders:true,dragEdges:true,fixedSupport:true,touchSupport:null,shade:false,boxWidth:0,boxHeight:0,boundary:2,fadeTime:400,animationDelay:20,swingSpeed:3,minSelect:[0,0],maxSize:[0,0],minSize:[0,0],onChange:function(){},onSelect:function(){},onDblClick:function(){},onRelease:function(){}};}(jQuery));
44
  function selectDrag(pos)
45
  {Coords.setCurrent(pos);Selection.update();}
46
  function newTracker()
47
+ {var trk=$('<div></div>').addClass(cssClass('tracker'));
48
  return trk;}
 
49
  if(typeof(obj)!=='object'){obj=$(obj)[0];}
50
  if(typeof(opt)!=='object'){opt={};}
51
  setOptions(opt);var img_css={border:'none',margin:0,padding:0,position:'absolute'};var $origimg=$(obj);var $img=$origimg.clone().removeAttr('id').css(img_css);$img.width($origimg.width());$img.height($origimg.height());$origimg.after($img).hide();presize($img,options.boxWidth,options.boxHeight);var boundx=$img.width(),boundy=$img.height(),$div=$('<div />').width(boundx).height(boundy).addClass(cssClass('holder')).css({position:'relative',backgroundColor:options.bgColor}).insertAfter($origimg).append($img);if(options.addClass){$div.addClass(options.addClass);}
243
  if(bgopacity!=options.bgOpacity){bgopacity=options.bgOpacity;if(options.shade)Shade.refresh();else Selection.setBgOpacity(bgopacity);}
244
  xlimit=options.maxSize[0]||0;ylimit=options.maxSize[1]||0;xmin=options.minSize[0]||0;ymin=options.minSize[1]||0;if(options.hasOwnProperty('outerImage')){$img.attr('src',options.outerImage);delete(options.outerImage);}
245
  Selection.refresh();}
246
+ if(Touch.support)$trk.bind('touchstart',Touch.newSelection);$hdl_holder.hide();interfaceUpdate(true);var api={setImage:setImage,animateTo:animateTo,setSelect:setSelect,setOptions:setOptionsNew,tellSelect:tellSelect,tellScaled:tellScaled,setClass:setClass,disable:disableCrop,enable:enableCrop,cancel:cancelCrop,release:Selection.release,destroy:destroy,focus:KeyManager.watchKeys,getBounds:function(){return[boundx*xscale,boundy*yscale];},getWidgetSize:function(){return[boundx,boundy];},getScaleFactor:function(){return[xscale,yscale];},ui:{holder:$div,selection:$sel}};
247
  $origimg.data('Jcrop',api);return api;};$.fn.Jcrop=function(options,callback)
248
  {function attachWhenDone(from)
249
  {var opt=(typeof(options)==='object')?options:{};var loadsrc=opt.useImg||from.src;var img=new Image();img.onload=function(){function attachJcrop(){var api=$.Jcrop(from,opt);if(typeof(callback)==='function'){callback.call(api);}}
251
  window.setTimeout(attachAttempt,50);};img.src=loadsrc;}
252
  this.each(function(){if($(this).data('Jcrop')){if(options==='api'){return $(this).data('Jcrop');}
253
  else{$(this).data('Jcrop').setOptions(options);}}
254
+ else{attachWhenDone(this);}});return this;};$.Jcrop.defaults={allowSelect:true,allowMove:true,allowResize:true,trackDocument:true,baseClass:'jcrop',addClass:null,bgColor:'black',bgOpacity:0.6,bgFade:false,borderOpacity:0.4,handleOpacity:0.5,handleSize:7,handleOffset:5,aspectRatio:0,keySupport:true,cornerHandles:true,sideHandles:true,drawBorders:true,dragEdges:true,fixedSupport:true,touchSupport:null,shade:false,boxWidth:0,boxHeight:0,boundary:2,fadeTime:400,animationDelay:20,swingSpeed:3,minSelect:[0,0],maxSize:[0,0],minSize:[0,0],onChange:function(){},onSelect:function(){},onDblClick:function(){},onRelease:function(){}};}(jQuery));
admin/js/flagallery-block.js CHANGED
@@ -1,4 +1,4 @@
1
- (function(blocks, element) {
2
  var el = element.createElement,
3
  source = blocks.source;
4
 
@@ -9,10 +9,12 @@
9
  var type = atts.type;
10
  var galleryname = atts.galleryname || '';
11
  var skin = atts.skin || '';
 
12
  var skinalign = atts.align || '';
13
  var gallerywidth = atts.width || '';
14
 
15
  var skinname = '';
 
16
  var gallerysize = '';
17
  if('gallery' == type) {
18
  scid = ' gid=' + id;
@@ -40,6 +42,17 @@
40
  skinname = '';
41
  skin = flagallery_data.default_skin;
42
  }
 
 
 
 
 
 
 
 
 
 
 
43
  if(skinalign) {
44
  skinalign = ' align=' + skinalign;
45
  }
@@ -47,7 +60,7 @@
47
  skinalign = '';
48
  }
49
 
50
- tagtext = '[flagallery' + scid + galleryname + gallerysize + skinname + skinalign + ']';
51
 
52
  return el('div', {className: 'flagallery-shortcode'}, tagtext);
53
  }
@@ -69,6 +82,9 @@
69
  skin: {
70
  type: 'string',
71
  },
 
 
 
72
  align: {
73
  type: 'string',
74
  },
@@ -82,6 +98,7 @@
82
  var type = props.attributes.type;
83
  var id = props.attributes.id;
84
  var skin = props.attributes.skin;
 
85
  var align = props.attributes.align;
86
  var width = props.attributes.width;
87
  var elclass = '';
@@ -108,6 +125,7 @@
108
  id: id,
109
  type: type,
110
  skin: form.find('.flagallery-skin').val(),
 
111
  align: form.find('.flagallery-align').val(),
112
  galleryname: galleryname,
113
  width: form.find('.flagallery-width').val(),
@@ -115,6 +133,20 @@
115
  event.preventDefault();
116
  }
117
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
118
  // Choose galleries
119
  options.push(
120
  el('option', {value: ''}, '- Select your album / gallery -'),
@@ -159,7 +191,25 @@
159
  );
160
  });
161
  children.push(
162
- el('select', {className: 'flagallery-skin', value: skin, onChange: setGallery}, options),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
163
  );
164
 
165
  // skin align
@@ -212,4 +262,5 @@
212
  })(
213
  window.wp.blocks,
214
  window.wp.element,
 
215
  );
1
+ (function(blocks, element, $) {
2
  var el = element.createElement,
3
  source = blocks.source;
4
 
9
  var type = atts.type;
10
  var galleryname = atts.galleryname || '';
11
  var skin = atts.skin || '';
12
+ var preset = atts.preset || '';
13
  var skinalign = atts.align || '';
14
  var gallerywidth = atts.width || '';
15
 
16
  var skinname = '';
17
+ var skinpreset = '';
18
  var gallerysize = '';
19
  if('gallery' == type) {
20
  scid = ' gid=' + id;
42
  skinname = '';
43
  skin = flagallery_data.default_skin;
44
  }
45
+ if(preset) {
46
+ if(preset.indexOf(' ') >= 0) {
47
+ skinpreset = ' preset=\'' + preset + '\'';
48
+ } else {
49
+ skinpreset = ' preset=' + preset;
50
+ }
51
+ }
52
+ else {
53
+ skinpreset = '';
54
+ preset = '';
55
+ }
56
  if(skinalign) {
57
  skinalign = ' align=' + skinalign;
58
  }
60
  skinalign = '';
61
  }
62
 
63
+ tagtext = '[flagallery' + scid + galleryname + gallerysize + skinname + skinpreset + skinalign + ']';
64
 
65
  return el('div', {className: 'flagallery-shortcode'}, tagtext);
66
  }
82
  skin: {
83
  type: 'string',
84
  },
85
+ preset: {
86
+ type: 'string',
87
+ },
88
  align: {
89
  type: 'string',
90
  },
98
  var type = props.attributes.type;
99
  var id = props.attributes.id;
100
  var skin = props.attributes.skin;
101
+ var preset = props.attributes.preset;
102
  var align = props.attributes.align;
103
  var width = props.attributes.width;
104
  var elclass = '';
125
  id: id,
126
  type: type,
127
  skin: form.find('.flagallery-skin').val(),
128
+ preset: form.find('.flagallery-preset').val(),
129
  align: form.find('.flagallery-align').val(),
130
  galleryname: galleryname,
131
  width: form.find('.flagallery-width').val(),
133
  event.preventDefault();
134
  }
135
 
136
+ function setSkin(event) {
137
+ setPreset($(event.target));
138
+ setGallery(event);
139
+ }
140
+
141
+ function setPreset(skinSelect) {
142
+ var form = skinSelect.closest('form.flagallery-preview');
143
+ var skin = skinSelect.val();
144
+ form.find('.flagallery-preset').val('').find('option').removeAttr('style');
145
+ if(skin) {
146
+ form.find('.flagallery-preset option').filter('.' + skin).show();
147
+ }
148
+ }
149
+
150
  // Choose galleries
151
  options.push(
152
  el('option', {value: ''}, '- Select your album / gallery -'),
191
  );
192
  });
193
  children.push(
194
+ el('select', {className: 'flagallery-skin', value: skin, onChange: setSkin}, options),
195
+ );
196
+
197
+ // preset
198
+ options = [];
199
+ options.push(
200
+ el('option', {className:'default-preset', value: ''}, 'Default preset'),
201
+ );
202
+ Object.keys(flagallery_data.presets).forEach(function(key) {
203
+ options.push(
204
+ el('option', {
205
+ className: flagallery_data.presets[key].id,
206
+ value: flagallery_data.presets[key].name,
207
+ style: { display: flagallery_data.presets[key].id === skin? 'block' : false }
208
+ }, flagallery_data.presets[key].name),
209
+ );
210
+ });
211
+ children.push(
212
+ el('select', {className: 'flagallery-preset', value: preset, onChange: setGallery}, options),
213
  );
214
 
215
  // skin align
262
  })(
263
  window.wp.blocks,
264
  window.wp.element,
265
+ jQuery
266
  );
admin/js/jquery.tablesorter.js CHANGED
@@ -1,71 +1,71 @@
1
  /*
2
- *
3
  * TableSorter 2.0 - Client-side table sorting with ease!
4
  * Version 2.0.3
5
  * @requires jQuery v1.2.3
6
- *
7
  * Copyright (c) 2007 Christian Bach
8
  * Examples and docs at: http://tablesorter.com
9
  * Dual licensed under the MIT and GPL licenses:
10
  * http://www.opensource.org/licenses/mit-license.php
11
  * http://www.gnu.org/licenses/gpl.html
12
- *
13
  */
14
  /**
15
  *
16
  * @description Create a sortable table with multi-column sorting capabilitys
17
- *
18
  * @example $('table').tablesorter();
19
  * @desc Create a simple tablesorter interface.
20
  *
21
  * @example $('table').tablesorter({ sortList:[[0,0],[1,0]] });
22
  * @desc Create a tablesorter interface and sort on the first and secound column in ascending order.
23
- *
24
  * @example $('table').tablesorter({ headers: { 0: { sorter: false}, 1: {sorter: false} } });
25
  * @desc Create a tablesorter interface and disableing the first and secound column headers.
26
- *
27
  * @example $('table').tablesorter({ 0: {sorter:"integer"}, 1: {sorter:"currency"} });
28
  * @desc Create a tablesorter interface and set a column parser for the first and secound column.
29
- *
30
- *
31
  * @param Object settings An object literal containing key/value pairs to provide optional settings.
32
- *
33
- * @option String cssHeader (optional) A string of the class name to be appended to sortable tr elements in the thead of the table.
34
  * Default value: "header"
35
- *
36
- * @option String cssAsc (optional) A string of the class name to be appended to sortable tr elements in the thead on a ascending sort.
37
  * Default value: "headerSortUp"
38
- *
39
- * @option String cssDesc (optional) A string of the class name to be appended to sortable tr elements in the thead on a descending sort.
40
  * Default value: "headerSortDown"
41
- *
42
- * @option String sortInitialOrder (optional) A string of the inital sorting order can be asc or desc.
43
  * Default value: "asc"
44
- *
45
- * @option String sortMultisortKey (optional) A string of the multi-column sort key.
46
  * Default value: "shiftKey"
47
- *
48
- * @option String textExtraction (optional) A string of the text-extraction method to use.
49
- * For complex html structures inside td cell set this option to "complex",
50
- * on large tables the complex option can be slow.
51
  * Default value: "simple"
52
- *
53
- * @option Object headers (optional) An array containing the forces sorting rules.
54
- * This option let's you specify a default sorting rule.
55
  * Default value: null
56
- *
57
- * @option Array sortList (optional) An array containing the forces sorting rules.
58
- * This option let's you specify a default sorting rule.
59
  * Default value: null
60
- *
61
- * @option Array sortForce (optional) An array containing forced sorting rules.
62
  * This option let's you specify a default sorting rule, which is prepended to user-selected rules.
63
  * Default value: null
64
- *
65
- * @option Array sortAppend (optional) An array containing forced sorting rules.
66
  * This option let's you specify a default sorting rule, which is appended to user-selected rules.
67
  * Default value: null
68
- *
69
  * @option Boolean widthFixed (optional) Boolean flag indicating if tablesorter should apply fixed widths to the table columns.
70
  * This is usefull when using the pager companion plugin.
71
  * This options requires the dimension jquery plugin.
@@ -79,18 +79,18 @@
79
  * @type jQuery
80
  *
81
  * @name tablesorter
82
- *
83
  * @cat Plugins/Tablesorter
84
- *
85
  * @author Christian Bach/christian.bach@polyester.se
86
  */
87
 
88
  (function($) {
89
  $.extend({
90
  tablesorter: new function() {
91
-
92
  var parsers = [], widgets = [];
93
-
94
  this.defaults = {
95
  cssHeader: "header",
96
  cssAsc: "headerSortUp",
@@ -100,8 +100,8 @@
100
  sortForce: null,
101
  sortAppend: null,
102
  textExtraction: "simple",
103
- parsers: {},
104
- widgets: [],
105
  widgetZebra: {css: ["even","odd"]},
106
  headers: {},
107
  widthFixed: false,
@@ -112,14 +112,14 @@
112
  decimal: '.',
113
  debug: false
114
  };
115
-
116
  /* debuging utils */
117
  function benchmark(s,d) {
118
  log(s + "," + (new Date().getTime() - d.getTime()) + "ms");
119
  }
120
-
121
  this.benchmark = benchmark;
122
-
123
  function log(s) {
124
  if (typeof console != "undefined" && typeof console.debug != "undefined") {
125
  console.log(s);
@@ -127,44 +127,44 @@
127
  alert(s);
128
  }
129
  }
130
-
131
  /* parsers utils */
132
  function buildParserCache(table,$headers) {
133
-
134
  if(table.config.debug) { var parsersDebug = ""; }
135
-
136
  var rows = table.tBodies[0].rows;
137
-
138
  if(table.tBodies[0].rows[0]) {
139
 
140
  var list = [], cells = rows[0].cells, l = cells.length;
141
-
142
  for (var i=0;i < l; i++) {
143
  var p = false;
144
-
145
  if($.metadata && ($($headers[i]).metadata() && $($headers[i]).metadata().sorter) ) {
146
-
147
- p = getParserById($($headers[i]).metadata().sorter);
148
-
149
  } else if((table.config.headers[i] && table.config.headers[i].sorter)) {
150
-
151
  p = getParserById(table.config.headers[i].sorter);
152
  }
153
  if(!p) {
154
  p = detectParserForColumn(table,cells[i]);
155
  }
156
-
157
  if(table.config.debug) { parsersDebug += "column:" + i + " parser:" +p.id + "\n"; }
158
-
159
  list.push(p);
160
  }
161
  }
162
-
163
  if(table.config.debug) { log(parsersDebug); }
164
 
165
  return list;
166
  };
167
-
168
  function detectParserForColumn(table,node) {
169
  var l = parsers.length;
170
  for(var i=1; i < l; i++) {
@@ -175,55 +175,55 @@
175
  // 0 is always the generic parser (text)
176
  return parsers[0];
177
  }
178
-
179
  function getParserById(name) {
180
  var l = parsers.length;
181
  for(var i=0; i < l; i++) {
182
- if(parsers[i].id.toLowerCase() == name.toLowerCase()) {
183
  return parsers[i];
184
  }
185
  }
186
  return false;
187
  }
188
-
189
  /* utils */
190
  function buildCache(table) {
191
-
192
  if(table.config.debug) { var cacheTime = new Date(); }
193
-
194
-
195
  var totalRows = (table.tBodies[0] && table.tBodies[0].rows.length) || 0,
196
  totalCells = (table.tBodies[0].rows[0] && table.tBodies[0].rows[0].cells.length) || 0,
197
- parsers = table.config.parsers,
198
  cache = {row: [], normalized: []};
199
-
200
  for (var i=0;i < totalRows; ++i) {
201
-
202
  /** Add the table data to main data array */
203
  var c = table.tBodies[0].rows[i], cols = [];
204
-
205
  cache.row.push($(c));
206
-
207
  for(var j=0; j < totalCells; ++j) {
208
- cols.push(parsers[j].format(getElementText(table.config,c.cells[j]),table,c.cells[j]));
209
  }
210
-
211
  cols.push(i); // add position for rowCache
212
  cache.normalized.push(cols);
213
  cols = null;
214
  };
215
-
216
  if(table.config.debug) { benchmark("Building cache for " + totalRows + " rows:", cacheTime); }
217
-
218
  return cache;
219
  };
220
-
221
  function getElementText(config,node) {
222
-
223
  if(!node) return "";
224
-
225
  var t = "";
226
-
227
  if(config.textExtraction == "simple") {
228
  if(node.childNodes[0] && node.childNodes[0].hasChildNodes()) {
229
  t = node.childNodes[0].innerHTML;
@@ -233,99 +233,99 @@
233
  } else {
234
  if(typeof(config.textExtraction) == "function") {
235
  t = config.textExtraction(node);
236
- } else {
237
  t = $(node).text();
238
- }
239
  }
240
  return t;
241
  }
242
-
243
  function appendToTable(table,cache) {
244
-
245
  if(table.config.debug) {var appendTime = new Date()}
246
-
247
- var c = cache,
248
- r = c.row,
249
- n= c.normalized,
250
- totalRows = n.length,
251
- checkCell = (n[0].length-1),
252
  tableBody = $(table.tBodies[0]),
253
  rows = [];
254
-
255
  for (var i=0;i < totalRows; i++) {
256
- rows.push(r[n[i][checkCell]]);
257
  if(!table.config.appender) {
258
-
259
  var o = r[n[i][checkCell]];
260
  var l = o.length;
261
  for(var j=0; j < l; j++) {
262
-
263
  tableBody[0].appendChild(o[j]);
264
-
265
  }
266
-
267
  //tableBody.append(r[n[i][checkCell]]);
268
  }
269
- }
270
-
271
  if(table.config.appender) {
272
-
273
- table.config.appender(table,rows);
274
  }
275
-
276
  rows = null;
277
-
278
  if(table.config.debug) { benchmark("Rebuilt table:", appendTime); }
279
-
280
  //apply table widgets
281
  applyWidget(table);
282
-
283
  // trigger sortend
284
  setTimeout(function() {
285
- $(table).trigger("sortEnd");
286
  },0);
287
-
288
  };
289
-
290
  function buildHeaders(table) {
291
-
292
  if(table.config.debug) { var time = new Date(); }
293
-
294
  var meta = ($.metadata) ? true : false, tableHeadersRows = [];
295
-
296
  for(var i = 0; i < table.tHead.rows.length; i++) { tableHeadersRows[i]=0; };
297
-
298
  $tableHeaders = $("thead th",table);
299
-
300
  $tableHeaders.each(function(index) {
301
-
302
  this.count = 0;
303
  this.column = index;
304
  this.order = formatSortingOrder(table.config.sortInitialOrder);
305
-
306
  if(checkHeaderMetadata(this) || checkHeaderOptions(table,index)) this.sortDisabled = true;
307
-
308
  if(!this.sortDisabled) {
309
  $(this).addClass(table.config.cssHeader);
310
  }
311
-
312
  // add cell to headerList
313
  table.config.headerList[index]= this;
314
  });
315
-
316
  if(table.config.debug) { benchmark("Built headers:", time); log($tableHeaders); }
317
-
318
  return $tableHeaders;
319
-
320
  };
321
-
322
  function checkCellColSpan(table, rows, row) {
323
  var arr = [], r = table.tHead.rows, c = r[row].cells;
324
-
325
  for(var i=0; i < c.length; i++) {
326
  var cell = c[i];
327
-
328
- if ( cell.colSpan > 1) {
329
  arr = arr.concat(checkCellColSpan(table, headerArr,row++));
330
  } else {
331
  if(table.tHead.length == 1 || (cell.rowSpan > 1 || !r[row+1])) {
@@ -336,38 +336,38 @@
336
  }
337
  return arr;
338
  };
339
-
340
  function checkHeaderMetadata(cell) {
341
  if(($.metadata) && ($(cell).metadata().sorter === false)) { return true; };
342
  return false;
343
  }
344
-
345
- function checkHeaderOptions(table,i) {
346
  if((table.config.headers[i]) && (table.config.headers[i].sorter === false)) { return true; };
347
  return false;
348
  }
349
-
350
  function applyWidget(table) {
351
  var c = table.config.widgets;
352
  var l = c.length;
353
  for(var i=0; i < l; i++) {
354
-
355
  getWidgetById(c[i]).format(table);
356
  }
357
-
358
  }
359
-
360
  function getWidgetById(name) {
361
  var l = widgets.length;
362
  for(var i=0; i < l; i++) {
363
  if(widgets[i].id.toLowerCase() == name.toLowerCase() ) {
364
- return widgets[i];
365
  }
366
  }
367
  };
368
-
369
  function formatSortingOrder(v) {
370
-
371
  if(typeof(v) != "Number") {
372
  i = (v.toLowerCase() == "desc") ? 1 : 0;
373
  } else {
@@ -375,34 +375,34 @@
375
  }
376
  return i;
377
  }
378
-
379
  function isValueInArray(v, a) {
380
  var l = a.length;
381
  for(var i=0; i < l; i++) {
382
  if(a[i][0] == v) {
383
- return true;
384
  }
385
  }
386
  return false;
387
  }
388
-
389
  function setHeadersCss(table,$headers, list, css) {
390
  // remove all header information
391
  $headers.removeClass(css[0]).removeClass(css[1]);
392
-
393
  var h = [];
394
  $headers.each(function(offset) {
395
  if(!this.sortDisabled) {
396
- h[this.column] = $(this);
397
  }
398
  });
399
-
400
- var l = list.length;
401
  for(var i=0; i < l; i++) {
402
  h[list[i][0]].addClass(css[list[i][1]]);
403
  }
404
  }
405
-
406
  function fixColumnWidth(table,$headers) {
407
  var c = table.config;
408
  if(c.widthFixed) {
@@ -413,7 +413,7 @@
413
  $(table).prepend(colgroup);
414
  };
415
  }
416
-
417
  function updateHeaderSortCount(table,sortList) {
418
  var c = table.config, l = sortList.length;
419
  for(var i=0; i < l; i++) {
@@ -422,142 +422,142 @@
422
  o.count++;
423
  }
424
  }
425
-
426
  /* sorting methods */
427
  function multisort(table,sortList,cache) {
428
-
429
  if(table.config.debug) { var sortTime = new Date(); }
430
-
431
  var dynamicExp = "var sortWrapper = function(a,b) {", l = sortList.length;
432
-
433
  for(var i=0; i < l; i++) {
434
-
435
  var c = sortList[i][0];
436
  var order = sortList[i][1];
437
  var s = (getCachedSortType(table.config.parsers,c) == "text") ? ((order == 0) ? "sortText" : "sortTextDesc") : ((order == 0) ? "sortNumeric" : "sortNumericDesc");
438
-
439
  var e = "e" + i;
440
-
441
  dynamicExp += "var " + e + " = " + s + "(a[" + c + "],b[" + c + "]); ";
442
  dynamicExp += "if(" + e + ") { return " + e + "; } ";
443
  dynamicExp += "else { ";
444
  }
445
-
446
- // if value is the same keep orignal order
447
  var orgOrderCol = cache.normalized[0].length - 1;
448
  dynamicExp += "return a[" + orgOrderCol + "]-b[" + orgOrderCol + "];";
449
-
450
  for(var i=0; i < l; i++) {
451
  dynamicExp += "}; ";
452
  }
453
-
454
- dynamicExp += "return 0; ";
455
- dynamicExp += "}; ";
456
-
457
  eval(dynamicExp);
458
-
459
  cache.normalized.sort(sortWrapper);
460
-
461
  if(table.config.debug) { benchmark("Sorting on " + sortList.toString() + " and dir " + order+ " time:", sortTime); }
462
-
463
  return cache;
464
  };
465
-
466
  function sortText(a,b) {
467
  return ((a < b) ? -1 : ((a > b) ? 1 : 0));
468
  };
469
-
470
  function sortTextDesc(a,b) {
471
  return ((b < a) ? -1 : ((b > a) ? 1 : 0));
472
- };
473
-
474
  function sortNumeric(a,b) {
475
  return a-b;
476
  };
477
-
478
  function sortNumericDesc(a,b) {
479
  return b-a;
480
  };
481
-
482
  function getCachedSortType(parsers,i) {
483
  return parsers[i].type;
484
  };
485
-
486
  /* public methods */
487
  this.construct = function(settings) {
488
 
489
  return this.each(function() {
490
-
491
  if(!this.tHead || !this.tBodies) return;
492
-
493
  var $this, $document,$headers, cache, config, shiftDown = 0, sortOrder;
494
-
495
  this.config = {};
496
-
497
  config = $.extend(this.config, $.tablesorter.defaults, settings);
498
-
499
- // store common expression for speed
500
  $this = $(this);
501
-
502
  // build headers
503
  $headers = buildHeaders(this);
504
-
505
  // try to auto detect column type, and store in tables config
506
  this.config.parsers = buildParserCache(this,$headers);
507
-
508
-
509
  // build the cache for the tbody cells
510
  cache = buildCache(this);
511
-
512
  // get the css class names, could be done else where.
513
  var sortCSS = [config.cssDesc,config.cssAsc];
514
-
515
  // fixate columns if the users supplies the fixedWidth option
516
  fixColumnWidth(this);
517
-
518
  // apply event handling to headers
519
  // this is to big, perhaps break it out?
520
  $headers.click(function(e) {
521
-
522
  $this.trigger("sortStart");
523
-
524
  var totalRows = ($this[0].tBodies[0] && $this[0].tBodies[0].rows.length) || 0;
525
-
526
  if(!this.sortDisabled && totalRows > 0) {
527
-
528
-
529
  // store exp, for speed
530
  var $cell = $(this);
531
-
532
  // get current column index
533
  var i = this.column;
534
-
535
  // get current column sort order
536
  this.order = this.count++ % 2;
537
-
538
  // user only whants to sort on one column
539
  if(!e[config.sortMultiSortKey]) {
540
-
541
  // flush the sort list
542
  config.sortList = [];
543
-
544
  if(config.sortForce != null) {
545
- var a = config.sortForce;
546
  for(var j=0; j < a.length; j++) {
547
  if(a[j][0] != i) {
548
  config.sortList.push(a[j]);
549
  }
550
  }
551
  }
552
-
553
  // add column to sort list
554
  config.sortList.push([i,this.order]);
555
-
556
  // multi column sorting
557
  } else {
558
  // the user has clicked on an all ready sortet column.
559
- if(isValueInArray(i,config.sortList)) {
560
-
561
  // revers the sorting direction for all tables.
562
  for(var j=0; j < config.sortList.length; j++) {
563
  var s = config.sortList[j], o = config.headerList[s[0]];
@@ -566,7 +566,7 @@
566
  o.count++;
567
  s[1] = o.count % 2;
568
  }
569
- }
570
  } else {
571
  // add column to sort list array
572
  config.sortList.push([i,this.order]);
@@ -580,68 +580,68 @@
580
  // stop normal event by returning false
581
  return false;
582
  }
583
- // cancel selection
584
  }).mousedown(function() {
585
  if(config.cancelSelection) {
586
  this.onselectstart = function() {return false};
587
  return false;
588
  }
589
  });
590
-
591
  // apply easy methods that trigger binded events
592
  $this.bind("update",function() {
593
-
594
  // rebuild parsers.
595
  this.config.parsers = buildParserCache(this,$headers);
596
-
597
  // rebuild the cache map
598
  cache = buildCache(this);
599
-
600
  }).bind("sorton",function(e,list) {
601
-
602
  $(this).trigger("sortStart");
603
-
604
  config.sortList = list;
605
-
606
  // update and store the sortlist
607
  var sortList = config.sortList;
608
-
609
  // update header count index
610
  updateHeaderSortCount(this,sortList);
611
-
612
  //set css for headers
613
  setHeadersCss(this,$headers,sortList,sortCSS);
614
-
615
-
616
  // sort the table and append it to the dom
617
  appendToTable(this,multisort(this,sortList,cache));
618
 
619
  }).bind("appendCache",function() {
620
-
621
  appendToTable(this,cache);
622
-
623
  }).bind("applyWidgetId",function(e,id) {
624
-
625
  getWidgetById(id).format(this);
626
-
627
  }).bind("applyWidgets",function() {
628
  // apply widgets
629
  applyWidget(this);
630
  });
631
-
632
  if($.metadata && ($(this).metadata() && $(this).metadata().sortlist)) {
633
  config.sortList = $(this).metadata().sortlist;
634
  }
635
  // if user has supplied a sort list to constructor.
636
  if(config.sortList.length > 0) {
637
- $this.trigger("sorton",[config.sortList]);
638
  }
639
-
640
  // apply widgets
641
  applyWidget(this);
642
  });
643
  };
644
-
645
  this.addParser = function(parser) {
646
  var l = parsers.length, a = true;
647
  for(var i=0; i < l; i++) {
@@ -651,11 +651,11 @@
651
  }
652
  if(a) { parsers.push(parser); };
653
  };
654
-
655
  this.addWidget = function(widget) {
656
  widgets.push(widget);
657
  };
658
-
659
  this.formatFloat = function(s) {
660
  var i = parseFloat(s);
661
  return (isNaN(i)) ? 0 : i;
@@ -664,33 +664,26 @@
664
  var i = parseInt(s);
665
  return (isNaN(i)) ? 0 : i;
666
  };
667
-
668
  this.isDigit = function(s,config) {
669
  var DECIMAL = '\\' + config.decimal;
670
  var exp = '/(^[+]?0(' + DECIMAL +'0+)?$)|(^([-+]?[1-9][0-9]*)$)|(^([-+]?((0?|[1-9][0-9]*)' + DECIMAL +'(0*[1-9][0-9]*)))$)|(^[-+]?[1-9]+[0-9]*' + DECIMAL +'0+$)/';
671
  return RegExp(exp).test($.trim(s));
672
  };
673
-
674
  this.clearTableBody = function(table) {
675
- if($.browser.msie) {
676
- function empty() {
677
- while ( this.firstChild ) this.removeChild( this.firstChild );
678
- }
679
- empty.apply(table.tBodies[0]);
680
- } else {
681
- table.tBodies[0].innerHTML = "";
682
- }
683
  };
684
  }
685
  });
686
-
687
  // extend plugin scope
688
  $.fn.extend({
689
  tablesorter: $.tablesorter.construct
690
  });
691
-
692
  var ts = $.tablesorter;
693
-
694
  // add default parsers
695
  ts.addParser({
696
  id: "text",
@@ -702,7 +695,7 @@
702
  },
703
  type: "text"
704
  });
705
-
706
  ts.addParser({
707
  id: "digit",
708
  is: function(s,table) {
@@ -714,7 +707,7 @@
714
  },
715
  type: "numeric"
716
  });
717
-
718
  ts.addParser({
719
  id: "currency",
720
  is: function(s) {
@@ -725,7 +718,7 @@
725
  },
726
  type: "numeric"
727
  });
728
-
729
  ts.addParser({
730
  id: "ipAddress",
731
  is: function(s) {
@@ -745,7 +738,7 @@
745
  },
746
  type: "numeric"
747
  });
748
-
749
  ts.addParser({
750
  id: "url",
751
  is: function(s) {
@@ -756,7 +749,7 @@
756
  },
757
  type: "text"
758
  });
759
-
760
  ts.addParser({
761
  id: "isoDate",
762
  is: function(s) {
@@ -767,10 +760,10 @@
767
  },
768
  type: "numeric"
769
  });
770
-
771
  ts.addParser({
772
  id: "percent",
773
- is: function(s) {
774
  return /\%$/.test($.trim(s));
775
  },
776
  format: function(s) {
@@ -805,7 +798,7 @@
805
  //reformat the string in ISO format
806
  s = s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4})/, "$3/$2/$1");
807
  } else if(c.dateFormat == "dd/mm/yy" || c.dateFormat == "dd-mm-yy") {
808
- s = s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{2})/, "$1/$2/$3");
809
  }
810
  return $.tablesorter.formatFloat(new Date(s).getTime());
811
  },
@@ -822,8 +815,8 @@
822
  },
823
  type: "numeric"
824
  });
825
-
826
-
827
  ts.addParser({
828
  id: "metadata",
829
  is: function(s) {
@@ -835,7 +828,7 @@
835
  },
836
  type: "numeric"
837
  });
838
-
839
  // add default widgets
840
  ts.addWidget({
841
  id: "zebra",
@@ -848,5 +841,5 @@
848
  .removeClass(table.config.widgetZebra.css[0]).addClass(table.config.widgetZebra.css[1]);
849
  if(table.config.debug) { $.tablesorter.benchmark("Applying Zebra widget", time); }
850
  }
851
- });
852
- })(jQuery);
1
  /*
2
+ *
3
  * TableSorter 2.0 - Client-side table sorting with ease!
4
  * Version 2.0.3
5
  * @requires jQuery v1.2.3
6
+ *
7
  * Copyright (c) 2007 Christian Bach
8
  * Examples and docs at: http://tablesorter.com
9
  * Dual licensed under the MIT and GPL licenses:
10
  * http://www.opensource.org/licenses/mit-license.php
11
  * http://www.gnu.org/licenses/gpl.html
12
+ *
13
  */
14
  /**
15
  *
16
  * @description Create a sortable table with multi-column sorting capabilitys
17
+ *
18
  * @example $('table').tablesorter();
19
  * @desc Create a simple tablesorter interface.
20
  *
21
  * @example $('table').tablesorter({ sortList:[[0,0],[1,0]] });
22
  * @desc Create a tablesorter interface and sort on the first and secound column in ascending order.
23
+ *
24
  * @example $('table').tablesorter({ headers: { 0: { sorter: false}, 1: {sorter: false} } });
25
  * @desc Create a tablesorter interface and disableing the first and secound column headers.
26
+ *
27
  * @example $('table').tablesorter({ 0: {sorter:"integer"}, 1: {sorter:"currency"} });
28
  * @desc Create a tablesorter interface and set a column parser for the first and secound column.
29
+ *
30
+ *
31
  * @param Object settings An object literal containing key/value pairs to provide optional settings.
32
+ *
33
+ * @option String cssHeader (optional) A string of the class name to be appended to sortable tr elements in the thead of the table.
34
  * Default value: "header"
35
+ *
36
+ * @option String cssAsc (optional) A string of the class name to be appended to sortable tr elements in the thead on a ascending sort.
37
  * Default value: "headerSortUp"
38
+ *
39
+ * @option String cssDesc (optional) A string of the class name to be appended to sortable tr elements in the thead on a descending sort.
40
  * Default value: "headerSortDown"
41
+ *
42
+ * @option String sortInitialOrder (optional) A string of the inital sorting order can be asc or desc.
43
  * Default value: "asc"
44
+ *
45
+ * @option String sortMultisortKey (optional) A string of the multi-column sort key.
46
  * Default value: "shiftKey"
47
+ *
48
+ * @option String textExtraction (optional) A string of the text-extraction method to use.
49
+ * For complex html structures inside td cell set this option to "complex",
50
+ * on large tables the complex option can be slow.
51
  * Default value: "simple"
52
+ *
53
+ * @option Object headers (optional) An array containing the forces sorting rules.
54
+ * This option let's you specify a default sorting rule.
55
  * Default value: null
56
+ *
57
+ * @option Array sortList (optional) An array containing the forces sorting rules.
58
+ * This option let's you specify a default sorting rule.
59
  * Default value: null
60
+ *
61
+ * @option Array sortForce (optional) An array containing forced sorting rules.
62
  * This option let's you specify a default sorting rule, which is prepended to user-selected rules.
63
  * Default value: null
64
+ *
65
+ * @option Array sortAppend (optional) An array containing forced sorting rules.
66
  * This option let's you specify a default sorting rule, which is appended to user-selected rules.
67
  * Default value: null
68
+ *
69
  * @option Boolean widthFixed (optional) Boolean flag indicating if tablesorter should apply fixed widths to the table columns.
70
  * This is usefull when using the pager companion plugin.
71
  * This options requires the dimension jquery plugin.
79
  * @type jQuery
80
  *
81
  * @name tablesorter
82
+ *
83
  * @cat Plugins/Tablesorter
84
+ *
85
  * @author Christian Bach/christian.bach@polyester.se
86
  */
87
 
88
  (function($) {
89
  $.extend({
90
  tablesorter: new function() {
91
+
92
  var parsers = [], widgets = [];
93
+
94
  this.defaults = {
95
  cssHeader: "header",
96
  cssAsc: "headerSortUp",
100
  sortForce: null,
101
  sortAppend: null,
102
  textExtraction: "simple",
103
+ parsers: {},
104
+ widgets: [],
105
  widgetZebra: {css: ["even","odd"]},
106
  headers: {},
107
  widthFixed: false,
112
  decimal: '.',
113
  debug: false
114
  };
115
+
116
  /* debuging utils */
117
  function benchmark(s,d) {
118
  log(s + "," + (new Date().getTime() - d.getTime()) + "ms");
119
  }
120
+
121
  this.benchmark = benchmark;
122
+
123
  function log(s) {
124
  if (typeof console != "undefined" && typeof console.debug != "undefined") {
125
  console.log(s);
127
  alert(s);
128
  }
129
  }
130
+
131
  /* parsers utils */
132
  function buildParserCache(table,$headers) {
133
+
134
  if(table.config.debug) { var parsersDebug = ""; }
135
+
136
  var rows = table.tBodies[0].rows;
137
+
138
  if(table.tBodies[0].rows[0]) {
139
 
140
  var list = [], cells = rows[0].cells, l = cells.length;
141
+
142
  for (var i=0;i < l; i++) {
143
  var p = false;
144
+
145
  if($.metadata && ($($headers[i]).metadata() && $($headers[i]).metadata().sorter) ) {
146
+
147
+ p = getParserById($($headers[i]).metadata().sorter);
148
+
149
  } else if((table.config.headers[i] && table.config.headers[i].sorter)) {
150
+
151
  p = getParserById(table.config.headers[i].sorter);
152
  }
153
  if(!p) {
154
  p = detectParserForColumn(table,cells[i]);
155
  }
156
+
157
  if(table.config.debug) { parsersDebug += "column:" + i + " parser:" +p.id + "\n"; }
158
+
159
  list.push(p);
160
  }
161
  }
162
+
163
  if(table.config.debug) { log(parsersDebug); }
164
 
165
  return list;
166
  };
167
+
168
  function detectParserForColumn(table,node) {
169
  var l = parsers.length;
170
  for(var i=1; i < l; i++) {
175
  // 0 is always the generic parser (text)
176
  return parsers[0];
177
  }
178
+
179
  function getParserById(name) {
180
  var l = parsers.length;
181
  for(var i=0; i < l; i++) {
182
+ if(parsers[i].id.toLowerCase() == name.toLowerCase()) {
183
  return parsers[i];
184
  }
185
  }
186
  return false;
187
  }
188
+
189
  /* utils */
190
  function buildCache(table) {
191
+
192
  if(table.config.debug) { var cacheTime = new Date(); }
193
+
194
+
195
  var totalRows = (table.tBodies[0] && table.tBodies[0].rows.length) || 0,
196
  totalCells = (table.tBodies[0].rows[0] && table.tBodies[0].rows[0].cells.length) || 0,
197
+ parsers = table.config.parsers,
198
  cache = {row: [], normalized: []};
199
+
200
  for (var i=0;i < totalRows; ++i) {
201
+
202
  /** Add the table data to main data array */
203
  var c = table.tBodies[0].rows[i], cols = [];
204
+
205
  cache.row.push($(c));
206
+
207
  for(var j=0; j < totalCells; ++j) {
208
+ cols.push(parsers[j].format(getElementText(table.config,c.cells[j]),table,c.cells[j]));
209
  }
210
+
211
  cols.push(i); // add position for rowCache
212
  cache.normalized.push(cols);
213
  cols = null;
214
  };
215
+
216
  if(table.config.debug) { benchmark("Building cache for " + totalRows + " rows:", cacheTime); }
217
+
218
  return cache;
219
  };
220
+
221
  function getElementText(config,node) {
222
+
223
  if(!node) return "";
224
+
225
  var t = "";
226
+
227
  if(config.textExtraction == "simple") {
228
  if(node.childNodes[0] && node.childNodes[0].hasChildNodes()) {
229
  t = node.childNodes[0].innerHTML;
233
  } else {
234
  if(typeof(config.textExtraction) == "function") {
235
  t = config.textExtraction(node);
236
+ } else {
237
  t = $(node).text();
238
+ }
239
  }
240
  return t;
241
  }
242
+
243
  function appendToTable(table,cache) {
244
+
245
  if(table.config.debug) {var appendTime = new Date()}
246
+
247
+ var c = cache,
248
+ r = c.row,
249
+ n= c.normalized,
250
+ totalRows = n.length,
251
+ checkCell = (n[0].length-1),
252
  tableBody = $(table.tBodies[0]),
253
  rows = [];
254
+
255
  for (var i=0;i < totalRows; i++) {
256
+ rows.push(r[n[i][checkCell]]);
257
  if(!table.config.appender) {
258
+
259
  var o = r[n[i][checkCell]];
260
  var l = o.length;
261
  for(var j=0; j < l; j++) {
262
+
263
  tableBody[0].appendChild(o[j]);
264
+
265
  }
266
+
267
  //tableBody.append(r[n[i][checkCell]]);
268
  }
269
+ }
270
+
271
  if(table.config.appender) {
272
+
273
+ table.config.appender(table,rows);
274
  }
275
+
276
  rows = null;
277
+
278
  if(table.config.debug) { benchmark("Rebuilt table:", appendTime); }
279
+
280
  //apply table widgets
281
  applyWidget(table);
282
+
283
  // trigger sortend
284
  setTimeout(function() {
285
+ $(table).trigger("sortEnd");
286
  },0);
287
+
288
  };
289
+
290
  function buildHeaders(table) {
291
+
292
  if(table.config.debug) { var time = new Date(); }
293
+
294
  var meta = ($.metadata) ? true : false, tableHeadersRows = [];
295
+
296
  for(var i = 0; i < table.tHead.rows.length; i++) { tableHeadersRows[i]=0; };
297
+
298
  $tableHeaders = $("thead th",table);
299
+
300
  $tableHeaders.each(function(index) {
301
+
302
  this.count = 0;
303
  this.column = index;
304
  this.order = formatSortingOrder(table.config.sortInitialOrder);
305
+
306
  if(checkHeaderMetadata(this) || checkHeaderOptions(table,index)) this.sortDisabled = true;
307
+
308
  if(!this.sortDisabled) {
309
  $(this).addClass(table.config.cssHeader);
310
  }
311
+
312
  // add cell to headerList
313
  table.config.headerList[index]= this;
314
  });
315
+
316
  if(table.config.debug) { benchmark("Built headers:", time); log($tableHeaders); }
317
+
318
  return $tableHeaders;
319
+
320
  };
321
+
322
  function checkCellColSpan(table, rows, row) {
323
  var arr = [], r = table.tHead.rows, c = r[row].cells;
324
+
325
  for(var i=0; i < c.length; i++) {
326
  var cell = c[i];
327
+
328
+ if ( cell.colSpan > 1) {
329
  arr = arr.concat(checkCellColSpan(table, headerArr,row++));
330
  } else {
331
  if(table.tHead.length == 1 || (cell.rowSpan > 1 || !r[row+1])) {
336
  }
337
  return arr;
338
  };
339
+
340
  function checkHeaderMetadata(cell) {
341
  if(($.metadata) && ($(cell).metadata().sorter === false)) { return true; };
342
  return false;
343
  }
344
+
345
+ function checkHeaderOptions(table,i) {
346
  if((table.config.headers[i]) && (table.config.headers[i].sorter === false)) { return true; };
347
  return false;
348
  }
349
+
350
  function applyWidget(table) {
351
  var c = table.config.widgets;
352
  var l = c.length;
353
  for(var i=0; i < l; i++) {
354
+
355
  getWidgetById(c[i]).format(table);
356
  }
357
+
358
  }
359
+
360
  function getWidgetById(name) {
361
  var l = widgets.length;
362
  for(var i=0; i < l; i++) {
363
  if(widgets[i].id.toLowerCase() == name.toLowerCase() ) {
364
+ return widgets[i];
365
  }
366
  }
367
  };
368
+
369
  function formatSortingOrder(v) {
370
+
371
  if(typeof(v) != "Number") {
372
  i = (v.toLowerCase() == "desc") ? 1 : 0;
373
  } else {
375
  }
376
  return i;
377
  }
378
+
379
  function isValueInArray(v, a) {
380
  var l = a.length;
381
  for(var i=0; i < l; i++) {
382
  if(a[i][0] == v) {
383
+ return true;
384
  }
385
  }
386
  return false;
387
  }
388
+
389
  function setHeadersCss(table,$headers, list, css) {
390
  // remove all header information
391
  $headers.removeClass(css[0]).removeClass(css[1]);
392
+
393
  var h = [];
394
  $headers.each(function(offset) {
395
  if(!this.sortDisabled) {
396
+ h[this.column] = $(this);
397
  }
398
  });
399
+
400
+ var l = list.length;
401
  for(var i=0; i < l; i++) {
402
  h[list[i][0]].addClass(css[list[i][1]]);
403
  }
404
  }
405
+
406
  function fixColumnWidth(table,$headers) {
407
  var c = table.config;
408
  if(c.widthFixed) {
413
  $(table).prepend(colgroup);
414
  };
415
  }
416
+
417
  function updateHeaderSortCount(table,sortList) {
418
  var c = table.config, l = sortList.length;
419
  for(var i=0; i < l; i++) {
422
  o.count++;
423
  }
424
  }
425
+
426
  /* sorting methods */
427
  function multisort(table,sortList,cache) {
428
+
429
  if(table.config.debug) { var sortTime = new Date(); }
430
+
431
  var dynamicExp = "var sortWrapper = function(a,b) {", l = sortList.length;
432
+
433
  for(var i=0; i < l; i++) {
434
+
435
  var c = sortList[i][0];
436
  var order = sortList[i][1];
437
  var s = (getCachedSortType(table.config.parsers,c) == "text") ? ((order == 0) ? "sortText" : "sortTextDesc") : ((order == 0) ? "sortNumeric" : "sortNumericDesc");
438
+
439
  var e = "e" + i;
440
+
441
  dynamicExp += "var " + e + " = " + s + "(a[" + c + "],b[" + c + "]); ";
442
  dynamicExp += "if(" + e + ") { return " + e + "; } ";
443
  dynamicExp += "else { ";
444
  }
445
+
446
+ // if value is the same keep orignal order
447
  var orgOrderCol = cache.normalized[0].length - 1;
448
  dynamicExp += "return a[" + orgOrderCol + "]-b[" + orgOrderCol + "];";
449
+
450
  for(var i=0; i < l; i++) {
451
  dynamicExp += "}; ";
452
  }
453
+
454
+ dynamicExp += "return 0; ";
455
+ dynamicExp += "}; ";
456
+
457
  eval(dynamicExp);
458
+
459
  cache.normalized.sort(sortWrapper);
460
+
461
  if(table.config.debug) { benchmark("Sorting on " + sortList.toString() + " and dir " + order+ " time:", sortTime); }
462
+
463
  return cache;
464
  };
465
+
466
  function sortText(a,b) {
467
  return ((a < b) ? -1 : ((a > b) ? 1 : 0));
468
  };
469
+
470
  function sortTextDesc(a,b) {
471
  return ((b < a) ? -1 : ((b > a) ? 1 : 0));
472
+ };
473
+
474
  function sortNumeric(a,b) {
475
  return a-b;
476
  };
477
+
478
  function sortNumericDesc(a,b) {
479
  return b-a;
480
  };
481
+
482
  function getCachedSortType(parsers,i) {
483
  return parsers[i].type;
484
  };
485
+
486
  /* public methods */
487
  this.construct = function(settings) {
488
 
489
  return this.each(function() {
490
+
491
  if(!this.tHead || !this.tBodies) return;
492
+
493
  var $this, $document,$headers, cache, config, shiftDown = 0, sortOrder;
494
+
495
  this.config = {};
496
+
497
  config = $.extend(this.config, $.tablesorter.defaults, settings);
498
+
499
+ // store common expression for speed
500
  $this = $(this);
501
+
502
  // build headers
503
  $headers = buildHeaders(this);
504
+
505
  // try to auto detect column type, and store in tables config
506
  this.config.parsers = buildParserCache(this,$headers);
507
+
508
+
509
  // build the cache for the tbody cells
510
  cache = buildCache(this);
511
+
512
  // get the css class names, could be done else where.
513
  var sortCSS = [config.cssDesc,config.cssAsc];
514
+
515
  // fixate columns if the users supplies the fixedWidth option
516
  fixColumnWidth(this);
517
+
518
  // apply event handling to headers
519
  // this is to big, perhaps break it out?
520
  $headers.click(function(e) {
521
+
522
  $this.trigger("sortStart");
523
+
524
  var totalRows = ($this[0].tBodies[0] && $this[0].tBodies[0].rows.length) || 0;
525
+
526
  if(!this.sortDisabled && totalRows > 0) {
527
+
528
+
529
  // store exp, for speed
530
  var $cell = $(this);
531
+
532
  // get current column index
533
  var i = this.column;
534
+
535
  // get current column sort order
536
  this.order = this.count++ % 2;
537
+
538
  // user only whants to sort on one column
539
  if(!e[config.sortMultiSortKey]) {
540
+
541
  // flush the sort list
542
  config.sortList = [];
543
+
544
  if(config.sortForce != null) {
545
+ var a = config.sortForce;
546
  for(var j=0; j < a.length; j++) {
547
  if(a[j][0] != i) {
548
  config.sortList.push(a[j]);
549
  }
550
  }
551
  }
552
+
553
  // add column to sort list
554
  config.sortList.push([i,this.order]);
555
+
556
  // multi column sorting
557
  } else {
558
  // the user has clicked on an all ready sortet column.
559
+ if(isValueInArray(i,config.sortList)) {
560
+
561
  // revers the sorting direction for all tables.
562
  for(var j=0; j < config.sortList.length; j++) {
563
  var s = config.sortList[j], o = config.headerList[s[0]];
566
  o.count++;
567
  s[1] = o.count % 2;
568
  }
569
+ }
570
  } else {
571
  // add column to sort list array
572
  config.sortList.push([i,this.order]);
580
  // stop normal event by returning false
581
  return false;
582
  }
583
+ // cancel selection
584
  }).mousedown(function() {
585
  if(config.cancelSelection) {
586
  this.onselectstart = function() {return false};
587
  return false;
588
  }
589
  });
590
+
591
  // apply easy methods that trigger binded events
592
  $this.bind("update",function() {
593
+
594
  // rebuild parsers.
595
  this.config.parsers = buildParserCache(this,$headers);
596
+
597
  // rebuild the cache map
598
  cache = buildCache(this);
599
+
600
  }).bind("sorton",function(e,list) {
601
+
602
  $(this).trigger("sortStart");
603
+
604
  config.sortList = list;
605
+
606
  // update and store the sortlist
607
  var sortList = config.sortList;
608
+
609
  // update header count index
610
  updateHeaderSortCount(this,sortList);
611
+
612
  //set css for headers
613
  setHeadersCss(this,$headers,sortList,sortCSS);
614
+
615
+
616
  // sort the table and append it to the dom
617
  appendToTable(this,multisort(this,sortList,cache));
618
 
619
  }).bind("appendCache",function() {
620
+
621
  appendToTable(this,cache);
622
+
623
  }).bind("applyWidgetId",function(e,id) {
624
+
625
  getWidgetById(id).format(this);
626
+
627
  }).bind("applyWidgets",function() {
628
  // apply widgets
629
  applyWidget(this);
630
  });
631
+
632
  if($.metadata && ($(this).metadata() && $(this).metadata().sortlist)) {
633
  config.sortList = $(this).metadata().sortlist;
634
  }
635
  // if user has supplied a sort list to constructor.
636
  if(config.sortList.length > 0) {
637
+ $this.trigger("sorton",[config.sortList]);
638
  }
639
+
640
  // apply widgets
641
  applyWidget(this);
642
  });
643
  };
644
+
645
  this.addParser = function(parser) {
646
  var l = parsers.length, a = true;
647
  for(var i=0; i < l; i++) {
651
  }
652
  if(a) { parsers.push(parser); };
653
  };
654
+
655
  this.addWidget = function(widget) {
656
  widgets.push(widget);
657
  };
658
+
659
  this.formatFloat = function(s) {
660
  var i = parseFloat(s);
661
  return (isNaN(i)) ? 0 : i;
664
  var i = parseInt(s);
665
  return (isNaN(i)) ? 0 : i;
666
  };
667
+
668
  this.isDigit = function(s,config) {
669
  var DECIMAL = '\\' + config.decimal;
670
  var exp = '/(^[+]?0(' + DECIMAL +'0+)?$)|(^([-+]?[1-9][0-9]*)$)|(^([-+]?((0?|[1-9][0-9]*)' + DECIMAL +'(0*[1-9][0-9]*)))$)|(^[-+]?[1-9]+[0-9]*' + DECIMAL +'0+$)/';
671
  return RegExp(exp).test($.trim(s));
672
  };
673
+
674
  this.clearTableBody = function(table) {
675
+ table.tBodies[0].innerHTML = "";
 
 
 
 
 
 
 
676
  };
677
  }
678
  });
679
+
680
  // extend plugin scope
681
  $.fn.extend({
682
  tablesorter: $.tablesorter.construct
683
  });
684
+
685
  var ts = $.tablesorter;
686
+
687
  // add default parsers
688
  ts.addParser({
689
  id: "text",
695
  },
696
  type: "text"
697
  });
698
+
699
  ts.addParser({
700
  id: "digit",
701
  is: function(s,table) {
707
  },
708
  type: "numeric"
709
  });
710
+
711
  ts.addParser({
712
  id: "currency",
713
  is: function(s) {
718
  },
719
  type: "numeric"
720
  });
721
+
722
  ts.addParser({
723
  id: "ipAddress",
724
  is: function(s) {
738
  },
739
  type: "numeric"
740
  });
741
+
742
  ts.addParser({
743
  id: "url",
744
  is: function(s) {
749
  },
750
  type: "text"
751
  });
752
+
753
  ts.addParser({
754
  id: "isoDate",
755
  is: function(s) {
760
  },
761
  type: "numeric"
762
  });
763
+
764
  ts.addParser({
765
  id: "percent",
766
+ is: function(s) {
767
  return /\%$/.test($.trim(s));
768
  },
769
  format: function(s) {
798
  //reformat the string in ISO format
799
  s = s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4})/, "$3/$2/$1");
800
  } else if(c.dateFormat == "dd/mm/yy" || c.dateFormat == "dd-mm-yy") {
801
+ s = s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{2})/, "$1/$2/$3");
802
  }
803
  return $.tablesorter.formatFloat(new Date(s).getTime());
804
  },
815
  },
816
  type: "numeric"
817
  });
818
+
819
+
820
  ts.addParser({
821
  id: "metadata",
822
  is: function(s) {
828
  },
829
  type: "numeric"
830
  });
831
+
832
  // add default widgets
833
  ts.addWidget({
834
  id: "zebra",
841
  .removeClass(table.config.widgetZebra.css[0]).addClass(table.config.widgetZebra.css[1]);
842
  if(table.config.debug) { $.tablesorter.benchmark("Applying Zebra widget", time); }
843
  }
844
+ });
845
+ })(jQuery);
admin/js/plupload/Moxie.swf CHANGED
Binary file
admin/js/plupload/Moxie.xap CHANGED
Binary file
admin/js/plupload/i18n/ar.js CHANGED
@@ -1,2 +1,2 @@
1
  // Arabic (ar)
2
- plupload.addI18n({"Stop Upload":"أيقاف التحميل","Upload URL might be wrong or doesn't exist.":"عنوان التحميل ربما يكون خاطئ أو غير متوفر","tb":"تيرابايت","Size":"الحجم","Close":"أغلاق","Init error.":"خطأ في تهيئة","Add files to the upload queue and click the start button.":"أضف ملفات إلى القائمة إنتظار التحميل ثم أضغط على زر البداية","Filename":"أسم الملف","Image format either wrong or not supported.":"صيغة الصورة أما خطاء أو غير مدعومه","Status":"الحالة","HTTP Error.":"خطأ في برتوكول نقل الملفات","Start Upload":"أبدا التحميل","mb":"ميجابايت","kb":"كيلوبايت","Duplicate file error.":"خطاء في تكرار الملف","File size error.":"خطأ في حجم الملف","N/A":"لا شي","gb":"جيجابايت","Error: Invalid file extension:":"خطاء : أمتداد الملف غير صالح :","Select files":"أختر الملفات","%s already present in the queue.":"%s الملف موجود بالفعل في قائمة الانتظار","File: %s":"ملف: %s","b":"بايت","Uploaded %d/%d files":"تحميل %d/%d ملف","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"العناصر المقبوله لتحميل هي %d ملف في هذا الوقت. الملفات الاضافية أزيلة.","%d files queued":"%d الملفات في قائمة الانتظار","File: %s, size: %d, max file size: %d":"ملف: %s, أقصى حجم للملف: %d, حجم: %d","Drag files here.":"سحب الملف هنا","Runtime ran out of available memory.":"الذاكرة المتوفره أنتهت لمدة التشغيل","File count error.":"خطاء في عد الملفات","File extension error.":"خطأ في أمتداد الملف","Error: File too large:":" خطاء : حجم الملف كبير :","Add Files":"أضف ملفات"});
1
  // Arabic (ar)
2
+ plupload.addI18n({"Stop Upload":"أيقاف التحميل","Upload URL might be wrong or doesn't exist.":"عنوان التحميل ربما يكون خاطئ أو غير متوفر","tb":"تيرابايت","Size":"الحجم","Close":"أغلاق","You must specify either browse_button or drop_element.":"","Init error.":"خطأ في تهيئة","Add files to the upload queue and click the start button.":"أضف ملفات إلى القائمة إنتظار التحميل ثم أضغط على زر البداية","List":"","Filename":"أسم الملف","%s specified, but cannot be found.":"","Image format either wrong or not supported.":"صيغة الصورة أما خطاء أو غير مدعومه","Status":"الحالة","HTTP Error.":"خطأ في برتوكول نقل الملفات","Start Upload":"أبدا التحميل","Error: File too large:":" خطاء : حجم الملف كبير :","kb":"كيلوبايت","Duplicate file error.":"خطاء في تكرار الملف","File size error.":"خطأ في حجم الملف","N/A":"لا شي","gb":"جيجابايت","Error: Invalid file extension:":"خطاء : أمتداد الملف غير صالح :","Select files":"أختر الملفات","%s already present in the queue.":"%s الملف موجود بالفعل في قائمة الانتظار","Resoultion out of boundaries! <b>%s</b> runtime supports images only up to %wx%hpx.":"","File: %s":"ملف: %s","b":"بايت","Uploaded %d/%d files":"تحميل %d/%d ملف","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"العناصر المقبوله لتحميل هي %d ملف في هذا الوقت. الملفات الاضافية أزيلة.","%d files queued":"%d الملفات في قائمة الانتظار","File: %s, size: %d, max file size: %d":"ملف: %s, أقصى حجم للملف: %d, حجم: %d","Thumbnails":"","Drag files here.":"سحب الملف هنا","Runtime ran out of available memory.":"الذاكرة المتوفره أنتهت لمدة التشغيل","File count error.":"خطاء في عد الملفات","File extension error.":"خطأ في أمتداد الملف","mb":"ميجابايت","Add Files":"أضف ملفات"});
admin/js/plupload/i18n/az.js ADDED
@@ -0,0 +1,2 @@
 
 
1
+ // Azerbaijani (az)
2
+ plupload.addI18n({"Stop Upload":"Yükləməni saxla","Upload URL might be wrong or doesn't exist.":"Yükləmə ünvanı səhvdir və ya mövcud deyil","tb":"tb","Size":"Həcm","Close":"Bağla","You must specify either browse_button or drop_element.":"","Init error.":"Init error.","Add files to the upload queue and click the start button.":"Faylları əlavə edin və yüklə düyməsinə klikləyin.","List":"","Filename":"Faylın adı","%s specified, but cannot be found.":"","Image format either wrong or not supported.":"Şəklin formatı uyğun deyil və ya dəstəklənmir.","Status":"Status","HTTP Error.":"HTTP xətası.","Start Upload":"Yüklə","Error: File too large:":"Xəta:Fayl həcmi çox böyükdür.","kb":"kb","Duplicate file error.":"Bu fayl artıq növbədə var.","File size error.":"Fayl həcmi xətası.","N/A":"N/A","gb":"gb","Error: Invalid file extension:":"Xəta: Yanlış fayl uzantısı:","Select files":"Faylları seçin","%s already present in the queue.":"%s artıq növbədə var.","Resoultion out of boundaries! <b>%s</b> runtime supports images only up to %wx%hpx.":"","File: %s":"Fayl: %s","b":"b","Uploaded %d/%d files":"%d/%d fayl yüklənib","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Upload element accepts only %d file(s) at a time. Extra files were stripped.","%d files queued":"Növbədə %d fayl var","File: %s, size: %d, max file size: %d":"Fayl: %s, həcm: %d, max fayl həcmi: %d","Thumbnails":"","Drag files here.":"Faylları bura çəkin.","Runtime ran out of available memory.":"Runtime ran out of available memory.","File count error.":"Fayl sayı çox böyükdür.","File extension error.":"Fayl uzantısı xətası.","mb":"mb","Add Files":"Fayl əlavə et"});
admin/js/plupload/i18n/bg.js ADDED
@@ -0,0 +1,2 @@
 
 
1
+ // Bulgarian (bg)
2
+ plupload.addI18n({"Stop Upload":"Спрете качването","Upload URL might be wrong or doesn't exist.":"URL за качване може да е грешен или да не съществува.","tb":"tb","Size":"Размер","Close":"Затвори","You must specify either browse_button or drop_element.":"","Init error.":"Грешка: инициализиране.","Add files to the upload queue and click the start button.":"Добавете файлове в опашката за качване, и щракнете бутона старт.","List":"","Filename":"Име на файла","%s specified, but cannot be found.":"","Image format either wrong or not supported.":"Формата на изображението или е объркан, или не се поддържа.","Status":"Статус","HTTP Error.":"Грешка: HTTP .","Start Upload":"Започнете качването","Error: File too large:":"Грешка: Файла е твърде голям:","kb":"kb","Duplicate file error.":"Грешка: файла е вече качен на сървъра.","File size error.":"Грешка: размер на файла.","N/A":"не приложимо","gb":"gb","Error: Invalid file extension:":"Грешка: Невалидно разширение на файл:","Select files":"Изберете файлове","%s already present in the queue.":"%s вече го има в опашката.","Resoultion out of boundaries! <b>%s</b> runtime supports images only up to %wx%hpx.":"","File: %s":"Файл: %s","b":"b","Uploaded %d/%d files":"Качени %d/%d файла","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Елемента за качване приема само %d файл(а) наведнъж. Допълнителните файлове бяха отстранени.","%d files queued":"%d файла в опашката","File: %s, size: %d, max file size: %d":"Файл: %s, размер: %d, максимален размер: %d","Thumbnails":"","Drag files here.":"Довлечете файловете тук.","Runtime ran out of available memory.":"Недостатъчна свободна памет.","File count error.":"Грешка в броя на файловете.","File extension error.":"Грешка: разширение на файла.","mb":"mb","Add Files":"Добавете файлове"});
admin/js/plupload/i18n/bs.js CHANGED
@@ -1,2 +1,2 @@
1
  // Bosnian (bs)
2
- plupload.addI18n({"Stop Upload":"Prekini dodavanje","Upload URL might be wrong or doesn't exist.":"URL za dodavanje je neispravan ili ne postoji.","tb":"tb","Size":"Veličina","Close":"Zatvori","Init error.":"Inicijalizacijska greška.","Add files to the upload queue and click the start button.":"Dodajte datoteke u red i kliknite na dugme za pokretanje.","Filename":"Naziv datoteke","Image format either wrong or not supported.":"Format slike je neispravan ili nije podržan.","Status":"Status","HTTP Error.":"HTTP greška.","Start Upload":"Započni dodavanje","mb":"mb","kb":"kb","Duplicate file error.":"Dupla datoteka.","File size error.":"Greška u veličini datoteke.","N/A":"N/A","gb":"gb","Error: Invalid file extension:":"Greška! Neispravan ekstenzija datoteke:","Select files":"Odaberite datoteke","%s already present in the queue.":"%s se već nalazi u redu.","File: %s":"Datoteka: %s","b":"b","Uploaded %d/%d files":"Dodano %d/%d datoteka","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Dodavanje trenutno dozvoljava samo %d datoteka istovremeno. Dodatne datoteke su uklonjene.","%d files queued":"%d datoteka čeka","File: %s, size: %d, max file size: %d":"Datoteka: %s, veličina: %d, maksimalna veličina: %d","Drag files here.":"Dovucite datoteke ovdje.","Runtime ran out of available memory.":"Nema više dostupne memorije.","File count error.":"Greška u brojanju datoeka.","File extension error.":"Greška u ekstenziji datoteke.","Error: File too large:":"Greška! Datoteka je prevelika:","Add Files":"Dodaj datoteke"});
1
  // Bosnian (bs)
2
+ plupload.addI18n({"Stop Upload":"Prekini dodavanje","Upload URL might be wrong or doesn't exist.":"URL za dodavanje je neispravan ili ne postoji.","tb":"tb","Size":"Veličina","Close":"Zatvori","You must specify either browse_button or drop_element.":"","Init error.":"Inicijalizacijska greška.","Add files to the upload queue and click the start button.":"Dodajte datoteke u red i kliknite na dugme za pokretanje.","List":"","Filename":"Naziv datoteke","%s specified, but cannot be found.":"","Image format either wrong or not supported.":"Format slike je neispravan ili nije podržan.","Status":"Status","HTTP Error.":"HTTP greška.","Start Upload":"Započni dodavanje","Error: File too large:":"Greška! Datoteka je prevelika:","kb":"kb","Duplicate file error.":"Dupla datoteka.","File size error.":"Greška u veličini datoteke.","N/A":"N/A","gb":"gb","Error: Invalid file extension:":"Greška! Neispravan ekstenzija datoteke:","Select files":"Odaberite datoteke","%s already present in the queue.":"%s se već nalazi u redu.","Resoultion out of boundaries! <b>%s</b> runtime supports images only up to %wx%hpx.":"","File: %s":"Datoteka: %s","b":"b","Uploaded %d/%d files":"Dodano %d/%d datoteka","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Dodavanje trenutno dozvoljava samo %d datoteka istovremeno. Dodatne datoteke su uklonjene.","%d files queued":"%d datoteka čeka","File: %s, size: %d, max file size: %d":"Datoteka: %s, veličina: %d, maksimalna veličina: %d","Thumbnails":"","Drag files here.":"Dovucite datoteke ovdje.","Runtime ran out of available memory.":"Nema više dostupne memorije.","File count error.":"Greška u brojanju datoeka.","File extension error.":"Greška u ekstenziji datoteke.","mb":"mb","Add Files":"Dodaj datoteke"});
admin/js/plupload/i18n/ca.js CHANGED
@@ -1,2 +1,2 @@
1
  // Catalan (ca)
2
- plupload.addI18n({"Stop Upload":"","Upload URL might be wrong or doesn't exist.":"","tb":"","Size":"","Close":"","Init error.":"","Add files to the upload queue and click the start button.":"","Filename":"","Image format either wrong or not supported.":"","Status":"","HTTP Error.":"","Start Upload":"","mb":"","kb":"","Duplicate file error.":"","File size error.":"","N/A":"","gb":"","Error: Invalid file extension:":"","Select files":"","%s already present in the queue.":"","File: %s":"","b":"","Uploaded %d/%d files":"","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"","%d files queued":"","File: %s, size: %d, max file size: %d":"","Drag files here.":"","Runtime ran out of available memory.":"","File count error.":"","File extension error.":"","Error: File too large:":"","Add Files":""});
1
  // Catalan (ca)
2
+ plupload.addI18n({"Stop Upload":"Parar pujada","Upload URL might be wrong or doesn't exist.":"La URL de càrrega no és correcte o bé no existeix.","tb":"Tb","Size":"Tamany","Close":"Tancar","You must specify either browse_button or drop_element.":"Has d'especificar o bé el botó de selecció de fitxers `browse_button` o bé l'àrea per arrosegar els fitxers `drop_element`.","Init error.":"Error d´inicialització.","Add files to the upload queue and click the start button.":"Afegeixi els fitxers a la cua de pujada i cliqui el botó Iniciar","List":"Llistat","Filename":"Nom de fitxer","%s specified, but cannot be found.":"%s especificat, però no es pot trobar.","Image format either wrong or not supported.":"Format d'imatge incorrecte o no suportat.","Status":"Estat","HTTP Error.":"Error HTTP.","Start Upload":"Començar pujada","Error: File too large:":"Error: Fitxer massa gran:","kb":"Kb","Duplicate file error.":"Error per duplicitat de fitxer.","File size error.":"Error en la mida del fitxer.","N/A":"N/D","gb":"Gb","Error: Invalid file extension:":"Error: Extensió de fitxer no vàlida:","Select files":"Seleccionar fitxers","%s already present in the queue.":"%s ja existeix a la cua.","Resoultion out of boundaries! <b>%s</b> runtime supports images only up to %wx%hpx.":"Resolució de la imatge massa gran! El pujador <b>%s</b> suporta mides d'imatge fins a %wx%hpx.","File: %s":"Fitxer: %s","b":"b","Uploaded %d/%d files":"Pujats %d/%d fitxers","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"La càrrega d'elements tan sols accepta %d fitxer(s) alhora. Els fitxers sobrants seran descartats.","%d files queued":"%d fitxers en cua","File: %s, size: %d, max file size: %d":"Fitxer: %s, mida: %d, mida màxima de fitxer: %d","Thumbnails":"Miniatures","Drag files here.":"Arrossegui fitxers aquí","Runtime ran out of available memory.":"L'execució ha arribat al límit de memòria.","File count error.":"Error en el recompte de fitxers","File extension error.":"Error en l´extensió del fitxer.","mb":"Mb","Add Files":"Afegir fitxers"});
admin/js/plupload/i18n/cs.js CHANGED
@@ -1,2 +1,2 @@
1
  // Czech (cs)
2
- plupload.addI18n({"Stop Upload":"Stop Upload","Upload URL might be wrong or doesn't exist.":"Upload URL might be wrong or doesn't exist.","tb":"","Size":"Velikost","Close":"Close","Init error.":"Init error.","Add files to the upload queue and click the start button.":"Přidejte soubory do fronty a pak spusťte nahrávání.","Filename":"Název souboru","Image format either wrong or not supported.":"Image format either wrong or not supported.","Status":"Status","HTTP Error.":"HTTP Error.","Start Upload":"Spustit nahrávání","mb":"","kb":"","Duplicate file error.":"","File size error.":"File size error.","N/A":"N/A","gb":"","Error: Invalid file extension:":"Error: Invalid file extension:","Select files":"Vyberte soubory","%s already present in the queue.":"","File: %s":"File: %s","b":"","Uploaded %d/%d files":"Nahráno %d/%d souborů","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Upload element accepts only %d file(s) at a time. Extra files were stripped.","%d files queued":"%d files queued","File: %s, size: %d, max file size: %d":"","Drag files here.":"Sem přetáhněte soubory.","Runtime ran out of available memory.":"Runtime ran out of available memory.","File count error.":"File count error.","File extension error.":"File extension error.","Error: File too large:":"Error: File too large:","Add Files":"Přidat soubory"});
1
  // Czech (cs)
2
+ plupload.addI18n({"Stop Upload":"Zastavit nahrávání","Upload URL might be wrong or doesn't exist.":"URL uploadu je možná špatně, nebo neexistuje.","tb":"tb","Size":"Velikost","Close":"Zavřít","You must specify either browse_button or drop_element.":"Musíte specifikovat browse_button či drop_element.","Init error.":"Chyba inicializace.","Add files to the upload queue and click the start button.":"Přidejte soubory do fronty a pak spusťte nahrávání.","List":"Seznam","Filename":"Název souboru","%s specified, but cannot be found.":"%s bylo specifikováno, ale nebylo nalezeno.","Image format either wrong or not supported.":"Špatný, nebo nepodporovaný formát obrázku.","Status":"Stav","HTTP Error.":"Chyba HTTP.","Start Upload":"Spustit nahrávání","Error: File too large:":"Chyba: Soubor je příliš veliký:","kb":"kb","Duplicate file error.":"Chyba - duplikovaný soubor.","File size error.":"Chyba velikosti souboru.","N/A":"N/A","gb":"gb","Error: Invalid file extension:":"Chyba: Neplatná koncovka souboru:","Select files":"Vyberte soubory","%s already present in the queue.":"%s je již zařazen ve frontě.","Resoultion out of boundaries! <b>%s</b> runtime supports images only up to %wx%hpx.":"Rozlišení je mimo rozmezí! <b>%s</b> runtime podporuje obrázky pouze do %wx%hpx.","File: %s":"Soubor: %s","b":"b","Uploaded %d/%d files":"Nahráno %d/%d souborů","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Upload akceptuje pouze %d soubor(ů) najednou. Další soubory byly odstraněny.","%d files queued":"%d souborů ve frontě","File: %s, size: %d, max file size: %d":"Soubor: %s, velikost: %d, maximální velikost souboru: %d","Thumbnails":"Náhledy","Drag files here.":"Sem přetáhněte soubory.","Runtime ran out of available memory.":"Běh skriptu přesáhl dostupnou paměť.","File count error.":"Chyba v počtu souborů.","File extension error.":"Chyba přípony souboru.","mb":"mb","Add Files":"Přidat soubory"});
admin/js/plupload/i18n/cy.js CHANGED
@@ -1,2 +1,2 @@
1
  // Welsh (cy)
2
- plupload.addI18n({"Stop Upload":"Atal Lanlwytho","Upload URL might be wrong or doesn't exist.":"URL y lanlwythiad ynb anghywir neu ddim yn bodoli.","tb":"tb","Size":"Maint","Close":"Cau","Init error.":"Gwall cych.","Add files to the upload queue and click the start button.":"Ychwanegwch ffeiliau i'r ciw lanlwytho a chlicio'r botwm dechrau.","Filename":"Enw'r ffeil","Image format either wrong or not supported.":"Fformat delwedd yn anghywir neu heb ei gynnal.","Status":"Statws","HTTP Error.":"Gwall HTTP.","Start Upload":"Dechrau Lanlwytho","mb":"mb","kb":"kb","Duplicate file error.":"Gwall ffeil ddyblyg.","File size error.":"Gwall maint ffeil.","N/A":"Dd/A","gb":"gb","Error: Invalid file extension:":"Gwall: estyniad ffeil annilys:","Select files":"Dewis ffeiliau","%s already present in the queue.":"%s yn y ciw yn barod.","File: %s":"Ffeil: %s","b":"b","Uploaded %d/%d files":"Lanlwythwyd %d/%d ffeil","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Mae'r elfen lanlwytho yn derbyn %d ffeil ar y tro. Caiff ffeiliau ychwanegol eu tynnu.","%d files queued":"%d ffeil mewn ciw","File: %s, size: %d, max file size: %d":"Ffeil: %s, maint: %d, maint mwyaf ffeil: %d","Drag files here.":"Llusgwch ffeiliau yma.","Runtime ran out of available memory.":"Allan o gof.","File count error.":"Gwall cyfri ffeiliau.","File extension error.":"Gwall estyniad ffeil.","Error: File too large:":"Gwall: Ffeil yn rhy fawr:","Add Files":"Ychwanegu Ffeiliau"});
1
  // Welsh (cy)
2
+ plupload.addI18n({"Stop Upload":"Atal Lanlwytho","Upload URL might be wrong or doesn't exist.":"URL y lanlwythiad ynb anghywir neu ddim yn bodoli.","tb":"tb","Size":"Maint","Close":"Cau","You must specify either browse_button or drop_element.":"","Init error.":"Gwall cych.","Add files to the upload queue and click the start button.":"Ychwanegwch ffeiliau i'r ciw lanlwytho a chlicio'r botwm dechrau.","List":"","Filename":"Enw'r ffeil","%s specified, but cannot be found.":"","Image format either wrong or not supported.":"Fformat delwedd yn anghywir neu heb ei gynnal.","Status":"Statws","HTTP Error.":"Gwall HTTP.","Start Upload":"Dechrau Lanlwytho","Error: File too large:":"Gwall: Ffeil yn rhy fawr:","kb":"kb","Duplicate file error.":"Gwall ffeil ddyblyg.","File size error.":"Gwall maint ffeil.","N/A":"Dd/A","gb":"gb","Error: Invalid file extension:":"Gwall: estyniad ffeil annilys:","Select files":"Dewis ffeiliau","%s already present in the queue.":"%s yn y ciw yn barod.","Resoultion out of boundaries! <b>%s</b> runtime supports images only up to %wx%hpx.":"","File: %s":"Ffeil: %s","b":"b","Uploaded %d/%d files":"Lanlwythwyd %d/%d ffeil","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Mae'r elfen lanlwytho yn derbyn %d ffeil ar y tro. Caiff ffeiliau ychwanegol eu tynnu.","%d files queued":"%d ffeil mewn ciw","File: %s, size: %d, max file size: %d":"Ffeil: %s, maint: %d, maint mwyaf ffeil: %d","Thumbnails":"","Drag files here.":"Llusgwch ffeiliau yma.","Runtime ran out of available memory.":"Allan o gof.","File count error.":"Gwall cyfri ffeiliau.","File extension error.":"Gwall estyniad ffeil.","mb":"mb","Add Files":"Ychwanegu Ffeiliau"});
admin/js/plupload/i18n/da.js CHANGED
@@ -1,2 +1,2 @@
1
  // Danish (da)
2
- plupload.addI18n({"Stop Upload":"Stop Upload","Upload URL might be wrong or doesn't exist.":"Upload URL might be wrong or doesn't exist.","tb":"","Size":"Størrelse","Close":"Close","Init error.":"Init error.","Add files to the upload queue and click the start button.":"Tilføj filer til køen","Filename":"Filnavn","Image format either wrong or not supported.":"Image format either wrong or not supported.","Status":"Status","HTTP Error.":"HTTP Error.","Start Upload":"Start Upload","mb":"","kb":"","Duplicate file error.":"","File size error.":"File size error.","N/A":"N/A","gb":"","Error: Invalid file extension:":"Error: Invalid file extension:","Select files":"Vælg filer","%s already present in the queue.":"","File: %s":"File: %s","b":"","Uploaded %d/%d files":"Uploaded %d/%d files","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Upload element accepts only %d file(s) at a time. Extra files were stripped.","%d files queued":"%d files queued","File: %s, size: %d, max file size: %d":"","Drag files here.":"Træk filer her.","Runtime ran out of available memory.":"Runtime ran out of available memory.","File count error.":"File count error.","File extension error.":"File extension error.","Error: File too large:":"Error: File too large:","Add Files":"Add Files"});
1
  // Danish (da)
2
+ plupload.addI18n({"Stop Upload":"Stop upload","Upload URL might be wrong or doesn't exist.":"Upload URL kan være forkert eller ikke eksisterende.","tb":"tb","Size":"Størrelse","Close":"Luk","You must specify either browse_button or drop_element.":"","Init error.":"Opstarts fejl.","Add files to the upload queue and click the start button.":"Tilføj filer til køen og klik Start upload knappen.","List":"","Filename":"Filnavn","%s specified, but cannot be found.":"","Image format either wrong or not supported.":"Billede format er enten forkert eller ikke understøttet.","Status":"Status","HTTP Error.":"HTTP fejl.","Start Upload":"Start upload","Error: File too large:":"Fejl: Filen er for stor:","kb":"kb","Duplicate file error.":"Filen findes allerede.","File size error.":"Filstørrelse fejl.","N/A":"N/A","gb":"gb","Error: Invalid file extension:":"Fejl: Ugyldigt fil format:","Select files":"Vælg filer","%s already present in the queue.":"%s findes allerede i køen.","Resoultion out of boundaries! <b>%s</b> runtime supports images only up to %wx%hpx.":"","File: %s":"Fil: %s","b":"b","Uploaded %d/%d files":"Uploaded %d/%d filer","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Upload accepterer kun %d fil(er) af gangen. Ekstra filer blev skippet.","%d files queued":"%d filer i kø","File: %s, size: %d, max file size: %d":"Fil: %s, størrelse: %d, maks. filstørrelse: %d","Thumbnails":"","Drag files here.":"Træk filer her.","Runtime ran out of available memory.":"Runtime mangler tilgængelige hukommelse.","File count error.":"Fil antal fejl.","File extension error.":"Fil format fejl.","mb":"mb","Add Files":"Tilføj filer"});
admin/js/plupload/i18n/de.js CHANGED
@@ -1,2 +1,2 @@
1
  // German (de)
2
- plupload.addI18n({"Stop Upload":"Hochladen stoppen","Upload URL might be wrong or doesn't exist.":"Upload-URL ist falsch oder existiert nicht.","tb":"TB","Size":"Gr&ouml;&szlig;e","Close":"Schließen","Init error.":"Initialisierungsfehler","Add files to the upload queue and click the start button.":"Dateien hinzuf&uuml;gen und auf 'Hochladen' klicken.","Filename":"Dateiname","Image format either wrong or not supported.":"Bildformat falsch oder nicht unterst&uuml;tzt.","Status":"Status","HTTP Error.":"HTTP-Fehler","Start Upload":"Upload beginnen","mb":"MB","kb":"kB","Duplicate file error.":"","File size error.":"Fehler bei Dateigr&ouml;ße","N/A":"Nicht verf&uuml;gbar","gb":"GB","Error: Invalid file extension:":"Fehler: Ungültige Dateiendung:","Select files":"Dateien hochladen","%s already present in the queue.":"","File: %s":"Datei: %s","b":"B","Uploaded %d/%d files":"%d/%d Dateien sind hochgeladen","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Der Uploader akzeptiert nur %d Datei(en) pro Durchgang. Überzählige Dateien wurden abgetrennt.","%d files queued":"%d Dateien in der Warteschlange","File: %s, size: %d, max file size: %d":"Datei: %s, Größe: %d, maximale Dateigröße: %d","Drag files here.":"Ziehen Sie die Dateien hier hin","Runtime ran out of available memory.":"Runtime ran out of available memory.","File count error.":"File count error.","File extension error.":"Fehler bei Dateiendung","Error: File too large:":"Fehler: Datei zu groß:","Add Files":"Dateien hinzufügen"});
1
  // German (de)
2
+ plupload.addI18n({"Stop Upload":"Hochladen abbrechen","Upload URL might be wrong or doesn't exist.":"Upload-URL ist falsch oder existiert nicht.","tb":"TB","Size":"Größe","Close":"Schließen","You must specify either browse_button or drop_element.":"","Init error.":"Initialisierungsfehler","Add files to the upload queue and click the start button.":"Dateien hinzufügen und auf 'Hochladen' klicken.","List":"Liste","Filename":"Dateiname","%s specified, but cannot be found.":"","Image format either wrong or not supported.":"Bildformat falsch oder nicht unterstützt.","Status":"Status","HTTP Error.":"HTTP-Fehler","Start Upload":"Hochladen beginnen","Error: File too large:":"Fehler: Datei zu groß:","kb":"KB","Duplicate file error.":"Datei bereits hochgeladen","File size error.":"Fehler bei Dateigröße","N/A":"Nicht verfügbar","gb":"GB","Error: Invalid file extension:":"Fehler: Ungültige Dateiendung:","Select files":"Dateien auswählen","%s already present in the queue.":"%s ist bereits in der Warteschlange","Resoultion out of boundaries! <b>%s</b> runtime supports images only up to %wx%hpx.":"","File: %s":"Datei: %s","b":"B","Uploaded %d/%d files":"%d/%d Dateien wurden hochgeladen","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Pro Durchgang können nur %d Datei(en) akzeptiert werden. Überzählige Dateien wurden ignoriert.","%d files queued":"%d Dateien in der Warteschlange","File: %s, size: %d, max file size: %d":"Datei: %s, Größe: %d, maximale Dateigröße: %d","Thumbnails":"Vorschaubilder","Drag files here.":"Dateien auf diese Fläche bewegen.","Runtime ran out of available memory.":"Nicht genügend Speicher verfügbar.","File count error.":"Fehlerhafte Dateianzahl.","File extension error.":"Fehler bei Dateiendung","mb":"MB","Add Files":"Dateien hinzufügen"});
admin/js/plupload/i18n/el.js CHANGED
@@ -1,2 +1,2 @@
1
  // Greek (el)
2
- plupload.addI18n({"Stop Upload":"Stop Upload","Upload URL might be wrong or doesn't exist.":"Upload URL might be wrong or doesn't exist.","tb":"","Size":"Μέγεθος","Close":"Close","Init error.":"Init error.","Add files to the upload queue and click the start button.":"Προσθήκη αρχείων στην ουρά μεταφόρτωσης","Filename":"Όνομα αρχείου","Image format either wrong or not supported.":"Image format either wrong or not supported.","Status":"Κατάσταση","HTTP Error.":"HTTP Error.","Start Upload":"Εκκίνηση μεταφόρτωσης","mb":"","kb":"","Duplicate file error.":"","File size error.":"File size error.","N/A":"N/A","gb":"","Error: Invalid file extension:":"Error: Invalid file extension:","Select files":"Επιλέξτε Αρχεία","%s already present in the queue.":"","File: %s":"File: %s","b":"","Uploaded %d/%d files":"Ανέβηκαν %d/%d αρχεία","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Upload element accepts only %d file(s) at a time. Extra files were stripped.","%d files queued":"%d files queued","File: %s, size: %d, max file size: %d":"","Drag files here.":"Σύρετε αρχεία εδώ","Runtime ran out of available memory.":"Runtime ran out of available memory.","File count error.":"File count error.","File extension error.":"File extension error.","Error: File too large:":"Error: File too large:","Add Files":"Προσθέστε αρχεία"});
1
  // Greek (el)
2
+ plupload.addI18n({"Stop Upload":"Ακύρωση Μεταφόρτωσης","Upload URL might be wrong or doesn't exist.":"Το URL μεταφόρτωσης είναι λάθος ή δεν υπάρχει.","tb":"tb","Size":"Μέγεθος","Close":"Κλείσιμο","You must specify either browse_button or drop_element.":"","Init error.":"Σφάλμα αρχικοποίησης.","Add files to the upload queue and click the start button.":"Προσθέστε αρχεία στην ουρά μεταφόρτωσης και πατήστε το κουμπί εκκίνησης.","List":"Λίστα","Filename":"Όνομα Αρχείου","%s specified, but cannot be found.":"","Image format either wrong or not supported.":"Ο τύπος εικόνας είναι λάθος ή δεν υποστηρίζεται.","Status":"Κατάσταση","HTTP Error.":"Σφάλμα HTTP.","Start Upload":"Εκκίνηση Μεταφόρτωσης","Error: File too large:":"Σφάλμα: Πολύ μεγάλο αρχείο:","kb":"kb","Duplicate file error.":"Το αρχείο έχει ξαναπροστεθεί.","File size error.":"Σφάλμα με το μέγεθος του αρχείου.","N/A":"Δεν ισχύει","gb":"gb","Error: Invalid file extension:":"Σφάλμα: Μη έγκυρος τύπος αρχείου:","Select files":"Επιλέξτε Αρχεία","%s already present in the queue.":"Το «%s» βρίσκεται ήδη στην ουρά.","Resoultion out of boundaries! <b>%s</b> runtime supports images only up to %wx%hpx.":"","File: %s":"Αρχείο: %s","b":"b","Uploaded %d/%d files":"Μεταφορτώθηκαν %d/%d αρχεία","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Μπορείτε να μεταφορτώσετε μεχρι και %d αρχείο/α κάθε φορά. Τα επιπλέον αρχεία αφαιρέθηκαν.","%d files queued":"%d αρχεία στην ουρά","File: %s, size: %d, max file size: %d":"Αρχείο: %s, μέγεθος: %d, μέγιστο μέγεθος αρχείου: %d","Thumbnails":"Μικρογραφίες","Drag files here.":"Σύρετε αρχεία εδώ","Runtime ran out of available memory.":"Δεν υπάρχει αρκετή διαθέσιμη μνήμη.","File count error.":"Σφάλμα με τον αριθμό αρχείων.","File extension error.":"Σφάλμα με τον τύπο αρχείου.","mb":"mb","Add Files":"Προσθέστε Αρχεία"});
admin/js/plupload/i18n/en.js CHANGED
@@ -1,2 +1,2 @@
1
  // English (en)
2
- plupload.addI18n({"Stop Upload":"Stop Upload","Upload URL might be wrong or doesn't exist.":"Upload URL might be wrong or doesn't exist.","tb":"tb","Size":"Size","Close":"Close","Init error.":"Init error.","Add files to the upload queue and click the start button.":"Add files to the upload queue and click the start button.","Filename":"Filename","Image format either wrong or not supported.":"Image format either wrong or not supported.","Status":"Status","HTTP Error.":"HTTP Error.","Start Upload":"Start Upload","mb":"mb","kb":"kb","Duplicate file error.":"Duplicate file error.","File size error.":"File size error.","N/A":"N/A","gb":"gb","Error: Invalid file extension:":"Error: Invalid file extension:","Select files":"Select files","%s already present in the queue.":"%s already present in the queue.","File: %s":"File: %s","b":"b","Uploaded %d/%d files":"Uploaded %d/%d files","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Upload element accepts only %d file(s) at a time. Extra files were stripped.","%d files queued":"%d files queued","File: %s, size: %d, max file size: %d":"File: %s, size: %d, max file size: %d","Drag files here.":"Drag files here.","Runtime ran out of available memory.":"Runtime ran out of available memory.","File count error.":"File count error.","File extension error.":"File extension error.","Error: File too large:":"Error: File too large:","Add Files":"Add Files"});
1
  // English (en)
2
+ plupload.addI18n({"Stop Upload":"Stop Upload","Upload URL might be wrong or doesn't exist.":"Upload URL might be wrong or doesn't exist.","tb":"tb","Size":"Size","Close":"Close","You must specify either browse_button or drop_element.":"You must specify either browse_button or drop_element.","Init error.":"Init error.","Add files to the upload queue and click the start button.":"Add files to the upload queue and click the start button.","List":"List","Filename":"Filename","%s specified, but cannot be found.":"%s specified, but cannot be found.","Image format either wrong or not supported.":"Image format either wrong or not supported.","Status":"Status","HTTP Error.":"HTTP Error.","Start Upload":"Start Upload","Error: File too large:":"Error: File too large:","kb":"kb","Duplicate file error.":"Duplicate file error.","File size error.":"File size error.","N/A":"N/A","gb":"gb","Error: Invalid file extension:":"Error: Invalid file extension:","Select files":"Select files","%s already present in the queue.":"%s already present in the queue.","Resoultion out of boundaries! <b>%s</b> runtime supports images only up to %wx%hpx.":"Resoultion out of boundaries! <b>%s</b> runtime supports images only up to %wx%hpx.","File: %s":"File: %s","b":"b","Uploaded %d/%d files":"Uploaded %d/%d files","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Upload element accepts only %d file(s) at a time. Extra files were stripped.","%d files queued":"%d files queued","File: %s, size: %d, max file size: %d":"File: %s, size: %d, max file size: %d","Thumbnails":"Thumbnails","Drag files here.":"Drag files here.","Runtime ran out of available memory.":"Runtime ran out of available memory.","File count error.":"File count error.","File extension error.":"File extension error.","mb":"mb","Add Files":"Add Files"});
admin/js/plupload/i18n/es.js CHANGED
@@ -1,2 +1,2 @@
1
  // Spanish (es)
2
- plupload.addI18n({"Stop Upload":"Detener Subida.","Upload URL might be wrong or doesn't exist.":"URL de carga inexistente.","tb":"TB","Size":"Tamaño","Close":"Cerrar","Init error.":"Error de inicialización.","Add files to the upload queue and click the start button.":"Agregue archivos a la lista de subida y pulse clic en el botón de Iniciar carga","Filename":"Nombre de archivo","Image format either wrong or not supported.":"Formato de imagen no soportada.","Status":"Estado","HTTP Error.":"Error de HTTP.","Start Upload":"Iniciar carga","mb":"MB","kb":"KB","Duplicate file error.":"Error, archivo duplicado","File size error.":"Error de tamaño de archivo.","N/A":"No disponible","gb":"GB","Error: Invalid file extension:":"Error: Extensión de archivo inválida:","Select files":"Elija archivos","%s already present in the queue.":"%s ya se encuentra en la lista.","File: %s":"Archivo: %s","b":"B","Uploaded %d/%d files":"Subidos %d/%d archivos","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Se aceptan sólo %d archivo(s) al tiempo. Más, no se tienen en cuenta.","%d files queued":"%d archivos en cola.","File: %s, size: %d, max file size: %d":"Archivo: %s, tamaño: %d, tamaño máximo de archivo: %d","Drag files here.":"Arrastre archivos aquí","Runtime ran out of available memory.":"No hay memoria disponible.","File count error.":"Error en contador de archivos.","File extension error.":"Error de extensión de archivo.","Error: File too large:":"Error: archivo demasiado grande:","Add Files":"Agregar archivos"});
1
  // Spanish (es)
2
+ plupload.addI18n({"Stop Upload":"Detener Subida.","Upload URL might be wrong or doesn't exist.":"URL de carga inexistente.","tb":"TB","Size":"Tamaño","Close":"Cerrar","You must specify either browse_button or drop_element.":"Debe especificar el browse_button o el drop_element","Init error.":"Error de inicialización.","Add files to the upload queue and click the start button.":"Agregue archivos a la lista de subida y pulse clic en el botón de Iniciar carga","List":"Lista","Filename":"Nombre de archivo","%s specified, but cannot be found.":"%s especificado, pero no se puede encontrar","Image format either wrong or not supported.":"Formato de imagen no soportada.","Status":"Estado","HTTP Error.":"Error de HTTP.","Start Upload":"Iniciar carga","Error: File too large:":"Error: archivo demasiado grande:","kb":"KB","Duplicate file error.":"Error, archivo duplicado","File size error.":"Error de tamaño de archivo.","N/A":"No disponible","gb":"GB","Error: Invalid file extension:":"Error: Extensión de archivo inválida:","Select files":"Elija archivos","%s already present in the queue.":"%s ya se encuentra en la lista.","Resoultion out of boundaries! <b>%s</b> runtime supports images only up to %wx%hpx.":"Resolución fuera de límites! El tiempo de ejecución <b>%s</b> sólo admite imágenes hasta %wx%hpx","File: %s":"Archivo: %s","b":"B","Uploaded %d/%d files":"Subidos %d/%d archivos","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Se aceptan sólo %d archivo(s) al tiempo. Más, no se tienen en cuenta.","%d files queued":"%d archivos en cola.","File: %s, size: %d, max file size: %d":"Archivo: %s, tamaño: %d, tamaño máximo de archivo: %d","Thumbnails":"Miniaturas","Drag files here.":"Arrastre archivos aquí","Runtime ran out of available memory.":"No hay memoria disponible.","File count error.":"Error en contador de archivos.","File extension error.":"Error de extensión de archivo.","mb":"MB","Add Files":"Agregar archivos"});
admin/js/plupload/i18n/et.js CHANGED
@@ -1,2 +1,2 @@
1
  // Estonian (et)
2
- plupload.addI18n({"Stop Upload":"Stop Upload","Upload URL might be wrong or doesn't exist.":"Üleslaadimise URL võib olla vale või seda pole.","tb":"","Size":"Suurus","Close":"Sulge","Init error.":"Lähtestamise viga.","Add files to the upload queue and click the start button.":"Lisa failid üleslaadimise järjekorda ja klõpsa alustamise nupule.","Filename":"Failinimi","Image format either wrong or not supported.":"Image format either wrong or not supported.","Status":"Olek","HTTP Error.":"HTTP ühenduse viga.","Start Upload":"Start Upload","mb":"","kb":"","Duplicate file error.":"","File size error.":"Failisuuruse viga.","N/A":"N/A","gb":"","Error: Invalid file extension:":"Error: Invalid file extension:","Select files":"Vali faile","%s already present in the queue.":"","File: %s":"Fail: %s","b":"","Uploaded %d/%d files":"Üles laaditud %d/%d","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Üleslaadimise element saab vastu võtta ainult %d faili ühe korraga. Ülejäänud failid jäetakse laadimata.","%d files queued":"Järjekorras on %d faili","File: %s, size: %d, max file size: %d":"","Drag files here.":"Lohista failid siia.","Runtime ran out of available memory.":"Runtime ran out of available memory.","File count error.":"Failide arvu viga.","File extension error.":"Faililaiendi viga.","Error: File too large:":"Error: File too large:","Add Files":"Add Files"});
1
  // Estonian (et)
2
+ plupload.addI18n({"Stop Upload":"Stop Upload","Upload URL might be wrong or doesn't exist.":"Üleslaadimise URL võib olla vale või seda pole.","tb":"","Size":"Suurus","Close":"Sulge","You must specify either browse_button or drop_element.":"","Init error.":"Lähtestamise viga.","Add files to the upload queue and click the start button.":"Lisa failid üleslaadimise järjekorda ja klõpsa alustamise nupule.","List":"","Filename":"Failinimi","%s specified, but cannot be found.":"","Image format either wrong or not supported.":"Image format either wrong or not supported.","Status":"Olek","HTTP Error.":"HTTP ühenduse viga.","Start Upload":"Start Upload","Error: File too large:":"Error: File too large:","kb":"","Duplicate file error.":"","File size error.":"Failisuuruse viga.","N/A":"N/A","gb":"","Error: Invalid file extension:":"Error: Invalid file extension:","Select files":"Vali faile","%s already present in the queue.":"","Resoultion out of boundaries! <b>%s</b> runtime supports images only up to %wx%hpx.":"","File: %s":"Fail: %s","b":"","Uploaded %d/%d files":"Üles laaditud %d/%d","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Üleslaadimise element saab vastu võtta ainult %d faili ühe korraga. Ülejäänud failid jäetakse laadimata.","%d files queued":"Järjekorras on %d faili","File: %s, size: %d, max file size: %d":"","Thumbnails":"","Drag files here.":"Lohista failid siia.","Runtime ran out of available memory.":"Runtime ran out of available memory.","File count error.":"Failide arvu viga.","File extension error.":"Faililaiendi viga.","mb":"","Add Files":"Add Files"});
admin/js/plupload/i18n/fa.js CHANGED
@@ -1,2 +1,2 @@
1
  // Persian (fa)
2
- plupload.addI18n({"Stop Upload":"توقف انتقال","Upload URL might be wrong or doesn't exist.":"Upload URL might be wrong or doesn't exist.","tb":"","Size":"سایز","Close":"بستن","Init error.":"خطا در استارت اسکریپت","Add files to the upload queue and click the start button.":"اضافه کنید فایل ها را به صف آپلود و دکمه شروع را کلیک کنید.","Filename":"نام فایل","Image format either wrong or not supported.":"Image format either wrong or not supported.","Status":"وضعیت","HTTP Error.":"HTTP خطای","Start Upload":"شروع انتقال","mb":"","kb":"","Duplicate file error.":"","File size error.":"خطای سایز فایل","N/A":"N/A","gb":"","Error: Invalid file extension:":"Error: Invalid file extension:","Select files":"انتخاب فایل","%s already present in the queue.":"","File: %s":" فایل ها : %s","b":"","Uploaded %d/%d files":"منتقل شد %d/%d از فایلها","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"عنصر بارگذار فقط %d فایل رو در یک زمان می پذیرد. سایر فایل ها مجرد از این موضوع هستند.","%d files queued":"%d فایل در صف","File: %s, size: %d, max file size: %d":"","Drag files here.":"بکشید فایل ها رو به اینجا","Runtime ran out of available memory.":"Runtime ran out of available memory.","File count error.":"خطای تعداد فایل","File extension error.":"خطا پیشوند فایل","Error: File too large:":"Error: File too large:","Add Files":"افزودن فایل"});
1
  // Persian (fa)
2
+ plupload.addI18n({"Stop Upload":"توقف انتقال","Upload URL might be wrong or doesn't exist.":"Upload URL might be wrong or doesn't exist.","tb":"ترابایت","Size":"سایز","Close":"بستن","You must specify either browse_button or drop_element.":"","Init error.":"خطا در استارت اسکریپت","Add files to the upload queue and click the start button.":"اضافه کنید فایل ها را به صف آپلود و دکمه شروع را کلیک کنید.","List":"","Filename":"نام فایل","%s specified, but cannot be found.":"","Image format either wrong or not supported.":"Image format either wrong or not supported.","Status":"وضعیت","HTTP Error.":"HTTP خطای","Start Upload":"شروع انتقال","Error: File too large:":"Error: File too large:","kb":"کیلوبایت","Duplicate file error.":"خطای فایل تکراری","File size error.":"خطای سایز فایل","N/A":"N/A","gb":"گیگابایت","Error: Invalid file extension:":"Error: Invalid file extension:","Select files":"انتخاب فایل","%s already present in the queue.":"%s در لیست آپلود وجود دارد.","Resoultion out of boundaries! <b>%s</b> runtime supports images only up to %wx%hpx.":"","File: %s":" فایل ها : %s","b":"بایت","Uploaded %d/%d files":"منتقل شد %d/%d از فایلها","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"عنصر بارگذار فقط %d فایل رو در یک زمان می پذیرد. سایر فایل ها مجرد از این موضوع هستند.","%d files queued":"%d فایل در صف","File: %s, size: %d, max file size: %d":"فایل: %s, اندازه: %d, محدودیت اندازه فایل: %d","Thumbnails":"","Drag files here.":"بکشید فایل ها رو به اینجا","Runtime ran out of available memory.":"Runtime ran out of available memory.","File count error.":"خطای تعداد فایل","File extension error.":"خطا پیشوند فایل","mb":"مگابایت","Add Files":"افزودن فایل"});
admin/js/plupload/i18n/fi.js CHANGED
@@ -1,2 +1,2 @@
1
  // Finnish (fi)
2
- plupload.addI18n({"Stop Upload":"Stop Upload","Upload URL might be wrong or doesn't exist.":"Upload URL might be wrong or doesn't exist.","tb":"","Size":"Koko","Close":"Sulje","Init error.":"Init virhe.","Add files to the upload queue and click the start button.":"Lisää tiedostoja latausjonoon ja klikkaa aloita-nappia.","Filename":"Tiedostonimi","Image format either wrong or not supported.":"Image format either wrong or not supported.","Status":"Tila","HTTP Error.":"HTTP virhe.","Start Upload":"Start Upload","mb":"","kb":"","Duplicate file error.":"","File size error.":"Tiedostokokovirhe.","N/A":"N/A","gb":"","Error: Invalid file extension:":"Error: Invalid file extension:","Select files":"Valitse tiedostoja","%s already present in the queue.":"","File: %s":"Tiedosto: %s","b":"","Uploaded %d/%d files":"Ladattu %d/%d tiedostoa","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Latauselementti sallii ladata vain %d tiedosto(a) kerrallaan. Ylimääräiset tiedostot ohitettiin.","%d files queued":"%d tiedostoa jonossa","File: %s, size: %d, max file size: %d":"","Drag files here.":"Raahaa tiedostot tänne.","Runtime ran out of available memory.":"Runtime ran out of available memory.","File count error.":"Tiedostolaskentavirhe.","File extension error.":"Tiedostopäätevirhe.","Error: File too large:":"Error: File too large:","Add Files":"Add Files"});
1
  // Finnish (fi)
2
+ plupload.addI18n({"Stop Upload":"Pysäytä lähetys","Upload URL might be wrong or doesn't exist.":"Lähetyksen URL-osoite saattaa olla väärä tai sitä ei ole olemassa.","tb":"TB","Size":"Koko","Close":"Sulje","You must specify either browse_button or drop_element.":"","Init error.":"Init virhe.","Add files to the upload queue and click the start button.":"Lisää tiedostoja lähetysjonoon ja klikkaa aloita-nappia.","List":"","Filename":"Tiedostonimi","%s specified, but cannot be found.":"","Image format either wrong or not supported.":"Kuvaformaatti on joko väärä tai ei tuettu.","Status":"Tila","HTTP Error.":"HTTP-virhe.","Start Upload":"Aloita lähetys","Error: File too large:":"Virhe: Liian suuri tiedosto:","kb":"kB","Duplicate file error.":"Tuplatiedostovirhe.","File size error.":"Tiedostokokovirhe.","N/A":"N/A","gb":"GB","Error: Invalid file extension:":"Virhe: Virheellinen tiedostopääte:","Select files":"Valitse tiedostoja","%s already present in the queue.":"%s on jo jonossa.","Resoultion out of boundaries! <b>%s</b> runtime supports images only up to %wx%hpx.":"","File: %s":"Tiedosto: %s","b":"B","Uploaded %d/%d files":"Lähetetty %d/%d tiedostoa","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Vain %d tiedosto(a) voidaan lähettää kerralla. Ylimääräiset tiedostot ohitettiin.","%d files queued":"%d tiedostoa jonossa","File: %s, size: %d, max file size: %d":"Tiedosto: %s, koko: %d, suurin sallittu tiedostokoko: %d","Thumbnails":"","Drag files here.":"Raahaa tiedostot tähän.","Runtime ran out of available memory.":"Toiminnon käytettävissä oleva muisti loppui kesken.","File count error.":"Tiedostolaskentavirhe.","File extension error.":"Tiedostopäätevirhe.","mb":"MB","Add Files":"Lisää tiedostoja"});
admin/js/plupload/i18n/fr.js CHANGED
@@ -1,2 +1,2 @@
1
  // French (fr)
2
- plupload.addI18n({"Stop Upload":"Arrêter l'envoi.","Upload URL might be wrong or doesn't exist.":"L'URL d'envoi est soit erronée soit n'existe pas.","tb":"To","Size":"Taille","Close":"Fermer","Init error.":"Erreur d'initialisation.","Add files to the upload queue and click the start button.":"Ajoutez des fichiers à la file d'attente de téléchargement et appuyez sur le bouton 'Démarrer l'envoi'","Filename":"Nom du fichier","Image format either wrong or not supported.":"Le format d'image est soit erroné soit pas géré.","Status":"État","HTTP Error.":"Erreur HTTP.","Start Upload":"Démarrer l'envoi","mb":"Mo","kb":"Ko","Duplicate file error.":"Erreur: Fichier à double.","File size error.":"Erreur de taille de fichier.","N/A":"Non applicable","gb":"Go","Error: Invalid file extension:":"Erreur: Extension de fichier non valide:","Select files":"Sélectionnez les fichiers","%s already present in the queue.":"%s déjà présent dans la file d'attente.","File: %s":"Fichier: %s","b":"o","Uploaded %d/%d files":"%d fichiers sur %d ont été envoyés","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Que %d fichier(s) peuvent être envoyé(s) à la fois. Les fichiers supplémentaires ont été ignorés.","%d files queued":"%d fichiers en attente","File: %s, size: %d, max file size: %d":"Fichier: %s, taille: %d, taille max. d'un fichier: %d","Drag files here.":"Déposez les fichiers ici.","Runtime ran out of available memory.":"Le traitement a manqué de mémoire disponible.","File count error.":"Erreur: Nombre de fichiers.","File extension error.":"Erreur d'extension de fichier","Error: File too large:":"Erreur: Fichier trop volumineux:","Add Files":"Ajouter des fichiers"});
1
  // French (fr)
2
+ plupload.addI18n({"Stop Upload":"Arrêter l'envoi.","Upload URL might be wrong or doesn't exist.":"L'URL d'envoi est soit erronée soit n'existe pas.","tb":"To","Size":"Taille","Close":"Fermer","You must specify either browse_button or drop_element.":"Vous devez spécifier browse_button ou drop_element.","Init error.":"Erreur d'initialisation.","Add files to the upload queue and click the start button.":"Ajoutez des fichiers à la file d'attente de téléchargement et appuyez sur le bouton 'Démarrer l'envoi'","List":"Liste","Filename":"Nom du fichier","%s specified, but cannot be found.":"%s spécifié, mais ne peut pas être trouvé.","Image format either wrong or not supported.":"Le format d'image est soit erroné soit pas géré.","Status":"État","HTTP Error.":"Erreur HTTP.","Start Upload":"Démarrer l'envoi","Error: File too large:":"Erreur: Fichier trop volumineux:","kb":"Ko","Duplicate file error.":"Erreur: Fichier déjà sélectionné.","File size error.":"Erreur de taille de fichier.","N/A":"Non applicable","gb":"Go","Error: Invalid file extension:":"Erreur: Extension de fichier non valide:","Select files":"Sélectionnez les fichiers","%s already present in the queue.":"%s déjà présent dans la file d'attente.","Resoultion out of boundaries! <b>%s</b> runtime supports images only up to %wx%hpx.":"Résolution sur les frontières ! L'exécution de <b>%s</b> supporte seulement les images de %wx%hpx","File: %s":"Fichier: %s","b":"o","Uploaded %d/%d files":"%d fichiers sur %d ont été envoyés","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Que %d fichier(s) peuvent être envoyé(s) à la fois. Les fichiers supplémentaires ont été ignorés.","%d files queued":"%d fichiers en attente","File: %s, size: %d, max file size: %d":"Fichier: %s, taille: %d, taille max. d'un fichier: %d","Thumbnails":"Miniatures","Drag files here.":"Déposez les fichiers ici.","Runtime ran out of available memory.":"Le traitement a manqué de mémoire disponible.","File count error.":"Erreur: Nombre de fichiers.","File extension error.":"Erreur d'extension de fichier","mb":"Mo","Add Files":"Ajouter des fichiers"});
admin/js/plupload/i18n/he.js CHANGED
@@ -1,2 +1,2 @@
1
  // Hebrew (he)
2
- plupload.addI18n({"Stop Upload":"בטל העלאה","Upload URL might be wrong or doesn't exist.":"כתובת URL שגויה או לא קיימת.","tb":"tb","Size":"גודל","Close":"סגור","Init error.":"שגיאת איתחול","Add files to the upload queue and click the start button.":"הוסף קבצים לרשימה ולחץ על כפתור שליחה להתחלת פעולות העלאה","Filename":"שם קובץ","Image format either wrong or not supported.":"תמונה פגומה או סוג תמונה לא נתמך","Status":"אחוז","HTTP Error.":"שגיאת פרוטוקול","Start Upload":"שליחה","mb":"MB","kb":"KB","Duplicate file error.":"קובץ כפול","File size error.":"גודל קובץ חורג מהמותר","N/A":"שגיאה","gb":"GB","Error: Invalid file extension:":"שגיאה: סוג קובץ לא נתמך:","Select files":"בחר קבצים","%s already present in the queue.":"%sקובץ נמצא כבר ברשימת הקבצים.","File: %s":"קובץ: %s","b":"B","Uploaded %d/%d files":"מעלה: %d/%d","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"אלמנטי ההעלאה מקבלים רק %d קובץ(ים) בפעם אחת. קבצים נוספים הוסרו.","%d files queued":"%d קבצים נותרו","File: %s, size: %d, max file size: %d":"קובץ: %s, גודל: %d, גודל מקסימלי: %d","Drag files here.":"גרור קבצים לכאן","Runtime ran out of available memory.":"שגיאת מחסור בזיכרון","File count error.":"שגיאת מספר קבצים","File extension error.":"קובץ זה לא נתמך","Error: File too large:":"שגיאה: קובץ חורג מהגודל המותר:","Add Files":"הוסף קבצים"});
1
  // Hebrew (he)
2
+ plupload.addI18n({"Stop Upload":"בטל העלאה","Upload URL might be wrong or doesn't exist.":"כתובת URL שגויה או לא קיימת.","tb":"tb","Size":"גודל","Close":"סגור","You must specify either browse_button or drop_element.":"יש לציין או browse_button או drop_element.","Init error.":"שגיאת איתחול","Add files to the upload queue and click the start button.":"הוסף קבצים לרשימה ולחץ על כפתור שליחה להתחלת פעולות העלאה","List":"רשימה","Filename":"שם קובץ","%s specified, but cannot be found.":"%s צויין, אך לא נמצא.","Image format either wrong or not supported.":"תמונה פגומה או סוג תמונה לא נתמך","Status":"אחוז","HTTP Error.":"שגיאת פרוטוקול","Start Upload":"שליחה","Error: File too large:":"שגיאה: קובץ חורג מהגודל המותר:","kb":"KB","Duplicate file error.":"קובץ כפול","File size error.":"גודל קובץ חורג מהמותר","N/A":"שגיאה","gb":"GB","Error: Invalid file extension:":"שגיאה: סוג קובץ לא נתמך:","Select files":"בחר קבצים","%s already present in the queue.":"%sקובץ נמצא כבר ברשימת הקבצים.","Resoultion out of boundaries! <b>%s</b> runtime supports images only up to %wx%hpx.":"הרזולוציה גבוהה מדי! <b>%s</b> הפלטפורמה תומכת בתמונות עד גודל px.","File: %s":"קובץ: %s","b":"B","Uploaded %d/%d files":"מעלה: %d/%d","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"אלמנטי ההעלאה מקבלים רק %d קובץ(ים) בפעם אחת. קבצים נוספים הוסרו.","%d files queued":"%d קבצים נותרו","File: %s, size: %d, max file size: %d":"קובץ: %s, גודל: %d, גודל מקסימלי: %d","Thumbnails":"תמונות ממוזערות","Drag files here.":"גרור קבצים לכאן","Runtime ran out of available memory.":"שגיאת מחסור בזיכרון","File count error.":"שגיאת מספר קבצים","File extension error.":"קובץ זה לא נתמך","mb":"MB","Add Files":"הוסף קבצים"});
admin/js/plupload/i18n/hr.js CHANGED
@@ -1,2 +1,2 @@
1
  // Croatian (hr)
2
- plupload.addI18n({"Stop Upload":"Zaustavi upload.","Upload URL might be wrong or doesn't exist.":"Upload URL might be wrong or doesn't exist.","tb":"tb","Size":"Veličina","Close":"Zatvori","Init error.":"Greška inicijalizacije.","Add files to the upload queue and click the start button.":"Dodajte datoteke u listu i kliknite Upload.","Filename":"Ime datoteke","Image format either wrong or not supported.":"Image format either wrong or not supported.","Status":"Status","HTTP Error.":"HTTP greška.","Start Upload":"Pokreni upload.","mb":"mb","kb":"kb","Duplicate file error.":"Pogreška dvostruke datoteke.","File size error.":"Greška veličine datoteke.","N/A":"N/A","gb":"gb","Error: Invalid file extension:":"Pogreška: Nevažeći nastavak datoteke:","Select files":"Odaberite datoteke:","%s already present in the queue.":"%s je već prisutan u listi čekanja.","File: %s":"Datoteka: %s","b":"b","Uploaded %d/%d files":"Uploadano %d/%d datoteka","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Upload element accepts only %d file(s) at a time. Extra files were stripped.","%d files queued":"%d datoteka na čekanju.","File: %s, size: %d, max file size: %d":"Datoteka: %s, veličina: %d, maksimalna veličina: %d","Drag files here.":"Dovucite datoteke ovdje","Runtime ran out of available memory.":"Runtime aplikaciji je ponestalo memorije.","File count error.":"Pogreška u broju datoteka.","File extension error.":"Pogreška u nastavku datoteke.","Error: File too large:":"Pogreška: Datoteka je prevelika:","Add Files":"Dodaj datoteke"});
1
  // Croatian (hr)
2
+ plupload.addI18n({"Stop Upload":"Zaustavi upload.","Upload URL might be wrong or doesn't exist.":"Upload URL might be wrong or doesn't exist.","tb":"tb","Size":"Veličina","Close":"Zatvori","You must specify either browse_button or drop_element.":"","Init error.":"Greška inicijalizacije.","Add files to the upload queue and click the start button.":"Dodajte datoteke u listu i kliknite Upload.","List":"","Filename":"Ime datoteke","%s specified, but cannot be found.":"","Image format either wrong or not supported.":"Image format either wrong or not supported.","Status":"Status","HTTP Error.":"HTTP greška.","Start Upload":"Pokreni upload.","Error: File too large:":"Pogreška: Datoteka je prevelika:","kb":"kb","Duplicate file error.":"Pogreška dvostruke datoteke.","File size error.":"Greška veličine datoteke.","N/A":"N/A","gb":"gb","Error: Invalid file extension:":"Pogreška: Nevažeći nastavak datoteke:","Select files":"Odaberite datoteke:","%s already present in the queue.":"%s je već prisutan u listi čekanja.","Resoultion out of boundaries! <b>%s</b> runtime supports images only up to %wx%hpx.":"","File: %s":"Datoteka: %s","b":"b","Uploaded %d/%d files":"Uploadano %d/%d datoteka","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Upload element accepts only %d file(s) at a time. Extra files were stripped.","%d files queued":"%d datoteka na čekanju.","File: %s, size: %d, max file size: %d":"Datoteka: %s, veličina: %d, maksimalna veličina: %d","Thumbnails":"","Drag files here.":"Dovucite datoteke ovdje","Runtime ran out of available memory.":"Runtime aplikaciji je ponestalo memorije.","File count error.":"Pogreška u broju datoteka.","File extension error.":"Pogreška u nastavku datoteke.","mb":"mb","Add Files":"Dodaj datoteke"});
admin/js/plupload/i18n/hu.js CHANGED
@@ -1,2 +1,2 @@
1
  // Hungarian (hu)
2
- plupload.addI18n({"Stop Upload":"Feltöltés leállítása","Upload URL might be wrong or doesn't exist.":"A feltöltő URL hibás vagy nem létezik.","tb":"","Size":"Méret","Close":"Bezárás","Init error.":"Init hiba.","Add files to the upload queue and click the start button.":"A fájlok feltöltési sorhoz való hozzáadása után az Indítás gombra kell kattintani.","Filename":"Fájlnév","Image format either wrong or not supported.":"Rossz vagy nem támogatott képformátum.","Status":"Állapot","HTTP Error.":"HTTP-hiba.","Start Upload":"Feltöltés indítása","mb":"","kb":"","Duplicate file error.":"Duplikáltfájl-hiba.","File size error.":"Hibás fájlméret.","N/A":"Nem elérhető","gb":"","Error: Invalid file extension:":"Hiba: érvénytelen fájlkiterjesztés:","Select files":"Fájlok kiválasztása","%s already present in the queue.":"%s már szerepel a listában.","File: %s":"Fájl: %s","b":"b","Uploaded %d/%d files":"Feltöltött fájlok: %d/%d","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"A feltöltés egyszerre csak %d fájlt fogad el, a többi fájl nem lesz feltöltve.","%d files queued":"%d fájl sorbaállítva","File: %s, size: %d, max file size: %d":"Fájl: %s, méret: %d, legnagyobb fájlméret: %d","Drag files here.":"Ide lehet húzni a fájlokat.","Runtime ran out of available memory.":"Futásidőben elfogyott a rendelkezésre álló memória.","File count error.":"A fájlok számával kapcsolatos hiba.","File extension error.":"Hibás fájlkiterjesztés.","Error: File too large:":"Hiba: a fájl túl nagy:","Add Files":"Fájlok hozzáadása"});
1
  // Hungarian (hu)
2
+ plupload.addI18n({"Stop Upload":"Feltöltés leállítása","Upload URL might be wrong or doesn't exist.":"A feltöltő URL hibás vagy nem létezik.","tb":"TB","Size":"Méret","Close":"Bezárás","You must specify either browse_button or drop_element.":"","Init error.":"Init hiba.","Add files to the upload queue and click the start button.":"A fájlok feltöltési sorhoz való hozzáadása után az Indítás gombra kell kattintani.","List":"","Filename":"Fájlnév","%s specified, but cannot be found.":"","Image format either wrong or not supported.":"Rossz vagy nem támogatott képformátum.","Status":"Állapot","HTTP Error.":"HTTP-hiba.","Start Upload":"Feltöltés indítása","Error: File too large:":"Hiba: a fájl túl nagy:","kb":"kB","Duplicate file error.":"Duplikáltfájl-hiba.","File size error.":"Hibás fájlméret.","N/A":"Nem elérhető","gb":"GB","Error: Invalid file extension:":"Hiba: érvénytelen fájlkiterjesztés:","Select files":"Fájlok kiválasztása","%s already present in the queue.":"%s már szerepel a listában.","Resoultion out of boundaries! <b>%s</b> runtime supports images only up to %wx%hpx.":"","File: %s":"Fájl: %s","b":"b","Uploaded %d/%d files":"Feltöltött fájlok: %d/%d","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"A feltöltés egyszerre csak %d fájlt fogad el, a többi fájl nem lesz feltöltve.","%d files queued":"%d fájl sorbaállítva","File: %s, size: %d, max file size: %d":"Fájl: %s, méret: %d, legnagyobb fájlméret: %d","Thumbnails":"","Drag files here.":"Ide lehet húzni a fájlokat.","Runtime ran out of available memory.":"Futásidőben elfogyott a rendelkezésre álló memória.","File count error.":"A fájlok számával kapcsolatos hiba.","File extension error.":"Hibás fájlkiterjesztés.","mb":"MB","Add Files":"Fájlok hozzáadása"});
admin/js/plupload/i18n/hy.js CHANGED
@@ -1,2 +1,2 @@
1
  // Armenian (hy)
2
- plupload.addI18n({"Stop Upload":"Կանգնեցնել","Upload URL might be wrong or doesn't exist.":"Ավեցաված URL-ը սխալ է կամ գոյություն չունի։","tb":"տբ","Size":"Չափ","Close":"Փակել","Init error.":"Ստեղծման սխալ","Add files to the upload queue and click the start button.":"Ավելացրեք ֆայլեր ցուցակում և սեղմեք \"Վերբեռնել\"։","Filename":"Ֆայլի անուն","Image format either wrong or not supported.":"Նկարի ֆորմատը սխալ է կամ չի ընդունվում։","Status":"","HTTP Error.":"HTTP սխալ","Start Upload":"Վերբեռնել","mb":"մբ","kb":"կբ","Duplicate file error.":"Ֆայլի կրկնման սխալ","File size error.":"Ֆայլի չափի սխալ","N/A":"N/A","gb":"գբ","Error: Invalid file extension:":"Սխալ։ Ֆայլի ընդլայնումը սխալ է։","Select files":"Ընտրեք ֆայլերը","%s already present in the queue.":"%s ֆայլը արդեն ավելացված է ցուցակում.","File: %s":"Ֆայլ: %s","b":"բ","Uploaded %d/%d files":"Վերբեռնվել են %d/%d ֆայլերը","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"","%d files queued":"ցուցակում կա %d ֆայլ","File: %s, size: %d, max file size: %d":"Ֆայլ: %s, չափ: %d, ֆայլի մաքսիմում չափ: %d","Drag files here.":"Տեղափոխեք ֆայլերը այստեղ","Runtime ran out of available memory.":"","File count error.":"Ֆայլերի քանակի սխալ","File extension error.":"Ֆայլի ընդլայնման սխալ","Error: File too large:":"Սխալ։ Ֆայլի չափը մեծ է։","Add Files":"Ավելացնել ֆայլեր"});
1
  // Armenian (hy)
2
+ plupload.addI18n({"Stop Upload":"Կանգնեցնել","Upload URL might be wrong or doesn't exist.":"Ավեցաված URL-ը սխալ է կամ գոյություն չունի։","tb":"տբ","Size":"Չափ","Close":"Փակել","You must specify either browse_button or drop_element.":"","Init error.":"Ստեղծման սխալ","Add files to the upload queue and click the start button.":"Ավելացրեք ֆայլեր ցուցակում և սեղմեք \"Վերբեռնել\"։","List":"","Filename":"Ֆայլի անուն","%s specified, but cannot be found.":"","Image format either wrong or not supported.":"Նկարի ֆորմատը սխալ է կամ չի ընդունվում։","Status":"Կարգավիճակ","HTTP Error.":"HTTP սխալ","Start Upload":"Վերբեռնել","Error: File too large:":"Սխալ։ Ֆայլի չափը մեծ է։","kb":"կբ","Duplicate file error.":"Ֆայլի կրկնման սխալ","File size error.":"Ֆայլի չափի սխալ","N/A":"N/A","gb":"գբ","Error: Invalid file extension:":"Սխալ։ Ֆայլի ընդլայնումը սխալ է։","Select files":"Ընտրեք ֆայլերը","%s already present in the queue.":"%s ֆայլը արդեն ավելացված է ցուցակում.","Resoultion out of boundaries! <b>%s</b> runtime supports images only up to %wx%hpx.":"","File: %s":"Ֆայլ: %s","b":"բ","Uploaded %d/%d files":"Վերբեռնվել են %d/%d ֆայլերը","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Վերբեռնիչը միանգամից ըդունում է միայն %d ֆայլ(եր). Ավելորդ ֆայլերը հեռացվել են.","%d files queued":"ցուցակում կա %d ֆայլ","File: %s, size: %d, max file size: %d":"Ֆայլ: %s, չափ: %d, ֆայլի մաքսիմում չափ: %d","Thumbnails":"","Drag files here.":"Տեղափոխեք ֆայլերը այստեղ","Runtime ran out of available memory.":"Օպերատիվ հիշողության անբավարարուտյուն.","File count error.":"Ֆայլերի քանակի սխալ","File extension error.":"Ֆայլի ընդլայնման սխալ","mb":"մբ","Add Files":"Ավելացնել ֆայլեր"});
admin/js/plupload/i18n/id.js CHANGED
@@ -1,2 +1,2 @@
1
  // Indonesian (id)
2
- plupload.addI18n({"Stop Upload":"Hentikan Upload","Upload URL might be wrong or doesn't exist.":"Alamat URL untuk upload tidak benar atau tidak ada","tb":"tb","Size":"Ukuran","Close":"Tutup","Init error.":"Kesalahan pada Init","Add files to the upload queue and click the start button.":"Tambahkan file kedalam antrian upload dan klik tombol Mulai","Filename":"Nama File","Image format either wrong or not supported.":"Kesalahan pada jenis gambar atau jenis file tidak didukung","Status":"Status","HTTP Error.":"HTTP Bermasalah","Start Upload":"Mulai Upload","mb":"mb","kb":"kb","Duplicate file error.":"Terjadi duplikasi file","File size error.":"Kesalahan pada ukuran file","N/A":"N/A","gb":"gb","Error: Invalid file extension:":"Kesalahan: Ekstensi file tidak dikenal","Select files":"Pilih file","%s already present in the queue.":"%s sudah ada dalam daftar antrian","File: %s":"File: %s","b":"b","Uploaded %d/%d files":"File terupload %d/%d","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Tempat untuk upload hanya menerima %d file(s) dalam setiap upload. File lainnya tidak akan disertakan","%d files queued":"%d file dalam antrian","File: %s, size: %d, max file size: %d":"File: %s, ukuran: %d, maksimum ukuran file: %d","Drag files here.":"Tarik file kesini","Runtime ran out of available memory.":"Tidak cukup memori","File count error.":"Kesalahan pada jumlah file","File extension error.":"Kesalahan pada ekstensi file","Error: File too large:":"Kesalahan: File terlalu besar","Add Files":"Tambah File"});
1
  // Indonesian (id)
2
+ plupload.addI18n({"Stop Upload":"Hentikan Upload","Upload URL might be wrong or doesn't exist.":"Alamat URL untuk upload tidak benar atau tidak ada","tb":"tb","Size":"Ukuran","Close":"Tutup","You must specify either browse_button or drop_element.":"","Init error.":"Kesalahan pada Init","Add files to the upload queue and click the start button.":"Tambahkan file kedalam antrian upload dan klik tombol Mulai","List":"","Filename":"Nama File","%s specified, but cannot be found.":"","Image format either wrong or not supported.":"Kesalahan pada jenis gambar atau jenis file tidak didukung","Status":"Status","HTTP Error.":"HTTP Bermasalah","Start Upload":"Mulai Upload","Error: File too large:":"Kesalahan: File terlalu besar","kb":"kb","Duplicate file error.":"Terjadi duplikasi file","File size error.":"Kesalahan pada ukuran file","N/A":"N/A","gb":"gb","Error: Invalid file extension:":"Kesalahan: Ekstensi file tidak dikenal","Select files":"Pilih file","%s already present in the queue.":"%s sudah ada dalam daftar antrian","Resoultion out of boundaries! <b>%s</b> runtime supports images only up to %wx%hpx.":"","File: %s":"File: %s","b":"b","Uploaded %d/%d files":"File terupload %d/%d","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Tempat untuk upload hanya menerima %d file(s) dalam setiap upload. File lainnya tidak akan disertakan","%d files queued":"%d file dalam antrian","File: %s, size: %d, max file size: %d":"File: %s, ukuran: %d, maksimum ukuran file: %d","Thumbnails":"","Drag files here.":"Tarik file kesini","Runtime ran out of available memory.":"Tidak cukup memori","File count error.":"Kesalahan pada jumlah file","File extension error.":"Kesalahan pada ekstensi file","mb":"mb","Add Files":"Tambah File"});
admin/js/plupload/i18n/it.js CHANGED
@@ -1,2 +1,2 @@
1
  // Italian (it)
2
- plupload.addI18n({"Stop Upload":"Ferma Upload","Upload URL might be wrong or doesn't exist.":"URL di Upload errata o non esistente","tb":"tb","Size":"Dimensione","Close":"Chiudi","Init error.":"Errore inizializzazione.","Add files to the upload queue and click the start button.":"Aggiungi i file alla coda di caricamento e clicca il pulsante di avvio.","Filename":"Nome file","Image format either wrong or not supported.":"Formato immagine errato o non supportato.","Status":"Stato","HTTP Error.":"Errore HTTP.","Start Upload":"Inizia Upload","mb":"mb","kb":"kb","Duplicate file error.":"Errore file duplicato.","File size error.":"Errore dimensione file.","N/A":"N/D","gb":"gb","Error: Invalid file extension:":"Errore: Estensione file non valida:","Select files":"Seleziona i files","%s already present in the queue.":"%s già presente nella coda.","File: %s":"File: %s","b":"byte","Uploaded %d/%d files":"Caricati %d/%d file","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Upload element accepts only %d file(s) at a time. Extra files were stripped.","%d files queued":"%d file in coda","File: %s, size: %d, max file size: %d":"File: %s, dimensione: %d, dimensione max file: %d","Drag files here.":"Trascina i files qui.","Runtime ran out of available memory.":"Runtime ha esaurito la memoria disponibile.","File count error.":"File count error.","File extension error.":"Errore estensione file.","Error: File too large:":"Errore: File troppo grande:","Add Files":"Aggiungi file"});
1
  // Italian (it)
2
+ plupload.addI18n({"Stop Upload":"Ferma Upload","Upload URL might be wrong or doesn't exist.":"URL di Upload errata o non esistente","tb":"tb","Size":"Dimensione","Close":"Chiudi","You must specify either browse_button or drop_element.":"Devi indicare almeno uno tra browse_button o drop_element.","Init error.":"Errore inizializzazione.","Add files to the upload queue and click the start button.":"Aggiungi i file alla coda di caricamento e clicca il pulsante di avvio.","List":"Lista","Filename":"Nome file","%s specified, but cannot be found.":"%s specificato, ma non è stato possibile trovarlo.","Image format either wrong or not supported.":"Formato immagine errato o non supportato.","Status":"Stato","HTTP Error.":"Errore HTTP.","Start Upload":"Inizia Upload","Error: File too large:":"Errore: File troppo grande:","kb":"kb","Duplicate file error.":"Errore file duplicato.","File size error.":"Errore dimensione file.","N/A":"N/D","gb":"gb","Error: Invalid file extension:":"Errore: Estensione file non valida:","Select files":"Seleziona i files","%s already present in the queue.":"%s già presente nella coda.","Resoultion out of boundaries! <b>%s</b> runtime supports images only up to %wx%hpx.":"Risoluzione oltre i limiti! <b>%s</b> runtime supporta immagini fino a %wx%hpx.","File: %s":"File: %s","b":"byte","Uploaded %d/%d files":"Caricati %d/%d file","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Upload element accepts only %d file(s) at a time. Extra files were stripped.","%d files queued":"%d file in coda","File: %s, size: %d, max file size: %d":"File: %s, dimensione: %d, dimensione max file: %d","Thumbnails":"Anteprime","Drag files here.":"Trascina i files qui.","Runtime ran out of available memory.":"Runtime ha esaurito la memoria disponibile.","File count error.":"File count error.","File extension error.":"Errore estensione file.","mb":"mb","Add Files":"Aggiungi file"});
admin/js/plupload/i18n/ja.js CHANGED
@@ -1,2 +1,2 @@
1
  // Japanese (ja)
2
- plupload.addI18n({"Stop Upload":"アップロード停止","Upload URL might be wrong or doesn't exist.":"アップロード先の URL が存在しません","tb":"","Size":"サイズ","Close":"閉じる","Init error.":"イニシャライズエラー","Add files to the upload queue and click the start button.":"ファイルをアップロードキューに追加してスタートボタンをクリックしてください","Filename":"ファイル名","Image format either wrong or not supported.":"Image format either wrong or not supported.","Status":"ステータス","HTTP Error.":"HTTP エラー","Start Upload":"アップロード","mb":"","kb":"","Duplicate file error.":"","File size error.":"ファイルサイズエラー","N/A":"N/A","gb":"","Error: Invalid file extension:":"Error: Invalid file extension:","Select files":"ファイル選択","%s already present in the queue.":"","File: %s":"ファイル: %s","b":"","Uploaded %d/%d files":"アップロード中 %d/%d ファイル","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"アップロード可能なファイル数は %d です。余分なファイルは削除されました","%d files queued":"%d ファイルが追加されました","File: %s, size: %d, max file size: %d":"","Drag files here.":"ここにファイルをドラッグ","Runtime ran out of available memory.":"Runtime ran out of available memory.","File count error.":"ファイル数エラー","File extension error.":"ファイル拡張子エラー","Error: File too large:":"Error: File too large:","Add Files":"ファイルを追加"});
1
  // Japanese (ja)
2
+ plupload.addI18n({"Stop Upload":"アップロード停止","Upload URL might be wrong or doesn't exist.":"アップロード先の URL が存在しません","tb":"TB","Size":"サイズ","Close":"閉じる","You must specify either browse_button or drop_element.":"ブラウザのボタンで または ファイルをドロップするか いずれかの方法で指定する必要があります。","Init error.":"イニシャライズエラー","Add files to the upload queue and click the start button.":"ファイルをアップロードキューに追加してスタートボタンをクリックしてください","List":"リスト","Filename":"ファイル名","%s specified, but cannot be found.":"指定された %s は見つかりません。","Image format either wrong or not supported.":"画像形式が間違っているかサポートされていません","Status":"ステータス","HTTP Error.":"HTTP エラー","Start Upload":"アップロード開始","Error: File too large:":"エラー: ファイルが大きすぎます:","kb":"KB","Duplicate file error.":"重複ファイルエラー","File size error.":"ファイルサイズエラー","N/A":"N/A","gb":"GB","Error: Invalid file extension:":"エラー: ファイルの拡張子が無効です:","Select files":"ファイル選択","%s already present in the queue.":"%s 既にキューに存在しています","Resoultion out of boundaries! <b>%s</b> runtime supports images only up to %wx%hpx.":"解像度がしきい値を超えています! ランタイム <b>%s</b> は縦 %h px 横 %w px までをサポートします","File: %s":"ファイル: %s","b":"B","Uploaded %d/%d files":"アップロード中 %d/%d ファイル","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"アップロード可能なファイル数は %d です 余分なファイルは削除されました","%d files queued":"%d ファイルが追加されました","File: %s, size: %d, max file size: %d":"ファイル: %s, サイズ: %d, 最大ファイルサイズ: %d","Thumbnails":"サムネイル","Drag files here.":"ここにファイルをドラッグ","Runtime ran out of available memory.":"ランタイムが使用するメモリが不足しました","File count error.":"ファイル数エラー","File extension error.":"ファイル拡張子エラー","mb":"MB","Add Files":"ファイルを追加"});
admin/js/plupload/i18n/ka.js CHANGED
@@ -1,2 +1,2 @@
1
  // Georgian (ka)
2
- plupload.addI18n({"Stop Upload":"ატვირთვის შეჩერება","Upload URL might be wrong or doesn't exist.":"ატვირთვის მისამართი არასწორია ან არ არსებობს.","tb":"ტბ","Size":"ზომა","Close":"დავხუროთ","Init error.":"ინიციალიზაციის შეცდომა.","Add files to the upload queue and click the start button.":"დაამატეთ ფაილები და დააჭირეთ ღილაკს - ატვირთვა.","Filename":"ფაილის სახელი","Image format either wrong or not supported.":"ფაილის ფორმატი არ არის მხარდაჭერილი ან არასწორია.","Status":"სტატუსი","HTTP Error.":"HTTP შეცდომა.","Start Upload":"ატვირთვა","mb":"მბ","kb":"კბ","Duplicate file error.":"ესეთი ფაილი უკვე დამატებულია.","File size error.":"ფაილის ზომა დაშვებულზე დიდია.","N/A":"N/A","gb":"გბ","Error: Invalid file extension:":"შეცდომა: ფაილს აქვს არასწორი გაფართოება.","Select files":"ფაილების მონიშვნა","%s already present in the queue.":"%s უკვე დამატებულია.","File: %s":"ფაილი: %s","b":"ბ","Uploaded %d/%d files":"ატვირთულია %d/%d ფაილი","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"ერთდროულად დაშვებულია მხოლოდ %d ფაილის დამატება.","%d files queued":"რიგშია %d ფაილი","File: %s, size: %d, max file size: %d":"ფაილი: %s, ზომა: %d, მაქსიმალური დაშვებული ზომა: %d","Drag files here.":"ჩააგდეთ ფაილები აქ.","Runtime ran out of available memory.":"ხელმისაწვდომი მეხსიერება გადაივსო.","File count error.":"აღმოჩენილია ზედმეტი ფაილები.","File extension error.":"ფაილის ფორმატი დაშვებული არ არის.","Error: File too large:":"შეცდომა: ფაილი ზედმეტად დიდია.","Add Files":"დაამატეთ ფაილები"});
1
  // Georgian (ka)
2
+ plupload.addI18n({"Stop Upload":"ატვირთვის შეჩერება","Upload URL might be wrong or doesn't exist.":"ატვირთვის მისამართი არასწორია ან არ არსებობს.","tb":"ტბ","Size":"ზომა","Close":"დავხუროთ","You must specify either browse_button or drop_element.":"თქვენ უნდა მიუთითოთ browse_button ან drop_element.","Init error.":"ინიციალიზაციის შეცდომა.","Add files to the upload queue and click the start button.":"დაამატეთ ფაილები და დააჭირეთ ღილაკს - ატვირთვა.","List":"","Filename":"ფაილის სახელი","%s specified, but cannot be found.":"%s მითითებულია, მაგრამ ვერ მოიძებნა.","Image format either wrong or not supported.":"ფაილის ფორმატი არ არის მხარდაჭერილი ან არასწორია.","Status":"სტატუსი","HTTP Error.":"HTTP შეცდომა.","Start Upload":"ატვირთვა","Error: File too large:":"შეცდომა: ფაილი ზედმეტად დიდია.","kb":"კბ","Duplicate file error.":"ესეთი ფაილი უკვე დამატებულია.","File size error.":"ფაილის ზომა დაშვებულზე დიდია.","N/A":"N/A","gb":"გბ","Error: Invalid file extension:":"შეცდომა: ფაილს აქვს არასწორი გაფართოება.","Select files":"ფაილების მონიშვნა","%s already present in the queue.":"%s უკვე დამატებულია.","Resoultion out of boundaries! <b>%s</b> runtime supports images only up to %wx%hpx.":"სურათის გარჩევადობა აღემატება <b>%s</b> გარემოს მიერ მხარდაჭერილ მქსიმუმებს - %wx%hpx.","File: %s":"ფაილი: %s","b":"ბ","Uploaded %d/%d files":"ატვირთულია %d/%d ფაილი","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"ერთდროულად დაშვებულია მხოლოდ %d ფაილის დამატება.","%d files queued":"რიგშია %d ფაილი","File: %s, size: %d, max file size: %d":"ფაილი: %s, ზომა: %d, მაქსიმალური დაშვებული ზომა: %d","Thumbnails":"","Drag files here.":"ჩააგდეთ ფაილები აქ.","Runtime ran out of available memory.":"ხელმისაწვდომი მეხსიერება გადაივსო.","File count error.":"აღმოჩენილია ზედმეტი ფაილები.","File extension error.":"ფაილის ფორმატი დაშვებული არ არის.","mb":"მბ","Add Files":"დაამატეთ ფაილები"});
admin/js/plupload/i18n/kk.js CHANGED
@@ -1,2 +1,2 @@
1
  // Kazakh (kk)
2
- plupload.addI18n({"Stop Upload":"Жүктеуді тоқтату","Upload URL might be wrong or doesn't exist.":"Жүктеуді қабылдаушы URL қате не мүлдем көрсетілмеген.","tb":"тб","Size":"Өлшемі","Close":"Жабу","Init error.":"Инициализация қатесі.","Add files to the upload queue and click the start button.":"Жүктеу кезегіне файлдар қосып, Бастау кнопкасын басыңыз.","Filename":"Файл аты","Image format either wrong or not supported.":"Сурет форматы қате немесе оның қолдауы жоқ.","Status":"Күйі","HTTP Error.":"HTTP қатесі.","Start Upload":"Жүктеуді бастау","mb":"мб","kb":"кб","Duplicate file error.":"Файл қайталамасының қатесі.","File size error.":"Файл өлшемінің қатесі.","N/A":"Қ/Ж","gb":"гб","Error: Invalid file extension:":"Қате: Файл кеңейтілуі қате:","Select files":"Файлдар таңдаңыз","%s already present in the queue.":"%s файлы кезекте бұрыннан бар.","File: %s":"Файл: %s","b":"б","Uploaded %d/%d files":"Жүктелген: %d/%d файл","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Жүктеу элементі бір кезде %d файл ғана жүктей алады. Артық файлдар жүктелмейді.","%d files queued":"%d файл кезекке қойылды","File: %s, size: %d, max file size: %d":"Файл: %s, өлшемі: %d, макс. файл өлшемі: %d","Drag files here.":"Файлдарды мына жерге тастаңыз.","Runtime ran out of available memory.":"Орындау кезінде жады жетпей қалды.","File count error.":"Файл санының қатесі.","File extension error.":"Файл кеңейтілуінің қатесі.","Error: File too large:":"Қате: Файл мөлшері тым үлкен:","Add Files":"Файл қосу"});
1
  // Kazakh (kk)
2
+ plupload.addI18n({"Stop Upload":"Жүктеуді тоқтату","Upload URL might be wrong or doesn't exist.":"Жүктеуді қабылдаушы URL қате не мүлдем көрсетілмеген.","tb":"тб","Size":"Өлшемі","Close":"Жабу","You must specify either browse_button or drop_element.":"","Init error.":"Инициализация қатесі.","Add files to the upload queue and click the start button.":"Жүктеу кезегіне файлдар қосып, Бастау кнопкасын басыңыз.","List":"","Filename":"Файл аты","%s specified, but cannot be found.":"","Image format either wrong or not supported.":"Сурет форматы қате немесе оның қолдауы жоқ.","Status":"Күйі","HTTP Error.":"HTTP қатесі.","Start Upload":"Жүктеуді бастау","Error: File too large:":"Қате: Файл мөлшері тым үлкен:","kb":"кб","Duplicate file error.":"Файл қайталамасының қатесі.","File size error.":"Файл өлшемінің қатесі.","N/A":"Қ/Ж","gb":"гб","Error: Invalid file extension:":"Қате: Файл кеңейтілуі қате:","Select files":"Файлдар таңдаңыз","%s already present in the queue.":"%s файлы кезекте бұрыннан бар.","Resoultion out of boundaries! <b>%s</b> runtime supports images only up to %wx%hpx.":"","File: %s":"Файл: %s","b":"б","Uploaded %d/%d files":"Жүктелген: %d/%d файл","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Жүктеу элементі бір кезде %d файл ғана жүктей алады. Артық файлдар жүктелмейді.","%d files queued":"%d файл кезекке қойылды","File: %s, size: %d, max file size: %d":"Файл: %s, өлшемі: %d, макс. файл өлшемі: %d","Thumbnails":"","Drag files here.":"Файлдарды мына жерге тастаңыз.","Runtime ran out of available memory.":"Орындау кезінде жады жетпей қалды.","File count error.":"Файл санының қатесі.","File extension error.":"Файл кеңейтілуінің қатесі.","mb":"мб","Add Files":"Файл қосу"});
admin/js/plupload/i18n/km.js ADDED
@@ -0,0 +1,2 @@
 
 
1
+ // Khmer (km)
2
+ plupload.addI18n({"Stop Upload":"បញ្ឈប់​ការ​ផ្ទុក​ឡើង","Upload URL might be wrong or doesn't exist.":"URL ផ្ទុក​ឡើង​អាច​ខុស ឬ​ក៏​គ្មាន។","tb":"tb","Size":"ទំហំ","Close":"បិទ","You must specify either browse_button or drop_element.":"","Init error.":"កំហុស Init។","Add files to the upload queue and click the start button.":"បន្ថែម​ឯកសារ​ទៅ​ក្នុង​ជួរ​លំដាប់​ផ្ទុក​ឡើង ហើយ​ចុច​ប៊ូតុង​ចាប់​ផ្ដើម។","List":"","Filename":"ឈ្មោះ​ឯកសារ","%s specified, but cannot be found.":"","Image format either wrong or not supported.":"ទ្រង់​ទ្រាយ​រូបភាព​អាច​ខុស ឬ​ក៏​មិន​ស្គាល់​តែ​ម្ដង។","Status":"ស្ថានភាព","HTTP Error.":"កំហុស HTTP ។","Start Upload":"ចាប់​ផ្ដើម​ផ្ទុក​ឡើង","Error: File too large:":"កំហុស៖ ឯកសារ​ធំ​ពេក៖","kb":"kb","Duplicate file error.":"កំហុស​ឯកសារ​ស្ទួន​គ្នា។","File size error.":"កំហុស​ទំហំ​ឯកសារ។","N/A":"គ្មាន","gb":"gb","Error: Invalid file extension:":"កំហុស៖ កន្ទុយ​ឯកសារ​មិន​ត្រឹម​ត្រូវ៖","Select files":"ជ្រើស​ឯកសារ","%s already present in the queue.":"មាន %s នៅ​ក្នុង​ជួរ​លំដាប់​ហើយ។","Resoultion out of boundaries! <b>%s</b> runtime supports images only up to %wx%hpx.":"","File: %s":"ឯកសារ៖ %s","b":"b","Uploaded %d/%d files":"បាន​ផ្ទុក​ឡើង​ឯកសារ %d/%d","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"ការ​ផ្ទុក​ឡើង​ទទួល​ឯកសារ​បាន​តែ %d ប៉ុណ្ណោះ​ក្នុង​ពេល​តែ​មួយ។ ឯកសារ​ផ្សេង​ទៀត​នឹង​ត្រូវ​ដក​ចេញ។","%d files queued":"បាន​ដាក់​ឯកសារ %d បន្ត​គ្នា","File: %s, size: %d, max file size: %d":"ឯកសារ៖ %s, size: %d, ទំហំ​ឯកសារ​អតិបរមា៖ %d","Thumbnails":"","Drag files here.":"អូស​ឯកសារ​មក​ទីនេះ។","Runtime ran out of available memory.":"ពេល​ដំណើរ​ការ​អស់​អង្គ​ចងចាំ​ទំនេរ​ហើយ។","File count error.":"កំហុស​ការ​រាប់​ឯកសារ។","File extension error.":"កំហុស​កន្ទុយ​ឯកសារ។","mb":"mb","Add Files":"បន្ថែម​ឯកសារ"});
admin/js/plupload/i18n/ko.js CHANGED
@@ -1,2 +1,2 @@
1
  // Korean (ko)
2
- plupload.addI18n({"Stop Upload":"업로드 중지","Upload URL might be wrong or doesn't exist.":"업로드할 URL이 존재하지 않습니다","tb":"","Size":"크기","Close":"닫기","Init error.":"초기화 오류","Add files to the upload queue and click the start button.":"파일을 업로드 큐에 추가하여 시작 버튼을 클릭하십시오.","Filename":"파일 이름","Image format either wrong or not supported.":"Image format either wrong or not supported.","Status":"상태","HTTP Error.":"HTTP 오류","Start Upload":"업로드","mb":"","kb":"","Duplicate file error.":"","File size error.":"파일 크기 오류","N/A":"N/A","gb":"","Error: Invalid file extension:":"오류 : 확장자가 허용되지 않습니다 :","Select files":"파일 선택","%s already present in the queue.":"","File: %s":"파일 % s","b":"","Uploaded %d/%d files":"업로드 중 % d / % d 파일","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"업로드 가능한 파일의 수는 % d입니다. 불필요한 파일은 삭제되었습니다","%d files queued":"% d 파일이 추가되었습니다","File: %s, size: %d, max file size: %d":"","Drag files here.":"여기에 파일을 드래그","Runtime ran out of available memory.":"Runtime ran out of available memory.","File count error.":"이미지 : 오류","File extension error.":"파일 확장자 오류","Error: File too large:":"오류 : 크기가 너무 큽니다","Add Files":"파일 추가"});
1
  // Korean (ko)
2
+ plupload.addI18n({"Stop Upload":"업로드 중지","Upload URL might be wrong or doesn't exist.":"업로드할 URL이 존재하지 않습니다.","tb":"tb","Size":"크기","Close":"닫기","You must specify either browse_button or drop_element.":"browse_button 이나 drop_element 둘 중 하나를 지정해 주세요.","Init error.":"초기화 오류.","Add files to the upload queue and click the start button.":"파일을 업로드 큐에 추가한 시작 버튼을 클릭하십시오.","List":"목록","Filename":"파일명","%s specified, but cannot be found.":"%s 가 지정됐지만, 찾을 수 없습니다.","Image format either wrong or not supported.":"지원되지 않는 이미지 형식입니다.","Status":"상태","HTTP Error.":"HTTP 오류.","Start Upload":"업로드 시작","Error: File too large:":"오류: 파일 크기가 너무 큽니다.","kb":"kb","Duplicate file error.":"파일 중복 오류.","File size error.":"파일 크기 오류.","N/A":"N/A","gb":"gb","Error: Invalid file extension:":"오류: 허용되지 않은 확장자입니다.","Select files":"파일 선택","%s already present in the queue.":"%s 파일이 이미 대기열에 존재합니다.","Resoultion out of boundaries! <b>%s</b> runtime supports images only up to %wx%hpx.":"해상도 지원 범위를 초과했습니다! <b>%s</b> 런타임은 %wx%hpx 이상의 이미지를 지원합니다.","File: %s":"파일: %s","b":"b","Uploaded %d/%d files":"%d / %d 파일 업로드 완료","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"업로드 가능한 파일의 수는 %d 입니다. 불필요한 파일은 삭제되었습니다.","%d files queued":"%d 파일이 추가됨","File: %s, size: %d, max file size: %d":"파일: %s, 크기: %d, 최대 파일 크기: %d","Thumbnails":"미리보기","Drag files here.":"이곳에 파일을 드래그 하세요.","Runtime ran out of available memory.":"런타임 메모리가 부족합니다.","File count error.":"파일 갯수 오류.","File extension error.":"파일 확장자 오류.","mb":"mb","Add Files":"파일 추가"});
admin/js/plupload/i18n/ku_IQ.js ADDED
@@ -0,0 +1,2 @@
 
 
1
+ // Kurdish (Iraq) (ku_IQ)
2
+ plupload.addI18n({"Stop Upload":"وەستانی بارکردن","Upload URL might be wrong or doesn't exist.":".بەستەری بارکراو نادروستە یان بەردەست نییە","tb":"تێرابایت","Size":"قەبارە","Close":"داخستن","You must specify either browse_button or drop_element.":"","Init error.":".هەڵەی ئامادەکردن","Add files to the upload queue and click the start button.":".زیادکردنی پەڕگەکان بۆ ڕیزی بارکردن و کرتەکردن لە دوگمەی دەستپێکردن","List":"","Filename":"ناوی پەڕگە","%s specified, but cannot be found.":"","Image format either wrong or not supported.":".شێوازی وێنە هەڵەیە یان پاڵپشتی ناکرێت","Status":"ڕەوش","HTTP Error.":".HTTP هەڵەی","Start Upload":"دەستپێکردنی بارکردن","Error: File too large:":":هەڵە: پەڕگەکە زۆر گەورەیە","kb":"کیلۆبایت","Duplicate file error.":".هەڵەی پەڕگەی دوبارە","File size error.":".هەڵەی قەبارەی پەڕگە","N/A":"بەردەست نییە","gb":"گێگابایت","Error: Invalid file extension:":":هەڵە: پاشگری پەڕگەی نادروست","Select files":"دیاریکردنی پەڕگەکان","%s already present in the queue.":".ئامادەیی هەیە لە ڕیز %s","Resoultion out of boundaries! <b>%s</b> runtime supports images only up to %wx%hpx.":"","File: %s":"%s :پەڕگە","b":"بایت","Uploaded %d/%d files":"پەڕگە بارکران %d/%d","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"بەشی بارکردن تەنها %d پەڕگە(کان) وەردەگرێت لەیەک کاتدا. پەڕگە زیادەکان .جیادەکرێنەوە","%d files queued":"پەڕگە ڕیزکران %d","File: %s, size: %d, max file size: %d":"پەڕگە: %s، قەبارە: %d، گەورەترین قەبارەی پەڕگە: %d","Thumbnails":"","Drag files here.":".پەڕگەکان ڕاکێشە بۆ ئێرە","Runtime ran out of available memory.":"هەڵەی دەرچوون لە بیرگەی بەردەست.","File count error.":".هەڵەی ژماردنی پەڕگە","File extension error.":".هەڵەی پاشگری پەڕگە","mb":"مێگابایت","Add Files":"زیادکردنی پەڕگەکان"});
admin/js/plupload/i18n/lt.js CHANGED
@@ -1,2 +1,2 @@
1
  // Lithuanian (lt)
2
- plupload.addI18n({"Stop Upload":"Stabdyti įkėlimą","Upload URL might be wrong or doesn't exist.":"Klaidinga arba neegzistuojanti įkėlimo nuoroda.","tb":"tb","Size":"Dydis","Close":"Uždaryti","Init error.":"Įkrovimo klaida.","Add files to the upload queue and click the start button.":"Pridėkite bylas į įkėlimo eilę ir paspauskite starto mygtuką.","Filename":"Bylos pavadinimas","Image format either wrong or not supported.":"Paveiksliuko formatas klaidingas arba nebepalaikomas.","Status":"Statusas","HTTP Error.":"HTTP klaida.","Start Upload":"Pradėti įkėlimą","mb":"mb","kb":"kb","Duplicate file error.":"Pasikartojanti byla.","File size error.":"Netinkamas bylos dydis.","N/A":"N/A","gb":"gb","Error: Invalid file extension:":"Klaida: Netinkamas bylos plėtinys:","Select files":"Žymėti bylas","%s already present in the queue.":"%s jau yra eilėje.","File: %s":"Byla: %s","b":"b","Uploaded %d/%d files":"Įkelta bylų: %d/%d","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Vienu metu galima įkelti tik %d bylas(ų). Papildomos bylos buvo pašalintos.","%d files queued":"%d bylų eilėje","File: %s, size: %d, max file size: %d":"Byla: %s, dydis: %d, galimas dydis: %d","Drag files here.":"Padėti bylas čia.","Runtime ran out of available memory.":"Išeikvota darbinė atmintis.","File count error.":"Netinkamas bylų kiekis.","File extension error.":"Netinkamas pletinys.","Error: File too large:":"Klaida: Byla per didelė:","Add Files":"Pridėti bylas"});
1
  // Lithuanian (lt)
2
+ plupload.addI18n({"Stop Upload":"Stabdyti įkėlimą","Upload URL might be wrong or doesn't exist.":"Klaidinga arba neegzistuojanti įkėlimo nuoroda.","tb":"tb","Size":"Dydis","Close":"Uždaryti","You must specify either browse_button or drop_element.":"","Init error.":"Įkrovimo klaida.","Add files to the upload queue and click the start button.":"Pridėkite bylas į įkėlimo eilę ir paspauskite starto mygtuką.","List":"","Filename":"Bylos pavadinimas","%s specified, but cannot be found.":"","Image format either wrong or not supported.":"Paveiksliuko formatas klaidingas arba nebepalaikomas.","Status":"Statusas","HTTP Error.":"HTTP klaida.","Start Upload":"Pradėti įkėlimą","Error: File too large:":"Klaida: Byla per didelė:","kb":"kb","Duplicate file error.":"Pasikartojanti byla.","File size error.":"Netinkamas bylos dydis.","N/A":"N/A","gb":"gb","Error: Invalid file extension:":"Klaida: Netinkamas bylos plėtinys:","Select files":"Žymėti bylas","%s already present in the queue.":"%s jau yra eilėje.","Resoultion out of boundaries! <b>%s</b> runtime supports images only up to %wx%hpx.":"","File: %s":"Byla: %s","b":"b","Uploaded %d/%d files":"Įkelta bylų: %d/%d","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Vienu metu galima įkelti tik %d bylas(ų). Papildomos bylos buvo pašalintos.","%d files queued":"%d bylų eilėje","File: %s, size: %d, max file size: %d":"Byla: %s, dydis: %d, galimas dydis: %d","Thumbnails":"","Drag files here.":"Padėti bylas čia.","Runtime ran out of available memory.":"Išeikvota darbinė atmintis.","File count error.":"Netinkamas bylų kiekis.","File extension error.":"Netinkamas pletinys.","mb":"mb","Add Files":"Pridėti bylas"});
admin/js/plupload/i18n/lv.js CHANGED
@@ -1,2 +1,2 @@
1
  // Latvian (lv)
2
- plupload.addI18n({"Stop Upload":"Stop Upload","Upload URL might be wrong or doesn't exist.":"Upload URL might be wrong or doesn't exist.","tb":"terrabaiti","Size":"Izmērs","Close":"Aizvērt","Init error.":"Inicializācijas kļūda.","Add files to the upload queue and click the start button.":"Pieveinojiet failus rindai un klikšķiniet uz","Filename":"Faila nosaukums","Image format either wrong or not supported.":"Image format either wrong or not supported.","Status":"Statuss","HTTP Error.":"HTTP kļūda.","Start Upload":"Start Upload","mb":"megabaiti","kb":"kilobaiti","Duplicate file error.":"Atkārtota faila kļūda","File size error.":"Faila izmēra kļūda.","N/A":"N/A","gb":"gigabaiti","Error: Invalid file extension:":"Error: Invalid file extension:","Select files":"Izvēlieties failus","%s already present in the queue.":"%s jau ir atrodams rindā.","File: %s":"Fails: %s","b":"baiti","Uploaded %d/%d files":"Augšupielādēti %d/%d faili","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Iespējams ielādēt tikai %d failus vienā reizē. Atlikušie faili netika pievienoti","%d files queued":"%d faili pievienoti rindai","File: %s, size: %d, max file size: %d":"Fails: %s, izmērs: %d, max faila izmērs: %d","Drag files here.":"Ievelciet failus šeit","Runtime ran out of available memory.":"Runtime ran out of available memory.","File count error.":"Failu skaita kļūda","File extension error.":"Faila paplašinājuma kļūda.","Error: File too large:":"Error: File too large:","Add Files":"Add Files"});
1
  // Latvian (lv)
2
+ plupload.addI18n({"Stop Upload":"Apturēt augšupielādi","Upload URL might be wrong or doesn't exist.":"Augšupielādes saite neeksistē vai ir nepareiza.","tb":"terabaiti","Size":"Izmērs","Close":"Aizvērt","You must specify either browse_button or drop_element.":"Jums ir jānorāda vainu browse_button vai drop_element.","Init error.":"Inicializācijas kļūda.","Add files to the upload queue and click the start button.":"Pievienojiet failus rindai un klikšķiniet uz pogas \"Sākt augšupielādi\".","List":"Saraksts","Filename":"Faila nosaukums","%s specified, but cannot be found.":"%s norādīts, bet nevar tikt atrasts.","Image format either wrong or not supported.":"Attēla formāts ir nepareizs vai arī netiek atbalstīts.","Status":"Statuss","HTTP Error.":"HTTP kļūda.","Start Upload":"Sākt augšupielādi","Error: File too large:":"Kļūda: Fails pārāk liels:","kb":"kilobaiti","Duplicate file error.":"Atkārtota faila kļūda","File size error.":"Faila izmēra kļūda.","N/A":"N/A","gb":"gigabaiti","Error: Invalid file extension:":"Kļūda: Nepareizs faila paplašinājums:","Select files":"Izvēlieties failus","%s already present in the queue.":"%s jau ir atrodams rindā.","Resoultion out of boundaries! <b>%s</b> runtime supports images only up to %wx%hpx.":"Izšķirtspēja ārpus robežām! <b>%s</b> atbalsta attēlus tikai līdz %wx%hpx","File: %s":"Fails: %s","b":"baiti","Uploaded %d/%d files":"Augšupielādēti %d/%d faili","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Iespējams ielādēt tikai %d failus vienā reizē. Atlikušie faili netika pievienoti","%d files queued":"%d faili pievienoti rindai","File: %s, size: %d, max file size: %d":"Fails: %s, izmērs: %d, max faila izmērs: %d","Thumbnails":"Ikonas","Drag files here.":"Ievelciet failus šeit","Runtime ran out of available memory.":"Pietrūkst izmantojamās atmiņas.","File count error.":"Failu skaita kļūda","File extension error.":"Faila paplašinājuma kļūda.","mb":"megabaiti","Add Files":"Pievienot failus"});
admin/js/plupload/i18n/ms.js ADDED
@@ -0,0 +1,2 @@
 
 
1
+ // Malay (ms)
2
+ plupload.addI18n({"Stop Upload":"Berhenti Muat naik","Upload URL might be wrong or doesn't exist.":"URL muat naik mungkin salah atau tidak wujud.","tb":"tb","Size":"saiz","Close":"Tutup","You must specify either browse_button or drop_element.":"","Init error.":"Ralat perlaksanaan.","Add files to the upload queue and click the start button.":"Tambah fail ke dalam giliran muat naik dan klik butang Muat Naik.","List":"","Filename":"Nama fail","%s specified, but cannot be found.":"","Image format either wrong or not supported.":"Format imej sama ada salah atau tidak disokong.","Status":"Status","HTTP Error.":"Ralat HTTP.","Start Upload":"Muat Naik","Error: File too large:":"Ralat: Fail terlalu bersar:","kb":"kb","Duplicate file error.":"Ralat menggandakan fail.","File size error.":"Ralat saiz fail.","N/A":"N/A","gb":"gb","Error: Invalid file extension:":"Ralat: Sambungan fail tidak sah:","Select files":"Pilih fail","%s already present in the queue.":"%s telah ada dalam barisan.","Resoultion out of boundaries! <b>%s</b> runtime supports images only up to %wx%hpx.":"","File: %s":"Fail: %s","b":"b","Uploaded %d/%d files":"%d/%d telah dimuat naik","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Element muat naik hanya menerima %d fail(-fail) pada satu masa. Fail tambahan telah digugurkan.","%d files queued":"%d fail dalam barisan","File: %s, size: %d, max file size: %d":"Fail: %s, saiz: %d, saiz maks fail: %d","Thumbnails":"","Drag files here.":"Seret fail ke sini.","Runtime ran out of available memory.":"Ruang ingatan masa larian tidak mencukupi.","File count error.":"Ralat bilangan fail.","File extension error.":"Ralat sambungan fail.","mb":"mb","Add Files":"Tambah Fail"});
admin/js/plupload/i18n/nl.js CHANGED
@@ -1,2 +1,2 @@
1
  // Dutch (nl)
2
- plupload.addI18n({"Stop Upload":"Stop Upload","Upload URL might be wrong or doesn't exist.":"Upload URL might be wrong or doesn't exist.","tb":"","Size":"Grootte","Close":"Close","Init error.":"Initialisatie error.","Add files to the upload queue and click the start button.":"Voeg bestanden toe aan de wachtrij en druk op 'Start'.","Filename":"Bestandsnaam","Image format either wrong or not supported.":"Image format either wrong or not supported.","Status":"Status","HTTP Error.":"HTTP Error.","Start Upload":"Start Upload","mb":"","kb":"","Duplicate file error.":"","File size error.":"Bestandsgrootte Error.","N/A":"Niet beschikbaar","gb":"","Error: Invalid file extension:":"Error: Invalid file extension:","Select files":"Selecteer bestand(en):","%s already present in the queue.":"","File: %s":"File: %s","b":"","Uploaded %d/%d files":"%d/%d bestanden ge-upload","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Upload element accepts only %d file(s) at a time. Extra files were stripped.","%d files queued":"%d files queued","File: %s, size: %d, max file size: %d":"","Drag files here.":"Sleep bestanden hierheen.","Runtime ran out of available memory.":"Runtime ran out of available memory.","File count error.":"File count error.","File extension error.":"Ongeldig bestandstype.","Error: File too large:":"Error: File too large:","Add Files":"Add Files"});
1
  // Dutch (nl)
2
+ plupload.addI18n({"Stop Upload":"Stop Upload","Upload URL might be wrong or doesn't exist.":"Upload URL is verkeerd of bestaat niet.","tb":"tb","Size":"Grootte","Close":"Sluiten","You must specify either browse_button or drop_element.":"","Init error.":"Initialisatie error.","Add files to the upload queue and click the start button.":"Voeg bestanden toe aan de wachtrij en druk op 'Start'.","List":"","Filename":"Bestandsnaam","%s specified, but cannot be found.":"","Image format either wrong or not supported.":"bestandsextensie is verkeerd of niet ondersteund.","Status":"Status","HTTP Error.":"HTTP Error.","Start Upload":"Start Upload","Error: File too large:":"Error: Bestand te groot:","kb":"kb","Duplicate file error.":"Bestand bestaat al.","File size error.":"Bestandsgrootte error.","N/A":"Niet beschikbaar","gb":"gb","Error: Invalid file extension:":"Error: Ongeldige bestandsextensie:","Select files":"Selecteer bestand(en):","%s already present in the queue.":"%s is al aan de wachtrij toegevoegd.","Resoultion out of boundaries! <b>%s</b> runtime supports images only up to %wx%hpx.":"","File: %s":"Bestand: %s","b":"b","Uploaded %d/%d files":"%d/%d bestanden ge-upload","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Upload accepteert alleen %d bestand(en) tegelijk. Extra bestanden zijn verwijderd.","%d files queued":"%d bestand(en) in de wachtrij","File: %s, size: %d, max file size: %d":"Bestand: %s, grootte: %d, maximale bestandsgrootte: %d","Thumbnails":"","Drag files here.":"Sleep bestanden hierheen.","Runtime ran out of available memory.":"Het maximum bruikbare geheugen is overschreden.","File count error.":"Teveel bestand(en) error.","File extension error.":"Ongeldig bestandsextensie.","mb":"mb","Add Files":"Bestand(en) toevoegen"});
admin/js/plupload/i18n/pl.js CHANGED
@@ -1,2 +1,2 @@
1
  // Polish (pl)
2
- plupload.addI18n({"Stop Upload":"Przerwij transfer.","Upload URL might be wrong or doesn't exist.":"Upload URL might be wrong or doesn't exist.","tb":"","Size":"Rozmiar","Close":"Close","Init error.":"Błąd inicjalizacji.","Add files to the upload queue and click the start button.":"Dodaj pliki i kliknij 'Rozpocznij transfer'.","Filename":"Nazwa pliku","Image format either wrong or not supported.":"Image format either wrong or not supported.","Status":"Status","HTTP Error.":"Błąd HTTP.","Start Upload":"Start Upload","mb":"","kb":"","Duplicate file error.":"","File size error.":"Plik jest zbyt duży.","N/A":"Nie dostępne","gb":"","Error: Invalid file extension:":"Error: Invalid file extension:","Select files":"Wybierz pliki:","%s already present in the queue.":"","File: %s":"File: %s","b":"","Uploaded %d/%d files":"Wysłano %d/%d plików","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Upload element accepts only %d file(s) at a time. Extra files were stripped.","%d files queued":"%d plików w kolejce.","File: %s, size: %d, max file size: %d":"","Drag files here.":"Przeciągnij tu pliki","Runtime ran out of available memory.":"Runtime ran out of available memory.","File count error.":"File count error.","File extension error.":"Nieobsługiwany format pliku.","Error: File too large:":"Error: File too large:","Add Files":"Dodaj pliki"});
1
  // Polish (pl)
2
+ plupload.addI18n({"Stop Upload":"Przerwij transfer.","Upload URL might be wrong or doesn't exist.":"Adres URL może być nieprawidłowy lub może nie istnieć","tb":"tb","Size":"Rozmiar","Close":"Zamknij","You must specify either browse_button or drop_element.":"Musisz określić browse_button albo drop_element.","Init error.":"Błąd inicjalizacji.","Add files to the upload queue and click the start button.":"Dodaj pliki i kliknij 'Rozpocznij transfer'.","List":"Lista","Filename":"Nazwa pliku","%s specified, but cannot be found.":"%s określony ale nie można znaleźć.","Image format either wrong or not supported.":"Format zdjęcia jest zły lub nieobsługiwany","Status":"Status","HTTP Error.":"Błąd HTTP.","Start Upload":"Wyślij","Error: File too large:":"Błąd: Plik za duży:","kb":"kb","Duplicate file error.":"Błąd: duplikacja pliku.","File size error.":"Plik jest zbyt duży.","N/A":"Nie dostępne","gb":"gb","Error: Invalid file extension:":"Błąd: Nieprawidłowe rozszerzenie pliku:","Select files":"Wybierz pliki:","%s already present in the queue.":"%s już występuje w kolejce.","Resoultion out of boundaries! <b>%s</b> runtime supports images only up to %wx%hpx.":"Za duża rozdzielczość! <b>%s</b> maksymalna rozdzielczość to: %wx%hpx.","File: %s":"Plik: %s","b":"b","Uploaded %d/%d files":"Wysłano %d/%d plików","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Można jednocześnie dodać %d plików. Dodatkowe pliki zostały usunięte.","%d files queued":"%d plików w kolejce.","File: %s, size: %d, max file size: %d":"Plik: %s, rozmiar: %d, maksymalny rozmiar pliku: %d","Thumbnails":"Miniatury","Drag files here.":"Przeciągnij tu pliki","Runtime ran out of available memory.":"Wyczerpano pamięć RAM.","File count error.":"Błąd liczenia pliku.","File extension error.":"Nie obsługiwany format pliku.","mb":"mb","Add Files":"Dodaj pliki"});
admin/js/plupload/i18n/pt.js ADDED
@@ -0,0 +1,2 @@
 
 
1
+ // Portuguese (pt)
2
+ plupload.addI18n({"Stop Upload":"Parar envio","Upload URL might be wrong or doesn't exist.":"O URL para carregar os ficheiros pode estar errado ou não existir.","tb":"tb","Size":"Tamanho","Close":"Fechar","You must specify either browse_button or drop_element.":"Deve especificar ou o botão de navegação browse_button ou o elemento de recolha drop_element.","Init error.":"Erro ao iniciar.","Add files to the upload queue and click the start button.":"Adicione ficheiros à fila e clique no botão iniciar.","List":"Lista","Filename":"Nome do ficheiro","%s specified, but cannot be found.":"%s definido mas não foi encontrado.","Image format either wrong or not supported.":"Formato da imagem errado ou não é suportado.","Status":"Estado","HTTP Error.":"Erro HTTP.","Start Upload":"Começar envio","Error: File too large:":"Erro: Ficheiro demasiado grande:","kb":"kb","Duplicate file error.":"Erro: ficheiro duplicado.","File size error.":"Tamanho do ficheiro errado.","N/A":"N/D","gb":"gb","Error: Invalid file extension:":"Erro: Extensão de ficheiro inválida:","Select files":"Seleccione ficheiros","%s already present in the queue.":"%s já se encontra em fila.","Resoultion out of boundaries! <b>%s</b> runtime supports images only up to %wx%hpx.":"Resolução excede os limites! <b>%s</b> suporta imagens até %wx%hpx.","File: %s":"Ficheiro: %s","b":"b","Uploaded %d/%d files":"Carregados %d/%d ficheiros","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Só é possível enviar %d ficheiro(s) de cada vez. Os restantes ficheiros foram excluídos.","%d files queued":"%d ficheiros em fila","File: %s, size: %d, max file size: %d":"Ficheiro: %s, tamanho: %d, tamanho máximo do ficheiro: %d","Thumbnails":"Miniaturas","Drag files here.":"Largar ficheiros aqui.","Runtime ran out of available memory.":"A execução esgotou a memória disponível.","File count error.":"Erro: contagem de ficheiros.","File extension error.":"Error de extensão do ficheiro.","mb":"mb","Add Files":"Adicionar ficheiros"});
admin/js/plupload/i18n/pt_BR.js CHANGED
@@ -1,2 +1,2 @@
1
  // Portuguese (Brazil) (pt_BR)
2
- plupload.addI18n({"Stop Upload":"Parar o envio","Upload URL might be wrong or doesn't exist.":"URL de envio está errada ou não existe","tb":"","Size":"Tamanho","Close":"Fechar","Init error.":"Erro inicializando.","Add files to the upload queue and click the start button.":"Adicione os arquivos abaixo e clique no botão \"Iniciar o envio\".","Filename":"Nome do arquivo","Image format either wrong or not supported.":"Image format either wrong or not supported.","Status":"Status","HTTP Error.":"Erro HTTP.","Start Upload":"Iniciar o envio","mb":"","kb":"","Duplicate file error.":"","File size error.":"Tamanho de arquivo não permitido.","N/A":"N/D","gb":"","Error: Invalid file extension:":"Error: Invalid file extension:","Select files":"Escolha os arquivos","%s already present in the queue.":"","File: %s":"Arquivo: %s","b":"","Uploaded %d/%d files":"Enviado(s) %d/%d arquivo(s)","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Só são aceitos %d arquivos por vez. O que passou disso foi descartado.","%d files queued":"%d arquivo(s)","File: %s, size: %d, max file size: %d":"","Drag files here.":"Arraste os arquivos pra cá","Runtime ran out of available memory.":"Runtime ran out of available memory.","File count error.":"Erro na contagem dos arquivos","File extension error.":"Tipo de arquivo não permitido.","Error: File too large:":"Error: File too large:","Add Files":"Adicionar arquivo(s)"});
1
  // Portuguese (Brazil) (pt_BR)
2
+ plupload.addI18n({"Stop Upload":"Parar o envio","Upload URL might be wrong or doesn't exist.":"URL de envio incorreta ou inexistente","tb":"TB","Size":"Tamanho","Close":"Fechar","You must specify either browse_button or drop_element.":"Você deve especificar o botão para escolher(browse_button) os arquivos ou o elemento para arrastar(drop_element).","Init error.":"Erro ao iniciar.","Add files to the upload queue and click the start button.":"Adicione os arquivos à fila e clique no botão \"Iniciar o envio\".","List":"Listagem","Filename":"Nome do arquivo","%s specified, but cannot be found.":"Método de envio <b>%s</b> especificado, mas não pôde ser encontrado.","Image format either wrong or not supported.":"Imagem em formato desconhecido ou não permitido.","Status":"Status","HTTP Error.":"Erro HTTP.","Start Upload":"Iniciar o envio","Error: File too large:":"Erro: Arquivo muito grande:","kb":"KB","Duplicate file error.":"Erro: Arquivo duplicado.","File size error.":"Tamanho de arquivo não permitido.","N/A":"N/D","gb":"GB","Error: Invalid file extension:":"Erro: Extensão de arquivo inválida:","Select files":"Selecione os arquivos","%s already present in the queue.":"%s já presentes na fila.","Resoultion out of boundaries! <b>%s</b> runtime supports images only up to %wx%hpx.":"Resolução fora de tamanho. O método de envio <b>%s</b> suporta imagens com no máximo %wx%hpx.","File: %s":"Arquivo: %s","b":"Bytes","Uploaded %d/%d files":"%d\\/%d arquivo(s) enviados(s)","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Só são aceitos %d arquivos por vez. O que passou disso foi descartado.","%d files queued":"%d arquivo(s)","File: %s, size: %d, max file size: %d":"Arquivo: %s, Tamanho: %d , Tamanho Máximo do Arquivo: %d","Thumbnails":"Miniaturas","Drag files here.":"Arraste os arquivos pra cá","Runtime ran out of available memory.":"Método de envio ficou sem mem\\u00f3ria.","File count error.":"Erro na contagem dos arquivos","File extension error.":"Tipo de arquivo não permitido.","mb":"MB","Add Files":"Adicionar arquivo(s)"});
admin/js/plupload/i18n/ro.js CHANGED
@@ -1,2 +1,2 @@
1
  // Romanian (ro)
2
- plupload.addI18n({"Stop Upload":"Oprește încărcarea","Upload URL might be wrong or doesn't exist.":"Upload URL might be wrong or doesn't exist.","tb":"tb","Size":"Mărime","Close":"Închide","Init error.":"Eroare inițializare.","Add files to the upload queue and click the start button.":"Adaugă fișiere în lista apoi apasă butonul \"Începe încărcarea\".","Filename":"Nume fișier","Image format either wrong or not supported.":"Formatul de imagine ori este greșit ori nu este suportat.","Status":"Stare","HTTP Error.":"Eroare HTTP","Start Upload":"Începe încărcarea","mb":"mb","kb":"kb","Duplicate file error.":"Eroare duplicat fișier.","File size error.":"Eroare dimensiune fișier.","N/A":"N/A","gb":"gb","Error: Invalid file extension:":"Eroare: Extensia fișierului este invalidă:","Select files":"Selectează fișierele","%s already present in the queue.":"%s există deja în lista de așteptare.","File: %s":"Fișier: %s","b":"b","Uploaded %d/%d files":"Fișiere încărcate %d/%d","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Upload element accepts only %d file(s) at a time. Extra files were stripped.","%d files queued":"%d fișiere listate","File: %s, size: %d, max file size: %d":"Fișier: %s, mărime: %d, mărime maximă: %d","Drag files here.":"Trage aici fișierele.","Runtime ran out of available memory.":"Runtime ran out of available memory.","File count error.":"Eroare numărare fișiere.","File extension error.":"Eroare extensie fișier.","Error: File too large:":"Eroare: Fișierul este prea mare:","Add Files":"Adaugă fișiere"});
1
  // Romanian (ro)
2
+ plupload.addI18n({"Stop Upload":"Oprește încărcarea","Upload URL might be wrong or doesn't exist.":"Upload URL might be wrong or doesn't exist.","tb":"tb","Size":"Mărime","Close":"Închide","You must specify either browse_button or drop_element.":"","Init error.":"Eroare inițializare.","Add files to the upload queue and click the start button.":"Adaugă fișiere în lista apoi apasă butonul \"Începe încărcarea\".","List":"","Filename":"Nume fișier","%s specified, but cannot be found.":"","Image format either wrong or not supported.":"Formatul de imagine ori este greșit ori nu este suportat.","Status":"Stare","HTTP Error.":"Eroare HTTP","Start Upload":"Începe încărcarea","Error: File too large:":"Eroare: Fișierul este prea mare:","kb":"kb","Duplicate file error.":"Eroare duplicat fișier.","File size error.":"Eroare dimensiune fișier.","N/A":"N/A","gb":"gb","Error: Invalid file extension:":"Eroare: Extensia fișierului este invalidă:","Select files":"Selectează fișierele","%s already present in the queue.":"%s există deja în lista de așteptare.","Resoultion out of boundaries! <b>%s</b> runtime supports images only up to %wx%hpx.":"","File: %s":"Fișier: %s","b":"b","Uploaded %d/%d files":"Fișiere încărcate %d/%d","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Upload element accepts only %d file(s) at a time. Extra files were stripped.","%d files queued":"%d fișiere listate","File: %s, size: %d, max file size: %d":"Fișier: %s, mărime: %d, mărime maximă: %d","Thumbnails":"","Drag files here.":"Trage aici fișierele.","Runtime ran out of available memory.":"Runtime ran out of available memory.","File count error.":"Eroare numărare fișiere.","File extension error.":"Eroare extensie fișier.","mb":"mb","Add Files":"Adaugă fișiere"});
admin/js/plupload/i18n/ru.js CHANGED
@@ -1,2 +1,2 @@
1
  // Russian (ru)
2
- plupload.addI18n({"Stop Upload":"Остановить Загрузку","Upload URL might be wrong or doesn't exist.":"Адрес заргузки неправильный или он не существует.","tb":"тб","Size":"Размер","Close":"Закрыть","Init error.":"Ошибка инициализации.","Add files to the upload queue and click the start button.":"Добавьте файлы в очередь и нажмите кнопку \"Загрузить файлы\".","Filename":"Имя файла","Image format either wrong or not supported.":"Формат картинки неправильный или он не поддерживается.","Status":"Статус","HTTP Error.":"Ошибка HTTP.","Start Upload":"Начать загрузку","mb":"мб","kb":"кб","Duplicate file error.":"Такой файл уже присутствует в очереди.","File size error.":"Неправильный размер файла.","N/A":"N/A","gb":"гб","Error: Invalid file extension:":"Ошибка: У файла неправильное расширение:","Select files":"Выберите файлы","%s already present in the queue.":"%s уже присутствует в очереди.","File: %s":"Файл: %s","b":"б","Uploaded %d/%d files":"Загружено %d/%d файлов","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Загрузочный элемент за раз принимает только %d файл(ов). Лишние файлы были отброшены.","%d files queued":"В очереди %d файл(ов)","File: %s, size: %d, max file size: %d":"Файл: %s, размер: %d, макс. размер файла: %d","Drag files here.":"Перетащите файлы сюда.","Runtime ran out of available memory.":"Рабочая среда превысила лимит достуной памяти.","File count error.":"Слишком много файлов.","File extension error.":"Неправильное расширение файла.","Error: File too large:":"Ошибка: Файл слишком большой:","Add Files":"Добавьте файлы"});
1
  // Russian (ru)
2
+ plupload.addI18n({"Stop Upload":"Остановить Загрузку","Upload URL might be wrong or doesn't exist.":"Адрес заргузки неправильный или он не существует.","tb":"тб","Size":"Размер","Close":"Закрыть","You must specify either browse_button or drop_element.":"Вы должны указать browse_button или drop_element.","Init error.":"Ошибка инициализации.","Add files to the upload queue and click the start button.":"Добавьте файлы в очередь и нажмите кнопку \"Загрузить файлы\".","List":"Список","Filename":"Имя файла","%s specified, but cannot be found.":"%s существует, но не может быть найден.","Image format either wrong or not supported.":"Формат картинки неправильный или он не поддерживается.","Status":"Статус","HTTP Error.":"Ошибка HTTP.","Start Upload":"Начать загрузку","Error: File too large:":"Ошибка: Файл слишком большой:","kb":"кб","Duplicate file error.":"Такой файл уже присутствует в очереди.","File size error.":"Неправильный размер файла.","N/A":"N/A","gb":"гб","Error: Invalid file extension:":"Ошибка: У файла неправильное расширение:","Select files":"Выберите файлы","%s already present in the queue.":"%s уже присутствует в очереди.","Resoultion out of boundaries! <b>%s</b> runtime supports images only up to %wx%hpx.":"Слишком большое разрешение! <b>%s</b> поддерживаются изображения с размером не более %wx%hpx","File: %s":"Файл: %s","b":"б","Uploaded %d/%d files":"Загружено %d/%d файлов","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Загрузочный элемент за раз принимает только %d файл(ов). Лишние файлы были отброшены.","%d files queued":"В очереди %d файл(ов)","File: %s, size: %d, max file size: %d":"Файл: %s, размер: %d, макс. размер файла: %d","Thumbnails":"Миниатюра","Drag files here.":"Перетащите файлы сюда.","Runtime ran out of available memory.":"Рабочая среда превысила лимит достуной памяти.","File count error.":"Слишком много файлов.","File extension error.":"Неправильное расширение файла.","mb":"мб","Add Files":"Добавьте файлы"});
admin/js/plupload/i18n/sk.js CHANGED
@@ -1,2 +1,2 @@
1
  // Slovak (sk)
2
- plupload.addI18n({"Stop Upload":"Zastaviť nahrávanie","Upload URL might be wrong or doesn't exist.":"Upload URL might be wrong or doesn't exist.","tb":"","Size":"Veľkosť","Close":"Close","Init error.":"Chyba inicializácie.","Add files to the upload queue and click the start button.":"Pridajte súbory do zoznamu a potom spustite nahrávanie.","Filename":"Názov súboru","Image format either wrong or not supported.":"Image format either wrong or not supported.","Status":"Stav","HTTP Error.":"HTTP Chyba.","Start Upload":"Start Upload","mb":"","kb":"","Duplicate file error.":"","File size error.":"Súbor je príliš veľký.","N/A":"N/A","gb":"","Error: Invalid file extension:":"Error: Invalid file extension:","Select files":"Vyberte súbory","%s already present in the queue.":"","File: %s":"File: %s","b":"","Uploaded %d/%d files":"Nahraných %d/%d súborov","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Upload element accepts only %d file(s) at a time. Extra files were stripped.","%d files queued":"%d súborov pridaných do zoznamu","File: %s, size: %d, max file size: %d":"","Drag files here.":"Sem pretiahnite súbory.","Runtime ran out of available memory.":"Runtime ran out of available memory.","File count error.":"File count error.","File extension error.":"Chybný typ súboru.","Error: File too large:":"Error: File too large:","Add Files":"Add Files"});
1
  // Slovak (sk)
2
+ plupload.addI18n({"Stop Upload":"Zastaviť nahrávanie","Upload URL might be wrong or doesn't exist.":"URL pre nahratie nie je správna alebo neexistuje.","tb":"tb","Size":"Veľkosť","Close":"Zatvoriť","You must specify either browse_button or drop_element.":"","Init error.":"Chyba inicializácie.","Add files to the upload queue and click the start button.":"Pridajte súbory do zoznamu a potom spustite nahrávanie.","List":"","Filename":"Názov súboru","%s specified, but cannot be found.":"","Image format either wrong or not supported.":"Formát obrázku je nesprávny alebo nie je podporovaný.","Status":"Stav","HTTP Error.":"HTTP Chyba.","Start Upload":"Spustiť nahrávanie","Error: File too large:":"Chyba: Súbor je príliš veľký:","kb":"kb","Duplicate file error.":"Duplicitný súbor.","File size error.":"Súbor je príliš veľký.","N/A":"N/A","gb":"gb","Error: Invalid file extension:":"Error: Nesprávny typ súboru:","Select files":"Vyberte súbory","%s already present in the queue.":"%s sa už nachádza v zozname.","Resoultion out of boundaries! <b>%s</b> runtime supports images only up to %wx%hpx.":"","File: %s":"Súbor: %s","b":"b","Uploaded %d/%d files":"Nahraných %d/%d súborov","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Upload element accepts only %d file(s) at a time. Extra files were stripped.","%d files queued":"%d súborov pridaných do zoznamu","File: %s, size: %d, max file size: %d":"Súbor: %s, veľkosť: %d, max. veľkosť súboru: %d","Thumbnails":"","Drag files here.":"Sem pretiahnite súbory.","Runtime ran out of available memory.":"Runtime ran out of available memory.","File count error.":"Nesprávny počet súborov.","File extension error.":"Chybný typ súboru.","mb":"mb","Add Files":"Pridať súbory"});
admin/js/plupload/i18n/sl.js ADDED
@@ -0,0 +1,2 @@
 
 
1
+ // Slovenian (sl)
2
+ plupload.addI18n({"Stop Upload":"Ustavi prenos","Upload URL might be wrong or doesn't exist.":"URL za nalaganje je napačen ali ne obstaja.","tb":"tb","Size":"Velikost","Close":"Zapri","You must specify either browse_button or drop_element.":"","Init error.":"Napaka pri inicializaciji.","Add files to the upload queue and click the start button.":"Dodaj datoteke na seznam in klikni na gumb začni","List":"Seznam","Filename":"Ime datoteke","%s specified, but cannot be found.":"","Image format either wrong or not supported.":"Format slike je napačen ali ni podrpt.","Status":"Status","HTTP Error.":"Neznana HTTP napaka.","Start Upload":"Začni prenos","Error: File too large:":"Napaka: datoteka je prevelika:","kb":"kb","Duplicate file error.":"Datoteka je že na seznamu.","File size error.":"Datoteka je prevelika.","N/A":"Ni na voljo","gb":"gb","Error: Invalid file extension:":"Napaka: napačen tip datoteke:","Select files":"Izberi datoteke","%s already present in the queue.":"%s je že na seznamu.","Resoultion out of boundaries! <b>%s</b> runtime supports images only up to %wx%hpx.":"","File: %s":"Datoteka: %s","b":"b","Uploaded %d/%d files":"Naloženo %d/%d datotek","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Nalagalnik sprejme samo %d datotek na enkrat. Višek datotek je odstranjen iz seznama.","%d files queued":"%d datotek na seznamu","File: %s, size: %d, max file size: %d":"Datoteka: %s, velikost: %d, največja dovoljena velikost: %d","Thumbnails":"Sličice","Drag files here.":"Potegni datoteke sem.","Runtime ran out of available memory.":"Zmanjkalo je pomnilnika.","File count error.":"Napačno število datotek.","File extension error.":"Napačen tip datoteke.","mb":"mb","Add Files":"Dodaj datoteke"});
admin/js/plupload/i18n/sq.js ADDED
@@ -0,0 +1,2 @@
 
 
1
+ // Albanian (sq)
2
+ plupload.addI18n({"Stop Upload":"Ndalimi i ngarkimit","Upload URL might be wrong or doesn't exist.":"Ngarkimi i URL-s është i gabuar ose nuk ekziston.","tb":"TB","Size":"Madhësia","Close":"Mbyll","You must specify either browse_button or drop_element.":"","Init error.":"Init gabim.","Add files to the upload queue and click the start button.":"Mbas ngarkimit të dosjeve sipas rradhës duhet të klikoni butonin Start.","List":"","Filename":"Emri i dosjes","%s specified, but cannot be found.":"","Image format either wrong or not supported.":"Formati i fotove është i keq ose nuk është i pranueshëm.","Status":"Statusi","HTTP Error.":"HTTP Gabim.","Start Upload":"Nisja e ngarkimit","Error: File too large:":"Gabim: dosja është shumë e madhe:","kb":"KB","Duplicate file error.":"Gabim i dublikimit të dosjes.","File size error.":"Gabim i madhësisë së dosjes.","N/A":"Nuk është në dispozicion","gb":"GB","Error: Invalid file extension:":"Gabim: përhapja e llojit të dosjes është e pavlefshme:","Select files":"Zhgjidhni dosjet","%s already present in the queue.":"%s tashmë ekziston në list.","Resoultion out of boundaries! <b>%s</b> runtime supports images only up to %wx%hpx.":"","File: %s":"Dosje: %s","b":"B","Uploaded %d/%d files":"Dosjet e ngarkuara: %d/%d","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Ngarkimi pranon njëherësh vetëm %d dosje, dosjet e tjera nuk do të jenë të ngarkuara.","%d files queued":"Dosja %d e vendosur në rradhë","File: %s, size: %d, max file size: %d":"Dosje: %s, madhësia: %d, madhësia maximale e dosjes: %d","Thumbnails":"","Drag files here.":"Këtu mund të tërhiqni dosjet","Runtime ran out of available memory.":"Memoria që ishte në dispozicion ka mbaruar.","File count error.":"Gabim në lidhje me numrin e dosjeve.","File extension error.":"Gabim i zgjerimit të dosjes.","mb":"MB","Add Files":"Shtoni dosjet"});
admin/js/plupload/i18n/sr.js CHANGED
@@ -1,2 +1,2 @@
1
  // Serbian (sr)
2
- plupload.addI18n({"Stop Upload":"Stop Upload","Upload URL might be wrong or doesn't exist.":"Upload URL might be wrong or doesn't exist.","tb":"","Size":"Veličina","Close":"Close","Init error.":"Init error.","Add files to the upload queue and click the start button.":"Dodajte fajlove u listu i kliknite na dugme Start.","Filename":"Naziv fajla","Image format either wrong or not supported.":"Image format either wrong or not supported.","Status":"Status","HTTP Error.":"HTTP Error.","Start Upload":"Počni upload","mb":"","kb":"","Duplicate file error.":"","File size error.":"File size error.","N/A":"N/A","gb":"","Error: Invalid file extension:":"Error: Invalid file extension:","Select files":"Izaberite fajlove","%s already present in the queue.":"","File: %s":"File: %s","b":"","Uploaded %d/%d files":"Snimljeno %d/%d fajlova","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Upload element accepts only %d file(s) at a time. Extra files were stripped.","%d files queued":"%d files queued","File: %s, size: %d, max file size: %d":"","Drag files here.":"Prevucite fajlove ovde.","Runtime ran out of available memory.":"Runtime ran out of available memory.","File count error.":"File count error.","File extension error.":"File extension error.","Error: File too large:":"Error: File too large:","Add Files":"Dodaj fajlove"});
1
  // Serbian (sr)
2
+ plupload.addI18n({"Stop Upload":"Stop Upload","Upload URL might be wrong or doesn't exist.":"Upload URL might be wrong or doesn't exist.","tb":"","Size":"Veličina","Close":"Close","You must specify either browse_button or drop_element.":"","Init error.":"Init error.","Add files to the upload queue and click the start button.":"Dodajte fajlove u listu i kliknite na dugme Start.","List":"","Filename":"Naziv fajla","%s specified, but cannot be found.":"","Image format either wrong or not supported.":"Image format either wrong or not supported.","Status":"Status","HTTP Error.":"HTTP Error.","Start Upload":"Počni upload","Error: File too large:":"Error: File too large:","kb":"","Duplicate file error.":"","File size error.":"File size error.","N/A":"N/A","gb":"","Error: Invalid file extension:":"Error: Invalid file extension:","Select files":"Izaberite fajlove","%s already present in the queue.":"","Resoultion out of boundaries! <b>%s</b> runtime supports images only up to %wx%hpx.":"","File: %s":"File: %s","b":"","Uploaded %d/%d files":"Snimljeno %d/%d fajlova","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Upload element accepts only %d file(s) at a time. Extra files were stripped.","%d files queued":"%d files queued","File: %s, size: %d, max file size: %d":"","Thumbnails":"","Drag files here.":"Prevucite fajlove ovde.","Runtime ran out of available memory.":"Runtime ran out of available memory.","File count error.":"File count error.","File extension error.":"File extension error.","mb":"","Add Files":"Dodaj fajlove"});
admin/js/plupload/i18n/sv.js CHANGED
@@ -1,2 +1,2 @@
1
  // Swedish (sv)
2
- plupload.addI18n({"Stop Upload":"Stop Upload","Upload URL might be wrong or doesn't exist.":"Upload URL might be wrong or doesn't exist.","tb":"","Size":"Storlek","Close":"Close","Init error.":"Init error.","Add files to the upload queue and click the start button.":"Lägg till filer till kön och tryck på start.","Filename":"Filnamn","Image format either wrong or not supported.":"Image format either wrong or not supported.","Status":"Status","HTTP Error.":"HTTP Error.","Start Upload":"Start Upload","mb":"","kb":"","Duplicate file error.":"","File size error.":"File size error.","N/A":"N/A","gb":"","Error: Invalid file extension:":"Error: Invalid file extension:","Select files":"Välj filer","%s already present in the queue.":"","File: %s":"File: %s","b":"","Uploaded %d/%d files":"Uploaded %d/%d files","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Upload element accepts only %d file(s) at a time. Extra files were stripped.","%d files queued":"%d files queued","File: %s, size: %d, max file size: %d":"","Drag files here.":"Dra filer hit","Runtime ran out of available memory.":"Runtime ran out of available memory.","File count error.":"File count error.","File extension error.":"File extension error.","Error: File too large:":"Error: File too large:","Add Files":"Add Files"});
1
  // Swedish (sv)
2
+ plupload.addI18n({"Stop Upload":"Avbryt","Upload URL might be wrong or doesn't exist.":"URL:en va fel eller existerar inte.","tb":"tb","Size":"Storlek","Close":"Stäng","You must specify either browse_button or drop_element.":"Du behöver specificera browse_button eller drop_element.","Init error.":"Problem vid initialisering.","Add files to the upload queue and click the start button.":"Lägg till filer till kön och tryck på start.","List":"Lista","Filename":"Filnamn","%s specified, but cannot be found.":"%s specificerad, men hittades inte.","Image format either wrong or not supported.":"Bildformatet är fel eller finns inte stöd för det.","Status":"Status","HTTP Error.":"HTTP problem.","Start Upload":"Starta","Error: File too large:":"Fel: Filen är för stor:","kb":"kb","Duplicate file error.":"Problem med dubbla filer.","File size error.":"Problem med filstorlek.","N/A":"N/A","gb":"gb","Error: Invalid file extension:":"Fel: Ej godkänd filändelse.","Select files":"Välj filer","%s already present in the queue.":"%s är redan tillagd.","Resoultion out of boundaries! <b>%s</b> runtime supports images only up to %wx%hpx.":"Upplösning utanför gränserna! <b>%s</b> bara bilder upp till %wx%hpx stöds.","File: %s":"Fil: %s","b":"b","Uploaded %d/%d files":"Laddade upp %d/%d filer","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Det går bara lägga till %d filer åt gången, allt utöver detta togs bort.","%d files queued":"%d filer i kö","File: %s, size: %d, max file size: %d":"Fil: %s, storlek: %d, max storlek: %d","Thumbnails":"Miniatyrer","Drag files here.":"Dra filer hit","Runtime ran out of available memory.":"Slut minne.","File count error.":"Räknefel.","File extension error.":"Problem med filändelse.","mb":"mb","Add Files":"Lägg till"});
admin/js/plupload/i18n/th_TH.js CHANGED
@@ -1,2 +1,2 @@
1
  // Thai (Thailand) (th_TH)
2
- plupload.addI18n({"Stop Upload":"หยุดอัพโหลด","Upload URL might be wrong or doesn't exist.":"URL ของการอัพโหลดอาจจะผิดหรือไม่มีอยู่","tb":"เทราไบต์","Size":"ขนาด","Close":"ปิด","Init error.":"Init เกิดข้อผิดพลาด","Add files to the upload queue and click the start button.":"เพิ่มไฟล์ไปยังคิวอัพโหลดและคลิกที่ปุ่มเริ่ม","Filename":"ชื่อไฟล์","Image format either wrong or not supported.":"รูปแบบรูปภาพทั้งสองผิดหรือไม่รองรับ","Status":"สถานะ","HTTP Error.":"HTTP เกิดข้อผิดพลาด","Start Upload":"เริ่มอัพโหลด","mb":"เมกะไบต์","kb":"กิโลไบต์","Duplicate file error.":"ไฟล์ที่ซ้ำกันเกิดข้อผิดพลาด","File size error.":"ขนาดไฟล์เกิดข้อผิดพลาด","N/A":"N/A","gb":"กิกะไบต์","Error: Invalid file extension:":"ข้อผิดพลาด: นามสกุลไฟล์ไม่ถูกต้อง:","Select files":"เลือกไฟล์","%s already present in the queue.":"%s อยู่ในคิวแล้ว","File: %s":"ไฟล์: %s","b":"ไบต์","Uploaded %d/%d files":"อัพโหลดแล้ว %d/%d ไฟล์","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"การอัพโหลดจะยอมรับเฉพาะ %d ไฟล์(s) ในช่วงเวลาเดียวกัน เมื่อไฟล์พิเศษถูกปลดออก","%d files queued":"%d ไฟล์ที่อยู่ในคิว","File: %s, size: %d, max file size: %d":"ไฟล์: %s, ขนาด: %d, ขนาดไฟล์สูงสุด: %d","Drag files here.":"ลากไฟล์มาที่นี่","Runtime ran out of available memory.":"รันไทม์วิ่งออกมาจากหน่วยความจำ","File count error.":"การนับไฟล์เกิดข้อผิดพลาด","File extension error.":"นามสกุลไฟล์เกิดข้อผิดพลาด","Error: File too large:":"ข้อผิดพลาด: ไฟล์ใหญ่เกินไป:","Add Files":"เพิ่มไฟล์"});
1
  // Thai (Thailand) (th_TH)
2
+ plupload.addI18n({"Stop Upload":"หยุดอัพโหลด","Upload URL might be wrong or doesn't exist.":"URL ของการอัพโหลดอาจจะผิดหรือไม่มีอยู่","tb":"เทราไบต์","Size":"ขนาด","Close":"ปิด","You must specify either browse_button or drop_element.":"","Init error.":"Init เกิดข้อผิดพลาด","Add files to the upload queue and click the start button.":"เพิ่มไฟล์ไปยังคิวอัพโหลดและคลิกที่ปุ่มเริ่ม","List":"","Filename":"ชื่อไฟล์","%s specified, but cannot be found.":"","Image format either wrong or not supported.":"รูปแบบรูปภาพทั้งสองผิดหรือไม่รองรับ","Status":"สถานะ","HTTP Error.":"HTTP เกิดข้อผิดพลาด","Start Upload":"เริ่มอัพโหลด","Error: File too large:":"ข้อผิดพลาด: ไฟล์ใหญ่เกินไป:","kb":"กิโลไบต์","Duplicate file error.":"ไฟล์ที่ซ้ำกันเกิดข้อผิดพลาด","File size error.":"ขนาดไฟล์เกิดข้อผิดพลาด","N/A":"N/A","gb":"กิกะไบต์","Error: Invalid file extension:":"ข้อผิดพลาด: นามสกุลไฟล์ไม่ถูกต้อง:","Select files":"เลือกไฟล์","%s already present in the queue.":"%s อยู่ในคิวแล้ว","Resoultion out of boundaries! <b>%s</b> runtime supports images only up to %wx%hpx.":"","File: %s":"ไฟล์: %s","b":"ไบต์","Uploaded %d/%d files":"อัพโหลดแล้ว %d/%d ไฟล์","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"การอัพโหลดจะยอมรับเฉพาะ %d ไฟล์(s) ในช่วงเวลาเดียวกัน เมื่อไฟล์พิเศษถูกปลดออก","%d files queued":"%d ไฟล์ที่อยู่ในคิว","File: %s, size: %d, max file size: %d":"ไฟล์: %s, ขนาด: %d, ขนาดไฟล์สูงสุด: %d","Thumbnails":"","Drag files here.":"ลากไฟล์มาที่นี่","Runtime ran out of available memory.":"รันไทม์วิ่งออกมาจากหน่วยความจำ","File count error.":"การนับไฟล์เกิดข้อผิดพลาด","File extension error.":"นามสกุลไฟล์เกิดข้อผิดพลาด","mb":"เมกะไบต์","Add Files":"เพิ่มไฟล์"});
admin/js/plupload/i18n/tr.js CHANGED
@@ -1,2 +1,2 @@
1
  // Turkish (tr)
2
- plupload.addI18n({"Stop Upload":"Yüklemeyi durdur","Upload URL might be wrong or doesn't exist.":"URL yok ya da hatalı olabilir.","tb":"tb","Size":"Boyut","Close":"Kapat","Init error.":"Başlangıç hatası.","Add files to the upload queue and click the start button.":"Dosyaları kuyruğa ekleyin ve başlatma butonuna tıklayın.","Filename":"Dosya adı","Image format either wrong or not supported.":"Resim formatı yanlış ya da desteklenmiyor.","Status":"Durum","HTTP Error.":"HTTP hatası.","Start Upload":"Yüklemeyi başlat","mb":"mb","kb":"kb","Duplicate file error.":"Yinelenen dosya hatası.","File size error.":"Dosya boyutu hatası.","N/A":"-","gb":"gb","Error: Invalid file extension:":"Hata: Geçersiz dosya uzantısı:","Select files":"Dosyaları seç","%s already present in the queue.":"%s kuyrukta zaten mevcut.","File: %s":"Dosya: %s","b":"bayt","Uploaded %d/%d files":"%d/%d dosya yüklendi","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Yükleme elemanı aynı anda %d dosya kabul eder. Ekstra dosyalar işleme konulmaz.","%d files queued":"Kuyrukta %d dosya var.","File: %s, size: %d, max file size: %d":"Dosya: %s, boyut: %d, maksimum dosya boyutu: %d","Drag files here.":"Dosyaları buraya bırakın.","Runtime ran out of available memory.":"İşlem için yeterli bellek yok.","File count error.":"Dosya sayım hatası.","File extension error.":"Dosya uzantısı hatası.","Error: File too large:":"Hata: Dosya çok büyük:","Add Files":"Dosya ekle"});
1
  // Turkish (tr)
2
+ plupload.addI18n({"Stop Upload":"Yüklemeyi durdur","Upload URL might be wrong or doesn't exist.":"URL yok ya da hatalı olabilir.","tb":"tb","Size":"Boyut","Close":"Kapat","You must specify either browse_button or drop_element.":"browse_button veya drop_element değişkenlerini belirlemelisiniz.","Init error.":"Başlangıç hatası.","Add files to the upload queue and click the start button.":"Dosyaları kuyruğa ekleyin ve başlatma butonuna tıklayın.","List":"Liste","Filename":"Dosya adı","%s specified, but cannot be found.":"%s tanımlandı fakat bulunamadı.","Image format either wrong or not supported.":"Resim formatı yanlış ya da desteklenmiyor.","Status":"Durum","HTTP Error.":"HTTP hatası.","Start Upload":"Yüklemeyi başlat","Error: File too large:":"Hata: Dosya çok büyük:","kb":"kb","Duplicate file error.":"Yinelenen dosya hatası.","File size error.":"Dosya boyutu hatası.","N/A":"-","gb":"gb","Error: Invalid file extension:":"Hata: Geçersiz dosya uzantısı:","Select files":"Dosyaları seç","%s already present in the queue.":"%s kuyrukta zaten mevcut.","Resoultion out of boundaries! <b>%s</b> runtime supports images only up to %wx%hpx.":"Çözünürlük sınırların dışındadır! <b>%s</b> modu en fazla %wx%hpx desteklemektedir.","File: %s":"Dosya: %s","b":"bayt","Uploaded %d/%d files":"%d/%d dosya yüklendi","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Yükleme elemanı aynı anda %d dosya kabul eder. Ekstra dosyalar işleme konulmaz.","%d files queued":"Kuyrukta %d dosya var.","File: %s, size: %d, max file size: %d":"Dosya: %s, boyut: %d, maksimum dosya boyutu: %d","Thumbnails":"Önizlemeler","Drag files here.":"Dosyaları buraya bırakın.","Runtime ran out of available memory.":"İşlem için yeterli bellek yok.","File count error.":"Dosya sayım hatası.","File extension error.":"Dosya uzantısı hatası.","mb":"mb","Add Files":"Dosya ekle"});
admin/js/plupload/i18n/uk_UA.js CHANGED
@@ -1,2 +1,2 @@
1
  // Ukrainian (Ukraine) (uk_UA)
2
- plupload.addI18n({"Stop Upload":"Зупинити завантаження","Upload URL might be wrong or doesn't exist.":"Адреса завантаження неправильна або не існує.","tb":"","Size":"Розмір","Close":"Закрити","Init error.":"Помилка ініціалізації.","Add files to the upload queue and click the start button.":"Додайте файли в чергу та натисніть кнопку \"Завантажити файли\".","Filename":"Назва файлу","Image format either wrong or not supported.":"Формат картинки не правильний або не підтримується.","Status":"Статус","HTTP Error.":"Помилка HTTP.","Start Upload":"Почати завантаження","mb":"","kb":"","Duplicate file error.":"","File size error.":"Неправильний розмір файлу.","N/A":"Н/Д","gb":"","Error: Invalid file extension:":"Помилка: У файлу неправильне розширення:","Select files":"Оберіть файли","%s already present in the queue.":"","File: %s":"Файл: %s","b":"","Uploaded %d/%d files":"Завантажено %d/%d файлів","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"","%d files queued":"В черзі %d файл(ів)","File: %s, size: %d, max file size: %d":"","Drag files here.":"Перетягніть файли сюди.","Runtime ran out of available memory.":"Робоче середовище перевищило ліміт доступної пам'яті.","File count error.":"Занадто багато файлів.","File extension error.":"Неправильне розширення файлу.","Error: File too large:":"Помилка: Файл занадто великий:","Add Files":"Додати файли"});
1
  // Ukrainian (Ukraine) (uk_UA)
2
+ plupload.addI18n({"Stop Upload":"Зупинити завантаження","Upload URL might be wrong or doesn't exist.":"Адреса завантаження неправильна або не існує.","tb":"тб","Size":"Розмір","Close":"Закрити","You must specify either browse_button or drop_element.":"Ви маєте вказати або browse_button, або drop_element.","Init error.":"Помилка ініціалізації.","Add files to the upload queue and click the start button.":"Додайте файли в чергу та натисніть кнопку \"Завантажити файли\".","List":"Список","Filename":"Назва файлу","%s specified, but cannot be found.":"%s вказано, але не може бути знайдено.","Image format either wrong or not supported.":"Формат картинки не правильний або не підтримується.","Status":"Статус","HTTP Error.":"Помилка HTTP.","Start Upload":"Почати завантаження","Error: File too large:":"Помилка: Файл занадто великий:","kb":"кб","Duplicate file error.":"Такий файл вже присутній в черзі.","File size error.":"Неправильний розмір файлу.","N/A":"Н/Д","gb":"гб","Error: Invalid file extension:":"Помилка: У файлу неправильне розширення:","Select files":"Оберіть файли","%s already present in the queue.":"%s вже присутній у черзі.","Resoultion out of boundaries! <b>%s</b> runtime supports images only up to %wx%hpx.":"Роздільна здатність поза межами! Робоче середовище <b>%s</b> підтримує зображення лише до %wx%hpx.","File: %s":"Файл: %s","b":"б","Uploaded %d/%d files":"Завантажено %d/%d файлів","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Завантажувальний елемент приймає лише %d файл(ів) одночасно. Зайві файли було відкинуто.","%d files queued":"В черзі %d файл(ів)","File: %s, size: %d, max file size: %d":"Файл: %s, розмір: %d, макс. розмір файлу: %d","Thumbnails":"Мініатюри","Drag files here.":"Перетягніть файли сюди.","Runtime ran out of available memory.":"Робоче середовище перевищило ліміт доступної пам'яті.","File count error.":"Занадто багато файлів.","File extension error.":"Неправильне розширення файлу.","mb":"мб","Add Files":"Додати файли"});
admin/js/plupload/i18n/vi.js ADDED
@@ -0,0 +1,2 @@
 
 
1
+ // Vietnamese (vi)
2
+ plupload.addI18n({"Stop Upload":"Dừng","Upload URL might be wrong or doesn't exist.":"Đường dẫn URL tải lên không đúng hoặc không tồn tại.","tb":"TB","Size":"Dung lượng","Close":"Đóng","You must specify either browse_button or drop_element.":"","Init error.":"Lỗi khởi tạo","Add files to the upload queue and click the start button.":"Thêm tập tin để tải lên và bấm vào nút bắt đầu","List":"Danh sách","Filename":"Tên tập tin","%s specified, but cannot be found.":"%s đã chỉ định nhưng không thể tìm thấy.","Image format either wrong or not supported.":"Định dạng hình ảnh không đúng hoặc không được hỗ trợ.","Status":"Trạng thái","HTTP Error.":"Lỗi HTTP","Start Upload":"Bắt đầu","Error: File too large:":"Lỗi: Dung lượng tập tin quá lớn:","kb":"KB","Duplicate file error.":"Tập tin đã tồn tại","File size error.":"Lỗi dung lượng tập tin","N/A":"Chưa có thông tin","gb":"GB","Error: Invalid file extension:":"Lỗi: Định dạng tập tin không xác định:","Select files":"Chọn tập tin","%s already present in the queue.":"%s đã có trong danh sách chờ tải lên","Resoultion out of boundaries! <b>%s</b> runtime supports images only up to %wx%hpx.":"Độ phân giải quá lớn! <b>%s</b> chỉ hỗ trợ kích thước tối đa %wx%hpx.","File: %s":"Tập tin: %s","b":"B","Uploaded %d/%d files":"Đã tải lên %d/%d tập tin","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"Chỉ có thể tải lên (%d) tập tin cùng một lúc. Những tập tin còn lại đã bị huỷ bỏ.","%d files queued":"%d tập tin trong danh sách chờ","File: %s, size: %d, max file size: %d":"Tập tin: %s, dung lượng %d, dung lượng tối đa: %d","Thumbnails":"Ảnh thu nhỏ","Drag files here.":"Thả tập tin vào đây","Runtime ran out of available memory.":"Thời gian chạy vượt quá giới hạn bộ nhớ cho phép.","File count error.":"Lỗi đếm tập tin","File extension error.":"Lỗi định dạng tập tin","mb":"MB","Add Files":"Thêm tập tin"});
admin/js/plupload/i18n/zh_CN.js CHANGED
@@ -1,2 +1,2 @@
1
  // Chinese (China) (zh_CN)
2
- plupload.addI18n({"Stop Upload":"停止上传","Upload URL might be wrong or doesn't exist.":"上传的URL可能是错误的或不存在。","tb":"tb","Size":"大小","Close":"关闭","Init error.":"初始化错误。","Add files to the upload queue and click the start button.":"将文件添加到上传队列,然后点击”开始上传“按钮。","Filename":"文件名","Image format either wrong or not supported.":"图片格式错误或者不支持。","Status":"状态","HTTP Error.":"HTTP 错误。","Start Upload":"开始上传","mb":"mb","kb":"kb","Duplicate file error.":"重复文件错误。","File size error.":"文件大小错误。","N/A":"N/A","gb":"gb","Error: Invalid file extension:":"错误:无效的文件扩展名:","Select files":"选择文件","%s already present in the queue.":"%s 已经在当前队列里。","File: %s":"文件: %s","b":"b","Uploaded %d/%d files":"已上传 %d/%d 个文件","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"每次只接受同时上传 %d 个文件,多余的文件将会被删除。","%d files queued":"%d 个文件加入到队列","File: %s, size: %d, max file size: %d":"文件: %s, 大小: %d, 最大文件大小: %d","Drag files here.":"把文件拖到这里。","Runtime ran out of available memory.":"运行时已消耗所有可用内存。","File count error.":"文件数量错误。","File extension error.":"文件扩展名错误。","Error: File too large:":"错误: 文件太大:","Add Files":"增加文件"});
1
  // Chinese (China) (zh_CN)
2
+ plupload.addI18n({"Stop Upload":"停止上传","Upload URL might be wrong or doesn't exist.":"上传的URL可能是错误的或不存在。","tb":"tb","Size":"大小","Close":"关闭","You must specify either browse_button or drop_element.":"您必须指定 browse_button 或者 drop_element。","Init error.":"初始化错误。","Add files to the upload queue and click the start button.":"将文件添加到上传队列,然后点击”开始上传“按钮。","List":"列表","Filename":"文件名","%s specified, but cannot be found.":"%s 已指定,但是没有找到。","Image format either wrong or not supported.":"图片格式错误或者不支持。","Status":"状态","HTTP Error.":"HTTP 错误。","Start Upload":"开始上传","Error: File too large:":"错误: 文件太大:","kb":"kb","Duplicate file error.":"重复文件错误。","File size error.":"文件大小错误。","N/A":"N/A","gb":"gb","Error: Invalid file extension:":"错误:无效的文件扩展名:","Select files":"选择文件","%s already present in the queue.":"%s 已经在当前队列里。","Resoultion out of boundaries! <b>%s</b> runtime supports images only up to %wx%hpx.":"超限。<b>%s</b> 支持最大 %wx%hpx 的图片。","File: %s":"文件: %s","b":"b","Uploaded %d/%d files":"已上传 %d/%d 个文件","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"每次只接受同时上传 %d 个文件,多余的文件将会被删除。","%d files queued":"%d 个文件加入到队列","File: %s, size: %d, max file size: %d":"文件: %s, 大小: %d, 最大文件大小: %d","Thumbnails":"缩略图","Drag files here.":"把文件拖到这里。","Runtime ran out of available memory.":"运行时已消耗所有可用内存。","File count error.":"文件数量错误。","File extension error.":"文件扩展名错误。","mb":"mb","Add Files":"增加文件"});
admin/js/plupload/i18n/zh_TW.js CHANGED
@@ -1,2 +1,2 @@
1
  // Chinese (Taiwan) (zh_TW)
2
- plupload.addI18n({"Stop Upload":"停止上傳","Upload URL might be wrong or doesn't exist.":"檔案URL可能有誤或者不存在。","tb":"tb","Size":"大小","Close":"關閉","Init error.":"初始化錯誤。","Add files to the upload queue and click the start button.":"將檔案加入上傳序列,然後點選”開始上傳“按鈕。","Filename":"檔案名稱","Image format either wrong or not supported.":"圖片格式錯誤或者不支援。","Status":"狀態","HTTP Error.":"HTTP 錯誤。","Start Upload":"開始上傳","mb":"mb","kb":"kb","Duplicate file error.":"錯誤:檔案重複。","File size error.":"錯誤:檔案大小超過限制。","N/A":"N/A","gb":"gb","Error: Invalid file extension:":"錯誤:不接受的檔案格式:","Select files":"選擇檔案","%s already present in the queue.":"%s 已經存在目前的檔案序列。","File: %s":"檔案: %s","b":"b","Uploaded %d/%d files":"已上傳 %d/%d 個文件","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"每次只能上傳 %d 個檔案,超過限制數量的檔案將被忽略。","%d files queued":"%d 個檔案加入到序列","File: %s, size: %d, max file size: %d":"檔案: %s, 大小: %d, 最大檔案大小: %d","Drag files here.":"把檔案拖曳到這裡。","Runtime ran out of available memory.":"執行時耗盡了所有可用的記憶體。","File count error.":"檔案數量錯誤。","File extension error.":"檔案副檔名錯誤。","Error: File too large:":"錯誤: 檔案大小太大:","Add Files":"增加檔案"});
1
  // Chinese (Taiwan) (zh_TW)
2
+ plupload.addI18n({"Stop Upload":"停止上傳","Upload URL might be wrong or doesn't exist.":"檔案URL可能有誤或者不存在。","tb":"tb","Size":"大小","Close":"關閉","You must specify either browse_button or drop_element.":"您必須指定 browse_button 或 drop_element。","Init error.":"初始化錯誤。","Add files to the upload queue and click the start button.":"將檔案加入上傳序列,然後點選”開始上傳“按鈕。","List":"清單","Filename":"檔案名稱","%s specified, but cannot be found.":"找不到已選擇的 %s。","Image format either wrong or not supported.":"圖片格式錯誤或者不支援。","Status":"狀態","HTTP Error.":"HTTP 錯誤。","Start Upload":"開始上傳","Error: File too large:":"錯誤: 檔案大小太大:","kb":"kb","Duplicate file error.":"錯誤:檔案重複。","File size error.":"錯誤:檔案大小超過限制。","N/A":"N/A","gb":"gb","Error: Invalid file extension:":"錯誤:不接受的檔案格式:","Select files":"選擇檔案","%s already present in the queue.":"%s 已經存在目前的檔案序列。","Resoultion out of boundaries! <b>%s</b> runtime supports images only up to %wx%hpx.":"圖片解析度超出範圍! <b>%s</b> 最高只支援到 %wx%hpx。","File: %s":"檔案: %s","b":"b","Uploaded %d/%d files":"已上傳 %d/%d 個文件","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"每次只能上傳 %d 個檔案,超過限制數量的檔案將被忽略。","%d files queued":"%d 個檔案加入到序列","File: %s, size: %d, max file size: %d":"檔案: %s, 大小: %d, 檔案大小上限: %d","Thumbnails":"縮圖","Drag files here.":"把檔案拖曳到這裡。","Runtime ran out of available memory.":"執行時耗盡了所有可用的記憶體。","File count error.":"檔案數量錯誤。","File extension error.":"檔案副檔名錯誤。","mb":"mb","Add Files":"增加檔案"});
admin/js/plupload/jquery.plupload.queue/css/jquery.plupload.queue.css ADDED
@@ -0,0 +1,185 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ Plupload
3
+ ------------------------------------------------------------------- */
4
+
5
+ .plupload_wrapper * {
6
+ box-sizing: content-box;
7
+ }
8
+
9
+ .plupload_button {
10
+ display: -moz-inline-box; /* FF < 3*/
11
+ display: inline-block;
12
+ font: normal 12px sans-serif;
13
+ text-decoration: none;
14
+ color: #42454a;
15
+ border: 1px solid #bababa;
16
+ padding: 2px 8px 3px 20px;
17
+ margin-right: 4px;
18
+ background: #f3f3f3 url('../img/buttons.png') no-repeat 0 center;
19
+ outline: 0;
20
+
21
+ /* Optional rounded corners for browsers that support it */
22
+ -moz-border-radius: 3px;
23
+ -khtml-border-radius: 3px;
24
+ -webkit-border-radius: 3px;
25
+ border-radius: 3px;
26
+ }
27
+
28
+ .plupload_button:hover {
29
+ color: #000;
30
+ text-decoration: none;
31
+ }
32
+
33
+ .plupload_disabled, a.plupload_disabled:hover {
34
+ color: #737373;
35
+ border-color: #c5c5c5;
36
+ background: #ededed url('../img/buttons-disabled.png') no-repeat 0 center;
37
+ cursor: default;
38
+ }
39
+
40
+ .plupload_add {
41
+ background-position: -181px center;
42
+ }
43
+
44
+ .plupload_wrapper {
45
+ font: normal 11px Verdana,sans-serif;
46
+ width: 100%;
47
+ }
48
+
49
+ .plupload_container {
50
+ padding: 8px;
51
+ background: url('../img/transp50.png');
52
+ /*-moz-border-radius: 5px;*/
53
+ }
54
+
55
+ .plupload_container input {
56
+ border: 1px solid #DDD;
57
+ font: normal 11px Verdana,sans-serif;
58
+ width: 98%;
59
+ }
60
+
61
+ .plupload_header {background: #2A2C2E url('../img/backgrounds.gif') repeat-x;}
62
+ .plupload_header_content {
63
+ background: url('../img/backgrounds.gif') no-repeat 0 -317px;
64
+ min-height: 56px;
65
+ padding-left: 60px;
66
+ color: #FFF;
67
+ }
68
+ .plupload_header_title {
69
+ font: normal 18px sans-serif;
70
+ padding: 6px 0 3px;
71
+ }
72
+ .plupload_header_text {
73
+ font: normal 12px sans-serif;
74
+ }
75
+
76
+ .plupload_filelist {
77
+ margin: 0;
78
+ padding: 0;
79
+ list-style: none;
80
+ }
81
+
82
+ .plupload_scroll .plupload_filelist {
83
+ height: 185px;
84
+ background: #F5F5F5;
85
+ overflow-y: scroll;
86
+ }
87
+
88
+ .plupload_filelist li {
89
+ padding: 10px 8px;
90
+ background: #F5F5F5 url('../img/backgrounds.gif') repeat-x 0 -156px;
91
+ border-bottom: 1px solid #DDD;
92
+ }
93
+
94
+ .plupload_filelist_header, .plupload_filelist_footer {
95
+ background: #DFDFDF;
96
+ padding: 8px 8px;
97
+ color: #42454A;
98
+ }
99
+ .plupload_filelist_header {
100
+ border-top: 1px solid #EEE;
101
+ border-bottom: 1px solid #CDCDCD;
102
+ }
103
+
104
+ .plupload_filelist_footer {border-top: 1px solid #FFF; height: 22px; line-height: 20px; vertical-align: middle;}
105
+ .plupload_file_name {float: left; overflow: hidden}
106
+ .plupload_file_status {color: #777;}
107
+ .plupload_file_status span {color: #42454A;}
108
+ .plupload_file_size, .plupload_file_status, .plupload_progress {
109
+ float: right;
110
+ width: 80px;
111
+ }
112
+ .plupload_file_size, .plupload_file_status, .plupload_file_action {text-align: right;}
113
+
114
+ .plupload_filelist .plupload_file_name {
115
+ width: 205px;
116
+ white-space: nowrap;
117
+ text-overflow: ellipsis;
118
+ }
119
+
120
+ .plupload_file_action {
121
+ float: right;
122
+ width: 16px;
123
+ height: 16px;
124
+ margin-left: 15px;
125
+ }
126
+
127
+ .plupload_file_action * {
128
+ display: none;
129
+ width: 16px;
130
+ height: 16px;
131
+ }
132
+
133
+ li.plupload_uploading {background: #ECF3DC url('../img/backgrounds.gif') repeat-x 0 -238px;}
134
+ li.plupload_done {color:#AAA}
135
+
136
+ li.plupload_delete a {
137
+ background: url('../img/delete.gif');
138
+ }
139
+
140
+ li.plupload_failed a {
141
+ background: url('../img/error.gif');
142
+ cursor: default;
143
+ }
144
+
145
+ li.plupload_done a {
146
+ background: url('../img/done.gif');
147
+ cursor: default;
148
+ }
149
+
150
+ .plupload_progress, .plupload_upload_status {
151
+ display: none;
152
+ }
153
+
154
+ .plupload_progress_container {
155
+ margin-top: 3px;
156
+ border: 1px solid #CCC;
157
+ background: #FFF;
158
+ padding: 1px;
159
+ }
160
+ .plupload_progress_bar {
161
+ width: 0px;
162
+ height: 7px;
163
+ background: #CDEB8B;
164
+ }
165
+
166
+ .plupload_scroll .plupload_filelist_header .plupload_file_action, .plupload_scroll .plupload_filelist_footer .plupload_file_action {
167
+ margin-right: 17px;
168
+ }
169
+
170
+ /* Floats */
171
+
172
+ .plupload_clear,.plupload_clearer {clear: both;}
173
+ .plupload_clearer, .plupload_progress_bar {
174
+ display: block;
175
+ font-size: 0;
176
+ line-height: 0;
177
+ }
178
+
179
+ li.plupload_droptext {
180
+ background: transparent;
181
+ text-align: center;
182
+ vertical-align: middle;
183
+ border: 0;
184
+ line-height: 165px;
185
+ }
admin/js/plupload/jquery.plupload.queue/img/backgrounds.gif ADDED
Binary file
admin/js/plupload/jquery.plupload.queue/img/buttons-disabled.png ADDED
Binary file
admin/js/plupload/jquery.plupload.queue/img/buttons.png ADDED
Binary file
admin/js/plupload/jquery.plupload.queue/img/delete.gif ADDED
Binary file
admin/js/plupload/jquery.plupload.queue/img/done.gif ADDED
Binary file
admin/js/plupload/jquery.plupload.queue/img/error.gif ADDED
Binary file
admin/js/plupload/jquery.plupload.queue/img/throbber.gif ADDED
Binary file
admin/js/plupload/jquery.plupload.queue/img/transp50.png ADDED
Binary file
admin/js/plupload/jquery.plupload.queue/jquery.plupload.queue.js ADDED
@@ -0,0 +1,433 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * jquery.plupload.queue.js
3
+ *
4
+ * Copyright 2009, Moxiecode Systems AB
5
+ * Released under GPL License.
6
+ *
7
+ * License: http://www.plupload.com/license
8
+ * Contributing: http://www.plupload.com/contributing
9
+ */
10
+
11
+ /* global jQuery:true, alert:true */
12
+
13
+ /**
14
+ jQuery based implementation of the Plupload API - multi-runtime file uploading API.
15
+
16
+ To use the widget you must include _jQuery_. It is not meant to be extended in any way and is provided to be
17
+ used as it is.
18
+
19
+ @example
20
+ <!-- Instantiating: -->
21
+ <div id="uploader">
22
+ <p>Your browser doesn't have Flash, Silverlight or HTML5 support.</p>
23
+ </div>
24
+
25
+ <script>
26
+ $('#uploader').pluploadQueue({
27
+ url : '../upload.php',
28
+ filters : [
29
+ {title : "Image files", extensions : "jpg,gif,png"}
30
+ ],
31
+ rename: true,
32
+ flash_swf_url : '../../js/Moxie.swf',
33
+ silverlight_xap_url : '../../js/Moxie.xap',
34
+ });
35
+ </script>
36
+
37
+ @example
38
+ // Retrieving a reference to plupload.Uploader object
39
+ var uploader = $('#uploader').pluploadQueue();
40
+
41
+ uploader.bind('FilesAdded', function() {
42
+
43
+ // Autostart
44
+ setTimeout(uploader.start, 1); // "detach" from the main thread
45
+ });
46
+
47
+ @class pluploadQueue
48
+ @constructor
49
+ @param {Object} settings For detailed information about each option check documentation.
50
+ @param {String} settings.url URL of the server-side upload handler.
51
+ @param {Number|String} [settings.chunk_size=0] Chunk size in bytes to slice the file into. Shorcuts with b, kb, mb, gb, tb suffixes also supported. `e.g. 204800 or "204800b" or "200kb"`. By default - disabled.
52
+ @param {String} [settings.file_data_name="file"] Name for the file field in Multipart formated message.
53
+ @param {Array} [settings.filters=[]] Set of file type filters, each one defined by hash of title and extensions. `e.g. {title : "Image files", extensions : "jpg,jpeg,gif,png"}`. Dispatches `plupload.FILE_EXTENSION_ERROR`
54
+ @param {String} [settings.flash_swf_url] URL of the Flash swf.
55
+ @param {Object} [settings.headers] Custom headers to send with the upload. Hash of name/value pairs.
56
+ @param {Number|String} [settings.max_file_size] Maximum file size that the user can pick, in bytes. Optionally supports b, kb, mb, gb, tb suffixes. `e.g. "10mb" or "1gb"`. By default - not set. Dispatches `plupload.FILE_SIZE_ERROR`.
57
+ @param {Number} [settings.max_retries=0] How many times to retry the chunk or file, before triggering Error event.
58
+ @param {Boolean} [settings.multipart=true] Whether to send file and additional parameters as Multipart formated message.
59
+ @param {Object} [settings.multipart_params] Hash of key/value pairs to send with every file upload.
60
+ @param {Boolean} [settings.multi_selection=true] Enable ability to select multiple files at once in file dialog.
61
+ @param {Boolean} [settings.prevent_duplicates=false] Do not let duplicates into the queue. Dispatches `plupload.FILE_DUPLICATE_ERROR`.
62
+ @param {String|Object} [settings.required_features] Either comma-separated list or hash of required features that chosen runtime should absolutely possess.
63
+ @param {Object} [settings.resize] Enable resizng of images on client-side. Applies to `image/jpeg` and `image/png` only. `e.g. {width : 200, height : 200, quality : 90, crop: true}`
64
+ @param {Number} [settings.resize.width] If image is bigger, it will be resized.
65
+ @param {Number} [settings.resize.height] If image is bigger, it will be resized.
66
+ @param {Number} [settings.resize.quality=90] Compression quality for jpegs (1-100).
67
+ @param {Boolean} [settings.resize.crop=false] Whether to crop images to exact dimensions. By default they will be resized proportionally.
68
+ @param {String} [settings.runtimes="html5,flash,silverlight,html4"] Comma separated list of runtimes, that Plupload will try in turn, moving to the next if previous fails.
69
+ @param {String} [settings.silverlight_xap_url] URL of the Silverlight xap.
70
+ @param {Boolean} [settings.unique_names=false] If true will generate unique filenames for uploaded files.
71
+
72
+ @param {Boolean} [settings.dragdrop=true] Enable ability to add file to the queue by drag'n'dropping them from the desktop.
73
+ @param {Boolean} [settings.rename=false] Enable ability to rename files in the queue.
74
+ @param {Boolean} [settings.multiple_queues=true] Re-activate the widget after each upload procedure.
75
+ */
76
+ ;(function($, plupload) {
77
+ var uploaders = {};
78
+
79
+ function _(str) {
80
+ return plupload.translate(str) || str;
81
+ }
82
+
83
+ function renderUI(id, target) {
84
+ // Remove all existing non plupload items
85
+ target.contents().each(function(i, node) {
86
+ node = $(node);
87
+
88
+ if (!node.is('.plupload')) {
89
+ node.remove();
90
+ }
91
+ });
92
+
93
+ target.prepend(
94
+ '<div class="plupload_wrapper plupload_scroll">' +
95
+ '<div id="' + id + '_container" class="plupload_container">' +
96
+ '<div class="plupload">' +
97
+ '<div class="plupload_header">' +
98
+ '<div class="plupload_header_content">' +
99
+ '<div class="plupload_header_title">' + _('Select files') + '</div>' +
100
+ '<div class="plupload_header_text">' + _('Add files to the upload queue and click the start button.') + '</div>' +
101
+ '</div>' +
102
+ '</div>' +
103
+
104
+ '<div class="plupload_content">' +
105
+ '<div class="plupload_filelist_header">' +
106
+ '<div class="plupload_file_name">' + _('Filename') + '</div>' +
107
+ '<div class="plupload_file_action">&nbsp;</div>' +
108
+ '<div class="plupload_file_status"><span>' + _('Status') + '</span></div>' +
109
+ '<div class="plupload_file_size">' + _('Size') + '</div>' +
110
+ '<div class="plupload_clearer">&nbsp;</div>' +
111
+ '</div>' +
112
+
113
+ '<ul id="' + id + '_filelist" class="plupload_filelist"></ul>' +
114
+
115
+ '<div class="plupload_filelist_footer">' +
116
+ '<div class="plupload_file_name">' +
117
+ '<div class="plupload_buttons">' +
118
+ '<a href="#" class="plupload_button plupload_add" id="' + id + '_browse">' + _('Add Files') + '</a>' +
119
+ '<a href="#" class="plupload_button plupload_start">' + _('Start Upload') + '</a>' +
120
+ '</div>' +
121
+ '<span class="plupload_upload_status"></span>' +
122
+ '</div>' +
123
+ '<div class="plupload_file_action"></div>' +
124
+ '<div class="plupload_file_status"><span class="plupload_total_status">0%</span></div>' +
125
+ '<div class="plupload_file_size"><span class="plupload_total_file_size">0 b</span></div>' +
126
+ '<div class="plupload_progress">' +
127
+ '<div class="plupload_progress_container">' +
128
+ '<div class="plupload_progress_bar"></div>' +
129
+ '</div>' +
130
+ '</div>' +
131
+ '<div class="plupload_clearer">&nbsp;</div>' +
132
+ '</div>' +
133
+ '</div>' +
134
+ '</div>' +
135
+ '</div>' +
136
+ '<input type="hidden" id="' + id + '_count" name="' + id + '_count" value="0" />' +
137
+ '</div>'
138
+ );
139
+ }
140
+
141
+ $.fn.pluploadQueue = function(settings) {
142
+ if (settings) {
143
+ this.each(function() {
144
+ var uploader, target, id, contents_bak;
145
+
146
+ target = $(this);
147
+ id = target.attr('id');
148
+
149
+ if (!id) {
150
+ id = plupload.guid();
151
+ target.attr('id', id);
152
+ }
153
+
154
+ contents_bak = target.html();
155
+ renderUI(id, target);
156
+
157
+ settings = $.extend({
158
+ dragdrop : true,
159
+ browse_button : id + '_browse',
160
+ container : id
161
+ }, settings);
162
+
163
+ // Enable drag/drop (see PostInit handler as well)
164
+ if (settings.dragdrop) {
165
+ settings.drop_element = id + '_filelist';
166
+ }
167
+
168
+ uploader = new plupload.Uploader(settings);
169
+
170
+ uploaders[id] = uploader;
171
+
172
+ function handleStatus(file) {
173
+ var actionClass;
174
+
175
+ if (file.status == plupload.DONE) {
176
+ actionClass = 'plupload_done';
177
+ }
178
+
179
+ if (file.status == plupload.FAILED) {
180
+ actionClass = 'plupload_failed';
181
+ }
182
+
183
+ if (file.status == plupload.QUEUED) {
184
+ actionClass = 'plupload_delete';
185
+ }
186
+
187
+ if (file.status == plupload.UPLOADING) {
188
+ actionClass = 'plupload_uploading';
189
+ }
190
+
191
+ var icon = $('#' + file.id).attr('class', actionClass).find('a').css('display', 'block');
192
+ if (file.hint) {
193
+ icon.attr('title', file.hint);
194
+ }
195
+ }
196
+
197
+ function updateTotalProgress() {
198
+ $('span.plupload_total_status', target).html(uploader.total.percent + '%');
199
+ $('div.plupload_progress_bar', target).css('width', uploader.total.percent + '%');
200
+ $('span.plupload_upload_status', target).html(
201
+ plupload.sprintf(_('Uploaded %d/%d files'), uploader.total.uploaded, uploader.files.length)
202
+ );
203
+ }
204
+
205
+ function updateList() {
206
+ var fileList = $('ul.plupload_filelist', target).html(''), inputCount = 0, inputHTML;
207
+
208
+ $.each(uploader.files, function(i, file) {
209
+ inputHTML = '';
210
+
211
+ if (file.status == plupload.DONE) {
212
+ if (file.target_name) {
213
+ inputHTML += '<input type="hidden" name="' + id + '_' + inputCount + '_tmpname" value="' + plupload.xmlEncode(file.target_name) + '" />';
214
+ }
215
+
216
+ inputHTML += '<input type="hidden" name="' + id + '_' + inputCount + '_name" value="' + plupload.xmlEncode(file.name) + '" />';
217
+ inputHTML += '<input type="hidden" name="' + id + '_' + inputCount + '_status" value="' + (file.status == plupload.DONE ? 'done' : 'failed') + '" />';
218
+
219
+ inputCount++;
220
+
221
+ $('#' + id + '_count').val(inputCount);
222
+ }
223
+
224
+ fileList.append(
225
+ '<li id="' + file.id + '">' +
226
+ '<div class="plupload_file_name"><span>' + file.name + '</span></div>' +
227
+ '<div class="plupload_file_action"><a href="#"></a></div>' +
228
+ '<div class="plupload_file_status">' + file.percent + '%</div>' +
229
+ '<div class="plupload_file_size">' + plupload.formatSize(file.size) + '</div>' +
230
+ '<div class="plupload_clearer">&nbsp;</div>' +
231
+ inputHTML +
232
+ '</li>'
233
+ );
234
+
235
+ handleStatus(file);
236
+
237
+ $('#' + file.id + '.plupload_delete a').click(function(e) {
238
+ $('#' + file.id).remove();
239
+ uploader.removeFile(file);
240
+
241
+ e.preventDefault();
242
+ });
243
+ });
244
+
245
+ $('span.plupload_total_file_size', target).html(plupload.formatSize(uploader.total.size));
246
+
247
+ if (uploader.total.queued === 0) {
248
+ $('span.plupload_add_text', target).html(_('Add Files'));
249
+ } else {
250
+ $('span.plupload_add_text', target).html(plupload.sprintf(_('%d files queued'), uploader.total.queued));
251
+ }
252
+
253
+ $('a.plupload_start', target).toggleClass('plupload_disabled', uploader.files.length == (uploader.total.uploaded + uploader.total.failed));
254
+
255
+ // Scroll to end of file list
256
+ fileList[0].scrollTop = fileList[0].scrollHeight;
257
+
258
+ updateTotalProgress();
259
+
260
+ // Re-add drag message if there is no files
261
+ if (!uploader.files.length && uploader.features.dragdrop && uploader.settings.dragdrop) {
262
+ $('#' + id + '_filelist').append('<li class="plupload_droptext">' + _("Drag files here.") + '</li>');
263
+ }
264
+ }
265
+
266
+ function destroy() {
267
+ delete uploaders[id];
268
+ uploader.destroy();
269
+ target.html(contents_bak);
270
+ uploader = target = contents_bak = null;
271
+ }
272
+
273
+ uploader.bind("UploadFile", function(up, file) {
274
+ $('#' + file.id).addClass('plupload_current_file');
275
+ });
276
+
277
+ uploader.bind('Init', function(up, res) {
278
+ // Enable rename support
279
+ if (!settings.unique_names && settings.rename) {
280
+ target.on('click', '#' + id + '_filelist div.plupload_file_name span', function(e) {
281
+ var targetSpan = $(e.target), file, parts, name, ext = "";
282
+ var fileContainer = targetSpan.closest('li');
283
+
284
+ if (!fileContainer.hasClass('plupload_delete')) {
285
+ return;
286
+ }
287
+
288
+ // Get file name and split out name and extension
289
+ file = up.getFile(targetSpan.parents('li')[0].id);
290
+ name = file.name;
291
+ parts = /^(.+)(\.[^.]+)$/.exec(name);
292
+ if (parts) {
293
+ name = parts[1];
294
+ ext = parts[2];
295
+ }
296
+
297
+ // Display input element
298
+ targetSpan.hide().after('<input type="text" />');
299
+ targetSpan.next().val(name).focus().blur(function() {
300
+ targetSpan.show().next().remove();
301
+ }).keydown(function(e) {
302
+ var targetInput = $(this);
303
+
304
+ if (e.keyCode == 13) {
305
+ e.preventDefault();
306
+
307
+ // Rename file and glue extension back on
308
+ file.name = targetInput.val() + ext;
309
+ targetSpan.html(file.name);
310
+ targetInput.blur();
311
+ }
312
+ });
313
+ });
314
+ }
315
+
316
+ $('#' + id + '_container').attr('title', 'Using runtime: ' + res.runtime);
317
+
318
+ $('a.plupload_start', target).click(function(e) {
319
+ if (!$(this).hasClass('plupload_disabled')) {
320
+ uploader.start();
321
+ }
322
+
323
+ e.preventDefault();
324
+ });
325
+
326
+ $('a.plupload_stop', target).click(function(e) {
327
+ e.preventDefault();
328
+ uploader.stop();
329
+ });
330
+
331
+ $('a.plupload_start', target).addClass('plupload_disabled');
332
+ });
333
+
334
+ uploader.bind("Error", function(up, err) {
335
+ var file = err.file, message;
336
+
337
+ if (file) {
338
+ message = err.message;
339
+
340
+ if (err.details) {
341
+ message += " (" + err.details + ")";
342
+ }
343
+
344
+ if (err.code == plupload.FILE_SIZE_ERROR) {
345
+ alert(_("Error: File too large:") + " " + file.name);
346
+ }
347
+
348
+ if (err.code == plupload.FILE_EXTENSION_ERROR) {
349
+ alert(_("Error: Invalid file extension:") + " " + file.name);
350
+ }
351
+
352
+ file.hint = message;
353
+ $('#' + file.id).attr('class', 'plupload_failed').find('a').css('display', 'block').attr('title', message);
354
+ }
355
+
356
+ if (err.code === plupload.INIT_ERROR) {
357
+ setTimeout(function() {
358
+ destroy();
359
+ }, 1);
360
+ }
361
+ });
362
+
363
+ uploader.bind("PostInit", function(up) {
364
+ // features are populated only after input components are fully instantiated
365
+ if (up.settings.dragdrop && up.features.dragdrop) {
366
+ $('#' + id + '_filelist').append('<li class="plupload_droptext">' + _("Drag files here.") + '</li>');
367
+ }
368
+ });
369
+
370
+ uploader.init();
371
+
372
+ uploader.bind('StateChanged', function() {
373
+ if (uploader.state === plupload.STARTED) {
374
+ $('li.plupload_delete a,div.plupload_buttons', target).hide();
375
+ uploader.disableBrowse(true);
376
+
377
+ $('span.plupload_upload_status,div.plupload_progress,a.plupload_stop', target).css('display', 'block');
378
+ $('span.plupload_upload_status', target).html('Uploaded ' + uploader.total.uploaded + '/' + uploader.files.length + ' files');
379
+
380
+ if (settings.multiple_queues) {
381
+ $('span.plupload_total_status,span.plupload_total_file_size', target).show();
382
+ }
383
+ } else {
384
+ updateList();
385
+ $('a.plupload_stop,div.plupload_progress', target).hide();
386
+ $('a.plupload_delete', target).css('display', 'block');
387
+
388
+ if (settings.multiple_queues && uploader.total.uploaded + uploader.total.failed == uploader.files.length) {
389
+ $(".plupload_buttons,.plupload_upload_status", target).css("display", "inline");
390
+ uploader.disableBrowse(false);
391
+
392
+ $(".plupload_start", target).addClass("plupload_disabled");
393
+ $('span.plupload_total_status,span.plupload_total_file_size', target).hide();
394
+ }
395
+ }
396
+ });
397
+
398
+ uploader.bind('FilesAdded', updateList);
399
+
400
+ uploader.bind('FilesRemoved', function() {
401
+ // since the whole file list is redrawn for every change in the queue
402
+ // we need to scroll back to the file removal point to avoid annoying
403
+ // scrolling to the bottom bug (see #926)
404
+ var scrollTop = $('#' + id + '_filelist').scrollTop();
405
+ updateList();
406
+ $('#' + id + '_filelist').scrollTop(scrollTop);
407
+ });
408
+
409
+ uploader.bind('FileUploaded', function(up, file) {
410
+ handleStatus(file);
411
+ });
412
+
413
+ uploader.bind("UploadProgress", function(up, file) {
414
+ // Set file specific progress
415
+ $('#' + file.id + ' div.plupload_file_status', target).html(file.percent + '%');
416
+
417
+ handleStatus(file);
418
+ updateTotalProgress();
419
+ });
420
+
421
+ // Call setup function
422
+ if (settings.setup) {
423
+ settings.setup(uploader);
424
+ }
425
+ });
426
+
427
+ return this;
428
+ } else {
429
+ // Get uploader instance for specified element
430
+ return uploaders[$(this[0]).attr('id')];
431
+ }
432
+ };
433
+ })(jQuery, plupload);
admin/js/plupload/jquery.plupload.queue/jquery.plupload.queue.min.js ADDED
@@ -0,0 +1 @@
 
1
+ !function(e,t){function i(e){return t.translate(e)||e}function s(t,s){s.contents().each(function(t,i){i=e(i),i.is(".plupload")||i.remove()}),s.prepend('<div class="plupload_wrapper plupload_scroll"><div id="'+t+'_container" class="plupload_container">'+'<div class="plupload">'+'<div class="plupload_header">'+'<div class="plupload_header_content">'+'<div class="plupload_header_title">'+i("Select files")+"</div>"+'<div class="plupload_header_text">'+i("Add files to the upload queue and click the start button.")+"</div>"+"</div>"+"</div>"+'<div class="plupload_content">'+'<div class="plupload_filelist_header">'+'<div class="plupload_file_name">'+i("Filename")+"</div>"+'<div class="plupload_file_action">&nbsp;</div>'+'<div class="plupload_file_status"><span>'+i("Status")+"</span></div>"+'<div class="plupload_file_size">'+i("Size")+"</div>"+'<div class="plupload_clearer">&nbsp;</div>'+"</div>"+'<ul id="'+t+'_filelist" class="plupload_filelist"></ul>'+'<div class="plupload_filelist_footer">'+'<div class="plupload_file_name">'+'<div class="plupload_buttons">'+'<a href="#" class="plupload_button plupload_add" id="'+t+'_browse">'+i("Add Files")+"</a>"+'<a href="#" class="plupload_button plupload_start">'+i("Start Upload")+"</a>"+"</div>"+'<span class="plupload_upload_status"></span>'+"</div>"+'<div class="plupload_file_action"></div>'+'<div class="plupload_file_status"><span class="plupload_total_status">0%</span></div>'+'<div class="plupload_file_size"><span class="plupload_total_file_size">0 b</span></div>'+'<div class="plupload_progress">'+'<div class="plupload_progress_container">'+'<div class="plupload_progress_bar"></div>'+"</div>"+"</div>"+'<div class="plupload_clearer">&nbsp;</div>'+"</div>"+"</div>"+"</div>"+"</div>"+'<input type="hidden" id="'+t+'_count" name="'+t+'_count" value="0" />'+"</div>")}var l={};e.fn.pluploadQueue=function(a){return a?(this.each(function(){function n(i){var s;i.status==t.DONE&&(s="plupload_done"),i.status==t.FAILED&&(s="plupload_failed"),i.status==t.QUEUED&&(s="plupload_delete"),i.status==t.UPLOADING&&(s="plupload_uploading");var l=e("#"+i.id).attr("class",s).find("a").css("display","block");i.hint&&l.attr("title",i.hint)}function o(){e("span.plupload_total_status",p).html(u.total.percent+"%"),e("div.plupload_progress_bar",p).css("width",u.total.percent+"%"),e("span.plupload_upload_status",p).html(t.sprintf(i("Uploaded %d/%d files"),u.total.uploaded,u.files.length))}function r(){var s,l=e("ul.plupload_filelist",p).html(""),a=0;e.each(u.files,function(i,o){s="",o.status==t.DONE&&(o.target_name&&(s+='<input type="hidden" name="'+c+"_"+a+'_tmpname" value="'+t.xmlEncode(o.target_name)+'" />'),s+='<input type="hidden" name="'+c+"_"+a+'_name" value="'+t.xmlEncode(o.name)+'" />',s+='<input type="hidden" name="'+c+"_"+a+'_status" value="'+(o.status==t.DONE?"done":"failed")+'" />',a++,e("#"+c+"_count").val(a)),l.append('<li id="'+o.id+'">'+'<div class="plupload_file_name"><span>'+o.name+"</span></div>"+'<div class="plupload_file_action"><a href="#"></a></div>'+'<div class="plupload_file_status">'+o.percent+"%</div>"+'<div class="plupload_file_size">'+t.formatSize(o.size)+"</div>"+'<div class="plupload_clearer">&nbsp;</div>'+s+"</li>"),n(o),e("#"+o.id+".plupload_delete a").click(function(t){e("#"+o.id).remove(),u.removeFile(o),t.preventDefault()})}),e("span.plupload_total_file_size",p).html(t.formatSize(u.total.size)),0===u.total.queued?e("span.plupload_add_text",p).html(i("Add Files")):e("span.plupload_add_text",p).html(t.sprintf(i("%d files queued"),u.total.queued)),e("a.plupload_start",p).toggleClass("plupload_disabled",u.files.length==u.total.uploaded+u.total.failed),l[0].scrollTop=l[0].scrollHeight,o(),!u.files.length&&u.features.dragdrop&&u.settings.dragdrop&&e("#"+c+"_filelist").append('<li class="plupload_droptext">'+i("Drag files here.")+"</li>")}function d(){delete l[c],u.destroy(),p.html(_),u=p=_=null}var u,p,c,_;p=e(this),c=p.attr("id"),c||(c=t.guid(),p.attr("id",c)),_=p.html(),s(c,p),a=e.extend({dragdrop:!0,browse_button:c+"_browse",container:c},a),a.dragdrop&&(a.drop_element=c+"_filelist"),u=new t.Uploader(a),l[c]=u,u.bind("UploadFile",function(t,i){e("#"+i.id).addClass("plupload_current_file")}),u.bind("Init",function(t,i){!a.unique_names&&a.rename&&p.on("click","#"+c+"_filelist div.plupload_file_name span",function(i){var s,l,a,n=e(i.target),o="",r=n.closest("li");r.hasClass("plupload_delete")&&(s=t.getFile(n.parents("li")[0].id),a=s.name,l=/^(.+)(\.[^.]+)$/.exec(a),l&&(a=l[1],o=l[2]),n.hide().after('<input type="text" />'),n.next().val(a).focus().blur(function(){n.show().next().remove()}).keydown(function(t){var i=e(this);13==t.keyCode&&(t.preventDefault(),s.name=i.val()+o,n.html(s.name),i.blur())}))}),e("#"+c+"_container").attr("title","Using runtime: "+i.runtime),e("a.plupload_start",p).click(function(t){e(this).hasClass("plupload_disabled")||u.start(),t.preventDefault()}),e("a.plupload_stop",p).click(function(e){e.preventDefault(),u.stop()}),e("a.plupload_start",p).addClass("plupload_disabled")}),u.bind("Error",function(s,l){var a,n=l.file;n&&(a=l.message,l.details&&(a+=" ("+l.details+")"),l.code==t.FILE_SIZE_ERROR&&alert(i("Error: File too large:")+" "+n.name),l.code==t.FILE_EXTENSION_ERROR&&alert(i("Error: Invalid file extension:")+" "+n.name),n.hint=a,e("#"+n.id).attr("class","plupload_failed").find("a").css("display","block").attr("title",a)),l.code===t.INIT_ERROR&&setTimeout(function(){d()},1)}),u.bind("PostInit",function(t){t.settings.dragdrop&&t.features.dragdrop&&e("#"+c+"_filelist").append('<li class="plupload_droptext">'+i("Drag files here.")+"</li>")}),u.init(),u.bind("StateChanged",function(){u.state===t.STARTED?(e("li.plupload_delete a,div.plupload_buttons",p).hide(),u.disableBrowse(!0),e("span.plupload_upload_status,div.plupload_progress,a.plupload_stop",p).css("display","block"),e("span.plupload_upload_status",p).html("Uploaded "+u.total.uploaded+"/"+u.files.length+" files"),a.multiple_queues&&e("span.plupload_total_status,span.plupload_total_file_size",p).show()):(r(),e("a.plupload_stop,div.plupload_progress",p).hide(),e("a.plupload_delete",p).css("display","block"),a.multiple_queues&&u.total.uploaded+u.total.failed==u.files.length&&(e(".plupload_buttons,.plupload_upload_status",p).css("display","inline"),u.disableBrowse(!1),e(".plupload_start",p).addClass("plupload_disabled"),e("span.plupload_total_status,span.plupload_total_file_size",p).hide()))}),u.bind("FilesAdded",r),u.bind("FilesRemoved",function(){var t=e("#"+c+"_filelist").scrollTop();r(),e("#"+c+"_filelist").scrollTop(t)}),u.bind("FileUploaded",function(e,t){n(t)}),u.bind("UploadProgress",function(t,i){e("#"+i.id+" div.plupload_file_status",p).html(i.percent+"%"),n(i),o()}),a.setup&&a.setup(u)}),this):l[e(this[0]).attr("id")]}}(jQuery,plupload);
admin/js/plupload/jquery.ui.plupload/css/jquery.ui.plupload.css CHANGED
@@ -2,6 +2,10 @@
2
  Plupload
3
  ------------------------------------------------------------------- */
4
 
 
 
 
 
5
  .plupload_button {
6
  cursor: pointer;
7
  outline: none;
@@ -11,6 +15,7 @@
11
  font: normal 11px Verdana,sans-serif;
12
  width: 100%;
13
  min-width: 520px;
 
14
  }
15
 
16
  .plupload_container {
@@ -23,10 +28,10 @@
23
  .plupload_file {border-width: 0 0 1px 0}
24
  .plupload_container .plupload_header {border-width: 0 0 1px 0; position: relative;}
25
 
26
- .plupload_delete .ui-icon,
27
  .plupload_done .ui-icon,
28
  .plupload_failed .ui-icon {
29
- cursor:pointer;
30
  }
31
 
32
  .plupload_header_content {
@@ -50,6 +55,7 @@
50
 
51
  .plupload_header_title {
52
  font: normal 18px sans-serif;
 
53
  padding: 6px 0 3px;
54
  }
55
 
@@ -71,7 +77,7 @@
71
 
72
  .plupload_content {
73
  position: absolute;
74
- top: 87px;
75
  bottom: 44px;
76
  left: 0;
77
  right: 0;
@@ -103,18 +109,22 @@
103
  display: block;
104
  position: relative;
105
  overflow: hidden;
106
- width: 100%;
107
  }
108
 
109
  .plupload_file_thumb {
110
- position: absolute;
111
- left: 6px;
112
- top: 6px;
 
 
 
113
  background: #eee url(../img/loading.gif) center no-repeat;
114
  }
115
 
116
- .plupload_file_thumb_loaded .plupload_file_thumb {
117
- background-image: none;
 
118
  }
119
 
120
  .plupload_file_name {
@@ -134,7 +144,7 @@
134
  right: 0;
135
  }
136
 
137
- .plupload_buttons {
138
  position: relative;
139
  }
140
 
@@ -144,9 +154,13 @@
144
  border-right: none;
145
  border-top: none;
146
  height: 29px;
 
 
 
 
147
  }
148
 
149
- .plupload_view_list div.plupload_file_size,
150
  .plupload_view_list div.plupload_file_status,
151
  .plupload_view_list div.plupload_file_action {
152
  padding: 8px 6px;
@@ -173,16 +187,16 @@
173
  margin-left: -2px;
174
  }
175
 
176
- .plupload_view_list .plupload_file_size,
177
  .plupload_view_list .plupload_file_status,
178
- .plupload_filelist_footer .plupload_file_size,
179
  .plupload_filelist_footer .plupload_file_status {
180
- text-align: right;
181
  width: 52px;
182
  }
183
 
184
- .plupload_view_list .plupload_file_thumb,
185
- .plupload_view_list .plupload_file_dummy {
186
  top: -999px;
187
  }
188
 
@@ -201,8 +215,7 @@
201
  }
202
 
203
  .plupload_view_thumbs .plupload_file {
204
- width: 100px;
205
- padding: 72px 6px 6px;
206
  margin: 10px;
207
  border: 1px solid #fff;
208
  float: left;
@@ -210,8 +223,6 @@
210
 
211
  .plupload_view_thumbs .plupload_file_thumb,
212
  .plupload_view_thumbs .plupload_file_dummy {
213
- width: 100px;
214
- height: 60px;
215
  text-align: center;
216
  overflow: hidden;
217
  }
@@ -221,8 +232,12 @@
221
  font-weight: bold;
222
  text-transform: lowercase;
223
  overflow: hidden;
224
- line-height: 60px;
225
  border: none;
 
 
 
 
 
226
  }
227
 
228
  .plupload_view_thumbs div.plupload_file_action {
@@ -247,13 +262,11 @@
247
  }
248
 
249
  .plupload_view_thumbs div.plupload_file_status {
250
- position: absolute;
251
- top: 67px;
252
- left: 6px;
253
- width: 100px;
254
  height: 3px;
255
  overflow: hidden;
256
  text-indent: -999px;
 
257
  }
258
 
259
  .plupload_view_thumbs div.plupload_file_progress {
@@ -263,7 +276,7 @@
263
 
264
  .plupload .ui-sortable-helper,
265
  .plupload .ui-sortable .plupload_file {
266
- cursor:move;
267
  }
268
 
269
  .plupload_file_action {width: 16px;}
@@ -297,7 +310,7 @@
297
  .plupload_clearer {height: 0;}
298
 
299
  /* Misc */
300
- .plupload_hidden {display: none;}
301
 
302
  .plupload_droptext {
303
  position: absolute;
@@ -317,12 +330,16 @@
317
  display: block;
318
  }
319
 
 
 
 
 
320
  .plupload_buttons, .plupload_upload_status {float: left}
321
 
322
  .plupload_message {
323
  position: absolute;
324
  top: -1px;
325
- left: -1px;
326
  height: 100%;
327
  width: 100%;
328
  }
@@ -333,28 +350,28 @@
333
  }
334
 
335
  .plupload_message strong {
336
- font-weight: bold;
337
  }
338
 
339
- plupload_message i {
340
- font-style: italic;
341
  }
342
 
343
  .plupload_message p span.ui-icon {
344
  float: left;
345
- margin-right: 0.3em;
346
  }
347
 
348
  .plupload_header_content .ui-state-error,
349
  .plupload_header_content .ui-state-highlight {
350
- border:none;
351
  }
352
 
353
  .plupload_message_close {
354
  position:absolute;
355
  top:5px;
356
  right:5px;
357
- cursor:pointer;
358
  }
359
 
360
  .plupload .ui-sortable-placeholder {
2
  Plupload
3
  ------------------------------------------------------------------- */
4
 
5
+ .plupload_wrapper * {
6
+ box-sizing: content-box;
7
+ }
8
+
9
  .plupload_button {
10
  cursor: pointer;
11
  outline: none;
15
  font: normal 11px Verdana,sans-serif;
16
  width: 100%;
17
  min-width: 520px;
18
+ line-height: 12px;
19
  }
20
 
21
  .plupload_container {
28
  .plupload_file {border-width: 0 0 1px 0}
29
  .plupload_container .plupload_header {border-width: 0 0 1px 0; position: relative;}
30
 
31
+ .plupload_delete .ui-icon,
32
  .plupload_done .ui-icon,
33
  .plupload_failed .ui-icon {
34
+ cursor:pointer;
35
  }
36
 
37
  .plupload_header_content {
55
 
56
  .plupload_header_title {
57
  font: normal 18px sans-serif;
58
+ line-height: 19px;
59
  padding: 6px 0 3px;
60
  }
61
 
77
 
78
  .plupload_content {
79
  position: absolute;
80
+ top: 86px;
81
  bottom: 44px;
82
  left: 0;
83
  right: 0;
109
  display: block;
110
  position: relative;
111
  overflow: hidden;
112
+ line-height: 12px;
113
  }
114
 
115
  .plupload_file_thumb {
116
+ position: relative;
117
+ background-image: none;
118
+ background-color: #eee;
119
+ }
120
+
121
+ .plupload_thumb_loading {
122
  background: #eee url(../img/loading.gif) center no-repeat;
123
  }
124
 
125
+ .plupload_thumb_loading .plupload_file_dummy,
126
+ .plupload_thumb_embedded .plupload_file_dummy {
127
+ display: none;
128
  }
129
 
130
  .plupload_file_name {
144
  right: 0;
145
  }
146
 
147
+ .plupload_buttons {
148
  position: relative;
149
  }
150
 
154
  border-right: none;
155
  border-top: none;
156
  height: 29px;
157
+ width: 100% !important;
158
+ /* fix IE6 vertical white-space bug */
159
+ _float: left;
160
+ _clear: left;
161
  }
162
 
163
+ .plupload_view_list div.plupload_file_size,
164
  .plupload_view_list div.plupload_file_status,
165
  .plupload_view_list div.plupload_file_action {
166
  padding: 8px 6px;
187
  margin-left: -2px;
188
  }
189
 
190
+ .plupload_view_list .plupload_file_size,
191
  .plupload_view_list .plupload_file_status,
192
+ .plupload_filelist_footer .plupload_file_size,
193
  .plupload_filelist_footer .plupload_file_status {
194
+ text-align: right;
195
  width: 52px;
196
  }
197
 
198
+ .plupload_view_list .plupload_file_thumb {
199
+ position: absolute;
200
  top: -999px;
201
  }
202
 
215
  }
216
 
217
  .plupload_view_thumbs .plupload_file {
218
+ padding: 6px;
 
219
  margin: 10px;
220
  border: 1px solid #fff;
221
  float: left;
223
 
224
  .plupload_view_thumbs .plupload_file_thumb,
225
  .plupload_view_thumbs .plupload_file_dummy {
 
 
226
  text-align: center;
227
  overflow: hidden;
228
  }
232
  font-weight: bold;
233
  text-transform: lowercase;
234
  overflow: hidden;
 
235
  border: none;
236
+ position: absolute;
237
+ top: 0;
238
+ left: 0;
239
+ width: 100%;
240
+ height: 100%;
241
  }
242
 
243
  .plupload_view_thumbs div.plupload_file_action {
262
  }
263
 
264
  .plupload_view_thumbs div.plupload_file_status {
265
+ position: relative;
 
 
 
266
  height: 3px;
267
  overflow: hidden;
268
  text-indent: -999px;
269
+ margin-bottom: 3px;
270
  }
271
 
272
  .plupload_view_thumbs div.plupload_file_progress {
276
 
277
  .plupload .ui-sortable-helper,
278
  .plupload .ui-sortable .plupload_file {
279
+ cursor:move;
280
  }
281
 
282
  .plupload_file_action {width: 16px;}
310
  .plupload_clearer {height: 0;}
311
 
312
  /* Misc */
313
+ .plupload_hidden {display: none !important;}
314
 
315
  .plupload_droptext {
316
  position: absolute;
330
  display: block;
331
  }
332
 
333
+ .plupload_files_queued .plupload_droptext {
334
+ display: none;
335
+ }
336
+
337
  .plupload_buttons, .plupload_upload_status {float: left}
338
 
339
  .plupload_message {
340
  position: absolute;
341
  top: -1px;
342
+ left: -1px;
343
  height: 100%;
344
  width: 100%;
345
  }
350
  }
351
 
352
  .plupload_message strong {
353
+ font-weight: bold;
354
  }
355
 
356
+ .plupload_message i {
357
+ font-style: italic;
358
  }
359
 
360
  .plupload_message p span.ui-icon {
361
  float: left;
362
+ margin-right: 0.3em;
363
  }
364
 
365
  .plupload_header_content .ui-state-error,
366
  .plupload_header_content .ui-state-highlight {
367
+ border:none;
368
  }
369
 
370
  .plupload_message_close {
371
  position:absolute;
372
  top:5px;
373
  right:5px;
374
+ cursor:pointer;
375
  }
376
 
377
  .plupload .ui-sortable-placeholder {
admin/js/plupload/jquery.ui.plupload/img/plupload.png CHANGED
Binary file
admin/js/plupload/jquery.ui.plupload/jquery.ui.plupload.js CHANGED
@@ -12,7 +12,7 @@
12
  * jquery.ui.widget.js
13
  * jquery.ui.button.js
14
  * jquery.ui.progressbar.js
15
- *
16
  * Optionally:
17
  * jquery.ui.sortable.js
18
  */
@@ -22,11 +22,11 @@
22
  /**
23
  jQuery UI based implementation of the Plupload API - multi-runtime file uploading API.
24
 
25
- To use the widget you must include _jQuery_ and _jQuery UI_ bundle (including `ui.core`, `ui.widget`, `ui.button`,
26
  `ui.progressbar` and `ui.sortable`).
27
 
28
- In general the widget is designed the way that you do not usually need to do anything to it after you instantiate it.
29
- But! You still can intervenue, to some extent, in case you need to. Although, due to the fact that widget is based on
30
  _jQuery UI_ widget factory, there are some specifics. See examples below for more details.
31
 
32
  @example
@@ -58,7 +58,7 @@ _jQuery UI_ widget factory, there are some specifics. See examples below for mor
58
  @example
59
  // Subscribing to the events...
60
  // ... on initialization:
61
- $('#uploader').plupload({
62
  ...
63
  viewchanged: function(event, args) {
64
  // stuff ...
@@ -75,7 +75,11 @@ _jQuery UI_ widget factory, there are some specifics. See examples below for mor
75
  @param {String} settings.url URL of the server-side upload handler.
76
  @param {Number|String} [settings.chunk_size=0] Chunk size in bytes to slice the file into. Shorcuts with b, kb, mb, gb, tb suffixes also supported. `e.g. 204800 or "204800b" or "200kb"`. By default - disabled.
77
  @param {String} [settings.file_data_name="file"] Name for the file field in Multipart formated message.
78
- @param {Array} [settings.filters=[]] Set of file type filters, each one defined by hash of title and extensions. `e.g. {title : "Image files", extensions : "jpg,jpeg,gif,png"}`. Dispatches `plupload.FILE_EXTENSION_ERROR`
 
 
 
 
79
  @param {String} [settings.flash_swf_url] URL of the Flash swf.
80
  @param {Object} [settings.headers] Custom headers to send with the upload. Hash of name/value pairs.
81
  @param {Number|String} [settings.max_file_size] Maximum file size that the user can pick, in bytes. Optionally supports b, kb, mb, gb, tb suffixes. `e.g. "10mb" or "1gb"`. By default - not set. Dispatches `plupload.FILE_SIZE_ERROR`.
@@ -98,19 +102,18 @@ _jQuery UI_ widget factory, there are some specifics. See examples below for mor
98
  @param {Boolean} [settings.dragdrop=true] Enable ability to add file to the queue by drag'n'dropping them from the desktop.
99
  @param {Boolean} [settings.rename=false] Enable ability to rename files in the queue.
100
  @param {Boolean} [settings.sortable=false] Enable ability to sort files in the queue, changing their uploading priority.
101
- @param {Object} [settings.buttons] Control the visibility of functional buttons.
102
  @param {Boolean} [settings.buttons.browse=true] Display browse button.
103
  @param {Boolean} [settings.buttons.start=true] Display start button.
104
- @param {Boolean} [settings.buttons.stop=true] Display stop button.
105
  @param {Object} [settings.views] Control various views of the file queue.
106
  @param {Boolean} [settings.views.list=true] Enable list view.
107
  @param {Boolean} [settings.views.thumbs=false] Enable thumbs view.
108
  @param {String} [settings.views.default='list'] Default view.
109
  @param {Boolean} [settings.views.remember=true] Whether to remember the current view (requires jQuery Cookie plugin).
110
  @param {Boolean} [settings.multiple_queues=true] Re-activate the widget after each upload procedure.
111
- @param {Number} [settings.max_file_count=0] Limit the number of files user is able to upload in one go, autosets _multiple_queues_ to _false_ (default is 0 - no limit).
112
  */
113
- (function(window, document, plupload, o, $) {
114
 
115
  /**
116
  Dispatched when the widget is initialized and ready.
@@ -138,14 +141,14 @@ Dispatched when file dialog is closed.
138
  /**
139
  Dispatched when upload is started.
140
 
141
- @event start
142
  @param {plupload.Uploader} uploader Uploader instance sending the event.
143
  */
144
 
145
  /**
146
  Dispatched when upload is stopped.
147
 
148
- @event stop
149
  @param {plupload.Uploader} uploader Uploader instance sending the event.
150
  */
151
 
@@ -195,13 +198,13 @@ Dispatched when error of some kind is detected.
195
  @param {Enum} status Status constant matching the plupload states QUEUED, UPLOADING, FAILED, DONE.
196
  */
197
 
198
- var uploaders = {};
199
-
200
  function _(str) {
201
  return plupload.translate(str) || str;
202
  }
203
 
204
- function renderUI(obj) {
205
  obj.id = obj.attr('id');
206
 
207
  obj.html(
@@ -210,8 +213,8 @@ function renderUI(obj) {
210
  '<div class="ui-state-default ui-widget-header plupload_header">' +
211
  '<div class="plupload_header_content">' +
212
  '<div class="plupload_logo"> </div>' +
213
- '<div class="plupload_header_title">' + _('Select files') + '</div>' +
214
- '<div class="plupload_header_text">' + _('Add files to the upload queue and click the start button.') + '</div>' +
215
  '<div class="plupload_view_switch">' +
216
  '<input type="radio" id="'+obj.id+'_view_list" name="view_mode_'+obj.id+'" checked="checked" /><label class="plupload_button" for="'+obj.id+'_view_list" data-view="list">' + _('List') + '</label>' +
217
  '<input type="radio" id="'+obj.id+'_view_thumbs" name="view_mode_'+obj.id+'" /><label class="plupload_button" for="'+obj.id+'_view_thumbs" data-view="thumbs">' + _('Thumbnails') + '</label>' +
@@ -233,14 +236,14 @@ function renderUI(obj) {
233
  '<ul class="plupload_filelist_content"> </ul>' +
234
  '<div class="plupload_clearer">&nbsp;</div>' +
235
  '</div>' +
236
-
237
  '<table class="plupload_filelist plupload_filelist_footer ui-widget-header">' +
238
  '<tr>' +
239
  '<td class="plupload_cell plupload_file_name">' +
240
  '<div class="plupload_buttons"><!-- Visible -->' +
241
- '<a class="plupload_button plupload_add">' + _('Add Files') + '</a>&nbsp;' +
242
- '<a class="plupload_button plupload_start">' + _('Start Upload') + '</a>&nbsp;' +
243
- '<a class="plupload_button plupload_stop plupload_hidden">'+_('Stop Upload') + '</a>&nbsp;' +
244
  '</div>' +
245
 
246
  '<div class="plupload_started plupload_hidden"><!-- Hidden -->' +
@@ -269,35 +272,41 @@ function renderUI(obj) {
269
  $.widget("ui.plupload", {
270
 
271
  widgetEventPrefix: '',
272
-
273
  contents_bak: '',
274
-
275
  options: {
276
  browse_button_hover: 'ui-state-hover',
277
  browse_button_active: 'ui-state-active',
278
-
 
 
279
  // widget specific
280
- dragdrop : true,
281
- multiple_queues: true, // re-use widget by default
282
  buttons: {
283
  browse: true,
284
  start: true,
285
- stop: true
286
  },
 
287
  views: {
288
  list: true,
289
  thumbs: false,
290
  active: 'list',
291
  remember: true // requires: https://github.com/carhartl/jquery-cookie, otherwise disabled even if set to true
292
  },
 
 
 
 
 
 
293
  autostart: false,
294
  sortable: false,
295
- rename: false,
296
- max_file_count: 0 // unlimited
297
  },
298
-
299
  FILE_COUNT_ERROR: -9001,
300
-
301
  _create: function() {
302
  var id = this.element.attr('id');
303
  if (!id) {
@@ -305,30 +314,30 @@ $.widget("ui.plupload", {
305
  this.element.attr('id', id);
306
  }
307
  this.id = id;
308
-
309
  // backup the elements initial state
310
  this.contents_bak = this.element.html();
311
  renderUI(this.element);
312
-
313
  // container, just in case
314
- this.container = $('.plupload_container', this.element).attr('id', id + '_container');
315
 
316
  this.content = $('.plupload_content', this.element);
317
-
318
  if ($.fn.resizable) {
319
- this.container.resizable({
320
  handles: 's',
321
  minHeight: 300
322
  });
323
  }
324
-
325
  // list of files, may become sortable
326
  this.filelist = $('.plupload_filelist_content', this.container)
327
  .attr({
328
  id: id + '_filelist',
329
  unselectable: 'on'
330
  });
331
-
332
 
333
  // buttons
334
  this.browse_button = $('.plupload_add', this.container).attr('id', id + '_browse');
@@ -336,22 +345,22 @@ $.widget("ui.plupload", {
336
  this.stop_button = $('.plupload_stop', this.container).attr('id', id + '_stop');
337
  this.thumbs_switcher = $('#' + id + '_view_thumbs');
338
  this.list_switcher = $('#' + id + '_view_list');
339
-
340
  if ($.ui.button) {
341
  this.browse_button.button({
342
  icons: { primary: 'ui-icon-circle-plus' },
343
  disabled: true
344
  });
345
-
346
  this.start_button.button({
347
  icons: { primary: 'ui-icon-circle-arrow-e' },
348
  disabled: true
349
  });
350
-
351
  this.stop_button.button({
352
  icons: { primary: 'ui-icon-circle-close' }
353
  });
354
-
355
  this.list_switcher.button({
356
  text: false,
357
  icons: { secondary: "ui-icon-grip-dotted-horizontal" }
@@ -362,21 +371,21 @@ $.widget("ui.plupload", {
362
  icons: { secondary: "ui-icon-image" }
363
  });
364
  }
365
-
366
  // progressbar
367
- this.progressbar = $('.plupload_progress_container', this.container);
368
-
369
  if ($.ui.progressbar) {
370
  this.progressbar.progressbar();
371
  }
372
-
373
  // counter
374
  this.counter = $('.plupload_count', this.element)
375
  .attr({
376
  id: id + '_count',
377
  name: id + '_count'
378
  });
379
-
380
  // initialize uploader instance
381
  this._initUploader();
382
  },
@@ -385,7 +394,7 @@ $.widget("ui.plupload", {
385
  var self = this
386
  , id = this.id
387
  , uploader
388
- , options = {
389
  container: id + '_buttons',
390
  browse_button: id + '_browse'
391
  }
@@ -398,48 +407,85 @@ $.widget("ui.plupload", {
398
  options.drop_element = this.id + '_dropbox';
399
  }
400
 
 
 
 
 
 
 
 
 
 
 
 
401
  uploader = this.uploader = uploaders[id] = new plupload.Uploader($.extend(this.options, options));
402
 
 
 
 
403
  if (self.options.views.thumbs) {
404
  uploader.settings.required_features.display_media = true;
405
  }
406
 
 
 
 
 
 
 
407
 
408
- uploader.bind('Error', function(up, err) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
409
  var message, details = "";
410
 
411
  message = '<strong>' + err.message + '</strong>';
412
-
413
  switch (err.code) {
414
  case plupload.FILE_EXTENSION_ERROR:
415
- details = o.sprintf(_("File: %s"), err.file.name);
416
  break;
417
-
418
  case plupload.FILE_SIZE_ERROR:
419
- details = o.sprintf(_("File: %s, size: %d, max file size: %d"), err.file.name, err.file.size, plupload.parseSize(self.options.max_file_size));
420
  break;
421
 
422
  case plupload.FILE_DUPLICATE_ERROR:
423
- details = o.sprintf(_("%s already present in the queue."), err.file.name);
424
  break;
425
-
426
  case self.FILE_COUNT_ERROR:
427
- details = o.sprintf(_("Upload element accepts only %d file(s) at a time. Extra files were stripped."), self.options.max_file_count);
428
  break;
429
-
430
  case plupload.IMAGE_FORMAT_ERROR :
431
  details = _("Image format either wrong or not supported.");
432
- break;
433
-
434
  case plupload.IMAGE_MEMORY_ERROR :
435
  details = _("Runtime ran out of available memory.");
436
  break;
437
-
438
  /* // This needs a review
439
  case plupload.IMAGE_DIMENSIONS_ERROR :
440
- details = o.sprintf(_('Resoultion out of boundaries! <b>%s</b> runtime supports images only up to %wx%hpx.'), up.runtime, up.features.maxWidth, up.features.maxHeight);
441
  break; */
442
-
443
  case plupload.HTTP_ERROR:
444
  details = _("Upload URL might be wrong or doesn't exist.");
445
  break;
@@ -459,8 +505,8 @@ $.widget("ui.plupload", {
459
  }
460
  });
461
 
462
-
463
- uploader.bind('PostInit', function(up) {
464
  // all buttons are optional, so they can be disabled and hidden
465
  if (!self.options.buttons.browse) {
466
  self.browse_button.button('disable').hide();
@@ -468,17 +514,17 @@ $.widget("ui.plupload", {
468
  } else {
469
  self.browse_button.button('enable');
470
  }
471
-
472
  if (!self.options.buttons.start) {
473
  self.start_button.button('disable').hide();
474
- }
475
-
476
  if (!self.options.buttons.stop) {
477
  self.stop_button.button('disable').hide();
478
  }
479
-
480
  if (!self.options.unique_names && self.options.rename) {
481
- self._enableRenaming();
482
  }
483
 
484
  if (self.options.dragdrop && up.features.dragdrop) {
@@ -486,7 +532,7 @@ $.widget("ui.plupload", {
486
  }
487
 
488
  self._enableViewSwitcher();
489
-
490
  self.start_button.click(function(e) {
491
  if (!$(this).button('option', 'disabled')) {
492
  self.start();
@@ -501,45 +547,24 @@ $.widget("ui.plupload", {
501
 
502
  self._trigger('ready', null, { up: up });
503
  });
504
-
505
-
506
- // check if file count doesn't exceed the limit
507
- if (self.options.max_file_count) {
508
- self.options.multiple_queues = false; // one go only
509
 
510
- uploader.bind('FilesAdded', function(up, selectedFiles) {
511
- var selectedCount = selectedFiles.length
512
- , extraCount = up.files.length + selectedCount - self.options.max_file_count
513
- ;
514
-
515
- if (extraCount > 0) {
516
- selectedFiles.splice(selectedCount - extraCount, extraCount);
517
-
518
- up.trigger('Error', {
519
- code : self.FILE_COUNT_ERROR,
520
- message : _('File count error.')
521
- });
522
- }
523
- });
524
- }
525
-
526
- // uploader internal events must run first
527
  uploader.init();
528
 
529
  uploader.bind('FileFiltered', function(up, file) {
530
  self._addFiles(file);
531
  });
532
-
533
  uploader.bind('FilesAdded', function(up, files) {
534
  self._trigger('selected', null, { up: up, files: files } );
535
 
536
  // re-enable sortable
537
  if (self.options.sortable && $.ui.sortable) {
538
- self._enableSortingList();
539
  }
540
 
541
  self._trigger('updatelist', null, { filelist: self.filelist });
542
-
543
  if (self.options.autostart) {
544
  // set a little delay to make sure that QueueChanged triggered by the core has time to complete
545
  setTimeout(function() {
@@ -547,43 +572,71 @@ $.widget("ui.plupload", {
547
  }, 10);
548
  }
549
  });
550
-
551
  uploader.bind('FilesRemoved', function(up, files) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
552
  self._trigger('removed', null, { up: up, files: files } );
553
  });
554
-
555
- uploader.bind('QueueChanged StateChanged', function() {
 
 
 
 
556
  self._handleState();
 
 
 
 
 
557
  });
558
-
559
  uploader.bind('UploadFile', function(up, file) {
560
  self._handleFileStatus(file);
561
  });
562
-
563
- uploader.bind('FileUploaded', function(up, file) {
564
  self._handleFileStatus(file);
565
- self._trigger('uploaded', null, { up: up, file: file } );
566
  });
567
-
568
  uploader.bind('UploadProgress', function(up, file) {
569
  self._handleFileStatus(file);
570
  self._updateTotalProgress();
571
  self._trigger('progress', null, { up: up, file: file } );
572
  });
573
-
574
  uploader.bind('UploadComplete', function(up, files) {
575
- self._addFormFields();
576
  self._trigger('complete', null, { up: up, files: files } );
577
  });
578
  },
579
 
580
-
581
  _setOption: function(key, value) {
582
  var self = this;
583
 
584
- if (key == 'buttons' && typeof(value) == 'object') {
585
  value = $.extend(self.options.buttons, value);
586
-
587
  if (!value.browse) {
588
  self.browse_button.button('disable').hide();
589
  self.uploader.disableBrowse(true);
@@ -591,24 +644,24 @@ $.widget("ui.plupload", {
591
  self.browse_button.button('enable').show();
592
  self.uploader.disableBrowse(false);
593
  }
594
-
595
  if (!value.start) {
596
  self.start_button.button('disable').hide();
597
  } else {
598
  self.start_button.button('enable').show();
599
  }
600
-
601
  if (!value.stop) {
602
  self.stop_button.button('disable').hide();
603
  } else {
604
- self.start_button.button('enable').show();
605
  }
606
  }
607
-
608
- self.uploader.settings[key] = value;
609
  },
610
 
611
-
612
  /**
613
  Start upload. Triggers `start` event.
614
 
@@ -616,10 +669,9 @@ $.widget("ui.plupload", {
616
  */
617
  start: function() {
618
  this.uploader.start();
619
- this._trigger('start', null, { up: this.uploader });
620
  },
621
 
622
-
623
  /**
624
  Stop upload. Triggers `stop` event.
625
 
@@ -627,7 +679,6 @@ $.widget("ui.plupload", {
627
  */
628
  stop: function() {
629
  this.uploader.stop();
630
- this._trigger('stop', null, { up: this.uploader });
631
  },
632
 
633
 
@@ -652,9 +703,9 @@ $.widget("ui.plupload", {
652
  this.uploader.disableBrowse(true);
653
  },
654
 
655
-
656
  /**
657
- Retrieve file by it's unique id.
658
 
659
  @method getFile
660
  @param {String} id Unique id of the file
@@ -662,18 +713,18 @@ $.widget("ui.plupload", {
662
  */
663
  getFile: function(id) {
664
  var file;
665
-
666
  if (typeof id === 'number') {
667
- file = this.uploader.files[id];
668
  } else {
669
- file = this.uploader.getFile(id);
670
  }
671
  return file;
672
  },
673
 
674
  /**
675
  Return array of files currently in the queue.
676
-
677
  @method getFiles
678
  @return {Array} Array of files in the queue represented by plupload.File objects
679
  */
@@ -681,21 +732,21 @@ $.widget("ui.plupload", {
681
  return this.uploader.files;
682
  },
683
 
684
-
685
  /**
686
  Remove the file from the queue.
687
 
688
  @method removeFile
689
- @param {plupload.File|String} file File to remove, might be specified directly or by it's unique id
690
  */
691
  removeFile: function(file) {
692
  if (plupload.typeOf(file) === 'string') {
693
  file = this.getFile(file);
694
  }
695
- this._removeFiles(file);
696
  },
697
 
698
-
699
  /**
700
  Clear the file queue.
701
 
@@ -739,12 +790,12 @@ $.widget("ui.plupload", {
739
  */
740
  notify: function(type, message) {
741
  var popup = $(
742
- '<div class="plupload_message">' +
743
  '<span class="plupload_message_close ui-icon ui-icon-circle-close" title="'+_('Close')+'"></span>' +
744
  '<p><span class="ui-icon"></span>' + message + '</p>' +
745
  '</div>'
746
  );
747
-
748
  popup
749
  .addClass('ui-state-' + (type === 'error' ? 'error' : 'highlight'))
750
  .find('p .ui-icon')
@@ -752,44 +803,42 @@ $.widget("ui.plupload", {
752
  .end()
753
  .find('.plupload_message_close')
754
  .click(function() {
755
- popup.remove();
756
  })
757
  .end();
758
-
759
  $('.plupload_header', this.container).append(popup);
760
  },
761
 
762
-
763
  /**
764
  Destroy the widget, the uploader, free associated resources and bring back original html.
765
 
766
  @method destroy
767
  */
768
  destroy: function() {
769
- this._removeFiles([].slice.call(this.uploader.files));
770
-
771
  // destroy uploader instance
772
  this.uploader.destroy();
773
 
774
  // unbind all button events
775
  $('.plupload_button', this.element).unbind();
776
-
777
  // destroy buttons
778
  if ($.ui.button) {
779
  $('.plupload_add, .plupload_start, .plupload_stop', this.container)
780
  .button('destroy');
781
  }
782
-
783
  // destroy progressbar
784
  if ($.ui.progressbar) {
785
- this.progressbar.progressbar('destroy');
786
  }
787
-
788
  // destroy sortable behavior
789
  if ($.ui.sortable && this.options.sortable) {
790
  $('tbody', this.filelist).sortable('destroy');
791
  }
792
-
793
  // restore the elements initial state
794
  this.element
795
  .empty()
@@ -798,42 +847,50 @@ $.widget("ui.plupload", {
798
 
799
  $.Widget.prototype.destroy.apply(this);
800
  },
801
-
802
-
803
  _handleState: function() {
804
- var up = this.uploader;
805
-
806
- if (up.state === plupload.STARTED) {
807
- $(this.start_button).button('disable');
808
-
 
809
  $([])
810
  .add(this.stop_button)
811
  .add('.plupload_started')
812
  .removeClass('plupload_hidden');
813
-
814
- $('.plupload_upload_status', this.element).html(o.sprintf(_('Uploaded %d/%d files'), up.total.uploaded, up.files.length));
 
 
 
 
 
 
 
815
  $('.plupload_header_content', this.element).addClass('plupload_header_content_bw');
816
- } else if (up.state === plupload.STOPPED) {
 
817
  $([])
818
  .add(this.stop_button)
819
  .add('.plupload_started')
820
  .addClass('plupload_hidden');
821
-
822
- if (this.options.multiple_queues) {
823
- $('.plupload_header_content', this.element).removeClass('plupload_header_content_bw');
824
  } else {
825
- $([])
826
- .add(this.browse_button)
827
- .add(this.start_button)
828
- .button('disable');
829
 
830
- up.disableBrowse();
 
831
  }
832
 
833
- if (up.files.length === (up.total.uploaded + up.total.failed)) {
834
- this.start_button.button('disable');
835
- } else {
836
- this.start_button.button('enable');
837
  }
838
 
839
  this._updateTotalProgress();
@@ -842,54 +899,57 @@ $.widget("ui.plupload", {
842
  if (up.total.queued === 0) {
843
  $('.ui-button-text', this.browse_button).html(_('Add Files'));
844
  } else {
845
- $('.ui-button-text', this.browse_button).html(o.sprintf(_('%d files queued'), up.total.queued));
846
  }
847
 
 
 
 
848
  up.refresh();
849
  },
850
-
851
-
852
  _handleFileStatus: function(file) {
853
- var self = this, actionClass, iconClass;
854
-
855
  // since this method might be called asynchronously, file row might not yet be rendered
856
- if (!$('#' + file.id).length) {
857
- return;
858
  }
859
 
860
  switch (file.status) {
861
- case plupload.DONE:
862
  actionClass = 'plupload_done';
863
- iconClass = 'ui-icon ui-icon-circle-check';
864
  break;
865
-
866
  case plupload.FAILED:
867
  actionClass = 'ui-state-error plupload_failed';
868
- iconClass = 'ui-icon ui-icon-alert';
869
  break;
870
 
871
  case plupload.QUEUED:
872
  actionClass = 'plupload_delete';
873
- iconClass = 'ui-icon ui-icon-circle-minus';
874
  break;
875
 
876
  case plupload.UPLOADING:
877
  actionClass = 'ui-state-highlight plupload_uploading';
878
- iconClass = 'ui-icon ui-icon-circle-arrow-w';
879
-
880
  // scroll uploading file into the view if its bottom boundary is out of it
881
  var scroller = $('.plupload_scroll', this.container)
882
  , scrollTop = scroller.scrollTop()
883
  , scrollerHeight = scroller.height()
884
- , rowOffset = $('#' + file.id).position().top + $('#' + file.id).height()
885
  ;
886
-
887
  if (scrollerHeight < rowOffset) {
888
  scroller.scrollTop(scrollTop + rowOffset - scrollerHeight);
889
- }
890
 
891
  // Set file specific progress
892
- $('#' + file.id)
893
  .find('.plupload_file_percent')
894
  .html(file.percent + '%')
895
  .end()
@@ -897,33 +957,26 @@ $.widget("ui.plupload", {
897
  .css('width', file.percent + '%')
898
  .end()
899
  .find('.plupload_file_size')
900
- .html(plupload.formatSize(file.size));
901
  break;
902
  }
903
  actionClass += ' ui-state-default plupload_file';
904
 
905
- $('#' + file.id)
906
  .attr('class', actionClass)
907
- .find('.ui-icon')
908
- .attr('class', iconClass)
909
- .end()
910
- .filter('.plupload_delete, .plupload_done, .plupload_failed')
911
- .find('.ui-icon')
912
- .click(function(e) {
913
- self._removeFiles(file);
914
- e.preventDefault();
915
- });
916
  },
917
-
918
-
919
  _updateTotalProgress: function() {
920
  var up = this.uploader;
921
 
922
  // Scroll to end of file list
923
  this.filelist[0].scrollTop = this.filelist[0].scrollHeight;
924
-
925
  this.progressbar.progressbar('value', up.total.percent);
926
-
927
  this.element
928
  .find('.plupload_total_status')
929
  .html(up.total.percent + '%')
@@ -932,7 +985,7 @@ $.widget("ui.plupload", {
932
  .html(plupload.formatSize(up.total.size))
933
  .end()
934
  .find('.plupload_upload_status')
935
- .html(o.sprintf(_('Uploaded %d/%d files'), up.total.uploaded, up.files.length));
936
  },
937
 
938
 
@@ -952,7 +1005,7 @@ $.widget("ui.plupload", {
952
 
953
  function onLast(el, eventName, cb) {
954
  var timer;
955
-
956
  el.on(eventName, function() {
957
  clearTimeout(timer);
958
  timer = setTimeout(function() {
@@ -981,15 +1034,15 @@ $.widget("ui.plupload", {
981
  // calculate index of virst visible thumb
982
  var startIdx = Math.floor(self.content.scrollTop() / th) * cols;
983
  // get potentially visible thumbs that are not yet visible
984
- thumbs = $('.plupload_file', self.filelist)
985
  .slice(startIdx, startIdx + num)
986
- .filter(':not(.plupload_file_thumb_loaded)')
987
  .get();
988
  }
989
-
990
 
991
  function init() {
992
- function mpl() {
993
  if (self.view_mode !== 'thumbs') {
994
  return;
995
  }
@@ -1012,25 +1065,37 @@ $.widget("ui.plupload", {
1012
 
1013
 
1014
  function preloadThumb(file, cb) {
1015
- var img = new o.Image();
 
1016
 
1017
  img.onload = function() {
1018
- var thumb = $('#' + file.id + ' .plupload_file_thumb', self.filelist).html('');
1019
- this.embed(thumb[0], {
1020
- width: 100,
1021
- height: 60,
1022
  crop: true,
1023
- swf_url: o.resolveUrl(self.options.flash_swf_url),
1024
- xap_url: o.resolveUrl(self.options.silverlight_xap_url)
 
 
1025
  });
1026
  };
1027
 
1028
- img.bind("embedded error", function() {
1029
- $('#' + file.id, self.filelist).addClass('plupload_file_thumb_loaded');
 
 
 
 
1030
  this.destroy();
1031
  setTimeout(cb, 1); // detach, otherwise ui might hang (in SilverLight for example)
1032
  });
1033
 
 
 
 
 
 
1034
  img.load(file.getSource());
1035
  }
1036
 
@@ -1038,7 +1103,7 @@ $.widget("ui.plupload", {
1038
  function lazyLoad() {
1039
  if (self.view_mode !== 'thumbs' || loading) {
1040
  return;
1041
- }
1042
 
1043
  pickThumbsToLoad();
1044
  if (!thumbs.length) {
@@ -1047,7 +1112,7 @@ $.widget("ui.plupload", {
1047
 
1048
  loading = true;
1049
 
1050
- preloadThumb(self.getFile($(thumbs.shift()).attr('id')), function() {
1051
  loading = false;
1052
  lazyLoad();
1053
  });
@@ -1062,19 +1127,23 @@ $.widget("ui.plupload", {
1062
 
1063
 
1064
  _addFiles: function(files) {
1065
- var self = this, file_html;
1066
 
1067
- file_html = '<li class="plupload_file ui-state-default" id="%id%">' +
1068
- '<div class="plupload_file_thumb">' +
1069
- '<div class="plupload_file_dummy ui-widget-content"><span class="ui-state-disabled">%ext%</span></div>' +
1070
  '</div>' +
1071
- '<div class="plupload_file_name" title="%name%"><span class="plupload_file_namespan">%name%</span></div>' +
1072
- '<div class="plupload_file_action"><div class="ui-icon"> </div></div>' +
1073
- '<div class="plupload_file_size">%size% </div>' +
1074
  '<div class="plupload_file_status">' +
1075
- '<div class="plupload_file_progress ui-widget-header" style="width: 0%"> </div>' +
1076
- '<span class="plupload_file_percent">%percent% </span>' +
 
 
 
 
 
 
1077
  '</div>' +
 
1078
  '<div class="plupload_file_fields"> </div>' +
1079
  '</li>';
1080
 
@@ -1083,51 +1152,27 @@ $.widget("ui.plupload", {
1083
  }
1084
 
1085
  $.each(files, function(i, file) {
1086
- var ext = o.Mime.getFileExtension(file.name) || 'none';
1087
-
1088
- self.filelist.append(file_html.replace(/%(\w+)%/g, function($0, $1) {
1089
- if ('size' === $1) {
1090
- return plupload.formatSize(file.size);
1091
- } else if ('ext' === $1) {
1092
- return ext;
1093
- } else {
1094
- return file[$1] || '';
1095
- }
1096
- }));
1097
-
1098
- self._handleFileStatus(file);
1099
- });
1100
- },
1101
 
 
 
 
 
 
1102
 
1103
- _removeFiles: function(files) {
1104
- var self = this, up = this.uploader;
1105
 
1106
- if (plupload.typeOf(files) !== 'array') {
1107
- files = [files];
1108
- }
1109
 
1110
- // destroy sortable if enabled
1111
- if ($.ui.sortable && this.options.sortable) {
1112
- $('tbody', self.filelist).sortable('destroy');
1113
- }
1114
-
1115
- $.each(files, function(i, file) {
1116
- $('#' + file.id).toggle("highlight", function() {
1117
- this.remove();
1118
  });
1119
- up.removeFile(file);
1120
  });
1121
 
1122
-
1123
- if (up.files.length) {
1124
- // re-initialize sortable
1125
- if (this.options.sortable && $.ui.sortable) {
1126
- this._enableSortingList();
1127
- }
1128
- }
1129
-
1130
- this._trigger('updatelist', null, { filelist: this.filelist });
1131
  },
1132
 
1133
 
@@ -1153,20 +1198,20 @@ $.widget("ui.plupload", {
1153
 
1154
  this.counter.val(this.uploader.files.length);
1155
  },
1156
-
1157
 
1158
  _viewChanged: function(view) {
1159
  // update or write a new cookie
1160
  if (this.options.views.remember && $.cookie) {
1161
  $.cookie('plupload_ui_view', view, { expires: 7, path: '/' });
1162
- }
1163
-
1164
  // ugly fix for IE6 - make content area stretchable
1165
- if (o.Env.browser === 'IE' && o.Env.version < 7) {
1166
- this.content.attr('style', 'height:expression(document.getElementById("' + this.id + '_container' + '").clientHeight - ' + (view === 'list' ? 133 : 103) + ');');
1167
  }
1168
 
1169
- this.container.removeClass('plupload_view_list plupload_view_thumbs').addClass('plupload_view_' + view);
1170
  this.view_mode = view;
1171
  this._trigger('viewchanged', null, { view: view });
1172
  },
@@ -1228,20 +1273,26 @@ $.widget("ui.plupload", {
1228
  this._displayThumbs();
1229
  }
1230
  },
1231
-
1232
-
1233
  _enableRenaming: function() {
1234
  var self = this;
1235
 
1236
  this.filelist.dblclick(function(e) {
1237
- var nameSpan = $(e.target), nameInput, file, parts, name, ext = "";
 
 
 
 
 
1238
 
1239
- if (!nameSpan.hasClass('plupload_file_namespan')) {
 
1240
  return;
1241
  }
1242
-
1243
  // Get file name and split out name and extension
1244
- file = self.uploader.getFile(nameSpan.closest('.plupload_file')[0].id);
1245
  name = file.name;
1246
  parts = /^(.+)(\.[^.]+)$/.exec(name);
1247
  if (parts) {
@@ -1269,39 +1320,39 @@ $.widget("ui.plupload", {
1269
  })[0].focus();
1270
  });
1271
  },
1272
-
1273
-
1274
  _enableSortingList: function() {
1275
  var self = this;
1276
-
1277
  if ($('.plupload_file', this.filelist).length < 2) {
1278
- return;
1279
  }
1280
 
1281
  // destroy sortable if enabled
1282
- $('tbody', this.filelist).sortable('destroy');
1283
-
1284
- // enable
1285
  this.filelist.sortable({
1286
  items: '.plupload_delete',
1287
-
1288
  cancel: 'object, .plupload_clearer',
1289
 
1290
  stop: function() {
1291
  var files = [];
1292
-
1293
  $.each($(this).sortable('toArray'), function(i, id) {
1294
  files[files.length] = self.uploader.getFile(id);
1295
- });
1296
-
1297
  files.unshift(files.length);
1298
  files.unshift(0);
1299
-
1300
- // re-populate files array
1301
- Array.prototype.splice.apply(self.uploader.files, files);
1302
  }
1303
- });
1304
  }
1305
  });
1306
 
1307
- } (window, document, plupload, mOxie, jQuery));
12
  * jquery.ui.widget.js
13
  * jquery.ui.button.js
14
  * jquery.ui.progressbar.js
15
+ *
16
  * Optionally:
17
  * jquery.ui.sortable.js
18
  */
22
  /**
23
  jQuery UI based implementation of the Plupload API - multi-runtime file uploading API.
24
 
25
+ To use the widget you must include _jQuery_ and _jQuery UI_ bundle (including `ui.core`, `ui.widget`, `ui.button`,
26
  `ui.progressbar` and `ui.sortable`).
27
 
28
+ In general the widget is designed the way that you do not usually need to do anything to it after you instantiate it.
29
+ But! You still can intervenue, to some extent, in case you need to. Although, due to the fact that widget is based on
30
  _jQuery UI_ widget factory, there are some specifics. See examples below for more details.
31
 
32
  @example
58
  @example
59
  // Subscribing to the events...
60
  // ... on initialization:
61
+ $('#uploader').plupload({
62
  ...
63
  viewchanged: function(event, args) {
64
  // stuff ...
75
  @param {String} settings.url URL of the server-side upload handler.
76
  @param {Number|String} [settings.chunk_size=0] Chunk size in bytes to slice the file into. Shorcuts with b, kb, mb, gb, tb suffixes also supported. `e.g. 204800 or "204800b" or "200kb"`. By default - disabled.
77
  @param {String} [settings.file_data_name="file"] Name for the file field in Multipart formated message.
78
+ @param {Object} [settings.filters={}] Set of file type filters.
79
+ @param {Array} [settings.filters.mime_types=[]] List of file types to accept, each one defined by title and list of extensions. `e.g. {title : "Image files", extensions : "jpg,jpeg,gif,png"}`. Dispatches `plupload.FILE_EXTENSION_ERROR`
80
+ @param {String|Number} [settings.filters.max_file_size=0] Maximum file size that the user can pick, in bytes. Optionally supports b, kb, mb, gb, tb suffixes. `e.g. "10mb" or "1gb"`. By default - not set. Dispatches `plupload.FILE_SIZE_ERROR`.
81
+ @param {Boolean} [settings.filters.prevent_duplicates=false] Do not let duplicates into the queue. Dispatches `plupload.FILE_DUPLICATE_ERROR`.
82
+ @param {Number} [settings.filters.max_file_count=0] Limit the number of files that can reside in the queue at the same time (default is 0 - no limit).
83
  @param {String} [settings.flash_swf_url] URL of the Flash swf.
84
  @param {Object} [settings.headers] Custom headers to send with the upload. Hash of name/value pairs.
85
  @param {Number|String} [settings.max_file_size] Maximum file size that the user can pick, in bytes. Optionally supports b, kb, mb, gb, tb suffixes. `e.g. "10mb" or "1gb"`. By default - not set. Dispatches `plupload.FILE_SIZE_ERROR`.
102
  @param {Boolean} [settings.dragdrop=true] Enable ability to add file to the queue by drag'n'dropping them from the desktop.
103
  @param {Boolean} [settings.rename=false] Enable ability to rename files in the queue.
104
  @param {Boolean} [settings.sortable=false] Enable ability to sort files in the queue, changing their uploading priority.
105
+ @param {Object} [settings.buttons] Control the visibility of functional buttons.
106
  @param {Boolean} [settings.buttons.browse=true] Display browse button.
107
  @param {Boolean} [settings.buttons.start=true] Display start button.
108
+ @param {Boolean} [settings.buttons.stop=true] Display stop button.
109
  @param {Object} [settings.views] Control various views of the file queue.
110
  @param {Boolean} [settings.views.list=true] Enable list view.
111
  @param {Boolean} [settings.views.thumbs=false] Enable thumbs view.
112
  @param {String} [settings.views.default='list'] Default view.
113
  @param {Boolean} [settings.views.remember=true] Whether to remember the current view (requires jQuery Cookie plugin).
114
  @param {Boolean} [settings.multiple_queues=true] Re-activate the widget after each upload procedure.
 
115
  */
116
+ ;(function(window, document, plupload, o, $) {
117
 
118
  /**
119
  Dispatched when the widget is initialized and ready.
141
  /**
142
  Dispatched when upload is started.
143
 
144
+ @event started
145
  @param {plupload.Uploader} uploader Uploader instance sending the event.
146
  */
147
 
148
  /**
149
  Dispatched when upload is stopped.
150
 
151
+ @event stopped
152
  @param {plupload.Uploader} uploader Uploader instance sending the event.
153
  */
154
 
198
  @param {Enum} status Status constant matching the plupload states QUEUED, UPLOADING, FAILED, DONE.
199
  */
200
 
201
+ var uploaders = {};
202
+
203
  function _(str) {
204
  return plupload.translate(str) || str;
205
  }
206
 
207
+ function renderUI(obj) {
208
  obj.id = obj.attr('id');
209
 
210
  obj.html(
213
  '<div class="ui-state-default ui-widget-header plupload_header">' +
214
  '<div class="plupload_header_content">' +
215
  '<div class="plupload_logo"> </div>' +
216
+ '<div class="plupload_header_title">' + _("Select files") + '</div>' +
217
+ '<div class="plupload_header_text">' + _("Add files to the upload queue and click the start button.") + '</div>' +
218
  '<div class="plupload_view_switch">' +
219
  '<input type="radio" id="'+obj.id+'_view_list" name="view_mode_'+obj.id+'" checked="checked" /><label class="plupload_button" for="'+obj.id+'_view_list" data-view="list">' + _('List') + '</label>' +
220
  '<input type="radio" id="'+obj.id+'_view_thumbs" name="view_mode_'+obj.id+'" /><label class="plupload_button" for="'+obj.id+'_view_thumbs" data-view="thumbs">' + _('Thumbnails') + '</label>' +
236
  '<ul class="plupload_filelist_content"> </ul>' +
237
  '<div class="plupload_clearer">&nbsp;</div>' +
238
  '</div>' +
239
+
240
  '<table class="plupload_filelist plupload_filelist_footer ui-widget-header">' +
241
  '<tr>' +
242
  '<td class="plupload_cell plupload_file_name">' +
243
  '<div class="plupload_buttons"><!-- Visible -->' +
244
+ '<a class="plupload_button plupload_add">' + _("Add Files") + '</a>&nbsp;' +
245
+ '<a class="plupload_button plupload_start">' + _("Start Upload") + '</a>&nbsp;' +
246
+ '<a class="plupload_button plupload_stop plupload_hidden">'+_("Stop Upload") + '</a>&nbsp;' +
247
  '</div>' +
248
 
249
  '<div class="plupload_started plupload_hidden"><!-- Hidden -->' +
272
  $.widget("ui.plupload", {
273
 
274
  widgetEventPrefix: '',
275
+
276
  contents_bak: '',
277
+
278
  options: {
279
  browse_button_hover: 'ui-state-hover',
280
  browse_button_active: 'ui-state-active',
281
+
282
+ filters: {},
283
+
284
  // widget specific
 
 
285
  buttons: {
286
  browse: true,
287
  start: true,
288
+ stop: true
289
  },
290
+
291
  views: {
292
  list: true,
293
  thumbs: false,
294
  active: 'list',
295
  remember: true // requires: https://github.com/carhartl/jquery-cookie, otherwise disabled even if set to true
296
  },
297
+
298
+ thumb_width: 100,
299
+ thumb_height: 60,
300
+
301
+ multiple_queues: true, // re-use widget by default
302
+ dragdrop : true,
303
  autostart: false,
304
  sortable: false,
305
+ rename: false
 
306
  },
307
+
308
  FILE_COUNT_ERROR: -9001,
309
+
310
  _create: function() {
311
  var id = this.element.attr('id');
312
  if (!id) {
314
  this.element.attr('id', id);
315
  }
316
  this.id = id;
317
+
318
  // backup the elements initial state
319
  this.contents_bak = this.element.html();
320
  renderUI(this.element);
321
+
322
  // container, just in case
323
+ this.container = $('.plupload_container', this.element).attr('id', id + '_container');
324
 
325
  this.content = $('.plupload_content', this.element);
326
+
327
  if ($.fn.resizable) {
328
+ this.container.resizable({
329
  handles: 's',
330
  minHeight: 300
331
  });
332
  }
333
+
334
  // list of files, may become sortable
335
  this.filelist = $('.plupload_filelist_content', this.container)
336
  .attr({
337
  id: id + '_filelist',
338
  unselectable: 'on'
339
  });
340
+
341
 
342
  // buttons
343
  this.browse_button = $('.plupload_add', this.container).attr('id', id + '_browse');
345
  this.stop_button = $('.plupload_stop', this.container).attr('id', id + '_stop');
346
  this.thumbs_switcher = $('#' + id + '_view_thumbs');
347
  this.list_switcher = $('#' + id + '_view_list');
348
+
349
  if ($.ui.button) {
350
  this.browse_button.button({
351
  icons: { primary: 'ui-icon-circle-plus' },
352
  disabled: true
353
  });
354
+
355
  this.start_button.button({
356
  icons: { primary: 'ui-icon-circle-arrow-e' },
357
  disabled: true
358
  });
359
+
360
  this.stop_button.button({
361
  icons: { primary: 'ui-icon-circle-close' }
362
  });
363
+
364
  this.list_switcher.button({
365
  text: false,
366
  icons: { secondary: "ui-icon-grip-dotted-horizontal" }
371
  icons: { secondary: "ui-icon-image" }
372
  });
373
  }
374
+
375
  // progressbar
376
+ this.progressbar = $('.plupload_progress_container', this.container);
377
+
378
  if ($.ui.progressbar) {
379
  this.progressbar.progressbar();
380
  }
381
+
382
  // counter
383
  this.counter = $('.plupload_count', this.element)
384
  .attr({
385
  id: id + '_count',
386
  name: id + '_count'
387
  });
388
+
389
  // initialize uploader instance
390
  this._initUploader();
391
  },
394
  var self = this
395
  , id = this.id
396
  , uploader
397
+ , options = {
398
  container: id + '_buttons',
399
  browse_button: id + '_browse'
400
  }
407
  options.drop_element = this.id + '_dropbox';
408
  }
409
 
410
+ this.filelist.on('click', function(e) {
411
+ var me = $(e.target), fileContainer;
412
+ if (me.hasClass('plupload_action_icon')) {
413
+ fileContainer = me.closest('.plupload_file');
414
+ if (fileContainer.hasClass('plupload_delete')) {
415
+ self.removeFile(fileContainer.attr('id'));
416
+ e.preventDefault();
417
+ }
418
+ }
419
+ });
420
+
421
  uploader = this.uploader = uploaders[id] = new plupload.Uploader($.extend(this.options, options));
422
 
423
+ // retrieve full normalized set of options
424
+ this.options = uploader.getOption();
425
+
426
  if (self.options.views.thumbs) {
427
  uploader.settings.required_features.display_media = true;
428
  }
429
 
430
+ // for backward compatibility
431
+ if (self.options.max_file_count) {
432
+ plupload.extend(uploader.getOption('filters'), {
433
+ max_file_count: self.options.max_file_count
434
+ });
435
+ }
436
 
437
+ plupload.addFileFilter('max_file_count', function(maxCount, file, cb) {
438
+ if (maxCount <= this.files.length - (this.total.uploaded + this.total.failed)) {
439
+ self.browse_button.button('disable');
440
+ this.disableBrowse();
441
+
442
+ this.trigger('Error', {
443
+ code : self.FILE_COUNT_ERROR,
444
+ message : _("File count error."),
445
+ file : file
446
+ });
447
+ cb(false);
448
+ } else {
449
+ cb(true);
450
+ }
451
+ });
452
+
453
+
454
+ uploader.bind('Error', function(up, err) {
455
  var message, details = "";
456
 
457
  message = '<strong>' + err.message + '</strong>';
458
+
459
  switch (err.code) {
460
  case plupload.FILE_EXTENSION_ERROR:
461
+ details = plupload.sprintf(_("File: %s"), err.file.name);
462
  break;
463
+
464
  case plupload.FILE_SIZE_ERROR:
465
+ details = plupload.sprintf(_("File: %s, size: %d, max file size: %d"), err.file.name, plupload.formatSize(err.file.size), plupload.formatSize(plupload.parseSize(up.getOption('filters').max_file_size)));
466
  break;
467
 
468
  case plupload.FILE_DUPLICATE_ERROR:
469
+ details = plupload.sprintf(_("%s already present in the queue."), err.file.name);
470
  break;
471
+
472
  case self.FILE_COUNT_ERROR:
473
+ details = plupload.sprintf(_("Upload element accepts only %d file(s) at a time. Extra files were stripped."), up.getOption('filters').max_file_count || 0);
474
  break;
475
+
476
  case plupload.IMAGE_FORMAT_ERROR :
477
  details = _("Image format either wrong or not supported.");
478
+ break;
479
+
480
  case plupload.IMAGE_MEMORY_ERROR :
481
  details = _("Runtime ran out of available memory.");
482
  break;
483
+
484
  /* // This needs a review
485
  case plupload.IMAGE_DIMENSIONS_ERROR :
486
+ details = plupload.sprintf(_('Resoultion out of boundaries! <b>%s</b> runtime supports images only up to %wx%hpx.'), up.runtime, up.features.maxWidth, up.features.maxHeight);
487
  break; */
488
+
489
  case plupload.HTTP_ERROR:
490
  details = _("Upload URL might be wrong or doesn't exist.");
491
  break;
505
  }
506
  });
507
 
508
+
509
+ uploader.bind('PostInit', function(up) {
510
  // all buttons are optional, so they can be disabled and hidden
511
  if (!self.options.buttons.browse) {
512
  self.browse_button.button('disable').hide();
514
  } else {
515
  self.browse_button.button('enable');
516
  }
517
+
518
  if (!self.options.buttons.start) {
519
  self.start_button.button('disable').hide();
520
+ }
521
+
522
  if (!self.options.buttons.stop) {
523
  self.stop_button.button('disable').hide();
524
  }
525
+
526
  if (!self.options.unique_names && self.options.rename) {
527
+ self._enableRenaming();
528
  }
529
 
530
  if (self.options.dragdrop && up.features.dragdrop) {
532
  }
533
 
534
  self._enableViewSwitcher();
535
+
536
  self.start_button.click(function(e) {
537
  if (!$(this).button('option', 'disabled')) {
538
  self.start();
547
 
548
  self._trigger('ready', null, { up: up });
549
  });
 
 
 
 
 
550
 
551
+ // uploader internal events must run first
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
552
  uploader.init();
553
 
554
  uploader.bind('FileFiltered', function(up, file) {
555
  self._addFiles(file);
556
  });
557
+
558
  uploader.bind('FilesAdded', function(up, files) {
559
  self._trigger('selected', null, { up: up, files: files } );
560
 
561
  // re-enable sortable
562
  if (self.options.sortable && $.ui.sortable) {
563
+ self._enableSortingList();
564
  }
565
 
566
  self._trigger('updatelist', null, { filelist: self.filelist });
567
+
568
  if (self.options.autostart) {
569
  // set a little delay to make sure that QueueChanged triggered by the core has time to complete
570
  setTimeout(function() {
572
  }, 10);
573
  }
574
  });
575
+
576
  uploader.bind('FilesRemoved', function(up, files) {
577
+ // destroy sortable if enabled
578
+ if ($.ui.sortable && self.options.sortable) {
579
+ $('tbody', self.filelist).sortable('destroy');
580
+ }
581
+
582
+ $.each(files, function(i, file) {
583
+ $('#' + file.id).toggle("highlight", function() {
584
+ $(this).remove();
585
+ });
586
+ });
587
+
588
+ if (up.files.length) {
589
+ // re-initialize sortable
590
+ if (self.options.sortable && $.ui.sortable) {
591
+ self._enableSortingList();
592
+ }
593
+ }
594
+
595
+ self._trigger('updatelist', null, { filelist: self.filelist });
596
  self._trigger('removed', null, { up: up, files: files } );
597
  });
598
+
599
+ uploader.bind('QueueChanged', function() {
600
+ self._handleState();
601
+ });
602
+
603
+ uploader.bind('StateChanged', function(up) {
604
  self._handleState();
605
+ if (plupload.STARTED === up.state) {
606
+ self._trigger('started', null, { up: this.uploader });
607
+ } else if (plupload.STOPPED === up.state) {
608
+ self._trigger('stopped', null, { up: this.uploader });
609
+ }
610
  });
611
+
612
  uploader.bind('UploadFile', function(up, file) {
613
  self._handleFileStatus(file);
614
  });
615
+
616
+ uploader.bind('FileUploaded', function(up, file, result) {
617
  self._handleFileStatus(file);
618
+ self._trigger('uploaded', null, { up: up, file: file, result: result } );
619
  });
620
+
621
  uploader.bind('UploadProgress', function(up, file) {
622
  self._handleFileStatus(file);
623
  self._updateTotalProgress();
624
  self._trigger('progress', null, { up: up, file: file } );
625
  });
626
+
627
  uploader.bind('UploadComplete', function(up, files) {
628
+ self._addFormFields();
629
  self._trigger('complete', null, { up: up, files: files } );
630
  });
631
  },
632
 
633
+
634
  _setOption: function(key, value) {
635
  var self = this;
636
 
637
+ if (key == 'buttons' && typeof(value) == 'object') {
638
  value = $.extend(self.options.buttons, value);
639
+
640
  if (!value.browse) {
641
  self.browse_button.button('disable').hide();
642
  self.uploader.disableBrowse(true);
644
  self.browse_button.button('enable').show();
645
  self.uploader.disableBrowse(false);
646
  }
647
+
648
  if (!value.start) {
649
  self.start_button.button('disable').hide();
650
  } else {
651
  self.start_button.button('enable').show();
652
  }
653
+
654
  if (!value.stop) {
655
  self.stop_button.button('disable').hide();
656
  } else {
657
+ self.start_button.button('enable').show();
658
  }
659
  }
660
+
661
+ self.uploader.setOption(key, value);
662
  },
663
 
664
+
665
  /**
666
  Start upload. Triggers `start` event.
667
 
669
  */
670
  start: function() {
671
  this.uploader.start();
 
672
  },
673
 
674
+
675
  /**
676
  Stop upload. Triggers `stop` event.
677
 
679
  */
680
  stop: function() {
681
  this.uploader.stop();
 
682
  },
683
 
684
 
703
  this.uploader.disableBrowse(true);
704
  },
705
 
706
+
707
  /**
708
+ Retrieve file by its unique id.
709
 
710
  @method getFile
711
  @param {String} id Unique id of the file
713
  */
714
  getFile: function(id) {
715
  var file;
716
+
717
  if (typeof id === 'number') {
718
+ file = this.uploader.files[id];
719
  } else {
720
+ file = this.uploader.getFile(id);
721
  }
722
  return file;
723
  },
724
 
725
  /**
726
  Return array of files currently in the queue.
727
+
728
  @method getFiles
729
  @return {Array} Array of files in the queue represented by plupload.File objects
730
  */
732
  return this.uploader.files;
733
  },
734
 
735
+
736
  /**
737
  Remove the file from the queue.
738
 
739
  @method removeFile
740
+ @param {plupload.File|String} file File to remove, might be specified directly or by its unique id
741
  */
742
  removeFile: function(file) {
743
  if (plupload.typeOf(file) === 'string') {
744
  file = this.getFile(file);
745
  }
746
+ this.uploader.removeFile(file);
747
  },
748
 
749
+
750
  /**
751
  Clear the file queue.
752
 
790
  */
791
  notify: function(type, message) {
792
  var popup = $(
793
+ '<div class="plupload_message">' +
794
  '<span class="plupload_message_close ui-icon ui-icon-circle-close" title="'+_('Close')+'"></span>' +
795
  '<p><span class="ui-icon"></span>' + message + '</p>' +
796
  '</div>'
797
  );
798
+
799
  popup
800
  .addClass('ui-state-' + (type === 'error' ? 'error' : 'highlight'))
801
  .find('p .ui-icon')
803
  .end()
804
  .find('.plupload_message_close')
805
  .click(function() {
806
+ popup.remove();
807
  })
808
  .end();
809
+
810
  $('.plupload_header', this.container).append(popup);
811
  },
812
 
813
+
814
  /**
815
  Destroy the widget, the uploader, free associated resources and bring back original html.
816
 
817
  @method destroy
818
  */
819
  destroy: function() {
 
 
820
  // destroy uploader instance
821
  this.uploader.destroy();
822
 
823
  // unbind all button events
824
  $('.plupload_button', this.element).unbind();
825
+
826
  // destroy buttons
827
  if ($.ui.button) {
828
  $('.plupload_add, .plupload_start, .plupload_stop', this.container)
829
  .button('destroy');
830
  }
831
+
832
  // destroy progressbar
833
  if ($.ui.progressbar) {
834
+ this.progressbar.progressbar('destroy');
835
  }
836
+
837
  // destroy sortable behavior
838
  if ($.ui.sortable && this.options.sortable) {
839
  $('tbody', this.filelist).sortable('destroy');
840
  }
841
+
842
  // restore the elements initial state
843
  this.element
844
  .empty()
847
 
848
  $.Widget.prototype.destroy.apply(this);
849
  },
850
+
851
+
852
  _handleState: function() {
853
+ var up = this.uploader
854
+ , filesPending = up.files.length - (up.total.uploaded + up.total.failed)
855
+ , maxCount = up.getOption('filters').max_file_count || 0
856
+ ;
857
+
858
+ if (plupload.STARTED === up.state) {
859
  $([])
860
  .add(this.stop_button)
861
  .add('.plupload_started')
862
  .removeClass('plupload_hidden');
863
+
864
+ this.start_button.button('disable');
865
+
866
+ if (!this.options.multiple_queues) {
867
+ this.browse_button.button('disable');
868
+ up.disableBrowse();
869
+ }
870
+
871
+ $('.plupload_upload_status', this.element).html(plupload.sprintf(_('Uploaded %d/%d files'), up.total.uploaded, up.files.length));
872
  $('.plupload_header_content', this.element).addClass('plupload_header_content_bw');
873
+ }
874
+ else if (plupload.STOPPED === up.state) {
875
  $([])
876
  .add(this.stop_button)
877
  .add('.plupload_started')
878
  .addClass('plupload_hidden');
879
+
880
+ if (filesPending) {
881
+ this.start_button.button('enable');
882
  } else {
883
+ this.start_button.button('disable');
884
+ }