Gallery – Flagallery Photo Portfolio - Version 2.11

Version Description

  • After plugin update go to Skins page and update skins with 'Update skins' button.
  • If you use Facebook template and copied it in the root directory, then after each plugin update click 'Copy facebook.php file to root directory'.
  • If GRAND FlAGallery displays an error message after upgrade, go to FlAGallery Overview page and press 'Reset settings'.
  • Have some troubles with plugin? Try first reseting settings, deactivate and reactivate plugin.
Download this release

Release Info

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

Version 2.11

Files changed (177) hide show
  1. admin/addgallery.php +301 -0
  2. admin/admin.php +301 -0
  3. admin/ajax.php +266 -0
  4. admin/banner-box.php +460 -0
  5. admin/banner-sort.php +120 -0
  6. admin/banner.functions.php +179 -0
  7. admin/css/flagSorter.css +76 -0
  8. admin/css/flagadmin.css +260 -0
  9. admin/css/flagallery.css +8 -0
  10. admin/css/flagallery_nocrawler.css +12 -0
  11. admin/css/flagallery_noflash.css +19 -0
  12. admin/css/tabs.css +126 -0
  13. admin/db_skin_color_scheme.php +122 -0
  14. admin/facebook-tool.php +272 -0
  15. admin/flag_install.php +330 -0
  16. admin/flv_preview.php +19 -0
  17. admin/functions.php +1316 -0
  18. admin/get_skin.php +140 -0
  19. admin/grab_meta.php +38 -0
  20. admin/images/asc.gif +0 -0
  21. admin/images/browser.png +0 -0
  22. admin/images/desc.gif +0 -0
  23. admin/images/fail.png +0 -0
  24. admin/images/flag.png +0 -0
  25. admin/images/hits.png +0 -0
  26. admin/images/loadingAnimation.gif +0 -0
  27. admin/images/lock.png +0 -0
  28. admin/images/mail.png +0 -0
  29. admin/images/map.png +0 -0
  30. admin/images/menu-bits.gif +0 -0
  31. admin/images/notes.png +0 -0
  32. admin/images/reset.png +0 -0
  33. admin/images/sortbg.gif +0 -0
  34. admin/images/wallpaper.png +0 -0
  35. admin/jgallery.php +110 -0
  36. admin/js/Jcrop/css/Jcrop.gif +0 -0
  37. admin/js/Jcrop/css/jquery.Jcrop.css +37 -0
  38. admin/js/Jcrop/js/jquery.Jcrop.js +255 -0
  39. admin/js/disablescroll.js +55 -0
  40. admin/js/farbtastic-nosharp.js +345 -0
  41. admin/js/flag.ajax.js +116 -0
  42. admin/js/flag.progressbar.js +80 -0
  43. admin/js/flagscroll.js +33 -0
  44. admin/js/images/arrows.png +0 -0
  45. admin/js/images/blank.gif +0 -0
  46. admin/js/images/bullets.png +0 -0
  47. admin/js/images/fancy_close.png +0 -0
  48. admin/js/images/fancy_loading.png +0 -0
  49. admin/js/images/fancy_nav_left.png +0 -0
  50. admin/js/images/fancy_nav_right.png +0 -0
  51. admin/js/images/fancy_nav_slide.png +0 -0
  52. admin/js/images/fancy_shadow_e.png +0 -0
  53. admin/js/images/fancy_shadow_n.png +0 -0
  54. admin/js/images/fancy_shadow_ne.png +0 -0
  55. admin/js/images/fancy_shadow_nw.png +0 -0
  56. admin/js/images/fancy_shadow_s.png +0 -0
  57. admin/js/images/fancy_shadow_se.png +0 -0
  58. admin/js/images/fancy_shadow_sw.png +0 -0
  59. admin/js/images/fancy_shadow_w.png +0 -0
  60. admin/js/images/fancy_title_left.png +0 -0
  61. admin/js/images/fancy_title_main.png +0 -0
  62. admin/js/images/fancy_title_over.png +0 -0
  63. admin/js/images/fancy_title_right.png +0 -0
  64. admin/js/images/fancybox-x.png +0 -0
  65. admin/js/images/fancybox-y.png +0 -0
  66. admin/js/images/fancybox.png +0 -0
  67. admin/js/images/loading.gif +0 -0
  68. admin/js/jquery.MultiFile.js +535 -0
  69. admin/js/jquery.MultiFile.pack.js +11 -0
  70. admin/js/jquery.dataset.js +167 -0
  71. admin/js/jquery.easing-1.3.pack.js +72 -0
  72. admin/js/jquery.fancybox-1.3.4.css +91 -0
  73. admin/js/jquery.fancybox-1.3.4.pack.js +46 -0
  74. admin/js/jquery.js +18 -0
  75. admin/js/jquery.nivo.slider.pack.js +10 -0
  76. admin/js/jquery.tablednd_0_5.js +382 -0
  77. admin/js/jquery.tablesorter.js +852 -0
  78. admin/js/jqueryFileTree/images/application.png +0 -0
  79. admin/js/jqueryFileTree/images/directory.png +0 -0
  80. admin/js/jqueryFileTree/images/film.png +0 -0
  81. admin/js/jqueryFileTree/images/flash.png +0 -0
  82. admin/js/jqueryFileTree/images/folder_open.png +0 -0
  83. admin/js/jqueryFileTree/images/music.png +0 -0
  84. admin/js/jqueryFileTree/images/pdf.png +0 -0
  85. admin/js/jqueryFileTree/images/picture.png +0 -0
  86. admin/js/jqueryFileTree/images/spinner.gif +0 -0
  87. admin/js/jqueryFileTree/images/zip.png +0 -0
  88. admin/js/jqueryFileTree/jqueryFileTree.css +81 -0
  89. admin/js/jqueryFileTree/jqueryFileTree.js +98 -0
  90. admin/js/loader.swf +0 -0
  91. admin/js/nivo-slider.css +120 -0
  92. admin/js/photoswipe/MIT-license.txt +21 -0
  93. admin/js/photoswipe/code.photoswipe.jquery-3.0.5.min.js +164 -0
  94. admin/js/photoswipe/images/error.gif +0 -0
  95. admin/js/photoswipe/images/icons.png +0 -0
  96. admin/js/photoswipe/images/icons@2x.png +0 -0
  97. admin/js/photoswipe/images/loader.gif +0 -0
  98. admin/js/photoswipe/klass.min.js +8 -0
  99. admin/js/photoswipe/photoswipe.css +196 -0
  100. admin/js/script.js +278 -0
  101. admin/js/swfaddress-optimizer.js +1 -0
  102. admin/js/swfaddress.js +1 -0
  103. admin/js/swfmousewheel.js +51 -0
  104. admin/js/swfobject.js +31 -0
  105. admin/js/swfupload.handler.js +153 -0
  106. admin/js/swfupload.js +986 -0
  107. admin/js/swfupload.swf +0 -0
  108. admin/js/tabcontent.js +159 -0
  109. admin/js/tabs.js +159 -0
  110. admin/js/themes/bar/arrows.png +0 -0
  111. admin/js/themes/bar/bullets.png +0 -0
  112. admin/js/themes/bar/loading.gif +0 -0
  113. admin/js/themes/bar/styles.css +132 -0
  114. admin/js/themes/dark/arrows.png +0 -0
  115. admin/js/themes/dark/bullets.png +0 -0
  116. admin/js/themes/dark/loading.gif +0 -0
  117. admin/js/themes/dark/styles.css +102 -0
  118. admin/js/themes/default/arrows.png +0 -0
  119. admin/js/themes/default/bullets.png +0 -0
  120. admin/js/themes/default/loading.gif +0 -0
  121. admin/js/themes/default/styles.css +101 -0
  122. admin/js/themes/light/arrows.png +0 -0
  123. admin/js/themes/light/bullets.png +0 -0
  124. admin/js/themes/light/loading.gif +0 -0
  125. admin/js/themes/light/styles.css +102 -0
  126. admin/js/widgets_admin.js +20 -0
  127. admin/manage-banner.php +254 -0
  128. admin/manage-galleries.php +367 -0
  129. admin/manage-images.php +609 -0
  130. admin/manage-playlist.php +265 -0
  131. admin/manage-sort.php +153 -0
  132. admin/manage-video.php +260 -0
  133. admin/manage.php +422 -0
  134. admin/manage_thumbnail.php +174 -0
  135. admin/media-upload.php +234 -0
  136. admin/meta_box.php +167 -0
  137. admin/music-box.php +443 -0
  138. admin/news.php +13 -0
  139. admin/overview.php +468 -0
  140. admin/playlist-sort.php +118 -0
  141. admin/playlist.functions.php +149 -0
  142. admin/settings.php +460 -0
  143. admin/showmeta.php +123 -0
  144. admin/skin_install.php +143 -0
  145. admin/skin_options.php +83 -0
  146. admin/skins.php +484 -0
  147. admin/tinymce/editor_plugin.js +78 -0
  148. admin/tinymce/flag.gif +0 -0
  149. admin/tinymce/img/butt2.png +0 -0
  150. admin/tinymce/img/button_bg.png +0 -0
  151. admin/tinymce/img/down_arrow.gif +0 -0
  152. admin/tinymce/img/fade-butt.png +0 -0
  153. admin/tinymce/img/separator.gif +0 -0
  154. admin/tinymce/img/tabs.gif +0 -0
  155. admin/tinymce/langs/de.js +6 -0
  156. admin/tinymce/langs/de_de.js +6 -0
  157. admin/tinymce/langs/en.js +6 -0
  158. admin/tinymce/langs/en_US.js +6 -0
  159. admin/tinymce/popup.css +210 -0
  160. admin/tinymce/tinymce.php +133 -0
  161. admin/tinymce/window.php +296 -0
  162. admin/tuning.php +55 -0
  163. admin/upgrade.php +198 -0
  164. admin/upload.php +48 -0
  165. admin/video-box.php +440 -0
  166. admin/video-sort.php +120 -0
  167. admin/video.functions.php +149 -0
  168. admin/wpmu.php +70 -0
  169. changelog.txt +430 -0
  170. facebook.php +101 -0
  171. flag-config.php +32 -0
  172. flag.php +461 -0
  173. flagshow.php +38 -0
  174. full_window_template.php +36 -0
  175. index.php +3 -0
  176. lang/flag-az_AZ.mo +0 -0
  177. lang/flag-az_AZ.po +1286 -0
admin/addgallery.php ADDED
@@ -0,0 +1,301 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You are not allowed to call this page directly.'); }
3
+
4
+ // sometimes a error feedback is better than a white screen
5
+ @ini_set('error_reporting', E_ALL ^ E_NOTICE);
6
+
7
+ function flag_admin_add_gallery() {
8
+
9
+ global $wpdb, $flagdb, $flag;
10
+
11
+ // same as $_SERVER['REQUEST_URI'], but should work under IIS 6.0
12
+ $filepath = admin_url() . 'admin.php?page=' . $_GET['page'];
13
+
14
+ // check for the max image size
15
+ $maxsize = flagGallery::check_memory_limit();
16
+
17
+ // link for the flash file
18
+ $swf_upload_link = FLAG_URLPATH . 'admin/upload.php';
19
+ $swf_upload_link = wp_nonce_url($swf_upload_link, 'flag_swfupload');
20
+ //flash doesn't seem to like encoded ampersands, so convert them back here
21
+ $swf_upload_link = str_replace('&#038;', '&', $swf_upload_link);
22
+
23
+ $defaultpath = $flag->options['galleryPath'];
24
+
25
+ if ($_POST['addgallery']){
26
+ check_admin_referer('flag_addgallery');
27
+ $newgallery = attribute_escape( $_POST['galleryname']);
28
+ if ( !empty($newgallery) )
29
+ flagAdmin::create_gallery($newgallery, $defaultpath);
30
+ }
31
+ if ($_POST['uploadimage']){
32
+ check_admin_referer('flag_addgallery');
33
+ if ($_FILES['MF__F_0_0']['error'] == 0) {
34
+ $messagetext = flagAdmin::upload_images();
35
+ }
36
+ else
37
+ flagGallery::show_error( __('Upload failed!','flag') );
38
+ }
39
+ if ($_POST['importfolder']){
40
+ check_admin_referer('flag_addgallery');
41
+ $galleryfolder = $_POST['galleryfolder'];
42
+ if ( ( !empty($galleryfolder) ) AND ($defaultpath != $galleryfolder) )
43
+ flagAdmin::import_gallery($galleryfolder);
44
+ }
45
+
46
+
47
+ if (isset($_POST['swf_callback'])){
48
+ if ($_POST['galleryselect'] == "0" )
49
+ flagGallery::show_error(__('No gallery selected !','flag'));
50
+ else {
51
+ // get the path to the gallery
52
+ $galleryID = (int) $_POST['galleryselect'];
53
+ $gallerypath = $wpdb->get_var("SELECT path FROM $wpdb->flaggallery WHERE gid = '$galleryID' ");
54
+ flagAdmin::import_gallery($gallerypath);
55
+ }
56
+ }
57
+
58
+ if ( isset($_POST['disable_flash']) ){
59
+ check_admin_referer('flag_addgallery');
60
+ $flag->options['swfUpload'] = false;
61
+ update_option('flag_options', $flag->options);
62
+ }
63
+
64
+ if ( isset($_POST['enable_flash']) ){
65
+ check_admin_referer('flag_addgallery');
66
+ $flag->options['swfUpload'] = true;
67
+ update_option('flag_options', $flag->options);
68
+ }
69
+
70
+ //get all galleries (after we added new ones)
71
+ $gallerylist = $flagdb->find_all_galleries('gid', 'DESC');
72
+
73
+ ?>
74
+
75
+ <?php if( !IS_WPMU || current_user_can('FlAG Import folder') ) { ?>
76
+ <link rel="stylesheet" type="text/css" href="<?php echo FLAG_URLPATH; ?>admin/js/jqueryFileTree/jqueryFileTree.css" />
77
+ <script type="text/javascript" src="<?php echo FLAG_URLPATH; ?>admin/js/jqueryFileTree/jqueryFileTree.js"></script>
78
+ <script type="text/javascript">
79
+ /* <![CDATA[ */
80
+ jQuery(function() {
81
+ jQuery("span.browsefiles").show().click(function(){
82
+ jQuery("#file_browser").fileTree({
83
+ script: "admin-ajax.php?action=flag_file_browser&nonce=<?php echo wp_create_nonce( 'flag-ajax' ) ;?>",
84
+ root: jQuery("#galleryfolder").val(),
85
+ }, function(file) {
86
+ //var path = file.replace("<?php echo WINABSPATH; ?>", "");
87
+ jQuery("#galleryfolder").val(file);
88
+ });
89
+
90
+ jQuery("#file_browser").show("slide");
91
+ });
92
+ });
93
+ /* ]]> */
94
+ </script>
95
+ <?php }
96
+ if($flag->options['swfUpload']) { ?>
97
+ <!-- SWFUpload script -->
98
+ <script type="text/javascript">
99
+ /* <![CDATA[ */
100
+ var flag_swf_upload;
101
+
102
+ window.onload = function () {
103
+ flag_swf_upload = new SWFUpload({
104
+ // Backend settings
105
+ upload_url : "<?php echo $swf_upload_link; ?>",
106
+ flash_url : "<?php echo FLAG_URLPATH; ?>admin/js/swfupload.swf",
107
+
108
+ // Button Settings
109
+ button_placeholder_id : "spanButtonPlaceholder",
110
+ button_width: 300,
111
+ button_height: 27,
112
+ button_window_mode: SWFUpload.WINDOW_MODE.TRANSPARENT,
113
+ button_cursor: SWFUpload.CURSOR.HAND,
114
+
115
+ // File Upload Settings
116
+ file_size_limit : "<?php echo wp_max_upload_size(); ?>b",
117
+ file_types : "*.jpg;*.gif;*.png",
118
+ file_types_description : "<?php _e('Image Files', 'flag'); ?>",
119
+
120
+ // Queue handler
121
+ file_queued_handler : fileQueued,
122
+
123
+ // Upload handler
124
+ upload_start_handler : uploadStart,
125
+ upload_progress_handler : uploadProgress,
126
+ upload_error_handler : uploadError,
127
+ upload_success_handler : uploadSuccess,
128
+ upload_complete_handler : uploadComplete,
129
+
130
+ post_params : {
131
+ "auth_cookie" : "<?php echo (is_ssl() ? $_COOKIE[SECURE_AUTH_COOKIE] : $_COOKIE[AUTH_COOKIE]); ?>",
132
+ "logged_in_cookie": "<?php echo $_COOKIE[LOGGED_IN_COOKIE]; ?>",
133
+ "_wpnonce" : "<?php echo wp_create_nonce('flag_swfupload'); ?>",
134
+ "galleryselect" : "0"
135
+ },
136
+
137
+ // i18names
138
+ custom_settings : {
139
+ "remove" : "<?php _e('remove', 'flag'); ?>",
140
+ "browse" : "<?php _e('Browse...', 'flag'); ?>",
141
+ "upload" : "<?php _e('Upload images', 'flag'); ?>"
142
+ },
143
+
144
+ // Debug settings
145
+ debug: false
146
+
147
+ });
148
+
149
+ // on load change the upload to swfupload
150
+ initSWFUpload();
151
+
152
+ };
153
+ /* ]]> */
154
+ </script>
155
+ <div class="wrap" id="progressbar-wrap" style="display:none;">
156
+ <div class="progressborder">
157
+ <div class="progressbar" id="progressbar">
158
+ <span>0%</span>
159
+ </div>
160
+ </div>
161
+ </div>
162
+ <?php } else { ?>
163
+ <!-- MultiFile script -->
164
+ <script type="text/javascript">
165
+ /* <![CDATA[ */
166
+ jQuery(document).ready(function(){
167
+ jQuery('#imagefiles').MultiFile({
168
+ STRING: {
169
+ remove:'<?php _e('remove', 'flag'); ?>'
170
+ }
171
+ });
172
+ });
173
+ /* ]]> */
174
+ </script>
175
+ <?php } ?>
176
+
177
+ <div id="slider" class="wrap">
178
+
179
+ <ul id="tabs" class="tabs">
180
+ <li class="selected"><a href="#" rel="addgallery"><?php _e('Add new gallery', 'flag'); ?></a></li>
181
+ <li><a href="#" rel="uploadimage"><?php _e('Upload Images', 'flag'); ?></a></li>
182
+ <?php if( !IS_WPMU || current_user_can('FlAG Import folder') ) { ?>
183
+ <li><a href="#" rel="importfolder"><?php _e('Import image folder', 'flag'); ?></a></li>
184
+ <?php } ?>
185
+ </ul>
186
+
187
+ <!-- create gallery -->
188
+ <div id="addgallery" class="cptab">
189
+ <h2><?php _e('Create a new gallery', 'flag'); ?></h2>
190
+ <form name="addgallery" id="addgallery_form" method="POST" action="<?php echo $filepath; ?>" accept-charset="utf-8" >
191
+ <?php wp_nonce_field('flag_addgallery'); ?>
192
+ <table class="form-table" style="width: auto;">
193
+ <tr>
194
+ <th scope="col" colspan="2" style="padding-bottom: 0;"><strong><?php _e('New Gallery', 'flag'); ?></strong></th>
195
+ </tr>
196
+ <tr valign="top">
197
+ <td><input type="text" size="65" name="galleryname" value="" /><br />
198
+ <?php if(!IS_WPMU) { ?>
199
+ <?php _e('Create a new , empty gallery below the folder', 'flag'); ?> <strong><?php echo $defaultpath; ?></strong><br />
200
+ <?php } ?>
201
+ <i>( <?php _e('Allowed characters for file and folder names are', 'flag'); ?>: a-z, A-Z, 0-9, -, _ )</i></td>
202
+ <?php do_action('flag_add_new_gallery_form'); ?>
203
+ <td><div class="submit" style="margin: 0; padding: 0;"><input class="button-primary" type="submit" name= "addgallery" value="<?php _e('Add gallery', 'flag'); ?>"/></div></td>
204
+ </tr>
205
+ </table>
206
+ <p>&nbsp;</p>
207
+ </form>
208
+ </div>
209
+ <!-- upload images -->
210
+ <div id="uploadimage" class="cptab">
211
+ <h2><?php _e('Upload images', 'flag'); ?></h2>
212
+ <script type="text/javascript">
213
+ /* <![CDATA[ */
214
+ jQuery(document).ready(function(){
215
+ if(jQuery("#galleryselect").val() == 0) {
216
+ jQuery("#choosegalfirst").animate({opacity: "0.5"}, 600);
217
+ jQuery("#choosegalfirst .disabledbut").show();
218
+ }
219
+ jQuery("#choosegalfirst .disabledbut").click(function () {
220
+ alert("Choose gallery, please.")
221
+ });
222
+ jQuery("#galleryselect").change(function () {
223
+ if(jQuery(this).val() == 0) {
224
+ jQuery("#choosegalfirst .disabledbut").show();
225
+ jQuery("#choosegalfirst").animate({opacity: "0.5"}, 600);
226
+ } else {
227
+ jQuery("#choosegalfirst .disabledbut").hide();
228
+ jQuery("#choosegalfirst").animate({opacity: "1"}, 600);
229
+ }
230
+ });
231
+ });
232
+ /* ]]> */
233
+ </script>
234
+ <form name="uploadimage" id="uploadimage_form" method="POST" enctype="multipart/form-data" action="<?php echo $filepath; ?>" accept-charset="utf-8" >
235
+ <?php wp_nonce_field('flag_addgallery'); ?>
236
+ <table class="form-table">
237
+ <tr valign="top">
238
+ <th scope="row"><strong><?php _e('Upload image(s):', 'flag'); ?></strong></th>
239
+ <td><span id='spanButtonPlaceholder'></span><input type="file" name="imagefiles[]" id="imagefiles" size="35" class="imagefiles"/></td>
240
+ </tr>
241
+ <tr valign="top">
242
+ <td colspan="2"><label for="galleryselect"><?php _e('in to', 'flag'); ?></label>
243
+ <select name="galleryselect" id="galleryselect">
244
+ <option value="0" ><?php _e('Choose gallery', 'flag'); ?></option>
245
+ <?php $ingallery = isset($_GET['gid']) ? (int) $_GET['gid'] : '';
246
+ foreach($gallerylist as $gallery) {
247
+ if ( !flagAdmin::can_manage_this_gallery($gallery->author) )
248
+ continue;
249
+ $name = ( empty($gallery->title) ) ? $gallery->name : $gallery->title;
250
+ $sel = ($ingallery == $gallery->gid) ? 'selected="selected" ' : '';
251
+ echo '<option ' . $sel . 'value="' . $gallery->gid . '" >' . $gallery->gid . ' - ' . $name . '</option>' . "\n";
252
+ } ?>
253
+ </select>
254
+ <?php echo $maxsize; ?>
255
+ <br /><?php if ((IS_WPMU) && flagGallery::flag_wpmu_enable_function('wpmuQuotaCheck')) display_space_usage(); ?>
256
+ </td>
257
+ </tr>
258
+ </table>
259
+ <div class="submit">
260
+ <span class="useflashupload">
261
+ <?php if ($flag->options['swfUpload']) { ?>
262
+ <input type="submit" name="disable_flash" id="disable_flash" title="<?php _e('The batch upload requires Adobe Flash 10, disable it if you have problems','flag'); ?>" value="<?php _e('Disable flash upload', 'flag'); ?>" />
263
+ <?php } else { ?>
264
+ <input type="submit" name="enable_flash" id="enable_flash" title="<?php _e('Upload multiple files at once by ctrl/shift-selecting in dialog','flag'); ?>" value="<?php _e('Enable flash based upload', 'flag'); ?>" />
265
+ <?php } ?>
266
+ </span>
267
+ <span id="choosegalfirst"><input class="button-primary" type="submit" name="uploadimage" id="uploadimage_btn" value="<?php _e('Upload images', 'flag'); ?>" /><span class="disabledbut" style="display: none;"></span></span>
268
+ <div class="clear"></div>
269
+ </div>
270
+ </form>
271
+ </div>
272
+ <?php if( !IS_WPMU || current_user_can('FlAG Import folder') ) { ?>
273
+ <!-- import folder -->
274
+ <div id="importfolder" class="cptab">
275
+ <h2><?php _e('Import image folder', 'flag'); ?></h2>
276
+ <form name="importfolder" id="importfolder_form" method="POST" action="<?php echo $filepath; ?>" accept-charset="utf-8" >
277
+ <?php wp_nonce_field('flag_addgallery'); ?>
278
+ <table class="form-table">
279
+ <tr valign="top">
280
+ <th scope="row"><?php _e('Import from Server path:', 'flag'); ?></th>
281
+ <td><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>
282
+ <div id="file_browser"></div>
283
+ <div><?php echo $maxsize; ?>
284
+ <?php if (SAFE_MODE) {?><br /><?php _e(' Please note : For safe-mode = ON you need to add the subfolder thumbs manually', 'flag'); ?><?php }; ?></div></td>
285
+ </tr>
286
+ </table>
287
+ <div class="submit"><input class="button-primary" type="submit" name="importfolder" value="<?php _e('Import folder', 'flag'); ?>"/></div>
288
+ </form>
289
+ </div>
290
+ <?php } ?>
291
+
292
+ <script type="text/javascript">
293
+ var cptabs=new ddtabcontent("tabs");
294
+ cptabs.setpersist(true);
295
+ cptabs.setselectedClassTarget("linkparent");
296
+ cptabs.init();
297
+ </script>
298
+ </div>
299
+ <?php
300
+ }
301
+ ?>
admin/admin.php ADDED
@@ -0,0 +1,301 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * flagAdminPanel - Admin Section for Flash Album Gallery
4
+ *
5
+ */
6
+ class flagAdminPanel{
7
+
8
+ // constructor
9
+ function flagAdminPanel() {
10
+
11
+ // Add the admin menu
12
+ add_action( 'admin_menu', array(&$this, 'add_menu') );
13
+ add_action('init', array(&$this, 'wp_flag_check_options'),2);
14
+
15
+ // Add the script and style files
16
+ add_action('admin_print_scripts', array(&$this, 'load_scripts') );
17
+ add_action('admin_print_styles', array(&$this, 'load_styles') );
18
+
19
+ add_filter('contextual_help', array(&$this, 'show_help'), 10, 2);
20
+ add_filter('screen_meta_screen', array(&$this, 'edit_screen_meta'));
21
+ }
22
+
23
+ function wp_flag_check_options() {
24
+ global $flag;
25
+ require_once(dirname (__FILE__) . '/flag_install.php' );
26
+ $default_options = flag_list_options();
27
+ $flag_db_options = get_option('flag_options');
28
+ if(function_exists('array_diff_key')) {
29
+ $flag_new_options = array_diff_key($default_options, $flag_db_options);
30
+ } else {
31
+ $flag_new_options = $this->PHP4_array_diff_key($default_options, $flag_db_options);
32
+ }
33
+ $flag_options = array_merge($flag_db_options, $flag_new_options);
34
+ update_option('flag_options', $flag_options);
35
+ }
36
+
37
+ function PHP4_array_diff_key() {
38
+ $arrs = func_get_args();
39
+ $result = array_shift($arrs);
40
+ foreach ($arrs as $array) {
41
+ foreach ($result as $key => $v) {
42
+ if (array_key_exists($key, $array)) {
43
+ unset($result[$key]);
44
+ }
45
+ }
46
+ }
47
+ return $result;
48
+ }
49
+
50
+ // integrate the menu
51
+ function add_menu() {
52
+
53
+ add_menu_page( __('GRAND Flash Album Gallery overview','flag'), __('FlAGallery'), 'FlAG overview', 'flag-overview', array (&$this, 'show_menu'), FLAG_URLPATH .'admin/images/flag.png' );
54
+ add_submenu_page( 'flag-overview' , __('GRAND Flash Album Gallery overview', 'flag'), __('Overview', 'flag'), 'FlAG overview', 'flag-overview', array (&$this, 'show_menu'));
55
+ add_submenu_page( 'flag-overview' , __('FlAG Manage gallery', 'flag'), __('Manage Galleries', 'flag'), 'FlAG Manage gallery', 'flag-manage-gallery', array (&$this, 'show_menu'));
56
+ add_submenu_page( 'flag-overview' , __('FlAG Music Box', 'flag'), __('Music Box', 'flag'), 'FlAG Manage music', 'flag-music-box', array (&$this, 'show_menu'));
57
+ add_submenu_page( 'flag-overview' , __('FlAG Video Box', 'flag'), __('Video Box', 'flag'), 'FlAG Manage video', 'flag-video-box', array (&$this, 'show_menu'));
58
+ add_submenu_page( 'flag-overview' , __('FlAG Banner Box', 'flag'), __('Banner Box', 'flag'), 'FlAG Manage banners', 'flag-banner-box', array (&$this, 'show_menu'));
59
+ add_submenu_page( 'flag-overview' , __('FlAG Manage skins', 'flag'), __('Skins', 'flag'), 'FlAG Change skin', 'flag-skins', array (&$this, 'show_menu'));
60
+ add_submenu_page( 'flag-overview' , __('FlAG Change options', 'flag'), __('Options', 'flag'), 'FlAG Change options', 'flag-options', array (&$this, 'show_menu'));
61
+ add_submenu_page( 'flag-overview' , __('FlAG Facebook Integration', 'flag'), __('Facebook', 'flag'), 'FlAG Facebook page', 'flag-facebook', array (&$this, 'show_menu'));
62
+ if ( flag_wpmu_site_admin() )
63
+ add_submenu_page( 'wpmu-admin.php' , __('GRAND Flash Album Gallery', 'flag'), __('GRAND FlAGallery', 'flag'), 'activate_plugins', 'flag-wpmu', array (&$this, 'show_menu'));
64
+
65
+ //register the column fields
66
+ $this->register_columns();
67
+
68
+ }
69
+
70
+ // load the script for the defined page and load only this code
71
+ function show_menu() {
72
+
73
+ global $flag;
74
+
75
+ // check for upgrade
76
+ /*if( get_option( 'flag_db_version' ) != FLAG_DBVERSION ) {
77
+ include_once ( dirname (__FILE__) . '/functions.php' );
78
+ include_once ( dirname (__FILE__) . '/upgrade.php' );
79
+ flag_upgrade_page();
80
+ return;
81
+ }*/
82
+
83
+ // Set installation date
84
+ if( empty($flag->options['installDate']) ) {
85
+ $flag->options['installDate'] = time();
86
+ update_option('flag_options', $flag->options);
87
+ }
88
+
89
+ switch ($_GET['page']){
90
+ case "flag-manage-gallery" :
91
+ include_once ( dirname (__FILE__) . '/functions.php' ); // admin functions
92
+ include_once ( dirname (__FILE__) . '/manage.php' ); // flag_admin_manage_gallery
93
+ // Initate the Manage Gallery page
94
+ $flag->manage_page = new flagManageGallery ();
95
+ // Render the output now, because you cannot access a object during the constructor is not finished
96
+ $flag->manage_page->controller();
97
+
98
+ break;
99
+ case "flag-music-box" :
100
+ include_once ( dirname (__FILE__) . '/music-box.php' ); // flag_music_box
101
+ flag_music_controler();
102
+ break;
103
+ case "flag-video-box" :
104
+ include_once ( dirname (__FILE__) . '/video-box.php' ); // flag_video_box
105
+ flag_video_controler();
106
+ break;
107
+ case "flag-banner-box" :
108
+ include_once ( dirname (__FILE__) . '/banner-box.php' ); // flag_banner_box
109
+ flag_banner_controler();
110
+ break;
111
+ case "flag-options" :
112
+ include_once ( dirname (__FILE__) . '/settings.php' ); // flag_admin_options
113
+ flag_admin_options();
114
+ break;
115
+ case "flag-skins" :
116
+ include_once ( dirname (__FILE__) . '/skins.php' ); // flag_manage_skins
117
+ break;
118
+ case "flag-facebook" :
119
+ include_once ( dirname(__FILE__) . '/facebook-tool.php' ); // flag_facebook
120
+ break;
121
+ case "flag-wpmu" :
122
+ include_once ( dirname (__FILE__) . '/wpmu.php' ); // flag_wpmu_admin
123
+ flag_wpmu_setup();
124
+ break;
125
+ default :
126
+ include_once ( dirname (__FILE__) . '/overview.php' ); // flag_admin_overview
127
+ flag_admin_overview();
128
+ break;
129
+ }
130
+ }
131
+
132
+ function load_scripts() {
133
+
134
+ wp_register_script('flag-ajax', FLAG_URLPATH .'admin/js/flag.ajax.js', array('jquery'), '1.4.0');
135
+ wp_localize_script('flag-ajax', 'flagAjaxSetup', array(
136
+ 'url' => admin_url('admin-ajax.php'),
137
+ 'action' => 'flag_ajax_operation',
138
+ 'operation' => '',
139
+ 'nonce' => wp_create_nonce( 'flag-ajax' ),
140
+ 'ids' => '',
141
+ 'permission' => __('You do not have the correct permission', 'flag'),
142
+ 'error' => __('Unexpected Error', 'flag'),
143
+ 'failure' => __('A failure occurred', 'flag')
144
+ ) );
145
+ wp_register_script('flag-progressbar', FLAG_URLPATH .'admin/js/flag.progressbar.js', array('jquery'), '1.0.0');
146
+ wp_register_script('swfupload_f10', FLAG_URLPATH .'admin/js/swfupload.js', array('jquery'), '2.2.0');
147
+
148
+ if (isset($_GET['page'])) {
149
+ switch ($_GET['page']) {
150
+ case 'flag-overview' :
151
+ wp_enqueue_script( 'postbox' );
152
+ case "flag-manage-gallery" :
153
+ print "<script type='text/javascript' src='".FLAG_URLPATH."admin/js/tabs.js'></script>\n";
154
+ wp_enqueue_script( 'jquery-ui-core' );
155
+ wp_enqueue_script( 'jquery-ui-draggable' );
156
+ wp_enqueue_script( 'jquery-ui-droppable' );
157
+ wp_enqueue_script( 'multifile', FLAG_URLPATH .'admin/js/jquery.MultiFile.js', array('jquery'), '1.4.6' );
158
+ wp_enqueue_script( 'flag-swfupload-handler', FLAG_URLPATH .'admin/js/swfupload.handler.js', array('swfupload_f10'), '2.2.0' );
159
+ wp_enqueue_script('dataset', FLAG_URLPATH .'admin/js/jquery.dataset.js', array('jquery'), '0.1.0');
160
+ wp_enqueue_script( 'postbox' );
161
+ wp_enqueue_script( 'flag-ajax' );
162
+ wp_enqueue_script( 'flag-progressbar' );
163
+ add_thickbox();
164
+ break;
165
+ case "flag-music-box" :
166
+ wp_enqueue_script( 'swfobject' );
167
+ wp_enqueue_script( 'thickbox' );
168
+ break;
169
+ case "flag-video-box" :
170
+ wp_enqueue_script( 'swfobject' );
171
+ wp_enqueue_script( 'thickbox' );
172
+ break;
173
+ case "flag-banner-box" :
174
+ wp_enqueue_script( 'thickbox' );
175
+ break;
176
+ case "flag-options" :
177
+ wp_enqueue_script('farbtastic-nosharp', FLAG_URLPATH.'admin/js/farbtastic-nosharp.js', array('jquery'), '1.2');
178
+ print "<script type='text/javascript' src='".FLAG_URLPATH."admin/js/tabs.js'></script>\n";
179
+ break;
180
+ case "flag-skins" :
181
+ wp_enqueue_script( 'thickbox' );
182
+ wp_enqueue_script('farbtastic-nosharp', FLAG_URLPATH.'admin/js/farbtastic-nosharp.js', array('jquery'), '1.2');
183
+ //wp_enqueue_script( 'farbtastic' );
184
+ print "<script type='text/javascript' src='".FLAG_URLPATH."admin/js/tabs.js'></script>\n";
185
+ break;
186
+ }
187
+ }
188
+ }
189
+
190
+ function load_styles() {
191
+
192
+ if (isset($_GET['page'])) {
193
+ switch ($_GET['page']) {
194
+ case 'flag-overview' :
195
+ wp_enqueue_style( 'flagadmin', FLAG_URLPATH .'admin/css/flagadmin.css', false, '2.8.1', 'screen' );
196
+ wp_admin_css( 'css/dashboard' );
197
+ break;
198
+ case "flag-options" :
199
+ wp_enqueue_style( 'farbtastic' );
200
+ case "flag-manage-gallery" :
201
+ wp_enqueue_style( 'flagtabs', FLAG_URLPATH .'admin/css/tabs.css', false, '1.0.0', 'screen' );
202
+ case "flag-music-box" :
203
+ case "flag-video-box" :
204
+ case "flag-banner-box" :
205
+ wp_enqueue_style( 'thickbox' );
206
+ wp_enqueue_style( 'flagadmin', FLAG_URLPATH .'admin/css/flagadmin.css', false, '2.8.1', 'screen' );
207
+ break;
208
+ case "flag-skins" :
209
+ wp_enqueue_style( 'thickbox' );
210
+ wp_enqueue_style( 'farbtastic' );
211
+ wp_enqueue_style( 'flagtabs', FLAG_URLPATH .'admin/css/tabs.css', false, '1.0.0', 'screen' );
212
+ wp_enqueue_style( 'flagadmin', FLAG_URLPATH .'admin/css/flagadmin.css', false, '2.8.1', 'screen' );
213
+ wp_admin_css( 'css/dashboard' );
214
+ break;
215
+ }
216
+ }
217
+ }
218
+
219
+ function show_help($help, $screen) {
220
+
221
+ $link ='';
222
+ // menu title is localized...
223
+ $i18n = strtolower ( _n( 'Gallery', 'Galleries', 1, 'flag' ) );
224
+
225
+ switch ($screen) {
226
+ case 'toplevel_page_' . 'flag-overview' :
227
+ case "{$i18n}_page_flag-manage-gallery" :
228
+ case "flag-manage-gallery":
229
+ case "flag-manage-images":
230
+ case "{$i18n}_page_flag-skins" :
231
+ case "{$i18n}_page_flag-options" :
232
+ $link = '<a href="http://codeasily.com/wordpress-plugins/flag" target="_blank">CodEasily.com</a>';
233
+ break;
234
+ }
235
+
236
+ if ( !empty($link) ) {
237
+ $help = '<h5>' . __('Get help with GRAND FlAGallery', 'flag') . '</h5>';
238
+ $help .= '<div class="metabox-prefs">';
239
+ $help .= $link;
240
+ $help .= "</div>\n";
241
+ $help .= '<h5>' . __('More Help & Info', 'flag') . '</h5>';
242
+ $help .= '<div class="metabox-prefs">';
243
+ $help .= '<a href="http://codeasily.com/wordpress-plugins/flash-album-gallery/grand-flash-album-gallery-wordpress-plugin-video-tutorial" target="_blank">' . __('GRAND FlAGallery Video Tutorial', 'flag') . '</a>';
244
+ $help .= ' | <a href="http://codeasily.com/wordpress-plugins/flash-album-gallery/faq" target="_blank">' . __('FAQ', 'flag') . '</a>';
245
+ $help .= ' | <a href="http://codeasily.com/wordpress-plugins/flash-album-gallery/flag-review" target="_blank">' . __('GRAND FlAGallery Review', 'flag') . '</a>';
246
+ $help .= ' | <a href="http://codeasily.com/wordpress-plugins/flash-album-gallery/languages" target="_blank">' . __('Get your language pack', 'flag') . '</a>';
247
+ $help .= ' | <a href="http://photogallerycreator.com/2009/07/skins-for-flash-album-gallery" target="_blank">' . __('Skins for GRAND FlAGallery', 'flag') . '</a>';
248
+ $help .= "</div>\n";
249
+ }
250
+
251
+ return $help;
252
+ }
253
+
254
+ function edit_screen_meta($screen) {
255
+
256
+ // menu title is localized, so we need to change the toplevel name
257
+ $i18n = strtolower ( _n( 'Gallery', 'Galleries', 1, 'flag' ) );
258
+
259
+ switch ($screen) {
260
+ case "{$i18n}_page_flag-manage-gallery" :
261
+ // we would like to have screen option only at the manage images / gallery page
262
+ if ( isset ($_POST['sortGallery']) )
263
+ $screen = $screen;
264
+ else if ( ($_GET['mode'] == 'edit') || isset ($_POST['backToGallery']) )
265
+ $screen = 'flag-manage-images';
266
+ else if ( ($_GET['mode'] == 'sort') )
267
+ $screen = $screen;
268
+ else
269
+ $screen = 'flag-manage-gallery';
270
+ break;
271
+ }
272
+
273
+ return $screen;
274
+ }
275
+
276
+ function register_column_headers($screen, $columns) {
277
+ global $_wp_column_headers;
278
+
279
+ if ( !isset($_wp_column_headers) )
280
+ $_wp_column_headers = array();
281
+
282
+ $_wp_column_headers[$screen] = $columns;
283
+ }
284
+
285
+ function register_columns() {
286
+ include_once ( dirname (__FILE__) . '/manage-images.php' );
287
+ $this->register_column_headers('flag-manage-images', flag_manage_gallery_columns() );
288
+ }
289
+
290
+ }
291
+
292
+ function flag_wpmu_site_admin() {
293
+ // Check for site admin
294
+ if ( function_exists('is_site_admin') )
295
+ if ( is_site_admin() )
296
+ return true;
297
+
298
+ return false;
299
+ }
300
+
301
+ ?>
admin/ajax.php ADDED
@@ -0,0 +1,266 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ add_action('wp_ajax_flag_ajax_operation', 'flag_ajax_operation' );
4
+
5
+ function flag_ajax_operation() {
6
+ global $wpdb;
7
+ // if nonce is not correct it returns -1
8
+ check_ajax_referer( "flag-ajax" );
9
+ // check for correct capability
10
+ if ( !is_user_logged_in() )
11
+ die('-1');
12
+ // check for correct FlAG capability
13
+ if ( !current_user_can('FlAG Upload images') || !current_user_can('FlAG Manage gallery') )
14
+ die('-1');
15
+ // include the flag function
16
+ include_once (dirname (__FILE__). '/functions.php');
17
+ // Get the image id
18
+ if ( isset($_POST['image'])) {
19
+ $id = (int) $_POST['image'];
20
+ // let's get the image data
21
+ $picture = flagdb::find_image($id);
22
+ // what do you want to do ?
23
+ switch ( $_POST['operation'] ) {
24
+ case 'create_thumbnail' :
25
+ $result = flagAdmin::create_thumbnail($picture);
26
+ break;
27
+ case 'resize_image' :
28
+ $result = flagAdmin::resize_image($picture);
29
+ break;
30
+ case 'import_metadata' :
31
+ $result = flagAdmin::import_MetaData( $id );
32
+ break;
33
+ case 'copy_metadata' :
34
+ $result = flagAdmin::copy_MetaData( $id );
35
+ break;
36
+ case 'get_image_ids' :
37
+ $result = flagAdmin::get_image_ids( $id );
38
+ break;
39
+ default :
40
+ do_action( 'flag_ajax_' . $_POST['operation'] );
41
+ die('-1');
42
+ break;
43
+ }
44
+ // A success should return a '1'
45
+ die ($result);
46
+ }
47
+ // The script should never stop here
48
+ die('0');
49
+ }
50
+
51
+ add_action('wp_ajax_flagCreateNewThumb', 'flagCreateNewThumb');
52
+
53
+ function flagCreateNewThumb() {
54
+
55
+ global $wpdb;
56
+
57
+ // check for correct capability
58
+ if ( !is_user_logged_in() )
59
+ die('-1');
60
+ // check for correct FlAG capability
61
+ if ( !current_user_can('FlAG Manage gallery') )
62
+ die('-1');
63
+
64
+ require_once( dirname( dirname(__FILE__) ) . '/flag-config.php');
65
+ include_once( flagGallery::graphic_library() );
66
+
67
+ $flag_options=get_option('flag_options');
68
+
69
+ $id = (int) $_POST['id'];
70
+ $picture = flagdb::find_image($id);
71
+
72
+ $x = round( $_POST['x'] * $_POST['rr'], 0);
73
+ $y = round( $_POST['y'] * $_POST['rr'], 0);
74
+ $w = round( $_POST['w'] * $_POST['rr'], 0);
75
+ $h = round( $_POST['h'] * $_POST['rr'], 0);
76
+
77
+ $thumb = new flag_Thumbnail($picture->imagePath, TRUE);
78
+
79
+ $thumb->crop($x, $y, $w, $h);
80
+
81
+ if ($flag_options['thumbFix']) {
82
+ if ($thumb->currentDimensions['height'] > $thumb->currentDimensions['width']) {
83
+ $thumb->resize($flag_options['thumbWidth'], 0);
84
+ } else {
85
+ $thumb->resize(0,$flag_options['thumbHeight']);
86
+ }
87
+ } else {
88
+ $thumb->resize($flag_options['thumbWidth'],$flag_options['thumbHeight'],$flag_options['thumbResampleMode']);
89
+ }
90
+
91
+ if ( $thumb->save($picture->thumbPath, 100)) {
92
+ //read the new sizes
93
+ $new_size = @getimagesize ( $picture->thumbPath );
94
+ $size['width'] = $new_size[0];
95
+ $size['height'] = $new_size[1];
96
+
97
+ // add them to the database
98
+ flagdb::update_image_meta($picture->pid, array( 'thumbnail' => $size) );
99
+
100
+ echo "OK";
101
+ } else {
102
+ header('HTTP/1.1 500 Internal Server Error');
103
+ echo "KO";
104
+ }
105
+
106
+ exit();
107
+
108
+ }
109
+
110
+ add_action('wp_ajax_flag_save_album', 'flag_save_album');
111
+
112
+ function flag_save_album() {
113
+
114
+ global $wpdb;
115
+
116
+ // check for correct capability
117
+ if ( !is_user_logged_in() )
118
+ die('-1');
119
+ // check for correct FlAG capability
120
+ if ( !current_user_can('FlAG Manage gallery') )
121
+ die('-1');
122
+
123
+ $g = array();
124
+ if(isset($_POST['form']))
125
+ parse_str($_POST['form']);
126
+ if($album_name && $album_id) {
127
+ if(count($g))
128
+ $galstring = implode(',', $g);
129
+ else
130
+ $galstring = '';
131
+ $result = $wpdb->query( $wpdb->prepare("UPDATE $wpdb->flagalbum SET name = %s, categories = %s WHERE id = %s", $album_name, $galstring, $album_id) );
132
+ }
133
+
134
+ if($result) {
135
+ _e('Success','flag');
136
+ }
137
+
138
+ exit();
139
+
140
+ }
141
+
142
+ add_action('wp_ajax_flag_delete_album', 'flag_delete_album');
143
+
144
+ function flag_delete_album() {
145
+
146
+ global $wpdb;
147
+
148
+ // check for correct capability
149
+ if ( !is_user_logged_in() )
150
+ die('-1');
151
+ // check for correct FlAG capability
152
+ if ( !current_user_can('FlAG Manage gallery') )
153
+ die('-1');
154
+
155
+ if(isset($_POST['post'])) {
156
+ $result = $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->flagalbum WHERE id = %d", $_POST['post']) );
157
+ }
158
+
159
+ if($result) {
160
+ _e('Success','flag');
161
+ }
162
+
163
+ exit();
164
+
165
+ }
166
+
167
+ add_action('wp_ajax_flag_banner_crunch', 'flag_banner_crunch');
168
+
169
+ function flag_banner_crunch() {
170
+
171
+ global $wpdb;
172
+
173
+ // check for correct capability
174
+ if ( !is_user_logged_in() )
175
+ die('-1');
176
+ // check for correct FlAG capability
177
+ if ( !current_user_can('FlAG Manage gallery') )
178
+ die('-1');
179
+
180
+ if(isset($_POST['path'])) {
181
+ include_once (dirname (__FILE__). '/functions.php');
182
+ $id = flagAdmin::handle_import_file($_POST['path']);
183
+ $file = basename($_POST['path']);
184
+ if ( is_wp_error($id) ) {
185
+ 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>';
186
+ } else {
187
+ echo '<p class="success">' . sprintf(__('<em>%s</em> has been added to Media library', 'flag'), $file) . '</p>';
188
+ }
189
+ }
190
+
191
+ exit();
192
+ }
193
+
194
+ add_action('wp_ajax_flag_file_browser', 'flag_ajax_file_browser');
195
+
196
+ /**
197
+ * jQuery File Tree PHP Connector
198
+ * @author Cory S.N. LaViska - A Beautiful Site (http://abeautifulsite.net/)
199
+ * @version 1.0.1
200
+ *
201
+ * @return string folder content
202
+ */
203
+ function flag_ajax_file_browser() {
204
+
205
+ global $flag;
206
+
207
+ // check for correct NextGEN capability
208
+ if ( !current_user_can('FlAG Import folder') )
209
+ die('No access');
210
+
211
+ if ( !defined('ABSPATH') )
212
+ die('No access');
213
+
214
+ // if nonce is not correct it returns -1
215
+ check_ajax_referer( 'flag-ajax', 'nonce' );
216
+
217
+ //PHP4 compat script
218
+ if (!function_exists('scandir')) {
219
+ function scandir($dir, $listDirectories = false, $skipDots = true ) {
220
+ $dirArray = array();
221
+ if ($handle = opendir($dir) ) {
222
+ while (false !== ($file = readdir($handle))) {
223
+ if (($file != '.' && $file != '..' ) || $skipDots == true) {
224
+ if($listDirectories == false) { if(is_dir($file)) { continue; } }
225
+ array_push($dirArray, basename($file) );
226
+ }
227
+ }
228
+ closedir($handle);
229
+ }
230
+ return $dirArray;
231
+ }
232
+ }
233
+
234
+ // start from the default path
235
+ $root = trailingslashit ( WINABSPATH );
236
+ // get the current directory
237
+ $dir = trailingslashit ( urldecode($_POST['dir']) );
238
+
239
+ if( file_exists($root . $dir) ) {
240
+ $files = scandir($root . $dir);
241
+ natcasesort($files);
242
+
243
+ // The 2 counts for . and ..
244
+ if( count($files) > 2 ) {
245
+ echo "<ul class=\"jqueryDirTree\" style=\"display: none;\">";
246
+
247
+ // return only directories
248
+ foreach( $files as $file ) {
249
+
250
+ //reserved name for the thumnbnails, don't use it as folder name
251
+ if ( $file == 'thumbs')
252
+ continue;
253
+
254
+ if ( file_exists($root . $dir . $file) && $file != '.' && $file != '..' && is_dir($root . $dir . $file) ) {
255
+ echo "<li class=\"directory collapsed\"><a href=\"#\" rel=\"" . esc_html($dir . $file) . "/\">" . esc_html($file) . "</a></li>";
256
+ }
257
+ }
258
+
259
+ echo "</ul>";
260
+ }
261
+ }
262
+
263
+ die();
264
+ }
265
+
266
+ ?>
admin/banner-box.php ADDED
@@ -0,0 +1,460 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You are not allowed to call this page directly.'); }
4
+
5
+ // check for correct capability
6
+ if ( !is_user_logged_in() )
7
+ die('-1');
8
+
9
+ // check for correct FlAG capability
10
+ if ( !current_user_can('FlAG Manage banners') )
11
+ die('-1');
12
+
13
+
14
+ require_once (dirname (__FILE__) . '/functions.php');
15
+ require_once (dirname (__FILE__) . '/banner.functions.php');
16
+
17
+ function flag_banner_controler() {
18
+ $mode = isset($_REQUEST['mode'])? $_REQUEST['mode'] : 'main';
19
+ if ($_POST['importfolder']){
20
+ check_admin_referer('flag_addbanner');
21
+ $bannerfolder = $_POST['bannerfolder'];
22
+ if ( !empty($bannerfolder) ) {
23
+ $crunch_list = flagAdmin::import_banner($bannerfolder);
24
+ $mode = 'import';
25
+ }
26
+ }
27
+ $action = isset($_REQUEST['bulkaction'])? $_REQUEST['bulkaction'] : false;
28
+ if($action == 'no_action') {
29
+ $action = false;
30
+ }
31
+ switch($mode) {
32
+ case 'sort':
33
+ include_once (dirname (__FILE__) . '/banner-sort.php');
34
+ flag_b_playlist_order($_GET['playlist']);
35
+ break;
36
+ case 'edit':
37
+ if(isset($_POST['updatePlaylist'])) {
38
+ $title = $_POST['playlist_title'];
39
+ $descr = $_POST['playlist_descr'];
40
+ $file = $_GET['playlist'];
41
+ foreach($_POST['item_a'] as $item_id => $item) {
42
+ if($action=='delete_items' && in_array($item_id, $_POST['doaction']))
43
+ continue;
44
+ $data[] = $item_id;
45
+ }
46
+ flagGallery::flagSaveWpMedia();
47
+ flagSave_bPlaylist($title,$descr,$data,$file);
48
+ }
49
+ if(isset($_POST['updatePlaylistSkin'])) {
50
+ $file = $_GET['playlist'];
51
+ flagSave_bPlaylistSkin($file);
52
+ }
53
+ include_once (dirname (__FILE__) . '/manage-banner.php');
54
+ flag_b_playlist_edit($_GET['playlist']);
55
+ break;
56
+ case 'save':
57
+ $title = $_POST['playlist_title'];
58
+ $descr = $_POST['playlist_descr'];
59
+ $data = $_POST['items_array'];
60
+ $file = isset($_REQUEST['playlist'])? $_REQUEST['playlist'] : false;
61
+ flagGallery::flagSaveWpMedia();
62
+ flagSave_bPlaylist($title,$descr,$data, $file);
63
+ if(isset($_GET['playlist'])) {
64
+ include_once (dirname (__FILE__) . '/manage-banner.php');
65
+ flag_b_playlist_edit($_GET['playlist']);
66
+ } else {
67
+ flag_created_b_playlists();
68
+ flag_banner_wp_media_lib();
69
+ }
70
+ break;
71
+ case 'add':
72
+ $added = $_POST['items'];
73
+ flag_banner_wp_media_lib($added);
74
+ break;
75
+ case 'delete':
76
+ flag_b_playlist_delete($_GET['playlist']);
77
+ case 'import':
78
+ flag_crunch($crunch_list);
79
+ case 'main':
80
+ if(isset($_POST['updateMedia'])) {
81
+ flagGallery::flagSaveWpMedia();
82
+ flagGallery::show_message( __('Media updated','flag') );
83
+ }
84
+ default:
85
+ flag_created_b_playlists();
86
+ flag_banner_wp_media_lib();
87
+ break;
88
+ }
89
+
90
+ }
91
+ function flag_crunch($crunch_list) {
92
+ if(!$crunch_list) {
93
+ return;
94
+ }
95
+ $crunch_string = implode(',', $crunch_list);
96
+ $folder = rtrim($_POST['bannerfolder'], '/');
97
+ $path = WINABSPATH . $folder.'/';
98
+ ?>
99
+ <script type="text/javascript">
100
+ <!--
101
+ jQuery(document).ready(function(){
102
+ var crunch_string = '<?php echo $crunch_string; ?>';
103
+ var bannerfolder = '<?php echo $path; ?>';
104
+ var crunch_list = crunch_string.split(',');
105
+ var parts = crunch_list.length;
106
+ function flag_crunch() {
107
+ if(crunch_list.length) {
108
+ jQuery.post(
109
+ ajaxurl,
110
+ {
111
+ action: "flag_banner_crunch",
112
+ _wpnonce: "<?php echo wp_create_nonce( 'flag-ajax' ); ?>",
113
+ path: encodeURI(bannerfolder + crunch_list[0])
114
+ },
115
+ function( response ) {
116
+ crunch_list.shift()
117
+ var parts_done = parts - crunch_list.length;
118
+ jQuery(".flag_crunching .flag_progress .flag_complete").animate({width:parts_done*(100/parts)+'%'}, 400);
119
+ jQuery(".flag_crunching").append(response);
120
+ flag_crunch();
121
+ }
122
+ );
123
+ } else {
124
+ var refpage = window.location.href;
125
+ jQuery(".flag_crunching .txt").html('<a href="'+refpage+'"><?php _e("Import folder is complete. The page reloads after 5 seconds.", "flag"); ?></a>');
126
+ //alert('<?php _e("Import folder complete. Refresh page.", "flag"); ?>');
127
+ setTimeout(function(){ window.location.href=window.location.href }, 5000);
128
+ }
129
+ }
130
+ flag_crunch();
131
+ });
132
+ //-->
133
+ </script>
134
+
135
+ <?php }
136
+
137
+ function flag_created_b_playlists() {
138
+
139
+ $filepath = admin_url() . 'admin.php?page=' . $_GET['page'];
140
+
141
+ $all_playlists = get_b_playlists();
142
+ $total_all_playlists = count($all_playlists);
143
+ $flag_options = get_option ('flag_options');
144
+
145
+ ?>
146
+ <div class="wrap">
147
+ <h2><?php _e('Created playlists', 'flag'); ?></h2>
148
+ <table class="widefat" cellspacing="0">
149
+ <thead>
150
+ <tr>
151
+ <th scope="col" width="25%"><?php _e('Title', 'flag'); ?></th>
152
+ <th scope="col" width="55%"><?php _e('Description', 'flag'); ?></th>
153
+ <th scope="col" ><?php _e('Quantity', 'flag'); ?></th>
154
+ <th scope="col" ><?php _e('Shortcode', 'flag'); ?></th>
155
+ <th scope="col" ><?php _e('Action', 'flag'); ?></th>
156
+ </tr>
157
+ </thead>
158
+ <tbody>
159
+ <?php
160
+ if($all_playlists) {
161
+ foreach((array)$all_playlists as $playlist_file => $playlist_data) {
162
+ $query_m = get_posts(array('post_type' => 'attachment', 'numberposts' => -1, 'post_status' => null, 'post_parent' => null, 'post__in' => $playlist_data['items']));
163
+ $class = ( !isset($class) || $class == 'class="alternate"' ) ? '' : 'class="alternate"';
164
+ $playlist_name = basename($playlist_file, '.xml');
165
+ if(count($query_m) != count($playlist_data['items'])) {
166
+ flagSave_bPlaylist($playlist_data['title'],$playlist_data['description'],$playlist_data['items'],$playlist_name);
167
+ }
168
+ ?>
169
+ <tr id="<?php echo $playlist_name; ?>" <?php echo $class; ?> >
170
+ <td>
171
+ <a href="<?php echo $filepath.'&amp;playlist='.$playlist_name.'&amp;mode=edit'; ?>" class='edit' title="<?php _e('Edit'); ?>" >
172
+ <?php echo $playlist_data['title']; ?>
173
+ </a>
174
+ </td>
175
+ <td><?php echo $playlist_data['description']; echo '&nbsp;('.__("player", "flag").': <strong>'.$playlist_data['skin'].'</strong>)' ?></td>
176
+ <td><?php echo count($query_m); ?></td>
177
+ <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>
178
+ <td>
179
+ <a href="<?php echo $filepath.'&amp;playlist='.$playlist_name."&amp;mode=delete"; ?>" class="delete" onclick="javascript:check=confirm( '<?php _e("Delete this playlist?",'flag')?>');if(check==false) return false;"><?php _e('Delete','flag'); ?></a>
180
+ </td>
181
+ </tr>
182
+ <?php
183
+ }
184
+ } else {
185
+ echo '<tr><td colspan="5" align="center"><strong>'.__('No playlists found','flag').'</strong></td></tr>';
186
+ }
187
+ ?>
188
+ </tbody>
189
+ </table>
190
+ </div>
191
+
192
+ <?php } ?>
193
+
194
+ <?php // *** show media list
195
+ function flag_banner_wp_media_lib($added=false) {
196
+ global $wpdb;
197
+ // same as $_SERVER['REQUEST_URI'], but should work under IIS 6.0
198
+ $filepath = admin_url() . 'admin.php?page=' . $_GET['page'];
199
+ if($added!==false) {
200
+ $filepath .= '&amp;playlist='.$_GET['playlist'].'&amp;mode=save';
201
+ $flag_options = get_option('flag_options');
202
+ $playlistPath = $flag_options['galleryPath'].'playlists/banner/'.$_GET['playlist'].'.xml';
203
+ $playlist = get_b_playlist_data(ABSPATH.$playlistPath);
204
+ $exclude = explode(',', $added);
205
+ }
206
+ ?>
207
+ <script type="text/javascript">
208
+ <!--
209
+ jQuery(document).ready(function(){
210
+ jQuery('.cb :checkbox').click(function() {
211
+ if(jQuery(this).is(':checked')){
212
+ var cur = jQuery(this).val();
213
+ var arr = jQuery('#items_array').val();
214
+ if(arr) { var del = ','; } else { var del = ''; }
215
+ jQuery('#items_array').val(arr+del+cur);
216
+ } else {
217
+ var cur = jQuery(this).val();
218
+ var arr = jQuery('#items_array').val().split(',');
219
+ arr = jQuery.grep(arr, function(a){ return a != cur; }).join(',');
220
+ jQuery('#items_array').val(arr);
221
+ };
222
+ });
223
+ });
224
+ function checkAll(form) {
225
+ for (i = 0, n = form.elements.length; i < n; i++) {
226
+ if(form.elements[i].type == "checkbox") {
227
+ if(form.elements[i].name == "doaction[]") {
228
+ if(form.elements[i].checked == true)
229
+ form.elements[i].checked = false;
230
+ else
231
+ form.elements[i].checked = true;
232
+ }
233
+ }
234
+ }
235
+ var arr = jQuery('.cb input:checked').map(function(){return jQuery(this).val();}).get().join(',');
236
+ jQuery('#items_array').val(arr);
237
+ }
238
+ // this function check for a the number of selected images, sumbmit false when no one selected
239
+ function checkSelected() {
240
+ if(!jQuery('.cb input:checked')) {
241
+ alert('<?php echo js_escape(__("No items selected", "flag")); ?>');
242
+ return false;
243
+ }
244
+ actionId = jQuery('#bulkaction').val();
245
+ switch (actionId) {
246
+ case "new_playlist":
247
+ showDialog('new_playlist', 160);
248
+ return false;
249
+ break;
250
+ case "add_to_playlist":
251
+ return confirm('<?php echo sprintf(js_escape(__("You are about to add %s items to playlist \n \n 'Cancel' to stop, 'OK' to proceed.",'flag')), "' + numchecked + '") ; ?>');
252
+ break;
253
+ }
254
+ return confirm('<?php echo sprintf(js_escape(__("You are about to start the bulk edit for %s items \n \n 'Cancel' to stop, 'OK' to proceed.",'flag')), "' + numchecked + '") ; ?>');
255
+ }
256
+
257
+ function showDialog( windowId, height ) {
258
+ jQuery("#" + windowId + "_bulkaction").val(jQuery("#bulkaction").val());
259
+ jQuery("#" + windowId + "_banid").val(jQuery('#items_array').val());
260
+ tb_show("", "#TB_inline?width=640&height=" + height + "&inlineId=" + windowId + "&modal=true", false);
261
+ }
262
+ //-->
263
+ </script>
264
+ <div class="wrap">
265
+
266
+ <?php if( current_user_can('FlAG Import folder') ) {
267
+ $defaultpath = 'wp-content/';
268
+ ?>
269
+ <link rel="stylesheet" type="text/css" href="<?php echo FLAG_URLPATH; ?>admin/js/jqueryFileTree/jqueryFileTree.css" />
270
+ <script type="text/javascript" src="<?php echo FLAG_URLPATH; ?>admin/js/jqueryFileTree/jqueryFileTree.js"></script>
271
+ <script type="text/javascript">
272
+ /* <![CDATA[ */
273
+ jQuery(function() {
274
+ jQuery("#file_browser").fileTree({
275
+ root: "<?php echo WINABSPATH; ?>",
276
+ script: "<?php echo FLAG_URLPATH; ?>admin/js/jqueryFileTree/connectors/jqueryFileTree.php",
277
+ }, function(file) {
278
+ var path = file.replace("<?php echo WINABSPATH; ?>", "");
279
+ jQuery("#bannerfolder").val(path);
280
+ });
281
+
282
+ jQuery("span.browsefiles").show().click(function(){
283
+ jQuery("#file_browser").slideToggle();
284
+ });
285
+ });
286
+ /* ]]> */
287
+ </script>
288
+
289
+ <!-- import folder -->
290
+ <div id="importfolder">
291
+ <h2><?php _e('Import banners from folder', 'flag'); ?></h2>
292
+ <form name="importfolder" id="importfolder_form" method="POST" action="<?php echo $filepath; ?>" accept-charset="utf-8" >
293
+ <?php wp_nonce_field('flag_addbanner'); ?>
294
+ <table class="form-table">
295
+ <tr valign="top">
296
+ <th scope="row"><?php _e('Import from Server path:', 'flag'); ?></th>
297
+ <td><input type="text" size="35" id="bannerfolder" name="bannerfolder" value="<?php echo $defaultpath; ?>" /><span class="browsefiles button" style="display:none"><?php _e('Toggle DIR Browser',"flag"); ?></span>
298
+ <div id="file_browser"></div><br />
299
+ <p><label><input type="checkbox" name="delete_files" value="delete" /> &nbsp;
300
+ <?php _e('delete files after import in WordPress Media Library','flag'); ?></label></p>
301
+ </td>
302
+ </tr>
303
+ </table>
304
+ <div class="submit"><input class="button-primary" type="submit" name="importfolder" value="<?php _e('Import folder', 'flag'); ?>"/></div>
305
+ </form>
306
+ </div>
307
+ <?php } ?>
308
+
309
+ <h2><?php _e('WordPress Image Library', 'flag'); ?></h2>
310
+ <form id="bannerlib" class="flagform" method="POST" action="<?php echo $filepath; ?>" accept-charset="utf-8">
311
+ <?php wp_nonce_field('flag_bulkbanner'); ?>
312
+ <input type="hidden" name="page" value="banner-box" />
313
+
314
+ <div class="tablenav">
315
+
316
+ <div class="actions">
317
+ <?php if($added===false) { ?>
318
+ <input name="updateMedia" class="button-primary" style="float: right;" type="submit" value="<?php _e('Update Media','flag'); ?>" />
319
+ <?php if ( function_exists('json_encode') ) { ?>
320
+ <select name="bulkaction" id="bulkaction">
321
+ <option value="no_action" ><?php _e("No action",'flag'); ?></option>
322
+ <option value="new_playlist" ><?php _e("Create new playlist",'flag'); ?></option>
323
+ </select>
324
+ <input name="showThickbox" class="button-secondary" type="submit" value="<?php _e('Apply','flag'); ?>" onclick="if ( !checkSelected() ) return false;" />
325
+ <?php } ?>
326
+ <a href="<?php echo admin_url( 'media-new.php'); ?>" class="button"><?php _e('Upload Banner(s)','flag'); ?></a>
327
+ <input type="hidden" id="items_array" name="items_array" value="" />
328
+ <?php } else { ?>
329
+ <input type="hidden" name="mode" value="save" />
330
+ <input style="width: 80%;" type="text" id="items_array" name="items_array" value="<?php echo $added; ?>" />
331
+ <input type="hidden" name="playlist_title" value="<?php echo $playlist['title']; ?>" />
332
+ <input type="hidden" name="skinname" value="<?php echo $playlist['skin']; ?>" />
333
+ <input type="hidden" name="skinaction" value="<?php echo $playlist['skin']; ?>" />
334
+ <textarea style="display: none;" name="playlist_descr" cols="40" rows="1"><?php echo $playlist['description']; ?></textarea>
335
+ <input name="addToPlaylist" class="button-secondary" type="submit" value="<?php _e('Update Playlist','flag'); ?>" onclick="if ( !checkSelected() ) return false;" />
336
+ <?php } ?>
337
+ </div>
338
+
339
+ </div>
340
+ <table class="widefat" cellspacing="0">
341
+ <thead>
342
+ <tr>
343
+ <th class="cb" width="54" scope="col"><a href="#" onclick="checkAll(document.getElementById('bannerlib'));return false;"><?php _e('Check', 'flag'); ?></a></th>
344
+ <th class="id" width="64" scope="col"><div><?php _e('ID', 'flag'); ?></div></th>
345
+ <th class="thumb" width="110" scope="col"><div><?php _e('Thumbnail', 'flag'); ?></div></th>
346
+ <th class="title_filename" scope="col"><div><?php _e('Filename / Title / Link', 'flag'); ?></div></th>
347
+ <th class="description" scope="col"><div><?php _e('Description', 'flag'); ?></div></th>
348
+ </tr>
349
+ </thead>
350
+ <tfoot>
351
+ <tr>
352
+ <th class="cb" scope="col"><a href="#" onclick="checkAll(document.getElementById('bannerlib'));return false;"><?php _e('Check', 'flag'); ?></a></th>
353
+ <th class="id" scope="col"><?php _e('ID', 'flag'); ?></th>
354
+ <th class="thumb" scope="col"><?php _e('Thumbnail', 'flag'); ?></th>
355
+ <th class="title_filename" scope="col"><?php _e('Filename / Title / Link', 'flag'); ?></th>
356
+ <th class="description" scope="col"><?php _e('Description', 'flag'); ?></th>
357
+ </tr>
358
+ </tfoot>
359
+ <tbody>
360
+ <?php $bannerlist = get_posts( $args = array(
361
+ 'numberposts' => -1,
362
+ 'orderby' => 'ID',
363
+ 'order' => 'DESC',
364
+ 'post_type' => 'attachment',
365
+ 'post_mime_type' => array('image') )
366
+ );
367
+ $uploads = wp_upload_dir();
368
+ $flag_options = get_option('flag_options');
369
+ if($bannerlist) {
370
+ foreach($bannerlist as $ban) {
371
+ $list[] = $ban->ID;
372
+ }
373
+ $class = ' class="alternate"';
374
+ foreach($bannerlist as $ban) {
375
+ $class = ( empty($class) ) ? ' class="alternate"' : '';
376
+ $class2 = ( empty($class) ) ? '' : ' alternate';
377
+ $ex = $checked = '';
378
+ if($added!==false && in_array($ban->ID, $exclude) ) {
379
+ $ex = ' style="background-color:#DDFFBB;" title="'.__("Already Added", "flag").'"';
380
+ $checked = ' checked="checked"';
381
+ }
382
+ $bg = ( !isset($class) || $class == 'class="alternate"' ) ? 'f9f9f9' : 'ffffff';
383
+ $thumb = $banthumb = get_post_meta($ban->ID, 'thumbnail', true);
384
+ $link = get_post_meta($ban->ID, 'link', true);
385
+ if(empty($thumb)) {
386
+ $thumb = wp_get_attachment_thumb_url($ban->ID);
387
+ $banthumb = '';
388
+ }
389
+ $url = wp_get_attachment_url($ban->ID);
390
+ ?>
391
+ <tr id="ban-<?php echo $ban->ID; ?>"<?php echo $class.$ex; ?>>
392
+ <td class="cb"><input name="doaction[]" type="checkbox"<?php echo $checked; ?> value="<?php echo $ban->ID; ?>" /></td>
393
+ <td class="id"><p style="margin-bottom: 3px; white-space: nowrap;">ID: <?php echo $ban->ID; ?></p></td>
394
+ <td class="thumb">
395
+ <a class="thickbox" title="<?php echo basename($url); ?>" href="<?php echo $url; ?>"><img id="thumb-<?php echo $ban->ID; ?>" src="<?php echo $thumb; ?>" width="100" height="100" alt="" /></a>
396
+ </td>
397
+ <td class="title_filename">
398
+ <strong><a href="<?php echo $url; ?>"><?php echo basename($url); ?></a></strong><br />
399
+ <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 $ban->post_title; ?></textarea><br />
400
+ <?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 $link; ?>" /><br />
401
+ </td>
402
+ <td class="description">
403
+ <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 $ban->post_content; ?></textarea>
404
+ </td>
405
+ </tr>
406
+ <?php
407
+ }
408
+ } else {
409
+ echo '<tr><td colspan="5" align="center"><strong>'.__('No images in WordPress Media Library.','flag').'</strong></td></tr>';
410
+ }
411
+ ?>
412
+ </tbody>
413
+ </table>
414
+ </form>
415
+ </div>
416
+
417
+ <!-- #new_playlist -->
418
+ <div id="new_playlist" style="display: none;" >
419
+ <form id="form_new_playlist" method="POST" action="<?php echo $filepath; ?>" accept-charset="utf-8">
420
+ <?php wp_nonce_field('flag_thickbox_form'); ?>
421
+ <input type="hidden" id="new_playlist_banid" name="items_array" value="" />
422
+ <input type="hidden" id="new_playlist_bulkaction" name="TB_bulkaction" value="" />
423
+ <input type="hidden" name="mode" value="save" />
424
+ <input type="hidden" name="page" value="banner-box" />
425
+ <table width="100%" border="0" cellspacing="3" cellpadding="3" >
426
+ <tr valign="top">
427
+ <th align="left" style="padding-top: 5px;"><?php _e('Playlist Title','flag'); ?></th>
428
+ <td><input type="text" class="alignleft" name="playlist_title" value="" />
429
+ <div class="alignright"><strong><?php _e("Choose skin", 'flag'); ?>:</strong>
430
+ <select id="skinname" name="skinname" style="width: 200px; height: 24px; font-size: 11px;">
431
+ <?php require_once (dirname(__FILE__) . '/get_skin.php');
432
+ $all_skins = get_skins($skin_folder='', $type='b');
433
+ if(count($all_skins)) {
434
+ foreach ( (array)$all_skins as $skin_file => $skin_data) {
435
+ echo '<option value="'.dirname($skin_file).'">'.$skin_data['Name'].'</option>'."\n";
436
+ }
437
+ } else {
438
+ echo '<option value="banner_default">'.__("No Skins", "flag").'</option>';
439
+ }
440
+ ?>
441
+ </select>
442
+ </div>
443
+ </td>
444
+ </tr>
445
+ <tr valign="top">
446
+ <th align="left" style="padding-top: 5px;"><?php _e('Playlist Description','flag'); ?></th>
447
+ <td><textarea style="width:100%;" rows="3" cols="60" name="playlist_descr"></textarea></td>
448
+ </tr>
449
+ <tr>
450
+ <td>&nbsp;</td>
451
+ <td align="right"><input class="button-secondary" type="reset" value="&nbsp;<?php _e('Cancel', 'flag'); ?>&nbsp;" onclick="tb_remove()"/>
452
+ &nbsp; &nbsp; &nbsp;
453
+ <input class="button-primary " type="submit" name="TB_NewPlaylist" value="<?php _e('OK', 'flag'); ?>" />
454
+ </td>
455
+ </tr>
456
+ </table>
457
+ </form>
458
+ </div>
459
+ <!-- /#new_playlist -->
460
+ <?php } ?>
admin/banner-sort.php ADDED
@@ -0,0 +1,120 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * @author Sergey Pasyuk
5
+ * @copyright 2011
6
+ */
7
+
8
+ function flag_b_playlist_order($playlist){
9
+ global $wpdb;
10
+
11
+ //this is the url without any presort variable
12
+ $base_url = admin_url() . 'admin.php?page=' . $_GET['page'];
13
+ $flag_options = get_option('flag_options');
14
+ $playlistPath = $flag_options['galleryPath'].'playlists/banner/'.$_GET['playlist'].'.xml';
15
+ $playlist = get_b_playlist_data(ABSPATH.$playlistPath);
16
+ $items_a = $playlist['items'];
17
+ $items = implode(',',$playlist['items']);
18
+ ?>
19
+ <script type="text/javascript" src="<?php echo FLAG_URLPATH; ?>admin/js/jquery.tablednd_0_5.js"></script>
20
+ <script type="text/javascript" src="<?php echo FLAG_URLPATH; ?>admin/js/jquery.tablesorter.js"></script>
21
+ <div class="wrap">
22
+ <h2><?php _e('Sort Gallery', 'flag'); ?></h2>
23
+
24
+ <div class="alignright tablenav" style="margin-bottom: -36px;">
25
+ <a href="<?php echo $base_url.'&amp;playlist='.$_GET['playlist'].'&amp;mode=edit'; ?>" class="button-secondary action"><?php _e('Back to playlist', 'flag'); ?></a>
26
+ </div>
27
+ <form id="sortPlaylist" method="POST" action="<?php echo $base_url.'&amp;playlist='.$_GET['playlist'].'&amp;mode=edit'; ?>" accept-charset="utf-8">
28
+ <div class="alignleft tablenav">
29
+ <?php wp_nonce_field('flag_updatesortorder'); ?>
30
+ <input class="button-primary action" type="submit" name="updatePlaylist" value="<?php _e('Update Sort Order', 'flag'); ?>" />
31
+ </div>
32
+ <br clear="all" />
33
+ <input type="hidden" name="playlist_title" value="<?php echo $playlist['title']; ?>" />
34
+ <input type="hidden" name="skinname" value="<?php echo $playlist['skin']; ?>" />
35
+ <input type="hidden" name="skinaction" value="<?php echo $playlist['skin']; ?>" />
36
+ <textarea style="display: none;" name="playlist_descr" cols="40" rows="1"><?php echo $playlist['description']; ?></textarea>
37
+ <script type="text/javascript">
38
+ /*<![CDATA[*/
39
+ jQuery(document).ready(function($) {
40
+ // Initialise the table
41
+ jQuery("#listitems").tableDnD({
42
+ onDragClass: "myDragClass",
43
+ onDrop: function() {
44
+ jQuery("#listitems tr:even").addClass('alternate');
45
+ jQuery("#listitems tr:odd").removeClass('alternate');
46
+ }
47
+ });
48
+ $("#flag-listitems").tablesorter({
49
+ // pass the headers argument and assing a object
50
+ headers: {
51
+ // assign the secound column (we start counting zero)
52
+ 1: {
53
+ // disable it by setting the property sorter to false
54
+ sorter: false
55
+ }
56
+ }
57
+ });
58
+ $("#flag-listitems").bind("sortEnd",function() {
59
+ jQuery("#listitems tr:even").addClass('alternate');
60
+ jQuery("#listitems tr:odd").removeClass('alternate');
61
+ });
62
+
63
+ });
64
+ /*]]>*/
65
+ </script>
66
+ <table id="flag-listitems" class="widefat fixed" cellspacing="0" >
67
+
68
+ <thead>
69
+ <tr>
70
+ <th class="header" width="54"><p style="margin-right:-10px;"><?php _e('ID', 'flag'); ?></p></th>
71
+ <th width="50"><div><?php _e('Thumb', 'flag'); ?></div></th>
72
+ <th class="header"><p><?php _e('Filename', 'flag'); ?></p></th>
73
+ <th class="header"><p><?php _e('Title', 'flag'); ?></p></th>
74
+ </tr>
75
+ </thead>
76
+ <tfoot>
77
+ <tr>
78
+ <th><?php _e('ID', 'flag'); ?></th>
79
+ <th><?php _e('Thumb', 'flag'); ?></th>
80
+ <th><?php _e('Filename', 'flag'); ?></th>
81
+ <th><?php _e('Title', 'flag'); ?></th>
82
+ </tr>
83
+ </tfoot>
84
+ <tbody id="listitems">
85
+ <?php
86
+ if(count($items_a)) {
87
+ $counter = 0;
88
+ foreach($items_a as $item) {
89
+ $ban = get_post($item);
90
+ $thumb = get_post_meta($item, 'thumbnail', true);
91
+ if(empty($thumb)) {
92
+ $thumb = wp_get_attachment_thumb_url($ban->ID);
93
+ }
94
+ $alternate = ( !isset($alternate) || $alternate == 'alternate' ) ? '' : 'alternate';
95
+ $counter++;
96
+ $bg = ( !isset($alternate) || $alternate == 'alternate' ) ? 'f9f9f9' : 'ffffff';
97
+ $url = wp_get_attachment_url($ban->ID);
98
+ ?>
99
+ <tr id="$ban-<?php echo $ban->ID; ?>" class="<?php echo $alternate; ?> iedit" valign="top">
100
+ <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>
101
+ <td width="50"><a class="thickbox" title="<?php echo basename($url); ?>" href="<?php echo $url; ?>"><img id="thumb-<?php echo $ban->ID; ?>" src="<?php echo $thumb; ?>" width="40" height="40" alt="" /></a></td>
102
+ <td><?php echo basename($url); ?></td>
103
+ <td><?php echo $ban->post_title; ?></td>
104
+ </tr>
105
+ <?php
106
+ }
107
+ } else {
108
+ echo '<tr><td colspan="4" align="center"><strong>'.__('No entries found','flag').'</strong></td></tr>';
109
+ }
110
+ ?>
111
+ </tbody>
112
+ </table>
113
+ <p class="actions"><input type="submit" class="button-primary action" name="updatePlaylist" value="<?php _e('Update Sort Order', 'flag'); ?>" /></p>
114
+ </form>
115
+ <br class="clear"/>
116
+ </div><!-- /#wrap -->
117
+
118
+ <?php
119
+ }
120
+ ?>
admin/banner.functions.php ADDED
@@ -0,0 +1,179 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You are not allowed to call this page directly.'); }
3
+
4
+ function get_b_playlist_data( $playlist_file ) {
5
+ global $wpdb;
6
+ $playlist_content = file_get_contents($playlist_file);
7
+
8
+ $playlist_data['title'] = flagGallery::flagGetBetween($playlist_content,'<title><![CDATA[',']]></title>');
9
+ $playlist_data['skin'] = flagGallery::flagGetBetween($playlist_content,'<skin><![CDATA[',']]></skin>');
10
+ $playlist_data['width'] = flagGallery::flagGetBetween($playlist_content,'<width><![CDATA[',']]></width>');
11
+ $playlist_data['height'] = flagGallery::flagGetBetween($playlist_content,'<height><![CDATA[',']]></height>');
12
+ $playlist_data['description'] = flagGallery::flagGetBetween($playlist_content,'<description><![CDATA[',']]></description>');
13
+ preg_match_all( '|<item id="(.*)">|', $playlist_content, $items );
14
+ $playlist_data['items'] = $items[1];
15
+ return $playlist_data;
16
+ }
17
+
18
+ /**
19
+ * Check the playlists directory and retrieve all playlist files with playlist data.
20
+ *
21
+ */
22
+ function get_b_playlists($playlist_folder = '') {
23
+
24
+ $flag_options = get_option('flag_options');
25
+ $flag_playlists = array ();
26
+ $playlist_root = ABSPATH.$flag_options['galleryPath'].'playlists/banner';
27
+ if( !empty($playlist_folder) )
28
+ $playlist_root = $playlist_folder;
29
+
30
+ // Files in flagallery/playlists directory
31
+ $playlists_dir = @ opendir( $playlist_root);
32
+ $playlist_files = array();
33
+ if ( $playlists_dir ) {
34
+ while (($file = readdir( $playlists_dir ) ) !== false ) {
35
+ if ( substr($file, 0, 1) == '.' )
36
+ continue;
37
+ if ( substr($file, -4) == '.xml' )
38
+ $playlist_files[] = $file;
39
+ }
40
+ }
41
+ @closedir( $playlists_dir );
42
+
43
+ if ( !$playlists_dir || empty($playlist_files) )
44
+ return $flag_playlists;
45
+
46
+ foreach ( $playlist_files as $playlist_file ) {
47
+ if ( !is_readable( "$playlist_root/$playlist_file" ) )
48
+ continue;
49
+
50
+ $playlist_data = get_b_playlist_data( "$playlist_root/$playlist_file" );
51
+
52
+ if ( empty ( $playlist_data['title'] ) )
53
+ continue;
54
+
55
+ $flag_playlists[basename( $playlist_file, ".xml" )] = $playlist_data;
56
+ }
57
+ uasort( $flag_playlists, create_function( '$a, $b', 'return strnatcasecmp( $a["title"], $b["title"] );' ));
58
+
59
+ return $flag_playlists;
60
+ }
61
+
62
+ function flagSave_bPlaylist($title,$descr,$data,$file='',$skinaction='') {
63
+ global $wpdb;
64
+ require_once(ABSPATH . '/wp-admin/includes/image.php');
65
+ if(!trim($title)) {
66
+ $title = 'default';
67
+ }
68
+ if (!$file) {
69
+ $file = sanitize_title($title);
70
+ }
71
+ if(!is_array($data))
72
+ $data = explode(',', $data);
73
+
74
+ $flag_options = get_option('flag_options');
75
+ $skin = isset($_POST['skinname'])? $_POST['skinname'] : 'banner_default';
76
+ if(!$skinaction) {
77
+ $skinaction = isset($_POST['skinaction'])? $_POST['skinaction'] : 'update';
78
+ }
79
+ $skinpath = trailingslashit( $flag_options['skinsDirABS'] ).$skin;
80
+ $playlistPath = ABSPATH.$flag_options['galleryPath'].'playlists/banner/'.$file.'.xml';
81
+ if( file_exists($playlistPath) && ($skin == $skinaction) ) {
82
+ $settings = file_get_contents($playlistPath);
83
+ } else {
84
+ $settings = file_get_contents($skinpath . "/settings/settings.xml");
85
+ }
86
+ $properties = flagGallery::flagGetBetween($settings,'<properties>','</properties>');
87
+ $w = flagGallery::flagGetBetween($properties,'<width><![CDATA[',']]></width>');
88
+ $h = flagGallery::flagGetBetween($properties,'<height><![CDATA[',']]></height>');
89
+ $suffix = $w.'x'.$h;
90
+ if(count($data)) {
91
+ $content = '<gallery>
92
+ <properties>'.$properties.'</properties>
93
+ <category id="'.$file.'">
94
+ <properties>
95
+ <title><![CDATA['.$title.']]></title>
96
+ <description><![CDATA['.$descr.']]></description>
97
+ <skin><![CDATA['.$skin.']]></skin>
98
+ </properties>
99
+ <items>';
100
+
101
+ foreach( (array) $data as $id) {
102
+ $ban = get_post($id);
103
+ if($ban->ID) {
104
+ $url = wp_get_attachment_url($ban->ID);
105
+ if($skin == 'banner_default') {
106
+ $path = get_attached_file($ban->ID);
107
+ $info = pathinfo($path);
108
+ $dir = $info['dirname'];
109
+ $ext = $info['extension'];
110
+ $name = urldecode( basename( str_replace( '%2F', '/', urlencode( $path ) ), ".$ext" ) );
111
+ $img_file = "{$dir}/{$name}-{$suffix}.{$ext}";
112
+ if(!file_exists($img_file)){
113
+ $thumb = image_resize($path,$w,$h,$cut=true,$suffix);
114
+ if(is_string($thumb)) {
115
+ $img = substr($thumb, strpos($thumb, 'wp-content'));
116
+ $track = get_bloginfo('wpurl') . '/' . $img;
117
+ } else {
118
+ $track = $url;
119
+ }
120
+
121
+ } else {
122
+ $track = dirname($url)."/{$name}-{$suffix}.{$ext}";
123
+ }
124
+ } else {
125
+ $track = $url;
126
+ }
127
+ $thumbnail = get_post_meta($id, 'thumbnail', true);
128
+ $link = get_post_meta($id, 'link', true);
129
+ $preview = get_post_meta($id, 'preview', true);
130
+ $content .= '
131
+ <item id="'.$ban->ID.'">
132
+ <track>'.$track.'</track>
133
+ <title><![CDATA['.$ban->post_title.']]></title>
134
+ <link>'.$link.'</link>
135
+ <preview>'.$preview.'</preview>
136
+ <description><![CDATA['.$ban->post_content.']]></description>
137
+ <thumbnail>'.$thumbnail.'</thumbnail>
138
+ </item>';
139
+ }
140
+ }
141
+ $content .= '
142
+ </items>
143
+ </category>
144
+ </gallery>';
145
+ // Save options
146
+ $flag_options = get_option('flag_options');
147
+ if(wp_mkdir_p(ABSPATH.$flag_options['galleryPath'].'playlists/banner/')) {
148
+ if( flagGallery::saveFile($playlistPath,$content,'w') ){
149
+ flagGallery::show_message(__('Playlist Saved Successfully','flag'));
150
+ }
151
+ } else {
152
+ flagGallery::show_message(__('Create directory please:','flag').'"/'.$flag_options['galleryPath'].'playlists/banner/"');
153
+ }
154
+ }
155
+ }
156
+
157
+ function flagSave_bPlaylistSkin($file) {
158
+ global $wpdb;
159
+ $flag_options = get_option('flag_options');
160
+ $playlistPath = ABSPATH.$flag_options['galleryPath'].'playlists/banner/'.$file.'.xml';
161
+ // Save options
162
+ $title = $_POST['playlist_title'];
163
+ $descr = $_POST['playlist_descr'];
164
+ $items = get_b_playlist_data($playlistPath);
165
+ $data = $items['items'];
166
+ flagSave_bPlaylist($title,$descr,$data,$file,$skinaction='update');
167
+ }
168
+
169
+ function flag_b_playlist_delete($playlist) {
170
+ $flag_options = get_option('flag_options');
171
+ $playlistXML = ABSPATH.$flag_options['galleryPath'].'playlists/banner/'.$playlist.'.xml';
172
+ if(file_exists($playlistXML)){
173
+ if(unlink($playlistXML)) {
174
+ flagGallery::show_message("'".$playlist.".xml' ".__('deleted','flag'));
175
+ }
176
+ }
177
+ }
178
+
179
+ ?>
admin/css/flagSorter.css ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .imageBox,.imageBoxHighlighted{
2
+ width:130px; /* Total width of each image box */
3
+ height:160px; /* Total height of each image box */
4
+ float:left;
5
+ }
6
+ .imageBox_theImage{
7
+ width:110px; /* Width of image */
8
+ height:125px; /* Height of image */
9
+
10
+ /*
11
+ Don't change these values *
12
+ */
13
+ background-position: center;
14
+ background-repeat: no-repeat;
15
+ margin: 0 auto;
16
+ margin-bottom:2px;
17
+ }
18
+
19
+ .imageBox .imageBox_theImage{
20
+ border:1px solid #DDD; /* Border color for not selected images */
21
+ padding:2px;
22
+ }
23
+ .imageBoxHighlighted .imageBox_theImage{
24
+ border:3px solid #316AC5; /* Border color for selected image */
25
+ padding:0px;
26
+
27
+ }
28
+ .imageBoxHighlighted span{ /* Title of selected image */
29
+ background-color: #316AC5;
30
+ color:#FFFFFF;
31
+ padding:2px;
32
+ }
33
+
34
+ .imageBox_label{ /* Title of images - both selected and not selected */
35
+ text-align:center;
36
+ font-family: arial;
37
+ font-size:11px;
38
+ padding-top:2px;
39
+ margin: 0 auto;
40
+ }
41
+
42
+ /*
43
+ DIV that indicates where the dragged image will be placed
44
+ */
45
+ #insertionMarker{
46
+ height:150px;
47
+ width:6px;
48
+ position:absolute;
49
+ }
50
+
51
+ #insertionMarkerLine{
52
+ width:6px; /* No need to change this value */
53
+ height:145px; /* To adjust the height of the div that indicates where the dragged image will be dropped */
54
+
55
+ }
56
+
57
+ #insertionMarker img{
58
+ float:left;
59
+ }
60
+
61
+ /*
62
+ DIV that shows the image as you drag it
63
+ */
64
+ #dragDropContent{
65
+
66
+ opacity:0.4; /* 40 % opacity */
67
+ filter:alpha(opacity=40); /* 40 % opacity */
68
+
69
+ /*
70
+ No need to change these three values
71
+ */
72
+ position:absolute;
73
+ z-index:10;
74
+ display:none;
75
+
76
+ }
admin/css/flagadmin.css ADDED
@@ -0,0 +1,260 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ ** Flash Album Gallery Admin StyleSheet
3
+ */
4
+
5
+ /* SETTINGS FOR SKIN PAGE */
6
+ .skins .inactive,
7
+ .skins .inactive th,
8
+ .skins .inactive td {
9
+ background-color: #ebeeef;
10
+ }
11
+ .skins .active,
12
+ .skins .active th,
13
+ .skins .active td {
14
+ color: #000;
15
+ }
16
+ .skins .inactive a {
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
+ .has-sidebar {
28
+ clear:left;
29
+ float:left;
30
+ width:100%;
31
+ }
32
+ .has-sidebar .has-sidebar-content {
33
+ padding-right:300px;
34
+ }
35
+
36
+ .postbox .misc-pub-section .icon { background-position:left top;background-repeat:no-repeat;padding-left:18px;}
37
+ #plugin-home {background-image:url(../images/browser.png)}
38
+ #plugin-comments {background-image:url(../images/notes.png)}
39
+ #rate-plugin {background-image:url(../images/wallpaper.png)}
40
+ #my-plugins {background-image:url(../images/map.png)}
41
+ #contact-me {background-image:url(../images/mail.png)}
42
+
43
+ #dashboard_server_settings ul.settings span {
44
+ padding-left : 10px;
45
+ color:#2583AD;
46
+ font-weight:bold;
47
+ }
48
+
49
+ .flag-overview .postbox .handlediv {
50
+ float:right;
51
+ height:24px;
52
+ width:24px;
53
+ }
54
+
55
+ #dashboard_primary .inside { margin: 0; }
56
+
57
+ #photogallerycreator .theme > p { margin: 0; padding: 0; }
58
+ #photogallerycreator .theme { overflow: hidden; padding: 7px 0; border-bottom: 1px solid #000000; }
59
+ #photogallerycreator .theme .img { margin-top: 25px; }
60
+ #photogallerycreator .theme .txt > *:first-child { display: block; margin: 0 0 -20px; padding: 0; text-align: center; position: relative; top: -204px; }
61
+
62
+ /* SETTING FOR UPLOAD PAGE */
63
+ .useflashupload {float:left;}
64
+ .swfupload {
65
+ position:absolute;
66
+ z-index:1;
67
+ vertical-align:top;
68
+ }
69
+ #uploadQueue {}
70
+ #choosegalfirst {position:relative; float:left; margin-left:15px; overflow:hidden;}
71
+ #choosegalfirst .disabledbut {position:absolute; top:0; left:0; right:0; bottom:0; width:100%; height:100%;}
72
+
73
+ /* SETTINGS FOR THE OPTIONS TABLE */
74
+ .flag-options th {
75
+ width:22%;
76
+ }
77
+
78
+ /* SETTINGS FOR MANAGE TABLE */
79
+
80
+ p#flag-inlinebutton {
81
+ float:right;
82
+ margin:0pt;
83
+ position:relative;
84
+ top:-25pt;
85
+ }
86
+
87
+ .flag-tablenav .button-secondary {
88
+ padding:2px 8px;
89
+ vertical-align: top;
90
+ }
91
+
92
+ #flag-listitems td, #flag-listitems th {
93
+
94
+ }
95
+
96
+ .fixed tbody th.column-cb {
97
+ padding:7px 0 22px;
98
+ }
99
+ .fixed .column-cb {
100
+ padding:0;
101
+ width:2.2em;
102
+ }
103
+
104
+ .fixed .column-thumbnail{
105
+ width:80px;
106
+ }
107
+
108
+ .fixed .column-thumbnail img{
109
+ max-height:60px;
110
+ max-width:80px;
111
+ }
112
+
113
+ .fixed .column-id {
114
+ width: 3em;
115
+ }
116
+
117
+ .fixed .column-rating { width:100px; text-align: center; }
118
+ .fixed td.column-rating { background-color: #CCFFCC; }
119
+ .fixed .column-views_likes { width:150px; padding-left: 0; padding-right: 0; }
120
+ .fixed .column-views_likes input { width:45px; font-size: 10px; }
121
+
122
+ .fixed .column-alt_title_desc {
123
+
124
+ }
125
+
126
+ .fixed .column-exclude, .fixed .column-action, .fixed .column-delete {
127
+ width: 2.2em; text-align: center;
128
+ }
129
+ .fixed .column-exclude input {
130
+ margin-top:4px;
131
+ }
132
+ .fixed .column-views {
133
+ width: 4em; text-align: center;
134
+ }
135
+
136
+ .flagform .widefat thead th { padding: 7px 0 8px; }
137
+ .flagform .widefat tfoot th { padding: 7px 0 8px; }
138
+ .flagform .widefat thead th > div, .flagform .widefat thead th > p { margin-left: 7px; padding: 0; }
139
+ .flagform .widefat thead th.cb { width: 54px; text-align: center; }
140
+ .flagform .widefat tfoot th.cb { text-align: center; }
141
+
142
+ .albums_table { width: 600px; position: relative; background: #ffffff; border: 1px solid #cccccc; border-radius: 4px; margin: 7px 0; padding: 1px 3px; float: left; }
143
+ .albums_table .album { position: relative; background: #f8f8f8; border: 1px solid #cccccc; border-radius: 4px; margin:2px 0; padding: 3px 3px 3px 36px; }
144
+ .albums_table .album form { margin: 0; padding: 0; display: inline; }
145
+ .albums_table .albID { position: absolute; display: block; width: 30px; top: 6px; left: 0px; text-align: right; }
146
+ .albums_table .album_actions { position: absolute; display: block; top: 3px; right: 3px; text-align: right; }
147
+ .albums_table .album_categoties { background: #fefefe; border: 1px solid #cccccc; margin:1px 0; padding: 0px; min-height: 14px; }
148
+ .albums_table .album_categoties .acat { border-top: 1px solid #cccccc; padding: 3px 6px; cursor: move; position: relative; }
149
+ .albums_table .album_categoties .acat .drop { display: none; position: absolute; right: 3px; top: 1px; font-size: 18px; line-height: 100%; color: #ff0000; cursor: pointer; }
150
+ .albums_table .album_categoties .acat:hover { background-color: #FFFFEE; }
151
+ .albums_table .album_categoties .acat:hover .drop { display: block; }
152
+ .albums_table .album_categoties .acat:first-child { border-top: none; }
153
+
154
+ .alb_msg { font-size: 10px; color: #006600; }
155
+ .flag-ajax-post { cursor: pointer; text-decoration: underline; }
156
+ .flag-ajax-post:hover { color: #ff0000; }
157
+
158
+ .all_galleries { float: left; white-space: nowrap; margin: 7px 0 0px 50px; }
159
+ .all_galleries .acat { border: 1px solid #cccccc; padding: 3px 6px; margin: 3px 0; background: #fefefe; cursor: move; }
160
+ .all_galleries .acat .drop { display: none; }
161
+ .all_galleries .acat:hover { background-color: #FFFFEE; }
162
+
163
+ .floatholder { overflow: hidden; }
164
+ /* SETTINGS FOR PROGRESS BAR */
165
+
166
+ div .progressborder {
167
+ border: 1px inset ;
168
+ display: block;
169
+ height: 20px;
170
+ background-color: #464646;
171
+ width: 100%;
172
+ margin-top: 15px;
173
+ margin-bottom: 15px;
174
+ }
175
+
176
+ div .progressbar {
177
+ border: medium none ;
178
+ display: block;
179
+ height: 20px;
180
+ background-color: #D54E21;
181
+ width: 0%;
182
+ }
183
+
184
+ div .progressbar span {
185
+ display: inline;
186
+ position: relative;
187
+ color: white;
188
+ font-weight: bold;
189
+ padding-left: 5px;
190
+ }
191
+
192
+
193
+ .show_details
194
+ {
195
+ height: 16px;
196
+ line-height: 20px;
197
+ overflow: hidden;
198
+ min-width: 8em;
199
+ padding: 3px;
200
+ cursor:pointer;
201
+ }
202
+
203
+ .show_details span
204
+ {
205
+ border-bottom:1px solid #999;
206
+ white-space:pre;
207
+ }
208
+ .show_details:hover
209
+ {
210
+ height: auto;
211
+ overflow: visible;
212
+ border: 1px solid #999;
213
+ }
214
+
215
+ /* SETTINGS FOR SORT GALLERY */
216
+ #flag-listitems .header p {
217
+ background-image:url(../images/sortbg.gif);
218
+ background-position:right center;
219
+ background-repeat:no-repeat;
220
+ cursor:pointer;
221
+ margin:0;
222
+ }
223
+ #flag-listitems .headerSortDown p {
224
+ background-image:url(../images/desc.gif) !important;
225
+ background-position:right center;
226
+ background-repeat:no-repeat;
227
+ cursor:pointer;
228
+ margin:0;
229
+ }
230
+ #flag-listitems .headerSortUp p {
231
+ background-image:url(../images/asc.gif) !important;
232
+ background-position:right center;
233
+ background-repeat:no-repeat;
234
+ cursor:pointer;
235
+ margin:0;
236
+ }
237
+
238
+ /* UPGRADE PAGE */
239
+
240
+ .error_inline {
241
+ background:#FFEBE8 none repeat scroll 0%;
242
+ border:1px solid #CC0000;
243
+ margin:5px auto;
244
+ padding:10px;
245
+ }
246
+
247
+ /* MEDIA BOX */
248
+
249
+ p.row-actions {
250
+ margin:0px;
251
+ padding:10px 4px 0;
252
+ }
253
+
254
+ div#TB_window iframe#TB_iframeContent { width: 100% !important; }
255
+ div.message { background: #ffffee; border: 1px solid #cccccc; border-radius: 4px; padding: 1px 10px; margin: 24px 20px 10px 0; font-size: 12px; }
256
+ div.message .flag_progress { position: relative; height: 18px; width: 400px; border: 1px solid #0066FF; background-color: #ffffff; margin: 7px 0; }
257
+ div.message .flag_progress .txt { position: absolute; left: 10px; top: 0; line-height: 18px; font-weight: bold; height: 18px; z-index: 10; }
258
+ div.message .flag_progress .flag_complete { position: absolute; left: 0; top: 0; height: 18px; width: 0px; overflow: hidden; background: #00FFB7; z-index: 5; }
259
+ div#license div p { font-size: 13px; }
260
+ .highlight_new { background-color: #E4F2FD; color: #000000; font-weight: bold; }
admin/css/flagallery.css ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ /*
2
+ ** Flash Album Gallery StyleSheet
3
+ */
4
+ .flashalbum { overflow:hidden; position:relative;}
5
+ .grandmusic, .grandvideo, .grandflv, .grandmp3, .grandbanner { overflow:hidden; position:relative; }
6
+ body.FlAG { margin: 0; padding: 0; font-size: 0; line-height: 0; }
7
+ 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; }
8
+ body.FlAG .FlAGd img { display: none !important; }
admin/css/flagallery_nocrawler.css ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
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 ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ .flag_alternate { background-color: <?php echo $bg; ?>; margin: 7px 0; }
13
+ .flag_alternate .flagcategory { width: 100%; height: auto; position: relative; text-align: center; padding-bottom: 4px; }
14
+ .flag_alternate .flagcategory a.flag_pic_alt { display: inline-block; margin: 1px 0 0 1px; padding: 0; height: 100px; width: 115px; line-height: 96px; position:relative; z-index: 2; text-align: center; z-index:99; 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; }
15
+ .flag_alternate .flagcategory a.flag_pic_alt > .flag_pic_desc { display: none; padding: 4px; line-height: 140%; font-size: 12px; }
16
+ .flag_alternate .flagcategory a.flag_pic_alt > .flag_pic_desc * { display: none; line-height: 140%; font-size: 12px !important; }
17
+ .flag_alternate .flagcategory a.flag_pic_alt:hover { background-color: #ffffff; border: 2px solid #4a4a4a; color: #4a4a4a; text-decoration: none; z-index: 3; }
18
+ .flag_alternate .flagcategory a.flag_pic_alt.current, .flag_alternate .flagcategory a.flag_pic_alt.last { border-color: #4a4a4a; }
19
+ .flag_alternate .flagcategory a.flag_pic_alt > img { vertical-align: middle; display:inline-block; position: static; margin: 0 auto; padding: 0; border: none; height: 100px !important; width: 115px !important; max-width: 115px; min-width: 115px; }
admin/css/tabs.css ADDED
@@ -0,0 +1,126 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #slider {
2
+ border-color:#EBEBEB rgb(204, 204, 204) rgb(204, 204, 204) rgb(235, 235, 235);
3
+ border-style:solid;
4
+ border-width:1px;
5
+ padding:2px;
6
+ margin-top:45px;
7
+
8
+ -moz-border-radius-topright: 6px;
9
+ -khtml-border-top-right-radius: 6px;
10
+ -webkit-border-top-right-radius: 6px;
11
+ border-top-right-radius: 6px;
12
+ -moz-border-radius-topleft: 6px;
13
+ -khtml-border-top-left-radius: 6px;
14
+ -webkit-border-top-left-radius: 6px;
15
+ border-top-left-radius: 6px;
16
+ }
17
+ .cptab {
18
+ display: none;
19
+ padding:0 15px;
20
+ }
21
+ .cptab h2 {margin-top:-85px; margin-bottom:45px;}
22
+
23
+ #tabs{
24
+ display: block;
25
+ background:#F1F1F1 none repeat scroll 0%;
26
+ font-size:14px;
27
+ overflow:hidden;
28
+
29
+ -moz-border-radius-topright: 6px;
30
+ -khtml-border-top-right-radius: 6px;
31
+ -webkit-border-top-right-radius: 6px;
32
+ border-top-right-radius: 6px;
33
+ -moz-border-radius-topleft: 6px;
34
+ -khtml-border-top-left-radius: 6px;
35
+ -webkit-border-top-left-radius: 6px;
36
+ border-top-left-radius: 6px;
37
+ }
38
+
39
+ .tabs {
40
+ list-style: none;
41
+ margin: 0;
42
+ padding: 0 0 0 10px;
43
+ }
44
+ .tabs:after { /* clearing without presentational markup, IE gets extra treatment */
45
+ display: block;
46
+ clear: both;
47
+ content: " ";
48
+ }
49
+ .tabs li {
50
+ float: left;
51
+ padding: 6px 5px;
52
+ min-width: 84px; /* be nice to Opera */
53
+ margin: 2px 2px 0px 1px !important;
54
+ text-decoration: none;
55
+ list-style: none;
56
+ }
57
+ .tabs a, .tabs a span {
58
+ display: block;
59
+ padding: 0 1px;
60
+ }
61
+
62
+ .tabs a {
63
+ margin: 1px 0 0; /* position: relative makes opacity fail for disabled tab in IE */
64
+ padding-left: 0;
65
+ color: #2583AD;
66
+ line-height: 1.2;
67
+ text-align: center;
68
+ text-decoration: none;
69
+ white-space: nowrap; /* required in IE 6 */
70
+ outline: 0; /* prevent dotted border in Firefox */
71
+ }
72
+ .tabs .selected{
73
+ background: #6D6D6D url(../images/menu-bits.gif) repeat-x scroll left top;
74
+ border-color: #6D6D6D;
75
+ color: #FFFFFF;
76
+ text-shadow:0 -1px 0 #666666;
77
+
78
+ -moz-border-radius-topright: 6px;
79
+ -khtml-border-top-right-radius: 6px;
80
+ -webkit-border-top-right-radius: 6px;
81
+ border-top-right-radius: 6px;
82
+ -moz-border-radius-topleft: 6px;
83
+ -khtml-border-top-left-radius: 6px;
84
+ -webkit-border-top-left-radius: 6px;
85
+ border-top-left-radius: 6px;
86
+ }
87
+
88
+ .selected a,
89
+ .selected a:hover {
90
+ color:#FFFFFF !important;
91
+ }
92
+
93
+ .tabs .selected a,
94
+ .tabs .selected a:hover {
95
+ position: relative;
96
+ top: 1px;
97
+ z-index: 2;
98
+ margin-top: 0;
99
+ }
100
+
101
+ .tabs li a:hover {
102
+ color:#D54E21;
103
+ }
104
+
105
+ .tabs .selected a, .tabs a:hover, .tabs a:focus, .tabs a:active {
106
+ background-position: 100% -150px;
107
+ }
108
+ .tabs a {
109
+ background-position: 100% -100px;
110
+ }
111
+ .tabs .selected a:link, .tabs .selected a:visited { /* @ Opera, use pseudo classes otherwise it confuses cursor... */
112
+ cursor: text;
113
+ }
114
+ .tabs a:hover, .tabs a:focus, .tabs a:active { /* @ Opera, we need to be explicit again here now... */
115
+ cursor: pointer;
116
+ }
117
+
118
+
119
+ /* Additional IE specific bug fixes... */
120
+ * html .tabs { /* auto clear, @ IE 6 & IE 7 Quirks Mode */
121
+ display: inline-block;
122
+ }
123
+ *:first-child+html .tabs { /* @ IE 7 Standards Mode - do not group selectors, otherwise IE 6 will ignore complete rule (because of the unknown + combinator)... */
124
+ display: inline-block;
125
+ }
126
+
admin/db_skin_color_scheme.php ADDED
@@ -0,0 +1,122 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ tChecked();
43
+ jQuery("#flashBacktransparent").click(tChecked);
44
+ });
45
+ </script>
46
+ <form method="POST"><div>
47
+ <?php wp_nonce_field('flag_settings'); ?>
48
+ <input type="hidden" name="page_options" value="flashBackcolor,buttonsBG,flashBacktransparent,buttonsMouseOver,buttonsMouseOut,catButtonsMouseOver,catButtonsMouseOut,catButtonsTextMouseOver,catButtonsTextMouseOut,thumbMouseOver,thumbMouseOut,mainTitle,categoryTitle,itemBG,itemTitle,itemDescription" />
49
+
50
+ <!-- Color settings -->
51
+ <h3><?php _e('Color Settings','flag'); ?></h3>
52
+ <table id="colors" class="form-table flag-options">
53
+ <tr>
54
+ <th style="width: 30%;"><?php _e('Background Color','flag'); ?>:</th>
55
+ <td><input class="colorPick" type="text" size="7" maxlength="6" id="flashBackcolor" name="flashBackcolor" value="<?php echo $flashBackcolor?>" /><div id="cp_flashBackcolor" style="background:#F9F9F9;position:absolute;display:none;"></div> <label><input type="checkbox" id="flashBacktransparent" name="flashBacktransparent" value="transparent" <?php checked('transparent', $flashBacktransparent); ?> /> transparent</label></td>
56
+ </tr>
57
+ <tr>
58
+ <th><?php _e('Buttons Background Color','flag'); ?>:</th>
59
+ <td><input class="colorPick" type="text" size="7" maxlength="6" id="buttonsBG" name="buttonsBG" value="<?php echo $buttonsBG; ?>" /><div id="cp_buttonsBG" style="background:#F9F9F9;position:absolute;display:none;"></div></td>
60
+ </tr>
61
+ <tr>
62
+ <th><?php _e('Buttons Text Color','flag'); ?>:</th>
63
+ <td>
64
+ <input class="colorPick" type="text" size="7" maxlength="6" id="buttonsMouseOver" name="buttonsMouseOver" value="<?php echo $buttonsMouseOver; ?>" /> mouseOver<br />
65
+ <div id="cp_buttonsMouseOver" style="background:#F9F9F9;position:absolute;display:none;"></div>
66
+ <input class="colorPick" type="text" size="7" maxlength="6" id="buttonsMouseOut" name="buttonsMouseOut" value="<?php echo $buttonsMouseOut; ?>" /> mouseOut<br />
67
+ <div id="cp_buttonsMouseOut" style="background:#F9F9F9;position:absolute;display:none;"></div>
68
+ </td>
69
+ </tr>
70
+ <tr>
71
+ <th><?php _e('Category Buttons Color','flag'); ?>:</th>
72
+ <td>
73
+ <input class="colorPick" type="text" size="7" maxlength="6" id="catButtonsMouseOver" name="catButtonsMouseOver" value="<?php echo $catButtonsMouseOver; ?>" /> mouseOver<br />
74
+ <div id="cp_catButtonsMouseOver" style="background:#F9F9F9;position:absolute;display:none;"></div>
75
+ <input class="colorPick" type="text" size="7" maxlength="6" id="catButtonsMouseOut" name="catButtonsMouseOut" value="<?php echo $catButtonsMouseOut; ?>" /> mouseOut<br />
76
+ <div id="cp_catButtonsMouseOut" style="background:#F9F9F9;position:absolute;display:none;"></div>
77
+ </td>
78
+ </tr>
79
+ <tr>
80
+ <th><?php _e('Category Buttons Text Color','flag'); ?>:</th>
81
+ <td>
82
+ <input class="colorPick" type="text" size="7" maxlength="6" id="catButtonsTextMouseOver" name="catButtonsTextMouseOver" value="<?php echo $catButtonsTextMouseOver; ?>" /> mouseOver<br />
83
+ <div id="cp_catButtonsTextMouseOver" style="background:#F9F9F9;position:absolute;display:none;"></div>
84
+ <input class="colorPick" type="text" size="7" maxlength="6" id="catButtonsTextMouseOut" name="catButtonsTextMouseOut" value="<?php echo $catButtonsTextMouseOut; ?>" /> mouseOut<br />
85
+ <div id="cp_catButtonsTextMouseOut" style="background:#F9F9F9;position:absolute;display:none;"></div>
86
+ </td>
87
+ </tr>
88
+ <tr>
89
+ <th><?php _e('Thumbs Rollover Color','flag'); ?>:</th>
90
+ <td>
91
+ <input class="colorPick" type="text" size="7" maxlength="6" id="thumbMouseOver" name="thumbMouseOver" value="<?php echo $thumbMouseOver; ?>" /> mouseOver<br />
92
+ <div id="cp_thumbMouseOver" style="background:#F9F9F9;position:absolute;display:none;"></div>
93
+ <input class="colorPick" type="text" size="7" maxlength="6" id="thumbMouseOut" name="thumbMouseOut" value="<?php echo $thumbMouseOut; ?>" /> mouseOut<br />
94
+ <div id="cp_thumbMouseOut" style="background:#F9F9F9;position:absolute;display:none;"></div>
95
+ </td>
96
+ </tr>
97
+ <tr>
98
+ <th><?php _e('Main Title','flag'); ?>:</th>
99
+ <td><input class="colorPick" type="text" size="7" maxlength="6" id="mainTitle" name="mainTitle" value="<?php echo $mainTitle; ?>" /><div id="cp_mainTitle" style="background:#F9F9F9;position:absolute;display:none;"></div></td>
100
+ </tr>
101
+ <tr>
102
+ <th><?php _e('Category Title','flag'); ?>:</th>
103
+ <td><input class="colorPick" type="text" size="7" maxlength="6" id="categoryTitle" name="categoryTitle" value="<?php echo $categoryTitle; ?>" /><div id="cp_categoryTitle" style="background:#F9F9F9;position:absolute;display:none;"></div></td>
104
+ </tr>
105
+ <tr>
106
+ <th><?php _e('Item Background','flag'); ?>:</th>
107
+ <td><input class="colorPick" type="text" size="7" maxlength="6" id="itemBG" name="itemBG" value="<?php echo $itemBG; ?>" /><div id="cp_itemBG" style="background:#F9F9F9;position:absolute;display:none;"></div></td>
108
+ </tr>
109
+ <tr>
110
+ <th><?php _e('Item Title','flag'); ?>:</th>
111
+ <td><input class="colorPick" type="text" size="7" maxlength="6" id="itemTitle" name="itemTitle" value="<?php echo $itemTitle; ?>" /><div id="cp_itemTitle" style="background:#F9F9F9;position:absolute;display:none;"></div></td>
112
+ </tr>
113
+ <tr>
114
+ <th><?php _e('Item Description','flag'); ?>:</th>
115
+ <td><input class="colorPick" type="text" size="7" maxlength="6" id="itemDescription" name="itemDescription" value="<?php echo $itemDescription; ?>" /><div id="cp_itemDescription" style="background:#F9F9F9;position:absolute;display:none;"></div></td>
116
+ </tr>
117
+ </table>
118
+
119
+ <div class="clear"> &nbsp; </div>
120
+ <div class="submit"><input class="button-primary" type="submit" name="updateoption" value="<?php _e('Save Changes', 'flag'); ?>"/></div>
121
+ </div></form>
122
+ <?php } ?>
admin/facebook-tool.php ADDED
@@ -0,0 +1,272 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You are not allowed to call this page directly.'); }
2
+
3
+ // check for correct capability
4
+ if ( !is_user_logged_in() )
5
+ die('-1');
6
+
7
+ // check for correct FlAG capability
8
+ if ( !current_user_can('FlAG Facebook page') )
9
+ die('-1');
10
+
11
+ if(isset($_POST['copy_file'])) {
12
+ if(copy(FLAG_ABSPATH.'facebook.php',ABSPATH.'facebook.php')) {
13
+ flagGallery::show_message(__('Success','flag'));
14
+ } else {
15
+ flagGallery::show_error(__('Failure','flag'));
16
+ }
17
+ }
18
+ global $flagdb;
19
+ require_once (dirname(__FILE__) . '/get_skin.php');
20
+ require_once (dirname(__FILE__) . '/playlist.functions.php');
21
+ require_once (dirname(__FILE__) . '/video.functions.php');
22
+ require_once (dirname(__FILE__) . '/banner.functions.php');
23
+ $i_skins = get_skins();
24
+ $all_m_playlists = get_playlists();
25
+ $all_v_playlists = get_v_playlists();
26
+ $all_b_playlists = get_b_playlists();
27
+ $fb_url = FLAG_URLPATH.'facebook.php';
28
+ if(file_exists(ABSPATH.'facebook.php')) {
29
+ $fb_url = home_url().'/facebook.php';
30
+ }
31
+ ?>
32
+ <script type="text/javascript">/*<![CDATA[*/
33
+ var url = '<?php echo $fb_url; ?>';
34
+ jQuery(document).ready(function() {
35
+ jQuery('#galleries input[value="all"]').attr('checked','checked').parent().siblings('.row').find('input').removeAttr('checked');
36
+ jQuery('#items_array').val('all');
37
+ var galleries = '?i='+jQuery('#items_array').val().split(',').join('_');
38
+ var skin = jQuery('#skinname option:selected').val();
39
+ if(skin) skin = '&f='+skin; else skin = '';
40
+ var 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
+ if(jQuery(this).is(':checked')){
47
+ var cur = jQuery(this).val();
48
+ if(cur == 'all') {
49
+ jQuery(this).parent().siblings('.row').find('input').removeAttr('checked');
50
+ jQuery('#items_array').val(cur);
51
+ } else {
52
+ jQuery('#galleries input[value="all"]').removeAttr('checked');
53
+ var arr = jQuery('#items_array').val();
54
+ if(arr && arr != 'all') { var del = ','; } else { arr = ''; var del = ''; }
55
+ jQuery('#items_array').val(arr+del+cur);
56
+ }
57
+ } else {
58
+ var cur = jQuery(this).val();
59
+ var arr = jQuery('#items_array').val().split(',');
60
+ arr = jQuery.grep(arr, function(a){ return a != cur; }).join(',');
61
+ if(arr) {
62
+ jQuery('#items_array').val(arr);
63
+ } else {
64
+ jQuery('#galleries input[value="all"]').attr('checked','checked');
65
+ jQuery('#items_array').val('all');
66
+ }
67
+ }
68
+ galleries = '?i='+jQuery('#items_array').val().split(',').join('_');
69
+ skin = jQuery('#skinname option:selected').val(); if(skin) skin = '&f='+skin; else skin = '';
70
+ h = parseInt(jQuery('#galleryheight').val()); if(h) h = '&h='+h; else h = '';
71
+ l = parseInt(jQuery('#postid').val()); if(l) l = '&l='+l; else l = '';
72
+ fb_url(galleries,skin,h,l);
73
+ });
74
+ jQuery('#skinname').change(function(){
75
+ var skin = jQuery(this).val();
76
+ if(skin) {
77
+ skin = '&f='+skin;
78
+ } else {
79
+ skin = '';
80
+ }
81
+ galleries = '?i='+jQuery('#items_array').val().split(',').join('_');
82
+ h = parseInt(jQuery('#galleryheight').val()); if(h) h = '&h='+h; else h = '';
83
+ l = parseInt(jQuery('#postid').val()); if(l) l = '&l='+l; else l = '';
84
+ fb_url(galleries,skin,h,l);
85
+ });
86
+ jQuery('#galleryheight').bind('keyup',function(){
87
+ var h = parseInt(jQuery(this).val());
88
+ if(h) {
89
+ h = '&h='+h;
90
+ } else {
91
+ h = '';
92
+ }
93
+ galleries = '?i='+jQuery('#items_array').val().split(',').join('_');
94
+ skin = jQuery('#skinname option:selected').val(); if(skin) skin = '&f='+skin; else skin = '';
95
+ l = parseInt(jQuery('#postid').val()); if(l) l = '&l='+l; else l = '';
96
+ fb_url(galleries,skin,h,l);
97
+ });
98
+ jQuery('#postid').bind('keyup',function(){
99
+ var l = parseInt(jQuery(this).val());
100
+ if(l) {
101
+ l = '&l='+l;
102
+ } else {
103
+ l = '';
104
+ }
105
+ galleries = '?i='+jQuery('#items_array').val().split(',').join('_');
106
+ skin = jQuery('#skinname option:selected').val(); if(skin) skin = '&f='+skin; else skin = '';
107
+ h = parseInt(jQuery('#galleryheight').val()); if(h) h = '&h='+h; else h = '';
108
+ fb_url(galleries,skin,h,l);
109
+ });
110
+ jQuery('#m_playlist').change(function(){
111
+ var playlist = jQuery(this).val();
112
+ if(playlist) {
113
+ playlist = '?m='+playlist;
114
+ } else {
115
+ playlist = '?m=';
116
+ }
117
+ jQuery('#fb2_url0').val(url+playlist);
118
+ });
119
+ jQuery('#v_playlist').change(function(){
120
+ var playlist = jQuery(this).val();
121
+ if(playlist) {
122
+ playlist = '?v='+playlist;
123
+ } else {
124
+ playlist = '?v=';
125
+ }
126
+ jQuery('#fb3_url0').val(url+playlist);
127
+ });
128
+ jQuery('#b_playlist').change(function(){
129
+ var playlist = jQuery(this).val();
130
+ if(playlist) {
131
+ playlist = '?b='+playlist;
132
+ } else {
133
+ playlist = '?b=';
134
+ }
135
+ jQuery('#fb4_url0').val(url+playlist);
136
+ });
137
+ });
138
+ function fb_url(galleries,skin,h,l) {
139
+ jQuery('#fb1_url0').val(url+galleries+skin+h+l);
140
+ }
141
+ /*]]>*/</script>
142
+ <div class="wrap">
143
+ <h2><?php _e('Facebook Integration', 'flag'); ?></h2>
144
+ <p>1. Log in to your <a target="_blank" href="http://www.facebook.com">Facebook</a> account.</p>
145
+ <p>2. Search for the <a href="http://apps.facebook.com/117531781690494/?ref=ts">Page Tabs: Static HTML + iFrame</a> tabs application and select it.</p>
146
+ <p>3. Click on <strong>Add Static HTML to a page</strong> button and you'll be prompted for the page where you want the app to be added.</p>
147
+ <p>4. Once added you'll see on the left side menu of your page a new tab with a star icon called Welcome. Click on it to edit it.</p>
148
+ <p>5. Add the <strong>Facebook Page Url</strong> in the text field.</p>
149
+ <p>6. Click <strong>preview</strong> to see how it looks or <strong>save changes</strong>. The product is now added to the Welcome tab of your page.</p>
150
+ <p>7. <strong>Optional:</strong> To change the tab's name, called by default <strong>Welcome</strong>, edit your page, go to the <strong>Apps</strong> tab and click <strong>Edit Settings</strong> option next to the <strong>Page Tabs: Static HTML + iFrame</strong> application to enter the name you want.</p>
151
+ <p>8. <strong>Optional:</strong> To make the tab your default landing tab (first thing your visitors see on your page) edit your page and go to the <strong>Manage Permissions</strong> tab and change the <strong>Default Landing Tab</strong>.</p>
152
+ <br /><br />
153
+ <form id="facebook_copy" name="facebook_copy" method="POST" class="alignright">
154
+ <p>Optional: &nbsp; <input type="submit" name="copy_file" class="button-primary" value="<?php _e('Copy facebook.php file to root directory', 'flag'); ?>" /><br />
155
+ (makes Facebook page url shorter)</p>
156
+ </form>
157
+ <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 Facebook Page Generator", 'flag'); ?></legend>
158
+ <table border="0" cellpadding="4" cellspacing="0">
159
+ <tr>
160
+ <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>
161
+ <td valign="top"><div id="galleries" style="width: 214px; height: 160px; overflow: auto;">
162
+ <div class="row"><input type="checkbox" value="all" checked="checked" /> <strong>* - <?php _e("all galleries", 'flag'); ?></strong></div>
163
+ <?php
164
+ $gallerylist = $flagdb->find_all_galleries('gid', 'ASC');
165
+ if(is_array($gallerylist)) {
166
+ foreach($gallerylist as $gallery) {
167
+ $name = ( empty($gallery->title) ) ? $gallery->name : $gallery->title;
168
+ echo '<div class="row"><input type="checkbox" value="' . $gallery->gid . '" /> <span>' . $gallery->gid . ' - ' . $name . '</span></div>' . "\n";
169
+ }
170
+ }
171
+ ?>
172
+ </div></td>
173
+ </tr>
174
+ <tr>
175
+ <td nowrap="nowrap" valign="top"><p style="padding-top:3px;"><?php _e("Galleries order", 'flag'); ?>: &nbsp; </p></td>
176
+ <td valign="top"><p><input readonly="readonly" type="text" id="items_array" value="all" style="width: 214px;" /></p></td>
177
+ </tr>
178
+ <tr>
179
+ <td nowrap="nowrap" valign="top"><p style="padding-top:3px;"><label for="skinname"><?php _e("Choose skin", 'flag'); ?>:</label></p></td>
180
+ <td valign="top"><p><select id="skinname" name="skinname" style="width: 214px;">
181
+ <option value="" selected="selected"><?php _e("skin active by default", 'flag'); ?></option>
182
+ <?php
183
+ foreach ( (array)$i_skins as $skin_file => $skin_data) {
184
+ echo '<option value="'.dirname($skin_file).'">'.$skin_data['Name'].'</option>'."\n";
185
+ }
186
+ ?>
187
+ </select></p></td>
188
+ </tr>
189
+ <tr>
190
+ <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>
191
+ <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>
192
+ </tr>
193
+ <tr>
194
+ <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>
195
+ <td valign="top"><p><input id="postid" type="text" /></p></td>
196
+ </tr>
197
+ <tr>
198
+ <td valign="top"><div style="padding-top:3px;"><strong><?php _e("Facebook Page Url", 'flag'); ?>: &nbsp; </strong></div></td>
199
+ <td valign="top"><input id="fb1_url0" type="text" style="width: 780px; font-size: 10px;" value="<?php echo $fb_url.'?i=all'; ?>" /></td>
200
+ </tr>
201
+ </table>
202
+ </fieldset></form>
203
+ <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 Facebook Page Generator", 'flag'); ?></legend>
204
+ <table border="0" cellpadding="4" cellspacing="0">
205
+ <tr>
206
+ <td nowrap="nowrap" valign="top"><p style="padding-top:3px;"><label><?php _e("Choose playlist", 'flag'); ?>:</label></p></td>
207
+ <td valign="top"><p><select id="m_playlist" style="width: 214px;">
208
+ <option value="" selected="selected"><?php _e('Choose playlist', 'flag'); ?></option>
209
+ <?php
210
+ foreach((array)$all_m_playlists as $playlist_file => $playlist_data) {
211
+ $playlist_name = basename($playlist_file, '.xml');
212
+ ?>
213
+ <option value="<?php echo $playlist_name; ?>"><?php echo $playlist_data['title']; ?></option>
214
+ <?php
215
+ }
216
+ ?>
217
+ </select></p></td>
218
+ </tr>
219
+ <tr>
220
+ <td valign="top"><div style="padding-top:3px;"><strong><?php _e("Facebook Page Url", 'flag'); ?>: &nbsp; </strong></div></td>
221
+ <td valign="top"><input id="fb2_url0" type="text" style="width: 600px; font-size: 10px;" value="<?php echo $fb_url.'?m='; ?>" /></td>
222
+ </tr>
223
+ </table>
224
+ </fieldset></form>
225
+ <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 Facebook Page Generator", 'flag'); ?></legend>
226
+ <table border="0" cellpadding="4" cellspacing="0">
227
+ <tr>
228
+ <td nowrap="nowrap" valign="top"><p style="padding-top:3px;"><label><?php _e("Choose playlist", 'flag'); ?>:</label></p></td>
229
+ <td valign="top"><p><select id="v_playlist" style="width: 214px;">
230
+ <option value="" selected="selected"><?php _e('Choose playlist', 'flag'); ?></option>
231
+ <?php
232
+ foreach((array)$all_v_playlists as $playlist_file => $playlist_data) {
233
+ $playlist_name = basename($playlist_file, '.xml');
234
+ ?>
235
+ <option value="<?php echo $playlist_name; ?>"><?php echo $playlist_data['title']; ?></option>
236
+ <?php
237
+ }
238
+ ?>
239
+ </select></p></td>
240
+ </tr>
241
+ <tr>
242
+ <td valign="top"><div style="padding-top:3px;"><strong><?php _e("Facebook Page Url", 'flag'); ?>: &nbsp; </strong></div></td>
243
+ <td valign="top"><input id="fb3_url0" type="text" style="width: 600px; font-size: 10px;" value="<?php echo $fb_url.'?v='; ?>" /></td>
244
+ </tr>
245
+ </table>
246
+ </fieldset></form>
247
+ <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 Facebook Page Generator", 'flag'); ?></legend>
248
+ <table border="0" cellpadding="4" cellspacing="0">
249
+ <tr>
250
+ <td nowrap="nowrap" valign="top"><p style="padding-top:3px;"><label><?php _e("Choose xml", 'flag'); ?>:</label></p></td>
251
+ <td valign="top"><p><select id="b_playlist" style="width: 214px;">
252
+ <option value="" selected="selected"><?php _e('Choose XML', 'flag'); ?></option>
253
+ <?php
254
+ foreach((array)$all_b_playlists as $playlist_file => $playlist_data) {
255
+ $playlist_name = basename($playlist_file, '.xml');
256
+ ?>
257
+ <option value="<?php echo $playlist_name; ?>"><?php echo $playlist_data['title']; ?></option>
258
+ <?php
259
+ }
260
+ ?>
261
+ </select></p></td>
262
+ </tr>
263
+ <tr>
264
+ <td valign="top"><div style="padding-top:3px;"><strong><?php _e("Facebook Page Url", 'flag'); ?>: &nbsp; </strong></div></td>
265
+ <td valign="top"><input id="fb4_url0" type="text" style="width: 600px; font-size: 10px;" value="<?php echo $fb_url.'?b='; ?>" /></td>
266
+ </tr>
267
+ </table>
268
+ </fieldset></form>
269
+ </div>
270
+ <?php
271
+
272
+ ?>
admin/flag_install.php ADDED
@@ -0,0 +1,330 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 ( version_compare(mysql_get_server_info(), '4.1.0', '>=') ) {
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 ,
46
+ description MEDIUMTEXT NULL ,
47
+ alttext MEDIUMTEXT NULL ,
48
+ imagedate DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
49
+ exclude TINYINT NULL DEFAULT '0',
50
+ sortorder BIGINT(20) DEFAULT '0' NOT NULL ,
51
+ location TEXT,
52
+ city TINYTEXT,
53
+ state TINYTEXT,
54
+ country TINYTEXT,
55
+ credit TEXT,
56
+ copyright TEXT,
57
+ commentson INT(1) UNSIGNED NOT NULL DEFAULT '1',
58
+ hitcounter INT(11) UNSIGNED DEFAULT '0',
59
+ total_value INT(11) UNSIGNED DEFAULT '0',
60
+ total_votes INT(11) UNSIGNED DEFAULT '0',
61
+ used_ips LONGTEXT,
62
+ meta_data LONGTEXT,
63
+ PRIMARY KEY pid (pid)
64
+ ) $charset_collate;";
65
+
66
+ dbDelta($sql);
67
+ }
68
+
69
+
70
+ if($wpdb->get_var("show tables like '$flagallery'") != $flaggallery) {
71
+
72
+ $sql = "CREATE TABLE " . $flaggallery . " (
73
+ gid BIGINT(20) NOT NULL AUTO_INCREMENT ,
74
+ name VARCHAR(255) NOT NULL ,
75
+ path MEDIUMTEXT NULL ,
76
+ title MEDIUMTEXT NULL ,
77
+ galdesc MEDIUMTEXT NULL ,
78
+ previewpic BIGINT(20) NULL DEFAULT '0' ,
79
+ sortorder BIGINT(20) DEFAULT '0' NOT NULL ,
80
+ author BIGINT(20) NOT NULL DEFAULT '0' ,
81
+ PRIMARY KEY gid (gid)
82
+ ) $charset_collate;";
83
+
84
+ dbDelta($sql);
85
+ }
86
+
87
+ if($wpdb->get_var("show tables like '$flagcomments'") != $flagcomments) {
88
+ $sql = "CREATE TABLE " . $flagcomments . " (
89
+ cid int(11) unsigned NOT NULL auto_increment,
90
+ ownerid int(11) unsigned NOT NULL default '0',
91
+ name varchar(255) NOT NULL default '',
92
+ email varchar(255) NOT NULL default '',
93
+ website varchar(255) default NULL,
94
+ date datetime default NULL,
95
+ comment text,
96
+ inmoderation int(1) unsigned NOT NULL default '0',
97
+ PRIMARY KEY (cid),
98
+ KEY ownerid (ownerid)
99
+ ) $charset_collate;";
100
+
101
+ dbDelta($sql);
102
+ }
103
+
104
+ if( !$wpdb->get_var( "SHOW TABLES LIKE '$flagalbum'" )) {
105
+
106
+ $sql = "CREATE TABLE " . $flagalbum . " (
107
+ id BIGINT(20) NOT NULL AUTO_INCREMENT ,
108
+ name VARCHAR(255) NOT NULL ,
109
+ previewpic BIGINT(20) DEFAULT '0' NOT NULL ,
110
+ albumdesc MEDIUMTEXT NULL ,
111
+ categories LONGTEXT NOT NULL,
112
+ PRIMARY KEY id (id)
113
+ ) $charset_collate;";
114
+
115
+ dbDelta($sql);
116
+ }
117
+
118
+
119
+ // check one table again, to be sure
120
+ if( !$wpdb->get_var( "SHOW TABLES LIKE '$flagpictures'" ) ) {
121
+ update_option( "flag_init_check", __('Flash Album Gallery : Tables could not created, please check your database settings','flag') );
122
+ return;
123
+ }
124
+
125
+ $options = get_option('flag_options');
126
+ // set the default settings, if we didn't upgrade
127
+ if ( empty( $options ) )
128
+ flag_default_options();
129
+
130
+
131
+ // if all is passed , save the VERSIONs
132
+ add_option("flag_db_version", FLAG_DBVERSION);
133
+ add_option("flagVersion", FLAGVERSION);
134
+ }
135
+
136
+ function flag_capabilities() {
137
+ global $wp_roles;
138
+
139
+ // Set the capabilities for the administrator
140
+ $role = get_role('administrator');
141
+ // We need this role, no other chance
142
+ if ( empty($role) ) {
143
+ update_option( "flag_init_check", __('Sorry, Flash Album Gallery works only with a role called administrator','flag') );
144
+ return;
145
+ }
146
+
147
+ $role->add_cap('FlAG overview');
148
+ $role->add_cap('FlAG Use TinyMCE');
149
+ $role->add_cap('FlAG Upload images');
150
+ $role->add_cap('FlAG Import folder');
151
+ $role->add_cap('FlAG Manage gallery');
152
+ $role->add_cap('FlAG Manage others gallery');
153
+ $role->add_cap('FlAG Change skin');
154
+ $role->add_cap('FlAG Add skins');
155
+ $role->add_cap('FlAG Delete skins');
156
+ $role->add_cap('FlAG Change options');
157
+ $role->add_cap('FlAG Manage music');
158
+ $role->add_cap('FlAG Manage video');
159
+ $role->add_cap('FlAG Manage banners');
160
+ $role->add_cap('FlAG Facebook page');
161
+
162
+ }
163
+
164
+ /**
165
+ * Setup the default option array for the gallery
166
+ *
167
+ * @access internal
168
+ * @return void
169
+ */
170
+ function flag_default_options() {
171
+
172
+ global $blog_id, $flag;
173
+
174
+ $flag_options = flag_list_options();
175
+ // special overrides for WPMU
176
+ if (IS_WPMU) {
177
+ // get the site options
178
+ $flag_wpmu_options = get_site_option('flag_options');
179
+ // get the default value during installation
180
+ //if (!is_array($flag_wpmu_options)) {
181
+ //$flag_wpmu_options['galleryPath'] = 'wp-content/blogs.dir/%BLOG_ID%/files/';
182
+ update_site_option('flag_options', $flag_wpmu_options);
183
+ //}
184
+ //$flag_options['galleryPath'] = str_replace("%BLOG_ID%", $blog_id , $flag_wpmu_options['galleryPath']);
185
+ }
186
+
187
+ update_option('flag_options', $flag_options);
188
+
189
+ }
190
+
191
+ function flag_list_options() {
192
+ $flag_options['galleryPath'] = 'wp-content/flagallery/'; // set default path to the gallery
193
+ $flag_options['swfUpload'] = true; // activate the batch upload
194
+ $flag_options['deleteImg'] = true; // delete Images
195
+ $flag_options['deepLinks'] = true;
196
+ $flag_options['access_key'] = '';
197
+ $flag_options['license_key'] = '';
198
+ $flag_options['useMediaRSS'] = false; // activate the global Media RSS file
199
+
200
+ // Sort Settings
201
+ $flag_options['galSort'] = 'sortorder'; // Sort order
202
+ $flag_options['galSortDir'] = 'ASC'; // Sort direction
203
+
204
+ // Flash settings
205
+ $flag_options['skinsDirABS'] = str_replace("\\","/", WP_PLUGIN_DIR . '/flagallery-skins/' );
206
+ $flag_options['skinsDirURL'] = WP_PLUGIN_URL . '/flagallery-skins/';
207
+ $flag_options['flashSkin'] = 'default';
208
+ $flag_options['flashWidth'] = '100%';
209
+ $flag_options['flashHeight'] = '500';
210
+
211
+ // Image Settings
212
+ $flag_options['imgWidth'] = 800; // Image Width
213
+ $flag_options['imgHeight'] = 600; // Image height
214
+ $flag_options['imgQuality'] = 85; // Image Quality
215
+
216
+ // Thumbnail Settings
217
+ $flag_options['thumbWidth'] = 220; // Thumb Width
218
+ $flag_options['thumbHeight'] = 220; // Thumb height
219
+ $flag_options['thumbFix'] = true; // Fix the dimension
220
+ $flag_options['thumbQuality'] = 100; // Thumb Quality
221
+
222
+ // Flash default skin colors settings
223
+ $flag_options['flashBacktransparent'] = false;
224
+ $flag_options['flashBackcolor'] = '262626';
225
+ $flag_options['buttonsBG'] = '000000';
226
+ $flag_options['buttonsMouseOver'] = '7485c2';
227
+ $flag_options['buttonsMouseOut'] = '717171';
228
+ $flag_options['catButtonsMouseOver'] = '000000';
229
+ $flag_options['catButtonsMouseOut'] = '000000';
230
+ $flag_options['catButtonsTextMouseOver']= '7485c2';
231
+ $flag_options['catButtonsTextMouseOut'] = 'bcbcbc';
232
+ $flag_options['thumbMouseOver'] = '7485c2';
233
+ $flag_options['thumbMouseOut'] = '000000';
234
+ $flag_options['mainTitle'] = 'ffffff';
235
+ $flag_options['categoryTitle'] = '7485c2';
236
+ $flag_options['itemBG'] = 'eae6ef';
237
+ $flag_options['itemTitle'] = '7485c2';
238
+ $flag_options['itemDescription'] = 'e0e0e0';
239
+
240
+ // Alternative gallery colors
241
+ $flag_options['jAlterGal'] = true;
242
+ $flag_options['jAlterGalScript'] = 1; // If '0' - use FancyBox script
243
+ $flag_options['BarsBG'] = '292929';
244
+ $flag_options['CatBGColor'] = '292929';
245
+ $flag_options['CatBGColorOver'] = '737373';
246
+ $flag_options['CatColor'] = 'ffffff';
247
+ $flag_options['CatColorOver'] = 'ffffff';
248
+ $flag_options['ThumbBG'] = 'ffffff';
249
+ $flag_options['ThumbLoaderColor'] = '4a4a4a';
250
+ $flag_options['TitleColor'] = 'ff9900';
251
+ $flag_options['DescrColor'] = 'cfcfcf';
252
+
253
+ // Single player colors
254
+ $flag_options['videoBG'] = '000000';
255
+ $flag_options['vmColor1'] = 'ffffff';
256
+ $flag_options['vmColor2'] = '3283A7';
257
+ $flag_options['vmAutoplay'] = 'true';
258
+ $flag_options['vmWidth'] = '520';
259
+ $flag_options['vmHeight'] = '304';
260
+
261
+ $flag_options['mpBG'] = '4f4f4f';
262
+ $flag_options['mpColor1'] = 'ffffff';
263
+ $flag_options['mpColor2'] = '3283A7';
264
+ $flag_options['mpAutoplay'] = 'false';
265
+
266
+ $flag_options['advanced'] = false; // Advanced options
267
+
268
+ return $flag_options;
269
+ }
270
+
271
+ /**
272
+ * Deregister a capability from all classic roles
273
+ *
274
+ * @access internal
275
+ * @param string $capability name of the capability which should be deregister
276
+ * @return void
277
+ */
278
+ function flag_remove_capability($capability){
279
+ // this function remove the $capability only from the classic roles
280
+ $check_order = array("subscriber", "contributor", "author", "editor", "administrator");
281
+
282
+ foreach ($check_order as $role) {
283
+
284
+ $role = get_role($role);
285
+ $role->remove_cap($capability) ;
286
+ }
287
+
288
+ }
289
+
290
+ /**
291
+ * Uninstall all settings and tables
292
+ * Called via Setup and register_unstall hook
293
+ *
294
+ * @access internal
295
+ * @return void
296
+ */
297
+ function flag_uninstall() {
298
+ global $wpdb;
299
+
300
+ // first remove all tables
301
+ $wpdb->query("DROP TABLE IF EXISTS {$wpdb->prefix}flag_pictures");
302
+ $wpdb->query("DROP TABLE IF EXISTS {$wpdb->prefix}flag_gallery");
303
+ $wpdb->query("DROP TABLE IF EXISTS {$wpdb->prefix}flag_comments");
304
+ $wpdb->query("DROP TABLE IF EXISTS {$wpdb->prefix}flag_album");
305
+
306
+ // then remove all options
307
+ delete_option( 'flag_options' );
308
+ delete_option( 'flag_db_version' );
309
+ delete_option( 'flagVersion' );
310
+
311
+ // now remove the capability
312
+ flag_remove_capability("FlAG overview");
313
+ flag_remove_capability("FlAG Use TinyMCE");
314
+ flag_remove_capability("FlAG Upload images");
315
+ flag_remove_capability("FlAG Import folder");
316
+ flag_remove_capability("FlAG Manage gallery");
317
+ flag_remove_capability('FlAG Manage others gallery');
318
+ flag_remove_capability("FlAG Change skin");
319
+ flag_remove_capability('FlAG Add skins');
320
+ flag_remove_capability('FlAG Delete skins');
321
+ flag_remove_capability("FlAG Change options");
322
+ flag_remove_capability("FlAG Manage music");
323
+ flag_remove_capability("FlAG Manage video");
324
+ flag_remove_capability("FlAG Manage banners");
325
+ flag_remove_capability("FlAG Facebook page");
326
+ }
327
+
328
+
329
+
330
+ ?>
admin/flv_preview.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ preg_match('|^(.*?/)(wp-content)/|i', str_replace('\\', '/', __FILE__), $_m);
3
+ require_once( $_m[1] . 'wp-load.php');
4
+ // check for correct capability
5
+ if ( !is_user_logged_in() )
6
+ die('-1');
7
+
8
+ // check for correct FlAG capability
9
+ if ( !current_user_can('FlAG Manage video') )
10
+ die('-1'); ?>
11
+ <html>
12
+ <head>
13
+ <title>Preview Video</title>
14
+ <script type="text/javascript" src="<?php echo FLAG_URLPATH; ?>admin/js/swfobject.js"></script>
15
+ </head>
16
+ <body style="margin: 0; padding: 0; background: #555555; overflow: hidden;">
17
+ <?php echo flagShowVmPlayer($_GET['vid'], $w='520', $h='304', $autoplay=true); ?>
18
+ </body>
19
+ </html>
admin/functions.php ADDED
@@ -0,0 +1,1316 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You are not allowed to call this page directly.'); }
4
+
5
+ /**
6
+ * flagAdmin - Class for admin operation
7
+ */
8
+ class flagAdmin{
9
+
10
+ /**
11
+ * create a new gallery & folder
12
+ *
13
+ * @class flagAdmin
14
+ * @param string $gallerytitle
15
+ * @param string $defaultpath
16
+ * @param bool $output if the function should show an error messsage or not
17
+ * @return
18
+ */
19
+ function create_gallery($gallerytitle, $defaultpath, $output = true) {
20
+ global $wpdb, $user_ID;
21
+
22
+ // get the current user ID
23
+ get_currentuserinfo();
24
+
25
+ //cleanup pathname
26
+ $galleryname = sanitize_file_name( $gallerytitle );
27
+ $galleryname = apply_filters('flag_gallery_name', $galleryname);
28
+ $galleryname = preg_replace('/[^\w\._-]+/', '', $galleryname);
29
+ if(!$galleryname) $galleryname = date('y-m-j_h-i-s');
30
+
31
+ $flagpath = $defaultpath . $galleryname;
32
+ $flagRoot = WINABSPATH . $defaultpath;
33
+ $txt = '';
34
+
35
+ // No gallery name ?
36
+ if (empty($galleryname)) {
37
+ if ($output) flagGallery::show_error( __('No valid gallery name!', 'flag') );
38
+ return false;
39
+ }
40
+
41
+ // check for main folder
42
+ if ( !is_dir($flagRoot) ) {
43
+ if ( !wp_mkdir_p( $flagRoot ) ) {
44
+ $txt = __('Directory', 'flag').' <strong>' . $defaultpath . '</strong> '.__('didn\'t exist. Please create first the main gallery folder ', 'flag').'!<br />';
45
+ $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> ';
46
+ if ($output) flagGallery::show_error($txt);
47
+ return false;
48
+ }
49
+ }
50
+
51
+ // check for permission settings, Safe mode limitations are not taken into account.
52
+ if ( !is_writeable( $flagRoot ) ) {
53
+ $txt = __('Directory', 'flag').' <strong>' . $defaultpath . '</strong> '.__('is not writeable !', 'flag').'<br />';
54
+ $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> ';
55
+ if ($output) flagGallery::show_error($txt);
56
+ return false;
57
+ }
58
+
59
+ // 1. Create new gallery folder
60
+ if ( !is_dir(WINABSPATH . $flagpath) ) {
61
+ if ( !wp_mkdir_p (WINABSPATH . $flagpath) )
62
+ $txt = __('Unable to create directory ', 'flag').$flagpath.'!<br />';
63
+ }
64
+
65
+ // 2. Check folder permission
66
+ if ( !is_writeable(WINABSPATH . $flagpath ) )
67
+ $txt .= __('Directory', 'flag').' <strong>'.$flagpath.'</strong> '.__('is not writeable !', 'flag').'<br />';
68
+
69
+ // 3. Now create "thumbs" folder inside
70
+ if ( !is_dir(WINABSPATH . $flagpath . '/thumbs') ) {
71
+ if ( !wp_mkdir_p ( WINABSPATH . $flagpath . '/thumbs') )
72
+ $txt .= __('Unable to create directory ', 'flag').' <strong>' . $flagpath . '/thumbs !</strong>';
73
+ }
74
+
75
+ if (SAFE_MODE) {
76
+ $help = __('The server setting Safe-Mode is on !', 'flag');
77
+ $help .= '<br />'.__('If you have problems, please create directory', 'flag').' <strong>' . $flagpath . '</strong> ';
78
+ $help .= __('and the thumbnails directory', 'flag').' <strong>' . $flagpath . '/thumbs</strong> '.__('with permission 777 manually !', 'flag');
79
+ if ($output) flagGallery::show_message($help);
80
+ }
81
+
82
+ // show an error message
83
+ if ( !empty($txt) ) {
84
+ if (SAFE_MODE) {
85
+ // for safe_mode , better delete folder, both folder must be created manually
86
+ @rmdir(WINABSPATH . $flagpath . '/thumbs');
87
+ @rmdir(WINABSPATH . $flagpath);
88
+ }
89
+ if ($output) flagGallery::show_error($txt);
90
+ return false;
91
+ }
92
+
93
+ $result = $wpdb->get_var("SELECT name FROM $wpdb->flaggallery WHERE name = '$galleryname' ");
94
+
95
+ if ($result) {
96
+ if ($output) flagGallery::show_error( __ngettext( 'Gallery', 'Galleries', 1, 'flag' ) .' <strong>' . $galleryname . '</strong> '.__('already exists', 'flag'));
97
+ return false;
98
+ } else {
99
+ $result = $wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->flaggallery (name, path, title, author) VALUES (%s, %s, %s, %s)", $galleryname, $flagpath, $gallerytitle , $user_ID) );
100
+ // and give me the new id
101
+ $gallery_id = (int) $wpdb->insert_id;
102
+ // here you can inject a custom function
103
+ do_action('flag_created_new_gallery', $gallery_id);
104
+
105
+ // return only the id if defined
106
+ if ($return_id)
107
+ return $gallery_id;
108
+
109
+ if ($result) {
110
+ $message = __('Gallery \'%1$s\' successfully created.<br/>You can show this gallery with the tag %2$s.<br/>','flag');
111
+ $message = sprintf($message, stripcslashes($gallerytitle), '[flagallery gid=' . $gallery_id . ' name="' . stripcslashes($gallerytitle) . '"]');
112
+ $message .= '<a href="' . admin_url() . 'admin.php?page=flag-manage-gallery&mode=edit&gid=' . $gallery_id . '" >';
113
+ $message .= __('Edit gallery','flag');
114
+ $message .= '</a>';
115
+
116
+ if ($output) flagGallery::show_message($message);
117
+ }
118
+ return true;
119
+ }
120
+ }
121
+
122
+ /**
123
+ * flagAdmin::import_gallery()
124
+ * TODO: Check permission of existing thumb folder & images
125
+ *
126
+ * @class flagAdmin
127
+ * @param string $galleryfolder contains relative path
128
+ * @return
129
+ */
130
+ function import_gallery($galleryfolder) {
131
+
132
+ global $wpdb, $user_ID;
133
+
134
+ // get the current user ID
135
+ get_currentuserinfo();
136
+
137
+ $created_msg = '';
138
+
139
+ // remove trailing slash at the end, if somebody use it
140
+ $galleryfolder = rtrim($galleryfolder, '/');
141
+ $gallerypath = WINABSPATH . $galleryfolder;
142
+
143
+ if (!is_dir($gallerypath)) {
144
+ flagGallery::show_error(__('Directory', 'flag').' <strong>'.$gallerypath.'</strong> '.__('doesn&#96;t exist!', 'flag'));
145
+ return ;
146
+ }
147
+
148
+ // read list of images
149
+ $new_imageslist = flagAdmin::scandir($gallerypath);
150
+ if (empty($new_imageslist)) {
151
+ flagGallery::show_message(__('Directory', 'flag').' <strong>'.$gallerypath.'</strong> '.__('contains no pictures', 'flag'));
152
+ return;
153
+ }
154
+
155
+ // check & create thumbnail folder
156
+ if ( !flagGallery::get_thumbnail_folder($gallerypath) )
157
+ return;
158
+
159
+ // take folder name as gallery name
160
+ $galleryname = basename($galleryfolder);
161
+ $galleryname = apply_filters('flag_gallery_name', $galleryname);
162
+
163
+ // check for existing gallery folder
164
+ $gallery_id = $wpdb->get_var("SELECT gid FROM $wpdb->flaggallery WHERE path = '$galleryfolder' ");
165
+
166
+ if (!$gallery_id) {
167
+ $result = $wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->flaggallery (name, path, title, author) VALUES (%s, %s, %s, %s)", $galleryname, $galleryfolder, $galleryname , $user_ID) );
168
+ if (!$result) {
169
+ flagGallery::show_error(__('Database error. Could not add gallery!','flag'));
170
+ return;
171
+ }
172
+ $created_msg = __ngettext( 'Gallery', 'Galleries', 1, 'flag' ) . ' <strong>' . $galleryname . '</strong> ' . __('successfully created!','flag') . '<br />';
173
+ $gallery_id = $wpdb->insert_id; // get index_id
174
+ }
175
+
176
+ // Look for existing image list
177
+ $old_imageslist = $wpdb->get_col("SELECT filename FROM $wpdb->flagpictures WHERE galleryid = '$gallery_id' ");
178
+
179
+ // if no images are there, create empty array
180
+ if ($old_imageslist == NULL)
181
+ $old_imageslist = array();
182
+
183
+ // check difference
184
+ $new_images = array_diff($new_imageslist, $old_imageslist);
185
+
186
+ // all images must be valid files
187
+ foreach($new_images as $key => $picture) {
188
+ if (!@getimagesize($gallerypath . '/' . $picture) ) {
189
+ unset($new_images[$key]);
190
+ @unlink($gallerypath . '/' . $picture);
191
+ }
192
+ }
193
+
194
+ // add images to database
195
+ $image_ids = flagAdmin::add_Images($gallery_id, $new_images);
196
+
197
+ //add the preview image if needed
198
+ flagAdmin::set_gallery_preview ( $gallery_id );
199
+
200
+ // now create thumbnails
201
+ flagAdmin::do_ajax_operation( 'create_thumbnail' , $image_ids, __('Create new thumbnails','flag') );
202
+
203
+ //TODO:Message will not shown, because AJAX routine require more time, message should be passed to AJAX
204
+ flagGallery::show_message( $created_msg . count($image_ids) .__(' picture(s) successfully added','flag') );
205
+
206
+ return;
207
+
208
+ }
209
+
210
+ /**
211
+ * flagAdmin::import_video()
212
+ *
213
+ * @class flagAdmin
214
+ * @param string $folder contains relative path
215
+ * @return
216
+ */
217
+ function import_video($folder) {
218
+ global $wpdb, $user_ID;
219
+
220
+ $created_msg = '';
221
+ // remove trailing slash at the end, if somebody use it
222
+ $folder = rtrim($folder, '/');
223
+ $path = WINABSPATH . $folder;
224
+ if (!is_dir($path)) {
225
+ echo '<p class="message">'.__('Directory', 'flag').' <strong>'.$path.'</strong> '.__('doesn&#96;t exist!', 'flag').'</p>';
226
+ return ;
227
+ }
228
+ // read list of files
229
+ $ext = array('flv');
230
+ $new_filelist = flagAdmin::scandir($path, $ext);
231
+ if (empty($new_filelist)) {
232
+ echo '<p class="message">'.__('Directory', 'flag').' <strong>'.$path.'</strong> '.__('does not contain flv files', 'flag').'</p>';
233
+ return;
234
+ }
235
+ $i=0;
236
+ foreach($new_filelist as $key => $file) {
237
+ //$new_filelist[$key] = $path . '/' . $file;
238
+ $filename = $path . '/' . $file;
239
+ $id = flagAdmin::handle_import_file($filename);
240
+ if ( is_wp_error($id) ) {
241
+ $created_msg .= '<p>' . sprintf(__('<em>%s</em> was <strong>not</strong> imported due to an error: %s', 'flag'), $file, $id->get_error_message() ) . '</p>';
242
+ } else {
243
+ $i++;
244
+ $created_msg .= '<p>' . sprintf(__('<em>%s</em> has been added to Media library', 'flag'), $file) . '</p>';
245
+ }
246
+ }
247
+ $created_msg .= '<p class="message">'.$i.__(' file(s) successfully added','flag').'</p><div class="hidden">'.$created_msg.'</div>';
248
+ echo $created_msg;
249
+ }
250
+
251
+ /**
252
+ * flagAdmin::import_mp3()
253
+ *
254
+ * @class flagAdmin
255
+ * @param string $folder contains relative path
256
+ * @return
257
+ */
258
+ function import_mp3($folder) {
259
+ global $wpdb, $user_ID;
260
+
261
+ $created_msg = '';
262
+ // remove trailing slash at the end, if somebody use it
263
+ $folder = rtrim($folder, '/');
264
+ $path = WINABSPATH . $folder;
265
+ if (!is_dir($path)) {
266
+ echo '<p class="message">'.__('Directory', 'flag').' <strong>'.$path.'</strong> '.__('doesn&#96;t exist!', 'flag').'</p>';
267
+ return ;
268
+ }
269
+ // read list of files
270
+ $ext = array('mp3');
271
+ $new_filelist = flagAdmin::scandir($path, $ext);
272
+ if (empty($new_filelist)) {
273
+ echo '<p class="message">'.__('Directory', 'flag').' <strong>'.$path.'</strong> '.__('does not contain mp3 files', 'flag').'</p>';
274
+ return;
275
+ }
276
+ $i=0;
277
+ foreach($new_filelist as $key => $file) {
278
+ //$new_filelist[$key] = $path . '/' . $file;
279
+ $filename = $path . '/' . $file;
280
+ $id = flagAdmin::handle_import_file($filename);
281
+ if ( is_wp_error($id) ) {
282
+ $created_msg .= '<p>' . sprintf(__('<em>%s</em> was <strong>not</strong> imported due to an error: %s', 'flag'), $file, $id->get_error_message() ) . '</p>';
283
+ } else {
284
+ $i++;
285
+ $created_msg .= '<p>' . sprintf(__('<em>%s</em> has been added to Media library', 'flag'), $file) . '</p>';
286
+ }
287
+ }
288
+ $created_msg .= '<p class="message">'.$i.__(' file(s) successfully added','flag').'</p><div class="hidden">'.$created_msg.'</div>';
289
+ echo $created_msg;
290
+ }
291
+
292
+ /**
293
+ * flagAdmin::import_banner()
294
+ *
295
+ * @class flagAdmin
296
+ * @param string $folder contains relative path
297
+ * @return
298
+ */
299
+ function import_banner($folder) {
300
+ global $wpdb, $user_ID;
301
+
302
+ $created_msg = '';
303
+ // remove trailing slash at the end, if somebody use it
304
+ $folder = rtrim($folder, '/');
305
+ $path = WINABSPATH . $folder;
306
+ if (!is_dir($path)) {
307
+ echo '<p class="message">'.__('Directory', 'flag').' <strong>'.$path.'</strong> '.__('doesn&#96;t exist!', 'flag').'</p>';
308
+ return ;
309
+ }
310
+ // read list of files
311
+ $new_filelist = flagAdmin::scandir($path);
312
+ if (empty($new_filelist)) {
313
+ echo '<p class="message">'.__('Directory', 'flag').' <strong>'.$path.'</strong> '.__('does not contain image files', 'flag').'</p>';
314
+ return;
315
+ }
316
+ $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>';
317
+ echo $created_msg;
318
+ return $new_filelist;
319
+ }
320
+
321
+ //Handle an individual file import.
322
+ function handle_import_file($file, $post_id = 0) {
323
+ set_time_limit(120);
324
+ $time = current_time('mysql');
325
+ if ( $post = get_post($post_id) ) {
326
+ if ( substr( $post->post_date, 0, 4 ) > 0 )
327
+ $time = $post->post_date;
328
+ }
329
+
330
+ // A writable uploads dir will pass this test. Again, there's no point overriding this one.
331
+ if ( ! ( ( $uploads = wp_upload_dir($time) ) && false === $uploads['error'] ) )
332
+ return new WP_Error($uploads['error']);
333
+
334
+ $wp_filetype = wp_check_filetype( $file, null );
335
+
336
+ extract( $wp_filetype );
337
+
338
+ if ( ( !$type || !$ext ) && !current_user_can( 'unfiltered_upload' ) )
339
+ return new WP_Error('wrong_file_type', __( 'File type does not meet security guidelines. Try another.' ) ); //A WP-core string..
340
+
341
+ $match = preg_match('|^' . preg_quote(str_replace('\\', '/', $uploads['basedir'])) . '(.*)$|i', $file, $mat);
342
+ //Is the file allready in the uploads folder?
343
+ if( $match ) {
344
+
345
+ $filename = basename($file);
346
+ $new_file = $file;
347
+
348
+ $url = $uploads['baseurl'] . $mat[1];
349
+
350
+ $attachment = get_posts(array( 'post_type' => 'attachment', 'meta_key' => '_wp_attached_file', 'meta_value' => $uploads['subdir'] . '/' . $filename ));
351
+ if ( !empty($attachment) )
352
+ return $attachments[0]->ID;
353
+
354
+ //Ok, Its in the uploads folder, But NOT in WordPress's media library.
355
+ if ( preg_match("|(\d+)/(\d+)|", $mat[1], $datemat) ) //So lets set the date of the import to the date folder its in, IF its in a date folder.
356
+ $time = mktime(0, 0, 0, $datemat[2], 1, $datemat[1]);
357
+ else //Else, set the date based on the date of the files time.
358
+ $time = @filemtime($file);
359
+
360
+ if ( $time ) {
361
+ $post_date = date( 'Y-m-d H:i:s', $time);
362
+ $post_date_gmt = gmdate( 'Y-m-d H:i:s', $time);
363
+ }
364
+ } else {
365
+ $filename = wp_unique_filename( $uploads['path'], basename($file));
366
+
367
+ // copy the file to the uploads dir
368
+ $new_file = $uploads['path'] . '/' . $filename;
369
+ if ( false === @copy( $file, $new_file ) )
370
+ wp_die(sprintf( __('The selected file could not be copied to %s.', 'flag'), $uploads['path']));
371
+
372
+ // Set correct file permissions
373
+ $stat = stat( dirname( $new_file ));
374
+ $perms = $stat['mode'] & 0000666;
375
+ @ chmod( $new_file, $perms );
376
+ // Compute the URL
377
+ $url = $uploads['url'] . '/' . rawurlencode($filename);
378
+ }
379
+
380
+ // Compute the URL
381
+ //Apply upload filters
382
+ $return = apply_filters( 'wp_handle_upload', array( 'file' => $new_file, 'url' => $url, 'type' => $type ) );
383
+ $new_file = $return['file'];
384
+ $url = $return['url'];
385
+ $type = $return['type'];
386
+
387
+ $title = preg_replace('!\.[^.]+$!', '', basename($file));
388
+ $content = '';
389
+
390
+ // use image exif/iptc data for title and caption defaults if possible
391
+ if ( $image_meta = @wp_read_image_metadata($new_file) ) {
392
+ if ( '' != trim($image_meta['title']) )
393
+ $title = trim($image_meta['title']);
394
+ if ( '' != trim($image_meta['caption']) )
395
+ $content = trim($image_meta['caption']);
396
+ }
397
+
398
+ if ( empty($post_date) )
399
+ $post_date = current_time('mysql');
400
+ if ( empty($post_date_gmt) )
401
+ $post_date_gmt = current_time('mysql', 1);
402
+
403
+ // Construct the attachment array
404
+ $attachment = array(
405
+ 'post_mime_type' => $type,
406
+ 'guid' => $url,
407
+ 'post_parent' => $post_id,
408
+ 'post_title' => $title,
409
+ 'post_name' => $title,
410
+ 'post_content' => $content,
411
+ 'post_date' => $post_date,
412
+ 'post_date_gmt' => $post_date_gmt
413
+ );
414
+
415
+ // Save the data
416
+ $id = wp_insert_attachment($attachment, $new_file, $post_id);
417
+ if ( !is_wp_error($id) ) {
418
+ $data = wp_generate_attachment_metadata( $id, $new_file );
419
+ wp_update_attachment_metadata( $id, $data );
420
+ if( !$match && isset($_POST['delete_files']) ) {
421
+ @unlink($file);
422
+ }
423
+ }
424
+
425
+ return $id;
426
+ }
427
+
428
+ /**
429
+ * flagAdmin::scandir()
430
+ *
431
+ * @class flagAdmin
432
+ * @param string $dirname
433
+ * @return array
434
+ */
435
+ function scandir($dirname = '.', $ext = array()) {
436
+ // thx to php.net :-)
437
+ if(empty($ext))
438
+ $ext = array('jpeg', 'jpg', 'png', 'gif');
439
+ $files = array();
440
+ if($handle = opendir($dirname)) {
441
+ while(false !== ($file = readdir($handle)))
442
+ for($i=0;$i<sizeof($ext);$i++)
443
+ if(stristr($file, '.' . $ext[$i]))
444
+ $files[] = utf8_encode($file);
445
+ closedir($handle);
446
+ }
447
+ sort($files);
448
+ return ($files);
449
+ }
450
+
451
+ /**
452
+ * flagAdmin::createThumbnail() - function to create or recreate a thumbnail
453
+ *
454
+ * @param object | int $image contain all information about the image or the id
455
+ * @return string result code
456
+ */
457
+ function create_thumbnail($image) {
458
+
459
+ global $flag;
460
+
461
+ if(! class_exists('flag_Thumbnail'))
462
+ require_once( flagGallery::graphic_library() );
463
+
464
+ if ( is_numeric($image) )
465
+ $image = flagdb::find_image( $image );
466
+
467
+ if ( !is_object($image) )
468
+ return __('Object didn\'t contain correct data','flag');
469
+
470
+ // check for existing thumbnail
471
+ if (file_exists($image->thumbPath))
472
+ if (!is_writable($image->thumbPath))
473
+ return $image->filename . __(' is not writeable ','flag');
474
+
475
+ $thumb = new flag_Thumbnail($image->imagePath, TRUE);
476
+
477
+ // skip if file is not there
478
+ if (!$thumb->error) {
479
+ if ($flag->options['thumbFix']) {
480
+ // check for portrait format
481
+ if ($thumb->currentDimensions['height'] > $thumb->currentDimensions['width']) {
482
+ // first resize to the wanted width
483
+ $thumb->resize($flag->options['thumbWidth'], 0);
484
+ // get optimal y startpos
485
+ $ypos = ($thumb->currentDimensions['height'] - $flag->options['thumbHeight']) / 2;
486
+ $thumb->crop(0, $ypos, $flag->options['thumbWidth'],$flag->options['thumbHeight']);
487
+ } else {
488
+ // first resize to the wanted height
489
+ $thumb->resize(0, $flag->options['thumbHeight']);
490
+ // get optimal x startpos
491
+ $xpos = ($thumb->currentDimensions['width'] - $flag->options['thumbWidth']) / 2;
492
+ $thumb->crop($xpos, 0, $flag->options['thumbWidth'],$flag->options['thumbHeight']);
493
+ }
494
+ //this create a thumbnail but keep ratio settings
495
+ } else {
496
+ $thumb->resize($flag->options['thumbWidth'],$flag->options['thumbHeight']);
497
+ }
498
+
499
+ // save the new thumbnail
500
+ $thumb->save($image->thumbPath, $flag->options['thumbQuality']);
501
+ flagAdmin::chmod ($image->thumbPath);
502
+
503
+ //read the new sizes
504
+ $new_size = @getimagesize ( $image->thumbPath );
505
+ $size['width'] = $new_size[0];
506
+ $size['height'] = $new_size[1];
507
+
508
+ // add them to the database
509
+ flagdb::update_image_meta($image->pid, array( 'thumbnail' => $size) );
510
+ }
511
+
512
+ $thumb->destruct();
513
+
514
+ if ( !empty($thumb->errmsg) )
515
+ return ' <strong>' . $image->filename . ' (Error : '.$thumb->errmsg .')</strong>';
516
+
517
+ // success
518
+ return '1';
519
+ }
520
+
521
+ /**
522
+ * flagAdmin::resize_image() - create a new image, based on the height /width
523
+ *
524
+ * @class flagAdmin
525
+ * @param object | int $image contain all information about the image or the id
526
+ * @param integer $width optional
527
+ * @param integer $height optional
528
+ * @return string result code
529
+ */
530
+ function resize_image($image, $width = 0, $height = 0) {
531
+
532
+ global $flag;
533
+
534
+ if(! class_exists('flag_Thumbnail'))
535
+ require_once( flagGallery::graphic_library() );
536
+
537
+ if ( is_numeric($image) )
538
+ $image = flagdb::find_image( $image );
539
+
540
+ if ( !is_object($image) )
541
+ return __('Object didn\'t contain correct data','flag');
542
+
543
+ // before we start we import the meta data to database (required for uploads before V0.40)
544
+ flagAdmin::maybe_import_meta( $image->pid );
545
+
546
+ // if no parameter is set, take global settings
547
+ $width = ($width == 0) ? $flag->options['imgWidth'] : $width;
548
+ $height = ($height == 0) ? $flag->options['imgHeight'] : $height;
549
+
550
+ if (!is_writable($image->imagePath))
551
+ return ' <strong>' . $image->filename . __(' is not writeable','flag') . '</strong>';
552
+
553
+ $file = new flag_Thumbnail($image->imagePath, TRUE);
554
+
555
+ // skip if file is not there
556
+ if (!$file->error) {
557
+ $file->resize($width, $height, 4);
558
+ $file->save($image->imagePath, $flag->options['imgQuality']);
559
+ // read the new sizes
560
+ $size = @getimagesize ( $image->imagePath );
561
+ // add them to the database
562
+ flagdb::update_image_meta($image->pid, array( 'width' => $size[0], 'height' => $size[1] ) );
563
+ $file->destruct();
564
+ } else {
565
+ $file->destruct();
566
+ return ' <strong>' . $image->filename . ' (Error : ' . $file->errmsg . ')</strong>';
567
+ }
568
+
569
+ return '1';
570
+ }
571
+
572
+ /**
573
+ * Add images to database
574
+ *
575
+ * @class flagAdmin
576
+ * @param int $galleryID
577
+ * @param array $imageslist
578
+ * @return array $image_ids Id's which are sucessful added
579
+ */
580
+ function add_Images($galleryID, $imageslist, $name2alt = false) {
581
+ global $wpdb;
582
+
583
+ $alttext = '';
584
+ $image_ids = array();
585
+
586
+ if ( is_array($imageslist) ) {
587
+ foreach($imageslist as $picture) {
588
+ if($name2alt) {
589
+ // strip off the extension of the filename
590
+ $path_parts = pathinfo( $picture );
591
+ $alttext = ( !isset($path_parts['filename']) ) ? substr($path_parts['basename'], 0,strpos($path_parts['basename'], '.')) : $path_parts['filename'];
592
+ }
593
+ // save it to the database
594
+ $result = $wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->flagpictures (galleryid, filename, alttext, exclude) VALUES (%s, %s, %s, 0)", $galleryID, $picture, $alttext) );
595
+ // and give me the new id
596
+ $pic_id = (int) $wpdb->insert_id;
597
+ if ($result)
598
+ $image_ids[] = $pic_id;
599
+
600
+ // add the metadata
601
+ flagAdmin::import_MetaData($pic_id);
602
+
603
+ // action hook for post process after the image is added to the database
604
+ $image = array( 'id' => $pic_id, 'filename' => $picture, 'galleryID' => $galleryID);
605
+ do_action('flag_added_new_image', $image);
606
+
607
+ }
608
+ } // is_array
609
+
610
+ return $image_ids;
611
+
612
+ }
613
+
614
+ /**
615
+ * Import some metadata into the database (if avialable)
616
+ *
617
+ * @class flagAdmin
618
+ * @param array|int $imagesIds
619
+ * @return bool
620
+ */
621
+ function import_MetaData($imagesIds) {
622
+
623
+ global $wpdb;
624
+
625
+ require_once(FLAG_ABSPATH . 'lib/image.php');
626
+
627
+ if (!is_array($imagesIds))
628
+ $imagesIds = array($imagesIds);
629
+
630
+ foreach($imagesIds as $imageID) {
631
+ $image = flagdb::find_image($imageID);
632
+ if (!$image->error) {
633
+
634
+ $meta = flagAdmin::get_MetaData($image->pid);
635
+
636
+ // get the title
637
+ $alttext = empty( $meta['title'] ) ? $image->alttext : $meta['title'];
638
+ // get the caption / description field
639
+ $description = empty( $meta['caption'] ) ? $image->description : $meta['caption'];
640
+ // get the file date/time from exif
641
+ $timestamp = $meta['timestamp'];
642
+ // update database
643
+ $result = $wpdb->query( $wpdb->prepare("UPDATE $wpdb->flagpictures SET alttext = %s, description = %s, imagedate = %s WHERE pid = %d", attribute_escape($alttext), attribute_escape($description), $timestamp, $image->pid) );
644
+ if ($result === false)
645
+ return ' <strong>' . $image->filename . ' ' . __('(Error : Couldn\'t not update data base)', 'flag') . '</strong>';
646
+
647
+ //this flag will inform us the import is already one time performed
648
+ $meta['common']['saved'] = true;
649
+ $result = flagdb::update_image_meta($image->pid, $meta['common']);
650
+
651
+ if ($result === false)
652
+ return ' <strong>' . $image->filename . ' ' . __('(Error : Couldn\'t not update meta data)', 'flag') . '</strong>';
653
+ } else
654
+ return ' <strong>' . $image->filename . ' ' . __('(Error : Couldn\'t not find image)', 'flag') . '</strong>';// error check
655
+ }
656
+
657
+ return '1';
658
+
659
+ }
660
+
661
+ /**
662
+ * Copy some metadata into the image description (if avialable)
663
+ *
664
+ * @class flagAdmin
665
+ * @param array|int $imagesIds
666
+ * @return bool
667
+ */
668
+ function copy_MetaData($imagesIds) {
669
+
670
+ global $wpdb;
671
+
672
+ require_once(FLAG_ABSPATH . 'lib/meta.php');
673
+ require_once(FLAG_ABSPATH . 'lib/image.php');
674
+
675
+ if (!is_array($imagesIds))
676
+ $imagesIds = array($imagesIds);
677
+
678
+ foreach($imagesIds as $imageID) {
679
+
680
+ $image = flagdb::find_image($imageID);
681
+ if (!$image->error) {
682
+
683
+ require_once(FLAG_ABSPATH . 'admin/grab_meta.php');
684
+
685
+ // get the title
686
+ $alttext = empty( $alttext ) ? $image->alttext : $meta['title'];
687
+ if($alttext) $alttext = '<font size="16"><b>'.$alttext."</b></font>\n";
688
+ // get the caption / description field
689
+ $description = empty($description ) ? $image->description : $meta['caption'];
690
+ if($description) $description = $description."<br>\n";
691
+ // get the file date/time from exif
692
+ $makedescription = $alttext.$description.$makedescription;
693
+ // update database
694
+ $result = $wpdb->query( $wpdb->prepare("UPDATE $wpdb->flagpictures SET alttext = %s, description = %s, imagedate = %s WHERE pid = %d", '', attribute_escape($makedescription), $timestamp, $image->pid) );
695
+ if ($result === false)
696
+ return ' <strong>' . $image->filename . ' ' . __('(Error : Couldn\'t not update data base)', 'flag') . '</strong>';
697
+
698
+ } else
699
+ return ' <strong>' . $image->filename . ' ' . __('(Error : Couldn\'t not find image)', 'flag') . '</strong>';// error check
700
+ }
701
+
702
+ return '1';
703
+
704
+ }
705
+
706
+ /**
707
+ * flagAdmin::get_MetaData()
708
+ *
709
+ * @class flagAdmin
710
+ * @require Meta class
711
+ * @param string $picPath must be Gallery absPath + filename
712
+ * @return array metadata
713
+ */
714
+ function get_MetaData($id) {
715
+
716
+ require_once(FLAG_ABSPATH . 'lib/meta.php');
717
+
718
+ $meta = array();
719
+
720
+ $pdata = new flagMeta( $id );
721
+
722
+ $meta['title'] = trim ( $pdata->get_META('title') );
723
+ $meta['caption'] = trim ( $pdata->get_META('caption') );
724
+ $meta['keywords'] = trim ( $pdata->get_META('keywords') );
725
+ $meta['timestamp'] = $pdata->get_date_time();
726
+ // this contain other useful meta information
727
+ $meta['common'] = $pdata->get_common_meta();
728
+
729
+ return $meta;
730
+
731
+ }
732
+
733
+ /**
734
+ * Maybe import some meta data to the database. The functions checks the flag 'saved'
735
+ * and if based on compat reason (pre V0.40) we save then some meta datas to the database
736
+ *
737
+ * @param int $id
738
+ * @return result
739
+ */
740
+ function maybe_import_meta( $id ) {
741
+
742
+ require_once(FLAG_ABSPATH . 'lib/meta.php');
743
+
744
+ $image = new flagMeta( $id );
745
+
746
+ if ( $image->meta_data['saved'] != true ) {
747
+ //this flag will inform us the import is already one time performed
748
+ $meta['saved'] = true;
749
+ $result = flagdb::update_image_meta($image->pid, $meta['common']);
750
+ } else
751
+ return false;
752
+
753
+ return $result;
754
+
755
+ }
756
+
757
+ /**
758
+ * flagAdmin::getOnlyImages()
759
+ *
760
+ * @class flagAdmin
761
+ * @param mixed $p_event
762
+ * @param mixed $p_header
763
+ * @return bool
764
+ */
765
+ function getOnlyImages($p_event, $p_header) {
766
+
767
+ $info = pathinfo($p_header['filename']);
768
+ // check for extension
769
+ $ext = array('jpeg', 'jpg', 'png', 'gif');
770
+ if ( in_array( strtolower($info['extension']), $ext) ) {
771
+ // For MAC skip the ".image" files
772
+ if ($info['basename']{0} == '.' )
773
+ return 0;
774
+ else
775
+ return 1;
776
+ }
777
+ // ----- all other files are skipped
778
+ else {
779
+ return 0;
780
+ }
781
+ }
782
+
783
+ /**
784
+ * Function for uploading of images via the upload form
785
+ *
786
+ * @class flagAdmin
787
+ * @return void
788
+ */
789
+ function upload_images() {
790
+
791
+ global $wpdb;
792
+
793
+ // WPMU action
794
+ if (flagAdmin::check_quota())
795
+ return;
796
+
797
+ // Images must be an array
798
+ $imageslist = array();
799
+
800
+ // get selected gallery
801
+ $galleryID = (int) $_POST['galleryselect'];
802
+
803
+ if ($galleryID == 0) {
804
+ flagGallery::show_error(__('No gallery selected !','flag'));
805
+ return;
806
+ }
807
+
808
+ // get the path to the gallery
809
+ $gallery = flagdb::find_gallery($galleryID);
810
+
811
+ if ( empty($gallery->path) ){
812
+ flagGallery::show_error(__('Failure in database, no gallery path set !','flag'));
813
+ return;
814
+ }
815
+
816
+ // read list of images
817
+ $dirlist = flagAdmin::scandir(WINABSPATH.$gallerypath);
818
+
819
+ $imagefiles = $_FILES['imagefiles'];
820
+
821
+ if (is_array($imagefiles)) {
822
+ foreach ($imagefiles['name'] as $key => $value) {
823
+
824
+ // look only for uploded files
825
+ if ($imagefiles['error'][$key] == 0) {
826
+
827
+ $temp_file = $imagefiles['tmp_name'][$key];
828
+
829
+ //clean filename and extract extension
830
+ $filepart = flagGallery::fileinfo( $imagefiles['name'][$key] );
831
+ $filename = $filepart['basename'];
832
+
833
+ // check for allowed extension and if it's an image file
834
+ $ext = array('jpg', 'png', 'gif');
835
+ if ( !in_array($filepart['extension'], $ext) || !@getimagesize($temp_file) ){
836
+ flagGallery::show_error('<strong>' . $imagefiles['name'][$key] . ' </strong>' . __('is no valid image file!','flag'));
837
+ continue;
838
+ }
839
+
840
+ // check if this filename already exist in the folder
841
+ $i = 0;
842
+ while ( in_array( $filename, $dirlist ) ) {
843
+ $filename = $filepart['filename'] . '_' . $i++ . '.' .$filepart['extension'];
844
+ }
845
+
846
+ $dest_file = $gallery->abspath . '/' . $filename;
847
+
848
+ //check for folder permission
849
+ if ( !is_writeable($gallery->abspath) ) {
850
+ $message = sprintf(__('Unable to write to directory %s. Is this directory writable by the server?', 'flag'), $gallery->abspath);
851
+ flagGallery::show_error($message);
852
+ return;
853
+ }
854
+
855
+ // save temp file to gallery
856
+ if ( !@move_uploaded_file($temp_file, $dest_file) ){
857
+ flagGallery::show_error(__('Error, the file could not moved to : ','flag') . $dest_file);
858
+ flagAdmin::check_safemode( $gallery->abspath );
859
+ continue;
860
+ }
861
+ if ( !flagAdmin::chmod($dest_file) ) {
862
+ flagGallery::show_error(__('Error, the file permissions could not set','flag'));
863
+ continue;
864
+ }
865
+
866
+ // add to imagelist & dirlist
867
+ $imageslist[] = $filename;
868
+ $dirlist[] = $filename;
869
+ }
870
+ }
871
+ }
872
+
873
+ if (count($imageslist) > 0) {
874
+
875
+ // add images to database
876
+ $image_ids = flagAdmin::add_Images($galleryID, $imageslist);
877
+
878
+ //create thumbnails
879
+ flagAdmin::do_ajax_operation( 'create_thumbnail' , $image_ids, __('Create new thumbnails','flag') );
880
+ //add the preview image if needed
881
+ flagAdmin::set_gallery_preview ( $galleryID );
882
+
883
+ flagGallery::show_message( count($image_ids) . __(' Image(s) successfully added','flag'));
884
+ }
885
+
886
+ return;
887
+
888
+ } // end function
889
+
890
+ /**
891
+ * Upload function will be called via the Flash uploader
892
+ *
893
+ * @class flagAdmin
894
+ * @param integer $galleryID
895
+ * @return string $result
896
+ */
897
+ function swfupload_image($galleryID = 0) {
898
+
899
+ global $wpdb;
900
+
901
+ if ($galleryID == 0) {
902
+ @unlink($temp_file);
903
+ return __('No gallery selected!','flag');;
904
+ }
905
+
906
+ // WPMU action
907
+ if (flagAdmin::check_quota())
908
+ return '0';
909
+
910
+ // Check the upload
911
+ if (!isset($_FILES['Filedata']) || !is_uploaded_file($_FILES["Filedata"]["tmp_name"]) || $_FILES["Filedata"]["error"] === UPLOAD_ERR_OK)
912
+ flagAdmin::file_upload_error_message($_FILES['Filedata']['error']);
913
+
914
+ // get the filename and extension
915
+ $temp_file = $_FILES["Filedata"]['tmp_name'];
916
+
917
+ $filepart = flagGallery::fileinfo( $_FILES['Filedata']['name'] );
918
+ $filename = $filepart['basename'];
919
+
920
+ // check for allowed extension
921
+ $ext = array('jpeg', 'jpg', 'png', 'gif');
922
+ if (!in_array($filepart['extension'], $ext))
923
+ return $_FILES[$key]['name'] . __('is no valid image file!','flag');
924
+
925
+ // get the path to the gallery
926
+ $gallerypath = $wpdb->get_var("SELECT path FROM $wpdb->flaggallery WHERE gid = '$galleryID' ");
927
+ if (!$gallerypath){
928
+ @unlink($temp_file);
929
+ return __('Failure in database, no gallery path set !','flag');
930
+ }
931
+
932
+ // read list of images
933
+ $imageslist = flagAdmin::scandir( WINABSPATH.$gallerypath );
934
+
935
+ // check if this filename already exist
936
+ $i = 0;
937
+ while (in_array($filename,$imageslist)) {
938
+ $filename = sanitize_title($filepart['filename']) . '_' . $i++ . '.' . $filepart['extension'];
939
+ }
940
+
941
+ $dest_file = WINABSPATH . $gallerypath . '/' . $filename;
942
+
943
+ // save temp file to gallery
944
+ if ( !@move_uploaded_file($_FILES["Filedata"]['tmp_name'], $dest_file) ){
945
+ flagAdmin::check_safemode(WINABSPATH.$gallerypath);
946
+ return __('Error, the file could not moved to : ','flag').$dest_file;
947
+ }
948
+
949
+ if ( !flagAdmin::chmod($dest_file) )
950
+ return __('Error, the file permissions could not set','flag');
951
+
952
+ return '0';
953
+ }
954
+
955
+ /**
956
+ * File upload error message
957
+ *
958
+ * @class flagAdmin
959
+ * @return string $result
960
+ */
961
+ function file_upload_error_message($error_code) {
962
+ switch ($error_code) {
963
+ case UPLOAD_ERR_INI_SIZE:
964
+ return __('The uploaded file exceeds the upload_max_filesize directive in php.ini','flag');
965
+ case UPLOAD_ERR_FORM_SIZE:
966
+ return __('The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form','flag');
967
+ case UPLOAD_ERR_PARTIAL:
968
+ return __('The uploaded file was only partially uploaded','flag');
969
+ case UPLOAD_ERR_NO_FILE:
970
+ return __('No file was uploaded','flag');
971
+ case UPLOAD_ERR_NO_TMP_DIR:
972
+ return __('Missing a temporary folder','flag');
973
+ case UPLOAD_ERR_CANT_WRITE:
974
+ return __('Failed to write file to disk','flag');
975
+ case UPLOAD_ERR_EXTENSION:
976
+ return __('File upload stopped by extension','flag');
977
+ default:
978
+ return __('Unknown upload error','flag');
979
+ }
980
+ }
981
+
982
+ /**
983
+ * Check the Quota under WPMU. Only needed for this case
984
+ *
985
+ * @class flagAdmin
986
+ * @return bool $result
987
+ */
988
+ function check_quota() {
989
+
990
+ if ( (IS_WPMU) && flagGallery::flag_wpmu_enable_function('wpmuQuotaCheck'))
991
+ if( $error = upload_is_user_over_quota( false ) ) {
992
+ flagGallery::show_error( __( 'Sorry, you have used your space allocation. Please delete some files to upload more files.','flag' ) );
993
+ return true;
994
+ }
995
+ return false;
996
+ }
997
+
998
+ /**
999
+ * Set correct file permissions (taken from wp core)
1000
+ *
1001
+ * @class flagAdmin
1002
+ * @param string $filename
1003
+ * @return bool $result
1004
+ */
1005
+ function chmod($filename = '') {
1006
+
1007
+ $stat = @ stat(dirname($filename));
1008
+ $perms = $stat['mode'] & 0007777;
1009
+ $perms = $perms & 0000666;
1010
+ if ( @chmod($filename, $perms) )
1011
+ return true;
1012
+
1013
+ return false;
1014
+ }
1015
+
1016
+ /**
1017
+ * Check UID in folder and Script
1018
+ * Read http://www.php.net/manual/en/features.safe-mode.php to understand safe_mode
1019
+ *
1020
+ * @class flagAdmin
1021
+ * @param string $foldername
1022
+ * @return bool $result
1023
+ */
1024
+ function check_safemode($foldername) {
1025
+
1026
+ if ( SAFE_MODE ) {
1027
+
1028
+ $script_uid = ( ini_get('safe_mode_gid') ) ? getmygid() : getmyuid();
1029
+ $folder_uid = fileowner($foldername);
1030
+
1031
+ if ($script_uid != $folder_uid) {
1032
+ $message = sprintf(__('SAFE MODE Restriction in effect! You need to create the folder <strong>%s</strong> manually','flag'), $foldername);
1033
+ $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 );
1034
+ flagGallery::show_error($message);
1035
+ return false;
1036
+ }
1037
+ }
1038
+
1039
+ return true;
1040
+ }
1041
+
1042
+ /**
1043
+ * Capability check. Check is the ID fit's to the user_ID
1044
+ *
1045
+ * @class flagAdmin
1046
+ * @param int $check_ID is the user_id
1047
+ * @return bool $result
1048
+ */
1049
+ function can_manage_this_gallery($check_ID) {
1050
+
1051
+ global $user_ID, $wp_roles;
1052
+
1053
+ if ( !current_user_can('FlAG Manage others gallery') ) {
1054
+ // get the current user ID
1055
+ get_currentuserinfo();
1056
+
1057
+ if ( $user_ID != $check_ID)
1058
+ return false;
1059
+ }
1060
+ return true;
1061
+ }
1062
+
1063
+ /**
1064
+ * Move images from one folder to another
1065
+ *
1066
+ * @param array|int $pic_ids ID's of the images
1067
+ * @param int $dest_gid destination gallery
1068
+ * @return void
1069
+ */
1070
+ function move_images($pic_ids, $dest_gid) {
1071
+
1072
+ $errors = '';
1073
+ $count = 0;
1074
+
1075
+ if (!is_array($pic_ids))
1076
+ $pic_ids = array($pic_ids);
1077
+
1078
+ // Get destination gallery
1079
+ $destination = flagdb::find_gallery( $dest_gid );
1080
+ $dest_abspath = WINABSPATH . $destination->path;
1081
+
1082
+ if ( $destination == null ) {
1083
+ flagGallery::show_error(__('The destination gallery does not exist','flag'));
1084
+ return;
1085
+ }
1086
+
1087
+ // Check for folder permission
1088
+ if ( !is_writeable( $dest_abspath ) ) {
1089
+ $message = sprintf(__('Unable to write to directory %s. Is this directory writable by the server?', 'flag'), $dest_abspath );
1090
+ flagGallery::show_error($message);
1091
+ return;
1092
+ }
1093
+
1094
+ // Get pictures
1095
+ $images = flagdb::find_images_in_list($pic_ids);
1096
+
1097
+ foreach ($images as $image) {
1098
+
1099
+ $i = 0;
1100
+ $tmp_prefix = '';
1101
+
1102
+ $destination_file_name = $image->filename;
1103
+ // check if the filename already exist, then we add a copy_ prefix
1104
+ while (file_exists( $dest_abspath . '/' . $destination_file_name)) {
1105
+ $tmp_prefix = 'copy_' . ($i++) . '_';
1106
+ $destination_file_name = $tmp_prefix . $image->filename;
1107
+ }
1108
+
1109
+ $destination_path = $dest_abspath . '/' . $destination_file_name;
1110
+ $destination_thumbnail = $dest_abspath . '/thumbs/thumbs_' . $destination_file_name;
1111
+
1112
+ // Move files
1113
+ if ( !@rename($image->imagePath, $destination_path) ) {
1114
+ $errors .= sprintf(__('Failed to move image %1$s to %2$s','flag'),
1115
+ '<strong>' . $image->filename . '</strong>', $destination_path) . '<br />';
1116
+ continue;
1117
+ }
1118
+
1119
+ // Move the thumbnail, if possible
1120
+ !@rename($image->thumbPath, $destination_thumbnail);
1121
+
1122
+ // Change the gallery id in the database , maybe the filename
1123
+ if ( flagdb::update_image($image->pid, $dest_gid, $destination_file_name) )
1124
+ $count++;
1125
+
1126
+ }
1127
+
1128
+ if ( $errors != '' )
1129
+ flagGallery::show_error($errors);
1130
+
1131
+ $link = '<a href="' . admin_url() . 'admin.php?page=flag-manage-gallery&mode=edit&gid=' . $destination->gid . '" >' . $destination->title . '</a>';
1132
+ $messages = sprintf(__('Moved %1$s picture(s) to gallery : %2$s .','flag'), $count, $link);
1133
+ flagGallery::show_message($messages);
1134
+
1135
+ return;
1136
+ }
1137
+
1138
+ /**
1139
+ * Copy images to another gallery
1140
+ *
1141
+ * @class flagAdmin
1142
+ * @param array|int $pic_ids ID's of the images
1143
+ * @param int $dest_gid destination gallery
1144
+ * @return void
1145
+ */
1146
+ function copy_images($pic_ids, $dest_gid) {
1147
+
1148
+ $errors = $messages = '';
1149
+
1150
+ if (!is_array($pic_ids))
1151
+ $pic_ids = array($pic_ids);
1152
+
1153
+ // Get destination gallery
1154
+ $destination = flagdb::find_gallery( $dest_gid );
1155
+ if ( $destination == null ) {
1156
+ flagGallery::show_error(__('The destination gallery does not exist','flag'));
1157
+ return;
1158
+ }
1159
+
1160
+ // Check for folder permission
1161
+ if (!is_writeable(WINABSPATH.$destination->path)) {
1162
+ $message = sprintf(__('Unable to write to directory %s. Is this directory writable by the server?', 'flag'), WINABSPATH.$destination->path);
1163
+ flagGallery::show_error($message);
1164
+ return;
1165
+ }
1166
+
1167
+ // Get pictures
1168
+ $images = flagdb::find_images_in_list($pic_ids);
1169
+ $destination_path = WINABSPATH . $destination->path;
1170
+
1171
+ foreach ($images as $image) {
1172
+ // WPMU action
1173
+ if ( flagAdmin::check_quota() )
1174
+ return;
1175
+
1176
+ $i = 0;
1177
+ $tmp_prefix = '';
1178
+ $destination_file_name = $image->filename;
1179
+ while (file_exists($destination_path . '/' . $destination_file_name)) {
1180
+ $tmp_prefix = 'copy_' . ($i++) . '_';
1181
+ $destination_file_name = $tmp_prefix . $image->filename;
1182
+ }
1183
+
1184
+ $destination_file_path = $destination_path . '/' . $destination_file_name;
1185
+ $destination_thumb_file_path = $destination_path . '/' . $image->thumbFolder . $image->thumbPrefix . $destination_file_name;
1186
+
1187
+ // Copy files
1188
+ if ( !@copy($image->imagePath, $destination_file_path) ) {
1189
+ $errors .= sprintf(__('Failed to copy image %1$s to %2$s','flag'),
1190
+ $image->filename, $destination_file_path) . '<br />';
1191
+ continue;
1192
+ }
1193
+
1194
+ // Copy the thumbnail if possible
1195
+ !@copy($image->thumbPath, $destination_thumb_file_path);
1196
+
1197
+ // Create new database entry for the image
1198
+ $new_pid = flagdb::insert_image( $destination->gid, $destination_file_name, $image->alttext, $image->description, $image->exclude);
1199
+
1200
+ if (!isset($new_pid)) {
1201
+ $errors .= sprintf(__('Failed to copy database row for picture %s','flag'), $image->pid) . '<br />';
1202
+ continue;
1203
+ }
1204
+
1205
+ if ( $tmp_prefix != '' ) {
1206
+ $messages .= sprintf(__('Image %1$s (%2$s) copied as image %3$s (%4$s) &raquo; The file already existed in the destination gallery.','flag'),
1207
+ $image->pid, $image->filename, $new_pid, $destination_file_name) . '<br />';
1208
+ } else {
1209
+ $messages .= sprintf(__('Image %1$s (%2$s) copied as image %3$s (%4$s)','flag'),
1210
+ $image->pid, $image->filename, $new_pid, $destination_file_name) . '<br />';
1211
+ }
1212
+
1213
+ }
1214
+
1215
+ // Finish by showing errors or success
1216
+ if ( $errors == '' ) {
1217
+ $link = '<a href="' . admin_url() . 'admin.php?page=flag-manage-gallery&mode=edit&gid=' . $destination->gid . '" >' . $destination->title . '</a>';
1218
+ $messages .= '<hr />' . sprintf(__('Copied %1$s picture(s) to gallery: %2$s .','flag'), count($images), $link);
1219
+ }
1220
+
1221
+ if ( $messages != '' )
1222
+ flagGallery::show_message($messages);
1223
+
1224
+ if ( $errors != '' )
1225
+ flagGallery::show_error($errors);
1226
+
1227
+ return;
1228
+ }
1229
+
1230
+ /**
1231
+ * Initate the Ajax operation
1232
+ *
1233
+ * @class flagAdmin
1234
+ * @param string $operation name of the function which should be executed
1235
+ * @param array $image_array
1236
+ * @param string $title name of the operation
1237
+ * @return string the javascript output
1238
+ */
1239
+ function do_ajax_operation( $operation, $image_array, $title = '' ) {
1240
+
1241
+ if ( !is_array($image_array) || empty($image_array) )
1242
+ return;
1243
+
1244
+ $js_array = implode('","', $image_array);
1245
+
1246
+ // send out some JavaScript, which initate the ajax operation
1247
+ ?>
1248
+ <script type="text/javascript">
1249
+
1250
+ Images = new Array("<?php echo $js_array; ?>");
1251
+
1252
+ flagAjaxOptions = {
1253
+ operation: "<?php echo $operation; ?>",
1254
+ ids: Images,
1255
+ header: "<?php echo $title; ?>",
1256
+ maxStep: Images.length
1257
+ };
1258
+
1259
+ jQuery(document).ready( function(){
1260
+ flagProgressBar.init( flagAjaxOptions );
1261
+ flagAjax.init( flagAjaxOptions );
1262
+ } );
1263
+ </script>
1264
+
1265
+ <div id="progressbar_container" class="wrap"></div>
1266
+
1267
+ <?php
1268
+ }
1269
+
1270
+ /**
1271
+ * flagAdmin::set_gallery_preview() - define a preview pic after the first upload, can be changed in the gallery settings
1272
+ *
1273
+ * @class flagAdmin
1274
+ * @param int $galleryID
1275
+ * @return void
1276
+ */
1277
+ function set_gallery_preview( $galleryID ) {
1278
+
1279
+ global $wpdb;
1280
+
1281
+ $gallery = flagdb::find_gallery( $galleryID );
1282
+
1283
+ // in the case no preview image is setup, we do this now
1284
+ if ($gallery->previewpic == 0) {
1285
+ $firstImage = $wpdb->get_var("SELECT pid FROM $wpdb->flagpictures WHERE exclude != 1 AND galleryid = '$galleryID' ORDER by pid DESC limit 0,1");
1286
+ if ($firstImage) {
1287
+ $wpdb->query("UPDATE $wpdb->flaggallery SET previewpic = '$firstImage' WHERE gid = '$galleryID'");
1288
+ wp_cache_delete($galleryID, 'flag_gallery');
1289
+ }
1290
+ }
1291
+
1292
+ return;
1293
+ }
1294
+
1295
+ /**
1296
+ * Return a JSON coded array of Image ids for a requested gallery
1297
+ *
1298
+ * @param int $galleryID
1299
+ * @return arry (JSON)
1300
+ */
1301
+ function get_image_ids( $galleryID ) {
1302
+
1303
+ if ( !function_exists('json_encode') )
1304
+ return(-2);
1305
+
1306
+ $gallery = flagdb::get_ids_from_gallery($galleryID, 'pid', 'ASC', false);
1307
+
1308
+ header('Content-Type: text/plain; charset=' . get_option('blog_charset'), true);
1309
+ $output = json_encode($gallery);
1310
+
1311
+ return $output;
1312
+ }
1313
+
1314
+ } // END class flagAdmin
1315
+
1316
+ ?>
admin/get_skin.php ADDED
@@ -0,0 +1,140 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Parse the skin contents to retrieve skin's metadata.
5
+ *
6
+ * <code>
7
+ * /*
8
+ * Skin Name: Name of Skin
9
+ * Skin URI: Link to skin information
10
+ * Description: Skin Description
11
+ * Author: Skin author's name
12
+ * Author URI: Link to the author's web site
13
+ * Version: Version of Skin
14
+ * * / # Remove the space to close comment
15
+ * </code>
16
+ *
17
+ * Skin data returned array contains the following:
18
+ * 'Name' - Name of the skin, must be unique.
19
+ * 'Title' - Title of the skin and the link to the skin's web site.
20
+ * 'Description' - Description of what the skin does and/or notes
21
+ * from the author.
22
+ * 'Author' - The author's name
23
+ * 'AuthorURI' - The authors web site address.
24
+ * 'Version' - The skin version number.
25
+ * 'SkinURI' - Skin web site address.
26
+ *
27
+ */
28
+
29
+ function get_skin_data( $skin_file, $type='' ) {
30
+ // We don't need to write to the file, so just open for reading.
31
+ $fp = fopen($skin_file, 'r');
32
+
33
+ // Pull only the first 8kiB of the file in.
34
+ $skin_data = fread( $fp, 8192 );
35
+
36
+ // PHP will close file handle, but we are good citizens.
37
+ fclose($fp);
38
+
39
+ preg_match( '|^'.$type.'Skin Name:(.*)$|mi', $skin_data, $name );
40
+ if($name[1]) {
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
52
+ ${$field} = '';
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;
60
+ }
61
+ }
62
+
63
+ /**
64
+ * Gets the basename of a skin.
65
+ *
66
+ * This method extracts the name of a skin from its filename.
67
+ *
68
+ */
69
+ function skin_basename($file) {
70
+ $flag_options = get_option('flag_options');
71
+ $file = str_replace('\\','/',$file); // sanitize for Win32 installs
72
+ $file = preg_replace('|/+|','/', $file); // remove any duplicate slash
73
+ $skin_dir = str_replace('\\','/',$flag_options['skinsDirABS']); // sanitize for Win32 installs
74
+ $skin_dir = preg_replace('|/+|','/', $skin_dir); // remove any duplicate slash
75
+ $mu_skin_dir = str_replace('\\','/',$flag_options['skinsDirABS']); // sanitize for Win32 installs
76
+ $mu_skin_dir = preg_replace('|/+|','/', $mu_skin_dir); // remove any duplicate slash
77
+ $file = preg_replace('#^' . preg_quote($skin_dir, '#') . '/|^' . preg_quote($mu_skin_dir, '#') . '/#','',$file); // get relative path from skins dir
78
+ $file = trim($file, '/');
79
+ return $file;
80
+ }
81
+
82
+ /**
83
+ * Check the skins directory and retrieve all skin files with skin data.
84
+ *
85
+ */
86
+ function get_skins($skin_folder='', $type='') {
87
+
88
+ $flag_options = get_option('flag_options');
89
+ $flag_skins = array ();
90
+ $skin_root = $flag_options['skinsDirABS'];
91
+ if( !empty($skin_folder) )
92
+ $skin_root = $skin_folder;
93
+
94
+ // Files in flash-album-gallery/skins directory
95
+ $skins_dir = @ opendir( $skin_root);
96
+ $skin_files = array();
97
+ if ( $skins_dir ) {
98
+ while (($file = readdir( $skins_dir ) ) !== false ) {
99
+ if ( substr($file, 0, 1) == '.' )
100
+ continue;
101
+ if ( is_dir( $skin_root.'/'.$file ) ) {
102
+ $skins_subdir = @ opendir( $skin_root.'/'.$file );
103
+ if ( $skins_subdir ) {
104
+ while (($subfile = readdir( $skins_subdir ) ) !== false ) {
105
+ if ( substr($subfile, 0, 1) == '.' )
106
+ continue;
107
+ if ( substr($subfile, -4) == '.php' )
108
+ $skin_files[] = "$file/$subfile";
109
+ }
110
+ }
111
+ } else {
112
+ if ( substr($file, -4) == '.php' )
113
+ $skin_files[] = $file;
114
+ }
115
+ }
116
+ }
117
+ @closedir( $skins_dir );
118
+ @closedir( $skins_subdir );
119
+
120
+ if ( !$skins_dir || empty($skin_files) )
121
+ return $flag_skins;
122
+
123
+ foreach ( $skin_files as $skin_file ) {
124
+ if ( !is_readable( "$skin_root/$skin_file" ) )
125
+ continue;
126
+
127
+ $skin_data = get_skin_data( "$skin_root/$skin_file", $type );
128
+
129
+ if ( empty ( $skin_data['Name'] ) )
130
+ continue;
131
+
132
+ $flag_skins[skin_basename( $skin_file )] = $skin_data;
133
+ }
134
+
135
+ uasort( $flag_skins, create_function( '$a, $b', 'return strnatcasecmp( $a["Name"], $b["Name"] );' ));
136
+
137
+ return $flag_skins;
138
+ }
139
+
140
+ ?>
admin/grab_meta.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $meta = new flagMeta($image->pid);
3
+ $dbdata = $meta->get_saved_meta();
4
+ $exifdata = $meta->get_EXIF();
5
+ $iptcdata = $meta->get_IPTC();
6
+ $xmpdata = $meta->get_XMP();
7
+ $alttext = trim ( $meta->get_META('title') );
8
+ $description = trim ( $meta->get_META('caption') );
9
+ $timestamp = $meta->get_date_time();
10
+
11
+ $makedescription = '<b>'.__('Meta Data','flag')."</b><br>";
12
+ if ($dbdata) {
13
+ foreach ($dbdata as $key => $value){
14
+ if ( is_array($value) ) continue;
15
+ $makedescription .= '<b>'.$meta->i8n_name($key)."</b> ".$value."<br>";
16
+ }
17
+ } else {
18
+ $makedescription .= __('No meta data saved','flag')."<br>";
19
+ }
20
+ if ($exifdata) {
21
+ $makedescription .= "\n<b>".__('EXIF Data','flag')."</b><br>";
22
+ foreach ($exifdata as $key => $value){
23
+ $makedescription .= '<b>'.$meta->i8n_name($key)."</b> ".$value."<br>";
24
+ }
25
+ }
26
+ if ($iptcdata) {
27
+ $makedescription .= "\n<b>".__('IPTC Data','flag')."</b><br>";
28
+ foreach ($iptcdata as $key => $value){
29
+ $makedescription .= '<b>'.$meta->i8n_name($key)."</b> ".$value."<br>";
30
+ }
31
+ }
32
+ if ($xmpdata) {
33
+ $makedescription .= "\n<b>".__('XMP Data','flag')."</b><br>";
34
+ foreach ($xmpdata as $key => $value){
35
+ $makedescription .= '<b>'.$meta->i8n_name($key)."</b> ".$value."<br>";
36
+ }
37
+ }
38
+ ?>
admin/images/asc.gif ADDED
Binary file
admin/images/browser.png ADDED
Binary file
admin/images/desc.gif ADDED
Binary file
admin/images/fail.png ADDED
Binary file
admin/images/flag.png ADDED
Binary file
admin/images/hits.png ADDED
Binary file
admin/images/loadingAnimation.gif ADDED
Binary file
admin/images/lock.png ADDED
Binary file
admin/images/mail.png ADDED
Binary file
admin/images/map.png ADDED
Binary file
admin/images/menu-bits.gif ADDED
Binary file
admin/images/notes.png ADDED
Binary file
admin/images/reset.png ADDED
Binary file
admin/images/sortbg.gif ADDED
Binary file
admin/images/wallpaper.png ADDED
Binary file
admin/jgallery.php ADDED
@@ -0,0 +1,110 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php global $wpdb, $post;
2
+ $flag_options = get_option ('flag_options');
3
+ $siteurl = site_url();
4
+ $c = array();
5
+ $isCrawler = flagGetUserNow($_SERVER['HTTP_USER_AGENT']); // check if is a crowler
6
+ extract($altColors);
7
+ $bg = ($wmode == 'window')? '#'.$Background : 'transparent';
8
+ $xml['alt'] .= '<style type="text/css">'.PHP_EOL;
9
+ if(!$isCrawler) {
10
+ $xml['alt'] .= '@import url("'.FLAG_URLPATH.'admin/css/flagallery_nocrawler.css");'.PHP_EOL;
11
+ }
12
+ $xml['alt'] .= '@import url("'.FLAG_URLPATH.'admin/css/flagallery_noflash.css");'.PHP_EOL;
13
+ if($isCrawler) {
14
+ $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; }
15
+ .flag_alternate .flagCatMeta p { font-size: 12px; }'.PHP_EOL;
16
+ }
17
+ if($BarsBG) {
18
+ $bgBar = ($wmode == 'window')? '#'.$BarsBG : 'transparent';
19
+ if(!$isCrawler){
20
+ $xml['alt'] .= "#fancybox-title-over .title { color: #{$TitleColor}; }
21
+ #fancybox-title-over .descr { color: #{$DescrColor}; }
22
+ .flag_alternate .flagcatlinks { background-color: #{$BarsBG}; }
23
+ .flag_alternate .flagcatlinks a.flagcat { color: #{$CatColor}; background-color: #{$CatBGColor}; }
24
+ .flag_alternate .flagcatlinks a.active, .flag_alternate .flagcatlinks a.flagcat:hover { color: #{$CatColorOver}; background-color: #{$CatBGColorOver}; }".PHP_EOL;
25
+ }
26
+ $xml['alt'] .= ".flag_alternate .flagcategory a.flag_pic_alt { background-color: #{$ThumbBG}; border: 2px solid #{$ThumbBG}; color: #{$ThumbBG}; }
27
+ .flag_alternate .flagcategory a.flag_pic_alt:hover { background-color: #{$ThumbBG}; border: 2px solid #{$ThumbLoaderColor}; color: #{$ThumbLoaderColor}; }
28
+ .flag_alternate .flagcategory a.flag_pic_alt.current, .flag_alternate .flagcategory a.flag_pic_alt.last { border-color: #{$ThumbLoaderColor}; }".PHP_EOL;
29
+ }
30
+ if($altColors['FullWindow'] && !$isCrawler){
31
+ $xml['alt'] .= ".flagcatlinks a.backlink { color: #{$CatColor}; background-color: #{$CatBGColor}; }".PHP_EOL;
32
+ }
33
+ $xml['alt'] .= '</style>'.PHP_EOL;
34
+ if(!$isCrawler){
35
+ if(!$flag_options['jAlterGalScript']) {
36
+ $xml['alt'] .= '<link href="'.plugins_url('/flash-album-gallery/admin/js/jquery.fancybox-1.3.4.css').'" rel="stylesheet" type="text/css" />'.PHP_EOL;
37
+ $xml['alt'] .= "<script type='text/javascript' src='".plugins_url('/flash-album-gallery/admin/js/jquery.fancybox-1.3.4.pack.js')."'></script>".PHP_EOL;
38
+ $xml['alt'] .= "<script type='text/javascript'>var ExtendVar='fancybox', hitajax = '".plugins_url('/lib/hitcounter.php', dirname(__FILE__))."';</script>".PHP_EOL;
39
+ } else if($flag_options['jAlterGalScript'] == 1) {
40
+ $xml['alt'] .= "<style type='text/css'>@import url('".plugins_url('/admin/js/photoswipe/photoswipe.css', dirname(__FILE__))."');</style>
41
+ <script type='text/javascript' src='".plugins_url('/admin/js/photoswipe/klass.min.js', dirname(__FILE__))."'></script>
42
+ <script type='text/javascript' src='".plugins_url('/admin/js/photoswipe/code.photoswipe.jquery-3.0.5.min.js', dirname(__FILE__))."'></script>
43
+ <script type='text/javascript'>var ExtendVar='photoswipe', hitajax = '".plugins_url('/lib/hitcounter.php', dirname(__FILE__))."';</script>".PHP_EOL;
44
+ }
45
+ }
46
+
47
+ $xml['alt'] .= '<div id="'.$skinID.'_jq" class="flag_alternate">
48
+ <div class="flagcatlinks">';
49
+ if($altColors['FullWindow'] && !$isCrawler){
50
+ $flag_custom = get_post_custom($post->ID);
51
+ $backlink = $flag_custom["mb_button_link"][0];
52
+ if(!$backlink || $backlink == 'http://'){ $backlink = $_SERVER["HTTP_REFERER"]; }
53
+ if($backlink){
54
+ $xml['alt'] .= '<a id="backlink" class="backlink" href="'.$backlink.'">'.$flag_custom["mb_button"][0].'</a>';
55
+ }
56
+ }
57
+ $xml['alt'] .= '</div>'.PHP_EOL;
58
+
59
+ $gID = explode( '_', $galleryID ); // get the gallery id
60
+ if ( is_user_logged_in() ) $exclude_clause = '';
61
+ else $exclude_clause = ' AND exclude<>1 ';
62
+ $i = 0;
63
+ foreach ( $gID as $galID ) {
64
+ $galID = (int) $galID;
65
+ if ( $galID == 0) {
66
+ $thegalleries = array();
67
+ $thepictures = $wpdb->get_results("SELECT pid, galleryid, filename, description, alttext, imagedate, sortorder, hitcounter, total_value, total_votes FROM $wpdb->flagpictures WHERE 1=1 {$exclude_clause} ORDER BY {$flag_options['galSort']} {$flag_options['galSortDir']} ", ARRAY_A);
68
+ } else {
69
+ $thegalleries = $wpdb->get_row("SELECT gid, name, path, title, galdesc FROM $wpdb->flaggallery WHERE gid={$galID}", ARRAY_A);
70
+ $thepictures = $wpdb->get_results("SELECT pid, filename, description, alttext, imagedate, hitcounter, total_value, total_votes FROM $wpdb->flagpictures WHERE galleryid = '{$galID}' {$exclude_clause} ORDER BY {$flag_options['galSort']} {$flag_options['galSortDir']} ", ARRAY_A);
71
+ }
72
+ $captions = '';
73
+
74
+
75
+ if (is_array ($thepictures) && count($thegalleries) && count($thepictures)){
76
+ $thegalleries = array_map('stripslashes', $thegalleries);
77
+ $thegalleries['galdesc'] = htmlspecialchars_decode($thegalleries['galdesc']);
78
+ $a = $thegalleries;
79
+
80
+ $xml['alt'] .= '<div class="flagCatMeta">'.PHP_EOL;
81
+ $xml['alt'] .= ' <h4>'.$thegalleries['title'].'</h4>'.PHP_EOL;
82
+ $xml['alt'] .= ' <p>'.$thegalleries['galdesc'].'</p>'.PHP_EOL;
83
+ $xml['alt'] .= '</div>'.PHP_EOL;
84
+ $xml['alt'] .= '<div class="flagcategory" id="gid_'.$galID.'_'.$skinID.'">'.PHP_EOL;
85
+ $n = count($thepictures);
86
+ $var = floor($n/5);
87
+ if($var==0 || $var > 4) $var=4;
88
+ $split = ceil($n/$var);
89
+ $j=0;
90
+ $b = array();
91
+ foreach ($thepictures as $picture) {
92
+ $picture = array_map('stripslashes', $picture);
93
+ $b['data'][] = $picture;
94
+
95
+ $pid = intval($picture['pid']);
96
+
97
+ if ($isCrawler){
98
+ $xml['alt'] .= '<a style="display:block; overflow: hidden; height: auto; width: auto; margin-bottom: 10px; background-color: #eeeeee; background-position: 22px 44px; text-align: left;" class="i'. $j++ .' flag_pic_alt" href="'.$siteurl.'/'.$thegalleries['path'].'/'.$picture['filename'].'" id="flag_pic_'.$pid.'" rel="gid_'.$galID.'_'.$skinID.'"><img style="float:left; margin-right: 10px;" title="'.strip_tags($picture['alttext']).'" alt="'.strip_tags($picture['alttext']).'" src="'.$siteurl.'/'.$thegalleries['path'].'/thumbs/thumbs_'.$picture['filename'].'" width="115" height="100" /><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($picture['alttext']).'</strong><br />'.strip_tags($picture['description'],'<b><u><i><span>').'</span></a>'.PHP_EOL;
99
+ } else {
100
+ $xml['alt'] .= '<a class="i'. $j++ .' flag_pic_alt" href="'.$siteurl.'/'.$thegalleries['path'].'/'.$picture['filename'].'" id="flag_pic_'.$pid.'" rel="gid_'.$galID.'_'.$skinID.'" title="'.strip_tags($picture['alttext']).'">[img src='.$siteurl.'/'.$thegalleries['path'].'/thumbs/thumbs_'.$picture['filename'].']<span class="flag_pic_desc" id="flag_desc_'.$pid.'"><strong>'.htmlspecialchars($picture['alttext']).'</strong><br /><span>'.htmlspecialchars($picture['description']).'</span></span></a>'.PHP_EOL;
101
+ }
102
+ }
103
+ $xml['alt'] .= '</div>'.PHP_EOL;
104
+ $c['galleries'][] = $a + $b;
105
+ }
106
+ }
107
+ $xml['alt'] .= '</div>'.PHP_EOL;
108
+ $d = array('properties'=>$data) + $c;
109
+ $xml['json'] = json_encode($d);
110
+ ?>
admin/js/Jcrop/css/Jcrop.gif ADDED
Binary file
admin/js/Jcrop/css/jquery.Jcrop.css ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* Fixes issue here http://code.google.com/p/jcrop/issues/detail?id=1 */
2
+ .jcrop-holder { text-align: left; }
3
+
4
+ .jcrop-vline, .jcrop-hline
5
+ {
6
+ font-size: 0;
7
+ position: absolute;
8
+ background: white url('Jcrop.gif') top left repeat;
9
+ }
10
+ .jcrop-vline { height: 100%; width: 1px !important; }
11
+ .jcrop-hline { width: 100%; height: 1px !important; }
12
+ .jcrop-handle {
13
+ font-size: 1px;
14
+ width: 7px !important;
15
+ height: 7px !important;
16
+ border: 1px #eee solid;
17
+ background-color: #333;
18
+ *width: 9px;
19
+ *height: 9px;
20
+ }
21
+
22
+ .jcrop-tracker { width: 100%; height: 100%; }
23
+
24
+ .custom .jcrop-vline,
25
+ .custom .jcrop-hline
26
+ {
27
+ background: yellow;
28
+ }
29
+ .custom .jcrop-handle
30
+ {
31
+ border-color: black;
32
+ background-color: #C7BB00;
33
+ -moz-border-radius: 3px;
34
+ -webkit-border-radius: 3px;
35
+ }
36
+
37
+ #actualThumb img { width: 150px; height: auto; }
admin/js/Jcrop/js/jquery.Jcrop.js ADDED
@@ -0,0 +1,255 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * jquery.Jcrop.min.js v0.9.9 {{{ (build:20110724)
3
+ * jQuery Image Cropping Plugin - released under MIT License
4
+ * Copyright (c) 2008-2011 Tapmodo Interactive LLC
5
+ * https://github.com/tapmodo/Jcrop
6
+ */
7
+
8
+ (function($){$.Jcrop=function(obj,opt){var options=$.extend({},$.Jcrop.defaults),docOffset,lastcurs,ie6mode=false;function px(n){return parseInt(n,10)+'px';}
9
+ function cssClass(cl){return options.baseClass+'-'+cl;}
10
+ function supportsColorFade(){return $.fx.step.hasOwnProperty('backgroundColor');}
11
+ function getPos(obj)
12
+ {var pos=$(obj).offset();return[pos.left,pos.top];}
13
+ function mouseAbs(e)
14
+ {return[(e.pageX-docOffset[0]),(e.pageY-docOffset[1])];}
15
+ function setOptions(opt)
16
+ {if(typeof(opt)!=='object')opt={};options=$.extend(options,opt);$.each(['onChange','onSelect','onRelease','onDblClick'],function(i,e){if(typeof(options[e])!=='function')options[e]=function(){};});}
17
+ function startDragMode(mode,pos)
18
+ {docOffset=getPos($img);Tracker.setCursor(mode==='move'?mode:mode+'-resize');if(mode==='move'){return Tracker.activateHandlers(createMover(pos),doneSelect);}
19
+ var fc=Coords.getFixed();var opp=oppLockCorner(mode);var opc=Coords.getCorner(oppLockCorner(opp));Coords.setPressed(Coords.getCorner(opp));Coords.setCurrent(opc);Tracker.activateHandlers(dragmodeHandler(mode,fc),doneSelect);}
20
+ function dragmodeHandler(mode,f)
21
+ {return function(pos){if(!options.aspectRatio){switch(mode){case'e':pos[1]=f.y2;break;case'w':pos[1]=f.y2;break;case'n':pos[0]=f.x2;break;case's':pos[0]=f.x2;break;}}else{switch(mode){case'e':pos[1]=f.y+1;break;case'w':pos[1]=f.y+1;break;case'n':pos[0]=f.x+1;break;case's':pos[0]=f.x+1;break;}}
22
+ Coords.setCurrent(pos);Selection.update();};}
23
+ function createMover(pos)
24
+ {var lloc=pos;KeyManager.watchKeys();return function(pos){Coords.moveOffset([pos[0]-lloc[0],pos[1]-lloc[1]]);lloc=pos;Selection.update();};}
25
+ function oppLockCorner(ord)
26
+ {switch(ord){case'n':return'sw';case's':return'nw';case'e':return'nw';case'w':return'ne';case'ne':return'sw';case'nw':return'se';case'se':return'nw';case'sw':return'ne';}}
27
+ function createDragger(ord)
28
+ {return function(e){if(options.disabled){return false;}
29
+ if((ord==='move')&&!options.allowMove){return false;}
30
+ btndown=true;startDragMode(ord,mouseAbs(e));e.stopPropagation();e.preventDefault();return false;};}
31
+ function presize($obj,w,h)
32
+ {var nw=$obj.width(),nh=$obj.height();if((nw>w)&&w>0){nw=w;nh=(w/$obj.width())*$obj.height();}
33
+ if((nh>h)&&h>0){nh=h;nw=(h/$obj.height())*$obj.width();}
34
+ xscale=$obj.width()/nw;yscale=$obj.height()/nh;$obj.width(nw).height(nh);}
35
+ function unscale(c)
36
+ {return{x:parseInt(c.x*xscale,10),y:parseInt(c.y*yscale,10),x2:parseInt(c.x2*xscale,10),y2:parseInt(c.y2*yscale,10),w:parseInt(c.w*xscale,10),h:parseInt(c.h*yscale,10)};}
37
+ function doneSelect(pos)
38
+ {var c=Coords.getFixed();if((c.w>options.minSelect[0])&&(c.h>options.minSelect[1])){Selection.enableHandles();Selection.done();}else{Selection.release();}
39
+ Tracker.setCursor(options.allowSelect?'crosshair':'default');}
40
+ function newSelection(e)
41
+ {if(options.disabled){return false;}
42
+ if(!options.allowSelect){return false;}
43
+ btndown=true;docOffset=getPos($img);Selection.disableHandles();Tracker.setCursor('crosshair');var pos=mouseAbs(e);Coords.setPressed(pos);Selection.update();Tracker.activateHandlers(selectDrag,doneSelect);KeyManager.watchKeys();e.stopPropagation();e.preventDefault();return false;}
44
+ function selectDrag(pos)
45
+ {Coords.setCurrent(pos);Selection.update();}
46
+ function newTracker()
47
+ {var trk=$('<div></div>').addClass(cssClass('tracker'));if($.browser.msie){trk.css({opacity:0,backgroundColor:'white'});}
48
+ return trk;}
49
+ if($.browser.msie&&($.browser.version.split('.')[0]==='6')){ie6mode=true;}
50
+ if(typeof(obj)!=='object'){obj=$(obj)[0];}
51
+ if(typeof(opt)!=='object'){opt={};}
52
+ setOptions(opt);var img_css={border:'none',margin:0,padding:0,position:'absolute'};var $origimg=$(obj);var $img=$origimg.clone().removeAttr('id').css(img_css);$img.width($origimg.width());$img.height($origimg.height());$origimg.after($img).hide();presize($img,options.boxWidth,options.boxHeight);var boundx=$img.width(),boundy=$img.height(),$div=$('<div />').width(boundx).height(boundy).addClass(cssClass('holder')).css({position:'relative',backgroundColor:options.bgColor}).insertAfter($origimg).append($img);if(options.addClass){$div.addClass(options.addClass);}
53
+ var $img2=$('<img />').attr('src',$img.attr('src')).css(img_css).width(boundx).height(boundy),$img_holder=$('<div />').width('100%').height('100%').css({zIndex:310,position:'absolute',overflow:'hidden'}),$hdl_holder=$('<div />').width('100%').height('100%').css('zIndex',320),$sel=$('<div />').css({position:'absolute',zIndex:600}).dblclick(function(){var c=Coords.getFixed();options.onDblClick.call(api,c);}).insertBefore($img).append($img_holder,$hdl_holder);$img_holder.append($img2);if(ie6mode){$sel.css({overflowY:'hidden'});}
54
+ var bound=options.boundary;var $trk=newTracker().width(boundx+(bound*2)).height(boundy+(bound*2)).css({position:'absolute',top:px(-bound),left:px(-bound),zIndex:290}).mousedown(newSelection);var bgcolor=options.bgColor,bgopacity=options.bgOpacity,xlimit,ylimit,xmin,ymin,xscale,yscale,enabled=true,btndown,animating,shift_down;docOffset=getPos($img);var Touch=(function(){function hasTouchSupport(){var support={},events=['touchstart','touchmove','touchend'],el=document.createElement('div'),i;try{for(i=0;i<events.length;i++){var eventName=events[i];eventName='on'+eventName;var isSupported=(eventName in el);if(!isSupported){el.setAttribute(eventName,'return;');isSupported=typeof el[eventName]=='function';}
55
+ support[events[i]]=isSupported;}
56
+ return support.touchstart&&support.touchend&&support.touchmove;}
57
+ catch(err){return false;}}
58
+ function detectSupport(){if((options.touchSupport===true)||(options.touchSupport===false))return options.touchSupport;else return hasTouchSupport();}
59
+ return{createDragger:function(ord){return function(e){e.pageX=e.originalEvent.changedTouches[0].pageX;e.pageY=e.originalEvent.changedTouches[0].pageY;if(options.disabled){return false;}
60
+ if((ord==='move')&&!options.allowMove){return false;}
61
+ btndown=true;startDragMode(ord,mouseAbs(e));e.stopPropagation();e.preventDefault();return false;};},newSelection:function(e){e.pageX=e.originalEvent.changedTouches[0].pageX;e.pageY=e.originalEvent.changedTouches[0].pageY;return newSelection(e);},isSupported:hasTouchSupport,support:detectSupport()};}());var Coords=(function(){var x1=0,y1=0,x2=0,y2=0,ox,oy;function setPressed(pos)
62
+ {pos=rebound(pos);x2=x1=pos[0];y2=y1=pos[1];}
63
+ function setCurrent(pos)
64
+ {pos=rebound(pos);ox=pos[0]-x2;oy=pos[1]-y2;x2=pos[0];y2=pos[1];}
65
+ function getOffset()
66
+ {return[ox,oy];}
67
+ function moveOffset(offset)
68
+ {var ox=offset[0],oy=offset[1];if(0>x1+ox){ox-=ox+x1;}
69
+ if(0>y1+oy){oy-=oy+y1;}
70
+ if(boundy<y2+oy){oy+=boundy-(y2+oy);}
71
+ if(boundx<x2+ox){ox+=boundx-(x2+ox);}
72
+ x1+=ox;x2+=ox;y1+=oy;y2+=oy;}
73
+ function getCorner(ord)
74
+ {var c=getFixed();switch(ord){case'ne':return[c.x2,c.y];case'nw':return[c.x,c.y];case'se':return[c.x2,c.y2];case'sw':return[c.x,c.y2];}}
75
+ function getFixed()
76
+ {if(!options.aspectRatio){return getRect();}
77
+ var aspect=options.aspectRatio,min_x=options.minSize[0]/xscale,max_x=options.maxSize[0]/xscale,max_y=options.maxSize[1]/yscale,rw=x2-x1,rh=y2-y1,rwa=Math.abs(rw),rha=Math.abs(rh),real_ratio=rwa/rha,xx,yy;if(max_x===0){max_x=boundx*10;}
78
+ if(max_y===0){max_y=boundy*10;}
79
+ if(real_ratio<aspect){yy=y2;w=rha*aspect;xx=rw<0?x1-w:w+x1;if(xx<0){xx=0;h=Math.abs((xx-x1)/aspect);yy=rh<0?y1-h:h+y1;}else if(xx>boundx){xx=boundx;h=Math.abs((xx-x1)/aspect);yy=rh<0?y1-h:h+y1;}}else{xx=x2;h=rwa/aspect;yy=rh<0?y1-h:y1+h;if(yy<0){yy=0;w=Math.abs((yy-y1)*aspect);xx=rw<0?x1-w:w+x1;}else if(yy>boundy){yy=boundy;w=Math.abs(yy-y1)*aspect;xx=rw<0?x1-w:w+x1;}}
80
+ if(xx>x1){if(xx-x1<min_x){xx=x1+min_x;}else if(xx-x1>max_x){xx=x1+max_x;}
81
+ if(yy>y1){yy=y1+(xx-x1)/aspect;}else{yy=y1-(xx-x1)/aspect;}}else if(xx<x1){if(x1-xx<min_x){xx=x1-min_x;}else if(x1-xx>max_x){xx=x1-max_x;}
82
+ if(yy>y1){yy=y1+(x1-xx)/aspect;}else{yy=y1-(x1-xx)/aspect;}}
83
+ if(xx<0){x1-=xx;xx=0;}else if(xx>boundx){x1-=xx-boundx;xx=boundx;}
84
+ if(yy<0){y1-=yy;yy=0;}else if(yy>boundy){y1-=yy-boundy;yy=boundy;}
85
+ return makeObj(flipCoords(x1,y1,xx,yy));}
86
+ function rebound(p)
87
+ {if(p[0]<0){p[0]=0;}
88
+ if(p[1]<0){p[1]=0;}
89
+ if(p[0]>boundx){p[0]=boundx;}
90
+ if(p[1]>boundy){p[1]=boundy;}
91
+ return[p[0],p[1]];}
92
+ function flipCoords(x1,y1,x2,y2)
93
+ {var xa=x1,xb=x2,ya=y1,yb=y2;if(x2<x1){xa=x2;xb=x1;}
94
+ if(y2<y1){ya=y2;yb=y1;}
95
+ return[Math.round(xa),Math.round(ya),Math.round(xb),Math.round(yb)];}
96
+ function getRect()
97
+ {var xsize=x2-x1,ysize=y2-y1,delta;if(xlimit&&(Math.abs(xsize)>xlimit)){x2=(xsize>0)?(x1+xlimit):(x1-xlimit);}
98
+ if(ylimit&&(Math.abs(ysize)>ylimit)){y2=(ysize>0)?(y1+ylimit):(y1-ylimit);}
99
+ if(ymin/yscale&&(Math.abs(ysize)<ymin/yscale)){y2=(ysize>0)?(y1+ymin/yscale):(y1-ymin/yscale);}
100
+ if(xmin/xscale&&(Math.abs(xsize)<xmin/xscale)){x2=(xsize>0)?(x1+xmin/xscale):(x1-xmin/xscale);}
101
+ if(x1<0){x2-=x1;x1-=x1;}
102
+ if(y1<0){y2-=y1;y1-=y1;}
103
+ if(x2<0){x1-=x2;x2-=x2;}
104
+ if(y2<0){y1-=y2;y2-=y2;}
105
+ if(x2>boundx){delta=x2-boundx;x1-=delta;x2-=delta;}
106
+ if(y2>boundy){delta=y2-boundy;y1-=delta;y2-=delta;}
107
+ if(x1>boundx){delta=x1-boundy;y2-=delta;y1-=delta;}
108
+ if(y1>boundy){delta=y1-boundy;y2-=delta;y1-=delta;}
109
+ return makeObj(flipCoords(x1,y1,x2,y2));}
110
+ function makeObj(a)
111
+ {return{x:a[0],y:a[1],x2:a[2],y2:a[3],w:a[2]-a[0],h:a[3]-a[1]};}
112
+ return{flipCoords:flipCoords,setPressed:setPressed,setCurrent:setCurrent,getOffset:getOffset,moveOffset:moveOffset,getCorner:getCorner,getFixed:getFixed};}());var Shade=(function(){var enabled=false,holder=$('<div />').css({position:'absolute',zIndex:240,opacity:0}),shades={top:createShade(),left:createShade().height(boundy),right:createShade().height(boundy),bottom:createShade()};function resizeShades(w,h){shades.left.css({height:px(h)});shades.right.css({height:px(h)});}
113
+ function updateAuto()
114
+ {return updateShade(Coords.getFixed());}
115
+ function updateShade(c)
116
+ {shades.top.css({left:px(c.x),width:px(c.w),height:px(c.y)});shades.bottom.css({top:px(c.y2),left:px(c.x),width:px(c.w),height:px(boundy-c.y2)});shades.right.css({left:px(c.x2),width:px(boundx-c.x2)});shades.left.css({width:px(c.x)});}
117
+ function createShade(){return $('<div />').css({position:'absolute',backgroundColor:options.shadeColor||options.bgColor}).appendTo(holder);}
118
+ function enableShade(){if(!enabled){enabled=true;holder.insertBefore($img);updateAuto();Selection.setBgOpacity(1,0,1);$img2.hide();setBgColor(options.shadeColor||options.bgColor,1);if(Selection.isAwake())
119
+ {setOpacity(options.bgOpacity,1);}
120
+ else setOpacity(1,1);}}
121
+ function setBgColor(color,now){colorChangeMacro(getShades(),color,now);}
122
+ function disableShade(){if(enabled){holder.remove();$img2.show();enabled=false;if(Selection.isAwake()){Selection.setBgOpacity(options.bgOpacity,1,1);}else{Selection.setBgOpacity(1,1,1);Selection.disableHandles();}
123
+ colorChangeMacro($div,0,1);}}
124
+ function setOpacity(opacity,now){if(enabled){if(options.bgFade&&!now){holder.animate({opacity:1-opacity},{queue:false,duration:options.fadeTime});}
125
+ else holder.css({opacity:1-opacity});}}
126
+ function refreshAll(){options.shade?enableShade():disableShade();if(Selection.isAwake())setOpacity(options.bgOpacity);}
127
+ function getShades(){return holder.children();}
128
+ return{update:updateAuto,updateRaw:updateShade,getShades:getShades,setBgColor:setBgColor,enable:enableShade,disable:disableShade,resize:resizeShades,refresh:refreshAll,opacity:setOpacity};}());var Selection=(function(){var awake,hdep=370;var borders={};var handle={};var seehandles=false;var hhs=options.handleOffset;function insertBorder(type)
129
+ {var jq=$('<div />').css({position:'absolute',opacity:options.borderOpacity}).addClass(cssClass(type));$img_holder.append(jq);return jq;}
130
+ function dragDiv(ord,zi)
131
+ {var jq=$('<div />').mousedown(createDragger(ord)).css({cursor:ord+'-resize',position:'absolute',zIndex:zi});if(Touch.support){jq.bind('touchstart',Touch.createDragger(ord));}
132
+ $hdl_holder.append(jq);return jq;}
133
+ function insertHandle(ord)
134
+ {var hs=options.handleSize;return dragDiv(ord,hdep++).css({top:px(-hhs+1),left:px(-hhs+1),opacity:options.handleOpacity}).width(hs).height(hs).addClass(cssClass('handle'));}
135
+ function insertDragbar(ord)
136
+ {var s=options.handleSize,h=s,w=s,t=hhs,l=hhs;switch(ord){case'n':case's':w='100%';break;case'e':case'w':h='100%';break;}
137
+ return dragDiv(ord,hdep++).width(w).height(h).css({top:px(-t+1),left:px(-l+1)});}
138
+ function createHandles(li)
139
+ {var i;for(i=0;i<li.length;i++){handle[li[i]]=insertHandle(li[i]);}}
140
+ function moveHandles(c)
141
+ {var midvert=Math.round((c.h/2)-hhs),midhoriz=Math.round((c.w/2)-hhs),north=-hhs+1,west=-hhs+1,east=c.w-hhs,south=c.h-hhs,x,y;if(handle.e){handle.e.css({top:px(midvert),left:px(east)});handle.w.css({top:px(midvert)});handle.s.css({top:px(south),left:px(midhoriz)});handle.n.css({left:px(midhoriz)});}
142
+ if(handle.ne){handle.ne.css({left:px(east)});handle.se.css({top:px(south),left:px(east)});handle.sw.css({top:px(south)});}
143
+ if(handle.b){handle.b.css({top:px(south)});handle.r.css({left:px(east)});}}
144
+ function moveto(x,y)
145
+ {if(!options.shade){$img2.css({top:px(-y),left:px(-x)});}
146
+ $sel.css({top:px(y),left:px(x)});}
147
+ function resize(w,h)
148
+ {$sel.width(w).height(h);}
149
+ function refresh()
150
+ {var c=Coords.getFixed();Coords.setPressed([c.x,c.y]);Coords.setCurrent([c.x2,c.y2]);updateVisible();}
151
+ function updateVisible()
152
+ {if(awake){return update();}}
153
+ function update()
154
+ {var c=Coords.getFixed();resize(c.w,c.h);moveto(c.x,c.y);if(options.shade)Shade.updateRaw(c);if(seehandles){moveHandles(c);}
155
+ if(!awake){show();}
156
+ options.onChange.call(api,unscale(c));}
157
+ function setBgOpacity(opacity,force,now)
158
+ {if(!awake&&!force)return;if(options.bgFade&&!now){$img.animate({opacity:opacity},{queue:false,duration:options.fadeTime});}else{$img.css('opacity',opacity);}}
159
+ function show()
160
+ {$sel.show();if(options.shade)Shade.opacity(bgopacity);else setBgOpacity(bgopacity,true);awake=true;}
161
+ function release()
162
+ {disableHandles();$sel.hide();if(options.shade)Shade.opacity(1);else setBgOpacity(1);awake=false;options.onRelease.call(api);}
163
+ function showHandles()
164
+ {if(seehandles){moveHandles(Coords.getFixed());$hdl_holder.show();}}
165
+ function enableHandles()
166
+ {seehandles=true;if(options.allowResize){moveHandles(Coords.getFixed());$hdl_holder.show();return true;}}
167
+ function disableHandles()
168
+ {seehandles=false;$hdl_holder.hide();}
169
+ function animMode(v)
170
+ {if(animating===v){disableHandles();}else{enableHandles();}}
171
+ function done()
172
+ {animMode(false);refresh();}
173
+ if(options.drawBorders){borders={top:insertBorder('hline'),bottom:insertBorder('hline bottom'),left:insertBorder('vline'),right:insertBorder('vline right')};}
174
+ if(options.dragEdges){handle.t=insertDragbar('n');handle.b=insertDragbar('s');handle.r=insertDragbar('e');handle.l=insertDragbar('w');}
175
+ if(options.sideHandles){createHandles(['n','s','e','w']);}
176
+ if(options.cornerHandles){createHandles(['sw','nw','ne','se']);}
177
+ var $track=newTracker().mousedown(createDragger('move')).css({cursor:'move',position:'absolute',zIndex:360});if(Touch.support){$track.bind('touchstart.jcrop',Touch.createDragger('move'));}
178
+ $img_holder.append($track);disableHandles();return{updateVisible:updateVisible,update:update,release:release,refresh:refresh,isAwake:function(){return awake;},setCursor:function(cursor){$track.css('cursor',cursor);},enableHandles:enableHandles,enableOnly:function(){seehandles=true;},showHandles:showHandles,disableHandles:disableHandles,animMode:animMode,setBgOpacity:setBgOpacity,done:done};}());var Tracker=(function(){var onMove=function(){},onDone=function(){},trackDoc=options.trackDocument;function toFront()
179
+ {$trk.css({zIndex:450});if(Touch.support){$(document).bind('touchmove',trackTouchMove).bind('touchend',trackTouchEnd);}
180
+ if(trackDoc){$(document).bind('mousemove',trackMove).bind('mouseup',trackUp);}}
181
+ function toBack()
182
+ {$trk.css({zIndex:290});if(Touch.support){$(document).unbind('touchmove',trackTouchMove).unbind('touchend',trackTouchEnd);}
183
+ if(trackDoc){$(document).unbind('mousemove',trackMove).unbind('mouseup',trackUp);}}
184
+ function trackMove(e)
185
+ {onMove(mouseAbs(e));return false;}
186
+ function trackUp(e)
187
+ {e.preventDefault();e.stopPropagation();if(btndown){btndown=false;onDone(mouseAbs(e));if(Selection.isAwake()){options.onSelect.call(api,unscale(Coords.getFixed()));}
188
+ toBack();onMove=function(){};onDone=function(){};}
189
+ return false;}
190
+ function activateHandlers(move,done)
191
+ {btndown=true;onMove=move;onDone=done;toFront();return false;}
192
+ function trackTouchMove(e)
193
+ {e.pageX=e.originalEvent.changedTouches[0].pageX;e.pageY=e.originalEvent.changedTouches[0].pageY;return trackMove(e);}
194
+ function trackTouchEnd(e)
195
+ {e.pageX=e.originalEvent.changedTouches[0].pageX;e.pageY=e.originalEvent.changedTouches[0].pageY;return trackUp(e);}
196
+ function setCursor(t)
197
+ {$trk.css('cursor',t);}
198
+ if(!trackDoc){$trk.mousemove(trackMove).mouseup(trackUp).mouseout(trackUp);}
199
+ $img.before($trk);return{activateHandlers:activateHandlers,setCursor:setCursor};}());var KeyManager=(function(){var $keymgr=$('<input type="radio" />').css({position:'fixed',left:'-120px',width:'12px'}),$keywrap=$('<div />').css({position:'absolute',overflow:'hidden'}).append($keymgr);function watchKeys()
200
+ {if(options.keySupport){$keymgr.show();$keymgr.focus();}}
201
+ function onBlur(e)
202
+ {$keymgr.hide();}
203
+ function doNudge(e,x,y)
204
+ {if(options.allowMove){Coords.moveOffset([x,y]);Selection.updateVisible();}
205
+ e.preventDefault();e.stopPropagation();}
206
+ function parseKey(e)
207
+ {if(e.ctrlKey){return true;}
208
+ shift_down=e.shiftKey?true:false;var nudge=shift_down?10:1;switch(e.keyCode){case 37:doNudge(e,-nudge,0);break;case 39:doNudge(e,nudge,0);break;case 38:doNudge(e,0,-nudge);break;case 40:doNudge(e,0,nudge);break;case 27:if(options.allowSelect)Selection.release();break;case 9:return true;}
209
+ return false;}
210
+ if(options.keySupport){$keymgr.keydown(parseKey).blur(onBlur);if(ie6mode||!options.fixedSupport){$keymgr.css({position:'absolute',left:'-20px'});$keywrap.append($keymgr).insertBefore($img);}else{$keymgr.insertBefore($img);}}
211
+ return{watchKeys:watchKeys};}());function setClass(cname)
212
+ {$div.removeClass().addClass(cssClass('holder')).addClass(cname);}
213
+ function animateTo(a,callback)
214
+ {var x1=parseInt(a[0],10)/xscale,y1=parseInt(a[1],10)/yscale,x2=parseInt(a[2],10)/xscale,y2=parseInt(a[3],10)/yscale;if(animating){return;}
215
+ var animto=Coords.flipCoords(x1,y1,x2,y2),c=Coords.getFixed(),initcr=[c.x,c.y,c.x2,c.y2],animat=initcr,interv=options.animationDelay,ix1=animto[0]-initcr[0],iy1=animto[1]-initcr[1],ix2=animto[2]-initcr[2],iy2=animto[3]-initcr[3],pcent=0,velocity=options.swingSpeed;x=animat[0];y=animat[1];x2=animat[2];y2=animat[3];Selection.animMode(true);var anim_timer;function queueAnimator(){window.setTimeout(animator,interv);}
216
+ var animator=(function(){return function(){pcent+=(100-pcent)/velocity;animat[0]=x+((pcent/100)*ix1);animat[1]=y+((pcent/100)*iy1);animat[2]=x2+((pcent/100)*ix2);animat[3]=y2+((pcent/100)*iy2);if(pcent>=99.8){pcent=100;}
217
+ if(pcent<100){setSelectRaw(animat);queueAnimator();}else{Selection.done();if(typeof(callback)==='function'){callback.call(api);}}};}());queueAnimator();}
218
+ function setSelect(rect)
219
+ {setSelectRaw([parseInt(rect[0],10)/xscale,parseInt(rect[1],10)/yscale,parseInt(rect[2],10)/xscale,parseInt(rect[3],10)/yscale]);options.onSelect.call(api,unscale(Coords.getFixed()));}
220
+ function setSelectRaw(l)
221
+ {Coords.setPressed([l[0],l[1]]);Coords.setCurrent([l[2],l[3]]);Selection.update();}
222
+ function tellSelect()
223
+ {return unscale(Coords.getFixed());}
224
+ function tellScaled()
225
+ {return Coords.getFixed();}
226
+ function setOptionsNew(opt)
227
+ {setOptions(opt);interfaceUpdate();}
228
+ function disableCrop()
229
+ {options.disabled=true;Selection.disableHandles();Selection.setCursor('default');Tracker.setCursor('default');}
230
+ function enableCrop()
231
+ {options.disabled=false;interfaceUpdate();}
232
+ function cancelCrop()
233
+ {Selection.done();Tracker.activateHandlers(null,null);}
234
+ function destroy()
235
+ {$div.remove();$origimg.show();$(obj).removeData('Jcrop');}
236
+ function setImage(src,callback)
237
+ {Selection.release();disableCrop();var img=new Image();img.onload=function(){var iw=img.width;var ih=img.height;var bw=options.boxWidth;var bh=options.boxHeight;$img.width(iw).height(ih);$img.attr('src',src);$img2.attr('src',src);presize($img,bw,bh);boundx=$img.width();boundy=$img.height();$img2.width(boundx).height(boundy);$trk.width(boundx+(bound*2)).height(boundy+(bound*2));$div.width(boundx).height(boundy);Shade.resize(boundx,boundy);enableCrop();if(typeof(callback)==='function'){callback.call(api);}};img.src=src;}
238
+ function colorChangeMacro($obj,color,now){var mycolor=color||options.bgColor;if(options.bgFade&&supportsColorFade()&&options.fadeTime&&!now){$obj.animate({backgroundColor:mycolor},{queue:false,duration:options.fadeTime});}else{$obj.css('backgroundColor',mycolor);}}
239
+ function interfaceUpdate(alt)
240
+ {if(options.allowResize){if(alt){Selection.enableOnly();}else{Selection.enableHandles();}}else{Selection.disableHandles();}
241
+ Tracker.setCursor(options.allowSelect?'crosshair':'default');Selection.setCursor(options.allowMove?'move':'default');if(options.hasOwnProperty('setSelect')){setSelect(options.setSelect);Selection.done();delete(options.setSelect);}
242
+ if(options.hasOwnProperty('trueSize')){xscale=options.trueSize[0]/boundx;yscale=options.trueSize[1]/boundy;}
243
+ Shade.refresh();if(options.bgColor!=bgcolor){colorChangeMacro(options.shade?Shade.getShades():$div,options.shade?(options.shadeColor||options.bgColor):options.bgColor);bgcolor=options.bgColor;}
244
+ if(bgopacity!=options.bgOpacity){bgopacity=options.bgOpacity;if(options.shade)Shade.refresh();else Selection.setBgOpacity(bgopacity);}
245
+ xlimit=options.maxSize[0]||0;ylimit=options.maxSize[1]||0;xmin=options.minSize[0]||0;ymin=options.minSize[1]||0;if(options.hasOwnProperty('outerImage')){$img.attr('src',options.outerImage);delete(options.outerImage);}
246
+ Selection.refresh();}
247
+ if(Touch.support)$trk.bind('touchstart',Touch.newSelection);$hdl_holder.hide();interfaceUpdate(true);var api={setImage:setImage,animateTo:animateTo,setSelect:setSelect,setOptions:setOptionsNew,tellSelect:tellSelect,tellScaled:tellScaled,setClass:setClass,disable:disableCrop,enable:enableCrop,cancel:cancelCrop,release:Selection.release,destroy:destroy,focus:KeyManager.watchKeys,getBounds:function(){return[boundx*xscale,boundy*yscale];},getWidgetSize:function(){return[boundx,boundy];},getScaleFactor:function(){return[xscale,yscale];},ui:{holder:$div,selection:$sel}};if($.browser.msie){$div.bind('selectstart',function(){return false;});}
248
+ $origimg.data('Jcrop',api);return api;};$.fn.Jcrop=function(options,callback)
249
+ {function attachWhenDone(from)
250
+ {var opt=(typeof(options)==='object')?options:{};var loadsrc=opt.useImg||from.src;var img=new Image();img.onload=function(){function attachJcrop(){var api=$.Jcrop(from,opt);if(typeof(callback)==='function'){callback.call(api);}}
251
+ function attachAttempt(){if(!img.width||!img.height){window.setTimeout(attachAttempt,50);}else{attachJcrop();}}
252
+ window.setTimeout(attachAttempt,50);};img.src=loadsrc;}
253
+ this.each(function(){if($(this).data('Jcrop')){if(options==='api'){return $(this).data('Jcrop');}
254
+ else{$(this).data('Jcrop').setOptions(options);}}
255
+ else{attachWhenDone(this);}});return this;};$.Jcrop.defaults={allowSelect:true,allowMove:true,allowResize:true,trackDocument:true,baseClass:'jcrop',addClass:null,bgColor:'black',bgOpacity:0.6,bgFade:false,borderOpacity:0.4,handleOpacity:0.5,handleSize:7,handleOffset:5,aspectRatio:0,keySupport:true,cornerHandles:true,sideHandles:true,drawBorders:true,dragEdges:true,fixedSupport:true,touchSupport:null,shade:false,boxWidth:0,boxHeight:0,boundary:2,fadeTime:400,animationDelay:20,swingSpeed:3,minSelect:[0,0],maxSize:[0,0],minSize:[0,0],onChange:function(){},onSelect:function(){},onDblClick:function(){},onRelease:function(){}};}(jQuery));
admin/js/disablescroll.js ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 ADDED
@@ -0,0 +1,345 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 ADDED
@@ -0,0 +1,116 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Ajax Plugin for Flash Album Gallery
3
+ */
4
+ (function($) {
5
+ flagAjax = {
6
+ settings: {
7
+ url: flagAjaxSetup.url,
8
+ type: "POST",
9
+ action: flagAjaxSetup.action,
10
+ operation : flagAjaxSetup.operation,
11
+ nonce: flagAjaxSetup.nonce,
12
+ ids: flagAjaxSetup.ids,
13
+ permission: flagAjaxSetup.permission,
14
+ error: flagAjaxSetup.error,
15
+ failure: flagAjaxSetup.failure,
16
+ timeout: 10000
17
+ },
18
+
19
+ run: function( index ) {
20
+ s = this.settings;
21
+ var req = $.ajax({
22
+ type: "POST",
23
+ url: s.url,
24
+ data:"action=" + s.action + "&operation=" + s.operation + "&_wpnonce=" + s.nonce + "&image=" + s.ids[index],
25
+ cache: false,
26
+ timeout: 10000,
27
+ success: function(msg){
28
+ switch ( parseInt(msg) ) {
29
+ case -1:
30
+ flagProgressBar.addNote( flagAjax.settings.permission );
31
+ break;
32
+ case 0:
33
+ flagProgressBar.addNote( flagAjax.settings.error );
34
+ break;
35
+ case 1:
36
+ // show nothing, its better
37
+ break;
38
+ default:
39
+ // Return the message
40
+ flagProgressBar.addNote( "<strong>ID " + flagAjax.settings.ids[index] + ":</strong> " + flagAjax.settings.failure, msg );
41
+ break;
42
+ }
43
+
44
+ },
45
+ error: function (msg) {
46
+ flagProgressBar.addNote( "<strong>ID " + flagAjax.settings.ids[index] + ":</strong> " + flagAjax.settings.failure, msg.responseText );
47
+ },
48
+ complete: function () {
49
+ index++;
50
+ flagProgressBar.increase( index );
51
+ // parse the whole array
52
+ if (index < flagAjax.settings.ids.length)
53
+ flagAjax.run( index );
54
+ else
55
+ flagProgressBar.finished();
56
+ }
57
+ });
58
+ },
59
+
60
+ readIDs: function( index ) {
61
+ s = this.settings;
62
+ var req = $.ajax({
63
+ type: "POST",
64
+ url: s.url,
65
+ data:"action=" + s.action + "&operation=" + s.operation + "&_wpnonce=" + s.nonce + "&image=" + s.ids[index],
66
+ dataType: "json",
67
+ cache: false,
68
+ timeout: 10000,
69
+ success: function(msg){
70
+ // join the array
71
+ imageIDS = imageIDS.concat(msg);
72
+ },
73
+ error: function (msg) {
74
+ flagProgressBar.addNote( "<strong>ID " + flagAjax.settings.ids[index] + ":</strong> " + flagAjax.settings.failure, msg.responseText );
75
+ },
76
+ complete: function () {
77
+ index++;
78
+ flagProgressBar.increase( index );
79
+ // parse the whole array
80
+ if (index < flagAjax.settings.ids.length)
81
+ flagAjax.readIDs( index );
82
+ else {
83
+ // and now run the image operation
84
+ index = 0;
85
+ flagAjax.settings.ids = imageIDS;
86
+ flagAjax.settings.operation = nextOperation;
87
+ flagAjax.settings.maxStep = imageIDS.length;
88
+ flagProgressBar.init( flagAjax.settings );
89
+ flagAjax.run( index );
90
+ }
91
+ }
92
+ });
93
+ },
94
+
95
+ init: function( s ) {
96
+
97
+ var index = 0;
98
+
99
+ // get the settings
100
+ this.settings = $.extend( {}, this.settings, {}, s || {} );
101
+
102
+ // a gallery operation need first all image ids via ajax
103
+ if ( this.settings.operation.substring(0, 8) == 'gallery_' ) {
104
+ nextOperation = this.settings.operation.substring(8);
105
+ //first run, get all the ids
106
+ this.settings.operation = 'get_image_ids';
107
+ imageIDS = new Array();
108
+ this.readIDs( index );
109
+ } else {
110
+ // start the ajax process
111
+ this.run( index );
112
+ }
113
+ }
114
+ }
115
+
116
+ }(jQuery));
admin/js/flag.progressbar.js ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Progress bar Plugin for FlashGen gallery
3
+ * Version: 1.0.0
4
+ * Author : Sergey Pasyuk
5
+ */
6
+ (function($) {
7
+ flagProgressBar = {
8
+
9
+ settings: {
10
+ id: 'progressbar',
11
+ maxStep: 100,
12
+ wait: false,
13
+ header: ''
14
+ },
15
+
16
+ init: function( s ) {
17
+
18
+ s = this.settings = $.extend( {}, this.settings, {}, s || {} );
19
+
20
+ div = $('#' + s.id + '_container');
21
+ width = Math.round( ( 100 / s.maxStep ) * 100 ) /100;
22
+
23
+ if ( div.find("#" + s.id).length == 0) {
24
+ if (s.header.length > 0)
25
+ div.append('<h2>'+ s.header +'</h2>');
26
+ div.append('<div id="' + s.id + '" class="progressborder"><div class="' + s.id + '"><span>0%</span></div></div>');
27
+ }
28
+ },
29
+
30
+ addMessage: function( message ) {
31
+ s = this.settings;
32
+ if ( div.find("#" + s.id + "_message").length == 0)
33
+ div.append('<div class="' + s.id + '_message"><span style="display:block" id="' + s.id + '_message">' + message + '</span></div>');
34
+ else
35
+ $("#" + s.id + "_message").html( message );
36
+ },
37
+
38
+ addNote: function( note, detail ) {
39
+ s = this.settings;
40
+ s.wait = true;
41
+ if ( div.find("#" + s.id + "_note").length == 0)
42
+ div.append('<ul id="' + s.id + '_note">&nbsp;</ul>');
43
+
44
+ if (detail)
45
+ $("#" + s.id + "_note").append("<li>" + note + "<div class='show_details'><span>[more]</span><br />" + detail + "</div></li>");
46
+ else
47
+ $("#" + s.id + "_note").append("<li>" + note + "</li>");
48
+ },
49
+
50
+ increase: function( step ) {
51
+ s = this.settings;
52
+ var value = step * width + "%";
53
+ var rvalue = Math.round (step * width) + "%" ;
54
+ $("#" + s.id + " div").width( value );
55
+ $("#" + s.id + " span").html( rvalue );
56
+ },
57
+
58
+ finished: function() {
59
+ s = this.settings;
60
+ $("#" + s.id + " div").width( '100%' );
61
+ $("#" + s.id + " span").html( '100%' );
62
+ // in the case we add a note , we should wait for a click
63
+ if (s.wait) {
64
+ setTimeout(function() {
65
+ $("#" + s.id).hide("slow");
66
+ }, 2000);
67
+ div.click(function () {
68
+ jQuery('.flagform').prepend("<input type=\"hidden\" name=\"ajax_callback\" value=\"0\">");
69
+ jQuery('.flagform').submit();
70
+ });
71
+ } else {
72
+ //div.hide("slow");
73
+ jQuery("#" + s.id).hide("slow");
74
+ jQuery("#" + s.id + "_container h2").hide("slow");
75
+ jQuery('.flagform').prepend("<input type=\"hidden\" name=\"ajax_callback\" value=\"1\">");
76
+ jQuery('.flagform').submit();
77
+ }
78
+ }
79
+ };
80
+ })(jQuery);
admin/js/flagscroll.js ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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/arrows.png ADDED
Binary file
admin/js/images/blank.gif ADDED
Binary file
admin/js/images/bullets.png ADDED
Binary file
admin/js/images/fancy_close.png ADDED
Binary file
admin/js/images/fancy_loading.png ADDED
Binary file
admin/js/images/fancy_nav_left.png ADDED
Binary file
admin/js/images/fancy_nav_right.png ADDED
Binary file
admin/js/images/fancy_nav_slide.png ADDED
Binary file
admin/js/images/fancy_shadow_e.png ADDED
Binary file
admin/js/images/fancy_shadow_n.png ADDED
Binary file
admin/js/images/fancy_shadow_ne.png ADDED
Binary file
admin/js/images/fancy_shadow_nw.png ADDED
Binary file
admin/js/images/fancy_shadow_s.png ADDED
Binary file
admin/js/images/fancy_shadow_se.png ADDED
Binary file
admin/js/images/fancy_shadow_sw.png ADDED
Binary file
admin/js/images/fancy_shadow_w.png ADDED
Binary file
admin/js/images/fancy_title_left.png ADDED
Binary file
admin/js/images/fancy_title_main.png ADDED
Binary file
admin/js/images/fancy_title_over.png ADDED
Binary file
admin/js/images/fancy_title_right.png ADDED
Binary file
admin/js/images/fancybox-x.png ADDED
Binary file
admin/js/images/fancybox-y.png ADDED
Binary file
admin/js/images/fancybox.png ADDED
Binary file
admin/js/images/loading.gif ADDED
Binary file
admin/js/jquery.MultiFile.js ADDED
@@ -0,0 +1,535 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ ### jQuery Multiple File Upload Plugin v1.46 - 2009-05-12 ###
3
+ * Home: http://www.fyneworks.com/jquery/multiple-file-upload/
4
+ * Code: http://code.google.com/p/jquery-multifile-plugin/
5
+ *
6
+ * Dual licensed under the MIT and GPL licenses:
7
+ * http://www.opensource.org/licenses/mit-license.php
8
+ * http://www.gnu.org/licenses/gpl.html
9
+ ###
10
+ */
11
+
12
+ /*# AVOID COLLISIONS #*/
13
+ ;if(window.jQuery) (function($){
14
+ /*# AVOID COLLISIONS #*/
15
+
16
+ // plugin initialization
17
+ $.fn.MultiFile = function(options){
18
+ if(this.length==0) return this; // quick fail
19
+
20
+ // Handle API methods
21
+ if(typeof arguments[0]=='string'){
22
+ // Perform API methods on individual elements
23
+ if(this.length>1){
24
+ var args = arguments;
25
+ return this.each(function(){
26
+ $.fn.MultiFile.apply($(this), args);
27
+ });
28
+ };
29
+ // Invoke API method handler
30
+ $.fn.MultiFile[arguments[0]].apply(this, $.makeArray(arguments).slice(1) || []);
31
+ // Quick exit...
32
+ return this;
33
+ };
34
+
35
+ // Initialize options for this call
36
+ var options = $.extend(
37
+ {}/* new object */,
38
+ $.fn.MultiFile.options/* default options */,
39
+ options || {} /* just-in-time options */
40
+ );
41
+
42
+ // Empty Element Fix!!!
43
+ // this code will automatically intercept native form submissions
44
+ // and disable empty file elements
45
+ $('form')
46
+ .not('MultiFile-intercepted')
47
+ .addClass('MultiFile-intercepted')
48
+ .submit($.fn.MultiFile.disableEmpty);
49
+
50
+ //### http://plugins.jquery.com/node/1363
51
+ // utility method to integrate this plugin with others...
52
+ if($.fn.MultiFile.options.autoIntercept){
53
+ $.fn.MultiFile.intercept( $.fn.MultiFile.options.autoIntercept /* array of methods to intercept */ );
54
+ $.fn.MultiFile.options.autoIntercept = null; /* only run this once */
55
+ };
56
+
57
+ // loop through each matched element
58
+ this
59
+ .not('.MultiFile-applied')
60
+ .addClass('MultiFile-applied')
61
+ .each(function(){
62
+ //#####################################################################
63
+ // MAIN PLUGIN FUNCTIONALITY - START
64
+ //#####################################################################
65
+
66
+ // BUG 1251 FIX: http://plugins.jquery.com/project/comments/add/1251
67
+ // variable group_count would repeat itself on multiple calls to the plugin.
68
+ // this would cause a conflict with multiple elements
69
+ // changes scope of variable to global so id will be unique over n calls
70
+ window.MultiFile = (window.MultiFile || 0) + 1;
71
+ var group_count = window.MultiFile;
72
+
73
+ // Copy parent attributes - Thanks to Jonas Wagner
74
+ // we will use this one to create new input elements
75
+ var MultiFile = {e:this, E:$(this), clone:$(this).clone()};
76
+
77
+ //===
78
+
79
+ //# USE CONFIGURATION
80
+ if(typeof options=='number') options = {max:options};
81
+ var o = $.extend({},
82
+ $.fn.MultiFile.options,
83
+ options || {},
84
+ ($.metadata? MultiFile.E.metadata(): ($.meta?MultiFile.E.data():null)) || {}, /* metadata options */
85
+ {} /* internals */
86
+ );
87
+ // limit number of files that can be selected?
88
+ if(!(o.max>0) /*IsNull(MultiFile.max)*/){
89
+ o.max = MultiFile.E.attr('maxlength');
90
+ if(!(o.max>0) /*IsNull(MultiFile.max)*/){
91
+ o.max = (String(MultiFile.e.className.match(/\b(max|limit)\-([0-9]+)\b/gi) || ['']).match(/[0-9]+/gi) || [''])[0];
92
+ if(!(o.max>0)) o.max = -1;
93
+ else o.max = String(o.max).match(/[0-9]+/gi)[0];
94
+ }
95
+ };
96
+ o.max = new Number(o.max);
97
+ // limit extensions?
98
+ o.accept = o.accept || MultiFile.E.attr('accept') || '';
99
+ if(!o.accept){
100
+ o.accept = (MultiFile.e.className.match(/\b(accept\-[\w\|]+)\b/gi)) || '';
101
+ o.accept = new String(o.accept).replace(/^(accept|ext)\-/i,'');
102
+ };
103
+
104
+ //===
105
+
106
+ // APPLY CONFIGURATION
107
+ $.extend(MultiFile, o || {});
108
+ MultiFile.STRING = $.extend({},$.fn.MultiFile.options.STRING,MultiFile.STRING);
109
+
110
+ //===
111
+
112
+ //#########################################
113
+ // PRIVATE PROPERTIES/METHODS
114
+ $.extend(MultiFile, {
115
+ n: 0, // How many elements are currently selected?
116
+ slaves: [], files: [],
117
+ instanceKey: MultiFile.e.id || 'MultiFile'+String(group_count), // Instance Key?
118
+ generateID: function(z){ return MultiFile.instanceKey + (z>0 ?'_F'+String(z):''); },
119
+ trigger: function(event, element){
120
+ var handler = MultiFile[event], value = $(element).attr('value');
121
+ if(handler){
122
+ var returnValue = handler(element, value, MultiFile);
123
+ if( returnValue!=null ) return returnValue;
124
+ }
125
+ return true;
126
+ }
127
+ });
128
+
129
+ //===
130
+
131
+ // Setup dynamic regular expression for extension validation
132
+ // - thanks to John-Paul Bader: http://smyck.de/2006/08/11/javascript-dynamic-regular-expresions/
133
+ if(String(MultiFile.accept).length>1){
134
+ MultiFile.accept = MultiFile.accept.replace(/\W+/g,'|').replace(/^\W|\W$/g,'');
135
+ MultiFile.rxAccept = new RegExp('\\.('+(MultiFile.accept?MultiFile.accept:'')+')$','gi');
136
+ };
137
+
138
+ //===
139
+
140
+ // Create wrapper to hold our file list
141
+ MultiFile.wrapID = MultiFile.instanceKey+'_wrap'; // Wrapper ID?
142
+ MultiFile.E.wrap('<div class="MultiFile-wrap" id="'+MultiFile.wrapID+'"></div>');
143
+ MultiFile.wrapper = $('#'+MultiFile.wrapID+'');
144
+
145
+ //===
146
+
147
+ // MultiFile MUST have a name - default: file1[], file2[], file3[]
148
+ MultiFile.e.name = MultiFile.e.name || 'file'+ group_count +'[]';
149
+
150
+ //===
151
+
152
+ if(!MultiFile.list){
153
+ // Create a wrapper for the list
154
+ // * OPERA BUG: NO_MODIFICATION_ALLOWED_ERR ('list' is a read-only property)
155
+ // this change allows us to keep the files in the order they were selected
156
+ MultiFile.wrapper.append( '<div class="MultiFile-list" id="'+MultiFile.wrapID+'_list"></div>' );
157
+ MultiFile.list = $('#'+MultiFile.wrapID+'_list');
158
+ };
159
+ MultiFile.list = $(MultiFile.list);
160
+
161
+ //===
162
+
163
+ // Bind a new element
164
+ MultiFile.addSlave = function( slave, slave_count ){
165
+ //if(window.console) console.log('MultiFile.addSlave',slave_count);
166
+
167
+ // Keep track of how many elements have been displayed
168
+ MultiFile.n++;
169
+ // Add reference to master element
170
+ slave.MultiFile = MultiFile;
171
+
172
+ // BUG FIX: http://plugins.jquery.com/node/1495
173
+ // Clear identifying properties from clones
174
+ if(slave_count>0) slave.id = slave.name = '';
175
+
176
+ // Define element's ID and name (upload components need this!)
177
+ //slave.id = slave.id || MultiFile.generateID(slave_count);
178
+ if(slave_count>0) slave.id = MultiFile.generateID(slave_count);
179
+ //FIX for: http://code.google.com/p/jquery-multifile-plugin/issues/detail?id=23
180
+
181
+ // 2008-Apr-29: New customizable naming convention (see url below)
182
+ // http://groups.google.com/group/jquery-dev/browse_frm/thread/765c73e41b34f924#
183
+ slave.name = String(MultiFile.namePattern
184
+ /*master name*/.replace(/\$name/gi,$(MultiFile.clone).attr('name'))
185
+ /*master id */.replace(/\$id/gi, $(MultiFile.clone).attr('id'))
186
+ /*group count*/.replace(/\$g/gi, group_count)//(group_count>0?group_count:''))
187
+ /*slave count*/.replace(/\$i/gi, slave_count)//(slave_count>0?slave_count:''))
188
+ );
189
+
190
+ // If we've reached maximum number, disable input slave
191
+ if( (MultiFile.max > 0) && ((MultiFile.n-1) > (MultiFile.max)) )//{ // MultiFile.n Starts at 1, so subtract 1 to find true count
192
+ slave.disabled = true;
193
+ //};
194
+
195
+ // Remember most recent slave
196
+ MultiFile.current = MultiFile.slaves[slave_count] = slave;
197
+
198
+ // We'll use jQuery from now on
199
+ slave = $(slave);
200
+
201
+ // Clear value
202
+ slave.val('').attr('value','')[0].value = '';
203
+
204
+ // Stop plugin initializing on slaves
205
+ slave.addClass('MultiFile-applied');
206
+
207
+ // Triggered when a file is selected
208
+ slave.change(function(){
209
+ //if(window.console) console.log('MultiFile.slave.change',slave_count);
210
+
211
+ // Lose focus to stop IE7 firing onchange again
212
+ $(this).blur();
213
+
214
+ //# Trigger Event! onFileSelect
215
+ if(!MultiFile.trigger('onFileSelect', this, MultiFile)) return false;
216
+ //# End Event!
217
+
218
+ //# Retrive value of selected file from element
219
+ var ERROR = '', v = String(this.value || ''/*.attr('value)*/);
220
+
221
+ // check extension
222
+ if(MultiFile.accept && v && !v.match(MultiFile.rxAccept))//{
223
+ ERROR = MultiFile.STRING.denied.replace('$ext', String(v.match(/\.\w{1,4}$/gi)));
224
+ //}
225
+ //};
226
+
227
+ // Disallow duplicates
228
+ for(var f in MultiFile.slaves)//{
229
+ if(MultiFile.slaves[f] && MultiFile.slaves[f]!=this)//{
230
+ //console.log(MultiFile.slaves[f],MultiFile.slaves[f].value);
231
+ if(MultiFile.slaves[f].value==v)//{
232
+ ERROR = MultiFile.STRING.duplicate.replace('$file', v.match(/[^\/\\]+$/gi));
233
+ //};
234
+ //};
235
+ //};
236
+
237
+ // Create a new file input element
238
+ var newEle = $(MultiFile.clone).clone();// Copy parent attributes - Thanks to Jonas Wagner
239
+ //# Let's remember which input we've generated so
240
+ // we can disable the empty ones before submission
241
+ // See: http://plugins.jquery.com/node/1495
242
+ newEle.addClass('MultiFile');
243
+
244
+ // Handle error
245
+ if(ERROR!=''){
246
+ // Handle error
247
+ MultiFile.error(ERROR);
248
+
249
+ // 2007-06-24: BUG FIX - Thanks to Adrian Wr�bel <adrian [dot] wrobel [at] gmail.com>
250
+ // Ditch the trouble maker and add a fresh new element
251
+ MultiFile.n--;
252
+ MultiFile.addSlave(newEle[0], slave_count);
253
+ slave.parent().prepend(newEle);
254
+ slave.remove();
255
+ return false;
256
+ };
257
+
258
+ // Hide this element (NB: display:none is evil!)
259
+ $(this).css({ position:'absolute', top: '-3000px' });
260
+
261
+ // Add new element to the form
262
+ slave.after(newEle);
263
+
264
+ // Update list
265
+ MultiFile.addToList( this, slave_count );
266
+
267
+ // Bind functionality
268
+ MultiFile.addSlave( newEle[0], slave_count+1 );
269
+
270
+ //# Trigger Event! afterFileSelect
271
+ if(!MultiFile.trigger('afterFileSelect', this, MultiFile)) return false;
272
+ //# End Event!
273
+
274
+ }); // slave.change()
275
+
276
+ // Save control to element
277
+ $(slave).data('MultiFile', MultiFile);
278
+
279
+ };// MultiFile.addSlave
280
+ // Bind a new element
281
+
282
+
283
+
284
+ // Add a new file to the list
285
+ MultiFile.addToList = function( slave, slave_count ){
286
+ //if(window.console) console.log('MultiFile.addToList',slave_count);
287
+
288
+ //# Trigger Event! onFileAppend
289
+ if(!MultiFile.trigger('onFileAppend', slave, MultiFile)) return false;
290
+ //# End Event!
291
+
292
+ // Create label elements
293
+ var
294
+ r = $('<div class="MultiFile-label"></div>'),
295
+ v = String(slave.value || ''/*.attr('value)*/),
296
+ a = $('<span class="MultiFile-title" title="'+MultiFile.STRING.selected.replace('$file', v)+'">'+MultiFile.STRING.file.replace('$file', v.match(/[^\/\\]+$/gi)[0])+'</span>'),
297
+ b = $('<a class="MultiFile-remove" href="#'+MultiFile.wrapID+'">'+MultiFile.STRING.remove+'</a>');
298
+
299
+ // Insert label
300
+ MultiFile.list.append(
301
+ r.append(b, ' ', a)
302
+ );
303
+
304
+ b
305
+ .click(function(){
306
+
307
+ //# Trigger Event! onFileRemove
308
+ if(!MultiFile.trigger('onFileRemove', slave, MultiFile)) return false;
309
+ //# End Event!
310
+
311
+ MultiFile.n--;
312
+ MultiFile.current.disabled = false;
313
+
314
+ // Remove element, remove label, point to current
315
+ MultiFile.slaves[slave_count] = null;
316
+ $(slave).remove();
317
+ $(this).parent().remove();
318
+
319
+ // Show most current element again (move into view) and clear selection
320
+ $(MultiFile.current).css({ position:'', top: '' });
321
+ $(MultiFile.current).reset().val('').attr('value', '')[0].value = '';
322
+
323
+ //# Trigger Event! afterFileRemove
324
+ if(!MultiFile.trigger('afterFileRemove', slave, MultiFile)) return false;
325
+ //# End Event!
326
+
327
+ return false;
328
+ });
329
+
330
+ //# Trigger Event! afterFileAppend
331
+ if(!MultiFile.trigger('afterFileAppend', slave, MultiFile)) return false;
332
+ //# End Event!
333
+
334
+ }; // MultiFile.addToList
335
+ // Add element to selected files list
336
+
337
+
338
+
339
+ // Bind functionality to the first element
340
+ if(!MultiFile.MultiFile) MultiFile.addSlave(MultiFile.e, 0);
341
+
342
+ // Increment control count
343
+ //MultiFile.I++; // using window.MultiFile
344
+ MultiFile.n++;
345
+
346
+ // Save control to element
347
+ MultiFile.E.data('MultiFile', MultiFile);
348
+
349
+
350
+ //#####################################################################
351
+ // MAIN PLUGIN FUNCTIONALITY - END
352
+ //#####################################################################
353
+ }); // each element
354
+ };
355
+
356
+ /*--------------------------------------------------------*/
357
+
358
+ /*
359
+ ### Core functionality and API ###
360
+ */
361
+ $.extend($.fn.MultiFile, {
362
+ /**
363
+ * This method removes all selected files
364
+ *
365
+ * Returns a jQuery collection of all affected elements.
366
+ *
367
+ * @name reset
368
+ * @type jQuery
369
+ * @cat Plugins/MultiFile
370
+ * @author Diego A. (http://www.fyneworks.com/)
371
+ *
372
+ * @example $.fn.MultiFile.reset();
373
+ */
374
+ reset: function(){
375
+ var settings = $(this).data('MultiFile');
376
+ //if(settings) settings.wrapper.find('a.MultiFile-remove').click();
377
+ if(settings) settings.list.find('a.MultiFile-remove').click();
378
+ return $(this);
379
+ },
380
+
381
+
382
+ /**
383
+ * This utility makes it easy to disable all 'empty' file elements in the document before submitting a form.
384
+ * It marks the affected elements so they can be easily re-enabled after the form submission or validation.
385
+ *
386
+ * Returns a jQuery collection of all affected elements.
387
+ *
388
+ * @name disableEmpty
389
+ * @type jQuery
390
+ * @cat Plugins/MultiFile
391
+ * @author Diego A. (http://www.fyneworks.com/)
392
+ *
393
+ * @example $.fn.MultiFile.disableEmpty();
394
+ * @param String class (optional) A string specifying a class to be applied to all affected elements - Default: 'mfD'.
395
+ */
396
+ disableEmpty: function(klass){ klass = (typeof(klass)=='string'?klass:'')||'mfD';
397
+ var o = [];
398
+ $('input:file.MultiFile').each(function(){ if($(this).val()=='') o[o.length] = this; });
399
+ return $(o).each(function(){ this.disabled = true }).addClass(klass);
400
+ },
401
+
402
+
403
+ /**
404
+ * This method re-enables 'empty' file elements that were disabled (and marked) with the $.fn.MultiFile.disableEmpty method.
405
+ *
406
+ * Returns a jQuery collection of all affected elements.
407
+ *
408
+ * @name reEnableEmpty
409
+ * @type jQuery
410
+ * @cat Plugins/MultiFile
411
+ * @author Diego A. (http://www.fyneworks.com/)
412
+ *
413
+ * @example $.fn.MultiFile.reEnableEmpty();
414
+ * @param String klass (optional) A string specifying the class that was used to mark affected elements - Default: 'mfD'.
415
+ */
416
+ reEnableEmpty: function(klass){ klass = (typeof(klass)=='string'?klass:'')||'mfD';
417
+ return $('input:file.'+klass).removeClass(klass).each(function(){ this.disabled = false });
418
+ },
419
+
420
+
421
+ /**
422
+ * This method will intercept other jQuery plugins and disable empty file input elements prior to form submission
423
+ *
424
+
425
+ * @name intercept
426
+ * @cat Plugins/MultiFile
427
+ * @author Diego A. (http://www.fyneworks.com/)
428
+ *
429
+ * @example $.fn.MultiFile.intercept();
430
+ * @param Array methods (optional) Array of method names to be intercepted
431
+ */
432
+ intercepted: {},
433
+ intercept: function(methods, context, args){
434
+ var method, value; args = args || [];
435
+ if(args.constructor.toString().indexOf("Array")<0) args = [ args ];
436
+ if(typeof(methods)=='function'){
437
+ $.fn.MultiFile.disableEmpty();
438
+ value = methods.apply(context || window, args);
439
+ //SEE-http://code.google.com/p/jquery-multifile-plugin/issues/detail?id=27
440
+ setTimeout(function(){ $.fn.MultiFile.reEnableEmpty() },1000);
441
+ return value;
442
+ };
443
+ if(methods.constructor.toString().indexOf("Array")<0) methods = [methods];
444
+ for(var i=0;i<methods.length;i++){
445
+ method = methods[i]+''; // make sure that we have a STRING
446
+ if(method) (function(method){ // make sure that method is ISOLATED for the interception
447
+ $.fn.MultiFile.intercepted[method] = $.fn[method] || function(){};
448
+ $.fn[method] = function(){
449
+ $.fn.MultiFile.disableEmpty();
450
+ value = $.fn.MultiFile.intercepted[method].apply(this, arguments);
451
+ //SEE-http://code.google.com/p/jquery-multifile-plugin/issues/detail?id=27
452
+ setTimeout(function(){ $.fn.MultiFile.reEnableEmpty() },1000);
453
+ return value;
454
+ }; // interception
455
+ })(method); // MAKE SURE THAT method IS ISOLATED for the interception
456
+ };// for each method
457
+ }
458
+ });
459
+
460
+ /*--------------------------------------------------------*/
461
+
462
+ /*
463
+ ### Default Settings ###
464
+ eg.: You can override default control like this:
465
+ $.fn.MultiFile.options.accept = 'gif|jpg';
466
+ */
467
+ $.fn.MultiFile.options = { //$.extend($.fn.MultiFile, { options: {
468
+ accept: '', // accepted file extensions
469
+ max: -1, // maximum number of selectable files
470
+
471
+ // name to use for newly created elements
472
+ namePattern: '$name', // same name by default (which creates an array)
473
+
474
+ // STRING: collection lets you show messages in different languages
475
+ STRING: {
476
+ remove:'x',
477
+ denied:'You cannot select a $ext file.\nTry again...',
478
+ file:'$file',
479
+ selected:'File selected: $file',
480
+ duplicate:'This file has already been selected:\n$file'
481
+ },
482
+
483
+ // name of methods that should be automcatically intercepted so the plugin can disable
484
+ // extra file elements that are empty before execution and automatically re-enable them afterwards
485
+ autoIntercept: [ 'submit', 'ajaxSubmit', 'ajaxForm', 'validate' /* array of methods to intercept */ ],
486
+
487
+ // error handling function
488
+ error: function(s){
489
+ /*
490
+ ERROR! blockUI is not currently working in IE
491
+ if($.blockUI){
492
+ $.blockUI({
493
+ message: s.replace(/\n/gi,'<br/>'),
494
+ css: {
495
+ border:'none', padding:'15px', size:'12.0pt',
496
+ backgroundColor:'#900', color:'#fff',
497
+ opacity:'.8','-webkit-border-radius': '10px','-moz-border-radius': '10px'
498
+ }
499
+ });
500
+ window.setTimeout($.unblockUI, 2000);
501
+ }
502
+ else//{// save a byte!
503
+ */
504
+ alert(s);
505
+ //}// save a byte!
506
+ }
507
+ }; //} });
508
+
509
+ /*--------------------------------------------------------*/
510
+
511
+ /*
512
+ ### Additional Methods ###
513
+ Required functionality outside the plugin's scope
514
+ */
515
+
516
+ // Native input reset method - because this alone doesn't always work: $(element).val('').attr('value', '')[0].value = '';
517
+ $.fn.reset = function(){ return this.each(function(){ try{ this.reset(); }catch(e){} }); };
518
+
519
+ /*--------------------------------------------------------*/
520
+
521
+ /*
522
+ ### Default implementation ###
523
+ The plugin will attach itself to file inputs
524
+ with the class 'multi' when the page loads
525
+ */
526
+ $(function(){
527
+ //$("input:file.multi").MultiFile();
528
+ $("input[type=file].multi").MultiFile();
529
+ });
530
+
531
+
532
+
533
+ /*# AVOID COLLISIONS #*/
534
+ })(jQuery);
535
+ /*# AVOID COLLISIONS #*/
admin/js/jquery.MultiFile.pack.js ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ ### jQuery Multiple File Upload Plugin v1.46 - 2009-05-12 ###
3
+ * Home: http://www.fyneworks.com/jquery/multiple-file-upload/
4
+ * Code: http://code.google.com/p/jquery-multifile-plugin/
5
+ *
6
+ * Dual licensed under the MIT and GPL licenses:
7
+ * http://www.opensource.org/licenses/mit-license.php
8
+ * http://www.gnu.org/licenses/gpl.html
9
+ ###
10
+ */
11
+ eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}(';3(U.1u)(6($){$.7.2=6(h){3(5.V==0)8 5;3(T S[0]==\'19\'){3(5.V>1){m i=S;8 5.M(6(){$.7.2.13($(5),i)})};$.7.2[S[0]].13(5,$.1N(S).27(1)||[]);8 5};m h=$.N({},$.7.2.F,h||{});$(\'2d\').1B(\'2-R\').Q(\'2-R\').1n($.7.2.Z);3($.7.2.F.15){$.7.2.1M($.7.2.F.15);$.7.2.F.15=10};5.1B(\'.2-1e\').Q(\'2-1e\').M(6(){U.2=(U.2||0)+1;m e=U.2;m g={e:5,E:$(5),L:$(5).L()};3(T h==\'21\')h={l:h};m o=$.N({},$.7.2.F,h||{},($.1m?g.E.1m():($.1S?g.E.17():10))||{},{});3(!(o.l>0)){o.l=g.E.D(\'28\');3(!(o.l>0)){o.l=(u(g.e.1D.B(/\\b(l|23)\\-([0-9]+)\\b/q)||[\'\']).B(/[0-9]+/q)||[\'\'])[0];3(!(o.l>0))o.l=-1;2b o.l=u(o.l).B(/[0-9]+/q)[0]}};o.l=18 2f(o.l);o.j=o.j||g.E.D(\'j\')||\'\';3(!o.j){o.j=(g.e.1D.B(/\\b(j\\-[\\w\\|]+)\\b/q))||\'\';o.j=18 u(o.j).t(/^(j|1d)\\-/i,\'\')};$.N(g,o||{});g.A=$.N({},$.7.2.F.A,g.A);$.N(g,{n:0,J:[],2c:[],1c:g.e.I||\'2\'+u(e),1i:6(z){8 g.1c+(z>0?\'1Z\'+u(z):\'\')},G:6(a,b){m c=g[a],k=$(b).D(\'k\');3(c){m d=c(b,k,g);3(d!=10)8 d}8 1a}});3(u(g.j).V>1){g.j=g.j.t(/\\W+/g,\'|\').t(/^\\W|\\W$/g,\'\');g.1k=18 2t(\'\\\\.(\'+(g.j?g.j:\'\')+\')$\',\'q\')};g.O=g.1c+\'1P\';g.E.1l(\'<P X="2-1l" I="\'+g.O+\'"></P>\');g.1q=$(\'#\'+g.O+\'\');g.e.H=g.e.H||\'p\'+e+\'[]\';3(!g.K){g.1q.1g(\'<P X="2-K" I="\'+g.O+\'1F"></P>\');g.K=$(\'#\'+g.O+\'1F\')};g.K=$(g.K);g.16=6(c,d){g.n++;c.2=g;3(d>0)c.I=c.H=\'\';3(d>0)c.I=g.1i(d);c.H=u(g.1j.t(/\\$H/q,$(g.L).D(\'H\')).t(/\\$I/q,$(g.L).D(\'I\')).t(/\\$g/q,e).t(/\\$i/q,d));3((g.l>0)&&((g.n-1)>(g.l)))c.14=1a;g.Y=g.J[d]=c;c=$(c);c.1b(\'\').D(\'k\',\'\')[0].k=\'\';c.Q(\'2-1e\');c.1V(6(){$(5).1X();3(!g.G(\'1Y\',5,g))8 y;m a=\'\',v=u(5.k||\'\');3(g.j&&v&&!v.B(g.1k))a=g.A.1o.t(\'$1d\',u(v.B(/\\.\\w{1,4}$/q)));1p(m f 2a g.J)3(g.J[f]&&g.J[f]!=5)3(g.J[f].k==v)a=g.A.1r.t(\'$p\',v.B(/[^\\/\\\\]+$/q));m b=$(g.L).L();b.Q(\'2\');3(a!=\'\'){g.1s(a);g.n--;g.16(b[0],d);c.1t().2e(b);c.C();8 y};$(5).1v({1w:\'1O\',1x:\'-1Q\'});c.1R(b);g.1y(5,d);g.16(b[0],d+1);3(!g.G(\'1T\',5,g))8 y});$(c).17(\'2\',g)};g.1y=6(c,d){3(!g.G(\'1U\',c,g))8 y;m r=$(\'<P X="2-1W"></P>\'),v=u(c.k||\'\'),a=$(\'<1z X="2-1A" 1A="\'+g.A.12.t(\'$p\',v)+\'">\'+g.A.p.t(\'$p\',v.B(/[^\\/\\\\]+$/q)[0])+\'</1z>\'),b=$(\'<a X="2-C" 2y="#\'+g.O+\'">\'+g.A.C+\'</a>\');g.K.1g(r.1g(b,\' \',a));b.1C(6(){3(!g.G(\'22\',c,g))8 y;g.n--;g.Y.14=y;g.J[d]=10;$(c).C();$(5).1t().C();$(g.Y).1v({1w:\'\',1x:\'\'});$(g.Y).11().1b(\'\').D(\'k\',\'\')[0].k=\'\';3(!g.G(\'24\',c,g))8 y;8 y});3(!g.G(\'25\',c,g))8 y};3(!g.2)g.16(g.e,0);g.n++;g.E.17(\'2\',g)})};$.N($.7.2,{11:6(){m a=$(5).17(\'2\');3(a)a.K.26(\'a.2-C\').1C();8 $(5)},Z:6(a){a=(T(a)==\'19\'?a:\'\')||\'1E\';m o=[];$(\'1h:p.2\').M(6(){3($(5).1b()==\'\')o[o.V]=5});8 $(o).M(6(){5.14=1a}).Q(a)},1f:6(a){a=(T(a)==\'19\'?a:\'\')||\'1E\';8 $(\'1h:p.\'+a).29(a).M(6(){5.14=y})},R:{},1M:6(b,c,d){m e,k;d=d||[];3(d.1G.1H().1I("1J")<0)d=[d];3(T(b)==\'6\'){$.7.2.Z();k=b.13(c||U,d);1K(6(){$.7.2.1f()},1L);8 k};3(b.1G.1H().1I("1J")<0)b=[b];1p(m i=0;i<b.V;i++){e=b[i]+\'\';3(e)(6(a){$.7.2.R[a]=$.7[a]||6(){};$.7[a]=6(){$.7.2.Z();k=$.7.2.R[a].13(5,S);1K(6(){$.7.2.1f()},1L);8 k}})(e)}}});$.7.2.F={j:\'\',l:-1,1j:\'$H\',A:{C:\'x\',1o:\'2g 2h 2i a $1d p.\\2j 2k...\',p:\'$p\',12:\'2l 12: $p\',1r:\'2m p 2n 2o 2p 12:\\n$p\'},15:[\'1n\',\'2q\',\'2r\',\'2s\'],1s:6(s){2u(s)}};$.7.11=6(){8 5.M(6(){2v{5.11()}2w(e){}})};$(6(){$("1h[2x=p].20").2()})})(1u);',62,159,'||MultiFile|if||this|function|fn|return|||||||||||accept|value|max|var|||file|gi|||replace|String||||false||STRING|match|remove|attr||options|trigger|name|id|slaves|list|clone|each|extend|wrapID|div|addClass|intercepted|arguments|typeof|window|length||class|current|disableEmpty|null|reset|selected|apply|disabled|autoIntercept|addSlave|data|new|string|true|val|instanceKey|ext|applied|reEnableEmpty|append|input|generateID|namePattern|rxAccept|wrap|metadata|submit|denied|for|wrapper|duplicate|error|parent|jQuery|css|position|top|addToList|span|title|not|click|className|mfD|_list|constructor|toString|indexOf|Array|setTimeout|1000|intercept|makeArray|absolute|_wrap|3000px|after|meta|afterFileSelect|onFileAppend|change|label|blur|onFileSelect|_F|multi|number|onFileRemove|limit|afterFileRemove|afterFileAppend|find|slice|maxlength|removeClass|in|else|files|form|prepend|Number|You|cannot|select|nTry|again|File|This|has|already|been|ajaxSubmit|ajaxForm|validate|RegExp|alert|try|catch|type|href'.split('|'),0,{}))
admin/js/jquery.dataset.js ADDED
@@ -0,0 +1,167 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /// jquery.dataset v0.1.0 -- HTML5 dataset jQuery plugin
2
+ /// http://orangesoda.net/jquery.dataset.html
3
+
4
+ /// Copyright (c) 2009, Ben Weaver. All rights reserved.
5
+ /// This software is issued "as is" under a BSD license
6
+ /// <http://orangesoda.net/license.html>. All warrenties disclaimed.
7
+
8
+ /// The HTML5 specification allows elements to have custom data
9
+ /// attributes that are prefixed with `data-'. They may be
10
+ /// conveniently accessed through an element's `dataset' property.
11
+ /// This plugin provides similar functionality.
12
+ ///
13
+ /// The methods in the plugin are designed to be similar to the
14
+ /// built-in `attr' and `data' methods. All names are without the
15
+ /// `data-' prefix.
16
+ //
17
+ /// These methods are defined:
18
+ ///
19
+ /// dataset()
20
+ /// Return an object with all custom attribute (name, value) items.
21
+ ///
22
+ /// dataset(name)
23
+ /// Return the value of the attribute `data-NAME'.
24
+ ///
25
+ /// dataset(name, value)
26
+ /// Set the value of attribtue `data-NAME' to VALUE.
27
+ ///
28
+ /// dataset({...})
29
+ /// Set many custom attributes at once.
30
+ ///
31
+ /// removeDataset(name)
32
+ /// Remove the attribute `data-NAME'.
33
+ ///
34
+ /// removeDataset([n1, n2, ...])
35
+ /// Remove the attributes `data-N1', `data-N2', ...
36
+
37
+ (function($) {
38
+ var PREFIX = 'data-',
39
+ PATTERN = /^data\-(.*)$/;
40
+
41
+ function dataset(name, value) {
42
+ if (value !== undefined) {
43
+ // dataset(name, value): set the NAME attribute to VALUE.
44
+ return this.attr(PREFIX + name, value);
45
+ }
46
+
47
+ switch (typeof name) {
48
+ case 'string':
49
+ // dataset(name): get the value of the NAME attribute.
50
+ return this.attr(PREFIX + name);
51
+
52
+ case 'object':
53
+ // dataset(items): set the values of all (name, value) items.
54
+ return set_items.call(this, name);
55
+
56
+ case 'undefined':
57
+ // dataset(): return a mapping of (name, value) items for the
58
+ // first element.
59
+ return get_items.call(this);
60
+
61
+ default:
62
+ throw 'dataset: invalid argument ' + name;
63
+ }
64
+ }
65
+
66
+ function get_items() {
67
+ return this.foldAttr(function(index, attr, result) {
68
+ var match = PATTERN.exec(this.name);
69
+ if (match) result[match[1]] = this.value;
70
+ });
71
+ }
72
+
73
+ function set_items(items) {
74
+ for (var key in items) {
75
+ this.attr(PREFIX + key, items[key]);
76
+ }
77
+ return this;
78
+ }
79
+
80
+ function remove(name) {
81
+ if (typeof name == 'string') {
82
+ // Remove a single attribute;
83
+ return this.removeAttr(PREFIX + name);
84
+ }
85
+ return remove_names(name);
86
+ }
87
+
88
+ function remove_names(obj) {
89
+ var idx, length = obj && obj.length;
90
+
91
+ // For any object, remove attributes named by the keys.
92
+ if (length === undefined) {
93
+ for (idx in obj) {
94
+ this.removeAttr(PREFIX + idx);
95
+ }
96
+ }
97
+ // For an array, remove attributes named by the values.
98
+ else {
99
+ for (idx = 0; idx < length; idx++) {
100
+ this.removeAttr(PREFIX + obj[idx]);
101
+ }
102
+ }
103
+
104
+ return this;
105
+ }
106
+
107
+ $.fn.dataset = dataset;
108
+ $.fn.removeDataset = remove_names;
109
+
110
+ })(jQuery);
111
+
112
+ (function($) {
113
+
114
+ function each_attr(proc) {
115
+ if (this.length > 0) {
116
+ $.each(this[0].attributes, proc);
117
+ }
118
+ return this;
119
+ }
120
+
121
+ function fold_attr(proc, acc) {
122
+ return fold((this.length > 0) && this[0].attributes, proc, acc);
123
+ }
124
+
125
+ /*
126
+ * A left-fold operator. The behavior is the same as $.each(),
127
+ * but the callback is called with the accumulator as the third
128
+ * argument. The default accumulator is an empty object.
129
+ */
130
+ function fold(object, proc, acc) {
131
+ var length = object && object.length;
132
+
133
+ // The default accumulator is an empty object.
134
+ if (acc === undefined) acc = {};
135
+
136
+ // Returning an empty accumulator when OBJECT is "false"
137
+ // makes FOLD more composable.
138
+ if (!object) return acc;
139
+
140
+ // Check to see if OBJECT is an array.
141
+ if (length !== undefined) {
142
+ for (var i = 0, value = object[i];
143
+ (i < length) && (proc.call(value, i, value, acc) !== false);
144
+ value = object[++i])
145
+ { }
146
+ }
147
+ // Object is a map of (name, value) items.
148
+ else {
149
+ for (var name in object) {
150
+ if (proc.call(object[name], name, object[name], acc) === false) break;
151
+ }
152
+ }
153
+
154
+ return acc;
155
+ }
156
+
157
+ function fold_jquery(proc, acc) {
158
+ if (acc === undefined) acc = [];
159
+ return fold(this, proc, acc);
160
+ }
161
+
162
+ $.fn.eachAttr = each_attr;
163
+ $.fn.foldAttr = fold_attr;
164
+ $.fn.fold = fold_jquery;
165
+ $.fold = fold;
166
+
167
+ })(jQuery);
admin/js/jquery.easing-1.3.pack.js ADDED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
3
+ *
4
+ * Uses the built in easing capabilities added In jQuery 1.1
5
+ * to offer multiple easing options
6
+ *
7
+ * TERMS OF USE - jQuery Easing
8
+ *
9
+ * Open source under the BSD License.
10
+ *
11
+ * Copyright © 2008 George McGinley Smith
12
+ * All rights reserved.
13
+ *
14
+ * Redistribution and use in source and binary forms, with or without modification,
15
+ * are permitted provided that the following conditions are met:
16
+ *
17
+ * Redistributions of source code must retain the above copyright notice, this list of
18
+ * conditions and the following disclaimer.
19
+ * Redistributions in binary form must reproduce the above copyright notice, this list
20
+ * of conditions and the following disclaimer in the documentation and/or other materials
21
+ * provided with the distribution.
22
+ *
23
+ * Neither the name of the author nor the names of contributors may be used to endorse
24
+ * or promote products derived from this software without specific prior written permission.
25
+ *
26
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
27
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
28
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
29
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
31
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
32
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
33
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
34
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
35
+ *
36
+ */
37
+
38
+ // t: current time, b: begInnIng value, c: change In value, d: duration
39
+ eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('h.i[\'1a\']=h.i[\'z\'];h.O(h.i,{y:\'D\',z:9(x,t,b,c,d){6 h.i[h.i.y](x,t,b,c,d)},17:9(x,t,b,c,d){6 c*(t/=d)*t+b},D:9(x,t,b,c,d){6-c*(t/=d)*(t-2)+b},13:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t+b;6-c/2*((--t)*(t-2)-1)+b},X:9(x,t,b,c,d){6 c*(t/=d)*t*t+b},U:9(x,t,b,c,d){6 c*((t=t/d-1)*t*t+1)+b},R:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t*t+b;6 c/2*((t-=2)*t*t+2)+b},N:9(x,t,b,c,d){6 c*(t/=d)*t*t*t+b},M:9(x,t,b,c,d){6-c*((t=t/d-1)*t*t*t-1)+b},L:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t*t*t+b;6-c/2*((t-=2)*t*t*t-2)+b},K:9(x,t,b,c,d){6 c*(t/=d)*t*t*t*t+b},J:9(x,t,b,c,d){6 c*((t=t/d-1)*t*t*t*t+1)+b},I:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t*t*t*t+b;6 c/2*((t-=2)*t*t*t*t+2)+b},G:9(x,t,b,c,d){6-c*8.C(t/d*(8.g/2))+c+b},15:9(x,t,b,c,d){6 c*8.n(t/d*(8.g/2))+b},12:9(x,t,b,c,d){6-c/2*(8.C(8.g*t/d)-1)+b},Z:9(x,t,b,c,d){6(t==0)?b:c*8.j(2,10*(t/d-1))+b},Y:9(x,t,b,c,d){6(t==d)?b+c:c*(-8.j(2,-10*t/d)+1)+b},W:9(x,t,b,c,d){e(t==0)6 b;e(t==d)6 b+c;e((t/=d/2)<1)6 c/2*8.j(2,10*(t-1))+b;6 c/2*(-8.j(2,-10*--t)+2)+b},V:9(x,t,b,c,d){6-c*(8.o(1-(t/=d)*t)-1)+b},S:9(x,t,b,c,d){6 c*8.o(1-(t=t/d-1)*t)+b},Q:9(x,t,b,c,d){e((t/=d/2)<1)6-c/2*(8.o(1-t*t)-1)+b;6 c/2*(8.o(1-(t-=2)*t)+1)+b},P:9(x,t,b,c,d){f s=1.l;f p=0;f a=c;e(t==0)6 b;e((t/=d)==1)6 b+c;e(!p)p=d*.3;e(a<8.w(c)){a=c;f s=p/4}m f s=p/(2*8.g)*8.r(c/a);6-(a*8.j(2,10*(t-=1))*8.n((t*d-s)*(2*8.g)/p))+b},H:9(x,t,b,c,d){f s=1.l;f p=0;f a=c;e(t==0)6 b;e((t/=d)==1)6 b+c;e(!p)p=d*.3;e(a<8.w(c)){a=c;f s=p/4}m f s=p/(2*8.g)*8.r(c/a);6 a*8.j(2,-10*t)*8.n((t*d-s)*(2*8.g)/p)+c+b},T:9(x,t,b,c,d){f s=1.l;f p=0;f a=c;e(t==0)6 b;e((t/=d/2)==2)6 b+c;e(!p)p=d*(.3*1.5);e(a<8.w(c)){a=c;f s=p/4}m f s=p/(2*8.g)*8.r(c/a);e(t<1)6-.5*(a*8.j(2,10*(t-=1))*8.n((t*d-s)*(2*8.g)/p))+b;6 a*8.j(2,-10*(t-=1))*8.n((t*d-s)*(2*8.g)/p)*.5+c+b},F:9(x,t,b,c,d,s){e(s==u)s=1.l;6 c*(t/=d)*t*((s+1)*t-s)+b},E:9(x,t,b,c,d,s){e(s==u)s=1.l;6 c*((t=t/d-1)*t*((s+1)*t+s)+1)+b},16:9(x,t,b,c,d,s){e(s==u)s=1.l;e((t/=d/2)<1)6 c/2*(t*t*(((s*=(1.B))+1)*t-s))+b;6 c/2*((t-=2)*t*(((s*=(1.B))+1)*t+s)+2)+b},A:9(x,t,b,c,d){6 c-h.i.v(x,d-t,0,c,d)+b},v:9(x,t,b,c,d){e((t/=d)<(1/2.k)){6 c*(7.q*t*t)+b}m e(t<(2/2.k)){6 c*(7.q*(t-=(1.5/2.k))*t+.k)+b}m e(t<(2.5/2.k)){6 c*(7.q*(t-=(2.14/2.k))*t+.11)+b}m{6 c*(7.q*(t-=(2.18/2.k))*t+.19)+b}},1b:9(x,t,b,c,d){e(t<d/2)6 h.i.A(x,t*2,0,c,d)*.5+b;6 h.i.v(x,t*2-d,0,c,d)*.5+c*.5+b}});',62,74,'||||||return||Math|function|||||if|var|PI|jQuery|easing|pow|75|70158|else|sin|sqrt||5625|asin|||undefined|easeOutBounce|abs||def|swing|easeInBounce|525|cos|easeOutQuad|easeOutBack|easeInBack|easeInSine|easeOutElastic|easeInOutQuint|easeOutQuint|easeInQuint|easeInOutQuart|easeOutQuart|easeInQuart|extend|easeInElastic|easeInOutCirc|easeInOutCubic|easeOutCirc|easeInOutElastic|easeOutCubic|easeInCirc|easeInOutExpo|easeInCubic|easeOutExpo|easeInExpo||9375|easeInOutSine|easeInOutQuad|25|easeOutSine|easeInOutBack|easeInQuad|625|984375|jswing|easeInOutBounce'.split('|'),0,{}))
40
+
41
+ /*
42
+ *
43
+ * TERMS OF USE - EASING EQUATIONS
44
+ *
45
+ * Open source under the BSD License.
46
+ *
47
+ * Copyright © 2001 Robert Penner
48
+ * All rights reserved.
49
+ *
50
+ * Redistribution and use in source and binary forms, with or without modification,
51
+ * are permitted provided that the following conditions are met:
52
+ *
53
+ * Redistributions of source code must retain the above copyright notice, this list of
54
+ * conditions and the following disclaimer.
55
+ * Redistributions in binary form must reproduce the above copyright notice, this list
56
+ * of conditions and the following disclaimer in the documentation and/or other materials
57
+ * provided with the distribution.
58
+ *
59
+ * Neither the name of the author nor the names of contributors may be used to endorse
60
+ * or promote products derived from this software without specific prior written permission.
61
+ *
62
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
63
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
64
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
65
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
66
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
67
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
68
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
69
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
70
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
71
+ *
72
+ */
admin/js/jquery.fancybox-1.3.4.css ADDED
@@ -0,0 +1,91 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ #fancybox-loading { position: fixed; top: 50%; left: 50%; width: 40px; height: 40px; margin-top: -20px; margin-left: -20px; cursor: pointer; overflow: hidden; z-index: 10104; display: none; }
19
+ #fancybox-loading div { position: absolute; top: 0; left: 0; width: 40px; height: 480px; background-image: url('images/fancybox.png'); }
20
+ #fancybox-overlay { position: absolute; top: 0; left: 0; width: 100%; z-index: 10100; display: none; }
21
+ #fancybox-tmp { padding: 0; margin: 0; border: 0; overflow: auto; display: none; }
22
+ #fancybox-wrap { position: absolute; top: 0; left: 0; padding: 20px; z-index: 10101; outline: none; display: none; }
23
+ #fancybox-outer { position: relative; width: 100%; height: 100%; background: #fff; }
24
+ #fancybox-content { width: 0; height: 0; padding: 0; outline: none; position: relative; overflow: hidden; z-index: 10102; border: 0px solid #fff; }
25
+ #fancybox-hide-sel-frame { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: transparent; z-index: 10101; }
26
+ #fancybox-close { position: absolute; top: -15px; right: -15px; width: 30px; height: 30px; background: transparent url('images/fancybox.png') -40px 0px; cursor: pointer; z-index: 10103; display: none; border: none; padding: 0; margin: 0; }
27
+ #fancybox-error { color: #444; font: normal 12px/20px Arial; padding: 14px; margin: 0; }
28
+ #fancybox-img { width: 100%; height: 100%; padding: 0; margin: 0; border: none; outline: none; line-height: 0; vertical-align: top; }
29
+ #fancybox-frame { width: 100%; height: 100%; border: none; display: block; }
30
+ #fancybox-left, #fancybox-right { position: absolute; bottom: 0px; height: 100%; width: 35%; cursor: pointer; outline: none; background: transparent url('images/blank.gif'); z-index: 10102; display: block; }
31
+ #fancybox-left { left: 0px; }
32
+ #fancybox-right { right: 0px; }
33
+ #fancybox-left-ico { position: absolute; top: 50%; right: auto; left: 20px; width: 30px; height: 30px; margin-top: -15px; cursor: pointer; z-index: 10102; display: block; }
34
+ #fancybox-right-ico { position: absolute; top: 50%; left: auto; right: 20px; width: 30px; height: 30px; margin-top: -15px; cursor: pointer; z-index: 10102; display: block; }
35
+ #fancybox-left-ico { background-image: url('images/fancybox.png'); background-position: -40px -30px; }
36
+ #fancybox-right-ico { background-image: url('images/fancybox.png'); background-position: -40px -60px; }
37
+ #fancybox-left:hover, #fancybox-right:hover { visibility: visible; /* IE6 */ }
38
+ #fancybox-left:hover span { left: 20px; }
39
+ #fancybox-right:hover span { left: auto; right: 20px; }
40
+ .fancybox-bg { position: absolute; padding: 0; margin: 0; border: 0; width: 20px; height: 20px; z-index: 10001; }
41
+ #fancybox-bg-n { top: -20px; left: 0; width: 100%; background-image: url('images/fancybox-x.png'); }
42
+ #fancybox-bg-ne { top: -20px; right: -20px; background-image: url('images/fancybox.png'); background-position: -40px -162px; }
43
+ #fancybox-bg-e { top: 0; right: -20px; height: 100%; background-image: url('images/fancybox-y.png'); background-position: -20px 0px; }
44
+ #fancybox-bg-se { bottom: -20px; right: -20px; background-image: url('images/fancybox.png'); background-position: -40px -182px; }
45
+ #fancybox-bg-s { bottom: -20px; left: 0; width: 100%; background-image: url('images/fancybox-x.png'); background-position: 0px -20px; }
46
+ #fancybox-bg-sw { bottom: -20px; left: -20px; background-image: url('images/fancybox.png'); background-position: -40px -142px; }
47
+ #fancybox-bg-w { top: 0; left: -20px; height: 100%; background-image: url('images/fancybox-y.png'); }
48
+ #fancybox-bg-nw { top: -20px; left: -20px; background-image: url('images/fancybox.png'); background-position: -40px -122px; }
49
+ #fancybox-title { font-family: Helvetica; font-size: 12px; z-index: 10102; }
50
+ .fancybox-title-inside { padding-bottom: 10px; text-align: center; color: #333; background: #fff; position: relative; }
51
+ .fancybox-title-outside { padding-top: 10px; color: #fff; }
52
+ .fancybox-title-over { position: absolute; bottom: 0; left: 0; color: #FFF; text-align: left; display: none; }
53
+ .grand .fancybox-title-over { top: 10px; }
54
+ #fancybox-title-over { padding: 10px; background-image: url('images/fancy_title_over.png'); display: block; }
55
+ .grand #fancybox-title-over { position: absolute; left: 0; bottom: 0; right: 0; }
56
+ .grand .grand_controls { position: absolute; right: 4px; top: -25px; }
57
+ .grand .grand_controls span { display: inline-block; width: 30px; height: 30px; margin-left: 0px; overflow: hidden; text-indent: -100em; cursor: pointer; }
58
+ .grand .grand_controls .g_prev { background: url('images/fancy_nav_left.png') 0 0 no-repeat; }
59
+ .grand .grand_controls .g_next { background: url('images/fancy_nav_right.png') 0 0 no-repeat; }
60
+ .grand .grand_controls .g_slideshow.play { background: url('images/fancy_nav_slide.png') -30px 0 no-repeat; }
61
+ .grand .grand_controls .g_slideshow.stop { background: url('images/fancy_nav_slide.png') 0px 0 no-repeat; }
62
+ .fancybox-title-float { position: absolute; left: 0; bottom: -20px; height: 32px; }
63
+ #fancybox-title-float-wrap { border: none; border-collapse: collapse; width: auto; }
64
+ #fancybox-title-float-wrap td { border: none; white-space: nowrap; }
65
+ #fancybox-title-float-left { padding: 0 0 0 15px; background: url('images/fancybox.png') -40px -90px no-repeat; }
66
+ #fancybox-title-float-main { color: #FFF; line-height: 29px; font-weight: bold; padding: 0 0 3px 0; background: url('images/fancybox-x.png') 0px -40px; }
67
+ #fancybox-title-float-right { padding: 0 0 0 15px; background: url('images/fancybox.png') -55px -90px no-repeat; }
68
+ /* IE6 */
69
+ .fancybox-ie6 #fancybox-close { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/fancy_close.png', sizingMethod='scale'); }
70
+ .fancybox-ie6 #fancybox-left-ico { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/fancy_nav_left.png', sizingMethod='scale'); }
71
+ .fancybox-ie6 #fancybox-right-ico { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/fancy_nav_right.png', sizingMethod='scale'); }
72
+ .fancybox-ie6 #fancybox-title-over { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/fancy_title_over.png', sizingMethod='scale'); zoom: 1; }
73
+ .fancybox-ie6 #fancybox-title-float-left { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/fancy_title_left.png', sizingMethod='scale'); }
74
+ .fancybox-ie6 #fancybox-title-float-main { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/fancy_title_main.png', sizingMethod='scale'); }
75
+ .fancybox-ie6 #fancybox-title-float-right { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/fancy_title_right.png', sizingMethod='scale'); }
76
+ .fancybox-ie6 #fancybox-bg-w, .fancybox-ie6 #fancybox-bg-e, .fancybox-ie6 #fancybox-left, .fancybox-ie6 #fancybox-right, #fancybox-hide-sel-frame { height: expression(this.parentNode.clientHeight + "px"); }
77
+ #fancybox-loading.fancybox-ie6 { position: absolute; margin-top: 0; top: expression( (-20 + (document.documentElement.clientHeight ? document.documentElement.clientHeight/2 : document.body.clientHeight/2 ) + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop )) + 'px'); }
78
+ #fancybox-loading.fancybox-ie6 div { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/fancy_loading.png', sizingMethod='scale'); }
79
+ /* IE6, IE7, IE8 */
80
+ .fancybox-ie .fancybox-bg { background: transparent !important; }
81
+ .fancybox-ie #fancybox-bg-n { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/fancy_shadow_n.png', sizingMethod='scale'); }
82
+ .fancybox-ie #fancybox-bg-ne { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/fancy_shadow_ne.png', sizingMethod='scale'); }
83
+ .fancybox-ie #fancybox-bg-e { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/fancy_shadow_e.png', sizingMethod='scale'); }
84
+ .fancybox-ie #fancybox-bg-se { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/fancy_shadow_se.png', sizingMethod='scale'); }
85
+ .fancybox-ie #fancybox-bg-s { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/fancy_shadow_s.png', sizingMethod='scale'); }
86
+ .fancybox-ie #fancybox-bg-sw { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/fancy_shadow_sw.png', sizingMethod='scale'); }
87
+ .fancybox-ie #fancybox-bg-w { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/fancy_shadow_w.png', sizingMethod='scale'); }
88
+ .fancybox-ie #fancybox-bg-nw { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/fancy_shadow_nw.png', sizingMethod='scale'); }
89
+ #fancybox-title-over em { font-size: 11px; }
90
+ #fancybox-title-over .title { font-size: 14px; }
91
+ #fancybox-title-over .descr { font-size: 12px; display: block; margin-top: 4px; }
admin/js/jquery.fancybox-1.3.4.pack.js ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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/jquery.nivo.slider.pack.js ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * jQuery Nivo Slider v3.1
3
+ * http://nivo.dev7studios.com
4
+ *
5
+ * Copyright 2012, Dev7studios
6
+ * Free to use and abuse under the MIT license.
7
+ * http://www.opensource.org/licenses/mit-license.php
8
+ */
9
+
10
+ (function(a){var b=function(b,c){var d=a.extend({},a.fn.nivoSlider.defaults,c);var e={currentSlide:0,currentImage:"",totalSlides:0,running:false,paused:false,stop:false,controlNavEl:false};var f=a(b);f.data("nivo:vars",e).addClass("nivoSlider");var g=f.children();g.each(function(){var b=a(this);var c="";if(!b.is("img")){if(b.is("a")){b.addClass("nivo-imageLink");c=b}b=b.find("img:first")}var d=d===0?b.attr("width"):b.width(),f=f===0?b.attr("height"):b.height();if(c!==""){c.css("display","none")}b.css("display","none");e.totalSlides++});if(d.randomStart){d.startSlide=Math.floor(Math.random()*e.totalSlides)}if(d.startSlide>0){if(d.startSlide>=e.totalSlides){d.startSlide=e.totalSlides-1}e.currentSlide=d.startSlide}if(a(g[e.currentSlide]).is("img")){e.currentImage=a(g[e.currentSlide])}else{e.currentImage=a(g[e.currentSlide]).find("img:first")}if(a(g[e.currentSlide]).is("a")){a(g[e.currentSlide]).css("display","block")}var h=a('<img class="nivo-main-image" src="#" />');h.attr("src",e.currentImage.attr("src")).show();f.append(h);a(window).resize(function(){f.children("img").width(f.width());h.attr("src",e.currentImage.attr("src"));h.stop().height("auto");a(".nivo-slice").remove();a(".nivo-box").remove()});f.append(a('<div class="nivo-caption"></div>'));var i=function(b){var c=a(".nivo-caption",f);if(e.currentImage.attr("title")!=""&&e.currentImage.attr("title")!=undefined){var d=e.currentImage.attr("title");if(d.substr(0,1)=="#")d=a(d).html();if(c.css("display")=="block"){setTimeout(function(){c.html(d)},b.animSpeed)}else{c.html(d);c.stop().fadeIn(b.animSpeed)}}else{c.stop().fadeOut(b.animSpeed)}};i(d);var j=0;if(!d.manualAdvance&&g.length>1){j=setInterval(function(){o(f,g,d,false)},d.pauseTime)}if(d.directionNav){f.append('<div class="nivo-directionNav"><a class="nivo-prevNav">'+d.prevText+'</a><a class="nivo-nextNav">'+d.nextText+"</a></div>");a("a.nivo-prevNav",f).live("click",function(){if(e.running){return false}clearInterval(j);j="";e.currentSlide-=2;o(f,g,d,"prev")});a("a.nivo-nextNav",f).live("click",function(){if(e.running){return false}clearInterval(j);j="";o(f,g,d,"next")})}if(d.controlNav){e.controlNavEl=a('<div class="nivo-controlNav"></div>');f.after(e.controlNavEl);for(var k=0;k<g.length;k++){if(d.controlNavThumbs){e.controlNavEl.addClass("nivo-thumbs-enabled");var l=g.eq(k);if(!l.is("img")){l=l.find("img:first")}if(l.attr("data-thumb"))e.controlNavEl.append('<a class="nivo-control" rel="'+k+'"><img src="'+l.attr("data-thumb")+'" alt="" /></a>')}else{e.controlNavEl.append('<a class="nivo-control" rel="'+k+'">'+(k+1)+"</a>")}}a("a:eq("+e.currentSlide+")",e.controlNavEl).addClass("active");a("a",e.controlNavEl).bind("click",function(){if(e.running)return false;if(a(this).hasClass("active"))return false;clearInterval(j);j="";h.attr("src",e.currentImage.attr("src"));e.currentSlide=a(this).attr("rel")-1;o(f,g,d,"control")})}if(d.pauseOnHover){f.hover(function(){e.paused=true;clearInterval(j);j=""},function(){e.paused=false;if(j===""&&!d.manualAdvance){j=setInterval(function(){o(f,g,d,false)},d.pauseTime)}})}f.bind("nivo:animFinished",function(){h.attr("src",e.currentImage.attr("src"));e.running=false;a(g).each(function(){if(a(this).is("a")){a(this).css("display","none")}});if(a(g[e.currentSlide]).is("a")){a(g[e.currentSlide]).css("display","block")}if(j===""&&!e.paused&&!d.manualAdvance){j=setInterval(function(){o(f,g,d,false)},d.pauseTime)}d.afterChange.call(this)});var m=function(b,c,d){if(a(d.currentImage).parent().is("a"))a(d.currentImage).parent().css("display","block");a('img[src="'+d.currentImage.attr("src")+'"]',b).not(".nivo-main-image,.nivo-control img").width(b.width()).css("visibility","hidden").show();var e=a('img[src="'+d.currentImage.attr("src")+'"]',b).not(".nivo-main-image,.nivo-control img").parent().is("a")?a('img[src="'+d.currentImage.attr("src")+'"]',b).not(".nivo-main-image,.nivo-control img").parent().height():a('img[src="'+d.currentImage.attr("src")+'"]',b).not(".nivo-main-image,.nivo-control img").height();for(var f=0;f<c.slices;f++){var g=Math.round(b.width()/c.slices);if(f===c.slices-1){b.append(a('<div class="nivo-slice" name="'+f+'"><img src="'+d.currentImage.attr("src")+'" style="position:absolute; width:'+b.width()+"px; height:auto; display:block !important; top:0; left:-"+(g+f*g-g)+'px;" /></div>').css({left:g*f+"px",width:b.width()-g*f+"px",height:e+"px",opacity:"0",overflow:"hidden"}))}else{b.append(a('<div class="nivo-slice" name="'+f+'"><img src="'+d.currentImage.attr("src")+'" style="position:absolute; width:'+b.width()+"px; height:auto; display:block !important; top:0; left:-"+(g+f*g-g)+'px;" /></div>').css({left:g*f+"px",width:g+"px",height:e+"px",opacity:"0",overflow:"hidden"}))}}a(".nivo-slice",b).height(e);h.stop().animate({height:a(d.currentImage).height()},c.animSpeed)};var n=function(b,c,d){if(a(d.currentImage).parent().is("a"))a(d.currentImage).parent().css("display","block");a('img[src="'+d.currentImage.attr("src")+'"]',b).not(".nivo-main-image,.nivo-control img").width(b.width()).css("visibility","hidden").show();var e=Math.round(b.width()/c.boxCols),f=Math.round(a('img[src="'+d.currentImage.attr("src")+'"]',b).not(".nivo-main-image,.nivo-control img").height()/c.boxRows);for(var g=0;g<c.boxRows;g++){for(var i=0;i<c.boxCols;i++){if(i===c.boxCols-1){b.append(a('<div class="nivo-box" name="'+i+'" rel="'+g+'"><img src="'+d.currentImage.attr("src")+'" style="position:absolute; width:'+b.width()+"px; height:auto; display:block; top:-"+f*g+"px; left:-"+e*i+'px;" /></div>').css({opacity:0,left:e*i+"px",top:f*g+"px",width:b.width()-e*i+"px"}));a('.nivo-box[name="'+i+'"]',b).height(a('.nivo-box[name="'+i+'"] img',b).height()+"px")}else{b.append(a('<div class="nivo-box" name="'+i+'" rel="'+g+'"><img src="'+d.currentImage.attr("src")+'" style="position:absolute; width:'+b.width()+"px; height:auto; display:block; top:-"+f*g+"px; left:-"+e*i+'px;" /></div>').css({opacity:0,left:e*i+"px",top:f*g+"px",width:e+"px"}));a('.nivo-box[name="'+i+'"]',b).height(a('.nivo-box[name="'+i+'"] img',b).height()+"px")}}}h.stop().animate({height:a(d.currentImage).height()},c.animSpeed)};var o=function(b,c,d,e){var f=b.data("nivo:vars");if(f&&f.currentSlide===f.totalSlides-1){d.lastSlide.call(this)}if((!f||f.stop)&&!e){return false}d.beforeChange.call(this);if(!e){h.attr("src",f.currentImage.attr("src"))}else{if(e==="prev"){h.attr("src",f.currentImage.attr("src"))}if(e==="next"){h.attr("src",f.currentImage.attr("src"))}}f.currentSlide++;if(f.currentSlide===f.totalSlides){f.currentSlide=0;d.slideshowEnd.call(this)}if(f.currentSlide<0){f.currentSlide=f.totalSlides-1}if(a(c[f.currentSlide]).is("img")){f.currentImage=a(c[f.currentSlide])}else{f.currentImage=a(c[f.currentSlide]).find("img:first")}if(d.controlNav){a("a",f.controlNavEl).removeClass("active");a("a:eq("+f.currentSlide+")",f.controlNavEl).addClass("active")}i(d);a(".nivo-slice",b).remove();a(".nivo-box",b).remove();var g=d.effect,j="";if(d.effect==="random"){j=new Array("sliceDownRight","sliceDownLeft","sliceUpRight","sliceUpLeft","sliceUpDown","sliceUpDownLeft","fold","fade","boxRandom","boxRain","boxRainReverse","boxRainGrow","boxRainGrowReverse");g=j[Math.floor(Math.random()*(j.length+1))];if(g===undefined){g="fade"}}if(d.effect.indexOf(",")!==-1){j=d.effect.split(",");g=j[Math.floor(Math.random()*j.length)];if(g===undefined){g="fade"}}if(f.currentImage.attr("data-transition")){g=f.currentImage.attr("data-transition")}f.running=true;var k=0,l=0,o="",q="",r="",s="";if(g==="sliceDown"||g==="sliceDownRight"||g==="sliceDownLeft"){m(b,d,f);k=0;l=0;o=a(".nivo-slice",b);if(g==="sliceDownLeft"){o=a(".nivo-slice",b)._reverse()}o.each(function(){var c=a(this);c.css({top:"0px"});if(l===d.slices-1){setTimeout(function(){c.animate({opacity:"1.0"},d.animSpeed,"",function(){b.trigger("nivo:animFinished")})},100+k)}else{setTimeout(function(){c.animate({opacity:"1.0"},d.animSpeed)},100+k)}k+=50;l++})}else if(g==="sliceUp"||g==="sliceUpRight"||g==="sliceUpLeft"){m(b,d,f);k=0;l=0;o=a(".nivo-slice",b);if(g==="sliceUpLeft"){o=a(".nivo-slice",b)._reverse()}o.each(function(){var c=a(this);c.css({bottom:"0px"});if(l===d.slices-1){setTimeout(function(){c.animate({opacity:"1.0"},d.animSpeed,"",function(){b.trigger("nivo:animFinished")})},100+k)}else{setTimeout(function(){c.animate({opacity:"1.0"},d.animSpeed)},100+k)}k+=50;l++})}else if(g==="sliceUpDown"||g==="sliceUpDownRight"||g==="sliceUpDownLeft"){m(b,d,f);k=0;l=0;var t=0;o=a(".nivo-slice",b);if(g==="sliceUpDownLeft"){o=a(".nivo-slice",b)._reverse()}o.each(function(){var c=a(this);if(l===0){c.css("top","0px");l++}else{c.css("bottom","0px");l=0}if(t===d.slices-1){setTimeout(function(){c.animate({opacity:"1.0"},d.animSpeed,"",function(){b.trigger("nivo:animFinished")})},100+k)}else{setTimeout(function(){c.animate({opacity:"1.0"},d.animSpeed)},100+k)}k+=50;t++})}else if(g==="fold"){m(b,d,f);k=0;l=0;a(".nivo-slice",b).each(function(){var c=a(this);var e=c.width();c.css({top:"0px",width:"0px"});if(l===d.slices-1){setTimeout(function(){c.animate({width:e,opacity:"1.0"},d.animSpeed,"",function(){b.trigger("nivo:animFinished")})},100+k)}else{setTimeout(function(){c.animate({width:e,opacity:"1.0"},d.animSpeed)},100+k)}k+=50;l++})}else if(g==="fade"){m(b,d,f);q=a(".nivo-slice:first",b);q.css({width:b.width()+"px"});q.animate({opacity:"1.0"},d.animSpeed*2,"",function(){b.trigger("nivo:animFinished")})}else if(g==="slideInRight"){m(b,d,f);q=a(".nivo-slice:first",b);q.css({width:"0px",opacity:"1"});q.animate({width:b.width()+"px"},d.animSpeed*2,"",function(){b.trigger("nivo:animFinished")})}else if(g==="slideInLeft"){m(b,d,f);q=a(".nivo-slice:first",b);q.css({width:"0px",opacity:"1",left:"",right:"0px"});q.animate({width:b.width()+"px"},d.animSpeed*2,"",function(){q.css({left:"0px",right:""});b.trigger("nivo:animFinished")})}else if(g==="boxRandom"){n(b,d,f);r=d.boxCols*d.boxRows;l=0;k=0;s=p(a(".nivo-box",b));s.each(function(){var c=a(this);if(l===r-1){setTimeout(function(){c.animate({opacity:"1"},d.animSpeed,"",function(){b.trigger("nivo:animFinished")})},100+k)}else{setTimeout(function(){c.animate({opacity:"1"},d.animSpeed)},100+k)}k+=20;l++})}else if(g==="boxRain"||g==="boxRainReverse"||g==="boxRainGrow"||g==="boxRainGrowReverse"){n(b,d,f);r=d.boxCols*d.boxRows;l=0;k=0;var u=0;var v=0;var w=[];w[u]=[];s=a(".nivo-box",b);if(g==="boxRainReverse"||g==="boxRainGrowReverse"){s=a(".nivo-box",b)._reverse()}s.each(function(){w[u][v]=a(this);v++;if(v===d.boxCols){u++;v=0;w[u]=[]}});for(var x=0;x<d.boxCols*2;x++){var y=x;for(var z=0;z<d.boxRows;z++){if(y>=0&&y<d.boxCols){(function(c,e,f,h,i){var j=a(w[c][e]);var k=j.width();var l=j.height();if(g==="boxRainGrow"||g==="boxRainGrowReverse"){j.width(0).height(0)}if(h===i-1){setTimeout(function(){j.animate({opacity:"1",width:k,height:l},d.animSpeed/1.3,"",function(){b.trigger("nivo:animFinished")})},100+f)}else{setTimeout(function(){j.animate({opacity:"1",width:k,height:l},d.animSpeed/1.3)},100+f)}})(z,y,k,l,r);l++}y--}k+=100}}};var p=function(a){for(var b,c,d=a.length;d;b=parseInt(Math.random()*d,10),c=a[--d],a[d]=a[b],a[b]=c);return a};var q=function(a){if(this.console&&typeof console.log!=="undefined"){console.log(a)}};this.stop=function(){if(!a(b).data("nivo:vars").stop){a(b).data("nivo:vars").stop=true;q("Stop Slider")}};this.start=function(){if(a(b).data("nivo:vars").stop){a(b).data("nivo:vars").stop=false;q("Start Slider")}};d.afterLoad.call(this);return this};a.fn.nivoSlider=function(c){return this.each(function(d,e){var f=a(this);if(f.data("nivoslider")){return f.data("nivoslider")}var g=new b(this,c);f.data("nivoslider",g)})};a.fn.nivoSlider.defaults={effect:"random",slices:15,boxCols:8,boxRows:4,animSpeed:500,pauseTime:3e3,startSlide:0,directionNav:true,controlNav:true,controlNavThumbs:false,pauseOnHover:true,manualAdvance:false,prevText:"Prev",nextText:"Next",randomStart:false,beforeChange:function(){},afterChange:function(){},slideshowEnd:function(){},lastSlide:function(){},afterLoad:function(){}};a.fn._reverse=[].reverse})(jQuery)
admin/js/jquery.tablednd_0_5.js ADDED
@@ -0,0 +1,382 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * TableDnD plug-in for JQuery, allows you to drag and drop table rows
3
+ * You can set up various options to control how the system will work
4
+ * Copyright (c) Denis Howlett <denish@isocra.com>
5
+ * Licensed like jQuery, see http://docs.jquery.com/License.
6
+ *
7
+ * Configuration options:
8
+ *
9
+ * onDragStyle
10
+ * This is the style that is assigned to the row during drag. There are limitations to the styles that can be
11
+ * associated with a row (such as you can't assign a border--well you can, but it won't be
12
+ * displayed). (So instead consider using onDragClass.) The CSS style to apply is specified as
13
+ * a map (as used in the jQuery css(...) function).
14
+ * onDropStyle
15
+ * This is the style that is assigned to the row when it is dropped. As for onDragStyle, there are limitations
16
+ * to what you can do. Also this replaces the original style, so again consider using onDragClass which
17
+ * is simply added and then removed on drop.
18
+ * onDragClass
19
+ * This class is added for the duration of the drag and then removed when the row is dropped. It is more
20
+ * flexible than using onDragStyle since it can be inherited by the row cells and other content. The default
21
+ * is class is tDnD_whileDrag. So to use the default, simply customise this CSS class in your
22
+ * stylesheet.
23
+ * onDrop
24
+ * Pass a function that will be called when the row is dropped. The function takes 2 parameters: the table
25
+ * and the row that was dropped. You can work out the new order of the rows by using
26
+ * table.rows.
27
+ * onDragStart
28
+ * Pass a function that will be called when the user starts dragging. The function takes 2 parameters: the
29
+ * table and the row which the user has started to drag.
30
+ * onAllowDrop
31
+ * Pass a function that will be called as a row is over another row. If the function returns true, allow
32
+ * dropping on that row, otherwise not. The function takes 2 parameters: the dragged row and the row under
33
+ * the cursor. It returns a boolean: true allows the drop, false doesn't allow it.
34
+ * scrollAmount
35
+ * This is the number of pixels to scroll if the user moves the mouse cursor to the top or bottom of the
36
+ * window. The page should automatically scroll up or down as appropriate (tested in IE6, IE7, Safari, FF2,
37
+ * FF3 beta
38
+ * dragHandle
39
+ * This is the name of a class that you assign to one or more cells in each row that is draggable. If you
40
+ * specify this class, then you are responsible for setting cursor: move in the CSS and only these cells
41
+ * will have the drag behaviour. If you do not specify a dragHandle, then you get the old behaviour where
42
+ * the whole row is draggable.
43
+ *
44
+ * Other ways to control behaviour:
45
+ *
46
+ * Add class="nodrop" to any rows for which you don't want to allow dropping, and class="nodrag" to any rows
47
+ * that you don't want to be draggable.
48
+ *
49
+ * Inside the onDrop method you can also call jQuery.tableDnD.serialize() this returns a string of the form
50
+ * <tableID>[]=<rowID1>&<tableID>[]=<rowID2> so that you can send this back to the server. The table must have
51
+ * an ID as must all the rows.
52
+ *
53
+ * Other methods:
54
+ *
55
+ * jQuery("...").tableDnDUpdate()
56
+ * Will update all the matching tables, that is it will reapply the mousedown method to the rows (or handle cells).
57
+ * This is useful if you have updated the table rows using Ajax and you want to make the table draggable again.
58
+ * The table maintains the original configuration (so you don't have to specify it again).
59
+ *
60
+ * jQuery("...").tableDnDSerialize()
61
+ * Will serialize and return the serialized string as above, but for each of the matching tables--so it can be
62
+ * called from anywhere and isn't dependent on the currentTable being set up correctly before calling
63
+ *
64
+ * Known problems:
65
+ * - Auto-scoll has some problems with IE7 (it scrolls even when it shouldn't), work-around: set scrollAmount to 0
66
+ *
67
+ * Version 0.2: 2008-02-20 First public version
68
+ * Version 0.3: 2008-02-07 Added onDragStart option
69
+ * Made the scroll amount configurable (default is 5 as before)
70
+ * Version 0.4: 2008-03-15 Changed the noDrag/noDrop attributes to nodrag/nodrop classes
71
+ * Added onAllowDrop to control dropping
72
+ * Fixed a bug which meant that you couldn't set the scroll amount in both directions
73
+ * Added serialize method
74
+ * Version 0.5: 2008-05-16 Changed so that if you specify a dragHandle class it doesn't make the whole row
75
+ * draggable
76
+ * Improved the serialize method to use a default (and settable) regular expression.
77
+ * Added tableDnDupate() and tableDnDSerialize() to be called when you are outside the table
78
+ */
79
+ jQuery.tableDnD = {
80
+ /** Keep hold of the current table being dragged */
81
+ currentTable : null,
82
+ /** Keep hold of the current drag object if any */
83
+ dragObject: null,
84
+ /** The current mouse offset */
85
+ mouseOffset: null,
86
+ /** Remember the old value of Y so that we don't do too much processing */
87
+ oldY: 0,
88
+
89
+ /** Actually build the structure */
90
+ build: function(options) {
91
+ // Set up the defaults if any
92
+
93
+ this.each(function() {
94
+ // This is bound to each matching table, set up the defaults and override with user options
95
+ this.tableDnDConfig = jQuery.extend({
96
+ onDragStyle: null,
97
+ onDropStyle: null,
98
+ // Add in the default class for whileDragging
99
+ onDragClass: "tDnD_whileDrag",
100
+ onDrop: null,
101
+ onDragStart: null,
102
+ scrollAmount: 5,
103
+ serializeRegexp: /[^\-]*$/, // The regular expression to use to trim row IDs
104
+ serializeParamName: null, // If you want to specify another parameter name instead of the table ID
105
+ dragHandle: null // If you give the name of a class here, then only Cells with this class will be draggable
106
+ }, options || {});
107
+ // Now make the rows draggable
108
+ jQuery.tableDnD.makeDraggable(this);
109
+ });
110
+
111
+ // Now we need to capture the mouse up and mouse move event
112
+ // We can use bind so that we don't interfere with other event handlers
113
+ jQuery(document)
114
+ .bind('mousemove', jQuery.tableDnD.mousemove)
115
+ .bind('mouseup', jQuery.tableDnD.mouseup);
116
+
117
+ // Don't break the chain
118
+ return this;
119
+ },
120
+
121
+ /** This function makes all the rows on the table draggable apart from those marked as "NoDrag" */
122
+ makeDraggable: function(table) {
123
+ var config = table.tableDnDConfig;
124
+ if (table.tableDnDConfig.dragHandle) {
125
+ // We only need to add the event to the specified cells
126
+ var cells = jQuery("td."+table.tableDnDConfig.dragHandle, table);
127
+ cells.each(function() {
128
+ // The cell is bound to "this"
129
+ jQuery(this).mousedown(function(ev) {
130
+ jQuery.tableDnD.dragObject = this.parentNode;
131
+ jQuery.tableDnD.currentTable = table;
132
+ jQuery.tableDnD.mouseOffset = jQuery.tableDnD.getMouseOffset(this, ev);
133
+ if (config.onDragStart) {
134
+ // Call the onDrop method if there is one
135
+ config.onDragStart(table, this);
136
+ }
137
+ return false;
138
+ });
139
+ })
140
+ } else {
141
+ // For backwards compatibility, we add the event to the whole row
142
+ var rows = jQuery("tr", table); // get all the rows as a wrapped set
143
+ rows.each(function() {
144
+ // Iterate through each row, the row is bound to "this"
145
+ var row = jQuery(this);
146
+ if (! row.hasClass("nodrag")) {
147
+ row.mousedown(function(ev) {
148
+ if (ev.target.tagName == "TD") {
149
+ jQuery.tableDnD.dragObject = this;
150
+ jQuery.tableDnD.currentTable = table;
151
+ jQuery.tableDnD.mouseOffset = jQuery.tableDnD.getMouseOffset(this, ev);
152
+ if (config.onDragStart) {
153
+ // Call the onDrop method if there is one
154
+ config.onDragStart(table, this);
155
+ }
156
+ return false;
157
+ }
158
+ }).css("cursor", "move"); // Store the tableDnD object
159
+ }
160
+ });
161
+ }
162
+ },
163
+
164
+ updateTables: function() {
165
+ this.each(function() {
166
+ // this is now bound to each matching table
167
+ if (this.tableDnDConfig) {
168
+ jQuery.tableDnD.makeDraggable(this);
169
+ }
170
+ })
171
+ },
172
+
173
+ /** Get the mouse coordinates from the event (allowing for browser differences) */
174
+ mouseCoords: function(ev){
175
+ if(ev.pageX || ev.pageY){
176
+ return {x:ev.pageX, y:ev.pageY};
177
+ }
178
+ return {
179
+ x:ev.clientX + document.body.scrollLeft - document.body.clientLeft,
180
+ y:ev.clientY + document.body.scrollTop - document.body.clientTop
181
+ };
182
+ },
183
+
184
+ /** Given a target element and a mouse event, get the mouse offset from that element.
185
+ To do this we need the element's position and the mouse position */
186
+ getMouseOffset: function(target, ev) {
187
+ ev = ev || window.event;
188
+
189
+ var docPos = this.getPosition(target);
190
+ var mousePos = this.mouseCoords(ev);
191
+ return {x:mousePos.x - docPos.x, y:mousePos.y - docPos.y};
192
+ },
193
+
194
+ /** Get the position of an element by going up the DOM tree and adding up all the offsets */
195
+ getPosition: function(e){
196
+ var left = 0;
197
+ var top = 0;
198
+ /** Safari fix -- thanks to Luis Chato for this! */
199
+ if (e.offsetHeight == 0) {
200
+ /** Safari 2 doesn't correctly grab the offsetTop of a table row
201
+ this is detailed here:
202
+ http://jacob.peargrove.com/blog/2006/technical/table-row-offsettop-bug-in-safari/
203
+ the solution is likewise noted there, grab the offset of a table cell in the row - the firstChild.
204
+ note that firefox will return a text node as a first child, so designing a more thorough
205
+ solution may need to take that into account, for now this seems to work in firefox, safari, ie */
206
+ e = e.firstChild; // a table cell
207
+ }
208
+
209
+ while (e.offsetParent){
210
+ left += e.offsetLeft;
211
+ top += e.offsetTop;
212
+ e = e.offsetParent;
213
+ }
214
+
215
+ left += e.offsetLeft;
216
+ top += e.offsetTop;
217
+
218
+ return {x:left, y:top};
219
+ },
220
+
221
+ mousemove: function(ev) {
222
+ if (jQuery.tableDnD.dragObject == null) {
223
+ return;
224
+ }
225
+
226
+ var dragObj = jQuery(jQuery.tableDnD.dragObject);
227
+ var config = jQuery.tableDnD.currentTable.tableDnDConfig;
228
+ var mousePos = jQuery.tableDnD.mouseCoords(ev);
229
+ var y = mousePos.y - jQuery.tableDnD.mouseOffset.y;
230
+ //auto scroll the window
231
+ var yOffset = window.pageYOffset;
232
+ if (document.all) {
233
+ // Windows version
234
+ //yOffset=document.body.scrollTop;
235
+ if (typeof document.compatMode != 'undefined' &&
236
+ document.compatMode != 'BackCompat') {
237
+ yOffset = document.documentElement.scrollTop;
238
+ }
239
+ else if (typeof document.body != 'undefined') {
240
+ yOffset=document.body.scrollTop;
241
+ }
242
+
243
+ }
244
+
245
+ if (mousePos.y-yOffset < config.scrollAmount) {
246
+ window.scrollBy(0, -config.scrollAmount);
247
+ } else {
248
+ var windowHeight = window.innerHeight ? window.innerHeight
249
+ : document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight;
250
+ if (windowHeight-(mousePos.y-yOffset) < config.scrollAmount) {
251
+ window.scrollBy(0, config.scrollAmount);
252
+ }
253
+ }
254
+
255
+
256
+ if (y != jQuery.tableDnD.oldY) {
257
+ // work out if we're going up or down...
258
+ var movingDown = y > jQuery.tableDnD.oldY;
259
+ // update the old value
260
+ jQuery.tableDnD.oldY = y;
261
+ // update the style to show we're dragging
262
+ if (config.onDragClass) {
263
+ dragObj.addClass(config.onDragClass);
264
+ } else {
265
+ dragObj.css(config.onDragStyle);
266
+ }
267
+ // If we're over a row then move the dragged row to there so that the user sees the
268
+ // effect dynamically
269
+ var currentRow = jQuery.tableDnD.findDropTargetRow(dragObj, y);
270
+ if (currentRow) {
271
+ // TODO worry about what happens when there are multiple TBODIES
272
+ if (movingDown && jQuery.tableDnD.dragObject != currentRow) {
273
+ jQuery.tableDnD.dragObject.parentNode.insertBefore(jQuery.tableDnD.dragObject, currentRow.nextSibling);
274
+ } else if (! movingDown && jQuery.tableDnD.dragObject != currentRow) {
275
+ jQuery.tableDnD.dragObject.parentNode.insertBefore(jQuery.tableDnD.dragObject, currentRow);
276
+ }
277
+ }
278
+ }
279
+
280
+ return false;
281
+ },
282
+
283
+ /** We're only worried about the y position really, because we can only move rows up and down */
284
+ findDropTargetRow: function(draggedRow, y) {
285
+ var rows = jQuery.tableDnD.currentTable.rows;
286
+ for (var i=0; i<rows.length; i++) {
287
+ var row = rows[i];
288
+ var rowY = this.getPosition(row).y;
289
+ var rowHeight = parseInt(row.offsetHeight)/2;
290
+ if (row.offsetHeight == 0) {
291
+ rowY = this.getPosition(row.firstChild).y;
292
+ rowHeight = parseInt(row.firstChild.offsetHeight)/2;
293
+ }
294
+ // Because we always have to insert before, we need to offset the height a bit
295
+ if ((y > rowY - rowHeight) && (y < (rowY + rowHeight))) {
296
+ // that's the row we're over
297
+ // If it's the same as the current row, ignore it
298
+ if (row == draggedRow) {return null;}
299
+ var config = jQuery.tableDnD.currentTable.tableDnDConfig;
300
+ if (config.onAllowDrop) {
301
+ if (config.onAllowDrop(draggedRow, row)) {
302
+ return row;
303
+ } else {
304
+ return null;
305
+ }
306
+ } else {
307
+ // If a row has nodrop class, then don't allow dropping (inspired by John Tarr and Famic)
308
+ var nodrop = jQuery(row).hasClass("nodrop");
309
+ if (! nodrop) {
310
+ return row;
311
+ } else {
312
+ return null;
313
+ }
314
+ }
315
+ return row;
316
+ }
317
+ }
318
+ return null;
319
+ },
320
+
321
+ mouseup: function(e) {
322
+ if (jQuery.tableDnD.currentTable && jQuery.tableDnD.dragObject) {
323
+ var droppedRow = jQuery.tableDnD.dragObject;
324
+ var config = jQuery.tableDnD.currentTable.tableDnDConfig;
325
+ // If we have a dragObject, then we need to release it,
326
+ // The row will already have been moved to the right place so we just reset stuff
327
+ if (config.onDragClass) {
328
+ jQuery(droppedRow).removeClass(config.onDragClass);
329
+ } else {
330
+ jQuery(droppedRow).css(config.onDropStyle);
331
+ }
332
+ jQuery.tableDnD.dragObject = null;
333
+ if (config.onDrop) {
334
+ // Call the onDrop method if there is one
335
+ config.onDrop(jQuery.tableDnD.currentTable, droppedRow);
336
+ }
337
+ jQuery.tableDnD.currentTable = null; // let go of the table too
338
+ }
339
+ },
340
+
341
+ serialize: function() {
342
+ if (jQuery.tableDnD.currentTable) {
343
+ return jQuery.tableDnD.serializeTable(jQuery.tableDnD.currentTable);
344
+ } else {
345
+ return "Error: No Table id set, you need to set an id on your table and every row";
346
+ }
347
+ },
348
+
349
+ serializeTable: function(table) {
350
+ var result = "";
351
+ var tableId = table.id;
352
+ var rows = table.rows;
353
+ for (var i=0; i<rows.length; i++) {
354
+ if (result.length > 0) result += "&";
355
+ var rowId = rows[i].id;
356
+ if (rowId && rowId && table.tableDnDConfig && table.tableDnDConfig.serializeRegexp) {
357
+ rowId = rowId.match(table.tableDnDConfig.serializeRegexp)[0];
358
+ }
359
+
360
+ result += tableId + '[]=' + rows[i].id;
361
+ }
362
+ return result;
363
+ },
364
+
365
+ serializeTables: function() {
366
+ var result = "";
367
+ this.each(function() {
368
+ // this is now bound to each matching table
369
+ result += jQuery.tableDnD.serializeTable(this);
370
+ });
371
+ return result;
372
+ }
373
+
374
+ }
375
+
376
+ jQuery.fn.extend(
377
+ {
378
+ tableDnD : jQuery.tableDnD.build,
379
+ tableDnDUpdate : jQuery.tableDnD.updateTables,
380
+ tableDnDSerialize: jQuery.tableDnD.serializeTables
381
+ }
382
+ );
admin/js/jquery.tablesorter.js ADDED
@@ -0,0 +1,852 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ *
3
+ * TableSorter 2.0 - Client-side table sorting with ease!
4
+ * Version 2.0.3
5
+ * @requires jQuery v1.2.3
6
+ *
7
+ * Copyright (c) 2007 Christian Bach
8
+ * Examples and docs at: http://tablesorter.com
9
+ * Dual licensed under the MIT and GPL licenses:
10
+ * http://www.opensource.org/licenses/mit-license.php
11
+ * http://www.gnu.org/licenses/gpl.html
12
+ *
13
+ */
14
+ /**
15
+ *
16
+ * @description Create a sortable table with multi-column sorting capabilitys
17
+ *
18
+ * @example $('table').tablesorter();
19
+ * @desc Create a simple tablesorter interface.
20
+ *
21
+ * @example $('table').tablesorter({ sortList:[[0,0],[1,0]] });
22
+ * @desc Create a tablesorter interface and sort on the first and secound column in ascending order.
23
+ *
24
+ * @example $('table').tablesorter({ headers: { 0: { sorter: false}, 1: {sorter: false} } });
25
+ * @desc Create a tablesorter interface and disableing the first and secound column headers.
26
+ *
27
+ * @example $('table').tablesorter({ 0: {sorter:"integer"}, 1: {sorter:"currency"} });
28
+ * @desc Create a tablesorter interface and set a column parser for the first and secound column.
29
+ *
30
+ *
31
+ * @param Object settings An object literal containing key/value pairs to provide optional settings.
32
+ *
33
+ * @option String cssHeader (optional) A string of the class name to be appended to sortable tr elements in the thead of the table.
34
+ * Default value: "header"
35
+ *
36
+ * @option String cssAsc (optional) A string of the class name to be appended to sortable tr elements in the thead on a ascending sort.
37
+ * Default value: "headerSortUp"
38
+ *
39
+ * @option String cssDesc (optional) A string of the class name to be appended to sortable tr elements in the thead on a descending sort.
40
+ * Default value: "headerSortDown"
41
+ *
42
+ * @option String sortInitialOrder (optional) A string of the inital sorting order can be asc or desc.
43
+ * Default value: "asc"
44
+ *
45
+ * @option String sortMultisortKey (optional) A string of the multi-column sort key.
46
+ * Default value: "shiftKey"
47
+ *
48
+ * @option String textExtraction (optional) A string of the text-extraction method to use.
49
+ * For complex html structures inside td cell set this option to "complex",
50
+ * on large tables the complex option can be slow.
51
+ * Default value: "simple"
52
+ *
53
+ * @option Object headers (optional) An array containing the forces sorting rules.
54
+ * This option let's you specify a default sorting rule.
55
+ * Default value: null
56
+ *
57
+ * @option Array sortList (optional) An array containing the forces sorting rules.
58
+ * This option let's you specify a default sorting rule.
59
+ * Default value: null
60
+ *
61
+ * @option Array sortForce (optional) An array containing forced sorting rules.
62
+ * This option let's you specify a default sorting rule, which is prepended to user-selected rules.
63
+ * Default value: null
64
+ *
65
+ * @option Array sortAppend (optional) An array containing forced sorting rules.
66
+ * This option let's you specify a default sorting rule, which is appended to user-selected rules.
67
+ * Default value: null
68
+ *
69
+ * @option Boolean widthFixed (optional) Boolean flag indicating if tablesorter should apply fixed widths to the table columns.
70
+ * This is usefull when using the pager companion plugin.
71
+ * This options requires the dimension jquery plugin.
72
+ * Default value: false
73
+ *
74
+ * @option Boolean cancelSelection (optional) Boolean flag indicating if tablesorter should cancel selection of the table headers text.
75
+ * Default value: true
76
+ *
77
+ * @option Boolean debug (optional) Boolean flag indicating if tablesorter should display debuging information usefull for development.
78
+ *
79
+ * @type jQuery
80
+ *
81
+ * @name tablesorter
82
+ *
83
+ * @cat Plugins/Tablesorter
84
+ *
85
+ * @author Christian Bach/christian.bach@polyester.se
86
+ */
87
+
88
+ (function($) {
89
+ $.extend({
90
+ tablesorter: new function() {
91
+
92
+ var parsers = [], widgets = [];
93
+
94
+ this.defaults = {
95
+ cssHeader: "header",
96
+ cssAsc: "headerSortUp",
97
+ cssDesc: "headerSortDown",
98
+ sortInitialOrder: "asc",
99
+ sortMultiSortKey: "shiftKey",
100
+ sortForce: null,
101
+ sortAppend: null,
102
+ textExtraction: "simple",
103
+ parsers: {},
104
+ widgets: [],
105
+ widgetZebra: {css: ["even","odd"]},
106
+ headers: {},
107
+ widthFixed: false,
108
+ cancelSelection: true,
109
+ sortList: [],
110
+ headerList: [],
111
+ dateFormat: "us",
112
+ decimal: '.',
113
+ debug: false
114
+ };
115
+
116
+ /* debuging utils */
117
+ function benchmark(s,d) {
118
+ log(s + "," + (new Date().getTime() - d.getTime()) + "ms");
119
+ }
120
+
121
+ this.benchmark = benchmark;
122
+
123
+ function log(s) {
124
+ if (typeof console != "undefined" && typeof console.debug != "undefined") {
125
+ console.log(s);
126
+ } else {
127
+ alert(s);
128
+ }
129
+ }
130
+
131
+ /* parsers utils */
132
+ function buildParserCache(table,$headers) {
133
+
134
+ if(table.config.debug) { var parsersDebug = ""; }
135
+
136
+ var rows = table.tBodies[0].rows;
137
+
138
+ if(table.tBodies[0].rows[0]) {
139
+
140
+ var list = [], cells = rows[0].cells, l = cells.length;
141
+
142
+ for (var i=0;i < l; i++) {
143
+ var p = false;
144
+
145
+ if($.metadata && ($($headers[i]).metadata() && $($headers[i]).metadata().sorter) ) {
146
+
147
+ p = getParserById($($headers[i]).metadata().sorter);
148
+
149
+ } else if((table.config.headers[i] && table.config.headers[i].sorter)) {
150
+
151
+ p = getParserById(table.config.headers[i].sorter);
152
+ }
153
+ if(!p) {
154
+ p = detectParserForColumn(table,cells[i]);
155
+ }
156
+
157
+ if(table.config.debug) { parsersDebug += "column:" + i + " parser:" +p.id + "\n"; }
158
+
159
+ list.push(p);
160
+ }
161
+ }
162
+
163
+ if(table.config.debug) { log(parsersDebug); }
164
+
165
+ return list;
166
+ };
167
+
168
+ function detectParserForColumn(table,node) {
169
+ var l = parsers.length;
170
+ for(var i=1; i < l; i++) {
171
+ if(parsers[i].is($.trim(getElementText(table.config,node)),table,node)) {
172
+ return parsers[i];
173
+ }
174
+ }
175
+ // 0 is always the generic parser (text)
176
+ return parsers[0];
177
+ }
178
+
179
+ function getParserById(name) {
180
+ var l = parsers.length;
181
+ for(var i=0; i < l; i++) {
182
+ if(parsers[i].id.toLowerCase() == name.toLowerCase()) {
183
+ return parsers[i];
184
+ }
185
+ }
186
+ return false;
187
+ }
188
+
189
+ /* utils */
190
+ function buildCache(table) {
191
+
192
+ if(table.config.debug) { var cacheTime = new Date(); }
193
+
194
+
195
+ var totalRows = (table.tBodies[0] && table.tBodies[0].rows.length) || 0,
196
+ totalCells = (table.tBodies[0].rows[0] && table.tBodies[0].rows[0].cells.length) || 0,
197
+ parsers = table.config.parsers,
198
+ cache = {row: [], normalized: []};
199
+
200
+ for (var i=0;i < totalRows; ++i) {
201
+
202
+ /** Add the table data to main data array */
203
+ var c = table.tBodies[0].rows[i], cols = [];
204
+
205
+ cache.row.push($(c));
206
+
207
+ for(var j=0; j < totalCells; ++j) {
208
+ cols.push(parsers[j].format(getElementText(table.config,c.cells[j]),table,c.cells[j]));
209
+ }
210
+
211
+ cols.push(i); // add position for rowCache
212
+ cache.normalized.push(cols);
213
+ cols = null;
214
+ };
215
+
216
+ if(table.config.debug) { benchmark("Building cache for " + totalRows + " rows:", cacheTime); }
217
+
218
+ return cache;
219
+ };
220
+
221
+ function getElementText(config,node) {
222
+
223
+ if(!node) return "";
224
+
225
+ var t = "";
226
+
227
+ if(config.textExtraction == "simple") {
228
+ if(node.childNodes[0] && node.childNodes[0].hasChildNodes()) {
229
+ t = node.childNodes[0].innerHTML;
230
+ } else {
231
+ t = node.innerHTML;
232
+ }
233
+ } else {
234
+ if(typeof(config.textExtraction) == "function") {
235
+ t = config.textExtraction(node);
236
+ } else {
237
+ t = $(node).text();
238
+ }
239
+ }
240
+ return t;
241
+ }
242
+
243
+ function appendToTable(table,cache) {
244
+
245
+ if(table.config.debug) {var appendTime = new Date()}
246
+
247
+ var c = cache,
248
+ r = c.row,
249
+ n= c.normalized,
250
+ totalRows = n.length,
251
+ checkCell = (n[0].length-1),
252
+ tableBody = $(table.tBodies[0]),
253
+ rows = [];
254
+
255
+ for (var i=0;i < totalRows; i++) {
256
+ rows.push(r[n[i][checkCell]]);
257
+ if(!table.config.appender) {
258
+
259
+ var o = r[n[i][checkCell]];
260
+ var l = o.length;
261
+ for(var j=0; j < l; j++) {
262
+
263
+ tableBody[0].appendChild(o[j]);
264
+
265
+ }
266
+
267
+ //tableBody.append(r[n[i][checkCell]]);
268
+ }
269
+ }
270
+
271
+ if(table.config.appender) {
272
+
273
+ table.config.appender(table,rows);
274
+ }
275
+
276
+ rows = null;
277
+
278
+ if(table.config.debug) { benchmark("Rebuilt table:", appendTime); }
279
+
280
+ //apply table widgets
281
+ applyWidget(table);
282
+
283
+ // trigger sortend
284
+ setTimeout(function() {
285
+ $(table).trigger("sortEnd");
286
+ },0);
287
+
288
+ };
289
+
290
+ function buildHeaders(table) {
291
+
292
+ if(table.config.debug) { var time = new Date(); }
293
+
294
+ var meta = ($.metadata) ? true : false, tableHeadersRows = [];
295
+
296
+ for(var i = 0; i < table.tHead.rows.length; i++) { tableHeadersRows[i]=0; };
297
+
298
+ $tableHeaders = $("thead th",table);
299
+
300
+ $tableHeaders.each(function(index) {
301
+
302
+ this.count = 0;
303
+ this.column = index;
304
+ this.order = formatSortingOrder(table.config.sortInitialOrder);
305
+
306
+ if(checkHeaderMetadata(this) || checkHeaderOptions(table,index)) this.sortDisabled = true;
307
+
308
+ if(!this.sortDisabled) {
309
+ $(this).addClass(table.config.cssHeader);
310
+ }
311
+
312
+ // add cell to headerList
313
+ table.config.headerList[index]= this;
314
+ });
315
+
316
+ if(table.config.debug) { benchmark("Built headers:", time); log($tableHeaders); }
317
+
318
+ return $tableHeaders;
319
+
320
+ };
321
+
322
+ function checkCellColSpan(table, rows, row) {
323
+ var arr = [], r = table.tHead.rows, c = r[row].cells;
324
+
325
+ for(var i=0; i < c.length; i++) {
326
+ var cell = c[i];
327
+
328
+ if ( cell.colSpan > 1) {
329
+ arr = arr.concat(checkCellColSpan(table, headerArr,row++));
330
+ } else {
331
+ if(table.tHead.length == 1 || (cell.rowSpan > 1 || !r[row+1])) {
332
+ arr.push(cell);
333
+ }
334
+ //headerArr[row] = (i+row);
335
+ }
336
+ }
337
+ return arr;
338
+ };
339
+
340
+ function checkHeaderMetadata(cell) {
341
+ if(($.metadata) && ($(cell).metadata().sorter === false)) { return true; };
342
+ return false;
343
+ }
344
+
345
+ function checkHeaderOptions(table,i) {
346
+ if((table.config.headers[i]) && (table.config.headers[i].sorter === false)) { return true; };
347
+ return false;
348
+ }
349
+
350
+ function applyWidget(table) {
351
+ var c = table.config.widgets;
352
+ var l = c.length;
353
+ for(var i=0; i < l; i++) {
354
+
355
+ getWidgetById(c[i]).format(table);
356
+ }
357
+
358
+ }
359
+
360
+ function getWidgetById(name) {
361
+ var l = widgets.length;
362
+ for(var i=0; i < l; i++) {
363
+ if(widgets[i].id.toLowerCase() == name.toLowerCase() ) {
364
+ return widgets[i];
365
+ }
366
+ }
367
+ };
368
+
369
+ function formatSortingOrder(v) {
370
+
371
+ if(typeof(v) != "Number") {
372
+ i = (v.toLowerCase() == "desc") ? 1 : 0;
373
+ } else {
374
+ i = (v == (0 || 1)) ? v : 0;
375
+ }
376
+ return i;
377
+ }
378
+
379
+ function isValueInArray(v, a) {
380
+ var l = a.length;
381
+ for(var i=0; i < l; i++) {
382
+ if(a[i][0] == v) {
383
+ return true;
384
+ }
385
+ }
386
+ return false;
387
+ }
388
+
389
+ function setHeadersCss(table,$headers, list, css) {
390
+ // remove all header information
391
+ $headers.removeClass(css[0]).removeClass(css[1]);
392
+
393
+ var h = [];
394
+ $headers.each(function(offset) {
395
+ if(!this.sortDisabled) {
396
+ h[this.column] = $(this);
397
+ }
398
+ });
399
+
400
+ var l = list.length;
401
+ for(var i=0; i < l; i++) {
402
+ h[list[i][0]].addClass(css[list[i][1]]);
403
+ }
404
+ }
405
+
406
+ function fixColumnWidth(table,$headers) {
407
+ var c = table.config;
408
+ if(c.widthFixed) {
409
+ var colgroup = $('<colgroup>');
410
+ $("tr:first td",table.tBodies[0]).each(function() {
411
+ colgroup.append($('<col>').css('width',$(this).width()));
412
+ });
413
+ $(table).prepend(colgroup);
414
+ };
415
+ }
416
+
417
+ function updateHeaderSortCount(table,sortList) {
418
+ var c = table.config, l = sortList.length;
419
+ for(var i=0; i < l; i++) {
420
+ var s = sortList[i], o = c.headerList[s[0]];
421
+ o.count = s[1];
422
+ o.count++;
423
+ }
424
+ }
425
+
426
+ /* sorting methods */
427
+ function multisort(table,sortList,cache) {
428
+
429
+ if(table.config.debug) { var sortTime = new Date(); }
430
+
431
+ var dynamicExp = "var sortWrapper = function(a,b) {", l = sortList.length;
432
+
433
+ for(var i=0; i < l; i++) {
434
+
435
+ var c = sortList[i][0];
436
+ var order = sortList[i][1];
437
+ var s = (getCachedSortType(table.config.parsers,c) == "text") ? ((order == 0) ? "sortText" : "sortTextDesc") : ((order == 0) ? "sortNumeric" : "sortNumericDesc");
438
+
439
+ var e = "e" + i;
440
+
441
+ dynamicExp += "var " + e + " = " + s + "(a[" + c + "],b[" + c + "]); ";
442
+ dynamicExp += "if(" + e + ") { return " + e + "; } ";
443
+ dynamicExp += "else { ";
444
+ }
445
+
446
+ // if value is the same keep orignal order
447
+ var orgOrderCol = cache.normalized[0].length - 1;
448
+ dynamicExp += "return a[" + orgOrderCol + "]-b[" + orgOrderCol + "];";
449
+
450
+ for(var i=0; i < l; i++) {
451
+ dynamicExp += "}; ";
452
+ }
453
+
454
+ dynamicExp += "return 0; ";
455
+ dynamicExp += "}; ";
456
+
457
+ eval(dynamicExp);
458
+
459
+ cache.normalized.sort(sortWrapper);
460
+
461
+ if(table.config.debug) { benchmark("Sorting on " + sortList.toString() + " and dir " + order+ " time:", sortTime); }
462
+
463
+ return cache;
464
+ };
465
+
466
+ function sortText(a,b) {
467
+ return ((a < b) ? -1 : ((a > b) ? 1 : 0));
468
+ };
469
+
470
+ function sortTextDesc(a,b) {
471
+ return ((b < a) ? -1 : ((b > a) ? 1 : 0));
472
+ };
473
+
474
+ function sortNumeric(a,b) {
475
+ return a-b;
476
+ };
477
+
478
+ function sortNumericDesc(a,b) {
479
+ return b-a;
480
+ };
481
+
482
+ function getCachedSortType(parsers,i) {
483
+ return parsers[i].type;
484
+ };
485
+
486
+ /* public methods */
487
+ this.construct = function(settings) {
488
+
489
+ return this.each(function() {
490
+
491
+ if(!this.tHead || !this.tBodies) return;
492
+
493
+ var $this, $document,$headers, cache, config, shiftDown = 0, sortOrder;
494
+
495
+ this.config = {};
496
+
497
+ config = $.extend(this.config, $.tablesorter.defaults, settings);
498
+
499
+ // store common expression for speed
500
+ $this = $(this);
501
+
502
+ // build headers
503
+ $headers = buildHeaders(this);
504
+
505
+ // try to auto detect column type, and store in tables config
506
+ this.config.parsers = buildParserCache(this,$headers);
507
+
508
+
509
+ // build the cache for the tbody cells
510
+ cache = buildCache(this);
511
+
512
+ // get the css class names, could be done else where.
513
+ var sortCSS = [config.cssDesc,config.cssAsc];
514
+
515
+ // fixate columns if the users supplies the fixedWidth option
516
+ fixColumnWidth(this);
517
+
518
+ // apply event handling to headers
519
+ // this is to big, perhaps break it out?
520
+ $headers.click(function(e) {
521
+
522
+ $this.trigger("sortStart");
523
+
524
+ var totalRows = ($this[0].tBodies[0] && $this[0].tBodies[0].rows.length) || 0;
525
+
526
+ if(!this.sortDisabled && totalRows > 0) {
527
+
528
+
529
+ // store exp, for speed
530
+ var $cell = $(this);
531
+
532
+ // get current column index
533
+ var i = this.column;
534
+
535
+ // get current column sort order
536
+ this.order = this.count++ % 2;
537
+
538
+ // user only whants to sort on one column
539
+ if(!e[config.sortMultiSortKey]) {
540
+
541
+ // flush the sort list
542
+ config.sortList = [];
543
+
544
+ if(config.sortForce != null) {
545
+ var a = config.sortForce;
546
+ for(var j=0; j < a.length; j++) {
547
+ if(a[j][0] != i) {
548
+ config.sortList.push(a[j]);
549
+ }
550
+ }
551
+ }
552
+
553
+ // add column to sort list
554
+ config.sortList.push([i,this.order]);
555
+
556
+ // multi column sorting
557
+ } else {
558
+ // the user has clicked on an all ready sortet column.
559
+ if(isValueInArray(i,config.sortList)) {
560
+
561
+ // revers the sorting direction for all tables.
562
+ for(var j=0; j < config.sortList.length; j++) {
563
+ var s = config.sortList[j], o = config.headerList[s[0]];
564
+ if(s[0] == i) {
565
+ o.count = s[1];
566
+ o.count++;
567
+ s[1] = o.count % 2;
568
+ }
569
+ }
570
+ } else {
571
+ // add column to sort list array
572
+ config.sortList.push([i,this.order]);
573
+ }
574
+ };
575
+ setTimeout(function() {
576
+ //set css for headers
577
+ setHeadersCss($this[0],$headers,config.sortList,sortCSS);
578
+ appendToTable($this[0],multisort($this[0],config.sortList,cache));
579
+ },1);
580
+ // stop normal event by returning false
581
+ return false;
582
+ }
583
+ // cancel selection
584
+ }).mousedown(function() {
585
+ if(config.cancelSelection) {
586
+ this.onselectstart = function() {return false};
587
+ return false;
588
+ }
589
+ });
590
+
591
+ // apply easy methods that trigger binded events
592
+ $this.bind("update",function() {
593
+
594
+ // rebuild parsers.
595
+ this.config.parsers = buildParserCache(this,$headers);
596
+
597
+ // rebuild the cache map
598
+ cache = buildCache(this);
599
+
600
+ }).bind("sorton",function(e,list) {
601
+
602
+ $(this).trigger("sortStart");
603
+
604
+ config.sortList = list;
605
+
606
+ // update and store the sortlist
607
+ var sortList = config.sortList;
608
+
609
+ // update header count index
610
+ updateHeaderSortCount(this,sortList);
611
+
612
+ //set css for headers
613
+ setHeadersCss(this,$headers,sortList,sortCSS);
614
+
615
+
616
+ // sort the table and append it to the dom
617
+ appendToTable(this,multisort(this,sortList,cache));
618
+
619
+ }).bind("appendCache",function() {
620
+
621
+ appendToTable(this,cache);
622
+
623
+ }).bind("applyWidgetId",function(e,id) {
624
+
625
+ getWidgetById(id).format(this);
626
+
627
+ }).bind("applyWidgets",function() {
628
+ // apply widgets
629
+ applyWidget(this);
630
+ });
631
+
632
+ if($.metadata && ($(this).metadata() && $(this).metadata().sortlist)) {
633
+ config.sortList = $(this).metadata().sortlist;
634
+ }
635
+ // if user has supplied a sort list to constructor.
636
+ if(config.sortList.length > 0) {
637
+ $this.trigger("sorton",[config.sortList]);
638
+ }
639
+
640
+ // apply widgets
641
+ applyWidget(this);
642
+ });
643
+ };
644
+
645
+ this.addParser = function(parser) {
646
+ var l = parsers.length, a = true;
647
+ for(var i=0; i < l; i++) {
648
+ if(parsers[i].id.toLowerCase() == parser.id.toLowerCase()) {
649
+ a = false;
650
+ }
651
+ }
652
+ if(a) { parsers.push(parser); };
653
+ };
654
+
655
+ this.addWidget = function(widget) {
656
+ widgets.push(widget);
657
+ };
658
+
659
+ this.formatFloat = function(s) {
660
+ var i = parseFloat(s);
661
+ return (isNaN(i)) ? 0 : i;
662
+ };
663
+ this.formatInt = function(s) {
664
+ var i = parseInt(s);
665
+ return (isNaN(i)) ? 0 : i;
666
+ };
667
+
668
+ this.isDigit = function(s,config) {
669
+ var DECIMAL = '\\' + config.decimal;
670
+ var exp = '/(^[+]?0(' + DECIMAL +'0+)?$)|(^([-+]?[1-9][0-9]*)$)|(^([-+]?((0?|[1-9][0-9]*)' + DECIMAL +'(0*[1-9][0-9]*)))$)|(^[-+]?[1-9]+[0-9]*' + DECIMAL +'0+$)/';
671
+ return RegExp(exp).test($.trim(s));
672
+ };
673
+
674
+ this.clearTableBody = function(table) {
675
+ if($.browser.msie) {
676
+ function empty() {
677
+ while ( this.firstChild ) this.removeChild( this.firstChild );
678
+ }
679
+ empty.apply(table.tBodies[0]);
680
+ } else {
681
+ table.tBodies[0].innerHTML = "";
682
+ }
683
+ };
684
+ }
685
+ });
686
+
687
+ // extend plugin scope
688
+ $.fn.extend({
689
+ tablesorter: $.tablesorter.construct
690
+ });
691
+
692
+ var ts = $.tablesorter;
693
+
694
+ // add default parsers
695
+ ts.addParser({
696
+ id: "text",
697
+ is: function(s) {
698
+ return true;
699
+ },
700
+ format: function(s) {
701
+ return $.trim(s.toLowerCase());
702
+ },
703
+ type: "text"
704
+ });
705
+
706
+ ts.addParser({
707
+ id: "digit",
708
+ is: function(s,table) {
709
+ var c = table.config;
710
+ return $.tablesorter.isDigit(s,c);
711
+ },
712
+ format: function(s) {
713
+ return $.tablesorter.formatFloat(s);
714
+ },
715
+ type: "numeric"
716
+ });
717
+
718
+ ts.addParser({
719
+ id: "currency",
720
+ is: function(s) {
721
+ return /^[£$€?.]/.test(s);
722
+ },
723
+ format: function(s) {
724
+ return $.tablesorter.formatFloat(s.replace(new RegExp(/[^0-9.]/g),""));
725
+ },
726
+ type: "numeric"
727
+ });
728
+
729
+ ts.addParser({
730
+ id: "ipAddress",
731
+ is: function(s) {
732
+ return /^\d{2,3}[\.]\d{2,3}[\.]\d{2,3}[\.]\d{2,3}$/.test(s);
733
+ },
734
+ format: function(s) {
735
+ var a = s.split("."), r = "", l = a.length;
736
+ for(var i = 0; i < l; i++) {
737
+ var item = a[i];
738
+ if(item.length == 2) {
739
+ r += "0" + item;
740
+ } else {
741
+ r += item;
742
+ }
743
+ }
744
+ return $.tablesorter.formatFloat(r);
745
+ },
746
+ type: "numeric"
747
+ });
748
+
749
+ ts.addParser({
750
+ id: "url",
751
+ is: function(s) {
752
+ return /^(https?|ftp|file):\/\/$/.test(s);
753
+ },
754
+ format: function(s) {
755
+ return jQuery.trim(s.replace(new RegExp(/(https?|ftp|file):\/\//),''));
756
+ },
757
+ type: "text"
758
+ });
759
+
760
+ ts.addParser({
761
+ id: "isoDate",
762
+ is: function(s) {
763
+ return /^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(s);
764
+ },
765
+ format: function(s) {
766
+ return $.tablesorter.formatFloat((s != "") ? new Date(s.replace(new RegExp(/-/g),"/")).getTime() : "0");
767
+ },
768
+ type: "numeric"
769
+ });
770
+
771
+ ts.addParser({
772
+ id: "percent",
773
+ is: function(s) {
774
+ return /\%$/.test($.trim(s));
775
+ },
776
+ format: function(s) {
777
+ return $.tablesorter.formatFloat(s.replace(new RegExp(/%/g),""));
778
+ },
779
+ type: "numeric"
780
+ });
781
+
782
+ ts.addParser({
783
+ id: "usLongDate",
784
+ is: function(s) {
785
+ return s.match(new RegExp(/^[A-Za-z]{3,10}\.? [0-9]{1,2}, ([0-9]{4}|'?[0-9]{2}) (([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\s(AM|PM)))$/));
786
+ },
787
+ format: function(s) {
788
+ return $.tablesorter.formatFloat(new Date(s).getTime());
789
+ },
790
+ type: "numeric"
791
+ });
792
+
793
+ ts.addParser({
794
+ id: "shortDate",
795
+ is: function(s) {
796
+ return /\d{1,2}[\/\-]\d{1,2}[\/\-]\d{2,4}/.test(s);
797
+ },
798
+ format: function(s,table) {
799
+ var c = table.config;
800
+ s = s.replace(/\-/g,"/");
801
+ if(c.dateFormat == "us") {
802
+ // reformat the string in ISO format
803
+ s = s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4})/, "$3/$1/$2");
804
+ } else if(c.dateFormat == "uk") {
805
+ //reformat the string in ISO format
806
+ s = s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4})/, "$3/$2/$1");
807
+ } else if(c.dateFormat == "dd/mm/yy" || c.dateFormat == "dd-mm-yy") {
808
+ s = s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{2})/, "$1/$2/$3");
809
+ }
810
+ return $.tablesorter.formatFloat(new Date(s).getTime());
811
+ },
812
+ type: "numeric"
813
+ });
814
+
815
+ ts.addParser({
816
+ id: "time",
817
+ is: function(s) {
818
+ return /^(([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\s(am|pm)))$/.test(s);
819
+ },
820
+ format: function(s) {
821
+ return $.tablesorter.formatFloat(new Date("2000/01/01 " + s).getTime());
822
+ },
823
+ type: "numeric"
824
+ });
825
+
826
+
827
+ ts.addParser({
828
+ id: "metadata",
829
+ is: function(s) {
830
+ return false;
831
+ },
832
+ format: function(s,table,cell) {
833
+ var c = table.config, p = (!c.parserMetadataName) ? 'sortValue' : c.parserMetadataName;
834
+ return $(cell).metadata()[p];
835
+ },
836
+ type: "numeric"
837
+ });
838
+
839
+ // add default widgets
840
+ ts.addWidget({
841
+ id: "zebra",
842
+ format: function(table) {
843
+ if(table.config.debug) { var time = new Date(); }
844
+ $("tr:visible",table.tBodies[0])
845
+ .filter(':even')
846
+ .removeClass(table.config.widgetZebra.css[1]).addClass(table.config.widgetZebra.css[0])
847
+ .end().filter(':odd')
848
+ .removeClass(table.config.widgetZebra.css[0]).addClass(table.config.widgetZebra.css[1]);
849
+ if(table.config.debug) { $.tablesorter.benchmark("Applying Zebra widget", time); }
850
+ }
851
+ });
852
+ })(jQuery);
admin/js/jqueryFileTree/images/application.png ADDED
Binary file
admin/js/jqueryFileTree/images/directory.png ADDED
Binary file
admin/js/jqueryFileTree/images/film.png ADDED
Binary file
admin/js/jqueryFileTree/images/flash.png ADDED
Binary file
admin/js/jqueryFileTree/images/folder_open.png ADDED
Binary file
admin/js/jqueryFileTree/images/music.png ADDED
Binary file
admin/js/jqueryFileTree/images/pdf.png ADDED
Binary file
admin/js/jqueryFileTree/images/picture.png ADDED
Binary file
admin/js/jqueryFileTree/images/spinner.gif ADDED
Binary file
admin/js/jqueryFileTree/images/zip.png ADDED
Binary file
admin/js/jqueryFileTree/jqueryFileTree.css ADDED
@@ -0,0 +1,81 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #file_browser {
2
+ border: 2px solid #999;
3
+ height: 200px;
4
+ overflow: auto;
5
+ padding: 4px 8px;
6
+ background: #fff;
7
+ margin: 4px 0px;
8
+ width: 350px;
9
+ position:relative;
10
+ display:none;
11
+ }
12
+ .browsefiles {margin-left:5px;}
13
+
14
+ ul.jqueryDirTree {
15
+ font-family: Verdana, sans-serif;
16
+ font-size: 11px;
17
+ line-height: 18px;
18
+ padding: 0px;
19
+ margin: 0px;
20
+ }
21
+
22
+ ul.jqueryDirTree li {
23
+ list-style: none;
24
+ padding: 2px 0px;
25
+ padding-left: 20px;
26
+ margin: 0px;
27
+ white-space: nowrap;
28
+ }
29
+
30
+ ul.jqueryDirTree a {
31
+ color: #333;
32
+ text-decoration: none;
33
+ display: block;
34
+ padding: 0px 2px;
35
+ }
36
+
37
+ ul.jqueryDirTree a:hover {
38
+ background: #bdf;
39
+ }
40
+ ul.jqueryDirTree li.active a {
41
+ background: #bdf;
42
+ }
43
+ ul.jqueryDirTree li.active li a {
44
+ background: none;
45
+ }
46
+ ul.jqueryDirTree li.active li a:hover {
47
+ background: #bdf;
48
+ }
49
+
50
+ /* Core Styles */
51
+ .jqueryDirTree li.directory { background: url(images/directory.png) left top no-repeat; }
52
+ .jqueryDirTree li.expanded { background: url(images/folder_open.png) left top no-repeat; }
53
+ .jqueryDirTree li.file { background: url(images/file.png) left top no-repeat; }
54
+ .jqueryDirTree li.wait { background: url(images/spinner.gif) left top no-repeat; }
55
+ /* File Extensions*/
56
+ .jqueryDirTree li.ext_3gp { background: url(images/film.png) left top no-repeat; }
57
+ .jqueryDirTree li.ext_avi { background: url(images/film.png) left top no-repeat; }
58
+ .jqueryDirTree li.ext_bat { background: url(images/application.png) left top no-repeat; }
59
+ .jqueryDirTree li.ext_bmp { background: url(images/picture.png) left top no-repeat; }
60
+ .jqueryDirTree li.ext_com { background: url(images/application.png) left top no-repeat; }
61
+ .jqueryDirTree li.ext_exe { background: url(images/application.png) left top no-repeat; }
62
+ .jqueryDirTree li.ext_gif { background: url(images/picture.png) left top no-repeat; }
63
+ .jqueryDirTree li.ext_fla { background: url(images/flash.png) left top no-repeat; }
64
+ .jqueryDirTree li.ext_jpg { background: url(images/picture.png) left top no-repeat; }
65
+ .jqueryDirTree li.ext_jpeg { background: url(images/picture.png) left top no-repeat; }
66
+ .jqueryDirTree li.ext_m4p { background: url(images/music.png) left top no-repeat; }
67
+ .jqueryDirTree li.ext_mov { background: url(images/film.png) left top no-repeat; }
68
+ .jqueryDirTree li.ext_mp3 { background: url(images/music.png) left top no-repeat; }
69
+ .jqueryDirTree li.ext_mp4 { background: url(images/film.png) left top no-repeat; }
70
+ .jqueryDirTree li.ext_mpg { background: url(images/film.png) left top no-repeat; }
71
+ .jqueryDirTree li.ext_mpeg { background: url(images/film.png) left top no-repeat; }
72
+ .jqueryDirTree li.ext_ogg { background: url(images/music.png) left top no-repeat; }
73
+ .jqueryDirTree li.ext_pcx { background: url(images/picture.png) left top no-repeat; }
74
+ .jqueryDirTree li.ext_pdf { background: url(images/pdf.png) left top no-repeat; }
75
+ .jqueryDirTree li.ext_png { background: url(images/picture.png) left top no-repeat; }
76
+ .jqueryDirTree li.ext_swf { background: url(images/flash.png) left top no-repeat; }
77
+ .jqueryDirTree li.ext_tif { background: url(images/picture.png) left top no-repeat; }
78
+ .jqueryDirTree li.ext_tiff { background: url(images/picture.png) left top no-repeat; }
79
+ .jqueryDirTree li.ext_wav { background: url(images/music.png) left top no-repeat; }
80
+ .jqueryDirTree li.ext_wmv { background: url(images/film.png) left top no-repeat; }
81
+ .jqueryDirTree li.ext_zip { background: url(images/zip.png) left top no-repeat; }
admin/js/jqueryFileTree/jqueryFileTree.js ADDED
@@ -0,0 +1,98 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // jQuery File Tree Plugin
2
+ //
3
+ // Version 1.01
4
+ //
5
+ // Cory S.N. LaViska
6
+ // A Beautiful Site (http://abeautifulsite.net/)
7
+ // 24 March 2008
8
+ //
9
+ // Visit http://abeautifulsite.net/notebook.php?article=58 for more information
10
+ //
11
+ // Usage: $('.fileTreeDemo').fileTree( options, callback )
12
+ //
13
+ // Options: root - root folder to display; default = /
14
+ // script - location of the serverside AJAX file to use; default = jqueryFileTree.php
15
+ // folderEvent - event to trigger expand/collapse; default = click
16
+ // expandSpeed - default = 500 (ms); use -1 for no animation
17
+ // collapseSpeed - default = 500 (ms); use -1 for no animation
18
+ // expandEasing - easing function to use on expand (optional)
19
+ // collapseEasing - easing function to use on collapse (optional)
20
+ // multiFolder - whether or not to limit the browser to one subfolder at a time
21
+ // loadMessage - Message to display while initial tree loads (can be HTML)
22
+ //
23
+ // History:
24
+ //
25
+ // 1.01 - updated to work with foreign characters in directory/file names (12 April 2008)
26
+ // 1.00 - released (24 March 2008)
27
+ //
28
+ // TERMS OF USE
29
+ //
30
+ // This plugin is dual-licensed under the GNU General Public License and the MIT License and
31
+ // is copyright 2008 A Beautiful Site, LLC.
32
+ //
33
+ if(jQuery) (function($){
34
+
35
+ $.extend($.fn, {
36
+ fileTree: function(o, h) {
37
+ // Defaults
38
+ if( !o ) var o = {};
39
+ if( o.root == undefined ) o.root = '/';
40
+ if( o.script == undefined ) o.script = 'jqueryFileTree.php';
41
+ if( o.folderEvent == undefined ) o.folderEvent = 'dblclick';
42
+ if( o.expandSpeed == undefined ) o.expandSpeed= 200;
43
+ if( o.collapseSpeed == undefined ) o.collapseSpeed= 500;
44
+ if( o.expandEasing == undefined ) o.expandEasing = null;
45
+ if( o.collapseEasing == undefined ) o.collapseEasing = null;
46
+ if( o.multiFolder == undefined ) o.multiFolder = true;
47
+ if( o.loadMessage == undefined ) o.loadMessage = 'Loading...';
48
+
49
+ $(this).each( function() {
50
+
51
+ function showTree(c, t) {
52
+ $(c).addClass('wait');
53
+ $(".jqueryFileTree.start").remove();
54
+ $.post(o.script, { dir: t }, function(data) {
55
+ $(c).find('.start').html('');
56
+ $(c).removeClass('wait').append(data);
57
+ if( o.root == t )
58
+ $(c).find('UL:hidden').show();
59
+ else
60
+ $(c).find('UL:hidden').slideDown({ duration: o.expandSpeed, easing: o.expandEasing });
61
+ bindTree(c);
62
+ });
63
+ }
64
+
65
+ function bindTree(t) {
66
+ $(t).find('li a').bind(o.folderEvent, function() {
67
+ if( $(this).parent().hasClass('collapsed') ) {
68
+ // Expand
69
+ if( !o.multiFolder ) {
70
+ $(this).parent().parent().find('ul').slideUp({ duration: o.collapseSpeed, easing: o.collapseEasing });
71
+ $(this).parent().parent().find('li.directory').removeClass('expanded').addClass('collapsed');
72
+ }
73
+ $(this).parent().find('ul').remove(); // cleanup
74
+ showTree( $(this).parent(), escape($(this).attr('rel').match( /.*\// )) );
75
+ $(this).parent().removeClass('collapsed').addClass('expanded');
76
+ } else {
77
+ // Collapse
78
+ $(this).parent().find('ul').slideUp({ duration: o.collapseSpeed, easing: o.collapseEasing });
79
+ $(this).parent().removeClass('expanded').addClass('collapsed');
80
+ }
81
+ return false;
82
+ });
83
+ $(t).find('li a').bind('click', function() {
84
+ h($(this).attr('rel'));
85
+ $(this).parents('#file_browser').find('.active').removeClass('active');
86
+ $(this).parent().addClass('active');
87
+ return false;
88
+ });
89
+ }
90
+ // Loading message
91
+ $(this).html('<ul class="jqueryFileTree start"><li class="wait">' + o.loadMessage + '<li></ul>');
92
+ // Get the initial file list
93
+ showTree( $(this), escape(o.root) );
94
+ });
95
+ }
96
+ });
97
+
98
+ })(jQuery);
admin/js/loader.swf ADDED
Binary file
admin/js/nivo-slider.css ADDED
@@ -0,0 +1,120 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * jQuery Nivo Slider v3.1
3
+ * http://nivo.dev7studios.com
4
+ *
5
+ * Copyright 2012, Dev7studios
6
+ * Free to use and abuse under the MIT license.
7
+ * http://www.opensource.org/licenses/mit-license.php
8
+ */
9
+
10
+ /* The Nivo Slider styles */
11
+ .slider-wrapper { position: relative; clear: both; }
12
+ .nivoSlider {
13
+ position:relative;
14
+ width:100%;
15
+ height:auto;
16
+ overflow: hidden;
17
+ }
18
+ .nivoSlider img {
19
+ position:absolute;
20
+ top:0px;
21
+ left:0px;
22
+ max-width: none;
23
+ }
24
+ .nivo-main-image {
25
+ display: block !important;
26
+ position: relative !important;
27
+ width: 100% !important;
28
+ }
29
+
30
+ /* If an image is wrapped in a link */
31
+ .nivoSlider a.nivo-imageLink {
32
+ position:absolute;
33
+ top:0px;
34
+ left:0px;
35
+ width:100%;
36
+ height:100%;
37
+ border:0;
38
+ padding:0;
39
+ margin:0;
40
+ z-index:6;
41
+ display:none;
42
+ }
43
+ /* The slices and boxes in the Slider */
44
+ .nivo-slice {
45
+ display:block;
46
+ position:absolute;
47
+ z-index:5;
48
+ height:100%;
49
+ top:0;
50
+ }
51
+ .nivo-box {
52
+ display:block;
53
+ position:absolute;
54
+ z-index:5;
55
+ overflow:hidden;
56
+ }
57
+ .nivo-box img { display:block; }
58
+
59
+ /* Caption styles */
60
+ .nivo-caption {
61
+ position:absolute;
62
+ left:0px;
63
+ bottom:0px;
64
+ background:#000;
65
+ color:#fff;
66
+ width:100%;
67
+ z-index:8;
68
+ padding: 5px 10px;
69
+ opacity: 0.8;
70
+ overflow: hidden;
71
+ display: none;
72
+ -moz-opacity: 0.8;
73
+ filter:alpha(opacity=8);
74
+ -webkit-box-sizing: border-box; /* Safari/Chrome, other WebKit */
75
+ -moz-box-sizing: border-box; /* Firefox, other Gecko */
76
+ box-sizing: border-box; /* Opera/IE 8+ */
77
+ }
78
+ .nivo-caption p {
79
+ padding:5px;
80
+ margin:0;
81
+ }
82
+ .nivo-caption a {
83
+ display:inline !important;
84
+ }
85
+ .nivo-html-caption {
86
+ display:none;
87
+ }
88
+ /* Direction nav styles (e.g. Next & Prev) */
89
+ .nivo-directionNav a {
90
+ position:absolute;
91
+ top:45%;
92
+ z-index:9;
93
+ cursor:pointer;
94
+ }
95
+ .nivo-prevNav {
96
+ left:0px;
97
+ }
98
+ .nivo-nextNav {
99
+ right:0px;
100
+ }
101
+ /* Control nav styles (e.g. 1,2,3...) */
102
+ .nivo-controlNav {
103
+ text-align:center;
104
+ padding: 15px 0;
105
+ }
106
+ .nivo-controlNav a {
107
+ cursor:pointer;
108
+ }
109
+ .nivo-controlNav a.active {
110
+ font-weight:bold;
111
+ }
112
+ .grandlovelink { display: none; float: right; background: #000000; color: #ffffff; font-size: 11px; padding: 1px 5px; border: 1px solid #000000; border-top: none;
113
+ border-bottom-left-radius: 4px; border-bottom-right-radius: 4px;
114
+ -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px;
115
+ -webkit-border-bottom-left-radius: 4px; -webkit-border-bottom-right-radius: 4px;
116
+ filter:progid:DXImageTransform.Microsoft.Alpha(opacity=80); /* IE 5.5+*/
117
+ opacity: 0.8; /* CSS3 - Mozilla 1.7b +, Firefox 0.9 +, Safari 1.2+, Opera 9 */
118
+ }
119
+ .grandlovelink a { color: #ffffff; text-decoration: none !important; border: none; background: transparent; }
120
+ .grandlovelink a:hover { color: #ffffff; text-decoration: none !important; border: none; background: transparent; }
admin/js/photoswipe/MIT-license.txt ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ The MIT License
2
+
3
+ Copyright (C) 2011 by Code Computerlove
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE
admin/js/photoswipe/code.photoswipe.jquery-3.0.5.min.js ADDED
@@ -0,0 +1,164 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // PhotoSwipe - http://www.photoswipe.com/
2
+ // Copyright (c) 2012 by Code Computerlove (http://www.codecomputerlove.com)
3
+ // Licensed under the MIT license
4
+ // version: 3.0.5
5
+ (function(e){if(!Function.prototype.bind)Function.prototype.bind=function(d){var a=[].slice,b=a.call(arguments,1),c=this,g=function(){},f=function(){return c.apply(this instanceof g?this:d||{},b.concat(a.call(arguments)))};g.prototype=c.prototype;f.prototype=new g;return f};if(typeof e.Code==="undefined")e.Code={};e.Code.Util={registerNamespace:function(){var d=arguments,a=null,b,c,g,f,i;b=0;for(f=d.length;b<f;b++){g=d[b];g=g.split(".");a=g[0];typeof e[a]==="undefined"&&(e[a]={});a=e[a];c=1;for(i=
6
+ g.length;c<i;++c)a[g[c]]=a[g[c]]||{},a=a[g[c]]}},coalesce:function(){var d,a;d=0;for(a=arguments.length;d<a;d++)if(!this.isNothing(arguments[d]))return arguments[d];return null},extend:function(d,a,b){var c;this.isNothing(b)&&(b=!0);if(d&&a&&this.isObject(a))for(c in a)this.objectHasProperty(a,c)&&(b?d[c]=a[c]:typeof d[c]==="undefined"&&(d[c]=a[c]))},clone:function(d){var a={};this.extend(a,d);return a},isObject:function(d){return d instanceof Object},isFunction:function(d){return{}.toString.call(d)===
7
+ "[object Function]"},isArray:function(d){return d instanceof Array},isLikeArray:function(d){return typeof d.length==="number"},isNumber:function(d){return typeof d==="number"},isString:function(d){return typeof d==="string"},isNothing:function(d){if(typeof d==="undefined"||d===null)return!0;return!1},swapArrayElements:function(d,a,b){var c=d[a];d[a]=d[b];d[b]=c},trim:function(d){return d.replace(/^\s\s*/,"").replace(/\s\s*$/,"")},toCamelCase:function(d){return d.replace(/(\-[a-z])/g,function(a){return a.toUpperCase().replace("-",
8
+ "")})},toDashedCase:function(d){return d.replace(/([A-Z])/g,function(a){return"-"+a.toLowerCase()})},arrayIndexOf:function(d,a,b){var c,g,f,e;f=-1;c=0;for(g=a.length;c<g;c++)if(e=a[c],this.isNothing(b)){if(e===d){f=c;break}}else if(this.objectHasProperty(e,b)&&e[b]===d){f=c;break}return f},objectHasProperty:function(d,a){return d.hasOwnProperty?d.hasOwnProperty(a):"undefined"!==typeof d[a]}}})(window);
9
+ (function(e,d){d.Browser={ua:null,version:null,safari:null,webkit:null,opera:null,msie:null,chrome:null,mozilla:null,android:null,blackberry:null,iPad:null,iPhone:null,iPod:null,iOS:null,is3dSupported:null,isCSSTransformSupported:null,isTouchSupported:null,isGestureSupported:null,_detect:function(){this.ua=e.navigator.userAgent;this.version=this.ua.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[];this.safari=/Safari/gi.test(e.navigator.appVersion);this.webkit=/webkit/i.test(this.ua);this.opera=/opera/i.test(this.ua);
10
+ this.msie=/msie/i.test(this.ua)&&!this.opera;this.chrome=/Chrome/i.test(this.ua);this.firefox=/Firefox/i.test(this.ua);this.fennec=/Fennec/i.test(this.ua);this.mozilla=/mozilla/i.test(this.ua)&&!/(compatible|webkit)/.test(this.ua);this.android=/android/i.test(this.ua);this.blackberry=/blackberry/i.test(this.ua);this.iOS=/iphone|ipod|ipad/gi.test(e.navigator.platform);this.iPad=/ipad/gi.test(e.navigator.platform);this.iPhone=/iphone/gi.test(e.navigator.platform);this.iPod=/ipod/gi.test(e.navigator.platform);
11
+ var a=document.createElement("div");this.is3dSupported=!d.isNothing(a.style.WebkitPerspective);this.isCSSTransformSupported=!d.isNothing(a.style.WebkitTransform)||!d.isNothing(a.style.MozTransform)||!d.isNothing(a.style.transformProperty);this.isTouchSupported=this.isEventSupported("touchstart");this.isGestureSupported=this.isEventSupported("gesturestart")},_eventTagNames:{select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"},isEventSupported:function(a){var b=
12
+ document.createElement(this._eventTagNames[a]||"div"),c,a="on"+a;c=d.objectHasProperty(b,a);c||(b.setAttribute(a,"return;"),c=typeof b[a]==="function");return c},isLandscape:function(){return d.DOM.windowWidth()>d.DOM.windowHeight()}};d.Browser._detect()})(window,window.Code.Util);
13
+ (function(e,d,a){a.extend(a,{Events:{add:function(a,c,g){d(a).bind(c,g)},remove:function(a,c,g){d(a).unbind(c,g)},fire:function(a,c){var g,f=Array.prototype.slice.call(arguments).splice(2);g=typeof c==="string"?{type:c}:c;d(a).trigger(d.Event(g.type,g),f)},getMousePosition:function(a){return{x:a.pageX,y:a.pageY}},getTouchEvent:function(a){return a.originalEvent},getWheelDelta:function(b){var c=0;a.isNothing(b.wheelDelta)?a.isNothing(b.detail)||(c=-b.detail/3):c=b.wheelDelta/120;return c},domReady:function(a){d(document).ready(a)}}})})(window,
14
+ window.jQuery,window.Code.Util);
15
+ (function(e,d,a){a.extend(a,{DOM:{setData:function(b,c,g){if(a.isLikeArray(b)){var f,d;f=0;for(d=b.length;f<d;f++)a.DOM._setData(b[f],c,g)}else a.DOM._setData(b,c,g)},_setData:function(b,c,g){a.DOM.setAttribute(b,"data-"+c,g)},getData:function(b,c,g){return a.DOM.getAttribute(b,"data-"+c,g)},removeData:function(b,c){if(a.isLikeArray(b)){var g,f;g=0;for(f=b.length;g<f;g++)a.DOM._removeData(b[g],c)}else a.DOM._removeData(b,c)},_removeData:function(b,c){a.DOM.removeAttribute(b,"data-"+c)},isChildOf:function(a,
16
+ c){if(c===a)return!1;for(;a&&a!==c;)a=a.parentNode;return a===c},find:function(b,c){if(a.isNothing(c))c=e.document;var g=d(b,c),f=[],i,j;i=0;for(j=g.length;i<j;i++)f.push(g[i]);return f},createElement:function(a,c,g){a=d("<"+a+"></"+a+">");a.attr(c);a.append(g);return a[0]},appendChild:function(a,c){d(c).append(a)},insertBefore:function(a,c){d(a).insertBefore(c)},appendText:function(a,c){d(c).text(a)},appendToBody:function(a){d("body").append(a)},removeChild:function(a){d(a).empty().remove()},removeChildren:function(a){d(a).empty()},
17
+ hasAttribute:function(b,c){return!a.isNothing(d(b).attr(c))},getAttribute:function(b,c,g){b=d(b).attr(c);a.isNothing(b)&&!a.isNothing(g)&&(b=g);return b},setAttribute:function(b,c,g){if(a.isLikeArray(b)){var f,d;f=0;for(d=b.length;f<d;f++)a.DOM._setAttribute(b[f],c,g)}else a.DOM._setAttribute(b,c,g)},_setAttribute:function(a,c,g){d(a).attr(c,g)},removeAttribute:function(b,c){if(a.isLikeArray(b)){var g,f;g=0;for(f=b.length;g<f;g++)a.DOM._removeAttribute(b[g],c)}else a.DOM._removeAttribute(b,c)},_removeAttribute:function(a,
18
+ c){d(a).removeAttr(c)},addClass:function(b,c){if(a.isLikeArray(b)){var g,f;g=0;for(f=b.length;g<f;g++)a.DOM._addClass(b[g],c)}else a.DOM._addClass(b,c)},_addClass:function(a,c){d(a).addClass(c)},removeClass:function(b,c){if(a.isLikeArray(b)){var g,f;g=0;for(f=b.length;g<f;g++)a.DOM._removeClass(b[g],c)}else a.DOM._removeClass(b,c)},_removeClass:function(a,c){d(a).removeClass(c)},hasClass:function(a,c){d(a).hasClass(c)},setStyle:function(b,c,g){if(a.isLikeArray(b)){var f,d;f=0;for(d=b.length;f<d;f++)a.DOM._setStyle(b[f],
19
+ c,g)}else a.DOM._setStyle(b,c,g)},_setStyle:function(b,c,g){var f;if(a.isObject(c))for(f in c)a.objectHasProperty(c,f)&&(f==="width"?a.DOM.width(b,c[f]):f==="height"?a.DOM.height(b,c[f]):d(b).css(f,c[f]));else d(b).css(c,g)},getStyle:function(a,c){return d(a).css(c)},hide:function(b){if(a.isLikeArray(b)){var c,g;c=0;for(g=b.length;c<g;c++)a.DOM._hide(b[c])}else a.DOM._hide(b)},_hide:function(a){d(a).hide()},show:function(b){if(a.isLikeArray(b)){var c,g;c=0;for(g=b.length;c<g;c++)a.DOM._show(b[c])}else a.DOM._show(b)},
20
+ _show:function(a){d(a).show()},width:function(b,c){a.isNothing(c)||d(b).width(c);return d(b).width()},outerWidth:function(a){return d(a).outerWidth()},height:function(b,c){a.isNothing(c)||d(b).height(c);return d(b).height()},outerHeight:function(a){return d(a).outerHeight()},documentWidth:function(){return d(document.documentElement).width()},documentHeight:function(){return d(document.documentElement).height()},documentOuterWidth:function(){return a.DOM.width(document.documentElement)},documentOuterHeight:function(){return a.DOM.outerHeight(document.documentElement)},
21
+ bodyWidth:function(){return d(document.body).width()},bodyHeight:function(){return d(document.body).height()},bodyOuterWidth:function(){return a.DOM.outerWidth(document.body)},bodyOuterHeight:function(){return a.DOM.outerHeight(document.body)},windowWidth:function(){if(!e.innerWidth)return d(e).width();return e.innerWidth},windowHeight:function(){if(!e.innerHeight)return d(e).height();return e.innerHeight},windowScrollLeft:function(){if(!e.pageXOffset)return d(e).scrollLeft();return e.pageXOffset},
22
+ windowScrollTop:function(){if(!e.pageYOffset)return d(e).scrollTop();return e.pageYOffset}}})})(window,window.jQuery,window.Code.Util);
23
+ (function(e,d){d.extend(d,{Animation:{_applyTransitionDelay:50,_transitionEndLabel:e.document.documentElement.style.webkitTransition!==void 0?"webkitTransitionEnd":"transitionend",_transitionEndHandler:null,_transitionPrefix:e.document.documentElement.style.webkitTransition!==void 0?"webkitTransition":e.document.documentElement.style.MozTransition!==void 0?"MozTransition":"transition",_transformLabel:e.document.documentElement.style.webkitTransform!==void 0?"webkitTransform":e.document.documentElement.style.MozTransition!==
24
+ void 0?"MozTransform":"transform",_getTransitionEndHandler:function(){if(d.isNothing(this._transitionEndHandler))this._transitionEndHandler=this._onTransitionEnd.bind(this);return this._transitionEndHandler},stop:function(a){if(d.Browser.isCSSTransformSupported){var b={};d.Events.remove(a,this._transitionEndLabel,this._getTransitionEndHandler());d.isNothing(a.callbackLabel)&&delete a.callbackLabel;b[this._transitionPrefix+"Property"]="";b[this._transitionPrefix+"Duration"]="";b[this._transitionPrefix+
25
+ "TimingFunction"]="";b[this._transitionPrefix+"Delay"]="";b[this._transformLabel]="";d.DOM.setStyle(a,b)}else d.isNothing(e.jQuery)||e.jQuery(a).stop(!0,!0)},fadeIn:function(a,b,c,g,f){f=d.coalesce(f,1);f<=0&&(f=1);if(b<=0&&(d.DOM.setStyle(a,"opacity",f),!d.isNothing(c))){c(a);return}d.DOM.getStyle(a,"opacity")>=1&&d.DOM.setStyle(a,"opacity",0);d.Browser.isCSSTransformSupported?this._applyTransition(a,"opacity",f,b,c,g):d.isNothing(e.jQuery)||e.jQuery(a).fadeTo(b,f,c)},fadeTo:function(a,b,c,g,f){this.fadeIn(a,
26
+ c,g,f,b)},fadeOut:function(a,b,c,g){if(b<=0&&(d.DOM.setStyle(a,"opacity",0),!d.isNothing(c))){c(a);return}d.Browser.isCSSTransformSupported?this._applyTransition(a,"opacity",0,b,c,g):e.jQuery(a).fadeTo(b,0,c)},slideBy:function(a,b,c,g,f,i){var j={},b=d.coalesce(b,0),c=d.coalesce(c,0),i=d.coalesce(i,"ease-out");j[this._transitionPrefix+"Property"]="all";j[this._transitionPrefix+"Delay"]="0";g===0?(j[this._transitionPrefix+"Duration"]="",j[this._transitionPrefix+"TimingFunction"]=""):(j[this._transitionPrefix+
27
+ "Duration"]=g+"ms",j[this._transitionPrefix+"TimingFunction"]=d.coalesce(i,"ease-out"),d.Events.add(a,this._transitionEndLabel,this._getTransitionEndHandler()));j[this._transformLabel]=d.Browser.is3dSupported?"translate3d("+b+"px, "+c+"px, 0px)":"translate("+b+"px, "+c+"px)";if(!d.isNothing(f))a.cclallcallback=f;d.DOM.setStyle(a,j);g===0&&e.setTimeout(function(){this._leaveTransforms(a)}.bind(this),this._applyTransitionDelay)},resetTranslate:function(a){var b={};b[this._transformLabel]=b[this._transformLabel]=
28
+ d.Browser.is3dSupported?"translate3d(0px, 0px, 0px)":"translate(0px, 0px)";d.DOM.setStyle(a,b)},_applyTransition:function(a,b,c,g,f,i){var j={},i=d.coalesce(i,"ease-in");j[this._transitionPrefix+"Property"]=b;j[this._transitionPrefix+"Duration"]=g+"ms";j[this._transitionPrefix+"TimingFunction"]=i;j[this._transitionPrefix+"Delay"]="0";d.Events.add(a,this._transitionEndLabel,this._getTransitionEndHandler());d.DOM.setStyle(a,j);d.isNothing(f)||(a["ccl"+b+"callback"]=f);e.setTimeout(function(){d.DOM.setStyle(a,
29
+ b,c)},this._applyTransitionDelay)},_onTransitionEnd:function(a){d.Events.remove(a.currentTarget,this._transitionEndLabel,this._getTransitionEndHandler());this._leaveTransforms(a.currentTarget)},_leaveTransforms:function(a){var b=a.style[this._transitionPrefix+"Property"],c=b!==""?"ccl"+b+"callback":"cclallcallback",g,b=d.coalesce(a.style.webkitTransform,a.style.MozTransform,a.style.transform),f,i=e.parseInt(d.DOM.getStyle(a,"left"),0),j=e.parseInt(d.DOM.getStyle(a,"top"),0),h,l,k={};b!==""&&(b=d.Browser.is3dSupported?
30
+ b.match(/translate3d\((.*?)\)/):b.match(/translate\((.*?)\)/),d.isNothing(b)||(f=b[1].split(", "),h=e.parseInt(f[0],0),l=e.parseInt(f[1],0)));k[this._transitionPrefix+"Property"]="";k[this._transitionPrefix+"Duration"]="";k[this._transitionPrefix+"TimingFunction"]="";k[this._transitionPrefix+"Delay"]="";d.DOM.setStyle(a,k);e.setTimeout(function(){if(!d.isNothing(f))k={},k[this._transformLabel]="",k.left=i+h+"px",k.top=j+l+"px",d.DOM.setStyle(a,k);d.isNothing(a[c])||(g=a[c],delete a[c],g(a))}.bind(this),
31
+ this._applyTransitionDelay)}}})})(window,window.Code.Util);
32
+ (function(e,d,a){a.registerNamespace("Code.Util.TouchElement");a.TouchElement.EventTypes={onTouch:"CodeUtilTouchElementOnTouch"};a.TouchElement.ActionTypes={touchStart:"touchStart",touchMove:"touchMove",touchEnd:"touchEnd",touchMoveEnd:"touchMoveEnd",tap:"tap",doubleTap:"doubleTap",swipeLeft:"swipeLeft",swipeRight:"swipeRight",swipeUp:"swipeUp",swipeDown:"swipeDown",gestureStart:"gestureStart",gestureChange:"gestureChange",gestureEnd:"gestureEnd"}})(window,window.klass,window.Code.Util);
33
+ (function(e,d,a){a.registerNamespace("Code.Util.TouchElement");a.TouchElement.TouchElementClass=d({el:null,captureSettings:null,touchStartPoint:null,touchEndPoint:null,touchStartTime:null,doubleTapTimeout:null,touchStartHandler:null,touchMoveHandler:null,touchEndHandler:null,mouseDownHandler:null,mouseMoveHandler:null,mouseUpHandler:null,mouseOutHandler:null,gestureStartHandler:null,gestureChangeHandler:null,gestureEndHandler:null,swipeThreshold:null,swipeTimeThreshold:null,doubleTapSpeed:null,dispose:function(){var b;
34
+ this.removeEventHandlers();for(b in this)a.objectHasProperty(this,b)&&(this[b]=null)},initialize:function(b,c){this.el=b;this.captureSettings={swipe:!1,move:!1,gesture:!1,doubleTap:!1,preventDefaultTouchEvents:!0};a.extend(this.captureSettings,c);this.swipeThreshold=50;this.doubleTapSpeed=this.swipeTimeThreshold=250;this.touchStartPoint={x:0,y:0};this.touchEndPoint={x:0,y:0}},addEventHandlers:function(){if(a.isNothing(this.touchStartHandler))this.touchStartHandler=this.onTouchStart.bind(this),this.touchMoveHandler=
35
+ this.onTouchMove.bind(this),this.touchEndHandler=this.onTouchEnd.bind(this),this.mouseDownHandler=this.onMouseDown.bind(this),this.mouseMoveHandler=this.onMouseMove.bind(this),this.mouseUpHandler=this.onMouseUp.bind(this),this.mouseOutHandler=this.onMouseOut.bind(this),this.gestureStartHandler=this.onGestureStart.bind(this),this.gestureChangeHandler=this.onGestureChange.bind(this),this.gestureEndHandler=this.onGestureEnd.bind(this);a.Events.add(this.el,"touchstart",this.touchStartHandler);this.captureSettings.move&&
36
+ a.Events.add(this.el,"touchmove",this.touchMoveHandler);a.Events.add(this.el,"touchend",this.touchEndHandler);a.Events.add(this.el,"mousedown",this.mouseDownHandler);a.Browser.isGestureSupported&&this.captureSettings.gesture&&(a.Events.add(this.el,"gesturestart",this.gestureStartHandler),a.Events.add(this.el,"gesturechange",this.gestureChangeHandler),a.Events.add(this.el,"gestureend",this.gestureEndHandler))},removeEventHandlers:function(){a.Events.remove(this.el,"touchstart",this.touchStartHandler);
37
+ this.captureSettings.move&&a.Events.remove(this.el,"touchmove",this.touchMoveHandler);a.Events.remove(this.el,"touchend",this.touchEndHandler);a.Events.remove(this.el,"mousedown",this.mouseDownHandler);a.Browser.isGestureSupported&&this.captureSettings.gesture&&(a.Events.remove(this.el,"gesturestart",this.gestureStartHandler),a.Events.remove(this.el,"gesturechange",this.gestureChangeHandler),a.Events.remove(this.el,"gestureend",this.gestureEndHandler))},getTouchPoint:function(a){return{x:a[0].pageX,
38
+ y:a[0].pageY}},fireTouchEvent:function(b){var c=0,g=0,f=0,d,c=this.touchEndPoint.x-this.touchStartPoint.x,g=this.touchEndPoint.y-this.touchStartPoint.y,f=Math.sqrt(c*c+g*g);if(this.captureSettings.swipe&&(d=new Date,d-=this.touchStartTime,d<=this.swipeTimeThreshold)){if(e.Math.abs(c)>=this.swipeThreshold){a.Events.fire(this,{type:a.TouchElement.EventTypes.onTouch,target:this,point:this.touchEndPoint,action:c<0?a.TouchElement.ActionTypes.swipeLeft:a.TouchElement.ActionTypes.swipeRight,targetEl:b.target,
39
+ currentTargetEl:b.currentTarget});return}if(e.Math.abs(g)>=this.swipeThreshold){a.Events.fire(this,{type:a.TouchElement.EventTypes.onTouch,target:this,point:this.touchEndPoint,action:g<0?a.TouchElement.ActionTypes.swipeUp:a.TouchElement.ActionTypes.swipeDown,targetEl:b.target,currentTargetEl:b.currentTarget});return}}f>1?a.Events.fire(this,{type:a.TouchElement.EventTypes.onTouch,target:this,action:a.TouchElement.ActionTypes.touchMoveEnd,point:this.touchEndPoint,targetEl:b.target,currentTargetEl:b.currentTarget}):
40
+ this.captureSettings.doubleTap?a.isNothing(this.doubleTapTimeout)?this.doubleTapTimeout=e.setTimeout(function(){this.doubleTapTimeout=null;a.Events.fire(this,{type:a.TouchElement.EventTypes.onTouch,target:this,point:this.touchEndPoint,action:a.TouchElement.ActionTypes.tap,targetEl:b.target,currentTargetEl:b.currentTarget})}.bind(this),this.doubleTapSpeed):(e.clearTimeout(this.doubleTapTimeout),this.doubleTapTimeout=null,a.Events.fire(this,{type:a.TouchElement.EventTypes.onTouch,target:this,point:this.touchEndPoint,
41
+ action:a.TouchElement.ActionTypes.doubleTap,targetEl:b.target,currentTargetEl:b.currentTarget})):a.Events.fire(this,{type:a.TouchElement.EventTypes.onTouch,target:this,point:this.touchEndPoint,action:a.TouchElement.ActionTypes.tap,targetEl:b.target,currentTargetEl:b.currentTarget})},onTouchStart:function(b){this.captureSettings.preventDefaultTouchEvents&&b.preventDefault();a.Events.remove(this.el,"mousedown",this.mouseDownHandler);var c=a.Events.getTouchEvent(b).touches;c.length>1&&this.captureSettings.gesture?
42
+ this.isGesture=!0:(this.touchStartTime=new Date,this.isGesture=!1,this.touchStartPoint=this.getTouchPoint(c),a.Events.fire(this,{type:a.TouchElement.EventTypes.onTouch,target:this,action:a.TouchElement.ActionTypes.touchStart,point:this.touchStartPoint,targetEl:b.target,currentTargetEl:b.currentTarget}))},onTouchMove:function(b){this.captureSettings.preventDefaultTouchEvents&&b.preventDefault();if(!this.isGesture||!this.captureSettings.gesture){var c=a.Events.getTouchEvent(b).touches;a.Events.fire(this,
43
+ {type:a.TouchElement.EventTypes.onTouch,target:this,action:a.TouchElement.ActionTypes.touchMove,point:this.getTouchPoint(c),targetEl:b.target,currentTargetEl:b.currentTarget})}},onTouchEnd:function(b){if(!this.isGesture||!this.captureSettings.gesture){this.captureSettings.preventDefaultTouchEvents&&b.preventDefault();var c=a.Events.getTouchEvent(b);this.touchEndPoint=this.getTouchPoint(!a.isNothing(c.changedTouches)?c.changedTouches:c.touches);a.Events.fire(this,{type:a.TouchElement.EventTypes.onTouch,
44
+ target:this,action:a.TouchElement.ActionTypes.touchEnd,point:this.touchEndPoint,targetEl:b.target,currentTargetEl:b.currentTarget});this.fireTouchEvent(b)}},onMouseDown:function(b){b.preventDefault();a.Events.remove(this.el,"touchstart",this.mouseDownHandler);a.Events.remove(this.el,"touchmove",this.touchMoveHandler);a.Events.remove(this.el,"touchend",this.touchEndHandler);this.captureSettings.move&&a.Events.add(this.el,"mousemove",this.mouseMoveHandler);a.Events.add(this.el,"mouseup",this.mouseUpHandler);
45
+ a.Events.add(this.el,"mouseout",this.mouseOutHandler);this.touchStartTime=new Date;this.isGesture=!1;this.touchStartPoint=a.Events.getMousePosition(b);a.Events.fire(this,{type:a.TouchElement.EventTypes.onTouch,target:this,action:a.TouchElement.ActionTypes.touchStart,point:this.touchStartPoint,targetEl:b.target,currentTargetEl:b.currentTarget})},onMouseMove:function(b){b.preventDefault();a.Events.fire(this,{type:a.TouchElement.EventTypes.onTouch,target:this,action:a.TouchElement.ActionTypes.touchMove,
46
+ point:a.Events.getMousePosition(b),targetEl:b.target,currentTargetEl:b.currentTarget})},onMouseUp:function(b){b.preventDefault();this.captureSettings.move&&a.Events.remove(this.el,"mousemove",this.mouseMoveHandler);a.Events.remove(this.el,"mouseup",this.mouseUpHandler);a.Events.remove(this.el,"mouseout",this.mouseOutHandler);this.touchEndPoint=a.Events.getMousePosition(b);a.Events.fire(this,{type:a.TouchElement.EventTypes.onTouch,target:this,action:a.TouchElement.ActionTypes.touchEnd,point:this.touchEndPoint,
47
+ targetEl:b.target,currentTargetEl:b.currentTarget});this.fireTouchEvent(b)},onMouseOut:function(b){var c=b.relatedTarget;if(!(this.el===c||a.DOM.isChildOf(c,this.el)))b.preventDefault(),this.captureSettings.move&&a.Events.remove(this.el,"mousemove",this.mouseMoveHandler),a.Events.remove(this.el,"mouseup",this.mouseUpHandler),a.Events.remove(this.el,"mouseout",this.mouseOutHandler),this.touchEndPoint=a.Events.getMousePosition(b),a.Events.fire(this,{type:a.TouchElement.EventTypes.onTouch,target:this,
48
+ action:a.TouchElement.ActionTypes.touchEnd,point:this.touchEndPoint,targetEl:b.target,currentTargetEl:b.currentTarget}),this.fireTouchEvent(b)},onGestureStart:function(b){b.preventDefault();var c=a.Events.getTouchEvent(b);a.Events.fire(this,{type:a.TouchElement.EventTypes.onTouch,target:this,action:a.TouchElement.ActionTypes.gestureStart,scale:c.scale,rotation:c.rotation,targetEl:b.target,currentTargetEl:b.currentTarget})},onGestureChange:function(b){b.preventDefault();var c=a.Events.getTouchEvent(b);
49
+ a.Events.fire(this,{type:a.TouchElement.EventTypes.onTouch,target:this,action:a.TouchElement.ActionTypes.gestureChange,scale:c.scale,rotation:c.rotation,targetEl:b.target,currentTargetEl:b.currentTarget})},onGestureEnd:function(b){b.preventDefault();var c=a.Events.getTouchEvent(b);a.Events.fire(this,{type:a.TouchElement.EventTypes.onTouch,target:this,action:a.TouchElement.ActionTypes.gestureEnd,scale:c.scale,rotation:c.rotation,targetEl:b.target,currentTargetEl:b.currentTarget})}})})(window,window.klass,
50
+ window.Code.Util);(function(e,d,a){a.registerNamespace("Code.PhotoSwipe.Image");e.Code.PhotoSwipe.Image.EventTypes={onLoad:"onLoad",onError:"onError"}})(window,window.klass,window.Code.Util);
51
+ (function(e,d,a){a.registerNamespace("Code.PhotoSwipe.Image");var b=e.Code.PhotoSwipe;b.Image.ImageClass=d({refObj:null,imageEl:null,src:null,caption:null,metaData:null,imageLoadHandler:null,imageErrorHandler:null,dispose:function(){var c;this.shrinkImage();for(c in this)a.objectHasProperty(this,c)&&(this[c]=null)},initialize:function(a,b,f,d){this.refObj=a;this.src=this.originalSrc=b;this.caption=f;this.metaData=d;this.imageEl=new e.Image;this.imageLoadHandler=this.onImageLoad.bind(this);this.imageErrorHandler=
52
+ this.onImageError.bind(this)},load:function(){this.imageEl.originalSrc=a.coalesce(this.imageEl.originalSrc,"");this.imageEl.originalSrc===this.src?this.imageEl.isError?a.Events.fire(this,{type:b.Image.EventTypes.onError,target:this}):a.Events.fire(this,{type:b.Image.EventTypes.onLoad,target:this}):(this.imageEl.isError=!1,this.imageEl.isLoading=!0,this.imageEl.naturalWidth=null,this.imageEl.naturalHeight=null,this.imageEl.isLandscape=!1,this.imageEl.onload=this.imageLoadHandler,this.imageEl.onerror=
53
+ this.imageErrorHandler,this.imageEl.onabort=this.imageErrorHandler,this.imageEl.originalSrc=this.src,this.imageEl.src=this.src)},shrinkImage:function(){if(!a.isNothing(this.imageEl)&&this.imageEl.src.indexOf(this.src)>-1)this.imageEl.src="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=",a.isNothing(this.imageEl.parentNode)||a.DOM.removeChild(this.imageEl,this.imageEl.parentNode)},onImageLoad:function(){this.imageEl.onload=null;this.imageEl.naturalWidth=a.coalesce(this.imageEl.naturalWidth,
54
+ this.imageEl.width);this.imageEl.naturalHeight=a.coalesce(this.imageEl.naturalHeight,this.imageEl.height);this.imageEl.isLandscape=this.imageEl.naturalWidth>this.imageEl.naturalHeight;this.imageEl.isLoading=!1;a.Events.fire(this,{type:b.Image.EventTypes.onLoad,target:this})},onImageError:function(){this.imageEl.onload=null;this.imageEl.onerror=null;this.imageEl.onabort=null;this.imageEl.isLoading=!1;this.imageEl.isError=!0;a.Events.fire(this,{type:b.Image.EventTypes.onError,target:this})}})})(window,
55
+ window.klass,window.Code.Util);
56
+ (function(e,d,a){a.registerNamespace("Code.PhotoSwipe.Cache");e=e.Code.PhotoSwipe;e.Cache.Mode={normal:"normal",aggressive:"aggressive"};e.Cache.Functions={getImageSource:function(a){return a.href},getImageCaption:function(b){if(b.nodeName==="IMG")return a.DOM.getAttribute(b,"alt");var c,g,f;c=0;for(g=b.childNodes.length;c<g;c++)if(f=b.childNodes[c],b.childNodes[c].nodeName==="IMG")return a.DOM.getAttribute(f,"alt")},getImageMetaData:function(){return{}}}})(window,window.klass,window.Code.Util);
57
+ (function(e,d,a){a.registerNamespace("Code.PhotoSwipe.Cache");var b=e.Code.PhotoSwipe;b.Cache.CacheClass=d({images:null,settings:null,dispose:function(){var c,b,f;if(!a.isNothing(this.images)){b=0;for(f=this.images.length;b<f;b++)this.images[b].dispose();this.images.length=0}for(c in this)a.objectHasProperty(this,c)&&(this[c]=null)},initialize:function(a,g){var f,d,e,h,l,k;this.settings=g;this.images=[];f=0;for(d=a.length;f<d;f++)e=a[f],h=this.settings.getImageSource(e),l=this.settings.getImageCaption(e),
58
+ k=this.settings.getImageMetaData(e),this.images.push(new b.Image.ImageClass(e,h,l,k))},getImages:function(c){var g,f,d=[],e;g=0;for(f=c.length;g<f;g++){e=this.images[c[g]];if(this.settings.cacheMode===b.Cache.Mode.aggressive)e.cacheDoNotShrink=!0;d.push(e)}if(this.settings.cacheMode===b.Cache.Mode.aggressive){g=0;for(f=this.images.length;g<f;g++)e=this.images[g],a.objectHasProperty(e,"cacheDoNotShrink")?delete e.cacheDoNotShrink:e.shrinkImage()}return d}})})(window,window.klass,window.Code.Util,window.Code.PhotoSwipe.Image);
59
+ (function(e,d,a){a.registerNamespace("Code.PhotoSwipe.DocumentOverlay");e.Code.PhotoSwipe.DocumentOverlay.CssClasses={documentOverlay:"ps-document-overlay"}})(window,window.klass,window.Code.Util);
60
+ (function(e,d,a){a.registerNamespace("Code.PhotoSwipe.DocumentOverlay");var b=e.Code.PhotoSwipe;b.DocumentOverlay.DocumentOverlayClass=d({el:null,settings:null,initialBodyHeight:null,dispose:function(){var c;a.Animation.stop(this.el);a.DOM.removeChild(this.el,this.el.parentNode);for(c in this)a.objectHasProperty(this,c)&&(this[c]=null)},initialize:function(c){this.settings=c;this.el=a.DOM.createElement("div",{"class":b.DocumentOverlay.CssClasses.documentOverlay},"");a.DOM.setStyle(this.el,{display:"block",
61
+ position:"absolute",left:0,top:0,zIndex:this.settings.zIndex});a.DOM.hide(this.el);this.settings.target===e?a.DOM.appendToBody(this.el):a.DOM.appendChild(this.el,this.settings.target);a.Animation.resetTranslate(this.el);this.initialBodyHeight=a.DOM.bodyOuterHeight()},resetPosition:function(){var c,b,f;if(this.settings.target===e){c=a.DOM.windowWidth();b=a.DOM.bodyOuterHeight()*2;f=this.settings.jQueryMobile?a.DOM.windowScrollTop()+"px":"0px";if(b<1)b=this.initialBodyHeight;a.DOM.windowHeight()>b&&
62
+ (b=a.DOM.windowHeight())}else c=a.DOM.width(this.settings.target),b=a.DOM.height(this.settings.target),f="0px";a.DOM.setStyle(this.el,{width:c,height:b,top:f})},fadeIn:function(c,b){this.resetPosition();a.DOM.setStyle(this.el,"opacity",0);a.DOM.show(this.el);a.Animation.fadeIn(this.el,c,b)}})})(window,window.klass,window.Code.Util);
63
+ (function(e,d,a){a.registerNamespace("Code.PhotoSwipe.Carousel");e=e.Code.PhotoSwipe;e.Carousel.EventTypes={onSlideByEnd:"PhotoSwipeCarouselOnSlideByEnd",onSlideshowStart:"PhotoSwipeCarouselOnSlideshowStart",onSlideshowStop:"PhotoSwipeCarouselOnSlideshowStop"};e.Carousel.CssClasses={carousel:"ps-carousel",content:"ps-carousel-content",item:"ps-carousel-item",itemLoading:"ps-carousel-item-loading",itemError:"ps-carousel-item-error"};e.Carousel.SlideByAction={previous:"previous",current:"current",next:"next"}})(window,
64
+ window.klass,window.Code.Util);
65
+ (function(e,d,a){a.registerNamespace("Code.PhotoSwipe.Carousel");var b=e.Code.PhotoSwipe;b.Carousel.CarouselClass=d({el:null,contentEl:null,settings:null,cache:null,slideByEndHandler:null,currentCacheIndex:null,isSliding:null,isSlideshowActive:null,lastSlideByAction:null,touchStartPoint:null,touchStartPosition:null,imageLoadHandler:null,imageErrorHandler:null,slideshowTimeout:null,dispose:function(){var c,g,f;g=0;for(f=this.cache.images.length;g<f;g++)a.Events.remove(this.cache.images[g],b.Image.EventTypes.onLoad,
66
+ this.imageLoadHandler),a.Events.remove(this.cache.images[g],b.Image.EventTypes.onError,this.imageErrorHandler);this.stopSlideshow();a.Animation.stop(this.el);a.DOM.removeChild(this.el,this.el.parentNode);for(c in this)a.objectHasProperty(this,c)&&(this[c]=null)},initialize:function(c,g){var f,d,j;this.cache=c;this.settings=g;this.slideByEndHandler=this.onSlideByEnd.bind(this);this.imageLoadHandler=this.onImageLoad.bind(this);this.imageErrorHandler=this.onImageError.bind(this);this.currentCacheIndex=
67
+ 0;this.isSlideshowActive=this.isSliding=!1;if(this.cache.images.length<3)this.settings.loop=!1;this.el=a.DOM.createElement("div",{"class":b.Carousel.CssClasses.carousel},"");a.DOM.setStyle(this.el,{display:"block",position:"absolute",left:0,top:0,overflow:"hidden",zIndex:this.settings.zIndex});a.DOM.hide(this.el);this.contentEl=a.DOM.createElement("div",{"class":b.Carousel.CssClasses.content},"");a.DOM.setStyle(this.contentEl,{display:"block",position:"absolute",left:0,top:0});a.DOM.appendChild(this.contentEl,
68
+ this.el);d=c.images.length<3?c.images.length:3;for(f=0;f<d;f++)j=a.DOM.createElement("div",{"class":b.Carousel.CssClasses.item+" "+b.Carousel.CssClasses.item+"-"+f},""),a.DOM.setAttribute(j,"style","float: left;"),a.DOM.setStyle(j,{display:"block",position:"relative",left:0,top:0,overflow:"hidden"}),this.settings.margin>0&&a.DOM.setStyle(j,{marginRight:this.settings.margin+"px"}),a.DOM.appendChild(j,this.contentEl);this.settings.target===e?a.DOM.appendToBody(this.el):a.DOM.appendChild(this.el,this.settings.target)},
69
+ resetPosition:function(){var c,g,f,d,j,h;this.settings.target===e?(c=a.DOM.windowWidth(),g=a.DOM.windowHeight(),f=a.DOM.windowScrollTop()+"px"):(c=a.DOM.width(this.settings.target),g=a.DOM.height(this.settings.target),f="0px");d=this.settings.margin>0?c+this.settings.margin:c;j=a.DOM.find("."+b.Carousel.CssClasses.item,this.contentEl);d*=j.length;a.DOM.setStyle(this.el,{top:f,width:c,height:g});a.DOM.setStyle(this.contentEl,{width:d,height:g});f=0;for(d=j.length;f<d;f++)h=j[f],a.DOM.setStyle(h,{width:c,
70
+ height:g}),h=a.DOM.find("img",h)[0],a.isNothing(h)||this.resetImagePosition(h);this.setContentLeftPosition()},resetImagePosition:function(c){if(!a.isNothing(c)){a.DOM.getAttribute(c,"src");var b,f,d,e=a.DOM.width(this.el),h=a.DOM.height(this.el);this.settings.imageScaleMethod==="fitNoUpscale"?(f=c.naturalWidth,d=c.naturalHeight,f>e&&(b=e/f,f=Math.round(f*b),d=Math.round(d*b)),d>h&&(b=h/d,d=Math.round(d*b),f=Math.round(f*b))):(b=c.isLandscape?e/c.naturalWidth:h/c.naturalHeight,f=Math.round(c.naturalWidth*
71
+ b),d=Math.round(c.naturalHeight*b),this.settings.imageScaleMethod==="zoom"?(b=1,d<h?b=h/d:f<e&&(b=e/f),b!==1&&(f=Math.round(f*b),d=Math.round(d*b))):this.settings.imageScaleMethod==="fit"&&(b=1,f>e?b=e/f:d>h&&(b=h/d),b!==1&&(f=Math.round(f*b),d=Math.round(d*b))));a.DOM.setStyle(c,{position:"absolute",width:f,height:d,top:Math.round((h-d)/2)+"px",left:Math.round((e-f)/2)+"px",display:"block"})}},setContentLeftPosition:function(){var c,b,d;c=this.settings.target===e?a.DOM.windowWidth():a.DOM.width(this.settings.target);
72
+ b=this.getItemEls();d=0;this.settings.loop?d=(c+this.settings.margin)*-1:this.currentCacheIndex===this.cache.images.length-1?d=(b.length-1)*(c+this.settings.margin)*-1:this.currentCacheIndex>0&&(d=(c+this.settings.margin)*-1);a.DOM.setStyle(this.contentEl,{left:d+"px"})},show:function(c){this.currentCacheIndex=c;this.resetPosition();this.setImages(!1);a.DOM.show(this.el);a.Animation.resetTranslate(this.contentEl);var c=this.getItemEls(),d,f;d=0;for(f=c.length;d<f;d++)a.Animation.resetTranslate(c[d]);
73
+ a.Events.fire(this,{type:b.Carousel.EventTypes.onSlideByEnd,target:this,action:b.Carousel.SlideByAction.current,cacheIndex:this.currentCacheIndex})},setImages:function(a){var b,d=this.getItemEls();b=this.currentCacheIndex+1;var e=this.currentCacheIndex-1;this.settings.loop?(b>this.cache.images.length-1&&(b=0),e<0&&(e=this.cache.images.length-1),b=this.cache.getImages([e,this.currentCacheIndex,b]),a||this.addCacheImageToItemEl(b[1],d[1]),this.addCacheImageToItemEl(b[2],d[2]),this.addCacheImageToItemEl(b[0],
74
+ d[0])):d.length===1?a||(b=this.cache.getImages([this.currentCacheIndex]),this.addCacheImageToItemEl(b[0],d[0])):d.length===2?this.currentCacheIndex===0?(b=this.cache.getImages([this.currentCacheIndex,this.currentCacheIndex+1]),a||this.addCacheImageToItemEl(b[0],d[0]),this.addCacheImageToItemEl(b[1],d[1])):(b=this.cache.getImages([this.currentCacheIndex-1,this.currentCacheIndex]),a||this.addCacheImageToItemEl(b[1],d[1]),this.addCacheImageToItemEl(b[0],d[0])):this.currentCacheIndex===0?(b=this.cache.getImages([this.currentCacheIndex,
75
+ this.currentCacheIndex+1,this.currentCacheIndex+2]),a||this.addCacheImageToItemEl(b[0],d[0]),this.addCacheImageToItemEl(b[1],d[1]),this.addCacheImageToItemEl(b[2],d[2])):(this.currentCacheIndex===this.cache.images.length-1?(b=this.cache.getImages([this.currentCacheIndex-2,this.currentCacheIndex-1,this.currentCacheIndex]),a||this.addCacheImageToItemEl(b[2],d[2]),this.addCacheImageToItemEl(b[1],d[1])):(b=this.cache.getImages([this.currentCacheIndex-1,this.currentCacheIndex,this.currentCacheIndex+1]),
76
+ a||this.addCacheImageToItemEl(b[1],d[1]),this.addCacheImageToItemEl(b[2],d[2])),this.addCacheImageToItemEl(b[0],d[0]))},addCacheImageToItemEl:function(c,d){a.DOM.removeClass(d,b.Carousel.CssClasses.itemError);a.DOM.addClass(d,b.Carousel.CssClasses.itemLoading);a.DOM.removeChildren(d);a.DOM.setStyle(c.imageEl,{display:"none"});a.DOM.appendChild(c.imageEl,d);a.Animation.resetTranslate(c.imageEl);a.Events.add(c,b.Image.EventTypes.onLoad,this.imageLoadHandler);a.Events.add(c,b.Image.EventTypes.onError,
77
+ this.imageErrorHandler);c.load()},slideCarousel:function(c,d,f){if(!this.isSliding){var i,j;i=this.settings.target===e?a.DOM.windowWidth()+this.settings.margin:a.DOM.width(this.settings.target)+this.settings.margin;f=a.coalesce(f,this.settings.slideSpeed);if(!(e.Math.abs(j)<1)){switch(d){case a.TouchElement.ActionTypes.swipeLeft:c=i*-1;break;case a.TouchElement.ActionTypes.swipeRight:c=i;break;default:j=c.x-this.touchStartPoint.x,c=e.Math.abs(j)>i/2?j>0?i:i*-1:0}this.lastSlideByAction=c<0?b.Carousel.SlideByAction.next:
78
+ c>0?b.Carousel.SlideByAction.previous:b.Carousel.SlideByAction.current;if(!this.settings.loop&&(this.lastSlideByAction===b.Carousel.SlideByAction.previous&&this.currentCacheIndex===0||this.lastSlideByAction===b.Carousel.SlideByAction.next&&this.currentCacheIndex===this.cache.images.length-1))c=0,this.lastSlideByAction=b.Carousel.SlideByAction.current;this.isSliding=!0;this.doSlideCarousel(c,f)}}},moveCarousel:function(a){this.isSliding||this.settings.enableDrag&&this.doMoveCarousel(a.x-this.touchStartPoint.x)},
79
+ getItemEls:function(){return a.DOM.find("."+b.Carousel.CssClasses.item,this.contentEl)},previous:function(){this.stopSlideshow();this.slideCarousel({x:0,y:0},a.TouchElement.ActionTypes.swipeRight,this.settings.nextPreviousSlideSpeed)},next:function(){this.stopSlideshow();this.slideCarousel({x:0,y:0},a.TouchElement.ActionTypes.swipeLeft,this.settings.nextPreviousSlideSpeed)},slideshowNext:function(){this.slideCarousel({x:0,y:0},a.TouchElement.ActionTypes.swipeLeft)},startSlideshow:function(){this.stopSlideshow();
80
+ this.isSlideshowActive=!0;this.slideshowTimeout=e.setTimeout(this.slideshowNext.bind(this),this.settings.slideshowDelay);a.Events.fire(this,{type:b.Carousel.EventTypes.onSlideshowStart,target:this})},stopSlideshow:function(){if(!a.isNothing(this.slideshowTimeout))e.clearTimeout(this.slideshowTimeout),this.slideshowTimeout=null,this.isSlideshowActive=!1,a.Events.fire(this,{type:b.Carousel.EventTypes.onSlideshowStop,target:this})},onSlideByEnd:function(){if(!a.isNothing(this.isSliding)){var c=this.getItemEls();
81
+ this.isSliding=!1;this.lastSlideByAction===b.Carousel.SlideByAction.next?this.currentCacheIndex+=1:this.lastSlideByAction===b.Carousel.SlideByAction.previous&&(this.currentCacheIndex-=1);if(this.settings.loop)if(this.lastSlideByAction===b.Carousel.SlideByAction.next?a.DOM.appendChild(c[0],this.contentEl):this.lastSlideByAction===b.Carousel.SlideByAction.previous&&a.DOM.insertBefore(c[c.length-1],c[0],this.contentEl),this.currentCacheIndex<0)this.currentCacheIndex=this.cache.images.length-1;else{if(this.currentCacheIndex===
82
+ this.cache.images.length)this.currentCacheIndex=0}else this.cache.images.length>3&&(this.currentCacheIndex>1&&this.currentCacheIndex<this.cache.images.length-2?this.lastSlideByAction===b.Carousel.SlideByAction.next?a.DOM.appendChild(c[0],this.contentEl):this.lastSlideByAction===b.Carousel.SlideByAction.previous&&a.DOM.insertBefore(c[c.length-1],c[0],this.contentEl):this.currentCacheIndex===1?this.lastSlideByAction===b.Carousel.SlideByAction.previous&&a.DOM.insertBefore(c[c.length-1],c[0],this.contentEl):
83
+ this.currentCacheIndex===this.cache.images.length-2&&this.lastSlideByAction===b.Carousel.SlideByAction.next&&a.DOM.appendChild(c[0],this.contentEl));this.lastSlideByAction!==b.Carousel.SlideByAction.current&&(this.setContentLeftPosition(),this.setImages(!0));a.Events.fire(this,{type:b.Carousel.EventTypes.onSlideByEnd,target:this,action:this.lastSlideByAction,cacheIndex:this.currentCacheIndex});this.isSlideshowActive&&(this.lastSlideByAction!==b.Carousel.SlideByAction.current?this.startSlideshow():
84
+ this.stopSlideshow())}},onTouch:function(b,d){this.stopSlideshow();switch(b){case a.TouchElement.ActionTypes.touchStart:this.touchStartPoint=d;this.touchStartPosition={x:e.parseInt(a.DOM.getStyle(this.contentEl,"left"),0),y:e.parseInt(a.DOM.getStyle(this.contentEl,"top"),0)};break;case a.TouchElement.ActionTypes.touchMove:this.moveCarousel(d);break;case a.TouchElement.ActionTypes.touchMoveEnd:case a.TouchElement.ActionTypes.swipeLeft:case a.TouchElement.ActionTypes.swipeRight:this.slideCarousel(d,
85
+ b)}},onImageLoad:function(c){c=c.target;a.isNothing(c.imageEl.parentNode)||(a.DOM.removeClass(c.imageEl.parentNode,b.Carousel.CssClasses.itemLoading),this.resetImagePosition(c.imageEl));a.Events.remove(c,b.Image.EventTypes.onLoad,this.imageLoadHandler);a.Events.remove(c,b.Image.EventTypes.onError,this.imageErrorHandler)},onImageError:function(c){c=c.target;a.isNothing(c.imageEl.parentNode)||(a.DOM.removeClass(c.imageEl.parentNode,b.Carousel.CssClasses.itemLoading),a.DOM.addClass(c.imageEl.parentNode,
86
+ b.Carousel.CssClasses.itemError));a.Events.remove(c,b.Image.EventTypes.onLoad,this.imageLoadHandler);a.Events.remove(c,b.Image.EventTypes.onError,this.imageErrorHandler)}})})(window,window.klass,window.Code.Util);
87
+ (function(e,d,a){a.registerNamespace("Code.PhotoSwipe.Carousel");d=e.Code.PhotoSwipe;d.Carousel.CarouselClass=d.Carousel.CarouselClass.extend({getStartingPos:function(){var b=this.touchStartPosition;a.isNothing(b)&&(b={x:e.parseInt(a.DOM.getStyle(this.contentEl,"left"),0),y:e.parseInt(a.DOM.getStyle(this.contentEl,"top"),0)});return b},doMoveCarousel:function(b){var c;a.Browser.isCSSTransformSupported?(c={},c[a.Animation._transitionPrefix+"Property"]="all",c[a.Animation._transitionPrefix+"Duration"]=
88
+ "",c[a.Animation._transitionPrefix+"TimingFunction"]="",c[a.Animation._transitionPrefix+"Delay"]="0",c[a.Animation._transformLabel]=a.Browser.is3dSupported?"translate3d("+b+"px, 0px, 0px)":"translate("+b+"px, 0px)",a.DOM.setStyle(this.contentEl,c)):a.isNothing(e.jQuery)||e.jQuery(this.contentEl).stop().css("left",this.getStartingPos().x+b+"px")},doSlideCarousel:function(b,c){var d;if(c<=0)this.slideByEndHandler();else if(a.Browser.isCSSTransformSupported)d=a.coalesce(this.contentEl.style.webkitTransform,
89
+ this.contentEl.style.MozTransform,this.contentEl.style.transform,""),d.indexOf("translate3d("+b)===0?this.slideByEndHandler():d.indexOf("translate("+b)===0?this.slideByEndHandler():a.Animation.slideBy(this.contentEl,b,0,c,this.slideByEndHandler,this.settings.slideTimingFunction);else if(!a.isNothing(e.jQuery)){d={left:this.getStartingPos().x+b+"px"};if(this.settings.animationTimingFunction==="ease-out")this.settings.animationTimingFunction="easeOutQuad";if(a.isNothing(e.jQuery.easing[this.settings.animationTimingFunction]))this.settings.animationTimingFunction=
90
+ "linear";e.jQuery(this.contentEl).animate(d,this.settings.slideSpeed,this.settings.animationTimingFunction,this.slideByEndHandler)}}})})(window,window.klass,window.Code.Util,window.Code.PhotoSwipe.TouchElement);
91
+ (function(e,d,a){a.registerNamespace("Code.PhotoSwipe.Toolbar");var b=e.Code.PhotoSwipe;b.Toolbar.CssClasses={toolbar:"ps-toolbar",toolbarContent:"ps-toolbar-content",toolbarTop:"ps-toolbar-top",caption:"ps-caption",captionBottom:"ps-caption-bottom",captionContent:"ps-caption-content",close:"ps-toolbar-close",play:"ps-toolbar-play",previous:"ps-toolbar-previous",previousDisabled:"ps-toolbar-previous-disabled",next:"ps-toolbar-next",nextDisabled:"ps-toolbar-next-disabled"};b.Toolbar.ToolbarAction=
92
+ {close:"close",play:"play",next:"next",previous:"previous",none:"none"};b.Toolbar.EventTypes={onTap:"PhotoSwipeToolbarOnClick",onBeforeShow:"PhotoSwipeToolbarOnBeforeShow",onShow:"PhotoSwipeToolbarOnShow",onBeforeHide:"PhotoSwipeToolbarOnBeforeHide",onHide:"PhotoSwipeToolbarOnHide"};b.Toolbar.getToolbar=function(){return'<div class="'+b.Toolbar.CssClasses.close+'"><div class="'+b.Toolbar.CssClasses.toolbarContent+'"></div></div><div class="'+b.Toolbar.CssClasses.play+'"><div class="'+b.Toolbar.CssClasses.toolbarContent+
93
+ '"></div></div><div class="'+b.Toolbar.CssClasses.previous+'"><div class="'+b.Toolbar.CssClasses.toolbarContent+'"></div></div><div class="'+b.Toolbar.CssClasses.next+'"><div class="'+b.Toolbar.CssClasses.toolbarContent+'"></div></div>'}})(window,window.klass,window.Code.Util);
94
+ (function(e,d,a){a.registerNamespace("Code.PhotoSwipe.Toolbar");var b=e.Code.PhotoSwipe;b.Toolbar.ToolbarClass=d({toolbarEl:null,closeEl:null,playEl:null,previousEl:null,nextEl:null,captionEl:null,captionContentEl:null,currentCaption:null,settings:null,cache:null,timeout:null,isVisible:null,fadeOutHandler:null,touchStartHandler:null,touchMoveHandler:null,clickHandler:null,dispose:function(){var b;this.clearTimeout();this.removeEventHandlers();a.Animation.stop(this.toolbarEl);a.Animation.stop(this.captionEl);
95
+ a.DOM.removeChild(this.toolbarEl,this.toolbarEl.parentNode);a.DOM.removeChild(this.captionEl,this.captionEl.parentNode);for(b in this)a.objectHasProperty(this,b)&&(this[b]=null)},initialize:function(c,d){var f;this.settings=d;this.cache=c;this.isVisible=!1;this.fadeOutHandler=this.onFadeOut.bind(this);this.touchStartHandler=this.onTouchStart.bind(this);this.touchMoveHandler=this.onTouchMove.bind(this);this.clickHandler=this.onClick.bind(this);f=b.Toolbar.CssClasses.toolbar;this.settings.captionAndToolbarFlipPosition&&
96
+ (f=f+" "+b.Toolbar.CssClasses.toolbarTop);this.toolbarEl=a.DOM.createElement("div",{"class":f},this.settings.getToolbar());a.DOM.setStyle(this.toolbarEl,{left:0,position:"absolute",overflow:"hidden",zIndex:this.settings.zIndex});this.settings.target===e?a.DOM.appendToBody(this.toolbarEl):a.DOM.appendChild(this.toolbarEl,this.settings.target);a.DOM.hide(this.toolbarEl);this.closeEl=a.DOM.find("."+b.Toolbar.CssClasses.close,this.toolbarEl)[0];this.settings.preventHide&&!a.isNothing(this.closeEl)&&a.DOM.hide(this.closeEl);
97
+ this.playEl=a.DOM.find("."+b.Toolbar.CssClasses.play,this.toolbarEl)[0];this.settings.preventSlideshow&&!a.isNothing(this.playEl)&&a.DOM.hide(this.playEl);this.nextEl=a.DOM.find("."+b.Toolbar.CssClasses.next,this.toolbarEl)[0];this.previousEl=a.DOM.find("."+b.Toolbar.CssClasses.previous,this.toolbarEl)[0];f=b.Toolbar.CssClasses.caption;this.settings.captionAndToolbarFlipPosition&&(f=f+" "+b.Toolbar.CssClasses.captionBottom);this.captionEl=a.DOM.createElement("div",{"class":f},"");a.DOM.setStyle(this.captionEl,
98
+ {left:0,position:"absolute",overflow:"hidden",zIndex:this.settings.zIndex});this.settings.target===e?a.DOM.appendToBody(this.captionEl):a.DOM.appendChild(this.captionEl,this.settings.target);a.DOM.hide(this.captionEl);this.captionContentEl=a.DOM.createElement("div",{"class":b.Toolbar.CssClasses.captionContent},"");a.DOM.appendChild(this.captionContentEl,this.captionEl);this.addEventHandlers()},resetPosition:function(){var b,d,f;this.settings.target===e?(this.settings.captionAndToolbarFlipPosition?
99
+ (d=a.DOM.windowScrollTop(),f=a.DOM.windowScrollTop()+a.DOM.windowHeight()-a.DOM.height(this.captionEl)):(d=a.DOM.windowScrollTop()+a.DOM.windowHeight()-a.DOM.height(this.toolbarEl),f=a.DOM.windowScrollTop()),b=a.DOM.windowWidth()):(this.settings.captionAndToolbarFlipPosition?(d="0",f=a.DOM.height(this.settings.target)-a.DOM.height(this.captionEl)):(d=a.DOM.height(this.settings.target)-a.DOM.height(this.toolbarEl),f=0),b=a.DOM.width(this.settings.target));a.DOM.setStyle(this.toolbarEl,{top:d+"px",
100
+ width:b});a.DOM.setStyle(this.captionEl,{top:f+"px",width:b})},toggleVisibility:function(a){this.isVisible?this.fadeOut():this.show(a)},show:function(c){a.Animation.stop(this.toolbarEl);a.Animation.stop(this.captionEl);this.resetPosition();this.setToolbarStatus(c);a.Events.fire(this,{type:b.Toolbar.EventTypes.onBeforeShow,target:this});this.showToolbar();this.setCaption(c);this.showCaption();this.isVisible=!0;this.setTimeout();a.Events.fire(this,{type:b.Toolbar.EventTypes.onShow,target:this})},setTimeout:function(){if(this.settings.captionAndToolbarAutoHideDelay>
101
+ 0)this.clearTimeout(),this.timeout=e.setTimeout(this.fadeOut.bind(this),this.settings.captionAndToolbarAutoHideDelay)},clearTimeout:function(){if(!a.isNothing(this.timeout))e.clearTimeout(this.timeout),this.timeout=null},fadeOut:function(){this.clearTimeout();a.Events.fire(this,{type:b.Toolbar.EventTypes.onBeforeHide,target:this});a.Animation.fadeOut(this.toolbarEl,this.settings.fadeOutSpeed);a.Animation.fadeOut(this.captionEl,this.settings.fadeOutSpeed,this.fadeOutHandler);this.isVisible=!1},addEventHandlers:function(){a.Browser.isTouchSupported&&
102
+ (a.Browser.blackberry||a.Events.add(this.toolbarEl,"touchstart",this.touchStartHandler),a.Events.add(this.toolbarEl,"touchmove",this.touchMoveHandler),a.Events.add(this.captionEl,"touchmove",this.touchMoveHandler));a.Events.add(this.toolbarEl,"click",this.clickHandler)},removeEventHandlers:function(){a.Browser.isTouchSupported&&(a.Browser.blackberry||a.Events.remove(this.toolbarEl,"touchstart",this.touchStartHandler),a.Events.remove(this.toolbarEl,"touchmove",this.touchMoveHandler),a.Events.remove(this.captionEl,
103
+ "touchmove",this.touchMoveHandler));a.Events.remove(this.toolbarEl,"click",this.clickHandler)},handleTap:function(c){this.clearTimeout();var d;if(c.target===this.nextEl||a.DOM.isChildOf(c.target,this.nextEl))d=b.Toolbar.ToolbarAction.next;else if(c.target===this.previousEl||a.DOM.isChildOf(c.target,this.previousEl))d=b.Toolbar.ToolbarAction.previous;else if(c.target===this.closeEl||a.DOM.isChildOf(c.target,this.closeEl))d=b.Toolbar.ToolbarAction.close;else if(c.target===this.playEl||a.DOM.isChildOf(c.target,
104
+ this.playEl))d=b.Toolbar.ToolbarAction.play;this.setTimeout();if(a.isNothing(d))d=b.Toolbar.ToolbarAction.none;a.Events.fire(this,{type:b.Toolbar.EventTypes.onTap,target:this,action:d,tapTarget:c.target})},setCaption:function(b){a.DOM.removeChildren(this.captionContentEl);this.currentCaption=a.coalesce(this.cache.images[b].caption,"\u00a0");if(a.isObject(this.currentCaption))a.DOM.appendChild(this.currentCaption,this.captionContentEl);else{if(this.currentCaption==="")this.currentCaption="\u00a0";
105
+ a.DOM.appendText(this.currentCaption,this.captionContentEl)}this.currentCaption=this.currentCaption==="\u00a0"?"":this.currentCaption;this.resetPosition()},showToolbar:function(){a.DOM.setStyle(this.toolbarEl,{opacity:this.settings.captionAndToolbarOpacity});a.DOM.show(this.toolbarEl)},showCaption:function(){(this.currentCaption===""||this.captionContentEl.childNodes.length<1)&&!this.settings.captionAndToolbarShowEmptyCaptions?a.DOM.hide(this.captionEl):(a.DOM.setStyle(this.captionEl,{opacity:this.settings.captionAndToolbarOpacity}),
106
+ a.DOM.show(this.captionEl))},setToolbarStatus:function(c){this.settings.loop||(a.DOM.removeClass(this.previousEl,b.Toolbar.CssClasses.previousDisabled),a.DOM.removeClass(this.nextEl,b.Toolbar.CssClasses.nextDisabled),c>0&&c<this.cache.images.length-1||(c===0&&(a.isNothing(this.previousEl)||a.DOM.addClass(this.previousEl,b.Toolbar.CssClasses.previousDisabled)),c===this.cache.images.length-1&&(a.isNothing(this.nextEl)||a.DOM.addClass(this.nextEl,b.Toolbar.CssClasses.nextDisabled))))},onFadeOut:function(){a.DOM.hide(this.toolbarEl);
107
+ a.DOM.hide(this.captionEl);a.Events.fire(this,{type:b.Toolbar.EventTypes.onHide,target:this})},onTouchStart:function(b){b.preventDefault();a.Events.remove(this.toolbarEl,"click",this.clickHandler);this.handleTap(b)},onTouchMove:function(a){a.preventDefault()},onClick:function(a){a.preventDefault();this.handleTap(a)}})})(window,window.klass,window.Code.Util);
108
+ (function(e,d,a){a.registerNamespace("Code.PhotoSwipe.UILayer");e.Code.PhotoSwipe.UILayer.CssClasses={uiLayer:"ps-uilayer"}})(window,window.klass,window.Code.Util);
109
+ (function(e,d,a){a.registerNamespace("Code.PhotoSwipe.UILayer");var b=e.Code.PhotoSwipe;b.UILayer.UILayerClass=a.TouchElement.TouchElementClass.extend({el:null,settings:null,dispose:function(){var b;this.removeEventHandlers();a.DOM.removeChild(this.el,this.el.parentNode);for(b in this)a.objectHasProperty(this,b)&&(this[b]=null)},initialize:function(c){this.settings=c;this.el=a.DOM.createElement("div",{"class":b.UILayer.CssClasses.uiLayer},"");a.DOM.setStyle(this.el,{display:"block",position:"absolute",
110
+ left:0,top:0,overflow:"hidden",zIndex:this.settings.zIndex,opacity:0});a.DOM.hide(this.el);this.settings.target===e?a.DOM.appendToBody(this.el):a.DOM.appendChild(this.el,this.settings.target);this.supr(this.el,{swipe:!0,move:!0,gesture:a.Browser.iOS,doubleTap:!0,preventDefaultTouchEvents:this.settings.preventDefaultTouchEvents})},resetPosition:function(){this.settings.target===e?a.DOM.setStyle(this.el,{top:a.DOM.windowScrollTop()+"px",width:a.DOM.windowWidth(),height:a.DOM.windowHeight()}):a.DOM.setStyle(this.el,
111
+ {top:"0px",width:a.DOM.width(this.settings.target),height:a.DOM.height(this.settings.target)})},show:function(){this.resetPosition();a.DOM.show(this.el);this.addEventHandlers()},addEventHandlers:function(){this.supr()},removeEventHandlers:function(){this.supr()}})})(window,window.klass,window.Code.Util);
112
+ (function(e,d,a){a.registerNamespace("Code.PhotoSwipe.ZoomPanRotate");e=e.Code.PhotoSwipe;e.ZoomPanRotate.CssClasses={zoomPanRotate:"ps-zoom-pan-rotate"};e.ZoomPanRotate.EventTypes={onTransform:"PhotoSwipeZoomPanRotateOnTransform"}})(window,window.klass,window.Code.Util);
113
+ (function(e,d,a){a.registerNamespace("Code.PhotoSwipe.ZoomPanRotate");var b=e.Code.PhotoSwipe;b.ZoomPanRotate.ZoomPanRotateClass=d({el:null,settings:null,containerEl:null,imageEl:null,transformSettings:null,panStartingPoint:null,transformEl:null,dispose:function(){var b;a.DOM.removeChild(this.el,this.el.parentNode);for(b in this)a.objectHasProperty(this,b)&&(this[b]=null)},initialize:function(c,d,f){var i,j,h;this.settings=c;this.settings.target===e?(c=document.body,i=a.DOM.windowWidth(),j=a.DOM.windowHeight(),
114
+ h=a.DOM.windowScrollTop()+"px"):(c=this.settings.target,i=a.DOM.width(c),j=a.DOM.height(c),h="0px");this.imageEl=d.imageEl.cloneNode(!1);a.DOM.setStyle(this.imageEl,{zIndex:1});this.transformSettings={startingScale:1,scale:1,startingRotation:0,rotation:0,startingTranslateX:0,startingTranslateY:0,translateX:0,translateY:0};this.el=a.DOM.createElement("div",{"class":b.ZoomPanRotate.CssClasses.zoomPanRotate},"");a.DOM.setStyle(this.el,{left:0,top:h,position:"absolute",width:i,height:j,zIndex:this.settings.zIndex,
115
+ display:"block"});a.DOM.insertBefore(this.el,f.el,c);a.Browser.iOS?(this.containerEl=a.DOM.createElement("div","",""),a.DOM.setStyle(this.containerEl,{left:0,top:0,width:i,height:j,position:"absolute",zIndex:1}),a.DOM.appendChild(this.imageEl,this.containerEl),a.DOM.appendChild(this.containerEl,this.el),a.Animation.resetTranslate(this.containerEl),a.Animation.resetTranslate(this.imageEl),this.transformEl=this.containerEl):(a.DOM.appendChild(this.imageEl,this.el),this.transformEl=this.imageEl)},setStartingTranslateFromCurrentTransform:function(){var b=
116
+ a.coalesce(this.transformEl.style.webkitTransform,this.transformEl.style.MozTransform,this.transformEl.style.transform);if(!a.isNothing(b)&&(b=b.match(/translate\((.*?)\)/),!a.isNothing(b)))b=b[1].split(", "),this.transformSettings.startingTranslateX=e.parseInt(b[0],10),this.transformSettings.startingTranslateY=e.parseInt(b[1],10)},getScale:function(a){a*=this.transformSettings.startingScale;if(this.settings.minUserZoom!==0&&a<this.settings.minUserZoom)a=this.settings.minUserZoom;else if(this.settings.maxUserZoom!==
117
+ 0&&a>this.settings.maxUserZoom)a=this.settings.maxUserZoom;return a},setStartingScaleAndRotation:function(a,b){this.transformSettings.startingScale=this.getScale(a);this.transformSettings.startingRotation=(this.transformSettings.startingRotation+b)%360},zoomRotate:function(a,b){this.transformSettings.scale=this.getScale(a);this.transformSettings.rotation=this.transformSettings.startingRotation+b;this.applyTransform()},panStart:function(a){this.setStartingTranslateFromCurrentTransform();this.panStartingPoint=
118
+ {x:a.x,y:a.y}},pan:function(a){var b=(a.y-this.panStartingPoint.y)/this.transformSettings.scale;this.transformSettings.translateX=this.transformSettings.startingTranslateX+(a.x-this.panStartingPoint.x)/this.transformSettings.scale;this.transformSettings.translateY=this.transformSettings.startingTranslateY+b;this.applyTransform()},zoomAndPanToPoint:function(b,d){if(this.settings.target===e){this.panStart({x:a.DOM.windowWidth()/2,y:a.DOM.windowHeight()/2});var f=(d.y-this.panStartingPoint.y)/this.transformSettings.scale;
119
+ this.transformSettings.translateX=(this.transformSettings.startingTranslateX+(d.x-this.panStartingPoint.x)/this.transformSettings.scale)*-1;this.transformSettings.translateY=(this.transformSettings.startingTranslateY+f)*-1}this.setStartingScaleAndRotation(b,0);this.transformSettings.scale=this.transformSettings.startingScale;this.transformSettings.rotation=0;this.applyTransform()},applyTransform:function(){var c=this.transformSettings.rotation%360,d=e.parseInt(this.transformSettings.translateX,10),
120
+ f=e.parseInt(this.transformSettings.translateY,10),i="scale("+this.transformSettings.scale+") rotate("+c+"deg) translate("+d+"px, "+f+"px)";a.DOM.setStyle(this.transformEl,{webkitTransform:i,MozTransform:i,msTransform:i,transform:i});a.Events.fire(this,{target:this,type:b.ZoomPanRotate.EventTypes.onTransform,scale:this.transformSettings.scale,rotation:this.transformSettings.rotation,rotationDegs:c,translateX:d,translateY:f})}})})(window,window.klass,window.Code.Util);
121
+ (function(e,d){d.registerNamespace("Code.PhotoSwipe");var a=e.Code.PhotoSwipe;a.CssClasses={buildingBody:"ps-building",activeBody:"ps-active"};a.EventTypes={onBeforeShow:"PhotoSwipeOnBeforeShow",onShow:"PhotoSwipeOnShow",onBeforeHide:"PhotoSwipeOnBeforeHide",onHide:"PhotoSwipeOnHide",onDisplayImage:"PhotoSwipeOnDisplayImage",onResetPosition:"PhotoSwipeOnResetPosition",onSlideshowStart:"PhotoSwipeOnSlideshowStart",onSlideshowStop:"PhotoSwipeOnSlideshowStop",onTouch:"PhotoSwipeOnTouch",onBeforeCaptionAndToolbarShow:"PhotoSwipeOnBeforeCaptionAndToolbarShow",
122
+ onCaptionAndToolbarShow:"PhotoSwipeOnCaptionAndToolbarShow",onBeforeCaptionAndToolbarHide:"PhotoSwipeOnBeforeCaptionAndToolbarHide",onCaptionAndToolbarHide:"PhotoSwipeOnCaptionAndToolbarHide",onToolbarTap:"PhotoSwipeOnToolbarTap",onBeforeZoomPanRotateShow:"PhotoSwipeOnBeforeZoomPanRotateShow",onZoomPanRotateShow:"PhotoSwipeOnZoomPanRotateShow",onBeforeZoomPanRotateHide:"PhotoSwipeOnBeforeZoomPanRotateHide",onZoomPanRotateHide:"PhotoSwipeOnZoomPanRotateHide",onZoomPanRotateTransform:"PhotoSwipeOnZoomPanRotateTransform"};
123
+ a.instances=[];a.activeInstances=[];a.setActivateInstance=function(b){if(d.arrayIndexOf(b.settings.target,a.activeInstances,"target")>-1)throw"Code.PhotoSwipe.activateInstance: Unable to active instance as another instance is already active for this target";a.activeInstances.push({target:b.settings.target,instance:b})};a.unsetActivateInstance=function(b){b=d.arrayIndexOf(b,a.activeInstances,"instance");a.activeInstances.splice(b,1)};a.attach=function(b,c,e){var f,i;f=a.createInstance(b,c,e);c=0;for(e=
124
+ b.length;c<e;c++)if(i=b[c],!d.isNothing(i.nodeType)&&i.nodeType===1)i.__photoSwipeClickHandler=a.onTriggerElementClick.bind(f),d.Events.remove(i,"click",i.__photoSwipeClickHandler),d.Events.add(i,"click",i.__photoSwipeClickHandler);return f};if(e.jQuery)e.jQuery.fn.photoSwipe=function(b,c){return a.attach(this,b,c)};a.detatch=function(b){var c,e,f;c=0;for(e=b.originalImages.length;c<e;c++)f=b.originalImages[c],!d.isNothing(f.nodeType)&&f.nodeType===1&&(d.Events.remove(f,"click",f.__photoSwipeClickHandler),
125
+ delete f.__photoSwipeClickHandler);a.disposeInstance(b)};a.createInstance=function(b,c,e){var f;if(d.isNothing(b))throw"Code.PhotoSwipe.attach: No images passed.";if(!d.isLikeArray(b))throw"Code.PhotoSwipe.createInstance: Images must be an array of elements or image urls.";if(b.length<1)throw"Code.PhotoSwipe.createInstance: No images to passed.";c=d.coalesce(c,{});f=a.getInstance(e);if(d.isNothing(f))f=new a.PhotoSwipeClass(b,c,e),a.instances.push(f);else throw'Code.PhotoSwipe.createInstance: Instance with id "'+
126
+ e+' already exists."';return f};a.disposeInstance=function(b){var c=a.getInstanceIndex(b);if(c<0)throw"Code.PhotoSwipe.disposeInstance: Unable to find instance to dispose.";b.dispose();a.instances.splice(c,1)};a.onTriggerElementClick=function(a){a.preventDefault();this.show(a.currentTarget)};a.getInstance=function(b){var c,d,e;c=0;for(d=a.instances.length;c<d;c++)if(e=a.instances[c],e.id===b)return e;return null};a.getInstanceIndex=function(b){var c,d,e=-1;c=0;for(d=a.instances.length;c<d;c++)if(a.instances[c]===
127
+ b){e=c;break}return e}})(window,window.Code.Util);
128
+ (function(e,d,a,b,c,g,f,i,j){a.registerNamespace("Code.PhotoSwipe");var h=e.Code.PhotoSwipe;h.PhotoSwipeClass=d({id:null,settings:null,isBackEventSupported:null,backButtonClicked:null,currentIndex:null,originalImages:null,mouseWheelStartTime:null,windowDimensions:null,cache:null,documentOverlay:null,carousel:null,uiLayer:null,toolbar:null,zoomPanRotate:null,windowOrientationChangeHandler:null,windowScrollHandler:null,windowHashChangeHandler:null,keyDownHandler:null,windowOrientationEventName:null,
129
+ uiLayerTouchHandler:null,carouselSlideByEndHandler:null,carouselSlideshowStartHandler:null,carouselSlideshowStopHandler:null,toolbarTapHandler:null,toolbarBeforeShowHandler:null,toolbarShowHandler:null,toolbarBeforeHideHandler:null,toolbarHideHandler:null,mouseWheelHandler:null,zoomPanRotateTransformHandler:null,_isResettingPosition:null,_uiWebViewResetPositionTimeout:null,dispose:function(){var b;a.Events.remove(this,h.EventTypes.onBeforeShow);a.Events.remove(this,h.EventTypes.onShow);a.Events.remove(this,
130
+ h.EventTypes.onBeforeHide);a.Events.remove(this,h.EventTypes.onHide);a.Events.remove(this,h.EventTypes.onDisplayImage);a.Events.remove(this,h.EventTypes.onResetPosition);a.Events.remove(this,h.EventTypes.onSlideshowStart);a.Events.remove(this,h.EventTypes.onSlideshowStop);a.Events.remove(this,h.EventTypes.onTouch);a.Events.remove(this,h.EventTypes.onBeforeCaptionAndToolbarShow);a.Events.remove(this,h.EventTypes.onCaptionAndToolbarShow);a.Events.remove(this,h.EventTypes.onBeforeCaptionAndToolbarHide);
131
+ a.Events.remove(this,h.EventTypes.onCaptionAndToolbarHide);a.Events.remove(this,h.EventTypes.onZoomPanRotateTransform);this.removeEventHandlers();a.isNothing(this.documentOverlay)||this.documentOverlay.dispose();a.isNothing(this.carousel)||this.carousel.dispose();a.isNothing(this.uiLayer)||this.uiLayer.dispose();a.isNothing(this.toolbar)||this.toolbar.dispose();this.destroyZoomPanRotate();a.isNothing(this.cache)||this.cache.dispose();for(b in this)a.objectHasProperty(this,b)&&(this[b]=null)},initialize:function(c,
132
+ d,f){this.id=a.isNothing(f)?"PhotoSwipe"+(new Date).getTime().toString():f;this.originalImages=c;if(a.Browser.android&&!a.Browser.firefox&&e.navigator.userAgent.match(/Android (\d+.\d+)/).toString().replace(/^.*\,/,"")>=2.1)this.isBackEventSupported=!0;if(!this.isBackEventSupported)this.isBackEventSupported=a.objectHasProperty(e,"onhashchange");this.settings={fadeInSpeed:250,fadeOutSpeed:250,preventHide:!1,preventSlideshow:!1,zIndex:1E3,backButtonHideEnabled:!0,enableKeyboard:!0,enableMouseWheel:!0,
133
+ mouseWheelSpeed:350,autoStartSlideshow:!1,jQueryMobile:!a.isNothing(e.jQuery)&&!a.isNothing(e.jQuery.mobile),jQueryMobileDialogHash:"&ui-state=dialog",enableUIWebViewRepositionTimeout:!1,uiWebViewResetPositionDelay:500,target:e,preventDefaultTouchEvents:!0,loop:!0,slideSpeed:250,nextPreviousSlideSpeed:0,enableDrag:!0,swipeThreshold:50,swipeTimeThreshold:250,slideTimingFunction:"ease-out",slideshowDelay:3E3,doubleTapSpeed:250,margin:20,imageScaleMethod:"fit",captionAndToolbarHide:!1,captionAndToolbarFlipPosition:!1,
134
+ captionAndToolbarAutoHideDelay:5E3,captionAndToolbarOpacity:0.8,captionAndToolbarShowEmptyCaptions:!0,getToolbar:h.Toolbar.getToolbar,allowUserZoom:!0,allowRotationOnUserZoom:!1,maxUserZoom:5,minUserZoom:0.5,doubleTapZoomLevel:2.5,getImageSource:h.Cache.Functions.getImageSource,getImageCaption:h.Cache.Functions.getImageCaption,getImageMetaData:h.Cache.Functions.getImageMetaData,cacheMode:h.Cache.Mode.normal};a.extend(this.settings,d);this.settings.target!==e&&(d=a.DOM.getStyle(this.settings.target,
135
+ "position"),(d!=="relative"||d!=="absolute")&&a.DOM.setStyle(this.settings.target,"position","relative"));if(this.settings.target!==e)this.isBackEventSupported=!1,this.settings.backButtonHideEnabled=!1;else if(this.settings.preventHide)this.settings.backButtonHideEnabled=!1;this.cache=new b.CacheClass(c,this.settings)},show:function(b){var c,d;this.backButtonClicked=this._isResettingPosition=!1;if(a.isNumber(b))this.currentIndex=b;else{this.currentIndex=-1;c=0;for(d=this.originalImages.length;c<d;c++)if(this.originalImages[c]===
136
+ b){this.currentIndex=c;break}}if(this.currentIndex<0||this.currentIndex>this.originalImages.length-1)throw"Code.PhotoSwipe.PhotoSwipeClass.show: Starting index out of range";this.isAlreadyGettingPage=this.getWindowDimensions();h.setActivateInstance(this);this.windowDimensions=this.getWindowDimensions();this.settings.target===e?a.DOM.addClass(e.document.body,h.CssClasses.buildingBody):a.DOM.addClass(this.settings.target,h.CssClasses.buildingBody);this.createComponents();a.Events.fire(this,{type:h.EventTypes.onBeforeShow,
137
+ target:this});this.documentOverlay.fadeIn(this.settings.fadeInSpeed,this.onDocumentOverlayFadeIn.bind(this))},getWindowDimensions:function(){return{width:a.DOM.windowWidth(),height:a.DOM.windowHeight()}},createComponents:function(){this.documentOverlay=new c.DocumentOverlayClass(this.settings);this.carousel=new g.CarouselClass(this.cache,this.settings);this.uiLayer=new i.UILayerClass(this.settings);if(!this.settings.captionAndToolbarHide)this.toolbar=new f.ToolbarClass(this.cache,this.settings)},
138
+ resetPosition:function(){if(!this._isResettingPosition){var b=this.getWindowDimensions();if(a.isNothing(this.windowDimensions)||!(b.width===this.windowDimensions.width&&b.height===this.windowDimensions.height))this._isResettingPosition=!0,this.windowDimensions=b,this.destroyZoomPanRotate(),this.documentOverlay.resetPosition(),this.carousel.resetPosition(),a.isNothing(this.toolbar)||this.toolbar.resetPosition(),this.uiLayer.resetPosition(),this._isResettingPosition=!1,a.Events.fire(this,{type:h.EventTypes.onResetPosition,
139
+ target:this})}},addEventHandler:function(b,c){a.Events.add(this,b,c)},addEventHandlers:function(){if(a.isNothing(this.windowOrientationChangeHandler))this.windowOrientationChangeHandler=this.onWindowOrientationChange.bind(this),this.windowScrollHandler=this.onWindowScroll.bind(this),this.keyDownHandler=this.onKeyDown.bind(this),this.windowHashChangeHandler=this.onWindowHashChange.bind(this),this.uiLayerTouchHandler=this.onUILayerTouch.bind(this),this.carouselSlideByEndHandler=this.onCarouselSlideByEnd.bind(this),
140
+ this.carouselSlideshowStartHandler=this.onCarouselSlideshowStart.bind(this),this.carouselSlideshowStopHandler=this.onCarouselSlideshowStop.bind(this),this.toolbarTapHandler=this.onToolbarTap.bind(this),this.toolbarBeforeShowHandler=this.onToolbarBeforeShow.bind(this),this.toolbarShowHandler=this.onToolbarShow.bind(this),this.toolbarBeforeHideHandler=this.onToolbarBeforeHide.bind(this),this.toolbarHideHandler=this.onToolbarHide.bind(this),this.mouseWheelHandler=this.onMouseWheel.bind(this),this.zoomPanRotateTransformHandler=
141
+ this.onZoomPanRotateTransform.bind(this);a.Browser.android?this.orientationEventName="resize":a.Browser.iOS&&!a.Browser.safari?a.Events.add(e.document.body,"orientationchange",this.windowOrientationChangeHandler):this.orientationEventName=!a.isNothing(e.onorientationchange)?"orientationchange":"resize";a.isNothing(this.orientationEventName)||a.Events.add(e,this.orientationEventName,this.windowOrientationChangeHandler);this.settings.target===e&&a.Events.add(e,"scroll",this.windowScrollHandler);this.settings.enableKeyboard&&
142
+ a.Events.add(e.document,"keydown",this.keyDownHandler);if(this.isBackEventSupported&&this.settings.backButtonHideEnabled)this.windowHashChangeHandler=this.onWindowHashChange.bind(this),this.settings.jQueryMobile?e.location.hash=this.settings.jQueryMobileDialogHash:(this.currentHistoryHashValue="PhotoSwipe"+(new Date).getTime().toString(),e.location.hash=this.currentHistoryHashValue),a.Events.add(e,"hashchange",this.windowHashChangeHandler);this.settings.enableMouseWheel&&a.Events.add(e,"mousewheel",
143
+ this.mouseWheelHandler);a.Events.add(this.uiLayer,a.TouchElement.EventTypes.onTouch,this.uiLayerTouchHandler);a.Events.add(this.carousel,g.EventTypes.onSlideByEnd,this.carouselSlideByEndHandler);a.Events.add(this.carousel,g.EventTypes.onSlideshowStart,this.carouselSlideshowStartHandler);a.Events.add(this.carousel,g.EventTypes.onSlideshowStop,this.carouselSlideshowStopHandler);a.isNothing(this.toolbar)||(a.Events.add(this.toolbar,f.EventTypes.onTap,this.toolbarTapHandler),a.Events.add(this.toolbar,
144
+ f.EventTypes.onBeforeShow,this.toolbarBeforeShowHandler),a.Events.add(this.toolbar,f.EventTypes.onShow,this.toolbarShowHandler),a.Events.add(this.toolbar,f.EventTypes.onBeforeHide,this.toolbarBeforeHideHandler),a.Events.add(this.toolbar,f.EventTypes.onHide,this.toolbarHideHandler))},removeEventHandlers:function(){a.Browser.iOS&&!a.Browser.safari&&a.Events.remove(e.document.body,"orientationchange",this.windowOrientationChangeHandler);a.isNothing(this.orientationEventName)||a.Events.remove(e,this.orientationEventName,
145
+ this.windowOrientationChangeHandler);a.Events.remove(e,"scroll",this.windowScrollHandler);this.settings.enableKeyboard&&a.Events.remove(e.document,"keydown",this.keyDownHandler);this.isBackEventSupported&&this.settings.backButtonHideEnabled&&a.Events.remove(e,"hashchange",this.windowHashChangeHandler);this.settings.enableMouseWheel&&a.Events.remove(e,"mousewheel",this.mouseWheelHandler);a.isNothing(this.uiLayer)||a.Events.remove(this.uiLayer,a.TouchElement.EventTypes.onTouch,this.uiLayerTouchHandler);
146
+ a.isNothing(this.toolbar)||(a.Events.remove(this.carousel,g.EventTypes.onSlideByEnd,this.carouselSlideByEndHandler),a.Events.remove(this.carousel,g.EventTypes.onSlideshowStart,this.carouselSlideshowStartHandler),a.Events.remove(this.carousel,g.EventTypes.onSlideshowStop,this.carouselSlideshowStopHandler));a.isNothing(this.toolbar)||(a.Events.remove(this.toolbar,f.EventTypes.onTap,this.toolbarTapHandler),a.Events.remove(this.toolbar,f.EventTypes.onBeforeShow,this.toolbarBeforeShowHandler),a.Events.remove(this.toolbar,
147
+ f.EventTypes.onShow,this.toolbarShowHandler),a.Events.remove(this.toolbar,f.EventTypes.onBeforeHide,this.toolbarBeforeHideHandler),a.Events.remove(this.toolbar,f.EventTypes.onHide,this.toolbarHideHandler))},hide:function(){if(!this.settings.preventHide){if(a.isNothing(this.documentOverlay))throw"Code.PhotoSwipe.PhotoSwipeClass.hide: PhotoSwipe instance is already hidden";if(a.isNothing(this.hiding)){this.clearUIWebViewResetPositionTimeout();this.destroyZoomPanRotate();this.removeEventHandlers();a.Events.fire(this,
148
+ {type:h.EventTypes.onBeforeHide,target:this});this.uiLayer.dispose();this.uiLayer=null;if(!a.isNothing(this.toolbar))this.toolbar.dispose(),this.toolbar=null;this.carousel.dispose();this.carousel=null;a.DOM.removeClass(e.document.body,h.CssClasses.activeBody);this.documentOverlay.dispose();this.documentOverlay=null;this._isResettingPosition=!1;h.unsetActivateInstance(this);a.Events.fire(this,{type:h.EventTypes.onHide,target:this});this.goBackInHistory()}}},goBackInHistory:function(){this.isBackEventSupported&&
149
+ this.settings.backButtonHideEnabled&&(this.backButtonClicked||e.history.back())},play:function(){!this.isZoomActive()&&!this.settings.preventSlideshow&&!a.isNothing(this.carousel)&&(!a.isNothing(this.toolbar)&&this.toolbar.isVisible&&this.toolbar.fadeOut(),this.carousel.startSlideshow())},stop:function(){this.isZoomActive()||a.isNothing(this.carousel)||this.carousel.stopSlideshow()},previous:function(){this.isZoomActive()||a.isNothing(this.carousel)||this.carousel.previous()},next:function(){this.isZoomActive()||
150
+ a.isNothing(this.carousel)||this.carousel.next()},toggleToolbar:function(){this.isZoomActive()||a.isNothing(this.toolbar)||this.toolbar.toggleVisibility(this.currentIndex)},fadeOutToolbarIfVisible:function(){!a.isNothing(this.toolbar)&&this.toolbar.isVisible&&this.settings.captionAndToolbarAutoHideDelay>0&&this.toolbar.fadeOut()},createZoomPanRotate:function(){this.stop();if(this.canUserZoom()&&!this.isZoomActive())a.Events.fire(this,h.EventTypes.onBeforeZoomPanRotateShow),this.zoomPanRotate=new j.ZoomPanRotateClass(this.settings,
151
+ this.cache.images[this.currentIndex],this.uiLayer),this.uiLayer.captureSettings.preventDefaultTouchEvents=!0,a.Events.add(this.zoomPanRotate,h.ZoomPanRotate.EventTypes.onTransform,this.zoomPanRotateTransformHandler),a.Events.fire(this,h.EventTypes.onZoomPanRotateShow),!a.isNothing(this.toolbar)&&this.toolbar.isVisible&&this.toolbar.fadeOut()},destroyZoomPanRotate:function(){if(!a.isNothing(this.zoomPanRotate))a.Events.fire(this,h.EventTypes.onBeforeZoomPanRotateHide),a.Events.remove(this.zoomPanRotate,
152
+ h.ZoomPanRotate.EventTypes.onTransform,this.zoomPanRotateTransformHandler),this.zoomPanRotate.dispose(),this.zoomPanRotate=null,this.uiLayer.captureSettings.preventDefaultTouchEvents=this.settings.preventDefaultTouchEvents,a.Events.fire(this,h.EventTypes.onZoomPanRotateHide)},canUserZoom:function(){var b;if(a.Browser.msie){if(b=document.createElement("div"),a.isNothing(b.style.msTransform))return!1}else if(!a.Browser.isCSSTransformSupported)return!1;if(!this.settings.allowUserZoom)return!1;if(this.carousel.isSliding)return!1;
153
+ b=this.cache.images[this.currentIndex];if(a.isNothing(b))return!1;if(b.isLoading)return!1;return!0},isZoomActive:function(){return!a.isNothing(this.zoomPanRotate)},getCurrentImage:function(){return this.cache.images[this.currentIndex]},onDocumentOverlayFadeIn:function(){e.setTimeout(function(){var b=this.settings.target===e?e.document.body:this.settings.target;a.DOM.removeClass(b,h.CssClasses.buildingBody);a.DOM.addClass(b,h.CssClasses.activeBody);this.addEventHandlers();this.carousel.show(this.currentIndex);
154
+ this.uiLayer.show();this.settings.autoStartSlideshow?this.play():a.isNothing(this.toolbar)||this.toolbar.show(this.currentIndex);a.Events.fire(this,{type:h.EventTypes.onShow,target:this});this.setUIWebViewResetPositionTimeout()}.bind(this),250)},setUIWebViewResetPositionTimeout:function(){if(this.settings.enableUIWebViewRepositionTimeout&&a.Browser.iOS&&!a.Browser.safari)a.isNothing(this._uiWebViewResetPositionTimeout)||e.clearTimeout(this._uiWebViewResetPositionTimeout),this._uiWebViewResetPositionTimeout=
155
+ e.setTimeout(function(){this.resetPosition();this.setUIWebViewResetPositionTimeout()}.bind(this),this.settings.uiWebViewResetPositionDelay)},clearUIWebViewResetPositionTimeout:function(){a.isNothing(this._uiWebViewResetPositionTimeout)||e.clearTimeout(this._uiWebViewResetPositionTimeout)},onWindowScroll:function(){this.resetPosition()},onWindowOrientationChange:function(){this.resetPosition()},onWindowHashChange:function(){if(e.location.hash!=="#"+(this.settings.jQueryMobile?this.settings.jQueryMobileDialogHash:
156
+ this.currentHistoryHashValue))this.backButtonClicked=!0,this.hide()},onKeyDown:function(a){a.keyCode===37?(a.preventDefault(),this.previous()):a.keyCode===39?(a.preventDefault(),this.next()):a.keyCode===38||a.keyCode===40?a.preventDefault():a.keyCode===27?(a.preventDefault(),this.hide()):a.keyCode===32?(this.settings.hideToolbar?this.hide():this.toggleToolbar(),a.preventDefault()):a.keyCode===13&&(a.preventDefault(),this.play())},onUILayerTouch:function(b){if(this.isZoomActive())switch(b.action){case a.TouchElement.ActionTypes.gestureChange:this.zoomPanRotate.zoomRotate(b.scale,
157
+ this.settings.allowRotationOnUserZoom?b.rotation:0);break;case a.TouchElement.ActionTypes.gestureEnd:this.zoomPanRotate.setStartingScaleAndRotation(b.scale,this.settings.allowRotationOnUserZoom?b.rotation:0);break;case a.TouchElement.ActionTypes.touchStart:this.zoomPanRotate.panStart(b.point);break;case a.TouchElement.ActionTypes.touchMove:this.zoomPanRotate.pan(b.point);break;case a.TouchElement.ActionTypes.doubleTap:this.destroyZoomPanRotate();this.toggleToolbar();break;case a.TouchElement.ActionTypes.swipeLeft:this.destroyZoomPanRotate();
158
+ this.next();this.toggleToolbar();break;case a.TouchElement.ActionTypes.swipeRight:this.destroyZoomPanRotate(),this.previous(),this.toggleToolbar()}else switch(b.action){case a.TouchElement.ActionTypes.touchMove:case a.TouchElement.ActionTypes.swipeLeft:case a.TouchElement.ActionTypes.swipeRight:this.fadeOutToolbarIfVisible();this.carousel.onTouch(b.action,b.point);break;case a.TouchElement.ActionTypes.touchStart:case a.TouchElement.ActionTypes.touchMoveEnd:this.carousel.onTouch(b.action,b.point);
159
+ break;case a.TouchElement.ActionTypes.tap:this.toggleToolbar();break;case a.TouchElement.ActionTypes.doubleTap:this.settings.target===e&&(b.point.x-=a.DOM.windowScrollLeft(),b.point.y-=a.DOM.windowScrollTop());var c=this.cache.images[this.currentIndex].imageEl,d=e.parseInt(a.DOM.getStyle(c,"top"),10),f=e.parseInt(a.DOM.getStyle(c,"left"),10),g=f+a.DOM.width(c),c=d+a.DOM.height(c);if(b.point.x<f)b.point.x=f;else if(b.point.x>g)b.point.x=g;if(b.point.y<d)b.point.y=d;else if(b.point.y>c)b.point.y=c;
160
+ this.createZoomPanRotate();this.isZoomActive()&&this.zoomPanRotate.zoomAndPanToPoint(this.settings.doubleTapZoomLevel,b.point);break;case a.TouchElement.ActionTypes.gestureStart:this.createZoomPanRotate()}a.Events.fire(this,{type:h.EventTypes.onTouch,target:this,point:b.point,action:b.action})},onCarouselSlideByEnd:function(b){this.currentIndex=b.cacheIndex;a.isNothing(this.toolbar)||(this.toolbar.setCaption(this.currentIndex),this.toolbar.setToolbarStatus(this.currentIndex));a.Events.fire(this,{type:h.EventTypes.onDisplayImage,
161
+ target:this,action:b.action,index:b.cacheIndex})},onToolbarTap:function(b){switch(b.action){case f.ToolbarAction.next:this.next();break;case f.ToolbarAction.previous:this.previous();break;case f.ToolbarAction.close:this.hide();break;case f.ToolbarAction.play:this.play()}a.Events.fire(this,{type:h.EventTypes.onToolbarTap,target:this,toolbarAction:b.action,tapTarget:b.tapTarget})},onMouseWheel:function(b){var c=a.Events.getWheelDelta(b);if(!(b.timeStamp-(this.mouseWheelStartTime||0)<this.settings.mouseWheelSpeed))this.mouseWheelStartTime=
162
+ b.timeStamp,this.settings.invertMouseWheel&&(c*=-1),c<0?this.next():c>0&&this.previous()},onCarouselSlideshowStart:function(){a.Events.fire(this,{type:h.EventTypes.onSlideshowStart,target:this})},onCarouselSlideshowStop:function(){a.Events.fire(this,{type:h.EventTypes.onSlideshowStop,target:this})},onToolbarBeforeShow:function(){a.Events.fire(this,{type:h.EventTypes.onBeforeCaptionAndToolbarShow,target:this})},onToolbarShow:function(){a.Events.fire(this,{type:h.EventTypes.onCaptionAndToolbarShow,
163
+ target:this})},onToolbarBeforeHide:function(){a.Events.fire(this,{type:h.EventTypes.onBeforeCaptionAndToolbarHide,target:this})},onToolbarHide:function(){a.Events.fire(this,{type:h.EventTypes.onCaptionAndToolbarHide,target:this})},onZoomPanRotateTransform:function(b){a.Events.fire(this,{target:this,type:h.EventTypes.onZoomPanRotateTransform,scale:b.scale,rotation:b.rotation,rotationDegs:b.rotationDegs,translateX:b.translateX,translateY:b.translateY})}})})(window,window.klass,window.Code.Util,window.Code.PhotoSwipe.Cache,
164
+ window.Code.PhotoSwipe.DocumentOverlay,window.Code.PhotoSwipe.Carousel,window.Code.PhotoSwipe.Toolbar,window.Code.PhotoSwipe.UILayer,window.Code.PhotoSwipe.ZoomPanRotate);
admin/js/photoswipe/images/error.gif ADDED
Binary file
admin/js/photoswipe/images/icons.png ADDED
Binary file
admin/js/photoswipe/images/icons@2x.png ADDED
Binary file
admin/js/photoswipe/images/loader.gif ADDED
Binary file
admin/js/photoswipe/klass.min.js ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
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/photoswipe/photoswipe.css ADDED
@@ -0,0 +1,196 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * photoswipe.css
3
+ * Copyright (c) %%year%% by Code Computerlove (http://www.codecomputerlove.com)
4
+ * Licensed under the MIT license
5
+ *
6
+ * Default styles for PhotoSwipe
7
+ * Avoid any position or dimension based styles
8
+ * where possible, unless specified already here.
9
+ * The gallery automatically works out gallery item
10
+ * positions etc.
11
+ */
12
+
13
+
14
+ body.ps-active, body.ps-building, div.ps-active, div.ps-building
15
+ {
16
+ background: #000;
17
+ overflow: hidden;
18
+ }
19
+ body.ps-active *, div.ps-active *
20
+ {
21
+ -webkit-tap-highlight-color: rgba(255, 255, 255, 0);
22
+ display: none;
23
+ }
24
+ body.ps-active *:focus, div.ps-active *:focus
25
+ {
26
+ outline: 0;
27
+ }
28
+
29
+
30
+ /* Document overlay */
31
+ div.ps-document-overlay
32
+ {
33
+ background: #000;
34
+ }
35
+
36
+
37
+ /* UILayer */
38
+ div.ps-uilayer {
39
+
40
+ background: #000;
41
+ cursor: pointer;
42
+
43
+ }
44
+
45
+
46
+ /* Zoom/pan/rotate layer */
47
+ div.ps-zoom-pan-rotate{
48
+ background: #000;
49
+ }
50
+ div.ps-zoom-pan-rotate * { display: block; }
51
+
52
+
53
+ /* Carousel */
54
+ div.ps-carousel-item-loading
55
+ {
56
+ background: url(images/loader.gif) no-repeat center center;
57
+ }
58
+
59
+ div.ps-carousel-item-error
60
+ {
61
+ background: url(images/error.gif) no-repeat center center;
62
+ }
63
+
64
+
65
+ /* Caption */
66
+ div.ps-caption
67
+ {
68
+ background: #000000;
69
+ background: -moz-linear-gradient(top, #303130 0%, #000101 100%);
70
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#303130), color-stop(100%,#000101));
71
+ border-bottom: 1px solid #42403f;
72
+ color: #ffffff;
73
+ font-size: 13px;
74
+ font-family: "Lucida Grande", Helvetica, Arial,Verdana, sans-serif;
75
+ text-align: center;
76
+ min-height: 44px;
77
+ }
78
+ div.ps-caption * { display: inline; }
79
+
80
+ div.ps-caption-bottom
81
+ {
82
+ border-top: 1px solid #42403f;
83
+ border-bottom: none;
84
+ min-height: 44px;
85
+ }
86
+
87
+ div.ps-caption-content
88
+ {
89
+ padding: 13px;
90
+ display: block;
91
+ max-height: 95%; overflow: auto;
92
+ }
93
+
94
+ div.ps-caption .ps-title { line-height: 100%; }
95
+ div.ps-caption div.ps-long-description { display: block; clear: both; padding: 13px 20px 7px 20px; text-align: left; }
96
+
97
+ /* Toolbar */
98
+ div.ps-toolbar
99
+ {
100
+ background: #000000;
101
+ background: -moz-linear-gradient(top, #303130 0%, #000101 100%);
102
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#303130), color-stop(100%,#000101));
103
+ border-top: 1px solid #42403f;
104
+ color: #ffffff;
105
+ font-size: 13px;
106
+ font-family: "Lucida Grande", Helvetica, Arial,Verdana, sans-serif;
107
+ text-align: center;
108
+ height: 44px;
109
+ display: table;
110
+ table-layout: fixed;
111
+ z-index: 10001 !important!;
112
+ }
113
+ div.ps-toolbar * {
114
+ display: block;
115
+ }
116
+
117
+ div.ps-toolbar-top
118
+ {
119
+ border-bottom: 1px solid #42403f;
120
+ border-top: none;
121
+ }
122
+
123
+ div.ps-toolbar-close, div.ps-toolbar-previous, div.ps-toolbar-next, div.ps-toolbar-play, div.ps-toolbar-descr
124
+ {
125
+ cursor: pointer;
126
+ display: table-cell;
127
+ vertical-align: middle;
128
+ }
129
+
130
+ div div.ps-toolbar-content
131
+ {
132
+ width: 44px;
133
+ height: 44px;
134
+ margin: 0 auto 0;
135
+ background-image: url(images/icons.png);
136
+ background-repeat: no-repeat;
137
+ display: block;
138
+ }
139
+
140
+ div.ps-toolbar-close div.ps-toolbar-content
141
+ {
142
+ background-position: 0 0;
143
+ }
144
+
145
+ div.ps-toolbar-previous div.ps-toolbar-content
146
+ {
147
+ background-position: -44px 0;
148
+ }
149
+
150
+ div.ps-toolbar-previous-disabled div.ps-toolbar-content
151
+ {
152
+ background-position: -44px -44px;
153
+ }
154
+
155
+ div.ps-toolbar-next div.ps-toolbar-content
156
+ {
157
+ background-position: -132px 0;
158
+ }
159
+
160
+ div.ps-toolbar-next-disabled div.ps-toolbar-content
161
+ {
162
+ background-position: -132px -44px;
163
+ }
164
+
165
+ div.ps-toolbar-play div.ps-toolbar-content
166
+ {
167
+ background-position: -88px 0;
168
+ }
169
+
170
+ div.ps-toolbar-descr div.ps-toolbar-content
171
+ {
172
+ background-position: -175px 0;
173
+ }
174
+ div.ps-toolbar-descr.disabled div.ps-toolbar-content
175
+ {
176
+ opacity:0.3;
177
+ }
178
+ div.ps-toolbar-descr.active div.ps-toolbar-content
179
+ {
180
+ background-position: -175px -44px;
181
+ }
182
+
183
+ /* Hi-res display */
184
+ @media only screen and (-webkit-min-device-pixel-ratio: 1.5),
185
+ only screen and (min--moz-device-pixel-ratio: 1.5),
186
+ only screen and (min-resolution: 240dpi)
187
+ {
188
+ div div.ps-toolbar-content
189
+ {
190
+ -moz-background-size: 220px 88px;
191
+ -o-background-size: 220px 88px;
192
+ -webkit-background-size: 220px 88px;
193
+ background-size: 220px 88px;
194
+ background-image: url(images/icons@2x.png);
195
+ }
196
+ }
admin/js/script.js ADDED
@@ -0,0 +1,278 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ var fv = swfobject.getFlashPlayerVersion();
2
+ var metaViewport = jQuery('meta[name=viewport]','head').attr('content');
3
+
4
+ function FlAGClass(ExtendVar, skin_id, pic_id, slideshow) {
5
+ jQuery(document).ready(function() {
6
+ if(pic_id !== false){
7
+ var skin_function = flagFind(skin_id);
8
+ if(pic_id !== 0 ) {
9
+ jQuery.fancybox(
10
+ {
11
+ 'showNavArrows' : false,
12
+ 'overlayShow' : true,
13
+ 'overlayOpacity': '0.9',
14
+ 'overlayColor' : '#000',
15
+ 'transitionIn' : 'elastic',
16
+ 'transitionOut' : 'elastic',
17
+ 'titlePosition' : 'over',
18
+ 'titleFormat' : function(title, currentArray, currentIndex, currentOpts) {
19
+ var descr = jQuery('<div />').html(jQuery("#flag_pic_"+pic_id, flag_alt[skin_id]).find('.flag_pic_desc > span').html()).text();
20
+ title = jQuery('<div />').html(jQuery("#flag_pic_"+pic_id, flag_alt[skin_id]).find('.flag_pic_desc > strong').html()).text();
21
+ if(title.length || descr.length)
22
+ 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>';
23
+ else
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>';
25
+ },
26
+ 'href' : jQuery("#flag_pic_"+pic_id, flag_alt[skin_id]).attr('href'),
27
+ 'onStart' : function(){
28
+ //if(skin_function && jQuery.isFunction(skin_function[skin_id+'_fb'])) {
29
+ skin_function[skin_id+'_fb']('active');
30
+ //}
31
+ jQuery('#fancybox-wrap').addClass('grand');
32
+ },
33
+ 'onClosed' : function(currentArray, currentIndex){
34
+ //if(skin_function && jQuery.isFunction(skin_function[skin_id+'_fb'])) {
35
+ skin_function[skin_id+'_fb']('close');
36
+ //}
37
+ jQuery('#fancybox-wrap').removeClass('grand');
38
+ },
39
+ 'onComplete' : function(currentArray, currentIndex) {
40
+ }
41
+ });
42
+ }
43
+ jQuery('#fancybox-wrap').on('click', '.grand_controls span', function(){
44
+ skin_function[skin_id+'_fb'](jQuery(this).attr('rel'));
45
+ if(jQuery(this).hasClass('g_slideshow')){
46
+ jQuery(this).toggleClass('play stop');
47
+ }
48
+ jQuery('#fancybox-wrap').off('click', '.grand_controls span');
49
+ });
50
+ } else {
51
+ if(!metaViewport && ExtendVar == 'photoswipe'){
52
+ jQuery('head').append('<meta content="width=device-width, initial-scale=1.0;" name="viewport" />');
53
+ }
54
+ jQuery('.flashalbum').css('height','auto');
55
+ jQuery('body#fullwindow').css('overflow','auto');
56
+ jQuery('.flag_alternate').each(function(i){
57
+ jQuery(this).show();
58
+ var catMeta = jQuery('.flagCatMeta',this).hide().get();
59
+ for(j=0; j<catMeta.length; j++) {
60
+ var catName = jQuery(catMeta[j]).find('h4').text();
61
+ var catDescr = jQuery(catMeta[j]).find('p').text();
62
+ var catId = jQuery(catMeta[j]).next('.flagcategory').attr('id');
63
+ var act = '';
64
+ if(j==0) act = ' active';
65
+ jQuery('.flagcatlinks',this).append('<a class="flagcat'+act+'" href="#'+catId+'" title="'+catDescr+'">'+catName+'</a>');
66
+ }
67
+ jQuery('a#backlink').appendTo('.flagcatlinks',this);
68
+ });
69
+ jQuery('.flag_alternate .flagcat').click(function(){
70
+ if(!jQuery(this).hasClass('active')) {
71
+ var catId = jQuery(this).attr('href');
72
+ jQuery(this).addClass('active').siblings().removeClass('active');
73
+ jQuery('.flag_alternate '+catId).show().siblings('.flagcategory').hide();
74
+ alternate_flag_e(catId, ExtendVar);
75
+ }
76
+ return false;
77
+ });
78
+ alternate_flag_e('.flagcategory:first', ExtendVar);
79
+ }
80
+ });
81
+ }
82
+
83
+ function alternate_flag_e(t, ExtendVar){
84
+ jQuery('.flag_alternate').find(t).not('.loaded').each(function(){
85
+ var d = jQuery(this).html();
86
+ if(d) {
87
+ d = d.replace(/\[/g, '<');
88
+ d = d.replace(/\]/g, ' />');
89
+ jQuery(this).addClass('loaded').html(d);
90
+ }
91
+ jQuery(this).show();
92
+ if(ExtendVar == 'photoswipe') {
93
+ var
94
+ showDescr, longDescription, imgdescr, psImgCaption, curel,
95
+ options = {
96
+ allowUserZoom:false,
97
+ captionAndToolbarAutoHideDelay:0,
98
+ captionAndToolbarHide:false,
99
+ captionAndToolbarShowEmptyCaptions:true,
100
+ zIndex:10000,
101
+ getToolbar: function(){
102
+ flagToolbar = window.Code.PhotoSwipe.Toolbar.getToolbar();
103
+ flagToolbar = flagToolbar + '<div class="ps-toolbar-descr"><div class="ps-toolbar-content"></div></div>';
104
+ return flagToolbar;
105
+ // NB. Calling PhotoSwipe.Toolbar.getToolbar() wil return the default toolbar HTML
106
+ },
107
+ getImageCaption: function(el){
108
+ psImgCaption = jQuery('<strong></strong>').addClass('ps-title').append(jQuery(el).attr('title'));
109
+ return psImgCaption;
110
+ },
111
+ getImageMetaData: function(el){
112
+ imgdescr = jQuery(el).find('span.flag_pic_desc > span:first').html();
113
+ if(imgdescr.length){
114
+ imgdescr = jQuery('<div></div>').append(imgdescr);
115
+ }
116
+ return {
117
+ longDescription: imgdescr
118
+ }
119
+
120
+ }
121
+ },
122
+ instance = jQuery('a.flag_pic_alt',this).photoSwipe(options);
123
+
124
+ // onBeforeShow - store a reference to our "say hi" button
125
+ instance.addEventHandler(window.Code.PhotoSwipe.EventTypes.onBeforeShow, function(e){
126
+ jQuery(window).scrollLeft(0).scrollTop(0);
127
+ jQuery('meta[name=viewport]').attr('content','width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0');
128
+ window.location.hash = '#OpenGallery';
129
+ });
130
+ // onShow - store a reference to our "say hi" button
131
+ instance.addEventHandler(window.Code.PhotoSwipe.EventTypes.onShow, function(e){
132
+ showDescr = window.document.querySelectorAll('.ps-toolbar-descr')[0];
133
+ });
134
+ // onBeforeHide - clean up
135
+ instance.addEventHandler(window.Code.PhotoSwipe.EventTypes.onBeforeHide, function(e){
136
+ showDescr = null;
137
+ });
138
+ // onHide - clean up
139
+ instance.addEventHandler(window.Code.PhotoSwipe.EventTypes.onHide, function(e){
140
+ if(!metaViewport){
141
+ jQuery('meta[name=viewport]').attr('content','width=device-width, initial-scale=1.0, minimum-scale=0.25, maximum-scale=1.6, user-scalable=1');
142
+ } else {
143
+ jQuery('meta[name=viewport]').attr('content',metaViewport);
144
+ }
145
+ window.location.hash = '#CloseGallery';
146
+ });
147
+ // onDisplayImage
148
+ instance.addEventHandler(window.Code.PhotoSwipe.EventTypes.onDisplayImage, function(e){
149
+ curel = instance.getCurrentImage();
150
+ var curid = curel.refObj.id;
151
+ curid = curid.replace('flag_pic_','');
152
+ jQuery.post(hitajax, { hit: curid }, function(r){ console.log(r); });
153
+ if(curel.metaData.longDescription){
154
+ jQuery('.ps-caption-content').append(jQuery('<div></div>').addClass('ps-long-description').html(jQuery(curel.metaData.longDescription).text()).hide());
155
+ jQuery('.ps-toolbar-descr').removeClass('disabled active').addClass('enabled');
156
+ } else {
157
+ jQuery('.ps-toolbar-descr').removeClass('enabled active').addClass('disabled');
158
+ }
159
+ });
160
+ // onSlideshowStart
161
+ instance.addEventHandler(window.Code.PhotoSwipe.EventTypes.onCaptionAndToolbarShow, function(e){
162
+ curel = instance.getCurrentImage();
163
+ if(curel.metaData.longDescription){
164
+ jQuery('.ps-caption-content').append(jQuery('<div></div>').addClass('ps-long-description').html(jQuery(curel.metaData.longDescription).text()).hide());
165
+ jQuery('.ps-toolbar-descr').removeClass('disabled active').addClass('enabled');
166
+ } else {
167
+ jQuery('.ps-toolbar-descr').removeClass('enabled active').addClass('disabled');
168
+ }
169
+ });
170
+ // onToolbarTap - listen out for when the toolbar is tapped
171
+ instance.addEventHandler(window.Code.PhotoSwipe.EventTypes.onToolbarTap, function(e){
172
+ if (e.toolbarAction === window.Code.PhotoSwipe.Toolbar.ToolbarAction.none){
173
+ if (e.tapTarget === showDescr || window.Code.Util.DOM.isChildOf(e.tapTarget, showDescr)){
174
+ if(jQuery(showDescr).hasClass('enabled')){
175
+ jQuery('.ps-toolbar-descr').toggleClass('active');
176
+ jQuery('.ps-long-description').slideToggle(400);
177
+ }
178
+ }
179
+ }
180
+ });
181
+ } else if(ExtendVar == 'fancybox'){
182
+ jQuery('a.flag_pic_alt',this).fancybox({
183
+ 'overlayShow' : true,
184
+ 'overlayOpacity': '0.5',
185
+ 'transitionIn' : 'elastic',
186
+ 'transitionOut' : 'elastic',
187
+ 'titlePosition' : 'over',
188
+ 'titleFormat' : function(title, currentArray, currentIndex, currentOpts) {
189
+ var descr = jQuery('<div />').html(jQuery('.flag_pic_desc > span', currentArray[currentIndex]).html()).text();
190
+ title = jQuery('<div />').html(jQuery('.flag_pic_desc > strong', currentArray[currentIndex]).html()).text();
191
+ 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>';
192
+ },
193
+ 'onClosed' : function(currentArray, currentIndex){
194
+ jQuery(currentArray[currentIndex]).removeClass('current').addClass('last');
195
+ },
196
+ 'onComplete' : function(currentArray, currentIndex) {
197
+ jQuery(currentArray).removeClass('current last');
198
+ jQuery(currentArray[currentIndex]).addClass('current');
199
+ var curid = jQuery(currentArray[currentIndex]).attr('id');
200
+ curid = curid.replace('flag_pic_','');
201
+ jQuery.post(hitajax, { hit: curid }, function(r){ console.log(r); });
202
+ }
203
+ });
204
+ }
205
+
206
+ });
207
+ }
208
+ if(fv.major<10 || (navigator.userAgent.toLowerCase().indexOf("android") > -1)) {
209
+ new FlAGClass(ExtendVar, false, false, false);
210
+ }
211
+ function thumb_cl(skin_id, pic_id, slideshow){
212
+ pic_id = parseInt(pic_id);
213
+ new FlAGClass(ExtendVar, skin_id, pic_id, slideshow);
214
+ }
215
+
216
+ /*jQuery(document).ready(function() {
217
+ jQuery('div.flashalbum').dblclick(function(e){
218
+ if(e.target.tagName == 'IMG' || e.target.tagName == 'A') return;
219
+ if(jQuery('body').hasClass('FlAG')){
220
+ unhideSite(this, jQuery(this).attr('data-height'), jQuery(this).attr('data-scrolltop'));
221
+ } else {
222
+ jQuery(this).attr('data-height',jQuery(this).height()).attr('data-scrolltop',jQuery(window).scrollTop());
223
+ hideSite(this);
224
+ }
225
+ });
226
+ });*/
227
+ function enlargeFlAG(t){
228
+ var pleft = jQuery(t).offset().left - jQuery(window).scrollLeft();
229
+ var pheight = jQuery(window).height();
230
+ jQuery(t).css({left:-pleft,top:0,width:'100%',height:pheight+'px'});
231
+ }
232
+ function unlargeFlAG(t, hFA, sst){
233
+ jQuery(t).css({left:0,top:0,width:'100%',height:hFA+'px'});
234
+ jQuery(window).scrollTop(sst);
235
+ }
236
+ function hideSite(t){
237
+ jQuery('body').addClass('FlAG');
238
+ jQuery(t).parents('div').addClass('FlAGz').each(function(){
239
+ if(jQuery(this).attr('style')){
240
+ jQuery(this).attr('data-elstyle',jQuery(this).attr('style')).css({zIndex:100,width:'100%',maxWidth:'100%',height:'auto',padding:0,margin:0,border:'none'});
241
+ } else {
242
+ jQuery(this).css({zIndex:100,width:'100%',maxWidth:'100%',height:'auto',padding:0,margin:0,border:'none'});
243
+ }
244
+ });
245
+ jQuery(t).siblings().not('script, link, style, head').addClass('FlAGd').each(function(){
246
+ if(jQuery(this).attr('style')){
247
+ 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});
248
+ } else {
249
+ jQuery(this).css({visibility:'hidden',height:0,minHeight:0,padding:0,margin:'0 0 0 -10000px',border:'none',fontSize:0,lineHeight:0});
250
+ }
251
+ });
252
+ jQuery(t).parents().siblings().not('script, link, style, head').addClass('FlAGd').each(function(){
253
+ if(jQuery(this).attr('style')){
254
+ 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});
255
+ } else {
256
+ jQuery(this).css({visibility:'hidden',height:0,minHeight:0,maxHeight:0,padding:0,margin:'0 0 0 -10000px',border:'none',fontSize:0,lineHeight:0});
257
+ }
258
+ });
259
+ enlargeFlAG(t);
260
+ }
261
+ function unhideSite(t, hFA, sst){
262
+ jQuery('body').removeClass('FlAG');
263
+ jQuery(t).parents('div').removeClass('FlAGz').each(function(i){
264
+ if(jQuery(this).attr('data-elstyle')){
265
+ jQuery(this).attr('style',jQuery(this).attr('data-elstyle')).removeAttr('data-elstyle');
266
+ } else {
267
+ jQuery(this).removeAttr('style');
268
+ }
269
+ });
270
+ jQuery('.FlAGd').each(function(){
271
+ if(jQuery(this).attr('data-elstyle')){
272
+ jQuery(this).attr('style',jQuery(this).attr('data-elstyle')).removeAttr('data-elstyle').removeClass('FlAGd');
273
+ } else {
274
+ jQuery(this).removeAttr('style').removeClass('FlAGd');
275
+ }
276
+ });
277
+ unlargeFlAG(t, hFA, sst);
278
+ }
admin/js/swfaddress-optimizer.js ADDED
@@ -0,0 +1 @@
 
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
  */
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
  */
admin/js/swfaddress.js ADDED
@@ -0,0 +1 @@
 
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
  */
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
  */
admin/js/swfmousewheel.js ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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/swfupload.handler.js ADDED
@@ -0,0 +1,153 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Flash Album Gallery - SWFUpload Handler
3
+ *
4
+ * Built on top of the swfupload library
5
+ * http://swfupload.org version 2.2.0
6
+ *
7
+ */
8
+
9
+ // on load change the upload to swfupload
10
+ function initSWFUpload() {
11
+ jQuery(function() {
12
+ jQuery("#uploadimage_btn").after("<input class='button-primary' type='button' name='uploadimage' id='swfupload_btn' value='" + flag_swf_upload.customSettings.upload + "' />")
13
+ .remove();
14
+ jQuery("#swfupload_btn").click( function() { submitFiles(); } );
15
+ jQuery("#imagefiles")
16
+ .after("<div id='uploadQueue'></div>")
17
+ .after("<input id='imagefiles' type='button' class='button-secondary uploadform' value='" + flag_swf_upload.customSettings.browse + "' />")
18
+ .after("<input type='text' id='txtFileName' readonly='readonly' />")
19
+ .remove();
20
+ jQuery("#imagefiles").click( function() { fileBrowse(); } );
21
+ jQuery("#progressbar-wrap").hide();
22
+ });
23
+ }
24
+
25
+ // call the upload dialog
26
+ function fileBrowse() {
27
+ jQuery("#txtFileName").val("");
28
+ flag_swf_upload.cancelUpload();
29
+ flag_swf_upload.selectFiles();
30
+ }
31
+
32
+ // called when a file is added
33
+ function fileQueued(fileObj) {
34
+ filesize = " (" + Math.round(fileObj.size/1024) + " kB) ";
35
+ jQuery("#txtFileName").val(fileObj.name);
36
+ jQuery("#uploadQueue")
37
+ .append("<div id='" + fileObj.id + "' class='flagUploadItem'> [<a href='javascript:removeFile(\"" + fileObj.id + "\");'>" + flag_swf_upload.customSettings.remove + "</a>] " + fileObj.name + filesize + "</div>")
38
+ .children("div:last").slideDown("slow")
39
+ .end();
40
+ }
41
+
42
+ // start the upload
43
+ function submitFiles() {
44
+ // check if a gallery is selected
45
+ if (jQuery('#galleryselect').val() > "0") {
46
+ jQuery("#progressbar-wrap").show();
47
+ // get old post_params
48
+ post_params = flag_swf_upload.getSetting("post_params");
49
+ // update the selected gallery in the post_params
50
+ post_params['galleryselect'] = jQuery('#galleryselect').val();
51
+ flag_swf_upload.setPostParams(post_params);
52
+ flag_swf_upload.startUpload();
53
+ } else {
54
+ jQuery('#uploadimage_form').prepend("<input type=\"hidden\" name=\"swf_callback\" value=\"-1\">");
55
+ jQuery("#uploadimage_form").submit();
56
+ }
57
+ }
58
+
59
+ // called when a file will be removed
60
+ function removeFile(fileID) {
61
+ flag_swf_upload.cancelUpload(fileID);
62
+ jQuery("#" + fileID).hide("slow");
63
+ jQuery("#" + fileID).remove();
64
+ }
65
+
66
+ // called before the uploads start
67
+ function uploadStart(fileObj) {
68
+ jQuery("#progressbar span").text("0% - " + fileObj.name);
69
+ return true;
70
+ }
71
+
72
+ // called during the upload progress
73
+ function uploadProgress(fileObj, bytesLoaded) {
74
+ var percent = Math.ceil((bytesLoaded / fileObj.size) * 100);
75
+ jQuery("#progressbar").css("width", percent + "%");
76
+ jQuery("#progressbar span").text(percent + "% - " + fileObj.name);
77
+ }
78
+
79
+ // called when the file is uploaded
80
+ function uploadComplete(fileObj) {
81
+ jQuery("#" + fileObj.id).hide("slow");
82
+ jQuery("#" + fileObj.id).remove();
83
+ if ( flag_swf_upload.getStats().files_queued == 0) {
84
+ jQuery("#progressbar-wrap").hide()
85
+ jQuery("#uploadimage_form").submit();
86
+ }
87
+ }
88
+
89
+ // called when all files are uploaded
90
+ function uploadSuccess(fileObj, server_data) {
91
+ // Show any error message
92
+ if (server_data != 0){
93
+ jQuery("#progressbar-wrap").append("<div><strong>ERROR</strong>: " + fileObj.name + " : " + server_data + "</div>");
94
+ }
95
+ // Upload the next file until queue is empty
96
+ if ( flag_swf_upload.getStats().files_queued > 0) {
97
+ flag_swf_upload.startUpload();
98
+ } else {
99
+ // server_data could be add as hidden field
100
+ jQuery('#uploadimage_form').prepend("<input type=\"hidden\" name=\"swf_callback\" value=\"" + server_data + "\">");
101
+ }
102
+ }
103
+
104
+ // called on error
105
+ function uploadError(fileObj, error_code, message) {
106
+ var error_name = "";
107
+ switch(error_code) {
108
+ case SWFUpload.UPLOAD_ERROR.HTTP_ERROR:
109
+ error_name = "HTTP ERROR";
110
+ break;
111
+ case SWFUpload.UPLOAD_ERROR.MISSING_UPLOAD_URL:
112
+ error_name = "MISSING UPLOAD URL";
113
+ break;
114
+ case SWFUpload.UPLOAD_ERROR.IO_ERROR:
115
+ error_name = "IO FAILURE";
116
+ break;
117
+ case SWFUpload.UPLOAD_ERROR.SECURITY_ERROR:
118
+ error_name = "SECURITY ERROR";
119
+ break;
120
+ case SWFUpload.UPLOAD_ERROR.UPLOAD_LIMIT_EXCEEDED:
121
+ error_name = "UPLOAD LIMIT EXCEEDED";
122
+ break;
123
+ case SWFUpload.UPLOAD_ERROR.UPLOAD_FAILED:
124
+ error_name = "UPLOAD FAILED";
125
+ break;
126
+ case SWFUpload.UPLOAD_ERROR.SPECIFIED_FILE_ID_NOT_FOUND:
127
+ error_name = "SPECIFIED FILE ID NOT FOUND";
128
+ break;
129
+ case SWFUpload.UPLOAD_ERROR.FILE_VALIDATION_FAILED:
130
+ error_name = "FILE VALIDATION FAILED";
131
+ break;
132
+ case SWFUpload.UPLOAD_ERROR.FILE_CANCELLED:
133
+ error_name = "FILE CANCELLED";
134
+ return;
135
+ break;
136
+ case SWFUpload.UPLOAD_ERROR.UPLOAD_STOPPED:
137
+ error_name = "FILE STOPPED";
138
+ break;
139
+ default:
140
+ error_name = "UNKNOWN";
141
+ break;
142
+ }
143
+ jQuery("#progressbar-wrap").append("<div><strong>ERROR " + error_name + " </strong>: " + fileObj.name + " : " + message + "</div>");
144
+ jQuery("#" + fileObj.id).hide("slow");
145
+ jQuery("#" + fileObj.id).remove();
146
+ if ( flag_swf_upload.getStats().files_queued > 0) {
147
+ flag_swf_upload.startUpload();
148
+ } else {
149
+ jQuery("#progressbar-wrap").hide()
150
+ jQuery('#uploadimage_form').prepend("<input type=\"hidden\" name=\"swf_callback\" value=\"" + error_name + "\">");
151
+ jQuery("#uploadimage_form").submit();
152
+ }
153
+ }
admin/js/swfupload.js ADDED
@@ -0,0 +1,986 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * SWFUpload: http://www.swfupload.org, http://swfupload.googlecode.com
3
+ *
4
+ * mmSWFUpload 1.0: Flash upload dialog - http://profandesign.se/swfupload/, http://www.vinterwebb.se/
5
+ *
6
+ * SWFUpload is (c) 2006-2007 Lars Huring, Olov Nilz�n and Mammon Media and is released under the MIT License:
7
+ * http://www.opensource.org/licenses/mit-license.php
8
+ *
9
+ * SWFUpload 2 is (c) 2007-2008 Jake Roberts and is released under the MIT License:
10
+ * http://www.opensource.org/licenses/mit-license.php
11
+ *
12
+ */
13
+
14
+
15
+ /* ******************* */
16
+ /* Constructor & Init */
17
+ /* ******************* */
18
+ var SWFUpload;
19
+
20
+ if (SWFUpload == undefined) {
21
+ SWFUpload = function (settings) {
22
+ this.initSWFUpload(settings);
23
+ };
24
+ }
25
+
26
+ SWFUpload.prototype.initSWFUpload = function (settings) {
27
+ try {
28
+ this.customSettings = {}; // A container where developers can place their own settings associated with this instance.
29
+ this.settings = settings;
30
+ this.eventQueue = [];
31
+ this.movieName = "SWFUpload_" + SWFUpload.movieCount++;
32
+ this.movieElement = null;
33
+
34
+
35
+ // Setup global control tracking
36
+ SWFUpload.instances[this.movieName] = this;
37
+
38
+ // Load the settings. Load the Flash movie.
39
+ this.initSettings();
40
+ this.loadFlash();
41
+ this.displayDebugInfo();
42
+ } catch (ex) {
43
+ delete SWFUpload.instances[this.movieName];
44
+ throw ex;
45
+ }
46
+ };
47
+
48
+ /* *************** */
49
+ /* Static Members */
50
+ /* *************** */
51
+ SWFUpload.instances = {};
52
+ SWFUpload.movieCount = 0;
53
+ SWFUpload.version = "2.2.0 2009-03-25";
54
+ SWFUpload.QUEUE_ERROR = {
55
+ QUEUE_LIMIT_EXCEEDED : -100,
56
+ FILE_EXCEEDS_SIZE_LIMIT : -110,
57
+ ZERO_BYTE_FILE : -120,
58
+ INVALID_FILETYPE : -130
59
+ };
60
+ SWFUpload.UPLOAD_ERROR = {
61
+ HTTP_ERROR : -200,
62
+ MISSING_UPLOAD_URL : -210,
63
+ IO_ERROR : -220,
64
+ SECURITY_ERROR : -230,
65
+ UPLOAD_LIMIT_EXCEEDED : -240,
66
+ UPLOAD_FAILED : -250,
67
+ SPECIFIED_FILE_ID_NOT_FOUND : -260,
68
+ FILE_VALIDATION_FAILED : -270,
69
+ FILE_CANCELLED : -280,
70
+ UPLOAD_STOPPED : -290
71
+ };
72
+ SWFUpload.FILE_STATUS = {
73
+ QUEUED : -1,
74
+ IN_PROGRESS : -2,
75
+ ERROR : -3,
76
+ COMPLETE : -4,
77
+ CANCELLED : -5
78
+ };
79
+ SWFUpload.BUTTON_ACTION = {
80
+ SELECT_FILE : -100,
81
+ SELECT_FILES : -110,
82
+ START_UPLOAD : -120
83
+ };
84
+ SWFUpload.CURSOR = {
85
+ ARROW : -1,
86
+ HAND : -2
87
+ };
88
+ SWFUpload.WINDOW_MODE = {
89
+ WINDOW : "window",
90
+ TRANSPARENT : "transparent",
91
+ OPAQUE : "opaque"
92
+ };
93
+
94
+ // Private: takes a URL, determines if it is relative and converts to an absolute URL
95
+ // using the current site. Only processes the URL if it can, otherwise returns the URL untouched
96
+ SWFUpload.completeURL = function(url) {
97
+ if (typeof(url) !== "string" || url.match(/^https?:\/\//i) || url.match(/^\//)) {
98
+ return url;
99
+ }
100
+
101
+ var currentURL = window.location.protocol + "//" + window.location.hostname + (window.location.port ? ":" + window.location.port : "");
102
+
103
+ var indexSlash = window.location.pathname.lastIndexOf("/");
104
+ if (indexSlash <= 0) {
105
+ path = "/";
106
+ } else {
107
+ path = window.location.pathname.substr(0, indexSlash) + "/";
108
+ }
109
+
110
+ return /*currentURL +*/ path + url;
111
+
112
+ };
113
+
114
+
115
+ /* ******************** */
116
+ /* Instance Members */
117
+ /* ******************** */
118
+
119
+ // Private: initSettings ensures that all the
120
+ // settings are set, getting a default value if one was not assigned.
121
+ SWFUpload.prototype.initSettings = function () {
122
+ this.ensureDefault = function (settingName, defaultValue) {
123
+ this.settings[settingName] = (this.settings[settingName] == undefined) ? defaultValue : this.settings[settingName];
124
+ };
125
+
126
+ // Upload backend settings
127
+ this.ensureDefault("upload_url", "");
128
+ this.ensureDefault("preserve_relative_urls", false);
129
+ this.ensureDefault("file_post_name", "Filedata");
130
+ this.ensureDefault("post_params", {});
131
+ this.ensureDefault("use_query_string", false);
132
+ this.ensureDefault("requeue_on_error", false);
133
+ this.ensureDefault("http_success", []);
134
+ this.ensureDefault("assume_success_timeout", 0);
135
+
136
+ // File Settings
137
+ this.ensureDefault("file_types", "*.*");
138
+ this.ensureDefault("file_types_description", "All Files");
139
+ this.ensureDefault("file_size_limit", 0); // Default zero means "unlimited"
140
+ this.ensureDefault("file_upload_limit", 0);
141
+ this.ensureDefault("file_queue_limit", 0);
142
+
143
+ // Flash Settings
144
+ this.ensureDefault("flash_url", "swfupload.swf");
145
+ this.ensureDefault("prevent_swf_caching", true);
146
+
147
+ // Button Settings
148
+ this.ensureDefault("button_image_url", "");
149
+ this.ensureDefault("button_width", 1);
150
+ this.ensureDefault("button_height", 1);
151
+ this.ensureDefault("button_text", "");
152
+ this.ensureDefault("button_text_style", "color: #000000; font-size: 16pt;");
153
+ this.ensureDefault("button_text_top_padding", 0);
154
+ this.ensureDefault("button_text_left_padding", 0);
155
+ this.ensureDefault("button_action", SWFUpload.BUTTON_ACTION.SELECT_FILES);
156
+ this.ensureDefault("button_disabled", false);
157
+ this.ensureDefault("button_placeholder_id", "");
158
+ this.ensureDefault("button_placeholder", null);
159
+ this.ensureDefault("button_cursor", SWFUpload.CURSOR.ARROW);
160
+ this.ensureDefault("button_window_mode", SWFUpload.WINDOW_MODE.WINDOW);
161
+
162
+ // Debug Settings
163
+ this.ensureDefault("debug", false);
164
+ this.settings.debug_enabled = this.settings.debug; // Here to maintain v2 API
165
+
166
+ // Event Handlers
167
+ this.settings.return_upload_start_handler = this.returnUploadStart;
168
+ this.ensureDefault("swfupload_loaded_handler", null);
169
+ this.ensureDefault("file_dialog_start_handler", null);
170
+ this.ensureDefault("file_queued_handler", null);
171
+ this.ensureDefault("file_queue_error_handler", null);
172
+ this.ensureDefault("file_dialog_complete_handler", null);
173
+
174
+ this.ensureDefault("upload_start_handler", null);
175
+ this.ensureDefault("upload_progress_handler", null);
176
+ this.ensureDefault("upload_error_handler", null);
177
+ this.ensureDefault("upload_success_handler", null);
178
+ this.ensureDefault("upload_complete_handler", null);
179
+
180
+ this.ensureDefault("debug_handler", this.debugMessage);
181
+
182
+ this.ensureDefault("custom_settings", {});
183
+
184
+ // Other settings
185
+ this.customSettings = this.settings.custom_settings;
186
+
187
+ // Update the flash url if needed
188
+ if (!!this.settings.prevent_swf_caching) {
189
+ this.settings.flash_url = this.settings.flash_url + (this.settings.flash_url.indexOf("?") < 0 ? "?" : "&") + "preventswfcaching=" + new Date().getTime();
190
+ }
191
+
192
+ if (!this.settings.preserve_relative_urls) {
193
+ //this.settings.flash_url = SWFUpload.completeURL(this.settings.flash_url); // Don't need to do this one since flash doesn't look at it
194
+ this.settings.upload_url = SWFUpload.completeURL(this.settings.upload_url);
195
+ this.settings.button_image_url = SWFUpload.completeURL(this.settings.button_image_url);
196
+ }
197
+
198
+ delete this.ensureDefault;
199
+ };
200
+
201
+ // Private: loadFlash replaces the button_placeholder element with the flash movie.
202
+ SWFUpload.prototype.loadFlash = function () {
203
+ var targetElement, tempParent;
204
+
205
+ // Make sure an element with the ID we are going to use doesn't already exist
206
+ if (document.getElementById(this.movieName) !== null) {
207
+ throw "ID " + this.movieName + " is already in use. The Flash Object could not be added";
208
+ }
209
+
210
+ // Get the element where we will be placing the flash movie
211
+ targetElement = document.getElementById(this.settings.button_placeholder_id) || this.settings.button_placeholder;
212
+
213
+ if (targetElement == undefined) {
214
+ throw "Could not find the placeholder element: " + this.settings.button_placeholder_id;
215
+ }
216
+
217
+ // Append the container and load the flash
218
+ tempParent = document.createElement("div");
219
+ tempParent.innerHTML = this.getFlashHTML(); // Using innerHTML is non-standard but the only sensible way to dynamically add Flash in IE (and maybe other browsers)
220
+ targetElement.parentNode.replaceChild(tempParent.firstChild, targetElement);
221
+
222
+ // Fix IE Flash/Form bug
223
+ if (window[this.movieName] == undefined) {
224
+ window[this.movieName] = this.getMovieElement();
225
+ }
226
+
227
+ };
228
+
229
+ // Private: getFlashHTML generates the object tag needed to embed the flash in to the document
230
+ SWFUpload.prototype.getFlashHTML = function () {
231
+ // Flash Satay object syntax: http://www.alistapart.com/articles/flashsatay
232
+ return ['<object id="', this.movieName, '" type="application/x-shockwave-flash" data="', this.settings.flash_url, '" width="', this.settings.button_width, '" height="', this.settings.button_height, '" class="swfupload">',
233
+ '<param name="wmode" value="', this.settings.button_window_mode, '" />',
234
+ '<param name="movie" value="', this.settings.flash_url, '" />',
235
+ '<param name="quality" value="high" />',
236
+ '<param name="menu" value="false" />',
237
+ '<param name="allowScriptAccess" value="always" />',
238
+ '<param name="flashvars" value="' + this.getFlashVars() + '" />',
239
+ '</object>'].join("");
240
+ };
241
+
242
+ // Private: getFlashVars builds the parameter string that will be passed
243
+ // to flash in the flashvars param.
244
+ SWFUpload.prototype.getFlashVars = function () {
245
+ // Build a string from the post param object
246
+ var paramString = this.buildParamString();
247
+ var httpSuccessString = this.settings.http_success.join(",");
248
+
249
+ // Build the parameter string
250
+ return ["movieName=", encodeURIComponent(this.movieName),
251
+ "&amp;uploadURL=", encodeURIComponent(this.settings.upload_url),
252
+ "&amp;useQueryString=", encodeURIComponent(this.settings.use_query_string),
253
+ "&amp;requeueOnError=", encodeURIComponent(this.settings.requeue_on_error),
254
+ "&amp;httpSuccess=", encodeURIComponent(httpSuccessString),
255
+ "&amp;assumeSuccessTimeout=", encodeURIComponent(this.settings.assume_success_timeout),
256
+ "&amp;params=", encodeURIComponent(paramString),
257
+ "&amp;filePostName=", encodeURIComponent(this.settings.file_post_name),
258
+ "&amp;fileTypes=", encodeURIComponent(this.settings.file_types),
259
+ "&amp;fileTypesDescription=", encodeURIComponent(this.settings.file_types_description),
260
+ "&amp;fileSizeLimit=", encodeURIComponent(this.settings.file_size_limit),
261
+ "&amp;fileUploadLimit=", encodeURIComponent(this.settings.file_upload_limit),
262
+ "&amp;fileQueueLimit=", encodeURIComponent(this.settings.file_queue_limit),
263
+ "&amp;debugEnabled=", encodeURIComponent(this.settings.debug_enabled),
264
+ "&amp;buttonImageURL=", encodeURIComponent(this.settings.button_image_url),
265
+ "&amp;buttonWidth=", encodeURIComponent(this.settings.button_width),
266
+ "&amp;buttonHeight=", encodeURIComponent(this.settings.button_height),
267
+ "&amp;buttonText=", encodeURIComponent(this.settings.button_text),
268
+ "&amp;buttonTextTopPadding=", encodeURIComponent(this.settings.button_text_top_padding),
269
+ "&amp;buttonTextLeftPadding=", encodeURIComponent(this.settings.button_text_left_padding),
270
+ "&amp;buttonTextStyle=", encodeURIComponent(this.settings.button_text_style),
271
+ "&amp;buttonAction=", encodeURIComponent(this.settings.button_action),
272
+ "&amp;buttonDisabled=", encodeURIComponent(this.settings.button_disabled),
273
+ "&amp;buttonCursor=", encodeURIComponent(this.settings.button_cursor)
274
+ ].join("");
275
+ };
276
+
277
+ // Public: getMovieElement retrieves the DOM reference to the Flash element added by SWFUpload
278
+ // The element is cached after the first lookup
279
+ SWFUpload.prototype.getMovieElement = function () {
280
+ if (this.movieElement == undefined) {
281
+ this.movieElement = document.getElementById(this.movieName);
282
+ }
283
+
284
+ if (this.movieElement === null) {
285
+ throw "Could not find Flash element";
286
+ }
287
+
288
+ return this.movieElement;
289
+ };
290
+
291
+ // Private: buildParamString takes the name/value pairs in the post_params setting object
292
+ // and joins them up in to a string formatted "name=value&amp;name=value"
293
+ SWFUpload.prototype.buildParamString = function () {
294
+ var postParams = this.settings.post_params;
295
+ var paramStringPairs = [];
296
+
297
+ if (typeof(postParams) === "object") {
298
+ for (var name in postParams) {
299
+ if (postParams.hasOwnProperty(name)) {
300
+ paramStringPairs.push(encodeURIComponent(name.toString()) + "=" + encodeURIComponent(postParams[name].toString()));
301
+ }
302
+ }
303
+ }
304
+
305
+ return paramStringPairs.join("&amp;");
306
+ };
307
+
308
+ // Public: Used to remove a SWFUpload instance from the page. This method strives to remove
309
+ // all references to the SWF, and other objects so memory is properly freed.
310
+ // Returns true if everything was destroyed. Returns a false if a failure occurs leaving SWFUpload in an inconsistant state.
311
+ // Credits: Major improvements provided by steffen
312
+ SWFUpload.prototype.destroy = function () {
313
+ try {
314
+ // Make sure Flash is done before we try to remove it
315
+ this.cancelUpload(null, false);
316
+
317
+
318
+ // Remove the SWFUpload DOM nodes
319
+ var movieElement = null;
320
+ movieElement = this.getMovieElement();
321
+
322
+ if (movieElement && typeof(movieElement.CallFunction) === "unknown") { // We only want to do this in IE
323
+ // Loop through all the movie's properties and remove all function references (DOM/JS IE 6/7 memory leak workaround)
324
+ for (var i in movieElement) {
325
+ try {
326
+ if (typeof(movieElement[i]) === "function") {
327
+ movieElement[i] = null;
328
+ }
329
+ } catch (ex1) {}
330
+ }
331
+
332
+ // Remove the Movie Element from the page
333
+ try {
334
+ movieElement.parentNode.removeChild(movieElement);
335
+ } catch (ex) {}
336
+ }
337
+
338
+ // Remove IE form fix reference
339
+ window[this.movieName] = null;
340
+
341
+ // Destroy other references
342
+ SWFUpload.instances[this.movieName] = null;
343
+ delete SWFUpload.instances[this.movieName];
344
+
345
+ this.movieElement = null;
346
+ this.settings = null;
347
+ this.customSettings = null;
348
+ this.eventQueue = null;
349
+ this.movieName = null;
350
+
351
+
352
+ return true;
353
+ } catch (ex2) {
354
+ return false;
355
+ }
356
+ };
357
+
358
+
359
+ // Public: displayDebugInfo prints out settings and configuration
360
+ // information about this SWFUpload instance.
361
+ // This function (and any references to it) can be deleted when placing
362
+ // SWFUpload in production.
363
+ SWFUpload.prototype.displayDebugInfo = function () {
364
+ this.debug(
365
+ [
366
+ "---SWFUpload Instance Info---\n",
367
+ "Version: ", SWFUpload.version, "\n",
368
+ "Movie Name: ", this.movieName, "\n",
369
+ "Settings:\n",
370
+ "\t", "upload_url: ", this.settings.upload_url, "\n",
371
+ "\t", "flash_url: ", this.settings.flash_url, "\n",
372
+ "\t", "use_query_string: ", this.settings.use_query_string.toString(), "\n",
373
+ "\t", "requeue_on_error: ", this.settings.requeue_on_error.toString(), "\n",
374
+ "\t", "http_success: ", this.settings.http_success.join(", "), "\n",
375
+ "\t", "assume_success_timeout: ", this.settings.assume_success_timeout, "\n",
376
+ "\t", "file_post_name: ", this.settings.file_post_name, "\n",
377
+ "\t", "post_params: ", this.settings.post_params.toString(), "\n",
378
+ "\t", "file_types: ", this.settings.file_types, "\n",
379
+ "\t", "file_types_description: ", this.settings.file_types_description, "\n",
380
+ "\t", "file_size_limit: ", this.settings.file_size_limit, "\n",
381
+ "\t", "file_upload_limit: ", this.settings.file_upload_limit, "\n",
382
+ "\t", "file_queue_limit: ", this.settings.file_queue_limit, "\n",
383
+ "\t", "debug: ", this.settings.debug.toString(), "\n",
384
+
385
+ "\t", "prevent_swf_caching: ", this.settings.prevent_swf_caching.toString(), "\n",
386
+
387
+ "\t", "button_placeholder_id: ", this.settings.button_placeholder_id.toString(), "\n",
388
+ "\t", "button_placeholder: ", (this.settings.button_placeholder ? "Set" : "Not Set"), "\n",
389
+ "\t", "button_image_url: ", this.settings.button_image_url.toString(), "\n",
390
+ "\t", "button_width: ", this.settings.button_width.toString(), "\n",
391
+ "\t", "button_height: ", this.settings.button_height.toString(), "\n",
392
+ "\t", "button_text: ", this.settings.button_text.toString(), "\n",
393
+ "\t", "button_text_style: ", this.settings.button_text_style.toString(), "\n",
394
+ "\t", "button_text_top_padding: ", this.settings.button_text_top_padding.toString(), "\n",
395
+ "\t", "button_text_left_padding: ", this.settings.button_text_left_padding.toString(), "\n",
396
+ "\t", "button_action: ", this.settings.button_action.toString(), "\n",
397
+ "\t", "button_disabled: ", this.settings.button_disabled.toString(), "\n",
398
+
399
+ "\t", "custom_settings: ", this.settings.custom_settings.toString(), "\n",
400
+ "Event Handlers:\n",
401
+ "\t", "swfupload_loaded_handler assigned: ", (typeof this.settings.swfupload_loaded_handler === "function").toString(), "\n",
402
+ "\t", "file_dialog_start_handler assigned: ", (typeof this.settings.file_dialog_start_handler === "function").toString(), "\n",
403
+ "\t", "file_queued_handler assigned: ", (typeof this.settings.file_queued_handler === "function").toString(), "\n",
404
+ "\t", "file_queue_error_handler assigned: ", (typeof this.settings.file_queue_error_handler === "function").toString(), "\n",
405
+ "\t", "upload_start_handler assigned: ", (typeof this.settings.upload_start_handler === "function").toString(), "\n",
406
+ "\t", "upload_progress_handler assigned: ", (typeof this.settings.upload_progress_handler === "function").toString(), "\n",
407
+ "\t", "upload_error_handler assigned: ", (typeof this.settings.upload_error_handler === "function").toString(), "\n",
408
+ "\t", "upload_success_handler assigned: ", (typeof this.settings.upload_success_handler === "function").toString(), "\n",
409
+ "\t", "upload_complete_handler assigned: ", (typeof this.settings.upload_complete_handler === "function").toString(), "\n",
410
+ "\t", "debug_handler assigned: ", (typeof this.settings.debug_handler === "function").toString(), "\n"
411
+ ].join("")
412
+ );
413
+ };
414
+
415
+ /* Note: addSetting and getSetting are no longer used by SWFUpload but are included
416
+ the maintain v2 API compatibility
417
+ */
418
+ // Public: (Deprecated) addSetting adds a setting value. If the value given is undefined or null then the default_value is used.
419
+ SWFUpload.prototype.addSetting = function (name, value, default_value) {
420
+ if (value == undefined) {
421
+ return (this.settings[name] = default_value);
422
+ } else {
423
+ return (this.settings[name] = value);
424
+ }
425
+ };
426
+
427
+ // Public: (Deprecated) getSetting gets a setting. Returns an empty string if the setting was not found.
428
+ SWFUpload.prototype.getSetting = function (name) {
429
+ if (this.settings[name] != undefined) {
430
+ return this.settings[name];
431
+ }
432
+
433
+ return "";
434
+ };
435
+
436
+
437
+
438
+ // Private: callFlash handles function calls made to the Flash element.
439
+ // Calls are made with a setTimeout for some functions to work around
440
+ // bugs in the ExternalInterface library.
441
+ SWFUpload.prototype.callFlash = function (functionName, argumentArray) {
442
+ argumentArray = argumentArray || [];
443
+
444
+ var movieElement = this.getMovieElement();
445
+ var returnValue, returnString;
446
+
447
+ // Flash's method if calling ExternalInterface methods (code adapted from MooTools).
448
+ try {
449
+ returnString = movieElement.CallFunction('<invoke name="' + functionName + '" returntype="javascript">' + __flash__argumentsToXML(argumentArray, 0) + '</invoke>');
450
+ returnValue = eval(returnString);
451
+ } catch (ex) {
452
+ throw "Call to " + functionName + " failed";
453
+ }
454
+
455
+ // Unescape file post param values
456
+ if (returnValue != undefined && typeof returnValue.post === "object") {
457
+ returnValue = this.unescapeFilePostParams(returnValue);
458
+ }
459
+
460
+ return returnValue;
461
+ };
462
+
463
+ /* *****************************
464
+ -- Flash control methods --
465
+ Your UI should use these
466
+ to operate SWFUpload
467
+ ***************************** */
468
+
469
+ // WARNING: this function does not work in Flash Player 10
470
+ // Public: selectFile causes a File Selection Dialog window to appear. This
471
+ // dialog only allows 1 file to be selected.
472
+ SWFUpload.prototype.selectFile = function () {
473
+ this.callFlash("SelectFile");
474
+ };
475
+
476
+ // WARNING: this function does not work in Flash Player 10
477
+ // Public: selectFiles causes a File Selection Dialog window to appear/ This
478
+ // dialog allows the user to select any number of files
479
+ // Flash Bug Warning: Flash limits the number of selectable files based on the combined length of the file names.
480
+ // If the selection name length is too long the dialog will fail in an unpredictable manner. There is no work-around
481
+ // for this bug.
482
+ SWFUpload.prototype.selectFiles = function () {
483
+ this.callFlash("SelectFiles");
484
+ };
485
+
486
+
487
+ // Public: startUpload starts uploading the first file in the queue unless
488
+ // the optional parameter 'fileID' specifies the ID
489
+ SWFUpload.prototype.startUpload = function (fileID) {
490
+ this.callFlash("StartUpload", [fileID]);
491
+ };
492
+
493
+ // Public: cancelUpload cancels any queued file. The fileID parameter may be the file ID or index.
494
+ // If you do not specify a fileID the current uploading file or first file in the queue is cancelled.
495
+ // If you do not want the uploadError event to trigger you can specify false for the triggerErrorEvent parameter.
496
+ SWFUpload.prototype.cancelUpload = function (fileID, triggerErrorEvent) {
497
+ if (triggerErrorEvent !== false) {
498
+ triggerErrorEvent = true;
499
+ }
500
+ this.callFlash("CancelUpload", [fileID, triggerErrorEvent]);
501
+ };
502
+
503
+ // Public: stopUpload stops the current upload and requeues the file at the beginning of the queue.
504
+ // If nothing is currently uploading then nothing happens.
505
+ SWFUpload.prototype.stopUpload = function () {
506
+ this.callFlash("StopUpload");
507
+ };
508
+
509
+ /* ************************
510
+ * Settings methods
511
+ * These methods change the SWFUpload settings.
512
+ * SWFUpload settings should not be changed directly on the settings object
513
+ * since many of the settings need to be passed to Flash in order to take
514
+ * effect.
515
+ * *********************** */
516
+
517
+ // Public: getStats gets the file statistics object.
518
+ SWFUpload.prototype.getStats = function () {
519
+ return this.callFlash("GetStats");
520
+ };
521
+
522
+ // Public: setStats changes the SWFUpload statistics. You shouldn't need to
523
+ // change the statistics but you can. Changing the statistics does not
524
+ // affect SWFUpload accept for the successful_uploads count which is used
525
+ // by the upload_limit setting to determine how many files the user may upload.
526
+ SWFUpload.prototype.setStats = function (statsObject) {
527
+ this.callFlash("SetStats", [statsObject]);
528
+ };
529
+
530
+ // Public: getFile retrieves a File object by ID or Index. If the file is
531
+ // not found then 'null' is returned.
532
+ SWFUpload.prototype.getFile = function (fileID) {
533
+ if (typeof(fileID) === "number") {
534
+ return this.callFlash("GetFileByIndex", [fileID]);
535
+ } else {
536
+ return this.callFlash("GetFile", [fileID]);
537
+ }
538
+ };
539
+
540
+ // Public: addFileParam sets a name/value pair that will be posted with the
541
+ // file specified by the Files ID. If the name already exists then the
542
+ // exiting value will be overwritten.
543
+ SWFUpload.prototype.addFileParam = function (fileID, name, value) {
544
+ return this.callFlash("AddFileParam", [fileID, name, value]);
545
+ };
546
+
547
+ // Public: removeFileParam removes a previously set (by addFileParam) name/value
548
+ // pair from the specified file.
549
+ SWFUpload.prototype.removeFileParam = function (fileID, name) {
550
+ this.callFlash("RemoveFileParam", [fileID, name]);
551
+ };
552
+
553
+ // Public: setUploadUrl changes the upload_url setting.
554
+ SWFUpload.prototype.setUploadURL = function (url) {
555
+ this.settings.upload_url = url.toString();
556
+ this.callFlash("SetUploadURL", [url]);
557
+ };
558
+
559
+ // Public: setPostParams changes the post_params setting
560
+ SWFUpload.prototype.setPostParams = function (paramsObject) {
561
+ this.settings.post_params = paramsObject;
562
+ this.callFlash("SetPostParams", [paramsObject]);
563
+ };
564
+
565
+ // Public: addPostParam adds post name/value pair. Each name can have only one value.
566
+ SWFUpload.prototype.addPostParam = function (name, value) {
567
+ this.settings.post_params[name] = value;
568
+ this.callFlash("SetPostParams", [this.settings.post_params]);
569
+ };
570
+
571
+ // Public: removePostParam deletes post name/value pair.
572
+ SWFUpload.prototype.removePostParam = function (name) {
573
+ delete this.settings.post_params[name];
574
+ this.callFlash("SetPostParams", [this.settings.post_params]);
575
+ };
576
+
577
+ // Public: setFileTypes changes the file_types setting and the file_types_description setting
578
+ SWFUpload.prototype.setFileTypes = function (types, description) {
579
+ this.settings.file_types = types;
580
+ this.settings.file_types_description = description;
581
+ this.callFlash("SetFileTypes", [types, description]);
582
+ };
583
+
584
+ // Public: setFileSizeLimit changes the file_size_limit setting
585
+ SWFUpload.prototype.setFileSizeLimit = function (fileSizeLimit) {
586
+ this.settings.file_size_limit = fileSizeLimit;
587
+ this.callFlash("SetFileSizeLimit", [fileSizeLimit]);
588
+ };
589
+
590
+ // Public: setFileUploadLimit changes the file_upload_limit setting
591
+ SWFUpload.prototype.setFileUploadLimit = function (fileUploadLimit) {
592
+ this.settings.file_upload_limit = fileUploadLimit;
593
+ this.callFlash("SetFileUploadLimit", [fileUploadLimit]);
594
+ };
595
+
596
+ // Public: setFileQueueLimit changes the file_queue_limit setting
597
+ SWFUpload.prototype.setFileQueueLimit = function (fileQueueLimit) {
598
+ this.settings.file_queue_limit = fileQueueLimit;
599
+ this.callFlash("SetFileQueueLimit", [fileQueueLimit]);
600
+ };
601
+
602
+ // Public: setFilePostName changes the file_post_name setting
603
+ SWFUpload.prototype.setFilePostName = function (filePostName) {
604
+ this.settings.file_post_name = filePostName;
605
+ this.callFlash("SetFilePostName", [filePostName]);
606
+ };
607
+
608
+ // Public: setUseQueryString changes the use_query_string setting
609
+ SWFUpload.prototype.setUseQueryString = function (useQueryString) {
610
+ this.settings.use_query_string = useQueryString;
611
+ this.callFlash("SetUseQueryString", [useQueryString]);
612
+ };
613
+
614
+ // Public: setRequeueOnError changes the requeue_on_error setting
615
+ SWFUpload.prototype.setRequeueOnError = function (requeueOnError) {
616
+ this.settings.requeue_on_error = requeueOnError;
617
+ this.callFlash("SetRequeueOnError", [requeueOnError]);
618
+ };
619
+
620
+ // Public: setHTTPSuccess changes the http_success setting
621
+ SWFUpload.prototype.setHTTPSuccess = function (http_status_codes) {
622
+ if (typeof http_status_codes === "string") {
623
+ http_status_codes = http_status_codes.replace(" ", "").split(",");
624
+ }
625
+
626
+ this.settings.http_success = http_status_codes;
627
+ this.callFlash("SetHTTPSuccess", [http_status_codes]);
628
+ };
629
+
630
+ // Public: setHTTPSuccess changes the http_success setting
631
+ SWFUpload.prototype.setAssumeSuccessTimeout = function (timeout_seconds) {
632
+ this.settings.assume_success_timeout = timeout_seconds;
633
+ this.callFlash("SetAssumeSuccessTimeout", [timeout_seconds]);
634
+ };
635
+
636
+ // Public: setDebugEnabled changes the debug_enabled setting
637
+ SWFUpload.prototype.setDebugEnabled = function (debugEnabled) {
638
+ this.settings.debug_enabled = debugEnabled;
639
+ this.callFlash("SetDebugEnabled", [debugEnabled]);
640
+ };
641
+
642
+ // Public: setButtonImageURL loads a button image sprite
643
+ SWFUpload.prototype.setButtonImageURL = function (buttonImageURL) {
644
+ if (buttonImageURL == undefined) {
645
+ buttonImageURL = "";
646
+ }
647
+
648
+ this.settings.button_image_url = buttonImageURL;
649
+ this.callFlash("SetButtonImageURL", [buttonImageURL]);
650
+ };
651
+
652
+ // Public: setButtonDimensions resizes the Flash Movie and button
653
+ SWFUpload.prototype.setButtonDimensions = function (width, height) {
654
+ this.settings.button_width = width;
655
+ this.settings.button_height = height;
656
+
657
+ var movie = this.getMovieElement();
658
+ if (movie != undefined) {
659
+ movie.style.width = width + "px";
660
+ movie.style.height = height + "px";
661
+ }
662
+
663
+ this.callFlash("SetButtonDimensions", [width, height]);
664
+ };
665
+ // Public: setButtonText Changes the text overlaid on the button
666
+ SWFUpload.prototype.setButtonText = function (html) {
667
+ this.settings.button_text = html;
668
+ this.callFlash("SetButtonText", [html]);
669
+ };
670
+ // Public: setButtonTextPadding changes the top and left padding of the text overlay
671
+ SWFUpload.prototype.setButtonTextPadding = function (left, top) {
672
+ this.settings.button_text_top_padding = top;
673
+ this.settings.button_text_left_padding = left;
674
+ this.callFlash("SetButtonTextPadding", [left, top]);
675
+ };
676
+
677
+ // Public: setButtonTextStyle changes the CSS used to style the HTML/Text overlaid on the button
678
+ SWFUpload.prototype.setButtonTextStyle = function (css) {
679
+ this.settings.button_text_style = css;
680
+ this.callFlash("SetButtonTextStyle", [css]);
681
+ };
682
+ // Public: setButtonDisabled disables/enables the button
683
+ SWFUpload.prototype.setButtonDisabled = function (isDisabled) {
684
+ this.settings.button_disabled = isDisabled;
685
+ this.callFlash("SetButtonDisabled", [isDisabled]);
686
+ };
687
+ // Public: setButtonAction sets the action that occurs when the button is clicked
688
+ SWFUpload.prototype.setButtonAction = function (buttonAction) {
689
+ this.settings.button_action = buttonAction;
690
+ this.callFlash("SetButtonAction", [buttonAction]);
691
+ };
692
+
693
+ // Public: setButtonCursor changes the mouse cursor displayed when hovering over the button
694
+ SWFUpload.prototype.setButtonCursor = function (cursor) {
695
+ this.settings.button_cursor = cursor;
696
+ this.callFlash("SetButtonCursor", [cursor]);
697
+ };
698
+
699
+ /* *******************************
700
+ Flash Event Interfaces
701
+ These functions are used by Flash to trigger the various
702
+ events.
703
+
704
+ All these functions a Private.
705
+
706
+ Because the ExternalInterface library is buggy the event calls
707
+ are added to a queue and the queue then executed by a setTimeout.
708
+ This ensures that events are executed in a determinate order and that
709
+ the ExternalInterface bugs are avoided.
710
+ ******************************* */
711
+
712
+ SWFUpload.prototype.queueEvent = function (handlerName, argumentArray) {
713
+ // Warning: Don't call this.debug inside here or you'll create an infinite loop
714
+
715
+ if (argumentArray == undefined) {
716
+ argumentArray = [];
717
+ } else if (!(argumentArray instanceof Array)) {
718
+ argumentArray = [argumentArray];
719
+ }
720
+
721
+ var self = this;
722
+ if (typeof this.settings[handlerName] === "function") {
723
+ // Queue the event
724
+ this.eventQueue.push(function () {
725
+ this.settings[handlerName].apply(this, argumentArray);
726
+ });
727
+
728
+ // Execute the next queued event
729
+ setTimeout(function () {
730
+ self.executeNextEvent();
731
+ }, 0);
732
+
733
+ } else if (this.settings[handlerName] !== null) {
734
+ throw "Event handler " + handlerName + " is unknown or is not a function";
735
+ }
736
+ };
737
+
738
+ // Private: Causes the next event in the queue to be executed. Since events are queued using a setTimeout
739
+ // we must queue them in order to garentee that they are executed in order.
740
+ SWFUpload.prototype.executeNextEvent = function () {
741
+ // Warning: Don't call this.debug inside here or you'll create an infinite loop
742
+
743
+ var f = this.eventQueue ? this.eventQueue.shift() : null;
744
+ if (typeof(f) === "function") {
745
+ f.apply(this);
746
+ }
747
+ };
748
+
749
+ // Private: unescapeFileParams is part of a workaround for a flash bug where objects passed through ExternalInterface cannot have
750
+ // properties that contain characters that are not valid for JavaScript identifiers. To work around this
751
+ // the Flash Component escapes the parameter names and we must unescape again before passing them along.
752
+ SWFUpload.prototype.unescapeFilePostParams = function (file) {
753
+ var reg = /[$]([0-9a-f]{4})/i;
754
+ var unescapedPost = {};
755
+ var uk;
756
+
757
+ if (file != undefined) {
758
+ for (var k in file.post) {
759
+ if (file.post.hasOwnProperty(k)) {
760
+ uk = k;
761
+ var match;
762
+ while ((match = reg.exec(uk)) !== null) {
763
+ uk = uk.replace(match[0], String.fromCharCode(parseInt("0x" + match[1], 16)));
764
+ }
765
+ unescapedPost[uk] = file.post[k];
766
+ }
767
+ }
768
+
769
+ file.post = unescapedPost;
770
+ }
771
+
772
+ return file;
773
+ };
774
+
775
+ // Private: Called by Flash to see if JS can call in to Flash (test if External Interface is working)
776
+ SWFUpload.prototype.testExternalInterface = function () {
777
+ try {
778
+ return this.callFlash("TestExternalInterface");
779
+ } catch (ex) {
780
+ return false;
781
+ }
782
+ };
783
+
784
+ // Private: This event is called by Flash when it has finished loading. Don't modify this.
785
+ // Use the swfupload_loaded_handler event setting to execute custom code when SWFUpload has loaded.
786
+ SWFUpload.prototype.flashReady = function () {
787
+ // Check that the movie element is loaded correctly with its ExternalInterface methods defined
788
+ var movieElement = this.getMovieElement();
789
+
790
+ if (!movieElement) {
791
+ this.debug("Flash called back ready but the flash movie can't be found.");
792
+ return;
793
+ }
794
+
795
+ this.cleanUp(movieElement);
796
+
797
+ this.queueEvent("swfupload_loaded_handler");
798
+ };
799
+
800
+ // Private: removes Flash added fuctions to the DOM node to prevent memory leaks in IE.
801
+ // This function is called by Flash each time the ExternalInterface functions are created.
802
+ SWFUpload.prototype.cleanUp = function (movieElement) {
803
+ // Pro-actively unhook all the Flash functions
804
+ try {
805
+ if (this.movieElement && typeof(movieElement.CallFunction) === "unknown") { // We only want to do this in IE
806
+ this.debug("Removing Flash functions hooks (this should only run in IE and should prevent memory leaks)");
807
+ for (var key in movieElement) {
808
+ try {
809
+ if (typeof(movieElement[key]) === "function") {
810
+ movieElement[key] = null;
811
+ }
812
+ } catch (ex) {
813
+ }
814
+ }
815
+ }
816
+ } catch (ex1) {
817
+
818
+ }
819
+
820
+ // Fix Flashes own cleanup code so if the SWFMovie was removed from the page
821
+ // it doesn't display errors.
822
+ window["__flash__removeCallback"] = function (instance, name) {
823
+ try {
824
+ if (instance) {
825
+ instance[name] = null;
826
+ }
827
+ } catch (flashEx) {
828
+
829
+ }
830
+ };
831
+
832
+ };
833
+
834
+
835
+ /* This is a chance to do something before the browse window opens */
836
+ SWFUpload.prototype.fileDialogStart = function () {
837
+ this.queueEvent("file_dialog_start_handler");
838
+ };
839
+
840
+
841
+ /* Called when a file is successfully added to the queue. */
842
+ SWFUpload.prototype.fileQueued = function (file) {
843
+ file = this.unescapeFilePostParams(file);
844
+ this.queueEvent("file_queued_handler", file);
845
+ };
846
+
847
+
848
+ /* Handle errors that occur when an attempt to queue a file fails. */
849
+ SWFUpload.prototype.fileQueueError = function (file, errorCode, message) {
850
+ file = this.unescapeFilePostParams(file);
851
+ this.queueEvent("file_queue_error_handler", [file, errorCode, message]);
852
+ };
853
+
854
+ /* Called after the file dialog has closed and the selected files have been queued.
855
+ You could call startUpload here if you want the queued files to begin uploading immediately. */
856
+ SWFUpload.prototype.fileDialogComplete = function (numFilesSelected, numFilesQueued, numFilesInQueue) {
857
+ this.queueEvent("file_dialog_complete_handler", [numFilesSelected, numFilesQueued, numFilesInQueue]);
858
+ };
859
+
860
+ SWFUpload.prototype.uploadStart = function (file) {
861
+ file = this.unescapeFilePostParams(file);
862
+ this.queueEvent("return_upload_start_handler", file);
863
+ };
864
+
865
+ SWFUpload.prototype.returnUploadStart = function (file) {
866
+ var returnValue;
867
+ if (typeof this.settings.upload_start_handler === "function") {
868
+ file = this.unescapeFilePostParams(file);
869
+ returnValue = this.settings.upload_start_handler.call(this, file);
870
+ } else if (this.settings.upload_start_handler != undefined) {
871
+ throw "upload_start_handler must be a function";
872
+ }
873
+
874
+ // Convert undefined to true so if nothing is returned from the upload_start_handler it is
875
+ // interpretted as 'true'.
876
+ if (returnValue === undefined) {
877
+ returnValue = true;
878
+ }
879
+
880
+ returnValue = !!returnValue;
881
+
882
+ this.callFlash("ReturnUploadStart", [returnValue]);
883
+ };
884
+
885
+
886
+
887
+ SWFUpload.prototype.uploadProgress = function (file, bytesComplete, bytesTotal) {
888
+ file = this.unescapeFilePostParams(file);
889
+ this.queueEvent("upload_progress_handler", [file, bytesComplete, bytesTotal]);
890
+ };
891
+
892
+ SWFUpload.prototype.uploadError = function (file, errorCode, message) {
893
+ file = this.unescapeFilePostParams(file);
894
+ this.queueEvent("upload_error_handler", [file, errorCode, message]);
895
+ };
896
+
897
+ SWFUpload.prototype.uploadSuccess = function (file, serverData, responseReceived) {
898
+ file = this.unescapeFilePostParams(file);
899
+ this.queueEvent("upload_success_handler", [file, serverData, responseReceived]);
900
+ };
901
+
902
+ SWFUpload.prototype.uploadComplete = function (file) {
903
+ file = this.unescapeFilePostParams(file);
904
+ this.queueEvent("upload_complete_handler", file);
905
+ };
906
+
907
+ /* Called by SWFUpload JavaScript and Flash functions when debug is enabled. By default it writes messages to the
908
+ internal debug console. You can override this event and have messages written where you want. */
909
+ SWFUpload.prototype.debug = function (message) {
910
+ this.queueEvent("debug_handler", message);
911
+ };
912
+
913
+
914
+ /* **********************************
915
+ Debug Console
916
+ The debug console is a self contained, in page location
917
+ for debug message to be sent. The Debug Console adds
918
+ itself to the body if necessary.
919
+
920
+ The console is automatically scrolled as messages appear.
921
+
922
+ If you are using your own debug handler or when you deploy to production and
923
+ have debug disabled you can remove these functions to reduce the file size
924
+ and complexity.
925
+ ********************************** */
926
+
927
+ // Private: debugMessage is the default debug_handler. If you want to print debug messages
928
+ // call the debug() function. When overriding the function your own function should
929
+ // check to see if the debug setting is true before outputting debug information.
930
+ SWFUpload.prototype.debugMessage = function (message) {
931
+ if (this.settings.debug) {
932
+ var exceptionMessage, exceptionValues = [];
933
+
934
+ // Check for an exception object and print it nicely
935
+ if (typeof message === "object" && typeof message.name === "string" && typeof message.message === "string") {
936
+ for (var key in message) {
937
+ if (message.hasOwnProperty(key)) {
938
+ exceptionValues.push(key + ": " + message[key]);
939
+ }
940
+ }
941
+ exceptionMessage = exceptionValues.join("\n") || "";
942
+ exceptionValues = exceptionMessage.split("\n");
943
+ exceptionMessage = "EXCEPTION: " + exceptionValues.join("\nEXCEPTION: ");
944
+ if (window.console)
945
+ console.log(exceptionMessage);
946
+ else
947
+ SWFUpload.Console.writeLine(exceptionMessage);
948
+ } else {
949
+ if (window.console)
950
+ console.log(message);
951
+ else
952
+ SWFUpload.Console.writeLine(message);
953
+ }
954
+ }
955
+ };
956
+
957
+ SWFUpload.Console = {};
958
+ SWFUpload.Console.writeLine = function (message) {
959
+ var console, documentForm;
960
+
961
+ try {
962
+ console = document.getElementById("SWFUpload_Console");
963
+
964
+ if (!console) {
965
+ documentForm = document.createElement("form");
966
+ document.getElementsByTagName("body")[0].appendChild(documentForm);
967
+
968
+ console = document.createElement("textarea");
969
+ console.id = "SWFUpload_Console";
970
+ console.style.fontFamily = "monospace";
971
+ console.setAttribute("wrap", "off");
972
+ console.wrap = "off";
973
+ console.style.overflow = "auto";
974
+ console.style.width = "99%";
975
+ console.style.height = "350px";
976
+ console.style.margin = "5px";
977
+ documentForm.appendChild(console);
978
+ }
979
+
980
+ console.value += message + "\n";
981
+
982
+ console.scrollTop = console.scrollHeight - console.clientHeight;
983
+ } catch (ex) {
984
+ alert("Exception: " + ex.name + " Message: " + ex.message);
985
+ }
986
+ };
admin/js/swfupload.swf ADDED
Binary file
admin/js/tabcontent.js ADDED
@@ -0,0 +1,159 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ //** Tab Content script v2.0- � Dynamic Drive DHTML code library (http://www.dynamicdrive.com)
2
+ //** Updated Oct 7th, 07 to version 2.0. Contains numerous improvements:
3
+ // -Added Auto Mode: Script auto rotates the tabs based on an interval, until a tab is explicitly selected
4
+ // -Ability to expand/contract arbitrary DIVs on the page as the tabbed content is expanded/ contracted
5
+ // -Ability to dynamically select a tab either based on its position within its peers, or its ID attribute (give the target tab one 1st)
6
+ // -Ability to set where the CSS classname "selected" get assigned- either to the target tab's link ("A"), or its parent container
7
+ //** Updated Feb 18th, 08 to version 2.1: Adds a "tabinstance.cycleit(dir)" method to cycle forward or backward between tabs dynamically
8
+ //** Updated April 8th, 08 to version 2.2: Adds support for expanding a tab using a URL parameter (ie: http://mysite.com/tabcontent.htm?tabinterfaceid=0)
9
+
10
+ ////NO NEED TO EDIT BELOW////////////////////////
11
+
12
+ function ddtabcontent(tabinterfaceid){
13
+ this.tabinterfaceid=tabinterfaceid //ID of Tab Menu main container
14
+ this.tabs=document.getElementById(tabinterfaceid).getElementsByTagName("a") //Get all tab links within container
15
+ this.enabletabpersistence=true
16
+ this.hottabspositions=[] //Array to store position of tabs that have a "rel" attr defined, relative to all tab links, within container
17
+ this.currentTabIndex=0 //Index of currently selected hot tab (tab with sub content) within hottabspositions[] array
18
+ this.subcontentids=[] //Array to store ids of the sub contents ("rel" attr values)
19
+ this.revcontentids=[] //Array to store ids of arbitrary contents to expand/contact as well ("rev" attr values)
20
+ this.selectedClassTarget="link" //keyword to indicate which target element to assign "selected" CSS class ("linkparent" or "link")
21
+ }
22
+
23
+ ddtabcontent.getCookie=function(Name){
24
+ var re=new RegExp(Name+"=[^;]+", "i"); //construct RE to search for target name/value pair
25
+ if (document.cookie.match(re)) //if cookie found
26
+ return document.cookie.match(re)[0].split("=")[1] //return its value
27
+ return ""
28
+ }
29
+
30
+ ddtabcontent.setCookie=function(name, value){
31
+ document.cookie = name+"="+value+";path=/" //cookie value is domain wide (path=/)
32
+ }
33
+
34
+ ddtabcontent.prototype={
35
+
36
+ expandit:function(tabid_or_position){ //PUBLIC function to select a tab either by its ID or position(int) within its peers
37
+ this.cancelautorun() //stop auto cycling of tabs (if running)
38
+ var tabref=""
39
+ try{
40
+ if (typeof tabid_or_position=="string" && document.getElementById(tabid_or_position).getAttribute("rel")) //if specified tab contains "rel" attr
41
+ tabref=document.getElementById(tabid_or_position)
42
+ else if (parseInt(tabid_or_position)!=NaN && this.tabs[tabid_or_position].getAttribute("rel")) //if specified tab contains "rel" attr
43
+ tabref=this.tabs[tabid_or_position]
44
+ }
45
+ catch(err){alert("Invalid Tab ID or position entered!")}
46
+ if (tabref!="") //if a valid tab is found based on function parameter
47
+ this.expandtab(tabref) //expand this tab
48
+ },
49
+
50
+ cycleit:function(dir, autorun){ //PUBLIC function to move foward or backwards through each hot tab (tabinstance.cycleit('foward/back') )
51
+ if (dir=="next"){
52
+ var currentTabIndex=(this.currentTabIndex<this.hottabspositions.length-1)? this.currentTabIndex+1 : 0
53
+ }
54
+ else if (dir=="prev"){
55
+ var currentTabIndex=(this.currentTabIndex>0)? this.currentTabIndex-1 : this.hottabspositions.length-1
56
+ }
57
+ if (typeof autorun=="undefined") //if cycleit() is being called by user, versus autorun() function
58
+ this.cancelautorun() //stop auto cycling of tabs (if running)
59
+ this.expandtab(this.tabs[this.hottabspositions[currentTabIndex]])
60
+ },
61
+
62
+ setpersist:function(bool){ //PUBLIC function to toggle persistence feature
63
+ this.enabletabpersistence=bool
64
+ },
65
+
66
+ setselectedClassTarget:function(objstr){ //PUBLIC function to set which target element to assign "selected" CSS class ("linkparent" or "link")
67
+ this.selectedClassTarget=objstr || "link"
68
+ },
69
+
70
+ getselectedClassTarget:function(tabref){ //Returns target element to assign "selected" CSS class to
71
+ return (this.selectedClassTarget==("linkparent".toLowerCase()))? tabref.parentNode : tabref
72
+ },
73
+
74
+ urlparamselect:function(tabinterfaceid){
75
+ var result=window.location.search.match(new RegExp(tabinterfaceid+"=(\\d+)", "i")) //check for "?tabinterfaceid=2" in URL
76
+ return (result==null)? null : parseInt(RegExp.$1) //returns null or index, where index (int) is the selected tab's index
77
+ },
78
+
79
+ expandtab:function(tabref){
80
+ var subcontentid=tabref.getAttribute("rel") //Get id of subcontent to expand
81
+ //Get "rev" attr as a string of IDs in the format ",john,george,trey,etc," to easily search through
82
+ var associatedrevids=(tabref.getAttribute("rev"))? ","+tabref.getAttribute("rev").replace(/\s+/, "")+"," : ""
83
+ this.expandsubcontent(subcontentid)
84
+ this.expandrevcontent(associatedrevids)
85
+ for (var i=0; i<this.tabs.length; i++){ //Loop through all tabs, and assign only the selected tab the CSS class "selected"
86
+ this.getselectedClassTarget(this.tabs[i]).className=(this.tabs[i].getAttribute("rel")==subcontentid)? "selected" : ""
87
+ }
88
+ if (this.enabletabpersistence) //if persistence enabled, save selected tab position(int) relative to its peers
89
+ ddtabcontent.setCookie(this.tabinterfaceid, tabref.tabposition)
90
+ this.setcurrenttabindex(tabref.tabposition) //remember position of selected tab within hottabspositions[] array
91
+ },
92
+
93
+ expandsubcontent:function(subcontentid){
94
+ for (var i=0; i<this.subcontentids.length; i++){
95
+ var subcontent=document.getElementById(this.subcontentids[i]) //cache current subcontent obj (in for loop)
96
+ subcontent.style.display=(subcontent.id==subcontentid)? "block" : "none" //"show" or hide sub content based on matching id attr value
97
+ }
98
+ },
99
+
100
+ expandrevcontent:function(associatedrevids){
101
+ var allrevids=this.revcontentids
102
+ for (var i=0; i<allrevids.length; i++){ //Loop through rev attributes for all tabs in this tab interface
103
+ //if any values stored within associatedrevids matches one within allrevids, expand that DIV, otherwise, contract it
104
+ document.getElementById(allrevids[i]).style.display=(associatedrevids.indexOf(","+allrevids[i]+",")!=-1)? "block" : "none"
105
+ }
106
+ },
107
+
108
+ setcurrenttabindex:function(tabposition){ //store current position of tab (within hottabspositions[] array)
109
+ for (var i=0; i<this.hottabspositions.length; i++){
110
+ if (tabposition==this.hottabspositions[i]){
111
+ this.currentTabIndex=i
112
+ break
113
+ }
114
+ }
115
+ },
116
+
117
+ autorun:function(){ //function to auto cycle through and select tabs based on a set interval
118
+ this.cycleit('next', true)
119
+ },
120
+
121
+ cancelautorun:function(){
122
+ if (typeof this.autoruntimer!="undefined")
123
+ clearInterval(this.autoruntimer)
124
+ },
125
+
126
+ init:function(automodeperiod){
127
+ var persistedtab=ddtabcontent.getCookie(this.tabinterfaceid) //get position of persisted tab (applicable if persistence is enabled)
128
+ var selectedtab=-1 //Currently selected tab index (-1 meaning none)
129
+ var selectedtabfromurl=this.urlparamselect(this.tabinterfaceid) //returns null or index from: tabcontent.htm?tabinterfaceid=index
130
+ this.automodeperiod=automodeperiod || 0
131
+ for (var i=0; i<this.tabs.length; i++){
132
+ this.tabs[i].tabposition=i //remember position of tab relative to its peers
133
+ if (this.tabs[i].getAttribute("rel")){
134
+ var tabinstance=this
135
+ this.hottabspositions[this.hottabspositions.length]=i //store position of "hot" tab ("rel" attr defined) relative to its peers
136
+ this.subcontentids[this.subcontentids.length]=this.tabs[i].getAttribute("rel") //store id of sub content ("rel" attr value)
137
+ this.tabs[i].onclick=function(){
138
+ tabinstance.expandtab(this)
139
+ tabinstance.cancelautorun() //stop auto cycling of tabs (if running)
140
+ return false
141
+ }
142
+ if (this.tabs[i].getAttribute("rev")){ //if "rev" attr defined, store each value within "rev" as an array element
143
+ this.revcontentids=this.revcontentids.concat(this.tabs[i].getAttribute("rev").split(/\s*,\s*/))
144
+ }
145
+ if (selectedtabfromurl==i || this.enabletabpersistence && selectedtab==-1 && parseInt(persistedtab)==i || !this.enabletabpersistence && selectedtab==-1 && this.getselectedClassTarget(this.tabs[i]).className=="selected"){
146
+ selectedtab=i //Selected tab index, if found
147
+ }
148
+ }
149
+ } //END for loop
150
+ if (selectedtab!=-1) //if a valid default selected tab index is found
151
+ this.expandtab(this.tabs[selectedtab]) //expand selected tab (either from URL parameter, persistent feature, or class="selected" class)
152
+ else //if no valid default selected index found
153
+ this.expandtab(this.tabs[this.hottabspositions[0]]) //Just select first tab that contains a "rel" attr
154
+ if (parseInt(this.automodeperiod)>500 && this.hottabspositions.length>1){
155
+ this.autoruntimer=setInterval(function(){tabinstance.autorun()}, this.automodeperiod)
156
+ }
157
+ } //END int() function
158
+
159
+ } //END Prototype assignment
admin/js/tabs.js ADDED
@@ -0,0 +1,159 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ //** Tab Content script v2.0- � Dynamic Drive DHTML code library (http://www.dynamicdrive.com)
2
+ //** Updated Oct 7th, 07 to version 2.0. Contains numerous improvements:
3
+ // -Added Auto Mode: Script auto rotates the tabs based on an interval, until a tab is explicitly selected
4
+ // -Ability to expand/contract arbitrary DIVs on the page as the tabbed content is expanded/ contracted
5
+ // -Ability to dynamically select a tab either based on its position within its peers, or its ID attribute (give the target tab one 1st)
6
+ // -Ability to set where the CSS classname "selected" get assigned- either to the target tab's link ("A"), or its parent container
7
+ //** Updated Feb 18th, 08 to version 2.1: Adds a "tabinstance.cycleit(dir)" method to cycle forward or backward between tabs dynamically
8
+ //** Updated April 8th, 08 to version 2.2: Adds support for expanding a tab using a URL parameter (ie: http://mysite.com/tabcontent.htm?tabinterfaceid=0)
9
+
10
+ ////NO NEED TO EDIT BELOW////////////////////////
11
+
12
+ function ddtabcontent(tabinterfaceid){
13
+ this.tabinterfaceid=tabinterfaceid //ID of Tab Menu main container
14
+ this.tabs=document.getElementById(tabinterfaceid).getElementsByTagName("a") //Get all tab links within container
15
+ this.enabletabpersistence=true
16
+ this.hottabspositions=[] //Array to store position of tabs that have a "rel" attr defined, relative to all tab links, within container
17
+ this.currentTabIndex=0 //Index of currently selected hot tab (tab with sub content) within hottabspositions[] array
18
+ this.subcontentids=[] //Array to store ids of the sub contents ("rel" attr values)
19
+ this.revcontentids=[] //Array to store ids of arbitrary contents to expand/contact as well ("rev" attr values)
20
+ this.selectedClassTarget="linkparent" //keyword to indicate which target element to assign "selected" CSS class ("linkparent" or "link")
21
+ }
22
+
23
+ ddtabcontent.getCookie=function(Name){
24
+ var re=new RegExp(Name+"=[^;]+", "i"); //construct RE to search for target name/value pair
25
+ if (document.cookie.match(re)) //if cookie found
26
+ return document.cookie.match(re)[0].split("=")[1] //return its value
27
+ return ""
28
+ }
29
+
30
+ ddtabcontent.setCookie=function(name, value){
31
+ document.cookie = name+"="+value+";path=/" //cookie value is domain wide (path=/)
32
+ }
33
+
34
+ ddtabcontent.prototype={
35
+
36
+ expandit:function(tabid_or_position){ //PUBLIC function to select a tab either by its ID or position(int) within its peers
37
+ this.cancelautorun() //stop auto cycling of tabs (if running)
38
+ var tabref=""
39
+ try{
40
+ if (typeof tabid_or_position=="string" && document.getElementById(tabid_or_position).getAttribute("rel")) //if specified tab contains "rel" attr
41
+ tabref=document.getElementById(tabid_or_position)
42
+ else if (parseInt(tabid_or_position)!=NaN && this.tabs[tabid_or_position].getAttribute("rel")) //if specified tab contains "rel" attr
43
+ tabref=this.tabs[tabid_or_position]
44
+ }
45
+ catch(err){alert("Invalid Tab ID or position entered!")}
46
+ if (tabref!="") //if a valid tab is found based on function parameter
47
+ this.expandtab(tabref) //expand this tab
48
+ },
49
+
50
+ cycleit:function(dir, autorun){ //PUBLIC function to move foward or backwards through each hot tab (tabinstance.cycleit('foward/back') )
51
+ if (dir=="next"){
52
+ var currentTabIndex=(this.currentTabIndex<this.hottabspositions.length-1)? this.currentTabIndex+1 : 0
53
+ }
54
+ else if (dir=="prev"){
55
+ var currentTabIndex=(this.currentTabIndex>0)? this.currentTabIndex-1 : this.hottabspositions.length-1
56
+ }
57
+ if (typeof autorun=="undefined") //if cycleit() is being called by user, versus autorun() function
58
+ this.cancelautorun() //stop auto cycling of tabs (if running)
59
+ this.expandtab(this.tabs[this.hottabspositions[currentTabIndex]])
60
+ },
61
+
62
+ setpersist:function(bool){ //PUBLIC function to toggle persistence feature
63
+ this.enabletabpersistence=bool
64
+ },
65
+
66
+ setselectedClassTarget:function(objstr){ //PUBLIC function to set which target element to assign "selected" CSS class ("linkparent" or "link")
67
+ this.selectedClassTarget=objstr || "link"
68
+ },
69
+
70
+ getselectedClassTarget:function(tabref){ //Returns target element to assign "selected" CSS class to
71
+ return (this.selectedClassTarget==("linkparent".toLowerCase()))? tabref.parentNode : tabref
72
+ },
73
+
74
+ urlparamselect:function(tabinterfaceid){
75
+ var result=window.location.search.match(new RegExp(tabinterfaceid+"=(\\d+)", "i")) //check for "?tabinterfaceid=2" in URL
76
+ return (result==null)? null : parseInt(RegExp.$1) //returns null or index, where index (int) is the selected tab's index
77
+ },
78
+
79
+ expandtab:function(tabref){
80
+ var subcontentid=tabref.getAttribute("rel") //Get id of subcontent to expand
81
+ //Get "rev" attr as a string of IDs in the format ",john,george,trey,etc," to easily search through
82
+ var associatedrevids=(tabref.getAttribute("rev"))? ","+tabref.getAttribute("rev").replace(/\s+/, "")+"," : ""
83
+ this.expandsubcontent(subcontentid)
84
+ this.expandrevcontent(associatedrevids)
85
+ for (var i=0; i<this.tabs.length; i++){ //Loop through all tabs, and assign only the selected tab the CSS class "selected"
86
+ this.getselectedClassTarget(this.tabs[i]).className=(this.tabs[i].getAttribute("rel")==subcontentid)? "selected" : ""
87
+ }
88
+ if (this.enabletabpersistence) //if persistence enabled, save selected tab position(int) relative to its peers
89
+ ddtabcontent.setCookie(this.tabinterfaceid, tabref.tabposition)
90
+ this.setcurrenttabindex(tabref.tabposition) //remember position of selected tab within hottabspositions[] array
91
+ },
92
+
93
+ expandsubcontent:function(subcontentid){
94
+ for (var i=0; i<this.subcontentids.length; i++){
95
+ var subcontent=document.getElementById(this.subcontentids[i]) //cache current subcontent obj (in for loop)
96
+ subcontent.style.display=(subcontent.id==subcontentid)? "block" : "none" //"show" or hide sub content based on matching id attr value
97
+ }
98
+ },
99
+
100
+ expandrevcontent:function(associatedrevids){
101
+ var allrevids=this.revcontentids
102
+ for (var i=0; i<allrevids.length; i++){ //Loop through rev attributes for all tabs in this tab interface
103
+ //if any values stored within associatedrevids matches one within allrevids, expand that DIV, otherwise, contract it
104
+ document.getElementById(allrevids[i]).style.display=(associatedrevids.indexOf(","+allrevids[i]+",")!=-1)? "block" : "none"
105
+ }
106
+ },
107
+
108
+ setcurrenttabindex:function(tabposition){ //store current position of tab (within hottabspositions[] array)
109
+ for (var i=0; i<this.hottabspositions.length; i++){
110
+ if (tabposition==this.hottabspositions[i]){
111
+ this.currentTabIndex=i
112
+ break
113
+ }
114
+ }
115
+ },
116
+
117
+ autorun:function(){ //function to auto cycle through and select tabs based on a set interval
118
+ this.cycleit('next', true)
119
+ },
120
+
121
+ cancelautorun:function(){
122
+ if (typeof this.autoruntimer!="undefined")
123
+ clearInterval(this.autoruntimer)
124
+ },
125
+
126
+ init:function(automodeperiod){
127
+ var persistedtab=ddtabcontent.getCookie(this.tabinterfaceid) //get position of persisted tab (applicable if persistence is enabled)
128
+ var selectedtab=-1 //Currently selected tab index (-1 meaning none)
129
+ var selectedtabfromurl=this.urlparamselect(this.tabinterfaceid) //returns null or index from: tabcontent.htm?tabinterfaceid=index
130
+ this.automodeperiod=automodeperiod || 0
131
+ for (var i=0; i<this.tabs.length; i++){
132
+ this.tabs[i].tabposition=i //remember position of tab relative to its peers
133
+ if (this.tabs[i].getAttribute("rel")){
134
+ var tabinstance=this
135
+ this.hottabspositions[this.hottabspositions.length]=i //store position of "hot" tab ("rel" attr defined) relative to its peers
136
+ this.subcontentids[this.subcontentids.length]=this.tabs[i].getAttribute("rel") //store id of sub content ("rel" attr value)
137
+ this.tabs[i].onclick=function(){
138
+ tabinstance.expandtab(this)
139
+ tabinstance.cancelautorun() //stop auto cycling of tabs (if running)
140
+ return false
141
+ }
142
+ if (this.tabs[i].getAttribute("rev")){ //if "rev" attr defined, store each value within "rev" as an array element
143
+ this.revcontentids=this.revcontentids.concat(this.tabs[i].getAttribute("rev").split(/\s*,\s*/))
144
+ }
145
+ if (selectedtabfromurl==i || this.enabletabpersistence && selectedtab==-1 && parseInt(persistedtab)==i || !this.enabletabpersistence && selectedtab==-1 && this.getselectedClassTarget(this.tabs[i]).className=="selected"){
146
+ selectedtab=i //Selected tab index, if found
147
+ }
148
+ }
149
+ } //END for loop
150
+ if (selectedtab!=-1) //if a valid default selected tab index is found
151
+ this.expandtab(this.tabs[selectedtab]) //expand selected tab (either from URL parameter, persistent feature, or class="selected" class)
152
+ else //if no valid default selected index found
153
+ this.expandtab(this.tabs[this.hottabspositions[0]]) //Just select first tab that contains a "rel" attr
154
+ if (parseInt(this.automodeperiod)>500 && this.hottabspositions.length>1){
155
+ this.autoruntimer=setInterval(function(){tabinstance.autorun()}, this.automodeperiod)
156
+ }
157
+ } //END int() function
158
+
159
+ } //END Prototype assignment
admin/js/themes/bar/arrows.png ADDED
Binary file
admin/js/themes/bar/bullets.png ADDED
Binary file
admin/js/themes/bar/loading.gif ADDED
Binary file
admin/js/themes/bar/styles.css ADDED
@@ -0,0 +1,132 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ Skin Name: Nivo Slider Bar Theme
3
+ Skin URI: http://nivo.dev7studios.com
4
+ Description: The bottom bar skin for the Nivo Slider.
5
+ Version: 1.0
6
+ Author: Gilbert Pellegrom
7
+ Author URI: http://dev7studios.com
8
+ Supports Thumbs: false
9
+ */
10
+
11
+ .theme-bar.slider-wrapper {
12
+ position: relative;
13
+ border: 1px solid #333;
14
+ overflow: hidden;
15
+ }
16
+ .theme-bar .nivoSlider {
17
+ position:relative;
18
+ background:#fff url(loading.gif) no-repeat 50% 50%;
19
+ }
20
+ .theme-bar .nivoSlider img {
21
+ position:absolute;
22
+ top:0px;
23
+ left:0px;
24
+ display:none;
25
+ }
26
+ .theme-bar .nivoSlider a {
27
+ border:0;
28
+ display:block;
29
+ }
30
+
31
+ .theme-bar .nivo-controlNav {
32
+ position: absolute;
33
+ left: 0;
34
+ bottom: -41px;
35
+ z-index: 10;
36
+ width: 100%;
37
+ height: 30px;
38
+ text-align: center;
39
+ padding: 5px 0;
40
+ border-top: 1px solid #333;
41
+ background: #333;
42
+ background: -moz-linear-gradient(top, #565656 0%, #333333 100%); /* FF3.6+ */
43
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#565656), color-stop(100%,#333333)); /* Chrome,Safari4+ */
44
+ background: -webkit-linear-gradient(top, #565656 0%,#333333 100%); /* Chrome10+,Safari5.1+ */
45
+ background: -o-linear-gradient(top, #565656 0%,#333333 100%); /* Opera 11.10+ */
46
+ background: -ms-linear-gradient(top, #565656 0%,#333333 100%); /* IE10+ */
47
+ background: linear-gradient(to bottom, #565656 0%,#333333 100%); /* W3C */
48
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#565656', endColorstr='#333333',GradientType=0 ); /* IE6-9 */
49
+ opacity: 0.5;
50
+ -webkit-transition: all 200ms ease-in-out;
51
+ -moz-transition: all 200ms ease-in-out;
52
+ -o-transition: all 200ms ease-in-out;
53
+ transition: all 200ms ease-in-out;
54
+ }
55
+ .theme-bar:hover .nivo-controlNav {
56
+ bottom: 0;
57
+ opacity: 1;
58
+ }
59
+ .theme-bar .nivo-controlNav a {
60
+ display:inline-block;
61
+ width:22px;
62
+ height:22px;
63
+ background:url(bullets.png) no-repeat;
64
+ text-indent:-9999px;
65
+ border:0;
66
+ margin: 5px 2px 0 2px;
67
+ }
68
+ .theme-bar .nivo-controlNav a.active {
69
+ background-position:0 -22px;
70
+ }
71
+
72
+ .theme-bar .nivo-directionNav a {
73
+ display:block;
74
+ border:0;
75
+ color: #fff;
76
+ text-transform: uppercase;
77
+ top: auto;
78
+ bottom: 10px;
79
+ z-index: 11;
80
+ font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
81
+ font-size: 13px;
82
+ line-height: 20px;
83
+ opacity: 0.5;
84
+ -webkit-transition: all 200ms ease-in-out;
85
+ -moz-transition: all 200ms ease-in-out;
86
+ -o-transition: all 200ms ease-in-out;
87
+ transition: all 200ms ease-in-out;
88
+ }
89
+ .theme-bar a.nivo-nextNav { right: -50px; }
90
+ .theme-bar a.nivo-prevNav { left: -50px; }
91
+ .theme-bar:hover a.nivo-nextNav {
92
+ right: 15px;
93
+ opacity: 1;
94
+ }
95
+ .theme-bar:hover a.nivo-prevNav {
96
+ left: 15px;
97
+ opacity: 1;
98
+ }
99
+ .theme-bar .nivo-directionNav a:hover { color: #ddd; }
100
+
101
+ .theme-bar .nivo-caption {
102
+ font-family: Helvetica, Arial, sans-serif;
103
+ -webkit-transition: all 200ms ease-in-out;
104
+ -moz-transition: all 200ms ease-in-out;
105
+ -o-transition: all 200ms ease-in-out;
106
+ transition: all 200ms ease-in-out;
107
+ }
108
+ .theme-bar:hover .nivo-caption {
109
+ bottom: 41px;
110
+ }
111
+ .theme-bar .nivo-caption a {
112
+ color:#fff;
113
+ border-bottom:1px dotted #fff;
114
+ }
115
+ .theme-bar .nivo-caption a:hover {
116
+ color:#fff;
117
+ }
118
+
119
+ .theme-bar .nivo-controlNav.nivo-thumbs-enabled {
120
+ width: 100%;
121
+ }
122
+ .theme-bar .nivo-controlNav.nivo-thumbs-enabled a {
123
+ width: auto;
124
+ height: auto;
125
+ background: none;
126
+ margin-bottom: 5px;
127
+ }
128
+ .theme-bar .nivo-controlNav.nivo-thumbs-enabled img {
129
+ display: block;
130
+ width: 120px;
131
+ height: auto;
132
+ }
admin/js/themes/dark/arrows.png ADDED
Binary file
admin/js/themes/dark/bullets.png ADDED
Binary file
admin/js/themes/dark/loading.gif ADDED
Binary file
admin/js/themes/dark/styles.css ADDED
@@ -0,0 +1,102 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ Skin Name: Nivo Slider Dark Theme
3
+ Skin URI: http://nivo.dev7studios.com
4
+ Description: A dark skin for the Nivo Slider.
5
+ Version: 1.0
6
+ Author: Gilbert Pellegrom
7
+ Author URI: http://dev7studios.com
8
+ Supports Thumbs: true
9
+ */
10
+
11
+ .theme-dark.slider-wrapper {
12
+ background: #222;
13
+ padding: 10px;
14
+ }
15
+ .theme-dark .nivoSlider {
16
+ position:relative;
17
+ background:#fff url(loading.gif) no-repeat 50% 50%;
18
+ margin-bottom:10px;
19
+ overflow: visible;
20
+ }
21
+ .theme-dark .nivoSlider img {
22
+ position:absolute;
23
+ top:0px;
24
+ left:0px;
25
+ display:none;
26
+ }
27
+ .theme-dark .nivoSlider a {
28
+ border:0;
29
+ display:block;
30
+ }
31
+
32
+ .theme-dark .nivo-controlNav {
33
+ text-align: left;
34
+ padding: 0;
35
+ position: relative;
36
+ z-index: 10;
37
+ }
38
+ .theme-dark .nivo-controlNav a {
39
+ display:inline-block;
40
+ width:10px;
41
+ height:10px;
42
+ background:url(bullets.png) no-repeat 0 2px;
43
+ text-indent:-9999px;
44
+ border:0;
45
+ margin: 0 2px;
46
+ }
47
+ .theme-dark .nivo-controlNav a.active {
48
+ background-position:0 100%;
49
+ }
50
+
51
+ .theme-dark .nivo-directionNav a {
52
+ display:block;
53
+ width:30px;
54
+ height:30px;
55
+ background: url(arrows.png) no-repeat;
56
+ text-indent:-9999px;
57
+ border:0;
58
+ top: auto;
59
+ bottom: -36px;
60
+ z-index: 11;
61
+ }
62
+ .theme-dark .nivo-directionNav a:hover {
63
+ background-color: #333;
64
+ -webkit-border-radius: 2px;
65
+ -moz-border-radius: 2px;
66
+ border-radius: 2px;
67
+ }
68
+ .theme-dark a.nivo-nextNav {
69
+ background-position:-16px 50%;
70
+ right:0px;
71
+ }
72
+ .theme-dark a.nivo-prevNav {
73
+ background-position:11px 50%;
74
+ left: auto;
75
+ right: 35px;
76
+ }
77
+
78
+ .theme-dark .nivo-caption {
79
+ font-family: Helvetica, Arial, sans-serif;
80
+ }
81
+ .theme-dark .nivo-caption a {
82
+ color:#fff;
83
+ border-bottom:1px dotted #fff;
84
+ }
85
+ .theme-dark .nivo-caption a:hover {
86
+ color:#fff;
87
+ }
88
+
89
+ .theme-dark .nivo-controlNav.nivo-thumbs-enabled {
90
+ width: 80%;
91
+ }
92
+ .theme-dark .nivo-controlNav.nivo-thumbs-enabled a {
93
+ width: auto;
94
+ height: auto;
95
+ background: none;
96
+ margin-bottom: 5px;
97
+ }
98
+ .theme-dark .nivo-controlNav.nivo-thumbs-enabled img {
99
+ display: block;
100
+ width: 120px;
101
+ height: auto;
102
+ }
admin/js/themes/default/arrows.png ADDED
Binary file
admin/js/themes/default/bullets.png ADDED
Binary file
admin/js/themes/default/loading.gif ADDED
Binary file
admin/js/themes/default/styles.css ADDED
@@ -0,0 +1,101 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ Skin Name: Nivo Slider Default Theme
3
+ Skin URI: http://nivo.dev7studios.com
4
+ Description: The default skin for the Nivo Slider.
5
+ Version: 1.3
6
+ Author: Gilbert Pellegrom
7
+ Author URI: http://dev7studios.com
8
+ Supports Thumbs: true
9
+ */
10
+
11
+ .theme-default .nivoSlider {
12
+ position:relative;
13
+ background:#fff url(loading.gif) no-repeat 50% 50%;
14
+ margin-bottom:0px;
15
+ -webkit-box-shadow: 0px 1px 5px 0px #4a4a4a;
16
+ -moz-box-shadow: 0px 1px 5px 0px #4a4a4a;
17
+ box-shadow: 0px 1px 5px 0px #4a4a4a;
18
+ }
19
+ .theme-default .nivoSlider img {
20
+ position:absolute;
21
+ top:0px;
22
+ left:0px;
23
+ display:none;
24
+ }
25
+ .theme-default .nivoSlider a {
26
+ border:0;
27
+ display:block;
28
+ }
29
+
30
+ .theme-default .nivo-controlNav {
31
+ text-align: center;
32
+ padding: 20px 20px;
33
+ position: absolute;
34
+ right:0;
35
+ top: 0;
36
+ z-index: 1001;
37
+ opacity: 0.6;
38
+ }
39
+ .theme-default .nivo-controlNav:hover {
40
+ opacity: 1;
41
+ }
42
+ .theme-default .nivo-controlNav a {
43
+ display:inline-block;
44
+ width:22px;
45
+ height:22px;
46
+ background:url(bullets.png) no-repeat;
47
+ text-indent:-9999px;
48
+ border:0;
49
+ margin: 0 2px;
50
+ }
51
+ .theme-default .nivo-controlNav a.active {
52
+ background-position:0 -22px;
53
+ }
54
+
55
+ .theme-default .nivo-directionNav a {
56
+ display:block;
57
+ width:30px;
58
+ height:30px;
59
+ background:url(arrows.png) no-repeat;
60
+ text-indent:-9999px;
61
+ border:0;
62
+ opacity: 0;
63
+ -webkit-transition: all 200ms ease-in-out;
64
+ -moz-transition: all 200ms ease-in-out;
65
+ -o-transition: all 200ms ease-in-out;
66
+ transition: all 200ms ease-in-out;
67
+ }
68
+ .theme-default:hover .nivo-directionNav a { opacity: 1; }
69
+ .theme-default a.nivo-nextNav {
70
+ background-position:-30px 0;
71
+ right:15px;
72
+ }
73
+ .theme-default a.nivo-prevNav {
74
+ left:15px;
75
+ }
76
+
77
+ .theme-default .nivo-caption {
78
+ font-family: Helvetica, Arial, sans-serif;
79
+ }
80
+ .theme-default .nivo-caption a {
81
+ color:#fff;
82
+ border-bottom:1px dotted #fff;
83
+ }
84
+ .theme-default .nivo-caption a:hover {
85
+ color:#fff;
86
+ }
87
+
88
+ .theme-default .nivo-controlNav.nivo-thumbs-enabled {
89
+ width: 100%;
90
+ }
91
+ .theme-default .nivo-controlNav.nivo-thumbs-enabled a {
92
+ width: auto;
93
+ height: auto;
94
+ background: none;
95
+ margin-bottom: 5px;
96
+ }
97
+ .theme-default .nivo-controlNav.nivo-thumbs-enabled img {
98
+ display: block;
99
+ width: 120px;
100
+ height: auto;
101
+ }
admin/js/themes/light/arrows.png ADDED
Binary file
admin/js/themes/light/bullets.png ADDED
Binary file
admin/js/themes/light/loading.gif ADDED
Binary file
admin/js/themes/light/styles.css ADDED
@@ -0,0 +1,102 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ Skin Name: Nivo Slider Light Theme
3
+ Skin URI: http://nivo.dev7studios.com
4
+ Description: A light skin for the Nivo Slider.
5
+ Version: 1.0
6
+ Author: Gilbert Pellegrom
7
+ Author URI: http://dev7studios.com
8
+ Supports Thumbs: true
9
+ */
10
+
11
+ .theme-light.slider-wrapper {
12
+ background: #fff;
13
+ padding: 10px;
14
+ }
15
+ .theme-light .nivoSlider {
16
+ position:relative;
17
+ background:#fff url(loading.gif) no-repeat 50% 50%;
18
+ margin-bottom:10px;
19
+ overflow: visible;
20
+ }
21
+ .theme-light .nivoSlider img {
22
+ position:absolute;
23
+ top:0px;
24
+ left:0px;
25
+ display:none;
26
+ }
27
+ .theme-light .nivoSlider a {
28
+ border:0;
29
+ display:block;
30
+ }
31
+
32
+ .theme-light .nivo-controlNav {
33
+ text-align: left;
34
+ padding: 0;
35
+ position: relative;
36
+ z-index: 10;
37
+ }
38
+ .theme-light .nivo-controlNav a {
39
+ display:inline-block;
40
+ width:10px;
41
+ height:10px;
42
+ background:url(bullets.png) no-repeat;
43
+ text-indent:-9999px;
44
+ border:0;
45
+ margin: 0 2px;
46
+ }
47
+ .theme-light .nivo-controlNav a.active {
48
+ background-position:0 100%;
49
+ }
50
+
51
+ .theme-light .nivo-directionNav a {
52
+ display:block;
53
+ width:30px;
54
+ height:30px;
55
+ background: url(arrows.png) no-repeat;
56
+ text-indent:-9999px;
57
+ border:0;
58
+ top: auto;
59
+ bottom: -36px;
60
+ z-index: 11;
61
+ }
62
+ .theme-light .nivo-directionNav a:hover {
63
+ background-color: #eee;
64
+ -webkit-border-radius: 2px;
65
+ -moz-border-radius: 2px;
66
+ border-radius: 2px;
67
+ }
68
+ .theme-light a.nivo-nextNav {
69
+ background-position:160% 50%;
70
+ right:0px;
71
+ }
72
+ .theme-light a.nivo-prevNav {
73
+ background-position:-60% 50%;
74
+ left: auto;
75
+ right: 35px;
76
+ }
77
+
78
+ .theme-light .nivo-caption {
79
+ font-family: Helvetica, Arial, sans-serif;
80
+ }
81
+ .theme-light .nivo-caption a {
82
+ color:#fff;
83
+ border-bottom:1px dotted #fff;
84
+ }
85
+ .theme-light .nivo-caption a:hover {
86
+ color:#fff;
87
+ }
88
+
89
+ .theme-light .nivo-controlNav.nivo-thumbs-enabled {
90
+ width: 80%;
91
+ }
92
+ .theme-light .nivo-controlNav.nivo-thumbs-enabled a {
93
+ width: auto;
94
+ height: auto;
95
+ background: none;
96
+ margin-bottom: 5px;
97
+ }
98
+ .theme-light .nivo-controlNav.nivo-thumbs-enabled img {
99
+ display: block;
100
+ width: 120px;
101
+ height: auto;
102
+ }
admin/js/widgets_admin.js ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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();
6
+ if(jQuery(this).is(':checked')){
7
+ arr = inp.val();
8
+ if(arr) { var del = ','; } else { arr = ''; var del = ''; }
9
+ inp.val(arr+del+cur);
10
+ } else {
11
+ arr = inp.val().split(',');
12
+ arr = jQuery.grep(arr, function(a){ return a != cur; }).join(',');
13
+ if(arr) {
14
+ inp.val(arr);
15
+ } else {
16
+ inp.val('');
17
+ }
18
+ }
19
+ });
20
+ });
admin/manage-banner.php ADDED
@@ -0,0 +1,254 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
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
+ global $wpdb;
7
+ $filepath = admin_url() . 'admin.php?page=' . $_GET['page'];
8
+ $all_playlists = get_b_playlists();
9
+ $flag_options = get_option('flag_options');
10
+ $playlistPath = $flag_options['galleryPath'].'playlists/banner/'.$_GET['playlist'].'.xml';
11
+ $playlist = get_b_playlist_data(ABSPATH.$playlistPath);
12
+ $items_a = $playlist['items'];
13
+ $items = implode(',',$playlist['items']);
14
+ ?>
15
+ <script type="text/javascript">
16
+ //<![CDATA[
17
+ function checkAll(form)
18
+ {
19
+ form.find(':checkbox').each(function(){this.checked = !this.checked});
20
+ return false;
21
+ }
22
+
23
+ function getNumChecked(form)
24
+ {
25
+ var num = 0;
26
+ for (i = 0, n = form.elements.length; i < n; i++) {
27
+ if(form.elements[i].type == "checkbox") {
28
+ if(form.elements[i].name == "doaction[]")
29
+ if(form.elements[i].checked == true)
30
+ num++;
31
+ }
32
+ }
33
+ return num;
34
+ }
35
+
36
+ // this function check for a the number of selected images, sumbmit false when no one selected
37
+ function checkSelected() {
38
+
39
+ var numchecked = getNumChecked(document.getElementById('updatePlaylist'));
40
+
41
+ if(numchecked < 1) {
42
+ alert('<?php echo js_escape(__("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(js_escape(__("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(js_escape(__("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 ) {
58
+ var form = document.getElementById('updatePlaylist');
59
+ var elementlist = "";
60
+ for (i = 0, n = form.elements.length; i < n; i++) {
61
+ if(form.elements[i].type == "checkbox") {
62
+ if(form.elements[i].name == "doaction[]")
63
+ if(form.elements[i].checked == true)
64
+ if (elementlist == "")
65
+ elementlist = form.elements[i].value
66
+ else
67
+ elementlist += "," + form.elements[i].value ;
68
+ }
69
+ }
70
+ jQuery("#" + windowId + "_bulkaction").val(jQuery("#bulkaction").val());
71
+ jQuery("#" + windowId + "_playlist").val(elementlist);
72
+ tb_show("", "#TB_inline?width=640&height=" + height + "&inlineId=" + windowId + "&modal=true", false);
73
+ }
74
+ var current_image = '';
75
+ function send_to_editor(html) {
76
+ var source = html.match(/src=\".*\" alt/);
77
+ source = source[0].replace(/^src=\"/, "").replace(/" alt$/, "");
78
+ if(insFor=='preview') {
79
+ jQuery('#preview-'+actInp).attr('value', source);
80
+ jQuery('#preview_txt-'+actInp).attr('src', source).text(source);
81
+ }
82
+ tb_remove();
83
+ }
84
+ jQuery(document).ready(function(){
85
+ jQuery('.del_preview').click(function(){
86
+ var id = jQuery(this).attr('data-id');
87
+ jQuery('#preview-'+id).attr('value', '');
88
+ jQuery('#preview_txt-'+id).attr('src', '#none').text('');
89
+ return false;
90
+ });
91
+ jQuery('#skinname').change(function(){
92
+ var skin = jQuery(this).val();
93
+ jQuery('#skinOptions').attr("href","<?php echo FLAG_URLPATH; ?>admin/skin_options.php?show_options=1&amp;skin="+skin+"&amp;TB_iframe=1&amp;width=600&amp;height=560");
94
+ });
95
+ })
96
+ //]]>
97
+ </script>
98
+
99
+ <div class="wrap">
100
+ <h2><?php _e( 'Playlist', 'flag' ); ?>: <?php echo $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');
108
+ if ($playlist_file == $_GET['playlist']) continue;
109
+ ?>
110
+ <option value="<?php echo $filepath."&amp;playlist=".$playlist_name."&amp;mode=edit"; ?>"><?php echo $playlist_data['title']; ?></option>
111
+ <?php
112
+ }
113
+ ?>
114
+ </select>
115
+ </div>
116
+ <form id="updatePlaylist" class="flagform" method="POST" action="<?php echo $filepath."&amp;playlist=".$_GET['playlist']."&amp;mode=edit"; ?>" accept-charset="utf-8">
117
+ <?php wp_nonce_field('flag_updateplaylist'); ?>
118
+ <input type="hidden" name="page" value="manage-playlist" />
119
+
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 $_GET['playlist']; ?>]" /></td>
129
+ <td rowspan="3" align="left" valign="top"><div style="font-size:11px;"><strong style="display: inline-block; width: 100px;"><?php _e("Playlist Skin", 'flag'); ?>:</strong>
130
+ <input id="skinaction" type="hidden" name="skinaction" value="<?php echo $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="banner_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='.$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 $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 $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>
161
+ <div class="clear"></div>
162
+ </div>
163
+ </div>
164
+ </div></div></div>
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 $filepath."&amp;playlist=".$_GET['playlist']."&amp;mode=sort"; ?>" class="button-secondary alignleft" style="margin:1px 10px 0 0;"><?php _e("Sort Playlist",'flag')?></a>
173
+ <a href="<?php echo $filepath."&amp;playlist=".$_GET['playlist']."&amp;mode=add"; ?>" 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" 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>
198
+ <?php
199
+ if(count($items_a)) {
200
+ $counter = 0;
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
+ ?>
217
+ <tr id="ban-<?php echo $ban->ID; ?>"<?php echo $alt; ?> valign="top">
218
+ <th class="cb" scope="row"><input name="doaction[]" type="checkbox" value="<?php echo $ban->ID; ?>" /></th>
219
+ <td class="id"><p style="white-space: nowrap;">ID: <?php echo $ban->ID; ?></p></td>
220
+ <td class="thumb">
221
+ <a class="thickbox" title="<?php echo basename($url); ?>" href="<?php echo $url; ?>"><img id="thumb-<?php echo $ban->ID; ?>" src="<?php echo $thumb; ?>" width="100" height="100" alt="" /></a>
222
+ </td>
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 $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 $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 $ban->post_content; ?></textarea>
230
+ </td>
231
+ </tr>
232
+ <?php
233
+ }
234
+ }
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 $filepath."&amp;playlist=".$_GET['playlist']."&amp;mode=add"; ?>">
247
+ <input type="hidden" name="items" value="<?php echo $items; ?>" />
248
+ </form>
249
+ <br class="clear"/>
250
+ </div><!-- /#wrap -->
251
+ <?php
252
+ }
253
+
254
+ ?>
admin/manage-galleries.php ADDED
@@ -0,0 +1,367 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ $perpage = 50;
15
+ $start = ( $_GET['paged'] - 1 ) * $perpage;
16
+ $gallerylist = $flagdb->find_all_galleries('gid', 'asc', TRUE, $perpage, $start, false);
17
+
18
+ $page_links = paginate_links( array(
19
+ 'base' => add_query_arg( 'paged', '%#%' ),
20
+ 'format' => '',
21
+ 'prev_text' => __('&laquo;'),
22
+ 'next_text' => __('&raquo;'),
23
+ 'total' => $flagdb->paged['max_objects_per_page'],
24
+ 'current' => $_GET['paged']
25
+ ));
26
+
27
+ ?>
28
+ <script type="text/javascript">
29
+ <!--
30
+ function checkAll(form)
31
+ {
32
+ for (i = 0, n = form.elements.length; i < n; i++) {
33
+ if(form.elements[i].type == "checkbox") {
34
+ if(form.elements[i].name == "doaction[]") {
35
+ if(form.elements[i].checked == true)
36
+ form.elements[i].checked = false;
37
+ else
38
+ form.elements[i].checked = true;
39
+ }
40
+ }
41
+ }
42
+ }
43
+
44
+ function getNumChecked(form)
45
+ {
46
+ var num = 0;
47
+ for (i = 0, n = form.elements.length; i < n; i++) {
48
+ if(form.elements[i].type == "checkbox") {
49
+ if(form.elements[i].name == "doaction[]")
50
+ if(form.elements[i].checked == true)
51
+ num++;
52
+ }
53
+ }
54
+ return num;
55
+ }
56
+
57
+ // this function check for a the number of selected images, sumbmit false when no one selected
58
+ function checkSelected() {
59
+
60
+ var numchecked = getNumChecked(document.getElementById('editgalleries'));
61
+
62
+ if(numchecked < 1) {
63
+ alert('<?php echo js_escape(__('No images selected', 'flag')); ?>');
64
+ return false;
65
+ }
66
+
67
+ actionId = jQuery('#bulkaction').val();
68
+
69
+ switch (actionId) {
70
+ case "resize_images":
71
+ showDialog('resize_images', 120);
72
+ return false;
73
+ break;
74
+ case "new_thumbnail":
75
+ showDialog('new_thumbnail', 160);
76
+ return false;
77
+ break;
78
+ }
79
+
80
+ return confirm('<?php echo sprintf(js_escape(__("You are about to start the bulk edit for %s galleries \n \n 'Cancel' to stop, 'OK' to proceed.",'flag')), "' + numchecked + '") ; ?>');
81
+ }
82
+
83
+ function showDialog( windowId, height ) {
84
+ var form = document.getElementById('editgalleries');
85
+ var elementlist = "";
86
+ for (i = 0, n = form.elements.length; i < n; i++) {
87
+ if(form.elements[i].type == "checkbox") {
88
+ if(form.elements[i].name == "doaction[]")
89
+ if(form.elements[i].checked == true)
90
+ if (elementlist == "")
91
+ elementlist = form.elements[i].value
92
+ else
93
+ elementlist += "," + form.elements[i].value ;
94
+ }
95
+ }
96
+ jQuery("#" + windowId + "_bulkaction").val(jQuery("#bulkaction").val());
97
+ jQuery("#" + windowId + "_imagelist").val(elementlist);
98
+ // console.log (jQuery("#TB_imagelist").val());
99
+ tb_show("", "#TB_inline?width=640&height=" + height + "&inlineId=" + windowId + "&modal=true", false);
100
+ }
101
+
102
+ //-->
103
+ </script>
104
+ <div class="wrap">
105
+ <h2><?php _e('Gallery Overview', 'flag'); ?></h2>
106
+ <form class="search-form" action="" method="get">
107
+ <p class="search-box">
108
+ <label class="hidden" for="media-search-input"><?php _e( 'Search Images', 'flag' ); ?>:</label>
109
+ <input type="hidden" id="page-name" name="page" value="flag-manage-gallery" />
110
+ <input type="text" id="media-search-input" name="s" value="<?php the_search_query(); ?>" />
111
+ <input type="submit" value="<?php _e( 'Search Images', 'flag' ); ?>" class="button" />
112
+ </p>
113
+ </form>
114
+ <form id="editgalleries" class="flagform" method="POST" action="<?php echo $flag->manage_page->base_page . '&amp;paged=' . $_GET['paged']; ?>" accept-charset="utf-8">
115
+ <?php wp_nonce_field('flag_bulkgallery'); ?>
116
+ <input type="hidden" name="page" value="manage-galleries" />
117
+
118
+ <div class="tablenav">
119
+
120
+ <div class="alignleft actions">
121
+ <?php if ( function_exists('json_encode') ) : ?>
122
+ <select name="bulkaction" id="bulkaction">
123
+ <option value="no_action" ><?php _e("No action",'flag'); ?></option>
124
+ <option value="new_thumbnail" ><?php _e("Create new thumbnails",'flag'); ?></option>
125
+ <option value="resize_images" ><?php _e("Resize images",'flag'); ?></option>
126
+ <option value="import_meta" ><?php _e("Import metadata",'flag'); ?></option>
127
+ <option value="copy_meta" ><?php _e("Metadata to description",'flag'); ?></option>
128
+ </select>
129
+ <input name="showThickbox" class="button-secondary" type="submit" value="<?php _e('Apply','flag'); ?>" onclick="if ( !checkSelected() ) return false;" />
130
+ <?php endif; ?>
131
+ </div>
132
+
133
+ <?php if ( $page_links ) : ?>
134
+ <div class="tablenav-pages"><?php $page_links_text = sprintf( '<span class="displaying-num">' . __( 'Displaying %s&#8211;%s of %s' ) . '</span>%s',
135
+ number_format_i18n( ( $_GET['paged'] - 1 ) * $perpage + 1 ),
136
+ number_format_i18n( min( $_GET['paged'] * $perpage, $flagdb->paged['total_objects'] ) ),
137
+ number_format_i18n( $flagdb->paged['total_objects'] ),
138
+ $page_links
139
+ ); echo $page_links_text; ?></div>
140
+ <br class="clear" />
141
+ <?php endif; ?>
142
+
143
+ </div>
144
+ <table class="widefat" cellspacing="0">
145
+ <thead>
146
+ <tr>
147
+ <th scope="col" class="cb column-cb" >
148
+ <input type="checkbox" onclick="checkAll(document.getElementById('editgalleries'));" name="checkall"/>
149
+ </th>
150
+ <th scope="col" ><?php _e('ID'); ?></th>
151
+ <th scope="col" width="25%"><?php _e('Title', 'flag'); ?></th>
152
+ <th scope="col" width="55%"><?php _e('Description', 'flag'); ?></th>
153
+ <th scope="col" ><?php _e('Author', 'flag'); ?></th>
154
+ <th scope="col" ><?php _e('Quantity', 'flag'); ?></th>
155
+ <th scope="col" ><?php _e('Action', 'flag'); ?></th>
156
+ </tr>
157
+ </thead>
158
+ <tbody>
159
+ <?php
160
+ if($gallerylist) {
161
+ foreach($gallerylist as $gallery) {
162
+ $class = ( !isset($class) || $class == 'class="alternate"' ) ? '' : 'class="alternate"';
163
+ $gid = $gallery->gid;
164
+ $name = (empty($gallery->title) ) ? $gallery->name : $gallery->title;
165
+ $author_user = get_userdata( (int) $gallery->author );
166
+ ?>
167
+ <tr id="gallery-<?php echo $gid; ?>" <?php echo $class; ?> >
168
+ <th scope="row" class="cb column-cb">
169
+ <?php if (flagAdmin::can_manage_this_gallery($gallery->author)) { ?>
170
+ <input name="doaction[]" type="checkbox" value="<?php echo $gid; ?>" />
171
+ <?php } ?>
172
+ </th>
173
+ <td scope="row"><?php echo $gid; ?></td>
174
+ <td>
175
+ <?php if (flagAdmin::can_manage_this_gallery($gallery->author)) { ?>
176
+ <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'); ?>" >
177
+ <?php echo flagGallery::i18n($name); ?>
178
+ </a>
179
+ <?php } else { ?>
180
+ <?php echo flagGallery::i18n($gallery->title); ?>
181
+ <?php } ?>
182
+ </td>
183
+ <td><?php echo flagGallery::i18n($gallery->galdesc); ?>&nbsp;</td>
184
+ <td><?php echo $author_user->display_name; ?></td>
185
+ <td><?php echo $gallery->counter; ?></td>
186
+ <td>
187
+ <?php if (flagAdmin::can_manage_this_gallery($gallery->author)) : ?>
188
+ <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>
189
+ <?php endif; ?>
190
+ </td>
191
+ </tr>
192
+ <?php
193
+ }
194
+ } else {
195
+ echo '<tr><td colspan="7" align="center"><strong>'.__('No entries found','flag').'</strong></td></tr>';
196
+ }
197
+ ?>
198
+ </tbody>
199
+ </table>
200
+ </form>
201
+ </div>
202
+ <script type="text/javascript">
203
+ /*<![CDATA[*/
204
+ jQuery(document).ready(function(){
205
+ jQuery(".albums_table .album_categoties").sortable({ opacity: 0.6, cursor: 'move', connectWith: ".album_categoties", update: function() {
206
+ //jQuery.post("updateDB.php", order, function(theResponse){
207
+ // jQuery("#contentRight").html(theResponse);
208
+ //});
209
+ }
210
+ }).disableSelection();
211
+ jQuery( "#draggable .acat" ).draggable({
212
+ connectToSortable: ".album_categoties",
213
+ helper: "clone",
214
+ revert: "invalid"
215
+ }).disableSelection();
216
+ jQuery( ".album_categoties" ).droppable({
217
+ accept: ".acat",
218
+ hoverClass: "active",
219
+ drop: function( event, ui ) {
220
+ jQuery( this ).find(jQuery(ui.draggable))
221
+ .addClass( "highlight_new" ).attr("id", "g_"+jQuery(ui.draggable).attr('rel'))
222
+ .find( "p" )
223
+ .remove();
224
+ }
225
+ });
226
+ jQuery( ".album_categoties .drop" ).live('click',function(){
227
+ jQuery(this).parent().remove();
228
+ });
229
+ jQuery('.flag-ajax-post').click(function(e){
230
+ var form = jQuery(this).attr('data-form');
231
+ var edata = jQuery(this).dataset();
232
+ edata.form = jQuery('#'+form).serialize()+'&'+jQuery(this).parents('.album').find('.album_categoties').sortable("serialize");
233
+ ;
234
+ jQuery.post( ajaxurl, edata,
235
+ function( response ) {
236
+ jQuery(e.target).parent().find('.alb_msg').show().html(response).fadeOut(1200);
237
+ if(jQuery(e.target).hasClass('del')) {
238
+ jQuery(e.target).parent().parent().parent().remove();
239
+ }
240
+ if(response == 'Success'){
241
+ jQuery(e.target).parents('div.album:first').find('.acat').removeClass('highlight_new');
242
+ jQuery(e.target).parents('span.album_actions').find('.alb_msg').show().text('OK').fadeOut(1200);
243
+ }
244
+ }
245
+ );
246
+ return false;
247
+ });
248
+ });
249
+ /*]]>*/
250
+ </script>
251
+ <div class="wrap">
252
+ <h2><?php _e('Albums', 'flag'); ?></h2>
253
+ <form method="post" style="width: 658px; float: left;"><?php wp_nonce_field('flag_album'); ?>
254
+ <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>
255
+ <h2><?php _e('Categories', 'flag'); ?></h2>
256
+ <div class="clear"></div>
257
+ <div class="floatholder">
258
+ <div class="albums_table">
259
+ <?php $albumlist = $flagdb->find_all_albums();
260
+ $nonce = wp_create_nonce( 'wpMediaLib' );
261
+ if($albumlist) {
262
+ foreach($albumlist as $album) {
263
+ ?>
264
+ <div class="album">
265
+ <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 $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="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;<span class="album_save flag-ajax-post button" 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>
266
+ <div class="album_categoties">
267
+ <?php $galids = explode(',',$album->categories);
268
+ if($album->categories) {
269
+ foreach($galids as $galid) {
270
+ $acat = $flagdb->find_gallery($galid);
271
+ ?>
272
+
273
+ <div class="acat" id="g_<?php echo $acat->gid; ?>"><?php echo $acat->title; ?><span class="drop">x</span></div>
274
+ <?php }
275
+ } else {
276
+ echo '<p style="text-align:center; padding: 7px 0; margin: 0;">'.__('Drag&Drop Categories Here','flag').'</p>';
277
+ }
278
+ ?>
279
+ </div>
280
+ </div>
281
+ <?php }
282
+ } else {
283
+ echo '<p style="text-align:center; padding: 20px 0; margin: 0;">'.__('No Albums','flag').'</p>';
284
+ }
285
+ ?>
286
+ </div>
287
+ <div class="all_galleries" id="draggable">
288
+ <?php
289
+ if($gallerylist) {
290
+ foreach($gallerylist as $gallery) {
291
+ $gid = $gallery->gid;
292
+ $name = (empty($gallery->title) ) ? $gallery->name : $gallery->title;
293
+ $author_user = get_userdata( (int) $gallery->author );
294
+ if (flagAdmin::can_manage_this_gallery($gallery->author)) {
295
+ ?>
296
+ <div class="acat" rel="<?php echo $gid; ?>"><?php echo $name; ?><span class="drop">x</span></div>
297
+ <?php
298
+ }
299
+ }
300
+ }
301
+ ?>
302
+ </div>
303
+ </div>
304
+ </div>
305
+
306
+ <!-- #resize_images -->
307
+ <div id="resize_images" style="display: none;" >
308
+ <form id="form_resize_images" method="POST" accept-charset="utf-8">
309
+ <?php wp_nonce_field('flag_thickbox_form'); ?>
310
+ <input type="hidden" id="resize_images_imagelist" name="TB_imagelist" value="" />
311
+ <input type="hidden" id="resize_images_bulkaction" name="TB_bulkaction" value="" />
312
+ <input type="hidden" name="page" value="manage-galleries" />
313
+ <table width="100%" border="0" cellspacing="3" cellpadding="3" >
314
+ <tr valign="top">
315
+ <td>
316
+ <strong><?php _e('Resize Images to', 'flag'); ?>:</strong>
317
+ </td>
318
+ <td>
319
+ <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']; ?>" />
320
+ <br /><small><?php _e('Width x height (in pixel). FlAGallery will keep ratio size','flag'); ?></small>
321
+ </td>
322
+ </tr>
323
+ <tr align="right">
324
+ <td colspan="2" class="submit">
325
+ <input class="button-primary" type="submit" name="TB_ResizeImages" value="<?php _e('OK', 'flag'); ?>" />
326
+ &nbsp;
327
+ <input class="button-secondary" type="reset" value="&nbsp;<?php _e('Cancel', 'flag'); ?>&nbsp;" onclick="tb_remove()"/>
328
+ </td>
329
+ </tr>
330
+ </table>
331
+ </form>
332
+ </div>
333
+ <!-- /#resize_images -->
334
+
335
+ <!-- #new_thumbnail -->
336
+ <div id="new_thumbnail" style="display: none;" >
337
+ <form id="form_new_thumbnail" method="POST" accept-charset="utf-8">
338
+ <?php wp_nonce_field('flag_thickbox_form'); ?>
339
+ <input type="hidden" id="new_thumbnail_imagelist" name="TB_imagelist" value="" />
340
+ <input type="hidden" id="new_thumbnail_bulkaction" name="TB_bulkaction" value="" />
341
+ <input type="hidden" name="page" value="manage-galleries" />
342
+ <table width="100%" border="0" cellspacing="3" cellpadding="3" >
343
+ <tr valign="top">
344
+ <th align="left"><?php _e('Width x height (in pixel)','flag'); ?></th>
345
+ <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']; ?>" />
346
+ <br /><small><?php _e('These values are maximum values ','flag'); ?></small></td>
347
+ </tr>
348
+ <tr valign="top">
349
+ <th align="left"><?php _e('Set fix dimension','flag'); ?></th>
350
+ <td><input type="checkbox" name="thumbFix" value="1" <?php checked('1', $flag->options['thumbFix']); ?> />
351
+ <br /><small><?php _e('Ignore the aspect ratio, no portrait thumbnails','flag'); ?></small></td>
352
+ </tr>
353
+ <tr align="right">
354
+ <td colspan="2" class="submit">
355
+ <input class="button-primary" type="submit" name="TB_NewThumbnail" value="<?php _e('OK', 'flag'); ?>" />
356
+ &nbsp;
357
+ <input class="button-secondary" type="reset" value="&nbsp;<?php _e('Cancel', 'flag'); ?>&nbsp;" onclick="tb_remove()"/>
358
+ </td>
359
+ </tr>
360
+ </table>
361
+ </form>
362
+ </div>
363
+ <!-- /#new_thumbnail -->
364
+
365
+ <?php
366
+ }
367
+ ?>
admin/manage-images.php ADDED
@@ -0,0 +1,609 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You are not allowed to call this page directly.');}
4
+
5
+ function flag_picturelist() {
6
+ // *** show picture list
7
+ global $wpdb, $flagdb, $user_ID, $flag;
8
+
9
+ // Look if its a search result
10
+ $is_search = isset ($_GET['s']) ? true : false;
11
+
12
+ if ($is_search) {
13
+
14
+ // fetch the imagelist
15
+ $picturelist = $flag->manage_page->search_result;
16
+
17
+ // we didn't set a gallery or a pagination
18
+ $act_gid = 0;
19
+ $_GET['paged'] = 1;
20
+ $page_links = false;
21
+
22
+ } else {
23
+
24
+ // GET variables
25
+ $act_gid = $flag->manage_page->gid;
26
+
27
+ // Load the gallery metadata
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
+
41
+ // look for pagination
42
+ if ( ! isset( $_GET['paged'] ) || $_GET['paged'] < 1 )
43
+ $_GET['paged'] = 1;
44
+
45
+ $start = ( $_GET['paged'] - 1 ) * 50;
46
+
47
+ // get picture values
48
+ $picturelist = $flagdb->get_gallery($act_gid, $flag->options['galSort'], $flag->options['galSortDir'], false, 50, $start );
49
+
50
+ // build pagination
51
+ $page_links = paginate_links( array(
52
+ 'base' => add_query_arg( 'paged', '%#%' ),
53
+ 'format' => '',
54
+ 'prev_text' => __('&laquo;'),
55
+ 'next_text' => __('&raquo;'),
56
+ 'total' => $flagdb->paged['max_objects_per_page'],
57
+ 'current' => $_GET['paged']
58
+ ));
59
+
60
+ // get the current author
61
+ $act_author_user = get_userdata( (int) $gallery->author );
62
+
63
+ }
64
+
65
+ // list all galleries
66
+ $gallerylist = $flagdb->find_all_galleries();
67
+
68
+ //get the columns
69
+ $gallery_columns = flag_manage_gallery_columns();
70
+ $hidden_columns = get_hidden_columns('flag-manage-images');
71
+ if($picturelist){
72
+ foreach($picturelist as $p){
73
+ $a_hits[] = $p->hitcounter;
74
+ }
75
+ if(!array_sum($a_hits)){
76
+ $hidden_columns[] = 'views_likes';
77
+ $hidden_columns[] = 'rating';
78
+ }
79
+ } else {
80
+ $hidden_columns[] = 'views_likes';
81
+ $hidden_columns[] = 'rating';
82
+ }
83
+ $num_columns = count($gallery_columns) - count($hidden_columns);
84
+ ?>
85
+ <!--[if lt IE 8]>
86
+ <style type="text/css">
87
+ .custom_thumb {
88
+ display : none;
89
+ }
90
+ </style>
91
+ <![endif]-->
92
+
93
+ <script type="text/javascript">
94
+ //<![CDATA[
95
+ function showDialog( windowId, height ) {
96
+ var form = document.getElementById('updategallery');
97
+ var elementlist = "";
98
+ for (i = 0, n = form.elements.length; i < n; i++) {
99
+ if(form.elements[i].type == "checkbox") {
100
+ if(form.elements[i].name == "doaction[]")
101
+ if(form.elements[i].checked == true)
102
+ if (elementlist == "")
103
+ elementlist = form.elements[i].value
104
+ else
105
+ elementlist += "," + form.elements[i].value ;
106
+ }
107
+ }
108
+ jQuery("#" + windowId + "_bulkaction").val(jQuery("#bulkaction").val());
109
+ jQuery("#" + windowId + "_imagelist").val(elementlist);
110
+ // console.log (jQuery("#TB_imagelist").val());
111
+ tb_show("", "#TB_inline?width=640&height=" + height + "&inlineId=" + windowId + "&modal=true", false);
112
+ }
113
+
114
+ function checkAll(form)
115
+ {
116
+ for (i = 0, n = form.elements.length; i < n; i++) {
117
+ if(form.elements[i].type == "checkbox") {
118
+ if(form.elements[i].name == "doaction[]") {
119
+ if(form.elements[i].checked == true)
120
+ form.elements[i].checked = false;
121
+ else
122
+ form.elements[i].checked = true;
123
+ }
124
+ }
125
+ }
126
+ }
127
+
128
+ function getNumChecked(form)
129
+ {
130
+ var num = 0;
131
+ for (i = 0, n = form.elements.length; i < n; i++) {
132
+ if(form.elements[i].type == "checkbox") {
133
+ if(form.elements[i].name == "doaction[]")
134
+ if(form.elements[i].checked == true)
135
+ num++;
136
+ }
137
+ }
138
+ return num;
139
+ }
140
+
141
+ // this function check for a the number of selected images, sumbmit false when no one selected
142
+ function checkSelected() {
143
+
144
+ var numchecked = getNumChecked(document.getElementById('updategallery'));
145
+
146
+ if(numchecked < 1) {
147
+ alert('<?php echo js_escape(__("No images selected", "flag")); ?>');
148
+ return false;
149
+ }
150
+
151
+ actionId = jQuery('#bulkaction').val();
152
+
153
+ switch (actionId) {
154
+ case "copy_to":
155
+ case "move_to":
156
+ showDialog('selectgallery', 120);
157
+ return false;
158
+ break;
159
+ case "resize_images":
160
+ showDialog('resize_images', 120);
161
+ return false;
162
+ break;
163
+ case "new_thumbnail":
164
+ showDialog('new_thumbnail', 160);
165
+ return false;
166
+ break;
167
+ }
168
+
169
+ return confirm('<?php echo sprintf(js_escape(__("You are about to start the bulk edit for %s images \n \n 'Cancel' to stop, 'OK' to proceed.",'flag')), "' + numchecked + '") ; ?>');
170
+ }
171
+
172
+ jQuery(document).ready( function() {
173
+ // close postboxes that should be closed
174
+ jQuery('.if-js-closed').removeClass('if-js-closed').addClass('closed');
175
+ postboxes.add_postbox_toggles('flag-manage-gallery');
176
+
177
+ });
178
+ //]]>
179
+ </script>
180
+
181
+ <div class="wrap">
182
+
183
+ <?php if ($is_search) :?>
184
+ <h2><?php printf( __('Search results for &#8220;%s&#8221;', 'flag'), wp_specialchars( get_search_query() ) ); ?></h2>
185
+ <form class="search-form" action="" method="get">
186
+ <p class="search-box">
187
+ <label class="hidden" for="media-search-input"><?php _e( 'Search Images', 'flag' ); ?>:</label>
188
+ <input type="hidden" id="page-name" name="page" value="flag-manage-gallery" />
189
+ <input type="text" id="media-search-input" name="s" value="<?php the_search_query(); ?>" />
190
+ <input type="submit" value="<?php _e( 'Search Images', 'flag' ); ?>" class="button" />
191
+ </p>
192
+ </form>
193
+
194
+ <br style="clear: both;" />
195
+
196
+ <form id="updategallery" class="flagform" method="POST" action="<?php echo $flag->manage_page->base_page . '&amp;mode=edit&amp;s=' . $_GET['s']; ?>" accept-charset="utf-8">
197
+ <?php wp_nonce_field('flag_updategallery'); ?>
198
+ <input type="hidden" name="page" value="manage-images" />
199
+
200
+ <?php else :?>
201
+
202
+ <h2><?php echo _n( 'Gallery', 'Galleries', 1, 'flag' ); ?> : <?php echo flagGallery::i18n($gallery->title); ?></h2>
203
+ <select name="select_gid" style="width:180px; float: right; margin: -20px 3px 0 0;" onchange="window.location.href=this.options[this.selectedIndex].value">
204
+ <option selected="selected"><?php _e('Choose another gallery', 'flag'); ?></option>
205
+ <?php
206
+ foreach ($gallerylist as $gal) {
207
+ if ($gal->gid != $act_gid) {
208
+ ?>
209
+ <option value="<?php echo wp_nonce_url( $flag->manage_page->base_page . "&amp;mode=edit&amp;gid=" . $gal->gid, 'flag_editgallery')?>" ><?php echo $gal->gid; ?> - <?php echo attribute_escape(stripslashes($gal->title)); ?></option>
210
+ <?php
211
+ }
212
+ }
213
+ ?>
214
+ </select>
215
+
216
+ <form id="updategallery" class="flagform" method="POST" action="<?php echo $flag->manage_page->base_page . '&amp;mode=edit&amp;gid=' . $act_gid . '&amp;paged=' . $_GET['paged']; ?>" accept-charset="utf-8">
217
+ <?php wp_nonce_field('flag_updategallery'); ?>
218
+ <input type="hidden" name="page" value="manage-images" />
219
+
220
+ <div id="poststuff" class="metabox-holder">
221
+ <?php wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false ); ?>
222
+ <div id="post-body"><div id="post-body-content"><div id="normal-sortables" class="meta-box-sortables ui-sortable" style="position: relative;">
223
+ <div id="flagalleryset" class="postbox <?php echo postbox_classes('flagalleryset', 'flag-manage-gallery'); ?>" >
224
+ <div class="handlediv" title="Click to toggle"><br/></div>
225
+ <h3 class="hndle"><span><?php _e('Gallery settings', 'flag'); ?></span></h3>
226
+ <div class="inside">
227
+ <table class="form-table" >
228
+ <tr>
229
+ <th align="left" scope="row"><?php _e('Title', 'flag'); ?>:</th>
230
+ <td align="left"><input type="text" size="50" name="title" value="<?php echo $gallery->title; ?>" /></td>
231
+ </tr>
232
+ <tr>
233
+ <th align="left" scope="row"><?php _e('Description', 'flag'); ?>:</th>
234
+ <td align="left"><textarea name="gallerydesc" cols="30" rows="3" style="width: 95%" ><?php echo $gallery->galdesc; ?></textarea></td>
235
+ </tr>
236
+ <tr>
237
+ <th align="left" scope="row"><?php _e('Path', 'flag'); ?>:</th>
238
+ <td align="left"><input <?php if (IS_WPMU) echo 'readonly = "readonly"'; ?> type="text" size="50" name="path" value="<?php echo $gallery->path; ?>" /></td>
239
+ </tr>
240
+ <tr>
241
+ <th align="right" scope="row"><?php _e('Author', 'flag'); ?>:</th>
242
+ <td align="left">
243
+ <?php
244
+ $editable_ids = $flag->manage_page->get_editable_user_ids( $user_ID );
245
+ if ( $editable_ids && count( $editable_ids ) > 1 )
246
+ wp_dropdown_users( array('include' => $editable_ids, 'name' => 'author', 'selected' => empty( $gallery->author ) ? 0 : $gallery->author ) );
247
+ else
248
+ echo $act_author_user->display_name;
249
+ ?>
250
+ <input type="hidden" name="previewpic" value="<?php if(is_array($picturelist)) echo $picturelist[0]->pid; ?>" />
251
+ </td>
252
+ </tr>
253
+ </table>
254
+
255
+ <div class="submit">
256
+ <input type="submit" class="button-secondary" name="scanfolder" value="<?php _e("Scan Folder for new images",'flag')?> " />
257
+ <input type="submit" class="button-primary action" name="updatepictures" value="<?php _e("Save Changes",'flag')?>" />
258
+ </div>
259
+ <div class="clear"></div>
260
+ </div>
261
+ </div>
262
+ </div></div></div>
263
+ </div> <!-- poststuff -->
264
+ <?php endif; ?>
265
+
266
+ <div class="tablenav flag-tablenav">
267
+ <?php if ( $page_links ) : ?>
268
+ <div class="tablenav-pages"><?php $page_links_text = sprintf( '<span class="displaying-num">' . __( 'Displaying %s&#8211;%s of %s' ) . '</span>%s',
269
+ number_format_i18n( ( $_GET['paged'] - 1 ) * $flagdb->paged['objects_per_page'] + 1 ),
270
+ number_format_i18n( min( $_GET['paged'] * $flagdb->paged['objects_per_page'], $flagdb->paged['total_objects'] ) ),
271
+ number_format_i18n( $flagdb->paged['total_objects'] ),
272
+ $page_links
273
+ ); echo $page_links_text; ?></div>
274
+ <?php endif; ?>
275
+ <div class="alignleft actions">
276
+ <select id="bulkaction" name="bulkaction" class="alignleft">
277
+ <option value="no_action" ><?php _e("No action",'flag')?></option>
278
+ <option value="new_thumbnail" ><?php _e("Create new thumbnails",'flag')?></option>
279
+ <option value="resize_images" ><?php _e("Resize images",'flag')?></option>
280
+ <option value="delete_images" ><?php _e("Delete images",'flag')?></option>
281
+ <option value="import_meta" ><?php _e("Import metadata",'flag')?></option>
282
+ <option value="copy_meta" ><?php _e("Metadata to description",'flag')?></option>
283
+ <option value="copy_to" ><?php _e("Copy to...",'flag')?></option>
284
+ <option value="move_to"><?php _e("Move to...",'flag')?></option>
285
+ </select>
286
+ <input class="button-secondary alignleft" style="margin-right:10px;" type="submit" name="showThickbox" value="<?php _e("OK",'flag')?>" onclick="if ( !checkSelected() ) return false;" />
287
+
288
+ <?php if (($flag->options['galSort'] == "sortorder") && (!$is_search) ) { ?>
289
+ <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>
290
+ <?php }
291
+ if(current_user_can('FlAG Upload images') && (!$is_search)){ ?>
292
+ <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>
293
+ <?php } ?>
294
+ <input type="submit" name="updatepictures" class="button-primary action alignleft" value="<?php _e("Save Changes",'flag')?>" />
295
+ </div>
296
+ </div>
297
+
298
+ <table id="flag-listimages" class="widefat fixed" cellspacing="0" >
299
+
300
+ <thead>
301
+ <tr>
302
+ <?php foreach($gallery_columns as $key=>$value){
303
+ if ( in_array($key, $hidden_columns) )
304
+ continue;
305
+ echo $cols = '<th class="manage-column column-'.$key.'">'.$value.'</td>';
306
+ }
307
+ ?>
308
+ </tr>
309
+ </thead>
310
+ <tfoot>
311
+ <tr>
312
+ <?php foreach($gallery_columns as $key=>$value){
313
+ if ( in_array($key, $hidden_columns) )
314
+ continue;
315
+ if($key == 'cb' && !$header) { $value = ''; }
316
+ echo $cols = '<th class="manage-column column-'.$key.'">'.$value.'</td>';
317
+ }
318
+ ?>
319
+ </tr>
320
+ </tfoot>
321
+ <tbody>
322
+ <?php
323
+ if($picturelist) {
324
+
325
+ $thumbsize = '';
326
+ $counter = 0;
327
+
328
+ if ($flag->options['thumbFix']) {
329
+ $thumbsize = 'width="'.$flag->options['thumbWidth'].'" height="'.$flag->options['thumbHeight'].'"';
330
+ }
331
+
332
+ $rt=array(24.5, 45.7, 54.8, 59.3, 64.7, 68.9, 71.5, 73.7, 75.9, 77.1);
333
+
334
+ foreach($picturelist as $picture) {
335
+
336
+ //for search result we need to check the capatibiliy
337
+ if ( !flagAdmin::can_manage_this_gallery($picture->author) && $is_search )
338
+ continue;
339
+
340
+ $hits = intval($picture->hitcounter);
341
+ $votes = intval($picture->total_votes);
342
+
343
+ $counter++;
344
+ $pid = (int) $picture->pid;
345
+ $alternate = ( !isset($alternate) || $alternate == 'alternate' ) ? '' : 'alternate';
346
+ $exclude = ( $picture->exclude ) ? 'checked="checked"' : '';
347
+ $date = mysql2date(get_option('date_format'), $picture->imagedate);
348
+ $time = mysql2date(get_option('time_format'), $picture->imagedate);
349
+
350
+ ?>
351
+ <tr id="picture-<?php echo $pid; ?>" class="<?php echo $alternate; ?> iedit" valign="top">
352
+ <?php
353
+ foreach($gallery_columns as $gallery_column_key => $column_display_name) {
354
+ $class = "class=\"$gallery_column_key column-$gallery_column_key\"";
355
+
356
+ $style = '';
357
+ if ( in_array($gallery_column_key, $hidden_columns) )
358
+ continue;
359
+
360
+ $attributes = "$class$style";
361
+
362
+ switch ($gallery_column_key) {
363
+ case 'cb' :
364
+ ?>
365
+ <th <?php echo $attributes; ?> scope="row"><input name="doaction[]" type="checkbox" value="<?php echo $pid; ?>" /></th>
366
+ <?php
367
+ break;
368
+ case 'id' :
369
+ ?>
370
+ <td <?php echo $attributes; ?>><?php echo $pid; ?>
371
+ <input type="hidden" name="pid[]" value="<?php echo $pid; ?>" />
372
+ </td>
373
+ <?php
374
+ break;
375
+ case 'thumbnail' :
376
+ ?>
377
+ <td <?php echo $attributes; ?>><a href="<?php echo $picture->imageURL; ?>" class="thickbox" title="<?php echo $picture->filename; ?>">
378
+ <img class="thumb" src="<?php echo $picture->thumbURL; ?>" <?php echo $thumbsize; ?> id="thumb-<?php echo $pid; ?>" />
379
+ </a>
380
+ </td>
381
+ <?php
382
+ break;
383
+ case 'filename' :
384
+ ?>
385
+ <td <?php echo $attributes; ?>>
386
+ <strong><a href="<?php echo $picture->imageURL; ?>" class="thickbox" title="<?php echo $picture->filename; ?>">
387
+ <?php echo $picture->filename; ?>
388
+ </a></strong>
389
+ <br /><?php echo $date; ?>
390
+ <?php if ( !empty($picture->meta_data['width']) ) {
391
+ echo '<br />'.__('Size: ', 'flag').$picture->meta_data['width'].'x'.$picture->meta_data['height'].' '.__('pixel', 'flag');
392
+ } else {
393
+ $imgpath = WINABSPATH.$picture->path."/".$picture->filename;
394
+ $img = @getimagesize($imgpath);
395
+ if($img) echo '<br />'.__('Size: ', 'flag').$img[0].'x'.$img[1].' '.__('pixel', 'flag');
396
+ } ?>
397
+ <p>
398
+ <?php
399
+ $actions = array();
400
+ $actions['view'] = '<a class="thickbox" href="' . $picture->imageURL . '" title="' . attribute_escape(sprintf(__('View "%s"'), $picture->filename)) . '">' . __('View', 'flag') . '</a>';
401
+ $actions['meta'] = '<a class="thickbox" href="' . FLAG_URLPATH . 'admin/showmeta.php?id=' . $pid . '" title="' . __('Show Meta data','flag') . '">' . __('Meta', 'flag') . '</a>';
402
+ $actions['custom_thumb'] = '<a class="thickbox" href="' . FLAG_URLPATH . 'admin/manage_thumbnail.php?id=' . $pid . '" title="' . __('Customize thumbnail','flag') . '">' . __('Edit thumb', 'flag') . '</a>';
403
+ $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( \'' . attribute_escape(sprintf(__('Delete "%s"' , 'flag'), $picture->filename)). '\');if(check==false) return false;">' . __('Delete','flag') . '</a>';
404
+ $action_count = count($actions);
405
+ $i = 0;
406
+ echo '<div class="row-actions">';
407
+ foreach ( $actions as $action => $link ) {
408
+ ++$i;
409
+ ( $i == $action_count ) ? $sep = '' : $sep = ' | ';
410
+ echo "<span class='$action'>$link$sep</span>";
411
+ }
412
+ echo '</div>';
413
+ ?></p>
414
+ </td>
415
+ <?php
416
+ break;
417
+ case 'views_likes' :
418
+ ?>
419
+ <td <?php echo $attributes; ?>>
420
+ <input name="hitcounter[<?php echo $pid; ?>]" type="text" value="<?php echo stripslashes($picture->hitcounter); ?>" /> /
421
+ <input name="total_votes[<?php echo $pid; ?>]" type="text" value="<?php echo stripslashes($picture->total_votes); ?>" />
422
+ </td>
423
+ <?php
424
+ break;
425
+ case 'rating' :
426
+ ?>
427
+ <td <?php echo $attributes; ?>>
428
+ <?php
429
+ if($votes==0){
430
+ $like = '0.0';
431
+ }else if($votes<11){
432
+ $like = $rt[$votes-1];
433
+ }else{
434
+ $like = round( ((100-$rt[count($rt)-1])/($hits>0?$hits:1))*($votes<=$hits?$votes:$hits), 1 ) + $rt[count($rt)-1];
435
+ }
436
+ echo $like.'%';
437
+ ?>
438
+ </td>
439
+ <?php
440
+ break;
441
+ case 'alt_title_desc' :
442
+ ?>
443
+ <td <?php echo $attributes; ?>>
444
+ <input name="alttext[<?php echo $pid; ?>]" type="text" style="width:95%; margin-bottom: 2px;" value="<?php echo stripslashes($picture->alttext); ?>" /><br/>
445
+ <textarea name="description[<?php echo $pid; ?>]" style="width:95%; margin-top: 2px;" rows="2" ><?php echo stripslashes($picture->description); ?></textarea>
446
+ </td>
447
+ <?php
448
+ break;
449
+ case 'exclude' :
450
+ ?>
451
+ <td <?php echo $attributes; ?>><input name="exclude[<?php echo $pid; ?>]" type="checkbox" value="1" <?php echo $exclude; ?> /></td>
452
+ <?php
453
+ break;
454
+ /*
455
+ case 'views' :
456
+ ?>
457
+ <td <?php echo $attributes; ?>><?php echo $picture->hitcounter; ?></td>
458
+ <?php
459
+ break;
460
+ */
461
+ default :
462
+ ?>
463
+ <td <?php echo $attributes; ?>><?php do_action('flag_manage_gallery_custom_column', $gallery_column_key, $pid); ?></td>
464
+ <?php
465
+ break;
466
+ }
467
+ ?>
468
+ <?php } ?>
469
+ </tr>
470
+ <?php
471
+ }
472
+ }
473
+
474
+ // In the case you have no capaptibility to see the search result
475
+ if ( $counter==0 )
476
+ echo '<tr><td colspan="' . $num_columns . '" align="center"><strong>'.__('No entries found','flag').'</strong></td></tr>';
477
+
478
+ ?>
479
+
480
+ </tbody>
481
+ </table>
482
+ <p class="submit"><input type="submit" class="button-primary action" name="updatepictures" value="<?php _e("Save Changes",'flag')?>" /></p>
483
+ </form>
484
+ <br class="clear"/>
485
+ </div><!-- /#wrap -->
486
+
487
+ <!-- #selectgallery -->
488
+ <div id="selectgallery" style="display: none;" >
489
+ <form id="form-select-gallery" method="POST" accept-charset="utf-8">
490
+ <?php wp_nonce_field('flag_thickbox_form'); ?>
491
+ <input type="hidden" id="selectgallery_imagelist" name="TB_imagelist" value="" />
492
+ <input type="hidden" id="selectgallery_bulkaction" name="TB_bulkaction" value="" />
493
+ <input type="hidden" name="page" value="manage-images" />
494
+ <table width="100%" border="0" cellspacing="3" cellpadding="3" >
495
+ <tr>
496
+ <th>
497
+ <?php _e('Select the destination gallery:', 'flag'); ?>&nbsp;
498
+ <select name="dest_gid" style="width:90%" >
499
+ <?php
500
+ foreach ($gallerylist as $gallery) {
501
+ if ($gallery->gid != $act_gid) {
502
+ ?>
503
+ <option value="<?php echo $gallery->gid; ?>" ><?php echo $gallery->gid; ?> - <?php echo stripslashes($gallery->title); ?></option>
504
+ <?php
505
+ }
506
+ }
507
+ ?>
508
+ </select>
509
+ </th>
510
+ </tr>
511
+ <tr align="right">
512
+ <td class="submit">
513
+ <input type="submit" class="button-primary" name="TB_SelectGallery" value="<?php _e("OK",'flag')?>" />
514
+ &nbsp;
515
+ <input class="button-secondary" type="reset" value="<?php _e("Cancel",'flag')?>" onclick="tb_remove()"/>
516
+ </td>
517
+ </tr>
518
+ </table>
519
+ </form>
520
+ </div>
521
+ <!-- /#selectgallery -->
522
+
523
+ <!-- #resize_images -->
524
+ <div id="resize_images" style="display: none;" >
525
+ <form id="form-resize-images" method="POST" accept-charset="utf-8">
526
+ <?php wp_nonce_field('flag_thickbox_form'); ?>
527
+ <input type="hidden" id="resize_images_imagelist" name="TB_imagelist" value="" />
528
+ <input type="hidden" id="resize_images_bulkaction" name="TB_bulkaction" value="" />
529
+ <input type="hidden" name="page" value="manage-images" />
530
+ <table width="100%" border="0" cellspacing="3" cellpadding="3" >
531
+ <tr valign="top">
532
+ <td>
533
+ <strong><?php _e('Resize Images to', 'flag'); ?>:</strong>
534
+ </td>
535
+ <td>
536
+ <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']; ?>" />
537
+ <br /><small><?php _e('Width x height (in pixel). GRAND FlAGallery will keep ratio size','flag'); ?></small>
538
+ </td>
539
+ </tr>
540
+ <tr align="right">
541
+ <td colspan="2" class="submit">
542
+ <input class="button-primary" type="submit" name="TB_ResizeImages" value="<?php _e('OK', 'flag'); ?>" />
543
+ &nbsp;
544
+ <input class="button-secondary" type="reset" value="&nbsp;<?php _e('Cancel', 'flag'); ?>&nbsp;" onclick="tb_remove()"/>
545
+ </td>
546
+ </tr>
547
+ </table>
548
+ </form>
549
+ </div>
550
+ <!-- /#resize_images -->
551
+
552
+ <!-- #new_thumbnail -->
553
+ <div id="new_thumbnail" style="display: none;" >
554
+ <form id="form-new-thumbnail" method="POST" accept-charset="utf-8">
555
+ <?php wp_nonce_field('flag_thickbox_form'); ?>
556
+ <input type="hidden" id="new_thumbnail_imagelist" name="TB_imagelist" value="" />
557
+ <input type="hidden" id="new_thumbnail_bulkaction" name="TB_bulkaction" value="" />
558
+ <input type="hidden" name="page" value="manage-images" />
559
+ <table width="100%" border="0" cellspacing="3" cellpadding="3" >
560
+ <tr valign="top">
561
+ <th align="left"><?php _e('Width x height (in pixel)','flag'); ?></th>
562
+ <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']; ?>" />
563
+ <br /><small><?php _e('These values are maximum values ','flag'); ?></small></td>
564
+ </tr>
565
+ <tr valign="top">
566
+ <th align="left"><?php _e('Set fix dimension','flag'); ?></th>
567
+ <td><input type="checkbox" name="thumbFix" value="1" <?php checked('1', $flag->options['thumbFix']); ?> />
568
+ <br /><small><?php _e('Ignore the aspect ratio, no portrait thumbnails','flag'); ?></small></td>
569
+ </tr>
570
+ <tr align="right">
571
+ <td colspan="2" class="submit">
572
+ <input class="button-primary" type="submit" name="TB_NewThumbnail" value="<?php _e('OK', 'flag'); ?>" />
573
+ &nbsp;
574
+ <input class="button-secondary" type="reset" value="&nbsp;<?php _e('Cancel', 'flag'); ?>&nbsp;" onclick="tb_remove()"/>
575
+ </td>
576
+ </tr>
577
+ </table>
578
+ </form>
579
+ </div>
580
+ <!-- /#new_thumbnail -->
581
+
582
+ <script type="text/javascript">
583
+ /* <![CDATA[ */
584
+ jQuery(document).ready(function(){columns.init('flag-manage-images');});
585
+ /* ]]> */
586
+ </script>
587
+ <?php
588
+ }
589
+
590
+ // define the columns to display, the syntax is 'internal name' => 'display name'
591
+ function flag_manage_gallery_columns() {
592
+ global $flag;
593
+
594
+ $gallery_columns = array();
595
+
596
+ $gallery_columns['cb'] = '<input name="checkall" type="checkbox" onclick="checkAll(document.getElementById(\'updategallery\'));" />';
597
+ $gallery_columns['id'] = __('ID');
598
+ $gallery_columns['thumbnail'] = __('Thumbnail', 'flag');
599
+ $gallery_columns['filename'] = __('Filename', 'flag');
600
+ $gallery_columns['views_likes'] = __('Views / Likes', 'flag');
601
+ $gallery_columns['rating'] = __('Rating', 'flag');
602
+ $gallery_columns['alt_title_desc'] = __('Alt &amp; Title Text', 'flag') . ' / ' . __('Description', 'flag');
603
+ $gallery_columns['exclude'] = '<img src="'.FLAG_URLPATH.'admin/images/lock.png" alt="member view" title="'.__('Only for logged in users', 'flag').'" />';
604
+ //$gallery_columns['views'] = '<img src="'.FLAG_URLPATH.'admin/images/hits.png" alt="total views" title="'.__('Views', 'flag').'" />';
605
+
606
+ return $gallery_columns;
607
+ }
608
+
609
+ ?>
admin/manage-playlist.php ADDED
@@ -0,0 +1,265 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You are not allowed to call this page directly.');}
4
+
5
+ function flag_playlist_edit() {
6
+ global $wpdb;
7
+ $filepath = admin_url() . 'admin.php?page=' . $_GET['page'];
8
+ $all_playlists = get_playlists();
9
+ $flag_options = get_option('flag_options');
10
+ $playlistPath = $flag_options['galleryPath'].'playlists/'.$_GET['playlist'].'.xml';
11
+ $playlist = get_playlist_data(ABSPATH.$playlistPath);
12
+ $items_a = $playlist['items'];
13
+ $items = implode(',',$playlist['items']);
14
+ ?>
15
+ <script type="text/javascript">
16
+ //<![CDATA[
17
+ function checkAll(form)
18
+ {
19
+ form.find(':checkbox').each(function(){this.checked = !this.checked});
20
+ return false;
21
+ }
22
+
23
+ function getNumChecked(form)
24
+ {
25
+ var num = 0;
26
+ for (i = 0, n = form.elements.length; i < n; i++) {
27
+ if(form.elements[i].type == "checkbox") {
28
+ if(form.elements[i].name == "doaction[]")
29
+ if(form.elements[i].checked == true)
30
+ num++;
31
+ }
32
+ }
33
+ return num;
34
+ }
35
+
36
+ // this function check for a the number of selected images, sumbmit false when no one selected
37
+ function checkSelected() {
38
+
39
+ var numchecked = getNumChecked(document.getElementById('updatePlaylist'));
40
+
41
+ if(numchecked < 1) {
42
+ alert('<?php echo js_escape(__("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(js_escape(__("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(js_escape(__("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 ) {
58
+ var form = document.getElementById('updatePlaylist');
59
+ var elementlist = "";
60
+ for (i = 0, n = form.elements.length; i < n; i++) {
61
+ if(form.elements[i].type == "checkbox") {
62
+ if(form.elements[i].name == "doaction[]")
63
+ if(form.elements[i].checked == true)
64
+ if (elementlist == "")
65
+ elementlist = form.elements[i].value
66
+ else
67
+ elementlist += "," + form.elements[i].value ;
68
+ }
69
+ }
70
+ jQuery("#" + windowId + "_bulkaction").val(jQuery("#bulkaction").val());
71
+ jQuery("#" + windowId + "_playlist").val(elementlist);
72
+ // console.log (jQuery("#TB_playlist").val());
73
+ tb_show("", "#TB_inline?width=640&height=" + height + "&inlineId=" + windowId + "&modal=true", false);
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
+ //var id = html.match(/wp-image-(\d+(\.\d)*)/ig);
80
+ //id = id[0].match(/\d+/);
81
+ jQuery('#mp3thumb-'+actInp).attr('value', source);
82
+ jQuery('#thumb-'+actInp).attr('src', source);
83
+ tb_remove();
84
+ }
85
+ jQuery(document).ready(function(){
86
+ jQuery('.del_thumb').click(function(){
87
+ var id = jQuery(this).attr('data-id');
88
+ jQuery('#mp3thumb-'+id).attr('value', '');
89
+ jQuery('#thumb-'+id).attr('src', '<?php echo site_url()."/wp-includes/images/crystal/audio.png"; ?>');
90
+ return false;
91
+ });
92
+ jQuery('#skinname').change(function(){
93
+ var skin = jQuery(this).val();
94
+ jQuery('#skinOptions').attr("href","<?php echo FLAG_URLPATH; ?>admin/skin_options.php?show_options=1&amp;skin="+skin+"&amp;TB_iframe=1&amp;width=600&amp;height=560");
95
+ });
96
+ })
97
+ //]]>
98
+ </script>
99
+
100
+ <div class="wrap">
101
+ <h2><?php _e( 'Playlist', 'flag' ); ?>: <?php echo $playlist['title']; ?></h2>
102
+ <div style="float: right; margin: -20px 3px 0 0;">
103
+ <span><a href="<?php echo $filepath; ?>"><?php _e('Back to Music 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');
109
+ if ($playlist_file == $_GET['playlist']) continue;
110
+ ?>
111
+ <option value="<?php echo $filepath."&amp;playlist=".$playlist_name."&amp;mode=edit"; ?>"><?php echo $playlist_data['title']; ?></option>
112
+ <?php
113
+ }
114
+ ?>
115
+ </select>
116
+ </div>
117
+ <form id="updatePlaylist" class="flagform" method="POST" action="<?php echo $filepath."&amp;playlist=".$_GET['playlist']."&amp;mode=edit"; ?>" accept-charset="utf-8">
118
+ <?php wp_nonce_field('flag_updateplaylist'); ?>
119
+ <input type="hidden" name="page" value="manage-playlist" />
120
+
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="[grandmusic playlist=<?php echo $_GET['playlist']; ?>]" /></td>
130
+ <td rowspan="3" align="left" valign="top"><div style="font-size:11px;"><strong style="display: inline-block; width: 100px;"><?php _e("Playlist Skin", 'flag'); ?>:</strong>
131
+ <input id="skinaction" type="hidden" name="skinaction" value="<?php echo $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='m');
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="music_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='.$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 $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 $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>
162
+ <div class="clear"></div>
163
+ </div>
164
+ </div>
165
+ </div></div></div>
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 $filepath."&amp;playlist=".$_GET['playlist']."&amp;mode=sort"; ?>" class="button-secondary alignleft" style="margin:1px 10px 0 0;"><?php _e("Sort Playlist",'flag')?></a>
174
+ <a href="<?php echo $filepath."&amp;playlist=".$_GET['playlist']."&amp;mode=add"; ?>" 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-listmusic" class="widefat fixed" 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>
201
+ <?php
202
+ if(count($items_a)) {
203
+ $counter = 0;
204
+ $alt = ' class="alternate"';
205
+ $flag_options = get_option('flag_options');
206
+ $uploads = wp_upload_dir();
207
+ foreach($items_a as $item) {
208
+ $mp3 = get_post($item);
209
+ $thumb = $mp3thumb = get_post_meta($item, 'thumbnail', true);
210
+ if(empty($thumb)) {
211
+ $thumb = site_url().'/wp-includes/images/crystal/audio.png';
212
+ $mp3thumb = '';
213
+ }
214
+ $alt = ( empty($alt) ) ? ' class="alternate"' : '';
215
+ $alt2 = ( empty($alt) ) ? '' : ' alternate';
216
+ $url = wp_get_attachment_url($mp3->ID);
217
+ $counter++;
218
+ ?>
219
+ <tr id="mp3-<?php echo $mp3->ID; ?>"<?php echo $alt; ?> valign="top">
220
+ <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>
221
+ <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>
222
+ <td class="size" style="padding-bottom: 0; border-bottom: none;"><?php
223
+ $path = $uploads['basedir'].str_replace($uploads['baseurl'],'',$url);
224
+ $size = filesize($path);
225
+ echo round($size/1024/1024,2).' Mb';
226
+ ?></td>
227
+ <td class="thumb" rowspan="2">
228
+ <img id="thumb-<?php echo $mp3->ID; ?>" src="<?php echo $thumb; ?>" width="100" height="100" alt="" />
229
+ </td>
230
+ <td class="title_filename" rowspan="2">
231
+ <strong><a href="<?php echo $url; ?>"><?php echo basename($url); ?></a></strong><br />
232
+ <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 $mp3->post_title; ?></textarea><br />
233
+ <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 $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>
234
+ </td>
235
+ <td class="description" rowspan="2">
236
+ <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 $mp3->post_content; ?></textarea>
237
+ </td>
238
+ </tr>
239
+ <tr class="mp3-<?php echo $mp3->ID.$alt2; ?>">
240
+ <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>
241
+ <div class="play" style="padding-left: 4px;"><span id="c-<?php echo $mp3->ID; ?>"></span></div></td>
242
+ </tr>
243
+ <?php
244
+ }
245
+ }
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','flag').'</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",'flag')?>" /></p>
256
+ </form>
257
+ <form id="form_listitems" name="form_listitems" method="POST" action="<?php echo $filepath."&amp;playlist=".$_GET['playlist']."&amp;mode=add"; ?>">
258
+ <input type="hidden" name="items" value="<?php echo $items; ?>" />
259
+ </form>
260
+ <br class="clear"/>
261
+ </div><!-- /#wrap -->
262
+ <?php
263
+ }
264
+
265
+ ?>
admin/manage-sort.php ADDED
@@ -0,0 +1,153 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * @author Sergey Pasyuk
5
+ * @copyright 2009
6
+ */
7
+
8
+ function flag_sortorder($galleryID = 0){
9
+ global $wpdb, $flag;
10
+
11
+ if ($galleryID == 0) return;
12
+
13
+ $galleryID = (int) $galleryID;
14
+
15
+ if (isset ($_POST['updateSortorder'])) {
16
+ check_admin_referer('flag_updatesortorder');
17
+ // get variable new sortorder
18
+ $neworder = array();
19
+ foreach($_POST as $id) {
20
+ $neworder[] = (int) $id;
21
+ }
22
+ $sortindex = 1;
23
+ foreach($neworder as $pic_id) {
24
+ $wpdb->query("UPDATE $wpdb->flagpictures SET sortorder = '$sortindex' WHERE pid = $pic_id");
25
+ $sortindex++;
26
+ }
27
+ $firstImage = $wpdb->get_var("SELECT pid FROM $wpdb->flagpictures WHERE galleryid = '$galleryID' ORDER by pid DESC limit 0,1");
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
+
35
+
36
+ // get gallery values
37
+ $act_gallery = $wpdb->get_row("SELECT * FROM $wpdb->flaggallery WHERE gid = '$galleryID' ");
38
+
39
+ // set gallery url
40
+ $act_gallery_url = get_option ('siteurl')."/".$act_gallery->path."/";
41
+ $act_thumbnail_url = get_option ('siteurl')."/".$act_gallery->path.flagGallery::get_thumbnail_folder($act_gallery->path, FALSE);
42
+
43
+ // look for presort args
44
+ $picturelist = $wpdb->get_results("SELECT * FROM $wpdb->flagpictures WHERE galleryid = '$galleryID' ORDER BY sortorder {$dir}");
45
+
46
+ //this is the url without any presort variable
47
+ $base_url = admin_url() . 'admin.php?page=flag-manage-gallery&amp;mode=sort&amp;gid=' . $galleryID;
48
+
49
+ ?>
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="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">
67
+ /*<![CDATA[*/
68
+ jQuery(document).ready(function($) {
69
+ // Initialise the table
70
+ jQuery("#listimages").tableDnD({
71
+ onDragClass: "myDragClass",
72
+ onDrop: function() {
73
+ jQuery("#listimages tr:even").addClass('alternate');
74
+ jQuery("#listimages tr:odd").removeClass('alternate');
75
+ }
76
+ });
77
+ $("#flag-listitems").tablesorter({
78
+ // pass the headers argument and assing a object
79
+ headers: {
80
+ // assign the secound column (we start counting zero)
81
+ 1: {
82
+ // disable it by setting the property sorter to false
83
+ sorter: false
84
+ }
85
+ }
86
+ });
87
+ $("#flag-listitems").bind("sortEnd",function() {
88
+ jQuery("#listimages tr:even").addClass('alternate');
89
+ jQuery("#listimages tr:odd").removeClass('alternate');
90
+ });
91
+
92
+ });
93
+ /*]]>*/
94
+ </script>
95
+ <table id="flag-listitems" class="widefat fixed" cellspacing="0" >
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="80"><?php _e('Thumb', 'flag'); ?></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><?php _e('ID', 'flag'); ?></th>
109
+ <th><?php _e('Thumb', 'flag'); ?></p></th>
110
+ <th><?php _e('Filename', 'flag'); ?></th>
111
+ <th><?php _e('Date', 'flag'); ?></th>
112
+ <th><?php _e('Alt &amp; Title Text', 'flag'); ?></th>
113
+ </tr>
114
+ </tfoot>
115
+ <tbody id="listimages">
116
+ <?php
117
+ if($picturelist) {
118
+
119
+ $alternate = '';
120
+ foreach($picturelist as $picture) {
121
+
122
+ $pid = (int) $picture->pid;
123
+ $alternate = ( $alternate == 'alternate' ) ? '' : 'alternate';
124
+ $date = mysql2date(get_option('date_format'), $picture->imagedate);
125
+ $time = mysql2date(get_option('time_format'), $picture->imagedate);
126
+
127
+ ?>
128
+ <tr id="picture-<?php echo $pid; ?>" class="<?php echo $alternate; ?> iedit" valign="top">
129
+ <td scope="row"><strong><?php echo $pid; ?></strong><input type="hidden" name="sortpid-<?php echo $pid; ?>" value="<?php echo $pid; ?>" /></td>
130
+ <td><a href="<?php echo $act_gallery_url.$picture->filename; ?>" class="thickbox" title="<?php echo $picture->filename; ?>">
131
+ <img class="thumb" src="<?php echo $act_thumbnail_url ."thumbs_" .$picture->filename; ?>" style="width:40px; height:auto;" id="thumb-<?php echo $pid; ?>" />
132
+ </a></td>
133
+ <td><?php echo $picture->filename; ?></td>
134
+ <td><?php echo $date; ?></td>
135
+ <td><?php echo stripslashes($picture->alttext); ?></td>
136
+ </tr>
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 -->
150
+
151
+ <?php
152
+ }
153
+ ?>
admin/manage-video.php ADDED
@@ -0,0 +1,260 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You are not allowed to call this page directly.');}
4
+
5
+ function flag_v_playlist_edit() {
6
+ global $wpdb;
7
+ $filepath = admin_url() . 'admin.php?page=' . $_GET['page'];
8
+ $all_playlists = get_v_playlists();
9
+ $flag_options = get_option('flag_options');
10
+ $playlistPath = $flag_options['galleryPath'].'playlists/video/'.$_GET['playlist'].'.xml';
11
+ $playlist = get_v_playlist_data(ABSPATH.$playlistPath);
12
+ $items_a = $playlist['items'];
13
+ $items = implode(',',$playlist['items']);
14
+ ?>
15
+ <script type="text/javascript">
16
+ //<![CDATA[
17
+ function checkAll(form)
18
+ {
19
+ form.find(':checkbox').each(function(){this.checked = !this.checked});
20
+ return false;
21
+ }
22
+
23
+ function getNumChecked(form)
24
+ {
25
+ var num = 0;
26
+ for (i = 0, n = form.elements.length; i < n; i++) {
27
+ if(form.elements[i].type == "checkbox") {
28
+ if(form.elements[i].name == "doaction[]")
29
+ if(form.elements[i].checked == true)
30
+ num++;
31
+ }
32
+ }
33
+ return num;
34
+ }
35
+
36
+ // this function check for a the number of selected images, sumbmit false when no one selected
37
+ function checkSelected() {
38
+
39
+ var numchecked = getNumChecked(document.getElementById('updatePlaylist'));
40
+
41
+ if(numchecked < 1) {
42
+ alert('<?php echo js_escape(__("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(js_escape(__("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(js_escape(__("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 ) {
58
+ var form = document.getElementById('updatePlaylist');
59
+ var elementlist = "";
60
+ for (i = 0, n = form.elements.length; i < n; i++) {
61
+ if(form.elements[i].type == "checkbox") {
62
+ if(form.elements[i].name == "doaction[]")
63
+ if(form.elements[i].checked == true)
64
+ if (elementlist == "")
65
+ elementlist = form.elements[i].value
66
+ else
67
+ elementlist += "," + form.elements[i].value ;
68
+ }
69
+ }
70
+ jQuery("#" + windowId + "_bulkaction").val(jQuery("#bulkaction").val());
71
+ jQuery("#" + windowId + "_playlist").val(elementlist);
72
+ // console.log (jQuery("#TB_playlist").val());
73
+ tb_show("", "#TB_inline?width=640&height=" + height + "&inlineId=" + windowId + "&modal=true", false);
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
+ //var id = html.match(/wp-image-(\d+(\.\d)*)/ig);
80
+ //id = id[0].match(/\d+/);
81
+ jQuery('#flvthumb-'+actInp).attr('value', source);
82
+ jQuery('#thumb-'+actInp).attr('src', source);
83
+ tb_remove();
84
+ }
85
+ jQuery(document).ready(function(){
86
+ jQuery('.del_thumb').click(function(){
87
+ var id = jQuery(this).attr('data-id');
88
+ jQuery('#flvthumb-'+id).attr('value', '');
89
+ jQuery('#thumb-'+id).attr('src', '<?php echo site_url()."/wp-includes/images/crystal/video.png"; ?>');
90
+ return false;
91
+ });
92
+ jQuery('#skinname').change(function(){
93
+ var skin = jQuery(this).val();
94
+ jQuery('#skinOptions').attr("href","<?php echo FLAG_URLPATH; ?>admin/skin_options.php?show_options=1&amp;skin="+skin+"&amp;TB_iframe=1&amp;width=600&amp;height=560");
95
+ });
96
+ })
97
+ //]]>
98
+ </script>
99
+
100
+ <div class="wrap">
101
+ <h2><?php _e( 'Playlist', 'flag' ); ?>: <?php echo $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');
109
+ if ($playlist_file == $_GET['playlist']) continue;
110
+ ?>
111
+ <option value="<?php echo $filepath."&amp;playlist=".$playlist_name."&amp;mode=edit"; ?>"><?php echo $playlist_data['title']; ?></option>
112
+ <?php
113
+ }
114
+ ?>
115
+ </select>
116
+ </div>
117
+ <form id="updatePlaylist" class="flagform" method="POST" action="<?php echo $filepath."&amp;playlist=".$_GET['playlist']."&amp;mode=edit"; ?>" accept-charset="utf-8">
118
+ <?php wp_nonce_field('flag_updateplaylist'); ?>
119
+ <input type="hidden" name="page" value="manage-playlist" />
120
+
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 $_GET['playlist']; ?>]" /></td>
130
+ <td rowspan="3" align="left" valign="top"><div style="font-size:11px;"><strong style="display: inline-block; width: 100px;"><?php _e("Playlist Skin", 'flag'); ?>:</strong>
131
+ <input id="skinaction" type="hidden" name="skinaction" value="<?php echo $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='.$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 $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 $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>
162
+ <div class="clear"></div>
163
+ </div>
164
+ </div>
165
+ </div></div></div>
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 $filepath."&amp;playlist=".$_GET['playlist']."&amp;mode=sort"; ?>" class="button-secondary alignleft" style="margin:1px 10px 0 0;"><?php _e("Sort Playlist",'flag')?></a>
174
+ <a href="<?php echo $filepath."&amp;playlist=".$_GET['playlist']."&amp;mode=add"; ?>" 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" 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>
201
+ <?php
202
+ if(count($items_a)) {
203
+ $counter = 0;
204
+ $alt = ' class="alternate"';
205
+ $uploads = wp_upload_dir();
206
+ foreach($items_a as $item) {
207
+ $flv = get_post($item);
208
+ $thumb = $flvthumb = get_post_meta($item, 'thumbnail', true);
209
+ if(empty($thumb)) {
210
+ $thumb = site_url().'/wp-includes/images/crystal/video.png';
211
+ $flvthumb = '';
212
+ }
213
+ $alt = ( empty($alt) ) ? ' class="alternate"' : '';
214
+ $alt2 = ( empty($alt) ) ? '' : ' alternate';
215
+ $counter++;
216
+ $url = wp_get_attachment_url($flv->ID);
217
+ ?>
218
+ <tr id="flv-<?php echo $flv->ID; ?>"<?php echo $alt; ?> valign="top">
219
+ <th class="cb" scope="row"><input name="doaction[]" type="checkbox" value="<?php echo $flv->ID; ?>" /></th>
220
+ <td class="id"><p style="white-space: nowrap;">ID: <?php echo $flv->ID; ?></p></td>
221
+ <td class="size"><?php
222
+ $path = $uploads['basedir'].str_replace($uploads['baseurl'],'',$url);
223
+ $size = filesize($path);
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 $thumb; ?>" width="100" height="100" 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 $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 $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 $flv->post_content; ?></textarea>
236
+ </td>
237
+ </tr>
238
+ <?php
239
+ }
240
+ }
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 $filepath."&amp;playlist=".$_GET['playlist']."&amp;mode=add"; ?>">
253
+ <input type="hidden" name="items" value="<?php echo $items; ?>" />
254
+ </form>
255
+ <br class="clear"/>
256
+ </div><!-- /#wrap -->
257
+ <?php
258
+ }
259
+
260
+ ?>
admin/manage.php ADDED
@@ -0,0 +1,422 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You are not allowed to call this page directly.'); }
4
+
5
+ class flagManageGallery {
6
+
7
+ var $mode = 'main';
8
+ var $gid = false;
9
+ var $pid = false;
10
+ var $base_page = 'admin.php?page=flag-manage-gallery';
11
+ var $search_result = false;
12
+
13
+ // initiate the manage page
14
+ function flagManageGallery() {
15
+
16
+ // GET variables
17
+ if(isset($_GET['gid']))
18
+ $this->gid = (int) $_GET['gid'];
19
+ if(isset($_GET['pid']))
20
+ $this->pid = (int) $_GET['pid'];
21
+ if(isset($_GET['mode']))
22
+ $this->mode = trim ($_GET['mode']);
23
+ // Should be only called via manage galleries overview
24
+ if ( $_POST['page'] == 'manage-galleries' )
25
+ $this->post_processor_galleries();
26
+ // Should be only called via a edit single gallery page
27
+ if ( $_POST['page'] == 'manage-images' )
28
+ $this->post_processor_images();
29
+ //Look for other POST process
30
+ if ( !empty($_POST) || !empty($_GET) )
31
+ $this->processor();
32
+
33
+ }
34
+
35
+ function controller() {
36
+
37
+ switch($this->mode) {
38
+ case 'sort':
39
+ include_once (dirname (__FILE__) . '/manage-sort.php');
40
+ flag_sortorder($this->gid);
41
+ break;
42
+ case 'edit':
43
+ include_once (dirname (__FILE__) . '/manage-images.php');
44
+ flag_picturelist();
45
+ break;
46
+ case 'main':
47
+ default:
48
+ if(current_user_can('FlAG Upload images')){
49
+ include_once (dirname (__FILE__) . '/addgallery.php');
50
+ flag_admin_add_gallery();
51
+ }
52
+ include_once (dirname (__FILE__) . '/manage-galleries.php');
53
+ flag_manage_gallery_main();
54
+ break;
55
+ }
56
+ }
57
+
58
+ function processor() {
59
+ global $wpdb, $flag, $flagdb;
60
+
61
+ // Delete a gallery
62
+ if ($this->mode == 'delete') {
63
+
64
+ check_admin_referer('flag_editgallery');
65
+
66
+ // get the path to the gallery
67
+ $gallerypath = $wpdb->get_var("SELECT path FROM $wpdb->flaggallery WHERE gid = '$this->gid' ");
68
+ if ($gallerypath){
69
+
70
+ // delete pictures
71
+ $imagelist = $wpdb->get_col("SELECT filename FROM $wpdb->flagpictures WHERE galleryid = '$this->gid' ");
72
+ if ($flag->options['deleteImg']) {
73
+ if (is_array($imagelist)) {
74
+ foreach ($imagelist as $filename) {
75
+ @unlink(WINABSPATH . $gallerypath . '/thumbs/thumbs_' . $filename);
76
+ @unlink(WINABSPATH . $gallerypath .'/'. $filename);
77
+ }
78
+ }
79
+ // delete folder
80
+ @rmdir( WINABSPATH . $gallerypath . '/thumbs' );
81
+ @rmdir( WINABSPATH . $gallerypath );
82
+ }
83
+ }
84
+
85
+ $delete_pic = $wpdb->query("DELETE FROM $wpdb->flagpictures WHERE galleryid = $this->gid");
86
+ $delete_galllery = $wpdb->query("DELETE FROM $wpdb->flaggallery WHERE gid = $this->gid");
87
+
88
+ if($delete_galllery) {
89
+
90
+ $albums = $wpdb->get_results("SELECT id, categories FROM $wpdb->flagalbum WHERE categories LIKE '%{$this->gid}%' ");
91
+ if($albums) {
92
+ foreach ($albums as $album) {
93
+ $strsearch = array(','.$this->gid, $this->gid.',', strval($this->gid) );
94
+ $galstring = str_replace($strsearch,'',$album->categories);
95
+ $wpdb->query( "UPDATE $wpdb->flagalbum SET categories = '{$galstring}' WHERE id = $album->id" );
96
+ }
97
+ }
98
+
99
+ flagGallery::show_message( __ngettext( 'Gallery', 'Galleries', 1, 'flag' ) . ' \''.$this->gid.'\' '.__('deleted successfully','flag'));
100
+
101
+ }
102
+
103
+ $this->mode = 'main'; // show mainpage
104
+ }
105
+
106
+ // New Album
107
+ if (isset($_POST['album_name'])) {
108
+
109
+ check_admin_referer('flag_album');
110
+ $newalbum = $wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->flagalbum (name) VALUES (%s)", $_POST['album_name']) );
111
+ // and give me the new id
112
+ $newalbum_id = (int) $wpdb->insert_id;
113
+
114
+ if($newalbum)
115
+ flagGallery::show_message( __( 'Album', 'flag' ) . ' \''.$_POST["album_name"].'\' '.__('successfully created','flag'));
116
+
117
+ $this->mode = 'main'; // show mainpage
118
+ }
119
+
120
+ // Delete a picture
121
+ if ($this->mode == 'delpic') {
122
+
123
+ check_admin_referer('flag_delpicture');
124
+ $image = $flagdb->find_image( $this->pid );
125
+ if ($image) {
126
+ //if ($flag->options['deleteImg']) {
127
+ @unlink($image->imagePath);
128
+ @unlink($image->thumbPath);
129
+ //}
130
+ $delete_pic = $wpdb->query("DELETE FROM $wpdb->flagpictures WHERE pid = $image->pid");
131
+ }
132
+ if($delete_pic)
133
+ flagGallery::show_message( __('Picture','flag').' \''.$this->pid.'\' '.__('deleted successfully','flag') );
134
+
135
+ $this->mode = 'edit'; // show pictures
136
+
137
+ }
138
+
139
+ // will be called after a ajax operation
140
+ if (isset ($_POST['ajax_callback'])) {
141
+ if ($_POST['ajax_callback'] == 1)
142
+ flagGallery::show_message(__('Operation successful. Please clear your browser cache.','flag'));
143
+ }
144
+
145
+ if ( isset ($_POST['backToGallery']) )
146
+ $this->mode = 'edit';
147
+
148
+ // show sort order
149
+ if ( isset ($_POST['sortGallery']) )
150
+ $this->mode = 'sort';
151
+
152
+ if ( isset ($_GET['s']) )
153
+ $this->search_images();
154
+
155
+ }
156
+
157
+ function post_processor_galleries() {
158
+ global $wpdb, $flag, $flagdb;
159
+
160
+ // bulk update in a single gallery
161
+ if (isset ($_POST['bulkaction']) && isset ($_POST['doaction'])) {
162
+
163
+ check_admin_referer('flag_bulkgallery');
164
+
165
+ switch ($_POST['bulkaction']) {
166
+ case 'no_action';
167
+ // No action
168
+ break;
169
+ case 'import_meta':
170
+ // Import Metadata
171
+ // A prefix 'gallery_' will first fetch all ids from the selected galleries
172
+ flagAdmin::do_ajax_operation( 'gallery_import_metadata' , $_POST['doaction'], __('Import metadata','flag') );
173
+ break;
174
+ case 'copy_meta':
175
+ // Copy Metadata
176
+ // A prefix 'gallery_' will first fetch all ids from the selected galleries
177
+ flagAdmin::do_ajax_operation( 'gallery_copy_metadata' , $_POST['doaction'], __('Copy metadata to image Description','flag') );
178
+ break;
179
+ }
180
+ }
181
+
182
+ if (isset ($_POST['TB_bulkaction']) && isset ($_POST['TB_ResizeImages'])) {
183
+
184
+ check_admin_referer('flag_thickbox_form');
185
+
186
+ //save the new values for the next operation
187
+ $flag->options['imgWidth'] = (int) $_POST['imgWidth'];
188
+ $flag->options['imgHeight'] = (int) $_POST['imgHeight'];
189
+ // What is in the case the user has no if cap 'FlAG Change options' ? Check feedback
190
+ update_option('flag_options', $flag->options);
191
+
192
+ $gallery_ids = explode(',', $_POST['TB_imagelist']);
193
+ // A prefix 'gallery_' will first fetch all ids from the selected galleries
194
+ flagAdmin::do_ajax_operation( 'gallery_resize_image' , $gallery_ids, __('Resize images','flag') );
195
+ }
196
+
197
+ if (isset ($_POST['TB_bulkaction']) && isset ($_POST['TB_NewThumbnail'])) {
198
+
199
+ check_admin_referer('flag_thickbox_form');
200
+
201
+ //save the new values for the next operation
202
+ $flag->options['thumbWidth'] = (int) $_POST['thumbWidth'];
203
+ $flag->options['thumbHeight'] = (int) $_POST['thumbHeight'];
204
+ $flag->options['thumbFix'] = (bool) $_POST['thumbFix'];
205
+ // What is in the case the user has no if cap 'FlAG Change options' ? Check feedback
206
+ update_option('flag_options', $flag->options);
207
+
208
+ $gallery_ids = explode(',', $_POST['TB_imagelist']);
209
+ // A prefix 'gallery_' will first fetch all ids from the selected galleries
210
+ flagAdmin::do_ajax_operation( 'gallery_create_thumbnail' , $gallery_ids, __('Create new thumbnails','flag') );
211
+ }
212
+
213
+ }
214
+
215
+ function post_processor_images() {
216
+ global $wpdb, $flag, $flagdb;
217
+
218
+ // bulk update in a single gallery
219
+ if (isset ($_POST['bulkaction']) && isset ($_POST['doaction'])) {
220
+
221
+ check_admin_referer('flag_updategallery');
222
+
223
+ switch ($_POST['bulkaction']) {
224
+ case 'no_action';
225
+ break;
226
+ case 'delete_images':
227
+ if ( is_array($_POST['doaction']) ) {
228
+ foreach ( $_POST['doaction'] as $imageID ) {
229
+ $image = $flagdb->find_image( $imageID );
230
+ if ($image) {
231
+ if ($flag->options['deleteImg']) {
232
+ @unlink($image->imagePath);
233
+ @unlink($image->thumbPath);
234
+ }
235
+ $delete_pic = flagdb::delete_image( $image->pid );
236
+ }
237
+ }
238
+ if($delete_pic)
239
+ flagGallery::show_message(__('Pictures deleted successfully ','flag'));
240
+ }
241
+ break;
242
+ case 'import_meta':
243
+ flagAdmin::do_ajax_operation( 'import_metadata' , $_POST['doaction'], __('Import metadata','flag') );
244
+ break;
245
+ case 'copy_meta':
246
+ flagAdmin::do_ajax_operation( 'copy_metadata' , $_POST['doaction'], __('Copy metadata to image Description','flag') );
247
+ break;
248
+ }
249
+ }
250
+
251
+ if (isset ($_POST['TB_bulkaction']) && isset ($_POST['TB_ResizeImages'])) {
252
+
253
+ check_admin_referer('flag_thickbox_form');
254
+
255
+ //save the new values for the next operation
256
+ $flag->options['imgWidth'] = (int) $_POST['imgWidth'];
257
+ $flag->options['imgHeight'] = (int) $_POST['imgHeight'];
258
+
259
+ update_option('flag_options', $flag->options);
260
+
261
+ $pic_ids = explode(',', $_POST['TB_imagelist']);
262
+ flagAdmin::do_ajax_operation( 'resize_image' , $pic_ids, __('Resize images','flag') );
263
+ }
264
+
265
+ if (isset ($_POST['TB_bulkaction']) && isset ($_POST['TB_NewThumbnail'])) {
266
+
267
+ check_admin_referer('flag_thickbox_form');
268
+
269
+ //save the new values for the next operation
270
+ $flag->options['thumbWidth'] = (int) $_POST['thumbWidth'];
271
+ $flag->options['thumbHeight'] = (int) $_POST['thumbHeight'];
272
+ $flag->options['thumbFix'] = (bool) $_POST['thumbFix'];
273
+ update_option('flag_options', $flag->options);
274
+
275
+ $pic_ids = explode(',', $_POST['TB_imagelist']);
276
+ flagAdmin::do_ajax_operation( 'create_thumbnail' , $pic_ids, __('Create new thumbnails','flag') );
277
+ }
278
+
279
+ if (isset ($_POST['TB_bulkaction']) && isset ($_POST['TB_SelectGallery'])) {
280
+
281
+ check_admin_referer('flag_thickbox_form');
282
+
283
+ $pic_ids = explode(',', $_POST['TB_imagelist']);
284
+ $dest_gid = (int) $_POST['dest_gid'];
285
+
286
+ switch ($_POST['TB_bulkaction']) {
287
+ case 'copy_to':
288
+ // Copy images
289
+ flagAdmin::copy_images( $pic_ids, $dest_gid );
290
+ break;
291
+ case 'move_to':
292
+ // Move images
293
+ flagAdmin::move_images( $pic_ids, $dest_gid );
294
+ break;
295
+ }
296
+ }
297
+
298
+ if (isset ($_POST['updatepictures'])) {
299
+ // Update pictures
300
+
301
+ check_admin_referer('flag_updategallery');
302
+
303
+ $gallery_title = esc_attr($_POST['title']);
304
+ $gallery_path = esc_attr($_POST['path']);
305
+ $gallery_desc = esc_attr($_POST['gallerydesc']);
306
+ $gallery_preview = (int) $_POST['previewpic'];
307
+
308
+ $wpdb->query("UPDATE $wpdb->flaggallery SET title= '$gallery_title', path= '$gallery_path', galdesc = '$gallery_desc', previewpic = '$gallery_preview' WHERE gid = '$this->gid'");
309
+
310
+ if (isset ($_POST['author'])) {
311
+ $gallery_author = (int) $_POST['author'];
312
+ $wpdb->query("UPDATE $wpdb->flaggallery SET author = '$gallery_author' WHERE gid = '$this->gid'");
313
+ }
314
+
315
+ $this->update_pictures();
316
+
317
+ //hook for other plugin to update the fields
318
+ do_action('flag_update_gallery', $this->gid, $_POST);
319
+
320
+ flagGallery::show_message(__('Update successful',"flag"));
321
+ }
322
+
323
+ if (isset ($_POST['scanfolder'])) {
324
+ // Rescan folder
325
+ check_admin_referer('flag_updategallery');
326
+
327
+ $gallerypath = $wpdb->get_var("SELECT path FROM $wpdb->flaggallery WHERE gid = '$this->gid' ");
328
+ flagAdmin::import_gallery($gallerypath);
329
+ }
330
+ }
331
+
332
+ function update_pictures() {
333
+ global $wpdb;
334
+
335
+ //TODO:Error message when update failed
336
+ //TODO:Combine update in one query per image
337
+
338
+ $description = $_POST['description'];
339
+ $alttext = $_POST['alttext'];
340
+ $exclude = $_POST['exclude'];
341
+ $pictures = $_POST['pid'];
342
+ $hitcounter = $_POST['hitcounter'];
343
+ $total_votes = $_POST['total_votes'];
344
+
345
+ if ( is_array($description) ) {
346
+ foreach( $description as $key => $value ) {
347
+ $desc = $wpdb->escape($value);
348
+ $wpdb->query( "UPDATE $wpdb->flagpictures SET description = '$desc' WHERE pid = $key");
349
+ }
350
+ }
351
+ if ( is_array($alttext) ){
352
+ foreach( $alttext as $key => $value ) {
353
+ $alttext = $wpdb->escape($value);
354
+ $wpdb->query( "UPDATE $wpdb->flagpictures SET alttext = '$alttext' WHERE pid = $key");
355
+ }
356
+ }
357
+ if ( is_array($hitcounter) ){
358
+ foreach( $hitcounter as $key => $value ) {
359
+ $hitcounter = abs( intval($value) );
360
+ $wpdb->query( "UPDATE $wpdb->flagpictures SET hitcounter = '$hitcounter' WHERE pid = $key");
361
+ }
362
+ }
363
+ if ( is_array($total_votes) ){
364
+ foreach( $total_votes as $key => $value ) {
365
+ $total_votes = abs( intval($value) );
366
+ $wpdb->query( "UPDATE $wpdb->flagpictures SET total_votes = IF(hitcounter > $total_votes, $total_votes, hitcounter) WHERE pid = $key");
367
+ }
368
+ }
369
+ if ( is_array($pictures) ){
370
+ foreach( $pictures as $pid ){
371
+ $pid = (int) $pid;
372
+ if (is_array($exclude)){
373
+ if ( array_key_exists($pid, $exclude) )
374
+ $wpdb->query("UPDATE $wpdb->flagpictures SET exclude = 1 WHERE pid = '$pid'");
375
+ else
376
+ $wpdb->query("UPDATE $wpdb->flagpictures SET exclude = 0 WHERE pid = '$pid'");
377
+ } else {
378
+ $wpdb->query("UPDATE $wpdb->flagpictures SET exclude = 0 WHERE pid = '$pid'");
379
+ }
380
+ }
381
+ }
382
+
383
+ return;
384
+ }
385
+
386
+ // Check if user can select a author
387
+ function get_editable_user_ids( $user_id, $exclude_zeros = true ) {
388
+ global $wpdb;
389
+
390
+ $user = new WP_User( $user_id );
391
+
392
+ if ( ! $user->has_cap('FlAG Manage others gallery') ) {
393
+ if ( $user->has_cap('FlAG Manage gallery') || $exclude_zeros == false )
394
+ return array($user->id);
395
+ else
396
+ return false;
397
+ }
398
+
399
+ $level_key = $wpdb->prefix . 'user_level';
400
+ $query = "SELECT user_id FROM $wpdb->usermeta WHERE meta_key = '$level_key'";
401
+ if ( $exclude_zeros )
402
+ $query .= " AND meta_value != '0'";
403
+
404
+ return $wpdb->get_col( $query );
405
+ }
406
+
407
+ function search_images() {
408
+ global $flagdb;
409
+
410
+ if ( empty($_GET['s']) )
411
+ return;
412
+ //on what ever reason I need to set again the query var
413
+ set_query_var('s', $_GET['s']);
414
+ $request = get_search_query();
415
+ // looknow for the images
416
+ $this->search_result = $flagdb->search_for_images( $request );
417
+ // show pictures page
418
+ $this->mode = 'edit';
419
+ }
420
+
421
+ }
422
+ ?>
admin/manage_thumbnail.php ADDED
@@ -0,0 +1,174 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+
5
+ Custom thumbnail for FLAGallery
6
+ Author : Simone Fumagalli | simone@iliveinperego.com
7
+
8
+ Credits:
9
+ jCrop : Kelly Hallman <khallman@wrack.org> | http://deepliquid.com/content/Jcrop.html
10
+
11
+ **/
12
+
13
+ require_once( dirname( dirname(__FILE__) ) . '/flag-config.php');
14
+ require_once( FLAG_ABSPATH . '/lib/image.php' );
15
+
16
+ if ( !is_user_logged_in() )
17
+ die(__('Cheatin&#8217; uh?'));
18
+
19
+ if ( !current_user_can('FlAG Manage gallery') )
20
+ die(__('Cheatin&#8217; uh?'));
21
+
22
+ global $wpdb;
23
+
24
+ $id = (int) $_GET['id'];
25
+
26
+ // let's get the image data
27
+ $picture = flagdb::find_image($id);
28
+
29
+ include_once( flagGallery::graphic_library() );
30
+ $flag_options=get_option('flag_options');
31
+
32
+ $thumb = new flag_Thumbnail($picture->imagePath, TRUE);
33
+ $thumb->resize(350,350);
34
+ // we need the new dimension
35
+ $resizedPreviewInfo = $thumb->newDimensions;
36
+ $thumb->destruct();
37
+
38
+ $preview_image = FLAG_URLPATH . 'flagshow.php?pid=' . $picture->pid . '&amp;width=350&amp;height=350';
39
+ $imageInfo = @getimagesize($picture->imagePath);
40
+ $rr = round($imageInfo[0] / $resizedPreviewInfo['newWidth'], 2);
41
+
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
+ ?>
66
+ <script src="<?php echo FLAG_URLPATH; ?>admin/js/Jcrop/js/jquery.Jcrop.js"></script>
67
+ <link rel="stylesheet" href="<?php echo FLAG_URLPATH; ?>admin/js/Jcrop/css/jquery.Jcrop.css" type="text/css" />
68
+
69
+ <script language="JavaScript">
70
+ <!--
71
+
72
+ var status = 'start';
73
+ var xT, yT, wT, hT, selectedCoords;
74
+ var selectedImage = "thumb-<?php echo $id; ?>";
75
+
76
+ function showPreview(coords)
77
+ {
78
+
79
+ if (status != 'edit') {
80
+ jQuery('#actualThumb').hide();
81
+ jQuery('#previewNewThumb').show();
82
+ status = 'edit';
83
+ }
84
+
85
+ var rx = <?php echo $WidthHtmlPrev; ?> / coords.w;
86
+ var ry = <?php echo $HeightHtmlPrev; ?> / coords.h;
87
+
88
+ jQuery('#imageToEditPreview').css({
89
+ width: Math.round(rx * <?php echo $resizedPreviewInfo['newWidth']; ?>) + 'px',
90
+ height: Math.round(ry * <?php echo $resizedPreviewInfo['newHeight']; ?>) + 'px',
91
+ marginLeft: '-' + Math.round(rx * coords.x) + 'px',
92
+ marginTop: '-' + Math.round(ry * coords.y) + 'px'
93
+ });
94
+
95
+ xT = coords.x;
96
+ yT = coords.y;
97
+ wT = coords.w;
98
+ hT = coords.h;
99
+
100
+ jQuery("#sizeThumb").html(xT+" "+yT+" "+wT+" "+hT);
101
+
102
+ };
103
+
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
+
111
+ jQuery.ajax({
112
+ url: "admin-ajax.php",
113
+ type : "POST",
114
+ data: {x: xT, y: yT, w: wT, h: hT, action: 'flagCreateNewThumb', id: <?php echo $id; ?>, rr: <?php echo $rr; ?>},
115
+ cache: false,
116
+ success: function(data){
117
+ var d = new Date();
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
+ }
130
+ });
131
+
132
+ }
133
+
134
+ -->
135
+ </script>
136
+
137
+ <table width="98%" align="center" style="border:1px solid #DADADA">
138
+ <tr>
139
+ <td rowspan="3" valign="middle" align="center" width="350" style="background-color:#DADADA;">
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>
147
+ <td align="center" width="300" height="320">
148
+ <div id="previewNewThumb" style="display:none;width:<?php echo $WidthHtmlPrev; ?>px;height:<?php echo $HeightHtmlPrev; ?>px;overflow:hidden; margin-left:5px;">
149
+ <img src="<?php echo $preview_image; ?>" id="imageToEditPreview" />
150
+ </div>
151
+ <div id="actualThumb">
152
+ <img src="<?php echo $picture->thumbURL; ?>?<?php echo time()?>" />
153
+ </div>
154
+ </td>
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>
162
+ </table>
163
+
164
+ <script type="text/javascript">
165
+ <!--
166
+ jQuery(document).ready(function(){
167
+ jQuery('#imageToEdit').Jcrop({
168
+ onChange: showPreview,
169
+ onSelect: showPreview,
170
+ aspectRatio: <?php echo round($WidthHtmlPrev/$HeightHtmlPrev,1); ?>
171
+ });
172
+ });
173
+ -->
174
+ </script>
admin/media-upload.php ADDED
@@ -0,0 +1,234 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * @title Add action/filter for the upload tab
5
+ */
6
+
7
+ function flag_wp_upload_tabs ($tabs) {
8
+
9
+ $newtab = array('flag' => __('FlAG Gallery','flag'));
10
+
11
+ return array_merge($tabs,$newtab);
12
+ }
13
+
14
+ add_filter('media_upload_tabs', 'flag_wp_upload_tabs');
15
+
16
+ function media_upload_flag() {
17
+
18
+ // Generate TinyMCE HTML output
19
+ if ( isset($_POST['send']) ) {
20
+ $keys = array_keys($_POST['send']);
21
+ $send_id = (int) array_shift($keys);
22
+ $image = $_POST['image'][$send_id];
23
+ $alttext = stripslashes( htmlspecialchars ($image['alttext'], ENT_QUOTES));
24
+ $description = stripslashes (htmlspecialchars($image['description'], ENT_QUOTES));
25
+
26
+ // here is no new line allowed
27
+ $clean_description = preg_replace("/\n|\r\n|\r$/", " ", $description);
28
+ $img = flagdb::find_image($send_id);
29
+ $class="flag-singlepic flag-{$image['align']}";
30
+
31
+ // Build output
32
+ if ($image['size'] == "thumbnail")
33
+ $html = "<img src='{$image['thumb']}' alt='$alttext' class='$class' align='{$image['align']}' />";
34
+ // Wrap the link to the fullsize image around
35
+ $html = "<a href='{$image['url']}' title='$clean_description'>$html</a>";
36
+
37
+ if ($image['size'] == "full")
38
+ $html = "<img src='{$image['url']}' alt='$alttext' class='$class' align='{$image['align']}' />";
39
+
40
+ media_upload_flag_save_image();
41
+
42
+ // Return it to TinyMCE
43
+ return media_send_to_editor($html);
44
+ }
45
+
46
+ // Save button
47
+ if ( isset($_POST['save']) ) {
48
+ media_upload_flag_save_image();
49
+ }
50
+
51
+ return wp_iframe( 'media_upload_flag_form', $errors );
52
+ }
53
+
54
+ add_action('media_upload_flag', 'media_upload_flag');
55
+
56
+ function media_upload_flag_save_image() {
57
+
58
+ global $wpdb;
59
+
60
+ check_admin_referer('flag-media-form');
61
+
62
+ if ( !empty($_POST['image']) ) foreach ( $_POST['image'] as $image_id => $image ) {
63
+
64
+ // Function save desription
65
+ $alttext = esc_attr($image['alttext']);
66
+ $description = esc_attr($image['description']);
67
+
68
+ $wpdb->query("UPDATE $wpdb->flagpictures SET alttext= '$alttext', description = '$description' WHERE pid = '$image_id'");
69
+
70
+ }
71
+ }
72
+
73
+ function media_upload_flag_form($errors) {
74
+
75
+ global $wpdb, $wp_query, $wp_locale, $type, $tab, $post_mime_types, $flag;
76
+
77
+ media_upload_header();
78
+
79
+ $post_id = intval($_REQUEST['post_id']);
80
+ $galleryID = 0;
81
+ $total = 1;
82
+ $picarray = false;
83
+
84
+ $form_action_url = site_url( "wp-admin/media-upload.php?type={$GLOBALS['type']}&tab=flag&post_id=$post_id", 'admin');
85
+
86
+ // Get number of images in gallery
87
+ if ($_REQUEST['select_gal']){
88
+ $galleryID = (int) $_REQUEST['select_gal'];
89
+ $total = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->flagpictures WHERE galleryid = '$galleryID'");
90
+ }
91
+
92
+ // Build navigation
93
+ $_GET['paged'] = intval($_GET['paged']);
94
+ if ( $_GET['paged'] < 1 )
95
+ $_GET['paged'] = 1;
96
+ $start = ( $_GET['paged'] - 1 ) * 10;
97
+ if ( $start < 1 )
98
+ $start = 0;
99
+
100
+ // Get the images
101
+ if ( $galleryID != 0 )
102
+ $picarray = $wpdb->get_col("SELECT pid FROM $wpdb->flagpictures WHERE galleryid = '$galleryID' AND exclude != 1 ORDER BY {$flag->options['galSort']} {$flag->options['galSortDir']} LIMIT $start, 10 ");
103
+
104
+ ?>
105
+
106
+ <form id="filter" action="" method="get">
107
+ <input type="hidden" name="type" value="<?php echo esc_attr( $GLOBALS['type'] ); ?>" />
108
+ <input type="hidden" name="tab" value="<?php echo esc_attr( $GLOBALS['tab'] ); ?>" />
109
+ <input type="hidden" name="post_id" value="<?php echo (int) $post_id; ?>" />
110
+
111
+ <div class="tablenav">
112
+ <?php
113
+ $page_links = paginate_links( array(
114
+ 'base' => add_query_arg( 'paged', '%#%' ),
115
+ 'format' => '',
116
+ 'total' => ceil($total / 10),
117
+ 'current' => $_GET['paged']
118
+ ));
119
+
120
+ if ( $page_links )
121
+ echo "<div class='tablenav-pages'>$page_links</div>";
122
+ ?>
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 esc_attr( _e('No gallery',"flag") ); ?></option>
127
+ <?php
128
+ // Show gallery selection
129
+ $gallerylist = $wpdb->get_results("SELECT * FROM $wpdb->flaggallery ORDER BY gid ASC");
130
+ if(is_array($gallerylist)) {
131
+ foreach($gallerylist as $gallery) {
132
+ $selected = ($gallery->gid == $galleryID )? ' selected="selected"' : "";
133
+ echo '<option value="'.$gallery->gid.'"'.$selected.' >'.$gallery->title.'</option>'."\n";
134
+ }
135
+ }
136
+ ?>
137
+ </select>
138
+ <input type="submit" id="show-gallery" value="<?php esc_attr( _e('Select &#187;','flag') ); ?>" class="button-secondary" />
139
+ </div>
140
+ <br style="clear:both;" />
141
+ </div>
142
+ </form>
143
+
144
+ <form enctype="multipart/form-data" method="post" action="<?php echo esc_attr($form_action_url); ?>" class="media-upload-form" id="library-form">
145
+
146
+ <?php wp_nonce_field('flag-media-form'); ?>
147
+
148
+ <script type="text/javascript">
149
+ <!--
150
+ jQuery(function($){
151
+ var preloaded = $(".media-item.preloaded");
152
+ if ( preloaded.length > 0 ) {
153
+ preloaded.each(function(){prepareMediaItem({id:this.id.replace(/[^0-9]/g, '')},'');});
154
+ updateMediaForm();
155
+ }
156
+ });
157
+ -->
158
+ </script>
159
+
160
+ <div id="media-items">
161
+ <?php
162
+ if(is_array($picarray)) {
163
+ foreach ($picarray as $picid) {
164
+ //TODO:Reduce SQL Queries
165
+ $picture = flagdb::find_image($picid);
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 esc_attr( _e('Show', "flag") ); ?></a>
170
+ <a class='toggle describe-toggle-off' href='#'><?php esc_attr( _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 esc_attr( _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_attr( 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 esc_attr( _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_attr( stripslashes($picture->alttext) ); ?>" type="text"/></td>
183
+ </tr>
184
+ <tr>
185
+ <td class="label"><label for="image[<?php echo $picid; ?>][description]"><?php esc_attr( _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_attr( stripslashes($picture->description) ); ?></textarea></td>
187
+ </tr>
188
+ <tr class="align">
189
+ <td class="label"><label for="image[<?php echo $picid; ?>][align]"><?php esc_attr( _e("Alignment") ); ?></label></td>
190
+ <td class="field">
191
+ <input name="image[<?php echo $picid; ?>][align]" id="image-align-none-<?php echo $picid; ?>" checked="checked" value="none" type="radio" />
192
+ <label for="image-align-none-<?php echo $picid; ?>" class="align image-align-none-label"><?php esc_attr( _e("None") ); ?></label>
193
+ <input name="image[<?php echo $picid; ?>][align]" id="image-align-left-<?php echo $picid; ?>" value="left" type="radio" />
194
+ <label for="image-align-left-<?php echo $picid; ?>" class="align image-align-left-label"><?php esc_attr( _e("Left") ); ?></label>
195
+ <input name="image[<?php echo $picid; ?>][align]" id="image-align-center-<?php echo $picid; ?>" value="center" type="radio" />
196
+ <label for="image-align-center-<?php echo $picid; ?>" class="align image-align-center-label"><?php esc_attr( _e("Center") ); ?></label>
197
+ <input name="image[<?php echo $picid; ?>][align]" id="image-align-right-<?php echo $picid; ?>" value="right" type="radio" />
198
+ <label for="image-align-right-<?php echo $picid; ?>" class="align image-align-right-label"><?php esc_attr( _e("Right") ); ?></label>
199
+ </td>
200
+ </tr>
201
+ <tr class="image-size">
202
+ <th class="label"><label for="image[<?php echo $picid; ?>][size]"><span class="alignleft"><?php esc_attr( _e("Size") ); ?></span></label>
203
+ </th>
204
+ <td class="field">
205
+ <input name="image[<?php echo $picid; ?>][size]" id="image-size-thumb-<?php echo $picid; ?>" type="radio" checked="checked" value="thumbnail" />
206
+ <label for="image-size-thumb-<?php echo $picid; ?>"><?php esc_attr( _e("Thumbnail") ); ?></label>
207
+ <input name="image[<?php echo $picid; ?>][size]" id="image-size-full-<?php echo $picid; ?>" type="radio" value="full" />
208
+ <label for="image-size-full-<?php echo $picid; ?>"><?php esc_attr( _e("Full size") ); ?></label>
209
+ </td>
210
+ </tr>
211
+ <tr class="submit">
212
+ <td>
213
+ <input type="hidden" name="image[<?php echo $picid; ?>][thumb]" value="<?php echo $picture->thumbURL; ?>" />
214
+ <input type="hidden" name="image[<?php echo $picid; ?>][url]" value="<?php echo $picture->imageURL; ?>" />
215
+ </td>
216
+ <td class="savesend"><button type="submit" class="button" value="1" name="send[<?php echo $picid; ?>]"><?php echo esc_attr( __('Insert into Post') ); ?></button></td>
217
+ </tr>
218
+ </tbody></table>
219
+ </div>
220
+ <?php
221
+ }
222
+ }
223
+ ?>
224
+ </div>
225
+ <p class="ml-submit">
226
+ <input type="submit" class="button savebutton" name="save" value="<?php esc_attr( _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; ?>" />
230
+ </form>
231
+
232
+ <?php
233
+ }
234
+ ?>
admin/meta_box.php ADDED
@@ -0,0 +1,167 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You are not allowed to call this page directly.'); }
2
+
3
+ global $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 = $flag_custom["mb_items_array"][0];
8
+ $skinname = $flag_custom["mb_skinname"][0];
9
+ $scode = $flag_custom["mb_scode"][0];
10
+ $button_text = $flag_custom["mb_button"][0];
11
+ $button_link = $flag_custom["mb_button_link"][0];
12
+ if(!$button_text) $button_text = __('Back','flag');
13
+ if(!$button_link) $button_link = 'http://';
14
+ $bg_link = $flag_custom["mb_bg_link"][0];
15
+ $bg_pos = $flag_custom["mb_bg_pos"][0];
16
+ $bg_repeat = $flag_custom["mb_bg_repeat"][0];
17
+ ?>
18
+ <script type="text/javascript">/*<![CDATA[*/
19
+ var i_arr = '<?php echo $items_array; ?>';
20
+ jQuery(document).ready(function() {
21
+ if(i_arr){
22
+ i_arr = i_arr.split(',');
23
+ jQuery('#galleries :checkbox').each(function(){
24
+ if(jQuery.inArray(jQuery(this).val(),i_arr) > -1){
25
+ jQuery(this).attr('checked','checked');
26
+ }
27
+ });
28
+ } else {
29
+ jQuery('#mb_items_array').val('all');
30
+ jQuery('#galleries input[value="all"]').attr('checked','checked').parent().siblings('.row').find('input').removeAttr('checked');
31
+ }
32
+ var galleries = 'gid='+jQuery('#mb_items_array').val();
33
+ var skin = jQuery('#mb_skinname option:selected').val();
34
+ if(skin) skin = ' skin='+skin; else skin = '';
35
+ var wmode = jQuery('#mb_bg_link').val();
36
+ if(wmode) wmode = ' wmode=transparent'; else wmode = ' wmode=window';
37
+ short_code(galleries,skin,wmode);
38
+ jQuery('#galleries :checkbox').click(function(){
39
+ if(jQuery(this).is(':checked')){
40
+ var cur = jQuery(this).val();
41
+ if(cur == 'all') {
42
+ jQuery(this).parent().siblings('.row').find('input').removeAttr('checked');
43
+ jQuery('#mb_items_array').val(cur);
44
+ } else {
45
+ jQuery('#galleries input[value="all"]').removeAttr('checked');
46
+ var arr = jQuery('#mb_items_array').val();
47
+ if(arr && arr != 'all') { var del = ','; } else { arr = ''; var del = ''; }
48
+ jQuery('#mb_items_array').val(arr+del+cur);
49
+ }
50
+ } else {
51
+ var cur = jQuery(this).val();
52
+ var arr = jQuery('#mb_items_array').val().split(',');
53
+ arr = jQuery.grep(arr, function(a){ return a != cur; }).join(',');
54
+ if(arr) {
55
+ jQuery('#mb_items_array').val(arr);
56
+ } else {
57
+ jQuery('#galleries input[value="all"]').attr('checked','checked');
58
+ jQuery('#mb_items_array').val('all');
59
+ }
60
+ }
61
+ galleries = 'gid='+jQuery('#mb_items_array').val();
62
+ skin = jQuery('#mb_skinname option:selected').val(); if(skin) skin = ' skin='+skin; else skin = '';
63
+ short_code(galleries,skin,wmode);
64
+ });
65
+ jQuery('#mb_skinname').change(function(){
66
+ var skin = jQuery(this).val();
67
+ if(skin) {
68
+ skin = ' skin='+skin;
69
+ } else {
70
+ skin = '';
71
+ }
72
+ galleries = 'gid='+jQuery('#mb_items_array').val();
73
+ short_code(galleries,skin,wmode);
74
+ });
75
+ jQuery('#mb_bg_link').change(function(){
76
+ var wmode = jQuery(this).val();
77
+ if(wmode) {
78
+ wmode = ' wmode=transparent';
79
+ } else {
80
+ wmode = ' wmode=window';
81
+ }
82
+ galleries = 'gid='+jQuery('#mb_items_array').val();
83
+ short_code(galleries,skin,wmode);
84
+ });
85
+ });
86
+ function short_code(galleries,skin,wmode) {
87
+ jQuery('#mb_scode').val('[flagallery '+galleries+' name=Gallery w=100% h=100%'+skin+wmode+' fullwindow=true]');
88
+ }
89
+ /*]]>*/</script>
90
+ <div class="wrap">
91
+ <form id="generator1">
92
+ <table border="0" cellpadding="4" cellspacing="0" style="width: 90%;">
93
+ <tr>
94
+ <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>
95
+ <td valign="top"><div id="galleries" style="width: 214px; height: 160px; overflow: auto;">
96
+ <div class="row"><input type="checkbox" value="all" /> <strong>* - <?php _e("all galleries", 'flag'); ?></strong></div>
97
+ <?php
98
+ $gallerylist = $flagdb->find_all_galleries('gid', 'ASC');
99
+ if(is_array($gallerylist)) {
100
+ foreach($gallerylist as $gallery) {
101
+ $name = ( empty($gallery->title) ) ? $gallery->name : $gallery->title;
102
+ echo '<div class="row"><input type="checkbox" value="' . $gallery->gid . '" /> <span>' . $gallery->gid . ' - ' . $name . '</span></div>' . "\n";
103
+ }
104
+ }
105
+ ?>
106
+ </div></td>
107
+ </tr>
108
+ <tr>
109
+ <td nowrap="nowrap" valign="top"><p style="padding-top:3px;"><?php _e("Galleries order", 'flag'); ?>: &nbsp; </p></td>
110
+ <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>
111
+ </tr>
112
+ <tr>
113
+ <td nowrap="nowrap" valign="top"><p style="padding-top:3px;"><label for="mb_skinname"><?php _e("Choose skin", 'flag'); ?>:</label></p></td>
114
+ <td valign="top"><p><select id="mb_skinname" name="mb_skinname">
115
+ <option value="" <?php selected($skinname,''); ?>><?php _e("skin active by default", 'flag'); ?></option>
116
+ <?php
117
+ foreach ( (array)$i_skins as $skin_file => $skin_data) {
118
+ echo '<option value="'.dirname($skin_file).'" '.selected($skinname,dirname($skin_file),false).'>'.$skin_data['Name'].'</option>'."\n";
119
+ }
120
+ ?>
121
+ </select></p>
122
+ <input id="mb_scode" name="mb_scode" type="hidden" style="width: 98%;" value="<?php echo $scode; ?>" />
123
+ </td>
124
+ </tr>
125
+ <tr>
126
+ <td nowrap="nowrap" valign="top"><div style="padding-top: 3px;"><?php _e("Back Button Text", 'flag'); ?>: &nbsp; </div></td>
127
+ <td valign="top"><input id="mb_button" name="mb_button" type="text" style="width: 49%;" value="<?php echo $button_text; ?>" /></td>
128
+ </tr>
129
+ <tr>
130
+ <td nowrap="nowrap" valign="top"><div style="padding-top: 3px;"><?php _e("Back Button Link", 'flag'); ?>: &nbsp; </div></td>
131
+ <td valign="top"><input id="mb_button_link" name="mb_button_link" type="text" style="width: 49%;" value="<?php echo $button_link; ?>" /><br />
132
+ <small><?php _e("Leave empty to use referer link", 'flag'); ?></small></td>
133
+ </tr>
134
+ <tr>
135
+ <td nowrap="nowrap" valign="top"><div style="padding-top: 3px;"><?php _e("Background Image Link", 'flag'); ?>: &nbsp; </div></td>
136
+ <td valign="top"><input id="mb_bg_link" name="mb_bg_link" type="text" style="width: 49%;" value="<?php echo $bg_link; ?>" /><br />
137
+ <small><?php _e("(optional) Be sure you set Wmode to 'transparent' in skin's options", 'flag'); ?></small></td>
138
+ </tr>
139
+ <tr>
140
+ <td nowrap="nowrap" valign="top"><div style="padding-top: 3px;"><?php _e("Background Position", 'flag'); ?>:</div></td>
141
+ <td valign="top"><select id="mb_bg_pos" name="mb_bg_pos">
142
+ <option value="center center" <?php selected($bg_pos,'center center'); ?>>center center</option>
143
+ <option value="left top" <?php selected($bg_pos,'left top'); ?>>left top</option>
144
+ <option value="left center" <?php selected($bg_pos,'left center'); ?>>left center</option>
145
+ <option value="left bottom" <?php selected($bg_pos,'left bottom'); ?>>left bottom</option>
146
+ <option value="center top" <?php selected($bg_pos,'center top'); ?>>center top</option>
147
+ <option value="center bottom" <?php selected($bg_pos,'center bottom'); ?>>center bottom</option>
148
+ <option value="right top" <?php selected($bg_pos,'right top'); ?>>right top</option>
149
+ <option value="right center" <?php selected($bg_pos,'right center'); ?>>right center</option>
150
+ <option value="right bottom" <?php selected($bg_pos,'right bottom'); ?>>right bottom</option>
151
+ </select></td>
152
+ </tr>
153
+ <tr>
154
+ <td nowrap="nowrap" valign="top"><div style="padding-top: 3px;"><?php _e("Background Repeat", 'flag'); ?>:</div></td>
155
+ <td valign="top"><select id="mb_bg_repeat" name="mb_bg_repeat">
156
+ <option value="repeat" <?php selected($bg_repeat,'repeat'); ?>>repeat</option>
157
+ <option value="repeat-x" <?php selected($bg_repeat,'repeat-x'); ?>>repeat-x</option>
158
+ <option value="repeat-y" <?php selected($bg_repeat,'repeat-y'); ?>>repeat-y</option>
159
+ <option value="no-repeat" <?php selected($bg_repeat,'no-repeat'); ?>>no-repeat</option>
160
+ </select></td>
161
+ </tr>
162
+ </table>
163
+ </form>
164
+ </div>
165
+ <?php
166
+
167
+ ?>
admin/music-box.php ADDED
@@ -0,0 +1,443 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You are not allowed to call this page directly.'); }
4
+
5
+ // check for correct capability
6
+ if ( !is_user_logged_in() )
7
+ die('-1');
8
+
9
+ // check for correct FlAG capability
10
+ if ( !current_user_can('FlAG Manage music') )
11
+ die('-1');
12
+
13
+
14
+ require_once (dirname (__FILE__) . '/functions.php');
15
+ require_once (dirname (__FILE__) . '/playlist.functions.php');
16
+
17
+ function flag_music_controler() {
18
+ if ($_POST['importfolder']){
19
+ check_admin_referer('flag_addmp3');
20
+ $mp3folder = $_POST['mp3folder'];
21
+ if ( !empty($mp3folder) )
22
+ flagAdmin::import_mp3($mp3folder);
23
+ }
24
+ $mode = isset($_REQUEST['mode'])? $_REQUEST['mode'] : 'main';
25
+ $action = isset($_REQUEST['bulkaction'])? $_REQUEST['bulkaction'] : false;
26
+ if($action == 'no_action') {
27
+ $action = false;
28
+ }
29
+ switch($mode) {
30
+ case 'sort':
31
+ include_once (dirname (__FILE__) . '/playlist-sort.php');
32
+ flag_playlist_order($_GET['playlist']);
33
+ break;
34
+ case 'edit':
35
+ if(isset($_POST['updatePlaylist'])) {
36
+ $title = $_POST['playlist_title'];
37
+ $descr = $_POST['playlist_descr'];
38
+ $file = $_GET['playlist'];
39
+ foreach($_POST['item_a'] as $item_id => $item) {
40
+ if($action=='delete_items' && in_array($item_id, $_POST['doaction']))
41
+ continue;
42
+ $data[] = $item_id;
43
+ }
44
+ flagGallery::flagSaveWpMedia();
45
+ flagSavePlaylist($title,$descr,$data,$file);
46
+ }
47
+ if(isset($_POST['updatePlaylistSkin'])) {
48
+ $file = $_GET['playlist'];
49
+ flagSavePlaylistSkin($file);
50
+ }
51
+ include_once (dirname (__FILE__) . '/manage-playlist.php');
52
+ flag_playlist_edit($_GET['playlist']);
53
+ break;
54
+ case 'save':
55
+ $title = $_POST['playlist_title'];
56
+ $descr = $_POST['playlist_descr'];
57
+ $data = $_POST['items_array'];
58
+ $file = isset($_REQUEST['playlist'])? $_REQUEST['playlist'] : false;
59
+ flagGallery::flagSaveWpMedia();
60
+ flagSavePlaylist($title,$descr,$data, $file);
61
+ if(isset($_GET['playlist'])) {
62
+ include_once (dirname (__FILE__) . '/manage-playlist.php');
63
+ flag_playlist_edit($_GET['playlist']);
64
+ } else {
65
+ flag_created_playlists();
66
+ flag_music_wp_media_lib();
67
+ }
68
+ break;
69
+ case 'add':
70
+ $added = $_POST['items'];
71
+ flag_music_wp_media_lib($added);
72
+ break;
73
+ case 'delete':
74
+ flag_playlist_delete($_GET['playlist']);
75
+ case 'main':
76
+ if(isset($_POST['updateMedia'])) {
77
+ flagGallery::flagSaveWpMedia();
78
+ flagGallery::show_message( __('Media updated','flag') );
79
+ }
80
+ default:
81
+ flag_created_playlists();
82
+ flag_music_wp_media_lib();
83
+ break;
84
+ }
85
+
86
+ }
87
+
88
+ function flag_created_playlists() {
89
+
90
+ // same as $_SERVER['REQUEST_URI'], but should work under IIS 6.0
91
+ $filepath = admin_url() . 'admin.php?page=' . $_GET['page'];
92
+
93
+ $all_playlists = get_playlists();
94
+ $total_all_playlists = count($all_playlists);
95
+ $flag_options = get_option ('flag_options');
96
+
97
+ ?>
98
+ <div class="wrap">
99
+ <h2><?php _e('Created playlists', 'flag'); ?></h2>
100
+ <table class="widefat" cellspacing="0">
101
+ <thead>
102
+ <tr>
103
+ <th scope="col" width="25%"><?php _e('Title', 'flag'); ?></th>
104
+ <th scope="col" width="55%"><?php _e('Description', 'flag'); ?></th>
105
+ <th scope="col" ><?php _e('Quantity', 'flag'); ?></th>
106
+ <th scope="col" ><?php _e('Shortcode', 'flag'); ?></th>
107
+ <th scope="col" ><?php _e('Action', 'flag'); ?></th>
108
+ </tr>
109
+ </thead>
110
+ <tbody>
111
+ <?php
112
+ if($all_playlists) {
113
+ foreach((array)$all_playlists as $playlist_file => $playlist_data) {
114
+ $query_m = get_posts(array('post_type' => 'attachment', 'numberposts' => -1, 'post_status' => null, 'post_parent' => null, 'post__in' => $playlist_data['items']));
115
+ $class = ( !isset($class) || $class == 'class="alternate"' ) ? '' : 'class="alternate"';
116
+ $playlist_name = basename($playlist_file, '.xml');
117
+ if(count($query_m) != count($playlist_data['items'])) {
118
+ flagSavePlaylist($playlist_data['title'],$playlist_data['description'],$playlist_data['items'],$playlist_name);
119
+ }
120
+ ?>
121
+ <tr id="<?php echo $playlist_name; ?>" <?php echo $class; ?> >
122
+ <td>
123
+ <a href="<?php echo $filepath.'&amp;playlist='.$playlist_name.'&amp;mode=edit'; ?>" class='edit' title="<?php _e('Edit'); ?>" >
124
+ <?php echo $playlist_data['title']; ?>
125
+ </a>
126
+ </td>
127
+ <td><?php echo $playlist_data['description']; echo '&nbsp;('.__("player", "flag").': <strong>'.$playlist_data['skin'].'</strong>)' ?></td>
128
+ <td><?php echo count($query_m); ?></td>
129
+ <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>
130
+ <td>
131
+ <a href="<?php echo $filepath.'&amp;playlist='.$playlist_name."&amp;mode=delete"; ?>" class="delete" onclick="javascript:check=confirm( '<?php _e("Delete this playlist?",'flag')?>');if(check==false) return false;"><?php _e('Delete','flag'); ?></a>
132
+ </td>
133
+ </tr>
134
+ <?php
135
+ }
136
+ } else {
137
+ echo '<tr><td colspan="5" align="center"><strong>'.__('No playlists found','flag').'</strong></td></tr>';
138
+ }
139
+ ?>
140
+ </tbody>
141
+ </table>
142
+ </div>
143
+
144
+ <?php }
145
+
146
+
147
+ // *** show media list
148
+ function flag_music_wp_media_lib($added=false) {
149
+ global $wpdb;
150
+ // same as $_SERVER['REQUEST_URI'], but should work under IIS 6.0
151
+ $filepath = admin_url() . 'admin.php?page=' . $_GET['page'];
152
+ if($added!==false) {
153
+ $filepath .= '&amp;playlist='.$_GET['playlist'].'&amp;mode=save';
154
+ $flag_options = get_option('flag_options');
155
+ $playlistPath = $flag_options['galleryPath'].'playlists/'.$_GET['playlist'].'.xml';
156
+ $playlist = get_playlist_data(ABSPATH.$playlistPath);
157
+ $exclude = explode(',', $added);
158
+ }
159
+ ?>
160
+ <script type="text/javascript">
161
+ <!--
162
+ jQuery(document).ready(function(){
163
+ jQuery('.cb :checkbox').click(function() {
164
+ if(jQuery(this).is(':checked')){
165
+ var cur = jQuery(this).val();
166
+ var arr = jQuery('#items_array').val();
167
+ if(arr) { var del = ','; } else { var del = ''; }
168
+ jQuery('#items_array').val(arr+del+cur);
169
+ } else {
170
+ var cur = jQuery(this).val();
171
+ var arr = jQuery('#items_array').val().split(',');
172
+ arr = jQuery.grep(arr, function(a){ return a != cur; }).join(',');
173
+ jQuery('#items_array').val(arr);
174
+ };
175
+ });
176
+ jQuery('.del_thumb').click(function(){
177
+ var id = jQuery(this).attr('data-id');
178
+ jQuery('#mp3thumb-'+id).attr('value', '');
179
+ jQuery('#thumb-'+id).attr('src', '<?php echo site_url()."/wp-includes/images/crystal/audio.png"; ?>');
180
+ return false;
181
+ })
182
+ });
183
+ function checkAll(form) {
184
+ for (i = 0, n = form.elements.length; i < n; i++) {
185
+ if(form.elements[i].type == "checkbox") {
186
+ if(form.elements[i].name == "doaction[]") {
187
+ if(form.elements[i].checked == true)
188
+ form.elements[i].checked = false;
189
+ else
190
+ form.elements[i].checked = true;
191
+ }
192
+ }
193
+ }
194
+ var arr = jQuery('.cb input:checked').map(function(){return jQuery(this).val();}).get().join(',');
195
+ jQuery('#items_array').val(arr);
196
+ }
197
+ // this function check for a the number of selected images, sumbmit false when no one selected
198
+ function checkSelected() {
199
+ if(!jQuery('.cb input:checked')) {
200
+ alert('<?php echo js_escape(__('No items selected', 'flag')); ?>');
201
+ return false;
202
+ }
203
+ actionId = jQuery('#bulkaction').val();
204
+ switch (actionId) {
205
+ case "new_playlist":
206
+ showDialog('new_playlist', 160);
207
+ return false;
208
+ break;
209
+ case "add_to_playlist":
210
+ return confirm('<?php echo sprintf(js_escape(__("You are about to add %s items to playlist \n \n 'Cancel' to stop, 'OK' to proceed.",'flag')), "' + numchecked + '") ; ?>');
211
+ break;
212
+ }
213
+ return confirm('<?php echo sprintf(js_escape(__("You are about to start the bulk edit for %s items \n \n 'Cancel' to stop, 'OK' to proceed.",'flag')), "' + numchecked + '") ; ?>');
214
+ }
215
+
216
+ function showDialog( windowId, height ) {
217
+ jQuery("#" + windowId + "_bulkaction").val(jQuery("#bulkaction").val());
218
+ jQuery("#" + windowId + "_mp3id").val(jQuery('#items_array').val());
219
+ // console.log (jQuery("#TB_imagelist").val());
220
+ tb_show("", "#TB_inline?width=640&height=" + height + "&inlineId=" + windowId + "&modal=true", false);
221
+ }
222
+ var current_image = '';
223
+ function send_to_editor(html) {
224
+ var source = html.match(/src=\".*\" alt/);
225
+ source = source[0].replace(/^src=\"/, "").replace(/" alt$/, "");
226
+ //var id = html.match(/wp-image-(\d+(\.\d)*)/ig);
227
+ //id = id[0].match(/\d+/);
228
+ jQuery('#mp3thumb-'+actInp).attr('value', source);
229
+ jQuery('#thumb-'+actInp).attr('src', source);
230
+ tb_remove();
231
+ }
232
+ //-->
233
+ </script>
234
+ <div class="wrap">
235
+ <?php if($added===false) { ?>
236
+ <?php if( current_user_can('FlAG Import folder') ) {
237
+ $defaultpath = 'wp-content/';
238
+ ?>
239
+ <link rel="stylesheet" type="text/css" href="<?php echo FLAG_URLPATH; ?>admin/js/jqueryFileTree/jqueryFileTree.css" />
240
+ <script type="text/javascript" src="<?php echo FLAG_URLPATH; ?>admin/js/jqueryFileTree/jqueryFileTree.js"></script>
241
+ <script type="text/javascript">
242
+ /* <![CDATA[ */
243
+ jQuery(function() {
244
+ jQuery("span.browsefiles").show().click(function(){
245
+ jQuery("#file_browser").fileTree({
246
+ script: "admin-ajax.php?action=flag_file_browser&nonce=<?php echo wp_create_nonce( 'flag-ajax' ) ;?>",
247
+ root: jQuery("#mp3folder").val(),
248
+ }, function(file) {
249
+ //var path = file.replace("<?php echo WINABSPATH; ?>", "");
250
+ jQuery("#mp3folder").val(file);
251
+ });
252
+
253
+ jQuery("#file_browser").show("slide");
254
+ });
255
+ });
256
+ /* ]]> */
257
+ </script>
258
+
259
+ <!-- import folder -->
260
+ <div id="importfolder">
261
+ <h2><?php _e('Import mp3 from folder', 'flag'); ?></h2>
262
+ <form name="importfolder" id="importfolder_form" method="POST" action="<?php echo $filepath; ?>" accept-charset="utf-8" >
263
+ <?php wp_nonce_field('flag_addmp3'); ?>
264
+ <table class="form-table">
265
+ <tr valign="top">
266
+ <th scope="row"><?php _e('Import from Server path:', 'flag'); ?></th>
267
+ <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>
268
+ <div id="file_browser"></div><br />
269
+ <p><label><input type="checkbox" name="delete_files" value="delete" checked="checked" /> &nbsp;
270
+ <?php _e('delete files after import in WordPress Media Library','flag'); ?></label></p>
271
+ </td>
272
+ </tr>
273
+ </table>
274
+ <div class="submit"><input class="button-primary" type="submit" name="importfolder" value="<?php _e('Import folder', 'flag'); ?>"/></div>
275
+ </form>
276
+ </div>
277
+ <?php } ?>
278
+ <?php } ?>
279
+
280
+ <h2><?php _e('WordPress Music Library', 'flag'); ?></h2>
281
+ <form id="musiclib" class="flagform" method="POST" action="<?php echo $filepath; ?>" accept-charset="utf-8">
282
+ <?php wp_nonce_field('flag_bulkmusic'); ?>
283
+ <input type="hidden" name="page" value="music-box" />
284
+
285
+ <div class="tablenav">
286
+
287
+ <div class="actions">
288
+ <?php if($added===false) { ?>
289
+ <input name="updateMedia" class="button-primary" style="float: right;" type="submit" value="<?php _e('Update Media','flag'); ?>" />
290
+
291
+ <?php if ( function_exists('json_encode') ) { ?>
292
+ <select name="bulkaction" id="bulkaction">
293
+ <option value="no_action" ><?php _e("No action",'flag'); ?></option>
294
+ <option value="new_playlist" ><?php _e("Create new playlist",'flag'); ?></option>
295
+ </select>
296
+ <input name="showThickbox" class="button-secondary" type="submit" value="<?php _e('Apply','flag'); ?>" onclick="if ( !checkSelected() ) return false;" />
297
+ <?php } ?>
298
+ <a href="<?php echo admin_url( 'media-new.php'); ?>" class="button"><?php _e('Upload Music','flag'); ?></a>
299
+ <input type="hidden" id="items_array" name="items_array" value="" />
300
+ <?php } else { ?>
301
+ <input type="hidden" name="mode" value="save" />
302
+ <input style="width: 80%;" type="text" id="items_array" name="items_array" value="<?php echo $added; ?>" />
303
+ <input type="hidden" name="playlist_title" value="<?php echo $playlist['title']; ?>" />
304
+ <input type="hidden" name="skinname" value="<?php echo $playlist['skin']; ?>" />
305
+ <input type="hidden" name="skinaction" value="<?php echo $playlist['skin']; ?>" />
306
+ <textarea style="display: none;" name="playlist_descr" cols="40" rows="1"><?php echo $playlist['description']; ?></textarea>
307
+ <input name="addToPlaylist" class="button-secondary" type="submit" value="<?php _e('Update Playlist','flag'); ?>" onclick="if ( !checkSelected() ) return false;" />
308
+ <?php } ?>
309
+ </div>
310
+
311
+ </div>
312
+ <table class="widefat" cellspacing="0">
313
+ <thead>
314
+ <tr>
315
+ <th class="cb" width="54" scope="col"><a href="#" onclick="checkAll(document.getElementById('musiclib'));return false;"><?php _e('Check', 'flag'); ?></a></th>
316
+ <th class="id" width="134" scope="col"><div><?php _e('ID', 'flag'); ?></div></th>
317
+ <th class="size" width="75" scope="col"><div><?php _e('Size', 'flag'); ?></div></th>
318
+ <th class="thumb" width="110" scope="col"><div><?php _e('Thumbnail', 'flag'); ?></div></th>
319
+ <th class="title_filename" scope="col"><div><?php _e('Filename / Title', 'flag'); ?></div></th>
320
+ <th class="description" scope="col"><div><?php _e('Description', 'flag'); ?></div></th>
321
+ </tr>
322
+ </thead>
323
+ <tfoot>
324
+ <tr>
325
+ <th class="cb" scope="col"><a href="#" onclick="checkAll(document.getElementById('musiclib'));return false;"><?php _e('Check', 'flag'); ?></a></th>
326
+ <th class="id" scope="col"><?php _e('ID', 'flag'); ?></th>
327
+ <th class="size" scope="col"><?php _e('Size', 'flag'); ?></th>
328
+ <th class="thumb" scope="col"><?php _e('Thumbnail', 'flag'); ?></th>
329
+ <th class="title_filename" scope="col"><?php _e('Filename / Title', 'flag'); ?></th>
330
+ <th class="description" scope="col"><?php _e('Description', 'flag'); ?></th>
331
+ </tr>
332
+ </tfoot>
333
+ <tbody>
334
+ <?php $musiclist = get_posts( $args = array(
335
+ 'numberposts' => -1,
336
+ 'orderby' => 'ID',
337
+ 'order' => 'DESC',
338
+ 'post_type' => 'attachment',
339
+ 'post_mime_type' => 'audio/mpeg' )
340
+ );
341
+ $uploads = wp_upload_dir();
342
+ $flag_options = get_option('flag_options');
343
+ if($musiclist) {
344
+ foreach($musiclist as $mp3) {
345
+ $list[] = $mp3->ID;
346
+ }
347
+ $class = ' class="alternate"';
348
+ foreach($musiclist as $mp3) {
349
+ $class = ( empty($class) ) ? ' class="alternate"' : '';
350
+ $class2 = ( empty($class) ) ? '' : ' alternate';
351
+ $ex = $checked = '';
352
+ if($added!==false && in_array($mp3->ID, $exclude) ) {
353
+ $ex = ' style="background-color:#DDFFBB;" title="'.__("Already Added", "flag").'"';
354
+ $checked = ' checked="checked"';
355
+ }
356
+ $bg = ( !isset($class) || $class == 'class="alternate"' ) ? 'f9f9f9' : 'ffffff';
357
+ $thumb = $mp3thumb = get_post_meta($mp3->ID, 'thumbnail', true);
358
+ if(empty($thumb)) {
359
+ $thumb = site_url().'/wp-includes/images/crystal/audio.png';
360
+ $mp3thumb = '';
361
+ }
362
+ $url = wp_get_attachment_url($mp3->ID);
363
+ ?>
364
+ <tr id="mp3-<?php echo $mp3->ID; ?>"<?php echo $class.$ex; ?>>
365
+ <th class="cb" scope="row" height="24" style="padding-bottom: 0; border-bottom: none;"><input name="doaction[]" type="checkbox"<?php echo $checked; ?> value="<?php echo $mp3->ID; ?>" /></th>
366
+ <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>
367
+ <td class="size" style="padding-bottom: 0; border-bottom: none;"><?php
368
+ $path = $uploads['basedir'].str_replace($uploads['baseurl'],'',$url);
369
+ $size = filesize($path);
370
+ echo round($size/1024/1024,2).' Mb';
371
+ ?></td>
372
+ <td class="thumb" rowspan="2">
373
+ <img id="thumb-<?php echo $mp3->ID; ?>" src="<?php echo $thumb; ?>" width="100" height="100" alt="" />
374
+ </td>
375
+ <td class="title_filename" rowspan="2">
376
+ <strong><a href="<?php echo $url; ?>"><?php echo basename($url); ?></a></strong><br />
377
+ <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 $mp3->post_title; ?></textarea><br />
378
+ <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 $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>
379
+ </td>
380
+ <td class="description" rowspan="2">
381
+ <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 $mp3->post_content; ?></textarea>
382
+ </td>
383
+ </tr>
384
+ <tr class="mp3-<?php echo $mp3->ID.$class2; ?>"<?php echo $ex; ?>>
385
+ <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>
386
+ <div class="play" style="padding-left: 4px;"><span id="c-<?php echo $mp3->ID; ?>"></span></div>
387
+ <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']; ?>]" /></p></td>
388
+ </tr>
389
+ <?php
390
+ }
391
+ } else {
392
+ echo '<tr><td colspan="6" align="center"><strong>'.__('No music in WordPress Media Library.','flag').'</strong></td></tr>';
393
+ }
394
+ ?>
395
+ </tbody>
396
+ </table>
397
+ </form>
398
+ </div>
399
+
400
+ <!-- #new_playlist -->
401
+ <div id="new_playlist" style="display: none;" >
402
+ <form id="form_new_playlist" method="POST" action="<?php echo $filepath; ?>" accept-charset="utf-8">
403
+ <?php wp_nonce_field('flag_thickbox_form'); ?>
404
+ <input type="hidden" id="new_playlist_mp3id" name="items_array" value="" />
405
+ <input type="hidden" id="new_playlist_bulkaction" name="TB_bulkaction" value="" />
406
+ <input type="hidden" name="mode" value="save" />
407
+ <input type="hidden" name="page" value="music-box" />
408
+ <table width="100%" border="0" cellspacing="3" cellpadding="3" >
409
+ <tr valign="top">
410
+ <th align="left" style="padding-top: 5px;"><?php _e('Playlist Title','flag'); ?></th>
411
+ <td><input type="text" class="alignleft" name="playlist_title" value="" />
412
+ <div class="alignright"><strong><?php _e("Choose skin", 'flag'); ?>:</strong>
413
+ <select id="skinname" name="skinname" style="width: 200px; height: 24px; font-size: 11px;">
414
+ <?php require_once (dirname(__FILE__) . '/get_skin.php');
415
+ $all_skins = get_skins($skin_folder='', $type='m');
416
+ if(count($all_skins)) {
417
+ foreach ( (array)$all_skins as $skin_file => $skin_data) {
418
+ echo '<option value="'.dirname($skin_file).'">'.$skin_data['Name'].'</option>'."\n";
419
+ }
420
+ } else {
421
+ echo '<option value="music_default">'.__("No Skins", "flag").'</option>';
422
+ }
423
+ ?>
424
+ </select>
425
+ </div>
426
+ </td>
427
+ </tr>
428
+ <tr valign="top">
429
+ <th align="left" style="padding-top: 5px;"><?php _e('Playlist Description','flag'); ?></th>
430
+ <td><textarea style="width:100%;" rows="3" cols="60" name="playlist_descr"></textarea></td>
431
+ </tr>
432
+ <tr>
433
+ <td>&nbsp;</td>
434
+ <td align="right"><input class="button-secondary" type="reset" value="&nbsp;<?php _e('Cancel', 'flag'); ?>&nbsp;" onclick="tb_remove()"/>
435
+ &nbsp; &nbsp; &nbsp;
436
+ <input class="button-primary " type="submit" name="TB_NewPlaylist" value="<?php _e('OK', 'flag'); ?>" />
437
+ </td>
438
+ </tr>
439
+ </table>
440
+ </form>
441
+ </div>
442
+ <!-- /#new_playlist -->
443
+ <?php } ?>
admin/news.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ // include the flag function
3
+ @ require_once (dirname(dirname(__FILE__)). '/flag-config.php');
4
+ if ( current_user_can('manage_options') ) {
5
+ extract($_POST);
6
+ $str = file_get_contents($want2Read);
7
+ echo $str;
8
+ } else { ?>
9
+ <div id="skins">
10
+ <p><?php _e('Failed to load content.') ?><br /><br /><a href="http://photogallerycreator.com/grand-flagallery/">http://photogallerycreator.com/grand-flagallery/</a></p>
11
+ </div>
12
+ <?php }
13
+ ?>
admin/overview.php ADDED
@@ -0,0 +1,468 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You are not allowed to call this page directly.'); }
3
+
4
+ /**
5
+ * flag_admin_overview()
6
+ *
7
+ * Add the admin overview in wp2.7 style
8
+ * @return mixed content
9
+ */
10
+ function flag_admin_overview() {
11
+ ?>
12
+ <div class="wrap flag-wrap">
13
+ <h2><?php _e('GRAND FlAGallery Overview', 'flag'); echo ' v'.FLAGVERSION; ?></h2>
14
+ <div id="flag-overview" class="metabox-holder">
15
+ <div id="post-body" class="has-sidebar">
16
+ <div class="has-sidebar-content">
17
+ <?php do_meta_boxes('flag-overview', 'normal', null); ?>
18
+ </div>
19
+ </div>
20
+ <div id="side-info-column" class="inner-sidebar" style="display:block; margin-left: -300px;">
21
+ <?php do_meta_boxes('flag-overview', 'side', null); ?>
22
+ </div>
23
+ </div>
24
+ </div>
25
+
26
+ <?php
27
+ wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );
28
+ wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false );
29
+ ?>
30
+ <script type="text/javascript">
31
+ //<![CDATA[
32
+ jQuery(document).ready( function() {
33
+ jQuery('.if-js-closed').removeClass('if-js-closed').addClass('closed');
34
+ // postboxes
35
+ postboxes.add_postbox_toggles('flag-overview');
36
+ jQuery('#side-info-column #major-publishing-actions').appendTo('#dashboard_primary');
37
+ });
38
+ //]]>
39
+ </script>
40
+
41
+ <?php
42
+ }
43
+
44
+ /**
45
+ * Show the server settings
46
+ *
47
+ * @return void
48
+ */
49
+ function flag_overview_server() {
50
+ ?>
51
+ <div id="dashboard_server_settings" class="dashboard-widget-holder wp_dashboard_empty">
52
+ <div class="flag-dashboard-widget">
53
+ <?php if (IS_WPMU) {
54
+ if (flagGallery::flag_wpmu_enable_function('wpmuQuotaCheck'))
55
+ echo flag_SpaceManager::details();
56
+ else {
57
+ //TODO:WPMU message in WP2.5 style
58
+ echo flag_SpaceManager::details();
59
+ }
60
+ } else { ?>
61
+ <div class="dashboard-widget-content">
62
+ <ul class="settings">
63
+ <?php get_serverinfo(); ?>
64
+ </ul>
65
+ </div>
66
+ <?php } ?>
67
+ </div>
68
+ </div>
69
+ <?php
70
+ }
71
+
72
+ /**
73
+ * Show the GD ibfos
74
+ *
75
+ * @return void
76
+ */
77
+ function flag_overview_graphic_lib() {
78
+ ?>
79
+ <div id="dashboard_server_settings" class="dashboard-widget-holder">
80
+ <div class="flag-dashboard-widget">
81
+ <div class="dashboard-widget-content">
82
+ <ul class="settings">
83
+ <?php flag_GD_info(); ?>
84
+ </ul>
85
+ </div>
86
+ </div>
87
+ </div>
88
+ <?php
89
+ }
90
+
91
+ /**
92
+ * Show the Setup Box and some info for Flash Album Gallery
93
+ *
94
+ * @return void
95
+ */
96
+ function flag_overview_setup(){
97
+ global $wpdb, $flag;
98
+
99
+ if (isset($_POST['resetdefault'])) {
100
+ check_admin_referer('flag_uninstall');
101
+
102
+ include_once ( dirname (__FILE__). '/flag_install.php');
103
+ include_once( dirname (__FILE__). '/tuning.php');
104
+
105
+ flag_default_options();
106
+ flag_tune();
107
+ $flag->define_constant();
108
+ $flag->load_options();
109
+
110
+ flagGallery::show_message(__('Reset all settings to default parameter','flag'));
111
+ }
112
+
113
+ if (isset($_POST['uninstall'])) {
114
+
115
+ check_admin_referer('flag_uninstall');
116
+
117
+ include_once ( dirname (__FILE__). '/flag_install.php');
118
+
119
+ flag_uninstall();
120
+
121
+ flagGallery::show_message(__('Uninstall sucessful ! Now delete the plugin and enjoy your life ! Good luck !','flag'));
122
+ }
123
+ ?>
124
+ <div class="submitbox" id="submitpost">
125
+ <div id="minor-publishing">
126
+ <div id="misc-publishing-actions">
127
+ <div class="misc-pub-section">
128
+ <span id="plugin-home" class="icon">
129
+ <strong><a href="http://codeasily.com/wordpress-plugins/flash-album-gallery/flag" style="text-decoration: none;"><?php _e('Plugin Home','flag'); ?></a></strong>
130
+ </span>
131
+ </div>
132
+ <div class="misc-pub-section">
133
+ <span id="plugin-comments" class="icon">
134
+ <a href="http://codeasily.com/wordpress-plugins/flash-album-gallery/flag#comments" style="text-decoration: none;"><?php _e('Plugin Comments','flag'); ?></a>
135
+ </span>
136
+ </div>
137
+ <div class="misc-pub-section">
138
+ <span id="rate-plugin" class="icon">
139
+ <a href="http://wordpress.org/extend/plugins/flash-album-gallery" style="text-decoration: none;"><?php _e('Rate Plugin','flag'); ?></a>
140
+ </span>
141
+ </div>
142
+ <!-- <div class="misc-pub-section">
143
+ <span id="my-plugins" class="icon">
144
+ <a href="http://codeasily.com/category/wordpress-plugins" style="text-decoration: none;"><?php _e('My Plugins','flag'); ?></a>
145
+ </span>
146
+ </div> -->
147
+ <div class="misc-pub-section curtime misc-pub-section-last">
148
+ <span id="contact-me" class="icon">
149
+ <a href="http://codeasily.com/about" style="text-decoration: none;"><?php _e('Contact Me','flag'); ?></a>
150
+ </span>
151
+ </div>
152
+ </div>
153
+ </div>
154
+ </div>
155
+ <?php if (!IS_WPMU || flag_wpmu_site_admin() ) : ?>
156
+ <div id="major-publishing-actions">
157
+ <form id="resetsettings" name="resetsettings" method="post">
158
+ <?php wp_nonce_field('flag_uninstall'); ?>
159
+ <div id="save-action" class="alignleft">
160
+ <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;" />
161
+ </div>
162
+ <div id="preview-action" class="alignright">
163
+ <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;" />
164
+ </div>
165
+ <br class="clear" />
166
+ </form>
167
+ </div>
168
+ <?php endif; ?>
169
+
170
+ <?php
171
+ }
172
+
173
+ /**
174
+ * Show a summary of the used images
175
+ *
176
+ * @return void
177
+ */
178
+ function flag_overview_right_now() {
179
+ global $wpdb;
180
+ $images = intval( $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->flagpictures") );
181
+ $galleries = intval( $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->flaggallery") );
182
+ ?>
183
+
184
+ <div class="table table_content">
185
+ <p class="sub"><?php _e('At a Glance', 'flag'); ?></p>
186
+ <table>
187
+ <tbody>
188
+ <tr class="first">
189
+ <td class="first b"><a href="admin.php?page=flag-manage-gallery&tabs=1"><?php echo $images; ?></a></td>
190
+ <td class="t"><?php echo __ngettext( 'Image', 'Images', $images, 'flag' ); ?></td>
191
+ <td class="b"></td>
192
+ <td class="last"></td>
193
+ </tr>
194
+ <tr>
195
+ <td class="first b"><a href="admin.php?page=flag-manage-gallery&tabs=0"><?php echo $galleries; ?></a></td>
196
+ <td class="t"><?php echo __ngettext( 'Gallery', 'Galleries', $galleries, 'flag' ); ?></td>
197
+ <td class="b"></td>
198
+ <td class="last"></td>
199
+ </tr>
200
+ </tbody>
201
+ </table>
202
+ </div>
203
+ <div class="versions">
204
+ <p>
205
+ <?php if(current_user_can('FlAG Upload images')): ?><a class="button rbutton" href="admin.php?page=flag-manage-gallery&tabs=1"><strong><?php _e('Upload pictures', 'flag'); ?></strong></a><?php endif; ?>
206
+ <?php _e('Here you can control your images and galleries.', 'flag'); ?></p>
207
+ <span><?php
208
+ $userlevel = '<span class="b">' . (current_user_can('manage_options') ? __('Gallery Administrator', 'flag') : __('Gallery Editor', 'flag')) . '</span>';
209
+ printf(__('You currently have %s rights.', 'flag'), $userlevel);
210
+ ?></span>
211
+ </div>
212
+ <?php
213
+ }
214
+
215
+ add_meta_box('dashboard_right_now', __('Welcome to FlAG Gallery !', 'flag'), 'flag_overview_right_now', 'flag-overview', 'normal', 'default');
216
+ add_meta_box('flag_server', __('Server Settings', 'flag'), 'flag_overview_server', 'flag-overview', 'normal', 'default');
217
+ add_meta_box('flag_gd_lib', __('Graphic Library', 'flag'), 'flag_overview_graphic_lib', 'flag-overview', 'normal', 'default');
218
+ add_meta_box('dashboard_primary', __('Setup Box', 'flag'), 'flag_overview_setup', 'flag-overview', 'side', 'core');
219
+
220
+ /**
221
+ * Show GD Library version information
222
+ *
223
+ * @return void
224
+ */
225
+ function flag_GD_info() {
226
+
227
+ if(function_exists("gd_info")){
228
+ $info = gd_info();
229
+ $keys = array_keys($info);
230
+ for($i=0; $i<count($keys); $i++) {
231
+ if(is_bool($info[$keys[$i]]))
232
+ echo "<li> " . $keys[$i] ." : <span>" . flag_GD_Support($info[$keys[$i]]) . "</span></li>\n";
233
+ else
234
+ echo "<li> " . $keys[$i] ." : <span>" . $info[$keys[$i]] . "</span></li>\n";
235
+ }
236
+ }
237
+ else {
238
+ echo '<h4>'.__('No GD support', 'flag').'!</h4>';
239
+ }
240
+ }
241
+
242
+ /**
243
+ * Return localized Yes or no
244
+ *
245
+ * @param bool $bool
246
+ * @return return 'Yes' | 'No'
247
+ */
248
+ function flag_GD_Support($bool){
249
+ if($bool)
250
+ return __('Yes', 'flag');
251
+ else
252
+ return __('No', 'flag');
253
+ }
254
+
255
+ /**
256
+ * Show up some server infor's
257
+ * @author GamerZ (http://www.lesterchan.net)
258
+ *
259
+ * @return void
260
+ */
261
+ function get_serverinfo() {
262
+ global $wpdb;
263
+ // Get MYSQL Version
264
+ $sqlversion = $wpdb->get_var("SELECT VERSION() AS version");
265
+ // GET SQL Mode
266
+ $mysqlinfo = $wpdb->get_results("SHOW VARIABLES LIKE 'sql_mode'");
267
+ if (is_array($mysqlinfo)) $sql_mode = $mysqlinfo[0]->Value;
268
+ if (empty($sql_mode)) $sql_mode = __('Not set', 'flag');
269
+ // Get PHP Safe Mode
270
+ if(ini_get('safe_mode')) $safe_mode = __('On', 'flag');
271
+ else $safe_mode = __('Off', 'flag');
272
+ // Get PHP allow_url_fopen
273
+ if(ini_get('allow_url_fopen')) $allow_url_fopen = __('On', 'flag');
274
+ else $allow_url_fopen = __('Off', 'flag');
275
+ // Get PHP Max Upload Size
276
+ if(ini_get('upload_max_filesize')) $upload_max = ini_get('upload_max_filesize');
277
+ else $upload_max = __('N/A', 'flag');
278
+ // Get PHP Output buffer Size
279
+ if(ini_get('output_buffering')) $output_buffer = ini_get('output_buffering');
280
+ else $output_buffer = __('N/A', 'flag');
281
+ // Get PHP Max Post Size
282
+ if(ini_get('post_max_size')) $post_max = ini_get('post_max_size');
283
+ else $post_max = __('N/A', 'flag');
284
+ // Get PHP Max execution time
285
+ if(ini_get('max_execution_time')) $max_execute = ini_get('max_execution_time');
286
+ else $max_execute = __('N/A', 'flag');
287
+ // Get PHP Memory Limit
288
+ if(ini_get('memory_limit')) $memory_limit = ini_get('memory_limit');
289
+ else $memory_limit = __('N/A', 'flag');
290
+ // Get actual memory_get_usage
291
+ if (function_exists('memory_get_usage')) $memory_usage = round(memory_get_usage() / 1024 / 1024, 2) . __(' MByte', 'flag');
292
+ else $memory_usage = __('N/A', 'flag');
293
+ // required for EXIF read
294
+ if (is_callable('exif_read_data')) $exif = __('Yes', 'flag'). " ( V" . substr(phpversion('exif'),0,4) . ")" ;
295
+ else $exif = __('No', 'flag');
296
+ // required for meta data
297
+ if (is_callable('iptcparse')) $iptc = __('Yes', 'flag');
298
+ else $iptc = __('No', 'flag');
299
+ // required for meta data
300
+ if (is_callable('xml_parser_create')) $xml = __('Yes', 'flag');
301
+ else $xml = __('No', 'flag');
302
+ ?>
303
+ <li><?php _e('Operating System', 'flag'); ?> : <span><?php echo PHP_OS; ?>&nbsp;(<?php echo (PHP_INT_SIZE * 8); ?>&nbsp;Bit)</span></li>
304
+ <li><?php _e('Server', 'flag'); ?> : <span><?php echo $_SERVER["SERVER_SOFTWARE"]; ?></span></li>
305
+ <li><?php _e('Memory usage', 'flag'); ?> : <span><?php echo $memory_usage; ?></span></li>
306
+ <li><?php _e('MYSQL Version', 'flag'); ?> : <span><?php echo $sqlversion; ?></span></li>
307
+ <li><?php _e('SQL Mode', 'flag'); ?> : <span><?php echo $sql_mode; ?></span></li>
308
+ <li><?php _e('PHP Version', 'flag'); ?> : <span><?php echo PHP_VERSION; ?></span></li>
309
+ <li><?php _e('PHP Safe Mode', 'flag'); ?> : <span><?php echo $safe_mode; ?></span></li>
310
+ <li><?php _e('PHP Allow URL fopen', 'flag'); ?> : <span><?php echo $allow_url_fopen; ?></span></li>
311
+ <li><?php _e('PHP Memory Limit', 'flag'); ?> : <span><?php echo $memory_limit; ?></span></li>
312
+ <li><?php _e('PHP Max Upload Size', 'flag'); ?> : <span><?php echo $upload_max; ?></span></li>
313
+ <li><?php _e('PHP Max Post Size', 'flag'); ?> : <span><?php echo $post_max; ?></span></li>
314
+ <li><?php _e('PHP Output Buffer Size', 'flag'); ?> : <span><?php echo $output_buffer; ?></span></li>
315
+ <li><?php _e('PHP Max Script Execute Time', 'flag'); ?> : <span><?php echo $max_execute; ?>s</span></li>
316
+ <li><?php _e('PHP Exif support', 'flag'); ?> : <span><?php echo $exif; ?></span></li>
317
+ <li><?php _e('PHP IPTC support', 'flag'); ?> : <span><?php echo $iptc; ?></span></li>
318
+ <li><?php _e('PHP XML support', 'flag'); ?> : <span><?php echo $xml; ?></span></li>
319
+ <?php
320
+ }
321
+
322
+ /**
323
+ * WPMU feature taken from Z-Space Upload Quotas
324
+ * @author Dylan Reeve
325
+ * @url http://dylan.wibble.net/
326
+ *
327
+ */
328
+ class flag_SpaceManager {
329
+
330
+ function getQuota() {
331
+ if (function_exists(get_space_allowed))
332
+ $quota = get_space_allowed();
333
+ else
334
+ $quota = get_site_option( "blog_upload_space" );
335
+
336
+ return $quota;
337
+ }
338
+
339
+ function details() {
340
+
341
+ // take default seetings
342
+ $settings = array(
343
+
344
+ 'remain' => array(
345
+ 'color_text' => 'white',
346
+ 'color_bar' => '#0D324F',
347
+ 'color_bg' => '#a0a0a0',
348
+ 'decimals' => 2,
349
+ 'unit' => 'm',
350
+ 'display' => true,
351
+ 'graph' => false
352
+ ),
353
+
354
+ 'used' => array(
355
+ 'color_text' => 'white',
356
+ 'color_bar' => '#0D324F',
357
+ 'color_bg' => '#a0a0a0',
358
+ 'decimals' => 2,
359
+ 'unit' => 'm',
360
+ 'display' => true,
361
+ 'graph' => true
362
+ )
363
+ );
364
+
365
+ $quota = flag_SpaceManager::getQuota() * 1024 * 1024;
366
+ $used = get_dirsize( constant( 'ABSPATH' ) . constant( 'UPLOADS' ) );
367
+ // $used = get_dirsize( ABSPATH."wp-content/blogs.dir/".$blog_id."/files" );
368
+
369
+ if ($used > $quota) $percentused = '100';
370
+ else $percentused = ( $used / $quota ) * 100;
371
+
372
+ $remaining = $quota - $used;
373
+ $percentremain = 100 - $percentused;
374
+
375
+ $out = '';
376
+ $out .= '<div id="spaceused"> <h3>'.__('Storage Space','flag').'</h3>';
377
+
378
+ if ($settings['used']['display']) {
379
+ $out .= __('Upload Space Used:','flag') . "\n";
380
+ $out .= flag_SpaceManager::buildGraph($settings['used'], $used,$quota,$percentused);
381
+ $out .= "<br />";
382
+ }
383
+
384
+ if($settings['remain']['display']) {
385
+ $out .= __('Upload Space Remaining:','flag') . "\n";
386
+ $out .= flag_SpaceManager::buildGraph($settings['remain'], $remaining,$quota,$percentremain);
387
+
388
+ }
389
+
390
+ $out .= "</div>";
391
+
392
+ echo $out;
393
+ }
394
+
395
+ function buildGraph($settings, $size, $quota, $percent) {
396
+ $color_bar = $settings['color_bar'];
397
+ $color_bg = $settings['color_bg'];
398
+ $color_text = $settings['color_text'];
399
+
400
+ switch ($settings['unit']) {
401
+ case "b":
402
+ $unit = "B";
403
+ break;
404
+
405
+ case "k":
406
+ $unit = "KB";
407
+ $size = $size / 1024;
408
+ $quota = $quota / 1024;
409
+ break;
410
+
411
+ case "g": // Gigabytes, really?
412
+ $unit = "GB";
413
+ $size = $size / 1024 / 1024 / 1024;
414
+ $quota = $quota / 1024 / 1024 / 1024;
415
+ break;
416
+
417
+ default:
418
+ $unit = "MB";
419
+ $size = $size / 1024 / 1024;
420
+ $quota = $quota / 1024 / 1024;
421
+ break;
422
+ }
423
+
424
+ $size = round($size, (int)$settings['decimals']);
425
+
426
+ $pct = round(($size / $quota)*100);
427
+
428
+ if ($settings['graph']) {
429
+ //TODO:move style to CSS
430
+ $out = '<div style="display: block; margin: 0; padding: 0; height: 15px; border: 1px inset; width: 100%; background-color: '.$color_bg.';">'."\n";
431
+ $out .= '<div style="display: block; height: 15px; border: none; background-color: '.$color_bar.'; width: '.$pct.'%;">'."\n";
432
+ $out .= '<div style="display: inline; position: relative; top: 0; left: 0; font-size: 10px; color: '.$color_text.'; font-weight: bold; padding-bottom: 2px; padding-left: 5px;">'."\n";
433
+ $out .= $size.$unit;
434
+ $out .= "</div>\n</div>\n</div>\n";
435
+ } else {
436
+ $out = "<strong>".$size.$unit." ( ".number_format($percent)."%)"."</strong><br />";
437
+ }
438
+
439
+ return $out;
440
+ }
441
+
442
+ }
443
+
444
+ /**
445
+ * get_phpinfo() - Extract all of the data from phpinfo into a nested array
446
+ *
447
+ * @author jon@sitewizard.ca
448
+ * @return array
449
+ */
450
+ function get_phpinfo() {
451
+
452
+ ob_start();
453
+ phpinfo();
454
+ $phpinfo = array('phpinfo' => array());
455
+
456
+ if ( preg_match_all('#(?:<h2>(?:<a name=".*?">)?(.*?)(?:</a>)?</h2>)|(?:<tr(?: class=".*?")?><t[hd](?: class=".*?")?>(.*?)\s*</t[hd]>(?:<t[hd](?: class=".*?")?>(.*?)\s*</t[hd]>(?:<t[hd](?: class=".*?")?>(.*?)\s*</t[hd]>)?)?</tr>)#s', ob_get_clean(), $matches, PREG_SET_ORDER) )
457
+ foreach($matches as $match) {
458
+ if(strlen($match[1]))
459
+ $phpinfo[$match[1]] = array();
460
+ elseif(isset($match[3]))
461
+ $phpinfo[end(array_keys($phpinfo))][$match[2]] = isset($match[4]) ? array($match[3], $match[4]) : $match[3];
462
+ else
463
+ $phpinfo[end(array_keys($phpinfo))][] = $match[2];
464
+ }
465
+
466
+ return $phpinfo;
467
+ }
468
+ ?>
admin/playlist-sort.php ADDED
@@ -0,0 +1,118 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * @author Sergey Pasyuk
5
+ * @copyright 2009
6
+ */
7
+
8
+ function flag_playlist_order($playlist){
9
+ global $wpdb;
10
+
11
+ //this is the url without any presort variable
12
+ $base_url = admin_url() . 'admin.php?page=' . $_GET['page'];
13
+ $flag_options = get_option('flag_options');
14
+ $playlistPath = $flag_options['galleryPath'].'playlists/'.$_GET['playlist'].'.xml';
15
+ $playlist = get_playlist_data(ABSPATH.$playlistPath);
16
+ $items_a = $playlist['items'];
17
+ $items = implode(',',$playlist['items']);
18
+ ?>
19
+ <script type="text/javascript" src="<?php echo FLAG_URLPATH; ?>admin/js/jquery.tablednd_0_5.js"></script>
20
+ <script type="text/javascript" src="<?php echo FLAG_URLPATH; ?>admin/js/jquery.tablesorter.js"></script>
21
+ <div class="wrap">
22
+ <h2><?php _e('Sort Gallery', 'flag'); ?></h2>
23
+
24
+ <div class="alignright tablenav" style="margin-bottom: -36px;">
25
+ <a href="<?php echo $base_url.'&amp;playlist='.$_GET['playlist'].'&amp;mode=edit'; ?>" class="button-secondary action"><?php _e('Back to playlist', 'flag'); ?></a>
26
+ </div>
27
+ <form id="sortPlaylist" method="POST" action="<?php echo $base_url.'&amp;playlist='.$_GET['playlist'].'&amp;mode=edit'; ?>" accept-charset="utf-8">
28
+ <div class="alignleft tablenav">
29
+ <?php wp_nonce_field('flag_updatesortorder'); ?>
30
+ <input class="button-primary action" type="submit" name="updatePlaylist" value="<?php _e('Update Sort Order', 'flag'); ?>" />
31
+ </div>
32
+ <br clear="all" />
33
+ <input type="hidden" name="playlist_title" value="<?php echo $playlist['title']; ?>" />
34
+ <input type="hidden" name="skinname" value="<?php echo $playlist['skin']; ?>" />
35
+ <input type="hidden" name="skinaction" value="<?php echo $playlist['skin']; ?>" />
36
+ <textarea style="display: none;" name="playlist_descr" cols="40" rows="1"><?php echo $playlist['description']; ?></textarea>
37
+ <script type="text/javascript">
38
+ /*<![CDATA[*/
39
+ jQuery(document).ready(function($) {
40
+ // Initialise the table
41
+ jQuery("#listitems").tableDnD({
42
+ onDragClass: "myDragClass",
43
+ onDrop: function() {
44
+ jQuery("#listitems tr:even").addClass('alternate');
45
+ jQuery("#listitems tr:odd").removeClass('alternate');
46
+ }
47
+ });
48
+ $("#flag-listitems").tablesorter({
49
+ // pass the headers argument and assing a object
50
+ headers: {
51
+ // assign the secound column (we start counting zero)
52
+ 1: {
53
+ // disable it by setting the property sorter to false
54
+ sorter: false
55
+ }
56
+ }
57
+ });
58
+ $("#flag-listitems").bind("sortEnd",function() {
59
+ jQuery("#listitems tr:even").addClass('alternate');
60
+ jQuery("#listitems tr:odd").removeClass('alternate');
61
+ });
62
+
63
+ });
64
+ /*]]>*/
65
+ </script>
66
+ <table id="flag-listitems" class="widefat fixed" cellspacing="0" >
67
+
68
+ <thead>
69
+ <tr>
70
+ <th class="header" width="54"><p style="margin-right:-10px;"><?php _e('ID', 'flag'); ?></p></th>
71
+ <th width="260"><div><?php _e('Play', 'flag'); ?></div></th>
72
+ <th class="header"><p><?php _e('Filename', 'flag'); ?></p></th>
73
+ <th class="header"><p><?php _e('Title', 'flag'); ?></p></th>
74
+ </tr>
75
+ </thead>
76
+ <tfoot>
77
+ <tr>
78
+ <th><?php _e('ID', 'flag'); ?></th>
79
+ <th><?php _e('Play', 'flag'); ?></th>
80
+ <th><?php _e('Filename', 'flag'); ?></th>
81
+ <th><?php _e('Title', 'flag'); ?></th>
82
+ </tr>
83
+ </tfoot>
84
+ <tbody id="listitems">
85
+ <?php
86
+ if(count($items_a)) {
87
+ $flag_options = get_option('flag_options');
88
+ $counter = 0;
89
+ foreach($items_a as $item) {
90
+ $mp3 = get_post($item);
91
+ $alternate = ( !isset($alternate) || $alternate == 'alternate' ) ? '' : 'alternate';
92
+ $counter++;
93
+ $bg = ( !isset($alternate) || $alternate == 'alternate' ) ? 'f9f9f9' : 'ffffff';
94
+ $url = wp_get_attachment_url($mp3->ID);
95
+ ?>
96
+ <tr id="$mp3-<?php echo $mp3->ID; ?>" class="<?php echo $alternate; ?> iedit" valign="top">
97
+ <td scope="row"><input type="hidden" name="item_a[<?php echo $mp3->ID; ?>][ID]" value="<?php echo $mp3->ID; ?>" /><strong><?php echo $mp3->ID; ?></strong></td>
98
+ <td><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>
99
+ <div class="play"><span id="c-<?php echo $mp3->ID; ?>"></span></div></td>
100
+ <td><?php echo basename($url); ?></td>
101
+ <td><?php echo $mp3->post_title; ?></td>
102
+ </tr>
103
+ <?php
104
+ }
105
+ } else {
106
+ echo '<tr><td colspan="4" align="center"><strong>'.__('No entries found','flag').'</strong></td></tr>';
107
+ }
108
+ ?>
109
+ </tbody>
110
+ </table>
111
+ <p class="actions"><input type="submit" class="button-primary action" name="updatePlaylist" value="<?php _e('Update Sort Order', 'flag'); ?>" /></p>
112
+ </form>
113
+ <br class="clear"/>
114
+ </div><!-- /#wrap -->
115
+
116
+ <?php
117
+ }
118
+ ?>
admin/playlist.functions.php ADDED
@@ -0,0 +1,149 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You are not allowed to call this page directly.'); }
3
+
4
+ function get_playlist_data( $playlist_file ) {
5
+ global $wpdb;
6
+ $playlist_content = file_get_contents($playlist_file);
7
+
8
+ $playlist_data['title'] = flagGallery::flagGetBetween($playlist_content,'<title><![CDATA[',']]></title>');
9
+ $playlist_data['skin'] = flagGallery::flagGetBetween($playlist_content,'<skin><![CDATA[',']]></skin>');
10
+ $playlist_data['width'] = flagGallery::flagGetBetween($playlist_content,'<width><![CDATA[',']]></width>');
11
+ $playlist_data['height'] = flagGallery::flagGetBetween($playlist_content,'<height><![CDATA[',']]></height>');
12
+ $playlist_data['description'] = flagGallery::flagGetBetween($playlist_content,'<description><![CDATA[',']]></description>');
13
+ preg_match_all( '|<item id="(.*)">|', $playlist_content, $items );
14
+ $playlist_data['items'] = $items[1];
15
+ return $playlist_data;
16
+ }
17
+
18
+ /**
19
+ * Check the playlists directory and retrieve all playlist files with playlist data.
20
+ *
21
+ */
22
+ function get_playlists($playlist_folder = '') {
23
+
24
+ $flag_options = get_option('flag_options');
25
+ $flag_playlists = array ();
26
+ $playlist_root = ABSPATH.$flag_options['galleryPath'].'playlists';
27
+ if( !empty($playlist_folder) )
28
+ $playlist_root = $playlist_folder;
29
+
30
+ // Files in flagallery/playlists directory
31
+ $playlists_dir = @ opendir( $playlist_root);
32
+ $playlist_files = array();
33
+ if ( $playlists_dir ) {
34
+ while (($file = readdir( $playlists_dir ) ) !== false ) {
35
+ if ( substr($file, 0, 1) == '.' )
36
+ continue;
37
+ if ( substr($file, -4) == '.xml' )
38
+ $playlist_files[] = $file;
39
+ }
40
+ }
41
+ @closedir( $playlists_dir );
42
+
43
+ if ( !$playlists_dir || empty($playlist_files) )
44
+ return $flag_playlists;
45
+
46
+ foreach ( $playlist_files as $playlist_file ) {
47
+ if ( !is_readable( "$playlist_root/$playlist_file" ) )
48
+ continue;
49
+
50
+ $playlist_data = get_playlist_data( "$playlist_root/$playlist_file" );
51
+
52
+ if ( empty ( $playlist_data['title'] ) )
53
+ continue;
54
+
55
+ $flag_playlists[basename( $playlist_file, ".xml" )] = $playlist_data;
56
+ }
57
+ uasort( $flag_playlists, create_function( '$a, $b', 'return strnatcasecmp( $a["title"], $b["title"] );' ));
58
+
59
+ return $flag_playlists;
60
+ }
61
+
62
+ function flagSavePlaylist($title,$descr,$data,$file='',$skinaction='') {
63
+ global $wpdb;
64
+ if(!trim($title)) {
65
+ $title = 'default';
66
+ }
67
+ if (!$file) {
68
+ $file = sanitize_title($title);
69
+ }
70
+ if(!is_array($data))
71
+ $data = explode(',', $data);
72
+
73
+ $flag_options = get_option('flag_options');
74
+ $skin = isset($_POST['skinname'])? $_POST['skinname'] : 'music_default';
75
+ if(!$skinaction) {
76
+ $skinaction = isset($_POST['skinaction'])? $_POST['skinaction'] : 'update';
77
+ }
78
+ $skinpath = trailingslashit( $flag_options['skinsDirABS'] ).$skin;
79
+ $playlistPath = ABSPATH.$flag_options['galleryPath'].'playlists/'.$file.'.xml';
80
+ if( file_exists($playlistPath) && ($skin == $skinaction) ) {
81
+ $settings = file_get_contents($playlistPath);
82
+ } else {
83
+ $settings = file_get_contents($skinpath . "/settings/settings.xml");
84
+ }
85
+ $properties = flagGallery::flagGetBetween($settings,'<properties>','</properties>');
86
+
87
+ if(count($data)) {
88
+ $content = '<gallery>
89
+ <properties>'.$properties.'</properties>
90
+ <category id="'.$file.'">
91
+ <properties>
92
+ <title><![CDATA['.$title.']]></title>
93
+ <description><![CDATA['.$descr.']]></description>
94
+ <skin><![CDATA['.$skin.']]></skin>
95
+ </properties>
96
+ <items>';
97
+
98
+ foreach( (array) $data as $id) {
99
+ $mp3 = get_post($id);
100
+ if($mp3->post_mime_type == 'audio/mpeg') {
101
+ $thumb = get_post_meta($id, 'thumbnail', true);
102
+ $content .= '
103
+ <item id="'.$mp3->ID.'">
104
+ <track>'.wp_get_attachment_url($mp3->ID).'</track>
105
+ <title><![CDATA['.$mp3->post_title.']]></title>
106
+ <description><![CDATA['.$mp3->post_content.']]></description>
107
+ <thumbnail>'.$thumb.'</thumbnail>
108
+ </item>';
109
+ }
110
+ }
111
+ $content .= '
112
+ </items>
113
+ </category>
114
+ </gallery>';
115
+ // Save options
116
+ $flag_options = get_option('flag_options');
117
+ if(wp_mkdir_p(ABSPATH.$flag_options['galleryPath'].'playlists/')) {
118
+ if( flagGallery::saveFile($playlistPath,$content,'w') ){
119
+ flagGallery::show_message(__('Playlist Saved Successfully','flag'));
120
+ }
121
+ } else {
122
+ flagGallery::show_message(__('Create directory please:','flag').'"/'.$flag_options['galleryPath'].'playlists/"');
123
+ }
124
+ }
125
+ }
126
+
127
+ function flagSavePlaylistSkin($file) {
128
+ global $wpdb;
129
+ $flag_options = get_option('flag_options');
130
+ $playlistPath = ABSPATH.$flag_options['galleryPath'].'playlists/'.$file.'.xml';
131
+ // Save options
132
+ $title = $_POST['playlist_title'];
133
+ $descr = $_POST['playlist_descr'];
134
+ $items = get_playlist_data($playlistPath);
135
+ $data = $items['items'];
136
+ flagSavePlaylist($title,$descr,$data,$file,$skinaction='update');
137
+ }
138
+
139
+ function flag_playlist_delete($playlist) {
140
+ $flag_options = get_option('flag_options');
141
+ $playlistXML = ABSPATH.$flag_options['galleryPath'].'playlists/'.$playlist.'.xml';
142
+ if(file_exists($playlistXML)){
143
+ if(unlink($playlistXML)) {
144
+ flagGallery::show_message("'".$playlist.".xml' ".__('deleted','flag'));
145
+ }
146
+ }
147
+ }
148
+
149
+ ?>
admin/settings.php ADDED
@@ -0,0 +1,460 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You are not allowed to call this page directly.'); }
3
+
4
+ function flag_admin_options() {
5
+
6
+ global $wpdb, $flag;
7
+
8
+ // same as $_SERVER['REQUEST_URI'], but should work under IIS 6.0
9
+ $filepath = admin_url() . 'admin.php?page='.$_GET['page'];
10
+
11
+ if ( isset($_POST['updateoption']) ) {
12
+ check_admin_referer('flag_settings');
13
+ // get the hidden option fields, taken from WP core
14
+ if ( $_POST['page_options'] )
15
+ $options = explode(',', stripslashes($_POST['page_options']));
16
+ if ($options) {
17
+ foreach ($options as $option) {
18
+ $option = trim($option);
19
+ $value = trim($_POST[$option]);
20
+ $flag->options[$option] = $value;
21
+ }
22
+ if(isset($_POST['galleryPath'])) {
23
+ // the path should always end with a slash
24
+ $flag->options['galleryPath'] = trailingslashit($flag->options['galleryPath']);
25
+ }
26
+ // the custom sortorder must be ascending
27
+ //$flag->options['galSortDir'] = ($flag->options['galSort'] == 'sortorder') ? 'ASC' : $flag->options['galSortDir'];
28
+ }
29
+ // Save options
30
+ update_option('flag_options', $flag->options);
31
+
32
+ if(!isset($_POST['access_key']))
33
+ flagGallery::show_message(__('Update Successfully','flag'));
34
+ }
35
+ if( isset($_POST['access_key']) ){
36
+ if(function_exists('curl_init')){
37
+ check_admin_referer('flag_settings');
38
+ $ch = curl_init('http://mypgc.co/app/account_st.php');
39
+ curl_setopt ($ch, CURLOPT_POST, 1);
40
+ curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
41
+ curl_setopt ($ch, CURLOPT_POSTFIELDS, array('access_key'=>$_POST['access_key'], 'access_url'=>$_POST['access_url']));
42
+ $access_key_return = curl_exec ($ch);
43
+ curl_close ($ch);
44
+ } else {
45
+ $access_key_return = '<div class="updated"><p>cURL library is not installed on your server.</p></div>';
46
+ }
47
+ echo $access_key_return;
48
+ }
49
+
50
+
51
+ if ( isset($_POST['update_cap']) ) {
52
+
53
+ check_admin_referer('flag_addroles');
54
+
55
+ // now set or remove the capability
56
+ flag_set_capability($_POST['general'],"FlAG overview");
57
+ flag_set_capability($_POST['tinymce'],"FlAG Use TinyMCE");
58
+ flag_set_capability($_POST['add_gallery'],"FlAG Upload images");
59
+ flag_set_capability($_POST['import_gallery'],"FlAG Import folder");
60
+ flag_set_capability($_POST['manage_gallery'],"FlAG Manage gallery");
61
+ flag_set_capability($_POST['manage_others'],"FlAG Manage others gallery");
62
+ flag_set_capability($_POST['change_skin'],"FlAG Change skin");
63
+ flag_set_capability($_POST['add_skins'],"FlAG Add skins");
64
+ flag_set_capability($_POST['delete_skins'],"FlAG Delete skins");
65
+ flag_set_capability($_POST['change_options'],"FlAG Change options");
66
+ flag_set_capability($_POST['manage_music'],"FlAG Manage music");
67
+ flag_set_capability($_POST['manage_video'],"FlAG Manage video");
68
+ flag_set_capability($_POST['manage_banners'],"FlAG Manage banners");
69
+ flag_set_capability($_POST['facebook_page'],"FlAG Facebook page");
70
+
71
+ flagGallery::show_message(__('Updated capabilities',"flag"));
72
+ }
73
+
74
+ // message windows
75
+ if(!empty($messagetext)) { echo '<!-- Last Action --><div id="message" class="updated fade"><p>'.$messagetext.'</p></div>'; }
76
+
77
+ $flag_options = get_option('flag_options');
78
+ ?>
79
+
80
+ <div id="slider" class="wrap">
81
+
82
+ <ul id="tabs" class="tabs">
83
+ <li class="selected"><a href="#" rel="imageoptions"><?php _e('Image Gallery Options', 'flag'); ?></a></li>
84
+ <li><a href="#" rel="rControl"><?php _e('Remote Control', 'flag'); ?></a></li>
85
+ <li><a href="#" rel="vPlayer"><?php _e('FLV Single Player Options', 'flag'); ?></a></li>
86
+ <li><a href="#" rel="mPlayer"><?php _e('MP3 Single Player Options', 'flag'); ?></a></li>
87
+ <?php if (flagGallery::flag_wpmu_enable_function('wpmuRoles')) : ?>
88
+ <li><a href="#" rel="roles"><?php _e('Roles', 'flag'); ?></a></li>
89
+ <?php endif; ?>
90
+ </ul>
91
+
92
+ <!-- Image Gallery Options -->
93
+ <script type="text/javascript">
94
+ jQuery(document).ready(function() {
95
+ jQuery('.flag_colors .colorPick').each( function(){
96
+ var inpID = jQuery(this).attr('name');
97
+ jQuery('#cp_'+inpID).farbtastic('#'+inpID);
98
+ jQuery('#'+inpID).focus( function(){
99
+ jQuery('#cp_'+inpID).show();
100
+ });
101
+ jQuery('#'+inpID).blur( function(){
102
+ jQuery('#cp_'+inpID).hide();
103
+ });
104
+ });
105
+ });
106
+ </script>
107
+ <div id="imageoptions" class="cptab">
108
+ <form name="generaloptions" method="post">
109
+ <?php wp_nonce_field('flag_settings'); ?>
110
+ <input type="hidden" name="page_options" value="galleryPath,flashWidth,flashHeight,deleteImg,deepLinks,useMediaRSS,jAlterGal,jAlterGalScript,BarsBG,CatBGColor,CatBGColorOver,CatColor,CatColorOver,ThumbBG,ThumbLoaderColor,TitleColor,DescrColor,imgResize,imgWidth,imgHeight,imgQuality,galSort,galSortDir" />
111
+ <h2><?php _e('Image Gallery Options','flag'); ?></h2>
112
+ <h3><?php _e('General Options','flag'); ?></h3>
113
+ <table class="form-table flag-options">
114
+ <tr valign="top">
115
+ <th align="left" width="200"><?php _e('Gallery path','flag'); ?></th>
116
+ <td><input <?php if (IS_WPMU) echo 'readonly = "readonly"'; ?> type="text" size="35" name="galleryPath" value="<?php echo $flag_options['galleryPath']; ?>" />
117
+ <span class="setting-description"><?php _e('This is the default path for all galleries','flag'); ?></span></td>
118
+ </tr>
119
+ <tr valign="top">
120
+ <th><?php _e('Default flash size (W x H)','flag'); ?>:</th>
121
+ <td><input type="text" size="4" maxlength="4" name="flashWidth" value="<?php echo $flag_options['flashWidth']; ?>" /> x
122
+ <input type="text" size="4" maxlength="4" name="flashHeight" value="<?php echo $flag_options['flashHeight']; ?>" /></td>
123
+ </tr>
124
+ <tr valign="top">
125
+ <th align="left"><?php _e('Delete image files','flag'); ?></th>
126
+ <td><input <?php if (IS_WPMU) echo 'readonly = "readonly"'; ?> type="checkbox" name="deleteImg" value="1" <?php checked('1', $flag_options['deleteImg']); ?> />
127
+ <?php _e('Delete files, when removing a gallery in the database','flag'); ?></td>
128
+ </tr>
129
+ <tr>
130
+ <th align="left"><?php _e('Activate Deep Linking (optional)','flag'); ?><br /><small><?php _e('Not all skins support this feature.','flag'); ?></small></th>
131
+ <td><input type="checkbox" name="deepLinks" value="1" <?php checked('1', $flag_options['deepLinks']); ?> />
132
+ <span class="setting-description"><?php _e('Deep links for images in flash.','flag'); ?></span></td>
133
+ </tr>
134
+ <tr>
135
+ <th align="left"><?php _e('Activate Media RSS feed','flag'); ?></th>
136
+ <td><input type="checkbox" name="useMediaRSS" value="1" <?php checked('1', $flag_options['useMediaRSS']); ?> />
137
+ <span class="setting-description"><?php _e('A RSS feed will be added to you blog header.','flag'); ?></span></td>
138
+ </tr>
139
+ </table>
140
+
141
+ <h3><?php _e('Flash Alternative Options','flag'); ?></h3>
142
+ <table class="flag_colors form-table flag-options">
143
+ <tr>
144
+ <th align="left"><?php _e('Show jQuery gallery for browsers without flashplayer','flag'); ?></th>
145
+ <td><input type="checkbox" name="jAlterGal" value="1" <?php checked('1', $flag_options['jAlterGal']); ?> /></td>
146
+ </tr>
147
+ <tr>
148
+ <th align="left"><?php _e('jQuery gallery script','flag'); ?></th>
149
+ <td><select name="jAlterGalScript">
150
+ <option value="0" <?php selected('0', $flag_options['jAlterGalScript']); ?>>FancyBox</option>
151
+ <option value="1" <?php selected('1', $flag_options['jAlterGalScript']); ?>>PhotoSwipe</option>
152
+ </select>
153
+ </td>
154
+ </tr>
155
+ <tr>
156
+ <th width="200"><?php _e('Top Bar BG','flag'); ?>:</th>
157
+ <td><input class="colorPick" type="text" size="7" maxlength="6" id="BarsBG" name="BarsBG" value="<?php echo $flag_options['BarsBG']?>" /><div id="cp_BarsBG" style="background:#F9F9F9;position:absolute;display:none;"></div></td>
158
+ </tr>
159
+ <tr>
160
+ <th><?php _e('Category Buttons BG','flag'); ?>:</th>
161
+ <td>
162
+ <input class="colorPick" type="text" size="7" maxlength="6" id="CatBGColorOver" name="CatBGColorOver" value="<?php echo $flag_options['CatBGColorOver']; ?>" /> mouseOver<br />
163
+ <div id="cp_CatBGColorOver" style="background:#F9F9F9;position:absolute;display:none;"></div>
164
+ <input class="colorPick" type="text" size="7" maxlength="6" id="CatBGColor" name="CatBGColor" value="<?php echo $flag_options['CatBGColor']; ?>" /> mouseOut<br />
165
+ <div id="cp_CatBGColor" style="background:#F9F9F9;position:absolute;display:none;"></div>
166
+ </td>
167
+ </tr>
168
+ <tr>
169
+ <th><?php _e('Category Buttons Color','flag'); ?>:</th>
170
+ <td>
171
+ <input class="colorPick" type="text" size="7" maxlength="6" id="CatColorOver" name="CatColorOver" value="<?php echo $flag_options['CatColorOver']; ?>" /> mouseOver<br />
172
+ <div id="cp_CatColorOver" style="background:#F9F9F9;position:absolute;display:none;"></div>
173
+ <input class="colorPick" type="text" size="7" maxlength="6" id="CatColor" name="CatColor" value="<?php echo $flag_options['CatColor']; ?>" /> mouseOut<br />
174
+ <div id="cp_CatColor" style="background:#F9F9F9;position:absolute;display:none;"></div>
175
+ </td>
176
+ </tr>
177
+ <tr>
178
+ <th><?php _e('Thumbnail BG','flag'); ?>:</th>
179
+ <td><input class="colorPick" type="text" size="7" maxlength="6" id="ThumbBG" name="ThumbBG" value="<?php echo $flag_options['ThumbBG']; ?>" /><div id="cp_ThumbBG" style="background:#F9F9F9;position:absolute;display:none;"></div></td>
180
+ </tr>
181
+ <tr>
182
+ <th><?php _e('Thumbnail MouseOver BG','flag'); ?>:</th>
183
+ <td><input class="colorPick" type="text" size="7" maxlength="6" id="ThumbLoaderColor" name="ThumbLoaderColor" value="<?php echo $flag_options['ThumbLoaderColor']; ?>" /><div id="cp_ThumbLoaderColor" style="background:#F9F9F9;position:absolute;display:none;"></div></td>
184
+ </tr>
185
+ <tr>
186
+ <th><?php _e('Fancybox Title','flag'); ?>:<br /><small><?php _e('Only if FancyBox script is selected','flag'); ?></small></th>
187
+ <td><input class="colorPick" type="text" size="7" maxlength="6" id="TitleColor" name="TitleColor" value="<?php echo $flag_options['TitleColor']; ?>" /><div id="cp_TitleColor" style="background:#F9F9F9;position:absolute;display:none;"></div></td>
188
+ </tr>
189
+ <tr>
190
+ <th><?php _e('Fancybox Description Text','flag'); ?>:<br /><small><?php _e('Only if FancyBox script is selected','flag'); ?></small></th>
191
+ <td><input class="colorPick" type="text" size="7" maxlength="6" id="DescrColor" name="DescrColor" value="<?php echo $flag_options['DescrColor']; ?>" /><div id="cp_DescrColor" style="background:#F9F9F9;position:absolute;display:none;"></div></td>
192
+ </tr>
193
+ </table>
194
+
195
+ <h3><?php _e('Image settings','flag'); ?></h3>
196
+ <table class="form-table flag-options">
197
+ <tr valign="top">
198
+ <th scope="row" width="200"><label for="fixratio"><?php _e('Resize Images','flag'); ?></label><br /><small>(Manage Gallery -> 'Resize Images' action)</small></th>
199
+ <td><input type="hidden" name="imgResize" value="1" <?php checked('1', $flag_options['imgResize']); ?> />
200
+ <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']; ?>" />
201
+ <span class="setting-description"><?php _e('Width x Height (in pixel). Flash Album Gallery will keep ratio size','flag'); ?></span></td>
202
+ </tr>
203
+ <tr valign="top">
204
+ <th align="left"><?php _e('Image quality','flag'); ?></th>
205
+ <td><input type="text" size="3" maxlength="3" name="imgQuality" value="<?php echo $flag_options['imgQuality']; ?>" /> %</td>
206
+ </tr>
207
+ </table>
208
+
209
+ <h3><?php _e('Sort options','flag'); ?></h3>
210
+ <table class="form-table flag-options">
211
+ <tr>
212
+ <th valign="top" width="200"><?php _e('Sort thumbnails','flag'); ?>:</th>
213
+ <td>
214
+ <label><input name="galSort" type="radio" value="sortorder" <?php checked('sortorder', $flag_options['galSort']); ?> /> <?php _e('Custom order', 'flag'); ?></label><br />
215
+ <label><input name="galSort" type="radio" value="pid" <?php checked('pid', $flag_options['galSort']); ?> /> <?php _e('Image ID', 'flag'); ?></label><br />
216
+ <label><input name="galSort" type="radio" value="filename" <?php checked('filename', $flag_options['galSort']); ?> /> <?php _e('File name', 'flag'); ?></label><br />
217
+ <label><input name="galSort" type="radio" value="alttext" <?php checked('alttext', $flag_options['galSort']); ?> /> <?php _e('Alt / Title text', 'flag'); ?></label><br />
218
+ <label><input name="galSort" type="radio" value="imagedate" <?php checked('imagedate', $flag_options['galSort']); ?> /> <?php _e('Date / Time', 'flag'); ?></label>
219
+ <label><input name="galSort" type="radio" value="hitcounter" <?php checked('hitcounter', $flag_options['galSort']); ?> /> <?php _e('Image views', 'flag'); ?></label>
220
+ <label><input name="galSort" type="radio" value="total_votes" <?php checked('total_votes', $flag_options['galSort']); ?> /> <?php _e('Image likes', 'flag'); ?></label>
221
+ </td>
222
+ </tr>
223
+ <tr>
224
+ <th valign="top"><?php _e('Sort direction','flag'); ?>:</th>
225
+ <td><label><input name="galSortDir" type="radio" value="ASC" <?php checked('ASC', $flag_options['galSortDir']); ?> /> <?php _e('Ascending', 'flag'); ?></label><br />
226
+ <label><input name="galSortDir" type="radio" value="DESC" <?php checked('DESC', $flag_options['galSortDir']); ?> /> <?php _e('Descending', 'flag'); ?></label>
227
+ </td>
228
+ </tr>
229
+ </table>
230
+ <div class="submit"><input class="button-primary" type="submit" name="updateoption" value="<?php _e('Save Changes', 'flag'); ?>"/></div>
231
+ </form>
232
+ </div>
233
+
234
+ <div id="rControl" class="cptab">
235
+ <form name="rControl" method="post">
236
+ <?php wp_nonce_field('flag_settings'); ?>
237
+ <input type="hidden" name="page_options" value="access_key" />
238
+ <input type="hidden" name="access_url" value="<?php echo plugins_url() . '/' . FLAGFOLDER . '/lib/app.php'; ?>" />
239
+ <h2><?php _e('Remote Control App Settings','flag'); ?></h2>
240
+ <table class="form-table flag-options">
241
+ <tr>
242
+ <th valign="top" width="200"><?php _e('App Access Key','flag'); ?>:</th>
243
+ <td valign="top"><input type="text" size="54" id="access_key" name="access_key" value="<?php echo $flag_options['access_key']?>" /></td>
244
+ </tr>
245
+ </table>
246
+ <h3>Coming soon...</h3>
247
+ <div class="submit"><input class="button-primary" type="submit" name="updateoption" value="<?php _e('Save Changes', 'flag'); ?>"/></div>
248
+ </form>
249
+ </div>
250
+
251
+ <div id="vPlayer" class="cptab">
252
+ <form name="vPlayer" method="post">
253
+ <?php wp_nonce_field('flag_settings'); ?>
254
+ <input type="hidden" name="page_options" value="videoBG,vmColor1,vmColor2,vmAutoplay,vmWidth,vmHeight" />
255
+ <h2><?php _e('Flash Video Player Colors','flag'); ?></h2>
256
+ <table class="flag_colors form-table flag-options">
257
+ <tr>
258
+ <th width="200"><?php _e('Video BG','flag'); ?>:</th>
259
+ <td><input class="colorPick" type="text" size="7" maxlength="6" id="videoBG" name="videoBG" value="<?php echo $flag_options['videoBG']?>" /><div id="cp_videoBG" style="background:#F9F9F9;position:absolute;display:none;"></div></td>
260
+ </tr>
261
+ <tr>
262
+ <th><?php _e('Color 1','flag'); ?>:</th>
263
+ <td><input class="colorPick" type="text" size="7" maxlength="6" id="vmColor1" name="vmColor1" value="<?php echo $flag_options['vmColor1']?>" /><div id="cp_vmColor1" style="background:#F9F9F9;position:absolute;display:none;"></div></td>
264
+ </tr>
265
+ <tr>
266
+ <th><?php _e('Color 2','flag'); ?>:</th>
267
+ <td>
268
+ <input class="colorPick" type="text" size="7" maxlength="6" id="vmColor2" name="vmColor2" value="<?php echo $flag_options['vmColor2']; ?>" /><div id="cp_vmColor2" style="background:#F9F9F9;position:absolute;display:none;"></div></td>
269
+ </tr>
270
+ <tr>
271
+ <th><?php _e('Autoplay','flag'); ?>:</th>
272
+ <td>
273
+ <label><input name="vmAutoplay" type="radio" value="true" <?php checked('true', $flag_options['vmAutoplay']); ?> /> <?php _e('True', 'flag'); ?></label><br />
274
+ <label><input name="vmAutoplay" type="radio" value="false" <?php checked('false', $flag_options['vmAutoplay']); ?> /> <?php _e('False', 'flag'); ?></label><br />
275
+ </td>
276
+ </tr>
277
+ <tr>
278
+ <th><?php _e('Default Size','flag'); ?>:<br /><small>(width x height)</small></th>
279
+ <td>
280
+ <input name="vmWidth" type="text" size="3" maxlength="3" value="<?php echo $flag_options['vmWidth']; ?>" /> x <input name="vmHeight" type="text" size="3" maxlength="3" value="<?php echo $flag_options['vmHeight']; ?>" />
281
+ </td>
282
+ </tr>
283
+ </table>
284
+ <div class="submit"><input class="button-primary" type="submit" name="updateoption" value="<?php _e('Save Changes', 'flag'); ?>"/></div>
285
+ </form>
286
+ </div>
287
+
288
+ <div id="mPlayer" class="cptab">
289
+ <form name="mPlayer" method="post">
290
+ <?php wp_nonce_field('flag_settings'); ?>
291
+ <input type="hidden" name="page_options" value="mpBG,mpColor1,mpColor2,mpAutoplay" />
292
+ <h2><?php _e('MP3 Player Colors','flag'); ?></h2>
293
+ <table class="flag_colors form-table flag-options">
294
+ <tr>
295
+ <th width="200"><?php _e('Player BG','flag'); ?>:</th>
296
+ <td><input class="colorPick" type="text" size="7" maxlength="6" id="mpBG" name="mpBG" value="<?php echo $flag_options['mpBG']?>" /><div id="cp_mpBG" style="background:#F9F9F9;position:absolute;display:none;"></div></td>
297
+ </tr>
298
+ <tr>
299
+ <th><?php _e('Color 1','flag'); ?>:</th>
300
+ <td><input class="colorPick" type="text" size="7" maxlength="6" id="mpColor1" name="mpColor1" value="<?php echo $flag_options['mpColor1']?>" /><div id="cp_mpColor1" style="background:#F9F9F9;position:absolute;display:none;"></div></td>
301
+ </tr>
302
+ <tr>
303
+ <th><?php _e('Color 2','flag'); ?>:</th>
304
+ <td>
305
+ <input class="colorPick" type="text" size="7" maxlength="6" id="mpColor2" name="mpColor2" value="<?php echo $flag_options['mpColor2']; ?>" /><div id="cp_mpColor2" style="background:#F9F9F9;position:absolute;display:none;"></div></td>
306
+ </tr>
307
+ <tr>
308
+ <th><?php _e('Autoplay','flag'); ?>:</th>
309
+ <td>
310
+ <label><input name="mpAutoplay" type="radio" value="true" <?php checked('true', $flag_options['mpAutoplay']); ?> /> <?php _e('True', 'flag'); ?></label><br />
311
+ <label><input name="mpAutoplay" type="radio" value="false" <?php checked('false', $flag_options['mpAutoplay']); ?> /> <?php _e('False', 'flag'); ?></label><br />
312
+ </td>
313
+ </tr>
314
+ </table>
315
+ <div class="submit"><input class="button-primary" type="submit" name="updateoption" value="<?php _e('Save Changes', 'flag'); ?>"/></div>
316
+ </form>
317
+ </div>
318
+
319
+ <?php if (flagGallery::flag_wpmu_enable_function('wpmuRoles')) : ?>
320
+ <div id="roles" class="cptab">
321
+ <form method="POST" name="addroles" id="addroles" accept-charset="utf-8">
322
+ <?php wp_nonce_field('flag_addroles'); ?>
323
+ <h2><?php _e('Roles / capabilities','flag'); ?></h2>
324
+ <p><?php _e('Select the lowest role which should be able to access the follow capabilities. Flash Album Gallery supports the standard roles from WordPress.', 'flag'); ?></p>
325
+ <table class="form-table">
326
+ <tr valign="top">
327
+ <th scope="row" style="white-space: nowrap"><?php _e('Main Flash Album Gallery overview', 'flag'); ?>:</th>
328
+ <td><label for="general"><select style="width: 150px;" name="general" id="general"><?php wp_dropdown_roles( flag_get_role('FlAG overview') ); ?></select></label></td>
329
+ </tr>
330
+ <tr valign="top">
331
+ <th scope="row" style="white-space: nowrap"><?php _e('Use TinyMCE Button / Upload tab', 'flag'); ?>:</th>
332
+ <td><label for="tinymce"><select style="width: 150px;" name="tinymce" id="tinymce"><?php wp_dropdown_roles( flag_get_role('FlAG Use TinyMCE') ); ?></select></label></td>
333
+ </tr>
334
+ <tr valign="top">
335
+ <th scope="row" style="white-space: nowrap"><?php _e('Add gallery / Upload images', 'flag'); ?>:</th>
336
+ <td><label for="add_gallery"><select style="width: 150px;" name="add_gallery" id="add_gallery"><?php wp_dropdown_roles( flag_get_role('FlAG Upload images') ); ?></select></label></td>
337
+ </tr>
338
+ <tr valign="top">
339
+ <th scope="row" style="white-space: nowrap"><?php _e('Import images folder', 'flag'); ?>:</th>
340
+ <td><label for="add_gallery"><select style="width: 150px;" name="import_gallery" id="import_gallery"><?php wp_dropdown_roles( flag_get_role('FlAG Import folder') ); ?></select></label></td>
341
+ </tr>
342
+ <tr valign="top">
343
+ <th scope="row" style="white-space: nowrap"><?php _e('Manage gallery', 'flag'); ?>:</th>
344
+ <td><label for="manage_gallery"><select style="width: 150px;" name="manage_gallery" id="manage_gallery"><?php wp_dropdown_roles( flag_get_role('FlAG Manage gallery') ); ?></select></label></td>
345
+ </tr>
346
+ <tr valign="top">
347
+ <th scope="row" style="white-space: nowrap"><?php _e('Manage others gallery', 'flag'); ?>:</th>
348
+ <td><label for="manage_others"><select style="width: 150px;" name="manage_others" id="manage_others"><?php wp_dropdown_roles( flag_get_role('FlAG Manage others gallery') ); ?></select></label></td>
349
+ </tr>
350
+ <tr valign="top">
351
+ <th scope="row" style="white-space: nowrap"><?php _e('Manage music', 'flag'); ?>:</th>
352
+ <td><label for="manage_music"><select style="width: 150px;" name="manage_music" id="manage_music"><?php wp_dropdown_roles( flag_get_role('FlAG Manage music') ); ?></select></label></td>
353
+ </tr>
354
+ <tr valign="top">
355
+ <th scope="row" style="white-space: nowrap"><?php _e('Manage video', 'flag'); ?>:</th>
356
+ <td><label for="manage_video"><select style="width: 150px;" name="manage_video" id="manage_video"><?php wp_dropdown_roles( flag_get_role('FlAG Manage video') ); ?></select></label></td>
357
+ </tr>
358
+ <tr valign="top">
359
+ <th scope="row" style="white-space: nowrap"><?php _e('Manage banners', 'flag'); ?>:</th>
360
+ <td><label for="manage_banners"><select style="width: 150px;" name="manage_banners" id="manage_banners"><?php wp_dropdown_roles( flag_get_role('FlAG Manage banners') ); ?></select></label></td>
361
+ </tr>
362
+ <tr valign="top">
363
+ <th scope="row" style="white-space: nowrap"><?php _e('Change skin', 'flag'); ?>:</th>
364
+ <td><label for="change_skin"><select style="width: 150px;" name="change_skin" id="change_skin"><?php wp_dropdown_roles( flag_get_role('FlAG Change skin') ); ?></select></label></td>
365
+ </tr>
366
+ <tr valign="top">
367
+ <th scope="row" style="white-space: nowrap"><?php _e('Add skins', 'flag'); ?>:</th>
368
+ <td><label for="add_skins"><select style="width: 150px;" name="add_skins" id="add_skins"><?php wp_dropdown_roles( flag_get_role('FlAG Add skins') ); ?></select></label></td>
369
+ </tr>
370
+ <tr valign="top">
371
+ <th scope="row" style="white-space: nowrap"><?php _e('Delete skins', 'flag'); ?>:</th>
372
+ <td><label for="delete_skins"><select style="width: 150px;" name="delete_skins" id="delete_skins"><?php wp_dropdown_roles( flag_get_role('FlAG Delete skins') ); ?></select></label></td>
373
+ </tr>
374
+ <tr valign="top">
375
+ <th scope="row" style="white-space: nowrap"><?php _e('Change options', 'flag'); ?>:</th>
376
+ <td><label for="change_options"><select style="width: 150px;" name="change_options" id="change_options"><?php wp_dropdown_roles( flag_get_role('FlAG Change options') ); ?></select></label></td>
377
+ </tr>
378
+ <tr valign="top">
379
+ <th scope="row" style="white-space: nowrap"><?php _e('Facebook page', 'flag'); ?>:</th>
380
+ <td><label for="facebook_page"><select style="width: 150px;" name="facebook_page" id="change_options"><?php wp_dropdown_roles( flag_get_role('FlAG Facebook page') ); ?></select></label></td>
381
+ </tr>
382
+ </table>
383
+ <div class="submit"><input type="submit" class="button-primary" name= "update_cap" value="<?php _e('Update capabilities', 'flag'); ?>"/></div>
384
+ </form>
385
+ </div>
386
+ <?php endif; ?>
387
+ </div>
388
+ <script type="text/javascript">
389
+ var cptabs=new ddtabcontent("tabs");
390
+ cptabs.setpersist(true);
391
+ cptabs.setselectedClassTarget("linkparent");
392
+ cptabs.init();
393
+ </script>
394
+
395
+ <?php
396
+ }
397
+
398
+ function flag_get_sorted_roles() {
399
+ // This function returns all roles, sorted by user level (lowest to highest)
400
+ global $wp_roles;
401
+ $roles = $wp_roles->role_objects;
402
+ $sorted = array();
403
+
404
+ if( class_exists('RoleManager') ) {
405
+ foreach( $roles as $role_key => $role_name ) {
406
+ $role = get_role($role_key);
407
+ if( empty($role) ) continue;
408
+ $role_user_level = array_reduce(array_keys($role->capabilities), array('WP_User', 'level_reduction'), 0);
409
+ $sorted[$role_user_level] = $role;
410
+ }
411
+ $sorted = array_values($sorted);
412
+ } else {
413
+ $role_order = array("subscriber", "contributor", "author", "editor", "administrator");
414
+ foreach($role_order as $role_key) {
415
+ $sorted[$role_key] = get_role($role_key);
416
+ }
417
+ }
418
+ return $sorted;
419
+ }
420
+
421
+ function flag_get_role($capability){
422
+ // This function return the lowest roles which has the capabilities
423
+ $check_order = flag_get_sorted_roles();
424
+
425
+ $args = array_slice(func_get_args(), 1);
426
+ $args = array_merge(array($capability), $args);
427
+
428
+ foreach ($check_order as $check_role) {
429
+ if ( empty($check_role) )
430
+ return false;
431
+
432
+ if (call_user_func_array(array(&$check_role, 'has_cap'), $args))
433
+ return $check_role->name;
434
+ }
435
+ return false;
436
+ }
437
+
438
+ function flag_set_capability($lowest_role, $capability){
439
+ // This function set or remove the $capability
440
+ $check_order = flag_get_sorted_roles();
441
+
442
+ $add_capability = false;
443
+
444
+ foreach ($check_order as $the_role) {
445
+ $role = $the_role->name;
446
+
447
+ if ( $lowest_role == $role )
448
+ $add_capability = true;
449
+
450
+ // If you rename the roles, the please use the role manager plugin
451
+
452
+ if ( empty($the_role) )
453
+ continue;
454
+
455
+ $add_capability ? $the_role->add_cap($capability) : $the_role->remove_cap($capability) ;
456
+ }
457
+
458
+ }
459
+
460
+ ?>
admin/showmeta.php ADDED
@@ -0,0 +1,123 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // look up for the path
4
+ require_once( dirname( dirname(__FILE__) ) . '/flag-config.php');
5
+
6
+ require_once(FLAG_ABSPATH . '/lib/meta.php');
7
+ require_once(FLAG_ABSPATH . '/lib/image.php');
8
+
9
+ if ( !is_user_logged_in() )
10
+ die(__('Cheatin&#8217; uh?'));
11
+
12
+ if ( !current_user_can('FlAG Manage gallery') )
13
+ die(__('Cheatin&#8217; uh?'));
14
+
15
+ global $wpdb;
16
+
17
+ $id = (int) $_GET['id'];
18
+ // let's get the meta data'
19
+ $meta = new flagMeta($id);
20
+ $dbdata = $meta->get_saved_meta();
21
+ $exifdata = $meta->get_EXIF();
22
+ $iptcdata = $meta->get_IPTC();
23
+ $xmpdata = $meta->get_XMP();
24
+
25
+ ?>
26
+ <!-- META DATA -->
27
+ <fieldset class="options flag">
28
+ <h3><?php _e('Meta Data','flag'); ?></h3>
29
+ <?php if ($dbdata) { ?>
30
+ <table id="the-list-x" width="100%" cellspacing="3" cellpadding="3">
31
+ <thead>
32
+ <tr>
33
+ <th scope="col"><?php _e('Tag','flag'); ?></th>
34
+ <th scope="col"><?php _e('Value','flag'); ?></th>
35
+ </tr>
36
+ </thead>
37
+ <?php
38
+ foreach ($dbdata as $key => $value){
39
+ if ( is_array($value) ) continue;
40
+ $class = ( $class == 'class="alternate"' ) ? '' : 'class="alternate"';
41
+ echo '<tr '.$class.'>
42
+ <td style="width:230px">'.$meta->i8n_name($key).'</td>
43
+ <td>'.$value.'</td>
44
+ </tr>';
45
+ }
46
+ ?>
47
+ </table>
48
+ <?php } else echo "<strong>" . __('No meta data saved','flag') . "</strong>"; ?>
49
+ </fieldset>
50
+
51
+ <!-- EXIF DATA -->
52
+ <?php if ($exifdata) { ?>
53
+ <fieldset class="options flag">
54
+ <h3><?php _e('EXIF Data','flag'); ?></h3>
55
+ <?php if ($exifdata) { ?>
56
+ <table id="the-list-x" width="100%" cellspacing="3" cellpadding="3">
57
+ <thead>
58
+ <tr>
59
+ <th scope="col"><?php _e('Tag','flag'); ?></th>
60
+ <th scope="col"><?php _e('Value','flag'); ?></th>
61
+ </tr>
62
+ </thead>
63
+ <?php
64
+ foreach ($exifdata as $key => $value){
65
+ $class = ( $class == 'class="alternate"' ) ? '' : 'class="alternate"';
66
+ echo '<tr '.$class.'>
67
+ <td style="width:230px">'.$meta->i8n_name($key).'</td>
68
+ <td>'.$value.'</td>
69
+ </tr>';
70
+ }
71
+ ?>
72
+ </table>
73
+ <?php } else echo "<strong>". __('No exif data','flag'). "</strong>"; ?>
74
+ </fieldset>
75
+ <?php } ?>
76
+
77
+ <!-- IPTC DATA -->
78
+ <?php if ($iptcdata) { ?>
79
+ <fieldset class="options flag">
80
+ <h3><?php _e('IPTC Data','flag'); ?></h3>
81
+ <table id="the-list-x" width="100%" cellspacing="3" cellpadding="3">
82
+ <thead>
83
+ <tr>
84
+ <th scope="col"><?php _e('Tag','flag'); ?></th>
85
+ <th scope="col"><?php _e('Value','flag'); ?></th>
86
+ </tr>
87
+ </thead>
88
+ <?php
89
+ foreach ($iptcdata as $key => $value){
90
+ $class = ( $class == 'class="alternate"' ) ? '' : 'class="alternate"';
91
+ echo '<tr '.$class.'>
92
+ <td style="width:230px">'.$meta->i8n_name($key).'</td>
93
+ <td>'.$value.'</td>
94
+ </tr>';
95
+ }
96
+ ?>
97
+ </table>
98
+ </fieldset>
99
+ <?php } ?>
100
+
101
+ <!-- XMP DATA -->
102
+ <?php if ($xmpdata) { ?>
103
+ <fieldset class="options flag">
104
+ <h3><?php _e('XMP Data','flag'); ?></h3>
105
+ <table id="the-list-x" width="100%" cellspacing="3" cellpadding="3">
106
+ <thead>
107
+ <tr>
108
+ <th scope="col"><?php _e('Tag','flag'); ?></th>
109
+ <th scope="col"><?php _e('Value','flag'); ?></th>
110
+ </tr>
111
+ </thead>
112
+ <?php
113
+ foreach ($xmpdata as $key => $value){
114
+ $class = ( $class == 'class="alternate"' ) ? '' : 'class="alternate"';
115
+ echo '<tr '.$class.'>
116
+ <td style="width:230px">'.$meta->i8n_name($key).'</td>
117
+ <td>'.$value.'</td>
118
+ </tr>';
119
+ }
120
+ ?>
121
+ </table>
122
+ </fieldset>
123
+ <?php } ?>
admin/skin_install.php ADDED
@@ -0,0 +1,143 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Install a skin from a local file.
4
+ *
5
+ */
6
+ function do_skin_install_local_package($package, $filename = '') {
7
+ global $wp_filesystem;
8
+
9
+ if ( empty($package) ) {
10
+ show_message( __('No skin Specified', 'flag') );
11
+ return false;
12
+ }
13
+
14
+ if ( empty($filename) )
15
+ $filename = basename($package);
16
+
17
+ $url = 'admin.php?page=flag-skins&action=upload&tabs=1';
18
+ $url = add_query_arg(array('package' => $filename), $url);
19
+
20
+ $url = wp_nonce_url($url, 'skin-upload');
21
+ if ( false === ($credentials = request_filesystem_credentials($url)) )
22
+ return false;
23
+
24
+ if ( ! WP_Filesystem($credentials) ) {
25
+ request_filesystem_credentials($url, '', true); //Failed to connect, Error and request again
26
+ return false;
27
+ }
28
+
29
+ if ( $wp_filesystem->errors->get_error_code() ) {
30
+ foreach ( $wp_filesystem->errors->get_error_messages() as $message )
31
+ show_message($message);
32
+ return false;
33
+ }
34
+
35
+ $result = wp_install_skin_local_package( $package, 'show_message' );
36
+
37
+ if ( is_wp_error($result) ) {
38
+ show_message($result);
39
+ show_message( __('Installation Failed', 'flag') );
40
+ return false;
41
+ } else {
42
+ show_message( __('The skin installed successfully.', 'flag') );
43
+ $skin_file = basename($result);
44
+ $install_actions = apply_filters('install_skin_complete_actions', array(
45
+ 'activate_skin' => '<a href="'.admin_url('admin.php?page=flag-skins&skin='.$skin_file).'" title="' . __('Activate this skin', 'flag') . '" target="_parent">' . __('Activate Skin', 'flag') . '</a>',
46
+ 'skins_page' => '<a href="#'.$skin_file.'" title="' . __('Goto skin overview', 'flag') . '" target="_parent">' . __('Skin overview', 'flag') . '</a>'
47
+ ), array(), $skin_file);
48
+ if ( ! empty($install_actions) ) {
49
+ //show_message('<strong>' . __('Actions:', 'flag') . '</strong> ' . implode(' | ', (array)$install_actions));
50
+ }
51
+ return $result;
52
+ }
53
+ }
54
+
55
+ /**
56
+ * Install skin from local package
57
+ *
58
+ */
59
+ function wp_install_skin_local_package($package, $feedback = '') {
60
+ global $wp_filesystem;
61
+
62
+ if ( !empty($feedback) )
63
+ add_filter('install_feedback', $feedback);
64
+
65
+ // Is a filesystem accessor setup?
66
+ if ( ! $wp_filesystem || ! is_object($wp_filesystem) )
67
+ WP_Filesystem();
68
+
69
+ if ( ! is_object($wp_filesystem) )
70
+ return new WP_Error('fs_unavailable', __('Could not access filesystem.', 'flag'));
71
+
72
+ if ( $wp_filesystem->errors->get_error_code() )
73
+ return new WP_Error('fs_error', __('Filesystem error', 'flag'), $wp_filesystem->errors);
74
+
75
+ //Get the base skin folder
76
+ $flag_options = get_option('flag_options');
77
+ $skins_dir = $flag_options['skinsDirABS'];
78
+ if ( empty($skins_dir) )
79
+ return new WP_Error('fs_no_skins_dir', __('Unable to locate FlAGallery Skin directory.', 'flag'));
80
+
81
+ //And the same for the Content directory.
82
+ $content_dir = $wp_filesystem->wp_content_dir();
83
+ if( empty($content_dir) )
84
+ return new WP_Error('fs_no_content_dir', __('Unable to locate WordPress Content directory (wp-content).', 'flag'));
85
+
86
+ $skins_dir = trailingslashit( $skins_dir );
87
+ $content_dir = trailingslashit( $content_dir );
88
+
89
+ if ( empty($package) )
90
+ return new WP_Error('no_package', __('Install package not available.', 'flag'));
91
+
92
+ $working_dir = $content_dir . 'upgrade/' . basename($package, '.zip');
93
+
94
+ // Clean up working directory
95
+ if ( $wp_filesystem->is_dir($working_dir) )
96
+ $wp_filesystem->delete($working_dir, true);
97
+
98
+ apply_filters('install_feedback', __('Unpacking the skin package', 'flag'));
99
+ // Unzip package to working directory
100
+ $result = unzip_file($package, $working_dir);
101
+
102
+ // Once extracted, delete the package
103
+ unlink($package);
104
+
105
+ if ( is_wp_error($result) ) {
106
+ $wp_filesystem->delete($working_dir, true);
107
+ return $result;
108
+ }
109
+
110
+ //Get a list of the directories in the working directory before we delete it, We need to know the new folder for the skin
111
+ $filelist = array_keys( $wp_filesystem->dirlist($working_dir) );
112
+
113
+ if( $wp_filesystem->exists( $skins_dir . $filelist[0] ) ) {
114
+ $wp_filesystem->delete($working_dir, true);
115
+ return new WP_Error('install_folder_exists', __('Folder already exists.', 'flag'), $filelist[0] );
116
+ }
117
+
118
+ apply_filters('install_feedback', __('Installing the skin', 'flag'));
119
+ // Copy new version of skin into place.
120
+ $result = copy_dir($working_dir, $skins_dir);
121
+ if ( is_wp_error($result) ) {
122
+ $wp_filesystem->delete($working_dir, true);
123
+ return $result;
124
+ }
125
+
126
+ //Get a list of the directories in the working directory before we delete it, We need to know the new folder for the skin
127
+ $filelist = array_keys( $wp_filesystem->dirlist($working_dir) );
128
+
129
+ // Remove working directory
130
+ $wp_filesystem->delete($working_dir, true);
131
+
132
+ if( empty($filelist) )
133
+ return false; //We couldnt find any files in the working dir, therefor no skin installed? Failsafe backup.
134
+
135
+ $folder = $filelist[0];
136
+ //$skin = get_skins('/' . $folder); //Ensure to pass with leading slash
137
+ //$skinfiles = array_keys($skin); //Assume the requested skin is the first in the list
138
+
139
+ //Return the skin files name.
140
+ return $skins_dir.$folder . '/';
141
+ }
142
+
143
+ ?>
admin/skin_options.php ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ require_once( dirname(dirname(__FILE__)) . '/flag-config.php');
3
+
4
+ // check for correct capability
5
+ if ( !is_user_logged_in() )
6
+ die('-1');
7
+
8
+ // check for correct FlAG capability
9
+ if ( !current_user_can('FlAG Change skin') )
10
+ die('-1');
11
+
12
+ $flag_options = get_option('flag_options');
13
+ $act_skin = isset($_GET['skin'])? $_GET['skin'] : $flag_options['flashSkin'];
14
+ $settings = $flag_options['skinsDirABS'].$act_skin.'/settings';
15
+ $settingsXML = $settings.'/settings.xml';
16
+
17
+ $flashPost = file_get_contents("php://input");
18
+ // parse properties_skin
19
+ parse_str($flashPost);
20
+
21
+ if(isset($properties_skin) && !empty($properties_skin)) {
22
+ $fp = fopen($settingsXML, "r");
23
+ if(!$fp) {
24
+ exit( "2");//Failure - not read;
25
+ }
26
+ while(!feof($fp)) {
27
+ $mainXML .= fgetc($fp);
28
+ }
29
+ $fp = fopen($settingsXML, "w");
30
+ if(!$fp)
31
+ exit("0");//Failure
32
+ $properties_skin = str_replace( array( '=','?','"','$' ), '', $properties_skin );
33
+ $newProperties = preg_replace("|<properties>.*?</properties>|si", $properties_skin, $mainXML);
34
+ fwrite($fp, $newProperties);
35
+ fclose($fp);
36
+ echo "1";//Save
37
+ }
38
+
39
+ if(isset($_GET['show_options'])) {
40
+ flag_skin_options();
41
+ }
42
+
43
+ function flag_skin_options() {
44
+ $flag_options = get_option('flag_options');
45
+ $act_skin = isset($_GET['skin'])? $_GET['skin'] : $flag_options['flashSkin'];
46
+ $settings = $flag_options['skinsDirURL'].$act_skin.'/settings';
47
+ $settingsXML = $flag_options['skinsDirABS'].$act_skin.'/settings/settings.xml';
48
+ $fp = fopen($settingsXML, "r");
49
+ if(!$fp) {
50
+ echo '<p style="color:#ff0000;"><b>Error! The configuration file not be found. You need to reinstall this skin.</b></p>';
51
+ } else {
52
+ $cPanel = FLAG_URLPATH."lib/cpanel.swf";
53
+ $constructor = FLAG_URLPATH."lib/";
54
+ $swfObject = FLAG_URLPATH."admin/js/swfobject.js?ver=2.2";
55
+ ?>
56
+ <div id="skinOptions">
57
+ <script type="text/javascript" src="<?php echo $swfObject ?>"></script>
58
+ <script type="text/javascript">
59
+ var flashvars = {
60
+ path : "<?php echo $settings; ?>",
61
+ constructor : "<?php echo $constructor; ?>",
62
+ skin : "<?php echo $act_skin; ?>",
63
+ };
64
+ var params = {
65
+ wmode : "transparent",
66
+ scale : "noScale",
67
+ saling : "lt",
68
+ allowfullscreen : "false",
69
+ menu : "false"
70
+ };
71
+ var attributes = {};
72
+ swfobject.embedSWF("<?php echo $cPanel; ?>", "myContent", "600", "550", "9.0.0", "<?php echo FLAG_URLPATH; ?>skins/expressInstall.swf", flashvars, params, attributes);
73
+ </script>
74
+ <div id="myContent"><a href="http://www.adobe.com/go/getflash"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a>
75
+ <p>This page requires Flash Player version 10.1.52 or higher.</p>
76
+ </div>
77
+ </div>
78
+ <?php
79
+ }
80
+ fclose($fp);
81
+ }
82
+
83
+ ?>
admin/skins.php ADDED
@@ -0,0 +1,484 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You are not allowed to call this page directly.'); }
3
+ // look up for the path
4
+ require_once( dirname(dirname(__FILE__)) . '/flag-config.php');
5
+
6
+ // check for correct capability
7
+ if ( !is_user_logged_in() )
8
+ die('-1');
9
+
10
+ // check for correct FlAG capability
11
+ if ( !current_user_can('FlAG Change skin') )
12
+ die('-1');
13
+
14
+ $flag_options = get_option('flag_options');
15
+
16
+ require_once (dirname (__FILE__) . '/get_skin.php');
17
+
18
+ if( isset($_POST['installskin']) ) {
19
+ require_once (dirname (__FILE__) . '/skin_install.php');
20
+ }
21
+ if( isset($_POST['skinzipurl']) ) {
22
+ $url = $_POST['skinzipurl'];
23
+ $mzip = download_url($url);
24
+ $mzip = str_replace("\\", "/", $mzip);
25
+
26
+ $skins_dir = $flag_options['skinsDirABS'];
27
+
28
+ if( class_exists('ZipArchive') ){
29
+ $zip = new ZipArchive;
30
+ $zip->open($mzip);
31
+ $zip->extractTo($skins_dir);
32
+ $zip->close();
33
+ }else{
34
+ require_once(ABSPATH . 'wp-admin/includes/class-pclzip.php');
35
+ $archive = new PclZip($mzip);
36
+ $list = $archive->extract($skins_dir);
37
+ if ($list == 0) {
38
+ die("ERROR : '".$archive->errorInfo(true)."'");
39
+ }
40
+
41
+ }
42
+ if(unlink($mzip)){
43
+ flagGallery::show_message( __('The skin installed successfully.', 'flag') );
44
+ }
45
+ }
46
+ add_action('install_skins_upload', 'upload_skin');
47
+ function upload_skin() {
48
+
49
+ echo '<div id="uploadaction">';
50
+ echo '<h3>'.__('Install info', 'flag').'</h3>';
51
+
52
+ if ( ! ( ( $uploads = wp_upload_dir() ) && false === $uploads['error'] ) ) {
53
+ echo "<p>".$uploads['error']."</p>\n";
54
+ } else {
55
+ if ( !empty($_FILES) ) {
56
+ $filename = $_FILES['skinzip']['name'];
57
+ } else if ( isset($_GET['package']) ) {
58
+ $filename = $_GET['package'];
59
+ }
60
+ if ( !$filename ) {
61
+ echo "<p>".__('No skin Specified', 'flag')."</p>\n";
62
+ } else {
63
+ check_admin_referer('skin-upload');
64
+ echo '<h4>', sprintf( __('Installing Skin from file: %s', 'flag'), basename($filename) ), '</h4>';
65
+
66
+ //Handle a newly uploaded file, Else assume it was
67
+ if ( !empty($_FILES) ) {
68
+ $filename = wp_unique_filename( $uploads['basedir'], $filename );
69
+ $local_file = $uploads['basedir'] . '/' . $filename;
70
+
71
+ // Move the file to the uploads dir
72
+ if ( false === @move_uploaded_file( $_FILES['skinzip']['tmp_name'], $local_file) )
73
+ echo "<p>".sprintf( __('The uploaded file could not be moved to %s.', 'flag'), $uploads['path'])."</p>\n";
74
+ } else {
75
+ $local_file = $uploads['basedir'] . '/' . $filename;
76
+ }
77
+ if( $installed_skin = do_skin_install_local_package($local_file, $filename) ) {
78
+ if ( file_exists($installed_skin.basename($installed_skin).'.png') ) {
79
+ @rename($installed_skin.basename($installed_skin).'.png', $installed_skin.'screenshot.png');
80
+ }
81
+ if( !file_exists( $installed_skin.'settings.php' ) ) {
82
+ if( file_exists( $installed_skin.'xml.php' ) ) {
83
+ if ( !@copy(dirname($installed_skin).'/default/old_colors.php', $installed_skin.'colors.php') ) {
84
+ echo "<p>".sprintf(__('Failed to copy and rename %1$s to %2$s','flag'),
85
+ dirname($installed_skin).'/default/old_colors.php', $installed_skin.'colors.php').'</p>';
86
+ }
87
+ $content = file_get_contents($installed_skin.'xml.php');
88
+ $pos = strpos($content,'/../../flash-album-gallery/flag-config.php');
89
+ if($pos === false) {
90
+ $content = str_replace('/../../flag-config.php','/../../flash-album-gallery/flag-config.php',$content);
91
+ $fp = fopen($installed_skin.'xml.php','w');
92
+ if( fwrite($fp,$content) === FALSE ) {
93
+ echo "<p>".sprintf(__("Failed to search string '/../../flag-config.php' and replace with '/../../flash-album-gallery/flag-config.php' in file '%1$s'",'flag'),
94
+ $installed_skin.'xml.php').'</p>';
95
+ }
96
+ fclose($fp);
97
+ }
98
+ }
99
+ }
100
+ }
101
+ }
102
+ }
103
+ echo '</div>';
104
+ }
105
+
106
+ /**
107
+ * Get skin options
108
+ *
109
+ */
110
+ function flag_skin_options_tab() {
111
+ //Get the active skin
112
+ $flag_options = get_option('flag_options');
113
+ $active_skin_settings = $flag_options['skinsDirABS'].$flag_options['flashSkin'].'/settings/settings.xml';
114
+ if(!file_exists($active_skin_settings)) {
115
+ $active_skin = $flag_options['skinsDirABS'].$flag_options['flashSkin'].'/'.$flag_options['flashSkin'].'.php';
116
+ include_once($active_skin);
117
+ } else {
118
+ include_once(dirname(__FILE__).'/skin_options.php');
119
+ }
120
+ if(function_exists('flag_skin_options')) {
121
+ flag_skin_options();
122
+ } else {
123
+ include_once(FLAG_ABSPATH.'admin/db_skin_color_scheme.php');
124
+ flag_skin_options();
125
+ }
126
+ }
127
+
128
+
129
+ if ( isset($_POST['updateskinoption']) ) {
130
+ check_admin_referer('skin_settings');
131
+ // get the hidden option fields, taken from WP core
132
+ if ( $_POST['skin_options'] )
133
+ $options = explode(',', stripslashes($_POST['skin_options']));
134
+ elseif ( $_POST['skinoptions'] )
135
+ $options = explode(',', stripslashes($_POST['skinoptions']));
136
+ if ($options) {
137
+ $settings_content = '<?php '."\n";
138
+ foreach ($options as $option) {
139
+ $option = trim($option);
140
+ $value = trim($_POST[$option]);
141
+ $flag->options[$option] = $value;
142
+ $settings_content .= '$'.$option.' = \''.str_replace('#','',$value)."';\n";
143
+ }
144
+ $settings_content .= '?>'."\n";
145
+ // the path should always end with a slash
146
+ $flag->options['galleryPath'] = trailingslashit($flag->options['galleryPath']);
147
+ }
148
+ // Save options
149
+ update_option('flag_options', $flag->options);
150
+ if( flagGallery::saveFile($flag_options['skinsDirABS'].$flag_options['flashSkin'].'_settings.php',$settings_content,'w') ){
151
+ flagGallery::show_message(__('Update Successfully','flag'));
152
+ }
153
+ }
154
+
155
+ if ( isset($_POST['license_key']) ) {
156
+ check_admin_referer('skin-api');
157
+ $license_key = mysql_real_escape_string($_POST['license_key']);
158
+ $flag_options['license_key'] = $license_key;
159
+ update_option('flag_options', $flag_options);
160
+ flagGallery::show_message(__('License Key Updated','flag'));
161
+ }
162
+
163
+ if(!empty($flag_options['license_key'])){
164
+ if(function_exists('curl_init')){
165
+ $ch = curl_init('http://mypgc.co/app/account_st.php');
166
+ curl_setopt ($ch, CURLOPT_POST, 1);
167
+ curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
168
+ curl_setopt ($ch, CURLOPT_POSTFIELDS, array('check_status'=>$flag_options['license_key']));
169
+ $status = curl_exec ($ch);
170
+ curl_close ($ch);
171
+ if($status === '0'){
172
+ $flag_options['license_key'] = '';
173
+ update_option('flag_options', $flag_options);
174
+ flagGallery::show_message(__('Your license key was deactivated','flag'));
175
+ } elseif($status === ''){
176
+ $flag_options['license_key'] = '';
177
+ update_option('flag_options', $flag_options);
178
+ flagGallery::show_message(__('Bad Licence Key','flag'));
179
+ }
180
+ } else {
181
+ flagGallery::show_message(__('cURL library is not installed on your server.','flag'));
182
+ }
183
+ }
184
+
185
+ if ( isset($_POST['updateoption']) ) {
186
+ check_admin_referer('flag_settings');
187
+ // get the hidden option fields, taken from WP core
188
+ if ( $_POST['page_options'] )
189
+ $options = explode(',', stripslashes($_POST['page_options']));
190
+ if ($options) {
191
+ foreach ($options as $option) {
192
+ $option = trim($option);
193
+ $value = trim($_POST[$option]);
194
+ $flag->options[$option] = $value;
195
+ }
196
+ // the path should always end with a slash
197
+ $flag->options['galleryPath'] = trailingslashit($flag->options['galleryPath']);
198
+ }
199
+ // Save options
200
+ update_option('flag_options', $flag->options);
201
+ flagGallery::show_message(__('Update Successfully','flag'));
202
+ }
203
+
204
+
205
+ if ( isset($_GET['delete']) ) {
206
+ $delskin = $_GET['delete'];
207
+ if ( current_user_can('FlAG Delete skins') ) {
208
+ if ( $flag_options['flashSkin'] != $delskin ) {
209
+ $skins_dir = trailingslashit( $flag_options['skinsDirABS'] );
210
+ $skin = $skins_dir.$delskin.'/';
211
+ if(basename($skin) != 'flagallery-skins') {
212
+ if ( is_dir($skin) ) {
213
+ if( flagGallery::flagFolderDelete($skin) ) {
214
+ flagGallery::show_message( __('Skin','flag').' \''.$delskin.'\' '.__('deleted successfully','flag') );
215
+ } else {
216
+ flagGallery::show_message( __('Can\'t find skin directory ','flag').' \''.$delskin.'\' '.__('. Try delete it manualy via ftp','flag') );
217
+ }
218
+ }
219
+ } else {
220
+ flagGallery::show_message( __('Can\'t find skin directory ','flag').' \''.$delskin.'\' '.__('. Try delete it manualy via ftp','flag') );
221
+ }
222
+ } else {
223
+ flagGallery::show_message( __('You need activate another skin before delete it','flag') );
224
+ }
225
+ } else {
226
+ wp_die(__('You do not have sufficient permissions to delete skins of GRAND FlAGallery.'));
227
+ }
228
+ }
229
+
230
+ if( isset($_GET['skin']) ) {
231
+ $set_skin = $_GET['skin'];
232
+ if($flag_options['flashSkin'] != $set_skin) {
233
+ $aValid = array('-', '_');
234
+ if(!ctype_alnum(str_replace($aValid, '', $set_skin))){
235
+ die('try again');
236
+ }
237
+ $active_skin = $flag_options['skinsDirABS'].$set_skin.'/'.$set_skin.'.php';
238
+ if(!file_exists($active_skin)){
239
+ die('try again');
240
+ }
241
+ $flag_options['flashSkin'] = $set_skin;
242
+ include_once($active_skin);
243
+ update_option('flag_options', $flag_options);
244
+ flagGallery::show_message( __('Skin','flag').' \''.$set_skin.'\' '.__('activated successfully','flag') );
245
+ }
246
+ }
247
+ $type = isset($_GET['type'])? $_GET['type'] : '';
248
+ switch($type){
249
+ case '':
250
+ $stype = 'gallery';
251
+ break;
252
+ case 'm':
253
+ $stype = 'music';
254
+ break;
255
+ case 'v':
256
+ $stype = 'video';
257
+ break;
258
+ case 'b':
259
+ $stype = 'banner';
260
+ break;
261
+ case 'w':
262
+ $stype = 'widget';
263
+ break;
264
+ default:
265
+ $stype = 'gallery';
266
+ break;
267
+ }
268
+
269
+ if( isset($_GET['skins_refresh']) ) {
270
+ // upgrade plugin
271
+ require_once(FLAG_ABSPATH . 'admin/tuning.php');
272
+ $ok = flag_tune();
273
+ if($ok)
274
+ flagGallery::show_message( __('Skins refreshed successfully','flag') );
275
+ }
276
+ ?>
277
+ <div id="slider" class="wrap">
278
+ <ul id="tabs" class="tabs">
279
+ <?php if( current_user_can('FlAG Add skins') ) { ?>
280
+ <li class="selected"><a href="#" rel="addskin"><?php _e('Add new skin', 'flag'); ?></a></li>
281
+ <?php } ?>
282
+ <li><a href="#" rel="skinoptions"><?php _e('Active Skin Options', 'flag'); ?></a></li>
283
+ </ul>
284
+
285
+ <?php if( current_user_can('FlAG Add skins') ) { ?>
286
+ <div id="addskin" class="cptab">
287
+ <h2><?php _e('Add new skin', 'flag'); ?></h2>
288
+ <h4><?php _e('Install a skin in .zip format', 'flag'); ?></h4>
289
+ <p><?php _e('If you have a skin in a .zip format, You may install it by uploading it here.', 'flag'); ?></p>
290
+ <form method="post" enctype="multipart/form-data" action="<?php echo admin_url('admin.php?page=flag-skins'); ?>">
291
+ <?php wp_nonce_field( 'skin-upload'); ?>
292
+ <p><input type="file" name="skinzip" />
293
+ <input type="submit" class="button" name="installskin" value="<?php _e('Install Now', 'flag'); ?>" /></p>
294
+ </form>
295
+ <?php if( isset($_POST['installskin']) ) {
296
+ do_action('install_skins_upload');
297
+ } ?>
298
+ </div>
299
+ <?php } ?>
300
+
301
+ <div id="skinoptions" class="cptab">
302
+ <h2><?php _e('Active Skin Options', 'flag'); ?></h2>
303
+ <?php flag_skin_options_tab(); ?>
304
+ </div>
305
+
306
+ <script type="text/javascript">
307
+ /* <![CDATA[ */
308
+ var cptabs=new ddtabcontent("tabs");
309
+ cptabs.setpersist(false);
310
+ cptabs.setselectedClassTarget("linkparent");
311
+ cptabs.init();
312
+ /* ]]> */
313
+ </script>
314
+ </div>
315
+
316
+ <?php if( current_user_can('FlAG Add skins') ) { ?>
317
+ <div id="skinapikey">
318
+ <h2><?php _e('Skin License Key', 'flag'); ?></h2>
319
+ <p><?php _e('If you have license key then paste it here.', 'flag'); ?></p>
320
+ <form method="post" enctype="multipart/form-data" action="<?php echo admin_url('admin.php?page=flag-skins'); ?>">
321
+ <?php wp_nonce_field( 'skin-api'); ?>
322
+ <p><input type="text" name="license_key" value="<?php echo $flag_options['license_key'] ?>" size="55" />
323
+ <input type="submit" class="button" value="<?php _e('Save', 'flag'); ?>" /></p>
324
+ </form>
325
+ </div>
326
+ <?php } ?>
327
+
328
+ <div class="wrap" style="min-width: 878px;">
329
+ <h2><?php _e('Skins', 'flag'); ?>:</h2>
330
+ <!--<p style="float: right;"><a class="button" href="<?php echo admin_url('admin.php?page=flag-skins&amp;skins_refresh=1'); ?>"><?php _e('Refresh / Update Skins', 'flag'); ?></a></p>-->
331
+ <p><a class="button<?php if(!$type) echo '-primary'; ?>" href="<?php echo admin_url('admin.php?page=flag-skins'); ?>"><span style="font-size: 14px;"><?php _e('Photo skins', 'flag'); ?></span></a>&nbsp;&nbsp;&nbsp;
332
+ <a class="button<?php if($type == 'm') echo '-primary'; ?>" href="<?php echo admin_url('admin.php?page=flag-skins&amp;type=m'); ?>"><span style="font-size: 14px;"><?php _e('Music skins', 'flag'); ?></span></a>&nbsp;&nbsp;&nbsp;
333
+ <a class="button<?php if($type == 'v') echo '-primary'; ?>" href="<?php echo admin_url('admin.php?page=flag-skins&amp;type=v'); ?>"><span style="font-size: 14px;"><?php _e('Video skins', 'flag'); ?></span></a>&nbsp;&nbsp;&nbsp;
334
+ <a class="button<?php if($type == 'b') echo '-primary'; ?>" href="<?php echo admin_url('admin.php?page=flag-skins&amp;type=b'); ?>"><span style="font-size: 14px;"><?php _e('Banner skins', 'flag'); ?></span></a>&nbsp;&nbsp;&nbsp;
335
+ <a class="button<?php if($type == 'w') echo '-primary'; ?>" href="<?php echo admin_url('admin.php?page=flag-skins&amp;type=w'); ?>"><span style="font-size: 14px;"><?php _e('Widget skins', 'flag'); ?></span></a>
336
+ </p>
337
+
338
+ <?php
339
+ $all_skins = get_skins(false,$type);
340
+ $total_all_skins = count($all_skins);
341
+
342
+ // not installed skins
343
+ $skins_xml = @simplexml_load_file('https://dl.dropbox.com/u/104873029/flagallery_skins/skins_v2.xml', 'SimpleXMLElement', LIBXML_NOCDATA);
344
+ $all_skins_arr = $skins_by_type = array();
345
+ $skins_xml_error = false;
346
+ if(!empty($skins_xml)) {
347
+ foreach($skins_xml as $skin){
348
+ $suid = (string) $skin->uid;
349
+ $skintype = (string) $skin->type;
350
+ $all_skins_arr[$suid] = get_object_vars($skin);
351
+ $skins_by_type[$skintype][$suid] = $all_skins_arr[$suid];
352
+ }
353
+ } else {
354
+ $skins_xml_error = __('URL file-access is disabled in the server configuration.', 'flag');
355
+ }
356
+
357
+
358
+ ?>
359
+
360
+ <div style="width:70%; overflow: hidden; float: left;">
361
+ <table class="widefat" cellspacing="0" id="skins-table">
362
+ <thead>
363
+ <tr>
364
+ <th scope="col" class="manage-column"><?php _e('Skin', 'flag'); ?></th>
365
+ <th scope="col" class="manage-column"><?php _e('Description', 'flag'); ?></th>
366
+ <th scope="col" class="action-links"><?php _e('Action', 'flag'); ?></th>
367
+ </tr>
368
+ </thead>
369
+
370
+ <tfoot>
371
+ <tr>
372
+ <th scope="col" class="manage-column"><?php _e('Skin', 'flag'); ?></th>
373
+ <th scope="col" class="manage-column"><?php _e('Description', 'flag'); ?></th>
374
+ <th scope="col" class="action-links"><?php _e('Action', 'flag'); ?></th>
375
+ </tr>
376
+ </tfoot>
377
+
378
+ <tbody class="skins">
379
+ <?php
380
+
381
+ if ( empty($all_skins) ) {
382
+ echo '<tr>
383
+ <td colspan="3">' . __('No skins to show') . '</td>
384
+ </tr>';
385
+ }
386
+ foreach ( (array)$all_skins as $skin_file => $skin_data) {
387
+ $class = ( dirname($skin_file) == $flag_options['flashSkin'] ) ? 'active' : 'inactive';
388
+ if(!empty($skin_data['uid'])){
389
+ $suid = (string) $skin_data['uid'];
390
+ if(isset($all_skins_arr[$suid]) && (string) $all_skins_arr[$suid]['uid'] == $suid) {
391
+ if(version_compare( (float) $all_skins_arr[$suid]['version'], (float) $skin_data['Version'], '<=' )) {
392
+ unset($skins_by_type[$stype][$suid]);
393
+ }
394
+ }
395
+ } ?>
396
+ <tr id="<?php echo basename($skin_file, '.php'); ?>" class="<?php echo $class; ?> first">
397
+ <td class="skin-title"><strong><?php echo $skin_data['Name']; ?></strong></td>
398
+ <td class="desc">
399
+ <?php
400
+ $skin_meta = array();
401
+ if ( !empty($skin_data['Version']) )
402
+ $skin_meta[] = sprintf(__('Version %s', 'flag'), $skin_data['Version']);
403
+ if ( !empty($skin_data['Author']) ) {
404
+ $author = $skin_data['Author'];
405
+ if ( !empty($skin_data['AuthorURI']) )
406
+ $author = '<a href="' . $skin_data['AuthorURI'] . '" title="' . __( 'Visit author homepage', 'flag' ) . '">' . $skin_data['Author'] . '</a>';
407
+ $skin_meta[] = sprintf( __('By %s', 'flag'), $author );
408
+ }
409
+ if ( ! empty($skin_data['SkinURI']) )
410
+ $skin_meta[] = '<a href="' . $skin_data['SkinURI'] . '" title="' . __( 'Visit skin site', 'flag' ) . '">' . __('Visit skin site', 'flag' ) . '</a>';
411
+ ?>
412
+ <?php echo implode(' | ', $skin_meta); ?>
413
+ </td>
414
+ <td class="skin-activate action-links">
415
+ <?php
416
+ if(isset($_GET['type']) && !empty($_GET['type'])) {
417
+ } else {
418
+ if ( dirname($skin_file) != $flag_options['flashSkin'] ) { ?>
419
+ <strong><a href="<?php echo admin_url('admin.php?page=flag-skins&skin='.dirname($skin_file)); ?>" title="<?php _e( 'Activate this skin', 'flag' ); ?>"><?php _e('Activate', 'flag' ); ?></a></strong>
420
+ <?php } else { ?>
421
+ <strong><?php _e('Activated by default', 'flag' ); ?></strong>
422
+ <?php
423
+ }
424
+ } ?>
425
+ </td>
426
+
427
+ </tr>
428
+ <tr class="<?php echo $class; ?> second">
429
+ <td class="skin-title"><img src="<?php echo WP_PLUGIN_URL."/flagallery-skins/".dirname($skin_file); ?>/screenshot.png" alt="<?php echo $skin_data['Name'];?>" title="<?php echo $skin_data['Name']; ?>" /></td>
430
+ <td class="desc">
431
+ <p><?php echo $skin_data['Description']; ?></p>
432
+ </td>
433
+ <td class="skin-delete action-links">
434
+ <?php
435
+ $settings = $flag_options['skinsDirABS'].dirname($skin_file).'/settings';
436
+ if(is_dir($settings)) { ?>
437
+ <a class="thickbox" href="<?php echo FLAG_URLPATH.'admin/skin_options.php?show_options=1&amp;skin='.dirname($skin_file).'&amp;TB_iframe=1&amp;width=600&amp;height=560'; ?>"><?php _e('Options', 'flag' ); ?></a>
438
+ <?php }
439
+ if ( current_user_can('FlAG Delete skins') ) {
440
+ if ( dirname($skin_file) != $flag_options['flashSkin'] ) { ?>
441
+ <br /><br /><a class="delete" onclick="javascript:check=confirm( \'<?php echo attribute_escape(sprintf(__('Delete "%s"' , 'flag'), $skin_data['Name'])); ?>\');if(check==false) return false;" href="<?php echo admin_url('admin.php?page=flag-skins&delete='.dirname($skin_file)); ?>" title="<?php _e( 'Delete this skin', 'flag' ); ?>"><?php _e('Delete', 'flag' ); ?></a>
442
+ <?php }
443
+ } ?>
444
+ </td>
445
+ </tr>
446
+ <?php } ?>
447
+ </tbody>
448
+ </table>
449
+ </div>
450
+
451
+ <div class="postbox metabox-holder" id="newskins" style="width: 29%; float: right; padding-top: 5px;">
452
+ <h3 style="font-size: 16px; line-height: 100%; font-weight: bold; color: #2583AD;">New Skins</h3>
453
+ <div class="inside">
454
+ <?php
455
+ if(isset($skins_by_type[$stype]) && !empty($skins_by_type[$stype])) {
456
+ foreach($skins_by_type[$stype] as $skin) { ?>
457
+ <div class="skin <?php echo $skin['type'].' '.$skin['status']; ?>" id="uid-<?php echo $skin['uid']; ?>" style="padding: 10px; float:left;">
458
+ <center>
459
+ <p><strong style="font-size: 120%;"><?php echo $skin['title']; ?></strong> <span class="version"><?php echo 'v'.$skin['version']; ?></span></p>
460
+ <div class="screenshot"><img src="<?php echo $skin['screenshot']; ?>" width="200" height="184" /></div>
461
+ </center>
462
+ <div class="content">
463
+ <div class="links" style="text-align: center;">
464
+ <form action="<?php echo admin_url('admin.php?page=flag-skins').'&amp;type='.$type; ?>" method="post">
465
+ <input type="hidden" name="skinzipurl" value="<?php echo $skin['download']; ?>" />
466
+ <p><a class="install button-primary" onclick="jQuery(this).closest('form').submit(); return false" href="<?php echo $skin['download']; ?>"><?php _e('Install', 'gmLang') ?></a>
467
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="button" href="<?php echo $skin['demo']; ?>" target="_blank"><?php _e('Preview', 'gmLang') ?></a></p>
468
+ </form>
469
+ </div>
470
+ </div>
471
+ </div>
472
+ <?php
473
+ }
474
+ } else { ?>
475
+ <div class="skin noskins"><?php if(!$skins_xml_error){ echo sprintf(__('All available %s skins are already installed...', 'gmLang'), $stype); } else { echo $skins_xml_error; } ?></div>
476
+ <?php }
477
+ ?>
478
+ </div>
479
+ </div>
480
+
481
+
482
+
483
+ </div>
484
+ <?php ?>
admin/tinymce/editor_plugin.js ADDED
@@ -0,0 +1,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Docu : http://wiki.moxiecode.com/index.php/TinyMCE:Create_plugin/3.x#Creating_your_own_plugins
2
+
3
+ (function() {
4
+ // Load plugin specific language pack
5
+ tinymce.PluginManager.requireLangPack('FlAG');
6
+
7
+ tinymce.create('tinymce.plugins.FlAG', {
8
+ /**
9
+ * Initializes the plugin, this will be executed after the plugin has been created.
10
+ * This call is done before the editor instance has finished it's initialization so use the onInit event
11
+ * of the editor instance to intercept that event.
12
+ *
13
+ * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.
14
+ * @param {string} url Absolute URL to where the plugin is located.
15
+ */
16
+ init : function(ed, url) {
17
+ // Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceExample');
18
+
19
+ ed.addCommand('mceFlAG', function() {
20
+ ed.windowManager.open({
21
+ file : url + '/window.php',
22
+ width : 360 + ed.getLang('FlAG.delta_width', 0),
23
+ height : 210 + ed.getLang('FlAG.delta_height', 0),
24
+ inline : 1
25
+ }, {
26
+ plugin_url : url // Plugin absolute URL
27
+ });
28
+ });
29
+
30
+ // Register example button
31
+ ed.addButton('FlAG', {
32
+ title : 'FlAG.desc',
33
+ cmd : 'mceFlAG',
34
+ image : url + '/flag.gif'
35
+ });
36
+
37
+ // Add a node change handler, selects the button in the UI when a image is selected
38
+ ed.onNodeChange.add(function(ed, cm, n) {
39
+ cm.setActive('FlAG', n.nodeName == 'IMG');
40
+ });
41
+ },
42
+
43
+ /**
44
+ * Creates control instances based in the incomming name. This method is normally not
45
+ * needed since the addButton method of the tinymce.Editor class is a more easy way of adding buttons
46
+ * but you sometimes need to create more complex controls like listboxes, split buttons etc then this
47
+ * method can be used to create those.
48
+ *
49
+ * @param {String} n Name of the control to create.
50
+ * @param {tinymce.ControlManager} cm Control manager to use inorder to create new control.
51
+ * @return {tinymce.ui.Control} New control instance or null if no control was created.
52
+ */
53
+ createControl : function(n, cm) {
54
+ return null;
55
+ },
56
+
57
+ /**
58
+ * Returns information about the plugin as a name/value array.
59
+ * The current keys are longname, author, authorurl, infourl and version.
60
+ *
61
+ * @return {Object} Name/value array containing information about the plugin.
62
+ */
63
+ getInfo : function() {
64
+ return {
65
+ longname : 'FlAG',
66
+ author : 'Sergey Pasyuk',
67
+ authorurl : 'http://codeasily.com',
68
+ infourl : 'http://codeasily.com',
69
+ version : "1.4"
70
+ };
71
+ }
72
+ });
73
+
74
+ // Register plugin
75
+ tinymce.PluginManager.add('FlAG', tinymce.plugins.FlAG);
76
+ })();
77
+
78
+
admin/tinymce/flag.gif ADDED
Binary file
admin/tinymce/img/butt2.png ADDED
Binary file
admin/tinymce/img/button_bg.png ADDED
Binary file
admin/tinymce/img/down_arrow.gif ADDED
Binary file
admin/tinymce/img/fade-butt.png ADDED
Binary file
admin/tinymce/img/separator.gif ADDED
Binary file
admin/tinymce/img/tabs.gif ADDED
Binary file
admin/tinymce/langs/de.js ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ // German lang variables for WP2.5
2
+
3
+ tinyMCE.addI18n({de:{
4
+ FlAG:{
5
+ desc : 'Flash Album Gallery hinzufuegen'
6
+ }}});
admin/tinymce/langs/de_de.js ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ // German lang variables for WP2.5
2
+
3
+ tinyMCE.addI18n({de:{
4
+ FlAG:{
5
+ desc : 'Flash Album Gallery hinzufuegen'
6
+ }}});
admin/tinymce/langs/en.js ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ // English lang variables for WP2.5
2
+
3
+ tinyMCE.addI18n({en:{
4
+ FlAG:{
5
+ desc : 'Add Flash Album Gallery'
6
+ }}});
admin/tinymce/langs/en_US.js ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ // English lang variables for WP2.5
2
+
3
+ tinyMCE.addI18n({en_US:{
4
+ FlAG:{
5
+ desc : 'Add Flash Album Gallery'
6
+ }}});
admin/tinymce/popup.css ADDED
@@ -0,0 +1,210 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ body {
2
+ font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px;
3
+ background:#f1f1f1;
4
+ padding:0;
5
+ margin:8px 8px 0 8px;
6
+ }
7
+
8
+ html {background:#f1f1f1;}
9
+ td {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;}
10
+ textarea {resize:none;outline:none;}
11
+ a:link, a:visited {color:black;}
12
+ a:hover {color:#2B6FB6;}
13
+ .nowrap {white-space: nowrap}
14
+
15
+ /* Forms */
16
+ fieldset {margin:0; padding:4px; border:1px solid #dfdfdf; font-family:Verdana, Arial; font-size:10px;}
17
+ legend {color:#2B6FB6; font-weight:bold;}
18
+ label.msg {display:none;}
19
+ label.invalid {color:#EE0000; display:inline;}
20
+ input.invalid {border:1px solid #EE0000;}
21
+ input {background:#FFF; border:1px solid #dfdfdf;}
22
+ input, select, textarea {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;}
23
+ input, select, textarea {border:1px solid #dfdfdf;}
24
+ input.radio {border:1px none #000000; background:transparent; vertical-align:middle;}
25
+ input.checkbox {border:1px none #000000; background:transparent; vertical-align:middle;}
26
+ .input_noborder {border:0;}
27
+
28
+ /* Buttons */
29
+ #insert, #cancel, #apply, .mceActionPanel .button, input.mceButton, .updateButton {
30
+ border: 1px solid #bbb;
31
+ margin:0;
32
+ padding:0 0 1px;
33
+ font-weight:bold;
34
+ font-size: 11px;
35
+ width:94px;
36
+ height:24px;
37
+ background:url(img/fade-butt.png) 0 0;
38
+ color:#000;
39
+ cursor:pointer;
40
+ -moz-border-radius: 3px;
41
+ -khtml-border-radius: 3px;
42
+ -webkit-border-radius: 3px;
43
+ border-radius: 3px;
44
+ }
45
+ #insert:hover, #cancel:hover, input.mceButton:hover, .updateButton:hover,
46
+ #insert:focus, #cancel:focus, input.mceButton:focus, .updateButton:focus {
47
+ border: 1px solid #555;
48
+ }
49
+
50
+
51
+ /* Charmap */
52
+ table.charmap {border:1px solid #AAA; text-align:center}
53
+ td.charmap, #charmap a {width:18px; height:18px; color:#000; border:1px solid #AAA; text-align:center; font-size:12px; vertical-align:middle; line-height: 18px;}
54
+ #charmap a {display:block; color:#000; text-decoration:none; border:0}
55
+ #charmap a:hover {background:#CCC;color:#2B6FB6}
56
+ #charmap #codeN {font-size:10px; font-family:Arial,Helvetica,sans-serif; text-align:center}
57
+ #charmap #codeV {font-size:40px; height:80px; border:1px solid #AAA; text-align:center}
58
+ #charmap #charmapView {background-color:#fff;}
59
+
60
+ /* Source */
61
+ .wordWrapCode {vertical-align:middle; border:1px none #000000; background:transparent;}
62
+ .mceActionPanel {margin-top:5px;}
63
+
64
+ /* Tabs classes */
65
+ div.tabs {width:100%; height:18px; line-height:normal; background:url(img/tabs.gif) repeat-x 0 -72px;}
66
+ div.tabs ul {margin:0; padding:0; list-style:none;}
67
+ div.tabs li {float:left; background:url(img/tabs.gif) no-repeat 0 0; margin:0 2px 0 0; padding:0 0 0 10px; line-height:17px; height:18px; display:block;}
68
+ div.tabs li.current {background:url(img/tabs.gif) no-repeat 0 -18px; margin-right:2px;}
69
+ div.tabs span {float:left; display:block; background:url(img/tabs.gif) no-repeat right -36px; padding:0px 10px 0 0;}
70
+ div.tabs .current span {background:url(img/tabs.gif) no-repeat right -54px;}
71
+ div.tabs a {text-decoration:none; font-family:Verdana, Arial; font-size:10px;}
72
+ div.tabs a:link, div.tabs a:visited, div.tabs a:hover {color:black;}
73
+
74
+ /* Panels */
75
+ .panel_wrapper div.panel {display:none;}
76
+ .panel_wrapper div.current {display:block; width:100%; height:300px; overflow:visible;}
77
+ .panel_wrapper {border:1px solid #919B9C; border-top:0px; padding:10px; padding-top:5px; clear:both; background:white;}
78
+
79
+ /* Columns */
80
+ .column {float:left;}
81
+ .properties {width:100%;}
82
+ .properties .column1 {}
83
+ .properties .column2 {text-align:left;}
84
+
85
+ /* Titles */
86
+ h1, h2, h3, h4 {color:#2B6FB6; margin:0; padding:0; padding-top:5px;}
87
+ h3 {font-size:14px;}
88
+ .title {font-size:12px; font-weight:bold; color:#2B6FB6;}
89
+
90
+ /* Dialog specific */
91
+ #link .panel_wrapper, #link div.current {height:125px;}
92
+ #image .panel_wrapper, #image div.current {height:200px;}
93
+ #plugintable thead {font-weight:bold; background:#DDD;}
94
+ #plugintable, #about #plugintable td {border:1px solid #919B9C;}
95
+ #plugintable {width:96%; margin-top:10px;}
96
+ #pluginscontainer {height:290px; overflow:auto;}
97
+ #colorpicker #preview {float:right; width:50px; height:14px;line-height:1px; border:1px solid black; margin-left:5px;}
98
+ #colorpicker #colors {float:left; border:1px solid gray; cursor:crosshair;}
99
+ #colorpicker #light {border:1px solid gray; margin-left:5px; float:left;width:15px; height:150px; cursor:crosshair;}
100
+ #colorpicker #light div {overflow:hidden;}
101
+ #colorpicker #previewblock {float:right; padding-left:10px; height:20px;}
102
+ #colorpicker .panel_wrapper div.current {height:175px;}
103
+ #colorpicker #namedcolors {width:150px;}
104
+ #colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;}
105
+ #colorpicker #colornamecontainer {margin-top:5px;}
106
+ #colorpicker #picker_panel fieldset {margin:auto;width:325px;}
107
+
108
+
109
+
110
+ ul#tabs{
111
+ display: block;
112
+ background:#F1F1F1 none repeat scroll 0%;
113
+ font-size:12px;
114
+ overflow:hidden;
115
+ width: auto;
116
+ padding: 0 0 0 5px;
117
+ /* border-bottom: 1px solid #000000; */
118
+ margin-bottom: 0;
119
+
120
+ -moz-border-radius-topright: 6px;
121
+ -khtml-border-top-right-radius: 6px;
122
+ -webkit-border-top-right-radius: 6px;
123
+ border-top-right-radius: 6px;
124
+ -moz-border-radius-topleft: 6px;
125
+ -khtml-border-top-left-radius: 6px;
126
+ -webkit-border-top-left-radius: 6px;
127
+ border-top-left-radius: 6px;
128
+ }
129
+
130
+ ul.tabs {
131
+ list-style: none;
132
+ }
133
+ ul.tabs:after { /* clearing without presentational markup, IE gets extra treatment */
134
+ display: block;
135
+ clear: both;
136
+ content: " ";
137
+ }
138
+ ul.tabs li {
139
+ float: left;
140
+ padding: 2px 3px;
141
+ margin: 2px 2px -1px 1px !important;
142
+ text-decoration: none;
143
+ list-style: none;
144
+ }
145
+ ul.tabs a, ul.tabs a span {
146
+ display: block;
147
+ padding: 0 1px;
148
+ }
149
+
150
+ ul.tabs a {
151
+ margin: 1px 0 0; /* position: relative makes opacity fail for disabled tab in IE */
152
+ padding-left: 0;
153
+ color: #2583AD;
154
+ text-align: center;
155
+ text-decoration: none;
156
+ white-space: nowrap; /* required in IE 6 */
157
+ outline: 0; /* prevent dotted border in Firefox */
158
+ }
159
+ ul.tabs .selected{
160
+ background: #6D6D6D url(../images/menu-bits.gif) repeat-x scroll left top;
161
+ border-color: #6D6D6D;
162
+ color: #FFFFFF;
163
+ text-shadow:0 -1px 0 #666666;
164
+
165
+ -moz-border-radius-topright: 6px;
166
+ -khtml-border-top-right-radius: 6px;
167
+ -webkit-border-top-right-radius: 6px;
168
+ border-top-right-radius: 6px;
169
+ -moz-border-radius-topleft: 6px;
170
+ -khtml-border-top-left-radius: 6px;
171
+ -webkit-border-top-left-radius: 6px;
172
+ border-top-left-radius: 6px;
173
+ }
174
+
175
+ ul.tabs .selected a,
176
+ ul.tabs .selected a:hover {
177
+ color:#FFFFFF !important;
178
+ position: relative;
179
+ top: 1px;
180
+ z-index: 2;
181
+ margin-top: 0;
182
+ }
183
+
184
+ ul.tabs li a:hover {
185
+ color:#D54E21;
186
+ }
187
+
188
+ ul.tabs .selected a, ul.tabs a:hover, ul.tabs a:focus, ul.tabs a:active {
189
+ background-position: 100% -150px;
190
+ }
191
+ ul.tabs a {
192
+ background-position: 100% -100px;
193
+ }
194
+ ul.tabs .selected a:link, ul.tabs .selected a:visited { /* @ Opera, use pseudo classes otherwise it confuses cursor... */
195
+ cursor: text;
196
+ }
197
+ ul.tabs a:hover, ul.tabs a:focus, ul.tabs a:active { /* @ Opera, we need to be explicit again here now... */
198
+ cursor: pointer;
199
+ }
200
+
201
+
202
+ /* Additional IE specific bug fixes... */
203
+ * html ul.tabs { /* auto clear, @ IE 6 & IE 7 Quirks Mode */
204
+ display: inline-block;
205
+ }
206
+ *:first-child+html ul.tabs { /* @ IE 7 Standards Mode - do not group selectors, otherwise IE 6 will ignore complete rule (because of the unknown + combinator)... */
207
+ display: inline-block;
208
+ }
209
+
210
+ .cptabs_wrapper .cptab { border:1px solid #919B9C; height:125px; padding: 5px; background: #fefefe; }
admin/tinymce/tinymce.php ADDED
@@ -0,0 +1,133 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * add_flag_button
5
+ *
6
+ * @package FlAG Gallery
7
+ * @title TinyMCE V3 Button Integration (for WP2.5 and higher)
8
+ */
9
+ class add_flag_button {
10
+
11
+ var $pluginname = 'FlAG';
12
+ var $path = '';
13
+ var $internalVersion = 100;
14
+
15
+ /**
16
+ * add_flag_button::add_flag_button()
17
+ * the constructor
18
+ *
19
+ * @return void
20
+ */
21
+ function add_flag_button() {
22
+
23
+ // Set path to editor_plugin.js
24
+ $this->path = FLAG_URLPATH . 'admin/tinymce/';
25
+
26
+ // Modify the version when tinyMCE plugins are changed.
27
+ add_filter('tiny_mce_version', array (&$this, 'change_tinymce_version') );
28
+
29
+ // init process for button control
30
+ add_action('init', array (&$this, 'addbuttons') );
31
+ }
32
+
33
+ /**
34
+ * add_flag_button::addbuttons()
35
+ *
36
+ * @return void
37
+ */
38
+ function addbuttons() {
39
+
40
+ // Don't bother doing this stuff if the current user lacks permissions
41
+ if ( !current_user_can('edit_posts') && !current_user_can('edit_pages') )
42
+ return;
43
+
44
+ // Check for FlAG capability
45
+ if ( !current_user_can('FlAG Use TinyMCE') )
46
+ return;
47
+
48
+ // Add only in Rich Editor mode
49
+ if ( get_user_option('rich_editing') == 'true') {
50
+
51
+ // add the button for wp2.5 in a new way
52
+ add_filter("mce_external_plugins", array (&$this, 'add_tinymce_plugin' ), 5);
53
+ add_filter('mce_buttons', array (&$this, 'register_button' ), 5);
54
+ }
55
+ add_filter('admin_head', array (&$this, 'wp_flag_ins_button' ), 5);
56
+ }
57
+
58
+ /**
59
+ * add_flag_button::register_button()
60
+ * used to insert button in wordpress 2.5x editor
61
+ *
62
+ * @return $buttons
63
+ */
64
+ function register_button($buttons) {
65
+
66
+ array_push($buttons, 'separator', $this->pluginname );
67
+
68
+ return $buttons;
69
+ }
70
+
71
+ /**
72
+ * add_flag_button::add_tinymce_plugin()
73
+ * Load the TinyMCE plugin : editor_plugin.js
74
+ *
75
+ * @return $plugin_array
76
+ */
77
+ function add_tinymce_plugin($plugin_array) {
78
+
79
+ $plugin_array[$this->pluginname] = $this->path . 'editor_plugin.js';
80
+
81
+ return $plugin_array;
82
+ }
83
+
84
+ /**
85
+ * add_flag_button::change_tinymce_version()
86
+ * A different version will rebuild the cache
87
+ *
88
+ * @return $versio
89
+ */
90
+ function change_tinymce_version($version) {
91
+ $version = $version + $this->internalVersion;
92
+ return $version;
93
+ }
94
+
95
+
96
+ /*
97
+ * INSERT BUTTON ON POST SCREEN
98
+ */
99
+
100
+ function wp_flag_ins_button() {
101
+
102
+ if( strpos($_SERVER['REQUEST_URI'], 'post.php')
103
+ || strstr($_SERVER['PHP_SELF'], 'page-new.php')
104
+ || strstr($_SERVER['PHP_SELF'], 'page.php')
105
+ || strstr($_SERVER['PHP_SELF'], 'post-new.php') )
106
+ {
107
+ ?>
108
+ <script type="text/javascript">
109
+ <!--
110
+ jQuery(function() {
111
+ jQuery("#ed_toolbar").before('<div class="quicktags-toolbar" style="float:right;"><input type="button" class="ed_button" id="qt_FlAGallery_button" onClick="wpflagins();" value="FlAGallery" /></div>');
112
+ });
113
+ function wpflagins() {
114
+ tb_show("<?php _e('Insert Flash Album with one or more galleries', 'flag'); ?>","<?php echo FLAG_URLPATH; ?>admin/tinymce/window.php?riched=false&TB_iframe=true&width=360&height=210",false);
115
+ jQuery("#TB_window").css({width:"360px", height:"210px", marginTop:"-120px", marginLeft:"-180px", top:"50%"});
116
+ jQuery("#TB_iframeContent").css({width:"360px", height:"210px"});
117
+ jQuery(window).unbind("resize");
118
+ }
119
+ function bind_resize() {
120
+ jQuery(window).bind("resize", tb_position);
121
+ }
122
+ //-->
123
+ </script>
124
+ <?php
125
+ }
126
+ }
127
+ }
128
+
129
+ // Call it now
130
+ $tinymce_button = new add_flag_button ();
131
+
132
+
133
+ ?>
admin/tinymce/window.php ADDED
@@ -0,0 +1,296 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // look up for the path
4
+ require_once( dirname( dirname( dirname(__FILE__) ) ) . '/flag-config.php');
5
+ require_once (dirname( dirname(__FILE__) ) . '/get_skin.php');
6
+ require_once (dirname( dirname(__FILE__) ) . '/playlist.functions.php');
7
+
8
+ // check for rights
9
+ if ( !is_user_logged_in() || !current_user_can('edit_posts') )
10
+ wp_die(__("You are not allowed to be here"));
11
+
12
+ global $flag, $flagdb, $wp_query;
13
+
14
+ $all_skins = get_skins();
15
+ $all_playlists = get_playlists();
16
+
17
+ if($_REQUEST['riched'] == "false") {
18
+ ?>
19
+ <html xmlns="http://www.w3.org/1999/xhtml">
20
+ <head>
21
+ <title><?php _e("Insert Flash Album with one or more galleries", 'flag'); ?></title>
22
+ <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_option('blog_charset'); ?>" />
23
+ <script language="javascript" type="text/javascript" src="<?php echo get_option('siteurl'); ?>/wp-includes/js/jquery/jquery.js"></script>
24
+ <script language="javascript" type="text/javascript" src="<?php echo FLAG_URLPATH; ?>admin/js/tabs.js"></script>
25
+ <link rel="stylesheet" type="text/css" href="<?php echo FLAG_URLPATH; ?>admin/tinymce/popup.css" />
26
+ <base target="_self" />
27
+ </head>
28
+ <body id="link">
29
+ <?php } else { ?>
30
+ <html xmlns="http://www.w3.org/1999/xhtml">
31
+ <head>
32
+ <title><?php _e("Insert Flash Album with one or more galleries", 'flag'); ?>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</title>
33
+ <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_option('blog_charset'); ?>" />
34
+ <script language="javascript" type="text/javascript" src="<?php echo get_option('siteurl'); ?>/wp-includes/js/jquery/jquery.js"></script>
35
+ <script language="javascript" type="text/javascript" src="<?php echo get_option('siteurl'); ?>/wp-includes/js/tinymce/tiny_mce_popup.js"></script>
36
+ <script language="javascript" type="text/javascript" src="<?php echo get_option('siteurl'); ?>/wp-includes/js/tinymce/utils/mctabs.js"></script>
37
+ <script language="javascript" type="text/javascript" src="<?php echo get_option('siteurl'); ?>/wp-includes/js/tinymce/utils/form_utils.js"></script>
38
+
39
+ <base target="_self" />
40
+ </head>
41
+ <body id="link" onload="tinyMCEPopup.executeOnLoad('init();');document.body.style.display='';document.getElementById('galleries').focus();" style="display: none">
42
+ <?php } ?>
43
+ <form name="FlAG" action="#">
44
+ <?php
45
+ if($_REQUEST['riched'] == "false") {
46
+ ?>
47
+ <div class="cptabs_wrapper">
48
+ <ul id="tabs" class="tabs">
49
+ <li class="selected"><a href="#" rel="gallery_panel"><span><?php _e( 'Galleries', 'flag' ); ?></span></a></li>
50
+ <li><a href="#" rel="album_panel"><span><?php _e( 'Albums', 'flag' ); ?></span></a></li>
51
+ <li id="sort_tab"><a href="#" rel="sort_panel"><span><?php _e('Sort', 'flag'); ?></span></a></li>
52
+ <li><a href="#" rel="custom_panel"><span><?php _e( 'Skin', 'flag' ); ?></span></a></li>
53
+ <li style="display:none;"><a href="#" rel="music_panel"><span><?php _e( 'Music', 'flag' ); ?></span></a></li>
54
+ </ul>
55
+ <?php } else { ?>
56
+ <div class="tabs" style="position:relative; overflow:hidden; margin-bottom:-1px;">
57
+ <ul>
58
+ <li id="gallery_tab" class="current"><span><a href="javascript:mcTabs.displayTab('gallery_tab','gallery_panel');" onmousedown="return false;"><?php _e( 'Galleries', 'flag' ); ?></a></span></li>
59
+ <li id="album_tab"><span><a href="javascript:mcTabs.displayTab('album_tab','album_panel');" onmousedown="return false;"><?php _e( 'Albums', 'flag' ); ?></a></span></li>
60
+ <li id="sort_tab"><span><a href="javascript:mcTabs.displayTab('sort_tab','sort_panel');" onmousedown="return false;"><?php _e('Sort', 'flag'); ?></a></span></li>
61
+ <li id="custom_tab"><span><a href="javascript:mcTabs.displayTab('custom_tab','custom_panel');" onmousedown="return false;"><?php _e( 'Skin', 'flag' ); ?></a></span></li>
62
+ <li id="music_tab" style="display:none;"><span><a href="javascript:mcTabs.displayTab('music_tab','music_panel');" onmousedown="return false;"><?php _e( 'Music', 'flag' ); ?></a></span></li>
63
+ </ul>
64
+ </div>
65
+ <div class="panel_wrapper" style="border:1px solid #919B9C; height:130px;">
66
+ <?php } ?>
67
+
68
+ <!-- gallery panel -->
69
+ <div id="gallery_panel" class="panel cptab current">
70
+ <table border="0" cellpadding="4" cellspacing="0">
71
+ <tr>
72
+ <td nowrap="nowrap" valign="middle"><label for="galleryname"><?php _e("Album Name", 'flag'); ?>:<span style="color:red;"> *</span></label></td>
73
+ <td valign="middle"><input id="galleryname" name="galleryname" value="Gallery" type="text" style="width: 200px" /></td>
74
+ </tr>
75
+ <tr>
76
+ <td nowrap="nowrap" valign="top"><label for="galleries"><?php _e("Select galleries", 'flag'); ?>:<span style="color:red;"> *</span></label><br /><small><?php _e("(album categories)", 'flag'); ?></small></td>
77
+ <td><select id="galleries" name="galleries" style="width: 200px" size="6" multiple="multiple">
78
+ <option value="all" selected="selected" onclick="javascript:document.getElementById('sort_tab').style.display='block'" style="font-weight:bold">* - <?php _e("all galleries", 'flag'); ?></option>
79
+ <?php
80
+ $gallerylist = $flagdb->find_all_galleries('gid', 'ASC');
81
+ if(is_array($gallerylist)) {
82
+ foreach($gallerylist as $gallery) {
83
+ $name = ( empty($gallery->title) ) ? $gallery->name : $gallery->title;
84
+ echo '<option value="' . $gallery->gid . '" >' . $gallery->gid . ' - ' . $name . '</option>' . "\n";
85
+ }
86
+ }
87
+ ?>
88
+ </select></td>
89
+ </tr>
90
+ </table>
91
+ </div>
92
+ <!-- /gallery panel -->
93
+ <!-- album panel -->
94
+ <div id="album_panel" class="panel cptab">
95
+ <table border="0" cellpadding="4" cellspacing="0">
96
+ <tr>
97
+ <td nowrap="nowrap" valign="top"><label for="album"><?php _e("Select album", 'flag'); ?>:</label></td>
98
+ <td><select id="album" name="album" style="width: 200px" size="8">
99
+ <option value="" selected="selected"><?php _e("choose album", 'flag'); ?></option>
100
+ <?php
101
+ $albumlist = $flagdb->find_all_albums('id', 'ASC');
102
+ if(is_array($albumlist)) {
103
+ foreach($albumlist as $album) {
104
+ $name = $album->name;
105
+ echo '<option value="' . $album->id . '" >' . $name . '</option>' . "\n";
106
+ }
107
+ }
108
+ ?>
109
+ </select></td>
110
+ </tr>
111
+ </table>
112
+ </div>
113
+ <!-- /album panel -->
114
+ <!-- skin panel -->
115
+ <div id="custom_panel" class="panel cptab">
116
+ <table border="0" cellpadding="4" cellspacing="0">
117
+ <tr>
118
+ <td nowrap="nowrap" valign="middle"><label for="skinname"><?php _e("Choose skin", 'flag'); ?>:</label></td>
119
+ <td valign="middle"><select id="skinname" name="skinname" style="width: 200px">
120
+ <option value="" selected="selected"><?php _e("choose custom skin", 'flag'); ?></option>
121
+ <?php
122
+ foreach ( (array)$all_skins as $skin_file => $skin_data) {
123
+ echo '<option value="'.dirname($skin_file).'">'.$skin_data['Name'].'</option>'."\n";
124
+ }
125
+ ?>
126
+ </select></td>
127
+ </tr>
128
+ <tr>
129
+ <td valign="top"><label><?php _e("Skin size", 'flag'); ?>:</label><br /><span style="font-size:9px">(<?php _e("blank for default", 'flag'); ?>)</span></td>
130
+ <td valign="top"><?php _e("width", 'flag'); ?>: <input id="gallerywidth" type="text" name="gallerywidth" style="width: 50px" /> &nbsp; <?php _e("height", 'flag'); ?>: <input id="galleryheight" type="text" name="galleryheight" style="width: 50px" /></td>
131
+ </tr>
132
+ <tr>
133
+ <td valign="top"><label><?php _e("Skin align", 'flag'); ?>:</label></td>
134
+ <td valign="top"><select id="skinalign" name="skinalign" style="width: 200px">
135
+ <option value="" selected="selected"><?php _e("default", 'flag'); ?></option>
136
+ <option value="left"><?php _e("align left", 'flag'); ?></option>
137
+ <option value="center"><?php _e("align center", 'flag'); ?></option>
138
+ <option value="right"><?php _e("align right", 'flag'); ?></option>
139
+ </select></td>
140
+ </tr>
141
+ </table>
142
+ </div>
143
+ <!-- /custom panel -->
144
+ <!-- sort panel -->
145
+ <div id="sort_panel" class="panel cptab">
146
+ <table border="0" cellpadding="4" cellspacing="0">
147
+ <tr>
148
+ <td nowrap="nowrap" valign="middle"><label for="galorderby"><?php _e("Order by", 'flag'); ?>:</label></td>
149
+ <td valign="middle"><select id="galorderby" name="galorderby" style="width: 200px">
150
+ <option value="" selected="selected"><?php _e("Gallery IDs (default)", 'flag'); ?></option>
151
+ <option value="title"><?php _e("Gallery Title", 'flag'); ?></option>
152
+ <!-- <option value="sortorder"><?php _e("User Defined", 'flag'); ?></option> -->
153
+ <option value="rand"><?php _e("Randomly", 'flag'); ?></option>
154
+ </select></td>
155
+ </tr>
156
+ <tr>
157
+ <td nowrap="nowrap" valign="middle"><label for="galorder"><?php _e("Order", 'flag'); ?>:</label></td>
158
+ <td valign="middle"><select id="galorder" name="galorder" style="width: 200px">
159
+ <option value="" selected="selected"><?php _e("DESC (default)", 'flag'); ?></option>
160
+ <option value="ASC"><?php _e("ASC", 'flag'); ?></option>
161
+ </select></td>
162
+ </tr>
163
+ <tr>
164
+ <td nowrap="nowrap" valign="middle"><label for="galexclude"><?php _e("Exclude Gallery", 'flag'); ?>:</label></td>
165
+ <td valign="middle"><input id="galexclude" name="galexclude" type="text" style="width: 200px" /></td>
166
+ </tr>
167
+ </table>
168
+ </div>
169
+ <!-- /sort panel -->
170
+ <!-- music panel -->
171
+ <div id="music_panel" class="panel cptab">
172
+ <table border="0" cellpadding="4" cellspacing="0">
173
+ <tr>
174
+ <td nowrap="nowrap" valign="top"><div style="display: block; width: 100px; white-space: normal;"><?php _e("Choose playlist for background music", 'flag'); ?>:</div></td>
175
+ <td valign="middle" valign="top"><select id="playlist" name="playlist" style="width: 200px">
176
+ <option value="" selected="selected"><?php _e("choose playlist", 'flag'); ?></option>
177
+ <?php
178
+ foreach((array)$all_playlists as $playlist_file => $playlist_data) {
179
+ $playlist_name = basename($playlist_file, '.xml');
180
+ ?>
181
+ <option value="<?php echo $playlist_name; ?>"><?php echo $playlist_data['title']; ?></option>
182
+ <?php
183
+ }
184
+ ?>
185
+ </select><p style="padding-top: 10px; margin: 0; font-size: 10px;"><?php _e('Read Skin specification for supporting this function.') ?></p></td>
186
+ </tr>
187
+ </table>
188
+ </div>
189
+ <!-- /music panel -->
190
+
191
+ </div>
192
+ <div class="mceActionPanel">
193
+ <div style="float: right">
194
+ <input type="button" id="insert" name="insert" value="<?php _e("Insert", 'flag'); ?>" />
195
+ </div>
196
+ </div>
197
+ <?php if($_REQUEST['riched'] == "false") { ?>
198
+ <script type="text/javascript">
199
+ /* <![CDATA[ */
200
+ var cptabs=new ddtabcontent("tabs");
201
+ cptabs.setpersist(false);
202
+ cptabs.setselectedClassTarget("linkparent");
203
+ cptabs.init();
204
+ /* ]]> */
205
+ </script>
206
+ <?php } ?>
207
+ <script type="text/javascript">
208
+ /* <![CDATA[ */
209
+ var win = window.dialogArguments || opener || parent || top;
210
+ jQuery('#insert').click(function(){
211
+ var tagtext;
212
+ var galleryname = document.getElementById('galleryname').value;
213
+ var gallerywidth = document.getElementById('gallerywidth').value;
214
+ var galleryheight = document.getElementById('galleryheight').value;
215
+ var galorderby = document.getElementById('galorderby').value;
216
+ var galorder = document.getElementById('galorder').value;
217
+ var galexclude = document.getElementById('galexclude').value;
218
+ var skinname = document.getElementById('skinname').value;
219
+ var skinalign = document.getElementById('skinalign').value;
220
+ var playlist = document.getElementById('playlist').value;
221
+ var gallery = document.getElementById('galleries');
222
+ var album = jQuery('#album').val();
223
+ var len = gallery.length;
224
+ var galleryid="";
225
+ if(!album){
226
+ for(i=0;i<len;i++)
227
+ {
228
+ if(gallery.options[i].selected) {
229
+ if(galleryid=="") {
230
+ galleryid = " gid=" + galleryid + gallery.options[i].value;
231
+ } else {
232
+ galleryid = galleryid + "," + gallery.options[i].value;
233
+ }
234
+ }
235
+ }
236
+ } else {
237
+ galleryname = jQuery('#album option:selected').text();
238
+ album = ' album='+album;
239
+ }
240
+ if (gallerywidth && galleryheight)
241
+ var gallerysize = " w=" + gallerywidth + " h=" + galleryheight;
242
+ else
243
+ var gallerysize="";
244
+
245
+ if (galleryid == ' gid=all') {
246
+ if (galorderby) {
247
+ var galorderby = " orderby=" + galorderby;
248
+ }
249
+ if (galorder) {
250
+ var galorder = " order=" + galorder;
251
+ }
252
+ if (galexclude) {
253
+ var galexclude = " exclude=" + galexclude;
254
+ }
255
+ } else {
256
+ var galorderby = '';
257
+ var galorder = '';
258
+ var galexclude = '';
259
+ }
260
+ if (skinname) {
261
+ var skinname = " skin=" + skinname;
262
+ } else var skinname = '';
263
+ if (skinalign) {
264
+ var skinalign = " align=" + skinalign;
265
+ } else var skinalign = '';
266
+ if (playlist) {
267
+ var skinname = " play=" + playlist;
268
+ } else var playlist = '';
269
+
270
+ if (galleryid || album ) {
271
+ tagtext = '[flagallery' + galleryid + album + gallerysize + galorderby + galorder + galexclude + skinname + skinalign + playlist + ' name=' + galleryname + ']';
272
+ win.send_to_editor(tagtext);
273
+ win.bind_resize();
274
+ <?php if($_REQUEST['riched'] != "false") { ?>
275
+ tinyMCEPopup.close();
276
+ <?php } ?>
277
+ } else alert('Choose at least one gallery!');
278
+ });
279
+ jQuery(window).unload(function(){
280
+ win.bind_resize();
281
+ });
282
+ /* ]]> */
283
+ </script>
284
+ <script type="text/javascript">
285
+ /* <![CDATA[ */
286
+ jQuery('#galleries').change(function(){
287
+ jQuery('#sort_tab').hide();
288
+ if(jQuery('#galleries option[value=all]:selected')) {
289
+ jQuery('#galleries option[value=all]:selected').siblings().removeAttr('selected');
290
+ }
291
+ });
292
+ /* ]]> */
293
+ </script>
294
+ </form>
295
+ </body>
296
+ </html>
admin/tuning.php ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You are not allowed to call this page directly.'); }
4
+
5
+ require_once(dirname(dirname(__FILE__)) . '/lib/core.php');
6
+
7
+ function flag_tune($show_error=true) {
8
+ /* Move skins outside the plugin folder */
9
+ $flag_options = get_option('flag_options');
10
+ $skins_dir = str_replace("\\","/", WP_PLUGIN_DIR . '/flagallery-skins/' );
11
+ $old_skins_dir = FLAG_ABSPATH . 'skins/';
12
+
13
+ $flag_options['skinsDirABS'] = $skins_dir;
14
+ $flag_options['skinsDirURL'] = WP_PLUGIN_URL . '/flagallery-skins/';
15
+ update_option('flag_options', $flag_options);
16
+
17
+ $errors = '';
18
+ // check for main folder
19
+ if ( !wp_mkdir_p( $skins_dir ) ) {
20
+ $errors .= __('Directory <strong>"', 'flag').$skins_dir.__('"</strong> doesn\'t exist. Please create first the <strong>"flagallery-skins"</strong> folder!', 'flag').'<br />';
21
+ } else {
22
+ // check for permission settings, Safe mode limitations are not taken into account.
23
+ if ( !is_writeable( $skins_dir ) ) {
24
+ $errors .= __('Directory <strong>"', 'flag').$skins_dir.__('"</strong> is not writeable!', 'flag').'<br />';
25
+ } else {
26
+
27
+ // Files in flash-album-gallery/skins directory
28
+ $open_old_skins_dir = @opendir( $old_skins_dir);
29
+ if ( $open_old_skins_dir ) {
30
+ while (($file = readdir( $open_old_skins_dir ) ) !== false ) {
31
+ if ( substr($file, 0, 1) == '.' )
32
+ continue;
33
+ if ( is_dir( $old_skins_dir.$file ) ) {
34
+ if( is_dir( $skins_dir.$file ) ) {
35
+ flagGallery::flagFolderDelete( $skins_dir.$file );
36
+ }
37
+ if ( !@rename($old_skins_dir.$file, $skins_dir.$file) ) {
38
+ $errors .= sprintf(__('Failed to move file %1$s to %2$s','flag'),
39
+ '<strong>'.$old_skins_dir.$file.'</strong>', $skins_dir.$file).'<br />';
40
+ }
41
+ }
42
+ }
43
+ }
44
+ @closedir( $open_old_skins_dir );
45
+ }
46
+ }
47
+
48
+ if ( $errors != '') {
49
+ if($show_error)
50
+ flagGallery::show_error($errors);
51
+ return false;
52
+ }
53
+ return true;
54
+ }
55
+ ?>
admin/upgrade.php ADDED
@@ -0,0 +1,198 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You are not allowed to call this page directly.'); }
4
+
5
+ /**
6
+ * flag_upgrade() - update routine for older version
7
+ *
8
+ * @return Success message
9
+ */
10
+ function flag_upgrade() {
11
+
12
+ global $wpdb, $user_ID;
13
+
14
+ // get the current user ID
15
+ get_currentuserinfo();
16
+
17
+ // Be sure that the tables exist
18
+ if($wpdb->get_var("show tables like '$wpdb->flagpictures'") == $wpdb->prefix . 'flag_pictures') {
19
+
20
+ echo __('Upgrade database structure...', 'flag');
21
+ $wpdb->show_errors();
22
+
23
+ $installed_ver = get_option( "flag_db_version" );
24
+
25
+ // v0.31 -> v0.32
26
+ if (version_compare($installed_ver, '0.32', '<')) {
27
+ // add description and previewpic for the ablum itself
28
+ flag_add_sql_column( $wpdb->flagpictures, 'copyright', "TEXT;");
29
+ flag_add_sql_column( $wpdb->flagpictures, 'credit', "TEXT;");
30
+ flag_add_sql_column( $wpdb->flagpictures, 'country', "TINYTEXT;");
31
+ flag_add_sql_column( $wpdb->flagpictures, 'state', "TINYTEXT;");
32
+ flag_add_sql_column( $wpdb->flagpictures, 'city', "TINYTEXT;");
33
+ flag_add_sql_column( $wpdb->flagpictures, 'location', "TEXT;");
34
+ flag_add_sql_column( $wpdb->flagpictures, 'used_ips', "LONGTEXT;");
35
+ flag_add_sql_column( $wpdb->flagpictures, 'total_votes', "INT(11) UNSIGNED DEFAULT '0';");
36
+ flag_add_sql_column( $wpdb->flagpictures, 'total_value', "INT(11) UNSIGNED DEFAULT '0';");
37
+ flag_add_sql_column( $wpdb->flagpictures, 'hitcounter', "INT(11) UNSIGNED DEFAULT '0';");
38
+ flag_add_sql_column( $wpdb->flagpictures, 'commentson', "INT(1) UNSIGNED NOT NULL DEFAULT '1';");
39
+ flag_add_sql_column( $wpdb->flagpictures, 'exclude', "TINYINT NULL DEFAULT '0';");
40
+
41
+ $flag_options = get_option('flag_options');
42
+ $flag_options['skinsDirABS'] = FLAG_ABSPATH . 'skins/';
43
+ $flag_options['skinsDirURL'] = FLAG_URLPATH . 'skins/';
44
+ update_option('flag_options', $flag_options);
45
+ }
46
+ // v0.32 -> v0.40
47
+ if (version_compare($installed_ver, '0.40', '<')) {
48
+ flag_add_sql_column( $wpdb->flagpictures, 'meta_data', "LONGTEXT AFTER used_ips;");
49
+ }
50
+
51
+ // update now the database
52
+ update_option( "flag_db_version", FLAG_DBVERSION );
53
+ echo __('finished', 'flag') . "<br />\n";
54
+ $wpdb->hide_errors();
55
+
56
+ // *** From here we start file operation which could failed sometimes,
57
+ // *** ensure that the DB changes are not performed two times...
58
+
59
+ // On some reason the import / date sometimes failed, due to the memory limit
60
+ if (version_compare($installed_ver, '0.32', '<')) {
61
+ echo __('Import date and time information...', 'flag');
62
+ flag_import_date_time();
63
+ echo __('finished', 'flag') . "<br />\n";
64
+ }
65
+
66
+ if (version_compare($installed_ver, '1.20', '<')) {
67
+ echo __('Adding new options to database...', 'flag');
68
+ $flag_options = get_option('flag_options');
69
+ // Alternative gallery colors
70
+ $flag_options['jAlterGal'] = true;
71
+ $flag_options['BarsBG'] = '292929';
72
+ $flag_options['CatBGColor'] = '292929';
73
+ $flag_options['CatBGColorOver'] = '737373';
74
+ $flag_options['CatColor'] = 'ffffff';
75
+ $flag_options['CatColorOver'] = 'ffffff';
76
+ $flag_options['ThumbBG'] = 'ffffff';
77
+ $flag_options['ThumbLoaderColor'] = '4a4a4a';
78
+ $flag_options['TitleColor'] = 'ff9900';
79
+ $flag_options['DescrColor'] = 'cfcfcf';
80
+ update_option('flag_options', $flag_options);
81
+ echo __('finished', 'flag') . "<br />\n";
82
+ }
83
+ if (version_compare($installed_ver, '1.22', '<')) {
84
+ echo __('Adding new options to database...', 'flag');
85
+ $flag_options = get_option('flag_options');
86
+ $flag_options['videoBG'] = '000000';
87
+ $flag_options['vmColor1'] = 'ffffff';
88
+ $flag_options['vmColor2'] = '3283A7';
89
+ $flag_options['vmAutoplay'] = 'true';
90
+ $flag_options['vmWidth'] = '520';
91
+ $flag_options['vmHeight'] = '304';
92
+ update_option('flag_options', $flag_options);
93
+ echo __('finished', 'flag') . "<br />\n";
94
+ }
95
+ if (version_compare($installed_ver, '1.24', '<')) {
96
+ echo __('Adding new options to database...', 'flag');
97
+ $flag_options = get_option('flag_options');
98
+ $flag_options['mpBG'] = '000000';
99
+ $flag_options['mpColor1'] = 'ffffff';
100
+ $flag_options['mpColor2'] = '3283A7';
101
+ update_option('flag_options', $flag_options);
102
+ echo __('finished', 'flag') . "<br />\n";
103
+ }
104
+ return;
105
+ }
106
+ }
107
+
108
+
109
+ /**
110
+ * flag_import_date_time() - Read the timestamp from exif and insert it into the database
111
+ *
112
+ * @return void
113
+ */
114
+ function flag_import_date_time() {
115
+ global $wpdb;
116
+
117
+ $imagelist = $wpdb->get_results("SELECT t.*, tt.* FROM $wpdb->flaggallery AS t INNER JOIN $wpdb->flagpictures AS tt ON t.gid = tt.galleryid ORDER BY tt.pid ASC");
118
+ if ( is_array($imagelist) ) {
119
+ foreach ($imagelist as $image) {
120
+ $picture = new flagImage($image);
121
+ $meta = new flagMeta($picture->imagePath, true);
122
+ $date = $meta->get_date_time();
123
+ $wpdb->query("UPDATE $wpdb->flagpictures SET imagedate = '$date' WHERE pid = '$picture->pid'");
124
+ }
125
+ }
126
+ }
127
+
128
+ /**
129
+ * Adding a new column if needed
130
+ * Example : flag_add_sql_column( $wpdb->flagpictures, 'imagedate', "DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00' AFTER alttext");
131
+ *
132
+ * @param string $table_name Database table name.
133
+ * @param string $column_name Database column name to create.
134
+ * @param string $create_ddl SQL statement to create column
135
+ * @return bool True, when done with execution.
136
+ */
137
+ function flag_add_sql_column($table_name, $column_name, $create_ddl) {
138
+ global $wpdb;
139
+
140
+ foreach ($wpdb->get_col("SHOW COLUMNS FROM $table_name") as $column ) {
141
+ if ($column == $column_name)
142
+ return true;
143
+ }
144
+
145
+ //didn't find it try to create it.
146
+ $wpdb->query("ALTER TABLE $table_name ADD COLUMN $column_name " . $create_ddl);
147
+
148
+ // we cannot directly tell that whether this succeeded!
149
+ foreach ($wpdb->get_col("SHOW COLUMNS FROM $table_name") as $column ) {
150
+ if ($column == $column_name)
151
+ return true;
152
+ }
153
+
154
+ echo("Could not add column $column_name in table $table_name<br />\n");
155
+ return false;
156
+ }
157
+
158
+ /**
159
+ * flag_upgrade_page() - This page showsup , when the database version doesn't fir to the script FLAG_DBVERSION constant.
160
+ *
161
+ * @return Upgrade Message
162
+ */
163
+ function flag_upgrade_page() {
164
+ $filepath = admin_url() . 'admin.php?page=' . $_GET['page'];
165
+
166
+ if ($_GET['upgrade'] == 'now') {
167
+ flag_start_upgrade($filepath);
168
+ return;
169
+ }
170
+ ?>
171
+ <div class="wrap">
172
+ <h2><?php _e('Upgrade GRAND FlAGallery', 'flag'); ?></h2>
173
+ <p><?php _e('The script detect that you upgrade from a older version.', 'flag'); ?>
174
+ <?php _e('Your database tables for GRAND FlAGallery is out-of-date, and must be upgraded before you can continue.', 'flag'); ?>
175
+ <?php _e('If you would like to downgrade later, please make first a complete backup of your database and the images.', 'flag'); ?></p>
176
+ <p><?php _e('The upgrade process may take a while, so please be patient.', 'flag'); ?></p>
177
+ <h3><a href="<?php echo $filepath; ?>&amp;upgrade=now"><?php _e('Start upgrade now', 'flag'); ?>...</a></h3>
178
+ </div>
179
+ <?php
180
+ }
181
+
182
+ /**
183
+ * flag_start_upgrade() - Proceed the upgrade routine
184
+ *
185
+ * @param mixed $filepath
186
+ * @return void
187
+ */
188
+ function flag_start_upgrade($filepath) {
189
+ ?>
190
+ <div class="wrap">
191
+ <h2><?php _e('Upgrade GRAND FlAGallery', 'flag'); ?></h2>
192
+ <p><?php flag_upgrade(); ?></p>
193
+ <p><?php _e('Upgrade sucessful', 'flag'); ?></p>
194
+ <h3><a href="<?php echo $filepath; ?>"><?php _e('Continue', 'flag'); ?>...</a></h3>
195
+ </div>
196
+ <?php
197
+ }
198
+ ?>
admin/upload.php ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Accepts file uploads from swfupload.
4
+ *
5
+ */
6
+ define('WP_ADMIN', true);
7
+
8
+ // look up for the path
9
+ require_once( dirname( dirname(__FILE__) ) . '/flag-config.php');
10
+
11
+ // Flash often fails to send cookies with the POST or upload, so we need to pass it in GET or POST instead
12
+ if ( is_ssl() && empty($_COOKIE[SECURE_AUTH_COOKIE]) && !empty($_REQUEST['auth_cookie']) )
13
+ $_COOKIE[SECURE_AUTH_COOKIE] = $_REQUEST['auth_cookie'];
14
+ elseif ( empty($_COOKIE[AUTH_COOKIE]) && !empty($_REQUEST['auth_cookie']) )
15
+ $_COOKIE[AUTH_COOKIE] = $_REQUEST['auth_cookie'];
16
+ if ( empty($_COOKIE[LOGGED_IN_COOKIE]) && !empty($_REQUEST['logged_in_cookie']) )
17
+ $_COOKIE[LOGGED_IN_COOKIE] = $_REQUEST['logged_in_cookie'];
18
+ // don't ask me why, sometimes needed, taken from wp core
19
+ unset($current_user);
20
+
21
+ // admin.php require a proper login cookie
22
+ require_once(ABSPATH . '/wp-admin/admin.php');
23
+
24
+ header('Content-Type: text/plain; charset=' . get_option('blog_charset'));
25
+
26
+ //check for correct capability
27
+ if ( !is_user_logged_in() )
28
+ die('Login failure. -1');
29
+
30
+ //check for correct capability
31
+ if ( !current_user_can('FlAG Upload images') )
32
+ die('You do not have permission to upload files. -2');
33
+
34
+ //check for correct nonce
35
+ check_admin_referer('flag_swfupload');
36
+
37
+ //check for flag
38
+ if ( !defined('FLAG_ABSPATH') )
39
+ die('FlAG Gallery not available. -3');
40
+
41
+ include_once (FLAG_ABSPATH. 'admin/functions.php');
42
+
43
+ // get the gallery
44
+ $galleryID = (int) $_POST['galleryselect'];
45
+
46
+ echo flagAdmin::swfupload_image($galleryID);
47
+
48
+ ?>
admin/video-box.php ADDED
@@ -0,0 +1,440 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You are not allowed to call this page directly.'); }
4
+
5
+ // check for correct capability
6
+ if ( !is_user_logged_in() )
7
+ die('-1');
8
+
9
+ // check for correct FlAG capability
10
+ if ( !current_user_can('FlAG Manage video') )
11
+ die('-1');
12
+
13
+
14
+ require_once (dirname (__FILE__) . '/functions.php');
15
+ require_once (dirname (__FILE__) . '/video.functions.php');
16
+
17
+ function flag_video_controler() {
18
+ if ($_POST['importfolder']){
19
+ check_admin_referer('flag_addvideo');
20
+ $videofolder = $_POST['videofolder'];
21
+ if ( !empty($videofolder) )
22
+ flagAdmin::import_video($videofolder);
23
+ }
24
+ $mode = isset($_REQUEST['mode'])? $_REQUEST['mode'] : 'main';
25
+ $action = isset($_REQUEST['bulkaction'])? $_REQUEST['bulkaction'] : false;
26
+ if($action == 'no_action') {
27
+ $action = false;
28
+ }
29
+ switch($mode) {
30
+ case 'sort':
31
+ include_once (dirname (__FILE__) . '/video-sort.php');
32
+ flag_v_playlist_order($_GET['playlist']);
33
+ break;
34
+ case 'edit':
35
+ if(isset($_POST['updatePlaylist'])) {
36
+ $title = $_POST['playlist_title'];
37
+ $descr = $_POST['playlist_descr'];
38
+ $file = $_GET['playlist'];
39
+ foreach($_POST['item_a'] as $item_id => $item) {
40
+ if($action=='delete_items' && in_array($item_id, $_POST['doaction']))
41
+ continue;
42
+ $data[] = $item_id;
43
+ }
44
+ flagGallery::flagSaveWpMedia();
45
+ flagSave_vPlaylist($title,$descr,$data,$file);
46
+ }
47
+ if(isset($_POST['updatePlaylistSkin'])) {
48
+ $file = $_GET['playlist'];
49
+ flagSave_vPlaylistSkin($file);
50
+ }
51
+ include_once (dirname (__FILE__) . '/manage-video.php');
52
+ flag_v_playlist_edit($_GET['playlist']);
53
+ break;
54
+ case 'save':
55
+ $title = $_POST['playlist_title'];
56
+ $descr = $_POST['playlist_descr'];
57
+ $data = $_POST['items_array'];
58
+ $file = isset($_REQUEST['playlist'])? $_REQUEST['playlist'] : false;
59
+ flagGallery::flagSaveWpMedia();
60
+ flagSave_vPlaylist($title,$descr,$data, $file);
61
+ if(isset($_GET['playlist'])) {
62
+ include_once (dirname (__FILE__) . '/manage-video.php');
63
+ flag_v_playlist_edit($_GET['playlist']);
64
+ } else {
65
+ flag_created_v_playlists();
66
+ flag_video_wp_media_lib();
67
+ }
68
+ break;
69
+ case 'add':
70
+ $added = $_POST['items'];
71
+ flag_video_wp_media_lib($added);
72
+ break;
73
+ case 'delete':
74
+ flag_v_playlist_delete($_GET['playlist']);
75
+ case 'main':
76
+ if(isset($_POST['updateMedia'])) {
77
+ flagGallery::flagSaveWpMedia();
78
+ flagGallery::show_message( __('Media updated','flag') );
79
+ }
80
+ default:
81
+ flag_created_v_playlists();
82
+ flag_video_wp_media_lib();
83
+ break;
84
+ }
85
+
86
+ }
87
+
88
+ function flag_created_v_playlists() {
89
+
90
+ // same as $_SERVER['REQUEST_URI'], but should work under IIS 6.0
91
+ $filepath = admin_url() . 'admin.php?page=' . $_GET['page'];
92
+
93
+ $all_playlists = get_v_playlists();
94
+ $total_all_playlists = count($all_playlists);
95
+ $flag_options = get_option ('flag_options');
96
+
97
+ ?>
98
+ <div class="wrap">
99
+ <h2><?php _e('Created playlists', 'flag'); ?></h2>
100
+ <table class="widefat" cellspacing="0">
101
+ <thead>
102
+ <tr>
103
+ <th scope="col" width="25%"><?php _e('Title', 'flag'); ?></th>
104
+ <th scope="col" width="55%"><?php _e('Description', 'flag'); ?></th>
105
+ <th scope="col" ><?php _e('Quantity', 'flag'); ?></th>
106
+ <th scope="col" ><?php _e('Shortcode', 'flag'); ?></th>
107
+ <th scope="col" ><?php _e('Action', 'flag'); ?></th>
108
+ </tr>
109
+ </thead>
110
+ <tbody>
111
+ <?php
112
+ if($all_playlists) {
113
+ foreach((array)$all_playlists as $playlist_file => $playlist_data) {
114
+ $query_m = get_posts(array('post_type' => 'attachment', 'numberposts' => -1, 'post_status' => null, 'post_parent' => null, 'post__in' => $playlist_data['items']));
115
+ $class = ( !isset($class) || $class == 'class="alternate"' ) ? '' : 'class="alternate"';
116
+ $playlist_name = basename($playlist_file, '.xml');
117
+ if(count($query_m) != count($playlist_data['items'])) {
118
+ flagSave_vPlaylist($playlist_data['title'],$playlist_data['description'],$playlist_data['items'],$playlist_name);
119
+ }
120
+ ?>
121
+ <tr id="<?php echo $playlist_name; ?>" <?php echo $class; ?> >
122
+ <td>
123
+ <a href="<?php echo $filepath.'&amp;playlist='.$playlist_name.'&amp;mode=edit'; ?>" class='edit' title="<?php _e('Edit'); ?>" >
124
+ <?php echo $playlist_data['title']; ?>
125
+ </a>
126
+ </td>
127
+ <td><?php echo $playlist_data['description']; echo '&nbsp;('.__("player", "flag").': <strong>'.$playlist_data['skin'].'</strong>)' ?></td>
128
+ <td><?php echo count($query_m); ?></td>
129
+ <td style="white-space: nowrap;"><input type="text" class="shortcode1" style="width: 200px; font-size: 9px;" readonly="readonly" onfocus="this.select()" value="[grandvideo playlist=<?php echo $playlist_name; ?>]" /></td>
130
+ <td>
131
+ <a href="<?php echo $filepath.'&amp;playlist='.$playlist_name."&amp;mode=delete"; ?>" class="delete" onclick="javascript:check=confirm( '<?php _e("Delete this playlist?",'flag')?>');if(check==false) return false;"><?php _e('Delete','flag'); ?></a>
132
+ </td>
133
+ </tr>
134
+ <?php
135
+ }
136
+ } else {
137
+ echo '<tr><td colspan="5" align="center"><strong>'.__('No playlists found','flag').'</strong></td></tr>';
138
+ }
139
+ ?>
140
+ </tbody>
141
+ </table>
142
+ </div>
143
+
144
+ <?php } ?>
145
+
146
+ <?php // *** show media list
147
+ function flag_video_wp_media_lib($added=false) {
148
+ global $wpdb;
149
+ // same as $_SERVER['REQUEST_URI'], but should work under IIS 6.0
150
+ $filepath = admin_url() . 'admin.php?page=' . $_GET['page'];
151
+ if($added!==false) {
152
+ $filepath .= '&amp;playlist='.$_GET['playlist'].'&amp;mode=save';
153
+ $flag_options = get_option('flag_options');
154
+ $playlistPath = $flag_options['galleryPath'].'playlists/video/'.$_GET['playlist'].'.xml';
155
+ $playlist = get_v_playlist_data(ABSPATH.$playlistPath);
156
+ $exclude = explode(',', $added);
157
+ }
158
+ ?>
159
+ <script type="text/javascript">
160
+ <!--
161
+ jQuery(document).ready(function(){
162
+ jQuery('.cb :checkbox').click(function() {
163
+ if(jQuery(this).is(':checked')){
164
+ var cur = jQuery(this).val();
165
+ var arr = jQuery('#items_array').val();
166
+ if(arr) { var del = ','; } else { var del = ''; }
167
+ jQuery('#items_array').val(arr+del+cur);
168
+ } else {
169
+ var cur = jQuery(this).val();
170
+ var arr = jQuery('#items_array').val().split(',');
171
+ arr = jQuery.grep(arr, function(a){ return a != cur; }).join(',');
172
+ jQuery('#items_array').val(arr);
173
+ };
174
+ });
175
+ jQuery('.del_thumb').click(function(){
176
+ var id = jQuery(this).attr('data-id');
177
+ jQuery('#flvthumb-'+id).attr('value', '');
178
+ jQuery('#thumb-'+id).attr('src', '<?php echo site_url()."/wp-includes/images/crystal/video.png"; ?>');
179
+ return false;
180
+ })
181
+ });
182
+ function checkAll(form) {
183
+ for (i = 0, n = form.elements.length; i < n; i++) {
184
+ if(form.elements[i].type == "checkbox") {
185
+ if(form.elements[i].name == "doaction[]") {
186
+ if(form.elements[i].checked == true)
187
+ form.elements[i].checked = false;
188
+ else
189
+ form.elements[i].checked = true;
190
+ }
191
+ }
192
+ }
193
+ var arr = jQuery('.cb input:checked').map(function(){return jQuery(this).val();}).get().join(',');
194
+ jQuery('#items_array').val(arr);
195
+ }
196
+ // this function check for a the number of selected images, sumbmit false when no one selected
197
+ function checkSelected() {
198
+ if(!jQuery('.cb input:checked')) {
199
+ alert('<?php echo js_escape(__('No items selected', 'flag')); ?>');
200
+ return false;
201
+ }
202
+ actionId = jQuery('#bulkaction').val();
203
+ switch (actionId) {
204
+ case "new_playlist":
205
+ showDialog('new_playlist', 160);
206
+ return false;
207
+ break;
208
+ case "add_to_playlist":
209
+ return confirm('<?php echo sprintf(js_escape(__("You are about to add %s items to playlist \n \n 'Cancel' to stop, 'OK' to proceed.",'flag')), "' + numchecked + '") ; ?>');
210
+ break;
211
+ }
212
+ return confirm('<?php echo sprintf(js_escape(__("You are about to start the bulk edit for %s items \n \n 'Cancel' to stop, 'OK' to proceed.",'flag')), "' + numchecked + '") ; ?>');
213
+ }
214
+
215
+ function showDialog( windowId, height ) {
216
+ jQuery("#" + windowId + "_bulkaction").val(jQuery("#bulkaction").val());
217
+ jQuery("#" + windowId + "_flvid").val(jQuery('#items_array').val());
218
+ tb_show("", "#TB_inline?width=640&height=" + height + "&inlineId=" + windowId + "&modal=true", false);
219
+ }
220
+ var current_image = '';
221
+ function send_to_editor(html) {
222
+ var source = html.match(/src=\".*\" alt/);
223
+ source = source[0].replace(/^src=\"/, "").replace(/" alt$/, "");
224
+ jQuery('#flvthumb-'+actInp).attr('value', source);
225
+ jQuery('#thumb-'+actInp).attr('src', source);
226
+ tb_remove();
227
+ }
228
+ //-->
229
+ </script>
230
+ <div class="wrap">
231
+
232
+ <?php if( current_user_can('FlAG Import folder') ) {
233
+ $defaultpath = 'wp-content/';
234
+ ?>
235
+ <link rel="stylesheet" type="text/css" href="<?php echo FLAG_URLPATH; ?>admin/js/jqueryFileTree/jqueryFileTree.css" />
236
+ <script type="text/javascript" src="<?php echo FLAG_URLPATH; ?>admin/js/jqueryFileTree/jqueryFileTree.js"></script>
237
+ <script type="text/javascript">
238
+ /* <![CDATA[ */
239
+ jQuery(function() {
240
+ jQuery("span.browsefiles").show().click(function(){
241
+ jQuery("#file_browser").fileTree({
242
+ script: "admin-ajax.php?action=flag_file_browser&nonce=<?php echo wp_create_nonce( 'flag-ajax' ) ;?>",
243
+ root: jQuery("#videofolder").val(),
244
+ }, function(file) {
245
+ //var path = file.replace("<?php echo WINABSPATH; ?>", "");
246
+ jQuery("#videofolder").val(file);
247
+ });
248
+
249
+ jQuery("#file_browser").show("slide");
250
+ });
251
+ });
252
+ /* ]]> */
253
+ </script>
254
+
255
+ <!-- import folder -->
256
+ <div id="importfolder">
257
+ <h2><?php _e('Import video from folder', 'flag'); ?></h2>
258
+ <form name="importfolder" id="importfolder_form" method="POST" action="<?php echo $filepath; ?>" accept-charset="utf-8" >
259
+ <?php wp_nonce_field('flag_addvideo'); ?>
260
+ <table class="form-table">
261
+ <tr valign="top">
262
+ <th scope="row"><?php _e('Import from Server path:', 'flag'); ?></th>
263
+ <td><input type="text" size="35" id="videofolder" name="videofolder" value="<?php echo $defaultpath; ?>" /><span class="browsefiles button" style="display:none"><?php _e('Browse...',"flag"); ?></span>
264
+ <div id="file_browser"></div><br />
265
+ <p><label><input type="checkbox" name="delete_files" value="delete" checked="checked" /> &nbsp;
266
+ <?php _e('delete files after import in WordPress Media Library','flag'); ?></label></p>
267
+ </td>
268
+ </tr>
269
+ </table>
270
+ <div class="submit"><input class="button-primary" type="submit" name="importfolder" value="<?php _e('Import folder', 'flag'); ?>"/></div>
271
+ </form>
272
+ </div>
273
+ <?php } ?>
274
+
275
+ <h2><?php _e('WordPress Video Library', 'flag'); ?></h2>
276
+ <form id="videolib" class="flagform" method="POST" action="<?php echo $filepath; ?>" accept-charset="utf-8">
277
+ <?php wp_nonce_field('flag_bulkvideo'); ?>
278
+ <input type="hidden" name="page" value="video-box" />
279
+
280
+ <div class="tablenav">
281
+
282
+ <div class="actions">
283
+ <?php if($added===false) { ?>
284
+ <input name="updateMedia" class="button-primary" style="float: right;" type="submit" value="<?php _e('Update Media','flag'); ?>" />
285
+ <?php if ( function_exists('json_encode') ) { ?>
286
+ <select name="bulkaction" id="bulkaction">
287
+ <option value="no_action" ><?php _e("No action",'flag'); ?></option>
288
+ <option value="new_playlist" ><?php _e("Create new playlist",'flag'); ?></option>
289
+ </select>
290
+ <input name="showThickbox" class="button-secondary" type="submit" value="<?php _e('Apply','flag'); ?>" onclick="if ( !checkSelected() ) return false;" />
291
+ <?php } ?>
292
+ <a href="<?php echo admin_url( 'media-new.php'); ?>" class="button"><?php _e('Upload Video','flag'); ?></a>
293
+ <input type="hidden" id="items_array" name="items_array" value="" />
294
+ <?php } else { ?>
295
+ <input type="hidden" name="mode" value="save" />
296
+ <input style="width: 80%;" type="text" id="items_array" name="items_array" value="<?php echo $added; ?>" />
297
+ <input type="hidden" name="playlist_title" value="<?php echo $playlist['title']; ?>" />
298
+ <input type="hidden" name="skinname" value="<?php echo $playlist['skin']; ?>" />
299
+ <input type="hidden" name="skinaction" value="<?php echo $playlist['skin']; ?>" />
300
+ <textarea style="display: none;" name="playlist_descr" cols="40" rows="1"><?php echo $playlist['description']; ?></textarea>
301
+ <input name="addToPlaylist" class="button-secondary" type="submit" value="<?php _e('Update Playlist','flag'); ?>" onclick="if ( !checkSelected() ) return false;" />
302
+ <?php } ?>
303
+ </div>
304
+
305
+ </div>
306
+ <table class="widefat" cellspacing="0">
307
+ <thead>
308
+ <tr>
309
+ <th class="cb" width="54" scope="col"><a href="#" onclick="checkAll(document.getElementById('videolib'));return false;"><?php _e('Check', 'flag'); ?></a></th>
310
+ <th class="id" width="134" scope="col"><div><?php _e('ID', 'flag'); ?></div></th>
311
+ <th class="size" width="75" scope="col"><div><?php _e('Size', 'flag'); ?></div></th>
312
+ <th class="thumb" width="110" scope="col"><div><?php _e('Thumbnail', 'flag'); ?></div></th>
313
+ <th class="title_filename" scope="col"><div><?php _e('Filename / Title', 'flag'); ?></div></th>
314
+ <th class="description" scope="col"><div><?php _e('Description', 'flag'); ?></div></th>
315
+ </tr>
316
+ </thead>
317
+ <tfoot>
318
+ <tr>
319
+ <th class="cb" scope="col"><a href="#" onclick="checkAll(document.getElementById('videolib'));return false;"><?php _e('Check', 'flag'); ?></a></th>
320
+ <th class="id" scope="col"><?php _e('ID', 'flag'); ?></th>
321
+ <th class="size" scope="col"><?php _e('Size', 'flag'); ?></th>
322
+ <th class="thumb" scope="col"><?php _e('Thumbnail', 'flag'); ?></th>
323
+ <th class="title_filename" scope="col"><?php _e('Filename / Title', 'flag'); ?></th>
324
+ <th class="description" scope="col"><?php _e('Description', 'flag'); ?></th>
325
+ </tr>
326
+ </tfoot>
327
+ <tbody>
328
+ <?php $videolist = get_posts( $args = array(
329
+ 'numberposts' => -1,
330
+ 'orderby' => 'ID',
331
+ 'order' => 'DESC',
332
+ 'post_type' => 'attachment',
333
+ 'post_mime_type' => array('video/x-flv') )
334
+ );
335
+ $uploads = wp_upload_dir();
336
+ $flag_options = get_option('flag_options');
337
+ if($videolist) {
338
+ //echo '<pre>';print_r($videolist); echo '</pre>';
339
+ foreach($videolist as $flv) {
340
+ $list[] = $flv->ID;
341
+ }
342
+ $class = ' class="alternate"';
343
+ foreach($videolist as $flv) {
344
+ $class = ( empty($class) ) ? ' class="alternate"' : '';
345
+ $class2 = ( empty($class) ) ? '' : ' alternate';
346
+ $ex = $checked = '';
347
+ if($added!==false && in_array($flv->ID, $exclude) ) {
348
+ $ex = ' style="background-color:#DDFFBB;" title="'.__("Already Added", "flag").'"';
349
+ $checked = ' checked="checked"';
350
+ }
351
+ $bg = ( !isset($class) || $class == 'class="alternate"' ) ? 'f9f9f9' : 'ffffff';
352
+ $thumb = $flvthumb = get_post_meta($flv->ID, 'thumbnail', true);
353
+ if(empty($thumb)) {
354
+ $thumb = site_url().'/wp-includes/images/crystal/video.png';
355
+ $flvthumb = '';
356
+ }
357
+ $url = wp_get_attachment_url($flv->ID);
358
+ ?>
359
+ <tr id="flv-<?php echo $flv->ID; ?>"<?php echo $class.$ex; ?>>
360
+ <th class="cb" scope="row" height="24" style="padding-bottom: 0; border-bottom: none;"><input name="doaction[]" type="checkbox"<?php echo $checked; ?> value="<?php echo $flv->ID; ?>" /></th>
361
+ <td class="id" style="padding-bottom: 0; border-bottom: none;"><p style="margin-bottom: 3px; white-space: nowrap;">ID: <?php echo $flv->ID; ?></p></td>
362
+ <td class="size" style="padding-bottom: 0; border-bottom: none;"><?php
363
+ $path = $uploads['basedir'].str_replace($uploads['baseurl'],'',$url);
364
+ $size = filesize($path);
365
+ if($size){
366
+ echo round($size/1024/1024,2).' Mb';
367
+ } else {
368
+ _e("Can't read file size. Perhaps file is broken.",'flag');
369
+ }
370
+ ?></td>
371
+ <td class="thumb" rowspan="2">
372
+ <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 $thumb; ?>" width="100" height="100" alt="" /></a>
373
+ </td>
374
+ <td class="title_filename" rowspan="2">
375
+ <strong><a href="<?php echo $url; ?>"><?php echo basename($url); ?></a></strong><br />
376
+ <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 $flv->post_title; ?></textarea><br />
377
+ <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 $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>
378
+ </td>
379
+ <td class="description" rowspan="2">
380
+ <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 $flv->post_content; ?></textarea>
381
+ </td>
382
+ </tr>
383
+ <tr class="flv-<?php echo $flv->ID.$class2; ?>"<?php echo $ex; ?>>
384
+ <td valign="top" class="player" colspan="3"><p style="padding: 7px 3px;">Shortcode:<br /><input type="text" style="width: 240px; font-size: 9px;" class="shortcode1" readonly="readonly" onfocus="this.select()" value="[grandflv id=<?php echo $flv->ID; ?> w=<?php echo $flag_options['vmWidth']; ?> h=<?php echo $flag_options['vmHeight']; ?> autoplay=<?php echo $flag_options['vmAutoplay']; ?>]" /></p></td>
385
+ </tr>
386
+ <?php
387
+ }
388
+ } else {
389
+ echo '<tr><td colspan="6" align="center"><strong>'.__('No video in WordPress Media Library.','flag').'</strong></td></tr>';
390
+ }
391
+ ?>
392
+ </tbody>
393
+ </table>
394
+ </form>
395
+ </div>
396
+
397
+ <!-- #new_playlist -->
398
+ <div id="new_playlist" style="display: none;" >
399
+ <form id="form_new_playlist" method="POST" action="<?php echo $filepath; ?>" accept-charset="utf-8">
400
+ <?php wp_nonce_field('flag_thickbox_form'); ?>
401
+ <input type="hidden" id="new_playlist_flvid" name="items_array" value="" />
402
+ <input type="hidden" id="new_playlist_bulkaction" name="TB_bulkaction" value="" />
403
+ <input type="hidden" name="mode" value="save" />
404
+ <input type="hidden" name="page" value="video-box" />
405
+ <table width="100%" border="0" cellspacing="3" cellpadding="3" >
406
+ <tr valign="top">
407
+ <th align="left" style="padding-top: 5px;"><?php _e('Playlist Title','flag'); ?></th>
408
+ <td><input type="text" class="alignleft" name="playlist_title" value="" />
409
+ <div class="alignright"><strong><?php _e("Choose skin", 'flag'); ?>:</strong>
410
+ <select id="skinname" name="skinname" style="width: 200px; height: 24px; font-size: 11px;">
411
+ <?php require_once (dirname(__FILE__) . '/get_skin.php');
412
+ $all_skins = get_skins($skin_folder='', $type='v');
413
+ if(count($all_skins)) {
414
+ foreach ( (array)$all_skins as $skin_file => $skin_data) {
415
+ echo '<option value="'.dirname($skin_file).'">'.$skin_data['Name'].'</option>'."\n";
416
+ }
417
+ } else {
418
+ echo '<option value="video_default">'.__("No Skins", "flag").'</option>';
419
+ }
420
+ ?>
421
+ </select>
422
+ </div>
423
+ </td>
424
+ </tr>
425
+ <tr valign="top">
426
+ <th align="left" style="padding-top: 5px;"><?php _e('Playlist Description','flag'); ?></th>
427
+ <td><textarea style="width:100%;" rows="3" cols="60" name="playlist_descr"></textarea></td>
428
+ </tr>
429
+ <tr>
430
+ <td>&nbsp;</td>
431
+ <td align="right"><input class="button-secondary" type="reset" value="&nbsp;<?php _e('Cancel', 'flag'); ?>&nbsp;" onclick="tb_remove()"/>
432
+ &nbsp; &nbsp; &nbsp;
433
+ <input class="button-primary " type="submit" name="TB_NewPlaylist" value="<?php _e('OK', 'flag'); ?>" />
434
+ </td>
435
+ </tr>
436
+ </table>
437
+ </form>
438
+ </div>
439
+ <!-- /#new_playlist -->
440
+ <?php } ?>
admin/video-sort.php ADDED
@@ -0,0 +1,120 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * @author Sergey Pasyuk
5
+ * @copyright 2009
6
+ */
7
+
8
+ function flag_v_playlist_order($playlist){
9
+ global $wpdb;
10
+
11
+ //this is the url without any presort variable
12
+ $base_url = admin_url() . 'admin.php?page=' . $_GET['page'];
13
+ $flag_options = get_option('flag_options');
14
+ $playlistPath = $flag_options['galleryPath'].'playlists/video/'.$_GET['playlist'].'.xml';
15
+ $playlist = get_v_playlist_data(ABSPATH.$playlistPath);
16
+ $items_a = $playlist['items'];
17
+ $items = implode(',',$playlist['items']);
18
+ ?>
19
+ <script type="text/javascript" src="<?php echo FLAG_URLPATH; ?>admin/js/jquery.tablednd_0_5.js"></script>
20
+ <script type="text/javascript" src="<?php echo FLAG_URLPATH; ?>admin/js/jquery.tablesorter.js"></script>
21
+ <div class="wrap">
22
+ <h2><?php _e('Sort Gallery', 'flag'); ?></h2>
23
+
24
+ <div class="alignright tablenav" style="margin-bottom: -36px;">
25
+ <a href="<?php echo $base_url.'&amp;playlist='.$_GET['playlist'].'&amp;mode=edit'; ?>" class="button-secondary action"><?php _e('Back to playlist', 'flag'); ?></a>
26
+ </div>
27
+ <form id="sortPlaylist" method="POST" action="<?php echo $base_url.'&amp;playlist='.$_GET['playlist'].'&amp;mode=edit'; ?>" accept-charset="utf-8">
28
+ <div class="alignleft tablenav">
29
+ <?php wp_nonce_field('flag_updatesortorder'); ?>
30
+ <input class="button-primary action" type="submit" name="updatePlaylist" value="<?php _e('Update Sort Order', 'flag'); ?>" />
31
+ </div>
32
+ <br clear="all" />
33
+ <input type="hidden" name="playlist_title" value="<?php echo $playlist['title']; ?>" />
34
+ <input type="hidden" name="skinname" value="<?php echo $playlist['skin']; ?>" />
35
+ <input type="hidden" name="skinaction" value="<?php echo $playlist['skin']; ?>" />
36
+ <textarea style="display: none;" name="playlist_descr" cols="40" rows="1"><?php echo $playlist['description']; ?></textarea>
37
+ <script type="text/javascript">
38
+ /*<![CDATA[*/
39
+ jQuery(document).ready(function($) {
40
+ // Initialise the table
41
+ jQuery("#listitems").tableDnD({
42
+ onDragClass: "myDragClass",
43
+ onDrop: function() {
44
+ jQuery("#listitems tr:even").addClass('alternate');
45
+ jQuery("#listitems tr:odd").removeClass('alternate');
46
+ }
47
+ });
48
+ $("#flag-listitems").tablesorter({
49
+ // pass the headers argument and assing a object
50
+ headers: {
51
+ // assign the secound column (we start counting zero)
52
+ 1: {
53
+ // disable it by setting the property sorter to false
54
+ sorter: false
55
+ }
56
+ }
57
+ });
58
+ $("#flag-listitems").bind("sortEnd",function() {
59
+ jQuery("#listitems tr:even").addClass('alternate');
60
+ jQuery("#listitems tr:odd").removeClass('alternate');
61
+ });
62
+
63
+ });
64
+ /*]]>*/
65
+ </script>
66
+ <table id="flag-listitems" class="widefat fixed" cellspacing="0" >
67
+
68
+ <thead>
69
+ <tr>
70
+ <th class="header" width="54"><p style="margin-right:-10px;"><?php _e('ID', 'flag'); ?></p></th>
71
+ <th width="260"><div><?php _e('Play', 'flag'); ?></div></th>
72
+ <th class="header"><p><?php _e('Filename', 'flag'); ?></p></th>
73
+ <th class="header"><p><?php _e('Title', 'flag'); ?></p></th>
74
+ </tr>
75
+ </thead>
76
+ <tfoot>
77
+ <tr>
78
+ <th><?php _e('ID', 'flag'); ?></th>
79
+ <th><?php _e('Play', 'flag'); ?></th>
80
+ <th><?php _e('Filename', 'flag'); ?></th>
81
+ <th><?php _e('Title', 'flag'); ?></th>
82
+ </tr>
83
+ </tfoot>
84
+ <tbody id="listitems">
85
+ <?php
86
+ if(count($items_a)) {
87
+ $counter = 0;
88
+ foreach($items_a as $item) {
89
+ $flv = get_post($item);
90
+ $thumb = get_post_meta($item, 'thumbnail', true);
91
+ if(empty($thumb)) {
92
+ $thumb = site_url().'/wp-includes/images/crystal/video.png';
93
+ }
94
+ $alternate = ( !isset($alternate) || $alternate == 'alternate' ) ? '' : 'alternate';
95
+ $counter++;
96
+ $bg = ( !isset($alternate) || $alternate == 'alternate' ) ? 'f9f9f9' : 'ffffff';
97
+ $url = wp_get_attachment_url($flv->ID);
98
+ ?>
99
+ <tr id="$flv-<?php echo $flv->ID; ?>" class="<?php echo $alternate; ?> iedit" valign="top">
100
+ <td scope="row"><input type="hidden" name="item_a[<?php echo $flv->ID; ?>][ID]" value="<?php echo $flv->ID; ?>" /><strong><?php echo $flv->ID; ?></strong></td>
101
+ <td width="50"><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 $thumb; ?>" width="20" height="20" alt="" /></a></td>
102
+ <td><?php echo basename($url); ?></td>
103
+ <td><?php echo $flv->post_title; ?></td>
104
+ </tr>
105
+ <?php
106
+ }
107
+ } else {
108
+ echo '<tr><td colspan="4" align="center"><strong>'.__('No entries found','flag').'</strong></td></tr>';
109
+ }
110
+ ?>
111
+ </tbody>
112
+ </table>
113
+ <p class="actions"><input type="submit" class="button-primary action" name="updatePlaylist" value="<?php _e('Update Sort Order', 'flag'); ?>" /></p>
114
+ </form>
115
+ <br class="clear"/>
116
+ </div><!-- /#wrap -->
117
+
118
+ <?php
119
+ }
120
+ ?>
admin/video.functions.php ADDED
@@ -0,0 +1,149 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You are not allowed to call this page directly.'); }
3
+
4
+ function get_v_playlist_data( $playlist_file ) {
5
+ global $wpdb;
6
+ $playlist_content = file_get_contents($playlist_file);
7
+
8
+ $playlist_data['title'] = flagGallery::flagGetBetween($playlist_content,'<title><![CDATA[',']]></title>');
9
+ $playlist_data['skin'] = flagGallery::flagGetBetween($playlist_content,'<skin><![CDATA[',']]></skin>');
10
+ $playlist_data['width'] = flagGallery::flagGetBetween($playlist_content,'<width><![CDATA[',']]></width>');
11
+ $playlist_data['height'] = flagGallery::flagGetBetween($playlist_content,'<height><![CDATA[',']]></height>');
12
+ $playlist_data['description'] = flagGallery::flagGetBetween($playlist_content,'<description><![CDATA[',']]></description>');
13
+ preg_match_all( '|<item id="(.*)">|', $playlist_content, $items );
14
+ $playlist_data['items'] = $items[1];
15
+ return $playlist_data;
16
+ }
17
+
18
+ /**
19
+ * Check the playlists directory and retrieve all playlist files with playlist data.
20
+ *
21
+ */
22
+ function get_v_playlists($playlist_folder = '') {
23
+
24
+ $flag_options = get_option('flag_options');
25
+ $flag_playlists = array ();
26
+ $playlist_root = ABSPATH.$flag_options['galleryPath'].'playlists/video';
27
+ if( !empty($playlist_folder) )
28
+ $playlist_root = $playlist_folder;
29
+
30
+ // Files in flagallery/playlists directory
31
+ $playlists_dir = @ opendir( $playlist_root);
32
+ $playlist_files = array();
33
+ if ( $playlists_dir ) {
34
+ while (($file = readdir( $playlists_dir ) ) !== false ) {
35
+ if ( substr($file, 0, 1) == '.' )
36
+ continue;
37
+ if ( substr($file, -4) == '.xml' )
38
+ $playlist_files[] = $file;
39
+ }
40
+ }
41
+ @closedir( $playlists_dir );
42
+
43
+ if ( !$playlists_dir || empty($playlist_files) )
44
+ return $flag_playlists;
45
+
46
+ foreach ( $playlist_files as $playlist_file ) {
47
+ if ( !is_readable( "$playlist_root/$playlist_file" ) )
48
+ continue;
49
+
50
+ $playlist_data = get_v_playlist_data( "$playlist_root/$playlist_file" );
51
+
52
+ if ( empty ( $playlist_data['title'] ) )
53
+ continue;
54
+
55
+ $flag_playlists[basename( $playlist_file, ".xml" )] = $playlist_data;
56
+ }
57
+ uasort( $flag_playlists, create_function( '$a, $b', 'return strnatcasecmp( $a["title"], $b["title"] );' ));
58
+
59
+ return $flag_playlists;
60
+ }
61
+
62
+ function flagSave_vPlaylist($title,$descr,$data,$file='',$skinaction='') {
63
+ global $wpdb;
64
+ if(!trim($title)) {
65
+ $title = 'default';
66
+ }
67
+ if (!$file) {
68
+ $file = sanitize_title($title);
69
+ }
70
+
71
+ if(!is_array($data))
72
+ $data = explode(',', $data);
73
+
74
+ $flag_options = get_option('flag_options');
75
+ $skin = isset($_POST['skinname'])? $_POST['skinname'] : 'video_default';
76
+ if(empty($skinaction))
77
+ $skinaction = isset($_POST['skinaction'])? $_POST['skinaction'] : 'update';
78
+ $skinpath = trailingslashit( $flag_options['skinsDirABS'] ).$skin;
79
+ $playlistPath = ABSPATH.$flag_options['galleryPath'].'playlists/video/'.$file.'.xml';
80
+ if( file_exists($playlistPath) && ($skin == $skinaction) ) {
81
+ $settings = file_get_contents($playlistPath);
82
+ } else {
83
+ $settings = file_get_contents($skinpath . "/settings/settings.xml");
84
+ }
85
+ $properties = flagGallery::flagGetBetween($settings,'<properties>','</properties>');
86
+
87
+ if(count($data)) {
88
+ $content = '<gallery>
89
+ <properties>'.$properties.'</properties>
90
+ <category id="'.$file.'">
91
+ <properties>
92
+ <title><![CDATA['.$title.']]></title>
93
+ <description><![CDATA['.$descr.']]></description>
94
+ <skin><![CDATA['.$skin.']]></skin>
95
+ </properties>
96
+ <items>';
97
+
98
+ foreach( (array) $data as $id) {
99
+ $flv = get_post($id);
100
+ if( in_array( $flv->post_mime_type, array('video/x-flv') ) ) {
101
+ $thumb = get_post_meta($id, 'thumbnail', true);
102
+ $content .= '
103
+ <item id="'.$flv->ID.'">
104
+ <track>'.wp_get_attachment_url($flv->ID).'</track>
105
+ <title><![CDATA['.$flv->post_title.']]></title>
106
+ <description><![CDATA['.$flv->post_content.']]></description>
107
+ <thumbnail>'.$thumb.'</thumbnail>
108
+ </item>';
109
+ }
110
+ }
111
+ $content .= '
112
+ </items>
113
+ </category>
114
+ </gallery>';
115
+ // Save options
116
+ $flag_options = get_option('flag_options');
117
+ if(wp_mkdir_p(ABSPATH.$flag_options['galleryPath'].'playlists/video/')) {
118
+ if( flagGallery::saveFile($playlistPath,$content,'w') ){
119
+ flagGallery::show_message(__('Playlist Saved Successfully','flag'));
120
+ }
121
+ } else {
122
+ flagGallery::show_message(__('Create directory please:','flag').'"/'.$flag_options['galleryPath'].'playlists/video/"');
123
+ }
124
+ }
125
+ }
126
+
127
+ function flagSave_vPlaylistSkin($file) {
128
+ global $wpdb;
129
+ $flag_options = get_option('flag_options');
130
+ $playlistPath = ABSPATH.$flag_options['galleryPath'].'playlists/video/'.$file.'.xml';
131
+ // Save options
132
+ $title = $_POST['playlist_title'];
133
+ $descr = $_POST['playlist_descr'];
134
+ $items = get_v_playlist_data($playlistPath);
135
+ $data = $items['items'];
136
+ flagSave_vPlaylist($title,$descr,$data,$file,$skinaction='update');
137
+ }
138
+
139
+ function flag_v_playlist_delete($playlist) {
140
+ $flag_options = get_option('flag_options');
141
+ $playlistXML = ABSPATH.$flag_options['galleryPath'].'playlists/video/'.$playlist.'.xml';
142
+ if(file_exists($playlistXML)){
143
+ if(unlink($playlistXML)) {
144
+ flagGallery::show_message("'".$playlist.".xml' ".__('deleted','flag'));
145
+ }
146
+ }
147
+ }
148
+
149
+ ?>
admin/wpmu.php ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You are not allowed to call this page directly.'); }
3
+
4
+ function flag_wpmu_setup() {
5
+ global $wpdb;
6
+
7
+ //to be sure
8
+ if (!is_site_admin())
9
+ die('You are not allowed to call this page.');
10
+
11
+ // get the options
12
+ $flag_options = get_site_option('flag_options');
13
+
14
+ // same as $_SERVER['REQUEST_URI'], but should work under IIS 6.0
15
+ $filepath = site_url( 'wp-admin/wpmu-admin.php?page=' . $_GET['page'], 'admin' );
16
+
17
+ if ( isset($_POST['updateoption']) ) {
18
+ check_admin_referer('flag_wpmu_settings');
19
+ // get the hidden option fields, taken from WP core
20
+ if ( $_POST['page_options'] )
21
+ $options = explode(',', stripslashes($_POST['page_options']));
22
+ if ($options) {
23
+ foreach ($options as $option) {
24
+ $option = trim($option);
25
+ $value = trim($_POST[$option]);
26
+ // $value = sanitize_option($option, $value); // This does strip slashes on those that need it
27
+ $flag_options[$option] = $value;
28
+ }
29
+ }
30
+
31
+ update_site_option('flag_options', $flag_options);
32
+ $messagetext = __('Update successfully','flag');
33
+ }
34
+
35
+ // message windows
36
+ if(!empty($messagetext)) { echo '<!-- Last Action --><div id="message" class="updated fade"><p>'.$messagetext.'</p></div>'; }
37
+
38
+ ?>
39
+
40
+ <div class="wrap">
41
+ <h2><?php _e('General WordPress MU Settings','flag'); ?></h2>
42
+ <form name="generaloptions" method="post">
43
+ <?php wp_nonce_field('flag_wpmu_settings'); ?>
44
+ <input type="hidden" name="page_options" value="gallerypath,wpmuQuotaCheck,wpmuRoles" />
45
+ <table class="form-table">
46
+ <tr valign="top">
47
+ <th align="left"><?php _e('Gallery path','flag'); ?></th>
48
+ <td><input type="text" size="50" name="gallerypath" value="<?php echo $flag_options[gallerypath]; ?>" title="TEST" /><br />
49
+ <?php _e('This is the default path for all blogs. With the placeholder %BLOG_ID% you can organize the folder structure better. The path must end with a /.','flag'); ?></td>
50
+ </tr>
51
+ <tr>
52
+ <th valign="top"><?php _e('Enable upload quota check','flag'); ?>:</th>
53
+ <td><input name="wpmuQuotaCheck" type="checkbox" value="1" <?php checked('1', $flag_options[wpmuQuotaCheck]); ?> />
54
+ <?php _e('Should work if the gallery is bellow the blog.dir','flag'); ?>
55
+ </td>
56
+ </tr>
57
+ <tr>
58
+ <th valign="top"><?php _e('Enable roles/capabilities','flag'); ?>:</th>
59
+ <td><input name="wpmuRoles" type="checkbox" value="1" <?php checked('1', $flag_options[wpmuRoles]); ?> />
60
+ <?php _e('Allow users to change the roles for other blog authors.','flag'); ?>
61
+ </td>
62
+ </tr>
63
+ </table>
64
+ <div class="submit"><input type="submit" name="updateoption" value="<?php _e('Update'); ?> &raquo;"/></div>
65
+ </form>
66
+ </div>
67
+
68
+ <?php
69
+ }
70
+ ?>
changelog.txt ADDED
@@ -0,0 +1,430 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ GRAND FlAGallery
2
+ by Rattus & CodEasily DEV Team
3
+
4
+ = v2.11 - 03.11.2012 =
5
+ * Updated: New system of checking license key
6
+ * Changed: Skins update box.
7
+
8
+ = v2.10 - 29.10.2012 =
9
+ * Fixed: Vulnerability in shortcode function, album saving, saving skin options, facebook.php file
10
+ * Fixed: Delete image will delete it from FTP
11
+
12
+ = v2.00 - 22.10.2012 =
13
+ * Updated: Faster loading content of gallery (update skins to new versions)
14
+ * New: Easily update demo skins to full version with license key. All your settings will be in save.
15
+ * Added: Remote control key for mobile application (application coming soon)
16
+
17
+ = v1.90 - 15.10.2012 =
18
+ * Fixed: FancyBox alternative gallery
19
+ * Fixed: Scroll for alternative gallery
20
+ * Changed: Alternative gallery categories bar styling
21
+ * Updated: Banner Rotator Default is now responsive and have 4 themes.
22
+
23
+ = v1.85 - 12.10.2012 =
24
+ * Changed: new way to add preview images for video and music
25
+
26
+ = v1.84 - 26.09.2012 =
27
+ * Fixed: edit thumbnail not worked on some servers (Major Fix)
28
+ * Fixed: gallery deep linkining
29
+
30
+ = v1.83 - 12.09.2012 =
31
+ * Updated: PhotoSwipe library and make it default alternative gallery
32
+ * Updated: Now FlAGallery widget in mobile browser opens galleries on new page, but not in popup
33
+ * Added: Backround image for GRAND Pages
34
+ * Fixed: cPanel for skins options (Major FIX)
35
+
36
+ = v1.82 - 20.08.2012 =
37
+ * Fixed: Compatibility with other plugins that use old swfobject
38
+
39
+ = v1.81 - 10.08.2012 =
40
+ * Fixed: Compatibility with some other flash embed plugins
41
+
42
+ = v1.80 - 25.07.2012 =
43
+ * Changed: New simple way to install skins
44
+
45
+ = v1.79 - 11.07.2012 =
46
+ * Added: Password protection for GRAND Pages
47
+ * Added: align=left|center|right parameter for shortcode
48
+ * Fixed: alternate gallery for https sites
49
+
50
+ = v1.78 - 25.06.2012 =
51
+ * Fixed: admin CSS for Overview page
52
+
53
+ = v1.77 - 16.05.2012 =
54
+ * Fixed: Fancybox javascript not worked when switched between gallery category
55
+ * Fixed: PhotoSwipe javascript not worked when switched between gallery category
56
+ * Updated: Added hitcounter to PhotoSwipe
57
+
58
+ = v1.76 - 13.05.2012 =
59
+ * Fixed: Fancybox javascript not worked in v1.75
60
+ * Updated: Fancybox javascript for Slider skin
61
+
62
+ = v1.75 - 10.05.2012 =
63
+ * Fixed: Saving Video skin settings for playlist
64
+ * Fixed: jQuery conflict for some new themes
65
+
66
+ = v1.74 - 25.04.2012 =
67
+ * Fixed: skins delete function
68
+
69
+ = v1.73 - 18.04.2012 =
70
+ * Fixed: xss vulnerability (skins.php)
71
+
72
+ = v1.72 - 10.04.2012 =
73
+ * Added: Sort by Image views option
74
+ * Added: Sort by Image likes option
75
+
76
+ = v1.71 - 27.03.2012 =
77
+ * Updated: Default Skin (added view counter)
78
+ * Added: widget for GRAND Pages
79
+ * Fixed: JS for alternate gallery
80
+
81
+ = v1.70 - 20.03.2012 =
82
+ * New: PhotoBlog Skin
83
+ * Added: Image Views, Likes and Rating for each images (available only in PhotoBlog skin)
84
+ * Fixed: CSS and JS small bugs
85
+
86
+ = v1.67 - 29.02.2012 =
87
+ * Added: Romanian language
88
+
89
+ = v1.66 - 23.02.2012 =
90
+ * Changed: FancyBox script for alternate gallery is now enabled by default.
91
+ * Changed: Instructions for Facebook gallery page creation.
92
+ * Fixed: small bugfixes.
93
+
94
+ = v1.65 - 15.02.2012 =
95
+ * Added: Now you can select FancyBox or PhotoSwipe script for alternate gallery. Added option to Options page. (Default is PhotoSwipe)
96
+ * Optimized: Optimized Photoswipe script for themes without mobile version.
97
+ * Fixed: FlAGallery media button above Post / Page editor.
98
+
99
+ = v1.64 - 07.02.2012 =
100
+ * Changed: Alternate Gallery changed fancybox script to PhotoSwipe. Full touchscreen support: iPhone, iPad, Android, Blackberry 6 and Desktop all supported.
101
+
102
+ = v1.63 - 24.01.2012 =
103
+ * Fixed: FlAGallery button on HTML Editor panel
104
+ * Added: FlAGallery Media button to Post and Page
105
+ * Changes: Minor changes
106
+
107
+ = v1.62 - 13.01.2012 =
108
+ * Fixed: script.js file error
109
+
110
+ = v1.61 - 12.01.2012 =
111
+ * Fixed: Import video from folder
112
+ * Fixed: Import mp3 from folder
113
+ * Fixed: Fancybox script for Slider skin (now it works in Safari browser)
114
+
115
+ = v1.60 - 10.01.2012 =
116
+ * Added: Default skin without any branding
117
+ * Added: Licenses to each skin folder
118
+
119
+ = v1.59 - 21.12.2011 =
120
+ * Updated: thumbnail generator script
121
+ * Updated: flagshow.php file
122
+
123
+ = v1.58 - 15.12.2011 =
124
+ * Bugfix: Compatibility with theme's custom post templates
125
+ * Bugfix: xss vulnerability (flagshow.php)
126
+ * Updated: Compatibility with Wordpress 3.3
127
+ * Fixed: Support any language for Add Gallery field
128
+
129
+ = v1.57 - 01.12.2011 =
130
+ * Bugfix: Error when update from very old version
131
+ * Bugfix: xss vulnerability
132
+ * Updated: 3D FlatWall, 3D Cube and Afflux skins compatibility with GRAND Pages
133
+
134
+ = v1.56 - 23.11.2011 =
135
+ * Added: Icon for GRAND Pages
136
+ * Added: FlAGallery Music Widget
137
+ * Added: New Music Player Skin
138
+ * Fixed: Bugfix in Baner Box import function
139
+ * Fixed: Music Box didn't update skin settings
140
+
141
+ = v1.55 - 09.11.2011 =
142
+ * Fixed: GRAND Pages permalinks
143
+ * Added: Option to disable deep linking in the flash (not all skins support this feature)
144
+ * Fixed: Alternative gallery
145
+ * Fixed: CSS for FancyBox
146
+ * Added: Alternative for Music Player Default
147
+
148
+ = v1.54 - 09.11.2011 =
149
+ * Added: GRAND Pages - Full Window Gallery Template
150
+ * Updated: Script for Slider skin (multiple Sliders on one page)
151
+
152
+ = v1.53 - 02.11.2011 =
153
+ * Updated : Feedburner RSS now display bold title near image (not only description)
154
+ * Added : Support for very old skins
155
+
156
+ = v1.52 - 01.11.2011 =
157
+ * Updated : Singleton (mini) mp3 player
158
+ * Added : Autoplay for singleton (mini) mp3 player
159
+ * Bugfix : Android browser support
160
+
161
+ = v1.51 - 04.10.2011 =
162
+ * Major Fix : Updated cPanel for skins
163
+ * Added : RSS for FeedBurner
164
+ * Updated : SEO optimization for serch engines
165
+ * Updated : Optimization for RSS Readers (added photo description)
166
+ * Updated : Scripts for feature SlideShow Skin
167
+
168
+ = v1.50 - 20.09.2011 =
169
+ * Fixed : Widget for Banner Rotator (refresh skins)
170
+ * Removed : Unnecessary links on Banner Rotator
171
+
172
+ = v1.49 - 06.09.2011 =
173
+ * Added : Widget for Video Playlists
174
+ * Fixed : Minor Bugs
175
+
176
+ = v1.48 - 30.08.2011 =
177
+ * Fixed : iPhone/iPad alternative for music and video default players
178
+
179
+ = v1.47 - 29.08.2011 =
180
+ * Added : Support mp3 for iPhone/iPad
181
+ * Added : Alternative for video and music for non-flash browsers
182
+ * Added : Widget Option for fancybox size
183
+ * Fixed : music and video default players
184
+
185
+ = v1.45 - 23.08.2011 =
186
+ * Added : Widget for Album Gallery
187
+ * Added : Lithuanian language
188
+ * Fixed : Minor bugs
189
+
190
+ = v1.44 - 18.08.2011 =
191
+ * Fixed : Widget for Banner Rotator
192
+
193
+ = v1.43 - 17.08.2011 =
194
+ * Added : Widget for Banner Rotator
195
+ * Fixed : Change playlist options
196
+ * Fixed : PHP4 Compatibility
197
+
198
+ = v1.42 - 08.08.2011 =
199
+ * Major Bugfix
200
+ * Fixed : Banner Rotator (update skins, please)
201
+
202
+ = v1.41 - 25.07.2011 =
203
+ * Fixed : Bug fix for WP v3.0.*
204
+ * Fixed : Shortcode generator in Visual Editor mode
205
+ * Fixed : Banner Rotator skin for WP v3.0
206
+ * Added : Ukrainian translation
207
+
208
+ = v1.40 - 18.07.2011 =
209
+ * Added : Video playlist creation
210
+ * Added : Video blog skin
211
+ * Added : Banner box page
212
+ * Added : Banner Rotator skin
213
+ * Added : Facebook link generator for Video and Banner
214
+ * Added : Album creation
215
+ * Added : Option to disable jQuery alternative gallery for iPad/iPhone
216
+ * Updated : swf files for skin options, mp3 mini.swf, video_mini.swf
217
+
218
+ = v1.33 - 13.07.2011 =
219
+ * Major Update
220
+ * Fixed : Bug with music and video sorting in playlists
221
+
222
+ = v1.32 - 12.07.2011 =
223
+ * Fixed : Bug with Shortcode insertion via TinyMCE button
224
+ * Updated : video player (new version)
225
+ * Updated : Wordpress v.3.2 compatibility
226
+
227
+ = v1.31 - 04.07.2011 =
228
+ * Added : Creating Multicategorized albums
229
+ * Added : Options for Single MP3 Player
230
+ * Fixed : Skins settings changing
231
+ * Fixed : Bug with Database capitalized prefix
232
+
233
+ = v1.23 - 20.06.2011 =
234
+ * Added : Video Box page (list of video from WP Media Library)
235
+ * Added : FLV Video Player and shortcode for it
236
+ * Added : Import mp3 files from server folder to WP Media Library
237
+ * Added : Import flv files from server folder to WP Media Library
238
+
239
+ = v1.22 - 11.06.2011 =
240
+ * Fixed : Facebook template (you should copy facebook.php in the root directory again if you did it before)
241
+ * Fixed : php4 compatibility
242
+ * Added : Autoplay option to Music player (you should update skins)
243
+ * Fixed : alternate gallery show only if no flash
244
+
245
+ = v1.21 - 07.06.2011 =
246
+ * Fixed : javascript for Alternative gallery
247
+ * Fixed : php4 unexpected T_STATIC error
248
+
249
+ = v1.20 - 06.06.2011 =
250
+ * Updated : Music skin (added autoplay option)
251
+ * Added : Alternate jQuery gallery for iPad, iPhone
252
+ * Added : Options for alternate gallery
253
+ * Added : additional javascript for flash
254
+ * Changed : swfObject output for all galleries
255
+ * Updated : cPanel.swf for skin optoins
256
+
257
+ = v1.13 - 26.05.2011 =
258
+ * Fixed : Refresh Skin button make aktive skin broken (reinstall broken skin please)
259
+
260
+ = v1.12 - 24.05.2011 =
261
+ * Added : Roles for Music and Facebook pages
262
+ * Updated : Midnight Skin v3.0
263
+ * Fixed : Facebook generator javascript on Mac browsers
264
+
265
+ = v1.11 - 23.05.2011 =
266
+ * Added : Music gallery 'Music Box'
267
+ * Added : Flash Gallery for Facebook page
268
+ * Fixed : small fixes
269
+
270
+ = v0.61 - 22.05.2011 =
271
+ * Added : Azerbaijani translation
272
+
273
+ = v0.60 - 11.04.2011 =
274
+ * Fixed : Security fix in two files
275
+
276
+ = v0.59 - 23.03.2011 =
277
+ * Fixed : Fix for default skins - don't load empty galleries
278
+ * Fixed : Fix for edit big thumbs
279
+ * Notice : New skin released today
280
+
281
+ = v0.58pl1 - 19.02.2011 =
282
+ * Changed : Fix for compatibility with new skin
283
+ * Notice : new skin released today
284
+
285
+ = v0.58 - 17.02.2011 =
286
+ * Changed : core files for skins swfobject
287
+ * Notice : all feature skins require plugin v0.58 or higher
288
+
289
+ = v0.57 - 16.02.2011 =
290
+ * Added : js for feature skin
291
+ * Fixed : small fixes
292
+
293
+ = v0.56 - 16.02.2011 =
294
+ * Fixed : transparent and bg color for skins
295
+ * Added : functionality for feature skin
296
+
297
+ = v0.55 - 18.01.2011 =
298
+ * Removed : disablescroll.js - very buggy
299
+
300
+ = v0.54 - 18.01.2011 =
301
+ * Added : javascript - flash scroll without html scroll
302
+ * Added : Dutch language
303
+
304
+ = v0.52 - 5.10.2010 =
305
+ * Added : Polish language
306
+
307
+ = v0.50 - 19.07.2010 =
308
+ * Fixed : Metadata to description wrong tag
309
+
310
+ = v0.49 - 28.06.2010 =
311
+ * Added : Bulk action: copy image metadata to image description
312
+ * Added : Russian translation
313
+ * Bug fixes and CSS fixes
314
+
315
+ = v0.46 - 03.05.2010 =
316
+
317
+ * Added : Belorussian language
318
+
319
+ = v0.45 - 22.04.2010 =
320
+
321
+ * Added : WordPress MU support
322
+ * Small bug fixes
323
+
324
+ = v0.44 - 12.04.2010 =
325
+
326
+ * Added : Turkish language
327
+ * Small bug fixes
328
+
329
+ = v0.43 - 28.03.2010 =
330
+
331
+ * Added : More informative error messages on plugin upgrade
332
+ * Bugfix : Conflicted with NGG JWPlayer
333
+ * Bugfix : Help screen replaced on all admin pages
334
+ * Bugfix : Wrong pager calculate
335
+ * Changed : swfobject js for compability with older version of js library
336
+
337
+ = v0.42 - 25.03.2010 =
338
+
339
+ * Changed : Replaced all php short_open_tag from '<?=...?>' to '<?php echo ...; ?>'
340
+
341
+ = v0.41 - 25.03.2010 =
342
+
343
+ * Bugfix : Skin options didn't save colors
344
+
345
+ = v0.40 - 24.03.2010 =
346
+
347
+ * Change : DataBase structure
348
+ * Change : Skin options now on skins page
349
+ * Change : Skins now in separate folder outside of plugin folder
350
+ * Added : Each skin has own color settings saved in file
351
+ * Added : Hide image for unregistered users option
352
+ * Added : SWFaddress for deeplinking in flash
353
+ * Added : Meta data for Images
354
+ * Added : Action popup for Resize image... and Create new thumbnails
355
+ * Added : New Action - Import Meta data
356
+ * Added : Actions on Manage Galleries page
357
+ * Added : Search Images on Manage Galleries page
358
+
359
+ = v0.39pl3 - 12.02.2010 =
360
+
361
+ * Bugfix : Image uploader fix (Error 'no valid image')
362
+ * Added : German translation
363
+
364
+ = v0.39pl2 - 04.02.2010 =
365
+
366
+ * Bugfix : TinyMCE button insert wrong shortcode
367
+ * Bugfix : Color tab and color settings not showing
368
+
369
+ = v0.39pl1 - 31.01.2010 =
370
+
371
+ * Added : Portuguese translation
372
+ * Added : Traditional Chinese translation
373
+
374
+ = v0.39 - 25.12.2009 =
375
+
376
+ * Added : Spanish translation
377
+ * Bugfix : bugfixes for WP2.9
378
+
379
+ = v0.38 - 08.12.2009 =
380
+
381
+ * Added : Shortcode parameters (orderby=gid | title | random, order=DESC | ASC, exclude, skin)
382
+ * Added : Popup tabs for additional shortcode parameters
383
+ * Added : Ability to add more flash albums in post/posts with different skins
384
+ * Added : Ability set default skin colors or leave your own
385
+ * Bugfix : small fixes
386
+
387
+ = v0.37 - 13.11.2009 =
388
+
389
+ * Added : French translation
390
+ * Bugfix : Fix for Skin page (blank page)
391
+
392
+ = v0.36 - 5.11.2009 =
393
+
394
+ * Added : Italian translation
395
+ * Update : Little fixes of text
396
+
397
+ = v0.35 - 22.10.2009 =
398
+
399
+ * Added : Confirmation popup for delete skin option
400
+ * Bugfix: Fix for included skins with WP 2.7.1 and PHP 4
401
+ * Update : Update for Wordpress v.2.8.5
402
+
403
+ = v0.34 - 19.10.2009 =
404
+
405
+ * Added : Delete skin option
406
+ * Added : Capability for 'delete skin'
407
+ * Bugfix : Fix for flag.ajax.js (conflict with wp-security-scan plugin)
408
+
409
+ = v0.33 - 5.10.2009 =
410
+
411
+ * Bugfix : Fix for skins upload
412
+ * Bugfix : Fix editor buttons in IE
413
+
414
+ = v0.32 - 30.09.2009 =
415
+
416
+ * Added : Skin "PhotoGallery PRO 1.0 DEMO"
417
+ * Bugfix : Fix for image date & time
418
+ * Bugfix : Fixed html special chars in description of image
419
+ * Changed : Database structure
420
+
421
+ = v0.29 - 17.08.2009 =
422
+
423
+ * NEW : Import images from folder
424
+ * Added : Button "FlAGallery" on HTML Editor panel, even if Visual Editor is disabled
425
+ * Added : International Skin to display any language in the flash
426
+ * Added : Loader for News Box on Overview page
427
+ * Added : To display all galleries in the album, added parameter value "all", e.g.: gid=all
428
+ * Changed : Shortcode 'album' replaced with 'flagallery', becouse of conflict with NextGEN Gallery
429
+ * Bugfix : Fix for Upload Images button on Overview page
430
+ * Bugfix : Fixed conflict with NextGEN Gallery (creating thumbnails cause error)
facebook.php ADDED
@@ -0,0 +1,101 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ preg_match('|^(.*?/)(wp-content)/|i', str_replace('\\', '/', __FILE__), $_m);
3
+ require_once( $_m[1] . 'wp-load.php');
4
+ ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+ <html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
6
+ <head profile="http://gmpg.org/xfn/11">
7
+ <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
8
+ <title><?php bloginfo('name'); ?> <?php if ( is_single() ) { ?> &raquo; Blog Archive <?php } ?> <?php wp_title(); ?> - <?php bloginfo('description'); ?> </title>
9
+ </head>
10
+ <body style="margin: 0; padding: 0;">
11
+ <div id="page">
12
+ <script language="JavaScript" src="<?php echo plugins_url('/flash-album-gallery/admin/js/jquery.js'); ?>" type="text/javascript"></script>
13
+ <script language="JavaScript" src="<?php echo plugins_url('/flash-album-gallery/admin/js/swfobject.js'); ?>" type="text/javascript"></script>
14
+ <?php $flag_options = get_option('flag_options');
15
+ if(isset($_GET['l'])) {
16
+ $linkto = intval($_GET['l']);
17
+ } else {
18
+ $posts = get_posts(array("showposts" => 1));
19
+ $linkto = $posts[0]->ID;
20
+ }
21
+ if(isset($_GET['i'])) {
22
+ $skin = '';
23
+ if(isset($_GET['f'])){
24
+ $skinpath = trailingslashit( $flag_options['skinsDirABS'] ).$_GET['f'];
25
+ $skin = esc_url($_GET['f']);
26
+ }
27
+ $h = isset($_GET['h'])? intval($_GET['h']) : (int) $flag_options['flashHeight'];
28
+
29
+ $gids = $_GET['i'];
30
+ if($gids=='all') {
31
+ $gids='';
32
+ if(empty($orderby)) $orderby='gid';
33
+ if(empty($order)) $order='DESC';
34
+ $gallerylist = $flagdb->find_all_galleries($orderby, $order);
35
+ if(is_array($gallerylist)) {
36
+ $excludelist = explode(',',$exclude);
37
+ foreach($gallerylist as $gallery) {
38
+ if (in_array($gallery->gid, $excludelist))
39
+ continue;
40
+ $gids.='_'.$gallery->gid;
41
+ }
42
+ $gids = ltrim($gids,'_');
43
+ }
44
+ } else {
45
+ $gids = explode('_',$gids);
46
+ $mapping = array_map('intval', $gids);
47
+ $gids = implode('_',$mapping);
48
+ }
49
+
50
+ if($gids){
51
+
52
+ echo flagShowFlashAlbum($gids, $name='Gallery', $width='100%', $height=$h, $skin, $playlist='', $wmode='opaque', $linkto); ?>
53
+
54
+ <link href="<?php echo plugins_url('/flash-album-gallery/admin/js/jquery.fancybox-1.3.4.css'); ?>" rel="stylesheet" type="text/css" />
55
+ <script language="JavaScript" src="<?php echo plugins_url('/flash-album-gallery/admin/js/jquery.fancybox-1.3.4.pack.js'); ?>" type="text/javascript"></script>
56
+ <script language="JavaScript" src="<?php echo plugins_url('/flash-album-gallery/admin/js/flagscroll.js'); ?>" type="text/javascript"></script>
57
+ <script language="JavaScript" src="<?php echo plugins_url('/flash-album-gallery/admin/js/script.js'); ?>" type="text/javascript"></script>
58
+
59
+ <?php }
60
+ } ?>
61
+
62
+ <?php
63
+ if(isset($_GET['m'])) {
64
+ $playlistpath = $flag_options['galleryPath'].'playlists/'.$_GET['m'].'.xml';
65
+ if(file_exists($playlistpath))
66
+ echo flagShowMPlayer($playlist=$_GET['m'], $width='', $height='', $wmode='opaque');
67
+ else
68
+ _e("Can't find playlist");
69
+ }
70
+ ?>
71
+ <?php
72
+ if(isset($_GET['v'])) {
73
+ $height = isset($_GET['h'])? intval($_GET['h']) : '';
74
+ $width = isset($_GET['w'])? '100%' : '';
75
+ $playlistpath = $flag_options['galleryPath'].'playlists/video/'.$_GET['v'].'.xml';
76
+ if(file_exists($playlistpath))
77
+ echo flagShowVPlayer($playlist=$_GET['v'], $width, $height, $wmode='opaque');
78
+ else
79
+ _e("Can't find playlist");
80
+ }
81
+ ?>
82
+ <?php
83
+ if(isset($_GET['mv'])) {
84
+ $height = isset($_GET['h'])? intval($_GET['h']) : '';
85
+ $width = '100%';
86
+ $mv = intval($_GET['mv']);
87
+ echo flagShowVmPlayer($mv, $width, $height, $autoplay='true');
88
+ }
89
+ ?>
90
+ <?php
91
+ if(isset($_GET['b'])) {
92
+ $playlistpath = $flag_options['galleryPath'].'playlists/banner/'.$_GET['b'].'.xml';
93
+ if(file_exists($playlistpath))
94
+ echo flagShowBanner($playlist=$_GET['b'], $width='', $height='', $wmode='opaque');
95
+ else
96
+ _e("Can't find playlist");
97
+ }
98
+ ?>
99
+ </div>
100
+ </body>
101
+ </html>
flag-config.php ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Bootstrap file for getting the ABSPATH constant to wp-load.php
4
+ * This is requried when a plugin requires access not via the admin screen.
5
+ *
6
+ * If the wp-load.php file is not found, then an error will be displayed
7
+ */
8
+
9
+ /** Define the server path to the file wp-config here, if you placed WP-CONTENT outside the classic file structure */
10
+
11
+ $path = ''; // It should be end with a trailing slash
12
+
13
+ /** That's all, stop editing from here **/
14
+
15
+ if ( !defined('WP_LOAD_PATH') ) {
16
+
17
+ /** classic root path if wp-content and plugins is below wp-config.php */
18
+ $classic_root = dirname(dirname(dirname(dirname(__FILE__)))) . '/' ;
19
+
20
+ if (file_exists( $classic_root . 'wp-load.php') )
21
+ define( 'WP_LOAD_PATH', $classic_root);
22
+ else
23
+ if (file_exists( $path . 'wp-load.php') )
24
+ define( 'WP_LOAD_PATH', $path);
25
+ else
26
+ exit("Could not find wp-load.php");
27
+ }
28
+
29
+ // let's load WordPress
30
+ require_once( WP_LOAD_PATH . 'wp-load.php');
31
+
32
+ ?>
flag.php ADDED
@@ -0,0 +1,461 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ Plugin Name: GRAND Flash Album Gallery
4
+ Plugin URI: http://codeasily.com/wordpress-plugins/flash-album-gallery/flag/
5
+ Description: The GRAND FlAGallery plugin - provides a comprehensive interface for managing photos and images through a set of admin pages, and it displays photos in a way that makes your web site look very professional.
6
+ Version: 2.11
7
+ Author: Rattus
8
+ Author URI: http://codeasily.com/
9
+
10
+ -------------------
11
+
12
+ Copyright 2009 Sergey Pasyuk (email : pasyuk@gmail.com)
13
+
14
+ */
15
+
16
+ // Stop direct call
17
+ if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You are not allowed to call this page directly.'); }
18
+
19
+ //ini_set('display_errors', '1');
20
+ //ini_set('error_reporting', E_ALL);
21
+
22
+
23
+ if (!class_exists('flagLoad')) {
24
+ class flagLoad {
25
+
26
+ var $version = '2.11';
27
+ var $dbversion = '1.24';
28
+ var $minium_WP = '3.0';
29
+ var $minium_WPMU = '2.8';
30
+ var $options = '';
31
+ var $manage_page;
32
+ var $add_PHP5_notice = false;
33
+
34
+ function flagLoad() {
35
+
36
+ // Load the language file
37
+ $this->load_textdomain();
38
+
39
+ // Stop the plugin if we missed the requirements
40
+ if ( ( !$this->required_version() ) || ( !$this->check_memory_limit() ) )
41
+ return;
42
+
43
+ // Get some constants first
44
+ $this->load_options();
45
+ $this->define_constant();
46
+ $this->define_tables();
47
+ $this->load_dependencies();
48
+
49
+ $this->plugin_name = plugin_basename(__FILE__);
50
+
51
+ // Init options & tables during activation & deregister init option
52
+ register_activation_hook( $this->plugin_name, array(&$this, 'activate') );
53
+ add_action( 'init', array(&$this, 'wp_flag_tune_messages') );
54
+ register_deactivation_hook( $this->plugin_name, array(&$this, 'deactivate') );
55
+
56
+ // Register a uninstall hook to remove all tables & option automatic
57
+ register_uninstall_hook( $this->plugin_name, array('flagLoader', 'uninstall') );
58
+
59
+ // Start this plugin once all other plugins are fully loaded
60
+ add_action( 'plugins_loaded', array(&$this, 'start_plugin') );
61
+
62
+ // Add a message for PHP4 Users, can disable the update message later on
63
+ if (version_compare(PHP_VERSION, '5.0.0', '<'))
64
+ add_filter('transient_update_plugins', array(&$this, 'disable_upgrade'));
65
+
66
+ //Add some message on the plugin page
67
+ add_action( 'after_plugin_row', array(&$this, 'flag_check_message_version') );
68
+
69
+ add_action( 'init', array(&$this, 'flag_fullwindow_page_init') );
70
+ add_action( 'add_meta_boxes', array(&$this, 'flag_fullwindow_page_add_meta_box') );
71
+ add_action( 'save_post', array(&$this, 'flag_fullwindow_page_save_meta_box') );
72
+ add_action( 'template_redirect', array(&$this, 'flag_fullwindow_page_template_redirect') );
73
+ add_filter( 'media_buttons_context', array(&$this, 'addFlAGMediaIcon') );
74
+ add_action('admin_print_scripts-widgets.php', array(&$this, 'flag_widgets_scripts') );
75
+ add_filter( 'posts_orderby', 'sort_query_by_post_in', 10, 2 );
76
+
77
+ }
78
+
79
+ function start_plugin() {
80
+
81
+ // Content Filters
82
+ add_filter('flag_gallery_name', 'sanitize_title');
83
+
84
+ // Load the admin panel or the frontend functions
85
+ if ( is_admin() ) {
86
+
87
+ // Pass the init check or show a message
88
+ if (get_option( "flag_init_check" ) != false )
89
+ add_action( 'admin_notices', create_function('', 'echo \'<div id="message" class="error"><p><strong>' . get_option( "flag_init_check" ) . '</strong></p></div>\';') );
90
+
91
+ } else {
92
+
93
+ // Add MRSS to wp_head
94
+ if ( $this->options['useMediaRSS'] )
95
+ add_action('wp_head', array('flagMediaRss', 'add_mrss_alternate_link'));
96
+
97
+ // Add the script and style files
98
+ add_action('wp_print_scripts', array(&$this, 'load_scripts') );
99
+
100
+ // Add a version number to the header
101
+ add_action('wp_head', create_function('', 'echo "\n<meta name=\'GRAND FlAGallery\' content=\'' . $this->version . '\' />\n";') );
102
+
103
+ }
104
+ }
105
+
106
+ function wp_flag_tune_messages() {
107
+ if($this->options['flagVersion'] != $this->version) {
108
+ // upgrade plugin
109
+ require_once(FLAG_ABSPATH . 'admin/tuning.php');
110
+ $ok = flag_tune($show_error=false);
111
+
112
+ include_once (dirname (__FILE__) . '/admin/flag_install.php');
113
+ // check for tables
114
+ flag_capabilities();
115
+ }
116
+ }
117
+
118
+ function required_version() {
119
+
120
+ global $wp_version, $wpmu_version;
121
+
122
+ // Check for WPMU installation
123
+ if (!defined ('IS_WPMU'))
124
+ define('IS_WPMU', version_compare($wpmu_version, $this->minium_WPMU, '>=') );
125
+
126
+ // Check for WP version installation
127
+ $wp_ok = version_compare($wp_version, $this->minium_WP, '>=');
128
+
129
+ if ( ($wp_ok == FALSE) and (IS_WPMU == FALSE) ) {
130
+ add_action('admin_notices', create_function('', 'global $flag; printf (\'<div id="message" class="error"><p><strong>\' . __(\'Sorry,GRAND Flash Album Gallery works only under WordPress %s or higher\', "flag" ) . \'</strong></p></div>\', $flag->minium_WP );'));
131
+ return false;
132
+ }
133
+ return true;
134
+
135
+ }
136
+
137
+ function check_memory_limit() {
138
+
139
+ $memory_limit = (int) substr( ini_get('memory_limit'), 0, -1);
140
+ //This works only with enough memory, 8MB is silly, wordpress requires already 7.9999
141
+ if ( ($memory_limit != 0) && ($memory_limit < 12 ) ) {
142
+ add_action('admin_notices', create_function('', 'echo \'<div id="message" class="error"><p><strong>' . __('Sorry, GRAND Flash Album Gallery works only with a Memory Limit of 16 MB higher', 'flag') . '</strong></p></div>\';'));
143
+ return false;
144
+ }
145
+
146
+ return true;
147
+
148
+ }
149
+
150
+ function define_tables() {
151
+ global $wpdb;
152
+
153
+ // add database pointer
154
+ $wpdb->flagpictures = $wpdb->prefix . 'flag_pictures';
155
+ $wpdb->flaggallery = $wpdb->prefix . 'flag_gallery';
156
+ $wpdb->flagcomments = $wpdb->prefix . 'flag_comments';
157
+ $wpdb->flagalbum = $wpdb->prefix . 'flag_album';
158
+
159
+ }
160
+
161
+ function define_constant() {
162
+
163
+ define('FLAGVERSION', $this->version);
164
+ // Minimum required database version
165
+ define('FLAG_DBVERSION', $this->dbversion);
166
+
167
+ // required for Windows & XAMPP
168
+ define('WINABSPATH', str_replace("\\", "/", ABSPATH) );
169
+
170
+ // define URL
171
+ define('FLAGFOLDER', plugin_basename( dirname(__FILE__)) );
172
+
173
+ define('FLAG_ABSPATH', str_replace("\\","/", WP_PLUGIN_DIR . '/' . plugin_basename( dirname(__FILE__) ) . '/' ));
174
+ define('FLAG_URLPATH', WP_PLUGIN_URL . '/' . plugin_basename( dirname(__FILE__) ) . '/' );
175
+
176
+ // get value for safe mode
177
+ if ( (gettype( ini_get('safe_mode') ) == 'string') ) {
178
+ // if sever did in in a other way
179
+ if ( ini_get('safe_mode') == 'off' ) define('SAFE_MODE', FALSE);
180
+ else define( 'SAFE_MODE', ini_get('safe_mode') );
181
+ } else
182
+ define( 'SAFE_MODE', ini_get('safe_mode') );
183
+
184
+ }
185
+
186
+ function load_dependencies() {
187
+ global $flagdb;
188
+
189
+ // Load global libraries
190
+ require_once (dirname (__FILE__) . '/lib/core.php');
191
+ require_once (dirname (__FILE__) . '/lib/flag-db.php');
192
+ require_once (dirname (__FILE__) . '/lib/image.php');
193
+ require_once (dirname (__FILE__) . '/widgets/widgets.php');
194
+
195
+ // We didn't need all stuff during a AJAX operation
196
+ if ( defined('DOING_AJAX') )
197
+ require_once (dirname (__FILE__) . '/admin/ajax.php');
198
+ else {
199
+ require_once (dirname (__FILE__) . '/lib/meta.php');
200
+ require_once (dirname (__FILE__) . '/lib/media-rss.php');
201
+ include_once (dirname (__FILE__) . '/admin/tinymce/tinymce.php');
202
+
203
+ // Load backend libraries
204
+ if ( is_admin() ) {
205
+ require_once (dirname (__FILE__) . '/admin/admin.php');
206
+ require_once (dirname (__FILE__) . '/admin/media-upload.php');
207
+ $this->flagAdminPanel = new flagAdminPanel();
208
+
209
+ // Load frontend libraries
210
+ } else {
211
+ require_once (dirname (__FILE__) . '/lib/swfobject.php');
212
+ require_once (dirname (__FILE__) . '/lib/shortcodes.php');
213
+ }
214
+ }
215
+ }
216
+
217
+ function load_textdomain() {
218
+
219
+ load_plugin_textdomain('flag', false, dirname( plugin_basename(__FILE__) ) . '/lang');
220
+
221
+ }
222
+
223
+ function load_scripts() {
224
+
225
+ wp_enqueue_script('jquery');
226
+ // Let's override WP's bundled swfobject, cause as of WP 2.9, it's still using 2.1
227
+ wp_deregister_script('swfobject');
228
+ // and register our own.
229
+ wp_register_script('swfobject', plugins_url('/flash-album-gallery/admin/js/swfobject.js'), array('jquery'), '2.2');
230
+ wp_enqueue_script('swfobject');
231
+ if($this->options['deepLinks']){
232
+ wp_register_script('swfaddress', plugins_url('/flash-album-gallery/admin/js/swfaddress.js'), array(), '2.4');
233
+ wp_enqueue_script('swfaddress');
234
+ }
235
+ wp_register_style('fancybox', plugins_url('/flash-album-gallery/admin/js/jquery.fancybox-1.3.4.css') );
236
+ wp_register_script('fancybox', plugins_url('/flash-album-gallery/admin/js/jquery.fancybox-1.3.4.pack.js'), array(), '1.3.4', true );
237
+
238
+ }
239
+
240
+ function flag_widgets_scripts() {
241
+
242
+ wp_enqueue_script('widgets_admin', plugins_url('/flash-album-gallery/admin/js/widgets_admin.js'), array('jquery'), '1.0');
243
+
244
+ }
245
+
246
+ function load_options() {
247
+ // Load the options
248
+ $this->options = get_option('flag_options');
249
+ }
250
+
251
+ function activate() {
252
+ //Since version 0.40 it's tested only with PHP5.2, currently we keep PHP4 support a while
253
+ //if (version_compare(PHP_VERSION, '5.2.0', '<')) {
254
+ // deactivate_plugins(plugin_basename(__FILE__)); // Deactivate ourself
255
+ // wp_die("Sorry, but you can't run this plugin, it requires PHP 5.2 or higher.");
256
+ // return;
257
+ //}
258
+ include_once (dirname (__FILE__) . '/admin/flag_install.php');
259
+ // check for tables
260
+ flag_install();
261
+ $this->flag_fullwindow_page_init();
262
+ flush_rewrite_rules();
263
+ }
264
+
265
+ function deactivate() {
266
+ // remove & reset the init check option
267
+ delete_option( 'flag_init_check' );
268
+ }
269
+
270
+ function uninstall() {
271
+ include_once (dirname (__FILE__) . '/admin/flag_install.php');
272
+ flag_uninstall();
273
+ }
274
+
275
+ function disable_upgrade($option){
276
+
277
+ $this_plugin = plugin_basename(__FILE__);
278
+
279
+ // PHP5.2 is required for FlAG V0.40
280
+ if ( version_compare($option->response[ $this_plugin ]->new_version, '0.40', '>=') )
281
+ return $option;
282
+
283
+ if( isset($option->response[ $this_plugin ]) ){
284
+ //TODO:Clear its download link, not now but maybe later
285
+ //$option->response[ $this_plugin ]->package = '';
286
+
287
+ //Add a notice message
288
+ if ($this->add_PHP5_notice == false){
289
+ add_action( "in_plugin_update_message-$this->plugin_name", create_function('', 'echo \'<br /><span style="color:red">Please update to PHP5.2 as soon as possible, the plugin is not tested under PHP4 anymore</span>\';') );
290
+ $this->add_PHP5_notice = true;
291
+ }
292
+ }
293
+ return $option;
294
+ }
295
+
296
+ // PLUGIN MESSAGE ON PLUGINS PAGE
297
+ function flag_check_message_version($file)
298
+ {
299
+ static $this_plugin;
300
+ global $wp_version;
301
+ if (!$this_plugin) $this_plugin = plugin_basename(__FILE__);
302
+
303
+ if ($file == $this_plugin ){
304
+ $checkfile = "http://codeasily.com/flagallery.chk";
305
+
306
+ $message = wp_remote_fopen($checkfile);
307
+
308
+ if($message)
309
+ {
310
+ preg_match( '|flag040:(.*)$|mi', $message, $theMessage );
311
+
312
+ $columns = substr($wp_version, 0, 3) == "2.8" ? 3 : 5;
313
+
314
+ if ( !empty( $theMessage ) )
315
+ {
316
+ $theMessage = trim($theMessage[1]);
317
+ echo '<td colspan="'.$columns.'" class="plugin-update" style="line-height:1.2em; font-size:11px; padding:1px;"><div id="flag-update-msg" style="padding-bottom:1px;" >'.$theMessage.'</div></td>';
318
+ } else {
319
+ return;
320
+ }
321
+ }
322
+ }
323
+ }
324
+
325
+ function flag_fullwindow_page_init() {
326
+ $labels = array(
327
+ 'name' => _x('GRAND Galleries', 'post type general name', 'flag'),
328
+ 'singular_name' => __('FlAGallery Page', 'flag'),
329
+ 'add_new' => __('Add New Gallery Page', 'flag'),
330
+ 'add_new_item' => __('Add New Gallery Page', 'flag'),
331
+ 'edit_item' => __('Edit Gallery Page', 'flag'),
332
+ 'new_item' => __('New Gallery Page', 'flag'),
333
+ 'all_items' => __('All GRAND Galleries', 'flag'),
334
+ 'view_item' => __('View Gallery Page', 'flag'),
335
+ 'search_items' => __('Search GRAND Galleries', 'flag'),
336
+ 'not_found' => __('No GRAND Galleries found', 'flag'),
337
+ 'not_found_in_trash' => __('No GRAND Galleries found in Trash', 'flag'),
338
+ 'parent_item_colon' => '',
339
+ 'menu_name' => 'GRAND Pages'
340
+
341
+ );
342
+ $args = array(
343
+ 'labels' => $labels,
344
+ 'description' => __('This is the page template for displaing GRAND FlAGallery galleries in full width and height of browser window.', 'flag'),
345
+ 'public' => true,
346
+ 'publicly_queryable' => true,
347
+ 'show_ui' => true,
348
+ 'show_in_menu' => true,
349
+ 'menu_position' => 20,
350
+ 'menu_icon' => FLAG_URLPATH .'admin/images/flag.png',
351
+ 'capability_type' => 'post',
352
+ 'hierarchical' => true,
353
+ 'supports' => array('title','author','thumbnail','excerpt','page-attributes'),
354
+ 'has_archive' => true,
355
+ 'rewrite' => array( 'slug' => 'flagallery','with_front' => FALSE),
356
+ 'query_var' => true,
357
+ );
358
+ register_post_type('flagallery',$args);
359
+ }
360
+
361
+ /* Adds a meta box to the main column on the flagallery edit screens */
362
+ function flag_fullwindow_page_add_meta_box() {
363
+ add_meta_box( 'flag_gallery', __( 'Photo Gallery Page Generator', 'flag' ), array(&$this, 'flag_fullwindow_page_meta_box'), 'flagallery', 'normal', 'high' );
364
+ }
365
+
366
+ /* Prints the meta box content */
367
+ function flag_fullwindow_page_meta_box( $post ) {
368
+
369
+ // Use nonce for verification
370
+ wp_nonce_field( plugin_basename( __FILE__ ), 'flag_meta_box' );
371
+
372
+ include_once(dirname(__FILE__) . '/admin/meta_box.php');
373
+ }
374
+
375
+ /* When the post is saved, saves our custom data */
376
+ function flag_fullwindow_page_save_meta_box( $post_id ) {
377
+ // verify if this is an auto save routine.
378
+ // If it is our form has not been submitted, so we dont want to do anything
379
+ if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )
380
+ return;
381
+
382
+ // verify this came from the our screen and with proper authorization,
383
+ // because save_post can be triggered at other times
384
+
385
+ if ( !wp_verify_nonce( $_POST['flag_meta_box'], plugin_basename( __FILE__ ) ) )
386
+ return;
387
+
388
+ // Check permissions
389
+ if ( 'flagallery' == $_POST['post_type'] )
390
+ {
391
+ if ( !current_user_can( 'edit_page', $post_id ) )
392
+ return;
393
+ }
394
+ else
395
+ {
396
+ if ( !current_user_can( 'edit_post', $post_id ) )
397
+ return;
398
+ }
399
+ // OK, we're authenticated: we need to find and save the data
400
+ $items_array = $_POST["mb_items_array"];
401
+ $skinname = $_POST["mb_skinname"];
402
+ $scode = $_POST["mb_scode"];
403
+ $button_text = $_POST["mb_button"];
404
+ $button_link = $_POST["mb_button_link"];
405
+ $bg_link = $_POST["mb_bg_link"];
406
+ $bg_pos = $_POST["mb_bg_pos"];
407
+ $bg_repeat = $_POST["mb_bg_repeat"];
408
+ update_post_meta($post_id, "mb_items_array", $_POST["mb_items_array"]);
409
+ update_post_meta($post_id, "mb_skinname", $_POST["mb_skinname"]);
410
+ update_post_meta($post_id, "mb_scode", $_POST["mb_scode"]);
411
+ update_post_meta($post_id, "mb_button", $_POST["mb_button"]);
412
+ update_post_meta($post_id, "mb_button_link", $_POST["mb_button_link"]);
413
+ update_post_meta($post_id, "mb_bg_link", $_POST["mb_bg_link"]);
414
+ update_post_meta($post_id, "mb_bg_pos", $_POST["mb_bg_pos"]);
415
+ update_post_meta($post_id, "mb_bg_repeat", $_POST["mb_bg_repeat"]);
416
+
417
+ }
418
+
419
+ // Template selection
420
+ function flag_fullwindow_page_template_redirect() {
421
+ global $wp;
422
+ global $wp_query;
423
+ if ($wp->query_vars["post_type"] == "flagallery")
424
+ {
425
+ // Let's look for the full_window_template.php template file
426
+ if (have_posts())
427
+ {
428
+ include(FLAG_ABSPATH . 'full_window_template.php');
429
+ die();
430
+ }
431
+ else
432
+ {
433
+ $wp_query->is_404 = true;
434
+ }
435
+ }
436
+ }
437
+
438
+ function addFlAGMediaIcon($context){
439
+ global $post_ID, $temp_ID, $wpdb;
440
+ $flag_upload_iframe_src = FLAG_URLPATH."admin/tinymce/window.php?media_button=true&riched=false";
441
+ $flag_iframe_src = apply_filters('flag_iframe_src', "$flag_upload_iframe_src&amp;tab=flagallery");
442
+ $title = __('Add GRAND FlAGallery');
443
+ return $context.'<a href="'.$flag_upload_iframe_src.'&amp;TB_iframe=1&amp;width=360&amp;height=210" class="thickbox" id="add_flagallery" title="'.$title.'"><span style="margin:0 5px;">FlAGallery</span></a>';
444
+ }
445
+
446
+
447
+ }
448
+ // Let's start the holy plugin
449
+ global $flag;
450
+ $flag = new flagLoad();
451
+
452
+ }
453
+ if(!function_exists('sort_query_by_post_in')){
454
+ function sort_query_by_post_in( $sortby, $thequery ) {
455
+ if ( !empty($thequery->query['post__in']) && isset($thequery->query['orderby']) && $thequery->query['orderby'] == 'post__in' )
456
+ $sortby = "find_in_set(ID, '" . implode( ',', $thequery->query['post__in'] ) . "')";
457
+
458
+ return $sortby;
459
+ }
460
+ }
461
+ ?>
flagshow.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ // Load wp-config
3
+ if ( !defined('ABSPATH') )
4
+ require_once( dirname(__FILE__) . '/flag-config.php');
5
+
6
+ // reference thumbnail class
7
+ include_once( flagGallery::graphic_library() );
8
+ include_once('lib/core.php');
9
+
10
+ // get the plugin options
11
+ $flag_options = get_option('flag_options');
12
+
13
+ // Some parameters from the URL
14
+ if ( !isset($_GET['pid']) )
15
+ exit;
16
+
17
+ $pictureID = intval($_GET['pid']);
18
+ if( !$pictureID )
19
+ exit;
20
+
21
+ // let's get the image data
22
+ $picture = flagdb::find_image( $pictureID );
23
+
24
+ if ( !is_object($picture) )
25
+ exit;
26
+
27
+ $thumb = new flag_Thumbnail( $picture->imagePath );
28
+
29
+ // Resize if necessary
30
+ if ( !empty($_GET['width']) || !empty($_GET['height']) )
31
+ $thumb->resize( intval($_GET['width']), intval($_GET['height']) );
32
+
33
+ // Show thumbnail
34
+ $thumb->show();
35
+ $thumb->destruct();
36
+
37
+ exit;
38
+ ?>
full_window_template.php ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ preg_match('|^(.*?/)(wp-content)/|i', str_replace('\\', '/', __FILE__), $_m);
3
+ require_once( $_m[1] . 'wp-load.php');
4
+ global $post;
5
+ $flag_custom = get_post_custom($post->ID);
6
+ ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
7
+ <html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
8
+ <head profile="http://gmpg.org/xfn/11">
9
+ <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
10
+ <title><?php wp_title(''); ?></title>
11
+ <style type="text/css">
12
+ html, body { margin: 0; padding: 0; width: 100%; height: 100%; overflow: hidden; min-height: 200px; min-width: 320px; }
13
+ div#page, .flashalbum { width: 100%; height: 100%; position: relative; z-index: 1; }
14
+ .flag_alternate { margin: 0 !important; }
15
+ <?php if(isset($flag_custom['mb_bg_link'][0]) && !empty($flag_custom['mb_bg_link'][0])) { ?>
16
+ div.flashalbum { background-image: url(<?php echo $flag_custom['mb_bg_link'][0]; ?>); background-position: <?php echo $flag_custom['mb_bg_pos'][0]; ?>; background-repeat: <?php echo $flag_custom['mb_bg_repeat'][0]; ?>; }
17
+ <?php } ?>
18
+ </style>
19
+ <script language="JavaScript" src="<?php echo plugins_url('/flash-album-gallery/admin/js/jquery.js'); ?>" type="text/javascript"></script>
20
+ <script language="JavaScript" src="<?php echo plugins_url('/flash-album-gallery/admin/js/swfobject.js'); ?>" type="text/javascript"></script>
21
+ <script language="JavaScript" src="<?php echo plugins_url('/flash-album-gallery/admin/js/swfaddress.js'); ?>" type="text/javascript"></script>
22
+ </head>
23
+ <body id="fullwindow">
24
+ <div id="page">
25
+ <?php
26
+ if ( post_password_required( $post ) ) {
27
+ the_content();
28
+ } else {
29
+ $scode = $flag_custom["mb_scode"][0];
30
+ echo do_shortcode($scode);
31
+ } ?>
32
+ </div>
33
+ <script language="JavaScript" src="<?php echo plugins_url('/flash-album-gallery/admin/js/flagscroll.js'); ?>" type="text/javascript"></script>
34
+ <script language="JavaScript" src="<?php echo plugins_url('/flash-album-gallery/admin/js/script.js'); ?>" type="text/javascript"></script>
35
+ </body>
36
+ </html>
index.php ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ <?php
2
+ // Silence is golden.
3
+ ?>
lang/flag-az_AZ.mo ADDED
Binary file
lang/flag-az_AZ.po ADDED
@@ -0,0 +1,1648 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: Flash Album Gallery\n"
4
+ "Report-Msgid-Bugs-To: http://wordpress.org/tag/flash-album-gallery\n"
5
+ "POT-Creation-Date: 2009-10-28 10:59+0000\n"
6
+ "PO-Revision-Date: \n"
7
+ "Last-Translator: Madat <translator.baku@gmail.com>\n"
8
+ "Language-Team: Webmestre <by.marcis@gmail.com>\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "Plural-Forms: nplurals=2; plural=n>1\n"
13
+ "X-Poedit-Language: Azerbaijani\n"
14
+ "X-Poedit-Country: AZERBAIJAN\n"
15
+ "X-Poedit-SourceCharset: utf-8\n"
16
+
17
+ #: admin/addgallery.php:37
18
+ #: admin/addmoreimages.php:36
19
+ msgid "Upload failed!"
20
+ msgstr "Yükləmə alınmadı!"
21
+
22
+ #: admin/addgallery.php:49
23
+ #: admin/addmoreimages.php:41
24
+ #: admin/functions.php:453
25
+ #: admin/functions.php:543
26
+ msgid "No gallery selected !"
27
+ msgstr "Qalereya seçilməyib!"
28
+
29
+ #: admin/addgallery.php:117
30
+ #: admin/addmoreimages.php:88
31
+ msgid "Image Files"
32
+ msgstr "Şəkillər fayılı"
33
+
34
+ #: admin/addgallery.php:136
35
+ #: admin/addgallery.php:166
36
+ #: admin/addmoreimages.php:107
37
+ #: admin/addmoreimages.php:136
38
+ msgid "remove"
39
+ msgstr "silmək"
40
+
41
+ #: admin/addgallery.php:137
42
+ #: admin/addmoreimages.php:108
43
+ msgid "Browse..."
44
+ msgstr "Gözdən keçirmək..."
45
+
46
+ #: admin/addgallery.php:138
47
+ #: admin/addgallery.php:203
48
+ #: admin/addgallery.php:251
49
+ #: admin/addmoreimages.php:109
50
+ #: admin/addmoreimages.php:168
51
+ msgid "Upload images"
52
+ msgstr "Şəkili yükləmək"
53
+
54
+ #: admin/addgallery.php:177
55
+ msgid "Add new gallery"
56
+ msgstr "Yeni qalereyanı əlavə etmək"
57
+
58
+ #: admin/addgallery.php:178
59
+ msgid "Upload Images"
60
+ msgstr "Şəkilləri Yükləmək"
61
+
62
+ #: admin/addgallery.php:179
63
+ #: admin/addgallery.php:258
64
+ msgid "Import image folder"
65
+ msgstr "Şəkillər papkasını gətirmək"
66
+
67
+ #: admin/addgallery.php:184
68
+ msgid "Create a new gallery"
69
+ msgstr "Yeni qalereyanı düzəltmək"
70
+
71
+ #: admin/addgallery.php:189
72
+ msgid "New Gallery"
73
+ msgstr "Yeni qalereya"
74
+
75
+ #: admin/addgallery.php:193
76
+ msgid "Create a new , empty gallery below the folder"
77
+ msgstr "Papkadan aşağıda yeni, boş qalereyanı düzəltmək"
78
+
79
+ #: admin/addgallery.php:194
80
+ msgid "Allowed characters for file and folder names are"
81
+ msgstr "Fayılların və papkaların adları üçün icazə verilmiş simvollar"
82
+
83
+ #: admin/addgallery.php:195
84
+ msgid "Add gallery"
85
+ msgstr "Qalereyanı əlavə etmək"
86
+
87
+ #: admin/addgallery.php:227
88
+ #: admin/addmoreimages.php:156
89
+ msgid "Upload image(s):"
90
+ msgstr "Şəkili (ləri) yükləmək:"
91
+
92
+ #: admin/addgallery.php:231
93
+ msgid "in to"
94
+ msgstr "- ya (-na)"
95
+
96
+ #: admin/addgallery.php:232
97
+ msgid "Choose gallery"
98
+ msgstr "Qalereyanı seçin"
99
+
100
+ #: admin/addgallery.php:246
101
+ #: admin/addmoreimages.php:164
102
+ msgid "The batch upload requires Adobe Flash 10, disable it if you have problems"
103
+ msgstr "Paketi yükləmək üçün Adobe Flash 10 tələb olunur, Sizdə problem varsa onu söndürün "
104
+
105
+ #: admin/addgallery.php:246
106
+ #: admin/addmoreimages.php:164
107
+ msgid "Disable flash upload"
108
+ msgstr "Fleş-yükləyicini söndürün"
109
+
110
+ #: admin/addgallery.php:248
111
+ #: admin/addmoreimages.php:166
112
+ msgid "Upload multiple files at once by ctrl/shift-selecting in dialog"
113
+ msgstr "Bir neçə fayılı eyni zamanda yüklənməsi, Ctrl/Shift-secim ilə dialoq pəncərəsində"
114
+
115
+ #: admin/addgallery.php:248
116
+ #: admin/addmoreimages.php:166
117
+ msgid "Enable flash based upload"
118
+ msgstr "Fleş-yükləyicini qoşun"
119
+
120
+ #: admin/addgallery.php:263
121
+ msgid "Import from Server path:"
122
+ msgstr "Serverdən götürün"
123
+
124
+ #: admin/addgallery.php:264
125
+ msgid "Toggle DIR Browser"
126
+ msgstr "Toggle DIR Brauzer"
127
+
128
+ #: admin/addgallery.php:267
129
+ msgid " Please note : For safe-mode = ON you need to add the subfolder thumbs manually"
130
+ msgstr "Diggət edin: təhlükəsiz rejimdə = ON, Siz özünüz papkanı əlavə etməlisiniz"
131
+
132
+ #: admin/addgallery.php:270
133
+ msgid "Import folder"
134
+ msgstr "Papkani gətirmək"
135
+
136
+ #: admin/addmoreimages.php:145
137
+ #, php-format
138
+ msgid "Upload More Images in \"%s\""
139
+ msgstr " \"%s\"-da daha da çox şəkil yükləmək"
140
+
141
+ #: admin/addmoreimages.php:150
142
+ msgid "Add images to gallery"
143
+ msgstr "Şəkilləri qalereyaya əlavə etmək"
144
+
145
+ #: admin/addmoreimages.php:158
146
+ #: admin/manage-sort.php:61
147
+ msgid "Back to gallery"
148
+ msgstr "Qalereyaya qayıtmaq"
149
+
150
+ #: admin/admin.php:23
151
+ #: admin/admin.php:24
152
+ msgid "Flash Album Gallery overview"
153
+ msgstr " Flash Album Gallery baxış"
154
+
155
+ #: admin/admin.php:23
156
+ msgid "FlAGallery"
157
+ msgstr "FlAGalereya"
158
+
159
+ #: admin/admin.php:24
160
+ msgid "Overview"
161
+ msgstr "Baxış"
162
+
163
+ #: admin/admin.php:25
164
+ msgid "FlAG Manage gallery"
165
+ msgstr "FlAG Qalereyanı idarə edilməsi "
166
+
167
+ #: admin/admin.php:25
168
+ msgid "Manage Galleries"
169
+ msgstr "Qalereyanı idarə edilməsi "
170
+
171
+ #: admin/admin.php:26
172
+ msgid "FlAG Manage skins"
173
+ msgstr "FlAG skinlərin idarə edilməsi "
174
+
175
+ #: admin/admin.php:26
176
+ #: admin/skins.php:312
177
+ msgid "Skins"
178
+ msgstr "Skinlər"
179
+
180
+ #: admin/admin.php:27
181
+ msgid "FlAG Change options"
182
+ msgstr "FlAG Köklərin opısiyaları"
183
+
184
+ #: admin/admin.php:27
185
+ msgid "Options"
186
+ msgstr "Opsiyalar"
187
+
188
+ #: admin/admin.php:77
189
+ msgid "You do not have the correct permission"
190
+ msgstr "Sizdə düzgün icazə yoxdur"
191
+
192
+ #: admin/admin.php:78
193
+ msgid "Unexpected Error"
194
+ msgstr "Gözlənilməyən səhv"
195
+
196
+ #: admin/admin.php:79
197
+ msgid "A failure occurred"
198
+ msgstr "Səhv oldu"
199
+
200
+ #: admin/flag_install.php:24
201
+ msgid "Sorry, Flash Album Gallery works only with a role called administrator"
202
+ msgstr "Bağışləayin, FlAGallery işləməsi üçün administrator hüquqları tələb olunur"
203
+
204
+ #: admin/flag_install.php:121
205
+ msgid "Flash Album Gallery : Tables could not created, please check your database settings"
206
+ msgstr "FlAGallery: Cədvəl yaradılmayıb, məlumat bazasının yükləmələrini yoxlayın"
207
+
208
+ #: admin/functions.php:29
209
+ msgid "No valid gallery name!"
210
+ msgstr "Qalereyanın adı düzgün deyil"
211
+
212
+ #: admin/functions.php:36
213
+ #: admin/functions.php:45
214
+ #: admin/functions.php:59
215
+ #: admin/functions.php:127
216
+ #: admin/functions.php:134
217
+ msgid "Directory"
218
+ msgstr "Kataloq"
219
+
220
+ #: admin/functions.php:36
221
+ msgid "didn't exist. Please create first the main gallery folder "
222
+ msgstr "mövcud deyil. Birinci əsas qalereya papkasını yaradın"
223
+
224
+ #: admin/functions.php:37
225
+ #: admin/functions.php:46
226
+ msgid "Check this link, if you didn't know how to set the permission :"
227
+ msgstr "Bu ssılkanı baxin, əgər Siz bilirsiniz ki icazəni neca düzəltmək olar:"
228
+
229
+ #: admin/functions.php:45
230
+ #: admin/functions.php:59
231
+ msgid "is not writeable !"
232
+ msgstr "yazılış mümkün deyil !"
233
+
234
+ #: admin/functions.php:54
235
+ #: admin/functions.php:64
236
+ #: lib/core.php:99
237
+ msgid "Unable to create directory "
238
+ msgstr "Kataloq düzəltmək mümkün deyil"
239
+
240
+ #: admin/functions.php:68
241
+ msgid "The server setting Safe-Mode is on !"
242
+ msgstr "Server kökləməsinin təhlükəsiz rejimi qoşulub!"
243
+
244
+ #: admin/functions.php:69
245
+ msgid "If you have problems, please create directory"
246
+ msgstr "Əgər Sizdə problem varsa kataloqu yaradın"
247
+
248
+ #: admin/functions.php:70
249
+ msgid "and the thumbnails directory"
250
+ msgstr "və ekskizlər kataloqu"
251
+
252
+ #: admin/functions.php:70
253
+ msgid "with permission 777 manually !"
254
+ msgstr "777-ci icazə ilə əl ilə edilən!"
255
+
256
+ #: admin/functions.php:88
257
+ #: admin/functions.php:155
258
+ #: admin/manage-images.php:139
259
+ #: admin/manage.php:89
260
+ #: admin/overview.php:220
261
+ msgid "Gallery"
262
+ msgid_plural "Galleries"
263
+ msgstr[0] "Qalereya"
264
+ msgstr[1] "Qalereyalar"
265
+
266
+ #: admin/functions.php:88
267
+ msgid "already exists"
268
+ msgstr "artıq mövcuddur"
269
+
270
+ #: admin/functions.php:93
271
+ #, php-format
272
+ msgid "Gallery '%1$s' successfully created.<br/>You can show this gallery with the tag %2$s.<br/>"
273
+ msgstr "'%1$s' qalereya müvəffəqiyyətlə yaradılıb. <br/> Siz bu qalereyaya %2$s. <br/> teq vasitəsi ilə göstərə bilərsiniz"
274
+
275
+ #: admin/functions.php:96
276
+ msgid "Edit gallery"
277
+ msgstr "Qalereyanı redaktə etmək"
278
+
279
+ #: admin/functions.php:127
280
+ msgid "doesn&#96;t exist!"
281
+ msgstr "mövcud deyil!"
282
+
283
+ #: admin/functions.php:134
284
+ msgid "contains no pictures"
285
+ msgstr "şəkil özündə saxlamır"
286
+
287
+ #: admin/functions.php:152
288
+ msgid "Database error. Could not add gallery!"
289
+ msgstr "Məlumat bazasında səhv. Qalereyanı əlavə etmək mümkün deyil!"
290
+
291
+ #: admin/functions.php:155
292
+ msgid "successfully created!"
293
+ msgstr "müvəffəqiyyətlə yaradılıb!"
294
+
295
+ #: admin/functions.php:184
296
+ #: admin/functions.php:525
297
+ #: admin/manage-images.php:212
298
+ #: admin/manage.php:137
299
+ msgid "Create new thumbnails"
300
+ msgstr "Yeni eskizlərin düzədilməsi"
301
+
302
+ #: admin/functions.php:187
303
+ msgid " picture(s) successfully added"
304
+ msgstr "şəkil(lər) müvəffəqiyyətlə əlavə olunub(lar)"
305
+
306
+ #: admin/functions.php:226
307
+ #: admin/functions.php:305
308
+ msgid "Object didn't contain correct data"
309
+ msgstr "Obyekt səhv məlumatlar özündə yaşayır"
310
+
311
+ #: admin/functions.php:231
312
+ msgid " is not writeable "
313
+ msgstr "yazılış mümkün deyil"
314
+
315
+ #: admin/functions.php:312
316
+ msgid " is not writeable"
317
+ msgstr "yazılış mümkün deyil"
318
+
319
+ #: admin/functions.php:461
320
+ #: admin/functions.php:566
321
+ msgid "Failure in database, no gallery path set !"
322
+ msgstr "Məlumat bazasında səhv, qalereyaya yol qoyulmayıb"
323
+
324
+ #: admin/functions.php:482
325
+ #: admin/functions.php:560
326
+ msgid "is no valid image file!"
327
+ msgstr "düzgün şəkil fayılı deyil!"
328
+
329
+ #: admin/functions.php:496
330
+ #: admin/functions.php:666
331
+ #: admin/functions.php:734
332
+ #, php-format
333
+ msgid "Unable to write to directory %s. Is this directory writable by the server?"
334
+ msgstr "Kataloqa %s yazmaq mümkün deyil. Невозможно записать в каталог . Bu serverdə yazılış etmək olar?"
335
+
336
+ #: admin/functions.php:503
337
+ #: admin/functions.php:583
338
+ msgid "Error, the file could not moved to : "
339
+ msgstr "Səhv, fayılı köçürmək olmaz:"
340
+
341
+ #: admin/functions.php:508
342
+ #: admin/functions.php:587
343
+ msgid "Error, the file permissions could not set"
344
+ msgstr "Səhf, fayıla icazə qoyula bilməz"
345
+
346
+ #: admin/functions.php:529
347
+ msgid " Image(s) successfully added"
348
+ msgstr "Şəkil(lər) müvəffəqiyyət ilə əlavə olunub(lar)"
349
+
350
+ #: admin/functions.php:548
351
+ msgid "Invalid upload. Error Code : "
352
+ msgstr "Müvəffəqiyyətsiz yükkləmə. Səhvin kodu:"
353
+
354
+ #: admin/functions.php:613
355
+ #, php-format
356
+ msgid "SAFE MODE Restriction in effect! You need to create the folder <strong>%s</strong> manually"
357
+ msgstr "SAFE MODE Effektdə məhdudiyyət! Siz <strong>%s</strong> əl ilə papka yaratmalısınız"
358
+
359
+ #: admin/functions.php:614
360
+ #, php-format
361
+ msgid "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"
362
+ msgstr "safe_mode qoşulu olduğu zaman, PHP yoxlayir ki hazırkı ssenarinin sahibi (%s) fayıl funksiyasında yaxud direktoriyada fayilın sahibi (%s) ilə uyğun gəlir yox isə yox."
363
+
364
+ #: admin/functions.php:660
365
+ #: admin/functions.php:728
366
+ msgid "The destination gallery does not exist"
367
+ msgstr "Qalereyanın yerləşdiyi yer təyyin olunmayıb"
368
+
369
+ #: admin/functions.php:691
370
+ #, php-format
371
+ msgid "Failed to move image %1$s to %2$s"
372
+ msgstr "%1$s şəkili %2$s -yə keçirtmək mümkün olmadı"
373
+
374
+ #: admin/functions.php:709
375
+ #, php-format
376
+ msgid "Moved %1$s picture(s) to gallery : %2$s ."
377
+ msgstr "%1$s şəkil(lər) qalereyaya : %2$s keçirdilib(lər)."
378
+
379
+ #: admin/functions.php:758
380
+ #, php-format
381
+ msgid "Failed to copy image %1$s to %2$s"
382
+ msgstr "Şəkili %1$s-dən %2$s-ya kopiya etmək mümkün deyil"
383
+
384
+ #: admin/functions.php:770
385
+ #, php-format
386
+ msgid "Failed to copy database row for picture %s"
387
+ msgstr " %s Şəkil üçün məlumat baza sətrini kopya etmək mümkün olmayıb"
388
+
389
+ #: admin/functions.php:775
390
+ #, php-format
391
+ msgid "Image %1$s (%2$s) copied as image %3$s (%4$s) &raquo; The file already existed in the destination gallery."
392
+ msgstr "Şəkil %1$s (%2$s) şəkil %3$s (%4$s) &raquo kimi kopiya edilib; Fayıl daha qalereyada yerləşdirilib."
393
+
394
+ #: admin/functions.php:778
395
+ #, php-format
396
+ msgid "Image %1$s (%2$s) copied as image %3$s (%4$s)"
397
+ msgstr "Şəkil %1$s (%2$s) şəkil %3$s (%4$s) kimi kopiya edilib"
398
+
399
+ #: admin/functions.php:787
400
+ #, php-format
401
+ msgid "Copied %1$s picture(s) to gallery: %2$s ."
402
+ msgstr "%1$s şəkil(lər) qalereyaya: %2$s kopiya edilib."
403
+
404
+ #: admin/manage-galleries.php:19
405
+ #: admin/manage-images.php:39
406
+ msgid "&laquo;"
407
+ msgstr "&laquo;"
408
+
409
+ #: admin/manage-galleries.php:20
410
+ #: admin/manage-images.php:40
411
+ msgid "&raquo;"
412
+ msgstr "&raquo;"
413
+
414
+ #: admin/manage-galleries.php:27
415
+ msgid "Gallery Overview"
416
+ msgstr "Qalereyaya Baxış"
417
+
418
+ #: admin/manage-galleries.php:30
419
+ #: admin/manage-images.php:202
420
+ #, php-format
421
+ msgid "Displaying %s&#8211;%s of %s"
422
+ msgstr "Göstərilib %s#8211;%s-dan %s"
423
+
424
+ #: admin/manage-galleries.php:42
425
+ #: admin/manage-images.php:234
426
+ #: admin/manage-images.php:243
427
+ #: admin/manage-sort.php:98
428
+ #: admin/manage-sort.php:107
429
+ msgid "ID"
430
+ msgstr "ID"
431
+
432
+ #: admin/manage-galleries.php:43
433
+ #: admin/manage-images.php:165
434
+ #: lib/meta.php:338
435
+ msgid "Title"
436
+ msgstr "Başlıq"
437
+
438
+ #: admin/manage-galleries.php:44
439
+ #: admin/manage-images.php:169
440
+ #: admin/media-upload.php:185
441
+ #: admin/skins.php:324
442
+ #: admin/skins.php:332
443
+ msgid "Description"
444
+ msgstr "Təsvir"
445
+
446
+ #: admin/manage-galleries.php:45
447
+ #: admin/manage-images.php:177
448
+ #: lib/meta.php:339
449
+ msgid "Author"
450
+ msgstr "Müəllif"
451
+
452
+ #: admin/manage-galleries.php:46
453
+ msgid "Quantity"
454
+ msgstr "Miqdarı"
455
+
456
+ #: admin/manage-galleries.php:47
457
+ #: admin/skins.php:23
458
+ #: admin/skins.php:325
459
+ #: admin/skins.php:333
460
+ msgid "Action"
461
+ msgstr "Hərəkət"
462
+
463
+ #: admin/manage-galleries.php:67
464
+ msgid "Edit"
465
+ msgstr "Redaktə etmək"
466
+
467
+ #: admin/manage-galleries.php:76
468
+ msgid "Delete this gallery ?"
469
+ msgstr "Bu qalereyanı silək?"
470
+
471
+ #: admin/manage-galleries.php:76
472
+ #: admin/manage-images.php:293
473
+ #: admin/skins.php:383
474
+ msgid "Delete"
475
+ msgstr "Silmək"
476
+
477
+ #: admin/manage-galleries.php:83
478
+ #: admin/manage-images.php:313
479
+ #: admin/manage-sort.php:139
480
+ msgid "No entries found"
481
+ msgstr "Yazılılar tapılmayıb"
482
+
483
+ #: admin/manage-images.php:16
484
+ msgid "Gallery not found."
485
+ msgstr "Qalereya tapilmayıb."
486
+
487
+ #: admin/manage-images.php:22
488
+ msgid "Sorry, you have no access here"
489
+ msgstr "Bağışlayın, bundan otrü sizda icazə yoxdur "
490
+
491
+ #: admin/manage-images.php:107
492
+ msgid "No images selected"
493
+ msgstr "Şəkillər seçilməyib"
494
+
495
+ #: admin/manage-images.php:121
496
+ #, php-format
497
+ msgid ""
498
+ "You are about to start the bulk edit for %s images \n"
499
+ " \n"
500
+ " 'Cancel' to stop, 'OK' to proceed."
501
+ msgstr ""
502
+ "Siz hazırlaşırsınız %s şəkillər\n"
503
+ " üçün həcm Вы собираетесь начать править \n"
504
+ " 'Отменаl' - прекратить, 'Ok' для продолжения."
505
+
506
+ #: admin/manage-images.php:141
507
+ msgid "Choose another gallery"
508
+ msgstr "Digər qalereyanı seçin"
509
+
510
+ #: admin/manage-images.php:161
511
+ msgid "Gallery settings"
512
+ msgstr "Qalereyanın kökləmələri"
513
+
514
+ #: admin/manage-images.php:173
515
+ msgid "Path"
516
+ msgstr "Yol"
517
+
518
+ #: admin/manage-images.php:191
519
+ msgid "Scan Folder for new images"
520
+ msgstr "Təzə şəkillərin papkasının yoxlamaq"
521
+
522
+ #: admin/manage-images.php:192
523
+ #: admin/manage-images.php:225
524
+ #: admin/manage-images.php:319
525
+ #: admin/settings.php:100
526
+ #: admin/settings.php:133
527
+ #: admin/settings.php:157
528
+ #: admin/settings.php:187
529
+ #: admin/settings.php:313
530
+ msgid "Save Changes"
531
+ msgstr "Dəyişikləri yaddaşda saxlamaq"
532
+
533
+ #: admin/manage-images.php:211
534
+ msgid "No action"
535
+ msgstr "Heç bir hərəkət edilməyib"
536
+
537
+ #: admin/manage-images.php:213
538
+ #: admin/manage.php:141
539
+ msgid "Resize images"
540
+ msgstr "Şəkillərin ölçülərin dəyişdirilməsi"
541
+
542
+ #: admin/manage-images.php:214
543
+ msgid "Delete images"
544
+ msgstr "şəkilləri ləğv etmək"
545
+
546
+ #: admin/manage-images.php:215
547
+ msgid "Import metadata"
548
+ msgstr "Metaməlimatları import etmək"
549
+
550
+ #: admin/manage-images.php:216
551
+ msgid "Copy to..."
552
+ msgstr "-ya kopiya etmək"
553
+
554
+ #: admin/manage-images.php:217
555
+ msgid "Move to..."
556
+ msgstr "-ya keçirtmək"
557
+
558
+ #: admin/manage-images.php:219
559
+ #: admin/manage-images.php:349
560
+ msgid "OK"
561
+ msgstr "OK"
562
+
563
+ #: admin/manage-images.php:221
564
+ msgid "Sort gallery"
565
+ msgstr "Qalereyanı növlərə ayırmaq"
566
+
567
+ #: admin/manage-images.php:223
568
+ msgid "Add Images"
569
+ msgstr "Şəkilləri əlavə etmək"
570
+
571
+ #: admin/manage-images.php:235
572
+ #: admin/manage-images.php:244
573
+ #: admin/media-upload.php:206
574
+ msgid "Thumbnail"
575
+ msgstr "Eskiz"
576
+
577
+ #: admin/manage-images.php:236
578
+ #: admin/manage-images.php:245
579
+ msgid "Filename / Date"
580
+ msgstr "Fayılın adı/ Tarix"
581
+
582
+ #: admin/manage-images.php:237
583
+ #: admin/manage-images.php:246
584
+ msgid "Alt & Title Text / Description"
585
+ msgstr "Mətn Текст Alt & Title / Təsviri"
586
+
587
+ #: admin/manage-images.php:286
588
+ msgid "Size: "
589
+ msgstr "Ölçü:"
590
+
591
+ #: admin/manage-images.php:291
592
+ #, php-format
593
+ msgid "View \"%s\""
594
+ msgstr "Baxış \"%s\""
595
+
596
+ #: admin/manage-images.php:291
597
+ msgid "View"
598
+ msgstr "Baxış"
599
+
600
+ #: admin/manage-images.php:292
601
+ msgid "Customize thumbnail"
602
+ msgstr "Eskizin kökləməsi"
603
+
604
+ #: admin/manage-images.php:292
605
+ msgid "Edit thumb"
606
+ msgstr "Eskizi redaktə etmək"
607
+
608
+ #: admin/manage-images.php:293
609
+ #: admin/skins.php:383
610
+ #, php-format
611
+ msgid "Delete \"%s\""
612
+ msgstr "Ləğv etmək \"%s\""
613
+
614
+ #: admin/manage-images.php:333
615
+ msgid "Select the destination gallery:"
616
+ msgstr "Qalereyanın yerləşməsini seçin:"
617
+
618
+ #: admin/manage-images.php:351
619
+ msgid "Cancel"
620
+ msgstr "Ləğv etmək"
621
+
622
+ #: admin/manage-sort.php:31
623
+ msgid "Sort order changed"
624
+ msgstr "Növlərə ayrılması qaydaları dəyişdirildi"
625
+
626
+ #: admin/manage-sort.php:54
627
+ msgid "Sort Gallery"
628
+ msgstr "Qalereyanı növlərə ayırmaq"
629
+
630
+ #: admin/manage-sort.php:58
631
+ #: admin/manage-sort.php:145
632
+ msgid "Update Sort Order"
633
+ msgstr "Növərlərə ayrılmaq qaydalarını yeniləşdirmək"
634
+
635
+ #: admin/manage-sort.php:99
636
+ #: admin/manage-sort.php:108
637
+ msgid "Thumb"
638
+ msgstr "Eskiz"
639
+
640
+ #: admin/manage-sort.php:100
641
+ #: admin/manage-sort.php:109
642
+ msgid "Filename"
643
+ msgstr "Fayılın adı"
644
+
645
+ #: admin/manage-sort.php:101
646
+ #: admin/manage-sort.php:110
647
+ msgid "Date"
648
+ msgstr "Tarix"
649
+
650
+ #: admin/manage-sort.php:102
651
+ #: admin/manage-sort.php:111
652
+ msgid "Alt &amp; Title Text"
653
+ msgstr "Alt &amp; Mətn"
654
+
655
+ #: admin/manage.php:42
656
+ #: admin/manage_thumbnail.php:17
657
+ #: admin/manage_thumbnail.php:20
658
+ msgid "Cheatin&#8217; uh?"
659
+ msgstr "Сheatin&#8217; а?"
660
+
661
+ #: admin/manage.php:89
662
+ #: admin/manage.php:111
663
+ #: admin/skins.php:226
664
+ msgid "deleted successfully"
665
+ msgstr "müvəffəqiyyətlə silindi"
666
+
667
+ #: admin/manage.php:111
668
+ msgid "Picture"
669
+ msgstr "Şəkil"
670
+
671
+ #: admin/manage.php:158
672
+ msgid "Pictures deleted successfully "
673
+ msgstr "Şəkil müvəffəqiyyətlə silindi"
674
+
675
+ #: admin/manage.php:164
676
+ msgid "Import metadata finished"
677
+ msgstr "Metaməlumatların importu başa çatdi"
678
+
679
+ #: admin/manage.php:172
680
+ msgid "Operation successful. Please clear your browser cache."
681
+ msgstr "Operasiya müvəffəqiyyətlə başa çatdı. Brauzerin keşini təmizləayin."
682
+
683
+ #: admin/manage.php:216
684
+ msgid "Update successful"
685
+ msgstr "Müvəffəqiyyətlə yeniləşdirişib"
686
+
687
+ #: admin/manage_thumbnail.php:114
688
+ msgid "Select with the mouse the area for the new thumbnail."
689
+ msgstr "Mışkanı istifadə edərək yeni eskiz üçün ərazini seçin."
690
+
691
+ #: admin/manage_thumbnail.php:128
692
+ msgid "Thumbnail updated"
693
+ msgstr "Eskiz yeniləşdirilib"
694
+
695
+ #: admin/manage_thumbnail.php:133
696
+ msgid "Error updating thumbnail."
697
+ msgstr "Yeniləşdirilən eskizin səhvi."
698
+
699
+ #: admin/manage_thumbnail.php:150
700
+ msgid "Select the area for the thumbnail from the picture on the left."
701
+ msgstr "Sol tərəfdəki şəkildən eskiz üçün ərazini seçin."
702
+
703
+ #: admin/manage_thumbnail.php:165
704
+ msgid "Update"
705
+ msgstr "Yeniləşdirmak"
706
+
707
+ #: admin/media-upload.php:9
708
+ msgid "FlAG Gallery"
709
+ msgstr "FlAG Qalereya"
710
+
711
+ #: admin/media-upload.php:126
712
+ msgid "No gallery"
713
+ msgstr "Qalereya yoxdur"
714
+
715
+ #: admin/media-upload.php:138
716
+ msgid "Select &#187;"
717
+ msgstr "Seçin &#187;"
718
+
719
+ #: admin/media-upload.php:169
720
+ msgid "Show"
721
+ msgstr "Göstərmək"
722
+
723
+ #: admin/media-upload.php:170
724
+ msgid "Hide"
725
+ msgstr "Gizlətmək"
726
+
727
+ #: admin/media-upload.php:175
728
+ msgid "Image ID:"
729
+ msgstr "Şəkilin ID-si:"
730
+
731
+ #: admin/media-upload.php:181
732
+ msgid "Alt/Title text"
733
+ msgstr "Mətn Alt/Title"
734
+
735
+ #: admin/media-upload.php:189
736
+ msgid "Alignment"
737
+ msgstr "Bərabərləşdirmə"
738
+
739
+ #: admin/media-upload.php:192
740
+ msgid "None"
741
+ msgstr "Heç nə"
742
+
743
+ #: admin/media-upload.php:194
744
+ msgid "Left"
745
+ msgstr "Solda"
746
+
747
+ #: admin/media-upload.php:196
748
+ msgid "Center"
749
+ msgstr "Mərkəzdə"
750
+
751
+ #: admin/media-upload.php:198
752
+ msgid "Right"
753
+ msgstr "Sağda"
754
+
755
+ #: admin/media-upload.php:202
756
+ msgid "Size"
757
+ msgstr "Ölçü"
758
+
759
+ #: admin/media-upload.php:208
760
+ msgid "Full size"
761
+ msgstr "Tam ölçü"
762
+
763
+ #: admin/media-upload.php:216
764
+ msgid "Insert into Post"
765
+ msgstr "Posta qoymaq "
766
+
767
+ #: admin/media-upload.php:226
768
+ msgid "Save all changes"
769
+ msgstr "Bütün dəyişiklləri yaddaşda saxlamaq"
770
+
771
+ #: admin/overview.php:13
772
+ msgid "FlAG Gallery Overview"
773
+ msgstr "Fiaq Qalereyaya Baxış"
774
+
775
+ #: admin/overview.php:106
776
+ msgid "Reset all settings to default parameter"
777
+ msgstr "Bütün kökləməri standarda keçirmək"
778
+
779
+ #: admin/overview.php:117
780
+ msgid "Uninstall sucessful ! Now delete the plugin and enjoy your life ! Good luck !"
781
+ msgstr "Silinmə müvəffəqiyyətlə keçib! İndi plagini silin və həyatdan həzz alın! Uğurlar arzu edirik!"
782
+
783
+ #: admin/overview.php:125
784
+ msgid "Plugin Home"
785
+ msgstr "Plaginin Ana Səhifəsi"
786
+
787
+ #: admin/overview.php:130
788
+ msgid "Plugin Comments"
789
+ msgstr "Plaginin Kommentariyaları"
790
+
791
+ #: admin/overview.php:135
792
+ msgid "Rate Plugin"
793
+ msgstr "Plaginin giymətləndirilməsi"
794
+
795
+ #: admin/overview.php:140
796
+ msgid "My Plugins"
797
+ msgstr "Mənim Plaginləri"
798
+
799
+ #: admin/overview.php:145
800
+ msgid "Contact Me"
801
+ msgstr "Mənim ilə əlaqə saxlamaq"
802
+
803
+ #: admin/overview.php:155
804
+ msgid "Reset settings"
805
+ msgstr "Bütün kökləmələri standartlaşdırmaq"
806
+
807
+ #: admin/overview.php:155
808
+ msgid ""
809
+ "Reset all options to default settings ?\\n"
810
+ "\\n"
811
+ "Choose [Cancel] to Stop, [OK] to proceed.\\n"
812
+ msgstr ""
813
+ "Bütün kökləmələrini standard etmək lazımdır??\\n"
814
+ "\\n"
815
+ "Saxlamaq üçün [Ləğv], davam etməsi üçün isə [OK] seçin. \\n"
816
+
817
+ #: admin/overview.php:158
818
+ msgid "Uninstall plugin"
819
+ msgstr "Plagini ləğv etmək"
820
+
821
+ #: admin/overview.php:158
822
+ msgid ""
823
+ "You are about to Uninstall this plugin from WordPress.\\n"
824
+ "This action is not reversible.\\n"
825
+ "\\n"
826
+ "Choose [Cancel] to Stop, [OK] to Uninstall.\\n"
827
+ msgstr ""
828
+ "Siz bu plagini WordPress-dən silmək istayirsiniz.\\n"
829
+ "Bu process geriqaytarılmazdır\\n"
830
+ "\\n"
831
+ "Saxlamaq üçün [Ləğv], davam etməsi üçün isə [OK] seçin. \\n"
832
+ " "
833
+
834
+ #: admin/overview.php:184
835
+ msgid "What's new at PhotoGalleryCreator.com"
836
+ msgstr "PhotoGalleryCreator.com-da nə yenilik var"
837
+
838
+ #: admin/overview.php:208
839
+ msgid "At a Glance"
840
+ msgstr "Qısa məlumat"
841
+
842
+ #: admin/overview.php:214
843
+ msgid "Image"
844
+ msgid_plural "Images"
845
+ msgstr[0] "Şəkil"
846
+ msgstr[1] "Şəkillər"
847
+
848
+ #: admin/overview.php:229
849
+ msgid "Upload pictures"
850
+ msgstr "Şəkili yükləmək"
851
+
852
+ #: admin/overview.php:230
853
+ msgid "Here you can control your images and galleries."
854
+ msgstr "Burada Siz özünüzün şəkillərinizi və qalereyanızı idarə edə bilərsiniz."
855
+
856
+ #: admin/overview.php:232
857
+ msgid "Gallery Administrator"
858
+ msgstr "Qalereyanın Administratoru"
859
+
860
+ #: admin/overview.php:232
861
+ msgid "Gallery Editor"
862
+ msgstr "Qalereyanın redaktoru"
863
+
864
+ #: admin/overview.php:233
865
+ #, php-format
866
+ msgid "You currently have %s rights."
867
+ msgstr "Sizin %s hüququnuz var"
868
+
869
+ #: admin/overview.php:239
870
+ msgid "Setup Box"
871
+ msgstr "Box-un yaradılması"
872
+
873
+ #: admin/overview.php:240
874
+ msgid "News Box"
875
+ msgstr "Yeni Box"
876
+
877
+ #: admin/overview.php:241
878
+ msgid "Welcome to FlAG Gallery !"
879
+ msgstr " FlAG Qalereyasına xoş gəlmisiniz!"
880
+
881
+ #: admin/overview.php:242
882
+ msgid "Server Settings"
883
+ msgstr "Serverin kökləmələri"
884
+
885
+ #: admin/overview.php:243
886
+ msgid "Graphic Library"
887
+ msgstr "Qrafik bibliotekası"
888
+
889
+ #: admin/overview.php:259
890
+ msgid "No GD support"
891
+ msgstr "GD-yə dəstək olunmur"
892
+
893
+ #: admin/overview.php:266
894
+ #: admin/overview.php:295
895
+ #: admin/overview.php:297
896
+ #: admin/overview.php:299
897
+ msgid "Yes"
898
+ msgstr "Bəli"
899
+
900
+ #: admin/overview.php:268
901
+ #: admin/overview.php:295
902
+ #: admin/overview.php:297
903
+ #: admin/overview.php:299
904
+ msgid "No"
905
+ msgstr "Yox"
906
+
907
+ #: admin/overview.php:279
908
+ msgid "Not set"
909
+ msgstr "Qurulmayıb"
910
+
911
+ #: admin/overview.php:281
912
+ #: admin/overview.php:283
913
+ msgid "On"
914
+ msgstr "Qoşulub"
915
+
916
+ #: admin/overview.php:281
917
+ #: admin/overview.php:283
918
+ msgid "Off"
919
+ msgstr "Söndürülüb"
920
+
921
+ #: admin/overview.php:285
922
+ #: admin/overview.php:287
923
+ #: admin/overview.php:289
924
+ #: admin/overview.php:291
925
+ #: admin/overview.php:293
926
+ msgid "N/A"
927
+ msgstr "N/A"
928
+
929
+ #: admin/overview.php:293
930
+ msgid " MByte"
931
+ msgstr "MByte"
932
+
933
+ #: admin/overview.php:302
934
+ msgid "Operating System"
935
+ msgstr "Əməliyyat Sistemi"
936
+
937
+ #: admin/overview.php:303
938
+ msgid "Server"
939
+ msgstr "Server"
940
+
941
+ #: admin/overview.php:304
942
+ msgid "Memory usage"
943
+ msgstr "Yaddaş istifadə olunub"
944
+
945
+ #: admin/overview.php:305
946
+ msgid "MYSQL Version"
947
+ msgstr " MYSQL-un Versiyası"
948
+
949
+ #: admin/overview.php:306
950
+ msgid "SQL Mode"
951
+ msgstr "SQL-un rejimi"
952
+
953
+ #: admin/overview.php:307
954
+ msgid "PHP Version"
955
+ msgstr "PHP Versiyası"
956
+
957
+ #: admin/overview.php:308
958
+ msgid "PHP Safe Mode"
959
+ msgstr "PHP-nın Təhlükəsiz Rejimi "
960
+
961
+ #: admin/overview.php:309
962
+ msgid "PHP Allow URL fopen"
963
+ msgstr "PHP-nin URL fopen icazəsi"
964
+
965
+ #: admin/overview.php:310
966
+ msgid "PHP Memory Limit"
967
+ msgstr "PHP yaddaşın məhduddluğu"
968
+
969
+ #: admin/overview.php:311
970
+ msgid "PHP Max Upload Size"
971
+ msgstr "PHP maksimal yüklənən ölçüsü"
972
+
973
+ #: admin/overview.php:312
974
+ msgid "PHP Max Post Size"
975
+ msgstr "PHP yazılışın maksimal olçüsü"
976
+
977
+ #: admin/overview.php:313
978
+ msgid "PHP Max Script Execute Time"
979
+ msgstr "PHP skriptin maksimal işləmə vaxtı"
980
+
981
+ #: admin/overview.php:314
982
+ msgid "PHP Exif support"
983
+ msgstr "PHP Exif dəstəyi"
984
+
985
+ #: admin/overview.php:315
986
+ msgid "PHP IPTC support"
987
+ msgstr "PHP IPTC dəstəyi"
988
+
989
+ #: admin/overview.php:316
990
+ msgid "PHP XML support"
991
+ msgstr "PHP XML dəstəyi"
992
+
993
+ #: admin/settings.php:32
994
+ msgid "Update Successfully"
995
+ msgstr "Müvəffəqiyyətlə yeniləşdirilib"
996
+
997
+ #: admin/settings.php:50
998
+ msgid "Updated capabilities"
999
+ msgstr "Yeniləşdirilmiş imkanlar"
1000
+
1001
+ #: admin/settings.php:61
1002
+ #: admin/settings.php:74
1003
+ msgid "General Options"
1004
+ msgstr "Ümumi kökləmələr"
1005
+
1006
+ #: admin/settings.php:62
1007
+ msgid "Thumbnails"
1008
+ msgstr "Eskizlər"
1009
+
1010
+ #: admin/settings.php:63
1011
+ msgid "Images"
1012
+ msgstr "Şəkillər"
1013
+
1014
+ #: admin/settings.php:64
1015
+ #: admin/settings.php:164
1016
+ msgid "Sorting"
1017
+ msgstr "Sortlara ayırma"
1018
+
1019
+ #: admin/settings.php:66
1020
+ #: admin/settings.php:223
1021
+ msgid "Colors"
1022
+ msgstr "Rənglər"
1023
+
1024
+ #: admin/settings.php:68
1025
+ msgid "Roles"
1026
+ msgstr "Rollar"
1027
+
1028
+ #: admin/settings.php:80
1029
+ msgid "Gallery path"
1030
+ msgstr "Qalereyanın yolları"
1031
+
1032
+ #: admin/settings.php:82
1033
+ msgid "This is the default path for all galleries"
1034
+ msgstr "Bu yol standard olaraq bütün qalereya üçündür"
1035
+
1036
+ #: admin/settings.php:85
1037
+ msgid "Default flash size (W x H)"
1038
+ msgstr "Standard ölçü flash (W x H)"
1039
+
1040
+ #: admin/settings.php:90
1041
+ msgid "Delete image files"
1042
+ msgstr "Şəkil fayıllarını silmək"
1043
+
1044
+ #: admin/settings.php:92
1045
+ msgid "Delete files, when removing a gallery in the database"
1046
+ msgstr "Qalereya məlumat bazasından silinən vaxtı fayılları silmək"
1047
+
1048
+ #: admin/settings.php:95
1049
+ msgid "Activate Media RSS feed"
1050
+ msgstr "Media RSS abunəsini aktivizasiya etmək"
1051
+
1052
+ #: admin/settings.php:97
1053
+ msgid "A RSS feed will be added to you blog header."
1054
+ msgstr "RSS göndərişlər sizin bloqunun başlıqlarına əlavə olunacaqlar"
1055
+
1056
+ #: admin/settings.php:107
1057
+ msgid "Thumbnail settings"
1058
+ msgstr "Eskizlərin kökləmələri"
1059
+
1060
+ #: admin/settings.php:111
1061
+ msgid "Please note : If you change the settings, you need to recreate the thumbnails under -> Manage Gallery ."
1062
+ msgstr "Zəhmət olmasa, diqqət edin: əgər siz kökləmələri dəyişsəniz onad eskizləri yenidən düzəltmək lazımdır -> Qalereyanı idarə etmək."
1063
+
1064
+ #: admin/settings.php:114
1065
+ msgid "Width x Height (in pixel)"
1066
+ msgstr "Eni х Hündürlüyü (pikseldə)"
1067
+
1068
+ #: admin/settings.php:116
1069
+ msgid "These values are maximum values "
1070
+ msgstr "Bu rəqəmlər maksimal rəqəmlərdilər"
1071
+
1072
+ #: admin/settings.php:119
1073
+ msgid "Set fix dimension"
1074
+ msgstr "Müəyyən edilmiş ölçüləri qoymaq"
1075
+
1076
+ #: admin/settings.php:121
1077
+ msgid "Ignore the aspect ratio, no portrait thumbnails"
1078
+ msgstr "Proporsiyanı nəzərə almamaq"
1079
+
1080
+ #: admin/settings.php:124
1081
+ msgid "Crop square thumbnail from image"
1082
+ msgstr "Şəkildən kvadrat eskiz kəsmək"
1083
+
1084
+ #: admin/settings.php:126
1085
+ msgid "Create square thumbnails, use only the width setting :"
1086
+ msgstr "Yalnız enin kökləmələrini istifadə edərək kvadrat eskiz düzəltmək :"
1087
+
1088
+ #: admin/settings.php:129
1089
+ msgid "Thumbnail quality"
1090
+ msgstr "Eskizlərin keyfiyyəti"
1091
+
1092
+ #: admin/settings.php:140
1093
+ msgid "Image settings"
1094
+ msgstr "Şəkillərin kökləmələri"
1095
+
1096
+ #: admin/settings.php:146
1097
+ msgid "Resize Images"
1098
+ msgstr "Şəkillərin ölçülərin dəyişmək"
1099
+
1100
+ #: admin/settings.php:149
1101
+ msgid "Width x Height (in pixel). Flash Album Gallery will keep ratio size"
1102
+ msgstr "Eni х Hündürlüyü (pikseldə). FlAGallery tərəflərin nisbətin saxlayacaq"
1103
+
1104
+ #: admin/settings.php:152
1105
+ msgid "Image quality"
1106
+ msgstr "Şəkilin keyfiyyəti"
1107
+
1108
+ #: admin/settings.php:168
1109
+ msgid "Sort options"
1110
+ msgstr "Sortlara ayrılması opsiyaları"
1111
+
1112
+ #: admin/settings.php:171
1113
+ msgid "Sort thumbnails"
1114
+ msgstr "Eskizlari sortlara ayrılması"
1115
+
1116
+ #: admin/settings.php:173
1117
+ msgid "Custom order"
1118
+ msgstr "İndividual sifariş"
1119
+
1120
+ #: admin/settings.php:174
1121
+ msgid "Image ID"
1122
+ msgstr "Şəkilin ID "
1123
+
1124
+ #: admin/settings.php:175
1125
+ msgid "File name"
1126
+ msgstr "Fayılın adı"
1127
+
1128
+ #: admin/settings.php:176
1129
+ msgid "Alt / Title text"
1130
+ msgstr "Mətn Alt / Title"
1131
+
1132
+ #: admin/settings.php:177
1133
+ msgid "Date / Time"
1134
+ msgstr "Tarix / Vaxt"
1135
+
1136
+ #: admin/settings.php:181
1137
+ msgid "Sort direction"
1138
+ msgstr "Sortirovkanın səmti"
1139
+
1140
+ #: admin/settings.php:182
1141
+ msgid "Ascending"
1142
+ msgstr "artıma doğru"
1143
+
1144
+ #: admin/settings.php:183
1145
+ msgid "Descending"
1146
+ msgstr "azalmağa doğru"
1147
+
1148
+ #: admin/settings.php:227
1149
+ msgid "Background Color"
1150
+ msgstr "Fonun rəngi"
1151
+
1152
+ #: admin/settings.php:233
1153
+ msgid "Buttons Background Color"
1154
+ msgstr "Düymənin fonun fəngi"
1155
+
1156
+ #: admin/settings.php:239
1157
+ msgid "Buttons Text Color"
1158
+ msgstr "Mətnin düyməsinin rəngi"
1159
+
1160
+ #: admin/settings.php:250
1161
+ msgid "Category Buttons Color"
1162
+ msgstr "Kateqoriya düyməsinin rəngi"
1163
+
1164
+ #: admin/settings.php:261
1165
+ msgid "Category Buttons Text Color"
1166
+ msgstr "Kateqoriya düyməsi mətninin rəngi"
1167
+
1168
+ #: admin/settings.php:272
1169
+ msgid "Thumbs Rollover Color"
1170
+ msgstr "Eskizin çevirmə rəngi"
1171
+
1172
+ #: admin/settings.php:283
1173
+ msgid "Main Title"
1174
+ msgstr "Əsas başlıq"
1175
+
1176
+ #: admin/settings.php:289
1177
+ msgid "Category Title"
1178
+ msgstr "Kateqoriyanın başlığı"
1179
+
1180
+ #: admin/settings.php:295
1181
+ msgid "Item Background"
1182
+ msgstr "İnstrument Fon"
1183
+
1184
+ #: admin/settings.php:301
1185
+ msgid "Item Title"
1186
+ msgstr "İnstrumetn Başlıq"
1187
+
1188
+ #: admin/settings.php:307
1189
+ msgid "Item Description"
1190
+ msgstr "İnstrument Təsvir"
1191
+
1192
+ #: admin/settings.php:322
1193
+ msgid "Roles / capabilities"
1194
+ msgstr "Rollar / imkanlar"
1195
+
1196
+ #: admin/settings.php:323
1197
+ msgid "Select the lowest role which should be able to access the follow capabilities. Flash Album Gallery supports the standard roles from WordPress."
1198
+ msgstr "Minimal rolu olan istifadəçini seçin, hansı ki sonraki imkanlara yol tapacaq. FlAGallery WordPress-dən olan standartları dəstək verir."
1199
+
1200
+ #: admin/settings.php:326
1201
+ msgid "Main Flash Album Gallery overview"
1202
+ msgstr "Əsas FLAGallery baxış"
1203
+
1204
+ #: admin/settings.php:330
1205
+ msgid "Use TinyMCE Button / Upload tab"
1206
+ msgstr "TinyMCE düyməsini istifadə etmək / Nişanı əlavə etmək"
1207
+
1208
+ #: admin/settings.php:334
1209
+ msgid "Add gallery / Upload images"
1210
+ msgstr "Qalereyanı əlavə etmək / Şəkili yükləmək"
1211
+
1212
+ #: admin/settings.php:338
1213
+ msgid "Manage gallery"
1214
+ msgstr "Qalereyanı idarə etmək "
1215
+
1216
+ #: admin/settings.php:342
1217
+ msgid "Manage others gallery"
1218
+ msgstr "Digər qalereyalarını idarə etmək"
1219
+
1220
+ #: admin/settings.php:346
1221
+ msgid "Change skin"
1222
+ msgstr "Skini dəyişmək"
1223
+
1224
+ #: admin/settings.php:350
1225
+ msgid "Add skins"
1226
+ msgstr "Skini əlavə etmək"
1227
+
1228
+ #: admin/settings.php:354
1229
+ msgid "Delete skins"
1230
+ msgstr "Skini silmək"
1231
+
1232
+ #: admin/settings.php:358
1233
+ msgid "Change options"
1234
+ msgstr "Opsiyalarını dəyişmək"
1235
+
1236
+ #: admin/settings.php:362
1237
+ msgid "Update capabilities"
1238
+ msgstr "İmkanları yeniləşdirmək"
1239
+
1240
+ #: admin/skins.php:20
1241
+ #: admin/skins.php:28
1242
+ msgid "Add new skin"
1243
+ msgstr "Yeni skini əlavə etmək"
1244
+
1245
+ #: admin/skins.php:21
1246
+ msgid "Want more skins?"
1247
+ msgstr "Daha da çox skin istəyirsiniz?"
1248
+
1249
+ #: admin/skins.php:29
1250
+ msgid "Install a skin in .zip format"
1251
+ msgstr ".zip formatında skini quraşdırın"
1252
+
1253
+ #: admin/skins.php:30
1254
+ msgid "If you have a skin in a .zip format, You may install it by uploading it here."
1255
+ msgstr "Əgər Sizdə skin .zip formatında varsa, onda Siz onu burdan yükləyərək quraşdıra bilərsiniz."
1256
+
1257
+ #: admin/skins.php:34
1258
+ msgid "Install Now"
1259
+ msgstr "İndi qurşdırmaq"
1260
+
1261
+ #: admin/skins.php:39
1262
+ msgid "More skins"
1263
+ msgstr "Daha da çox skinlər"
1264
+
1265
+ #: admin/skins.php:40
1266
+ msgid "If you want more skins, You may get it at."
1267
+ msgstr "Əgrə Siz daha da çox skin istayirsiniz isə onda Siz onları əldə etməlisiniz."
1268
+
1269
+ #: admin/skins.php:47
1270
+ msgid "Install info"
1271
+ msgstr "Quraşdırma məlumatı"
1272
+
1273
+ #: admin/skins.php:58
1274
+ #: admin/skins.php:88
1275
+ msgid "No skin Specified"
1276
+ msgstr "Göstərilən skin mövcud deyil"
1277
+
1278
+ #: admin/skins.php:61
1279
+ #, php-format
1280
+ msgid "Installing Skin from file: %s"
1281
+ msgstr "Skinin %s fayıldan quraşdırılması"
1282
+
1283
+ #: admin/skins.php:70
1284
+ #, php-format
1285
+ msgid "The uploaded file could not be moved to %s."
1286
+ msgstr "Yüklənmi�