Gallery – Flagallery Photo Portfolio - Version 5.1.8

Version Description

Download this release

Release Info

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

Code changes from version 4.36 to 5.1.8

Files changed (121) hide show
  1. license.txt → _license.txt +0 -0
  2. admin/addgallery.php +31 -36
  3. admin/admin.php +97 -38
  4. admin/ajax.php +160 -21
  5. admin/banner-box.php +48 -48
  6. admin/banner-sort.php +14 -14
  7. admin/banner.functions.php +164 -172
  8. admin/css/flagadmin.css +327 -8
  9. admin/css/flagallery.css +0 -9
  10. admin/css/flagallery_nocrawler.css +0 -12
  11. admin/css/flagallery_noflash.css +0 -26
  12. admin/css/tabs.css +6 -2
  13. admin/db_skin_color_scheme.php +0 -154
  14. admin/flag_install.php +215 -237
  15. admin/flagframe-tool.php +96 -79
  16. admin/functions.php +372 -349
  17. admin/get_skin.php +3 -2
  18. admin/grab_meta.php +5 -5
  19. admin/images/appstore_button.png +0 -0
  20. admin/images/like.png +0 -0
  21. admin/images/views.png +0 -0
  22. admin/jgallery.php +0 -159
  23. admin/js/disablescroll.js +0 -55
  24. admin/js/farbtastic-nosharp.js +0 -345
  25. admin/js/flag.ajax.js +1 -1
  26. admin/js/flagscroll.js +0 -33
  27. admin/js/images/fancy_close.png +0 -0
  28. admin/js/images/fancy_loading.png +0 -0
  29. admin/js/images/fancy_nav_left.png +0 -0
  30. admin/js/images/fancy_nav_right.png +0 -0
  31. admin/js/images/fancy_nav_slide.png +0 -0
  32. admin/js/images/fancy_shadow_n.png +0 -0
  33. admin/js/images/fancy_shadow_s.png +0 -0
  34. admin/js/images/fancy_shadow_w.png +0 -0
  35. admin/js/images/fancy_title_over.png +0 -0
  36. admin/js/images/fancybox-y.png +0 -0
  37. admin/js/jquery.fancybox-1.3.4.pack.js +0 -46
  38. admin/js/jquery.js +0 -18
  39. admin/js/jqueryFileTree/images/zip.png +0 -0
  40. admin/js/loader.swf +0 -0
  41. admin/js/photoswipe/images/icons.png +0 -0
  42. admin/js/photoswipe/images/icons@2x.png +0 -0
  43. admin/js/photoswipe/klass.min.js +0 -8
  44. admin/js/plupload/jquery.ui.plupload/img/plupload.png +0 -0
  45. admin/js/script.js +0 -292
  46. admin/js/swfaddress-optimizer.js +0 -1
  47. admin/js/swfaddress.js +0 -1
  48. admin/js/swfmousewheel.js +0 -51
  49. admin/js/swfobject.js +0 -31
  50. admin/js/themes/default/arrows.png +0 -0
  51. admin/js/themes/default/bullets.png +0 -0
  52. admin/js/widgets_admin.js +1 -1
  53. admin/manage-banner.php +45 -41
  54. admin/manage-galleries.php +407 -363
  55. admin/manage-images.php +63 -68
  56. admin/manage-playlist.php +58 -54
  57. admin/manage-sort.php +16 -16
  58. admin/manage-video.php +44 -39
  59. admin/manage.php +22 -24
  60. admin/manage_thumbnail.php +12 -19
  61. admin/media-upload.php +9 -9
  62. admin/meta_box.php +45 -67
  63. admin/music-box.php +52 -58
  64. admin/overview.php +94 -73
  65. admin/playlist-sort.php +14 -15
  66. admin/playlist.functions.php +171 -134
  67. admin/settings.php +620 -571
  68. admin/showmeta.php +14 -14
  69. admin/skin_functions.php +200 -0
  70. admin/skin_install.php +14 -14
  71. admin/skin_options.php +58 -105
  72. admin/skins.php +637 -553
  73. admin/tinymce/editor_plugin.js +2 -2
  74. admin/tinymce/img/butt2.png +0 -0
  75. admin/tinymce/img/button_bg.png +0 -0
  76. admin/tinymce/img/fade-butt.png +0 -0
  77. admin/tinymce/langs/de.js +1 -1
  78. admin/tinymce/langs/de_de.js +1 -1
  79. admin/tinymce/langs/en.js +1 -1
  80. admin/tinymce/langs/en_US.js +1 -1
  81. admin/tinymce/tinymce.php +3 -6
  82. admin/tinymce/window.php +59 -81
  83. admin/tuning.php +11 -8
  84. admin/upgrade.php +36 -43
  85. admin/video-box.php +52 -52
  86. admin/video-sort.php +14 -14
  87. admin/video.functions.php +174 -136
  88. admin/{flv_preview.php → video_preview.php} +0 -1
  89. admin/wpmu.php +11 -11
  90. assets/fancybox/images/blank.gif +0 -0
  91. assets/fancybox/images/fancy_close.png +0 -0
  92. assets/fancybox/images/fancy_loading.png +0 -0
  93. assets/fancybox/images/fancy_nav_left.png +0 -0
  94. assets/fancybox/images/fancy_nav_right.png +0 -0
  95. assets/fancybox/images/fancy_nav_slide.png +0 -0
  96. {admin/js → assets/fancybox}/images/fancy_shadow_e.png +0 -0
  97. assets/fancybox/images/fancy_shadow_n.png +0 -0
  98. {admin/js → assets/fancybox}/images/fancy_shadow_ne.png +0 -0
  99. {admin/js → assets/fancybox}/images/fancy_shadow_nw.png +0 -0
  100. assets/fancybox/images/fancy_shadow_s.png +0 -0
  101. {admin/js → assets/fancybox}/images/fancy_shadow_se.png +0 -0
  102. {admin/js → assets/fancybox}/images/fancy_shadow_sw.png +0 -0
  103. assets/fancybox/images/fancy_shadow_w.png +0 -0
  104. {admin/js → assets/fancybox}/images/fancy_title_left.png +0 -0
  105. {admin/js → assets/fancybox}/images/fancy_title_main.png +0 -0
  106. assets/fancybox/images/fancy_title_over.png +0 -0
  107. {admin/js → assets/fancybox}/images/fancy_title_right.png +0 -0
  108. {admin/js → assets/fancybox}/images/fancybox-x.png +0 -0
  109. assets/fancybox/images/fancybox-y.png +0 -0
  110. {admin/js → assets/fancybox}/images/fancybox.png +0 -0
  111. {admin/js → assets/fancybox}/jquery.fancybox-1.3.4.css +0 -0
  112. assets/fancybox/jquery.fancybox-1.3.4.pack.js +1 -0
  113. assets/flagallery.css +4 -0
  114. assets/jplayer/jquery.jplayer.min.js +3 -0
  115. assets/jplayer/jquery.jplayer.swf +0 -0
  116. admin/js/jquery.easing-1.3.pack.js → assets/jq-plugins/jquery.easing.js +19 -2
  117. assets/mag-popup/LICENSE.txt +20 -0
  118. assets/mag-popup/jquery.magnific-popup.js +1860 -0
  119. assets/mag-popup/jquery.magnific-popup.min.js +4 -0
  120. assets/mag-popup/magnific-popup.css +351 -0
  121. assets/mediaelement/mediaelement-and-player.min.js +12 -0
license.txt → _license.txt RENAMED
File without changes
admin/addgallery.php CHANGED
@@ -28,15 +28,14 @@ function flag_admin_add_gallery() {
28
  if ( $_POST['uploadimage'] ) {
29
  check_admin_referer( 'flag_upload' );
30
 
31
- $flag->options['thumbWidth'] = intval( $_POST['thumbWidth'] ) ? intval( $_POST['thumbWidth'] ) : 100;
32
- $flag->options['thumbHeight'] = intval( $_POST['thumbHeight'] ) ? intval( $_POST['thumbHeight'] ) : 100;
33
- $flag->options['thumbFix'] = isset( $_POST['thumbFix'] ) ? 1 : 0;
34
  update_option( 'flag_options', $flag->options );
35
 
36
  if ( $_FILES['MF__F_0_0']['error'] == 0 ) {
37
  flagAdmin::upload_images();
38
  } else {
39
- flagGallery::show_error( __( 'Upload failed!', 'flag' ) );
40
  }
41
  }
42
  if ( $_POST['importfolder'] ) {
@@ -89,36 +88,36 @@ function flag_admin_add_gallery() {
89
  <div id="slider" class="flag-wrap">
90
 
91
  <ul id="tabs" class="tabs">
92
- <li class="selected"><a href="#" rel="addgallery"><?php _e( 'Add new gallery', 'flag' ); ?></a></li>
93
- <li><a href="#" rel="uploadimage"><?php _e( 'Upload Images', 'flag' ); ?></a></li>
94
  <?php if ( ! IS_WPMU || current_user_can( 'FlAG Import folder' ) ) { ?>
95
- <li><a href="#" rel="importfolder"><?php _e( 'Import image folder', 'flag' ); ?></a></li>
96
  <?php } ?>
97
  </ul>
98
 
99
  <!-- create gallery -->
100
  <div id="addgallery" class="cptab">
101
- <h2><?php _e( 'Create a new gallery', 'flag' ); ?></h2>
102
 
103
  <form name="addgallery" id="addgallery_form" method="POST" action="<?php echo $filepath; ?>" accept-charset="utf-8">
104
  <?php wp_nonce_field( 'flag_addgallery' ); ?>
105
  <table class="form-table" style="width: auto;">
106
  <tr>
107
  <th scope="col" colspan="2" style="padding-bottom: 0;">
108
- <strong><?php _e( 'New Gallery', 'flag' ); ?></strong></th>
109
  </tr>
110
  <tr valign="top">
111
  <td><input type="text" size="65" name="galleryname" value=""/><br/>
112
  <?php if ( ! IS_WPMU ) { ?>
113
- <?php _e( 'Create a new , empty gallery below the folder', 'flag' ); ?>
114
  <strong><?php echo $defaultpath; ?></strong><br/>
115
  <?php } ?>
116
- <i>( <?php _e( 'Allowed characters for file and folder names are', 'flag' ); ?>: a-z, A-Z, 0-9, -, _ )</i>
117
  </td>
118
  <?php do_action( 'flag_add_new_gallery_form' ); ?>
119
- <td>
120
  <div class="submit" style="margin: 0; padding: 0;">
121
- <input class="button-primary" type="submit" name="addgallery" value="<?php _e( 'Add gallery', 'flag' ); ?>"/>
122
  </div>
123
  </td>
124
  </tr>
@@ -128,16 +127,16 @@ function flag_admin_add_gallery() {
128
  </div>
129
  <!-- upload images -->
130
  <div id="uploadimage" class="cptab">
131
- <h2><?php _e( 'Upload images', 'flag' ); ?></h2>
132
 
133
  <form name="uploadimage" id="gmUpload" method="POST" enctype="multipart/form-data" action="<?php echo $filepath; ?>" accept-charset="utf-8">
134
  <?php wp_nonce_field( 'flag_upload' ); ?>
135
  <table class="flag-form-table">
136
  <tr valign="top">
137
  <td style="width: 216px;">
138
- <label for="galleryselect"><?php _e( 'Upload images in', 'flag' ); ?> *</label>
139
  <select name="galleryselect" id="galleryselect" style="width: 200px">
140
- <option value="0"><?php _e( 'Choose gallery', 'flag' ); ?></option>
141
  <?php $ingallery = isset( $_GET['gid'] ) ? (int) $_GET['gid'] : '';
142
  foreach ( $gallerylist as $gallery ) {
143
  if ( ! flagAdmin::can_manage_this_gallery( $gallery->author ) ) {
@@ -160,22 +159,19 @@ function flag_admin_add_gallery() {
160
  } ?>
161
  <br/>
162
 
163
- <p><?php _e( 'Thumbnail WIDTH x HEIGHT (in pixel)', 'flag' ); ?> *
164
- <br/><input type="text" size="5" maxlength="5" name="thumbWidth" id="thumbWidth" value="<?php echo $flag->options['thumbWidth']; ?>"/> x
165
- <input type="text" size="5" maxlength="5" name="thumbHeight" id="thumbHeight" value="<?php echo $flag->options['thumbHeight']; ?>"/>
166
  <br/>
167
- <small><?php _e( 'These values are maximum values ', 'flag' ); ?></small>
168
  </p>
169
- <p>
170
- <label><input type="checkbox" name="thumbFix" id="thumbFix" value="1" <?php checked( '1', $flag->options['thumbFix'] ); ?> /> <?php _e( 'Ignore the aspect ratio, no portrait thumbnails', 'flag' ); ?>
171
- </label></p>
172
 
173
  <div class="submit">
174
  <span class="useflashupload">
175
  <?php if ( $flag->options['swfUpload'] ) { ?>
176
- <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', 'flag' ); ?>" value="<?php _e( 'Switch to Browser Upload', 'flag' ); ?>"/>
177
  <?php } else { ?>
178
- <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', 'flag' ); ?>" value="<?php _e( 'Switch to Plupload based Upload', 'flag' ); ?>"/>
179
  <?php } ?>
180
  </span>
181
 
@@ -187,11 +183,11 @@ function flag_admin_add_gallery() {
187
  <td>
188
  <div id="pluploadUploader">
189
  <?php if ( ! $flag->options['swfUpload']) { ?>
190
- <strong><?php _e( 'Upload image(s):', 'flag' ); ?></strong><br>
191
  <input type="file" name="imagefiles[]" id="imagefiles" size="35" class="imagefiles"/>
192
  </div>
193
  <span id="choosegalfirst">
194
- <input class="button-primary" type="submit" name="uploadimage" id="uploadimage_btn" value="<?php _e( 'Upload images', 'flag' ); ?>"/>
195
  <span class="disabledbut" style="display: none;"></span>
196
  </span>
197
  <?php } ?>
@@ -239,7 +235,6 @@ function flag_admin_add_gallery() {
239
  galleryselect: jQuery('#galleryselect').val(),
240
  thumbw: jQuery('#thumbWidth').val(),
241
  thumbh: jQuery('#thumbHeight').val(),
242
- thumbf: jQuery('#thumbFix').prop("checked"),
243
  last: files_remaining,
244
  action: 'flag_plupload_uploader',
245
  _wpnonce: '<?php echo $nonce; ?>'
@@ -280,7 +275,7 @@ function flag_admin_add_gallery() {
280
  });
281
  uploader.bind('UploadComplete', function(up, files){
282
  console.log('[UploadComplete]', files);
283
- jQuery('<div/>').addClass('success').html('<?php _e('Done!', 'flag'); ?> <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');
284
  });
285
 
286
  jQuery("#gmUpload").on('click', '.ui-button-disabled', function(){
@@ -307,7 +302,7 @@ function flag_admin_add_gallery() {
307
  jQuery(document).ready(function(){
308
  jQuery('#imagefiles').MultiFile({
309
  STRING: {
310
- remove: '<?php _e('remove', 'flag'); ?>'
311
  }
312
  });
313
 
@@ -336,26 +331,26 @@ function flag_admin_add_gallery() {
336
  <?php if ( ! IS_WPMU || current_user_can( 'FlAG Import folder' ) ) { ?>
337
  <!-- import folder -->
338
  <div id="importfolder" class="cptab">
339
- <h2><?php _e( 'Import image folder', 'flag' ); ?></h2>
340
 
341
  <form name="importfolder" id="importfolder_form" method="POST" action="<?php echo $filepath; ?>" accept-charset="utf-8">
342
  <?php wp_nonce_field( 'flag_addgallery' ); ?>
343
  <table class="form-table">
344
  <tr valign="top">
345
- <th scope="row"><?php _e( 'Import from Server path:', 'flag' ); ?></th>
346
  <td>
347
- <input type="text" size="35" id="galleryfolder" name="galleryfolder" value="<?php echo $defaultpath; ?>"/><span class="browsefiles button" style="display:none"><?php _e( 'Browse...', "flag" ); ?></span>
348
 
349
  <div id="file_browser"></div>
350
  <div><?php echo $maxsize; ?>
351
- <?php if ( SAFE_MODE ) { ?>
352
- <br/><?php _e( ' Please note : For safe-mode = ON you need to add the subfolder thumbs manually', 'flag' ); ?><?php }; ?>
353
  </div>
354
  </td>
355
  </tr>
356
  </table>
357
  <div class="submit">
358
- <input class="button-primary" type="submit" name="importfolder" value="<?php _e( 'Import folder', 'flag' ); ?>"/>
359
  </div>
360
  </form>
361
  </div>
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'] ) {
88
  <div id="slider" class="flag-wrap">
89
 
90
  <ul id="tabs" class="tabs">
91
+ <li class="selected"><a href="#" rel="addgallery"><?php _e( 'Add new gallery', 'flash-album-gallery' ); ?></a></li>
92
+ <li><a href="#" rel="uploadimage"><?php _e( 'Upload Images', 'flash-album-gallery' ); ?></a></li>
93
  <?php if ( ! IS_WPMU || current_user_can( 'FlAG Import folder' ) ) { ?>
94
+ <li><a href="#" rel="importfolder"><?php _e( 'Import image folder', 'flash-album-gallery' ); ?></a></li>
95
  <?php } ?>
96
  </ul>
97
 
98
  <!-- create gallery -->
99
  <div id="addgallery" class="cptab">
100
+ <h2><?php _e( 'Create a new gallery', 'flash-album-gallery' ); ?></h2>
101
 
102
  <form name="addgallery" id="addgallery_form" method="POST" action="<?php echo $filepath; ?>" accept-charset="utf-8">
103
  <?php wp_nonce_field( 'flag_addgallery' ); ?>
104
  <table class="form-table" style="width: auto;">
105
  <tr>
106
  <th scope="col" colspan="2" style="padding-bottom: 0;">
107
+ <strong><?php _e( 'New Gallery', 'flash-album-gallery' ); ?></strong></th>
108
  </tr>
109
  <tr valign="top">
110
  <td><input type="text" size="65" name="galleryname" value=""/><br/>
111
  <?php if ( ! IS_WPMU ) { ?>
112
+ <?php _e( 'Create a new , empty gallery below the folder', 'flash-album-gallery' ); ?>
113
  <strong><?php echo $defaultpath; ?></strong><br/>
114
  <?php } ?>
115
+ <i>( <?php _e( 'Allowed characters for file and folder names are', 'flash-album-gallery' ); ?>: a-z, A-Z, 0-9, -, _ )</i>
116
  </td>
117
  <?php do_action( 'flag_add_new_gallery_form' ); ?>
118
+ <td style="vertical-align:top;">
119
  <div class="submit" style="margin: 0; padding: 0;">
120
+ <input class="button-primary" type="submit" name="addgallery" value="<?php _e( 'Add gallery', 'flash-album-gallery' ); ?>"/>
121
  </div>
122
  </td>
123
  </tr>
127
  </div>
128
  <!-- upload images -->
129
  <div id="uploadimage" class="cptab">
130
+ <h2><?php _e( 'Upload images', 'flash-album-gallery' ); ?></h2>
131
 
132
  <form name="uploadimage" id="gmUpload" method="POST" enctype="multipart/form-data" action="<?php echo $filepath; ?>" accept-charset="utf-8">
133
  <?php wp_nonce_field( 'flag_upload' ); ?>
134
  <table class="flag-form-table">
135
  <tr valign="top">
136
  <td style="width: 216px;">
137
+ <label for="galleryselect"><?php _e( 'Upload images in', 'flash-album-gallery' ); ?> *</label>
138
  <select name="galleryselect" id="galleryselect" style="width: 200px">
139
+ <option value="0"><?php _e( 'Choose gallery', 'flash-album-gallery' ); ?></option>
140
  <?php $ingallery = isset( $_GET['gid'] ) ? (int) $_GET['gid'] : '';
141
  foreach ( $gallerylist as $gallery ) {
142
  if ( ! flagAdmin::can_manage_this_gallery( $gallery->author ) ) {
159
  } ?>
160
  <br/>
161
 
162
+ <p><?php _e( 'Thumbnail WIDTH x HEIGHT (in pixel)', 'flash-album-gallery' ); ?> *
163
+ <br/><input type="number" size="5" maxlength="5" min="300" max="800" name="thumbWidth" id="thumbWidth" value="<?php echo $flag->options['thumbWidth']; ?>"/> x
164
+ <input type="number" size="5" maxlength="5" min="300" max="800" name="thumbHeight" id="thumbHeight" value="<?php echo $flag->options['thumbHeight']; ?>"/>
165
  <br/>
166
+ <small><?php _e( 'These values are maximum values ', 'flash-album-gallery' ); ?></small>
167
  </p>
 
 
 
168
 
169
  <div class="submit">
170
  <span class="useflashupload">
171
  <?php if ( $flag->options['swfUpload'] ) { ?>
172
+ <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' ); ?>"/>
173
  <?php } else { ?>
174
+ <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' ); ?>"/>
175
  <?php } ?>
176
  </span>
177
 
183
  <td>
184
  <div id="pluploadUploader">
185
  <?php if ( ! $flag->options['swfUpload']) { ?>
186
+ <strong><?php _e( 'Upload image(s):', 'flash-album-gallery' ); ?></strong><br>
187
  <input type="file" name="imagefiles[]" id="imagefiles" size="35" class="imagefiles"/>
188
  </div>
189
  <span id="choosegalfirst">
190
+ <input class="button-primary" type="submit" name="uploadimage" id="uploadimage_btn" value="<?php _e( 'Upload images', 'flash-album-gallery' ); ?>"/>
191
  <span class="disabledbut" style="display: none;"></span>
192
  </span>
193
  <?php } ?>
235
  galleryselect: jQuery('#galleryselect').val(),
236
  thumbw: jQuery('#thumbWidth').val(),
237
  thumbh: jQuery('#thumbHeight').val(),
 
238
  last: files_remaining,
239
  action: 'flag_plupload_uploader',
240
  _wpnonce: '<?php echo $nonce; ?>'
275
  });
276
  uploader.bind('UploadComplete', function(up, files){
277
  console.log('[UploadComplete]', files);
278
+ 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');
279
  });
280
 
281
  jQuery("#gmUpload").on('click', '.ui-button-disabled', function(){
302
  jQuery(document).ready(function(){
303
  jQuery('#imagefiles').MultiFile({
304
  STRING: {
305
+ remove: '<?php _e('remove', 'flash-album-gallery'); ?>'
306
  }
307
  });
308
 
331
  <?php if ( ! IS_WPMU || current_user_can( 'FlAG Import folder' ) ) { ?>
332
  <!-- import folder -->
333
  <div id="importfolder" class="cptab">
334
+ <h2><?php _e( 'Import image folder', 'flash-album-gallery' ); ?></h2>
335
 
336
  <form name="importfolder" id="importfolder_form" method="POST" action="<?php echo $filepath; ?>" accept-charset="utf-8">
337
  <?php wp_nonce_field( 'flag_addgallery' ); ?>
338
  <table class="form-table">
339
  <tr valign="top">
340
+ <th scope="row"><?php _e( 'Import from Server path:', 'flash-album-gallery' ); ?></th>
341
  <td>
342
+ <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>
343
 
344
  <div id="file_browser"></div>
345
  <div><?php echo $maxsize; ?>
346
+ <?php if ( FLAG_SAFE_MODE ) { ?>
347
+ <br/><?php _e( ' Please note : For safe-mode = ON you need to add the subfolder thumbs manually', 'flash-album-gallery' ); ?><?php }; ?>
348
  </div>
349
  </td>
350
  </tr>
351
  </table>
352
  <div class="submit">
353
+ <input class="button-primary" type="submit" name="importfolder" value="<?php _e( 'Import folder', 'flash-album-gallery' ); ?>"/>
354
  </div>
355
  </form>
356
  </div>
admin/admin.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
 
3
  /**
4
- * flagAdminPanel - Admin Section for Flash Album Gallery
5
  *
6
  */
7
  class flagAdminPanel {
@@ -13,18 +13,31 @@ class flagAdminPanel {
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_print_scripts', array( &$this, 'load_scripts' ) );
18
  add_action( 'admin_print_styles', array( &$this, 'load_styles' ) );
19
 
20
  add_filter( 'contextual_help', array( &$this, 'show_help' ), 10, 2 );
21
  add_filter( 'screen_meta_screen', array( &$this, 'edit_screen_meta' ) );
22
- }
 
 
 
23
 
24
  function wp_flag_check_options() {
25
  global $flag;
26
  require_once( dirname( __FILE__ ) . '/flag_install.php' );
27
- $default_options = flag_list_options();
 
 
 
 
 
 
 
28
  $flag_db_options = get_option( 'flag_options' );
29
  if ( $flag_db_options ) {
30
  if ( function_exists( 'array_diff_key' ) ) {
@@ -56,44 +69,44 @@ class flagAdminPanel {
56
  // integrate the menu
57
  function add_menu() {
58
 
59
- add_menu_page( __( 'GRAND Flash Album Gallery overview', 'flag' ), __( 'FlAGallery' ), 'FlAG overview', 'flag-overview', array(
60
  &$this,
61
  'show_menu'
62
  ), FLAG_URLPATH . 'admin/images/flag.png' );
63
- add_submenu_page( 'flag-overview', __( 'GRAND Flash Album Gallery overview', 'flag' ), __( 'Overview', 'flag' ), 'FlAG overview', 'flag-overview', array(
64
  &$this,
65
  'show_menu'
66
  ) );
67
- add_submenu_page( 'flag-overview', __( 'FlAG Manage gallery', 'flag' ), __( 'Manage Galleries', 'flag' ), 'FlAG Manage gallery', 'flag-manage-gallery', array(
68
  &$this,
69
  'show_menu'
70
  ) );
71
- add_submenu_page( 'flag-overview', __( 'FlAG Music Box', 'flag' ), __( 'Music Box', 'flag' ), 'FlAG Manage music', 'flag-music-box', array(
72
  &$this,
73
  'show_menu'
74
  ) );
75
- add_submenu_page( 'flag-overview', __( 'FlAG Video Box', 'flag' ), __( 'Video Box', 'flag' ), 'FlAG Manage video', 'flag-video-box', array(
76
  &$this,
77
  'show_menu'
78
  ) );
79
- add_submenu_page( 'flag-overview', __( 'FlAG Banner Box', 'flag' ), __( 'Banner Box', 'flag' ), 'FlAG Manage banners', 'flag-banner-box', array(
80
  &$this,
81
  'show_menu'
82
  ) );
83
- add_submenu_page( 'flag-overview', __( 'FlAG Manage skins', 'flag' ), __( 'Skins', 'flag' ), 'FlAG Change skin', 'flag-skins', array(
84
  &$this,
85
  'show_menu'
86
  ) );
87
- add_submenu_page( 'flag-overview', __( 'FlAG Change options', 'flag' ), __( 'Options', 'flag' ), 'FlAG Change options', 'flag-options', array(
88
  &$this,
89
  'show_menu'
90
  ) );
91
- add_submenu_page( 'flag-overview', __( 'Flagallery in iframe', 'flag' ), __( 'Iframe', 'flag' ), 'FlAG iFrame page', 'flag-iframe', array(
92
  &$this,
93
  'show_menu'
94
  ) );
95
  if ( flag_wpmu_site_admin() ) {
96
- add_submenu_page( 'wpmu-admin.php', __( 'GRAND Flash Album Gallery', 'flag' ), __( 'Grand Flagallery', 'flag' ), 'activate_plugins', 'flag-wpmu', array(
97
  &$this,
98
  'show_menu'
99
  ) );
@@ -158,20 +171,44 @@ class flagAdminPanel {
158
  }
159
  }
160
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
161
  function load_scripts() {
162
 
163
- wp_register_script( 'flag-ajax', FLAG_URLPATH . 'admin/js/flag.ajax.js', array( 'jquery' ), '1.4.0' );
164
  wp_localize_script( 'flag-ajax', 'flagAjaxSetup', array(
165
  'url' => admin_url( 'admin-ajax.php' ),
166
  'action' => 'flag_ajax_operation',
167
  'operation' => '',
168
  'nonce' => wp_create_nonce( 'flag-ajax' ),
169
  'ids' => '',
170
- 'permission' => __( 'You do not have the correct permission', 'flag' ),
171
- 'error' => __( 'Unexpected Error', 'flag' ),
172
- 'failure' => __( 'A failure occurred', 'flag' )
173
  ) );
174
- wp_register_script( 'flag-progressbar', FLAG_URLPATH . 'admin/js/flag.progressbar.js', array( 'jquery' ), '1.0.0' );
175
 
176
  if ( isset( $_GET['page'] ) ) {
177
  switch ( $_GET['page'] ) {
@@ -180,8 +217,8 @@ class flagAdminPanel {
180
  case "flag-manage-gallery" :
181
  print "<script type='text/javascript' src='" . FLAG_URLPATH . "admin/js/tabs.js'></script>\n";
182
 
183
- wp_enqueue_style( 'jquery-ui-smoothness', 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/themes/smoothness/jquery-ui.min.css', array(), '1.10.4', 'screen' );
184
- wp_enqueue_script( 'jquery-ui-full', 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/jquery-ui.min.js', array( 'jquery' ), '1.10.4' );
185
 
186
  wp_enqueue_script( 'jquery-ui-droppable' );
187
 
@@ -217,13 +254,13 @@ class flagAdminPanel {
217
  wp_enqueue_script( 'thickbox' );
218
  break;
219
  case "flag-options" :
220
- wp_enqueue_script( 'farbtastic-nosharp', FLAG_URLPATH . 'admin/js/farbtastic-nosharp.js', array( 'jquery' ), '1.2' );
221
  print "<script type='text/javascript' src='" . FLAG_URLPATH . "admin/js/tabs.js'></script>\n";
222
  break;
223
  case "flag-skins" :
224
  wp_enqueue_script( 'thickbox' );
225
- wp_enqueue_script( 'farbtastic-nosharp', FLAG_URLPATH . 'admin/js/farbtastic-nosharp.js', array( 'jquery' ), '1.2' );
226
- //wp_enqueue_script( 'farbtastic' );
 
227
  print "<script type='text/javascript' src='" . FLAG_URLPATH . "admin/js/tabs.js'></script>\n";
228
  break;
229
  }
@@ -235,24 +272,24 @@ class flagAdminPanel {
235
  if ( isset( $_GET['page'] ) ) {
236
  switch ( $_GET['page'] ) {
237
  case 'flag-overview' :
238
- wp_enqueue_style( 'flagadmin', FLAG_URLPATH . 'admin/css/flagadmin.css', false, '4.3.0', 'screen' );
239
  wp_admin_css( 'css/dashboard' );
240
  break;
241
  case "flag-options" :
242
  wp_enqueue_style( 'farbtastic' );
243
  case "flag-manage-gallery" :
244
- wp_enqueue_style( 'flagtabs', FLAG_URLPATH . 'admin/css/tabs.css', false, '4.3.0', 'screen' );
245
  case "flag-music-box" :
246
  case "flag-video-box" :
247
  case "flag-banner-box" :
248
  wp_enqueue_style( 'thickbox' );
249
- wp_enqueue_style( 'flagadmin', FLAG_URLPATH . 'admin/css/flagadmin.css', false, '4.3.0', 'screen' );
250
  break;
251
  case "flag-skins" :
252
  wp_enqueue_style( 'thickbox' );
253
  wp_enqueue_style( 'farbtastic' );
254
- wp_enqueue_style( 'flagtabs', FLAG_URLPATH . 'admin/css/tabs.css', false, '4.3.0', 'screen' );
255
- wp_enqueue_style( 'flagadmin', FLAG_URLPATH . 'admin/css/flagadmin.css', false, '4.3.0', 'screen' );
256
  wp_admin_css( 'css/dashboard' );
257
  break;
258
  }
@@ -263,7 +300,7 @@ class flagAdminPanel {
263
 
264
  $link = '';
265
  // menu title is localized...
266
- $i18n = strtolower( _n( 'Gallery', 'Galleries', 1, 'flag' ) );
267
 
268
  switch ( $screen ) {
269
  case 'toplevel_page_' . 'flag-overview' :
@@ -277,16 +314,16 @@ class flagAdminPanel {
277
  }
278
 
279
  if ( ! empty( $link ) ) {
280
- $help = '<h5>' . __( 'Get help with Grand Flagallery', 'flag' ) . '</h5>';
281
  $help .= '<div class="metabox-prefs">';
282
  $help .= $link;
283
  $help .= "</div>\n";
284
- $help .= '<h5>' . __( 'More Help & Info', 'flag' ) . '</h5>';
285
  $help .= '<div class="metabox-prefs">';
286
- $help .= '<a href="http://codeasily.com/community/topic/video-tutorials/" target="_blank">' . __( 'Grand Flagallery Video Tutorial', 'flag' ) . '</a>';
287
- $help .= ' | <a href="http://codeasily.com/community/forum/flagallery-wordpress-plugin/" target="_blank">' . __( 'Forum', 'flag' ) . '</a>';
288
- $help .= ' | <a href="http://codeasily.com/community/topic/language-files/" target="_blank">' . __( 'Get your language pack', 'flag' ) . '</a>';
289
- $help .= ' | <a href="http://codeasily.com/portfolio/grand-flagallery-skins/" target="_blank">' . __( 'Skins for Grand Flagallery', 'flag' ) . '</a>';
290
  $help .= "</div>\n";
291
  }
292
 
@@ -296,17 +333,17 @@ class flagAdminPanel {
296
  function edit_screen_meta( $screen ) {
297
 
298
  // menu title is localized, so we need to change the toplevel name
299
- $i18n = strtolower( _n( 'Gallery', 'Galleries', 1, 'flag' ) );
300
 
301
  switch ( $screen ) {
302
  case "{$i18n}_page_flag-manage-gallery" :
303
  // we would like to have screen option only at the manage images / gallery page
304
  if ( isset ( $_POST['sortGallery'] ) ) {
305
- $screen = $screen;
306
  } else if ( ( $_GET['mode'] == 'edit' ) || isset ( $_POST['backToGallery'] ) ) {
307
  $screen = 'flag-manage-images';
308
  } else if ( ( $_GET['mode'] == 'sort' ) ) {
309
- $screen = $screen;
310
  } else {
311
  $screen = 'flag-manage-gallery';
312
  }
@@ -331,6 +368,28 @@ class flagAdminPanel {
331
  $this->register_column_headers( 'flag-manage-images', flag_manage_gallery_columns() );
332
  }
333
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
334
  }
335
 
336
  function flag_wpmu_site_admin() {
1
  <?php
2
 
3
  /**
4
+ * flagAdminPanel - Admin Section for FlaGallery
5
  *
6
  */
7
  class flagAdminPanel {
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_filter( 'contextual_help', array( &$this, 'show_help' ), 10, 2 );
24
  add_filter( 'screen_meta_screen', array( &$this, 'edit_screen_meta' ) );
25
+
26
+ add_filter('admin_head', array (&$this, 'wp_flag_ins_button' ), 5);
27
+
28
+ }
29
 
30
  function wp_flag_check_options() {
31
  global $flag;
32
  require_once( dirname( __FILE__ ) . '/flag_install.php' );
33
+
34
+ if (isset($_GET['page']) && 'flag-overview' === $_GET['page'] && isset($_POST['uninstall'])) {
35
+ check_admin_referer('flag_uninstall');
36
+ flag_uninstall();
37
+ }
38
+
39
+
40
+ $default_options = flag_list_options();
41
  $flag_db_options = get_option( 'flag_options' );
42
  if ( $flag_db_options ) {
43
  if ( function_exists( 'array_diff_key' ) ) {
69
  // integrate the menu
70
  function add_menu() {
71
 
72
+ add_menu_page( __( 'GRAND FlaGallery overview', 'flash-album-gallery' ), __( 'FlAGallery' ), 'FlAG overview', 'flag-overview', array(
73
  &$this,
74
  'show_menu'
75
  ), FLAG_URLPATH . 'admin/images/flag.png' );
76
+ add_submenu_page( 'flag-overview', __( 'GRAND FlaGallery overview', 'flash-album-gallery' ), __( 'Overview', 'flash-album-gallery' ), 'FlAG overview', 'flag-overview', array(
77
  &$this,
78
  'show_menu'
79
  ) );
80
+ add_submenu_page( 'flag-overview', __( 'FlAG Manage gallery', 'flash-album-gallery' ), __( 'Manage Galleries', 'flash-album-gallery' ), 'FlAG Manage gallery', 'flag-manage-gallery', array(
81
  &$this,
82
  'show_menu'
83
  ) );
84
+ add_submenu_page( 'flag-overview', __( 'FlAG Music Box', 'flash-album-gallery' ), __( 'Music Box', 'flash-album-gallery' ), 'FlAG Manage music', 'flag-music-box', array(
85
  &$this,
86
  'show_menu'
87
  ) );
88
+ add_submenu_page( 'flag-overview', __( 'FlAG Video Box', 'flash-album-gallery' ), __( 'Video Box', 'flash-album-gallery' ), 'FlAG Manage video', 'flag-video-box', array(
89
  &$this,
90
  'show_menu'
91
  ) );
92
+ add_submenu_page( 'flag-overview', __( 'FlAG Banner Box', 'flash-album-gallery' ), __( 'Banner Box', 'flash-album-gallery' ), 'FlAG Manage banners', 'flag-banner-box', array(
93
  &$this,
94
  'show_menu'
95
  ) );
96
+ add_submenu_page( 'flag-overview', __( 'FlAG Manage skins', 'flash-album-gallery' ), __( 'Skins', 'flash-album-gallery' ), 'FlAG Change skin', 'flag-skins', array(
97
  &$this,
98
  'show_menu'
99
  ) );
100
+ add_submenu_page( 'flag-overview', __( 'FlAG Change options', 'flash-album-gallery' ), __( 'Options', 'flash-album-gallery' ), 'FlAG Change options', 'flag-options', array(
101
  &$this,
102
  'show_menu'
103
  ) );
104
+ add_submenu_page( 'flag-overview', __( 'Flagallery in iframe', 'flash-album-gallery' ), __( 'Iframe', 'flash-album-gallery' ), 'FlAG iFrame page', 'flag-iframe', array(
105
  &$this,
106
  'show_menu'
107
  ) );
108
  if ( flag_wpmu_site_admin() ) {
109
+ add_submenu_page( 'wpmu-admin.php', __( 'GRAND FlaGallery', 'flash-album-gallery' ), __( 'Grand Flagallery', 'flash-album-gallery' ), 'activate_plugins', 'flag-wpmu', array(
110
  &$this,
111
  'show_menu'
112
  ) );
171
  }
172
  }
173
 
174
+ function enqueue_scripts($hook) {
175
+ // no need to go on if it's not a plugin page
176
+ 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'))){
177
+ global $wp_scripts, $wp_styles;
178
+ foreach($wp_scripts->registered as $handle => $wp_script){
179
+ if(((false !== strpos($wp_script->src, '/plugins/')) || (false !== strpos($wp_script->src, '/themes/'))) && (false === strpos($wp_script->src, 'flash-album-gallery'))){
180
+ if(in_array($handle, $wp_scripts->queue)){
181
+ wp_dequeue_script($handle);
182
+ }
183
+ wp_deregister_script($handle);
184
+ }
185
+ }
186
+ foreach($wp_styles->registered as $handle => $wp_style){
187
+ if(((false !== strpos($wp_style->src, '/plugins/')) || (false !== strpos($wp_style->src, '/themes/'))) && (false === strpos($wp_style->src, 'flash-album-gallery'))){
188
+ if(in_array($handle, $wp_styles->queue)){
189
+ wp_dequeue_style($handle);
190
+ }
191
+ wp_deregister_style($handle);
192
+ }
193
+ }
194
+ }
195
+
196
+ }
197
+
198
  function load_scripts() {
199
 
200
+ wp_register_script( 'flag-ajax', FLAG_URLPATH . 'admin/js/flag.ajax.js', array( 'jquery' ), '1.4.1' );
201
  wp_localize_script( 'flag-ajax', 'flagAjaxSetup', array(
202
  'url' => admin_url( 'admin-ajax.php' ),
203
  'action' => 'flag_ajax_operation',
204
  'operation' => '',
205
  'nonce' => wp_create_nonce( 'flag-ajax' ),
206
  'ids' => '',
207
+ 'permission' => __( 'You do not have the correct permission', 'flash-album-gallery' ),
208
+ 'error' => __( 'Unexpected Error', 'flash-album-gallery' ),
209
+ 'failure' => __( 'A failure occurred', 'flash-album-gallery' )
210
  ) );
211
+ wp_register_script( 'flag-progressbar', FLAG_URLPATH . 'admin/js/flag.progressbar.js', array( 'jquery' ), '1.0.1' );
212
 
213
  if ( isset( $_GET['page'] ) ) {
214
  switch ( $_GET['page'] ) {
217
  case "flag-manage-gallery" :
218
  print "<script type='text/javascript' src='" . FLAG_URLPATH . "admin/js/tabs.js'></script>\n";
219
 
220
+ 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' );
221
+ wp_enqueue_script( 'jquery-ui-full', '//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/jquery-ui.min.js', array( 'jquery' ), '1.10.4' );
222
 
223
  wp_enqueue_script( 'jquery-ui-droppable' );
224
 
254
  wp_enqueue_script( 'thickbox' );
255
  break;
256
  case "flag-options" :
 
257
  print "<script type='text/javascript' src='" . FLAG_URLPATH . "admin/js/tabs.js'></script>\n";
258
  break;
259
  case "flag-skins" :
260
  wp_enqueue_script( 'thickbox' );
261
+ // Add the color picker assets
262
+ wp_enqueue_style( 'wp-color-picker' );
263
+ wp_enqueue_script( 'wp-color-picker' );
264
  print "<script type='text/javascript' src='" . FLAG_URLPATH . "admin/js/tabs.js'></script>\n";
265
  break;
266
  }
272
  if ( isset( $_GET['page'] ) ) {
273
  switch ( $_GET['page'] ) {
274
  case 'flag-overview' :
275
+ wp_enqueue_style( 'flagadmin', FLAG_URLPATH . 'admin/css/flagadmin.css', false, '5.0.0', 'screen' );
276
  wp_admin_css( 'css/dashboard' );
277
  break;
278
  case "flag-options" :
279
  wp_enqueue_style( 'farbtastic' );
280
  case "flag-manage-gallery" :
281
+ wp_enqueue_style( 'flagtabs', FLAG_URLPATH . 'admin/css/tabs.css', false, '5.0.0', 'screen' );
282
  case "flag-music-box" :
283
  case "flag-video-box" :
284
  case "flag-banner-box" :
285
  wp_enqueue_style( 'thickbox' );
286
+ wp_enqueue_style( 'flagadmin', FLAG_URLPATH . 'admin/css/flagadmin.css', false, '5.0.0', 'screen' );
287
  break;
288
  case "flag-skins" :
289
  wp_enqueue_style( 'thickbox' );
290
  wp_enqueue_style( 'farbtastic' );
291
+ wp_enqueue_style( 'flagtabs', FLAG_URLPATH . 'admin/css/tabs.css', false, '5.0.0', 'screen' );
292
+ wp_enqueue_style( 'flagadmin', FLAG_URLPATH . 'admin/css/flagadmin.css', false, '5.0.0', 'screen' );
293
  wp_admin_css( 'css/dashboard' );
294
  break;
295
  }
300
 
301
  $link = '';
302
  // menu title is localized...
303
+ $i18n = strtolower( _n( 'Gallery', 'Galleries', 1, 'flash-album-gallery' ) );
304
 
305
  switch ( $screen ) {
306
  case 'toplevel_page_' . 'flag-overview' :
314
  }
315
 
316
  if ( ! empty( $link ) ) {
317
+ $help = '<h5>' . __( 'Get help with Grand Flagallery', 'flash-album-gallery' ) . '</h5>';
318
  $help .= '<div class="metabox-prefs">';
319
  $help .= $link;
320
  $help .= "</div>\n";
321
+ $help .= '<h5>' . __( 'More Help & Info', 'flash-album-gallery' ) . '</h5>';
322
  $help .= '<div class="metabox-prefs">';
323
+ $help .= '<a href="http://codeasily.com/community/topic/video-tutorials/" target="_blank">' . __( 'Grand Flagallery Video Tutorial', 'flash-album-gallery' ) . '</a>';
324
+ $help .= ' | <a href="http://codeasily.com/community/forum/flagallery-wordpress-plugin/" target="_blank">' . __( 'Forum', 'flash-album-gallery' ) . '</a>';
325
+ $help .= ' | <a href="http://codeasily.com/community/topic/language-files/" target="_blank">' . __( 'Get your language pack', 'flash-album-gallery' ) . '</a>';
326
+ $help .= ' | <a href="http://codeasily.com/portfolio/grand-flagallery-skins/" target="_blank">' . __( 'Skins for Grand Flagallery', 'flash-album-gallery' ) . '</a>';
327
  $help .= "</div>\n";
328
  }
329
 
333
  function edit_screen_meta( $screen ) {
334
 
335
  // menu title is localized, so we need to change the toplevel name
336
+ $i18n = strtolower( _n( 'Gallery', 'Galleries', 1, 'flash-album-gallery' ) );
337
 
338
  switch ( $screen ) {
339
  case "{$i18n}_page_flag-manage-gallery" :
340
  // we would like to have screen option only at the manage images / gallery page
341
  if ( isset ( $_POST['sortGallery'] ) ) {
342
+ //$screen = $screen;
343
  } else if ( ( $_GET['mode'] == 'edit' ) || isset ( $_POST['backToGallery'] ) ) {
344
  $screen = 'flag-manage-images';
345
  } else if ( ( $_GET['mode'] == 'sort' ) ) {
346
+ //$screen = $screen;
347
  } else {
348
  $screen = 'flag-manage-gallery';
349
  }
368
  $this->register_column_headers( 'flag-manage-images', flag_manage_gallery_columns() );
369
  }
370
 
371
+ function wp_flag_ins_button() {
372
+
373
+ if( strpos($_SERVER['REQUEST_URI'], 'post.php')
374
+ || strstr($_SERVER['PHP_SELF'], 'page-new.php')
375
+ || strstr($_SERVER['PHP_SELF'], 'page.php')
376
+ || strstr($_SERVER['PHP_SELF'], 'post-new.php') )
377
+ {
378
+ ?>
379
+ <script type="text/javascript">
380
+ <!--
381
+ function bind_resize() {
382
+ if(!window.flag_bind_resize){
383
+ jQuery(window).bind("resize", tb_position);
384
+ }
385
+ window.flag_bind_resize = true;
386
+ }
387
+ //-->
388
+ </script>
389
+ <?php
390
+ }
391
+ }
392
+
393
  }
394
 
395
  function flag_wpmu_site_admin() {
admin/ajax.php CHANGED
@@ -76,24 +76,9 @@ function flagCreateNewThumb() {
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
- if ( $flag_options['thumbFix'] ) {
89
- if ( $thumb->currentDimensions['height'] > $thumb->currentDimensions['width'] ) {
90
- $thumb->resize( $flag_options['thumbWidth'], 0 );
91
- } else {
92
- $thumb->resize( 0, $flag_options['thumbHeight'] );
93
- }
94
- } else {
95
- $thumb->resize( $flag_options['thumbWidth'], $flag_options['thumbHeight'] );
96
- }
97
 
98
  if ( $thumb->save( $picture->thumbPath, 100 ) ) {
99
  //read the new sizes
@@ -137,7 +122,7 @@ function flag_save_album() {
137
  }
138
  $result = false;
139
  $album_id = intval( $album_id );
140
- $album_name = preg_replace( '/[^\w\s\._-]+/', '', $album_name );
141
  if ( $album_name && $album_id ) {
142
  if ( count( $g ) ) {
143
  $galstring = implode( ',', $g );
@@ -148,7 +133,7 @@ function flag_save_album() {
148
  }
149
 
150
  if ( $result ) {
151
- _e( 'Success', 'flag' );
152
  }
153
 
154
  exit();
@@ -176,7 +161,7 @@ function flag_delete_album() {
176
  }
177
 
178
  if ( $result ) {
179
- _e( 'Success', 'flag' );
180
  }
181
 
182
  exit();
@@ -201,9 +186,9 @@ function flag_banner_crunch() {
201
  $id = flagAdmin::handle_import_file( $_POST['path'] );
202
  $file = basename( $_POST['path'] );
203
  if ( is_wp_error( $id ) ) {
204
- echo '<p class="error">' . sprintf( __( '<em>%s</em> was <strong>not</strong> imported due to an error: %s', 'flag' ), $file, $id->get_error_message() ) . '</p>';
205
  } else {
206
- echo '<p class="success">' . sprintf( __( '<em>%s</em> has been added to Media library', 'flag' ), $file ) . '</p>';
207
  }
208
  }
209
 
@@ -310,3 +295,157 @@ function flag_ajax_plupload_uploader() {
310
  echo flagAdmin::swfupload_image( $galleryID );
311
  die();
312
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
76
  $id = (int) $_POST['id'];
77
  $picture = flagdb::find_image( $id );
78
 
 
 
 
 
 
79
  $thumb = new flag_Thumbnail( $picture->imagePath, true );
80
 
81
+ $thumb->resize( $flag_options['thumbWidth'], $flag_options['thumbHeight'] );
 
 
 
 
 
 
 
 
 
 
82
 
83
  if ( $thumb->save( $picture->thumbPath, 100 ) ) {
84
  //read the new sizes
122
  }
123
  $result = false;
124
  $album_id = intval( $album_id );
125
+ $album_name = wp_check_invalid_utf8(wp_strip_all_tags( $album_name ));
126
  if ( $album_name && $album_id ) {
127
  if ( count( $g ) ) {
128
  $galstring = implode( ',', $g );
133
  }
134
 
135
  if ( $result ) {
136
+ _e( 'Success', 'flash-album-gallery' );
137
  }
138
 
139
  exit();
161
  }
162
 
163
  if ( $result ) {
164
+ _e( 'Success', 'flash-album-gallery' );
165
  }
166
 
167
  exit();
186
  $id = flagAdmin::handle_import_file( $_POST['path'] );
187
  $file = basename( $_POST['path'] );
188
  if ( is_wp_error( $id ) ) {
189
+ 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>';
190
  } else {
191
+ echo '<p class="success">' . sprintf( __( '<em>%s</em> has been added to Media library', 'flash-album-gallery' ), $file ) . '</p>';
192
  }
193
  }
194
 
295
  echo flagAdmin::swfupload_image( $galleryID );
296
  die();
297
  }
298
+
299
+ add_action( 'wp_ajax_flag_shortcode_helper', 'flag_ajax_shortcode_helper' );
300
+ function flag_ajax_shortcode_helper() {
301
+ //check for correct capability
302
+ if ( ! is_user_logged_in() ) {
303
+ die( 'Login failure. -1' );
304
+ }
305
+ //check for correct capability
306
+ if ( ! current_user_can( 'FlAG Use TinyMCE' ) ) {
307
+ die( 'You do not have permission to upload files. -2' );
308
+ }
309
+
310
+ $media_button = isset($_GET['media_button']) && $_GET['media_button'] == 'true'? true : false;
311
+ $riched = isset($_GET['riched']) && $_GET['riched'] == 'true'? true : false;
312
+
313
+ include_once( FLAG_ABSPATH . 'admin/tinymce/window.php' );
314
+
315
+ die();
316
+ }
317
+
318
+ add_action('wp_ajax_flagallery_skin_interaction', 'flagallery_skin_interaction');
319
+ add_action('wp_ajax_nopriv_flagallery_skin_interaction', 'flagallery_skin_interaction');
320
+ add_action('wp_ajax_flagallery_module_interaction', 'flagallery_module_interaction');
321
+ add_action('wp_ajax_nopriv_flagallery_module_interaction', 'flagallery_module_interaction');
322
+ function flagallery_module_interaction(){
323
+ global $wpdb;
324
+
325
+ if(empty($_SERVER['HTTP_REFERER'])){
326
+ header($_SERVER['SERVER_PROTOCOL'] . ' 400 Bad Request');
327
+ die();
328
+ }
329
+
330
+ $ref = $_SERVER['HTTP_REFERER'];
331
+ //$uip = str_replace('.', '', $_SERVER['REMOTE_ADDR'])
332
+ if((false === strpos($ref, get_home_url())) && (false === strpos($ref, get_site_url()))){
333
+ header($_SERVER['SERVER_PROTOCOL'] . ' 400 Bad Request');
334
+ die();
335
+ }
336
+ if(('POST' !== $_SERVER['REQUEST_METHOD']) || !isset($_SERVER['HTTP_HOST']) || !strpos(get_home_url(), $_SERVER['HTTP_HOST'])){
337
+ header($_SERVER['SERVER_PROTOCOL'] . ' 400 Bad Request');
338
+ die();
339
+ }
340
+
341
+ $upd = array('pid'=>false,'vote'=>false,'hit'=>false,'reset'=>false);
342
+
343
+ if(($pid = intval($_POST['hit']))){
344
+ $upd['pid'] = $pid;
345
+ $upd['hit'] = isset($_POST['hit']);
346
+ $upd['vote'] = isset($_POST['vote']);
347
+
348
+ flag_update_counter($upd);
349
+
350
+ $result = $wpdb->get_results( "SELECT hitcounter, total_votes FROM $wpdb->flagpictures WHERE `pid` = $pid" );
351
+
352
+ $meta['views'] = intval($result[0]->hitcounter);
353
+ $meta['likes'] = intval($result[0]->total_votes);
354
+ $meta = array_map('intval', $meta);
355
+
356
+ header('Content-Type: application/json; charset=' . get_option('blog_charset'), true);
357
+ echo json_encode($meta);
358
+ die();
359
+ }
360
+
361
+ die();
362
+ }
363
+
364
+ /**
365
+ * Update image hitcounter in the database
366
+ *
367
+ * @param $upd
368
+ */
369
+ function flag_update_counter($upd) {
370
+ global $wpdb;
371
+
372
+ if ( $pid = abs( intval($upd['pid']) ) ){
373
+ if($upd['reset'] == false){
374
+ if( $upd['hit'] ){
375
+ $wpdb->query( "UPDATE $wpdb->flagpictures SET `hitcounter` = `hitcounter`+1 WHERE pid = $pid" );
376
+ }
377
+ if( $upd['vote'] ){
378
+ $wpdb->query( "UPDATE $wpdb->flagpictures SET `total_votes` = IF(hitcounter > total_votes, total_votes+1, hitcounter) WHERE pid = $pid" );
379
+ }
380
+ } else {
381
+ if( $upd['hit'] ){
382
+ $hit = abs( intval($upd['hit']) );
383
+ $wpdb->query( "UPDATE $wpdb->flagpictures SET `hitcounter` = $hit WHERE pid = $pid" );
384
+ }
385
+ if( $upd['vote'] == 1 ){
386
+ $vote = abs( intval($upd['vote']) );
387
+ $wpdb->query( "UPDATE $wpdb->flagpictures SET `total_votes` = IF(hitcounter > $vote, $vote, hitcounter) WHERE pid = $pid" );
388
+ }
389
+ }
390
+ }
391
+
392
+ }
393
+
394
+ add_action('wp_ajax_flagallery_update_counters', 'flagallery_update_counters');
395
+ add_action('wp_ajax_nopriv_flagallery_update_counters', 'flagallery_update_counters');
396
+ function flagallery_update_counters(){
397
+ global $wpdb;
398
+
399
+ if(empty($_SERVER['HTTP_REFERER'])){
400
+ header($_SERVER['SERVER_PROTOCOL'] . ' 400 Bad Request');
401
+ die();
402
+ }
403
+
404
+ $ref = $_SERVER['HTTP_REFERER'];
405
+ //$uip = str_replace('.', '', $_SERVER['REMOTE_ADDR'])
406
+ if((false === strpos($ref, get_home_url())) && (false === strpos($ref, get_site_url()))){
407
+ header($_SERVER['SERVER_PROTOCOL'] . ' 400 Bad Request');
408
+ die();
409
+ }
410
+ if(('POST' !== $_SERVER['REQUEST_METHOD']) || !isset($_SERVER['HTTP_HOST']) || !strpos(get_home_url(), $_SERVER['HTTP_HOST'])){
411
+ header($_SERVER['SERVER_PROTOCOL'] . ' 400 Bad Request');
412
+ die();
413
+ }
414
+
415
+ $json = (array) json_decode(stripslashes($_POST['json']));
416
+ //$upd = array('pid'=>false,'vote'=>false,'hit'=>false,'reset'=>false);
417
+ $upd_array = array();
418
+ if(is_array($json)){
419
+ if(isset($json['views']) && is_array($json['views'])){
420
+ foreach($json['views'] as $id){
421
+ if((int)$id){
422
+ $upd_array[ $id ] = array('pid' => $id, 'hit' => 1, 'vote' => false, 'reset' => false);
423
+ }
424
+ }
425
+ }
426
+ if(isset($json['likes']) && is_array($json['likes'])){
427
+ foreach($json['likes'] as $id){
428
+ if(isset($upd_array[$id])){
429
+ $upd_array[ $id ]['vote'] = 1;
430
+ }
431
+ }
432
+ }
433
+ }
434
+
435
+ $meta = array();
436
+ foreach($upd_array as $upd){
437
+ $pid = (int)$upd['pid'];
438
+ flag_update_counter($upd);
439
+ $result = $wpdb->get_results( "SELECT hitcounter, total_votes FROM $wpdb->flagpictures WHERE `pid` = $pid" );
440
+ if($result){
441
+ $meta[$pid] = array(
442
+ 'views' => intval($result[0]->hitcounter),
443
+ 'likes' => intval($result[0]->total_votes),
444
+ );
445
+ }
446
+ }
447
+
448
+ header('Content-Type: application/json; charset=' . get_option('blog_charset'), true);
449
+ echo json_encode($meta);
450
+ die();
451
+ }
admin/banner-box.php CHANGED
@@ -99,7 +99,7 @@ function flag_banner_controler() {
99
  if ( isset( $_POST['updateMedia'] ) ) {
100
  check_admin_referer( 'flag_update' );
101
  flagGallery::flagSaveWpMedia();
102
- flagGallery::show_message( __( 'Media updated', 'flag' ) );
103
  }
104
  default:
105
  flag_created_b_playlists();
@@ -145,9 +145,9 @@ function flag_crunch( $crunch_list ) {
145
  );
146
  } else{
147
  var refpage = window.location.href;
148
- jQuery(".flag_crunching .txt").html('<a href="' + refpage + '"><?php _e("Import folder is complete. The page reloads after 5 seconds.", "flag"); ?></a>');
149
- //alert('<?php _e("Import folder complete. Refresh page.", "flag"); ?>');
150
- setTimeout(function(){ window.location.href = window.location.href }, 5000);
151
  }
152
  }
153
 
@@ -168,15 +168,15 @@ function flag_created_b_playlists() {
168
 
169
  ?>
170
  <div class="flag-wrap">
171
- <h2><?php _e( 'Created playlists', 'flag' ); ?></h2>
172
  <table class="widefat flag-table" cellspacing="0">
173
  <thead>
174
  <tr>
175
- <th scope="col" width="25%"><?php _e( 'Title', 'flag' ); ?></th>
176
- <th scope="col" width="55%"><?php _e( 'Description', 'flag' ); ?></th>
177
- <th scope="col"><?php _e( 'Quantity', 'flag' ); ?></th>
178
- <th scope="col"><?php _e( 'Shortcode', 'flag' ); ?></th>
179
- <th scope="col"><?php _e( 'Action', 'flag' ); ?></th>
180
  </tr>
181
  </thead>
182
  <tbody>
@@ -197,18 +197,18 @@ function flag_created_b_playlists() {
197
  </a>
198
  </td>
199
  <td><?php echo esc_html( $playlist_data['description'] );
200
- echo '&nbsp;(' . __( "player", "flag" ) . ': <strong>' . esc_html( $playlist_data['skin'] ) . '</strong>)' ?></td>
201
  <td><?php echo count( $query_m ); ?></td>
202
  <td style="white-space: nowrap;"><input type="text" class="shortcode1" style="width: 200px; font-size: 9px;" readonly="readonly" onfocus="this.select()" value="[grandbanner xml=<?php echo $playlist_name; ?>]"/></td>
203
  <td>
204
- <a href="<?php echo wp_nonce_url( $filepath . '&playlist=' . $playlist_name . "&mode=delete", 'flag_delete' ); ?>" class="delete" onclick="javascript:check=confirm( '<?php _e( "Delete this playlist?", 'flag' ) ?>');if(check==false) {return false;
205
- }"><?php _e( 'Delete', 'flag' ); ?></a>
206
  </td>
207
  </tr>
208
  <?php
209
  }
210
  } else {
211
- echo '<tr><td colspan="5" align="center"><strong>' . __( 'No playlists found', 'flag' ) . '</strong></td></tr>';
212
  }
213
  ?>
214
  </tbody>
@@ -310,7 +310,7 @@ function flag_banner_wp_media_lib( $added = false ) {
310
  // this function check for a the number of selected images, sumbmit false when no one selected
311
  function checkSelected(){
312
  if(!jQuery('#items_array').val()){
313
- alert('<?php echo esc_js(__("No items selected", "flag")); ?>');
314
  return false;
315
  }
316
  var actionId = jQuery('#bulkaction').val();
@@ -356,29 +356,29 @@ function flag_banner_wp_media_lib( $added = false ) {
356
 
357
  <!-- import folder -->
358
  <div id="importfolder">
359
- <h2><?php _e( 'Import banners from folder', 'flag' ); ?></h2>
360
 
361
  <form name="importfolder" id="importfolder_form" method="POST" action="<?php echo $filepath; ?>" accept-charset="utf-8">
362
  <?php wp_nonce_field( 'flag_addbanner' ); ?>
363
  <table class="form-table">
364
  <tr valign="top">
365
- <th scope="row"><?php _e( 'Import from Server path:', 'flag' ); ?></th>
366
- <td><input type="text" size="35" id="bannerfolder" name="bannerfolder" value="<?php echo $defaultpath; ?>"/><span class="browsefiles button" style="display:none"><?php _e( 'Browse...', "flag" ); ?></span>
367
 
368
  <div id="file_browser"></div>
369
  <br/>
370
  <p><label><input type="checkbox" name="delete_files" value="delete"/> &nbsp;
371
- <?php _e( 'delete files after import in WordPress Media Library', 'flag' ); ?></label></p>
372
  </td>
373
  </tr>
374
  </table>
375
- <div class="submit"><input class="button-primary" type="submit" name="importfolder" value="<?php _e( 'Import folder', 'flag' ); ?>"/></div>
376
  </form>
377
  </div>
378
  <?php } ?>
379
  <?php } ?>
380
 
381
- <h2><?php _e( 'WordPress Image Library', 'flag' ); ?></h2>
382
 
383
  <?php
384
  // look for pagination
@@ -412,8 +412,8 @@ function flag_banner_wp_media_lib( $added = false ) {
412
  ?>
413
  <div class="tablenav" style="overflow: hidden; height: auto;">
414
  <?php if ( $added === false ) { ?>
415
- <div class="alignleft"><b><?php _e( 'Selected Media', 'flag' ); ?>: </b><input style="width:500px;" type="text" readonly="readonly" id="items_array" name="items_array" value="<?php echo $items_array_default; ?>"/>
416
- <span class="clear_selected button"><?php _e( 'Clear Selected', 'flag' ); ?></span></div>
417
  <?php } ?>
418
  <div class="tablenav-pages"><?php $page_links_text = sprintf( '<span class="displaying-num">' . __( 'Displaying %s&#8211;%s of %s' ) . '</span>%s', number_format_i18n( ( $_GET['paged'] - 1 ) * $objects_per_page + 1 ), number_format_i18n( min( $_GET['paged'] * $objects_per_page, $img_total_count ) ), number_format_i18n( $img_total_count ), $page_links );
419
  echo $page_links_text; ?></div>
@@ -426,16 +426,16 @@ function flag_banner_wp_media_lib( $added = false ) {
426
 
427
  <div class="actions">
428
  <?php if ( $added === false ) { ?>
429
- <input name="updateMedia" class="button-primary" style="float: right;" type="submit" value="<?php _e( 'Update Media', 'flag' ); ?>"/>
430
  <?php if ( function_exists( 'json_encode' ) ) { ?>
431
  <select name="bulkaction" id="bulkaction">
432
- <option value="no_action"><?php _e( "No action", 'flag' ); ?></option>
433
- <option value="new_playlist"><?php _e( "Create new playlist", 'flag' ); ?></option>
434
  </select>
435
- <input name="showThickbox" class="button-secondary" type="submit" value="<?php _e( 'Apply', 'flag' ); ?>" onclick="if ( !checkSelected() ) {return false;
436
  }"/>
437
  <?php } ?>
438
- <a href="<?php echo admin_url( 'media-new.php' ); ?>" class="button"><?php _e( 'Upload Banner(s)', 'flag' ); ?></a>
439
  <input type="hidden" id="items_array" name="items_array" value=""/>
440
  <?php } else { ?>
441
  <input type="hidden" name="mode" value="save"/>
@@ -444,7 +444,7 @@ function flag_banner_wp_media_lib( $added = false ) {
444
  <input type="hidden" name="skinname" value="<?php echo sanitize_flagname( $playlist['skin'] ); ?>"/>
445
  <input type="hidden" name="skinaction" value="<?php echo sanitize_flagname( $playlist['skin'] ); ?>"/>
446
  <textarea style="display: none;" name="playlist_descr" cols="40" rows="1"><?php echo esc_html( $playlist['description'] ); ?></textarea>
447
- <input name="addToPlaylist" class="button-secondary" type="submit" value="<?php _e( 'Update Playlist', 'flag' ); ?>"/>
448
  <?php } ?>
449
  </div>
450
 
@@ -452,28 +452,28 @@ function flag_banner_wp_media_lib( $added = false ) {
452
  <table class="widefat flag-table" cellspacing="0">
453
  <thead>
454
  <tr>
455
- <th class="cb" width="54" scope="col"><a href="#" onclick="checkAll(document.getElementById('bannerlib'));return false;"><?php _e( 'Check', 'flag' ); ?></a></th>
456
  <th class="id" width="64" scope="col">
457
- <div><?php _e( 'ID', 'flag' ); ?></div>
458
  </th>
459
  <th class="thumb" width="110" scope="col">
460
- <div><?php _e( 'Thumbnail', 'flag' ); ?></div>
461
  </th>
462
  <th class="title_filename" scope="col">
463
- <div><?php _e( 'Filename / Title / Link', 'flag' ); ?></div>
464
  </th>
465
  <th class="description" scope="col">
466
- <div><?php _e( 'Description', 'flag' ); ?></div>
467
  </th>
468
  </tr>
469
  </thead>
470
  <tfoot>
471
  <tr>
472
- <th class="cb" scope="col"><a href="#" onclick="checkAll(document.getElementById('bannerlib'));return false;"><?php _e( 'Check', 'flag' ); ?></a></th>
473
- <th class="id" scope="col"><?php _e( 'ID', 'flag' ); ?></th>
474
- <th class="thumb" scope="col"><?php _e( 'Thumbnail', 'flag' ); ?></th>
475
- <th class="title_filename" scope="col"><?php _e( 'Filename / Title / Link', 'flag' ); ?></th>
476
- <th class="description" scope="col"><?php _e( 'Description', 'flag' ); ?></th>
477
  </tr>
478
  </tfoot>
479
  <tbody>
@@ -490,7 +490,7 @@ function flag_banner_wp_media_lib( $added = false ) {
490
  $ex = $checked = '';
491
  if ( ( $added !== false || ! empty( $items_array_default ) ) && in_array( $ban->ID, $exclude ) ) {
492
  $class .= ' already-added';
493
- $ex = ' title="' . __( "Already Added", "flag" ) . '"';
494
  $checked = ' checked="checked"';
495
  }
496
  $thumb = get_post_meta( $ban->ID, 'thumbnail', true );
@@ -509,7 +509,7 @@ function flag_banner_wp_media_lib( $added = false ) {
509
  <td class="title_filename">
510
  <strong><a href="<?php echo $url; ?>"><?php echo basename( $url ); ?></a></strong><br/>
511
  <textarea title="Title" name="item_a[<?php echo $ban->ID; ?>][post_title]" cols="20" rows="1" style="width:95%; height: 25px; overflow:hidden;"><?php echo esc_html( stripslashes( $ban->post_title ) ); ?></textarea><br/>
512
- <?php _e( 'URL', 'flag' ); ?>: <input id="banlink-<?php echo $ban->ID; ?>" name="item_a[<?php echo $ban->ID; ?>][link]" style="width:50%;" type="text" value="<?php echo esc_url( $link ); ?>"/><br/>
513
  </td>
514
  <td class="description">
515
  <textarea name="item_a[<?php echo $ban->ID; ?>][post_content]" style="width:95%; height: 96px; margin-top: 2px; font-size:12px; line-height:115%;" rows="1"><?php echo esc_html( stripslashes( $ban->post_content ) ); ?></textarea>
@@ -518,7 +518,7 @@ function flag_banner_wp_media_lib( $added = false ) {
518
  <?php
519
  }
520
  } else {
521
- echo '<tr><td colspan="5" align="center"><strong>' . __( 'No images in WordPress Media Library.', 'flag' ) . '</strong></td></tr>';
522
  }
523
  ?>
524
  </tbody>
@@ -536,10 +536,10 @@ function flag_banner_wp_media_lib( $added = false ) {
536
  <input type="hidden" name="page" value="banner-box"/>
537
  <table width="100%" border="0" cellspacing="3" cellpadding="3">
538
  <tr valign="top">
539
- <th align="left" style="padding-top: 5px;"><?php _e( 'Playlist Title', 'flag' ); ?></th>
540
  <td><input type="text" class="alignleft" name="playlist_title" value=""/>
541
 
542
- <div class="alignright"><strong><?php _e( "Choose skin", 'flag' ); ?>:</strong>
543
  <select id="skinname" name="skinname" style="width: 200px; height: 24px; font-size: 11px;">
544
  <?php require_once( dirname( __FILE__ ) . '/get_skin.php' );
545
  $all_skins = get_skins( $skin_folder = '', $type = 'b' );
@@ -548,7 +548,7 @@ function flag_banner_wp_media_lib( $added = false ) {
548
  echo '<option value="' . dirname( $skin_file ) . '">' . $skin_data['Name'] . '</option>' . "\n";
549
  }
550
  } else {
551
- echo '<option value="rotator_default">' . __( "No Skins", "flag" ) . '</option>';
552
  }
553
  ?>
554
  </select>
@@ -556,14 +556,14 @@ function flag_banner_wp_media_lib( $added = false ) {
556
  </td>
557
  </tr>
558
  <tr valign="top">
559
- <th align="left" style="padding-top: 5px;"><?php _e( 'Playlist Description', 'flag' ); ?></th>
560
  <td><textarea style="width:100%;" rows="3" cols="60" name="playlist_descr"></textarea></td>
561
  </tr>
562
  <tr>
563
  <td>&nbsp;</td>
564
- <td align="right"><input class="button-secondary" type="reset" value="&nbsp;<?php _e( 'Cancel', 'flag' ); ?>&nbsp;" onclick="tb_remove()"/>
565
  &nbsp; &nbsp; &nbsp;
566
- <input class="button-primary " type="submit" name="TB_NewPlaylist" value="<?php _e( 'OK', 'flag' ); ?>"/>
567
  </td>
568
  </tr>
569
  </table>
99
  if ( isset( $_POST['updateMedia'] ) ) {
100
  check_admin_referer( 'flag_update' );
101
  flagGallery::flagSaveWpMedia();
102
+ flagGallery::show_message( __( 'Media updated', 'flash-album-gallery' ) );
103
  }
104
  default:
105
  flag_created_b_playlists();
145
  );
146
  } else{
147
  var refpage = window.location.href;
148
+ jQuery(".flag_crunching .txt").html('<a href="' + refpage + '"><?php _e("Import folder is complete. The page reloads after 5 seconds.", "flash-album-gallery"); ?></a>');
149
+ //alert('<?php _e("Import folder complete. Refresh page.", "flash-album-gallery"); ?>');
150
+ setTimeout(function(){ window.location.href = refpage }, 5000);
151
  }
152
  }
153
 
168
 
169
  ?>
170
  <div class="flag-wrap">
171
+ <h2><?php _e( 'Created playlists', 'flash-album-gallery' ); ?></h2>
172
  <table class="widefat flag-table" cellspacing="0">
173
  <thead>
174
  <tr>
175
+ <th scope="col" width="25%"><?php _e( 'Title', 'flash-album-gallery' ); ?></th>
176
+ <th scope="col" width="55%"><?php _e( 'Description', 'flash-album-gallery' ); ?></th>
177
+ <th scope="col"><?php _e( 'Quantity', 'flash-album-gallery' ); ?></th>
178
+ <th scope="col"><?php _e( 'Shortcode', 'flash-album-gallery' ); ?></th>
179
+ <th scope="col"><?php _e( 'Action', 'flash-album-gallery' ); ?></th>
180
  </tr>
181
  </thead>
182
  <tbody>
197
  </a>
198
  </td>
199
  <td><?php echo esc_html( $playlist_data['description'] );
200
+ echo '&nbsp;(' . __( "player", "flash-album-gallery" ) . ': <strong>' . esc_html( $playlist_data['skin'] ) . '</strong>)' ?></td>
201
  <td><?php echo count( $query_m ); ?></td>
202
  <td style="white-space: nowrap;"><input type="text" class="shortcode1" style="width: 200px; font-size: 9px;" readonly="readonly" onfocus="this.select()" value="[grandbanner xml=<?php echo $playlist_name; ?>]"/></td>
203
  <td>
204
+ <a href="<?php echo wp_nonce_url( $filepath . '&playlist=' . $playlist_name . "&mode=delete", 'flag_delete' ); ?>" class="delete" onclick="javascript:check=confirm( '<?php _e( "Delete this playlist?", 'flash-album-gallery' ) ?>');if(check==false) {return false;
205
+ }"><?php _e( 'Delete', 'flash-album-gallery' ); ?></a>
206
  </td>
207
  </tr>
208
  <?php
209
  }
210
  } else {
211
+ echo '<tr><td colspan="5" align="center"><strong>' . __( 'No playlists found', 'flash-album-gallery' ) . '</strong></td></tr>';
212
  }
213
  ?>
214
  </tbody>
310
  // this function check for a the number of selected images, sumbmit false when no one selected
311
  function checkSelected(){
312
  if(!jQuery('#items_array').val()){
313
+ alert('<?php echo esc_js(__("No items selected", "flash-album-gallery")); ?>');
314
  return false;
315
  }
316
  var actionId = jQuery('#bulkaction').val();
356
 
357
  <!-- import folder -->
358
  <div id="importfolder">
359
+ <h2><?php _e( 'Import banners from folder', 'flash-album-gallery' ); ?></h2>
360
 
361
  <form name="importfolder" id="importfolder_form" method="POST" action="<?php echo $filepath; ?>" accept-charset="utf-8">
362
  <?php wp_nonce_field( 'flag_addbanner' ); ?>
363
  <table class="form-table">
364
  <tr valign="top">
365
+ <th scope="row"><?php _e( 'Import from Server path:', 'flash-album-gallery' ); ?></th>
366
+ <td><input type="text" size="35" id="bannerfolder" name="bannerfolder" value="<?php echo $defaultpath; ?>"/><span class="browsefiles button" style="display:none"><?php _e( 'Browse...', "flash-album-gallery" ); ?></span>
367
 
368
  <div id="file_browser"></div>
369
  <br/>
370
  <p><label><input type="checkbox" name="delete_files" value="delete"/> &nbsp;
371
+ <?php _e( 'delete files after import in WordPress Media Library', 'flash-album-gallery' ); ?></label></p>
372
  </td>
373
  </tr>
374
  </table>
375
+ <div class="submit"><input class="button-primary" type="submit" name="importfolder" value="<?php _e( 'Import folder', 'flash-album-gallery' ); ?>"/></div>
376
  </form>
377
  </div>
378
  <?php } ?>
379
  <?php } ?>
380
 
381
+ <h2><?php _e( 'WordPress Image Library', 'flash-album-gallery' ); ?></h2>
382
 
383
  <?php
384
  // look for pagination
412
  ?>
413
  <div class="tablenav" style="overflow: hidden; height: auto;">
414
  <?php if ( $added === false ) { ?>
415
+ <div class="alignleft"><b><?php _e( 'Selected Media', 'flash-album-gallery' ); ?>: </b><input style="width:500px;" type="text" readonly="readonly" id="items_array" name="items_array" value="<?php echo $items_array_default; ?>"/>
416
+ <span class="clear_selected button"><?php _e( 'Clear Selected', 'flash-album-gallery' ); ?></span></div>
417
  <?php } ?>
418
  <div class="tablenav-pages"><?php $page_links_text = sprintf( '<span class="displaying-num">' . __( 'Displaying %s&#8211;%s of %s' ) . '</span>%s', number_format_i18n( ( $_GET['paged'] - 1 ) * $objects_per_page + 1 ), number_format_i18n( min( $_GET['paged'] * $objects_per_page, $img_total_count ) ), number_format_i18n( $img_total_count ), $page_links );
419
  echo $page_links_text; ?></div>
426
 
427
  <div class="actions">
428
  <?php if ( $added === false ) { ?>
429
+ <input name="updateMedia" class="button-primary" style="float: right;" type="submit" value="<?php _e( 'Update Media', 'flash-album-gallery' ); ?>"/>
430
  <?php if ( function_exists( 'json_encode' ) ) { ?>
431
  <select name="bulkaction" id="bulkaction">
432
+ <option value="no_action"><?php _e( "No action", 'flash-album-gallery' ); ?></option>
433
+ <option value="new_playlist"><?php _e( "Create new playlist", 'flash-album-gallery' ); ?></option>
434
  </select>
435
+ <input name="showThickbox" class="button-secondary" type="submit" value="<?php _e( 'Apply', 'flash-album-gallery' ); ?>" onclick="if ( !checkSelected() ) {return false;
436
  }"/>
437
  <?php } ?>
438
+ <a href="<?php echo admin_url( 'media-new.php' ); ?>" class="button" style="display: inline-block; margin: 0;"><?php _e( 'Upload Banner(s)', 'flash-album-gallery' ); ?></a>
439
  <input type="hidden" id="items_array" name="items_array" value=""/>
440
  <?php } else { ?>
441
  <input type="hidden" name="mode" value="save"/>
444
  <input type="hidden" name="skinname" value="<?php echo sanitize_flagname( $playlist['skin'] ); ?>"/>
445
  <input type="hidden" name="skinaction" value="<?php echo sanitize_flagname( $playlist['skin'] ); ?>"/>
446
  <textarea style="display: none;" name="playlist_descr" cols="40" rows="1"><?php echo esc_html( $playlist['description'] ); ?></textarea>
447
+ <input name="addToPlaylist" class="button-secondary" type="submit" value="<?php _e( 'Update Playlist', 'flash-album-gallery' ); ?>"/>
448
  <?php } ?>
449
  </div>
450
 
452
  <table class="widefat flag-table" cellspacing="0">
453
  <thead>
454
  <tr>
455
+ <th class="cb" width="54" scope="col"><a href="#" onclick="checkAll(document.getElementById('bannerlib'));return false;"><?php _e( 'Check', 'flash-album-gallery' ); ?></a></th>
456
  <th class="id" width="64" scope="col">
457
+ <div><?php _e( 'ID', 'flash-album-gallery' ); ?></div>
458
  </th>
459
  <th class="thumb" width="110" scope="col">
460
+ <div><?php _e( 'Thumbnail', 'flash-album-gallery' ); ?></div>
461
  </th>
462
  <th class="title_filename" scope="col">
463
+ <div><?php _e( 'Filename / Title / Link', 'flash-album-gallery' ); ?></div>
464
  </th>
465
  <th class="description" scope="col">
466
+ <div><?php _e( 'Description', 'flash-album-gallery' ); ?></div>
467
  </th>
468
  </tr>
469
  </thead>
470
  <tfoot>
471
  <tr>
472
+ <th class="cb" scope="col"><a href="#" onclick="checkAll(document.getElementById('bannerlib'));return false;"><?php _e( 'Check', 'flash-album-gallery' ); ?></a></th>
473
+ <th class="id" scope="col"><?php _e( 'ID', 'flash-album-gallery' ); ?></th>
474
+ <th class="thumb" scope="col"><?php _e( 'Thumbnail', 'flash-album-gallery' ); ?></th>
475
+ <th class="title_filename" scope="col"><?php _e( 'Filename / Title / Link', 'flash-album-gallery' ); ?></th>
476
+ <th class="description" scope="col"><?php _e( 'Description', 'flash-album-gallery' ); ?></th>
477
  </tr>
478
  </tfoot>
479
  <tbody>
490
  $ex = $checked = '';
491
  if ( ( $added !== false || ! empty( $items_array_default ) ) && in_array( $ban->ID, $exclude ) ) {
492
  $class .= ' already-added';
493
+ $ex = ' title="' . __( "Already Added", "flash-album-gallery" ) . '"';
494
  $checked = ' checked="checked"';
495
  }
496
  $thumb = get_post_meta( $ban->ID, 'thumbnail', true );
509
  <td class="title_filename">
510
  <strong><a href="<?php echo $url; ?>"><?php echo basename( $url ); ?></a></strong><br/>
511
  <textarea title="Title" name="item_a[<?php echo $ban->ID; ?>][post_title]" cols="20" rows="1" style="width:95%; height: 25px; overflow:hidden;"><?php echo esc_html( stripslashes( $ban->post_title ) ); ?></textarea><br/>
512
+ <?php _e( 'URL', 'flash-album-gallery' ); ?>: <input id="banlink-<?php echo $ban->ID; ?>" name="item_a[<?php echo $ban->ID; ?>][link]" style="width:50%;" type="text" value="<?php echo esc_url( $link ); ?>"/><br/>
513
  </td>
514
  <td class="description">
515
  <textarea name="item_a[<?php echo $ban->ID; ?>][post_content]" style="width:95%; height: 96px; margin-top: 2px; font-size:12px; line-height:115%;" rows="1"><?php echo esc_html( stripslashes( $ban->post_content ) ); ?></textarea>
518
  <?php
519
  }
520
  } else {
521
+ echo '<tr><td colspan="5" align="center"><strong>' . __( 'No images in WordPress Media Library.', 'flash-album-gallery' ) . '</strong></td></tr>';
522
  }
523
  ?>
524
  </tbody>
536
  <input type="hidden" name="page" value="banner-box"/>
537
  <table width="100%" border="0" cellspacing="3" cellpadding="3">
538
  <tr valign="top">
539
+ <th align="left" style="padding-top: 5px;"><?php _e( 'Playlist Title', 'flash-album-gallery' ); ?></th>
540
  <td><input type="text" class="alignleft" name="playlist_title" value=""/>
541
 
542
+ <div class="alignright"><strong><?php _e( "Choose skin", 'flash-album-gallery' ); ?>:</strong>
543
  <select id="skinname" name="skinname" style="width: 200px; height: 24px; font-size: 11px;">
544
  <?php require_once( dirname( __FILE__ ) . '/get_skin.php' );
545
  $all_skins = get_skins( $skin_folder = '', $type = 'b' );
548
  echo '<option value="' . dirname( $skin_file ) . '">' . $skin_data['Name'] . '</option>' . "\n";
549
  }
550
  } else {
551
+ echo '<option value="nivoslider">' . __( "No Skins", "flash-album-gallery" ) . '</option>';
552
  }
553
  ?>
554
  </select>
556
  </td>
557
  </tr>
558
  <tr valign="top">
559
+ <th align="left" style="padding-top: 5px;"><?php _e( 'Playlist Description', 'flash-album-gallery' ); ?></th>
560
  <td><textarea style="width:100%;" rows="3" cols="60" name="playlist_descr"></textarea></td>
561
  </tr>
562
  <tr>
563
  <td>&nbsp;</td>
564
+ <td align="right"><input class="button-secondary" type="reset" value="&nbsp;<?php _e( 'Cancel', 'flash-album-gallery' ); ?>&nbsp;" onclick="tb_remove()"/>
565
  &nbsp; &nbsp; &nbsp;
566
+ <input class="button-primary " type="submit" name="TB_NewPlaylist" value="<?php _e( 'OK', 'flash-album-gallery' ); ?>"/>
567
  </td>
568
  </tr>
569
  </table>
admin/banner-sort.php CHANGED
@@ -15,15 +15,15 @@ function flag_b_playlist_order( $playlist = 'deprecated' ) {
15
  <script type="text/javascript" src="<?php echo FLAG_URLPATH; ?>admin/js/jquery.tablednd_0_5.js"></script>
16
  <script type="text/javascript" src="<?php echo FLAG_URLPATH; ?>admin/js/jquery.tablesorter.js"></script>
17
  <div class="flag-wrap">
18
- <h2><?php _e( 'Sort Gallery', 'flag' ); ?></h2>
19
 
20
  <div class="alignright tablenav" style="margin-bottom: -36px;">
21
- <a href="<?php echo esc_url( $base_url . '&playlist=' . $filename . '&mode=edit' ); ?>" class="button-secondary action"><?php _e( 'Back to playlist', 'flag' ); ?></a>
22
  </div>
23
  <form id="sortPlaylist" method="POST" action="<?php echo esc_url( $base_url . '&playlist=' . $filename . '&mode=edit' ); ?>" accept-charset="utf-8">
24
  <div class="alignleft tablenav">
25
  <?php wp_nonce_field( 'flag_update' ); ?>
26
- <input class="button-primary action" type="submit" name="updatePlaylist" value="<?php _e( 'Update Sort Order', 'flag' ); ?>"/>
27
  </div>
28
  <br clear="all"/>
29
  <input type="hidden" name="playlist_title" value="<?php echo esc_html( $playlist['title'] ); ?>"/>
@@ -63,18 +63,18 @@ function flag_b_playlist_order( $playlist = 'deprecated' ) {
63
 
64
  <thead>
65
  <tr>
66
- <th class="header" width="54"><p style="margin-right:-10px;"><?php _e( 'ID', 'flag' ); ?></p></th>
67
- <th width="50"><p><?php _e( 'Thumb', 'flag' ); ?></p></th>
68
- <th class="header"><p><?php _e( 'Filename', 'flag' ); ?></p></th>
69
- <th class="header"><p><?php _e( 'Title', 'flag' ); ?></p></th>
70
  </tr>
71
  </thead>
72
  <tfoot>
73
  <tr>
74
- <th><p><?php _e( 'ID', 'flag' ); ?></p></th>
75
- <th><p><?php _e( 'Thumb', 'flag' ); ?></p></th>
76
- <th><p><?php _e( 'Filename', 'flag' ); ?></p></th>
77
- <th><p><?php _e( 'Title', 'flag' ); ?></p></th>
78
  </tr>
79
  </tfoot>
80
  <tbody id="listitems">
@@ -94,19 +94,19 @@ function flag_b_playlist_order( $playlist = 'deprecated' ) {
94
  ?>
95
  <tr id="$ban-<?php echo $ban->ID; ?>" class="<?php echo $alternate; ?> iedit" valign="top">
96
  <td scope="row"><input type="hidden" name="item_a[<?php echo $ban->ID; ?>][ID]" value="<?php echo $ban->ID; ?>"/><strong><?php echo $ban->ID; ?></strong></td>
97
- <td width="100"><a class="thickbox" title="<?php echo basename( $url ); ?>" href="<?php echo $url; ?>"><img id="thumb-<?php echo $ban->ID; ?>" src="<?php echo $thumb; ?>" width="80" style="height:auto" alt=""/></a></td>
98
  <td><?php echo basename( $url ); ?></td>
99
  <td><?php echo esc_html( stripslashes( $ban->post_title ) ); ?></td>
100
  </tr>
101
  <?php
102
  }
103
  } else {
104
- echo '<tr><td colspan="4" align="center"><strong>' . __( 'No entries found', 'flag' ) . '</strong></td></tr>';
105
  }
106
  ?>
107
  </tbody>
108
  </table>
109
- <p class="actions"><input type="submit" class="button-primary action" name="updatePlaylist" value="<?php _e( 'Update Sort Order', 'flag' ); ?>"/></p>
110
  </form>
111
  <br class="clear"/>
112
  </div><!-- /#wrap -->
15
  <script type="text/javascript" src="<?php echo FLAG_URLPATH; ?>admin/js/jquery.tablednd_0_5.js"></script>
16
  <script type="text/javascript" src="<?php echo FLAG_URLPATH; ?>admin/js/jquery.tablesorter.js"></script>
17
  <div class="flag-wrap">
18
+ <h2><?php _e( 'Sort Gallery', 'flash-album-gallery' ); ?></h2>
19
 
20
  <div class="alignright tablenav" style="margin-bottom: -36px;">
21
+ <a href="<?php echo esc_url( $base_url . '&playlist=' . $filename . '&mode=edit' ); ?>" class="button-secondary action"><?php _e( 'Back to playlist', 'flash-album-gallery' ); ?></a>
22
  </div>
23
  <form id="sortPlaylist" method="POST" action="<?php echo esc_url( $base_url . '&playlist=' . $filename . '&mode=edit' ); ?>" accept-charset="utf-8">
24
  <div class="alignleft tablenav">
25
  <?php wp_nonce_field( 'flag_update' ); ?>
26
+ <input class="button-primary action" type="submit" name="updatePlaylist" value="<?php _e( 'Update Sort Order', 'flash-album-gallery' ); ?>"/>
27
  </div>
28
  <br clear="all"/>
29
  <input type="hidden" name="playlist_title" value="<?php echo esc_html( $playlist['title'] ); ?>"/>
63
 
64
  <thead>
65
  <tr>
66
+ <th class="header" width="54"><p style="margin-right:-10px;"><?php _e( 'ID', 'flash-album-gallery' ); ?></p></th>
67
+ <th width="120"><p><?php _e( 'Thumb', 'flash-album-gallery' ); ?></p></th>
68
+ <th class="header"><p><?php _e( 'Filename', 'flash-album-gallery' ); ?></p></th>
69
+ <th class="header"><p><?php _e( 'Title', 'flash-album-gallery' ); ?></p></th>
70
  </tr>
71
  </thead>
72
  <tfoot>
73
  <tr>
74
+ <th><p><?php _e( 'ID', 'flash-album-gallery' ); ?></p></th>
75
+ <th><p><?php _e( 'Thumb', 'flash-album-gallery' ); ?></p></th>
76
+ <th><p><?php _e( 'Filename', 'flash-album-gallery' ); ?></p></th>
77
+ <th><p><?php _e( 'Title', 'flash-album-gallery' ); ?></p></th>
78
  </tr>
79
  </tfoot>
80
  <tbody id="listitems">
94
  ?>
95
  <tr id="$ban-<?php echo $ban->ID; ?>" class="<?php echo $alternate; ?> iedit" valign="top">
96
  <td scope="row"><input type="hidden" name="item_a[<?php echo $ban->ID; ?>][ID]" value="<?php echo $ban->ID; ?>"/><strong><?php echo $ban->ID; ?></strong></td>
97
+ <td><a class="thickbox" title="<?php echo basename( $url ); ?>" href="<?php echo $url; ?>"><img id="thumb-<?php echo $ban->ID; ?>" src="<?php echo $thumb; ?>" width="80" style="height:auto" alt=""/></a></td>
98
  <td><?php echo basename( $url ); ?></td>
99
  <td><?php echo esc_html( stripslashes( $ban->post_title ) ); ?></td>
100
  </tr>
101
  <?php
102
  }
103
  } else {
104
+ echo '<tr><td colspan="4" align="center"><strong>' . __( 'No entries found', 'flash-album-gallery' ) . '</strong></td></tr>';
105
  }
106
  ?>
107
  </tbody>
108
  </table>
109
+ <p class="actions"><input type="submit" class="button-primary action" name="updatePlaylist" value="<?php _e( 'Update Sort Order', 'flash-album-gallery' ); ?>"/></p>
110
  </form>
111
  <br class="clear"/>
112
  </div><!-- /#wrap -->
admin/banner.functions.php CHANGED
@@ -1,117 +1,140 @@
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
- function get_b_playlist_data( $playlist_file ) {
7
 
8
- $playlist_content = file_get_contents( $playlist_file );
9
 
10
- $playlist_data['title'] = flagGallery::flagGetBetween( $playlist_content, '<title><![CDATA[', ']]></title>' );
11
- $playlist_data['skin'] = flagGallery::flagGetBetween( $playlist_content, '<skin><![CDATA[', ']]></skin>' );
12
- $playlist_data['width'] = flagGallery::flagGetBetween( $playlist_content, '<width><![CDATA[', ']]></width>' );
13
- $playlist_data['height'] = flagGallery::flagGetBetween( $playlist_content, '<height><![CDATA[', ']]></height>' );
14
- $playlist_data['description'] = flagGallery::flagGetBetween( $playlist_content, '<description><![CDATA[', ']]></description>' );
15
- preg_match_all( '|<item id="(.*)">|', $playlist_content, $items );
16
- $playlist_data['items'] = $items[1];
17
 
18
- return $playlist_data;
19
  }
20
 
21
  /**
22
  * Check the playlists directory and retrieve all playlist files with playlist data.
23
  *
24
  */
25
- function get_b_playlists( $playlist_folder = '' ) {
26
-
27
- $flag_options = get_option( 'flag_options' );
28
- $flag_playlists = array();
29
- $playlist_root = ABSPATH . $flag_options['galleryPath'] . 'playlists/banner';
30
- if ( ! empty( $playlist_folder ) ) {
31
- $playlist_root = $playlist_folder;
32
- }
33
-
34
- // Files in flagallery/playlists directory
35
- $playlists_dir = @ opendir( $playlist_root );
36
- $playlist_files = array();
37
- if ( $playlists_dir ) {
38
- while( ( $file = readdir( $playlists_dir ) ) !== false ){
39
- if ( substr( $file, 0, 1 ) == '.' ) {
40
- continue;
41
- }
42
- if ( substr( $file, - 4 ) == '.xml' ) {
43
- $playlist_files[] = $file;
44
- }
45
- }
46
- }
47
- @closedir( $playlists_dir );
48
-
49
- if ( ! $playlists_dir || empty( $playlist_files ) ) {
50
- return $flag_playlists;
51
- }
52
-
53
- foreach ( $playlist_files as $playlist_file ) {
54
- if ( ! is_readable( "$playlist_root/$playlist_file" ) ) {
55
- continue;
56
- }
57
-
58
- $playlist_data = get_b_playlist_data( "$playlist_root/$playlist_file" );
59
-
60
- if ( empty ( $playlist_data['title'] ) ) {
61
- continue;
62
- }
63
-
64
- $flag_playlists[ basename( $playlist_file, ".xml" ) ] = $playlist_data;
65
- }
66
- uasort( $flag_playlists, create_function( '$a, $b', 'return strnatcasecmp( $a["title"], $b["title"] );' ) );
67
-
68
- return $flag_playlists;
69
  }
70
 
71
- function flagSave_bPlaylist( $title, $descr, $data, $file = '', $skinaction = '' ) {
72
-
73
- require_once( ABSPATH . '/wp-admin/includes/image.php' );
74
- if ( ! trim( $title ) ) {
75
- $title = 'default';
76
- }
77
- $title = htmlspecialchars_decode( stripslashes( $title ), ENT_QUOTES );
78
- $descr = htmlspecialchars_decode( stripslashes( $descr ), ENT_QUOTES );
79
- if ( ! $file ) {
80
- $file = sanitize_flagname( $title );
81
- }
82
- if ( ! is_array( $data ) ) {
83
- $data = explode( ',', $data );
84
- }
85
-
86
- $flag_options = get_option( 'flag_options' );
87
- $skin = isset( $_POST['skinname'] ) ? sanitize_flagname( $_POST['skinname'] ) : 'rotator_default';
88
- if ( ! $skinaction ) {
89
- $skinaction = isset( $_POST['skinaction'] ) ? sanitize_key( $_POST['skinaction'] ) : 'update';
90
- }
91
- $skinpath = trailingslashit( $flag_options['skinsDirABS'] ) . $skin;
92
- $playlistPath = ABSPATH . $flag_options['galleryPath'] . 'playlists/banner/' . $file . '.xml';
93
- $settings = '';
94
- if ( file_exists( $playlistPath ) && ( $skin == $skinaction ) ) {
95
- $settings = file_get_contents( $playlistPath );
96
- } elseif ( file_exists( $skinpath . "/settings/settings.xml" ) ) {
97
- $settings = file_get_contents( $skinpath . "/settings/settings.xml" );
98
- } else {
99
- flagGallery::show_message( __( "Can't find skin settings", 'flag' ) );
100
-
101
- return;
102
- }
103
- $properties = flagGallery::flagGetBetween( $settings, '<properties>', '</properties>' );
104
- if ( empty( $properties ) ) {
105
- flagGallery::show_message( __( "Can't find skin settings", 'flag' ) );
106
-
107
- return;
108
- }
109
- $w = flagGallery::flagGetBetween( $properties, '<width><![CDATA[', ']]></width>' );
110
- $h = flagGallery::flagGetBetween( $properties, '<height><![CDATA[', ']]></height>' );
111
- $suffix = $w . 'x' . $h;
112
- if ( count( $data ) ) {
113
- $content = '<gallery>
114
- <properties>' . $properties . '</properties>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
115
  <category id="' . $file . '">
116
  <properties>
117
  <title><![CDATA[' . $title . ']]></title>
@@ -120,89 +143,58 @@ function flagSave_bPlaylist( $title, $descr, $data, $file = '', $skinaction = ''
120
  </properties>
121
  <items>';
122
 
123
- foreach ( (array) $data as $id ) {
124
- $ban = get_post( $id );
125
- if ( $ban->ID ) {
126
- $url = wp_get_attachment_url( $ban->ID );
127
- if ( $skin == 'rotator_default' ) {
128
- $path = get_attached_file( $ban->ID );
129
- $info = pathinfo( $path );
130
- $dir = $info['dirname'];
131
- $ext = $info['extension'];
132
- $name = urldecode( basename( str_replace( '%2F', '/', urlencode( $path ) ), ".$ext" ) );
133
- $img_file = "{$dir}/{$name}-{$suffix}.{$ext}";
134
- if ( ! file_exists( $img_file ) ) {
135
- if ( function_exists( 'wp_get_image_editor' ) ) {
136
- $editor = wp_get_image_editor( $path );
137
- $editor->resize( $w, $h, $cut = true );
138
- $dest_file = $editor->generate_filename( $suffix );
139
- $thumb = $editor->save( $dest_file );
140
- } else {
141
- $thumb = image_resize( $path, $w, $h, $cut = true, $suffix );
142
- }
143
- if ( is_string( $thumb ) ) {
144
- $img = substr( $thumb, strpos( $thumb, basename( WP_CONTENT_DIR ) ) );
145
- $track = get_bloginfo( 'wpurl' ) . '/' . $img;
146
- } else {
147
- $track = $url;
148
- }
149
-
150
- } else {
151
- $track = dirname( $url ) . "/{$name}-{$suffix}.{$ext}";
152
- }
153
- } else {
154
- $track = $url;
155
- }
156
- $thumbnail = get_post_meta( $id, 'thumbnail', true );
157
- $link = get_post_meta( $id, 'link', true );
158
- $preview = get_post_meta( $id, 'preview', true );
159
- $content .= '
160
  <item id="' . $ban->ID . '">
161
- <track>' . $track . '</track>
162
  <title><![CDATA[' . $ban->post_title . ']]></title>
163
  <link>' . $link . '</link>
164
- <preview>' . $preview . '</preview>
165
  <description><![CDATA[' . $ban->post_content . ']]></description>
166
  <thumbnail>' . $thumbnail . '</thumbnail>
167
  </item>';
168
- }
169
- }
170
- $content .= '
171
  </items>
172
  </category>
173
  </gallery>';
174
- //$content = str_replace(array('\\\'','\"'), array('\'','"'), $content);
175
- // Save options
176
- $flag_options = get_option( 'flag_options' );
177
- if ( wp_mkdir_p( ABSPATH . $flag_options['galleryPath'] . 'playlists/banner/' ) ) {
178
- if ( flagGallery::saveFile( $playlistPath, $content, 'w' ) ) {
179
- flagGallery::show_message( __( 'Playlist Saved Successfully', 'flag' ) );
180
- }
181
- } else {
182
- flagGallery::show_message( __( 'Create directory please:', 'flag' ) . '"/' . $flag_options['galleryPath'] . 'playlists/banner/"' );
183
- }
184
- }
185
  }
186
 
187
- function flagSave_bPlaylistSkin( $file ) {
188
- $file = sanitize_flagname( $file );
189
- $flag_options = get_option( 'flag_options' );
190
- $playlistPath = ABSPATH . $flag_options['galleryPath'] . 'playlists/banner/' . $file . '.xml';
191
- // Save options
192
- $title = esc_html( $_POST['playlist_title'] );
193
- $descr = esc_html( $_POST['playlist_descr'] );
194
- $items = get_b_playlist_data( $playlistPath );
195
- $data = $items['items'];
196
- flagSave_bPlaylist( $title, $descr, $data, $file, $skinaction = 'update' );
197
  }
198
 
199
- function flag_b_playlist_delete( $playlist ) {
200
- $playlist = sanitize_file_name( $playlist );
201
- $flag_options = get_option( 'flag_options' );
202
- $playlistXML = ABSPATH . $flag_options['galleryPath'] . 'playlists/banner/' . $playlist . '.xml';
203
- if ( file_exists( $playlistXML ) ) {
204
- if ( unlink( $playlistXML ) ) {
205
- flagGallery::show_message( "'" . $playlist . ".xml' " . __( 'deleted', 'flag' ) );
206
- }
207
- }
208
  }
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
+ function get_b_playlist_data($playlist_file){
7
 
8
+ $playlist_content = file_get_contents($playlist_file);
9
 
10
+ $playlist_data['settings'] = flagGallery::flagGetBetween($playlist_content, '<settings><![CDATA[', ']]></settings>');
11
+ $playlist_data['title'] = flagGallery::flagGetBetween($playlist_content, '<title><![CDATA[', ']]></title>');
12
+ $playlist_data['skin'] = flagGallery::flagGetBetween($playlist_content, '<skin><![CDATA[', ']]></skin>');
13
+ $playlist_data['description'] = flagGallery::flagGetBetween($playlist_content, '<description><![CDATA[', ']]></description>');
14
+ preg_match_all('|<item id="(.*)">|', $playlist_content, $items);
15
+ $playlist_data['items'] = $items[1];
 
16
 
17
+ return $playlist_data;
18
  }
19
 
20
  /**
21
  * Check the playlists directory and retrieve all playlist files with playlist data.
22
  *
23
  */
24
+ function get_b_playlists($playlist_folder = ''){
25
+
26
+ $flag_options = get_option('flag_options');
27
+ $flag_playlists = array();
28
+ $playlist_root = ABSPATH . $flag_options['galleryPath'] . 'playlists/banner';
29
+ if( !empty($playlist_folder)){
30
+ $playlist_root = $playlist_folder;
31
+ }
32
+
33
+ // Files in flagallery/playlists directory
34
+ $playlists_dir = @ opendir($playlist_root);
35
+ $playlist_files = array();
36
+ if($playlists_dir){
37
+ while(($file = readdir($playlists_dir)) !== false){
38
+ if(substr($file, 0, 1) == '.'){
39
+ continue;
40
+ }
41
+ if(substr($file, - 4) == '.xml'){
42
+ $playlist_files[] = $file;
43
+ }
44
+ }
45
+ }
46
+ @closedir($playlists_dir);
47
+
48
+ if( !$playlists_dir || empty($playlist_files)){
49
+ return $flag_playlists;
50
+ }
51
+
52
+ foreach($playlist_files as $playlist_file){
53
+ if( !is_readable("$playlist_root/$playlist_file")){
54
+ continue;
55
+ }
56
+
57
+ $playlist_data = get_b_playlist_data("$playlist_root/$playlist_file");
58
+
59
+ if(empty ($playlist_data['title'])){
60
+ continue;
61
+ }
62
+
63
+ $flag_playlists[ basename($playlist_file, ".xml") ] = $playlist_data;
64
+ }
65
+ uasort($flag_playlists, create_function('$a, $b', 'return strnatcasecmp( $a["title"], $b["title"] );'));
66
+
67
+ return $flag_playlists;
68
  }
69
 
70
+ function flagSave_bPlaylist($title, $descr, $data, $file = '', $skinaction = ''){
71
+
72
+ require_once(ABSPATH . '/wp-admin/includes/image.php');
73
+ if( !trim($title)){
74
+ $title = 'default';
75
+ }
76
+ $title = htmlspecialchars_decode(stripslashes($title), ENT_QUOTES);
77
+ $descr = htmlspecialchars_decode(stripslashes($descr), ENT_QUOTES);
78
+ if( !$file){
79
+ $file = sanitize_flagname($title);
80
+ }
81
+ if( !is_array($data)){
82
+ $data = explode(',', $data);
83
+ }
84
+
85
+ $flag_options = get_option('flag_options');
86
+ $skin = isset($_POST['skinname'])? sanitize_flagname($_POST['skinname']) : 'nivoslider';
87
+ if( !$skinaction){
88
+ $skinaction = isset($_POST['skinaction'])? sanitize_key($_POST['skinaction']) : 'update';
89
+ }
90
+ $skinpath = str_replace("\\","/", WP_PLUGIN_DIR ).'/flagallery-skins/'.$skin;
91
+ if(!is_dir($skinpath)) {
92
+ $skinpath = str_replace("\\","/", WP_PLUGIN_DIR ).'/flash-album-gallery/skins/'.$skin;
93
+ if(!is_dir($skinpath)) {
94
+ $skin = 'nivoslider';
95
+ $skinpath = str_replace("\\","/", WP_PLUGIN_DIR ).'/flagallery-skins/'.$skin;
96
+ if(!is_dir($skinpath)) {
97
+ $skinpath = str_replace("\\","/", WP_PLUGIN_DIR ).'/flash-album-gallery/skins/'.$skin;
98
+ }
99
+ }
100
+ }
101
+ $playlistPath = ABSPATH . $flag_options['galleryPath'] . 'playlists/banner/' . $file . '.xml';
102
+
103
+ if(file_exists($skinpath . "/settings.php")){
104
+ /**
105
+ * @var $default_options
106
+ */
107
+ include($skinpath . "/settings.php");
108
+ } else{
109
+ flagGallery::show_message(__("Can't find skin settings", 'flash-album-gallery'));
110
+
111
+ return;
112
+ }
113
+
114
+ $arr_xml_settings = array();
115
+ $settings = array();
116
+ if(file_exists($playlistPath)){
117
+ $playlist = file_get_contents($playlistPath);
118
+ $xml_settings = flagGallery::flagGetBetween($playlist, '<settings><![CDATA[', ']]></settings>');
119
+ if($xml_settings){
120
+ $arr_xml_settings = json_decode($xml_settings);
121
+ if(!empty($arr_xml_settings)){
122
+ $settings = array_replace_recursive((array)$arr_xml_settings, $settings);
123
+ }
124
+ }
125
+ }
126
+ if(empty($settings) || ($skin !== $skinaction)){
127
+ $settings = $default_options;
128
+ if(isset($flag_options["{$skin}_options"])){
129
+ $db_skin_options = maybe_unserialize( $flag_options["{$skin}_options"] );
130
+ $settings = array_replace_recursive( $settings, $db_skin_options );
131
+ }
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>
140
  <title><![CDATA[' . $title . ']]></title>
143
  </properties>
144
  <items>';
145
 
146
+ foreach((array) $data as $id){
147
+ $ban = get_post($id);
148
+ if($ban->ID){
149
+ $url = wp_get_attachment_url($ban->ID);
150
+ $thumbnail = wp_get_attachment_image_url( $ban->ID, 'large', false );
151
+ $link = get_post_meta($id, 'link', true);
152
+ $content .= '
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
153
  <item id="' . $ban->ID . '">
154
+ <track>' . $url . '</track>
155
  <title><![CDATA[' . $ban->post_title . ']]></title>
156
  <link>' . $link . '</link>
 
157
  <description><![CDATA[' . $ban->post_content . ']]></description>
158
  <thumbnail>' . $thumbnail . '</thumbnail>
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
 
179
+ function flagSave_bPlaylistSkin($file){
180
+ $file = sanitize_flagname($file);
181
+ $flag_options = get_option('flag_options');
182
+ $playlistPath = ABSPATH . $flag_options['galleryPath'] . 'playlists/banner/' . $file . '.xml';
183
+ // Save options
184
+ $title = esc_html($_POST['playlist_title']);
185
+ $descr = esc_html($_POST['playlist_descr']);
186
+ $items = get_b_playlist_data($playlistPath);
187
+ $data = $items['items'];
188
+ flagSave_bPlaylist($title, $descr, $data, $file, $skinaction = 'update');
189
  }
190
 
191
+ function flag_b_playlist_delete($playlist){
192
+ $playlist = sanitize_file_name($playlist);
193
+ $flag_options = get_option('flag_options');
194
+ $playlistXML = ABSPATH . $flag_options['galleryPath'] . 'playlists/banner/' . $playlist . '.xml';
195
+ if(file_exists($playlistXML)){
196
+ if(unlink($playlistXML)){
197
+ flagGallery::show_message("'" . $playlist . ".xml' " . __('deleted', 'flash-album-gallery'));
198
+ }
199
+ }
200
  }
admin/css/flagadmin.css CHANGED
@@ -1,5 +1,5 @@
1
  /*
2
- ** Flash Album Gallery Admin StyleSheet
3
  */
4
 
5
  /* SETTINGS FOR SKIN PAGE */
@@ -13,15 +13,321 @@
13
  .skins .active td {
14
  color: #000;
15
  }
16
- .skins .inactive a {
17
  color: #557799;
18
  }
19
- .skins .inactive a:hover {
20
  color: #d54e21;
21
  }
22
  .skins tr.first td {border-bottom:1px solid #F9F9F9;}
23
- .skins tr.second td {border-top:none;}
 
24
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
25
 
26
  /* SETTINGS FOR Overview Gallery */
27
  .flag-wrap {margin:20px 20px 0 2px}
@@ -145,10 +451,12 @@ p#flag-inlinebutton {
145
  .fixed .column-views {
146
  width: 4em; text-align: center;
147
  }
148
-
 
 
149
  .flag-table td,
150
  .flag-table th {padding:4px 7px; text-align:left;}
151
- .flag-table th {font-weight:bold; padding:8px 7px;}
152
  .flag-table th p {margin:0;}
153
 
154
  #flag-listmusic tbody td { height: 50px; }
@@ -169,7 +477,7 @@ p#flag-inlinebutton {
169
  .flag-ajax-post { cursor: pointer; text-decoration: underline; }
170
  .flag-ajax-post:hover { color: #ff0000; }
171
 
172
- .all_galleries { float: left; white-space: nowrap; margin: 7px 0 0px 50px; max-height: 550px; overflow: auto; padding-right: 20px; min-width:30%; }
173
  .all_galleries .acat { border: 1px solid #cccccc; padding: 3px 6px; margin: 3px 0; background: #fefefe; cursor: move; min-width:15%; }
174
  .all_galleries .acat .drop { display: none; }
175
  .all_galleries .acat:hover { background-color: #FFFFEE; }
@@ -277,4 +585,15 @@ div#license div p { font-size: 13px; }
277
  #gmUpload { padding-top:10px }
278
  #gmUpload table td { font-size: 11px !important; }
279
 
280
- .already-added {background-color:#DDFFBB;}
 
 
 
 
 
 
 
 
 
 
 
1
  /*
2
+ ** FlaGallery Admin StyleSheet
3
  */
4
 
5
  /* SETTINGS FOR SKIN PAGE */
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}
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; }
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; }
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
+ }
admin/css/flagallery.css DELETED
@@ -1,9 +0,0 @@
1
- /*
2
- ** Flash Album Gallery StyleSheet
3
- */
4
- .flashalbum { overflow:hidden; position:relative;}
5
- body div.flashalbum object { margin: 0 !important; }
6
- .grandmusic, .grandvideo, .grandflv, .grandmp3, .grandbanner, .grandrotator { overflow:hidden; position:relative; }
7
- body.FlAG { margin: 0; padding: 0; font-size: 0; line-height: 0; }
8
- body.FlAG .FlAGd * { margin-top: 0 !important; margin-bottom: 0 !important; padding-top: 0 !important; padding-bottom: 0 !important; font-size: 0 !important; line-height: 0 !important; height: 0 !important; border-style: none !important; }
9
- body.FlAG .FlAGd img { display: none !important; }
 
 
 
 
 
 
 
 
 
admin/css/flagallery_nocrawler.css DELETED
@@ -1,12 +0,0 @@
1
- /*
2
- ** Flash Album Gallery StyleSheet (if is not crawler)
3
- */
4
- .flag_alternate { display: none; }
5
- .flag_alternate .flagcatlinks { padding: 3px; margin:0 0 3px; background-color: #292929; text-align: left; }
6
- .flag_alternate .flagcatlinks a.flagcat { display: inline-block; padding: 4px 10px; margin: 2px; border: none; font: 14px/16px Tahoma; text-decoration: none; background: none; color: #ffffff; background-color: #292929; }
7
- .flag_alternate .flagcatlinks a.flagcat:hover { text-decoration: none; background: none; }
8
- .flag_alternate .flagcatlinks a.active, .flag_alternate .flagcatlinks a.flagcat:hover { color: #ffffff; background-color: #737373; outline: none; }
9
- .flag_alternate .flagcatlinks a.flagcat:first-child { }
10
- .flag_alternate .flagcategory { display: none; font-size: 0; line-height: 0; }
11
- .flagcatlinks a.backlink { display: inline-block; padding: 4px 10px; margin: 2px text-decoration: none; outline: none; font-size: 12px; font-family: Verdana; font-weight: bold; line-height: 16px; }
12
- .flagcatlinks a.backlink:hover { text-decoration: underline; }
 
 
 
 
 
 
 
 
 
 
 
 
admin/css/flagallery_noflash.css DELETED
@@ -1,26 +0,0 @@
1
- /*
2
- ** Flash Album Gallery StyleSheet (no flash)
3
- */
4
- .flashalbum {
5
- -webkit-user-select: none;
6
- -khtml-user-select: none;
7
- -moz-user-select: -moz-none;
8
- -ms-user-select: none;
9
- -o-user-select: none;
10
- user-select: none;
11
- }
12
- div.flashalbum br { display: none; }
13
- .flag_alternate { margin: 7px 0; }
14
- .flag_alternate .flagcategory { width: 100%; height: auto; position: relative; text-align: center; padding-bottom: 4px; }
15
- .flag_alternate .flagcategory a.flag_pic_alt { display: inline-block; margin: 1px 0 0 1px; padding: 0; height: 120px; width: 120px; line-height: 96px; position:relative; overflow: hidden; text-align: center; cursor:pointer; background-color: #ffffff; border: 2px solid #ffffff; text-decoration: none; background-image: url(../images/loadingAnimation.gif); background-repeat: no-repeat; background-position: 50% 50%; font-size: 8px; color: #ffffff; }
16
- .flag_alternate .flagcategory a.flag_pic_alt > .flag_pic_desc { display: none; padding: 4px; line-height: 140%; font-size: 12px; }
17
- .flag_alternate .flagcategory a.flag_pic_alt > .flag_pic_desc * { display: none; line-height: 140%; font-size: 12px !important; }
18
- .flag_alternate .flagcategory a.flag_pic_alt:hover { background-color: #ffffff; border: 2px solid #4a4a4a; color: #4a4a4a; text-decoration: none; z-index: 3; }
19
- .flag_alternate .flagcategory a.flag_pic_alt.current, .flag_alternate .flagcategory a.flag_pic_alt.last { border-color: #4a4a4a; }
20
- .flag_alternate .flagcategory a.flag_pic_alt > img { opacity: 1; vertical-align: middle; display:inline-block; position: static; margin: 0 auto; padding: 0; border: none; height: 120px; width: 120px; min-height: 120px !important; min-width: 120px !important; max-height: 150px; max-width: 150px; line-height: 96px; font-size: 0; }
21
- div.flashalbum .flag_alternate .flagcategory a.flag_pic_alt > img { opacity: 1; }
22
- .flag_alternate .flagcategory a.flag_pic_alt .flag_pic_counters { position: absolute; left: 0; bottom: 0; right: 0; height: 20px; display: block; line-height: 20px; margin: 0; padding: 0 10px; text-align: left; opacity: 0.85; filter: "alpha(opacity=85)"; }
23
- .flag_alternate .flagcategory .flag_pic_counters i { display: inline-block; line-height: 20px; margin: 0; padding: 0 0 0 16px; background: url(../images/views.png) 0 50% no-repeat; font-style: normal; font-size: 12px; float: left; }
24
- .flag_alternate .flagcategory .flag_pic_counters b { display: inline-block; line-height: 20px; margin: 0; padding: 0 0 0 16px; background: url(../images/like.png) 0 50% no-repeat; font-weight: normal; font-size: 12px; float: right; width: 25%; }
25
-
26
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/css/tabs.css CHANGED
@@ -3,7 +3,7 @@
3
  border-style:solid;
4
  border-width:1px;
5
  padding:2px;
6
- margin-top:60px;
7
 
8
  -moz-border-radius-topright: 6px;
9
  -khtml-border-top-right-radius: 6px;
@@ -18,7 +18,6 @@
18
  display: none;
19
  padding:0 15px;
20
  }
21
- .cptab h2 {margin-top:-65px; margin-bottom:45px;}
22
 
23
  #tabs{
24
  display: block;
@@ -115,6 +114,11 @@
115
  cursor: pointer;
116
  }
117
 
 
 
 
 
 
118
 
119
  /* Additional IE specific bug fixes... */
120
  * html .tabs { /* auto clear, @ IE 6 & IE 7 Quirks Mode */
3
  border-style:solid;
4
  border-width:1px;
5
  padding:2px;
6
+ overflow:hidden;
7
 
8
  -moz-border-radius-topright: 6px;
9
  -khtml-border-top-right-radius: 6px;
18
  display: none;
19
  padding:0 15px;
20
  }
 
21
 
22
  #tabs{
23
  display: block;
114
  cursor: pointer;
115
  }
116
 
117
+ #skinoptions {
118
+ max-height: 85vh;
119
+ overflow:auto;
120
+ float:left;
121
+ }
122
 
123
  /* Additional IE specific bug fixes... */
124
  * html .tabs { /* auto clear, @ IE 6 & IE 7 Quirks Mode */
admin/db_skin_color_scheme.php DELETED
@@ -1,154 +0,0 @@
1
- <?php function flag_skin_options() {
2
- $flag_options = get_option( 'flag_options' );
3
- $flashBacktransparent = $flag_options['flashBacktransparent'];
4
- $flashBackcolor = str_replace( '#', '', $flag_options['flashBackcolor'] );
5
- $buttonsBG = str_replace( '#', '', $flag_options['buttonsBG'] );
6
- $buttonsMouseOver = str_replace( '#', '', $flag_options['buttonsMouseOver'] );
7
- $buttonsMouseOut = str_replace( '#', '', $flag_options['buttonsMouseOut'] );
8
- $catButtonsMouseOver = str_replace( '#', '', $flag_options['catButtonsMouseOver'] );
9
- $catButtonsMouseOut = str_replace( '#', '', $flag_options['catButtonsMouseOut'] );
10
- $catButtonsTextMouseOver = str_replace( '#', '', $flag_options['catButtonsTextMouseOver'] );
11
- $catButtonsTextMouseOut = str_replace( '#', '', $flag_options['catButtonsTextMouseOut'] );
12
- $thumbMouseOver = str_replace( '#', '', $flag_options['thumbMouseOver'] );
13
- $thumbMouseOut = str_replace( '#', '', $flag_options['thumbMouseOut'] );
14
- $mainTitle = str_replace( '#', '', $flag_options['mainTitle'] );
15
- $categoryTitle = str_replace( '#', '', $flag_options['categoryTitle'] );
16
- $itemBG = str_replace( '#', '', $flag_options['itemBG'] );
17
- $itemTitle = str_replace( '#', '', $flag_options['itemTitle'] );
18
- $itemDescription = str_replace( '#', '', $flag_options['itemDescription'] );
19
- ?>
20
- <script type="text/javascript">
21
- jQuery(document).ready(function(){
22
- jQuery('#colors .colorPick').each(function(){
23
- var inpID = jQuery(this).attr('name');
24
- jQuery('#cp_' + inpID).farbtastic('#' + inpID);
25
- jQuery('#' + inpID).focus(function(){
26
- jQuery('#cp_' + inpID).show();
27
- });
28
- jQuery('#' + inpID).blur(function(){
29
- jQuery('#cp_' + inpID).hide();
30
- });
31
- });
32
- function tChecked(){
33
- if(jQuery('#flashBacktransparent').attr('checked')){
34
- var dclone = jQuery('#flashBackcolor').clone();
35
- jQuery('#flashBackcolor').hide();
36
- dclone.removeAttr('style').removeAttr('id').removeAttr('name').addClass('flashBackcolor').attr('disabled', 'disabled').insertAfter('#flashBackcolor');
37
- } else{
38
- jQuery('.flashBackcolor').remove();
39
- jQuery('#flashBackcolor').show();
40
- }
41
- }
42
-
43
- tChecked();
44
- jQuery("#flashBacktransparent").click(tChecked);
45
- });
46
- </script>
47
- <form method="POST">
48
- <div>
49
- <?php wp_nonce_field( 'flag_settings' ); ?>
50
- <input type="hidden" name="page_options" value="flashBackcolor,buttonsBG,flashBacktransparent,buttonsMouseOver,buttonsMouseOut,catButtonsMouseOver,catButtonsMouseOut,catButtonsTextMouseOver,catButtonsTextMouseOut,thumbMouseOver,thumbMouseOut,mainTitle,categoryTitle,itemBG,itemTitle,itemDescription"/>
51
-
52
- <!-- Color settings -->
53
- <h3><?php _e( 'Color Settings', 'flag' ); ?></h3>
54
- <table id="colors" class="form-table flag-options">
55
- <tr>
56
- <th style="width: 30%;"><?php _e( 'Background Color', 'flag' ); ?>:</th>
57
- <td><input class="colorPick" type="text" size="7" maxlength="6" id="flashBackcolor" name="flashBackcolor" value="<?php echo $flashBackcolor ?>"/>
58
-
59
- <div id="cp_flashBackcolor" style="background:#F9F9F9;position:absolute;display:none;"></div>
60
- <label><input type="checkbox" id="flashBacktransparent" name="flashBacktransparent" value="transparent" <?php checked( 'transparent', $flashBacktransparent ); ?> /> transparent</label></td>
61
- </tr>
62
- <tr>
63
- <th><?php _e( 'Buttons Background Color', 'flag' ); ?>:</th>
64
- <td><input class="colorPick" type="text" size="7" maxlength="6" id="buttonsBG" name="buttonsBG" value="<?php echo $buttonsBG; ?>"/>
65
-
66
- <div id="cp_buttonsBG" style="background:#F9F9F9;position:absolute;display:none;"></div>
67
- </td>
68
- </tr>
69
- <tr>
70
- <th><?php _e( 'Buttons Text Color', 'flag' ); ?>:</th>
71
- <td>
72
- <input class="colorPick" type="text" size="7" maxlength="6" id="buttonsMouseOver" name="buttonsMouseOver" value="<?php echo $buttonsMouseOver; ?>"/> mouseOver<br/>
73
-
74
- <div id="cp_buttonsMouseOver" style="background:#F9F9F9;position:absolute;display:none;"></div>
75
- <input class="colorPick" type="text" size="7" maxlength="6" id="buttonsMouseOut" name="buttonsMouseOut" value="<?php echo $buttonsMouseOut; ?>"/> mouseOut<br/>
76
-
77
- <div id="cp_buttonsMouseOut" style="background:#F9F9F9;position:absolute;display:none;"></div>
78
- </td>
79
- </tr>
80
- <tr>
81
- <th><?php _e( 'Category Buttons Color', 'flag' ); ?>:</th>
82
- <td>
83
- <input class="colorPick" type="text" size="7" maxlength="6" id="catButtonsMouseOver" name="catButtonsMouseOver" value="<?php echo $catButtonsMouseOver; ?>"/> mouseOver<br/>
84
-
85
- <div id="cp_catButtonsMouseOver" style="background:#F9F9F9;position:absolute;display:none;"></div>
86
- <input class="colorPick" type="text" size="7" maxlength="6" id="catButtonsMouseOut" name="catButtonsMouseOut" value="<?php echo $catButtonsMouseOut; ?>"/> mouseOut<br/>
87
-
88
- <div id="cp_catButtonsMouseOut" style="background:#F9F9F9;position:absolute;display:none;"></div>
89
- </td>
90
- </tr>
91
- <tr>
92
- <th><?php _e( 'Category Buttons Text Color', 'flag' ); ?>:</th>
93
- <td>
94
- <input class="colorPick" type="text" size="7" maxlength="6" id="catButtonsTextMouseOver" name="catButtonsTextMouseOver" value="<?php echo $catButtonsTextMouseOver; ?>"/> mouseOver<br/>
95
-
96
- <div id="cp_catButtonsTextMouseOver" style="background:#F9F9F9;position:absolute;display:none;"></div>
97
- <input class="colorPick" type="text" size="7" maxlength="6" id="catButtonsTextMouseOut" name="catButtonsTextMouseOut" value="<?php echo $catButtonsTextMouseOut; ?>"/> mouseOut<br/>
98
-
99
- <div id="cp_catButtonsTextMouseOut" style="background:#F9F9F9;position:absolute;display:none;"></div>
100
- </td>
101
- </tr>
102
- <tr>
103
- <th><?php _e( 'Thumbs Rollover Color', 'flag' ); ?>:</th>
104
- <td>
105
- <input class="colorPick" type="text" size="7" maxlength="6" id="thumbMouseOver" name="thumbMouseOver" value="<?php echo $thumbMouseOver; ?>"/> mouseOver<br/>
106
-
107
- <div id="cp_thumbMouseOver" style="background:#F9F9F9;position:absolute;display:none;"></div>
108
- <input class="colorPick" type="text" size="7" maxlength="6" id="thumbMouseOut" name="thumbMouseOut" value="<?php echo $thumbMouseOut; ?>"/> mouseOut<br/>
109
-
110
- <div id="cp_thumbMouseOut" style="background:#F9F9F9;position:absolute;display:none;"></div>
111
- </td>
112
- </tr>
113
- <tr>
114
- <th><?php _e( 'Main Title', 'flag' ); ?>:</th>
115
- <td><input class="colorPick" type="text" size="7" maxlength="6" id="mainTitle" name="mainTitle" value="<?php echo $mainTitle; ?>"/>
116
-
117
- <div id="cp_mainTitle" style="background:#F9F9F9;position:absolute;display:none;"></div>
118
- </td>
119
- </tr>
120
- <tr>
121
- <th><?php _e( 'Category Title', 'flag' ); ?>:</th>
122
- <td><input class="colorPick" type="text" size="7" maxlength="6" id="categoryTitle" name="categoryTitle" value="<?php echo $categoryTitle; ?>"/>
123
-
124
- <div id="cp_categoryTitle" style="background:#F9F9F9;position:absolute;display:none;"></div>
125
- </td>
126
- </tr>
127
- <tr>
128
- <th><?php _e( 'Item Background', 'flag' ); ?>:</th>
129
- <td><input class="colorPick" type="text" size="7" maxlength="6" id="itemBG" name="itemBG" value="<?php echo $itemBG; ?>"/>
130
-
131
- <div id="cp_itemBG" style="background:#F9F9F9;position:absolute;display:none;"></div>
132
- </td>
133
- </tr>
134
- <tr>
135
- <th><?php _e( 'Item Title', 'flag' ); ?>:</th>
136
- <td><input class="colorPick" type="text" size="7" maxlength="6" id="itemTitle" name="itemTitle" value="<?php echo $itemTitle; ?>"/>
137
-
138
- <div id="cp_itemTitle" style="background:#F9F9F9;position:absolute;display:none;"></div>
139
- </td>
140
- </tr>
141
- <tr>
142
- <th><?php _e( 'Item Description', 'flag' ); ?>:</th>
143
- <td><input class="colorPick" type="text" size="7" maxlength="6" id="itemDescription" name="itemDescription" value="<?php echo $itemDescription; ?>"/>
144
-
145
- <div id="cp_itemDescription" style="background:#F9F9F9;position:absolute;display:none;"></div>
146
- </td>
147
- </tr>
148
- </table>
149
-
150
- <div class="clear"> &nbsp; </div>
151
- <div class="submit"><input class="button-primary" type="submit" name="updateoption" value="<?php _e( 'Save Changes', 'flag' ); ?>"/></div>
152
- </div>
153
- </form>
154
- <?php }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/flag_install.php CHANGED
@@ -1,45 +1,50 @@
1
  <?php
2
  // Stop direct call
3
- if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You are not allowed to call this page directly.'); }
 
 
4
 
5
  /**
6
  * creates all tables for the gallery
7
  * called during register_activation hook
8
- *
9
  * @access internal
10
  * @return void
11
- **/
12
-
13
- function flag_install () {
14
- global $wpdb, $wp_version;
15
-
16
- // Check for capability
17
- if ( !current_user_can('activate_plugins') )
18
- return;
19
-
20
- flag_capabilities();
21
-
22
- // upgrade function changed in WordPress 2.3
23
- require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
24
-
25
- // add charset & collate like wp core
26
- $charset_collate = '';
27
-
28
- if ( $wpdb->has_cap('collation') ) {
29
- if ( ! empty($wpdb->charset) )
30
- $charset_collate = "DEFAULT CHARACTER SET $wpdb->charset";
31
- if ( ! empty($wpdb->collate) )
32
- $charset_collate .= " COLLATE $wpdb->collate";
33
- }
34
-
35
- $flagpictures = $wpdb->prefix . 'flag_pictures';
36
- $flaggallery = $wpdb->prefix . 'flag_gallery';
37
- $flagcomments = $wpdb->prefix . 'flag_comments';
38
- $flagalbum = $wpdb->prefix . 'flag_album';
39
-
40
- if($wpdb->get_var("show tables like '$flagpictures'") != $flagpictures) {
41
-
42
- $sql = "CREATE TABLE " . $flagpictures . " (
 
 
 
43
  pid BIGINT(20) NOT NULL AUTO_INCREMENT ,
44
  galleryid BIGINT(20) DEFAULT '0' NOT NULL ,
45
  filename VARCHAR(255) NOT NULL ,
@@ -64,14 +69,14 @@ function flag_install () {
64
  meta_data LONGTEXT,
65
  PRIMARY KEY pid (pid)
66
  ) $charset_collate;";
67
-
68
- dbDelta($sql);
69
  }
70
 
71
 
72
- if($wpdb->get_var("show tables like '$flaggallery'") != $flaggallery) {
73
-
74
- $sql = "CREATE TABLE " . $flaggallery . " (
75
  gid BIGINT(20) NOT NULL AUTO_INCREMENT ,
76
  name VARCHAR(255) NOT NULL ,
77
  path MEDIUMTEXT NULL ,
@@ -83,12 +88,12 @@ function flag_install () {
83
  status TINYINT NULL DEFAULT '0' ,
84
  PRIMARY KEY gid (gid)
85
  ) $charset_collate;";
86
-
87
- dbDelta($sql);
88
  }
89
 
90
- if($wpdb->get_var("show tables like '$flagcomments'") != $flagcomments) {
91
- $sql = "CREATE TABLE " . $flagcomments . " (
92
  cid int(11) unsigned NOT NULL auto_increment,
93
  ownerid int(11) unsigned NOT NULL default '0',
94
  name varchar(255) NOT NULL default '',
@@ -100,13 +105,13 @@ function flag_install () {
100
  PRIMARY KEY (cid),
101
  KEY ownerid (ownerid)
102
  ) $charset_collate;";
103
-
104
- dbDelta($sql);
105
- }
106
 
107
- if( !$wpdb->get_var( "SHOW TABLES LIKE '$flagalbum'" )) {
108
-
109
- $sql = "CREATE TABLE " . $flagalbum . " (
 
 
 
110
  id BIGINT(20) NOT NULL AUTO_INCREMENT ,
111
  name VARCHAR(255) NOT NULL ,
112
  previewpic BIGINT(20) DEFAULT '0' NOT NULL ,
@@ -114,228 +119,201 @@ function flag_install () {
114
  categories LONGTEXT NOT NULL,
115
  PRIMARY KEY id (id)
116
  ) $charset_collate;";
117
-
118
- dbDelta($sql);
119
  }
120
 
121
 
122
- // check one table again, to be sure
123
- if( !$wpdb->get_var( "SHOW TABLES LIKE '$flagpictures'" ) ) {
124
- update_option( "flag_init_check", __('Flash Album Gallery : Tables could not created, please check your database settings','flag') );
125
- return;
126
- }
127
-
128
- $options = get_option('flag_options');
129
- // set the default settings, if we didn't upgrade
130
- if ( empty( $options ) )
131
- flag_default_options();
132
-
133
-
134
- // if all is passed , save the VERSIONs
135
- add_option("flag_db_version", FLAG_DBVERSION);
136
- add_option("flagVersion", FLAGVERSION);
137
-
138
- include_once( dirname (__FILE__). '/tuning.php');
139
- flag_tune(false);
 
 
 
140
  }
141
 
142
- function flag_capabilities() {
143
- global $wp_roles;
144
-
145
- // Set the capabilities for the administrator
146
- $role = get_role('administrator');
147
- // We need this role, no other chance
148
- if ( empty($role) ) {
149
- update_option( "flag_init_check", __('Sorry, Flash Album Gallery works only with a role called administrator','flag') );
150
- return;
151
- }
152
-
153
- $role->add_cap('FlAG overview');
154
- $role->add_cap('FlAG Use TinyMCE');
155
- $role->add_cap('FlAG Upload images');
156
- $role->add_cap('FlAG Import folder');
157
- $role->add_cap('FlAG Manage gallery');
158
- $role->add_cap('FlAG Manage others gallery');
159
- $role->add_cap('FlAG Change skin');
160
- $role->add_cap('FlAG Add skins');
161
- $role->add_cap('FlAG Delete skins');
162
- $role->add_cap('FlAG Change options');
163
- $role->add_cap('FlAG Manage music');
164
- $role->add_cap('FlAG Manage video');
165
- $role->add_cap('FlAG Manage banners');
166
- $role->add_cap('FlAG iFrame page');
 
167
 
168
  }
169
 
170
  /**
171
  * Setup the default option array for the gallery
172
- *
173
  * @access internal
174
  * @return void
175
  */
176
- function flag_default_options() {
177
-
178
- global $blog_id, $flag;
179
-
180
- $flag_options = flag_list_options();
181
- // special overrides for WPMU
182
- if (IS_WPMU) {
183
- // get the site options
184
- $flag_wpmu_options = get_site_option('flag_options');
185
- // get the default value during installation
186
- //if (!is_array($flag_wpmu_options)) {
187
- //$flag_wpmu_options['galleryPath'] = 'wp-content/blogs.dir/%BLOG_ID%/files/';
188
- update_site_option('flag_options', $flag_wpmu_options);
189
- //}
190
- //$flag_options['galleryPath'] = str_replace("%BLOG_ID%", $blog_id , $flag_wpmu_options['galleryPath']);
191
- }
192
-
193
- update_option('flag_options', $flag_options);
194
 
195
  }
196
 
197
- function flag_list_options() {
198
- $wp_content = basename(WP_CONTENT_DIR);
199
- $flag_options['galleryPath'] = $wp_content.'/flagallery/'; // set default path to the gallery
200
- $flag_options['swfUpload'] = true; // activate the batch upload
201
- $flag_options['deleteImg'] = true; // delete Images
202
- $flag_options['deepLinks'] = true;
203
- $flag_options['access_key'] = '';
204
- $flag_options['license_key'] = '';
205
- $flag_options['useMediaRSS'] = false; // activate the global Media RSS file
206
-
207
- $flag_options['gp_jscode'] = ''; // GRAND Pages: google analytics code
208
-
209
- // Sort Settings
210
- $flag_options['albSort'] = 'title'; // Galleries Sort order
211
- $flag_options['albSortDir'] = 'ASC'; // Galleries Sort dir
212
- $flag_options['albPerPage'] = '50'; // Galleries per page
213
- $flag_options['galSort'] = 'sortorder'; // Images Sort order
214
- $flag_options['galSortDir'] = 'ASC'; // Images Sort direction
215
-
216
- // Flash settings
217
- $flag_options['skinsDirABS'] = str_replace("\\","/", WP_PLUGIN_DIR . '/flagallery-skins/' );
218
- $flag_options['skinsDirURL'] = WP_PLUGIN_URL . '/flagallery-skins/';
219
- $flag_options['flashSkin'] = 'minima_jn';
220
- $flag_options['flashWidth'] = '100%';
221
- $flag_options['flashHeight'] = '500';
222
-
223
- // Image Settings
224
- $flag_options['imgWidth'] = 800; // Image Width
225
- $flag_options['imgHeight'] = 600; // Image height
226
- $flag_options['imgQuality'] = 85; // Image Quality
227
- $flag_options['optimized_imgs'] = false; // Image Quality
228
-
229
- // Thumbnail Settings
230
- $flag_options['thumbWidth'] = 100; // Thumb Width
231
- $flag_options['thumbHeight'] = 100; // Thumb height
232
- $flag_options['thumbFix'] = true; // Fix the dimension
233
- $flag_options['thumbQuality'] = 100; // Thumb Quality
234
-
235
- // Flash default skin colors settings TODO remove old settings
236
- $flag_options['flashBacktransparent'] = false;
237
- $flag_options['flashBackcolor'] = '262626';
238
- $flag_options['buttonsBG'] = '000000';
239
- $flag_options['buttonsMouseOver'] = '7485c2';
240
- $flag_options['buttonsMouseOut'] = '717171';
241
- $flag_options['catButtonsMouseOver'] = '000000';
242
- $flag_options['catButtonsMouseOut'] = '000000';
243
- $flag_options['catButtonsTextMouseOver']= '7485c2';
244
- $flag_options['catButtonsTextMouseOut'] = 'bcbcbc';
245
- $flag_options['thumbMouseOver'] = '7485c2';
246
- $flag_options['thumbMouseOut'] = '000000';
247
- $flag_options['mainTitle'] = 'ffffff';
248
- $flag_options['categoryTitle'] = '7485c2';
249
- $flag_options['itemBG'] = 'eae6ef';
250
- $flag_options['itemTitle'] = '7485c2';
251
- $flag_options['itemDescription'] = 'e0e0e0';
252
-
253
- // Alternative gallery colors
254
- $flag_options['jAlterGal'] = true;
255
- $flag_options['jAlterGalScript'] = 1; // If '0' - use FancyBox script
256
- $flag_options['disableViews'] = 0;
257
- $flag_options['BarsBG'] = '292929';
258
- $flag_options['CatBGColor'] = '292929';
259
- $flag_options['CatBGColorOver'] = '737373';
260
- $flag_options['CatColor'] = 'ffffff';
261
- $flag_options['CatColorOver'] = 'ffffff';
262
- $flag_options['ThumbBG'] = 'ffffff';
263
- $flag_options['ThumbLoaderColor'] = '4a4a4a';
264
- $flag_options['TitleColor'] = 'ff9900';
265
- $flag_options['DescrColor'] = 'cfcfcf';
266
-
267
- // Single player colors
268
- $flag_options['videoBG'] = '000000';
269
- $flag_options['vmColor1'] = 'ffffff';
270
- $flag_options['vmColor2'] = '3283A7';
271
- $flag_options['vmAutoplay'] = 'true';
272
- $flag_options['vmWidth'] = '520';
273
- $flag_options['vmHeight'] = '304';
274
-
275
- $flag_options['mpBG'] = '4f4f4f';
276
- $flag_options['mpColor1'] = 'ffffff';
277
- $flag_options['mpColor2'] = '3283A7';
278
- $flag_options['mpAutoplay'] = 'false';
279
-
280
- $flag_options['advanced'] = false; // Advanced options
281
-
282
- return $flag_options;
283
  }
284
 
285
  /**
286
  * Deregister a capability from all classic roles
287
- *
288
  * @access internal
 
289
  * @param string $capability name of the capability which should be deregister
 
290
  * @return void
291
  */
292
  function flag_remove_capability($capability){
293
- // this function remove the $capability only from the classic roles
294
- $check_order = array("subscriber", "contributor", "author", "editor", "administrator");
295
 
296
- foreach ($check_order as $role) {
297
 
298
- $role = get_role($role);
299
- $role->remove_cap($capability) ;
300
- }
301
 
302
  }
303
 
304
  /**
305
  * Uninstall all settings and tables
306
  * Called via Setup and register_unstall hook
307
- *
308
  * @access internal
309
  * @return void
310
  */
311
- function flag_uninstall() {
312
- global $wpdb;
313
-
314
- // first remove all tables
315
- $wpdb->query("DROP TABLE IF EXISTS {$wpdb->prefix}flag_pictures");
316
- $wpdb->query("DROP TABLE IF EXISTS {$wpdb->prefix}flag_gallery");
317
- $wpdb->query("DROP TABLE IF EXISTS {$wpdb->prefix}flag_comments");
318
- $wpdb->query("DROP TABLE IF EXISTS {$wpdb->prefix}flag_album");
319
-
320
- // then remove all options
321
- delete_option( 'flag_options' );
322
- delete_option( 'flag_db_version' );
323
- delete_option( 'flagVersion' );
324
- delete_option( 'flag_plugin_error' );
325
-
326
- // now remove the capability
327
- flag_remove_capability("FlAG overview");
328
- flag_remove_capability("FlAG Use TinyMCE");
329
- flag_remove_capability("FlAG Upload images");
330
- flag_remove_capability("FlAG Import folder");
331
- flag_remove_capability("FlAG Manage gallery");
332
- flag_remove_capability('FlAG Manage others gallery');
333
- flag_remove_capability("FlAG Change skin");
334
- flag_remove_capability('FlAG Add skins');
335
- flag_remove_capability('FlAG Delete skins');
336
- flag_remove_capability("FlAG Change options");
337
- flag_remove_capability("FlAG Manage music");
338
- flag_remove_capability("FlAG Manage video");
339
- flag_remove_capability("FlAG Manage banners");
340
- flag_remove_capability("FlAG iFrame page");
 
 
 
 
 
 
 
 
341
  }
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 ,
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 ,
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 '',
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 ,
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'] = 'phantom';
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
  }
admin/flagframe-tool.php CHANGED
@@ -10,9 +10,9 @@ if ( !current_user_can('FlAG iFrame page') )
10
 
11
  if(isset($_POST['copy_file'])) {
12
  if(copy(FLAG_ABSPATH.'flagframe.php',ABSPATH.'flagframe.php')) {
13
- flagGallery::show_message(__('Success','flag'));
14
  } else {
15
- flagGallery::show_error(__('Failure','flag'));
16
  }
17
  }
18
  global $flag, $flagdb;
@@ -37,11 +37,9 @@ jQuery(document).ready(function() {
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 h = parseInt(jQuery('#galleryheight').val());
41
- if(h) h = '&h='+h; else h = '';
42
- var l = parseInt(jQuery('#postid').val());
43
- if(l) l = '&l='+l; else l = '';
44
- fb_url(galleries,skin,h,l);
45
  jQuery('#galleries :checkbox').click(function(){
46
  var cur, arr, del;
47
  if(jQuery(this).is(':checked')){
@@ -68,9 +66,9 @@ jQuery(document).ready(function() {
68
  }
69
  galleries = '?i='+jQuery('#items_array').val().split(',').join('_');
70
  skin = jQuery('#skinname option:selected').val(); if(skin) skin = '&f='+skin; else skin = '';
71
- h = parseInt(jQuery('#galleryheight').val()); if(h) h = '&h='+h; else h = '';
72
- l = parseInt(jQuery('#postid').val()); if(l) l = '&l='+l; else l = '';
73
- fb_url(galleries,skin,h,l);
74
  });
75
  jQuery('#skinname').change(function(){
76
  var skin = jQuery(this).val();
@@ -80,78 +78,73 @@ jQuery(document).ready(function() {
80
  skin = '';
81
  }
82
  galleries = '?i='+jQuery('#items_array').val().split(',').join('_');
83
- h = parseInt(jQuery('#galleryheight').val()); if(h) h = '&h='+h; else h = '';
84
- l = parseInt(jQuery('#postid').val()); if(l) l = '&l='+l; else l = '';
85
- fb_url(galleries,skin,h,l);
86
  });
87
- jQuery('#galleryheight').bind('keyup',function(){
88
- var h = parseInt(jQuery(this).val());
89
- if(h) {
90
- h = '&h='+h;
91
- } else {
92
- h = '';
93
- }
94
- galleries = '?i='+jQuery('#items_array').val().split(',').join('_');
95
- skin = jQuery('#skinname option:selected').val(); if(skin) skin = '&f='+skin; else skin = '';
96
- l = parseInt(jQuery('#postid').val()); if(l) l = '&l='+l; else l = '';
97
- fb_url(galleries,skin,h,l);
98
- });
99
- jQuery('#postid').bind('keyup',function(){
100
- var l = parseInt(jQuery(this).val());
101
- if(l) {
102
- l = '&l='+l;
103
- } else {
104
- l = '';
105
- }
106
  galleries = '?i='+jQuery('#items_array').val().split(',').join('_');
107
  skin = jQuery('#skinname option:selected').val(); if(skin) skin = '&f='+skin; else skin = '';
108
- h = parseInt(jQuery('#galleryheight').val()); if(h) h = '&h='+h; else h = '';
109
- fb_url(galleries,skin,h,l);
110
  });
111
- jQuery('#m_playlist').change(function(){
112
- var playlist = jQuery(this).val();
113
  if(playlist) {
114
  playlist = '?m='+playlist;
115
  } else {
116
- playlist = '?m=';
117
  }
118
- jQuery('#fb2_url0').val(url+playlist);
119
  });
120
- jQuery('#v_playlist').change(function(){
121
- var playlist = jQuery(this).val();
122
  if(playlist) {
123
  playlist = '?v='+playlist;
124
  } else {
125
- playlist = '?v=';
126
  }
127
- jQuery('#fb3_url0').val(url+playlist);
128
  });
129
- jQuery('#b_playlist').change(function(){
130
- var playlist = jQuery(this).val();
131
  if(playlist) {
132
  playlist = '?b='+playlist;
133
  } else {
134
- playlist = '?b=';
135
  }
136
- jQuery('#fb4_url0').val(url+playlist);
137
  });
138
  });
139
- function fb_url(galleries,skin,h,l) {
140
- jQuery('#fb1_url0').val(url+galleries+skin+h+l);
 
 
 
 
 
 
 
 
 
 
 
 
141
  }
142
  /*]]>*/</script>
143
  <div class="flag-wrap">
144
- <h2><?php _e('Flagallery iFrame', 'flag'); ?></h2>
145
  <form id="flagframe_copy" name="flagframe_copy" method="POST" class="alignright">
146
- <p>Optional: &nbsp; <input type="submit" name="copy_file" class="button-primary" value="<?php _e('Copy flagframe.php file to root directory', 'flag'); ?>" /><br />
147
  (makes iframe url shorter)</p>
148
  </form>
149
- <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", 'flag'); ?></legend>
150
  <table border="0" cellpadding="4" cellspacing="0">
151
  <tr>
152
- <td nowrap="nowrap" valign="top"><div><?php _e("Select galleries", 'flag'); ?>:<span style="color:red;"> *</span><br /><small><?php _e("(album categories)", 'flag'); ?></small></div></td>
153
  <td valign="top"><div id="galleries" style="width: 214px; height: 160px; overflow: auto; white-space: nowrap;">
154
- <div class="row"><input type="checkbox" value="all" checked="checked" /> <strong><span style="display:inline-block; width:3em;">*</span> - <?php _e("all galleries", 'flag'); ?></strong></div>
155
  <?php
156
  $gallerylist = $flagdb->find_all_galleries($flag->options['albSort'], $flag->options['albSortDir']);
157
  if(is_array($gallerylist)) {
@@ -164,13 +157,13 @@ function fb_url(galleries,skin,h,l) {
164
  </div></td>
165
  </tr>
166
  <tr>
167
- <td nowrap="nowrap" valign="top"><p style="padding-top:3px;"><?php _e("Galleries order", 'flag'); ?>: &nbsp; </p></td>
168
  <td valign="top"><p><input readonly="readonly" type="text" id="items_array" value="all" style="width: 214px;" /></p></td>
169
  </tr>
170
  <tr>
171
- <td nowrap="nowrap" valign="top"><p style="padding-top:3px;"><label for="skinname"><?php _e("Choose skin", 'flag'); ?>:</label></p></td>
172
  <td valign="top"><p><select id="skinname" name="skinname" style="width: 214px;">
173
- <option value="" selected="selected"><?php _e("skin active by default", 'flag'); ?></option>
174
  <?php
175
  foreach ( (array)$i_skins as $skin_file => $skin_data) {
176
  echo '<option value="'.dirname($skin_file).'">'.$skin_data['Name'].'</option>'."\n";
@@ -179,25 +172,25 @@ function fb_url(galleries,skin,h,l) {
179
  </select></p></td>
180
  </tr>
181
  <tr>
182
- <td valign="top"><p style="padding-top:3px;"><?php _e("Skin size", 'flag'); ?>:<br /><span style="font-size:9px">(<?php _e("blank for default", 'flag'); ?>)</span></p></td>
183
- <td valign="top"><p><?php _e("width", 'flag'); ?>: <input id="gallerywidth" type="text" disabled="disabled" style="width: 50px" value="100%" /> &nbsp; <?php _e("height", 'flag'); ?>: <input id="galleryheight" type="text" style="width: 50px" /></p></td>
184
  </tr>
185
- <tr>
186
- <td nowrap="nowrap" valign="top"><p style="padding-top:3px;"><?php _e("Post ID", 'flag'); ?>:<br /><span style="font-size:9px">(<?php _e("optional", 'flag'); ?>)</span></p></td>
187
- <td valign="top"><p><input id="postid" type="text" /></p></td>
188
- </tr>
189
  <tr>
190
- <td valign="top"><div style="padding-top:3px;"><strong><?php _e("iFrame Url", 'flag'); ?>: &nbsp; </strong></div></td>
191
- <td valign="top"><input id="fb1_url0" type="text" style="width: 780px; font-size: 10px;" value="<?php echo $fb_url.'?i=all'; ?>" /></td>
192
  </tr>
 
 
 
 
193
  </table>
194
  </fieldset></form>
195
- <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", 'flag'); ?></legend>
196
  <table border="0" cellpadding="4" cellspacing="0">
197
  <tr>
198
- <td nowrap="nowrap" valign="top"><p style="padding-top:3px;"><label><?php _e("Choose playlist", 'flag'); ?>:</label></p></td>
199
  <td valign="top"><p><select id="m_playlist" style="width: 214px;">
200
- <option value="" selected="selected"><?php _e('Choose playlist', 'flag'); ?></option>
201
  <?php
202
  foreach((array)$all_m_playlists as $playlist_file => $playlist_data) {
203
  $playlist_name = basename($playlist_file, '.xml');
@@ -207,19 +200,27 @@ function fb_url(galleries,skin,h,l) {
207
  }
208
  ?>
209
  </select></p></td>
 
 
 
 
210
  </tr>
211
  <tr>
212
- <td valign="top"><div style="padding-top:3px;"><strong><?php _e("iFrame Url", 'flag'); ?>: &nbsp; </strong></div></td>
213
- <td valign="top"><input id="fb2_url0" type="text" style="width: 600px; font-size: 10px;" value="<?php echo $fb_url.'?m='; ?>" /></td>
214
  </tr>
 
 
 
 
215
  </table>
216
  </fieldset></form>
217
- <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", 'flag'); ?></legend>
218
  <table border="0" cellpadding="4" cellspacing="0">
219
  <tr>
220
- <td nowrap="nowrap" valign="top"><p style="padding-top:3px;"><label><?php _e("Choose playlist", 'flag'); ?>:</label></p></td>
221
  <td valign="top"><p><select id="v_playlist" style="width: 214px;">
222
- <option value="" selected="selected"><?php _e('Choose playlist', 'flag'); ?></option>
223
  <?php
224
  foreach((array)$all_v_playlists as $playlist_file => $playlist_data) {
225
  $playlist_name = basename($playlist_file, '.xml');
@@ -229,19 +230,27 @@ function fb_url(galleries,skin,h,l) {
229
  }
230
  ?>
231
  </select></p></td>
 
 
 
 
232
  </tr>
233
  <tr>
234
- <td valign="top"><div style="padding-top:3px;"><strong><?php _e("iFrame Url", 'flag'); ?>: &nbsp; </strong></div></td>
235
- <td valign="top"><input id="fb3_url0" type="text" style="width: 600px; font-size: 10px;" value="<?php echo $fb_url.'?v='; ?>" /></td>
 
 
 
 
236
  </tr>
237
  </table>
238
  </fieldset></form>
239
- <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", 'flag'); ?></legend>
240
  <table border="0" cellpadding="4" cellspacing="0">
241
  <tr>
242
- <td nowrap="nowrap" valign="top"><p style="padding-top:3px;"><label><?php _e("Choose xml", 'flag'); ?>:</label></p></td>
243
  <td valign="top"><p><select id="b_playlist" style="width: 214px;">
244
- <option value="" selected="selected"><?php _e('Choose XML', 'flag'); ?></option>
245
  <?php
246
  foreach((array)$all_b_playlists as $playlist_file => $playlist_data) {
247
  $playlist_name = basename($playlist_file, '.xml');
@@ -251,11 +260,19 @@ function fb_url(galleries,skin,h,l) {
251
  }
252
  ?>
253
  </select></p></td>
 
 
 
 
254
  </tr>
255
  <tr>
256
- <td valign="top"><div style="padding-top:3px;"><strong><?php _e("iFrame Url", 'flag'); ?>: &nbsp; </strong></div></td>
257
- <td valign="top"><input id="fb4_url0" type="text" style="width: 600px; font-size: 10px;" value="<?php echo $fb_url.'?b='; ?>" /></td>
258
  </tr>
 
 
 
 
259
  </table>
260
  </fieldset></form>
261
  </div>
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;
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')){
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();
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)) {
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";
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');
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');
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');
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>
admin/functions.php CHANGED
@@ -19,9 +19,9 @@ class flagAdmin{
19
  */
20
  public static function create_gallery($gallery, $defaultpath, $output = true) {
21
  global $wpdb, $user_ID;
22
-
23
  // get the current user ID
24
- get_currentuserinfo();
25
 
26
  $description = '';
27
  $status = 0;
@@ -41,63 +41,63 @@ class flagAdmin{
41
  $flagpath = $defaultpath . $galleryname;
42
  $flagRoot = WINABSPATH . $defaultpath;
43
  $txt = '';
44
-
45
  // No gallery name ?
46
- if (empty($galleryname)) {
47
- if ($output) flagGallery::show_error( __('No valid gallery name!', 'flag') );
48
  return false;
49
  }
50
-
51
  // check for main folder
52
  if ( !is_dir($flagRoot) ) {
53
  if ( !wp_mkdir_p( $flagRoot ) ) {
54
- $txt = __('Directory', 'flag').' <strong>' . $defaultpath . '</strong> '.__('didn\'t exist. Please create first the main gallery folder ', 'flag').'!<br />';
55
- $txt .= __('Check this link, if you didn\'t know how to set the permission :', 'flag').' <a href="http://codex.wordpress.org/Changing_File_Permissions">http://codex.wordpress.org/Changing_File_Permissions</a> ';
56
  if ($output) flagGallery::show_error($txt);
57
  return false;
58
  }
59
  }
60
 
61
- // check for permission settings, Safe mode limitations are not taken into account.
62
  if ( !is_writeable( $flagRoot ) ) {
63
- $txt = __('Directory', 'flag').' <strong>' . $defaultpath . '</strong> '.__('is not writeable !', 'flag').'<br />';
64
- $txt .= __('Check this link, if you didn\'t know how to set the permission :', 'flag').' <a href="http://codex.wordpress.org/Changing_File_Permissions">http://codex.wordpress.org/Changing_File_Permissions</a> ';
65
  if ($output) flagGallery::show_error($txt);
66
  return false;
67
  }
68
-
69
  // 1. Create new gallery folder
70
  if ( !is_dir(WINABSPATH . $flagpath) ) {
71
- if ( !wp_mkdir_p (WINABSPATH . $flagpath) )
72
- $txt = __('Unable to create directory ', 'flag').$flagpath.'!<br />';
73
  }
74
-
75
  // 2. Check folder permission
76
  if ( !is_writeable(WINABSPATH . $flagpath ) )
77
- $txt .= __('Directory', 'flag').' <strong>'.$flagpath.'</strong> '.__('is not writeable !', 'flag').'<br />';
78
 
79
  // 3. Now create "thumbs" folder inside
80
- if ( !is_dir(WINABSPATH . $flagpath . '/thumbs') ) {
81
- if ( !wp_mkdir_p ( WINABSPATH . $flagpath . '/thumbs') )
82
- $txt .= __('Unable to create directory ', 'flag').' <strong>' . $flagpath . '/thumbs !</strong>';
83
  }
84
-
85
  // 4. Now create "webview" folder inside
86
  if ( !is_dir(WINABSPATH . $flagpath . '/webview') ) {
87
  if ( !wp_mkdir_p ( WINABSPATH . $flagpath . '/webview') )
88
- $txt .= __('Unable to create directory ', 'flag').' <strong>' . $flagpath . '/webview !</strong>';
89
  }
90
 
91
- if (SAFE_MODE) {
92
- $help = __('The server setting Safe-Mode is on !', 'flag');
93
- $help .= '<br />'.__('If you have problems, please create directory', 'flag').' <strong>' . $flagpath . '</strong> ';
94
- $help .= __('and the thumbnails directory', 'flag').' <strong>' . $flagpath . '/thumbs</strong> '.__('with permission 777 manually !', 'flag');
95
  if ($output) flagGallery::show_message($help);
96
  }
97
-
98
- // show an error message
99
  if ( !empty($txt) ) {
100
- if (SAFE_MODE) {
101
  // for safe_mode , better delete folder, both folder must be created manually
102
  @rmdir(WINABSPATH . $flagpath . '/thumbs');
103
  @rmdir(WINABSPATH . $flagpath);
@@ -105,11 +105,11 @@ class flagAdmin{
105
  if ($output) flagGallery::show_error($txt);
106
  return false;
107
  }
108
-
109
  $result = $wpdb->get_var($wpdb->prepare("SELECT `name` FROM `{$wpdb->flaggallery}` WHERE `name` = '%s' ", $galleryname));
110
-
111
  if ($result) {
112
- if ($output) flagGallery::show_error( _n( 'Gallery', 'Galleries', 1, 'flag' ) .' <strong>' . $galleryname . '</strong> '.__('already exists', 'flag'));
113
  return true;
114
  } else {
115
  if(empty($user_ID)){
@@ -122,20 +122,20 @@ class flagAdmin{
122
  do_action('flag_created_new_gallery', $gallery_id);
123
 
124
  if ($result) {
125
- $message = __('Gallery \'%1$s\' successfully created.<br/>You can show this gallery with the tag %2$s.<br/>','flag');
126
  $message = sprintf($message, esc_html(stripcslashes($gallerytitle)), '[flagallery gid=' . $gallery_id . ']');
127
  $message .= '<a href="' . admin_url() . 'admin.php?page=flag-manage-gallery&mode=edit&gid=' . $gallery_id . '" >';
128
- $message .= __('Edit gallery','flag');
129
  $message .= '</a>';
130
-
131
- if ($output) flagGallery::show_message($message);
132
  }
133
  // return only the id if defined
134
  if ($gallery_id)
135
  return $gallery_id;
136
 
137
  return true;
138
- }
139
  }
140
 
141
  /**
@@ -147,36 +147,36 @@ class flagAdmin{
147
  * @return void
148
  */
149
  public static function import_gallery($galleryfolder) {
150
-
151
  global $wpdb, $user_ID;
152
 
153
  // get the current user ID
154
- get_currentuserinfo();
155
-
156
  $created_msg = '';
157
-
158
  // remove trailing slash at the end, if somebody use it
159
  $galleryfolder = str_replace('../','', $galleryfolder );
160
  $galleryfolder = rtrim($galleryfolder, '/');
161
  $gallerypath = WINABSPATH . $galleryfolder;
162
-
163
  if (!is_dir($gallerypath)) {
164
- flagGallery::show_error(__('Directory', 'flag').' <strong>'.esc_html($gallerypath).'</strong> '.__('doesn&#96;t exist!', 'flag').' '.__('Or imported folder name contains special characters.', 'flag'));
165
  return ;
166
  }
167
-
168
  // read list of images
169
  $new_imageslist = flagAdmin::scandir($gallerypath);
170
  if (empty($new_imageslist)) {
171
- flagGallery::show_message(__('Directory', 'flag').' <strong>'.esc_html($gallerypath).'</strong> '.__('contains no pictures', 'flag'));
172
  return;
173
  }
174
-
175
  // check & create thumbnail folder
176
  if ( !flagGallery::create_thumbnail_folder($gallerypath) )
177
  return;
178
-
179
- // take folder name as gallery name
180
  $galleryname = basename($galleryfolder);
181
 
182
  // check for existing gallery folder
@@ -185,43 +185,43 @@ class flagAdmin{
185
  if (!$gallery_id) {
186
  $result = $wpdb->query( $wpdb->prepare("INSERT INTO {$wpdb->flaggallery} (name, path, title, author) VALUES (%s, %s, %s, %s)", $galleryname, $galleryfolder, $galleryname , $user_ID) );
187
  if (!$result) {
188
- flagGallery::show_error(__('Database error. Could not add gallery!','flag'));
189
  return;
190
  }
191
- $created_msg = _n( 'Gallery', 'Galleries', 1, 'flag' ) . ' <strong>' . $galleryname . '</strong> ' . __('successfully created!','flag') . '<br />';
192
  $gallery_id = $wpdb->insert_id; // get index_id
193
  }
194
-
195
  // Look for existing image list
196
  $old_imageslist = $wpdb->get_col($wpdb->prepare("SELECT filename FROM {$wpdb->flagpictures} WHERE galleryid = %d ", $gallery_id));
197
-
198
  // if no images are there, create empty array
199
- if ($old_imageslist == NULL)
200
  $old_imageslist = array();
201
-
202
  // check difference
203
  $new_images = array_diff($new_imageslist, $old_imageslist);
204
-
205
  // all images must be valid files
206
  foreach($new_images as $key => $picture) {
207
  if (!@getimagesize($gallerypath . '/' . $picture) ) {
208
  unset($new_images[$key]);
209
- @unlink($gallerypath . '/' . $picture);
210
  }
211
  }
212
-
213
- // add images to database
214
  $image_ids = flagAdmin::add_Images($gallery_id, $new_images);
215
-
216
  //add the preview image if needed
217
  flagAdmin::set_gallery_preview ( $gallery_id );
218
 
219
  // now create thumbnails
220
- flagAdmin::do_ajax_operation( 'create_thumbnail' , $image_ids, __('Create new thumbnails','flag') );
221
-
222
  //TODO:Message will not shown, because AJAX routine require more time, message should be passed to AJAX
223
- flagGallery::show_message( $created_msg . count($image_ids) .__(' picture(s) successfully added','flag') );
224
-
225
  return;
226
 
227
  }
@@ -242,14 +242,14 @@ class flagAdmin{
242
  $folder = rtrim($folder, '/');
243
  $path = WINABSPATH . $folder;
244
  if (!is_dir($path)) {
245
- echo '<p class="message">'.__('Directory', 'flag').' <strong>'.$path.'</strong> '.__('doesn&#96;t exist!', 'flag').' '.__('Or imported folder name contains special characters.', 'flag').'</p>';
246
  return ;
247
  }
248
  // read list of files
249
- $ext = array('flv');
250
  $new_filelist = flagAdmin::scandir($path, $ext);
251
  if (empty($new_filelist)) {
252
- echo '<p class="message">'.__('Directory', 'flag').' <strong>'.$path.'</strong> '.__('does not contain flv files', 'flag').'</p>';
253
  return;
254
  }
255
  $i=0;
@@ -258,13 +258,13 @@ class flagAdmin{
258
  $filename = $path . '/' . $file;
259
  $id = flagAdmin::handle_import_file($filename);
260
  if ( is_wp_error($id) ) {
261
- $created_msg .= '<p>' . sprintf(__('<em>%s</em> was <strong>not</strong> imported due to an error: %s', 'flag'), $file, $id->get_error_message() ) . '</p>';
262
  } else {
263
  $i++;
264
- $created_msg .= '<p>' . sprintf(__('<em>%s</em> has been added to Media library', 'flag'), $file) . '</p>';
265
  }
266
  }
267
- $created_msg .= '<p class="message">'.$i.__(' file(s) successfully added','flag').'</p><div class="hidden">'.$created_msg.'</div>';
268
  echo $created_msg;
269
  }
270
 
@@ -283,14 +283,14 @@ class flagAdmin{
283
  $folder = rtrim($folder, '/');
284
  $path = WINABSPATH . $folder;
285
  if (!is_dir($path)) {
286
- echo '<p class="message">'.__('Directory', 'flag').' <strong>'.$path.'</strong> '.__('doesn&#96;t exist!', 'flag').' '.__('Or imported folder name contains special characters.', 'flag').'</p>';
287
  return ;
288
  }
289
  // read list of files
290
- $ext = array('mp3');
291
  $new_filelist = flagAdmin::scandir($path, $ext);
292
  if (empty($new_filelist)) {
293
- echo '<p class="message">'.__('Directory', 'flag').' <strong>'.$path.'</strong> '.__('does not contain mp3 files', 'flag').'</p>';
294
  return;
295
  }
296
  $i=0;
@@ -299,13 +299,13 @@ class flagAdmin{
299
  $filename = $path . '/' . $file;
300
  $id = flagAdmin::handle_import_file($filename);
301
  if ( is_wp_error($id) ) {
302
- $created_msg .= '<p>' . sprintf(__('<em>%s</em> was <strong>not</strong> imported due to an error: %s', 'flag'), $file, $id->get_error_message() ) . '</p>';
303
  } else {
304
  $i++;
305
- $created_msg .= '<p>' . sprintf(__('<em>%s</em> has been added to Media library', 'flag'), $file) . '</p>';
306
  }
307
  }
308
- $created_msg .= '<p class="message">'.$i.__(' file(s) successfully added','flag').'</p><div class="hidden">'.$created_msg.'</div>';
309
  echo $created_msg;
310
  }
311
 
@@ -324,16 +324,16 @@ class flagAdmin{
324
  $folder = rtrim($folder, '/');
325
  $path = WINABSPATH . $folder;
326
  if (!is_dir($path)) {
327
- echo '<p class="message">'.__('Directory', 'flag').' <strong>'.$path.'</strong> '.__('doesn&#96;t exist!', 'flag').' '.__('Or imported folder name contains special characters.', 'flag').'</p>';
328
  return false;
329
  }
330
  // read list of files
331
  $new_filelist = flagAdmin::scandir($path);
332
  if (empty($new_filelist)) {
333
- echo '<p class="message">'.__('Directory', 'flag').' <strong>'.$path.'</strong> '.__('does not contain image files', 'flag').'</p>';
334
  return false;
335
  }
336
- $created_msg .= '<div class="message"><p>'.count($new_filelist).' '.__('image(s) in the folder','flag').':</p><div class="flag_crunching"><div class="flag_progress"><span class="flag_complete"></span><span class="txt">'.__('Crunching...','flag').'</span></div></div></div>';
337
  echo $created_msg;
338
  return $new_filelist;
339
  }
@@ -356,10 +356,10 @@ class flagAdmin{
356
  /** @var $type
357
  * @var $ext */
358
  extract( $wp_filetype );
359
-
360
  if ( ( !$type || !$ext ) && !current_user_can( 'unfiltered_upload' ) )
361
  return new WP_Error('wrong_file_type', __( 'File type does not meet security guidelines. Try another.' ) ); //A WP-core string..
362
-
363
  $match = preg_match('|^' . preg_quote(str_replace('\\', '/', $uploads['basedir'])) . '(.*)$|i', $file, $mat);
364
  //Is the file allready in the uploads folder?
365
  if( $match ) {
@@ -383,13 +383,14 @@ class flagAdmin{
383
  $post_date = date( 'Y-m-d H:i:s', $time);
384
  $post_date_gmt = gmdate( 'Y-m-d H:i:s', $time);
385
  }
386
- } else {
387
  $filename = wp_unique_filename( $uploads['path'], basename($file));
388
 
389
  // copy the file to the uploads dir
390
  $new_file = $uploads['path'] . '/' . $filename;
391
- if ( false === @copy( $file, $new_file ) )
392
- wp_die(sprintf( __('The selected file could not be copied to %s.', 'flag'), $uploads['path']));
 
393
 
394
  // Set correct file permissions
395
  $stat = stat( dirname( $new_file ));
@@ -440,7 +441,7 @@ class flagAdmin{
440
  $data = wp_generate_attachment_metadata( $id, $new_file );
441
  wp_update_attachment_metadata( $id, $data );
442
  if( !$match && isset($_POST['delete_files']) ) {
443
- @unlink($file);
444
  }
445
  }
446
 
@@ -458,34 +459,34 @@ class flagAdmin{
458
  public static function scandir($dirname = '.', $ext = array()) {
459
  // thx to php.net :-)
460
  if(empty($ext))
461
- $ext = array('jpeg', 'jpg', 'png', 'gif');
462
- $files = array();
463
- if($handle = opendir($dirname)) {
464
- while(false !== ($file = readdir($handle)))
465
- for($i=0;$i<sizeof($ext);$i++)
466
- if(stristr($file, '.' . $ext[$i]))
467
- $files[] = utf8_encode($file);
468
- closedir($handle);
469
- }
470
  sort($files);
471
- return ($files);
472
- }
473
-
474
  /**
475
  * flagAdmin::createThumbnail() - function to create or recreate a thumbnail
476
- *
477
  * @param object | int $image contain all information about the image or the id
478
  * @return string result code
479
  */
480
  public static function create_thumbnail($image) {
481
-
482
  global $flag;
483
 
484
  if ( is_numeric($image) )
485
  $image = flagdb::find_image( $image );
486
 
487
  if ( !is_object($image) )
488
- return __('Object didn\'t contain correct data','flag');
489
 
490
  $dest_path = dirname($image->webimagePath);
491
  if(!is_dir($dest_path)){
@@ -495,37 +496,19 @@ class flagAdmin{
495
 
496
  if(! class_exists('flag_Thumbnail'))
497
  require_once( flagGallery::graphic_library() );
498
-
499
  // check for existing thumbnail
500
  if (file_exists($image->thumbPath))
501
  if (!is_writable($image->thumbPath))
502
- return $image->filename . __(' is not writeable ','flag');
503
 
504
  $thumb = new flag_Thumbnail($image->imagePath, TRUE);
505
  $img_size = @getimagesize ( $image->imagePath );
506
 
507
  // skip if file is not there
508
  if (!$thumb->error) {
509
- if ($flag->options['thumbFix']) {
510
- // check for portrait format
511
- if ( ($flag->options['thumbWidth']/$flag->options['thumbHeight'] > $img_size[0]/$img_size[1]) ) {
512
- // first resize to the wanted width
513
- $thumb->resize($flag->options['thumbWidth'], 0);
514
- // get optimal y startpos
515
- $ypos = ($thumb->currentDimensions['height'] - $flag->options['thumbHeight']) / 2;
516
- $thumb->crop(0, $ypos, $flag->options['thumbWidth'],$flag->options['thumbHeight']);
517
- } else {
518
- // first resize to the wanted height
519
- $thumb->resize(0, $flag->options['thumbHeight']);
520
- // get optimal x startpos
521
- $xpos = ($thumb->currentDimensions['width'] - $flag->options['thumbWidth']) / 2;
522
- $thumb->crop($xpos, 0, $flag->options['thumbWidth'],$flag->options['thumbHeight']);
523
- }
524
- //this create a thumbnail but keep ratio settings
525
- } else {
526
- $thumb->resize($flag->options['thumbWidth'],$flag->options['thumbHeight']);
527
- }
528
-
529
  // save the new thumbnail
530
  $thumb->save($image->thumbPath, $flag->options['thumbQuality']);
531
  flagAdmin::chmod ($image->thumbPath);
@@ -533,14 +516,14 @@ class flagAdmin{
533
  //read the new sizes
534
  $new_size = @getimagesize ( $image->thumbPath );
535
  $size['width'] = $new_size[0];
536
- $size['height'] = $new_size[1];
537
-
538
  // add them to the database
539
  flagdb::update_image_meta($image->pid, array( 'thumbnail' => $size) );
540
  }
541
-
542
  $thumb->destruct();
543
-
544
  if ( !empty($thumb->errmsg) )
545
  return $image->filename . ' (Error : '.$thumb->errmsg .')';
546
 
@@ -549,30 +532,30 @@ class flagAdmin{
549
  flagAdmin::webview_image($image);
550
 
551
  // success
552
- return '1';
553
  }
554
-
555
  /**
556
  * flagAdmin::resize_image() - create a new image, based on the height /width
557
- *
558
  * @class flagAdmin
559
  * @param object | int $image contain all information about the image or the id
560
- * @param integer $width optional
561
  * @param integer $height optional
562
  * @return string result code
563
  */
564
  public static function resize_image($image, $width = 0, $height = 0) {
565
-
566
  global $flag;
567
-
568
  if(! class_exists('flag_Thumbnail'))
569
  require_once( flagGallery::graphic_library() );
570
 
571
  if ( is_numeric($image) )
572
  $image = flagdb::find_image( $image );
573
-
574
- if ( !is_object($image) )
575
- return __('Object didn\'t contain correct data','flag');
576
 
577
  // before we start we import the meta data to database (required for uploads before V0.40)
578
  flagAdmin::maybe_import_meta( $image->pid );
@@ -580,10 +563,10 @@ class flagAdmin{
580
  // if no parameter is set, take global settings
581
  $width = ($width == 0) ? $flag->options['imgWidth'] : $width;
582
  $height = ($height == 0) ? $flag->options['imgHeight'] : $height;
583
-
584
  if (!is_writable($image->imagePath))
585
- return ' <strong>' . $image->filename . __(' is not writeable','flag') . '</strong>';
586
-
587
  $file = new flag_Thumbnail($image->imagePath, TRUE);
588
 
589
  // skip if file is not there
@@ -605,14 +588,17 @@ class flagAdmin{
605
  return '1';
606
  }
607
 
608
- /**
609
- * flagAdmin::webview_image() - create a new image, based on the height /width
610
- *
611
- * @class flagAdmin
612
- * @param object | int $image contain all information about the image or the id
613
- * @return string result code
614
- */
615
- public static function webview_image($image) {
 
 
 
616
 
617
  global $flag;
618
 
@@ -620,39 +606,51 @@ class flagAdmin{
620
  $image = flagdb::find_image( $image );
621
 
622
  if ( !is_object($image) )
623
- return __('Object didn\'t contain correct data','flag');
624
 
625
  $img_size = @getimagesize ( $image->imagePath );
626
- $dest_path = dirname($image->webimagePath);
 
627
  if(flagGallery::create_webview_folder(dirname($image->imagePath))){
628
  if (! is_writable( $dest_path ) ) {
629
  @chmod( $dest_path, 0755 );
630
  }
631
 
632
  if (file_exists($image->webimagePath)){
633
- return '1';
 
 
 
 
 
 
634
  }
635
 
636
  $imgquality = $flag->options['imgQuality'];
637
- $max_width = ($img_size[0] < 1200)? $img_size[0] : 1200;
638
- $max_height = ($img_size[1] < 1200)? $img_size[1] : 1200;
639
  if( function_exists('wp_get_image_editor') ) {
640
  $editor = wp_get_image_editor( $image->imagePath );
641
- $editor->set_quality( $imgquality );
642
- $editor->resize( $max_width, $max_height, 0 );
643
- $editor->save( $image->webimagePath );
644
- if(@filesize($image->webimagePath) > @filesize($image->imagePath)) {
645
- @copy($image->imagePath, $image->webimagePath);
646
- }
647
- $webviewsize = @getimagesize ( $image->webimagePath );
648
- flagdb::update_image_meta($image->pid, array( 'webview' => $webviewsize) );
649
-
650
- do_action('flag_image_optimized', $image);
651
-
 
652
  }
653
  }
654
 
655
- return '1';
 
 
 
 
656
  }
657
 
658
  /**
@@ -666,10 +664,10 @@ class flagAdmin{
666
  */
667
  public static function add_Images($galleryID, $imageslist, $name2alt = false) {
668
  global $wpdb;
669
-
670
  $alttext = '';
671
  $image_ids = array();
672
-
673
  if ( is_array($imageslist) ) {
674
  foreach($imageslist as $picture) {
675
  if($name2alt) {
@@ -677,11 +675,11 @@ class flagAdmin{
677
  $path_parts = pathinfo( $picture );
678
  $alttext = ( !isset($path_parts['filename']) ) ? substr($path_parts['basename'], 0,strpos($path_parts['basename'], '.')) : $path_parts['filename'];
679
  }
680
- // save it to the database
681
  $result = $wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->flagpictures (galleryid, filename, alttext, exclude) VALUES (%s, %s, %s, 0)", $galleryID, $picture, $alttext) );
682
  // and give me the new id
683
  $pic_id = (int) $wpdb->insert_id;
684
- if ($result)
685
  $image_ids[] = $pic_id;
686
 
687
  // add the metadata
@@ -690,36 +688,36 @@ class flagAdmin{
690
  // action hook for post process after the image is added to the database
691
  $image = array( 'id' => $pic_id, 'filename' => $picture, 'galleryID' => $galleryID);
692
  do_action('flag_added_new_image', $image);
693
-
694
- }
695
  } // is_array
696
-
697
  return $image_ids;
698
-
699
  }
700
 
701
  /**
702
  * Import some metadata into the database (if avialable)
703
- *
704
  * @class flagAdmin
705
  * @param array|int $imagesIds
706
  * @return bool
707
  */
708
  public static function import_MetaData($imagesIds) {
709
-
710
  global $wpdb;
711
-
712
  require_once(FLAG_ABSPATH . 'lib/image.php');
713
-
714
  if (!is_array($imagesIds))
715
  $imagesIds = array($imagesIds);
716
-
717
  foreach($imagesIds as $imageID) {
718
  $image = flagdb::find_image($imageID);
719
  if (!$image->error) {
720
 
721
  $meta = flagAdmin::get_MetaData($image->pid);
722
-
723
  // get the title
724
  $alttext = empty( $meta['title'] ) ? $image->alttext : $meta['title'];
725
  // get the caption / description field
@@ -729,31 +727,31 @@ class flagAdmin{
729
  // update database
730
  $result = $wpdb->query( $wpdb->prepare("UPDATE $wpdb->flagpictures SET alttext = %s, description = %s, imagedate = %s WHERE pid = %d", $alttext, $description, $timestamp, $image->pid) );
731
  if ($result === false)
732
- return ' <strong>' . $image->filename . ' ' . __('(Error : Couldn\'t not update data base)', 'flag') . '</strong>';
733
-
734
  //this flag will inform us the import is already one time performed
735
- $meta['common']['saved'] = true;
736
  $result = flagdb::update_image_meta($image->pid, $meta['common']);
737
-
738
  if ($result === false)
739
- return ' <strong>' . $image->filename . ' ' . __('(Error : Couldn\'t not update meta data)', 'flag') . '</strong>';
740
  } else
741
- return ' <strong>' . $image->filename . ' ' . __('(Error : Couldn\'t not find image)', 'flag') . '</strong>';// error check
742
  }
743
-
744
  return '1';
745
-
746
  }
747
 
748
  /**
749
  * Copy some metadata into the image description (if avialable)
750
- *
751
  * @class flagAdmin
752
  * @param array|int $imagesIds
753
  * @return bool
754
  */
755
  public static function copy_MetaData($imagesIds) {
756
-
757
  global $wpdb;
758
 
759
  /** @var $meta */
@@ -762,15 +760,15 @@ class flagAdmin{
762
 
763
  if (!is_array($imagesIds))
764
  $imagesIds = array($imagesIds);
765
-
766
  foreach($imagesIds as $imageID) {
767
-
768
  $image = flagdb::find_image($imageID);
769
  if (!$image->error) {
770
  /** @var $makedescription
771
  * @var $timestamp */
772
  require_once(FLAG_ABSPATH . 'admin/grab_meta.php');
773
-
774
  // get the title
775
  $alttext = empty( $alttext ) ? $image->alttext : $meta['title'];
776
  if($alttext) $alttext = '<font size="16"><b>'.$alttext."</b></font>\n";
@@ -782,14 +780,14 @@ class flagAdmin{
782
  // update database
783
  $result = $wpdb->query( $wpdb->prepare("UPDATE $wpdb->flagpictures SET alttext = %s, description = %s, imagedate = %s WHERE pid = %d", '', $makedescription, $timestamp, $image->pid) );
784
  if ($result === false)
785
- return ' <strong>' . $image->filename . ' ' . __('(Error : Couldn\'t not update data base)', 'flag') . '</strong>';
786
-
787
  } else
788
- return ' <strong>' . $image->filename . ' ' . __('(Error : Couldn\'t not find image)', 'flag') . '</strong>';// error check
789
  }
790
-
791
  return '1';
792
-
793
  }
794
 
795
  /**
@@ -801,37 +799,37 @@ class flagAdmin{
801
  * @return array metadata
802
  */
803
  public static function get_MetaData($id) {
804
-
805
  require_once(FLAG_ABSPATH . 'lib/meta.php');
806
-
807
  $meta = array();
808
 
809
  $pdata = new flagMeta( $id );
810
 
811
- $meta['title'] = trim ( $pdata->get_META('title') );
812
- $meta['caption'] = trim ( $pdata->get_META('caption') );
813
  $meta['keywords'] = trim ( $pdata->get_META('keywords') );
814
  $meta['timestamp'] = $pdata->get_date_time();
815
  // this contain other useful meta information
816
  $meta['common'] = $pdata->get_common_meta();
817
-
818
  return $meta;
819
-
820
  }
821
 
822
  /**
823
  * Maybe import some meta data to the database. The functions checks the flag 'saved'
824
  * and if based on compat reason (pre V0.40) we save then some meta datas to the database
825
- *
826
  * @param int $id
827
  * @return mixed result
828
  */
829
  public static function maybe_import_meta( $id ) {
830
-
831
  require_once(FLAG_ABSPATH . 'lib/meta.php');
832
 
833
  $meta_obj = new flagMeta( $id );
834
-
835
  if ( $meta_obj->image->meta_data['saved'] != true ) {
836
  $common = $meta_obj->get_common_meta();
837
  //this flag will inform us that the import is already one time performed
@@ -839,29 +837,29 @@ class flagAdmin{
839
  $result = flagdb::update_image_meta($id, $common);
840
  } else
841
  return false;
842
-
843
- return $result;
844
 
845
  }
846
 
847
  /**
848
  * flagAdmin::getOnlyImages()
849
- *
850
  * @class flagAdmin
851
  * @param mixed $p_event
852
  * @param mixed $p_header
853
  * @return bool
854
  */
855
  public static function getOnlyImages($p_event, $p_header) {
856
-
857
  $info = pathinfo($p_header['filename']);
858
  // check for extension
859
- $ext = array('jpeg', 'jpg', 'png', 'gif');
860
  if ( in_array( strtolower($info['extension']), $ext) ) {
861
  // For MAC skip the ".image" files
862
- if ($info['basename']{0} == '.' )
863
  return 0;
864
- else
865
  return 1;
866
  }
867
  // ----- all other files are skipped
@@ -872,14 +870,14 @@ class flagAdmin{
872
 
873
  /**
874
  * Function for uploading of images via the upload form
875
- *
876
  * @class flagAdmin
877
  * @return void
878
  */
879
  public static function upload_images() {
880
-
881
  global $wpdb;
882
-
883
  // WPMU action
884
  if (flagAdmin::check_quota())
885
  return;
@@ -891,97 +889,97 @@ class flagAdmin{
891
  $galleryID = (int) $_POST['galleryselect'];
892
 
893
  if ($galleryID == 0) {
894
- flagGallery::show_error(__('No gallery selected !','flag'));
895
- return;
896
  }
897
 
898
- // get the path to the gallery
899
  $gallery = flagdb::find_gallery($galleryID);
900
 
901
  if ( empty($gallery->path) ){
902
- flagGallery::show_error(__('Failure in database, no gallery path set !','flag'));
903
  return;
904
- }
905
-
906
  // read list of images
907
  $dirlist = flagAdmin::scandir(WINABSPATH.$gallery->path);
908
-
909
  $imagefiles = $_FILES['imagefiles'];
910
-
911
  if (is_array($imagefiles)) {
912
  foreach ($imagefiles['name'] as $key => $value) {
913
 
914
  // look only for uploded files
915
  if ($imagefiles['error'][$key] == 0) {
916
-
917
  $temp_file = $imagefiles['tmp_name'][$key];
918
-
919
  //clean filename and extract extension
920
  $filepart = flagGallery::fileinfo( $imagefiles['name'][$key] );
921
  $filename = $filepart['basename'];
922
-
923
  // check for allowed extension and if it's an image file
924
  $ext = array('jpg', 'jpeg', 'png', 'gif');
925
  if ( !in_array(strtolower($filepart['extension']), $ext) || !@getimagesize($temp_file) ){
926
- flagGallery::show_error('<strong>' . $imagefiles['name'][$key] . ' </strong>' . __('is no valid image file!','flag'));
927
  continue;
928
  }
929
-
930
  // check if this filename already exist in the folder
931
  $i = 0;
932
  while ( in_array( $filename, $dirlist ) ) {
933
  $filename = $filepart['filename'] . '_' . $i++ . '.' .$filepart['extension'];
934
  }
935
-
936
  $dest_file = $gallery->abspath . '/' . $filename;
937
-
938
  //check for folder permission
939
  if ( !is_writeable($gallery->abspath) ) {
940
- $message = sprintf(__('Unable to write to directory %s. Is this directory writable by the server?', 'flag'), $gallery->abspath);
941
  flagGallery::show_error($message);
942
- return;
943
  }
944
-
945
  // save temp file to gallery
946
  if ( !@move_uploaded_file($temp_file, $dest_file) ){
947
  if( !file_exists($dest_file)){
948
- flagGallery::show_error(__('Error, the file could not moved to : ','flag') . $dest_file);
949
  flagAdmin::check_safemode( $gallery->abspath );
950
  continue;
951
  }
952
- }
953
  if ( !flagAdmin::chmod($dest_file) ) {
954
- flagGallery::show_error(__('Error, the file permissions could not set','flag'));
955
  continue;
956
  }
957
-
958
  // add to imagelist & dirlist
959
  $imageslist[] = $filename;
960
  $dirlist[] = $filename;
961
  }
962
  }
963
  }
964
-
965
  if (count($imageslist) > 0) {
966
-
967
- // add images to database
968
  $image_ids = flagAdmin::add_Images($galleryID, $imageslist);
969
 
970
  //create thumbnails
971
- flagAdmin::do_ajax_operation( 'create_thumbnail' , $image_ids, __('Create new thumbnails','flag') );
972
  //add the preview image if needed
973
  flagAdmin::set_gallery_preview ( $galleryID );
974
-
975
- flagGallery::show_message( count($image_ids) . __(' Image(s) successfully added','flag'));
976
  }
977
-
978
  return;
979
 
980
  } // end function
981
-
982
  /**
983
  * Upload function will be called via the Flash uploader
984
- *
985
  * @class flagAdmin
986
  * @param integer $galleryID
987
  * @return string $result
@@ -992,7 +990,7 @@ class flagAdmin{
992
 
993
  if ($galleryID == 0) {
994
  //@unlink($temp_file);
995
- return __('No gallery selected!','flag');
996
  }
997
 
998
  // WPMU action
@@ -1010,18 +1008,18 @@ class flagAdmin{
1010
  $filename = $filepart['basename'];
1011
 
1012
  // check for allowed extension
1013
- $ext = array('jpeg', 'jpg', 'png', 'gif');
1014
  if (!in_array(strtolower($filepart['extension']), $ext)){
1015
  if(!@getimagesize($temp_file))
1016
- return $filename . ' '. __('is no valid image file!','flag');
1017
  }
1018
 
1019
  // get the path to the gallery
1020
  $gallerypath = $wpdb->get_var($wpdb->prepare("SELECT path FROM {$wpdb->flaggallery} WHERE gid = %d ", $galleryID));
1021
  if (!$gallerypath){
1022
  @unlink($temp_file);
1023
- return __('Failure in database, no gallery path set !','flag');
1024
- }
1025
 
1026
  // read list of images
1027
  $imageslist = flagAdmin::scandir( WINABSPATH.$gallerypath );
@@ -1031,19 +1029,44 @@ class flagAdmin{
1031
  while (in_array($filename,$imageslist)) {
1032
  $filename = sanitize_title($filepart['filename']) . '_' . $i++ . '.' . $filepart['extension'];
1033
  }
1034
-
1035
  $dest_file = WINABSPATH . $gallerypath . '/' . $filename;
1036
-
1037
  // save temp file to gallery
1038
  if ( !@move_uploaded_file($temp_file, $dest_file) ){
1039
  if( !file_exists($dest_file)){
1040
  flagAdmin::check_safemode(WINABSPATH.$gallerypath);
1041
- return __('Error, the file could not moved to : ','flag').$dest_file;
1042
  }
1043
  }
1044
-
1045
  if ( !flagAdmin::chmod($dest_file) )
1046
- return __('Error, the file permissions could not set','flag');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1047
 
1048
  // add images to database
1049
  $image_ids = flagAdmin::add_Images($galleryID, array($filename));
@@ -1051,9 +1074,8 @@ class flagAdmin{
1051
  //create thumbnails
1052
 
1053
  //save the thumb size values
1054
- $flag->options['thumbWidth'] = intval($_POST['thumbw'])? intval($_POST['thumbw']) : 100;
1055
- $flag->options['thumbHeight'] = intval($_POST['thumbh'])? intval($_POST['thumbh']) : 100;
1056
- $flag->options['thumbFix'] = ('true' == $_POST['thumbf'])? 1 : 0;
1057
  update_option('flag_options', $flag->options);
1058
 
1059
  foreach($image_ids as $picture){
@@ -1074,46 +1096,46 @@ class flagAdmin{
1074
  * @param $error_code
1075
  * @return string $result
1076
  */
1077
- function file_upload_error_message($error_code) {
1078
  switch ($error_code) {
1079
  case UPLOAD_ERR_INI_SIZE:
1080
- return __('The uploaded file exceeds the upload_max_filesize directive in php.ini','flag');
1081
  case UPLOAD_ERR_FORM_SIZE:
1082
- return __('The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form','flag');
1083
  case UPLOAD_ERR_PARTIAL:
1084
- return __('The uploaded file was only partially uploaded','flag');
1085
  case UPLOAD_ERR_NO_FILE:
1086
- return __('No file was uploaded','flag');
1087
  case UPLOAD_ERR_NO_TMP_DIR:
1088
- return __('Missing a temporary folder','flag');
1089
  case UPLOAD_ERR_CANT_WRITE:
1090
- return __('Failed to write file to disk','flag');
1091
  case UPLOAD_ERR_EXTENSION:
1092
- return __('File upload stopped by extension','flag');
1093
  default:
1094
- return __('Unknown upload error','flag');
1095
  }
1096
  }
1097
 
1098
  /**
1099
  * Check the Quota under WPMU. Only needed for this case
1100
- *
1101
  * @class flagAdmin
1102
  * @return bool $result
1103
  */
1104
- public static function check_quota() {
1105
 
1106
  if ( (IS_WPMU) && flagGallery::flag_wpmu_enable_function('wpmuQuotaCheck'))
1107
  if( $error = upload_is_user_over_quota( false ) ) {
1108
- flagGallery::show_error( __( 'Sorry, you have used your space allocation. Please delete some files to upload more files.','flag' ) );
1109
  return true;
1110
  }
1111
  return false;
1112
  }
1113
-
1114
  /**
1115
  * Set correct file permissions (taken from wp core)
1116
- *
1117
  * @class flagAdmin
1118
  * @param string $filename
1119
  * @return bool $result
@@ -1125,39 +1147,40 @@ class flagAdmin{
1125
  $perms = $perms & 0000666;
1126
  if ( @chmod($filename, $perms) )
1127
  return true;
1128
-
1129
  return false;
1130
  }
1131
-
1132
  /**
1133
  * Check UID in folder and Script
1134
  * Read http://www.php.net/manual/en/features.safe-mode.php to understand safe_mode
1135
- *
1136
  * @class flagAdmin
1137
  * @param string $foldername
1138
  * @return bool $result
1139
  */
1140
  public static function check_safemode($foldername) {
1141
 
1142
- if ( SAFE_MODE ) {
1143
-
1144
- $script_uid = ( ini_get('safe_mode_gid') ) ? getmygid() : getmyuid();
 
1145
  $folder_uid = fileowner($foldername);
1146
 
1147
  if ($script_uid != $folder_uid) {
1148
- $message = sprintf(__('SAFE MODE Restriction in effect! You need to create the folder <strong>%s</strong> manually','flag'), $foldername);
1149
- $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','flag'), $script_uid, $folder_uid );
1150
  flagGallery::show_error($message);
1151
  return false;
1152
  }
1153
  }
1154
-
1155
  return true;
1156
  }
1157
-
1158
  /**
1159
  * Capability check. Check is the ID fit's to the user_ID
1160
- *
1161
  * @class flagAdmin
1162
  * @param int $check_ID is the user_id
1163
  * @return bool $result
@@ -1165,17 +1188,17 @@ class flagAdmin{
1165
  public static function can_manage_this_gallery($check_ID) {
1166
 
1167
  global $user_ID, $wp_roles;
1168
-
1169
  if ( !current_user_can('FlAG Manage others gallery') ) {
1170
  // get the current user ID
1171
- get_currentuserinfo();
1172
-
1173
  if ( $user_ID != $check_ID)
1174
  return false;
1175
  }
1176
  return true;
1177
  }
1178
-
1179
  /**
1180
  * Move images from one folder to another
1181
  *
@@ -1190,51 +1213,51 @@ class flagAdmin{
1190
 
1191
  if (!is_array($pic_ids))
1192
  $pic_ids = array($pic_ids);
1193
-
1194
  // Get destination gallery
1195
  $destination = flagdb::find_gallery( $dest_gid );
1196
  $dest_abspath = WINABSPATH . $destination->path;
1197
-
1198
  if ( $destination == null ) {
1199
- flagGallery::show_error(__('The destination gallery does not exist','flag'));
1200
  return;
1201
  }
1202
-
1203
  // Check for folder permission
1204
  if ( !is_writeable( $dest_abspath ) ) {
1205
- $message = sprintf(__('Unable to write to directory %s. Is this directory writable by the server?', 'flag'), $dest_abspath );
1206
  flagGallery::show_error($message);
1207
- return;
1208
  }
1209
-
1210
  // Get pictures
1211
  $images = flagdb::find_images_in_list($pic_ids);
1212
 
1213
- foreach ($images as $image) {
1214
-
1215
  $i = 0;
1216
  $tmp_prefix = '';
1217
-
1218
  $destination_file_name = $image->filename;
1219
  // check if the filename already exist, then we add a copy_ prefix
1220
  while (file_exists( $dest_abspath . '/' . $destination_file_name)) {
1221
  $tmp_prefix = 'copy_' . ($i++) . '_';
1222
  $destination_file_name = $tmp_prefix . $image->filename;
1223
  }
1224
-
1225
  $destination_path = $dest_abspath . '/' . $destination_file_name;
1226
  $destination_thumbnail = $dest_abspath . '/thumbs/thumbs_' . $destination_file_name;
1227
 
1228
  // Move files
1229
  if ( !@rename($image->imagePath, $destination_path) ) {
1230
- $errors .= sprintf(__('Failed to move image %1$s to %2$s','flag'),
1231
  '<strong>' . $image->filename . '</strong>', $destination_path) . '<br />';
1232
- continue;
1233
  }
1234
-
1235
  // Move the thumbnail, if possible
1236
  @rename($image->thumbPath, $destination_thumbnail);
1237
-
1238
  // Change the gallery id in the database , maybe the filename
1239
  if ( flagdb::update_image($image->pid, $dest_gid, $destination_file_name) )
1240
  $count++;
@@ -1245,94 +1268,94 @@ class flagAdmin{
1245
  flagGallery::show_error($errors);
1246
 
1247
  $link = '<a href="' . admin_url() . 'admin.php?page=flag-manage-gallery&mode=edit&gid=' . $destination->gid . '" >' . $destination->title . '</a>';
1248
- $messages = sprintf(__('Moved %1$s picture(s) to gallery : %2$s .','flag'), $count, $link);
1249
  flagGallery::show_message($messages);
1250
 
1251
  return;
1252
  }
1253
-
1254
  /**
1255
  * Copy images to another gallery
1256
- *
1257
  * @class flagAdmin
1258
  * @param array|int $pic_ids ID's of the images
1259
  * @param int $dest_gid destination gallery
1260
  * @return void
1261
  */
1262
  public static function copy_images($pic_ids, $dest_gid) {
1263
-
1264
  $errors = $messages = '';
1265
-
1266
  if (!is_array($pic_ids))
1267
  $pic_ids = array($pic_ids);
1268
-
1269
  // Get destination gallery
1270
  $destination = flagdb::find_gallery( $dest_gid );
1271
  if ( $destination == null ) {
1272
- flagGallery::show_error(__('The destination gallery does not exist','flag'));
1273
  return;
1274
  }
1275
-
1276
  // Check for folder permission
1277
  if (!is_writeable(WINABSPATH.$destination->path)) {
1278
- $message = sprintf(__('Unable to write to directory %s. Is this directory writable by the server?', 'flag'), WINABSPATH.$destination->path);
1279
  flagGallery::show_error($message);
1280
- return;
1281
  }
1282
-
1283
  // Get pictures
1284
  $images = flagdb::find_images_in_list($pic_ids);
1285
  $destination_path = WINABSPATH . $destination->path;
1286
-
1287
- foreach ($images as $image) {
1288
  // WPMU action
1289
  if ( flagAdmin::check_quota() )
1290
  return;
1291
-
1292
  $i = 0;
1293
- $tmp_prefix = '';
1294
  $destination_file_name = $image->filename;
1295
  while (file_exists($destination_path . '/' . $destination_file_name)) {
1296
  $tmp_prefix = 'copy_' . ($i++) . '_';
1297
  $destination_file_name = $tmp_prefix . $image->filename;
1298
  }
1299
-
1300
  $destination_file_path = $destination_path . '/' . $destination_file_name;
1301
  $destination_thumb_file_path = $destination_path . '/' . $image->thumbFolder . $image->thumbPrefix . $destination_file_name;
1302
 
1303
  // Copy files
1304
  if ( !@copy($image->imagePath, $destination_file_path) ) {
1305
- $errors .= sprintf(__('Failed to copy image %1$s to %2$s','flag'),
1306
  $image->filename, $destination_file_path) . '<br />';
1307
- continue;
1308
  }
1309
-
1310
  // Copy the thumbnail if possible
1311
  @copy($image->thumbPath, $destination_thumb_file_path);
1312
-
1313
  // Create new database entry for the image
1314
  $new_pid = flagdb::insert_image( $destination->gid, $destination_file_name, $image->alttext, $image->description, $image->exclude);
1315
 
1316
- if (!isset($new_pid)) {
1317
- $errors .= sprintf(__('Failed to copy database row for picture %s','flag'), $image->pid) . '<br />';
1318
- continue;
1319
  }
1320
-
1321
  if ( $tmp_prefix != '' ) {
1322
- $messages .= sprintf(__('Image %1$s (%2$s) copied as image %3$s (%4$s) &raquo; The file already existed in the destination gallery.','flag'),
1323
  $image->pid, $image->filename, $new_pid, $destination_file_name) . '<br />';
1324
  } else {
1325
- $messages .= sprintf(__('Image %1$s (%2$s) copied as image %3$s (%4$s)','flag'),
1326
  $image->pid, $image->filename, $new_pid, $destination_file_name) . '<br />';
1327
  }
1328
 
1329
  }
1330
-
1331
  // Finish by showing errors or success
1332
  if ( $errors == '' ) {
1333
  $link = '<a href="' . admin_url() . 'admin.php?page=flag-manage-gallery&mode=edit&gid=' . $destination->gid . '" >' . $destination->title . '</a>';
1334
- $messages .= '<hr />' . sprintf(__('Copied %1$s picture(s) to gallery: %2$s .','flag'), count($images), $link);
1335
- }
1336
 
1337
  if ( $messages != '' )
1338
  flagGallery::show_message($messages);
@@ -1342,23 +1365,23 @@ class flagAdmin{
1342
 
1343
  return;
1344
  }
1345
-
1346
  /**
1347
  * Initate the Ajax operation
1348
- *
1349
- * @class flagAdmin
1350
  * @param string $operation name of the function which should be executed
1351
  * @param array $image_array
1352
  * @param string $title name of the operation
1353
  * @return string the javascript output
1354
  */
1355
  public static function do_ajax_operation( $operation, $image_array, $title = '' ) {
1356
-
1357
  if ( !is_array($image_array) || empty($image_array) )
1358
  return;
1359
 
1360
  $js_array = implode('","', $image_array);
1361
-
1362
  // send out some JavaScript, which initate the ajax operation
1363
  ?>
1364
  <script type="text/javascript">
@@ -1367,25 +1390,25 @@ class flagAdmin{
1367
 
1368
  flagAjaxOptions = {
1369
  operation: "<?php echo $operation; ?>",
1370
- ids: Images,
1371
  header: "<?php echo $title; ?>",
1372
  maxStep: Images.length
1373
  };
1374
-
1375
- jQuery(document).ready( function(){
1376
  flagProgressBar.init( flagAjaxOptions );
1377
  flagAjax.init( flagAjaxOptions );
1378
  } );
1379
  </script>
1380
-
1381
  <div id="progressbar_container" class="wrap"></div>
1382
-
1383
- <?php
1384
  }
1385
-
1386
  /**
1387
  * flagAdmin::set_gallery_preview() - define a preview pic after the first upload, can be changed in the gallery settings
1388
- *
1389
  * @class flagAdmin
1390
  * @param int $galleryID
1391
  * @return void
@@ -1395,7 +1418,7 @@ class flagAdmin{
1395
 
1396
  $galleryID = intval($galleryID);
1397
  $gallery = flagdb::find_gallery( $galleryID );
1398
-
1399
  // in the case no preview image is setup, we do this now
1400
  if ($gallery->previewpic == 0) {
1401
  $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));
@@ -1404,28 +1427,28 @@ class flagAdmin{
1404
  wp_cache_delete($galleryID, 'flag_gallery');
1405
  }
1406
  }
1407
-
1408
  return;
1409
  }
1410
 
1411
  /**
1412
  * Return a JSON coded array of Image ids for a requested gallery
1413
- *
1414
  * @param int $galleryID
1415
  * @return array (JSON)
1416
  */
1417
  public static function get_image_ids( $galleryID ) {
1418
-
1419
  if ( !function_exists('json_encode') )
1420
  return(-2);
1421
-
1422
  $gallery = flagdb::get_ids_from_gallery($galleryID, 'pid', 'ASC', false);
1423
 
1424
  header('Content-Type: text/plain; charset=' . get_option('blog_charset'), true);
1425
  $output = json_encode($gallery);
1426
-
1427
  return $output;
1428
  }
1429
-
1430
  } // END class flagAdmin
1431
  }
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;
41
  $flagpath = $defaultpath . $galleryname;
42
  $flagRoot = WINABSPATH . $defaultpath;
43
  $txt = '';
44
+
45
  // No gallery name ?
46
+ if (empty($galleryname)) {
47
+ if ($output) flagGallery::show_error( __('No valid gallery name!', 'flash-album-gallery') );
48
  return false;
49
  }
50
+
51
  // check for main folder
52
  if ( !is_dir($flagRoot) ) {
53
  if ( !wp_mkdir_p( $flagRoot ) ) {
54
+ $txt = __('Directory', 'flash-album-gallery').' <strong>' . $defaultpath . '</strong> '.__('didn\'t exist. Please create first the main gallery folder ', 'flash-album-gallery').'!<br />';
55
+ $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> ';
56
  if ($output) flagGallery::show_error($txt);
57
  return false;
58
  }
59
  }
60
 
61
+ // check for permission settings, Safe mode limitations are not taken into account.
62
  if ( !is_writeable( $flagRoot ) ) {
63
+ $txt = __('Directory', 'flash-album-gallery').' <strong>' . $defaultpath . '</strong> '.__('is not writeable !', 'flash-album-gallery').'<br />';
64
+ $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> ';
65
  if ($output) flagGallery::show_error($txt);
66
  return false;
67
  }
68
+
69
  // 1. Create new gallery folder
70
  if ( !is_dir(WINABSPATH . $flagpath) ) {
71
+ if ( !wp_mkdir_p (WINABSPATH . $flagpath) )
72
+ $txt = __('Unable to create directory ', 'flash-album-gallery').$flagpath.'!<br />';
73
  }
74
+
75
  // 2. Check folder permission
76
  if ( !is_writeable(WINABSPATH . $flagpath ) )
77
+ $txt .= __('Directory', 'flash-album-gallery').' <strong>'.$flagpath.'</strong> '.__('is not writeable !', 'flash-album-gallery').'<br />';
78
 
79
  // 3. Now create "thumbs" folder inside
80
+ if ( !is_dir(WINABSPATH . $flagpath . '/thumbs') ) {
81
+ if ( !wp_mkdir_p ( WINABSPATH . $flagpath . '/thumbs') )
82
+ $txt .= __('Unable to create directory ', 'flash-album-gallery').' <strong>' . $flagpath . '/thumbs !</strong>';
83
  }
84
+
85
  // 4. Now create "webview" folder inside
86
  if ( !is_dir(WINABSPATH . $flagpath . '/webview') ) {
87
  if ( !wp_mkdir_p ( WINABSPATH . $flagpath . '/webview') )
88
+ $txt .= __('Unable to create directory ', 'flash-album-gallery').' <strong>' . $flagpath . '/webview !</strong>';
89
  }
90
 
91
+ if (FLAG_SAFE_MODE) {
92
+ $help = __('The server setting Safe-Mode is on !', 'flash-album-gallery');
93
+ $help .= '<br />'.__('If you have problems, please create directory', 'flash-album-gallery').' <strong>' . $flagpath . '</strong> ';
94
+ $help .= __('and the thumbnails directory', 'flash-album-gallery').' <strong>' . $flagpath . '/thumbs</strong> '.__('with permission 777 manually !', 'flash-album-gallery');
95
  if ($output) flagGallery::show_message($help);
96
  }
97
+
98
+ // show an error message
99
  if ( !empty($txt) ) {
100
+ if (FLAG_SAFE_MODE) {
101
  // for safe_mode , better delete folder, both folder must be created manually
102
  @rmdir(WINABSPATH . $flagpath . '/thumbs');
103
  @rmdir(WINABSPATH . $flagpath);
105
  if ($output) flagGallery::show_error($txt);
106
  return false;
107
  }
108
+
109
  $result = $wpdb->get_var($wpdb->prepare("SELECT `name` FROM `{$wpdb->flaggallery}` WHERE `name` = '%s' ", $galleryname));
110
+
111
  if ($result) {
112
+ if ($output) flagGallery::show_error( _n( 'Gallery', 'Galleries', 1, 'flash-album-gallery' ) .' <strong>' . $galleryname . '</strong> '.__('already exists', 'flash-album-gallery'));
113
  return true;
114
  } else {
115
  if(empty($user_ID)){
122
  do_action('flag_created_new_gallery', $gallery_id);
123
 
124
  if ($result) {
125
+ $message = __('Gallery \'%1$s\' successfully created.<br/>You can show this gallery with the tag %2$s.<br/>','flash-album-gallery');
126
  $message = sprintf($message, esc_html(stripcslashes($gallerytitle)), '[flagallery gid=' . $gallery_id . ']');
127
  $message .= '<a href="' . admin_url() . 'admin.php?page=flag-manage-gallery&mode=edit&gid=' . $gallery_id . '" >';
128
+ $message .= __('Edit gallery','flash-album-gallery');
129
  $message .= '</a>';
130
+
131
+ if ($output) flagGallery::show_message($message);
132
  }
133
  // return only the id if defined
134
  if ($gallery_id)
135
  return $gallery_id;
136
 
137
  return true;
138
+ }
139
  }
140
 
141
  /**
147
  * @return void
148
  */
149
  public static function import_gallery($galleryfolder) {
150
+
151
  global $wpdb, $user_ID;
152
 
153
  // get the current user ID
154
+ wp_get_current_user();
155
+
156
  $created_msg = '';
157
+
158
  // remove trailing slash at the end, if somebody use it
159
  $galleryfolder = str_replace('../','', $galleryfolder );
160
  $galleryfolder = rtrim($galleryfolder, '/');
161
  $gallerypath = WINABSPATH . $galleryfolder;
162
+
163
  if (!is_dir($gallerypath)) {
164
+ 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'));
165
  return ;
166
  }
167
+
168
  // read list of images
169
  $new_imageslist = flagAdmin::scandir($gallerypath);
170
  if (empty($new_imageslist)) {
171
+ flagGallery::show_message(__('Directory', 'flash-album-gallery').' <strong>'.esc_html($gallerypath).'</strong> '.__('contains no pictures', 'flash-album-gallery'));
172
  return;
173
  }
174
+
175
  // check & create thumbnail folder
176
  if ( !flagGallery::create_thumbnail_folder($gallerypath) )
177
  return;
178
+
179
+ // take folder name as gallery name
180
  $galleryname = basename($galleryfolder);
181
 
182
  // check for existing gallery folder
185
  if (!$gallery_id) {
186
  $result = $wpdb->query( $wpdb->prepare("INSERT INTO {$wpdb->flaggallery} (name, path, title, author) VALUES (%s, %s, %s, %s)", $galleryname, $galleryfolder, $galleryname , $user_ID) );
187
  if (!$result) {
188
+ flagGallery::show_error(__('Database error. Could not add gallery!','flash-album-gallery'));
189
  return;
190
  }
191
+ $created_msg = _n( 'Gallery', 'Galleries', 1, 'flash-album-gallery' ) . ' <strong>' . $galleryname . '</strong> ' . __('successfully created!','flash-album-gallery') . '<br />';
192
  $gallery_id = $wpdb->insert_id; // get index_id
193
  }
194
+
195
  // Look for existing image list
196
  $old_imageslist = $wpdb->get_col($wpdb->prepare("SELECT filename FROM {$wpdb->flagpictures} WHERE galleryid = %d ", $gallery_id));
197
+
198
  // if no images are there, create empty array
199
+ if ($old_imageslist == NULL)
200
  $old_imageslist = array();
201
+
202
  // check difference
203
  $new_images = array_diff($new_imageslist, $old_imageslist);
204
+
205
  // all images must be valid files
206
  foreach($new_images as $key => $picture) {
207
  if (!@getimagesize($gallerypath . '/' . $picture) ) {
208
  unset($new_images[$key]);
209
+ @unlink($gallerypath . '/' . $picture);
210
  }
211
  }
212
+
213
+ // add images to database
214
  $image_ids = flagAdmin::add_Images($gallery_id, $new_images);
215
+
216
  //add the preview image if needed
217
  flagAdmin::set_gallery_preview ( $gallery_id );
218
 
219
  // now create thumbnails
220
+ flagAdmin::do_ajax_operation( 'create_thumbnail' , $image_ids, __('Create new thumbnails','flash-album-gallery') );
221
+
222
  //TODO:Message will not shown, because AJAX routine require more time, message should be passed to AJAX
223
+ flagGallery::show_message( $created_msg . count($image_ids) .__(' picture(s) successfully added','flash-album-gallery') );
224
+
225
  return;
226
 
227
  }
242
  $folder = rtrim($folder, '/');
243
  $path = WINABSPATH . $folder;
244
  if (!is_dir($path)) {
245
+ 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>';
246
  return ;
247
  }
248
  // read list of files
249
+ $ext = array('mp4','ogg','webm','flv');
250
  $new_filelist = flagAdmin::scandir($path, $ext);
251
  if (empty($new_filelist)) {
252
+ echo '<p class="message">'.__('Directory', 'flash-album-gallery').' <strong>'.$path.'</strong> '.__('does not contain video files', 'flash-album-gallery').'</p>';
253
  return;
254
  }
255
  $i=0;
258
  $filename = $path . '/' . $file;
259
  $id = flagAdmin::handle_import_file($filename);
260
  if ( is_wp_error($id) ) {
261
+ $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>';
262
  } else {
263
  $i++;
264
+ $created_msg .= '<p>' . sprintf(__('<em>%s</em> has been added to Media library', 'flash-album-gallery'), $file) . '</p>';
265
  }
266
  }
267
+ $created_msg .= '<p class="message">'.$i.__(' file(s) successfully added','flash-album-gallery').'</p><div class="hidden">'.$created_msg.'</div>';
268
  echo $created_msg;
269
  }
270
 
283
  $folder = rtrim($folder, '/');
284
  $path = WINABSPATH . $folder;
285
  if (!is_dir($path)) {
286
+ 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>';
287
  return ;
288
  }
289
  // read list of files
290
+ $ext = array('mp3', 'ogg', 'wav');
291
  $new_filelist = flagAdmin::scandir($path, $ext);
292
  if (empty($new_filelist)) {
293
+ echo '<p class="message">'.__('Directory', 'flash-album-gallery').' <strong>'.$path.'</strong> '.__('does not contain audio files', 'flash-album-gallery').'</p>';
294
  return;
295
  }
296
  $i=0;
299
  $filename = $path . '/' . $file;
300
  $id = flagAdmin::handle_import_file($filename);
301
  if ( is_wp_error($id) ) {
302
+ $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>';
303
  } else {
304
  $i++;
305
+ $created_msg .= '<p>' . sprintf(__('<em>%s</em> has been added to Media library', 'flash-album-gallery'), $file) . '</p>';
306
  }
307
  }
308
+ $created_msg .= '<p class="message">'.$i.__(' file(s) successfully added','flash-album-gallery').'</p><div class="hidden">'.$created_msg.'</div>';
309
  echo $created_msg;
310
  }
311
 
324
  $folder = rtrim($folder, '/');
325
  $path = WINABSPATH . $folder;
326
  if (!is_dir($path)) {
327
+ 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>';
328
  return false;
329
  }
330
  // read list of files
331
  $new_filelist = flagAdmin::scandir($path);
332
  if (empty($new_filelist)) {
333
+ echo '<p class="message">'.__('Directory', 'flash-album-gallery').' <strong>'.$path.'</strong> '.__('does not contain image files', 'flash-album-gallery').'</p>';
334
  return false;
335
  }
336
+ $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>';
337
  echo $created_msg;
338
  return $new_filelist;
339
  }
356
  /** @var $type
357
  * @var $ext */
358
  extract( $wp_filetype );
359
+
360
  if ( ( !$type || !$ext ) && !current_user_can( 'unfiltered_upload' ) )
361
  return new WP_Error('wrong_file_type', __( 'File type does not meet security guidelines. Try another.' ) ); //A WP-core string..
362
+
363
  $match = preg_match('|^' . preg_quote(str_replace('\\', '/', $uploads['basedir'])) . '(.*)$|i', $file, $mat);
364
  //Is the file allready in the uploads folder?
365
  if( $match ) {
383
  $post_date = date( 'Y-m-d H:i:s', $time);
384
  $post_date_gmt = gmdate( 'Y-m-d H:i:s', $time);
385
  }
386
+ } else {
387
  $filename = wp_unique_filename( $uploads['path'], basename($file));
388
 
389
  // copy the file to the uploads dir
390
  $new_file = $uploads['path'] . '/' . $filename;
391
+ if ( false === @copy( $file, $new_file ) ){
392
+ wp_die(sprintf(__('The selected file could not be copied to %s.', 'flash-album-gallery'), $uploads['path']));
393
+ }
394
 
395
  // Set correct file permissions
396
  $stat = stat( dirname( $new_file ));
441
  $data = wp_generate_attachment_metadata( $id, $new_file );
442
  wp_update_attachment_metadata( $id, $data );
443
  if( !$match && isset($_POST['delete_files']) ) {
444
+ @unlink($file);
445
  }
446
  }
447
 
459
  public static function scandir($dirname = '.', $ext = array()) {
460
  // thx to php.net :-)
461
  if(empty($ext))
462
+ $ext = array('jpeg', 'jpg', 'png', 'gif');
463
+ $files = array();
464
+ if($handle = opendir($dirname)) {
465
+ while(false !== ($file = readdir($handle)))
466
+ for($i=0;$i<sizeof($ext);$i++)
467
+ if(stristr($file, '.' . $ext[$i]))
468
+ $files[] = utf8_encode($file);
469
+ closedir($handle);
470
+ }
471
  sort($files);
472
+ return ($files);
473
+ }
474
+
475
  /**
476
  * flagAdmin::createThumbnail() - function to create or recreate a thumbnail
477
+ *
478
  * @param object | int $image contain all information about the image or the id
479
  * @return string result code
480
  */
481
  public static function create_thumbnail($image) {
482
+
483
  global $flag;
484
 
485
  if ( is_numeric($image) )
486
  $image = flagdb::find_image( $image );
487
 
488
  if ( !is_object($image) )
489
+ return __('Object didn\'t contain correct data','flash-album-gallery');
490
 
491
  $dest_path = dirname($image->webimagePath);
492
  if(!is_dir($dest_path)){
496
 
497
  if(! class_exists('flag_Thumbnail'))
498
  require_once( flagGallery::graphic_library() );
499
+
500
  // check for existing thumbnail
501
  if (file_exists($image->thumbPath))
502
  if (!is_writable($image->thumbPath))
503
+ return $image->filename . __(' is not writeable ','flash-album-gallery');
504
 
505
  $thumb = new flag_Thumbnail($image->imagePath, TRUE);
506
  $img_size = @getimagesize ( $image->imagePath );
507
 
508
  // skip if file is not there
509
  if (!$thumb->error) {
510
+ $thumb->resize($flag->options['thumbWidth'],$flag->options['thumbHeight']);
511
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
512
  // save the new thumbnail
513
  $thumb->save($image->thumbPath, $flag->options['thumbQuality']);
514
  flagAdmin::chmod ($image->thumbPath);
516
  //read the new sizes
517
  $new_size = @getimagesize ( $image->thumbPath );
518
  $size['width'] = $new_size[0];
519
+ $size['height'] = $new_size[1];
520
+
521
  // add them to the database
522
  flagdb::update_image_meta($image->pid, array( 'thumbnail' => $size) );
523
  }
524
+
525
  $thumb->destruct();
526
+
527
  if ( !empty($thumb->errmsg) )
528
  return $image->filename . ' (Error : '.$thumb->errmsg .')';
529
 
532
  flagAdmin::webview_image($image);
533
 
534
  // success
535
+ return '1';
536
  }
537
+
538
  /**
539
  * flagAdmin::resize_image() - create a new image, based on the height /width
540
+ *
541
  * @class flagAdmin
542
  * @param object | int $image contain all information about the image or the id
543
+ * @param integer $width optional
544
  * @param integer $height optional
545
  * @return string result code
546
  */
547
  public static function resize_image($image, $width = 0, $height = 0) {
548
+
549
  global $flag;
550
+
551
  if(! class_exists('flag_Thumbnail'))
552
  require_once( flagGallery::graphic_library() );
553
 
554
  if ( is_numeric($image) )
555
  $image = flagdb::find_image( $image );
556
+
557
+ if ( !is_object($image) )
558
+ return __('Object didn\'t contain correct data','flash-album-gallery');
559
 
560
  // before we start we import the meta data to database (required for uploads before V0.40)
561
  flagAdmin::maybe_import_meta( $image->pid );
563
  // if no parameter is set, take global settings
564
  $width = ($width == 0) ? $flag->options['imgWidth'] : $width;
565
  $height = ($height == 0) ? $flag->options['imgHeight'] : $height;
566
+
567
  if (!is_writable($image->imagePath))
568
+ return ' <strong>' . $image->filename . __(' is not writeable','flash-album-gallery') . '</strong>';
569
+
570
  $file = new flag_Thumbnail($image->imagePath, TRUE);
571
 
572
  // skip if file is not there
588
  return '1';
589
  }
590
 
591
+ /**
592
+ * flagAdmin::webview_image() - create a new image, based on the height /width
593
+ *
594
+ * @class flagAdmin
595
+ *
596
+ * @param object | int $image contain all information about the image or the id
597
+ * @param bool $return_size
598
+ *
599
+ * @return string result code
600
+ */
601
+ public static function webview_image($image, $return_size = false) {
602
 
603
  global $flag;
604
 
606
  $image = flagdb::find_image( $image );
607
 
608
  if ( !is_object($image) )
609
+ return __('Object didn\'t contain correct data','flash-album-gallery');
610
 
611
  $img_size = @getimagesize ( $image->imagePath );
612
+ $webviewsize = '0';
613
+ $dest_path = dirname($image->webimagePath);
614
  if(flagGallery::create_webview_folder(dirname($image->imagePath))){
615
  if (! is_writable( $dest_path ) ) {
616
  @chmod( $dest_path, 0755 );
617
  }
618
 
619
  if (file_exists($image->webimagePath)){
620
+ $webviewsize = @getimagesize ( $image->webimagePath );
621
+ flagdb::update_image_meta($image->pid, array( 'webview' => $webviewsize) );
622
+ if($return_size){
623
+ return $webviewsize;
624
+ } else {
625
+ return '1';
626
+ }
627
  }
628
 
629
  $imgquality = $flag->options['imgQuality'];
630
+ $max_width = ($img_size[0] < 2000)? $img_size[0] : 2000;
631
+ $max_height = ($img_size[1] < 2000)? $img_size[1] : 2000;
632
  if( function_exists('wp_get_image_editor') ) {
633
  $editor = wp_get_image_editor( $image->imagePath );
634
+ if ( ! is_wp_error( $editor ) ) {
635
+ $editor->set_quality( $imgquality );
636
+ $editor->resize( $max_width, $max_height, 0 );
637
+ $editor->save( $image->webimagePath );
638
+ if(@filesize($image->webimagePath) > @filesize($image->imagePath)) {
639
+ @copy($image->imagePath, $image->webimagePath);
640
+ }
641
+ $webviewsize = @getimagesize ( $image->webimagePath );
642
+ flagdb::update_image_meta($image->pid, array( 'webview' => $webviewsize) );
643
+
644
+ do_action('flag_image_optimized', $image);
645
+ }
646
  }
647
  }
648
 
649
+ if($return_size){
650
+ return $webviewsize;
651
+ } else {
652
+ return '1';
653
+ }
654
  }
655
 
656
  /**
664
  */
665
  public static function add_Images($galleryID, $imageslist, $name2alt = false) {
666
  global $wpdb;
667
+
668
  $alttext = '';
669
  $image_ids = array();
670
+
671
  if ( is_array($imageslist) ) {
672
  foreach($imageslist as $picture) {
673
  if($name2alt) {
675
  $path_parts = pathinfo( $picture );
676
  $alttext = ( !isset($path_parts['filename']) ) ? substr($path_parts['basename'], 0,strpos($path_parts['basename'], '.')) : $path_parts['filename'];
677
  }
678
+ // save it to the database
679
  $result = $wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->flagpictures (galleryid, filename, alttext, exclude) VALUES (%s, %s, %s, 0)", $galleryID, $picture, $alttext) );
680
  // and give me the new id
681
  $pic_id = (int) $wpdb->insert_id;
682
+ if ($result)
683
  $image_ids[] = $pic_id;
684
 
685
  // add the metadata
688
  // action hook for post process after the image is added to the database
689
  $image = array( 'id' => $pic_id, 'filename' => $picture, 'galleryID' => $galleryID);
690
  do_action('flag_added_new_image', $image);
691
+
692
+ }
693
  } // is_array
694
+
695
  return $image_ids;
696
+
697
  }
698
 
699
  /**
700
  * Import some metadata into the database (if avialable)
701
+ *
702
  * @class flagAdmin
703
  * @param array|int $imagesIds
704
  * @return bool
705
  */
706
  public static function import_MetaData($imagesIds) {
707
+
708
  global $wpdb;
709
+
710
  require_once(FLAG_ABSPATH . 'lib/image.php');
711
+
712
  if (!is_array($imagesIds))
713
  $imagesIds = array($imagesIds);
714
+
715
  foreach($imagesIds as $imageID) {
716
  $image = flagdb::find_image($imageID);
717
  if (!$image->error) {
718
 
719
  $meta = flagAdmin::get_MetaData($image->pid);
720
+
721
  // get the title
722
  $alttext = empty( $meta['title'] ) ? $image->alttext : $meta['title'];
723
  // get the caption / description field
727
  // update database
728
  $result = $wpdb->query( $wpdb->prepare("UPDATE $wpdb->flagpictures SET alttext = %s, description = %s, imagedate = %s WHERE pid = %d", $alttext, $description, $timestamp, $image->pid) );
729
  if ($result === false)
730
+ return ' <strong>' . $image->filename . ' ' . __('(Error : Couldn\'t not update data base)', 'flash-album-gallery') . '</strong>';
731
+
732
  //this flag will inform us the import is already one time performed
733
+ $meta['common']['saved'] = true;
734
  $result = flagdb::update_image_meta($image->pid, $meta['common']);
735
+
736
  if ($result === false)
737
+ return ' <strong>' . $image->filename . ' ' . __('(Error : Couldn\'t not update meta data)', 'flash-album-gallery') . '</strong>';
738
  } else
739
+ return ' <strong>' . $image->filename . ' ' . __('(Error : Couldn\'t not find image)', 'flash-album-gallery') . '</strong>';// error check
740
  }
741
+
742
  return '1';
743
+
744
  }
745
 
746
  /**
747
  * Copy some metadata into the image description (if avialable)
748
+ *
749
  * @class flagAdmin
750
  * @param array|int $imagesIds
751
  * @return bool
752
  */
753
  public static function copy_MetaData($imagesIds) {
754
+
755
  global $wpdb;
756
 
757
  /** @var $meta */
760
 
761
  if (!is_array($imagesIds))
762
  $imagesIds = array($imagesIds);
763
+
764
  foreach($imagesIds as $imageID) {
765
+
766
  $image = flagdb::find_image($imageID);
767
  if (!$image->error) {
768
  /** @var $makedescription
769
  * @var $timestamp */
770
  require_once(FLAG_ABSPATH . 'admin/grab_meta.php');
771
+
772
  // get the title
773
  $alttext = empty( $alttext ) ? $image->alttext : $meta['title'];
774
  if($alttext) $alttext = '<font size="16"><b>'.$alttext."</b></font>\n";
780
  // update database
781
  $result = $wpdb->query( $wpdb->prepare("UPDATE $wpdb->flagpictures SET alttext = %s, description = %s, imagedate = %s WHERE pid = %d", '', $makedescription, $timestamp, $image->pid) );
782
  if ($result === false)
783
+ return ' <strong>' . $image->filename . ' ' . __('(Error : Couldn\'t not update data base)', 'flash-album-gallery') . '</strong>';
784
+
785
  } else
786
+ return ' <strong>' . $image->filename . ' ' . __('(Error : Couldn\'t not find image)', 'flash-album-gallery') . '</strong>';// error check
787
  }
788
+
789
  return '1';
790
+
791
  }
792
 
793
  /**
799
  * @return array metadata
800
  */
801
  public static function get_MetaData($id) {
802
+
803
  require_once(FLAG_ABSPATH . 'lib/meta.php');
804
+
805
  $meta = array();
806
 
807
  $pdata = new flagMeta( $id );
808
 
809
+ $meta['title'] = trim ( $pdata->get_META('title') );
810
+ $meta['caption'] = trim ( $pdata->get_META('caption') );
811
  $meta['keywords'] = trim ( $pdata->get_META('keywords') );
812
  $meta['timestamp'] = $pdata->get_date_time();
813
  // this contain other useful meta information
814
  $meta['common'] = $pdata->get_common_meta();
815
+
816
  return $meta;
817
+
818
  }
819
 
820
  /**
821
  * Maybe import some meta data to the database. The functions checks the flag 'saved'
822
  * and if based on compat reason (pre V0.40) we save then some meta datas to the database
823
+ *
824
  * @param int $id
825
  * @return mixed result
826
  */
827
  public static function maybe_import_meta( $id ) {
828
+
829
  require_once(FLAG_ABSPATH . 'lib/meta.php');
830
 
831
  $meta_obj = new flagMeta( $id );
832
+
833
  if ( $meta_obj->image->meta_data['saved'] != true ) {
834
  $common = $meta_obj->get_common_meta();
835
  //this flag will inform us that the import is already one time performed
837
  $result = flagdb::update_image_meta($id, $common);
838
  } else
839
  return false;
840
+
841
+ return $result;
842
 
843
  }
844
 
845
  /**
846
  * flagAdmin::getOnlyImages()
847
+ *
848
  * @class flagAdmin
849
  * @param mixed $p_event
850
  * @param mixed $p_header
851
  * @return bool
852
  */
853
  public static function getOnlyImages($p_event, $p_header) {
854
+
855
  $info = pathinfo($p_header['filename']);
856
  // check for extension
857
+ $ext = array('jpeg', 'jpg', 'png', 'gif');
858
  if ( in_array( strtolower($info['extension']), $ext) ) {
859
  // For MAC skip the ".image" files
860
+ if ($info['basename']{0} == '.' )
861
  return 0;
862
+ else
863
  return 1;
864
  }
865
  // ----- all other files are skipped
870
 
871
  /**
872
  * Function for uploading of images via the upload form
873
+ *
874
  * @class flagAdmin
875
  * @return void
876
  */
877
  public static function upload_images() {
878
+
879
  global $wpdb;
880
+
881
  // WPMU action
882
  if (flagAdmin::check_quota())
883
  return;
889
  $galleryID = (int) $_POST['galleryselect'];
890
 
891
  if ($galleryID == 0) {
892
+ flagGallery::show_error(__('No gallery selected !','flash-album-gallery'));
893
+ return;
894
  }
895
 
896
+ // get the path to the gallery
897
  $gallery = flagdb::find_gallery($galleryID);
898
 
899
  if ( empty($gallery->path) ){
900
+ flagGallery::show_error(__('Failure in database, no gallery path set !','flash-album-gallery'));
901
  return;
902
+ }
903
+
904
  // read list of images
905
  $dirlist = flagAdmin::scandir(WINABSPATH.$gallery->path);
906
+
907
  $imagefiles = $_FILES['imagefiles'];
908
+
909
  if (is_array($imagefiles)) {
910
  foreach ($imagefiles['name'] as $key => $value) {
911
 
912
  // look only for uploded files
913
  if ($imagefiles['error'][$key] == 0) {
914
+
915
  $temp_file = $imagefiles['tmp_name'][$key];
916
+
917
  //clean filename and extract extension
918
  $filepart = flagGallery::fileinfo( $imagefiles['name'][$key] );
919
  $filename = $filepart['basename'];
920
+
921
  // check for allowed extension and if it's an image file
922
  $ext = array('jpg', 'jpeg', 'png', 'gif');
923
  if ( !in_array(strtolower($filepart['extension']), $ext) || !@getimagesize($temp_file) ){
924
+ flagGallery::show_error('<strong>' . $imagefiles['name'][$key] . ' </strong>' . __('is no valid image file!','flash-album-gallery'));
925
  continue;
926
  }
927
+
928
  // check if this filename already exist in the folder
929
  $i = 0;
930
  while ( in_array( $filename, $dirlist ) ) {
931
  $filename = $filepart['filename'] . '_' . $i++ . '.' .$filepart['extension'];
932
  }
933
+
934
  $dest_file = $gallery->abspath . '/' . $filename;
935
+
936
  //check for folder permission
937
  if ( !is_writeable($gallery->abspath) ) {
938
+ $message = sprintf(__('Unable to write to directory %s. Is this directory writable by the server?', 'flash-album-gallery'), $gallery->abspath);
939
  flagGallery::show_error($message);
940
+ return;
941
  }
942
+
943
  // save temp file to gallery
944
  if ( !@move_uploaded_file($temp_file, $dest_file) ){
945
  if( !file_exists($dest_file)){
946
+ flagGallery::show_error(__('Error, the file could not moved to : ','flash-album-gallery') . $dest_file);
947
  flagAdmin::check_safemode( $gallery->abspath );
948
  continue;
949
  }
950
+ }
951
  if ( !flagAdmin::chmod($dest_file) ) {
952
+ flagGallery::show_error(__('Error, the file permissions could not set','flash-album-gallery'));
953
  continue;
954
  }
955
+
956
  // add to imagelist & dirlist
957
  $imageslist[] = $filename;
958
  $dirlist[] = $filename;
959
  }
960
  }
961
  }
962
+
963
  if (count($imageslist) > 0) {
964
+
965
+ // add images to database
966
  $image_ids = flagAdmin::add_Images($galleryID, $imageslist);
967
 
968
  //create thumbnails
969
+ flagAdmin::do_ajax_operation( 'create_thumbnail' , $image_ids, __('Create new thumbnails','flash-album-gallery') );
970
  //add the preview image if needed
971
  flagAdmin::set_gallery_preview ( $galleryID );
972
+
973
+ flagGallery::show_message( count($image_ids) . __(' Image(s) successfully added','flash-album-gallery'));
974
  }
975
+
976
  return;
977
 
978
  } // end function
979
+
980
  /**
981
  * Upload function will be called via the Flash uploader
982
+ *
983
  * @class flagAdmin
984
  * @param integer $galleryID
985
  * @return string $result
990
 
991
  if ($galleryID == 0) {
992
  //@unlink($temp_file);
993
+ return __('No gallery selected!','flash-album-gallery');
994
  }
995
 
996
  // WPMU action
1008
  $filename = $filepart['basename'];
1009
 
1010
  // check for allowed extension
1011
+ $ext = array('jpeg', 'jpg', 'png', 'gif');
1012
  if (!in_array(strtolower($filepart['extension']), $ext)){
1013
  if(!@getimagesize($temp_file))
1014
+ return $filename . ' '. __('is no valid image file!','flash-album-gallery');
1015
  }
1016
 
1017
  // get the path to the gallery
1018
  $gallerypath = $wpdb->get_var($wpdb->prepare("SELECT path FROM {$wpdb->flaggallery} WHERE gid = %d ", $galleryID));
1019
  if (!$gallerypath){
1020
  @unlink($temp_file);
1021
+ return __('Failure in database, no gallery path set !','flash-album-gallery');
1022
+ }
1023
 
1024
  // read list of images
1025
  $imageslist = flagAdmin::scandir( WINABSPATH.$gallerypath );
1029
  while (in_array($filename,$imageslist)) {
1030
  $filename = sanitize_title($filepart['filename']) . '_' . $i++ . '.' . $filepart['extension'];
1031
  }
1032
+
1033
  $dest_file = WINABSPATH . $gallerypath . '/' . $filename;
1034
+
1035
  // save temp file to gallery
1036
  if ( !@move_uploaded_file($temp_file, $dest_file) ){
1037
  if( !file_exists($dest_file)){
1038
  flagAdmin::check_safemode(WINABSPATH.$gallerypath);
1039
+ return __('Error, the file could not moved to : ','flash-album-gallery').$dest_file;
1040
  }
1041
  }
1042
+
1043
  if ( !flagAdmin::chmod($dest_file) )
1044
+ return __('Error, the file permissions could not set','flash-album-gallery');
1045
+
1046
+ require_once(ABSPATH . 'wp-admin/includes/image.php');
1047
+ $angle = 0;
1048
+ $image_meta = wp_read_image_metadata($dest_file);
1049
+ if(!empty($image_meta['orientation'])){
1050
+ switch($image_meta['orientation']){
1051
+ case 3:
1052
+ $angle = 180;
1053
+ break;
1054
+ case 6:
1055
+ $angle = 270;
1056
+ break;
1057
+ case 8:
1058
+ $angle = 90;
1059
+ break;
1060
+ }
1061
+ }
1062
+ if($angle){
1063
+ $editor = wp_get_image_editor($dest_file);
1064
+ if(!is_wp_error($editor)){
1065
+ $editor->rotate($angle);
1066
+ $editor->set_quality(90);
1067
+ $editor->save($dest_file);
1068
+ }
1069
+ }
1070
 
1071
  // add images to database
1072
  $image_ids = flagAdmin::add_Images($galleryID, array($filename));
1074
  //create thumbnails
1075
 
1076
  //save the thumb size values
1077
+ $flag->options['thumbWidth'] = intval($_POST['thumbw'])? intval($_POST['thumbw']) : 300;
1078
+ $flag->options['thumbHeight'] = intval($_POST['thumbh'])? intval($_POST['thumbh']) : 300;
 
1079
  update_option('flag_options', $flag->options);
1080
 
1081
  foreach($image_ids as $picture){
1096
  * @param $error_code
1097
  * @return string $result
1098
  */
1099
+ public static function file_upload_error_message($error_code) {
1100
  switch ($error_code) {
1101
  case UPLOAD_ERR_INI_SIZE:
1102
+ return __('The uploaded file exceeds the upload_max_filesize directive in php.ini','flash-album-gallery');
1103
  case UPLOAD_ERR_FORM_SIZE:
1104
+ return __('The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form','flash-album-gallery');
1105
  case UPLOAD_ERR_PARTIAL:
1106
+ return __('The uploaded file was only partially uploaded','flash-album-gallery');
1107
  case UPLOAD_ERR_NO_FILE:
1108
+ return __('No file was uploaded','flash-album-gallery');
1109
  case UPLOAD_ERR_NO_TMP_DIR:
1110
+ return __('Missing a temporary folder','flash-album-gallery');
1111
  case UPLOAD_ERR_CANT_WRITE:
1112
+ return __('Failed to write file to disk','flash-album-gallery');
1113
  case UPLOAD_ERR_EXTENSION:
1114
+ return __('File upload stopped by extension','flash-album-gallery');
1115
  default:
1116
+ return __('Unknown upload error','flash-album-gallery');
1117
  }
1118
  }
1119
 
1120
  /**
1121
  * Check the Quota under WPMU. Only needed for this case
1122
+ *
1123
  * @class flagAdmin
1124
  * @return bool $result
1125
  */
1126
+ public static function check_quota() {
1127
 
1128
  if ( (IS_WPMU) && flagGallery::flag_wpmu_enable_function('wpmuQuotaCheck'))
1129
  if( $error = upload_is_user_over_quota( false ) ) {
1130
+ flagGallery::show_error( __( 'Sorry, you have used your space allocation. Please delete some files to upload more files.','flash-album-gallery' ) );
1131
  return true;
1132
  }
1133
  return false;
1134
  }
1135
+
1136
  /**
1137
  * Set correct file permissions (taken from wp core)
1138
+ *
1139
  * @class flagAdmin
1140
  * @param string $filename
1141
  * @return bool $result
1147
  $perms = $perms & 0000666;
1148
  if ( @chmod($filename, $perms) )
1149
  return true;
1150
+
1151
  return false;
1152
  }
1153
+
1154
  /**
1155
  * Check UID in folder and Script
1156
  * Read http://www.php.net/manual/en/features.safe-mode.php to understand safe_mode
1157
+ *
1158
  * @class flagAdmin
1159
  * @param string $foldername
1160
  * @return bool $result
1161
  */
1162
  public static function check_safemode($foldername) {
1163
 
1164
+ if ( FLAG_SAFE_MODE ) {
1165
+
1166
+ //$script_uid = ( ini_get('safe_mode_gid') ) ? getmygid() : getmyuid();
1167
+ $script_uid = getmyuid();
1168
  $folder_uid = fileowner($foldername);
1169
 
1170
  if ($script_uid != $folder_uid) {
1171
+ $message = sprintf(__('SAFE MODE Restriction in effect! You need to create the folder <strong>%s</strong> manually','flash-album-gallery'), $foldername);
1172
+ $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 );
1173
  flagGallery::show_error($message);
1174
  return false;
1175
  }
1176
  }
1177
+
1178
  return true;
1179
  }
1180
+
1181
  /**
1182
  * Capability check. Check is the ID fit's to the user_ID
1183
+ *
1184
  * @class flagAdmin
1185
  * @param int $check_ID is the user_id
1186
  * @return bool $result
1188
  public static function can_manage_this_gallery($check_ID) {
1189
 
1190
  global $user_ID, $wp_roles;
1191
+
1192
  if ( !current_user_can('FlAG Manage others gallery') ) {
1193
  // get the current user ID
1194
+ wp_get_current_user();
1195
+
1196
  if ( $user_ID != $check_ID)
1197
  return false;
1198
  }
1199
  return true;
1200
  }
1201
+
1202
  /**
1203
  * Move images from one folder to another
1204
  *
1213
 
1214
  if (!is_array($pic_ids))
1215
  $pic_ids = array($pic_ids);
1216
+
1217
  // Get destination gallery
1218
  $destination = flagdb::find_gallery( $dest_gid );
1219
  $dest_abspath = WINABSPATH . $destination->path;
1220
+
1221
  if ( $destination == null ) {
1222
+ flagGallery::show_error(__('The destination gallery does not exist','flash-album-gallery'));
1223
  return;
1224
  }
1225
+
1226
  // Check for folder permission
1227
  if ( !is_writeable( $dest_abspath ) ) {
1228
+ $message = sprintf(__('Unable to write to directory %s. Is this directory writable by the server?', 'flash-album-gallery'), $dest_abspath );
1229
  flagGallery::show_error($message);
1230
+ return;
1231
  }
1232
+
1233
  // Get pictures
1234
  $images = flagdb::find_images_in_list($pic_ids);
1235
 
1236
+ foreach ($images as $image) {
1237
+
1238
  $i = 0;
1239
  $tmp_prefix = '';
1240
+
1241
  $destination_file_name = $image->filename;
1242
  // check if the filename already exist, then we add a copy_ prefix
1243
  while (file_exists( $dest_abspath . '/' . $destination_file_name)) {
1244
  $tmp_prefix = 'copy_' . ($i++) . '_';
1245
  $destination_file_name = $tmp_prefix . $image->filename;
1246
  }
1247
+
1248
  $destination_path = $dest_abspath . '/' . $destination_file_name;
1249
  $destination_thumbnail = $dest_abspath . '/thumbs/thumbs_' . $destination_file_name;
1250
 
1251
  // Move files
1252
  if ( !@rename($image->imagePath, $destination_path) ) {
1253
+ $errors .= sprintf(__('Failed to move image %1$s to %2$s','flash-album-gallery'),
1254
  '<strong>' . $image->filename . '</strong>', $destination_path) . '<br />';
1255
+ continue;
1256
  }
1257
+
1258
  // Move the thumbnail, if possible
1259
  @rename($image->thumbPath, $destination_thumbnail);
1260
+
1261
  // Change the gallery id in the database , maybe the filename
1262
  if ( flagdb::update_image($image->pid, $dest_gid, $destination_file_name) )
1263
  $count++;
1268
  flagGallery::show_error($errors);
1269
 
1270
  $link = '<a href="' . admin_url() . 'admin.php?page=flag-manage-gallery&mode=edit&gid=' . $destination->gid . '" >' . $destination->title . '</a>';
1271
+ $messages = sprintf(__('Moved %1$s picture(s) to gallery : %2$s .','flash-album-gallery'), $count, $link);
1272
  flagGallery::show_message($messages);
1273
 
1274
  return;
1275
  }
1276
+
1277
  /**
1278
  * Copy images to another gallery
1279
+ *
1280
  * @class flagAdmin
1281
  * @param array|int $pic_ids ID's of the images
1282
  * @param int $dest_gid destination gallery
1283
  * @return void
1284
  */
1285
  public static function copy_images($pic_ids, $dest_gid) {
1286
+
1287
  $errors = $messages = '';
1288
+
1289
  if (!is_array($pic_ids))
1290
  $pic_ids = array($pic_ids);
1291
+
1292
  // Get destination gallery
1293
  $destination = flagdb::find_gallery( $dest_gid );
1294
  if ( $destination == null ) {
1295
+ flagGallery::show_error(__('The destination gallery does not exist','flash-album-gallery'));
1296
  return;
1297
  }
1298
+
1299
  // Check for folder permission
1300
  if (!is_writeable(WINABSPATH.$destination->path)) {
1301
+ $message = sprintf(__('Unable to write to directory %s. Is this directory writable by the server?', 'flash-album-gallery'), WINABSPATH.$destination->path);
1302
  flagGallery::show_error($message);
1303
+ return;
1304
  }
1305
+
1306
  // Get pictures
1307
  $images = flagdb::find_images_in_list($pic_ids);
1308
  $destination_path = WINABSPATH . $destination->path;
1309
+
1310
+ foreach ($images as $image) {
1311
  // WPMU action
1312
  if ( flagAdmin::check_quota() )
1313
  return;
1314
+
1315
  $i = 0;
1316
+ $tmp_prefix = '';
1317
  $destination_file_name = $image->filename;
1318
  while (file_exists($destination_path . '/' . $destination_file_name)) {
1319
  $tmp_prefix = 'copy_' . ($i++) . '_';
1320
  $destination_file_name = $tmp_prefix . $image->filename;
1321
  }
1322
+
1323
  $destination_file_path = $destination_path . '/' . $destination_file_name;
1324
  $destination_thumb_file_path = $destination_path . '/' . $image->thumbFolder . $image->thumbPrefix . $destination_file_name;
1325
 
1326
  // Copy files
1327
  if ( !@copy($image->imagePath, $destination_file_path) ) {
1328
+ $errors .= sprintf(__('Failed to copy image %1$s to %2$s','flash-album-gallery'),
1329
  $image->filename, $destination_file_path) . '<br />';
1330
+ continue;
1331
  }
1332
+
1333
  // Copy the thumbnail if possible
1334
  @copy($image->thumbPath, $destination_thumb_file_path);
1335
+
1336
  // Create new database entry for the image
1337
  $new_pid = flagdb::insert_image( $destination->gid, $destination_file_name, $image->alttext, $image->description, $image->exclude);
1338
 
1339
+ if (!isset($new_pid)) {
1340
+ $errors .= sprintf(__('Failed to copy database row for picture %s','flash-album-gallery'), $image->pid) . '<br />';
1341
+ continue;
1342
  }
1343
+
1344
  if ( $tmp_prefix != '' ) {
1345
+ $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'),
1346
  $image->pid, $image->filename, $new_pid, $destination_file_name) . '<br />';
1347
  } else {
1348
+ $messages .= sprintf(__('Image %1$s (%2$s) copied as image %3$s (%4$s)','flash-album-gallery'),
1349
  $image->pid, $image->filename, $new_pid, $destination_file_name) . '<br />';
1350
  }
1351
 
1352
  }
1353
+
1354
  // Finish by showing errors or success
1355
  if ( $errors == '' ) {
1356
  $link = '<a href="' . admin_url() . 'admin.php?page=flag-manage-gallery&mode=edit&gid=' . $destination->gid . '" >' . $destination->title . '</a>';
1357
+ $messages .= '<hr />' . sprintf(__('Copied %1$s picture(s) to gallery: %2$s .','flash-album-gallery'), count($images), $link);
1358
+ }
1359
 
1360
  if ( $messages != '' )
1361
  flagGallery::show_message($messages);
1365
 
1366
  return;
1367
  }
1368
+
1369
  /**
1370
  * Initate the Ajax operation
1371
+ *
1372
+ * @class flagAdmin
1373
  * @param string $operation name of the function which should be executed
1374
  * @param array $image_array
1375
  * @param string $title name of the operation
1376
  * @return string the javascript output
1377
  */
1378
  public static function do_ajax_operation( $operation, $image_array, $title = '' ) {
1379
+
1380
  if ( !is_array($image_array) || empty($image_array) )
1381
  return;
1382
 
1383
  $js_array = implode('","', $image_array);
1384
+
1385
  // send out some JavaScript, which initate the ajax operation
1386
  ?>
1387
  <script type="text/javascript">
1390
 
1391
  flagAjaxOptions = {
1392
  operation: "<?php echo $operation; ?>",
1393
+ ids: Images,
1394
  header: "<?php echo $title; ?>",
1395
  maxStep: Images.length
1396
  };
1397
+
1398
+ jQuery(document).ready( function(){
1399
  flagProgressBar.init( flagAjaxOptions );
1400
  flagAjax.init( flagAjaxOptions );
1401
  } );
1402
  </script>
1403
+
1404
  <div id="progressbar_container" class="wrap"></div>
1405
+
1406
+ <?php
1407
  }
1408
+
1409
  /**
1410
  * flagAdmin::set_gallery_preview() - define a preview pic after the first upload, can be changed in the gallery settings
1411
+ *
1412
  * @class flagAdmin
1413
  * @param int $galleryID
1414
  * @return void
1418
 
1419
  $galleryID = intval($galleryID);
1420
  $gallery = flagdb::find_gallery( $galleryID );
1421
+
1422
  // in the case no preview image is setup, we do this now
1423
  if ($gallery->previewpic == 0) {
1424
  $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));
1427
  wp_cache_delete($galleryID, 'flag_gallery');
1428
  }
1429
  }
1430
+
1431
  return;
1432
  }
1433
 
1434
  /**
1435
  * Return a JSON coded array of Image ids for a requested gallery
1436
+ *
1437
  * @param int $galleryID
1438
  * @return array (JSON)
1439
  */
1440
  public static function get_image_ids( $galleryID ) {
1441
+
1442
  if ( !function_exists('json_encode') )
1443
  return(-2);
1444
+
1445
  $gallery = flagdb::get_ids_from_gallery($galleryID, 'pid', 'ASC', false);
1446
 
1447
  header('Content-Type: text/plain; charset=' . get_option('blog_charset'), true);
1448
  $output = json_encode($gallery);
1449
+
1450
  return $output;
1451
  }
1452
+
1453
  } // END class flagAdmin
1454
  }
admin/get_skin.php CHANGED
@@ -40,12 +40,13 @@ function get_skin_data( $skin_file, $type='' ) {
40
  if($name) {
41
  preg_match( '|Skin URI:(.*)$|mi', $skin_data, $uri );
42
  preg_match( '|uid:(.*)|i', $skin_data, $uid );
 
43
  preg_match( '|Version:(.*)|i', $skin_data, $version );
44
  preg_match( '|Description:(.*)$|mi', $skin_data, $description );
45
  preg_match( '|Author:(.*)$|mi', $skin_data, $author_name );
46
  preg_match( '|Author URI:(.*)$|mi', $skin_data, $author_uri );
47
 
48
- foreach ( array( 'name', 'uri', 'version', 'uid', 'description', 'author_name', 'author_uri' ) as $field ) {
49
  if ( !empty( ${$field} ) )
50
  ${$field} = trim(${$field}[1]);
51
  else
@@ -53,7 +54,7 @@ function get_skin_data( $skin_file, $type='' ) {
53
  }
54
 
55
  $skin_data = array(
56
- 'Name' => $name, 'Title' => $name, 'SkinURI' => $uri, 'Description' => $description,
57
  'Author' => $author_name, 'AuthorURI' => $author_uri, 'Version' => $version, 'uid' => $uid
58
  );
59
  return $skin_data;
40
  if($name) {
41
  preg_match( '|Skin URI:(.*)$|mi', $skin_data, $uri );
42
  preg_match( '|uid:(.*)|i', $skin_data, $uid );
43
+ preg_match( '|status:(.*)|i', $skin_data, $status );
44
  preg_match( '|Version:(.*)|i', $skin_data, $version );
45
  preg_match( '|Description:(.*)$|mi', $skin_data, $description );
46
  preg_match( '|Author:(.*)$|mi', $skin_data, $author_name );
47
  preg_match( '|Author URI:(.*)$|mi', $skin_data, $author_uri );
48
 
49
+ foreach ( array( 'name', 'uri', 'version', 'uid', 'status', 'description', 'author_name', 'author_uri' ) as $field ) {
50
  if ( !empty( ${$field} ) )
51
  ${$field} = trim(${$field}[1]);
52
  else
54
  }
55
 
56
  $skin_data = array(
57
+ 'Name' => $name, 'Title' => $name, 'SkinURI' => $uri, 'Status' => $status, 'Description' => $description,
58
  'Author' => $author_name, 'AuthorURI' => $author_uri, 'Version' => $version, 'uid' => $uid
59
  );
60
  return $skin_data;
admin/grab_meta.php CHANGED
@@ -10,29 +10,29 @@ $alttext = trim ( $meta->get_META('title') );
10
  $description = trim ( $meta->get_META('caption') );
11
  $timestamp = $meta->get_date_time();
12
 
13
- $makedescription = '<b>'.__('Meta Data','flag')."</b><br>";
14
  if ($dbdata) {
15
  foreach ($dbdata as $key => $value){
16
  if ( is_array($value) ) continue;
17
  $makedescription .= '<b>'.$meta->i8n_name($key)."</b> ".$value."<br>";
18
  }
19
  } else {
20
- $makedescription .= __('No meta data saved','flag')."<br>";
21
  }
22
  if ($exifdata) {
23
- $makedescription .= "\n<b>".__('EXIF Data','flag')."</b><br>";
24
  foreach ($exifdata as $key => $value){
25
  $makedescription .= '<b>'.$meta->i8n_name($key)."</b> ".$value."<br>";
26
  }
27
  }
28
  if ($iptcdata) {
29
- $makedescription .= "\n<b>".__('IPTC Data','flag')."</b><br>";
30
  foreach ($iptcdata as $key => $value){
31
  $makedescription .= '<b>'.$meta->i8n_name($key)."</b> ".$value."<br>";
32
  }
33
  }
34
  if ($xmpdata) {
35
- $makedescription .= "\n<b>".__('XMP Data','flag')."</b><br>";
36
  foreach ($xmpdata as $key => $value){
37
  $makedescription .= '<b>'.$meta->i8n_name($key)."</b> ".$value."<br>";
38
  }
10
  $description = trim ( $meta->get_META('caption') );
11
  $timestamp = $meta->get_date_time();
12
 
13
+ $makedescription = '<b>'.__('Meta Data','flash-album-gallery')."</b><br>";
14
  if ($dbdata) {
15
  foreach ($dbdata as $key => $value){
16
  if ( is_array($value) ) continue;
17
  $makedescription .= '<b>'.$meta->i8n_name($key)."</b> ".$value."<br>";
18
  }
19
  } else {
20
+ $makedescription .= __('No meta data saved','flash-album-gallery')."<br>";
21
  }
22
  if ($exifdata) {
23
+ $makedescription .= "\n<b>".__('EXIF Data','flash-album-gallery')."</b><br>";
24
  foreach ($exifdata as $key => $value){
25
  $makedescription .= '<b>'.$meta->i8n_name($key)."</b> ".$value."<br>";
26
  }
27
  }
28
  if ($iptcdata) {
29
+ $makedescription .= "\n<b>".__('IPTC Data','flash-album-gallery')."</b><br>";
30
  foreach ($iptcdata as $key => $value){
31
  $makedescription .= '<b>'.$meta->i8n_name($key)."</b> ".$value."<br>";
32
  }
33
  }
34
  if ($xmpdata) {
35
+ $makedescription .= "\n<b>".__('XMP Data','flash-album-gallery')."</b><br>";
36
  foreach ($xmpdata as $key => $value){
37
  $makedescription .= '<b>'.$meta->i8n_name($key)."</b> ".$value."<br>";
38
  }
admin/images/appstore_button.png CHANGED
Binary file
admin/images/like.png CHANGED
Binary file
admin/images/views.png CHANGED
Binary file
admin/jgallery.php DELETED
@@ -1,159 +0,0 @@
1
- <?php
2
- if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You are not allowed to call this page directly.'); }
3
-
4
- global $wpdb, $post;
5
- $xml = array();
6
- $flag_options = get_option ('flag_options');
7
- $siteurl = site_url();
8
- $c = array();
9
- $isCrawler = isset($_SERVER['HTTP_USER_AGENT'])? flagGetUserNow($_SERVER['HTTP_USER_AGENT']) : false;
10
- extract($altColors);
11
- $bg = ($wmode == 'window')? '#'.$Background : 'transparent';
12
- $xml['alt'] = '<style type="text/css" scoped="scoped">';
13
- if(!$isCrawler) {
14
- $xml['alt'] .= '@import url("'.plugins_url('/admin/css/flagallery_nocrawler.css', dirname(__FILE__)).'");';
15
- }
16
- $xml['alt'] .= '@import url("'.plugins_url('/admin/css/flagallery_noflash.css', dirname(__FILE__)).'");';
17
- if($isCrawler) {
18
- $xml['alt'] .= '.flag_alternate .flagCatMeta h4 { padding: 4px 10px; margin: 7px 0; border: none; font: 14px Tahoma; text-decoration: none; background:#292929 none; color: #ffffff; }';
19
- $xml['alt'] .= '.flag_alternate .flagCatMeta p { font-size: 12px; }';
20
- }
21
- if($BarsBG) {
22
- $bgBar = ($wmode == 'window')? '#'.$BarsBG : 'transparent';
23
- if(!$isCrawler){
24
- $xml['alt'] .= "#fancybox-title-over .title { color: #{$TitleColor}; }";
25
- $xml['alt'] .= "#fancybox-title-over .descr { color: #{$DescrColor}; }";
26
- $xml['alt'] .= ".flag_alternate .flagcatlinks { background-color: #{$BarsBG}; }";
27
- $xml['alt'] .= ".flag_alternate .flagcatlinks a.flagcat, span.flag_pic_counters { color: #{$CatColor}; background-color: #{$CatBGColor}; }";
28
- $xml['alt'] .= ".flag_alternate .flagcatlinks a.active, .flag_alternate .flagcatlinks a.flagcat:hover { color: #{$CatColorOver}; background-color: #{$CatBGColorOver}; }";
29
- }
30
- $xml['alt'] .= ".flag_alternate .flagcategory a.flag_pic_alt { background-color: #{$ThumbBG}; border: 2px solid #{$ThumbBG}; color: #{$ThumbBG}; }";
31
- $xml['alt'] .= ".flag_alternate .flagcategory a.flag_pic_alt:hover { background-color: #{$ThumbBG}; border: 2px solid #{$ThumbLoaderColor}; color: #{$ThumbLoaderColor}; }";
32
- $xml['alt'] .= ".flag_alternate .flagcategory a.flag_pic_alt.current, .flag_alternate .flagcategory a.flag_pic_alt.last { border-color: #{$ThumbLoaderColor}; }";
33
- }
34
- if($altColors['FullWindow'] && !$isCrawler){
35
- $xml['alt'] .= ".flagcatlinks a.backlink { color: #{$CatColor}; background-color: #{$CatBGColor}; }";
36
- }
37
- $xml['alt'] .= '</style>';
38
- if(!$isCrawler){
39
- if(!intval($flag_options['jAlterGalScript'])) {
40
- if(wp_style_is('fancybox', 'registered')){
41
- wp_print_styles('fancybox');
42
- } else{
43
- wp_print_styles('fancybox-1.3.4');
44
- }
45
- if(wp_script_is('fancybox', 'registered')){
46
- wp_print_scripts('fancybox');
47
- } else{
48
- wp_print_scripts('fancybox-1.3.4');
49
- }
50
- //$xml['alt'] .= '<style type="text/css" scoped="scoped">@import url("'.plugins_url('/flash-album-gallery/admin/js/jquery.fancybox-1.3.4.css').'");</style>';
51
- //$xml['alt'] .= "<script type='text/javascript' src='".plugins_url('/flash-album-gallery/admin/js/jquery.fancybox-1.3.4.pack.js')."'></script>";
52
- $xml['alt'] .= "<script type='text/javascript'>var ExtendVar='fancybox', hitajax = '".plugins_url('/lib/hitcounter.php', dirname(__FILE__))."';</script>";
53
- } else if(intval($flag_options['jAlterGalScript']) == 1) {
54
- wp_print_styles('photoswipe');
55
- wp_print_scripts('klass.photoswipe');
56
- wp_print_scripts('photoswipe');
57
- //$xml['alt'] .= "<style type='text/css'>@import url('".plugins_url('/admin/js/photoswipe/photoswipe.css', dirname(__FILE__))."');</style>";
58
- //$xml['alt'] .= "<script type='text/javascript' src='".plugins_url('/admin/js/photoswipe/klass.min.js', dirname(__FILE__))."'></script>";
59
- //$xml['alt'] .= "<script type='text/javascript' src='".plugins_url('/admin/js/photoswipe/code.photoswipe.jquery-3.0.5.min.js', dirname(__FILE__))."'></script>";
60
- $xml['alt'] .= "<script type='text/javascript'>var ExtendVar='photoswipe', hitajax = '".plugins_url('/lib/hitcounter.php', dirname(__FILE__))."';</script>";
61
- }
62
- }
63
-
64
- $xml['alt'] .= '<div id="'.$skinID.'_jq" class="flag_alternate noLightbox"><div class="flagcatlinks">';
65
- if($altColors['FullWindow'] && !$isCrawler){
66
- $flag_custom = get_post_custom($post->ID);
67
- $backlink = $flag_custom["mb_button_link"][0];
68
- if(!$backlink || $backlink == 'http://'){ $backlink = $_SERVER["HTTP_REFERER"]; }
69
- if($backlink){
70
- $xml['alt'] .= '<a id="backlink" class="backlink" href="'.$backlink.'">'.$flag_custom["mb_button"][0].'</a>';
71
- }
72
- }
73
- $xml['alt'] .= '</div>';
74
-
75
- $gID = explode( '_', $galleryID ); // get the gallery id
76
- if ( is_user_logged_in() ) $exclude_clause = '';
77
- else $exclude_clause = ' AND exclude<>1 ';
78
- $i = 0;
79
- if(isset($flag_options['disableViews']) && !empty($flag_options['disableViews'])){
80
- $disableViews = 1;
81
- } else { $disableViews = 0; }
82
- if((get_option( 'flag_db_version' ) < 2.75)){
83
- $select_columns = 'pid, galleryid, filename, description, alttext, imagedate, sortorder, hitcounter, total_value, total_votes, meta_data';
84
- $exclude_clause = '';
85
- } else {
86
- $select_columns = 'pid, galleryid, filename, description, alttext, link, imagedate, sortorder, hitcounter, total_value, total_votes, meta_data';
87
- }
88
-
89
- foreach ( $gID as $galID ) {
90
- $galID = (int) $galID;
91
- $status = $wpdb->get_var("SELECT status FROM $wpdb->flaggallery WHERE gid={$galID}");
92
- if(intval($status)){
93
- continue;
94
- }
95
-
96
- if ( $galID == 0) {
97
- $thegalleries = array();
98
- $thepictures = $wpdb->get_results("SELECT $select_columns FROM $wpdb->flagpictures WHERE 1=1 {$exclude_clause} ORDER BY {$flag_options['galSort']} {$flag_options['galSortDir']} ", ARRAY_A);
99
- } else {
100
- $thegalleries = $wpdb->get_row("SELECT gid, name, path, title, galdesc FROM $wpdb->flaggallery WHERE gid={$galID}", ARRAY_A);
101
- $thepictures = $wpdb->get_results("SELECT $select_columns FROM $wpdb->flagpictures WHERE galleryid = '{$galID}' {$exclude_clause} ORDER BY {$flag_options['galSort']} {$flag_options['galSortDir']} ", ARRAY_A);
102
- }
103
- $captions = '';
104
-
105
-
106
- if (is_array ($thepictures) && count($thegalleries) && count($thepictures)){
107
- $thegalleries = array_map('stripslashes', $thegalleries);
108
- $galdesc = $thegalleries['galdesc'];
109
- $thegalleries['galdesc'] = htmlspecialchars_decode($galdesc);
110
- $a = $thegalleries;
111
-
112
- $xml['alt'] .= '<div class="flagCatMeta">';
113
- $xml['alt'] .= '<h4>'.htmlspecialchars_decode($thegalleries['title'], ENT_QUOTES).'</h4>';
114
- $xml['alt'] .= '<p>'.str_replace('"','', strip_tags(htmlspecialchars_decode($galdesc, ENT_QUOTES))).'</p>';
115
- $xml['alt'] .= '</div>';
116
- $xml['alt'] .= '<div class="flagcategory" id="gid_'.$galID.'_'.$skinID.'">';
117
- $n = count($thepictures);
118
- $var = floor($n/5);
119
- if($var==0 || $var > 4) $var=4;
120
- $split = ceil($n/$var);
121
- $j=0;
122
- $b = array();
123
- foreach ($thepictures as $picture) {
124
- $meta_data = maybe_unserialize($picture['meta_data']);
125
- $picture['width'] = $meta_data['width'];
126
- $picture['height'] = $meta_data['height'];
127
- $picture['thumbnail'] = $meta_data['thumbnail']['width'].'x'.$meta_data['thumbnail']['height'];
128
- $webview = '';
129
- if(isset($meta_data['webview'])){
130
- $picture['webview'] = $meta_data['webview'][0].'x'.$meta_data['webview'][1];
131
- $webview = $flag_options['optimized_imgs']? '/webview' : '';
132
- }
133
- unset($picture['meta_data']);
134
- $picture = array_map('stripslashes', $picture);
135
- $b['data'][] = $picture;
136
-
137
- $pid = intval($picture['pid']);
138
-
139
- if ($isCrawler){
140
- $xml['alt'] .= '<a style="display:block; overflow: hidden; height: 100px; width: 115px; margin-bottom: 10px; background-color: #eeeeee; background-position: 22px 44px; text-align: left;" class="i'. $j++ .' flag_pic_alt" href="'.$siteurl.'/'.$thegalleries['path'].$webview.'/'.$picture['filename'].'" id="flag_pic_'.$pid.'"><img style="float:left; margin-right: 10px; width: auto; height: auto; min-height:100px; min-width:115px;" title="'.esc_attr(strip_tags(htmlspecialchars_decode($picture['alttext']))).'" alt="'.esc_attr(strip_tags(htmlspecialchars_decode($picture['alttext']))).'" src="'.$siteurl.'/'.$thegalleries['path'].'/thumbs/thumbs_'.$picture['filename'].'" /><span style="display: block; overflow: hidden; text-decoration: none; color: #000; font-weight: normal;" class="flag_pic_desc" id="flag_desc_'.$pid.'"><strong>'.strip_tags(htmlspecialchars_decode($picture['alttext'])).'</strong><br />'.strip_tags(htmlspecialchars_decode($picture['description'])).'</span></a>';
141
- } else {
142
- if(!$disableViews){
143
- $views = (intval($picture['hitcounter']) < 10000) ? $picture['hitcounter'] : round($picture['hitcounter']/1000, 1).'k';
144
- $likes = (intval($picture['total_votes']) < 10000) ? $picture['total_votes'] : round($picture['total_votes']/1000, 1).'k';
145
- $views_panel = '<span class="flag_pic_counters"><i>'.$views.'</i><b>'.$likes.'</b></span>';
146
- } else {
147
- $views_panel = '';
148
- }
149
- $xml['alt'] .= '<a class="i' . $j++ . ' flag_pic_alt" href="' . $siteurl . '/' . $thegalleries['path'] . $webview . '/' . $picture['filename'] . '" id="flag_pic_' . $pid . '" title="' . esc_attr(strip_tags(htmlspecialchars_decode($picture['alttext']))) . '">[img src=' . $siteurl . '/' . $thegalleries['path'] . '/thumbs/thumbs_' . $picture['filename'] . ']' . $views_panel . '<span class="flag_pic_desc" id="flag_desc_' . $pid . '"><strong>' . strip_tags($picture['alttext']) . '</strong><br /><span>' . htmlspecialchars(nl2br($picture['description'])) . '</span></span></a>';
150
- }
151
- }
152
- $xml['alt'] .= '</div>';
153
- $c['galleries'][] = $a + $b;
154
- }
155
- }
156
- $xml['alt'] .= '</div>';
157
- $content_data = $c + $musicData;
158
- $d = array('properties'=>$data) + $content_data;
159
- $xml['json'] = json_encode($d);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/js/disablescroll.js DELETED
@@ -1,55 +0,0 @@
1
- function hookMouseWheel(){
2
- if (window.addEventListener)
3
- window.addEventListener('DOMMouseScroll', onMouseWheel, false);
4
- window.onmousewheel = document.onmousewheel = onMouseWheel;
5
- }
6
-
7
- function isOverSwf(mEvent)
8
- {
9
- var elem;
10
- if (mEvent.srcElement) {
11
- elem = mEvent.srcElement.nodeName;
12
- } else if (mEvent.target) {
13
- elem = mEvent.target.nodeName;
14
- }
15
-
16
- if (elem.toLowerCase() == "object" || elem.toLowerCase() == "embed") {
17
- // if (jQuery(elem).hasClass('flashalbum')) {
18
- return true;
19
- }
20
- return false;
21
- }
22
-
23
- function onMouseWheel(event)
24
- {
25
- var delta = 0;
26
- if (!event)
27
- event = window.event;
28
- if (event.wheelDelta) {
29
- delta = event.wheelDelta/120;
30
- if (window.opera) delta = -delta;
31
- } else if (event.detail) {
32
- delta = -event.detail/3;
33
- }
34
-
35
- if (isOverSwf(event)) {
36
- return cancelEvent(event);
37
- }
38
-
39
- return true;
40
- }
41
-
42
- function cancelEvent(e)
43
- {
44
- e = e ? e : window.event;
45
- if (e.stopPropagation)
46
- e.stopPropagation();
47
- if (e.preventDefault)
48
- e.preventDefault();
49
- e.cancelBubble = true;
50
- e.cancel = true;
51
- e.returnValue = false;
52
- return false;
53
- }
54
-
55
- hookMouseWheel();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/js/farbtastic-nosharp.js DELETED
@@ -1,345 +0,0 @@
1
- /**
2
- * Farbtastic Color Picker 1.2
3
- * © 2008 Steven Wittens
4
- *
5
- * This program is free software; you can redistribute it and/or modify
6
- * it under the terms of the GNU General Public License as published by
7
- * the Free Software Foundation; either version 2 of the License, or
8
- * (at your option) any later version.
9
- *
10
- * This program is distributed in the hope that it will be useful,
11
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- * GNU General Public License for more details.
14
- *
15
- * You should have received a copy of the GNU General Public License
16
- * along with this program; if not, write to the Free Software
17
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18
- */
19
-
20
- jQuery.fn.farbtastic = function (callback) {
21
- jQuery.farbtastic(this, callback);
22
- return this;
23
- };
24
-
25
- jQuery.farbtastic = function (container, callback) {
26
- var container = jQuery(container).get(0);
27
- return container.farbtastic || (container.farbtastic = new jQuery._farbtastic(container, callback));
28
- }
29
-
30
- jQuery._farbtastic = function (container, callback) {
31
- // Store farbtastic object
32
- var fb = this;
33
-
34
- // Insert markup
35
- jQuery(container).html('<div class="farbtastic"><div class="color"></div><div class="wheel"></div><div class="overlay"></div><div class="h-marker marker"></div><div class="sl-marker marker"></div></div>');
36
- var e = jQuery('.farbtastic', container);
37
- fb.wheel = jQuery('.wheel', container).get(0);
38
- // Dimensions
39
- fb.radius = 84;
40
- fb.square = 100;
41
- fb.width = 194;
42
-
43
- // Fix background PNGs in IE6
44
- if (navigator.appVersion.match(/MSIE [0-6]\./)) {
45
- jQuery('*', e).each(function () {
46
- if (this.currentStyle.backgroundImage != 'none') {
47
- var image = this.currentStyle.backgroundImage;
48
- image = this.currentStyle.backgroundImage.substring(5, image.length - 2);
49
- jQuery(this).css({
50
- 'backgroundImage': 'none',
51
- 'filter': "progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=crop, src='" + image + "')"
52
- });
53
- }
54
- });
55
- }
56
-
57
- /**
58
- * Link to the given element(s) or callback.
59
- */
60
- fb.linkTo = function (callback) {
61
- // Unbind previous nodes
62
- if (typeof fb.callback == 'object') {
63
- jQuery(fb.callback).unbind('keyup', fb.updateValue);
64
- }
65
-
66
- // Reset color
67
- fb.color = null;
68
-
69
- // Bind callback or elements
70
- if (typeof callback == 'function') {
71
- fb.callback = callback;
72
- }
73
- else if (typeof callback == 'object' || typeof callback == 'string') {
74
- fb.callback = jQuery(callback);
75
- fb.callback.bind('keyup', fb.updateValue);
76
- if (fb.callback.get(0).value) {
77
- fb.setColor(fb.callback.get(0).value);
78
- }
79
- }
80
- return this;
81
- }
82
- fb.updateValue = function (event) {
83
- if (this.value && this.value != fb.color) {
84
- fb.setColor(this.value);
85
- }
86
- }
87
-
88
- /**
89
- * Change color with HTML syntax #123456
90
- */
91
- fb.setColor = function (color) {
92
- var unpack = fb.unpack(color);
93
- if (fb.color != color && unpack) {
94
- fb.color = color;
95
- fb.rgb = unpack;
96
- fb.hsl = fb.RGBToHSL(fb.rgb);
97
- fb.updateDisplay();
98
- }
99
- return this;
100
- }
101
-
102
- /**
103
- * Change color with HSL triplet [0..1, 0..1, 0..1]
104
- */
105
- fb.setHSL = function (hsl) {
106
- fb.hsl = hsl;
107
- fb.rgb = fb.HSLToRGB(hsl);
108
- fb.color = fb.pack(fb.rgb);
109
- fb.updateDisplay();
110
- return this;
111
- }
112
-
113
- /////////////////////////////////////////////////////
114
-
115
- /**
116
- * Retrieve the coordinates of the given event relative to the center
117
- * of the widget.
118
- */
119
- fb.widgetCoords = function (event) {
120
- var x, y;
121
- var el = event.target || event.srcElement;
122
- var reference = fb.wheel;
123
-
124
- if (typeof event.offsetX != 'undefined') {
125
- // Use offset coordinates and find common offsetParent
126
- var pos = { x: event.offsetX, y: event.offsetY };
127
-
128
- // Send the coordinates upwards through the offsetParent chain.
129
- var e = el;
130
- while (e) {
131
- e.mouseX = pos.x;
132
- e.mouseY = pos.y;
133
- pos.x += e.offsetLeft;
134
- pos.y += e.offsetTop;
135
- e = e.offsetParent;
136
- }
137
-
138
- // Look for the coordinates starting from the wheel widget.
139
- var e = reference;
140
- var offset = { x: 0, y: 0 }
141
- while (e) {
142
- if (typeof e.mouseX != 'undefined') {
143
- x = e.mouseX - offset.x;
144
- y = e.mouseY - offset.y;
145
- break;
146
- }
147
- offset.x += e.offsetLeft;
148
- offset.y += e.offsetTop;
149
- e = e.offsetParent;
150
- }
151
-
152
- // Reset stored coordinates
153
- e = el;
154
- while (e) {
155
- e.mouseX = undefined;
156
- e.mouseY = undefined;
157
- e = e.offsetParent;
158
- }
159
- }
160
- else {
161
- // Use absolute coordinates
162
- var pos = fb.absolutePosition(reference);
163
- x = (event.pageX || 0*(event.clientX + jQuery('html').get(0).scrollLeft)) - pos.x;
164
- y = (event.pageY || 0*(event.clientY + jQuery('html').get(0).scrollTop)) - pos.y;
165
- }
166
- // Subtract distance to middle
167
- return { x: x - fb.width / 2, y: y - fb.width / 2 };
168
- }
169
-
170
- /**
171
- * Mousedown handler
172
- */
173
- fb.mousedown = function (event) {
174
- // Capture mouse
175
- if (!document.dragging) {
176
- jQuery(document).bind('mousemove', fb.mousemove).bind('mouseup', fb.mouseup);
177
- document.dragging = true;
178
- }
179
-
180
- // Check which area is being dragged
181
- var pos = fb.widgetCoords(event);
182
- fb.circleDrag = Math.max(Math.abs(pos.x), Math.abs(pos.y)) * 2 > fb.square;
183
-
184
- // Process
185
- fb.mousemove(event);
186
- return false;
187
- }
188
-
189
- /**
190
- * Mousemove handler
191
- */
192
- fb.mousemove = function (event) {
193
- // Get coordinates relative to color picker center
194
- var pos = fb.widgetCoords(event);
195
-
196
- // Set new HSL parameters
197
- if (fb.circleDrag) {
198
- var hue = Math.atan2(pos.x, -pos.y) / 6.28;
199
- if (hue < 0) hue += 1;
200
- fb.setHSL([hue, fb.hsl[1], fb.hsl[2]]);
201
- }
202
- else {
203
- var sat = Math.max(0, Math.min(1, -(pos.x / fb.square) + .5));
204
- var lum = Math.max(0, Math.min(1, -(pos.y / fb.square) + .5));
205
- fb.setHSL([fb.hsl[0], sat, lum]);
206
- }
207
- return false;
208
- }
209
-
210
- /**
211
- * Mouseup handler
212
- */
213
- fb.mouseup = function () {
214
- // Uncapture mouse
215
- jQuery(document).unbind('mousemove', fb.mousemove);
216
- jQuery(document).unbind('mouseup', fb.mouseup);
217
- document.dragging = false;
218
- }
219
-
220
- /**
221
- * Update the markers and styles
222
- */
223
- fb.updateDisplay = function () {
224
- // Markers
225
- var angle = fb.hsl[0] * 6.28;
226
- jQuery('.h-marker', e).css({
227
- left: Math.round(Math.sin(angle) * fb.radius + fb.width / 2) + 'px',
228
- top: Math.round(-Math.cos(angle) * fb.radius + fb.width / 2) + 'px'
229
- });
230
-
231
- jQuery('.sl-marker', e).css({
232
- left: Math.round(fb.square * (.5 - fb.hsl[1]) + fb.width / 2) + 'px',
233
- top: Math.round(fb.square * (.5 - fb.hsl[2]) + fb.width / 2) + 'px'
234
- });
235
-
236
- // Saturation/Luminance gradient
237
- jQuery('.color', e).css('backgroundColor', '#'+fb.pack(fb.HSLToRGB([fb.hsl[0], 1, 0.5])));
238
-
239
- // Linked elements or callback
240
- if (typeof fb.callback == 'object') {
241
- // Set background/foreground color
242
- jQuery(fb.callback).css({
243
- backgroundColor: '#'+fb.color,
244
- color: fb.hsl[2] > 0.5 ? '#000' : '#fff'
245
- });
246
-
247
- // Change linked value
248
- jQuery(fb.callback).each(function() {
249
- if (this.value && this.value != fb.color) {
250
- this.value = fb.color;
251
- }
252
- });
253
- }
254
- else if (typeof fb.callback == 'function') {
255
- fb.callback.call(fb, fb.color);
256
- }
257
- }
258
-
259
- /**
260
- * Get absolute position of element
261
- */
262
- fb.absolutePosition = function (el) {
263
- var r = { x: el.offsetLeft, y: el.offsetTop };
264
- // Resolve relative to offsetParent
265
- if (el.offsetParent) {
266
- var tmp = fb.absolutePosition(el.offsetParent);
267
- r.x += tmp.x;
268
- r.y += tmp.y;
269
- }
270
- return r;
271
- };
272
-
273
- /* Various color utility functions */
274
- fb.pack = function (rgb) {
275
- var r = Math.round(rgb[0] * 255);
276
- var g = Math.round(rgb[1] * 255);
277
- var b = Math.round(rgb[2] * 255);
278
- return (r < 16 ? '0' : '') + r.toString(16) +
279
- (g < 16 ? '0' : '') + g.toString(16) +
280
- (b < 16 ? '0' : '') + b.toString(16);
281
- }
282
-
283
- fb.unpack = function (color) {
284
- if (color.length == 6) {
285
- return [parseInt('0x' + color.substring(0, 2)) / 255,
286
- parseInt('0x' + color.substring(2, 4)) / 255,
287
- parseInt('0x' + color.substring(4, 6)) / 255];
288
- }
289
- else if (color.length == 3) {
290
- return [parseInt('0x' + color.substring(0, 1)) / 15,
291
- parseInt('0x' + color.substring(1, 2)) / 15,
292
- parseInt('0x' + color.substring(2, 3)) / 15];
293
- }
294
- }
295
-
296
- fb.HSLToRGB = function (hsl) {
297
- var m1, m2, r, g, b;
298
- var h = hsl[0], s = hsl[1], l = hsl[2];
299
- m2 = (l <= 0.5) ? l * (s + 1) : l + s - l*s;
300
- m1 = l * 2 - m2;
301
- return [this.hueToRGB(m1, m2, h+0.33333),
302
- this.hueToRGB(m1, m2, h),
303
- this.hueToRGB(m1, m2, h-0.33333)];
304
- }
305
-
306
- fb.hueToRGB = function (m1, m2, h) {
307
- h = (h < 0) ? h + 1 : ((h > 1) ? h - 1 : h);
308
- if (h * 6 < 1) return m1 + (m2 - m1) * h * 6;
309
- if (h * 2 < 1) return m2;
310
- if (h * 3 < 2) return m1 + (m2 - m1) * (0.66666 - h) * 6;
311
- return m1;
312
- }
313
-
314
- fb.RGBToHSL = function (rgb) {
315
- var min, max, delta, h, s, l;
316
- var r = rgb[0], g = rgb[1], b = rgb[2];
317
- min = Math.min(r, Math.min(g, b));
318
- max = Math.max(r, Math.max(g, b));
319
- delta = max - min;
320
- l = (min + max) / 2;
321
- s = 0;
322
- if (l > 0 && l < 1) {
323
- s = delta / (l < 0.5 ? (2 * l) : (2 - 2 * l));
324
- }
325
- h = 0;
326
- if (delta > 0) {
327
- if (max == r && max != g) h += (g - b) / delta;
328
- if (max == g && max != b) h += (2 + (b - r) / delta);
329
- if (max == b && max != r) h += (4 + (r - g) / delta);
330
- h /= 6;
331
- }
332
- return [h, s, l];
333
- }
334
-
335
- // Install mousedown handler (the others are set on the document on-demand)
336
- jQuery('*', e).mousedown(fb.mousedown);
337
-
338
- // Init color
339
- fb.setColor('000000');
340
-
341
- // Set linked elements/callback
342
- if (callback) {
343
- fb.linkTo(callback);
344
- }
345
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/js/flag.ajax.js CHANGED
@@ -1,5 +1,5 @@
1
  /*
2
- * Ajax Plugin for Flash Album Gallery
3
  */
4
  (function($) {
5
  flagAjax = {
1
  /*
2
+ * Ajax Plugin for FlaGallery
3
  */
4
  (function($) {
5
  flagAjax = {
admin/js/flagscroll.js DELETED
@@ -1,33 +0,0 @@
1
- jQuery(document).ready(function() {
2
- jQuery('div.flashalbum').bind("mouseenter",function(){
3
- var obj_id = jQuery('object, embed',this).attr('id');
4
- var flash = flagFind(obj_id);
5
- if(flash && jQuery.isFunction(flash[obj_id])) {
6
- flash[obj_id]("false");
7
- console.log(flash[obj_id]);
8
- }
9
- }).bind("mouseleave",function(){
10
- var obj_id = jQuery('object, embed',this).attr('id');
11
- var flash = flagFind(obj_id);
12
- if(flash && jQuery.isFunction(flash[obj_id])) {
13
- flash[obj_id]("true");
14
- console.log(flash[obj_id]);
15
- }
16
- });
17
- });
18
-
19
- function flagFind(flagName){
20
- if (window.document[flagName]){
21
- return window.document[flagName];
22
- }
23
- if (navigator.appName.indexOf("Microsoft Internet")==-1){
24
- if (document.embeds && document.embeds[flagName])
25
- return document.embeds[flagName];
26
- }
27
- if (document.getElementById(flagName)){
28
- return document.getElementById(flagName);
29
- }
30
- else {
31
- return false;
32
- }
33
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/js/images/fancy_close.png DELETED
Binary file
admin/js/images/fancy_loading.png DELETED
Binary file
admin/js/images/fancy_nav_left.png DELETED
Binary file
admin/js/images/fancy_nav_right.png DELETED
Binary file
admin/js/images/fancy_nav_slide.png DELETED
Binary file
admin/js/images/fancy_shadow_n.png DELETED
Binary file
admin/js/images/fancy_shadow_s.png DELETED
Binary file
admin/js/images/fancy_shadow_w.png DELETED
Binary file
admin/js/images/fancy_title_over.png DELETED
Binary file
admin/js/images/fancybox-y.png DELETED
Binary file
admin/js/jquery.fancybox-1.3.4.pack.js DELETED
@@ -1,46 +0,0 @@
1
- /*
2
- * FancyBox - jQuery Plugin
3
- * Simple and fancy lightbox alternative
4
- *
5
- * Examples and documentation at: http://fancybox.net
6
- *
7
- * Copyright (c) 2008 - 2010 Janis Skarnelis
8
- * That said, it is hardly a one-person project. Many people have submitted bugs, code, and offered their advice freely. Their support is greatly appreciated.
9
- *
10
- * Version: 1.3.4 (11/11/2010)
11
- * Requires: jQuery v1.3+
12
- *
13
- * Dual licensed under the MIT and GPL licenses:
14
- * http://www.opensource.org/licenses/mit-license.php
15
- * http://www.gnu.org/licenses/gpl.html
16
- */
17
-
18
- ;(function(b){var m,t,u,f,D,j,E,n,z,A,q=0,e={},o=[],p=0,d={},l=[],G=null,v=new Image,J=/\.(jpg|gif|png|bmp|jpeg)(.*)?$/i,W=/[^\.]\.(swf)\s*$/i,K,L=1,y=0,s="",r,i,h=false,B=b.extend(b("<div/>")[0],{prop:0}),M=b.browser.msie&&b.browser.version<7&&!window.XMLHttpRequest,N=function(){t.hide();v.onerror=v.onload=null;G&&G.abort();m.empty()},O=function(){if(false===e.onError(o,q,e)){t.hide();h=false}else{e.titleShow=false;e.width="auto";e.height="auto";m.html('<p id="fancybox-error">The requested content cannot be loaded.<br />Please try again later.</p>');
19
- F()}},I=function(){var a=o[q],c,g,k,C,P,w;N();e=b.extend({},b.fn.fancybox.defaults,typeof b(a).data("fancybox")=="undefined"?e:b(a).data("fancybox"));w=e.onStart(o,q,e);if(w===false)h=false;else{if(typeof w=="object")e=b.extend(e,w);k=e.title||(a.nodeName?b(a).attr("title"):a.title)||"";if(a.nodeName&&!e.orig)e.orig=b(a).children("img:first").length?b(a).children("img:first"):b(a);if(k===""&&e.orig&&e.titleFromAlt)k=e.orig.attr("alt");c=e.href||(a.nodeName?b(a).attr("href"):a.href)||null;if(/^(?:javascript)/i.test(c)||
20
- c=="#")c=null;if(e.type){g=e.type;if(!c)c=e.content}else if(e.content)g="html";else if(c)g=c.match(J)?"image":c.match(W)?"swf":b(a).hasClass("iframe")?"iframe":c.indexOf("#")===0?"inline":"ajax";if(g){if(g=="inline"){a=c.substr(c.indexOf("#"));g=b(a).length>0?"inline":"ajax"}e.type=g;e.href=c;e.title=k;if(e.autoDimensions)if(e.type=="html"||e.type=="inline"||e.type=="ajax"){e.width="auto";e.height="auto"}else e.autoDimensions=false;if(e.modal){e.overlayShow=true;e.hideOnOverlayClick=false;e.hideOnContentClick=
21
- false;e.enableEscapeButton=false;e.showCloseButton=false}e.padding=parseInt(e.padding,10);e.margin=parseInt(e.margin,10);m.css("padding",e.padding+e.margin);b(".fancybox-inline-tmp").unbind("fancybox-cancel").bind("fancybox-change",function(){b(this).replaceWith(j.children())});switch(g){case "html":m.html(e.content);F();break;case "inline":if(b(a).parent().is("#fancybox-content")===true){h=false;break}b('<div class="fancybox-inline-tmp" />').hide().insertBefore(b(a)).bind("fancybox-cleanup",function(){b(this).replaceWith(j.children())}).bind("fancybox-cancel",
22
- function(){b(this).replaceWith(m.children())});b(a).appendTo(m);F();break;case "image":h=false;b.fancybox.showActivity();v=new Image;v.onerror=function(){O()};v.onload=function(){h=true;v.onerror=v.onload=null;e.width=v.width;e.height=v.height;b("<img />").attr({id:"fancybox-img",src:v.src,alt:e.title}).appendTo(m);Q()};v.src=c;break;case "swf":e.scrolling="no";C='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+e.width+'" height="'+e.height+'"><param name="movie" value="'+c+
23
- '"></param>';P="";b.each(e.swf,function(x,H){C+='<param name="'+x+'" value="'+H+'"></param>';P+=" "+x+'="'+H+'"'});C+='<embed src="'+c+'" type="application/x-shockwave-flash" width="'+e.width+'" height="'+e.height+'"'+P+"></embed></object>";m.html(C);F();break;case "ajax":h=false;b.fancybox.showActivity();e.ajax.win=e.ajax.success;G=b.ajax(b.extend({},e.ajax,{url:c,data:e.ajax.data||{},error:function(x){x.status>0&&O()},success:function(x,H,R){if((typeof R=="object"?R:G).status==200){if(typeof e.ajax.win==
24
- "function"){w=e.ajax.win(c,x,H,R);if(w===false){t.hide();return}else if(typeof w=="string"||typeof w=="object")x=w}m.html(x);F()}}}));break;case "iframe":Q()}}else O()}},F=function(){var a=e.width,c=e.height;a=a.toString().indexOf("%")>-1?parseInt((b(window).width()-e.margin*2)*parseFloat(a)/100,10)+"px":a=="auto"?"auto":a+"px";c=c.toString().indexOf("%")>-1?parseInt((b(window).height()-e.margin*2)*parseFloat(c)/100,10)+"px":c=="auto"?"auto":c+"px";m.wrapInner('<div style="width:'+a+";height:"+c+
25
- ";overflow: "+(e.scrolling=="auto"?"auto":e.scrolling=="yes"?"scroll":"hidden")+';position:relative;"></div>');e.width=m.width();e.height=m.height();Q()},Q=function(){var a,c;t.hide();if(f.is(":visible")&&false===d.onCleanup(l,p,d)){b.event.trigger("fancybox-cancel");h=false}else{h=true;b(j.add(u)).unbind();b(window).unbind("resize.fb scroll.fb");b(document).unbind("keydown.fb");f.is(":visible")&&d.titlePosition!=="outside"&&f.css("height",f.height());l=o;p=q;d=e;if(d.overlayShow){u.css({"background-color":d.overlayColor,
26
- opacity:d.overlayOpacity,cursor:d.hideOnOverlayClick?"pointer":"auto",height:b(document).height()});if(!u.is(":visible")){M&&b("select:not(#fancybox-tmp select)").filter(function(){return this.style.visibility!=="hidden"}).css({visibility:"hidden"}).one("fancybox-cleanup",function(){this.style.visibility="inherit"});u.show()}}else u.hide();i=X();s=d.title||"";y=0;n.empty().removeAttr("style").removeClass();if(d.titleShow!==false){if(b.isFunction(d.titleFormat))a=d.titleFormat(s,l,p,d);else a=s&&s.length?
27
- d.titlePosition=="float"?'<table id="fancybox-title-float-wrap" cellpadding="0" cellspacing="0"><tr><td id="fancybox-title-float-left"></td><td id="fancybox-title-float-main">'+s+'</td><td id="fancybox-title-float-right"></td></tr></table>':'<div id="fancybox-title-'+d.titlePosition+'">'+s+"</div>":false;s=a;if(!(!s||s==="")){n.addClass("fancybox-title-"+d.titlePosition).html(s).appendTo("body").show();switch(d.titlePosition){case "inside":n.css({width:i.width-d.padding*2,marginLeft:d.padding,marginRight:d.padding});
28
- y=n.outerHeight(true);n.appendTo(D);i.height+=y;break;case "over":n.css({marginLeft:d.padding,width:i.width-d.padding*2,bottom:d.padding}).appendTo(D);break;case "float":n.css("left",parseInt((n.width()-i.width-40)/2,10)*-1).appendTo(f);break;default:n.css({width:i.width-d.padding*2,paddingLeft:d.padding,paddingRight:d.padding}).appendTo(f)}}}n.hide();if(f.is(":visible")){b(E.add(z).add(A)).hide();a=f.position();r={top:a.top,left:a.left,width:f.width(),height:f.height()};c=r.width==i.width&&r.height==
29
- i.height;j.fadeTo(d.changeFade,0.3,function(){var g=function(){j.html(m.contents()).fadeTo(d.changeFade,1,S)};b.event.trigger("fancybox-change");j.empty().removeAttr("filter").css({"border-width":d.padding,width:i.width-d.padding*2,height:e.autoDimensions?"auto":i.height-y-d.padding*2});if(c)g();else{B.prop=0;b(B).animate({prop:1},{duration:d.changeSpeed,easing:d.easingChange,step:T,complete:g})}})}else{f.removeAttr("style");j.css("border-width",d.padding);if(d.transitionIn=="elastic"){r=V();j.html(m.contents());
30
- f.show();if(d.opacity)i.opacity=0;B.prop=0;b(B).animate({prop:1},{duration:d.speedIn,easing:d.easingIn,step:T,complete:S})}else{d.titlePosition=="inside"&&y>0&&n.show();j.css({width:i.width-d.padding*2,height:e.autoDimensions?"auto":i.height-y-d.padding*2}).html(m.contents());f.css(i).fadeIn(d.transitionIn=="none"?0:d.speedIn,S)}}}},Y=function(){if(d.enableEscapeButton||d.enableKeyboardNav)b(document).bind("keydown.fb",function(a){if(a.keyCode==27&&d.enableEscapeButton){a.preventDefault();b.fancybox.close()}else if((a.keyCode==
31
- 37||a.keyCode==39)&&d.enableKeyboardNav&&a.target.tagName!=="INPUT"&&a.target.tagName!=="TEXTAREA"&&a.target.tagName!=="SELECT"){a.preventDefault();b.fancybox[a.keyCode==37?"prev":"next"]()}});if(d.showNavArrows){if(d.cyclic&&l.length>1||p!==0)z.show();if(d.cyclic&&l.length>1||p!=l.length-1)A.show()}else{z.hide();A.hide()}},S=function(){if(!b.support.opacity){j.get(0).style.removeAttribute("filter");f.get(0).style.removeAttribute("filter")}e.autoDimensions&&j.css("height","auto");f.css("height","auto");
32
- s&&s.length&&n.show();d.showCloseButton&&E.show();Y();d.hideOnContentClick&&j.bind("click",b.fancybox.close);d.hideOnOverlayClick&&u.bind("click",b.fancybox.close);b(window).bind("resize.fb",b.fancybox.resize);d.centerOnScroll&&b(window).bind("scroll.fb",b.fancybox.center);if(d.type=="iframe")b('<iframe id="fancybox-frame" name="fancybox-frame'+(new Date).getTime()+'" frameborder="0" hspace="0" '+(b.browser.msie?'allowtransparency="true""':"")+' scrolling="'+e.scrolling+'" src="'+d.href+'"></iframe>').appendTo(j);
33
- f.show();h=false;b.fancybox.center();d.onComplete(l,p,d);var a,c;if(l.length-1>p){a=l[p+1].href;if(typeof a!=="undefined"&&a.match(J)){c=new Image;c.src=a}}if(p>0){a=l[p-1].href;if(typeof a!=="undefined"&&a.match(J)){c=new Image;c.src=a}}},T=function(a){var c={width:parseInt(r.width+(i.width-r.width)*a,10),height:parseInt(r.height+(i.height-r.height)*a,10),top:parseInt(r.top+(i.top-r.top)*a,10),left:parseInt(r.left+(i.left-r.left)*a,10)};if(typeof i.opacity!=="undefined")c.opacity=a<0.5?0.5:a;f.css(c);
34
- j.css({width:c.width-d.padding*2,height:c.height-y*a-d.padding*2})},U=function(){return[b(window).width()-d.margin*2,b(window).height()-d.margin*2,b(document).scrollLeft()+d.margin,b(document).scrollTop()+d.margin]},X=function(){var a=U(),c={},g=d.autoScale,k=d.padding*2;c.width=d.width.toString().indexOf("%")>-1?parseInt(a[0]*parseFloat(d.width)/100,10):d.width+k;c.height=d.height.toString().indexOf("%")>-1?parseInt(a[1]*parseFloat(d.height)/100,10):d.height+k;if(g&&(c.width>a[0]||c.height>a[1]))if(e.type==
35
- "image"||e.type=="swf"){g=d.width/d.height;if(c.width>a[0]){c.width=a[0];c.height=parseInt((c.width-k)/g+k,10)}if(c.height>a[1]){c.height=a[1];c.width=parseInt((c.height-k)*g+k,10)}}else{c.width=Math.min(c.width,a[0]);c.height=Math.min(c.height,a[1])}c.top=parseInt(Math.max(a[3]-20,a[3]+(a[1]-c.height-40)*0.5),10);c.left=parseInt(Math.max(a[2]-20,a[2]+(a[0]-c.width-40)*0.5),10);return c},V=function(){var a=e.orig?b(e.orig):false,c={};if(a&&a.length){c=a.offset();c.top+=parseInt(a.css("paddingTop"),
36
- 10)||0;c.left+=parseInt(a.css("paddingLeft"),10)||0;c.top+=parseInt(a.css("border-top-width"),10)||0;c.left+=parseInt(a.css("border-left-width"),10)||0;c.width=a.width();c.height=a.height();c={width:c.width+d.padding*2,height:c.height+d.padding*2,top:c.top-d.padding-20,left:c.left-d.padding-20}}else{a=U();c={width:d.padding*2,height:d.padding*2,top:parseInt(a[3]+a[1]*0.5,10),left:parseInt(a[2]+a[0]*0.5,10)}}return c},Z=function(){if(t.is(":visible")){b("div",t).css("top",L*-40+"px");L=(L+1)%12}else clearInterval(K)};
37
- b.fn.fancybox=function(a){if(!b(this).length)return this;b(this).data("fancybox",b.extend({},a,b.metadata?b(this).metadata():{})).unbind("click.fb").bind("click.fb",function(c){c.preventDefault();if(!h){h=true;b(this).blur();o=[];q=0;c=b(this).attr("rel")||"";if(!c||c==""||c==="nofollow")o.push(this);else{o=b("a[rel="+c+"], area[rel="+c+"]");q=o.index(this)}I()}});return this};b.fancybox=function(a,c){var g;if(!h){h=true;g=typeof c!=="undefined"?c:{};o=[];q=parseInt(g.index,10)||0;if(b.isArray(a)){for(var k=
38
- 0,C=a.length;k<C;k++)if(typeof a[k]=="object")b(a[k]).data("fancybox",b.extend({},g,a[k]));else a[k]=b({}).data("fancybox",b.extend({content:a[k]},g));o=jQuery.merge(o,a)}else{if(typeof a=="object")b(a).data("fancybox",b.extend({},g,a));else a=b({}).data("fancybox",b.extend({content:a},g));o.push(a)}if(q>o.length||q<0)q=0;I()}};b.fancybox.showActivity=function(){clearInterval(K);t.show();K=setInterval(Z,66)};b.fancybox.hideActivity=function(){t.hide()};b.fancybox.next=function(){return b.fancybox.pos(p+
39
- 1)};b.fancybox.prev=function(){return b.fancybox.pos(p-1)};b.fancybox.pos=function(a){if(!h){a=parseInt(a);o=l;if(a>-1&&a<l.length){q=a;I()}else if(d.cyclic&&l.length>1){q=a>=l.length?0:l.length-1;I()}}};b.fancybox.cancel=function(){if(!h){h=true;b.event.trigger("fancybox-cancel");N();e.onCancel(o,q,e);h=false}};b.fancybox.close=function(){function a(){u.fadeOut("fast");n.empty().hide();f.hide();b.event.trigger("fancybox-cleanup");j.empty();d.onClosed(l,p,d);l=e=[];p=q=0;d=e={};h=false}if(!(h||f.is(":hidden"))){h=
40
- true;if(d&&false===d.onCleanup(l,p,d))h=false;else{N();b(E.add(z).add(A)).hide();b(j.add(u)).unbind();b(window).unbind("resize.fb scroll.fb");b(document).unbind("keydown.fb");j.find("iframe").attr("src",M&&/^https/i.test(window.location.href||"")?"javascript:void(false)":"about:blank");d.titlePosition!=="inside"&&n.empty();f.stop();if(d.transitionOut=="elastic"){r=V();var c=f.position();i={top:c.top,left:c.left,width:f.width(),height:f.height()};if(d.opacity)i.opacity=1;n.empty().hide();B.prop=1;
41
- b(B).animate({prop:0},{duration:d.speedOut,easing:d.easingOut,step:T,complete:a})}else f.fadeOut(d.transitionOut=="none"?0:d.speedOut,a)}}};b.fancybox.resize=function(){u.is(":visible")&&u.css("height",b(document).height());b.fancybox.center(true)};b.fancybox.center=function(a){var c,g;if(!h){g=a===true?1:0;c=U();!g&&(f.width()>c[0]||f.height()>c[1])||f.stop().animate({top:parseInt(Math.max(c[3]-20,c[3]+(c[1]-j.height()-40)*0.5-d.padding)),left:parseInt(Math.max(c[2]-20,c[2]+(c[0]-j.width()-40)*0.5-
42
- d.padding))},typeof a=="number"?a:200)}};b.fancybox.init=function(){if(!b("#fancybox-wrap").length){b("body").append(m=b('<div id="fancybox-tmp"></div>'),t=b('<div id="fancybox-loading"><div></div></div>'),u=b('<div id="fancybox-overlay"></div>'),f=b('<div id="fancybox-wrap"></div>'));D=b('<div id="fancybox-outer"></div>').append('<div class="fancybox-bg" id="fancybox-bg-n"></div><div class="fancybox-bg" id="fancybox-bg-ne"></div><div class="fancybox-bg" id="fancybox-bg-e"></div><div class="fancybox-bg" id="fancybox-bg-se"></div><div class="fancybox-bg" id="fancybox-bg-s"></div><div class="fancybox-bg" id="fancybox-bg-sw"></div><div class="fancybox-bg" id="fancybox-bg-w"></div><div class="fancybox-bg" id="fancybox-bg-nw"></div>').appendTo(f);
43
- D.append(j=b('<div id="fancybox-content"></div>'),E=b('<a id="fancybox-close"></a>'),n=b('<div id="fancybox-title"></div>'),z=b('<a href="javascript:;" id="fancybox-left"><span class="fancy-ico" id="fancybox-left-ico"></span></a>'),A=b('<a href="javascript:;" id="fancybox-right"><span class="fancy-ico" id="fancybox-right-ico"></span></a>'));E.click(b.fancybox.close);t.click(b.fancybox.cancel);z.click(function(a){a.preventDefault();b.fancybox.prev()});A.click(function(a){a.preventDefault();b.fancybox.next()});
44
- b.fn.mousewheel&&f.bind("mousewheel.fb",function(a,c){if(h)a.preventDefault();else if(b(a.target).get(0).clientHeight==0||b(a.target).get(0).scrollHeight===b(a.target).get(0).clientHeight){a.preventDefault();b.fancybox[c>0?"prev":"next"]()}});b.support.opacity||f.addClass("fancybox-ie");if(M){t.addClass("fancybox-ie6");f.addClass("fancybox-ie6");b('<iframe id="fancybox-hide-sel-frame" src="'+(/^https/i.test(window.location.href||"")?"javascript:void(false)":"about:blank")+'" scrolling="no" border="0" frameborder="0" tabindex="-1"></iframe>').prependTo(D)}}};
45
- b.fn.fancybox.defaults={padding:10,margin:40,opacity:false,modal:false,cyclic:false,scrolling:"auto",width:560,height:340,autoScale:true,autoDimensions:true,centerOnScroll:false,ajax:{},swf:{wmode:"transparent"},hideOnOverlayClick:true,hideOnContentClick:false,overlayShow:true,overlayOpacity:0.7,overlayColor:"#777",titleShow:true,titlePosition:"float",titleFormat:null,titleFromAlt:false,transitionIn:"fade",transitionOut:"fade",speedIn:300,speedOut:300,changeSpeed:300,changeFade:"fast",easingIn:"swing",
46
- easingOut:"swing",showCloseButton:true,showNavArrows:true,enableEscapeButton:true,enableKeyboardNav:true,onStart:function(){},onCancel:function(){},onComplete:function(){},onCleanup:function(){},onClosed:function(){},onError:function(){}};b(document).ready(function(){b.fancybox.init()})})(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/js/jquery.js DELETED
@@ -1,18 +0,0 @@
1
- /*!
2
- * jQuery JavaScript Library v1.6.1
3
- * http://jquery.com/
4
- *
5
- * Copyright 2011, John Resig
6
- * Dual licensed under the MIT or GPL Version 2 licenses.
7
- * http://jquery.org/license
8
- *
9
- * Includes Sizzle.js
10
- * http://sizzlejs.com/
11
- * Copyright 2011, The Dojo Foundation
12
- * Released under the MIT, BSD, and GPL Licenses.
13
- *
14
- * Date: Thu May 12 15:04:36 2011 -0400
15
- */
16
- (function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cv(a){if(!cj[a]){var b=f("<"+a+">").appendTo("body"),d=b.css("display");b.remove();if(d==="none"||d===""){ck||(ck=c.createElement("iframe"),ck.frameBorder=ck.width=ck.height=0),c.body.appendChild(ck);if(!cl||!ck.createElement)cl=(ck.contentWindow||ck.contentDocument).document,cl.write("<!doctype><html><body></body></html>");b=cl.createElement(a),cl.body.appendChild(b),d=f.css(b,"display"),c.body.removeChild(ck)}cj[a]=d}return cj[a]}function cu(a,b){var c={};f.each(cp.concat.apply([],cp.slice(0,b)),function(){c[this]=a});return c}function ct(){cq=b}function cs(){setTimeout(ct,0);return cq=f.now()}function ci(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ch(){try{return new a.XMLHttpRequest}catch(b){}}function cb(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g<i;g++){if(g===1)for(h in a.converters)typeof h=="string"&&(e[h.toLowerCase()]=a.converters[h]);l=k,k=d[g];if(k==="*")k=l;else if(l!=="*"&&l!==k){m=l+" "+k,n=e[m]||e["* "+k];if(!n){p=b;for(o in e){j=o.split(" ");if(j[0]===l||j[0]==="*"){p=e[j[1]+" "+k];if(p){o=e[o],o===!0?n=p:p===!0&&(n=o);break}}}}!n&&!p&&f.error("No conversion from "+m.replace(" "," to ")),n!==!0&&(c=n?n(c):p(o(c)))}}return c}function ca(a,c,d){var e=a.contents,f=a.dataTypes,g=a.responseFields,h,i,j,k;for(i in g)i in d&&(c[g[i]]=d[i]);while(f[0]==="*")f.shift(),h===b&&(h=a.mimeType||c.getResponseHeader("content-type"));if(h)for(i in e)if(e[i]&&e[i].test(h)){f.unshift(i);break}if(f[0]in d)j=f[0];else{for(i in d){if(!f[0]||a.converters[i+" "+f[0]]){j=i;break}k||(k=i)}j=j||k}if(j){j!==f[0]&&f.unshift(j);return d[j]}}function b_(a,b,c,d){if(f.isArray(b))f.each(b,function(b,e){c||bF.test(a)?d(a,e):b_(a+"["+(typeof e=="object"||f.isArray(e)?b:"")+"]",e,c,d)});else if(!c&&b!=null&&typeof b=="object")for(var e in b)b_(a+"["+e+"]",b[e],c,d);else d(a,b)}function b$(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;var h=a[f],i=0,j=h?h.length:0,k=a===bU,l;for(;i<j&&(k||!l);i++)l=h[i](c,d,e),typeof l=="string"&&(!k||g[l]?l=b:(c.dataTypes.unshift(l),l=b$(a,c,d,e,l,g)));(k||!l)&&!g["*"]&&(l=b$(a,c,d,e,"*",g));return l}function bZ(a){return function(b,c){typeof b!="string"&&(c=b,b="*");if(f.isFunction(c)){var d=b.toLowerCase().split(bQ),e=0,g=d.length,h,i,j;for(;e<g;e++)h=d[e],j=/^\+/.test(h),j&&(h=h.substr(1)||"*"),i=a[h]=a[h]||[],i[j?"unshift":"push"](c)}}}function bD(a,b,c){var d=b==="width"?bx:by,e=b==="width"?a.offsetWidth:a.offsetHeight;if(c==="border")return e;f.each(d,function(){c||(e-=parseFloat(f.css(a,"padding"+this))||0),c==="margin"?e+=parseFloat(f.css(a,"margin"+this))||0:e-=parseFloat(f.css(a,"border"+this+"Width"))||0});return e}function bn(a,b){b.src?f.ajax({url:b.src,async:!1,dataType:"script"}):f.globalEval((b.text||b.textContent||b.innerHTML||"").replace(bf,"/*$0*/")),b.parentNode&&b.parentNode.removeChild(b)}function bm(a){f.nodeName(a,"input")?bl(a):a.getElementsByTagName&&f.grep(a.getElementsByTagName("input"),bl)}function bl(a){if(a.type==="checkbox"||a.type==="radio")a.defaultChecked=a.checked}function bk(a){return"getElementsByTagName"in a?a.getElementsByTagName("*"):"querySelectorAll"in a?a.querySelectorAll("*"):[]}function bj(a,b){var c;if(b.nodeType===1){b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase();if(c==="object")b.outerHTML=a.outerHTML;else if(c!=="input"||a.type!=="checkbox"&&a.type!=="radio"){if(c==="option")b.selected=a.defaultSelected;else if(c==="input"||c==="textarea")b.defaultValue=a.defaultValue}else a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value);b.removeAttribute(f.expando)}}function bi(a,b){if(b.nodeType===1&&!!f.hasData(a)){var c=f.expando,d=f.data(a),e=f.data(b,d);if(d=d[c]){var g=d.events;e=e[c]=f.extend({},d);if(g){delete e.handle,e.events={};for(var h in g)for(var i=0,j=g[h].length;i<j;i++)f.event.add(b,h+(g[h][i].namespace?".":"")+g[h][i].namespace,g[h][i],g[h][i].data)}}}}function bh(a,b){return f.nodeName(a,"table")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function X(a,b,c){b=b||0;if(f.isFunction(b))return f.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return f.grep(a,function(a,d){return a===b===c});if(typeof b=="string"){var d=f.grep(a,function(a){return a.nodeType===1});if(S.test(b))return f.filter(b,d,!c);b=f.filter(b,d)}return f.grep(a,function(a,d){return f.inArray(a,b)>=0===c})}function W(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function O(a,b){return(a&&a!=="*"?a+".":"")+b.replace(A,"`").replace(B,"&")}function N(a){var b,c,d,e,g,h,i,j,k,l,m,n,o,p=[],q=[],r=f._data(this,"events");if(!(a.liveFired===this||!r||!r.live||a.target.disabled||a.button&&a.type==="click")){a.namespace&&(n=new RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)")),a.liveFired=this;var s=r.live.slice(0);for(i=0;i<s.length;i++)g=s[i],g.origType.replace(y,"")===a.type?q.push(g.selector):s.splice(i--,1);e=f(a.target).closest(q,a.currentTarget);for(j=0,k=e.length;j<k;j++){m=e[j];for(i=0;i<s.length;i++){g=s[i];if(m.selector===g.selector&&(!n||n.test(g.namespace))&&!m.elem.disabled){h=m.elem,d=null;if(g.preType==="mouseenter"||g.preType==="mouseleave")a.type=g.preType,d=f(a.relatedTarget).closest(g.selector)[0],d&&f.contains(h,d)&&(d=h);(!d||d!==h)&&p.push({elem:h,handleObj:g,level:m.level})}}}for(j=0,k=p.length;j<k;j++){e=p[j];if(c&&e.level>c)break;a.currentTarget=e.elem,a.data=e.handleObj.data,a.handleObj=e.handleObj,o=e.handleObj.origHandler.apply(e.elem,arguments);if(o===!1||a.isPropagationStopped()){c=e.level,o===!1&&(b=!1);if(a.isImmediatePropagationStopped())break}}return b}}function L(a,c,d){var e=f.extend({},d[0]);e.type=a,e.originalEvent={},e.liveFired=b,f.event.handle.call(c,e),e.isDefaultPrevented()&&d[0].preventDefault()}function F(){return!0}function E(){return!1}function m(a,c,d){var e=c+"defer",g=c+"queue",h=c+"mark",i=f.data(a,e,b,!0);i&&(d==="queue"||!f.data(a,g,b,!0))&&(d==="mark"||!f.data(a,h,b,!0))&&setTimeout(function(){!f.data(a,g,b,!0)&&!f.data(a,h,b,!0)&&(f.removeData(a,e,!0),i.resolve())},0)}function l(a){for(var b in a)if(b!=="toJSON")return!1;return!0}function k(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(j,"$1-$2").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNaN(d)?i.test(d)?f.parseJSON(d):d:parseFloat(d)}catch(g){}f.data(a,c,d)}else d=b}return d}var c=a.document,d=a.navigator,e=a.location,f=function(){function H(){if(!e.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(H,1);return}e.ready()}}var e=function(a,b){return new e.fn.init(a,b,h)},f=a.jQuery,g=a.$,h,i=/^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/\d/,n=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,o=/^[\],:{}\s]*$/,p=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,q=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,r=/(?:^|:|,)(?:\s*\[)+/g,s=/(webkit)[ \/]([\w.]+)/,t=/(opera)(?:.*version)?[ \/]([\w.]+)/,u=/(msie) ([\w.]+)/,v=/(mozilla)(?:.*? rv:([\w.]+))?/,w=d.userAgent,x,y,z,A=Object.prototype.toString,B=Object.prototype.hasOwnProperty,C=Array.prototype.push,D=Array.prototype.slice,E=String.prototype.trim,F=Array.prototype.indexOf,G={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=n.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.6.1",length:0,size:function(){return this.length},toArray:function(){return D.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?C.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),y.done(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(D.apply(this,arguments),"slice",D.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:C,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j<k;j++)if((a=arguments[j])!=null)for(c in a){d=i[c],f=a[c];if(i===f)continue;l&&f&&(e.isPlainObject(f)||(g=e.isArray(f)))?(g?(g=!1,h=d&&e.isArray(d)?d:[]):h=d&&e.isPlainObject(d)?d:{},i[c]=e.extend(l,h,f)):f!==b&&(i[c]=f)}return i},e.extend({noConflict:function(b){a.$===e&&(a.$=g),b&&a.jQuery===e&&(a.jQuery=f);return e},isReady:!1,readyWait:1,holdReady:function(a){a?e.readyWait++:e.ready(!0)},ready:function(a){if(a===!0&&!--e.readyWait||a!==!0&&!e.isReady){if(!c.body)return setTimeout(e.ready,1);e.isReady=!0;if(a!==!0&&--e.readyWait>0)return;y.resolveWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").unbind("ready")}},bindReady:function(){if(!y){y=e._Deferred();if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",z,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",z),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&H()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNaN:function(a){return a==null||!m.test(a)||isNaN(a)},type:function(a){return a==null?String(a):G[A.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;if(a.constructor&&!B.call(a,"constructor")&&!B.call(a.constructor.prototype,"isPrototypeOf"))return!1;var c;for(c in a);return c===b||B.call(a,c)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw a},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(o.test(b.replace(p,"@").replace(q,"]").replace(r,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(b,c,d){a.DOMParser?(d=new DOMParser,c=d.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b)),d=c.documentElement,(!d||!d.nodeName||d.nodeName==="parsererror")&&e.error("Invalid XML: "+b);return c},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g<h;)if(c.apply(a[g++],d)===!1)break}else if(i){for(f in a)if(c.call(a[f],f,a[f])===!1)break}else for(;g<h;)if(c.call(a[g],g,a[g++])===!1)break;return a},trim:E?function(a){return a==null?"":E.call(a)}:function(a){return a==null?"":(a+"").replace(k,"").replace(l,"")},makeArray:function(a,b){var c=b||[];if(a!=null){var d=e.type(a);a.length==null||d==="string"||d==="function"||d==="regexp"||e.isWindow(a)?C.call(c,a):e.merge(c,a)}return c},inArray:function(a,b){if(F)return F.call(b,a);for(var c=0,d=b.length;c<d;c++)if(b[c]===a)return c;return-1},merge:function(a,c){var d=a.length,e=0;if(typeof c.length=="number")for(var f=c.length;e<f;e++)a[d++]=c[e];else while(c[e]!==b)a[d++]=c[e++];a.length=d;return a},grep:function(a,b,c){var d=[],e;c=!!c;for(var f=0,g=a.length;f<g;f++)e=!!b(a[f],f),c!==e&&d.push(a[f]);return d},map:function(a,c,d){var f,g,h=[],i=0,j=a.length,k=a instanceof e||j!==b&&typeof j=="number"&&(j>0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i<j;i++)f=c(a[i],i,d),f!=null&&(h[h.length]=f);else for(g in a)f=c(a[g],g,d),f!=null&&(h[h.length]=f);return h.concat.apply([],h)},guid:1,proxy:function(a,c){if(typeof c=="string"){var d=a[c];c=a,a=d}if(!e.isFunction(a))return b;var f=D.call(arguments,2),g=function(){return a.apply(c,f.concat(D.call(arguments)))};g.guid=a.guid=a.guid||g.guid||e.guid++;return g},access:function(a,c,d,f,g,h){var i=a.length;if(typeof c=="object"){for(var j in c)e.access(a,j,c[j],f,g,d);return a}if(d!==b){f=!h&&f&&e.isFunction(d);for(var k=0;k<i;k++)g(a[k],c,f?d.call(a[k],k,g(a[k],c)):d,h);return a}return i?g(a[0],c):b},now:function(){return(new Date).getTime()},uaMatch:function(a){a=a.toLowerCase();var b=s.exec(a)||t.exec(a)||u.exec(a)||a.indexOf("compatible")<0&&v.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},sub:function(){function a(b,c){return new a.fn.init(b,c)}e.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function(d,f){f&&f instanceof e&&!(f instanceof a)&&(f=a(f));return e.fn.init.call(this,d,f,b)},a.fn.init.prototype=a.fn;var b=a(c);return a},browser:{}}),e.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){G["[object "+b+"]"]=b.toLowerCase()}),x=e.uaMatch(w),x.browser&&(e.browser[x.browser]=!0,e.browser.version=x.version),e.browser.webkit&&(e.browser.safari=!0),j.test(" ")&&(k=/^[\s\xA0]+/,l=/[\s\xA0]+$/),h=e(c),c.addEventListener?z=function(){c.removeEventListener("DOMContentLoaded",z,!1),e.ready()}:c.attachEvent&&(z=function(){c.readyState==="complete"&&(c.detachEvent("onreadystatechange",z),e.ready())});return e}(),g="done fail isResolved isRejected promise then always pipe".split(" "),h=[].slice;f.extend({_Deferred:function(){var a=[],b,c,d,e={done:function(){if(!d){var c=arguments,g,h,i,j,k;b&&(k=b,b=0);for(g=0,h=c.length;g<h;g++)i=c[g],j=f.type(i),j==="array"?e.done.apply(e,i):j==="function"&&a.push(i);k&&e.resolveWith(k[0],k[1])}return this},resolveWith:function(e,f){if(!d&&!b&&!c){f=f||[],c=1;try{while(a[0])a.shift().apply(e,f)}finally{b=[e,f],c=0}}return this},resolve:function(){e.resolveWith(this,arguments);return this},isResolved:function(){return!!c||!!b},cancel:function(){d=1,a=[];return this}};return e},Deferred:function(a){var b=f._Deferred(),c=f._Deferred(),d;f.extend(b,{then:function(a,c){b.done(a).fail(c);return this},always:function(){return b.done.apply(b,arguments).fail.apply(this,arguments)},fail:c.done,rejectWith:c.resolveWith,reject:c.resolve,isRejected:c.isResolved,pipe:function(a,c){return f.Deferred(function(d){f.each({done:[a,"resolve"],fail:[c,"reject"]},function(a,c){var e=c[0],g=c[1],h;f.isFunction(e)?b[a](function(){h=e.apply(this,arguments),h&&f.isFunction(h.promise)?h.promise().then(d.resolve,d.reject):d[g](h)}):b[a](d[g])})}).promise()},promise:function(a){if(a==null){if(d)return d;d=a={}}var c=g.length;while(c--)a[g[c]]=b[g[c]];return a}}),b.done(c.cancel).fail(b.cancel),delete b.cancel,a&&a.call(b,b);return b},when:function(a){function i(a){return function(c){b[a]=arguments.length>1?h.call(arguments,0):c,--e||g.resolveWith(g,h.call(b,0))}}var b=arguments,c=0,d=b.length,e=d,g=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred();if(d>1){for(;c<d;c++)b[c]&&f.isFunction(b[c].promise)?b[c].promise().then(i(c),g.reject):--e;e||g.resolveWith(g,b)}else g!==a&&g.resolveWith(g,d?[a]:[]);return g.promise()}}),f.support=function(){var a=c.createElement("div"),b=c.documentElement,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r;a.setAttribute("className","t"),a.innerHTML=" <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>",d=a.getElementsByTagName("*"),e=a.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};f=c.createElement("select"),g=f.appendChild(c.createElement("option")),h=a.getElementsByTagName("input")[0],j={leadingWhitespace:a.firstChild.nodeType===3,tbody:!a.getElementsByTagName("tbody").length,htmlSerialize:!!a.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55$/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:h.value==="on",optSelected:g.selected,getSetAttribute:a.className!=="t",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},h.checked=!0,j.noCloneChecked=h.cloneNode(!0).checked,f.disabled=!0,j.optDisabled=!g.disabled;try{delete a.test}catch(s){j.deleteExpando=!1}!a.addEventListener&&a.attachEvent&&a.fireEvent&&(a.attachEvent("onclick",function b(){j.noCloneEvent=!1,a.detachEvent("onclick",b)}),a.cloneNode(!0).fireEvent("onclick")),h=c.createElement("input"),h.value="t",h.setAttribute("type","radio"),j.radioValue=h.value==="t",h.setAttribute("checked","checked"),a.appendChild(h),k=c.createDocumentFragment(),k.appendChild(a.firstChild),j.checkClone=k.cloneNode(!0).cloneNode(!0).lastChild.checked,a.innerHTML="",a.style.width=a.style.paddingLeft="1px",l=c.createElement("body"),m={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"};for(q in m)l.style[q]=m[q];l.appendChild(a),b.insertBefore(l,b.firstChild),j.appendChecked=h.checked,j.boxModel=a.offsetWidth===2,"zoom"in a.style&&(a.style.display="inline",a.style.zoom=1,j.inlineBlockNeedsLayout=a.offsetWidth===2,a.style.display="",a.innerHTML="<div style='width:4px;'></div>",j.shrinkWrapBlocks=a.offsetWidth!==2),a.innerHTML="<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>",n=a.getElementsByTagName("td"),r=n[0].offsetHeight===0,n[0].style.display="",n[1].style.display="none",j.reliableHiddenOffsets=r&&n[0].offsetHeight===0,a.innerHTML="",c.defaultView&&c.defaultView.getComputedStyle&&(i=c.createElement("div"),i.style.width="0",i.style.marginRight="0",a.appendChild(i),j.reliableMarginRight=(parseInt((c.defaultView.getComputedStyle(i,null)||{marginRight:0}).marginRight,10)||0)===0),l.innerHTML="",b.removeChild(l);if(a.attachEvent)for(q in{submit:1,change:1,focusin:1})p="on"+q,r=p in a,r||(a.setAttribute(p,"return;"),r=typeof a[p]=="function"),j[q+"Bubbles"]=r;return j}(),f.boxModel=f.support.boxModel;var i=/^(?:\{.*\}|\[.*\])$/,j=/([a-z])([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!l(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g=f.expando,h=typeof c=="string",i,j=a.nodeType,k=j?f.cache:a,l=j?a[f.expando]:a[f.expando]&&f.expando;if((!l||e&&l&&!k[l][g])&&h&&d===b)return;l||(j?a[f.expando]=l=++f.uuid:l=f.expando),k[l]||(k[l]={},j||(k[l].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?k[l][g]=f.extend(k[l][g],c):k[l]=f.extend(k[l],c);i=k[l],e&&(i[g]||(i[g]={}),i=i[g]),d!==b&&(i[f.camelCase(c)]=d);if(c==="events"&&!i[c])return i[g]&&i[g].events;return h?i[f.camelCase(c)]:i}},removeData:function(b,c,d){if(!!f.acceptData(b)){var e=f.expando,g=b.nodeType,h=g?f.cache:b,i=g?b[f.expando]:f.expando;if(!h[i])return;if(c){var j=d?h[i][e]:h[i];if(j){delete j[c];if(!l(j))return}}if(d){delete h[i][e];if(!l(h[i]))return}var k=h[i][e];f.support.deleteExpando||h!=a?delete h[i]:h[i]=null,k?(h[i]={},g||(h[i].toJSON=f.noop),h[i][e]=k):g&&(f.support.deleteExpando?delete b[f.expando]:b.removeAttribute?b.removeAttribute(f.expando):b[f.expando]=null)}},_data:function(a,b,c){return f.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=f.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),f.fn.extend({data:function(a,c){var d=null;if(typeof a=="undefined"){if(this.length){d=f.data(this[0]);if(this[0].nodeType===1){var e=this[0].attributes,g;for(var h=0,i=e.length;h<i;h++)g=e[h].name,g.indexOf("data-")===0&&(g=f.camelCase(g.substring(5)),k(this[0],g,d[g]))}}return d}if(typeof a=="object")return this.each(function(){f.data(this,a)});var j=a.split(".");j[1]=j[1]?"."+j[1]:"";if(c===b){d=this.triggerHandler("getData"+j[1]+"!",[j[0]]),d===b&&this.length&&(d=f.data(this[0],a),d=k(this[0],a,d));return d===b&&j[1]?this.data(j[0]):d}return this.each(function(){var b=f(this),d=[j[0],c];b.triggerHandler("setData"+j[1]+"!",d),f.data(this,a,c),b.triggerHandler("changeData"+j[1]+"!",d)})},removeData:function(a){return this.each(function(){f.removeData(this,a)})}}),f.extend({_mark:function(a,c){a&&(c=(c||"fx")+"mark",f.data(a,c,(f.data(a,c,b,!0)||0)+1,!0))},_unmark:function(a,c,d){a!==!0&&(d=c,c=a,a=!1);if(c){d=d||"fx";var e=d+"mark",g=a?0:(f.data(c,e,b,!0)||1)-1;g?f.data(c,e,g,!0):(f.removeData(c,e,!0),m(c,d,"mark"))}},queue:function(a,c,d){if(a){c=(c||"fx")+"queue";var e=f.data(a,c,b,!0);d&&(!e||f.isArray(d)?e=f.data(a,c,f.makeArray(d),!0):e.push(d));return e||[]}},dequeue:function(a,b){b=b||"fx";var c=f.queue(a,b),d=c.shift(),e;d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),d.call(a,function(){f.dequeue(a,b)})),c.length||(f.removeData(a,b+"queue",!0),m(a,b,"queue"))}}),f.fn.extend({queue:function(a,c){typeof a!="string"&&(c=a,a="fx");if(c===b)return f.queue(this[0],a);return this.each(function(){var b=f.queue(this,a,c);a==="fx"&&b[0]!=="inprogress"&&f.dequeue(this,a)})},dequeue:function(a){return this.each(function(){f.dequeue(this,a)})},delay:function(a,b){a=f.fx?f.fx.speeds[a]||a:a,b=b||"fx";return this.queue(b,function(){var c=this;setTimeout(function(){f.dequeue(c,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,c){function m(){--h||d.resolveWith(e,[e])}typeof a!="string"&&(c=a,a=b),a=a||"fx";var d=f.Deferred(),e=this,g=e.length,h=1,i=a+"defer",j=a+"queue",k=a+"mark",l;while(g--)if(l=f.data(e[g],i,b,!0)||(f.data(e[g],j,b,!0)||f.data(e[g],k,b,!0))&&f.data(e[g],i,f._Deferred(),!0))h++,l.done(m);m();return d.promise()}});var n=/[\n\t\r]/g,o=/\s+/,p=/\r/g,q=/^(?:button|input)$/i,r=/^(?:button|input|object|select|textarea)$/i,s=/^a(?:rea)?$/i,t=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,u=/\:/,v,w;f.fn.extend({attr:function(a,b){return f.access(this,a,b,!0,f.attr)},removeAttr:function(a){return this.each(function(){f.removeAttr(this,a)})},prop:function(a,b){return f.access(this,a,b,!0,f.prop)},removeProp:function(a){a=f.propFix[a]||a;return this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.addClass(a.call(this,b,c.attr("class")||""))});if(a&&typeof a=="string"){var b=(a||"").split(o);for(var c=0,d=this.length;c<d;c++){var e=this[c];if(e.nodeType===1)if(!e.className)e.className=a;else{var g=" "+e.className+" ",h=e.className;for(var i=0,j=b.length;i<j;i++)g.indexOf(" "+b[i]+" ")<0&&(h+=" "+b[i]);e.className=f.trim(h)}}}return this},removeClass:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.removeClass(a.call(this,b,c.attr("class")))});if(a&&typeof a=="string"||a===b){var c=(a||"").split(o);for(var d=0,e=this.length;d<e;d++){var g=this[d];if(g.nodeType===1&&g.className)if(a){var h=(" "+g.className+" ").replace(n," ");for(var i=0,j=c.length;i<j;i++)h=h.replace(" "+c[i]+" "," ");g.className=f.trim(h)}else g.className=""}}return this},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";if(f.isFunction(a))return this.each(function(c){var d=f(this);d.toggleClass(a.call(this,c,d.attr("class"),b),b)});return this.each(function(){if(c==="string"){var e,g=0,h=f(this),i=b,j=a.split(o);while(e=j[g++])i=d?i:!h.hasClass(e),h[i?"addClass":"removeClass"](e)}else if(c==="undefined"||c==="boolean")this.className&&f._data(this,"__className__",this.className),this.className=this.className||a===!1?"":f._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ";for(var c=0,d=this.length;c<d;c++)if((" "+this[c].className+" ").replace(n," ").indexOf(b)>-1)return!0;return!1},val:function(a){var c,d,e=this[0];if(!arguments.length){if(e){c=f.valHooks[e.nodeName.toLowerCase()]||f.valHooks[e.type];if(c&&"get"in c&&(d=c.get(e,"value"))!==b)return d;return(e.value||"").replace(p,"")}return b}var g=f.isFunction(a);return this.each(function(d){var e=f(this),h;if(this.nodeType===1){g?h=a.call(this,d,e.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c=a.selectedIndex,d=[],e=a.options,g=a.type==="select-one";if(c<0)return null;for(var h=g?c:0,i=g?c+1:e.length;h<i;h++){var j=e[h];if(j.selected&&(f.support.optDisabled?!j.disabled:j.getAttribute("disabled")===null)&&(!j.parentNode.disabled||!f.nodeName(j.parentNode,"optgroup"))){b=f(j).val();if(g)return b;d.push(b)}}if(g&&!d.length&&e.length)return f(e[c]).val();return d},set:function(a,b){var c=f.makeArray(b);f(a).find("option").each(function(){this.selected=f.inArray(f(this).val(),c)>=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attrFix:{tabindex:"tabIndex"},attr:function(a,c,d,e){var g=a.nodeType;if(!a||g===3||g===8||g===2)return b;if(e&&c in f.attrFn)return f(a)[c](d);if(!("getAttribute"in a))return f.prop(a,c,d);var h,i,j=g!==1||!f.isXMLDoc(a);c=j&&f.attrFix[c]||c,i=f.attrHooks[c],i||(!t.test(c)||typeof d!="boolean"&&d!==b&&d.toLowerCase()!==c.toLowerCase()?v&&(f.nodeName(a,"form")||u.test(c))&&(i=v):i=w);if(d!==b){if(d===null){f.removeAttr(a,c);return b}if(i&&"set"in i&&j&&(h=i.set(a,d,c))!==b)return h;a.setAttribute(c,""+d);return d}if(i&&"get"in i&&j)return i.get(a,c);h=a.getAttribute(c);return h===null?b:h},removeAttr:function(a,b){var c;a.nodeType===1&&(b=f.attrFix[b]||b,f.support.getSetAttribute?a.removeAttribute(b):(f.attr(a,b,""),a.removeAttributeNode(a.getAttributeNode(b))),t.test(b)&&(c=f.propFix[b]||b)in a&&(a[c]=!1))},attrHooks:{type:{set:function(a,b){if(q.test(a.nodeName)&&a.parentNode)f.error("type property can't be changed");else if(!f.support.radioValue&&b==="radio"&&f.nodeName(a,"input")){var c=a.value;a.setAttribute("type",b),c&&(a.value=c);return b}}},tabIndex:{get:function(a){var c=a.getAttributeNode("tabIndex");return c&&c.specified?parseInt(c.value,10):r.test(a.nodeName)||s.test(a.nodeName)&&a.href?0:b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e=a.nodeType;if(!a||e===3||e===8||e===2)return b;var g,h,i=e!==1||!f.isXMLDoc(a);c=i&&f.propFix[c]||c,h=f.propHooks[c];return d!==b?h&&"set"in h&&(g=h.set(a,d,c))!==b?g:a[c]=d:h&&"get"in h&&(g=h.get(a,c))!==b?g:a[c]},propHooks:{}}),w={get:function(a,c){return a[f.propFix[c]||c]?c.toLowerCase():b},set:function(a,b,c){var d;b===!1?f.removeAttr(a,c):(d=f.propFix[c]||c,d in a&&(a[d]=b),a.setAttribute(c,c.toLowerCase()));return c}},f.attrHooks.value={get:function(a,b){if(v&&f.nodeName(a,"button"))return v.get(a,b);return a.value},set:function(a,b,c){if(v&&f.nodeName(a,"button"))return v.set(a,b,c);a.value=b}},f.support.getSetAttribute||(f.attrFix=f.propFix,v=f.attrHooks.name=f.valHooks.button={get:function(a,c){var d;d=a.getAttributeNode(c);return d&&d.nodeValue!==""?d.nodeValue:b},set:function(a,b,c){var d=a.getAttributeNode(c);if(d){d.nodeValue=b;return b}}},f.each(["width","height"],function(a,b){f.attrHooks[b]=f.extend(f.attrHooks[b],{set:function(a,c){if(c===""){a.setAttribute(b,"auto");return c}}})})),f.support.hrefNormalized||f.each(["href","src","width","height"],function(a,c){f.attrHooks[c]=f.extend(f.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),f.support.style||(f.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=""+b}}),f.support.optSelected||(f.propHooks.selected=f.extend(f.propHooks.selected,{get:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex)}})),f.support.checkOn||f.each(["radio","checkbox"],function(){f.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),f.each(["radio","checkbox"],function(){f.valHooks[this]=f.extend(f.valHooks[this],{set:function(a,b){if(f.isArray(b))return a.checked=f.inArray(f(a).val(),b)>=0}})});var x=Object.prototype.hasOwnProperty,y=/\.(.*)$/,z=/^(?:textarea|input|select)$/i,A=/\./g,B=/ /g,C=/[^\w\s.|`]/g,D=function(a){return a.replace(C,"\\$&")};f.event={add:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){if(d===!1)d=E;else if(!d)return;var g,h;d.handler&&(g=d,d=g.handler),d.guid||(d.guid=f.guid++);var i=f._data(a);if(!i)return;var j=i.events,k=i.handle;j||(i.events=j={}),k||(i.handle=k=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.handle.apply(k.elem,arguments):b}),k.elem=a,c=c.split(" ");var l,m=0,n;while(l=c[m++]){h=g?f.extend({},g):{handler:d,data:e},l.indexOf(".")>-1?(n=l.split("."),l=n.shift(),h.namespace=n.slice(0).sort().join(".")):(n=[],h.namespace=""),h.type=l,h.guid||(h.guid=d.guid);var o=j[l],p=f.event.special[l]||{};if(!o){o=j[l]=[];if(!p.setup||p.setup.call(a,e,n,k)===!1)a.addEventListener?a.addEventListener(l,k,!1):a.attachEvent&&a.attachEvent("on"+l,k)}p.add&&(p.add.call(a,h),h.handler.guid||(h.handler.guid=d.guid)),o.push(h),f.event.global[l]=!0}a=null}},global:{},remove:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){d===!1&&(d=E);var g,h,i,j,k=0,l,m,n,o,p,q,r,s=f.hasData(a)&&f._data(a),t=s&&s.events;if(!s||!t)return;c&&c.type&&(d=c.handler,c=c.type);if(!c||typeof c=="string"&&c.charAt(0)==="."){c=c||"";for(h in t)f.event.remove(a,h+c);return}c=c.split(" ");while(h=c[k++]){r=h,q=null,l=h.indexOf(".")<0,m=[],l||(m=h.split("."),h=m.shift(),n=new RegExp("(^|\\.)"+f.map(m.slice(0).sort(),D).join("\\.(?:.*\\.)?")+"(\\.|$)")),p=t[h];if(!p)continue;if(!d){for(j=0;j<p.length;j++){q=p[j];if(l||n.test(q.namespace))f.event.remove(a,r,q.handler,j),p.splice(j--,1)}continue}o=f.event.special[h]||{};for(j=e||0;j<p.length;j++){q=p[j];if(d.guid===q.guid){if(l||n.test(q.namespace))e==null&&p.splice(j--,1),o.remove&&o.remove.call(a,q);if(e!=null)break}}if(p.length===0||e!=null&&p.length===1)(!o.teardown||o.teardown.call(a,m)===!1)&&f.removeEvent(a,h,s.handle),g=null,delete t[h]}if(f.isEmptyObject(t)){var u=s.handle;u&&(u.elem=null),delete s.events,delete s.handle,f.isEmptyObject(s)&&f.removeData(a,b,!0)}}},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(c,d,e,g){var h=c.type||c,i=[],j;h.indexOf("!")>=0&&(h=h.slice(0,-1),j=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if(!!e&&!f.event.customEvent[h]||!!f.event.global[h]){c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.exclusive=j,c.namespace=i.join("."),c.namespace_re=new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)");if(g||!e)c.preventDefault(),c.stopPropagation();if(!e){f.each(f.cache,function(){var a=f.expando,b=this[a];b&&b.events&&b.events[h]&&f.event.trigger(c,d,b.handle.elem
17
- )});return}if(e.nodeType===3||e.nodeType===8)return;c.result=b,c.target=e,d=d?f.makeArray(d):[],d.unshift(c);var k=e,l=h.indexOf(":")<0?"on"+h:"";do{var m=f._data(k,"handle");c.currentTarget=k,m&&m.apply(k,d),l&&f.acceptData(k)&&k[l]&&k[l].apply(k,d)===!1&&(c.result=!1,c.preventDefault()),k=k.parentNode||k.ownerDocument||k===c.target.ownerDocument&&a}while(k&&!c.isPropagationStopped());if(!c.isDefaultPrevented()){var n,o=f.event.special[h]||{};if((!o._default||o._default.call(e.ownerDocument,c)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)){try{l&&e[h]&&(n=e[l],n&&(e[l]=null),f.event.triggered=h,e[h]())}catch(p){}n&&(e[l]=n),f.event.triggered=b}}return c.result}},handle:function(c){c=f.event.fix(c||a.event);var d=((f._data(this,"events")||{})[c.type]||[]).slice(0),e=!c.exclusive&&!c.namespace,g=Array.prototype.slice.call(arguments,0);g[0]=c,c.currentTarget=this;for(var h=0,i=d.length;h<i;h++){var j=d[h];if(e||c.namespace_re.test(j.namespace)){c.handler=j.handler,c.data=j.data,c.handleObj=j;var k=j.handler.apply(this,g);k!==b&&(c.result=k,k===!1&&(c.preventDefault(),c.stopPropagation()));if(c.isImmediatePropagationStopped())break}}return c.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(a){if(a[f.expando])return a;var d=a;a=f.Event(d);for(var e=this.props.length,g;e;)g=this.props[--e],a[g]=d[g];a.target||(a.target=a.srcElement||c),a.target.nodeType===3&&(a.target=a.target.parentNode),!a.relatedTarget&&a.fromElement&&(a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement);if(a.pageX==null&&a.clientX!=null){var h=a.target.ownerDocument||c,i=h.documentElement,j=h.body;a.pageX=a.clientX+(i&&i.scrollLeft||j&&j.scrollLeft||0)-(i&&i.clientLeft||j&&j.clientLeft||0),a.pageY=a.clientY+(i&&i.scrollTop||j&&j.scrollTop||0)-(i&&i.clientTop||j&&j.clientTop||0)}a.which==null&&(a.charCode!=null||a.keyCode!=null)&&(a.which=a.charCode!=null?a.charCode:a.keyCode),!a.metaKey&&a.ctrlKey&&(a.metaKey=a.ctrlKey),!a.which&&a.button!==b&&(a.which=a.button&1?1:a.button&2?3:a.button&4?2:0);return a},guid:1e8,proxy:f.proxy,special:{ready:{setup:f.bindReady,teardown:f.noop},live:{add:function(a){f.event.add(this,O(a.origType,a.selector),f.extend({},a,{handler:N,guid:a.handler.guid}))},remove:function(a){f.event.remove(this,O(a.origType,a.selector),a)}},beforeunload:{setup:function(a,b,c){f.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}}},f.removeEvent=c.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){a.detachEvent&&a.detachEvent("on"+b,c)},f.Event=function(a,b){if(!this.preventDefault)return new f.Event(a,b);a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?F:E):this.type=a,b&&f.extend(this,b),this.timeStamp=f.now(),this[f.expando]=!0},f.Event.prototype={preventDefault:function(){this.isDefaultPrevented=F;var a=this.originalEvent;!a||(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=F;var a=this.originalEvent;!a||(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=F,this.stopPropagation()},isDefaultPrevented:E,isPropagationStopped:E,isImmediatePropagationStopped:E};var G=function(a){var b=a.relatedTarget;a.type=a.data;try{if(b&&b!==c&&!b.parentNode)return;while(b&&b!==this)b=b.parentNode;b!==this&&f.event.handle.apply(this,arguments)}catch(d){}},H=function(a){a.type=a.data,f.event.handle.apply(this,arguments)};f.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){f.event.special[a]={setup:function(c){f.event.add(this,b,c&&c.selector?H:G,a)},teardown:function(a){f.event.remove(this,b,a&&a.selector?H:G)}}}),f.support.submitBubbles||(f.event.special.submit={setup:function(a,b){if(!f.nodeName(this,"form"))f.event.add(this,"click.specialSubmit",function(a){var b=a.target,c=b.type;(c==="submit"||c==="image")&&f(b).closest("form").length&&L("submit",this,arguments)}),f.event.add(this,"keypress.specialSubmit",function(a){var b=a.target,c=b.type;(c==="text"||c==="password")&&f(b).closest("form").length&&a.keyCode===13&&L("submit",this,arguments)});else return!1},teardown:function(a){f.event.remove(this,".specialSubmit")}});if(!f.support.changeBubbles){var I,J=function(a){var b=a.type,c=a.value;b==="radio"||b==="checkbox"?c=a.checked:b==="select-multiple"?c=a.selectedIndex>-1?f.map(a.options,function(a){return a.selected}).join("-"):"":f.nodeName(a,"select")&&(c=a.selectedIndex);return c},K=function(c){var d=c.target,e,g;if(!!z.test(d.nodeName)&&!d.readOnly){e=f._data(d,"_change_data"),g=J(d),(c.type!=="focusout"||d.type!=="radio")&&f._data(d,"_change_data",g);if(e===b||g===e)return;if(e!=null||g)c.type="change",c.liveFired=b,f.event.trigger(c,arguments[1],d)}};f.event.special.change={filters:{focusout:K,beforedeactivate:K,click:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(c==="radio"||c==="checkbox"||f.nodeName(b,"select"))&&K.call(this,a)},keydown:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(a.keyCode===13&&!f.nodeName(b,"textarea")||a.keyCode===32&&(c==="checkbox"||c==="radio")||c==="select-multiple")&&K.call(this,a)},beforeactivate:function(a){var b=a.target;f._data(b,"_change_data",J(b))}},setup:function(a,b){if(this.type==="file")return!1;for(var c in I)f.event.add(this,c+".specialChange",I[c]);return z.test(this.nodeName)},teardown:function(a){f.event.remove(this,".specialChange");return z.test(this.nodeName)}},I=f.event.special.change.filters,I.focus=I.beforeactivate}f.support.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(a,b){function e(a){var c=f.event.fix(a);c.type=b,c.originalEvent={},f.event.trigger(c,null,c.target),c.isDefaultPrevented()&&a.preventDefault()}var d=0;f.event.special[b]={setup:function(){d++===0&&c.addEventListener(a,e,!0)},teardown:function(){--d===0&&c.removeEventListener(a,e,!0)}}}),f.each(["bind","one"],function(a,c){f.fn[c]=function(a,d,e){var g;if(typeof a=="object"){for(var h in a)this[c](h,d,a[h],e);return this}if(arguments.length===2||d===!1)e=d,d=b;c==="one"?(g=function(a){f(this).unbind(a,g);return e.apply(this,arguments)},g.guid=e.guid||f.guid++):g=e;if(a==="unload"&&c!=="one")this.one(a,d,e);else for(var i=0,j=this.length;i<j;i++)f.event.add(this[i],a,g,d);return this}}),f.fn.extend({unbind:function(a,b){if(typeof a=="object"&&!a.preventDefault)for(var c in a)this.unbind(c,a[c]);else for(var d=0,e=this.length;d<e;d++)f.event.remove(this[d],a,b);return this},delegate:function(a,b,c,d){return this.live(b,c,d,a)},undelegate:function(a,b,c){return arguments.length===0?this.unbind("live"):this.die(b,null,c,a)},trigger:function(a,b){return this.each(function(){f.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0])return f.event.trigger(a,b,this[0],!0)},toggle:function(a){var b=arguments,c=a.guid||f.guid++,d=0,e=function(c){var e=(f.data(this,"lastToggle"+a.guid)||0)%d;f.data(this,"lastToggle"+a.guid,e+1),c.preventDefault();return b[e].apply(this,arguments)||!1};e.guid=c;while(d<b.length)b[d++].guid=c;return this.click(e)},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var M={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};f.each(["live","die"],function(a,c){f.fn[c]=function(a,d,e,g){var h,i=0,j,k,l,m=g||this.selector,n=g?this:f(this.context);if(typeof a=="object"&&!a.preventDefault){for(var o in a)n[c](o,d,a[o],m);return this}if(c==="die"&&!a&&g&&g.charAt(0)==="."){n.unbind(g);return this}if(d===!1||f.isFunction(d))e=d||E,d=b;a=(a||"").split(" ");while((h=a[i++])!=null){j=y.exec(h),k="",j&&(k=j[0],h=h.replace(y,""));if(h==="hover"){a.push("mouseenter"+k,"mouseleave"+k);continue}l=h,M[h]?(a.push(M[h]+k),h=h+k):h=(M[h]||h)+k;if(c==="live")for(var p=0,q=n.length;p<q;p++)f.event.add(n[p],"live."+O(h,m),{data:d,selector:m,handler:e,origType:h,origHandler:e,preType:l});else n.unbind("live."+O(h,m),e)}return this}}),f.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "),function(a,b){f.fn[b]=function(a,c){c==null&&(c=a,a=null);return arguments.length>0?this.bind(b,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0)}),function(){function u(a,b,c,d,e,f){for(var g=0,h=d.length;g<h;g++){var i=d[g];if(i){var j=!1;i=i[a];while(i){if(i.sizcache===c){j=d[i.sizset];break}if(i.nodeType===1){f||(i.sizcache=c,i.sizset=g);if(typeof b!="string"){if(i===b){j=!0;break}}else if(k.filter(b,[i]).length>0){j=i;break}}i=i[a]}d[g]=j}}}function t(a,b,c,d,e,f){for(var g=0,h=d.length;g<h;g++){var i=d[g];if(i){var j=!1;i=i[a];while(i){if(i.sizcache===c){j=d[i.sizset];break}i.nodeType===1&&!f&&(i.sizcache=c,i.sizset=g);if(i.nodeName.toLowerCase()===b){j=i;break}i=i[a]}d[g]=j}}}var a=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d=0,e=Object.prototype.toString,g=!1,h=!0,i=/\\/g,j=/\W/;[0,0].sort(function(){h=!1;return 0});var k=function(b,d,f,g){f=f||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return f;var i,j,n,o,q,r,s,t,u=!0,w=k.isXML(d),x=[],y=b;do{a.exec(""),i=a.exec(y);if(i){y=i[3],x.push(i[1]);if(i[2]){o=i[3];break}}}while(i);if(x.length>1&&m.exec(b))if(x.length===2&&l.relative[x[0]])j=v(x[0]+x[1],d);else{j=l.relative[x[0]]?[d]:k(x.shift(),d);while(x.length)b=x.shift(),l.relative[b]&&(b+=x.shift()),j=v(b,j)}else{!g&&x.length>1&&d.nodeType===9&&!w&&l.match.ID.test(x[0])&&!l.match.ID.test(x[x.length-1])&&(q=k.find(x.shift(),d,w),d=q.expr?k.filter(q.expr,q.set)[0]:q.set[0]);if(d){q=g?{expr:x.pop(),set:p(g)}:k.find(x.pop(),x.length===1&&(x[0]==="~"||x[0]==="+")&&d.parentNode?d.parentNode:d,w),j=q.expr?k.filter(q.expr,q.set):q.set,x.length>0?n=p(j):u=!1;while(x.length)r=x.pop(),s=r,l.relative[r]?s=x.pop():r="",s==null&&(s=d),l.relative[r](n,s,w)}else n=x=[]}n||(n=j),n||k.error(r||b);if(e.call(n)==="[object Array]")if(!u)f.push.apply(f,n);else if(d&&d.nodeType===1)for(t=0;n[t]!=null;t++)n[t]&&(n[t]===!0||n[t].nodeType===1&&k.contains(d,n[t]))&&f.push(j[t]);else for(t=0;n[t]!=null;t++)n[t]&&n[t].nodeType===1&&f.push(j[t]);else p(n,f);o&&(k(o,h,f,g),k.uniqueSort(f));return f};k.uniqueSort=function(a){if(r){g=h,a.sort(r);if(g)for(var b=1;b<a.length;b++)a[b]===a[b-1]&&a.splice(b--,1)}return a},k.matches=function(a,b){return k(a,null,null,b)},k.matchesSelector=function(a,b){return k(b,null,null,[a]).length>0},k.find=function(a,b,c){var d;if(!a)return[];for(var e=0,f=l.order.length;e<f;e++){var g,h=l.order[e];if(g=l.leftMatch[h].exec(a)){var j=g[1];g.splice(1,1);if(j.substr(j.length-1)!=="\\"){g[1]=(g[1]||"").replace(i,""),d=l.find[h](g,b,c);if(d!=null){a=a.replace(l.match[h],"");break}}}}d||(d=typeof b.getElementsByTagName!="undefined"?b.getElementsByTagName("*"):[]);return{set:d,expr:a}},k.filter=function(a,c,d,e){var f,g,h=a,i=[],j=c,m=c&&c[0]&&k.isXML(c[0]);while(a&&c.length){for(var n in l.filter)if((f=l.leftMatch[n].exec(a))!=null&&f[2]){var o,p,q=l.filter[n],r=f[1];g=!1,f.splice(1,1);if(r.substr(r.length-1)==="\\")continue;j===i&&(i=[]);if(l.preFilter[n]){f=l.preFilter[n](f,j,d,i,e,m);if(!f)g=o=!0;else if(f===!0)continue}if(f)for(var s=0;(p=j[s])!=null;s++)if(p){o=q(p,f,s,j);var t=e^!!o;d&&o!=null?t?g=!0:j[s]=!1:t&&(i.push(p),g=!0)}if(o!==b){d||(j=i),a=a.replace(l.match[n],"");if(!g)return[];break}}if(a===h)if(g==null)k.error(a);else break;h=a}return j},k.error=function(a){throw"Syntax error, unrecognized expression: "+a};var l=k.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(a){return a.getAttribute("href")},type:function(a){return a.getAttribute("type")}},relative:{"+":function(a,b){var c=typeof b=="string",d=c&&!j.test(b),e=c&&!d;d&&(b=b.toLowerCase());for(var f=0,g=a.length,h;f<g;f++)if(h=a[f]){while((h=h.previousSibling)&&h.nodeType!==1);a[f]=e||h&&h.nodeName.toLowerCase()===b?h||!1:h===b}e&&k.filter(b,a,!0)},">":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!j.test(b)){b=b.toLowerCase();for(;e<f;e++){c=a[e];if(c){var g=c.parentNode;a[e]=g.nodeName.toLowerCase()===b?g:!1}}}else{for(;e<f;e++)c=a[e],c&&(a[e]=d?c.parentNode:c.parentNode===b);d&&k.filter(b,a,!0)}},"":function(a,b,c){var e,f=d++,g=u;typeof b=="string"&&!j.test(b)&&(b=b.toLowerCase(),e=b,g=t),g("parentNode",b,f,a,e,c)},"~":function(a,b,c){var e,f=d++,g=u;typeof b=="string"&&!j.test(b)&&(b=b.toLowerCase(),e=b,g=t),g("previousSibling",b,f,a,e,c)}},find:{ID:function(a,b,c){if(typeof b.getElementById!="undefined"&&!c){var d=b.getElementById(a[1]);return d&&d.parentNode?[d]:[]}},NAME:function(a,b){if(typeof b.getElementsByName!="undefined"){var c=[],d=b.getElementsByName(a[1]);for(var e=0,f=d.length;e<f;e++)d[e].getAttribute("name")===a[1]&&c.push(d[e]);return c.length===0?null:c}},TAG:function(a,b){if(typeof b.getElementsByTagName!="undefined")return b.getElementsByTagName(a[1])}},preFilter:{CLASS:function(a,b,c,d,e,f){a=" "+a[1].replace(i,"")+" ";if(f)return a;for(var g=0,h;(h=b[g])!=null;g++)h&&(e^(h.className&&(" "+h.className+" ").replace(/[\t\n\r]/g," ").indexOf(a)>=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(i,"")},TAG:function(a,b){return a[1].replace(i,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||k.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&k.error(a[0]);a[0]=d++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(i,"");!f&&l.attrMap[g]&&(a[1]=l.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(i,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=k(b[3],null,null,c);else{var g=k.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(l.match.POS.test(b[0])||l.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!k(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return b<c[3]-0},gt:function(a,b,c){return b>c[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=l.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||k.getText([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h<i;h++)if(g[h]===a)return!1;return!0}k.error(e)},CHILD:function(a,b){var c=b[1],d=a;switch(c){case"only":case"first":while(d=d.previousSibling)if(d.nodeType===1)return!1;if(c==="first")return!0;d=a;case"last":while(d=d.nextSibling)if(d.nodeType===1)return!1;return!0;case"nth":var e=b[2],f=b[3];if(e===1&&f===0)return!0;var g=b[0],h=a.parentNode;if(h&&(h.sizcache!==g||!a.nodeIndex)){var i=0;for(d=h.firstChild;d;d=d.nextSibling)d.nodeType===1&&(d.nodeIndex=++i);h.sizcache=g}var j=a.nodeIndex-f;return e===0?j===0:j%e===0&&j/e>=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=l.attrHandle[c]?l.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=l.setFilters[e];if(f)return f(a,c,b,d)}}},m=l.match.POS,n=function(a,b){return"\\"+(b-0+1)};for(var o in l.match)l.match[o]=new RegExp(l.match[o].source+/(?![^\[]*\])(?![^\(]*\))/.source),l.leftMatch[o]=new RegExp(/(^(?:.|\r|\n)*?)/.source+l.match[o].source.replace(/\\(\d+)/g,n));var p=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(q){p=function(a,b){var c=0,d=b||[];if(e.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var f=a.length;c<f;c++)d.push(a[c]);else for(;a[c];c++)d.push(a[c]);return d}}var r,s;c.documentElement.compareDocumentPosition?r=function(a,b){if(a===b){g=!0;return 0}if(!a.compareDocumentPosition||!b.compareDocumentPosition)return a.compareDocumentPosition?-1:1;return a.compareDocumentPosition(b)&4?-1:1}:(r=function(a,b){if(a===b){g=!0;return 0}if(a.sourceIndex&&b.sourceIndex)return a.sourceIndex-b.sourceIndex;var c,d,e=[],f=[],h=a.parentNode,i=b.parentNode,j=h;if(h===i)return s(a,b);if(!h)return-1;if(!i)return 1;while(j)e.unshift(j),j=j.parentNode;j=i;while(j)f.unshift(j),j=j.parentNode;c=e.length,d=f.length;for(var k=0;k<c&&k<d;k++)if(e[k]!==f[k])return s(e[k],f[k]);return k===c?s(a,f[k],-1):s(e[k],b,1)},s=function(a,b,c){if(a===b)return c;var d=a.nextSibling;while(d){if(d===b)return-1;d=d.nextSibling}return 1}),k.getText=function(a){var b="",c;for(var d=0;a[d];d++)c=a[d],c.nodeType===3||c.nodeType===4?b+=c.nodeValue:c.nodeType!==8&&(b+=k.getText(c.childNodes));return b},function(){var a=c.createElement("div"),d="script"+(new Date).getTime(),e=c.documentElement;a.innerHTML="<a name='"+d+"'/>",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(l.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},l.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(l.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="<a href='#'></a>",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(l.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=k,b=c.createElement("div"),d="__sizzle__";b.innerHTML="<p class='TEST'></p>";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){k=function(b,e,f,g){e=e||c;if(!g&&!k.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return p(e.getElementsByTagName(b),f);if(h[2]&&l.find.CLASS&&e.getElementsByClassName)return p(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return p([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return p([],f);if(i.id===h[3])return p([i],f)}try{return p(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var m=e,n=e.getAttribute("id"),o=n||d,q=e.parentNode,r=/^\s*[+~]/.test(b);n?o=o.replace(/'/g,"\\$&"):e.setAttribute("id",o),r&&q&&(e=e.parentNode);try{if(!r||q)return p(e.querySelectorAll("[id='"+o+"'] "+b),f)}catch(s){}finally{n||m.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)k[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}k.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(a))try{if(e||!l.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return k(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="<div class='test e'></div><div class='test'></div>";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;l.order.splice(1,0,"CLASS"),l.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?k.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?k.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:k.contains=function(){return!1},k.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var v=function(a,b){var c,d=[],e="",f=b.nodeType?[b]:b;while(c=l.match.PSEUDO.exec(a))e+=c[0],a=a.replace(l.match.PSEUDO,"");a=l.relative[a]?a+"*":a;for(var g=0,h=f.length;g<h;g++)k(a,f[g],d);return k.filter(e,d)};f.find=k,f.expr=k.selectors,f.expr[":"]=f.expr.filters,f.unique=k.uniqueSort,f.text=k.getText,f.isXMLDoc=k.isXML,f.contains=k.contains}();var P=/Until$/,Q=/^(?:parents|prevUntil|prevAll)/,R=/,/,S=/^.[^:#\[\.,]*$/,T=Array.prototype.slice,U=f.expr.match.POS,V={children:!0,contents:!0,next:!0,prev:!0};f.fn.extend({find:function(a){var b=this,c,d;if(typeof a!="string")return f(a).filter(function(){for(c=0,d=b.length;c<d;c++)if(f.contains(b[c],this))return!0});var e=this.pushStack("","find",a),g,h,i;for(c=0,d=this.length;c<d;c++){g=e.length,f.find(a,this[c],e);if(c>0)for(h=g;h<e.length;h++)for(i=0;i<g;i++)if(e[i]===e[h]){e.splice(h--,1);break}}return e},has:function(a){var b=f(a);return this.filter(function(){for(var a=0,c=b.length;a<c;a++)if(f.contains(this,b[a]))return!0})},not:function(a){return this.pushStack(X(this,a,!1),"not",a)},filter:function(a){return this.pushStack(X(this,a,!0),"filter",a)},is:function(a){return!!a&&(typeof a=="string"?f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h,i,j={},k=1;if(g&&a.length){for(d=0,e=a.length;d<e;d++)i=a[d],j[i]||(j[i]=U.test(i)?f(i,b||this.context):i);while(g&&g.ownerDocument&&g!==b){for(i in j)h=j[i],(h.jquery?h.index(g)>-1:f(g).is(h))&&c.push({selector:i,elem:g,level:k});g=g.parentNode,k++}}return c}var l=U.test(a)||typeof a!="string"?f(a,b||this.context):0;for(d=0,e=this.length;d<e;d++){g=this[d];while(g){if(l?l.index(g)>-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a||typeof a=="string")return f.inArray(this[0],a?f(a):this.parent().children());return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(W(c[0])||W(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c),g=T.call(arguments);P.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!V[a]?f.unique(e):e,(this.length>1||R.test(d))&&Q.test(a)&&(e=e.reverse());return this.pushStack(e,a,g.join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var Y=/ jQuery\d+="(?:\d+|null)"/g,Z=/^\s+/,$=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,_=/<([\w:]+)/,ba=/<tbody/i,bb=/<|&#?\w+;/,bc=/<(?:script|object|embed|option|style)/i,bd=/checked\s*(?:[^=]|=\s*.checked.)/i,be=/\/(java|ecma)script/i,bf=/^\s*<!(?:\[CDATA\[|\-\-)/,bg={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div<div>","</div>"]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){f(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f(arguments[0]).toArray());return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(Y,""):null;if(typeof a=="string"&&!bc.test(a)&&(f.support.leadingWhitespace||!Z.test(a))&&!bg[(_.exec(a)||["",""])[1].toLowerCase()]){a=a.replace($,"<$1></$2>");try{for(var c=0,d=this.length;c<d;c++)this[c].nodeType===1&&(f.cleanData(this[c].getElementsByTagName("*")),this[c].innerHTML=a)}catch(e){this.empty().append(a)}}else f.isFunction(a)?this.each(function(b){var c=f(this);c.html(a.call(this,b,c.html()))}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(f.isFunction(a))return this.each(function(b){var c=f(this),d=c.html();c.replaceWith(a.call(this,b,d))});typeof a!="string"&&(a=f(a).detach());return this.each(function(){var b=this.nextSibling,c=this.parentNode;f(this).remove(),b?f(b).before(a):f(c).append(a)})}return this.length?this.pushStack(f(f.isFunction(a)?a():a),"replaceWith",a):this},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,d){var e,g,h,i,j=a[0],k=[];if(!f.support.checkClone&&arguments.length===3&&typeof j=="string"&&bd.test(j))return this.each(function(){f(this).domManip(a,c,d,!0)});if(f.isFunction(j))return this.each(function(e){var g=f(this);a[0]=j.call(this,e,c?g.html():b),g.domManip(a,c,d)});if(this[0]){i=j&&j.parentNode,f.support.parentNode&&i&&i.nodeType===11&&i.childNodes.length===this.length?e={fragment:i}:e=f.buildFragment(a,this,k),h=e.fragment,h.childNodes.length===1?g=h=h.firstChild:g=h.firstChild;if(g){c=c&&f.nodeName(g,"tr");for(var l=0,m=this.length,n=m-1;l<m;l++)d.call(c?bh(this[l],g):this[l],e.cacheable||m>1&&l<n?f.clone(h,!0,!0):h)}k.length&&f.each(k,bn)}return this}}),f.buildFragment=function(a,b,d){var e,g,h,i=b&&b[0]?b[0].ownerDocument||b[0]:c;a.length===1&&typeof a[0]=="string"&&a[0].length<512&&i===c&&a[0].charAt(0)==="<"&&!bc.test(a[0])&&(f.support.checkClone||!bd.test(a[0]))&&(g=!0,h=f.fragments[a[0]],h&&h!==1&&(e=h)),e||(e=i.createDocumentFragment(),f.clean(a,i,e,d)),g&&(f.fragments[a[0]]=h?e:1);return{fragment:e,cacheable:g}},f.fragments={},f.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){f.fn[a]=function(c){var d=[],e=f(c),g=this.length===1&&this[0].parentNode;if(g&&g.nodeType===11&&g.childNodes.length===1&&e.length===1){e[b](this[0]);return this}for(var h=0,i=e.length;h<i;h++){var j=(h>0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d=a.cloneNode(!0),e,g,h;if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bj(a,d),e=bk(a),g=bk(d);for(h=0;e[h];++h)bj(e[h],g[h])}if(b){bi(a,d);if(c){e=bk(a),g=bk(d);for(h=0;e[h];++h)bi(e[h],g[h])}}return d},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||
18
- b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!bb.test(k))k=b.createTextNode(k);else{k=k.replace($,"<$1></$2>");var l=(_.exec(k)||["",""])[1].toLowerCase(),m=bg[l]||bg._default,n=m[0],o=b.createElement("div");o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=ba.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]==="<table>"&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&Z.test(k)&&o.insertBefore(b.createTextNode(Z.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i<r;i++)bm(k[i]);else bm(k);k.nodeType?h.push(k):h=f.merge(h,k)}if(d){g=function(a){return!a.type||be.test(a.type)};for(j=0;h[j];j++)if(e&&f.nodeName(h[j],"script")&&(!h[j].type||h[j].type.toLowerCase()==="text/javascript"))e.push(h[j].parentNode?h[j].parentNode.removeChild(h[j]):h[j]);else{if(h[j].nodeType===1){var s=f.grep(h[j].getElementsByTagName("script"),g);h.splice.apply(h,[j+1,0].concat(s))}d.appendChild(h[j])}}return h},cleanData:function(a){var b,c,d=f.cache,e=f.expando,g=f.event.special,h=f.support.deleteExpando;for(var i=0,j;(j=a[i])!=null;i++){if(j.nodeName&&f.noData[j.nodeName.toLowerCase()])continue;c=j[f.expando];if(c){b=d[c]&&d[c][e];if(b&&b.events){for(var k in b.events)g[k]?f.event.remove(j,k):f.removeEvent(j,k,b.handle);b.handle&&(b.handle.elem=null)}h?delete j[f.expando]:j.removeAttribute&&j.removeAttribute(f.expando),delete d[c]}}}});var bo=/alpha\([^)]*\)/i,bp=/opacity=([^)]*)/,bq=/-([a-z])/ig,br=/([A-Z]|^ms)/g,bs=/^-?\d+(?:px)?$/i,bt=/^-?\d/,bu=/^[+\-]=/,bv=/[^+\-\.\de]+/g,bw={position:"absolute",visibility:"hidden",display:"block"},bx=["Left","Right"],by=["Top","Bottom"],bz,bA,bB,bC=function(a,b){return b.toUpperCase()};f.fn.css=function(a,c){if(arguments.length===2&&c===b)return this;return f.access(this,a,c,!0,function(a,c,d){return d!==b?f.style(a,c,d):f.css(a,c)})},f.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=bz(a,"opacity","opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{zIndex:!0,fontWeight:!0,opacity:!0,zoom:!0,lineHeight:!0,widows:!0,orphans:!0},cssProps:{"float":f.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!!a&&a.nodeType!==3&&a.nodeType!==8&&!!a.style){var g,h,i=f.camelCase(c),j=a.style,k=f.cssHooks[i];c=f.cssProps[i]||i;if(d===b){if(k&&"get"in k&&(g=k.get(a,!1,e))!==b)return g;return j[c]}h=typeof d;if(h==="number"&&isNaN(d)||d==null)return;h==="string"&&bu.test(d)&&(d=+d.replace(bv,"")+parseFloat(f.css(a,c))),h==="number"&&!f.cssNumber[i]&&(d+="px");if(!k||!("set"in k)||(d=k.set(a,d))!==b)try{j[c]=d}catch(l){}}},css:function(a,c,d){var e,g;c=f.camelCase(c),g=f.cssHooks[c],c=f.cssProps[c]||c,c==="cssFloat"&&(c="float");if(g&&"get"in g&&(e=g.get(a,!0,d))!==b)return e;if(bz)return bz(a,c)},swap:function(a,b,c){var d={};for(var e in b)d[e]=a.style[e],a.style[e]=b[e];c.call(a);for(e in b)a.style[e]=d[e]},camelCase:function(a){return a.replace(bq,bC)}}),f.curCSS=f.css,f.each(["height","width"],function(a,b){f.cssHooks[b]={get:function(a,c,d){var e;if(c){a.offsetWidth!==0?e=bD(a,b,d):f.swap(a,bw,function(){e=bD(a,b,d)});if(e<=0){e=bz(a,b,b),e==="0px"&&bB&&(e=bB(a,b,b));if(e!=null)return e===""||e==="auto"?"0px":e}if(e<0||e==null){e=a.style[b];return e===""||e==="auto"?"0px":e}return typeof e=="string"?e:e+"px"}},set:function(a,b){if(!bs.test(b))return b;b=parseFloat(b);if(b>=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bp.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle;c.zoom=1;var e=f.isNaN(b)?"":"alpha(opacity="+b*100+")",g=d&&d.filter||c.filter||"";c.filter=bo.test(g)?g.replace(bo,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bz(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bA=function(a,c){var d,e,g;c=c.replace(br,"-$1").toLowerCase();if(!(e=a.ownerDocument.defaultView))return b;if(g=e.getComputedStyle(a,null))d=g.getPropertyValue(c),d===""&&!f.contains(a.ownerDocument.documentElement,a)&&(d=f.style(a,c));return d}),c.documentElement.currentStyle&&(bB=function(a,b){var c,d=a.currentStyle&&a.currentStyle[b],e=a.runtimeStyle&&a.runtimeStyle[b],f=a.style;!bs.test(d)&&bt.test(d)&&(c=f.left,e&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":d||0,d=f.pixelLeft+"px",f.left=c,e&&(a.runtimeStyle.left=e));return d===""?"auto":d}),bz=bA||bB,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bE=/%20/g,bF=/\[\]$/,bG=/\r?\n/g,bH=/#.*$/,bI=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bJ=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bK=/^(?:about|app|app\-storage|.+\-extension|file|widget):$/,bL=/^(?:GET|HEAD)$/,bM=/^\/\//,bN=/\?/,bO=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,bP=/^(?:select|textarea)/i,bQ=/\s+/,bR=/([?&])_=[^&]*/,bS=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bT=f.fn.load,bU={},bV={},bW,bX;try{bW=e.href}catch(bY){bW=c.createElement("a"),bW.href="",bW=bW.href}bX=bS.exec(bW.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bT)return bT.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("<div>").append(c.replace(bO,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bP.test(this.nodeName)||bJ.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bG,"\r\n")}}):{name:b.name,value:c.replace(bG,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.bind(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?f.extend(!0,a,f.ajaxSettings,b):(b=a,a=f.extend(!0,f.ajaxSettings,b));for(var c in{context:1,url:1})c in b?a[c]=b[c]:c in f.ajaxSettings&&(a[c]=f.ajaxSettings[c]);return a},ajaxSettings:{url:bW,isLocal:bK.test(bX[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":"*/*"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML}},ajaxPrefilter:bZ(bU),ajaxTransport:bZ(bV),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a?4:0;var o,r,u,w=l?ca(d,v,l):b,x,y;if(a>=200&&a<300||a===304){if(d.ifModified){if(x=v.getResponseHeader("Last-Modified"))f.lastModified[k]=x;if(y=v.getResponseHeader("Etag"))f.etag[k]=y}if(a===304)c="notmodified",o=!0;else try{r=cb(d,w),c="success",o=!0}catch(z){c="parsererror",u=z}}else{u=c;if(!c||a)c="error",a<0&&(a=0)}v.status=a,v.statusText=c,o?h.resolveWith(e,[r,c,v]):h.rejectWith(e,[v,c,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.resolveWith(e,[v,c]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f._Deferred(),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bI.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.done,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bH,"").replace(bM,bX[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bQ),d.crossDomain==null&&(r=bS.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bX[1]&&r[2]==bX[2]&&(r[3]||(r[1]==="http:"?80:443))==(bX[3]||(bX[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),b$(bU,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bL.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bN.test(d.url)?"&":"?")+d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bR,"$1_="+x);d.url=y+(y===d.url?(bN.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", */*; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=b$(bV,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){status<2?w(-1,z):f.error(z)}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)b_(g,a[g],c,e);return d.join("&").replace(bE,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cc=f.now(),cd=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cc++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(cd.test(b.url)||e&&cd.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(cd,l),b.url===j&&(e&&(k=k.replace(cd,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var ce=a.ActiveXObject?function(){for(var a in cg)cg[a](0,1)}:!1,cf=0,cg;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ch()||ci()}:ch,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,ce&&delete cg[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cf,ce&&(cg||(cg={},f(a).unload(ce)),cg[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var cj={},ck,cl,cm=/^(?:toggle|show|hide)$/,cn=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,co,cp=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cq,cr=a.webkitRequestAnimationFrame||a.mozRequestAnimationFrame||a.oRequestAnimationFrame;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cu("show",3),a,b,c);for(var g=0,h=this.length;g<h;g++)d=this[g],d.style&&(e=d.style.display,!f._data(d,"olddisplay")&&e==="none"&&(e=d.style.display=""),e===""&&f.css(d,"display")==="none"&&f._data(d,"olddisplay",cv(d.nodeName)));for(g=0;g<h;g++){d=this[g];if(d.style){e=d.style.display;if(e===""||e==="none")d.style.display=f._data(d,"olddisplay")||""}}return this},hide:function(a,b,c){if(a||a===0)return this.animate(cu("hide",3),a,b,c);for(var d=0,e=this.length;d<e;d++)if(this[d].style){var g=f.css(this[d],"display");g!=="none"&&!f._data(this[d],"olddisplay")&&f._data(this[d],"olddisplay",g)}for(d=0;d<e;d++)this[d].style&&(this[d].style.display="none");return this},_toggle:f.fn.toggle,toggle:function(a,b,c){var d=typeof a=="boolean";f.isFunction(a)&&f.isFunction(b)?this._toggle.apply(this,arguments):a==null||d?this.each(function(){var b=d?a:f(this).is(":hidden");f(this)[b?"show":"hide"]()}):this.animate(cu("toggle",3),a,b,c);return this},fadeTo:function(a,b,c,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=f.speed(b,c,d);if(f.isEmptyObject(a))return this.each(e.complete,[!1]);a=f.extend({},a);return this[e.queue===!1?"each":"queue"](function(){e.queue===!1&&f._mark(this);var b=f.extend({},e),c=this.nodeType===1,d=c&&f(this).is(":hidden"),g,h,i,j,k,l,m,n,o;b.animatedProperties={};for(i in a){g=f.camelCase(i),i!==g&&(a[g]=a[i],delete a[i]),h=a[g],f.isArray(h)?(b.animatedProperties[g]=h[1],h=a[g]=h[0]):b.animatedProperties[g]=b.specialEasing&&b.specialEasing[g]||b.easing||"swing";if(h==="hide"&&d||h==="show"&&!d)return b.complete.call(this);c&&(g==="height"||g==="width")&&(b.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY],f.css(this,"display")==="inline"&&f.css(this,"float")==="none"&&(f.support.inlineBlockNeedsLayout?(j=cv(this.nodeName),j==="inline"?this.style.display="inline-block":(this.style.display="inline",this.style.zoom=1)):this.style.display="inline-block"))}b.overflow!=null&&(this.style.overflow="hidden");for(i in a)k=new f.fx(this,b,i),h=a[i],cm.test(h)?k[h==="toggle"?d?"show":"hide":h]():(l=cn.exec(h),m=k.cur(),l?(n=parseFloat(l[2]),o=l[3]||(f.cssNumber[i]?"":"px"),o!=="px"&&(f.style(this,i,(n||1)+o),m=(n||1)/k.cur()*m,f.style(this,i,m+o)),l[1]&&(n=(l[1]==="-="?-1:1)*n+m),k.custom(m,n,o)):k.custom(m,h,""));return!0})},stop:function(a,b){a&&this.queue([]),this.each(function(){var a=f.timers,c=a.length;b||f._unmark(!0,this);while(c--)a[c].elem===this&&(b&&a[c](!0),a.splice(c,1))}),b||this.dequeue();return this}}),f.each({slideDown:cu("show",1),slideUp:cu("hide",1),slideToggle:cu("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){f.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),f.extend({speed:function(a,b,c){var d=a&&typeof a=="object"?f.extend({},a):{complete:c||!c&&b||f.isFunction(a)&&a,duration:a,easing:c&&b||b&&!f.isFunction(b)&&b};d.duration=f.fx.off?0:typeof d.duration=="number"?d.duration:d.duration in f.fx.speeds?f.fx.speeds[d.duration]:f.fx.speeds._default,d.old=d.complete,d.complete=function(a){d.queue!==!1?f.dequeue(this):a!==!1&&f._unmark(this),f.isFunction(d.old)&&d.old.call(this)};return d},easing:{linear:function(a,b,c,d){return c+d*a},swing:function(a,b,c,d){return(-Math.cos(a*Math.PI)/2+.5)*d+c}},timers:[],fx:function(a,b,c){this.options=b,this.elem=a,this.prop=c,b.orig=b.orig||{}}}),f.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this),(f.fx.step[this.prop]||f.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a,b=f.css(this.elem,this.prop);return isNaN(a=parseFloat(b))?!b||b==="auto"?0:b:a},custom:function(a,b,c){function h(a){return d.step(a)}var d=this,e=f.fx,g;this.startTime=cq||cs(),this.start=a,this.end=b,this.unit=c||this.unit||(f.cssNumber[this.prop]?"":"px"),this.now=this.start,this.pos=this.state=0,h.elem=this.elem,h()&&f.timers.push(h)&&!co&&(cr?(co=1,g=function(){co&&(cr(g),e.tick())},cr(g)):co=setInterval(e.tick,e.interval))},show:function(){this.options.orig[this.prop]=f.style(this.elem,this.prop),this.options.show=!0,this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur()),f(this.elem).show()},hide:function(){this.options.orig[this.prop]=f.style(this.elem,this.prop),this.options.hide=!0,this.custom(this.cur(),0)},step:function(a){var b=cq||cs(),c=!0,d=this.elem,e=this.options,g,h;if(a||b>=e.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),e.animatedProperties[this.prop]=!0;for(g in e.animatedProperties)e.animatedProperties[g]!==!0&&(c=!1);if(c){e.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){d.style["overflow"+b]=e.overflow[a]}),e.hide&&f(d).hide();if(e.hide||e.show)for(var i in e.animatedProperties)f.style(d,i,e.orig[i]);e.complete.call(d)}return!1}e.duration==Infinity?this.now=b:(h=b-this.startTime,this.state=h/e.duration,this.pos=f.easing[e.animatedProperties[this.prop]](this.state,h,0,1,e.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){for(var a=f.timers,b=0;b<a.length;++b)a[b]()||a.splice(b--,1);a.length||f.fx.stop()},interval:13,stop:function(){clearInterval(co),co=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){f.style(a.elem,"opacity",a.now)},_default:function(a){a.elem.style&&a.elem.style[a.prop]!=null?a.elem.style[a.prop]=(a.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit:a.elem[a.prop]=a.now}}}),f.expr&&f.expr.filters&&(f.expr.filters.animated=function(a){return f.grep(f.timers,function(b){return a===b.elem}).length});var cw=/^t(?:able|d|h)$/i,cx=/^(?:body|html)$/i;"getBoundingClientRect"in c.documentElement?f.fn.offset=function(a){var b=this[0],c;if(a)return this.each(function(b){f.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return f.offset.bodyOffset(b);try{c=b.getBoundingClientRect()}catch(d){}var e=b.ownerDocument,g=e.documentElement;if(!c||!f.contains(g,b))return c?{top:c.top,left:c.left}:{top:0,left:0};var h=e.body,i=cy(e),j=g.clientTop||h.clientTop||0,k=g.clientLeft||h.clientLeft||0,l=i.pageYOffset||f.support.boxModel&&g.scrollTop||h.scrollTop,m=i.pageXOffset||f.support.boxModel&&g.scrollLeft||h.scrollLeft,n=c.top+l-j,o=c.left+m-k;return{top:n,left:o}}:f.fn.offset=function(a){var b=this[0];if(a)return this.each(function(b){f.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return f.offset.bodyOffset(b);f.offset.initialize();var c,d=b.offsetParent,e=b,g=b.ownerDocument,h=g.documentElement,i=g.body,j=g.defaultView,k=j?j.getComputedStyle(b,null):b.currentStyle,l=b.offsetTop,m=b.offsetLeft;while((b=b.parentNode)&&b!==i&&b!==h){if(f.offset.supportsFixedPosition&&k.position==="fixed")break;c=j?j.getComputedStyle(b,null):b.currentStyle,l-=b.scrollTop,m-=b.scrollLeft,b===d&&(l+=b.offsetTop,m+=b.offsetLeft,f.offset.doesNotAddBorder&&(!f.offset.doesAddBorderForTableAndCells||!cw.test(b.nodeName))&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),e=d,d=b.offsetParent),f.offset.subtractsBorderForOverflowNotVisible&&c.overflow!=="visible"&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),k=c}if(k.position==="relative"||k.position==="static")l+=i.offsetTop,m+=i.offsetLeft;f.offset.supportsFixedPosition&&k.position==="fixed"&&(l+=Math.max(h.scrollTop,i.scrollTop),m+=Math.max(h.scrollLeft,i.scrollLeft));return{top:l,left:m}},f.offset={initialize:function(){var a=c.body,b=c.createElement("div"),d,e,g,h,i=parseFloat(f.css(a,"marginTop"))||0,j="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";f.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"}),b.innerHTML=j,a.insertBefore(b,a.firstChild),d=b.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,this.doesNotAddBorder=e.offsetTop!==5,this.doesAddBorderForTableAndCells=h.offsetTop===5,e.style.position="fixed",e.style.top="20px",this.supportsFixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",this.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==i,a.removeChild(b),f.offset.initialize=f.noop},bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;f.offset.initialize(),f.offset.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(f.css(a,"marginTop"))||0,c+=parseFloat(f.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var d=f.css(a,"position");d==="static"&&(a.style.position="relative");var e=f(a),g=e.offset(),h=f.css(a,"top"),i=f.css(a,"left"),j=(d==="absolute"||d==="fixed")&&f.inArray("auto",[h,i])>-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cy(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cy(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){return this[0]?parseFloat(f.css(this[0],d,"padding")):null},f.fn["outer"+c]=function(a){return this[0]?parseFloat(f.css(this[0],d,a?"margin":"border")):null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c];return e.document.compatMode==="CSS1Compat"&&g||e.document.body["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var h=f.css(e,d),i=parseFloat(h);return f.isNaN(i)?h:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f})(window);jQuery.noConflict();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/js/jqueryFileTree/images/zip.png CHANGED
Binary file
admin/js/loader.swf DELETED
Binary file
admin/js/photoswipe/images/icons.png DELETED
Binary file
admin/js/photoswipe/images/icons@2x.png DELETED
Binary file
admin/js/photoswipe/klass.min.js DELETED
@@ -1,8 +0,0 @@
1
- /**
2
- * Klass.js - copyright @dedfat
3
- * version 1.0
4
- * https://github.com/ded/klass
5
- * Follow our software http://twitter.com/dedfat :)
6
- * MIT License
7
- */
8
- !function(a,b){function j(a,b){function c(){}c[e]=this[e];var d=this,g=new c,h=f(a),j=h?a:this,k=h?{}:a,l=function(){this.initialize?this.initialize.apply(this,arguments):(b||h&&d.apply(this,arguments),j.apply(this,arguments))};l.methods=function(a){i(g,a,d),l[e]=g;return this},l.methods.call(l,k).prototype.constructor=l,l.extend=arguments.callee,l[e].implement=l.statics=function(a,b){a=typeof a=="string"?function(){var c={};c[a]=b;return c}():a,i(this,a,d);return this};return l}function i(a,b,d){for(var g in b)b.hasOwnProperty(g)&&(a[g]=f(b[g])&&f(d[e][g])&&c.test(b[g])?h(g,b[g],d):b[g])}function h(a,b,c){return function(){var d=this.supr;this.supr=c[e][a];var f=b.apply(this,arguments);this.supr=d;return f}}function g(a){return j.call(f(a)?a:d,a,1)}var c=/xyz/.test(function(){xyz})?/\bsupr\b/:/.*/,d=function(){},e="prototype",f=function(a){return typeof a===b};if(typeof module!="undefined"&&module.exports)module.exports=g;else{var k=a.klass;g.noConflict=function(){a.klass=k;return this},a.klass=g}}(this,"function")
 
 
 
 
 
 
 
 
admin/js/plupload/jquery.ui.plupload/img/plupload.png CHANGED
Binary file
admin/js/script.js DELETED
@@ -1,292 +0,0 @@
1
- var metaViewport;
2
- jQuery(function() {
3
- metaViewport = jQuery('meta[name=viewport]','head').attr('content');
4
- });
5
-
6
- function FlAGClass(ExtendVar, skin_id, pic_id, slideshow) {
7
- jQuery(function() {
8
- if(pic_id !== false){
9
- var skin_function = flagFind(skin_id);
10
- if(pic_id !== 0 ) {
11
- jQuery.fancybox(
12
- {
13
- 'showNavArrows' : false,
14
- 'overlayShow' : true,
15
- 'overlayOpacity': '0.9',
16
- 'overlayColor' : '#000',
17
- 'transitionIn' : 'elastic',
18
- 'transitionOut' : 'elastic',
19
- 'titlePosition' : 'over',
20
- 'titleFormat' : function(title, currentArray, currentIndex, currentOpts) {
21
- var descr = jQuery('<div />').html(jQuery("#flag_pic_"+pic_id, window[skin_id]).find('.flag_pic_desc > span').html()).text();
22
- title = jQuery('<div />').html(jQuery("#flag_pic_"+pic_id, window[skin_id]).find('.flag_pic_desc > strong').html()).text();
23
- if(title.length || descr.length)
24
- return '<div class="grand_controls" rel="'+skin_id+'"><span rel="prev" class="g_prev">prev</span><span rel="show" class="g_slideshow '+slideshow+'">play/pause</span><span rel="next" class="g_next">next</span></div><div id="fancybox-title-over">'+(title.length? '<strong class="title">'+title+'</strong>' : '')+(descr.length? '<div class="descr">'+descr+'</div>' : '')+'</div>';
25
- else
26
- return '<div class="grand_controls" rel="'+skin_id+'"><span rel="prev" class="g_prev">prev</span><span rel="show" class="g_slideshow '+slideshow+'">play/pause</span><span rel="next" class="g_next">next</span></div>';
27
- },
28
- 'href' : jQuery("#flag_pic_"+pic_id, window[skin_id]).attr('href'),
29
- 'onStart' : function(){
30
- //if(skin_function && jQuery.isFunction(skin_function[skin_id+'_fb'])) {
31
- skin_function[skin_id+'_fb']('active');
32
- //}
33
- jQuery('#fancybox-wrap').addClass('grand');
34
- },
35
- 'onClosed' : function(currentArray, currentIndex){
36
- //if(skin_function && jQuery.isFunction(skin_function[skin_id+'_fb'])) {
37
- skin_function[skin_id+'_fb']('close');
38
- //}
39
- jQuery('#fancybox-wrap').removeClass('grand');
40
- },
41
- 'onComplete' : function(currentArray, currentIndex) {
42
- }
43
- });
44
- }
45
- jQuery('#fancybox-wrap').off('click', '.grand_controls span').on('click', '.grand_controls span', function(){
46
- skin_function[skin_id+'_fb'](jQuery(this).attr('rel'));
47
- if(jQuery(this).hasClass('g_slideshow')){
48
- jQuery(this).toggleClass('play stop');
49
- }
50
- });
51
- } else {
52
- if((('undefined' == metaViewport) || !metaViewport) && ExtendVar == 'photoswipe'){
53
- jQuery('head').append('<meta content="width=device-width, initial-scale=1.0;" name="viewport" />');
54
- }
55
- jQuery('.flashalbum').css('height','auto');
56
- jQuery('body#fullwindow').css('overflow','auto');
57
- jQuery('#'+skin_id+'_jq').each(function(i){
58
- jQuery(this).css({display: 'block'});
59
- var catMeta = jQuery('.flagCatMeta',this).hide().get();
60
- for(j=0; j<catMeta.length; j++) {
61
- var catName = jQuery(catMeta[j]).find('h4').text();
62
- var catDescr = jQuery(catMeta[j]).find('p').text();
63
- var catId = jQuery(catMeta[j]).next('.flagcategory').attr('id');
64
- var act = '';
65
- if(j==0) act = ' active';
66
- jQuery('.flagcatlinks',this).append('<a class="flagcat'+act+'" href="#'+catId+'" title="'+catDescr+'">'+catName+'</a>');
67
- }
68
- jQuery('a#backlink').appendTo('.flagcatlinks',this);
69
- jQuery('.flagcategory', this).each(function(){
70
- var flagcatid = jQuery(this).attr('id');
71
- jQuery('a.flag_pic_alt', this).attr('rel',flagcatid);
72
- });
73
- });
74
- jQuery('#'+skin_id+'_jq .flagcat').click(function(){
75
- if(!jQuery(this).hasClass('active')) {
76
- var catId = jQuery(this).attr('href');
77
- jQuery(this).addClass('active').siblings().removeClass('active');
78
- jQuery('#'+skin_id+'_jq '+catId).css({display: 'block'}).siblings('.flagcategory').hide();
79
- alternate_flag_e(skin_id, catId, ExtendVar);
80
- }
81
- return false;
82
- });
83
- alternate_flag_e(skin_id, '.flagcategory:first', ExtendVar);
84
- }
85
- });
86
- }
87
-
88
- function alternate_flag_e(skin_id, t, ExtendVar){
89
- jQuery('#'+skin_id+'_jq').find(t).not('.loaded').each(function(){
90
- var d = jQuery(this).html();
91
- if(d) {
92
- d = d.replace(/>\[img src=/g, '><img src="');
93
- //d = d.replace(/src=/g, 'src="');
94
- d = d.replace(/\]</g, '" /><');
95
- jQuery(this).addClass('loaded').html(d);
96
- }
97
- jQuery(this).css({display: 'block'});
98
- if(ExtendVar == 'photoswipe') {
99
- var
100
- showDescr, longDescription, imgdescr, psImgCaption, curel,
101
- options = {
102
- allowUserZoom:false,
103
- captionAndToolbarAutoHideDelay:0,
104
- captionAndToolbarHide:false,
105
- captionAndToolbarShowEmptyCaptions:true,
106
- zIndex:10000,
107
- getToolbar: function(){
108
- flagToolbar = window.Code.PhotoSwipe.Toolbar.getToolbar();
109
- flagToolbar = flagToolbar + '<div class="ps-toolbar-descr"><div class="ps-toolbar-content"></div></div>';
110
- return flagToolbar;
111
- // NB. Calling PhotoSwipe.Toolbar.getToolbar() wil return the default toolbar HTML
112
- },
113
- getImageCaption: function(el){
114
- psImgCaption = jQuery('<strong></strong>').addClass('ps-title').append(jQuery(el).attr('title'));
115
- return psImgCaption;
116
- },
117
- getImageMetaData: function(el){
118
- imgdescr = jQuery(el).find('span.flag_pic_desc > span:first').html();
119
- if(imgdescr.length){
120
- imgdescr = jQuery('<div></div>').append(imgdescr);
121
- }
122
- return {
123
- longDescription: imgdescr
124
- }
125
-
126
- }
127
- },
128
- flagBodyScrollTop,
129
- flagBodyScrollLeft,
130
- instance = jQuery('a.flag_pic_alt',this).on('click',function(){
131
- flagBodyScrollTop = jQuery(window).scrollTop();
132
- flagBodyScrollLeft = jQuery(window).scrollLeft();
133
- }).photoSwipe(options);
134
-
135
- // onBeforeShow - store a reference to our "say hi" button
136
- instance.addEventHandler(window.Code.PhotoSwipe.EventTypes.onBeforeShow, function(e){
137
- jQuery(window).scrollLeft(0).scrollTop(0);
138
- jQuery('html').addClass('ps-noscroll');
139
- jQuery('meta[name=viewport]').attr('content','width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0');
140
- //window.location.hash = '#OpenGallery';
141
- });
142
- // onShow - store a reference to our "say hi" button
143
- instance.addEventHandler(window.Code.PhotoSwipe.EventTypes.onShow, function(e){
144
- showDescr = window.document.querySelectorAll('.ps-toolbar-descr')[0];
145
- });
146
- // onBeforeHide - clean up
147
- instance.addEventHandler(window.Code.PhotoSwipe.EventTypes.onBeforeHide, function(e){
148
- showDescr = null;
149
- });
150
- // onHide - clean up
151
- instance.addEventHandler(window.Code.PhotoSwipe.EventTypes.onHide, function(e){
152
- if(('undefined' == metaViewport) || !metaViewport){
153
- jQuery('meta[name=viewport]').attr('content','width=device-width, initial-scale=1.0, minimum-scale=0.25, maximum-scale=1.6, user-scalable=1');
154
- jQuery('meta[name=viewport]').remove();
155
- } else {
156
- jQuery('meta[name=viewport]').attr('content',metaViewport);
157
- }
158
- jQuery('html').removeClass('ps-noscroll');
159
- setTimeout(function(){ jQuery(window).scrollTop(flagBodyScrollTop).scrollLeft(flagBodyScrollLeft); }, 0);
160
- console.log(flagBodyScrollLeft, flagBodyScrollTop);
161
- //window.location.hash = '#CloseGallery';
162
- });
163
- // onDisplayImage
164
- instance.addEventHandler(window.Code.PhotoSwipe.EventTypes.onDisplayImage, function(e){
165
- curel = instance.getCurrentImage();
166
- var curid = curel.refObj.id;
167
- curid = curid.replace('flag_pic_','');
168
- jQuery.post(hitajax, { hit: curid }, function(r){ console.log(r); });
169
- if(curel.metaData.longDescription){
170
- jQuery('.ps-caption-content').append(jQuery('<div></div>').addClass('ps-long-description').html(jQuery(curel.metaData.longDescription).text()).hide());
171
- jQuery('.ps-toolbar-descr').removeClass('disabled active').addClass('enabled');
172
- } else {
173
- jQuery('.ps-toolbar-descr').removeClass('enabled active').addClass('disabled');
174
- }
175
- });
176
- // onSlideshowStart
177
- instance.addEventHandler(window.Code.PhotoSwipe.EventTypes.onCaptionAndToolbarShow, function(e){
178
- curel = instance.getCurrentImage();
179
- if(curel.metaData.longDescription){
180
- jQuery('.ps-caption-content').append(jQuery('<div></div>').addClass('ps-long-description').html(jQuery(curel.metaData.longDescription).text()).hide());
181
- jQuery('.ps-toolbar-descr').removeClass('disabled active').addClass('enabled');
182
- } else {
183
- jQuery('.ps-toolbar-descr').removeClass('enabled active').addClass('disabled');
184
- }
185
- });
186
- // onToolbarTap - listen out for when the toolbar is tapped
187
- instance.addEventHandler(window.Code.PhotoSwipe.EventTypes.onToolbarTap, function(e){
188
- if (e.toolbarAction === window.Code.PhotoSwipe.Toolbar.ToolbarAction.none){
189
- if (e.tapTarget === showDescr || window.Code.Util.DOM.isChildOf(e.tapTarget, showDescr)){
190
- if(jQuery(showDescr).hasClass('enabled')){
191
- jQuery('.ps-toolbar-descr').toggleClass('active');
192
- jQuery('.ps-long-description').slideToggle(400);
193
- }
194
- }
195
- }
196
- });
197
- } else if(ExtendVar == 'fancybox'){
198
- jQuery('a.flag_pic_alt',this).fancybox({
199
- 'overlayShow' : true,
200
- 'overlayOpacity': '0.5',
201
- 'transitionIn' : 'elastic',
202
- 'transitionOut' : 'elastic',
203
- 'titlePosition' : 'over',
204
- 'titleFormat' : function(title, currentArray, currentIndex, currentOpts) {
205
- var descr = jQuery('<div />').html(jQuery('.flag_pic_desc > span', currentArray[currentIndex]).html()).text();
206
- title = jQuery('<div />').html(jQuery('.flag_pic_desc > strong', currentArray[currentIndex]).html()).text();
207
- return '<div id="fancybox-title-over"><em>'+(currentIndex + 1)+' / '+currentArray.length+' &nbsp; </em>'+(title.length? '<strong class="title">'+title+'</strong>' : '')+(descr.length? '<div class="descr">'+descr+'</div>' : '')+'</div>';
208
- },
209
- 'onClosed' : function(currentArray, currentIndex){
210
- jQuery(currentArray[currentIndex]).removeClass('current').addClass('last');
211
- },
212
- 'onComplete' : function(currentArray, currentIndex) {
213
- jQuery(currentArray).removeClass('current last');
214
- jQuery(currentArray[currentIndex]).addClass('current');
215
- var curid = jQuery(currentArray[currentIndex]).attr('id');
216
- curid = curid.replace('flag_pic_','');
217
- jQuery.post(hitajax, { hit: curid }, function(r){ console.log(r); });
218
- }
219
- });
220
- }
221
-
222
- });
223
- }
224
-
225
- function thumb_cl(skin_id, pic_id, slideshow){
226
- pic_id = parseInt(pic_id);
227
- new FlAGClass(ExtendVar, skin_id, pic_id, slideshow);
228
- }
229
-
230
- /*jQuery(document).ready(function() {
231
- jQuery('div.flashalbum').dblclick(function(e){
232
- if(e.target.tagName == 'IMG' || e.target.tagName == 'A') return;
233
- if(jQuery('body').hasClass('FlAG')){
234
- unhideSite(this, jQuery(this).attr('data-height'), jQuery(this).attr('data-scrolltop'));
235
- } else {
236
- jQuery(this).attr('data-height',jQuery(this).height()).attr('data-scrolltop',jQuery(window).scrollTop());
237
- hideSite(this);
238
- }
239
- });
240
- });*/
241
- function enlargeFlAG(t){
242
- var pleft = jQuery(t).offset().left - jQuery(window).scrollLeft();
243
- var pheight = jQuery(window).height();
244
- jQuery(t).css({left:-pleft,top:0,width:'100%',height:pheight+'px'});
245
- }
246
- function unlargeFlAG(t, hFA, sst){
247
- jQuery(t).css({left:0,top:0,width:'100%',height:hFA+'px'});
248
- jQuery(window).scrollTop(sst);
249
- }
250
- function hideSite(t){
251
- jQuery('body').addClass('FlAG');
252
- jQuery(t).parents('div').addClass('FlAGz').each(function(){
253
- if(jQuery(this).attr('style')){
254
- jQuery(this).attr('data-elstyle',jQuery(this).attr('style')).css({zIndex:100,width:'100%',maxWidth:'100%',height:'auto',padding:0,margin:0,border:'none'});
255
- } else {
256
- jQuery(this).css({zIndex:100,width:'100%',maxWidth:'100%',height:'auto',padding:0,margin:0,border:'none'});
257
- }
258
- });
259
- jQuery(t).siblings().not('script, link, style, head').addClass('FlAGd').each(function(){
260
- if(jQuery(this).attr('style')){
261
- jQuery(this).attr('data-elstyle',jQuery(this).attr('style')).css({visibility:'hidden',height:0,minHeight:0,padding:0,margin:'0 0 0 -10000px',border:'none',fontSize:0,lineHeight:0});
262
- } else {
263
- jQuery(this).css({visibility:'hidden',height:0,minHeight:0,padding:0,margin:'0 0 0 -10000px',border:'none',fontSize:0,lineHeight:0});
264
- }
265
- });
266
- jQuery(t).parents().siblings().not('script, link, style, head').addClass('FlAGd').each(function(){
267
- if(jQuery(this).attr('style')){
268
- jQuery(this).attr('data-elstyle',jQuery(this).attr('style')).css({visibility:'hidden',height:0,minHeight:0,maxHeight:0,padding:0,margin:'0 0 0 -10000px',border:'none',fontSize:0,lineHeight:0});
269
- } else {
270
- jQuery(this).css({visibility:'hidden',height:0,minHeight:0,maxHeight:0,padding:0,margin:'0 0 0 -10000px',border:'none',fontSize:0,lineHeight:0});
271
- }
272
- });
273
- enlargeFlAG(t);
274
- }
275
- function unhideSite(t, hFA, sst){
276
- jQuery('body').removeClass('FlAG');
277
- jQuery(t).parents('div').removeClass('FlAGz').each(function(i){
278
- if(jQuery(this).attr('data-elstyle')){
279
- jQuery(this).attr('style',jQuery(this).attr('data-elstyle')).removeAttr('data-elstyle');
280
- } else {
281
- jQuery(this).removeAttr('style');
282
- }
283
- });
284
- jQuery('.FlAGd').each(function(){
285
- if(jQuery(this).attr('data-elstyle')){
286
- jQuery(this).attr('style',jQuery(this).attr('data-elstyle')).removeAttr('data-elstyle').removeClass('FlAGd');
287
- } else {
288
- jQuery(this).removeAttr('style').removeClass('FlAGd');
289
- }
290
- });
291
- unlargeFlAG(t, hFA, sst);
292
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/js/swfaddress-optimizer.js DELETED
@@ -1 +0,0 @@
1
- /**
2
  * SWFAddress 2.4: Deep linking for Flash and Ajax <http://www.asual.com/swfaddress/>
3
  *
4
  * SWFAddress is (c) 2006-2009 Rostislav Hristov and contributors
5
  * This software is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
6
  *
7
  * Uses code from SWFObject 2.1 <http://code.google.com/p/swfobject/>
8
  * SWFObject is (c) 2007-2009 Geoff Stearns, Michael Williams, and Bobby van der Sluis
9
  *
10
  */
 
0
  * SWFAddress 2.4: Deep linking for Flash and Ajax <http://www.asual.com/swfaddress/>
1
  *
2
  * SWFAddress is (c) 2006-2009 Rostislav Hristov and contributors
3
  * This software is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
4
  *
5
  * Uses code from SWFObject 2.1 <http://code.google.com/p/swfobject/>
6
  * SWFObject is (c) 2007-2009 Geoff Stearns, Michael Williams, and Bobby van der Sluis
7
  *
8
  */
admin/js/swfaddress.js DELETED
@@ -1 +0,0 @@
1
- /**
2
  * SWFAddress 2.4: Deep linking for Flash and Ajax <http://www.asual.com/swfaddress/>
3
  *
4
  * SWFAddress is (c) 2006-2009 Rostislav Hristov and contributors
5
  * This software is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
6
  *
7
  */
 
0
  * SWFAddress 2.4: Deep linking for Flash and Ajax <http://www.asual.com/swfaddress/>
1
  *
2
  * SWFAddress is (c) 2006-2009 Rostislav Hristov and contributors
3
  * This software is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
4
  *
5
  */
admin/js/swfmousewheel.js DELETED
@@ -1,51 +0,0 @@
1
- // RM: this is my own version of the swfmacmousewheel.js
2
- // works with out registration, or the requirement of swfobject
3
- // only applies scroll events to swf the mouse is currently over
4
- // prevents browser scrolling on all OS's
5
-
6
- // Good portion of code kindly borrowed from: SWFMacMouseWheel v2.0: Mac Mouse Wheel functionality in flash - http://blog.pixelbreaker.com/
7
-
8
- var swfmousewheel = function () {
9
-
10
- var u = navigator.userAgent.toLowerCase();
11
- var p = navigator.platform.toLowerCase();
12
- var isMac = p ? /mac/.test(p) : /mac/.test(u);
13
-
14
- var handleWheelScroll = function(event) {
15
-
16
- var evt = event || window.event;
17
- var tgt = evt.target || evt.srcElement;
18
- if (tgt.nodeType == 3) { tgt = tgt.parentNode; } // safari edge case
19
-
20
- var typeAttr = tgt.getAttribute('type') || '';
21
- var classAttr = tgt.getAttribute('classid') || '';
22
- var isSWF = typeAttr.toLowerCase() == 'application/x-shockwave-flash' || classAttr.toLowerCase() == 'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000';
23
-
24
- if (!isSWF) { return; } // not over a swf, let the browser deal with it
25
-
26
- var delta = 0;
27
- if (evt.wheelDelta) { // ie/opera
28
- delta = evt.wheelDelta / 120;
29
- if (window.opera) { delta = -delta; }
30
-
31
- } else if (evt.detail) { // mozilla
32
- delta = -evt.detail;
33
- }
34
-
35
- if (delta && isMac) {
36
- // we've scrolled.. pass info into swf if it can handle it
37
- if( typeof( tgt.externalMouseEvent ) == 'function' ) {
38
- tgt.externalMouseEvent( delta );
39
- }
40
- }
41
- // RM: always prevent scroll events from reach the browser if we are over a swf
42
- if (evt.preventDefault) { evt.preventDefault(); }
43
- evt.returnValue = false;
44
-
45
- }
46
-
47
- // init
48
- if (window.addEventListener) { window.addEventListener('DOMMouseScroll', handleWheelScroll, false); } // mozilla
49
- window.onmousewheel = document.onmousewheel = handleWheelScroll; // ie/opera
50
-
51
- }();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/js/swfobject.js DELETED
@@ -1,31 +0,0 @@
1
- /* SWFObject v2.2 <http://code.google.com/p/swfobject/>
2
- is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
3
- */
4
- var swfobject=function(){var D="undefined",r="object",S="Shockwave Flash",W="ShockwaveFlash.ShockwaveFlash",q="application/x-shockwave-flash",R="SWFObjectExprInst",x="onreadystatechange",O=window,j=document,t=navigator,T=false,U=[h],o=[],N=[],I=[],l,Q,E,B,J=false,a=false,n,G,m=true,M=function(){var aa=typeof j.getElementById!=D&&typeof j.getElementsByTagName!=D&&typeof j.createElement!=D,ah=t.userAgent.toLowerCase(),Y=t.platform.toLowerCase(),ae=Y?/win/.test(Y):/win/.test(ah),ac=Y?/mac/.test(Y):/mac/.test(ah),af=/webkit/.test(ah)?parseFloat(ah.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,X=!+"\v1",ag=[0,0,0],ab=null;if(typeof t.plugins!=D&&typeof t.plugins[S]==r){ab=t.plugins[S].description;if(ab&&!(typeof t.mimeTypes!=D&&t.mimeTypes[q]&&!t.mimeTypes[q].enabledPlugin)){T=true;X=false;ab=ab.replace(/^.*\s+(\S+\s+\S+$)/,"$1");ag[0]=parseInt(ab.replace(/^(.*)\..*$/,"$1"),10);ag[1]=parseInt(ab.replace(/^.*\.(.*)\s.*$/,"$1"),10);ag[2]=/[a-zA-Z]/.test(ab)?parseInt(ab.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else{if(typeof O.ActiveXObject!=D){try{var ad=new ActiveXObject(W);if(ad){ab=ad.GetVariable("$version");if(ab){X=true;ab=ab.split(" ")[1].split(",");ag=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}}catch(Z){}}}return{w3:aa,pv:ag,wk:af,ie:X,win:ae,mac:ac}}(),k=function(){if(!M.w3){return}if((typeof j.readyState!=D&&j.readyState=="complete")||(typeof j.readyState==D&&(j.getElementsByTagName("body")[0]||j.body))){f()}if(!J){if(typeof j.addEventListener!=D){j.addEventListener("DOMContentLoaded",f,false)}if(M.ie&&M.win){j.attachEvent(x,function(){if(j.readyState=="complete"){j.detachEvent(x,arguments.callee);f()}});if(O==top){(function(){if(J){return}try{j.documentElement.doScroll("left")}catch(X){setTimeout(arguments.callee,0);return}f()})()}}if(M.wk){(function(){if(J){return}if(!/loaded|complete/.test(j.readyState)){setTimeout(arguments.callee,0);return}f()})()}s(f)}}();function f(){if(J){return}try{var Z=j.getElementsByTagName("body")[0].appendChild(C("span"));Z.parentNode.removeChild(Z)}catch(aa){return}J=true;var X=U.length;for(var Y=0;Y<X;Y++){U[Y]()}}function K(X){if(J){X()}else{U[U.length]=X}}function s(Y){if(typeof O.addEventListener!=D){O.addEventListener("load",Y,false)}else{if(typeof j.addEventListener!=D){j.addEventListener("load",Y,false)}else{if(typeof O.attachEvent!=D){i(O,"onload",Y)}else{if(typeof O.onload=="function"){var X=O.onload;O.onload=function(){X();Y()}}else{O.onload=Y}}}}}function h(){if(T){V()}else{H()}}function V(){var X=j.getElementsByTagName("body")[0];var aa=C(r);aa.setAttribute("type",q);var Z=X.appendChild(aa);if(Z){var Y=0;(function(){if(typeof Z.GetVariable!=D){var ab=Z.GetVariable("$version");if(ab){ab=ab.split(" ")[1].split(",");M.pv=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}else{if(Y<10){Y++;setTimeout(arguments.callee,10);return}}X.removeChild(aa);Z=null;H()})()}else{H()}}function H(){var ag=o.length;if(ag>0){for(var af=0;af<ag;af++){var Y=o[af].id;var ab=o[af].callbackFn;var aa={success:false,id:Y};if(M.pv[0]>0){var ae=c(Y);if(ae){if(F(o[af].swfVersion)&&!(M.wk&&M.wk<312)){w(Y,true);if(ab){aa.success=true;aa.ref=z(Y);ab(aa)}}else{if(o[af].expressInstall&&A()){var ai={};ai.data=o[af].expressInstall;ai.width=ae.getAttribute("width")||"0";ai.height=ae.getAttribute("height")||"0";if(ae.getAttribute("class")){ai.styleclass=ae.getAttribute("class")}if(ae.getAttribute("align")){ai.align=ae.getAttribute("align")}var ah={};var X=ae.getElementsByTagName("param");var ac=X.length;for(var ad=0;ad<ac;ad++){if(X[ad].getAttribute("name").toLowerCase()!="movie"){ah[X[ad].getAttribute("name")]=X[ad].getAttribute("value")}}P(ai,ah,Y,ab)}else{p(ae);if(ab){ab(aa)}}}}}else{w(Y,true);if(ab){var Z=z(Y);if(Z&&typeof Z.SetVariable!=D){aa.success=true;aa.ref=Z}ab(aa)}}}}}function z(aa){var X=null;var Y=c(aa);if(Y&&Y.nodeName=="OBJECT"){if(typeof Y.SetVariable!=D){X=Y}else{var Z=Y.getElementsByTagName(r)[0];if(Z){X=Z}}}return X}function A(){return !a&&F("6.0.65")&&(M.win||M.mac)&&!(M.wk&&M.wk<312)}function P(aa,ab,X,Z){a=true;E=Z||null;B={success:false,id:X};var ae=c(X);if(ae){if(ae.nodeName=="OBJECT"){l=g(ae);Q=null}else{l=ae;Q=X}aa.id=R;if(typeof aa.width==D||(!/%$/.test(aa.width)&&parseInt(aa.width,10)<310)){aa.width="310"}if(typeof aa.height==D||(!/%$/.test(aa.height)&&parseInt(aa.height,10)<137)){aa.height="137"}j.title=j.title.slice(0,47)+" - Flash Player Installation";var ad=M.ie&&M.win?"ActiveX":"PlugIn",ac="MMredirectURL="+O.location.toString().replace(/&/g,"%26")+"&MMplayerType="+ad+"&MMdoctitle="+j.title;if(typeof ab.flashvars!=D){ab.flashvars+="&"+ac}else{ab.flashvars=ac}if(M.ie&&M.win&&ae.readyState!=4){var Y=C("div");X+="SWFObjectNew";Y.setAttribute("id",X);ae.parentNode.insertBefore(Y,ae);ae.style.display="none";(function(){if(ae.readyState==4){ae.parentNode.removeChild(ae)}else{setTimeout(arguments.callee,10)}})()}u(aa,ab,X)}}function p(Y){if(M.ie&&M.win&&Y.readyState!=4){var X=C("div");Y.parentNode.insertBefore(X,Y);X.parentNode.replaceChild(g(Y),X);Y.style.display="none";(function(){if(Y.readyState==4){Y.parentNode.removeChild(Y)}else{setTimeout(arguments.callee,10)}})()}else{Y.parentNode.replaceChild(g(Y),Y)}}function g(ab){var aa=C("div");if(M.win&&M.ie){aa.innerHTML=ab.innerHTML}else{var Y=ab.getElementsByTagName(r)[0];if(Y){var ad=Y.childNodes;if(ad){var X=ad.length;for(var Z=0;Z<X;Z++){if(!(ad[Z].nodeType==1&&ad[Z].nodeName=="PARAM")&&!(ad[Z].nodeType==8)){aa.appendChild(ad[Z].cloneNode(true))}}}}}return aa}function u(ai,ag,Y){var X,aa=c(Y);if(M.wk&&M.wk<312){return X}if(aa){if(typeof ai.id==D){ai.id=Y}if(M.ie&&M.win){var ah="";for(var ae in ai){if(ai[ae]!=Object.prototype[ae]){if(ae.toLowerCase()=="data"){ag.movie=ai[ae]}else{if(ae.toLowerCase()=="styleclass"){ah+=' class="'+ai[ae]+'"'}else{if(ae.toLowerCase()!="classid"){ah+=" "+ae+'="'+ai[ae]+'"'}}}}}var af="";for(var ad in ag){if(ag[ad]!=Object.prototype[ad]){af+='<param name="'+ad+'" value="'+ag[ad]+'" />'}}aa.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+ah+">"+af+"</object>";N[N.length]=ai.id;X=c(ai.id)}else{var Z=C(r);Z.setAttribute("type",q);for(var ac in ai){if(ai[ac]!=Object.prototype[ac]){if(ac.toLowerCase()=="styleclass"){Z.setAttribute("class",ai[ac])}else{if(ac.toLowerCase()!="classid"){Z.setAttribute(ac,ai[ac])}}}}for(var ab in ag){if(ag[ab]!=Object.prototype[ab]&&ab.toLowerCase()!="movie"){e(Z,ab,ag[ab])}}aa.parentNode.replaceChild(Z,aa);X=Z}}return X}function e(Z,X,Y){var aa=C("param");aa.setAttribute("name",X);aa.setAttribute("value",Y);Z.appendChild(aa)}function y(Y){var X=c(Y);if(X&&X.nodeName=="OBJECT"){if(M.ie&&M.win){X.style.display="none";(function(){if(X.readyState==4){b(Y)}else{setTimeout(arguments.callee,10)}})()}else{X.parentNode.removeChild(X)}}}function b(Z){var Y=c(Z);if(Y){for(var X in Y){if(typeof Y[X]=="function"){Y[X]=null}}Y.parentNode.removeChild(Y)}}function c(Z){var X=null;try{X=j.getElementById(Z)}catch(Y){}return X}function C(X){return j.createElement(X)}function i(Z,X,Y){Z.attachEvent(X,Y);I[I.length]=[Z,X,Y]}function F(Z){var Y=M.pv,X=Z.split(".");X[0]=parseInt(X[0],10);X[1]=parseInt(X[1],10)||0;X[2]=parseInt(X[2],10)||0;return(Y[0]>X[0]||(Y[0]==X[0]&&Y[1]>X[1])||(Y[0]==X[0]&&Y[1]==X[1]&&Y[2]>=X[2]))?true:false}function v(ac,Y,ad,ab){if(M.ie&&M.mac){return}var aa=j.getElementsByTagName("head")[0];if(!aa){return}var X=(ad&&typeof ad=="string")?ad:"screen";if(ab){n=null;G=null}if(!n||G!=X){var Z=C("style");Z.setAttribute("type","text/css");Z.setAttribute("media",X);n=aa.appendChild(Z);if(M.ie&&M.win&&typeof j.styleSheets!=D&&j.styleSheets.length>0){n=j.styleSheets[j.styleSheets.length-1]}G=X}if(M.ie&&M.win){if(n&&typeof n.addRule==r){n.addRule(ac,Y)}}else{if(n&&typeof j.createTextNode!=D){n.appendChild(j.createTextNode(ac+" {"+Y+"}"))}}}function w(Z,X){if(!m){return}var Y=X?"visible":"hidden";if(J&&c(Z)){c(Z).style.visibility=Y}else{v("#"+Z,"visibility:"+Y)}}function L(Y){var Z=/[\\\"<>\.;]/;var X=Z.exec(Y)!=null;return X&&typeof encodeURIComponent!=D?encodeURIComponent(Y):Y}var d=function(){if(M.ie&&M.win){window.attachEvent("onunload",function(){var ac=I.length;for(var ab=0;ab<ac;ab++){I[ab][0].detachEvent(I[ab][1],I[ab][2])}var Z=N.length;for(var aa=0;aa<Z;aa++){y(N[aa])}for(var Y in M){M[Y]=null}M=null;for(var X in swfobject){swfobject[X]=null}swfobject=null})}}();return{registerObject:function(ab,X,aa,Z){if(M.w3&&ab&&X){var Y={};Y.id=ab;Y.swfVersion=X;Y.expressInstall=aa;Y.callbackFn=Z;o[o.length]=Y;w(ab,false)}else{if(Z){Z({success:false,id:ab})}}},getObjectById:function(X){if(M.w3){return z(X)}},embedSWF:function(ab,ah,ae,ag,Y,aa,Z,ad,af,ac){var X={success:false,id:ah};if(M.w3&&!(M.wk&&M.wk<312)&&ab&&ah&&ae&&ag&&Y){w(ah,false);K(function(){ae+="";ag+="";var aj={};if(af&&typeof af===r){for(var al in af){aj[al]=af[al]}}aj.data=ab;aj.width=ae;aj.height=ag;var am={};if(ad&&typeof ad===r){for(var ak in ad){am[ak]=ad[ak]}}if(Z&&typeof Z===r){for(var ai in Z){if(typeof am.flashvars!=D){am.flashvars+="&"+ai+"="+Z[ai]}else{am.flashvars=ai+"="+Z[ai]}}}if(F(Y)){var an=u(aj,am,ah);if(aj.id==ah){w(ah,true)}X.success=true;X.ref=an}else{if(aa&&A()){aj.data=aa;P(aj,am,ah,ac);return}else{w(ah,true)}}if(ac){ac(X)}})}else{if(ac){ac(X)}}},switchOffAutoHideShow:function(){m=false},ua:M,getFlashPlayerVersion:function(){return{major:M.pv[0],minor:M.pv[1],release:M.pv[2]}},hasFlashPlayerVersion:F,createSWF:function(Z,Y,X){if(M.w3){return u(Z,Y,X)}else{return undefined}},showExpressInstall:function(Z,aa,X,Y){if(M.w3&&A()){P(Z,aa,X,Y)}},removeSWF:function(X){if(M.w3){y(X)}},createCSS:function(aa,Z,Y,X){if(M.w3){v(aa,Z,Y,X)}},addDomLoadEvent:K,addLoadEvent:s,getQueryParamValue:function(aa){var Z=j.location.search||j.location.hash;if(Z){if(/\?/.test(Z)){Z=Z.split("?")[1]}if(aa==null){return L(Z)}var Y=Z.split("&");for(var X=0;X<Y.length;X++){if(Y[X].substring(0,Y[X].indexOf("="))==aa){return L(Y[X].substring((Y[X].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(a){var X=c(R);if(X&&l){X.parentNode.replaceChild(l,X);if(Q){w(Q,true);if(M.ie&&M.win){l.style.display="block"}}if(E){E(B)}}a=false}}}}();
5
- var flag_alt = new Object();
6
- function waitJQ(fbVar,fbW,fbH) { if (typeof(jQuery) == 'undefined') { window.setTimeout(waitJQ, 100); } else { if (typeof(jQuery.fn.fancybox) == 'undefined') { jQuery("head").append("<script type='text/javascript' src='"+fbVar+"admin/js/jquery.fancybox-1.3.4.pack.js'></script><link rel='stylesheet' href='"+fbVar+"admin/js/jquery.fancybox-1.3.4.css' type='text/css' media='screen' />"); } waitFB(fbW,fbH); } }
7
- function waitFB(fbW,fbH) { if (typeof(jQuery.fn.fancybox) == 'undefined') { window.setTimeout(waitFB, 100); } else {
8
- jQuery(document).ready(function() {
9
- jQuery('.flag_fancybox').fancybox({
10
- 'type' : 'iframe',
11
- 'width' : fbW,
12
- 'height' : fbH,
13
- 'overlayShow' : true,
14
- 'overlayOpacity': '0.5',
15
- 'showNavArrows' : false
16
- });
17
- });
18
- }}
19
- function waitJQv(fvVar,fvW,fvH) { if (typeof(jQuery) == 'undefined') { window.setTimeout(waitJQ, 100); } else { if (typeof(jQuery.fn.fancybox) == 'undefined') { jQuery("head").append("<script type='text/javascript' src='"+fvVar+"admin/js/jquery.fancybox-1.3.4.pack.js'></script><link rel='stylesheet' href='"+fvVar+"admin/js/jquery.fancybox-1.3.4.css' type='text/css' media='screen' />"); } waitFBv(fvW,fvH); } }
20
- function waitFBv(fvW,fvH) { if (typeof(jQuery.fn.fancybox) == 'undefined') { window.setTimeout(waitFB, 100); } else {
21
- jQuery(document).ready(function() {
22
- jQuery('.flag_fancyvid').fancybox({
23
- 'type' : 'iframe',
24
- 'width' : fvW,
25
- 'height' : fvH,
26
- 'overlayShow' : true,
27
- 'overlayOpacity': '0.5',
28
- 'showNavArrows' : false
29
- });
30
- });
31
- }}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/js/themes/default/arrows.png DELETED
Binary file
admin/js/themes/default/bullets.png DELETED
Binary file
admin/js/widgets_admin.js CHANGED
@@ -1,5 +1,5 @@
1
  jQuery(document).ready(function() {
2
- jQuery('#widgets-right .grandGalleries :checkbox').live('click',function(e){
3
  var inp = jQuery(e.target).parent().parent().parent().find('.grand_items_array > input');
4
  console.log(inp);
5
  var cur = jQuery(e.target).val();
1
  jQuery(document).ready(function() {
2
+ jQuery('#widgets-right').on('click', '.grandGalleries :checkbox',function(e){
3
  var inp = jQuery(e.target).parent().parent().parent().find('.grand_items_array > input');
4
  console.log(inp);
5
  var cur = jQuery(e.target).val();
admin/manage-banner.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You are not allowed to call this page directly.');}
4
 
5
- function flag_b_playlist_edit() {
6
 
7
  $filepath = admin_url() . 'admin.php?page=' . urlencode($_GET['page']);
8
  $all_playlists = get_b_playlists();
@@ -39,7 +39,7 @@ function checkSelected() {
39
  var numchecked = getNumChecked(document.getElementById('updatePlaylist'));
40
 
41
  if(numchecked < 1) {
42
- alert('<?php echo esc_js(__("No items selected", "flag")); ?>');
43
  return false;
44
  }
45
 
@@ -47,11 +47,11 @@ function checkSelected() {
47
 
48
  switch (actionId) {
49
  case "delete_items":
50
- return confirm('<?php echo sprintf(esc_js(__("You are about to delete %s item(s) \n \n 'Cancel' to stop, 'OK' to proceed.",'flag')), "' + numchecked + '") ; ?>');
51
  break;
52
  }
53
 
54
- return confirm('<?php echo sprintf(esc_js(__("You are about to start the bulk edit for %s item(s) \n \n 'Cancel' to stop, 'OK' to proceed.",'flag')), "' + numchecked + '") ; ?>');
55
  }
56
 
57
  function showDialog( windowId, height ) {
@@ -97,11 +97,11 @@ jQuery(document).ready(function(){
97
  </script>
98
 
99
  <div class="flag-wrap">
100
- <h2><?php _e( 'Playlist', 'flag' ); ?>: <?php echo esc_html($playlist['title']); ?></h2>
101
  <div style="float: right; margin: -20px 3px 0 0;">
102
- <span><a href="<?php echo $filepath; ?>"><?php _e('Back to Banner Box', 'flag'); ?></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
103
  <select name="select_playlist" onchange="window.location.href=this.options[this.selectedIndex].value">
104
- <option selected="selected"><?php _e('Choose another playlist', 'flag'); ?></option>
105
  <?php
106
  foreach((array)$all_playlists as $playlist_file => $playlist_data) {
107
  $playlist_name = basename($playlist_file, '.xml');
@@ -120,41 +120,46 @@ jQuery(document).ready(function(){
120
  <div id="poststuff" class="metabox-holder">
121
  <div id="post-body"><div id="post-body-content"><div id="normal-sortables" style="position: relative;">
122
  <div id="flagalleryset" class="postbox" >
123
- <h3 class="hndle"><span><?php _e('Playlist settings', 'flag'); ?></span></h3>
124
  <div class="inside">
125
  <table cellspacing="8" cellpadding="0" border="0">
126
  <tr>
127
- <th align="left" valign="middle" scope="row"><?php _e('Shortcode', 'flag'); ?>:</th>
128
  <td align="left" valign="middle"><input type="text" readonly="readonly" size="50" onfocus="this.select()" value="[grandbanner xml=<?php echo sanitize_flagname($_GET['playlist']); ?>]" /></td>
129
- <td rowspan="3" align="left" valign="top"><div><strong style="display: inline-block; width: 100px;"><?php _e("Playlist Skin", 'flag'); ?>:</strong>
130
  <input id="skinaction" type="hidden" name="skinaction" value="<?php echo sanitize_flagname($playlist['skin']); ?>" />
131
  <select id="skinname" name="skinname" style="width: 200px; height: 24px; font-size: 11px;">
132
  <?php require_once (dirname(__FILE__) . '/get_skin.php');
133
  $all_skins = get_skins($skin_folder='', $type='b');
 
134
  if(count($all_skins)) {
135
  foreach ( (array)$all_skins as $skin_file => $skin_data) {
136
- $cur = ($playlist['skin'] == dirname($skin_file))? ' selected="selected"' : '';
 
 
 
 
137
  echo '<option'.$cur.' value="'.dirname($skin_file).'">'.$skin_data['Name'].'</option>'."\n";
138
  }
139
  } else {
140
- echo '<option value="rotator_default">'.__("No Skins", "flag").'</option>';
141
  }
142
  ?>
143
- </select>&nbsp;&nbsp;<a id="skinOptions" class="thickbox" href="<?php echo FLAG_URLPATH.'admin/skin_options.php?show_options=1&amp;skin='.sanitize_flagname($playlist["skin"]).'&amp;TB_iframe=1&amp;width=600&amp;height=560'; ?>"><?php _e('Change Skin Options', 'flag' ); ?></a>
144
  </div>
145
- <p style="margin:10px 0 0 100px;"><input type="submit" id="updatePlaylistSkin" name="updatePlaylistSkin" class="button-primary action" value="<?php _e('Update skin options for this playlist', 'flag'); ?>" /></p>
146
  </td>
147
  </tr>
148
  <tr>
149
- <th align="left" valign="middle" scope="row"><?php _e('Title', 'flag'); ?>:</th>
150
  <td align="left" valign="middle"><input type="text" size="50" name="playlist_title" value="<?php echo esc_html($playlist['title']); ?>" /></td>
151
  </tr>
152
  <tr>
153
- <th align="left" valign="top" scope="row"><?php _e('Description', 'flag'); ?>:</th>
154
  <td align="left" valign="top"><textarea name="playlist_descr" cols="60" rows="2" style="width: 95%" ><?php echo esc_html($playlist['description']); ?></textarea></td>
155
  </tr>
156
  <!--<tr>
157
- <th align="left" valign="top" scope="row"><?php _e('Path', 'flag'); ?>:</th>
158
  <td align="left" colspan="2" valign="top"><?php echo $playlistPath; ?></td>
159
  </tr>-->
160
  </table>
@@ -165,33 +170,33 @@ jQuery(document).ready(function(){
165
  </div> <!-- poststuff -->
166
  <div class="tablenav flag-tablenav">
167
  <select id="bulkaction" name="bulkaction" class="alignleft">
168
- <option value="no_action" ><?php _e("No action",'flag')?></option>
169
- <option value="delete_items" ><?php _e("Delete items",'flag')?></option>
170
  </select>
171
- <input class="button-secondary alignleft" style="margin-right:10px;" type="submit" name="updatePlaylist" value="<?php _e("OK",'flag')?>" onclick="if ( !checkSelected() ) return false;" />
172
- <a href="<?php echo wp_nonce_url($filepath."&playlist=".sanitize_flagname($_GET['playlist'])."&mode=sort", 'flag_sort'); ?>" class="button-secondary alignleft" style="margin:1px 10px 0 0;"><?php _e("Sort Playlist",'flag')?></a>
173
- <a href="#" onClick="jQuery('#form_listitems').submit();return false;" class="button-secondary alignleft" style="margin:1px 10px 0 0;"><?php _e("Add/Remove Items from Playlist",'flag')?></a>
174
- <input type="submit" name="updatePlaylist" class="button-primary action alignright" value="<?php _e("Update Playlist",'flag')?>" />
175
  </div>
176
 
177
  <table id="flag-listvideo" class="widefat fixed flag-table" cellspacing="0" >
178
 
179
  <thead>
180
  <tr>
181
- <th class="cb" width="54" scope="col"><a href="#" onclick="checkAll(document.getElementById('updatePlaylist'));return false;"><?php _e('Check', 'flag'); ?></a></th>
182
- <th class="id" width="64" scope="col"><div><?php _e('ID', 'flag'); ?></div></th>
183
- <th class="thumb" width="110" scope="col"><div><?php _e('Thumbnail', 'flag'); ?></div></th>
184
- <th class="title_filename" scope="col"><div><?php _e('Filename / Title', 'flag'); ?></div></th>
185
- <th class="description" scope="col"><div><?php _e('Description', 'flag'); ?></div></th>
186
  </tr>
187
  </thead>
188
  <tfoot>
189
  <tr>
190
- <th class="cb" scope="col"><a href="#" onclick="checkAll(document.getElementById('updatePlaylist'));return false;"><?php _e('Check', 'flag'); ?></a></th>
191
- <th class="id" scope="col"><?php _e('ID', 'flag'); ?></th>
192
- <th class="thumb" scope="col"><?php _e('Thumbnail', 'flag'); ?></th>
193
- <th class="title_filename" scope="col"><?php _e('Filename / Title', 'flag'); ?></th>
194
- <th class="description" scope="col"><?php _e('Description', 'flag'); ?></th>
195
  </tr>
196
  </tfoot>
197
  <tbody>
@@ -199,18 +204,17 @@ jQuery(document).ready(function(){
199
  $counter = 0;
200
  if(count($items_a)) {
201
  $alt = ' class="alternate"';
202
- $uploads = wp_upload_dir();
203
  foreach($items_a as $item) {
204
  $ban = get_post($item);
205
- $thumb = $banthumb = get_post_meta($item, 'thumbnail', true);
 
 
 
206
  $link = get_post_meta($ban->ID, 'link', true);
207
- $preview = get_post_meta($ban->ID, 'preview', true);
208
  if(empty($thumb)) {
209
  $thumb = wp_get_attachment_thumb_url($ban->ID);
210
- $banthumb = '';
211
  }
212
  $alt = ( empty($alt) ) ? ' class="alternate"' : '';
213
- $alt2 = ( empty($alt) ) ? '' : ' alternate';
214
  $counter++;
215
  $url = wp_get_attachment_url($ban->ID);
216
  ?>
@@ -223,7 +227,7 @@ if(count($items_a)) {
223
  <td class="title_filename">
224
  <strong><a href="<?php echo $url; ?>"><?php echo basename($url); ?></a></strong><br />
225
  <textarea title="Title" name="item_a[<?php echo $ban->ID; ?>][post_title]" cols="20" rows="1" style="width:95%; height: 25px; overflow:hidden;"><?php echo esc_html(stripslashes($ban->post_title)); ?></textarea><br />
226
- <?php _e('URL', 'flag'); ?>: <input id="banlink-<?php echo $ban->ID; ?>" name="item_a[<?php echo $ban->ID; ?>][link]" style="width:50%;" type="text" value="<?php echo esc_url($link); ?>" /><br />
227
  </td>
228
  <td class="description">
229
  <textarea name="item_a[<?php echo $ban->ID; ?>][post_content]" style="width:95%; height: 96px; margin-top: 2px; font-size:12px; line-height:115%;" rows="1" ><?php echo esc_html(stripslashes($ban->post_content)); ?></textarea>
@@ -235,13 +239,13 @@ if(count($items_a)) {
235
 
236
  // In the case you have no capaptibility to see the search result
237
  if ( $counter==0 )
238
- echo '<tr><td colspan="5" align="center"><strong>'.__('No entries found','flag').'</strong></td></tr>';
239
 
240
  ?>
241
 
242
  </tbody>
243
  </table>
244
- <p class="submit" style="text-align: right;"><input type="submit" class="button-primary action" name="updatePlaylist" value="<?php _e("Update Playlist",'flag')?>" /></p>
245
  </form>
246
  <form id="form_listitems" name="form_listitems" method="POST" action="<?php echo esc_url($filepath."&playlist=".sanitize_flagname($_GET['playlist'])."&mode=add"); ?>">
247
  <?php wp_nonce_field('flag_add'); ?>
2
 
3
  if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You are not allowed to call this page directly.');}
4
 
5
+ function flag_b_playlist_edit($file = '') {
6
 
7
  $filepath = admin_url() . 'admin.php?page=' . urlencode($_GET['page']);
8
  $all_playlists = get_b_playlists();
39
  var numchecked = getNumChecked(document.getElementById('updatePlaylist'));
40
 
41
  if(numchecked < 1) {
42
+ alert('<?php echo esc_js(__("No items selected", "flash-album-gallery")); ?>');
43
  return false;
44
  }
45
 
47
 
48
  switch (actionId) {
49
  case "delete_items":
50
+ return confirm('<?php echo sprintf(esc_js(__("You are about to delete %s item(s) \n \n 'Cancel' to stop, 'OK' to proceed.",'flash-album-gallery')), "' + numchecked + '") ; ?>');
51
  break;
52
  }
53
 
54
+ return confirm('<?php echo sprintf(esc_js(__("You are about to start the bulk edit for %s item(s) \n \n 'Cancel' to stop, 'OK' to proceed.",'flash-album-gallery')), "' + numchecked + '") ; ?>');
55
  }
56
 
57
  function showDialog( windowId, height ) {
97
  </script>
98
 
99
  <div class="flag-wrap">
100
+ <h2><?php _e( 'Playlist', 'flash-album-gallery' ); ?>: <?php echo esc_html($playlist['title']); ?></h2>
101
  <div style="float: right; margin: -20px 3px 0 0;">
102
+ <span><a href="<?php echo $filepath; ?>"><?php _e('Back to Banner Box', 'flash-album-gallery'); ?></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
103
  <select name="select_playlist" onchange="window.location.href=this.options[this.selectedIndex].value">
104
+ <option selected="selected"><?php _e('Choose another playlist', 'flash-album-gallery'); ?></option>
105
  <?php
106
  foreach((array)$all_playlists as $playlist_file => $playlist_data) {
107
  $playlist_name = basename($playlist_file, '.xml');
120
  <div id="poststuff" class="metabox-holder">
121
  <div id="post-body"><div id="post-body-content"><div id="normal-sortables" style="position: relative;">
122
  <div id="flagalleryset" class="postbox" >
123
+ <h3 class="hndle"><span><?php _e('Playlist settings', 'flash-album-gallery'); ?></span></h3>
124
  <div class="inside">
125
  <table cellspacing="8" cellpadding="0" border="0">
126
  <tr>
127
+ <th align="left" valign="middle" scope="row"><?php _e('Shortcode', 'flash-album-gallery'); ?>:</th>
128
  <td align="left" valign="middle"><input type="text" readonly="readonly" size="50" onfocus="this.select()" value="[grandbanner xml=<?php echo sanitize_flagname($_GET['playlist']); ?>]" /></td>
129
+ <td rowspan="3" align="left" valign="top"><div><strong style="display: inline-block; width: 100px;"><?php _e("Playlist Skin", 'flash-album-gallery'); ?>:</strong>
130
  <input id="skinaction" type="hidden" name="skinaction" value="<?php echo sanitize_flagname($playlist['skin']); ?>" />
131
  <select id="skinname" name="skinname" style="width: 200px; height: 24px; font-size: 11px;">
132
  <?php require_once (dirname(__FILE__) . '/get_skin.php');
133
  $all_skins = get_skins($skin_folder='', $type='b');
134
+ $current_skin_title = __('No Skin', 'flash-album-gallery');
135
  if(count($all_skins)) {
136
  foreach ( (array)$all_skins as $skin_file => $skin_data) {
137
+ $cur = '';
138
+ if($playlist['skin'] == dirname($skin_file)){
139
+ $cur = ' selected="selected"';
140
+ $current_skin_title = $skin_data['Name'];
141
+ }
142
  echo '<option'.$cur.' value="'.dirname($skin_file).'">'.$skin_data['Name'].'</option>'."\n";
143
  }
144
  } else {
145
+ echo '<option value="nivoslider">'.__("No Skins", "flash-album-gallery").'</option>';
146
  }
147
  ?>
148
+ </select>&nbsp;&nbsp;<a id="skinOptions" class="thickbox" title="<?php echo esc_attr($current_skin_title); ?>" href="<?php echo FLAG_URLPATH.'admin/skin_options.php?show_options=1&amp;skin='.sanitize_flagname($playlist["skin"]).'&amp;TB_iframe=1&amp;width=600&amp;height=560'; ?>"><?php _e('Change Skin Options', 'flash-album-gallery' ); ?></a>
149
  </div>
150
+ <p style="margin:10px 0 0 100px;"><input type="submit" id="updatePlaylistSkin" name="updatePlaylistSkin" class="button-primary action" value="<?php _e('Update skin options for this playlist', 'flash-album-gallery'); ?>" /></p>
151
  </td>
152
  </tr>
153
  <tr>
154
+ <th align="left" valign="middle" scope="row"><?php _e('Title', 'flash-album-gallery'); ?>:</th>
155
  <td align="left" valign="middle"><input type="text" size="50" name="playlist_title" value="<?php echo esc_html($playlist['title']); ?>" /></td>
156
  </tr>
157
  <tr>
158
+ <th align="left" valign="top" scope="row"><?php _e('Description', 'flash-album-gallery'); ?>:</th>
159
  <td align="left" valign="top"><textarea name="playlist_descr" cols="60" rows="2" style="width: 95%" ><?php echo esc_html($playlist['description']); ?></textarea></td>
160
  </tr>
161
  <!--<tr>
162
+ <th align="left" valign="top" scope="row"><?php _e('Path', 'flash-album-gallery'); ?>:</th>
163
  <td align="left" colspan="2" valign="top"><?php echo $playlistPath; ?></td>
164
  </tr>-->
165
  </table>
170
  </div> <!-- poststuff -->
171
  <div class="tablenav flag-tablenav">
172
  <select id="bulkaction" name="bulkaction" class="alignleft">
173
+ <option value="no_action" ><?php _e("No action",'flash-album-gallery')?></option>
174
+ <option value="delete_items" ><?php _e("Delete items",'flash-album-gallery')?></option>
175
  </select>
176
+ <input class="button-secondary alignleft" style="margin-right:10px;" type="submit" name="updatePlaylist" value="<?php _e("OK",'flash-album-gallery')?>" onclick="if ( !checkSelected() ) return false;" />
177
+ <a href="<?php echo wp_nonce_url($filepath."&playlist=".sanitize_flagname($_GET['playlist'])."&mode=sort", 'flag_sort'); ?>" class="button-secondary alignleft" style="margin:1px 10px 0 0;"><?php _e("Sort Playlist",'flash-album-gallery')?></a>
178
+ <a href="#" onClick="jQuery('#form_listitems').submit();return false;" class="button-secondary alignleft" style="margin:1px 10px 0 0;"><?php _e("Add/Remove Items from Playlist",'flash-album-gallery')?></a>
179
+ <input type="submit" name="updatePlaylist" class="button-primary action alignright" value="<?php _e("Update Playlist",'flash-album-gallery')?>" />
180
  </div>
181
 
182
  <table id="flag-listvideo" class="widefat fixed flag-table" cellspacing="0" >
183
 
184
  <thead>
185
  <tr>
186
+ <th class="cb" width="54" scope="col"><a href="#" onclick="checkAll(document.getElementById('updatePlaylist'));return false;"><?php _e('Check', 'flash-album-gallery'); ?></a></th>
187
+ <th class="id" width="64" scope="col"><div><?php _e('ID', 'flash-album-gallery'); ?></div></th>
188
+ <th class="thumb" width="110" scope="col"><div><?php _e('Thumbnail', 'flash-album-gallery'); ?></div></th>
189
+ <th class="title_filename" scope="col"><div><?php _e('Filename / Title', 'flash-album-gallery'); ?></div></th>
190
+ <th class="description" scope="col"><div><?php _e('Description', 'flash-album-gallery'); ?></div></th>
191
  </tr>
192
  </thead>
193
  <tfoot>
194
  <tr>
195
+ <th class="cb" scope="col"><a href="#" onclick="checkAll(document.getElementById('updatePlaylist'));return false;"><?php _e('Check', 'flash-album-gallery'); ?></a></th>
196
+ <th class="id" scope="col"><?php _e('ID', 'flash-album-gallery'); ?></th>
197
+ <th class="thumb" scope="col"><?php _e('Thumbnail', 'flash-album-gallery'); ?></th>
198
+ <th class="title_filename" scope="col"><?php _e('Filename / Title', 'flash-album-gallery'); ?></th>
199
+ <th class="description" scope="col"><?php _e('Description', 'flash-album-gallery'); ?></th>
200
  </tr>
201
  </tfoot>
202
  <tbody>
204
  $counter = 0;
205
  if(count($items_a)) {
206
  $alt = ' class="alternate"';
 
207
  foreach($items_a as $item) {
208
  $ban = get_post($item);
209
+ if(!$ban){
210
+ continue;
211
+ }
212
+ $thumb = get_post_meta($item, 'thumbnail', true);
213
  $link = get_post_meta($ban->ID, 'link', true);
 
214
  if(empty($thumb)) {
215
  $thumb = wp_get_attachment_thumb_url($ban->ID);
 
216
  }
217
  $alt = ( empty($alt) ) ? ' class="alternate"' : '';
 
218
  $counter++;
219
  $url = wp_get_attachment_url($ban->ID);
220
  ?>
227
  <td class="title_filename">
228
  <strong><a href="<?php echo $url; ?>"><?php echo basename($url); ?></a></strong><br />
229
  <textarea title="Title" name="item_a[<?php echo $ban->ID; ?>][post_title]" cols="20" rows="1" style="width:95%; height: 25px; overflow:hidden;"><?php echo esc_html(stripslashes($ban->post_title)); ?></textarea><br />
230
+ <?php _e('URL', 'flash-album-gallery'); ?>: <input id="banlink-<?php echo $ban->ID; ?>" name="item_a[<?php echo $ban->ID; ?>][link]" style="width:50%;" type="text" value="<?php echo esc_url($link); ?>" /><br />
231
  </td>
232
  <td class="description">
233
  <textarea name="item_a[<?php echo $ban->ID; ?>][post_content]" style="width:95%; height: 96px; margin-top: 2px; font-size:12px; line-height:115%;" rows="1" ><?php echo esc_html(stripslashes($ban->post_content)); ?></textarea>
239
 
240
  // In the case you have no capaptibility to see the search result
241
  if ( $counter==0 )
242
+ echo '<tr><td colspan="5" align="center"><strong>'.__('No entries found','flash-album-gallery').'</strong></td></tr>';
243
 
244
  ?>
245
 
246
  </tbody>
247
  </table>
248
+ <p class="submit" style="text-align: right;"><input type="submit" class="button-primary action" name="updatePlaylist" value="<?php _e("Update Playlist",'flash-album-gallery')?>" /></p>
249
  </form>
250
  <form id="form_listitems" name="form_listitems" method="POST" action="<?php echo esc_url($filepath."&playlist=".sanitize_flagname($_GET['playlist'])."&mode=add"); ?>">
251
  <?php wp_nonce_field('flag_add'); ?>
admin/manage-galleries.php CHANGED
@@ -1,376 +1,420 @@
1
  <?php
2
 
3
- if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You are not allowed to call this page directly.'); }
 
 
4
 
5
  // *** show main gallery list
6
- function flag_manage_gallery_main() {
7
 
8
- global $flag, $flagdb, $wp_query;
9
-
10
- //Build the pagination for more than 25 galleries
11
- if ( ! isset( $_GET['paged'] ) || $_GET['paged'] < 1 )
12
- $_GET['paged'] = 1;
13
 
14
- $sort_gall_by = (isset($_GET['galsort']))? $_GET['galsort'] : $flag->options['albSort'];
15
- $sort_gall_dir = (isset($_GET['sortdir']))? $_GET['sortdir'] : $flag->options['albSortDir'];
16
- $ascdesc = ($sort_gall_dir == 'DESC')? 'ASC' : 'DESC';
 
17
 
18
- $_GET['paged'] = intval($_GET['paged']);
19
- $perpage = intval($flag->options['albPerPage'])? intval($flag->options['albPerPage']) : 50;
20
- $start = ( $_GET['paged'] - 1 ) * $perpage;
21
- $gallerylist = $flagdb->find_all_galleries($sort_gall_by, $sort_gall_dir, $counter = true, $perpage, $start, $exclude = false, $draft = true);
22
 
23
- $page_links = paginate_links( array(
24
- 'base' => add_query_arg( 'paged', '%#%' ),
25
- 'format' => '',
26
- 'prev_text' => __('&laquo;'),
27
- 'next_text' => __('&raquo;'),
28
- 'total' => $flagdb->paged['max_objects_per_page'],
29
- 'current' => $_GET['paged']
30
- ));
31
-
32
- ?>
33
- <script type="text/javascript">
34
- <!--
35
- function checkAll(form)
36
- {
37
- for (i = 0, n = form.elements.length; i < n; i++) {
38
- if(form.elements[i].type == "checkbox") {
39
- if(form.elements[i].name == "doaction[]") {
40
- if(form.elements[i].checked == true)
41
- form.elements[i].checked = false;
42
- else
43
- form.elements[i].checked = true;
44
- }
45
- }
46
- }
47
- }
48
-
49
- function getNumChecked(form)
50
- {
51
- var num = 0;
52
- for (i = 0, n = form.elements.length; i < n; i++) {
53
- if(form.elements[i].type == "checkbox") {
54
- if(form.elements[i].name == "doaction[]")
55
- if(form.elements[i].checked == true)
56
- num++;
57
- }
58
- }
59
- return num;
60
- }
61
 
62
- // this function check for a the number of selected images, sumbmit false when no one selected
63
- function checkSelected() {
64
-
65
- var numchecked = getNumChecked(document.getElementById('editgalleries'));
66
-
67
- if(numchecked < 1) {
68
- alert('<?php echo esc_js(__('No images selected', 'flag')); ?>');
69
- return false;
70
- }
71
-
72
- actionId = jQuery('#bulkaction').val();
73
-
74
- switch (actionId) {
75
- case "resize_images":
76
- showDialog('resize_images', 120);
77
- return false;
78
- break;
79
- case "new_thumbnail":
80
- showDialog('new_thumbnail', 160);
81
- return false;
82
- break;
83
- }
84
-
85
- return confirm('<?php echo sprintf(esc_js(__("You are about to start the bulk edit for %s galleries \n \n 'Cancel' to stop, 'OK' to proceed.",'flag')), "' + numchecked + '") ; ?>');
86
- }
87
 
88
- function showDialog( windowId, height ) {
89
- var form = document.getElementById('editgalleries');
90
- var elementlist = "";
91
- for (i = 0, n = form.elements.length; i < n; i++) {
92
- if(form.elements[i].type == "checkbox") {
93
- if(form.elements[i].name == "doaction[]")
94
- if(form.elements[i].checked == true)
95
- if (elementlist == "")
96
- elementlist = form.elements[i].value;
97
- else
98
- elementlist += "," + form.elements[i].value ;
99
- }
100
- }
101
- jQuery("#" + windowId + "_bulkaction").val(jQuery("#bulkaction").val());
102
- jQuery("#" + windowId + "_imagelist").val(elementlist);
103
- // console.log (jQuery("#TB_imagelist").val());
104
- tb_show("", "#TB_inline?width=640&height=" + height + "&inlineId=" + windowId + "&modal=true", false);
105
- }
106
-
107
- //-->
108
- </script>
109
- <div class="flag-wrap" style="margin-top:40px;">
110
- <h2><?php _e('Gallery Overview', 'flag'); ?></h2>
111
- <form class="search-form" action="" method="get">
112
- <p class="search-box">
113
- <label class="hidden" for="media-search-input"><?php _e( 'Search Images', 'flag' ); ?>:</label>
114
- <input type="hidden" id="page-name" name="page" value="flag-manage-gallery" />
115
- <input type="text" id="media-search-input" name="s" value="<?php the_search_query(); ?>" />
116
- <input type="submit" value="<?php _e( 'Search Images', 'flag' ); ?>" class="button" />
117
- </p>
118
- </form>
119
- <form id="editgalleries" class="flagform" method="POST" action="<?php echo $flag->manage_page->base_page . '&amp;paged=' . $_GET['paged']; ?>" accept-charset="utf-8">
120
- <?php wp_nonce_field('flag_bulkgallery'); ?>
121
- <input type="hidden" name="page" value="manage-galleries" />
122
-
123
- <div class="tablenav">
124
-
125
- <div class="alignleft actions">
126
- <?php if ( function_exists('json_encode') ) : ?>
127
- <select name="bulkaction" id="bulkaction">
128
- <option value="no_action" ><?php _e("No action",'flag'); ?></option>
129
- <option value="webview_images" ><?php _e("Create images optimized for web",'flag'); ?></option>
130
- <option value="new_thumbnail" ><?php _e("Create new thumbnails",'flag'); ?></option>
131
- <option value="resize_images" ><?php _e("Resize images",'flag'); ?></option>
132
- <option value="import_meta" ><?php _e("Import metadata",'flag'); ?></option>
133
- <option value="copy_meta" ><?php _e("Metadata to description",'flag'); ?></option>
134
- <?php do_action('flag_manage_galleries_bulkaction'); ?>
135
- </select>
136
- <input name="showThickbox" class="button-secondary" type="submit" value="<?php _e('Apply','flag'); ?>" onclick="if ( !checkSelected() ) return false;" />
137
- <?php endif; ?>
138
- </div>
139
-
140
- <?php if ( $page_links ) : ?>
141
- <div class="tablenav-pages"><?php $page_links_text = sprintf( '<span class="displaying-num">' . __( 'Displaying %s&#8211;%s of %s' ) . '</span>%s',
142
- number_format_i18n( ( $_GET['paged'] - 1 ) * $perpage + 1 ),
143
- number_format_i18n( min( $_GET['paged'] * $perpage, $flagdb->paged['total_objects'] ) ),
144
- number_format_i18n( $flagdb->paged['total_objects'] ),
145
- $page_links
146
- ); echo $page_links_text; ?></div>
147
- <br class="clear" />
148
- <?php endif; ?>
149
-
150
- </div>
151
- <table class="widefat flag-table" cellspacing="0">
152
- <thead>
153
- <tr>
154
- <th scope="col" class="cb column-cb" >
155
- <input type="checkbox" onclick="checkAll(document.getElementById('editgalleries'));" name="checkall"/>
156
- </th>
157
- <th scope="col"><a href="<?php echo $flag->manage_page->base_page . "&galsort=gid&sortdir={$ascdesc}&paged=" . $_GET['paged']; ?>"><?php _e('ID'); ?></a></th>
158
- <th scope="col"><a href="<?php echo $flag->manage_page->base_page . "&galsort=title&sortdir={$ascdesc}&paged=" . $_GET['paged']; ?>"><?php _e('Title', 'flag'); ?></a></th>
159
- <th scope="col"><?php _e('Description', 'flag'); ?></th>
160
- <th scope="col"><?php _e('Author', 'flag'); ?></th>
161
- <th scope="col"><?php _e('Quantity', 'flag'); ?></th>
162
- <th scope="col"><?php _e('Action', 'flag'); ?></th>
163
- </tr>
164
- </thead>
165
- <tbody>
166
- <?php
167
- if($gallerylist) {
168
- foreach($gallerylist as $gallery) {
169
- $class = ( !isset($class) || $class == 'alt ' ) ? '' : 'alt ';
170
- $gid = $gallery->gid;
171
- $name = (empty($gallery->title) ) ? $gallery->name : $gallery->title;
172
- $author_user = get_userdata( (int) $gallery->author );
173
- ?>
174
- <tr id="gallery-<?php echo $gid; ?>" class="<?php echo $class; echo ( $gallery->status ) ? 'flag_draft' : 'flag_public'; ?>" >
175
- <th scope="row" class="cb column-cb">
176
- <?php if (flagAdmin::can_manage_this_gallery($gallery->author)) { ?>
177
- <input name="doaction[]" type="checkbox" value="<?php echo $gid; ?>" />
178
- <?php } ?>
179
- </th>
180
- <td scope="row"><?php echo $gid; ?></td>
181
- <td style="width:30%">
182
- <?php if (flagAdmin::can_manage_this_gallery($gallery->author)) { ?>
183
- <a href="<?php echo wp_nonce_url( $flag->manage_page->base_page . "&amp;mode=edit&amp;gid=" . $gid, 'flag_editgallery')?>" class='edit' title="<?php _e('Edit'); ?>" >
184
- <?php echo esc_html(flagGallery::i18n($name)); ?>
185
- </a>
186
- <?php } else { ?>
187
- <?php echo esc_html(flagGallery::i18n($gallery->title)); ?>
188
- <?php }
189
- if($gallery->status){ echo ' <b>- '.__('Draft', 'flag').'</b>'; }?>
190
- </td>
191
- <td style="width:30%"><?php echo esc_html(flagGallery::i18n($gallery->galdesc)); ?>&nbsp;</td>
192
- <td><?php echo $author_user->display_name; ?></td>
193
- <td><?php echo $gallery->counter; ?></td>
194
- <td style="white-space:nowrap;">
195
- <?php if (flagAdmin::can_manage_this_gallery($gallery->author)) : ?>
196
- <a href="<?php echo wp_nonce_url( $flag->manage_page->base_page . "&amp;mode=delete&amp;gid=" . $gid, 'flag_editgallery')?>" class="delete" onclick="javascript:check=confirm( '<?php _e("Delete this gallery ?",'flag')?>');if(check==false) return false;"><?php _e('Delete','flag'); ?></a>
197
- <?php if($gallery->status) { ?>
198
- | <a href="<?php echo wp_nonce_url( $flag->manage_page->base_page . "&amp;mode=publish&amp;gid=" . $gid, 'flag_editgallery')?>" class="status" onclick="javascript:check=confirm( '<?php _e("Publish this gallery?",'flag')?>');if(check==false) return false;"><?php _e('Publish','flag'); ?></a>
199
- <?php } else { ?>
200
- | <a href="<?php echo wp_nonce_url( $flag->manage_page->base_page . "&amp;mode=draft&amp;gid=" . $gid, 'flag_editgallery')?>" class="status" onclick="javascript:check=confirm( '<?php _e("Make this gallery draft?",'flag')?>');if(check==false) return false;"><?php _e('Draft','flag'); ?></a>
201
- <?php } ?>
202
- <?php endif; ?>
203
- </td>
204
- </tr>
205
- <?php
206
- }
207
- } else {
208
- echo '<tr><td colspan="7" align="center"><strong>'.__('No entries found','flag').'</strong></td></tr>';
209
- }
210
- ?>
211
- </tbody>
212
- </table>
213
- </form>
214
- </div>
215
- <?php if ( current_user_can('FlAG Manage others gallery') ) { ?>
216
- <script type="text/javascript">
217
- /*<![CDATA[*/
218
- jQuery(document).ready(function(){
219
- jQuery(".album_categoties").sortable({ opacity: 0.6, cursor: 'move', connectWith: ".album_categoties", update: function() {}}).disableSelection();
220
- jQuery( "#draggable .acat" ).draggable({
221
- connectToSortable: ".album_categoties",
222
- helper: "clone",
223
- revert: "invalid"
224
- }).disableSelection();
225
- jQuery( ".album_categoties" ).droppable({
226
- accept: ".acat",
227
- hoverClass: "active",
228
- drop: function( event, ui ) {
229
- jQuery( this ).find(jQuery(ui.draggable)).addClass( "highlight_new" ).attr("id", "g_"+jQuery(ui.draggable).attr('rel')).removeAttr('style');
230
- jQuery( this ).find( "p" ).hide();
231
- }
232
- });
233
- jQuery( ".album_categoties .drop" ).live('click',function(){
234
- var acat_parent = jQuery(this).parent().parent();
235
- jQuery(this).parent().remove();
236
- if(!acat_parent.find('.acat').length){
237
- acat_parent.find('p').show();
238
- }
239
- });
240
- jQuery('.flag-ajax-post').click(function(e){
241
- var form = jQuery(this).attr('data-form');
242
- var edata = jQuery(this).dataset();
243
- edata.form = jQuery('#'+form).serialize()+'&'+jQuery(this).parents('.album').find('.album_categoties').sortable("serialize");
244
- jQuery.post( ajaxurl, edata,
245
- function( response ) {
246
- jQuery(e.target).parent().find('.alb_msg').show().html(response).fadeOut(1200);
247
- if(jQuery(e.target).hasClass('del')) {
248
- jQuery(e.target).parent().parent().parent().remove();
249
- }
250
- if(response == 'Success'){
251
- jQuery(e.target).parents('div.album:first').find('.acat').removeClass('highlight_new');
252
- jQuery(e.target).parents('span.album_actions').find('.alb_msg').show().text('OK').fadeOut(1200);
253
- }
254
- }
255
- );
256
- return false;
257
- });
258
- });
259
- /*]]>*/
260
- </script>
261
- <div class="flag-wrap">
262
- <h2><?php _e('Albums', 'flag'); ?></h2>
263
- <form method="post" style="width: 658px; float: left;" action="<?php echo admin_url('admin.php?page=flag-manage-gallery'); ?>"><?php wp_nonce_field('flag_album'); ?>
264
- <p><input type="text" id="album_name" name="album_name" value="" /> &nbsp; <input type="submit" value="<?php _e('Create New Album','flag'); ?>" class="button-primary" /></p></form>
265
- <h2><?php _e('Categories', 'flag'); ?></h2>
266
- <div class="clear"></div>
267
- <div class="floatholder">
268
- <div class="albums_table">
269
- <?php $albumlist = $flagdb->find_all_albums();
270
- $nonce = wp_create_nonce( 'wpMediaLib' );
271
- if($albumlist) {
272
- foreach($albumlist as $album) {
273
- ?>
274
- <div class="album">
275
- <div class="album_name"><span class="albID"><?php echo $album->id; ?>.</span> <form method="post" id="albName_<?php echo $album->id; ?>" name="albName_<?php echo $album->id; ?>"><input type="text" name="album_name" value="<?php echo esc_html($album->name); ?>" /><input type="hidden" name="album_id" value="<?php echo $album->id; ?>" /></form> <span class="album_actions"><span class="alb_msg"></span>&nbsp;&nbsp;&nbsp;<span class="button del flag-ajax-post" data-action="flag_delete_album" data-_ajax_nonce="<?php echo $nonce; ?>" data-post="<?php echo $album->id; ?>"><?php _e('Delete', 'flag'); ?></span>&nbsp;&nbsp;<span class="album_save flag-ajax-post button-primary" data-action="flag_save_album" data-_ajax_nonce="<?php echo $nonce; ?>" data-form="albName_<?php echo $album->id; ?>"><strong><?php _e('Save', 'flag'); ?></strong></span></span></div>
276
- <div class="album_categoties">
277
- <?php $galids = explode(',',$album->categories);
278
- if($album->categories) {
279
- foreach($galids as $galid) {
280
- $acat = $flagdb->find_gallery($galid);
281
- ?>
282
-
283
- <div class="acat" id="g_<?php echo $acat->gid; ?>"><?php echo esc_html($acat->title); ?><span class="drop">x</span></div>
284
- <?php }
285
- } else {
286
- echo '<p style="text-align:center; padding: 7px 0; margin: 0;">'.__('Drag&Drop Categories Here','flag').'</p>';
287
- }
288
- ?>
289
- </div>
290
- </div>
291
- <?php }
292
- } else {
293
- echo '<p style="text-align:center; padding: 20px 0; margin: 0;">'.__('No Albums','flag').'</p>';
294
- }
295
- ?>
296
- </div>
297
- <div class="all_galleries" id="draggable">
298
- <?php
299
- if($gallerylist) {
300
- foreach($gallerylist as $gallery) {
301
- $gid = $gallery->gid;
302
- $name = (empty($gallery->title) ) ? $gallery->name : esc_html($gallery->title);
303
- $author_user = get_userdata( (int) $gallery->author );
304
- if (flagAdmin::can_manage_this_gallery($gallery->author)) {
305
- ?>
306
- <div class="acat" rel="<?php echo $gid; ?>"><?php echo $name; ?><span class="drop">x</span></div>
307
- <?php
308
- }
309
- }
310
- }
311
- ?>
312
- </div>
313
- </div>
314
- </div>
315
- <?php } ?>
316
- <!-- #resize_images -->
317
- <div id="resize_images" style="display: none;" >
318
- <form id="form_resize_images" method="POST" accept-charset="utf-8">
319
- <?php wp_nonce_field('flag_thickbox_form'); ?>
320
- <input type="hidden" id="resize_images_imagelist" name="TB_imagelist" value="" />
321
- <input type="hidden" id="resize_images_bulkaction" name="TB_bulkaction" value="" />
322
- <input type="hidden" name="page" value="manage-galleries" />
323
- <table width="100%" border="0" cellspacing="3" cellpadding="3" >
324
- <tr valign="top">
325
- <td>
326
- <strong><?php _e('Resize Images to', 'flag'); ?>:</strong>
327
- </td>
328
- <td>
329
- <input type="text" size="5" name="imgWidth" value="<?php echo $flag->options['imgWidth']; ?>" /> x <input type="text" size="5" name="imgHeight" value="<?php echo $flag->options['imgHeight']; ?>" />
330
- <br /><small><?php _e('Width x height (in pixel). FlAGallery will keep ratio size','flag'); ?></small>
331
- </td>
332
- </tr>
333
- <tr align="right">
334
- <td colspan="2" class="submit">
335
- <input class="button-primary" type="submit" name="TB_ResizeImages" value="<?php _e('OK', 'flag'); ?>" />
336
- &nbsp;
337
- <input class="button-secondary" type="reset" value="&nbsp;<?php _e('Cancel', 'flag'); ?>&nbsp;" onclick="tb_remove()"/>
338
- </td>
339
- </tr>
340
- </table>
341
- </form>
342
- </div>
343
- <!-- /#resize_images -->
344
 
345
- <!-- #new_thumbnail -->
346
- <div id="new_thumbnail" style="display: none;" >
347
- <form id="form_new_thumbnail" method="POST" accept-charset="utf-8">
348
- <?php wp_nonce_field('flag_thickbox_form'); ?>
349
- <input type="hidden" id="new_thumbnail_imagelist" name="TB_imagelist" value="" />
350
- <input type="hidden" id="new_thumbnail_bulkaction" name="TB_bulkaction" value="" />
351
- <input type="hidden" name="page" value="manage-galleries" />
352
- <table width="100%" border="0" cellspacing="3" cellpadding="3" >
353
- <tr valign="top">
354
- <th align="left"><?php _e('Width x height (in pixel)','flag'); ?></th>
355
- <td><input type="text" size="5" maxlength="5" name="thumbWidth" value="<?php echo $flag->options['thumbWidth']; ?>" /> x <input type="text" size="5" maxlength="5" name="thumbHeight" value="<?php echo $flag->options['thumbHeight']; ?>" />
356
- <br /><small><?php _e('These values are maximum values ','flag'); ?></small></td>
357
- </tr>
358
- <tr valign="top">
359
- <th align="left"><?php _e('Set fix dimension','flag'); ?></th>
360
- <td><input type="checkbox" name="thumbFix" value="1" <?php checked('1', $flag->options['thumbFix']); ?> />
361
- <br /><small><?php _e('Ignore the aspect ratio, no portrait thumbnails','flag'); ?></small></td>
362
- </tr>
363
- <tr align="right">
364
- <td colspan="2" class="submit">
365
- <input class="button-primary" type="submit" name="TB_NewThumbnail" value="<?php _e('OK', 'flag'); ?>" />
366
- &nbsp;
367
- <input class="button-secondary" type="reset" value="&nbsp;<?php _e('Cancel', 'flag'); ?>&nbsp;" onclick="tb_remove()"/>
368
- </td>
369
- </tr>
370
- </table>
371
- </form>
372
- </div>
373
- <!-- /#new_thumbnail -->
374
 
375
- <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
376
  }
1
  <?php
2
 
3
+ if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])){
4
+ die('You are not allowed to call this page directly.');
5
+ }
6
 
7
  // *** show main gallery list
8
+ function flag_manage_gallery_main(){
9
 
10
+ global $flag, $flagdb, $wp_query;
 
 
 
 
11
 
12
+ //Build the pagination for more than 25 galleries
13
+ if( !isset($_GET['paged']) || $_GET['paged'] < 1){
14
+ $_GET['paged'] = 1;
15
+ }
16
 
17
+ $sort_gall_by = (isset($_GET['galsort']))? $_GET['galsort'] : $flag->options['albSort'];
18
+ $sort_gall_dir = (isset($_GET['sortdir']))? $_GET['sortdir'] : $flag->options['albSortDir'];
19
+ $ascdesc = ($sort_gall_dir == 'DESC')? 'ASC' : 'DESC';
 
20
 
21
+ $_GET['paged'] = intval($_GET['paged']);
22
+ $perpage = intval($flag->options['albPerPage'])? intval($flag->options['albPerPage']) : 50;
23
+ $start = ($_GET['paged'] - 1) * $perpage;
24
+ $gallerylist = $flagdb->find_all_galleries($sort_gall_by, $sort_gall_dir, $counter = true, $perpage, $start, $exclude = false, $draft = true);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
25
 
26
+ $page_links = paginate_links(array(
27
+ 'base' => add_query_arg('paged', '%#%'),
28
+ 'format' => '',
29
+ 'prev_text' => __('&laquo;'),
30
+ 'next_text' => __('&raquo;'),
31
+ 'total' => $flagdb->paged['max_objects_per_page'],
32
+ 'current' => $_GET['paged'],
33
+ )
34
+ );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
 
36
+ ?>
37
+ <script type="text/javascript">
38
+ <!--
39
+ function checkAll(form){
40
+ for(i = 0, n = form.elements.length; i < n; i++){
41
+ if(form.elements[i].type == "checkbox"){
42
+ if(form.elements[i].name == "doaction[]"){
43
+ if(form.elements[i].checked == true)
44
+ form.elements[i].checked = false;
45
+ else
46
+ form.elements[i].checked = true;
47
+ }
48
+ }
49
+ }
50
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
51
 
52
+ function getNumChecked(form){
53
+ var num = 0;
54
+ for(i = 0, n = form.elements.length; i < n; i++){
55
+ if(form.elements[i].type == "checkbox"){
56
+ if(form.elements[i].name == "doaction[]")
57
+ if(form.elements[i].checked == true)
58
+ num++;
59
+ }
60
+ }
61
+ return num;
62
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
63
 
64
+ // this function check for a the number of selected images, sumbmit false when no one selected
65
+ function checkSelected(){
66
+
67
+ var numchecked = getNumChecked(document.getElementById('editgalleries'));
68
+
69
+ if(numchecked < 1){
70
+ alert('<?php echo esc_js(__('No images selected', 'flash-album-gallery')); ?>');
71
+ return false;
72
+ }
73
+
74
+ actionId = jQuery('#bulkaction').val();
75
+
76
+ switch(actionId){
77
+ case "resize_images":
78
+ showDialog('resize_images', 120);
79
+ return false;
80
+ break;
81
+ case "new_thumbnail":
82
+ showDialog('new_thumbnail', 160);
83
+ return false;
84
+ break;
85
+ }
86
+
87
+ return confirm('<?php echo sprintf(esc_js(__("You are about to start the bulk edit for %s galleries \n \n 'Cancel' to stop, 'OK' to proceed.", 'flash-album-gallery')), "' + numchecked + '"); ?>');
88
+ }
89
+
90
+ function showDialog(windowId, height){
91
+ var form = document.getElementById('editgalleries');
92
+ var elementlist = "";
93
+ for(i = 0, n = form.elements.length; i < n; i++){
94
+ if(form.elements[i].type == "checkbox"){
95
+ if(form.elements[i].name == "doaction[]")
96
+ if(form.elements[i].checked == true)
97
+ if(elementlist == "")
98
+ elementlist = form.elements[i].value;
99
+ else
100
+ elementlist += "," + form.elements[i].value;
101
+ }
102
+ }
103
+ jQuery("#" + windowId + "_bulkaction").val(jQuery("#bulkaction").val());
104
+ jQuery("#" + windowId + "_imagelist").val(elementlist);
105
+ // console.log (jQuery("#TB_imagelist").val());
106
+ tb_show("", "#TB_inline?width=640&height=" + height + "&inlineId=" + windowId + "&modal=true", false);
107
+ }
108
+
109
+ //-->
110
+ </script>
111
+ <div class="flag-wrap" style="margin-top:40px;">
112
+ <h2><?php _e('Gallery Overview', 'flash-album-gallery'); ?></h2>
113
+ <div class="updated" style="margin:0 0 10px;">
114
+ <?php
115
+ _e('Have a problem with blurry thumbnails or the large image doesn\'t loading?
116
+ <br>Then select gallery(ies) and in Actions dropdown choose "Create new thumbnails" -> click Apply button and set thumbnails size to fit your needs.
117
+ <br>Note that some skins also have settings for thumbnail\'s display size.', 'flash-album-gallery');
118
+ ?>
119
+ </div>
120
+ <form class="search-form" action="" method="get" style="float:right">
121
+ <p class="search-box">
122
+ <label class="hidden" for="media-search-input"><?php _e('Search Images', 'flash-album-gallery'); ?>
123
+ :</label>
124
+ <input type="hidden" id="page-name" name="page" value="flag-manage-gallery"/>
125
+ <input type="text" id="media-search-input" name="s" value="<?php the_search_query(); ?>"/>
126
+ <input type="submit" value="<?php _e('Search Images', 'flash-album-gallery'); ?>" class="button"/>
127
+ </p>
128
+ </form>
129
+ <form id="editgalleries" class="flagform" method="POST" action="<?php echo $flag->manage_page->base_page . '&amp;paged=' . $_GET['paged']; ?>" accept-charset="utf-8">
130
+ <?php wp_nonce_field('flag_bulkgallery'); ?>
131
+ <input type="hidden" name="page" value="manage-galleries"/>
132
+
133
+ <div class="tablenav" style="clear:none">
134
+
135
+ <div class="alignleft actions">
136
+ <?php if(function_exists('json_encode')) : ?>
137
+ <select name="bulkaction" id="bulkaction">
138
+ <option value="no_action"><?php _e("No action", 'flash-album-gallery'); ?></option>
139
+ <option value="webview_images"><?php _e("Create images optimized for web", 'flash-album-gallery'); ?></option>
140
+ <option value="new_thumbnail"><?php _e("Create new thumbnails", 'flash-album-gallery'); ?></option>
141
+ <option value="resize_images"><?php _e("Resize images", 'flash-album-gallery'); ?></option>
142
+ <option value="import_meta"><?php _e("Import metadata", 'flash-album-gallery'); ?></option>
143
+ <option value="copy_meta"><?php _e("Metadata to description", 'flash-album-gallery'); ?></option>
144
+ <?php do_action('flag_manage_galleries_bulkaction'); ?>
145
+ </select>
146
+ <input name="showThickbox" class="button-secondary" type="submit" value="<?php _e('Apply', 'flash-album-gallery'); ?>" onclick="if ( !checkSelected() ) return false;"/>
147
+ <?php endif; ?>
148
+ </div>
149
+
150
+ <?php if($page_links) : ?>
151
+ <div class="tablenav-pages"><?php $page_links_text = sprintf('<span class="displaying-num">' . __('Displaying %s&#8211;%s of %s') . '</span>%s',
152
+ number_format_i18n(($_GET['paged'] - 1) * $perpage + 1),
153
+ number_format_i18n(min($_GET['paged'] * $perpage, $flagdb->paged['total_objects'])),
154
+ number_format_i18n($flagdb->paged['total_objects']),
155
+ $page_links
156
+ );
157
+ echo $page_links_text; ?></div>
158
+ <br class="clear"/>
159
+ <?php endif; ?>
160
+
161
+ </div>
162
+ <table class="widefat flag-table" cellspacing="0">
163
+ <thead>
164
+ <tr>
165
+ <th scope="col" class="cb column-cb">
166
+ <input type="checkbox" onclick="checkAll(document.getElementById('editgalleries'));" name="checkall"/>
167
+ </th>
168
+ <th scope="col">
169
+ <a href="<?php echo $flag->manage_page->base_page . "&galsort=gid&sortdir={$ascdesc}&paged=" . $_GET['paged']; ?>"><?php _e('ID'); ?></a>
170
+ </th>
171
+ <th scope="col">
172
+ <a href="<?php echo $flag->manage_page->base_page . "&galsort=title&sortdir={$ascdesc}&paged=" . $_GET['paged']; ?>"><?php _e('Title', 'flash-album-gallery'); ?></a>
173
+ </th>
174
+ <th scope="col"><?php _e('Description', 'flash-album-gallery'); ?></th>
175
+ <th scope="col"><?php _e('Author', 'flash-album-gallery'); ?></th>
176
+ <th scope="col"><?php _e('Quantity', 'flash-album-gallery'); ?></th>
177
+ <th scope="col"><?php _e('Action', 'flash-album-gallery'); ?></th>
178
+ </tr>
179
+ </thead>
180
+ <tbody>
181
+ <?php
182
+ if($gallerylist){
183
+ foreach($gallerylist as $gallery){
184
+ $class = ( !isset($class) || $class == 'alt ')? '' : 'alt ';
185
+ $gid = $gallery->gid;
186
+ $name = (empty($gallery->title))? $gallery->name : $gallery->title;
187
+ $author_user = get_userdata((int) $gallery->author);
188
+ ?>
189
+ <tr id="gallery-<?php echo $gid; ?>" class="<?php echo $class;
190
+ echo ($gallery->status)? 'flag_draft' : 'flag_public'; ?>">
191
+ <th scope="row" class="cb column-cb">
192
+ <?php if(flagAdmin::can_manage_this_gallery($gallery->author)){ ?>
193
+ <input name="doaction[]" type="checkbox" value="<?php echo $gid; ?>"/>
194
+ <?php } ?>
195
+ </th>
196
+ <td scope="row"><?php echo $gid; ?></td>
197
+ <td style="width:30%">
198
+ <?php if(flagAdmin::can_manage_this_gallery($gallery->author)){ ?>
199
+ <a href="<?php echo wp_nonce_url($flag->manage_page->base_page . "&amp;mode=edit&amp;gid=" . $gid, 'flag_editgallery') ?>" class='edit' title="<?php _e('Edit'); ?>">
200
+ <?php echo esc_html(flagGallery::i18n($name)); ?>
201
+ </a>
202
+ <?php } else{ ?>
203
+ <?php echo esc_html(flagGallery::i18n($gallery->title)); ?>
204
+ <?php }
205
+ if($gallery->status){
206
+ echo ' <b>- ' . __('Draft', 'flash-album-gallery') . '</b>';
207
+ } ?>
208
+ </td>
209
+ <td style="width:30%"><?php echo esc_html(flagGallery::i18n($gallery->galdesc)); ?>&nbsp;
210
+ </td>
211
+ <td><?php echo $author_user->display_name; ?></td>
212
+ <td><?php echo $gallery->counter; ?></td>
213
+ <td style="white-space:nowrap;">
214
+ <?php if(flagAdmin::can_manage_this_gallery($gallery->author)) : ?>
215
+ <a href="<?php echo wp_nonce_url($flag->manage_page->base_page . "&amp;mode=delete&amp;gid=" . $gid, 'flag_editgallery') ?>" class="delete" onclick="javascript:check=confirm( '<?php _e("Delete this gallery ?", 'flash-album-gallery') ?>');if(check==false) return false;"><?php _e('Delete', 'flash-album-gallery'); ?></a>
216
+ <?php if($gallery->status){ ?>
217
+ |
218
+ <a href="<?php echo wp_nonce_url($flag->manage_page->base_page . "&amp;mode=publish&amp;gid=" . $gid, 'flag_editgallery') ?>" class="status" onclick="javascript:check=confirm( '<?php _e("Publish this gallery?", 'flash-album-gallery') ?>');if(check==false) return false;"><?php _e('Publish', 'flash-album-gallery'); ?></a>
219
+ <?php } else{ ?>
220
+ |
221
+ <a href="<?php echo wp_nonce_url($flag->manage_page->base_page . "&amp;mode=draft&amp;gid=" . $gid, 'flag_editgallery') ?>" class="status" onclick="javascript:check=confirm( '<?php _e("Make this gallery draft?", 'flash-album-gallery') ?>');if(check==false) return false;"><?php _e('Draft', 'flash-album-gallery'); ?></a>
222
+ <?php } ?>
223
+ <?php endif; ?>
224
+ </td>
225
+ </tr>
226
+ <?php
227
+ }
228
+ } else{
229
+ echo '<tr><td colspan="7" align="center"><strong>' . __('No entries found', 'flash-album-gallery') . '</strong></td></tr>';
230
+ }
231
+ ?>
232
+ </tbody>
233
+ </table>
234
+ </form>
235
+ </div>
236
+ <?php if(current_user_can('FlAG Manage others gallery')){ ?>
237
+ <script type="text/javascript">
238
+ /*<![CDATA[*/
239
+ jQuery(document).ready(function(){
240
+ jQuery(".album_categoties").sortable({
241
+ opacity: 0.6,
242
+ cursor: 'move',
243
+ connectWith: ".album_categoties",
244
+ update: function(){}
245
+ }).disableSelection();
246
+ jQuery("#draggable .acat").draggable({
247
+ connectToSortable: ".album_categoties",
248
+ helper: "clone",
249
+ revert: "invalid"
250
+ }).disableSelection();
251
+ jQuery(".album_categoties").droppable({
252
+ accept: ".acat",
253
+ hoverClass: "active",
254
+ drop: function(event, ui){
255
+ jQuery(this).find(jQuery(ui.draggable)).addClass("highlight_new").attr("id", "g_" + jQuery(ui.draggable).attr('rel')).removeAttr('style');
256
+ jQuery(this).find("p").hide();
257
+ }
258
+ });
259
+ jQuery(".album_categoties").on('click', '.drop', function(){
260
+ var acat_parent = jQuery(this).parent().parent();
261
+ jQuery(this).parent().remove();
262
+ if(!acat_parent.find('.acat').length){
263
+ acat_parent.find('p').show();
264
+ }
265
+ });
266
+ jQuery('.flag-ajax-post').click(function(e){
267
+ var form = jQuery(this).attr('data-form');
268
+ var edata = jQuery(this).dataset();
269
+ edata.form = jQuery('#' + form).serialize() + '&' + jQuery(this).parents('.album').find('.album_categoties').sortable("serialize");
270
+ jQuery.post(ajaxurl, edata,
271
+ function(response){
272
+ jQuery(e.target).parent().find('.alb_msg').show().html(response).fadeOut(1200);
273
+ if(jQuery(e.target).hasClass('del')){
274
+ jQuery(e.target).parent().parent().parent().remove();
275
+ }
276
+ if(response == 'Success'){
277
+ jQuery(e.target).parents('div.album:first').find('.acat').removeClass('highlight_new');
278
+ jQuery(e.target).parents('span.album_actions').find('.alb_msg').show().text('OK').fadeOut(1200);
279
+ }
280
+ }
281
+ );
282
+ return false;
283
+ });
284
+ });
285
+ /*]]>*/
286
+ </script>
287
+ <div class="flag-wrap">
288
+ <div class="floatholder">
289
+ <div style="float:left;">
290
+ <h2 style="float:left; margin:5px 0;"><?php _e('Albums', 'flash-album-gallery'); ?></h2>
291
+ <form method="post" style="float: right;" action="<?php echo admin_url('admin.php?page=flag-manage-gallery'); ?>"><?php wp_nonce_field('flag_album'); ?>
292
+ <div><input type="text" id="album_name" name="album_name" value=""/> &nbsp;
293
+ <input type="submit" value="<?php _e('Create New Album', 'flash-album-gallery'); ?>" class="button-primary"/>
294
+ </div></form>
295
+ <div class="clearfix"></div>
296
+ <div class="albums_table">
297
+ <?php $albumlist = $flagdb->find_all_albums();
298
+ $nonce = wp_create_nonce('wpMediaLib');
299
+ if($albumlist){
300
+ foreach($albumlist as $album){
301
+ ?>
302
+ <div class="album">
303
+ <div class="album_name"><span class="albID"><?php echo $album->id; ?>.</span>
304
+ <form method="post" id="albName_<?php echo $album->id; ?>" name="albName_<?php echo $album->id; ?>">
305
+ <input type="text" name="album_name" value="<?php echo esc_html($album->name); ?>"/><input type="hidden" name="album_id" value="<?php echo $album->id; ?>"/>
306
+ </form>
307
+ <span class="album_actions"><span class="alb_msg"></span>&nbsp;&nbsp;&nbsp;<span class="button del flag-ajax-post" data-action="flag_delete_album" data-_ajax_nonce="<?php echo $nonce; ?>" data-post="<?php echo $album->id; ?>"><?php _e('Delete', 'flash-album-gallery'); ?></span>&nbsp;&nbsp;<span class="album_save flag-ajax-post button-primary" data-action="flag_save_album" data-_ajax_nonce="<?php echo $nonce; ?>" data-form="albName_<?php echo $album->id; ?>"><strong><?php _e('Save', 'flash-album-gallery'); ?></strong></span></span>
308
+ </div>
309
+ <div class="album_categoties">
310
+ <?php $galids = explode(',', $album->categories);
311
+ if($album->categories){
312
+ foreach($galids as $galid){
313
+ $acat = $flagdb->find_gallery($galid);
314
+ ?>
315
+
316
+ <div class="acat" id="g_<?php echo $acat->gid; ?>"><?php echo esc_html($acat->title); ?>
317
+ <span class="drop">x</span></div>
318
+ <?php }
319
+ } else{
320
+ echo '<p style="text-align:center; padding: 7px 0; margin: 0;">' . __('Drag&Drop Categories Here', 'flash-album-gallery') . '</p>';
321
+ }
322
+ ?>
323
+ </div>
324
+ </div>
325
+ <?php }
326
+ } else{
327
+ echo '<p style="text-align:center; padding: 20px 0; margin: 0;">' . __('No Albums', 'flash-album-gallery') . '</p>';
328
+ }
329
+ ?>
330
+ </div>
331
+ </div>
332
+
333
+ <div class="all_galleries">
334
+ <h2 style="margin:5px 0 12px;"><?php _e('Galleries', 'flash-album-gallery'); ?></h2>
335
+ <div id="draggable">
336
+ <?php
337
+ if($gallerylist){
338
+ foreach($gallerylist as $gallery){
339
+ $gid = $gallery->gid;
340
+ $name = (empty($gallery->title))? $gallery->name : esc_html($gallery->title);
341
+ $author_user = get_userdata((int) $gallery->author);
342
+ if(flagAdmin::can_manage_this_gallery($gallery->author)){
343
+ ?>
344
+ <div class="acat" rel="<?php echo $gid; ?>"><?php echo $name; ?>
345
+ <span class="drop">x</span></div>
346
+ <?php
347
+ }
348
+ }
349
+ }
350
+ ?>
351
+
352
+ </div>
353
+ </div>
354
+ </div>
355
+ </div>
356
+ <?php } ?>
357
+ <!-- #resize_images -->
358
+ <div id="resize_images" style="display: none;">
359
+ <form id="form_resize_images" method="POST" accept-charset="utf-8">
360
+ <?php wp_nonce_field('flag_thickbox_form'); ?>
361
+ <input type="hidden" id="resize_images_imagelist" name="TB_imagelist" value=""/>
362
+ <input type="hidden" id="resize_images_bulkaction" name="TB_bulkaction" value=""/>
363
+ <input type="hidden" name="page" value="manage-galleries"/>
364
+ <table width="100%" border="0" cellspacing="3" cellpadding="3">
365
+ <tr valign="top">
366
+ <td>
367
+ <strong><?php _e('Resize Images to', 'flash-album-gallery'); ?>:</strong>
368
+ </td>
369
+ <td>
370
+ <input type="text" size="5" name="imgWidth" value="<?php echo $flag->options['imgWidth']; ?>"/>
371
+ x
372
+ <input type="text" size="5" name="imgHeight" value="<?php echo $flag->options['imgHeight']; ?>"/>
373
+ <br/>
374
+ <small><?php _e('Width x height (in pixel). FlAGallery will keep ratio size', 'flash-album-gallery'); ?></small>
375
+ </td>
376
+ </tr>
377
+ <tr align="right">
378
+ <td colspan="2" class="submit">
379
+ <input class="button-primary" type="submit" name="TB_ResizeImages" value="<?php _e('OK', 'flash-album-gallery'); ?>"/>
380
+ &nbsp;
381
+ <input class="button-secondary" type="reset" value="&nbsp;<?php _e('Cancel', 'flash-album-gallery'); ?>&nbsp;" onclick="tb_remove()"/>
382
+ </td>
383
+ </tr>
384
+ </table>
385
+ </form>
386
+ </div>
387
+ <!-- /#resize_images -->
388
+
389
+ <!-- #new_thumbnail -->
390
+ <div id="new_thumbnail" style="display: none;">
391
+ <form id="form_new_thumbnail" method="POST" accept-charset="utf-8">
392
+ <?php wp_nonce_field('flag_thickbox_form'); ?>
393
+ <input type="hidden" id="new_thumbnail_imagelist" name="TB_imagelist" value=""/>
394
+ <input type="hidden" id="new_thumbnail_bulkaction" name="TB_bulkaction" value=""/>
395
+ <input type="hidden" name="page" value="manage-galleries"/>
396
+ <table width="100%" border="0" cellspacing="3" cellpadding="3">
397
+ <tr valign="top">
398
+ <th align="left"><?php _e('Width x height (in pixel)', 'flash-album-gallery'); ?></th>
399
+ <td>
400
+ <input type="number" size="5" maxlength="5" name="thumbWidth" min="300" max="800" value="<?php echo $flag->options['thumbWidth']; ?>"/>
401
+ x
402
+ <input type="number" size="5" maxlength="5" min="300" max="800" name="thumbHeight" value="<?php echo $flag->options['thumbHeight']; ?>"/>
403
+ <br/>
404
+ <small><?php _e('These values are maximum values ', 'flash-album-gallery'); ?></small>
405
+ </td>
406
+ </tr>
407
+ <tr align="right">
408
+ <td colspan="2" class="submit">
409
+ <input class="button-primary" type="submit" name="TB_NewThumbnail" value="<?php _e('OK', 'flash-album-gallery'); ?>"/>
410
+ &nbsp;
411
+ <input class="button-secondary" type="reset" value="&nbsp;<?php _e('Cancel', 'flash-album-gallery'); ?>&nbsp;" onclick="tb_remove()"/>
412
+ </td>
413
+ </tr>
414
+ </table>
415
+ </form>
416
+ </div>
417
+ <!-- /#new_thumbnail -->
418
+
419
+ <?php
420
  }
admin/manage-images.php CHANGED
@@ -28,13 +28,13 @@ function flag_picturelist() {
28
  $gallery = $flagdb->find_gallery($act_gid);
29
 
30
  if (!$gallery) {
31
- flagGallery::show_error(__('Gallery not found.', 'flag'));
32
  return;
33
  }
34
 
35
  // Check if you have the correct capability
36
  if (!flagAdmin::can_manage_this_gallery($gallery->author)) {
37
- flagGallery::show_error(__('Sorry, you have no access here', 'flag'));
38
  return;
39
  }
40
 
@@ -147,7 +147,7 @@ function checkSelected() {
147
  var numchecked = getNumChecked(document.getElementById('updategallery'));
148
 
149
  if(numchecked < 1) {
150
- alert('<?php echo esc_js(__("No images selected", "flag")); ?>');
151
  return false;
152
  }
153
 
@@ -169,7 +169,7 @@ function checkSelected() {
169
  break;
170
  }
171
 
172
- return confirm('<?php echo sprintf(esc_js(__("You are about to start the bulk edit for %s images \n \n 'Cancel' to stop, 'OK' to proceed.",'flag')), "' + numchecked + '") ; ?>');
173
  }
174
 
175
  jQuery(document).ready( function() {
@@ -184,13 +184,13 @@ jQuery(document).ready( function() {
184
  <div class="flag-wrap">
185
 
186
  <?php if ($is_search) :?>
187
- <h2><?php printf( __('Search results for &#8220;%s&#8221;', 'flag'), esc_html( stripslashes(get_search_query()) ) ); ?></h2>
188
  <form class="search-form" action="" method="get">
189
  <p class="search-box">
190
- <label class="hidden" for="media-search-input"><?php _e( 'Search Images', 'flag' ); ?>:</label>
191
  <input type="hidden" id="page-name" name="page" value="flag-manage-gallery" />
192
  <input type="text" id="media-search-input" name="s" value="<?php the_search_query(); ?>" />
193
- <input type="submit" value="<?php _e( 'Search Images', 'flag' ); ?>" class="button" />
194
  </p>
195
  </form>
196
 
@@ -202,9 +202,9 @@ jQuery(document).ready( function() {
202
 
203
  <?php else :?>
204
 
205
- <h2><?php echo _n( 'Gallery', 'Galleries', 1, 'flag' ); ?> : <?php echo esc_html($gallery->title); ?></h2>
206
  <select name="select_gid" style="width:180px; float: right; margin: -20px 3px 0 0;" onchange="window.location.href=this.options[this.selectedIndex].value">
207
- <option selected="selected"><?php _e('Choose another gallery', 'flag'); ?></option>
208
  <?php
209
  foreach ($gallerylist as $gal) {
210
  if ($gal->gid != $act_gid) {
@@ -225,26 +225,26 @@ jQuery(document).ready( function() {
225
  <div id="post-body"><div id="post-body-content"><div id="normal-sortables" class="meta-box-sortables ui-sortable" style="position: relative;">
226
  <div id="flagalleryset" class="postbox <?php echo postbox_classes('flagalleryset', 'flag-manage-gallery'); ?>" >
227
  <div class="handlediv" title="Click to toggle"><br/></div>
228
- <h3 class="hndle"><span><?php _e('Gallery settings', 'flag'); ?></span></h3>
229
  <div class="inside">
230
  <table class="flag-form-table" >
231
  <tr>
232
- <th align="right" scope="row"><?php _e('Title', 'flag'); ?>:</th>
233
  <td> </td>
234
  <td align="left"><input type="text" size="50" name="title" value="<?php echo esc_html($gallery->title); ?>" /></td>
235
  </tr>
236
  <tr>
237
- <th align="right" valign="top" scope="row"><?php _e('Description', 'flag'); ?>:</th>
238
  <td> </td>
239
  <td align="left"><textarea name="gallerydesc" cols="30" rows="3" style="width: 95%" ><?php echo esc_html($gallery->galdesc); ?></textarea></td>
240
  </tr>
241
  <tr>
242
- <th align="right" scope="row"><?php _e('Path', 'flag'); ?>:</th>
243
  <td> </td>
244
  <td align="left"><input <?php if (IS_WPMU) echo 'readonly = "readonly"'; ?> type="text" size="50" name="path" value="<?php echo esc_attr($gallery->path); ?>" /></td>
245
  </tr>
246
  <tr>
247
- <th align="right" scope="row"><?php _e('Author', 'flag'); ?>:</th>
248
  <td> </td>
249
  <td align="left">
250
  <?php
@@ -254,14 +254,14 @@ jQuery(document).ready( function() {
254
  else
255
  echo $act_author_user->display_name;
256
  ?>
257
- <input type="hidden" name="previewpic" value="<?php if(is_array($picturelist)) echo $picturelist[0]->pid; ?>" />
258
  </td>
259
  </tr>
260
  </table>
261
 
262
  <div class="submit">
263
- <input type="submit" class="button-secondary" name="scanfolder" value="<?php _e("Scan Folder for new images",'flag')?> " />
264
- <input type="submit" class="button-primary action" name="updatepictures" value="<?php _e("Save Changes",'flag')?>" />
265
  </div>
266
  <div class="clear"></div>
267
  </div>
@@ -281,27 +281,27 @@ jQuery(document).ready( function() {
281
  <?php endif; ?>
282
  <div class="alignleft actions">
283
  <select id="bulkaction" name="bulkaction" class="alignleft">
284
- <option value="no_action" ><?php _e("No action",'flag')?></option>
285
- <option value="webview_images" ><?php _e("Create images optimized for web",'flag'); ?></option>
286
- <option value="new_thumbnail" ><?php _e("Create new thumbnails",'flag')?></option>
287
- <option value="resize_images" ><?php _e("Resize images",'flag')?></option>
288
- <option value="delete_images" ><?php _e("Delete images",'flag')?></option>
289
- <option value="import_meta" ><?php _e("Import metadata",'flag')?></option>
290
- <option value="copy_meta" ><?php _e("Metadata to description",'flag')?></option>
291
- <option value="copy_to" ><?php _e("Copy to...",'flag')?></option>
292
- <option value="move_to"><?php _e("Move to...",'flag')?></option>
293
- <option value="reset_counters"><?php _e("Reset Views & Likes counters", 'flag') ?></option>
294
  <?php do_action('flag_manage_images_bulkaction'); ?>
295
  </select>
296
- <input class="button-secondary alignleft" style="margin-right:10px;" type="submit" name="showThickbox" value="<?php _e("OK",'flag')?>" onclick="if ( !checkSelected() ) return false;" />
297
 
298
  <?php if (($flag->options['galSort'] == "sortorder") && (!$is_search) ) { ?>
299
- <a href="<?php echo wp_nonce_url( $flag->manage_page->base_page . "&amp;mode=sort&amp;gid=" . $act_gid, 'flag_sortgallery')?>" class="button-secondary alignleft" style="margin:1px 10px 0 0;"><?php _e("Sort gallery",'flag')?></a>
300
  <?php }
301
  if(current_user_can('FlAG Upload images') && (!$is_search)){ ?>
302
- <a href="<?php echo wp_nonce_url( $flag->manage_page->base_page . "&amp;gid=" . $act_gid . "&amp;tabs=1", 'flag_addimages')?>" class="button-secondary alignleft" style="margin:1px 10px 0 0;"><?php _e("Add Images",'flag')?></a>
303
  <?php } ?>
304
- <input type="submit" name="updatepictures" class="button-primary action alignleft" value="<?php _e("Save Changes",'flag')?>" />
305
  </div>
306
  </div>
307
 
@@ -392,27 +392,27 @@ if($picturelist) {
392
  </a></strong>
393
  <br /><?php echo $date; ?>
394
  <?php if ( !empty($picture->meta_data['width']) ) {
395
- echo '<br />'.__('Image size: ', 'flag').$picture->meta_data['width'].'x'.$picture->meta_data['height'];
396
  } else {
397
  $imgpath = WINABSPATH.$picture->path."/".$picture->filename;
398
  $img = @getimagesize($imgpath);
399
- if($img) echo '<br />'.__('Image size: ', 'flag').$img[0].'x'.$img[1];
400
  } ?>
401
  <?php if ( !empty($picture->meta_data['thumbnail']) ) {
402
- echo '<br />'.__('Thumbnail size: ', 'flag').$picture->meta_data['thumbnail']['width'].'x'.$picture->meta_data['thumbnail']['height'];
403
  } ?>
404
  <?php if ( !empty($picture->meta_data['webview']) ) {
405
- echo '<br />'.__('Optimized size: ', 'flag').$picture->meta_data['webview'][0].'x'.$picture->meta_data['webview'][1];
406
  } else {
407
- echo '<br />'.__('Optimized size: ', 'flag').__('not optimized ', 'flag');
408
  } ?>
409
  <p>
410
  <?php
411
  $actions = array();
412
- $actions['view'] = '<a class="thickbox" href="' . $picture->imageURL . '" title="' . esc_attr(sprintf(__('View "%s"'), $picture->filename)) . '">' . __('View', 'flag') . '</a>';
413
- $actions['meta'] = '<a class="thickbox" href="' . FLAG_URLPATH . 'admin/showmeta.php?id=' . $pid . '" title="' . __('Show Meta data','flag') . '">' . __('Meta', 'flag') . '</a>';
414
- $actions['custom_thumb'] = '<a class="thickbox" href="' . FLAG_URLPATH . 'admin/manage_thumbnail.php?id=' . $pid . '" title="' . __('Customize thumbnail','flag') . '">' . __('Edit thumb', 'flag') . '</a>';
415
- $actions['delete'] = '<a class="submitdelete" href="' . wp_nonce_url("admin.php?page=flag-manage-gallery&amp;mode=delpic&amp;gid=".$act_gid."&amp;pid=".$pid, 'flag_delpicture'). '" class="delete column-delete" onclick="javascript:check=confirm( \'' . esc_attr(sprintf(__('Delete "%s"' , 'flag'), $picture->filename)). '\');if(check==false) return false;">' . __('Delete','flag') . '</a>';
416
  $action_count = count($actions);
417
  $i = 0;
418
  echo '<div class="row-actions">';
@@ -453,9 +453,9 @@ if($picturelist) {
453
  case 'alt_title_desc' :
454
  ?>
455
  <td <?php echo $attributes; ?>>
456
- <input name="alttext[<?php echo $pid; ?>]" type="text" style="width:95%; margin-bottom: 2px;" value="<?php echo esc_html(stripslashes($picture->alttext)); ?>" /><br/>
457
- <textarea name="description[<?php echo $pid; ?>]" style="width:95%; margin-top: 2px;" rows="2" ><?php echo esc_html(stripslashes($picture->description)); ?></textarea>
458
- <input name="link[<?php echo $pid; ?>]" type="text" style="width:95%; margin-bottom: 2px;" value="<?php echo esc_attr(stripslashes($picture->link)); ?>" placeholder="(optional for skin) URL for linked button" /><br/>
459
  </td>
460
  <?php
461
  break;
@@ -486,13 +486,13 @@ if($picturelist) {
486
 
487
  // In the case you have no capaptibility to see the search result
488
  if ( $counter==0 )
489
- echo '<tr><td colspan="' . $num_columns . '" align="center"><strong>'.__('No entries found','flag').'</strong></td></tr>';
490
 
491
  ?>
492
 
493
  </tbody>
494
  </table>
495
- <p class="submit"><input type="submit" class="button-primary action" name="updatepictures" value="<?php _e("Save Changes",'flag')?>" /></p>
496
  </form>
497
  <br class="clear"/>
498
  </div><!-- /#wrap -->
@@ -507,7 +507,7 @@ if ( $counter==0 )
507
  <table width="100%" border="0" cellspacing="3" cellpadding="3" >
508
  <tr>
509
  <th>
510
- <?php _e('Select the destination gallery:', 'flag'); ?>&nbsp;
511
  <select name="dest_gid" style="width:90%" >
512
  <?php
513
  foreach ($gallerylist as $gallery) {
@@ -523,9 +523,9 @@ if ( $counter==0 )
523
  </tr>
524
  <tr align="right">
525
  <td class="submit">
526
- <input type="submit" class="button-primary" name="TB_SelectGallery" value="<?php _e("OK",'flag')?>" />
527
  &nbsp;
528
- <input class="button-secondary" type="reset" value="<?php _e("Cancel",'flag')?>" onclick="tb_remove()"/>
529
  </td>
530
  </tr>
531
  </table>
@@ -543,18 +543,18 @@ if ( $counter==0 )
543
  <table width="100%" border="0" cellspacing="3" cellpadding="3" >
544
  <tr valign="top">
545
  <td>
546
- <strong><?php _e('Resize Images to', 'flag'); ?>:</strong>
547
  </td>
548
  <td>
549
  <input type="text" size="5" name="imgWidth" value="<?php echo $flag->options['imgWidth']; ?>" /> x <input type="text" size="5" name="imgHeight" value="<?php echo $flag->options['imgHeight']; ?>" />
550
- <br /><small><?php _e('Width x height (in pixel). Grand Flagallery will keep ratio size','flag'); ?></small>
551
  </td>
552
  </tr>
553
  <tr align="right">
554
  <td colspan="2" class="submit">
555
- <input class="button-primary" type="submit" name="TB_ResizeImages" value="<?php _e('OK', 'flag'); ?>" />
556
  &nbsp;
557
- <input class="button-secondary" type="reset" value="&nbsp;<?php _e('Cancel', 'flag'); ?>&nbsp;" onclick="tb_remove()"/>
558
  </td>
559
  </tr>
560
  </table>
@@ -571,20 +571,15 @@ if ( $counter==0 )
571
  <input type="hidden" name="page" value="manage-images" />
572
  <table width="100%" border="0" cellspacing="3" cellpadding="3" >
573
  <tr valign="top">
574
- <th align="left"><?php _e('Width x height (in pixel)','flag'); ?></th>
575
- <td><input type="text" size="5" maxlength="5" name="thumbWidth" value="<?php echo $flag->options['thumbWidth']; ?>" /> x <input type="text" size="5" maxlength="5" name="thumbHeight" value="<?php echo $flag->options['thumbHeight']; ?>" />
576
- <br /><small><?php _e('These values are maximum values ','flag'); ?></small></td>
577
- </tr>
578
- <tr valign="top">
579
- <th align="left"><?php _e('Set fix dimension','flag'); ?></th>
580
- <td><input type="checkbox" name="thumbFix" value="1" <?php checked('1', $flag->options['thumbFix']); ?> />
581
- <br /><small><?php _e('Ignore the aspect ratio, no portrait thumbnails','flag'); ?></small></td>
582
  </tr>
583
  <tr align="right">
584
  <td colspan="2" class="submit">
585
- <input class="button-primary" type="submit" name="TB_NewThumbnail" value="<?php _e('OK', 'flag'); ?>" />
586
  &nbsp;
587
- <input class="button-secondary" type="reset" value="&nbsp;<?php _e('Cancel', 'flag'); ?>&nbsp;" onclick="tb_remove()"/>
588
  </td>
589
  </tr>
590
  </table>
@@ -608,12 +603,12 @@ function flag_manage_gallery_columns() {
608
 
609
  $gallery_columns['cb'] = '<input name="checkall" type="checkbox" onclick="checkAll(document.getElementById(\'updategallery\'));" />';
610
  $gallery_columns['id'] = __('ID');
611
- $gallery_columns['thumbnail'] = __('Thumbnail', 'flag');
612
- $gallery_columns['filename'] = __('Filename', 'flag');
613
- $gallery_columns['views_likes'] = __('Views / Likes', 'flag');
614
- $gallery_columns['rating'] = __('Rating', 'flag');
615
- $gallery_columns['alt_title_desc'] = __('Alt &amp; Title Text', 'flag') . ' / ' . __('Description', 'flag');// . ' / ' . __('Link', 'flag');
616
- $gallery_columns['exclude'] = '<span title="'.__('Only for logged in users', 'flag').'"><img src="'.FLAG_URLPATH.'admin/images/lock.png" alt="member view" /> Private</span>';
617
  $gallery_columns = apply_filters('flag_manage_images_columns', $gallery_columns);
618
 
619
  return $gallery_columns;
28
  $gallery = $flagdb->find_gallery($act_gid);
29
 
30
  if (!$gallery) {
31
+ flagGallery::show_error(__('Gallery not found.', 'flash-album-gallery'));
32
  return;
33
  }
34
 
35
  // Check if you have the correct capability
36
  if (!flagAdmin::can_manage_this_gallery($gallery->author)) {
37
+ flagGallery::show_error(__('Sorry, you have no access here', 'flash-album-gallery'));
38
  return;
39
  }
40
 
147
  var numchecked = getNumChecked(document.getElementById('updategallery'));
148
 
149
  if(numchecked < 1) {
150
+ alert('<?php echo esc_js(__("No images selected", "flash-album-gallery")); ?>');
151
  return false;
152
  }
153
 
169
  break;
170
  }
171
 
172
+ return confirm('<?php echo sprintf(esc_js(__("You are about to start the bulk edit for %s images \n \n 'Cancel' to stop, 'OK' to proceed.",'flash-album-gallery')), "' + numchecked + '") ; ?>');
173
  }
174
 
175
  jQuery(document).ready( function() {
184
  <div class="flag-wrap">
185
 
186
  <?php if ($is_search) :?>
187
+ <h2><?php printf( __('Search results for &#8220;%s&#8221;', 'flash-album-gallery'), esc_html( stripslashes(get_search_query()) ) ); ?></h2>
188
  <form class="search-form" action="" method="get">
189
  <p class="search-box">
190
+ <label class="hidden" for="media-search-input"><?php _e( 'Search Images', 'flash-album-gallery' ); ?>:</label>
191
  <input type="hidden" id="page-name" name="page" value="flag-manage-gallery" />
192
  <input type="text" id="media-search-input" name="s" value="<?php the_search_query(); ?>" />
193
+ <input type="submit" value="<?php _e( 'Search Images', 'flash-album-gallery' ); ?>" class="button" />
194
  </p>
195
  </form>
196
 
202
 
203
  <?php else :?>
204
 
205
+ <h2><?php echo _n( 'Gallery', 'Galleries', 1, 'flash-album-gallery' ); ?> : <?php echo esc_html($gallery->title); ?></h2>
206
  <select name="select_gid" style="width:180px; float: right; margin: -20px 3px 0 0;" onchange="window.location.href=this.options[this.selectedIndex].value">
207
+ <option selected="selected"><?php _e('Choose another gallery', 'flash-album-gallery'); ?></option>
208
  <?php
209
  foreach ($gallerylist as $gal) {
210
  if ($gal->gid != $act_gid) {
225
  <div id="post-body"><div id="post-body-content"><div id="normal-sortables" class="meta-box-sortables ui-sortable" style="position: relative;">
226
  <div id="flagalleryset" class="postbox <?php echo postbox_classes('flagalleryset', 'flag-manage-gallery'); ?>" >
227
  <div class="handlediv" title="Click to toggle"><br/></div>
228
+ <h3 class="hndle"><span><?php _e('Gallery settings', 'flash-album-gallery'); ?></span></h3>
229
  <div class="inside">
230
  <table class="flag-form-table" >
231
  <tr>
232
+ <th align="right" scope="row"><?php _e('Title', 'flash-album-gallery'); ?>:</th>
233
  <td> </td>
234
  <td align="left"><input type="text" size="50" name="title" value="<?php echo esc_html($gallery->title); ?>" /></td>
235
  </tr>
236
  <tr>
237
+ <th align="right" valign="top" scope="row"><?php _e('Description', 'flash-album-gallery'); ?>:</th>
238
  <td> </td>
239
  <td align="left"><textarea name="gallerydesc" cols="30" rows="3" style="width: 95%" ><?php echo esc_html($gallery->galdesc); ?></textarea></td>
240
  </tr>
241
  <tr>
242
+ <th align="right" scope="row"><?php _e('Path', 'flash-album-gallery'); ?>:</th>
243
  <td> </td>
244
  <td align="left"><input <?php if (IS_WPMU) echo 'readonly = "readonly"'; ?> type="text" size="50" name="path" value="<?php echo esc_attr($gallery->path); ?>" /></td>
245
  </tr>
246
  <tr>
247
+ <th align="right" scope="row"><?php _e('Author', 'flash-album-gallery'); ?>:</th>
248
  <td> </td>
249
  <td align="left">
250
  <?php
254
  else
255
  echo $act_author_user->display_name;
256
  ?>
257
+ <input type="hidden" name="previewpic" value="<?php if(is_array($picturelist) && count($picturelist)) { $pic = reset($picturelist); echo $pic->pid; }; ?>" />
258
  </td>
259
  </tr>
260
  </table>
261
 
262
  <div class="submit">
263
+ <input type="submit" class="button-secondary" name="scanfolder" value="<?php _e("Scan Folder for new images",'flash-album-gallery')?> " />
264
+ <input type="submit" class="button-primary action" name="updatepictures" value="<?php _e("Save Changes",'flash-album-gallery')?>" />
265
  </div>
266
  <div class="clear"></div>
267
  </div>
281
  <?php endif; ?>
282
  <div class="alignleft actions">
283
  <select id="bulkaction" name="bulkaction" class="alignleft">
284
+ <option value="no_action" ><?php _e("No action",'flash-album-gallery')?></option>
285
+ <option value="webview_images" ><?php _e("Create images optimized for web",'flash-album-gallery'); ?></option>
286
+ <option value="new_thumbnail" ><?php _e("Create new thumbnails",'flash-album-gallery')?></option>
287
+ <option value="resize_images" ><?php _e("Resize images",'flash-album-gallery')?></option>
288
+ <option value="delete_images" ><?php _e("Delete images",'flash-album-gallery')?></option>
289
+ <option value="import_meta" ><?php _e("Import metadata",'flash-album-gallery')?></option>
290
+ <option value="copy_meta" ><?php _e("Metadata to description",'flash-album-gallery')?></option>
291
+ <option value="copy_to" ><?php _e("Copy to...",'flash-album-gallery')?></option>
292
+ <option value="move_to"><?php _e("Move to...",'flash-album-gallery')?></option>
293
+ <option value="reset_counters"><?php _e("Reset Views & Likes counters", 'flash-album-gallery') ?></option>
294
  <?php do_action('flag_manage_images_bulkaction'); ?>
295
  </select>
296
+ <input class="button-secondary alignleft" style="margin-right:10px;" type="submit" name="showThickbox" value="<?php _e("OK",'flash-album-gallery')?>" onclick="if ( !checkSelected() ) return false;" />
297
 
298
  <?php if (($flag->options['galSort'] == "sortorder") && (!$is_search) ) { ?>
299
+ <a href="<?php echo wp_nonce_url( $flag->manage_page->base_page . "&amp;mode=sort&amp;gid=" . $act_gid, 'flag_sortgallery')?>" class="button-secondary alignleft" style="margin:1px 10px 0 0;"><?php _e("Sort gallery",'flash-album-gallery')?></a>
300
  <?php }
301
  if(current_user_can('FlAG Upload images') && (!$is_search)){ ?>
302
+ <a href="<?php echo wp_nonce_url( $flag->manage_page->base_page . "&amp;gid=" . $act_gid . "&amp;tabs=1", 'flag_addimages')?>" class="button-secondary alignleft" style="margin:1px 10px 0 0;"><?php _e("Add Images",'flash-album-gallery')?></a>
303
  <?php } ?>
304
+ <input type="submit" name="updatepictures" class="button-primary action alignleft" value="<?php _e("Save Changes",'flash-album-gallery')?>" />
305
  </div>
306
  </div>
307
 
392
  </a></strong>
393
  <br /><?php echo $date; ?>
394
  <?php if ( !empty($picture->meta_data['width']) ) {
395
+ echo '<br />'.__('Image size: ', 'flash-album-gallery').$picture->meta_data['width'].'x'.$picture->meta_data['height'];
396
  } else {
397
  $imgpath = WINABSPATH.$picture->path."/".$picture->filename;
398
  $img = @getimagesize($imgpath);
399
+ if($img) echo '<br />'.__('Image size: ', 'flash-album-gallery').$img[0].'x'.$img[1];
400
  } ?>
401
  <?php if ( !empty($picture->meta_data['thumbnail']) ) {
402
+ echo '<br />'.__('Thumbnail size: ', 'flash-album-gallery').$picture->meta_data['thumbnail']['width'].'x'.$picture->meta_data['thumbnail']['height'];
403
  } ?>
404
  <?php if ( !empty($picture->meta_data['webview']) ) {
405
+ echo '<br />'.__('Optimized size: ', 'flash-album-gallery').$picture->meta_data['webview'][0].'x'.$picture->meta_data['webview'][1];
406
  } else {
407
+ echo '<br />'.__('Optimized size: ', 'flash-album-gallery').__('not optimized ', 'flash-album-gallery');
408
  } ?>
409
  <p>
410
  <?php
411
  $actions = array();
412
+ $actions['view'] = '<a class="thickbox" href="' . $picture->imageURL . '" title="' . esc_attr(sprintf(__('View "%s"'), $picture->filename)) . '">' . __('View', 'flash-album-gallery') . '</a>';
413
+ $actions['meta'] = '<a class="thickbox" href="' . FLAG_URLPATH . 'admin/showmeta.php?id=' . $pid . '" title="' . __('Show Meta data','flash-album-gallery') . '">' . __('Meta', 'flash-album-gallery') . '</a>';
414
+ $actions['custom_thumb'] = '<a class="thickbox" href="' . FLAG_URLPATH . 'admin/manage_thumbnail.php?id=' . $pid . '" title="' . __('Customize thumbnail','flash-album-gallery') . '">' . __('Edit thumb', 'flash-album-gallery') . '</a>';
415
+ $actions['delete'] = '<a class="submitdelete" href="' . wp_nonce_url("admin.php?page=flag-manage-gallery&amp;mode=delpic&amp;gid=".$act_gid."&amp;pid=".$pid, 'flag_delpicture'). '" class="delete column-delete" onclick="javascript:check=confirm( \'' . esc_attr(sprintf(__('Delete "%s"' , 'flash-album-gallery'), $picture->filename)). '\');if(check==false) return false;">' . __('Delete','flash-album-gallery') . '</a>';
416
  $action_count = count($actions);
417
  $i = 0;
418
  echo '<div class="row-actions">';
453
  case 'alt_title_desc' :
454
  ?>
455
  <td <?php echo $attributes; ?>>
456
+ <input name="alttext[<?php echo $pid; ?>]" type="text" style="width:95%; margin-bottom: 2px;" value="<?php echo esc_html(stripslashes($picture->alttext)); ?>" placeholder="<?php _e('Alt & Title', 'flash-album-gallery'); ?>" /><br/>
457
+ <textarea name="description[<?php echo $pid; ?>]" style="width:95%; margin-top: 2px;" rows="2" placeholder="<?php _e('Description', 'flash-album-gallery'); ?>"><?php echo esc_html(stripslashes($picture->description)); ?></textarea>
458
+ <input name="link[<?php echo $pid; ?>]" type="text" style="width:95%; margin-bottom: 2px;" value="<?php echo esc_attr(stripslashes($picture->link)); ?>" placeholder="<?php _e('Link To (optional)', 'flash-album-gallery'); ?>" /><br/>
459
  </td>
460
  <?php
461
  break;
486
 
487
  // In the case you have no capaptibility to see the search result
488
  if ( $counter==0 )
489
+ echo '<tr><td colspan="' . $num_columns . '" align="center"><strong>'.__('No entries found','flash-album-gallery').'</strong></td></tr>';
490
 
491
  ?>
492
 
493
  </tbody>
494
  </table>
495
+ <p class="submit"><input type="submit" class="button-primary action" name="updatepictures" value="<?php _e("Save Changes",'flash-album-gallery')?>" /></p>
496
  </form>
497
  <br class="clear"/>
498
  </div><!-- /#wrap -->
507
  <table width="100%" border="0" cellspacing="3" cellpadding="3" >
508
  <tr>
509
  <th>
510
+ <?php _e('Select the destination gallery:', 'flash-album-gallery'); ?>&nbsp;
511
  <select name="dest_gid" style="width:90%" >
512
  <?php
513
  foreach ($gallerylist as $gallery) {
523
  </tr>
524
  <tr align="right">
525
  <td class="submit">
526
+ <input type="submit" class="button-primary" name="TB_SelectGallery" value="<?php _e("OK",'flash-album-gallery')?>" />
527
  &nbsp;
528
+ <input class="button-secondary" type="reset" value="<?php _e("Cancel",'flash-album-gallery')?>" onclick="tb_remove()"/>
529
  </td>
530
  </tr>
531
  </table>
543
  <table width="100%" border="0" cellspacing="3" cellpadding="3" >
544
  <tr valign="top">
545
  <td>
546
+ <strong><?php _e('Resize Images to', 'flash-album-gallery'); ?>:</strong>
547
  </td>
548
  <td>
549
  <input type="text" size="5" name="imgWidth" value="<?php echo $flag->options['imgWidth']; ?>" /> x <input type="text" size="5" name="imgHeight" value="<?php echo $flag->options['imgHeight']; ?>" />
550
+ <br /><small><?php _e('Width x height (in pixel). Grand Flagallery will keep ratio size','flash-album-gallery'); ?></small>
551
  </td>
552
  </tr>
553
  <tr align="right">
554
  <td colspan="2" class="submit">
555
+ <input class="button-primary" type="submit" name="TB_ResizeImages" value="<?php _e('OK', 'flash-album-gallery'); ?>" />
556
  &nbsp;
557
+ <input class="button-secondary" type="reset" value="&nbsp;<?php _e('Cancel', 'flash-album-gallery'); ?>&nbsp;" onclick="tb_remove()"/>
558
  </td>
559
  </tr>
560
  </table>
571
  <input type="hidden" name="page" value="manage-images" />
572
  <table width="100%" border="0" cellspacing="3" cellpadding="3" >
573
  <tr valign="top">
574
+ <th align="left"><?php _e('Width x height (in pixel)','flash-album-gallery'); ?></th>
575
+ <td><input type="number" size="5" maxlength="5" min="300" max="800" name="thumbWidth" value="<?php echo $flag->options['thumbWidth']; ?>" /> x <input type="number" size="5" maxlength="5" min="300" max="800" name="thumbHeight" value="<?php echo $flag->options['thumbHeight']; ?>" />
576
+ <br /><small><?php _e('These values are maximum values ','flash-album-gallery'); ?></small></td>
 
 
 
 
 
577
  </tr>
578
  <tr align="right">
579
  <td colspan="2" class="submit">
580
+ <input class="button-primary" type="submit" name="TB_NewThumbnail" value="<?php _e('OK', 'flash-album-gallery'); ?>" />
581
  &nbsp;
582
+ <input class="button-secondary" type="reset" value="&nbsp;<?php _e('Cancel', 'flash-album-gallery'); ?>&nbsp;" onclick="tb_remove()"/>
583
  </td>
584
  </tr>
585
  </table>
603
 
604
  $gallery_columns['cb'] = '<input name="checkall" type="checkbox" onclick="checkAll(document.getElementById(\'updategallery\'));" />';
605
  $gallery_columns['id'] = __('ID');
606
+ $gallery_columns['thumbnail'] = __('Thumbnail', 'flash-album-gallery');
607
+ $gallery_columns['filename'] = __('Filename', 'flash-album-gallery');
608
+ $gallery_columns['views_likes'] = __('Views / Likes', 'flash-album-gallery');
609
+ $gallery_columns['rating'] = __('Rating', 'flash-album-gallery');
610
+ $gallery_columns['alt_title_desc'] = __('Alt &amp; Title Text', 'flash-album-gallery') . ' / ' . __('Description', 'flash-album-gallery');// . ' / ' . __('Link', 'flash-album-gallery');
611
+ $gallery_columns['exclude'] = '<span title="'.__('Only for logged in users', 'flash-album-gallery').'"><img src="'.FLAG_URLPATH.'admin/images/lock.png" alt="member view" /> Private</span>';
612
  $gallery_columns = apply_filters('flag_manage_images_columns', $gallery_columns);
613
 
614
  return $gallery_columns;
admin/manage-playlist.php CHANGED
@@ -12,7 +12,7 @@ function flag_playlist_edit() {
12
  $items_a = $playlist['items'];
13
  $items = implode(',',$playlist['items']);
14
  ?>
15
- <script type="text/javascript">
16
  //<![CDATA[
17
  function checkAll(form)
18
  {
@@ -37,21 +37,21 @@ function getNumChecked(form)
37
  function checkSelected() {
38
 
39
  var numchecked = getNumChecked(document.getElementById('updatePlaylist'));
40
-
41
- if(numchecked < 1) {
42
- alert('<?php echo esc_js(__("No items selected", "flag")); ?>');
43
- return false;
44
- }
45
-
46
  actionId = jQuery('#bulkaction').val();
47
-
48
  switch (actionId) {
49
  case "delete_items":
50
- return confirm('<?php echo sprintf(esc_js(__("You are about to delete %s item(s) \n \n 'Cancel' to stop, 'OK' to proceed.",'flag')), "' + numchecked + '") ; ?>');
51
- break;
52
  }
53
-
54
- return confirm('<?php echo sprintf(esc_js(__("You are about to start the bulk edit for %s item(s) \n \n 'Cancel' to stop, 'OK' to proceed.",'flag')), "' + numchecked + '") ; ?>');
55
  }
56
 
57
  function showDialog( windowId, height ) {
@@ -95,18 +95,18 @@ jQuery(document).ready(function(){
95
  </script>
96
 
97
  <div class="flag-wrap">
98
- <h2><?php _e( 'Playlist', 'flag' ); ?>: <?php echo esc_html($playlist['title']); ?></h2>
99
  <div style="float: right; margin: -20px 3px 0 0;">
100
- <span><a href="<?php echo $filepath; ?>"><?php _e('Back to Music Box', 'flag'); ?></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
101
  <select name="select_playlist" onchange="window.location.href=this.options[this.selectedIndex].value">
102
- <option selected="selected"><?php _e('Choose another playlist', 'flag'); ?></option>
103
- <?php
104
  foreach((array)$all_playlists as $playlist_file => $playlist_data) {
105
  $playlist_name = basename($playlist_file, '.xml');
106
  if ($playlist_file == sanitize_flagname($_GET['playlist'])) continue;
107
  ?>
108
  <option value="<?php echo esc_url($filepath."&playlist=".$playlist_name."&mode=edit"); ?>"><?php echo esc_html($playlist_data['title']); ?></option>
109
- <?php
110
  }
111
  ?>
112
  </select>
@@ -118,41 +118,46 @@ jQuery(document).ready(function(){
118
  <div id="poststuff" class="metabox-holder">
119
  <div id="post-body"><div id="post-body-content"><div id="normal-sortables" style="position: relative;">
120
  <div id="flagalleryset" class="postbox" >
121
- <h3 class="hndle"><span><?php _e('Playlist settings', 'flag'); ?></span></h3>
122
  <div class="inside">
123
  <table cellspacing="8" cellpadding="0" border="0">
124
  <tr>
125
- <th align="left" valign="middle" scope="row"><?php _e('Shortcode', 'flag'); ?>:</th>
126
  <td align="left" valign="middle"><input type="text" readonly="readonly" size="50" onfocus="this.select()" value="[grandmusic playlist=<?php echo sanitize_flagname($_GET['playlist']); ?>]" /></td>
127
- <td rowspan="3" align="left" valign="top"><div><strong style="display: inline-block; width: 100px;"><?php _e("Playlist Skin", 'flag'); ?>:</strong>
128
  <input id="skinaction" type="hidden" name="skinaction" value="<?php echo sanitize_flagname($playlist['skin']); ?>" />
129
  <select id="skinname" name="skinname" style="width: 200px; height: 24px; font-size: 11px;">
130
  <?php require_once (dirname(__FILE__) . '/get_skin.php');
131
  $all_skins = get_skins($skin_folder='', $type='m');
 
132
  if(count($all_skins)) {
133
  foreach ( (array)$all_skins as $skin_file => $skin_data) {
134
- $cur = ($playlist['skin'] == dirname($skin_file))? ' selected="selected"' : '';
 
 
 
 
135
  echo '<option'.$cur.' value="'.dirname($skin_file).'">'.$skin_data['Name'].'</option>'."\n";
136
  }
137
  } else {
138
- echo '<option value="music_default">'.__("No Skins", "flag").'</option>';
139
  }
140
  ?>
141
- </select>&nbsp;&nbsp;<a id="skinOptions" class="thickbox" href="<?php echo FLAG_URLPATH.'admin/skin_options.php?show_options=1&amp;skin='.sanitize_flagname($playlist['skin']).'&amp;TB_iframe=1&amp;width=600&amp;height=560'; ?>"><?php _e('Change Skin Options', 'flag' ); ?></a>
142
  </div>
143
- <p style="margin:10px 0 0 100px;"><input type="submit" id="updatePlaylistSkin" name="updatePlaylistSkin" class="button-primary action" value="<?php _e('Update skin options for this playlist', 'flag'); ?>" /></p>
144
  </td>
145
  </tr>
146
  <tr>
147
- <th align="left" valign="middle" scope="row"><?php _e('Title', 'flag'); ?>:</th>
148
  <td align="left" valign="middle"><input type="text" size="50" name="playlist_title" value="<?php echo esc_html($playlist['title']); ?>" /></td>
149
  </tr>
150
  <tr>
151
- <th align="left" valign="top" scope="row"><?php _e('Description', 'flag'); ?>:</th>
152
  <td align="left" valign="top"><textarea name="playlist_descr" cols="60" rows="2" style="width: 95%" ><?php echo esc_html($playlist['description']); ?></textarea></td>
153
  </tr>
154
  <!--<tr>
155
- <th align="left" valign="top" scope="row"><?php _e('Path', 'flag'); ?>:</th>
156
  <td align="left" colspan="2" valign="top"><?php echo $playlistPath; ?></td>
157
  </tr>-->
158
  </table>
@@ -163,35 +168,35 @@ jQuery(document).ready(function(){
163
  </div> <!-- poststuff -->
164
  <div class="tablenav flag-tablenav">
165
  <select id="bulkaction" name="bulkaction" class="alignleft">
166
- <option value="no_action" ><?php _e("No action",'flag')?></option>
167
- <option value="delete_items" ><?php _e("Delete items",'flag')?></option>
168
  </select>
169
- <input class="button-secondary alignleft" style="margin-right:10px;" type="submit" name="updatePlaylist" value="<?php _e("OK",'flag')?>" onclick="if ( !checkSelected() ) return false;" />
170
- <a href="<?php echo wp_nonce_url($filepath."&playlist=".sanitize_flagname($_GET['playlist'])."&mode=sort", 'flag_sort'); ?>" class="button-secondary alignleft" style="margin:1px 10px 0 0;"><?php _e("Sort Playlist",'flag')?></a>
171
- <a href="#" onClick="jQuery('#form_listitems').submit();return false;" class="button-secondary alignleft" style="margin:1px 10px 0 0;"><?php _e("Add/Remove Items from Playlist",'flag')?></a>
172
- <input type="submit" name="updatePlaylist" class="button-primary action alignright" value="<?php _e("Update Playlist",'flag')?>" />
173
  </div>
174
 
175
  <table id="flag-listmusic" class="widefat fixed flag-table" cellspacing="0" >
176
 
177
  <thead>
178
  <tr>
179
- <th class="cb" width="54" scope="col"><a href="#" onclick="checkAll(document.getElementById('updatePlaylist'));return false;"><?php _e('Check', 'flag'); ?></a></th>
180
- <th class="id" width="134" scope="col"><div><?php _e('ID', 'flag'); ?></div></th>
181
- <th class="size" width="75" scope="col"><div><?php _e('Size', 'flag'); ?></div></th>
182
- <th class="thumb" width="110" scope="col"><div><?php _e('Thumbnail', 'flag'); ?></div></th>
183
- <th class="title_filename" scope="col"><div><?php _e('Filename / Title', 'flag'); ?></div></th>
184
- <th class="description" scope="col"><div><?php _e('Description', 'flag'); ?></div></th>
185
  </tr>
186
  </thead>
187
  <tfoot>
188
  <tr>
189
- <th class="cb" scope="col"><a href="#" onclick="checkAll(document.getElementById('updatePlaylist'));return false;"><?php _e('Check', 'flag'); ?></a></th>
190
- <th class="id" scope="col"><?php _e('ID', 'flag'); ?></th>
191
- <th class="size" scope="col"><?php _e('Size', 'flag'); ?></th>
192
- <th class="thumb" scope="col"><?php _e('Thumbnail', 'flag'); ?></th>
193
- <th class="title_filename" scope="col"><?php _e('Filename / Title', 'flag'); ?></th>
194
- <th class="description" scope="col"><?php _e('Description', 'flag'); ?></th>
195
  </tr>
196
  </tfoot>
197
  <tbody>
@@ -216,7 +221,7 @@ if(count($items_a)) {
216
  <tr id="mp3-<?php echo $mp3->ID; ?>"<?php echo $alt; ?> valign="top">
217
  <th class="cb" scope="row" height="24" style="padding-bottom: 0; border-bottom: none;"><input name="doaction[]" type="checkbox" value="<?php echo $mp3->ID; ?>" /></th>
218
  <td class="id" style="padding-bottom: 0; border-bottom: none;"><p style="margin-bottom: 3px; white-space: nowrap;">ID: <?php echo $mp3->ID; ?></p></td>
219
- <td class="size" style="padding-bottom: 0; border-bottom: none;"><?php
220
  $path = $uploads['basedir'].str_replace($uploads['baseurl'],'',$url);
221
  $size = filesize($path);
222
  echo round($size/1024/1024,2).' Mb';
@@ -227,30 +232,29 @@ if(count($items_a)) {
227
  <td class="title_filename" rowspan="2">
228
  <strong><a href="<?php echo $url; ?>"><?php echo basename($url); ?></a></strong><br />
229
  <textarea title="Title" name="item_a[<?php echo $mp3->ID; ?>][post_title]" cols="20" rows="1" style="width:95%; height: 25px; overflow:hidden;"><?php echo esc_html(stripslashes($mp3->post_title)); ?></textarea><br />
230
- <p><?php _e('Thumb URL:', 'flag'); ?> <input id="mp3thumb-<?php echo $mp3->ID; ?>" name="item_a[<?php echo $mp3->ID; ?>][post_thumb]" type="text" value="<?php echo esc_url($mp3thumb); ?>" /> <a class="thickbox" onclick="actInp=<?php echo $mp3->ID; ?>" href="media-upload.php?type=image&amp;TB_iframe=1&amp;width=640&amp;height=400" title="<?php _e('Add an Image','flag'); ?>"><?php _e('assist', 'flag'); ?></a></p>
231
  </td>
232
  <td class="description" rowspan="2">
233
  <textarea name="item_a[<?php echo $mp3->ID; ?>][post_content]" style="width:95%; height: 96px; margin-top: 2px; font-size:12px; line-height:115%;" rows="1" ><?php echo esc_html(stripslashes($mp3->post_content)); ?></textarea>
234
  </td>
235
  </tr>
236
  <tr class="mp3-<?php echo $mp3->ID.$alt2; ?>">
237
- <td valign="top" class="player" colspan="3"><script type="text/javascript">swfobject.embedSWF("<?php echo FLAG_URLPATH; ?>lib/mini.swf", "c-<?php echo $mp3->ID; ?>", "250", "20", "10.1.52", "expressInstall.swf", {path:"<?php echo str_replace(array('.mp3'), array(''), $url); ?>",bgcolor:"<?php echo $flag_options['mpBG'] ?>",color1:"<?php echo $flag_options['mpColor1'] ?>",color2:"<?php echo $flag_options['mpColor2'] ?>"}, {wmode:"transparent"}, {id:"f-<?php echo $mp3->ID; ?>",name:"f-<?php echo $mp3->ID; ?>"});</script>
238
- <div class="play" style="padding-left: 4px;"><span id="c-<?php echo $mp3->ID; ?>"></span></div></td>
239
  </tr>
240
  <?php
241
  }
242
  }
243
-
244
  // In the case you have no capaptibility to see the search result
245
  if ( $counter==0 )
246
- echo '<tr><td colspan="5" align="center"><strong>'.__('No entries found','flag').'</strong></td></tr>';
247
 
248
  ?>
249
-
250
  </tbody>
251
  </table>
252
- <p class="submit" style="text-align: right;"><input type="submit" class="button-primary action" name="updatePlaylist" value="<?php _e("Update Playlist",'flag')?>" /></p>
253
- </form>
254
  <form id="form_listitems" name="form_listitems" method="POST" action="<?php echo esc_url($filepath."&playlist=".sanitize_flagname($_GET['playlist'])."&mode=add"); ?>">
255
  <?php wp_nonce_field('flag_add'); ?>
256
  <input type="hidden" name="items" value="<?php echo $items; ?>" />
12
  $items_a = $playlist['items'];
13
  $items = implode(',',$playlist['items']);
14
  ?>
15
+ <script type="text/javascript">
16
  //<![CDATA[
17
  function checkAll(form)
18
  {
37
  function checkSelected() {
38
 
39
  var numchecked = getNumChecked(document.getElementById('updatePlaylist'));
40
+
41
+ if(numchecked < 1) {
42
+ alert('<?php echo esc_js(__("No items selected", "flash-album-gallery")); ?>');
43
+ return false;
44
+ }
45
+
46
  actionId = jQuery('#bulkaction').val();
47
+
48
  switch (actionId) {
49
  case "delete_items":
50
+ return confirm('<?php echo sprintf(esc_js(__("You are about to delete %s item(s) \n \n 'Cancel' to stop, 'OK' to proceed.",'flash-album-gallery')), "' + numchecked + '") ; ?>');
51
+ break;
52
  }
53
+
54
+ return confirm('<?php echo sprintf(esc_js(__("You are about to start the bulk edit for %s item(s) \n \n 'Cancel' to stop, 'OK' to proceed.",'flash-album-gallery')), "' + numchecked + '") ; ?>');
55
  }
56
 
57
  function showDialog( windowId, height ) {
95
  </script>
96
 
97
  <div class="flag-wrap">
98
+ <h2><?php _e( 'Playlist', 'flash-album-gallery' ); ?>: <?php echo esc_html($playlist['title']); ?></h2>
99
  <div style="float: right; margin: -20px 3px 0 0;">
100
+ <span><a href="<?php echo $filepath; ?>"><?php _e('Back to Music Box', 'flash-album-gallery'); ?></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
101
  <select name="select_playlist" onchange="window.location.href=this.options[this.selectedIndex].value">
102
+ <option selected="selected"><?php _e('Choose another playlist', 'flash-album-gallery'); ?></option>
103
+ <?php
104
  foreach((array)$all_playlists as $playlist_file => $playlist_data) {
105
  $playlist_name = basename($playlist_file, '.xml');
106
  if ($playlist_file == sanitize_flagname($_GET['playlist'])) continue;
107
  ?>
108
  <option value="<?php echo esc_url($filepath."&playlist=".$playlist_name."&mode=edit"); ?>"><?php echo esc_html($playlist_data['title']); ?></option>
109
+ <?php
110
  }
111
  ?>
112
  </select>
118
  <div id="poststuff" class="metabox-holder">
119
  <div id="post-body"><div id="post-body-content"><div id="normal-sortables" style="position: relative;">
120
  <div id="flagalleryset" class="postbox" >
121
+ <h3 class="hndle"><span><?php _e('Playlist settings', 'flash-album-gallery'); ?></span></h3>
122
  <div class="inside">
123
  <table cellspacing="8" cellpadding="0" border="0">
124
  <tr>
125
+ <th align="left" valign="middle" scope="row"><?php _e('Shortcode', 'flash-album-gallery'); ?>:</th>
126
  <td align="left" valign="middle"><input type="text" readonly="readonly" size="50" onfocus="this.select()" value="[grandmusic playlist=<?php echo sanitize_flagname($_GET['playlist']); ?>]" /></td>
127
+ <td rowspan="3" align="left" valign="top"><div><strong style="display: inline-block; width: 100px;"><?php _e("Playlist Skin", 'flash-album-gallery'); ?>:</strong>
128
  <input id="skinaction" type="hidden" name="skinaction" value="<?php echo sanitize_flagname($playlist['skin']); ?>" />
129
  <select id="skinname" name="skinname" style="width: 200px; height: 24px; font-size: 11px;">
130
  <?php require_once (dirname(__FILE__) . '/get_skin.php');
131
  $all_skins = get_skins($skin_folder='', $type='m');
132
+ $current_skin_title = __('No Skin', 'flash-album-gallery');
133
  if(count($all_skins)) {
134
  foreach ( (array)$all_skins as $skin_file => $skin_data) {
135
+ $cur = '';
136
+ if($playlist['skin'] == dirname($skin_file)){
137
+ $cur = ' selected="selected"';
138
+ $current_skin_title = $skin_data['Name'];
139
+ }
140
  echo '<option'.$cur.' value="'.dirname($skin_file).'">'.$skin_data['Name'].'</option>'."\n";
141
  }
142
  } else {
143
+ echo '<option value="music_default">'.__("No Skins", "flash-album-gallery").'</option>';
144
  }
145
  ?>
146
+ </select>&nbsp;&nbsp;<a id="skinOptions" class="thickbox" title="<?php echo esc_attr($current_skin_title); ?>" href="<?php echo FLAG_URLPATH.'admin/skin_options.php?show_options=1&amp;skin='.sanitize_flagname($playlist['skin']).'&amp;TB_iframe=1&amp;width=600&amp;height=560'; ?>"><?php _e('Change Skin Options', 'flash-album-gallery' ); ?></a>
147
  </div>
148
+ <p style="margin:10px 0 0 100px;"><input type="submit" id="updatePlaylistSkin" name="updatePlaylistSkin" class="button-primary action" value="<?php _e('Update skin options for this playlist', 'flash-album-gallery'); ?>" /></p>
149
  </td>
150
  </tr>
151
  <tr>
152
+ <th align="left" valign="middle" scope="row"><?php _e('Title', 'flash-album-gallery'); ?>:</th>
153
  <td align="left" valign="middle"><input type="text" size="50" name="playlist_title" value="<?php echo esc_html($playlist['title']); ?>" /></td>
154
  </tr>
155
  <tr>
156
+ <th align="left" valign="top" scope="row"><?php _e('Description', 'flash-album-gallery'); ?>:</th>
157
  <td align="left" valign="top"><textarea name="playlist_descr" cols="60" rows="2" style="width: 95%" ><?php echo esc_html($playlist['description']); ?></textarea></td>
158
  </tr>
159
  <!--<tr>
160
+ <th align="left" valign="top" scope="row"><?php _e('Path', 'flash-album-gallery'); ?>:</th>
161
  <td align="left" colspan="2" valign="top"><?php echo $playlistPath; ?></td>
162
  </tr>-->
163
  </table>
168
  </div> <!-- poststuff -->
169
  <div class="tablenav flag-tablenav">
170
  <select id="bulkaction" name="bulkaction" class="alignleft">
171
+ <option value="no_action" ><?php _e("No action",'flash-album-gallery')?></option>
172
+ <option value="delete_items" ><?php _e("Delete items",'flash-album-gallery')?></option>
173
  </select>
174
+ <input class="button-secondary alignleft" style="margin-right:10px;" type="submit" name="updatePlaylist" value="<?php _e("OK",'flash-album-gallery')?>" onclick="if ( !checkSelected() ) return false;" />
175
+ <a href="<?php echo wp_nonce_url($filepath."&playlist=".sanitize_flagname($_GET['playlist'])."&mode=sort", 'flag_sort'); ?>" class="button-secondary alignleft" style="margin:1px 10px 0 0;"><?php _e("Sort Playlist",'flash-album-gallery')?></a>
176
+ <a href="#" onClick="jQuery('#form_listitems').submit();return false;" class="button-secondary alignleft" style="margin:1px 10px 0 0;"><?php _e("Add/Remove Items from Playlist",'flash-album-gallery')?></a>
177
+ <input type="submit" name="updatePlaylist" class="button-primary action alignright" value="<?php _e("Update Playlist",'flash-album-gallery')?>" />
178
  </div>
179
 
180
  <table id="flag-listmusic" class="widefat fixed flag-table" cellspacing="0" >
181
 
182
  <thead>
183
  <tr>
184
+ <th class="cb" width="54" scope="col"><a href="#" onclick="checkAll(document.getElementById('updatePlaylist'));return false;"><?php _e('Check', 'flash-album-gallery'); ?></a></th>
185
+ <th class="id" width="134" scope="col"><div><?php _e('ID', 'flash-album-gallery'); ?></div></th>
186
+ <th class="size" width="75" scope="col"><div><?php _e('Size', 'flash-album-gallery'); ?></div></th>
187
+ <th class="thumb" width="110" scope="col"><div><?php _e('Thumbnail', 'flash-album-gallery'); ?></div></th>
188
+ <th class="title_filename" scope="col"><div><?php _e('Filename / Title', 'flash-album-gallery'); ?></div></th>
189
+ <th class="description" scope="col"><div><?php _e('Description', 'flash-album-gallery'); ?></div></th>
190
  </tr>
191
  </thead>
192
  <tfoot>
193
  <tr>
194
+ <th class="cb" scope="col"><a href="#" onclick="checkAll(document.getElementById('updatePlaylist'));return false;"><?php _e('Check', 'flash-album-gallery'); ?></a></th>
195
+ <th class="id" scope="col"><?php _e('ID', 'flash-album-gallery'); ?></th>
196
+ <th class="size" scope="col"><?php _e('Size', 'flash-album-gallery'); ?></th>
197
+ <th class="thumb" scope="col"><?php _e('Thumbnail', 'flash-album-gallery'); ?></th>
198
+ <th class="title_filename" scope="col"><?php _e('Filename / Title', 'flash-album-gallery'); ?></th>
199
+ <th class="description" scope="col"><?php _e('Description', 'flash-album-gallery'); ?></th>
200
  </tr>
201
  </tfoot>
202
  <tbody>
221
  <tr id="mp3-<?php echo $mp3->ID; ?>"<?php echo $alt; ?> valign="top">
222
  <th class="cb" scope="row" height="24" style="padding-bottom: 0; border-bottom: none;"><input name="doaction[]" type="checkbox" value="<?php echo $mp3->ID; ?>" /></th>
223
  <td class="id" style="padding-bottom: 0; border-bottom: none;"><p style="margin-bottom: 3px; white-space: nowrap;">ID: <?php echo $mp3->ID; ?></p></td>
224
+ <td class="size" style="padding-bottom: 0; border-bottom: none;"><?php
225
  $path = $uploads['basedir'].str_replace($uploads['baseurl'],'',$url);
226
  $size = filesize($path);
227
  echo round($size/1024/1024,2).' Mb';
232
  <td class="title_filename" rowspan="2">
233
  <strong><a href="<?php echo $url; ?>"><?php echo basename($url); ?></a></strong><br />
234
  <textarea title="Title" name="item_a[<?php echo $mp3->ID; ?>][post_title]" cols="20" rows="1" style="width:95%; height: 25px; overflow:hidden;"><?php echo esc_html(stripslashes($mp3->post_title)); ?></textarea><br />
235
+ <p><?php _e('Thumb URL:', 'flash-album-gallery'); ?> <input id="mp3thumb-<?php echo $mp3->ID; ?>" name="item_a[<?php echo $mp3->ID; ?>][post_thumb]" type="text" value="<?php echo esc_url($mp3thumb); ?>" /> <a class="thickbox" onclick="actInp=<?php echo $mp3->ID; ?>" href="media-upload.php?type=image&amp;TB_iframe=1&amp;width=640&amp;height=400" title="<?php _e('Add an Image','flash-album-gallery'); ?>"><?php _e('assist', 'flash-album-gallery'); ?></a></p>
236
  </td>
237
  <td class="description" rowspan="2">
238
  <textarea name="item_a[<?php echo $mp3->ID; ?>][post_content]" style="width:95%; height: 96px; margin-top: 2px; font-size:12px; line-height:115%;" rows="1" ><?php echo esc_html(stripslashes($mp3->post_content)); ?></textarea>
239
  </td>
240
  </tr>
241
  <tr class="mp3-<?php echo $mp3->ID.$alt2; ?>">
242
+ <td valign="top" class="player" colspan="3"><audio src="<?php echo esc_url($url); ?>" controls preload="none" autobuffer="false"></audio></td>
 
243
  </tr>
244
  <?php
245
  }
246
  }
247
+
248
  // In the case you have no capaptibility to see the search result
249
  if ( $counter==0 )
250
+ echo '<tr><td colspan="5" align="center"><strong>'.__('No entries found','flash-album-gallery').'</strong></td></tr>';
251
 
252
  ?>
253
+
254
  </tbody>
255
  </table>
256
+ <p class="submit" style="text-align: right;"><input type="submit" class="button-primary action" name="updatePlaylist" value="<?php _e("Update Playlist",'flash-album-gallery')?>" /></p>
257
+ </form>
258
  <form id="form_listitems" name="form_listitems" method="POST" action="<?php echo esc_url($filepath."&playlist=".sanitize_flagname($_GET['playlist'])."&mode=add"); ?>">
259
  <?php wp_nonce_field('flag_add'); ?>
260
  <input type="hidden" name="items" value="<?php echo $items; ?>" />
admin/manage-sort.php CHANGED
@@ -28,7 +28,7 @@ function flag_sortorder($galleryID = 0){
28
  if ($firstImage)
29
  $wpdb->query("UPDATE $wpdb->flaggallery SET previewpic = '$firstImage' WHERE gid = '$galleryID'");
30
 
31
- flagGallery::show_message(__('Sort order changed','flag'));
32
 
33
  }
34
 
@@ -50,17 +50,17 @@ function flag_sortorder($galleryID = 0){
50
  <script type="text/javascript" src="<?php echo FLAG_URLPATH; ?>admin/js/jquery.tablednd_0_5.js"></script>
51
  <script type="text/javascript" src="<?php echo FLAG_URLPATH; ?>admin/js/jquery.tablesorter.js"></script>
52
  <div class="flag-wrap">
53
- <h2><?php _e('Sort Gallery', 'flag'); ?></h2>
54
 
55
  <form class="alignright" method="POST" action="<?php echo admin_url() . 'admin.php?page=flag-manage-gallery&amp;mode=edit&amp;gid=' . $galleryID; ?>" accept-charset="utf-8">
56
  <div class="alignright tablenav" style="margin-bottom: -36px;">
57
- <input class="button-secondary action" type="submit" name="backToGallery" value="<?php _e('Back to gallery', 'flag'); ?>" />
58
  </div>
59
  </form>
60
  <form id="sortGallery" method="POST" action="<?php echo $base_url; ?>" accept-charset="utf-8">
61
  <div class="alignleft tablenav">
62
  <?php wp_nonce_field('flag_updatesortorder'); ?>
63
- <input class="button-primary action" type="submit" name="updateSortorder" value="<?php _e('Update Sort Order', 'flag'); ?>" />
64
  </div>
65
  <br clear="all" />
66
  <script type="text/javascript">
@@ -96,20 +96,20 @@ jQuery(document).ready(function($) {
96
 
97
  <thead>
98
  <tr>
99
- <th class="header" width="30px"><p style="margin-right:-10px;"><?php _e('ID', 'flag'); ?></p></th>
100
- <th width="120"><p><?php _e('Thumb', 'flag'); ?></p></th>
101
- <th class="header"><p><?php _e('Filename', 'flag'); ?></p></th>
102
- <th class="header" width="130"><p><?php _e('Date', 'flag'); ?></p></th>
103
- <th class="header"><p><?php _e('Alt &amp; Title Text', 'flag'); ?></p></th>
104
  </tr>
105
  </thead>
106
  <tfoot>
107
  <tr>
108
- <th><p><?php _e('ID', 'flag'); ?></p></th>
109
- <th><p><?php _e('Thumb', 'flag'); ?></p></th>
110
- <th><p><?php _e('Filename', 'flag'); ?></p></th>
111
- <th><p><?php _e('Date', 'flag'); ?></p></th>
112
- <th><p><?php _e('Alt &amp; Title Text', 'flag'); ?></p></th>
113
  </tr>
114
  </tfoot>
115
  <tbody id="listimages">
@@ -137,13 +137,13 @@ if($picturelist) {
137
  <?php
138
  }
139
  } else {
140
- echo '<tr><td colspan="5" align="center"><strong>'.__('No entries found','flag').'</strong></td></tr>';
141
  }
142
  ?>
143
 
144
  </tbody>
145
  </table>
146
- <p class="actions"><input type="submit" class="button-primary action" name="updateSortorder" onclick="saveImageOrder()" value="<?php _e('Update Sort Order', 'flag'); ?>" /></p>
147
  </form>
148
  <br class="clear"/>
149
  </div><!-- /#wrap -->
28
  if ($firstImage)
29
  $wpdb->query("UPDATE $wpdb->flaggallery SET previewpic = '$firstImage' WHERE gid = '$galleryID'");
30
 
31
+ flagGallery::show_message(__('Sort order changed','flash-album-gallery'));
32
 
33
  }
34
 
50
  <script type="text/javascript" src="<?php echo FLAG_URLPATH; ?>admin/js/jquery.tablednd_0_5.js"></script>
51
  <script type="text/javascript" src="<?php echo FLAG_URLPATH; ?>admin/js/jquery.tablesorter.js"></script>
52
  <div class="flag-wrap">
53
+ <h2><?php _e('Sort Gallery', 'flash-album-gallery'); ?></h2>
54
 
55
  <form class="alignright" method="POST" action="<?php echo admin_url() . 'admin.php?page=flag-manage-gallery&amp;mode=edit&amp;gid=' . $galleryID; ?>" accept-charset="utf-8">
56
  <div class="alignright tablenav" style="margin-bottom: -36px;">
57
+ <input class="button-secondary action" type="submit" name="backToGallery" value="<?php _e('Back to gallery', 'flash-album-gallery'); ?>" />
58
  </div>
59
  </form>
60
  <form id="sortGallery" method="POST" action="<?php echo $base_url; ?>" accept-charset="utf-8">
61
  <div class="alignleft tablenav">
62
  <?php wp_nonce_field('flag_updatesortorder'); ?>
63
+ <input class="button-primary action" type="submit" name="updateSortorder" value="<?php _e('Update Sort Order', 'flash-album-gallery'); ?>" />
64
  </div>
65
  <br clear="all" />
66
  <script type="text/javascript">
96
 
97
  <thead>
98
  <tr>
99
+ <th class="header" width="30px"><p style="margin-right:-10px;"><?php _e('ID', 'flash-album-gallery'); ?></p></th>
100
+ <th width="120"><p><?php _e('Thumb', 'flash-album-gallery'); ?></p></th>
101
+ <th class="header"><p><?php _e('Filename', 'flash-album-gallery'); ?></p></th>
102
+ <th class="header" width="130"><p><?php _e('Date', 'flash-album-gallery'); ?></p></th>
103
+ <th class="header"><p><?php _e('Alt &amp; Title Text', 'flash-album-gallery'); ?></p></th>
104
  </tr>
105
  </thead>
106
  <tfoot>
107
  <tr>
108
+ <th><p><?php _e('ID', 'flash-album-gallery'); ?></p></th>
109
+ <th><p><?php _e('Thumb', 'flash-album-gallery'); ?></p></th>
110
+ <th><p><?php _e('Filename', 'flash-album-gallery'); ?></p></th>
111
+ <th><p><?php _e('Date', 'flash-album-gallery'); ?></p></th>
112
+ <th><p><?php _e('Alt &amp; Title Text', 'flash-album-gallery'); ?></p></th>
113
  </tr>
114
  </tfoot>
115
  <tbody id="listimages">
137
  <?php
138
  }
139
  } else {
140
+ echo '<tr><td colspan="5" align="center"><strong>'.__('No entries found','flash-album-gallery').'</strong></td></tr>';
141
  }
142
  ?>
143
 
144
  </tbody>
145
  </table>
146
+ <p class="actions"><input type="submit" class="button-primary action" name="updateSortorder" onclick="saveImageOrder()" value="<?php _e('Update Sort Order', 'flash-album-gallery'); ?>" /></p>
147
  </form>
148
  <br class="clear"/>
149
  </div><!-- /#wrap -->
admin/manage-video.php CHANGED
@@ -39,19 +39,19 @@ function checkSelected() {
39
  var numchecked = getNumChecked(document.getElementById('updatePlaylist'));
40
 
41
  if(numchecked < 1) {
42
- alert('<?php echo esc_js(__("No items selected", "flag")); ?>');
43
  return false;
44
  }
45
 
46
- actionId = jQuery('#bulkaction').val();
47
 
48
  switch (actionId) {
49
  case "delete_items":
50
- return confirm('<?php echo sprintf(esc_js(__("You are about to delete %s item(s) \n \n 'Cancel' to stop, 'OK' to proceed.",'flag')), "' + numchecked + '") ; ?>');
51
  break;
52
  }
53
 
54
- return confirm('<?php echo sprintf(esc_js(__("You are about to start the bulk edit for %s item(s) \n \n 'Cancel' to stop, 'OK' to proceed.",'flag')), "' + numchecked + '") ; ?>');
55
  }
56
 
57
  function showDialog( windowId, height ) {
@@ -98,11 +98,11 @@ jQuery(document).ready(function(){
98
  </script>
99
 
100
  <div class="flag-wrap">
101
- <h2><?php _e( 'Playlist', 'flag' ); ?>: <?php echo esc_html($playlist['title']); ?></h2>
102
  <div style="float: right; margin: -20px 3px 0 0;">
103
- <span><a href="<?php echo $filepath; ?>"><?php _e('Back to Video Box', 'flag'); ?></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
104
  <select name="select_playlist" onchange="window.location.href=this.options[this.selectedIndex].value">
105
- <option selected="selected"><?php _e('Choose another playlist', 'flag'); ?></option>
106
  <?php
107
  foreach((array)$all_playlists as $playlist_file => $playlist_data) {
108
  $playlist_name = basename($playlist_file, '.xml');
@@ -121,41 +121,46 @@ jQuery(document).ready(function(){
121
  <div id="poststuff" class="metabox-holder">
122
  <div id="post-body"><div id="post-body-content"><div id="normal-sortables" style="position: relative;">
123
  <div id="flagalleryset" class="postbox" >
124
- <h3 class="hndle"><span><?php _e('Playlist settings', 'flag'); ?></span></h3>
125
  <div class="inside">
126
  <table cellspacing="8" cellpadding="0" border="0">
127
  <tr>
128
- <th align="left" valign="middle" scope="row"><?php _e('Shortcode', 'flag'); ?>:</th>
129
  <td align="left" valign="middle"><input type="text" readonly="readonly" size="50" onfocus="this.select()" value="[grandvideo playlist=<?php echo sanitize_flagname($_GET['playlist']); ?>]" /></td>
130
- <td rowspan="3" align="left" valign="top"><div><strong style="display: inline-block; width: 100px;"><?php _e("Playlist Skin", 'flag'); ?>:</strong>
131
  <input id="skinaction" type="hidden" name="skinaction" value="<?php echo sanitize_flagname($playlist['skin']); ?>" />
132
  <select id="skinname" name="skinname" style="width: 200px; height: 24px; font-size: 11px;">
133
  <?php require_once (dirname(__FILE__) . '/get_skin.php');
134
  $all_skins = get_skins($skin_folder='', $type='v');
 
135
  if(count($all_skins)) {
136
  foreach ( (array)$all_skins as $skin_file => $skin_data) {
137
- $cur = ($playlist['skin'] == dirname($skin_file))? ' selected="selected"' : '';
 
 
 
 
138
  echo '<option'.$cur.' value="'.dirname($skin_file).'">'.$skin_data['Name'].'</option>'."\n";
139
  }
140
  } else {
141
- echo '<option value="video_default">'.__("No Skins", "flag").'</option>';
142
  }
143
  ?>
144
- </select>&nbsp;&nbsp;<a id="skinOptions" class="thickbox" href="<?php echo FLAG_URLPATH.'admin/skin_options.php?show_options=1&amp;skin='.sanitize_flagname($playlist['skin']).'&amp;TB_iframe=1&amp;width=600&amp;height=560'; ?>"><?php _e('Change Skin Options', 'flag' ); ?></a>
145
  </div>
146
- <p style="margin:10px 0 0 100px;"><input type="submit" id="updatePlaylistSkin" name="updatePlaylistSkin" class="button-primary action" value="<?php _e('Update skin options for this playlist', 'flag'); ?>" /></p>
147
  </td>
148
  </tr>
149
  <tr>
150
- <th align="left" valign="middle" scope="row"><?php _e('Title', 'flag'); ?>:</th>
151
  <td align="left" valign="middle"><input type="text" size="50" name="playlist_title" value="<?php echo esc_html($playlist['title']); ?>" /></td>
152
  </tr>
153
  <tr>
154
- <th align="left" valign="top" scope="row"><?php _e('Description', 'flag'); ?>:</th>
155
  <td align="left" valign="top"><textarea name="playlist_descr" cols="60" rows="2" style="width: 95%" ><?php echo esc_html($playlist['description']); ?></textarea></td>
156
  </tr>
157
  <!--<tr>
158
- <th align="left" valign="top" scope="row"><?php _e('Path', 'flag'); ?>:</th>
159
  <td align="left" colspan="2" valign="top"><?php echo $playlistPath; ?></td>
160
  </tr>-->
161
  </table>
@@ -166,35 +171,35 @@ jQuery(document).ready(function(){
166
  </div> <!-- poststuff -->
167
  <div class="tablenav flag-tablenav">
168
  <select id="bulkaction" name="bulkaction" class="alignleft">
169
- <option value="no_action" ><?php _e("No action",'flag')?></option>
170
- <option value="delete_items" ><?php _e("Delete items",'flag')?></option>
171
  </select>
172
- <input class="button-secondary alignleft" style="margin-right:10px;" type="submit" name="updatePlaylist" value="<?php _e("OK",'flag')?>" onclick="if ( !checkSelected() ) return false;" />
173
- <a href="<?php echo wp_nonce_url($filepath."&playlist=".sanitize_flagname($_GET['playlist'])."&mode=sort", 'flag_sort'); ?>" class="button-secondary alignleft" style="margin:1px 10px 0 0;"><?php _e("Sort Playlist",'flag')?></a>
174
- <a href="#" onClick="jQuery('#form_listitems').submit();return false;" class="button-secondary alignleft" style="margin:1px 10px 0 0;"><?php _e("Add/Remove Items from Playlist",'flag')?></a>
175
- <input type="submit" name="updatePlaylist" class="button-primary action alignright" value="<?php _e("Update Playlist",'flag')?>" />
176
  </div>
177
 
178
  <table id="flag-listvideo" class="widefat fixed flag-table" cellspacing="0" >
179
 
180
  <thead>
181
  <tr>
182
- <th class="cb" width="54" scope="col"><a href="#" onclick="checkAll(document.getElementById('updatePlaylist'));return false;"><?php _e('Check', 'flag'); ?></a></th>
183
- <th class="id" width="134" scope="col"><div><?php _e('ID', 'flag'); ?></div></th>
184
- <th class="size" width="75" scope="col"><div><?php _e('Size', 'flag'); ?></div></th>
185
- <th class="thumb" width="110" scope="col"><div><?php _e('Thumbnail', 'flag'); ?></div></th>
186
- <th class="title_filename" scope="col"><div><?php _e('Filename / Title', 'flag'); ?></div></th>
187
- <th class="description" scope="col"><div><?php _e('Description', 'flag'); ?></div></th>
188
  </tr>
189
  </thead>
190
  <tfoot>
191
  <tr>
192
- <th class="cb" scope="col"><a href="#" onclick="checkAll(document.getElementById('updatePlaylist'));return false;"><?php _e('Check', 'flag'); ?></a></th>
193
- <th class="id" scope="col"><?php _e('ID', 'flag'); ?></th>
194
- <th class="size" scope="col"><?php _e('Size', 'flag'); ?></th>
195
- <th class="thumb" scope="col"><?php _e('Thumbnail', 'flag'); ?></th>
196
- <th class="title_filename" scope="col"><?php _e('Filename / Title', 'flag'); ?></th>
197
- <th class="description" scope="col"><?php _e('Description', 'flag'); ?></th>
198
  </tr>
199
  </tfoot>
200
  <tbody>
@@ -224,12 +229,12 @@ if(count($items_a)) {
224
  echo round($size/1024/1024,2).' Mb';
225
  ?></td>
226
  <td class="thumb">
227
- <a class="thickbox" title="<?php echo basename($url); ?>" href="<?php echo FLAG_URLPATH; ?>admin/flv_preview.php?vid=<?php echo $flv->ID; ?>&amp;TB_iframe=1&amp;width=490&amp;height=293"><img id="thumb-<?php echo $flv->ID; ?>" src="<?php echo esc_url($thumb); ?>" style="width:auto; height:auto; max-width:100px; max-height:100px;" alt="" /></a>
228
  </td>
229
  <td class="title_filename">
230
  <strong><a href="<?php echo $url; ?>"><?php echo basename($url); ?></a></strong><br />
231
  <textarea title="Title" name="item_a[<?php echo $flv->ID; ?>][post_title]" cols="20" rows="1" style="width:95%; height: 25px; overflow:hidden;"><?php echo esc_html(stripslashes($flv->post_title)); ?></textarea><br />
232
- <p><?php _e('Thumb URL:', 'flag'); ?> <input id="flvthumb-<?php echo $flv->ID; ?>" name="item_a[<?php echo $flv->ID; ?>][post_thumb]" type="text" value="<?php echo esc_url($flvthumb); ?>" /> <a class="thickbox" onclick="actInp=<?php echo $flv->ID; ?>" href="media-upload.php?type=image&amp;TB_iframe=1&amp;width=640&amp;height=400" title="<?php _e('Add an Image','flag'); ?>"><?php _e('assist', 'flag'); ?></a></p>
233
  </td>
234
  <td class="description">
235
  <textarea name="item_a[<?php echo $flv->ID; ?>][post_content]" style="width:95%; height: 96px; margin-top: 2px; font-size:12px; line-height:115%;" rows="1" ><?php echo esc_html(stripslashes($flv->post_content)); ?></textarea>
@@ -241,13 +246,13 @@ if(count($items_a)) {
241
 
242
  // In the case you have no capaptibility to see the search result
243
  if ( $counter==0 )
244
- echo '<tr><td colspan="5" align="center"><strong>'.__('No entries found','flag').'</strong></td></tr>';
245
 
246
  ?>
247
 
248
  </tbody>
249
  </table>
250
- <p class="submit" style="text-align: right;"><input type="submit" class="button-primary action" name="updatePlaylist" value="<?php _e("Update Playlist",'flag')?>" /></p>
251
  </form>
252
  <form id="form_listitems" name="form_listitems" method="POST" action="<?php echo esc_url($filepath."&playlist=".sanitize_flagname($_GET['playlist'])."&mode=add"); ?>">
253
  <?php wp_nonce_field('flag_add'); ?>
39
  var numchecked = getNumChecked(document.getElementById('updatePlaylist'));
40
 
41
  if(numchecked < 1) {
42
+ alert('<?php echo esc_js(__("No items selected", "flash-album-gallery")); ?>');
43
  return false;
44
  }
45
 
46
+ var actionId = jQuery('#bulkaction').val();
47
 
48
  switch (actionId) {
49
  case "delete_items":
50
+ return confirm('<?php echo sprintf(esc_js(__("You are about to delete %s item(s) \n \n 'Cancel' to stop, 'OK' to proceed.",'flash-album-gallery')), "' + numchecked + '") ; ?>');
51
  break;
52
  }
53
 
54
+ return confirm('<?php echo sprintf(esc_js(__("You are about to start the bulk edit for %s item(s) \n \n 'Cancel' to stop, 'OK' to proceed.",'flash-album-gallery')), "' + numchecked + '") ; ?>');
55
  }
56
 
57
  function showDialog( windowId, height ) {
98
  </script>
99
 
100
  <div class="flag-wrap">
101
+ <h2><?php _e( 'Playlist', 'flash-album-gallery' ); ?>: <?php echo esc_html($playlist['title']); ?></h2>
102
  <div style="float: right; margin: -20px 3px 0 0;">
103
+ <span><a href="<?php echo $filepath; ?>"><?php _e('Back to Video Box', 'flash-album-gallery'); ?></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
104
  <select name="select_playlist" onchange="window.location.href=this.options[this.selectedIndex].value">
105
+ <option selected="selected"><?php _e('Choose another playlist', 'flash-album-gallery'); ?></option>
106
  <?php
107
  foreach((array)$all_playlists as $playlist_file => $playlist_data) {
108
  $playlist_name = basename($playlist_file, '.xml');
121
  <div id="poststuff" class="metabox-holder">
122
  <div id="post-body"><div id="post-body-content"><div id="normal-sortables" style="position: relative;">
123
  <div id="flagalleryset" class="postbox" >
124
+ <h3 class="hndle"><span><?php _e('Playlist settings', 'flash-album-gallery'); ?></span></h3>
125
  <div class="inside">
126
  <table cellspacing="8" cellpadding="0" border="0">
127
  <tr>
128
+ <th align="left" valign="middle" scope="row"><?php _e('Shortcode', 'flash-album-gallery'); ?>:</th>
129
  <td align="left" valign="middle"><input type="text" readonly="readonly" size="50" onfocus="this.select()" value="[grandvideo playlist=<?php echo sanitize_flagname($_GET['playlist']); ?>]" /></td>
130
+ <td rowspan="3" align="left" valign="top"><div><strong style="display: inline-block; width: 100px;"><?php _e("Playlist Skin", 'flash-album-gallery'); ?>:</strong>
131
  <input id="skinaction" type="hidden" name="skinaction" value="<?php echo sanitize_flagname($playlist['skin']); ?>" />
132
  <select id="skinname" name="skinname" style="width: 200px; height: 24px; font-size: 11px;">
133
  <?php require_once (dirname(__FILE__) . '/get_skin.php');
134
  $all_skins = get_skins($skin_folder='', $type='v');
135
+ $current_skin_title = __('No Skin', 'flash-album-gallery');
136
  if(count($all_skins)) {
137
  foreach ( (array)$all_skins as $skin_file => $skin_data) {
138
+ $cur = '';
139
+ if($playlist['skin'] == dirname($skin_file)){
140
+ $cur = ' selected="selected"';
141
+ $current_skin_title = $skin_data['Name'];
142
+ }
143
  echo '<option'.$cur.' value="'.dirname($skin_file).'">'.$skin_data['Name'].'</option>'."\n";
144
  }
145
  } else {
146
+ echo '<option value="wp-videoplayer">'.__("No Skins", "flash-album-gallery").'</option>';
147
  }
148
  ?>
149
+ </select>&nbsp;&nbsp;<a id="skinOptions" class="thickbox" title="<?php echo esc_attr($current_skin_title); ?>" href="<?php echo FLAG_URLPATH.'admin/skin_options.php?show_options=1&amp;skin='.sanitize_flagname($playlist['skin']).'&amp;TB_iframe=1&amp;width=600&amp;height=560'; ?>"><?php _e('Change Skin Options', 'flash-album-gallery' ); ?></a>
150
  </div>
151
+ <p style="margin:10px 0 0 100px;"><input type="submit" id="updatePlaylistSkin" name="updatePlaylistSkin" class="button-primary action" value="<?php _e('Update skin options for this playlist', 'flash-album-gallery'); ?>" /></p>
152
  </td>
153
  </tr>
154
  <tr>
155
+ <th align="left" valign="middle" scope="row"><?php _e('Title', 'flash-album-gallery'); ?>:</th>
156
  <td align="left" valign="middle"><input type="text" size="50" name="playlist_title" value="<?php echo esc_html($playlist['title']); ?>" /></td>
157
  </tr>
158
  <tr>
159
+ <th align="left" valign="top" scope="row"><?php _e('Description', 'flash-album-gallery'); ?>:</th>
160
  <td align="left" valign="top"><textarea name="playlist_descr" cols="60" rows="2" style="width: 95%" ><?php echo esc_html($playlist['description']); ?></textarea></td>
161
  </tr>
162
  <!--<tr>
163
+ <th align="left" valign="top" scope="row"><?php _e('Path', 'flash-album-gallery'); ?>:</th>
164
  <td align="left" colspan="2" valign="top"><?php echo $playlistPath; ?></td>
165
  </tr>-->
166
  </table>
171
  </div> <!-- poststuff -->
172
  <div class="tablenav flag-tablenav">
173
  <select id="bulkaction" name="bulkaction" class="alignleft">
174
+ <option value="no_action" ><?php _e("No action",'flash-album-gallery')?></option>
175
+ <option value="delete_items" ><?php _e("Delete items",'flash-album-gallery')?></option>
176
  </select>
177
+ <input class="button-secondary alignleft" style="margin-right:10px;" type="submit" name="updatePlaylist" value="<?php _e("OK",'flash-album-gallery')?>" onclick="if ( !checkSelected() ) return false;" />
178
+ <a href="<?php echo wp_nonce_url($filepath."&playlist=".sanitize_flagname($_GET['playlist'])."&mode=sort", 'flag_sort'); ?>" class="button-secondary alignleft" style="margin:1px 10px 0 0;"><?php _e("Sort Playlist",'flash-album-gallery')?></a>
179
+ <a href="#" onClick="jQuery('#form_listitems').submit();return false;" class="button-secondary alignleft" style="margin:1px 10px 0 0;"><?php _e("Add/Remove Items from Playlist",'flash-album-gallery')?></a>
180
+ <input type="submit" name="updatePlaylist" class="button-primary action alignright" value="<?php _e("Update Playlist",'flash-album-gallery')?>" />
181
  </div>
182
 
183
  <table id="flag-listvideo" class="widefat fixed flag-table" cellspacing="0" >
184
 
185
  <thead>
186
  <tr>
187
+ <th class="cb" width="54" scope="col"><a href="#" onclick="checkAll(document.getElementById('updatePlaylist'));return false;"><?php _e('Check', 'flash-album-gallery'); ?></a></th>
188
+ <th class="id" width="134" scope="col"><div><?php _e('ID', 'flash-album-gallery'); ?></div></th>
189
+ <th class="size" width="75" scope="col"><div><?php _e('Size', 'flash-album-gallery'); ?></div></th>
190
+ <th class="thumb" width="110" scope="col"><div><?php _e('Thumbnail', 'flash-album-gallery'); ?></div></th>
191
+ <th class="title_filename" scope="col"><div><?php _e('Filename / Title', 'flash-album-gallery'); ?></div></th>
192
+ <th class="description" scope="col"><div><?php _e('Description', 'flash-album-gallery'); ?></div></th>
193
  </tr>
194
  </thead>
195
  <tfoot>
196
  <tr>
197
+ <th class="cb" scope="col"><a href="#" onclick="checkAll(document.getElementById('updatePlaylist'));return false;"><?php _e('Check', 'flash-album-gallery'); ?></a></th>
198
+ <th class="id" scope="col"><?php _e('ID', 'flash-album-gallery'); ?></th>
199
+ <th class="size" scope="col"><?php _e('Size', 'flash-album-gallery'); ?></th>
200
+ <th class="thumb" scope="col"><?php _e('Thumbnail', 'flash-album-gallery'); ?></th>
201
+ <th class="title_filename" scope="col"><?php _e('Filename / Title', 'flash-album-gallery'); ?></th>
202
+ <th class="description" scope="col"><?php _e('Description', 'flash-album-gallery'); ?></th>
203
  </tr>
204
  </tfoot>
205
  <tbody>
229
  echo round($size/1024/1024,2).' Mb';
230
  ?></td>
231
  <td class="thumb">
232
+ <a class="thickbox" title="<?php echo basename($url); ?>" href="<?php echo FLAG_URLPATH; ?>admin/video_preview.php?vid=<?php echo $flv->ID; ?>&amp;TB_iframe=1&amp;width=490&amp;height=293"><img id="thumb-<?php echo $flv->ID; ?>" src="<?php echo esc_url($thumb); ?>" style="width:auto; height:auto; max-width:100px; max-height:100px;" alt="" /></a>
233
  </td>
234
  <td class="title_filename">
235
  <strong><a href="<?php echo $url; ?>"><?php echo basename($url); ?></a></strong><br />
236
  <textarea title="Title" name="item_a[<?php echo $flv->ID; ?>][post_title]" cols="20" rows="1" style="width:95%; height: 25px; overflow:hidden;"><?php echo esc_html(stripslashes($flv->post_title)); ?></textarea><br />
237
+ <p><?php _e('Thumb URL:', 'flash-album-gallery'); ?> <input id="flvthumb-<?php echo $flv->ID; ?>" name="item_a[<?php echo $flv->ID; ?>][post_thumb]" type="text" value="<?php echo esc_url($flvthumb); ?>" /> <a class="thickbox" onclick="actInp=<?php echo $flv->ID; ?>" href="media-upload.php?type=image&amp;TB_iframe=1&amp;width=640&amp;height=400" title="<?php _e('Add an Image','flash-album-gallery'); ?>"><?php _e('assist', 'flash-album-gallery'); ?></a></p>
238
  </td>
239
  <td class="description">
240
  <textarea name="item_a[<?php echo $flv->ID; ?>][post_content]" style="width:95%; height: 96px; margin-top: 2px; font-size:12px; line-height:115%;" rows="1" ><?php echo esc_html(stripslashes($flv->post_content)); ?></textarea>
246
 
247
  // In the case you have no capaptibility to see the search result
248
  if ( $counter==0 )
249
+ echo '<tr><td colspan="5" align="center"><strong>'.__('No entries found','flash-album-gallery').'</strong></td></tr>';
250
 
251
  ?>
252
 
253
  </tbody>
254
  </table>
255
+ <p class="submit" style="text-align: right;"><input type="submit" class="button-primary action" name="updatePlaylist" value="<?php _e("Update Playlist",'flash-album-gallery')?>" /></p>
256
  </form>
257
  <form id="form_listitems" name="form_listitems" method="POST" action="<?php echo esc_url($filepath."&playlist=".sanitize_flagname($_GET['playlist'])."&mode=add"); ?>">
258
  <?php wp_nonce_field('flag_add'); ?>
admin/manage.php CHANGED
@@ -103,7 +103,7 @@ class flagManageGallery {
103
  }
104
  }
105
 
106
- flagGallery::show_message( _n( 'Gallery', 'Galleries', 1, 'flag' ) . ' \''.$this->gid.'\' '.__('deleted successfully','flag'));
107
 
108
  }
109
 
@@ -114,7 +114,7 @@ class flagManageGallery {
114
  if ($this->mode == 'draft') {
115
  check_admin_referer('flag_editgallery');
116
  if($wpdb->query( "UPDATE $wpdb->flaggallery SET status = 1 WHERE gid = '{$this->gid}'" ))
117
- flagGallery::show_message( __( 'Gallery', 'flag' ) . ' \''.$this->gid.'\' '.__('now in draft','flag'));
118
  $this->mode = 'main'; // show mainpage
119
  }
120
 
@@ -122,7 +122,7 @@ class flagManageGallery {
122
  if ($this->mode == 'publish') {
123
  check_admin_referer('flag_editgallery');
124
  if($wpdb->query( "UPDATE $wpdb->flaggallery SET status = 0 WHERE gid = '{$this->gid}'" ))
125
- flagGallery::show_message( __( 'Gallery', 'flag' ) . ' \''.$this->gid.'\' '.__('now visible','flag'));
126
  $this->mode = 'main'; // show mainpage
127
  }
128
 
@@ -130,13 +130,13 @@ class flagManageGallery {
130
  if ( isset($_POST['album_name']) && !empty($_POST['album_name']) ) {
131
 
132
  check_admin_referer('flag_album');
133
- $album_name = preg_replace('/[^\w\s\._-]+/', '', $_POST['album_name']);
134
  $newalbum = $wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->flagalbum (name) VALUES (%s)", $album_name) );
135
  // and give me the new id
136
  $newalbum_id = (int) $wpdb->insert_id;
137
 
138
  if($newalbum)
139
- flagGallery::show_message( __( 'Album', 'flag' ) . ' \''.$album_name.'\' '.__('successfully created','flag'));
140
 
141
  $this->mode = 'main'; // show mainpage
142
  }
@@ -156,7 +156,7 @@ class flagManageGallery {
156
  $delete_pic = $wpdb->query("DELETE FROM $wpdb->flagpictures WHERE pid = '{$image->pid}'");
157
  }
158
  if($delete_pic)
159
- flagGallery::show_message( __('Picture','flag').' \''.$this->pid.'\' '.__('deleted successfully','flag') );
160
 
161
  $this->mode = 'edit'; // show pictures
162
 
@@ -165,7 +165,7 @@ class flagManageGallery {
165
  // will be called after a ajax operation
166
  if (isset ($_POST['ajax_callback'])) {
167
  if ($_POST['ajax_callback'] == 1)
168
- flagGallery::show_message(__('Operation successful. Please clear your browser cache.','flag'));
169
  }
170
 
171
  if ( isset ($_POST['backToGallery']) )
@@ -197,16 +197,16 @@ class flagManageGallery {
197
  case 'import_meta':
198
  // Import Metadata
199
  // A prefix 'gallery_' will first fetch all ids from the selected galleries
200
- flagAdmin::do_ajax_operation( 'gallery_import_metadata' , $_POST['doaction'], __('Import metadata','flag') );
201
  break;
202
  case 'copy_meta':
203
  // Copy Metadata
204
  // A prefix 'gallery_' will first fetch all ids from the selected galleries
205
- flagAdmin::do_ajax_operation( 'gallery_copy_metadata' , $_POST['doaction'], __('Copy metadata to image Description','flag') );
206
  break;
207
  case 'webview_images':
208
  // A prefix 'gallery_' will first fetch all ids from the selected galleries
209
- flagAdmin::do_ajax_operation( 'gallery_webview_image' , $_POST['doaction'], __('Creating images optimized for web','flag') );
210
  break;
211
  }
212
  }
@@ -223,7 +223,7 @@ class flagManageGallery {
223
 
224
  $gallery_ids = explode(',', $_POST['TB_imagelist']);
225
  // A prefix 'gallery_' will first fetch all ids from the selected galleries
226
- flagAdmin::do_ajax_operation( 'gallery_resize_image' , $gallery_ids, __('Resize images','flag') );
227
  }
228
 
229
  if (isset ($_POST['TB_bulkaction']) && isset ($_POST['TB_NewThumbnail'])) {
@@ -233,12 +233,11 @@ class flagManageGallery {
233
  //save the new values for the next operation
234
  $flag->options['thumbWidth'] = (int) $_POST['thumbWidth'];
235
  $flag->options['thumbHeight'] = (int) $_POST['thumbHeight'];
236
- $flag->options['thumbFix'] = (bool) $_POST['thumbFix'];
237
  update_option('flag_options', $flag->options);
238
 
239
  $gallery_ids = explode(',', $_POST['TB_imagelist']);
240
  // A prefix 'gallery_' will first fetch all ids from the selected galleries
241
- flagAdmin::do_ajax_operation( 'gallery_create_thumbnail' , $gallery_ids, __('Create new thumbnails','flag') );
242
  }
243
 
244
  }
@@ -271,17 +270,17 @@ class flagManageGallery {
271
  }
272
  }
273
  if($delete_pic)
274
- flagGallery::show_message(__('Pictures deleted successfully ','flag'));
275
  }
276
  break;
277
  case 'import_meta':
278
- flagAdmin::do_ajax_operation( 'import_metadata' , $_POST['doaction'], __('Import metadata','flag') );
279
  break;
280
  case 'copy_meta':
281
- flagAdmin::do_ajax_operation( 'copy_metadata' , $_POST['doaction'], __('Copy metadata to image Description','flag') );
282
  break;
283
  case 'webview_images':
284
- flagAdmin::do_ajax_operation( 'webview_image' , $_POST['doaction'], __('Creating images optimized for web','flag') );
285
  break;
286
  case 'reset_counters':
287
  if(is_array($_POST['doaction'])){
@@ -306,7 +305,7 @@ class flagManageGallery {
306
  update_option('flag_options', $flag->options);
307
 
308
  $pic_ids = explode(',', $_POST['TB_imagelist']);
309
- flagAdmin::do_ajax_operation( 'resize_image' , $pic_ids, __('Resize images','flag') );
310
  }
311
 
312
  if (isset ($_POST['TB_bulkaction']) && isset ($_POST['TB_NewThumbnail'])) {
@@ -316,11 +315,10 @@ class flagManageGallery {
316
  //save the new values for the next operation
317
  $flag->options['thumbWidth'] = (int) $_POST['thumbWidth'];
318
  $flag->options['thumbHeight'] = (int) $_POST['thumbHeight'];
319
- $flag->options['thumbFix'] = (bool) $_POST['thumbFix'];
320
  update_option('flag_options', $flag->options);
321
 
322
  $pic_ids = explode(',', $_POST['TB_imagelist']);
323
- flagAdmin::do_ajax_operation( 'create_thumbnail' , $pic_ids, __('Create new thumbnails','flag') );
324
  }
325
 
326
  if (isset ($_POST['TB_bulkaction']) && isset ($_POST['TB_SelectGallery'])) {
@@ -348,9 +346,9 @@ class flagManageGallery {
348
 
349
  check_admin_referer('flag_updategallery');
350
 
351
- $gallery_title = esc_html($_POST['title']);
352
  $gallery_path = esc_attr(str_replace('..','',$_POST['path']));
353
- $gallery_desc = esc_html($_POST['gallerydesc']);
354
  $gallery_preview = (int) $_POST['previewpic'];
355
 
356
  $wpdb->query("UPDATE $wpdb->flaggallery SET title= '$gallery_title', path= '$gallery_path', galdesc = '$gallery_desc', previewpic = '$gallery_preview' WHERE gid = '{$this->gid}'");
@@ -365,7 +363,7 @@ class flagManageGallery {
365
  //hook for other plugin to update the fields
366
  do_action('flag_update_gallery', $this->gid, $_POST);
367
 
368
- flagGallery::show_message(__('Update successful',"flag"));
369
  }
370
 
371
  if (isset ($_POST['scanfolder'])) {
@@ -393,7 +391,7 @@ class flagManageGallery {
393
 
394
  if ( is_array($description) ) {
395
  foreach( $description as $key => $value ) {
396
- $desc = esc_sql($value);
397
  $key =intval($key);
398
  $wpdb->query( "UPDATE $wpdb->flagpictures SET description = '$desc' WHERE pid = $key");
399
  }
103
  }
104
  }
105
 
106
+ flagGallery::show_message( _n( 'Gallery', 'Galleries', 1, 'flash-album-gallery' ) . ' \''.$this->gid.'\' '.__('deleted successfully','flash-album-gallery'));
107
 
108
  }
109
 
114
  if ($this->mode == 'draft') {
115
  check_admin_referer('flag_editgallery');
116
  if($wpdb->query( "UPDATE $wpdb->flaggallery SET status = 1 WHERE gid = '{$this->gid}'" ))
117
+ flagGallery::show_message( __( 'Gallery', 'flash-album-gallery' ) . ' \''.$this->gid.'\' '.__('now in draft','flash-album-gallery'));
118
  $this->mode = 'main'; // show mainpage
119
  }
120
 
122
  if ($this->mode == 'publish') {
123
  check_admin_referer('flag_editgallery');
124
  if($wpdb->query( "UPDATE $wpdb->flaggallery SET status = 0 WHERE gid = '{$this->gid}'" ))
125
+ flagGallery::show_message( __( 'Gallery', 'flash-album-gallery' ) . ' \''.$this->gid.'\' '.__('now visible','flash-album-gallery'));
126
  $this->mode = 'main'; // show mainpage
127
  }
128
 
130
  if ( isset($_POST['album_name']) && !empty($_POST['album_name']) ) {
131
 
132
  check_admin_referer('flag_album');
133
+ $album_name = wp_check_invalid_utf8(wp_strip_all_tags($_POST['album_name']));
134
  $newalbum = $wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->flagalbum (name) VALUES (%s)", $album_name) );
135
  // and give me the new id
136
  $newalbum_id = (int) $wpdb->insert_id;
137
 
138
  if($newalbum)
139
+ flagGallery::show_message( __( 'Album', 'flash-album-gallery' ) . ' \''.$album_name.'\' '.__('successfully created','flash-album-gallery'));
140
 
141
  $this->mode = 'main'; // show mainpage
142
  }
156
  $delete_pic = $wpdb->query("DELETE FROM $wpdb->flagpictures WHERE pid = '{$image->pid}'");
157
  }
158
  if($delete_pic)
159
+ flagGallery::show_message( __('Picture','flash-album-gallery').' \''.$this->pid.'\' '.__('deleted successfully','flash-album-gallery') );
160
 
161
  $this->mode = 'edit'; // show pictures
162
 
165
  // will be called after a ajax operation
166
  if (isset ($_POST['ajax_callback'])) {
167
  if ($_POST['ajax_callback'] == 1)
168
+ flagGallery::show_message(__('Operation successful. Please clear your browser cache.','flash-album-gallery'));
169
  }
170
 
171
  if ( isset ($_POST['backToGallery']) )
197
  case 'import_meta':
198
  // Import Metadata
199
  // A prefix 'gallery_' will first fetch all ids from the selected galleries
200
+ flagAdmin::do_ajax_operation( 'gallery_import_metadata' , $_POST['doaction'], __('Import metadata','flash-album-gallery') );
201
  break;
202
  case 'copy_meta':
203
  // Copy Metadata
204
  // A prefix 'gallery_' will first fetch all ids from the selected galleries
205
+ flagAdmin::do_ajax_operation( 'gallery_copy_metadata' , $_POST['doaction'], __('Copy metadata to image Description','flash-album-gallery') );
206
  break;
207
  case 'webview_images':
208
  // A prefix 'gallery_' will first fetch all ids from the selected galleries
209
+ flagAdmin::do_ajax_operation( 'gallery_webview_image' , $_POST['doaction'], __('Creating images optimized for web','flash-album-gallery') );
210
  break;
211
  }
212
  }
223
 
224
  $gallery_ids = explode(',', $_POST['TB_imagelist']);
225
  // A prefix 'gallery_' will first fetch all ids from the selected galleries
226
+ flagAdmin::do_ajax_operation( 'gallery_resize_image' , $gallery_ids, __('Resize images','flash-album-gallery') );
227
  }
228
 
229
  if (isset ($_POST['TB_bulkaction']) && isset ($_POST['TB_NewThumbnail'])) {
233
  //save the new values for the next operation
234
  $flag->options['thumbWidth'] = (int) $_POST['thumbWidth'];
235
  $flag->options['thumbHeight'] = (int) $_POST['thumbHeight'];
 
236
  update_option('flag_options', $flag->options);
237
 
238
  $gallery_ids = explode(',', $_POST['TB_imagelist']);
239
  // A prefix 'gallery_' will first fetch all ids from the selected galleries
240
+ flagAdmin::do_ajax_operation( 'gallery_create_thumbnail' , $gallery_ids, __('Create new thumbnails','flash-album-gallery') );
241
  }
242
 
243
  }
270
  }
271
  }
272
  if($delete_pic)
273
+ flagGallery::show_message(__('Pictures deleted successfully ','flash-album-gallery'));
274
  }
275
  break;
276
  case 'import_meta':
277
+ flagAdmin::do_ajax_operation( 'import_metadata' , $_POST['doaction'], __('Import metadata','flash-album-gallery') );
278
  break;
279
  case 'copy_meta':
280
+ flagAdmin::do_ajax_operation( 'copy_metadata' , $_POST['doaction'], __('Copy metadata to image Description','flash-album-gallery') );
281
  break;
282
  case 'webview_images':
283
+ flagAdmin::do_ajax_operation( 'webview_image' , $_POST['doaction'], __('Creating images optimized for web','flash-album-gallery') );
284
  break;
285
  case 'reset_counters':
286
  if(is_array($_POST['doaction'])){
305
  update_option('flag_options', $flag->options);
306
 
307
  $pic_ids = explode(',', $_POST['TB_imagelist']);
308
+ flagAdmin::do_ajax_operation( 'resize_image' , $pic_ids, __('Resize images','flash-album-gallery') );
309
  }
310
 
311
  if (isset ($_POST['TB_bulkaction']) && isset ($_POST['TB_NewThumbnail'])) {
315
  //save the new values for the next operation
316
  $flag->options['thumbWidth'] = (int) $_POST['thumbWidth'];
317
  $flag->options['thumbHeight'] = (int) $_POST['thumbHeight'];
 
318
  update_option('flag_options', $flag->options);
319
 
320
  $pic_ids = explode(',', $_POST['TB_imagelist']);
321
+ flagAdmin::do_ajax_operation( 'create_thumbnail' , $pic_ids, __('Create new thumbnails','flash-album-gallery') );
322
  }
323
 
324
  if (isset ($_POST['TB_bulkaction']) && isset ($_POST['TB_SelectGallery'])) {
346
 
347
  check_admin_referer('flag_updategallery');
348
 
349
+ $gallery_title = esc_html(wp_check_invalid_utf8($_POST['title']));
350
  $gallery_path = esc_attr(str_replace('..','',$_POST['path']));
351
+ $gallery_desc = esc_html(wp_check_invalid_utf8($_POST['gallerydesc']));
352
  $gallery_preview = (int) $_POST['previewpic'];
353
 
354
  $wpdb->query("UPDATE $wpdb->flaggallery SET title= '$gallery_title', path= '$gallery_path', galdesc = '$gallery_desc', previewpic = '$gallery_preview' WHERE gid = '{$this->gid}'");
363
  //hook for other plugin to update the fields
364
  do_action('flag_update_gallery', $this->gid, $_POST);
365
 
366
+ flagGallery::show_message(__('Update successful',"flash-album-gallery"));
367
  }
368
 
369
  if (isset ($_POST['scanfolder'])) {
391
 
392
  if ( is_array($description) ) {
393
  foreach( $description as $key => $value ) {
394
+ $desc = esc_sql(wp_check_invalid_utf8($value));
395
  $key =intval($key);
396
  $wpdb->query( "UPDATE $wpdb->flagpictures SET description = '$desc' WHERE pid = $key");
397
  }
admin/manage_thumbnail.php CHANGED
@@ -42,24 +42,17 @@ $rr = round($imageInfo[0] / $resizedPreviewInfo['newWidth'], 2);
42
  $WidthHtmlPrev = $flag_options['thumbWidth'];
43
  $HeightHtmlPrev = $flag_options['thumbHeight'];
44
 
45
- if ( ($flag_options['thumbFix'] == 1) ) {
 
46
 
47
- $WidthHtmlPrev = $flag_options['thumbWidth'];
48
- $HeightHtmlPrev = $flag_options['thumbHeight'];
49
 
50
  } else {
51
- // H > W
52
- if ($imageInfo[1] > $imageInfo[0]) {
53
 
54
- $HeightHtmlPrev = $flag_options['thumbHeight'];
55
- $WidthHtmlPrev = round($imageInfo[0] / ($imageInfo[1] / $flag_options['thumbHeight']),0);
56
-
57
- } else {
58
-
59
- $WidthtHtmlPrev = $flag_options['thumbWidth'];
60
- $HeightHtmlPrev = round($imageInfo[1] / ($imageInfo[0] / $flag_options['thumbWidth']),0);
61
-
62
- }
63
  }
64
 
65
  ?>
@@ -104,7 +97,7 @@ if ( ($flag_options['thumbFix'] == 1) ) {
104
  function updateThumb() {
105
 
106
  if ( (wT == 0) || (hT == 0) || (wT == undefined) || (hT == undefined) ) {
107
- alert("<?php _e('Select with the mouse the area for the new thumbnail.', 'flag'); ?>");
108
  return false;
109
  }
110
 
@@ -118,12 +111,12 @@ if ( ($flag_options['thumbFix'] == 1) ) {
118
  newUrl = jQuery("#"+selectedImage).attr("src") + "?" + d.getTime();
119
  jQuery("#"+selectedImage).attr("src" , newUrl);
120
 
121
- jQuery('#thumbMsg').html("<?php _e('Thumbnail updated', 'flag'); ?>");
122
  jQuery('#thumbMsg').css({'display':'block'});
123
  setTimeout(function(){ jQuery('#thumbMsg').fadeOut('slow'); }, 1500);
124
  },
125
  error: function() {
126
- jQuery('#thumbMsg').html("<?php _e('Error updating thumbnail.', 'flag'); ?>");
127
  jQuery('#thumbMsg').css({'display':'block'});
128
  setTimeout(function(){ jQuery('#thumbMsg').fadeOut('slow'); }, 1500);
129
  }
@@ -140,7 +133,7 @@ if ( ($flag_options['thumbFix'] == 1) ) {
140
  <img src="<?php echo $preview_image; ?>" alt="" id="imageToEdit" />
141
  </td>
142
  <td width="300" style="background-color : #DADADA;">
143
- <small style="margin-left:6px; display:block;"><?php _e('Select the area for the thumbnail from the picture on the left.', 'flag'); ?></small>
144
  </td>
145
  </tr>
146
  <tr>
@@ -155,7 +148,7 @@ if ( ($flag_options['thumbFix'] == 1) ) {
155
  </tr>
156
  <tr style="background-color:#DADADA;">
157
  <td>
158
- <input type="button" name="update" value="<?php _e('Update', 'flag'); ?>" onclick="updateThumb()" class="button-secondary" style="float:left; margin-left:4px;"/>
159
  <div id="thumbMsg" style="color:#FF0000; display : none;font-size:11px; float:right; width:60%; height:2em; line-height:2em;"></div>
160
  </td>
161
  </tr>
42
  $WidthHtmlPrev = $flag_options['thumbWidth'];
43
  $HeightHtmlPrev = $flag_options['thumbHeight'];
44
 
45
+ // H > W
46
+ if ($imageInfo[1] > $imageInfo[0]) {
47
 
48
+ $HeightHtmlPrev = $flag_options['thumbHeight'];
49
+ $WidthHtmlPrev = round($imageInfo[0] / ($imageInfo[1] / $flag_options['thumbHeight']),0);
50
 
51
  } else {
 
 
52
 
53
+ $WidthtHtmlPrev = $flag_options['thumbWidth'];
54
+ $HeightHtmlPrev = round($imageInfo[1] / ($imageInfo[0] / $flag_options['thumbWidth']),0);
55
+
 
 
 
 
 
 
56
  }
57
 
58
  ?>
97
  function updateThumb() {
98
 
99
  if ( (wT == 0) || (hT == 0) || (wT == undefined) || (hT == undefined) ) {
100
+ alert("<?php _e('Select with the mouse the area for the new thumbnail.', 'flash-album-gallery'); ?>");
101
  return false;
102
  }
103
 
111
  newUrl = jQuery("#"+selectedImage).attr("src") + "?" + d.getTime();
112
  jQuery("#"+selectedImage).attr("src" , newUrl);
113
 
114
+ jQuery('#thumbMsg').html("<?php _e('Thumbnail updated', 'flash-album-gallery'); ?>");
115
  jQuery('#thumbMsg').css({'display':'block'});
116
  setTimeout(function(){ jQuery('#thumbMsg').fadeOut('slow'); }, 1500);
117
  },
118
  error: function() {
119
+ jQuery('#thumbMsg').html("<?php _e('Error updating thumbnail.', 'flash-album-gallery'); ?>");
120
  jQuery('#thumbMsg').css({'display':'block'});
121
  setTimeout(function(){ jQuery('#thumbMsg').fadeOut('slow'); }, 1500);
122
  }
133
  <img src="<?php echo $preview_image; ?>" alt="" id="imageToEdit" />
134
  </td>
135
  <td width="300" style="background-color : #DADADA;">
136
+ <small style="margin-left:6px; display:block;"><?php _e('Select the area for the thumbnail from the picture on the left.', 'flash-album-gallery'); ?></small>
137
  </td>
138
  </tr>
139
  <tr>
148
  </tr>
149
  <tr style="background-color:#DADADA;">
150
  <td>
151
+ <input type="button" name="update" value="<?php _e('Update', 'flash-album-gallery'); ?>" onclick="updateThumb()" class="button-secondary" style="float:left; margin-left:4px;"/>
152
  <div id="thumbMsg" style="color:#FF0000; display : none;font-size:11px; float:right; width:60%; height:2em; line-height:2em;"></div>
153
  </td>
154
  </tr>
admin/media-upload.php CHANGED
@@ -5,7 +5,7 @@
5
 
6
  function flag_wp_upload_tabs ($tabs) {
7
 
8
- $newtab = array('flag' => __('FlAGallery','flag'));
9
 
10
  return array_merge($tabs,$newtab);
11
  }
@@ -123,7 +123,7 @@ function media_upload_flag_form() {
123
 
124
  <div class="alignleft actions">
125
  <select id="select_gal" name="select_gal" style="width:200px;">;
126
- <option value="0" <?php selected('0', $galleryID); ?> ><?php _e('No gallery',"flag"); ?></option>
127
  <?php
128
  // Show gallery selection
129
  $gallerylist = $wpdb->get_results("SELECT * FROM $wpdb->flaggallery ORDER BY gid ASC");
@@ -135,7 +135,7 @@ function media_upload_flag_form() {
135
  }
136
  ?>
137
  </select>
138
- <input type="submit" id="show-gallery" value="<?php _e('Select &#187;','flag'); ?>" class="button-secondary" />
139
  </div>
140
  <br style="clear:both;" />
141
  </div>
@@ -166,23 +166,23 @@ function media_upload_flag_form() {
166
  ?>
167
  <div id='media-item-<?php echo $picid; ?>' class='media-item preloaded'>
168
  <div class='filename'></div>
169
- <a class='toggle describe-toggle-on' href='#'><?php _e('Show', "flag"); ?></a>
170
- <a class='toggle describe-toggle-off' href='#'><?php _e('Hide', "flag"); ?></a>
171
  <div class='filename new'><?php echo ( empty($picture->alttext) ) ? wp_html_excerpt($picture->filename,60): stripslashes( wp_html_excerpt($picture->alttext,60) ); ?></div>
172
  <table class='slidetoggle describe startclosed'><tbody>
173
  <tr>
174
  <td rowspan='4'><img class='thumbnail' alt='<?php echo esc_attr( $picture->alttext ); ?>' src='<?php echo esc_attr( $picture->thumbURL ); ?>'/></td>
175
- <td><?php _e('Image ID:', "flag"); ?><?php echo $picid; ?></td>
176
  </tr>
177
  <tr><td><?php echo esc_attr( $picture->filename ); ?></td></tr>
178
  <tr><td><?php echo esc_html( stripslashes($picture->alttext) ); ?></td></tr>
179
  <tr><td>&nbsp;</td></tr>
180
  <tr>
181
- <td class="label"><label for="image[<?php echo $picid; ?>][alttext]"><?php _e('Alt/Title text', "flag"); ?></label></td>
182
  <td class="field"><input id="image[<?php echo $picid; ?>][alttext]" name="image[<?php echo $picid; ?>][alttext]" value="<?php echo esc_html( stripslashes($picture->alttext) ); ?>" type="text"/></td>
183
  </tr>
184
  <tr>
185
- <td class="label"><label for="image[<?php echo $picid; ?>][description]"><?php _e("Description","flag"); ?></label></td>
186
  <td class="field"><textarea name="image[<?php echo $picid; ?>][description]" id="image[<?php echo $picid; ?>][description]"><?php echo esc_html( stripslashes($picture->description) ); ?></textarea></td>
187
  </tr>
188
  <tr class="align">
@@ -223,7 +223,7 @@ function media_upload_flag_form() {
223
  ?>
224
  </div>
225
  <p class="ml-submit">
226
- <input type="submit" class="button savebutton" name="save" value="<?php _e('Save all changes','flag'); ?>" />
227
  </p>
228
  <input type="hidden" name="post_id" id="post_id" value="<?php echo (int) $post_id; ?>" />
229
  <input type="hidden" name="select_gal" id="select_gal" value="<?php echo (int) $galleryID; ?>" />
5
 
6
  function flag_wp_upload_tabs ($tabs) {
7
 
8
+ $newtab = array('flash-album-gallery' => __('FlAGallery','flash-album-gallery'));
9
 
10
  return array_merge($tabs,$newtab);
11
  }
123
 
124
  <div class="alignleft actions">
125
  <select id="select_gal" name="select_gal" style="width:200px;">;
126
+ <option value="0" <?php selected('0', $galleryID); ?> ><?php _e('No gallery',"flash-album-gallery"); ?></option>
127
  <?php
128
  // Show gallery selection
129
  $gallerylist = $wpdb->get_results("SELECT * FROM $wpdb->flaggallery ORDER BY gid ASC");
135
  }
136
  ?>
137
  </select>
138
+ <input type="submit" id="show-gallery" value="<?php _e('Select &#187;','flash-album-gallery'); ?>" class="button-secondary" />
139
  </div>
140
  <br style="clear:both;" />
141
  </div>
166
  ?>
167
  <div id='media-item-<?php echo $picid; ?>' class='media-item preloaded'>
168
  <div class='filename'></div>
169
+ <a class='toggle describe-toggle-on' href='#'><?php _e('Show', "flash-album-gallery"); ?></a>
170
+ <a class='toggle describe-toggle-off' href='#'><?php _e('Hide', "flash-album-gallery"); ?></a>
171
  <div class='filename new'><?php echo ( empty($picture->alttext) ) ? wp_html_excerpt($picture->filename,60): stripslashes( wp_html_excerpt($picture->alttext,60) ); ?></div>
172
  <table class='slidetoggle describe startclosed'><tbody>
173
  <tr>
174
  <td rowspan='4'><img class='thumbnail' alt='<?php echo esc_attr( $picture->alttext ); ?>' src='<?php echo esc_attr( $picture->thumbURL ); ?>'/></td>
175
+ <td><?php _e('Image ID:', "flash-album-gallery"); ?><?php echo $picid; ?></td>
176
  </tr>
177
  <tr><td><?php echo esc_attr( $picture->filename ); ?></td></tr>
178
  <tr><td><?php echo esc_html( stripslashes($picture->alttext) ); ?></td></tr>
179
  <tr><td>&nbsp;</td></tr>
180
  <tr>
181
+ <td class="label"><label for="image[<?php echo $picid; ?>][alttext]"><?php _e('Alt/Title text', "flash-album-gallery"); ?></label></td>
182
  <td class="field"><input id="image[<?php echo $picid; ?>][alttext]" name="image[<?php echo $picid; ?>][alttext]" value="<?php echo esc_html( stripslashes($picture->alttext) ); ?>" type="text"/></td>
183
  </tr>
184
  <tr>
185
+ <td class="label"><label for="image[<?php echo $picid; ?>][description]"><?php _e("Description","flash-album-gallery"); ?></label></td>
186
  <td class="field"><textarea name="image[<?php echo $picid; ?>][description]" id="image[<?php echo $picid; ?>][description]"><?php echo esc_html( stripslashes($picture->description) ); ?></textarea></td>
187
  </tr>
188
  <tr class="align">
223
  ?>
224
  </div>
225
  <p class="ml-submit">
226
+ <input type="submit" class="button savebutton" name="save" value="<?php _e('Save all changes','flash-album-gallery'); ?>" />
227
  </p>
228
  <input type="hidden" name="post_id" id="post_id" value="<?php echo (int) $post_id; ?>" />
229
  <input type="hidden" name="select_gal" id="select_gal" value="<?php echo (int) $galleryID; ?>" />
admin/meta_box.php CHANGED
@@ -2,19 +2,17 @@
2
 
3
  global $flag, $flagdb, $post;
4
  require_once (dirname(__FILE__) . '/get_skin.php');
5
- require_once (dirname(__FILE__) . '/playlist.functions.php');
6
  $i_skins = get_skins();
7
- $all_playlists = get_playlists();
8
  $flag_custom = get_post_custom($post->ID);
9
  $items_array = isset($flag_custom["mb_items_array"][0])? $flag_custom["mb_items_array"][0] : '';
10
  $skinname = isset($flag_custom["mb_skinname"][0])? $flag_custom["mb_skinname"][0] : '';
11
  $scode = isset($flag_custom["mb_scode"][0])? $flag_custom["mb_scode"][0] : '';
12
- $music = isset($flag_custom["mb_playlist"][0])? $flag_custom["mb_playlist"][0] : '';
13
  $button_text = isset($flag_custom["mb_button"][0])? $flag_custom["mb_button"][0] : '';
14
  $button_link = isset($flag_custom["mb_button_link"][0])? $flag_custom["mb_button_link"][0] : '';
15
  $bg_link = isset($flag_custom["mb_bg_link"][0])? $flag_custom["mb_bg_link"][0] : '';
16
- $bg_pos = isset($flag_custom["mb_bg_pos"][0])? $flag_custom["mb_bg_pos"][0] : '';
17
- $bg_repeat = isset($flag_custom["mb_bg_repeat"][0])? $flag_custom["mb_bg_repeat"][0] : '';
 
18
  ?>
19
  <script type="text/javascript">/*<![CDATA[*/
20
  var i_arr = '<?php echo $items_array; ?>';
@@ -23,30 +21,26 @@ jQuery(document).ready(function() {
23
  i_arr = i_arr.split(',');
24
  jQuery('#galleries :checkbox').each(function(){
25
  if(jQuery.inArray(jQuery(this).val(),i_arr) > -1){
26
- jQuery(this).attr('checked','checked');
27
  }
28
  });
29
  } else {
30
  jQuery('#mb_items_array').val('all');
31
- jQuery('#galleries input[value="all"]').attr('checked','checked').parent().siblings('.row').find('input').removeAttr('checked');
32
  }
33
  var galleries = 'gid='+jQuery('#mb_items_array').val();
34
  var skin = jQuery('#mb_skinname option:selected').val();
35
  if(skin) skin = ' skin='+skin; else skin = '';
36
- var playlist = jQuery('#mb_playlist option:selected').val();
37
- if(playlist) playlist = ' playlist='+playlist; else playlist = '';
38
- var wmode = jQuery('#mb_bg_link').val();
39
- if(wmode) wmode = ' wmode=transparent'; else wmode = ' wmode=window';
40
- short_code(galleries,skin,wmode,playlist);
41
  jQuery('#galleries :checkbox').click(function(){
42
  var cur, arr, del;
43
  if(jQuery(this).is(':checked')){
44
  cur = jQuery(this).val();
45
  if(cur == 'all') {
46
- jQuery(this).parent().siblings('.row').find('input').removeAttr('checked');
47
  jQuery('#mb_items_array').val(cur);
48
  } else {
49
- jQuery('#galleries input[value="all"]').removeAttr('checked');
50
  arr = jQuery('#mb_items_array').val();
51
  if(arr && arr != 'all') { del = ','; } else { arr = ''; del = ''; }
52
  jQuery('#mb_items_array').val(arr+del+cur);
@@ -58,12 +52,12 @@ jQuery(document).ready(function() {
58
  if(arr) {
59
  jQuery('#mb_items_array').val(arr);
60
  } else {
61
- jQuery('#galleries input[value="all"]').attr('checked','checked');
62
  jQuery('#mb_items_array').val('all');
63
  }
64
  }
65
  galleries = 'gid='+jQuery('#mb_items_array').val();
66
- short_code(galleries,skin,wmode,playlist);
67
  });
68
  jQuery('#mb_skinname').change(function(){
69
  skin = jQuery(this).val();
@@ -72,38 +66,28 @@ jQuery(document).ready(function() {
72
  } else {
73
  skin = '';
74
  }
75
- short_code(galleries,skin,wmode,playlist);
76
- });
77
- jQuery('#mb_playlist').change(function(){
78
- playlist = jQuery(this).val();
79
- if(playlist) {
80
- playlist = ' playlist='+playlist;
81
- } else {
82
- playlist = '';
83
- }
84
- short_code(galleries,skin,wmode,playlist);
85
- });
86
- jQuery('#mb_bg_link').change(function(){
87
- wmode = jQuery(this).val();
88
- if(wmode) {
89
- wmode = ' wmode=transparent';
90
- } else {
91
- wmode = ' wmode=window';
92
- }
93
- short_code(galleries,skin,wmode,playlist);
94
  });
95
  });
96
- function short_code(galleries,skin,wmode,playlist) {
97
- jQuery('#mb_scode').val('[flagallery '+galleries+' w=100% h=100%'+skin+wmode+playlist+' fullwindow=true]');
 
 
 
 
 
 
 
98
  }
 
99
  /*]]>*/</script>
100
  <div class="wrap">
101
  <form id="generator1">
102
  <table border="0" cellpadding="4" cellspacing="0" style="width: 90%;">
103
  <tr>
104
- <td nowrap="nowrap" valign="top" style="width: 10%;"><div><?php _e("Select galleries", 'flag'); ?>:<span style="color:red;"> *</span><br /><small><?php _e("(album categories)", 'flag'); ?></small></div></td>
105
  <td valign="top"><div id="galleries" style="width: 214px; height: 160px; overflow: auto;">
106
- <div class="row"><input type="checkbox" value="all" /> <strong>* - <?php _e("all galleries", 'flag'); ?></strong></div>
107
  <?php
108
  $gallerylist = $flagdb->find_all_galleries($flag->options['albSort'], $flag->options['albSortDir']);
109
  if(is_array($gallerylist)) {
@@ -118,13 +102,13 @@ function short_code(galleries,skin,wmode,playlist) {
118
  </div></td>
119
  </tr>
120
  <tr>
121
- <td nowrap="nowrap" valign="top"><p style="padding-top:3px;"><?php _e("Galleries order", 'flag'); ?>: &nbsp; </p></td>
122
  <td valign="top"><p><input readonly="readonly" type="text" id="mb_items_array" name="mb_items_array" value="<?php echo $items_array; ?>" style="width: 98%;" /></p></td>
123
  </tr>
124
  <tr>
125
- <td nowrap="nowrap" valign="top"><p style="padding-top:3px;"><label for="mb_skinname"><?php _e("Choose skin", 'flag'); ?>:</label></p></td>
126
  <td valign="top"><p><select id="mb_skinname" name="mb_skinname">
127
- <option value="" <?php selected($skinname,''); ?>><?php _e("skin active by default", 'flag'); ?></option>
128
  <?php
129
  foreach ( (array)$i_skins as $skin_file => $skin_data) {
130
  echo '<option value="'.dirname($skin_file).'" '.selected($skinname,dirname($skin_file),false).'>'.$skin_data['Name'].'</option>'."\n";
@@ -135,37 +119,23 @@ function short_code(galleries,skin,wmode,playlist) {
135
  </td>
136
  </tr>
137
  <tr>
138
- <td nowrap="nowrap" valign="top"><div style="padding-top: 3px;"><?php _e("Back Button Text", 'flag'); ?>: &nbsp; </div></td>
139
- <td valign="top"><input id="mb_button" name="mb_button" type="text" style="width: 49%;" placeholder="Home" value="<?php echo $button_text; ?>" /><br />
140
- <small><?php _e("Leave empty to hide Back button", 'flag'); ?></small></td>
141
  </tr>
142
  <tr>
143
- <td nowrap="nowrap" valign="top"><div style="padding-top: 3px;"><?php _e("Back Button Link", 'flag'); ?>: &nbsp; </div></td>
144
  <td valign="top"><input id="mb_button_link" name="mb_button_link" type="text" style="width: 49%;" placeholder="<?php echo home_url(); ?>" value="<?php echo $button_link; ?>" /><br />
145
- <small><?php _e("Leave empty to use referer link", 'flag'); ?></small></td>
146
- </tr>
147
- <tr>
148
- <td nowrap="nowrap" valign="top"><div style="padding-top: 3px;"><?php _e("Music", 'flag'); ?>: &nbsp; </div></td>
149
- <td valign="top"><select id="mb_playlist" name="mb_playlist">
150
- <option value="" selected="selected" <?php selected($music,''); ?>><?php _e("choose playlist", 'flag'); ?></option>
151
- <?php
152
- foreach((array)$all_playlists as $playlist_file => $playlist_data) {
153
- $playlist_name = basename($playlist_file, '.xml');
154
- ?>
155
- <option value="<?php echo $playlist_name; ?>" <?php selected($music,$playlist_name); ?>><?php echo $playlist_data['title']; ?></option>
156
- <?php
157
- }
158
- ?>
159
- </select><br />
160
- <small><?php _e("(optional) Read Skin specification for supporting this function.", 'flag'); ?></small></td>
161
  </tr>
162
  <tr>
163
- <td nowrap="nowrap" valign="top"><div style="padding-top: 3px;"><?php _e("Background Image Link", 'flag'); ?>: &nbsp; </div></td>
164
- <td valign="top"><input id="mb_bg_link" name="mb_bg_link" type="text" style="width: 49%;" value="<?php echo $bg_link; ?>" /><br />
165
- <small><?php _e("(optional) Be sure you set Wmode to 'transparent' in skin's options", 'flag'); ?></small></td>
 
 
166
  </tr>
167
  <tr>
168
- <td nowrap="nowrap" valign="top"><div style="padding-top: 3px;"><?php _e("Background Position", 'flag'); ?>:</div></td>
169
  <td valign="top"><select id="mb_bg_pos" name="mb_bg_pos">
170
  <option value="center center" <?php selected($bg_pos,'center center'); ?>>center center</option>
171
  <option value="left top" <?php selected($bg_pos,'left top'); ?>>left top</option>
@@ -179,7 +149,7 @@ function short_code(galleries,skin,wmode,playlist) {
179
  </select></td>
180
  </tr>
181
  <tr>
182
- <td nowrap="nowrap" valign="top"><div style="padding-top: 3px;"><?php _e("Background Repeat", 'flag'); ?>:</div></td>
183
  <td valign="top"><select id="mb_bg_repeat" name="mb_bg_repeat">
184
  <option value="repeat" <?php selected($bg_repeat,'repeat'); ?>>repeat</option>
185
  <option value="repeat-x" <?php selected($bg_repeat,'repeat-x'); ?>>repeat-x</option>
@@ -187,6 +157,14 @@ function short_code(galleries,skin,wmode,playlist) {
187
  <option value="no-repeat" <?php selected($bg_repeat,'no-repeat'); ?>>no-repeat</option>
188
  </select></td>
189
  </tr>
 
 
 
 
 
 
 
 
190
  </table>
191
  </form>
192
  </div>
2
 
3
  global $flag, $flagdb, $post;
4
  require_once (dirname(__FILE__) . '/get_skin.php');
 
5
  $i_skins = get_skins();
 
6
  $flag_custom = get_post_custom($post->ID);
7
  $items_array = isset($flag_custom["mb_items_array"][0])? $flag_custom["mb_items_array"][0] : '';
8
  $skinname = isset($flag_custom["mb_skinname"][0])? $flag_custom["mb_skinname"][0] : '';
9
  $scode = isset($flag_custom["mb_scode"][0])? $flag_custom["mb_scode"][0] : '';
 
10
  $button_text = isset($flag_custom["mb_button"][0])? $flag_custom["mb_button"][0] : '';
11
  $button_link = isset($flag_custom["mb_button_link"][0])? $flag_custom["mb_button_link"][0] : '';
12
  $bg_link = isset($flag_custom["mb_bg_link"][0])? $flag_custom["mb_bg_link"][0] : '';
13
+ $bg_pos = isset($flag_custom["mb_bg_pos"][0])? $flag_custom["mb_bg_pos"][0] : 'center center';
14
+ $bg_repeat = isset($flag_custom["mb_bg_repeat"][0])? $flag_custom["mb_bg_repeat"][0] : 'repeat';
15
+ $bg_size = isset($flag_custom["mb_bg_size"][0])? $flag_custom["mb_bg_size"][0] : 'auto';
16
  ?>
17
  <script type="text/javascript">/*<![CDATA[*/
18
  var i_arr = '<?php echo $items_array; ?>';
21
  i_arr = i_arr.split(',');
22
  jQuery('#galleries :checkbox').each(function(){
23
  if(jQuery.inArray(jQuery(this).val(),i_arr) > -1){
24
+ jQuery(this).prop('checked',true);
25
  }
26
  });
27
  } else {
28
  jQuery('#mb_items_array').val('all');
29
+ jQuery('#galleries input[value="all"]').prop('checked',true).parent().siblings('.row').find('input').prop('checked', false);
30
  }
31
  var galleries = 'gid='+jQuery('#mb_items_array').val();
32
  var skin = jQuery('#mb_skinname option:selected').val();
33
  if(skin) skin = ' skin='+skin; else skin = '';
34
+ short_code(galleries,skin);
 
 
 
 
35
  jQuery('#galleries :checkbox').click(function(){
36
  var cur, arr, del;
37
  if(jQuery(this).is(':checked')){
38
  cur = jQuery(this).val();
39
  if(cur == 'all') {
40
+ jQuery(this).parent().siblings('.row').find('input').prop('checked', false);
41
  jQuery('#mb_items_array').val(cur);
42
  } else {
43
+ jQuery('#galleries input[value="all"]').prop('checked', false);
44
  arr = jQuery('#mb_items_array').val();
45
  if(arr && arr != 'all') { del = ','; } else { arr = ''; del = ''; }
46
  jQuery('#mb_items_array').val(arr+del+cur);
52
  if(arr) {
53
  jQuery('#mb_items_array').val(arr);
54
  } else {
55
+ jQuery('#galleries input[value="all"]').prop('checked',true);
56
  jQuery('#mb_items_array').val('all');
57
  }
58
  }
59
  galleries = 'gid='+jQuery('#mb_items_array').val();
60
+ short_code(galleries,skin);
61
  });
62
  jQuery('#mb_skinname').change(function(){
63
  skin = jQuery(this).val();
66
  } else {
67
  skin = '';
68
  }
69
+ short_code(galleries,skin);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
70
  });
71
  });
72
+ function short_code(galleries,skin) {
73
+ jQuery('#mb_scode').val('[flagallery '+galleries+' w=100% h=100%'+skin+' fullwindow=true]');
74
+ }
75
+ var current_image = '';
76
+ function send_to_editor(html){
77
+ var source = html.match(/src=\".*\" alt/);
78
+ source = source[0].replace(/^src=\"/, "").replace(/" alt$/, "");
79
+ jQuery('#mb_bg_link').val(source);
80
+ tb_remove();
81
  }
82
+
83
  /*]]>*/</script>
84
  <div class="wrap">
85
  <form id="generator1">
86
  <table border="0" cellpadding="4" cellspacing="0" style="width: 90%;">
87
  <tr>
88
+ <td nowrap="nowrap" valign="top" style="width: 10%;"><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>
89
  <td valign="top"><div id="galleries" style="width: 214px; height: 160px; overflow: auto;">
90
+ <div class="row"><input type="checkbox" value="all" /> <strong>* - <?php _e("all galleries", 'flash-album-gallery'); ?></strong></div>
91
  <?php
92
  $gallerylist = $flagdb->find_all_galleries($flag->options['albSort'], $flag->options['albSortDir']);
93
  if(is_array($gallerylist)) {
102
  </div></td>
103
  </tr>
104
  <tr>
105
+ <td nowrap="nowrap" valign="top"><p style="padding-top:3px;"><?php _e("Galleries order", 'flash-album-gallery'); ?>: &nbsp; </p></td>
106
  <td valign="top"><p><input readonly="readonly" type="text" id="mb_items_array" name="mb_items_array" value="<?php echo $items_array; ?>" style="width: 98%;" /></p></td>
107
  </tr>
108
  <tr>
109
+ <td nowrap="nowrap" valign="top"><p style="padding-top:3px;"><label for="mb_skinname"><?php _e("Choose skin", 'flash-album-gallery'); ?>:</label></p></td>
110
  <td valign="top"><p><select id="mb_skinname" name="mb_skinname">
111
+ <option value="" <?php selected($skinname,''); ?>><?php _e("skin active by default", 'flash-album-gallery'); ?></option>
112
  <?php
113
  foreach ( (array)$i_skins as $skin_file => $skin_data) {
114
  echo '<option value="'.dirname($skin_file).'" '.selected($skinname,dirname($skin_file),false).'>'.$skin_data['Name'].'</option>'."\n";
119
  </td>
120
  </tr>
121
  <tr>
122
+ <td nowrap="nowrap" valign="top"><div style="padding-top: 3px;"><?php _e("Back Button Text", 'flash-album-gallery'); ?>: &nbsp; </div></td>
123
+ <td valign="top"><input id="mb_button" name="mb_button" type="text" style="width: 49%;" placeholder="<?php _e('Go Back', 'flash-album-gallery'); ?>" value="<?php echo $button_text; ?>" /></td>
 
124
  </tr>
125
  <tr>
126
+ <td nowrap="nowrap" valign="top"><div style="padding-top: 3px;"><?php _e("Back Button Link", 'flash-album-gallery'); ?>: &nbsp; </div></td>
127
  <td valign="top"><input id="mb_button_link" name="mb_button_link" type="text" style="width: 49%;" placeholder="<?php echo home_url(); ?>" value="<?php echo $button_link; ?>" /><br />
128
+ <small><?php _e("Leave empty to use referer link", 'flash-album-gallery'); ?></small></td>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
129
  </tr>
130
  <tr>
131
+ <td nowrap="nowrap" valign="top"><div style="padding-top: 3px;"><?php _e("Background Image Link", 'flash-album-gallery'); ?>: &nbsp; </div></td>
132
+ <td valign="top">
133
+ <input id="mb_bg_link" name="mb_bg_link" type="text" style="width: 49%;" value="<?php echo $bg_link; ?>" />
134
+ <a class="thickbox" href="media-upload.php?type=image&amp;TB_iframe=1&amp;width=640&amp;height=400" title="<?php _e('Add an Image', 'flash-album-gallery'); ?>"><?php _e('assist', 'flash-album-gallery'); ?></a>
135
+ </td>
136
  </tr>
137
  <tr>
138
+ <td nowrap="nowrap" valign="top"><div style="padding-top: 3px;"><?php _e("Background Position", 'flash-album-gallery'); ?>:</div></td>
139
  <td valign="top"><select id="mb_bg_pos" name="mb_bg_pos">
140
  <option value="center center" <?php selected($bg_pos,'center center'); ?>>center center</option>
141
  <option value="left top" <?php selected($bg_pos,'left top'); ?>>left top</option>
149
  </select></td>
150
  </tr>
151
  <tr>
152
+ <td nowrap="nowrap" valign="top"><div style="padding-top: 3px;"><?php _e("Background Repeat", 'flash-album-gallery'); ?>:</div></td>
153
  <td valign="top"><select id="mb_bg_repeat" name="mb_bg_repeat">
154
  <option value="repeat" <?php selected($bg_repeat,'repeat'); ?>>repeat</option>
155
  <option value="repeat-x" <?php selected($bg_repeat,'repeat-x'); ?>>repeat-x</option>
157
  <option value="no-repeat" <?php selected($bg_repeat,'no-repeat'); ?>>no-repeat</option>
158
  </select></td>
159
  </tr>
160
+ <tr>
161
+ <td nowrap="nowrap" valign="top"><div style="padding-top: 3px;"><?php _e("Background Size", 'flash-album-gallery'); ?>:</div></td>
162
+ <td valign="top"><select id="mb_bg_size" name="mb_bg_size">
163
+ <option value="auto" <?php selected($bg_size,'auto'); ?>>auto</option>
164
+ <option value="contain" <?php selected($bg_size,'contain'); ?>>contain</option>
165
+ <option value="cover" <?php selected($bg_size,'cover'); ?>>cover</option>
166
+ </select></td>
167
+ </tr>
168
  </table>
169
  </form>
170
  </div>
admin/music-box.php CHANGED
@@ -96,7 +96,7 @@ function flag_music_controler(){
96
  if(isset($_POST['updateMedia'])){
97
  check_admin_referer('flag_update');
98
  flagGallery::flagSaveWpMedia();
99
- flagGallery::show_message(__('Media updated', 'flag'));
100
  }
101
  default:
102
  flag_created_playlists();
@@ -116,15 +116,15 @@ function flag_created_playlists(){
116
 
117
  ?>
118
  <div class="flag-wrap">
119
- <h2><?php _e('Created playlists', 'flag'); ?></h2>
120
  <table class="widefat flag-table" cellspacing="0">
121
  <thead>
122
  <tr>
123
- <th scope="col" width="25%"><?php _e('Title', 'flag'); ?></th>
124
- <th scope="col" width="55%"><?php _e('Description', 'flag'); ?></th>
125
- <th scope="col"><?php _e('Quantity', 'flag'); ?></th>
126
- <th scope="col"><?php _e('Shortcode', 'flag'); ?></th>
127
- <th scope="col"><?php _e('Action', 'flag'); ?></th>
128
  </tr>
129
  </thead>
130
  <tbody>
@@ -145,18 +145,18 @@ function flag_created_playlists(){
145
  </a>
146
  </td>
147
  <td><?php echo esc_html($playlist_data['description']);
148
- echo '&nbsp;(' . __("player", "flag") . ': <strong>' . esc_html($playlist_data['skin']) . '</strong>)' ?></td>
149
  <td><?php echo count($query_m); ?></td>
150
  <td style="white-space: nowrap;"><input type="text" class="shortcode1" style="width: 200px; font-size: 9px;" readonly="readonly" onfocus="this.select()" value="[grandmusic playlist=<?php echo $playlist_name; ?>]"/></td>
151
  <td>
152
- <a href="<?php echo wp_nonce_url($filepath . '&playlist=' . $playlist_name . "&mode=delete", 'flag_delete'); ?>" class="delete" onclick="javascript:check=confirm( '<?php _e("Delete this playlist?", 'flag') ?>');if(check==false) {return false;
153
- }"><?php _e('Delete', 'flag'); ?></a>
154
  </td>
155
  </tr>
156
  <?php
157
  }
158
  } else{
159
- echo '<tr><td colspan="5" align="center"><strong>' . __('No playlists found', 'flag') . '</strong></td></tr>';
160
  }
161
  ?>
162
  </tbody>
@@ -264,7 +264,7 @@ function flag_music_wp_media_lib($added = false){
264
  // this function check for a the number of selected images, sumbmit false when no one selected
265
  function checkSelected(){
266
  if(!jQuery('#items_array').val()){
267
- alert('<?php echo esc_js(__("No items selected", "flag")); ?>');
268
  return false;
269
  }
270
  var actionId = jQuery('#bulkaction').val();
@@ -318,29 +318,29 @@ function flag_music_wp_media_lib($added = false){
318
 
319
  <!-- import folder -->
320
  <div id="importfolder">
321
- <h2><?php _e('Import mp3 from folder', 'flag'); ?></h2>
322
 
323
  <form name="importfolder" id="importfolder_form" method="POST" action="<?php echo $filepath; ?>" accept-charset="utf-8">
324
  <?php wp_nonce_field('flag_addmp3'); ?>
325
  <table class="form-table">
326
  <tr valign="top">
327
- <th scope="row"><?php _e('Import from Server path:', 'flag'); ?></th>
328
- <td><input type="text" size="35" id="mp3folder" name="mp3folder" value="<?php echo $defaultpath; ?>"/><span class="browsefiles button" style="display:none"><?php _e('Browse...', "flag"); ?></span>
329
 
330
  <div id="file_browser"></div>
331
  <br/>
332
  <p><label><input type="checkbox" name="delete_files" value="delete"/> &nbsp;
333
- <?php _e('delete files after import in WordPress Media Library', 'flag'); ?></label></p>
334
  </td>
335
  </tr>
336
  </table>
337
- <div class="submit"><input class="button-primary" type="submit" name="importfolder" value="<?php _e('Import folder', 'flag'); ?>"/></div>
338
  </form>
339
  </div>
340
  <?php } ?>
341
  <?php } ?>
342
 
343
- <h2><?php _e('WordPress Music Library', 'flag'); ?></h2>
344
  <?php
345
  // look for pagination
346
  if(!isset($_GET['paged']) || $_GET['paged'] < 1){
@@ -350,14 +350,14 @@ function flag_music_wp_media_lib($added = false){
350
  $_GET['paged'] = intval($_GET['paged']);
351
  $objects_per_page = 25;
352
  $start = ($_GET['paged'] - 1) * $objects_per_page;
353
- $img_total_count = $wpdb->get_var("SELECT COUNT(ID) FROM $wpdb->posts WHERE `post_mime_type` = 'audio/mpeg' AND `post_type` = 'attachment' AND `post_status` = 'inherit'");
354
  $musiclist = get_posts($args = array(
355
  'numberposts' => $objects_per_page,
356
  'offset' => $start,
357
  'orderby' => 'ID',
358
  'order' => 'DESC',
359
  'post_type' => 'attachment',
360
- 'post_mime_type' => 'audio/mpeg'
361
  ));
362
 
363
  // build pagination
@@ -373,8 +373,8 @@ function flag_music_wp_media_lib($added = false){
373
  ?>
374
  <div class="tablenav" style="overflow: hidden; height: auto;">
375
  <?php if($added === false){ ?>
376
- <div class="alignleft"><b><?php _e('Selected Media', 'flag'); ?>: </b><input style="width:500px;" type="text" readonly="readonly" id="items_array" name="items_array" value="<?php echo $items_array_default; ?>"/>
377
- <span class="clear_selected button"><?php _e('Clear Selected', 'flag'); ?></span></div>
378
  <?php } ?>
379
  <div class="tablenav-pages"><?php $page_links_text = sprintf('<span class="displaying-num">' . __('Displaying %s&#8211;%s of %s') . '</span>%s', number_format_i18n(($_GET['paged'] - 1) * $objects_per_page + 1), number_format_i18n(min($_GET['paged'] * $objects_per_page, $img_total_count)), number_format_i18n($img_total_count), $page_links);
380
  echo $page_links_text; ?></div>
@@ -387,16 +387,16 @@ function flag_music_wp_media_lib($added = false){
387
 
388
  <div class="actions">
389
  <?php if($added === false){ ?>
390
- <input name="updateMedia" class="button-primary" style="float: right;" type="submit" value="<?php _e('Update Media', 'flag'); ?>"/>
391
  <?php if(function_exists('json_encode')){ ?>
392
  <select name="bulkaction" id="bulkaction">
393
- <option value="no_action"><?php _e("No action", 'flag'); ?></option>
394
- <option value="new_playlist"><?php _e("Create new playlist", 'flag'); ?></option>
395
  </select>
396
- <input name="showThickbox" class="button-secondary" type="submit" value="<?php _e('Apply', 'flag'); ?>" onclick="if ( !checkSelected() ) {return false;
397
  }"/>
398
  <?php } ?>
399
- <a href="<?php echo admin_url('media-new.php'); ?>" class="button"><?php _e('Upload Music', 'flag'); ?></a>
400
  <input type="hidden" id="items_array" name="items_array" value=""/>
401
  <?php } else{ ?>
402
  <input type="hidden" name="mode" value="save"/>
@@ -405,7 +405,7 @@ function flag_music_wp_media_lib($added = false){
405
  <input type="hidden" name="skinname" value="<?php echo sanitize_flagname($playlist['skin']); ?>"/>
406
  <input type="hidden" name="skinaction" value="<?php echo sanitize_flagname($playlist['skin']); ?>"/>
407
  <textarea style="display: none;" name="playlist_descr" cols="40" rows="1"><?php echo esc_html($playlist['description']); ?></textarea>
408
- <input name="addToPlaylist" class="button-secondary" type="submit" value="<?php _e('Update Playlist', 'flag'); ?>"/>
409
  <?php } ?>
410
  </div>
411
 
@@ -413,32 +413,32 @@ function flag_music_wp_media_lib($added = false){
413
  <table class="widefat flag-table" cellspacing="0">
414
  <thead>
415
  <tr>
416
- <th class="cb" width="54" scope="col"><a href="#" onclick="checkAll(document.getElementById('musiclib'));return false;"><?php _e('Check', 'flag'); ?></a></th>
417
  <th class="id" width="134" scope="col">
418
- <div><?php _e('ID', 'flag'); ?></div>
419
  </th>
420
  <th class="size" width="75" scope="col">
421
- <div><?php _e('Size', 'flag'); ?></div>
422
  </th>
423
  <th class="thumb" width="110" scope="col">
424
- <div><?php _e('Thumbnail', 'flag'); ?></div>
425
  </th>
426
  <th class="title_filename" scope="col">
427
- <div><?php _e('Filename / Title', 'flag'); ?></div>
428
  </th>
429
  <th class="description" scope="col">
430
- <div><?php _e('Description', 'flag'); ?></div>
431
  </th>
432
  </tr>
433
  </thead>
434
  <tfoot>
435
  <tr>
436
- <th class="cb" scope="col"><a href="#" onclick="checkAll(document.getElementById('musiclib'));return false;"><?php _e('Check', 'flag'); ?></a></th>
437
- <th class="id" scope="col"><?php _e('ID', 'flag'); ?></th>
438
- <th class="size" scope="col"><?php _e('Size', 'flag'); ?></th>
439
- <th class="thumb" scope="col"><?php _e('Thumbnail', 'flag'); ?></th>
440
- <th class="title_filename" scope="col"><?php _e('Filename / Title', 'flag'); ?></th>
441
- <th class="description" scope="col"><?php _e('Description', 'flag'); ?></th>
442
  </tr>
443
  </tfoot>
444
  <?php
@@ -454,7 +454,7 @@ function flag_music_wp_media_lib($added = false){
454
  $ex = $checked = '';
455
  if(($added !== false || !empty($items_array_default)) && in_array($mp3->ID, $exclude)){
456
  $class .= ' already-added';
457
- $ex = ' title="' . __("Already Added", "flag") . '"';
458
  $checked = ' checked="checked"';
459
  }
460
  $thumb = $mp3thumb = get_post_meta($mp3->ID, 'thumbnail', true);
@@ -474,7 +474,7 @@ function flag_music_wp_media_lib($added = false){
474
  if($size){
475
  echo round($size / 1024 / 1024, 2) . ' Mb';
476
  } else{
477
- _e("Can't read file size. Perhaps file is broken.", 'flag');
478
  }
479
  ?></td>
480
  <td class="thumb" rowspan="2">
@@ -483,8 +483,8 @@ function flag_music_wp_media_lib($added = false){
483
  <td class="title_filename" rowspan="2">
484
  <strong><a href="<?php echo $url; ?>"><?php echo basename($url); ?></a></strong><br/>
485
  <textarea title="Title" name="item_a[<?php echo $mp3->ID; ?>][post_title]" cols="20" rows="1" style="width:95%; height: 25px; overflow:hidden;"><?php echo esc_html(stripslashes($mp3->post_title)); ?></textarea><br/>
486
- <p><?php _e('Thumb URL:', 'flag'); ?> <input id="mp3thumb-<?php echo $mp3->ID; ?>" name="item_a[<?php echo $mp3->ID; ?>][post_thumb]" type="text" value="<?php echo esc_url($mp3thumb); ?>"/>
487
- <a class="thickbox" onclick="actInp=<?php echo $mp3->ID; ?>" href="media-upload.php?type=image&amp;TB_iframe=1&amp;width=640&amp;height=400" title="<?php _e('Add an Image', 'flag'); ?>"><?php _e('assist', 'flag'); ?></a>
488
  </p>
489
  </td>
490
  <td class="description" rowspan="2">
@@ -493,13 +493,7 @@ function flag_music_wp_media_lib($added = false){
493
  </tr>
494
  <tr class="mp3-<?php echo $mp3->ID; ?>">
495
  <td valign="top" class="player" colspan="3">
496
- <script type="text/javascript">swfobject.embedSWF("<?php echo FLAG_URLPATH; ?>lib/mini.swf", "c-<?php echo $mp3->ID; ?>", "250", "20", "10.1.52", "expressInstall.swf", {
497
- path: "<?php echo str_replace(array('.mp3'), array(''), $url); ?>",
498
- bgcolor: "<?php echo $flag_options['mpBG'] ?>",
499
- color1: "<?php echo $flag_options['mpColor1'] ?>",
500
- color2: "<?php echo $flag_options['mpColor2'] ?>"
501
- }, {wmode: "transparent"}, {id: "f-<?php echo $mp3->ID; ?>", name: "f-<?php echo $mp3->ID; ?>"});</script>
502
- <div class="play" style="padding-left: 4px;"><span id="c-<?php echo $mp3->ID; ?>"></span></div>
503
  <p style="padding: 7px 3px;">Shortcode:&nbsp;<input type="text" class="shortcode1" readonly="readonly" style="width: 180px; font-size: 9px;" onfocus="this.select()" value="[grandmp3 id=<?php echo $mp3->ID; ?> autoplay=<?php echo $flag_options['mpAutoplay']; ?>]"/>
504
  </p></td>
505
  </tr>
@@ -507,7 +501,7 @@ function flag_music_wp_media_lib($added = false){
507
  <?php
508
  }
509
  } else{
510
- echo '<tr><td colspan="6" align="center"><strong>' . __('No music in WordPress Media Library.', 'flag') . '</strong></td></tr>';
511
  }
512
  ?>
513
  </table>
@@ -524,10 +518,10 @@ function flag_music_wp_media_lib($added = false){
524
  <input type="hidden" name="page" value="music-box"/>
525
  <table width="100%" border="0" cellspacing="3" cellpadding="3">
526
  <tr valign="top">
527
- <th align="left" style="padding-top: 5px;"><?php _e('Playlist Title', 'flag'); ?></th>
528
  <td><input type="text" class="alignleft" name="playlist_title" value=""/>
529
 
530
- <div class="alignright"><strong><?php _e("Choose skin", 'flag'); ?>:</strong>
531
  <select id="skinname" name="skinname" style="width: 200px; height: 24px; font-size: 11px;">
532
  <?php require_once(dirname(__FILE__) . '/get_skin.php');
533
  $all_skins = get_skins($skin_folder = '', $type = 'm');
@@ -536,7 +530,7 @@ function flag_music_wp_media_lib($added = false){
536
  echo '<option value="' . dirname($skin_file) . '">' . $skin_data['Name'] . '</option>' . "\n";
537
  }
538
  } else{
539
- echo '<option value="music_default">' . __("No Skins", "flag") . '</option>';
540
  }
541
  ?>
542
  </select>
@@ -544,14 +538,14 @@ function flag_music_wp_media_lib($added = false){
544
  </td>
545
  </tr>
546
  <tr valign="top">
547
- <th align="left" style="padding-top: 5px;"><?php _e('Playlist Description', 'flag'); ?></th>
548
  <td><textarea style="width:100%;" rows="3" cols="60" name="playlist_descr"></textarea></td>
549
  </tr>
550
  <tr>
551
  <td>&nbsp;</td>
552
- <td align="right"><input class="button-secondary" type="reset" value="&nbsp;<?php _e('Cancel', 'flag'); ?>&nbsp;" onclick="tb_remove()"/>
553
  &nbsp; &nbsp; &nbsp;
554
- <input class="button-primary " type="submit" name="TB_NewPlaylist" value="<?php _e('OK', 'flag'); ?>"/>
555
  </td>
556
  </tr>
557
  </table>
96
  if(isset($_POST['updateMedia'])){
97
  check_admin_referer('flag_update');
98
  flagGallery::flagSaveWpMedia();
99
+ flagGallery::show_message(__('Media updated', 'flash-album-gallery'));
100
  }
101
  default:
102
  flag_created_playlists();
116
 
117
  ?>
118
  <div class="flag-wrap">
119
+ <h2><?php _e('Created playlists', 'flash-album-gallery'); ?></h2>
120
  <table class="widefat flag-table" cellspacing="0">
121
  <thead>
122
  <tr>
123
+ <th scope="col" width="25%"><?php _e('Title', 'flash-album-gallery'); ?></th>
124
+ <th scope="col" width="55%"><?php _e('Description', 'flash-album-gallery'); ?></th>
125
+ <th scope="col"><?php _e('Quantity', 'flash-album-gallery'); ?></th>
126
+ <th scope="col"><?php _e('Shortcode', 'flash-album-gallery'); ?></th>
127
+ <th scope="col"><?php _e('Action', 'flash-album-gallery'); ?></th>
128
  </tr>
129
  </thead>
130
  <tbody>
145
  </a>
146
  </td>
147
  <td><?php echo esc_html($playlist_data['description']);
148
+ echo '&nbsp;(' . __("player", "flash-album-gallery") . ': <strong>' . esc_html($playlist_data['skin']) . '</strong>)' ?></td>
149
  <td><?php echo count($query_m); ?></td>
150
  <td style="white-space: nowrap;"><input type="text" class="shortcode1" style="width: 200px; font-size: 9px;" readonly="readonly" onfocus="this.select()" value="[grandmusic playlist=<?php echo $playlist_name; ?>]"/></td>
151
  <td>
152
+ <a href="<?php echo wp_nonce_url($filepath . '&playlist=' . $playlist_name . "&mode=delete", 'flag_delete'); ?>" class="delete" onclick="javascript:check=confirm( '<?php _e("Delete this playlist?", 'flash-album-gallery') ?>');if(check==false) {return false;
153
+ }"><?php _e('Delete', 'flash-album-gallery'); ?></a>
154
  </td>
155
  </tr>
156
  <?php
157
  }
158
  } else{
159
+ echo '<tr><td colspan="5" align="center"><strong>' . __('No playlists found', 'flash-album-gallery') . '</strong></td></tr>';
160
  }
161
  ?>
162
  </tbody>
264
  // this function check for a the number of selected images, sumbmit false when no one selected
265
  function checkSelected(){
266
  if(!jQuery('#items_array').val()){
267
+ alert('<?php echo esc_js(__("No items selected", "flash-album-gallery")); ?>');
268
  return false;
269
  }
270
  var actionId = jQuery('#bulkaction').val();
318
 
319
  <!-- import folder -->
320
  <div id="importfolder">
321
+ <h2><?php _e('Import mp3 from folder', 'flash-album-gallery'); ?></h2>
322
 
323
  <form name="importfolder" id="importfolder_form" method="POST" action="<?php echo $filepath; ?>" accept-charset="utf-8">
324
  <?php wp_nonce_field('flag_addmp3'); ?>
325
  <table class="form-table">
326
  <tr valign="top">
327
+ <th scope="row"><?php _e('Import from Server path:', 'flash-album-gallery'); ?></th>
328
+ <td><input type="text" size="35" id="mp3folder" name="mp3folder" value="<?php echo $defaultpath; ?>"/><span class="browsefiles button" style="display:none"><?php _e('Browse...', "flash-album-gallery"); ?></span>
329
 
330
  <div id="file_browser"></div>
331
  <br/>
332
  <p><label><input type="checkbox" name="delete_files" value="delete"/> &nbsp;
333
+ <?php _e('delete files after import in WordPress Media Library', 'flash-album-gallery'); ?></label></p>
334
  </td>
335
  </tr>
336
  </table>
337
+ <div class="submit"><input class="button-primary" type="submit" name="importfolder" value="<?php _e('Import folder', 'flash-album-gallery'); ?>"/></div>
338
  </form>
339
  </div>
340
  <?php } ?>
341
  <?php } ?>
342
 
343
+ <h2><?php _e('WordPress Music Library', 'flash-album-gallery'); ?></h2>
344
  <?php
345
  // look for pagination
346
  if(!isset($_GET['paged']) || $_GET['paged'] < 1){
350
  $_GET['paged'] = intval($_GET['paged']);
351
  $objects_per_page = 25;
352
  $start = ($_GET['paged'] - 1) * $objects_per_page;
353
+ $img_total_count = $wpdb->get_var("SELECT COUNT(ID) FROM $wpdb->posts WHERE `post_mime_type` LIKE 'audio/%' AND `post_type` = 'attachment' AND `post_status` = 'inherit'");
354
  $musiclist = get_posts($args = array(
355
  'numberposts' => $objects_per_page,
356
  'offset' => $start,
357
  'orderby' => 'ID',
358
  'order' => 'DESC',
359
  'post_type' => 'attachment',
360
+ 'post_mime_type' => 'audio/*'
361
  ));
362
 
363
  // build pagination
373
  ?>
374
  <div class="tablenav" style="overflow: hidden; height: auto;">
375
  <?php if($added === false){ ?>
376
+ <div class="alignleft"><b><?php _e('Selected Media', 'flash-album-gallery'); ?>: </b><input style="width:500px;" type="text" readonly="readonly" id="items_array" name="items_array" value="<?php echo $items_array_default; ?>"/>
377
+ <span class="clear_selected button"><?php _e('Clear Selected', 'flash-album-gallery'); ?></span></div>
378
  <?php } ?>
379
  <div class="tablenav-pages"><?php $page_links_text = sprintf('<span class="displaying-num">' . __('Displaying %s&#8211;%s of %s') . '</span>%s', number_format_i18n(($_GET['paged'] - 1) * $objects_per_page + 1), number_format_i18n(min($_GET['paged'] * $objects_per_page, $img_total_count)), number_format_i18n($img_total_count), $page_links);
380
  echo $page_links_text; ?></div>
387
 
388
  <div class="actions">
389
  <?php if($added === false){ ?>
390
+ <input name="updateMedia" class="button-primary" style="float: right;" type="submit" value="<?php _e('Update Media', 'flash-album-gallery'); ?>"/>
391
  <?php if(function_exists('json_encode')){ ?>
392
  <select name="bulkaction" id="bulkaction">
393
+ <option value="no_action"><?php _e("No action", 'flash-album-gallery'); ?></option>
394
+ <option value="new_playlist"><?php _e("Create new playlist", 'flash-album-gallery'); ?></option>
395
  </select>
396
+ <input name="showThickbox" class="button-secondary" type="submit" value="<?php _e('Apply', 'flash-album-gallery'); ?>" onclick="if ( !checkSelected() ) {return false;
397
  }"/>
398
  <?php } ?>
399
+ <a href="<?php echo admin_url('media-new.php'); ?>" class="button" style="display: inline-block; margin: 0;"><?php _e('Upload Music', 'flash-album-gallery'); ?></a>
400
  <input type="hidden" id="items_array" name="items_array" value=""/>
401
  <?php } else{ ?>
402
  <input type="hidden" name="mode" value="save"/>
405
  <input type="hidden" name="skinname" value="<?php echo sanitize_flagname($playlist['skin']); ?>"/>
406
  <input type="hidden" name="skinaction" value="<?php echo sanitize_flagname($playlist['skin']); ?>"/>
407
  <textarea style="display: none;" name="playlist_descr" cols="40" rows="1"><?php echo esc_html($playlist['description']); ?></textarea>
408
+ <input name="addToPlaylist" class="button-secondary" type="submit" value="<?php _e('Update Playlist', 'flash-album-gallery'); ?>"/>
409
  <?php } ?>
410
  </div>
411
 
413
  <table class="widefat flag-table" cellspacing="0">
414
  <thead>
415
  <tr>
416
+ <th class="cb" width="54" scope="col"><a href="#" onclick="checkAll(document.getElementById('musiclib'));return false;"><?php _e('Check', 'flash-album-gallery'); ?></a></th>
417
  <th class="id" width="134" scope="col">
418
+ <div><?php _e('ID', 'flash-album-gallery'); ?></div>
419
  </th>
420
  <th class="size" width="75" scope="col">
421
+ <div><?php _e('Size', 'flash-album-gallery'); ?></div>
422
  </th>
423
  <th class="thumb" width="110" scope="col">
424
+ <div><?php _e('Thumbnail', 'flash-album-gallery'); ?></div>
425
  </th>
426
  <th class="title_filename" scope="col">
427
+ <div><?php _e('Filename / Title', 'flash-album-gallery'); ?></div>
428
  </th>
429
  <th class="description" scope="col">
430
+ <div><?php _e('Description', 'flash-album-gallery'); ?></div>
431
  </th>
432
  </tr>
433
  </thead>
434
  <tfoot>
435
  <tr>
436
+ <th class="cb" scope="col"><a href="#" onclick="checkAll(document.getElementById('musiclib'));return false;"><?php _e('Check', 'flash-album-gallery'); ?></a></th>
437
+ <th class="id" scope="col"><?php _e('ID', 'flash-album-gallery'); ?></th>
438
+ <th class="size" scope="col"><?php _e('Size', 'flash-album-gallery'); ?></th>
439
+ <th class="thumb" scope="col"><?php _e('Thumbnail', 'flash-album-gallery'); ?></th>
440
+ <th class="title_filename" scope="col"><?php _e('Filename / Title', 'flash-album-gallery'); ?></th>
441
+ <th class="description" scope="col"><?php _e('Description', 'flash-album-gallery'); ?></th>
442
  </tr>
443
  </tfoot>
444
  <?php
454
  $ex = $checked = '';
455
  if(($added !== false || !empty($items_array_default)) && in_array($mp3->ID, $exclude)){
456
  $class .= ' already-added';
457
+ $ex = ' title="' . __("Already Added", "flash-album-gallery") . '"';
458
  $checked = ' checked="checked"';
459
  }
460
  $thumb = $mp3thumb = get_post_meta($mp3->ID, 'thumbnail', true);
474
  if($size){
475
  echo round($size / 1024 / 1024, 2) . ' Mb';
476
  } else{
477
+ _e("Can't read file size. Perhaps file is broken.", 'flash-album-gallery');
478
  }
479
  ?></td>
480
  <td class="thumb" rowspan="2">
483
  <td class="title_filename" rowspan="2">
484
  <strong><a href="<?php echo $url; ?>"><?php echo basename($url); ?></a></strong><br/>
485
  <textarea title="Title" name="item_a[<?php echo $mp3->ID; ?>][post_title]" cols="20" rows="1" style="width:95%; height: 25px; overflow:hidden;"><?php echo esc_html(stripslashes($mp3->post_title)); ?></textarea><br/>
486
+ <p><?php _e('Thumb URL:', 'flash-album-gallery'); ?> <input id="mp3thumb-<?php echo $mp3->ID; ?>" name="item_a[<?php echo $mp3->ID; ?>][post_thumb]" type="text" value="<?php echo esc_url($mp3thumb); ?>"/>
487
+ <a class="thickbox" onclick="actInp=<?php echo $mp3->ID; ?>" href="media-upload.php?type=image&amp;TB_iframe=1&amp;width=640&amp;height=400" title="<?php _e('Add an Image', 'flash-album-gallery'); ?>"><?php _e('assist', 'flash-album-gallery'); ?></a>
488
  </p>
489
  </td>
490
  <td class="description" rowspan="2">
493
  </tr>
494
  <tr class="mp3-<?php echo $mp3->ID; ?>">
495
  <td valign="top" class="player" colspan="3">
496
+ <audio src="<?php echo esc_url($url); ?>" controls preload="none" autobuffer="false"></audio>
 
 
 
 
 
 
497
  <p style="padding: 7px 3px;">Shortcode:&nbsp;<input type="text" class="shortcode1" readonly="readonly" style="width: 180px; font-size: 9px;" onfocus="this.select()" value="[grandmp3 id=<?php echo $mp3->ID; ?> autoplay=<?php echo $flag_options['mpAutoplay']; ?>]"/>
498
  </p></td>
499
  </tr>
501
  <?php
502
  }
503
  } else{
504
+ echo '<tr><td colspan="6" align="center"><strong>' . __('No music in WordPress Media Library.', 'flash-album-gallery') . '</strong></td></tr>';
505
  }
506
  ?>
507
  </table>
518
  <input type="hidden" name="page" value="music-box"/>
519
  <table width="100%" border="0" cellspacing="3" cellpadding="3">
520
  <tr valign="top">
521
+ <th align="left" style="padding-top: 5px;"><?php _e('Playlist Title', 'flash-album-gallery'); ?></th>
522
  <td><input type="text" class="alignleft" name="playlist_title" value=""/>
523
 
524
+ <div class="alignright"><strong><?php _e("Choose skin", 'flash-album-gallery'); ?>:</strong>
525
  <select id="skinname" name="skinname" style="width: 200px; height: 24px; font-size: 11px;">
526
  <?php require_once(dirname(__FILE__) . '/get_skin.php');
527
  $all_skins = get_skins($skin_folder = '', $type = 'm');
530
  echo '<option value="' . dirname($skin_file) . '">' . $skin_data['Name'] . '</option>' . "\n";
531
  }
532
  } else{
533
+ echo '<option value="music_default">' . __("No Skins", "flash-album-gallery") . '</option>';
534
  }
535
  ?>
536
  </select>
538
  </td>
539
  </tr>
540
  <tr valign="top">
541
+ <th align="left" style="padding-top: 5px;"><?php _e('Playlist Description', 'flash-album-gallery'); ?></th>
542
  <td><textarea style="width:100%;" rows="3" cols="60" name="playlist_descr"></textarea></td>
543
  </tr>
544
  <tr>
545
  <td>&nbsp;</td>
546
+ <td align="right"><input class="button-secondary" type="reset" value="&nbsp;<?php _e('Cancel', 'flash-album-gallery'); ?>&nbsp;" onclick="tb_remove()"/>
547
  &nbsp; &nbsp; &nbsp;
548
+ <input class="button-primary " type="submit" name="TB_NewPlaylist" value="<?php _e('OK', 'flash-album-gallery'); ?>"/>
549
  </td>
550
  </tr>
551
  </table>
admin/overview.php CHANGED
@@ -11,7 +11,7 @@ function flag_admin_overview() {
11
  echo get_option('flag_plugin_error');
12
  ?>
13
  <div class="flag-wrap">
14
- <h2 class="overview-title"><?php _e('Grand Flagallery Overview', 'flag'); echo ' v'.FLAGVERSION; ?></h2>
15
  <div id="flag-overview" class="metabox-holder">
16
  <div id="post-body" class="has-sidebar">
17
  <div class="has-sidebar-content">
@@ -90,7 +90,7 @@ function flag_overview_graphic_lib() {
90
  }
91
 
92
  /**
93
- * Show the Setup Box and some info for Flash Album Gallery
94
  *
95
  * @return void
96
  */
@@ -108,18 +108,7 @@ function flag_overview_setup(){
108
  $flag->define_constant();
109
  $flag->load_options();
110
 
111
- flagGallery::show_message(__('Reset all settings to default parameter','flag'));
112
- }
113
-
114
- if (isset($_POST['uninstall'])) {
115
-
116
- check_admin_referer('flag_uninstall');
117
-
118
- include_once ( dirname (__FILE__). '/flag_install.php');
119
-
120
- flag_uninstall();
121
-
122
- flagGallery::show_message(__('Uninstall sucessful ! Now delete the plugin and enjoy your life ! Good luck !','flag'));
123
  }
124
  ?>
125
  <div class="submitbox" id="submitpost">
@@ -127,22 +116,22 @@ function flag_overview_setup(){
127
  <div id="misc-publishing-actions">
128
  <div class="misc-pub-section">
129
  <span id="plugin-home" class="icon">
130
- <strong><a href="http://codeasily.com/wordpress-plugins/flag/" style="text-decoration: none;"><?php _e('Plugin Home','flag'); ?></a></strong>
131
  </span>
132
  </div>
133
  <div class="misc-pub-section">
134
  <span id="plugin-comments" class="icon">
135
- <a href="http://codeasily.com/community/forum/flagallery-wordpress-plugin/" style="text-decoration: none;"><?php _e('Plugin Forum','flag'); ?></a>
136
  </span>
137
  </div>
138
  <div class="misc-pub-section">
139
  <span id="rate-plugin" class="icon">
140
- <a href="http://wordpress.org/extend/plugins/flash-album-gallery/" style="text-decoration: none;"><?php _e('Rate Plugin','flag'); ?></a>
141
  </span>
142
  </div>
143
  <div class="misc-pub-section curtime misc-pub-section-last">
144
  <span id="contact-me" class="icon">
145
- <a href="http://codeasily.com/support/contact/" style="text-decoration: none;"><?php _e('Contact Me','flag'); ?></a>
146
  </span>
147
  </div>
148
  </div>
@@ -153,10 +142,10 @@ function flag_overview_setup(){
153
  <form id="resetsettings" name="resetsettings" method="post">
154
  <?php wp_nonce_field('flag_uninstall'); ?>
155
  <div id="save-action" class="alignleft">
156
- <input class="button" id="save-post" type="submit" name="resetdefault" value="<?php _e('Reset settings', 'flag'); ?>" onclick="javascript:check=confirm('<?php _e('Reset all options to default settings ?\n\nChoose [Cancel] to Stop, [OK] to proceed.\n','flag'); ?>');if(check==false) return false;" />
157
  </div>
158
  <div id="preview-action" class="alignright">
159
- <input type="submit" name="uninstall" class="button delete" value="<?php _e('Uninstall plugin', 'flag'); ?>" onclick="javascript:check=confirm('<?php _e('You are about to Uninstall this plugin from WordPress.\nThis action is not reversible.\n\nChoose [Cancel] to Stop, [OK] to Uninstall.\n','flag'); ?>');if(check==false) return false;" />
160
  </div>
161
  <br class="clear" />
162
  </form>
@@ -178,15 +167,15 @@ function flag_overview_right_now() {
178
  ?>
179
 
180
  <div class="table table_content">
181
- <strong><?php _e('At a Glance', 'flag'); ?>:</strong>
182
  <table>
183
  <tr class="first">
184
- <td class="t"><?php echo _n( 'Image', 'Images', $images, 'flag' ); ?></td>
185
  <td>:</td>
186
  <td class="b"><a href="admin.php?page=flag-manage-gallery&tabs=1"><?php echo $images; ?></a></td>
187
  </tr>
188
  <tr>
189
- <td class="t"><?php echo _n( 'Gallery', 'Galleries', $galleries, 'flag' ); ?></td>
190
  <td>:</td>
191
  <td class="b"><a href="admin.php?page=flag-manage-gallery&tabs=0"><?php echo $galleries; ?></a></td>
192
  </tr>
@@ -195,23 +184,47 @@ function flag_overview_right_now() {
195
  <div class="versions">
196
  <?php if(current_user_can('FlAG Upload images')): ?>
197
  <p>
198
- <?php _e('Here you can control your images and galleries', 'flag'); ?>
199
  &nbsp;
200
- <a class="button rbutton" href="admin.php?page=flag-manage-gallery&tabs=1"><strong><?php _e('Upload pictures', 'flag'); ?></strong></a>
201
  </p>
202
  <?php endif; ?>
203
  <span><?php
204
- $userlevel = '<span class="b">' . (current_user_can('manage_options') ? __('Gallery Administrator', 'flag') : __('Gallery Editor', 'flag')) . '</span>';
205
- printf(__('You currently have %s rights.', 'flag'), $userlevel);
206
  ?></span>
207
  </div>
208
- <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
209
  }
210
 
211
- add_meta_box('flag_dashboard_right_now', __('Welcome to FlAGallery !', 'flag'), 'flag_overview_right_now', 'flag-overview', 'normal', 'default');
212
- add_meta_box('flag_server', __('Server Settings', 'flag'), 'flag_overview_server', 'flag-overview', 'normal', 'default');
213
- add_meta_box('flag_gd_lib', __('Graphic Library', 'flag'), 'flag_overview_graphic_lib', 'flag-overview', 'normal', 'default');
214
- add_meta_box('dashboard_primary', __('Setup Box', 'flag'), 'flag_overview_setup', 'flag-overview', 'side', 'core');
215
 
216
  /**
217
  * Show GD Library version information
@@ -231,7 +244,7 @@ function flag_GD_info() {
231
  }
232
  }
233
  else {
234
- echo '<h4>'.__('No GD support', 'flag').'!</h4>';
235
  }
236
  }
237
 
@@ -243,9 +256,9 @@ function flag_GD_info() {
243
  */
244
  function flag_GD_Support($bool){
245
  if($bool)
246
- return __('Yes', 'flag');
247
  else
248
- return __('No', 'flag');
249
  }
250
 
251
  /**
@@ -261,57 +274,65 @@ function get_serverinfo() {
261
  // GET SQL Mode
262
  $mysqlinfo = $wpdb->get_results("SHOW VARIABLES LIKE 'sql_mode'");
263
  if (is_array($mysqlinfo)) $sql_mode = $mysqlinfo[0]->Value;
264
- if (empty($sql_mode)) $sql_mode = __('Not set', 'flag');
265
  // Get PHP Safe Mode
266
- if(ini_get('safe_mode')) $safe_mode = __('On', 'flag');
267
- else $safe_mode = __('Off', 'flag');
 
 
 
 
 
 
268
  // Get PHP allow_url_fopen
269
- if(ini_get('allow_url_fopen')) $allow_url_fopen = __('On', 'flag');
270
- else $allow_url_fopen = __('Off', 'flag');
271
  // Get PHP Max Upload Size
272
  if(ini_get('upload_max_filesize')) $upload_max = ini_get('upload_max_filesize');
273
- else $upload_max = __('N/A', 'flag');
274
  // Get PHP Output buffer Size
275
  if(ini_get('output_buffering')) $output_buffer = ini_get('output_buffering');
276
- else $output_buffer = __('N/A', 'flag');
277
  // Get PHP Max Post Size
278
  if(ini_get('post_max_size')) $post_max = ini_get('post_max_size');
279
- else $post_max = __('N/A', 'flag');
280
  // Get PHP Max execution time
281
  if(ini_get('max_execution_time')) $max_execute = ini_get('max_execution_time');
282
- else $max_execute = __('N/A', 'flag');
283
  // Get PHP Memory Limit
284
  if(ini_get('memory_limit')) $memory_limit = ini_get('memory_limit');
285
- else $memory_limit = __('N/A', 'flag');
286
  // Get actual memory_get_usage
287
- if (function_exists('memory_get_usage')) $memory_usage = round(memory_get_usage() / 1024 / 1024, 2) . __(' MByte', 'flag');
288
- else $memory_usage = __('N/A', 'flag');
289
  // required for EXIF read
290
- if (is_callable('exif_read_data')) $exif = __('Yes', 'flag'). " ( V" . substr(phpversion('exif'),0,4) . ")" ;
291
- else $exif = __('No', 'flag');
292
  // required for meta data
293
- if (is_callable('iptcparse')) $iptc = __('Yes', 'flag');
294
- else $iptc = __('No', 'flag');
295
  // required for meta data
296
- if (is_callable('xml_parser_create')) $xml = __('Yes', 'flag');
297
- else $xml = __('No', 'flag');
298
  ?>
299
- <li><?php _e('Operating System', 'flag'); ?> : <span><?php echo PHP_OS; ?>&nbsp;(<?php echo (PHP_INT_SIZE * 8); ?>&nbsp;Bit)</span></li>
300
- <li><?php _e('Server', 'flag'); ?> : <span><?php echo $_SERVER["SERVER_SOFTWARE"]; ?></span></li>
301
- <li><?php _e('Memory usage', 'flag'); ?> : <span><?php echo $memory_usage; ?></span></li>
302
- <li><?php _e('MYSQL Version', 'flag'); ?> : <span><?php echo $sqlversion; ?></span></li>
303
- <li><?php _e('SQL Mode', 'flag'); ?> : <span><?php echo $sql_mode; ?></span></li>
304
- <li><?php _e('PHP Version', 'flag'); ?> : <span><?php echo PHP_VERSION; ?></span></li>
305
- <li><?php _e('PHP Safe Mode', 'flag'); ?> : <span><?php echo $safe_mode; ?></span></li>
306
- <li><?php _e('PHP Allow URL fopen', 'flag'); ?> : <span><?php echo $allow_url_fopen; ?></span></li>
307
- <li><?php _e('PHP Memory Limit', 'flag'); ?> : <span><?php echo $memory_limit; ?></span></li>
308
- <li><?php _e('PHP Max Upload Size', 'flag'); ?> : <span><?php echo $upload_max; ?></span></li>
309
- <li><?php _e('PHP Max Post Size', 'flag'); ?> : <span><?php echo $post_max; ?></span></li>
310
- <li><?php _e('PHP Output Buffer Size', 'flag'); ?> : <span><?php echo $output_buffer; ?></span></li>
311
- <li><?php _e('PHP Max Script Execute Time', 'flag'); ?> : <span><?php echo $max_execute; ?>s</span></li>
312
- <li><?php _e('PHP Exif support', 'flag'); ?> : <span><?php echo $exif; ?></span></li>
313
- <li><?php _e('PHP IPTC support', 'flag'); ?> : <span><?php echo $iptc; ?></span></li>
314
- <li><?php _e('PHP XML support', 'flag'); ?> : <span><?php echo $xml; ?></span></li>
 
 
315
  <?php
316
  }
317
 
@@ -324,7 +345,7 @@ function get_serverinfo() {
324
  class flag_SpaceManager {
325
 
326
  function getQuota() {
327
- if (function_exists(get_space_allowed))
328
  $quota = get_space_allowed();
329
  else
330
  $quota = get_site_option( "blog_upload_space" );
@@ -369,16 +390,16 @@ class flag_SpaceManager {
369
  $percentremain = 100 - $percentused;
370
 
371
  $out = '';
372
- $out .= '<div id="spaceused"> <h3>'.__('Storage Space','flag').'</h3>';
373
 
374
  if ($settings['used']['display']) {
375
- $out .= __('Upload Space Used:','flag') . "\n";
376
  $out .= flag_SpaceManager::buildGraph($settings['used'], $used,$quota,$percentused);
377
  $out .= "<br />";
378
  }
379
 
380
  if($settings['remain']['display']) {
381
- $out .= __('Upload Space Remaining:','flag') . "\n";
382
  $out .= flag_SpaceManager::buildGraph($settings['remain'], $remaining,$quota,$percentremain);
383
 
384
  }
11
  echo get_option('flag_plugin_error');
12
  ?>
13
  <div class="flag-wrap">
14
+ <h2 class="overview-title"><?php _e('Grand Flagallery Overview', 'flash-album-gallery'); echo ' v'.FLAGVERSION; ?></h2>
15
  <div id="flag-overview" class="metabox-holder">
16
  <div id="post-body" class="has-sidebar">
17
  <div class="has-sidebar-content">
90
  }
91
 
92
  /**
93
+ * Show the Setup Box and some info for FlaGallery
94
  *
95
  * @return void
96
  */
108