Version Description
Download this release
Release Info
Developer | pasyuk |
Plugin | Gallery – Flagallery Photo Portfolio |
Version | 5.1.8 |
Comparing to | |
See all releases |
Code changes from version 4.36 to 5.1.8
- license.txt → _license.txt +0 -0
- admin/addgallery.php +31 -36
- admin/admin.php +97 -38
- admin/ajax.php +160 -21
- admin/banner-box.php +48 -48
- admin/banner-sort.php +14 -14
- admin/banner.functions.php +164 -172
- admin/css/flagadmin.css +327 -8
- admin/css/flagallery.css +0 -9
- admin/css/flagallery_nocrawler.css +0 -12
- admin/css/flagallery_noflash.css +0 -26
- admin/css/tabs.css +6 -2
- admin/db_skin_color_scheme.php +0 -154
- admin/flag_install.php +215 -237
- admin/flagframe-tool.php +96 -79
- admin/functions.php +372 -349
- admin/get_skin.php +3 -2
- admin/grab_meta.php +5 -5
- admin/images/appstore_button.png +0 -0
- admin/images/like.png +0 -0
- admin/images/views.png +0 -0
- admin/jgallery.php +0 -159
- admin/js/disablescroll.js +0 -55
- admin/js/farbtastic-nosharp.js +0 -345
- admin/js/flag.ajax.js +1 -1
- admin/js/flagscroll.js +0 -33
- admin/js/images/fancy_close.png +0 -0
- admin/js/images/fancy_loading.png +0 -0
- admin/js/images/fancy_nav_left.png +0 -0
- admin/js/images/fancy_nav_right.png +0 -0
- admin/js/images/fancy_nav_slide.png +0 -0
- admin/js/images/fancy_shadow_n.png +0 -0
- admin/js/images/fancy_shadow_s.png +0 -0
- admin/js/images/fancy_shadow_w.png +0 -0
- admin/js/images/fancy_title_over.png +0 -0
- admin/js/images/fancybox-y.png +0 -0
- admin/js/jquery.fancybox-1.3.4.pack.js +0 -46
- admin/js/jquery.js +0 -18
- admin/js/jqueryFileTree/images/zip.png +0 -0
- admin/js/loader.swf +0 -0
- admin/js/photoswipe/images/icons.png +0 -0
- admin/js/photoswipe/images/icons@2x.png +0 -0
- admin/js/photoswipe/klass.min.js +0 -8
- admin/js/plupload/jquery.ui.plupload/img/plupload.png +0 -0
- admin/js/script.js +0 -292
- admin/js/swfaddress-optimizer.js +0 -1
- admin/js/swfaddress.js +0 -1
- admin/js/swfmousewheel.js +0 -51
- admin/js/swfobject.js +0 -31
- admin/js/themes/default/arrows.png +0 -0
- admin/js/themes/default/bullets.png +0 -0
- admin/js/widgets_admin.js +1 -1
- admin/manage-banner.php +45 -41
- admin/manage-galleries.php +407 -363
- admin/manage-images.php +63 -68
- admin/manage-playlist.php +58 -54
- admin/manage-sort.php +16 -16
- admin/manage-video.php +44 -39
- admin/manage.php +22 -24
- admin/manage_thumbnail.php +12 -19
- admin/media-upload.php +9 -9
- admin/meta_box.php +45 -67
- admin/music-box.php +52 -58
- admin/overview.php +94 -73
- admin/playlist-sort.php +14 -15
- admin/playlist.functions.php +171 -134
- admin/settings.php +620 -571
- admin/showmeta.php +14 -14
- admin/skin_functions.php +200 -0
- admin/skin_install.php +14 -14
- admin/skin_options.php +58 -105
- admin/skins.php +637 -553
- admin/tinymce/editor_plugin.js +2 -2
- admin/tinymce/img/butt2.png +0 -0
- admin/tinymce/img/button_bg.png +0 -0
- admin/tinymce/img/fade-butt.png +0 -0
- admin/tinymce/langs/de.js +1 -1
- admin/tinymce/langs/de_de.js +1 -1
- admin/tinymce/langs/en.js +1 -1
- admin/tinymce/langs/en_US.js +1 -1
- admin/tinymce/tinymce.php +3 -6
- admin/tinymce/window.php +59 -81
- admin/tuning.php +11 -8
- admin/upgrade.php +36 -43
- admin/video-box.php +52 -52
- admin/video-sort.php +14 -14
- admin/video.functions.php +174 -136
- admin/{flv_preview.php → video_preview.php} +0 -1
- admin/wpmu.php +11 -11
- assets/fancybox/images/blank.gif +0 -0
- assets/fancybox/images/fancy_close.png +0 -0
- assets/fancybox/images/fancy_loading.png +0 -0
- assets/fancybox/images/fancy_nav_left.png +0 -0
- assets/fancybox/images/fancy_nav_right.png +0 -0
- assets/fancybox/images/fancy_nav_slide.png +0 -0
- {admin/js → assets/fancybox}/images/fancy_shadow_e.png +0 -0
- assets/fancybox/images/fancy_shadow_n.png +0 -0
- {admin/js → assets/fancybox}/images/fancy_shadow_ne.png +0 -0
- {admin/js → assets/fancybox}/images/fancy_shadow_nw.png +0 -0
- assets/fancybox/images/fancy_shadow_s.png +0 -0
- {admin/js → assets/fancybox}/images/fancy_shadow_se.png +0 -0
- {admin/js → assets/fancybox}/images/fancy_shadow_sw.png +0 -0
- assets/fancybox/images/fancy_shadow_w.png +0 -0
- {admin/js → assets/fancybox}/images/fancy_title_left.png +0 -0
- {admin/js → assets/fancybox}/images/fancy_title_main.png +0 -0
- assets/fancybox/images/fancy_title_over.png +0 -0
- {admin/js → assets/fancybox}/images/fancy_title_right.png +0 -0
- {admin/js → assets/fancybox}/images/fancybox-x.png +0 -0
- assets/fancybox/images/fancybox-y.png +0 -0
- {admin/js → assets/fancybox}/images/fancybox.png +0 -0
- {admin/js → assets/fancybox}/jquery.fancybox-1.3.4.css +0 -0
- assets/fancybox/jquery.fancybox-1.3.4.pack.js +1 -0
- assets/flagallery.css +4 -0
- assets/jplayer/jquery.jplayer.min.js +3 -0
- assets/jplayer/jquery.jplayer.swf +0 -0
- admin/js/jquery.easing-1.3.pack.js → assets/jq-plugins/jquery.easing.js +19 -2
- assets/mag-popup/LICENSE.txt +20 -0
- assets/mag-popup/jquery.magnific-popup.js +1860 -0
- assets/mag-popup/jquery.magnific-popup.min.js +4 -0
- assets/mag-popup/magnific-popup.css +351 -0
- assets/mediaelement/mediaelement-and-player.min.js +12 -0
license.txt → _license.txt
RENAMED
File without changes
|
admin/addgallery.php
CHANGED
@@ -28,15 +28,14 @@ function flag_admin_add_gallery() {
|
|
28 |
if ( $_POST['uploadimage'] ) {
|
29 |
check_admin_referer( 'flag_upload' );
|
30 |
|
31 |
-
$flag->options['thumbWidth'] = intval( $_POST['thumbWidth'] ) ? intval( $_POST['thumbWidth'] ) :
|
32 |
-
$flag->options['thumbHeight'] = intval( $_POST['thumbHeight'] ) ? intval( $_POST['thumbHeight'] ) :
|
33 |
-
$flag->options['thumbFix'] = isset( $_POST['thumbFix'] ) ? 1 : 0;
|
34 |
update_option( 'flag_options', $flag->options );
|
35 |
|
36 |
if ( $_FILES['MF__F_0_0']['error'] == 0 ) {
|
37 |
flagAdmin::upload_images();
|
38 |
} else {
|
39 |
-
flagGallery::show_error( __( 'Upload failed!', '
|
40 |
}
|
41 |
}
|
42 |
if ( $_POST['importfolder'] ) {
|
@@ -89,36 +88,36 @@ function flag_admin_add_gallery() {
|
|
89 |
<div id="slider" class="flag-wrap">
|
90 |
|
91 |
<ul id="tabs" class="tabs">
|
92 |
-
<li class="selected"><a href="#" rel="addgallery"><?php _e( 'Add new gallery', '
|
93 |
-
<li><a href="#" rel="uploadimage"><?php _e( 'Upload Images', '
|
94 |
<?php if ( ! IS_WPMU || current_user_can( 'FlAG Import folder' ) ) { ?>
|
95 |
-
<li><a href="#" rel="importfolder"><?php _e( 'Import image folder', '
|
96 |
<?php } ?>
|
97 |
</ul>
|
98 |
|
99 |
<!-- create gallery -->
|
100 |
<div id="addgallery" class="cptab">
|
101 |
-
<h2><?php _e( 'Create a new gallery', '
|
102 |
|
103 |
<form name="addgallery" id="addgallery_form" method="POST" action="<?php echo $filepath; ?>" accept-charset="utf-8">
|
104 |
<?php wp_nonce_field( 'flag_addgallery' ); ?>
|
105 |
<table class="form-table" style="width: auto;">
|
106 |
<tr>
|
107 |
<th scope="col" colspan="2" style="padding-bottom: 0;">
|
108 |
-
<strong><?php _e( 'New Gallery', '
|
109 |
</tr>
|
110 |
<tr valign="top">
|
111 |
<td><input type="text" size="65" name="galleryname" value=""/><br/>
|
112 |
<?php if ( ! IS_WPMU ) { ?>
|
113 |
-
<?php _e( 'Create a new , empty gallery below the folder', '
|
114 |
<strong><?php echo $defaultpath; ?></strong><br/>
|
115 |
<?php } ?>
|
116 |
-
<i>( <?php _e( 'Allowed characters for file and folder names are', '
|
117 |
</td>
|
118 |
<?php do_action( 'flag_add_new_gallery_form' ); ?>
|
119 |
-
<td>
|
120 |
<div class="submit" style="margin: 0; padding: 0;">
|
121 |
-
<input class="button-primary" type="submit" name="addgallery" value="<?php _e( 'Add gallery', '
|
122 |
</div>
|
123 |
</td>
|
124 |
</tr>
|
@@ -128,16 +127,16 @@ function flag_admin_add_gallery() {
|
|
128 |
</div>
|
129 |
<!-- upload images -->
|
130 |
<div id="uploadimage" class="cptab">
|
131 |
-
<h2><?php _e( 'Upload images', '
|
132 |
|
133 |
<form name="uploadimage" id="gmUpload" method="POST" enctype="multipart/form-data" action="<?php echo $filepath; ?>" accept-charset="utf-8">
|
134 |
<?php wp_nonce_field( 'flag_upload' ); ?>
|
135 |
<table class="flag-form-table">
|
136 |
<tr valign="top">
|
137 |
<td style="width: 216px;">
|
138 |
-
<label for="galleryselect"><?php _e( 'Upload images in', '
|
139 |
<select name="galleryselect" id="galleryselect" style="width: 200px">
|
140 |
-
<option value="0"><?php _e( 'Choose gallery', '
|
141 |
<?php $ingallery = isset( $_GET['gid'] ) ? (int) $_GET['gid'] : '';
|
142 |
foreach ( $gallerylist as $gallery ) {
|
143 |
if ( ! flagAdmin::can_manage_this_gallery( $gallery->author ) ) {
|
@@ -160,22 +159,19 @@ function flag_admin_add_gallery() {
|
|
160 |
} ?>
|
161 |
<br/>
|
162 |
|
163 |
-
<p><?php _e( 'Thumbnail WIDTH x HEIGHT (in pixel)', '
|
164 |
-
<br/><input type="
|
165 |
-
<input type="
|
166 |
<br/>
|
167 |
-
<small><?php _e( 'These values are maximum values ', '
|
168 |
</p>
|
169 |
-
<p>
|
170 |
-
<label><input type="checkbox" name="thumbFix" id="thumbFix" value="1" <?php checked( '1', $flag->options['thumbFix'] ); ?> /> <?php _e( 'Ignore the aspect ratio, no portrait thumbnails', 'flag' ); ?>
|
171 |
-
</label></p>
|
172 |
|
173 |
<div class="submit">
|
174 |
<span class="useflashupload">
|
175 |
<?php if ( $flag->options['swfUpload'] ) { ?>
|
176 |
-
<input type="submit" class="button-secondary" name="disable_flash" id="disable_flash" title="<?php _e( 'The batch upload via Plupload, disable it if you have problems', '
|
177 |
<?php } else { ?>
|
178 |
-
<input type="submit" class="button-secondary" name="enable_flash" id="enable_flash" title="<?php _e( 'Upload multiple files at once by ctrl/shift-selecting in dialog', '
|
179 |
<?php } ?>
|
180 |
</span>
|
181 |
|
@@ -187,11 +183,11 @@ function flag_admin_add_gallery() {
|
|
187 |
<td>
|
188 |
<div id="pluploadUploader">
|
189 |
<?php if ( ! $flag->options['swfUpload']) { ?>
|
190 |
-
<strong><?php _e( 'Upload image(s):', '
|
191 |
<input type="file" name="imagefiles[]" id="imagefiles" size="35" class="imagefiles"/>
|
192 |
</div>
|
193 |
<span id="choosegalfirst">
|
194 |
-
<input class="button-primary" type="submit" name="uploadimage" id="uploadimage_btn" value="<?php _e( 'Upload images', '
|
195 |
<span class="disabledbut" style="display: none;"></span>
|
196 |
</span>
|
197 |
<?php } ?>
|
@@ -239,7 +235,6 @@ function flag_admin_add_gallery() {
|
|
239 |
galleryselect: jQuery('#galleryselect').val(),
|
240 |
thumbw: jQuery('#thumbWidth').val(),
|
241 |
thumbh: jQuery('#thumbHeight').val(),
|
242 |
-
thumbf: jQuery('#thumbFix').prop("checked"),
|
243 |
last: files_remaining,
|
244 |
action: 'flag_plupload_uploader',
|
245 |
_wpnonce: '<?php echo $nonce; ?>'
|
@@ -280,7 +275,7 @@ function flag_admin_add_gallery() {
|
|
280 |
});
|
281 |
uploader.bind('UploadComplete', function(up, files){
|
282 |
console.log('[UploadComplete]', files);
|
283 |
-
jQuery('<div/>').addClass('success').html('<?php _e('Done!', '
|
284 |
});
|
285 |
|
286 |
jQuery("#gmUpload").on('click', '.ui-button-disabled', function(){
|
@@ -307,7 +302,7 @@ function flag_admin_add_gallery() {
|
|
307 |
jQuery(document).ready(function(){
|
308 |
jQuery('#imagefiles').MultiFile({
|
309 |
STRING: {
|
310 |
-
remove: '<?php _e('remove', '
|
311 |
}
|
312 |
});
|
313 |
|
@@ -336,26 +331,26 @@ function flag_admin_add_gallery() {
|
|
336 |
<?php if ( ! IS_WPMU || current_user_can( 'FlAG Import folder' ) ) { ?>
|
337 |
<!-- import folder -->
|
338 |
<div id="importfolder" class="cptab">
|
339 |
-
<h2><?php _e( 'Import image folder', '
|
340 |
|
341 |
<form name="importfolder" id="importfolder_form" method="POST" action="<?php echo $filepath; ?>" accept-charset="utf-8">
|
342 |
<?php wp_nonce_field( 'flag_addgallery' ); ?>
|
343 |
<table class="form-table">
|
344 |
<tr valign="top">
|
345 |
-
<th scope="row"><?php _e( 'Import from Server path:', '
|
346 |
<td>
|
347 |
-
<input type="text" size="35" id="galleryfolder" name="galleryfolder" value="<?php echo $defaultpath; ?>"/><span class="browsefiles button" style="display:none"><?php _e( 'Browse...', "
|
348 |
|
349 |
<div id="file_browser"></div>
|
350 |
<div><?php echo $maxsize; ?>
|
351 |
-
<?php if (
|
352 |
-
<br/><?php _e( ' Please note : For safe-mode = ON you need to add the subfolder thumbs manually', '
|
353 |
</div>
|
354 |
</td>
|
355 |
</tr>
|
356 |
</table>
|
357 |
<div class="submit">
|
358 |
-
<input class="button-primary" type="submit" name="importfolder" value="<?php _e( 'Import folder', '
|
359 |
</div>
|
360 |
</form>
|
361 |
</div>
|
28 |
if ( $_POST['uploadimage'] ) {
|
29 |
check_admin_referer( 'flag_upload' );
|
30 |
|
31 |
+
$flag->options['thumbWidth'] = intval( $_POST['thumbWidth'] ) ? intval( $_POST['thumbWidth'] ) : 300;
|
32 |
+
$flag->options['thumbHeight'] = intval( $_POST['thumbHeight'] ) ? intval( $_POST['thumbHeight'] ) : 300;
|
|
|
33 |
update_option( 'flag_options', $flag->options );
|
34 |
|
35 |
if ( $_FILES['MF__F_0_0']['error'] == 0 ) {
|
36 |
flagAdmin::upload_images();
|
37 |
} else {
|
38 |
+
flagGallery::show_error( __( 'Upload failed!', 'flash-album-gallery' ) );
|
39 |
}
|
40 |
}
|
41 |
if ( $_POST['importfolder'] ) {
|
88 |
<div id="slider" class="flag-wrap">
|
89 |
|
90 |
<ul id="tabs" class="tabs">
|
91 |
+
<li class="selected"><a href="#" rel="addgallery"><?php _e( 'Add new gallery', 'flash-album-gallery' ); ?></a></li>
|
92 |
+
<li><a href="#" rel="uploadimage"><?php _e( 'Upload Images', 'flash-album-gallery' ); ?></a></li>
|
93 |
<?php if ( ! IS_WPMU || current_user_can( 'FlAG Import folder' ) ) { ?>
|
94 |
+
<li><a href="#" rel="importfolder"><?php _e( 'Import image folder', 'flash-album-gallery' ); ?></a></li>
|
95 |
<?php } ?>
|
96 |
</ul>
|
97 |
|
98 |
<!-- create gallery -->
|
99 |
<div id="addgallery" class="cptab">
|
100 |
+
<h2><?php _e( 'Create a new gallery', 'flash-album-gallery' ); ?></h2>
|
101 |
|
102 |
<form name="addgallery" id="addgallery_form" method="POST" action="<?php echo $filepath; ?>" accept-charset="utf-8">
|
103 |
<?php wp_nonce_field( 'flag_addgallery' ); ?>
|
104 |
<table class="form-table" style="width: auto;">
|
105 |
<tr>
|
106 |
<th scope="col" colspan="2" style="padding-bottom: 0;">
|
107 |
+
<strong><?php _e( 'New Gallery', 'flash-album-gallery' ); ?></strong></th>
|
108 |
</tr>
|
109 |
<tr valign="top">
|
110 |
<td><input type="text" size="65" name="galleryname" value=""/><br/>
|
111 |
<?php if ( ! IS_WPMU ) { ?>
|
112 |
+
<?php _e( 'Create a new , empty gallery below the folder', 'flash-album-gallery' ); ?>
|
113 |
<strong><?php echo $defaultpath; ?></strong><br/>
|
114 |
<?php } ?>
|
115 |
+
<i>( <?php _e( 'Allowed characters for file and folder names are', 'flash-album-gallery' ); ?>: a-z, A-Z, 0-9, -, _ )</i>
|
116 |
</td>
|
117 |
<?php do_action( 'flag_add_new_gallery_form' ); ?>
|
118 |
+
<td style="vertical-align:top;">
|
119 |
<div class="submit" style="margin: 0; padding: 0;">
|
120 |
+
<input class="button-primary" type="submit" name="addgallery" value="<?php _e( 'Add gallery', 'flash-album-gallery' ); ?>"/>
|
121 |
</div>
|
122 |
</td>
|
123 |
</tr>
|
127 |
</div>
|
128 |
<!-- upload images -->
|
129 |
<div id="uploadimage" class="cptab">
|
130 |
+
<h2><?php _e( 'Upload images', 'flash-album-gallery' ); ?></h2>
|
131 |
|
132 |
<form name="uploadimage" id="gmUpload" method="POST" enctype="multipart/form-data" action="<?php echo $filepath; ?>" accept-charset="utf-8">
|
133 |
<?php wp_nonce_field( 'flag_upload' ); ?>
|
134 |
<table class="flag-form-table">
|
135 |
<tr valign="top">
|
136 |
<td style="width: 216px;">
|
137 |
+
<label for="galleryselect"><?php _e( 'Upload images in', 'flash-album-gallery' ); ?> *</label>
|
138 |
<select name="galleryselect" id="galleryselect" style="width: 200px">
|
139 |
+
<option value="0"><?php _e( 'Choose gallery', 'flash-album-gallery' ); ?></option>
|
140 |
<?php $ingallery = isset( $_GET['gid'] ) ? (int) $_GET['gid'] : '';
|
141 |
foreach ( $gallerylist as $gallery ) {
|
142 |
if ( ! flagAdmin::can_manage_this_gallery( $gallery->author ) ) {
|
159 |
} ?>
|
160 |
<br/>
|
161 |
|
162 |
+
<p><?php _e( 'Thumbnail WIDTH x HEIGHT (in pixel)', 'flash-album-gallery' ); ?> *
|
163 |
+
<br/><input type="number" size="5" maxlength="5" min="300" max="800" name="thumbWidth" id="thumbWidth" value="<?php echo $flag->options['thumbWidth']; ?>"/> x
|
164 |
+
<input type="number" size="5" maxlength="5" min="300" max="800" name="thumbHeight" id="thumbHeight" value="<?php echo $flag->options['thumbHeight']; ?>"/>
|
165 |
<br/>
|
166 |
+
<small><?php _e( 'These values are maximum values ', 'flash-album-gallery' ); ?></small>
|
167 |
</p>
|
|
|
|
|
|
|
168 |
|
169 |
<div class="submit">
|
170 |
<span class="useflashupload">
|
171 |
<?php if ( $flag->options['swfUpload'] ) { ?>
|
172 |
+
<input type="submit" class="button-secondary" name="disable_flash" id="disable_flash" title="<?php _e( 'The batch upload via Plupload, disable it if you have problems', 'flash-album-gallery' ); ?>" value="<?php _e( 'Switch to Browser Upload', 'flash-album-gallery' ); ?>"/>
|
173 |
<?php } else { ?>
|
174 |
+
<input type="submit" class="button-secondary" name="enable_flash" id="enable_flash" title="<?php _e( 'Upload multiple files at once by ctrl/shift-selecting in dialog', 'flash-album-gallery' ); ?>" value="<?php _e( 'Switch to Plupload based Upload', 'flash-album-gallery' ); ?>"/>
|
175 |
<?php } ?>
|
176 |
</span>
|
177 |
|
183 |
<td>
|
184 |
<div id="pluploadUploader">
|
185 |
<?php if ( ! $flag->options['swfUpload']) { ?>
|
186 |
+
<strong><?php _e( 'Upload image(s):', 'flash-album-gallery' ); ?></strong><br>
|
187 |
<input type="file" name="imagefiles[]" id="imagefiles" size="35" class="imagefiles"/>
|
188 |
</div>
|
189 |
<span id="choosegalfirst">
|
190 |
+
<input class="button-primary" type="submit" name="uploadimage" id="uploadimage_btn" value="<?php _e( 'Upload images', 'flash-album-gallery' ); ?>"/>
|
191 |
<span class="disabledbut" style="display: none;"></span>
|
192 |
</span>
|
193 |
<?php } ?>
|
235 |
galleryselect: jQuery('#galleryselect').val(),
|
236 |
thumbw: jQuery('#thumbWidth').val(),
|
237 |
thumbh: jQuery('#thumbHeight').val(),
|
|
|
238 |
last: files_remaining,
|
239 |
action: 'flag_plupload_uploader',
|
240 |
_wpnonce: '<?php echo $nonce; ?>'
|
275 |
});
|
276 |
uploader.bind('UploadComplete', function(up, files){
|
277 |
console.log('[UploadComplete]', files);
|
278 |
+
jQuery('<div/>').addClass('success').html('<?php _e('Done!', 'flash-album-gallery'); ?> <a href="<?php echo wp_nonce_url( $flag->manage_page->base_page . "&mode=edit", 'flag_editgallery'); ?>&gid=' + jQuery("#galleryselect").val() + '">Open Gallery</a>').appendTo('#pl-message');
|
279 |
});
|
280 |
|
281 |
jQuery("#gmUpload").on('click', '.ui-button-disabled', function(){
|
302 |
jQuery(document).ready(function(){
|
303 |
jQuery('#imagefiles').MultiFile({
|
304 |
STRING: {
|
305 |
+
remove: '<?php _e('remove', 'flash-album-gallery'); ?>'
|
306 |
}
|
307 |
});
|
308 |
|
331 |
<?php if ( ! IS_WPMU || current_user_can( 'FlAG Import folder' ) ) { ?>
|
332 |
<!-- import folder -->
|
333 |
<div id="importfolder" class="cptab">
|
334 |
+
<h2><?php _e( 'Import image folder', 'flash-album-gallery' ); ?></h2>
|
335 |
|
336 |
<form name="importfolder" id="importfolder_form" method="POST" action="<?php echo $filepath; ?>" accept-charset="utf-8">
|
337 |
<?php wp_nonce_field( 'flag_addgallery' ); ?>
|
338 |
<table class="form-table">
|
339 |
<tr valign="top">
|
340 |
+
<th scope="row"><?php _e( 'Import from Server path:', 'flash-album-gallery' ); ?></th>
|
341 |
<td>
|
342 |
+
<input type="text" size="35" id="galleryfolder" name="galleryfolder" value="<?php echo $defaultpath; ?>"/><span class="browsefiles button" style="display:none"><?php _e( 'Browse...', "flash-album-gallery" ); ?></span>
|
343 |
|
344 |
<div id="file_browser"></div>
|
345 |
<div><?php echo $maxsize; ?>
|
346 |
+
<?php if ( FLAG_SAFE_MODE ) { ?>
|
347 |
+
<br/><?php _e( ' Please note : For safe-mode = ON you need to add the subfolder thumbs manually', 'flash-album-gallery' ); ?><?php }; ?>
|
348 |
</div>
|
349 |
</td>
|
350 |
</tr>
|
351 |
</table>
|
352 |
<div class="submit">
|
353 |
+
<input class="button-primary" type="submit" name="importfolder" value="<?php _e( 'Import folder', 'flash-album-gallery' ); ?>"/>
|
354 |
</div>
|
355 |
</form>
|
356 |
</div>
|
admin/admin.php
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?php
|
2 |
|
3 |
/**
|
4 |
-
* flagAdminPanel - Admin Section for
|
5 |
*
|
6 |
*/
|
7 |
class flagAdminPanel {
|
@@ -13,18 +13,31 @@ class flagAdminPanel {
|
|
13 |
add_action( 'admin_menu', array( &$this, 'add_menu' ) );
|
14 |
add_action( 'init', array( &$this, 'wp_flag_check_options' ), 2 );
|
15 |
|
|
|
|
|
|
|
16 |
// Add the script and style files
|
17 |
add_action( 'admin_print_scripts', array( &$this, 'load_scripts' ) );
|
18 |
add_action( 'admin_print_styles', array( &$this, 'load_styles' ) );
|
19 |
|
20 |
add_filter( 'contextual_help', array( &$this, 'show_help' ), 10, 2 );
|
21 |
add_filter( 'screen_meta_screen', array( &$this, 'edit_screen_meta' ) );
|
22 |
-
|
|
|
|
|
|
|
23 |
|
24 |
function wp_flag_check_options() {
|
25 |
global $flag;
|
26 |
require_once( dirname( __FILE__ ) . '/flag_install.php' );
|
27 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
$flag_db_options = get_option( 'flag_options' );
|
29 |
if ( $flag_db_options ) {
|
30 |
if ( function_exists( 'array_diff_key' ) ) {
|
@@ -56,44 +69,44 @@ class flagAdminPanel {
|
|
56 |
// integrate the menu
|
57 |
function add_menu() {
|
58 |
|
59 |
-
add_menu_page( __( 'GRAND
|
60 |
&$this,
|
61 |
'show_menu'
|
62 |
), FLAG_URLPATH . 'admin/images/flag.png' );
|
63 |
-
add_submenu_page( 'flag-overview', __( 'GRAND
|
64 |
&$this,
|
65 |
'show_menu'
|
66 |
) );
|
67 |
-
add_submenu_page( 'flag-overview', __( 'FlAG Manage gallery', '
|
68 |
&$this,
|
69 |
'show_menu'
|
70 |
) );
|
71 |
-
add_submenu_page( 'flag-overview', __( 'FlAG Music Box', '
|
72 |
&$this,
|
73 |
'show_menu'
|
74 |
) );
|
75 |
-
add_submenu_page( 'flag-overview', __( 'FlAG Video Box', '
|
76 |
&$this,
|
77 |
'show_menu'
|
78 |
) );
|
79 |
-
add_submenu_page( 'flag-overview', __( 'FlAG Banner Box', '
|
80 |
&$this,
|
81 |
'show_menu'
|
82 |
) );
|
83 |
-
add_submenu_page( 'flag-overview', __( 'FlAG Manage skins', '
|
84 |
&$this,
|
85 |
'show_menu'
|
86 |
) );
|
87 |
-
add_submenu_page( 'flag-overview', __( 'FlAG Change options', '
|
88 |
&$this,
|
89 |
'show_menu'
|
90 |
) );
|
91 |
-
add_submenu_page( 'flag-overview', __( 'Flagallery in iframe', '
|
92 |
&$this,
|
93 |
'show_menu'
|
94 |
) );
|
95 |
if ( flag_wpmu_site_admin() ) {
|
96 |
-
add_submenu_page( 'wpmu-admin.php', __( 'GRAND
|
97 |
&$this,
|
98 |
'show_menu'
|
99 |
) );
|
@@ -158,20 +171,44 @@ class flagAdminPanel {
|
|
158 |
}
|
159 |
}
|
160 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
161 |
function load_scripts() {
|
162 |
|
163 |
-
wp_register_script( 'flag-ajax', FLAG_URLPATH . 'admin/js/flag.ajax.js', array( 'jquery' ), '1.4.
|
164 |
wp_localize_script( 'flag-ajax', 'flagAjaxSetup', array(
|
165 |
'url' => admin_url( 'admin-ajax.php' ),
|
166 |
'action' => 'flag_ajax_operation',
|
167 |
'operation' => '',
|
168 |
'nonce' => wp_create_nonce( 'flag-ajax' ),
|
169 |
'ids' => '',
|
170 |
-
'permission' => __( 'You do not have the correct permission', '
|
171 |
-
'error' => __( 'Unexpected Error', '
|
172 |
-
'failure' => __( 'A failure occurred', '
|
173 |
) );
|
174 |
-
wp_register_script( 'flag-progressbar', FLAG_URLPATH . 'admin/js/flag.progressbar.js', array( 'jquery' ), '1.0.
|
175 |
|
176 |
if ( isset( $_GET['page'] ) ) {
|
177 |
switch ( $_GET['page'] ) {
|
@@ -180,8 +217,8 @@ class flagAdminPanel {
|
|
180 |
case "flag-manage-gallery" :
|
181 |
print "<script type='text/javascript' src='" . FLAG_URLPATH . "admin/js/tabs.js'></script>\n";
|
182 |
|
183 |
-
wp_enqueue_style( 'jquery-ui-smoothness', '
|
184 |
-
wp_enqueue_script( 'jquery-ui-full', '
|
185 |
|
186 |
wp_enqueue_script( 'jquery-ui-droppable' );
|
187 |
|
@@ -217,13 +254,13 @@ class flagAdminPanel {
|
|
217 |
wp_enqueue_script( 'thickbox' );
|
218 |
break;
|
219 |
case "flag-options" :
|
220 |
-
wp_enqueue_script( 'farbtastic-nosharp', FLAG_URLPATH . 'admin/js/farbtastic-nosharp.js', array( 'jquery' ), '1.2' );
|
221 |
print "<script type='text/javascript' src='" . FLAG_URLPATH . "admin/js/tabs.js'></script>\n";
|
222 |
break;
|
223 |
case "flag-skins" :
|
224 |
wp_enqueue_script( 'thickbox' );
|
225 |
-
|
226 |
-
|
|
|
227 |
print "<script type='text/javascript' src='" . FLAG_URLPATH . "admin/js/tabs.js'></script>\n";
|
228 |
break;
|
229 |
}
|
@@ -235,24 +272,24 @@ class flagAdminPanel {
|
|
235 |
if ( isset( $_GET['page'] ) ) {
|
236 |
switch ( $_GET['page'] ) {
|
237 |
case 'flag-overview' :
|
238 |
-
wp_enqueue_style( 'flagadmin', FLAG_URLPATH . 'admin/css/flagadmin.css', false, '
|
239 |
wp_admin_css( 'css/dashboard' );
|
240 |
break;
|
241 |
case "flag-options" :
|
242 |
wp_enqueue_style( 'farbtastic' );
|
243 |
case "flag-manage-gallery" :
|
244 |
-
wp_enqueue_style( 'flagtabs', FLAG_URLPATH . 'admin/css/tabs.css', false, '
|
245 |
case "flag-music-box" :
|
246 |
case "flag-video-box" :
|
247 |
case "flag-banner-box" :
|
248 |
wp_enqueue_style( 'thickbox' );
|
249 |
-
wp_enqueue_style( 'flagadmin', FLAG_URLPATH . 'admin/css/flagadmin.css', false, '
|
250 |
break;
|
251 |
case "flag-skins" :
|
252 |
wp_enqueue_style( 'thickbox' );
|
253 |
wp_enqueue_style( 'farbtastic' );
|
254 |
-
wp_enqueue_style( 'flagtabs', FLAG_URLPATH . 'admin/css/tabs.css', false, '
|
255 |
-
wp_enqueue_style( 'flagadmin', FLAG_URLPATH . 'admin/css/flagadmin.css', false, '
|
256 |
wp_admin_css( 'css/dashboard' );
|
257 |
break;
|
258 |
}
|
@@ -263,7 +300,7 @@ class flagAdminPanel {
|
|
263 |
|
264 |
$link = '';
|
265 |
// menu title is localized...
|
266 |
-
$i18n = strtolower( _n( 'Gallery', 'Galleries', 1, '
|
267 |
|
268 |
switch ( $screen ) {
|
269 |
case 'toplevel_page_' . 'flag-overview' :
|
@@ -277,16 +314,16 @@ class flagAdminPanel {
|
|
277 |
}
|
278 |
|
279 |
if ( ! empty( $link ) ) {
|
280 |
-
$help = '<h5>' . __( 'Get help with Grand Flagallery', '
|
281 |
$help .= '<div class="metabox-prefs">';
|
282 |
$help .= $link;
|
283 |
$help .= "</div>\n";
|
284 |
-
$help .= '<h5>' . __( 'More Help & Info', '
|
285 |
$help .= '<div class="metabox-prefs">';
|
286 |
-
$help .= '<a href="http://codeasily.com/community/topic/video-tutorials/" target="_blank">' . __( 'Grand Flagallery Video Tutorial', '
|
287 |
-
$help .= ' | <a href="http://codeasily.com/community/forum/flagallery-wordpress-plugin/" target="_blank">' . __( 'Forum', '
|
288 |
-
$help .= ' | <a href="http://codeasily.com/community/topic/language-files/" target="_blank">' . __( 'Get your language pack', '
|
289 |
-
$help .= ' | <a href="http://codeasily.com/portfolio/grand-flagallery-skins/" target="_blank">' . __( 'Skins for Grand Flagallery', '
|
290 |
$help .= "</div>\n";
|
291 |
}
|
292 |
|
@@ -296,17 +333,17 @@ class flagAdminPanel {
|
|
296 |
function edit_screen_meta( $screen ) {
|
297 |
|
298 |
// menu title is localized, so we need to change the toplevel name
|
299 |
-
$i18n = strtolower( _n( 'Gallery', 'Galleries', 1, '
|
300 |
|
301 |
switch ( $screen ) {
|
302 |
case "{$i18n}_page_flag-manage-gallery" :
|
303 |
// we would like to have screen option only at the manage images / gallery page
|
304 |
if ( isset ( $_POST['sortGallery'] ) ) {
|
305 |
-
|
306 |
} else if ( ( $_GET['mode'] == 'edit' ) || isset ( $_POST['backToGallery'] ) ) {
|
307 |
$screen = 'flag-manage-images';
|
308 |
} else if ( ( $_GET['mode'] == 'sort' ) ) {
|
309 |
-
|
310 |
} else {
|
311 |
$screen = 'flag-manage-gallery';
|
312 |
}
|
@@ -331,6 +368,28 @@ class flagAdminPanel {
|
|
331 |
$this->register_column_headers( 'flag-manage-images', flag_manage_gallery_columns() );
|
332 |
}
|
333 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
334 |
}
|
335 |
|
336 |
function flag_wpmu_site_admin() {
|
1 |
<?php
|
2 |
|
3 |
/**
|
4 |
+
* flagAdminPanel - Admin Section for FlaGallery
|
5 |
*
|
6 |
*/
|
7 |
class flagAdminPanel {
|
13 |
add_action( 'admin_menu', array( &$this, 'add_menu' ) );
|
14 |
add_action( 'init', array( &$this, 'wp_flag_check_options' ), 2 );
|
15 |
|
16 |
+
// Add the script and style files
|
17 |
+
add_action('admin_enqueue_scripts', array(&$this, 'enqueue_scripts'), 20);
|
18 |
+
|
19 |
// Add the script and style files
|
20 |
add_action( 'admin_print_scripts', array( &$this, 'load_scripts' ) );
|
21 |
add_action( 'admin_print_styles', array( &$this, 'load_styles' ) );
|
22 |
|
23 |
add_filter( 'contextual_help', array( &$this, 'show_help' ), 10, 2 );
|
24 |
add_filter( 'screen_meta_screen', array( &$this, 'edit_screen_meta' ) );
|
25 |
+
|
26 |
+
add_filter('admin_head', array (&$this, 'wp_flag_ins_button' ), 5);
|
27 |
+
|
28 |
+
}
|
29 |
|
30 |
function wp_flag_check_options() {
|
31 |
global $flag;
|
32 |
require_once( dirname( __FILE__ ) . '/flag_install.php' );
|
33 |
+
|
34 |
+
if (isset($_GET['page']) && 'flag-overview' === $_GET['page'] && isset($_POST['uninstall'])) {
|
35 |
+
check_admin_referer('flag_uninstall');
|
36 |
+
flag_uninstall();
|
37 |
+
}
|
38 |
+
|
39 |
+
|
40 |
+
$default_options = flag_list_options();
|
41 |
$flag_db_options = get_option( 'flag_options' );
|
42 |
if ( $flag_db_options ) {
|
43 |
if ( function_exists( 'array_diff_key' ) ) {
|
69 |
// integrate the menu
|
70 |
function add_menu() {
|
71 |
|
72 |
+
add_menu_page( __( 'GRAND FlaGallery overview', 'flash-album-gallery' ), __( 'FlAGallery' ), 'FlAG overview', 'flag-overview', array(
|
73 |
&$this,
|
74 |
'show_menu'
|
75 |
), FLAG_URLPATH . 'admin/images/flag.png' );
|
76 |
+
add_submenu_page( 'flag-overview', __( 'GRAND FlaGallery overview', 'flash-album-gallery' ), __( 'Overview', 'flash-album-gallery' ), 'FlAG overview', 'flag-overview', array(
|
77 |
&$this,
|
78 |
'show_menu'
|
79 |
) );
|
80 |
+
add_submenu_page( 'flag-overview', __( 'FlAG Manage gallery', 'flash-album-gallery' ), __( 'Manage Galleries', 'flash-album-gallery' ), 'FlAG Manage gallery', 'flag-manage-gallery', array(
|
81 |
&$this,
|
82 |
'show_menu'
|
83 |
) );
|
84 |
+
add_submenu_page( 'flag-overview', __( 'FlAG Music Box', 'flash-album-gallery' ), __( 'Music Box', 'flash-album-gallery' ), 'FlAG Manage music', 'flag-music-box', array(
|
85 |
&$this,
|
86 |
'show_menu'
|
87 |
) );
|
88 |
+
add_submenu_page( 'flag-overview', __( 'FlAG Video Box', 'flash-album-gallery' ), __( 'Video Box', 'flash-album-gallery' ), 'FlAG Manage video', 'flag-video-box', array(
|
89 |
&$this,
|
90 |
'show_menu'
|
91 |
) );
|
92 |
+
add_submenu_page( 'flag-overview', __( 'FlAG Banner Box', 'flash-album-gallery' ), __( 'Banner Box', 'flash-album-gallery' ), 'FlAG Manage banners', 'flag-banner-box', array(
|
93 |
&$this,
|
94 |
'show_menu'
|
95 |
) );
|
96 |
+
add_submenu_page( 'flag-overview', __( 'FlAG Manage skins', 'flash-album-gallery' ), __( 'Skins', 'flash-album-gallery' ), 'FlAG Change skin', 'flag-skins', array(
|
97 |
&$this,
|
98 |
'show_menu'
|
99 |
) );
|
100 |
+
add_submenu_page( 'flag-overview', __( 'FlAG Change options', 'flash-album-gallery' ), __( 'Options', 'flash-album-gallery' ), 'FlAG Change options', 'flag-options', array(
|
101 |
&$this,
|
102 |
'show_menu'
|
103 |
) );
|
104 |
+
add_submenu_page( 'flag-overview', __( 'Flagallery in iframe', 'flash-album-gallery' ), __( 'Iframe', 'flash-album-gallery' ), 'FlAG iFrame page', 'flag-iframe', array(
|
105 |
&$this,
|
106 |
'show_menu'
|
107 |
) );
|
108 |
if ( flag_wpmu_site_admin() ) {
|
109 |
+
add_submenu_page( 'wpmu-admin.php', __( 'GRAND FlaGallery', 'flash-album-gallery' ), __( 'Grand Flagallery', 'flash-album-gallery' ), 'activate_plugins', 'flag-wpmu', array(
|
110 |
&$this,
|
111 |
'show_menu'
|
112 |
) );
|
171 |
}
|
172 |
}
|
173 |
|
174 |
+
function enqueue_scripts($hook) {
|
175 |
+
// no need to go on if it's not a plugin page
|
176 |
+
if('admin.php' != $hook && isset($_GET['page']) && in_array($_GET['page'], array('flag-overview', 'flag-manage-gallery', 'flag-music-box', 'flag-video-box', 'flag-banner-box', 'flag-skins', 'flag-options', 'flag-iframe'))){
|
177 |
+
global $wp_scripts, $wp_styles;
|
178 |
+
foreach($wp_scripts->registered as $handle => $wp_script){
|
179 |
+
if(((false !== strpos($wp_script->src, '/plugins/')) || (false !== strpos($wp_script->src, '/themes/'))) && (false === strpos($wp_script->src, 'flash-album-gallery'))){
|
180 |
+
if(in_array($handle, $wp_scripts->queue)){
|
181 |
+
wp_dequeue_script($handle);
|
182 |
+
}
|
183 |
+
wp_deregister_script($handle);
|
184 |
+
}
|
185 |
+
}
|
186 |
+
foreach($wp_styles->registered as $handle => $wp_style){
|
187 |
+
if(((false !== strpos($wp_style->src, '/plugins/')) || (false !== strpos($wp_style->src, '/themes/'))) && (false === strpos($wp_style->src, 'flash-album-gallery'))){
|
188 |
+
if(in_array($handle, $wp_styles->queue)){
|
189 |
+
wp_dequeue_style($handle);
|
190 |
+
}
|
191 |
+
wp_deregister_style($handle);
|
192 |
+
}
|
193 |
+
}
|
194 |
+
}
|
195 |
+
|
196 |
+
}
|
197 |
+
|
198 |
function load_scripts() {
|
199 |
|
200 |
+
wp_register_script( 'flag-ajax', FLAG_URLPATH . 'admin/js/flag.ajax.js', array( 'jquery' ), '1.4.1' );
|
201 |
wp_localize_script( 'flag-ajax', 'flagAjaxSetup', array(
|
202 |
'url' => admin_url( 'admin-ajax.php' ),
|
203 |
'action' => 'flag_ajax_operation',
|
204 |
'operation' => '',
|
205 |
'nonce' => wp_create_nonce( 'flag-ajax' ),
|
206 |
'ids' => '',
|
207 |
+
'permission' => __( 'You do not have the correct permission', 'flash-album-gallery' ),
|
208 |
+
'error' => __( 'Unexpected Error', 'flash-album-gallery' ),
|
209 |
+
'failure' => __( 'A failure occurred', 'flash-album-gallery' )
|
210 |
) );
|
211 |
+
wp_register_script( 'flag-progressbar', FLAG_URLPATH . 'admin/js/flag.progressbar.js', array( 'jquery' ), '1.0.1' );
|
212 |
|
213 |
if ( isset( $_GET['page'] ) ) {
|
214 |
switch ( $_GET['page'] ) {
|
217 |
case "flag-manage-gallery" :
|
218 |
print "<script type='text/javascript' src='" . FLAG_URLPATH . "admin/js/tabs.js'></script>\n";
|
219 |
|
220 |
+
wp_enqueue_style( 'jquery-ui-smoothness', '//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/themes/smoothness/jquery-ui.min.css', array(), '1.10.4', 'screen' );
|
221 |
+
wp_enqueue_script( 'jquery-ui-full', '//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/jquery-ui.min.js', array( 'jquery' ), '1.10.4' );
|
222 |
|
223 |
wp_enqueue_script( 'jquery-ui-droppable' );
|
224 |
|
254 |
wp_enqueue_script( 'thickbox' );
|
255 |
break;
|
256 |
case "flag-options" :
|
|
|
257 |
print "<script type='text/javascript' src='" . FLAG_URLPATH . "admin/js/tabs.js'></script>\n";
|
258 |
break;
|
259 |
case "flag-skins" :
|
260 |
wp_enqueue_script( 'thickbox' );
|
261 |
+
// Add the color picker assets
|
262 |
+
wp_enqueue_style( 'wp-color-picker' );
|
263 |
+
wp_enqueue_script( 'wp-color-picker' );
|
264 |
print "<script type='text/javascript' src='" . FLAG_URLPATH . "admin/js/tabs.js'></script>\n";
|
265 |
break;
|
266 |
}
|
272 |
if ( isset( $_GET['page'] ) ) {
|
273 |
switch ( $_GET['page'] ) {
|
274 |
case 'flag-overview' :
|
275 |
+
wp_enqueue_style( 'flagadmin', FLAG_URLPATH . 'admin/css/flagadmin.css', false, '5.0.0', 'screen' );
|
276 |
wp_admin_css( 'css/dashboard' );
|
277 |
break;
|
278 |
case "flag-options" :
|
279 |
wp_enqueue_style( 'farbtastic' );
|
280 |
case "flag-manage-gallery" :
|
281 |
+
wp_enqueue_style( 'flagtabs', FLAG_URLPATH . 'admin/css/tabs.css', false, '5.0.0', 'screen' );
|
282 |
case "flag-music-box" :
|
283 |
case "flag-video-box" :
|
284 |
case "flag-banner-box" :
|
285 |
wp_enqueue_style( 'thickbox' );
|
286 |
+
wp_enqueue_style( 'flagadmin', FLAG_URLPATH . 'admin/css/flagadmin.css', false, '5.0.0', 'screen' );
|
287 |
break;
|
288 |
case "flag-skins" :
|
289 |
wp_enqueue_style( 'thickbox' );
|
290 |
wp_enqueue_style( 'farbtastic' );
|
291 |
+
wp_enqueue_style( 'flagtabs', FLAG_URLPATH . 'admin/css/tabs.css', false, '5.0.0', 'screen' );
|
292 |
+
wp_enqueue_style( 'flagadmin', FLAG_URLPATH . 'admin/css/flagadmin.css', false, '5.0.0', 'screen' );
|
293 |
wp_admin_css( 'css/dashboard' );
|
294 |
break;
|
295 |
}
|
300 |
|
301 |
$link = '';
|
302 |
// menu title is localized...
|
303 |
+
$i18n = strtolower( _n( 'Gallery', 'Galleries', 1, 'flash-album-gallery' ) );
|
304 |
|
305 |
switch ( $screen ) {
|
306 |
case 'toplevel_page_' . 'flag-overview' :
|
314 |
}
|
315 |
|
316 |
if ( ! empty( $link ) ) {
|
317 |
+
$help = '<h5>' . __( 'Get help with Grand Flagallery', 'flash-album-gallery' ) . '</h5>';
|
318 |
$help .= '<div class="metabox-prefs">';
|
319 |
$help .= $link;
|
320 |
$help .= "</div>\n";
|
321 |
+
$help .= '<h5>' . __( 'More Help & Info', 'flash-album-gallery' ) . '</h5>';
|
322 |
$help .= '<div class="metabox-prefs">';
|
323 |
+
$help .= '<a href="http://codeasily.com/community/topic/video-tutorials/" target="_blank">' . __( 'Grand Flagallery Video Tutorial', 'flash-album-gallery' ) . '</a>';
|
324 |
+
$help .= ' | <a href="http://codeasily.com/community/forum/flagallery-wordpress-plugin/" target="_blank">' . __( 'Forum', 'flash-album-gallery' ) . '</a>';
|
325 |
+
$help .= ' | <a href="http://codeasily.com/community/topic/language-files/" target="_blank">' . __( 'Get your language pack', 'flash-album-gallery' ) . '</a>';
|
326 |
+
$help .= ' | <a href="http://codeasily.com/portfolio/grand-flagallery-skins/" target="_blank">' . __( 'Skins for Grand Flagallery', 'flash-album-gallery' ) . '</a>';
|
327 |
$help .= "</div>\n";
|
328 |
}
|
329 |
|
333 |
function edit_screen_meta( $screen ) {
|
334 |
|
335 |
// menu title is localized, so we need to change the toplevel name
|
336 |
+
$i18n = strtolower( _n( 'Gallery', 'Galleries', 1, 'flash-album-gallery' ) );
|
337 |
|
338 |
switch ( $screen ) {
|
339 |
case "{$i18n}_page_flag-manage-gallery" :
|
340 |
// we would like to have screen option only at the manage images / gallery page
|
341 |
if ( isset ( $_POST['sortGallery'] ) ) {
|
342 |
+
//$screen = $screen;
|
343 |
} else if ( ( $_GET['mode'] == 'edit' ) || isset ( $_POST['backToGallery'] ) ) {
|
344 |
$screen = 'flag-manage-images';
|
345 |
} else if ( ( $_GET['mode'] == 'sort' ) ) {
|
346 |
+
//$screen = $screen;
|
347 |
} else {
|
348 |
$screen = 'flag-manage-gallery';
|
349 |
}
|
368 |
$this->register_column_headers( 'flag-manage-images', flag_manage_gallery_columns() );
|
369 |
}
|
370 |
|
371 |
+
function wp_flag_ins_button() {
|
372 |
+
|
373 |
+
if( strpos($_SERVER['REQUEST_URI'], 'post.php')
|
374 |
+
|| strstr($_SERVER['PHP_SELF'], 'page-new.php')
|
375 |
+
|| strstr($_SERVER['PHP_SELF'], 'page.php')
|
376 |
+
|| strstr($_SERVER['PHP_SELF'], 'post-new.php') )
|
377 |
+
{
|
378 |
+
?>
|
379 |
+
<script type="text/javascript">
|
380 |
+
<!--
|
381 |
+
function bind_resize() {
|
382 |
+
if(!window.flag_bind_resize){
|
383 |
+
jQuery(window).bind("resize", tb_position);
|
384 |
+
}
|
385 |
+
window.flag_bind_resize = true;
|
386 |
+
}
|
387 |
+
//-->
|
388 |
+
</script>
|
389 |
+
<?php
|
390 |
+
}
|
391 |
+
}
|
392 |
+
|
393 |
}
|
394 |
|
395 |
function flag_wpmu_site_admin() {
|
admin/ajax.php
CHANGED
@@ -76,24 +76,9 @@ function flagCreateNewThumb() {
|
|
76 |
$id = (int) $_POST['id'];
|
77 |
$picture = flagdb::find_image( $id );
|
78 |
|
79 |
-
$x = round( $_POST['x'] * $_POST['rr'], 0 );
|
80 |
-
$y = round( $_POST['y'] * $_POST['rr'], 0 );
|
81 |
-
$w = round( $_POST['w'] * $_POST['rr'], 0 );
|
82 |
-
$h = round( $_POST['h'] * $_POST['rr'], 0 );
|
83 |
-
|
84 |
$thumb = new flag_Thumbnail( $picture->imagePath, true );
|
85 |
|
86 |
-
$thumb->
|
87 |
-
|
88 |
-
if ( $flag_options['thumbFix'] ) {
|
89 |
-
if ( $thumb->currentDimensions['height'] > $thumb->currentDimensions['width'] ) {
|
90 |
-
$thumb->resize( $flag_options['thumbWidth'], 0 );
|
91 |
-
} else {
|
92 |
-
$thumb->resize( 0, $flag_options['thumbHeight'] );
|
93 |
-
}
|
94 |
-
} else {
|
95 |
-
$thumb->resize( $flag_options['thumbWidth'], $flag_options['thumbHeight'] );
|
96 |
-
}
|
97 |
|
98 |
if ( $thumb->save( $picture->thumbPath, 100 ) ) {
|
99 |
//read the new sizes
|
@@ -137,7 +122,7 @@ function flag_save_album() {
|
|
137 |
}
|
138 |
$result = false;
|
139 |
$album_id = intval( $album_id );
|
140 |
-
$album_name =
|
141 |
if ( $album_name && $album_id ) {
|
142 |
if ( count( $g ) ) {
|
143 |
$galstring = implode( ',', $g );
|
@@ -148,7 +133,7 @@ function flag_save_album() {
|
|
148 |
}
|
149 |
|
150 |
if ( $result ) {
|
151 |
-
_e( 'Success', '
|
152 |
}
|
153 |
|
154 |
exit();
|
@@ -176,7 +161,7 @@ function flag_delete_album() {
|
|
176 |
}
|
177 |
|
178 |
if ( $result ) {
|
179 |
-
_e( 'Success', '
|
180 |
}
|
181 |
|
182 |
exit();
|
@@ -201,9 +186,9 @@ function flag_banner_crunch() {
|
|
201 |
$id = flagAdmin::handle_import_file( $_POST['path'] );
|
202 |
$file = basename( $_POST['path'] );
|
203 |
if ( is_wp_error( $id ) ) {
|
204 |
-
echo '<p class="error">' . sprintf( __( '<em>%s</em> was <strong>not</strong> imported due to an error: %s', '
|
205 |
} else {
|
206 |
-
echo '<p class="success">' . sprintf( __( '<em>%s</em> has been added to Media library', '
|
207 |
}
|
208 |
}
|
209 |
|
@@ -310,3 +295,157 @@ function flag_ajax_plupload_uploader() {
|
|
310 |
echo flagAdmin::swfupload_image( $galleryID );
|
311 |
die();
|
312 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
76 |
$id = (int) $_POST['id'];
|
77 |
$picture = flagdb::find_image( $id );
|
78 |
|
|
|
|
|
|
|
|
|
|
|
79 |
$thumb = new flag_Thumbnail( $picture->imagePath, true );
|
80 |
|
81 |
+
$thumb->resize( $flag_options['thumbWidth'], $flag_options['thumbHeight'] );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
82 |
|
83 |
if ( $thumb->save( $picture->thumbPath, 100 ) ) {
|
84 |
//read the new sizes
|
122 |
}
|
123 |
$result = false;
|
124 |
$album_id = intval( $album_id );
|
125 |
+
$album_name = wp_check_invalid_utf8(wp_strip_all_tags( $album_name ));
|
126 |
if ( $album_name && $album_id ) {
|
127 |
if ( count( $g ) ) {
|
128 |
$galstring = implode( ',', $g );
|
133 |
}
|
134 |
|
135 |
if ( $result ) {
|
136 |
+
_e( 'Success', 'flash-album-gallery' );
|
137 |
}
|
138 |
|
139 |
exit();
|
161 |
}
|
162 |
|
163 |
if ( $result ) {
|
164 |
+
_e( 'Success', 'flash-album-gallery' );
|
165 |
}
|
166 |
|
167 |
exit();
|
186 |
$id = flagAdmin::handle_import_file( $_POST['path'] );
|
187 |
$file = basename( $_POST['path'] );
|
188 |
if ( is_wp_error( $id ) ) {
|
189 |
+
echo '<p class="error">' . sprintf( __( '<em>%s</em> was <strong>not</strong> imported due to an error: %s', 'flash-album-gallery' ), $file, $id->get_error_message() ) . '</p>';
|
190 |
} else {
|
191 |
+
echo '<p class="success">' . sprintf( __( '<em>%s</em> has been added to Media library', 'flash-album-gallery' ), $file ) . '</p>';
|
192 |
}
|
193 |
}
|
194 |
|
295 |
echo flagAdmin::swfupload_image( $galleryID );
|
296 |
die();
|
297 |
}
|
298 |
+
|
299 |
+
add_action( 'wp_ajax_flag_shortcode_helper', 'flag_ajax_shortcode_helper' );
|
300 |
+
function flag_ajax_shortcode_helper() {
|
301 |
+
//check for correct capability
|
302 |
+
if ( ! is_user_logged_in() ) {
|
303 |
+
die( 'Login failure. -1' );
|
304 |
+
}
|
305 |
+
//check for correct capability
|
306 |
+
if ( ! current_user_can( 'FlAG Use TinyMCE' ) ) {
|
307 |
+
die( 'You do not have permission to upload files. -2' );
|
308 |
+
}
|
309 |
+
|
310 |
+
$media_button = isset($_GET['media_button']) && $_GET['media_button'] == 'true'? true : false;
|
311 |
+
$riched = isset($_GET['riched']) && $_GET['riched'] == 'true'? true : false;
|
312 |
+
|
313 |
+
include_once( FLAG_ABSPATH . 'admin/tinymce/window.php' );
|
314 |
+
|
315 |
+
die();
|
316 |
+
}
|
317 |
+
|
318 |
+
add_action('wp_ajax_flagallery_skin_interaction', 'flagallery_skin_interaction');
|
319 |
+
add_action('wp_ajax_nopriv_flagallery_skin_interaction', 'flagallery_skin_interaction');
|
320 |
+
add_action('wp_ajax_flagallery_module_interaction', 'flagallery_module_interaction');
|
321 |
+
add_action('wp_ajax_nopriv_flagallery_module_interaction', 'flagallery_module_interaction');
|
322 |
+
function flagallery_module_interaction(){
|
323 |
+
global $wpdb;
|
324 |
+
|
325 |
+
if(empty($_SERVER['HTTP_REFERER'])){
|
326 |
+
header($_SERVER['SERVER_PROTOCOL'] . ' 400 Bad Request');
|
327 |
+
die();
|
328 |
+
}
|
329 |
+
|
330 |
+
$ref = $_SERVER['HTTP_REFERER'];
|
331 |
+
//$uip = str_replace('.', '', $_SERVER['REMOTE_ADDR'])
|
332 |
+
if((false === strpos($ref, get_home_url())) && (false === strpos($ref, get_site_url()))){
|
333 |
+
header($_SERVER['SERVER_PROTOCOL'] . ' 400 Bad Request');
|
334 |
+
die();
|
335 |
+
}
|
336 |
+
if(('POST' !== $_SERVER['REQUEST_METHOD']) || !isset($_SERVER['HTTP_HOST']) || !strpos(get_home_url(), $_SERVER['HTTP_HOST'])){
|
337 |
+
header($_SERVER['SERVER_PROTOCOL'] . ' 400 Bad Request');
|
338 |
+
die();
|
339 |
+
}
|
340 |
+
|
341 |
+
$upd = array('pid'=>false,'vote'=>false,'hit'=>false,'reset'=>false);
|
342 |
+
|
343 |
+
if(($pid = intval($_POST['hit']))){
|
344 |
+
$upd['pid'] = $pid;
|
345 |
+
$upd['hit'] = isset($_POST['hit']);
|
346 |
+
$upd['vote'] = isset($_POST['vote']);
|
347 |
+
|
348 |
+
flag_update_counter($upd);
|
349 |
+
|
350 |
+
$result = $wpdb->get_results( "SELECT hitcounter, total_votes FROM $wpdb->flagpictures WHERE `pid` = $pid" );
|
351 |
+
|
352 |
+
$meta['views'] = intval($result[0]->hitcounter);
|
353 |
+
$meta['likes'] = intval($result[0]->total_votes);
|
354 |
+
$meta = array_map('intval', $meta);
|
355 |
+
|
356 |
+
header('Content-Type: application/json; charset=' . get_option('blog_charset'), true);
|
357 |
+
echo json_encode($meta);
|
358 |
+
die();
|
359 |
+
}
|
360 |
+
|
361 |
+
die();
|
362 |
+
}
|
363 |
+
|
364 |
+
/**
|
365 |
+
* Update image hitcounter in the database
|
366 |
+
*
|
367 |
+
* @param $upd
|
368 |
+
*/
|
369 |
+
function flag_update_counter($upd) {
|
370 |
+
global $wpdb;
|
371 |
+
|
372 |
+
if ( $pid = abs( intval($upd['pid']) ) ){
|
373 |
+
if($upd['reset'] == false){
|
374 |
+
if( $upd['hit'] ){
|
375 |
+
$wpdb->query( "UPDATE $wpdb->flagpictures SET `hitcounter` = `hitcounter`+1 WHERE pid = $pid" );
|
376 |
+
}
|
377 |
+
if( $upd['vote'] ){
|
378 |
+
$wpdb->query( "UPDATE $wpdb->flagpictures SET `total_votes` = IF(hitcounter > total_votes, total_votes+1, hitcounter) WHERE pid = $pid" );
|
379 |
+
}
|
380 |
+
} else {
|
381 |
+
if( $upd['hit'] ){
|
382 |
+
$hit = abs( intval($upd['hit']) );
|
383 |
+
$wpdb->query( "UPDATE $wpdb->flagpictures SET `hitcounter` = $hit WHERE pid = $pid" );
|
384 |
+
}
|
385 |
+
if( $upd['vote'] == 1 ){
|
386 |
+
$vote = abs( intval($upd['vote']) );
|
387 |
+
$wpdb->query( "UPDATE $wpdb->flagpictures SET `total_votes` = IF(hitcounter > $vote, $vote, hitcounter) WHERE pid = $pid" );
|
388 |
+
}
|
389 |
+
}
|
390 |
+
}
|
391 |
+
|
392 |
+
}
|
393 |
+
|
394 |
+
add_action('wp_ajax_flagallery_update_counters', 'flagallery_update_counters');
|
395 |
+
add_action('wp_ajax_nopriv_flagallery_update_counters', 'flagallery_update_counters');
|
396 |
+
function flagallery_update_counters(){
|
397 |
+
global $wpdb;
|
398 |
+
|
399 |
+
if(empty($_SERVER['HTTP_REFERER'])){
|
400 |
+
header($_SERVER['SERVER_PROTOCOL'] . ' 400 Bad Request');
|
401 |
+
die();
|
402 |
+
}
|
403 |
+
|
404 |
+
$ref = $_SERVER['HTTP_REFERER'];
|
405 |
+
//$uip = str_replace('.', '', $_SERVER['REMOTE_ADDR'])
|
406 |
+
if((false === strpos($ref, get_home_url())) && (false === strpos($ref, get_site_url()))){
|
407 |
+
header($_SERVER['SERVER_PROTOCOL'] . ' 400 Bad Request');
|
408 |
+
die();
|
409 |
+
}
|
410 |
+
if(('POST' !== $_SERVER['REQUEST_METHOD']) || !isset($_SERVER['HTTP_HOST']) || !strpos(get_home_url(), $_SERVER['HTTP_HOST'])){
|
411 |
+
header($_SERVER['SERVER_PROTOCOL'] . ' 400 Bad Request');
|
412 |
+
die();
|
413 |
+
}
|
414 |
+
|
415 |
+
$json = (array) json_decode(stripslashes($_POST['json']));
|
416 |
+
//$upd = array('pid'=>false,'vote'=>false,'hit'=>false,'reset'=>false);
|
417 |
+
$upd_array = array();
|
418 |
+
if(is_array($json)){
|
419 |
+
if(isset($json['views']) && is_array($json['views'])){
|
420 |
+
foreach($json['views'] as $id){
|
421 |
+
if((int)$id){
|
422 |
+
$upd_array[ $id ] = array('pid' => $id, 'hit' => 1, 'vote' => false, 'reset' => false);
|
423 |
+
}
|
424 |
+
}
|
425 |
+
}
|
426 |
+
if(isset($json['likes']) && is_array($json['likes'])){
|
427 |
+
foreach($json['likes'] as $id){
|
428 |
+
if(isset($upd_array[$id])){
|
429 |
+
$upd_array[ $id ]['vote'] = 1;
|
430 |
+
}
|
431 |
+
}
|
432 |
+
}
|
433 |
+
}
|
434 |
+
|
435 |
+
$meta = array();
|
436 |
+
foreach($upd_array as $upd){
|
437 |
+
$pid = (int)$upd['pid'];
|
438 |
+
flag_update_counter($upd);
|
439 |
+
$result = $wpdb->get_results( "SELECT hitcounter, total_votes FROM $wpdb->flagpictures WHERE `pid` = $pid" );
|
440 |
+
if($result){
|
441 |
+
$meta[$pid] = array(
|
442 |
+
'views' => intval($result[0]->hitcounter),
|
443 |
+
'likes' => intval($result[0]->total_votes),
|
444 |
+
);
|
445 |
+
}
|
446 |
+
}
|
447 |
+
|
448 |
+
header('Content-Type: application/json; charset=' . get_option('blog_charset'), true);
|
449 |
+
echo json_encode($meta);
|
450 |
+
die();
|
451 |
+
}
|
admin/banner-box.php
CHANGED
@@ -99,7 +99,7 @@ function flag_banner_controler() {
|
|
99 |
if ( isset( $_POST['updateMedia'] ) ) {
|
100 |
check_admin_referer( 'flag_update' );
|
101 |
flagGallery::flagSaveWpMedia();
|
102 |
-
flagGallery::show_message( __( 'Media updated', '
|
103 |
}
|
104 |
default:
|
105 |
flag_created_b_playlists();
|
@@ -145,9 +145,9 @@ function flag_crunch( $crunch_list ) {
|
|
145 |
);
|
146 |
} else{
|
147 |
var refpage = window.location.href;
|
148 |
-
jQuery(".flag_crunching .txt").html('<a href="' + refpage + '"><?php _e("Import folder is complete. The page reloads after 5 seconds.", "
|
149 |
-
//alert('<?php _e("Import folder complete. Refresh page.", "
|
150 |
-
setTimeout(function(){ window.location.href =
|
151 |
}
|
152 |
}
|
153 |
|
@@ -168,15 +168,15 @@ function flag_created_b_playlists() {
|
|
168 |
|
169 |
?>
|
170 |
<div class="flag-wrap">
|
171 |
-
<h2><?php _e( 'Created playlists', '
|
172 |
<table class="widefat flag-table" cellspacing="0">
|
173 |
<thead>
|
174 |
<tr>
|
175 |
-
<th scope="col" width="25%"><?php _e( 'Title', '
|
176 |
-
<th scope="col" width="55%"><?php _e( 'Description', '
|
177 |
-
<th scope="col"><?php _e( 'Quantity', '
|
178 |
-
<th scope="col"><?php _e( 'Shortcode', '
|
179 |
-
<th scope="col"><?php _e( 'Action', '
|
180 |
</tr>
|
181 |
</thead>
|
182 |
<tbody>
|
@@ -197,18 +197,18 @@ function flag_created_b_playlists() {
|
|
197 |
</a>
|
198 |
</td>
|
199 |
<td><?php echo esc_html( $playlist_data['description'] );
|
200 |
-
echo ' (' . __( "player", "
|
201 |
<td><?php echo count( $query_m ); ?></td>
|
202 |
<td style="white-space: nowrap;"><input type="text" class="shortcode1" style="width: 200px; font-size: 9px;" readonly="readonly" onfocus="this.select()" value="[grandbanner xml=<?php echo $playlist_name; ?>]"/></td>
|
203 |
<td>
|
204 |
-
<a href="<?php echo wp_nonce_url( $filepath . '&playlist=' . $playlist_name . "&mode=delete", 'flag_delete' ); ?>" class="delete" onclick="javascript:check=confirm( '<?php _e( "Delete this playlist?", '
|
205 |
-
}"><?php _e( 'Delete', '
|
206 |
</td>
|
207 |
</tr>
|
208 |
<?php
|
209 |
}
|
210 |
} else {
|
211 |
-
echo '<tr><td colspan="5" align="center"><strong>' . __( 'No playlists found', '
|
212 |
}
|
213 |
?>
|
214 |
</tbody>
|
@@ -310,7 +310,7 @@ function flag_banner_wp_media_lib( $added = false ) {
|
|
310 |
// this function check for a the number of selected images, sumbmit false when no one selected
|
311 |
function checkSelected(){
|
312 |
if(!jQuery('#items_array').val()){
|
313 |
-
alert('<?php echo esc_js(__("No items selected", "
|
314 |
return false;
|
315 |
}
|
316 |
var actionId = jQuery('#bulkaction').val();
|
@@ -356,29 +356,29 @@ function flag_banner_wp_media_lib( $added = false ) {
|
|
356 |
|
357 |
<!-- import folder -->
|
358 |
<div id="importfolder">
|
359 |
-
<h2><?php _e( 'Import banners from folder', '
|
360 |
|
361 |
<form name="importfolder" id="importfolder_form" method="POST" action="<?php echo $filepath; ?>" accept-charset="utf-8">
|
362 |
<?php wp_nonce_field( 'flag_addbanner' ); ?>
|
363 |
<table class="form-table">
|
364 |
<tr valign="top">
|
365 |
-
<th scope="row"><?php _e( 'Import from Server path:', '
|
366 |
-
<td><input type="text" size="35" id="bannerfolder" name="bannerfolder" value="<?php echo $defaultpath; ?>"/><span class="browsefiles button" style="display:none"><?php _e( 'Browse...', "
|
367 |
|
368 |
<div id="file_browser"></div>
|
369 |
<br/>
|
370 |
<p><label><input type="checkbox" name="delete_files" value="delete"/>
|
371 |
-
<?php _e( 'delete files after import in WordPress Media Library', '
|
372 |
</td>
|
373 |
</tr>
|
374 |
</table>
|
375 |
-
<div class="submit"><input class="button-primary" type="submit" name="importfolder" value="<?php _e( 'Import folder', '
|
376 |
</form>
|
377 |
</div>
|
378 |
<?php } ?>
|
379 |
<?php } ?>
|
380 |
|
381 |
-
<h2><?php _e( 'WordPress Image Library', '
|
382 |
|
383 |
<?php
|
384 |
// look for pagination
|
@@ -412,8 +412,8 @@ function flag_banner_wp_media_lib( $added = false ) {
|
|
412 |
?>
|
413 |
<div class="tablenav" style="overflow: hidden; height: auto;">
|
414 |
<?php if ( $added === false ) { ?>
|
415 |
-
<div class="alignleft"><b><?php _e( 'Selected Media', '
|
416 |
-
<span class="clear_selected button"><?php _e( 'Clear Selected', '
|
417 |
<?php } ?>
|
418 |
<div class="tablenav-pages"><?php $page_links_text = sprintf( '<span class="displaying-num">' . __( 'Displaying %s–%s of %s' ) . '</span>%s', number_format_i18n( ( $_GET['paged'] - 1 ) * $objects_per_page + 1 ), number_format_i18n( min( $_GET['paged'] * $objects_per_page, $img_total_count ) ), number_format_i18n( $img_total_count ), $page_links );
|
419 |
echo $page_links_text; ?></div>
|
@@ -426,16 +426,16 @@ function flag_banner_wp_media_lib( $added = false ) {
|
|
426 |
|
427 |
<div class="actions">
|
428 |
<?php if ( $added === false ) { ?>
|
429 |
-
<input name="updateMedia" class="button-primary" style="float: right;" type="submit" value="<?php _e( 'Update Media', '
|
430 |
<?php if ( function_exists( 'json_encode' ) ) { ?>
|
431 |
<select name="bulkaction" id="bulkaction">
|
432 |
-
<option value="no_action"><?php _e( "No action", '
|
433 |
-
<option value="new_playlist"><?php _e( "Create new playlist", '
|
434 |
</select>
|
435 |
-
<input name="showThickbox" class="button-secondary" type="submit" value="<?php _e( 'Apply', '
|
436 |
}"/>
|
437 |
<?php } ?>
|
438 |
-
<a href="<?php echo admin_url( 'media-new.php' ); ?>" class="button"><?php _e( 'Upload Banner(s)', '
|
439 |
<input type="hidden" id="items_array" name="items_array" value=""/>
|
440 |
<?php } else { ?>
|
441 |
<input type="hidden" name="mode" value="save"/>
|
@@ -444,7 +444,7 @@ function flag_banner_wp_media_lib( $added = false ) {
|
|
444 |
<input type="hidden" name="skinname" value="<?php echo sanitize_flagname( $playlist['skin'] ); ?>"/>
|
445 |
<input type="hidden" name="skinaction" value="<?php echo sanitize_flagname( $playlist['skin'] ); ?>"/>
|
446 |
<textarea style="display: none;" name="playlist_descr" cols="40" rows="1"><?php echo esc_html( $playlist['description'] ); ?></textarea>
|
447 |
-
<input name="addToPlaylist" class="button-secondary" type="submit" value="<?php _e( 'Update Playlist', '
|
448 |
<?php } ?>
|
449 |
</div>
|
450 |
|
@@ -452,28 +452,28 @@ function flag_banner_wp_media_lib( $added = false ) {
|
|
452 |
<table class="widefat flag-table" cellspacing="0">
|
453 |
<thead>
|
454 |
<tr>
|
455 |
-
<th class="cb" width="54" scope="col"><a href="#" onclick="checkAll(document.getElementById('bannerlib'));return false;"><?php _e( 'Check', '
|
456 |
<th class="id" width="64" scope="col">
|
457 |
-
<div><?php _e( 'ID', '
|
458 |
</th>
|
459 |
<th class="thumb" width="110" scope="col">
|
460 |
-
<div><?php _e( 'Thumbnail', '
|
461 |
</th>
|
462 |
<th class="title_filename" scope="col">
|
463 |
-
<div><?php _e( 'Filename / Title / Link', '
|
464 |
</th>
|
465 |
<th class="description" scope="col">
|
466 |
-
<div><?php _e( 'Description', '
|
467 |
</th>
|
468 |
</tr>
|
469 |
</thead>
|
470 |
<tfoot>
|
471 |
<tr>
|
472 |
-
<th class="cb" scope="col"><a href="#" onclick="checkAll(document.getElementById('bannerlib'));return false;"><?php _e( 'Check', '
|
473 |
-
<th class="id" scope="col"><?php _e( 'ID', '
|
474 |
-
<th class="thumb" scope="col"><?php _e( 'Thumbnail', '
|
475 |
-
<th class="title_filename" scope="col"><?php _e( 'Filename / Title / Link', '
|
476 |
-
<th class="description" scope="col"><?php _e( 'Description', '
|
477 |
</tr>
|
478 |
</tfoot>
|
479 |
<tbody>
|
@@ -490,7 +490,7 @@ function flag_banner_wp_media_lib( $added = false ) {
|
|
490 |
$ex = $checked = '';
|
491 |
if ( ( $added !== false || ! empty( $items_array_default ) ) && in_array( $ban->ID, $exclude ) ) {
|
492 |
$class .= ' already-added';
|
493 |
-
$ex = ' title="' . __( "Already Added", "
|
494 |
$checked = ' checked="checked"';
|
495 |
}
|
496 |
$thumb = get_post_meta( $ban->ID, 'thumbnail', true );
|
@@ -509,7 +509,7 @@ function flag_banner_wp_media_lib( $added = false ) {
|
|
509 |
<td class="title_filename">
|
510 |
<strong><a href="<?php echo $url; ?>"><?php echo basename( $url ); ?></a></strong><br/>
|
511 |
<textarea title="Title" name="item_a[<?php echo $ban->ID; ?>][post_title]" cols="20" rows="1" style="width:95%; height: 25px; overflow:hidden;"><?php echo esc_html( stripslashes( $ban->post_title ) ); ?></textarea><br/>
|
512 |
-
<?php _e( 'URL', '
|
513 |
</td>
|
514 |
<td class="description">
|
515 |
<textarea name="item_a[<?php echo $ban->ID; ?>][post_content]" style="width:95%; height: 96px; margin-top: 2px; font-size:12px; line-height:115%;" rows="1"><?php echo esc_html( stripslashes( $ban->post_content ) ); ?></textarea>
|
@@ -518,7 +518,7 @@ function flag_banner_wp_media_lib( $added = false ) {
|
|
518 |
<?php
|
519 |
}
|
520 |
} else {
|
521 |
-
echo '<tr><td colspan="5" align="center"><strong>' . __( 'No images in WordPress Media Library.', '
|
522 |
}
|
523 |
?>
|
524 |
</tbody>
|
@@ -536,10 +536,10 @@ function flag_banner_wp_media_lib( $added = false ) {
|
|
536 |
<input type="hidden" name="page" value="banner-box"/>
|
537 |
<table width="100%" border="0" cellspacing="3" cellpadding="3">
|
538 |
<tr valign="top">
|
539 |
-
<th align="left" style="padding-top: 5px;"><?php _e( 'Playlist Title', '
|
540 |
<td><input type="text" class="alignleft" name="playlist_title" value=""/>
|
541 |
|
542 |
-
<div class="alignright"><strong><?php _e( "Choose skin", '
|
543 |
<select id="skinname" name="skinname" style="width: 200px; height: 24px; font-size: 11px;">
|
544 |
<?php require_once( dirname( __FILE__ ) . '/get_skin.php' );
|
545 |
$all_skins = get_skins( $skin_folder = '', $type = 'b' );
|
@@ -548,7 +548,7 @@ function flag_banner_wp_media_lib( $added = false ) {
|
|
548 |
echo '<option value="' . dirname( $skin_file ) . '">' . $skin_data['Name'] . '</option>' . "\n";
|
549 |
}
|
550 |
} else {
|
551 |
-
echo '<option value="
|
552 |
}
|
553 |
?>
|
554 |
</select>
|
@@ -556,14 +556,14 @@ function flag_banner_wp_media_lib( $added = false ) {
|
|
556 |
</td>
|
557 |
</tr>
|
558 |
<tr valign="top">
|
559 |
-
<th align="left" style="padding-top: 5px;"><?php _e( 'Playlist Description', '
|
560 |
<td><textarea style="width:100%;" rows="3" cols="60" name="playlist_descr"></textarea></td>
|
561 |
</tr>
|
562 |
<tr>
|
563 |
<td> </td>
|
564 |
-
<td align="right"><input class="button-secondary" type="reset" value=" <?php _e( 'Cancel', '
|
565 |
|
566 |
-
<input class="button-primary " type="submit" name="TB_NewPlaylist" value="<?php _e( 'OK', '
|
567 |
</td>
|
568 |
</tr>
|
569 |
</table>
|
99 |
if ( isset( $_POST['updateMedia'] ) ) {
|
100 |
check_admin_referer( 'flag_update' );
|
101 |
flagGallery::flagSaveWpMedia();
|
102 |
+
flagGallery::show_message( __( 'Media updated', 'flash-album-gallery' ) );
|
103 |
}
|
104 |
default:
|
105 |
flag_created_b_playlists();
|
145 |
);
|
146 |
} else{
|
147 |
var refpage = window.location.href;
|
148 |
+
jQuery(".flag_crunching .txt").html('<a href="' + refpage + '"><?php _e("Import folder is complete. The page reloads after 5 seconds.", "flash-album-gallery"); ?></a>');
|
149 |
+
//alert('<?php _e("Import folder complete. Refresh page.", "flash-album-gallery"); ?>');
|
150 |
+
setTimeout(function(){ window.location.href = refpage }, 5000);
|
151 |
}
|
152 |
}
|
153 |
|
168 |
|
169 |
?>
|
170 |
<div class="flag-wrap">
|
171 |
+
<h2><?php _e( 'Created playlists', 'flash-album-gallery' ); ?></h2>
|
172 |
<table class="widefat flag-table" cellspacing="0">
|
173 |
<thead>
|
174 |
<tr>
|
175 |
+
<th scope="col" width="25%"><?php _e( 'Title', 'flash-album-gallery' ); ?></th>
|
176 |
+
<th scope="col" width="55%"><?php _e( 'Description', 'flash-album-gallery' ); ?></th>
|
177 |
+
<th scope="col"><?php _e( 'Quantity', 'flash-album-gallery' ); ?></th>
|
178 |
+
<th scope="col"><?php _e( 'Shortcode', 'flash-album-gallery' ); ?></th>
|
179 |
+
<th scope="col"><?php _e( 'Action', 'flash-album-gallery' ); ?></th>
|
180 |
</tr>
|
181 |
</thead>
|
182 |
<tbody>
|
197 |
</a>
|
198 |
</td>
|
199 |
<td><?php echo esc_html( $playlist_data['description'] );
|
200 |
+
echo ' (' . __( "player", "flash-album-gallery" ) . ': <strong>' . esc_html( $playlist_data['skin'] ) . '</strong>)' ?></td>
|
201 |
<td><?php echo count( $query_m ); ?></td>
|
202 |
<td style="white-space: nowrap;"><input type="text" class="shortcode1" style="width: 200px; font-size: 9px;" readonly="readonly" onfocus="this.select()" value="[grandbanner xml=<?php echo $playlist_name; ?>]"/></td>
|
203 |
<td>
|
204 |
+
<a href="<?php echo wp_nonce_url( $filepath . '&playlist=' . $playlist_name . "&mode=delete", 'flag_delete' ); ?>" class="delete" onclick="javascript:check=confirm( '<?php _e( "Delete this playlist?", 'flash-album-gallery' ) ?>');if(check==false) {return false;
|
205 |
+
}"><?php _e( 'Delete', 'flash-album-gallery' ); ?></a>
|
206 |
</td>
|
207 |
</tr>
|
208 |
<?php
|
209 |
}
|
210 |
} else {
|
211 |
+
echo '<tr><td colspan="5" align="center"><strong>' . __( 'No playlists found', 'flash-album-gallery' ) . '</strong></td></tr>';
|
212 |
}
|
213 |
?>
|
214 |
</tbody>
|
310 |
// this function check for a the number of selected images, sumbmit false when no one selected
|
311 |
function checkSelected(){
|
312 |
if(!jQuery('#items_array').val()){
|
313 |
+
alert('<?php echo esc_js(__("No items selected", "flash-album-gallery")); ?>');
|
314 |
return false;
|
315 |
}
|
316 |
var actionId = jQuery('#bulkaction').val();
|
356 |
|
357 |
<!-- import folder -->
|
358 |
<div id="importfolder">
|
359 |
+
<h2><?php _e( 'Import banners from folder', 'flash-album-gallery' ); ?></h2>
|
360 |
|
361 |
<form name="importfolder" id="importfolder_form" method="POST" action="<?php echo $filepath; ?>" accept-charset="utf-8">
|
362 |
<?php wp_nonce_field( 'flag_addbanner' ); ?>
|
363 |
<table class="form-table">
|
364 |
<tr valign="top">
|
365 |
+
<th scope="row"><?php _e( 'Import from Server path:', 'flash-album-gallery' ); ?></th>
|
366 |
+
<td><input type="text" size="35" id="bannerfolder" name="bannerfolder" value="<?php echo $defaultpath; ?>"/><span class="browsefiles button" style="display:none"><?php _e( 'Browse...', "flash-album-gallery" ); ?></span>
|
367 |
|
368 |
<div id="file_browser"></div>
|
369 |
<br/>
|
370 |
<p><label><input type="checkbox" name="delete_files" value="delete"/>
|
371 |
+
<?php _e( 'delete files after import in WordPress Media Library', 'flash-album-gallery' ); ?></label></p>
|
372 |
</td>
|
373 |
</tr>
|
374 |
</table>
|
375 |
+
<div class="submit"><input class="button-primary" type="submit" name="importfolder" value="<?php _e( 'Import folder', 'flash-album-gallery' ); ?>"/></div>
|
376 |
</form>
|
377 |
</div>
|
378 |
<?php } ?>
|
379 |
<?php } ?>
|
380 |
|
381 |
+
<h2><?php _e( 'WordPress Image Library', 'flash-album-gallery' ); ?></h2>
|
382 |
|
383 |
<?php
|
384 |
// look for pagination
|
412 |
?>
|
413 |
<div class="tablenav" style="overflow: hidden; height: auto;">
|
414 |
<?php if ( $added === false ) { ?>
|
415 |
+
<div class="alignleft"><b><?php _e( 'Selected Media', 'flash-album-gallery' ); ?>: </b><input style="width:500px;" type="text" readonly="readonly" id="items_array" name="items_array" value="<?php echo $items_array_default; ?>"/>
|
416 |
+
<span class="clear_selected button"><?php _e( 'Clear Selected', 'flash-album-gallery' ); ?></span></div>
|
417 |
<?php } ?>
|
418 |
<div class="tablenav-pages"><?php $page_links_text = sprintf( '<span class="displaying-num">' . __( 'Displaying %s–%s of %s' ) . '</span>%s', number_format_i18n( ( $_GET['paged'] - 1 ) * $objects_per_page + 1 ), number_format_i18n( min( $_GET['paged'] * $objects_per_page, $img_total_count ) ), number_format_i18n( $img_total_count ), $page_links );
|
419 |
echo $page_links_text; ?></div>
|
426 |
|
427 |
<div class="actions">
|
428 |
<?php if ( $added === false ) { ?>
|
429 |
+
<input name="updateMedia" class="button-primary" style="float: right;" type="submit" value="<?php _e( 'Update Media', 'flash-album-gallery' ); ?>"/>
|
430 |
<?php if ( function_exists( 'json_encode' ) ) { ?>
|
431 |
<select name="bulkaction" id="bulkaction">
|
432 |
+
<option value="no_action"><?php _e( "No action", 'flash-album-gallery' ); ?></option>
|
433 |
+
<option value="new_playlist"><?php _e( "Create new playlist", 'flash-album-gallery' ); ?></option>
|
434 |
</select>
|
435 |
+
<input name="showThickbox" class="button-secondary" type="submit" value="<?php _e( 'Apply', 'flash-album-gallery' ); ?>" onclick="if ( !checkSelected() ) {return false;
|
436 |
}"/>
|
437 |
<?php } ?>
|
438 |
+
<a href="<?php echo admin_url( 'media-new.php' ); ?>" class="button" style="display: inline-block; margin: 0;"><?php _e( 'Upload Banner(s)', 'flash-album-gallery' ); ?></a>
|
439 |
<input type="hidden" id="items_array" name="items_array" value=""/>
|
440 |
<?php } else { ?>
|
441 |
<input type="hidden" name="mode" value="save"/>
|
444 |
<input type="hidden" name="skinname" value="<?php echo sanitize_flagname( $playlist['skin'] ); ?>"/>
|
445 |
<input type="hidden" name="skinaction" value="<?php echo sanitize_flagname( $playlist['skin'] ); ?>"/>
|
446 |
<textarea style="display: none;" name="playlist_descr" cols="40" rows="1"><?php echo esc_html( $playlist['description'] ); ?></textarea>
|
447 |
+
<input name="addToPlaylist" class="button-secondary" type="submit" value="<?php _e( 'Update Playlist', 'flash-album-gallery' ); ?>"/>
|
448 |
<?php } ?>
|
449 |
</div>
|
450 |
|
452 |
<table class="widefat flag-table" cellspacing="0">
|
453 |
<thead>
|
454 |
<tr>
|
455 |
+
<th class="cb" width="54" scope="col"><a href="#" onclick="checkAll(document.getElementById('bannerlib'));return false;"><?php _e( 'Check', 'flash-album-gallery' ); ?></a></th>
|
456 |
<th class="id" width="64" scope="col">
|
457 |
+
<div><?php _e( 'ID', 'flash-album-gallery' ); ?></div>
|
458 |
</th>
|
459 |
<th class="thumb" width="110" scope="col">
|
460 |
+
<div><?php _e( 'Thumbnail', 'flash-album-gallery' ); ?></div>
|
461 |
</th>
|
462 |
<th class="title_filename" scope="col">
|
463 |
+
<div><?php _e( 'Filename / Title / Link', 'flash-album-gallery' ); ?></div>
|
464 |
</th>
|
465 |
<th class="description" scope="col">
|
466 |
+
<div><?php _e( 'Description', 'flash-album-gallery' ); ?></div>
|
467 |
</th>
|
468 |
</tr>
|
469 |
</thead>
|
470 |
<tfoot>
|
471 |
<tr>
|
472 |
+
<th class="cb" scope="col"><a href="#" onclick="checkAll(document.getElementById('bannerlib'));return false;"><?php _e( 'Check', 'flash-album-gallery' ); ?></a></th>
|
473 |
+
<th class="id" scope="col"><?php _e( 'ID', 'flash-album-gallery' ); ?></th>
|
474 |
+
<th class="thumb" scope="col"><?php _e( 'Thumbnail', 'flash-album-gallery' ); ?></th>
|
475 |
+
<th class="title_filename" scope="col"><?php _e( 'Filename / Title / Link', 'flash-album-gallery' ); ?></th>
|
476 |
+
<th class="description" scope="col"><?php _e( 'Description', 'flash-album-gallery' ); ?></th>
|
477 |
</tr>
|
478 |
</tfoot>
|
479 |
<tbody>
|
490 |
$ex = $checked = '';
|
491 |
if ( ( $added !== false || ! empty( $items_array_default ) ) && in_array( $ban->ID, $exclude ) ) {
|
492 |
$class .= ' already-added';
|
493 |
+
$ex = ' title="' . __( "Already Added", "flash-album-gallery" ) . '"';
|
494 |
$checked = ' checked="checked"';
|
495 |
}
|
496 |
$thumb = get_post_meta( $ban->ID, 'thumbnail', true );
|
509 |
<td class="title_filename">
|
510 |
<strong><a href="<?php echo $url; ?>"><?php echo basename( $url ); ?></a></strong><br/>
|
511 |
<textarea title="Title" name="item_a[<?php echo $ban->ID; ?>][post_title]" cols="20" rows="1" style="width:95%; height: 25px; overflow:hidden;"><?php echo esc_html( stripslashes( $ban->post_title ) ); ?></textarea><br/>
|
512 |
+
<?php _e( 'URL', 'flash-album-gallery' ); ?>: <input id="banlink-<?php echo $ban->ID; ?>" name="item_a[<?php echo $ban->ID; ?>][link]" style="width:50%;" type="text" value="<?php echo esc_url( $link ); ?>"/><br/>
|
513 |
</td>
|
514 |
<td class="description">
|
515 |
<textarea name="item_a[<?php echo $ban->ID; ?>][post_content]" style="width:95%; height: 96px; margin-top: 2px; font-size:12px; line-height:115%;" rows="1"><?php echo esc_html( stripslashes( $ban->post_content ) ); ?></textarea>
|
518 |
<?php
|
519 |
}
|
520 |
} else {
|
521 |
+
echo '<tr><td colspan="5" align="center"><strong>' . __( 'No images in WordPress Media Library.', 'flash-album-gallery' ) . '</strong></td></tr>';
|
522 |
}
|
523 |
?>
|
524 |
</tbody>
|
536 |
<input type="hidden" name="page" value="banner-box"/>
|
537 |
<table width="100%" border="0" cellspacing="3" cellpadding="3">
|
538 |
<tr valign="top">
|
539 |
+
<th align="left" style="padding-top: 5px;"><?php _e( 'Playlist Title', 'flash-album-gallery' ); ?></th>
|
540 |
<td><input type="text" class="alignleft" name="playlist_title" value=""/>
|
541 |
|
542 |
+
<div class="alignright"><strong><?php _e( "Choose skin", 'flash-album-gallery' ); ?>:</strong>
|
543 |
<select id="skinname" name="skinname" style="width: 200px; height: 24px; font-size: 11px;">
|
544 |
<?php require_once( dirname( __FILE__ ) . '/get_skin.php' );
|
545 |
$all_skins = get_skins( $skin_folder = '', $type = 'b' );
|
548 |
echo '<option value="' . dirname( $skin_file ) . '">' . $skin_data['Name'] . '</option>' . "\n";
|
549 |
}
|
550 |
} else {
|
551 |
+
echo '<option value="nivoslider">' . __( "No Skins", "flash-album-gallery" ) . '</option>';
|
552 |
}
|
553 |
?>
|
554 |
</select>
|
556 |
</td>
|
557 |
</tr>
|
558 |
<tr valign="top">
|
559 |
+
<th align="left" style="padding-top: 5px;"><?php _e( 'Playlist Description', 'flash-album-gallery' ); ?></th>
|
560 |
<td><textarea style="width:100%;" rows="3" cols="60" name="playlist_descr"></textarea></td>
|
561 |
</tr>
|
562 |
<tr>
|
563 |
<td> </td>
|
564 |
+
<td align="right"><input class="button-secondary" type="reset" value=" <?php _e( 'Cancel', 'flash-album-gallery' ); ?> " onclick="tb_remove()"/>
|
565 |
|
566 |
+
<input class="button-primary " type="submit" name="TB_NewPlaylist" value="<?php _e( 'OK', 'flash-album-gallery' ); ?>"/>
|
567 |
</td>
|
568 |
</tr>
|
569 |
</table>
|
admin/banner-sort.php
CHANGED
@@ -15,15 +15,15 @@ function flag_b_playlist_order( $playlist = 'deprecated' ) {
|
|
15 |
<script type="text/javascript" src="<?php echo FLAG_URLPATH; ?>admin/js/jquery.tablednd_0_5.js"></script>
|
16 |
<script type="text/javascript" src="<?php echo FLAG_URLPATH; ?>admin/js/jquery.tablesorter.js"></script>
|
17 |
<div class="flag-wrap">
|
18 |
-
<h2><?php _e( 'Sort Gallery', '
|
19 |
|
20 |
<div class="alignright tablenav" style="margin-bottom: -36px;">
|
21 |
-
<a href="<?php echo esc_url( $base_url . '&playlist=' . $filename . '&mode=edit' ); ?>" class="button-secondary action"><?php _e( 'Back to playlist', '
|
22 |
</div>
|
23 |
<form id="sortPlaylist" method="POST" action="<?php echo esc_url( $base_url . '&playlist=' . $filename . '&mode=edit' ); ?>" accept-charset="utf-8">
|
24 |
<div class="alignleft tablenav">
|
25 |
<?php wp_nonce_field( 'flag_update' ); ?>
|
26 |
-
<input class="button-primary action" type="submit" name="updatePlaylist" value="<?php _e( 'Update Sort Order', '
|
27 |
</div>
|
28 |
<br clear="all"/>
|
29 |
<input type="hidden" name="playlist_title" value="<?php echo esc_html( $playlist['title'] ); ?>"/>
|
@@ -63,18 +63,18 @@ function flag_b_playlist_order( $playlist = 'deprecated' ) {
|
|
63 |
|
64 |
<thead>
|
65 |
<tr>
|
66 |
-
<th class="header" width="54"><p style="margin-right:-10px;"><?php _e( 'ID', '
|
67 |
-
<th width="
|
68 |
-
<th class="header"><p><?php _e( 'Filename', '
|
69 |
-
<th class="header"><p><?php _e( 'Title', '
|
70 |
</tr>
|
71 |
</thead>
|
72 |
<tfoot>
|
73 |
<tr>
|
74 |
-
<th><p><?php _e( 'ID', '
|
75 |
-
<th><p><?php _e( 'Thumb', '
|
76 |
-
<th><p><?php _e( 'Filename', '
|
77 |
-
<th><p><?php _e( 'Title', '
|
78 |
</tr>
|
79 |
</tfoot>
|
80 |
<tbody id="listitems">
|
@@ -94,19 +94,19 @@ function flag_b_playlist_order( $playlist = 'deprecated' ) {
|
|
94 |
?>
|
95 |
<tr id="$ban-<?php echo $ban->ID; ?>" class="<?php echo $alternate; ?> iedit" valign="top">
|
96 |
<td scope="row"><input type="hidden" name="item_a[<?php echo $ban->ID; ?>][ID]" value="<?php echo $ban->ID; ?>"/><strong><?php echo $ban->ID; ?></strong></td>
|
97 |
-
<td
|
98 |
<td><?php echo basename( $url ); ?></td>
|
99 |
<td><?php echo esc_html( stripslashes( $ban->post_title ) ); ?></td>
|
100 |
</tr>
|
101 |
<?php
|
102 |
}
|
103 |
} else {
|
104 |
-
echo '<tr><td colspan="4" align="center"><strong>' . __( 'No entries found', '
|
105 |
}
|
106 |
?>
|
107 |
</tbody>
|
108 |
</table>
|
109 |
-
<p class="actions"><input type="submit" class="button-primary action" name="updatePlaylist" value="<?php _e( 'Update Sort Order', '
|
110 |
</form>
|
111 |
<br class="clear"/>
|
112 |
</div><!-- /#wrap -->
|
15 |
<script type="text/javascript" src="<?php echo FLAG_URLPATH; ?>admin/js/jquery.tablednd_0_5.js"></script>
|
16 |
<script type="text/javascript" src="<?php echo FLAG_URLPATH; ?>admin/js/jquery.tablesorter.js"></script>
|
17 |
<div class="flag-wrap">
|
18 |
+
<h2><?php _e( 'Sort Gallery', 'flash-album-gallery' ); ?></h2>
|
19 |
|
20 |
<div class="alignright tablenav" style="margin-bottom: -36px;">
|
21 |
+
<a href="<?php echo esc_url( $base_url . '&playlist=' . $filename . '&mode=edit' ); ?>" class="button-secondary action"><?php _e( 'Back to playlist', 'flash-album-gallery' ); ?></a>
|
22 |
</div>
|
23 |
<form id="sortPlaylist" method="POST" action="<?php echo esc_url( $base_url . '&playlist=' . $filename . '&mode=edit' ); ?>" accept-charset="utf-8">
|
24 |
<div class="alignleft tablenav">
|
25 |
<?php wp_nonce_field( 'flag_update' ); ?>
|
26 |
+
<input class="button-primary action" type="submit" name="updatePlaylist" value="<?php _e( 'Update Sort Order', 'flash-album-gallery' ); ?>"/>
|
27 |
</div>
|
28 |
<br clear="all"/>
|
29 |
<input type="hidden" name="playlist_title" value="<?php echo esc_html( $playlist['title'] ); ?>"/>
|
63 |
|
64 |
<thead>
|
65 |
<tr>
|
66 |
+
<th class="header" width="54"><p style="margin-right:-10px;"><?php _e( 'ID', 'flash-album-gallery' ); ?></p></th>
|
67 |
+
<th width="120"><p><?php _e( 'Thumb', 'flash-album-gallery' ); ?></p></th>
|
68 |
+
<th class="header"><p><?php _e( 'Filename', 'flash-album-gallery' ); ?></p></th>
|
69 |
+
<th class="header"><p><?php _e( 'Title', 'flash-album-gallery' ); ?></p></th>
|
70 |
</tr>
|
71 |
</thead>
|
72 |
<tfoot>
|
73 |
<tr>
|
74 |
+
<th><p><?php _e( 'ID', 'flash-album-gallery' ); ?></p></th>
|
75 |
+
<th><p><?php _e( 'Thumb', 'flash-album-gallery' ); ?></p></th>
|
76 |
+
<th><p><?php _e( 'Filename', 'flash-album-gallery' ); ?></p></th>
|
77 |
+
<th><p><?php _e( 'Title', 'flash-album-gallery' ); ?></p></th>
|
78 |
</tr>
|
79 |
</tfoot>
|
80 |
<tbody id="listitems">
|
94 |
?>
|
95 |
<tr id="$ban-<?php echo $ban->ID; ?>" class="<?php echo $alternate; ?> iedit" valign="top">
|
96 |
<td scope="row"><input type="hidden" name="item_a[<?php echo $ban->ID; ?>][ID]" value="<?php echo $ban->ID; ?>"/><strong><?php echo $ban->ID; ?></strong></td>
|
97 |
+
<td><a class="thickbox" title="<?php echo basename( $url ); ?>" href="<?php echo $url; ?>"><img id="thumb-<?php echo $ban->ID; ?>" src="<?php echo $thumb; ?>" width="80" style="height:auto" alt=""/></a></td>
|
98 |
<td><?php echo basename( $url ); ?></td>
|
99 |
<td><?php echo esc_html( stripslashes( $ban->post_title ) ); ?></td>
|
100 |
</tr>
|
101 |
<?php
|
102 |
}
|
103 |
} else {
|
104 |
+
echo '<tr><td colspan="4" align="center"><strong>' . __( 'No entries found', 'flash-album-gallery' ) . '</strong></td></tr>';
|
105 |
}
|
106 |
?>
|
107 |
</tbody>
|
108 |
</table>
|
109 |
+
<p class="actions"><input type="submit" class="button-primary action" name="updatePlaylist" value="<?php _e( 'Update Sort Order', 'flash-album-gallery' ); ?>"/></p>
|
110 |
</form>
|
111 |
<br class="clear"/>
|
112 |
</div><!-- /#wrap -->
|
admin/banner.functions.php
CHANGED
@@ -1,117 +1,140 @@
|
|
1 |
<?php
|
2 |
-
if
|
3 |
-
|
4 |
}
|
5 |
|
6 |
-
function get_b_playlist_data(
|
7 |
|
8 |
-
|
9 |
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
$playlist_data['items'] = $items[1];
|
17 |
|
18 |
-
|
19 |
}
|
20 |
|
21 |
/**
|
22 |
* Check the playlists directory and retrieve all playlist files with playlist data.
|
23 |
*
|
24 |
*/
|
25 |
-
function get_b_playlists(
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
}
|
70 |
|
71 |
-
function flagSave_bPlaylist(
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
115 |
<category id="' . $file . '">
|
116 |
<properties>
|
117 |
<title><![CDATA[' . $title . ']]></title>
|
@@ -120,89 +143,58 @@ function flagSave_bPlaylist( $title, $descr, $data, $file = '', $skinaction = ''
|
|
120 |
</properties>
|
121 |
<items>';
|
122 |
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
$dir = $info['dirname'];
|
131 |
-
$ext = $info['extension'];
|
132 |
-
$name = urldecode( basename( str_replace( '%2F', '/', urlencode( $path ) ), ".$ext" ) );
|
133 |
-
$img_file = "{$dir}/{$name}-{$suffix}.{$ext}";
|
134 |
-
if ( ! file_exists( $img_file ) ) {
|
135 |
-
if ( function_exists( 'wp_get_image_editor' ) ) {
|
136 |
-
$editor = wp_get_image_editor( $path );
|
137 |
-
$editor->resize( $w, $h, $cut = true );
|
138 |
-
$dest_file = $editor->generate_filename( $suffix );
|
139 |
-
$thumb = $editor->save( $dest_file );
|
140 |
-
} else {
|
141 |
-
$thumb = image_resize( $path, $w, $h, $cut = true, $suffix );
|
142 |
-
}
|
143 |
-
if ( is_string( $thumb ) ) {
|
144 |
-
$img = substr( $thumb, strpos( $thumb, basename( WP_CONTENT_DIR ) ) );
|
145 |
-
$track = get_bloginfo( 'wpurl' ) . '/' . $img;
|
146 |
-
} else {
|
147 |
-
$track = $url;
|
148 |
-
}
|
149 |
-
|
150 |
-
} else {
|
151 |
-
$track = dirname( $url ) . "/{$name}-{$suffix}.{$ext}";
|
152 |
-
}
|
153 |
-
} else {
|
154 |
-
$track = $url;
|
155 |
-
}
|
156 |
-
$thumbnail = get_post_meta( $id, 'thumbnail', true );
|
157 |
-
$link = get_post_meta( $id, 'link', true );
|
158 |
-
$preview = get_post_meta( $id, 'preview', true );
|
159 |
-
$content .= '
|
160 |
<item id="' . $ban->ID . '">
|
161 |
-
<track>' . $
|
162 |
<title><![CDATA[' . $ban->post_title . ']]></title>
|
163 |
<link>' . $link . '</link>
|
164 |
-
<preview>' . $preview . '</preview>
|
165 |
<description><![CDATA[' . $ban->post_content . ']]></description>
|
166 |
<thumbnail>' . $thumbnail . '</thumbnail>
|
167 |
</item>';
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
</items>
|
172 |
</category>
|
173 |
</gallery>';
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
}
|
186 |
|
187 |
-
function flagSave_bPlaylistSkin(
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
}
|
198 |
|
199 |
-
function flag_b_playlist_delete(
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
}
|
1 |
<?php
|
2 |
+
if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])){
|
3 |
+
die('You are not allowed to call this page directly.');
|
4 |
}
|
5 |
|
6 |
+
function get_b_playlist_data($playlist_file){
|
7 |
|
8 |
+
$playlist_content = file_get_contents($playlist_file);
|
9 |
|
10 |
+
$playlist_data['settings'] = flagGallery::flagGetBetween($playlist_content, '<settings><![CDATA[', ']]></settings>');
|
11 |
+
$playlist_data['title'] = flagGallery::flagGetBetween($playlist_content, '<title><![CDATA[', ']]></title>');
|
12 |
+
$playlist_data['skin'] = flagGallery::flagGetBetween($playlist_content, '<skin><![CDATA[', ']]></skin>');
|
13 |
+
$playlist_data['description'] = flagGallery::flagGetBetween($playlist_content, '<description><![CDATA[', ']]></description>');
|
14 |
+
preg_match_all('|<item id="(.*)">|', $playlist_content, $items);
|
15 |
+
$playlist_data['items'] = $items[1];
|
|
|
16 |
|
17 |
+
return $playlist_data;
|
18 |
}
|
19 |
|
20 |
/**
|
21 |
* Check the playlists directory and retrieve all playlist files with playlist data.
|
22 |
*
|
23 |
*/
|
24 |
+
function get_b_playlists($playlist_folder = ''){
|
25 |
+
|
26 |
+
$flag_options = get_option('flag_options');
|
27 |
+
$flag_playlists = array();
|
28 |
+
$playlist_root = ABSPATH . $flag_options['galleryPath'] . 'playlists/banner';
|
29 |
+
if( !empty($playlist_folder)){
|
30 |
+
$playlist_root = $playlist_folder;
|
31 |
+
}
|
32 |
+
|
33 |
+
// Files in flagallery/playlists directory
|
34 |
+
$playlists_dir = @ opendir($playlist_root);
|
35 |
+
$playlist_files = array();
|
36 |
+
if($playlists_dir){
|
37 |
+
while(($file = readdir($playlists_dir)) !== false){
|
38 |
+
if(substr($file, 0, 1) == '.'){
|
39 |
+
continue;
|
40 |
+
}
|
41 |
+
if(substr($file, - 4) == '.xml'){
|
42 |
+
$playlist_files[] = $file;
|
43 |
+
}
|
44 |
+
}
|
45 |
+
}
|
46 |
+
@closedir($playlists_dir);
|
47 |
+
|
48 |
+
if( !$playlists_dir || empty($playlist_files)){
|
49 |
+
return $flag_playlists;
|
50 |
+
}
|
51 |
+
|
52 |
+
foreach($playlist_files as $playlist_file){
|
53 |
+
if( !is_readable("$playlist_root/$playlist_file")){
|
54 |
+
continue;
|
55 |
+
}
|
56 |
+
|
57 |
+
$playlist_data = get_b_playlist_data("$playlist_root/$playlist_file");
|
58 |
+
|
59 |
+
if(empty ($playlist_data['title'])){
|
60 |
+
continue;
|
61 |
+
}
|
62 |
+
|
63 |
+
$flag_playlists[ basename($playlist_file, ".xml") ] = $playlist_data;
|
64 |
+
}
|
65 |
+
uasort($flag_playlists, create_function('$a, $b', 'return strnatcasecmp( $a["title"], $b["title"] );'));
|
66 |
+
|
67 |
+
return $flag_playlists;
|
68 |
}
|
69 |
|
70 |
+
function flagSave_bPlaylist($title, $descr, $data, $file = '', $skinaction = ''){
|
71 |
+
|
72 |
+
require_once(ABSPATH . '/wp-admin/includes/image.php');
|
73 |
+
if( !trim($title)){
|
74 |
+
$title = 'default';
|
75 |
+
}
|
76 |
+
$title = htmlspecialchars_decode(stripslashes($title), ENT_QUOTES);
|
77 |
+
$descr = htmlspecialchars_decode(stripslashes($descr), ENT_QUOTES);
|
78 |
+
if( !$file){
|
79 |
+
$file = sanitize_flagname($title);
|
80 |
+
}
|
81 |
+
if( !is_array($data)){
|
82 |
+
$data = explode(',', $data);
|
83 |
+
}
|
84 |
+
|
85 |
+
$flag_options = get_option('flag_options');
|
86 |
+
$skin = isset($_POST['skinname'])? sanitize_flagname($_POST['skinname']) : 'nivoslider';
|
87 |
+
if( !$skinaction){
|
88 |
+
$skinaction = isset($_POST['skinaction'])? sanitize_key($_POST['skinaction']) : 'update';
|
89 |
+
}
|
90 |
+
$skinpath = str_replace("\\","/", WP_PLUGIN_DIR ).'/flagallery-skins/'.$skin;
|
91 |
+
if(!is_dir($skinpath)) {
|
92 |
+
$skinpath = str_replace("\\","/", WP_PLUGIN_DIR ).'/flash-album-gallery/skins/'.$skin;
|
93 |
+
if(!is_dir($skinpath)) {
|
94 |
+
$skin = 'nivoslider';
|
95 |
+
$skinpath = str_replace("\\","/", WP_PLUGIN_DIR ).'/flagallery-skins/'.$skin;
|
96 |
+
if(!is_dir($skinpath)) {
|
97 |
+
$skinpath = str_replace("\\","/", WP_PLUGIN_DIR ).'/flash-album-gallery/skins/'.$skin;
|
98 |
+
}
|
99 |
+
}
|
100 |
+
}
|
101 |
+
$playlistPath = ABSPATH . $flag_options['galleryPath'] . 'playlists/banner/' . $file . '.xml';
|
102 |
+
|
103 |
+
if(file_exists($skinpath . "/settings.php")){
|
104 |
+
/**
|
105 |
+
* @var $default_options
|
106 |
+
*/
|
107 |
+
include($skinpath . "/settings.php");
|
108 |
+
} else{
|
109 |
+
flagGallery::show_message(__("Can't find skin settings", 'flash-album-gallery'));
|
110 |
+
|
111 |
+
return;
|
112 |
+
}
|
113 |
+
|
114 |
+
$arr_xml_settings = array();
|
115 |
+
$settings = array();
|
116 |
+
if(file_exists($playlistPath)){
|
117 |
+
$playlist = file_get_contents($playlistPath);
|
118 |
+
$xml_settings = flagGallery::flagGetBetween($playlist, '<settings><![CDATA[', ']]></settings>');
|
119 |
+
if($xml_settings){
|
120 |
+
$arr_xml_settings = json_decode($xml_settings);
|
121 |
+
if(!empty($arr_xml_settings)){
|
122 |
+
$settings = array_replace_recursive((array)$arr_xml_settings, $settings);
|
123 |
+
}
|
124 |
+
}
|
125 |
+
}
|
126 |
+
if(empty($settings) || ($skin !== $skinaction)){
|
127 |
+
$settings = $default_options;
|
128 |
+
if(isset($flag_options["{$skin}_options"])){
|
129 |
+
$db_skin_options = maybe_unserialize( $flag_options["{$skin}_options"] );
|
130 |
+
$settings = array_replace_recursive( $settings, $db_skin_options );
|
131 |
+
}
|
132 |
+
}
|
133 |
+
$properties = json_encode($settings);
|
134 |
+
|
135 |
+
if(count($data)){
|
136 |
+
$content = '<gallery>
|
137 |
+
<settings><![CDATA[' . $properties . ']]></settings>
|
138 |
<category id="' . $file . '">
|
139 |
<properties>
|
140 |
<title><![CDATA[' . $title . ']]></title>
|
143 |
</properties>
|
144 |
<items>';
|
145 |
|
146 |
+
foreach((array) $data as $id){
|
147 |
+
$ban = get_post($id);
|
148 |
+
if($ban->ID){
|
149 |
+
$url = wp_get_attachment_url($ban->ID);
|
150 |
+
$thumbnail = wp_get_attachment_image_url( $ban->ID, 'large', false );
|
151 |
+
$link = get_post_meta($id, 'link', true);
|
152 |
+
$content .= '
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
153 |
<item id="' . $ban->ID . '">
|
154 |
+
<track>' . $url . '</track>
|
155 |
<title><![CDATA[' . $ban->post_title . ']]></title>
|
156 |
<link>' . $link . '</link>
|
|
|
157 |
<description><![CDATA[' . $ban->post_content . ']]></description>
|
158 |
<thumbnail>' . $thumbnail . '</thumbnail>
|
159 |
</item>';
|
160 |
+
}
|
161 |
+
}
|
162 |
+
$content .= '
|
163 |
</items>
|
164 |
</category>
|
165 |
</gallery>';
|
166 |
+
//$content = str_replace(array('\\\'','\"'), array('\'','"'), $content);
|
167 |
+
// Save options
|
168 |
+
$flag_options = get_option('flag_options');
|
169 |
+
if(wp_mkdir_p(ABSPATH . $flag_options['galleryPath'] . 'playlists/banner/')){
|
170 |
+
if(flagGallery::saveFile($playlistPath, $content, 'w')){
|
171 |
+
flagGallery::show_message(__('Playlist Saved Successfully', 'flash-album-gallery'));
|
172 |
+
}
|
173 |
+
} else{
|
174 |
+
flagGallery::show_message(__('Create directory please:', 'flash-album-gallery') . '"/' . $flag_options['galleryPath'] . 'playlists/banner/"');
|
175 |
+
}
|
176 |
+
}
|
177 |
}
|
178 |
|
179 |
+
function flagSave_bPlaylistSkin($file){
|
180 |
+
$file = sanitize_flagname($file);
|
181 |
+
$flag_options = get_option('flag_options');
|
182 |
+
$playlistPath = ABSPATH . $flag_options['galleryPath'] . 'playlists/banner/' . $file . '.xml';
|
183 |
+
// Save options
|
184 |
+
$title = esc_html($_POST['playlist_title']);
|
185 |
+
$descr = esc_html($_POST['playlist_descr']);
|
186 |
+
$items = get_b_playlist_data($playlistPath);
|
187 |
+
$data = $items['items'];
|
188 |
+
flagSave_bPlaylist($title, $descr, $data, $file, $skinaction = 'update');
|
189 |
}
|
190 |
|
191 |
+
function flag_b_playlist_delete($playlist){
|
192 |
+
$playlist = sanitize_file_name($playlist);
|
193 |
+
$flag_options = get_option('flag_options');
|
194 |
+
$playlistXML = ABSPATH . $flag_options['galleryPath'] . 'playlists/banner/' . $playlist . '.xml';
|
195 |
+
if(file_exists($playlistXML)){
|
196 |
+
if(unlink($playlistXML)){
|
197 |
+
flagGallery::show_message("'" . $playlist . ".xml' " . __('deleted', 'flash-album-gallery'));
|
198 |
+
}
|
199 |
+
}
|
200 |
}
|
admin/css/flagadmin.css
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
/*
|
2 |
-
**
|
3 |
*/
|
4 |
|
5 |
/* SETTINGS FOR SKIN PAGE */
|
@@ -13,15 +13,321 @@
|
|
13 |
.skins .active td {
|
14 |
color: #000;
|
15 |
}
|
16 |
-
.skins .inactive a {
|
17 |
color: #557799;
|
18 |
}
|
19 |
-
.skins .inactive a:hover {
|
20 |
color: #d54e21;
|
21 |
}
|
22 |
.skins tr.first td {border-bottom:1px solid #F9F9F9;}
|
23 |
-
.skins tr.second td {border-top:none;}
|
|
|
24 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
|
26 |
/* SETTINGS FOR Overview Gallery */
|
27 |
.flag-wrap {margin:20px 20px 0 2px}
|
@@ -145,10 +451,12 @@ p#flag-inlinebutton {
|
|
145 |
.fixed .column-views {
|
146 |
width: 4em; text-align: center;
|
147 |
}
|
148 |
-
|
|
|
|
|
149 |
.flag-table td,
|
150 |
.flag-table th {padding:4px 7px; text-align:left;}
|
151 |
-
.flag-table th {font-weight:bold; padding:
|
152 |
.flag-table th p {margin:0;}
|
153 |
|
154 |
#flag-listmusic tbody td { height: 50px; }
|
@@ -169,7 +477,7 @@ p#flag-inlinebutton {
|
|
169 |
.flag-ajax-post { cursor: pointer; text-decoration: underline; }
|
170 |
.flag-ajax-post:hover { color: #ff0000; }
|
171 |
|
172 |
-
.all_galleries { float: left; white-space: nowrap; margin:
|
173 |
.all_galleries .acat { border: 1px solid #cccccc; padding: 3px 6px; margin: 3px 0; background: #fefefe; cursor: move; min-width:15%; }
|
174 |
.all_galleries .acat .drop { display: none; }
|
175 |
.all_galleries .acat:hover { background-color: #FFFFEE; }
|
@@ -277,4 +585,15 @@ div#license div p { font-size: 13px; }
|
|
277 |
#gmUpload { padding-top:10px }
|
278 |
#gmUpload table td { font-size: 11px !important; }
|
279 |
|
280 |
-
.already-added {background-color:#DDFFBB;}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
/*
|
2 |
+
** FlaGallery Admin StyleSheet
|
3 |
*/
|
4 |
|
5 |
/* SETTINGS FOR SKIN PAGE */
|
13 |
.skins .active td {
|
14 |
color: #000;
|
15 |
}
|
16 |
+
.skins .inactive a:not(.button) {
|
17 |
color: #557799;
|
18 |
}
|
19 |
+
.skins .inactive a:not(.button):hover {
|
20 |
color: #d54e21;
|
21 |
}
|
22 |
.skins tr.first td {border-bottom:1px solid #F9F9F9;}
|
23 |
+
.skins tr.second td {border-top:none; border-bottom: 30px solid #f1f1f1;}
|
24 |
+
.skins td img { max-width:300px;}
|
25 |
|
26 |
+
fieldset {
|
27 |
+
padding: 0;
|
28 |
+
margin: 0;
|
29 |
+
border: 0;
|
30 |
+
min-width: 0;
|
31 |
+
}
|
32 |
+
legend {
|
33 |
+
display: block;
|
34 |
+
width: 100%;
|
35 |
+
padding: 0;
|
36 |
+
margin-bottom: 20px;
|
37 |
+
font-size: 21px;
|
38 |
+
line-height: inherit;
|
39 |
+
color: #333333;
|
40 |
+
border: 0;
|
41 |
+
border-bottom: 1px solid #e5e5e5;
|
42 |
+
}
|
43 |
+
label {
|
44 |
+
display: inline-block;
|
45 |
+
max-width: 100%;
|
46 |
+
margin-bottom: 5px;
|
47 |
+
font-weight: bold;
|
48 |
+
}
|
49 |
+
.form-control {
|
50 |
+
display: block;
|
51 |
+
width: 100%;
|
52 |
+
height: 34px;
|
53 |
+
padding: 6px 12px;
|
54 |
+
font-size: 14px;
|
55 |
+
line-height: 1.42857143;
|
56 |
+
color: #555555;
|
57 |
+
background-color: #ffffff;
|
58 |
+
background-image: none;
|
59 |
+
border: 1px solid #cccccc;
|
60 |
+
border-radius: 4px;
|
61 |
+
box-sizing: border-box;
|
62 |
+
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
|
63 |
+
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
|
64 |
+
-webkit-transition: border-color ease-in-out .15s, -webkit-box-shadow ease-in-out .15s;
|
65 |
+
-o-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
|
66 |
+
transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
|
67 |
+
}
|
68 |
+
.form-control:focus {
|
69 |
+
border-color: #66afe9;
|
70 |
+
outline: 0;
|
71 |
+
-webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6);
|
72 |
+
box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6);
|
73 |
+
}
|
74 |
+
.form-control::-moz-placeholder {
|
75 |
+
color: #999999;
|
76 |
+
opacity: 1;
|
77 |
+
}
|
78 |
+
.form-control:-ms-input-placeholder {
|
79 |
+
color: #999999;
|
80 |
+
}
|
81 |
+
.form-control::-webkit-input-placeholder {
|
82 |
+
color: #999999;
|
83 |
+
}
|
84 |
+
.form-control::-ms-expand {
|
85 |
+
border: 0;
|
86 |
+
background-color: transparent;
|
87 |
+
}
|
88 |
+
.form-control[disabled],
|
89 |
+
.form-control[readonly],
|
90 |
+
fieldset[disabled] .form-control {
|
91 |
+
background-color: #eeeeee;
|
92 |
+
opacity: 1;
|
93 |
+
}
|
94 |
+
.form-control[disabled],
|
95 |
+
fieldset[disabled] .form-control {
|
96 |
+
cursor: not-allowed;
|
97 |
+
}
|
98 |
+
textarea.form-control {
|
99 |
+
height: auto;
|
100 |
+
}
|
101 |
+
.form-group {
|
102 |
+
margin-bottom: 15px;
|
103 |
+
}
|
104 |
+
.radio,
|
105 |
+
.checkbox {
|
106 |
+
position: relative;
|
107 |
+
display: block;
|
108 |
+
margin-top: 10px;
|
109 |
+
margin-bottom: 10px;
|
110 |
+
}
|
111 |
+
.radio label,
|
112 |
+
.checkbox label {
|
113 |
+
min-height: 20px;
|
114 |
+
padding-left: 20px;
|
115 |
+
margin-bottom: 0;
|
116 |
+
font-weight: normal;
|
117 |
+
cursor: pointer;
|
118 |
+
}
|
119 |
+
.radio input[type="radio"],
|
120 |
+
.radio-inline input[type="radio"],
|
121 |
+
.checkbox input[type="checkbox"],
|
122 |
+
.checkbox-inline input[type="checkbox"] {
|
123 |
+
position: absolute;
|
124 |
+
margin: 0 0 0 -20px;
|
125 |
+
margin-top: 4px \9;
|
126 |
+
width:16px;
|
127 |
+
height:16px;
|
128 |
+
}
|
129 |
+
.radio + .radio,
|
130 |
+
.checkbox + .checkbox {
|
131 |
+
margin-top: -5px;
|
132 |
+
}
|
133 |
+
.radio-inline,
|
134 |
+
.checkbox-inline {
|
135 |
+
position: relative;
|
136 |
+
display: inline-block;
|
137 |
+
padding-left: 20px;
|
138 |
+
margin-bottom: 0;
|
139 |
+
vertical-align: middle;
|
140 |
+
font-weight: normal;
|
141 |
+
cursor: pointer;
|
142 |
+
}
|
143 |
+
.radio-inline + .radio-inline,
|
144 |
+
.checkbox-inline + .checkbox-inline {
|
145 |
+
margin-top: 0;
|
146 |
+
margin-left: 10px;
|
147 |
+
}
|
148 |
+
input[type="radio"][disabled],
|
149 |
+
input[type="checkbox"][disabled],
|
150 |
+
input[type="radio"].disabled,
|
151 |
+
input[type="checkbox"].disabled,
|
152 |
+
fieldset[disabled] input[type="radio"],
|
153 |
+
fieldset[disabled] input[type="checkbox"] {
|
154 |
+
cursor: not-allowed;
|
155 |
+
}
|
156 |
+
.radio-inline.disabled,
|
157 |
+
.checkbox-inline.disabled,
|
158 |
+
fieldset[disabled] .radio-inline,
|
159 |
+
fieldset[disabled] .checkbox-inline {
|
160 |
+
cursor: not-allowed;
|
161 |
+
}
|
162 |
+
.radio.disabled label,
|
163 |
+
.checkbox.disabled label,
|
164 |
+
fieldset[disabled] .radio label,
|
165 |
+
fieldset[disabled] .checkbox label {
|
166 |
+
cursor: not-allowed;
|
167 |
+
}
|
168 |
+
.form-control-static {
|
169 |
+
padding-top: 7px;
|
170 |
+
padding-bottom: 7px;
|
171 |
+
margin-bottom: 0;
|
172 |
+
min-height: 34px;
|
173 |
+
}
|
174 |
+
.form-control-static.input-lg,
|
175 |
+
.form-control-static.input-sm {
|
176 |
+
padding-left: 0;
|
177 |
+
padding-right: 0;
|
178 |
+
}
|
179 |
+
.input-sm {
|
180 |
+
height: 30px;
|
181 |
+
padding: 5px 10px;
|
182 |
+
font-size: 12px;
|
183 |
+
line-height: 1.5;
|
184 |
+
border-radius: 3px;
|
185 |
+
box-sizing:border-box;
|
186 |
+
}
|
187 |
+
select.input-sm {
|
188 |
+
height: 30px;
|
189 |
+
line-height: 30px;
|
190 |
+
}
|
191 |
+
textarea.input-sm,
|
192 |
+
select[multiple].input-sm {
|
193 |
+
height: auto;
|
194 |
+
}
|
195 |
+
.form-group-sm .form-control {
|
196 |
+
height: 30px;
|
197 |
+
padding: 5px 10px;
|
198 |
+
font-size: 12px;
|
199 |
+
line-height: 1.5;
|
200 |
+
border-radius: 3px;
|
201 |
+
}
|
202 |
+
.form-group-sm select.form-control {
|
203 |
+
height: 30px;
|
204 |
+
line-height: 30px;
|
205 |
+
}
|
206 |
+
.form-group-sm textarea.form-control,
|
207 |
+
.form-group-sm select[multiple].form-control {
|
208 |
+
height: auto;
|
209 |
+
}
|
210 |
+
.form-group-sm .form-control-static {
|
211 |
+
height: 30px;
|
212 |
+
min-height: 32px;
|
213 |
+
padding: 6px 10px;
|
214 |
+
font-size: 12px;
|
215 |
+
line-height: 1.5;
|
216 |
+
}
|
217 |
+
.input-lg {
|
218 |
+
height: 46px;
|
219 |
+
padding: 10px 16px;
|
220 |
+
font-size: 18px;
|
221 |
+
line-height: 1.3333333;
|
222 |
+
border-radius: 6px;
|
223 |
+
}
|
224 |
+
select.input-lg {
|
225 |
+
height: 46px;
|
226 |
+
line-height: 46px;
|
227 |
+
}
|
228 |
+
textarea.input-lg,
|
229 |
+
select[multiple].input-lg {
|
230 |
+
height: auto;
|
231 |
+
}
|
232 |
+
.form-group-lg .form-control {
|
233 |
+
height: 46px;
|
234 |
+
padding: 10px 16px;
|
235 |
+
font-size: 18px;
|
236 |
+
line-height: 1.3333333;
|
237 |
+
border-radius: 6px;
|
238 |
+
}
|
239 |
+
.form-group-lg select.form-control {
|
240 |
+
height: 46px;
|
241 |
+
line-height: 46px;
|
242 |
+
}
|
243 |
+
.form-group-lg textarea.form-control,
|
244 |
+
.form-group-lg select[multiple].form-control {
|
245 |
+
height: auto;
|
246 |
+
}
|
247 |
+
.form-group-lg .form-control-static {
|
248 |
+
height: 46px;
|
249 |
+
min-height: 38px;
|
250 |
+
padding: 11px 16px;
|
251 |
+
font-size: 18px;
|
252 |
+
line-height: 1.3333333;
|
253 |
+
}
|
254 |
+
.has-feedback {
|
255 |
+
position: relative;
|
256 |
+
}
|
257 |
+
.has-feedback .form-control {
|
258 |
+
padding-right: 42.5px;
|
259 |
+
}
|
260 |
+
.form-control-feedback {
|
261 |
+
position: absolute;
|
262 |
+
top: 0;
|
263 |
+
right: 0;
|
264 |
+
z-index: 2;
|
265 |
+
display: block;
|
266 |
+
width: 34px;
|
267 |
+
height: 34px;
|
268 |
+
line-height: 34px;
|
269 |
+
text-align: center;
|
270 |
+
pointer-events: none;
|
271 |
+
}
|
272 |
+
.input-lg + .form-control-feedback,
|
273 |
+
.input-group-lg + .form-control-feedback,
|
274 |
+
.form-group-lg .form-control + .form-control-feedback {
|
275 |
+
width: 46px;
|
276 |
+
height: 46px;
|
277 |
+
line-height: 46px;
|
278 |
+
}
|
279 |
+
.input-sm + .form-control-feedback,
|
280 |
+
.input-group-sm + .form-control-feedback,
|
281 |
+
.form-group-sm .form-control + .form-control-feedback {
|
282 |
+
width: 30px;
|
283 |
+
height: 30px;
|
284 |
+
line-height: 30px;
|
285 |
+
}
|
286 |
+
.help-block {
|
287 |
+
display: block;
|
288 |
+
margin-top: 5px;
|
289 |
+
margin-bottom: 10px;
|
290 |
+
color: #737373;
|
291 |
+
}
|
292 |
+
.form-horizontal .radio,
|
293 |
+
.form-horizontal .checkbox,
|
294 |
+
.form-horizontal .radio-inline,
|
295 |
+
.form-horizontal .checkbox-inline {
|
296 |
+
margin-top: 0;
|
297 |
+
margin-bottom: 0;
|
298 |
+
padding-top: 7px;
|
299 |
+
}
|
300 |
+
.form-horizontal .radio,
|
301 |
+
.form-horizontal .checkbox {
|
302 |
+
min-height: 27px;
|
303 |
+
}
|
304 |
+
.form-horizontal .form-group {
|
305 |
+
margin-left: -15px;
|
306 |
+
margin-right: -15px;
|
307 |
+
}
|
308 |
+
.clearfix:before,
|
309 |
+
.clearfix:after,
|
310 |
+
.form-horizontal .form-group:before,
|
311 |
+
.form-horizontal .form-group:after {
|
312 |
+
content: " ";
|
313 |
+
display: table;
|
314 |
+
}
|
315 |
+
.clearfix:after,
|
316 |
+
.form-horizontal .form-group:after {
|
317 |
+
clear: both;
|
318 |
+
}
|
319 |
+
.center-block {
|
320 |
+
display: block;
|
321 |
+
margin-left: auto;
|
322 |
+
margin-right: auto;
|
323 |
+
}
|
324 |
+
#skinOptions .wp-picker-container, #skinOptions .wp-picker-container:active {
|
325 |
+
display:block;
|
326 |
+
}
|
327 |
+
#skinOptions .wp-picker-container input[type="text"].wp-color-picker {
|
328 |
+
float: left;
|
329 |
+
height: 25px;
|
330 |
+
}
|
331 |
|
332 |
/* SETTINGS FOR Overview Gallery */
|
333 |
.flag-wrap {margin:20px 20px 0 2px}
|
451 |
.fixed .column-views {
|
452 |
width: 4em; text-align: center;
|
453 |
}
|
454 |
+
.flag-table tr > * {
|
455 |
+
border-bottom:1px solid #ddd;
|
456 |
+
}
|
457 |
.flag-table td,
|
458 |
.flag-table th {padding:4px 7px; text-align:left;}
|
459 |
+
.flag-table th {font-weight:bold; padding:6px 7px; vertical-align:top;}
|
460 |
.flag-table th p {margin:0;}
|
461 |
|
462 |
#flag-listmusic tbody td { height: 50px; }
|
477 |
.flag-ajax-post { cursor: pointer; text-decoration: underline; }
|
478 |
.flag-ajax-post:hover { color: #ff0000; }
|
479 |
|
480 |
+
.all_galleries { float: left; white-space: nowrap; margin: 0 0 0px 50px; max-height: 550px; overflow: auto; padding-right: 20px; min-width:30%; }
|
481 |
.all_galleries .acat { border: 1px solid #cccccc; padding: 3px 6px; margin: 3px 0; background: #fefefe; cursor: move; min-width:15%; }
|
482 |
.all_galleries .acat .drop { display: none; }
|
483 |
.all_galleries .acat:hover { background-color: #FFFFEE; }
|
585 |
#gmUpload { padding-top:10px }
|
586 |
#gmUpload table td { font-size: 11px !important; }
|
587 |
|
588 |
+
.already-added {background-color:#DDFFBB;}
|
589 |
+
|
590 |
+
a.button.button-primary.button-red {
|
591 |
+
background: red;
|
592 |
+
border-color: darkred;
|
593 |
+
text-shadow: 0 -1px 1px darkred, 1px 0 1px darkred, 0 1px 1px darkred, -1px 0 1px darkred;
|
594 |
+
}
|
595 |
+
|
596 |
+
a.button.button-primary.button-red:hover {
|
597 |
+
background: orangered;
|
598 |
+
border-color: darkred;
|
599 |
+
}
|
admin/css/flagallery.css
DELETED
@@ -1,9 +0,0 @@
|
|
1 |
-
/*
|
2 |
-
** Flash Album Gallery StyleSheet
|
3 |
-
*/
|
4 |
-
.flashalbum { overflow:hidden; position:relative;}
|
5 |
-
body div.flashalbum object { margin: 0 !important; }
|
6 |
-
.grandmusic, .grandvideo, .grandflv, .grandmp3, .grandbanner, .grandrotator { overflow:hidden; position:relative; }
|
7 |
-
body.FlAG { margin: 0; padding: 0; font-size: 0; line-height: 0; }
|
8 |
-
body.FlAG .FlAGd * { margin-top: 0 !important; margin-bottom: 0 !important; padding-top: 0 !important; padding-bottom: 0 !important; font-size: 0 !important; line-height: 0 !important; height: 0 !important; border-style: none !important; }
|
9 |
-
body.FlAG .FlAGd img { display: none !important; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/css/flagallery_nocrawler.css
DELETED
@@ -1,12 +0,0 @@
|
|
1 |
-
/*
|
2 |
-
** Flash Album Gallery StyleSheet (if is not crawler)
|
3 |
-
*/
|
4 |
-
.flag_alternate { display: none; }
|
5 |
-
.flag_alternate .flagcatlinks { padding: 3px; margin:0 0 3px; background-color: #292929; text-align: left; }
|
6 |
-
.flag_alternate .flagcatlinks a.flagcat { display: inline-block; padding: 4px 10px; margin: 2px; border: none; font: 14px/16px Tahoma; text-decoration: none; background: none; color: #ffffff; background-color: #292929; }
|
7 |
-
.flag_alternate .flagcatlinks a.flagcat:hover { text-decoration: none; background: none; }
|
8 |
-
.flag_alternate .flagcatlinks a.active, .flag_alternate .flagcatlinks a.flagcat:hover { color: #ffffff; background-color: #737373; outline: none; }
|
9 |
-
.flag_alternate .flagcatlinks a.flagcat:first-child { }
|
10 |
-
.flag_alternate .flagcategory { display: none; font-size: 0; line-height: 0; }
|
11 |
-
.flagcatlinks a.backlink { display: inline-block; padding: 4px 10px; margin: 2px text-decoration: none; outline: none; font-size: 12px; font-family: Verdana; font-weight: bold; line-height: 16px; }
|
12 |
-
.flagcatlinks a.backlink:hover { text-decoration: underline; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/css/flagallery_noflash.css
DELETED
@@ -1,26 +0,0 @@
|
|
1 |
-
/*
|
2 |
-
** Flash Album Gallery StyleSheet (no flash)
|
3 |
-
*/
|
4 |
-
.flashalbum {
|
5 |
-
-webkit-user-select: none;
|
6 |
-
-khtml-user-select: none;
|
7 |
-
-moz-user-select: -moz-none;
|
8 |
-
-ms-user-select: none;
|
9 |
-
-o-user-select: none;
|
10 |
-
user-select: none;
|
11 |
-
}
|
12 |
-
div.flashalbum br { display: none; }
|
13 |
-
.flag_alternate { margin: 7px 0; }
|
14 |
-
.flag_alternate .flagcategory { width: 100%; height: auto; position: relative; text-align: center; padding-bottom: 4px; }
|
15 |
-
.flag_alternate .flagcategory a.flag_pic_alt { display: inline-block; margin: 1px 0 0 1px; padding: 0; height: 120px; width: 120px; line-height: 96px; position:relative; overflow: hidden; text-align: center; cursor:pointer; background-color: #ffffff; border: 2px solid #ffffff; text-decoration: none; background-image: url(../images/loadingAnimation.gif); background-repeat: no-repeat; background-position: 50% 50%; font-size: 8px; color: #ffffff; }
|
16 |
-
.flag_alternate .flagcategory a.flag_pic_alt > .flag_pic_desc { display: none; padding: 4px; line-height: 140%; font-size: 12px; }
|
17 |
-
.flag_alternate .flagcategory a.flag_pic_alt > .flag_pic_desc * { display: none; line-height: 140%; font-size: 12px !important; }
|
18 |
-
.flag_alternate .flagcategory a.flag_pic_alt:hover { background-color: #ffffff; border: 2px solid #4a4a4a; color: #4a4a4a; text-decoration: none; z-index: 3; }
|
19 |
-
.flag_alternate .flagcategory a.flag_pic_alt.current, .flag_alternate .flagcategory a.flag_pic_alt.last { border-color: #4a4a4a; }
|
20 |
-
.flag_alternate .flagcategory a.flag_pic_alt > img { opacity: 1; vertical-align: middle; display:inline-block; position: static; margin: 0 auto; padding: 0; border: none; height: 120px; width: 120px; min-height: 120px !important; min-width: 120px !important; max-height: 150px; max-width: 150px; line-height: 96px; font-size: 0; }
|
21 |
-
div.flashalbum .flag_alternate .flagcategory a.flag_pic_alt > img { opacity: 1; }
|
22 |
-
.flag_alternate .flagcategory a.flag_pic_alt .flag_pic_counters { position: absolute; left: 0; bottom: 0; right: 0; height: 20px; display: block; line-height: 20px; margin: 0; padding: 0 10px; text-align: left; opacity: 0.85; filter: "alpha(opacity=85)"; }
|
23 |
-
.flag_alternate .flagcategory .flag_pic_counters i { display: inline-block; line-height: 20px; margin: 0; padding: 0 0 0 16px; background: url(../images/views.png) 0 50% no-repeat; font-style: normal; font-size: 12px; float: left; }
|
24 |
-
.flag_alternate .flagcategory .flag_pic_counters b { display: inline-block; line-height: 20px; margin: 0; padding: 0 0 0 16px; background: url(../images/like.png) 0 50% no-repeat; font-weight: normal; font-size: 12px; float: right; width: 25%; }
|
25 |
-
|
26 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/css/tabs.css
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
border-style:solid;
|
4 |
border-width:1px;
|
5 |
padding:2px;
|
6 |
-
|
7 |
|
8 |
-moz-border-radius-topright: 6px;
|
9 |
-khtml-border-top-right-radius: 6px;
|
@@ -18,7 +18,6 @@
|
|
18 |
display: none;
|
19 |
padding:0 15px;
|
20 |
}
|
21 |
-
.cptab h2 {margin-top:-65px; margin-bottom:45px;}
|
22 |
|
23 |
#tabs{
|
24 |
display: block;
|
@@ -115,6 +114,11 @@
|
|
115 |
cursor: pointer;
|
116 |
}
|
117 |
|
|
|
|
|
|
|
|
|
|
|
118 |
|
119 |
/* Additional IE specific bug fixes... */
|
120 |
* html .tabs { /* auto clear, @ IE 6 & IE 7 Quirks Mode */
|
3 |
border-style:solid;
|
4 |
border-width:1px;
|
5 |
padding:2px;
|
6 |
+
overflow:hidden;
|
7 |
|
8 |
-moz-border-radius-topright: 6px;
|
9 |
-khtml-border-top-right-radius: 6px;
|
18 |
display: none;
|
19 |
padding:0 15px;
|
20 |
}
|
|
|
21 |
|
22 |
#tabs{
|
23 |
display: block;
|
114 |
cursor: pointer;
|
115 |
}
|
116 |
|
117 |
+
#skinoptions {
|
118 |
+
max-height: 85vh;
|
119 |
+
overflow:auto;
|
120 |
+
float:left;
|
121 |
+
}
|
122 |
|
123 |
/* Additional IE specific bug fixes... */
|
124 |
* html .tabs { /* auto clear, @ IE 6 & IE 7 Quirks Mode */
|
admin/db_skin_color_scheme.php
DELETED
@@ -1,154 +0,0 @@
|
|
1 |
-
<?php function flag_skin_options() {
|
2 |
-
$flag_options = get_option( 'flag_options' );
|
3 |
-
$flashBacktransparent = $flag_options['flashBacktransparent'];
|
4 |
-
$flashBackcolor = str_replace( '#', '', $flag_options['flashBackcolor'] );
|
5 |
-
$buttonsBG = str_replace( '#', '', $flag_options['buttonsBG'] );
|
6 |
-
$buttonsMouseOver = str_replace( '#', '', $flag_options['buttonsMouseOver'] );
|
7 |
-
$buttonsMouseOut = str_replace( '#', '', $flag_options['buttonsMouseOut'] );
|
8 |
-
$catButtonsMouseOver = str_replace( '#', '', $flag_options['catButtonsMouseOver'] );
|
9 |
-
$catButtonsMouseOut = str_replace( '#', '', $flag_options['catButtonsMouseOut'] );
|
10 |
-
$catButtonsTextMouseOver = str_replace( '#', '', $flag_options['catButtonsTextMouseOver'] );
|
11 |
-
$catButtonsTextMouseOut = str_replace( '#', '', $flag_options['catButtonsTextMouseOut'] );
|
12 |
-
$thumbMouseOver = str_replace( '#', '', $flag_options['thumbMouseOver'] );
|
13 |
-
$thumbMouseOut = str_replace( '#', '', $flag_options['thumbMouseOut'] );
|
14 |
-
$mainTitle = str_replace( '#', '', $flag_options['mainTitle'] );
|
15 |
-
$categoryTitle = str_replace( '#', '', $flag_options['categoryTitle'] );
|
16 |
-
$itemBG = str_replace( '#', '', $flag_options['itemBG'] );
|
17 |
-
$itemTitle = str_replace( '#', '', $flag_options['itemTitle'] );
|
18 |
-
$itemDescription = str_replace( '#', '', $flag_options['itemDescription'] );
|
19 |
-
?>
|
20 |
-
<script type="text/javascript">
|
21 |
-
jQuery(document).ready(function(){
|
22 |
-
jQuery('#colors .colorPick').each(function(){
|
23 |
-
var inpID = jQuery(this).attr('name');
|
24 |
-
jQuery('#cp_' + inpID).farbtastic('#' + inpID);
|
25 |
-
jQuery('#' + inpID).focus(function(){
|
26 |
-
jQuery('#cp_' + inpID).show();
|
27 |
-
});
|
28 |
-
jQuery('#' + inpID).blur(function(){
|
29 |
-
jQuery('#cp_' + inpID).hide();
|
30 |
-
});
|
31 |
-
});
|
32 |
-
function tChecked(){
|
33 |
-
if(jQuery('#flashBacktransparent').attr('checked')){
|
34 |
-
var dclone = jQuery('#flashBackcolor').clone();
|
35 |
-
jQuery('#flashBackcolor').hide();
|
36 |
-
dclone.removeAttr('style').removeAttr('id').removeAttr('name').addClass('flashBackcolor').attr('disabled', 'disabled').insertAfter('#flashBackcolor');
|
37 |
-
} else{
|
38 |
-
jQuery('.flashBackcolor').remove();
|
39 |
-
jQuery('#flashBackcolor').show();
|
40 |
-
}
|
41 |
-
}
|
42 |
-
|
43 |
-
tChecked();
|
44 |
-
jQuery("#flashBacktransparent").click(tChecked);
|
45 |
-
});
|
46 |
-
</script>
|
47 |
-
<form method="POST">
|
48 |
-
<div>
|
49 |
-
<?php wp_nonce_field( 'flag_settings' ); ?>
|
50 |
-
<input type="hidden" name="page_options" value="flashBackcolor,buttonsBG,flashBacktransparent,buttonsMouseOver,buttonsMouseOut,catButtonsMouseOver,catButtonsMouseOut,catButtonsTextMouseOver,catButtonsTextMouseOut,thumbMouseOver,thumbMouseOut,mainTitle,categoryTitle,itemBG,itemTitle,itemDescription"/>
|
51 |
-
|
52 |
-
<!-- Color settings -->
|
53 |
-
<h3><?php _e( 'Color Settings', 'flag' ); ?></h3>
|
54 |
-
<table id="colors" class="form-table flag-options">
|
55 |
-
<tr>
|
56 |
-
<th style="width: 30%;"><?php _e( 'Background Color', 'flag' ); ?>:</th>
|
57 |
-
<td><input class="colorPick" type="text" size="7" maxlength="6" id="flashBackcolor" name="flashBackcolor" value="<?php echo $flashBackcolor ?>"/>
|
58 |
-
|
59 |
-
<div id="cp_flashBackcolor" style="background:#F9F9F9;position:absolute;display:none;"></div>
|
60 |
-
<label><input type="checkbox" id="flashBacktransparent" name="flashBacktransparent" value="transparent" <?php checked( 'transparent', $flashBacktransparent ); ?> /> transparent</label></td>
|
61 |
-
</tr>
|
62 |
-
<tr>
|
63 |
-
<th><?php _e( 'Buttons Background Color', 'flag' ); ?>:</th>
|
64 |
-
<td><input class="colorPick" type="text" size="7" maxlength="6" id="buttonsBG" name="buttonsBG" value="<?php echo $buttonsBG; ?>"/>
|
65 |
-
|
66 |
-
<div id="cp_buttonsBG" style="background:#F9F9F9;position:absolute;display:none;"></div>
|
67 |
-
</td>
|
68 |
-
</tr>
|
69 |
-
<tr>
|
70 |
-
<th><?php _e( 'Buttons Text Color', 'flag' ); ?>:</th>
|
71 |
-
<td>
|
72 |
-
<input class="colorPick" type="text" size="7" maxlength="6" id="buttonsMouseOver" name="buttonsMouseOver" value="<?php echo $buttonsMouseOver; ?>"/> mouseOver<br/>
|
73 |
-
|
74 |
-
<div id="cp_buttonsMouseOver" style="background:#F9F9F9;position:absolute;display:none;"></div>
|
75 |
-
<input class="colorPick" type="text" size="7" maxlength="6" id="buttonsMouseOut" name="buttonsMouseOut" value="<?php echo $buttonsMouseOut; ?>"/> mouseOut<br/>
|
76 |
-
|
77 |
-
<div id="cp_buttonsMouseOut" style="background:#F9F9F9;position:absolute;display:none;"></div>
|
78 |
-
</td>
|
79 |
-
</tr>
|
80 |
-
<tr>
|
81 |
-
<th><?php _e( 'Category Buttons Color', 'flag' ); ?>:</th>
|
82 |
-
<td>
|
83 |
-
<input class="colorPick" type="text" size="7" maxlength="6" id="catButtonsMouseOver" name="catButtonsMouseOver" value="<?php echo $catButtonsMouseOver; ?>"/> mouseOver<br/>
|
84 |
-
|
85 |
-
<div id="cp_catButtonsMouseOver" style="background:#F9F9F9;position:absolute;display:none;"></div>
|
86 |
-
<input class="colorPick" type="text" size="7" maxlength="6" id="catButtonsMouseOut" name="catButtonsMouseOut" value="<?php echo $catButtonsMouseOut; ?>"/> mouseOut<br/>
|
87 |
-
|
88 |
-
<div id="cp_catButtonsMouseOut" style="background:#F9F9F9;position:absolute;display:none;"></div>
|
89 |
-
</td>
|
90 |
-
</tr>
|
91 |
-
<tr>
|
92 |
-
<th><?php _e( 'Category Buttons Text Color', 'flag' ); ?>:</th>
|
93 |
-
<td>
|
94 |
-
<input class="colorPick" type="text" size="7" maxlength="6" id="catButtonsTextMouseOver" name="catButtonsTextMouseOver" value="<?php echo $catButtonsTextMouseOver; ?>"/> mouseOver<br/>
|
95 |
-
|
96 |
-
<div id="cp_catButtonsTextMouseOver" style="background:#F9F9F9;position:absolute;display:none;"></div>
|
97 |
-
<input class="colorPick" type="text" size="7" maxlength="6" id="catButtonsTextMouseOut" name="catButtonsTextMouseOut" value="<?php echo $catButtonsTextMouseOut; ?>"/> mouseOut<br/>
|
98 |
-
|
99 |
-
<div id="cp_catButtonsTextMouseOut" style="background:#F9F9F9;position:absolute;display:none;"></div>
|
100 |
-
</td>
|
101 |
-
</tr>
|
102 |
-
<tr>
|
103 |
-
<th><?php _e( 'Thumbs Rollover Color', 'flag' ); ?>:</th>
|
104 |
-
<td>
|
105 |
-
<input class="colorPick" type="text" size="7" maxlength="6" id="thumbMouseOver" name="thumbMouseOver" value="<?php echo $thumbMouseOver; ?>"/> mouseOver<br/>
|
106 |
-
|
107 |
-
<div id="cp_thumbMouseOver" style="background:#F9F9F9;position:absolute;display:none;"></div>
|
108 |
-
<input class="colorPick" type="text" size="7" maxlength="6" id="thumbMouseOut" name="thumbMouseOut" value="<?php echo $thumbMouseOut; ?>"/> mouseOut<br/>
|
109 |
-
|
110 |
-
<div id="cp_thumbMouseOut" style="background:#F9F9F9;position:absolute;display:none;"></div>
|
111 |
-
</td>
|
112 |
-
</tr>
|
113 |
-
<tr>
|
114 |
-
<th><?php _e( 'Main Title', 'flag' ); ?>:</th>
|
115 |
-
<td><input class="colorPick" type="text" size="7" maxlength="6" id="mainTitle" name="mainTitle" value="<?php echo $mainTitle; ?>"/>
|
116 |
-
|
117 |
-
<div id="cp_mainTitle" style="background:#F9F9F9;position:absolute;display:none;"></div>
|
118 |
-
</td>
|
119 |
-
</tr>
|
120 |
-
<tr>
|
121 |
-
<th><?php _e( 'Category Title', 'flag' ); ?>:</th>
|
122 |
-
<td><input class="colorPick" type="text" size="7" maxlength="6" id="categoryTitle" name="categoryTitle" value="<?php echo $categoryTitle; ?>"/>
|
123 |
-
|
124 |
-
<div id="cp_categoryTitle" style="background:#F9F9F9;position:absolute;display:none;"></div>
|
125 |
-
</td>
|
126 |
-
</tr>
|
127 |
-
<tr>
|
128 |
-
<th><?php _e( 'Item Background', 'flag' ); ?>:</th>
|
129 |
-
<td><input class="colorPick" type="text" size="7" maxlength="6" id="itemBG" name="itemBG" value="<?php echo $itemBG; ?>"/>
|
130 |
-
|
131 |
-
<div id="cp_itemBG" style="background:#F9F9F9;position:absolute;display:none;"></div>
|
132 |
-
</td>
|
133 |
-
</tr>
|
134 |
-
<tr>
|
135 |
-
<th><?php _e( 'Item Title', 'flag' ); ?>:</th>
|
136 |
-
<td><input class="colorPick" type="text" size="7" maxlength="6" id="itemTitle" name="itemTitle" value="<?php echo $itemTitle; ?>"/>
|
137 |
-
|
138 |
-
<div id="cp_itemTitle" style="background:#F9F9F9;position:absolute;display:none;"></div>
|
139 |
-
</td>
|
140 |
-
</tr>
|
141 |
-
<tr>
|
142 |
-
<th><?php _e( 'Item Description', 'flag' ); ?>:</th>
|
143 |
-
<td><input class="colorPick" type="text" size="7" maxlength="6" id="itemDescription" name="itemDescription" value="<?php echo $itemDescription; ?>"/>
|
144 |
-
|
145 |
-
<div id="cp_itemDescription" style="background:#F9F9F9;position:absolute;display:none;"></div>
|
146 |
-
</td>
|
147 |
-
</tr>
|
148 |
-
</table>
|
149 |
-
|
150 |
-
<div class="clear"> </div>
|
151 |
-
<div class="submit"><input class="button-primary" type="submit" name="updateoption" value="<?php _e( 'Save Changes', 'flag' ); ?>"/></div>
|
152 |
-
</div>
|
153 |
-
</form>
|
154 |
-
<?php }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/flag_install.php
CHANGED
@@ -1,45 +1,50 @@
|
|
1 |
<?php
|
2 |
// Stop direct call
|
3 |
-
if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF']))
|
|
|
|
|
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 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
|
|
|
|
|
|
43 |
pid BIGINT(20) NOT NULL AUTO_INCREMENT ,
|
44 |
galleryid BIGINT(20) DEFAULT '0' NOT NULL ,
|
45 |
filename VARCHAR(255) NOT NULL ,
|
@@ -64,14 +69,14 @@ function flag_install () {
|
|
64 |
meta_data LONGTEXT,
|
65 |
PRIMARY KEY pid (pid)
|
66 |
) $charset_collate;";
|
67 |
-
|
68 |
-
|
69 |
}
|
70 |
|
71 |
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
gid BIGINT(20) NOT NULL AUTO_INCREMENT ,
|
76 |
name VARCHAR(255) NOT NULL ,
|
77 |
path MEDIUMTEXT NULL ,
|
@@ -83,12 +88,12 @@ function flag_install () {
|
|
83 |
status TINYINT NULL DEFAULT '0' ,
|
84 |
PRIMARY KEY gid (gid)
|
85 |
) $charset_collate;";
|
86 |
-
|
87 |
-
|
88 |
}
|
89 |
|
90 |
-
|
91 |
-
|
92 |
cid int(11) unsigned NOT NULL auto_increment,
|
93 |
ownerid int(11) unsigned NOT NULL default '0',
|
94 |
name varchar(255) NOT NULL default '',
|
@@ -100,13 +105,13 @@ function flag_install () {
|
|
100 |
PRIMARY KEY (cid),
|
101 |
KEY ownerid (ownerid)
|
102 |
) $charset_collate;";
|
103 |
-
|
104 |
-
dbDelta($sql);
|
105 |
-
}
|
106 |
|
107 |
-
|
108 |
-
|
109 |
-
|
|
|
|
|
|
|
110 |
id BIGINT(20) NOT NULL AUTO_INCREMENT ,
|
111 |
name VARCHAR(255) NOT NULL ,
|
112 |
previewpic BIGINT(20) DEFAULT '0' NOT NULL ,
|
@@ -114,228 +119,201 @@ function flag_install () {
|
|
114 |
categories LONGTEXT NOT NULL,
|
115 |
PRIMARY KEY id (id)
|
116 |
) $charset_collate;";
|
117 |
-
|
118 |
-
|
119 |
}
|
120 |
|
121 |
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
|
|
|
|
|
|
140 |
}
|
141 |
|
142 |
-
function flag_capabilities()
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
|
|
167 |
|
168 |
}
|
169 |
|
170 |
/**
|
171 |
* Setup the default option array for the gallery
|
172 |
-
*
|
173 |
* @access internal
|
174 |
* @return void
|
175 |
*/
|
176 |
-
function flag_default_options()
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
|
195 |
}
|
196 |
|
197 |
-
function flag_list_options()
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
$flag_options['catButtonsMouseOut'] = '000000';
|
243 |
-
$flag_options['catButtonsTextMouseOver']= '7485c2';
|
244 |
-
$flag_options['catButtonsTextMouseOut'] = 'bcbcbc';
|
245 |
-
$flag_options['thumbMouseOver'] = '7485c2';
|
246 |
-
$flag_options['thumbMouseOut'] = '000000';
|
247 |
-
$flag_options['mainTitle'] = 'ffffff';
|
248 |
-
$flag_options['categoryTitle'] = '7485c2';
|
249 |
-
$flag_options['itemBG'] = 'eae6ef';
|
250 |
-
$flag_options['itemTitle'] = '7485c2';
|
251 |
-
$flag_options['itemDescription'] = 'e0e0e0';
|
252 |
-
|
253 |
-
// Alternative gallery colors
|
254 |
-
$flag_options['jAlterGal'] = true;
|
255 |
-
$flag_options['jAlterGalScript'] = 1; // If '0' - use FancyBox script
|
256 |
-
$flag_options['disableViews'] = 0;
|
257 |
-
$flag_options['BarsBG'] = '292929';
|
258 |
-
$flag_options['CatBGColor'] = '292929';
|
259 |
-
$flag_options['CatBGColorOver'] = '737373';
|
260 |
-
$flag_options['CatColor'] = 'ffffff';
|
261 |
-
$flag_options['CatColorOver'] = 'ffffff';
|
262 |
-
$flag_options['ThumbBG'] = 'ffffff';
|
263 |
-
$flag_options['ThumbLoaderColor'] = '4a4a4a';
|
264 |
-
$flag_options['TitleColor'] = 'ff9900';
|
265 |
-
$flag_options['DescrColor'] = 'cfcfcf';
|
266 |
-
|
267 |
-
// Single player colors
|
268 |
-
$flag_options['videoBG'] = '000000';
|
269 |
-
$flag_options['vmColor1'] = 'ffffff';
|
270 |
-
$flag_options['vmColor2'] = '3283A7';
|
271 |
-
$flag_options['vmAutoplay'] = 'true';
|
272 |
-
$flag_options['vmWidth'] = '520';
|
273 |
-
$flag_options['vmHeight'] = '304';
|
274 |
-
|
275 |
-
$flag_options['mpBG'] = '4f4f4f';
|
276 |
-
$flag_options['mpColor1'] = 'ffffff';
|
277 |
-
$flag_options['mpColor2'] = '3283A7';
|
278 |
-
$flag_options['mpAutoplay'] = 'false';
|
279 |
-
|
280 |
-
$flag_options['advanced'] = false; // Advanced options
|
281 |
-
|
282 |
-
return $flag_options;
|
283 |
}
|
284 |
|
285 |
/**
|
286 |
* Deregister a capability from all classic roles
|
287 |
-
*
|
288 |
* @access internal
|
|
|
289 |
* @param string $capability name of the capability which should be deregister
|
|
|
290 |
* @return void
|
291 |
*/
|
292 |
function flag_remove_capability($capability){
|
293 |
-
|
294 |
-
|
295 |
|
296 |
-
|
297 |
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
|
302 |
}
|
303 |
|
304 |
/**
|
305 |
* Uninstall all settings and tables
|
306 |
* Called via Setup and register_unstall hook
|
307 |
-
*
|
308 |
* @access internal
|
309 |
* @return void
|
310 |
*/
|
311 |
-
function flag_uninstall()
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
341 |
}
|
1 |
<?php
|
2 |
// Stop direct call
|
3 |
+
if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])){
|
4 |
+
die('You are not allowed to call this page directly.');
|
5 |
+
}
|
6 |
|
7 |
/**
|
8 |
* creates all tables for the gallery
|
9 |
* called during register_activation hook
|
10 |
+
*
|
11 |
* @access internal
|
12 |
* @return void
|
13 |
+
**/
|
14 |
+
|
15 |
+
function flag_install(){
|
16 |
+
global $wpdb, $wp_version;
|
17 |
+
|
18 |
+
// Check for capability
|
19 |
+
if( !current_user_can('activate_plugins')){
|
20 |
+
return;
|
21 |
+
}
|
22 |
+
|
23 |
+
flag_capabilities();
|
24 |
+
|
25 |
+
// upgrade function changed in WordPress 2.3
|
26 |
+
require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
|
27 |
+
|
28 |
+
// add charset & collate like wp core
|
29 |
+
$charset_collate = '';
|
30 |
+
|
31 |
+
if($wpdb->has_cap('collation')){
|
32 |
+
if( !empty($wpdb->charset)){
|
33 |
+
$charset_collate = "DEFAULT CHARACTER SET $wpdb->charset";
|
34 |
+
}
|
35 |
+
if( !empty($wpdb->collate)){
|
36 |
+
$charset_collate .= " COLLATE $wpdb->collate";
|
37 |
+
}
|
38 |
+
}
|
39 |
+
|
40 |
+
$flagpictures = $wpdb->prefix . 'flag_pictures';
|
41 |
+
$flaggallery = $wpdb->prefix . 'flag_gallery';
|
42 |
+
$flagcomments = $wpdb->prefix . 'flag_comments';
|
43 |
+
$flagalbum = $wpdb->prefix . 'flag_album';
|
44 |
+
|
45 |
+
if($wpdb->get_var("show tables like '$flagpictures'") != $flagpictures){
|
46 |
+
|
47 |
+
$sql = "CREATE TABLE " . $flagpictures . " (
|
48 |
pid BIGINT(20) NOT NULL AUTO_INCREMENT ,
|
49 |
galleryid BIGINT(20) DEFAULT '0' NOT NULL ,
|
50 |
filename VARCHAR(255) NOT NULL ,
|
69 |
meta_data LONGTEXT,
|
70 |
PRIMARY KEY pid (pid)
|
71 |
) $charset_collate;";
|
72 |
+
|
73 |
+
dbDelta($sql);
|
74 |
}
|
75 |
|
76 |
|
77 |
+
if($wpdb->get_var("show tables like '$flaggallery'") != $flaggallery){
|
78 |
+
|
79 |
+
$sql = "CREATE TABLE " . $flaggallery . " (
|
80 |
gid BIGINT(20) NOT NULL AUTO_INCREMENT ,
|
81 |
name VARCHAR(255) NOT NULL ,
|
82 |
path MEDIUMTEXT NULL ,
|
88 |
status TINYINT NULL DEFAULT '0' ,
|
89 |
PRIMARY KEY gid (gid)
|
90 |
) $charset_collate;";
|
91 |
+
|
92 |
+
dbDelta($sql);
|
93 |
}
|
94 |
|
95 |
+
if($wpdb->get_var("show tables like '$flagcomments'") != $flagcomments){
|
96 |
+
$sql = "CREATE TABLE " . $flagcomments . " (
|
97 |
cid int(11) unsigned NOT NULL auto_increment,
|
98 |
ownerid int(11) unsigned NOT NULL default '0',
|
99 |
name varchar(255) NOT NULL default '',
|
105 |
PRIMARY KEY (cid),
|
106 |
KEY ownerid (ownerid)
|
107 |
) $charset_collate;";
|
|
|
|
|
|
|
108 |
|
109 |
+
dbDelta($sql);
|
110 |
+
}
|
111 |
+
|
112 |
+
if( !$wpdb->get_var("SHOW TABLES LIKE '$flagalbum'")){
|
113 |
+
|
114 |
+
$sql = "CREATE TABLE " . $flagalbum . " (
|
115 |
id BIGINT(20) NOT NULL AUTO_INCREMENT ,
|
116 |
name VARCHAR(255) NOT NULL ,
|
117 |
previewpic BIGINT(20) DEFAULT '0' NOT NULL ,
|
119 |
categories LONGTEXT NOT NULL,
|
120 |
PRIMARY KEY id (id)
|
121 |
) $charset_collate;";
|
122 |
+
|
123 |
+
dbDelta($sql);
|
124 |
}
|
125 |
|
126 |
|
127 |
+
// check one table again, to be sure
|
128 |
+
if( !$wpdb->get_var("SHOW TABLES LIKE '$flagpictures'")){
|
129 |
+
update_option("flag_init_check", __('FlaGallery : Tables could not created, please check your database settings', 'flash-album-gallery'));
|
130 |
+
|
131 |
+
return;
|
132 |
+
}
|
133 |
+
|
134 |
+
$options = get_option('flag_options');
|
135 |
+
// set the default settings, if we didn't upgrade
|
136 |
+
if(empty($options)){
|
137 |
+
flag_default_options();
|
138 |
+
}
|
139 |
+
|
140 |
+
|
141 |
+
delete_transient('flagallery_uninstalled');
|
142 |
+
// if all is passed , save the VERSIONs
|
143 |
+
add_option("flag_db_version", FLAG_DBVERSION);
|
144 |
+
add_option("flagVersion", FLAGVERSION);
|
145 |
+
|
146 |
+
include_once(dirname(__FILE__) . '/tuning.php');
|
147 |
+
flag_tune(false);
|
148 |
}
|
149 |
|
150 |
+
function flag_capabilities(){
|
151 |
+
global $wp_roles;
|
152 |
+
|
153 |
+
// Set the capabilities for the administrator
|
154 |
+
$role = get_role('administrator');
|
155 |
+
// We need this role, no other chance
|
156 |
+
if(empty($role)){
|
157 |
+
update_option("flag_init_check", __('Sorry, FlaGallery works only with a role called administrator', 'flash-album-gallery'));
|
158 |
+
|
159 |
+
return;
|
160 |
+
}
|
161 |
+
|
162 |
+
$role->add_cap('FlAG overview');
|
163 |
+
$role->add_cap('FlAG Use TinyMCE');
|
164 |
+
$role->add_cap('FlAG Upload images');
|
165 |
+
$role->add_cap('FlAG Import folder');
|
166 |
+
$role->add_cap('FlAG Manage gallery');
|
167 |
+
$role->add_cap('FlAG Manage others gallery');
|
168 |
+
$role->add_cap('FlAG Change skin');
|
169 |
+
$role->add_cap('FlAG Add skins');
|
170 |
+
$role->add_cap('FlAG Delete skins');
|
171 |
+
$role->add_cap('FlAG Change options');
|
172 |
+
$role->add_cap('FlAG Manage music');
|
173 |
+
$role->add_cap('FlAG Manage video');
|
174 |
+
$role->add_cap('FlAG Manage banners');
|
175 |
+
$role->add_cap('FlAG iFrame page');
|
176 |
|
177 |
}
|
178 |
|
179 |
/**
|
180 |
* Setup the default option array for the gallery
|
181 |
+
*
|
182 |
* @access internal
|
183 |
* @return void
|
184 |
*/
|
185 |
+
function flag_default_options(){
|
186 |
+
|
187 |
+
global $blog_id, $flag;
|
188 |
+
|
189 |
+
$flag_options = flag_list_options();
|
190 |
+
// special overrides for WPMU
|
191 |
+
if(IS_WPMU){
|
192 |
+
// get the site options
|
193 |
+
$flag_wpmu_options = get_site_option('flag_options');
|
194 |
+
// get the default value during installation
|
195 |
+
//if (!is_array($flag_wpmu_options)) {
|
196 |
+
//$flag_wpmu_options['galleryPath'] = 'wp-content/blogs.dir/%BLOG_ID%/files/';
|
197 |
+
update_site_option('flag_options', $flag_wpmu_options);
|
198 |
+
//}
|
199 |
+
//$flag_options['galleryPath'] = str_replace("%BLOG_ID%", $blog_id , $flag_wpmu_options['galleryPath']);
|
200 |
+
}
|
201 |
+
|
202 |
+
update_option('flag_options', $flag_options);
|
203 |
|
204 |
}
|
205 |
|
206 |
+
function flag_list_options(){
|
207 |
+
$wp_content = basename(WP_CONTENT_DIR);
|
208 |
+
$flag_options['galleryPath'] = $wp_content . '/flagallery/'; // set default path to the gallery
|
209 |
+
$flag_options['swfUpload'] = true; // activate the batch upload
|
210 |
+
$flag_options['deleteImg'] = true; // delete Images
|
211 |
+
$flag_options['deepLinks'] = true;
|
212 |
+
$flag_options['access_key'] = '';
|
213 |
+
$flag_options['license_key'] = '';
|
214 |
+
$flag_options['license_name'] = '';
|
215 |
+
$flag_options['useMediaRSS'] = false; // activate the global Media RSS file
|
216 |
+
|
217 |
+
$flag_options['gp_jscode'] = ''; // GRAND Pages: google analytics code
|
218 |
+
|
219 |
+
// Sort Settings
|
220 |
+
$flag_options['albSort'] = 'title'; // Galleries Sort order
|
221 |
+
$flag_options['albSortDir'] = 'ASC'; // Galleries Sort dir
|
222 |
+
$flag_options['albPerPage'] = '50'; // Galleries per page
|
223 |
+
$flag_options['galSort'] = 'sortorder'; // Images Sort order
|
224 |
+
$flag_options['galSortDir'] = 'ASC'; // Images Sort direction
|
225 |
+
|
226 |
+
// Flash settings
|
227 |
+
$flag_options['skinsDirABS'] = str_replace("\\", "/", WP_PLUGIN_DIR . '/flagallery-skins/');
|
228 |
+
$flag_options['skinsDirURL'] = WP_PLUGIN_URL . '/flagallery-skins/';
|
229 |
+
$flag_options['flashSkin'] = 'phantom';
|
230 |
+
$flag_options['flashWidth'] = '100%';
|
231 |
+
$flag_options['flashHeight'] = '500';
|
232 |
+
|
233 |
+
// Image Settings
|
234 |
+
$flag_options['imgWidth'] = 2200; // Image Width
|
235 |
+
$flag_options['imgHeight'] = 2200; // Image height
|
236 |
+
$flag_options['imgQuality'] = 87; // Image Quality
|
237 |
+
|
238 |
+
// Thumbnail Settings
|
239 |
+
$flag_options['thumbWidth'] = 400; // Thumb Width
|
240 |
+
$flag_options['thumbHeight'] = 400; // Thumb height
|
241 |
+
$flag_options['thumbQuality'] = 100; // Thumb Quality
|
242 |
+
|
243 |
+
$flag_options['mpAutoplay'] = 'false';
|
244 |
+
$flag_options['vmAutoplay'] = 'false';
|
245 |
+
$flag_options['vmWidth'] = '640';
|
246 |
+
$flag_options['vmHeight'] = '480';
|
247 |
+
|
248 |
+
$flag_options['advanced'] = false; // Advanced options
|
249 |
+
|
250 |
+
return $flag_options;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
251 |
}
|
252 |
|
253 |
/**
|
254 |
* Deregister a capability from all classic roles
|
255 |
+
*
|
256 |
* @access internal
|
257 |
+
*
|
258 |
* @param string $capability name of the capability which should be deregister
|
259 |
+
*
|
260 |
* @return void
|
261 |
*/
|
262 |
function flag_remove_capability($capability){
|
263 |
+
// this function remove the $capability only from the classic roles
|
264 |
+
$check_order = array("subscriber", "contributor", "author", "editor", "administrator");
|
265 |
|
266 |
+
foreach($check_order as $role){
|
267 |
|
268 |
+
$role = get_role($role);
|
269 |
+
$role->remove_cap($capability);
|
270 |
+
}
|
271 |
|
272 |
}
|
273 |
|
274 |
/**
|
275 |
* Uninstall all settings and tables
|
276 |
* Called via Setup and register_unstall hook
|
277 |
+
*
|
278 |
* @access internal
|
279 |
* @return void
|
280 |
*/
|
281 |
+
function flag_uninstall(){
|
282 |
+
global $wpdb;
|
283 |
+
|
284 |
+
// first remove all tables
|
285 |
+
$wpdb->query("DROP TABLE IF EXISTS {$wpdb->prefix}flag_pictures");
|
286 |
+
$wpdb->query("DROP TABLE IF EXISTS {$wpdb->prefix}flag_gallery");
|
287 |
+
$wpdb->query("DROP TABLE IF EXISTS {$wpdb->prefix}flag_comments");
|
288 |
+
$wpdb->query("DROP TABLE IF EXISTS {$wpdb->prefix}flag_album");
|
289 |
+
|
290 |
+
// then remove all options
|
291 |
+
delete_option('flag_options');
|
292 |
+
delete_option('flag_db_version');
|
293 |
+
delete_option('flagVersion');
|
294 |
+
delete_option('flag_plugin_error');
|
295 |
+
|
296 |
+
// now remove the capability
|
297 |
+
flag_remove_capability("FlAG overview");
|
298 |
+
flag_remove_capability("FlAG Use TinyMCE");
|
299 |
+
flag_remove_capability("FlAG Upload images");
|
300 |
+
flag_remove_capability("FlAG Import folder");
|
301 |
+
flag_remove_capability("FlAG Manage gallery");
|
302 |
+
flag_remove_capability('FlAG Manage others gallery');
|
303 |
+
flag_remove_capability("FlAG Change skin");
|
304 |
+
flag_remove_capability('FlAG Add skins');
|
305 |
+
flag_remove_capability('FlAG Delete skins');
|
306 |
+
flag_remove_capability("FlAG Change options");
|
307 |
+
flag_remove_capability("FlAG Manage music");
|
308 |
+
flag_remove_capability("FlAG Manage video");
|
309 |
+
flag_remove_capability("FlAG Manage banners");
|
310 |
+
flag_remove_capability("FlAG iFrame page");
|
311 |
+
|
312 |
+
if(is_plugin_active(FLAGFOLDER . '/flag.php')) {
|
313 |
+
// Deactivate plugin
|
314 |
+
deactivate_plugins(FLAGFOLDER . '/flag.php');
|
315 |
+
$plugins_url = admin_url('plugins.php');
|
316 |
+
wp_redirect($plugins_url);
|
317 |
+
exit();
|
318 |
+
}
|
319 |
}
|
admin/flagframe-tool.php
CHANGED
@@ -10,9 +10,9 @@ if ( !current_user_can('FlAG iFrame page') )
|
|
10 |
|
11 |
if(isset($_POST['copy_file'])) {
|
12 |
if(copy(FLAG_ABSPATH.'flagframe.php',ABSPATH.'flagframe.php')) {
|
13 |
-
flagGallery::show_message(__('Success','
|
14 |
} else {
|
15 |
-
flagGallery::show_error(__('Failure','
|
16 |
}
|
17 |
}
|
18 |
global $flag, $flagdb;
|
@@ -37,11 +37,9 @@ jQuery(document).ready(function() {
|
|
37 |
var galleries = '?i='+jQuery('#items_array').val().split(',').join('_');
|
38 |
var skin = jQuery('#skinname option:selected').val();
|
39 |
if(skin) skin = '&f='+skin; else skin = '';
|
40 |
-
var
|
41 |
-
|
42 |
-
|
43 |
-
if(l) l = '&l='+l; else l = '';
|
44 |
-
fb_url(galleries,skin,h,l);
|
45 |
jQuery('#galleries :checkbox').click(function(){
|
46 |
var cur, arr, del;
|
47 |
if(jQuery(this).is(':checked')){
|
@@ -68,9 +66,9 @@ jQuery(document).ready(function() {
|
|
68 |
}
|
69 |
galleries = '?i='+jQuery('#items_array').val().split(',').join('_');
|
70 |
skin = jQuery('#skinname option:selected').val(); if(skin) skin = '&f='+skin; else skin = '';
|
71 |
-
|
72 |
-
|
73 |
-
fb_url(galleries,skin,h
|
74 |
});
|
75 |
jQuery('#skinname').change(function(){
|
76 |
var skin = jQuery(this).val();
|
@@ -80,78 +78,73 @@ jQuery(document).ready(function() {
|
|
80 |
skin = '';
|
81 |
}
|
82 |
galleries = '?i='+jQuery('#items_array').val().split(',').join('_');
|
83 |
-
|
84 |
-
|
85 |
-
fb_url(galleries,skin,h
|
86 |
});
|
87 |
-
jQuery('#galleryheight').bind('keyup',function(){
|
88 |
-
var
|
89 |
-
|
90 |
-
h = '&h='+h;
|
91 |
-
} else {
|
92 |
-
h = '';
|
93 |
-
}
|
94 |
-
galleries = '?i='+jQuery('#items_array').val().split(',').join('_');
|
95 |
-
skin = jQuery('#skinname option:selected').val(); if(skin) skin = '&f='+skin; else skin = '';
|
96 |
-
l = parseInt(jQuery('#postid').val()); if(l) l = '&l='+l; else l = '';
|
97 |
-
fb_url(galleries,skin,h,l);
|
98 |
-
});
|
99 |
-
jQuery('#postid').bind('keyup',function(){
|
100 |
-
var l = parseInt(jQuery(this).val());
|
101 |
-
if(l) {
|
102 |
-
l = '&l='+l;
|
103 |
-
} else {
|
104 |
-
l = '';
|
105 |
-
}
|
106 |
galleries = '?i='+jQuery('#items_array').val().split(',').join('_');
|
107 |
skin = jQuery('#skinname option:selected').val(); if(skin) skin = '&f='+skin; else skin = '';
|
108 |
-
|
109 |
-
fb_url(galleries,skin,h,l);
|
110 |
});
|
111 |
-
jQuery('#m_playlist').change(function(){
|
112 |
-
var playlist = jQuery(
|
113 |
if(playlist) {
|
114 |
playlist = '?m='+playlist;
|
115 |
} else {
|
116 |
-
playlist = '
|
117 |
}
|
118 |
-
|
119 |
});
|
120 |
-
jQuery('#v_playlist').change(function(){
|
121 |
-
var playlist = jQuery(
|
122 |
if(playlist) {
|
123 |
playlist = '?v='+playlist;
|
124 |
} else {
|
125 |
-
playlist = '
|
126 |
}
|
127 |
-
|
128 |
});
|
129 |
-
jQuery('#b_playlist').change(function(){
|
130 |
-
var playlist = jQuery(
|
131 |
if(playlist) {
|
132 |
playlist = '?b='+playlist;
|
133 |
} else {
|
134 |
-
playlist = '
|
135 |
}
|
136 |
-
|
137 |
});
|
138 |
});
|
139 |
-
function fb_url(galleries,skin,h
|
140 |
-
jQuery('#fb1_url0').val(url+galleries+skin
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
141 |
}
|
142 |
/*]]>*/</script>
|
143 |
<div class="flag-wrap">
|
144 |
-
<h2><?php _e('Flagallery iFrame', '
|
145 |
<form id="flagframe_copy" name="flagframe_copy" method="POST" class="alignright">
|
146 |
-
<p>Optional: <input type="submit" name="copy_file" class="button-primary" value="<?php _e('Copy flagframe.php file to root directory', '
|
147 |
(makes iframe url shorter)</p>
|
148 |
</form>
|
149 |
-
<form id="generator1"><fieldset style="clear:both; margin:0 0 20px 0; padding: 20px; border: 1px solid #888888;"><legend style="font-size: 18px; padding: 0 5px;"><?php _e("Photo Gallery iFrame Generator", '
|
150 |
<table border="0" cellpadding="4" cellspacing="0">
|
151 |
<tr>
|
152 |
-
<td nowrap="nowrap" valign="top"><div><?php _e("Select galleries", '
|
153 |
<td valign="top"><div id="galleries" style="width: 214px; height: 160px; overflow: auto; white-space: nowrap;">
|
154 |
-
<div class="row"><input type="checkbox" value="all" checked="checked" /> <strong><span style="display:inline-block; width:3em;">*</span> - <?php _e("all galleries", '
|
155 |
<?php
|
156 |
$gallerylist = $flagdb->find_all_galleries($flag->options['albSort'], $flag->options['albSortDir']);
|
157 |
if(is_array($gallerylist)) {
|
@@ -164,13 +157,13 @@ function fb_url(galleries,skin,h,l) {
|
|
164 |
</div></td>
|
165 |
</tr>
|
166 |
<tr>
|
167 |
-
<td nowrap="nowrap" valign="top"><p style="padding-top:3px;"><?php _e("Galleries order", '
|
168 |
<td valign="top"><p><input readonly="readonly" type="text" id="items_array" value="all" style="width: 214px;" /></p></td>
|
169 |
</tr>
|
170 |
<tr>
|
171 |
-
<td nowrap="nowrap" valign="top"><p style="padding-top:3px;"><label for="skinname"><?php _e("Choose skin", '
|
172 |
<td valign="top"><p><select id="skinname" name="skinname" style="width: 214px;">
|
173 |
-
<option value="" selected="selected"><?php _e("skin active by default", '
|
174 |
<?php
|
175 |
foreach ( (array)$i_skins as $skin_file => $skin_data) {
|
176 |
echo '<option value="'.dirname($skin_file).'">'.$skin_data['Name'].'</option>'."\n";
|
@@ -179,25 +172,25 @@ function fb_url(galleries,skin,h,l) {
|
|
179 |
</select></p></td>
|
180 |
</tr>
|
181 |
<tr>
|
182 |
-
<td valign="top"><p style="padding-top:3px;"><?php _e("
|
183 |
-
<td valign="top"><p><?php _e("width", '
|
184 |
</tr>
|
185 |
-
<tr>
|
186 |
-
<td nowrap="nowrap" valign="top"><p style="padding-top:3px;"><?php _e("Post ID", 'flag'); ?>:<br /><span style="font-size:9px">(<?php _e("optional", 'flag'); ?>)</span></p></td>
|
187 |
-
<td valign="top"><p><input id="postid" type="text" /></p></td>
|
188 |
-
</tr>
|
189 |
<tr>
|
190 |
-
<td valign="top"><div style="padding-top:3px;"><strong><?php _e("iFrame Url", '
|
191 |
-
<td valign="top"><input id="fb1_url0" type="text" style="width: 780px; font-size: 10px;" value="<?php echo $fb_url.'?i=all'; ?>" /></td>
|
192 |
</tr>
|
|
|
|
|
|
|
|
|
193 |
</table>
|
194 |
</fieldset></form>
|
195 |
-
<form id="generator2"><fieldset style="padding: 20px; margin:0 0 20px 0; border: 1px solid #888888;"><legend style="font-size: 18px; padding: 0 5px;"><?php _e("mp3 Gallery iFrame Generator", '
|
196 |
<table border="0" cellpadding="4" cellspacing="0">
|
197 |
<tr>
|
198 |
-
<td nowrap="nowrap" valign="top"><p style="padding-top:3px;"><label><?php _e("Choose playlist", '
|
199 |
<td valign="top"><p><select id="m_playlist" style="width: 214px;">
|
200 |
-
<option value="" selected="selected"><?php _e('Choose playlist', '
|
201 |
<?php
|
202 |
foreach((array)$all_m_playlists as $playlist_file => $playlist_data) {
|
203 |
$playlist_name = basename($playlist_file, '.xml');
|
@@ -207,19 +200,27 @@ function fb_url(galleries,skin,h,l) {
|
|
207 |
}
|
208 |
?>
|
209 |
</select></p></td>
|
|
|
|
|
|
|
|
|
210 |
</tr>
|
211 |
<tr>
|
212 |
-
<td valign="top"><div style="padding-top:3px;"><strong><?php _e("iFrame Url", '
|
213 |
-
<td valign="top"><input id="fb2_url0" type="text" style="width: 600px; font-size: 10px;" value="<?php echo $fb_url.'?m='; ?>" /></td>
|
214 |
</tr>
|
|
|
|
|
|
|
|
|
215 |
</table>
|
216 |
</fieldset></form>
|
217 |
-
<form id="generator3"><fieldset style="padding: 20px; margin:0 0 20px 0; border: 1px solid #888888;"><legend style="font-size: 18px; padding: 0 5px;"><?php _e("Video Blog Gallery iFrame Generator", '
|
218 |
<table border="0" cellpadding="4" cellspacing="0">
|
219 |
<tr>
|
220 |
-
<td nowrap="nowrap" valign="top"><p style="padding-top:3px;"><label><?php _e("Choose playlist", '
|
221 |
<td valign="top"><p><select id="v_playlist" style="width: 214px;">
|
222 |
-
<option value="" selected="selected"><?php _e('Choose playlist', '
|
223 |
<?php
|
224 |
foreach((array)$all_v_playlists as $playlist_file => $playlist_data) {
|
225 |
$playlist_name = basename($playlist_file, '.xml');
|
@@ -229,19 +230,27 @@ function fb_url(galleries,skin,h,l) {
|
|
229 |
}
|
230 |
?>
|
231 |
</select></p></td>
|
|
|
|
|
|
|
|
|
232 |
</tr>
|
233 |
<tr>
|
234 |
-
<td valign="top"><div style="padding-top:3px;"><strong><?php _e("iFrame Url", '
|
235 |
-
<td valign="top"><input id="fb3_url0" type="text" style="width: 600px; font-size: 10px;" value="<?php echo $fb_url.'?v='; ?>" /></td>
|
|
|
|
|
|
|
|
|
236 |
</tr>
|
237 |
</table>
|
238 |
</fieldset></form>
|
239 |
-
<form id="generator4"><fieldset style="padding: 20px; margin:0 0 20px 0; border: 1px solid #888888;"><legend style="font-size: 18px; padding: 0 5px;"><?php _e("Banner Box iFrame Generator", '
|
240 |
<table border="0" cellpadding="4" cellspacing="0">
|
241 |
<tr>
|
242 |
-
<td nowrap="nowrap" valign="top"><p style="padding-top:3px;"><label><?php _e("Choose xml", '
|
243 |
<td valign="top"><p><select id="b_playlist" style="width: 214px;">
|
244 |
-
<option value="" selected="selected"><?php _e('Choose XML', '
|
245 |
<?php
|
246 |
foreach((array)$all_b_playlists as $playlist_file => $playlist_data) {
|
247 |
$playlist_name = basename($playlist_file, '.xml');
|
@@ -251,11 +260,19 @@ function fb_url(galleries,skin,h,l) {
|
|
251 |
}
|
252 |
?>
|
253 |
</select></p></td>
|
|
|
|
|
|
|
|
|
254 |
</tr>
|
255 |
<tr>
|
256 |
-
<td valign="top"><div style="padding-top:3px;"><strong><?php _e("iFrame Url", '
|
257 |
-
<td valign="top"><input id="fb4_url0" type="text" style="width: 600px; font-size: 10px;" value="<?php echo $fb_url.'?b='; ?>" /></td>
|
258 |
</tr>
|
|
|
|
|
|
|
|
|
259 |
</table>
|
260 |
</fieldset></form>
|
261 |
</div>
|
10 |
|
11 |
if(isset($_POST['copy_file'])) {
|
12 |
if(copy(FLAG_ABSPATH.'flagframe.php',ABSPATH.'flagframe.php')) {
|
13 |
+
flagGallery::show_message(__('Success','flash-album-gallery'));
|
14 |
} else {
|
15 |
+
flagGallery::show_error(__('Failure','flash-album-gallery'));
|
16 |
}
|
17 |
}
|
18 |
global $flag, $flagdb;
|
37 |
var galleries = '?i='+jQuery('#items_array').val().split(',').join('_');
|
38 |
var skin = jQuery('#skinname option:selected').val();
|
39 |
if(skin) skin = '&f='+skin; else skin = '';
|
40 |
+
var w = jQuery('#gallerywidth').val();
|
41 |
+
var h = jQuery('#galleryheight').val();
|
42 |
+
fb_url(galleries,skin,w,h);
|
|
|
|
|
43 |
jQuery('#galleries :checkbox').click(function(){
|
44 |
var cur, arr, del;
|
45 |
if(jQuery(this).is(':checked')){
|
66 |
}
|
67 |
galleries = '?i='+jQuery('#items_array').val().split(',').join('_');
|
68 |
skin = jQuery('#skinname option:selected').val(); if(skin) skin = '&f='+skin; else skin = '';
|
69 |
+
w = jQuery('#gallerywidth').val();
|
70 |
+
h = jQuery('#galleryheight').val();
|
71 |
+
fb_url(galleries,skin,w,h);
|
72 |
});
|
73 |
jQuery('#skinname').change(function(){
|
74 |
var skin = jQuery(this).val();
|
78 |
skin = '';
|
79 |
}
|
80 |
galleries = '?i='+jQuery('#items_array').val().split(',').join('_');
|
81 |
+
w = jQuery('#gallerywidth').val();
|
82 |
+
h = jQuery('#galleryheight').val();
|
83 |
+
fb_url(galleries,skin,w,h);
|
84 |
});
|
85 |
+
jQuery('#gallerywidth, #galleryheight').bind('keyup',function(){
|
86 |
+
var w = jQuery('#gallerywidth').val();
|
87 |
+
var h = jQuery('#galleryheight').val();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
88 |
galleries = '?i='+jQuery('#items_array').val().split(',').join('_');
|
89 |
skin = jQuery('#skinname option:selected').val(); if(skin) skin = '&f='+skin; else skin = '';
|
90 |
+
fb_url(galleries,skin,w,h);
|
|
|
91 |
});
|
92 |
+
jQuery('#m_playlist, #gallerywidth2, #galleryheight2').change(function(){
|
93 |
+
var playlist = jQuery('#m_playlist').val();
|
94 |
if(playlist) {
|
95 |
playlist = '?m='+playlist;
|
96 |
} else {
|
97 |
+
playlist = '';
|
98 |
}
|
99 |
+
fb_url2(playlist,2);
|
100 |
});
|
101 |
+
jQuery('#v_playlist, #gallerywidth3, #galleryheight3').change(function(){
|
102 |
+
var playlist = jQuery('#v_playlist').val();
|
103 |
if(playlist) {
|
104 |
playlist = '?v='+playlist;
|
105 |
} else {
|
106 |
+
playlist = '';
|
107 |
}
|
108 |
+
fb_url2(playlist,3);
|
109 |
});
|
110 |
+
jQuery('#b_playlist, #gallerywidth4, #galleryheight4').change(function(){
|
111 |
+
var playlist = jQuery('#b_playlist').val();
|
112 |
if(playlist) {
|
113 |
playlist = '?b='+playlist;
|
114 |
} else {
|
115 |
+
playlist = '';
|
116 |
}
|
117 |
+
fb_url2(playlist,4);
|
118 |
});
|
119 |
});
|
120 |
+
function fb_url(galleries,skin,w,h) {
|
121 |
+
jQuery('#fb1_url0').val(url+galleries+skin);
|
122 |
+
jQuery('#fb1_ifr0').val('<iframe src="' + url+galleries+skin + '" allowfullscreen allowtransparency frameborder="0" width="' + w + '" height="' + h + '"></iframe>');
|
123 |
+
}
|
124 |
+
function fb_url2(playlist,fieldset_id) {
|
125 |
+
if(playlist){
|
126 |
+
var w = jQuery('#gallerywidth' + fieldset_id).val();
|
127 |
+
var h = jQuery('#galleryheight' + fieldset_id).val();
|
128 |
+
jQuery('#fb' + fieldset_id + '_url0').val(url + playlist);
|
129 |
+
jQuery('#fb' + fieldset_id + '_ifr0').val('<iframe src="' + url + playlist + '" allowfullscreen allowtransparency frameborder="0" width="' + w + '" height="' + h + '"></iframe>');
|
130 |
+
} else{
|
131 |
+
jQuery('#fb' + fieldset_id + '_url0').val(url);
|
132 |
+
jQuery('#fb' + fieldset_id + '_ifr0').val('');
|
133 |
+
}
|
134 |
}
|
135 |
/*]]>*/</script>
|
136 |
<div class="flag-wrap">
|
137 |
+
<h2><?php _e('Flagallery iFrame', 'flash-album-gallery'); ?></h2>
|
138 |
<form id="flagframe_copy" name="flagframe_copy" method="POST" class="alignright">
|
139 |
+
<p>Optional: <input type="submit" name="copy_file" class="button-primary" value="<?php _e('Copy flagframe.php file to root directory', 'flash-album-gallery'); ?>" /><br />
|
140 |
(makes iframe url shorter)</p>
|
141 |
</form>
|
142 |
+
<form id="generator1"><fieldset style="clear:both; margin:0 0 20px 0; padding: 20px; border: 1px solid #888888;"><legend style="font-size: 18px; padding: 0 5px;"><?php _e("Photo Gallery iFrame Generator", 'flash-album-gallery'); ?></legend>
|
143 |
<table border="0" cellpadding="4" cellspacing="0">
|
144 |
<tr>
|
145 |
+
<td nowrap="nowrap" valign="top"><div><?php _e("Select galleries", 'flash-album-gallery'); ?>:<span style="color:red;"> *</span><br /><small><?php _e("(album categories)", 'flash-album-gallery'); ?></small></div></td>
|
146 |
<td valign="top"><div id="galleries" style="width: 214px; height: 160px; overflow: auto; white-space: nowrap;">
|
147 |
+
<div class="row"><input type="checkbox" value="all" checked="checked" /> <strong><span style="display:inline-block; width:3em;">*</span> - <?php _e("all galleries", 'flash-album-gallery'); ?></strong></div>
|
148 |
<?php
|
149 |
$gallerylist = $flagdb->find_all_galleries($flag->options['albSort'], $flag->options['albSortDir']);
|
150 |
if(is_array($gallerylist)) {
|
157 |
</div></td>
|
158 |
</tr>
|
159 |
<tr>
|
160 |
+
<td nowrap="nowrap" valign="top"><p style="padding-top:3px;"><?php _e("Galleries order", 'flash-album-gallery'); ?>: </p></td>
|
161 |
<td valign="top"><p><input readonly="readonly" type="text" id="items_array" value="all" style="width: 214px;" /></p></td>
|
162 |
</tr>
|
163 |
<tr>
|
164 |
+
<td nowrap="nowrap" valign="top"><p style="padding-top:3px;"><label for="skinname"><?php _e("Choose skin", 'flash-album-gallery'); ?>:</label></p></td>
|
165 |
<td valign="top"><p><select id="skinname" name="skinname" style="width: 214px;">
|
166 |
+
<option value="" selected="selected"><?php _e("skin active by default", 'flash-album-gallery'); ?></option>
|
167 |
<?php
|
168 |
foreach ( (array)$i_skins as $skin_file => $skin_data) {
|
169 |
echo '<option value="'.dirname($skin_file).'">'.$skin_data['Name'].'</option>'."\n";
|
172 |
</select></p></td>
|
173 |
</tr>
|
174 |
<tr>
|
175 |
+
<td valign="top"><p style="padding-top:3px;"><?php _e("iFrame size", 'flash-album-gallery'); ?>:<br /><span style="font-size:9px">(<?php _e("blank for default", 'flash-album-gallery'); ?>)</span></p></td>
|
176 |
+
<td valign="top"><p><?php _e("width", 'flash-album-gallery'); ?>: <input id="gallerywidth" type="text" style="width: 50px" value="100%" /> <?php _e("height", 'flash-album-gallery'); ?>: <input id="galleryheight" type="text" style="width: 50px" value="500" /></p></td>
|
177 |
</tr>
|
|
|
|
|
|
|
|
|
178 |
<tr>
|
179 |
+
<td valign="top"><div style="padding-top:3px;"><strong><?php _e("iFrame Url", 'flash-album-gallery'); ?>: </strong></div></td>
|
180 |
+
<td valign="top"><input id="fb1_url0" type="text" style="width: 780px; font-size: 10px;" value="<?php echo $fb_url.'?i=all'; ?>" readonly /></td>
|
181 |
</tr>
|
182 |
+
<tr>
|
183 |
+
<td valign="top"><div style="padding-top:3px;"><strong><?php _e("Embed iFrame code", 'flash-album-gallery'); ?>: </strong></div></td>
|
184 |
+
<td valign="top"><textarea id="fb1_ifr0" style="width: 600px; height:60px; font-size: 12px;" readonly></textarea></td>
|
185 |
+
</tr>
|
186 |
</table>
|
187 |
</fieldset></form>
|
188 |
+
<form id="generator2"><fieldset style="padding: 20px; margin:0 0 20px 0; border: 1px solid #888888;"><legend style="font-size: 18px; padding: 0 5px;"><?php _e("mp3 Gallery iFrame Generator", 'flash-album-gallery'); ?></legend>
|
189 |
<table border="0" cellpadding="4" cellspacing="0">
|
190 |
<tr>
|
191 |
+
<td nowrap="nowrap" valign="top"><p style="padding-top:3px;"><label><?php _e("Choose playlist", 'flash-album-gallery'); ?>:</label></p></td>
|
192 |
<td valign="top"><p><select id="m_playlist" style="width: 214px;">
|
193 |
+
<option value="" selected="selected"><?php _e('Choose playlist', 'flash-album-gallery'); ?></option>
|
194 |
<?php
|
195 |
foreach((array)$all_m_playlists as $playlist_file => $playlist_data) {
|
196 |
$playlist_name = basename($playlist_file, '.xml');
|
200 |
}
|
201 |
?>
|
202 |
</select></p></td>
|
203 |
+
</tr>
|
204 |
+
<tr>
|
205 |
+
<td valign="top"><p style="padding-top:3px;"><?php _e("iFrame size", 'flash-album-gallery'); ?>:<br /><span style="font-size:9px">(<?php _e("blank for default", 'flash-album-gallery'); ?>)</span></p></td>
|
206 |
+
<td valign="top"><p><?php _e("width", 'flash-album-gallery'); ?>: <input id="gallerywidth2" type="text" style="width: 50px" value="100%" /> <?php _e("height", 'flash-album-gallery'); ?>: <input id="galleryheight2" type="text" style="width: 50px" value="500" /></p></td>
|
207 |
</tr>
|
208 |
<tr>
|
209 |
+
<td valign="top"><div style="padding-top:3px;"><strong><?php _e("iFrame Url", 'flash-album-gallery'); ?>: </strong></div></td>
|
210 |
+
<td valign="top"><input id="fb2_url0" type="text" style="width: 600px; font-size: 10px;" value="<?php echo $fb_url.'?m='; ?>" readonly /></td>
|
211 |
</tr>
|
212 |
+
<tr>
|
213 |
+
<td valign="top"><div style="padding-top:3px;"><strong><?php _e("Embed iFrame code", 'flash-album-gallery'); ?>: </strong></div></td>
|
214 |
+
<td valign="top"><textarea id="fb2_ifr0" style="width: 600px; height:60px; font-size: 12px;" readonly></textarea></td>
|
215 |
+
</tr>
|
216 |
</table>
|
217 |
</fieldset></form>
|
218 |
+
<form id="generator3"><fieldset style="padding: 20px; margin:0 0 20px 0; border: 1px solid #888888;"><legend style="font-size: 18px; padding: 0 5px;"><?php _e("Video Blog Gallery iFrame Generator", 'flash-album-gallery'); ?></legend>
|
219 |
<table border="0" cellpadding="4" cellspacing="0">
|
220 |
<tr>
|
221 |
+
<td nowrap="nowrap" valign="top"><p style="padding-top:3px;"><label><?php _e("Choose playlist", 'flash-album-gallery'); ?>:</label></p></td>
|
222 |
<td valign="top"><p><select id="v_playlist" style="width: 214px;">
|
223 |
+
<option value="" selected="selected"><?php _e('Choose playlist', 'flash-album-gallery'); ?></option>
|
224 |
<?php
|
225 |
foreach((array)$all_v_playlists as $playlist_file => $playlist_data) {
|
226 |
$playlist_name = basename($playlist_file, '.xml');
|
230 |
}
|
231 |
?>
|
232 |
</select></p></td>
|
233 |
+
</tr>
|
234 |
+
<tr>
|
235 |
+
<td valign="top"><p style="padding-top:3px;"><?php _e("iFrame size", 'flash-album-gallery'); ?>:<br /><span style="font-size:9px">(<?php _e("blank for default", 'flash-album-gallery'); ?>)</span></p></td>
|
236 |
+
<td valign="top"><p><?php _e("width", 'flash-album-gallery'); ?>: <input id="gallerywidth3" type="text" style="width: 50px" value="100%" /> <?php _e("height", 'flash-album-gallery'); ?>: <input id="galleryheight3" type="text" style="width: 50px" value="500" /></p></td>
|
237 |
</tr>
|
238 |
<tr>
|
239 |
+
<td valign="top"><div style="padding-top:3px;"><strong><?php _e("iFrame Url", 'flash-album-gallery'); ?>: </strong></div></td>
|
240 |
+
<td valign="top"><input id="fb3_url0" type="text" style="width: 600px; font-size: 10px;" value="<?php echo $fb_url.'?v='; ?>" readonly /></td>
|
241 |
+
</tr>
|
242 |
+
<tr>
|
243 |
+
<td valign="top"><div style="padding-top:3px;"><strong><?php _e("Embed iFrame code", 'flash-album-gallery'); ?>: </strong></div></td>
|
244 |
+
<td valign="top"><textarea id="fb3_ifr0" style="width: 600px; height:60px; font-size: 12px;" readonly</textarea></td>
|
245 |
</tr>
|
246 |
</table>
|
247 |
</fieldset></form>
|
248 |
+
<form id="generator4"><fieldset style="padding: 20px; margin:0 0 20px 0; border: 1px solid #888888;"><legend style="font-size: 18px; padding: 0 5px;"><?php _e("Banner Box iFrame Generator", 'flash-album-gallery'); ?></legend>
|
249 |
<table border="0" cellpadding="4" cellspacing="0">
|
250 |
<tr>
|
251 |
+
<td nowrap="nowrap" valign="top"><p style="padding-top:3px;"><label><?php _e("Choose xml", 'flash-album-gallery'); ?>:</label></p></td>
|
252 |
<td valign="top"><p><select id="b_playlist" style="width: 214px;">
|
253 |
+
<option value="" selected="selected"><?php _e('Choose XML', 'flash-album-gallery'); ?></option>
|
254 |
<?php
|
255 |
foreach((array)$all_b_playlists as $playlist_file => $playlist_data) {
|
256 |
$playlist_name = basename($playlist_file, '.xml');
|
260 |
}
|
261 |
?>
|
262 |
</select></p></td>
|
263 |
+
</tr>
|
264 |
+
<tr>
|
265 |
+
<td valign="top"><p style="padding-top:3px;"><?php _e("iFrame size", 'flash-album-gallery'); ?>:<br /><span style="font-size:9px">(<?php _e("blank for default", 'flash-album-gallery'); ?>)</span></p></td>
|
266 |
+
<td valign="top"><p><?php _e("width", 'flash-album-gallery'); ?>: <input id="gallerywidth4" type="text" style="width: 50px" value="100%" /> <?php _e("height", 'flash-album-gallery'); ?>: <input id="galleryheight4" type="text" style="width: 50px" value="500" /></p></td>
|
267 |
</tr>
|
268 |
<tr>
|
269 |
+
<td valign="top"><div style="padding-top:3px;"><strong><?php _e("iFrame Url", 'flash-album-gallery'); ?>: </strong></div></td>
|
270 |
+
<td valign="top"><input id="fb4_url0" type="text" style="width: 600px; font-size: 10px;" value="<?php echo $fb_url.'?b='; ?>" readonly /></td>
|
271 |
</tr>
|
272 |
+
<tr>
|
273 |
+
<td valign="top"><div style="padding-top:3px;"><strong><?php _e("Embed iFrame code", 'flash-album-gallery'); ?>: </strong></div></td>
|
274 |
+
<td valign="top"><textarea id="fb4_ifr0" style="width: 600px; height:60px; font-size: 12px;" readonly></textarea></td>
|
275 |
+
</tr>
|
276 |
</table>
|
277 |
</fieldset></form>
|
278 |
</div>
|
admin/functions.php
CHANGED
@@ -19,9 +19,9 @@ class flagAdmin{
|
|
19 |
*/
|
20 |
public static function create_gallery($gallery, $defaultpath, $output = true) {
|
21 |
global $wpdb, $user_ID;
|
22 |
-
|
23 |
// get the current user ID
|
24 |
-
|
25 |
|
26 |
$description = '';
|
27 |
$status = 0;
|
@@ -41,63 +41,63 @@ class flagAdmin{
|
|
41 |
$flagpath = $defaultpath . $galleryname;
|
42 |
$flagRoot = WINABSPATH . $defaultpath;
|
43 |
$txt = '';
|
44 |
-
|
45 |
// No gallery name ?
|
46 |
-
if (empty($galleryname)) {
|
47 |
-
if ($output) flagGallery::show_error( __('No valid gallery name!', '
|
48 |
return false;
|
49 |
}
|
50 |
-
|
51 |
// check for main folder
|
52 |
if ( !is_dir($flagRoot) ) {
|
53 |
if ( !wp_mkdir_p( $flagRoot ) ) {
|
54 |
-
$txt = __('Directory', '
|
55 |
-
$txt .= __('Check this link, if you didn\'t know how to set the permission :', '
|
56 |
if ($output) flagGallery::show_error($txt);
|
57 |
return false;
|
58 |
}
|
59 |
}
|
60 |
|
61 |
-
// check for permission settings, Safe mode limitations are not taken into account.
|
62 |
if ( !is_writeable( $flagRoot ) ) {
|
63 |
-
$txt = __('Directory', '
|
64 |
-
$txt .= __('Check this link, if you didn\'t know how to set the permission :', '
|
65 |
if ($output) flagGallery::show_error($txt);
|
66 |
return false;
|
67 |
}
|
68 |
-
|
69 |
// 1. Create new gallery folder
|
70 |
if ( !is_dir(WINABSPATH . $flagpath) ) {
|
71 |
-
if ( !wp_mkdir_p (WINABSPATH . $flagpath) )
|
72 |
-
$txt = __('Unable to create directory ', '
|
73 |
}
|
74 |
-
|
75 |
// 2. Check folder permission
|
76 |
if ( !is_writeable(WINABSPATH . $flagpath ) )
|
77 |
-
$txt .= __('Directory', '
|
78 |
|
79 |
// 3. Now create "thumbs" folder inside
|
80 |
-
if ( !is_dir(WINABSPATH . $flagpath . '/thumbs') ) {
|
81 |
-
if ( !wp_mkdir_p ( WINABSPATH . $flagpath . '/thumbs') )
|
82 |
-
$txt .= __('Unable to create directory ', '
|
83 |
}
|
84 |
-
|
85 |
// 4. Now create "webview" folder inside
|
86 |
if ( !is_dir(WINABSPATH . $flagpath . '/webview') ) {
|
87 |
if ( !wp_mkdir_p ( WINABSPATH . $flagpath . '/webview') )
|
88 |
-
$txt .= __('Unable to create directory ', '
|
89 |
}
|
90 |
|
91 |
-
if (
|
92 |
-
$help = __('The server setting Safe-Mode is on !', '
|
93 |
-
$help .= '<br />'.__('If you have problems, please create directory', '
|
94 |
-
$help .= __('and the thumbnails directory', '
|
95 |
if ($output) flagGallery::show_message($help);
|
96 |
}
|
97 |
-
|
98 |
-
// show an error message
|
99 |
if ( !empty($txt) ) {
|
100 |
-
if (
|
101 |
// for safe_mode , better delete folder, both folder must be created manually
|
102 |
@rmdir(WINABSPATH . $flagpath . '/thumbs');
|
103 |
@rmdir(WINABSPATH . $flagpath);
|
@@ -105,11 +105,11 @@ class flagAdmin{
|
|
105 |
if ($output) flagGallery::show_error($txt);
|
106 |
return false;
|
107 |
}
|
108 |
-
|
109 |
$result = $wpdb->get_var($wpdb->prepare("SELECT `name` FROM `{$wpdb->flaggallery}` WHERE `name` = '%s' ", $galleryname));
|
110 |
-
|
111 |
if ($result) {
|
112 |
-
if ($output) flagGallery::show_error( _n( 'Gallery', 'Galleries', 1, '
|
113 |
return true;
|
114 |
} else {
|
115 |
if(empty($user_ID)){
|
@@ -122,20 +122,20 @@ class flagAdmin{
|
|
122 |
do_action('flag_created_new_gallery', $gallery_id);
|
123 |
|
124 |
if ($result) {
|
125 |
-
$message = __('Gallery \'%1$s\' successfully created.<br/>You can show this gallery with the tag %2$s.<br/>','
|
126 |
$message = sprintf($message, esc_html(stripcslashes($gallerytitle)), '[flagallery gid=' . $gallery_id . ']');
|
127 |
$message .= '<a href="' . admin_url() . 'admin.php?page=flag-manage-gallery&mode=edit&gid=' . $gallery_id . '" >';
|
128 |
-
$message .= __('Edit gallery','
|
129 |
$message .= '</a>';
|
130 |
-
|
131 |
-
if ($output) flagGallery::show_message($message);
|
132 |
}
|
133 |
// return only the id if defined
|
134 |
if ($gallery_id)
|
135 |
return $gallery_id;
|
136 |
|
137 |
return true;
|
138 |
-
}
|
139 |
}
|
140 |
|
141 |
/**
|
@@ -147,36 +147,36 @@ class flagAdmin{
|
|
147 |
* @return void
|
148 |
*/
|
149 |
public static function import_gallery($galleryfolder) {
|
150 |
-
|
151 |
global $wpdb, $user_ID;
|
152 |
|
153 |
// get the current user ID
|
154 |
-
|
155 |
-
|
156 |
$created_msg = '';
|
157 |
-
|
158 |
// remove trailing slash at the end, if somebody use it
|
159 |
$galleryfolder = str_replace('../','', $galleryfolder );
|
160 |
$galleryfolder = rtrim($galleryfolder, '/');
|
161 |
$gallerypath = WINABSPATH . $galleryfolder;
|
162 |
-
|
163 |
if (!is_dir($gallerypath)) {
|
164 |
-
flagGallery::show_error(__('Directory', '
|
165 |
return ;
|
166 |
}
|
167 |
-
|
168 |
// read list of images
|
169 |
$new_imageslist = flagAdmin::scandir($gallerypath);
|
170 |
if (empty($new_imageslist)) {
|
171 |
-
flagGallery::show_message(__('Directory', '
|
172 |
return;
|
173 |
}
|
174 |
-
|
175 |
// check & create thumbnail folder
|
176 |
if ( !flagGallery::create_thumbnail_folder($gallerypath) )
|
177 |
return;
|
178 |
-
|
179 |
-
// take folder name as gallery name
|
180 |
$galleryname = basename($galleryfolder);
|
181 |
|
182 |
// check for existing gallery folder
|
@@ -185,43 +185,43 @@ class flagAdmin{
|
|
185 |
if (!$gallery_id) {
|
186 |
$result = $wpdb->query( $wpdb->prepare("INSERT INTO {$wpdb->flaggallery} (name, path, title, author) VALUES (%s, %s, %s, %s)", $galleryname, $galleryfolder, $galleryname , $user_ID) );
|
187 |
if (!$result) {
|
188 |
-
flagGallery::show_error(__('Database error. Could not add gallery!','
|
189 |
return;
|
190 |
}
|
191 |
-
$created_msg = _n( 'Gallery', 'Galleries', 1, '
|
192 |
$gallery_id = $wpdb->insert_id; // get index_id
|
193 |
}
|
194 |
-
|
195 |
// Look for existing image list
|
196 |
$old_imageslist = $wpdb->get_col($wpdb->prepare("SELECT filename FROM {$wpdb->flagpictures} WHERE galleryid = %d ", $gallery_id));
|
197 |
-
|
198 |
// if no images are there, create empty array
|
199 |
-
if ($old_imageslist == NULL)
|
200 |
$old_imageslist = array();
|
201 |
-
|
202 |
// check difference
|
203 |
$new_images = array_diff($new_imageslist, $old_imageslist);
|
204 |
-
|
205 |
// all images must be valid files
|
206 |
foreach($new_images as $key => $picture) {
|
207 |
if (!@getimagesize($gallerypath . '/' . $picture) ) {
|
208 |
unset($new_images[$key]);
|
209 |
-
@unlink($gallerypath . '/' . $picture);
|
210 |
}
|
211 |
}
|
212 |
-
|
213 |
-
// add images to database
|
214 |
$image_ids = flagAdmin::add_Images($gallery_id, $new_images);
|
215 |
-
|
216 |
//add the preview image if needed
|
217 |
flagAdmin::set_gallery_preview ( $gallery_id );
|
218 |
|
219 |
// now create thumbnails
|
220 |
-
flagAdmin::do_ajax_operation( 'create_thumbnail' , $image_ids, __('Create new thumbnails','
|
221 |
-
|
222 |
//TODO:Message will not shown, because AJAX routine require more time, message should be passed to AJAX
|
223 |
-
flagGallery::show_message( $created_msg . count($image_ids) .__(' picture(s) successfully added','
|
224 |
-
|
225 |
return;
|
226 |
|
227 |
}
|
@@ -242,14 +242,14 @@ class flagAdmin{
|
|
242 |
$folder = rtrim($folder, '/');
|
243 |
$path = WINABSPATH . $folder;
|
244 |
if (!is_dir($path)) {
|
245 |
-
echo '<p class="message">'.__('Directory', '
|
246 |
return ;
|
247 |
}
|
248 |
// read list of files
|
249 |
-
$ext = array('flv');
|
250 |
$new_filelist = flagAdmin::scandir($path, $ext);
|
251 |
if (empty($new_filelist)) {
|
252 |
-
echo '<p class="message">'.__('Directory', '
|
253 |
return;
|
254 |
}
|
255 |
$i=0;
|
@@ -258,13 +258,13 @@ class flagAdmin{
|
|
258 |
$filename = $path . '/' . $file;
|
259 |
$id = flagAdmin::handle_import_file($filename);
|
260 |
if ( is_wp_error($id) ) {
|
261 |
-
$created_msg .= '<p>' . sprintf(__('<em>%s</em> was <strong>not</strong> imported due to an error: %s', '
|
262 |
} else {
|
263 |
$i++;
|
264 |
-
$created_msg .= '<p>' . sprintf(__('<em>%s</em> has been added to Media library', '
|
265 |
}
|
266 |
}
|
267 |
-
$created_msg .= '<p class="message">'.$i.__(' file(s) successfully added','
|
268 |
echo $created_msg;
|
269 |
}
|
270 |
|
@@ -283,14 +283,14 @@ class flagAdmin{
|
|
283 |
$folder = rtrim($folder, '/');
|
284 |
$path = WINABSPATH . $folder;
|
285 |
if (!is_dir($path)) {
|
286 |
-
echo '<p class="message">'.__('Directory', '
|
287 |
return ;
|
288 |
}
|
289 |
// read list of files
|
290 |
-
$ext = array('mp3');
|
291 |
$new_filelist = flagAdmin::scandir($path, $ext);
|
292 |
if (empty($new_filelist)) {
|
293 |
-
echo '<p class="message">'.__('Directory', '
|
294 |
return;
|
295 |
}
|
296 |
$i=0;
|
@@ -299,13 +299,13 @@ class flagAdmin{
|
|
299 |
$filename = $path . '/' . $file;
|
300 |
$id = flagAdmin::handle_import_file($filename);
|
301 |
if ( is_wp_error($id) ) {
|
302 |
-
$created_msg .= '<p>' . sprintf(__('<em>%s</em> was <strong>not</strong> imported due to an error: %s', '
|
303 |
} else {
|
304 |
$i++;
|
305 |
-
$created_msg .= '<p>' . sprintf(__('<em>%s</em> has been added to Media library', '
|
306 |
}
|
307 |
}
|
308 |
-
$created_msg .= '<p class="message">'.$i.__(' file(s) successfully added','
|
309 |
echo $created_msg;
|
310 |
}
|
311 |
|
@@ -324,16 +324,16 @@ class flagAdmin{
|
|
324 |
$folder = rtrim($folder, '/');
|
325 |
$path = WINABSPATH . $folder;
|
326 |
if (!is_dir($path)) {
|
327 |
-
echo '<p class="message">'.__('Directory', '
|
328 |
return false;
|
329 |
}
|
330 |
// read list of files
|
331 |
$new_filelist = flagAdmin::scandir($path);
|
332 |
if (empty($new_filelist)) {
|
333 |
-
echo '<p class="message">'.__('Directory', '
|
334 |
return false;
|
335 |
}
|
336 |
-
$created_msg .= '<div class="message"><p>'.count($new_filelist).' '.__('image(s) in the folder','
|
337 |
echo $created_msg;
|
338 |
return $new_filelist;
|
339 |
}
|
@@ -356,10 +356,10 @@ class flagAdmin{
|
|
356 |
/** @var $type
|
357 |
* @var $ext */
|
358 |
extract( $wp_filetype );
|
359 |
-
|
360 |
if ( ( !$type || !$ext ) && !current_user_can( 'unfiltered_upload' ) )
|
361 |
return new WP_Error('wrong_file_type', __( 'File type does not meet security guidelines. Try another.' ) ); //A WP-core string..
|
362 |
-
|
363 |
$match = preg_match('|^' . preg_quote(str_replace('\\', '/', $uploads['basedir'])) . '(.*)$|i', $file, $mat);
|
364 |
//Is the file allready in the uploads folder?
|
365 |
if( $match ) {
|
@@ -383,13 +383,14 @@ class flagAdmin{
|
|
383 |
$post_date = date( 'Y-m-d H:i:s', $time);
|
384 |
$post_date_gmt = gmdate( 'Y-m-d H:i:s', $time);
|
385 |
}
|
386 |
-
} else {
|
387 |
$filename = wp_unique_filename( $uploads['path'], basename($file));
|
388 |
|
389 |
// copy the file to the uploads dir
|
390 |
$new_file = $uploads['path'] . '/' . $filename;
|
391 |
-
if ( false === @copy( $file, $new_file ) )
|
392 |
-
|
|
|
393 |
|
394 |
// Set correct file permissions
|
395 |
$stat = stat( dirname( $new_file ));
|
@@ -440,7 +441,7 @@ class flagAdmin{
|
|
440 |
$data = wp_generate_attachment_metadata( $id, $new_file );
|
441 |
wp_update_attachment_metadata( $id, $data );
|
442 |
if( !$match && isset($_POST['delete_files']) ) {
|
443 |
-
@unlink($file);
|
444 |
}
|
445 |
}
|
446 |
|
@@ -458,34 +459,34 @@ class flagAdmin{
|
|
458 |
public static function scandir($dirname = '.', $ext = array()) {
|
459 |
// thx to php.net :-)
|
460 |
if(empty($ext))
|
461 |
-
$ext = array('jpeg', 'jpg', 'png', 'gif');
|
462 |
-
$files = array();
|
463 |
-
if($handle = opendir($dirname)) {
|
464 |
-
while(false !== ($file = readdir($handle)))
|
465 |
-
for($i=0;$i<sizeof($ext);$i++)
|
466 |
-
if(stristr($file, '.' . $ext[$i]))
|
467 |
-
$files[] = utf8_encode($file);
|
468 |
-
closedir($handle);
|
469 |
-
}
|
470 |
sort($files);
|
471 |
-
return ($files);
|
472 |
-
}
|
473 |
-
|
474 |
/**
|
475 |
* flagAdmin::createThumbnail() - function to create or recreate a thumbnail
|
476 |
-
*
|
477 |
* @param object | int $image contain all information about the image or the id
|
478 |
* @return string result code
|
479 |
*/
|
480 |
public static function create_thumbnail($image) {
|
481 |
-
|
482 |
global $flag;
|
483 |
|
484 |
if ( is_numeric($image) )
|
485 |
$image = flagdb::find_image( $image );
|
486 |
|
487 |
if ( !is_object($image) )
|
488 |
-
return __('Object didn\'t contain correct data','
|
489 |
|
490 |
$dest_path = dirname($image->webimagePath);
|
491 |
if(!is_dir($dest_path)){
|
@@ -495,37 +496,19 @@ class flagAdmin{
|
|
495 |
|
496 |
if(! class_exists('flag_Thumbnail'))
|
497 |
require_once( flagGallery::graphic_library() );
|
498 |
-
|
499 |
// check for existing thumbnail
|
500 |
if (file_exists($image->thumbPath))
|
501 |
if (!is_writable($image->thumbPath))
|
502 |
-
return $image->filename . __(' is not writeable ','
|
503 |
|
504 |
$thumb = new flag_Thumbnail($image->imagePath, TRUE);
|
505 |
$img_size = @getimagesize ( $image->imagePath );
|
506 |
|
507 |
// skip if file is not there
|
508 |
if (!$thumb->error) {
|
509 |
-
|
510 |
-
|
511 |
-
if ( ($flag->options['thumbWidth']/$flag->options['thumbHeight'] > $img_size[0]/$img_size[1]) ) {
|
512 |
-
// first resize to the wanted width
|
513 |
-
$thumb->resize($flag->options['thumbWidth'], 0);
|
514 |
-
// get optimal y startpos
|
515 |
-
$ypos = ($thumb->currentDimensions['height'] - $flag->options['thumbHeight']) / 2;
|
516 |
-
$thumb->crop(0, $ypos, $flag->options['thumbWidth'],$flag->options['thumbHeight']);
|
517 |
-
} else {
|
518 |
-
// first resize to the wanted height
|
519 |
-
$thumb->resize(0, $flag->options['thumbHeight']);
|
520 |
-
// get optimal x startpos
|
521 |
-
$xpos = ($thumb->currentDimensions['width'] - $flag->options['thumbWidth']) / 2;
|
522 |
-
$thumb->crop($xpos, 0, $flag->options['thumbWidth'],$flag->options['thumbHeight']);
|
523 |
-
}
|
524 |
-
//this create a thumbnail but keep ratio settings
|
525 |
-
} else {
|
526 |
-
$thumb->resize($flag->options['thumbWidth'],$flag->options['thumbHeight']);
|
527 |
-
}
|
528 |
-
|
529 |
// save the new thumbnail
|
530 |
$thumb->save($image->thumbPath, $flag->options['thumbQuality']);
|
531 |
flagAdmin::chmod ($image->thumbPath);
|
@@ -533,14 +516,14 @@ class flagAdmin{
|
|
533 |
//read the new sizes
|
534 |
$new_size = @getimagesize ( $image->thumbPath );
|
535 |
$size['width'] = $new_size[0];
|
536 |
-
$size['height'] = $new_size[1];
|
537 |
-
|
538 |
// add them to the database
|
539 |
flagdb::update_image_meta($image->pid, array( 'thumbnail' => $size) );
|
540 |
}
|
541 |
-
|
542 |
$thumb->destruct();
|
543 |
-
|
544 |
if ( !empty($thumb->errmsg) )
|
545 |
return $image->filename . ' (Error : '.$thumb->errmsg .')';
|
546 |
|
@@ -549,30 +532,30 @@ class flagAdmin{
|
|
549 |
flagAdmin::webview_image($image);
|
550 |
|
551 |
// success
|
552 |
-
return '1';
|
553 |
}
|
554 |
-
|
555 |
/**
|
556 |
* flagAdmin::resize_image() - create a new image, based on the height /width
|
557 |
-
*
|
558 |
* @class flagAdmin
|
559 |
* @param object | int $image contain all information about the image or the id
|
560 |
-
* @param integer $width optional
|
561 |
* @param integer $height optional
|
562 |
* @return string result code
|
563 |
*/
|
564 |
public static function resize_image($image, $width = 0, $height = 0) {
|
565 |
-
|
566 |
global $flag;
|
567 |
-
|
568 |
if(! class_exists('flag_Thumbnail'))
|
569 |
require_once( flagGallery::graphic_library() );
|
570 |
|
571 |
if ( is_numeric($image) )
|
572 |
$image = flagdb::find_image( $image );
|
573 |
-
|
574 |
-
if ( !is_object($image) )
|
575 |
-
return __('Object didn\'t contain correct data','
|
576 |
|
577 |
// before we start we import the meta data to database (required for uploads before V0.40)
|
578 |
flagAdmin::maybe_import_meta( $image->pid );
|
@@ -580,10 +563,10 @@ class flagAdmin{
|
|
580 |
// if no parameter is set, take global settings
|
581 |
$width = ($width == 0) ? $flag->options['imgWidth'] : $width;
|
582 |
$height = ($height == 0) ? $flag->options['imgHeight'] : $height;
|
583 |
-
|
584 |
if (!is_writable($image->imagePath))
|
585 |
-
return ' <strong>' . $image->filename . __(' is not writeable','
|
586 |
-
|
587 |
$file = new flag_Thumbnail($image->imagePath, TRUE);
|
588 |
|
589 |
// skip if file is not there
|
@@ -605,14 +588,17 @@ class flagAdmin{
|
|
605 |
return '1';
|
606 |
}
|
607 |
|
608 |
-
|
609 |
-
|
610 |
-
|
611 |
-
|
612 |
-
|
613 |
-
|
614 |
-
|
615 |
-
|
|
|
|
|
|
|
616 |
|
617 |
global $flag;
|
618 |
|
@@ -620,39 +606,51 @@ class flagAdmin{
|
|
620 |
$image = flagdb::find_image( $image );
|
621 |
|
622 |
if ( !is_object($image) )
|
623 |
-
return __('Object didn\'t contain correct data','
|
624 |
|
625 |
$img_size = @getimagesize ( $image->imagePath );
|
626 |
-
|
|
|
627 |
if(flagGallery::create_webview_folder(dirname($image->imagePath))){
|
628 |
if (! is_writable( $dest_path ) ) {
|
629 |
@chmod( $dest_path, 0755 );
|
630 |
}
|
631 |
|
632 |
if (file_exists($image->webimagePath)){
|
633 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
634 |
}
|
635 |
|
636 |
$imgquality = $flag->options['imgQuality'];
|
637 |
-
$max_width = ($img_size[0] <
|
638 |
-
$max_height = ($img_size[1] <
|
639 |
if( function_exists('wp_get_image_editor') ) {
|
640 |
$editor = wp_get_image_editor( $image->imagePath );
|
641 |
-
|
642 |
-
|
643 |
-
|
644 |
-
|
645 |
-
|
646 |
-
|
647 |
-
|
648 |
-
|
649 |
-
|
650 |
-
|
651 |
-
|
|
|
652 |
}
|
653 |
}
|
654 |
|
655 |
-
|
|
|
|
|
|
|
|
|
656 |
}
|
657 |
|
658 |
/**
|
@@ -666,10 +664,10 @@ class flagAdmin{
|
|
666 |
*/
|
667 |
public static function add_Images($galleryID, $imageslist, $name2alt = false) {
|
668 |
global $wpdb;
|
669 |
-
|
670 |
$alttext = '';
|
671 |
$image_ids = array();
|
672 |
-
|
673 |
if ( is_array($imageslist) ) {
|
674 |
foreach($imageslist as $picture) {
|
675 |
if($name2alt) {
|
@@ -677,11 +675,11 @@ class flagAdmin{
|
|
677 |
$path_parts = pathinfo( $picture );
|
678 |
$alttext = ( !isset($path_parts['filename']) ) ? substr($path_parts['basename'], 0,strpos($path_parts['basename'], '.')) : $path_parts['filename'];
|
679 |
}
|
680 |
-
// save it to the database
|
681 |
$result = $wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->flagpictures (galleryid, filename, alttext, exclude) VALUES (%s, %s, %s, 0)", $galleryID, $picture, $alttext) );
|
682 |
// and give me the new id
|
683 |
$pic_id = (int) $wpdb->insert_id;
|
684 |
-
if ($result)
|
685 |
$image_ids[] = $pic_id;
|
686 |
|
687 |
// add the metadata
|
@@ -690,36 +688,36 @@ class flagAdmin{
|
|
690 |
// action hook for post process after the image is added to the database
|
691 |
$image = array( 'id' => $pic_id, 'filename' => $picture, 'galleryID' => $galleryID);
|
692 |
do_action('flag_added_new_image', $image);
|
693 |
-
|
694 |
-
}
|
695 |
} // is_array
|
696 |
-
|
697 |
return $image_ids;
|
698 |
-
|
699 |
}
|
700 |
|
701 |
/**
|
702 |
* Import some metadata into the database (if avialable)
|
703 |
-
*
|
704 |
* @class flagAdmin
|
705 |
* @param array|int $imagesIds
|
706 |
* @return bool
|
707 |
*/
|
708 |
public static function import_MetaData($imagesIds) {
|
709 |
-
|
710 |
global $wpdb;
|
711 |
-
|
712 |
require_once(FLAG_ABSPATH . 'lib/image.php');
|
713 |
-
|
714 |
if (!is_array($imagesIds))
|
715 |
$imagesIds = array($imagesIds);
|
716 |
-
|
717 |
foreach($imagesIds as $imageID) {
|
718 |
$image = flagdb::find_image($imageID);
|
719 |
if (!$image->error) {
|
720 |
|
721 |
$meta = flagAdmin::get_MetaData($image->pid);
|
722 |
-
|
723 |
// get the title
|
724 |
$alttext = empty( $meta['title'] ) ? $image->alttext : $meta['title'];
|
725 |
// get the caption / description field
|
@@ -729,31 +727,31 @@ class flagAdmin{
|
|
729 |
// update database
|
730 |
$result = $wpdb->query( $wpdb->prepare("UPDATE $wpdb->flagpictures SET alttext = %s, description = %s, imagedate = %s WHERE pid = %d", $alttext, $description, $timestamp, $image->pid) );
|
731 |
if ($result === false)
|
732 |
-
return ' <strong>' . $image->filename . ' ' . __('(Error : Couldn\'t not update data base)', '
|
733 |
-
|
734 |
//this flag will inform us the import is already one time performed
|
735 |
-
$meta['common']['saved'] = true;
|
736 |
$result = flagdb::update_image_meta($image->pid, $meta['common']);
|
737 |
-
|
738 |
if ($result === false)
|
739 |
-
return ' <strong>' . $image->filename . ' ' . __('(Error : Couldn\'t not update meta data)', '
|
740 |
} else
|
741 |
-
return ' <strong>' . $image->filename . ' ' . __('(Error : Couldn\'t not find image)', '
|
742 |
}
|
743 |
-
|
744 |
return '1';
|
745 |
-
|
746 |
}
|
747 |
|
748 |
/**
|
749 |
* Copy some metadata into the image description (if avialable)
|
750 |
-
*
|
751 |
* @class flagAdmin
|
752 |
* @param array|int $imagesIds
|
753 |
* @return bool
|
754 |
*/
|
755 |
public static function copy_MetaData($imagesIds) {
|
756 |
-
|
757 |
global $wpdb;
|
758 |
|
759 |
/** @var $meta */
|
@@ -762,15 +760,15 @@ class flagAdmin{
|
|
762 |
|
763 |
if (!is_array($imagesIds))
|
764 |
$imagesIds = array($imagesIds);
|
765 |
-
|
766 |
foreach($imagesIds as $imageID) {
|
767 |
-
|
768 |
$image = flagdb::find_image($imageID);
|
769 |
if (!$image->error) {
|
770 |
/** @var $makedescription
|
771 |
* @var $timestamp */
|
772 |
require_once(FLAG_ABSPATH . 'admin/grab_meta.php');
|
773 |
-
|
774 |
// get the title
|
775 |
$alttext = empty( $alttext ) ? $image->alttext : $meta['title'];
|
776 |
if($alttext) $alttext = '<font size="16"><b>'.$alttext."</b></font>\n";
|
@@ -782,14 +780,14 @@ class flagAdmin{
|
|
782 |
// update database
|
783 |
$result = $wpdb->query( $wpdb->prepare("UPDATE $wpdb->flagpictures SET alttext = %s, description = %s, imagedate = %s WHERE pid = %d", '', $makedescription, $timestamp, $image->pid) );
|
784 |
if ($result === false)
|
785 |
-
return ' <strong>' . $image->filename . ' ' . __('(Error : Couldn\'t not update data base)', '
|
786 |
-
|
787 |
} else
|
788 |
-
return ' <strong>' . $image->filename . ' ' . __('(Error : Couldn\'t not find image)', '
|
789 |
}
|
790 |
-
|
791 |
return '1';
|
792 |
-
|
793 |
}
|
794 |
|
795 |
/**
|
@@ -801,37 +799,37 @@ class flagAdmin{
|
|
801 |
* @return array metadata
|
802 |
*/
|
803 |
public static function get_MetaData($id) {
|
804 |
-
|
805 |
require_once(FLAG_ABSPATH . 'lib/meta.php');
|
806 |
-
|
807 |
$meta = array();
|
808 |
|
809 |
$pdata = new flagMeta( $id );
|
810 |
|
811 |
-
$meta['title'] = trim ( $pdata->get_META('title') );
|
812 |
-
$meta['caption'] = trim ( $pdata->get_META('caption') );
|
813 |
$meta['keywords'] = trim ( $pdata->get_META('keywords') );
|
814 |
$meta['timestamp'] = $pdata->get_date_time();
|
815 |
// this contain other useful meta information
|
816 |
$meta['common'] = $pdata->get_common_meta();
|
817 |
-
|
818 |
return $meta;
|
819 |
-
|
820 |
}
|
821 |
|
822 |
/**
|
823 |
* Maybe import some meta data to the database. The functions checks the flag 'saved'
|
824 |
* and if based on compat reason (pre V0.40) we save then some meta datas to the database
|
825 |
-
*
|
826 |
* @param int $id
|
827 |
* @return mixed result
|
828 |
*/
|
829 |
public static function maybe_import_meta( $id ) {
|
830 |
-
|
831 |
require_once(FLAG_ABSPATH . 'lib/meta.php');
|
832 |
|
833 |
$meta_obj = new flagMeta( $id );
|
834 |
-
|
835 |
if ( $meta_obj->image->meta_data['saved'] != true ) {
|
836 |
$common = $meta_obj->get_common_meta();
|
837 |
//this flag will inform us that the import is already one time performed
|
@@ -839,29 +837,29 @@ class flagAdmin{
|
|
839 |
$result = flagdb::update_image_meta($id, $common);
|
840 |
} else
|
841 |
return false;
|
842 |
-
|
843 |
-
return $result;
|
844 |
|
845 |
}
|
846 |
|
847 |
/**
|
848 |
* flagAdmin::getOnlyImages()
|
849 |
-
*
|
850 |
* @class flagAdmin
|
851 |
* @param mixed $p_event
|
852 |
* @param mixed $p_header
|
853 |
* @return bool
|
854 |
*/
|
855 |
public static function getOnlyImages($p_event, $p_header) {
|
856 |
-
|
857 |
$info = pathinfo($p_header['filename']);
|
858 |
// check for extension
|
859 |
-
$ext = array('jpeg', 'jpg', 'png', 'gif');
|
860 |
if ( in_array( strtolower($info['extension']), $ext) ) {
|
861 |
// For MAC skip the ".image" files
|
862 |
-
if ($info['basename']{0} == '.' )
|
863 |
return 0;
|
864 |
-
else
|
865 |
return 1;
|
866 |
}
|
867 |
// ----- all other files are skipped
|
@@ -872,14 +870,14 @@ class flagAdmin{
|
|
872 |
|
873 |
/**
|
874 |
* Function for uploading of images via the upload form
|
875 |
-
*
|
876 |
* @class flagAdmin
|
877 |
* @return void
|
878 |
*/
|
879 |
public static function upload_images() {
|
880 |
-
|
881 |
global $wpdb;
|
882 |
-
|
883 |
// WPMU action
|
884 |
if (flagAdmin::check_quota())
|
885 |
return;
|
@@ -891,97 +889,97 @@ class flagAdmin{
|
|
891 |
$galleryID = (int) $_POST['galleryselect'];
|
892 |
|
893 |
if ($galleryID == 0) {
|
894 |
-
flagGallery::show_error(__('No gallery selected !','
|
895 |
-
return;
|
896 |
}
|
897 |
|
898 |
-
// get the path to the gallery
|
899 |
$gallery = flagdb::find_gallery($galleryID);
|
900 |
|
901 |
if ( empty($gallery->path) ){
|
902 |
-
flagGallery::show_error(__('Failure in database, no gallery path set !','
|
903 |
return;
|
904 |
-
}
|
905 |
-
|
906 |
// read list of images
|
907 |
$dirlist = flagAdmin::scandir(WINABSPATH.$gallery->path);
|
908 |
-
|
909 |
$imagefiles = $_FILES['imagefiles'];
|
910 |
-
|
911 |
if (is_array($imagefiles)) {
|
912 |
foreach ($imagefiles['name'] as $key => $value) {
|
913 |
|
914 |
// look only for uploded files
|
915 |
if ($imagefiles['error'][$key] == 0) {
|
916 |
-
|
917 |
$temp_file = $imagefiles['tmp_name'][$key];
|
918 |
-
|
919 |
//clean filename and extract extension
|
920 |
$filepart = flagGallery::fileinfo( $imagefiles['name'][$key] );
|
921 |
$filename = $filepart['basename'];
|
922 |
-
|
923 |
// check for allowed extension and if it's an image file
|
924 |
$ext = array('jpg', 'jpeg', 'png', 'gif');
|
925 |
if ( !in_array(strtolower($filepart['extension']), $ext) || !@getimagesize($temp_file) ){
|
926 |
-
flagGallery::show_error('<strong>' . $imagefiles['name'][$key] . ' </strong>' . __('is no valid image file!','
|
927 |
continue;
|
928 |
}
|
929 |
-
|
930 |
// check if this filename already exist in the folder
|
931 |
$i = 0;
|
932 |
while ( in_array( $filename, $dirlist ) ) {
|
933 |
$filename = $filepart['filename'] . '_' . $i++ . '.' .$filepart['extension'];
|
934 |
}
|
935 |
-
|
936 |
$dest_file = $gallery->abspath . '/' . $filename;
|
937 |
-
|
938 |
//check for folder permission
|
939 |
if ( !is_writeable($gallery->abspath) ) {
|
940 |
-
$message = sprintf(__('Unable to write to directory %s. Is this directory writable by the server?', '
|
941 |
flagGallery::show_error($message);
|
942 |
-
return;
|
943 |
}
|
944 |
-
|
945 |
// save temp file to gallery
|
946 |
if ( !@move_uploaded_file($temp_file, $dest_file) ){
|
947 |
if( !file_exists($dest_file)){
|
948 |
-
flagGallery::show_error(__('Error, the file could not moved to : ','
|
949 |
flagAdmin::check_safemode( $gallery->abspath );
|
950 |
continue;
|
951 |
}
|
952 |
-
}
|
953 |
if ( !flagAdmin::chmod($dest_file) ) {
|
954 |
-
flagGallery::show_error(__('Error, the file permissions could not set','
|
955 |
continue;
|
956 |
}
|
957 |
-
|
958 |
// add to imagelist & dirlist
|
959 |
$imageslist[] = $filename;
|
960 |
$dirlist[] = $filename;
|
961 |
}
|
962 |
}
|
963 |
}
|
964 |
-
|
965 |
if (count($imageslist) > 0) {
|
966 |
-
|
967 |
-
// add images to database
|
968 |
$image_ids = flagAdmin::add_Images($galleryID, $imageslist);
|
969 |
|
970 |
//create thumbnails
|
971 |
-
flagAdmin::do_ajax_operation( 'create_thumbnail' , $image_ids, __('Create new thumbnails','
|
972 |
//add the preview image if needed
|
973 |
flagAdmin::set_gallery_preview ( $galleryID );
|
974 |
-
|
975 |
-
flagGallery::show_message( count($image_ids) . __(' Image(s) successfully added','
|
976 |
}
|
977 |
-
|
978 |
return;
|
979 |
|
980 |
} // end function
|
981 |
-
|
982 |
/**
|
983 |
* Upload function will be called via the Flash uploader
|
984 |
-
*
|
985 |
* @class flagAdmin
|
986 |
* @param integer $galleryID
|
987 |
* @return string $result
|
@@ -992,7 +990,7 @@ class flagAdmin{
|
|
992 |
|
993 |
if ($galleryID == 0) {
|
994 |
//@unlink($temp_file);
|
995 |
-
return __('No gallery selected!','
|
996 |
}
|
997 |
|
998 |
// WPMU action
|
@@ -1010,18 +1008,18 @@ class flagAdmin{
|
|
1010 |
$filename = $filepart['basename'];
|
1011 |
|
1012 |
// check for allowed extension
|
1013 |
-
$ext = array('jpeg', 'jpg', 'png', 'gif');
|
1014 |
if (!in_array(strtolower($filepart['extension']), $ext)){
|
1015 |
if(!@getimagesize($temp_file))
|
1016 |
-
return $filename . ' '. __('is no valid image file!','
|
1017 |
}
|
1018 |
|
1019 |
// get the path to the gallery
|
1020 |
$gallerypath = $wpdb->get_var($wpdb->prepare("SELECT path FROM {$wpdb->flaggallery} WHERE gid = %d ", $galleryID));
|
1021 |
if (!$gallerypath){
|
1022 |
@unlink($temp_file);
|
1023 |
-
return __('Failure in database, no gallery path set !','
|
1024 |
-
}
|
1025 |
|
1026 |
// read list of images
|
1027 |
$imageslist = flagAdmin::scandir( WINABSPATH.$gallerypath );
|
@@ -1031,19 +1029,44 @@ class flagAdmin{
|
|
1031 |
while (in_array($filename,$imageslist)) {
|
1032 |
$filename = sanitize_title($filepart['filename']) . '_' . $i++ . '.' . $filepart['extension'];
|
1033 |
}
|
1034 |
-
|
1035 |
$dest_file = WINABSPATH . $gallerypath . '/' . $filename;
|
1036 |
-
|
1037 |
// save temp file to gallery
|
1038 |
if ( !@move_uploaded_file($temp_file, $dest_file) ){
|
1039 |
if( !file_exists($dest_file)){
|
1040 |
flagAdmin::check_safemode(WINABSPATH.$gallerypath);
|
1041 |
-
return __('Error, the file could not moved to : ','
|
1042 |
}
|
1043 |
}
|
1044 |
-
|
1045 |
if ( !flagAdmin::chmod($dest_file) )
|
1046 |
-
return __('Error, the file permissions could not set','
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1047 |
|
1048 |
// add images to database
|
1049 |
$image_ids = flagAdmin::add_Images($galleryID, array($filename));
|
@@ -1051,9 +1074,8 @@ class flagAdmin{
|
|
1051 |
//create thumbnails
|
1052 |
|
1053 |
//save the thumb size values
|
1054 |
-
$flag->options['thumbWidth'] = intval($_POST['thumbw'])? intval($_POST['thumbw']) :
|
1055 |
-
$flag->options['thumbHeight'] = intval($_POST['thumbh'])? intval($_POST['thumbh']) :
|
1056 |
-
$flag->options['thumbFix'] = ('true' == $_POST['thumbf'])? 1 : 0;
|
1057 |
update_option('flag_options', $flag->options);
|
1058 |
|
1059 |
foreach($image_ids as $picture){
|
@@ -1074,46 +1096,46 @@ class flagAdmin{
|
|
1074 |
* @param $error_code
|
1075 |
* @return string $result
|
1076 |
*/
|
1077 |
-
|
1078 |
switch ($error_code) {
|
1079 |
case UPLOAD_ERR_INI_SIZE:
|
1080 |
-
return __('The uploaded file exceeds the upload_max_filesize directive in php.ini','
|
1081 |
case UPLOAD_ERR_FORM_SIZE:
|
1082 |
-
return __('The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form','
|
1083 |
case UPLOAD_ERR_PARTIAL:
|
1084 |
-
return __('The uploaded file was only partially uploaded','
|
1085 |
case UPLOAD_ERR_NO_FILE:
|
1086 |
-
return __('No file was uploaded','
|
1087 |
case UPLOAD_ERR_NO_TMP_DIR:
|
1088 |
-
return __('Missing a temporary folder','
|
1089 |
case UPLOAD_ERR_CANT_WRITE:
|
1090 |
-
return __('Failed to write file to disk','
|
1091 |
case UPLOAD_ERR_EXTENSION:
|
1092 |
-
return __('File upload stopped by extension','
|
1093 |
default:
|
1094 |
-
return __('Unknown upload error','
|
1095 |
}
|
1096 |
}
|
1097 |
|
1098 |
/**
|
1099 |
* Check the Quota under WPMU. Only needed for this case
|
1100 |
-
*
|
1101 |
* @class flagAdmin
|
1102 |
* @return bool $result
|
1103 |
*/
|
1104 |
-
|
1105 |
|
1106 |
if ( (IS_WPMU) && flagGallery::flag_wpmu_enable_function('wpmuQuotaCheck'))
|
1107 |
if( $error = upload_is_user_over_quota( false ) ) {
|
1108 |
-
flagGallery::show_error( __( 'Sorry, you have used your space allocation. Please delete some files to upload more files.','
|
1109 |
return true;
|
1110 |
}
|
1111 |
return false;
|
1112 |
}
|
1113 |
-
|
1114 |
/**
|
1115 |
* Set correct file permissions (taken from wp core)
|
1116 |
-
*
|
1117 |
* @class flagAdmin
|
1118 |
* @param string $filename
|
1119 |
* @return bool $result
|
@@ -1125,39 +1147,40 @@ class flagAdmin{
|
|
1125 |
$perms = $perms & 0000666;
|
1126 |
if ( @chmod($filename, $perms) )
|
1127 |
return true;
|
1128 |
-
|
1129 |
return false;
|
1130 |
}
|
1131 |
-
|
1132 |
/**
|
1133 |
* Check UID in folder and Script
|
1134 |
* Read http://www.php.net/manual/en/features.safe-mode.php to understand safe_mode
|
1135 |
-
*
|
1136 |
* @class flagAdmin
|
1137 |
* @param string $foldername
|
1138 |
* @return bool $result
|
1139 |
*/
|
1140 |
public static function check_safemode($foldername) {
|
1141 |
|
1142 |
-
if (
|
1143 |
-
|
1144 |
-
|
|
|
1145 |
$folder_uid = fileowner($foldername);
|
1146 |
|
1147 |
if ($script_uid != $folder_uid) {
|
1148 |
-
$message = sprintf(__('SAFE MODE Restriction in effect! You need to create the folder <strong>%s</strong> manually','
|
1149 |
-
$message .= '<br />' . sprintf(__('When safe_mode is on, PHP checks to see if the owner (%s) of the current script matches the owner (%s) of the file to be operated on by a file function or its directory','
|
1150 |
flagGallery::show_error($message);
|
1151 |
return false;
|
1152 |
}
|
1153 |
}
|
1154 |
-
|
1155 |
return true;
|
1156 |
}
|
1157 |
-
|
1158 |
/**
|
1159 |
* Capability check. Check is the ID fit's to the user_ID
|
1160 |
-
*
|
1161 |
* @class flagAdmin
|
1162 |
* @param int $check_ID is the user_id
|
1163 |
* @return bool $result
|
@@ -1165,17 +1188,17 @@ class flagAdmin{
|
|
1165 |
public static function can_manage_this_gallery($check_ID) {
|
1166 |
|
1167 |
global $user_ID, $wp_roles;
|
1168 |
-
|
1169 |
if ( !current_user_can('FlAG Manage others gallery') ) {
|
1170 |
// get the current user ID
|
1171 |
-
|
1172 |
-
|
1173 |
if ( $user_ID != $check_ID)
|
1174 |
return false;
|
1175 |
}
|
1176 |
return true;
|
1177 |
}
|
1178 |
-
|
1179 |
/**
|
1180 |
* Move images from one folder to another
|
1181 |
*
|
@@ -1190,51 +1213,51 @@ class flagAdmin{
|
|
1190 |
|
1191 |
if (!is_array($pic_ids))
|
1192 |
$pic_ids = array($pic_ids);
|
1193 |
-
|
1194 |
// Get destination gallery
|
1195 |
$destination = flagdb::find_gallery( $dest_gid );
|
1196 |
$dest_abspath = WINABSPATH . $destination->path;
|
1197 |
-
|
1198 |
if ( $destination == null ) {
|
1199 |
-
flagGallery::show_error(__('The destination gallery does not exist','
|
1200 |
return;
|
1201 |
}
|
1202 |
-
|
1203 |
// Check for folder permission
|
1204 |
if ( !is_writeable( $dest_abspath ) ) {
|
1205 |
-
$message = sprintf(__('Unable to write to directory %s. Is this directory writable by the server?', '
|
1206 |
flagGallery::show_error($message);
|
1207 |
-
return;
|
1208 |
}
|
1209 |
-
|
1210 |
// Get pictures
|
1211 |
$images = flagdb::find_images_in_list($pic_ids);
|
1212 |
|
1213 |
-
foreach ($images as $image) {
|
1214 |
-
|
1215 |
$i = 0;
|
1216 |
$tmp_prefix = '';
|
1217 |
-
|
1218 |
$destination_file_name = $image->filename;
|
1219 |
// check if the filename already exist, then we add a copy_ prefix
|
1220 |
while (file_exists( $dest_abspath . '/' . $destination_file_name)) {
|
1221 |
$tmp_prefix = 'copy_' . ($i++) . '_';
|
1222 |
$destination_file_name = $tmp_prefix . $image->filename;
|
1223 |
}
|
1224 |
-
|
1225 |
$destination_path = $dest_abspath . '/' . $destination_file_name;
|
1226 |
$destination_thumbnail = $dest_abspath . '/thumbs/thumbs_' . $destination_file_name;
|
1227 |
|
1228 |
// Move files
|
1229 |
if ( !@rename($image->imagePath, $destination_path) ) {
|
1230 |
-
$errors .= sprintf(__('Failed to move image %1$s to %2$s','
|
1231 |
'<strong>' . $image->filename . '</strong>', $destination_path) . '<br />';
|
1232 |
-
continue;
|
1233 |
}
|
1234 |
-
|
1235 |
// Move the thumbnail, if possible
|
1236 |
@rename($image->thumbPath, $destination_thumbnail);
|
1237 |
-
|
1238 |
// Change the gallery id in the database , maybe the filename
|
1239 |
if ( flagdb::update_image($image->pid, $dest_gid, $destination_file_name) )
|
1240 |
$count++;
|
@@ -1245,94 +1268,94 @@ class flagAdmin{
|
|
1245 |
flagGallery::show_error($errors);
|
1246 |
|
1247 |
$link = '<a href="' . admin_url() . 'admin.php?page=flag-manage-gallery&mode=edit&gid=' . $destination->gid . '" >' . $destination->title . '</a>';
|
1248 |
-
$messages = sprintf(__('Moved %1$s picture(s) to gallery : %2$s .','
|
1249 |
flagGallery::show_message($messages);
|
1250 |
|
1251 |
return;
|
1252 |
}
|
1253 |
-
|
1254 |
/**
|
1255 |
* Copy images to another gallery
|
1256 |
-
*
|
1257 |
* @class flagAdmin
|
1258 |
* @param array|int $pic_ids ID's of the images
|
1259 |
* @param int $dest_gid destination gallery
|
1260 |
* @return void
|
1261 |
*/
|
1262 |
public static function copy_images($pic_ids, $dest_gid) {
|
1263 |
-
|
1264 |
$errors = $messages = '';
|
1265 |
-
|
1266 |
if (!is_array($pic_ids))
|
1267 |
$pic_ids = array($pic_ids);
|
1268 |
-
|
1269 |
// Get destination gallery
|
1270 |
$destination = flagdb::find_gallery( $dest_gid );
|
1271 |
if ( $destination == null ) {
|
1272 |
-
flagGallery::show_error(__('The destination gallery does not exist','
|
1273 |
return;
|
1274 |
}
|
1275 |
-
|
1276 |
// Check for folder permission
|
1277 |
if (!is_writeable(WINABSPATH.$destination->path)) {
|
1278 |
-
$message = sprintf(__('Unable to write to directory %s. Is this directory writable by the server?', '
|
1279 |
flagGallery::show_error($message);
|
1280 |
-
return;
|
1281 |
}
|
1282 |
-
|
1283 |
// Get pictures
|
1284 |
$images = flagdb::find_images_in_list($pic_ids);
|
1285 |
$destination_path = WINABSPATH . $destination->path;
|
1286 |
-
|
1287 |
-
foreach ($images as $image) {
|
1288 |
// WPMU action
|
1289 |
if ( flagAdmin::check_quota() )
|
1290 |
return;
|
1291 |
-
|
1292 |
$i = 0;
|
1293 |
-
$tmp_prefix = '';
|
1294 |
$destination_file_name = $image->filename;
|
1295 |
while (file_exists($destination_path . '/' . $destination_file_name)) {
|
1296 |
$tmp_prefix = 'copy_' . ($i++) . '_';
|
1297 |
$destination_file_name = $tmp_prefix . $image->filename;
|
1298 |
}
|
1299 |
-
|
1300 |
$destination_file_path = $destination_path . '/' . $destination_file_name;
|
1301 |
$destination_thumb_file_path = $destination_path . '/' . $image->thumbFolder . $image->thumbPrefix . $destination_file_name;
|
1302 |
|
1303 |
// Copy files
|
1304 |
if ( !@copy($image->imagePath, $destination_file_path) ) {
|
1305 |
-
$errors .= sprintf(__('Failed to copy image %1$s to %2$s','
|
1306 |
$image->filename, $destination_file_path) . '<br />';
|
1307 |
-
continue;
|
1308 |
}
|
1309 |
-
|
1310 |
// Copy the thumbnail if possible
|
1311 |
@copy($image->thumbPath, $destination_thumb_file_path);
|
1312 |
-
|
1313 |
// Create new database entry for the image
|
1314 |
$new_pid = flagdb::insert_image( $destination->gid, $destination_file_name, $image->alttext, $image->description, $image->exclude);
|
1315 |
|
1316 |
-
if (!isset($new_pid)) {
|
1317 |
-
$errors .= sprintf(__('Failed to copy database row for picture %s','
|
1318 |
-
continue;
|
1319 |
}
|
1320 |
-
|
1321 |
if ( $tmp_prefix != '' ) {
|
1322 |
-
$messages .= sprintf(__('Image %1$s (%2$s) copied as image %3$s (%4$s) » The file already existed in the destination gallery.','
|
1323 |
$image->pid, $image->filename, $new_pid, $destination_file_name) . '<br />';
|
1324 |
} else {
|
1325 |
-
$messages .= sprintf(__('Image %1$s (%2$s) copied as image %3$s (%4$s)','
|
1326 |
$image->pid, $image->filename, $new_pid, $destination_file_name) . '<br />';
|
1327 |
}
|
1328 |
|
1329 |
}
|
1330 |
-
|
1331 |
// Finish by showing errors or success
|
1332 |
if ( $errors == '' ) {
|
1333 |
$link = '<a href="' . admin_url() . 'admin.php?page=flag-manage-gallery&mode=edit&gid=' . $destination->gid . '" >' . $destination->title . '</a>';
|
1334 |
-
$messages .= '<hr />' . sprintf(__('Copied %1$s picture(s) to gallery: %2$s .','
|
1335 |
-
}
|
1336 |
|
1337 |
if ( $messages != '' )
|
1338 |
flagGallery::show_message($messages);
|
@@ -1342,23 +1365,23 @@ class flagAdmin{
|
|
1342 |
|
1343 |
return;
|
1344 |
}
|
1345 |
-
|
1346 |
/**
|
1347 |
* Initate the Ajax operation
|
1348 |
-
*
|
1349 |
-
* @class flagAdmin
|
1350 |
* @param string $operation name of the function which should be executed
|
1351 |
* @param array $image_array
|
1352 |
* @param string $title name of the operation
|
1353 |
* @return string the javascript output
|
1354 |
*/
|
1355 |
public static function do_ajax_operation( $operation, $image_array, $title = '' ) {
|
1356 |
-
|
1357 |
if ( !is_array($image_array) || empty($image_array) )
|
1358 |
return;
|
1359 |
|
1360 |
$js_array = implode('","', $image_array);
|
1361 |
-
|
1362 |
// send out some JavaScript, which initate the ajax operation
|
1363 |
?>
|
1364 |
<script type="text/javascript">
|
@@ -1367,25 +1390,25 @@ class flagAdmin{
|
|
1367 |
|
1368 |
flagAjaxOptions = {
|
1369 |
operation: "<?php echo $operation; ?>",
|
1370 |
-
ids: Images,
|
1371 |
header: "<?php echo $title; ?>",
|
1372 |
maxStep: Images.length
|
1373 |
};
|
1374 |
-
|
1375 |
-
jQuery(document).ready( function(){
|
1376 |
flagProgressBar.init( flagAjaxOptions );
|
1377 |
flagAjax.init( flagAjaxOptions );
|
1378 |
} );
|
1379 |
</script>
|
1380 |
-
|
1381 |
<div id="progressbar_container" class="wrap"></div>
|
1382 |
-
|
1383 |
-
<?php
|
1384 |
}
|
1385 |
-
|
1386 |
/**
|
1387 |
* flagAdmin::set_gallery_preview() - define a preview pic after the first upload, can be changed in the gallery settings
|
1388 |
-
*
|
1389 |
* @class flagAdmin
|
1390 |
* @param int $galleryID
|
1391 |
* @return void
|
@@ -1395,7 +1418,7 @@ class flagAdmin{
|
|
1395 |
|
1396 |
$galleryID = intval($galleryID);
|
1397 |
$gallery = flagdb::find_gallery( $galleryID );
|
1398 |
-
|
1399 |
// in the case no preview image is setup, we do this now
|
1400 |
if ($gallery->previewpic == 0) {
|
1401 |
$firstImage = $wpdb->get_var($wpdb->prepare("SELECT `pid` FROM `{$wpdb->flagpictures}` WHERE `exclude` != 1 AND `galleryid` = '%d' ORDER by `pid` DESC limit 0,1", $galleryID));
|
@@ -1404,28 +1427,28 @@ class flagAdmin{
|
|
1404 |
wp_cache_delete($galleryID, 'flag_gallery');
|
1405 |
}
|
1406 |
}
|
1407 |
-
|
1408 |
return;
|
1409 |
}
|
1410 |
|
1411 |
/**
|
1412 |
* Return a JSON coded array of Image ids for a requested gallery
|
1413 |
-
*
|
1414 |
* @param int $galleryID
|
1415 |
* @return array (JSON)
|
1416 |
*/
|
1417 |
public static function get_image_ids( $galleryID ) {
|
1418 |
-
|
1419 |
if ( !function_exists('json_encode') )
|
1420 |
return(-2);
|
1421 |
-
|
1422 |
$gallery = flagdb::get_ids_from_gallery($galleryID, 'pid', 'ASC', false);
|
1423 |
|
1424 |
header('Content-Type: text/plain; charset=' . get_option('blog_charset'), true);
|
1425 |
$output = json_encode($gallery);
|
1426 |
-
|
1427 |
return $output;
|
1428 |
}
|
1429 |
-
|
1430 |
} // END class flagAdmin
|
1431 |
}
|
19 |
*/
|
20 |
public static function create_gallery($gallery, $defaultpath, $output = true) {
|
21 |
global $wpdb, $user_ID;
|
22 |
+
|
23 |
// get the current user ID
|
24 |
+
wp_get_current_user();
|
25 |
|
26 |
$description = '';
|
27 |
$status = 0;
|
41 |
$flagpath = $defaultpath . $galleryname;
|
42 |
$flagRoot = WINABSPATH . $defaultpath;
|
43 |
$txt = '';
|
44 |
+
|
45 |
// No gallery name ?
|
46 |
+
if (empty($galleryname)) {
|
47 |
+
if ($output) flagGallery::show_error( __('No valid gallery name!', 'flash-album-gallery') );
|
48 |
return false;
|
49 |
}
|
50 |
+
|
51 |
// check for main folder
|
52 |
if ( !is_dir($flagRoot) ) {
|
53 |
if ( !wp_mkdir_p( $flagRoot ) ) {
|
54 |
+
$txt = __('Directory', 'flash-album-gallery').' <strong>' . $defaultpath . '</strong> '.__('didn\'t exist. Please create first the main gallery folder ', 'flash-album-gallery').'!<br />';
|
55 |
+
$txt .= __('Check this link, if you didn\'t know how to set the permission :', 'flash-album-gallery').' <a href="http://codex.wordpress.org/Changing_File_Permissions">http://codex.wordpress.org/Changing_File_Permissions</a> ';
|
56 |
if ($output) flagGallery::show_error($txt);
|
57 |
return false;
|
58 |
}
|
59 |
}
|
60 |
|
61 |
+
// check for permission settings, Safe mode limitations are not taken into account.
|
62 |
if ( !is_writeable( $flagRoot ) ) {
|
63 |
+
$txt = __('Directory', 'flash-album-gallery').' <strong>' . $defaultpath . '</strong> '.__('is not writeable !', 'flash-album-gallery').'<br />';
|
64 |
+
$txt .= __('Check this link, if you didn\'t know how to set the permission :', 'flash-album-gallery').' <a href="http://codex.wordpress.org/Changing_File_Permissions">http://codex.wordpress.org/Changing_File_Permissions</a> ';
|
65 |
if ($output) flagGallery::show_error($txt);
|
66 |
return false;
|
67 |
}
|
68 |
+
|
69 |
// 1. Create new gallery folder
|
70 |
if ( !is_dir(WINABSPATH . $flagpath) ) {
|
71 |
+
if ( !wp_mkdir_p (WINABSPATH . $flagpath) )
|
72 |
+
$txt = __('Unable to create directory ', 'flash-album-gallery').$flagpath.'!<br />';
|
73 |
}
|
74 |
+
|
75 |
// 2. Check folder permission
|
76 |
if ( !is_writeable(WINABSPATH . $flagpath ) )
|
77 |
+
$txt .= __('Directory', 'flash-album-gallery').' <strong>'.$flagpath.'</strong> '.__('is not writeable !', 'flash-album-gallery').'<br />';
|
78 |
|
79 |
// 3. Now create "thumbs" folder inside
|
80 |
+
if ( !is_dir(WINABSPATH . $flagpath . '/thumbs') ) {
|
81 |
+
if ( !wp_mkdir_p ( WINABSPATH . $flagpath . '/thumbs') )
|
82 |
+
$txt .= __('Unable to create directory ', 'flash-album-gallery').' <strong>' . $flagpath . '/thumbs !</strong>';
|
83 |
}
|
84 |
+
|
85 |
// 4. Now create "webview" folder inside
|
86 |
if ( !is_dir(WINABSPATH . $flagpath . '/webview') ) {
|
87 |
if ( !wp_mkdir_p ( WINABSPATH . $flagpath . '/webview') )
|
88 |
+
$txt .= __('Unable to create directory ', 'flash-album-gallery').' <strong>' . $flagpath . '/webview !</strong>';
|
89 |
}
|
90 |
|
91 |
+
if (FLAG_SAFE_MODE) {
|
92 |
+
$help = __('The server setting Safe-Mode is on !', 'flash-album-gallery');
|
93 |
+
$help .= '<br />'.__('If you have problems, please create directory', 'flash-album-gallery').' <strong>' . $flagpath . '</strong> ';
|
94 |
+
$help .= __('and the thumbnails directory', 'flash-album-gallery').' <strong>' . $flagpath . '/thumbs</strong> '.__('with permission 777 manually !', 'flash-album-gallery');
|
95 |
if ($output) flagGallery::show_message($help);
|
96 |
}
|
97 |
+
|
98 |
+
// show an error message
|
99 |
if ( !empty($txt) ) {
|
100 |
+
if (FLAG_SAFE_MODE) {
|
101 |
// for safe_mode , better delete folder, both folder must be created manually
|
102 |
@rmdir(WINABSPATH . $flagpath . '/thumbs');
|
103 |
@rmdir(WINABSPATH . $flagpath);
|
105 |
if ($output) flagGallery::show_error($txt);
|
106 |
return false;
|
107 |
}
|
108 |
+
|
109 |
$result = $wpdb->get_var($wpdb->prepare("SELECT `name` FROM `{$wpdb->flaggallery}` WHERE `name` = '%s' ", $galleryname));
|
110 |
+
|
111 |
if ($result) {
|
112 |
+
if ($output) flagGallery::show_error( _n( 'Gallery', 'Galleries', 1, 'flash-album-gallery' ) .' <strong>' . $galleryname . '</strong> '.__('already exists', 'flash-album-gallery'));
|
113 |
return true;
|
114 |
} else {
|
115 |
if(empty($user_ID)){
|
122 |
do_action('flag_created_new_gallery', $gallery_id);
|
123 |
|
124 |
if ($result) {
|
125 |
+
$message = __('Gallery \'%1$s\' successfully created.<br/>You can show this gallery with the tag %2$s.<br/>','flash-album-gallery');
|
126 |
$message = sprintf($message, esc_html(stripcslashes($gallerytitle)), '[flagallery gid=' . $gallery_id . ']');
|
127 |
$message .= '<a href="' . admin_url() . 'admin.php?page=flag-manage-gallery&mode=edit&gid=' . $gallery_id . '" >';
|
128 |
+
$message .= __('Edit gallery','flash-album-gallery');
|
129 |
$message .= '</a>';
|
130 |
+
|
131 |
+
if ($output) flagGallery::show_message($message);
|
132 |
}
|
133 |
// return only the id if defined
|
134 |
if ($gallery_id)
|
135 |
return $gallery_id;
|
136 |
|
137 |
return true;
|
138 |
+
}
|
139 |
}
|
140 |
|
141 |
/**
|
147 |
* @return void
|
148 |
*/
|
149 |
public static function import_gallery($galleryfolder) {
|
150 |
+
|
151 |
global $wpdb, $user_ID;
|
152 |
|
153 |
// get the current user ID
|
154 |
+
wp_get_current_user();
|
155 |
+
|
156 |
$created_msg = '';
|
157 |
+
|
158 |
// remove trailing slash at the end, if somebody use it
|
159 |
$galleryfolder = str_replace('../','', $galleryfolder );
|
160 |
$galleryfolder = rtrim($galleryfolder, '/');
|
161 |
$gallerypath = WINABSPATH . $galleryfolder;
|
162 |
+
|
163 |
if (!is_dir($gallerypath)) {
|
164 |
+
flagGallery::show_error(__('Directory', 'flash-album-gallery').' <strong>'.esc_html($gallerypath).'</strong> '.__('doesn`t exist!', 'flash-album-gallery').' '.__('Or imported folder name contains special characters.', 'flash-album-gallery'));
|
165 |
return ;
|
166 |
}
|
167 |
+
|
168 |
// read list of images
|
169 |
$new_imageslist = flagAdmin::scandir($gallerypath);
|
170 |
if (empty($new_imageslist)) {
|
171 |
+
flagGallery::show_message(__('Directory', 'flash-album-gallery').' <strong>'.esc_html($gallerypath).'</strong> '.__('contains no pictures', 'flash-album-gallery'));
|
172 |
return;
|
173 |
}
|
174 |
+
|
175 |
// check & create thumbnail folder
|
176 |
if ( !flagGallery::create_thumbnail_folder($gallerypath) )
|
177 |
return;
|
178 |
+
|
179 |
+
// take folder name as gallery name
|
180 |
$galleryname = basename($galleryfolder);
|
181 |
|
182 |
// check for existing gallery folder
|
185 |
if (!$gallery_id) {
|
186 |
$result = $wpdb->query( $wpdb->prepare("INSERT INTO {$wpdb->flaggallery} (name, path, title, author) VALUES (%s, %s, %s, %s)", $galleryname, $galleryfolder, $galleryname , $user_ID) );
|
187 |
if (!$result) {
|
188 |
+
flagGallery::show_error(__('Database error. Could not add gallery!','flash-album-gallery'));
|
189 |
return;
|
190 |
}
|
191 |
+
$created_msg = _n( 'Gallery', 'Galleries', 1, 'flash-album-gallery' ) . ' <strong>' . $galleryname . '</strong> ' . __('successfully created!','flash-album-gallery') . '<br />';
|
192 |
$gallery_id = $wpdb->insert_id; // get index_id
|
193 |
}
|
194 |
+
|
195 |
// Look for existing image list
|
196 |
$old_imageslist = $wpdb->get_col($wpdb->prepare("SELECT filename FROM {$wpdb->flagpictures} WHERE galleryid = %d ", $gallery_id));
|
197 |
+
|
198 |
// if no images are there, create empty array
|
199 |
+
if ($old_imageslist == NULL)
|
200 |
$old_imageslist = array();
|
201 |
+
|
202 |
// check difference
|
203 |
$new_images = array_diff($new_imageslist, $old_imageslist);
|
204 |
+
|
205 |
// all images must be valid files
|
206 |
foreach($new_images as $key => $picture) {
|
207 |
if (!@getimagesize($gallerypath . '/' . $picture) ) {
|
208 |
unset($new_images[$key]);
|
209 |
+
@unlink($gallerypath . '/' . $picture);
|
210 |
}
|
211 |
}
|
212 |
+
|
213 |
+
// add images to database
|
214 |
$image_ids = flagAdmin::add_Images($gallery_id, $new_images);
|
215 |
+
|
216 |
//add the preview image if needed
|
217 |
flagAdmin::set_gallery_preview ( $gallery_id );
|
218 |
|
219 |
// now create thumbnails
|
220 |
+
flagAdmin::do_ajax_operation( 'create_thumbnail' , $image_ids, __('Create new thumbnails','flash-album-gallery') );
|
221 |
+
|
222 |
//TODO:Message will not shown, because AJAX routine require more time, message should be passed to AJAX
|
223 |
+
flagGallery::show_message( $created_msg . count($image_ids) .__(' picture(s) successfully added','flash-album-gallery') );
|
224 |
+
|
225 |
return;
|
226 |
|
227 |
}
|
242 |
$folder = rtrim($folder, '/');
|
243 |
$path = WINABSPATH . $folder;
|
244 |
if (!is_dir($path)) {
|
245 |
+
echo '<p class="message">'.__('Directory', 'flash-album-gallery').' <strong>'.$path.'</strong> '.__('doesn`t exist!', 'flash-album-gallery').' '.__('Or imported folder name contains special characters.', 'flash-album-gallery').'</p>';
|
246 |
return ;
|
247 |
}
|
248 |
// read list of files
|
249 |
+
$ext = array('mp4','ogg','webm','flv');
|
250 |
$new_filelist = flagAdmin::scandir($path, $ext);
|
251 |
if (empty($new_filelist)) {
|
252 |
+
echo '<p class="message">'.__('Directory', 'flash-album-gallery').' <strong>'.$path.'</strong> '.__('does not contain video files', 'flash-album-gallery').'</p>';
|
253 |
return;
|
254 |
}
|
255 |
$i=0;
|
258 |
$filename = $path . '/' . $file;
|
259 |
$id = flagAdmin::handle_import_file($filename);
|
260 |
if ( is_wp_error($id) ) {
|
261 |
+
$created_msg .= '<p>' . sprintf(__('<em>%s</em> was <strong>not</strong> imported due to an error: %s', 'flash-album-gallery'), $file, $id->get_error_message() ) . '</p>';
|
262 |
} else {
|
263 |
$i++;
|
264 |
+
$created_msg .= '<p>' . sprintf(__('<em>%s</em> has been added to Media library', 'flash-album-gallery'), $file) . '</p>';
|
265 |
}
|
266 |
}
|
267 |
+
$created_msg .= '<p class="message">'.$i.__(' file(s) successfully added','flash-album-gallery').'</p><div class="hidden">'.$created_msg.'</div>';
|
268 |
echo $created_msg;
|
269 |
}
|
270 |
|
283 |
$folder = rtrim($folder, '/');
|
284 |
$path = WINABSPATH . $folder;
|
285 |
if (!is_dir($path)) {
|
286 |
+
echo '<p class="message">'.__('Directory', 'flash-album-gallery').' <strong>'.$path.'</strong> '.__('doesn`t exist!', 'flash-album-gallery').' '.__('Or imported folder name contains special characters.', 'flash-album-gallery').'</p>';
|
287 |
return ;
|
288 |
}
|
289 |
// read list of files
|
290 |
+
$ext = array('mp3', 'ogg', 'wav');
|
291 |
$new_filelist = flagAdmin::scandir($path, $ext);
|
292 |
if (empty($new_filelist)) {
|
293 |
+
echo '<p class="message">'.__('Directory', 'flash-album-gallery').' <strong>'.$path.'</strong> '.__('does not contain audio files', 'flash-album-gallery').'</p>';
|
294 |
return;
|
295 |
}
|
296 |
$i=0;
|
299 |
$filename = $path . '/' . $file;
|
300 |
$id = flagAdmin::handle_import_file($filename);
|
301 |
if ( is_wp_error($id) ) {
|
302 |
+
$created_msg .= '<p>' . sprintf(__('<em>%s</em> was <strong>not</strong> imported due to an error: %s', 'flash-album-gallery'), $file, $id->get_error_message() ) . '</p>';
|
303 |
} else {
|
304 |
$i++;
|
305 |
+
$created_msg .= '<p>' . sprintf(__('<em>%s</em> has been added to Media library', 'flash-album-gallery'), $file) . '</p>';
|
306 |
}
|
307 |
}
|
308 |
+
$created_msg .= '<p class="message">'.$i.__(' file(s) successfully added','flash-album-gallery').'</p><div class="hidden">'.$created_msg.'</div>';
|
309 |
echo $created_msg;
|
310 |
}
|
311 |
|
324 |
$folder = rtrim($folder, '/');
|
325 |
$path = WINABSPATH . $folder;
|
326 |
if (!is_dir($path)) {
|
327 |
+
echo '<p class="message">'.__('Directory', 'flash-album-gallery').' <strong>'.$path.'</strong> '.__('doesn`t exist!', 'flash-album-gallery').' '.__('Or imported folder name contains special characters.', 'flash-album-gallery').'</p>';
|
328 |
return false;
|
329 |
}
|
330 |
// read list of files
|
331 |
$new_filelist = flagAdmin::scandir($path);
|
332 |
if (empty($new_filelist)) {
|
333 |
+
echo '<p class="message">'.__('Directory', 'flash-album-gallery').' <strong>'.$path.'</strong> '.__('does not contain image files', 'flash-album-gallery').'</p>';
|
334 |
return false;
|
335 |
}
|
336 |
+
$created_msg .= '<div class="message"><p>'.count($new_filelist).' '.__('image(s) in the folder','flash-album-gallery').':</p><div class="flag_crunching"><div class="flag_progress"><span class="flag_complete"></span><span class="txt">'.__('Crunching...','flash-album-gallery').'</span></div></div></div>';
|
337 |
echo $created_msg;
|
338 |
return $new_filelist;
|
339 |
}
|
356 |
/** @var $type
|
357 |
* @var $ext */
|
358 |
extract( $wp_filetype );
|
359 |
+
|
360 |
if ( ( !$type || !$ext ) && !current_user_can( 'unfiltered_upload' ) )
|
361 |
return new WP_Error('wrong_file_type', __( 'File type does not meet security guidelines. Try another.' ) ); //A WP-core string..
|
362 |
+
|
363 |
$match = preg_match('|^' . preg_quote(str_replace('\\', '/', $uploads['basedir'])) . '(.*)$|i', $file, $mat);
|
364 |
//Is the file allready in the uploads folder?
|
365 |
if( $match ) {
|
383 |
$post_date = date( 'Y-m-d H:i:s', $time);
|
384 |
$post_date_gmt = gmdate( 'Y-m-d H:i:s', $time);
|
385 |
}
|
386 |
+
} else {
|
387 |
$filename = wp_unique_filename( $uploads['path'], basename($file));
|
388 |
|
389 |
// copy the file to the uploads dir
|
390 |
$new_file = $uploads['path'] . '/' . $filename;
|
391 |
+
if ( false === @copy( $file, $new_file ) ){
|
392 |
+
wp_die(sprintf(__('The selected file could not be copied to %s.', 'flash-album-gallery'), $uploads['path']));
|
393 |
+
}
|
394 |
|
395 |
// Set correct file permissions
|
396 |
$stat = stat( dirname( $new_file ));
|
441 |
$data = wp_generate_attachment_metadata( $id, $new_file );
|
442 |
wp_update_attachment_metadata( $id, $data );
|
443 |
if( !$match && isset($_POST['delete_files']) ) {
|
444 |
+
@unlink($file);
|
445 |
}
|
446 |
}
|
447 |
|
459 |
public static function scandir($dirname = '.', $ext = array()) {
|
460 |
// thx to php.net :-)
|
461 |
if(empty($ext))
|
462 |
+
$ext = array('jpeg', 'jpg', 'png', 'gif');
|
463 |
+
$files = array();
|
464 |
+
if($handle = opendir($dirname)) {
|
465 |
+
while(false !== ($file = readdir($handle)))
|
466 |
+
for($i=0;$i<sizeof($ext);$i++)
|
467 |
+
if(stristr($file, '.' . $ext[$i]))
|
468 |
+
$files[] = utf8_encode($file);
|
469 |
+
closedir($handle);
|
470 |
+
}
|
471 |
sort($files);
|
472 |
+
return ($files);
|
473 |
+
}
|
474 |
+
|
475 |
/**
|
476 |
* flagAdmin::createThumbnail() - function to create or recreate a thumbnail
|
477 |
+
*
|
478 |
* @param object | int $image contain all information about the image or the id
|
479 |
* @return string result code
|
480 |
*/
|
481 |
public static function create_thumbnail($image) {
|
482 |
+
|
483 |
global $flag;
|
484 |
|
485 |
if ( is_numeric($image) )
|
486 |
$image = flagdb::find_image( $image );
|
487 |
|
488 |
if ( !is_object($image) )
|
489 |
+
return __('Object didn\'t contain correct data','flash-album-gallery');
|
490 |
|
491 |
$dest_path = dirname($image->webimagePath);
|
492 |
if(!is_dir($dest_path)){
|
496 |
|
497 |
if(! class_exists('flag_Thumbnail'))
|
498 |
require_once( flagGallery::graphic_library() );
|
499 |
+
|
500 |
// check for existing thumbnail
|
501 |
if (file_exists($image->thumbPath))
|
502 |
if (!is_writable($image->thumbPath))
|
503 |
+
return $image->filename . __(' is not writeable ','flash-album-gallery');
|
504 |
|
505 |
$thumb = new flag_Thumbnail($image->imagePath, TRUE);
|
506 |
$img_size = @getimagesize ( $image->imagePath );
|
507 |
|
508 |
// skip if file is not there
|
509 |
if (!$thumb->error) {
|
510 |
+
$thumb->resize($flag->options['thumbWidth'],$flag->options['thumbHeight']);
|
511 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
512 |
// save the new thumbnail
|
513 |
$thumb->save($image->thumbPath, $flag->options['thumbQuality']);
|
514 |
flagAdmin::chmod ($image->thumbPath);
|
516 |
//read the new sizes
|
517 |
$new_size = @getimagesize ( $image->thumbPath );
|
518 |
$size['width'] = $new_size[0];
|
519 |
+
$size['height'] = $new_size[1];
|
520 |
+
|
521 |
// add them to the database
|
522 |
flagdb::update_image_meta($image->pid, array( 'thumbnail' => $size) );
|
523 |
}
|
524 |
+
|
525 |
$thumb->destruct();
|
526 |
+
|
527 |
if ( !empty($thumb->errmsg) )
|
528 |
return $image->filename . ' (Error : '.$thumb->errmsg .')';
|
529 |
|
532 |
flagAdmin::webview_image($image);
|
533 |
|
534 |
// success
|
535 |
+
return '1';
|
536 |
}
|
537 |
+
|
538 |
/**
|
539 |
* flagAdmin::resize_image() - create a new image, based on the height /width
|
540 |
+
*
|
541 |
* @class flagAdmin
|
542 |
* @param object | int $image contain all information about the image or the id
|
543 |
+
* @param integer $width optional
|
544 |
* @param integer $height optional
|
545 |
* @return string result code
|
546 |
*/
|
547 |
public static function resize_image($image, $width = 0, $height = 0) {
|
548 |
+
|
549 |
global $flag;
|
550 |
+
|
551 |
if(! class_exists('flag_Thumbnail'))
|
552 |
require_once( flagGallery::graphic_library() );
|
553 |
|
554 |
if ( is_numeric($image) )
|
555 |
$image = flagdb::find_image( $image );
|
556 |
+
|
557 |
+
if ( !is_object($image) )
|
558 |
+
return __('Object didn\'t contain correct data','flash-album-gallery');
|
559 |
|
560 |
// before we start we import the meta data to database (required for uploads before V0.40)
|
561 |
flagAdmin::maybe_import_meta( $image->pid );
|
563 |
// if no parameter is set, take global settings
|
564 |
$width = ($width == 0) ? $flag->options['imgWidth'] : $width;
|
565 |
$height = ($height == 0) ? $flag->options['imgHeight'] : $height;
|
566 |
+
|
567 |
if (!is_writable($image->imagePath))
|
568 |
+
return ' <strong>' . $image->filename . __(' is not writeable','flash-album-gallery') . '</strong>';
|
569 |
+
|
570 |
$file = new flag_Thumbnail($image->imagePath, TRUE);
|
571 |
|
572 |
// skip if file is not there
|
588 |
return '1';
|
589 |
}
|
590 |
|
591 |
+
/**
|
592 |
+
* flagAdmin::webview_image() - create a new image, based on the height /width
|
593 |
+
*
|
594 |
+
* @class flagAdmin
|
595 |
+
*
|
596 |
+
* @param object | int $image contain all information about the image or the id
|
597 |
+
* @param bool $return_size
|
598 |
+
*
|
599 |
+
* @return string result code
|
600 |
+
*/
|
601 |
+
public static function webview_image($image, $return_size = false) {
|
602 |
|
603 |
global $flag;
|
604 |
|
606 |
$image = flagdb::find_image( $image );
|
607 |
|
608 |
if ( !is_object($image) )
|
609 |
+
return __('Object didn\'t contain correct data','flash-album-gallery');
|
610 |
|
611 |
$img_size = @getimagesize ( $image->imagePath );
|
612 |
+
$webviewsize = '0';
|
613 |
+
$dest_path = dirname($image->webimagePath);
|
614 |
if(flagGallery::create_webview_folder(dirname($image->imagePath))){
|
615 |
if (! is_writable( $dest_path ) ) {
|
616 |
@chmod( $dest_path, 0755 );
|
617 |
}
|
618 |
|
619 |
if (file_exists($image->webimagePath)){
|
620 |
+
$webviewsize = @getimagesize ( $image->webimagePath );
|
621 |
+
flagdb::update_image_meta($image->pid, array( 'webview' => $webviewsize) );
|
622 |
+
if($return_size){
|
623 |
+
return $webviewsize;
|
624 |
+
} else {
|
625 |
+
return '1';
|
626 |
+
}
|
627 |
}
|
628 |
|
629 |
$imgquality = $flag->options['imgQuality'];
|
630 |
+
$max_width = ($img_size[0] < 2000)? $img_size[0] : 2000;
|
631 |
+
$max_height = ($img_size[1] < 2000)? $img_size[1] : 2000;
|
632 |
if( function_exists('wp_get_image_editor') ) {
|
633 |
$editor = wp_get_image_editor( $image->imagePath );
|
634 |
+
if ( ! is_wp_error( $editor ) ) {
|
635 |
+
$editor->set_quality( $imgquality );
|
636 |
+
$editor->resize( $max_width, $max_height, 0 );
|
637 |
+
$editor->save( $image->webimagePath );
|
638 |
+
if(@filesize($image->webimagePath) > @filesize($image->imagePath)) {
|
639 |
+
@copy($image->imagePath, $image->webimagePath);
|
640 |
+
}
|
641 |
+
$webviewsize = @getimagesize ( $image->webimagePath );
|
642 |
+
flagdb::update_image_meta($image->pid, array( 'webview' => $webviewsize) );
|
643 |
+
|
644 |
+
do_action('flag_image_optimized', $image);
|
645 |
+
}
|
646 |
}
|
647 |
}
|
648 |
|
649 |
+
if($return_size){
|
650 |
+
return $webviewsize;
|
651 |
+
} else {
|
652 |
+
return '1';
|
653 |
+
}
|
654 |
}
|
655 |
|
656 |
/**
|
664 |
*/
|
665 |
public static function add_Images($galleryID, $imageslist, $name2alt = false) {
|
666 |
global $wpdb;
|
667 |
+
|
668 |
$alttext = '';
|
669 |
$image_ids = array();
|
670 |
+
|
671 |
if ( is_array($imageslist) ) {
|
672 |
foreach($imageslist as $picture) {
|
673 |
if($name2alt) {
|
675 |
$path_parts = pathinfo( $picture );
|
676 |
$alttext = ( !isset($path_parts['filename']) ) ? substr($path_parts['basename'], 0,strpos($path_parts['basename'], '.')) : $path_parts['filename'];
|
677 |
}
|
678 |
+
// save it to the database
|
679 |
$result = $wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->flagpictures (galleryid, filename, alttext, exclude) VALUES (%s, %s, %s, 0)", $galleryID, $picture, $alttext) );
|
680 |
// and give me the new id
|
681 |
$pic_id = (int) $wpdb->insert_id;
|
682 |
+
if ($result)
|
683 |
$image_ids[] = $pic_id;
|
684 |
|
685 |
// add the metadata
|
688 |
// action hook for post process after the image is added to the database
|
689 |
$image = array( 'id' => $pic_id, 'filename' => $picture, 'galleryID' => $galleryID);
|
690 |
do_action('flag_added_new_image', $image);
|
691 |
+
|
692 |
+
}
|
693 |
} // is_array
|
694 |
+
|
695 |
return $image_ids;
|
696 |
+
|
697 |
}
|
698 |
|
699 |
/**
|
700 |
* Import some metadata into the database (if avialable)
|
701 |
+
*
|
702 |
* @class flagAdmin
|
703 |
* @param array|int $imagesIds
|
704 |
* @return bool
|
705 |
*/
|
706 |
public static function import_MetaData($imagesIds) {
|
707 |
+
|
708 |
global $wpdb;
|
709 |
+
|
710 |
require_once(FLAG_ABSPATH . 'lib/image.php');
|
711 |
+
|
712 |
if (!is_array($imagesIds))
|
713 |
$imagesIds = array($imagesIds);
|
714 |
+
|
715 |
foreach($imagesIds as $imageID) {
|
716 |
$image = flagdb::find_image($imageID);
|
717 |
if (!$image->error) {
|
718 |
|
719 |
$meta = flagAdmin::get_MetaData($image->pid);
|
720 |
+
|
721 |
// get the title
|
722 |
$alttext = empty( $meta['title'] ) ? $image->alttext : $meta['title'];
|
723 |
// get the caption / description field
|
727 |
// update database
|
728 |
$result = $wpdb->query( $wpdb->prepare("UPDATE $wpdb->flagpictures SET alttext = %s, description = %s, imagedate = %s WHERE pid = %d", $alttext, $description, $timestamp, $image->pid) );
|
729 |
if ($result === false)
|
730 |
+
return ' <strong>' . $image->filename . ' ' . __('(Error : Couldn\'t not update data base)', 'flash-album-gallery') . '</strong>';
|
731 |
+
|
732 |
//this flag will inform us the import is already one time performed
|
733 |
+
$meta['common']['saved'] = true;
|
734 |
$result = flagdb::update_image_meta($image->pid, $meta['common']);
|
735 |
+
|
736 |
if ($result === false)
|
737 |
+
return ' <strong>' . $image->filename . ' ' . __('(Error : Couldn\'t not update meta data)', 'flash-album-gallery') . '</strong>';
|
738 |
} else
|
739 |
+
return ' <strong>' . $image->filename . ' ' . __('(Error : Couldn\'t not find image)', 'flash-album-gallery') . '</strong>';// error check
|
740 |
}
|
741 |
+
|
742 |
return '1';
|
743 |
+
|
744 |
}
|
745 |
|
746 |
/**
|
747 |
* Copy some metadata into the image description (if avialable)
|
748 |
+
*
|
749 |
* @class flagAdmin
|
750 |
* @param array|int $imagesIds
|
751 |
* @return bool
|
752 |
*/
|
753 |
public static function copy_MetaData($imagesIds) {
|
754 |
+
|
755 |
global $wpdb;
|
756 |
|
757 |
/** @var $meta */
|
760 |
|
761 |
if (!is_array($imagesIds))
|
762 |
$imagesIds = array($imagesIds);
|
763 |
+
|
764 |
foreach($imagesIds as $imageID) {
|
765 |
+
|
766 |
$image = flagdb::find_image($imageID);
|
767 |
if (!$image->error) {
|
768 |
/** @var $makedescription
|
769 |
* @var $timestamp */
|
770 |
require_once(FLAG_ABSPATH . 'admin/grab_meta.php');
|
771 |
+
|
772 |
// get the title
|
773 |
$alttext = empty( $alttext ) ? $image->alttext : $meta['title'];
|
774 |
if($alttext) $alttext = '<font size="16"><b>'.$alttext."</b></font>\n";
|
780 |
// update database
|
781 |
$result = $wpdb->query( $wpdb->prepare("UPDATE $wpdb->flagpictures SET alttext = %s, description = %s, imagedate = %s WHERE pid = %d", '', $makedescription, $timestamp, $image->pid) );
|
782 |
if ($result === false)
|
783 |
+
return ' <strong>' . $image->filename . ' ' . __('(Error : Couldn\'t not update data base)', 'flash-album-gallery') . '</strong>';
|
784 |
+
|
785 |
} else
|
786 |
+
return ' <strong>' . $image->filename . ' ' . __('(Error : Couldn\'t not find image)', 'flash-album-gallery') . '</strong>';// error check
|
787 |
}
|
788 |
+
|
789 |
return '1';
|
790 |
+
|
791 |
}
|
792 |
|
793 |
/**
|
799 |
* @return array metadata
|
800 |
*/
|
801 |
public static function get_MetaData($id) {
|
802 |
+
|
803 |
require_once(FLAG_ABSPATH . 'lib/meta.php');
|
804 |
+
|
805 |
$meta = array();
|
806 |
|
807 |
$pdata = new flagMeta( $id );
|
808 |
|
809 |
+
$meta['title'] = trim ( $pdata->get_META('title') );
|
810 |
+
$meta['caption'] = trim ( $pdata->get_META('caption') );
|
811 |
$meta['keywords'] = trim ( $pdata->get_META('keywords') );
|
812 |
$meta['timestamp'] = $pdata->get_date_time();
|
813 |
// this contain other useful meta information
|
814 |
$meta['common'] = $pdata->get_common_meta();
|
815 |
+
|
816 |
return $meta;
|
817 |
+
|
818 |
}
|
819 |
|
820 |
/**
|
821 |
* Maybe import some meta data to the database. The functions checks the flag 'saved'
|
822 |
* and if based on compat reason (pre V0.40) we save then some meta datas to the database
|
823 |
+
*
|
824 |
* @param int $id
|
825 |
* @return mixed result
|
826 |
*/
|
827 |
public static function maybe_import_meta( $id ) {
|
828 |
+
|
829 |
require_once(FLAG_ABSPATH . 'lib/meta.php');
|
830 |
|
831 |
$meta_obj = new flagMeta( $id );
|
832 |
+
|
833 |
if ( $meta_obj->image->meta_data['saved'] != true ) {
|
834 |
$common = $meta_obj->get_common_meta();
|
835 |
//this flag will inform us that the import is already one time performed
|
837 |
$result = flagdb::update_image_meta($id, $common);
|
838 |
} else
|
839 |
return false;
|
840 |
+
|
841 |
+
return $result;
|
842 |
|
843 |
}
|
844 |
|
845 |
/**
|
846 |
* flagAdmin::getOnlyImages()
|
847 |
+
*
|
848 |
* @class flagAdmin
|
849 |
* @param mixed $p_event
|
850 |
* @param mixed $p_header
|
851 |
* @return bool
|
852 |
*/
|
853 |
public static function getOnlyImages($p_event, $p_header) {
|
854 |
+
|
855 |
$info = pathinfo($p_header['filename']);
|
856 |
// check for extension
|
857 |
+
$ext = array('jpeg', 'jpg', 'png', 'gif');
|
858 |
if ( in_array( strtolower($info['extension']), $ext) ) {
|
859 |
// For MAC skip the ".image" files
|
860 |
+
if ($info['basename']{0} == '.' )
|
861 |
return 0;
|
862 |
+
else
|
863 |
return 1;
|
864 |
}
|
865 |
// ----- all other files are skipped
|
870 |
|
871 |
/**
|
872 |
* Function for uploading of images via the upload form
|
873 |
+
*
|
874 |
* @class flagAdmin
|
875 |
* @return void
|
876 |
*/
|
877 |
public static function upload_images() {
|
878 |
+
|
879 |
global $wpdb;
|
880 |
+
|
881 |
// WPMU action
|
882 |
if (flagAdmin::check_quota())
|
883 |
return;
|
889 |
$galleryID = (int) $_POST['galleryselect'];
|
890 |
|
891 |
if ($galleryID == 0) {
|
892 |
+
flagGallery::show_error(__('No gallery selected !','flash-album-gallery'));
|
893 |
+
return;
|
894 |
}
|
895 |
|
896 |
+
// get the path to the gallery
|
897 |
$gallery = flagdb::find_gallery($galleryID);
|
898 |
|
899 |
if ( empty($gallery->path) ){
|
900 |
+
flagGallery::show_error(__('Failure in database, no gallery path set !','flash-album-gallery'));
|
901 |
return;
|
902 |
+
}
|
903 |
+
|
904 |
// read list of images
|
905 |
$dirlist = flagAdmin::scandir(WINABSPATH.$gallery->path);
|
906 |
+
|
907 |
$imagefiles = $_FILES['imagefiles'];
|
908 |
+
|
909 |
if (is_array($imagefiles)) {
|
910 |
foreach ($imagefiles['name'] as $key => $value) {
|
911 |
|
912 |
// look only for uploded files
|
913 |
if ($imagefiles['error'][$key] == 0) {
|
914 |
+
|
915 |
$temp_file = $imagefiles['tmp_name'][$key];
|
916 |
+
|
917 |
//clean filename and extract extension
|
918 |
$filepart = flagGallery::fileinfo( $imagefiles['name'][$key] );
|
919 |
$filename = $filepart['basename'];
|
920 |
+
|
921 |
// check for allowed extension and if it's an image file
|
922 |
$ext = array('jpg', 'jpeg', 'png', 'gif');
|
923 |
if ( !in_array(strtolower($filepart['extension']), $ext) || !@getimagesize($temp_file) ){
|
924 |
+
flagGallery::show_error('<strong>' . $imagefiles['name'][$key] . ' </strong>' . __('is no valid image file!','flash-album-gallery'));
|
925 |
continue;
|
926 |
}
|
927 |
+
|
928 |
// check if this filename already exist in the folder
|
929 |
$i = 0;
|
930 |
while ( in_array( $filename, $dirlist ) ) {
|
931 |
$filename = $filepart['filename'] . '_' . $i++ . '.' .$filepart['extension'];
|
932 |
}
|
933 |
+
|
934 |
$dest_file = $gallery->abspath . '/' . $filename;
|
935 |
+
|
936 |
//check for folder permission
|
937 |
if ( !is_writeable($gallery->abspath) ) {
|
938 |
+
$message = sprintf(__('Unable to write to directory %s. Is this directory writable by the server?', 'flash-album-gallery'), $gallery->abspath);
|
939 |
flagGallery::show_error($message);
|
940 |
+
return;
|
941 |
}
|
942 |
+
|
943 |
// save temp file to gallery
|
944 |
if ( !@move_uploaded_file($temp_file, $dest_file) ){
|
945 |
if( !file_exists($dest_file)){
|
946 |
+
flagGallery::show_error(__('Error, the file could not moved to : ','flash-album-gallery') . $dest_file);
|
947 |
flagAdmin::check_safemode( $gallery->abspath );
|
948 |
continue;
|
949 |
}
|
950 |
+
}
|
951 |
if ( !flagAdmin::chmod($dest_file) ) {
|
952 |
+
flagGallery::show_error(__('Error, the file permissions could not set','flash-album-gallery'));
|
953 |
continue;
|
954 |
}
|
955 |
+
|
956 |
// add to imagelist & dirlist
|
957 |
$imageslist[] = $filename;
|
958 |
$dirlist[] = $filename;
|
959 |
}
|
960 |
}
|
961 |
}
|
962 |
+
|
963 |
if (count($imageslist) > 0) {
|
964 |
+
|
965 |
+
// add images to database
|
966 |
$image_ids = flagAdmin::add_Images($galleryID, $imageslist);
|
967 |
|
968 |
//create thumbnails
|
969 |
+
flagAdmin::do_ajax_operation( 'create_thumbnail' , $image_ids, __('Create new thumbnails','flash-album-gallery') );
|
970 |
//add the preview image if needed
|
971 |
flagAdmin::set_gallery_preview ( $galleryID );
|
972 |
+
|
973 |
+
flagGallery::show_message( count($image_ids) . __(' Image(s) successfully added','flash-album-gallery'));
|
974 |
}
|
975 |
+
|
976 |
return;
|
977 |
|
978 |
} // end function
|
979 |
+
|
980 |
/**
|
981 |
* Upload function will be called via the Flash uploader
|
982 |
+
*
|
983 |
* @class flagAdmin
|
984 |
* @param integer $galleryID
|
985 |
* @return string $result
|
990 |
|
991 |
if ($galleryID == 0) {
|
992 |
//@unlink($temp_file);
|
993 |
+
return __('No gallery selected!','flash-album-gallery');
|
994 |
}
|
995 |
|
996 |
// WPMU action
|
1008 |
$filename = $filepart['basename'];
|
1009 |
|
1010 |
// check for allowed extension
|
1011 |
+
$ext = array('jpeg', 'jpg', 'png', 'gif');
|
1012 |
if (!in_array(strtolower($filepart['extension']), $ext)){
|
1013 |
if(!@getimagesize($temp_file))
|
1014 |
+
return $filename . ' '. __('is no valid image file!','flash-album-gallery');
|
1015 |
}
|
1016 |
|
1017 |
// get the path to the gallery
|
1018 |
$gallerypath = $wpdb->get_var($wpdb->prepare("SELECT path FROM {$wpdb->flaggallery} WHERE gid = %d ", $galleryID));
|
1019 |
if (!$gallerypath){
|
1020 |
@unlink($temp_file);
|
1021 |
+
return __('Failure in database, no gallery path set !','flash-album-gallery');
|
1022 |
+
}
|
1023 |
|
1024 |
// read list of images
|
1025 |
$imageslist = flagAdmin::scandir( WINABSPATH.$gallerypath );
|
1029 |
while (in_array($filename,$imageslist)) {
|
1030 |
$filename = sanitize_title($filepart['filename']) . '_' . $i++ . '.' . $filepart['extension'];
|
1031 |
}
|
1032 |
+
|
1033 |
$dest_file = WINABSPATH . $gallerypath . '/' . $filename;
|
1034 |
+
|
1035 |
// save temp file to gallery
|
1036 |
if ( !@move_uploaded_file($temp_file, $dest_file) ){
|
1037 |
if( !file_exists($dest_file)){
|
1038 |
flagAdmin::check_safemode(WINABSPATH.$gallerypath);
|
1039 |
+
return __('Error, the file could not moved to : ','flash-album-gallery').$dest_file;
|
1040 |
}
|
1041 |
}
|
1042 |
+
|
1043 |
if ( !flagAdmin::chmod($dest_file) )
|
1044 |
+
return __('Error, the file permissions could not set','flash-album-gallery');
|
1045 |
+
|
1046 |
+
require_once(ABSPATH . 'wp-admin/includes/image.php');
|
1047 |
+
$angle = 0;
|
1048 |
+
$image_meta = wp_read_image_metadata($dest_file);
|
1049 |
+
if(!empty($image_meta['orientation'])){
|
1050 |
+
switch($image_meta['orientation']){
|
1051 |
+
case 3:
|
1052 |
+
$angle = 180;
|
1053 |
+
break;
|
1054 |
+
case 6:
|
1055 |
+
$angle = 270;
|
1056 |
+
break;
|
1057 |
+
case 8:
|
1058 |
+
$angle = 90;
|
1059 |
+
break;
|
1060 |
+
}
|
1061 |
+
}
|
1062 |
+
if($angle){
|
1063 |
+
$editor = wp_get_image_editor($dest_file);
|
1064 |
+
if(!is_wp_error($editor)){
|
1065 |
+
$editor->rotate($angle);
|
1066 |
+
$editor->set_quality(90);
|
1067 |
+
$editor->save($dest_file);
|
1068 |
+
}
|
1069 |
+
}
|
1070 |
|
1071 |
// add images to database
|
1072 |
$image_ids = flagAdmin::add_Images($galleryID, array($filename));
|
1074 |
//create thumbnails
|
1075 |
|
1076 |
//save the thumb size values
|
1077 |
+
$flag->options['thumbWidth'] = intval($_POST['thumbw'])? intval($_POST['thumbw']) : 300;
|
1078 |
+
$flag->options['thumbHeight'] = intval($_POST['thumbh'])? intval($_POST['thumbh']) : 300;
|
|
|
1079 |
update_option('flag_options', $flag->options);
|
1080 |
|
1081 |
foreach($image_ids as $picture){
|
1096 |
* @param $error_code
|
1097 |
* @return string $result
|
1098 |
*/
|
1099 |
+
public static function file_upload_error_message($error_code) {
|
1100 |
switch ($error_code) {
|
1101 |
case UPLOAD_ERR_INI_SIZE:
|
1102 |
+
return __('The uploaded file exceeds the upload_max_filesize directive in php.ini','flash-album-gallery');
|
1103 |
case UPLOAD_ERR_FORM_SIZE:
|
1104 |
+
return __('The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form','flash-album-gallery');
|
1105 |
case UPLOAD_ERR_PARTIAL:
|
1106 |
+
return __('The uploaded file was only partially uploaded','flash-album-gallery');
|
1107 |
case UPLOAD_ERR_NO_FILE:
|
1108 |
+
return __('No file was uploaded','flash-album-gallery');
|
1109 |
case UPLOAD_ERR_NO_TMP_DIR:
|
1110 |
+
return __('Missing a temporary folder','flash-album-gallery');
|
1111 |
case UPLOAD_ERR_CANT_WRITE:
|
1112 |
+
return __('Failed to write file to disk','flash-album-gallery');
|
1113 |
case UPLOAD_ERR_EXTENSION:
|
1114 |
+
return __('File upload stopped by extension','flash-album-gallery');
|
1115 |
default:
|
1116 |
+
return __('Unknown upload error','flash-album-gallery');
|
1117 |
}
|
1118 |
}
|
1119 |
|
1120 |
/**
|
1121 |
* Check the Quota under WPMU. Only needed for this case
|
1122 |
+
*
|
1123 |
* @class flagAdmin
|
1124 |
* @return bool $result
|
1125 |
*/
|
1126 |
+
public static function check_quota() {
|
1127 |
|
1128 |
if ( (IS_WPMU) && flagGallery::flag_wpmu_enable_function('wpmuQuotaCheck'))
|
1129 |
if( $error = upload_is_user_over_quota( false ) ) {
|
1130 |
+
flagGallery::show_error( __( 'Sorry, you have used your space allocation. Please delete some files to upload more files.','flash-album-gallery' ) );
|
1131 |
return true;
|
1132 |
}
|
1133 |
return false;
|
1134 |
}
|
1135 |
+
|
1136 |
/**
|
1137 |
* Set correct file permissions (taken from wp core)
|
1138 |
+
*
|
1139 |
* @class flagAdmin
|
1140 |
* @param string $filename
|
1141 |
* @return bool $result
|
1147 |
$perms = $perms & 0000666;
|
1148 |
if ( @chmod($filename, $perms) )
|
1149 |
return true;
|
1150 |
+
|
1151 |
return false;
|
1152 |
}
|
1153 |
+
|
1154 |
/**
|
1155 |
* Check UID in folder and Script
|
1156 |
* Read http://www.php.net/manual/en/features.safe-mode.php to understand safe_mode
|
1157 |
+
*
|
1158 |
* @class flagAdmin
|
1159 |
* @param string $foldername
|
1160 |
* @return bool $result
|
1161 |
*/
|
1162 |
public static function check_safemode($foldername) {
|
1163 |
|
1164 |
+
if ( FLAG_SAFE_MODE ) {
|
1165 |
+
|
1166 |
+
//$script_uid = ( ini_get('safe_mode_gid') ) ? getmygid() : getmyuid();
|
1167 |
+
$script_uid = getmyuid();
|
1168 |
$folder_uid = fileowner($foldername);
|
1169 |
|
1170 |
if ($script_uid != $folder_uid) {
|
1171 |
+
$message = sprintf(__('SAFE MODE Restriction in effect! You need to create the folder <strong>%s</strong> manually','flash-album-gallery'), $foldername);
|
1172 |
+
$message .= '<br />' . sprintf(__('When safe_mode is on, PHP checks to see if the owner (%s) of the current script matches the owner (%s) of the file to be operated on by a file function or its directory','flash-album-gallery'), $script_uid, $folder_uid );
|
1173 |
flagGallery::show_error($message);
|
1174 |
return false;
|
1175 |
}
|
1176 |
}
|
1177 |
+
|
1178 |
return true;
|
1179 |
}
|
1180 |
+
|
1181 |
/**
|
1182 |
* Capability check. Check is the ID fit's to the user_ID
|
1183 |
+
*
|
1184 |
* @class flagAdmin
|
1185 |
* @param int $check_ID is the user_id
|
1186 |
* @return bool $result
|
1188 |
public static function can_manage_this_gallery($check_ID) {
|
1189 |
|
1190 |
global $user_ID, $wp_roles;
|
1191 |
+
|
1192 |
if ( !current_user_can('FlAG Manage others gallery') ) {
|
1193 |
// get the current user ID
|
1194 |
+
wp_get_current_user();
|
1195 |
+
|
1196 |
if ( $user_ID != $check_ID)
|
1197 |
return false;
|
1198 |
}
|
1199 |
return true;
|
1200 |
}
|
1201 |
+
|
1202 |
/**
|
1203 |
* Move images from one folder to another
|
1204 |
*
|
1213 |
|
1214 |
if (!is_array($pic_ids))
|
1215 |
$pic_ids = array($pic_ids);
|
1216 |
+
|
1217 |
// Get destination gallery
|
1218 |
$destination = flagdb::find_gallery( $dest_gid );
|
1219 |
$dest_abspath = WINABSPATH . $destination->path;
|
1220 |
+
|
1221 |
if ( $destination == null ) {
|
1222 |
+
flagGallery::show_error(__('The destination gallery does not exist','flash-album-gallery'));
|
1223 |
return;
|
1224 |
}
|
1225 |
+
|
1226 |
// Check for folder permission
|
1227 |
if ( !is_writeable( $dest_abspath ) ) {
|
1228 |
+
$message = sprintf(__('Unable to write to directory %s. Is this directory writable by the server?', 'flash-album-gallery'), $dest_abspath );
|
1229 |
flagGallery::show_error($message);
|
1230 |
+
return;
|
1231 |
}
|
1232 |
+
|
1233 |
// Get pictures
|
1234 |
$images = flagdb::find_images_in_list($pic_ids);
|
1235 |
|
1236 |
+
foreach ($images as $image) {
|
1237 |
+
|
1238 |
$i = 0;
|
1239 |
$tmp_prefix = '';
|
1240 |
+
|
1241 |
$destination_file_name = $image->filename;
|
1242 |
// check if the filename already exist, then we add a copy_ prefix
|
1243 |
while (file_exists( $dest_abspath . '/' . $destination_file_name)) {
|
1244 |
$tmp_prefix = 'copy_' . ($i++) . '_';
|
1245 |
$destination_file_name = $tmp_prefix . $image->filename;
|
1246 |
}
|
1247 |
+
|
1248 |
$destination_path = $dest_abspath . '/' . $destination_file_name;
|
1249 |
$destination_thumbnail = $dest_abspath . '/thumbs/thumbs_' . $destination_file_name;
|
1250 |
|
1251 |
// Move files
|
1252 |
if ( !@rename($image->imagePath, $destination_path) ) {
|
1253 |
+
$errors .= sprintf(__('Failed to move image %1$s to %2$s','flash-album-gallery'),
|
1254 |
'<strong>' . $image->filename . '</strong>', $destination_path) . '<br />';
|
1255 |
+
continue;
|
1256 |
}
|
1257 |
+
|
1258 |
// Move the thumbnail, if possible
|
1259 |
@rename($image->thumbPath, $destination_thumbnail);
|
1260 |
+
|
1261 |
// Change the gallery id in the database , maybe the filename
|
1262 |
if ( flagdb::update_image($image->pid, $dest_gid, $destination_file_name) )
|
1263 |
$count++;
|
1268 |
flagGallery::show_error($errors);
|
1269 |
|
1270 |
$link = '<a href="' . admin_url() . 'admin.php?page=flag-manage-gallery&mode=edit&gid=' . $destination->gid . '" >' . $destination->title . '</a>';
|
1271 |
+
$messages = sprintf(__('Moved %1$s picture(s) to gallery : %2$s .','flash-album-gallery'), $count, $link);
|
1272 |
flagGallery::show_message($messages);
|
1273 |
|
1274 |
return;
|
1275 |
}
|
1276 |
+
|
1277 |
/**
|
1278 |
* Copy images to another gallery
|
1279 |
+
*
|
1280 |
* @class flagAdmin
|
1281 |
* @param array|int $pic_ids ID's of the images
|
1282 |
* @param int $dest_gid destination gallery
|
1283 |
* @return void
|
1284 |
*/
|
1285 |
public static function copy_images($pic_ids, $dest_gid) {
|
1286 |
+
|
1287 |
$errors = $messages = '';
|
1288 |
+
|
1289 |
if (!is_array($pic_ids))
|
1290 |
$pic_ids = array($pic_ids);
|
1291 |
+
|
1292 |
// Get destination gallery
|
1293 |
$destination = flagdb::find_gallery( $dest_gid );
|
1294 |
if ( $destination == null ) {
|
1295 |
+
flagGallery::show_error(__('The destination gallery does not exist','flash-album-gallery'));
|
1296 |
return;
|
1297 |
}
|
1298 |
+
|
1299 |
// Check for folder permission
|
1300 |
if (!is_writeable(WINABSPATH.$destination->path)) {
|
1301 |
+
$message = sprintf(__('Unable to write to directory %s. Is this directory writable by the server?', 'flash-album-gallery'), WINABSPATH.$destination->path);
|
1302 |
flagGallery::show_error($message);
|
1303 |
+
return;
|
1304 |
}
|
1305 |
+
|
1306 |
// Get pictures
|
1307 |
$images = flagdb::find_images_in_list($pic_ids);
|
1308 |
$destination_path = WINABSPATH . $destination->path;
|
1309 |
+
|
1310 |
+
foreach ($images as $image) {
|
1311 |
// WPMU action
|
1312 |
if ( flagAdmin::check_quota() )
|
1313 |
return;
|
1314 |
+
|
1315 |
$i = 0;
|
1316 |
+
$tmp_prefix = '';
|
1317 |
$destination_file_name = $image->filename;
|
1318 |
while (file_exists($destination_path . '/' . $destination_file_name)) {
|
1319 |
$tmp_prefix = 'copy_' . ($i++) . '_';
|
1320 |
$destination_file_name = $tmp_prefix . $image->filename;
|
1321 |
}
|
1322 |
+
|
1323 |
$destination_file_path = $destination_path . '/' . $destination_file_name;
|
1324 |
$destination_thumb_file_path = $destination_path . '/' . $image->thumbFolder . $image->thumbPrefix . $destination_file_name;
|
1325 |
|
1326 |
// Copy files
|
1327 |
if ( !@copy($image->imagePath, $destination_file_path) ) {
|
1328 |
+
$errors .= sprintf(__('Failed to copy image %1$s to %2$s','flash-album-gallery'),
|
1329 |
$image->filename, $destination_file_path) . '<br />';
|
1330 |
+
continue;
|
1331 |
}
|
1332 |
+
|
1333 |
// Copy the thumbnail if possible
|
1334 |
@copy($image->thumbPath, $destination_thumb_file_path);
|
1335 |
+
|
1336 |
// Create new database entry for the image
|
1337 |
$new_pid = flagdb::insert_image( $destination->gid, $destination_file_name, $image->alttext, $image->description, $image->exclude);
|
1338 |
|
1339 |
+
if (!isset($new_pid)) {
|
1340 |
+
$errors .= sprintf(__('Failed to copy database row for picture %s','flash-album-gallery'), $image->pid) . '<br />';
|
1341 |
+
continue;
|
1342 |
}
|
1343 |
+
|
1344 |
if ( $tmp_prefix != '' ) {
|
1345 |
+
$messages .= sprintf(__('Image %1$s (%2$s) copied as image %3$s (%4$s) » The file already existed in the destination gallery.','flash-album-gallery'),
|
1346 |
$image->pid, $image->filename, $new_pid, $destination_file_name) . '<br />';
|
1347 |
} else {
|
1348 |
+
$messages .= sprintf(__('Image %1$s (%2$s) copied as image %3$s (%4$s)','flash-album-gallery'),
|
1349 |
$image->pid, $image->filename, $new_pid, $destination_file_name) . '<br />';
|
1350 |
}
|
1351 |
|
1352 |
}
|
1353 |
+
|
1354 |
// Finish by showing errors or success
|
1355 |
if ( $errors == '' ) {
|
1356 |
$link = '<a href="' . admin_url() . 'admin.php?page=flag-manage-gallery&mode=edit&gid=' . $destination->gid . '" >' . $destination->title . '</a>';
|
1357 |
+
$messages .= '<hr />' . sprintf(__('Copied %1$s picture(s) to gallery: %2$s .','flash-album-gallery'), count($images), $link);
|
1358 |
+
}
|
1359 |
|
1360 |
if ( $messages != '' )
|
1361 |
flagGallery::show_message($messages);
|
1365 |
|
1366 |
return;
|
1367 |
}
|
1368 |
+
|
1369 |
/**
|
1370 |
* Initate the Ajax operation
|
1371 |
+
*
|
1372 |
+
* @class flagAdmin
|
1373 |
* @param string $operation name of the function which should be executed
|
1374 |
* @param array $image_array
|
1375 |
* @param string $title name of the operation
|
1376 |
* @return string the javascript output
|
1377 |
*/
|
1378 |
public static function do_ajax_operation( $operation, $image_array, $title = '' ) {
|
1379 |
+
|
1380 |
if ( !is_array($image_array) || empty($image_array) )
|
1381 |
return;
|
1382 |
|
1383 |
$js_array = implode('","', $image_array);
|
1384 |
+
|
1385 |
// send out some JavaScript, which initate the ajax operation
|
1386 |
?>
|
1387 |
<script type="text/javascript">
|
1390 |
|
1391 |
flagAjaxOptions = {
|
1392 |
operation: "<?php echo $operation; ?>",
|
1393 |
+
ids: Images,
|
1394 |
header: "<?php echo $title; ?>",
|
1395 |
maxStep: Images.length
|
1396 |
};
|
1397 |
+
|
1398 |
+
jQuery(document).ready( function(){
|
1399 |
flagProgressBar.init( flagAjaxOptions );
|
1400 |
flagAjax.init( flagAjaxOptions );
|
1401 |
} );
|
1402 |
</script>
|
1403 |
+
|
1404 |
<div id="progressbar_container" class="wrap"></div>
|
1405 |
+
|
1406 |
+
<?php
|
1407 |
}
|
1408 |
+
|
1409 |
/**
|
1410 |
* flagAdmin::set_gallery_preview() - define a preview pic after the first upload, can be changed in the gallery settings
|
1411 |
+
*
|
1412 |
* @class flagAdmin
|
1413 |
* @param int $galleryID
|
1414 |
* @return void
|
1418 |
|
1419 |
$galleryID = intval($galleryID);
|
1420 |
$gallery = flagdb::find_gallery( $galleryID );
|
1421 |
+
|
1422 |
// in the case no preview image is setup, we do this now
|
1423 |
if ($gallery->previewpic == 0) {
|
1424 |
$firstImage = $wpdb->get_var($wpdb->prepare("SELECT `pid` FROM `{$wpdb->flagpictures}` WHERE `exclude` != 1 AND `galleryid` = '%d' ORDER by `pid` DESC limit 0,1", $galleryID));
|
1427 |
wp_cache_delete($galleryID, 'flag_gallery');
|
1428 |
}
|
1429 |
}
|
1430 |
+
|
1431 |
return;
|
1432 |
}
|
1433 |
|
1434 |
/**
|
1435 |
* Return a JSON coded array of Image ids for a requested gallery
|
1436 |
+
*
|
1437 |
* @param int $galleryID
|
1438 |
* @return array (JSON)
|
1439 |
*/
|
1440 |
public static function get_image_ids( $galleryID ) {
|
1441 |
+
|
1442 |
if ( !function_exists('json_encode') )
|
1443 |
return(-2);
|
1444 |
+
|
1445 |
$gallery = flagdb::get_ids_from_gallery($galleryID, 'pid', 'ASC', false);
|
1446 |
|
1447 |
header('Content-Type: text/plain; charset=' . get_option('blog_charset'), true);
|
1448 |
$output = json_encode($gallery);
|
1449 |
+
|
1450 |
return $output;
|
1451 |
}
|
1452 |
+
|
1453 |
} // END class flagAdmin
|
1454 |
}
|
admin/get_skin.php
CHANGED
@@ -40,12 +40,13 @@ function get_skin_data( $skin_file, $type='' ) {
|
|
40 |
if($name) {
|
41 |
preg_match( '|Skin URI:(.*)$|mi', $skin_data, $uri );
|
42 |
preg_match( '|uid:(.*)|i', $skin_data, $uid );
|
|
|
43 |
preg_match( '|Version:(.*)|i', $skin_data, $version );
|
44 |
preg_match( '|Description:(.*)$|mi', $skin_data, $description );
|
45 |
preg_match( '|Author:(.*)$|mi', $skin_data, $author_name );
|
46 |
preg_match( '|Author URI:(.*)$|mi', $skin_data, $author_uri );
|
47 |
|
48 |
-
foreach ( array( 'name', 'uri', 'version', 'uid', 'description', 'author_name', 'author_uri' ) as $field ) {
|
49 |
if ( !empty( ${$field} ) )
|
50 |
${$field} = trim(${$field}[1]);
|
51 |
else
|
@@ -53,7 +54,7 @@ function get_skin_data( $skin_file, $type='' ) {
|
|
53 |
}
|
54 |
|
55 |
$skin_data = array(
|
56 |
-
'Name' => $name, 'Title' => $name, 'SkinURI' => $uri, 'Description' => $description,
|
57 |
'Author' => $author_name, 'AuthorURI' => $author_uri, 'Version' => $version, 'uid' => $uid
|
58 |
);
|
59 |
return $skin_data;
|
40 |
if($name) {
|
41 |
preg_match( '|Skin URI:(.*)$|mi', $skin_data, $uri );
|
42 |
preg_match( '|uid:(.*)|i', $skin_data, $uid );
|
43 |
+
preg_match( '|status:(.*)|i', $skin_data, $status );
|
44 |
preg_match( '|Version:(.*)|i', $skin_data, $version );
|
45 |
preg_match( '|Description:(.*)$|mi', $skin_data, $description );
|
46 |
preg_match( '|Author:(.*)$|mi', $skin_data, $author_name );
|
47 |
preg_match( '|Author URI:(.*)$|mi', $skin_data, $author_uri );
|
48 |
|
49 |
+
foreach ( array( 'name', 'uri', 'version', 'uid', 'status', 'description', 'author_name', 'author_uri' ) as $field ) {
|
50 |
if ( !empty( ${$field} ) )
|
51 |
${$field} = trim(${$field}[1]);
|
52 |
else
|
54 |
}
|
55 |
|
56 |
$skin_data = array(
|
57 |
+
'Name' => $name, 'Title' => $name, 'SkinURI' => $uri, 'Status' => $status, 'Description' => $description,
|
58 |
'Author' => $author_name, 'AuthorURI' => $author_uri, 'Version' => $version, 'uid' => $uid
|
59 |
);
|
60 |
return $skin_data;
|
admin/grab_meta.php
CHANGED
@@ -10,29 +10,29 @@ $alttext = trim ( $meta->get_META('title') );
|
|
10 |
$description = trim ( $meta->get_META('caption') );
|
11 |
$timestamp = $meta->get_date_time();
|
12 |
|
13 |
-
$makedescription = '<b>'.__('Meta Data','
|
14 |
if ($dbdata) {
|
15 |
foreach ($dbdata as $key => $value){
|
16 |
if ( is_array($value) ) continue;
|
17 |
$makedescription .= '<b>'.$meta->i8n_name($key)."</b> ".$value."<br>";
|
18 |
}
|
19 |
} else {
|
20 |
-
$makedescription .= __('No meta data saved','
|
21 |
}
|
22 |
if ($exifdata) {
|
23 |
-
$makedescription .= "\n<b>".__('EXIF Data','
|
24 |
foreach ($exifdata as $key => $value){
|
25 |
$makedescription .= '<b>'.$meta->i8n_name($key)."</b> ".$value."<br>";
|
26 |
}
|
27 |
}
|
28 |
if ($iptcdata) {
|
29 |
-
$makedescription .= "\n<b>".__('IPTC Data','
|
30 |
foreach ($iptcdata as $key => $value){
|
31 |
$makedescription .= '<b>'.$meta->i8n_name($key)."</b> ".$value."<br>";
|
32 |
}
|
33 |
}
|
34 |
if ($xmpdata) {
|
35 |
-
$makedescription .= "\n<b>".__('XMP Data','
|
36 |
foreach ($xmpdata as $key => $value){
|
37 |
$makedescription .= '<b>'.$meta->i8n_name($key)."</b> ".$value."<br>";
|
38 |
}
|
10 |
$description = trim ( $meta->get_META('caption') );
|
11 |
$timestamp = $meta->get_date_time();
|
12 |
|
13 |
+
$makedescription = '<b>'.__('Meta Data','flash-album-gallery')."</b><br>";
|
14 |
if ($dbdata) {
|
15 |
foreach ($dbdata as $key => $value){
|
16 |
if ( is_array($value) ) continue;
|
17 |
$makedescription .= '<b>'.$meta->i8n_name($key)."</b> ".$value."<br>";
|
18 |
}
|
19 |
} else {
|
20 |
+
$makedescription .= __('No meta data saved','flash-album-gallery')."<br>";
|
21 |
}
|
22 |
if ($exifdata) {
|
23 |
+
$makedescription .= "\n<b>".__('EXIF Data','flash-album-gallery')."</b><br>";
|
24 |
foreach ($exifdata as $key => $value){
|
25 |
$makedescription .= '<b>'.$meta->i8n_name($key)."</b> ".$value."<br>";
|
26 |
}
|
27 |
}
|
28 |
if ($iptcdata) {
|
29 |
+
$makedescription .= "\n<b>".__('IPTC Data','flash-album-gallery')."</b><br>";
|
30 |
foreach ($iptcdata as $key => $value){
|
31 |
$makedescription .= '<b>'.$meta->i8n_name($key)."</b> ".$value."<br>";
|
32 |
}
|
33 |
}
|
34 |
if ($xmpdata) {
|
35 |
+
$makedescription .= "\n<b>".__('XMP Data','flash-album-gallery')."</b><br>";
|
36 |
foreach ($xmpdata as $key => $value){
|
37 |
$makedescription .= '<b>'.$meta->i8n_name($key)."</b> ".$value."<br>";
|
38 |
}
|
admin/images/appstore_button.png
CHANGED
Binary file
|
admin/images/like.png
CHANGED
Binary file
|
admin/images/views.png
CHANGED
Binary file
|
admin/jgallery.php
DELETED
@@ -1,159 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You are not allowed to call this page directly.'); }
|
3 |
-
|
4 |
-
global $wpdb, $post;
|
5 |
-
$xml = array();
|
6 |
-
$flag_options = get_option ('flag_options');
|
7 |
-
$siteurl = site_url();
|
8 |
-
$c = array();
|
9 |
-
$isCrawler = isset($_SERVER['HTTP_USER_AGENT'])? flagGetUserNow($_SERVER['HTTP_USER_AGENT']) : false;
|
10 |
-
extract($altColors);
|
11 |
-
$bg = ($wmode == 'window')? '#'.$Background : 'transparent';
|
12 |
-
$xml['alt'] = '<style type="text/css" scoped="scoped">';
|
13 |
-
if(!$isCrawler) {
|
14 |
-
$xml['alt'] .= '@import url("'.plugins_url('/admin/css/flagallery_nocrawler.css', dirname(__FILE__)).'");';
|
15 |
-
}
|
16 |
-
$xml['alt'] .= '@import url("'.plugins_url('/admin/css/flagallery_noflash.css', dirname(__FILE__)).'");';
|
17 |
-
if($isCrawler) {
|
18 |
-
$xml['alt'] .= '.flag_alternate .flagCatMeta h4 { padding: 4px 10px; margin: 7px 0; border: none; font: 14px Tahoma; text-decoration: none; background:#292929 none; color: #ffffff; }';
|
19 |
-
$xml['alt'] .= '.flag_alternate .flagCatMeta p { font-size: 12px; }';
|
20 |
-
}
|
21 |
-
if($BarsBG) {
|
22 |
-
$bgBar = ($wmode == 'window')? '#'.$BarsBG : 'transparent';
|
23 |
-
if(!$isCrawler){
|
24 |
-
$xml['alt'] .= "#fancybox-title-over .title { color: #{$TitleColor}; }";
|
25 |
-
$xml['alt'] .= "#fancybox-title-over .descr { color: #{$DescrColor}; }";
|
26 |
-
$xml['alt'] .= ".flag_alternate .flagcatlinks { background-color: #{$BarsBG}; }";
|
27 |
-
$xml['alt'] .= ".flag_alternate .flagcatlinks a.flagcat, span.flag_pic_counters { color: #{$CatColor}; background-color: #{$CatBGColor}; }";
|
28 |
-
$xml['alt'] .= ".flag_alternate .flagcatlinks a.active, .flag_alternate .flagcatlinks a.flagcat:hover { color: #{$CatColorOver}; background-color: #{$CatBGColorOver}; }";
|
29 |
-
}
|
30 |
-
$xml['alt'] .= ".flag_alternate .flagcategory a.flag_pic_alt { background-color: #{$ThumbBG}; border: 2px solid #{$ThumbBG}; color: #{$ThumbBG}; }";
|
31 |
-
$xml['alt'] .= ".flag_alternate .flagcategory a.flag_pic_alt:hover { background-color: #{$ThumbBG}; border: 2px solid #{$ThumbLoaderColor}; color: #{$ThumbLoaderColor}; }";
|
32 |
-
$xml['alt'] .= ".flag_alternate .flagcategory a.flag_pic_alt.current, .flag_alternate .flagcategory a.flag_pic_alt.last { border-color: #{$ThumbLoaderColor}; }";
|
33 |
-
}
|
34 |
-
if($altColors['FullWindow'] && !$isCrawler){
|
35 |
-
$xml['alt'] .= ".flagcatlinks a.backlink { color: #{$CatColor}; background-color: #{$CatBGColor}; }";
|
36 |
-
}
|
37 |
-
$xml['alt'] .= '</style>';
|
38 |
-
if(!$isCrawler){
|
39 |
-
if(!intval($flag_options['jAlterGalScript'])) {
|
40 |
-
if(wp_style_is('fancybox', 'registered')){
|
41 |
-
wp_print_styles('fancybox');
|
42 |
-
} else{
|
43 |
-
wp_print_styles('fancybox-1.3.4');
|
44 |
-
}
|
45 |
-
if(wp_script_is('fancybox', 'registered')){
|
46 |
-
wp_print_scripts('fancybox');
|
47 |
-
} else{
|
48 |
-
wp_print_scripts('fancybox-1.3.4');
|
49 |
-
}
|
50 |
-
//$xml['alt'] .= '<style type="text/css" scoped="scoped">@import url("'.plugins_url('/flash-album-gallery/admin/js/jquery.fancybox-1.3.4.css').'");</style>';
|
51 |
-
//$xml['alt'] .= "<script type='text/javascript' src='".plugins_url('/flash-album-gallery/admin/js/jquery.fancybox-1.3.4.pack.js')."'></script>";
|
52 |
-
$xml['alt'] .= "<script type='text/javascript'>var ExtendVar='fancybox', hitajax = '".plugins_url('/lib/hitcounter.php', dirname(__FILE__))."';</script>";
|
53 |
-
} else if(intval($flag_options['jAlterGalScript']) == 1) {
|
54 |
-
wp_print_styles('photoswipe');
|
55 |
-
wp_print_scripts('klass.photoswipe');
|
56 |
-
wp_print_scripts('photoswipe');
|
57 |
-
//$xml['alt'] .= "<style type='text/css'>@import url('".plugins_url('/admin/js/photoswipe/photoswipe.css', dirname(__FILE__))."');</style>";
|
58 |
-
//$xml['alt'] .= "<script type='text/javascript' src='".plugins_url('/admin/js/photoswipe/klass.min.js', dirname(__FILE__))."'></script>";
|
59 |
-
//$xml['alt'] .= "<script type='text/javascript' src='".plugins_url('/admin/js/photoswipe/code.photoswipe.jquery-3.0.5.min.js', dirname(__FILE__))."'></script>";
|
60 |
-
$xml['alt'] .= "<script type='text/javascript'>var ExtendVar='photoswipe', hitajax = '".plugins_url('/lib/hitcounter.php', dirname(__FILE__))."';</script>";
|
61 |
-
}
|
62 |
-
}
|
63 |
-
|
64 |
-
$xml['alt'] .= '<div id="'.$skinID.'_jq" class="flag_alternate noLightbox"><div class="flagcatlinks">';
|
65 |
-
if($altColors['FullWindow'] && !$isCrawler){
|
66 |
-
$flag_custom = get_post_custom($post->ID);
|
67 |
-
$backlink = $flag_custom["mb_button_link"][0];
|
68 |
-
if(!$backlink || $backlink == 'http://'){ $backlink = $_SERVER["HTTP_REFERER"]; }
|
69 |
-
if($backlink){
|
70 |
-
$xml['alt'] .= '<a id="backlink" class="backlink" href="'.$backlink.'">'.$flag_custom["mb_button"][0].'</a>';
|
71 |
-
}
|
72 |
-
}
|
73 |
-
$xml['alt'] .= '</div>';
|
74 |
-
|
75 |
-
$gID = explode( '_', $galleryID ); // get the gallery id
|
76 |
-
if ( is_user_logged_in() ) $exclude_clause = '';
|
77 |
-
else $exclude_clause = ' AND exclude<>1 ';
|
78 |
-
$i = 0;
|
79 |
-
if(isset($flag_options['disableViews']) && !empty($flag_options['disableViews'])){
|
80 |
-
$disableViews = 1;
|
81 |
-
} else { $disableViews = 0; }
|
82 |
-
if((get_option( 'flag_db_version' ) < 2.75)){
|
83 |
-
$select_columns = 'pid, galleryid, filename, description, alttext, imagedate, sortorder, hitcounter, total_value, total_votes, meta_data';
|
84 |
-
$exclude_clause = '';
|
85 |
-
} else {
|
86 |
-
$select_columns = 'pid, galleryid, filename, description, alttext, link, imagedate, sortorder, hitcounter, total_value, total_votes, meta_data';
|
87 |
-
}
|
88 |
-
|
89 |
-
foreach ( $gID as $galID ) {
|
90 |
-
$galID = (int) $galID;
|
91 |
-
$status = $wpdb->get_var("SELECT status FROM $wpdb->flaggallery WHERE gid={$galID}");
|
92 |
-
if(intval($status)){
|
93 |
-
continue;
|
94 |
-
}
|
95 |
-
|
96 |
-
if ( $galID == 0) {
|
97 |
-
$thegalleries = array();
|
98 |
-
$thepictures = $wpdb->get_results("SELECT $select_columns FROM $wpdb->flagpictures WHERE 1=1 {$exclude_clause} ORDER BY {$flag_options['galSort']} {$flag_options['galSortDir']} ", ARRAY_A);
|
99 |
-
} else {
|
100 |
-
$thegalleries = $wpdb->get_row("SELECT gid, name, path, title, galdesc FROM $wpdb->flaggallery WHERE gid={$galID}", ARRAY_A);
|
101 |
-
$thepictures = $wpdb->get_results("SELECT $select_columns FROM $wpdb->flagpictures WHERE galleryid = '{$galID}' {$exclude_clause} ORDER BY {$flag_options['galSort']} {$flag_options['galSortDir']} ", ARRAY_A);
|
102 |
-
}
|
103 |
-
$captions = '';
|
104 |
-
|
105 |
-
|
106 |
-
if (is_array ($thepictures) && count($thegalleries) && count($thepictures)){
|
107 |
-
$thegalleries = array_map('stripslashes', $thegalleries);
|
108 |
-
$galdesc = $thegalleries['galdesc'];
|
109 |
-
$thegalleries['galdesc'] = htmlspecialchars_decode($galdesc);
|
110 |
-
$a = $thegalleries;
|
111 |
-
|
112 |
-
$xml['alt'] .= '<div class="flagCatMeta">';
|
113 |
-
$xml['alt'] .= '<h4>'.htmlspecialchars_decode($thegalleries['title'], ENT_QUOTES).'</h4>';
|
114 |
-
$xml['alt'] .= '<p>'.str_replace('"','', strip_tags(htmlspecialchars_decode($galdesc, ENT_QUOTES))).'</p>';
|
115 |
-
$xml['alt'] .= '</div>';
|
116 |
-
$xml['alt'] .= '<div class="flagcategory" id="gid_'.$galID.'_'.$skinID.'">';
|
117 |
-
$n = count($thepictures);
|
118 |
-
$var = floor($n/5);
|
119 |
-
if($var==0 || $var > 4) $var=4;
|
120 |
-
$split = ceil($n/$var);
|
121 |
-
$j=0;
|
122 |
-
$b = array();
|
123 |
-
foreach ($thepictures as $picture) {
|
124 |
-
$meta_data = maybe_unserialize($picture['meta_data']);
|
125 |
-
$picture['width'] = $meta_data['width'];
|
126 |
-
$picture['height'] = $meta_data['height'];
|
127 |
-
$picture['thumbnail'] = $meta_data['thumbnail']['width'].'x'.$meta_data['thumbnail']['height'];
|
128 |
-
$webview = '';
|
129 |
-
if(isset($meta_data['webview'])){
|
130 |
-
$picture['webview'] = $meta_data['webview'][0].'x'.$meta_data['webview'][1];
|
131 |
-
$webview = $flag_options['optimized_imgs']? '/webview' : '';
|
132 |
-
}
|
133 |
-
unset($picture['meta_data']);
|
134 |
-
$picture = array_map('stripslashes', $picture);
|
135 |
-
$b['data'][] = $picture;
|
136 |
-
|
137 |
-
$pid = intval($picture['pid']);
|
138 |
-
|
139 |
-
if ($isCrawler){
|
140 |
-
$xml['alt'] .= '<a style="display:block; overflow: hidden; height: 100px; width: 115px; margin-bottom: 10px; background-color: #eeeeee; background-position: 22px 44px; text-align: left;" class="i'. $j++ .' flag_pic_alt" href="'.$siteurl.'/'.$thegalleries['path'].$webview.'/'.$picture['filename'].'" id="flag_pic_'.$pid.'"><img style="float:left; margin-right: 10px; width: auto; height: auto; min-height:100px; min-width:115px;" title="'.esc_attr(strip_tags(htmlspecialchars_decode($picture['alttext']))).'" alt="'.esc_attr(strip_tags(htmlspecialchars_decode($picture['alttext']))).'" src="'.$siteurl.'/'.$thegalleries['path'].'/thumbs/thumbs_'.$picture['filename'].'" /><span style="display: block; overflow: hidden; text-decoration: none; color: #000; font-weight: normal;" class="flag_pic_desc" id="flag_desc_'.$pid.'"><strong>'.strip_tags(htmlspecialchars_decode($picture['alttext'])).'</strong><br />'.strip_tags(htmlspecialchars_decode($picture['description'])).'</span></a>';
|
141 |
-
} else {
|
142 |
-
if(!$disableViews){
|
143 |
-
$views = (intval($picture['hitcounter']) < 10000) ? $picture['hitcounter'] : round($picture['hitcounter']/1000, 1).'k';
|
144 |
-
$likes = (intval($picture['total_votes']) < 10000) ? $picture['total_votes'] : round($picture['total_votes']/1000, 1).'k';
|
145 |
-
$views_panel = '<span class="flag_pic_counters"><i>'.$views.'</i><b>'.$likes.'</b></span>';
|
146 |
-
} else {
|
147 |
-
$views_panel = '';
|
148 |
-
}
|
149 |
-
$xml['alt'] .= '<a class="i' . $j++ . ' flag_pic_alt" href="' . $siteurl . '/' . $thegalleries['path'] . $webview . '/' . $picture['filename'] . '" id="flag_pic_' . $pid . '" title="' . esc_attr(strip_tags(htmlspecialchars_decode($picture['alttext']))) . '">[img src=' . $siteurl . '/' . $thegalleries['path'] . '/thumbs/thumbs_' . $picture['filename'] . ']' . $views_panel . '<span class="flag_pic_desc" id="flag_desc_' . $pid . '"><strong>' . strip_tags($picture['alttext']) . '</strong><br /><span>' . htmlspecialchars(nl2br($picture['description'])) . '</span></span></a>';
|
150 |
-
}
|
151 |
-
}
|
152 |
-
$xml['alt'] .= '</div>';
|
153 |
-
$c['galleries'][] = $a + $b;
|
154 |
-
}
|
155 |
-
}
|
156 |
-
$xml['alt'] .= '</div>';
|
157 |
-
$content_data = $c + $musicData;
|
158 |
-
$d = array('properties'=>$data) + $content_data;
|
159 |
-
$xml['json'] = json_encode($d);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/js/disablescroll.js
DELETED
@@ -1,55 +0,0 @@
|
|
1 |
-
function hookMouseWheel(){
|
2 |
-
if (window.addEventListener)
|
3 |
-
window.addEventListener('DOMMouseScroll', onMouseWheel, false);
|
4 |
-
window.onmousewheel = document.onmousewheel = onMouseWheel;
|
5 |
-
}
|
6 |
-
|
7 |
-
function isOverSwf(mEvent)
|
8 |
-
{
|
9 |
-
var elem;
|
10 |
-
if (mEvent.srcElement) {
|
11 |
-
elem = mEvent.srcElement.nodeName;
|
12 |
-
} else if (mEvent.target) {
|
13 |
-
elem = mEvent.target.nodeName;
|
14 |
-
}
|
15 |
-
|
16 |
-
if (elem.toLowerCase() == "object" || elem.toLowerCase() == "embed") {
|
17 |
-
// if (jQuery(elem).hasClass('flashalbum')) {
|
18 |
-
return true;
|
19 |
-
}
|
20 |
-
return false;
|
21 |
-
}
|
22 |
-
|
23 |
-
function onMouseWheel(event)
|
24 |
-
{
|
25 |
-
var delta = 0;
|
26 |
-
if (!event)
|
27 |
-
event = window.event;
|
28 |
-
if (event.wheelDelta) {
|
29 |
-
delta = event.wheelDelta/120;
|
30 |
-
if (window.opera) delta = -delta;
|
31 |
-
} else if (event.detail) {
|
32 |
-
delta = -event.detail/3;
|
33 |
-
}
|
34 |
-
|
35 |
-
if (isOverSwf(event)) {
|
36 |
-
return cancelEvent(event);
|
37 |
-
}
|
38 |
-
|
39 |
-
return true;
|
40 |
-
}
|
41 |
-
|
42 |
-
function cancelEvent(e)
|
43 |
-
{
|
44 |
-
e = e ? e : window.event;
|
45 |
-
if (e.stopPropagation)
|
46 |
-
e.stopPropagation();
|
47 |
-
if (e.preventDefault)
|
48 |
-
e.preventDefault();
|
49 |
-
e.cancelBubble = true;
|
50 |
-
e.cancel = true;
|
51 |
-
e.returnValue = false;
|
52 |
-
return false;
|
53 |
-
}
|
54 |
-
|
55 |
-
hookMouseWheel();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/js/farbtastic-nosharp.js
DELETED
@@ -1,345 +0,0 @@
|
|
1 |
-
/**
|
2 |
-
* Farbtastic Color Picker 1.2
|
3 |
-
* © 2008 Steven Wittens
|
4 |
-
*
|
5 |
-
* This program is free software; you can redistribute it and/or modify
|
6 |
-
* it under the terms of the GNU General Public License as published by
|
7 |
-
* the Free Software Foundation; either version 2 of the License, or
|
8 |
-
* (at your option) any later version.
|
9 |
-
*
|
10 |
-
* This program is distributed in the hope that it will be useful,
|
11 |
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12 |
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13 |
-
* GNU General Public License for more details.
|
14 |
-
*
|
15 |
-
* You should have received a copy of the GNU General Public License
|
16 |
-
* along with this program; if not, write to the Free Software
|
17 |
-
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
18 |
-
*/
|
19 |
-
|
20 |
-
jQuery.fn.farbtastic = function (callback) {
|
21 |
-
jQuery.farbtastic(this, callback);
|
22 |
-
return this;
|
23 |
-
};
|
24 |
-
|
25 |
-
jQuery.farbtastic = function (container, callback) {
|
26 |
-
var container = jQuery(container).get(0);
|
27 |
-
return container.farbtastic || (container.farbtastic = new jQuery._farbtastic(container, callback));
|
28 |
-
}
|
29 |
-
|
30 |
-
jQuery._farbtastic = function (container, callback) {
|
31 |
-
// Store farbtastic object
|
32 |
-
var fb = this;
|
33 |
-
|
34 |
-
// Insert markup
|
35 |
-
jQuery(container).html('<div class="farbtastic"><div class="color"></div><div class="wheel"></div><div class="overlay"></div><div class="h-marker marker"></div><div class="sl-marker marker"></div></div>');
|
36 |
-
var e = jQuery('.farbtastic', container);
|
37 |
-
fb.wheel = jQuery('.wheel', container).get(0);
|
38 |
-
// Dimensions
|
39 |
-
fb.radius = 84;
|
40 |
-
fb.square = 100;
|
41 |
-
fb.width = 194;
|
42 |
-
|
43 |
-
// Fix background PNGs in IE6
|
44 |
-
if (navigator.appVersion.match(/MSIE [0-6]\./)) {
|
45 |
-
jQuery('*', e).each(function () {
|
46 |
-
if (this.currentStyle.backgroundImage != 'none') {
|
47 |
-
var image = this.currentStyle.backgroundImage;
|
48 |
-
image = this.currentStyle.backgroundImage.substring(5, image.length - 2);
|
49 |
-
jQuery(this).css({
|
50 |
-
'backgroundImage': 'none',
|
51 |
-
'filter': "progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=crop, src='" + image + "')"
|
52 |
-
});
|
53 |
-
}
|
54 |
-
});
|
55 |
-
}
|
56 |
-
|
57 |
-
/**
|
58 |
-
* Link to the given element(s) or callback.
|
59 |
-
*/
|
60 |
-
fb.linkTo = function (callback) {
|
61 |
-
// Unbind previous nodes
|
62 |
-
if (typeof fb.callback == 'object') {
|
63 |
-
jQuery(fb.callback).unbind('keyup', fb.updateValue);
|
64 |
-
}
|
65 |
-
|
66 |
-
// Reset color
|
67 |
-
fb.color = null;
|
68 |
-
|
69 |
-
// Bind callback or elements
|
70 |
-
if (typeof callback == 'function') {
|
71 |
-
fb.callback = callback;
|
72 |
-
}
|
73 |
-
else if (typeof callback == 'object' || typeof callback == 'string') {
|
74 |
-
fb.callback = jQuery(callback);
|
75 |
-
fb.callback.bind('keyup', fb.updateValue);
|
76 |
-
if (fb.callback.get(0).value) {
|
77 |
-
fb.setColor(fb.callback.get(0).value);
|
78 |
-
}
|
79 |
-
}
|
80 |
-
return this;
|
81 |
-
}
|
82 |
-
fb.updateValue = function (event) {
|
83 |
-
if (this.value && this.value != fb.color) {
|
84 |
-
fb.setColor(this.value);
|
85 |
-
}
|
86 |
-
}
|
87 |
-
|
88 |
-
/**
|
89 |
-
* Change color with HTML syntax #123456
|
90 |
-
*/
|
91 |
-
fb.setColor = function (color) {
|
92 |
-
var unpack = fb.unpack(color);
|
93 |
-
if (fb.color != color && unpack) {
|
94 |
-
fb.color = color;
|
95 |
-
fb.rgb = unpack;
|
96 |
-
fb.hsl = fb.RGBToHSL(fb.rgb);
|
97 |
-
fb.updateDisplay();
|
98 |
-
}
|
99 |
-
return this;
|
100 |
-
}
|
101 |
-
|
102 |
-
/**
|
103 |
-
* Change color with HSL triplet [0..1, 0..1, 0..1]
|
104 |
-
*/
|
105 |
-
fb.setHSL = function (hsl) {
|
106 |
-
fb.hsl = hsl;
|
107 |
-
fb.rgb = fb.HSLToRGB(hsl);
|
108 |
-
fb.color = fb.pack(fb.rgb);
|
109 |
-
fb.updateDisplay();
|
110 |
-
return this;
|
111 |
-
}
|
112 |
-
|
113 |
-
/////////////////////////////////////////////////////
|
114 |
-
|
115 |
-
/**
|
116 |
-
* Retrieve the coordinates of the given event relative to the center
|
117 |
-
* of the widget.
|
118 |
-
*/
|
119 |
-
fb.widgetCoords = function (event) {
|
120 |
-
var x, y;
|
121 |
-
var el = event.target || event.srcElement;
|
122 |
-
var reference = fb.wheel;
|
123 |
-
|
124 |
-
if (typeof event.offsetX != 'undefined') {
|
125 |
-
// Use offset coordinates and find common offsetParent
|
126 |
-
var pos = { x: event.offsetX, y: event.offsetY };
|
127 |
-
|
128 |
-
// Send the coordinates upwards through the offsetParent chain.
|
129 |
-
var e = el;
|
130 |
-
while (e) {
|
131 |
-
e.mouseX = pos.x;
|
132 |
-
e.mouseY = pos.y;
|
133 |
-
pos.x += e.offsetLeft;
|
134 |
-
pos.y += e.offsetTop;
|
135 |
-
e = e.offsetParent;
|
136 |
-
}
|
137 |
-
|
138 |
-
// Look for the coordinates starting from the wheel widget.
|
139 |
-
var e = reference;
|
140 |
-
var offset = { x: 0, y: 0 }
|
141 |
-
while (e) {
|
142 |
-
if (typeof e.mouseX != 'undefined') {
|
143 |
-
x = e.mouseX - offset.x;
|
144 |
-
y = e.mouseY - offset.y;
|
145 |
-
break;
|
146 |
-
}
|
147 |
-
offset.x += e.offsetLeft;
|
148 |
-
offset.y += e.offsetTop;
|
149 |
-
e = e.offsetParent;
|
150 |
-
}
|
151 |
-
|
152 |
-
// Reset stored coordinates
|
153 |
-
e = el;
|
154 |
-
while (e) {
|
155 |
-
e.mouseX = undefined;
|
156 |
-
e.mouseY = undefined;
|
157 |
-
e = e.offsetParent;
|
158 |
-
}
|
159 |
-
}
|
160 |
-
else {
|
161 |
-
// Use absolute coordinates
|
162 |
-
var pos = fb.absolutePosition(reference);
|
163 |
-
x = (event.pageX || 0*(event.clientX + jQuery('html').get(0).scrollLeft)) - pos.x;
|
164 |
-
y = (event.pageY || 0*(event.clientY + jQuery('html').get(0).scrollTop)) - pos.y;
|
165 |
-
}
|
166 |
-
// Subtract distance to middle
|
167 |
-
return { x: x - fb.width / 2, y: y - fb.width / 2 };
|
168 |
-
}
|
169 |
-
|
170 |
-
/**
|
171 |
-
* Mousedown handler
|
172 |
-
*/
|
173 |
-
fb.mousedown = function (event) {
|
174 |
-
// Capture mouse
|
175 |
-
if (!document.dragging) {
|
176 |
-
jQuery(document).bind('mousemove', fb.mousemove).bind('mouseup', fb.mouseup);
|
177 |
-
document.dragging = true;
|
178 |
-
}
|
179 |
-
|
180 |
-
// Check which area is being dragged
|
181 |
-
var pos = fb.widgetCoords(event);
|
182 |
-
fb.circleDrag = Math.max(Math.abs(pos.x), Math.abs(pos.y)) * 2 > fb.square;
|
183 |
-
|
184 |
-
// Process
|
185 |
-
fb.mousemove(event);
|
186 |
-
return false;
|
187 |
-
}
|
188 |
-
|
189 |
-
/**
|
190 |
-
* Mousemove handler
|
191 |
-
*/
|
192 |
-
fb.mousemove = function (event) {
|
193 |
-
// Get coordinates relative to color picker center
|
194 |
-
var pos = fb.widgetCoords(event);
|
195 |
-
|
196 |
-
// Set new HSL parameters
|
197 |
-
if (fb.circleDrag) {
|
198 |
-
var hue = Math.atan2(pos.x, -pos.y) / 6.28;
|
199 |
-
if (hue < 0) hue += 1;
|
200 |
-
fb.setHSL([hue, fb.hsl[1], fb.hsl[2]]);
|
201 |
-
}
|
202 |
-
else {
|
203 |
-
var sat = Math.max(0, Math.min(1, -(pos.x / fb.square) + .5));
|
204 |
-
var lum = Math.max(0, Math.min(1, -(pos.y / fb.square) + .5));
|
205 |
-
fb.setHSL([fb.hsl[0], sat, lum]);
|
206 |
-
}
|
207 |
-
return false;
|
208 |
-
}
|
209 |
-
|
210 |
-
/**
|
211 |
-
* Mouseup handler
|
212 |
-
*/
|
213 |
-
fb.mouseup = function () {
|
214 |
-
// Uncapture mouse
|
215 |
-
jQuery(document).unbind('mousemove', fb.mousemove);
|
216 |
-
jQuery(document).unbind('mouseup', fb.mouseup);
|
217 |
-
document.dragging = false;
|
218 |
-
}
|
219 |
-
|
220 |
-
/**
|
221 |
-
* Update the markers and styles
|
222 |
-
*/
|
223 |
-
fb.updateDisplay = function () {
|
224 |
-
// Markers
|
225 |
-
var angle = fb.hsl[0] * 6.28;
|
226 |
-
jQuery('.h-marker', e).css({
|
227 |
-
left: Math.round(Math.sin(angle) * fb.radius + fb.width / 2) + 'px',
|
228 |
-
top: Math.round(-Math.cos(angle) * fb.radius + fb.width / 2) + 'px'
|
229 |
-
});
|
230 |
-
|
231 |
-
jQuery('.sl-marker', e).css({
|
232 |
-
left: Math.round(fb.square * (.5 - fb.hsl[1]) + fb.width / 2) + 'px',
|
233 |
-
top: Math.round(fb.square * (.5 - fb.hsl[2]) + fb.width / 2) + 'px'
|
234 |
-
});
|
235 |
-
|
236 |
-
// Saturation/Luminance gradient
|
237 |
-
jQuery('.color', e).css('backgroundColor', '#'+fb.pack(fb.HSLToRGB([fb.hsl[0], 1, 0.5])));
|
238 |
-
|
239 |
-
// Linked elements or callback
|
240 |
-
if (typeof fb.callback == 'object') {
|
241 |
-
// Set background/foreground color
|
242 |
-
jQuery(fb.callback).css({
|
243 |
-
backgroundColor: '#'+fb.color,
|
244 |
-
color: fb.hsl[2] > 0.5 ? '#000' : '#fff'
|
245 |
-
});
|
246 |
-
|
247 |
-
// Change linked value
|
248 |
-
jQuery(fb.callback).each(function() {
|
249 |
-
if (this.value && this.value != fb.color) {
|
250 |
-
this.value = fb.color;
|
251 |
-
}
|
252 |
-
});
|
253 |
-
}
|
254 |
-
else if (typeof fb.callback == 'function') {
|
255 |
-
fb.callback.call(fb, fb.color);
|
256 |
-
}
|
257 |
-
}
|
258 |
-
|
259 |
-
/**
|
260 |
-
* Get absolute position of element
|
261 |
-
*/
|
262 |
-
fb.absolutePosition = function (el) {
|
263 |
-
var r = { x: el.offsetLeft, y: el.offsetTop };
|
264 |
-
// Resolve relative to offsetParent
|
265 |
-
if (el.offsetParent) {
|
266 |
-
var tmp = fb.absolutePosition(el.offsetParent);
|
267 |
-
r.x += tmp.x;
|
268 |
-
r.y += tmp.y;
|
269 |
-
}
|
270 |
-
return r;
|
271 |
-
};
|
272 |
-
|
273 |
-
/* Various color utility functions */
|
274 |
-
fb.pack = function (rgb) {
|
275 |
-
var r = Math.round(rgb[0] * 255);
|
276 |
-
var g = Math.round(rgb[1] * 255);
|
277 |
-
var b = Math.round(rgb[2] * 255);
|
278 |
-
return (r < 16 ? '0' : '') + r.toString(16) +
|
279 |
-
(g < 16 ? '0' : '') + g.toString(16) +
|
280 |
-
(b < 16 ? '0' : '') + b.toString(16);
|
281 |
-
}
|
282 |
-
|
283 |
-
fb.unpack = function (color) {
|
284 |
-
if (color.length == 6) {
|
285 |
-
return [parseInt('0x' + color.substring(0, 2)) / 255,
|
286 |
-
parseInt('0x' + color.substring(2, 4)) / 255,
|
287 |
-
parseInt('0x' + color.substring(4, 6)) / 255];
|
288 |
-
}
|
289 |
-
else if (color.length == 3) {
|
290 |
-
return [parseInt('0x' + color.substring(0, 1)) / 15,
|
291 |
-
parseInt('0x' + color.substring(1, 2)) / 15,
|
292 |
-
parseInt('0x' + color.substring(2, 3)) / 15];
|
293 |
-
}
|
294 |
-
}
|
295 |
-
|
296 |
-
fb.HSLToRGB = function (hsl) {
|
297 |
-
var m1, m2, r, g, b;
|
298 |
-
var h = hsl[0], s = hsl[1], l = hsl[2];
|
299 |
-
m2 = (l <= 0.5) ? l * (s + 1) : l + s - l*s;
|
300 |
-
m1 = l * 2 - m2;
|
301 |
-
return [this.hueToRGB(m1, m2, h+0.33333),
|
302 |
-
this.hueToRGB(m1, m2, h),
|
303 |
-
this.hueToRGB(m1, m2, h-0.33333)];
|
304 |
-
}
|
305 |
-
|
306 |
-
fb.hueToRGB = function (m1, m2, h) {
|
307 |
-
h = (h < 0) ? h + 1 : ((h > 1) ? h - 1 : h);
|
308 |
-
if (h * 6 < 1) return m1 + (m2 - m1) * h * 6;
|
309 |
-
if (h * 2 < 1) return m2;
|
310 |
-
if (h * 3 < 2) return m1 + (m2 - m1) * (0.66666 - h) * 6;
|
311 |
-
return m1;
|
312 |
-
}
|
313 |
-
|
314 |
-
fb.RGBToHSL = function (rgb) {
|
315 |
-
var min, max, delta, h, s, l;
|
316 |
-
var r = rgb[0], g = rgb[1], b = rgb[2];
|
317 |
-
min = Math.min(r, Math.min(g, b));
|
318 |
-
max = Math.max(r, Math.max(g, b));
|
319 |
-
delta = max - min;
|
320 |
-
l = (min + max) / 2;
|
321 |
-
s = 0;
|
322 |
-
if (l > 0 && l < 1) {
|
323 |
-
s = delta / (l < 0.5 ? (2 * l) : (2 - 2 * l));
|
324 |
-
}
|
325 |
-
h = 0;
|
326 |
-
if (delta > 0) {
|
327 |
-
if (max == r && max != g) h += (g - b) / delta;
|
328 |
-
if (max == g && max != b) h += (2 + (b - r) / delta);
|
329 |
-
if (max == b && max != r) h += (4 + (r - g) / delta);
|
330 |
-
h /= 6;
|
331 |
-
}
|
332 |
-
return [h, s, l];
|
333 |
-
}
|
334 |
-
|
335 |
-
// Install mousedown handler (the others are set on the document on-demand)
|
336 |
-
jQuery('*', e).mousedown(fb.mousedown);
|
337 |
-
|
338 |
-
// Init color
|
339 |
-
fb.setColor('000000');
|
340 |
-
|
341 |
-
// Set linked elements/callback
|
342 |
-
if (callback) {
|
343 |
-
fb.linkTo(callback);
|
344 |
-
}
|
345 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/js/flag.ajax.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
/*
|
2 |
-
* Ajax Plugin for
|
3 |
*/
|
4 |
(function($) {
|
5 |
flagAjax = {
|
1 |
/*
|
2 |
+
* Ajax Plugin for FlaGallery
|
3 |
*/
|
4 |
(function($) {
|
5 |
flagAjax = {
|
admin/js/flagscroll.js
DELETED
@@ -1,33 +0,0 @@
|
|
1 |
-
jQuery(document).ready(function() {
|
2 |
-
jQuery('div.flashalbum').bind("mouseenter",function(){
|
3 |
-
var obj_id = jQuery('object, embed',this).attr('id');
|
4 |
-
var flash = flagFind(obj_id);
|
5 |
-
if(flash && jQuery.isFunction(flash[obj_id])) {
|
6 |
-
flash[obj_id]("false");
|
7 |
-
console.log(flash[obj_id]);
|
8 |
-
}
|
9 |
-
}).bind("mouseleave",function(){
|
10 |
-
var obj_id = jQuery('object, embed',this).attr('id');
|
11 |
-
var flash = flagFind(obj_id);
|
12 |
-
if(flash && jQuery.isFunction(flash[obj_id])) {
|
13 |
-
flash[obj_id]("true");
|
14 |
-
console.log(flash[obj_id]);
|
15 |
-
}
|
16 |
-
});
|
17 |
-
});
|
18 |
-
|
19 |
-
function flagFind(flagName){
|
20 |
-
if (window.document[flagName]){
|
21 |
-
return window.document[flagName];
|
22 |
-
}
|
23 |
-
if (navigator.appName.indexOf("Microsoft Internet")==-1){
|
24 |
-
if (document.embeds && document.embeds[flagName])
|
25 |
-
return document.embeds[flagName];
|
26 |
-
}
|
27 |
-
if (document.getElementById(flagName)){
|
28 |
-
return document.getElementById(flagName);
|
29 |
-
}
|
30 |
-
else {
|
31 |
-
return false;
|
32 |
-
}
|
33 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/js/images/fancy_close.png
DELETED
Binary file
|
admin/js/images/fancy_loading.png
DELETED
Binary file
|
admin/js/images/fancy_nav_left.png
DELETED
Binary file
|
admin/js/images/fancy_nav_right.png
DELETED
Binary file
|
admin/js/images/fancy_nav_slide.png
DELETED
Binary file
|
admin/js/images/fancy_shadow_n.png
DELETED
Binary file
|
admin/js/images/fancy_shadow_s.png
DELETED
Binary file
|
admin/js/images/fancy_shadow_w.png
DELETED
Binary file
|
admin/js/images/fancy_title_over.png
DELETED
Binary file
|
admin/js/images/fancybox-y.png
DELETED
Binary file
|
admin/js/jquery.fancybox-1.3.4.pack.js
DELETED
@@ -1,46 +0,0 @@
|
|
1 |
-
/*
|
2 |
-
* FancyBox - jQuery Plugin
|
3 |
-
* Simple and fancy lightbox alternative
|
4 |
-
*
|
5 |
-
* Examples and documentation at: http://fancybox.net
|
6 |
-
*
|
7 |
-
* Copyright (c) 2008 - 2010 Janis Skarnelis
|
8 |
-
* That said, it is hardly a one-person project. Many people have submitted bugs, code, and offered their advice freely. Their support is greatly appreciated.
|
9 |
-
*
|
10 |
-
* Version: 1.3.4 (11/11/2010)
|
11 |
-
* Requires: jQuery v1.3+
|
12 |
-
*
|
13 |
-
* Dual licensed under the MIT and GPL licenses:
|
14 |
-
* http://www.opensource.org/licenses/mit-license.php
|
15 |
-
* http://www.gnu.org/licenses/gpl.html
|
16 |
-
*/
|
17 |
-
|
18 |
-
;(function(b){var m,t,u,f,D,j,E,n,z,A,q=0,e={},o=[],p=0,d={},l=[],G=null,v=new Image,J=/\.(jpg|gif|png|bmp|jpeg)(.*)?$/i,W=/[^\.]\.(swf)\s*$/i,K,L=1,y=0,s="",r,i,h=false,B=b.extend(b("<div/>")[0],{prop:0}),M=b.browser.msie&&b.browser.version<7&&!window.XMLHttpRequest,N=function(){t.hide();v.onerror=v.onload=null;G&&G.abort();m.empty()},O=function(){if(false===e.onError(o,q,e)){t.hide();h=false}else{e.titleShow=false;e.width="auto";e.height="auto";m.html('<p id="fancybox-error">The requested content cannot be loaded.<br />Please try again later.</p>');
|
19 |
-
F()}},I=function(){var a=o[q],c,g,k,C,P,w;N();e=b.extend({},b.fn.fancybox.defaults,typeof b(a).data("fancybox")=="undefined"?e:b(a).data("fancybox"));w=e.onStart(o,q,e);if(w===false)h=false;else{if(typeof w=="object")e=b.extend(e,w);k=e.title||(a.nodeName?b(a).attr("title"):a.title)||"";if(a.nodeName&&!e.orig)e.orig=b(a).children("img:first").length?b(a).children("img:first"):b(a);if(k===""&&e.orig&&e.titleFromAlt)k=e.orig.attr("alt");c=e.href||(a.nodeName?b(a).attr("href"):a.href)||null;if(/^(?:javascript)/i.test(c)||
|
20 |
-
c=="#")c=null;if(e.type){g=e.type;if(!c)c=e.content}else if(e.content)g="html";else if(c)g=c.match(J)?"image":c.match(W)?"swf":b(a).hasClass("iframe")?"iframe":c.indexOf("#")===0?"inline":"ajax";if(g){if(g=="inline"){a=c.substr(c.indexOf("#"));g=b(a).length>0?"inline":"ajax"}e.type=g;e.href=c;e.title=k;if(e.autoDimensions)if(e.type=="html"||e.type=="inline"||e.type=="ajax"){e.width="auto";e.height="auto"}else e.autoDimensions=false;if(e.modal){e.overlayShow=true;e.hideOnOverlayClick=false;e.hideOnContentClick=
|
21 |
-
false;e.enableEscapeButton=false;e.showCloseButton=false}e.padding=parseInt(e.padding,10);e.margin=parseInt(e.margin,10);m.css("padding",e.padding+e.margin);b(".fancybox-inline-tmp").unbind("fancybox-cancel").bind("fancybox-change",function(){b(this).replaceWith(j.children())});switch(g){case "html":m.html(e.content);F();break;case "inline":if(b(a).parent().is("#fancybox-content")===true){h=false;break}b('<div class="fancybox-inline-tmp" />').hide().insertBefore(b(a)).bind("fancybox-cleanup",function(){b(this).replaceWith(j.children())}).bind("fancybox-cancel",
|
22 |
-
function(){b(this).replaceWith(m.children())});b(a).appendTo(m);F();break;case "image":h=false;b.fancybox.showActivity();v=new Image;v.onerror=function(){O()};v.onload=function(){h=true;v.onerror=v.onload=null;e.width=v.width;e.height=v.height;b("<img />").attr({id:"fancybox-img",src:v.src,alt:e.title}).appendTo(m);Q()};v.src=c;break;case "swf":e.scrolling="no";C='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+e.width+'" height="'+e.height+'"><param name="movie" value="'+c+
|
23 |
-
'"></param>';P="";b.each(e.swf,function(x,H){C+='<param name="'+x+'" value="'+H+'"></param>';P+=" "+x+'="'+H+'"'});C+='<embed src="'+c+'" type="application/x-shockwave-flash" width="'+e.width+'" height="'+e.height+'"'+P+"></embed></object>";m.html(C);F();break;case "ajax":h=false;b.fancybox.showActivity();e.ajax.win=e.ajax.success;G=b.ajax(b.extend({},e.ajax,{url:c,data:e.ajax.data||{},error:function(x){x.status>0&&O()},success:function(x,H,R){if((typeof R=="object"?R:G).status==200){if(typeof e.ajax.win==
|
24 |
-
"function"){w=e.ajax.win(c,x,H,R);if(w===false){t.hide();return}else if(typeof w=="string"||typeof w=="object")x=w}m.html(x);F()}}}));break;case "iframe":Q()}}else O()}},F=function(){var a=e.width,c=e.height;a=a.toString().indexOf("%")>-1?parseInt((b(window).width()-e.margin*2)*parseFloat(a)/100,10)+"px":a=="auto"?"auto":a+"px";c=c.toString().indexOf("%")>-1?parseInt((b(window).height()-e.margin*2)*parseFloat(c)/100,10)+"px":c=="auto"?"auto":c+"px";m.wrapInner('<div style="width:'+a+";height:"+c+
|
25 |
-
";overflow: "+(e.scrolling=="auto"?"auto":e.scrolling=="yes"?"scroll":"hidden")+';position:relative;"></div>');e.width=m.width();e.height=m.height();Q()},Q=function(){var a,c;t.hide();if(f.is(":visible")&&false===d.onCleanup(l,p,d)){b.event.trigger("fancybox-cancel");h=false}else{h=true;b(j.add(u)).unbind();b(window).unbind("resize.fb scroll.fb");b(document).unbind("keydown.fb");f.is(":visible")&&d.titlePosition!=="outside"&&f.css("height",f.height());l=o;p=q;d=e;if(d.overlayShow){u.css({"background-color":d.overlayColor,
|
26 |
-
opacity:d.overlayOpacity,cursor:d.hideOnOverlayClick?"pointer":"auto",height:b(document).height()});if(!u.is(":visible")){M&&b("select:not(#fancybox-tmp select)").filter(function(){return this.style.visibility!=="hidden"}).css({visibility:"hidden"}).one("fancybox-cleanup",function(){this.style.visibility="inherit"});u.show()}}else u.hide();i=X();s=d.title||"";y=0;n.empty().removeAttr("style").removeClass();if(d.titleShow!==false){if(b.isFunction(d.titleFormat))a=d.titleFormat(s,l,p,d);else a=s&&s.length?
|
27 |
-
d.titlePosition=="float"?'<table id="fancybox-title-float-wrap" cellpadding="0" cellspacing="0"><tr><td id="fancybox-title-float-left"></td><td id="fancybox-title-float-main">'+s+'</td><td id="fancybox-title-float-right"></td></tr></table>':'<div id="fancybox-title-'+d.titlePosition+'">'+s+"</div>":false;s=a;if(!(!s||s==="")){n.addClass("fancybox-title-"+d.titlePosition).html(s).appendTo("body").show();switch(d.titlePosition){case "inside":n.css({width:i.width-d.padding*2,marginLeft:d.padding,marginRight:d.padding});
|
28 |
-
y=n.outerHeight(true);n.appendTo(D);i.height+=y;break;case "over":n.css({marginLeft:d.padding,width:i.width-d.padding*2,bottom:d.padding}).appendTo(D);break;case "float":n.css("left",parseInt((n.width()-i.width-40)/2,10)*-1).appendTo(f);break;default:n.css({width:i.width-d.padding*2,paddingLeft:d.padding,paddingRight:d.padding}).appendTo(f)}}}n.hide();if(f.is(":visible")){b(E.add(z).add(A)).hide();a=f.position();r={top:a.top,left:a.left,width:f.width(),height:f.height()};c=r.width==i.width&&r.height==
|
29 |
-
i.height;j.fadeTo(d.changeFade,0.3,function(){var g=function(){j.html(m.contents()).fadeTo(d.changeFade,1,S)};b.event.trigger("fancybox-change");j.empty().removeAttr("filter").css({"border-width":d.padding,width:i.width-d.padding*2,height:e.autoDimensions?"auto":i.height-y-d.padding*2});if(c)g();else{B.prop=0;b(B).animate({prop:1},{duration:d.changeSpeed,easing:d.easingChange,step:T,complete:g})}})}else{f.removeAttr("style");j.css("border-width",d.padding);if(d.transitionIn=="elastic"){r=V();j.html(m.contents());
|
30 |
-
f.show();if(d.opacity)i.opacity=0;B.prop=0;b(B).animate({prop:1},{duration:d.speedIn,easing:d.easingIn,step:T,complete:S})}else{d.titlePosition=="inside"&&y>0&&n.show();j.css({width:i.width-d.padding*2,height:e.autoDimensions?"auto":i.height-y-d.padding*2}).html(m.contents());f.css(i).fadeIn(d.transitionIn=="none"?0:d.speedIn,S)}}}},Y=function(){if(d.enableEscapeButton||d.enableKeyboardNav)b(document).bind("keydown.fb",function(a){if(a.keyCode==27&&d.enableEscapeButton){a.preventDefault();b.fancybox.close()}else if((a.keyCode==
|
31 |
-
37||a.keyCode==39)&&d.enableKeyboardNav&&a.target.tagName!=="INPUT"&&a.target.tagName!=="TEXTAREA"&&a.target.tagName!=="SELECT"){a.preventDefault();b.fancybox[a.keyCode==37?"prev":"next"]()}});if(d.showNavArrows){if(d.cyclic&&l.length>1||p!==0)z.show();if(d.cyclic&&l.length>1||p!=l.length-1)A.show()}else{z.hide();A.hide()}},S=function(){if(!b.support.opacity){j.get(0).style.removeAttribute("filter");f.get(0).style.removeAttribute("filter")}e.autoDimensions&&j.css("height","auto");f.css("height","auto");
|
32 |
-
s&&s.length&&n.show();d.showCloseButton&&E.show();Y();d.hideOnContentClick&&j.bind("click",b.fancybox.close);d.hideOnOverlayClick&&u.bind("click",b.fancybox.close);b(window).bind("resize.fb",b.fancybox.resize);d.centerOnScroll&&b(window).bind("scroll.fb",b.fancybox.center);if(d.type=="iframe")b('<iframe id="fancybox-frame" name="fancybox-frame'+(new Date).getTime()+'" frameborder="0" hspace="0" '+(b.browser.msie?'allowtransparency="true""':"")+' scrolling="'+e.scrolling+'" src="'+d.href+'"></iframe>').appendTo(j);
|
33 |
-
f.show();h=false;b.fancybox.center();d.onComplete(l,p,d);var a,c;if(l.length-1>p){a=l[p+1].href;if(typeof a!=="undefined"&&a.match(J)){c=new Image;c.src=a}}if(p>0){a=l[p-1].href;if(typeof a!=="undefined"&&a.match(J)){c=new Image;c.src=a}}},T=function(a){var c={width:parseInt(r.width+(i.width-r.width)*a,10),height:parseInt(r.height+(i.height-r.height)*a,10),top:parseInt(r.top+(i.top-r.top)*a,10),left:parseInt(r.left+(i.left-r.left)*a,10)};if(typeof i.opacity!=="undefined")c.opacity=a<0.5?0.5:a;f.css(c);
|
34 |
-
j.css({width:c.width-d.padding*2,height:c.height-y*a-d.padding*2})},U=function(){return[b(window).width()-d.margin*2,b(window).height()-d.margin*2,b(document).scrollLeft()+d.margin,b(document).scrollTop()+d.margin]},X=function(){var a=U(),c={},g=d.autoScale,k=d.padding*2;c.width=d.width.toString().indexOf("%")>-1?parseInt(a[0]*parseFloat(d.width)/100,10):d.width+k;c.height=d.height.toString().indexOf("%")>-1?parseInt(a[1]*parseFloat(d.height)/100,10):d.height+k;if(g&&(c.width>a[0]||c.height>a[1]))if(e.type==
|
35 |
-
"image"||e.type=="swf"){g=d.width/d.height;if(c.width>a[0]){c.width=a[0];c.height=parseInt((c.width-k)/g+k,10)}if(c.height>a[1]){c.height=a[1];c.width=parseInt((c.height-k)*g+k,10)}}else{c.width=Math.min(c.width,a[0]);c.height=Math.min(c.height,a[1])}c.top=parseInt(Math.max(a[3]-20,a[3]+(a[1]-c.height-40)*0.5),10);c.left=parseInt(Math.max(a[2]-20,a[2]+(a[0]-c.width-40)*0.5),10);return c},V=function(){var a=e.orig?b(e.orig):false,c={};if(a&&a.length){c=a.offset();c.top+=parseInt(a.css("paddingTop"),
|
36 |
-
10)||0;c.left+=parseInt(a.css("paddingLeft"),10)||0;c.top+=parseInt(a.css("border-top-width"),10)||0;c.left+=parseInt(a.css("border-left-width"),10)||0;c.width=a.width();c.height=a.height();c={width:c.width+d.padding*2,height:c.height+d.padding*2,top:c.top-d.padding-20,left:c.left-d.padding-20}}else{a=U();c={width:d.padding*2,height:d.padding*2,top:parseInt(a[3]+a[1]*0.5,10),left:parseInt(a[2]+a[0]*0.5,10)}}return c},Z=function(){if(t.is(":visible")){b("div",t).css("top",L*-40+"px");L=(L+1)%12}else clearInterval(K)};
|
37 |
-
b.fn.fancybox=function(a){if(!b(this).length)return this;b(this).data("fancybox",b.extend({},a,b.metadata?b(this).metadata():{})).unbind("click.fb").bind("click.fb",function(c){c.preventDefault();if(!h){h=true;b(this).blur();o=[];q=0;c=b(this).attr("rel")||"";if(!c||c==""||c==="nofollow")o.push(this);else{o=b("a[rel="+c+"], area[rel="+c+"]");q=o.index(this)}I()}});return this};b.fancybox=function(a,c){var g;if(!h){h=true;g=typeof c!=="undefined"?c:{};o=[];q=parseInt(g.index,10)||0;if(b.isArray(a)){for(var k=
|
38 |
-
0,C=a.length;k<C;k++)if(typeof a[k]=="object")b(a[k]).data("fancybox",b.extend({},g,a[k]));else a[k]=b({}).data("fancybox",b.extend({content:a[k]},g));o=jQuery.merge(o,a)}else{if(typeof a=="object")b(a).data("fancybox",b.extend({},g,a));else a=b({}).data("fancybox",b.extend({content:a},g));o.push(a)}if(q>o.length||q<0)q=0;I()}};b.fancybox.showActivity=function(){clearInterval(K);t.show();K=setInterval(Z,66)};b.fancybox.hideActivity=function(){t.hide()};b.fancybox.next=function(){return b.fancybox.pos(p+
|
39 |
-
1)};b.fancybox.prev=function(){return b.fancybox.pos(p-1)};b.fancybox.pos=function(a){if(!h){a=parseInt(a);o=l;if(a>-1&&a<l.length){q=a;I()}else if(d.cyclic&&l.length>1){q=a>=l.length?0:l.length-1;I()}}};b.fancybox.cancel=function(){if(!h){h=true;b.event.trigger("fancybox-cancel");N();e.onCancel(o,q,e);h=false}};b.fancybox.close=function(){function a(){u.fadeOut("fast");n.empty().hide();f.hide();b.event.trigger("fancybox-cleanup");j.empty();d.onClosed(l,p,d);l=e=[];p=q=0;d=e={};h=false}if(!(h||f.is(":hidden"))){h=
|
40 |
-
true;if(d&&false===d.onCleanup(l,p,d))h=false;else{N();b(E.add(z).add(A)).hide();b(j.add(u)).unbind();b(window).unbind("resize.fb scroll.fb");b(document).unbind("keydown.fb");j.find("iframe").attr("src",M&&/^https/i.test(window.location.href||"")?"javascript:void(false)":"about:blank");d.titlePosition!=="inside"&&n.empty();f.stop();if(d.transitionOut=="elastic"){r=V();var c=f.position();i={top:c.top,left:c.left,width:f.width(),height:f.height()};if(d.opacity)i.opacity=1;n.empty().hide();B.prop=1;
|
41 |
-
b(B).animate({prop:0},{duration:d.speedOut,easing:d.easingOut,step:T,complete:a})}else f.fadeOut(d.transitionOut=="none"?0:d.speedOut,a)}}};b.fancybox.resize=function(){u.is(":visible")&&u.css("height",b(document).height());b.fancybox.center(true)};b.fancybox.center=function(a){var c,g;if(!h){g=a===true?1:0;c=U();!g&&(f.width()>c[0]||f.height()>c[1])||f.stop().animate({top:parseInt(Math.max(c[3]-20,c[3]+(c[1]-j.height()-40)*0.5-d.padding)),left:parseInt(Math.max(c[2]-20,c[2]+(c[0]-j.width()-40)*0.5-
|
42 |
-
d.padding))},typeof a=="number"?a:200)}};b.fancybox.init=function(){if(!b("#fancybox-wrap").length){b("body").append(m=b('<div id="fancybox-tmp"></div>'),t=b('<div id="fancybox-loading"><div></div></div>'),u=b('<div id="fancybox-overlay"></div>'),f=b('<div id="fancybox-wrap"></div>'));D=b('<div id="fancybox-outer"></div>').append('<div class="fancybox-bg" id="fancybox-bg-n"></div><div class="fancybox-bg" id="fancybox-bg-ne"></div><div class="fancybox-bg" id="fancybox-bg-e"></div><div class="fancybox-bg" id="fancybox-bg-se"></div><div class="fancybox-bg" id="fancybox-bg-s"></div><div class="fancybox-bg" id="fancybox-bg-sw"></div><div class="fancybox-bg" id="fancybox-bg-w"></div><div class="fancybox-bg" id="fancybox-bg-nw"></div>').appendTo(f);
|
43 |
-
D.append(j=b('<div id="fancybox-content"></div>'),E=b('<a id="fancybox-close"></a>'),n=b('<div id="fancybox-title"></div>'),z=b('<a href="javascript:;" id="fancybox-left"><span class="fancy-ico" id="fancybox-left-ico"></span></a>'),A=b('<a href="javascript:;" id="fancybox-right"><span class="fancy-ico" id="fancybox-right-ico"></span></a>'));E.click(b.fancybox.close);t.click(b.fancybox.cancel);z.click(function(a){a.preventDefault();b.fancybox.prev()});A.click(function(a){a.preventDefault();b.fancybox.next()});
|
44 |
-
b.fn.mousewheel&&f.bind("mousewheel.fb",function(a,c){if(h)a.preventDefault();else if(b(a.target).get(0).clientHeight==0||b(a.target).get(0).scrollHeight===b(a.target).get(0).clientHeight){a.preventDefault();b.fancybox[c>0?"prev":"next"]()}});b.support.opacity||f.addClass("fancybox-ie");if(M){t.addClass("fancybox-ie6");f.addClass("fancybox-ie6");b('<iframe id="fancybox-hide-sel-frame" src="'+(/^https/i.test(window.location.href||"")?"javascript:void(false)":"about:blank")+'" scrolling="no" border="0" frameborder="0" tabindex="-1"></iframe>').prependTo(D)}}};
|
45 |
-
b.fn.fancybox.defaults={padding:10,margin:40,opacity:false,modal:false,cyclic:false,scrolling:"auto",width:560,height:340,autoScale:true,autoDimensions:true,centerOnScroll:false,ajax:{},swf:{wmode:"transparent"},hideOnOverlayClick:true,hideOnContentClick:false,overlayShow:true,overlayOpacity:0.7,overlayColor:"#777",titleShow:true,titlePosition:"float",titleFormat:null,titleFromAlt:false,transitionIn:"fade",transitionOut:"fade",speedIn:300,speedOut:300,changeSpeed:300,changeFade:"fast",easingIn:"swing",
|
46 |
-
easingOut:"swing",showCloseButton:true,showNavArrows:true,enableEscapeButton:true,enableKeyboardNav:true,onStart:function(){},onCancel:function(){},onComplete:function(){},onCleanup:function(){},onClosed:function(){},onError:function(){}};b(document).ready(function(){b.fancybox.init()})})(jQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/js/jquery.js
DELETED
@@ -1,18 +0,0 @@
|
|
1 |
-
/*!
|
2 |
-
* jQuery JavaScript Library v1.6.1
|
3 |
-
* http://jquery.com/
|
4 |
-
*
|
5 |
-
* Copyright 2011, John Resig
|
6 |
-
* Dual licensed under the MIT or GPL Version 2 licenses.
|
7 |
-
* http://jquery.org/license
|
8 |
-
*
|
9 |
-
* Includes Sizzle.js
|
10 |
-
* http://sizzlejs.com/
|
11 |
-
* Copyright 2011, The Dojo Foundation
|
12 |
-
* Released under the MIT, BSD, and GPL Licenses.
|
13 |
-
*
|
14 |
-
* Date: Thu May 12 15:04:36 2011 -0400
|
15 |
-
*/
|
16 |
-
(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cv(a){if(!cj[a]){var b=f("<"+a+">").appendTo("body"),d=b.css("display");b.remove();if(d==="none"||d===""){ck||(ck=c.createElement("iframe"),ck.frameBorder=ck.width=ck.height=0),c.body.appendChild(ck);if(!cl||!ck.createElement)cl=(ck.contentWindow||ck.contentDocument).document,cl.write("<!doctype><html><body></body></html>");b=cl.createElement(a),cl.body.appendChild(b),d=f.css(b,"display"),c.body.removeChild(ck)}cj[a]=d}return cj[a]}function cu(a,b){var c={};f.each(cp.concat.apply([],cp.slice(0,b)),function(){c[this]=a});return c}function ct(){cq=b}function cs(){setTimeout(ct,0);return cq=f.now()}function ci(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ch(){try{return new a.XMLHttpRequest}catch(b){}}function cb(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g<i;g++){if(g===1)for(h in a.converters)typeof h=="string"&&(e[h.toLowerCase()]=a.converters[h]);l=k,k=d[g];if(k==="*")k=l;else if(l!=="*"&&l!==k){m=l+" "+k,n=e[m]||e["* "+k];if(!n){p=b;for(o in e){j=o.split(" ");if(j[0]===l||j[0]==="*"){p=e[j[1]+" "+k];if(p){o=e[o],o===!0?n=p:p===!0&&(n=o);break}}}}!n&&!p&&f.error("No conversion from "+m.replace(" "," to ")),n!==!0&&(c=n?n(c):p(o(c)))}}return c}function ca(a,c,d){var e=a.contents,f=a.dataTypes,g=a.responseFields,h,i,j,k;for(i in g)i in d&&(c[g[i]]=d[i]);while(f[0]==="*")f.shift(),h===b&&(h=a.mimeType||c.getResponseHeader("content-type"));if(h)for(i in e)if(e[i]&&e[i].test(h)){f.unshift(i);break}if(f[0]in d)j=f[0];else{for(i in d){if(!f[0]||a.converters[i+" "+f[0]]){j=i;break}k||(k=i)}j=j||k}if(j){j!==f[0]&&f.unshift(j);return d[j]}}function b_(a,b,c,d){if(f.isArray(b))f.each(b,function(b,e){c||bF.test(a)?d(a,e):b_(a+"["+(typeof e=="object"||f.isArray(e)?b:"")+"]",e,c,d)});else if(!c&&b!=null&&typeof b=="object")for(var e in b)b_(a+"["+e+"]",b[e],c,d);else d(a,b)}function b$(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;var h=a[f],i=0,j=h?h.length:0,k=a===bU,l;for(;i<j&&(k||!l);i++)l=h[i](c,d,e),typeof l=="string"&&(!k||g[l]?l=b:(c.dataTypes.unshift(l),l=b$(a,c,d,e,l,g)));(k||!l)&&!g["*"]&&(l=b$(a,c,d,e,"*",g));return l}function bZ(a){return function(b,c){typeof b!="string"&&(c=b,b="*");if(f.isFunction(c)){var d=b.toLowerCase().split(bQ),e=0,g=d.length,h,i,j;for(;e<g;e++)h=d[e],j=/^\+/.test(h),j&&(h=h.substr(1)||"*"),i=a[h]=a[h]||[],i[j?"unshift":"push"](c)}}}function bD(a,b,c){var d=b==="width"?bx:by,e=b==="width"?a.offsetWidth:a.offsetHeight;if(c==="border")return e;f.each(d,function(){c||(e-=parseFloat(f.css(a,"padding"+this))||0),c==="margin"?e+=parseFloat(f.css(a,"margin"+this))||0:e-=parseFloat(f.css(a,"border"+this+"Width"))||0});return e}function bn(a,b){b.src?f.ajax({url:b.src,async:!1,dataType:"script"}):f.globalEval((b.text||b.textContent||b.innerHTML||"").replace(bf,"/*$0*/")),b.parentNode&&b.parentNode.removeChild(b)}function bm(a){f.nodeName(a,"input")?bl(a):a.getElementsByTagName&&f.grep(a.getElementsByTagName("input"),bl)}function bl(a){if(a.type==="checkbox"||a.type==="radio")a.defaultChecked=a.checked}function bk(a){return"getElementsByTagName"in a?a.getElementsByTagName("*"):"querySelectorAll"in a?a.querySelectorAll("*"):[]}function bj(a,b){var c;if(b.nodeType===1){b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase();if(c==="object")b.outerHTML=a.outerHTML;else if(c!=="input"||a.type!=="checkbox"&&a.type!=="radio"){if(c==="option")b.selected=a.defaultSelected;else if(c==="input"||c==="textarea")b.defaultValue=a.defaultValue}else a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value);b.removeAttribute(f.expando)}}function bi(a,b){if(b.nodeType===1&&!!f.hasData(a)){var c=f.expando,d=f.data(a),e=f.data(b,d);if(d=d[c]){var g=d.events;e=e[c]=f.extend({},d);if(g){delete e.handle,e.events={};for(var h in g)for(var i=0,j=g[h].length;i<j;i++)f.event.add(b,h+(g[h][i].namespace?".":"")+g[h][i].namespace,g[h][i],g[h][i].data)}}}}function bh(a,b){return f.nodeName(a,"table")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function X(a,b,c){b=b||0;if(f.isFunction(b))return f.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return f.grep(a,function(a,d){return a===b===c});if(typeof b=="string"){var d=f.grep(a,function(a){return a.nodeType===1});if(S.test(b))return f.filter(b,d,!c);b=f.filter(b,d)}return f.grep(a,function(a,d){return f.inArray(a,b)>=0===c})}function W(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function O(a,b){return(a&&a!=="*"?a+".":"")+b.replace(A,"`").replace(B,"&")}function N(a){var b,c,d,e,g,h,i,j,k,l,m,n,o,p=[],q=[],r=f._data(this,"events");if(!(a.liveFired===this||!r||!r.live||a.target.disabled||a.button&&a.type==="click")){a.namespace&&(n=new RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)")),a.liveFired=this;var s=r.live.slice(0);for(i=0;i<s.length;i++)g=s[i],g.origType.replace(y,"")===a.type?q.push(g.selector):s.splice(i--,1);e=f(a.target).closest(q,a.currentTarget);for(j=0,k=e.length;j<k;j++){m=e[j];for(i=0;i<s.length;i++){g=s[i];if(m.selector===g.selector&&(!n||n.test(g.namespace))&&!m.elem.disabled){h=m.elem,d=null;if(g.preType==="mouseenter"||g.preType==="mouseleave")a.type=g.preType,d=f(a.relatedTarget).closest(g.selector)[0],d&&f.contains(h,d)&&(d=h);(!d||d!==h)&&p.push({elem:h,handleObj:g,level:m.level})}}}for(j=0,k=p.length;j<k;j++){e=p[j];if(c&&e.level>c)break;a.currentTarget=e.elem,a.data=e.handleObj.data,a.handleObj=e.handleObj,o=e.handleObj.origHandler.apply(e.elem,arguments);if(o===!1||a.isPropagationStopped()){c=e.level,o===!1&&(b=!1);if(a.isImmediatePropagationStopped())break}}return b}}function L(a,c,d){var e=f.extend({},d[0]);e.type=a,e.originalEvent={},e.liveFired=b,f.event.handle.call(c,e),e.isDefaultPrevented()&&d[0].preventDefault()}function F(){return!0}function E(){return!1}function m(a,c,d){var e=c+"defer",g=c+"queue",h=c+"mark",i=f.data(a,e,b,!0);i&&(d==="queue"||!f.data(a,g,b,!0))&&(d==="mark"||!f.data(a,h,b,!0))&&setTimeout(function(){!f.data(a,g,b,!0)&&!f.data(a,h,b,!0)&&(f.removeData(a,e,!0),i.resolve())},0)}function l(a){for(var b in a)if(b!=="toJSON")return!1;return!0}function k(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(j,"$1-$2").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNaN(d)?i.test(d)?f.parseJSON(d):d:parseFloat(d)}catch(g){}f.data(a,c,d)}else d=b}return d}var c=a.document,d=a.navigator,e=a.location,f=function(){function H(){if(!e.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(H,1);return}e.ready()}}var e=function(a,b){return new e.fn.init(a,b,h)},f=a.jQuery,g=a.$,h,i=/^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/\d/,n=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,o=/^[\],:{}\s]*$/,p=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,q=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,r=/(?:^|:|,)(?:\s*\[)+/g,s=/(webkit)[ \/]([\w.]+)/,t=/(opera)(?:.*version)?[ \/]([\w.]+)/,u=/(msie) ([\w.]+)/,v=/(mozilla)(?:.*? rv:([\w.]+))?/,w=d.userAgent,x,y,z,A=Object.prototype.toString,B=Object.prototype.hasOwnProperty,C=Array.prototype.push,D=Array.prototype.slice,E=String.prototype.trim,F=Array.prototype.indexOf,G={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=n.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.6.1",length:0,size:function(){return this.length},toArray:function(){return D.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?C.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),y.done(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(D.apply(this,arguments),"slice",D.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:C,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j<k;j++)if((a=arguments[j])!=null)for(c in a){d=i[c],f=a[c];if(i===f)continue;l&&f&&(e.isPlainObject(f)||(g=e.isArray(f)))?(g?(g=!1,h=d&&e.isArray(d)?d:[]):h=d&&e.isPlainObject(d)?d:{},i[c]=e.extend(l,h,f)):f!==b&&(i[c]=f)}return i},e.extend({noConflict:function(b){a.$===e&&(a.$=g),b&&a.jQuery===e&&(a.jQuery=f);return e},isReady:!1,readyWait:1,holdReady:function(a){a?e.readyWait++:e.ready(!0)},ready:function(a){if(a===!0&&!--e.readyWait||a!==!0&&!e.isReady){if(!c.body)return setTimeout(e.ready,1);e.isReady=!0;if(a!==!0&&--e.readyWait>0)return;y.resolveWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").unbind("ready")}},bindReady:function(){if(!y){y=e._Deferred();if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",z,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",z),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&H()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNaN:function(a){return a==null||!m.test(a)||isNaN(a)},type:function(a){return a==null?String(a):G[A.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;if(a.constructor&&!B.call(a,"constructor")&&!B.call(a.constructor.prototype,"isPrototypeOf"))return!1;var c;for(c in a);return c===b||B.call(a,c)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw a},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(o.test(b.replace(p,"@").replace(q,"]").replace(r,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(b,c,d){a.DOMParser?(d=new DOMParser,c=d.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b)),d=c.documentElement,(!d||!d.nodeName||d.nodeName==="parsererror")&&e.error("Invalid XML: "+b);return c},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g<h;)if(c.apply(a[g++],d)===!1)break}else if(i){for(f in a)if(c.call(a[f],f,a[f])===!1)break}else for(;g<h;)if(c.call(a[g],g,a[g++])===!1)break;return a},trim:E?function(a){return a==null?"":E.call(a)}:function(a){return a==null?"":(a+"").replace(k,"").replace(l,"")},makeArray:function(a,b){var c=b||[];if(a!=null){var d=e.type(a);a.length==null||d==="string"||d==="function"||d==="regexp"||e.isWindow(a)?C.call(c,a):e.merge(c,a)}return c},inArray:function(a,b){if(F)return F.call(b,a);for(var c=0,d=b.length;c<d;c++)if(b[c]===a)return c;return-1},merge:function(a,c){var d=a.length,e=0;if(typeof c.length=="number")for(var f=c.length;e<f;e++)a[d++]=c[e];else while(c[e]!==b)a[d++]=c[e++];a.length=d;return a},grep:function(a,b,c){var d=[],e;c=!!c;for(var f=0,g=a.length;f<g;f++)e=!!b(a[f],f),c!==e&&d.push(a[f]);return d},map:function(a,c,d){var f,g,h=[],i=0,j=a.length,k=a instanceof e||j!==b&&typeof j=="number"&&(j>0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i<j;i++)f=c(a[i],i,d),f!=null&&(h[h.length]=f);else for(g in a)f=c(a[g],g,d),f!=null&&(h[h.length]=f);return h.concat.apply([],h)},guid:1,proxy:function(a,c){if(typeof c=="string"){var d=a[c];c=a,a=d}if(!e.isFunction(a))return b;var f=D.call(arguments,2),g=function(){return a.apply(c,f.concat(D.call(arguments)))};g.guid=a.guid=a.guid||g.guid||e.guid++;return g},access:function(a,c,d,f,g,h){var i=a.length;if(typeof c=="object"){for(var j in c)e.access(a,j,c[j],f,g,d);return a}if(d!==b){f=!h&&f&&e.isFunction(d);for(var k=0;k<i;k++)g(a[k],c,f?d.call(a[k],k,g(a[k],c)):d,h);return a}return i?g(a[0],c):b},now:function(){return(new Date).getTime()},uaMatch:function(a){a=a.toLowerCase();var b=s.exec(a)||t.exec(a)||u.exec(a)||a.indexOf("compatible")<0&&v.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},sub:function(){function a(b,c){return new a.fn.init(b,c)}e.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function(d,f){f&&f instanceof e&&!(f instanceof a)&&(f=a(f));return e.fn.init.call(this,d,f,b)},a.fn.init.prototype=a.fn;var b=a(c);return a},browser:{}}),e.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){G["[object "+b+"]"]=b.toLowerCase()}),x=e.uaMatch(w),x.browser&&(e.browser[x.browser]=!0,e.browser.version=x.version),e.browser.webkit&&(e.browser.safari=!0),j.test(" ")&&(k=/^[\s\xA0]+/,l=/[\s\xA0]+$/),h=e(c),c.addEventListener?z=function(){c.removeEventListener("DOMContentLoaded",z,!1),e.ready()}:c.attachEvent&&(z=function(){c.readyState==="complete"&&(c.detachEvent("onreadystatechange",z),e.ready())});return e}(),g="done fail isResolved isRejected promise then always pipe".split(" "),h=[].slice;f.extend({_Deferred:function(){var a=[],b,c,d,e={done:function(){if(!d){var c=arguments,g,h,i,j,k;b&&(k=b,b=0);for(g=0,h=c.length;g<h;g++)i=c[g],j=f.type(i),j==="array"?e.done.apply(e,i):j==="function"&&a.push(i);k&&e.resolveWith(k[0],k[1])}return this},resolveWith:function(e,f){if(!d&&!b&&!c){f=f||[],c=1;try{while(a[0])a.shift().apply(e,f)}finally{b=[e,f],c=0}}return this},resolve:function(){e.resolveWith(this,arguments);return this},isResolved:function(){return!!c||!!b},cancel:function(){d=1,a=[];return this}};return e},Deferred:function(a){var b=f._Deferred(),c=f._Deferred(),d;f.extend(b,{then:function(a,c){b.done(a).fail(c);return this},always:function(){return b.done.apply(b,arguments).fail.apply(this,arguments)},fail:c.done,rejectWith:c.resolveWith,reject:c.resolve,isRejected:c.isResolved,pipe:function(a,c){return f.Deferred(function(d){f.each({done:[a,"resolve"],fail:[c,"reject"]},function(a,c){var e=c[0],g=c[1],h;f.isFunction(e)?b[a](function(){h=e.apply(this,arguments),h&&f.isFunction(h.promise)?h.promise().then(d.resolve,d.reject):d[g](h)}):b[a](d[g])})}).promise()},promise:function(a){if(a==null){if(d)return d;d=a={}}var c=g.length;while(c--)a[g[c]]=b[g[c]];return a}}),b.done(c.cancel).fail(b.cancel),delete b.cancel,a&&a.call(b,b);return b},when:function(a){function i(a){return function(c){b[a]=arguments.length>1?h.call(arguments,0):c,--e||g.resolveWith(g,h.call(b,0))}}var b=arguments,c=0,d=b.length,e=d,g=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred();if(d>1){for(;c<d;c++)b[c]&&f.isFunction(b[c].promise)?b[c].promise().then(i(c),g.reject):--e;e||g.resolveWith(g,b)}else g!==a&&g.resolveWith(g,d?[a]:[]);return g.promise()}}),f.support=function(){var a=c.createElement("div"),b=c.documentElement,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r;a.setAttribute("className","t"),a.innerHTML=" <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>",d=a.getElementsByTagName("*"),e=a.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};f=c.createElement("select"),g=f.appendChild(c.createElement("option")),h=a.getElementsByTagName("input")[0],j={leadingWhitespace:a.firstChild.nodeType===3,tbody:!a.getElementsByTagName("tbody").length,htmlSerialize:!!a.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55$/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:h.value==="on",optSelected:g.selected,getSetAttribute:a.className!=="t",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},h.checked=!0,j.noCloneChecked=h.cloneNode(!0).checked,f.disabled=!0,j.optDisabled=!g.disabled;try{delete a.test}catch(s){j.deleteExpando=!1}!a.addEventListener&&a.attachEvent&&a.fireEvent&&(a.attachEvent("onclick",function b(){j.noCloneEvent=!1,a.detachEvent("onclick",b)}),a.cloneNode(!0).fireEvent("onclick")),h=c.createElement("input"),h.value="t",h.setAttribute("type","radio"),j.radioValue=h.value==="t",h.setAttribute("checked","checked"),a.appendChild(h),k=c.createDocumentFragment(),k.appendChild(a.firstChild),j.checkClone=k.cloneNode(!0).cloneNode(!0).lastChild.checked,a.innerHTML="",a.style.width=a.style.paddingLeft="1px",l=c.createElement("body"),m={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"};for(q in m)l.style[q]=m[q];l.appendChild(a),b.insertBefore(l,b.firstChild),j.appendChecked=h.checked,j.boxModel=a.offsetWidth===2,"zoom"in a.style&&(a.style.display="inline",a.style.zoom=1,j.inlineBlockNeedsLayout=a.offsetWidth===2,a.style.display="",a.innerHTML="<div style='width:4px;'></div>",j.shrinkWrapBlocks=a.offsetWidth!==2),a.innerHTML="<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>",n=a.getElementsByTagName("td"),r=n[0].offsetHeight===0,n[0].style.display="",n[1].style.display="none",j.reliableHiddenOffsets=r&&n[0].offsetHeight===0,a.innerHTML="",c.defaultView&&c.defaultView.getComputedStyle&&(i=c.createElement("div"),i.style.width="0",i.style.marginRight="0",a.appendChild(i),j.reliableMarginRight=(parseInt((c.defaultView.getComputedStyle(i,null)||{marginRight:0}).marginRight,10)||0)===0),l.innerHTML="",b.removeChild(l);if(a.attachEvent)for(q in{submit:1,change:1,focusin:1})p="on"+q,r=p in a,r||(a.setAttribute(p,"return;"),r=typeof a[p]=="function"),j[q+"Bubbles"]=r;return j}(),f.boxModel=f.support.boxModel;var i=/^(?:\{.*\}|\[.*\])$/,j=/([a-z])([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!l(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g=f.expando,h=typeof c=="string",i,j=a.nodeType,k=j?f.cache:a,l=j?a[f.expando]:a[f.expando]&&f.expando;if((!l||e&&l&&!k[l][g])&&h&&d===b)return;l||(j?a[f.expando]=l=++f.uuid:l=f.expando),k[l]||(k[l]={},j||(k[l].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?k[l][g]=f.extend(k[l][g],c):k[l]=f.extend(k[l],c);i=k[l],e&&(i[g]||(i[g]={}),i=i[g]),d!==b&&(i[f.camelCase(c)]=d);if(c==="events"&&!i[c])return i[g]&&i[g].events;return h?i[f.camelCase(c)]:i}},removeData:function(b,c,d){if(!!f.acceptData(b)){var e=f.expando,g=b.nodeType,h=g?f.cache:b,i=g?b[f.expando]:f.expando;if(!h[i])return;if(c){var j=d?h[i][e]:h[i];if(j){delete j[c];if(!l(j))return}}if(d){delete h[i][e];if(!l(h[i]))return}var k=h[i][e];f.support.deleteExpando||h!=a?delete h[i]:h[i]=null,k?(h[i]={},g||(h[i].toJSON=f.noop),h[i][e]=k):g&&(f.support.deleteExpando?delete b[f.expando]:b.removeAttribute?b.removeAttribute(f.expando):b[f.expando]=null)}},_data:function(a,b,c){return f.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=f.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),f.fn.extend({data:function(a,c){var d=null;if(typeof a=="undefined"){if(this.length){d=f.data(this[0]);if(this[0].nodeType===1){var e=this[0].attributes,g;for(var h=0,i=e.length;h<i;h++)g=e[h].name,g.indexOf("data-")===0&&(g=f.camelCase(g.substring(5)),k(this[0],g,d[g]))}}return d}if(typeof a=="object")return this.each(function(){f.data(this,a)});var j=a.split(".");j[1]=j[1]?"."+j[1]:"";if(c===b){d=this.triggerHandler("getData"+j[1]+"!",[j[0]]),d===b&&this.length&&(d=f.data(this[0],a),d=k(this[0],a,d));return d===b&&j[1]?this.data(j[0]):d}return this.each(function(){var b=f(this),d=[j[0],c];b.triggerHandler("setData"+j[1]+"!",d),f.data(this,a,c),b.triggerHandler("changeData"+j[1]+"!",d)})},removeData:function(a){return this.each(function(){f.removeData(this,a)})}}),f.extend({_mark:function(a,c){a&&(c=(c||"fx")+"mark",f.data(a,c,(f.data(a,c,b,!0)||0)+1,!0))},_unmark:function(a,c,d){a!==!0&&(d=c,c=a,a=!1);if(c){d=d||"fx";var e=d+"mark",g=a?0:(f.data(c,e,b,!0)||1)-1;g?f.data(c,e,g,!0):(f.removeData(c,e,!0),m(c,d,"mark"))}},queue:function(a,c,d){if(a){c=(c||"fx")+"queue";var e=f.data(a,c,b,!0);d&&(!e||f.isArray(d)?e=f.data(a,c,f.makeArray(d),!0):e.push(d));return e||[]}},dequeue:function(a,b){b=b||"fx";var c=f.queue(a,b),d=c.shift(),e;d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),d.call(a,function(){f.dequeue(a,b)})),c.length||(f.removeData(a,b+"queue",!0),m(a,b,"queue"))}}),f.fn.extend({queue:function(a,c){typeof a!="string"&&(c=a,a="fx");if(c===b)return f.queue(this[0],a);return this.each(function(){var b=f.queue(this,a,c);a==="fx"&&b[0]!=="inprogress"&&f.dequeue(this,a)})},dequeue:function(a){return this.each(function(){f.dequeue(this,a)})},delay:function(a,b){a=f.fx?f.fx.speeds[a]||a:a,b=b||"fx";return this.queue(b,function(){var c=this;setTimeout(function(){f.dequeue(c,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,c){function m(){--h||d.resolveWith(e,[e])}typeof a!="string"&&(c=a,a=b),a=a||"fx";var d=f.Deferred(),e=this,g=e.length,h=1,i=a+"defer",j=a+"queue",k=a+"mark",l;while(g--)if(l=f.data(e[g],i,b,!0)||(f.data(e[g],j,b,!0)||f.data(e[g],k,b,!0))&&f.data(e[g],i,f._Deferred(),!0))h++,l.done(m);m();return d.promise()}});var n=/[\n\t\r]/g,o=/\s+/,p=/\r/g,q=/^(?:button|input)$/i,r=/^(?:button|input|object|select|textarea)$/i,s=/^a(?:rea)?$/i,t=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,u=/\:/,v,w;f.fn.extend({attr:function(a,b){return f.access(this,a,b,!0,f.attr)},removeAttr:function(a){return this.each(function(){f.removeAttr(this,a)})},prop:function(a,b){return f.access(this,a,b,!0,f.prop)},removeProp:function(a){a=f.propFix[a]||a;return this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.addClass(a.call(this,b,c.attr("class")||""))});if(a&&typeof a=="string"){var b=(a||"").split(o);for(var c=0,d=this.length;c<d;c++){var e=this[c];if(e.nodeType===1)if(!e.className)e.className=a;else{var g=" "+e.className+" ",h=e.className;for(var i=0,j=b.length;i<j;i++)g.indexOf(" "+b[i]+" ")<0&&(h+=" "+b[i]);e.className=f.trim(h)}}}return this},removeClass:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.removeClass(a.call(this,b,c.attr("class")))});if(a&&typeof a=="string"||a===b){var c=(a||"").split(o);for(var d=0,e=this.length;d<e;d++){var g=this[d];if(g.nodeType===1&&g.className)if(a){var h=(" "+g.className+" ").replace(n," ");for(var i=0,j=c.length;i<j;i++)h=h.replace(" "+c[i]+" "," ");g.className=f.trim(h)}else g.className=""}}return this},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";if(f.isFunction(a))return this.each(function(c){var d=f(this);d.toggleClass(a.call(this,c,d.attr("class"),b),b)});return this.each(function(){if(c==="string"){var e,g=0,h=f(this),i=b,j=a.split(o);while(e=j[g++])i=d?i:!h.hasClass(e),h[i?"addClass":"removeClass"](e)}else if(c==="undefined"||c==="boolean")this.className&&f._data(this,"__className__",this.className),this.className=this.className||a===!1?"":f._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ";for(var c=0,d=this.length;c<d;c++)if((" "+this[c].className+" ").replace(n," ").indexOf(b)>-1)return!0;return!1},val:function(a){var c,d,e=this[0];if(!arguments.length){if(e){c=f.valHooks[e.nodeName.toLowerCase()]||f.valHooks[e.type];if(c&&"get"in c&&(d=c.get(e,"value"))!==b)return d;return(e.value||"").replace(p,"")}return b}var g=f.isFunction(a);return this.each(function(d){var e=f(this),h;if(this.nodeType===1){g?h=a.call(this,d,e.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c=a.selectedIndex,d=[],e=a.options,g=a.type==="select-one";if(c<0)return null;for(var h=g?c:0,i=g?c+1:e.length;h<i;h++){var j=e[h];if(j.selected&&(f.support.optDisabled?!j.disabled:j.getAttribute("disabled")===null)&&(!j.parentNode.disabled||!f.nodeName(j.parentNode,"optgroup"))){b=f(j).val();if(g)return b;d.push(b)}}if(g&&!d.length&&e.length)return f(e[c]).val();return d},set:function(a,b){var c=f.makeArray(b);f(a).find("option").each(function(){this.selected=f.inArray(f(this).val(),c)>=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attrFix:{tabindex:"tabIndex"},attr:function(a,c,d,e){var g=a.nodeType;if(!a||g===3||g===8||g===2)return b;if(e&&c in f.attrFn)return f(a)[c](d);if(!("getAttribute"in a))return f.prop(a,c,d);var h,i,j=g!==1||!f.isXMLDoc(a);c=j&&f.attrFix[c]||c,i=f.attrHooks[c],i||(!t.test(c)||typeof d!="boolean"&&d!==b&&d.toLowerCase()!==c.toLowerCase()?v&&(f.nodeName(a,"form")||u.test(c))&&(i=v):i=w);if(d!==b){if(d===null){f.removeAttr(a,c);return b}if(i&&"set"in i&&j&&(h=i.set(a,d,c))!==b)return h;a.setAttribute(c,""+d);return d}if(i&&"get"in i&&j)return i.get(a,c);h=a.getAttribute(c);return h===null?b:h},removeAttr:function(a,b){var c;a.nodeType===1&&(b=f.attrFix[b]||b,f.support.getSetAttribute?a.removeAttribute(b):(f.attr(a,b,""),a.removeAttributeNode(a.getAttributeNode(b))),t.test(b)&&(c=f.propFix[b]||b)in a&&(a[c]=!1))},attrHooks:{type:{set:function(a,b){if(q.test(a.nodeName)&&a.parentNode)f.error("type property can't be changed");else if(!f.support.radioValue&&b==="radio"&&f.nodeName(a,"input")){var c=a.value;a.setAttribute("type",b),c&&(a.value=c);return b}}},tabIndex:{get:function(a){var c=a.getAttributeNode("tabIndex");return c&&c.specified?parseInt(c.value,10):r.test(a.nodeName)||s.test(a.nodeName)&&a.href?0:b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e=a.nodeType;if(!a||e===3||e===8||e===2)return b;var g,h,i=e!==1||!f.isXMLDoc(a);c=i&&f.propFix[c]||c,h=f.propHooks[c];return d!==b?h&&"set"in h&&(g=h.set(a,d,c))!==b?g:a[c]=d:h&&"get"in h&&(g=h.get(a,c))!==b?g:a[c]},propHooks:{}}),w={get:function(a,c){return a[f.propFix[c]||c]?c.toLowerCase():b},set:function(a,b,c){var d;b===!1?f.removeAttr(a,c):(d=f.propFix[c]||c,d in a&&(a[d]=b),a.setAttribute(c,c.toLowerCase()));return c}},f.attrHooks.value={get:function(a,b){if(v&&f.nodeName(a,"button"))return v.get(a,b);return a.value},set:function(a,b,c){if(v&&f.nodeName(a,"button"))return v.set(a,b,c);a.value=b}},f.support.getSetAttribute||(f.attrFix=f.propFix,v=f.attrHooks.name=f.valHooks.button={get:function(a,c){var d;d=a.getAttributeNode(c);return d&&d.nodeValue!==""?d.nodeValue:b},set:function(a,b,c){var d=a.getAttributeNode(c);if(d){d.nodeValue=b;return b}}},f.each(["width","height"],function(a,b){f.attrHooks[b]=f.extend(f.attrHooks[b],{set:function(a,c){if(c===""){a.setAttribute(b,"auto");return c}}})})),f.support.hrefNormalized||f.each(["href","src","width","height"],function(a,c){f.attrHooks[c]=f.extend(f.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),f.support.style||(f.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=""+b}}),f.support.optSelected||(f.propHooks.selected=f.extend(f.propHooks.selected,{get:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex)}})),f.support.checkOn||f.each(["radio","checkbox"],function(){f.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),f.each(["radio","checkbox"],function(){f.valHooks[this]=f.extend(f.valHooks[this],{set:function(a,b){if(f.isArray(b))return a.checked=f.inArray(f(a).val(),b)>=0}})});var x=Object.prototype.hasOwnProperty,y=/\.(.*)$/,z=/^(?:textarea|input|select)$/i,A=/\./g,B=/ /g,C=/[^\w\s.|`]/g,D=function(a){return a.replace(C,"\\$&")};f.event={add:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){if(d===!1)d=E;else if(!d)return;var g,h;d.handler&&(g=d,d=g.handler),d.guid||(d.guid=f.guid++);var i=f._data(a);if(!i)return;var j=i.events,k=i.handle;j||(i.events=j={}),k||(i.handle=k=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.handle.apply(k.elem,arguments):b}),k.elem=a,c=c.split(" ");var l,m=0,n;while(l=c[m++]){h=g?f.extend({},g):{handler:d,data:e},l.indexOf(".")>-1?(n=l.split("."),l=n.shift(),h.namespace=n.slice(0).sort().join(".")):(n=[],h.namespace=""),h.type=l,h.guid||(h.guid=d.guid);var o=j[l],p=f.event.special[l]||{};if(!o){o=j[l]=[];if(!p.setup||p.setup.call(a,e,n,k)===!1)a.addEventListener?a.addEventListener(l,k,!1):a.attachEvent&&a.attachEvent("on"+l,k)}p.add&&(p.add.call(a,h),h.handler.guid||(h.handler.guid=d.guid)),o.push(h),f.event.global[l]=!0}a=null}},global:{},remove:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){d===!1&&(d=E);var g,h,i,j,k=0,l,m,n,o,p,q,r,s=f.hasData(a)&&f._data(a),t=s&&s.events;if(!s||!t)return;c&&c.type&&(d=c.handler,c=c.type);if(!c||typeof c=="string"&&c.charAt(0)==="."){c=c||"";for(h in t)f.event.remove(a,h+c);return}c=c.split(" ");while(h=c[k++]){r=h,q=null,l=h.indexOf(".")<0,m=[],l||(m=h.split("."),h=m.shift(),n=new RegExp("(^|\\.)"+f.map(m.slice(0).sort(),D).join("\\.(?:.*\\.)?")+"(\\.|$)")),p=t[h];if(!p)continue;if(!d){for(j=0;j<p.length;j++){q=p[j];if(l||n.test(q.namespace))f.event.remove(a,r,q.handler,j),p.splice(j--,1)}continue}o=f.event.special[h]||{};for(j=e||0;j<p.length;j++){q=p[j];if(d.guid===q.guid){if(l||n.test(q.namespace))e==null&&p.splice(j--,1),o.remove&&o.remove.call(a,q);if(e!=null)break}}if(p.length===0||e!=null&&p.length===1)(!o.teardown||o.teardown.call(a,m)===!1)&&f.removeEvent(a,h,s.handle),g=null,delete t[h]}if(f.isEmptyObject(t)){var u=s.handle;u&&(u.elem=null),delete s.events,delete s.handle,f.isEmptyObject(s)&&f.removeData(a,b,!0)}}},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(c,d,e,g){var h=c.type||c,i=[],j;h.indexOf("!")>=0&&(h=h.slice(0,-1),j=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if(!!e&&!f.event.customEvent[h]||!!f.event.global[h]){c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.exclusive=j,c.namespace=i.join("."),c.namespace_re=new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)");if(g||!e)c.preventDefault(),c.stopPropagation();if(!e){f.each(f.cache,function(){var a=f.expando,b=this[a];b&&b.events&&b.events[h]&&f.event.trigger(c,d,b.handle.elem
|
17 |
-
)});return}if(e.nodeType===3||e.nodeType===8)return;c.result=b,c.target=e,d=d?f.makeArray(d):[],d.unshift(c);var k=e,l=h.indexOf(":")<0?"on"+h:"";do{var m=f._data(k,"handle");c.currentTarget=k,m&&m.apply(k,d),l&&f.acceptData(k)&&k[l]&&k[l].apply(k,d)===!1&&(c.result=!1,c.preventDefault()),k=k.parentNode||k.ownerDocument||k===c.target.ownerDocument&&a}while(k&&!c.isPropagationStopped());if(!c.isDefaultPrevented()){var n,o=f.event.special[h]||{};if((!o._default||o._default.call(e.ownerDocument,c)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)){try{l&&e[h]&&(n=e[l],n&&(e[l]=null),f.event.triggered=h,e[h]())}catch(p){}n&&(e[l]=n),f.event.triggered=b}}return c.result}},handle:function(c){c=f.event.fix(c||a.event);var d=((f._data(this,"events")||{})[c.type]||[]).slice(0),e=!c.exclusive&&!c.namespace,g=Array.prototype.slice.call(arguments,0);g[0]=c,c.currentTarget=this;for(var h=0,i=d.length;h<i;h++){var j=d[h];if(e||c.namespace_re.test(j.namespace)){c.handler=j.handler,c.data=j.data,c.handleObj=j;var k=j.handler.apply(this,g);k!==b&&(c.result=k,k===!1&&(c.preventDefault(),c.stopPropagation()));if(c.isImmediatePropagationStopped())break}}return c.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(a){if(a[f.expando])return a;var d=a;a=f.Event(d);for(var e=this.props.length,g;e;)g=this.props[--e],a[g]=d[g];a.target||(a.target=a.srcElement||c),a.target.nodeType===3&&(a.target=a.target.parentNode),!a.relatedTarget&&a.fromElement&&(a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement);if(a.pageX==null&&a.clientX!=null){var h=a.target.ownerDocument||c,i=h.documentElement,j=h.body;a.pageX=a.clientX+(i&&i.scrollLeft||j&&j.scrollLeft||0)-(i&&i.clientLeft||j&&j.clientLeft||0),a.pageY=a.clientY+(i&&i.scrollTop||j&&j.scrollTop||0)-(i&&i.clientTop||j&&j.clientTop||0)}a.which==null&&(a.charCode!=null||a.keyCode!=null)&&(a.which=a.charCode!=null?a.charCode:a.keyCode),!a.metaKey&&a.ctrlKey&&(a.metaKey=a.ctrlKey),!a.which&&a.button!==b&&(a.which=a.button&1?1:a.button&2?3:a.button&4?2:0);return a},guid:1e8,proxy:f.proxy,special:{ready:{setup:f.bindReady,teardown:f.noop},live:{add:function(a){f.event.add(this,O(a.origType,a.selector),f.extend({},a,{handler:N,guid:a.handler.guid}))},remove:function(a){f.event.remove(this,O(a.origType,a.selector),a)}},beforeunload:{setup:function(a,b,c){f.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}}},f.removeEvent=c.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){a.detachEvent&&a.detachEvent("on"+b,c)},f.Event=function(a,b){if(!this.preventDefault)return new f.Event(a,b);a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?F:E):this.type=a,b&&f.extend(this,b),this.timeStamp=f.now(),this[f.expando]=!0},f.Event.prototype={preventDefault:function(){this.isDefaultPrevented=F;var a=this.originalEvent;!a||(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=F;var a=this.originalEvent;!a||(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=F,this.stopPropagation()},isDefaultPrevented:E,isPropagationStopped:E,isImmediatePropagationStopped:E};var G=function(a){var b=a.relatedTarget;a.type=a.data;try{if(b&&b!==c&&!b.parentNode)return;while(b&&b!==this)b=b.parentNode;b!==this&&f.event.handle.apply(this,arguments)}catch(d){}},H=function(a){a.type=a.data,f.event.handle.apply(this,arguments)};f.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){f.event.special[a]={setup:function(c){f.event.add(this,b,c&&c.selector?H:G,a)},teardown:function(a){f.event.remove(this,b,a&&a.selector?H:G)}}}),f.support.submitBubbles||(f.event.special.submit={setup:function(a,b){if(!f.nodeName(this,"form"))f.event.add(this,"click.specialSubmit",function(a){var b=a.target,c=b.type;(c==="submit"||c==="image")&&f(b).closest("form").length&&L("submit",this,arguments)}),f.event.add(this,"keypress.specialSubmit",function(a){var b=a.target,c=b.type;(c==="text"||c==="password")&&f(b).closest("form").length&&a.keyCode===13&&L("submit",this,arguments)});else return!1},teardown:function(a){f.event.remove(this,".specialSubmit")}});if(!f.support.changeBubbles){var I,J=function(a){var b=a.type,c=a.value;b==="radio"||b==="checkbox"?c=a.checked:b==="select-multiple"?c=a.selectedIndex>-1?f.map(a.options,function(a){return a.selected}).join("-"):"":f.nodeName(a,"select")&&(c=a.selectedIndex);return c},K=function(c){var d=c.target,e,g;if(!!z.test(d.nodeName)&&!d.readOnly){e=f._data(d,"_change_data"),g=J(d),(c.type!=="focusout"||d.type!=="radio")&&f._data(d,"_change_data",g);if(e===b||g===e)return;if(e!=null||g)c.type="change",c.liveFired=b,f.event.trigger(c,arguments[1],d)}};f.event.special.change={filters:{focusout:K,beforedeactivate:K,click:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(c==="radio"||c==="checkbox"||f.nodeName(b,"select"))&&K.call(this,a)},keydown:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(a.keyCode===13&&!f.nodeName(b,"textarea")||a.keyCode===32&&(c==="checkbox"||c==="radio")||c==="select-multiple")&&K.call(this,a)},beforeactivate:function(a){var b=a.target;f._data(b,"_change_data",J(b))}},setup:function(a,b){if(this.type==="file")return!1;for(var c in I)f.event.add(this,c+".specialChange",I[c]);return z.test(this.nodeName)},teardown:function(a){f.event.remove(this,".specialChange");return z.test(this.nodeName)}},I=f.event.special.change.filters,I.focus=I.beforeactivate}f.support.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(a,b){function e(a){var c=f.event.fix(a);c.type=b,c.originalEvent={},f.event.trigger(c,null,c.target),c.isDefaultPrevented()&&a.preventDefault()}var d=0;f.event.special[b]={setup:function(){d++===0&&c.addEventListener(a,e,!0)},teardown:function(){--d===0&&c.removeEventListener(a,e,!0)}}}),f.each(["bind","one"],function(a,c){f.fn[c]=function(a,d,e){var g;if(typeof a=="object"){for(var h in a)this[c](h,d,a[h],e);return this}if(arguments.length===2||d===!1)e=d,d=b;c==="one"?(g=function(a){f(this).unbind(a,g);return e.apply(this,arguments)},g.guid=e.guid||f.guid++):g=e;if(a==="unload"&&c!=="one")this.one(a,d,e);else for(var i=0,j=this.length;i<j;i++)f.event.add(this[i],a,g,d);return this}}),f.fn.extend({unbind:function(a,b){if(typeof a=="object"&&!a.preventDefault)for(var c in a)this.unbind(c,a[c]);else for(var d=0,e=this.length;d<e;d++)f.event.remove(this[d],a,b);return this},delegate:function(a,b,c,d){return this.live(b,c,d,a)},undelegate:function(a,b,c){return arguments.length===0?this.unbind("live"):this.die(b,null,c,a)},trigger:function(a,b){return this.each(function(){f.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0])return f.event.trigger(a,b,this[0],!0)},toggle:function(a){var b=arguments,c=a.guid||f.guid++,d=0,e=function(c){var e=(f.data(this,"lastToggle"+a.guid)||0)%d;f.data(this,"lastToggle"+a.guid,e+1),c.preventDefault();return b[e].apply(this,arguments)||!1};e.guid=c;while(d<b.length)b[d++].guid=c;return this.click(e)},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var M={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};f.each(["live","die"],function(a,c){f.fn[c]=function(a,d,e,g){var h,i=0,j,k,l,m=g||this.selector,n=g?this:f(this.context);if(typeof a=="object"&&!a.preventDefault){for(var o in a)n[c](o,d,a[o],m);return this}if(c==="die"&&!a&&g&&g.charAt(0)==="."){n.unbind(g);return this}if(d===!1||f.isFunction(d))e=d||E,d=b;a=(a||"").split(" ");while((h=a[i++])!=null){j=y.exec(h),k="",j&&(k=j[0],h=h.replace(y,""));if(h==="hover"){a.push("mouseenter"+k,"mouseleave"+k);continue}l=h,M[h]?(a.push(M[h]+k),h=h+k):h=(M[h]||h)+k;if(c==="live")for(var p=0,q=n.length;p<q;p++)f.event.add(n[p],"live."+O(h,m),{data:d,selector:m,handler:e,origType:h,origHandler:e,preType:l});else n.unbind("live."+O(h,m),e)}return this}}),f.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "),function(a,b){f.fn[b]=function(a,c){c==null&&(c=a,a=null);return arguments.length>0?this.bind(b,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0)}),function(){function u(a,b,c,d,e,f){for(var g=0,h=d.length;g<h;g++){var i=d[g];if(i){var j=!1;i=i[a];while(i){if(i.sizcache===c){j=d[i.sizset];break}if(i.nodeType===1){f||(i.sizcache=c,i.sizset=g);if(typeof b!="string"){if(i===b){j=!0;break}}else if(k.filter(b,[i]).length>0){j=i;break}}i=i[a]}d[g]=j}}}function t(a,b,c,d,e,f){for(var g=0,h=d.length;g<h;g++){var i=d[g];if(i){var j=!1;i=i[a];while(i){if(i.sizcache===c){j=d[i.sizset];break}i.nodeType===1&&!f&&(i.sizcache=c,i.sizset=g);if(i.nodeName.toLowerCase()===b){j=i;break}i=i[a]}d[g]=j}}}var a=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d=0,e=Object.prototype.toString,g=!1,h=!0,i=/\\/g,j=/\W/;[0,0].sort(function(){h=!1;return 0});var k=function(b,d,f,g){f=f||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return f;var i,j,n,o,q,r,s,t,u=!0,w=k.isXML(d),x=[],y=b;do{a.exec(""),i=a.exec(y);if(i){y=i[3],x.push(i[1]);if(i[2]){o=i[3];break}}}while(i);if(x.length>1&&m.exec(b))if(x.length===2&&l.relative[x[0]])j=v(x[0]+x[1],d);else{j=l.relative[x[0]]?[d]:k(x.shift(),d);while(x.length)b=x.shift(),l.relative[b]&&(b+=x.shift()),j=v(b,j)}else{!g&&x.length>1&&d.nodeType===9&&!w&&l.match.ID.test(x[0])&&!l.match.ID.test(x[x.length-1])&&(q=k.find(x.shift(),d,w),d=q.expr?k.filter(q.expr,q.set)[0]:q.set[0]);if(d){q=g?{expr:x.pop(),set:p(g)}:k.find(x.pop(),x.length===1&&(x[0]==="~"||x[0]==="+")&&d.parentNode?d.parentNode:d,w),j=q.expr?k.filter(q.expr,q.set):q.set,x.length>0?n=p(j):u=!1;while(x.length)r=x.pop(),s=r,l.relative[r]?s=x.pop():r="",s==null&&(s=d),l.relative[r](n,s,w)}else n=x=[]}n||(n=j),n||k.error(r||b);if(e.call(n)==="[object Array]")if(!u)f.push.apply(f,n);else if(d&&d.nodeType===1)for(t=0;n[t]!=null;t++)n[t]&&(n[t]===!0||n[t].nodeType===1&&k.contains(d,n[t]))&&f.push(j[t]);else for(t=0;n[t]!=null;t++)n[t]&&n[t].nodeType===1&&f.push(j[t]);else p(n,f);o&&(k(o,h,f,g),k.uniqueSort(f));return f};k.uniqueSort=function(a){if(r){g=h,a.sort(r);if(g)for(var b=1;b<a.length;b++)a[b]===a[b-1]&&a.splice(b--,1)}return a},k.matches=function(a,b){return k(a,null,null,b)},k.matchesSelector=function(a,b){return k(b,null,null,[a]).length>0},k.find=function(a,b,c){var d;if(!a)return[];for(var e=0,f=l.order.length;e<f;e++){var g,h=l.order[e];if(g=l.leftMatch[h].exec(a)){var j=g[1];g.splice(1,1);if(j.substr(j.length-1)!=="\\"){g[1]=(g[1]||"").replace(i,""),d=l.find[h](g,b,c);if(d!=null){a=a.replace(l.match[h],"");break}}}}d||(d=typeof b.getElementsByTagName!="undefined"?b.getElementsByTagName("*"):[]);return{set:d,expr:a}},k.filter=function(a,c,d,e){var f,g,h=a,i=[],j=c,m=c&&c[0]&&k.isXML(c[0]);while(a&&c.length){for(var n in l.filter)if((f=l.leftMatch[n].exec(a))!=null&&f[2]){var o,p,q=l.filter[n],r=f[1];g=!1,f.splice(1,1);if(r.substr(r.length-1)==="\\")continue;j===i&&(i=[]);if(l.preFilter[n]){f=l.preFilter[n](f,j,d,i,e,m);if(!f)g=o=!0;else if(f===!0)continue}if(f)for(var s=0;(p=j[s])!=null;s++)if(p){o=q(p,f,s,j);var t=e^!!o;d&&o!=null?t?g=!0:j[s]=!1:t&&(i.push(p),g=!0)}if(o!==b){d||(j=i),a=a.replace(l.match[n],"");if(!g)return[];break}}if(a===h)if(g==null)k.error(a);else break;h=a}return j},k.error=function(a){throw"Syntax error, unrecognized expression: "+a};var l=k.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(a){return a.getAttribute("href")},type:function(a){return a.getAttribute("type")}},relative:{"+":function(a,b){var c=typeof b=="string",d=c&&!j.test(b),e=c&&!d;d&&(b=b.toLowerCase());for(var f=0,g=a.length,h;f<g;f++)if(h=a[f]){while((h=h.previousSibling)&&h.nodeType!==1);a[f]=e||h&&h.nodeName.toLowerCase()===b?h||!1:h===b}e&&k.filter(b,a,!0)},">":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!j.test(b)){b=b.toLowerCase();for(;e<f;e++){c=a[e];if(c){var g=c.parentNode;a[e]=g.nodeName.toLowerCase()===b?g:!1}}}else{for(;e<f;e++)c=a[e],c&&(a[e]=d?c.parentNode:c.parentNode===b);d&&k.filter(b,a,!0)}},"":function(a,b,c){var e,f=d++,g=u;typeof b=="string"&&!j.test(b)&&(b=b.toLowerCase(),e=b,g=t),g("parentNode",b,f,a,e,c)},"~":function(a,b,c){var e,f=d++,g=u;typeof b=="string"&&!j.test(b)&&(b=b.toLowerCase(),e=b,g=t),g("previousSibling",b,f,a,e,c)}},find:{ID:function(a,b,c){if(typeof b.getElementById!="undefined"&&!c){var d=b.getElementById(a[1]);return d&&d.parentNode?[d]:[]}},NAME:function(a,b){if(typeof b.getElementsByName!="undefined"){var c=[],d=b.getElementsByName(a[1]);for(var e=0,f=d.length;e<f;e++)d[e].getAttribute("name")===a[1]&&c.push(d[e]);return c.length===0?null:c}},TAG:function(a,b){if(typeof b.getElementsByTagName!="undefined")return b.getElementsByTagName(a[1])}},preFilter:{CLASS:function(a,b,c,d,e,f){a=" "+a[1].replace(i,"")+" ";if(f)return a;for(var g=0,h;(h=b[g])!=null;g++)h&&(e^(h.className&&(" "+h.className+" ").replace(/[\t\n\r]/g," ").indexOf(a)>=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(i,"")},TAG:function(a,b){return a[1].replace(i,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||k.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&k.error(a[0]);a[0]=d++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(i,"");!f&&l.attrMap[g]&&(a[1]=l.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(i,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=k(b[3],null,null,c);else{var g=k.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(l.match.POS.test(b[0])||l.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!k(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return b<c[3]-0},gt:function(a,b,c){return b>c[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=l.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||k.getText([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h<i;h++)if(g[h]===a)return!1;return!0}k.error(e)},CHILD:function(a,b){var c=b[1],d=a;switch(c){case"only":case"first":while(d=d.previousSibling)if(d.nodeType===1)return!1;if(c==="first")return!0;d=a;case"last":while(d=d.nextSibling)if(d.nodeType===1)return!1;return!0;case"nth":var e=b[2],f=b[3];if(e===1&&f===0)return!0;var g=b[0],h=a.parentNode;if(h&&(h.sizcache!==g||!a.nodeIndex)){var i=0;for(d=h.firstChild;d;d=d.nextSibling)d.nodeType===1&&(d.nodeIndex=++i);h.sizcache=g}var j=a.nodeIndex-f;return e===0?j===0:j%e===0&&j/e>=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=l.attrHandle[c]?l.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=l.setFilters[e];if(f)return f(a,c,b,d)}}},m=l.match.POS,n=function(a,b){return"\\"+(b-0+1)};for(var o in l.match)l.match[o]=new RegExp(l.match[o].source+/(?![^\[]*\])(?![^\(]*\))/.source),l.leftMatch[o]=new RegExp(/(^(?:.|\r|\n)*?)/.source+l.match[o].source.replace(/\\(\d+)/g,n));var p=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(q){p=function(a,b){var c=0,d=b||[];if(e.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var f=a.length;c<f;c++)d.push(a[c]);else for(;a[c];c++)d.push(a[c]);return d}}var r,s;c.documentElement.compareDocumentPosition?r=function(a,b){if(a===b){g=!0;return 0}if(!a.compareDocumentPosition||!b.compareDocumentPosition)return a.compareDocumentPosition?-1:1;return a.compareDocumentPosition(b)&4?-1:1}:(r=function(a,b){if(a===b){g=!0;return 0}if(a.sourceIndex&&b.sourceIndex)return a.sourceIndex-b.sourceIndex;var c,d,e=[],f=[],h=a.parentNode,i=b.parentNode,j=h;if(h===i)return s(a,b);if(!h)return-1;if(!i)return 1;while(j)e.unshift(j),j=j.parentNode;j=i;while(j)f.unshift(j),j=j.parentNode;c=e.length,d=f.length;for(var k=0;k<c&&k<d;k++)if(e[k]!==f[k])return s(e[k],f[k]);return k===c?s(a,f[k],-1):s(e[k],b,1)},s=function(a,b,c){if(a===b)return c;var d=a.nextSibling;while(d){if(d===b)return-1;d=d.nextSibling}return 1}),k.getText=function(a){var b="",c;for(var d=0;a[d];d++)c=a[d],c.nodeType===3||c.nodeType===4?b+=c.nodeValue:c.nodeType!==8&&(b+=k.getText(c.childNodes));return b},function(){var a=c.createElement("div"),d="script"+(new Date).getTime(),e=c.documentElement;a.innerHTML="<a name='"+d+"'/>",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(l.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},l.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(l.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="<a href='#'></a>",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(l.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=k,b=c.createElement("div"),d="__sizzle__";b.innerHTML="<p class='TEST'></p>";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){k=function(b,e,f,g){e=e||c;if(!g&&!k.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return p(e.getElementsByTagName(b),f);if(h[2]&&l.find.CLASS&&e.getElementsByClassName)return p(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return p([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return p([],f);if(i.id===h[3])return p([i],f)}try{return p(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var m=e,n=e.getAttribute("id"),o=n||d,q=e.parentNode,r=/^\s*[+~]/.test(b);n?o=o.replace(/'/g,"\\$&"):e.setAttribute("id",o),r&&q&&(e=e.parentNode);try{if(!r||q)return p(e.querySelectorAll("[id='"+o+"'] "+b),f)}catch(s){}finally{n||m.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)k[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}k.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(a))try{if(e||!l.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return k(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="<div class='test e'></div><div class='test'></div>";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;l.order.splice(1,0,"CLASS"),l.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?k.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?k.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:k.contains=function(){return!1},k.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var v=function(a,b){var c,d=[],e="",f=b.nodeType?[b]:b;while(c=l.match.PSEUDO.exec(a))e+=c[0],a=a.replace(l.match.PSEUDO,"");a=l.relative[a]?a+"*":a;for(var g=0,h=f.length;g<h;g++)k(a,f[g],d);return k.filter(e,d)};f.find=k,f.expr=k.selectors,f.expr[":"]=f.expr.filters,f.unique=k.uniqueSort,f.text=k.getText,f.isXMLDoc=k.isXML,f.contains=k.contains}();var P=/Until$/,Q=/^(?:parents|prevUntil|prevAll)/,R=/,/,S=/^.[^:#\[\.,]*$/,T=Array.prototype.slice,U=f.expr.match.POS,V={children:!0,contents:!0,next:!0,prev:!0};f.fn.extend({find:function(a){var b=this,c,d;if(typeof a!="string")return f(a).filter(function(){for(c=0,d=b.length;c<d;c++)if(f.contains(b[c],this))return!0});var e=this.pushStack("","find",a),g,h,i;for(c=0,d=this.length;c<d;c++){g=e.length,f.find(a,this[c],e);if(c>0)for(h=g;h<e.length;h++)for(i=0;i<g;i++)if(e[i]===e[h]){e.splice(h--,1);break}}return e},has:function(a){var b=f(a);return this.filter(function(){for(var a=0,c=b.length;a<c;a++)if(f.contains(this,b[a]))return!0})},not:function(a){return this.pushStack(X(this,a,!1),"not",a)},filter:function(a){return this.pushStack(X(this,a,!0),"filter",a)},is:function(a){return!!a&&(typeof a=="string"?f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h,i,j={},k=1;if(g&&a.length){for(d=0,e=a.length;d<e;d++)i=a[d],j[i]||(j[i]=U.test(i)?f(i,b||this.context):i);while(g&&g.ownerDocument&&g!==b){for(i in j)h=j[i],(h.jquery?h.index(g)>-1:f(g).is(h))&&c.push({selector:i,elem:g,level:k});g=g.parentNode,k++}}return c}var l=U.test(a)||typeof a!="string"?f(a,b||this.context):0;for(d=0,e=this.length;d<e;d++){g=this[d];while(g){if(l?l.index(g)>-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a||typeof a=="string")return f.inArray(this[0],a?f(a):this.parent().children());return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(W(c[0])||W(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c),g=T.call(arguments);P.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!V[a]?f.unique(e):e,(this.length>1||R.test(d))&&Q.test(a)&&(e=e.reverse());return this.pushStack(e,a,g.join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var Y=/ jQuery\d+="(?:\d+|null)"/g,Z=/^\s+/,$=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,_=/<([\w:]+)/,ba=/<tbody/i,bb=/<|&#?\w+;/,bc=/<(?:script|object|embed|option|style)/i,bd=/checked\s*(?:[^=]|=\s*.checked.)/i,be=/\/(java|ecma)script/i,bf=/^\s*<!(?:\[CDATA\[|\-\-)/,bg={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div<div>","</div>"]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){f(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f(arguments[0]).toArray());return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(Y,""):null;if(typeof a=="string"&&!bc.test(a)&&(f.support.leadingWhitespace||!Z.test(a))&&!bg[(_.exec(a)||["",""])[1].toLowerCase()]){a=a.replace($,"<$1></$2>");try{for(var c=0,d=this.length;c<d;c++)this[c].nodeType===1&&(f.cleanData(this[c].getElementsByTagName("*")),this[c].innerHTML=a)}catch(e){this.empty().append(a)}}else f.isFunction(a)?this.each(function(b){var c=f(this);c.html(a.call(this,b,c.html()))}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(f.isFunction(a))return this.each(function(b){var c=f(this),d=c.html();c.replaceWith(a.call(this,b,d))});typeof a!="string"&&(a=f(a).detach());return this.each(function(){var b=this.nextSibling,c=this.parentNode;f(this).remove(),b?f(b).before(a):f(c).append(a)})}return this.length?this.pushStack(f(f.isFunction(a)?a():a),"replaceWith",a):this},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,d){var e,g,h,i,j=a[0],k=[];if(!f.support.checkClone&&arguments.length===3&&typeof j=="string"&&bd.test(j))return this.each(function(){f(this).domManip(a,c,d,!0)});if(f.isFunction(j))return this.each(function(e){var g=f(this);a[0]=j.call(this,e,c?g.html():b),g.domManip(a,c,d)});if(this[0]){i=j&&j.parentNode,f.support.parentNode&&i&&i.nodeType===11&&i.childNodes.length===this.length?e={fragment:i}:e=f.buildFragment(a,this,k),h=e.fragment,h.childNodes.length===1?g=h=h.firstChild:g=h.firstChild;if(g){c=c&&f.nodeName(g,"tr");for(var l=0,m=this.length,n=m-1;l<m;l++)d.call(c?bh(this[l],g):this[l],e.cacheable||m>1&&l<n?f.clone(h,!0,!0):h)}k.length&&f.each(k,bn)}return this}}),f.buildFragment=function(a,b,d){var e,g,h,i=b&&b[0]?b[0].ownerDocument||b[0]:c;a.length===1&&typeof a[0]=="string"&&a[0].length<512&&i===c&&a[0].charAt(0)==="<"&&!bc.test(a[0])&&(f.support.checkClone||!bd.test(a[0]))&&(g=!0,h=f.fragments[a[0]],h&&h!==1&&(e=h)),e||(e=i.createDocumentFragment(),f.clean(a,i,e,d)),g&&(f.fragments[a[0]]=h?e:1);return{fragment:e,cacheable:g}},f.fragments={},f.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){f.fn[a]=function(c){var d=[],e=f(c),g=this.length===1&&this[0].parentNode;if(g&&g.nodeType===11&&g.childNodes.length===1&&e.length===1){e[b](this[0]);return this}for(var h=0,i=e.length;h<i;h++){var j=(h>0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d=a.cloneNode(!0),e,g,h;if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bj(a,d),e=bk(a),g=bk(d);for(h=0;e[h];++h)bj(e[h],g[h])}if(b){bi(a,d);if(c){e=bk(a),g=bk(d);for(h=0;e[h];++h)bi(e[h],g[h])}}return d},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||
|
18 |
-
b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!bb.test(k))k=b.createTextNode(k);else{k=k.replace($,"<$1></$2>");var l=(_.exec(k)||["",""])[1].toLowerCase(),m=bg[l]||bg._default,n=m[0],o=b.createElement("div");o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=ba.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]==="<table>"&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&Z.test(k)&&o.insertBefore(b.createTextNode(Z.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i<r;i++)bm(k[i]);else bm(k);k.nodeType?h.push(k):h=f.merge(h,k)}if(d){g=function(a){return!a.type||be.test(a.type)};for(j=0;h[j];j++)if(e&&f.nodeName(h[j],"script")&&(!h[j].type||h[j].type.toLowerCase()==="text/javascript"))e.push(h[j].parentNode?h[j].parentNode.removeChild(h[j]):h[j]);else{if(h[j].nodeType===1){var s=f.grep(h[j].getElementsByTagName("script"),g);h.splice.apply(h,[j+1,0].concat(s))}d.appendChild(h[j])}}return h},cleanData:function(a){var b,c,d=f.cache,e=f.expando,g=f.event.special,h=f.support.deleteExpando;for(var i=0,j;(j=a[i])!=null;i++){if(j.nodeName&&f.noData[j.nodeName.toLowerCase()])continue;c=j[f.expando];if(c){b=d[c]&&d[c][e];if(b&&b.events){for(var k in b.events)g[k]?f.event.remove(j,k):f.removeEvent(j,k,b.handle);b.handle&&(b.handle.elem=null)}h?delete j[f.expando]:j.removeAttribute&&j.removeAttribute(f.expando),delete d[c]}}}});var bo=/alpha\([^)]*\)/i,bp=/opacity=([^)]*)/,bq=/-([a-z])/ig,br=/([A-Z]|^ms)/g,bs=/^-?\d+(?:px)?$/i,bt=/^-?\d/,bu=/^[+\-]=/,bv=/[^+\-\.\de]+/g,bw={position:"absolute",visibility:"hidden",display:"block"},bx=["Left","Right"],by=["Top","Bottom"],bz,bA,bB,bC=function(a,b){return b.toUpperCase()};f.fn.css=function(a,c){if(arguments.length===2&&c===b)return this;return f.access(this,a,c,!0,function(a,c,d){return d!==b?f.style(a,c,d):f.css(a,c)})},f.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=bz(a,"opacity","opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{zIndex:!0,fontWeight:!0,opacity:!0,zoom:!0,lineHeight:!0,widows:!0,orphans:!0},cssProps:{"float":f.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!!a&&a.nodeType!==3&&a.nodeType!==8&&!!a.style){var g,h,i=f.camelCase(c),j=a.style,k=f.cssHooks[i];c=f.cssProps[i]||i;if(d===b){if(k&&"get"in k&&(g=k.get(a,!1,e))!==b)return g;return j[c]}h=typeof d;if(h==="number"&&isNaN(d)||d==null)return;h==="string"&&bu.test(d)&&(d=+d.replace(bv,"")+parseFloat(f.css(a,c))),h==="number"&&!f.cssNumber[i]&&(d+="px");if(!k||!("set"in k)||(d=k.set(a,d))!==b)try{j[c]=d}catch(l){}}},css:function(a,c,d){var e,g;c=f.camelCase(c),g=f.cssHooks[c],c=f.cssProps[c]||c,c==="cssFloat"&&(c="float");if(g&&"get"in g&&(e=g.get(a,!0,d))!==b)return e;if(bz)return bz(a,c)},swap:function(a,b,c){var d={};for(var e in b)d[e]=a.style[e],a.style[e]=b[e];c.call(a);for(e in b)a.style[e]=d[e]},camelCase:function(a){return a.replace(bq,bC)}}),f.curCSS=f.css,f.each(["height","width"],function(a,b){f.cssHooks[b]={get:function(a,c,d){var e;if(c){a.offsetWidth!==0?e=bD(a,b,d):f.swap(a,bw,function(){e=bD(a,b,d)});if(e<=0){e=bz(a,b,b),e==="0px"&&bB&&(e=bB(a,b,b));if(e!=null)return e===""||e==="auto"?"0px":e}if(e<0||e==null){e=a.style[b];return e===""||e==="auto"?"0px":e}return typeof e=="string"?e:e+"px"}},set:function(a,b){if(!bs.test(b))return b;b=parseFloat(b);if(b>=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bp.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle;c.zoom=1;var e=f.isNaN(b)?"":"alpha(opacity="+b*100+")",g=d&&d.filter||c.filter||"";c.filter=bo.test(g)?g.replace(bo,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bz(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bA=function(a,c){var d,e,g;c=c.replace(br,"-$1").toLowerCase();if(!(e=a.ownerDocument.defaultView))return b;if(g=e.getComputedStyle(a,null))d=g.getPropertyValue(c),d===""&&!f.contains(a.ownerDocument.documentElement,a)&&(d=f.style(a,c));return d}),c.documentElement.currentStyle&&(bB=function(a,b){var c,d=a.currentStyle&&a.currentStyle[b],e=a.runtimeStyle&&a.runtimeStyle[b],f=a.style;!bs.test(d)&&bt.test(d)&&(c=f.left,e&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":d||0,d=f.pixelLeft+"px",f.left=c,e&&(a.runtimeStyle.left=e));return d===""?"auto":d}),bz=bA||bB,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bE=/%20/g,bF=/\[\]$/,bG=/\r?\n/g,bH=/#.*$/,bI=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bJ=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bK=/^(?:about|app|app\-storage|.+\-extension|file|widget):$/,bL=/^(?:GET|HEAD)$/,bM=/^\/\//,bN=/\?/,bO=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,bP=/^(?:select|textarea)/i,bQ=/\s+/,bR=/([?&])_=[^&]*/,bS=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bT=f.fn.load,bU={},bV={},bW,bX;try{bW=e.href}catch(bY){bW=c.createElement("a"),bW.href="",bW=bW.href}bX=bS.exec(bW.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bT)return bT.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("<div>").append(c.replace(bO,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bP.test(this.nodeName)||bJ.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bG,"\r\n")}}):{name:b.name,value:c.replace(bG,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.bind(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?f.extend(!0,a,f.ajaxSettings,b):(b=a,a=f.extend(!0,f.ajaxSettings,b));for(var c in{context:1,url:1})c in b?a[c]=b[c]:c in f.ajaxSettings&&(a[c]=f.ajaxSettings[c]);return a},ajaxSettings:{url:bW,isLocal:bK.test(bX[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":"*/*"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML}},ajaxPrefilter:bZ(bU),ajaxTransport:bZ(bV),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a?4:0;var o,r,u,w=l?ca(d,v,l):b,x,y;if(a>=200&&a<300||a===304){if(d.ifModified){if(x=v.getResponseHeader("Last-Modified"))f.lastModified[k]=x;if(y=v.getResponseHeader("Etag"))f.etag[k]=y}if(a===304)c="notmodified",o=!0;else try{r=cb(d,w),c="success",o=!0}catch(z){c="parsererror",u=z}}else{u=c;if(!c||a)c="error",a<0&&(a=0)}v.status=a,v.statusText=c,o?h.resolveWith(e,[r,c,v]):h.rejectWith(e,[v,c,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.resolveWith(e,[v,c]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f._Deferred(),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bI.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.done,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bH,"").replace(bM,bX[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bQ),d.crossDomain==null&&(r=bS.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bX[1]&&r[2]==bX[2]&&(r[3]||(r[1]==="http:"?80:443))==(bX[3]||(bX[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),b$(bU,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bL.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bN.test(d.url)?"&":"?")+d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bR,"$1_="+x);d.url=y+(y===d.url?(bN.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", */*; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=b$(bV,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){status<2?w(-1,z):f.error(z)}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)b_(g,a[g],c,e);return d.join("&").replace(bE,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cc=f.now(),cd=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cc++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(cd.test(b.url)||e&&cd.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(cd,l),b.url===j&&(e&&(k=k.replace(cd,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var ce=a.ActiveXObject?function(){for(var a in cg)cg[a](0,1)}:!1,cf=0,cg;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ch()||ci()}:ch,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,ce&&delete cg[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cf,ce&&(cg||(cg={},f(a).unload(ce)),cg[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var cj={},ck,cl,cm=/^(?:toggle|show|hide)$/,cn=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,co,cp=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cq,cr=a.webkitRequestAnimationFrame||a.mozRequestAnimationFrame||a.oRequestAnimationFrame;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cu("show",3),a,b,c);for(var g=0,h=this.length;g<h;g++)d=this[g],d.style&&(e=d.style.display,!f._data(d,"olddisplay")&&e==="none"&&(e=d.style.display=""),e===""&&f.css(d,"display")==="none"&&f._data(d,"olddisplay",cv(d.nodeName)));for(g=0;g<h;g++){d=this[g];if(d.style){e=d.style.display;if(e===""||e==="none")d.style.display=f._data(d,"olddisplay")||""}}return this},hide:function(a,b,c){if(a||a===0)return this.animate(cu("hide",3),a,b,c);for(var d=0,e=this.length;d<e;d++)if(this[d].style){var g=f.css(this[d],"display");g!=="none"&&!f._data(this[d],"olddisplay")&&f._data(this[d],"olddisplay",g)}for(d=0;d<e;d++)this[d].style&&(this[d].style.display="none");return this},_toggle:f.fn.toggle,toggle:function(a,b,c){var d=typeof a=="boolean";f.isFunction(a)&&f.isFunction(b)?this._toggle.apply(this,arguments):a==null||d?this.each(function(){var b=d?a:f(this).is(":hidden");f(this)[b?"show":"hide"]()}):this.animate(cu("toggle",3),a,b,c);return this},fadeTo:function(a,b,c,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=f.speed(b,c,d);if(f.isEmptyObject(a))return this.each(e.complete,[!1]);a=f.extend({},a);return this[e.queue===!1?"each":"queue"](function(){e.queue===!1&&f._mark(this);var b=f.extend({},e),c=this.nodeType===1,d=c&&f(this).is(":hidden"),g,h,i,j,k,l,m,n,o;b.animatedProperties={};for(i in a){g=f.camelCase(i),i!==g&&(a[g]=a[i],delete a[i]),h=a[g],f.isArray(h)?(b.animatedProperties[g]=h[1],h=a[g]=h[0]):b.animatedProperties[g]=b.specialEasing&&b.specialEasing[g]||b.easing||"swing";if(h==="hide"&&d||h==="show"&&!d)return b.complete.call(this);c&&(g==="height"||g==="width")&&(b.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY],f.css(this,"display")==="inline"&&f.css(this,"float")==="none"&&(f.support.inlineBlockNeedsLayout?(j=cv(this.nodeName),j==="inline"?this.style.display="inline-block":(this.style.display="inline",this.style.zoom=1)):this.style.display="inline-block"))}b.overflow!=null&&(this.style.overflow="hidden");for(i in a)k=new f.fx(this,b,i),h=a[i],cm.test(h)?k[h==="toggle"?d?"show":"hide":h]():(l=cn.exec(h),m=k.cur(),l?(n=parseFloat(l[2]),o=l[3]||(f.cssNumber[i]?"":"px"),o!=="px"&&(f.style(this,i,(n||1)+o),m=(n||1)/k.cur()*m,f.style(this,i,m+o)),l[1]&&(n=(l[1]==="-="?-1:1)*n+m),k.custom(m,n,o)):k.custom(m,h,""));return!0})},stop:function(a,b){a&&this.queue([]),this.each(function(){var a=f.timers,c=a.length;b||f._unmark(!0,this);while(c--)a[c].elem===this&&(b&&a[c](!0),a.splice(c,1))}),b||this.dequeue();return this}}),f.each({slideDown:cu("show",1),slideUp:cu("hide",1),slideToggle:cu("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){f.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),f.extend({speed:function(a,b,c){var d=a&&typeof a=="object"?f.extend({},a):{complete:c||!c&&b||f.isFunction(a)&&a,duration:a,easing:c&&b||b&&!f.isFunction(b)&&b};d.duration=f.fx.off?0:typeof d.duration=="number"?d.duration:d.duration in f.fx.speeds?f.fx.speeds[d.duration]:f.fx.speeds._default,d.old=d.complete,d.complete=function(a){d.queue!==!1?f.dequeue(this):a!==!1&&f._unmark(this),f.isFunction(d.old)&&d.old.call(this)};return d},easing:{linear:function(a,b,c,d){return c+d*a},swing:function(a,b,c,d){return(-Math.cos(a*Math.PI)/2+.5)*d+c}},timers:[],fx:function(a,b,c){this.options=b,this.elem=a,this.prop=c,b.orig=b.orig||{}}}),f.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this),(f.fx.step[this.prop]||f.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a,b=f.css(this.elem,this.prop);return isNaN(a=parseFloat(b))?!b||b==="auto"?0:b:a},custom:function(a,b,c){function h(a){return d.step(a)}var d=this,e=f.fx,g;this.startTime=cq||cs(),this.start=a,this.end=b,this.unit=c||this.unit||(f.cssNumber[this.prop]?"":"px"),this.now=this.start,this.pos=this.state=0,h.elem=this.elem,h()&&f.timers.push(h)&&!co&&(cr?(co=1,g=function(){co&&(cr(g),e.tick())},cr(g)):co=setInterval(e.tick,e.interval))},show:function(){this.options.orig[this.prop]=f.style(this.elem,this.prop),this.options.show=!0,this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur()),f(this.elem).show()},hide:function(){this.options.orig[this.prop]=f.style(this.elem,this.prop),this.options.hide=!0,this.custom(this.cur(),0)},step:function(a){var b=cq||cs(),c=!0,d=this.elem,e=this.options,g,h;if(a||b>=e.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),e.animatedProperties[this.prop]=!0;for(g in e.animatedProperties)e.animatedProperties[g]!==!0&&(c=!1);if(c){e.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){d.style["overflow"+b]=e.overflow[a]}),e.hide&&f(d).hide();if(e.hide||e.show)for(var i in e.animatedProperties)f.style(d,i,e.orig[i]);e.complete.call(d)}return!1}e.duration==Infinity?this.now=b:(h=b-this.startTime,this.state=h/e.duration,this.pos=f.easing[e.animatedProperties[this.prop]](this.state,h,0,1,e.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){for(var a=f.timers,b=0;b<a.length;++b)a[b]()||a.splice(b--,1);a.length||f.fx.stop()},interval:13,stop:function(){clearInterval(co),co=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){f.style(a.elem,"opacity",a.now)},_default:function(a){a.elem.style&&a.elem.style[a.prop]!=null?a.elem.style[a.prop]=(a.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit:a.elem[a.prop]=a.now}}}),f.expr&&f.expr.filters&&(f.expr.filters.animated=function(a){return f.grep(f.timers,function(b){return a===b.elem}).length});var cw=/^t(?:able|d|h)$/i,cx=/^(?:body|html)$/i;"getBoundingClientRect"in c.documentElement?f.fn.offset=function(a){var b=this[0],c;if(a)return this.each(function(b){f.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return f.offset.bodyOffset(b);try{c=b.getBoundingClientRect()}catch(d){}var e=b.ownerDocument,g=e.documentElement;if(!c||!f.contains(g,b))return c?{top:c.top,left:c.left}:{top:0,left:0};var h=e.body,i=cy(e),j=g.clientTop||h.clientTop||0,k=g.clientLeft||h.clientLeft||0,l=i.pageYOffset||f.support.boxModel&&g.scrollTop||h.scrollTop,m=i.pageXOffset||f.support.boxModel&&g.scrollLeft||h.scrollLeft,n=c.top+l-j,o=c.left+m-k;return{top:n,left:o}}:f.fn.offset=function(a){var b=this[0];if(a)return this.each(function(b){f.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return f.offset.bodyOffset(b);f.offset.initialize();var c,d=b.offsetParent,e=b,g=b.ownerDocument,h=g.documentElement,i=g.body,j=g.defaultView,k=j?j.getComputedStyle(b,null):b.currentStyle,l=b.offsetTop,m=b.offsetLeft;while((b=b.parentNode)&&b!==i&&b!==h){if(f.offset.supportsFixedPosition&&k.position==="fixed")break;c=j?j.getComputedStyle(b,null):b.currentStyle,l-=b.scrollTop,m-=b.scrollLeft,b===d&&(l+=b.offsetTop,m+=b.offsetLeft,f.offset.doesNotAddBorder&&(!f.offset.doesAddBorderForTableAndCells||!cw.test(b.nodeName))&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),e=d,d=b.offsetParent),f.offset.subtractsBorderForOverflowNotVisible&&c.overflow!=="visible"&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),k=c}if(k.position==="relative"||k.position==="static")l+=i.offsetTop,m+=i.offsetLeft;f.offset.supportsFixedPosition&&k.position==="fixed"&&(l+=Math.max(h.scrollTop,i.scrollTop),m+=Math.max(h.scrollLeft,i.scrollLeft));return{top:l,left:m}},f.offset={initialize:function(){var a=c.body,b=c.createElement("div"),d,e,g,h,i=parseFloat(f.css(a,"marginTop"))||0,j="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";f.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"}),b.innerHTML=j,a.insertBefore(b,a.firstChild),d=b.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,this.doesNotAddBorder=e.offsetTop!==5,this.doesAddBorderForTableAndCells=h.offsetTop===5,e.style.position="fixed",e.style.top="20px",this.supportsFixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",this.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==i,a.removeChild(b),f.offset.initialize=f.noop},bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;f.offset.initialize(),f.offset.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(f.css(a,"marginTop"))||0,c+=parseFloat(f.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var d=f.css(a,"position");d==="static"&&(a.style.position="relative");var e=f(a),g=e.offset(),h=f.css(a,"top"),i=f.css(a,"left"),j=(d==="absolute"||d==="fixed")&&f.inArray("auto",[h,i])>-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cy(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cy(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){return this[0]?parseFloat(f.css(this[0],d,"padding")):null},f.fn["outer"+c]=function(a){return this[0]?parseFloat(f.css(this[0],d,a?"margin":"border")):null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c];return e.document.compatMode==="CSS1Compat"&&g||e.document.body["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var h=f.css(e,d),i=parseFloat(h);return f.isNaN(i)?h:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f})(window);jQuery.noConflict();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/js/jqueryFileTree/images/zip.png
CHANGED
Binary file
|
admin/js/loader.swf
DELETED
Binary file
|
admin/js/photoswipe/images/icons.png
DELETED
Binary file
|
admin/js/photoswipe/images/icons@2x.png
DELETED
Binary file
|
admin/js/photoswipe/klass.min.js
DELETED
@@ -1,8 +0,0 @@
|
|
1 |
-
/**
|
2 |
-
* Klass.js - copyright @dedfat
|
3 |
-
* version 1.0
|
4 |
-
* https://github.com/ded/klass
|
5 |
-
* Follow our software http://twitter.com/dedfat :)
|
6 |
-
* MIT License
|
7 |
-
*/
|
8 |
-
!function(a,b){function j(a,b){function c(){}c[e]=this[e];var d=this,g=new c,h=f(a),j=h?a:this,k=h?{}:a,l=function(){this.initialize?this.initialize.apply(this,arguments):(b||h&&d.apply(this,arguments),j.apply(this,arguments))};l.methods=function(a){i(g,a,d),l[e]=g;return this},l.methods.call(l,k).prototype.constructor=l,l.extend=arguments.callee,l[e].implement=l.statics=function(a,b){a=typeof a=="string"?function(){var c={};c[a]=b;return c}():a,i(this,a,d);return this};return l}function i(a,b,d){for(var g in b)b.hasOwnProperty(g)&&(a[g]=f(b[g])&&f(d[e][g])&&c.test(b[g])?h(g,b[g],d):b[g])}function h(a,b,c){return function(){var d=this.supr;this.supr=c[e][a];var f=b.apply(this,arguments);this.supr=d;return f}}function g(a){return j.call(f(a)?a:d,a,1)}var c=/xyz/.test(function(){xyz})?/\bsupr\b/:/.*/,d=function(){},e="prototype",f=function(a){return typeof a===b};if(typeof module!="undefined"&&module.exports)module.exports=g;else{var k=a.klass;g.noConflict=function(){a.klass=k;return this},a.klass=g}}(this,"function")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/js/plupload/jquery.ui.plupload/img/plupload.png
CHANGED
Binary file
|
admin/js/script.js
DELETED
@@ -1,292 +0,0 @@
|
|
1 |
-
var metaViewport;
|
2 |
-
jQuery(function() {
|
3 |
-
metaViewport = jQuery('meta[name=viewport]','head').attr('content');
|
4 |
-
});
|
5 |
-
|
6 |
-
function FlAGClass(ExtendVar, skin_id, pic_id, slideshow) {
|
7 |
-
jQuery(function() {
|
8 |
-
if(pic_id !== false){
|
9 |
-
var skin_function = flagFind(skin_id);
|
10 |
-
if(pic_id !== 0 ) {
|
11 |
-
jQuery.fancybox(
|
12 |
-
{
|
13 |
-
'showNavArrows' : false,
|
14 |
-
'overlayShow' : true,
|
15 |
-
'overlayOpacity': '0.9',
|
16 |
-
'overlayColor' : '#000',
|
17 |
-
'transitionIn' : 'elastic',
|
18 |
-
'transitionOut' : 'elastic',
|
19 |
-
'titlePosition' : 'over',
|
20 |
-
'titleFormat' : function(title, currentArray, currentIndex, currentOpts) {
|
21 |
-
var descr = jQuery('<div />').html(jQuery("#flag_pic_"+pic_id, window[skin_id]).find('.flag_pic_desc > span').html()).text();
|
22 |
-
title = jQuery('<div />').html(jQuery("#flag_pic_"+pic_id, window[skin_id]).find('.flag_pic_desc > strong').html()).text();
|
23 |
-
if(title.length || descr.length)
|
24 |
-
return '<div class="grand_controls" rel="'+skin_id+'"><span rel="prev" class="g_prev">prev</span><span rel="show" class="g_slideshow '+slideshow+'">play/pause</span><span rel="next" class="g_next">next</span></div><div id="fancybox-title-over">'+(title.length? '<strong class="title">'+title+'</strong>' : '')+(descr.length? '<div class="descr">'+descr+'</div>' : '')+'</div>';
|
25 |
-
else
|
26 |
-
return '<div class="grand_controls" rel="'+skin_id+'"><span rel="prev" class="g_prev">prev</span><span rel="show" class="g_slideshow '+slideshow+'">play/pause</span><span rel="next" class="g_next">next</span></div>';
|
27 |
-
},
|
28 |
-
'href' : jQuery("#flag_pic_"+pic_id, window[skin_id]).attr('href'),
|
29 |
-
'onStart' : function(){
|
30 |
-
//if(skin_function && jQuery.isFunction(skin_function[skin_id+'_fb'])) {
|
31 |
-
skin_function[skin_id+'_fb']('active');
|
32 |
-
//}
|
33 |
-
jQuery('#fancybox-wrap').addClass('grand');
|
34 |
-
},
|
35 |
-
'onClosed' : function(currentArray, currentIndex){
|
36 |
-
//if(skin_function && jQuery.isFunction(skin_function[skin_id+'_fb'])) {
|
37 |
-
skin_function[skin_id+'_fb']('close');
|
38 |
-
//}
|
39 |
-
jQuery('#fancybox-wrap').removeClass('grand');
|
40 |
-
},
|
41 |
-
'onComplete' : function(currentArray, currentIndex) {
|
42 |
-
}
|
43 |
-
});
|
44 |
-
}
|
45 |
-
jQuery('#fancybox-wrap').off('click', '.grand_controls span').on('click', '.grand_controls span', function(){
|
46 |
-
skin_function[skin_id+'_fb'](jQuery(this).attr('rel'));
|
47 |
-
if(jQuery(this).hasClass('g_slideshow')){
|
48 |
-
jQuery(this).toggleClass('play stop');
|
49 |
-
}
|
50 |
-
});
|
51 |
-
} else {
|
52 |
-
if((('undefined' == metaViewport) || !metaViewport) && ExtendVar == 'photoswipe'){
|
53 |
-
jQuery('head').append('<meta content="width=device-width, initial-scale=1.0;" name="viewport" />');
|
54 |
-
}
|
55 |
-
jQuery('.flashalbum').css('height','auto');
|
56 |
-
jQuery('body#fullwindow').css('overflow','auto');
|
57 |
-
jQuery('#'+skin_id+'_jq').each(function(i){
|
58 |
-
jQuery(this).css({display: 'block'});
|
59 |
-
var catMeta = jQuery('.flagCatMeta',this).hide().get();
|
60 |
-
for(j=0; j<catMeta.length; j++) {
|
61 |
-
var catName = jQuery(catMeta[j]).find('h4').text();
|
62 |
-
var catDescr = jQuery(catMeta[j]).find('p').text();
|
63 |
-
var catId = jQuery(catMeta[j]).next('.flagcategory').attr('id');
|
64 |
-
var act = '';
|
65 |
-
if(j==0) act = ' active';
|
66 |
-
jQuery('.flagcatlinks',this).append('<a class="flagcat'+act+'" href="#'+catId+'" title="'+catDescr+'">'+catName+'</a>');
|
67 |
-
}
|
68 |
-
jQuery('a#backlink').appendTo('.flagcatlinks',this);
|
69 |
-
jQuery('.flagcategory', this).each(function(){
|
70 |
-
var flagcatid = jQuery(this).attr('id');
|
71 |
-
jQuery('a.flag_pic_alt', this).attr('rel',flagcatid);
|
72 |
-
});
|
73 |
-
});
|
74 |
-
jQuery('#'+skin_id+'_jq .flagcat').click(function(){
|
75 |
-
if(!jQuery(this).hasClass('active')) {
|
76 |
-
var catId = jQuery(this).attr('href');
|
77 |
-
jQuery(this).addClass('active').siblings().removeClass('active');
|
78 |
-
jQuery('#'+skin_id+'_jq '+catId).css({display: 'block'}).siblings('.flagcategory').hide();
|
79 |
-
alternate_flag_e(skin_id, catId, ExtendVar);
|
80 |
-
}
|
81 |
-
return false;
|
82 |
-
});
|
83 |
-
alternate_flag_e(skin_id, '.flagcategory:first', ExtendVar);
|
84 |
-
}
|
85 |
-
});
|
86 |
-
}
|
87 |
-
|
88 |
-
function alternate_flag_e(skin_id, t, ExtendVar){
|
89 |
-
jQuery('#'+skin_id+'_jq').find(t).not('.loaded').each(function(){
|
90 |
-
var d = jQuery(this).html();
|
91 |
-
if(d) {
|
92 |
-
d = d.replace(/>\[img src=/g, '><img src="');
|
93 |
-
//d = d.replace(/src=/g, 'src="');
|
94 |
-
d = d.replace(/\]</g, '" /><');
|
95 |
-
jQuery(this).addClass('loaded').html(d);
|
96 |
-
}
|
97 |
-
jQuery(this).css({display: 'block'});
|
98 |
-
if(ExtendVar == 'photoswipe') {
|
99 |
-
var
|
100 |
-
showDescr, longDescription, imgdescr, psImgCaption, curel,
|
101 |
-
options = {
|
102 |
-
allowUserZoom:false,
|
103 |
-
captionAndToolbarAutoHideDelay:0,
|
104 |
-
captionAndToolbarHide:false,
|
105 |
-
captionAndToolbarShowEmptyCaptions:true,
|
106 |
-
zIndex:10000,
|
107 |
-
getToolbar: function(){
|
108 |
-
flagToolbar = window.Code.PhotoSwipe.Toolbar.getToolbar();
|
109 |
-
flagToolbar = flagToolbar + '<div class="ps-toolbar-descr"><div class="ps-toolbar-content"></div></div>';
|
110 |
-
return flagToolbar;
|
111 |
-
// NB. Calling PhotoSwipe.Toolbar.getToolbar() wil return the default toolbar HTML
|
112 |
-
},
|
113 |
-
getImageCaption: function(el){
|
114 |
-
psImgCaption = jQuery('<strong></strong>').addClass('ps-title').append(jQuery(el).attr('title'));
|
115 |
-
return psImgCaption;
|
116 |
-
},
|
117 |
-
getImageMetaData: function(el){
|
118 |
-
imgdescr = jQuery(el).find('span.flag_pic_desc > span:first').html();
|
119 |
-
if(imgdescr.length){
|
120 |
-
imgdescr = jQuery('<div></div>').append(imgdescr);
|
121 |
-
}
|
122 |
-
return {
|
123 |
-
longDescription: imgdescr
|
124 |
-
}
|
125 |
-
|
126 |
-
}
|
127 |
-
},
|
128 |
-
flagBodyScrollTop,
|
129 |
-
flagBodyScrollLeft,
|
130 |
-
instance = jQuery('a.flag_pic_alt',this).on('click',function(){
|
131 |
-
flagBodyScrollTop = jQuery(window).scrollTop();
|
132 |
-
flagBodyScrollLeft = jQuery(window).scrollLeft();
|
133 |
-
}).photoSwipe(options);
|
134 |
-
|
135 |
-
// onBeforeShow - store a reference to our "say hi" button
|
136 |
-
instance.addEventHandler(window.Code.PhotoSwipe.EventTypes.onBeforeShow, function(e){
|
137 |
-
jQuery(window).scrollLeft(0).scrollTop(0);
|
138 |
-
jQuery('html').addClass('ps-noscroll');
|
139 |
-
jQuery('meta[name=viewport]').attr('content','width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0');
|
140 |
-
//window.location.hash = '#OpenGallery';
|
141 |
-
});
|
142 |
-
// onShow - store a reference to our "say hi" button
|
143 |
-
instance.addEventHandler(window.Code.PhotoSwipe.EventTypes.onShow, function(e){
|
144 |
-
showDescr = window.document.querySelectorAll('.ps-toolbar-descr')[0];
|
145 |
-
});
|
146 |
-
// onBeforeHide - clean up
|
147 |
-
instance.addEventHandler(window.Code.PhotoSwipe.EventTypes.onBeforeHide, function(e){
|
148 |
-
showDescr = null;
|
149 |
-
});
|
150 |
-
// onHide - clean up
|
151 |
-
instance.addEventHandler(window.Code.PhotoSwipe.EventTypes.onHide, function(e){
|
152 |
-
if(('undefined' == metaViewport) || !metaViewport){
|
153 |
-
jQuery('meta[name=viewport]').attr('content','width=device-width, initial-scale=1.0, minimum-scale=0.25, maximum-scale=1.6, user-scalable=1');
|
154 |
-
jQuery('meta[name=viewport]').remove();
|
155 |
-
} else {
|
156 |
-
jQuery('meta[name=viewport]').attr('content',metaViewport);
|
157 |
-
}
|
158 |
-
jQuery('html').removeClass('ps-noscroll');
|
159 |
-
setTimeout(function(){ jQuery(window).scrollTop(flagBodyScrollTop).scrollLeft(flagBodyScrollLeft); }, 0);
|
160 |
-
console.log(flagBodyScrollLeft, flagBodyScrollTop);
|
161 |
-
//window.location.hash = '#CloseGallery';
|
162 |
-
});
|
163 |
-
// onDisplayImage
|
164 |
-
instance.addEventHandler(window.Code.PhotoSwipe.EventTypes.onDisplayImage, function(e){
|
165 |
-
curel = instance.getCurrentImage();
|
166 |
-
var curid = curel.refObj.id;
|
167 |
-
curid = curid.replace('flag_pic_','');
|
168 |
-
jQuery.post(hitajax, { hit: curid }, function(r){ console.log(r); });
|
169 |
-
if(curel.metaData.longDescription){
|
170 |
-
jQuery('.ps-caption-content').append(jQuery('<div></div>').addClass('ps-long-description').html(jQuery(curel.metaData.longDescription).text()).hide());
|
171 |
-
jQuery('.ps-toolbar-descr').removeClass('disabled active').addClass('enabled');
|
172 |
-
} else {
|
173 |
-
jQuery('.ps-toolbar-descr').removeClass('enabled active').addClass('disabled');
|
174 |
-
}
|
175 |
-
});
|
176 |
-
// onSlideshowStart
|
177 |
-
instance.addEventHandler(window.Code.PhotoSwipe.EventTypes.onCaptionAndToolbarShow, function(e){
|
178 |
-
curel = instance.getCurrentImage();
|
179 |
-
if(curel.metaData.longDescription){
|
180 |
-
jQuery('.ps-caption-content').append(jQuery('<div></div>').addClass('ps-long-description').html(jQuery(curel.metaData.longDescription).text()).hide());
|
181 |
-
jQuery('.ps-toolbar-descr').removeClass('disabled active').addClass('enabled');
|
182 |
-
} else {
|
183 |
-
jQuery('.ps-toolbar-descr').removeClass('enabled active').addClass('disabled');
|
184 |
-
}
|
185 |
-
});
|
186 |
-
// onToolbarTap - listen out for when the toolbar is tapped
|
187 |
-
instance.addEventHandler(window.Code.PhotoSwipe.EventTypes.onToolbarTap, function(e){
|
188 |
-
if (e.toolbarAction === window.Code.PhotoSwipe.Toolbar.ToolbarAction.none){
|
189 |
-
if (e.tapTarget === showDescr || window.Code.Util.DOM.isChildOf(e.tapTarget, showDescr)){
|
190 |
-
if(jQuery(showDescr).hasClass('enabled')){
|
191 |
-
jQuery('.ps-toolbar-descr').toggleClass('active');
|
192 |
-
jQuery('.ps-long-description').slideToggle(400);
|
193 |
-
}
|
194 |
-
}
|
195 |
-
}
|
196 |
-
});
|
197 |
-
} else if(ExtendVar == 'fancybox'){
|
198 |
-
jQuery('a.flag_pic_alt',this).fancybox({
|
199 |
-
'overlayShow' : true,
|
200 |
-
'overlayOpacity': '0.5',
|
201 |
-
'transitionIn' : 'elastic',
|
202 |
-
'transitionOut' : 'elastic',
|
203 |
-
'titlePosition' : 'over',
|
204 |
-
'titleFormat' : function(title, currentArray, currentIndex, currentOpts) {
|
205 |
-
var descr = jQuery('<div />').html(jQuery('.flag_pic_desc > span', currentArray[currentIndex]).html()).text();
|
206 |
-
title = jQuery('<div />').html(jQuery('.flag_pic_desc > strong', currentArray[currentIndex]).html()).text();
|
207 |
-
return '<div id="fancybox-title-over"><em>'+(currentIndex + 1)+' / '+currentArray.length+' </em>'+(title.length? '<strong class="title">'+title+'</strong>' : '')+(descr.length? '<div class="descr">'+descr+'</div>' : '')+'</div>';
|
208 |
-
},
|
209 |
-
'onClosed' : function(currentArray, currentIndex){
|
210 |
-
jQuery(currentArray[currentIndex]).removeClass('current').addClass('last');
|
211 |
-
},
|
212 |
-
'onComplete' : function(currentArray, currentIndex) {
|
213 |
-
jQuery(currentArray).removeClass('current last');
|
214 |
-
jQuery(currentArray[currentIndex]).addClass('current');
|
215 |
-
var curid = jQuery(currentArray[currentIndex]).attr('id');
|
216 |
-
curid = curid.replace('flag_pic_','');
|
217 |
-
jQuery.post(hitajax, { hit: curid }, function(r){ console.log(r); });
|
218 |
-
}
|
219 |
-
});
|
220 |
-
}
|
221 |
-
|
222 |
-
});
|
223 |
-
}
|
224 |
-
|
225 |
-
function thumb_cl(skin_id, pic_id, slideshow){
|
226 |
-
pic_id = parseInt(pic_id);
|
227 |
-
new FlAGClass(ExtendVar, skin_id, pic_id, slideshow);
|
228 |
-
}
|
229 |
-
|
230 |
-
/*jQuery(document).ready(function() {
|
231 |
-
jQuery('div.flashalbum').dblclick(function(e){
|
232 |
-
if(e.target.tagName == 'IMG' || e.target.tagName == 'A') return;
|
233 |
-
if(jQuery('body').hasClass('FlAG')){
|
234 |
-
unhideSite(this, jQuery(this).attr('data-height'), jQuery(this).attr('data-scrolltop'));
|
235 |
-
} else {
|
236 |
-
jQuery(this).attr('data-height',jQuery(this).height()).attr('data-scrolltop',jQuery(window).scrollTop());
|
237 |
-
hideSite(this);
|
238 |
-
}
|
239 |
-
});
|
240 |
-
});*/
|
241 |
-
function enlargeFlAG(t){
|
242 |
-
var pleft = jQuery(t).offset().left - jQuery(window).scrollLeft();
|
243 |
-
var pheight = jQuery(window).height();
|
244 |
-
jQuery(t).css({left:-pleft,top:0,width:'100%',height:pheight+'px'});
|
245 |
-
}
|
246 |
-
function unlargeFlAG(t, hFA, sst){
|
247 |
-
jQuery(t).css({left:0,top:0,width:'100%',height:hFA+'px'});
|
248 |
-
jQuery(window).scrollTop(sst);
|
249 |
-
}
|
250 |
-
function hideSite(t){
|
251 |
-
jQuery('body').addClass('FlAG');
|
252 |
-
jQuery(t).parents('div').addClass('FlAGz').each(function(){
|
253 |
-
if(jQuery(this).attr('style')){
|
254 |
-
jQuery(this).attr('data-elstyle',jQuery(this).attr('style')).css({zIndex:100,width:'100%',maxWidth:'100%',height:'auto',padding:0,margin:0,border:'none'});
|
255 |
-
} else {
|
256 |
-
jQuery(this).css({zIndex:100,width:'100%',maxWidth:'100%',height:'auto',padding:0,margin:0,border:'none'});
|
257 |
-
}
|
258 |
-
});
|
259 |
-
jQuery(t).siblings().not('script, link, style, head').addClass('FlAGd').each(function(){
|
260 |
-
if(jQuery(this).attr('style')){
|
261 |
-
jQuery(this).attr('data-elstyle',jQuery(this).attr('style')).css({visibility:'hidden',height:0,minHeight:0,padding:0,margin:'0 0 0 -10000px',border:'none',fontSize:0,lineHeight:0});
|
262 |
-
} else {
|
263 |
-
jQuery(this).css({visibility:'hidden',height:0,minHeight:0,padding:0,margin:'0 0 0 -10000px',border:'none',fontSize:0,lineHeight:0});
|
264 |
-
}
|
265 |
-
});
|
266 |
-
jQuery(t).parents().siblings().not('script, link, style, head').addClass('FlAGd').each(function(){
|
267 |
-
if(jQuery(this).attr('style')){
|
268 |
-
jQuery(this).attr('data-elstyle',jQuery(this).attr('style')).css({visibility:'hidden',height:0,minHeight:0,maxHeight:0,padding:0,margin:'0 0 0 -10000px',border:'none',fontSize:0,lineHeight:0});
|
269 |
-
} else {
|
270 |
-
jQuery(this).css({visibility:'hidden',height:0,minHeight:0,maxHeight:0,padding:0,margin:'0 0 0 -10000px',border:'none',fontSize:0,lineHeight:0});
|
271 |
-
}
|
272 |
-
});
|
273 |
-
enlargeFlAG(t);
|
274 |
-
}
|
275 |
-
function unhideSite(t, hFA, sst){
|
276 |
-
jQuery('body').removeClass('FlAG');
|
277 |
-
jQuery(t).parents('div').removeClass('FlAGz').each(function(i){
|
278 |
-
if(jQuery(this).attr('data-elstyle')){
|
279 |
-
jQuery(this).attr('style',jQuery(this).attr('data-elstyle')).removeAttr('data-elstyle');
|
280 |
-
} else {
|
281 |
-
jQuery(this).removeAttr('style');
|
282 |
-
}
|
283 |
-
});
|
284 |
-
jQuery('.FlAGd').each(function(){
|
285 |
-
if(jQuery(this).attr('data-elstyle')){
|
286 |
-
jQuery(this).attr('style',jQuery(this).attr('data-elstyle')).removeAttr('data-elstyle').removeClass('FlAGd');
|
287 |
-
} else {
|
288 |
-
jQuery(this).removeAttr('style').removeClass('FlAGd');
|
289 |
-
}
|
290 |
-
});
|
291 |
-
unlargeFlAG(t, hFA, sst);
|
292 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/js/swfaddress-optimizer.js
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
/**
|
2 |
* SWFAddress 2.4: Deep linking for Flash and Ajax <http://www.asual.com/swfaddress/>
|
3 |
*
|
4 |
* SWFAddress is (c) 2006-2009 Rostislav Hristov and contributors
|
5 |
* This software is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
|
6 |
*
|
7 |
* Uses code from SWFObject 2.1 <http://code.google.com/p/swfobject/>
|
8 |
* SWFObject is (c) 2007-2009 Geoff Stearns, Michael Williams, and Bobby van der Sluis
|
9 |
*
|
10 |
*/
|
|
|
0 |
* SWFAddress 2.4: Deep linking for Flash and Ajax <http://www.asual.com/swfaddress/>
|
1 |
*
|
2 |
* SWFAddress is (c) 2006-2009 Rostislav Hristov and contributors
|
3 |
* This software is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
|
4 |
*
|
5 |
* Uses code from SWFObject 2.1 <http://code.google.com/p/swfobject/>
|
6 |
* SWFObject is (c) 2007-2009 Geoff Stearns, Michael Williams, and Bobby van der Sluis
|
7 |
*
|
8 |
*/
|
admin/js/swfaddress.js
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
/**
|
2 |
* SWFAddress 2.4: Deep linking for Flash and Ajax <http://www.asual.com/swfaddress/>
|
3 |
*
|
4 |
* SWFAddress is (c) 2006-2009 Rostislav Hristov and contributors
|
5 |
* This software is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
|
6 |
*
|
7 |
*/
|
|
|
0 |
* SWFAddress 2.4: Deep linking for Flash and Ajax <http://www.asual.com/swfaddress/>
|
1 |
*
|
2 |
* SWFAddress is (c) 2006-2009 Rostislav Hristov and contributors
|
3 |
* This software is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
|
4 |
*
|
5 |
*/
|
admin/js/swfmousewheel.js
DELETED
@@ -1,51 +0,0 @@
|
|
1 |
-
// RM: this is my own version of the swfmacmousewheel.js
|
2 |
-
// works with out registration, or the requirement of swfobject
|
3 |
-
// only applies scroll events to swf the mouse is currently over
|
4 |
-
// prevents browser scrolling on all OS's
|
5 |
-
|
6 |
-
// Good portion of code kindly borrowed from: SWFMacMouseWheel v2.0: Mac Mouse Wheel functionality in flash - http://blog.pixelbreaker.com/
|
7 |
-
|
8 |
-
var swfmousewheel = function () {
|
9 |
-
|
10 |
-
var u = navigator.userAgent.toLowerCase();
|
11 |
-
var p = navigator.platform.toLowerCase();
|
12 |
-
var isMac = p ? /mac/.test(p) : /mac/.test(u);
|
13 |
-
|
14 |
-
var handleWheelScroll = function(event) {
|
15 |
-
|
16 |
-
var evt = event || window.event;
|
17 |
-
var tgt = evt.target || evt.srcElement;
|
18 |
-
if (tgt.nodeType == 3) { tgt = tgt.parentNode; } // safari edge case
|
19 |
-
|
20 |
-
var typeAttr = tgt.getAttribute('type') || '';
|
21 |
-
var classAttr = tgt.getAttribute('classid') || '';
|
22 |
-
var isSWF = typeAttr.toLowerCase() == 'application/x-shockwave-flash' || classAttr.toLowerCase() == 'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000';
|
23 |
-
|
24 |
-
if (!isSWF) { return; } // not over a swf, let the browser deal with it
|
25 |
-
|
26 |
-
var delta = 0;
|
27 |
-
if (evt.wheelDelta) { // ie/opera
|
28 |
-
delta = evt.wheelDelta / 120;
|
29 |
-
if (window.opera) { delta = -delta; }
|
30 |
-
|
31 |
-
} else if (evt.detail) { // mozilla
|
32 |
-
delta = -evt.detail;
|
33 |
-
}
|
34 |
-
|
35 |
-
if (delta && isMac) {
|
36 |
-
// we've scrolled.. pass info into swf if it can handle it
|
37 |
-
if( typeof( tgt.externalMouseEvent ) == 'function' ) {
|
38 |
-
tgt.externalMouseEvent( delta );
|
39 |
-
}
|
40 |
-
}
|
41 |
-
// RM: always prevent scroll events from reach the browser if we are over a swf
|
42 |
-
if (evt.preventDefault) { evt.preventDefault(); }
|
43 |
-
evt.returnValue = false;
|
44 |
-
|
45 |
-
}
|
46 |
-
|
47 |
-
// init
|
48 |
-
if (window.addEventListener) { window.addEventListener('DOMMouseScroll', handleWheelScroll, false); } // mozilla
|
49 |
-
window.onmousewheel = document.onmousewheel = handleWheelScroll; // ie/opera
|
50 |
-
|
51 |
-
}();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/js/swfobject.js
DELETED
@@ -1,31 +0,0 @@
|
|
1 |
-
/* SWFObject v2.2 <http://code.google.com/p/swfobject/>
|
2 |
-
is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
|
3 |
-
*/
|
4 |
-
var swfobject=function(){var D="undefined",r="object",S="Shockwave Flash",W="ShockwaveFlash.ShockwaveFlash",q="application/x-shockwave-flash",R="SWFObjectExprInst",x="onreadystatechange",O=window,j=document,t=navigator,T=false,U=[h],o=[],N=[],I=[],l,Q,E,B,J=false,a=false,n,G,m=true,M=function(){var aa=typeof j.getElementById!=D&&typeof j.getElementsByTagName!=D&&typeof j.createElement!=D,ah=t.userAgent.toLowerCase(),Y=t.platform.toLowerCase(),ae=Y?/win/.test(Y):/win/.test(ah),ac=Y?/mac/.test(Y):/mac/.test(ah),af=/webkit/.test(ah)?parseFloat(ah.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,X=!+"\v1",ag=[0,0,0],ab=null;if(typeof t.plugins!=D&&typeof t.plugins[S]==r){ab=t.plugins[S].description;if(ab&&!(typeof t.mimeTypes!=D&&t.mimeTypes[q]&&!t.mimeTypes[q].enabledPlugin)){T=true;X=false;ab=ab.replace(/^.*\s+(\S+\s+\S+$)/,"$1");ag[0]=parseInt(ab.replace(/^(.*)\..*$/,"$1"),10);ag[1]=parseInt(ab.replace(/^.*\.(.*)\s.*$/,"$1"),10);ag[2]=/[a-zA-Z]/.test(ab)?parseInt(ab.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else{if(typeof O.ActiveXObject!=D){try{var ad=new ActiveXObject(W);if(ad){ab=ad.GetVariable("$version");if(ab){X=true;ab=ab.split(" ")[1].split(",");ag=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}}catch(Z){}}}return{w3:aa,pv:ag,wk:af,ie:X,win:ae,mac:ac}}(),k=function(){if(!M.w3){return}if((typeof j.readyState!=D&&j.readyState=="complete")||(typeof j.readyState==D&&(j.getElementsByTagName("body")[0]||j.body))){f()}if(!J){if(typeof j.addEventListener!=D){j.addEventListener("DOMContentLoaded",f,false)}if(M.ie&&M.win){j.attachEvent(x,function(){if(j.readyState=="complete"){j.detachEvent(x,arguments.callee);f()}});if(O==top){(function(){if(J){return}try{j.documentElement.doScroll("left")}catch(X){setTimeout(arguments.callee,0);return}f()})()}}if(M.wk){(function(){if(J){return}if(!/loaded|complete/.test(j.readyState)){setTimeout(arguments.callee,0);return}f()})()}s(f)}}();function f(){if(J){return}try{var Z=j.getElementsByTagName("body")[0].appendChild(C("span"));Z.parentNode.removeChild(Z)}catch(aa){return}J=true;var X=U.length;for(var Y=0;Y<X;Y++){U[Y]()}}function K(X){if(J){X()}else{U[U.length]=X}}function s(Y){if(typeof O.addEventListener!=D){O.addEventListener("load",Y,false)}else{if(typeof j.addEventListener!=D){j.addEventListener("load",Y,false)}else{if(typeof O.attachEvent!=D){i(O,"onload",Y)}else{if(typeof O.onload=="function"){var X=O.onload;O.onload=function(){X();Y()}}else{O.onload=Y}}}}}function h(){if(T){V()}else{H()}}function V(){var X=j.getElementsByTagName("body")[0];var aa=C(r);aa.setAttribute("type",q);var Z=X.appendChild(aa);if(Z){var Y=0;(function(){if(typeof Z.GetVariable!=D){var ab=Z.GetVariable("$version");if(ab){ab=ab.split(" ")[1].split(",");M.pv=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}else{if(Y<10){Y++;setTimeout(arguments.callee,10);return}}X.removeChild(aa);Z=null;H()})()}else{H()}}function H(){var ag=o.length;if(ag>0){for(var af=0;af<ag;af++){var Y=o[af].id;var ab=o[af].callbackFn;var aa={success:false,id:Y};if(M.pv[0]>0){var ae=c(Y);if(ae){if(F(o[af].swfVersion)&&!(M.wk&&M.wk<312)){w(Y,true);if(ab){aa.success=true;aa.ref=z(Y);ab(aa)}}else{if(o[af].expressInstall&&A()){var ai={};ai.data=o[af].expressInstall;ai.width=ae.getAttribute("width")||"0";ai.height=ae.getAttribute("height")||"0";if(ae.getAttribute("class")){ai.styleclass=ae.getAttribute("class")}if(ae.getAttribute("align")){ai.align=ae.getAttribute("align")}var ah={};var X=ae.getElementsByTagName("param");var ac=X.length;for(var ad=0;ad<ac;ad++){if(X[ad].getAttribute("name").toLowerCase()!="movie"){ah[X[ad].getAttribute("name")]=X[ad].getAttribute("value")}}P(ai,ah,Y,ab)}else{p(ae);if(ab){ab(aa)}}}}}else{w(Y,true);if(ab){var Z=z(Y);if(Z&&typeof Z.SetVariable!=D){aa.success=true;aa.ref=Z}ab(aa)}}}}}function z(aa){var X=null;var Y=c(aa);if(Y&&Y.nodeName=="OBJECT"){if(typeof Y.SetVariable!=D){X=Y}else{var Z=Y.getElementsByTagName(r)[0];if(Z){X=Z}}}return X}function A(){return !a&&F("6.0.65")&&(M.win||M.mac)&&!(M.wk&&M.wk<312)}function P(aa,ab,X,Z){a=true;E=Z||null;B={success:false,id:X};var ae=c(X);if(ae){if(ae.nodeName=="OBJECT"){l=g(ae);Q=null}else{l=ae;Q=X}aa.id=R;if(typeof aa.width==D||(!/%$/.test(aa.width)&&parseInt(aa.width,10)<310)){aa.width="310"}if(typeof aa.height==D||(!/%$/.test(aa.height)&&parseInt(aa.height,10)<137)){aa.height="137"}j.title=j.title.slice(0,47)+" - Flash Player Installation";var ad=M.ie&&M.win?"ActiveX":"PlugIn",ac="MMredirectURL="+O.location.toString().replace(/&/g,"%26")+"&MMplayerType="+ad+"&MMdoctitle="+j.title;if(typeof ab.flashvars!=D){ab.flashvars+="&"+ac}else{ab.flashvars=ac}if(M.ie&&M.win&&ae.readyState!=4){var Y=C("div");X+="SWFObjectNew";Y.setAttribute("id",X);ae.parentNode.insertBefore(Y,ae);ae.style.display="none";(function(){if(ae.readyState==4){ae.parentNode.removeChild(ae)}else{setTimeout(arguments.callee,10)}})()}u(aa,ab,X)}}function p(Y){if(M.ie&&M.win&&Y.readyState!=4){var X=C("div");Y.parentNode.insertBefore(X,Y);X.parentNode.replaceChild(g(Y),X);Y.style.display="none";(function(){if(Y.readyState==4){Y.parentNode.removeChild(Y)}else{setTimeout(arguments.callee,10)}})()}else{Y.parentNode.replaceChild(g(Y),Y)}}function g(ab){var aa=C("div");if(M.win&&M.ie){aa.innerHTML=ab.innerHTML}else{var Y=ab.getElementsByTagName(r)[0];if(Y){var ad=Y.childNodes;if(ad){var X=ad.length;for(var Z=0;Z<X;Z++){if(!(ad[Z].nodeType==1&&ad[Z].nodeName=="PARAM")&&!(ad[Z].nodeType==8)){aa.appendChild(ad[Z].cloneNode(true))}}}}}return aa}function u(ai,ag,Y){var X,aa=c(Y);if(M.wk&&M.wk<312){return X}if(aa){if(typeof ai.id==D){ai.id=Y}if(M.ie&&M.win){var ah="";for(var ae in ai){if(ai[ae]!=Object.prototype[ae]){if(ae.toLowerCase()=="data"){ag.movie=ai[ae]}else{if(ae.toLowerCase()=="styleclass"){ah+=' class="'+ai[ae]+'"'}else{if(ae.toLowerCase()!="classid"){ah+=" "+ae+'="'+ai[ae]+'"'}}}}}var af="";for(var ad in ag){if(ag[ad]!=Object.prototype[ad]){af+='<param name="'+ad+'" value="'+ag[ad]+'" />'}}aa.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+ah+">"+af+"</object>";N[N.length]=ai.id;X=c(ai.id)}else{var Z=C(r);Z.setAttribute("type",q);for(var ac in ai){if(ai[ac]!=Object.prototype[ac]){if(ac.toLowerCase()=="styleclass"){Z.setAttribute("class",ai[ac])}else{if(ac.toLowerCase()!="classid"){Z.setAttribute(ac,ai[ac])}}}}for(var ab in ag){if(ag[ab]!=Object.prototype[ab]&&ab.toLowerCase()!="movie"){e(Z,ab,ag[ab])}}aa.parentNode.replaceChild(Z,aa);X=Z}}return X}function e(Z,X,Y){var aa=C("param");aa.setAttribute("name",X);aa.setAttribute("value",Y);Z.appendChild(aa)}function y(Y){var X=c(Y);if(X&&X.nodeName=="OBJECT"){if(M.ie&&M.win){X.style.display="none";(function(){if(X.readyState==4){b(Y)}else{setTimeout(arguments.callee,10)}})()}else{X.parentNode.removeChild(X)}}}function b(Z){var Y=c(Z);if(Y){for(var X in Y){if(typeof Y[X]=="function"){Y[X]=null}}Y.parentNode.removeChild(Y)}}function c(Z){var X=null;try{X=j.getElementById(Z)}catch(Y){}return X}function C(X){return j.createElement(X)}function i(Z,X,Y){Z.attachEvent(X,Y);I[I.length]=[Z,X,Y]}function F(Z){var Y=M.pv,X=Z.split(".");X[0]=parseInt(X[0],10);X[1]=parseInt(X[1],10)||0;X[2]=parseInt(X[2],10)||0;return(Y[0]>X[0]||(Y[0]==X[0]&&Y[1]>X[1])||(Y[0]==X[0]&&Y[1]==X[1]&&Y[2]>=X[2]))?true:false}function v(ac,Y,ad,ab){if(M.ie&&M.mac){return}var aa=j.getElementsByTagName("head")[0];if(!aa){return}var X=(ad&&typeof ad=="string")?ad:"screen";if(ab){n=null;G=null}if(!n||G!=X){var Z=C("style");Z.setAttribute("type","text/css");Z.setAttribute("media",X);n=aa.appendChild(Z);if(M.ie&&M.win&&typeof j.styleSheets!=D&&j.styleSheets.length>0){n=j.styleSheets[j.styleSheets.length-1]}G=X}if(M.ie&&M.win){if(n&&typeof n.addRule==r){n.addRule(ac,Y)}}else{if(n&&typeof j.createTextNode!=D){n.appendChild(j.createTextNode(ac+" {"+Y+"}"))}}}function w(Z,X){if(!m){return}var Y=X?"visible":"hidden";if(J&&c(Z)){c(Z).style.visibility=Y}else{v("#"+Z,"visibility:"+Y)}}function L(Y){var Z=/[\\\"<>\.;]/;var X=Z.exec(Y)!=null;return X&&typeof encodeURIComponent!=D?encodeURIComponent(Y):Y}var d=function(){if(M.ie&&M.win){window.attachEvent("onunload",function(){var ac=I.length;for(var ab=0;ab<ac;ab++){I[ab][0].detachEvent(I[ab][1],I[ab][2])}var Z=N.length;for(var aa=0;aa<Z;aa++){y(N[aa])}for(var Y in M){M[Y]=null}M=null;for(var X in swfobject){swfobject[X]=null}swfobject=null})}}();return{registerObject:function(ab,X,aa,Z){if(M.w3&&ab&&X){var Y={};Y.id=ab;Y.swfVersion=X;Y.expressInstall=aa;Y.callbackFn=Z;o[o.length]=Y;w(ab,false)}else{if(Z){Z({success:false,id:ab})}}},getObjectById:function(X){if(M.w3){return z(X)}},embedSWF:function(ab,ah,ae,ag,Y,aa,Z,ad,af,ac){var X={success:false,id:ah};if(M.w3&&!(M.wk&&M.wk<312)&&ab&&ah&&ae&&ag&&Y){w(ah,false);K(function(){ae+="";ag+="";var aj={};if(af&&typeof af===r){for(var al in af){aj[al]=af[al]}}aj.data=ab;aj.width=ae;aj.height=ag;var am={};if(ad&&typeof ad===r){for(var ak in ad){am[ak]=ad[ak]}}if(Z&&typeof Z===r){for(var ai in Z){if(typeof am.flashvars!=D){am.flashvars+="&"+ai+"="+Z[ai]}else{am.flashvars=ai+"="+Z[ai]}}}if(F(Y)){var an=u(aj,am,ah);if(aj.id==ah){w(ah,true)}X.success=true;X.ref=an}else{if(aa&&A()){aj.data=aa;P(aj,am,ah,ac);return}else{w(ah,true)}}if(ac){ac(X)}})}else{if(ac){ac(X)}}},switchOffAutoHideShow:function(){m=false},ua:M,getFlashPlayerVersion:function(){return{major:M.pv[0],minor:M.pv[1],release:M.pv[2]}},hasFlashPlayerVersion:F,createSWF:function(Z,Y,X){if(M.w3){return u(Z,Y,X)}else{return undefined}},showExpressInstall:function(Z,aa,X,Y){if(M.w3&&A()){P(Z,aa,X,Y)}},removeSWF:function(X){if(M.w3){y(X)}},createCSS:function(aa,Z,Y,X){if(M.w3){v(aa,Z,Y,X)}},addDomLoadEvent:K,addLoadEvent:s,getQueryParamValue:function(aa){var Z=j.location.search||j.location.hash;if(Z){if(/\?/.test(Z)){Z=Z.split("?")[1]}if(aa==null){return L(Z)}var Y=Z.split("&");for(var X=0;X<Y.length;X++){if(Y[X].substring(0,Y[X].indexOf("="))==aa){return L(Y[X].substring((Y[X].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(a){var X=c(R);if(X&&l){X.parentNode.replaceChild(l,X);if(Q){w(Q,true);if(M.ie&&M.win){l.style.display="block"}}if(E){E(B)}}a=false}}}}();
|
5 |
-
var flag_alt = new Object();
|
6 |
-
function waitJQ(fbVar,fbW,fbH) { if (typeof(jQuery) == 'undefined') { window.setTimeout(waitJQ, 100); } else { if (typeof(jQuery.fn.fancybox) == 'undefined') { jQuery("head").append("<script type='text/javascript' src='"+fbVar+"admin/js/jquery.fancybox-1.3.4.pack.js'></script><link rel='stylesheet' href='"+fbVar+"admin/js/jquery.fancybox-1.3.4.css' type='text/css' media='screen' />"); } waitFB(fbW,fbH); } }
|
7 |
-
function waitFB(fbW,fbH) { if (typeof(jQuery.fn.fancybox) == 'undefined') { window.setTimeout(waitFB, 100); } else {
|
8 |
-
jQuery(document).ready(function() {
|
9 |
-
jQuery('.flag_fancybox').fancybox({
|
10 |
-
'type' : 'iframe',
|
11 |
-
'width' : fbW,
|
12 |
-
'height' : fbH,
|
13 |
-
'overlayShow' : true,
|
14 |
-
'overlayOpacity': '0.5',
|
15 |
-
'showNavArrows' : false
|
16 |
-
});
|
17 |
-
});
|
18 |
-
}}
|
19 |
-
function waitJQv(fvVar,fvW,fvH) { if (typeof(jQuery) == 'undefined') { window.setTimeout(waitJQ, 100); } else { if (typeof(jQuery.fn.fancybox) == 'undefined') { jQuery("head").append("<script type='text/javascript' src='"+fvVar+"admin/js/jquery.fancybox-1.3.4.pack.js'></script><link rel='stylesheet' href='"+fvVar+"admin/js/jquery.fancybox-1.3.4.css' type='text/css' media='screen' />"); } waitFBv(fvW,fvH); } }
|
20 |
-
function waitFBv(fvW,fvH) { if (typeof(jQuery.fn.fancybox) == 'undefined') { window.setTimeout(waitFB, 100); } else {
|
21 |
-
jQuery(document).ready(function() {
|
22 |
-
jQuery('.flag_fancyvid').fancybox({
|
23 |
-
'type' : 'iframe',
|
24 |
-
'width' : fvW,
|
25 |
-
'height' : fvH,
|
26 |
-
'overlayShow' : true,
|
27 |
-
'overlayOpacity': '0.5',
|
28 |
-
'showNavArrows' : false
|
29 |
-
});
|
30 |
-
});
|
31 |
-
}}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/js/themes/default/arrows.png
DELETED
Binary file
|
admin/js/themes/default/bullets.png
DELETED
Binary file
|
admin/js/widgets_admin.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
jQuery(document).ready(function() {
|
2 |
-
jQuery('#widgets-right
|
3 |
var inp = jQuery(e.target).parent().parent().parent().find('.grand_items_array > input');
|
4 |
console.log(inp);
|
5 |
var cur = jQuery(e.target).val();
|
1 |
jQuery(document).ready(function() {
|
2 |
+
jQuery('#widgets-right').on('click', '.grandGalleries :checkbox',function(e){
|
3 |
var inp = jQuery(e.target).parent().parent().parent().find('.grand_items_array > input');
|
4 |
console.log(inp);
|
5 |
var cur = jQuery(e.target).val();
|
admin/manage-banner.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You are not allowed to call this page directly.');}
|
4 |
|
5 |
-
function flag_b_playlist_edit() {
|
6 |
|
7 |
$filepath = admin_url() . 'admin.php?page=' . urlencode($_GET['page']);
|
8 |
$all_playlists = get_b_playlists();
|
@@ -39,7 +39,7 @@ function checkSelected() {
|
|
39 |
var numchecked = getNumChecked(document.getElementById('updatePlaylist'));
|
40 |
|
41 |
if(numchecked < 1) {
|
42 |
-
alert('<?php echo esc_js(__("No items selected", "
|
43 |
return false;
|
44 |
}
|
45 |
|
@@ -47,11 +47,11 @@ function checkSelected() {
|
|
47 |
|
48 |
switch (actionId) {
|
49 |
case "delete_items":
|
50 |
-
return confirm('<?php echo sprintf(esc_js(__("You are about to delete %s item(s) \n \n 'Cancel' to stop, 'OK' to proceed.",'
|
51 |
break;
|
52 |
}
|
53 |
|
54 |
-
return confirm('<?php echo sprintf(esc_js(__("You are about to start the bulk edit for %s item(s) \n \n 'Cancel' to stop, 'OK' to proceed.",'
|
55 |
}
|
56 |
|
57 |
function showDialog( windowId, height ) {
|
@@ -97,11 +97,11 @@ jQuery(document).ready(function(){
|
|
97 |
</script>
|
98 |
|
99 |
<div class="flag-wrap">
|
100 |
-
<h2><?php _e( 'Playlist', '
|
101 |
<div style="float: right; margin: -20px 3px 0 0;">
|
102 |
-
<span><a href="<?php echo $filepath; ?>"><?php _e('Back to Banner Box', '
|
103 |
<select name="select_playlist" onchange="window.location.href=this.options[this.selectedIndex].value">
|
104 |
-
<option selected="selected"><?php _e('Choose another playlist', '
|
105 |
<?php
|
106 |
foreach((array)$all_playlists as $playlist_file => $playlist_data) {
|
107 |
$playlist_name = basename($playlist_file, '.xml');
|
@@ -120,41 +120,46 @@ jQuery(document).ready(function(){
|
|
120 |
<div id="poststuff" class="metabox-holder">
|
121 |
<div id="post-body"><div id="post-body-content"><div id="normal-sortables" style="position: relative;">
|
122 |
<div id="flagalleryset" class="postbox" >
|
123 |
-
<h3 class="hndle"><span><?php _e('Playlist settings', '
|
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', '
|
128 |
<td align="left" valign="middle"><input type="text" readonly="readonly" size="50" onfocus="this.select()" value="[grandbanner xml=<?php echo sanitize_flagname($_GET['playlist']); ?>]" /></td>
|
129 |
-
<td rowspan="3" align="left" valign="top"><div><strong style="display: inline-block; width: 100px;"><?php _e("Playlist Skin", '
|
130 |
<input id="skinaction" type="hidden" name="skinaction" value="<?php echo sanitize_flagname($playlist['skin']); ?>" />
|
131 |
<select id="skinname" name="skinname" style="width: 200px; height: 24px; font-size: 11px;">
|
132 |
<?php require_once (dirname(__FILE__) . '/get_skin.php');
|
133 |
$all_skins = get_skins($skin_folder='', $type='b');
|
|
|
134 |
if(count($all_skins)) {
|
135 |
foreach ( (array)$all_skins as $skin_file => $skin_data) {
|
136 |
-
|
|
|
|
|
|
|
|
|
137 |
echo '<option'.$cur.' value="'.dirname($skin_file).'">'.$skin_data['Name'].'</option>'."\n";
|
138 |
}
|
139 |
} else {
|
140 |
-
echo '<option value="
|
141 |
}
|
142 |
?>
|
143 |
-
</select> <a id="skinOptions" class="thickbox" href="<?php echo FLAG_URLPATH.'admin/skin_options.php?show_options=1&skin='.sanitize_flagname($playlist["skin"]).'&TB_iframe=1&width=600&height=560'; ?>"><?php _e('Change Skin Options', '
|
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', '
|
146 |
</td>
|
147 |
</tr>
|
148 |
<tr>
|
149 |
-
<th align="left" valign="middle" scope="row"><?php _e('Title', '
|
150 |
<td align="left" valign="middle"><input type="text" size="50" name="playlist_title" value="<?php echo esc_html($playlist['title']); ?>" /></td>
|
151 |
</tr>
|
152 |
<tr>
|
153 |
-
<th align="left" valign="top" scope="row"><?php _e('Description', '
|
154 |
<td align="left" valign="top"><textarea name="playlist_descr" cols="60" rows="2" style="width: 95%" ><?php echo esc_html($playlist['description']); ?></textarea></td>
|
155 |
</tr>
|
156 |
<!--<tr>
|
157 |
-
<th align="left" valign="top" scope="row"><?php _e('Path', '
|
158 |
<td align="left" colspan="2" valign="top"><?php echo $playlistPath; ?></td>
|
159 |
</tr>-->
|
160 |
</table>
|
@@ -165,33 +170,33 @@ jQuery(document).ready(function(){
|
|
165 |
</div> <!-- poststuff -->
|
166 |
<div class="tablenav flag-tablenav">
|
167 |
<select id="bulkaction" name="bulkaction" class="alignleft">
|
168 |
-
<option value="no_action" ><?php _e("No action",'
|
169 |
-
<option value="delete_items" ><?php _e("Delete items",'
|
170 |
</select>
|
171 |
-
<input class="button-secondary alignleft" style="margin-right:10px;" type="submit" name="updatePlaylist" value="<?php _e("OK",'
|
172 |
-
<a href="<?php echo wp_nonce_url($filepath."&playlist=".sanitize_flagname($_GET['playlist'])."&mode=sort", 'flag_sort'); ?>" class="button-secondary alignleft" style="margin:1px 10px 0 0;"><?php _e("Sort Playlist",'
|
173 |
-
<a href="#" onClick="jQuery('#form_listitems').submit();return false;" class="button-secondary alignleft" style="margin:1px 10px 0 0;"><?php _e("Add/Remove Items from Playlist",'
|
174 |
-
<input type="submit" name="updatePlaylist" class="button-primary action alignright" value="<?php _e("Update Playlist",'
|
175 |
</div>
|
176 |
|
177 |
<table id="flag-listvideo" class="widefat fixed flag-table" cellspacing="0" >
|
178 |
|
179 |
<thead>
|
180 |
<tr>
|
181 |
-
<th class="cb" width="54" scope="col"><a href="#" onclick="checkAll(document.getElementById('updatePlaylist'));return false;"><?php _e('Check', '
|
182 |
-
<th class="id" width="64" scope="col"><div><?php _e('ID', '
|
183 |
-
<th class="thumb" width="110" scope="col"><div><?php _e('Thumbnail', '
|
184 |
-
<th class="title_filename" scope="col"><div><?php _e('Filename / Title', '
|
185 |
-
<th class="description" scope="col"><div><?php _e('Description', '
|
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', '
|
191 |
-
<th class="id" scope="col"><?php _e('ID', '
|
192 |
-
<th class="thumb" scope="col"><?php _e('Thumbnail', '
|
193 |
-
<th class="title_filename" scope="col"><?php _e('Filename / Title', '
|
194 |
-
<th class="description" scope="col"><?php _e('Description', '
|
195 |
</tr>
|
196 |
</tfoot>
|
197 |
<tbody>
|
@@ -199,18 +204,17 @@ jQuery(document).ready(function(){
|
|
199 |
$counter = 0;
|
200 |
if(count($items_a)) {
|
201 |
$alt = ' class="alternate"';
|
202 |
-
$uploads = wp_upload_dir();
|
203 |
foreach($items_a as $item) {
|
204 |
$ban = get_post($item);
|
205 |
-
|
|
|
|
|
|
|
206 |
$link = get_post_meta($ban->ID, 'link', true);
|
207 |
-
$preview = get_post_meta($ban->ID, 'preview', true);
|
208 |
if(empty($thumb)) {
|
209 |
$thumb = wp_get_attachment_thumb_url($ban->ID);
|
210 |
-
$banthumb = '';
|
211 |
}
|
212 |
$alt = ( empty($alt) ) ? ' class="alternate"' : '';
|
213 |
-
$alt2 = ( empty($alt) ) ? '' : ' alternate';
|
214 |
$counter++;
|
215 |
$url = wp_get_attachment_url($ban->ID);
|
216 |
?>
|
@@ -223,7 +227,7 @@ if(count($items_a)) {
|
|
223 |
<td class="title_filename">
|
224 |
<strong><a href="<?php echo $url; ?>"><?php echo basename($url); ?></a></strong><br />
|
225 |
<textarea title="Title" name="item_a[<?php echo $ban->ID; ?>][post_title]" cols="20" rows="1" style="width:95%; height: 25px; overflow:hidden;"><?php echo esc_html(stripslashes($ban->post_title)); ?></textarea><br />
|
226 |
-
<?php _e('URL', '
|
227 |
</td>
|
228 |
<td class="description">
|
229 |
<textarea name="item_a[<?php echo $ban->ID; ?>][post_content]" style="width:95%; height: 96px; margin-top: 2px; font-size:12px; line-height:115%;" rows="1" ><?php echo esc_html(stripslashes($ban->post_content)); ?></textarea>
|
@@ -235,13 +239,13 @@ if(count($items_a)) {
|
|
235 |
|
236 |
// In the case you have no capaptibility to see the search result
|
237 |
if ( $counter==0 )
|
238 |
-
echo '<tr><td colspan="5" align="center"><strong>'.__('No entries found','
|
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",'
|
245 |
</form>
|
246 |
<form id="form_listitems" name="form_listitems" method="POST" action="<?php echo esc_url($filepath."&playlist=".sanitize_flagname($_GET['playlist'])."&mode=add"); ?>">
|
247 |
<?php wp_nonce_field('flag_add'); ?>
|
2 |
|
3 |
if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You are not allowed to call this page directly.');}
|
4 |
|
5 |
+
function flag_b_playlist_edit($file = '') {
|
6 |
|
7 |
$filepath = admin_url() . 'admin.php?page=' . urlencode($_GET['page']);
|
8 |
$all_playlists = get_b_playlists();
|
39 |
var numchecked = getNumChecked(document.getElementById('updatePlaylist'));
|
40 |
|
41 |
if(numchecked < 1) {
|
42 |
+
alert('<?php echo esc_js(__("No items selected", "flash-album-gallery")); ?>');
|
43 |
return false;
|
44 |
}
|
45 |
|
47 |
|
48 |
switch (actionId) {
|
49 |
case "delete_items":
|
50 |
+
return confirm('<?php echo sprintf(esc_js(__("You are about to delete %s item(s) \n \n 'Cancel' to stop, 'OK' to proceed.",'flash-album-gallery')), "' + numchecked + '") ; ?>');
|
51 |
break;
|
52 |
}
|
53 |
|
54 |
+
return confirm('<?php echo sprintf(esc_js(__("You are about to start the bulk edit for %s item(s) \n \n 'Cancel' to stop, 'OK' to proceed.",'flash-album-gallery')), "' + numchecked + '") ; ?>');
|
55 |
}
|
56 |
|
57 |
function showDialog( windowId, height ) {
|
97 |
</script>
|
98 |
|
99 |
<div class="flag-wrap">
|
100 |
+
<h2><?php _e( 'Playlist', 'flash-album-gallery' ); ?>: <?php echo esc_html($playlist['title']); ?></h2>
|
101 |
<div style="float: right; margin: -20px 3px 0 0;">
|
102 |
+
<span><a href="<?php echo $filepath; ?>"><?php _e('Back to Banner Box', 'flash-album-gallery'); ?></a> </span>
|
103 |
<select name="select_playlist" onchange="window.location.href=this.options[this.selectedIndex].value">
|
104 |
+
<option selected="selected"><?php _e('Choose another playlist', 'flash-album-gallery'); ?></option>
|
105 |
<?php
|
106 |
foreach((array)$all_playlists as $playlist_file => $playlist_data) {
|
107 |
$playlist_name = basename($playlist_file, '.xml');
|
120 |
<div id="poststuff" class="metabox-holder">
|
121 |
<div id="post-body"><div id="post-body-content"><div id="normal-sortables" style="position: relative;">
|
122 |
<div id="flagalleryset" class="postbox" >
|
123 |
+
<h3 class="hndle"><span><?php _e('Playlist settings', 'flash-album-gallery'); ?></span></h3>
|
124 |
<div class="inside">
|
125 |
<table cellspacing="8" cellpadding="0" border="0">
|
126 |
<tr>
|
127 |
+
<th align="left" valign="middle" scope="row"><?php _e('Shortcode', 'flash-album-gallery'); ?>:</th>
|
128 |
<td align="left" valign="middle"><input type="text" readonly="readonly" size="50" onfocus="this.select()" value="[grandbanner xml=<?php echo sanitize_flagname($_GET['playlist']); ?>]" /></td>
|
129 |
+
<td rowspan="3" align="left" valign="top"><div><strong style="display: inline-block; width: 100px;"><?php _e("Playlist Skin", 'flash-album-gallery'); ?>:</strong>
|
130 |
<input id="skinaction" type="hidden" name="skinaction" value="<?php echo sanitize_flagname($playlist['skin']); ?>" />
|
131 |
<select id="skinname" name="skinname" style="width: 200px; height: 24px; font-size: 11px;">
|
132 |
<?php require_once (dirname(__FILE__) . '/get_skin.php');
|
133 |
$all_skins = get_skins($skin_folder='', $type='b');
|
134 |
+
$current_skin_title = __('No Skin', 'flash-album-gallery');
|
135 |
if(count($all_skins)) {
|
136 |
foreach ( (array)$all_skins as $skin_file => $skin_data) {
|
137 |
+
$cur = '';
|
138 |
+
if($playlist['skin'] == dirname($skin_file)){
|
139 |
+
$cur = ' selected="selected"';
|
140 |
+
$current_skin_title = $skin_data['Name'];
|
141 |
+
}
|
142 |
echo '<option'.$cur.' value="'.dirname($skin_file).'">'.$skin_data['Name'].'</option>'."\n";
|
143 |
}
|
144 |
} else {
|
145 |
+
echo '<option value="nivoslider">'.__("No Skins", "flash-album-gallery").'</option>';
|
146 |
}
|
147 |
?>
|
148 |
+
</select> <a id="skinOptions" class="thickbox" title="<?php echo esc_attr($current_skin_title); ?>" href="<?php echo FLAG_URLPATH.'admin/skin_options.php?show_options=1&skin='.sanitize_flagname($playlist["skin"]).'&TB_iframe=1&width=600&height=560'; ?>"><?php _e('Change Skin Options', 'flash-album-gallery' ); ?></a>
|
149 |
</div>
|
150 |
+
<p style="margin:10px 0 0 100px;"><input type="submit" id="updatePlaylistSkin" name="updatePlaylistSkin" class="button-primary action" value="<?php _e('Update skin options for this playlist', 'flash-album-gallery'); ?>" /></p>
|
151 |
</td>
|
152 |
</tr>
|
153 |
<tr>
|
154 |
+
<th align="left" valign="middle" scope="row"><?php _e('Title', 'flash-album-gallery'); ?>:</th>
|
155 |
<td align="left" valign="middle"><input type="text" size="50" name="playlist_title" value="<?php echo esc_html($playlist['title']); ?>" /></td>
|
156 |
</tr>
|
157 |
<tr>
|
158 |
+
<th align="left" valign="top" scope="row"><?php _e('Description', 'flash-album-gallery'); ?>:</th>
|
159 |
<td align="left" valign="top"><textarea name="playlist_descr" cols="60" rows="2" style="width: 95%" ><?php echo esc_html($playlist['description']); ?></textarea></td>
|
160 |
</tr>
|
161 |
<!--<tr>
|
162 |
+
<th align="left" valign="top" scope="row"><?php _e('Path', 'flash-album-gallery'); ?>:</th>
|
163 |
<td align="left" colspan="2" valign="top"><?php echo $playlistPath; ?></td>
|
164 |
</tr>-->
|
165 |
</table>
|
170 |
</div> <!-- poststuff -->
|
171 |
<div class="tablenav flag-tablenav">
|
172 |
<select id="bulkaction" name="bulkaction" class="alignleft">
|
173 |
+
<option value="no_action" ><?php _e("No action",'flash-album-gallery')?></option>
|
174 |
+
<option value="delete_items" ><?php _e("Delete items",'flash-album-gallery')?></option>
|
175 |
</select>
|
176 |
+
<input class="button-secondary alignleft" style="margin-right:10px;" type="submit" name="updatePlaylist" value="<?php _e("OK",'flash-album-gallery')?>" onclick="if ( !checkSelected() ) return false;" />
|
177 |
+
<a href="<?php echo wp_nonce_url($filepath."&playlist=".sanitize_flagname($_GET['playlist'])."&mode=sort", 'flag_sort'); ?>" class="button-secondary alignleft" style="margin:1px 10px 0 0;"><?php _e("Sort Playlist",'flash-album-gallery')?></a>
|
178 |
+
<a href="#" onClick="jQuery('#form_listitems').submit();return false;" class="button-secondary alignleft" style="margin:1px 10px 0 0;"><?php _e("Add/Remove Items from Playlist",'flash-album-gallery')?></a>
|
179 |
+
<input type="submit" name="updatePlaylist" class="button-primary action alignright" value="<?php _e("Update Playlist",'flash-album-gallery')?>" />
|
180 |
</div>
|
181 |
|
182 |
<table id="flag-listvideo" class="widefat fixed flag-table" cellspacing="0" >
|
183 |
|
184 |
<thead>
|
185 |
<tr>
|
186 |
+
<th class="cb" width="54" scope="col"><a href="#" onclick="checkAll(document.getElementById('updatePlaylist'));return false;"><?php _e('Check', 'flash-album-gallery'); ?></a></th>
|
187 |
+
<th class="id" width="64" scope="col"><div><?php _e('ID', 'flash-album-gallery'); ?></div></th>
|
188 |
+
<th class="thumb" width="110" scope="col"><div><?php _e('Thumbnail', 'flash-album-gallery'); ?></div></th>
|
189 |
+
<th class="title_filename" scope="col"><div><?php _e('Filename / Title', 'flash-album-gallery'); ?></div></th>
|
190 |
+
<th class="description" scope="col"><div><?php _e('Description', 'flash-album-gallery'); ?></div></th>
|
191 |
</tr>
|
192 |
</thead>
|
193 |
<tfoot>
|
194 |
<tr>
|
195 |
+
<th class="cb" scope="col"><a href="#" onclick="checkAll(document.getElementById('updatePlaylist'));return false;"><?php _e('Check', 'flash-album-gallery'); ?></a></th>
|
196 |
+
<th class="id" scope="col"><?php _e('ID', 'flash-album-gallery'); ?></th>
|
197 |
+
<th class="thumb" scope="col"><?php _e('Thumbnail', 'flash-album-gallery'); ?></th>
|
198 |
+
<th class="title_filename" scope="col"><?php _e('Filename / Title', 'flash-album-gallery'); ?></th>
|
199 |
+
<th class="description" scope="col"><?php _e('Description', 'flash-album-gallery'); ?></th>
|
200 |
</tr>
|
201 |
</tfoot>
|
202 |
<tbody>
|
204 |
$counter = 0;
|
205 |
if(count($items_a)) {
|
206 |
$alt = ' class="alternate"';
|
|
|
207 |
foreach($items_a as $item) {
|
208 |
$ban = get_post($item);
|
209 |
+
if(!$ban){
|
210 |
+
continue;
|
211 |
+
}
|
212 |
+
$thumb = get_post_meta($item, 'thumbnail', true);
|
213 |
$link = get_post_meta($ban->ID, 'link', true);
|
|
|
214 |
if(empty($thumb)) {
|
215 |
$thumb = wp_get_attachment_thumb_url($ban->ID);
|
|
|
216 |
}
|
217 |
$alt = ( empty($alt) ) ? ' class="alternate"' : '';
|
|
|
218 |
$counter++;
|
219 |
$url = wp_get_attachment_url($ban->ID);
|
220 |
?>
|
227 |
<td class="title_filename">
|
228 |
<strong><a href="<?php echo $url; ?>"><?php echo basename($url); ?></a></strong><br />
|
229 |
<textarea title="Title" name="item_a[<?php echo $ban->ID; ?>][post_title]" cols="20" rows="1" style="width:95%; height: 25px; overflow:hidden;"><?php echo esc_html(stripslashes($ban->post_title)); ?></textarea><br />
|
230 |
+
<?php _e('URL', 'flash-album-gallery'); ?>: <input id="banlink-<?php echo $ban->ID; ?>" name="item_a[<?php echo $ban->ID; ?>][link]" style="width:50%;" type="text" value="<?php echo esc_url($link); ?>" /><br />
|
231 |
</td>
|
232 |
<td class="description">
|
233 |
<textarea name="item_a[<?php echo $ban->ID; ?>][post_content]" style="width:95%; height: 96px; margin-top: 2px; font-size:12px; line-height:115%;" rows="1" ><?php echo esc_html(stripslashes($ban->post_content)); ?></textarea>
|
239 |
|
240 |
// In the case you have no capaptibility to see the search result
|
241 |
if ( $counter==0 )
|
242 |
+
echo '<tr><td colspan="5" align="center"><strong>'.__('No entries found','flash-album-gallery').'</strong></td></tr>';
|
243 |
|
244 |
?>
|
245 |
|
246 |
</tbody>
|
247 |
</table>
|
248 |
+
<p class="submit" style="text-align: right;"><input type="submit" class="button-primary action" name="updatePlaylist" value="<?php _e("Update Playlist",'flash-album-gallery')?>" /></p>
|
249 |
</form>
|
250 |
<form id="form_listitems" name="form_listitems" method="POST" action="<?php echo esc_url($filepath."&playlist=".sanitize_flagname($_GET['playlist'])."&mode=add"); ?>">
|
251 |
<?php wp_nonce_field('flag_add'); ?>
|
admin/manage-galleries.php
CHANGED
@@ -1,376 +1,420 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF']))
|
|
|
|
|
4 |
|
5 |
// *** show main gallery list
|
6 |
-
function flag_manage_gallery_main()
|
7 |
|
8 |
-
|
9 |
-
|
10 |
-
//Build the pagination for more than 25 galleries
|
11 |
-
if ( ! isset( $_GET['paged'] ) || $_GET['paged'] < 1 )
|
12 |
-
$_GET['paged'] = 1;
|
13 |
|
14 |
-
|
15 |
-
|
16 |
-
|
|
|
17 |
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
$gallerylist = $flagdb->find_all_galleries($sort_gall_by, $sort_gall_dir, $counter = true, $perpage, $start, $exclude = false, $draft = true);
|
22 |
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
'next_text' => __('»'),
|
28 |
-
'total' => $flagdb->paged['max_objects_per_page'],
|
29 |
-
'current' => $_GET['paged']
|
30 |
-
));
|
31 |
-
|
32 |
-
?>
|
33 |
-
<script type="text/javascript">
|
34 |
-
<!--
|
35 |
-
function checkAll(form)
|
36 |
-
{
|
37 |
-
for (i = 0, n = form.elements.length; i < n; i++) {
|
38 |
-
if(form.elements[i].type == "checkbox") {
|
39 |
-
if(form.elements[i].name == "doaction[]") {
|
40 |
-
if(form.elements[i].checked == true)
|
41 |
-
form.elements[i].checked = false;
|
42 |
-
else
|
43 |
-
form.elements[i].checked = true;
|
44 |
-
}
|
45 |
-
}
|
46 |
-
}
|
47 |
-
}
|
48 |
-
|
49 |
-
function getNumChecked(form)
|
50 |
-
{
|
51 |
-
var num = 0;
|
52 |
-
for (i = 0, n = form.elements.length; i < n; i++) {
|
53 |
-
if(form.elements[i].type == "checkbox") {
|
54 |
-
if(form.elements[i].name == "doaction[]")
|
55 |
-
if(form.elements[i].checked == true)
|
56 |
-
num++;
|
57 |
-
}
|
58 |
-
}
|
59 |
-
return num;
|
60 |
-
}
|
61 |
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
actionId = jQuery('#bulkaction').val();
|
73 |
-
|
74 |
-
switch (actionId) {
|
75 |
-
case "resize_images":
|
76 |
-
showDialog('resize_images', 120);
|
77 |
-
return false;
|
78 |
-
break;
|
79 |
-
case "new_thumbnail":
|
80 |
-
showDialog('new_thumbnail', 160);
|
81 |
-
return false;
|
82 |
-
break;
|
83 |
-
}
|
84 |
-
|
85 |
-
return confirm('<?php echo sprintf(esc_js(__("You are about to start the bulk edit for %s galleries \n \n 'Cancel' to stop, 'OK' to proceed.",'flag')), "' + numchecked + '") ; ?>');
|
86 |
-
}
|
87 |
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
// console.log (jQuery("#TB_imagelist").val());
|
104 |
-
tb_show("", "#TB_inline?width=640&height=" + height + "&inlineId=" + windowId + "&modal=true", false);
|
105 |
-
}
|
106 |
-
|
107 |
-
//-->
|
108 |
-
</script>
|
109 |
-
<div class="flag-wrap" style="margin-top:40px;">
|
110 |
-
<h2><?php _e('Gallery Overview', 'flag'); ?></h2>
|
111 |
-
<form class="search-form" action="" method="get">
|
112 |
-
<p class="search-box">
|
113 |
-
<label class="hidden" for="media-search-input"><?php _e( 'Search Images', 'flag' ); ?>:</label>
|
114 |
-
<input type="hidden" id="page-name" name="page" value="flag-manage-gallery" />
|
115 |
-
<input type="text" id="media-search-input" name="s" value="<?php the_search_query(); ?>" />
|
116 |
-
<input type="submit" value="<?php _e( 'Search Images', 'flag' ); ?>" class="button" />
|
117 |
-
</p>
|
118 |
-
</form>
|
119 |
-
<form id="editgalleries" class="flagform" method="POST" action="<?php echo $flag->manage_page->base_page . '&paged=' . $_GET['paged']; ?>" accept-charset="utf-8">
|
120 |
-
<?php wp_nonce_field('flag_bulkgallery'); ?>
|
121 |
-
<input type="hidden" name="page" value="manage-galleries" />
|
122 |
-
|
123 |
-
<div class="tablenav">
|
124 |
-
|
125 |
-
<div class="alignleft actions">
|
126 |
-
<?php if ( function_exists('json_encode') ) : ?>
|
127 |
-
<select name="bulkaction" id="bulkaction">
|
128 |
-
<option value="no_action" ><?php _e("No action",'flag'); ?></option>
|
129 |
-
<option value="webview_images" ><?php _e("Create images optimized for web",'flag'); ?></option>
|
130 |
-
<option value="new_thumbnail" ><?php _e("Create new thumbnails",'flag'); ?></option>
|
131 |
-
<option value="resize_images" ><?php _e("Resize images",'flag'); ?></option>
|
132 |
-
<option value="import_meta" ><?php _e("Import metadata",'flag'); ?></option>
|
133 |
-
<option value="copy_meta" ><?php _e("Metadata to description",'flag'); ?></option>
|
134 |
-
<?php do_action('flag_manage_galleries_bulkaction'); ?>
|
135 |
-
</select>
|
136 |
-
<input name="showThickbox" class="button-secondary" type="submit" value="<?php _e('Apply','flag'); ?>" onclick="if ( !checkSelected() ) return false;" />
|
137 |
-
<?php endif; ?>
|
138 |
-
</div>
|
139 |
-
|
140 |
-
<?php if ( $page_links ) : ?>
|
141 |
-
<div class="tablenav-pages"><?php $page_links_text = sprintf( '<span class="displaying-num">' . __( 'Displaying %s–%s of %s' ) . '</span>%s',
|
142 |
-
number_format_i18n( ( $_GET['paged'] - 1 ) * $perpage + 1 ),
|
143 |
-
number_format_i18n( min( $_GET['paged'] * $perpage, $flagdb->paged['total_objects'] ) ),
|
144 |
-
number_format_i18n( $flagdb->paged['total_objects'] ),
|
145 |
-
$page_links
|
146 |
-
); echo $page_links_text; ?></div>
|
147 |
-
<br class="clear" />
|
148 |
-
<?php endif; ?>
|
149 |
-
|
150 |
-
</div>
|
151 |
-
<table class="widefat flag-table" cellspacing="0">
|
152 |
-
<thead>
|
153 |
-
<tr>
|
154 |
-
<th scope="col" class="cb column-cb" >
|
155 |
-
<input type="checkbox" onclick="checkAll(document.getElementById('editgalleries'));" name="checkall"/>
|
156 |
-
</th>
|
157 |
-
<th scope="col"><a href="<?php echo $flag->manage_page->base_page . "&galsort=gid&sortdir={$ascdesc}&paged=" . $_GET['paged']; ?>"><?php _e('ID'); ?></a></th>
|
158 |
-
<th scope="col"><a href="<?php echo $flag->manage_page->base_page . "&galsort=title&sortdir={$ascdesc}&paged=" . $_GET['paged']; ?>"><?php _e('Title', 'flag'); ?></a></th>
|
159 |
-
<th scope="col"><?php _e('Description', 'flag'); ?></th>
|
160 |
-
<th scope="col"><?php _e('Author', 'flag'); ?></th>
|
161 |
-
<th scope="col"><?php _e('Quantity', 'flag'); ?></th>
|
162 |
-
<th scope="col"><?php _e('Action', 'flag'); ?></th>
|
163 |
-
</tr>
|
164 |
-
</thead>
|
165 |
-
<tbody>
|
166 |
-
<?php
|
167 |
-
if($gallerylist) {
|
168 |
-
foreach($gallerylist as $gallery) {
|
169 |
-
$class = ( !isset($class) || $class == 'alt ' ) ? '' : 'alt ';
|
170 |
-
$gid = $gallery->gid;
|
171 |
-
$name = (empty($gallery->title) ) ? $gallery->name : $gallery->title;
|
172 |
-
$author_user = get_userdata( (int) $gallery->author );
|
173 |
-
?>
|
174 |
-
<tr id="gallery-<?php echo $gid; ?>" class="<?php echo $class; echo ( $gallery->status ) ? 'flag_draft' : 'flag_public'; ?>" >
|
175 |
-
<th scope="row" class="cb column-cb">
|
176 |
-
<?php if (flagAdmin::can_manage_this_gallery($gallery->author)) { ?>
|
177 |
-
<input name="doaction[]" type="checkbox" value="<?php echo $gid; ?>" />
|
178 |
-
<?php } ?>
|
179 |
-
</th>
|
180 |
-
<td scope="row"><?php echo $gid; ?></td>
|
181 |
-
<td style="width:30%">
|
182 |
-
<?php if (flagAdmin::can_manage_this_gallery($gallery->author)) { ?>
|
183 |
-
<a href="<?php echo wp_nonce_url( $flag->manage_page->base_page . "&mode=edit&gid=" . $gid, 'flag_editgallery')?>" class='edit' title="<?php _e('Edit'); ?>" >
|
184 |
-
<?php echo esc_html(flagGallery::i18n($name)); ?>
|
185 |
-
</a>
|
186 |
-
<?php } else { ?>
|
187 |
-
<?php echo esc_html(flagGallery::i18n($gallery->title)); ?>
|
188 |
-
<?php }
|
189 |
-
if($gallery->status){ echo ' <b>- '.__('Draft', 'flag').'</b>'; }?>
|
190 |
-
</td>
|
191 |
-
<td style="width:30%"><?php echo esc_html(flagGallery::i18n($gallery->galdesc)); ?> </td>
|
192 |
-
<td><?php echo $author_user->display_name; ?></td>
|
193 |
-
<td><?php echo $gallery->counter; ?></td>
|
194 |
-
<td style="white-space:nowrap;">
|
195 |
-
<?php if (flagAdmin::can_manage_this_gallery($gallery->author)) : ?>
|
196 |
-
<a href="<?php echo wp_nonce_url( $flag->manage_page->base_page . "&mode=delete&gid=" . $gid, 'flag_editgallery')?>" class="delete" onclick="javascript:check=confirm( '<?php _e("Delete this gallery ?",'flag')?>');if(check==false) return false;"><?php _e('Delete','flag'); ?></a>
|
197 |
-
<?php if($gallery->status) { ?>
|
198 |
-
| <a href="<?php echo wp_nonce_url( $flag->manage_page->base_page . "&mode=publish&gid=" . $gid, 'flag_editgallery')?>" class="status" onclick="javascript:check=confirm( '<?php _e("Publish this gallery?",'flag')?>');if(check==false) return false;"><?php _e('Publish','flag'); ?></a>
|
199 |
-
<?php } else { ?>
|
200 |
-
| <a href="<?php echo wp_nonce_url( $flag->manage_page->base_page . "&mode=draft&gid=" . $gid, 'flag_editgallery')?>" class="status" onclick="javascript:check=confirm( '<?php _e("Make this gallery draft?",'flag')?>');if(check==false) return false;"><?php _e('Draft','flag'); ?></a>
|
201 |
-
<?php } ?>
|
202 |
-
<?php endif; ?>
|
203 |
-
</td>
|
204 |
-
</tr>
|
205 |
-
<?php
|
206 |
-
}
|
207 |
-
} else {
|
208 |
-
echo '<tr><td colspan="7" align="center"><strong>'.__('No entries found','flag').'</strong></td></tr>';
|
209 |
-
}
|
210 |
-
?>
|
211 |
-
</tbody>
|
212 |
-
</table>
|
213 |
-
</form>
|
214 |
-
</div>
|
215 |
-
<?php if ( current_user_can('FlAG Manage others gallery') ) { ?>
|
216 |
-
<script type="text/javascript">
|
217 |
-
/*<![CDATA[*/
|
218 |
-
jQuery(document).ready(function(){
|
219 |
-
jQuery(".album_categoties").sortable({ opacity: 0.6, cursor: 'move', connectWith: ".album_categoties", update: function() {}}).disableSelection();
|
220 |
-
jQuery( "#draggable .acat" ).draggable({
|
221 |
-
connectToSortable: ".album_categoties",
|
222 |
-
helper: "clone",
|
223 |
-
revert: "invalid"
|
224 |
-
}).disableSelection();
|
225 |
-
jQuery( ".album_categoties" ).droppable({
|
226 |
-
accept: ".acat",
|
227 |
-
hoverClass: "active",
|
228 |
-
drop: function( event, ui ) {
|
229 |
-
jQuery( this ).find(jQuery(ui.draggable)).addClass( "highlight_new" ).attr("id", "g_"+jQuery(ui.draggable).attr('rel')).removeAttr('style');
|
230 |
-
jQuery( this ).find( "p" ).hide();
|
231 |
-
}
|
232 |
-
});
|
233 |
-
jQuery( ".album_categoties .drop" ).live('click',function(){
|
234 |
-
var acat_parent = jQuery(this).parent().parent();
|
235 |
-
jQuery(this).parent().remove();
|
236 |
-
if(!acat_parent.find('.acat').length){
|
237 |
-
acat_parent.find('p').show();
|
238 |
-
}
|
239 |
-
});
|
240 |
-
jQuery('.flag-ajax-post').click(function(e){
|
241 |
-
var form = jQuery(this).attr('data-form');
|
242 |
-
var edata = jQuery(this).dataset();
|
243 |
-
edata.form = jQuery('#'+form).serialize()+'&'+jQuery(this).parents('.album').find('.album_categoties').sortable("serialize");
|
244 |
-
jQuery.post( ajaxurl, edata,
|
245 |
-
function( response ) {
|
246 |
-
jQuery(e.target).parent().find('.alb_msg').show().html(response).fadeOut(1200);
|
247 |
-
if(jQuery(e.target).hasClass('del')) {
|
248 |
-
jQuery(e.target).parent().parent().parent().remove();
|
249 |
-
}
|
250 |
-
if(response == 'Success'){
|
251 |
-
jQuery(e.target).parents('div.album:first').find('.acat').removeClass('highlight_new');
|
252 |
-
jQuery(e.target).parents('span.album_actions').find('.alb_msg').show().text('OK').fadeOut(1200);
|
253 |
-
}
|
254 |
-
}
|
255 |
-
);
|
256 |
-
return false;
|
257 |
-
});
|
258 |
-
});
|
259 |
-
/*]]>*/
|
260 |
-
</script>
|
261 |
-
<div class="flag-wrap">
|
262 |
-
<h2><?php _e('Albums', 'flag'); ?></h2>
|
263 |
-
<form method="post" style="width: 658px; float: left;" action="<?php echo admin_url('admin.php?page=flag-manage-gallery'); ?>"><?php wp_nonce_field('flag_album'); ?>
|
264 |
-
<p><input type="text" id="album_name" name="album_name" value="" /> <input type="submit" value="<?php _e('Create New Album','flag'); ?>" class="button-primary" /></p></form>
|
265 |
-
<h2><?php _e('Categories', 'flag'); ?></h2>
|
266 |
-
<div class="clear"></div>
|
267 |
-
<div class="floatholder">
|
268 |
-
<div class="albums_table">
|
269 |
-
<?php $albumlist = $flagdb->find_all_albums();
|
270 |
-
$nonce = wp_create_nonce( 'wpMediaLib' );
|
271 |
-
if($albumlist) {
|
272 |
-
foreach($albumlist as $album) {
|
273 |
-
?>
|
274 |
-
<div class="album">
|
275 |
-
<div class="album_name"><span class="albID"><?php echo $album->id; ?>.</span> <form method="post" id="albName_<?php echo $album->id; ?>" name="albName_<?php echo $album->id; ?>"><input type="text" name="album_name" value="<?php echo esc_html($album->name); ?>" /><input type="hidden" name="album_id" value="<?php echo $album->id; ?>" /></form> <span class="album_actions"><span class="alb_msg"></span> <span class="button del flag-ajax-post" data-action="flag_delete_album" data-_ajax_nonce="<?php echo $nonce; ?>" data-post="<?php echo $album->id; ?>"><?php _e('Delete', 'flag'); ?></span> <span class="album_save flag-ajax-post button-primary" data-action="flag_save_album" data-_ajax_nonce="<?php echo $nonce; ?>" data-form="albName_<?php echo $album->id; ?>"><strong><?php _e('Save', 'flag'); ?></strong></span></span></div>
|
276 |
-
<div class="album_categoties">
|
277 |
-
<?php $galids = explode(',',$album->categories);
|
278 |
-
if($album->categories) {
|
279 |
-
foreach($galids as $galid) {
|
280 |
-
$acat = $flagdb->find_gallery($galid);
|
281 |
-
?>
|
282 |
-
|
283 |
-
<div class="acat" id="g_<?php echo $acat->gid; ?>"><?php echo esc_html($acat->title); ?><span class="drop">x</span></div>
|
284 |
-
<?php }
|
285 |
-
} else {
|
286 |
-
echo '<p style="text-align:center; padding: 7px 0; margin: 0;">'.__('Drag&Drop Categories Here','flag').'</p>';
|
287 |
-
}
|
288 |
-
?>
|
289 |
-
</div>
|
290 |
-
</div>
|
291 |
-
<?php }
|
292 |
-
} else {
|
293 |
-
echo '<p style="text-align:center; padding: 20px 0; margin: 0;">'.__('No Albums','flag').'</p>';
|
294 |
-
}
|
295 |
-
?>
|
296 |
-
</div>
|
297 |
-
<div class="all_galleries" id="draggable">
|
298 |
-
<?php
|
299 |
-
if($gallerylist) {
|
300 |
-
foreach($gallerylist as $gallery) {
|
301 |
-
$gid = $gallery->gid;
|
302 |
-
$name = (empty($gallery->title) ) ? $gallery->name : esc_html($gallery->title);
|
303 |
-
$author_user = get_userdata( (int) $gallery->author );
|
304 |
-
if (flagAdmin::can_manage_this_gallery($gallery->author)) {
|
305 |
-
?>
|
306 |
-
<div class="acat" rel="<?php echo $gid; ?>"><?php echo $name; ?><span class="drop">x</span></div>
|
307 |
-
<?php
|
308 |
-
}
|
309 |
-
}
|
310 |
-
}
|
311 |
-
?>
|
312 |
-
</div>
|
313 |
-
</div>
|
314 |
-
</div>
|
315 |
-
<?php } ?>
|
316 |
-
<!-- #resize_images -->
|
317 |
-
<div id="resize_images" style="display: none;" >
|
318 |
-
<form id="form_resize_images" method="POST" accept-charset="utf-8">
|
319 |
-
<?php wp_nonce_field('flag_thickbox_form'); ?>
|
320 |
-
<input type="hidden" id="resize_images_imagelist" name="TB_imagelist" value="" />
|
321 |
-
<input type="hidden" id="resize_images_bulkaction" name="TB_bulkaction" value="" />
|
322 |
-
<input type="hidden" name="page" value="manage-galleries" />
|
323 |
-
<table width="100%" border="0" cellspacing="3" cellpadding="3" >
|
324 |
-
<tr valign="top">
|
325 |
-
<td>
|
326 |
-
<strong><?php _e('Resize Images to', 'flag'); ?>:</strong>
|
327 |
-
</td>
|
328 |
-
<td>
|
329 |
-
<input type="text" size="5" name="imgWidth" value="<?php echo $flag->options['imgWidth']; ?>" /> x <input type="text" size="5" name="imgHeight" value="<?php echo $flag->options['imgHeight']; ?>" />
|
330 |
-
<br /><small><?php _e('Width x height (in pixel). FlAGallery will keep ratio size','flag'); ?></small>
|
331 |
-
</td>
|
332 |
-
</tr>
|
333 |
-
<tr align="right">
|
334 |
-
<td colspan="2" class="submit">
|
335 |
-
<input class="button-primary" type="submit" name="TB_ResizeImages" value="<?php _e('OK', 'flag'); ?>" />
|
336 |
-
|
337 |
-
<input class="button-secondary" type="reset" value=" <?php _e('Cancel', 'flag'); ?> " onclick="tb_remove()"/>
|
338 |
-
</td>
|
339 |
-
</tr>
|
340 |
-
</table>
|
341 |
-
</form>
|
342 |
-
</div>
|
343 |
-
<!-- /#resize_images -->
|
344 |
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
<br /><small><?php _e('These values are maximum values ','flag'); ?></small></td>
|
357 |
-
</tr>
|
358 |
-
<tr valign="top">
|
359 |
-
<th align="left"><?php _e('Set fix dimension','flag'); ?></th>
|
360 |
-
<td><input type="checkbox" name="thumbFix" value="1" <?php checked('1', $flag->options['thumbFix']); ?> />
|
361 |
-
<br /><small><?php _e('Ignore the aspect ratio, no portrait thumbnails','flag'); ?></small></td>
|
362 |
-
</tr>
|
363 |
-
<tr align="right">
|
364 |
-
<td colspan="2" class="submit">
|
365 |
-
<input class="button-primary" type="submit" name="TB_NewThumbnail" value="<?php _e('OK', 'flag'); ?>" />
|
366 |
-
|
367 |
-
<input class="button-secondary" type="reset" value=" <?php _e('Cancel', 'flag'); ?> " onclick="tb_remove()"/>
|
368 |
-
</td>
|
369 |
-
</tr>
|
370 |
-
</table>
|
371 |
-
</form>
|
372 |
-
</div>
|
373 |
-
<!-- /#new_thumbnail -->
|
374 |
|
375 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
376 |
}
|
1 |
<?php
|
2 |
|
3 |
+
if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])){
|
4 |
+
die('You are not allowed to call this page directly.');
|
5 |
+
}
|
6 |
|
7 |
// *** show main gallery list
|
8 |
+
function flag_manage_gallery_main(){
|
9 |
|
10 |
+
global $flag, $flagdb, $wp_query;
|
|
|
|
|
|
|
|
|
11 |
|
12 |
+
//Build the pagination for more than 25 galleries
|
13 |
+
if( !isset($_GET['paged']) || $_GET['paged'] < 1){
|
14 |
+
$_GET['paged'] = 1;
|
15 |
+
}
|
16 |
|
17 |
+
$sort_gall_by = (isset($_GET['galsort']))? $_GET['galsort'] : $flag->options['albSort'];
|
18 |
+
$sort_gall_dir = (isset($_GET['sortdir']))? $_GET['sortdir'] : $flag->options['albSortDir'];
|
19 |
+
$ascdesc = ($sort_gall_dir == 'DESC')? 'ASC' : 'DESC';
|
|
|
20 |
|
21 |
+
$_GET['paged'] = intval($_GET['paged']);
|
22 |
+
$perpage = intval($flag->options['albPerPage'])? intval($flag->options['albPerPage']) : 50;
|
23 |
+
$start = ($_GET['paged'] - 1) * $perpage;
|
24 |
+
$gallerylist = $flagdb->find_all_galleries($sort_gall_by, $sort_gall_dir, $counter = true, $perpage, $start, $exclude = false, $draft = true);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
|
26 |
+
$page_links = paginate_links(array(
|
27 |
+
'base' => add_query_arg('paged', '%#%'),
|
28 |
+
'format' => '',
|
29 |
+
'prev_text' => __('«'),
|
30 |
+
'next_text' => __('»'),
|
31 |
+
'total' => $flagdb->paged['max_objects_per_page'],
|
32 |
+
'current' => $_GET['paged'],
|
33 |
+
)
|
34 |
+
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
|
36 |
+
?>
|
37 |
+
<script type="text/javascript">
|
38 |
+
<!--
|
39 |
+
function checkAll(form){
|
40 |
+
for(i = 0, n = form.elements.length; i < n; i++){
|
41 |
+
if(form.elements[i].type == "checkbox"){
|
42 |
+
if(form.elements[i].name == "doaction[]"){
|
43 |
+
if(form.elements[i].checked == true)
|
44 |
+
form.elements[i].checked = false;
|
45 |
+
else
|
46 |
+
form.elements[i].checked = true;
|
47 |
+
}
|
48 |
+
}
|
49 |
+
}
|
50 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51 |
|
52 |
+
function getNumChecked(form){
|
53 |
+
var num = 0;
|
54 |
+
for(i = 0, n = form.elements.length; i < n; i++){
|
55 |
+
if(form.elements[i].type == "checkbox"){
|
56 |
+
if(form.elements[i].name == "doaction[]")
|
57 |
+
if(form.elements[i].checked == true)
|
58 |
+
num++;
|
59 |
+
}
|
60 |
+
}
|
61 |
+
return num;
|
62 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
63 |
|
64 |
+
// this function check for a the number of selected images, sumbmit false when no one selected
|
65 |
+
function checkSelected(){
|
66 |
+
|
67 |
+
var numchecked = getNumChecked(document.getElementById('editgalleries'));
|
68 |
+
|
69 |
+
if(numchecked < 1){
|
70 |
+
alert('<?php echo esc_js(__('No images selected', 'flash-album-gallery')); ?>');
|
71 |
+
return false;
|
72 |
+
}
|
73 |
+
|
74 |
+
actionId = jQuery('#bulkaction').val();
|
75 |
+
|
76 |
+
switch(actionId){
|
77 |
+
case "resize_images":
|
78 |
+
showDialog('resize_images', 120);
|
79 |
+
return false;
|
80 |
+
break;
|
81 |
+
case "new_thumbnail":
|
82 |
+
showDialog('new_thumbnail', 160);
|
83 |
+
return false;
|
84 |
+
break;
|
85 |
+
}
|
86 |
+
|
87 |
+
return confirm('<?php echo sprintf(esc_js(__("You are about to start the bulk edit for %s galleries \n \n 'Cancel' to stop, 'OK' to proceed.", 'flash-album-gallery')), "' + numchecked + '"); ?>');
|
88 |
+
}
|
89 |
+
|
90 |
+
function showDialog(windowId, height){
|
91 |
+
var form = document.getElementById('editgalleries');
|
92 |
+
var elementlist = "";
|
93 |
+
for(i = 0, n = form.elements.length; i < n; i++){
|
94 |
+
if(form.elements[i].type == "checkbox"){
|
95 |
+
if(form.elements[i].name == "doaction[]")
|
96 |
+
if(form.elements[i].checked == true)
|
97 |
+
if(elementlist == "")
|
98 |
+
elementlist = form.elements[i].value;
|
99 |
+
else
|
100 |
+
elementlist += "," + form.elements[i].value;
|
101 |
+
}
|
102 |
+
}
|
103 |
+
jQuery("#" + windowId + "_bulkaction").val(jQuery("#bulkaction").val());
|
104 |
+
jQuery("#" + windowId + "_imagelist").val(elementlist);
|
105 |
+
// console.log (jQuery("#TB_imagelist").val());
|
106 |
+
tb_show("", "#TB_inline?width=640&height=" + height + "&inlineId=" + windowId + "&modal=true", false);
|
107 |
+
}
|
108 |
+
|
109 |
+
//-->
|
110 |
+
</script>
|
111 |
+
<div class="flag-wrap" style="margin-top:40px;">
|
112 |
+
<h2><?php _e('Gallery Overview', 'flash-album-gallery'); ?></h2>
|
113 |
+
<div class="updated" style="margin:0 0 10px;">
|
114 |
+
<?php
|
115 |
+
_e('Have a problem with blurry thumbnails or the large image doesn\'t loading?
|
116 |
+
<br>Then select gallery(ies) and in Actions dropdown choose "Create new thumbnails" -> click Apply button and set thumbnails size to fit your needs.
|
117 |
+
<br>Note that some skins also have settings for thumbnail\'s display size.', 'flash-album-gallery');
|
118 |
+
?>
|
119 |
+
</div>
|
120 |
+
<form class="search-form" action="" method="get" style="float:right">
|
121 |
+
<p class="search-box">
|
122 |
+
<label class="hidden" for="media-search-input"><?php _e('Search Images', 'flash-album-gallery'); ?>
|
123 |
+
:</label>
|
124 |
+
<input type="hidden" id="page-name" name="page" value="flag-manage-gallery"/>
|
125 |
+
<input type="text" id="media-search-input" name="s" value="<?php the_search_query(); ?>"/>
|
126 |
+
<input type="submit" value="<?php _e('Search Images', 'flash-album-gallery'); ?>" class="button"/>
|
127 |
+
</p>
|
128 |
+
</form>
|
129 |
+
<form id="editgalleries" class="flagform" method="POST" action="<?php echo $flag->manage_page->base_page . '&paged=' . $_GET['paged']; ?>" accept-charset="utf-8">
|
130 |
+
<?php wp_nonce_field('flag_bulkgallery'); ?>
|
131 |
+
<input type="hidden" name="page" value="manage-galleries"/>
|
132 |
+
|
133 |
+
<div class="tablenav" style="clear:none">
|
134 |
+
|
135 |
+
<div class="alignleft actions">
|
136 |
+
<?php if(function_exists('json_encode')) : ?>
|
137 |
+
<select name="bulkaction" id="bulkaction">
|
138 |
+
<option value="no_action"><?php _e("No action", 'flash-album-gallery'); ?></option>
|
139 |
+
<option value="webview_images"><?php _e("Create images optimized for web", 'flash-album-gallery'); ?></option>
|
140 |
+
<option value="new_thumbnail"><?php _e("Create new thumbnails", 'flash-album-gallery'); ?></option>
|
141 |
+
<option value="resize_images"><?php _e("Resize images", 'flash-album-gallery'); ?></option>
|
142 |
+
<option value="import_meta"><?php _e("Import metadata", 'flash-album-gallery'); ?></option>
|
143 |
+
<option value="copy_meta"><?php _e("Metadata to description", 'flash-album-gallery'); ?></option>
|
144 |
+
<?php do_action('flag_manage_galleries_bulkaction'); ?>
|
145 |
+
</select>
|
146 |
+
<input name="showThickbox" class="button-secondary" type="submit" value="<?php _e('Apply', 'flash-album-gallery'); ?>" onclick="if ( !checkSelected() ) return false;"/>
|
147 |
+
<?php endif; ?>
|
148 |
+
</div>
|
149 |
+
|
150 |
+
<?php if($page_links) : ?>
|
151 |
+
<div class="tablenav-pages"><?php $page_links_text = sprintf('<span class="displaying-num">' . __('Displaying %s–%s of %s') . '</span>%s',
|
152 |
+
number_format_i18n(($_GET['paged'] - 1) * $perpage + 1),
|
153 |
+
number_format_i18n(min($_GET['paged'] * $perpage, $flagdb->paged['total_objects'])),
|
154 |
+
number_format_i18n($flagdb->paged['total_objects']),
|
155 |
+
$page_links
|
156 |
+
);
|
157 |
+
echo $page_links_text; ?></div>
|
158 |
+
<br class="clear"/>
|
159 |
+
<?php endif; ?>
|
160 |
+
|
161 |
+
</div>
|
162 |
+
<table class="widefat flag-table" cellspacing="0">
|
163 |
+
<thead>
|
164 |
+
<tr>
|
165 |
+
<th scope="col" class="cb column-cb">
|
166 |
+
<input type="checkbox" onclick="checkAll(document.getElementById('editgalleries'));" name="checkall"/>
|
167 |
+
</th>
|
168 |
+
<th scope="col">
|
169 |
+
<a href="<?php echo $flag->manage_page->base_page . "&galsort=gid&sortdir={$ascdesc}&paged=" . $_GET['paged']; ?>"><?php _e('ID'); ?></a>
|
170 |
+
</th>
|
171 |
+
<th scope="col">
|
172 |
+
<a href="<?php echo $flag->manage_page->base_page . "&galsort=title&sortdir={$ascdesc}&paged=" . $_GET['paged']; ?>"><?php _e('Title', 'flash-album-gallery'); ?></a>
|
173 |
+
</th>
|
174 |
+
<th scope="col"><?php _e('Description', 'flash-album-gallery'); ?></th>
|
175 |
+
<th scope="col"><?php _e('Author', 'flash-album-gallery'); ?></th>
|
176 |
+
<th scope="col"><?php _e('Quantity', 'flash-album-gallery'); ?></th>
|
177 |
+
<th scope="col"><?php _e('Action', 'flash-album-gallery'); ?></th>
|
178 |
+
</tr>
|
179 |
+
</thead>
|
180 |
+
<tbody>
|
181 |
+
<?php
|
182 |
+
if($gallerylist){
|
183 |
+
foreach($gallerylist as $gallery){
|
184 |
+
$class = ( !isset($class) || $class == 'alt ')? '' : 'alt ';
|
185 |
+
$gid = $gallery->gid;
|
186 |
+
$name = (empty($gallery->title))? $gallery->name : $gallery->title;
|
187 |
+
$author_user = get_userdata((int) $gallery->author);
|
188 |
+
?>
|
189 |
+
<tr id="gallery-<?php echo $gid; ?>" class="<?php echo $class;
|
190 |
+
echo ($gallery->status)? 'flag_draft' : 'flag_public'; ?>">
|
191 |
+
<th scope="row" class="cb column-cb">
|
192 |
+
<?php if(flagAdmin::can_manage_this_gallery($gallery->author)){ ?>
|
193 |
+
<input name="doaction[]" type="checkbox" value="<?php echo $gid; ?>"/>
|
194 |
+
<?php } ?>
|
195 |
+
</th>
|
196 |
+
<td scope="row"><?php echo $gid; ?></td>
|
197 |
+
<td style="width:30%">
|
198 |
+
<?php if(flagAdmin::can_manage_this_gallery($gallery->author)){ ?>
|
199 |
+
<a href="<?php echo wp_nonce_url($flag->manage_page->base_page . "&mode=edit&gid=" . $gid, 'flag_editgallery') ?>" class='edit' title="<?php _e('Edit'); ?>">
|
200 |
+
<?php echo esc_html(flagGallery::i18n($name)); ?>
|
201 |
+
</a>
|
202 |
+
<?php } else{ ?>
|
203 |
+
<?php echo esc_html(flagGallery::i18n($gallery->title)); ?>
|
204 |
+
<?php }
|
205 |
+
if($gallery->status){
|
206 |
+
echo ' <b>- ' . __('Draft', 'flash-album-gallery') . '</b>';
|
207 |
+
} ?>
|
208 |
+
</td>
|
209 |
+
<td style="width:30%"><?php echo esc_html(flagGallery::i18n($gallery->galdesc)); ?>
|
210 |
+
</td>
|
211 |
+
<td><?php echo $author_user->display_name; ?></td>
|
212 |
+
<td><?php echo $gallery->counter; ?></td>
|
213 |
+
<td style="white-space:nowrap;">
|
214 |
+
<?php if(flagAdmin::can_manage_this_gallery($gallery->author)) : ?>
|
215 |
+
<a href="<?php echo wp_nonce_url($flag->manage_page->base_page . "&mode=delete&gid=" . $gid, 'flag_editgallery') ?>" class="delete" onclick="javascript:check=confirm( '<?php _e("Delete this gallery ?", 'flash-album-gallery') ?>');if(check==false) return false;"><?php _e('Delete', 'flash-album-gallery'); ?></a>
|
216 |
+
<?php if($gallery->status){ ?>
|
217 |
+
|
|
218 |
+
<a href="<?php echo wp_nonce_url($flag->manage_page->base_page . "&mode=publish&gid=" . $gid, 'flag_editgallery') ?>" class="status" onclick="javascript:check=confirm( '<?php _e("Publish this gallery?", 'flash-album-gallery') ?>');if(check==false) return false;"><?php _e('Publish', 'flash-album-gallery'); ?></a>
|
219 |
+
<?php } else{ ?>
|
220 |
+
|
|
221 |
+
<a href="<?php echo wp_nonce_url($flag->manage_page->base_page . "&mode=draft&gid=" . $gid, 'flag_editgallery') ?>" class="status" onclick="javascript:check=confirm( '<?php _e("Make this gallery draft?", 'flash-album-gallery') ?>');if(check==false) return false;"><?php _e('Draft', 'flash-album-gallery'); ?></a>
|
222 |
+
<?php } ?>
|
223 |
+
<?php endif; ?>
|
224 |
+
</td>
|
225 |
+
</tr>
|
226 |
+
<?php
|
227 |
+
}
|
228 |
+
} else{
|
229 |
+
echo '<tr><td colspan="7" align="center"><strong>' . __('No entries found', 'flash-album-gallery') . '</strong></td></tr>';
|
230 |
+
}
|
231 |
+
?>
|
232 |
+
</tbody>
|
233 |
+
</table>
|
234 |
+
</form>
|
235 |
+
</div>
|
236 |
+
<?php if(current_user_can('FlAG Manage others gallery')){ ?>
|
237 |
+
<script type="text/javascript">
|
238 |
+
/*<![CDATA[*/
|
239 |
+
jQuery(document).ready(function(){
|
240 |
+
jQuery(".album_categoties").sortable({
|
241 |
+
opacity: 0.6,
|
242 |
+
cursor: 'move',
|
243 |
+
connectWith: ".album_categoties",
|
244 |
+
update: function(){}
|
245 |
+
}).disableSelection();
|
246 |
+
jQuery("#draggable .acat").draggable({
|
247 |
+
connectToSortable: ".album_categoties",
|
248 |
+
helper: "clone",
|
249 |
+
revert: "invalid"
|
250 |
+
}).disableSelection();
|
251 |
+
jQuery(".album_categoties").droppable({
|
252 |
+
accept: ".acat",
|
253 |
+
hoverClass: "active",
|
254 |
+
drop: function(event, ui){
|
255 |
+
jQuery(this).find(jQuery(ui.draggable)).addClass("highlight_new").attr("id", "g_" + jQuery(ui.draggable).attr('rel')).removeAttr('style');
|
256 |
+
jQuery(this).find("p").hide();
|
257 |
+
}
|
258 |
+
});
|
259 |
+
jQuery(".album_categoties").on('click', '.drop', function(){
|
260 |
+
var acat_parent = jQuery(this).parent().parent();
|
261 |
+
jQuery(this).parent().remove();
|
262 |
+
if(!acat_parent.find('.acat').length){
|
263 |
+
acat_parent.find('p').show();
|
264 |
+
}
|
265 |
+
});
|
266 |
+
jQuery('.flag-ajax-post').click(function(e){
|
267 |
+
var form = jQuery(this).attr('data-form');
|
268 |
+
var edata = jQuery(this).dataset();
|
269 |
+
edata.form = jQuery('#' + form).serialize() + '&' + jQuery(this).parents('.album').find('.album_categoties').sortable("serialize");
|
270 |
+
jQuery.post(ajaxurl, edata,
|
271 |
+
function(response){
|
272 |
+
jQuery(e.target).parent().find('.alb_msg').show().html(response).fadeOut(1200);
|
273 |
+
if(jQuery(e.target).hasClass('del')){
|
274 |
+
jQuery(e.target).parent().parent().parent().remove();
|
275 |
+
}
|
276 |
+
if(response == 'Success'){
|
277 |
+
jQuery(e.target).parents('div.album:first').find('.acat').removeClass('highlight_new');
|
278 |
+
jQuery(e.target).parents('span.album_actions').find('.alb_msg').show().text('OK').fadeOut(1200);
|
279 |
+
}
|
280 |
+
}
|
281 |
+
);
|
282 |
+
return false;
|
283 |
+
});
|
284 |
+
});
|
285 |
+
/*]]>*/
|
286 |
+
</script>
|
287 |
+
<div class="flag-wrap">
|
288 |
+
<div class="floatholder">
|
289 |
+
<div style="float:left;">
|
290 |
+
<h2 style="float:left; margin:5px 0;"><?php _e('Albums', 'flash-album-gallery'); ?></h2>
|
291 |
+
<form method="post" style="float: right;" action="<?php echo admin_url('admin.php?page=flag-manage-gallery'); ?>"><?php wp_nonce_field('flag_album'); ?>
|
292 |
+
<div><input type="text" id="album_name" name="album_name" value=""/>
|
293 |
+
<input type="submit" value="<?php _e('Create New Album', 'flash-album-gallery'); ?>" class="button-primary"/>
|
294 |
+
</div></form>
|
295 |
+
<div class="clearfix"></div>
|
296 |
+
<div class="albums_table">
|
297 |
+
<?php $albumlist = $flagdb->find_all_albums();
|
298 |
+
$nonce = wp_create_nonce('wpMediaLib');
|
299 |
+
if($albumlist){
|
300 |
+
foreach($albumlist as $album){
|
301 |
+
?>
|
302 |
+
<div class="album">
|
303 |
+
<div class="album_name"><span class="albID"><?php echo $album->id; ?>.</span>
|
304 |
+
<form method="post" id="albName_<?php echo $album->id; ?>" name="albName_<?php echo $album->id; ?>">
|
305 |
+
<input type="text" name="album_name" value="<?php echo esc_html($album->name); ?>"/><input type="hidden" name="album_id" value="<?php echo $album->id; ?>"/>
|
306 |
+
</form>
|
307 |
+
<span class="album_actions"><span class="alb_msg"></span> <span class="button del flag-ajax-post" data-action="flag_delete_album" data-_ajax_nonce="<?php echo $nonce; ?>" data-post="<?php echo $album->id; ?>"><?php _e('Delete', 'flash-album-gallery'); ?></span> <span class="album_save flag-ajax-post button-primary" data-action="flag_save_album" data-_ajax_nonce="<?php echo $nonce; ?>" data-form="albName_<?php echo $album->id; ?>"><strong><?php _e('Save', 'flash-album-gallery'); ?></strong></span></span>
|
308 |
+
</div>
|
309 |
+
<div class="album_categoties">
|
310 |
+
<?php $galids = explode(',', $album->categories);
|
311 |
+
if($album->categories){
|
312 |
+
foreach($galids as $galid){
|
313 |
+
$acat = $flagdb->find_gallery($galid);
|
314 |
+
?>
|
315 |
+
|
316 |
+
<div class="acat" id="g_<?php echo $acat->gid; ?>"><?php echo esc_html($acat->title); ?>
|
317 |
+
<span class="drop">x</span></div>
|
318 |
+
<?php }
|
319 |
+
} else{
|
320 |
+
echo '<p style="text-align:center; padding: 7px 0; margin: 0;">' . __('Drag&Drop Categories Here', 'flash-album-gallery') . '</p>';
|
321 |
+
}
|
322 |
+
?>
|
323 |
+
</div>
|
324 |
+
</div>
|
325 |
+
<?php }
|
326 |
+
} else{
|
327 |
+
echo '<p style="text-align:center; padding: 20px 0; margin: 0;">' . __('No Albums', 'flash-album-gallery') . '</p>';
|
328 |
+
}
|
329 |
+
?>
|
330 |
+
</div>
|
331 |
+
</div>
|
332 |
+
|
333 |
+
<div class="all_galleries">
|
334 |
+
<h2 style="margin:5px 0 12px;"><?php _e('Galleries', 'flash-album-gallery'); ?></h2>
|
335 |
+
<div id="draggable">
|
336 |
+
<?php
|
337 |
+
if($gallerylist){
|
338 |
+
foreach($gallerylist as $gallery){
|
339 |
+
$gid = $gallery->gid;
|
340 |
+
$name = (empty($gallery->title))? $gallery->name : esc_html($gallery->title);
|
341 |
+
$author_user = get_userdata((int) $gallery->author);
|
342 |
+
if(flagAdmin::can_manage_this_gallery($gallery->author)){
|
343 |
+
?>
|
344 |
+
<div class="acat" rel="<?php echo $gid; ?>"><?php echo $name; ?>
|
345 |
+
<span class="drop">x</span></div>
|
346 |
+
<?php
|
347 |
+
}
|
348 |
+
}
|
349 |
+
}
|
350 |
+
?>
|
351 |
+
|
352 |
+
</div>
|
353 |
+
</div>
|
354 |
+
</div>
|
355 |
+
</div>
|
356 |
+
<?php } ?>
|
357 |
+
<!-- #resize_images -->
|
358 |
+
<div id="resize_images" style="display: none;">
|
359 |
+
<form id="form_resize_images" method="POST" accept-charset="utf-8">
|
360 |
+
<?php wp_nonce_field('flag_thickbox_form'); ?>
|
361 |
+
<input type="hidden" id="resize_images_imagelist" name="TB_imagelist" value=""/>
|
362 |
+
<input type="hidden" id="resize_images_bulkaction" name="TB_bulkaction" value=""/>
|
363 |
+
<input type="hidden" name="page" value="manage-galleries"/>
|
364 |
+
<table width="100%" border="0" cellspacing="3" cellpadding="3">
|
365 |
+
<tr valign="top">
|
366 |
+
<td>
|
367 |
+
<strong><?php _e('Resize Images to', 'flash-album-gallery'); ?>:</strong>
|
368 |
+
</td>
|
369 |
+
<td>
|
370 |
+
<input type="text" size="5" name="imgWidth" value="<?php echo $flag->options['imgWidth']; ?>"/>
|
371 |
+
x
|
372 |
+
<input type="text" size="5" name="imgHeight" value="<?php echo $flag->options['imgHeight']; ?>"/>
|
373 |
+
<br/>
|
374 |
+
<small><?php _e('Width x height (in pixel). FlAGallery will keep ratio size', 'flash-album-gallery'); ?></small>
|
375 |
+
</td>
|
376 |
+
</tr>
|
377 |
+
<tr align="right">
|
378 |
+
<td colspan="2" class="submit">
|
379 |
+
<input class="button-primary" type="submit" name="TB_ResizeImages" value="<?php _e('OK', 'flash-album-gallery'); ?>"/>
|
380 |
+
|
381 |
+
<input class="button-secondary" type="reset" value=" <?php _e('Cancel', 'flash-album-gallery'); ?> " onclick="tb_remove()"/>
|
382 |
+
</td>
|
383 |
+
</tr>
|
384 |
+
</table>
|
385 |
+
</form>
|
386 |
+
</div>
|
387 |
+
<!-- /#resize_images -->
|
388 |
+
|
389 |
+
<!-- #new_thumbnail -->
|
390 |
+
<div id="new_thumbnail" style="display: none;">
|
391 |
+
<form id="form_new_thumbnail" method="POST" accept-charset="utf-8">
|
392 |
+
<?php wp_nonce_field('flag_thickbox_form'); ?>
|
393 |
+
<input type="hidden" id="new_thumbnail_imagelist" name="TB_imagelist" value=""/>
|
394 |
+
<input type="hidden" id="new_thumbnail_bulkaction" name="TB_bulkaction" value=""/>
|
395 |
+
<input type="hidden" name="page" value="manage-galleries"/>
|
396 |
+
<table width="100%" border="0" cellspacing="3" cellpadding="3">
|
397 |
+
<tr valign="top">
|
398 |
+
<th align="left"><?php _e('Width x height (in pixel)', 'flash-album-gallery'); ?></th>
|
399 |
+
<td>
|
400 |
+
<input type="number" size="5" maxlength="5" name="thumbWidth" min="300" max="800" value="<?php echo $flag->options['thumbWidth']; ?>"/>
|
401 |
+
x
|
402 |
+
<input type="number" size="5" maxlength="5" min="300" max="800" name="thumbHeight" value="<?php echo $flag->options['thumbHeight']; ?>"/>
|
403 |
+
<br/>
|
404 |
+
<small><?php _e('These values are maximum values ', 'flash-album-gallery'); ?></small>
|
405 |
+
</td>
|
406 |
+
</tr>
|
407 |
+
<tr align="right">
|
408 |
+
<td colspan="2" class="submit">
|
409 |
+
<input class="button-primary" type="submit" name="TB_NewThumbnail" value="<?php _e('OK', 'flash-album-gallery'); ?>"/>
|
410 |
+
|
411 |
+
<input class="button-secondary" type="reset" value=" <?php _e('Cancel', 'flash-album-gallery'); ?> " onclick="tb_remove()"/>
|
412 |
+
</td>
|
413 |
+
</tr>
|
414 |
+
</table>
|
415 |
+
</form>
|
416 |
+
</div>
|
417 |
+
<!-- /#new_thumbnail -->
|
418 |
+
|
419 |
+
<?php
|
420 |
}
|
admin/manage-images.php
CHANGED
@@ -28,13 +28,13 @@ function flag_picturelist() {
|
|
28 |
$gallery = $flagdb->find_gallery($act_gid);
|
29 |
|
30 |
if (!$gallery) {
|
31 |
-
flagGallery::show_error(__('Gallery not found.', '
|
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', '
|
38 |
return;
|
39 |
}
|
40 |
|
@@ -147,7 +147,7 @@ function checkSelected() {
|
|
147 |
var numchecked = getNumChecked(document.getElementById('updategallery'));
|
148 |
|
149 |
if(numchecked < 1) {
|
150 |
-
alert('<?php echo esc_js(__("No images selected", "
|
151 |
return false;
|
152 |
}
|
153 |
|
@@ -169,7 +169,7 @@ function checkSelected() {
|
|
169 |
break;
|
170 |
}
|
171 |
|
172 |
-
return confirm('<?php echo sprintf(esc_js(__("You are about to start the bulk edit for %s images \n \n 'Cancel' to stop, 'OK' to proceed.",'
|
173 |
}
|
174 |
|
175 |
jQuery(document).ready( function() {
|
@@ -184,13 +184,13 @@ jQuery(document).ready( function() {
|
|
184 |
<div class="flag-wrap">
|
185 |
|
186 |
<?php if ($is_search) :?>
|
187 |
-
<h2><?php printf( __('Search results for “%s”', '
|
188 |
<form class="search-form" action="" method="get">
|
189 |
<p class="search-box">
|
190 |
-
<label class="hidden" for="media-search-input"><?php _e( 'Search Images', '
|
191 |
<input type="hidden" id="page-name" name="page" value="flag-manage-gallery" />
|
192 |
<input type="text" id="media-search-input" name="s" value="<?php the_search_query(); ?>" />
|
193 |
-
<input type="submit" value="<?php _e( 'Search Images', '
|
194 |
</p>
|
195 |
</form>
|
196 |
|
@@ -202,9 +202,9 @@ jQuery(document).ready( function() {
|
|
202 |
|
203 |
<?php else :?>
|
204 |
|
205 |
-
<h2><?php echo _n( 'Gallery', 'Galleries', 1, '
|
206 |
<select name="select_gid" style="width:180px; float: right; margin: -20px 3px 0 0;" onchange="window.location.href=this.options[this.selectedIndex].value">
|
207 |
-
<option selected="selected"><?php _e('Choose another gallery', '
|
208 |
<?php
|
209 |
foreach ($gallerylist as $gal) {
|
210 |
if ($gal->gid != $act_gid) {
|
@@ -225,26 +225,26 @@ jQuery(document).ready( function() {
|
|
225 |
<div id="post-body"><div id="post-body-content"><div id="normal-sortables" class="meta-box-sortables ui-sortable" style="position: relative;">
|
226 |
<div id="flagalleryset" class="postbox <?php echo postbox_classes('flagalleryset', 'flag-manage-gallery'); ?>" >
|
227 |
<div class="handlediv" title="Click to toggle"><br/></div>
|
228 |
-
<h3 class="hndle"><span><?php _e('Gallery settings', '
|
229 |
<div class="inside">
|
230 |
<table class="flag-form-table" >
|
231 |
<tr>
|
232 |
-
<th align="right" scope="row"><?php _e('Title', '
|
233 |
<td> </td>
|
234 |
<td align="left"><input type="text" size="50" name="title" value="<?php echo esc_html($gallery->title); ?>" /></td>
|
235 |
</tr>
|
236 |
<tr>
|
237 |
-
<th align="right" valign="top" scope="row"><?php _e('Description', '
|
238 |
<td> </td>
|
239 |
<td align="left"><textarea name="gallerydesc" cols="30" rows="3" style="width: 95%" ><?php echo esc_html($gallery->galdesc); ?></textarea></td>
|
240 |
</tr>
|
241 |
<tr>
|
242 |
-
<th align="right" scope="row"><?php _e('Path', '
|
243 |
<td> </td>
|
244 |
<td align="left"><input <?php if (IS_WPMU) echo 'readonly = "readonly"'; ?> type="text" size="50" name="path" value="<?php echo esc_attr($gallery->path); ?>" /></td>
|
245 |
</tr>
|
246 |
<tr>
|
247 |
-
<th align="right" scope="row"><?php _e('Author', '
|
248 |
<td> </td>
|
249 |
<td align="left">
|
250 |
<?php
|
@@ -254,14 +254,14 @@ jQuery(document).ready( function() {
|
|
254 |
else
|
255 |
echo $act_author_user->display_name;
|
256 |
?>
|
257 |
-
<input type="hidden" name="previewpic" value="<?php if(is_array($picturelist)) echo $
|
258 |
</td>
|
259 |
</tr>
|
260 |
</table>
|
261 |
|
262 |
<div class="submit">
|
263 |
-
<input type="submit" class="button-secondary" name="scanfolder" value="<?php _e("Scan Folder for new images",'
|
264 |
-
<input type="submit" class="button-primary action" name="updatepictures" value="<?php _e("Save Changes",'
|
265 |
</div>
|
266 |
<div class="clear"></div>
|
267 |
</div>
|
@@ -281,27 +281,27 @@ jQuery(document).ready( function() {
|
|
281 |
<?php endif; ?>
|
282 |
<div class="alignleft actions">
|
283 |
<select id="bulkaction" name="bulkaction" class="alignleft">
|
284 |
-
<option value="no_action" ><?php _e("No action",'
|
285 |
-
<option value="webview_images" ><?php _e("Create images optimized for web",'
|
286 |
-
<option value="new_thumbnail" ><?php _e("Create new thumbnails",'
|
287 |
-
<option value="resize_images" ><?php _e("Resize images",'
|
288 |
-
<option value="delete_images" ><?php _e("Delete images",'
|
289 |
-
<option value="import_meta" ><?php _e("Import metadata",'
|
290 |
-
<option value="copy_meta" ><?php _e("Metadata to description",'
|
291 |
-
<option value="copy_to" ><?php _e("Copy to...",'
|
292 |
-
<option value="move_to"><?php _e("Move to...",'
|
293 |
-
<option value="reset_counters"><?php _e("Reset Views & Likes counters", '
|
294 |
<?php do_action('flag_manage_images_bulkaction'); ?>
|
295 |
</select>
|
296 |
-
<input class="button-secondary alignleft" style="margin-right:10px;" type="submit" name="showThickbox" value="<?php _e("OK",'
|
297 |
|
298 |
<?php if (($flag->options['galSort'] == "sortorder") && (!$is_search) ) { ?>
|
299 |
-
<a href="<?php echo wp_nonce_url( $flag->manage_page->base_page . "&mode=sort&gid=" . $act_gid, 'flag_sortgallery')?>" class="button-secondary alignleft" style="margin:1px 10px 0 0;"><?php _e("Sort gallery",'
|
300 |
<?php }
|
301 |
if(current_user_can('FlAG Upload images') && (!$is_search)){ ?>
|
302 |
-
<a href="<?php echo wp_nonce_url( $flag->manage_page->base_page . "&gid=" . $act_gid . "&tabs=1", 'flag_addimages')?>" class="button-secondary alignleft" style="margin:1px 10px 0 0;"><?php _e("Add Images",'
|
303 |
<?php } ?>
|
304 |
-
<input type="submit" name="updatepictures" class="button-primary action alignleft" value="<?php _e("Save Changes",'
|
305 |
</div>
|
306 |
</div>
|
307 |
|
@@ -392,27 +392,27 @@ if($picturelist) {
|
|
392 |
</a></strong>
|
393 |
<br /><?php echo $date; ?>
|
394 |
<?php if ( !empty($picture->meta_data['width']) ) {
|
395 |
-
echo '<br />'.__('Image size: ', '
|
396 |
} else {
|
397 |
$imgpath = WINABSPATH.$picture->path."/".$picture->filename;
|
398 |
$img = @getimagesize($imgpath);
|
399 |
-
if($img) echo '<br />'.__('Image size: ', '
|
400 |
} ?>
|
401 |
<?php if ( !empty($picture->meta_data['thumbnail']) ) {
|
402 |
-
echo '<br />'.__('Thumbnail size: ', '
|
403 |
} ?>
|
404 |
<?php if ( !empty($picture->meta_data['webview']) ) {
|
405 |
-
echo '<br />'.__('Optimized size: ', '
|
406 |
} else {
|
407 |
-
echo '<br />'.__('Optimized size: ', '
|
408 |
} ?>
|
409 |
<p>
|
410 |
<?php
|
411 |
$actions = array();
|
412 |
-
$actions['view'] = '<a class="thickbox" href="' . $picture->imageURL . '" title="' . esc_attr(sprintf(__('View "%s"'), $picture->filename)) . '">' . __('View', '
|
413 |
-
$actions['meta'] = '<a class="thickbox" href="' . FLAG_URLPATH . 'admin/showmeta.php?id=' . $pid . '" title="' . __('Show Meta data','
|
414 |
-
$actions['custom_thumb'] = '<a class="thickbox" href="' . FLAG_URLPATH . 'admin/manage_thumbnail.php?id=' . $pid . '" title="' . __('Customize thumbnail','
|
415 |
-
$actions['delete'] = '<a class="submitdelete" href="' . wp_nonce_url("admin.php?page=flag-manage-gallery&mode=delpic&gid=".$act_gid."&pid=".$pid, 'flag_delpicture'). '" class="delete column-delete" onclick="javascript:check=confirm( \'' . esc_attr(sprintf(__('Delete "%s"' , '
|
416 |
$action_count = count($actions);
|
417 |
$i = 0;
|
418 |
echo '<div class="row-actions">';
|
@@ -453,9 +453,9 @@ if($picturelist) {
|
|
453 |
case 'alt_title_desc' :
|
454 |
?>
|
455 |
<td <?php echo $attributes; ?>>
|
456 |
-
<input name="alttext[<?php echo $pid; ?>]" type="text" style="width:95%; margin-bottom: 2px;" value="<?php echo esc_html(stripslashes($picture->alttext)); ?>" /><br/>
|
457 |
-
<textarea name="description[<?php echo $pid; ?>]" style="width:95%; margin-top: 2px;" rows="2" ><?php echo esc_html(stripslashes($picture->description)); ?></textarea>
|
458 |
-
<input name="link[<?php echo $pid; ?>]" type="text" style="width:95%; margin-bottom: 2px;" value="<?php echo esc_attr(stripslashes($picture->link)); ?>" placeholder="(
|
459 |
</td>
|
460 |
<?php
|
461 |
break;
|
@@ -486,13 +486,13 @@ if($picturelist) {
|
|
486 |
|
487 |
// In the case you have no capaptibility to see the search result
|
488 |
if ( $counter==0 )
|
489 |
-
echo '<tr><td colspan="' . $num_columns . '" align="center"><strong>'.__('No entries found','
|
490 |
|
491 |
?>
|
492 |
|
493 |
</tbody>
|
494 |
</table>
|
495 |
-
<p class="submit"><input type="submit" class="button-primary action" name="updatepictures" value="<?php _e("Save Changes",'
|
496 |
</form>
|
497 |
<br class="clear"/>
|
498 |
</div><!-- /#wrap -->
|
@@ -507,7 +507,7 @@ if ( $counter==0 )
|
|
507 |
<table width="100%" border="0" cellspacing="3" cellpadding="3" >
|
508 |
<tr>
|
509 |
<th>
|
510 |
-
<?php _e('Select the destination gallery:', '
|
511 |
<select name="dest_gid" style="width:90%" >
|
512 |
<?php
|
513 |
foreach ($gallerylist as $gallery) {
|
@@ -523,9 +523,9 @@ if ( $counter==0 )
|
|
523 |
</tr>
|
524 |
<tr align="right">
|
525 |
<td class="submit">
|
526 |
-
<input type="submit" class="button-primary" name="TB_SelectGallery" value="<?php _e("OK",'
|
527 |
|
528 |
-
<input class="button-secondary" type="reset" value="<?php _e("Cancel",'
|
529 |
</td>
|
530 |
</tr>
|
531 |
</table>
|
@@ -543,18 +543,18 @@ if ( $counter==0 )
|
|
543 |
<table width="100%" border="0" cellspacing="3" cellpadding="3" >
|
544 |
<tr valign="top">
|
545 |
<td>
|
546 |
-
<strong><?php _e('Resize Images to', '
|
547 |
</td>
|
548 |
<td>
|
549 |
<input type="text" size="5" name="imgWidth" value="<?php echo $flag->options['imgWidth']; ?>" /> x <input type="text" size="5" name="imgHeight" value="<?php echo $flag->options['imgHeight']; ?>" />
|
550 |
-
<br /><small><?php _e('Width x height (in pixel). Grand Flagallery will keep ratio size','
|
551 |
</td>
|
552 |
</tr>
|
553 |
<tr align="right">
|
554 |
<td colspan="2" class="submit">
|
555 |
-
<input class="button-primary" type="submit" name="TB_ResizeImages" value="<?php _e('OK', '
|
556 |
|
557 |
-
<input class="button-secondary" type="reset" value=" <?php _e('Cancel', '
|
558 |
</td>
|
559 |
</tr>
|
560 |
</table>
|
@@ -571,20 +571,15 @@ if ( $counter==0 )
|
|
571 |
<input type="hidden" name="page" value="manage-images" />
|
572 |
<table width="100%" border="0" cellspacing="3" cellpadding="3" >
|
573 |
<tr valign="top">
|
574 |
-
<th align="left"><?php _e('Width x height (in pixel)','
|
575 |
-
<td><input type="
|
576 |
-
<br /><small><?php _e('These values are maximum values ','
|
577 |
-
</tr>
|
578 |
-
<tr valign="top">
|
579 |
-
<th align="left"><?php _e('Set fix dimension','flag'); ?></th>
|
580 |
-
<td><input type="checkbox" name="thumbFix" value="1" <?php checked('1', $flag->options['thumbFix']); ?> />
|
581 |
-
<br /><small><?php _e('Ignore the aspect ratio, no portrait thumbnails','flag'); ?></small></td>
|
582 |
</tr>
|
583 |
<tr align="right">
|
584 |
<td colspan="2" class="submit">
|
585 |
-
<input class="button-primary" type="submit" name="TB_NewThumbnail" value="<?php _e('OK', '
|
586 |
|
587 |
-
<input class="button-secondary" type="reset" value=" <?php _e('Cancel', '
|
588 |
</td>
|
589 |
</tr>
|
590 |
</table>
|
@@ -608,12 +603,12 @@ function flag_manage_gallery_columns() {
|
|
608 |
|
609 |
$gallery_columns['cb'] = '<input name="checkall" type="checkbox" onclick="checkAll(document.getElementById(\'updategallery\'));" />';
|
610 |
$gallery_columns['id'] = __('ID');
|
611 |
-
$gallery_columns['thumbnail'] = __('Thumbnail', '
|
612 |
-
$gallery_columns['filename'] = __('Filename', '
|
613 |
-
$gallery_columns['views_likes'] = __('Views / Likes', '
|
614 |
-
$gallery_columns['rating'] = __('Rating', '
|
615 |
-
$gallery_columns['alt_title_desc'] = __('Alt & Title Text', '
|
616 |
-
$gallery_columns['exclude'] = '<span title="'.__('Only for logged in users', '
|
617 |
$gallery_columns = apply_filters('flag_manage_images_columns', $gallery_columns);
|
618 |
|
619 |
return $gallery_columns;
|
28 |
$gallery = $flagdb->find_gallery($act_gid);
|
29 |
|
30 |
if (!$gallery) {
|
31 |
+
flagGallery::show_error(__('Gallery not found.', 'flash-album-gallery'));
|
32 |
return;
|
33 |
}
|
34 |
|
35 |
// Check if you have the correct capability
|
36 |
if (!flagAdmin::can_manage_this_gallery($gallery->author)) {
|
37 |
+
flagGallery::show_error(__('Sorry, you have no access here', 'flash-album-gallery'));
|
38 |
return;
|
39 |
}
|
40 |
|
147 |
var numchecked = getNumChecked(document.getElementById('updategallery'));
|
148 |
|
149 |
if(numchecked < 1) {
|
150 |
+
alert('<?php echo esc_js(__("No images selected", "flash-album-gallery")); ?>');
|
151 |
return false;
|
152 |
}
|
153 |
|
169 |
break;
|
170 |
}
|
171 |
|
172 |
+
return confirm('<?php echo sprintf(esc_js(__("You are about to start the bulk edit for %s images \n \n 'Cancel' to stop, 'OK' to proceed.",'flash-album-gallery')), "' + numchecked + '") ; ?>');
|
173 |
}
|
174 |
|
175 |
jQuery(document).ready( function() {
|
184 |
<div class="flag-wrap">
|
185 |
|
186 |
<?php if ($is_search) :?>
|
187 |
+
<h2><?php printf( __('Search results for “%s”', 'flash-album-gallery'), esc_html( stripslashes(get_search_query()) ) ); ?></h2>
|
188 |
<form class="search-form" action="" method="get">
|
189 |
<p class="search-box">
|
190 |
+
<label class="hidden" for="media-search-input"><?php _e( 'Search Images', 'flash-album-gallery' ); ?>:</label>
|
191 |
<input type="hidden" id="page-name" name="page" value="flag-manage-gallery" />
|
192 |
<input type="text" id="media-search-input" name="s" value="<?php the_search_query(); ?>" />
|
193 |
+
<input type="submit" value="<?php _e( 'Search Images', 'flash-album-gallery' ); ?>" class="button" />
|
194 |
</p>
|
195 |
</form>
|
196 |
|
202 |
|
203 |
<?php else :?>
|
204 |
|
205 |
+
<h2><?php echo _n( 'Gallery', 'Galleries', 1, 'flash-album-gallery' ); ?> : <?php echo esc_html($gallery->title); ?></h2>
|
206 |
<select name="select_gid" style="width:180px; float: right; margin: -20px 3px 0 0;" onchange="window.location.href=this.options[this.selectedIndex].value">
|
207 |
+
<option selected="selected"><?php _e('Choose another gallery', 'flash-album-gallery'); ?></option>
|
208 |
<?php
|
209 |
foreach ($gallerylist as $gal) {
|
210 |
if ($gal->gid != $act_gid) {
|
225 |
<div id="post-body"><div id="post-body-content"><div id="normal-sortables" class="meta-box-sortables ui-sortable" style="position: relative;">
|
226 |
<div id="flagalleryset" class="postbox <?php echo postbox_classes('flagalleryset', 'flag-manage-gallery'); ?>" >
|
227 |
<div class="handlediv" title="Click to toggle"><br/></div>
|
228 |
+
<h3 class="hndle"><span><?php _e('Gallery settings', 'flash-album-gallery'); ?></span></h3>
|
229 |
<div class="inside">
|
230 |
<table class="flag-form-table" >
|
231 |
<tr>
|
232 |
+
<th align="right" scope="row"><?php _e('Title', 'flash-album-gallery'); ?>:</th>
|
233 |
<td> </td>
|
234 |
<td align="left"><input type="text" size="50" name="title" value="<?php echo esc_html($gallery->title); ?>" /></td>
|
235 |
</tr>
|
236 |
<tr>
|
237 |
+
<th align="right" valign="top" scope="row"><?php _e('Description', 'flash-album-gallery'); ?>:</th>
|
238 |
<td> </td>
|
239 |
<td align="left"><textarea name="gallerydesc" cols="30" rows="3" style="width: 95%" ><?php echo esc_html($gallery->galdesc); ?></textarea></td>
|
240 |
</tr>
|
241 |
<tr>
|
242 |
+
<th align="right" scope="row"><?php _e('Path', 'flash-album-gallery'); ?>:</th>
|
243 |
<td> </td>
|
244 |
<td align="left"><input <?php if (IS_WPMU) echo 'readonly = "readonly"'; ?> type="text" size="50" name="path" value="<?php echo esc_attr($gallery->path); ?>" /></td>
|
245 |
</tr>
|
246 |
<tr>
|
247 |
+
<th align="right" scope="row"><?php _e('Author', 'flash-album-gallery'); ?>:</th>
|
248 |
<td> </td>
|
249 |
<td align="left">
|
250 |
<?php
|
254 |
else
|
255 |
echo $act_author_user->display_name;
|
256 |
?>
|
257 |
+
<input type="hidden" name="previewpic" value="<?php if(is_array($picturelist) && count($picturelist)) { $pic = reset($picturelist); echo $pic->pid; }; ?>" />
|
258 |
</td>
|
259 |
</tr>
|
260 |
</table>
|
261 |
|
262 |
<div class="submit">
|
263 |
+
<input type="submit" class="button-secondary" name="scanfolder" value="<?php _e("Scan Folder for new images",'flash-album-gallery')?> " />
|
264 |
+
<input type="submit" class="button-primary action" name="updatepictures" value="<?php _e("Save Changes",'flash-album-gallery')?>" />
|
265 |
</div>
|
266 |
<div class="clear"></div>
|
267 |
</div>
|
281 |
<?php endif; ?>
|
282 |
<div class="alignleft actions">
|
283 |
<select id="bulkaction" name="bulkaction" class="alignleft">
|
284 |
+
<option value="no_action" ><?php _e("No action",'flash-album-gallery')?></option>
|
285 |
+
<option value="webview_images" ><?php _e("Create images optimized for web",'flash-album-gallery'); ?></option>
|
286 |
+
<option value="new_thumbnail" ><?php _e("Create new thumbnails",'flash-album-gallery')?></option>
|
287 |
+
<option value="resize_images" ><?php _e("Resize images",'flash-album-gallery')?></option>
|
288 |
+
<option value="delete_images" ><?php _e("Delete images",'flash-album-gallery')?></option>
|
289 |
+
<option value="import_meta" ><?php _e("Import metadata",'flash-album-gallery')?></option>
|
290 |
+
<option value="copy_meta" ><?php _e("Metadata to description",'flash-album-gallery')?></option>
|
291 |
+
<option value="copy_to" ><?php _e("Copy to...",'flash-album-gallery')?></option>
|
292 |
+
<option value="move_to"><?php _e("Move to...",'flash-album-gallery')?></option>
|
293 |
+
<option value="reset_counters"><?php _e("Reset Views & Likes counters", 'flash-album-gallery') ?></option>
|
294 |
<?php do_action('flag_manage_images_bulkaction'); ?>
|
295 |
</select>
|
296 |
+
<input class="button-secondary alignleft" style="margin-right:10px;" type="submit" name="showThickbox" value="<?php _e("OK",'flash-album-gallery')?>" onclick="if ( !checkSelected() ) return false;" />
|
297 |
|
298 |
<?php if (($flag->options['galSort'] == "sortorder") && (!$is_search) ) { ?>
|
299 |
+
<a href="<?php echo wp_nonce_url( $flag->manage_page->base_page . "&mode=sort&gid=" . $act_gid, 'flag_sortgallery')?>" class="button-secondary alignleft" style="margin:1px 10px 0 0;"><?php _e("Sort gallery",'flash-album-gallery')?></a>
|
300 |
<?php }
|
301 |
if(current_user_can('FlAG Upload images') && (!$is_search)){ ?>
|
302 |
+
<a href="<?php echo wp_nonce_url( $flag->manage_page->base_page . "&gid=" . $act_gid . "&tabs=1", 'flag_addimages')?>" class="button-secondary alignleft" style="margin:1px 10px 0 0;"><?php _e("Add Images",'flash-album-gallery')?></a>
|
303 |
<?php } ?>
|
304 |
+
<input type="submit" name="updatepictures" class="button-primary action alignleft" value="<?php _e("Save Changes",'flash-album-gallery')?>" />
|
305 |
</div>
|
306 |
</div>
|
307 |
|
392 |
</a></strong>
|
393 |
<br /><?php echo $date; ?>
|
394 |
<?php if ( !empty($picture->meta_data['width']) ) {
|
395 |
+
echo '<br />'.__('Image size: ', 'flash-album-gallery').$picture->meta_data['width'].'x'.$picture->meta_data['height'];
|
396 |
} else {
|
397 |
$imgpath = WINABSPATH.$picture->path."/".$picture->filename;
|
398 |
$img = @getimagesize($imgpath);
|
399 |
+
if($img) echo '<br />'.__('Image size: ', 'flash-album-gallery').$img[0].'x'.$img[1];
|
400 |
} ?>
|
401 |
<?php if ( !empty($picture->meta_data['thumbnail']) ) {
|
402 |
+
echo '<br />'.__('Thumbnail size: ', 'flash-album-gallery').$picture->meta_data['thumbnail']['width'].'x'.$picture->meta_data['thumbnail']['height'];
|
403 |
} ?>
|
404 |
<?php if ( !empty($picture->meta_data['webview']) ) {
|
405 |
+
echo '<br />'.__('Optimized size: ', 'flash-album-gallery').$picture->meta_data['webview'][0].'x'.$picture->meta_data['webview'][1];
|
406 |
} else {
|
407 |
+
echo '<br />'.__('Optimized size: ', 'flash-album-gallery').__('not optimized ', 'flash-album-gallery');
|
408 |
} ?>
|
409 |
<p>
|
410 |
<?php
|
411 |
$actions = array();
|
412 |
+
$actions['view'] = '<a class="thickbox" href="' . $picture->imageURL . '" title="' . esc_attr(sprintf(__('View "%s"'), $picture->filename)) . '">' . __('View', 'flash-album-gallery') . '</a>';
|
413 |
+
$actions['meta'] = '<a class="thickbox" href="' . FLAG_URLPATH . 'admin/showmeta.php?id=' . $pid . '" title="' . __('Show Meta data','flash-album-gallery') . '">' . __('Meta', 'flash-album-gallery') . '</a>';
|
414 |
+
$actions['custom_thumb'] = '<a class="thickbox" href="' . FLAG_URLPATH . 'admin/manage_thumbnail.php?id=' . $pid . '" title="' . __('Customize thumbnail','flash-album-gallery') . '">' . __('Edit thumb', 'flash-album-gallery') . '</a>';
|
415 |
+
$actions['delete'] = '<a class="submitdelete" href="' . wp_nonce_url("admin.php?page=flag-manage-gallery&mode=delpic&gid=".$act_gid."&pid=".$pid, 'flag_delpicture'). '" class="delete column-delete" onclick="javascript:check=confirm( \'' . esc_attr(sprintf(__('Delete "%s"' , 'flash-album-gallery'), $picture->filename)). '\');if(check==false) return false;">' . __('Delete','flash-album-gallery') . '</a>';
|
416 |
$action_count = count($actions);
|
417 |
$i = 0;
|
418 |
echo '<div class="row-actions">';
|
453 |
case 'alt_title_desc' :
|
454 |
?>
|
455 |
<td <?php echo $attributes; ?>>
|
456 |
+
<input name="alttext[<?php echo $pid; ?>]" type="text" style="width:95%; margin-bottom: 2px;" value="<?php echo esc_html(stripslashes($picture->alttext)); ?>" placeholder="<?php _e('Alt & Title', 'flash-album-gallery'); ?>" /><br/>
|
457 |
+
<textarea name="description[<?php echo $pid; ?>]" style="width:95%; margin-top: 2px;" rows="2" placeholder="<?php _e('Description', 'flash-album-gallery'); ?>"><?php echo esc_html(stripslashes($picture->description)); ?></textarea>
|
458 |
+
<input name="link[<?php echo $pid; ?>]" type="text" style="width:95%; margin-bottom: 2px;" value="<?php echo esc_attr(stripslashes($picture->link)); ?>" placeholder="<?php _e('Link To (optional)', 'flash-album-gallery'); ?>" /><br/>
|
459 |
</td>
|
460 |
<?php
|
461 |
break;
|
486 |
|
487 |
// In the case you have no capaptibility to see the search result
|
488 |
if ( $counter==0 )
|
489 |
+
echo '<tr><td colspan="' . $num_columns . '" align="center"><strong>'.__('No entries found','flash-album-gallery').'</strong></td></tr>';
|
490 |
|
491 |
?>
|
492 |
|
493 |
</tbody>
|
494 |
</table>
|
495 |
+
<p class="submit"><input type="submit" class="button-primary action" name="updatepictures" value="<?php _e("Save Changes",'flash-album-gallery')?>" /></p>
|
496 |
</form>
|
497 |
<br class="clear"/>
|
498 |
</div><!-- /#wrap -->
|
507 |
<table width="100%" border="0" cellspacing="3" cellpadding="3" >
|
508 |
<tr>
|
509 |
<th>
|
510 |
+
<?php _e('Select the destination gallery:', 'flash-album-gallery'); ?>
|
511 |
<select name="dest_gid" style="width:90%" >
|
512 |
<?php
|
513 |
foreach ($gallerylist as $gallery) {
|
523 |
</tr>
|
524 |
<tr align="right">
|
525 |
<td class="submit">
|
526 |
+
<input type="submit" class="button-primary" name="TB_SelectGallery" value="<?php _e("OK",'flash-album-gallery')?>" />
|
527 |
|
528 |
+
<input class="button-secondary" type="reset" value="<?php _e("Cancel",'flash-album-gallery')?>" onclick="tb_remove()"/>
|
529 |
</td>
|
530 |
</tr>
|
531 |
</table>
|
543 |
<table width="100%" border="0" cellspacing="3" cellpadding="3" >
|
544 |
<tr valign="top">
|
545 |
<td>
|
546 |
+
<strong><?php _e('Resize Images to', 'flash-album-gallery'); ?>:</strong>
|
547 |
</td>
|
548 |
<td>
|
549 |
<input type="text" size="5" name="imgWidth" value="<?php echo $flag->options['imgWidth']; ?>" /> x <input type="text" size="5" name="imgHeight" value="<?php echo $flag->options['imgHeight']; ?>" />
|
550 |
+
<br /><small><?php _e('Width x height (in pixel). Grand Flagallery will keep ratio size','flash-album-gallery'); ?></small>
|
551 |
</td>
|
552 |
</tr>
|
553 |
<tr align="right">
|
554 |
<td colspan="2" class="submit">
|
555 |
+
<input class="button-primary" type="submit" name="TB_ResizeImages" value="<?php _e('OK', 'flash-album-gallery'); ?>" />
|
556 |
|
557 |
+
<input class="button-secondary" type="reset" value=" <?php _e('Cancel', 'flash-album-gallery'); ?> " onclick="tb_remove()"/>
|
558 |
</td>
|
559 |
</tr>
|
560 |
</table>
|
571 |
<input type="hidden" name="page" value="manage-images" />
|
572 |
<table width="100%" border="0" cellspacing="3" cellpadding="3" >
|
573 |
<tr valign="top">
|
574 |
+
<th align="left"><?php _e('Width x height (in pixel)','flash-album-gallery'); ?></th>
|
575 |
+
<td><input type="number" size="5" maxlength="5" min="300" max="800" name="thumbWidth" value="<?php echo $flag->options['thumbWidth']; ?>" /> x <input type="number" size="5" maxlength="5" min="300" max="800" name="thumbHeight" value="<?php echo $flag->options['thumbHeight']; ?>" />
|
576 |
+
<br /><small><?php _e('These values are maximum values ','flash-album-gallery'); ?></small></td>
|
|
|
|
|
|
|
|
|
|
|
577 |
</tr>
|
578 |
<tr align="right">
|
579 |
<td colspan="2" class="submit">
|
580 |
+
<input class="button-primary" type="submit" name="TB_NewThumbnail" value="<?php _e('OK', 'flash-album-gallery'); ?>" />
|
581 |
|
582 |
+
<input class="button-secondary" type="reset" value=" <?php _e('Cancel', 'flash-album-gallery'); ?> " onclick="tb_remove()"/>
|
583 |
</td>
|
584 |
</tr>
|
585 |
</table>
|
603 |
|
604 |
$gallery_columns['cb'] = '<input name="checkall" type="checkbox" onclick="checkAll(document.getElementById(\'updategallery\'));" />';
|
605 |
$gallery_columns['id'] = __('ID');
|
606 |
+
$gallery_columns['thumbnail'] = __('Thumbnail', 'flash-album-gallery');
|
607 |
+
$gallery_columns['filename'] = __('Filename', 'flash-album-gallery');
|
608 |
+
$gallery_columns['views_likes'] = __('Views / Likes', 'flash-album-gallery');
|
609 |
+
$gallery_columns['rating'] = __('Rating', 'flash-album-gallery');
|
610 |
+
$gallery_columns['alt_title_desc'] = __('Alt & Title Text', 'flash-album-gallery') . ' / ' . __('Description', 'flash-album-gallery');// . ' / ' . __('Link', 'flash-album-gallery');
|
611 |
+
$gallery_columns['exclude'] = '<span title="'.__('Only for logged in users', 'flash-album-gallery').'"><img src="'.FLAG_URLPATH.'admin/images/lock.png" alt="member view" /> Private</span>';
|
612 |
$gallery_columns = apply_filters('flag_manage_images_columns', $gallery_columns);
|
613 |
|
614 |
return $gallery_columns;
|
admin/manage-playlist.php
CHANGED
@@ -12,7 +12,7 @@ function flag_playlist_edit() {
|
|
12 |
$items_a = $playlist['items'];
|
13 |
$items = implode(',',$playlist['items']);
|
14 |
?>
|
15 |
-
<script type="text/javascript">
|
16 |
//<![CDATA[
|
17 |
function checkAll(form)
|
18 |
{
|
@@ -37,21 +37,21 @@ function getNumChecked(form)
|
|
37 |
function checkSelected() {
|
38 |
|
39 |
var numchecked = getNumChecked(document.getElementById('updatePlaylist'));
|
40 |
-
|
41 |
-
if(numchecked < 1) {
|
42 |
-
alert('<?php echo esc_js(__("No items selected", "
|
43 |
-
return false;
|
44 |
-
}
|
45 |
-
|
46 |
actionId = jQuery('#bulkaction').val();
|
47 |
-
|
48 |
switch (actionId) {
|
49 |
case "delete_items":
|
50 |
-
return confirm('<?php echo sprintf(esc_js(__("You are about to delete %s item(s) \n \n 'Cancel' to stop, 'OK' to proceed.",'
|
51 |
-
break;
|
52 |
}
|
53 |
-
|
54 |
-
return confirm('<?php echo sprintf(esc_js(__("You are about to start the bulk edit for %s item(s) \n \n 'Cancel' to stop, 'OK' to proceed.",'
|
55 |
}
|
56 |
|
57 |
function showDialog( windowId, height ) {
|
@@ -95,18 +95,18 @@ jQuery(document).ready(function(){
|
|
95 |
</script>
|
96 |
|
97 |
<div class="flag-wrap">
|
98 |
-
<h2><?php _e( 'Playlist', '
|
99 |
<div style="float: right; margin: -20px 3px 0 0;">
|
100 |
-
<span><a href="<?php echo $filepath; ?>"><?php _e('Back to Music Box', '
|
101 |
<select name="select_playlist" onchange="window.location.href=this.options[this.selectedIndex].value">
|
102 |
-
<option selected="selected"><?php _e('Choose another playlist', '
|
103 |
-
<?php
|
104 |
foreach((array)$all_playlists as $playlist_file => $playlist_data) {
|
105 |
$playlist_name = basename($playlist_file, '.xml');
|
106 |
if ($playlist_file == sanitize_flagname($_GET['playlist'])) continue;
|
107 |
?>
|
108 |
<option value="<?php echo esc_url($filepath."&playlist=".$playlist_name."&mode=edit"); ?>"><?php echo esc_html($playlist_data['title']); ?></option>
|
109 |
-
<?php
|
110 |
}
|
111 |
?>
|
112 |
</select>
|
@@ -118,41 +118,46 @@ jQuery(document).ready(function(){
|
|
118 |
<div id="poststuff" class="metabox-holder">
|
119 |
<div id="post-body"><div id="post-body-content"><div id="normal-sortables" style="position: relative;">
|
120 |
<div id="flagalleryset" class="postbox" >
|
121 |
-
<h3 class="hndle"><span><?php _e('Playlist settings', '
|
122 |
<div class="inside">
|
123 |
<table cellspacing="8" cellpadding="0" border="0">
|
124 |
<tr>
|
125 |
-
<th align="left" valign="middle" scope="row"><?php _e('Shortcode', '
|
126 |
<td align="left" valign="middle"><input type="text" readonly="readonly" size="50" onfocus="this.select()" value="[grandmusic playlist=<?php echo sanitize_flagname($_GET['playlist']); ?>]" /></td>
|
127 |
-
<td rowspan="3" align="left" valign="top"><div><strong style="display: inline-block; width: 100px;"><?php _e("Playlist Skin", '
|
128 |
<input id="skinaction" type="hidden" name="skinaction" value="<?php echo sanitize_flagname($playlist['skin']); ?>" />
|
129 |
<select id="skinname" name="skinname" style="width: 200px; height: 24px; font-size: 11px;">
|
130 |
<?php require_once (dirname(__FILE__) . '/get_skin.php');
|
131 |
$all_skins = get_skins($skin_folder='', $type='m');
|
|
|
132 |
if(count($all_skins)) {
|
133 |
foreach ( (array)$all_skins as $skin_file => $skin_data) {
|
134 |
-
|
|
|
|
|
|
|
|
|
135 |
echo '<option'.$cur.' value="'.dirname($skin_file).'">'.$skin_data['Name'].'</option>'."\n";
|
136 |
}
|
137 |
} else {
|
138 |
-
echo '<option value="music_default">'.__("No Skins", "
|
139 |
}
|
140 |
?>
|
141 |
-
</select> <a id="skinOptions" class="thickbox" href="<?php echo FLAG_URLPATH.'admin/skin_options.php?show_options=1&skin='.sanitize_flagname($playlist['skin']).'&TB_iframe=1&width=600&height=560'; ?>"><?php _e('Change Skin Options', '
|
142 |
</div>
|
143 |
-
<p style="margin:10px 0 0 100px;"><input type="submit" id="updatePlaylistSkin" name="updatePlaylistSkin" class="button-primary action" value="<?php _e('Update skin options for this playlist', '
|
144 |
</td>
|
145 |
</tr>
|
146 |
<tr>
|
147 |
-
<th align="left" valign="middle" scope="row"><?php _e('Title', '
|
148 |
<td align="left" valign="middle"><input type="text" size="50" name="playlist_title" value="<?php echo esc_html($playlist['title']); ?>" /></td>
|
149 |
</tr>
|
150 |
<tr>
|
151 |
-
<th align="left" valign="top" scope="row"><?php _e('Description', '
|
152 |
<td align="left" valign="top"><textarea name="playlist_descr" cols="60" rows="2" style="width: 95%" ><?php echo esc_html($playlist['description']); ?></textarea></td>
|
153 |
</tr>
|
154 |
<!--<tr>
|
155 |
-
<th align="left" valign="top" scope="row"><?php _e('Path', '
|
156 |
<td align="left" colspan="2" valign="top"><?php echo $playlistPath; ?></td>
|
157 |
</tr>-->
|
158 |
</table>
|
@@ -163,35 +168,35 @@ jQuery(document).ready(function(){
|
|
163 |
</div> <!-- poststuff -->
|
164 |
<div class="tablenav flag-tablenav">
|
165 |
<select id="bulkaction" name="bulkaction" class="alignleft">
|
166 |
-
<option value="no_action" ><?php _e("No action",'
|
167 |
-
<option value="delete_items" ><?php _e("Delete items",'
|
168 |
</select>
|
169 |
-
<input class="button-secondary alignleft" style="margin-right:10px;" type="submit" name="updatePlaylist" value="<?php _e("OK",'
|
170 |
-
<a href="<?php echo wp_nonce_url($filepath."&playlist=".sanitize_flagname($_GET['playlist'])."&mode=sort", 'flag_sort'); ?>" class="button-secondary alignleft" style="margin:1px 10px 0 0;"><?php _e("Sort Playlist",'
|
171 |
-
<a href="#" onClick="jQuery('#form_listitems').submit();return false;" class="button-secondary alignleft" style="margin:1px 10px 0 0;"><?php _e("Add/Remove Items from Playlist",'
|
172 |
-
<input type="submit" name="updatePlaylist" class="button-primary action alignright" value="<?php _e("Update Playlist",'
|
173 |
</div>
|
174 |
|
175 |
<table id="flag-listmusic" class="widefat fixed flag-table" cellspacing="0" >
|
176 |
|
177 |
<thead>
|
178 |
<tr>
|
179 |
-
<th class="cb" width="54" scope="col"><a href="#" onclick="checkAll(document.getElementById('updatePlaylist'));return false;"><?php _e('Check', '
|
180 |
-
<th class="id" width="134" scope="col"><div><?php _e('ID', '
|
181 |
-
<th class="size" width="75" scope="col"><div><?php _e('Size', '
|
182 |
-
<th class="thumb" width="110" scope="col"><div><?php _e('Thumbnail', '
|
183 |
-
<th class="title_filename" scope="col"><div><?php _e('Filename / Title', '
|
184 |
-
<th class="description" scope="col"><div><?php _e('Description', '
|
185 |
</tr>
|
186 |
</thead>
|
187 |
<tfoot>
|
188 |
<tr>
|
189 |
-
<th class="cb" scope="col"><a href="#" onclick="checkAll(document.getElementById('updatePlaylist'));return false;"><?php _e('Check', '
|
190 |
-
<th class="id" scope="col"><?php _e('ID', '
|
191 |
-
<th class="size" scope="col"><?php _e('Size', '
|
192 |
-
<th class="thumb" scope="col"><?php _e('Thumbnail', '
|
193 |
-
<th class="title_filename" scope="col"><?php _e('Filename / Title', '
|
194 |
-
<th class="description" scope="col"><?php _e('Description', '
|
195 |
</tr>
|
196 |
</tfoot>
|
197 |
<tbody>
|
@@ -216,7 +221,7 @@ if(count($items_a)) {
|
|
216 |
<tr id="mp3-<?php echo $mp3->ID; ?>"<?php echo $alt; ?> valign="top">
|
217 |
<th class="cb" scope="row" height="24" style="padding-bottom: 0; border-bottom: none;"><input name="doaction[]" type="checkbox" value="<?php echo $mp3->ID; ?>" /></th>
|
218 |
<td class="id" style="padding-bottom: 0; border-bottom: none;"><p style="margin-bottom: 3px; white-space: nowrap;">ID: <?php echo $mp3->ID; ?></p></td>
|
219 |
-
<td class="size" style="padding-bottom: 0; border-bottom: none;"><?php
|
220 |
$path = $uploads['basedir'].str_replace($uploads['baseurl'],'',$url);
|
221 |
$size = filesize($path);
|
222 |
echo round($size/1024/1024,2).' Mb';
|
@@ -227,30 +232,29 @@ if(count($items_a)) {
|
|
227 |
<td class="title_filename" rowspan="2">
|
228 |
<strong><a href="<?php echo $url; ?>"><?php echo basename($url); ?></a></strong><br />
|
229 |
<textarea title="Title" name="item_a[<?php echo $mp3->ID; ?>][post_title]" cols="20" rows="1" style="width:95%; height: 25px; overflow:hidden;"><?php echo esc_html(stripslashes($mp3->post_title)); ?></textarea><br />
|
230 |
-
<p><?php _e('Thumb URL:', '
|
231 |
</td>
|
232 |
<td class="description" rowspan="2">
|
233 |
<textarea name="item_a[<?php echo $mp3->ID; ?>][post_content]" style="width:95%; height: 96px; margin-top: 2px; font-size:12px; line-height:115%;" rows="1" ><?php echo esc_html(stripslashes($mp3->post_content)); ?></textarea>
|
234 |
</td>
|
235 |
</tr>
|
236 |
<tr class="mp3-<?php echo $mp3->ID.$alt2; ?>">
|
237 |
-
<td valign="top" class="player" colspan="3"><
|
238 |
-
<div class="play" style="padding-left: 4px;"><span id="c-<?php echo $mp3->ID; ?>"></span></div></td>
|
239 |
</tr>
|
240 |
<?php
|
241 |
}
|
242 |
}
|
243 |
-
|
244 |
// In the case you have no capaptibility to see the search result
|
245 |
if ( $counter==0 )
|
246 |
-
echo '<tr><td colspan="5" align="center"><strong>'.__('No entries found','
|
247 |
|
248 |
?>
|
249 |
-
|
250 |
</tbody>
|
251 |
</table>
|
252 |
-
<p class="submit" style="text-align: right;"><input type="submit" class="button-primary action" name="updatePlaylist" value="<?php _e("Update Playlist",'
|
253 |
-
</form>
|
254 |
<form id="form_listitems" name="form_listitems" method="POST" action="<?php echo esc_url($filepath."&playlist=".sanitize_flagname($_GET['playlist'])."&mode=add"); ?>">
|
255 |
<?php wp_nonce_field('flag_add'); ?>
|
256 |
<input type="hidden" name="items" value="<?php echo $items; ?>" />
|
12 |
$items_a = $playlist['items'];
|
13 |
$items = implode(',',$playlist['items']);
|
14 |
?>
|
15 |
+
<script type="text/javascript">
|
16 |
//<![CDATA[
|
17 |
function checkAll(form)
|
18 |
{
|
37 |
function checkSelected() {
|
38 |
|
39 |
var numchecked = getNumChecked(document.getElementById('updatePlaylist'));
|
40 |
+
|
41 |
+
if(numchecked < 1) {
|
42 |
+
alert('<?php echo esc_js(__("No items selected", "flash-album-gallery")); ?>');
|
43 |
+
return false;
|
44 |
+
}
|
45 |
+
|
46 |
actionId = jQuery('#bulkaction').val();
|
47 |
+
|
48 |
switch (actionId) {
|
49 |
case "delete_items":
|
50 |
+
return confirm('<?php echo sprintf(esc_js(__("You are about to delete %s item(s) \n \n 'Cancel' to stop, 'OK' to proceed.",'flash-album-gallery')), "' + numchecked + '") ; ?>');
|
51 |
+
break;
|
52 |
}
|
53 |
+
|
54 |
+
return confirm('<?php echo sprintf(esc_js(__("You are about to start the bulk edit for %s item(s) \n \n 'Cancel' to stop, 'OK' to proceed.",'flash-album-gallery')), "' + numchecked + '") ; ?>');
|
55 |
}
|
56 |
|
57 |
function showDialog( windowId, height ) {
|
95 |
</script>
|
96 |
|
97 |
<div class="flag-wrap">
|
98 |
+
<h2><?php _e( 'Playlist', 'flash-album-gallery' ); ?>: <?php echo esc_html($playlist['title']); ?></h2>
|
99 |
<div style="float: right; margin: -20px 3px 0 0;">
|
100 |
+
<span><a href="<?php echo $filepath; ?>"><?php _e('Back to Music Box', 'flash-album-gallery'); ?></a> </span>
|
101 |
<select name="select_playlist" onchange="window.location.href=this.options[this.selectedIndex].value">
|
102 |
+
<option selected="selected"><?php _e('Choose another playlist', 'flash-album-gallery'); ?></option>
|
103 |
+
<?php
|
104 |
foreach((array)$all_playlists as $playlist_file => $playlist_data) {
|
105 |
$playlist_name = basename($playlist_file, '.xml');
|
106 |
if ($playlist_file == sanitize_flagname($_GET['playlist'])) continue;
|
107 |
?>
|
108 |
<option value="<?php echo esc_url($filepath."&playlist=".$playlist_name."&mode=edit"); ?>"><?php echo esc_html($playlist_data['title']); ?></option>
|
109 |
+
<?php
|
110 |
}
|
111 |
?>
|
112 |
</select>
|
118 |
<div id="poststuff" class="metabox-holder">
|
119 |
<div id="post-body"><div id="post-body-content"><div id="normal-sortables" style="position: relative;">
|
120 |
<div id="flagalleryset" class="postbox" >
|
121 |
+
<h3 class="hndle"><span><?php _e('Playlist settings', 'flash-album-gallery'); ?></span></h3>
|
122 |
<div class="inside">
|
123 |
<table cellspacing="8" cellpadding="0" border="0">
|
124 |
<tr>
|
125 |
+
<th align="left" valign="middle" scope="row"><?php _e('Shortcode', 'flash-album-gallery'); ?>:</th>
|
126 |
<td align="left" valign="middle"><input type="text" readonly="readonly" size="50" onfocus="this.select()" value="[grandmusic playlist=<?php echo sanitize_flagname($_GET['playlist']); ?>]" /></td>
|
127 |
+
<td rowspan="3" align="left" valign="top"><div><strong style="display: inline-block; width: 100px;"><?php _e("Playlist Skin", 'flash-album-gallery'); ?>:</strong>
|
128 |
<input id="skinaction" type="hidden" name="skinaction" value="<?php echo sanitize_flagname($playlist['skin']); ?>" />
|
129 |
<select id="skinname" name="skinname" style="width: 200px; height: 24px; font-size: 11px;">
|
130 |
<?php require_once (dirname(__FILE__) . '/get_skin.php');
|
131 |
$all_skins = get_skins($skin_folder='', $type='m');
|
132 |
+
$current_skin_title = __('No Skin', 'flash-album-gallery');
|
133 |
if(count($all_skins)) {
|
134 |
foreach ( (array)$all_skins as $skin_file => $skin_data) {
|
135 |
+
$cur = '';
|
136 |
+
if($playlist['skin'] == dirname($skin_file)){
|
137 |
+
$cur = ' selected="selected"';
|
138 |
+
$current_skin_title = $skin_data['Name'];
|
139 |
+
}
|
140 |
echo '<option'.$cur.' value="'.dirname($skin_file).'">'.$skin_data['Name'].'</option>'."\n";
|
141 |
}
|
142 |
} else {
|
143 |
+
echo '<option value="music_default">'.__("No Skins", "flash-album-gallery").'</option>';
|
144 |
}
|
145 |
?>
|
146 |
+
</select> <a id="skinOptions" class="thickbox" title="<?php echo esc_attr($current_skin_title); ?>" href="<?php echo FLAG_URLPATH.'admin/skin_options.php?show_options=1&skin='.sanitize_flagname($playlist['skin']).'&TB_iframe=1&width=600&height=560'; ?>"><?php _e('Change Skin Options', 'flash-album-gallery' ); ?></a>
|
147 |
</div>
|
148 |
+
<p style="margin:10px 0 0 100px;"><input type="submit" id="updatePlaylistSkin" name="updatePlaylistSkin" class="button-primary action" value="<?php _e('Update skin options for this playlist', 'flash-album-gallery'); ?>" /></p>
|
149 |
</td>
|
150 |
</tr>
|
151 |
<tr>
|
152 |
+
<th align="left" valign="middle" scope="row"><?php _e('Title', 'flash-album-gallery'); ?>:</th>
|
153 |
<td align="left" valign="middle"><input type="text" size="50" name="playlist_title" value="<?php echo esc_html($playlist['title']); ?>" /></td>
|
154 |
</tr>
|
155 |
<tr>
|
156 |
+
<th align="left" valign="top" scope="row"><?php _e('Description', 'flash-album-gallery'); ?>:</th>
|
157 |
<td align="left" valign="top"><textarea name="playlist_descr" cols="60" rows="2" style="width: 95%" ><?php echo esc_html($playlist['description']); ?></textarea></td>
|
158 |
</tr>
|
159 |
<!--<tr>
|
160 |
+
<th align="left" valign="top" scope="row"><?php _e('Path', 'flash-album-gallery'); ?>:</th>
|
161 |
<td align="left" colspan="2" valign="top"><?php echo $playlistPath; ?></td>
|
162 |
</tr>-->
|
163 |
</table>
|
168 |
</div> <!-- poststuff -->
|
169 |
<div class="tablenav flag-tablenav">
|
170 |
<select id="bulkaction" name="bulkaction" class="alignleft">
|
171 |
+
<option value="no_action" ><?php _e("No action",'flash-album-gallery')?></option>
|
172 |
+
<option value="delete_items" ><?php _e("Delete items",'flash-album-gallery')?></option>
|
173 |
</select>
|
174 |
+
<input class="button-secondary alignleft" style="margin-right:10px;" type="submit" name="updatePlaylist" value="<?php _e("OK",'flash-album-gallery')?>" onclick="if ( !checkSelected() ) return false;" />
|
175 |
+
<a href="<?php echo wp_nonce_url($filepath."&playlist=".sanitize_flagname($_GET['playlist'])."&mode=sort", 'flag_sort'); ?>" class="button-secondary alignleft" style="margin:1px 10px 0 0;"><?php _e("Sort Playlist",'flash-album-gallery')?></a>
|
176 |
+
<a href="#" onClick="jQuery('#form_listitems').submit();return false;" class="button-secondary alignleft" style="margin:1px 10px 0 0;"><?php _e("Add/Remove Items from Playlist",'flash-album-gallery')?></a>
|
177 |
+
<input type="submit" name="updatePlaylist" class="button-primary action alignright" value="<?php _e("Update Playlist",'flash-album-gallery')?>" />
|
178 |
</div>
|
179 |
|
180 |
<table id="flag-listmusic" class="widefat fixed flag-table" cellspacing="0" >
|
181 |
|
182 |
<thead>
|
183 |
<tr>
|
184 |
+
<th class="cb" width="54" scope="col"><a href="#" onclick="checkAll(document.getElementById('updatePlaylist'));return false;"><?php _e('Check', 'flash-album-gallery'); ?></a></th>
|
185 |
+
<th class="id" width="134" scope="col"><div><?php _e('ID', 'flash-album-gallery'); ?></div></th>
|
186 |
+
<th class="size" width="75" scope="col"><div><?php _e('Size', 'flash-album-gallery'); ?></div></th>
|
187 |
+
<th class="thumb" width="110" scope="col"><div><?php _e('Thumbnail', 'flash-album-gallery'); ?></div></th>
|
188 |
+
<th class="title_filename" scope="col"><div><?php _e('Filename / Title', 'flash-album-gallery'); ?></div></th>
|
189 |
+
<th class="description" scope="col"><div><?php _e('Description', 'flash-album-gallery'); ?></div></th>
|
190 |
</tr>
|
191 |
</thead>
|
192 |
<tfoot>
|
193 |
<tr>
|
194 |
+
<th class="cb" scope="col"><a href="#" onclick="checkAll(document.getElementById('updatePlaylist'));return false;"><?php _e('Check', 'flash-album-gallery'); ?></a></th>
|
195 |
+
<th class="id" scope="col"><?php _e('ID', 'flash-album-gallery'); ?></th>
|
196 |
+
<th class="size" scope="col"><?php _e('Size', 'flash-album-gallery'); ?></th>
|
197 |
+
<th class="thumb" scope="col"><?php _e('Thumbnail', 'flash-album-gallery'); ?></th>
|
198 |
+
<th class="title_filename" scope="col"><?php _e('Filename / Title', 'flash-album-gallery'); ?></th>
|
199 |
+
<th class="description" scope="col"><?php _e('Description', 'flash-album-gallery'); ?></th>
|
200 |
</tr>
|
201 |
</tfoot>
|
202 |
<tbody>
|
221 |
<tr id="mp3-<?php echo $mp3->ID; ?>"<?php echo $alt; ?> valign="top">
|
222 |
<th class="cb" scope="row" height="24" style="padding-bottom: 0; border-bottom: none;"><input name="doaction[]" type="checkbox" value="<?php echo $mp3->ID; ?>" /></th>
|
223 |
<td class="id" style="padding-bottom: 0; border-bottom: none;"><p style="margin-bottom: 3px; white-space: nowrap;">ID: <?php echo $mp3->ID; ?></p></td>
|
224 |
+
<td class="size" style="padding-bottom: 0; border-bottom: none;"><?php
|
225 |
$path = $uploads['basedir'].str_replace($uploads['baseurl'],'',$url);
|
226 |
$size = filesize($path);
|
227 |
echo round($size/1024/1024,2).' Mb';
|
232 |
<td class="title_filename" rowspan="2">
|
233 |
<strong><a href="<?php echo $url; ?>"><?php echo basename($url); ?></a></strong><br />
|
234 |
<textarea title="Title" name="item_a[<?php echo $mp3->ID; ?>][post_title]" cols="20" rows="1" style="width:95%; height: 25px; overflow:hidden;"><?php echo esc_html(stripslashes($mp3->post_title)); ?></textarea><br />
|
235 |
+
<p><?php _e('Thumb URL:', 'flash-album-gallery'); ?> <input id="mp3thumb-<?php echo $mp3->ID; ?>" name="item_a[<?php echo $mp3->ID; ?>][post_thumb]" type="text" value="<?php echo esc_url($mp3thumb); ?>" /> <a class="thickbox" onclick="actInp=<?php echo $mp3->ID; ?>" href="media-upload.php?type=image&TB_iframe=1&width=640&height=400" title="<?php _e('Add an Image','flash-album-gallery'); ?>"><?php _e('assist', 'flash-album-gallery'); ?></a></p>
|
236 |
</td>
|
237 |
<td class="description" rowspan="2">
|
238 |
<textarea name="item_a[<?php echo $mp3->ID; ?>][post_content]" style="width:95%; height: 96px; margin-top: 2px; font-size:12px; line-height:115%;" rows="1" ><?php echo esc_html(stripslashes($mp3->post_content)); ?></textarea>
|
239 |
</td>
|
240 |
</tr>
|
241 |
<tr class="mp3-<?php echo $mp3->ID.$alt2; ?>">
|
242 |
+
<td valign="top" class="player" colspan="3"><audio src="<?php echo esc_url($url); ?>" controls preload="none" autobuffer="false"></audio></td>
|
|
|
243 |
</tr>
|
244 |
<?php
|
245 |
}
|
246 |
}
|
247 |
+
|
248 |
// In the case you have no capaptibility to see the search result
|
249 |
if ( $counter==0 )
|
250 |
+
echo '<tr><td colspan="5" align="center"><strong>'.__('No entries found','flash-album-gallery').'</strong></td></tr>';
|
251 |
|
252 |
?>
|
253 |
+
|
254 |
</tbody>
|
255 |
</table>
|
256 |
+
<p class="submit" style="text-align: right;"><input type="submit" class="button-primary action" name="updatePlaylist" value="<?php _e("Update Playlist",'flash-album-gallery')?>" /></p>
|
257 |
+
</form>
|
258 |
<form id="form_listitems" name="form_listitems" method="POST" action="<?php echo esc_url($filepath."&playlist=".sanitize_flagname($_GET['playlist'])."&mode=add"); ?>">
|
259 |
<?php wp_nonce_field('flag_add'); ?>
|
260 |
<input type="hidden" name="items" value="<?php echo $items; ?>" />
|
admin/manage-sort.php
CHANGED
@@ -28,7 +28,7 @@ function flag_sortorder($galleryID = 0){
|
|
28 |
if ($firstImage)
|
29 |
$wpdb->query("UPDATE $wpdb->flaggallery SET previewpic = '$firstImage' WHERE gid = '$galleryID'");
|
30 |
|
31 |
-
flagGallery::show_message(__('Sort order changed','
|
32 |
|
33 |
}
|
34 |
|
@@ -50,17 +50,17 @@ function flag_sortorder($galleryID = 0){
|
|
50 |
<script type="text/javascript" src="<?php echo FLAG_URLPATH; ?>admin/js/jquery.tablednd_0_5.js"></script>
|
51 |
<script type="text/javascript" src="<?php echo FLAG_URLPATH; ?>admin/js/jquery.tablesorter.js"></script>
|
52 |
<div class="flag-wrap">
|
53 |
-
<h2><?php _e('Sort Gallery', '
|
54 |
|
55 |
<form class="alignright" method="POST" action="<?php echo admin_url() . 'admin.php?page=flag-manage-gallery&mode=edit&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', '
|
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', '
|
64 |
</div>
|
65 |
<br clear="all" />
|
66 |
<script type="text/javascript">
|
@@ -96,20 +96,20 @@ jQuery(document).ready(function($) {
|
|
96 |
|
97 |
<thead>
|
98 |
<tr>
|
99 |
-
<th class="header" width="30px"><p style="margin-right:-10px;"><?php _e('ID', '
|
100 |
-
<th width="120"><p><?php _e('Thumb', '
|
101 |
-
<th class="header"><p><?php _e('Filename', '
|
102 |
-
<th class="header" width="130"><p><?php _e('Date', '
|
103 |
-
<th class="header"><p><?php _e('Alt & Title Text', '
|
104 |
</tr>
|
105 |
</thead>
|
106 |
<tfoot>
|
107 |
<tr>
|
108 |
-
<th><p><?php _e('ID', '
|
109 |
-
<th><p><?php _e('Thumb', '
|
110 |
-
<th><p><?php _e('Filename', '
|
111 |
-
<th><p><?php _e('Date', '
|
112 |
-
<th><p><?php _e('Alt & Title Text', '
|
113 |
</tr>
|
114 |
</tfoot>
|
115 |
<tbody id="listimages">
|
@@ -137,13 +137,13 @@ if($picturelist) {
|
|
137 |
<?php
|
138 |
}
|
139 |
} else {
|
140 |
-
echo '<tr><td colspan="5" align="center"><strong>'.__('No entries found','
|
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', '
|
147 |
</form>
|
148 |
<br class="clear"/>
|
149 |
</div><!-- /#wrap -->
|
28 |
if ($firstImage)
|
29 |
$wpdb->query("UPDATE $wpdb->flaggallery SET previewpic = '$firstImage' WHERE gid = '$galleryID'");
|
30 |
|
31 |
+
flagGallery::show_message(__('Sort order changed','flash-album-gallery'));
|
32 |
|
33 |
}
|
34 |
|
50 |
<script type="text/javascript" src="<?php echo FLAG_URLPATH; ?>admin/js/jquery.tablednd_0_5.js"></script>
|
51 |
<script type="text/javascript" src="<?php echo FLAG_URLPATH; ?>admin/js/jquery.tablesorter.js"></script>
|
52 |
<div class="flag-wrap">
|
53 |
+
<h2><?php _e('Sort Gallery', 'flash-album-gallery'); ?></h2>
|
54 |
|
55 |
<form class="alignright" method="POST" action="<?php echo admin_url() . 'admin.php?page=flag-manage-gallery&mode=edit&gid=' . $galleryID; ?>" accept-charset="utf-8">
|
56 |
<div class="alignright tablenav" style="margin-bottom: -36px;">
|
57 |
+
<input class="button-secondary action" type="submit" name="backToGallery" value="<?php _e('Back to gallery', 'flash-album-gallery'); ?>" />
|
58 |
</div>
|
59 |
</form>
|
60 |
<form id="sortGallery" method="POST" action="<?php echo $base_url; ?>" accept-charset="utf-8">
|
61 |
<div class="alignleft tablenav">
|
62 |
<?php wp_nonce_field('flag_updatesortorder'); ?>
|
63 |
+
<input class="button-primary action" type="submit" name="updateSortorder" value="<?php _e('Update Sort Order', 'flash-album-gallery'); ?>" />
|
64 |
</div>
|
65 |
<br clear="all" />
|
66 |
<script type="text/javascript">
|
96 |
|
97 |
<thead>
|
98 |
<tr>
|
99 |
+
<th class="header" width="30px"><p style="margin-right:-10px;"><?php _e('ID', 'flash-album-gallery'); ?></p></th>
|
100 |
+
<th width="120"><p><?php _e('Thumb', 'flash-album-gallery'); ?></p></th>
|
101 |
+
<th class="header"><p><?php _e('Filename', 'flash-album-gallery'); ?></p></th>
|
102 |
+
<th class="header" width="130"><p><?php _e('Date', 'flash-album-gallery'); ?></p></th>
|
103 |
+
<th class="header"><p><?php _e('Alt & Title Text', 'flash-album-gallery'); ?></p></th>
|
104 |
</tr>
|
105 |
</thead>
|
106 |
<tfoot>
|
107 |
<tr>
|
108 |
+
<th><p><?php _e('ID', 'flash-album-gallery'); ?></p></th>
|
109 |
+
<th><p><?php _e('Thumb', 'flash-album-gallery'); ?></p></th>
|
110 |
+
<th><p><?php _e('Filename', 'flash-album-gallery'); ?></p></th>
|
111 |
+
<th><p><?php _e('Date', 'flash-album-gallery'); ?></p></th>
|
112 |
+
<th><p><?php _e('Alt & Title Text', 'flash-album-gallery'); ?></p></th>
|
113 |
</tr>
|
114 |
</tfoot>
|
115 |
<tbody id="listimages">
|
137 |
<?php
|
138 |
}
|
139 |
} else {
|
140 |
+
echo '<tr><td colspan="5" align="center"><strong>'.__('No entries found','flash-album-gallery').'</strong></td></tr>';
|
141 |
}
|
142 |
?>
|
143 |
|
144 |
</tbody>
|
145 |
</table>
|
146 |
+
<p class="actions"><input type="submit" class="button-primary action" name="updateSortorder" onclick="saveImageOrder()" value="<?php _e('Update Sort Order', 'flash-album-gallery'); ?>" /></p>
|
147 |
</form>
|
148 |
<br class="clear"/>
|
149 |
</div><!-- /#wrap -->
|
admin/manage-video.php
CHANGED
@@ -39,19 +39,19 @@ function checkSelected() {
|
|
39 |
var numchecked = getNumChecked(document.getElementById('updatePlaylist'));
|
40 |
|
41 |
if(numchecked < 1) {
|
42 |
-
alert('<?php echo esc_js(__("No items selected", "
|
43 |
return false;
|
44 |
}
|
45 |
|
46 |
-
actionId = jQuery('#bulkaction').val();
|
47 |
|
48 |
switch (actionId) {
|
49 |
case "delete_items":
|
50 |
-
return confirm('<?php echo sprintf(esc_js(__("You are about to delete %s item(s) \n \n 'Cancel' to stop, 'OK' to proceed.",'
|
51 |
break;
|
52 |
}
|
53 |
|
54 |
-
return confirm('<?php echo sprintf(esc_js(__("You are about to start the bulk edit for %s item(s) \n \n 'Cancel' to stop, 'OK' to proceed.",'
|
55 |
}
|
56 |
|
57 |
function showDialog( windowId, height ) {
|
@@ -98,11 +98,11 @@ jQuery(document).ready(function(){
|
|
98 |
</script>
|
99 |
|
100 |
<div class="flag-wrap">
|
101 |
-
<h2><?php _e( 'Playlist', '
|
102 |
<div style="float: right; margin: -20px 3px 0 0;">
|
103 |
-
<span><a href="<?php echo $filepath; ?>"><?php _e('Back to Video Box', '
|
104 |
<select name="select_playlist" onchange="window.location.href=this.options[this.selectedIndex].value">
|
105 |
-
<option selected="selected"><?php _e('Choose another playlist', '
|
106 |
<?php
|
107 |
foreach((array)$all_playlists as $playlist_file => $playlist_data) {
|
108 |
$playlist_name = basename($playlist_file, '.xml');
|
@@ -121,41 +121,46 @@ jQuery(document).ready(function(){
|
|
121 |
<div id="poststuff" class="metabox-holder">
|
122 |
<div id="post-body"><div id="post-body-content"><div id="normal-sortables" style="position: relative;">
|
123 |
<div id="flagalleryset" class="postbox" >
|
124 |
-
<h3 class="hndle"><span><?php _e('Playlist settings', '
|
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', '
|
129 |
<td align="left" valign="middle"><input type="text" readonly="readonly" size="50" onfocus="this.select()" value="[grandvideo playlist=<?php echo sanitize_flagname($_GET['playlist']); ?>]" /></td>
|
130 |
-
<td rowspan="3" align="left" valign="top"><div><strong style="display: inline-block; width: 100px;"><?php _e("Playlist Skin", '
|
131 |
<input id="skinaction" type="hidden" name="skinaction" value="<?php echo sanitize_flagname($playlist['skin']); ?>" />
|
132 |
<select id="skinname" name="skinname" style="width: 200px; height: 24px; font-size: 11px;">
|
133 |
<?php require_once (dirname(__FILE__) . '/get_skin.php');
|
134 |
$all_skins = get_skins($skin_folder='', $type='v');
|
|
|
135 |
if(count($all_skins)) {
|
136 |
foreach ( (array)$all_skins as $skin_file => $skin_data) {
|
137 |
-
|
|
|
|
|
|
|
|
|
138 |
echo '<option'.$cur.' value="'.dirname($skin_file).'">'.$skin_data['Name'].'</option>'."\n";
|
139 |
}
|
140 |
} else {
|
141 |
-
echo '<option value="
|
142 |
}
|
143 |
?>
|
144 |
-
</select> <a id="skinOptions" class="thickbox" href="<?php echo FLAG_URLPATH.'admin/skin_options.php?show_options=1&skin='.sanitize_flagname($playlist['skin']).'&TB_iframe=1&width=600&height=560'; ?>"><?php _e('Change Skin Options', '
|
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', '
|
147 |
</td>
|
148 |
</tr>
|
149 |
<tr>
|
150 |
-
<th align="left" valign="middle" scope="row"><?php _e('Title', '
|
151 |
<td align="left" valign="middle"><input type="text" size="50" name="playlist_title" value="<?php echo esc_html($playlist['title']); ?>" /></td>
|
152 |
</tr>
|
153 |
<tr>
|
154 |
-
<th align="left" valign="top" scope="row"><?php _e('Description', '
|
155 |
<td align="left" valign="top"><textarea name="playlist_descr" cols="60" rows="2" style="width: 95%" ><?php echo esc_html($playlist['description']); ?></textarea></td>
|
156 |
</tr>
|
157 |
<!--<tr>
|
158 |
-
<th align="left" valign="top" scope="row"><?php _e('Path', '
|
159 |
<td align="left" colspan="2" valign="top"><?php echo $playlistPath; ?></td>
|
160 |
</tr>-->
|
161 |
</table>
|
@@ -166,35 +171,35 @@ jQuery(document).ready(function(){
|
|
166 |
</div> <!-- poststuff -->
|
167 |
<div class="tablenav flag-tablenav">
|
168 |
<select id="bulkaction" name="bulkaction" class="alignleft">
|
169 |
-
<option value="no_action" ><?php _e("No action",'
|
170 |
-
<option value="delete_items" ><?php _e("Delete items",'
|
171 |
</select>
|
172 |
-
<input class="button-secondary alignleft" style="margin-right:10px;" type="submit" name="updatePlaylist" value="<?php _e("OK",'
|
173 |
-
<a href="<?php echo wp_nonce_url($filepath."&playlist=".sanitize_flagname($_GET['playlist'])."&mode=sort", 'flag_sort'); ?>" class="button-secondary alignleft" style="margin:1px 10px 0 0;"><?php _e("Sort Playlist",'
|
174 |
-
<a href="#" onClick="jQuery('#form_listitems').submit();return false;" class="button-secondary alignleft" style="margin:1px 10px 0 0;"><?php _e("Add/Remove Items from Playlist",'
|
175 |
-
<input type="submit" name="updatePlaylist" class="button-primary action alignright" value="<?php _e("Update Playlist",'
|
176 |
</div>
|
177 |
|
178 |
<table id="flag-listvideo" class="widefat fixed flag-table" cellspacing="0" >
|
179 |
|
180 |
<thead>
|
181 |
<tr>
|
182 |
-
<th class="cb" width="54" scope="col"><a href="#" onclick="checkAll(document.getElementById('updatePlaylist'));return false;"><?php _e('Check', '
|
183 |
-
<th class="id" width="134" scope="col"><div><?php _e('ID', '
|
184 |
-
<th class="size" width="75" scope="col"><div><?php _e('Size', '
|
185 |
-
<th class="thumb" width="110" scope="col"><div><?php _e('Thumbnail', '
|
186 |
-
<th class="title_filename" scope="col"><div><?php _e('Filename / Title', '
|
187 |
-
<th class="description" scope="col"><div><?php _e('Description', '
|
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', '
|
193 |
-
<th class="id" scope="col"><?php _e('ID', '
|
194 |
-
<th class="size" scope="col"><?php _e('Size', '
|
195 |
-
<th class="thumb" scope="col"><?php _e('Thumbnail', '
|
196 |
-
<th class="title_filename" scope="col"><?php _e('Filename / Title', '
|
197 |
-
<th class="description" scope="col"><?php _e('Description', '
|
198 |
</tr>
|
199 |
</tfoot>
|
200 |
<tbody>
|
@@ -224,12 +229,12 @@ if(count($items_a)) {
|
|
224 |
echo round($size/1024/1024,2).' Mb';
|
225 |
?></td>
|
226 |
<td class="thumb">
|
227 |
-
<a class="thickbox" title="<?php echo basename($url); ?>" href="<?php echo FLAG_URLPATH; ?>admin/
|
228 |
</td>
|
229 |
<td class="title_filename">
|
230 |
<strong><a href="<?php echo $url; ?>"><?php echo basename($url); ?></a></strong><br />
|
231 |
<textarea title="Title" name="item_a[<?php echo $flv->ID; ?>][post_title]" cols="20" rows="1" style="width:95%; height: 25px; overflow:hidden;"><?php echo esc_html(stripslashes($flv->post_title)); ?></textarea><br />
|
232 |
-
<p><?php _e('Thumb URL:', '
|
233 |
</td>
|
234 |
<td class="description">
|
235 |
<textarea name="item_a[<?php echo $flv->ID; ?>][post_content]" style="width:95%; height: 96px; margin-top: 2px; font-size:12px; line-height:115%;" rows="1" ><?php echo esc_html(stripslashes($flv->post_content)); ?></textarea>
|
@@ -241,13 +246,13 @@ if(count($items_a)) {
|
|
241 |
|
242 |
// In the case you have no capaptibility to see the search result
|
243 |
if ( $counter==0 )
|
244 |
-
echo '<tr><td colspan="5" align="center"><strong>'.__('No entries found','
|
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",'
|
251 |
</form>
|
252 |
<form id="form_listitems" name="form_listitems" method="POST" action="<?php echo esc_url($filepath."&playlist=".sanitize_flagname($_GET['playlist'])."&mode=add"); ?>">
|
253 |
<?php wp_nonce_field('flag_add'); ?>
|
39 |
var numchecked = getNumChecked(document.getElementById('updatePlaylist'));
|
40 |
|
41 |
if(numchecked < 1) {
|
42 |
+
alert('<?php echo esc_js(__("No items selected", "flash-album-gallery")); ?>');
|
43 |
return false;
|
44 |
}
|
45 |
|
46 |
+
var actionId = jQuery('#bulkaction').val();
|
47 |
|
48 |
switch (actionId) {
|
49 |
case "delete_items":
|
50 |
+
return confirm('<?php echo sprintf(esc_js(__("You are about to delete %s item(s) \n \n 'Cancel' to stop, 'OK' to proceed.",'flash-album-gallery')), "' + numchecked + '") ; ?>');
|
51 |
break;
|
52 |
}
|
53 |
|
54 |
+
return confirm('<?php echo sprintf(esc_js(__("You are about to start the bulk edit for %s item(s) \n \n 'Cancel' to stop, 'OK' to proceed.",'flash-album-gallery')), "' + numchecked + '") ; ?>');
|
55 |
}
|
56 |
|
57 |
function showDialog( windowId, height ) {
|
98 |
</script>
|
99 |
|
100 |
<div class="flag-wrap">
|
101 |
+
<h2><?php _e( 'Playlist', 'flash-album-gallery' ); ?>: <?php echo esc_html($playlist['title']); ?></h2>
|
102 |
<div style="float: right; margin: -20px 3px 0 0;">
|
103 |
+
<span><a href="<?php echo $filepath; ?>"><?php _e('Back to Video Box', 'flash-album-gallery'); ?></a> </span>
|
104 |
<select name="select_playlist" onchange="window.location.href=this.options[this.selectedIndex].value">
|
105 |
+
<option selected="selected"><?php _e('Choose another playlist', 'flash-album-gallery'); ?></option>
|
106 |
<?php
|
107 |
foreach((array)$all_playlists as $playlist_file => $playlist_data) {
|
108 |
$playlist_name = basename($playlist_file, '.xml');
|
121 |
<div id="poststuff" class="metabox-holder">
|
122 |
<div id="post-body"><div id="post-body-content"><div id="normal-sortables" style="position: relative;">
|
123 |
<div id="flagalleryset" class="postbox" >
|
124 |
+
<h3 class="hndle"><span><?php _e('Playlist settings', 'flash-album-gallery'); ?></span></h3>
|
125 |
<div class="inside">
|
126 |
<table cellspacing="8" cellpadding="0" border="0">
|
127 |
<tr>
|
128 |
+
<th align="left" valign="middle" scope="row"><?php _e('Shortcode', 'flash-album-gallery'); ?>:</th>
|
129 |
<td align="left" valign="middle"><input type="text" readonly="readonly" size="50" onfocus="this.select()" value="[grandvideo playlist=<?php echo sanitize_flagname($_GET['playlist']); ?>]" /></td>
|
130 |
+
<td rowspan="3" align="left" valign="top"><div><strong style="display: inline-block; width: 100px;"><?php _e("Playlist Skin", 'flash-album-gallery'); ?>:</strong>
|
131 |
<input id="skinaction" type="hidden" name="skinaction" value="<?php echo sanitize_flagname($playlist['skin']); ?>" />
|
132 |
<select id="skinname" name="skinname" style="width: 200px; height: 24px; font-size: 11px;">
|
133 |
<?php require_once (dirname(__FILE__) . '/get_skin.php');
|
134 |
$all_skins = get_skins($skin_folder='', $type='v');
|
135 |
+
$current_skin_title = __('No Skin', 'flash-album-gallery');
|
136 |
if(count($all_skins)) {
|
137 |
foreach ( (array)$all_skins as $skin_file => $skin_data) {
|
138 |
+
$cur = '';
|
139 |
+
if($playlist['skin'] == dirname($skin_file)){
|
140 |
+
$cur = ' selected="selected"';
|
141 |
+
$current_skin_title = $skin_data['Name'];
|
142 |
+
}
|
143 |
echo '<option'.$cur.' value="'.dirname($skin_file).'">'.$skin_data['Name'].'</option>'."\n";
|
144 |
}
|
145 |
} else {
|
146 |
+
echo '<option value="wp-videoplayer">'.__("No Skins", "flash-album-gallery").'</option>';
|
147 |
}
|
148 |
?>
|
149 |
+
</select> <a id="skinOptions" class="thickbox" title="<?php echo esc_attr($current_skin_title); ?>" href="<?php echo FLAG_URLPATH.'admin/skin_options.php?show_options=1&skin='.sanitize_flagname($playlist['skin']).'&TB_iframe=1&width=600&height=560'; ?>"><?php _e('Change Skin Options', 'flash-album-gallery' ); ?></a>
|
150 |
</div>
|
151 |
+
<p style="margin:10px 0 0 100px;"><input type="submit" id="updatePlaylistSkin" name="updatePlaylistSkin" class="button-primary action" value="<?php _e('Update skin options for this playlist', 'flash-album-gallery'); ?>" /></p>
|
152 |
</td>
|
153 |
</tr>
|
154 |
<tr>
|
155 |
+
<th align="left" valign="middle" scope="row"><?php _e('Title', 'flash-album-gallery'); ?>:</th>
|
156 |
<td align="left" valign="middle"><input type="text" size="50" name="playlist_title" value="<?php echo esc_html($playlist['title']); ?>" /></td>
|
157 |
</tr>
|
158 |
<tr>
|
159 |
+
<th align="left" valign="top" scope="row"><?php _e('Description', 'flash-album-gallery'); ?>:</th>
|
160 |
<td align="left" valign="top"><textarea name="playlist_descr" cols="60" rows="2" style="width: 95%" ><?php echo esc_html($playlist['description']); ?></textarea></td>
|
161 |
</tr>
|
162 |
<!--<tr>
|
163 |
+
<th align="left" valign="top" scope="row"><?php _e('Path', 'flash-album-gallery'); ?>:</th>
|
164 |
<td align="left" colspan="2" valign="top"><?php echo $playlistPath; ?></td>
|
165 |
</tr>-->
|
166 |
</table>
|
171 |
</div> <!-- poststuff -->
|
172 |
<div class="tablenav flag-tablenav">
|
173 |
<select id="bulkaction" name="bulkaction" class="alignleft">
|
174 |
+
<option value="no_action" ><?php _e("No action",'flash-album-gallery')?></option>
|
175 |
+
<option value="delete_items" ><?php _e("Delete items",'flash-album-gallery')?></option>
|
176 |
</select>
|
177 |
+
<input class="button-secondary alignleft" style="margin-right:10px;" type="submit" name="updatePlaylist" value="<?php _e("OK",'flash-album-gallery')?>" onclick="if ( !checkSelected() ) return false;" />
|
178 |
+
<a href="<?php echo wp_nonce_url($filepath."&playlist=".sanitize_flagname($_GET['playlist'])."&mode=sort", 'flag_sort'); ?>" class="button-secondary alignleft" style="margin:1px 10px 0 0;"><?php _e("Sort Playlist",'flash-album-gallery')?></a>
|
179 |
+
<a href="#" onClick="jQuery('#form_listitems').submit();return false;" class="button-secondary alignleft" style="margin:1px 10px 0 0;"><?php _e("Add/Remove Items from Playlist",'flash-album-gallery')?></a>
|
180 |
+
<input type="submit" name="updatePlaylist" class="button-primary action alignright" value="<?php _e("Update Playlist",'flash-album-gallery')?>" />
|
181 |
</div>
|
182 |
|
183 |
<table id="flag-listvideo" class="widefat fixed flag-table" cellspacing="0" >
|
184 |
|
185 |
<thead>
|
186 |
<tr>
|
187 |
+
<th class="cb" width="54" scope="col"><a href="#" onclick="checkAll(document.getElementById('updatePlaylist'));return false;"><?php _e('Check', 'flash-album-gallery'); ?></a></th>
|
188 |
+
<th class="id" width="134" scope="col"><div><?php _e('ID', 'flash-album-gallery'); ?></div></th>
|
189 |
+
<th class="size" width="75" scope="col"><div><?php _e('Size', 'flash-album-gallery'); ?></div></th>
|
190 |
+
<th class="thumb" width="110" scope="col"><div><?php _e('Thumbnail', 'flash-album-gallery'); ?></div></th>
|
191 |
+
<th class="title_filename" scope="col"><div><?php _e('Filename / Title', 'flash-album-gallery'); ?></div></th>
|
192 |
+
<th class="description" scope="col"><div><?php _e('Description', 'flash-album-gallery'); ?></div></th>
|
193 |
</tr>
|
194 |
</thead>
|
195 |
<tfoot>
|
196 |
<tr>
|
197 |
+
<th class="cb" scope="col"><a href="#" onclick="checkAll(document.getElementById('updatePlaylist'));return false;"><?php _e('Check', 'flash-album-gallery'); ?></a></th>
|
198 |
+
<th class="id" scope="col"><?php _e('ID', 'flash-album-gallery'); ?></th>
|
199 |
+
<th class="size" scope="col"><?php _e('Size', 'flash-album-gallery'); ?></th>
|
200 |
+
<th class="thumb" scope="col"><?php _e('Thumbnail', 'flash-album-gallery'); ?></th>
|
201 |
+
<th class="title_filename" scope="col"><?php _e('Filename / Title', 'flash-album-gallery'); ?></th>
|
202 |
+
<th class="description" scope="col"><?php _e('Description', 'flash-album-gallery'); ?></th>
|
203 |
</tr>
|
204 |
</tfoot>
|
205 |
<tbody>
|
229 |
echo round($size/1024/1024,2).' Mb';
|
230 |
?></td>
|
231 |
<td class="thumb">
|
232 |
+
<a class="thickbox" title="<?php echo basename($url); ?>" href="<?php echo FLAG_URLPATH; ?>admin/video_preview.php?vid=<?php echo $flv->ID; ?>&TB_iframe=1&width=490&height=293"><img id="thumb-<?php echo $flv->ID; ?>" src="<?php echo esc_url($thumb); ?>" style="width:auto; height:auto; max-width:100px; max-height:100px;" alt="" /></a>
|
233 |
</td>
|
234 |
<td class="title_filename">
|
235 |
<strong><a href="<?php echo $url; ?>"><?php echo basename($url); ?></a></strong><br />
|
236 |
<textarea title="Title" name="item_a[<?php echo $flv->ID; ?>][post_title]" cols="20" rows="1" style="width:95%; height: 25px; overflow:hidden;"><?php echo esc_html(stripslashes($flv->post_title)); ?></textarea><br />
|
237 |
+
<p><?php _e('Thumb URL:', 'flash-album-gallery'); ?> <input id="flvthumb-<?php echo $flv->ID; ?>" name="item_a[<?php echo $flv->ID; ?>][post_thumb]" type="text" value="<?php echo esc_url($flvthumb); ?>" /> <a class="thickbox" onclick="actInp=<?php echo $flv->ID; ?>" href="media-upload.php?type=image&TB_iframe=1&width=640&height=400" title="<?php _e('Add an Image','flash-album-gallery'); ?>"><?php _e('assist', 'flash-album-gallery'); ?></a></p>
|
238 |
</td>
|
239 |
<td class="description">
|
240 |
<textarea name="item_a[<?php echo $flv->ID; ?>][post_content]" style="width:95%; height: 96px; margin-top: 2px; font-size:12px; line-height:115%;" rows="1" ><?php echo esc_html(stripslashes($flv->post_content)); ?></textarea>
|
246 |
|
247 |
// In the case you have no capaptibility to see the search result
|
248 |
if ( $counter==0 )
|
249 |
+
echo '<tr><td colspan="5" align="center"><strong>'.__('No entries found','flash-album-gallery').'</strong></td></tr>';
|
250 |
|
251 |
?>
|
252 |
|
253 |
</tbody>
|
254 |
</table>
|
255 |
+
<p class="submit" style="text-align: right;"><input type="submit" class="button-primary action" name="updatePlaylist" value="<?php _e("Update Playlist",'flash-album-gallery')?>" /></p>
|
256 |
</form>
|
257 |
<form id="form_listitems" name="form_listitems" method="POST" action="<?php echo esc_url($filepath."&playlist=".sanitize_flagname($_GET['playlist'])."&mode=add"); ?>">
|
258 |
<?php wp_nonce_field('flag_add'); ?>
|
admin/manage.php
CHANGED
@@ -103,7 +103,7 @@ class flagManageGallery {
|
|
103 |
}
|
104 |
}
|
105 |
|
106 |
-
flagGallery::show_message( _n( 'Gallery', 'Galleries', 1, '
|
107 |
|
108 |
}
|
109 |
|
@@ -114,7 +114,7 @@ class flagManageGallery {
|
|
114 |
if ($this->mode == 'draft') {
|
115 |
check_admin_referer('flag_editgallery');
|
116 |
if($wpdb->query( "UPDATE $wpdb->flaggallery SET status = 1 WHERE gid = '{$this->gid}'" ))
|
117 |
-
flagGallery::show_message( __( 'Gallery', '
|
118 |
$this->mode = 'main'; // show mainpage
|
119 |
}
|
120 |
|
@@ -122,7 +122,7 @@ class flagManageGallery {
|
|
122 |
if ($this->mode == 'publish') {
|
123 |
check_admin_referer('flag_editgallery');
|
124 |
if($wpdb->query( "UPDATE $wpdb->flaggallery SET status = 0 WHERE gid = '{$this->gid}'" ))
|
125 |
-
flagGallery::show_message( __( 'Gallery', '
|
126 |
$this->mode = 'main'; // show mainpage
|
127 |
}
|
128 |
|
@@ -130,13 +130,13 @@ class flagManageGallery {
|
|
130 |
if ( isset($_POST['album_name']) && !empty($_POST['album_name']) ) {
|
131 |
|
132 |
check_admin_referer('flag_album');
|
133 |
-
$album_name =
|
134 |
$newalbum = $wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->flagalbum (name) VALUES (%s)", $album_name) );
|
135 |
// and give me the new id
|
136 |
$newalbum_id = (int) $wpdb->insert_id;
|
137 |
|
138 |
if($newalbum)
|
139 |
-
flagGallery::show_message( __( 'Album', '
|
140 |
|
141 |
$this->mode = 'main'; // show mainpage
|
142 |
}
|
@@ -156,7 +156,7 @@ class flagManageGallery {
|
|
156 |
$delete_pic = $wpdb->query("DELETE FROM $wpdb->flagpictures WHERE pid = '{$image->pid}'");
|
157 |
}
|
158 |
if($delete_pic)
|
159 |
-
flagGallery::show_message( __('Picture','
|
160 |
|
161 |
$this->mode = 'edit'; // show pictures
|
162 |
|
@@ -165,7 +165,7 @@ class flagManageGallery {
|
|
165 |
// will be called after a ajax operation
|
166 |
if (isset ($_POST['ajax_callback'])) {
|
167 |
if ($_POST['ajax_callback'] == 1)
|
168 |
-
flagGallery::show_message(__('Operation successful. Please clear your browser cache.','
|
169 |
}
|
170 |
|
171 |
if ( isset ($_POST['backToGallery']) )
|
@@ -197,16 +197,16 @@ class flagManageGallery {
|
|
197 |
case 'import_meta':
|
198 |
// Import Metadata
|
199 |
// A prefix 'gallery_' will first fetch all ids from the selected galleries
|
200 |
-
flagAdmin::do_ajax_operation( 'gallery_import_metadata' , $_POST['doaction'], __('Import metadata','
|
201 |
break;
|
202 |
case 'copy_meta':
|
203 |
// Copy Metadata
|
204 |
// A prefix 'gallery_' will first fetch all ids from the selected galleries
|
205 |
-
flagAdmin::do_ajax_operation( 'gallery_copy_metadata' , $_POST['doaction'], __('Copy metadata to image Description','
|
206 |
break;
|
207 |
case 'webview_images':
|
208 |
// A prefix 'gallery_' will first fetch all ids from the selected galleries
|
209 |
-
flagAdmin::do_ajax_operation( 'gallery_webview_image' , $_POST['doaction'], __('Creating images optimized for web','
|
210 |
break;
|
211 |
}
|
212 |
}
|
@@ -223,7 +223,7 @@ class flagManageGallery {
|
|
223 |
|
224 |
$gallery_ids = explode(',', $_POST['TB_imagelist']);
|
225 |
// A prefix 'gallery_' will first fetch all ids from the selected galleries
|
226 |
-
flagAdmin::do_ajax_operation( 'gallery_resize_image' , $gallery_ids, __('Resize images','
|
227 |
}
|
228 |
|
229 |
if (isset ($_POST['TB_bulkaction']) && isset ($_POST['TB_NewThumbnail'])) {
|
@@ -233,12 +233,11 @@ class flagManageGallery {
|
|
233 |
//save the new values for the next operation
|
234 |
$flag->options['thumbWidth'] = (int) $_POST['thumbWidth'];
|
235 |
$flag->options['thumbHeight'] = (int) $_POST['thumbHeight'];
|
236 |
-
$flag->options['thumbFix'] = (bool) $_POST['thumbFix'];
|
237 |
update_option('flag_options', $flag->options);
|
238 |
|
239 |
$gallery_ids = explode(',', $_POST['TB_imagelist']);
|
240 |
// A prefix 'gallery_' will first fetch all ids from the selected galleries
|
241 |
-
flagAdmin::do_ajax_operation( 'gallery_create_thumbnail' , $gallery_ids, __('Create new thumbnails','
|
242 |
}
|
243 |
|
244 |
}
|
@@ -271,17 +270,17 @@ class flagManageGallery {
|
|
271 |
}
|
272 |
}
|
273 |
if($delete_pic)
|
274 |
-
flagGallery::show_message(__('Pictures deleted successfully ','
|
275 |
}
|
276 |
break;
|
277 |
case 'import_meta':
|
278 |
-
flagAdmin::do_ajax_operation( 'import_metadata' , $_POST['doaction'], __('Import metadata','
|
279 |
break;
|
280 |
case 'copy_meta':
|
281 |
-
flagAdmin::do_ajax_operation( 'copy_metadata' , $_POST['doaction'], __('Copy metadata to image Description','
|
282 |
break;
|
283 |
case 'webview_images':
|
284 |
-
flagAdmin::do_ajax_operation( 'webview_image' , $_POST['doaction'], __('Creating images optimized for web','
|
285 |
break;
|
286 |
case 'reset_counters':
|
287 |
if(is_array($_POST['doaction'])){
|
@@ -306,7 +305,7 @@ class flagManageGallery {
|
|
306 |
update_option('flag_options', $flag->options);
|
307 |
|
308 |
$pic_ids = explode(',', $_POST['TB_imagelist']);
|
309 |
-
flagAdmin::do_ajax_operation( 'resize_image' , $pic_ids, __('Resize images','
|
310 |
}
|
311 |
|
312 |
if (isset ($_POST['TB_bulkaction']) && isset ($_POST['TB_NewThumbnail'])) {
|
@@ -316,11 +315,10 @@ class flagManageGallery {
|
|
316 |
//save the new values for the next operation
|
317 |
$flag->options['thumbWidth'] = (int) $_POST['thumbWidth'];
|
318 |
$flag->options['thumbHeight'] = (int) $_POST['thumbHeight'];
|
319 |
-
$flag->options['thumbFix'] = (bool) $_POST['thumbFix'];
|
320 |
update_option('flag_options', $flag->options);
|
321 |
|
322 |
$pic_ids = explode(',', $_POST['TB_imagelist']);
|
323 |
-
flagAdmin::do_ajax_operation( 'create_thumbnail' , $pic_ids, __('Create new thumbnails','
|
324 |
}
|
325 |
|
326 |
if (isset ($_POST['TB_bulkaction']) && isset ($_POST['TB_SelectGallery'])) {
|
@@ -348,9 +346,9 @@ class flagManageGallery {
|
|
348 |
|
349 |
check_admin_referer('flag_updategallery');
|
350 |
|
351 |
-
$gallery_title = esc_html($_POST['title']);
|
352 |
$gallery_path = esc_attr(str_replace('..','',$_POST['path']));
|
353 |
-
$gallery_desc = esc_html($_POST['gallerydesc']);
|
354 |
$gallery_preview = (int) $_POST['previewpic'];
|
355 |
|
356 |
$wpdb->query("UPDATE $wpdb->flaggallery SET title= '$gallery_title', path= '$gallery_path', galdesc = '$gallery_desc', previewpic = '$gallery_preview' WHERE gid = '{$this->gid}'");
|
@@ -365,7 +363,7 @@ class flagManageGallery {
|
|
365 |
//hook for other plugin to update the fields
|
366 |
do_action('flag_update_gallery', $this->gid, $_POST);
|
367 |
|
368 |
-
flagGallery::show_message(__('Update successful',"
|
369 |
}
|
370 |
|
371 |
if (isset ($_POST['scanfolder'])) {
|
@@ -393,7 +391,7 @@ class flagManageGallery {
|
|
393 |
|
394 |
if ( is_array($description) ) {
|
395 |
foreach( $description as $key => $value ) {
|
396 |
-
$desc = esc_sql($value);
|
397 |
$key =intval($key);
|
398 |
$wpdb->query( "UPDATE $wpdb->flagpictures SET description = '$desc' WHERE pid = $key");
|
399 |
}
|
103 |
}
|
104 |
}
|
105 |
|
106 |
+
flagGallery::show_message( _n( 'Gallery', 'Galleries', 1, 'flash-album-gallery' ) . ' \''.$this->gid.'\' '.__('deleted successfully','flash-album-gallery'));
|
107 |
|
108 |
}
|
109 |
|
114 |
if ($this->mode == 'draft') {
|
115 |
check_admin_referer('flag_editgallery');
|
116 |
if($wpdb->query( "UPDATE $wpdb->flaggallery SET status = 1 WHERE gid = '{$this->gid}'" ))
|
117 |
+
flagGallery::show_message( __( 'Gallery', 'flash-album-gallery' ) . ' \''.$this->gid.'\' '.__('now in draft','flash-album-gallery'));
|
118 |
$this->mode = 'main'; // show mainpage
|
119 |
}
|
120 |
|
122 |
if ($this->mode == 'publish') {
|
123 |
check_admin_referer('flag_editgallery');
|
124 |
if($wpdb->query( "UPDATE $wpdb->flaggallery SET status = 0 WHERE gid = '{$this->gid}'" ))
|
125 |
+
flagGallery::show_message( __( 'Gallery', 'flash-album-gallery' ) . ' \''.$this->gid.'\' '.__('now visible','flash-album-gallery'));
|
126 |
$this->mode = 'main'; // show mainpage
|
127 |
}
|
128 |
|
130 |
if ( isset($_POST['album_name']) && !empty($_POST['album_name']) ) {
|
131 |
|
132 |
check_admin_referer('flag_album');
|
133 |
+
$album_name = wp_check_invalid_utf8(wp_strip_all_tags($_POST['album_name']));
|
134 |
$newalbum = $wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->flagalbum (name) VALUES (%s)", $album_name) );
|
135 |
// and give me the new id
|
136 |
$newalbum_id = (int) $wpdb->insert_id;
|
137 |
|
138 |
if($newalbum)
|
139 |
+
flagGallery::show_message( __( 'Album', 'flash-album-gallery' ) . ' \''.$album_name.'\' '.__('successfully created','flash-album-gallery'));
|
140 |
|
141 |
$this->mode = 'main'; // show mainpage
|
142 |
}
|
156 |
$delete_pic = $wpdb->query("DELETE FROM $wpdb->flagpictures WHERE pid = '{$image->pid}'");
|
157 |
}
|
158 |
if($delete_pic)
|
159 |
+
flagGallery::show_message( __('Picture','flash-album-gallery').' \''.$this->pid.'\' '.__('deleted successfully','flash-album-gallery') );
|
160 |
|
161 |
$this->mode = 'edit'; // show pictures
|
162 |
|
165 |
// will be called after a ajax operation
|
166 |
if (isset ($_POST['ajax_callback'])) {
|
167 |
if ($_POST['ajax_callback'] == 1)
|
168 |
+
flagGallery::show_message(__('Operation successful. Please clear your browser cache.','flash-album-gallery'));
|
169 |
}
|
170 |
|
171 |
if ( isset ($_POST['backToGallery']) )
|
197 |
case 'import_meta':
|
198 |
// Import Metadata
|
199 |
// A prefix 'gallery_' will first fetch all ids from the selected galleries
|
200 |
+
flagAdmin::do_ajax_operation( 'gallery_import_metadata' , $_POST['doaction'], __('Import metadata','flash-album-gallery') );
|
201 |
break;
|
202 |
case 'copy_meta':
|
203 |
// Copy Metadata
|
204 |
// A prefix 'gallery_' will first fetch all ids from the selected galleries
|
205 |
+
flagAdmin::do_ajax_operation( 'gallery_copy_metadata' , $_POST['doaction'], __('Copy metadata to image Description','flash-album-gallery') );
|
206 |
break;
|
207 |
case 'webview_images':
|
208 |
// A prefix 'gallery_' will first fetch all ids from the selected galleries
|
209 |
+
flagAdmin::do_ajax_operation( 'gallery_webview_image' , $_POST['doaction'], __('Creating images optimized for web','flash-album-gallery') );
|
210 |
break;
|
211 |
}
|
212 |
}
|
223 |
|
224 |
$gallery_ids = explode(',', $_POST['TB_imagelist']);
|
225 |
// A prefix 'gallery_' will first fetch all ids from the selected galleries
|
226 |
+
flagAdmin::do_ajax_operation( 'gallery_resize_image' , $gallery_ids, __('Resize images','flash-album-gallery') );
|
227 |
}
|
228 |
|
229 |
if (isset ($_POST['TB_bulkaction']) && isset ($_POST['TB_NewThumbnail'])) {
|
233 |
//save the new values for the next operation
|
234 |
$flag->options['thumbWidth'] = (int) $_POST['thumbWidth'];
|
235 |
$flag->options['thumbHeight'] = (int) $_POST['thumbHeight'];
|
|
|
236 |
update_option('flag_options', $flag->options);
|
237 |
|
238 |
$gallery_ids = explode(',', $_POST['TB_imagelist']);
|
239 |
// A prefix 'gallery_' will first fetch all ids from the selected galleries
|
240 |
+
flagAdmin::do_ajax_operation( 'gallery_create_thumbnail' , $gallery_ids, __('Create new thumbnails','flash-album-gallery') );
|
241 |
}
|
242 |
|
243 |
}
|
270 |
}
|
271 |
}
|
272 |
if($delete_pic)
|
273 |
+
flagGallery::show_message(__('Pictures deleted successfully ','flash-album-gallery'));
|
274 |
}
|
275 |
break;
|
276 |
case 'import_meta':
|
277 |
+
flagAdmin::do_ajax_operation( 'import_metadata' , $_POST['doaction'], __('Import metadata','flash-album-gallery') );
|
278 |
break;
|
279 |
case 'copy_meta':
|
280 |
+
flagAdmin::do_ajax_operation( 'copy_metadata' , $_POST['doaction'], __('Copy metadata to image Description','flash-album-gallery') );
|
281 |
break;
|
282 |
case 'webview_images':
|
283 |
+
flagAdmin::do_ajax_operation( 'webview_image' , $_POST['doaction'], __('Creating images optimized for web','flash-album-gallery') );
|
284 |
break;
|
285 |
case 'reset_counters':
|
286 |
if(is_array($_POST['doaction'])){
|
305 |
update_option('flag_options', $flag->options);
|
306 |
|
307 |
$pic_ids = explode(',', $_POST['TB_imagelist']);
|
308 |
+
flagAdmin::do_ajax_operation( 'resize_image' , $pic_ids, __('Resize images','flash-album-gallery') );
|
309 |
}
|
310 |
|
311 |
if (isset ($_POST['TB_bulkaction']) && isset ($_POST['TB_NewThumbnail'])) {
|
315 |
//save the new values for the next operation
|
316 |
$flag->options['thumbWidth'] = (int) $_POST['thumbWidth'];
|
317 |
$flag->options['thumbHeight'] = (int) $_POST['thumbHeight'];
|
|
|
318 |
update_option('flag_options', $flag->options);
|
319 |
|
320 |
$pic_ids = explode(',', $_POST['TB_imagelist']);
|
321 |
+
flagAdmin::do_ajax_operation( 'create_thumbnail' , $pic_ids, __('Create new thumbnails','flash-album-gallery') );
|
322 |
}
|
323 |
|
324 |
if (isset ($_POST['TB_bulkaction']) && isset ($_POST['TB_SelectGallery'])) {
|
346 |
|
347 |
check_admin_referer('flag_updategallery');
|
348 |
|
349 |
+
$gallery_title = esc_html(wp_check_invalid_utf8($_POST['title']));
|
350 |
$gallery_path = esc_attr(str_replace('..','',$_POST['path']));
|
351 |
+
$gallery_desc = esc_html(wp_check_invalid_utf8($_POST['gallerydesc']));
|
352 |
$gallery_preview = (int) $_POST['previewpic'];
|
353 |
|
354 |
$wpdb->query("UPDATE $wpdb->flaggallery SET title= '$gallery_title', path= '$gallery_path', galdesc = '$gallery_desc', previewpic = '$gallery_preview' WHERE gid = '{$this->gid}'");
|
363 |
//hook for other plugin to update the fields
|
364 |
do_action('flag_update_gallery', $this->gid, $_POST);
|
365 |
|
366 |
+
flagGallery::show_message(__('Update successful',"flash-album-gallery"));
|
367 |
}
|
368 |
|
369 |
if (isset ($_POST['scanfolder'])) {
|
391 |
|
392 |
if ( is_array($description) ) {
|
393 |
foreach( $description as $key => $value ) {
|
394 |
+
$desc = esc_sql(wp_check_invalid_utf8($value));
|
395 |
$key =intval($key);
|
396 |
$wpdb->query( "UPDATE $wpdb->flagpictures SET description = '$desc' WHERE pid = $key");
|
397 |
}
|
admin/manage_thumbnail.php
CHANGED
@@ -42,24 +42,17 @@ $rr = round($imageInfo[0] / $resizedPreviewInfo['newWidth'], 2);
|
|
42 |
$WidthHtmlPrev = $flag_options['thumbWidth'];
|
43 |
$HeightHtmlPrev = $flag_options['thumbHeight'];
|
44 |
|
45 |
-
|
|
|
46 |
|
47 |
-
|
48 |
-
|
49 |
|
50 |
} else {
|
51 |
-
// H > W
|
52 |
-
if ($imageInfo[1] > $imageInfo[0]) {
|
53 |
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
} else {
|
58 |
-
|
59 |
-
$WidthtHtmlPrev = $flag_options['thumbWidth'];
|
60 |
-
$HeightHtmlPrev = round($imageInfo[1] / ($imageInfo[0] / $flag_options['thumbWidth']),0);
|
61 |
-
|
62 |
-
}
|
63 |
}
|
64 |
|
65 |
?>
|
@@ -104,7 +97,7 @@ if ( ($flag_options['thumbFix'] == 1) ) {
|
|
104 |
function updateThumb() {
|
105 |
|
106 |
if ( (wT == 0) || (hT == 0) || (wT == undefined) || (hT == undefined) ) {
|
107 |
-
alert("<?php _e('Select with the mouse the area for the new thumbnail.', '
|
108 |
return false;
|
109 |
}
|
110 |
|
@@ -118,12 +111,12 @@ if ( ($flag_options['thumbFix'] == 1) ) {
|
|
118 |
newUrl = jQuery("#"+selectedImage).attr("src") + "?" + d.getTime();
|
119 |
jQuery("#"+selectedImage).attr("src" , newUrl);
|
120 |
|
121 |
-
jQuery('#thumbMsg').html("<?php _e('Thumbnail updated', '
|
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.', '
|
127 |
jQuery('#thumbMsg').css({'display':'block'});
|
128 |
setTimeout(function(){ jQuery('#thumbMsg').fadeOut('slow'); }, 1500);
|
129 |
}
|
@@ -140,7 +133,7 @@ if ( ($flag_options['thumbFix'] == 1) ) {
|
|
140 |
<img src="<?php echo $preview_image; ?>" alt="" id="imageToEdit" />
|
141 |
</td>
|
142 |
<td width="300" style="background-color : #DADADA;">
|
143 |
-
<small style="margin-left:6px; display:block;"><?php _e('Select the area for the thumbnail from the picture on the left.', '
|
144 |
</td>
|
145 |
</tr>
|
146 |
<tr>
|
@@ -155,7 +148,7 @@ if ( ($flag_options['thumbFix'] == 1) ) {
|
|
155 |
</tr>
|
156 |
<tr style="background-color:#DADADA;">
|
157 |
<td>
|
158 |
-
<input type="button" name="update" value="<?php _e('Update', '
|
159 |
<div id="thumbMsg" style="color:#FF0000; display : none;font-size:11px; float:right; width:60%; height:2em; line-height:2em;"></div>
|
160 |
</td>
|
161 |
</tr>
|
42 |
$WidthHtmlPrev = $flag_options['thumbWidth'];
|
43 |
$HeightHtmlPrev = $flag_options['thumbHeight'];
|
44 |
|
45 |
+
// H > W
|
46 |
+
if ($imageInfo[1] > $imageInfo[0]) {
|
47 |
|
48 |
+
$HeightHtmlPrev = $flag_options['thumbHeight'];
|
49 |
+
$WidthHtmlPrev = round($imageInfo[0] / ($imageInfo[1] / $flag_options['thumbHeight']),0);
|
50 |
|
51 |
} else {
|
|
|
|
|
52 |
|
53 |
+
$WidthtHtmlPrev = $flag_options['thumbWidth'];
|
54 |
+
$HeightHtmlPrev = round($imageInfo[1] / ($imageInfo[0] / $flag_options['thumbWidth']),0);
|
55 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
56 |
}
|
57 |
|
58 |
?>
|
97 |
function updateThumb() {
|
98 |
|
99 |
if ( (wT == 0) || (hT == 0) || (wT == undefined) || (hT == undefined) ) {
|
100 |
+
alert("<?php _e('Select with the mouse the area for the new thumbnail.', 'flash-album-gallery'); ?>");
|
101 |
return false;
|
102 |
}
|
103 |
|
111 |
newUrl = jQuery("#"+selectedImage).attr("src") + "?" + d.getTime();
|
112 |
jQuery("#"+selectedImage).attr("src" , newUrl);
|
113 |
|
114 |
+
jQuery('#thumbMsg').html("<?php _e('Thumbnail updated', 'flash-album-gallery'); ?>");
|
115 |
jQuery('#thumbMsg').css({'display':'block'});
|
116 |
setTimeout(function(){ jQuery('#thumbMsg').fadeOut('slow'); }, 1500);
|
117 |
},
|
118 |
error: function() {
|
119 |
+
jQuery('#thumbMsg').html("<?php _e('Error updating thumbnail.', 'flash-album-gallery'); ?>");
|
120 |
jQuery('#thumbMsg').css({'display':'block'});
|
121 |
setTimeout(function(){ jQuery('#thumbMsg').fadeOut('slow'); }, 1500);
|
122 |
}
|
133 |
<img src="<?php echo $preview_image; ?>" alt="" id="imageToEdit" />
|
134 |
</td>
|
135 |
<td width="300" style="background-color : #DADADA;">
|
136 |
+
<small style="margin-left:6px; display:block;"><?php _e('Select the area for the thumbnail from the picture on the left.', 'flash-album-gallery'); ?></small>
|
137 |
</td>
|
138 |
</tr>
|
139 |
<tr>
|
148 |
</tr>
|
149 |
<tr style="background-color:#DADADA;">
|
150 |
<td>
|
151 |
+
<input type="button" name="update" value="<?php _e('Update', 'flash-album-gallery'); ?>" onclick="updateThumb()" class="button-secondary" style="float:left; margin-left:4px;"/>
|
152 |
<div id="thumbMsg" style="color:#FF0000; display : none;font-size:11px; float:right; width:60%; height:2em; line-height:2em;"></div>
|
153 |
</td>
|
154 |
</tr>
|
admin/media-upload.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
|
6 |
function flag_wp_upload_tabs ($tabs) {
|
7 |
|
8 |
-
$newtab = array('
|
9 |
|
10 |
return array_merge($tabs,$newtab);
|
11 |
}
|
@@ -123,7 +123,7 @@ function media_upload_flag_form() {
|
|
123 |
|
124 |
<div class="alignleft actions">
|
125 |
<select id="select_gal" name="select_gal" style="width:200px;">;
|
126 |
-
<option value="0" <?php selected('0', $galleryID); ?> ><?php _e('No gallery',"
|
127 |
<?php
|
128 |
// Show gallery selection
|
129 |
$gallerylist = $wpdb->get_results("SELECT * FROM $wpdb->flaggallery ORDER BY gid ASC");
|
@@ -135,7 +135,7 @@ function media_upload_flag_form() {
|
|
135 |
}
|
136 |
?>
|
137 |
</select>
|
138 |
-
<input type="submit" id="show-gallery" value="<?php _e('Select »','
|
139 |
</div>
|
140 |
<br style="clear:both;" />
|
141 |
</div>
|
@@ -166,23 +166,23 @@ function media_upload_flag_form() {
|
|
166 |
?>
|
167 |
<div id='media-item-<?php echo $picid; ?>' class='media-item preloaded'>
|
168 |
<div class='filename'></div>
|
169 |
-
<a class='toggle describe-toggle-on' href='#'><?php _e('Show', "
|
170 |
-
<a class='toggle describe-toggle-off' href='#'><?php _e('Hide', "
|
171 |
<div class='filename new'><?php echo ( empty($picture->alttext) ) ? wp_html_excerpt($picture->filename,60): stripslashes( wp_html_excerpt($picture->alttext,60) ); ?></div>
|
172 |
<table class='slidetoggle describe startclosed'><tbody>
|
173 |
<tr>
|
174 |
<td rowspan='4'><img class='thumbnail' alt='<?php echo esc_attr( $picture->alttext ); ?>' src='<?php echo esc_attr( $picture->thumbURL ); ?>'/></td>
|
175 |
-
<td><?php _e('Image ID:', "
|
176 |
</tr>
|
177 |
<tr><td><?php echo esc_attr( $picture->filename ); ?></td></tr>
|
178 |
<tr><td><?php echo esc_html( stripslashes($picture->alttext) ); ?></td></tr>
|
179 |
<tr><td> </td></tr>
|
180 |
<tr>
|
181 |
-
<td class="label"><label for="image[<?php echo $picid; ?>][alttext]"><?php _e('Alt/Title text', "
|
182 |
<td class="field"><input id="image[<?php echo $picid; ?>][alttext]" name="image[<?php echo $picid; ?>][alttext]" value="<?php echo esc_html( stripslashes($picture->alttext) ); ?>" type="text"/></td>
|
183 |
</tr>
|
184 |
<tr>
|
185 |
-
<td class="label"><label for="image[<?php echo $picid; ?>][description]"><?php _e("Description","
|
186 |
<td class="field"><textarea name="image[<?php echo $picid; ?>][description]" id="image[<?php echo $picid; ?>][description]"><?php echo esc_html( stripslashes($picture->description) ); ?></textarea></td>
|
187 |
</tr>
|
188 |
<tr class="align">
|
@@ -223,7 +223,7 @@ function media_upload_flag_form() {
|
|
223 |
?>
|
224 |
</div>
|
225 |
<p class="ml-submit">
|
226 |
-
<input type="submit" class="button savebutton" name="save" value="<?php _e('Save all changes','
|
227 |
</p>
|
228 |
<input type="hidden" name="post_id" id="post_id" value="<?php echo (int) $post_id; ?>" />
|
229 |
<input type="hidden" name="select_gal" id="select_gal" value="<?php echo (int) $galleryID; ?>" />
|
5 |
|
6 |
function flag_wp_upload_tabs ($tabs) {
|
7 |
|
8 |
+
$newtab = array('flash-album-gallery' => __('FlAGallery','flash-album-gallery'));
|
9 |
|
10 |
return array_merge($tabs,$newtab);
|
11 |
}
|
123 |
|
124 |
<div class="alignleft actions">
|
125 |
<select id="select_gal" name="select_gal" style="width:200px;">;
|
126 |
+
<option value="0" <?php selected('0', $galleryID); ?> ><?php _e('No gallery',"flash-album-gallery"); ?></option>
|
127 |
<?php
|
128 |
// Show gallery selection
|
129 |
$gallerylist = $wpdb->get_results("SELECT * FROM $wpdb->flaggallery ORDER BY gid ASC");
|
135 |
}
|
136 |
?>
|
137 |
</select>
|
138 |
+
<input type="submit" id="show-gallery" value="<?php _e('Select »','flash-album-gallery'); ?>" class="button-secondary" />
|
139 |
</div>
|
140 |
<br style="clear:both;" />
|
141 |
</div>
|
166 |
?>
|
167 |
<div id='media-item-<?php echo $picid; ?>' class='media-item preloaded'>
|
168 |
<div class='filename'></div>
|
169 |
+
<a class='toggle describe-toggle-on' href='#'><?php _e('Show', "flash-album-gallery"); ?></a>
|
170 |
+
<a class='toggle describe-toggle-off' href='#'><?php _e('Hide', "flash-album-gallery"); ?></a>
|
171 |
<div class='filename new'><?php echo ( empty($picture->alttext) ) ? wp_html_excerpt($picture->filename,60): stripslashes( wp_html_excerpt($picture->alttext,60) ); ?></div>
|
172 |
<table class='slidetoggle describe startclosed'><tbody>
|
173 |
<tr>
|
174 |
<td rowspan='4'><img class='thumbnail' alt='<?php echo esc_attr( $picture->alttext ); ?>' src='<?php echo esc_attr( $picture->thumbURL ); ?>'/></td>
|
175 |
+
<td><?php _e('Image ID:', "flash-album-gallery"); ?><?php echo $picid; ?></td>
|
176 |
</tr>
|
177 |
<tr><td><?php echo esc_attr( $picture->filename ); ?></td></tr>
|
178 |
<tr><td><?php echo esc_html( stripslashes($picture->alttext) ); ?></td></tr>
|
179 |
<tr><td> </td></tr>
|
180 |
<tr>
|
181 |
+
<td class="label"><label for="image[<?php echo $picid; ?>][alttext]"><?php _e('Alt/Title text', "flash-album-gallery"); ?></label></td>
|
182 |
<td class="field"><input id="image[<?php echo $picid; ?>][alttext]" name="image[<?php echo $picid; ?>][alttext]" value="<?php echo esc_html( stripslashes($picture->alttext) ); ?>" type="text"/></td>
|
183 |
</tr>
|
184 |
<tr>
|
185 |
+
<td class="label"><label for="image[<?php echo $picid; ?>][description]"><?php _e("Description","flash-album-gallery"); ?></label></td>
|
186 |
<td class="field"><textarea name="image[<?php echo $picid; ?>][description]" id="image[<?php echo $picid; ?>][description]"><?php echo esc_html( stripslashes($picture->description) ); ?></textarea></td>
|
187 |
</tr>
|
188 |
<tr class="align">
|
223 |
?>
|
224 |
</div>
|
225 |
<p class="ml-submit">
|
226 |
+
<input type="submit" class="button savebutton" name="save" value="<?php _e('Save all changes','flash-album-gallery'); ?>" />
|
227 |
</p>
|
228 |
<input type="hidden" name="post_id" id="post_id" value="<?php echo (int) $post_id; ?>" />
|
229 |
<input type="hidden" name="select_gal" id="select_gal" value="<?php echo (int) $galleryID; ?>" />
|
admin/meta_box.php
CHANGED
@@ -2,19 +2,17 @@
|
|
2 |
|
3 |
global $flag, $flagdb, $post;
|
4 |
require_once (dirname(__FILE__) . '/get_skin.php');
|
5 |
-
require_once (dirname(__FILE__) . '/playlist.functions.php');
|
6 |
$i_skins = get_skins();
|
7 |
-
$all_playlists = get_playlists();
|
8 |
$flag_custom = get_post_custom($post->ID);
|
9 |
$items_array = isset($flag_custom["mb_items_array"][0])? $flag_custom["mb_items_array"][0] : '';
|
10 |
$skinname = isset($flag_custom["mb_skinname"][0])? $flag_custom["mb_skinname"][0] : '';
|
11 |
$scode = isset($flag_custom["mb_scode"][0])? $flag_custom["mb_scode"][0] : '';
|
12 |
-
$music = isset($flag_custom["mb_playlist"][0])? $flag_custom["mb_playlist"][0] : '';
|
13 |
$button_text = isset($flag_custom["mb_button"][0])? $flag_custom["mb_button"][0] : '';
|
14 |
$button_link = isset($flag_custom["mb_button_link"][0])? $flag_custom["mb_button_link"][0] : '';
|
15 |
$bg_link = isset($flag_custom["mb_bg_link"][0])? $flag_custom["mb_bg_link"][0] : '';
|
16 |
-
$bg_pos = isset($flag_custom["mb_bg_pos"][0])? $flag_custom["mb_bg_pos"][0] : '';
|
17 |
-
$bg_repeat = isset($flag_custom["mb_bg_repeat"][0])? $flag_custom["mb_bg_repeat"][0] : '';
|
|
|
18 |
?>
|
19 |
<script type="text/javascript">/*<![CDATA[*/
|
20 |
var i_arr = '<?php echo $items_array; ?>';
|
@@ -23,30 +21,26 @@ jQuery(document).ready(function() {
|
|
23 |
i_arr = i_arr.split(',');
|
24 |
jQuery('#galleries :checkbox').each(function(){
|
25 |
if(jQuery.inArray(jQuery(this).val(),i_arr) > -1){
|
26 |
-
jQuery(this).
|
27 |
}
|
28 |
});
|
29 |
} else {
|
30 |
jQuery('#mb_items_array').val('all');
|
31 |
-
jQuery('#galleries input[value="all"]').
|
32 |
}
|
33 |
var galleries = 'gid='+jQuery('#mb_items_array').val();
|
34 |
var skin = jQuery('#mb_skinname option:selected').val();
|
35 |
if(skin) skin = ' skin='+skin; else skin = '';
|
36 |
-
|
37 |
-
if(playlist) playlist = ' playlist='+playlist; else playlist = '';
|
38 |
-
var wmode = jQuery('#mb_bg_link').val();
|
39 |
-
if(wmode) wmode = ' wmode=transparent'; else wmode = ' wmode=window';
|
40 |
-
short_code(galleries,skin,wmode,playlist);
|
41 |
jQuery('#galleries :checkbox').click(function(){
|
42 |
var cur, arr, del;
|
43 |
if(jQuery(this).is(':checked')){
|
44 |
cur = jQuery(this).val();
|
45 |
if(cur == 'all') {
|
46 |
-
jQuery(this).parent().siblings('.row').find('input').
|
47 |
jQuery('#mb_items_array').val(cur);
|
48 |
} else {
|
49 |
-
jQuery('#galleries input[value="all"]').
|
50 |
arr = jQuery('#mb_items_array').val();
|
51 |
if(arr && arr != 'all') { del = ','; } else { arr = ''; del = ''; }
|
52 |
jQuery('#mb_items_array').val(arr+del+cur);
|
@@ -58,12 +52,12 @@ jQuery(document).ready(function() {
|
|
58 |
if(arr) {
|
59 |
jQuery('#mb_items_array').val(arr);
|
60 |
} else {
|
61 |
-
jQuery('#galleries input[value="all"]').
|
62 |
jQuery('#mb_items_array').val('all');
|
63 |
}
|
64 |
}
|
65 |
galleries = 'gid='+jQuery('#mb_items_array').val();
|
66 |
-
short_code(galleries,skin
|
67 |
});
|
68 |
jQuery('#mb_skinname').change(function(){
|
69 |
skin = jQuery(this).val();
|
@@ -72,38 +66,28 @@ jQuery(document).ready(function() {
|
|
72 |
} else {
|
73 |
skin = '';
|
74 |
}
|
75 |
-
short_code(galleries,skin
|
76 |
-
});
|
77 |
-
jQuery('#mb_playlist').change(function(){
|
78 |
-
playlist = jQuery(this).val();
|
79 |
-
if(playlist) {
|
80 |
-
playlist = ' playlist='+playlist;
|
81 |
-
} else {
|
82 |
-
playlist = '';
|
83 |
-
}
|
84 |
-
short_code(galleries,skin,wmode,playlist);
|
85 |
-
});
|
86 |
-
jQuery('#mb_bg_link').change(function(){
|
87 |
-
wmode = jQuery(this).val();
|
88 |
-
if(wmode) {
|
89 |
-
wmode = ' wmode=transparent';
|
90 |
-
} else {
|
91 |
-
wmode = ' wmode=window';
|
92 |
-
}
|
93 |
-
short_code(galleries,skin,wmode,playlist);
|
94 |
});
|
95 |
});
|
96 |
-
function short_code(galleries,skin
|
97 |
-
jQuery('#mb_scode').val('[flagallery '+galleries+' w=100% h=100%'+skin+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
98 |
}
|
|
|
99 |
/*]]>*/</script>
|
100 |
<div class="wrap">
|
101 |
<form id="generator1">
|
102 |
<table border="0" cellpadding="4" cellspacing="0" style="width: 90%;">
|
103 |
<tr>
|
104 |
-
<td nowrap="nowrap" valign="top" style="width: 10%;"><div><?php _e("Select galleries", '
|
105 |
<td valign="top"><div id="galleries" style="width: 214px; height: 160px; overflow: auto;">
|
106 |
-
<div class="row"><input type="checkbox" value="all" /> <strong>* - <?php _e("all galleries", '
|
107 |
<?php
|
108 |
$gallerylist = $flagdb->find_all_galleries($flag->options['albSort'], $flag->options['albSortDir']);
|
109 |
if(is_array($gallerylist)) {
|
@@ -118,13 +102,13 @@ function short_code(galleries,skin,wmode,playlist) {
|
|
118 |
</div></td>
|
119 |
</tr>
|
120 |
<tr>
|
121 |
-
<td nowrap="nowrap" valign="top"><p style="padding-top:3px;"><?php _e("Galleries order", '
|
122 |
<td valign="top"><p><input readonly="readonly" type="text" id="mb_items_array" name="mb_items_array" value="<?php echo $items_array; ?>" style="width: 98%;" /></p></td>
|
123 |
</tr>
|
124 |
<tr>
|
125 |
-
<td nowrap="nowrap" valign="top"><p style="padding-top:3px;"><label for="mb_skinname"><?php _e("Choose skin", '
|
126 |
<td valign="top"><p><select id="mb_skinname" name="mb_skinname">
|
127 |
-
<option value="" <?php selected($skinname,''); ?>><?php _e("skin active by default", '
|
128 |
<?php
|
129 |
foreach ( (array)$i_skins as $skin_file => $skin_data) {
|
130 |
echo '<option value="'.dirname($skin_file).'" '.selected($skinname,dirname($skin_file),false).'>'.$skin_data['Name'].'</option>'."\n";
|
@@ -135,37 +119,23 @@ function short_code(galleries,skin,wmode,playlist) {
|
|
135 |
</td>
|
136 |
</tr>
|
137 |
<tr>
|
138 |
-
<td nowrap="nowrap" valign="top"><div style="padding-top: 3px;"><?php _e("Back Button Text", '
|
139 |
-
<td valign="top"><input id="mb_button" name="mb_button" type="text" style="width: 49%;" placeholder="
|
140 |
-
<small><?php _e("Leave empty to hide Back button", 'flag'); ?></small></td>
|
141 |
</tr>
|
142 |
<tr>
|
143 |
-
<td nowrap="nowrap" valign="top"><div style="padding-top: 3px;"><?php _e("Back Button Link", '
|
144 |
<td valign="top"><input id="mb_button_link" name="mb_button_link" type="text" style="width: 49%;" placeholder="<?php echo home_url(); ?>" value="<?php echo $button_link; ?>" /><br />
|
145 |
-
<small><?php _e("Leave empty to use referer link", '
|
146 |
-
</tr>
|
147 |
-
<tr>
|
148 |
-
<td nowrap="nowrap" valign="top"><div style="padding-top: 3px;"><?php _e("Music", 'flag'); ?>: </div></td>
|
149 |
-
<td valign="top"><select id="mb_playlist" name="mb_playlist">
|
150 |
-
<option value="" selected="selected" <?php selected($music,''); ?>><?php _e("choose playlist", 'flag'); ?></option>
|
151 |
-
<?php
|
152 |
-
foreach((array)$all_playlists as $playlist_file => $playlist_data) {
|
153 |
-
$playlist_name = basename($playlist_file, '.xml');
|
154 |
-
?>
|
155 |
-
<option value="<?php echo $playlist_name; ?>" <?php selected($music,$playlist_name); ?>><?php echo $playlist_data['title']; ?></option>
|
156 |
-
<?php
|
157 |
-
}
|
158 |
-
?>
|
159 |
-
</select><br />
|
160 |
-
<small><?php _e("(optional) Read Skin specification for supporting this function.", 'flag'); ?></small></td>
|
161 |
</tr>
|
162 |
<tr>
|
163 |
-
<td nowrap="nowrap" valign="top"><div style="padding-top: 3px;"><?php _e("Background Image Link", '
|
164 |
-
<td valign="top"
|
165 |
-
|
|
|
|
|
166 |
</tr>
|
167 |
<tr>
|
168 |
-
<td nowrap="nowrap" valign="top"><div style="padding-top: 3px;"><?php _e("Background Position", '
|
169 |
<td valign="top"><select id="mb_bg_pos" name="mb_bg_pos">
|
170 |
<option value="center center" <?php selected($bg_pos,'center center'); ?>>center center</option>
|
171 |
<option value="left top" <?php selected($bg_pos,'left top'); ?>>left top</option>
|
@@ -179,7 +149,7 @@ function short_code(galleries,skin,wmode,playlist) {
|
|
179 |
</select></td>
|
180 |
</tr>
|
181 |
<tr>
|
182 |
-
<td nowrap="nowrap" valign="top"><div style="padding-top: 3px;"><?php _e("Background Repeat", '
|
183 |
<td valign="top"><select id="mb_bg_repeat" name="mb_bg_repeat">
|
184 |
<option value="repeat" <?php selected($bg_repeat,'repeat'); ?>>repeat</option>
|
185 |
<option value="repeat-x" <?php selected($bg_repeat,'repeat-x'); ?>>repeat-x</option>
|
@@ -187,6 +157,14 @@ function short_code(galleries,skin,wmode,playlist) {
|
|
187 |
<option value="no-repeat" <?php selected($bg_repeat,'no-repeat'); ?>>no-repeat</option>
|
188 |
</select></td>
|
189 |
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
190 |
</table>
|
191 |
</form>
|
192 |
</div>
|
2 |
|
3 |
global $flag, $flagdb, $post;
|
4 |
require_once (dirname(__FILE__) . '/get_skin.php');
|
|
|
5 |
$i_skins = get_skins();
|
|
|
6 |
$flag_custom = get_post_custom($post->ID);
|
7 |
$items_array = isset($flag_custom["mb_items_array"][0])? $flag_custom["mb_items_array"][0] : '';
|
8 |
$skinname = isset($flag_custom["mb_skinname"][0])? $flag_custom["mb_skinname"][0] : '';
|
9 |
$scode = isset($flag_custom["mb_scode"][0])? $flag_custom["mb_scode"][0] : '';
|
|
|
10 |
$button_text = isset($flag_custom["mb_button"][0])? $flag_custom["mb_button"][0] : '';
|
11 |
$button_link = isset($flag_custom["mb_button_link"][0])? $flag_custom["mb_button_link"][0] : '';
|
12 |
$bg_link = isset($flag_custom["mb_bg_link"][0])? $flag_custom["mb_bg_link"][0] : '';
|
13 |
+
$bg_pos = isset($flag_custom["mb_bg_pos"][0])? $flag_custom["mb_bg_pos"][0] : 'center center';
|
14 |
+
$bg_repeat = isset($flag_custom["mb_bg_repeat"][0])? $flag_custom["mb_bg_repeat"][0] : 'repeat';
|
15 |
+
$bg_size = isset($flag_custom["mb_bg_size"][0])? $flag_custom["mb_bg_size"][0] : 'auto';
|
16 |
?>
|
17 |
<script type="text/javascript">/*<![CDATA[*/
|
18 |
var i_arr = '<?php echo $items_array; ?>';
|
21 |
i_arr = i_arr.split(',');
|
22 |
jQuery('#galleries :checkbox').each(function(){
|
23 |
if(jQuery.inArray(jQuery(this).val(),i_arr) > -1){
|
24 |
+
jQuery(this).prop('checked',true);
|
25 |
}
|
26 |
});
|
27 |
} else {
|
28 |
jQuery('#mb_items_array').val('all');
|
29 |
+
jQuery('#galleries input[value="all"]').prop('checked',true).parent().siblings('.row').find('input').prop('checked', false);
|
30 |
}
|
31 |
var galleries = 'gid='+jQuery('#mb_items_array').val();
|
32 |
var skin = jQuery('#mb_skinname option:selected').val();
|
33 |
if(skin) skin = ' skin='+skin; else skin = '';
|
34 |
+
short_code(galleries,skin);
|
|
|
|
|
|
|
|
|
35 |
jQuery('#galleries :checkbox').click(function(){
|
36 |
var cur, arr, del;
|
37 |
if(jQuery(this).is(':checked')){
|
38 |
cur = jQuery(this).val();
|
39 |
if(cur == 'all') {
|
40 |
+
jQuery(this).parent().siblings('.row').find('input').prop('checked', false);
|
41 |
jQuery('#mb_items_array').val(cur);
|
42 |
} else {
|
43 |
+
jQuery('#galleries input[value="all"]').prop('checked', false);
|
44 |
arr = jQuery('#mb_items_array').val();
|
45 |
if(arr && arr != 'all') { del = ','; } else { arr = ''; del = ''; }
|
46 |
jQuery('#mb_items_array').val(arr+del+cur);
|
52 |
if(arr) {
|
53 |
jQuery('#mb_items_array').val(arr);
|
54 |
} else {
|
55 |
+
jQuery('#galleries input[value="all"]').prop('checked',true);
|
56 |
jQuery('#mb_items_array').val('all');
|
57 |
}
|
58 |
}
|
59 |
galleries = 'gid='+jQuery('#mb_items_array').val();
|
60 |
+
short_code(galleries,skin);
|
61 |
});
|
62 |
jQuery('#mb_skinname').change(function(){
|
63 |
skin = jQuery(this).val();
|
66 |
} else {
|
67 |
skin = '';
|
68 |
}
|
69 |
+
short_code(galleries,skin);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
70 |
});
|
71 |
});
|
72 |
+
function short_code(galleries,skin) {
|
73 |
+
jQuery('#mb_scode').val('[flagallery '+galleries+' w=100% h=100%'+skin+' fullwindow=true]');
|
74 |
+
}
|
75 |
+
var current_image = '';
|
76 |
+
function send_to_editor(html){
|
77 |
+
var source = html.match(/src=\".*\" alt/);
|
78 |
+
source = source[0].replace(/^src=\"/, "").replace(/" alt$/, "");
|
79 |
+
jQuery('#mb_bg_link').val(source);
|
80 |
+
tb_remove();
|
81 |
}
|
82 |
+
|
83 |
/*]]>*/</script>
|
84 |
<div class="wrap">
|
85 |
<form id="generator1">
|
86 |
<table border="0" cellpadding="4" cellspacing="0" style="width: 90%;">
|
87 |
<tr>
|
88 |
+
<td nowrap="nowrap" valign="top" style="width: 10%;"><div><?php _e("Select galleries", 'flash-album-gallery'); ?>:<span style="color:red;"> *</span><br /><small><?php _e("(album categories)", 'flash-album-gallery'); ?></small></div></td>
|
89 |
<td valign="top"><div id="galleries" style="width: 214px; height: 160px; overflow: auto;">
|
90 |
+
<div class="row"><input type="checkbox" value="all" /> <strong>* - <?php _e("all galleries", 'flash-album-gallery'); ?></strong></div>
|
91 |
<?php
|
92 |
$gallerylist = $flagdb->find_all_galleries($flag->options['albSort'], $flag->options['albSortDir']);
|
93 |
if(is_array($gallerylist)) {
|
102 |
</div></td>
|
103 |
</tr>
|
104 |
<tr>
|
105 |
+
<td nowrap="nowrap" valign="top"><p style="padding-top:3px;"><?php _e("Galleries order", 'flash-album-gallery'); ?>: </p></td>
|
106 |
<td valign="top"><p><input readonly="readonly" type="text" id="mb_items_array" name="mb_items_array" value="<?php echo $items_array; ?>" style="width: 98%;" /></p></td>
|
107 |
</tr>
|
108 |
<tr>
|
109 |
+
<td nowrap="nowrap" valign="top"><p style="padding-top:3px;"><label for="mb_skinname"><?php _e("Choose skin", 'flash-album-gallery'); ?>:</label></p></td>
|
110 |
<td valign="top"><p><select id="mb_skinname" name="mb_skinname">
|
111 |
+
<option value="" <?php selected($skinname,''); ?>><?php _e("skin active by default", 'flash-album-gallery'); ?></option>
|
112 |
<?php
|
113 |
foreach ( (array)$i_skins as $skin_file => $skin_data) {
|
114 |
echo '<option value="'.dirname($skin_file).'" '.selected($skinname,dirname($skin_file),false).'>'.$skin_data['Name'].'</option>'."\n";
|
119 |
</td>
|
120 |
</tr>
|
121 |
<tr>
|
122 |
+
<td nowrap="nowrap" valign="top"><div style="padding-top: 3px;"><?php _e("Back Button Text", 'flash-album-gallery'); ?>: </div></td>
|
123 |
+
<td valign="top"><input id="mb_button" name="mb_button" type="text" style="width: 49%;" placeholder="<?php _e('Go Back', 'flash-album-gallery'); ?>" value="<?php echo $button_text; ?>" /></td>
|
|
|
124 |
</tr>
|
125 |
<tr>
|
126 |
+
<td nowrap="nowrap" valign="top"><div style="padding-top: 3px;"><?php _e("Back Button Link", 'flash-album-gallery'); ?>: </div></td>
|
127 |
<td valign="top"><input id="mb_button_link" name="mb_button_link" type="text" style="width: 49%;" placeholder="<?php echo home_url(); ?>" value="<?php echo $button_link; ?>" /><br />
|
128 |
+
<small><?php _e("Leave empty to use referer link", 'flash-album-gallery'); ?></small></td>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
129 |
</tr>
|
130 |
<tr>
|
131 |
+
<td nowrap="nowrap" valign="top"><div style="padding-top: 3px;"><?php _e("Background Image Link", 'flash-album-gallery'); ?>: </div></td>
|
132 |
+
<td valign="top">
|
133 |
+
<input id="mb_bg_link" name="mb_bg_link" type="text" style="width: 49%;" value="<?php echo $bg_link; ?>" />
|
134 |
+
<a class="thickbox" href="media-upload.php?type=image&TB_iframe=1&width=640&height=400" title="<?php _e('Add an Image', 'flash-album-gallery'); ?>"><?php _e('assist', 'flash-album-gallery'); ?></a>
|
135 |
+
</td>
|
136 |
</tr>
|
137 |
<tr>
|
138 |
+
<td nowrap="nowrap" valign="top"><div style="padding-top: 3px;"><?php _e("Background Position", 'flash-album-gallery'); ?>:</div></td>
|
139 |
<td valign="top"><select id="mb_bg_pos" name="mb_bg_pos">
|
140 |
<option value="center center" <?php selected($bg_pos,'center center'); ?>>center center</option>
|
141 |
<option value="left top" <?php selected($bg_pos,'left top'); ?>>left top</option>
|
149 |
</select></td>
|
150 |
</tr>
|
151 |
<tr>
|
152 |
+
<td nowrap="nowrap" valign="top"><div style="padding-top: 3px;"><?php _e("Background Repeat", 'flash-album-gallery'); ?>:</div></td>
|
153 |
<td valign="top"><select id="mb_bg_repeat" name="mb_bg_repeat">
|
154 |
<option value="repeat" <?php selected($bg_repeat,'repeat'); ?>>repeat</option>
|
155 |
<option value="repeat-x" <?php selected($bg_repeat,'repeat-x'); ?>>repeat-x</option>
|
157 |
<option value="no-repeat" <?php selected($bg_repeat,'no-repeat'); ?>>no-repeat</option>
|
158 |
</select></td>
|
159 |
</tr>
|
160 |
+
<tr>
|
161 |
+
<td nowrap="nowrap" valign="top"><div style="padding-top: 3px;"><?php _e("Background Size", 'flash-album-gallery'); ?>:</div></td>
|
162 |
+
<td valign="top"><select id="mb_bg_size" name="mb_bg_size">
|
163 |
+
<option value="auto" <?php selected($bg_size,'auto'); ?>>auto</option>
|
164 |
+
<option value="contain" <?php selected($bg_size,'contain'); ?>>contain</option>
|
165 |
+
<option value="cover" <?php selected($bg_size,'cover'); ?>>cover</option>
|
166 |
+
</select></td>
|
167 |
+
</tr>
|
168 |
</table>
|
169 |
</form>
|
170 |
</div>
|
admin/music-box.php
CHANGED
@@ -96,7 +96,7 @@ function flag_music_controler(){
|
|
96 |
if(isset($_POST['updateMedia'])){
|
97 |
check_admin_referer('flag_update');
|
98 |
flagGallery::flagSaveWpMedia();
|
99 |
-
flagGallery::show_message(__('Media updated', '
|
100 |
}
|
101 |
default:
|
102 |
flag_created_playlists();
|
@@ -116,15 +116,15 @@ function flag_created_playlists(){
|
|
116 |
|
117 |
?>
|
118 |
<div class="flag-wrap">
|
119 |
-
<h2><?php _e('Created playlists', '
|
120 |
<table class="widefat flag-table" cellspacing="0">
|
121 |
<thead>
|
122 |
<tr>
|
123 |
-
<th scope="col" width="25%"><?php _e('Title', '
|
124 |
-
<th scope="col" width="55%"><?php _e('Description', '
|
125 |
-
<th scope="col"><?php _e('Quantity', '
|
126 |
-
<th scope="col"><?php _e('Shortcode', '
|
127 |
-
<th scope="col"><?php _e('Action', '
|
128 |
</tr>
|
129 |
</thead>
|
130 |
<tbody>
|
@@ -145,18 +145,18 @@ function flag_created_playlists(){
|
|
145 |
</a>
|
146 |
</td>
|
147 |
<td><?php echo esc_html($playlist_data['description']);
|
148 |
-
echo ' (' . __("player", "
|
149 |
<td><?php echo count($query_m); ?></td>
|
150 |
<td style="white-space: nowrap;"><input type="text" class="shortcode1" style="width: 200px; font-size: 9px;" readonly="readonly" onfocus="this.select()" value="[grandmusic playlist=<?php echo $playlist_name; ?>]"/></td>
|
151 |
<td>
|
152 |
-
<a href="<?php echo wp_nonce_url($filepath . '&playlist=' . $playlist_name . "&mode=delete", 'flag_delete'); ?>" class="delete" onclick="javascript:check=confirm( '<?php _e("Delete this playlist?", '
|
153 |
-
}"><?php _e('Delete', '
|
154 |
</td>
|
155 |
</tr>
|
156 |
<?php
|
157 |
}
|
158 |
} else{
|
159 |
-
echo '<tr><td colspan="5" align="center"><strong>' . __('No playlists found', '
|
160 |
}
|
161 |
?>
|
162 |
</tbody>
|
@@ -264,7 +264,7 @@ function flag_music_wp_media_lib($added = false){
|
|
264 |
// this function check for a the number of selected images, sumbmit false when no one selected
|
265 |
function checkSelected(){
|
266 |
if(!jQuery('#items_array').val()){
|
267 |
-
alert('<?php echo esc_js(__("No items selected", "
|
268 |
return false;
|
269 |
}
|
270 |
var actionId = jQuery('#bulkaction').val();
|
@@ -318,29 +318,29 @@ function flag_music_wp_media_lib($added = false){
|
|
318 |
|
319 |
<!-- import folder -->
|
320 |
<div id="importfolder">
|
321 |
-
<h2><?php _e('Import mp3 from folder', '
|
322 |
|
323 |
<form name="importfolder" id="importfolder_form" method="POST" action="<?php echo $filepath; ?>" accept-charset="utf-8">
|
324 |
<?php wp_nonce_field('flag_addmp3'); ?>
|
325 |
<table class="form-table">
|
326 |
<tr valign="top">
|
327 |
-
<th scope="row"><?php _e('Import from Server path:', '
|
328 |
-
<td><input type="text" size="35" id="mp3folder" name="mp3folder" value="<?php echo $defaultpath; ?>"/><span class="browsefiles button" style="display:none"><?php _e('Browse...', "
|
329 |
|
330 |
<div id="file_browser"></div>
|
331 |
<br/>
|
332 |
<p><label><input type="checkbox" name="delete_files" value="delete"/>
|
333 |
-
<?php _e('delete files after import in WordPress Media Library', '
|
334 |
</td>
|
335 |
</tr>
|
336 |
</table>
|
337 |
-
<div class="submit"><input class="button-primary" type="submit" name="importfolder" value="<?php _e('Import folder', '
|
338 |
</form>
|
339 |
</div>
|
340 |
<?php } ?>
|
341 |
<?php } ?>
|
342 |
|
343 |
-
<h2><?php _e('WordPress Music Library', '
|
344 |
<?php
|
345 |
// look for pagination
|
346 |
if(!isset($_GET['paged']) || $_GET['paged'] < 1){
|
@@ -350,14 +350,14 @@ function flag_music_wp_media_lib($added = false){
|
|
350 |
$_GET['paged'] = intval($_GET['paged']);
|
351 |
$objects_per_page = 25;
|
352 |
$start = ($_GET['paged'] - 1) * $objects_per_page;
|
353 |
-
$img_total_count = $wpdb->get_var("SELECT COUNT(ID) FROM $wpdb->posts WHERE `post_mime_type`
|
354 |
$musiclist = get_posts($args = array(
|
355 |
'numberposts' => $objects_per_page,
|
356 |
'offset' => $start,
|
357 |
'orderby' => 'ID',
|
358 |
'order' => 'DESC',
|
359 |
'post_type' => 'attachment',
|
360 |
-
'post_mime_type' => 'audio
|
361 |
));
|
362 |
|
363 |
// build pagination
|
@@ -373,8 +373,8 @@ function flag_music_wp_media_lib($added = false){
|
|
373 |
?>
|
374 |
<div class="tablenav" style="overflow: hidden; height: auto;">
|
375 |
<?php if($added === false){ ?>
|
376 |
-
<div class="alignleft"><b><?php _e('Selected Media', '
|
377 |
-
<span class="clear_selected button"><?php _e('Clear Selected', '
|
378 |
<?php } ?>
|
379 |
<div class="tablenav-pages"><?php $page_links_text = sprintf('<span class="displaying-num">' . __('Displaying %s–%s of %s') . '</span>%s', number_format_i18n(($_GET['paged'] - 1) * $objects_per_page + 1), number_format_i18n(min($_GET['paged'] * $objects_per_page, $img_total_count)), number_format_i18n($img_total_count), $page_links);
|
380 |
echo $page_links_text; ?></div>
|
@@ -387,16 +387,16 @@ function flag_music_wp_media_lib($added = false){
|
|
387 |
|
388 |
<div class="actions">
|
389 |
<?php if($added === false){ ?>
|
390 |
-
<input name="updateMedia" class="button-primary" style="float: right;" type="submit" value="<?php _e('Update Media', '
|
391 |
<?php if(function_exists('json_encode')){ ?>
|
392 |
<select name="bulkaction" id="bulkaction">
|
393 |
-
<option value="no_action"><?php _e("No action", '
|
394 |
-
<option value="new_playlist"><?php _e("Create new playlist", '
|
395 |
</select>
|
396 |
-
<input name="showThickbox" class="button-secondary" type="submit" value="<?php _e('Apply', '
|
397 |
}"/>
|
398 |
<?php } ?>
|
399 |
-
<a href="<?php echo admin_url('media-new.php'); ?>" class="button"><?php _e('Upload Music', '
|
400 |
<input type="hidden" id="items_array" name="items_array" value=""/>
|
401 |
<?php } else{ ?>
|
402 |
<input type="hidden" name="mode" value="save"/>
|
@@ -405,7 +405,7 @@ function flag_music_wp_media_lib($added = false){
|
|
405 |
<input type="hidden" name="skinname" value="<?php echo sanitize_flagname($playlist['skin']); ?>"/>
|
406 |
<input type="hidden" name="skinaction" value="<?php echo sanitize_flagname($playlist['skin']); ?>"/>
|
407 |
<textarea style="display: none;" name="playlist_descr" cols="40" rows="1"><?php echo esc_html($playlist['description']); ?></textarea>
|
408 |
-
<input name="addToPlaylist" class="button-secondary" type="submit" value="<?php _e('Update Playlist', '
|
409 |
<?php } ?>
|
410 |
</div>
|
411 |
|
@@ -413,32 +413,32 @@ function flag_music_wp_media_lib($added = false){
|
|
413 |
<table class="widefat flag-table" cellspacing="0">
|
414 |
<thead>
|
415 |
<tr>
|
416 |
-
<th class="cb" width="54" scope="col"><a href="#" onclick="checkAll(document.getElementById('musiclib'));return false;"><?php _e('Check', '
|
417 |
<th class="id" width="134" scope="col">
|
418 |
-
<div><?php _e('ID', '
|
419 |
</th>
|
420 |
<th class="size" width="75" scope="col">
|
421 |
-
<div><?php _e('Size', '
|
422 |
</th>
|
423 |
<th class="thumb" width="110" scope="col">
|
424 |
-
<div><?php _e('Thumbnail', '
|
425 |
</th>
|
426 |
<th class="title_filename" scope="col">
|
427 |
-
<div><?php _e('Filename / Title', '
|
428 |
</th>
|
429 |
<th class="description" scope="col">
|
430 |
-
<div><?php _e('Description', '
|
431 |
</th>
|
432 |
</tr>
|
433 |
</thead>
|
434 |
<tfoot>
|
435 |
<tr>
|
436 |
-
<th class="cb" scope="col"><a href="#" onclick="checkAll(document.getElementById('musiclib'));return false;"><?php _e('Check', '
|
437 |
-
<th class="id" scope="col"><?php _e('ID', '
|
438 |
-
<th class="size" scope="col"><?php _e('Size', '
|
439 |
-
<th class="thumb" scope="col"><?php _e('Thumbnail', '
|
440 |
-
<th class="title_filename" scope="col"><?php _e('Filename / Title', '
|
441 |
-
<th class="description" scope="col"><?php _e('Description', '
|
442 |
</tr>
|
443 |
</tfoot>
|
444 |
<?php
|
@@ -454,7 +454,7 @@ function flag_music_wp_media_lib($added = false){
|
|
454 |
$ex = $checked = '';
|
455 |
if(($added !== false || !empty($items_array_default)) && in_array($mp3->ID, $exclude)){
|
456 |
$class .= ' already-added';
|
457 |
-
$ex = ' title="' . __("Already Added", "
|
458 |
$checked = ' checked="checked"';
|
459 |
}
|
460 |
$thumb = $mp3thumb = get_post_meta($mp3->ID, 'thumbnail', true);
|
@@ -474,7 +474,7 @@ function flag_music_wp_media_lib($added = false){
|
|
474 |
if($size){
|
475 |
echo round($size / 1024 / 1024, 2) . ' Mb';
|
476 |
} else{
|
477 |
-
_e("Can't read file size. Perhaps file is broken.", '
|
478 |
}
|
479 |
?></td>
|
480 |
<td class="thumb" rowspan="2">
|
@@ -483,8 +483,8 @@ function flag_music_wp_media_lib($added = false){
|
|
483 |
<td class="title_filename" rowspan="2">
|
484 |
<strong><a href="<?php echo $url; ?>"><?php echo basename($url); ?></a></strong><br/>
|
485 |
<textarea title="Title" name="item_a[<?php echo $mp3->ID; ?>][post_title]" cols="20" rows="1" style="width:95%; height: 25px; overflow:hidden;"><?php echo esc_html(stripslashes($mp3->post_title)); ?></textarea><br/>
|
486 |
-
<p><?php _e('Thumb URL:', '
|
487 |
-
<a class="thickbox" onclick="actInp=<?php echo $mp3->ID; ?>" href="media-upload.php?type=image&TB_iframe=1&width=640&height=400" title="<?php _e('Add an Image', '
|
488 |
</p>
|
489 |
</td>
|
490 |
<td class="description" rowspan="2">
|
@@ -493,13 +493,7 @@ function flag_music_wp_media_lib($added = false){
|
|
493 |
</tr>
|
494 |
<tr class="mp3-<?php echo $mp3->ID; ?>">
|
495 |
<td valign="top" class="player" colspan="3">
|
496 |
-
|
497 |
-
path: "<?php echo str_replace(array('.mp3'), array(''), $url); ?>",
|
498 |
-
bgcolor: "<?php echo $flag_options['mpBG'] ?>",
|
499 |
-
color1: "<?php echo $flag_options['mpColor1'] ?>",
|
500 |
-
color2: "<?php echo $flag_options['mpColor2'] ?>"
|
501 |
-
}, {wmode: "transparent"}, {id: "f-<?php echo $mp3->ID; ?>", name: "f-<?php echo $mp3->ID; ?>"});</script>
|
502 |
-
<div class="play" style="padding-left: 4px;"><span id="c-<?php echo $mp3->ID; ?>"></span></div>
|
503 |
<p style="padding: 7px 3px;">Shortcode: <input type="text" class="shortcode1" readonly="readonly" style="width: 180px; font-size: 9px;" onfocus="this.select()" value="[grandmp3 id=<?php echo $mp3->ID; ?> autoplay=<?php echo $flag_options['mpAutoplay']; ?>]"/>
|
504 |
</p></td>
|
505 |
</tr>
|
@@ -507,7 +501,7 @@ function flag_music_wp_media_lib($added = false){
|
|
507 |
<?php
|
508 |
}
|
509 |
} else{
|
510 |
-
echo '<tr><td colspan="6" align="center"><strong>' . __('No music in WordPress Media Library.', '
|
511 |
}
|
512 |
?>
|
513 |
</table>
|
@@ -524,10 +518,10 @@ function flag_music_wp_media_lib($added = false){
|
|
524 |
<input type="hidden" name="page" value="music-box"/>
|
525 |
<table width="100%" border="0" cellspacing="3" cellpadding="3">
|
526 |
<tr valign="top">
|
527 |
-
<th align="left" style="padding-top: 5px;"><?php _e('Playlist Title', '
|
528 |
<td><input type="text" class="alignleft" name="playlist_title" value=""/>
|
529 |
|
530 |
-
<div class="alignright"><strong><?php _e("Choose skin", '
|
531 |
<select id="skinname" name="skinname" style="width: 200px; height: 24px; font-size: 11px;">
|
532 |
<?php require_once(dirname(__FILE__) . '/get_skin.php');
|
533 |
$all_skins = get_skins($skin_folder = '', $type = 'm');
|
@@ -536,7 +530,7 @@ function flag_music_wp_media_lib($added = false){
|
|
536 |
echo '<option value="' . dirname($skin_file) . '">' . $skin_data['Name'] . '</option>' . "\n";
|
537 |
}
|
538 |
} else{
|
539 |
-
echo '<option value="music_default">' . __("No Skins", "
|
540 |
}
|
541 |
?>
|
542 |
</select>
|
@@ -544,14 +538,14 @@ function flag_music_wp_media_lib($added = false){
|
|
544 |
</td>
|
545 |
</tr>
|
546 |
<tr valign="top">
|
547 |
-
<th align="left" style="padding-top: 5px;"><?php _e('Playlist Description', '
|
548 |
<td><textarea style="width:100%;" rows="3" cols="60" name="playlist_descr"></textarea></td>
|
549 |
</tr>
|
550 |
<tr>
|
551 |
<td> </td>
|
552 |
-
<td align="right"><input class="button-secondary" type="reset" value=" <?php _e('Cancel', '
|
553 |
|
554 |
-
<input class="button-primary " type="submit" name="TB_NewPlaylist" value="<?php _e('OK', '
|
555 |
</td>
|
556 |
</tr>
|
557 |
</table>
|
96 |
if(isset($_POST['updateMedia'])){
|
97 |
check_admin_referer('flag_update');
|
98 |
flagGallery::flagSaveWpMedia();
|
99 |
+
flagGallery::show_message(__('Media updated', 'flash-album-gallery'));
|
100 |
}
|
101 |
default:
|
102 |
flag_created_playlists();
|
116 |
|
117 |
?>
|
118 |
<div class="flag-wrap">
|
119 |
+
<h2><?php _e('Created playlists', 'flash-album-gallery'); ?></h2>
|
120 |
<table class="widefat flag-table" cellspacing="0">
|
121 |
<thead>
|
122 |
<tr>
|
123 |
+
<th scope="col" width="25%"><?php _e('Title', 'flash-album-gallery'); ?></th>
|
124 |
+
<th scope="col" width="55%"><?php _e('Description', 'flash-album-gallery'); ?></th>
|
125 |
+
<th scope="col"><?php _e('Quantity', 'flash-album-gallery'); ?></th>
|
126 |
+
<th scope="col"><?php _e('Shortcode', 'flash-album-gallery'); ?></th>
|
127 |
+
<th scope="col"><?php _e('Action', 'flash-album-gallery'); ?></th>
|
128 |
</tr>
|
129 |
</thead>
|
130 |
<tbody>
|
145 |
</a>
|
146 |
</td>
|
147 |
<td><?php echo esc_html($playlist_data['description']);
|
148 |
+
echo ' (' . __("player", "flash-album-gallery") . ': <strong>' . esc_html($playlist_data['skin']) . '</strong>)' ?></td>
|
149 |
<td><?php echo count($query_m); ?></td>
|
150 |
<td style="white-space: nowrap;"><input type="text" class="shortcode1" style="width: 200px; font-size: 9px;" readonly="readonly" onfocus="this.select()" value="[grandmusic playlist=<?php echo $playlist_name; ?>]"/></td>
|
151 |
<td>
|
152 |
+
<a href="<?php echo wp_nonce_url($filepath . '&playlist=' . $playlist_name . "&mode=delete", 'flag_delete'); ?>" class="delete" onclick="javascript:check=confirm( '<?php _e("Delete this playlist?", 'flash-album-gallery') ?>');if(check==false) {return false;
|
153 |
+
}"><?php _e('Delete', 'flash-album-gallery'); ?></a>
|
154 |
</td>
|
155 |
</tr>
|
156 |
<?php
|
157 |
}
|
158 |
} else{
|
159 |
+
echo '<tr><td colspan="5" align="center"><strong>' . __('No playlists found', 'flash-album-gallery') . '</strong></td></tr>';
|
160 |
}
|
161 |
?>
|
162 |
</tbody>
|
264 |
// this function check for a the number of selected images, sumbmit false when no one selected
|
265 |
function checkSelected(){
|
266 |
if(!jQuery('#items_array').val()){
|
267 |
+
alert('<?php echo esc_js(__("No items selected", "flash-album-gallery")); ?>');
|
268 |
return false;
|
269 |
}
|
270 |
var actionId = jQuery('#bulkaction').val();
|
318 |
|
319 |
<!-- import folder -->
|
320 |
<div id="importfolder">
|
321 |
+
<h2><?php _e('Import mp3 from folder', 'flash-album-gallery'); ?></h2>
|
322 |
|
323 |
<form name="importfolder" id="importfolder_form" method="POST" action="<?php echo $filepath; ?>" accept-charset="utf-8">
|
324 |
<?php wp_nonce_field('flag_addmp3'); ?>
|
325 |
<table class="form-table">
|
326 |
<tr valign="top">
|
327 |
+
<th scope="row"><?php _e('Import from Server path:', 'flash-album-gallery'); ?></th>
|
328 |
+
<td><input type="text" size="35" id="mp3folder" name="mp3folder" value="<?php echo $defaultpath; ?>"/><span class="browsefiles button" style="display:none"><?php _e('Browse...', "flash-album-gallery"); ?></span>
|
329 |
|
330 |
<div id="file_browser"></div>
|
331 |
<br/>
|
332 |
<p><label><input type="checkbox" name="delete_files" value="delete"/>
|
333 |
+
<?php _e('delete files after import in WordPress Media Library', 'flash-album-gallery'); ?></label></p>
|
334 |
</td>
|
335 |
</tr>
|
336 |
</table>
|
337 |
+
<div class="submit"><input class="button-primary" type="submit" name="importfolder" value="<?php _e('Import folder', 'flash-album-gallery'); ?>"/></div>
|
338 |
</form>
|
339 |
</div>
|
340 |
<?php } ?>
|
341 |
<?php } ?>
|
342 |
|
343 |
+
<h2><?php _e('WordPress Music Library', 'flash-album-gallery'); ?></h2>
|
344 |
<?php
|
345 |
// look for pagination
|
346 |
if(!isset($_GET['paged']) || $_GET['paged'] < 1){
|
350 |
$_GET['paged'] = intval($_GET['paged']);
|
351 |
$objects_per_page = 25;
|
352 |
$start = ($_GET['paged'] - 1) * $objects_per_page;
|
353 |
+
$img_total_count = $wpdb->get_var("SELECT COUNT(ID) FROM $wpdb->posts WHERE `post_mime_type` LIKE 'audio/%' AND `post_type` = 'attachment' AND `post_status` = 'inherit'");
|
354 |
$musiclist = get_posts($args = array(
|
355 |
'numberposts' => $objects_per_page,
|
356 |
'offset' => $start,
|
357 |
'orderby' => 'ID',
|
358 |
'order' => 'DESC',
|
359 |
'post_type' => 'attachment',
|
360 |
+
'post_mime_type' => 'audio/*'
|
361 |
));
|
362 |
|
363 |
// build pagination
|
373 |
?>
|
374 |
<div class="tablenav" style="overflow: hidden; height: auto;">
|
375 |
<?php if($added === false){ ?>
|
376 |
+
<div class="alignleft"><b><?php _e('Selected Media', 'flash-album-gallery'); ?>: </b><input style="width:500px;" type="text" readonly="readonly" id="items_array" name="items_array" value="<?php echo $items_array_default; ?>"/>
|
377 |
+
<span class="clear_selected button"><?php _e('Clear Selected', 'flash-album-gallery'); ?></span></div>
|
378 |
<?php } ?>
|
379 |
<div class="tablenav-pages"><?php $page_links_text = sprintf('<span class="displaying-num">' . __('Displaying %s–%s of %s') . '</span>%s', number_format_i18n(($_GET['paged'] - 1) * $objects_per_page + 1), number_format_i18n(min($_GET['paged'] * $objects_per_page, $img_total_count)), number_format_i18n($img_total_count), $page_links);
|
380 |
echo $page_links_text; ?></div>
|
387 |
|
388 |
<div class="actions">
|
389 |
<?php if($added === false){ ?>
|
390 |
+
<input name="updateMedia" class="button-primary" style="float: right;" type="submit" value="<?php _e('Update Media', 'flash-album-gallery'); ?>"/>
|
391 |
<?php if(function_exists('json_encode')){ ?>
|
392 |
<select name="bulkaction" id="bulkaction">
|
393 |
+
<option value="no_action"><?php _e("No action", 'flash-album-gallery'); ?></option>
|
394 |
+
<option value="new_playlist"><?php _e("Create new playlist", 'flash-album-gallery'); ?></option>
|
395 |
</select>
|
396 |
+
<input name="showThickbox" class="button-secondary" type="submit" value="<?php _e('Apply', 'flash-album-gallery'); ?>" onclick="if ( !checkSelected() ) {return false;
|
397 |
}"/>
|
398 |
<?php } ?>
|
399 |
+
<a href="<?php echo admin_url('media-new.php'); ?>" class="button" style="display: inline-block; margin: 0;"><?php _e('Upload Music', 'flash-album-gallery'); ?></a>
|
400 |
<input type="hidden" id="items_array" name="items_array" value=""/>
|
401 |
<?php } else{ ?>
|
402 |
<input type="hidden" name="mode" value="save"/>
|
405 |
<input type="hidden" name="skinname" value="<?php echo sanitize_flagname($playlist['skin']); ?>"/>
|
406 |
<input type="hidden" name="skinaction" value="<?php echo sanitize_flagname($playlist['skin']); ?>"/>
|
407 |
<textarea style="display: none;" name="playlist_descr" cols="40" rows="1"><?php echo esc_html($playlist['description']); ?></textarea>
|
408 |
+
<input name="addToPlaylist" class="button-secondary" type="submit" value="<?php _e('Update Playlist', 'flash-album-gallery'); ?>"/>
|
409 |
<?php } ?>
|
410 |
</div>
|
411 |
|
413 |
<table class="widefat flag-table" cellspacing="0">
|
414 |
<thead>
|
415 |
<tr>
|
416 |
+
<th class="cb" width="54" scope="col"><a href="#" onclick="checkAll(document.getElementById('musiclib'));return false;"><?php _e('Check', 'flash-album-gallery'); ?></a></th>
|
417 |
<th class="id" width="134" scope="col">
|
418 |
+
<div><?php _e('ID', 'flash-album-gallery'); ?></div>
|
419 |
</th>
|
420 |
<th class="size" width="75" scope="col">
|
421 |
+
<div><?php _e('Size', 'flash-album-gallery'); ?></div>
|
422 |
</th>
|
423 |
<th class="thumb" width="110" scope="col">
|
424 |
+
<div><?php _e('Thumbnail', 'flash-album-gallery'); ?></div>
|
425 |
</th>
|
426 |
<th class="title_filename" scope="col">
|
427 |
+
<div><?php _e('Filename / Title', 'flash-album-gallery'); ?></div>
|
428 |
</th>
|
429 |
<th class="description" scope="col">
|
430 |
+
<div><?php _e('Description', 'flash-album-gallery'); ?></div>
|
431 |
</th>
|
432 |
</tr>
|
433 |
</thead>
|
434 |
<tfoot>
|
435 |
<tr>
|
436 |
+
<th class="cb" scope="col"><a href="#" onclick="checkAll(document.getElementById('musiclib'));return false;"><?php _e('Check', 'flash-album-gallery'); ?></a></th>
|
437 |
+
<th class="id" scope="col"><?php _e('ID', 'flash-album-gallery'); ?></th>
|
438 |
+
<th class="size" scope="col"><?php _e('Size', 'flash-album-gallery'); ?></th>
|
439 |
+
<th class="thumb" scope="col"><?php _e('Thumbnail', 'flash-album-gallery'); ?></th>
|
440 |
+
<th class="title_filename" scope="col"><?php _e('Filename / Title', 'flash-album-gallery'); ?></th>
|
441 |
+
<th class="description" scope="col"><?php _e('Description', 'flash-album-gallery'); ?></th>
|
442 |
</tr>
|
443 |
</tfoot>
|
444 |
<?php
|
454 |
$ex = $checked = '';
|
455 |
if(($added !== false || !empty($items_array_default)) && in_array($mp3->ID, $exclude)){
|
456 |
$class .= ' already-added';
|
457 |
+
$ex = ' title="' . __("Already Added", "flash-album-gallery") . '"';
|
458 |
$checked = ' checked="checked"';
|
459 |
}
|
460 |
$thumb = $mp3thumb = get_post_meta($mp3->ID, 'thumbnail', true);
|
474 |
if($size){
|
475 |
echo round($size / 1024 / 1024, 2) . ' Mb';
|
476 |
} else{
|
477 |
+
_e("Can't read file size. Perhaps file is broken.", 'flash-album-gallery');
|
478 |
}
|
479 |
?></td>
|
480 |
<td class="thumb" rowspan="2">
|
483 |
<td class="title_filename" rowspan="2">
|
484 |
<strong><a href="<?php echo $url; ?>"><?php echo basename($url); ?></a></strong><br/>
|
485 |
<textarea title="Title" name="item_a[<?php echo $mp3->ID; ?>][post_title]" cols="20" rows="1" style="width:95%; height: 25px; overflow:hidden;"><?php echo esc_html(stripslashes($mp3->post_title)); ?></textarea><br/>
|
486 |
+
<p><?php _e('Thumb URL:', 'flash-album-gallery'); ?> <input id="mp3thumb-<?php echo $mp3->ID; ?>" name="item_a[<?php echo $mp3->ID; ?>][post_thumb]" type="text" value="<?php echo esc_url($mp3thumb); ?>"/>
|
487 |
+
<a class="thickbox" onclick="actInp=<?php echo $mp3->ID; ?>" href="media-upload.php?type=image&TB_iframe=1&width=640&height=400" title="<?php _e('Add an Image', 'flash-album-gallery'); ?>"><?php _e('assist', 'flash-album-gallery'); ?></a>
|
488 |
</p>
|
489 |
</td>
|
490 |
<td class="description" rowspan="2">
|
493 |
</tr>
|
494 |
<tr class="mp3-<?php echo $mp3->ID; ?>">
|
495 |
<td valign="top" class="player" colspan="3">
|
496 |
+
<audio src="<?php echo esc_url($url); ?>" controls preload="none" autobuffer="false"></audio>
|
|
|
|
|
|
|
|
|
|
|
|
|
497 |
<p style="padding: 7px 3px;">Shortcode: <input type="text" class="shortcode1" readonly="readonly" style="width: 180px; font-size: 9px;" onfocus="this.select()" value="[grandmp3 id=<?php echo $mp3->ID; ?> autoplay=<?php echo $flag_options['mpAutoplay']; ?>]"/>
|
498 |
</p></td>
|
499 |
</tr>
|
501 |
<?php
|
502 |
}
|
503 |
} else{
|
504 |
+
echo '<tr><td colspan="6" align="center"><strong>' . __('No music in WordPress Media Library.', 'flash-album-gallery') . '</strong></td></tr>';
|
505 |
}
|
506 |
?>
|
507 |
</table>
|
518 |
<input type="hidden" name="page" value="music-box"/>
|
519 |
<table width="100%" border="0" cellspacing="3" cellpadding="3">
|
520 |
<tr valign="top">
|
521 |
+
<th align="left" style="padding-top: 5px;"><?php _e('Playlist Title', 'flash-album-gallery'); ?></th>
|
522 |
<td><input type="text" class="alignleft" name="playlist_title" value=""/>
|
523 |
|
524 |
+
<div class="alignright"><strong><?php _e("Choose skin", 'flash-album-gallery'); ?>:</strong>
|
525 |
<select id="skinname" name="skinname" style="width: 200px; height: 24px; font-size: 11px;">
|
526 |
<?php require_once(dirname(__FILE__) . '/get_skin.php');
|
527 |
$all_skins = get_skins($skin_folder = '', $type = 'm');
|
530 |
echo '<option value="' . dirname($skin_file) . '">' . $skin_data['Name'] . '</option>' . "\n";
|
531 |
}
|
532 |
} else{
|
533 |
+
echo '<option value="music_default">' . __("No Skins", "flash-album-gallery") . '</option>';
|
534 |
}
|
535 |
?>
|
536 |
</select>
|
538 |
</td>
|
539 |
</tr>
|
540 |
<tr valign="top">
|
541 |
+
<th align="left" style="padding-top: 5px;"><?php _e('Playlist Description', 'flash-album-gallery'); ?></th>
|
542 |
<td><textarea style="width:100%;" rows="3" cols="60" name="playlist_descr"></textarea></td>
|
543 |
</tr>
|
544 |
<tr>
|
545 |
<td> </td>
|
546 |
+
<td align="right"><input class="button-secondary" type="reset" value=" <?php _e('Cancel', 'flash-album-gallery'); ?> " onclick="tb_remove()"/>
|
547 |
|
548 |
+
<input class="button-primary " type="submit" name="TB_NewPlaylist" value="<?php _e('OK', 'flash-album-gallery'); ?>"/>
|
549 |
</td>
|
550 |
</tr>
|
551 |
</table>
|
admin/overview.php
CHANGED
@@ -11,7 +11,7 @@ function flag_admin_overview() {
|
|
11 |
echo get_option('flag_plugin_error');
|
12 |
?>
|
13 |
<div class="flag-wrap">
|
14 |
-
<h2 class="overview-title"><?php _e('Grand Flagallery Overview', '
|
15 |
<div id="flag-overview" class="metabox-holder">
|
16 |
<div id="post-body" class="has-sidebar">
|
17 |
<div class="has-sidebar-content">
|
@@ -90,7 +90,7 @@ function flag_overview_graphic_lib() {
|
|
90 |
}
|
91 |
|
92 |
/**
|
93 |
-
* Show the Setup Box and some info for
|
94 |
*
|
95 |
* @return void
|
96 |
*/
|
@@ -108,18 +108,7 @@ function flag_overview_setup(){
|
|
108 |
$flag->define_constant();
|
109 |
$flag->load_options();
|
110 |
|
111 |
-
flagGallery::show_message(__('Reset all settings to default parameter','
|
112 |
-
}
|
113 |
-
|
114 |
-
if (isset($_POST['uninstall'])) {
|
115 |
-
|
116 |
-
check_admin_referer('flag_uninstall');
|
117 |
-
|
118 |
-
include_once ( dirname (__FILE__). '/flag_install.php');
|
119 |
-
|
120 |
-
flag_uninstall();
|
121 |
-
|
122 |
-
flagGallery::show_message(__('Uninstall sucessful ! Now delete the plugin and enjoy your life ! Good luck !','flag'));
|
123 |
}
|
124 |
?>
|
125 |
<div class="submitbox" id="submitpost">
|
@@ -127,22 +116,22 @@ function flag_overview_setup(){
|
|
127 |
<div id="misc-publishing-actions">
|
128 |
<div class="misc-pub-section">
|
129 |
<span id="plugin-home" class="icon">
|
130 |
-
<strong><a href="
|
131 |
</span>
|
132 |
</div>
|
133 |
<div class="misc-pub-section">
|
134 |
<span id="plugin-comments" class="icon">
|
135 |
-
<a href="
|
136 |
</span>
|
137 |
</div>
|
138 |
<div class="misc-pub-section">
|
139 |
<span id="rate-plugin" class="icon">
|
140 |
-
<a href="
|
141 |
</span>
|
142 |
</div>
|
143 |
<div class="misc-pub-section curtime misc-pub-section-last">
|
144 |
<span id="contact-me" class="icon">
|
145 |
-
<a href="
|
146 |
</span>
|
147 |
</div>
|
148 |
</div>
|
@@ -153,10 +142,10 @@ function flag_overview_setup(){
|
|
153 |
<form id="resetsettings" name="resetsettings" method="post">
|
154 |
<?php wp_nonce_field('flag_uninstall'); ?>
|
155 |
<div id="save-action" class="alignleft">
|
156 |
-
<input class="button" id="save-post" type="submit" name="resetdefault" value="<?php _e('Reset settings', '
|
157 |
</div>
|
158 |
<div id="preview-action" class="alignright">
|
159 |
-
<input type="submit" name="uninstall" class="button delete" value="<?php _e('Uninstall plugin', '
|
160 |
</div>
|
161 |
<br class="clear" />
|
162 |
</form>
|
@@ -178,15 +167,15 @@ function flag_overview_right_now() {
|
|
178 |
?>
|
179 |
|
180 |
<div class="table table_content">
|
181 |
-
<strong><?php _e('At a Glance', '
|
182 |
<table>
|
183 |
<tr class="first">
|
184 |
-
<td class="t"><?php echo _n( 'Image', 'Images', $images, '
|
185 |
<td>:</td>
|
186 |
<td class="b"><a href="admin.php?page=flag-manage-gallery&tabs=1"><?php echo $images; ?></a></td>
|
187 |
</tr>
|
188 |
<tr>
|
189 |
-
<td class="t"><?php echo _n( 'Gallery', 'Galleries', $galleries, '
|
190 |
<td>:</td>
|
191 |
<td class="b"><a href="admin.php?page=flag-manage-gallery&tabs=0"><?php echo $galleries; ?></a></td>
|
192 |
</tr>
|
@@ -195,23 +184,47 @@ function flag_overview_right_now() {
|
|
195 |
<div class="versions">
|
196 |
<?php if(current_user_can('FlAG Upload images')): ?>
|
197 |
<p>
|
198 |
-
<?php _e('Here you can control your images and galleries', '
|
199 |
|
200 |
-
<a class="button rbutton" href="admin.php?page=flag-manage-gallery&tabs=1"><strong><?php _e('Upload pictures', '
|
201 |
</p>
|
202 |
<?php endif; ?>
|
203 |
<span><?php
|
204 |
-
$userlevel = '<span class="b">' . (current_user_can('manage_options') ? __('Gallery Administrator', '
|
205 |
-
printf(__('You currently have %s rights.', '
|
206 |
?></span>
|
207 |
</div>
|
208 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
209 |
}
|
210 |
|
211 |
-
add_meta_box('flag_dashboard_right_now', __('Welcome to FlAGallery !', '
|
212 |
-
add_meta_box('flag_server', __('Server Settings', '
|
213 |
-
add_meta_box('flag_gd_lib', __('Graphic Library', '
|
214 |
-
add_meta_box('dashboard_primary', __('Setup Box', '
|
215 |
|
216 |
/**
|
217 |
* Show GD Library version information
|
@@ -231,7 +244,7 @@ function flag_GD_info() {
|
|
231 |
}
|
232 |
}
|
233 |
else {
|
234 |
-
echo '<h4>'.__('No GD support', '
|
235 |
}
|
236 |
}
|
237 |
|
@@ -243,9 +256,9 @@ function flag_GD_info() {
|
|
243 |
*/
|
244 |
function flag_GD_Support($bool){
|
245 |
if($bool)
|
246 |
-
return __('Yes', '
|
247 |
else
|
248 |
-
return __('No', '
|
249 |
}
|
250 |
|
251 |
/**
|
@@ -261,57 +274,65 @@ function get_serverinfo() {
|
|
261 |
// GET SQL Mode
|
262 |
$mysqlinfo = $wpdb->get_results("SHOW VARIABLES LIKE 'sql_mode'");
|
263 |
if (is_array($mysqlinfo)) $sql_mode = $mysqlinfo[0]->Value;
|
264 |
-
if (empty($sql_mode)) $sql_mode = __('Not set', '
|
265 |
// Get PHP Safe Mode
|
266 |
-
|
267 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
268 |
// Get PHP allow_url_fopen
|
269 |
-
if(ini_get('allow_url_fopen')) $allow_url_fopen = __('On', '
|
270 |
-
else $allow_url_fopen = __('Off', '
|
271 |
// Get PHP Max Upload Size
|
272 |
if(ini_get('upload_max_filesize')) $upload_max = ini_get('upload_max_filesize');
|
273 |
-
else $upload_max = __('N/A', '
|
274 |
// Get PHP Output buffer Size
|
275 |
if(ini_get('output_buffering')) $output_buffer = ini_get('output_buffering');
|
276 |
-
else $output_buffer = __('N/A', '
|
277 |
// Get PHP Max Post Size
|
278 |
if(ini_get('post_max_size')) $post_max = ini_get('post_max_size');
|
279 |
-
else $post_max = __('N/A', '
|
280 |
// Get PHP Max execution time
|
281 |
if(ini_get('max_execution_time')) $max_execute = ini_get('max_execution_time');
|
282 |
-
else $max_execute = __('N/A', '
|
283 |
// Get PHP Memory Limit
|
284 |
if(ini_get('memory_limit')) $memory_limit = ini_get('memory_limit');
|
285 |
-
else $memory_limit = __('N/A', '
|
286 |
// Get actual memory_get_usage
|
287 |
-
if (function_exists('memory_get_usage')) $memory_usage = round(memory_get_usage() / 1024 / 1024, 2) . __(' MByte', '
|
288 |
-
else $memory_usage = __('N/A', '
|
289 |
// required for EXIF read
|
290 |
-
if (is_callable('exif_read_data')) $exif = __('Yes', '
|
291 |
-
else $exif = __('No', '
|
292 |
// required for meta data
|
293 |
-
if (is_callable('iptcparse')) $iptc = __('Yes', '
|
294 |
-
else $iptc = __('No', '
|
295 |
// required for meta data
|
296 |
-
if (is_callable('xml_parser_create')) $xml = __('Yes', '
|
297 |
-
else $xml = __('No', '
|
298 |
?>
|
299 |
-
<li><?php _e('Operating System', '
|
300 |
-
<li><?php _e('Server', '
|
301 |
-
<li><?php _e('Memory usage', '
|
302 |
-
<li><?php _e('MYSQL Version', '
|
303 |
-
<li><?php _e('SQL Mode', '
|
304 |
-
<li><?php _e('PHP Version', '
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
<li><?php _e('PHP
|
309 |
-
<li><?php _e('PHP
|
310 |
-
<li><?php _e('PHP
|
311 |
-
<li><?php _e('PHP Max
|
312 |
-
<li><?php _e('PHP
|
313 |
-
<li><?php _e('PHP
|
314 |
-
<li><?php _e('PHP
|
|
|
|
|
315 |
<?php
|
316 |
}
|
317 |
|
@@ -324,7 +345,7 @@ function get_serverinfo() {
|
|
324 |
class flag_SpaceManager {
|
325 |
|
326 |
function getQuota() {
|
327 |
-
if (function_exists(get_space_allowed))
|
328 |
$quota = get_space_allowed();
|
329 |
else
|
330 |
$quota = get_site_option( "blog_upload_space" );
|
@@ -369,16 +390,16 @@ class flag_SpaceManager {
|
|
369 |
$percentremain = 100 - $percentused;
|
370 |
|
371 |
$out = '';
|
372 |
-
$out .= '<div id="spaceused"> <h3>'.__('Storage Space','
|
373 |
|
374 |
if ($settings['used']['display']) {
|
375 |
-
$out .= __('Upload Space Used:','
|
376 |
$out .= flag_SpaceManager::buildGraph($settings['used'], $used,$quota,$percentused);
|
377 |
$out .= "<br />";
|
378 |
}
|
379 |
|
380 |
if($settings['remain']['display']) {
|
381 |
-
$out .= __('Upload Space Remaining:','
|
382 |
$out .= flag_SpaceManager::buildGraph($settings['remain'], $remaining,$quota,$percentremain);
|
383 |
|
384 |
}
|
11 |
echo get_option('flag_plugin_error');
|
12 |
?>
|
13 |
<div class="flag-wrap">
|
14 |
+
<h2 class="overview-title"><?php _e('Grand Flagallery Overview', 'flash-album-gallery'); echo ' v'.FLAGVERSION; ?></h2>
|
15 |
<div id="flag-overview" class="metabox-holder">
|
16 |
<div id="post-body" class="has-sidebar">
|
17 |
<div class="has-sidebar-content">
|
90 |
}
|
91 |
|
92 |
/**
|
93 |
+
* Show the Setup Box and some info for FlaGallery
|
94 |
*
|
95 |
* @return void
|
96 |
*/
|
108 |
$flag->define_constant();
|
109 |
$flag->load_options();
|
110 |
|
111 |
+
flagGallery::show_message(__('Reset all settings to default parameter','flash-album-gallery'));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
112 |
}
|
113 |
?>
|
114 |
<div class="submitbox" id="submitpost">
|
116 |
<div id="misc-publishing-actions">
|
117 |
<div class="misc-pub-section">
|
118 |
<span id="plugin-home" class="icon">
|
119 |
+
<strong><a href="https://mypgc.co/" style="text-decoration: none;"><?php _e('Plugin Home','flash-album-gallery'); ?></a></strong>
|
120 |
</span>
|
121 |
</div>
|
122 |
<div class="misc-pub-section">
|
123 |
<span id="plugin-comments" class="icon">
|
124 |
+
<a href="https://codeasily.com/community/forum/flagallery-wordpress-plugin/" style="text-decoration: none;"><?php _e('Plugin Forum','flash-album-gallery'); ?></a>
|
125 |
</span>
|
126 |
</div>
|
127 |
<div class="misc-pub-section">
|
128 |
<span id="rate-plugin" class="icon">
|
129 |
+
<a href="https://wordpress.org/support/view/plugin-reviews/flash-album-gallery" style="text-decoration: none;"><?php _e('Rate Plugin','flash-album-gallery'); ?></a>
|
130 |
</span>
|
131 |
</div>
|
132 |
<div class="misc-pub-section curtime misc-pub-section-last">
|
133 |
<span id="contact-me" class="icon">
|
134 |
+
<a href="https://mypgc.co/contact/" style="text-decoration: none;"><?php _e('Contact Me','flash-album-gallery'); ?></a>
|
135 |
</span>
|
136 |
</div>
|
137 |
</div>
|
142 |
<form id="resetsettings" name="resetsettings" method="post">
|
143 |
<?php wp_nonce_field('flag_uninstall'); ?>
|
144 |
<div id="save-action" class="alignleft">
|
145 |
+
<input class="button" id="save-post" type="submit" name="resetdefault" value="<?php _e('Reset settings', 'flash-album-gallery'); ?>" onclick="javascript:check=confirm('<?php _e('Reset all options to default settings ?\n\nChoose [Cancel] to Stop, [OK] to proceed.\n','flash-album-gallery'); ?>');if(check==false) return false;" />
|
146 |
</div>
|
147 |
<div id="preview-action" class="alignright">
|
148 |
+
<input type="submit" name="uninstall" class="button delete" value="<?php _e('Uninstall plugin', 'flash-album-gallery'); ?>" 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','flash-album-gallery'); ?>');if(check==false) return false;" />
|
149 |
</div>
|
150 |
<br class="clear" />
|
151 |
</form>
|
167 |
?>
|
168 |
|
169 |
<div class="table table_content">
|
170 |
+
<strong><?php _e('At a Glance', 'flash-album-gallery'); ?>:</strong>
|
171 |
<table>
|
172 |
<tr class="first">
|
173 |
+
<td class="t"><?php echo _n( 'Image', 'Images', $images, 'flash-album-gallery' ); ?></td>
|
174 |
<td>:</td>
|
175 |
<td class="b"><a href="admin.php?page=flag-manage-gallery&tabs=1"><?php echo $images; ?></a></td>
|
176 |
</tr>
|
177 |
<tr>
|
178 |
+
<td class="t"><?php echo _n( 'Gallery', 'Galleries', $galleries, 'flash-album-gallery' ); ?></td>
|
179 |
<td>:</td>
|
180 |
<td class="b"><a href="admin.php?page=flag-manage-gallery&tabs=0"><?php echo $galleries; ?></a></td>
|
181 |
</tr>
|
184 |
<div class="versions">
|
185 |
<?php if(current_user_can('FlAG Upload images')): ?>
|
186 |
<p>
|
187 |
+
<?php _e('Here you can control your images and galleries', 'flash-album-gallery'); ?>
|
188 |
|
189 |
+
<a class="button rbutton" href="admin.php?page=flag-manage-gallery&tabs=1"><strong><?php _e('Upload pictures', 'flash-album-gallery'); ?></strong></a>
|
190 |
</p>
|
191 |
<?php endif; ?>
|
192 |
<span><?php
|
193 |
+
$userlevel = '<span class="b">' . (current_user_can('manage_options') ? __('Gallery Administrator', 'flash-album-gallery') : __('Gallery Editor', 'flash-album-gallery')) . '</span>';
|
194 |
+
printf(__('You currently have %s rights.', 'flash-album-gallery'), $userlevel);
|
195 |
?></span>
|
196 |
</div>
|
197 |
+
|
198 |
+
<div id="message" class="updated" style="margin-top:20px;"><?php _e('<h2>Flagallery Wordpress Plugin v5.0</h2>
|
199 |
+
<p>WordPress announced removing adobe flash based plugins from WordPress v4.9.<br />
|
200 |
+
Flagallery was reworked from the ground and here is the all new skins now built with HTML and JS.<br />
|
201 |
+
<b style="color:red;">Note:</b> all your old galleries now will be replaced with new default skin "Phantom".<br />
|
202 |
+
You can install new skins at the skins page and use them in flagallery shortcodes.</p>
|
203 |
+
<p><b><i>Changes:</i></b><br />
|
204 |
+
* All flash code replaced with HTML & JS<br />
|
205 |
+
* GRAND Page have new option for background: Background Size<br />
|
206 |
+
* GRAND Page added \'assist\' link for Background Image<br />
|
207 |
+
* iFrame tool now have embed code, which you can copy and paste whenever you need</p>
|
208 |
+
<p>* <b>New Skins:</b><br />
|
209 |
+
- Phantom - free<br />
|
210 |
+
- NivoGallery - free<br />
|
211 |
+
- Nivo Slider - free Banner Rotator<br />
|
212 |
+
- jQ Music Player - free Music Playlist<br />
|
213 |
+
- WP Video Player - free Video Playlist<br />
|
214 |
+
- Photomania - premium<br />
|
215 |
+
- FlipGrid - premium with multicategory<br />
|
216 |
+
- PhotoBox - premium<br />
|
217 |
+
- Mosaic - premium<br />
|
218 |
+
- AlbumsGrid - premium splash gallery<br />
|
219 |
+
- AlbumsSwitcher - premium splash gallery<br />
|
220 |
+
- PhotoCluster - premium splash gallery</p>', "flash-album-gallery" ); ?></p></div>
|
221 |
+
<?php
|
222 |
}
|
223 |
|
224 |
+
add_meta_box('flag_dashboard_right_now', __('Welcome to FlAGallery !', 'flash-album-gallery'), 'flag_overview_right_now', 'flag-overview', 'normal', 'default');
|
225 |
+
add_meta_box('flag_server', __('Server Settings', 'flash-album-gallery'), 'flag_overview_server', 'flag-overview', 'normal', 'default');
|
226 |
+
add_meta_box('flag_gd_lib', __('Graphic Library', 'flash-album-gallery'), 'flag_overview_graphic_lib', 'flag-overview', 'normal', 'default');
|
227 |
+
add_meta_box('dashboard_primary', __('Setup Box', 'flash-album-gallery'), 'flag_overview_setup', 'flag-overview', 'side', 'core');
|
228 |
|
229 |
/**
|
230 |
* Show GD Library version information
|
244 |
}
|
245 |
}
|
246 |
else {
|
247 |
+
echo '<h4>'.__('No GD support', 'flash-album-gallery').'!</h4>';
|
248 |
}
|
249 |
}
|
250 |
|
256 |
*/
|
257 |
function flag_GD_Support($bool){
|
258 |
if($bool)
|
259 |
+
return __('Yes', 'flash-album-gallery');
|
260 |
else
|
261 |
+
return __('No', 'flash-album-gallery');
|
262 |
}
|
263 |
|
264 |
/**
|
274 |
// GET SQL Mode
|
275 |
$mysqlinfo = $wpdb->get_results("SHOW VARIABLES LIKE 'sql_mode'");
|
276 |
if (is_array($mysqlinfo)) $sql_mode = $mysqlinfo[0]->Value;
|
277 |
+
if (empty($sql_mode)) $sql_mode = __('Not set', 'flash-album-gallery');
|
278 |
// Get PHP Safe Mode
|
279 |
+
$safe_mode = false;
|
280 |
+
if(version_compare('5.3', phpversion(), '>')){
|
281 |
+
if(ini_get('safe_mode')){
|
282 |
+
$safe_mode = __('On', 'flash-album-gallery');
|
283 |
+
} else{
|
284 |
+
$safe_mode = __('Off', 'flash-album-gallery');
|
285 |
+
}
|
286 |
+
}
|
287 |
// Get PHP allow_url_fopen
|
288 |
+
if(ini_get('allow_url_fopen')) $allow_url_fopen = __('On', 'flash-album-gallery');
|
289 |
+
else $allow_url_fopen = __('Off', 'flash-album-gallery');
|
290 |
// Get PHP Max Upload Size
|
291 |
if(ini_get('upload_max_filesize')) $upload_max = ini_get('upload_max_filesize');
|
292 |
+
else $upload_max = __('N/A', 'flash-album-gallery');
|
293 |
// Get PHP Output buffer Size
|
294 |
if(ini_get('output_buffering')) $output_buffer = ini_get('output_buffering');
|
295 |
+
else $output_buffer = __('N/A', 'flash-album-gallery');
|
296 |
// Get PHP Max Post Size
|
297 |
if(ini_get('post_max_size')) $post_max = ini_get('post_max_size');
|
298 |
+
else $post_max = __('N/A', 'flash-album-gallery');
|
299 |
// Get PHP Max execution time
|
300 |
if(ini_get('max_execution_time')) $max_execute = ini_get('max_execution_time');
|
301 |
+
else $max_execute = __('N/A', 'flash-album-gallery');
|
302 |
// Get PHP Memory Limit
|
303 |
if(ini_get('memory_limit')) $memory_limit = ini_get('memory_limit');
|
304 |
+
else $memory_limit = __('N/A', 'flash-album-gallery');
|
305 |
// Get actual memory_get_usage
|
306 |
+
if (function_exists('memory_get_usage')) $memory_usage = round(memory_get_usage() / 1024 / 1024, 2) . __(' MByte', 'flash-album-gallery');
|
307 |
+
else $memory_usage = __('N/A', 'flash-album-gallery');
|
308 |
// required for EXIF read
|
309 |
+
if (is_callable('exif_read_data')) $exif = __('Yes', 'flash-album-gallery'). " ( V" . substr(phpversion('exif'),0,4) . ")" ;
|
310 |
+
else $exif = __('No', 'flash-album-gallery');
|
311 |
// required for meta data
|
312 |
+
if (is_callable('iptcparse')) $iptc = __('Yes', 'flash-album-gallery');
|
313 |
+
else $iptc = __('No', 'flash-album-gallery');
|
314 |
// required for meta data
|
315 |
+
if (is_callable('xml_parser_create')) $xml = __('Yes', 'flash-album-gallery');
|
316 |
+
else $xml = __('No', 'flash-album-gallery');
|
317 |
?>
|
318 |
+
<li><?php _e('Operating System', 'flash-album-gallery'); ?> : <span><?php echo PHP_OS; ?> (<?php echo (PHP_INT_SIZE * 8); ?> Bit)</span></li>
|
319 |
+
<li><?php _e('Server', 'flash-album-gallery'); ?> : <span><?php echo $_SERVER["SERVER_SOFTWARE"]; ?></span></li>
|
320 |
+
<li><?php _e('Memory usage', 'flash-album-gallery'); ?> : <span><?php echo $memory_usage; ?></span></li>
|
321 |
+
<li><?php _e('MYSQL Version', 'flash-album-gallery'); ?> : <span><?php echo $sqlversion; ?></span></li>
|
322 |
+
<li><?php _e('SQL Mode', 'flash-album-gallery'); ?> : <span><?php echo $sql_mode; ?></span></li>
|
323 |
+
<li><?php _e('PHP Version', 'flash-album-gallery'); ?> : <span><?php echo PHP_VERSION; ?></span></li>
|
324 |
+
<?php if($safe_mode){ ?>
|
325 |
+
<li><?php _e('PHP Safe Mode', 'flash-album-gallery'); ?> : <span><?php echo $safe_mode; ?></span></li>
|
326 |
+
<?php } ?>
|
327 |
+
<li><?php _e('PHP Allow URL fopen', 'flash-album-gallery'); ?> : <span><?php echo $allow_url_fopen; ?></span></li>
|
328 |
+
<li><?php _e('PHP Memory Limit', 'flash-album-gallery'); ?> : <span><?php echo $memory_limit; ?></span></li>
|
329 |
+
<li><?php _e('PHP Max Upload Size', 'flash-album-gallery'); ?> : <span><?php echo $upload_max; ?></span></li>
|
330 |
+
<li><?php _e('PHP Max Post Size', 'flash-album-gallery'); ?> : <span><?php echo $post_max; ?></span></li>
|
331 |
+
<li><?php _e('PHP Output Buffer Size', 'flash-album-gallery'); ?> : <span><?php echo $output_buffer; ?></span></li>
|
332 |
+
<li><?php _e('PHP Max Script Execute Time', 'flash-album-gallery'); ?> : <span><?php echo $max_execute; ?>s</span></li>
|
333 |
+
<li><?php _e('PHP Exif support', 'flash-album-gallery'); ?> : <span><?php echo $exif; ?></span></li>
|
334 |
+
<li><?php _e('PHP IPTC support', 'flash-album-gallery'); ?> : <span><?php echo $iptc; ?></span></li>
|
335 |
+
<li><?php _e('PHP XML support', 'flash-album-gallery'); ?> : <span><?php echo $xml; ?></span></li>
|
336 |
<?php
|
337 |
}
|
338 |
|
345 |
class flag_SpaceManager {
|
346 |
|
347 |
function getQuota() {
|
348 |
+
if (function_exists('get_space_allowed'))
|
349 |
$quota = get_space_allowed();
|
350 |
else
|
351 |
$quota = get_site_option( "blog_upload_space" );
|
390 |
$percentremain = 100 - $percentused;
|
391 |
|
392 |
$out = '';
|
393 |
+
$out .= '<div id="spaceused"> <h3>'.__('Storage Space','flash-album-gallery').'</h3>';
|
394 |
|
395 |
if ($settings['used']['display']) {
|
396 |
+
$out .= __('Upload Space Used:','flash-album-gallery') . "\n";
|
397 |
$out .= flag_SpaceManager::buildGraph($settings['used'], $used,$quota,$percentused);
|
398 |
$out .= "<br />";
|
399 |
}
|
400 |
|
401 |
if($settings['remain']['display']) {
|
402 |
+
$out .= __('Upload Space Remaining:','flash-album-gallery') . "\n";
|
403 |
$out .= flag_SpaceManager::buildGraph($settings['remain'], $remaining,$quota,$percentremain);
|
404 |
|
405 |
}
|
admin/playlist-sort.php
CHANGED
@@ -15,15 +15,15 @@ function flag_playlist_order($playlist = 'deprecated'){
|
|
15 |
<script type="text/javascript" src="<?php echo FLAG_URLPATH; ?>admin/js/jquery.tablednd_0_5.js"></script>
|
16 |
<script type="text/javascript" src="<?php echo FLAG_URLPATH; ?>admin/js/jquery.tablesorter.js"></script>
|
17 |
<div class="flag-wrap">
|
18 |
-
<h2><?php _e('Sort Gallery', '
|
19 |
|
20 |
<div class="alignright tablenav" style="margin-bottom: -36px;">
|
21 |
-
<a href="<?php echo esc_url($base_url."&playlist=".$filename.'&mode=edit'); ?>" class="button-secondary action"><?php _e('Back to playlist', '
|
22 |
</div>
|
23 |
<form id="sortPlaylist" method="POST" action="<?php echo esc_url($base_url."&playlist=".$filename.'&mode=edit'); ?>" accept-charset="utf-8">
|
24 |
<div class="alignleft tablenav">
|
25 |
<?php wp_nonce_field('flag_update'); ?>
|
26 |
-
<input class="button-primary action" type="submit" name="updatePlaylist" value="<?php _e('Update Sort Order', '
|
27 |
</div>
|
28 |
<br clear="all" />
|
29 |
<input type="hidden" name="playlist_title" value="<?php echo esc_html($playlist['title']); ?>" />
|
@@ -63,18 +63,18 @@ jQuery(document).ready(function($) {
|
|
63 |
|
64 |
<thead>
|
65 |
<tr>
|
66 |
-
<th class="header" width="54"><p style="margin-right:-10px;"><?php _e('ID', '
|
67 |
-
<th width="260"><div><?php _e('Play', '
|
68 |
-
<th class="header"><p><?php _e('Filename', '
|
69 |
-
<th class="header"><p><?php _e('Title', '
|
70 |
</tr>
|
71 |
</thead>
|
72 |
<tfoot>
|
73 |
<tr>
|
74 |
-
<th><?php _e('ID', '
|
75 |
-
<th><?php _e('Play', '
|
76 |
-
<th><?php _e('Filename', '
|
77 |
-
<th><?php _e('Title', '
|
78 |
</tr>
|
79 |
</tfoot>
|
80 |
<tbody id="listitems">
|
@@ -91,20 +91,19 @@ if(count($items_a)) {
|
|
91 |
?>
|
92 |
<tr id="$mp3-<?php echo $mp3->ID; ?>" class="<?php echo $alternate; ?> iedit" valign="top">
|
93 |
<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>
|
94 |
-
<td><
|
95 |
-
<div class="play"><span id="c-<?php echo $mp3->ID; ?>"></span></div></td>
|
96 |
<td><?php echo basename($url); ?></td>
|
97 |
<td><?php echo esc_html(stripslashes($mp3->post_title)); ?></td>
|
98 |
</tr>
|
99 |
<?php
|
100 |
}
|
101 |
} else {
|
102 |
-
echo '<tr><td colspan="4" align="center"><strong>'.__('No entries found','
|
103 |
}
|
104 |
?>
|
105 |
</tbody>
|
106 |
</table>
|
107 |
-
<p class="actions"><input type="submit" class="button-primary action" name="updatePlaylist" value="<?php _e('Update Sort Order', '
|
108 |
</form>
|
109 |
<br class="clear"/>
|
110 |
</div><!-- /#wrap -->
|
15 |
<script type="text/javascript" src="<?php echo FLAG_URLPATH; ?>admin/js/jquery.tablednd_0_5.js"></script>
|
16 |
<script type="text/javascript" src="<?php echo FLAG_URLPATH; ?>admin/js/jquery.tablesorter.js"></script>
|
17 |
<div class="flag-wrap">
|
18 |
+
<h2><?php _e('Sort Gallery', 'flash-album-gallery'); ?></h2>
|
19 |
|
20 |
<div class="alignright tablenav" style="margin-bottom: -36px;">
|
21 |
+
<a href="<?php echo esc_url($base_url."&playlist=".$filename.'&mode=edit'); ?>" class="button-secondary action"><?php _e('Back to playlist', 'flash-album-gallery'); ?></a>
|
22 |
</div>
|
23 |
<form id="sortPlaylist" method="POST" action="<?php echo esc_url($base_url."&playlist=".$filename.'&mode=edit'); ?>" accept-charset="utf-8">
|
24 |
<div class="alignleft tablenav">
|
25 |
<?php wp_nonce_field('flag_update'); ?>
|
26 |
+
<input class="button-primary action" type="submit" name="updatePlaylist" value="<?php _e('Update Sort Order', 'flash-album-gallery'); ?>" />
|
27 |
</div>
|
28 |
<br clear="all" />
|
29 |
<input type="hidden" name="playlist_title" value="<?php echo esc_html($playlist['title']); ?>" />
|
63 |
|
64 |
<thead>
|
65 |
<tr>
|
66 |
+
<th class="header" width="54"><p style="margin-right:-10px;"><?php _e('ID', 'flash-album-gallery'); ?></p></th>
|
67 |
+
<th width="260"><div><?php _e('Play', 'flash-album-gallery'); ?></div></th>
|
68 |
+
<th class="header"><p><?php _e('Filename', 'flash-album-gallery'); ?></p></th>
|
69 |
+
<th class="header"><p><?php _e('Title', 'flash-album-gallery'); ?></p></th>
|
70 |
</tr>
|
71 |
</thead>
|
72 |
<tfoot>
|
73 |
<tr>
|
74 |
+
<th><?php _e('ID', 'flash-album-gallery'); ?></th>
|
75 |
+
<th><?php _e('Play', 'flash-album-gallery'); ?></th>
|
76 |
+
<th><?php _e('Filename', 'flash-album-gallery'); ?></th>
|
77 |
+
<th><?php _e('Title', 'flash-album-gallery'); ?></th>
|
78 |
</tr>
|
79 |
</tfoot>
|
80 |
<tbody id="listitems">
|
91 |
?>
|
92 |
<tr id="$mp3-<?php echo $mp3->ID; ?>" class="<?php echo $alternate; ?> iedit" valign="top">
|
93 |
<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>
|
94 |
+
<td><audio src="<?php echo esc_url($url); ?>" controls preload="none" autobuffer="false"></audio></td>
|
|
|
95 |
<td><?php echo basename($url); ?></td>
|
96 |
<td><?php echo esc_html(stripslashes($mp3->post_title)); ?></td>
|
97 |
</tr>
|
98 |
<?php
|
99 |
}
|
100 |
} else {
|
101 |
+
echo '<tr><td colspan="4" align="center"><strong>'.__('No entries found','flash-album-gallery').'</strong></td></tr>';
|
102 |
}
|
103 |
?>
|
104 |
</tbody>
|
105 |
</table>
|
106 |
+
<p class="actions"><input type="submit" class="button-primary action" name="updatePlaylist" value="<?php _e('Update Sort Order', 'flash-album-gallery'); ?>" /></p>
|
107 |
</form>
|
108 |
<br class="clear"/>
|
109 |
</div><!-- /#wrap -->
|
admin/playlist.functions.php
CHANGED
@@ -1,159 +1,196 @@
|
|
1 |
<?php
|
2 |
-
if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF']))
|
|
|
|
|
|
|
|
|
3 |
|
4 |
-
|
5 |
|
6 |
-
|
|
|
|
|
|
|
|
|
|
|
7 |
|
8 |
-
|
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 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
}
|
61 |
|
62 |
-
function flagSavePlaylist($title
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
$
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
101 |
<properties>
|
102 |
-
<title><![CDATA['
|
103 |
-
<description><![CDATA['
|
104 |
-
<skin><![CDATA['
|
105 |
</properties>
|
106 |
<items>';
|
107 |
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
<item id="'
|
114 |
-
<track>'.wp_get_attachment_url($mp3->ID).'</track>
|
115 |
-
<title><![CDATA['
|
116 |
-
<description><![CDATA['
|
117 |
-
<thumbnail>'
|
118 |
</item>';
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
</items>
|
123 |
</category>
|
124 |
</gallery>';
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
}
|
136 |
|
137 |
-
function flagSavePlaylistSkin($file)
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
}
|
149 |
|
150 |
-
function flag_playlist_delete($playlist)
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
}
|
1 |
<?php
|
2 |
+
if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])){
|
3 |
+
die('You are not allowed to call this page directly.');
|
4 |
+
}
|
5 |
+
|
6 |
+
function get_playlist_data($playlist_file){
|
7 |
|
8 |
+
$playlist_content = file_get_contents($playlist_file);
|
9 |
|
10 |
+
$playlist_data['settings'] = flagGallery::flagGetBetween($playlist_content, '<settings><![CDATA[', ']]></settings>');
|
11 |
+
$playlist_data['title'] = flagGallery::flagGetBetween($playlist_content, '<title><![CDATA[', ']]></title>');
|
12 |
+
$playlist_data['skin'] = flagGallery::flagGetBetween($playlist_content, '<skin><![CDATA[', ']]></skin>');
|
13 |
+
$playlist_data['description'] = flagGallery::flagGetBetween($playlist_content, '<description><![CDATA[', ']]></description>');
|
14 |
+
preg_match_all('|<item id="(.*)">|', $playlist_content, $items);
|
15 |
+
$playlist_data['items'] = $items[1];
|
16 |
|
17 |
+
return $playlist_data;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
}
|
19 |
|
20 |
/**
|
21 |
* Check the playlists directory and retrieve all playlist files with playlist data.
|
22 |
*
|
23 |
*/
|
24 |
+
function get_playlists($playlist_folder = ''){
|
25 |
+
|
26 |
+
$flag_options = get_option('flag_options');
|
27 |
+
$flag_playlists = array();
|
28 |
+
$playlist_root = ABSPATH . $flag_options['galleryPath'] . 'playlists';
|
29 |
+
if( !empty($playlist_folder)){
|
30 |
+
$playlist_root = $playlist_folder;
|
31 |
+
}
|
32 |
+
|
33 |
+
// Files in flagallery/playlists directory
|
34 |
+
$playlists_dir = @ opendir($playlist_root);
|
35 |
+
$playlist_files = array();
|
36 |
+
if($playlists_dir){
|
37 |
+
while(($file = readdir($playlists_dir)) !== false){
|
38 |
+
if(substr($file, 0, 1) == '.'){
|
39 |
+
continue;
|
40 |
+
}
|
41 |
+
if(substr($file, - 4) == '.xml'){
|
42 |
+
$playlist_files[] = $file;
|
43 |
+
}
|
44 |
+
}
|
45 |
+
}
|
46 |
+
@closedir($playlists_dir);
|
47 |
+
|
48 |
+
if( !$playlists_dir || empty($playlist_files)){
|
49 |
+
return $flag_playlists;
|
50 |
+
}
|
51 |
+
|
52 |
+
foreach($playlist_files as $playlist_file){
|
53 |
+
if( !is_readable("$playlist_root/$playlist_file")){
|
54 |
+
continue;
|
55 |
+
}
|
56 |
+
|
57 |
+
$playlist_data = get_playlist_data("$playlist_root/$playlist_file");
|
58 |
+
|
59 |
+
if(empty ($playlist_data['title'])){
|
60 |
+
continue;
|
61 |
+
}
|
62 |
+
|
63 |
+
$flag_playlists[ basename($playlist_file, ".xml") ] = $playlist_data;
|
64 |
+
}
|
65 |
+
uasort($flag_playlists, create_function('$a, $b', 'return strnatcasecmp( $a["title"], $b["title"] );'));
|
66 |
+
|
67 |
+
return $flag_playlists;
|
68 |
}
|
69 |
|
70 |
+
function flagSavePlaylist($title, $descr, $data, $file = '', $skinaction = ''){
|
71 |
+
|
72 |
+
if( !trim($title)){
|
73 |
+
$title = 'default';
|
74 |
+
}
|
75 |
+
$title = htmlspecialchars_decode(stripslashes($title), ENT_QUOTES);
|
76 |
+
$descr = htmlspecialchars_decode(stripslashes($descr), ENT_QUOTES);
|
77 |
+
if( !$file){
|
78 |
+
$file = sanitize_flagname($title);
|
79 |
+
}
|
80 |
+
if( !is_array($data)){
|
81 |
+
$data = explode(',', $data);
|
82 |
+
}
|
83 |
+
|
84 |
+
$flag_options = get_option('flag_options');
|
85 |
+
$skin = isset($_POST['skinname'])? sanitize_flagname($_POST['skinname']) : 'music_default';
|
86 |
+
if( !$skinaction){
|
87 |
+
$skinaction = isset($_POST['skinaction'])? sanitize_key($_POST['skinaction']) : 'update';
|
88 |
+
}
|
89 |
+
$skinpath = str_replace("\\","/", WP_PLUGIN_DIR ).'/flagallery-skins/'.$skin;
|
90 |
+
if(!is_dir($skinpath)) {
|
91 |
+
$skinpath = str_replace("\\","/", WP_PLUGIN_DIR ).'/flash-album-gallery/skins/'.$skin;
|
92 |
+
if(!is_dir($skinpath)) {
|
93 |
+
$skin = 'jq-mplayer';
|
94 |
+
$skinpath = str_replace("\\","/", WP_PLUGIN_DIR ).'/flagallery-skins/'.$skin;
|
95 |
+
if(!is_dir($skinpath)) {
|
96 |
+
$skinpath = str_replace("\\","/", WP_PLUGIN_DIR ).'/flash-album-gallery/skins/'.$skin;
|
97 |
+
}
|
98 |
+
}
|
99 |
+
}
|
100 |
+
$playlistPath = ABSPATH . $flag_options['galleryPath'] . 'playlists/' . $file . '.xml';
|
101 |
+
|
102 |
+
if(file_exists($skinpath . "/settings.php")){
|
103 |
+
/**
|
104 |
+
* @var $default_options
|
105 |
+
*/
|
106 |
+
include($skinpath . "/settings.php");
|
107 |
+
} else{
|
108 |
+
flagGallery::show_message(__("Can't find skin settings", 'flash-album-gallery'));
|
109 |
+
|
110 |
+
return;
|
111 |
+
}
|
112 |
+
|
113 |
+
$arr_xml_settings = array();
|
114 |
+
$settings = array();
|
115 |
+
if(file_exists($playlistPath)){
|
116 |
+
$playlist = file_get_contents($playlistPath);
|
117 |
+
$xml_settings = flagGallery::flagGetBetween($playlist, '<settings><![CDATA[', ']]></settings>');
|
118 |
+
if($xml_settings){
|
119 |
+
$arr_xml_settings = json_decode($xml_settings);
|
120 |
+
if(!empty($arr_xml_settings)){
|
121 |
+
$settings = array_replace_recursive((array)$arr_xml_settings, $settings);
|
122 |
+
}
|
123 |
+
}
|
124 |
+
}
|
125 |
+
if(empty($settings) || ($skin !== $skinaction)){
|
126 |
+
$settings = $default_options;
|
127 |
+
if(isset($flag_options["{$skin}_options"])){
|
128 |
+
$db_skin_options = maybe_unserialize( $flag_options["{$skin}_options"] );
|
129 |
+
$settings = array_replace_recursive( $settings, $db_skin_options );
|
130 |
+
}
|
131 |
+
}
|
132 |
+
$properties = json_encode($settings);
|
133 |
+
|
134 |
+
if(count($data)){
|
135 |
+
$content = '<gallery>
|
136 |
+
<settings><![CDATA[' . $properties . ']]></settings>
|
137 |
+
<category id="' . $file . '">
|
138 |
<properties>
|
139 |
+
<title><![CDATA[' . $title . ']]></title>
|
140 |
+
<description><![CDATA[' . $descr . ']]></description>
|
141 |
+
<skin><![CDATA[' . $skin . ']]></skin>
|
142 |
</properties>
|
143 |
<items>';
|
144 |
|
145 |
+
foreach((array) $data as $id){
|
146 |
+
$mp3 = get_post($id);
|
147 |
+
if( $mp3->ID){
|
148 |
+
$thumb = get_post_meta($id, 'thumbnail', true);
|
149 |
+
$content .= '
|
150 |
+
<item id="' . $mp3->ID . '">
|
151 |
+
<track>' . wp_get_attachment_url($mp3->ID) . '</track>
|
152 |
+
<title><![CDATA[' . $mp3->post_title . ']]></title>
|
153 |
+
<description><![CDATA[' . $mp3->post_content . ']]></description>
|
154 |
+
<thumbnail>' . $thumb . '</thumbnail>
|
155 |
</item>';
|
156 |
+
}
|
157 |
+
}
|
158 |
+
$content .= '
|
159 |
</items>
|
160 |
</category>
|
161 |
</gallery>';
|
162 |
+
// Save options
|
163 |
+
$flag_options = get_option('flag_options');
|
164 |
+
if(wp_mkdir_p(ABSPATH . $flag_options['galleryPath'] . 'playlists/')){
|
165 |
+
if(flagGallery::saveFile($playlistPath, $content, 'w')){
|
166 |
+
flagGallery::show_message(__('Playlist Saved Successfully', 'flash-album-gallery'));
|
167 |
+
}
|
168 |
+
} else{
|
169 |
+
flagGallery::show_message(__('Create directory please:', 'flash-album-gallery') . '"/' . $flag_options['galleryPath'] . 'playlists/"');
|
170 |
+
}
|
171 |
+
}
|
172 |
}
|
173 |
|
174 |
+
function flagSavePlaylistSkin($file){
|
175 |
+
|
176 |
+
$file = sanitize_flagname($file);
|
177 |
+
$flag_options = get_option('flag_options');
|
178 |
+
$playlistPath = ABSPATH . $flag_options['galleryPath'] . 'playlists/' . $file . '.xml';
|
179 |
+
// Save options
|
180 |
+
$title = esc_html($_POST['playlist_title']);
|
181 |
+
$descr = esc_html($_POST['playlist_descr']);
|
182 |
+
$items = get_playlist_data($playlistPath);
|
183 |
+
$data = $items['items'];
|
184 |
+
flagSavePlaylist($title, $descr, $data, $file, $skinaction = 'update');
|
185 |
}
|
186 |
|
187 |
+
function flag_playlist_delete($playlist){
|
188 |
+
$playlist = sanitize_flagname($playlist);
|
189 |
+
$flag_options = get_option('flag_options');
|
190 |
+
$playlistXML = ABSPATH . $flag_options['galleryPath'] . 'playlists/' . $playlist . '.xml';
|
191 |
+
if(file_exists($playlistXML)){
|
192 |
+
if(unlink($playlistXML)){
|
193 |
+
flagGallery::show_message("'" . $playlist . ".xml' " . __('deleted', 'flash-album-gallery'));
|
194 |
+
}
|
195 |
+
}
|
196 |
}
|
admin/settings.php
CHANGED
@@ -1,581 +1,630 @@
|
|
1 |
<?php
|
2 |
-
if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF']))
|
3 |
-
|
4 |
-
function flag_admin_options() {
|
5 |
-
|
6 |
-
global $flag;
|
7 |
-
|
8 |
-
// same as $_SERVER['REQUEST_URI'], but should work under IIS 6.0
|
9 |
-
$filepath = admin_url() . 'admin.php?page='.urlencode($_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 |
-
$options=array();
|
15 |
-
if ( $_POST['page_options'] )
|
16 |
-
$options = explode(',', stripslashes($_POST['page_options']));
|
17 |
-
if (!empty($options)) {
|
18 |
-
foreach ($options as $option) {
|
19 |
-
$option = trim($option);
|
20 |
-
if(isset($_POST[$option]))
|
21 |
-
$value = trim($_POST[$option]);
|
22 |
-
else
|
23 |
-
$value = false;
|
24 |
-
$flag->options[$option] = $value;
|
25 |
-
}
|
26 |
-
if(isset($_POST['galleryPath'])) {
|
27 |
-
// the path should always end with a slash
|
28 |
-
$flag->options['galleryPath'] = trailingslashit($flag->options['galleryPath']);
|
29 |
-
}
|
30 |
-
// the custom sortorder must be ascending
|
31 |
-
//$flag->options['galSortDir'] = ($flag->options['galSort'] == 'sortorder') ? 'ASC' : $flag->options['galSortDir'];
|
32 |
-
}
|
33 |
-
// Save options
|
34 |
-
update_option('flag_options', $flag->options);
|
35 |
-
|
36 |
-
flagGallery::show_message(__('Update Successfully','flag'));
|
37 |
-
}
|
38 |
-
$regform = 0;
|
39 |
-
if( isset($_POST['membership']) ){
|
40 |
-
if(function_exists('curl_init')){
|
41 |
-
check_admin_referer('flag_settings');
|
42 |
-
$ch = curl_init('http://mypgc.co/app/account_st.php');
|
43 |
-
curl_setopt ($ch, CURLOPT_REFERER, site_url());
|
44 |
-
curl_setopt ($ch, CURLOPT_POST, 1);
|
45 |
-
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
|
46 |
-
curl_setopt ($ch, CURLOPT_POSTFIELDS, array('access_key'=>$_POST['access_key'], 'access_url'=>$_POST['access_url'], 'license_key'=>$_POST['license_key']));
|
47 |
-
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 3);
|
48 |
-
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
|
49 |
-
$access_key_return = curl_exec ($ch);
|
50 |
-
curl_close ($ch);
|
51 |
-
} else {
|
52 |
-
$access_key_return = __('cURL library is not installed on your server.','flag');
|
53 |
-
}
|
54 |
-
if(strpos($access_key_return, 'Error') !== FALSE){
|
55 |
-
$_POST['license_key'] = '';
|
56 |
-
}
|
57 |
-
$options = explode(',', stripslashes($_POST['page_options']));
|
58 |
-
foreach ($options as $option) {
|
59 |
-
$option = trim($option);
|
60 |
-
$value = trim($_POST[$option]);
|
61 |
-
$flag->options[$option] = $value;
|
62 |
-
}
|
63 |
-
|
64 |
-
if(strpos($access_key_return, 'Error') === FALSE || strpos($access_key_return, 'not a member') !== FALSE){
|
65 |
-
flagGallery::show_message($access_key_return);
|
66 |
-
if(strpos($access_key_return, 'not a member') !== FALSE){
|
67 |
-
$regform = 1;
|
68 |
-
//$flag->options['access_key'] = '';
|
69 |
-
}
|
70 |
-
} else {
|
71 |
-
flagGallery::show_error($access_key_return);
|
72 |
-
//$flag->options['access_key'] = '';
|
73 |
-
}
|
74 |
-
|
75 |
-
// Save options
|
76 |
-
update_option('flag_options', $flag->options);
|
77 |
-
}
|
78 |
-
|
79 |
-
if( isset($_POST['register_subscriber']) ){
|
80 |
-
if(empty($_POST['customer_first_name']) || empty($_POST['customer_last_name']) || empty($_POST['customer_email'])){
|
81 |
-
$regform = 1;
|
82 |
-
flagGallery::show_error(__('Error: All fields required.'));
|
83 |
-
} else {
|
84 |
-
if(function_exists('curl_init')){
|
85 |
-
check_admin_referer('flag_settings');
|
86 |
-
$ch = curl_init('http://mypgc.co/app/account_st.php');
|
87 |
-
curl_setopt ($ch, CURLOPT_REFERER, site_url());
|
88 |
-
curl_setopt ($ch, CURLOPT_POST, 1);
|
89 |
-
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
|
90 |
-
curl_setopt ($ch, CURLOPT_POSTFIELDS, array('access_key'=>$_POST['access_key'], 'access_url'=>$_POST['access_url'], 'customer_first_name'=>$_POST['customer_first_name'], 'customer_last_name'=>$_POST['customer_last_name'], 'customer_email'=>$_POST['customer_email']));
|
91 |
-
$reg_return = curl_exec ($ch);
|
92 |
-
curl_close ($ch);
|
93 |
-
} else {
|
94 |
-
$reg_return = __('cURL library is not installed on your server.','flag');
|
95 |
-
}
|
96 |
-
|
97 |
-
if(strpos($reg_return, 'Error') === FALSE){
|
98 |
-
flagGallery::show_message($reg_return);
|
99 |
-
} else {
|
100 |
-
flagGallery::show_error($reg_return);
|
101 |
-
$regform = 1;
|
102 |
-
}
|
103 |
-
}
|
104 |
-
}
|
105 |
-
|
106 |
-
|
107 |
-
if ( isset($_POST['update_cap']) ) {
|
108 |
-
|
109 |
-
check_admin_referer('flag_addroles');
|
110 |
-
|
111 |
-
// now set or remove the capability
|
112 |
-
flag_set_capability($_POST['general'],"FlAG overview");
|
113 |
-
flag_set_capability($_POST['tinymce'],"FlAG Use TinyMCE");
|
114 |
-
flag_set_capability($_POST['add_gallery'],"FlAG Upload images");
|
115 |
-
flag_set_capability($_POST['import_gallery'],"FlAG Import folder");
|
116 |
-
flag_set_capability($_POST['manage_gallery'],"FlAG Manage gallery");
|
117 |
-
flag_set_capability($_POST['manage_others'],"FlAG Manage others gallery");
|
118 |
-
flag_set_capability($_POST['change_skin'],"FlAG Change skin");
|
119 |
-
flag_set_capability($_POST['add_skins'],"FlAG Add skins");
|
120 |
-
flag_set_capability($_POST['delete_skins'],"FlAG Delete skins");
|
121 |
-
flag_set_capability($_POST['change_options'],"FlAG Change options");
|
122 |
-
flag_set_capability($_POST['manage_music'],"FlAG Manage music");
|
123 |
-
flag_set_capability($_POST['manage_video'],"FlAG Manage video");
|
124 |
-
flag_set_capability($_POST['manage_banners'],"FlAG Manage banners");
|
125 |
-
flag_set_capability($_POST['flagframe_page'],"FlAG iFrame page");
|
126 |
-
|
127 |
-
flagGallery::show_message(__('Updated capabilities',"flag"));
|
128 |
-
}
|
129 |
-
|
130 |
-
// message windows
|
131 |
-
if(!empty($messagetext)) { echo '<!-- Last Action --><div id="message" class="updated fade"><p>'.$messagetext.'</p></div>'; }
|
132 |
-
|
133 |
-
$flag_options = get_option('flag_options');
|
134 |
-
?>
|
135 |
-
|
136 |
-
<div id="slider" class="flag-wrap">
|
137 |
-
|
138 |
-
<ul id="tabs" class="tabs">
|
139 |
-
<li class="selected"><a href="#" rel="imageoptions"><?php _e('Gallery Options', 'flag'); ?></a></li>
|
140 |
-
<li><a href="#" rel="grandpages"><?php _e('GRAND Pages', 'flag'); ?></a></li>
|
141 |
-
<?php if(current_user_can('administrator')){ ?>
|
142 |
-
<li><a href="#" rel="rControl"><?php _e('License Key & Remote Control', 'flag'); ?></a></li>
|
143 |
-
<?php } ?>
|
144 |
-
<li><a href="#" rel="vPlayer"><?php _e('FLV Single Player Options', 'flag'); ?></a></li>
|
145 |
-
<li><a href="#" rel="mPlayer"><?php _e('MP3 Single Player Options', 'flag'); ?></a></li>
|
146 |
-
<?php if (flagGallery::flag_wpmu_enable_function('wpmuRoles')) : ?>
|
147 |
-
<li><a href="#" rel="roles"><?php _e('Roles', 'flag'); ?></a></li>
|
148 |
-
<?php endif; ?>
|
149 |
-
</ul>
|
150 |
-
<!-- Image Gallery Options -->
|
151 |
-
<script type="text/javascript">
|
152 |
-
jQuery(document).ready(function() {
|
153 |
-
jQuery('.flag_colors .colorPick').each( function(){
|
154 |
-
var inpID = jQuery(this).attr('name');
|
155 |
-
jQuery('#cp_'+inpID).farbtastic('#'+inpID);
|
156 |
-
jQuery('#'+inpID).focus( function(){
|
157 |
-
jQuery('#cp_'+inpID).show();
|
158 |
-
});
|
159 |
-
jQuery('#'+inpID).blur( function(){
|
160 |
-
jQuery('#cp_'+inpID).hide();
|
161 |
-
});
|
162 |
-
});
|
163 |
-
});
|
164 |
-
</script>
|
165 |
-
<div id="imageoptions" class="cptab">
|
166 |
-
<form name="generaloptions" method="post">
|
167 |
-
<?php wp_nonce_field('flag_settings'); ?>
|
168 |
-
<input type="hidden" name="page_options" value="galleryPath,flashWidth,flashHeight,deleteImg,deepLinks,useMediaRSS,optimized_imgs,jAlterGal,jAlterGalScript,BarsBG,CatBGColor,CatBGColorOver,CatColor,CatColorOver,ThumbBG,ThumbLoaderColor,TitleColor,DescrColor,imgQuality,albSort,albSortDir,albPerPage,galSort,galSortDir,disableViews" />
|
169 |
-
<h2><?php _e('Image Gallery Options','flag'); ?></h2>
|
170 |
-
<h3><?php _e('General Options','flag'); ?></h3>
|
171 |
-
<table class="form-table flag-options" style="width: auto; white-space: nowrap;">
|
172 |
-
<tr valign="top">
|
173 |
-
<th align="left" width="200"><?php _e('Gallery path','flag'); ?></th>
|
174 |
-
<td><input readonly="readonly" type="text" size="35" name="galleryPath" value="<?php echo $flag_options['galleryPath']; ?>" />
|
175 |
-
<span class="setting-description"><?php _e('This is the default path for all galleries','flag'); ?></span></td>
|
176 |
-
</tr>
|
177 |
-
<tr valign="top">
|
178 |
-
<th><?php _e('Default flash size (W x H)','flag'); ?>:</th>
|
179 |
-
<td><input type="text" size="4" maxlength="4" name="flashWidth" value="<?php echo $flag_options['flashWidth']; ?>" /> x
|
180 |
-
<input type="text" size="4" maxlength="4" name="flashHeight" value="<?php echo $flag_options['flashHeight']; ?>" /></td>
|
181 |
-
</tr>
|
182 |
-
<tr valign="top">
|
183 |
-
<th align="left"><?php _e('Delete image files','flag'); ?></th>
|
184 |
-
<td><input <?php if (IS_WPMU) echo 'readonly = "readonly"'; ?> type="checkbox" name="deleteImg" value="1" <?php checked('1', $flag_options['deleteImg']); ?> />
|
185 |
-
<?php _e('Delete files, when removing a gallery in the database','flag'); ?></td>
|
186 |
-
</tr>
|
187 |
-
<tr>
|
188 |
-
<th align="left"><?php _e('Activate Deep Linking (optional)','flag'); ?><br /><small><?php _e('Not all skins support this feature.','flag'); ?></small></th>
|
189 |
-
<td><input type="checkbox" name="deepLinks" value="1" <?php checked('1', $flag_options['deepLinks']); ?> />
|
190 |
-
<span class="setting-description"><?php _e('Deep links for images in flash.','flag'); ?></span></td>
|
191 |
-
</tr>
|
192 |
-
<tr>
|
193 |
-
<th align="left"><?php _e('Activate Media RSS feed','flag'); ?></th>
|
194 |
-
<td><input type="checkbox" name="useMediaRSS" value="1" <?php checked('1', $flag_options['useMediaRSS']); ?> />
|
195 |
-
<span class="setting-description"><?php _e('A RSS feed will be added to you blog header.','flag'); ?></span></td>
|
196 |
-
</tr>
|
197 |
-
</table>
|
198 |
-
|
199 |
-
<h3><?php _e('Image settings','flag'); ?></h3>
|
200 |
-
<table class="form-table flag-options" style="width: auto; white-space: nowrap;">
|
201 |
-
<tr valign="top">
|
202 |
-
<th scope="row" width="200"><label><?php _e('Use optimized images for mobile browsers','flag'); ?></label><br /><small>(Manage Gallery -> 'Optimize images for web' action)</small></th>
|
203 |
-
<td><input type="checkbox" name="optimized_imgs" value="1" <?php checked('1', $flag_options['optimized_imgs']); ?> />
|
204 |
-
<span class="setting-description"><?php _e('Optimized images loads faster, save traffic and make page more lightweight for browser','flag'); ?></span></td>
|
205 |
-
</tr>
|
206 |
-
<tr valign="top">
|
207 |
-
<th align="left"><?php _e('Image quality','flag'); ?></th>
|
208 |
-
<td><input type="text" size="3" maxlength="3" name="imgQuality" value="<?php echo $flag_options['imgQuality']; ?>" /> % <span class="setting-description"><?php _e('Default: 85%','flag'); ?></span></td>
|
209 |
-
</tr>
|
210 |
-
</table>
|
211 |
-
|
212 |
-
<h3><?php _e('Sort options','flag'); ?></h3>
|
213 |
-
<table class="form-table flag-options" style="width: auto; white-space: nowrap;">
|
214 |
-
<tr>
|
215 |
-
<th valign="top" width="200"><?php _e('Sort galleries','flag'); ?>:</th>
|
216 |
-
<td valign="top">
|
217 |
-
<label><input name="albSort" type="radio" value="gid" <?php checked('gid', $flag_options['albSort']); ?> /> <?php _e('Gallery ID', 'flag'); ?></label><br />
|
218 |
-
<label><input name="albSort" type="radio" value="title" <?php checked('title', $flag_options['albSort']); ?> /> <?php _e('Title', 'flag'); ?></label><br />
|
219 |
-
</td>
|
220 |
-
<td valign="top"><label><input name="albSortDir" type="radio" value="ASC" <?php checked('ASC', $flag_options['albSortDir']); ?> /> <?php _e('Ascending', 'flag'); ?></label><br />
|
221 |
-
<label><input name="albSortDir" type="radio" value="DESC" <?php checked('DESC', $flag_options['albSortDir']); ?> /> <?php _e('Descending', 'flag'); ?></label>
|
222 |
-
</td>
|
223 |
-
</tr>
|
224 |
-
<tr style="border-bottom: 1px solid #000000;">
|
225 |
-
<th valign="top" width="200"><?php _e('Galleries per page: <br><small>on Manage Galleries page</small>','flag'); ?></th>
|
226 |
-
<td valign="top">
|
227 |
-
<input name="albPerPage" type="text" value="<?php echo $flag_options['albPerPage']; ?>" />
|
228 |
-
</td>
|
229 |
-
<td valign="top"></td>
|
230 |
-
</tr>
|
231 |
-
<tr>
|
232 |
-
<th valign="top" width="200"><?php _e('Sort images','flag'); ?>:</th>
|
233 |
-
<td valign="top">
|
234 |
-
<label><input name="galSort" type="radio" value="sortorder" <?php checked('sortorder', $flag_options['galSort']); ?> /> <?php _e('Custom order', 'flag'); ?></label><br />
|
235 |
-
<label><input name="galSort" type="radio" value="pid" <?php checked('pid', $flag_options['galSort']); ?> /> <?php _e('Image ID', 'flag'); ?></label><br />
|
236 |
-
<label><input name="galSort" type="radio" value="filename" <?php checked('filename', $flag_options['galSort']); ?> /> <?php _e('File name', 'flag'); ?></label><br />
|
237 |
-
<label><input name="galSort" type="radio" value="alttext" <?php checked('alttext', $flag_options['galSort']); ?> /> <?php _e('Alt / Title text', 'flag'); ?></label><br />
|
238 |
-
<label><input name="galSort" type="radio" value="imagedate" <?php checked('imagedate', $flag_options['galSort']); ?> /> <?php _e('Date / Time', 'flag'); ?></label><br />
|
239 |
-
<label><input name="galSort" type="radio" value="hitcounter" <?php checked('hitcounter', $flag_options['galSort']); ?> /> <?php _e('Image views', 'flag'); ?></label><br />
|
240 |
-
<label><input name="galSort" type="radio" value="total_votes" <?php checked('total_votes', $flag_options['galSort']); ?> /> <?php _e('Image likes', 'flag'); ?></label><br />
|
241 |
-
<label><input name="galSort" type="radio" value="rand()" <?php checked('rand()', $flag_options['galSort']); ?> /> <?php _e('Randomly', 'flag'); ?></label>
|
242 |
-
</td>
|
243 |
-
<td valign="top"><label><input name="galSortDir" type="radio" value="ASC" <?php checked('ASC', $flag_options['galSortDir']); ?> /> <?php _e('Ascending', 'flag'); ?></label><br />
|
244 |
-
<label><input name="galSortDir" type="radio" value="DESC" <?php checked('DESC', $flag_options['galSortDir']); ?> /> <?php _e('Descending', 'flag'); ?></label>
|
245 |
-
</td>
|
246 |
-
</tr>
|
247 |
-
</table>
|
248 |
-
|
249 |
-
<h3><?php _e('Alternative Gallery Options','flag'); ?> <br><small style="color: darkgreen;"><?php _e('(Note: this is not flash skin option. Options below only for alternative gallery in mobile browsers)','flag'); ?></small></h3>
|
250 |
-
<table class="flag_colors form-table flag-options" style="width: auto; white-space: nowrap;">
|
251 |
-
<tr>
|
252 |
-
<th align="left"><?php _e('Show jQuery gallery for browsers without flashplayer','flag'); ?></th>
|
253 |
-
<td><input type="checkbox" name="jAlterGal" value="1" <?php checked('1', $flag_options['jAlterGal']); ?> /></td>
|
254 |
-
</tr>
|
255 |
-
<tr>
|
256 |
-
<th align="left"><?php _e('jQuery gallery script','flag'); ?></th>
|
257 |
-
<td><select name="jAlterGalScript">
|
258 |
-
<option value="0" <?php selected('0', $flag_options['jAlterGalScript']); ?>>FancyBox</option>
|
259 |
-
<option value="1" <?php selected('1', $flag_options['jAlterGalScript']); ?>>PhotoSwipe</option>
|
260 |
-
</select>
|
261 |
-
</td>
|
262 |
-
</tr>
|
263 |
-
<tr>
|
264 |
-
<th align="left"><?php _e('Disable image views/likes counter on thumbnails','flag'); ?></th>
|
265 |
-
<td><input type="checkbox" name="disableViews" value="1" <?php checked('1', $flag_options['disableViews']); ?> /></td>
|
266 |
-
</tr>
|
267 |
-
<tr>
|
268 |
-
<th width="200"><?php _e('Top Bar BG','flag'); ?>:</th>
|
269 |
-
<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>
|
270 |
-
</tr>
|
271 |
-
<tr>
|
272 |
-
<th><?php _e('Category Buttons BG','flag'); ?>:</th>
|
273 |
-
<td>
|
274 |
-
<input class="colorPick" type="text" size="7" maxlength="6" id="CatBGColorOver" name="CatBGColorOver" value="<?php echo $flag_options['CatBGColorOver']; ?>" /> mouseOver<br />
|
275 |
-
<div id="cp_CatBGColorOver" style="background:#F9F9F9;position:absolute;display:none;"></div>
|
276 |
-
<input class="colorPick" type="text" size="7" maxlength="6" id="CatBGColor" name="CatBGColor" value="<?php echo $flag_options['CatBGColor']; ?>" /> mouseOut<br />
|
277 |
-
<div id="cp_CatBGColor" style="background:#F9F9F9;position:absolute;display:none;"></div>
|
278 |
-
</td>
|
279 |
-
</tr>
|
280 |
-
<tr>
|
281 |
-
<th><?php _e('Category Buttons Color','flag'); ?>:</th>
|
282 |
-
<td>
|
283 |
-
<input class="colorPick" type="text" size="7" maxlength="6" id="CatColorOver" name="CatColorOver" value="<?php echo $flag_options['CatColorOver']; ?>" /> mouseOver<br />
|
284 |
-
<div id="cp_CatColorOver" style="background:#F9F9F9;position:absolute;display:none;"></div>
|
285 |
-
<input class="colorPick" type="text" size="7" maxlength="6" id="CatColor" name="CatColor" value="<?php echo $flag_options['CatColor']; ?>" /> mouseOut<br />
|
286 |
-
<div id="cp_CatColor" style="background:#F9F9F9;position:absolute;display:none;"></div>
|
287 |
-
</td>
|
288 |
-
</tr>
|
289 |
-
<tr>
|
290 |
-
<th><?php _e('Thumbnail BG','flag'); ?>:</th>
|
291 |
-
<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>
|
292 |
-
</tr>
|
293 |
-
<tr>
|
294 |
-
<th><?php _e('Thumbnail MouseOver BG','flag'); ?>:</th>
|
295 |
-
<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>
|
296 |
-
</tr>
|
297 |
-
<tr>
|
298 |
-
<th><?php _e('Fancybox Title','flag'); ?>:<br /><small><?php _e('Only if FancyBox script is selected','flag'); ?></small></th>
|
299 |
-
<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>
|
300 |
-
</tr>
|
301 |
-
<tr>
|
302 |
-
<th><?php _e('Fancybox Description Text','flag'); ?>:<br /><small><?php _e('Only if FancyBox script is selected','flag'); ?></small></th>
|
303 |
-
<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>
|
304 |
-
</tr>
|
305 |
-
</table>
|
306 |
-
<div class="submit"><input class="button-primary" type="submit" name="updateoption" value="<?php _e('Save Changes', 'flag'); ?>"/></div>
|
307 |
-
</form>
|
308 |
-
</div>
|
309 |
-
|
310 |
-
<div id="grandpages" class="cptab">
|
311 |
-
<form name="grandpages" method="post">
|
312 |
-
<?php wp_nonce_field('flag_settings'); ?>
|
313 |
-
<input type="hidden" name="page_options" value="gp_jscode" />
|
314 |
-
<h2><?php _e('GRAND Pages settings','flag'); ?></h2>
|
315 |
-
<h3><?php _e('Google Analytics Tracking Code','flag'); ?></h3>
|
316 |
-
<textarea name="gp_jscode" rows="5" cols="50"><?php if(isset($flag_options['gp_jscode'])){ echo stripslashes($flag_options['gp_jscode']); } ?></textarea>
|
317 |
-
<p><?php _e('Enter your Google analytics tracking Code here. It will automatically be added to GRAND Pages so google can track your visitors behavior.', 'flag'); ?></p>
|
318 |
-
<div class="submit"><input class="button-primary" type="submit" name="updateoption" value="<?php _e('Save Changes', 'flag'); ?>"/></div>
|
319 |
-
</form>
|
320 |
-
</div>
|
321 |
-
|
322 |
-
<?php if(current_user_can('administrator')){ ?>
|
323 |
-
<div id="rControl" class="cptab">
|
324 |
-
<form name="rControl" method="post" style="float: left;width: 50%;">
|
325 |
-
<?php wp_nonce_field('flag_settings'); ?>
|
326 |
-
<input type="hidden" name="page_options" value="access_key,license_key" />
|
327 |
-
<h2><?php _e('License Key & Remote Control','flag'); ?></h2>
|
328 |
-
<input type="hidden" name="access_url" value="<?php echo plugins_url() . '/' . FLAGFOLDER . '/lib/app.php'; ?>" />
|
329 |
-
<table class="form-table flag-options" style="">
|
330 |
-
<tr>
|
331 |
-
<th valign="top" width="200"><a href="http://mypgc.co/membership/" target="_blank"><?php _e('License Key', 'flag') ?></a>:</th>
|
332 |
-
<td valign="top"><input type="text" size="40" id="license_key" name="license_key" value="<?php echo $flag_options['license_key']?>" /></td>
|
333 |
-
</tr>
|
334 |
-
<tr>
|
335 |
-
<td colspan="2"><br><?php _e('If you want to upload photos to FlAGallery right from your iPhone <a href="https://itunes.apple.com/us/app/mypgc/id663405181?ls=1&mt=8">download application</a> and enter access key below. You can enter your own access key. You can change these at any point in time and this will force all users to have to log in again in application.', 'flag'); ?> </td>
|
336 |
-
</tr>
|
337 |
-
<tr>
|
338 |
-
<th valign="top" width="200"><?php _e('Remote App Access Key','flag'); ?>:</th>
|
339 |
-
<td valign="top"><input type="text" size="40" id="access_key" name="access_key" value="<?php echo $flag_options['access_key']?>" />
|
340 |
-
<button type="button" onclick="jQuery('#flag_register_form').toggle();"><?php _e('Register free account Form', 'flag') ?></button>
|
341 |
-
<br><small><?php _e('Leave blank to disable access from application', 'flag'); ?></small></td>
|
342 |
-
</tr>
|
343 |
-
</table>
|
344 |
-
<p><a href="https://itunes.apple.com/us/app/mypgc/id663405181?ls=1&mt=8"><img src="<?php echo plugins_url() . '/' . FLAGFOLDER; ?>/admin/images/appstore_button.png" alt="Download from AppStore" /></a></p>
|
345 |
-
<div class="submit"><input class="button-primary" type="submit" name="membership" value="<?php _e('Update Settings for Remote Access', 'flag'); ?>"/></div>
|
346 |
-
</form>
|
347 |
-
|
348 |
-
<form id="flag_register_form" name="reg_on_mypgc" method="post" style="<?php if(!$regform || !empty($flag_options['access_key'])){ ?>display:none;<?php } ?> float: left; border: 1px solid #666666; background-color: #ffffee; margin-top: 95px; width: 49%;">
|
349 |
-
<?php wp_nonce_field('flag_settings'); ?>
|
350 |
-
<h3 style="padding-left: 10px;"><?php _e('Register with form below or <a href="http://mypgc.co/membership/" target="_blank">purchase license key</a>','flag'); ?></h3>
|
351 |
-
<div style="padding:0 10px;">
|
352 |
-
<p><?php _e("this email and password that you'll receive will be used to login in iOS application",'flag'); ?></p>
|
353 |
-
<p><b><?php _e("Note: if you already purchased license key or already registered this website you don't need register again. Just create your own Access Key and Save",'flag'); ?></b></p>
|
354 |
-
</div>
|
355 |
-
<input type="hidden" name="access_key" value="<?php echo $flag_options['access_key']?>" />
|
356 |
-
<input type="hidden" name="access_url" value="<?php echo plugins_url() . '/' . FLAGFOLDER . '/lib/app.php'; ?>" />
|
357 |
-
<table class="form-table" style="100%;">
|
358 |
-
<tr>
|
359 |
-
<td valign="top" style="width: 50%;"><?php _e('First Name', 'flag') ?>:<br><input type="text" id="customer_first_name" name="customer_first_name" value="" style="width: 95%;" /></td>
|
360 |
-
<td valign="top"><?php _e('Last Name', 'flag') ?>:<br><input type="text" id="customer_last_name" name="customer_last_name" value="" style="width: 95%;" /></td>
|
361 |
-
</tr>
|
362 |
-
<tr>
|
363 |
-
<td valign="top"><?php _e('Email', 'flag') ?>:<br><input type="text" size="54" id="customer_email" name="customer_email" value="" style="width: 95%;" /></td>
|
364 |
-
<td valign="top"><div class="submit"><input class="button-primary" type="submit" name="register_subscriber" value="<?php _e('Register', 'flag'); ?>"/></div></td>
|
365 |
-
</tr>
|
366 |
-
</table>
|
367 |
-
</form>
|
368 |
-
|
369 |
-
<div style="clear: both;"> </div>
|
370 |
-
</div>
|
371 |
-
<?php } ?>
|
372 |
-
|
373 |
-
<div id="vPlayer" class="cptab">
|
374 |
-
<form name="vPlayer" method="post">
|
375 |
-
<?php wp_nonce_field('flag_settings'); ?>
|
376 |
-
<input type="hidden" name="page_options" value="videoBG,vmColor1,vmColor2,vmAutoplay,vmWidth,vmHeight" />
|
377 |
-
<h2><?php _e('Flash Video Player Colors','flag'); ?></h2>
|
378 |
-
<table class="flag_colors form-table flag-options" style="width: auto; white-space: nowrap;">
|
379 |
-
<tr>
|
380 |
-
<th width="200"><?php _e('Video BG','flag'); ?>:</th>
|
381 |
-
<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>
|
382 |
-
</tr>
|
383 |
-
<tr>
|
384 |
-
<th><?php _e('Color 1','flag'); ?>:</th>
|
385 |
-
<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>
|
386 |
-
</tr>
|
387 |
-
<tr>
|
388 |
-
<th><?php _e('Color 2','flag'); ?>:</th>
|
389 |
-
<td>
|
390 |
-
<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>
|
391 |
-
</tr>
|
392 |
-
<tr>
|
393 |
-
<th><?php _e('Autoplay','flag'); ?>:</th>
|
394 |
-
<td>
|
395 |
-
<label><input name="vmAutoplay" type="radio" value="true" <?php checked('true', $flag_options['vmAutoplay']); ?> /> <?php _e('True', 'flag'); ?></label><br />
|
396 |
-
<label><input name="vmAutoplay" type="radio" value="false" <?php checked('false', $flag_options['vmAutoplay']); ?> /> <?php _e('False', 'flag'); ?></label><br />
|
397 |
-
</td>
|
398 |
-
</tr>
|
399 |
-
<tr>
|
400 |
-
<th><?php _e('Default Size','flag'); ?>:<br /><small>(width x height)</small></th>
|
401 |
-
<td>
|
402 |
-
<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']; ?>" />
|
403 |
-
</td>
|
404 |
-
</tr>
|
405 |
-
</table>
|
406 |
-
<div class="submit"><input class="button-primary" type="submit" name="updateoption" value="<?php _e('Save Changes', 'flag'); ?>"/></div>
|
407 |
-
</form>
|
408 |
-
</div>
|
409 |
-
|
410 |
-
<div id="mPlayer" class="cptab">
|
411 |
-
<form name="mPlayer" method="post">
|
412 |
-
<?php wp_nonce_field('flag_settings'); ?>
|
413 |
-
<input type="hidden" name="page_options" value="mpBG,mpColor1,mpColor2,mpAutoplay" />
|
414 |
-
<h2><?php _e('MP3 Player Colors','flag'); ?></h2>
|
415 |
-
<table class="flag_colors form-table flag-options" style="width: auto; white-space: nowrap;">
|
416 |
-
<tr>
|
417 |
-
<th width="200"><?php _e('Player BG','flag'); ?>:</th>
|
418 |
-
<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>
|
419 |
-
</tr>
|
420 |
-
<tr>
|
421 |
-
<th><?php _e('Color 1','flag'); ?>:</th>
|
422 |
-
<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>
|
423 |
-
</tr>
|
424 |
-
<tr>
|
425 |
-
<th><?php _e('Color 2','flag'); ?>:</th>
|
426 |
-
<td>
|
427 |
-
<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>
|
428 |
-
</tr>
|
429 |
-
<tr>
|
430 |
-
<th><?php _e('Autoplay','flag'); ?>:</th>
|
431 |
-
<td>
|
432 |
-
<label><input name="mpAutoplay" type="radio" value="true" <?php checked('true', $flag_options['mpAutoplay']); ?> /> <?php _e('True', 'flag'); ?></label><br />
|
433 |
-
<label><input name="mpAutoplay" type="radio" value="false" <?php checked('false', $flag_options['mpAutoplay']); ?> /> <?php _e('False', 'flag'); ?></label><br />
|
434 |
-
</td>
|
435 |
-
</tr>
|
436 |
-
</table>
|
437 |
-
<div class="submit"><input class="button-primary" type="submit" name="updateoption" value="<?php _e('Save Changes', 'flag'); ?>"/></div>
|
438 |
-
</form>
|
439 |
-
</div>
|
440 |
-
|
441 |
-
<?php if (flagGallery::flag_wpmu_enable_function('wpmuRoles')) : ?>
|
442 |
-
<div id="roles" class="cptab">
|
443 |
-
<form method="POST" name="addroles" id="addroles" accept-charset="utf-8">
|
444 |
-
<?php wp_nonce_field('flag_addroles'); ?>
|
445 |
-
<h2><?php _e('Roles / capabilities','flag'); ?></h2>
|
446 |
-
<div> </div>
|
447 |
-
<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>
|
448 |
-
<table class="form-table">
|
449 |
-
<tr valign="top">
|
450 |
-
<th scope="row" style="white-space: nowrap"><?php _e('Main Flash Album Gallery overview', 'flag'); ?>:</th>
|
451 |
-
<td><label for="general"><select style="width: 150px;" name="general" id="general"><?php wp_dropdown_roles( flag_get_role('FlAG overview') ); ?></select></label></td>
|
452 |
-
</tr>
|
453 |
-
<tr valign="top">
|
454 |
-
<th scope="row" style="white-space: nowrap"><?php _e('View TinyMCE Button / GRAND Pages', 'flag'); ?>:</th>
|
455 |
-
<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>
|
456 |
-
</tr>
|
457 |
-
<tr valign="top">
|
458 |
-
<th scope="row" style="white-space: nowrap"><?php _e('Add gallery / Upload images', 'flag'); ?>:</th>
|
459 |
-
<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>
|
460 |
-
</tr>
|
461 |
-
<tr valign="top">
|
462 |
-
<th scope="row" style="white-space: nowrap"><?php _e('Import images folder', 'flag'); ?>:</th>
|
463 |
-
<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>
|
464 |
-
</tr>
|
465 |
-
<tr valign="top">
|
466 |
-
<th scope="row" style="white-space: nowrap"><?php _e('Manage gallery', 'flag'); ?>:</th>
|
467 |
-
<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>
|
468 |
-
</tr>
|
469 |
-
<tr valign="top">
|
470 |
-
<th scope="row" style="white-space: nowrap"><?php _e('Manage others galleries and Albums', 'flag'); ?>:</th>
|
471 |
-
<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>
|
472 |
-
</tr>
|
473 |
-
<tr valign="top">
|
474 |
-
<th scope="row" style="white-space: nowrap"><?php _e('Manage music', 'flag'); ?>:</th>
|
475 |
-
<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>
|
476 |
-
</tr>
|
477 |
-
<tr valign="top">
|
478 |
-
<th scope="row" style="white-space: nowrap"><?php _e('Manage video', 'flag'); ?>:</th>
|
479 |
-
<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>
|
480 |
-
</tr>
|
481 |
-
<tr valign="top">
|
482 |
-
<th scope="row" style="white-space: nowrap"><?php _e('Manage banners', 'flag'); ?>:</th>
|
483 |
-
<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>
|
484 |
-
</tr>
|
485 |
-
<tr valign="top">
|
486 |
-
<th scope="row" style="white-space: nowrap"><?php _e('Change skin', 'flag'); ?>:</th>
|
487 |
-
<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>
|
488 |
-
</tr>
|
489 |
-
<tr valign="top">
|
490 |
-
<th scope="row" style="white-space: nowrap"><?php _e('Add skins', 'flag'); ?>:</th>
|
491 |
-
<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>
|
492 |
-
</tr>
|
493 |
-
<tr valign="top">
|
494 |
-
<th scope="row" style="white-space: nowrap"><?php _e('Delete skins', 'flag'); ?>:</th>
|
495 |
-
<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>
|
496 |
-
</tr>
|
497 |
-
<tr valign="top">
|
498 |
-
<th scope="row" style="white-space: nowrap"><?php _e('Change options', 'flag'); ?>:</th>
|
499 |
-
<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>
|
500 |
-
</tr>
|
501 |
-
<tr valign="top">
|
502 |
-
<th scope="row" style="white-space: nowrap"><?php _e('iFrame page', 'flag'); ?>:</th>
|
503 |
-
<td><label for="flagframe_page"><select style="width: 150px;" name="flagframe_page" id="flagframe_page"><?php wp_dropdown_roles( flag_get_role('FlAG iFrame page') ); ?></select></label></td>
|
504 |
-
</tr>
|
505 |
-
</table>
|
506 |
-
<div class="submit"><input type="submit" class="button-primary" name= "update_cap" value="<?php _e('Update capabilities', 'flag'); ?>"/></div>
|
507 |
-
</form>
|
508 |
-
</div>
|
509 |
-
<?php endif; ?>
|
510 |
-
</div>
|
511 |
-
<script type="text/javascript">
|
512 |
-
var cptabs=new ddtabcontent("tabs");
|
513 |
-
cptabs.setpersist(true);
|
514 |
-
cptabs.setselectedClassTarget("linkparent");
|
515 |
-
cptabs.init();
|
516 |
-
</script>
|
517 |
-
|
518 |
-
<?php
|
519 |
}
|
520 |
|
521 |
-
function
|
522 |
-
|
523 |
-
|
524 |
-
|
525 |
-
|
526 |
-
|
527 |
-
|
528 |
-
|
529 |
-
|
530 |
-
|
531 |
-
|
532 |
-
|
533 |
-
|
534 |
-
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
-
|
539 |
-
|
540 |
-
|
541 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
542 |
}
|
543 |
|
544 |
function flag_get_role($capability){
|
545 |
-
|
546 |
-
|
547 |
-
|
548 |
-
|
549 |
-
|
550 |
-
|
551 |
-
|
552 |
-
|
553 |
-
|
554 |
-
|
555 |
-
|
556 |
-
|
557 |
-
|
558 |
-
|
|
|
|
|
|
|
559 |
}
|
560 |
|
561 |
function flag_set_capability($lowest_role, $capability){
|
562 |
-
|
563 |
-
|
564 |
-
|
565 |
-
|
566 |
-
|
567 |
-
|
568 |
-
|
569 |
-
|
570 |
-
|
571 |
-
|
572 |
-
|
573 |
-
|
574 |
-
|
575 |
-
|
576 |
-
|
577 |
-
|
578 |
-
|
579 |
-
|
580 |
-
|
|
|
|
|
581 |
}
|
1 |
<?php
|
2 |
+
if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])){
|
3 |
+
die('You are not allowed to call this page directly.');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
}
|
5 |
|
6 |
+
function flag_admin_options(){
|
7 |
+
|
8 |
+
global $flag;
|
9 |
+
|
10 |
+
// same as $_SERVER['REQUEST_URI'], but should work under IIS 6.0
|
11 |
+
$filepath = admin_url() . 'admin.php?page=' . urlencode($_GET['page']);
|
12 |
+
|
13 |
+
if(isset($_POST['updateoption'])){
|
14 |
+
check_admin_referer('flag_settings');
|
15 |
+
// get the hidden option fields, taken from WP core
|
16 |
+
$options = array();
|
17 |
+
if($_POST['page_options']){
|
18 |
+
$options = explode(',', stripslashes($_POST['page_options']));
|
19 |
+
}
|
20 |
+
if( !empty($options)){
|
21 |
+
foreach($options as $option){
|
22 |
+
$option = trim($option);
|
23 |
+
if(isset($_POST[ $option ])){
|
24 |
+
$value = trim($_POST[ $option ]);
|
25 |
+
} else{
|
26 |
+
$value = false;
|
27 |
+
}
|
28 |
+
$flag->options[ $option ] = $value;
|
29 |
+
}
|
30 |
+
if(isset($_POST['galleryPath'])){
|
31 |
+
// the path should always end with a slash
|
32 |
+
$flag->options['galleryPath'] = trailingslashit($flag->options['galleryPath']);
|
33 |
+
}
|
34 |
+
// the custom sortorder must be ascending
|
35 |
+
//$flag->options['galSortDir'] = ($flag->options['galSort'] == 'sortorder') ? 'ASC' : $flag->options['galSortDir'];
|
36 |
+
}
|
37 |
+
// Save options
|
38 |
+
update_option('flag_options', $flag->options);
|
39 |
+
|
40 |
+
flagGallery::show_message(__('Update Successfully', 'flash-album-gallery'));
|
41 |
+
}
|
42 |
+
$regform = 0;
|
43 |
+
if(isset($_POST['membership'])){
|
44 |
+
if(function_exists('curl_init')){
|
45 |
+
check_admin_referer('flag_settings');
|
46 |
+
$ch = curl_init('http://mypgc.co/app/account_st.php');
|
47 |
+
curl_setopt($ch, CURLOPT_REFERER, site_url());
|
48 |
+
curl_setopt($ch, CURLOPT_POST, 1);
|
49 |
+
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
50 |
+
curl_setopt($ch, CURLOPT_POSTFIELDS, array(
|
51 |
+
'access_key' => $_POST['access_key'],
|
52 |
+
'access_url' => $_POST['access_url'],
|
53 |
+
'license_key' => $_POST['license_key'],
|
54 |
+
)
|
55 |
+
);
|
56 |
+
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 3);
|
57 |
+
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
|
58 |
+
$access_key_return = curl_exec($ch);
|
59 |
+
curl_close($ch);
|
60 |
+
} else{
|
61 |
+
$access_key_return = __('cURL library is not installed on your server.', 'flash-album-gallery');
|
62 |
+
}
|
63 |
+
if(strpos($access_key_return, 'Error') !== false){
|
64 |
+
$_POST['license_key'] = '';
|
65 |
+
}
|
66 |
+
|
67 |
+
if( !empty($_POST['license_key']) && function_exists('curl_init')){
|
68 |
+
$ch = curl_init('https://mypgc.co/app/account_st.php');
|
69 |
+
curl_setopt($ch, CURLOPT_REFERER, home_url());
|
70 |
+
curl_setopt($ch, CURLOPT_POST, 1);
|
71 |
+
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
72 |
+
curl_setopt($ch, CURLOPT_POSTFIELDS, array('check_status' => $_POST['license_key']));
|
73 |
+
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 3);
|
74 |
+
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
|
75 |
+
$status = curl_exec($ch);
|
76 |
+
curl_close($ch);
|
77 |
+
if($status === '0'){
|
78 |
+
$flag->options['license_name'] = '';
|
79 |
+
} elseif($status === ''){
|
80 |
+
$flag->options['license_name'] = '';
|
81 |
+
} else{
|
82 |
+
$flag->options['license_name'] = $status;
|
83 |
+
}
|
84 |
+
}
|
85 |
+
|
86 |
+
$options = explode(',', stripslashes($_POST['page_options']));
|
87 |
+
foreach($options as $option){
|
88 |
+
$option = trim($option);
|
89 |
+
$value = trim($_POST[ $option ]);
|
90 |
+
$flag->options[ $option ] = $value;
|
91 |
+
}
|
92 |
+
|
93 |
+
if(strpos($access_key_return, 'Error') === false || strpos($access_key_return, 'not a member') !== false){
|
94 |
+
flagGallery::show_message($access_key_return);
|
95 |
+
if(strpos($access_key_return, 'not a member') !== false){
|
96 |
+
$regform = 1;
|
97 |
+
//$flag->options['access_key'] = '';
|
98 |
+
}
|
99 |
+
} else{
|
100 |
+
flagGallery::show_error($access_key_return);
|
101 |
+
//$flag->options['access_key'] = '';
|
102 |
+
}
|
103 |
+
|
104 |
+
// Save options
|
105 |
+
update_option('flag_options', $flag->options);
|
106 |
+
}
|
107 |
+
|
108 |
+
if(isset($_POST['register_subscriber'])){
|
109 |
+
if(empty($_POST['customer_first_name']) || empty($_POST['customer_last_name']) || empty($_POST['customer_email'])){
|
110 |
+
$regform = 1;
|
111 |
+
flagGallery::show_error(__('Error: All fields required.'));
|
112 |
+
} else{
|
113 |
+
if(function_exists('curl_init')){
|
114 |
+
check_admin_referer('flag_settings');
|
115 |
+
$ch = curl_init('http://mypgc.co/app/account_st.php');
|
116 |
+
curl_setopt($ch, CURLOPT_REFERER, site_url());
|
117 |
+
curl_setopt($ch, CURLOPT_POST, 1);
|
118 |
+
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
119 |
+
curl_setopt($ch, CURLOPT_POSTFIELDS, array(
|
120 |
+
'access_key' => $_POST['access_key'],
|
121 |
+
'access_url' => $_POST['access_url'],
|
122 |
+
'customer_first_name' => $_POST['customer_first_name'],
|
123 |
+
'customer_last_name' => $_POST['customer_last_name'],
|
124 |
+
'customer_email' => $_POST['customer_email'],
|
125 |
+
)
|
126 |
+
);
|
127 |
+
$reg_return = curl_exec($ch);
|
128 |
+
curl_close($ch);
|
129 |
+
} else{
|
130 |
+
$reg_return = __('cURL library is not installed on your server.', 'flash-album-gallery');
|
131 |
+
}
|
132 |
+
|
133 |
+
if(strpos($reg_return, 'Error') === false){
|
134 |
+
flagGallery::show_message($reg_return);
|
135 |
+
} else{
|
136 |
+
flagGallery::show_error($reg_return);
|
137 |
+
$regform = 1;
|
138 |
+
}
|
139 |
+
}
|
140 |
+
}
|
141 |
+
|
142 |
+
|
143 |
+
if(isset($_POST['update_cap'])){
|
144 |
+
|
145 |
+
check_admin_referer('flag_addroles');
|
146 |
+
|
147 |
+
// now set or remove the capability
|
148 |
+
flag_set_capability($_POST['general'], "FlAG overview");
|
149 |
+
flag_set_capability($_POST['tinymce'], "FlAG Use TinyMCE");
|
150 |
+
flag_set_capability($_POST['add_gallery'], "FlAG Upload images");
|
151 |
+
flag_set_capability($_POST['import_gallery'], "FlAG Import folder");
|
152 |
+
flag_set_capability($_POST['manage_gallery'], "FlAG Manage gallery");
|
153 |
+
flag_set_capability($_POST['manage_others'], "FlAG Manage others gallery");
|
154 |
+
flag_set_capability($_POST['change_skin'], "FlAG Change skin");
|
155 |
+
flag_set_capability($_POST['add_skins'], "FlAG Add skins");
|
156 |
+
flag_set_capability($_POST['delete_skins'], "FlAG Delete skins");
|
157 |
+
flag_set_capability($_POST['change_options'], "FlAG Change options");
|
158 |
+
flag_set_capability($_POST['manage_music'], "FlAG Manage music");
|
159 |
+
flag_set_capability($_POST['manage_video'], "FlAG Manage video");
|
160 |
+
flag_set_capability($_POST['manage_banners'], "FlAG Manage banners");
|
161 |
+
flag_set_capability($_POST['flagframe_page'], "FlAG iFrame page");
|
162 |
+
|
163 |
+
flagGallery::show_message(__('Updated capabilities', "flash-album-gallery"));
|
164 |
+
}
|
165 |
+
|
166 |
+
// message windows
|
167 |
+
if( !empty($messagetext)){
|
168 |
+
echo '<!-- Last Action --><div id="message" class="updated fade"><p>' . $messagetext . '</p></div>';
|
169 |
+
}
|
170 |
+
|
171 |
+
$flag_options = get_option('flag_options');
|
172 |
+
?>
|
173 |
+
|
174 |
+
<div id="slider" class="flag-wrap">
|
175 |
+
|
176 |
+
<ul id="tabs" class="tabs">
|
177 |
+
<li class="selected">
|
178 |
+
<a href="#" rel="imageoptions"><?php _e('Gallery Options', 'flash-album-gallery'); ?></a></li>
|
179 |
+
<li><a href="#" rel="grandpages"><?php _e('GRAND Pages', 'flash-album-gallery'); ?></a></li>
|
180 |
+
<?php if(current_user_can('administrator')){ ?>
|
181 |
+
<li><a href="#" rel="rControl"><?php _e('License Key & Remote Control', 'flash-album-gallery'); ?></a>
|
182 |
+
</li>
|
183 |
+
<?php if(flagGallery::flag_wpmu_enable_function('wpmuRoles')) : ?>
|
184 |
+
<li><a href="#" rel="roles"><?php _e('Roles', 'flash-album-gallery'); ?></a></li>
|
185 |
+
<?php endif; ?>
|
186 |
+
<?php } ?>
|
187 |
+
</ul>
|
188 |
+
<!-- Image Gallery Options -->
|
189 |
+
<script type="text/javascript">
|
190 |
+
jQuery(document).ready(function(){
|
191 |
+
jQuery('.flag_colors .colorPick').each(function(){
|
192 |
+
var inpID = jQuery(this).attr('name');
|
193 |
+
jQuery('#cp_' + inpID).farbtastic('#' + inpID);
|
194 |
+
jQuery('#' + inpID).focus(function(){
|
195 |
+
jQuery('#cp_' + inpID).show();
|
196 |
+
});
|
197 |
+
jQuery('#' + inpID).blur(function(){
|
198 |
+
jQuery('#cp_' + inpID).hide();
|
199 |
+
});
|
200 |
+
});
|
201 |
+
});
|
202 |
+
</script>
|
203 |
+
<div id="imageoptions" class="cptab">
|
204 |
+
<form name="generaloptions" method="post">
|
205 |
+
<?php wp_nonce_field('flag_settings'); ?>
|
206 |
+
<input type="hidden" name="page_options" value="galleryPath,flashWidth,flashHeight,deleteImg,deepLinks,useMediaRSS,imgQuality,albSort,albSortDir,albPerPage,galSort,galSortDir,disableViews"/>
|
207 |
+
<h2><?php _e('Image Gallery Options', 'flash-album-gallery'); ?></h2>
|
208 |
+
<h3><?php _e('General Options', 'flash-album-gallery'); ?></h3>
|
209 |
+
<table class="form-table flag-options" style="width: auto; white-space: nowrap;">
|
210 |
+
<tr valign="top">
|
211 |
+
<th align="left" width="200"><?php _e('Gallery path', 'flash-album-gallery'); ?></th>
|
212 |
+
<td>
|
213 |
+
<input readonly="readonly" type="text" size="35" name="galleryPath" value="<?php echo $flag_options['galleryPath']; ?>"/>
|
214 |
+
<span class="setting-description"><?php _e('This is the default path for all galleries', 'flash-album-gallery'); ?></span>
|
215 |
+
</td>
|
216 |
+
</tr>
|
217 |
+
<tr valign="top">
|
218 |
+
<th align="left"><?php _e('Delete image files', 'flash-album-gallery'); ?></th>
|
219 |
+
<td><input <?php if(IS_WPMU){
|
220 |
+
echo 'readonly = "readonly"';
|
221 |
+
} ?> type="checkbox" name="deleteImg" value="1" <?php checked('1', $flag_options['deleteImg']); ?> />
|
222 |
+
<?php _e('Delete files, when removing a gallery in the database', 'flash-album-gallery'); ?>
|
223 |
+
</td>
|
224 |
+
</tr>
|
225 |
+
<tr>
|
226 |
+
<th align="left"><?php _e('Activate Media RSS feed', 'flash-album-gallery'); ?></th>
|
227 |
+
<td>
|
228 |
+
<input type="checkbox" name="useMediaRSS" value="1" <?php checked('1', $flag_options['useMediaRSS']); ?> />
|
229 |
+
<span class="setting-description"><?php _e('A RSS feed will be added to you blog header.', 'flash-album-gallery'); ?></span>
|
230 |
+
</td>
|
231 |
+
</tr>
|
232 |
+
</table>
|
233 |
+
|
234 |
+
<h3><?php _e('Image settings', 'flash-album-gallery'); ?></h3>
|
235 |
+
<table class="form-table flag-options" style="width: auto; white-space: nowrap;">
|
236 |
+
<tr valign="top">
|
237 |
+
<th align="left"><?php _e('Image quality', 'flash-album-gallery'); ?></th>
|
238 |
+
<td>
|
239 |
+
<input type="text" size="3" maxlength="3" name="imgQuality" value="<?php echo $flag_options['imgQuality']; ?>"/>
|
240 |
+
%
|
241 |
+
<span class="setting-description"><?php _e('Default: 85%', 'flash-album-gallery'); ?></span>
|
242 |
+
</td>
|
243 |
+
</tr>
|
244 |
+
</table>
|
245 |
+
|
246 |
+
<h3><?php _e('Sort options', 'flash-album-gallery'); ?></h3>
|
247 |
+
<table class="form-table flag-options" style="width: auto; white-space: nowrap;">
|
248 |
+
<tr>
|
249 |
+
<th valign="top" width="200"><?php _e('Sort galleries', 'flash-album-gallery'); ?>:</th>
|
250 |
+
<td valign="top">
|
251 |
+
<label><input name="albSort" type="radio" value="gid" <?php checked('gid', $flag_options['albSort']); ?> /> <?php _e('Gallery ID', 'flash-album-gallery'); ?>
|
252 |
+
</label><br/>
|
253 |
+
<label><input name="albSort" type="radio" value="title" <?php checked('title', $flag_options['albSort']); ?> /> <?php _e('Title', 'flash-album-gallery'); ?>
|
254 |
+
</label><br/>
|
255 |
+
</td>
|
256 |
+
<td valign="top">
|
257 |
+
<label><input name="albSortDir" type="radio" value="ASC" <?php checked('ASC', $flag_options['albSortDir']); ?> /> <?php _e('Ascending', 'flash-album-gallery'); ?>
|
258 |
+
</label><br/>
|
259 |
+
<label><input name="albSortDir" type="radio" value="DESC" <?php checked('DESC', $flag_options['albSortDir']); ?> /> <?php _e('Descending', 'flash-album-gallery'); ?>
|
260 |
+
</label>
|
261 |
+
</td>
|
262 |
+
</tr>
|
263 |
+
<tr style="border-bottom: 1px solid #000000;">
|
264 |
+
<th valign="top" width="200"><?php _e('Galleries per page: <br><small>on Manage Galleries page</small>', 'flash-album-gallery'); ?></th>
|
265 |
+
<td valign="top">
|
266 |
+
<input name="albPerPage" type="text" value="<?php echo $flag_options['albPerPage']; ?>"/>
|
267 |
+
</td>
|
268 |
+
<td valign="top"></td>
|
269 |
+
</tr>
|
270 |
+
<tr>
|
271 |
+
<th valign="top" width="200"><?php _e('Sort images', 'flash-album-gallery'); ?>:</th>
|
272 |
+
<td valign="top">
|
273 |
+
<label><input name="galSort" type="radio" value="sortorder" <?php checked('sortorder', $flag_options['galSort']); ?> /> <?php _e('Custom order', 'flash-album-gallery'); ?>
|
274 |
+
</label><br/>
|
275 |
+
<label><input name="galSort" type="radio" value="pid" <?php checked('pid', $flag_options['galSort']); ?> /> <?php _e('Image ID', 'flash-album-gallery'); ?>
|
276 |
+
</label><br/>
|
277 |
+
<label><input name="galSort" type="radio" value="filename" <?php checked('filename', $flag_options['galSort']); ?> /> <?php _e('File name', 'flash-album-gallery'); ?>
|
278 |
+
</label><br/>
|
279 |
+
<label><input name="galSort" type="radio" value="alttext" <?php checked('alttext', $flag_options['galSort']); ?> /> <?php _e('Alt / Title text', 'flash-album-gallery'); ?>
|
280 |
+
</label><br/>
|
281 |
+
<label><input name="galSort" type="radio" value="imagedate" <?php checked('imagedate', $flag_options['galSort']); ?> /> <?php _e('Date / Time', 'flash-album-gallery'); ?>
|
282 |
+
</label><br/>
|
283 |
+
<label><input name="galSort" type="radio" value="hitcounter" <?php checked('hitcounter', $flag_options['galSort']); ?> /> <?php _e('Image views', 'flash-album-gallery'); ?>
|
284 |
+
</label><br/>
|
285 |
+
<label><input name="galSort" type="radio" value="total_votes" <?php checked('total_votes', $flag_options['galSort']); ?> /> <?php _e('Image likes', 'flash-album-gallery'); ?>
|
286 |
+
</label><br/>
|
287 |
+
<label><input name="galSort" type="radio" value="rand()" <?php checked('rand()', $flag_options['galSort']); ?> /> <?php _e('Randomly', 'flash-album-gallery'); ?>
|
288 |
+
</label>
|
289 |
+
</td>
|
290 |
+
<td valign="top">
|
291 |
+
<label><input name="galSortDir" type="radio" value="ASC" <?php checked('ASC', $flag_options['galSortDir']); ?> /> <?php _e('Ascending', 'flash-album-gallery'); ?>
|
292 |
+
</label><br/>
|
293 |
+
<label><input name="galSortDir" type="radio" value="DESC" <?php checked('DESC', $flag_options['galSortDir']); ?> /> <?php _e('Descending', 'flash-album-gallery'); ?>
|
294 |
+
</label>
|
295 |
+
</td>
|
296 |
+
</tr>
|
297 |
+
</table>
|
298 |
+
<div class="submit">
|
299 |
+
<input class="button-primary" type="submit" name="updateoption" value="<?php _e('Save Changes', 'flash-album-gallery'); ?>"/>
|
300 |
+
</div>
|
301 |
+
</form>
|
302 |
+
</div>
|
303 |
+
|
304 |
+
<div id="grandpages" class="cptab">
|
305 |
+
<form name="grandpages" method="post">
|
306 |
+
<?php wp_nonce_field('flag_settings'); ?>
|
307 |
+
<input type="hidden" name="page_options" value="gp_jscode"/>
|
308 |
+
<h2><?php _e('GRAND Pages settings', 'flash-album-gallery'); ?></h2>
|
309 |
+
<h3><?php _e('Google Analytics Tracking Code', 'flash-album-gallery'); ?></h3>
|
310 |
+
<textarea name="gp_jscode" rows="5" cols="50"><?php if(isset($flag_options['gp_jscode'])){
|
311 |
+
echo stripslashes($flag_options['gp_jscode']);
|
312 |
+
} ?></textarea>
|
313 |
+
<p><?php _e('Enter your Google analytics tracking Code here. It will automatically be added to GRAND Pages so google can track your visitors behavior.', 'flash-album-gallery'); ?></p>
|
314 |
+
<div class="submit">
|
315 |
+
<input class="button-primary" type="submit" name="updateoption" value="<?php _e('Save Changes', 'flash-album-gallery'); ?>"/>
|
316 |
+
</div>
|
317 |
+
</form>
|
318 |
+
</div>
|
319 |
+
|
320 |
+
<?php if(current_user_can('administrator')){ ?>
|
321 |
+
<div id="rControl" class="cptab">
|
322 |
+
<form name="rControl" method="post" style="float: left;width: 50%;">
|
323 |
+
<?php wp_nonce_field('flag_settings'); ?>
|
324 |
+
<input type="hidden" name="page_options" value="access_key,license_key"/>
|
325 |
+
<h2><?php _e('License Key & Remote Control', 'flash-album-gallery'); ?></h2>
|
326 |
+
<input type="hidden" name="access_url" value="<?php echo plugins_url() . '/' . FLAGFOLDER . '/lib/app.php'; ?>"/>
|
327 |
+
<table class="form-table flag-options" style="">
|
328 |
+
<tr>
|
329 |
+
<th valign="top" width="200">
|
330 |
+
<a href="http://mypgc.co/membership/" target="_blank"><?php _e('License Key', 'flash-album-gallery') ?></a>:
|
331 |
+
</th>
|
332 |
+
<td valign="top">
|
333 |
+
<input type="text" size="40" id="license_key" name="license_key" value="<?php echo $flag_options['license_key'] ?>"/>
|
334 |
+
<?php
|
335 |
+
if( !$flag_options['license_name']){
|
336 |
+
?>
|
337 |
+
<p>
|
338 |
+
<a href="http://bit.ly/2jPNRB0" class="button button-primary button-red" target="_blank"><?php _e('Get Premium', 'flash-album-gallery') ?></a>
|
339 |
+
</p>
|
340 |
+
<?php
|
341 |
+
} else{
|
342 |
+
if('MINIPack' === $flag_options['license_name']){
|
343 |
+
?>
|
344 |
+
<p>
|
345 |
+
<a href="http://bit.ly/2jPNRB0" class="button button-primary button-red" target="_blank"><?php _e('Upgrade License to GRANDPack or GRANDPack+', 'flash-album-gallery') ?></a>
|
346 |
+
</p>
|
347 |
+
<?php
|
348 |
+
} elseif('GRANDPack' === $flag_options['license_name']){
|
349 |
+
?>
|
350 |
+
<p>
|
351 |
+
<a href="http://bit.ly/2jPNRB0" class="button button-primary button-red" target="_blank"><?php _e('Upgrade License to GRANDPack+', 'flash-album-gallery') ?></a>
|
352 |
+
</p>
|
353 |
+
<?php
|
354 |
+
}
|
355 |
+
}
|
356 |
+
?>
|
357 |
+
</td>
|
358 |
+
</tr>
|
359 |
+
<tr>
|
360 |
+
<td colspan="2">
|
361 |
+
<br><?php _e('If you want to upload photos to FlAGallery right from your iPhone <a href="https://itunes.apple.com/us/app/mypgc/id663405181?ls=1&mt=8">download application</a> and enter access key below. You can enter your own access key. You can change these at any point in time and this will force all users to have to log in again in application.', 'flash-album-gallery'); ?>
|
362 |
+
</td>
|
363 |
+
</tr>
|
364 |
+
<tr>
|
365 |
+
<th valign="top" width="200"><?php _e('Remote App Access Key', 'flash-album-gallery'); ?>:
|
366 |
+
</th>
|
367 |
+
<td valign="top">
|
368 |
+
<input type="text" size="40" id="access_key" name="access_key" value="<?php echo $flag_options['access_key'] ?>"/>
|
369 |
+
<button type="button" onclick="jQuery('#flag_register_form').toggle();"><?php _e('Register free account Form', 'flash-album-gallery') ?></button>
|
370 |
+
<br>
|
371 |
+
<small><?php _e('Leave blank to disable access from application', 'flash-album-gallery'); ?></small>
|
372 |
+
</td>
|
373 |
+
</tr>
|
374 |
+
</table>
|
375 |
+
<p>
|
376 |
+
<a href="https://itunes.apple.com/us/app/mypgc/id663405181?ls=1&mt=8"><img src="<?php echo plugins_url() . '/' . FLAGFOLDER; ?>/admin/images/appstore_button.png" alt="Download from AppStore"/></a>
|
377 |
+
</p>
|
378 |
+
<div class="submit">
|
379 |
+
<input class="button-primary" type="submit" name="membership" value="<?php _e('Update Settings for Remote Access', 'flash-album-gallery'); ?>"/>
|
380 |
+
</div>
|
381 |
+
</form>
|
382 |
+
|
383 |
+
<form id="flag_register_form" name="reg_on_mypgc" method="post" style="<?php if( !$regform || !empty($flag_options['access_key'])){ ?>display:none;<?php } ?> float: left; border: 1px solid #666666; background-color: #ffffee; margin-top: 95px; width: 49%;">
|
384 |
+
<?php wp_nonce_field('flag_settings'); ?>
|
385 |
+
<h3 style="padding-left: 10px;"><?php _e('Register with form below or <a href="http://mypgc.co/membership/" target="_blank">purchase license key</a>', 'flash-album-gallery'); ?></h3>
|
386 |
+
<div style="padding:0 10px;">
|
387 |
+
<p><?php _e("this email and password that you'll receive will be used to login in iOS application", 'flash-album-gallery'); ?></p>
|
388 |
+
<p>
|
389 |
+
<b><?php _e("Note: if you already purchased license key or already registered this website you don't need register again. Just create your own Access Key and Save", 'flash-album-gallery'); ?></b>
|
390 |
+
</p>
|
391 |
+
</div>
|
392 |
+
<input type="hidden" name="access_key" value="<?php echo $flag_options['access_key'] ?>"/>
|
393 |
+
<input type="hidden" name="access_url" value="<?php echo plugins_url() . '/' . FLAGFOLDER . '/lib/app.php'; ?>"/>
|
394 |
+
<table class="form-table" style="100%;">
|
395 |
+
<tr>
|
396 |
+
<td valign="top" style="width: 50%;"><?php _e('First Name', 'flash-album-gallery') ?>
|
397 |
+
:<br><input type="text" id="customer_first_name" name="customer_first_name" value="" style="width: 95%;"/>
|
398 |
+
</td>
|
399 |
+
<td valign="top"><?php _e('Last Name', 'flash-album-gallery') ?>
|
400 |
+
:<br><input type="text" id="customer_last_name" name="customer_last_name" value="" style="width: 95%;"/>
|
401 |
+
</td>
|
402 |
+
</tr>
|
403 |
+
<tr>
|
404 |
+
<td valign="top"><?php _e('Email', 'flash-album-gallery') ?>
|
405 |
+
:<br><input type="text" size="54" id="customer_email" name="customer_email" value="" style="width: 95%;"/>
|
406 |
+
</td>
|
407 |
+
<td valign="top">
|
408 |
+
<div class="submit">
|
409 |
+
<input class="button-primary" type="submit" name="register_subscriber" value="<?php _e('Register', 'flash-album-gallery'); ?>"/>
|
410 |
+
</div>
|
411 |
+
</td>
|
412 |
+
</tr>
|
413 |
+
</table>
|
414 |
+
</form>
|
415 |
+
|
416 |
+
<div style="clear: both;"></div>
|
417 |
+
</div>
|
418 |
+
|
419 |
+
<?php if(flagGallery::flag_wpmu_enable_function('wpmuRoles')) : ?>
|
420 |
+
<div id="roles" class="cptab">
|
421 |
+
<form method="POST" name="addroles" id="addroles" accept-charset="utf-8">
|
422 |
+
<?php wp_nonce_field('flag_addroles'); ?>
|
423 |
+
<h2><?php _e('Roles / capabilities', 'flash-album-gallery'); ?></h2>
|
424 |
+
<div> </div>
|
425 |
+
<p><?php _e('Select the lowest role which should be able to access the follow capabilities. FlaGallery supports the standard roles from WordPress.', 'flash-album-gallery'); ?></p>
|
426 |
+
<table class="form-table">
|
427 |
+
<tr valign="top">
|
428 |
+
<th scope="row" style="white-space: nowrap"><?php _e('Main FlaGallery overview', 'flash-album-gallery'); ?>
|
429 |
+
:
|
430 |
+
</th>
|
431 |
+
<td>
|
432 |
+
<label for="general"><select style="width: 150px;" name="general" id="general"><?php wp_dropdown_roles(flag_get_role('FlAG overview')); ?></select></label>
|
433 |
+
</td>
|
434 |
+
</tr>
|
435 |
+
<tr valign="top">
|
436 |
+
<th scope="row" style="white-space: nowrap"><?php _e('Add GRAND Pages / View Flagallery Button on Edit Post', 'flash-album-gallery'); ?>
|
437 |
+
:
|
438 |
+
</th>
|
439 |
+
<td>
|
440 |
+
<label for="tinymce"><select style="width: 150px;" name="tinymce" id="tinymce"><?php wp_dropdown_roles(flag_get_role('FlAG Use TinyMCE')); ?></select></label>
|
441 |
+
</td>
|
442 |
+
</tr>
|
443 |
+
<tr valign="top">
|
444 |
+
<th scope="row" style="white-space: nowrap"><?php _e('Add gallery / Upload images', 'flash-album-gallery'); ?>
|
445 |
+
:
|
446 |
+
</th>
|
447 |
+
<td>
|
448 |
+
<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>
|
449 |
+
</td>
|
450 |
+
</tr>
|
451 |
+
<tr valign="top">
|
452 |
+
<th scope="row" style="white-space: nowrap"><?php _e('Import images folder', 'flash-album-gallery'); ?>
|
453 |
+
:
|
454 |
+
</th>
|
455 |
+
<td>
|
456 |
+
<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>
|
457 |
+
</td>
|
458 |
+
</tr>
|
459 |
+
<tr valign="top">
|
460 |
+
<th scope="row" style="white-space: nowrap"><?php _e('Manage gallery', 'flash-album-gallery'); ?>
|
461 |
+
:
|
462 |
+
</th>
|
463 |
+
<td>
|
464 |
+
<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>
|
465 |
+
</td>
|
466 |
+
</tr>
|
467 |
+
<tr valign="top">
|
468 |
+
<th scope="row" style="white-space: nowrap"><?php _e('Manage others galleries and Albums', 'flash-album-gallery'); ?>
|
469 |
+
:
|
470 |
+
</th>
|
471 |
+
<td>
|
472 |
+
<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>
|
473 |
+
</td>
|
474 |
+
</tr>
|
475 |
+
<tr valign="top">
|
476 |
+
<th scope="row" style="white-space: nowrap"><?php _e('Manage music', 'flash-album-gallery'); ?>
|
477 |
+
:
|
478 |
+
</th>
|
479 |
+
<td>
|
480 |
+
<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>
|
481 |
+
</td>
|
482 |
+
</tr>
|
483 |
+
<tr valign="top">
|
484 |
+
<th scope="row" style="white-space: nowrap"><?php _e('Manage video', 'flash-album-gallery'); ?>
|
485 |
+
:
|
486 |
+
</th>
|
487 |
+
<td>
|
488 |
+
<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>
|
489 |
+
</td>
|
490 |
+
</tr>
|
491 |
+
<tr valign="top">
|
492 |
+
<th scope="row" style="white-space: nowrap"><?php _e('Manage banners', 'flash-album-gallery'); ?>
|
493 |
+
:
|
494 |
+
</th>
|
495 |
+
<td>
|
496 |
+
<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>
|
497 |
+
</td>
|
498 |
+
</tr>
|
499 |
+
<tr valign="top">
|
500 |
+
<th scope="row" style="white-space: nowrap"><?php _e('Change skin', 'flash-album-gallery'); ?>
|
501 |
+
:
|
502 |
+
</th>
|
503 |
+
<td>
|
504 |
+
<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>
|
505 |
+
</td>
|
506 |
+
</tr>
|
507 |
+
<tr valign="top">
|
508 |
+
<th scope="row" style="white-space: nowrap"><?php _e('Add skins', 'flash-album-gallery'); ?>
|
509 |
+
:
|
510 |
+
</th>
|
511 |
+
<td>
|
512 |
+
<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>
|
513 |
+
</td>
|
514 |
+
</tr>
|
515 |
+
<tr valign="top">
|
516 |
+
<th scope="row" style="white-space: nowrap"><?php _e('Delete skins', 'flash-album-gallery'); ?>
|
517 |
+
:
|
518 |
+
</th>
|
519 |
+
<td>
|
520 |
+
<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>
|
521 |
+
</td>
|
522 |
+
</tr>
|
523 |
+
<tr valign="top">
|
524 |
+
<th scope="row" style="white-space: nowrap"><?php _e('Change options', 'flash-album-gallery'); ?>
|
525 |
+
:
|
526 |
+
</th>
|
527 |
+
<td>
|
528 |
+
<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>
|
529 |
+
</td>
|
530 |
+
</tr>
|
531 |
+
<tr valign="top">
|
532 |
+
<th scope="row" style="white-space: nowrap"><?php _e('iFrame page', 'flash-album-gallery'); ?>
|
533 |
+
:
|
534 |
+
</th>
|
535 |
+
<td>
|
536 |
+
<label for="flagframe_page"><select style="width: 150px;" name="flagframe_page" id="flagframe_page"><?php wp_dropdown_roles(flag_get_role('FlAG iFrame page')); ?></select></label>
|
537 |
+
</td>
|
538 |
+
</tr>
|
539 |
+
</table>
|
540 |
+
<div class="submit">
|
541 |
+
<input type="submit" class="button-primary" name="update_cap" value="<?php _e('Update capabilities', 'flash-album-gallery'); ?>"/>
|
542 |
+
</div>
|
543 |
+
</form>
|
544 |
+
</div>
|
545 |
+
<?php endif;
|
546 |
+
} ?>
|
547 |
+
</div>
|
548 |
+
<script type="text/javascript">
|
549 |
+
var cptabs = new ddtabcontent("tabs");
|
550 |
+
cptabs.setpersist(true);
|
551 |
+
cptabs.setselectedClassTarget("linkparent");
|
552 |
+
cptabs.init();
|
553 |
+
</script>
|
554 |
+
|
555 |
+
<?php
|
556 |
+
}
|
557 |
+
|
558 |
+
function flag_get_sorted_roles(){
|
559 |
+
// This function returns all roles, sorted by user level (lowest to highest)
|
560 |
+
global $wp_roles;
|
561 |
+
$roles = $wp_roles->role_objects;
|
562 |
+
$sorted = array();
|
563 |
+
|
564 |
+
if(class_exists('RoleManager')){
|
565 |
+
foreach($roles as $role_key => $role_name){
|
566 |
+
$role = get_role($role_key);
|
567 |
+
if(empty($role)){
|
568 |
+
continue;
|
569 |
+
}
|
570 |
+
$role_user_level = array_reduce(array_keys($role->capabilities), array(
|
571 |
+
'WP_User',
|
572 |
+
'level_reduction',
|
573 |
+
), 0
|
574 |
+
);
|
575 |
+
$sorted[ $role_user_level ] = $role;
|
576 |
+
}
|
577 |
+
$sorted = array_values($sorted);
|
578 |
+
} else{
|
579 |
+
$role_order = array("subscriber", "contributor", "author", "editor", "administrator");
|
580 |
+
foreach($role_order as $role_key){
|
581 |
+
$sorted[ $role_key ] = get_role($role_key);
|
582 |
+
}
|
583 |
+
}
|
584 |
+
|
585 |
+
return $sorted;
|
586 |
}
|
587 |
|
588 |
function flag_get_role($capability){
|
589 |
+
// This function return the lowest roles which has the capabilities
|
590 |
+
$check_order = flag_get_sorted_roles();
|
591 |
+
|
592 |
+
$args = array_slice(func_get_args(), 1);
|
593 |
+
$args = array_merge(array($capability), $args);
|
594 |
+
|
595 |
+
foreach($check_order as $check_role){
|
596 |
+
if(empty($check_role)){
|
597 |
+
return false;
|
598 |
+
}
|
599 |
+
|
600 |
+
if(call_user_func_array(array(&$check_role, 'has_cap'), $args)){
|
601 |
+
return $check_role->name;
|
602 |
+
}
|
603 |
+
}
|
604 |
+
|
605 |
+
return false;
|
606 |
}
|
607 |
|
608 |
function flag_set_capability($lowest_role, $capability){
|
609 |
+
// This function set or remove the $capability
|
610 |
+
$check_order = flag_get_sorted_roles();
|
611 |
+
|
612 |
+
$add_capability = false;
|
613 |
+
|
614 |
+
foreach($check_order as $the_role){
|
615 |
+
$role = $the_role->name;
|
616 |
+
|
617 |
+
if($lowest_role == $role){
|
618 |
+
$add_capability = true;
|
619 |
+
}
|
620 |
+
|
621 |
+
// If you rename the roles, the please use the role manager plugin
|
622 |
+
|
623 |
+
if(empty($the_role)){
|
624 |
+
continue;
|
625 |
+
}
|
626 |
+
|
627 |
+
$add_capability? $the_role->add_cap($capability) : $the_role->remove_cap($capability);
|
628 |
+
}
|
629 |
+
|
630 |
}
|
admin/showmeta.php
CHANGED
@@ -25,13 +25,13 @@ $xmpdata = $meta->get_XMP();
|
|
25 |
?>
|
26 |
<!-- META DATA -->
|
27 |
<fieldset class="options flag">
|
28 |
-
<h3><?php _e('Meta Data','
|
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','
|
34 |
-
<th scope="col"><?php _e('Value','
|
35 |
</tr>
|
36 |
</thead>
|
37 |
<?php $class = '';
|
@@ -45,19 +45,19 @@ $xmpdata = $meta->get_XMP();
|
|
45 |
}
|
46 |
?>
|
47 |
</table>
|
48 |
-
<?php } else echo "<strong>" . __('No meta data saved','
|
49 |
</fieldset>
|
50 |
|
51 |
<!-- EXIF DATA -->
|
52 |
<?php if ($exifdata) { ?>
|
53 |
<fieldset class="options flag">
|
54 |
-
<h3><?php _e('EXIF Data','
|
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','
|
60 |
-
<th scope="col"><?php _e('Value','
|
61 |
</tr>
|
62 |
</thead>
|
63 |
<?php
|
@@ -70,19 +70,19 @@ $xmpdata = $meta->get_XMP();
|
|
70 |
}
|
71 |
?>
|
72 |
</table>
|
73 |
-
<?php } else echo "<strong>". __('No exif data','
|
74 |
</fieldset>
|
75 |
<?php } ?>
|
76 |
|
77 |
<!-- IPTC DATA -->
|
78 |
<?php if ($iptcdata) { ?>
|
79 |
<fieldset class="options flag">
|
80 |
-
<h3><?php _e('IPTC Data','
|
81 |
<table id="the-list-x" width="100%" cellspacing="3" cellpadding="3">
|
82 |
<thead>
|
83 |
<tr>
|
84 |
-
<th scope="col"><?php _e('Tag','
|
85 |
-
<th scope="col"><?php _e('Value','
|
86 |
</tr>
|
87 |
</thead>
|
88 |
<?php
|
@@ -101,12 +101,12 @@ $xmpdata = $meta->get_XMP();
|
|
101 |
<!-- XMP DATA -->
|
102 |
<?php if ($xmpdata) { ?>
|
103 |
<fieldset class="options flag">
|
104 |
-
<h3><?php _e('XMP Data','
|
105 |
<table id="the-list-x" width="100%" cellspacing="3" cellpadding="3">
|
106 |
<thead>
|
107 |
<tr>
|
108 |
-
<th scope="col"><?php _e('Tag','
|
109 |
-
<th scope="col"><?php _e('Value','
|
110 |
</tr>
|
111 |
</thead>
|
112 |
<?php
|
25 |
?>
|
26 |
<!-- META DATA -->
|
27 |
<fieldset class="options flag">
|
28 |
+
<h3><?php _e('Meta Data','flash-album-gallery'); ?></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','flash-album-gallery'); ?></th>
|
34 |
+
<th scope="col"><?php _e('Value','flash-album-gallery'); ?></th>
|
35 |
</tr>
|
36 |
</thead>
|
37 |
<?php $class = '';
|
45 |
}
|
46 |
?>
|
47 |
</table>
|
48 |
+
<?php } else echo "<strong>" . __('No meta data saved','flash-album-gallery') . "</strong>"; ?>
|
49 |
</fieldset>
|
50 |
|
51 |
<!-- EXIF DATA -->
|
52 |
<?php if ($exifdata) { ?>
|
53 |
<fieldset class="options flag">
|
54 |
+
<h3><?php _e('EXIF Data','flash-album-gallery'); ?></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','flash-album-gallery'); ?></th>
|
60 |
+
<th scope="col"><?php _e('Value','flash-album-gallery'); ?></th>
|
61 |
</tr>
|
62 |
</thead>
|
63 |
<?php
|
70 |
}
|
71 |
?>
|
72 |
</table>
|
73 |
+
<?php } else echo "<strong>". __('No exif data','flash-album-gallery'). "</strong>"; ?>
|
74 |
</fieldset>
|
75 |
<?php } ?>
|
76 |
|
77 |
<!-- IPTC DATA -->
|
78 |
<?php if ($iptcdata) { ?>
|
79 |
<fieldset class="options flag">
|
80 |
+
<h3><?php _e('IPTC Data','flash-album-gallery'); ?></h3>
|
81 |
<table id="the-list-x" width="100%" cellspacing="3" cellpadding="3">
|
82 |
<thead>
|
83 |
<tr>
|
84 |
+
<th scope="col"><?php _e('Tag','flash-album-gallery'); ?></th>
|
85 |
+
<th scope="col"><?php _e('Value','flash-album-gallery'); ?></th>
|
86 |
</tr>
|
87 |
</thead>
|
88 |
<?php
|
101 |
<!-- XMP DATA -->
|
102 |
<?php if ($xmpdata) { ?>
|
103 |
<fieldset class="options flag">
|
104 |
+
<h3><?php _e('XMP Data','flash-album-gallery'); ?></h3>
|
105 |
<table id="the-list-x" width="100%" cellspacing="3" cellpadding="3">
|
106 |
<thead>
|
107 |
<tr>
|
108 |
+
<th scope="col"><?php _e('Tag','flash-album-gallery'); ?></th>
|
109 |
+
<th scope="col"><?php _e('Value','flash-album-gallery'); ?></th>
|
110 |
</tr>
|
111 |
</thead>
|
112 |
<?php
|
admin/skin_functions.php
ADDED
@@ -0,0 +1,200 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if ( ! function_exists( 'sanitize_flagname' ) ) {
|
3 |
+
function sanitize_flagname( $filename ) {
|
4 |
+
|
5 |
+
//$filename = wp_strip_all_tags( $filename );
|
6 |
+
//$filename = remove_accents( $filename );
|
7 |
+
// Kill octets
|
8 |
+
$filename = preg_replace( '|%([a-fA-F0-9][a-fA-F0-9])|', '', $filename );
|
9 |
+
$filename = preg_replace( '/&.+?;/', '', $filename ); // Kill entities
|
10 |
+
$filename = preg_replace( '|[^a-zA-Z0-9 _.\-]|i', '', $filename );
|
11 |
+
$filename = preg_replace( '/[\s-]+/', '-', $filename );
|
12 |
+
$filename = trim( $filename, '.-_ ' );
|
13 |
+
|
14 |
+
return $filename;
|
15 |
+
}
|
16 |
+
}
|
17 |
+
|
18 |
+
function flag_skin_options( $act_skin ) {
|
19 |
+
$flag_options = get_option( 'flag_options' );
|
20 |
+
|
21 |
+
if(isset($_POST['skin']) && !isset($_POST['reset_skin_settings'])){
|
22 |
+
check_admin_referer('skin_settings');
|
23 |
+
|
24 |
+
$skin_options = $_POST['skin'];
|
25 |
+
$skin_options_key = "{$act_skin}_options";
|
26 |
+
array_walk_recursive($skin_options, 'esc_attr');
|
27 |
+
$flag_options[ $skin_options_key ] = $skin_options;
|
28 |
+
// Save options
|
29 |
+
update_option('flag_options', $flag_options);
|
30 |
+
flagGallery::show_message(__('Update Successfully', 'flash-album-gallery'));
|
31 |
+
}
|
32 |
+
|
33 |
+
/**
|
34 |
+
* @var $options_tree
|
35 |
+
* @var $default_options
|
36 |
+
*/
|
37 |
+
include $flag_options['skinsDirABS'] . $act_skin . '/settings.php';
|
38 |
+
$gallery_settings = array();
|
39 |
+
if(isset($_POST['reset_skin_settings'])){
|
40 |
+
$gallery_settings = array();
|
41 |
+
flagGallery::show_message(__('All settings fields reset to default. Click Update button to save default settings.', 'flash-album-gallery'));
|
42 |
+
} elseif(isset($flag_options["{$act_skin}_options"])){
|
43 |
+
$gallery_settings = maybe_unserialize( $flag_options["{$act_skin}_options"] );
|
44 |
+
}
|
45 |
+
?>
|
46 |
+
<form id="skinOptions" class="wp-core-ui" method="post" style="overflow:hidden; max-width:700px; background-color:#f1f1f1; padding: 20px;">
|
47 |
+
<?php
|
48 |
+
if ( isset( $options_tree ) ) {
|
49 |
+
flag_skin_options_fieldset( $options_tree, $default_options, $gallery_settings );
|
50 |
+
}
|
51 |
+
wp_nonce_field( 'skin_settings' );
|
52 |
+
?>
|
53 |
+
<div class="textright" style="padding: 0 10px;">
|
54 |
+
<button type="submit" class="button button-secondary" name="reset_skin_settings"><?php _e( 'Reset to Default', 'flash-album-gallery' ) ?></button>
|
55 |
+
|
56 |
+
<button type="submit" class="button button-primary"><?php _e( 'Update', 'flash-album-gallery' ) ?></button>
|
57 |
+
</div>
|
58 |
+
<script type="text/javascript">
|
59 |
+
jQuery(document).ready(function () {
|
60 |
+
jQuery('#skinOptions [data-type="color"]').wpColorPicker();
|
61 |
+
});
|
62 |
+
</script>
|
63 |
+
</form>
|
64 |
+
<?php
|
65 |
+
}
|
66 |
+
|
67 |
+
function flag_xml2array( $xmlObject, $out = array() ) {
|
68 |
+
foreach ( (array) $xmlObject as $index => $node ) {
|
69 |
+
$out[ $index ] = ( is_object( $node ) || is_array( $node ) ) ? flag_xml2array( $node ) : $node;
|
70 |
+
}
|
71 |
+
|
72 |
+
return $out;
|
73 |
+
}
|
74 |
+
|
75 |
+
/**
|
76 |
+
* @param $options_tree
|
77 |
+
* @param $default
|
78 |
+
* @param array $value
|
79 |
+
*/
|
80 |
+
function flag_skin_options_fieldset( $options_tree, $default, $value = array() ) {
|
81 |
+
$i = 0;
|
82 |
+
foreach ( $options_tree as $section ) {
|
83 |
+
$i ++;
|
84 |
+
$pane_class = 'tab-pane';
|
85 |
+
?>
|
86 |
+
<fieldset id="gallery_settings<?php echo $i; ?>" class="<?php echo $pane_class; ?>"
|
87 |
+
style="margin: 20px 0;padding:10px;">
|
88 |
+
<legend><?php echo $section['label']; ?>
|
89 |
+
<button type="submit" class="button button-primary button-small alignright"><?php _e( 'Update', 'flash-album-gallery' ) ?></button>
|
90 |
+
</legend>
|
91 |
+
<?php
|
92 |
+
foreach ( $section['fields'] as $name => $field ) {
|
93 |
+
if ( 'textblock' == $field['tag'] ) {
|
94 |
+
$args = array(
|
95 |
+
'id' => $name,
|
96 |
+
'field' => $field,
|
97 |
+
);
|
98 |
+
} else {
|
99 |
+
if ( isset( $section['key'] ) ) {
|
100 |
+
$key = $section['key'];
|
101 |
+
if ( ! isset( $default[ $key ][ $name ] ) ) {
|
102 |
+
$default[ $key ][ $name ] = false;
|
103 |
+
}
|
104 |
+
$val = isset( $value[ $key ][ $name ] ) ? $value[ $key ][ $name ] : $default[ $key ][ $name ];
|
105 |
+
$args = array(
|
106 |
+
'id' => strtolower( "{$key}_{$name}" ),
|
107 |
+
'name' => "skin[{$key}][{$name}]",
|
108 |
+
'field' => $field,
|
109 |
+
'value' => $val,
|
110 |
+
'default' => $default[ $key ][ $name ],
|
111 |
+
);
|
112 |
+
} else {
|
113 |
+
if ( ! isset( $default[ $name ] ) ) {
|
114 |
+
$default[ $name ] = false;
|
115 |
+
}
|
116 |
+
$val = isset( $value[ $name ] ) ? $value[ $name ] : $default[ $name ];
|
117 |
+
$args = array(
|
118 |
+
'id' => strtolower( $name ),
|
119 |
+
'name' => "skin[{$name}]",
|
120 |
+
'field' => $field,
|
121 |
+
'value' => $val,
|
122 |
+
'default' => $default[ $name ],
|
123 |
+
);
|
124 |
+
}
|
125 |
+
}
|
126 |
+
flag_skin_options_formgroup( $args );
|
127 |
+
}
|
128 |
+
?>
|
129 |
+
</fieldset>
|
130 |
+
<?php
|
131 |
+
}
|
132 |
+
}
|
133 |
+
|
134 |
+
/**
|
135 |
+
* @param $args
|
136 |
+
*/
|
137 |
+
function flag_skin_options_formgroup( $args ) {
|
138 |
+
/**
|
139 |
+
* @var $id
|
140 |
+
* @var $name
|
141 |
+
* @var $field
|
142 |
+
* @var $value
|
143 |
+
* @var $default
|
144 |
+
*/
|
145 |
+
extract( $args );
|
146 |
+
if ( 'input' == $field['tag'] ) {
|
147 |
+
?>
|
148 |
+
<div class="form-group" id="div_<?php echo $id; ?>">
|
149 |
+
<label><?php echo $field['label']; ?></label>
|
150 |
+
<input <?php echo $field['attr']; ?> id="<?php echo $id; ?>" class="form-control input-sm"
|
151 |
+
name="<?php echo $name; ?>" value="<?php echo esc_attr( $value ); ?>"
|
152 |
+
data-value="<?php echo $default; ?>"
|
153 |
+
placeholder="<?php echo $default; ?>"/>
|
154 |
+
<?php if ( ! empty( $field['text'] ) ) {
|
155 |
+
echo "<p class='help-block'>{$field['text']}</p>";
|
156 |
+
} ?>
|
157 |
+
</div>
|
158 |
+
<?php } elseif ( 'checkbox' == $field['tag'] ) { ?>
|
159 |
+
<div class="form-group" id="div_<?php echo $id; ?>">
|
160 |
+
<div class="checkbox">
|
161 |
+
<input type="hidden" name="<?php echo $name; ?>" value="0"/>
|
162 |
+
<label><input type="checkbox" <?php echo $field['attr']; ?> id="<?php echo $id; ?>"
|
163 |
+
name="<?php echo $name; ?>" value="1"
|
164 |
+
data-value="<?php echo $default; ?>" <?php echo checked( $value, '1' ); ?>/> <?php echo $field['label']; ?>
|
165 |
+
</label>
|
166 |
+
<?php if ( ! empty( $field['text'] ) ) {
|
167 |
+
echo "<p class='help-block'>{$field['text']}</p>";
|
168 |
+
} ?>
|
169 |
+
</div>
|
170 |
+
</div>
|
171 |
+
<?php } elseif ( 'select' == $field['tag'] ) { ?>
|
172 |
+
<div class="form-group" id="div_<?php echo $id; ?>">
|
173 |
+
<label><?php echo $field['label']; ?></label>
|
174 |
+
<select <?php echo $field['attr']; ?> id="<?php echo $id; ?>" class="form-control input-sm"
|
175 |
+
name="<?php echo $name; ?>" data-value="<?php echo $default; ?>">
|
176 |
+
<?php foreach ( $field['choices'] as $choice ) { ?>
|
177 |
+
<option value="<?php esc_attr_e( $choice['value'] ); ?>" <?php echo selected( $value, $choice['value'] ); ?>><?php echo $choice['label']; ?></option>
|
178 |
+
<?php } ?>
|
179 |
+
</select>
|
180 |
+
<?php if ( ! empty( $field['text'] ) ) {
|
181 |
+
echo "<p class='help-block'>{$field['text']}</p>";
|
182 |
+
} ?>
|
183 |
+
</div>
|
184 |
+
<?php } elseif ( 'textarea' == $field['tag'] ) { ?>
|
185 |
+
<div class="form-group" id="div_<?php echo $id; ?>">
|
186 |
+
<label><?php echo $field['label']; ?></label>
|
187 |
+
<textarea <?php echo $field['attr']; ?> id="<?php echo $id; ?>" class="form-control input-sm"
|
188 |
+
name="<?php echo $name; ?>"><?php echo esc_textarea( $value ); ?></textarea>
|
189 |
+
<?php if ( ! empty( $field['text'] ) ) {
|
190 |
+
echo "<p class='help-block'>{$field['text']}</p>";
|
191 |
+
} ?>
|
192 |
+
</div>
|
193 |
+
<?php } elseif ( 'textblock' == $field['tag'] ) { ?>
|
194 |
+
<div class="text-block">
|
195 |
+
<?php echo $field['label']; ?>
|
196 |
+
<?php echo $field['text']; ?>
|
197 |
+
</div>
|
198 |
+
<?php } ?>
|
199 |
+
<?php
|
200 |
+
}
|
admin/skin_install.php
CHANGED
@@ -7,7 +7,7 @@ function do_skin_install_local_package($package, $filename = '') {
|
|
7 |
global $wp_filesystem;
|
8 |
|
9 |
if ( empty($package) ) {
|
10 |
-
show_message( __('No skin Specified', '
|
11 |
return false;
|
12 |
}
|
13 |
|
@@ -36,17 +36,17 @@ function do_skin_install_local_package($package, $filename = '') {
|
|
36 |
|
37 |
if ( is_wp_error($result) ) {
|
38 |
show_message($result);
|
39 |
-
show_message( __('Installation Failed', '
|
40 |
return false;
|
41 |
} else {
|
42 |
-
show_message( __('The skin installed successfully.', '
|
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', '
|
46 |
-
'skins_page' => '<a href="#'.$skin_file.'" title="' . __('Goto skin overview', '
|
47 |
), array(), $skin_file);
|
48 |
if ( ! empty($install_actions) ) {
|
49 |
-
//show_message('<strong>' . __('Actions:', '
|
50 |
}
|
51 |
return $result;
|
52 |
}
|
@@ -67,27 +67,27 @@ function wp_install_skin_local_package($package, $feedback = '') {
|
|
67 |
WP_Filesystem();
|
68 |
|
69 |
if ( ! is_object($wp_filesystem) )
|
70 |
-
return new WP_Error('fs_unavailable', __('Could not access filesystem.', '
|
71 |
|
72 |
if ( $wp_filesystem->errors->get_error_code() )
|
73 |
-
return new WP_Error('fs_error', __('Filesystem error', '
|
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.', '
|
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).', '
|
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.', '
|
91 |
|
92 |
$working_dir = $content_dir . 'upgrade/' . basename($package, '.zip');
|
93 |
|
@@ -95,7 +95,7 @@ function wp_install_skin_local_package($package, $feedback = '') {
|
|
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', '
|
99 |
// Unzip package to working directory
|
100 |
$result = unzip_file($package, $working_dir);
|
101 |
|
@@ -112,10 +112,10 @@ function wp_install_skin_local_package($package, $feedback = '') {
|
|
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.', '
|
116 |
}
|
117 |
|
118 |
-
apply_filters('install_feedback', __('Installing the skin', '
|
119 |
// Copy new version of skin into place.
|
120 |
$result = copy_dir($working_dir, $skins_dir);
|
121 |
if ( is_wp_error($result) ) {
|
7 |
global $wp_filesystem;
|
8 |
|
9 |
if ( empty($package) ) {
|
10 |
+
show_message( __('No skin Specified', 'flash-album-gallery') );
|
11 |
return false;
|
12 |
}
|
13 |
|
36 |
|
37 |
if ( is_wp_error($result) ) {
|
38 |
show_message($result);
|
39 |
+
show_message( __('Installation Failed', 'flash-album-gallery') );
|
40 |
return false;
|
41 |
} else {
|
42 |
+
show_message( __('The skin installed successfully.', 'flash-album-gallery') );
|
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', 'flash-album-gallery') . '" target="_parent">' . __('Activate Skin', 'flash-album-gallery') . '</a>',
|
46 |
+
'skins_page' => '<a href="#'.$skin_file.'" title="' . __('Goto skin overview', 'flash-album-gallery') . '" target="_parent">' . __('Skin overview', 'flash-album-gallery') . '</a>'
|
47 |
), array(), $skin_file);
|
48 |
if ( ! empty($install_actions) ) {
|
49 |
+
//show_message('<strong>' . __('Actions:', 'flash-album-gallery') . '</strong> ' . implode(' | ', (array)$install_actions));
|
50 |
}
|
51 |
return $result;
|
52 |
}
|
67 |
WP_Filesystem();
|
68 |
|
69 |
if ( ! is_object($wp_filesystem) )
|
70 |
+
return new WP_Error('fs_unavailable', __('Could not access filesystem.', 'flash-album-gallery'));
|
71 |
|
72 |
if ( $wp_filesystem->errors->get_error_code() )
|
73 |
+
return new WP_Error('fs_error', __('Filesystem error', 'flash-album-gallery'), $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.', 'flash-album-gallery'));
|
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).', 'flash-album-gallery'));
|
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.', 'flash-album-gallery'));
|
91 |
|
92 |
$working_dir = $content_dir . 'upgrade/' . basename($package, '.zip');
|
93 |
|
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', 'flash-album-gallery'));
|
99 |
// Unzip package to working directory
|
100 |
$result = unzip_file($package, $working_dir);
|
101 |
|
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.', 'flash-album-gallery'), $filelist[0] );
|
116 |
}
|
117 |
|
118 |
+
apply_filters('install_feedback', __('Installing the skin', 'flash-album-gallery'));
|
119 |
// Copy new version of skin into place.
|
120 |
$result = copy_dir($working_dir, $skins_dir);
|
121 |
if ( is_wp_error($result) ) {
|
admin/skin_options.php
CHANGED
@@ -1,117 +1,70 @@
|
|
1 |
<?php
|
2 |
define('WP_INSTALLING', true);
|
3 |
-
require_once(
|
|
|
|
|
4 |
|
5 |
-
if(!function_exists('
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
$filename = preg_replace( '|[^a-zA-Z0-9 _.\-]|i', '', $filename );
|
14 |
-
$filename = preg_replace('/[\s-]+/', '-', $filename);
|
15 |
-
$filename = trim($filename, '.-_ ');
|
16 |
-
|
17 |
-
return $filename;
|
18 |
-
}
|
19 |
-
}
|
20 |
-
|
21 |
-
if(!function_exists('get_currentuserinfo')){
|
22 |
-
require( ABSPATH . WPINC . '/formatting.php' );
|
23 |
-
require( ABSPATH . WPINC . '/capabilities.php' );
|
24 |
-
require( ABSPATH . WPINC . '/user.php' );
|
25 |
-
require( ABSPATH . WPINC . '/meta.php' );
|
26 |
-
require( ABSPATH . WPINC . '/pluggable.php' );
|
27 |
-
require( ABSPATH . WPINC . '/post.php' );
|
28 |
-
wp_cookie_constants( );
|
29 |
}
|
30 |
|
31 |
// check for correct capability
|
32 |
-
if
|
33 |
-
|
|
|
34 |
|
35 |
// check for correct FlAG capability
|
36 |
-
if
|
37 |
-
|
38 |
-
|
39 |
-
$flashPost = file_get_contents("php://input");
|
40 |
-
// parse properties_skin
|
41 |
-
$arr = array();
|
42 |
-
parse_str($flashPost, $arr);
|
43 |
|
44 |
$flag_options = get_option('flag_options');
|
45 |
-
$act_skin
|
46 |
-
$act_skin
|
47 |
-
$settings = $flag_options['skinsDirABS'].$act_skin.'/settings';
|
48 |
-
$settingsXML = $settings.'/settings.xml';
|
49 |
|
50 |
-
if(isset($
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
$arr['properties_skin'] = str_replace( array( '=','?','"','$' ), '', $arr['properties_skin'] );
|
65 |
-
$newProperties = preg_replace("|<properties>.*?</properties>|si", $arr['properties_skin'], $mainXML);
|
66 |
-
if(fwrite($fp, $newProperties))
|
67 |
-
echo "1";//Save
|
68 |
-
else
|
69 |
-
echo "0";
|
70 |
-
fclose($fp);
|
71 |
-
}
|
72 |
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
skin : "<?php echo $act_skin; ?>"
|
99 |
-
};
|
100 |
-
var params = {
|
101 |
-
wmode : "transparent",
|
102 |
-
scale : "noScale",
|
103 |
-
saling : "lt",
|
104 |
-
allowfullscreen : "false",
|
105 |
-
menu : "false"
|
106 |
-
};
|
107 |
-
var attributes = {};
|
108 |
-
swfobject.embedSWF("<?php echo $cPanel; ?>", "myContent", "600", "550", "9.0.0", "<?php echo $flag_urlpath; ?>skins/expressInstall.swf", flashvars, params, attributes);
|
109 |
-
</script>
|
110 |
-
<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>
|
111 |
-
<p>This page requires Flash Player version 10.1.52 or higher.</p>
|
112 |
-
</div>
|
113 |
-
</div>
|
114 |
-
<?php
|
115 |
-
}
|
116 |
-
fclose($fp);
|
117 |
-
}
|
1 |
<?php
|
2 |
define('WP_INSTALLING', true);
|
3 |
+
require_once(dirname(dirname(__FILE__)) . '/flag-config.php');
|
4 |
+
require_once(dirname(dirname(__FILE__)) . '/lib/core.php');
|
5 |
+
require_once(dirname(__FILE__) . '/skin_functions.php');
|
6 |
|
7 |
+
if( !function_exists('wp_get_current_user')){
|
8 |
+
require(ABSPATH . WPINC . '/formatting.php');
|
9 |
+
require(ABSPATH . WPINC . '/capabilities.php');
|
10 |
+
require(ABSPATH . WPINC . '/user.php');
|
11 |
+
require(ABSPATH . WPINC . '/meta.php');
|
12 |
+
require(ABSPATH . WPINC . '/pluggable.php');
|
13 |
+
require(ABSPATH . WPINC . '/post.php');
|
14 |
+
wp_cookie_constants();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
}
|
16 |
|
17 |
// check for correct capability
|
18 |
+
if( !is_user_logged_in()){
|
19 |
+
die('-1');
|
20 |
+
}
|
21 |
|
22 |
// check for correct FlAG capability
|
23 |
+
if( !current_user_can('FlAG Change skin')){
|
24 |
+
die('-1');
|
25 |
+
}
|
|
|
|
|
|
|
|
|
26 |
|
27 |
$flag_options = get_option('flag_options');
|
28 |
+
$act_skin = isset($_GET['skin'])? $_GET['skin'] : $flag_options['flashSkin'];
|
29 |
+
$act_skin = sanitize_flagname($act_skin);
|
|
|
|
|
30 |
|
31 |
+
if(isset($_GET['show_options'])){
|
32 |
+
?>
|
33 |
+
<!doctype html>
|
34 |
+
<html>
|
35 |
+
<head>
|
36 |
+
<link rel='stylesheet' id='common-css' href='<?php echo get_admin_url(null, '/css/common.css'); ?>' type='text/css'/>
|
37 |
+
<link rel='stylesheet' id='forms-css' href='<?php echo includes_url('/css/buttons.css'); ?>' type='text/css'/>
|
38 |
+
<link rel="stylesheet" id="flagadmin-css" href="<?php echo plugins_url('/flash-album-gallery/admin/css/flagadmin.css'); ?>" type="text/css"/>
|
39 |
+
<link rel='stylesheet' id='wp-color-picker-css' href='<?php echo get_admin_url(null, '/css/color-picker.css'); ?>' type='text/css' media='all'/>
|
40 |
+
<script type='text/javascript' src='<?php echo includes_url('/js/jquery/jquery.js'); ?>'></script>
|
41 |
+
<script type='text/javascript' src='<?php echo includes_url('/js/jquery/jquery-migrate.js'); ?>'></script>
|
42 |
+
</head>
|
43 |
+
<body>
|
44 |
+
<?php flag_skin_options($act_skin); ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
|
46 |
+
<script type='text/javascript' src='<?php echo get_admin_url(null, '/js/svg-painter.js'); ?>'></script>
|
47 |
+
<script type='text/javascript' src='<?php echo includes_url('/js/jquery/ui/core.min.js'); ?>'></script>
|
48 |
+
<script type='text/javascript' src='<?php echo includes_url('/js/jquery/ui/widget.min.js'); ?>'></script>
|
49 |
+
<script type='text/javascript' src='<?php echo includes_url('/js/jquery/ui/mouse.min.js'); ?>'></script>
|
50 |
+
<script type='text/javascript' src='<?php echo includes_url('/js/jquery/ui/draggable.min.js'); ?>'></script>
|
51 |
+
<script type='text/javascript' src='<?php echo includes_url('/js/jquery/ui/droppable.min.js'); ?>'></script>
|
52 |
+
<script type='text/javascript' src='<?php echo includes_url('/js/jquery/ui/sortable.min.js'); ?>'></script>
|
53 |
+
<script type='text/javascript' src='<?php echo includes_url('/js/jquery/jquery.ui.touch-punch.js'); ?>'></script>
|
54 |
+
<script type='text/javascript' src='<?php echo includes_url('/js/jquery/ui/slider.min.js'); ?>'></script>
|
55 |
+
<script type='text/javascript' src='<?php echo get_admin_url(null, '/js/iris.min.js'); ?>'></script>
|
56 |
+
<script type='text/javascript'>
|
57 |
+
/* <![CDATA[ */
|
58 |
+
var wpColorPickerL10n = {
|
59 |
+
"clear": "Clear",
|
60 |
+
"defaultString": "Default",
|
61 |
+
"pick": "Select Color",
|
62 |
+
"current": "Current Color"
|
63 |
+
};
|
64 |
+
/* ]]> */
|
65 |
+
</script>
|
66 |
+
<script type='text/javascript' src='<?php echo get_admin_url(null, '/js/color-picker.js'); ?>'></script>
|
67 |
+
</body>
|
68 |
+
</html>
|
69 |
+
<?php
|
70 |
+
} ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/skins.php
CHANGED
@@ -1,596 +1,680 @@
|
|
1 |
<?php
|
2 |
-
if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF']))
|
|
|
|
|
3 |
// look up for the path
|
4 |
-
require_once(
|
5 |
|
6 |
// check for correct capability
|
7 |
-
if
|
8 |
-
|
|
|
9 |
|
10 |
// check for correct FlAG capability
|
11 |
-
if
|
12 |
-
|
|
|
13 |
|
14 |
global $flag;
|
15 |
$flag_options = get_option('flag_options');
|
16 |
|
17 |
-
require_once
|
18 |
|
19 |
-
if(
|
20 |
-
|
21 |
-
|
22 |
}
|
23 |
-
if(
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
}
|
71 |
add_action('install_skins_upload', 'upload_skin');
|
72 |
-
function upload_skin()
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
}
|
130 |
-
|
131 |
-
|
132 |
-
if ( isset($_POST['updateskinoption']) ) {
|
133 |
-
check_admin_referer('skin_settings');
|
134 |
-
// get the hidden option fields, taken from WP core
|
135 |
-
$options = false;
|
136 |
-
if ( $_POST['skin_options'] )
|
137 |
-
$options = explode(',', stripslashes($_POST['skin_options']));
|
138 |
-
elseif ( $_POST['skinoptions'] )
|
139 |
-
$options = explode(',', stripslashes($_POST['skinoptions']));
|
140 |
-
if ($options) {
|
141 |
-
$settings_content = '<?php '."\n";
|
142 |
-
foreach ($options as $option) {
|
143 |
-
$option = trim($option);
|
144 |
-
$value = trim($_POST[$option]);
|
145 |
-
$flag->options[$option] = $value;
|
146 |
-
$settings_content .= '$'.$option.' = \''.str_replace('#','',$value)."';\n";
|
147 |
-
}
|
148 |
-
$settings_content .= '?>'."\n";
|
149 |
-
// the path should always end with a slash
|
150 |
-
$flag->options['galleryPath'] = trailingslashit($flag->options['galleryPath']);
|
151 |
-
}
|
152 |
-
// Save options
|
153 |
-
update_option('flag_options', $flag->options);
|
154 |
-
if( flagGallery::saveFile($flag_options['skinsDirABS'].$flag_options['flashSkin'].'_settings.php',$settings_content,'w') ){
|
155 |
-
flagGallery::show_message(__('Update Successfully','flag'));
|
156 |
-
}
|
157 |
}
|
158 |
|
159 |
-
if
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
|
|
|
|
|
|
|
|
|
|
165 |
}
|
166 |
|
167 |
-
if(!empty($flag_options['license_key'])){
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
190 |
}
|
191 |
|
192 |
-
if
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
|
|
210 |
}
|
211 |
|
212 |
|
213 |
-
if
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
}
|
238 |
|
239 |
-
if(
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
}
|
257 |
$type = isset($_GET['type'])? sanitize_key($_GET['type']) : '';
|
258 |
switch($type){
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
default:
|
280 |
-
$stype = 'gallery';
|
281 |
-
$new_skins = __('New Photo Skins', 'flag');
|
282 |
-
break;
|
283 |
}
|
284 |
|
285 |
-
if(
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
|
|
292 |
}
|
293 |
?>
|
294 |
<div id="slider" class="flag-wrap">
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
var cptabs=new ddtabcontent("tabs");
|
328 |
-
cptabs.setpersist(false);
|
329 |
-
cptabs.setselectedClassTarget("linkparent");
|
330 |
-
cptabs.init();
|
331 |
-
/* ]]> */
|
332 |
-
</script>
|
333 |
</div>
|
334 |
|
335 |
-
<?php if(
|
336 |
-
<div id="skinapikey">
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
345 |
<?php } ?>
|
346 |
|
347 |
<div class="flag-wrap" style="min-width: 878px;">
|
348 |
-
<h2><?php _e('Skins', '
|
349 |
-
<p style="float: right; display:none;"
|
350 |
-
<
|
351 |
-
|
352 |
-
<a class="button<?php if(
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
<?php
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
}
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
-
|
481 |
-
|
482 |
-
|
483 |
-
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
-
|
488 |
-
|
489 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
490 |
<td colspan="3">' . __('No skins to show') . '</td>
|
491 |
</tr>';
|
492 |
-
|
493 |
-
|
494 |
-
|
495 |
-
|
496 |
-
|
497 |
-
|
498 |
-
|
499 |
-
|
500 |
-
|
501 |
-
|
502 |
-
|
503 |
-
|
504 |
-
|
505 |
-
|
506 |
-
|
507 |
-
|
508 |
-
|
509 |
-
|
510 |
-
|
511 |
-
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
-
|
516 |
-
|
517 |
-
|
518 |
-
|
519 |
-
|
520 |
-
|
521 |
-
|
522 |
-
|
523 |
-
|
524 |
-
|
525 |
-
|
526 |
-
|
527 |
-
|
528 |
-
|
529 |
-
|
530 |
-
|
531 |
-
|
532 |
-
|
533 |
-
|
534 |
-
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
-
|
539 |
-
|
540 |
-
|
541 |
-
|
542 |
-
|
543 |
-
|
544 |
-
|
545 |
-
|
546 |
-
|
547 |
-
|
548 |
-
|
549 |
-
|
550 |
-
|
551 |
-
|
552 |
-
|
553 |
-
|
554 |
-
|
555 |
-
|
556 |
-
|
557 |
-
|
558 |
-
|
559 |
-
|
560 |
-
|
561 |
-
|
562 |
-
|
563 |
-
|
564 |
-
|
565 |
-
|
566 |
-
|
567 |
-
|
568 |
-
|
569 |
-
|
570 |
-
|
571 |
-
|
572 |
-
|
573 |
-
|
574 |
-
|
575 |
-
|
576 |
-
|
577 |
-
|
578 |
-
|
579 |
-
|
580 |
-
|
581 |
-
|
582 |
-
|
583 |
-
|
584 |
-
|
585 |
-
|
586 |
-
|
587 |
-
|
588 |
-
|
589 |
-
|
590 |
-
|
591 |
-
|
592 |
-
|
593 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
594 |
|
595 |
|
596 |
</div>
|
1 |
<?php
|
2 |
+
if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])){
|
3 |
+
die('You are not allowed to call this page directly.');
|
4 |
+
}
|
5 |
// look up for the path
|
6 |
+
require_once(dirname(dirname(__FILE__)) . '/flag-config.php');
|
7 |
|
8 |
// check for correct capability
|
9 |
+
if( !is_user_logged_in()){
|
10 |
+
die('-1');
|
11 |
+
}
|
12 |
|
13 |
// check for correct FlAG capability
|
14 |
+
if( !current_user_can('FlAG Change skin')){
|
15 |
+
die('-1');
|
16 |
+
}
|
17 |
|
18 |
global $flag;
|
19 |
$flag_options = get_option('flag_options');
|
20 |
|
21 |
+
require_once(dirname(__FILE__) . '/get_skin.php');
|
22 |
|
23 |
+
if(isset($_POST['installskin'])){
|
24 |
+
check_admin_referer('skin-upload');
|
25 |
+
require_once(dirname(__FILE__) . '/skin_install.php');
|
26 |
}
|
27 |
+
if(isset($_POST['skinzipurl'])){
|
28 |
+
check_admin_referer('skin_install');
|
29 |
+
$url = 'https://mypgc.co/skins/' . sanitize_flagname(basename($_POST['skinzipurl']));
|
30 |
+
$skins_dir = $flag_options['skinsDirABS'];
|
31 |
+
$mzip = download_url($url);
|
32 |
+
if(is_wp_error($mzip)){
|
33 |
+
$userAgent = 'Googlebot/2.1 (https://www.googlebot.com/bot.html)';
|
34 |
+
$filename = basename($url);
|
35 |
+
$mzip = rtrim($skins_dir, '/') . '/' . $filename;
|
36 |
+
$ch = curl_init();
|
37 |
+
$fp = fopen("$mzip", "w");
|
38 |
+
curl_setopt($ch, CURLOPT_USERAGENT, $userAgent);
|
39 |
+
curl_setopt($ch, CURLOPT_URL, $url);
|
40 |
+
curl_setopt($ch, CURLOPT_FAILONERROR, true);
|
41 |
+
curl_setopt($ch, CURLOPT_HEADER, 0);
|
42 |
+
@curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
|
43 |
+
curl_setopt($ch, CURLOPT_AUTOREFERER, true);
|
44 |
+
curl_setopt($ch, CURLOPT_BINARYTRANSFER, true);
|
45 |
+
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
|
46 |
+
curl_setopt($ch, CURLOPT_TIMEOUT, 20);
|
47 |
+
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
|
48 |
+
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
|
49 |
+
curl_setopt($ch, CURLOPT_FILE, $fp);
|
50 |
+
$data = curl_exec($ch);
|
51 |
+
curl_close($ch);
|
52 |
+
fclose($fp);
|
53 |
+
}
|
54 |
+
|
55 |
+
$mzip = str_replace("\\", "/", $mzip);
|
56 |
+
|
57 |
+
if(class_exists('ZipArchive')){
|
58 |
+
$zip = new ZipArchive;
|
59 |
+
$zip->open($mzip);
|
60 |
+
$zip->extractTo($skins_dir);
|
61 |
+
$zip->close();
|
62 |
+
} else{
|
63 |
+
require_once(ABSPATH . 'wp-admin/includes/class-pclzip.php');
|
64 |
+
$archive = new PclZip($mzip);
|
65 |
+
$list = $archive->extract($skins_dir);
|
66 |
+
if($list == 0){
|
67 |
+
die("ERROR : '" . $archive->errorInfo(true) . "'");
|
68 |
+
}
|
69 |
+
|
70 |
+
}
|
71 |
+
if(@unlink($mzip)){
|
72 |
+
flagGallery::show_message(__('The skin installed successfully.', 'flash-album-gallery'));
|
73 |
+
}
|
74 |
}
|
75 |
add_action('install_skins_upload', 'upload_skin');
|
76 |
+
function upload_skin(){
|
77 |
+
|
78 |
+
echo '<div id="uploadaction">';
|
79 |
+
echo '<h3>' . __('Install info', 'flash-album-gallery') . '</h3>';
|
80 |
+
|
81 |
+
if( !(($uploads = wp_upload_dir()) && false === $uploads['error'])){
|
82 |
+
echo "<p>" . $uploads['error'] . "</p>\n";
|
83 |
+
} else{
|
84 |
+
$filename = false;
|
85 |
+
if( !empty($_FILES)){
|
86 |
+
$filename = $_FILES['skinzip']['name'];
|
87 |
+
} else if(isset($_GET['package'])){
|
88 |
+
$filename = urlencode($_GET['package']);
|
89 |
+
}
|
90 |
+
if( !$filename){
|
91 |
+
echo "<p>" . __('No skin Specified', 'flash-album-gallery') . "</p>\n";
|
92 |
+
} else{
|
93 |
+
check_admin_referer('skin-upload');
|
94 |
+
echo '<h4>', sprintf(__('Installing Skin from file: %s', 'flash-album-gallery'), basename($filename)), '</h4>';
|
95 |
+
|
96 |
+
//Handle a newly uploaded file, Else assume it was
|
97 |
+
if( !empty($_FILES)){
|
98 |
+
$flag_options = get_option('flag_options');
|
99 |
+
$skins_dir = $flag_options['skinsDirABS'];
|
100 |
+
if( !wp_mkdir_p($skins_dir)){
|
101 |
+
echo "<p>" . sprintf(__('Unable to create directory %s. Is its parent directory writable by the server?', 'flash-album-gallery'), $skins_dir) . "</p>\n";
|
102 |
+
echo '</div>';
|
103 |
+
|
104 |
+
return;
|
105 |
+
}
|
106 |
+
if( !is_writable($skins_dir)){
|
107 |
+
@chmod($skins_dir, 0755);
|
108 |
+
if( !is_writable($skins_dir)){
|
109 |
+
//@unlink( $_FILES['modulezip']['tmp_name'] );
|
110 |
+
echo "<p>" . sprintf(__('Directory %s is not writable by the server.', 'flash-album-gallery'), $skins_dir) . "</p>\n";
|
111 |
+
echo '</div>';
|
112 |
+
|
113 |
+
return;
|
114 |
+
}
|
115 |
+
}
|
116 |
+
$filename = wp_unique_filename($uploads['basedir'], $filename);
|
117 |
+
$local_file = $uploads['basedir'] . '/' . $filename;
|
118 |
+
|
119 |
+
// Move the file to the uploads dir
|
120 |
+
if(false === @move_uploaded_file($_FILES['skinzip']['tmp_name'], $local_file)){
|
121 |
+
echo "<p>" . sprintf(__('The uploaded file could not be moved to %s.', 'flash-album-gallery'), $uploads['path']) . "</p>\n";
|
122 |
+
echo '</div>';
|
123 |
+
|
124 |
+
return;
|
125 |
+
}
|
126 |
+
} else{
|
127 |
+
$local_file = $uploads['basedir'] . '/' . $filename;
|
128 |
+
}
|
129 |
+
$installed_skin = do_skin_install_local_package($local_file, $filename);
|
130 |
+
}
|
131 |
+
}
|
132 |
+
echo '</div>';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
133 |
}
|
134 |
|
135 |
+
if(isset($_POST['license_key'])){
|
136 |
+
check_admin_referer('skin-api');
|
137 |
+
$license_key = esc_sql($_POST['license_key']);
|
138 |
+
$license_name = esc_sql($_POST['license_name']);
|
139 |
+
$flag_options['license_key'] = trim($license_key);
|
140 |
+
$flag_options['license_name'] = trim($license_name);
|
141 |
+
if(empty($_POST['license_key'])){
|
142 |
+
$flag_options['license_name'] = '';
|
143 |
+
}
|
144 |
+
update_option('flag_options', $flag_options);
|
145 |
+
flagGallery::show_message(__('License Key Updated', 'flash-album-gallery'));
|
146 |
}
|
147 |
|
148 |
+
if( !empty($flag_options['license_key'])){
|
149 |
+
if(function_exists('curl_init')){
|
150 |
+
$ch = curl_init('https://mypgc.co/app/account_st.php');
|
151 |
+
curl_setopt($ch, CURLOPT_REFERER, home_url());
|
152 |
+
curl_setopt($ch, CURLOPT_POST, 1);
|
153 |
+
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
154 |
+
curl_setopt($ch, CURLOPT_POSTFIELDS, array('check_status' => $flag_options['license_key']));
|
155 |
+
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 3);
|
156 |
+
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
|
157 |
+
$status = curl_exec($ch);
|
158 |
+
curl_close($ch);
|
159 |
+
if($status === '0'){
|
160 |
+
$flag_options['license_key'] = '';
|
161 |
+
if(empty($_POST['license_name'])){
|
162 |
+
$flag_options['license_name'] = '';
|
163 |
+
}
|
164 |
+
update_option('flag_options', $flag_options);
|
165 |
+
flagGallery::show_message(__('Your license key was deactivated', 'flash-album-gallery'));
|
166 |
+
} elseif($status === ''){
|
167 |
+
$flag_options['license_key'] = '';
|
168 |
+
if(empty($_POST['license_name'])){
|
169 |
+
$flag_options['license_name'] = '';
|
170 |
+
}
|
171 |
+
flagGallery::show_message(__('Bad Licence Key', 'flash-album-gallery'));
|
172 |
+
} elseif(!empty($status)){
|
173 |
+
$flag_options['license_name'] = $status;
|
174 |
+
}
|
175 |
+
update_option('flag_options', $flag_options);
|
176 |
+
} else{
|
177 |
+
flagGallery::show_message(__('cURL library is not installed on your server.', 'flash-album-gallery'));
|
178 |
+
}
|
179 |
}
|
180 |
|
181 |
+
if(isset($_POST['updateoption'])){
|
182 |
+
check_admin_referer('flag_settings');
|
183 |
+
// get the hidden option fields, taken from WP core
|
184 |
+
$options = false;
|
185 |
+
if($_POST['page_options']){
|
186 |
+
$options = explode(',', stripslashes($_POST['page_options']));
|
187 |
+
}
|
188 |
+
if($options){
|
189 |
+
foreach($options as $option){
|
190 |
+
$option = trim($option);
|
191 |
+
$value = trim($_POST[ $option ]);
|
192 |
+
$flag->options[ $option ] = $value;
|
193 |
+
}
|
194 |
+
// the path should always end with a slash
|
195 |
+
$flag->options['galleryPath'] = trailingslashit($flag->options['galleryPath']);
|
196 |
+
}
|
197 |
+
// Save options
|
198 |
+
update_option('flag_options', $flag->options);
|
199 |
+
flagGallery::show_message(__('Update Successfully', 'flash-album-gallery'));
|
200 |
}
|
201 |
|
202 |
|
203 |
+
if(isset($_GET['delete'])){
|
204 |
+
check_admin_referer('delete_skin');
|
205 |
+
$delskin = sanitize_flagname($_GET['delete']);
|
206 |
+
if(current_user_can('FlAG Delete skins') && false === strpos($delskin, '..')){
|
207 |
+
if($flag_options['flashSkin'] != $delskin){
|
208 |
+
$skins_dir = trailingslashit($flag_options['skinsDirABS']);
|
209 |
+
$skin = $skins_dir . $delskin . '/';
|
210 |
+
if(basename($skin) != 'flagallery-skins'){
|
211 |
+
if(is_dir($skin)){
|
212 |
+
if(flagGallery::flagFolderDelete($skin)){
|
213 |
+
flagGallery::show_message(__('Skin', 'flash-album-gallery') . ' \'' . $delskin . '\' ' . __('deleted successfully', 'flash-album-gallery'));
|
214 |
+
} else{
|
215 |
+
flagGallery::show_message(__('Can\'t find skin directory ', 'flash-album-gallery') . ' \'' . $delskin . '\' ' . __('. Try delete it manualy via ftp', 'flash-album-gallery'));
|
216 |
+
}
|
217 |
+
}
|
218 |
+
} else{
|
219 |
+
flagGallery::show_message(__('Can\'t find skin directory ', 'flash-album-gallery') . ' \'' . $delskin . '\' ' . __('. Try delete it manualy via ftp', 'flash-album-gallery'));
|
220 |
+
}
|
221 |
+
} else{
|
222 |
+
flagGallery::show_message(__('You need activate another skin before delete it', 'flash-album-gallery'));
|
223 |
+
}
|
224 |
+
} else{
|
225 |
+
wp_die(__('You do not have sufficient permissions to delete skins of Grand Flagallery.'));
|
226 |
+
}
|
227 |
}
|
228 |
|
229 |
+
if(isset($_GET['skin'])){
|
230 |
+
check_admin_referer('set_default_skin');
|
231 |
+
$set_skin = sanitize_flagname($_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($active_skin);
|
243 |
+
update_option('flag_options', $flag_options);
|
244 |
+
flagGallery::show_message(__('Skin', 'flash-album-gallery') . ' \'' . $set_skin . '\' ' . __('activated successfully. Optionally it can be overwritten with shortcode parameter.', 'flash-album-gallery'));
|
245 |
+
}
|
246 |
}
|
247 |
$type = isset($_GET['type'])? sanitize_key($_GET['type']) : '';
|
248 |
switch($type){
|
249 |
+
case '':
|
250 |
+
$stype = 'gallery';
|
251 |
+
$new_skins = __('New Photo Skins', 'flash-album-gallery');
|
252 |
+
break;
|
253 |
+
case 'm':
|
254 |
+
$stype = 'music';
|
255 |
+
$new_skins = __('New Music Skins', 'flash-album-gallery');
|
256 |
+
break;
|
257 |
+
case 'v':
|
258 |
+
$stype = 'video';
|
259 |
+
$new_skins = __('New Video Skins', 'flash-album-gallery');
|
260 |
+
break;
|
261 |
+
case 'b':
|
262 |
+
$stype = 'banner';
|
263 |
+
$new_skins = __('New Banner Skins', 'flash-album-gallery');
|
264 |
+
break;
|
265 |
+
default:
|
266 |
+
$stype = 'gallery';
|
267 |
+
$new_skins = __('New Photo Skins', 'flash-album-gallery');
|
268 |
+
break;
|
|
|
|
|
|
|
|
|
269 |
}
|
270 |
|
271 |
+
if(isset($_GET['skins_refresh'])){
|
272 |
+
check_admin_referer('skins_refresh');
|
273 |
+
// upgrade plugin
|
274 |
+
require_once(FLAG_ABSPATH . 'admin/tuning.php');
|
275 |
+
$ok = flag_tune();
|
276 |
+
if($ok){
|
277 |
+
flagGallery::show_message(__('Skins refreshed successfully', 'flash-album-gallery'));
|
278 |
+
}
|
279 |
}
|
280 |
?>
|
281 |
<div id="slider" class="flag-wrap">
|
282 |
+
<?php if(current_user_can('FlAG Add skins')){ ?>
|
283 |
+
<ul id="tabs" class="tabs">
|
284 |
+
<li class="selected"><a href="#" rel="addskin"><?php _e('Add new skin', 'flash-album-gallery'); ?></a></li>
|
285 |
+
</ul>
|
286 |
+
<?php } ?>
|
287 |
+
|
288 |
+
<?php if(current_user_can('FlAG Add skins')){ ?>
|
289 |
+
<div id="addskin" class="cptab" style="display:block;">
|
290 |
+
<div> </div>
|
291 |
+
<h4 style="margin-top:0;"><?php _e('Install a skin in .zip format', 'flash-album-gallery'); ?></h4>
|
292 |
+
<p><?php _e('If you have a skin in a .zip format, You may install it by uploading it here.', 'flash-album-gallery'); ?></p>
|
293 |
+
<form method="post" enctype="multipart/form-data" action="<?php echo admin_url('admin.php?page=flag-skins'); ?>">
|
294 |
+
<?php wp_nonce_field('skin-upload'); ?>
|
295 |
+
<p><input type="file" name="skinzip"/>
|
296 |
+
<input type="submit" class="button" name="installskin" value="<?php _e('Install Now', 'flash-album-gallery'); ?>"/>
|
297 |
+
</p>
|
298 |
+
</form>
|
299 |
+
<?php if(isset($_POST['installskin'])){
|
300 |
+
do_action('install_skins_upload');
|
301 |
+
} ?>
|
302 |
+
</div>
|
303 |
+
<?php } ?>
|
304 |
+
|
305 |
+
<!--<script type="text/javascript">-->
|
306 |
+
<!-- /* <![CDATA[ */-->
|
307 |
+
<!-- //noinspection JSPotentiallyInvalidConstructorUsage-->
|
308 |
+
<!-- var cptabs = new ddtabcontent("tabs");-->
|
309 |
+
<!-- cptabs.setpersist(true);-->
|
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('FlaGallery License Key', 'flash-album-gallery'); ?></h2>
|
319 |
+
<p><?php _e('If you have license key then paste it here.', 'flash-album-gallery'); ?></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>
|
323 |
+
<input type="text" name="license_key" value="<?php echo $flag_options['license_key'] ?>" size="55"/>
|
324 |
+
<input style="display:none" type="text" name="license_name" value="<?php echo $flag_options['license_name'] ?>"/>
|
325 |
+
<input type="submit" class="button" value="<?php _e('Save', 'flash-album-gallery'); ?>"/>
|
326 |
+
</p>
|
327 |
+
<?php if($flag_options['license_name']){ ?>
|
328 |
+
<p style="font-weight: bold;"><?php printf(__('You have <span style="color:red">%s</span> license'), $flag_options['license_name']); ?></p>
|
329 |
+
<?php }
|
330 |
+
if( !$flag_options['license_name']){
|
331 |
+
?>
|
332 |
+
<p>
|
333 |
+
<a href="http://bit.ly/2jPNRB0" class="button button-primary button-red" target="_blank"><?php _e('Get Premium', 'flash-album-gallery') ?></a>
|
334 |
+
</p>
|
335 |
+
<?php
|
336 |
+
} else{
|
337 |
+
if('MINIPack' === $flag_options['license_name']){
|
338 |
+
?>
|
339 |
+
<p>
|
340 |
+
<a href="http://bit.ly/2jPNRB0" class="button button-primary button-red" target="_blank"><?php _e('Upgrade License to GRANDPack or GRANDPack+', 'flash-album-gallery') ?></a>
|
341 |
+
</p>
|
342 |
+
<?php
|
343 |
+
} elseif('GRANDPack' === $flag_options['license_name']){
|
344 |
+
?>
|
345 |
+
<p>
|
346 |
+
<a href="http://bit.ly/2jPNRB0" class="button button-primary button-red" target="_blank"><?php _e('Upgrade License to GRANDPack+', 'flash-album-gallery') ?></a>
|
347 |
+
</p>
|
348 |
+
<?php
|
349 |
+
}
|
350 |
+
}
|
351 |
+
?>
|
352 |
+
</form>
|
353 |
+
</div>
|
354 |
<?php } ?>
|
355 |
|
356 |
<div class="flag-wrap" style="min-width: 878px;">
|
357 |
+
<h2><?php _e('Skins', 'flash-album-gallery'); ?>:</h2>
|
358 |
+
<p style="float: right; display:none;">
|
359 |
+
<a class="button" href="<?php echo wp_nonce_url('admin.php?page=flag-skins&skins_refresh=1', 'skins_refresh'); ?>"><?php _e('Refresh / Update Skins', 'flash-album-gallery'); ?></a>
|
360 |
+
</p>
|
361 |
+
<p><a class="button<?php if( !$type){
|
362 |
+
echo '-primary';
|
363 |
+
} ?>" href="<?php echo admin_url('admin.php?page=flag-skins'); ?>"><span style="font-size: 14px;"><?php _e('Photo skins', 'flash-album-gallery'); ?></span></a>
|
364 |
+
<a class="button<?php if($type == 'm'){
|
365 |
+
echo '-primary';
|
366 |
+
} ?>" href="<?php echo admin_url('admin.php?page=flag-skins&type=m'); ?>"><span style="font-size: 14px;"><?php _e('Music skins', 'flash-album-gallery'); ?></span></a>
|
367 |
+
<a class="button<?php if($type == 'v'){
|
368 |
+
echo '-primary';
|
369 |
+
} ?>" href="<?php echo admin_url('admin.php?page=flag-skins&type=v'); ?>"><span style="font-size: 14px;"><?php _e('Video skins', 'flash-album-gallery'); ?></span></a>
|
370 |
+
<a class="button<?php if($type == 'b'){
|
371 |
+
echo '-primary';
|
372 |
+
} ?>" href="<?php echo admin_url('admin.php?page=flag-skins&type=b'); ?>"><span style="font-size: 14px;"><?php _e('Banner skins', 'flash-album-gallery'); ?></span></a>
|
373 |
+
</p>
|
374 |
+
|
375 |
+
<?php
|
376 |
+
$all_skins = get_skins(false, $type);
|
377 |
+
$total_all_skins = count($all_skins);
|
378 |
+
|
379 |
+
function flag_curl_exec_follow($ch, &$maxredirect = null){
|
380 |
+
|
381 |
+
// we emulate a browser here since some websites detect
|
382 |
+
// us as a bot and don't let us do our job
|
383 |
+
$user_agent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5)" .
|
384 |
+
" Gecko/20041107 Firefox/1.0";
|
385 |
+
curl_setopt($ch, CURLOPT_USERAGENT, $user_agent);
|
386 |
+
|
387 |
+
$mr = $maxredirect === null? 5 : intval($maxredirect);
|
388 |
+
|
389 |
+
if(filter_var(ini_get('open_basedir'), FILTER_VALIDATE_BOOLEAN) === false && FLAG_SAFE_MODE === false){
|
390 |
+
|
391 |
+
@curl_setopt($ch, CURLOPT_FOLLOWLOCATION, $mr > 0);
|
392 |
+
curl_setopt($ch, CURLOPT_MAXREDIRS, $mr);
|
393 |
+
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
394 |
+
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
|
395 |
+
|
396 |
+
} else{
|
397 |
+
|
398 |
+
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false);
|
399 |
+
|
400 |
+
if($mr > 0){
|
401 |
+
$original_url = curl_getinfo($ch, CURLINFO_EFFECTIVE_URL);
|
402 |
+
$newurl = $original_url;
|
403 |
+
|
404 |
+
$rch = curl_copy_handle($ch);
|
405 |
+
|
406 |
+
curl_setopt($rch, CURLOPT_HEADER, true);
|
407 |
+
curl_setopt($rch, CURLOPT_NOBODY, true);
|
408 |
+
curl_setopt($rch, CURLOPT_FORBID_REUSE, false);
|
409 |
+
do {
|
410 |
+
curl_setopt($rch, CURLOPT_URL, $newurl);
|
411 |
+
$header = curl_exec($rch);
|
412 |
+
if(curl_errno($rch)){
|
413 |
+
$code = 0;
|
414 |
+
} else{
|
415 |
+
$code = curl_getinfo($rch, CURLINFO_HTTP_CODE);
|
416 |
+
if($code == 301 || $code == 302){
|
417 |
+
preg_match('/Location:(.*?)\n/i', $header, $matches);
|
418 |
+
$newurl = trim(array_pop($matches));
|
419 |
+
|
420 |
+
// if no scheme is present then the new url is a
|
421 |
+
// relative path and thus needs some extra care
|
422 |
+
if( !preg_match("/^https?:/i", $newurl)){
|
423 |
+
$newurl = $original_url . $newurl;
|
424 |
+
}
|
425 |
+
} else{
|
426 |
+
$code = 0;
|
427 |
+
}
|
428 |
+
}
|
429 |
+
} while($code && -- $mr);
|
430 |
+
|
431 |
+
curl_close($rch);
|
432 |
+
|
433 |
+
if( !$mr){
|
434 |
+
if($maxredirect === null){
|
435 |
+
trigger_error('Too many redirects.', E_USER_WARNING);
|
436 |
+
} else{
|
437 |
+
$maxredirect = 0;
|
438 |
+
}
|
439 |
+
|
440 |
+
return false;
|
441 |
+
}
|
442 |
+
curl_setopt($ch, CURLOPT_URL, $newurl);
|
443 |
+
}
|
444 |
+
}
|
445 |
+
|
446 |
+
return curl_exec($ch);
|
447 |
+
}
|
448 |
+
|
449 |
+
$skins_remote_xml = 'http://mypgc.co/depository/skins2.xml';
|
450 |
+
// not installed skins
|
451 |
+
$skins_xml = @simplexml_load_file($skins_remote_xml, 'SimpleXMLElement', LIBXML_NOCDATA);
|
452 |
+
$all_skins_arr = $skins_by_type = array();
|
453 |
+
$skins_xml_error = false;
|
454 |
+
if(empty($skins_xml) && function_exists('curl_init')){
|
455 |
+
$ch = curl_init($skins_remote_xml);
|
456 |
+
/*curl_setopt($ch, CURLOPT_HEADER, 0);
|
457 |
+
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
458 |
+
@curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
|
459 |
+
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
|
460 |
+
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 3);
|
461 |
+
curl_setopt($ch, CURLOPT_TIMEOUT, 15);
|
462 |
+
*/
|
463 |
+
$skins_xml = @simplexml_load_string(flag_curl_exec_follow($ch));
|
464 |
+
curl_close($ch);
|
465 |
+
}
|
466 |
+
|
467 |
+
if( !empty($skins_xml)){
|
468 |
+
foreach($skins_xml as $skin){
|
469 |
+
$suid = (string) $skin->uid;
|
470 |
+
$skintype = (string) $skin->type;
|
471 |
+
$all_skins_arr[ $suid ] = get_object_vars($skin);
|
472 |
+
$skins_by_type[ $skintype ][ $suid ] = $all_skins_arr[ $suid ];
|
473 |
+
}
|
474 |
+
} else{
|
475 |
+
//$skins_xml_error = __('URL file-access is disabled in the server configuration.', 'flash-album-gallery');
|
476 |
+
$skins_xml_error = __('cURL library is not installed on your server.', 'flash-album-gallery') . '<br>' . __('Download skins from http://mypgc.co/', 'flash-album-gallery');
|
477 |
+
}
|
478 |
+
|
479 |
+
|
480 |
+
?>
|
481 |
+
|
482 |
+
<div style="width:70%; overflow: hidden; float: left;">
|
483 |
+
<table class="widefat flag-table" cellspacing="0" id="skins-table">
|
484 |
+
<thead>
|
485 |
+
<tr>
|
486 |
+
<th scope="col" class="manage-column"><?php _e('Skin', 'flash-album-gallery'); ?></th>
|
487 |
+
<th scope="col" class="manage-column"><?php _e('Description', 'flash-album-gallery'); ?></th>
|
488 |
+
<th scope="col" class="action-links"><?php _e('Action', 'flash-album-gallery'); ?></th>
|
489 |
+
</tr>
|
490 |
+
</thead>
|
491 |
+
|
492 |
+
<tfoot>
|
493 |
+
<tr>
|
494 |
+
<th scope="col" class="manage-column"><?php _e('Skin', 'flash-album-gallery'); ?></th>
|
495 |
+
<th scope="col" class="manage-column"><?php _e('Description', 'flash-album-gallery'); ?></th>
|
496 |
+
<th scope="col" class="action-links"><?php _e('Action', 'flash-album-gallery'); ?></th>
|
497 |
+
</tr>
|
498 |
+
</tfoot>
|
499 |
+
|
500 |
+
<tbody class="skins">
|
501 |
+
<?php
|
502 |
+
|
503 |
+
if(empty($all_skins)){
|
504 |
+
echo '<tr>
|
505 |
<td colspan="3">' . __('No skins to show') . '</td>
|
506 |
</tr>';
|
507 |
+
}
|
508 |
+
foreach((array) $all_skins as $skin_file => $skin_data){
|
509 |
+
$class = (dirname($skin_file) == $flag_options['flashSkin'])? 'active' : 'inactive';
|
510 |
+
$is_premium = isset($skin_data['Status']);
|
511 |
+
$class .= $is_premium? ' skin-status-' . $skin_data['Name'] : '';
|
512 |
+
if( !empty($skin_data['uid'])){
|
513 |
+
$suid = (string) $skin_data['uid'];
|
514 |
+
if(isset($all_skins_arr[ $suid ]) && (string) $all_skins_arr[ $suid ]['uid'] == $suid){
|
515 |
+
if(version_compare((float) $all_skins_arr[ $suid ]['version'], (float) $skin_data['Version'], '<=')){
|
516 |
+
unset($skins_by_type[ $stype ][ $suid ]);
|
517 |
+
}
|
518 |
+
}
|
519 |
+
} ?>
|
520 |
+
<tr id="<?php echo basename($skin_file, '.php'); ?>" class="<?php echo $class; ?> first">
|
521 |
+
<td class="skin-title"><strong><?php echo $skin_data['Name']; ?></strong>
|
522 |
+
- <?php echo ( !$skin_data['Status'] || 'free' === $skin_data['Status'])? 'Free' : 'Premium'; ?>
|
523 |
+
</td>
|
524 |
+
<td class="desc">
|
525 |
+
<?php
|
526 |
+
$skin_meta = array();
|
527 |
+
if( !empty($skin_data['Version'])){
|
528 |
+
$skin_meta[] = sprintf(__('Version %s', 'flash-album-gallery'), $skin_data['Version']);
|
529 |
+
}
|
530 |
+
if( !empty($skin_data['Author'])){
|
531 |
+
$author = $skin_data['Author'];
|
532 |
+
if( !empty($skin_data['AuthorURI'])){
|
533 |
+
$author = '<a href="' . $skin_data['AuthorURI'] . '" title="' . __('Visit author homepage', 'flash-album-gallery') . '">' . $skin_data['Author'] . '</a>';
|
534 |
+
}
|
535 |
+
$skin_meta[] = sprintf(__('By %s', 'flash-album-gallery'), $author);
|
536 |
+
}
|
537 |
+
if( !empty($skin_data['SkinURI'])){
|
538 |
+
$skin_meta[] = '<a href="' . $skin_data['SkinURI'] . '" title="' . __('Visit skin site', 'flash-album-gallery') . '">' . __('Visit skin site', 'flash-album-gallery') . '</a>';
|
539 |
+
}
|
540 |
+
?>
|
541 |
+
<?php echo implode(' | ', $skin_meta); ?>
|
542 |
+
</td>
|
543 |
+
<td class="skin-activate action-links" style="white-space: nowrap;">
|
544 |
+
<?php
|
545 |
+
if(isset($_GET['type']) && !empty($_GET['type'])){
|
546 |
+
} else{
|
547 |
+
if(dirname($skin_file) != $flag_options['flashSkin']){ ?>
|
548 |
+
<strong><a href="<?php echo wp_nonce_url('admin.php?page=flag-skins&skin=' . dirname($skin_file), 'set_default_skin'); ?>" title="<?php _e('Activate this skin', 'flash-album-gallery'); ?>"><?php _e('Activate', 'flash-album-gallery'); ?></a></strong>
|
549 |
+
<?php } else{ ?>
|
550 |
+
<strong><?php _e('Activated by default', 'flash-album-gallery'); ?></strong>
|
551 |
+
<?php
|
552 |
+
}
|
553 |
+
} ?>
|
554 |
+
</td>
|
555 |
+
|
556 |
+
</tr>
|
557 |
+
<tr class="<?php echo $class; ?> second">
|
558 |
+
<td class="skin-title">
|
559 |
+
<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']; ?>"/>
|
560 |
+
</td>
|
561 |
+
<td class="desc">
|
562 |
+
<p><?php echo $skin_data['Description']; ?></p>
|
563 |
+
<?php
|
564 |
+
if( !$flag_options['license_name']){
|
565 |
+
if($skin_data['Status'] && 'free' !== $skin_data['Status']){
|
566 |
+
?>
|
567 |
+
<p>
|
568 |
+
<a href="http://bit.ly/2jPNRB0" class="button button-primary button-red" target="_blank"><?php _e('Get Premium', 'flash-album-gallery') ?></a>
|
569 |
+
</p>
|
570 |
+
<?php
|
571 |
+
}
|
572 |
+
} else{
|
573 |
+
if('GRANDPackPlus' === $skin_data['Status'] && 'GRANDPackPlus' !== $flag_options['license_name']){
|
574 |
+
?>
|
575 |
+
<p>
|
576 |
+
<a href="http://bit.ly/2jPNRB0" class="button button-primary button-red" target="_blank"><?php _e('Upgrade License to GRANDPack+', 'flash-album-gallery') ?></a>
|
577 |
+
</p>
|
578 |
+
<?php
|
579 |
+
} elseif('GRANDPack' === $skin_data['Status'] && !in_array($flag_options['license_name'], array(
|
580 |
+
'GRANDPackPlus',
|
581 |
+
'GRANDPack',
|
582 |
+
)
|
583 |
+
)){
|
584 |
+
?>
|
585 |
+
<p>
|
586 |
+
<a href="http://bit.ly/2jPNRB0" class="button button-primary button-red" target="_blank"><?php _e('Upgrade License to GRANDPack or GRANDPack+', 'flash-album-gallery') ?></a>
|
587 |
+
</p>
|
588 |
+
<?php
|
589 |
+
}
|
590 |
+
}
|
591 |
+
?>
|
592 |
+
</td>
|
593 |
+
<td class="skin-delete action-links">
|
594 |
+
<a class="thickbox" title="<?php echo esc_attr($skin_data['Name']); ?>" href="<?php echo FLAG_URLPATH . 'admin/skin_options.php?show_options=1&skin=' . dirname($skin_file) . '&TB_iframe=1&width=600&height=560'; ?>"><?php _e('Options', 'flash-album-gallery'); ?></a>
|
595 |
+
<?php
|
596 |
+
if(current_user_can('FlAG Delete skins')){
|
597 |
+
if(dirname($skin_file) != $flag_options['flashSkin']){ ?>
|
598 |
+
<br/><br/>
|
599 |
+
<a class="delete" onclick="javascript:return flag_delskin('<?php echo $skin_data['Name']; ?>');" href="<?php echo wp_nonce_url('admin.php?page=flag-skins&delete=' . dirname($skin_file), 'delete_skin'); ?>" title="<?php _e('Delete this skin', 'flash-album-gallery'); ?>"><?php _e('Delete', 'flash-album-gallery'); ?></a>
|
600 |
+
<?php }
|
601 |
+
} ?>
|
602 |
+
</td>
|
603 |
+
</tr>
|
604 |
+
<?php } ?>
|
605 |
+
</tbody>
|
606 |
+
</table>
|
607 |
+
<script type="text/javascript">
|
608 |
+
function flag_delskin(skin_name){
|
609 |
+
return confirm('<?php echo __('Delete', 'flash-album-gallery'); ?> "' + skin_name + '"');
|
610 |
+
}
|
611 |
+
</script>
|
612 |
+
</div>
|
613 |
+
|
614 |
+
<div class="postbox metabox-holder" id="newskins" style="width: 29%; float: right; padding-top: 5px; text-align:center">
|
615 |
+
<h3 style="font-size: 16px; line-height: 100%; font-weight: bold; color: #2583AD;"><?php echo $new_skins; ?></h3>
|
616 |
+
<div class="inside">
|
617 |
+
<?php
|
618 |
+
if(isset($skins_by_type[ $stype ]) && !empty($skins_by_type[ $stype ])){
|
619 |
+
foreach($skins_by_type[ $stype ] as $skin){ ?>
|
620 |
+
<div class="skin <?php echo $skin['type'] . ' ' . $skin['status']; ?>" id="uid-<?php echo $skin['uid']; ?>" style="padding: 10px;">
|
621 |
+
<div style="text-align: center;">
|
622 |
+
<p style="font-size: 120%;"><strong><?php echo $skin['title']; ?></strong>
|
623 |
+
<small class="version"><?php echo 'v' . $skin['version']; ?></small>
|
624 |
+
- <?php echo ( !$skin['status'] || 'free' === $skin['status'])? 'Free' : 'Premium'; ?></p>
|
625 |
+
<div class="screenshot">
|
626 |
+
<img src="<?php echo $skin['screenshot']; ?>" style="width:80%; height:auto" alt=""/>
|
627 |
+
</div>
|
628 |
+
</div>
|
629 |
+
<div class="content">
|
630 |
+
<div class="links" style="text-align: center;">
|
631 |
+
<form action="<?php echo admin_url('admin.php?page=flag-skins') . '&type=' . $type; ?>" method="post">
|
632 |
+
<?php wp_nonce_field('skin_install'); ?>
|
633 |
+
<input type="hidden" name="skinzipurl" value="<?php echo $skin['download']; ?>"/>
|
634 |
+
<p>
|
635 |
+
<a class="install button-primary" onclick="jQuery(this).closest('form').submit(); return false" href="<?php echo $skin['download']; ?>"><?php _e('Install', 'gmLang') ?></a>
|
636 |
+
<a class="button" href="<?php echo $skin['demo']; ?>" target="_blank"><?php _e('Preview', 'gmLang') ?></a>
|
637 |
+
<?php
|
638 |
+
if( !$flag_options['license_name']){
|
639 |
+
if($skin['status'] && 'free' !== $skin['status']){
|
640 |
+
?>
|
641 |
+
<a href="http://bit.ly/2jPNRB0" class="button button-primary button-red" target="_blank"><?php _e('Get Premium', 'flash-album-gallery') ?></a>
|
642 |
+
<?php
|
643 |
+
}
|
644 |
+
} else{
|
645 |
+
if('GRANDPackPlus' === $skin['status'] && 'GRANDPackPlus' !== $flag_options['license_name']){
|
646 |
+
?>
|
647 |
+
<a href="http://bit.ly/2jPNRB0" class="button button-primary button-red" target="_blank"><?php _e('Upgrade License', 'flash-album-gallery') ?></a>
|
648 |
+
<?php
|
649 |
+
} elseif('GRANDPack' === $skin['status'] && !in_array($flag_options['license_name'], array(
|
650 |
+
'GRANDPackPlus',
|
651 |
+
'GRANDPack',
|
652 |
+
)
|
653 |
+
)){
|
654 |
+
?>
|
655 |
+
<a href="http://bit.ly/2jPNRB0" class="button button-primary button-red" target="_blank"><?php _e('Upgrade License', 'flash-album-gallery') ?></a>
|
656 |
+
<?php
|
657 |
+
}
|
658 |
+
}
|
659 |
+
|
660 |
+
?>
|
661 |
+
</p>
|
662 |
+
</form>
|
663 |
+
</div>
|
664 |
+
</div>
|
665 |
+
</div>
|
666 |
+
<?php
|
667 |
+
}
|
668 |
+
} else{ ?>
|
669 |
+
<div class="skin noskins"><?php if( !$skins_xml_error){
|
670 |
+
echo sprintf(__('All available %s skins are already installed...', 'gmLang'), $stype);
|
671 |
+
} else{
|
672 |
+
echo $skins_xml_error;
|
673 |
+
} ?></div>
|
674 |
+
<?php }
|
675 |
+
?>
|
676 |
+
</div>
|
677 |
+
</div>
|
678 |
|
679 |
|
680 |
</div>
|
admin/tinymce/editor_plugin.js
CHANGED
@@ -18,7 +18,7 @@
|
|
18 |
|
19 |
ed.addCommand('mceFlAG', function() {
|
20 |
ed.windowManager.open({
|
21 |
-
file :
|
22 |
width : 640 + ed.getLang('FlAG.delta_width', 0),
|
23 |
height : 480 + ed.getLang('FlAG.delta_height', 0),
|
24 |
inline : 1
|
@@ -65,7 +65,7 @@
|
|
65 |
longname : 'FlAG',
|
66 |
author : 'Sergey Pasyuk',
|
67 |
authorurl : 'http://codeasily.com',
|
68 |
-
infourl : 'http://
|
69 |
version : "1.4"
|
70 |
};
|
71 |
}
|
18 |
|
19 |
ed.addCommand('mceFlAG', function() {
|
20 |
ed.windowManager.open({
|
21 |
+
file : ajaxurl + '?action=flag_shortcode_helper&riched=true',
|
22 |
width : 640 + ed.getLang('FlAG.delta_width', 0),
|
23 |
height : 480 + ed.getLang('FlAG.delta_height', 0),
|
24 |
inline : 1
|
65 |
longname : 'FlAG',
|
66 |
author : 'Sergey Pasyuk',
|
67 |
authorurl : 'http://codeasily.com',
|
68 |
+
infourl : 'http://mypgc.co',
|
69 |
version : "1.4"
|
70 |
};
|
71 |
}
|
admin/tinymce/img/butt2.png
CHANGED
Binary file
|
admin/tinymce/img/button_bg.png
CHANGED
Binary file
|
admin/tinymce/img/fade-butt.png
CHANGED
Binary file
|
admin/tinymce/langs/de.js
CHANGED
@@ -2,5 +2,5 @@
|
|
2 |
|
3 |
tinyMCE.addI18n({de:{
|
4 |
FlAG:{
|
5 |
-
desc : '
|
6 |
}}});
|
2 |
|
3 |
tinyMCE.addI18n({de:{
|
4 |
FlAG:{
|
5 |
+
desc : 'FlaGallery hinzufuegen'
|
6 |
}}});
|
admin/tinymce/langs/de_de.js
CHANGED
@@ -2,5 +2,5 @@
|
|
2 |
|
3 |
tinyMCE.addI18n({de:{
|
4 |
FlAG:{
|
5 |
-
desc : '
|
6 |
}}});
|
2 |
|
3 |
tinyMCE.addI18n({de:{
|
4 |
FlAG:{
|
5 |
+
desc : 'FlaGallery hinzufuegen'
|
6 |
}}});
|
admin/tinymce/langs/en.js
CHANGED
@@ -2,5 +2,5 @@
|
|
2 |
|
3 |
tinyMCE.addI18n({en:{
|
4 |
FlAG:{
|
5 |
-
desc : 'Add
|
6 |
}}});
|
2 |
|
3 |
tinyMCE.addI18n({en:{
|
4 |
FlAG:{
|
5 |
+
desc : 'Add FlaGallery'
|
6 |
}}});
|
admin/tinymce/langs/en_US.js
CHANGED
@@ -2,5 +2,5 @@
|
|
2 |
|
3 |
tinyMCE.addI18n({en_US:{
|
4 |
FlAG:{
|
5 |
-
desc : 'Add
|
6 |
}}});
|
2 |
|
3 |
tinyMCE.addI18n({en_US:{
|
4 |
FlAG:{
|
5 |
+
desc : 'Add FlaGallery'
|
6 |
}}});
|
admin/tinymce/tinymce.php
CHANGED
@@ -110,15 +110,12 @@ class add_flag_button {
|
|
110 |
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>');
|
111 |
});
|
112 |
function wpflagins() {
|
113 |
-
tb_show("<?php _e('Insert
|
114 |
jQuery("#TB_window").css({width:"640px", height:"310px", marginTop:"-160px", marginLeft:"-320px", top:"50%"});
|
115 |
jQuery("#TB_iframeContent").css({width:"640px", height:"310px"});
|
116 |
jQuery(window).unbind("resize");
|
117 |
}
|
118 |
-
|
119 |
-
jQuery(window).bind("resize", tb_position);
|
120 |
-
}
|
121 |
-
//-->
|
122 |
</script>
|
123 |
<?php
|
124 |
}
|
@@ -126,4 +123,4 @@ class add_flag_button {
|
|
126 |
}
|
127 |
|
128 |
// Call it now
|
129 |
-
$tinymce_button = new add_flag_button
|
110 |
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>');
|
111 |
});
|
112 |
function wpflagins() {
|
113 |
+
tb_show("<?php _e('Insert FlaGallery Album with one or more galleries', 'flash-album-gallery'); ?>","<?php echo add_query_arg(array('action' => 'flag_shortcode_helper'), admin_url( 'admin-ajax.php' )); ?>&TB_iframe=true&width=640&height=310",false);
|
114 |
jQuery("#TB_window").css({width:"640px", height:"310px", marginTop:"-160px", marginLeft:"-320px", top:"50%"});
|
115 |
jQuery("#TB_iframeContent").css({width:"640px", height:"310px"});
|
116 |
jQuery(window).unbind("resize");
|
117 |
}
|
118 |
+
//-->
|
|
|
|
|
|
|
119 |
</script>
|
120 |
<?php
|
121 |
}
|
123 |
}
|
124 |
|
125 |
// Call it now
|
126 |
+
$tinymce_button = new add_flag_button();
|
admin/tinymce/window.php
CHANGED
@@ -3,7 +3,6 @@
|
|
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') )
|
@@ -12,35 +11,34 @@ if ( !is_user_logged_in() || !current_user_can('edit_posts') )
|
|
12 |
global $flag, $flagdb, $wp_query;
|
13 |
|
14 |
$all_skins = get_skins();
|
15 |
-
|
16 |
-
|
17 |
-
if($riched) {
|
18 |
?>
|
19 |
<html xmlns="http://www.w3.org/1999/xhtml">
|
20 |
<head>
|
21 |
-
<title><?php _e("Insert
|
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 |
-
<link rel="stylesheet" type="text/css" href="<?php echo FLAG_URLPATH; ?>admin/js/selectize/selectize.css" />
|
27 |
-
<script language="javascript" type="text/javascript" src="
|
28 |
-
<script language="javascript" type="text/javascript" src="<?php echo FLAG_URLPATH; ?>admin/js/selectize/selectize.min.js"></script>
|
29 |
<base target="_self" />
|
30 |
</head>
|
31 |
<body id="link">
|
32 |
<?php } else { ?>
|
33 |
<html xmlns="http://www.w3.org/1999/xhtml">
|
34 |
<head>
|
35 |
-
<title><?php _e("Insert
|
36 |
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_option('blog_charset'); ?>" />
|
37 |
-
<script language="javascript" type="text/javascript" src="<?php echo get_option('siteurl'); ?>/wp-includes/js/jquery/jquery.js"></script>
|
38 |
-
<script language="javascript" type="text/javascript" src="<?php echo get_option('siteurl'); ?>/wp-includes/js/tinymce/tiny_mce_popup.js"></script>
|
39 |
-
<script language="javascript" type="text/javascript" src="<?php echo FLAG_URLPATH; ?>admin/js/tabs.js"></script>
|
40 |
-
<link rel="stylesheet" type="text/css" href="<?php echo FLAG_URLPATH; ?>admin/tinymce/popup.css" />
|
41 |
-
<link rel="stylesheet" type="text/css" href="<?php echo FLAG_URLPATH; ?>admin/js/selectize/selectize.css" />
|
42 |
-
<script language="javascript" type="text/javascript" src="
|
43 |
-
<script language="javascript" type="text/javascript" src="<?php echo FLAG_URLPATH; ?>admin/js/selectize/selectize.min.js"></script>
|
44 |
<base target="_self" />
|
45 |
</head>
|
46 |
<body id="link" onload="tinyMCEPopup.executeOnLoad('init();');document.body.style.display='';document.getElementById('galleries').focus();" style="display: none; font-size: 13px;">
|
@@ -48,24 +46,23 @@ if($riched) {
|
|
48 |
<form name="FlAG" action="#">
|
49 |
<div class="cptabs_wrapper">
|
50 |
<ul id="tabs" class="tabs">
|
51 |
-
<li class="selected"><a href="#" rel="gallery_panel"><span><?php _e( 'Galleries', '
|
52 |
-
<li><a href="#" rel="album_panel"><span><?php _e( 'Albums', '
|
53 |
-
<li id="sort_tab"><a href="#" rel="sort_panel"><span><?php _e('Sort', '
|
54 |
-
<li><a href="#" rel="custom_panel"><span><?php _e( 'Skin', '
|
55 |
-
<li><a href="#" rel="music_panel"><span><?php _e( 'Music', 'flag' ); ?></span></a></li>
|
56 |
</ul>
|
57 |
|
58 |
<!-- gallery panel -->
|
59 |
<div id="gallery_panel" class="panel cptab current">
|
60 |
<table border="0" cellpadding="4" cellspacing="0">
|
61 |
<tr>
|
62 |
-
<td nowrap="nowrap" valign="middle" width="35%"><label for="galleryname"><?php _e("Album Name", '
|
63 |
<td valign="middle"><input id="galleryname" name="galleryname" value="Gallery" type="text" /></td>
|
64 |
</tr>
|
65 |
<tr>
|
66 |
-
<td nowrap="nowrap" valign="middle"><label for="galleries"><?php _e("Select galleries", '
|
67 |
-
<td><select id="galleries" name="galleries" size="6" multiple="multiple" placeholder="<?php _e("Leave blank for all galleries", '
|
68 |
-
<option value=""><?php _e("Leave blank for all galleries", '
|
69 |
<?php
|
70 |
$gallerylist = $flagdb->find_all_galleries($flag->options['albSort'], $flag->options['albSortDir']);
|
71 |
if(is_array($gallerylist)) {
|
@@ -86,9 +83,9 @@ if($riched) {
|
|
86 |
<div id="album_panel" class="panel cptab">
|
87 |
<table border="0" cellpadding="4" cellspacing="0">
|
88 |
<tr>
|
89 |
-
<td nowrap="nowrap" valign="middle" width="35%"><label for="album"><?php _e("Select album", '
|
90 |
<td><select id="album" name="album">
|
91 |
-
<option value="galleries"><?php _e("Choose Album or skip to use Galleries", '
|
92 |
<?php
|
93 |
$albumlist = $flagdb->find_all_albums('id', 'ASC');
|
94 |
if(is_array($albumlist)) {
|
@@ -107,9 +104,9 @@ if($riched) {
|
|
107 |
<div id="custom_panel" class="panel cptab">
|
108 |
<table border="0" cellpadding="4" cellspacing="0">
|
109 |
<tr>
|
110 |
-
<td nowrap="nowrap" valign="middle" width="35%"><label for="skinname"><?php _e("Choose skin", '
|
111 |
<td valign="middle"><select id="skinname" name="skinname">
|
112 |
-
<option value="" selected="selected"><?php _e("choose custom skin", '
|
113 |
<?php
|
114 |
foreach ( (array)$all_skins as $skin_file => $skin_data) {
|
115 |
echo '<option value="'.dirname($skin_file).'">'.$skin_data['Name'].'</option>'."\n";
|
@@ -118,16 +115,16 @@ if($riched) {
|
|
118 |
</select></td>
|
119 |
</tr>
|
120 |
<tr>
|
121 |
-
<td valign="top"><label><?php _e("Skin size", '
|
122 |
-
<td valign="top"><?php _e("width", '
|
123 |
</tr>
|
124 |
<tr>
|
125 |
-
<td valign="top"><label><?php _e("Skin align", '
|
126 |
<td valign="top"><select id="skinalign" name="skinalign">
|
127 |
-
<option value="" selected="selected"><?php _e("default", '
|
128 |
-
<option value="left"><?php _e("align left", '
|
129 |
-
<option value="center"><?php _e("align center", '
|
130 |
-
<option value="right"><?php _e("align right", '
|
131 |
</select></td>
|
132 |
</tr>
|
133 |
</table>
|
@@ -137,53 +134,33 @@ if($riched) {
|
|
137 |
<div id="sort_panel" class="panel cptab">
|
138 |
<table border="0" cellpadding="4" cellspacing="0">
|
139 |
<tr>
|
140 |
-
<td nowrap="nowrap" valign="middle" width="35%"><label for="galorderby"><?php _e("Order galleries by", '
|
141 |
<td valign="middle"><select id="galorderby" name="galorderby">
|
142 |
-
<option value="" selected="selected"><?php _e("Gallery IDs (default)", '
|
143 |
-
<option value="title"><?php _e("Gallery Title", '
|
144 |
-
<!-- <option value="sortorder"><?php _e("User Defined", '
|
145 |
-
<option value="rand"><?php _e("Randomly", '
|
146 |
</select></td>
|
147 |
</tr>
|
148 |
<tr>
|
149 |
-
<td nowrap="nowrap" valign="middle"><label for="galorder"><?php _e("Order", '
|
150 |
<td valign="middle"><select id="galorder" name="galorder">
|
151 |
-
<option value="" selected="selected"><?php _e("DESC (default)", '
|
152 |
-
<option value="ASC"><?php _e("ASC", '
|
153 |
</select></td>
|
154 |
</tr>
|
155 |
<tr>
|
156 |
-
<td nowrap="nowrap" valign="middle"><label for="galexclude"><?php _e("Exclude Gallery", '
|
157 |
<td valign="middle"><input id="galexclude" name="galexclude" type="text" /></td>
|
158 |
</tr>
|
159 |
</table>
|
160 |
</div>
|
161 |
<!-- /sort panel -->
|
162 |
-
<!-- music panel -->
|
163 |
-
<div id="music_panel" class="panel cptab">
|
164 |
-
<table border="0" cellpadding="4" cellspacing="0">
|
165 |
-
<tr>
|
166 |
-
<td nowrap="nowrap" valign="top" width="35%"><div style="display: block; white-space: normal;"><?php _e("Choose playlist for background music", 'flag'); ?>:</div></td>
|
167 |
-
<td valign="middle" valign="top"><select id="playlist" name="playlist">
|
168 |
-
<option value="" selected="selected"><?php _e("choose playlist", 'flag'); ?></option>
|
169 |
-
<?php
|
170 |
-
foreach((array)$all_playlists as $playlist_file => $playlist_data) {
|
171 |
-
$playlist_name = basename($playlist_file, '.xml');
|
172 |
-
?>
|
173 |
-
<option value="<?php echo $playlist_name; ?>"><?php echo esc_html(stripslashes($playlist_data['title'])); ?></option>
|
174 |
-
<?php
|
175 |
-
}
|
176 |
-
?>
|
177 |
-
</select><p style="padding-top: 10px; margin: 0; font-size: 11px;"><?php _e('Read Skin specification for supporting this function.') ?></p></td>
|
178 |
-
</tr>
|
179 |
-
</table>
|
180 |
-
</div>
|
181 |
-
<!-- /music panel -->
|
182 |
|
183 |
</div>
|
184 |
<div class="mceActionPanel">
|
185 |
<div style="float: right">
|
186 |
-
<input type="button" id="insert" name="insert" value="<?php _e("Insert", '
|
187 |
</div>
|
188 |
</div>
|
189 |
<script type="text/javascript">
|
@@ -197,7 +174,7 @@ if($riched) {
|
|
197 |
<script type="text/javascript">
|
198 |
/* <![CDATA[ */
|
199 |
|
200 |
-
|
201 |
plugins: ['drag_drop','remove_button'],
|
202 |
create: false,
|
203 |
hideSelected: true,
|
@@ -229,13 +206,11 @@ if($riched) {
|
|
229 |
var tagtext;
|
230 |
var galleryname = document.getElementById('galleryname').value;
|
231 |
var gallerywidth = document.getElementById('gallerywidth').value;
|
232 |
-
var galleryheight = document.getElementById('galleryheight').value;
|
233 |
var galorderby = document.getElementById('galorderby').value;
|
234 |
var galorder = document.getElementById('galorder').value;
|
235 |
var galexclude = document.getElementById('galexclude').value;
|
236 |
var skinname = document.getElementById('skinname').value;
|
237 |
var skinalign = document.getElementById('skinalign').value;
|
238 |
-
var playlist = document.getElementById('playlist').value;
|
239 |
var gallery = document.getElementById('galleries');
|
240 |
var album = jQuery('#album').val();
|
241 |
var len = gallery.length;
|
@@ -261,11 +236,17 @@ if($riched) {
|
|
261 |
galleryname = jQuery('#album option:selected').text();
|
262 |
album = ' album='+album;
|
263 |
}
|
|
|
|
|
|
|
264 |
if (galleryname.indexOf(' ') >= 0) {
|
265 |
galleryname = "'"+galleryname+"'";
|
266 |
}
|
267 |
-
|
268 |
-
|
|
|
|
|
|
|
269 |
else
|
270 |
gallerysize="";
|
271 |
|
@@ -290,23 +271,20 @@ if($riched) {
|
|
290 |
if (skinalign) {
|
291 |
skinalign = " align=" + skinalign;
|
292 |
} else skinalign = '';
|
293 |
-
if (playlist) {
|
294 |
-
playlist = " playlist=" + playlist;
|
295 |
-
} else playlist = '';
|
296 |
|
297 |
if (galleryid || album ) {
|
298 |
-
tagtext = '[flagallery' + galleryid + album + gallerysize + galorderby + galorder + galexclude + skinname + skinalign +
|
299 |
win.send_to_editor(tagtext);
|
300 |
win.bind_resize();
|
301 |
-
<?php if(
|
302 |
tinyMCEPopup.close();
|
303 |
<?php } ?>
|
304 |
} else alert('Choose at least one gallery!');
|
305 |
});
|
306 |
jQuery(window).unload(function(){
|
307 |
-
|
308 |
});
|
309 |
-
|
310 |
</script>
|
311 |
</form>
|
312 |
</body>
|
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 |
|
7 |
// check for rights
|
8 |
if ( !is_user_logged_in() || !current_user_can('edit_posts') )
|
11 |
global $flag, $flagdb, $wp_query;
|
12 |
|
13 |
$all_skins = get_skins();
|
14 |
+
//$riched = isset($_REQUEST['riched']);
|
15 |
+
if(empty($riched)) {
|
|
|
16 |
?>
|
17 |
<html xmlns="http://www.w3.org/1999/xhtml">
|
18 |
<head>
|
19 |
+
<title><?php _e("Insert FlaGallery Album with one or more galleries", 'flash-album-gallery'); ?></title>
|
20 |
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_option('blog_charset'); ?>" />
|
21 |
+
<script language="javascript" type="text/javascript" src="<?php echo set_url_scheme( get_option('siteurl'), 'admin'); ?>/wp-includes/js/jquery/jquery.js"></script>
|
22 |
+
<script language="javascript" type="text/javascript" src="<?php echo set_url_scheme( FLAG_URLPATH, 'admin'); ?>admin/js/tabs.js"></script>
|
23 |
+
<link rel="stylesheet" type="text/css" href="<?php echo set_url_scheme( FLAG_URLPATH, 'admin'); ?>admin/tinymce/popup.css" />
|
24 |
+
<link rel="stylesheet" type="text/css" href="<?php echo set_url_scheme( FLAG_URLPATH, 'admin'); ?>admin/js/selectize/selectize.css" />
|
25 |
+
<script language="javascript" type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/jquery-ui.min.js"></script>
|
26 |
+
<script language="javascript" type="text/javascript" src="<?php echo set_url_scheme( FLAG_URLPATH, 'admin'); ?>admin/js/selectize/selectize.min.js"></script>
|
27 |
<base target="_self" />
|
28 |
</head>
|
29 |
<body id="link">
|
30 |
<?php } else { ?>
|
31 |
<html xmlns="http://www.w3.org/1999/xhtml">
|
32 |
<head>
|
33 |
+
<title><?php _e("Insert FlaGallery Album with one or more galleries", 'flash-album-gallery'); ?> </title>
|
34 |
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_option('blog_charset'); ?>" />
|
35 |
+
<script language="javascript" type="text/javascript" src="<?php echo set_url_scheme( get_option('siteurl'), 'admin'); ?>/wp-includes/js/jquery/jquery.js"></script>
|
36 |
+
<script language="javascript" type="text/javascript" src="<?php echo set_url_scheme( get_option('siteurl'), 'admin'); ?>/wp-includes/js/tinymce/tiny_mce_popup.js"></script>
|
37 |
+
<script language="javascript" type="text/javascript" src="<?php echo set_url_scheme( FLAG_URLPATH, 'admin'); ?>admin/js/tabs.js"></script>
|
38 |
+
<link rel="stylesheet" type="text/css" href="<?php echo set_url_scheme( FLAG_URLPATH, 'admin'); ?>admin/tinymce/popup.css" />
|
39 |
+
<link rel="stylesheet" type="text/css" href="<?php echo set_url_scheme( FLAG_URLPATH, 'admin'); ?>admin/js/selectize/selectize.css" />
|
40 |
+
<script language="javascript" type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/jquery-ui.min.js"></script>
|
41 |
+
<script language="javascript" type="text/javascript" src="<?php echo set_url_scheme( FLAG_URLPATH, 'admin'); ?>admin/js/selectize/selectize.min.js"></script>
|
42 |
<base target="_self" />
|
43 |
</head>
|
44 |
<body id="link" onload="tinyMCEPopup.executeOnLoad('init();');document.body.style.display='';document.getElementById('galleries').focus();" style="display: none; font-size: 13px;">
|
46 |
<form name="FlAG" action="#">
|
47 |
<div class="cptabs_wrapper">
|
48 |
<ul id="tabs" class="tabs">
|
49 |
+
<li class="selected"><a href="#" rel="gallery_panel"><span><?php _e( 'Galleries', 'flash-album-gallery' ); ?></span></a></li>
|
50 |
+
<li><a href="#" rel="album_panel"><span><?php _e( 'Albums', 'flash-album-gallery' ); ?></span></a></li>
|
51 |
+
<li id="sort_tab"><a href="#" rel="sort_panel"><span><?php _e('Sort', 'flash-album-gallery'); ?></span></a></li>
|
52 |
+
<li><a href="#" rel="custom_panel"><span><?php _e( 'Skin', 'flash-album-gallery' ); ?></span></a></li>
|
|
|
53 |
</ul>
|
54 |
|
55 |
<!-- gallery panel -->
|
56 |
<div id="gallery_panel" class="panel cptab current">
|
57 |
<table border="0" cellpadding="4" cellspacing="0">
|
58 |
<tr>
|
59 |
+
<td nowrap="nowrap" valign="middle" width="35%"><label for="galleryname"><?php _e("Album Name", 'flash-album-gallery'); ?>:<span style="color:red;"> *</span></label></td>
|
60 |
<td valign="middle"><input id="galleryname" name="galleryname" value="Gallery" type="text" /></td>
|
61 |
</tr>
|
62 |
<tr>
|
63 |
+
<td nowrap="nowrap" valign="middle"><label for="galleries"><?php _e("Select galleries", 'flash-album-gallery'); ?>:</label><br /><small><?php _e("(album categories)", 'flash-album-gallery'); ?></small></td>
|
64 |
+
<td><select id="galleries" name="galleries" size="6" multiple="multiple" placeholder="<?php _e("Leave blank for all galleries", 'flash-album-gallery'); ?>">
|
65 |
+
<option value=""><?php _e("Leave blank for all galleries", 'flash-album-gallery'); ?></option>
|
66 |
<?php
|
67 |
$gallerylist = $flagdb->find_all_galleries($flag->options['albSort'], $flag->options['albSortDir']);
|
68 |
if(is_array($gallerylist)) {
|
83 |
<div id="album_panel" class="panel cptab">
|
84 |
<table border="0" cellpadding="4" cellspacing="0">
|
85 |
<tr>
|
86 |
+
<td nowrap="nowrap" valign="middle" width="35%"><label for="album"><?php _e("Select album", 'flash-album-gallery'); ?>:</label></td>
|
87 |
<td><select id="album" name="album">
|
88 |
+
<option value="galleries"><?php _e("Choose Album or skip to use Galleries", 'flash-album-gallery'); ?></option>
|
89 |
<?php
|
90 |
$albumlist = $flagdb->find_all_albums('id', 'ASC');
|
91 |
if(is_array($albumlist)) {
|
104 |
<div id="custom_panel" class="panel cptab">
|
105 |
<table border="0" cellpadding="4" cellspacing="0">
|
106 |
<tr>
|
107 |
+
<td nowrap="nowrap" valign="middle" width="35%"><label for="skinname"><?php _e("Choose skin", 'flash-album-gallery'); ?>:</label></td>
|
108 |
<td valign="middle"><select id="skinname" name="skinname">
|
109 |
+
<option value="" selected="selected"><?php _e("choose custom skin", 'flash-album-gallery'); ?></option>
|
110 |
<?php
|
111 |
foreach ( (array)$all_skins as $skin_file => $skin_data) {
|
112 |
echo '<option value="'.dirname($skin_file).'">'.$skin_data['Name'].'</option>'."\n";
|
115 |
</select></td>
|
116 |
</tr>
|
117 |
<tr>
|
118 |
+
<td valign="top"><label><?php _e("Skin size", 'flash-album-gallery'); ?>:</label><br /><span style="font-size:9px">(<?php _e("blank for default", 'flash-album-gallery'); ?>)</span></td>
|
119 |
+
<td valign="top"><?php _e("width", 'flash-album-gallery'); ?>: <input id="gallerywidth" type="text" name="gallerywidth" style="width: 50px" /></td>
|
120 |
</tr>
|
121 |
<tr>
|
122 |
+
<td valign="top"><label><?php _e("Skin align", 'flash-album-gallery'); ?>:</label></td>
|
123 |
<td valign="top"><select id="skinalign" name="skinalign">
|
124 |
+
<option value="" selected="selected"><?php _e("default", 'flash-album-gallery'); ?></option>
|
125 |
+
<option value="left"><?php _e("align left", 'flash-album-gallery'); ?></option>
|
126 |
+
<option value="center"><?php _e("align center", 'flash-album-gallery'); ?></option>
|
127 |
+
<option value="right"><?php _e("align right", 'flash-album-gallery'); ?></option>
|
128 |
</select></td>
|
129 |
</tr>
|
130 |
</table>
|
134 |
<div id="sort_panel" class="panel cptab">
|
135 |
<table border="0" cellpadding="4" cellspacing="0">
|
136 |
<tr>
|
137 |
+
<td nowrap="nowrap" valign="middle" width="35%"><label for="galorderby"><?php _e("Order galleries by", 'flash-album-gallery'); ?>:</label></td>
|
138 |
<td valign="middle"><select id="galorderby" name="galorderby">
|
139 |
+
<option value="" selected="selected"><?php _e("Gallery IDs (default)", 'flash-album-gallery'); ?></option>
|
140 |
+
<option value="title"><?php _e("Gallery Title", 'flash-album-gallery'); ?></option>
|
141 |
+
<!-- <option value="sortorder"><?php _e("User Defined", 'flash-album-gallery'); ?></option> -->
|
142 |
+
<option value="rand"><?php _e("Randomly", 'flash-album-gallery'); ?></option>
|
143 |
</select></td>
|
144 |
</tr>
|
145 |
<tr>
|
146 |
+
<td nowrap="nowrap" valign="middle"><label for="galorder"><?php _e("Order", 'flash-album-gallery'); ?>:</label></td>
|
147 |
<td valign="middle"><select id="galorder" name="galorder">
|
148 |
+
<option value="" selected="selected"><?php _e("DESC (default)", 'flash-album-gallery'); ?></option>
|
149 |
+
<option value="ASC"><?php _e("ASC", 'flash-album-gallery'); ?></option>
|
150 |
</select></td>
|
151 |
</tr>
|
152 |
<tr>
|
153 |
+
<td nowrap="nowrap" valign="middle"><label for="galexclude"><?php _e("Exclude Gallery", 'flash-album-gallery'); ?>:</label></td>
|
154 |
<td valign="middle"><input id="galexclude" name="galexclude" type="text" /></td>
|
155 |
</tr>
|
156 |
</table>
|
157 |
</div>
|
158 |
<!-- /sort panel -->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
159 |
|
160 |
</div>
|
161 |
<div class="mceActionPanel">
|
162 |
<div style="float: right">
|
163 |
+
<input type="button" id="insert" name="insert" value="<?php _e("Insert", 'flash-album-gallery'); ?>" />
|
164 |
</div>
|
165 |
</div>
|
166 |
<script type="text/javascript">
|
174 |
<script type="text/javascript">
|
175 |
/* <![CDATA[ */
|
176 |
|
177 |
+
jQuery('#galleries').selectize({
|
178 |
plugins: ['drag_drop','remove_button'],
|
179 |
create: false,
|
180 |
hideSelected: true,
|
206 |
var tagtext;
|
207 |
var galleryname = document.getElementById('galleryname').value;
|
208 |
var gallerywidth = document.getElementById('gallerywidth').value;
|
|
|
209 |
var galorderby = document.getElementById('galorderby').value;
|
210 |
var galorder = document.getElementById('galorder').value;
|
211 |
var galexclude = document.getElementById('galexclude').value;
|
212 |
var skinname = document.getElementById('skinname').value;
|
213 |
var skinalign = document.getElementById('skinalign').value;
|
|
|
214 |
var gallery = document.getElementById('galleries');
|
215 |
var album = jQuery('#album').val();
|
216 |
var len = gallery.length;
|
236 |
galleryname = jQuery('#album option:selected').text();
|
237 |
album = ' album='+album;
|
238 |
}
|
239 |
+
if (galleryname == 'Gallery') {
|
240 |
+
galleryname = '';
|
241 |
+
}
|
242 |
if (galleryname.indexOf(' ') >= 0) {
|
243 |
galleryname = "'"+galleryname+"'";
|
244 |
}
|
245 |
+
if(galleryname){
|
246 |
+
galleryname = ' name=' + galleryname;
|
247 |
+
}
|
248 |
+
if (gallerywidth)
|
249 |
+
gallerysize = " w=" + gallerywidth;
|
250 |
else
|
251 |
gallerysize="";
|
252 |
|
271 |
if (skinalign) {
|
272 |
skinalign = " align=" + skinalign;
|
273 |
} else skinalign = '';
|
|
|
|
|
|
|
274 |
|
275 |
if (galleryid || album ) {
|
276 |
+
tagtext = '[flagallery' + galleryid + album + galleryname + gallerysize + galorderby + galorder + galexclude + skinname + skinalign + ']';
|
277 |
win.send_to_editor(tagtext);
|
278 |
win.bind_resize();
|
279 |
+
<?php if(!empty($riched)) { ?>
|
280 |
tinyMCEPopup.close();
|
281 |
<?php } ?>
|
282 |
} else alert('Choose at least one gallery!');
|
283 |
});
|
284 |
jQuery(window).unload(function(){
|
285 |
+
jQuery(win).unbind("resize");
|
286 |
});
|
287 |
+
/* ]]> */
|
288 |
</script>
|
289 |
</form>
|
290 |
</body>
|
admin/tuning.php
CHANGED
@@ -14,20 +14,23 @@ function flag_tune($show_error=true, $skins_reset=false) {
|
|
14 |
$flag_options['skinsDirURL'] = WP_PLUGIN_URL . '/flagallery-skins/';
|
15 |
update_option('flag_options', $flag_options);
|
16 |
|
17 |
-
if(version_compare(get_option('flagVersion'), '4.25', '<')){
|
18 |
-
|
19 |
-
|
20 |
-
|
|
|
|
|
|
|
21 |
}
|
22 |
-
|
23 |
$errors = '';
|
24 |
// check for main folder
|
25 |
if ( !wp_mkdir_p( $skins_dir ) ) {
|
26 |
-
$errors .= __('Directory <strong>"', '
|
27 |
} else {
|
28 |
// check for permission settings, Safe mode limitations are not taken into account.
|
29 |
if ( !is_writeable( $skins_dir ) ) {
|
30 |
-
$errors .= __('Directory <strong>"', '
|
31 |
} else {
|
32 |
|
33 |
// Files in flash-album-gallery/skins directory
|
@@ -45,7 +48,7 @@ function flag_tune($show_error=true, $skins_reset=false) {
|
|
45 |
}
|
46 |
}
|
47 |
if ( !@rename($old_skins_dir.$file, $skins_dir.$file) ) {
|
48 |
-
$errors .= sprintf(__('Failed to move files from %1$s to %2$s','
|
49 |
'<strong>'.$old_skins_dir.$file.'</strong>', $skins_dir.$file).'<br />';
|
50 |
}
|
51 |
}
|
14 |
$flag_options['skinsDirURL'] = WP_PLUGIN_URL . '/flagallery-skins/';
|
15 |
update_option('flag_options', $flag_options);
|
16 |
|
17 |
+
//if(version_compare(get_option('flagVersion'), '4.25', '<')){
|
18 |
+
// $skins_reset = true;
|
19 |
+
// @unlink($skins_dir.'banner_default');
|
20 |
+
// @unlink($skins_dir.'banner_widget_default');
|
21 |
+
//}
|
22 |
+
if(version_compare(get_option('flagVersion'), '5.0', '<')){
|
23 |
+
flagGallery::flagFolderDelete($skins_dir);
|
24 |
}
|
25 |
+
|
26 |
$errors = '';
|
27 |
// check for main folder
|
28 |
if ( !wp_mkdir_p( $skins_dir ) ) {
|
29 |
+
$errors .= __('Directory <strong>"', 'flash-album-gallery').$skins_dir.__('"</strong> doesn\'t exist. Please create first the <strong>"flagallery-skins"</strong> folder!', 'flash-album-gallery').'<br />';
|
30 |
} else {
|
31 |
// check for permission settings, Safe mode limitations are not taken into account.
|
32 |
if ( !is_writeable( $skins_dir ) ) {
|
33 |
+
$errors .= __('Directory <strong>"', 'flash-album-gallery').$skins_dir.__('"</strong> is not writeable!', 'flash-album-gallery').'<br />';
|
34 |
} else {
|
35 |
|
36 |
// Files in flash-album-gallery/skins directory
|
48 |
}
|
49 |
}
|
50 |
if ( !@rename($old_skins_dir.$file, $skins_dir.$file) ) {
|
51 |
+
$errors .= sprintf(__('Failed to move files from %1$s to %2$s','flash-album-gallery'),
|
52 |
'<strong>'.$old_skins_dir.$file.'</strong>', $skins_dir.$file).'<br />';
|
53 |
}
|
54 |
}
|
admin/upgrade.php
CHANGED
@@ -12,7 +12,7 @@ function flag_upgrade() {
|
|
12 |
global $wpdb, $user_ID;
|
13 |
|
14 |
// get the current user ID
|
15 |
-
|
16 |
|
17 |
// Be sure that the tables exist
|
18 |
if($wpdb->get_var("show tables like '$wpdb->flagpictures'") == $wpdb->prefix . 'flag_pictures') {
|
@@ -49,61 +49,54 @@ function flag_upgrade() {
|
|
49 |
|
50 |
// On some reason the import / date sometimes failed, due to the memory limit
|
51 |
if (version_compare($installed_ver, '0.32', '<')) {
|
52 |
-
echo __('Import date and time information...', '
|
53 |
flag_import_date_time();
|
54 |
-
echo __('finished', '
|
55 |
}
|
56 |
|
57 |
-
if (version_compare($installed_ver, '1.20', '<')) {
|
58 |
-
echo __('Adding new options to database...', 'flag');
|
59 |
-
$flag_options = get_option('flag_options');
|
60 |
-
// Alternative gallery colors
|
61 |
-
$flag_options['jAlterGal'] = true;
|
62 |
-
$flag_options['BarsBG'] = '292929';
|
63 |
-
$flag_options['CatBGColor'] = '292929';
|
64 |
-
$flag_options['CatBGColorOver'] = '737373';
|
65 |
-
$flag_options['CatColor'] = 'ffffff';
|
66 |
-
$flag_options['CatColorOver'] = 'ffffff';
|
67 |
-
$flag_options['ThumbBG'] = 'ffffff';
|
68 |
-
$flag_options['ThumbLoaderColor'] = '4a4a4a';
|
69 |
-
$flag_options['TitleColor'] = 'ff9900';
|
70 |
-
$flag_options['DescrColor'] = 'cfcfcf';
|
71 |
-
update_option('flag_options', $flag_options);
|
72 |
-
echo __('finished', 'flag') . "<br />\n";
|
73 |
-
}
|
74 |
-
if (version_compare($installed_ver, '1.22', '<')) {
|
75 |
-
echo __('Adding new options to database...', 'flag');
|
76 |
-
$flag_options = get_option('flag_options');
|
77 |
-
$flag_options['videoBG'] = '000000';
|
78 |
-
$flag_options['vmColor1'] = 'ffffff';
|
79 |
-
$flag_options['vmColor2'] = '3283A7';
|
80 |
-
$flag_options['vmAutoplay'] = 'true';
|
81 |
-
$flag_options['vmWidth'] = '520';
|
82 |
-
$flag_options['vmHeight'] = '304';
|
83 |
-
update_option('flag_options', $flag_options);
|
84 |
-
echo __('finished', 'flag') . "<br />\n";
|
85 |
-
}
|
86 |
-
if (version_compare($installed_ver, '1.24', '<')) {
|
87 |
-
echo __('Adding new options to database...', 'flag');
|
88 |
-
$flag_options = get_option('flag_options');
|
89 |
-
$flag_options['mpBG'] = '000000';
|
90 |
-
$flag_options['mpColor1'] = 'ffffff';
|
91 |
-
$flag_options['mpColor2'] = '3283A7';
|
92 |
-
update_option('flag_options', $flag_options);
|
93 |
-
echo __('finished', 'flag') . "<br />\n";
|
94 |
-
}
|
95 |
-
|
96 |
// v2.56 -> v2.70
|
97 |
if (version_compare($installed_ver, '2.70', '<')) {
|
98 |
flag_add_sql_column( $wpdb->flagpictures, 'link', "TEXT NULL AFTER alttext;");
|
99 |
}
|
100 |
|
101 |
// v2.72 -> v2.75
|
102 |
-
if (version_compare($installed_ver, '2.75
|
103 |
flag_add_sql_column( $wpdb->flagpictures, 'modified', "TIMESTAMP NOT NULL ON UPDATE CURRENT_TIMESTAMP AFTER imagedate;");
|
104 |
flag_add_sql_column( $wpdb->flaggallery, 'status', "TINYINT NULL DEFAULT '0' AFTER author;");
|
105 |
}
|
106 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
107 |
// update now the database
|
108 |
update_option( "flag_db_version", FLAG_DBVERSION );
|
109 |
$wpdb->hide_errors();
|
12 |
global $wpdb, $user_ID;
|
13 |
|
14 |
// get the current user ID
|
15 |
+
wp_get_current_user();
|
16 |
|
17 |
// Be sure that the tables exist
|
18 |
if($wpdb->get_var("show tables like '$wpdb->flagpictures'") == $wpdb->prefix . 'flag_pictures') {
|
49 |
|
50 |
// On some reason the import / date sometimes failed, due to the memory limit
|
51 |
if (version_compare($installed_ver, '0.32', '<')) {
|
52 |
+
echo __('Import date and time information...', 'flash-album-gallery');
|
53 |
flag_import_date_time();
|
54 |
+
echo __('finished', 'flash-album-gallery') . "<br />\n";
|
55 |
}
|
56 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
// v2.56 -> v2.70
|
58 |
if (version_compare($installed_ver, '2.70', '<')) {
|
59 |
flag_add_sql_column( $wpdb->flagpictures, 'link', "TEXT NULL AFTER alttext;");
|
60 |
}
|
61 |
|
62 |
// v2.72 -> v2.75
|
63 |
+
if (version_compare($installed_ver, '2.75', '<')) {
|
64 |
flag_add_sql_column( $wpdb->flagpictures, 'modified', "TIMESTAMP NOT NULL ON UPDATE CURRENT_TIMESTAMP AFTER imagedate;");
|
65 |
flag_add_sql_column( $wpdb->flaggallery, 'status', "TINYINT NULL DEFAULT '0' AFTER author;");
|
66 |
}
|
67 |
|
68 |
+
if (version_compare($installed_ver, '5.0', '<')) {
|
69 |
+
$flag_options = get_option('flag_options');
|
70 |
+
$flag_options['license_name'] = '';
|
71 |
+
$flag_options['flashSkin'] = 'phantom';
|
72 |
+
$flag_options['imgWidth'] = 2200;
|
73 |
+
$flag_options['imgHeight'] = 2200;
|
74 |
+
$flag_options['imgQuality'] = 87;
|
75 |
+
$flag_options['thumbWidth'] = 400;
|
76 |
+
$flag_options['thumbHeight'] = 400;
|
77 |
+
$flag_options['thumbQuality'] = 100;
|
78 |
+
|
79 |
+
if(!empty($flag_options['license_key']) && function_exists('curl_init')){
|
80 |
+
$ch = curl_init('https://mypgc.co/app/account_st.php');
|
81 |
+
curl_setopt($ch, CURLOPT_REFERER, home_url());
|
82 |
+
curl_setopt($ch, CURLOPT_POST, 1);
|
83 |
+
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
84 |
+
curl_setopt($ch, CURLOPT_POSTFIELDS, array('check_status' => $flag_options['license_key']));
|
85 |
+
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 3);
|
86 |
+
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
|
87 |
+
$status = curl_exec($ch);
|
88 |
+
curl_close($ch);
|
89 |
+
if($status === '0' || $status === ''){
|
90 |
+
$flag_options['license_key'] = '';
|
91 |
+
$flag_options['license_name'] = '';
|
92 |
+
} else{
|
93 |
+
$flag_options['license_name'] = $status;
|
94 |
+
}
|
95 |
+
}
|
96 |
+
|
97 |
+
update_option('flag_options', $flag_options);
|
98 |
+
}
|
99 |
+
|
100 |
// update now the database
|
101 |
update_option( "flag_db_version", FLAG_DBVERSION );
|
102 |
$wpdb->hide_errors();
|
admin/video-box.php
CHANGED
@@ -96,7 +96,7 @@ function flag_video_controler(){
|
|
96 |
if(isset($_POST['updateMedia'])){
|
97 |
check_admin_referer('flag_update');
|
98 |
flagGallery::flagSaveWpMedia();
|
99 |
-
flagGallery::show_message(__('Media updated', '
|
100 |
}
|
101 |
default:
|
102 |
flag_created_v_playlists();
|
@@ -117,15 +117,15 @@ function flag_created_v_playlists(){
|
|
117 |
|
118 |
?>
|
119 |
<div class="flag-wrap">
|
120 |
-
<h2><?php _e('Created playlists', '
|
121 |
<table class="widefat flag-table" cellspacing="0">
|
122 |
<thead>
|
123 |
<tr>
|
124 |
-
<th scope="col" width="25%"><?php _e('Title', '
|
125 |
-
<th scope="col" width="55%"><?php _e('Description', '
|
126 |
-
<th scope="col"><?php _e('Quantity', '
|
127 |
-
<th scope="col"><?php _e('Shortcode', '
|
128 |
-
<th scope="col"><?php _e('Action', '
|
129 |
</tr>
|
130 |
</thead>
|
131 |
<tbody>
|
@@ -146,18 +146,18 @@ function flag_created_v_playlists(){
|
|
146 |
</a>
|
147 |
</td>
|
148 |
<td><?php echo esc_html($playlist_data['description']);
|
149 |
-
echo ' (' . __("player", "
|
150 |
<td><?php echo count($query_m); ?></td>
|
151 |
<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>
|
152 |
<td>
|
153 |
-
<a href="<?php echo wp_nonce_url($filepath . '&playlist=' . $playlist_name . "&mode=delete", 'flag_delete'); ?>" class="delete" onclick="javascript:check=confirm( '<?php _e("Delete this playlist?", '
|
154 |
-
}"><?php _e('Delete', '
|
155 |
</td>
|
156 |
</tr>
|
157 |
<?php
|
158 |
}
|
159 |
} else{
|
160 |
-
echo '<tr><td colspan="5" align="center"><strong>' . __('No playlists found', '
|
161 |
}
|
162 |
?>
|
163 |
</tbody>
|
@@ -265,7 +265,7 @@ function flag_video_wp_media_lib($added = false){
|
|
265 |
// this function check for a the number of selected images, sumbmit false when no one selected
|
266 |
function checkSelected(){
|
267 |
if(!jQuery('#items_array').val()){
|
268 |
-
alert('<?php echo esc_js(__('No items selected', '
|
269 |
return false;
|
270 |
}
|
271 |
var actionId = jQuery('#bulkaction').val();
|
@@ -319,29 +319,29 @@ function flag_video_wp_media_lib($added = false){
|
|
319 |
|
320 |
<!-- import folder -->
|
321 |
<div id="importfolder">
|
322 |
-
<h2><?php _e('Import video from folder', '
|
323 |
|
324 |
<form name="importfolder" id="importfolder_form" method="POST" action="<?php echo $filepath; ?>" accept-charset="utf-8">
|
325 |
<?php wp_nonce_field('flag_addvideo'); ?>
|
326 |
<table class="form-table">
|
327 |
<tr valign="top">
|
328 |
-
<th scope="row"><?php _e('Import from Server path:', '
|
329 |
-
<td><input type="text" size="35" id="videofolder" name="videofolder" value="<?php echo $defaultpath; ?>"/><span class="browsefiles button" style="display:none"><?php _e('Browse...', "
|
330 |
|
331 |
<div id="file_browser"></div>
|
332 |
<br/>
|
333 |
<p><label><input type="checkbox" name="delete_files" value="delete"/>
|
334 |
-
<?php _e('delete files after import in WordPress Media Library', '
|
335 |
</td>
|
336 |
</tr>
|
337 |
</table>
|
338 |
-
<div class="submit"><input class="button-primary" type="submit" name="importfolder" value="<?php _e('Import folder', '
|
339 |
</form>
|
340 |
</div>
|
341 |
<?php } ?>
|
342 |
<?php } ?>
|
343 |
|
344 |
-
<h2><?php _e('WordPress Video Library', '
|
345 |
<?php
|
346 |
// look for pagination
|
347 |
if(!isset($_GET['paged']) || $_GET['paged'] < 1){
|
@@ -351,14 +351,14 @@ function flag_video_wp_media_lib($added = false){
|
|
351 |
$_GET['paged'] = intval($_GET['paged']);
|
352 |
$objects_per_page = 25;
|
353 |
$start = ($_GET['paged'] - 1) * $objects_per_page;
|
354 |
-
$img_total_count = $wpdb->get_var("SELECT COUNT(ID) FROM $wpdb->posts WHERE `post_mime_type`
|
355 |
$videolist = get_posts($args = array(
|
356 |
'numberposts' => $objects_per_page,
|
357 |
'offset' => $start,
|
358 |
'orderby' => 'ID',
|
359 |
'order' => 'DESC',
|
360 |
'post_type' => 'attachment',
|
361 |
-
'post_mime_type' => 'video
|
362 |
));
|
363 |
|
364 |
// build pagination
|
@@ -374,8 +374,8 @@ function flag_video_wp_media_lib($added = false){
|
|
374 |
?>
|
375 |
<div class="tablenav" style="overflow: hidden; height: auto;">
|
376 |
<?php if($added === false){ ?>
|
377 |
-
<div class="alignleft"><b><?php _e('Selected Media', '
|
378 |
-
<span class="clear_selected button"><?php _e('Clear Selected', '
|
379 |
<?php } ?>
|
380 |
<div class="tablenav-pages"><?php $page_links_text = sprintf('<span class="displaying-num">' . __('Displaying %s–%s of %s') . '</span>%s', number_format_i18n(($_GET['paged'] - 1) * $objects_per_page + 1), number_format_i18n(min($_GET['paged'] * $objects_per_page, $img_total_count)), number_format_i18n($img_total_count), $page_links);
|
381 |
echo $page_links_text; ?></div>
|
@@ -388,16 +388,16 @@ function flag_video_wp_media_lib($added = false){
|
|
388 |
|
389 |
<div class="actions">
|
390 |
<?php if($added === false){ ?>
|
391 |
-
<input name="updateMedia" class="button-primary" style="float: right;" type="submit" value="<?php _e('Update Media', '
|
392 |
<?php if(function_exists('json_encode')){ ?>
|
393 |
<select name="bulkaction" id="bulkaction">
|
394 |
-
<option value="no_action"><?php _e("No action", '
|
395 |
-
<option value="new_playlist"><?php _e("Create new playlist", '
|
396 |
</select>
|
397 |
-
<input name="showThickbox" class="button-secondary" type="submit" value="<?php _e('Apply', '
|
398 |
}"/>
|
399 |
<?php } ?>
|
400 |
-
<a href="<?php echo admin_url('media-new.php'); ?>" class="button"><?php _e('Upload Video', '
|
401 |
<input type="hidden" id="items_array" name="items_array" value=""/>
|
402 |
<?php } else{ ?>
|
403 |
<input type="hidden" name="mode" value="save"/>
|
@@ -406,7 +406,7 @@ function flag_video_wp_media_lib($added = false){
|
|
406 |
<input type="hidden" name="skinname" value="<?php echo sanitize_flagname($playlist['skin']); ?>"/>
|
407 |
<input type="hidden" name="skinaction" value="<?php echo sanitize_flagname($playlist['skin']); ?>"/>
|
408 |
<textarea style="display: none;" name="playlist_descr" cols="40" rows="1"><?php echo esc_html($playlist['description']); ?></textarea>
|
409 |
-
<input name="addToPlaylist" class="button-secondary" type="submit" value="<?php _e('Update Playlist', '
|
410 |
<?php } ?>
|
411 |
</div>
|
412 |
|
@@ -414,32 +414,32 @@ function flag_video_wp_media_lib($added = false){
|
|
414 |
<table class="widefat flag-table" cellspacing="0">
|
415 |
<thead>
|
416 |
<tr>
|
417 |
-
<th class="cb" width="54" scope="col"><a href="#" onclick="checkAll(document.getElementById('videolib'));return false;"><?php _e('Check', '
|
418 |
<th class="id" width="134" scope="col">
|
419 |
-
<div><?php _e('ID', '
|
420 |
</th>
|
421 |
<th class="size" width="75" scope="col">
|
422 |
-
<div><?php _e('Size', '
|
423 |
</th>
|
424 |
<th class="thumb" width="110" scope="col">
|
425 |
-
<div><?php _e('Thumbnail', '
|
426 |
</th>
|
427 |
<th class="title_filename" scope="col">
|
428 |
-
<div><?php _e('Filename / Title', '
|
429 |
</th>
|
430 |
<th class="description" scope="col">
|
431 |
-
<div><?php _e('Description', '
|
432 |
</th>
|
433 |
</tr>
|
434 |
</thead>
|
435 |
<tfoot>
|
436 |
<tr>
|
437 |
-
<th class="cb" scope="col"><a href="#" onclick="checkAll(document.getElementById('videolib'));return false;"><?php _e('Check', '
|
438 |
-
<th class="id" scope="col"><?php _e('ID', '
|
439 |
-
<th class="size" scope="col"><?php _e('Size', '
|
440 |
-
<th class="thumb" scope="col"><?php _e('Thumbnail', '
|
441 |
-
<th class="title_filename" scope="col"><?php _e('Filename / Title', '
|
442 |
-
<th class="description" scope="col"><?php _e('Description', '
|
443 |
</tr>
|
444 |
</tfoot>
|
445 |
<?php
|
@@ -455,7 +455,7 @@ function flag_video_wp_media_lib($added = false){
|
|
455 |
$ex = $checked = '';
|
456 |
if(($added !== false || !empty($items_array_default)) && in_array($flv->ID, $exclude)){
|
457 |
$class .= ' already-added';
|
458 |
-
$ex = ' title="' . __("Already Added", "
|
459 |
$checked = ' checked="checked"';
|
460 |
}
|
461 |
$thumb = $flvthumb = get_post_meta($flv->ID, 'thumbnail', true);
|
@@ -475,17 +475,17 @@ function flag_video_wp_media_lib($added = false){
|
|
475 |
if($size){
|
476 |
echo round($size / 1024 / 1024, 2) . ' Mb';
|
477 |
} else{
|
478 |
-
_e("Can't read file size. Perhaps file is broken.", '
|
479 |
}
|
480 |
?></td>
|
481 |
<td class="thumb" rowspan="2">
|
482 |
-
<a class="thickbox" title="<?php echo basename($url); ?>" href="<?php echo FLAG_URLPATH; ?>admin/
|
483 |
</td>
|
484 |
<td class="title_filename" rowspan="2">
|
485 |
<strong><a href="<?php echo $url; ?>"><?php echo basename($url); ?></a></strong><br/>
|
486 |
<textarea title="Title" name="item_a[<?php echo $flv->ID; ?>][post_title]" cols="20" rows="1" style="width:95%; height: 25px; overflow:hidden;"><?php echo esc_html(stripslashes($flv->post_title)); ?></textarea><br/>
|
487 |
-
<p><?php _e('Thumb URL:', '
|
488 |
-
<a class="thickbox" onclick="actInp=<?php echo $flv->ID; ?>" href="media-upload.php?type=image&TB_iframe=1&width=640&height=400" title="<?php _e('Add an Image', '
|
489 |
</p>
|
490 |
</td>
|
491 |
<td class="description" rowspan="2">
|
@@ -501,7 +501,7 @@ function flag_video_wp_media_lib($added = false){
|
|
501 |
<?php
|
502 |
}
|
503 |
} else{
|
504 |
-
echo '<tr><td colspan="6" align="center"><strong>' . __('No video in WordPress Media Library.', '
|
505 |
}
|
506 |
?>
|
507 |
</table>
|
@@ -518,10 +518,10 @@ function flag_video_wp_media_lib($added = false){
|
|
518 |
<input type="hidden" name="page" value="video-box"/>
|
519 |
<table width="100%" border="0" cellspacing="3" cellpadding="3">
|
520 |
<tr valign="top">
|
521 |
-
<th align="left" style="padding-top: 5px;"><?php _e('Playlist Title', '
|
522 |
<td><input type="text" class="alignleft" name="playlist_title" value=""/>
|
523 |
|
524 |
-
<div class="alignright"><strong><?php _e("Choose skin", '
|
525 |
<select id="skinname" name="skinname" style="width: 200px; height: 24px; font-size: 11px;">
|
526 |
<?php require_once(dirname(__FILE__) . '/get_skin.php');
|
527 |
$all_skins = get_skins($skin_folder = '', $type = 'v');
|
@@ -530,7 +530,7 @@ function flag_video_wp_media_lib($added = false){
|
|
530 |
echo '<option value="' . dirname($skin_file) . '">' . $skin_data['Name'] . '</option>' . "\n";
|
531 |
}
|
532 |
} else{
|
533 |
-
echo '<option value="
|
534 |
}
|
535 |
?>
|
536 |
</select>
|
@@ -538,14 +538,14 @@ function flag_video_wp_media_lib($added = false){
|
|
538 |
</td>
|
539 |
</tr>
|
540 |
<tr valign="top">
|
541 |
-
<th align="left" style="padding-top: 5px;"><?php _e('Playlist Description', '
|
542 |
<td><textarea style="width:100%;" rows="3" cols="60" name="playlist_descr"></textarea></td>
|
543 |
</tr>
|
544 |
<tr>
|
545 |
<td> </td>
|
546 |
-
<td align="right"><input class="button-secondary" type="reset" value=" <?php _e('Cancel', '
|
547 |
|
548 |
-
<input class="button-primary " type="submit" name="TB_NewPlaylist" value="<?php _e('OK', '
|
549 |
</td>
|
550 |
</tr>
|
551 |
</table>
|
96 |
if(isset($_POST['updateMedia'])){
|
97 |
check_admin_referer('flag_update');
|
98 |
flagGallery::flagSaveWpMedia();
|
99 |
+
flagGallery::show_message(__('Media updated', 'flash-album-gallery'));
|
100 |
}
|
101 |
default:
|
102 |
flag_created_v_playlists();
|
117 |
|
118 |
?>
|
119 |
<div class="flag-wrap">
|
120 |
+
<h2><?php _e('Created playlists', 'flash-album-gallery'); ?></h2>
|
121 |
<table class="widefat flag-table" cellspacing="0">
|
122 |
<thead>
|
123 |
<tr>
|
124 |
+
<th scope="col" width="25%"><?php _e('Title', 'flash-album-gallery'); ?></th>
|
125 |
+
<th scope="col" width="55%"><?php _e('Description', 'flash-album-gallery'); ?></th>
|
126 |
+
<th scope="col"><?php _e('Quantity', 'flash-album-gallery'); ?></th>
|
127 |
+
<th scope="col"><?php _e('Shortcode', 'flash-album-gallery'); ?></th>
|
128 |
+
<th scope="col"><?php _e('Action', 'flash-album-gallery'); ?></th>
|
129 |
</tr>
|
130 |
</thead>
|
131 |
<tbody>
|
146 |
</a>
|
147 |
</td>
|
148 |
<td><?php echo esc_html($playlist_data['description']);
|
149 |
+
echo ' (' . __("player", "flash-album-gallery") . ': <strong>' . esc_html($playlist_data['skin']) . '</strong>)' ?></td>
|
150 |
<td><?php echo count($query_m); ?></td>
|
151 |
<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>
|
152 |
<td>
|
153 |
+
<a href="<?php echo wp_nonce_url($filepath . '&playlist=' . $playlist_name . "&mode=delete", 'flag_delete'); ?>" class="delete" onclick="javascript:check=confirm( '<?php _e("Delete this playlist?", 'flash-album-gallery') ?>');if(check==false) {return false;
|
154 |
+
}"><?php _e('Delete', 'flash-album-gallery'); ?></a>
|
155 |
</td>
|
156 |
</tr>
|
157 |
<?php
|
158 |
}
|
159 |
} else{
|
160 |
+
echo '<tr><td colspan="5" align="center"><strong>' . __('No playlists found', 'flash-album-gallery') . '</strong></td></tr>';
|
161 |
}
|
162 |
?>
|
163 |
</tbody>
|
265 |
// this function check for a the number of selected images, sumbmit false when no one selected
|
266 |
function checkSelected(){
|
267 |
if(!jQuery('#items_array').val()){
|
268 |
+
alert('<?php echo esc_js(__('No items selected', 'flash-album-gallery')); ?>');
|
269 |
return false;
|
270 |
}
|
271 |
var actionId = jQuery('#bulkaction').val();
|
319 |
|
320 |
<!-- import folder -->
|
321 |
<div id="importfolder">
|
322 |
+
<h2><?php _e('Import video from folder', 'flash-album-gallery'); ?></h2>
|
323 |
|
324 |
<form name="importfolder" id="importfolder_form" method="POST" action="<?php echo $filepath; ?>" accept-charset="utf-8">
|
325 |
<?php wp_nonce_field('flag_addvideo'); ?>
|
326 |
<table class="form-table">
|
327 |
<tr valign="top">
|
328 |
+
<th scope="row"><?php _e('Import from Server path:', 'flash-album-gallery'); ?></th>
|
329 |
+
<td><input type="text" size="35" id="videofolder" name="videofolder" value="<?php echo $defaultpath; ?>"/><span class="browsefiles button" style="display:none"><?php _e('Browse...', "flash-album-gallery"); ?></span>
|
330 |
|
331 |
<div id="file_browser"></div>
|
332 |
<br/>
|
333 |
<p><label><input type="checkbox" name="delete_files" value="delete"/>
|
334 |
+
<?php _e('delete files after import in WordPress Media Library', 'flash-album-gallery'); ?></label></p>
|
335 |
</td>
|
336 |
</tr>
|
337 |
</table>
|
338 |
+
<div class="submit"><input class="button-primary" type="submit" name="importfolder" value="<?php _e('Import folder', 'flash-album-gallery'); ?>"/></div>
|
339 |
</form>
|
340 |
</div>
|
341 |
<?php } ?>
|
342 |
<?php } ?>
|
343 |
|
344 |
+
<h2><?php _e('WordPress Video Library', 'flash-album-gallery'); ?></h2>
|
345 |
<?php
|
346 |
// look for pagination
|
347 |
if(!isset($_GET['paged']) || $_GET['paged'] < 1){
|
351 |
$_GET['paged'] = intval($_GET['paged']);
|
352 |
$objects_per_page = 25;
|
353 |
$start = ($_GET['paged'] - 1) * $objects_per_page;
|
354 |
+
$img_total_count = $wpdb->get_var("SELECT COUNT(ID) FROM $wpdb->posts WHERE `post_mime_type` LIKE 'video/%' AND `post_type` = 'attachment' AND `post_status` = 'inherit'");
|
355 |
$videolist = get_posts($args = array(
|
356 |
'numberposts' => $objects_per_page,
|
357 |
'offset' => $start,
|
358 |
'orderby' => 'ID',
|
359 |
'order' => 'DESC',
|
360 |
'post_type' => 'attachment',
|
361 |
+
'post_mime_type' => 'video/*'
|
362 |
));
|
363 |
|
364 |
// build pagination
|
374 |
?>
|
375 |
<div class="tablenav" style="overflow: hidden; height: auto;">
|
376 |
<?php if($added === false){ ?>
|
377 |
+
<div class="alignleft"><b><?php _e('Selected Media', 'flash-album-gallery'); ?>: </b><input style="width:500px;" type="text" readonly="readonly" id="items_array" name="items_array" value="<?php echo $items_array_default; ?>"/>
|
378 |
+
<span class="clear_selected button"><?php _e('Clear Selected', 'flash-album-gallery'); ?></span></div>
|
379 |
<?php } ?>
|
380 |
<div class="tablenav-pages"><?php $page_links_text = sprintf('<span class="displaying-num">' . __('Displaying %s–%s of %s') . '</span>%s', number_format_i18n(($_GET['paged'] - 1) * $objects_per_page + 1), number_format_i18n(min($_GET['paged'] * $objects_per_page, $img_total_count)), number_format_i18n($img_total_count), $page_links);
|
381 |
echo $page_links_text; ?></div>
|
388 |
|
389 |
<div class="actions">
|
390 |
<?php if($added === false){ ?>
|
391 |
+
<input name="updateMedia" class="button-primary" style="float: right;" type="submit" value="<?php _e('Update Media', 'flash-album-gallery'); ?>"/>
|
392 |
<?php if(function_exists('json_encode')){ ?>
|
393 |
<select name="bulkaction" id="bulkaction">
|
394 |
+
<option value="no_action"><?php _e("No action", 'flash-album-gallery'); ?></option>
|
395 |
+
<option value="new_playlist"><?php _e("Create new playlist", 'flash-album-gallery'); ?></option>
|
396 |
</select>
|
397 |
+
<input name="showThickbox" class="button-secondary" type="submit" value="<?php _e('Apply', 'flash-album-gallery'); ?>" onclick="if ( !checkSelected() ) {return false;
|
398 |
}"/>
|
399 |
<?php } ?>
|
400 |
+
<a href="<?php echo admin_url('media-new.php'); ?>" class="button" style="display: inline-block; margin: 0;"><?php _e('Upload Video', 'flash-album-gallery'); ?></a>
|
401 |
<input type="hidden" id="items_array" name="items_array" value=""/>
|
402 |
<?php } else{ ?>
|
403 |
<input type="hidden" name="mode" value="save"/>
|
406 |
<input type="hidden" name="skinname" value="<?php echo sanitize_flagname($playlist['skin']); ?>"/>
|
407 |
<input type="hidden" name="skinaction" value="<?php echo sanitize_flagname($playlist['skin']); ?>"/>
|
408 |
<textarea style="display: none;" name="playlist_descr" cols="40" rows="1"><?php echo esc_html($playlist['description']); ?></textarea>
|
409 |
+
<input name="addToPlaylist" class="button-secondary" type="submit" value="<?php _e('Update Playlist', 'flash-album-gallery'); ?>"/>
|
410 |
<?php } ?>
|
411 |
</div>
|
412 |
|
414 |
<table class="widefat flag-table" cellspacing="0">
|
415 |
<thead>
|
416 |
<tr>
|
417 |
+
<th class="cb" width="54" scope="col"><a href="#" onclick="checkAll(document.getElementById('videolib'));return false;"><?php _e('Check', 'flash-album-gallery'); ?></a></th>
|
418 |
<th class="id" width="134" scope="col">
|
419 |
+
<div><?php _e('ID', 'flash-album-gallery'); ?></div>
|
420 |
</th>
|
421 |
<th class="size" width="75" scope="col">
|
422 |
+
<div><?php _e('Size', 'flash-album-gallery'); ?></div>
|
423 |
</th>
|
424 |
<th class="thumb" width="110" scope="col">
|
425 |
+
<div><?php _e('Thumbnail', 'flash-album-gallery'); ?></div>
|
426 |
</th>
|
427 |
<th class="title_filename" scope="col">
|
428 |
+
<div><?php _e('Filename / Title', 'flash-album-gallery'); ?></div>
|
429 |
</th>
|
430 |
<th class="description" scope="col">
|
431 |
+
<div><?php _e('Description', 'flash-album-gallery'); ?></div>
|
432 |
</th>
|
433 |
</tr>
|
434 |
</thead>
|
435 |
<tfoot>
|
436 |
<tr>
|
437 |
+
<th class="cb" scope="col"><a href="#" onclick="checkAll(document.getElementById('videolib'));return false;"><?php _e('Check', 'flash-album-gallery'); ?></a></th>
|
438 |
+
<th class="id" scope="col"><?php _e('ID', 'flash-album-gallery'); ?></th>
|
439 |
+
<th class="size" scope="col"><?php _e('Size', 'flash-album-gallery'); ?></th>
|
440 |
+
<th class="thumb" scope="col"><?php _e('Thumbnail', 'flash-album-gallery'); ?></th>
|
441 |
+
<th class="title_filename" scope="col"><?php _e('Filename / Title', 'flash-album-gallery'); ?></th>
|
442 |
+
<th class="description" scope="col"><?php _e('Description', 'flash-album-gallery'); ?></th>
|
443 |
</tr>
|
444 |
</tfoot>
|
445 |
<?php
|
455 |
$ex = $checked = '';
|
456 |
if(($added !== false || !empty($items_array_default)) && in_array($flv->ID, $exclude)){
|
457 |
$class .= ' already-added';
|
458 |
+
$ex = ' title="' . __("Already Added", "flash-album-gallery") . '"';
|
459 |
$checked = ' checked="checked"';
|
460 |
}
|
461 |
$thumb = $flvthumb = get_post_meta($flv->ID, 'thumbnail', true);
|
475 |
if($size){
|
476 |
echo round($size / 1024 / 1024, 2) . ' Mb';
|
477 |
} else{
|
478 |
+
_e("Can't read file size. Perhaps file is broken.", 'flash-album-gallery');
|
479 |
}
|
480 |
?></td>
|
481 |
<td class="thumb" rowspan="2">
|
482 |
+
<a class="thickbox" title="<?php echo basename($url); ?>" href="<?php echo FLAG_URLPATH; ?>admin/video_preview.php?vid=<?php echo $flv->ID; ?>&TB_iframe=1&width=490&height=293"><img id="thumb-<?php echo $flv->ID; ?>" src="<?php echo esc_url($thumb); ?>" style="width:auto; height:auto; max-width:100px; max-height:100px;" alt=""/></a>
|
483 |
</td>
|
484 |
<td class="title_filename" rowspan="2">
|
485 |
<strong><a href="<?php echo $url; ?>"><?php echo basename($url); ?></a></strong><br/>
|
486 |
<textarea title="Title" name="item_a[<?php echo $flv->ID; ?>][post_title]" cols="20" rows="1" style="width:95%; height: 25px; overflow:hidden;"><?php echo esc_html(stripslashes($flv->post_title)); ?></textarea><br/>
|
487 |
+
<p><?php _e('Thumb URL:', 'flash-album-gallery'); ?> <input id="flvthumb-<?php echo $flv->ID; ?>" name="item_a[<?php echo $flv->ID; ?>][post_thumb]" type="text" value="<?php echo esc_url($flvthumb); ?>"/>
|
488 |
+
<a class="thickbox" onclick="actInp=<?php echo $flv->ID; ?>" href="media-upload.php?type=image&TB_iframe=1&width=640&height=400" title="<?php _e('Add an Image', 'flash-album-gallery'); ?>"><?php _e('assist', 'flash-album-gallery'); ?></a>
|
489 |
</p>
|
490 |
</td>
|
491 |
<td class="description" rowspan="2">
|
501 |
<?php
|
502 |
}
|
503 |
} else{
|
504 |
+
echo '<tr><td colspan="6" align="center"><strong>' . __('No video in WordPress Media Library.', 'flash-album-gallery') . '</strong></td></tr>';
|
505 |
}
|
506 |
?>
|
507 |
</table>
|
518 |
<input type="hidden" name="page" value="video-box"/>
|
519 |
<table width="100%" border="0" cellspacing="3" cellpadding="3">
|
520 |
<tr valign="top">
|
521 |
+
<th align="left" style="padding-top: 5px;"><?php _e('Playlist Title', 'flash-album-gallery'); ?></th>
|
522 |
<td><input type="text" class="alignleft" name="playlist_title" value=""/>
|
523 |
|
524 |
+
<div class="alignright"><strong><?php _e("Choose skin", 'flash-album-gallery'); ?>:</strong>
|
525 |
<select id="skinname" name="skinname" style="width: 200px; height: 24px; font-size: 11px;">
|
526 |
<?php require_once(dirname(__FILE__) . '/get_skin.php');
|
527 |
$all_skins = get_skins($skin_folder = '', $type = 'v');
|
530 |
echo '<option value="' . dirname($skin_file) . '">' . $skin_data['Name'] . '</option>' . "\n";
|
531 |
}
|
532 |
} else{
|
533 |
+
echo '<option value="wp-videoplayer">' . __("No Skins", "flash-album-gallery") . '</option>';
|
534 |
}
|
535 |
?>
|
536 |
</select>
|
538 |
</td>
|
539 |
</tr>
|
540 |
<tr valign="top">
|
541 |
+
<th align="left" style="padding-top: 5px;"><?php _e('Playlist Description', 'flash-album-gallery'); ?></th>
|
542 |
<td><textarea style="width:100%;" rows="3" cols="60" name="playlist_descr"></textarea></td>
|
543 |
</tr>
|
544 |
<tr>
|
545 |
<td> </td>
|
546 |
+
<td align="right"><input class="button-secondary" type="reset" value=" <?php _e('Cancel', 'flash-album-gallery'); ?> " onclick="tb_remove()"/>
|
547 |
|
548 |
+
<input class="button-primary " type="submit" name="TB_NewPlaylist" value="<?php _e('OK', 'flash-album-gallery'); ?>"/>
|
549 |
</td>
|
550 |
</tr>
|
551 |
</table>
|
admin/video-sort.php
CHANGED
@@ -20,15 +20,15 @@ function flag_v_playlist_order($playlist = 'deprecated'){
|
|
20 |
<script type="text/javascript" src="<?php echo FLAG_URLPATH; ?>admin/js/jquery.tablednd_0_5.js"></script>
|
21 |
<script type="text/javascript" src="<?php echo FLAG_URLPATH; ?>admin/js/jquery.tablesorter.js"></script>
|
22 |
<div class="flag-wrap">
|
23 |
-
<h2><?php _e('Sort Gallery', '
|
24 |
|
25 |
<div class="alignright tablenav" style="margin-bottom: -36px;">
|
26 |
-
<a href="<?php echo esc_url($base_url."&playlist=".$filename.'&mode=edit'); ?>" class="button-secondary action"><?php _e('Back to playlist', '
|
27 |
</div>
|
28 |
<form id="sortPlaylist" method="POST" action="<?php echo esc_url($base_url."&playlist=".$filename.'&mode=edit'); ?>" accept-charset="utf-8">
|
29 |
<div class="alignleft tablenav">
|
30 |
<?php wp_nonce_field('flag_update'); ?>
|
31 |
-
<input class="button-primary action" type="submit" name="updatePlaylist" value="<?php _e('Update Sort Order', '
|
32 |
</div>
|
33 |
<br clear="all" />
|
34 |
<input type="hidden" name="playlist_title" value="<?php echo esc_html($playlist['title']); ?>" />
|
@@ -68,18 +68,18 @@ jQuery(document).ready(function($) {
|
|
68 |
|
69 |
<thead>
|
70 |
<tr>
|
71 |
-
<th class="header" width="54"><p style="margin-right:-10px;"><?php _e('ID', '
|
72 |
-
<th width="260"><p><?php _e('Play', '
|
73 |
-
<th class="header"><p><?php _e('Filename', '
|
74 |
-
<th class="header"><p><?php _e('Title', '
|
75 |
</tr>
|
76 |
</thead>
|
77 |
<tfoot>
|
78 |
<tr>
|
79 |
-
<th><p><?php _e('ID', '
|
80 |
-
<th><p><?php _e('Play', '
|
81 |
-
<th><p><?php _e('Filename', '
|
82 |
-
<th><p><?php _e('Title', '
|
83 |
</tr>
|
84 |
</tfoot>
|
85 |
<tbody id="listitems">
|
@@ -99,19 +99,19 @@ if(count($items_a)) {
|
|
99 |
?>
|
100 |
<tr id="$flv-<?php echo $flv->ID; ?>" class="<?php echo $alternate; ?> iedit" valign="top">
|
101 |
<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>
|
102 |
-
<td width="50"><a class="thickbox" title="<?php echo basename($url); ?>" href="<?php echo FLAG_URLPATH; ?>admin/
|
103 |
<td><?php echo basename($url); ?></td>
|
104 |
<td><?php echo esc_html(stripslashes($flv->post_title)); ?></td>
|
105 |
</tr>
|
106 |
<?php
|
107 |
}
|
108 |
} else {
|
109 |
-
echo '<tr><td colspan="4" align="center"><strong>'.__('No entries found','
|
110 |
}
|
111 |
?>
|
112 |
</tbody>
|
113 |
</table>
|
114 |
-
<p class="actions"><input type="submit" class="button-primary action" name="updatePlaylist" value="<?php _e('Update Sort Order', '
|
115 |
</form>
|
116 |
<br class="clear"/>
|
117 |
</div><!-- /#wrap -->
|
20 |
<script type="text/javascript" src="<?php echo FLAG_URLPATH; ?>admin/js/jquery.tablednd_0_5.js"></script>
|
21 |
<script type="text/javascript" src="<?php echo FLAG_URLPATH; ?>admin/js/jquery.tablesorter.js"></script>
|
22 |
<div class="flag-wrap">
|
23 |
+
<h2><?php _e('Sort Gallery', 'flash-album-gallery'); ?></h2>
|
24 |
|
25 |
<div class="alignright tablenav" style="margin-bottom: -36px;">
|
26 |
+
<a href="<?php echo esc_url($base_url."&playlist=".$filename.'&mode=edit'); ?>" class="button-secondary action"><?php _e('Back to playlist', 'flash-album-gallery'); ?></a>
|
27 |
</div>
|
28 |
<form id="sortPlaylist" method="POST" action="<?php echo esc_url($base_url."&playlist=".$filename.'&mode=edit'); ?>" accept-charset="utf-8">
|
29 |
<div class="alignleft tablenav">
|
30 |
<?php wp_nonce_field('flag_update'); ?>
|
31 |
+
<input class="button-primary action" type="submit" name="updatePlaylist" value="<?php _e('Update Sort Order', 'flash-album-gallery'); ?>" />
|
32 |
</div>
|
33 |
<br clear="all" />
|
34 |
<input type="hidden" name="playlist_title" value="<?php echo esc_html($playlist['title']); ?>" />
|
68 |
|
69 |
<thead>
|
70 |
<tr>
|
71 |
+
<th class="header" width="54"><p style="margin-right:-10px;"><?php _e('ID', 'flash-album-gallery'); ?></p></th>
|
72 |
+
<th width="260"><p><?php _e('Play', 'flash-album-gallery'); ?></p></th>
|
73 |
+
<th class="header"><p><?php _e('Filename', 'flash-album-gallery'); ?></p></th>
|
74 |
+
<th class="header"><p><?php _e('Title', 'flash-album-gallery'); ?></p></th>
|
75 |
</tr>
|
76 |
</thead>
|
77 |
<tfoot>
|
78 |
<tr>
|
79 |
+
<th><p><?php _e('ID', 'flash-album-gallery'); ?></p></th>
|
80 |
+
<th><p><?php _e('Play', 'flash-album-gallery'); ?></p></th>
|
81 |
+
<th><p><?php _e('Filename', 'flash-album-gallery'); ?></p></th>
|
82 |
+
<th><p><?php _e('Title', 'flash-album-gallery'); ?></p></th>
|
83 |
</tr>
|
84 |
</tfoot>
|
85 |
<tbody id="listitems">
|
99 |
?>
|
100 |
<tr id="$flv-<?php echo $flv->ID; ?>" class="<?php echo $alternate; ?> iedit" valign="top">
|
101 |
<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>
|
102 |
+
<td width="50"><a class="thickbox" title="<?php echo basename($url); ?>" href="<?php echo FLAG_URLPATH; ?>admin/video_preview.php?vid=<?php echo $flv->ID; ?>&TB_iframe=1&width=490&height=293"><img id="thumb-<?php echo $flv->ID; ?>" src="<?php echo esc_url($thumb); ?>" width="20" height="20" alt="" /></a></td>
|
103 |
<td><?php echo basename($url); ?></td>
|
104 |
<td><?php echo esc_html(stripslashes($flv->post_title)); ?></td>
|
105 |
</tr>
|
106 |
<?php
|
107 |
}
|
108 |
} else {
|
109 |
+
echo '<tr><td colspan="4" align="center"><strong>'.__('No entries found','flash-album-gallery').'</strong></td></tr>';
|
110 |
}
|
111 |
?>
|
112 |
</tbody>
|
113 |
</table>
|
114 |
+
<p class="actions"><input type="submit" class="button-primary action" name="updatePlaylist" value="<?php _e('Update Sort Order', 'flash-album-gallery'); ?>" /></p>
|
115 |
</form>
|
116 |
<br class="clear"/>
|
117 |
</div><!-- /#wrap -->
|
admin/video.functions.php
CHANGED
@@ -1,158 +1,196 @@
|
|
1 |
<?php
|
2 |
-
if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF']))
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
|
|
|
|
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 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
}
|
61 |
|
62 |
-
function flagSave_vPlaylist($title
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
$
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
101 |
<properties>
|
102 |
-
<title><![CDATA['
|
103 |
-
<description><![CDATA['
|
104 |
-
<skin><![CDATA['
|
105 |
</properties>
|
106 |
<items>';
|
107 |
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
<item id="'
|
114 |
-
<track>'.wp_get_attachment_url($flv->ID).'</track>
|
115 |
-
<title><![CDATA['
|
116 |
-
<description><![CDATA['
|
117 |
-
<thumbnail>'
|
118 |
</item>';
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
</items>
|
123 |
</category>
|
124 |
</gallery>';
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
}
|
136 |
|
137 |
-
function flagSave_vPlaylistSkin($file)
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
}
|
148 |
|
149 |
-
function flag_v_playlist_delete($playlist)
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
}
|
1 |
<?php
|
2 |
+
if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])){
|
3 |
+
die('You are not allowed to call this page directly.');
|
4 |
+
}
|
5 |
+
|
6 |
+
function get_v_playlist_data($playlist_file){
|
7 |
+
|
8 |
+
$playlist_content = file_get_contents($playlist_file);
|
9 |
+
|
10 |
+
$playlist_data['settings'] = flagGallery::flagGetBetween($playlist_content, '<settings><![CDATA[', ']]></settings>');
|
11 |
+
$playlist_data['title'] = flagGallery::flagGetBetween($playlist_content, '<title><![CDATA[', ']]></title>');
|
12 |
+
$playlist_data['skin'] = flagGallery::flagGetBetween($playlist_content, '<skin><![CDATA[', ']]></skin>');
|
13 |
+
$playlist_data['description'] = flagGallery::flagGetBetween($playlist_content, '<description><![CDATA[', ']]></description>');
|
14 |
+
preg_match_all('|<item id="(.*)">|', $playlist_content, $items);
|
15 |
+
$playlist_data['items'] = $items[1];
|
16 |
+
|
17 |
+
return $playlist_data;
|
18 |
}
|
19 |
|
20 |
/**
|
21 |
* Check the playlists directory and retrieve all playlist files with playlist data.
|
22 |
*
|
23 |
*/
|
24 |
+
function get_v_playlists($playlist_folder = ''){
|
25 |
+
|
26 |
+
$flag_options = get_option('flag_options');
|
27 |
+
$flag_playlists = array();
|
28 |
+
$playlist_root = ABSPATH . $flag_options['galleryPath'] . 'playlists/video';
|
29 |
+
if( !empty($playlist_folder)){
|
30 |
+
$playlist_root = $playlist_folder;
|
31 |
+
}
|
32 |
+
|
33 |
+
// Files in flagallery/playlists directory
|
34 |
+
$playlists_dir = @ opendir($playlist_root);
|
35 |
+
$playlist_files = array();
|
36 |
+
if($playlists_dir){
|
37 |
+
while(($file = readdir($playlists_dir)) !== false){
|
38 |
+
if(substr($file, 0, 1) == '.'){
|
39 |
+
continue;
|
40 |
+
}
|
41 |
+
if(substr($file, - 4) == '.xml'){
|
42 |
+
$playlist_files[] = $file;
|
43 |
+
}
|
44 |
+
}
|
45 |
+
}
|
46 |
+
@closedir($playlists_dir);
|
47 |
+
|
48 |
+
if( !$playlists_dir || empty($playlist_files)){
|
49 |
+
return $flag_playlists;
|
50 |
+
}
|
51 |
+
|
52 |
+
foreach($playlist_files as $playlist_file){
|
53 |
+
if( !is_readable("$playlist_root/$playlist_file")){
|
54 |
+
continue;
|
55 |
+
}
|
56 |
+
|
57 |
+
$playlist_data = get_v_playlist_data("$playlist_root/$playlist_file");
|
58 |
+
|
59 |
+
if(empty ($playlist_data['title'])){
|
60 |
+
continue;
|
61 |
+
}
|
62 |
+
|
63 |
+
$flag_playlists[ basename($playlist_file, ".xml") ] = $playlist_data;
|
64 |
+
}
|
65 |
+
uasort($flag_playlists, create_function('$a, $b', 'return strnatcasecmp( $a["title"], $b["title"] );'));
|
66 |
+
|
67 |
+
return $flag_playlists;
|
68 |
}
|
69 |
|
70 |
+
function flagSave_vPlaylist($title, $descr, $data, $file = '', $skinaction = ''){
|
71 |
+
|
72 |
+
if( !trim($title)){
|
73 |
+
$title = 'default';
|
74 |
+
}
|
75 |
+
$title = htmlspecialchars_decode(stripslashes($title), ENT_QUOTES);
|
76 |
+
$descr = htmlspecialchars_decode(stripslashes($descr), ENT_QUOTES);
|
77 |
+
if( !$file){
|
78 |
+
$file = sanitize_flagname($title);
|
79 |
+
}
|
80 |
+
|
81 |
+
if( !is_array($data)){
|
82 |
+
$data = explode(',', $data);
|
83 |
+
}
|
84 |
+
|
85 |
+
$flag_options = get_option('flag_options');
|
86 |
+
$skin = isset($_POST['skinname'])? sanitize_flagname($_POST['skinname']) : 'wp-videoplayer';
|
87 |
+
if(empty($skinaction)){
|
88 |
+
$skinaction = isset($_POST['skinaction'])? sanitize_key($_POST['skinaction']) : 'update';
|
89 |
+
}
|
90 |
+
$skinpath = str_replace("\\","/", WP_PLUGIN_DIR ).'/flagallery-skins/'.$skin;
|
91 |
+
if(!is_dir($skinpath)) {
|
92 |
+
$skinpath = str_replace("\\","/", WP_PLUGIN_DIR ).'/flash-album-gallery/skins/'.$skin;
|
93 |
+
if(!is_dir($skinpath)) {
|
94 |
+
$skin = 'wp-videoplayer';
|
95 |
+
$skinpath = str_replace("\\","/", WP_PLUGIN_DIR ).'/flagallery-skins/'.$skin;
|
96 |
+
if(!is_dir($skinpath)) {
|
97 |
+
$skinpath = str_replace("\\","/", WP_PLUGIN_DIR ).'/flash-album-gallery/skins/'.$skin;
|
98 |
+
}
|
99 |
+
}
|
100 |
+
}
|
101 |
+
$playlistPath = ABSPATH . $flag_options['galleryPath'] . 'playlists/video/' . $file . '.xml';
|
102 |
+
|
103 |
+
if(file_exists($skinpath . "/settings.php")){
|
104 |
+
/**
|
105 |
+
* @var $default_options
|
106 |
+
*/
|
107 |
+
include($skinpath . "/settings.php");
|
108 |
+
} else{
|
109 |
+
flagGallery::show_message(__("Can't find skin settings", 'flash-album-gallery'));
|
110 |
+
|
111 |
+
return;
|
112 |
+
}
|
113 |
+
|
114 |
+
$arr_xml_settings = array();
|
115 |
+
$settings = array();
|
116 |
+
if(file_exists($playlistPath)){
|
117 |
+
$playlist = file_get_contents($playlistPath);
|
118 |
+
$xml_settings = flagGallery::flagGetBetween($playlist, '<settings><![CDATA[', ']]></settings>');
|
119 |
+
if($xml_settings){
|
120 |
+
$arr_xml_settings = json_decode($xml_settings);
|
121 |
+
if(!empty($arr_xml_settings)){
|
122 |
+
$settings = array_replace_recursive((array)$arr_xml_settings, $settings);
|
123 |
+
}
|
124 |
+
}
|
125 |
+
}
|
126 |
+
if(empty($settings) || ($skin !== $skinaction)){
|
127 |
+
$settings = $default_options;
|
128 |
+
if(isset($flag_options["{$skin}_options"])){
|
129 |
+
$db_skin_options = maybe_unserialize( $flag_options["{$skin}_options"] );
|
130 |
+
$settings = array_replace_recursive( $settings, $db_skin_options );
|
131 |
+
}
|
132 |
+
}
|
133 |
+
$properties = json_encode($settings);
|
134 |
+
|
135 |
+
if(count($data)){
|
136 |
+
$content = '<gallery>
|
137 |
+
<settings><![CDATA[' . $properties . ']]></settings>
|
138 |
+
<category id="' . $file . '">
|
139 |
<properties>
|
140 |
+
<title><![CDATA[' . $title . ']]></title>
|
141 |
+
<description><![CDATA[' . $descr . ']]></description>
|
142 |
+
<skin><![CDATA[' . $skin . ']]></skin>
|
143 |
</properties>
|
144 |
<items>';
|
145 |
|
146 |
+
foreach((array) $data as $id){
|
147 |
+
$flv = get_post($id);
|
148 |
+
if($flv->ID){
|
149 |
+
$thumb = get_post_meta($id, 'thumbnail', true);
|
150 |
+
$content .= '
|
151 |
+
<item id="' . $flv->ID . '">
|
152 |
+
<track>' . wp_get_attachment_url($flv->ID) . '</track>
|
153 |
+
<title><![CDATA[' . $flv->post_title . ']]></title>
|
154 |
+
<description><![CDATA[' . $flv->post_content . ']]></description>
|
155 |
+
<thumbnail>' . $thumb . '</thumbnail>
|
156 |
</item>';
|
157 |
+
}
|
158 |
+
}
|
159 |
+
$content .= '
|
160 |
</items>
|
161 |
</category>
|
162 |
</gallery>';
|
163 |
+
// Save options
|
164 |
+
$flag_options = get_option('flag_options');
|
165 |
+
if(wp_mkdir_p(ABSPATH . $flag_options['galleryPath'] . 'playlists/video/')){
|
166 |
+
if(flagGallery::saveFile($playlistPath, $content, 'w')){
|
167 |
+
flagGallery::show_message(__('Playlist Saved Successfully', 'flash-album-gallery'));
|
168 |
+
}
|
169 |
+
} else{
|
170 |
+
flagGallery::show_message(__('Create directory please:', 'flash-album-gallery') . '"/' . $flag_options['galleryPath'] . 'playlists/video/"');
|
171 |
+
}
|
172 |
+
}
|
173 |
}
|
174 |
|
175 |
+
function flagSave_vPlaylistSkin($file){
|
176 |
+
$file = sanitize_flagname($file);
|
177 |
+
$flag_options = get_option('flag_options');
|
178 |
+
$playlistPath = ABSPATH . $flag_options['galleryPath'] . 'playlists/video/' . $file . '.xml';
|
179 |
+
// Save options
|
180 |
+
$title = esc_html($_POST['playlist_title']);
|
181 |
+
$descr = esc_html($_POST['playlist_descr']);
|
182 |
+
$items = get_v_playlist_data($playlistPath);
|
183 |
+
$data = $items['items'];
|
184 |
+
flagSave_vPlaylist($title, $descr, $data, $file, $skinaction = 'update');
|
185 |
}
|
186 |
|
187 |
+
function flag_v_playlist_delete($playlist){
|
188 |
+
$playlist = sanitize_flagname($playlist);
|
189 |
+
$flag_options = get_option('flag_options');
|
190 |
+
$playlistXML = ABSPATH . $flag_options['galleryPath'] . 'playlists/video/' . $playlist . '.xml';
|
191 |
+
if(file_exists($playlistXML)){
|
192 |
+
if(unlink($playlistXML)){
|
193 |
+
flagGallery::show_message("'" . $playlist . ".xml' " . __('deleted', 'flash-album-gallery'));
|
194 |
+
}
|
195 |
+
}
|
196 |
}
|
admin/{flv_preview.php → video_preview.php}
RENAMED
@@ -11,7 +11,6 @@ if ( !current_user_can('FlAG Manage video') )
|
|
11 |
<head>
|
12 |
<title>Preview Video</title>
|
13 |
<script type="text/javascript" src="<?php echo plugins_url('/'.FLAGFOLDER.'/'); ?>admin/js/jquery.js"></script>
|
14 |
-
<script type="text/javascript" src="<?php echo plugins_url('/'.FLAGFOLDER.'/'); ?>admin/js/swfobject.js"></script>
|
15 |
</head>
|
16 |
<body style="margin: 0; padding: 0; background: #555555; overflow: hidden;">
|
17 |
<?php $vidID = intval($_GET['vid']);
|
11 |
<head>
|
12 |
<title>Preview Video</title>
|
13 |
<script type="text/javascript" src="<?php echo plugins_url('/'.FLAGFOLDER.'/'); ?>admin/js/jquery.js"></script>
|
|
|
14 |
</head>
|
15 |
<body style="margin: 0; padding: 0; background: #555555; overflow: hidden;">
|
16 |
<?php $vidID = intval($_GET['vid']);
|
admin/wpmu.php
CHANGED
@@ -26,7 +26,7 @@ if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You
|
|
26 |
}
|
27 |
|
28 |
update_site_option('flag_options', $flag_options);
|
29 |
-
$messagetext = __('Update successfully','
|
30 |
}
|
31 |
|
32 |
// message windows
|
@@ -35,26 +35,26 @@ if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You
|
|
35 |
?>
|
36 |
|
37 |
<div class="wrap">
|
38 |
-
<h2><?php _e('General WordPress MU Settings','
|
39 |
<form name="generaloptions" method="post">
|
40 |
<?php wp_nonce_field('flag_wpmu_settings'); ?>
|
41 |
<input type="hidden" name="page_options" value="gallerypath,wpmuQuotaCheck,wpmuRoles" />
|
42 |
<table class="form-table">
|
43 |
<tr valign="top">
|
44 |
-
<th align="left"><?php _e('Gallery path','
|
45 |
-
<td><input type="text" size="50" name="gallerypath" value="<?php echo $flag_options[gallerypath]; ?>" title="TEST" /><br />
|
46 |
-
<?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 /.','
|
47 |
</tr>
|
48 |
<tr>
|
49 |
-
<th valign="top"><?php _e('Enable upload quota check','
|
50 |
-
<td><input name="wpmuQuotaCheck" type="checkbox" value="1" <?php checked('1', $flag_options[wpmuQuotaCheck]); ?> />
|
51 |
-
<?php _e('Should work if the gallery is bellow the blog.dir','
|
52 |
</td>
|
53 |
</tr>
|
54 |
<tr>
|
55 |
-
<th valign="top"><?php _e('Enable roles/capabilities','
|
56 |
-
<td><input name="wpmuRoles" type="checkbox" value="1" <?php checked('1', $flag_options[wpmuRoles]); ?> />
|
57 |
-
<?php _e('Allow users to change the roles for other blog authors.','
|
58 |
</td>
|
59 |
</tr>
|
60 |
</table>
|
26 |
}
|
27 |
|
28 |
update_site_option('flag_options', $flag_options);
|
29 |
+
$messagetext = __('Update successfully','flash-album-gallery');
|
30 |
}
|
31 |
|
32 |
// message windows
|
35 |
?>
|
36 |
|
37 |
<div class="wrap">
|
38 |
+
<h2><?php _e('General WordPress MU Settings','flash-album-gallery'); ?></h2>
|
39 |
<form name="generaloptions" method="post">
|
40 |
<?php wp_nonce_field('flag_wpmu_settings'); ?>
|
41 |
<input type="hidden" name="page_options" value="gallerypath,wpmuQuotaCheck,wpmuRoles" />
|
42 |
<table class="form-table">
|
43 |
<tr valign="top">
|
44 |
+
<th align="left"><?php _e('Gallery path','flash-album-gallery'); ?></th>
|
45 |
+
<td><input type="text" size="50" name="gallerypath" value="<?php echo $flag_options['gallerypath']; ?>" title="TEST" /><br />
|
46 |
+
<?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 /.','flash-album-gallery'); ?></td>
|
47 |
</tr>
|
48 |
<tr>
|
49 |
+
<th valign="top"><?php _e('Enable upload quota check','flash-album-gallery'); ?>:</th>
|
50 |
+
<td><input name="wpmuQuotaCheck" type="checkbox" value="1" <?php checked('1', $flag_options['wpmuQuotaCheck']); ?> />
|
51 |
+
<?php _e('Should work if the gallery is bellow the blog.dir','flash-album-gallery'); ?>
|
52 |
</td>
|
53 |
</tr>
|
54 |
<tr>
|
55 |
+
<th valign="top"><?php _e('Enable roles/capabilities','flash-album-gallery'); ?>:</th>
|
56 |
+
<td><input name="wpmuRoles" type="checkbox" value="1" <?php checked('1', $flag_options['wpmuRoles']); ?> />
|
57 |
+
<?php _e('Allow users to change the roles for other blog authors.','flash-album-gallery'); ?>
|
58 |
</td>
|
59 |
</tr>
|
60 |
</table>
|
assets/fancybox/images/blank.gif
ADDED
Binary file
|
assets/fancybox/images/fancy_close.png
ADDED
Binary file
|
assets/fancybox/images/fancy_loading.png
ADDED
Binary file
|
assets/fancybox/images/fancy_nav_left.png
ADDED
Binary file
|
assets/fancybox/images/fancy_nav_right.png
ADDED
Binary file
|
assets/fancybox/images/fancy_nav_slide.png
ADDED
Binary file
|
{admin/js → assets/fancybox}/images/fancy_shadow_e.png
RENAMED
File without changes
|
assets/fancybox/images/fancy_shadow_n.png
ADDED
Binary file
|
{admin/js → assets/fancybox}/images/fancy_shadow_ne.png
RENAMED
File without changes
|
{admin/js → assets/fancybox}/images/fancy_shadow_nw.png
RENAMED
File without changes
|
assets/fancybox/images/fancy_shadow_s.png
ADDED
Binary file
|
{admin/js → assets/fancybox}/images/fancy_shadow_se.png
RENAMED
File without changes
|
{admin/js → assets/fancybox}/images/fancy_shadow_sw.png
RENAMED
File without changes
|
assets/fancybox/images/fancy_shadow_w.png
ADDED
Binary file
|
{admin/js → assets/fancybox}/images/fancy_title_left.png
RENAMED
File without changes
|
{admin/js → assets/fancybox}/images/fancy_title_main.png
RENAMED
File without changes
|
assets/fancybox/images/fancy_title_over.png
ADDED
Binary file
|
{admin/js → assets/fancybox}/images/fancy_title_right.png
RENAMED
File without changes
|
{admin/js → assets/fancybox}/images/fancybox-x.png
RENAMED
File without changes
|
assets/fancybox/images/fancybox-y.png
ADDED
Binary file
|
{admin/js → assets/fancybox}/images/fancybox.png
RENAMED
File without changes
|
{admin/js → assets/fancybox}/jquery.fancybox-1.3.4.css
RENAMED
File without changes
|
assets/fancybox/jquery.fancybox-1.3.4.pack.js
ADDED
@@ -0,0 +1 @@
|
|
|
|
0 |
* FancyBox - jQuery Plugin
|
1 |
* Simple and fancy lightbox alternative
|
2 |
*
|
3 |
* Examples and documentation at: http://fancybox.net
|
4 |
*
|
5 |
* Copyright (c) 2008 - 2010 Janis Skarnelis
|
6 |
* 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.
|
7 |
*
|
8 |
* Version: 1.3.4 (11/11/2010)
|
9 |
* Requires: jQuery v1.3+
|
10 |
*
|
11 |
* Dual licensed under the MIT and GPL licenses:
|
12 |
* http://www.opensource.org/licenses/mit-license.php
|
13 |
* http://www.gnu.org/licenses/gpl.html
|
14 |
*/
|
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 |
*/
|
assets/flagallery.css
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
** FlaGallery StyleSheet
|
3 |
+
*/
|
4 |
+
.flashalbum { overflow:hidden; position:relative;}
|
assets/jplayer/jquery.jplayer.min.js
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
/*! jPlayer 2.9.2 for jQuery ~ (c) 2009-2014 Happyworm Ltd ~ MIT License */
|
2 |
+
!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],b):b("object"==typeof exports?require("jquery"):a.jQuery?a.jQuery:a.Zepto)}(this,function(a,b){a.fn.jPlayer=function(c){var d="jPlayer",e="string"==typeof c,f=Array.prototype.slice.call(arguments,1),g=this;return c=!e&&f.length?a.extend.apply(null,[!0,c].concat(f)):c,e&&"_"===c.charAt(0)?g:(this.each(e?function(){var e=a(this).data(d),h=e&&a.isFunction(e[c])?e[c].apply(e,f):e;return h!==e&&h!==b?(g=h,!1):void 0}:function(){var b=a(this).data(d);b?b.option(c||{}):a(this).data(d,new a.jPlayer(c,this))}),g)},a.jPlayer=function(b,c){if(arguments.length){this.element=a(c),this.options=a.extend(!0,{},this.options,b);var d=this;this.element.bind("remove.jPlayer",function(){d.destroy()}),this._init()}},"function"!=typeof a.fn.stop&&(a.fn.stop=function(){}),a.jPlayer.emulateMethods="load play pause",a.jPlayer.emulateStatus="src readyState networkState currentTime duration paused ended playbackRate",a.jPlayer.emulateOptions="muted volume",a.jPlayer.reservedEvent="ready flashreset resize repeat error warning",a.jPlayer.event={},a.each(["ready","setmedia","flashreset","resize","repeat","click","error","warning","loadstart","progress","suspend","abort","emptied","stalled","play","pause","loadedmetadata","loadeddata","waiting","playing","canplay","canplaythrough","seeking","seeked","timeupdate","ended","ratechange","durationchange","volumechange"],function(){a.jPlayer.event[this]="jPlayer_"+this}),a.jPlayer.htmlEvent=["loadstart","abort","emptied","stalled","loadedmetadata","canplay","canplaythrough"],a.jPlayer.pause=function(){a.jPlayer.prototype.destroyRemoved(),a.each(a.jPlayer.prototype.instances,function(a,b){b.data("jPlayer").status.srcSet&&b.jPlayer("pause")})},a.jPlayer.timeFormat={showHour:!1,showMin:!0,showSec:!0,padHour:!1,padMin:!0,padSec:!0,sepHour:":",sepMin:":",sepSec:""};var c=function(){this.init()};c.prototype={init:function(){this.options={timeFormat:a.jPlayer.timeFormat}},time:function(a){a=a&&"number"==typeof a?a:0;var b=new Date(1e3*a),c=b.getUTCHours(),d=this.options.timeFormat.showHour?b.getUTCMinutes():b.getUTCMinutes()+60*c,e=this.options.timeFormat.showMin?b.getUTCSeconds():b.getUTCSeconds()+60*d,f=this.options.timeFormat.padHour&&10>c?"0"+c:c,g=this.options.timeFormat.padMin&&10>d?"0"+d:d,h=this.options.timeFormat.padSec&&10>e?"0"+e:e,i="";return i+=this.options.timeFormat.showHour?f+this.options.timeFormat.sepHour:"",i+=this.options.timeFormat.showMin?g+this.options.timeFormat.sepMin:"",i+=this.options.timeFormat.showSec?h+this.options.timeFormat.sepSec:""}};var d=new c;a.jPlayer.convertTime=function(a){return d.time(a)},a.jPlayer.uaBrowser=function(a){var b=a.toLowerCase(),c=/(webkit)[ \/]([\w.]+)/,d=/(opera)(?:.*version)?[ \/]([\w.]+)/,e=/(msie) ([\w.]+)/,f=/(mozilla)(?:.*? rv:([\w.]+))?/,g=c.exec(b)||d.exec(b)||e.exec(b)||b.indexOf("compatible")<0&&f.exec(b)||[];return{browser:g[1]||"",version:g[2]||"0"}},a.jPlayer.uaPlatform=function(a){var b=a.toLowerCase(),c=/(ipad|iphone|ipod|android|blackberry|playbook|windows ce|webos)/,d=/(ipad|playbook)/,e=/(android)/,f=/(mobile)/,g=c.exec(b)||[],h=d.exec(b)||!f.exec(b)&&e.exec(b)||[];return g[1]&&(g[1]=g[1].replace(/\s/g,"_")),{platform:g[1]||"",tablet:h[1]||""}},a.jPlayer.browser={},a.jPlayer.platform={};var e=a.jPlayer.uaBrowser(navigator.userAgent);e.browser&&(a.jPlayer.browser[e.browser]=!0,a.jPlayer.browser.version=e.version);var f=a.jPlayer.uaPlatform(navigator.userAgent);f.platform&&(a.jPlayer.platform[f.platform]=!0,a.jPlayer.platform.mobile=!f.tablet,a.jPlayer.platform.tablet=!!f.tablet),a.jPlayer.getDocMode=function(){var b;return a.jPlayer.browser.msie&&(document.documentMode?b=document.documentMode:(b=5,document.compatMode&&"CSS1Compat"===document.compatMode&&(b=7))),b},a.jPlayer.browser.documentMode=a.jPlayer.getDocMode(),a.jPlayer.nativeFeatures={init:function(){var a,b,c,d=document,e=d.createElement("video"),f={w3c:["fullscreenEnabled","fullscreenElement","requestFullscreen","exitFullscreen","fullscreenchange","fullscreenerror"],moz:["mozFullScreenEnabled","mozFullScreenElement","mozRequestFullScreen","mozCancelFullScreen","mozfullscreenchange","mozfullscreenerror"],webkit:["","webkitCurrentFullScreenElement","webkitRequestFullScreen","webkitCancelFullScreen","webkitfullscreenchange",""],webkitVideo:["webkitSupportsFullscreen","webkitDisplayingFullscreen","webkitEnterFullscreen","webkitExitFullscreen","",""],ms:["","msFullscreenElement","msRequestFullscreen","msExitFullscreen","MSFullscreenChange","MSFullscreenError"]},g=["w3c","moz","webkit","webkitVideo","ms"];for(this.fullscreen=a={support:{w3c:!!d[f.w3c[0]],moz:!!d[f.moz[0]],webkit:"function"==typeof d[f.webkit[3]],webkitVideo:"function"==typeof e[f.webkitVideo[2]],ms:"function"==typeof e[f.ms[2]]},used:{}},b=0,c=g.length;c>b;b++){var h=g[b];if(a.support[h]){a.spec=h,a.used[h]=!0;break}}if(a.spec){var i=f[a.spec];a.api={fullscreenEnabled:!0,fullscreenElement:function(a){return a=a?a:d,a[i[1]]},requestFullscreen:function(a){return a[i[2]]()},exitFullscreen:function(a){return a=a?a:d,a[i[3]]()}},a.event={fullscreenchange:i[4],fullscreenerror:i[5]}}else a.api={fullscreenEnabled:!1,fullscreenElement:function(){return null},requestFullscreen:function(){},exitFullscreen:function(){}},a.event={}}},a.jPlayer.nativeFeatures.init(),a.jPlayer.focus=null,a.jPlayer.keyIgnoreElementNames="A INPUT TEXTAREA SELECT BUTTON";var g=function(b){var c,d=a.jPlayer.focus;d&&(a.each(a.jPlayer.keyIgnoreElementNames.split(/\s+/g),function(a,d){return b.target.nodeName.toUpperCase()===d.toUpperCase()?(c=!0,!1):void 0}),c||a.each(d.options.keyBindings,function(c,e){return e&&a.isFunction(e.fn)&&("number"==typeof e.key&&b.which===e.key||"string"==typeof e.key&&b.key===e.key)?(b.preventDefault(),e.fn(d),!1):void 0}))};a.jPlayer.keys=function(b){var c="keydown.jPlayer";a(document.documentElement).unbind(c),b&&a(document.documentElement).bind(c,g)},a.jPlayer.keys(!0),a.jPlayer.prototype={count:0,version:{script:"2.9.2",needFlash:"2.9.0",flash:"unknown"},options:{swfPath:"js",solution:"html, flash",supplied:"mp3",auroraFormats:"wav",preload:"metadata",volume:.8,muted:!1,remainingDuration:!1,toggleDuration:!1,captureDuration:!0,playbackRate:1,defaultPlaybackRate:1,minPlaybackRate:.5,maxPlaybackRate:4,wmode:"opaque",backgroundColor:"#000000",cssSelectorAncestor:"#jp_container_1",cssSelector:{videoPlay:".jp-video-play",play:".jp-play",pause:".jp-pause",stop:".jp-stop",seekBar:".jp-seek-bar",playBar:".jp-play-bar",mute:".jp-mute",unmute:".jp-unmute",volumeBar:".jp-volume-bar",volumeBarValue:".jp-volume-bar-value",volumeMax:".jp-volume-max",playbackRateBar:".jp-playback-rate-bar",playbackRateBarValue:".jp-playback-rate-bar-value",currentTime:".jp-current-time",duration:".jp-duration",title:".jp-title",fullScreen:".jp-full-screen",restoreScreen:".jp-restore-screen",repeat:".jp-repeat",repeatOff:".jp-repeat-off",gui:".jp-gui",noSolution:".jp-no-solution"},stateClass:{playing:"jp-state-playing",seeking:"jp-state-seeking",muted:"jp-state-muted",looped:"jp-state-looped",fullScreen:"jp-state-full-screen",noVolume:"jp-state-no-volume"},useStateClassSkin:!1,autoBlur:!0,smoothPlayBar:!1,fullScreen:!1,fullWindow:!1,autohide:{restored:!1,full:!0,fadeIn:200,fadeOut:600,hold:1e3},loop:!1,repeat:function(b){b.jPlayer.options.loop?a(this).unbind(".jPlayerRepeat").bind(a.jPlayer.event.ended+".jPlayer.jPlayerRepeat",function(){a(this).jPlayer("play")}):a(this).unbind(".jPlayerRepeat")},nativeVideoControls:{},noFullWindow:{msie:/msie [0-6]\./,ipad:/ipad.*?os [0-4]\./,iphone:/iphone/,ipod:/ipod/,android_pad:/android [0-3]\.(?!.*?mobile)/,android_phone:/(?=.*android)(?!.*chrome)(?=.*mobile)/,blackberry:/blackberry/,windows_ce:/windows ce/,iemobile:/iemobile/,webos:/webos/},noVolume:{ipad:/ipad/,iphone:/iphone/,ipod:/ipod/,android_pad:/android(?!.*?mobile)/,android_phone:/android.*?mobile/,blackberry:/blackberry/,windows_ce:/windows ce/,iemobile:/iemobile/,webos:/webos/,playbook:/playbook/},timeFormat:{},keyEnabled:!1,audioFullScreen:!1,keyBindings:{play:{key:80,fn:function(a){a.status.paused?a.play():a.pause()}},fullScreen:{key:70,fn:function(a){(a.status.video||a.options.audioFullScreen)&&a._setOption("fullScreen",!a.options.fullScreen)}},muted:{key:77,fn:function(a){a._muted(!a.options.muted)}},volumeUp:{key:190,fn:function(a){a.volume(a.options.volume+.1)}},volumeDown:{key:188,fn:function(a){a.volume(a.options.volume-.1)}},loop:{key:76,fn:function(a){a._loop(!a.options.loop)}}},verticalVolume:!1,verticalPlaybackRate:!1,globalVolume:!1,idPrefix:"jp",noConflict:"jQuery",emulateHtml:!1,consoleAlerts:!0,errorAlerts:!1,warningAlerts:!1},optionsAudio:{size:{width:"0px",height:"0px",cssClass:""},sizeFull:{width:"0px",height:"0px",cssClass:""}},optionsVideo:{size:{width:"480px",height:"270px",cssClass:"jp-video-270p"},sizeFull:{width:"100%",height:"100%",cssClass:"jp-video-full"}},instances:{},status:{src:"",media:{},paused:!0,format:{},formatType:"",waitForPlay:!0,waitForLoad:!0,srcSet:!1,video:!1,seekPercent:0,currentPercentRelative:0,currentPercentAbsolute:0,currentTime:0,duration:0,remaining:0,videoWidth:0,videoHeight:0,readyState:0,networkState:0,playbackRate:1,ended:0},internal:{ready:!1},solution:{html:!0,aurora:!0,flash:!0},format:{mp3:{codec:"audio/mpeg",flashCanPlay:!0,media:"audio"},m4a:{codec:'audio/mp4; codecs="mp4a.40.2"',flashCanPlay:!0,media:"audio"},m3u8a:{codec:'application/vnd.apple.mpegurl; codecs="mp4a.40.2"',flashCanPlay:!1,media:"audio"},m3ua:{codec:"audio/mpegurl",flashCanPlay:!1,media:"audio"},oga:{codec:'audio/ogg; codecs="vorbis, opus"',flashCanPlay:!1,media:"audio"},flac:{codec:"audio/x-flac",flashCanPlay:!1,media:"audio"},wav:{codec:'audio/wav; codecs="1"',flashCanPlay:!1,media:"audio"},webma:{codec:'audio/webm; codecs="vorbis"',flashCanPlay:!1,media:"audio"},fla:{codec:"audio/x-flv",flashCanPlay:!0,media:"audio"},rtmpa:{codec:'audio/rtmp; codecs="rtmp"',flashCanPlay:!0,media:"audio"},m4v:{codec:'video/mp4; codecs="avc1.42E01E, mp4a.40.2"',flashCanPlay:!0,media:"video"},m3u8v:{codec:'application/vnd.apple.mpegurl; codecs="avc1.42E01E, mp4a.40.2"',flashCanPlay:!1,media:"video"},m3uv:{codec:"audio/mpegurl",flashCanPlay:!1,media:"video"},ogv:{codec:'video/ogg; codecs="theora, vorbis"',flashCanPlay:!1,media:"video"},webmv:{codec:'video/webm; codecs="vorbis, vp8"',flashCanPlay:!1,media:"video"},flv:{codec:"video/x-flv",flashCanPlay:!0,media:"video"},rtmpv:{codec:'video/rtmp; codecs="rtmp"',flashCanPlay:!0,media:"video"}},_init:function(){var c=this;if(this.element.empty(),this.status=a.extend({},this.status),this.internal=a.extend({},this.internal),this.options.timeFormat=a.extend({},a.jPlayer.timeFormat,this.options.timeFormat),this.internal.cmdsIgnored=a.jPlayer.platform.ipad||a.jPlayer.platform.iphone||a.jPlayer.platform.ipod,this.internal.domNode=this.element.get(0),this.options.keyEnabled&&!a.jPlayer.focus&&(a.jPlayer.focus=this),this.androidFix={setMedia:!1,play:!1,pause:!1,time:0/0},a.jPlayer.platform.android&&(this.options.preload="auto"!==this.options.preload?"metadata":"auto"),this.formats=[],this.solutions=[],this.require={},this.htmlElement={},this.html={},this.html.audio={},this.html.video={},this.aurora={},this.aurora.formats=[],this.aurora.properties=[],this.flash={},this.css={},this.css.cs={},this.css.jq={},this.ancestorJq=[],this.options.volume=this._limitValue(this.options.volume,0,1),a.each(this.options.supplied.toLowerCase().split(","),function(b,d){var e=d.replace(/^\s+|\s+$/g,"");if(c.format[e]){var f=!1;a.each(c.formats,function(a,b){return e===b?(f=!0,!1):void 0}),f||c.formats.push(e)}}),a.each(this.options.solution.toLowerCase().split(","),function(b,d){var e=d.replace(/^\s+|\s+$/g,"");if(c.solution[e]){var f=!1;a.each(c.solutions,function(a,b){return e===b?(f=!0,!1):void 0}),f||c.solutions.push(e)}}),a.each(this.options.auroraFormats.toLowerCase().split(","),function(b,d){var e=d.replace(/^\s+|\s+$/g,"");if(c.format[e]){var f=!1;a.each(c.aurora.formats,function(a,b){return e===b?(f=!0,!1):void 0}),f||c.aurora.formats.push(e)}}),this.internal.instance="jp_"+this.count,this.instances[this.internal.instance]=this.element,this.element.attr("id")||this.element.attr("id",this.options.idPrefix+"_jplayer_"+this.count),this.internal.self=a.extend({},{id:this.element.attr("id"),jq:this.element}),this.internal.audio=a.extend({},{id:this.options.idPrefix+"_audio_"+this.count,jq:b}),this.internal.video=a.extend({},{id:this.options.idPrefix+"_video_"+this.count,jq:b}),this.internal.flash=a.extend({},{id:this.options.idPrefix+"_flash_"+this.count,jq:b,swf:this.options.swfPath+(".swf"!==this.options.swfPath.toLowerCase().slice(-4)?(this.options.swfPath&&"/"!==this.options.swfPath.slice(-1)?"/":"")+"jquery.jplayer.swf":"")}),this.internal.poster=a.extend({},{id:this.options.idPrefix+"_poster_"+this.count,jq:b}),a.each(a.jPlayer.event,function(a,d){c.options[a]!==b&&(c.element.bind(d+".jPlayer",c.options[a]),c.options[a]=b)}),this.require.audio=!1,this.require.video=!1,a.each(this.formats,function(a,b){c.require[c.format[b].media]=!0}),this.options=this.require.video?a.extend(!0,{},this.optionsVideo,this.options):a.extend(!0,{},this.optionsAudio,this.options),this._setSize(),this.status.nativeVideoControls=this._uaBlocklist(this.options.nativeVideoControls),this.status.noFullWindow=this._uaBlocklist(this.options.noFullWindow),this.status.noVolume=this._uaBlocklist(this.options.noVolume),a.jPlayer.nativeFeatures.fullscreen.api.fullscreenEnabled&&this._fullscreenAddEventListeners(),this._restrictNativeVideoControls(),this.htmlElement.poster=document.createElement("img"),this.htmlElement.poster.id=this.internal.poster.id,this.htmlElement.poster.onload=function(){(!c.status.video||c.status.waitForPlay)&&c.internal.poster.jq.show()},this.element.append(this.htmlElement.poster),this.internal.poster.jq=a("#"+this.internal.poster.id),this.internal.poster.jq.css({width:this.status.width,height:this.status.height}),this.internal.poster.jq.hide(),this.internal.poster.jq.bind("click.jPlayer",function(){c._trigger(a.jPlayer.event.click)}),this.html.audio.available=!1,this.require.audio&&(this.htmlElement.audio=document.createElement("audio"),this.htmlElement.audio.id=this.internal.audio.id,this.html.audio.available=!!this.htmlElement.audio.canPlayType&&this._testCanPlayType(this.htmlElement.audio)),this.html.video.available=!1,this.require.video&&(this.htmlElement.video=document.createElement("video"),this.htmlElement.video.id=this.internal.video.id,this.html.video.available=!!this.htmlElement.video.canPlayType&&this._testCanPlayType(this.htmlElement.video)),this.flash.available=this._checkForFlash(10.1),this.html.canPlay={},this.aurora.canPlay={},this.flash.canPlay={},a.each(this.formats,function(b,d){c.html.canPlay[d]=c.html[c.format[d].media].available&&""!==c.htmlElement[c.format[d].media].canPlayType(c.format[d].codec),c.aurora.canPlay[d]=a.inArray(d,c.aurora.formats)>-1,c.flash.canPlay[d]=c.format[d].flashCanPlay&&c.flash.available}),this.html.desired=!1,this.aurora.desired=!1,this.flash.desired=!1,a.each(this.solutions,function(b,d){if(0===b)c[d].desired=!0;else{var e=!1,f=!1;a.each(c.formats,function(a,b){c[c.solutions[0]].canPlay[b]&&("video"===c.format[b].media?f=!0:e=!0)}),c[d].desired=c.require.audio&&!e||c.require.video&&!f}}),this.html.support={},this.aurora.support={},this.flash.support={},a.each(this.formats,function(a,b){c.html.support[b]=c.html.canPlay[b]&&c.html.desired,c.aurora.support[b]=c.aurora.canPlay[b]&&c.aurora.desired,c.flash.support[b]=c.flash.canPlay[b]&&c.flash.desired}),this.html.used=!1,this.aurora.used=!1,this.flash.used=!1,a.each(this.solutions,function(b,d){a.each(c.formats,function(a,b){return c[d].support[b]?(c[d].used=!0,!1):void 0})}),this._resetActive(),this._resetGate(),this._cssSelectorAncestor(this.options.cssSelectorAncestor),this.html.used||this.aurora.used||this.flash.used?this.css.jq.noSolution.length&&this.css.jq.noSolution.hide():(this._error({type:a.jPlayer.error.NO_SOLUTION,context:"{solution:'"+this.options.solution+"', supplied:'"+this.options.supplied+"'}",message:a.jPlayer.errorMsg.NO_SOLUTION,hint:a.jPlayer.errorHint.NO_SOLUTION}),this.css.jq.noSolution.length&&this.css.jq.noSolution.show()),this.flash.used){var d,e="jQuery="+encodeURI(this.options.noConflict)+"&id="+encodeURI(this.internal.self.id)+"&vol="+this.options.volume+"&muted="+this.options.muted;if(a.jPlayer.browser.msie&&(Number(a.jPlayer.browser.version)<9||a.jPlayer.browser.documentMode<9)){var f='<object id="'+this.internal.flash.id+'" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="0" height="0" tabindex="-1"></object>',g=['<param name="movie" value="'+this.internal.flash.swf+'" />','<param name="FlashVars" value="'+e+'" />','<param name="allowScriptAccess" value="always" />','<param name="bgcolor" value="'+this.options.backgroundColor+'" />','<param name="wmode" value="'+this.options.wmode+'" />'];d=document.createElement(f);for(var h=0;h<g.length;h++)d.appendChild(document.createElement(g[h]))}else{var i=function(a,b,c){var d=document.createElement("param");d.setAttribute("name",b),d.setAttribute("value",c),a.appendChild(d)};d=document.createElement("object"),d.setAttribute("id",this.internal.flash.id),d.setAttribute("name",this.internal.flash.id),d.setAttribute("data",this.internal.flash.swf),d.setAttribute("type","application/x-shockwave-flash"),d.setAttribute("width","1"),d.setAttribute("height","1"),d.setAttribute("tabindex","-1"),i(d,"flashvars",e),i(d,"allowscriptaccess","always"),i(d,"bgcolor",this.options.backgroundColor),i(d,"wmode",this.options.wmode)}this.element.append(d),this.internal.flash.jq=a(d)}this.status.playbackRateEnabled=this.html.used&&!this.flash.used?this._testPlaybackRate("audio"):!1,this._updatePlaybackRate(),this.html.used&&(this.html.audio.available&&(this._addHtmlEventListeners(this.htmlElement.audio,this.html.audio),this.element.append(this.htmlElement.audio),this.internal.audio.jq=a("#"+this.internal.audio.id)),this.html.video.available&&(this._addHtmlEventListeners(this.htmlElement.video,this.html.video),this.element.append(this.htmlElement.video),this.internal.video.jq=a("#"+this.internal.video.id),this.internal.video.jq.css(this.status.nativeVideoControls?{width:this.status.width,height:this.status.height}:{width:"0px",height:"0px"}),this.internal.video.jq.bind("click.jPlayer",function(){c._trigger(a.jPlayer.event.click)}))),this.aurora.used,this.options.emulateHtml&&this._emulateHtmlBridge(),!this.html.used&&!this.aurora.used||this.flash.used||setTimeout(function(){c.internal.ready=!0,c.version.flash="n/a",c._trigger(a.jPlayer.event.repeat),c._trigger(a.jPlayer.event.ready)},100),this._updateNativeVideoControls(),this.css.jq.videoPlay.length&&this.css.jq.videoPlay.hide(),a.jPlayer.prototype.count++},destroy:function(){this.clearMedia(),this._removeUiClass(),this.css.jq.currentTime.length&&this.css.jq.currentTime.text(""),this.css.jq.duration.length&&this.css.jq.duration.text(""),a.each(this.css.jq,function(a,b){b.length&&b.unbind(".jPlayer")}),this.internal.poster.jq.unbind(".jPlayer"),this.internal.video.jq&&this.internal.video.jq.unbind(".jPlayer"),this._fullscreenRemoveEventListeners(),this===a.jPlayer.focus&&(a.jPlayer.focus=null),this.options.emulateHtml&&this._destroyHtmlBridge(),this.element.removeData("jPlayer"),this.element.unbind(".jPlayer"),this.element.empty(),delete this.instances[this.internal.instance]},destroyRemoved:function(){var b=this;a.each(this.instances,function(a,c){b.element!==c&&(c.data("jPlayer")||(c.jPlayer("destroy"),delete b.instances[a]))})},enable:function(){},disable:function(){},_testCanPlayType:function(a){try{return a.canPlayType(this.format.mp3.codec),!0}catch(b){return!1}},_testPlaybackRate:function(a){var b,c=.5;a="string"==typeof a?a:"audio",b=document.createElement(a);try{return"playbackRate"in b?(b.playbackRate=c,b.playbackRate===c):!1}catch(d){return!1}},_uaBlocklist:function(b){var c=navigator.userAgent.toLowerCase(),d=!1;return a.each(b,function(a,b){return b&&b.test(c)?(d=!0,!1):void 0}),d},_restrictNativeVideoControls:function(){this.require.audio&&this.status.nativeVideoControls&&(this.status.nativeVideoControls=!1,this.status.noFullWindow=!0)},_updateNativeVideoControls:function(){this.html.video.available&&this.html.used&&(this.htmlElement.video.controls=this.status.nativeVideoControls,this._updateAutohide(),this.status.nativeVideoControls&&this.require.video?(this.internal.poster.jq.hide(),this.internal.video.jq.css({width:this.status.width,height:this.status.height})):this.status.waitForPlay&&this.status.video&&(this.internal.poster.jq.show(),this.internal.video.jq.css({width:"0px",height:"0px"})))},_addHtmlEventListeners:function(b,c){var d=this;b.preload=this.options.preload,b.muted=this.options.muted,b.volume=this.options.volume,this.status.playbackRateEnabled&&(b.defaultPlaybackRate=this.options.defaultPlaybackRate,b.playbackRate=this.options.playbackRate),b.addEventListener("progress",function(){c.gate&&(d.internal.cmdsIgnored&&this.readyState>0&&(d.internal.cmdsIgnored=!1),d._getHtmlStatus(b),d._updateInterface(),d._trigger(a.jPlayer.event.progress))},!1),b.addEventListener("loadeddata",function(){c.gate&&(d.androidFix.setMedia=!1,d.androidFix.play&&(d.androidFix.play=!1,d.play(d.androidFix.time)),d.androidFix.pause&&(d.androidFix.pause=!1,d.pause(d.androidFix.time)),d._trigger(a.jPlayer.event.loadeddata))},!1),b.addEventListener("timeupdate",function(){c.gate&&(d._getHtmlStatus(b),d._updateInterface(),d._trigger(a.jPlayer.event.timeupdate))},!1),b.addEventListener("durationchange",function(){c.gate&&(d._getHtmlStatus(b),d._updateInterface(),d._trigger(a.jPlayer.event.durationchange))},!1),b.addEventListener("play",function(){c.gate&&(d._updateButtons(!0),d._html_checkWaitForPlay(),d._trigger(a.jPlayer.event.play))},!1),b.addEventListener("playing",function(){c.gate&&(d._updateButtons(!0),d._seeked(),d._trigger(a.jPlayer.event.playing))},!1),b.addEventListener("pause",function(){c.gate&&(d._updateButtons(!1),d._trigger(a.jPlayer.event.pause))},!1),b.addEventListener("waiting",function(){c.gate&&(d._seeking(),d._trigger(a.jPlayer.event.waiting))},!1),b.addEventListener("seeking",function(){c.gate&&(d._seeking(),d._trigger(a.jPlayer.event.seeking))},!1),b.addEventListener("seeked",function(){c.gate&&(d._seeked(),d._trigger(a.jPlayer.event.seeked))},!1),b.addEventListener("volumechange",function(){c.gate&&(d.options.volume=b.volume,d.options.muted=b.muted,d._updateMute(),d._updateVolume(),d._trigger(a.jPlayer.event.volumechange))},!1),b.addEventListener("ratechange",function(){c.gate&&(d.options.defaultPlaybackRate=b.defaultPlaybackRate,d.options.playbackRate=b.playbackRate,d._updatePlaybackRate(),d._trigger(a.jPlayer.event.ratechange))},!1),b.addEventListener("suspend",function(){c.gate&&(d._seeked(),d._trigger(a.jPlayer.event.suspend))},!1),b.addEventListener("ended",function(){c.gate&&(a.jPlayer.browser.webkit||(d.htmlElement.media.currentTime=0),d.htmlElement.media.pause(),d._updateButtons(!1),d._getHtmlStatus(b,!0),d._updateInterface(),d._trigger(a.jPlayer.event.ended))},!1),b.addEventListener("error",function(){c.gate&&(d._updateButtons(!1),d._seeked(),d.status.srcSet&&(clearTimeout(d.internal.htmlDlyCmdId),d.status.waitForLoad=!0,d.status.waitForPlay=!0,d.status.video&&!d.status.nativeVideoControls&&d.internal.video.jq.css({width:"0px",height:"0px"}),d._validString(d.status.media.poster)&&!d.status.nativeVideoControls&&d.internal.poster.jq.show(),d.css.jq.videoPlay.length&&d.css.jq.videoPlay.show(),d._error({type:a.jPlayer.error.URL,context:d.status.src,message:a.jPlayer.errorMsg.URL,hint:a.jPlayer.errorHint.URL})))},!1),a.each(a.jPlayer.htmlEvent,function(e,f){b.addEventListener(this,function(){c.gate&&d._trigger(a.jPlayer.event[f])},!1)})},_addAuroraEventListeners:function(b,c){var d=this;b.volume=100*this.options.volume,b.on("progress",function(){c.gate&&(d.internal.cmdsIgnored&&this.readyState>0&&(d.internal.cmdsIgnored=!1),d._getAuroraStatus(b),d._updateInterface(),d._trigger(a.jPlayer.event.progress),b.duration>0&&d._trigger(a.jPlayer.event.timeupdate))},!1),b.on("ready",function(){c.gate&&d._trigger(a.jPlayer.event.loadeddata)},!1),b.on("duration",function(){c.gate&&(d._getAuroraStatus(b),d._updateInterface(),d._trigger(a.jPlayer.event.durationchange))},!1),b.on("end",function(){c.gate&&(d._updateButtons(!1),d._getAuroraStatus(b,!0),d._updateInterface(),d._trigger(a.jPlayer.event.ended))},!1),b.on("error",function(){c.gate&&(d._updateButtons(!1),d._seeked(),d.status.srcSet&&(d.status.waitForLoad=!0,d.status.waitForPlay=!0,d.status.video&&!d.status.nativeVideoControls&&d.internal.video.jq.css({width:"0px",height:"0px"}),d._validString(d.status.media.poster)&&!d.status.nativeVideoControls&&d.internal.poster.jq.show(),d.css.jq.videoPlay.length&&d.css.jq.videoPlay.show(),d._error({type:a.jPlayer.error.URL,context:d.status.src,message:a.jPlayer.errorMsg.URL,hint:a.jPlayer.errorHint.URL})))},!1)},_getHtmlStatus:function(a,b){var c=0,d=0,e=0,f=0;isFinite(a.duration)&&(this.status.duration=a.duration),c=a.currentTime,d=this.status.duration>0?100*c/this.status.duration:0,"object"==typeof a.seekable&&a.seekable.length>0?(e=this.status.duration>0?100*a.seekable.end(a.seekable.length-1)/this.status.duration:100,f=this.status.duration>0?100*a.currentTime/a.seekable.end(a.seekable.length-1):0):(e=100,f=d),b&&(c=0,f=0,d=0),this.status.seekPercent=e,this.status.currentPercentRelative=f,this.status.currentPercentAbsolute=d,this.status.currentTime=c,this.status.remaining=this.status.duration-this.status.currentTime,this.status.videoWidth=a.videoWidth,this.status.videoHeight=a.videoHeight,this.status.readyState=a.readyState,this.status.networkState=a.networkState,this.status.playbackRate=a.playbackRate,this.status.ended=a.ended},_getAuroraStatus:function(a,b){var c=0,d=0,e=0,f=0;this.status.duration=a.duration/1e3,c=a.currentTime/1e3,d=this.status.duration>0?100*c/this.status.duration:0,a.buffered>0?(e=this.status.duration>0?a.buffered*this.status.duration/this.status.duration:100,f=this.status.duration>0?c/(a.buffered*this.status.duration):0):(e=100,f=d),b&&(c=0,f=0,d=0),this.status.seekPercent=e,this.status.currentPercentRelative=f,this.status.currentPercentAbsolute=d,this.status.currentTime=c,this.status.remaining=this.status.duration-this.status.currentTime,this.status.readyState=4,this.status.networkState=0,this.status.playbackRate=1,this.status.ended=!1},_resetStatus:function(){this.status=a.extend({},this.status,a.jPlayer.prototype.status)},_trigger:function(b,c,d){var e=a.Event(b);e.jPlayer={},e.jPlayer.version=a.extend({},this.version),e.jPlayer.options=a.extend(!0,{},this.options),e.jPlayer.status=a.extend(!0,{},this.status),e.jPlayer.html=a.extend(!0,{},this.html),e.jPlayer.aurora=a.extend(!0,{},this.aurora),e.jPlayer.flash=a.extend(!0,{},this.flash),c&&(e.jPlayer.error=a.extend({},c)),d&&(e.jPlayer.warning=a.extend({},d)),this.element.trigger(e)},jPlayerFlashEvent:function(b,c){if(b===a.jPlayer.event.ready)if(this.internal.ready){if(this.flash.gate){if(this.status.srcSet){var d=this.status.currentTime,e=this.status.paused;this.setMedia(this.status.media),this.volumeWorker(this.options.volume),d>0&&(e?this.pause(d):this.play(d))}this._trigger(a.jPlayer.event.flashreset)}}else this.internal.ready=!0,this.internal.flash.jq.css({width:"0px",height:"0px"}),this.version.flash=c.version,this.version.needFlash!==this.version.flash&&this._error({type:a.jPlayer.error.VERSION,context:this.version.flash,message:a.jPlayer.errorMsg.VERSION+this.version.flash,hint:a.jPlayer.errorHint.VERSION}),this._trigger(a.jPlayer.event.repeat),this._trigger(b);if(this.flash.gate)switch(b){case a.jPlayer.event.progress:this._getFlashStatus(c),this._updateInterface(),this._trigger(b);break;case a.jPlayer.event.timeupdate:this._getFlashStatus(c),this._updateInterface(),this._trigger(b);break;case a.jPlayer.event.play:this._seeked(),this._updateButtons(!0),this._trigger(b);break;case a.jPlayer.event.pause:this._updateButtons(!1),this._trigger(b);break;case a.jPlayer.event.ended:this._updateButtons(!1),this._trigger(b);break;case a.jPlayer.event.click:this._trigger(b);break;case a.jPlayer.event.error:this.status.waitForLoad=!0,this.status.waitForPlay=!0,this.status.video&&this.internal.flash.jq.css({width:"0px",height:"0px"}),this._validString(this.status.media.poster)&&this.internal.poster.jq.show(),this.css.jq.videoPlay.length&&this.status.video&&this.css.jq.videoPlay.show(),this.status.video?this._flash_setVideo(this.status.media):this._flash_setAudio(this.status.media),this._updateButtons(!1),this._error({type:a.jPlayer.error.URL,context:c.src,message:a.jPlayer.errorMsg.URL,hint:a.jPlayer.errorHint.URL});break;case a.jPlayer.event.seeking:this._seeking(),this._trigger(b);break;case a.jPlayer.event.seeked:this._seeked(),this._trigger(b);break;case a.jPlayer.event.ready:break;default:this._trigger(b)}return!1},_getFlashStatus:function(a){this.status.seekPercent=a.seekPercent,this.status.currentPercentRelative=a.currentPercentRelative,this.status.currentPercentAbsolute=a.currentPercentAbsolute,this.status.currentTime=a.currentTime,this.status.duration=a.duration,this.status.remaining=a.duration-a.currentTime,this.status.videoWidth=a.videoWidth,this.status.videoHeight=a.videoHeight,this.status.readyState=4,this.status.networkState=0,this.status.playbackRate=1,this.status.ended=!1},_updateButtons:function(a){a===b?a=!this.status.paused:this.status.paused=!a,a?this.addStateClass("playing"):this.removeStateClass("playing"),!this.status.noFullWindow&&this.options.fullWindow?this.addStateClass("fullScreen"):this.removeStateClass("fullScreen"),this.options.loop?this.addStateClass("looped"):this.removeStateClass("looped"),this.css.jq.play.length&&this.css.jq.pause.length&&(a?(this.css.jq.play.hide(),this.css.jq.pause.show()):(this.css.jq.play.show(),this.css.jq.pause.hide())),this.css.jq.restoreScreen.length&&this.css.jq.fullScreen.length&&(this.status.noFullWindow?(this.css.jq.fullScreen.hide(),this.css.jq.restoreScreen.hide()):this.options.fullWindow?(this.css.jq.fullScreen.hide(),this.css.jq.restoreScreen.show()):(this.css.jq.fullScreen.show(),this.css.jq.restoreScreen.hide())),this.css.jq.repeat.length&&this.css.jq.repeatOff.length&&(this.options.loop?(this.css.jq.repeat.hide(),this.css.jq.repeatOff.show()):(this.css.jq.repeat.show(),this.css.jq.repeatOff.hide()))},_updateInterface:function(){this.css.jq.seekBar.length&&this.css.jq.seekBar.width(this.status.seekPercent+"%"),this.css.jq.playBar.length&&(this.options.smoothPlayBar?this.css.jq.playBar.stop().animate({width:this.status.currentPercentAbsolute+"%"},250,"linear"):this.css.jq.playBar.width(this.status.currentPercentRelative+"%"));var a="";this.css.jq.currentTime.length&&(a=this._convertTime(this.status.currentTime),a!==this.css.jq.currentTime.text()&&this.css.jq.currentTime.text(this._convertTime(this.status.currentTime)));var b="",c=this.status.duration,d=this.status.remaining;this.css.jq.duration.length&&("string"==typeof this.status.media.duration?b=this.status.media.duration:("number"==typeof this.status.media.duration&&(c=this.status.media.duration,d=c-this.status.currentTime),b=this.options.remainingDuration?(d>0?"-":"")+this._convertTime(d):this._convertTime(c)),b!==this.css.jq.duration.text()&&this.css.jq.duration.text(b))},_convertTime:c.prototype.time,_seeking:function(){this.css.jq.seekBar.length&&this.css.jq.seekBar.addClass("jp-seeking-bg"),this.addStateClass("seeking")},_seeked:function(){this.css.jq.seekBar.length&&this.css.jq.seekBar.removeClass("jp-seeking-bg"),this.removeStateClass("seeking")},_resetGate:function(){this.html.audio.gate=!1,this.html.video.gate=!1,this.aurora.gate=!1,this.flash.gate=!1},_resetActive:function(){this.html.active=!1,this.aurora.active=!1,this.flash.active=!1},_escapeHtml:function(a){return a.split("&").join("&").split("<").join("<").split(">").join(">").split('"').join(""")},_qualifyURL:function(a){var b=document.createElement("div");
|
3 |
+
return b.innerHTML='<a href="'+this._escapeHtml(a)+'">x</a>',b.firstChild.href},_absoluteMediaUrls:function(b){var c=this;return a.each(b,function(a,d){d&&c.format[a]&&"data:"!==d.substr(0,5)&&(b[a]=c._qualifyURL(d))}),b},addStateClass:function(a){this.ancestorJq.length&&this.ancestorJq.addClass(this.options.stateClass[a])},removeStateClass:function(a){this.ancestorJq.length&&this.ancestorJq.removeClass(this.options.stateClass[a])},setMedia:function(b){var c=this,d=!1,e=this.status.media.poster!==b.poster;this._resetMedia(),this._resetGate(),this._resetActive(),this.androidFix.setMedia=!1,this.androidFix.play=!1,this.androidFix.pause=!1,b=this._absoluteMediaUrls(b),a.each(this.formats,function(e,f){var g="video"===c.format[f].media;return a.each(c.solutions,function(e,h){if(c[h].support[f]&&c._validString(b[f])){var i="html"===h,j="aurora"===h;return g?(i?(c.html.video.gate=!0,c._html_setVideo(b),c.html.active=!0):(c.flash.gate=!0,c._flash_setVideo(b),c.flash.active=!0),c.css.jq.videoPlay.length&&c.css.jq.videoPlay.show(),c.status.video=!0):(i?(c.html.audio.gate=!0,c._html_setAudio(b),c.html.active=!0,a.jPlayer.platform.android&&(c.androidFix.setMedia=!0)):j?(c.aurora.gate=!0,c._aurora_setAudio(b),c.aurora.active=!0):(c.flash.gate=!0,c._flash_setAudio(b),c.flash.active=!0),c.css.jq.videoPlay.length&&c.css.jq.videoPlay.hide(),c.status.video=!1),d=!0,!1}}),d?!1:void 0}),d?(this.status.nativeVideoControls&&this.html.video.gate||this._validString(b.poster)&&(e?this.htmlElement.poster.src=b.poster:this.internal.poster.jq.show()),"string"==typeof b.title&&(this.css.jq.title.length&&this.css.jq.title.html(b.title),this.htmlElement.audio&&this.htmlElement.audio.setAttribute("title",b.title),this.htmlElement.video&&this.htmlElement.video.setAttribute("title",b.title)),this.status.srcSet=!0,this.status.media=a.extend({},b),this._updateButtons(!1),this._updateInterface(),this._trigger(a.jPlayer.event.setmedia)):this._error({type:a.jPlayer.error.NO_SUPPORT,context:"{supplied:'"+this.options.supplied+"'}",message:a.jPlayer.errorMsg.NO_SUPPORT,hint:a.jPlayer.errorHint.NO_SUPPORT})},_resetMedia:function(){this._resetStatus(),this._updateButtons(!1),this._updateInterface(),this._seeked(),this.internal.poster.jq.hide(),clearTimeout(this.internal.htmlDlyCmdId),this.html.active?this._html_resetMedia():this.aurora.active?this._aurora_resetMedia():this.flash.active&&this._flash_resetMedia()},clearMedia:function(){this._resetMedia(),this.html.active?this._html_clearMedia():this.aurora.active?this._aurora_clearMedia():this.flash.active&&this._flash_clearMedia(),this._resetGate(),this._resetActive()},load:function(){this.status.srcSet?this.html.active?this._html_load():this.aurora.active?this._aurora_load():this.flash.active&&this._flash_load():this._urlNotSetError("load")},focus:function(){this.options.keyEnabled&&(a.jPlayer.focus=this)},play:function(a){var b="object"==typeof a;b&&this.options.useStateClassSkin&&!this.status.paused?this.pause(a):(a="number"==typeof a?a:0/0,this.status.srcSet?(this.focus(),this.html.active?this._html_play(a):this.aurora.active?this._aurora_play(a):this.flash.active&&this._flash_play(a)):this._urlNotSetError("play"))},videoPlay:function(){this.play()},pause:function(a){a="number"==typeof a?a:0/0,this.status.srcSet?this.html.active?this._html_pause(a):this.aurora.active?this._aurora_pause(a):this.flash.active&&this._flash_pause(a):this._urlNotSetError("pause")},tellOthers:function(b,c){var d=this,e="function"==typeof c,f=Array.prototype.slice.call(arguments);"string"==typeof b&&(e&&f.splice(1,1),a.jPlayer.prototype.destroyRemoved(),a.each(this.instances,function(){d.element!==this&&(!e||c.call(this.data("jPlayer"),d))&&this.jPlayer.apply(this,f)}))},pauseOthers:function(a){this.tellOthers("pause",function(){return this.status.srcSet},a)},stop:function(){this.status.srcSet?this.html.active?this._html_pause(0):this.aurora.active?this._aurora_pause(0):this.flash.active&&this._flash_pause(0):this._urlNotSetError("stop")},playHead:function(a){a=this._limitValue(a,0,100),this.status.srcSet?this.html.active?this._html_playHead(a):this.aurora.active?this._aurora_playHead(a):this.flash.active&&this._flash_playHead(a):this._urlNotSetError("playHead")},_muted:function(a){this.mutedWorker(a),this.options.globalVolume&&this.tellOthers("mutedWorker",function(){return this.options.globalVolume},a)},mutedWorker:function(b){this.options.muted=b,this.html.used&&this._html_setProperty("muted",b),this.aurora.used&&this._aurora_mute(b),this.flash.used&&this._flash_mute(b),this.html.video.gate||this.html.audio.gate||(this._updateMute(b),this._updateVolume(this.options.volume),this._trigger(a.jPlayer.event.volumechange))},mute:function(a){var c="object"==typeof a;c&&this.options.useStateClassSkin&&this.options.muted?this._muted(!1):(a=a===b?!0:!!a,this._muted(a))},unmute:function(a){a=a===b?!0:!!a,this._muted(!a)},_updateMute:function(a){a===b&&(a=this.options.muted),a?this.addStateClass("muted"):this.removeStateClass("muted"),this.css.jq.mute.length&&this.css.jq.unmute.length&&(this.status.noVolume?(this.css.jq.mute.hide(),this.css.jq.unmute.hide()):a?(this.css.jq.mute.hide(),this.css.jq.unmute.show()):(this.css.jq.mute.show(),this.css.jq.unmute.hide()))},volume:function(a){this.volumeWorker(a),this.options.globalVolume&&this.tellOthers("volumeWorker",function(){return this.options.globalVolume},a)},volumeWorker:function(b){b=this._limitValue(b,0,1),this.options.volume=b,this.html.used&&this._html_setProperty("volume",b),this.aurora.used&&this._aurora_volume(b),this.flash.used&&this._flash_volume(b),this.html.video.gate||this.html.audio.gate||(this._updateVolume(b),this._trigger(a.jPlayer.event.volumechange))},volumeBar:function(b){if(this.css.jq.volumeBar.length){var c=a(b.currentTarget),d=c.offset(),e=b.pageX-d.left,f=c.width(),g=c.height()-b.pageY+d.top,h=c.height();this.volume(this.options.verticalVolume?g/h:e/f)}this.options.muted&&this._muted(!1)},_updateVolume:function(a){a===b&&(a=this.options.volume),a=this.options.muted?0:a,this.status.noVolume?(this.addStateClass("noVolume"),this.css.jq.volumeBar.length&&this.css.jq.volumeBar.hide(),this.css.jq.volumeBarValue.length&&this.css.jq.volumeBarValue.hide(),this.css.jq.volumeMax.length&&this.css.jq.volumeMax.hide()):(this.removeStateClass("noVolume"),this.css.jq.volumeBar.length&&this.css.jq.volumeBar.show(),this.css.jq.volumeBarValue.length&&(this.css.jq.volumeBarValue.show(),this.css.jq.volumeBarValue[this.options.verticalVolume?"height":"width"](100*a+"%")),this.css.jq.volumeMax.length&&this.css.jq.volumeMax.show())},volumeMax:function(){this.volume(1),this.options.muted&&this._muted(!1)},_cssSelectorAncestor:function(b){var c=this;this.options.cssSelectorAncestor=b,this._removeUiClass(),this.ancestorJq=b?a(b):[],b&&1!==this.ancestorJq.length&&this._warning({type:a.jPlayer.warning.CSS_SELECTOR_COUNT,context:b,message:a.jPlayer.warningMsg.CSS_SELECTOR_COUNT+this.ancestorJq.length+" found for cssSelectorAncestor.",hint:a.jPlayer.warningHint.CSS_SELECTOR_COUNT}),this._addUiClass(),a.each(this.options.cssSelector,function(a,b){c._cssSelector(a,b)}),this._updateInterface(),this._updateButtons(),this._updateAutohide(),this._updateVolume(),this._updateMute()},_cssSelector:function(b,c){var d=this;if("string"==typeof c)if(a.jPlayer.prototype.options.cssSelector[b]){if(this.css.jq[b]&&this.css.jq[b].length&&this.css.jq[b].unbind(".jPlayer"),this.options.cssSelector[b]=c,this.css.cs[b]=this.options.cssSelectorAncestor+" "+c,this.css.jq[b]=c?a(this.css.cs[b]):[],this.css.jq[b].length&&this[b]){var e=function(c){c.preventDefault(),d[b](c),d.options.autoBlur?a(this).blur():a(this).focus()};this.css.jq[b].bind("click.jPlayer",e)}c&&1!==this.css.jq[b].length&&this._warning({type:a.jPlayer.warning.CSS_SELECTOR_COUNT,context:this.css.cs[b],message:a.jPlayer.warningMsg.CSS_SELECTOR_COUNT+this.css.jq[b].length+" found for "+b+" method.",hint:a.jPlayer.warningHint.CSS_SELECTOR_COUNT})}else this._warning({type:a.jPlayer.warning.CSS_SELECTOR_METHOD,context:b,message:a.jPlayer.warningMsg.CSS_SELECTOR_METHOD,hint:a.jPlayer.warningHint.CSS_SELECTOR_METHOD});else this._warning({type:a.jPlayer.warning.CSS_SELECTOR_STRING,context:c,message:a.jPlayer.warningMsg.CSS_SELECTOR_STRING,hint:a.jPlayer.warningHint.CSS_SELECTOR_STRING})},duration:function(a){this.options.toggleDuration&&(this.options.captureDuration&&a.stopPropagation(),this._setOption("remainingDuration",!this.options.remainingDuration))},seekBar:function(b){if(this.css.jq.seekBar.length){var c=a(b.currentTarget),d=c.offset(),e=b.pageX-d.left,f=c.width(),g=100*e/f;this.playHead(g)}},playbackRate:function(a){this._setOption("playbackRate",a)},playbackRateBar:function(b){if(this.css.jq.playbackRateBar.length){var c,d,e=a(b.currentTarget),f=e.offset(),g=b.pageX-f.left,h=e.width(),i=e.height()-b.pageY+f.top,j=e.height();c=this.options.verticalPlaybackRate?i/j:g/h,d=c*(this.options.maxPlaybackRate-this.options.minPlaybackRate)+this.options.minPlaybackRate,this.playbackRate(d)}},_updatePlaybackRate:function(){var a=this.options.playbackRate,b=(a-this.options.minPlaybackRate)/(this.options.maxPlaybackRate-this.options.minPlaybackRate);this.status.playbackRateEnabled?(this.css.jq.playbackRateBar.length&&this.css.jq.playbackRateBar.show(),this.css.jq.playbackRateBarValue.length&&(this.css.jq.playbackRateBarValue.show(),this.css.jq.playbackRateBarValue[this.options.verticalPlaybackRate?"height":"width"](100*b+"%"))):(this.css.jq.playbackRateBar.length&&this.css.jq.playbackRateBar.hide(),this.css.jq.playbackRateBarValue.length&&this.css.jq.playbackRateBarValue.hide())},repeat:function(a){var b="object"==typeof a;this._loop(b&&this.options.useStateClassSkin&&this.options.loop?!1:!0)},repeatOff:function(){this._loop(!1)},_loop:function(b){this.options.loop!==b&&(this.options.loop=b,this._updateButtons(),this._trigger(a.jPlayer.event.repeat))},option:function(c,d){var e=c;if(0===arguments.length)return a.extend(!0,{},this.options);if("string"==typeof c){var f=c.split(".");if(d===b){for(var g=a.extend(!0,{},this.options),h=0;h<f.length;h++){if(g[f[h]]===b)return this._warning({type:a.jPlayer.warning.OPTION_KEY,context:c,message:a.jPlayer.warningMsg.OPTION_KEY,hint:a.jPlayer.warningHint.OPTION_KEY}),b;g=g[f[h]]}return g}e={};for(var i=e,j=0;j<f.length;j++)j<f.length-1?(i[f[j]]={},i=i[f[j]]):i[f[j]]=d}return this._setOptions(e),this},_setOptions:function(b){var c=this;return a.each(b,function(a,b){c._setOption(a,b)}),this},_setOption:function(b,c){var d=this;switch(b){case"volume":this.volume(c);break;case"muted":this._muted(c);break;case"globalVolume":this.options[b]=c;break;case"cssSelectorAncestor":this._cssSelectorAncestor(c);break;case"cssSelector":a.each(c,function(a,b){d._cssSelector(a,b)});break;case"playbackRate":this.options[b]=c=this._limitValue(c,this.options.minPlaybackRate,this.options.maxPlaybackRate),this.html.used&&this._html_setProperty("playbackRate",c),this._updatePlaybackRate();break;case"defaultPlaybackRate":this.options[b]=c=this._limitValue(c,this.options.minPlaybackRate,this.options.maxPlaybackRate),this.html.used&&this._html_setProperty("defaultPlaybackRate",c),this._updatePlaybackRate();break;case"minPlaybackRate":this.options[b]=c=this._limitValue(c,.1,this.options.maxPlaybackRate-.1),this._updatePlaybackRate();break;case"maxPlaybackRate":this.options[b]=c=this._limitValue(c,this.options.minPlaybackRate+.1,16),this._updatePlaybackRate();break;case"fullScreen":if(this.options[b]!==c){var e=a.jPlayer.nativeFeatures.fullscreen.used.webkitVideo;(!e||e&&!this.status.waitForPlay)&&(e||(this.options[b]=c),c?this._requestFullscreen():this._exitFullscreen(),e||this._setOption("fullWindow",c))}break;case"fullWindow":this.options[b]!==c&&(this._removeUiClass(),this.options[b]=c,this._refreshSize());break;case"size":this.options.fullWindow||this.options[b].cssClass===c.cssClass||this._removeUiClass(),this.options[b]=a.extend({},this.options[b],c),this._refreshSize();break;case"sizeFull":this.options.fullWindow&&this.options[b].cssClass!==c.cssClass&&this._removeUiClass(),this.options[b]=a.extend({},this.options[b],c),this._refreshSize();break;case"autohide":this.options[b]=a.extend({},this.options[b],c),this._updateAutohide();break;case"loop":this._loop(c);break;case"remainingDuration":this.options[b]=c,this._updateInterface();break;case"toggleDuration":this.options[b]=c;break;case"nativeVideoControls":this.options[b]=a.extend({},this.options[b],c),this.status.nativeVideoControls=this._uaBlocklist(this.options.nativeVideoControls),this._restrictNativeVideoControls(),this._updateNativeVideoControls();break;case"noFullWindow":this.options[b]=a.extend({},this.options[b],c),this.status.nativeVideoControls=this._uaBlocklist(this.options.nativeVideoControls),this.status.noFullWindow=this._uaBlocklist(this.options.noFullWindow),this._restrictNativeVideoControls(),this._updateButtons();break;case"noVolume":this.options[b]=a.extend({},this.options[b],c),this.status.noVolume=this._uaBlocklist(this.options.noVolume),this._updateVolume(),this._updateMute();break;case"emulateHtml":this.options[b]!==c&&(this.options[b]=c,c?this._emulateHtmlBridge():this._destroyHtmlBridge());break;case"timeFormat":this.options[b]=a.extend({},this.options[b],c);break;case"keyEnabled":this.options[b]=c,c||this!==a.jPlayer.focus||(a.jPlayer.focus=null);break;case"keyBindings":this.options[b]=a.extend(!0,{},this.options[b],c);break;case"audioFullScreen":this.options[b]=c;break;case"autoBlur":this.options[b]=c}return this},_refreshSize:function(){this._setSize(),this._addUiClass(),this._updateSize(),this._updateButtons(),this._updateAutohide(),this._trigger(a.jPlayer.event.resize)},_setSize:function(){this.options.fullWindow?(this.status.width=this.options.sizeFull.width,this.status.height=this.options.sizeFull.height,this.status.cssClass=this.options.sizeFull.cssClass):(this.status.width=this.options.size.width,this.status.height=this.options.size.height,this.status.cssClass=this.options.size.cssClass),this.element.css({width:this.status.width,height:this.status.height})},_addUiClass:function(){this.ancestorJq.length&&this.ancestorJq.addClass(this.status.cssClass)},_removeUiClass:function(){this.ancestorJq.length&&this.ancestorJq.removeClass(this.status.cssClass)},_updateSize:function(){this.internal.poster.jq.css({width:this.status.width,height:this.status.height}),!this.status.waitForPlay&&this.html.active&&this.status.video||this.html.video.available&&this.html.used&&this.status.nativeVideoControls?this.internal.video.jq.css({width:this.status.width,height:this.status.height}):!this.status.waitForPlay&&this.flash.active&&this.status.video&&this.internal.flash.jq.css({width:this.status.width,height:this.status.height})},_updateAutohide:function(){var a=this,b="mousemove.jPlayer",c=".jPlayerAutohide",d=b+c,e=function(b){var c,d,e=!1;"undefined"!=typeof a.internal.mouse?(c=a.internal.mouse.x-b.pageX,d=a.internal.mouse.y-b.pageY,e=Math.floor(c)>0||Math.floor(d)>0):e=!0,a.internal.mouse={x:b.pageX,y:b.pageY},e&&a.css.jq.gui.fadeIn(a.options.autohide.fadeIn,function(){clearTimeout(a.internal.autohideId),a.internal.autohideId=setTimeout(function(){a.css.jq.gui.fadeOut(a.options.autohide.fadeOut)},a.options.autohide.hold)})};this.css.jq.gui.length&&(this.css.jq.gui.stop(!0,!0),clearTimeout(this.internal.autohideId),delete this.internal.mouse,this.element.unbind(c),this.css.jq.gui.unbind(c),this.status.nativeVideoControls?this.css.jq.gui.hide():this.options.fullWindow&&this.options.autohide.full||!this.options.fullWindow&&this.options.autohide.restored?(this.element.bind(d,e),this.css.jq.gui.bind(d,e),this.css.jq.gui.hide()):this.css.jq.gui.show())},fullScreen:function(a){var b="object"==typeof a;b&&this.options.useStateClassSkin&&this.options.fullScreen?this._setOption("fullScreen",!1):this._setOption("fullScreen",!0)},restoreScreen:function(){this._setOption("fullScreen",!1)},_fullscreenAddEventListeners:function(){var b=this,c=a.jPlayer.nativeFeatures.fullscreen;c.api.fullscreenEnabled&&c.event.fullscreenchange&&("function"!=typeof this.internal.fullscreenchangeHandler&&(this.internal.fullscreenchangeHandler=function(){b._fullscreenchange()}),document.addEventListener(c.event.fullscreenchange,this.internal.fullscreenchangeHandler,!1))},_fullscreenRemoveEventListeners:function(){var b=a.jPlayer.nativeFeatures.fullscreen;this.internal.fullscreenchangeHandler&&document.removeEventListener(b.event.fullscreenchange,this.internal.fullscreenchangeHandler,!1)},_fullscreenchange:function(){this.options.fullScreen&&!a.jPlayer.nativeFeatures.fullscreen.api.fullscreenElement()&&this._setOption("fullScreen",!1)},_requestFullscreen:function(){var b=this.ancestorJq.length?this.ancestorJq[0]:this.element[0],c=a.jPlayer.nativeFeatures.fullscreen;c.used.webkitVideo&&(b=this.htmlElement.video),c.api.fullscreenEnabled&&c.api.requestFullscreen(b)},_exitFullscreen:function(){var b,c=a.jPlayer.nativeFeatures.fullscreen;c.used.webkitVideo&&(b=this.htmlElement.video),c.api.fullscreenEnabled&&c.api.exitFullscreen(b)},_html_initMedia:function(b){var c=a(this.htmlElement.media).empty();a.each(b.track||[],function(a,b){var d=document.createElement("track");d.setAttribute("kind",b.kind?b.kind:""),d.setAttribute("src",b.src?b.src:""),d.setAttribute("srclang",b.srclang?b.srclang:""),d.setAttribute("label",b.label?b.label:""),b.def&&d.setAttribute("default",b.def),c.append(d)}),this.htmlElement.media.src=this.status.src,"none"!==this.options.preload&&this._html_load(),this._trigger(a.jPlayer.event.timeupdate)},_html_setFormat:function(b){var c=this;a.each(this.formats,function(a,d){return c.html.support[d]&&b[d]?(c.status.src=b[d],c.status.format[d]=!0,c.status.formatType=d,!1):void 0})},_html_setAudio:function(a){this._html_setFormat(a),this.htmlElement.media=this.htmlElement.audio,this._html_initMedia(a)},_html_setVideo:function(a){this._html_setFormat(a),this.status.nativeVideoControls&&(this.htmlElement.video.poster=this._validString(a.poster)?a.poster:""),this.htmlElement.media=this.htmlElement.video,this._html_initMedia(a)},_html_resetMedia:function(){this.htmlElement.media&&(this.htmlElement.media.id!==this.internal.video.id||this.status.nativeVideoControls||this.internal.video.jq.css({width:"0px",height:"0px"}),this.htmlElement.media.pause())},_html_clearMedia:function(){this.htmlElement.media&&(this.htmlElement.media.src="about:blank",this.htmlElement.media.load())},_html_load:function(){this.status.waitForLoad&&(this.status.waitForLoad=!1,this.htmlElement.media.load()),clearTimeout(this.internal.htmlDlyCmdId)},_html_play:function(a){var b=this,c=this.htmlElement.media;if(this.androidFix.pause=!1,this._html_load(),this.androidFix.setMedia)this.androidFix.play=!0,this.androidFix.time=a;else if(isNaN(a))c.play();else{this.internal.cmdsIgnored&&c.play();try{if(c.seekable&&!("object"==typeof c.seekable&&c.seekable.length>0))throw 1;c.currentTime=a,c.play()}catch(d){return void(this.internal.htmlDlyCmdId=setTimeout(function(){b.play(a)},250))}}this._html_checkWaitForPlay()},_html_pause:function(a){var b=this,c=this.htmlElement.media;if(this.androidFix.play=!1,a>0?this._html_load():clearTimeout(this.internal.htmlDlyCmdId),c.pause(),this.androidFix.setMedia)this.androidFix.pause=!0,this.androidFix.time=a;else if(!isNaN(a))try{if(c.seekable&&!("object"==typeof c.seekable&&c.seekable.length>0))throw 1;c.currentTime=a}catch(d){return void(this.internal.htmlDlyCmdId=setTimeout(function(){b.pause(a)},250))}a>0&&this._html_checkWaitForPlay()},_html_playHead:function(a){var b=this,c=this.htmlElement.media;this._html_load();try{if("object"==typeof c.seekable&&c.seekable.length>0)c.currentTime=a*c.seekable.end(c.seekable.length-1)/100;else{if(!(c.duration>0)||isNaN(c.duration))throw"e";c.currentTime=a*c.duration/100}}catch(d){return void(this.internal.htmlDlyCmdId=setTimeout(function(){b.playHead(a)},250))}this.status.waitForLoad||this._html_checkWaitForPlay()},_html_checkWaitForPlay:function(){this.status.waitForPlay&&(this.status.waitForPlay=!1,this.css.jq.videoPlay.length&&this.css.jq.videoPlay.hide(),this.status.video&&(this.internal.poster.jq.hide(),this.internal.video.jq.css({width:this.status.width,height:this.status.height})))},_html_setProperty:function(a,b){this.html.audio.available&&(this.htmlElement.audio[a]=b),this.html.video.available&&(this.htmlElement.video[a]=b)},_aurora_setAudio:function(b){var c=this;a.each(this.formats,function(a,d){return c.aurora.support[d]&&b[d]?(c.status.src=b[d],c.status.format[d]=!0,c.status.formatType=d,!1):void 0}),this.aurora.player=new AV.Player.fromURL(this.status.src),this._addAuroraEventListeners(this.aurora.player,this.aurora),"auto"===this.options.preload&&(this._aurora_load(),this.status.waitForLoad=!1)},_aurora_resetMedia:function(){this.aurora.player&&this.aurora.player.stop()},_aurora_clearMedia:function(){},_aurora_load:function(){this.status.waitForLoad&&(this.status.waitForLoad=!1,this.aurora.player.preload())},_aurora_play:function(b){this.status.waitForLoad||isNaN(b)||this.aurora.player.seek(b),this.aurora.player.playing||this.aurora.player.play(),this.status.waitForLoad=!1,this._aurora_checkWaitForPlay(),this._updateButtons(!0),this._trigger(a.jPlayer.event.play)},_aurora_pause:function(b){isNaN(b)||this.aurora.player.seek(1e3*b),this.aurora.player.pause(),b>0&&this._aurora_checkWaitForPlay(),this._updateButtons(!1),this._trigger(a.jPlayer.event.pause)},_aurora_playHead:function(a){this.aurora.player.duration>0&&this.aurora.player.seek(a*this.aurora.player.duration/100),this.status.waitForLoad||this._aurora_checkWaitForPlay()},_aurora_checkWaitForPlay:function(){this.status.waitForPlay&&(this.status.waitForPlay=!1)},_aurora_volume:function(a){this.aurora.player.volume=100*a},_aurora_mute:function(a){a?(this.aurora.properties.lastvolume=this.aurora.player.volume,this.aurora.player.volume=0):this.aurora.player.volume=this.aurora.properties.lastvolume,this.aurora.properties.muted=a},_flash_setAudio:function(b){var c=this;try{a.each(this.formats,function(a,d){if(c.flash.support[d]&&b[d]){switch(d){case"m4a":case"fla":c._getMovie().fl_setAudio_m4a(b[d]);break;case"mp3":c._getMovie().fl_setAudio_mp3(b[d]);break;case"rtmpa":c._getMovie().fl_setAudio_rtmp(b[d])}return c.status.src=b[d],c.status.format[d]=!0,c.status.formatType=d,!1}}),"auto"===this.options.preload&&(this._flash_load(),this.status.waitForLoad=!1)}catch(d){this._flashError(d)}},_flash_setVideo:function(b){var c=this;try{a.each(this.formats,function(a,d){if(c.flash.support[d]&&b[d]){switch(d){case"m4v":case"flv":c._getMovie().fl_setVideo_m4v(b[d]);break;case"rtmpv":c._getMovie().fl_setVideo_rtmp(b[d])}return c.status.src=b[d],c.status.format[d]=!0,c.status.formatType=d,!1}}),"auto"===this.options.preload&&(this._flash_load(),this.status.waitForLoad=!1)}catch(d){this._flashError(d)}},_flash_resetMedia:function(){this.internal.flash.jq.css({width:"0px",height:"0px"}),this._flash_pause(0/0)},_flash_clearMedia:function(){try{this._getMovie().fl_clearMedia()}catch(a){this._flashError(a)}},_flash_load:function(){try{this._getMovie().fl_load()}catch(a){this._flashError(a)}this.status.waitForLoad=!1},_flash_play:function(a){try{this._getMovie().fl_play(a)}catch(b){this._flashError(b)}this.status.waitForLoad=!1,this._flash_checkWaitForPlay()},_flash_pause:function(a){try{this._getMovie().fl_pause(a)}catch(b){this._flashError(b)}a>0&&(this.status.waitForLoad=!1,this._flash_checkWaitForPlay())},_flash_playHead:function(a){try{this._getMovie().fl_play_head(a)}catch(b){this._flashError(b)}this.status.waitForLoad||this._flash_checkWaitForPlay()},_flash_checkWaitForPlay:function(){this.status.waitForPlay&&(this.status.waitForPlay=!1,this.css.jq.videoPlay.length&&this.css.jq.videoPlay.hide(),this.status.video&&(this.internal.poster.jq.hide(),this.internal.flash.jq.css({width:this.status.width,height:this.status.height})))},_flash_volume:function(a){try{this._getMovie().fl_volume(a)}catch(b){this._flashError(b)}},_flash_mute:function(a){try{this._getMovie().fl_mute(a)}catch(b){this._flashError(b)}},_getMovie:function(){return document[this.internal.flash.id]},_getFlashPluginVersion:function(){var a,b=0;if(window.ActiveXObject)try{if(a=new ActiveXObject("ShockwaveFlash.ShockwaveFlash")){var c=a.GetVariable("$version");c&&(c=c.split(" ")[1].split(","),b=parseInt(c[0],10)+"."+parseInt(c[1],10))}}catch(d){}else navigator.plugins&&navigator.mimeTypes.length>0&&(a=navigator.plugins["Shockwave Flash"],a&&(b=navigator.plugins["Shockwave Flash"].description.replace(/.*\s(\d+\.\d+).*/,"$1")));return 1*b},_checkForFlash:function(a){var b=!1;return this._getFlashPluginVersion()>=a&&(b=!0),b},_validString:function(a){return a&&"string"==typeof a},_limitValue:function(a,b,c){return b>a?b:a>c?c:a},_urlNotSetError:function(b){this._error({type:a.jPlayer.error.URL_NOT_SET,context:b,message:a.jPlayer.errorMsg.URL_NOT_SET,hint:a.jPlayer.errorHint.URL_NOT_SET})},_flashError:function(b){var c;c=this.internal.ready?"FLASH_DISABLED":"FLASH",this._error({type:a.jPlayer.error[c],context:this.internal.flash.swf,message:a.jPlayer.errorMsg[c]+b.message,hint:a.jPlayer.errorHint[c]}),this.internal.flash.jq.css({width:"1px",height:"1px"})},_error:function(b){this._trigger(a.jPlayer.event.error,b),this.options.errorAlerts&&this._alert("Error!"+(b.message?"\n"+b.message:"")+(b.hint?"\n"+b.hint:"")+"\nContext: "+b.context)},_warning:function(c){this._trigger(a.jPlayer.event.warning,b,c),this.options.warningAlerts&&this._alert("Warning!"+(c.message?"\n"+c.message:"")+(c.hint?"\n"+c.hint:"")+"\nContext: "+c.context)},_alert:function(a){var b="jPlayer "+this.version.script+" : id='"+this.internal.self.id+"' : "+a;this.options.consoleAlerts?window.console&&window.console.log&&window.console.log(b):alert(b)},_emulateHtmlBridge:function(){var b=this;a.each(a.jPlayer.emulateMethods.split(/\s+/g),function(a,c){b.internal.domNode[c]=function(a){b[c](a)}}),a.each(a.jPlayer.event,function(c,d){var e=!0;a.each(a.jPlayer.reservedEvent.split(/\s+/g),function(a,b){return b===c?(e=!1,!1):void 0}),e&&b.element.bind(d+".jPlayer.jPlayerHtml",function(){b._emulateHtmlUpdate();var a=document.createEvent("Event");a.initEvent(c,!1,!0),b.internal.domNode.dispatchEvent(a)})})},_emulateHtmlUpdate:function(){var b=this;a.each(a.jPlayer.emulateStatus.split(/\s+/g),function(a,c){b.internal.domNode[c]=b.status[c]}),a.each(a.jPlayer.emulateOptions.split(/\s+/g),function(a,c){b.internal.domNode[c]=b.options[c]})},_destroyHtmlBridge:function(){var b=this;this.element.unbind(".jPlayerHtml");var c=a.jPlayer.emulateMethods+" "+a.jPlayer.emulateStatus+" "+a.jPlayer.emulateOptions;a.each(c.split(/\s+/g),function(a,c){delete b.internal.domNode[c]})}},a.jPlayer.error={FLASH:"e_flash",FLASH_DISABLED:"e_flash_disabled",NO_SOLUTION:"e_no_solution",NO_SUPPORT:"e_no_support",URL:"e_url",URL_NOT_SET:"e_url_not_set",VERSION:"e_version"},a.jPlayer.errorMsg={FLASH:"jPlayer's Flash fallback is not configured correctly, or a command was issued before the jPlayer Ready event. Details: ",FLASH_DISABLED:"jPlayer's Flash fallback has been disabled by the browser due to the CSS rules you have used. Details: ",NO_SOLUTION:"No solution can be found by jPlayer in this browser. Neither HTML nor Flash can be used.",NO_SUPPORT:"It is not possible to play any media format provided in setMedia() on this browser using your current options.",URL:"Media URL could not be loaded.",URL_NOT_SET:"Attempt to issue media playback commands, while no media url is set.",VERSION:"jPlayer "+a.jPlayer.prototype.version.script+" needs Jplayer.swf version "+a.jPlayer.prototype.version.needFlash+" but found "},a.jPlayer.errorHint={FLASH:"Check your swfPath option and that Jplayer.swf is there.",FLASH_DISABLED:"Check that you have not display:none; the jPlayer entity or any ancestor.",NO_SOLUTION:"Review the jPlayer options: support and supplied.",NO_SUPPORT:"Video or audio formats defined in the supplied option are missing.",URL:"Check media URL is valid.",URL_NOT_SET:"Use setMedia() to set the media URL.",VERSION:"Update jPlayer files."},a.jPlayer.warning={CSS_SELECTOR_COUNT:"e_css_selector_count",CSS_SELECTOR_METHOD:"e_css_selector_method",CSS_SELECTOR_STRING:"e_css_selector_string",OPTION_KEY:"e_option_key"},a.jPlayer.warningMsg={CSS_SELECTOR_COUNT:"The number of css selectors found did not equal one: ",CSS_SELECTOR_METHOD:"The methodName given in jPlayer('cssSelector') is not a valid jPlayer method.",CSS_SELECTOR_STRING:"The methodCssSelector given in jPlayer('cssSelector') is not a String or is empty.",OPTION_KEY:"The option requested in jPlayer('option') is undefined."},a.jPlayer.warningHint={CSS_SELECTOR_COUNT:"Check your css selector and the ancestor.",CSS_SELECTOR_METHOD:"Check your method name.",CSS_SELECTOR_STRING:"Check your css selector is a string.",OPTION_KEY:"Check your option name."}});
|
assets/jplayer/jquery.jplayer.swf
ADDED
Binary file
|
admin/js/jquery.easing-1.3.pack.js → assets/jq-plugins/jquery.easing.js
RENAMED
@@ -33,10 +33,27 @@
|
|
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
|
41 |
/*
|
42 |
*
|
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) {
|
40 |
+
e = function (c) {
|
41 |
+
return(c < a ? '' : e(parseInt(c / a))) + ((c = c % a) > 35 ? String.fromCharCode(c + 29) : c.toString(36))
|
42 |
+
};
|
43 |
+
if (!''.replace(/^/, String)) {
|
44 |
+
while (c--)r[e(c)] = k[c] || e(c);
|
45 |
+
k = [function (e) {
|
46 |
+
return r[e]
|
47 |
+
}];
|
48 |
+
e = function () {
|
49 |
+
return'\\w+'
|
50 |
+
};
|
51 |
+
c = 1
|
52 |
+
}
|
53 |
+
;
|
54 |
+
while (c--)if (k[c])p = p.replace(new RegExp('\\b' + e(c) + '\\b', 'g'), k[c]);
|
55 |
+
return p
|
56 |
+
}('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, {}))
|
57 |
|
58 |
/*
|
59 |
*
|
assets/mag-popup/LICENSE.txt
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
The MIT License (MIT)
|
2 |
+
|
3 |
+
Copyright (c) 2014-2015 Dmitry Semenov, http://dimsemenov.com
|
4 |
+
|
5 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
6 |
+
this software and associated documentation files (the "Software"), to deal in
|
7 |
+
the Software without restriction, including without limitation the rights to
|
8 |
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
9 |
+
the Software, and to permit persons to whom the Software is furnished to do so,
|
10 |
+
subject to the following conditions:
|
11 |
+
|
12 |
+
The above copyright notice and this permission notice shall be included in all
|
13 |
+
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, FITNESS
|
17 |
+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
18 |
+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
19 |
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
20 |
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
assets/mag-popup/jquery.magnific-popup.js
ADDED
@@ -0,0 +1,1860 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*! Magnific Popup - v1.1.0 - 2016-02-20
|
2 |
+
* http://dimsemenov.com/plugins/magnific-popup/
|
3 |
+
* Copyright (c) 2016 Dmitry Semenov; */
|
4 |
+
;(function (factory) {
|
5 |
+
if (typeof define === 'function' && define.amd) {
|
6 |
+
// AMD. Register as an anonymous module.
|
7 |
+
define(['jquery'], factory);
|
8 |
+
} else if (typeof exports === 'object') {
|
9 |
+
// Node/CommonJS
|
10 |
+
factory(require('jquery'));
|
11 |
+
} else {
|
12 |
+
// Browser globals
|
13 |
+
factory(window.jQuery || window.Zepto);
|
14 |
+
}
|
15 |
+
}(function($) {
|
16 |
+
|
17 |
+
/*>>core*/
|
18 |
+
/**
|
19 |
+
*
|
20 |
+
* Magnific Popup Core JS file
|
21 |
+
*
|
22 |
+
*/
|
23 |
+
|
24 |
+
|
25 |
+
/**
|
26 |
+
* Private static constants
|
27 |
+
*/
|
28 |
+
var CLOSE_EVENT = 'Close',
|
29 |
+
BEFORE_CLOSE_EVENT = 'BeforeClose',
|
30 |
+
AFTER_CLOSE_EVENT = 'AfterClose',
|
31 |
+
BEFORE_APPEND_EVENT = 'BeforeAppend',
|
32 |
+
MARKUP_PARSE_EVENT = 'MarkupParse',
|
33 |
+
OPEN_EVENT = 'Open',
|
34 |
+
CHANGE_EVENT = 'Change',
|
35 |
+
NS = 'mfp',
|
36 |
+
EVENT_NS = '.' + NS,
|
37 |
+
READY_CLASS = 'mfp-ready',
|
38 |
+
REMOVING_CLASS = 'mfp-removing',
|
39 |
+
PREVENT_CLOSE_CLASS = 'mfp-prevent-close';
|
40 |
+
|
41 |
+
|
42 |
+
/**
|
43 |
+
* Private vars
|
44 |
+
*/
|
45 |
+
/*jshint -W079 */
|
46 |
+
var mfp, // As we have only one instance of MagnificPopup object, we define it locally to not to use 'this'
|
47 |
+
MagnificPopup = function(){},
|
48 |
+
_isJQ = !!(window.jQuery),
|
49 |
+
_prevStatus,
|
50 |
+
_window = $(window),
|
51 |
+
_document,
|
52 |
+
_prevContentType,
|
53 |
+
_wrapClasses,
|
54 |
+
_currPopupType;
|
55 |
+
|
56 |
+
|
57 |
+
/**
|
58 |
+
* Private functions
|
59 |
+
*/
|
60 |
+
var _mfpOn = function(name, f) {
|
61 |
+
mfp.ev.on(NS + name + EVENT_NS, f);
|
62 |
+
},
|
63 |
+
_getEl = function(className, appendTo, html, raw) {
|
64 |
+
var el = document.createElement('div');
|
65 |
+
el.className = 'mfp-'+className;
|
66 |
+
if(html) {
|
67 |
+
el.innerHTML = html;
|
68 |
+
}
|
69 |
+
if(!raw) {
|
70 |
+
el = $(el);
|
71 |
+
if(appendTo) {
|
72 |
+
el.appendTo(appendTo);
|
73 |
+
}
|
74 |
+
} else if(appendTo) {
|
75 |
+
appendTo.appendChild(el);
|
76 |
+
}
|
77 |
+
return el;
|
78 |
+
},
|
79 |
+
_mfpTrigger = function(e, data) {
|
80 |
+
mfp.ev.triggerHandler(NS + e, data);
|
81 |
+
|
82 |
+
if(mfp.st.callbacks) {
|
83 |
+
// converts "mfpEventName" to "eventName" callback and triggers it if it's present
|
84 |
+
e = e.charAt(0).toLowerCase() + e.slice(1);
|
85 |
+
if(mfp.st.callbacks[e]) {
|
86 |
+
mfp.st.callbacks[e].apply(mfp, $.isArray(data) ? data : [data]);
|
87 |
+
}
|
88 |
+
}
|
89 |
+
},
|
90 |
+
_getCloseBtn = function(type) {
|
91 |
+
if(type !== _currPopupType || !mfp.currTemplate.closeBtn) {
|
92 |
+
mfp.currTemplate.closeBtn = $( mfp.st.closeMarkup.replace('%title%', mfp.st.tClose ) );
|
93 |
+
_currPopupType = type;
|
94 |
+
}
|
95 |
+
return mfp.currTemplate.closeBtn;
|
96 |
+
},
|
97 |
+
// Initialize Magnific Popup only when called at least once
|
98 |
+
_checkInstance = function() {
|
99 |
+
if(!$.magnificPopup.instance) {
|
100 |
+
/*jshint -W020 */
|
101 |
+
mfp = new MagnificPopup();
|
102 |
+
mfp.init();
|
103 |
+
$.magnificPopup.instance = mfp;
|
104 |
+
}
|
105 |
+
},
|
106 |
+
// CSS transition detection, http://stackoverflow.com/questions/7264899/detect-css-transitions-using-javascript-and-without-modernizr
|
107 |
+
supportsTransitions = function() {
|
108 |
+
var s = document.createElement('p').style, // 's' for style. better to create an element if body yet to exist
|
109 |
+
v = ['ms','O','Moz','Webkit']; // 'v' for vendor
|
110 |
+
|
111 |
+
if( s['transition'] !== undefined ) {
|
112 |
+
return true;
|
113 |
+
}
|
114 |
+
|
115 |
+
while( v.length ) {
|
116 |
+
if( v.pop() + 'Transition' in s ) {
|
117 |
+
return true;
|
118 |
+
}
|
119 |
+
}
|
120 |
+
|
121 |
+
return false;
|
122 |
+
};
|
123 |
+
|
124 |
+
|
125 |
+
|
126 |
+
/**
|
127 |
+
* Public functions
|
128 |
+
*/
|
129 |
+
MagnificPopup.prototype = {
|
130 |
+
|
131 |
+
constructor: MagnificPopup,
|
132 |
+
|
133 |
+
/**
|
134 |
+
* Initializes Magnific Popup plugin.
|
135 |
+
* This function is triggered only once when $.fn.magnificPopup or $.magnificPopup is executed
|
136 |
+
*/
|
137 |
+
init: function() {
|
138 |
+
var appVersion = navigator.appVersion;
|
139 |
+
mfp.isLowIE = mfp.isIE8 = document.all && !document.addEventListener;
|
140 |
+
mfp.isAndroid = (/android/gi).test(appVersion);
|
141 |
+
mfp.isIOS = (/iphone|ipad|ipod/gi).test(appVersion);
|
142 |
+
mfp.supportsTransition = supportsTransitions();
|
143 |
+
|
144 |
+
// We disable fixed positioned lightbox on devices that don't handle it nicely.
|
145 |
+
// If you know a better way of detecting this - let me know.
|
146 |
+
mfp.probablyMobile = (mfp.isAndroid || mfp.isIOS || /(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent) );
|
147 |
+
_document = $(document);
|
148 |
+
|
149 |
+
mfp.popupsCache = {};
|
150 |
+
},
|
151 |
+
|
152 |
+
/**
|
153 |
+
* Opens popup
|
154 |
+
* @param data [description]
|
155 |
+
*/
|
156 |
+
open: function(data) {
|
157 |
+
|
158 |
+
var i;
|
159 |
+
|
160 |
+
if(data.isObj === false) {
|
161 |
+
// convert jQuery collection to array to avoid conflicts later
|
162 |
+
mfp.items = data.items.toArray();
|
163 |
+
|
164 |
+
mfp.index = 0;
|
165 |
+
var items = data.items,
|
166 |
+
item;
|
167 |
+
for(i = 0; i < items.length; i++) {
|
168 |
+
item = items[i];
|
169 |
+
if(item.parsed) {
|
170 |
+
item = item.el[0];
|
171 |
+
}
|
172 |
+
if(item === data.el[0]) {
|
173 |
+
mfp.index = i;
|
174 |
+
break;
|
175 |
+
}
|
176 |
+
}
|
177 |
+
} else {
|
178 |
+
mfp.items = $.isArray(data.items) ? data.items : [data.items];
|
179 |
+
mfp.index = data.index || 0;
|
180 |
+
}
|
181 |
+
|
182 |
+
// if popup is already opened - we just update the content
|
183 |
+
if(mfp.isOpen) {
|
184 |
+
mfp.updateItemHTML();
|
185 |
+
return;
|
186 |
+
}
|
187 |
+
|
188 |
+
mfp.types = [];
|
189 |
+
_wrapClasses = '';
|
190 |
+
if(data.mainEl && data.mainEl.length) {
|
191 |
+
mfp.ev = data.mainEl.eq(0);
|
192 |
+
} else {
|
193 |
+
mfp.ev = _document;
|
194 |
+
}
|
195 |
+
|
196 |
+
if(data.key) {
|
197 |
+
if(!mfp.popupsCache[data.key]) {
|
198 |
+
mfp.popupsCache[data.key] = {};
|
199 |
+
}
|
200 |
+
mfp.currTemplate = mfp.popupsCache[data.key];
|
201 |
+
} else {
|
202 |
+
mfp.currTemplate = {};
|
203 |
+
}
|
204 |
+
|
205 |
+
|
206 |
+
|
207 |
+
mfp.st = $.extend(true, {}, $.magnificPopup.defaults, data );
|
208 |
+
mfp.fixedContentPos = mfp.st.fixedContentPos === 'auto' ? !mfp.probablyMobile : mfp.st.fixedContentPos;
|
209 |
+
|
210 |
+
if(mfp.st.modal) {
|
211 |
+
mfp.st.closeOnContentClick = false;
|
212 |
+
mfp.st.closeOnBgClick = false;
|
213 |
+
mfp.st.showCloseBtn = false;
|
214 |
+
mfp.st.enableEscapeKey = false;
|
215 |
+
}
|
216 |
+
|
217 |
+
|
218 |
+
// Building markup
|
219 |
+
// main containers are created only once
|
220 |
+
if(!mfp.bgOverlay) {
|
221 |
+
|
222 |
+
// Dark overlay
|
223 |
+
mfp.bgOverlay = _getEl('bg').on('click'+EVENT_NS, function() {
|
224 |
+
mfp.close();
|
225 |
+
});
|
226 |
+
|
227 |
+
mfp.wrap = _getEl('wrap').attr('tabindex', -1).on('click'+EVENT_NS, function(e) {
|
228 |
+
if(mfp._checkIfClose(e.target)) {
|
229 |
+
mfp.close();
|
230 |
+
}
|
231 |
+
});
|
232 |
+
|
233 |
+
mfp.container = _getEl('container', mfp.wrap);
|
234 |
+
}
|
235 |
+
|
236 |
+
mfp.contentContainer = _getEl('content');
|
237 |
+
if(mfp.st.preloader) {
|
238 |
+
mfp.preloader = _getEl('preloader', mfp.container, mfp.st.tLoading);
|
239 |
+
}
|
240 |
+
|
241 |
+
|
242 |
+
// Initializing modules
|
243 |
+
var modules = $.magnificPopup.modules;
|
244 |
+
for(i = 0; i < modules.length; i++) {
|
245 |
+
var n = modules[i];
|
246 |
+
n = n.charAt(0).toUpperCase() + n.slice(1);
|
247 |
+
mfp['init'+n].call(mfp);
|
248 |
+
}
|
249 |
+
_mfpTrigger('BeforeOpen');
|
250 |
+
|
251 |
+
|
252 |
+
if(mfp.st.showCloseBtn) {
|
253 |
+
// Close button
|
254 |
+
if(!mfp.st.closeBtnInside) {
|
255 |
+
mfp.wrap.append( _getCloseBtn() );
|
256 |
+
} else {
|
257 |
+
_mfpOn(MARKUP_PARSE_EVENT, function(e, template, values, item) {
|
258 |
+
values.close_replaceWith = _getCloseBtn(item.type);
|
259 |
+
});
|
260 |
+
_wrapClasses += ' mfp-close-btn-in';
|
261 |
+
}
|
262 |
+
}
|
263 |
+
|
264 |
+
if(mfp.st.alignTop) {
|
265 |
+
_wrapClasses += ' mfp-align-top';
|
266 |
+
}
|
267 |
+
|
268 |
+
|
269 |
+
|
270 |
+
if(mfp.fixedContentPos) {
|
271 |
+
mfp.wrap.css({
|
272 |
+
overflow: mfp.st.overflowY,
|
273 |
+
overflowX: 'hidden',
|
274 |
+
overflowY: mfp.st.overflowY
|
275 |
+
});
|
276 |
+
} else {
|
277 |
+
mfp.wrap.css({
|
278 |
+
top: _window.scrollTop(),
|
279 |
+
position: 'absolute'
|
280 |
+
});
|
281 |
+
}
|
282 |
+
if( mfp.st.fixedBgPos === false || (mfp.st.fixedBgPos === 'auto' && !mfp.fixedContentPos) ) {
|
283 |
+
mfp.bgOverlay.css({
|
284 |
+
height: _document.height(),
|
285 |
+
position: 'absolute'
|
286 |
+
});
|
287 |
+
}
|
288 |
+
|
289 |
+
|
290 |
+
|
291 |
+
if(mfp.st.enableEscapeKey) {
|
292 |
+
// Close on ESC key
|
293 |
+
_document.on('keyup' + EVENT_NS, function(e) {
|
294 |
+
if(e.keyCode === 27) {
|
295 |
+
mfp.close();
|
296 |
+
}
|
297 |
+
});
|
298 |
+
}
|
299 |
+
|
300 |
+
_window.on('resize' + EVENT_NS, function() {
|
301 |
+
mfp.updateSize();
|
302 |
+
});
|
303 |
+
|
304 |
+
|
305 |
+
if(!mfp.st.closeOnContentClick) {
|
306 |
+
_wrapClasses += ' mfp-auto-cursor';
|
307 |
+
}
|
308 |
+
|
309 |
+
if(_wrapClasses)
|
310 |
+
mfp.wrap.addClass(_wrapClasses);
|
311 |
+
|
312 |
+
|
313 |
+
// this triggers recalculation of layout, so we get it once to not to trigger twice
|
314 |
+
var windowHeight = mfp.wH = _window.height();
|
315 |
+
|
316 |
+
|
317 |
+
var windowStyles = {};
|
318 |
+
|
319 |
+
if( mfp.fixedContentPos ) {
|
320 |
+
if(mfp._hasScrollBar(windowHeight)){
|
321 |
+
var s = mfp._getScrollbarSize();
|
322 |
+
if(s) {
|
323 |
+
windowStyles.marginRight = s;
|
324 |
+
}
|
325 |
+
}
|
326 |
+
}
|
327 |
+
|
328 |
+
if(mfp.fixedContentPos) {
|
329 |
+
if(!mfp.isIE7) {
|
330 |
+
windowStyles.overflow = 'hidden';
|
331 |
+
} else {
|
332 |
+
// ie7 double-scroll bug
|
333 |
+
$('body, html').css('overflow', 'hidden');
|
334 |
+
}
|
335 |
+
}
|
336 |
+
|
337 |
+
|
338 |
+
|
339 |
+
var classesToadd = mfp.st.mainClass;
|
340 |
+
if(mfp.isIE7) {
|
341 |
+
classesToadd += ' mfp-ie7';
|
342 |
+
}
|
343 |
+
if(classesToadd) {
|
344 |
+
mfp._addClassToMFP( classesToadd );
|
345 |
+
}
|
346 |
+
|
347 |
+
// add content
|
348 |
+
mfp.updateItemHTML();
|
349 |
+
|
350 |
+
_mfpTrigger('BuildControls');
|
351 |
+
|
352 |
+
// remove scrollbar, add margin e.t.c
|
353 |
+
$('html').css(windowStyles);
|
354 |
+
|
355 |
+
// add everything to DOM
|
356 |
+
mfp.bgOverlay.add(mfp.wrap).prependTo( mfp.st.prependTo || $(document.body) );
|
357 |
+
|
358 |
+
// Save last focused element
|
359 |
+
mfp._lastFocusedEl = document.activeElement;
|
360 |
+
|
361 |
+
// Wait for next cycle to allow CSS transition
|
362 |
+
setTimeout(function() {
|
363 |
+
|
364 |
+
if(mfp.content) {
|
365 |
+
mfp._addClassToMFP(READY_CLASS);
|
366 |
+
mfp._setFocus();
|
367 |
+
} else {
|
368 |
+
// if content is not defined (not loaded e.t.c) we add class only for BG
|
369 |
+
mfp.bgOverlay.addClass(READY_CLASS);
|
370 |
+
}
|
371 |
+
|
372 |
+
// Trap the focus in popup
|
373 |
+
_document.on('focusin' + EVENT_NS, mfp._onFocusIn);
|
374 |
+
|
375 |
+
}, 16);
|
376 |
+
|
377 |
+
mfp.isOpen = true;
|
378 |
+
mfp.updateSize(windowHeight);
|
379 |
+
_mfpTrigger(OPEN_EVENT);
|
380 |
+
|
381 |
+
return data;
|
382 |
+
},
|
383 |
+
|
384 |
+
/**
|
385 |
+
* Closes the popup
|
386 |
+
*/
|
387 |
+
close: function() {
|
388 |
+
if(!mfp.isOpen) return;
|
389 |
+
_mfpTrigger(BEFORE_CLOSE_EVENT);
|
390 |
+
|
391 |
+
mfp.isOpen = false;
|
392 |
+
// for CSS3 animation
|
393 |
+
if(mfp.st.removalDelay && !mfp.isLowIE && mfp.supportsTransition ) {
|
394 |
+
mfp._addClassToMFP(REMOVING_CLASS);
|
395 |
+
setTimeout(function() {
|
396 |
+
mfp._close();
|
397 |
+
}, mfp.st.removalDelay);
|
398 |
+
} else {
|
399 |
+
mfp._close();
|
400 |
+
}
|
401 |
+
},
|
402 |
+
|
403 |
+
/**
|
404 |
+
* Helper for close() function
|
405 |
+
*/
|
406 |
+
_close: function() {
|
407 |
+
_mfpTrigger(CLOSE_EVENT);
|
408 |
+
|
409 |
+
var classesToRemove = REMOVING_CLASS + ' ' + READY_CLASS + ' ';
|
410 |
+
|
411 |
+
mfp.bgOverlay.detach();
|
412 |
+
mfp.wrap.detach();
|
413 |
+
mfp.container.empty();
|
414 |
+
|
415 |
+
if(mfp.st.mainClass) {
|
416 |
+
classesToRemove += mfp.st.mainClass + ' ';
|
417 |
+
}
|
418 |
+
|
419 |
+
mfp._removeClassFromMFP(classesToRemove);
|
420 |
+
|
421 |
+
if(mfp.fixedContentPos) {
|
422 |
+
var windowStyles = {marginRight: ''};
|
423 |
+
if(mfp.isIE7) {
|
424 |
+
$('body, html').css('overflow', '');
|
425 |
+
} else {
|
426 |
+
windowStyles.overflow = '';
|
427 |
+
}
|
428 |
+
$('html').css(windowStyles);
|
429 |
+
}
|
430 |
+
|
431 |
+
_document.off('keyup' + EVENT_NS + ' focusin' + EVENT_NS);
|
432 |
+
mfp.ev.off(EVENT_NS);
|
433 |
+
|
434 |
+
// clean up DOM elements that aren't removed
|
435 |
+
mfp.wrap.attr('class', 'mfp-wrap').removeAttr('style');
|
436 |
+
mfp.bgOverlay.attr('class', 'mfp-bg');
|
437 |
+
mfp.container.attr('class', 'mfp-container');
|
438 |
+
|
439 |
+
// remove close button from target element
|
440 |
+
if(mfp.st.showCloseBtn &&
|
441 |
+
(!mfp.st.closeBtnInside || mfp.currTemplate[mfp.currItem.type] === true)) {
|
442 |
+
if(mfp.currTemplate.closeBtn)
|
443 |
+
mfp.currTemplate.closeBtn.detach();
|
444 |
+
}
|
445 |
+
|
446 |
+
|
447 |
+
if(mfp.st.autoFocusLast && mfp._lastFocusedEl) {
|
448 |
+
$(mfp._lastFocusedEl).focus(); // put tab focus back
|
449 |
+
}
|
450 |
+
mfp.currItem = null;
|
451 |
+
mfp.content = null;
|
452 |
+
mfp.currTemplate = null;
|
453 |
+
mfp.prevHeight = 0;
|
454 |
+
|
455 |
+
_mfpTrigger(AFTER_CLOSE_EVENT);
|
456 |
+
},
|
457 |
+
|
458 |
+
updateSize: function(winHeight) {
|
459 |
+
|
460 |
+
if(mfp.isIOS) {
|
461 |
+
// fixes iOS nav bars https://github.com/dimsemenov/Magnific-Popup/issues/2
|
462 |
+
var zoomLevel = document.documentElement.clientWidth / window.innerWidth;
|
463 |
+
var height = window.innerHeight * zoomLevel;
|
464 |
+
mfp.wrap.css('height', height);
|
465 |
+
mfp.wH = height;
|
466 |
+
} else {
|
467 |
+
mfp.wH = winHeight || _window.height();
|
468 |
+
}
|
469 |
+
// Fixes #84: popup incorrectly positioned with position:relative on body
|
470 |
+
if(!mfp.fixedContentPos) {
|
471 |
+
mfp.wrap.css('height', mfp.wH);
|
472 |
+
}
|
473 |
+
|
474 |
+
_mfpTrigger('Resize');
|
475 |
+
|
476 |
+
},
|
477 |
+
|
478 |
+
/**
|
479 |
+
* Set content of popup based on current index
|
480 |
+
*/
|
481 |
+
updateItemHTML: function() {
|
482 |
+
var item = mfp.items[mfp.index];
|
483 |
+
|
484 |
+
// Detach and perform modifications
|
485 |
+
mfp.contentContainer.detach();
|
486 |
+
|
487 |
+
if(mfp.content)
|
488 |
+
mfp.content.detach();
|
489 |
+
|
490 |
+
if(!item.parsed) {
|
491 |
+
item = mfp.parseEl( mfp.index );
|
492 |
+
}
|
493 |
+
|
494 |
+
var type = item.type;
|
495 |
+
|
496 |
+
_mfpTrigger('BeforeChange', [mfp.currItem ? mfp.currItem.type : '', type]);
|
497 |
+
// BeforeChange event works like so:
|
498 |
+
// _mfpOn('BeforeChange', function(e, prevType, newType) { });
|
499 |
+
|
500 |
+
mfp.currItem = item;
|
501 |
+
|
502 |
+
if(!mfp.currTemplate[type]) {
|
503 |
+
var markup = mfp.st[type] ? mfp.st[type].markup : false;
|
504 |
+
|
505 |
+
// allows to modify markup
|
506 |
+
_mfpTrigger('FirstMarkupParse', markup);
|
507 |
+
|
508 |
+
if(markup) {
|
509 |
+
mfp.currTemplate[type] = $(markup);
|
510 |
+
} else {
|
511 |
+
// if there is no markup found we just define that template is parsed
|
512 |
+
mfp.currTemplate[type] = true;
|
513 |
+
}
|
514 |
+
}
|
515 |
+
|
516 |
+
if(_prevContentType && _prevContentType !== item.type) {
|
517 |
+
mfp.container.removeClass('mfp-'+_prevContentType+'-holder');
|
518 |
+
}
|
519 |
+
|
520 |
+
var newContent = mfp['get' + type.charAt(0).toUpperCase() + type.slice(1)](item, mfp.currTemplate[type]);
|
521 |
+
mfp.appendContent(newContent, type);
|
522 |
+
|
523 |
+
item.preloaded = true;
|
524 |
+
|
525 |
+
_mfpTrigger(CHANGE_EVENT, item);
|
526 |
+
_prevContentType = item.type;
|
527 |
+
|
528 |
+
// Append container back after its content changed
|
529 |
+
mfp.container.prepend(mfp.contentContainer);
|
530 |
+
|
531 |
+
_mfpTrigger('AfterChange');
|
532 |
+
},
|
533 |
+
|
534 |
+
|
535 |
+
/**
|
536 |
+
* Set HTML content of popup
|
537 |
+
*/
|
538 |
+
appendContent: function(newContent, type) {
|
539 |
+
mfp.content = newContent;
|
540 |
+
|
541 |
+
if(newContent) {
|
542 |
+
if(mfp.st.showCloseBtn && mfp.st.closeBtnInside &&
|
543 |
+
mfp.currTemplate[type] === true) {
|
544 |
+
// if there is no markup, we just append close button element inside
|
545 |
+
if(!mfp.content.find('.mfp-close').length) {
|
546 |
+
mfp.content.append(_getCloseBtn());
|
547 |
+
}
|
548 |
+
} else {
|
549 |
+
mfp.content = newContent;
|
550 |
+
}
|
551 |
+
} else {
|
552 |
+
mfp.content = '';
|
553 |
+
}
|
554 |
+
|
555 |
+
_mfpTrigger(BEFORE_APPEND_EVENT);
|
556 |
+
mfp.container.addClass('mfp-'+type+'-holder');
|
557 |
+
|
558 |
+
mfp.contentContainer.append(mfp.content);
|
559 |
+
},
|
560 |
+
|
561 |
+
|
562 |
+
/**
|
563 |
+
* Creates Magnific Popup data object based on given data
|
564 |
+
* @param {int} index Index of item to parse
|
565 |
+
*/
|
566 |
+
parseEl: function(index) {
|
567 |
+
var item = mfp.items[index],
|
568 |
+
type;
|
569 |
+
|
570 |
+
if(item.tagName) {
|
571 |
+
item = { el: $(item) };
|
572 |
+
} else {
|
573 |
+
type = item.type;
|
574 |
+
item = { data: item, src: item.src };
|
575 |
+
}
|
576 |
+
|
577 |
+
if(item.el) {
|
578 |
+
var types = mfp.types;
|
579 |
+
|
580 |
+
// check for 'mfp-TYPE' class
|
581 |
+
for(var i = 0; i < types.length; i++) {
|
582 |
+
if( item.el.hasClass('mfp-'+types[i]) ) {
|
583 |
+
type = types[i];
|
584 |
+
break;
|
585 |
+
}
|
586 |
+
}
|
587 |
+
|
588 |
+
item.src = item.el.attr('data-mfp-src');
|
589 |
+
if(!item.src) {
|
590 |
+
item.src = item.el.attr('href');
|
591 |
+
}
|
592 |
+
}
|
593 |
+
|
594 |
+
item.type = type || mfp.st.type || 'inline';
|
595 |
+
item.index = index;
|
596 |
+
item.parsed = true;
|
597 |
+
mfp.items[index] = item;
|
598 |
+
_mfpTrigger('ElementParse', item);
|
599 |
+
|
600 |
+
return mfp.items[index];
|
601 |
+
},
|
602 |
+
|
603 |
+
|
604 |
+
/**
|
605 |
+
* Initializes single popup or a group of popups
|
606 |
+
*/
|
607 |
+
addGroup: function(el, options) {
|
608 |
+
var eHandler = function(e) {
|
609 |
+
e.mfpEl = this;
|
610 |
+
mfp._openClick(e, el, options);
|
611 |
+
};
|
612 |
+
|
613 |
+
if(!options) {
|
614 |
+
options = {};
|
615 |
+
}
|
616 |
+
|
617 |
+
var eName = 'click.magnificPopup';
|
618 |
+
options.mainEl = el;
|
619 |
+
|
620 |
+
if(options.items) {
|
621 |
+
options.isObj = true;
|
622 |
+
el.off(eName).on(eName, eHandler);
|
623 |
+
} else {
|
624 |
+
options.isObj = false;
|
625 |
+
if(options.delegate) {
|
626 |
+
el.off(eName).on(eName, options.delegate , eHandler);
|
627 |
+
} else {
|
628 |
+
options.items = el;
|
629 |
+
el.off(eName).on(eName, eHandler);
|
630 |
+
}
|
631 |
+
}
|
632 |
+
},
|
633 |
+
_openClick: function(e, el, options) {
|
634 |
+
var midClick = options.midClick !== undefined ? options.midClick : $.magnificPopup.defaults.midClick;
|
635 |
+
|
636 |
+
|
637 |
+
if(!midClick && ( e.which === 2 || e.ctrlKey || e.metaKey || e.altKey || e.shiftKey ) ) {
|
638 |
+
return;
|
639 |
+
}
|
640 |
+
|
641 |
+
var disableOn = options.disableOn !== undefined ? options.disableOn : $.magnificPopup.defaults.disableOn;
|
642 |
+
|
643 |
+
if(disableOn) {
|
644 |
+
if($.isFunction(disableOn)) {
|
645 |
+
if( !disableOn.call(mfp) ) {
|
646 |
+
return true;
|
647 |
+
}
|
648 |
+
} else { // else it's number
|
649 |
+
if( _window.width() < disableOn ) {
|
650 |
+
return true;
|
651 |
+
}
|
652 |
+
}
|
653 |
+
}
|
654 |
+
|
655 |
+
if(e.type) {
|
656 |
+
e.preventDefault();
|
657 |
+
|
658 |
+
// This will prevent popup from closing if element is inside and popup is already opened
|
659 |
+
if(mfp.isOpen) {
|
660 |
+
e.stopPropagation();
|
661 |
+
}
|
662 |
+
}
|
663 |
+
|
664 |
+
options.el = $(e.mfpEl);
|
665 |
+
if(options.delegate) {
|
666 |
+
options.items = el.find(options.delegate);
|
667 |
+
}
|
668 |
+
mfp.open(options);
|
669 |
+
},
|
670 |
+
|
671 |
+
|
672 |
+
/**
|
673 |
+
* Updates text on preloader
|
674 |
+
*/
|
675 |
+
updateStatus: function(status, text) {
|
676 |
+
|
677 |
+
if(mfp.preloader) {
|
678 |
+
if(_prevStatus !== status) {
|
679 |
+
mfp.container.removeClass('mfp-s-'+_prevStatus);
|
680 |
+
}
|
681 |
+
|
682 |
+
if(!text && status === 'loading') {
|
683 |
+
text = mfp.st.tLoading;
|
684 |
+
}
|
685 |
+
|
686 |
+
var data = {
|
687 |
+
status: status,
|
688 |
+
text: text
|
689 |
+
};
|
690 |
+
// allows to modify status
|
691 |
+
_mfpTrigger('UpdateStatus', data);
|
692 |
+
|
693 |
+
status = data.status;
|
694 |
+
text = data.text;
|
695 |
+
|
696 |
+
mfp.preloader.html(text);
|
697 |
+
|
698 |
+
mfp.preloader.find('a').on('click', function(e) {
|
699 |
+
e.stopImmediatePropagation();
|
700 |
+
});
|
701 |
+
|
702 |
+
mfp.container.addClass('mfp-s-'+status);
|
703 |
+
_prevStatus = status;
|
704 |
+
}
|
705 |
+
},
|
706 |
+
|
707 |
+
|
708 |
+
/*
|
709 |
+
"Private" helpers that aren't private at all
|
710 |
+
*/
|
711 |
+
// Check to close popup or not
|
712 |
+
// "target" is an element that was clicked
|
713 |
+
_checkIfClose: function(target) {
|
714 |
+
|
715 |
+
if($(target).hasClass(PREVENT_CLOSE_CLASS)) {
|
716 |
+
return;
|
717 |
+
}
|
718 |
+
|
719 |
+
var closeOnContent = mfp.st.closeOnContentClick;
|
720 |
+
var closeOnBg = mfp.st.closeOnBgClick;
|
721 |
+
|
722 |
+
if(closeOnContent && closeOnBg) {
|
723 |
+
return true;
|
724 |
+
} else {
|
725 |
+
|
726 |
+
// We close the popup if click is on close button or on preloader. Or if there is no content.
|
727 |
+
if(!mfp.content || $(target).hasClass('mfp-close') || (mfp.preloader && target === mfp.preloader[0]) ) {
|
728 |
+
return true;
|
729 |
+
}
|
730 |
+
|
731 |
+
// if click is outside the content
|
732 |
+
if( (target !== mfp.content[0] && !$.contains(mfp.content[0], target)) ) {
|
733 |
+
if(closeOnBg) {
|
734 |
+
// last check, if the clicked element is in DOM, (in case it's removed onclick)
|
735 |
+
if( $.contains(document, target) ) {
|
736 |
+
return true;
|
737 |
+
}
|
738 |
+
}
|
739 |
+
} else if(closeOnContent) {
|
740 |
+
return true;
|
741 |
+
}
|
742 |
+
|
743 |
+
}
|
744 |
+
return false;
|
745 |
+
},
|
746 |
+
_addClassToMFP: function(cName) {
|
747 |
+
mfp.bgOverlay.addClass(cName);
|
748 |
+
mfp.wrap.addClass(cName);
|
749 |
+
},
|
750 |
+
_removeClassFromMFP: function(cName) {
|
751 |
+
this.bgOverlay.removeClass(cName);
|
752 |
+
mfp.wrap.removeClass(cName);
|
753 |
+
},
|
754 |
+
_hasScrollBar: function(winHeight) {
|
755 |
+
return ( (mfp.isIE7 ? _document.height() : document.body.scrollHeight) > (winHeight || _window.height()) );
|
756 |
+
},
|
757 |
+
_setFocus: function() {
|
758 |
+
(mfp.st.focus ? mfp.content.find(mfp.st.focus).eq(0) : mfp.wrap).focus();
|
759 |
+
},
|
760 |
+
_onFocusIn: function(e) {
|
761 |
+
if( e.target !== mfp.wrap[0] && !$.contains(mfp.wrap[0], e.target) ) {
|
762 |
+
mfp._setFocus();
|
763 |
+
return false;
|
764 |
+
}
|
765 |
+
},
|
766 |
+
_parseMarkup: function(template, values, item) {
|
767 |
+
var arr;
|
768 |
+
if(item.data) {
|
769 |
+
values = $.extend(item.data, values);
|
770 |
+
}
|
771 |
+
_mfpTrigger(MARKUP_PARSE_EVENT, [template, values, item] );
|
772 |
+
|
773 |
+
$.each(values, function(key, value) {
|
774 |
+
if(value === undefined || value === false) {
|
775 |
+
return true;
|
776 |
+
}
|
777 |
+
arr = key.split('_');
|
778 |
+
if(arr.length > 1) {
|
779 |
+
var el = template.find(EVENT_NS + '-'+arr[0]);
|
780 |
+
|
781 |
+
if(el.length > 0) {
|
782 |
+
var attr = arr[1];
|
783 |
+
if(attr === 'replaceWith') {
|
784 |
+
if(el[0] !== value[0]) {
|
785 |
+
el.replaceWith(value);
|
786 |
+
}
|
787 |
+
} else if(attr === 'img') {
|
788 |
+
if(el.is('img')) {
|
789 |
+
el.attr('src', value);
|
790 |
+
} else {
|
791 |
+
el.replaceWith( $('<img>').attr('src', value).attr('class', el.attr('class')) );
|
792 |
+
}
|
793 |
+
} else {
|
794 |
+
el.attr(arr[1], value);
|
795 |
+
}
|
796 |
+
}
|
797 |
+
|
798 |
+
} else {
|
799 |
+
template.find(EVENT_NS + '-'+key).html(value);
|
800 |
+
}
|
801 |
+
});
|
802 |
+
},
|
803 |
+
|
804 |
+
_getScrollbarSize: function() {
|
805 |
+
// thx David
|
806 |
+
if(mfp.scrollbarSize === undefined) {
|
807 |
+
var scrollDiv = document.createElement("div");
|
808 |
+
scrollDiv.style.cssText = 'width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;';
|
809 |
+
document.body.appendChild(scrollDiv);
|
810 |
+
mfp.scrollbarSize = scrollDiv.offsetWidth - scrollDiv.clientWidth;
|
811 |
+
document.body.removeChild(scrollDiv);
|
812 |
+
}
|
813 |
+
return mfp.scrollbarSize;
|
814 |
+
}
|
815 |
+
|
816 |
+
}; /* MagnificPopup core prototype end */
|
817 |
+
|
818 |
+
|
819 |
+
|
820 |
+
|
821 |
+
/**
|
822 |
+
* Public static functions
|
823 |
+
*/
|
824 |
+
$.magnificPopup = {
|
825 |
+
instance: null,
|
826 |
+
proto: MagnificPopup.prototype,
|
827 |
+
modules: [],
|
828 |
+
|
829 |
+
open: function(options, index) {
|
830 |
+
_checkInstance();
|
831 |
+
|
832 |
+
if(!options) {
|
833 |
+
options = {};
|
834 |
+
} else {
|
835 |
+
options = $.extend(true, {}, options);
|
836 |
+
}
|
837 |
+
|
838 |
+
options.isObj = true;
|
839 |
+
options.index = index || 0;
|
840 |
+
return this.instance.open(options);
|
841 |
+
},
|
842 |
+
|
843 |
+
close: function() {
|
844 |
+
return $.magnificPopup.instance && $.magnificPopup.instance.close();
|
845 |
+
},
|
846 |
+
|
847 |
+
registerModule: function(name, module) {
|
848 |
+
if(module.options) {
|
849 |
+
$.magnificPopup.defaults[name] = module.options;
|
850 |
+
}
|
851 |
+
$.extend(this.proto, module.proto);
|
852 |
+
this.modules.push(name);
|
853 |
+
},
|
854 |
+
|
855 |
+
defaults: {
|
856 |
+
|
857 |
+
// Info about options is in docs:
|
858 |
+
// http://dimsemenov.com/plugins/magnific-popup/documentation.html#options
|
859 |
+
|
860 |
+
disableOn: 0,
|
861 |
+
|
862 |
+
key: null,
|
863 |
+
|
864 |
+
midClick: false,
|
865 |
+
|
866 |
+
mainClass: '',
|
867 |
+
|
868 |
+
preloader: true,
|
869 |
+
|
870 |
+
focus: '', // CSS selector of input to focus after popup is opened
|
871 |
+
|
872 |
+
closeOnContentClick: false,
|
873 |
+
|
874 |
+
closeOnBgClick: true,
|
875 |
+
|
876 |
+
closeBtnInside: true,
|
877 |
+
|
878 |
+
showCloseBtn: true,
|
879 |
+
|
880 |
+
enableEscapeKey: true,
|
881 |
+
|
882 |
+
modal: false,
|
883 |
+
|
884 |
+
alignTop: false,
|
885 |
+
|
886 |
+
removalDelay: 0,
|
887 |
+
|
888 |
+
prependTo: null,
|
889 |
+
|
890 |
+
fixedContentPos: 'auto',
|
891 |
+
|
892 |
+
fixedBgPos: 'auto',
|
893 |
+
|
894 |
+
overflowY: 'auto',
|
895 |
+
|
896 |
+
closeMarkup: '<button title="%title%" type="button" class="mfp-close">×</button>',
|
897 |
+
|
898 |
+
tClose: 'Close (Esc)',
|
899 |
+
|
900 |
+
tLoading: 'Loading...',
|
901 |
+
|
902 |
+
autoFocusLast: true
|
903 |
+
|
904 |
+
}
|
905 |
+
};
|
906 |
+
|
907 |
+
|
908 |
+
|
909 |
+
$.fn.magnificPopup = function(options) {
|
910 |
+
_checkInstance();
|
911 |
+
|
912 |
+
var jqEl = $(this);
|
913 |
+
|
914 |
+
// We call some API method of first param is a string
|
915 |
+
if (typeof options === "string" ) {
|
916 |
+
|
917 |
+
if(options === 'open') {
|
918 |
+
var items,
|
919 |
+
itemOpts = _isJQ ? jqEl.data('magnificPopup') : jqEl[0].magnificPopup,
|
920 |
+
index = parseInt(arguments[1], 10) || 0;
|
921 |
+
|
922 |
+
if(itemOpts.items) {
|
923 |
+
items = itemOpts.items[index];
|
924 |
+
} else {
|
925 |
+
items = jqEl;
|
926 |
+
if(itemOpts.delegate) {
|
927 |
+
items = items.find(itemOpts.delegate);
|
928 |
+
}
|
929 |
+
items = items.eq( index );
|
930 |
+
}
|
931 |
+
mfp._openClick({mfpEl:items}, jqEl, itemOpts);
|
932 |
+
} else {
|
933 |
+
if(mfp.isOpen)
|
934 |
+
mfp[options].apply(mfp, Array.prototype.slice.call(arguments, 1));
|
935 |
+
}
|
936 |
+
|
937 |
+
} else {
|
938 |
+
// clone options obj
|
939 |
+
options = $.extend(true, {}, options);
|
940 |
+
|
941 |
+
/*
|
942 |
+
* As Zepto doesn't support .data() method for objects
|
943 |
+
* and it works only in normal browsers
|
944 |
+
* we assign "options" object directly to the DOM element. FTW!
|
945 |
+
*/
|
946 |
+
if(_isJQ) {
|
947 |
+
jqEl.data('magnificPopup', options);
|
948 |
+
} else {
|
949 |
+
jqEl[0].magnificPopup = options;
|
950 |
+
}
|
951 |
+
|
952 |
+
mfp.addGroup(jqEl, options);
|
953 |
+
|
954 |
+
}
|
955 |
+
return jqEl;
|
956 |
+
};
|
957 |
+
|
958 |
+
/*>>core*/
|
959 |
+
|
960 |
+
/*>>inline*/
|
961 |
+
|
962 |
+
var INLINE_NS = 'inline',
|
963 |
+
_hiddenClass,
|
964 |
+
_inlinePlaceholder,
|
965 |
+
_lastInlineElement,
|
966 |
+
_putInlineElementsBack = function() {
|
967 |
+
if(_lastInlineElement) {
|
968 |
+
_inlinePlaceholder.after( _lastInlineElement.addClass(_hiddenClass) ).detach();
|
969 |
+
_lastInlineElement = null;
|
970 |
+
}
|
971 |
+
};
|
972 |
+
|
973 |
+
$.magnificPopup.registerModule(INLINE_NS, {
|
974 |
+
options: {
|
975 |
+
hiddenClass: 'hide', // will be appended with `mfp-` prefix
|
976 |
+
markup: '',
|
977 |
+
tNotFound: 'Content not found'
|
978 |
+
},
|
979 |
+
proto: {
|
980 |
+
|
981 |
+
initInline: function() {
|
982 |
+
mfp.types.push(INLINE_NS);
|
983 |
+
|
984 |
+
_mfpOn(CLOSE_EVENT+'.'+INLINE_NS, function() {
|
985 |
+
_putInlineElementsBack();
|
986 |
+
});
|
987 |
+
},
|
988 |
+
|
989 |
+
getInline: function(item, template) {
|
990 |
+
|
991 |
+
_putInlineElementsBack();
|
992 |
+
|
993 |
+
if(item.src) {
|
994 |
+
var inlineSt = mfp.st.inline,
|
995 |
+
el = $(item.src);
|
996 |
+
|
997 |
+
if(el.length) {
|
998 |
+
|
999 |
+
// If target element has parent - we replace it with placeholder and put it back after popup is closed
|
1000 |
+
var parent = el[0].parentNode;
|
1001 |
+
if(parent && parent.tagName) {
|
1002 |
+
if(!_inlinePlaceholder) {
|
1003 |
+
_hiddenClass = inlineSt.hiddenClass;
|
1004 |
+
_inlinePlaceholder = _getEl(_hiddenClass);
|
1005 |
+
_hiddenClass = 'mfp-'+_hiddenClass;
|
1006 |
+
}
|
1007 |
+
// replace target inline element with placeholder
|
1008 |
+
_lastInlineElement = el.after(_inlinePlaceholder).detach().removeClass(_hiddenClass);
|
1009 |
+
}
|
1010 |
+
|
1011 |
+
mfp.updateStatus('ready');
|
1012 |
+
} else {
|
1013 |
+
mfp.updateStatus('error', inlineSt.tNotFound);
|
1014 |
+
el = $('<div>');
|
1015 |
+
}
|
1016 |
+
|
1017 |
+
item.inlineElement = el;
|
1018 |
+
return el;
|
1019 |
+
}
|
1020 |
+
|
1021 |
+
mfp.updateStatus('ready');
|
1022 |
+
mfp._parseMarkup(template, {}, item);
|
1023 |
+
return template;
|
1024 |
+
}
|
1025 |
+
}
|
1026 |
+
});
|
1027 |
+
|
1028 |
+
/*>>inline*/
|
1029 |
+
|
1030 |
+
/*>>ajax*/
|
1031 |
+
var AJAX_NS = 'ajax',
|
1032 |
+
_ajaxCur,
|
1033 |
+
_removeAjaxCursor = function() {
|
1034 |
+
if(_ajaxCur) {
|
1035 |
+
$(document.body).removeClass(_ajaxCur);
|
1036 |
+
}
|
1037 |
+
},
|
1038 |
+
_destroyAjaxRequest = function() {
|
1039 |
+
_removeAjaxCursor();
|
1040 |
+
if(mfp.req) {
|
1041 |
+
mfp.req.abort();
|
1042 |
+
}
|
1043 |
+
};
|
1044 |
+
|
1045 |
+
$.magnificPopup.registerModule(AJAX_NS, {
|
1046 |
+
|
1047 |
+
options: {
|
1048 |
+
settings: null,
|
1049 |
+
cursor: 'mfp-ajax-cur',
|
1050 |
+
tError: '<a href="%url%">The content</a> could not be loaded.'
|
1051 |
+
},
|
1052 |
+
|
1053 |
+
proto: {
|
1054 |
+
initAjax: function() {
|
1055 |
+
mfp.types.push(AJAX_NS);
|
1056 |
+
_ajaxCur = mfp.st.ajax.cursor;
|
1057 |
+
|
1058 |
+
_mfpOn(CLOSE_EVENT+'.'+AJAX_NS, _destroyAjaxRequest);
|
1059 |
+
_mfpOn('BeforeChange.' + AJAX_NS, _destroyAjaxRequest);
|
1060 |
+
},
|
1061 |
+
getAjax: function(item) {
|
1062 |
+
|
1063 |
+
if(_ajaxCur) {
|
1064 |
+
$(document.body).addClass(_ajaxCur);
|
1065 |
+
}
|
1066 |
+
|
1067 |
+
mfp.updateStatus('loading');
|
1068 |
+
|
1069 |
+
var opts = $.extend({
|
1070 |
+
url: item.src,
|
1071 |
+
success: function(data, textStatus, jqXHR) {
|
1072 |
+
var temp = {
|
1073 |
+
data:data,
|
1074 |
+
xhr:jqXHR
|
1075 |
+
};
|
1076 |
+
|
1077 |
+
_mfpTrigger('ParseAjax', temp);
|
1078 |
+
|
1079 |
+
mfp.appendContent( $(temp.data), AJAX_NS );
|
1080 |
+
|
1081 |
+
item.finished = true;
|
1082 |
+
|
1083 |
+
_removeAjaxCursor();
|
1084 |
+
|
1085 |
+
mfp._setFocus();
|
1086 |
+
|
1087 |
+
setTimeout(function() {
|
1088 |
+
mfp.wrap.addClass(READY_CLASS);
|
1089 |
+
}, 16);
|
1090 |
+
|
1091 |
+
mfp.updateStatus('ready');
|
1092 |
+
|
1093 |
+
_mfpTrigger('AjaxContentAdded');
|
1094 |
+
},
|
1095 |
+
error: function() {
|
1096 |
+
_removeAjaxCursor();
|
1097 |
+
item.finished = item.loadError = true;
|
1098 |
+
mfp.updateStatus('error', mfp.st.ajax.tError.replace('%url%', item.src));
|
1099 |
+
}
|
1100 |
+
}, mfp.st.ajax.settings);
|
1101 |
+
|
1102 |
+
mfp.req = $.ajax(opts);
|
1103 |
+
|
1104 |
+
return '';
|
1105 |
+
}
|
1106 |
+
}
|
1107 |
+
});
|
1108 |
+
|
1109 |
+
/*>>ajax*/
|
1110 |
+
|
1111 |
+
/*>>image*/
|
1112 |
+
var _imgInterval,
|
1113 |
+
_getTitle = function(item) {
|
1114 |
+
if(item.data && item.data.title !== undefined)
|
1115 |
+
return item.data.title;
|
1116 |
+
|
1117 |
+
var src = mfp.st.image.titleSrc;
|
1118 |
+
|
1119 |
+
if(src) {
|
1120 |
+
if($.isFunction(src)) {
|
1121 |
+
return src.call(mfp, item);
|
1122 |
+
} else if(item.el) {
|
1123 |
+
return item.el.attr(src) || '';
|
1124 |
+
}
|
1125 |
+
}
|
1126 |
+
return '';
|
1127 |
+
};
|
1128 |
+
|
1129 |
+
$.magnificPopup.registerModule('image', {
|
1130 |
+
|
1131 |
+
options: {
|
1132 |
+
markup: '<div class="mfp-figure">'+
|
1133 |
+
'<div class="mfp-close"></div>'+
|
1134 |
+
'<figure>'+
|
1135 |
+
'<div class="mfp-img"></div>'+
|
1136 |
+
'<figcaption>'+
|
1137 |
+
'<div class="mfp-bottom-bar">'+
|
1138 |
+
'<div class="mfp-title"></div>'+
|
1139 |
+
'<div class="mfp-counter"></div>'+
|
1140 |
+
'</div>'+
|
1141 |
+
'</figcaption>'+
|
1142 |
+
'</figure>'+
|
1143 |
+
'</div>',
|
1144 |
+
cursor: 'mfp-zoom-out-cur',
|
1145 |
+
titleSrc: 'title',
|
1146 |
+
verticalFit: true,
|
1147 |
+
tError: '<a href="%url%">The image</a> could not be loaded.'
|
1148 |
+
},
|
1149 |
+
|
1150 |
+
proto: {
|
1151 |
+
initImage: function() {
|
1152 |
+
var imgSt = mfp.st.image,
|
1153 |
+
ns = '.image';
|
1154 |
+
|
1155 |
+
mfp.types.push('image');
|
1156 |
+
|
1157 |
+
_mfpOn(OPEN_EVENT+ns, function() {
|
1158 |
+
if(mfp.currItem.type === 'image' && imgSt.cursor) {
|
1159 |
+
$(document.body).addClass(imgSt.cursor);
|
1160 |
+
}
|
1161 |
+
});
|
1162 |
+
|
1163 |
+
_mfpOn(CLOSE_EVENT+ns, function() {
|
1164 |
+
if(imgSt.cursor) {
|
1165 |
+
$(document.body).removeClass(imgSt.cursor);
|
1166 |
+
}
|
1167 |
+
_window.off('resize' + EVENT_NS);
|
1168 |
+
});
|
1169 |
+
|
1170 |
+
_mfpOn('Resize'+ns, mfp.resizeImage);
|
1171 |
+
if(mfp.isLowIE) {
|
1172 |
+
_mfpOn('AfterChange', mfp.resizeImage);
|
1173 |
+
}
|
1174 |
+
},
|
1175 |
+
resizeImage: function() {
|
1176 |
+
var item = mfp.currItem;
|
1177 |
+
if(!item || !item.img) return;
|
1178 |
+
|
1179 |
+
if(mfp.st.image.verticalFit) {
|
1180 |
+
var decr = 0;
|
1181 |
+
// fix box-sizing in ie7/8
|
1182 |
+
if(mfp.isLowIE) {
|
1183 |
+
decr = parseInt(item.img.css('padding-top'), 10) + parseInt(item.img.css('padding-bottom'),10);
|
1184 |
+
}
|
1185 |
+
item.img.css('max-height', mfp.wH-decr);
|
1186 |
+
}
|
1187 |
+
},
|
1188 |
+
_onImageHasSize: function(item) {
|
1189 |
+
if(item.img) {
|
1190 |
+
|
1191 |
+
item.hasSize = true;
|
1192 |
+
|
1193 |
+
if(_imgInterval) {
|
1194 |
+
clearInterval(_imgInterval);
|
1195 |
+
}
|
1196 |
+
|
1197 |
+
item.isCheckingImgSize = false;
|
1198 |
+
|
1199 |
+
_mfpTrigger('ImageHasSize', item);
|
1200 |
+
|
1201 |
+
if(item.imgHidden) {
|
1202 |
+
if(mfp.content)
|
1203 |
+
mfp.content.removeClass('mfp-loading');
|
1204 |
+
|
1205 |
+
item.imgHidden = false;
|
1206 |
+
}
|
1207 |
+
|
1208 |
+
}
|
1209 |
+
},
|
1210 |
+
|
1211 |
+
/**
|
1212 |
+
* Function that loops until the image has size to display elements that rely on it asap
|
1213 |
+
*/
|
1214 |
+
findImageSize: function(item) {
|
1215 |
+
|
1216 |
+
var counter = 0,
|
1217 |
+
img = item.img[0],
|
1218 |
+
mfpSetInterval = function(delay) {
|
1219 |
+
|
1220 |
+
if(_imgInterval) {
|
1221 |
+
clearInterval(_imgInterval);
|
1222 |
+
}
|
1223 |
+
// decelerating interval that checks for size of an image
|
1224 |
+
_imgInterval = setInterval(function() {
|
1225 |
+
if(img.naturalWidth > 0) {
|
1226 |
+
mfp._onImageHasSize(item);
|
1227 |
+
return;
|
1228 |
+
}
|
1229 |
+
|
1230 |
+
if(counter > 200) {
|
1231 |
+
clearInterval(_imgInterval);
|
1232 |
+
}
|
1233 |
+
|
1234 |
+
counter++;
|
1235 |
+
if(counter === 3) {
|
1236 |
+
mfpSetInterval(10);
|
1237 |
+
} else if(counter === 40) {
|
1238 |
+
mfpSetInterval(50);
|
1239 |
+
} else if(counter === 100) {
|
1240 |
+
mfpSetInterval(500);
|
1241 |
+
}
|
1242 |
+
}, delay);
|
1243 |
+
};
|
1244 |
+
|
1245 |
+
mfpSetInterval(1);
|
1246 |
+
},
|
1247 |
+
|
1248 |
+
getImage: function(item, template) {
|
1249 |
+
|
1250 |
+
var guard = 0,
|
1251 |
+
|
1252 |
+
// image load complete handler
|
1253 |
+
onLoadComplete = function() {
|
1254 |
+
if(item) {
|
1255 |
+
if (item.img[0].complete) {
|
1256 |
+
item.img.off('.mfploader');
|
1257 |
+
|
1258 |
+
if(item === mfp.currItem){
|
1259 |
+
mfp._onImageHasSize(item);
|
1260 |
+
|
1261 |
+
mfp.updateStatus('ready');
|
1262 |
+
}
|
1263 |
+
|
1264 |
+
item.hasSize = true;
|
1265 |
+
item.loaded = true;
|
1266 |
+
|
1267 |
+
_mfpTrigger('ImageLoadComplete');
|
1268 |
+
|
1269 |
+
}
|
1270 |
+
else {
|
1271 |
+
// if image complete check fails 200 times (20 sec), we assume that there was an error.
|
1272 |
+
guard++;
|
1273 |
+
if(guard < 200) {
|
1274 |
+
setTimeout(onLoadComplete,100);
|
1275 |
+
} else {
|
1276 |
+
onLoadError();
|
1277 |
+
}
|
1278 |
+
}
|
1279 |
+
}
|
1280 |
+
},
|
1281 |
+
|
1282 |
+
// image error handler
|
1283 |
+
onLoadError = function() {
|
1284 |
+
if(item) {
|
1285 |
+
item.img.off('.mfploader');
|
1286 |
+
if(item === mfp.currItem){
|
1287 |
+
mfp._onImageHasSize(item);
|
1288 |
+
mfp.updateStatus('error', imgSt.tError.replace('%url%', item.src) );
|
1289 |
+
}
|
1290 |
+
|
1291 |
+
item.hasSize = true;
|
1292 |
+
item.loaded = true;
|
1293 |
+
item.loadError = true;
|
1294 |
+
}
|
1295 |
+
},
|
1296 |
+
imgSt = mfp.st.image;
|
1297 |
+
|
1298 |
+
|
1299 |
+
var el = template.find('.mfp-img');
|
1300 |
+
if(el.length) {
|
1301 |
+
var img = document.createElement('img');
|
1302 |
+
img.className = 'mfp-img';
|
1303 |
+
if(item.el && item.el.find('img').length) {
|
1304 |
+
img.alt = item.el.find('img').attr('alt');
|
1305 |
+
}
|
1306 |
+
item.img = $(img).on('load.mfploader', onLoadComplete).on('error.mfploader', onLoadError);
|
1307 |
+
img.src = item.src;
|
1308 |
+
|
1309 |
+
// without clone() "error" event is not firing when IMG is replaced by new IMG
|
1310 |
+
// TODO: find a way to avoid such cloning
|
1311 |
+
if(el.is('img')) {
|
1312 |
+
item.img = item.img.clone();
|
1313 |
+
}
|
1314 |
+
|
1315 |
+
img = item.img[0];
|
1316 |
+
if(img.naturalWidth > 0) {
|
1317 |
+
item.hasSize = true;
|
1318 |
+
} else if(!img.width) {
|
1319 |
+
item.hasSize = false;
|
1320 |
+
}
|
1321 |
+
}
|
1322 |
+
|
1323 |
+
mfp._parseMarkup(template, {
|
1324 |
+
title: _getTitle(item),
|
1325 |
+
img_replaceWith: item.img
|
1326 |
+
}, item);
|
1327 |
+
|
1328 |
+
mfp.resizeImage();
|
1329 |
+
|
1330 |
+
if(item.hasSize) {
|
1331 |
+
if(_imgInterval) clearInterval(_imgInterval);
|
1332 |
+
|
1333 |
+
if(item.loadError) {
|
1334 |
+
template.addClass('mfp-loading');
|
1335 |
+
mfp.updateStatus('error', imgSt.tError.replace('%url%', item.src) );
|
1336 |
+
} else {
|
1337 |
+
template.removeClass('mfp-loading');
|
1338 |
+
mfp.updateStatus('ready');
|
1339 |
+
}
|
1340 |
+
return template;
|
1341 |
+
}
|
1342 |
+
|
1343 |
+
mfp.updateStatus('loading');
|
1344 |
+
item.loading = true;
|
1345 |
+
|
1346 |
+
if(!item.hasSize) {
|
1347 |
+
item.imgHidden = true;
|
1348 |
+
template.addClass('mfp-loading');
|
1349 |
+
mfp.findImageSize(item);
|
1350 |
+
}
|
1351 |
+
|
1352 |
+
return template;
|
1353 |
+
}
|
1354 |
+
}
|
1355 |
+
});
|
1356 |
+
|
1357 |
+
/*>>image*/
|
1358 |
+
|
1359 |
+
/*>>zoom*/
|
1360 |
+
var hasMozTransform,
|
1361 |
+
getHasMozTransform = function() {
|
1362 |
+
if(hasMozTransform === undefined) {
|
1363 |
+
hasMozTransform = document.createElement('p').style.MozTransform !== undefined;
|
1364 |
+
}
|
1365 |
+
return hasMozTransform;
|
1366 |
+
};
|
1367 |
+
|
1368 |
+
$.magnificPopup.registerModule('zoom', {
|
1369 |
+
|
1370 |
+
options: {
|
1371 |
+
enabled: false,
|
1372 |
+
easing: 'ease-in-out',
|
1373 |
+
duration: 300,
|
1374 |
+
opener: function(element) {
|
1375 |
+
return element.is('img') ? element : element.find('img');
|
1376 |
+
}
|
1377 |
+
},
|
1378 |
+
|
1379 |
+
proto: {
|
1380 |
+
|
1381 |
+
initZoom: function() {
|
1382 |
+
var zoomSt = mfp.st.zoom,
|
1383 |
+
ns = '.zoom',
|
1384 |
+
image;
|
1385 |
+
|
1386 |
+
if(!zoomSt.enabled || !mfp.supportsTransition) {
|
1387 |
+
return;
|
1388 |
+
}
|
1389 |
+
|
1390 |
+
var duration = zoomSt.duration,
|
1391 |
+
getElToAnimate = function(image) {
|
1392 |
+
var newImg = image.clone().removeAttr('style').removeAttr('class').addClass('mfp-animated-image'),
|
1393 |
+
transition = 'all '+(zoomSt.duration/1000)+'s ' + zoomSt.easing,
|
1394 |
+
cssObj = {
|
1395 |
+
position: 'fixed',
|
1396 |
+
zIndex: 9999,
|
1397 |
+
left: 0,
|
1398 |
+
top: 0,
|
1399 |
+
'-webkit-backface-visibility': 'hidden'
|
1400 |
+
},
|
1401 |
+
t = 'transition';
|
1402 |
+
|
1403 |
+
cssObj['-webkit-'+t] = cssObj['-moz-'+t] = cssObj['-o-'+t] = cssObj[t] = transition;
|
1404 |
+
|
1405 |
+
newImg.css(cssObj);
|
1406 |
+
return newImg;
|
1407 |
+
},
|
1408 |
+
showMainContent = function() {
|
1409 |
+
mfp.content.css('visibility', 'visible');
|
1410 |
+
},
|
1411 |
+
openTimeout,
|
1412 |
+
animatedImg;
|
1413 |
+
|
1414 |
+
_mfpOn('BuildControls'+ns, function() {
|
1415 |
+
if(mfp._allowZoom()) {
|
1416 |
+
|
1417 |
+
clearTimeout(openTimeout);
|
1418 |
+
mfp.content.css('visibility', 'hidden');
|
1419 |
+
|
1420 |
+
// Basically, all code below does is clones existing image, puts in on top of the current one and animated it
|
1421 |
+
|
1422 |
+
image = mfp._getItemToZoom();
|
1423 |
+
|
1424 |
+
if(!image) {
|
1425 |
+
showMainContent();
|
1426 |
+
return;
|
1427 |
+
}
|
1428 |
+
|
1429 |
+
animatedImg = getElToAnimate(image);
|
1430 |
+
|
1431 |
+
animatedImg.css( mfp._getOffset() );
|
1432 |
+
|
1433 |
+
mfp.wrap.append(animatedImg);
|
1434 |
+
|
1435 |
+
openTimeout = setTimeout(function() {
|
1436 |
+
animatedImg.css( mfp._getOffset( true ) );
|
1437 |
+
openTimeout = setTimeout(function() {
|
1438 |
+
|
1439 |
+
showMainContent();
|
1440 |
+
|
1441 |
+
setTimeout(function() {
|
1442 |
+
animatedImg.remove();
|
1443 |
+
image = animatedImg = null;
|
1444 |
+
_mfpTrigger('ZoomAnimationEnded');
|
1445 |
+
}, 16); // avoid blink when switching images
|
1446 |
+
|
1447 |
+
}, duration); // this timeout equals animation duration
|
1448 |
+
|
1449 |
+
}, 16); // by adding this timeout we avoid short glitch at the beginning of animation
|
1450 |
+
|
1451 |
+
|
1452 |
+
// Lots of timeouts...
|
1453 |
+
}
|
1454 |
+
});
|
1455 |
+
_mfpOn(BEFORE_CLOSE_EVENT+ns, function() {
|
1456 |
+
if(mfp._allowZoom()) {
|
1457 |
+
|
1458 |
+
clearTimeout(openTimeout);
|
1459 |
+
|
1460 |
+
mfp.st.removalDelay = duration;
|
1461 |
+
|
1462 |
+
if(!image) {
|
1463 |
+
image = mfp._getItemToZoom();
|
1464 |
+
if(!image) {
|
1465 |
+
return;
|
1466 |
+
}
|
1467 |
+
animatedImg = getElToAnimate(image);
|
1468 |
+
}
|
1469 |
+
|
1470 |
+
animatedImg.css( mfp._getOffset(true) );
|
1471 |
+
mfp.wrap.append(animatedImg);
|
1472 |
+
mfp.content.css('visibility', 'hidden');
|
1473 |
+
|
1474 |
+
setTimeout(function() {
|
1475 |
+
animatedImg.css( mfp._getOffset() );
|
1476 |
+
}, 16);
|
1477 |
+
}
|
1478 |
+
|
1479 |
+
});
|
1480 |
+
|
1481 |
+
_mfpOn(CLOSE_EVENT+ns, function() {
|
1482 |
+
if(mfp._allowZoom()) {
|
1483 |
+
showMainContent();
|
1484 |
+
if(animatedImg) {
|
1485 |
+
animatedImg.remove();
|
1486 |
+
}
|
1487 |
+
image = null;
|
1488 |
+
}
|
1489 |
+
});
|
1490 |
+
},
|
1491 |
+
|
1492 |
+
_allowZoom: function() {
|
1493 |
+
return mfp.currItem.type === 'image';
|
1494 |
+
},
|
1495 |
+
|
1496 |
+
_getItemToZoom: function() {
|
1497 |
+
if(mfp.currItem.hasSize) {
|
1498 |
+
return mfp.currItem.img;
|
1499 |
+
} else {
|
1500 |
+
return false;
|
1501 |
+
}
|
1502 |
+
},
|
1503 |
+
|
1504 |
+
// Get element postion relative to viewport
|
1505 |
+
_getOffset: function(isLarge) {
|
1506 |
+
var el;
|
1507 |
+
if(isLarge) {
|
1508 |
+
el = mfp.currItem.img;
|
1509 |
+
} else {
|
1510 |
+
el = mfp.st.zoom.opener(mfp.currItem.el || mfp.currItem);
|
1511 |
+
}
|
1512 |
+
|
1513 |
+
var offset = el.offset();
|
1514 |
+
var paddingTop = parseInt(el.css('padding-top'),10);
|
1515 |
+
var paddingBottom = parseInt(el.css('padding-bottom'),10);
|
1516 |
+
offset.top -= ( $(window).scrollTop() - paddingTop );
|
1517 |
+
|
1518 |
+
|
1519 |
+
/*
|
1520 |
+
|
1521 |
+
Animating left + top + width/height looks glitchy in Firefox, but perfect in Chrome. And vice-versa.
|
1522 |
+
|
1523 |
+
*/
|
1524 |
+
var obj = {
|
1525 |
+
width: el.width(),
|
1526 |
+
// fix Zepto height+padding issue
|
1527 |
+
height: (_isJQ ? el.innerHeight() : el[0].offsetHeight) - paddingBottom - paddingTop
|
1528 |
+
};
|
1529 |
+
|
1530 |
+
// I hate to do this, but there is no another option
|
1531 |
+
if( getHasMozTransform() ) {
|
1532 |
+
obj['-moz-transform'] = obj['transform'] = 'translate(' + offset.left + 'px,' + offset.top + 'px)';
|
1533 |
+
} else {
|
1534 |
+
obj.left = offset.left;
|
1535 |
+
obj.top = offset.top;
|
1536 |
+
}
|
1537 |
+
return obj;
|
1538 |
+
}
|
1539 |
+
|
1540 |
+
}
|
1541 |
+
});
|
1542 |
+
|
1543 |
+
|
1544 |
+
|
1545 |
+
/*>>zoom*/
|
1546 |
+
|
1547 |
+
/*>>iframe*/
|
1548 |
+
|
1549 |
+
var IFRAME_NS = 'iframe',
|
1550 |
+
_emptyPage = '//about:blank',
|
1551 |
+
|
1552 |
+
_fixIframeBugs = function(isShowing) {
|
1553 |
+
if(mfp.currTemplate[IFRAME_NS]) {
|
1554 |
+
var el = mfp.currTemplate[IFRAME_NS].find('iframe');
|
1555 |
+
if(el.length) {
|
1556 |
+
// reset src after the popup is closed to avoid "video keeps playing after popup is closed" bug
|
1557 |
+
if(!isShowing) {
|
1558 |
+
el[0].src = _emptyPage;
|
1559 |
+
}
|
1560 |
+
|
1561 |
+
// IE8 black screen bug fix
|
1562 |
+
if(mfp.isIE8) {
|
1563 |
+
el.css('display', isShowing ? 'block' : 'none');
|
1564 |
+
}
|
1565 |
+
}
|
1566 |
+
}
|
1567 |
+
};
|
1568 |
+
|
1569 |
+
$.magnificPopup.registerModule(IFRAME_NS, {
|
1570 |
+
|
1571 |
+
options: {
|
1572 |
+
markup: '<div class="mfp-iframe-scaler">'+
|
1573 |
+
'<div class="mfp-close"></div>'+
|
1574 |
+
'<iframe class="mfp-iframe" src="//about:blank" frameborder="0" allowfullscreen></iframe>'+
|
1575 |
+
'</div>',
|
1576 |
+
|
1577 |
+
srcAction: 'iframe_src',
|
1578 |
+
|
1579 |
+
// we don't care and support only one default type of URL by default
|
1580 |
+
patterns: {
|
1581 |
+
youtube: {
|
1582 |
+
index: 'youtube.com',
|
1583 |
+
id: 'v=',
|
1584 |
+
src: '//www.youtube.com/embed/%id%?autoplay=1'
|
1585 |
+
},
|
1586 |
+
vimeo: {
|
1587 |
+
index: 'vimeo.com/',
|
1588 |
+
id: '/',
|
1589 |
+
src: '//player.vimeo.com/video/%id%?autoplay=1'
|
1590 |
+
},
|
1591 |
+
gmaps: {
|
1592 |
+
index: '//maps.google.',
|
1593 |
+
src: '%id%&output=embed'
|
1594 |
+
}
|
1595 |
+
}
|
1596 |
+
},
|
1597 |
+
|
1598 |
+
proto: {
|
1599 |
+
initIframe: function() {
|
1600 |
+
mfp.types.push(IFRAME_NS);
|
1601 |
+
|
1602 |
+
_mfpOn('BeforeChange', function(e, prevType, newType) {
|
1603 |
+
if(prevType !== newType) {
|
1604 |
+
if(prevType === IFRAME_NS) {
|
1605 |
+
_fixIframeBugs(); // iframe if removed
|
1606 |
+
} else if(newType === IFRAME_NS) {
|
1607 |
+
_fixIframeBugs(true); // iframe is showing
|
1608 |
+
}
|
1609 |
+
}// else {
|
1610 |
+
// iframe source is switched, don't do anything
|
1611 |
+
//}
|
1612 |
+
});
|
1613 |
+
|
1614 |
+
_mfpOn(CLOSE_EVENT + '.' + IFRAME_NS, function() {
|
1615 |
+
_fixIframeBugs();
|
1616 |
+
});
|
1617 |
+
},
|
1618 |
+
|
1619 |
+
getIframe: function(item, template) {
|
1620 |
+
var embedSrc = item.src;
|
1621 |
+
var iframeSt = mfp.st.iframe;
|
1622 |
+
|
1623 |
+
$.each(iframeSt.patterns, function() {
|
1624 |
+
if(embedSrc.indexOf( this.index ) > -1) {
|
1625 |
+
if(this.id) {
|
1626 |
+
if(typeof this.id === 'string') {
|
1627 |
+
embedSrc = embedSrc.substr(embedSrc.lastIndexOf(this.id)+this.id.length, embedSrc.length);
|
1628 |
+
} else {
|
1629 |
+
embedSrc = this.id.call( this, embedSrc );
|
1630 |
+
}
|
1631 |
+
}
|
1632 |
+
embedSrc = this.src.replace('%id%', embedSrc );
|
1633 |
+
return false; // break;
|
1634 |
+
}
|
1635 |
+
});
|
1636 |
+
|
1637 |
+
var dataObj = {};
|
1638 |
+
if(iframeSt.srcAction) {
|
1639 |
+
dataObj[iframeSt.srcAction] = embedSrc;
|
1640 |
+
}
|
1641 |
+
mfp._parseMarkup(template, dataObj, item);
|
1642 |
+
|
1643 |
+
mfp.updateStatus('ready');
|
1644 |
+
|
1645 |
+
return template;
|
1646 |
+
}
|
1647 |
+
}
|
1648 |
+
});
|
1649 |
+
|
1650 |
+
|
1651 |
+
|
1652 |
+
/*>>iframe*/
|
1653 |
+
|
1654 |
+
/*>>gallery*/
|
1655 |
+
/**
|
1656 |
+
* Get looped index depending on number of slides
|
1657 |
+
*/
|
1658 |
+
var _getLoopedId = function(index) {
|
1659 |
+
var numSlides = mfp.items.length;
|
1660 |
+
if(index > numSlides - 1) {
|
1661 |
+
return index - numSlides;
|
1662 |
+
} else if(index < 0) {
|
1663 |
+
return numSlides + index;
|
1664 |
+
}
|
1665 |
+
return index;
|
1666 |
+
},
|
1667 |
+
_replaceCurrTotal = function(text, curr, total) {
|
1668 |
+
return text.replace(/%curr%/gi, curr + 1).replace(/%total%/gi, total);
|
1669 |
+
};
|
1670 |
+
|
1671 |
+
$.magnificPopup.registerModule('gallery', {
|
1672 |
+
|
1673 |
+
options: {
|
1674 |
+
enabled: false,
|
1675 |
+
arrowMarkup: '<button title="%title%" type="button" class="mfp-arrow mfp-arrow-%dir%"></button>',
|
1676 |
+
preload: [0,2],
|
1677 |
+
navigateByImgClick: true,
|
1678 |
+
arrows: true,
|
1679 |
+
|
1680 |
+
tPrev: 'Previous (Left arrow key)',
|
1681 |
+
tNext: 'Next (Right arrow key)',
|
1682 |
+
tCounter: '%curr% of %total%'
|
1683 |
+
},
|
1684 |
+
|
1685 |
+
proto: {
|
1686 |
+
initGallery: function() {
|
1687 |
+
|
1688 |
+
var gSt = mfp.st.gallery,
|
1689 |
+
ns = '.mfp-gallery';
|
1690 |
+
|
1691 |
+
mfp.direction = true; // true - next, false - prev
|
1692 |
+
|
1693 |
+
if(!gSt || !gSt.enabled ) return false;
|
1694 |
+
|
1695 |
+
_wrapClasses += ' mfp-gallery';
|
1696 |
+
|
1697 |
+
_mfpOn(OPEN_EVENT+ns, function() {
|
1698 |
+
|
1699 |
+
if(gSt.navigateByImgClick) {
|
1700 |
+
mfp.wrap.on('click'+ns, '.mfp-img', function() {
|
1701 |
+
if(mfp.items.length > 1) {
|
1702 |
+
mfp.next();
|
1703 |
+
return false;
|
1704 |
+
}
|
1705 |
+
});
|
1706 |
+
}
|
1707 |
+
|
1708 |
+
_document.on('keydown'+ns, function(e) {
|
1709 |
+
if (e.keyCode === 37) {
|
1710 |
+
mfp.prev();
|
1711 |
+
} else if (e.keyCode === 39) {
|
1712 |
+
mfp.next();
|
1713 |
+
}
|
1714 |
+
});
|
1715 |
+
});
|
1716 |
+
|
1717 |
+
_mfpOn('UpdateStatus'+ns, function(e, data) {
|
1718 |
+
if(data.text) {
|
1719 |
+
data.text = _replaceCurrTotal(data.text, mfp.currItem.index, mfp.items.length);
|
1720 |
+
}
|
1721 |
+
});
|
1722 |
+
|
1723 |
+
_mfpOn(MARKUP_PARSE_EVENT+ns, function(e, element, values, item) {
|
1724 |
+
var l = mfp.items.length;
|
1725 |
+
values.counter = l > 1 ? _replaceCurrTotal(gSt.tCounter, item.index, l) : '';
|
1726 |
+
});
|
1727 |
+
|
1728 |
+
_mfpOn('BuildControls' + ns, function() {
|
1729 |
+
if(mfp.items.length > 1 && gSt.arrows && !mfp.arrowLeft) {
|
1730 |
+
var markup = gSt.arrowMarkup,
|
1731 |
+
arrowLeft = mfp.arrowLeft = $( markup.replace(/%title%/gi, gSt.tPrev).replace(/%dir%/gi, 'left') ).addClass(PREVENT_CLOSE_CLASS),
|
1732 |
+
arrowRight = mfp.arrowRight = $( markup.replace(/%title%/gi, gSt.tNext).replace(/%dir%/gi, 'right') ).addClass(PREVENT_CLOSE_CLASS);
|
1733 |
+
|
1734 |
+
arrowLeft.click(function() {
|
1735 |
+
mfp.prev();
|
1736 |
+
});
|
1737 |
+
arrowRight.click(function() {
|
1738 |
+
mfp.next();
|
1739 |
+
});
|
1740 |
+
|
1741 |
+
mfp.container.append(arrowLeft.add(arrowRight));
|
1742 |
+
}
|
1743 |
+
});
|
1744 |
+
|
1745 |
+
_mfpOn(CHANGE_EVENT+ns, function() {
|
1746 |
+
if(mfp._preloadTimeout) clearTimeout(mfp._preloadTimeout);
|
1747 |
+
|
1748 |
+
mfp._preloadTimeout = setTimeout(function() {
|
1749 |
+
mfp.preloadNearbyImages();
|
1750 |
+
mfp._preloadTimeout = null;
|
1751 |
+
}, 16);
|
1752 |
+
});
|
1753 |
+
|
1754 |
+
|
1755 |
+
_mfpOn(CLOSE_EVENT+ns, function() {
|
1756 |
+
_document.off(ns);
|
1757 |
+
mfp.wrap.off('click'+ns);
|
1758 |
+
mfp.arrowRight = mfp.arrowLeft = null;
|
1759 |
+
});
|
1760 |
+
|
1761 |
+
},
|
1762 |
+
next: function() {
|
1763 |
+
mfp.direction = true;
|
1764 |
+
mfp.index = _getLoopedId(mfp.index + 1);
|
1765 |
+
mfp.updateItemHTML();
|
1766 |
+
},
|
1767 |
+
prev: function() {
|
1768 |
+
mfp.direction = false;
|
1769 |
+
mfp.index = _getLoopedId(mfp.index - 1);
|
1770 |
+
mfp.updateItemHTML();
|
1771 |
+
},
|
1772 |
+
goTo: function(newIndex) {
|
1773 |
+
mfp.direction = (newIndex >= mfp.index);
|
1774 |
+
mfp.index = newIndex;
|
1775 |
+
mfp.updateItemHTML();
|
1776 |
+
},
|
1777 |
+
preloadNearbyImages: function() {
|
1778 |
+
var p = mfp.st.gallery.preload,
|
1779 |
+
preloadBefore = Math.min(p[0], mfp.items.length),
|
1780 |
+
preloadAfter = Math.min(p[1], mfp.items.length),
|
1781 |
+
i;
|
1782 |
+
|
1783 |
+
for(i = 1; i <= (mfp.direction ? preloadAfter : preloadBefore); i++) {
|
1784 |
+
mfp._preloadItem(mfp.index+i);
|
1785 |
+
}
|
1786 |
+
for(i = 1; i <= (mfp.direction ? preloadBefore : preloadAfter); i++) {
|
1787 |
+
mfp._preloadItem(mfp.index-i);
|
1788 |
+
}
|
1789 |
+
},
|
1790 |
+
_preloadItem: function(index) {
|
1791 |
+
index = _getLoopedId(index);
|
1792 |
+
|
1793 |
+
if(mfp.items[index].preloaded) {
|
1794 |
+
return;
|
1795 |
+
}
|
1796 |
+
|
1797 |
+
var item = mfp.items[index];
|
1798 |
+
if(!item.parsed) {
|
1799 |
+
item = mfp.parseEl( index );
|
1800 |
+
}
|
1801 |
+
|
1802 |
+
_mfpTrigger('LazyLoad', item);
|
1803 |
+
|
1804 |
+
if(item.type === 'image') {
|
1805 |
+
item.img = $('<img class="mfp-img" />').on('load.mfploader', function() {
|
1806 |
+
item.hasSize = true;
|
1807 |
+
}).on('error.mfploader', function() {
|
1808 |
+
item.hasSize = true;
|
1809 |
+
item.loadError = true;
|
1810 |
+
_mfpTrigger('LazyLoadError', item);
|
1811 |
+
}).attr('src', item.src);
|
1812 |
+
}
|
1813 |
+
|
1814 |
+
|
1815 |
+
item.preloaded = true;
|
1816 |
+
}
|
1817 |
+
}
|
1818 |
+
});
|
1819 |
+
|
1820 |
+
/*>>gallery*/
|
1821 |
+
|
1822 |
+
/*>>retina*/
|
1823 |
+
|
1824 |
+
var RETINA_NS = 'retina';
|
1825 |
+
|
1826 |
+
$.magnificPopup.registerModule(RETINA_NS, {
|
1827 |
+
options: {
|
1828 |
+
replaceSrc: function(item) {
|
1829 |
+
return item.src.replace(/\.\w+$/, function(m) { return '@2x' + m; });
|
1830 |
+
},
|
1831 |
+
ratio: 1 // Function or number. Set to 1 to disable.
|
1832 |
+
},
|
1833 |
+
proto: {
|
1834 |
+
initRetina: function() {
|
1835 |
+
if(window.devicePixelRatio > 1) {
|
1836 |
+
|
1837 |
+
var st = mfp.st.retina,
|
1838 |
+
ratio = st.ratio;
|
1839 |
+
|
1840 |
+
ratio = !isNaN(ratio) ? ratio : ratio();
|
1841 |
+
|
1842 |
+
if(ratio > 1) {
|
1843 |
+
_mfpOn('ImageHasSize' + '.' + RETINA_NS, function(e, item) {
|
1844 |
+
item.img.css({
|
1845 |
+
'max-width': item.img[0].naturalWidth / ratio,
|
1846 |
+
'width': '100%'
|
1847 |
+
});
|
1848 |
+
});
|
1849 |
+
_mfpOn('ElementParse' + '.' + RETINA_NS, function(e, item) {
|
1850 |
+
item.src = st.replaceSrc(item, ratio);
|
1851 |
+
});
|
1852 |
+
}
|
1853 |
+
}
|
1854 |
+
|
1855 |
+
}
|
1856 |
+
}
|
1857 |
+
});
|
1858 |
+
|
1859 |
+
/*>>retina*/
|
1860 |
+
_checkInstance(); }));
|
assets/mag-popup/jquery.magnific-popup.min.js
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
/*! Magnific Popup - v1.1.0 - 2016-02-20
|
2 |
+
* http://dimsemenov.com/plugins/magnific-popup/
|
3 |
+
* Copyright (c) 2016 Dmitry Semenov; */
|
4 |
+
!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a("object"==typeof exports?require("jquery"):window.jQuery||window.Zepto)}(function(a){var b,c,d,e,f,g,h="Close",i="BeforeClose",j="AfterClose",k="BeforeAppend",l="MarkupParse",m="Open",n="Change",o="mfp",p="."+o,q="mfp-ready",r="mfp-removing",s="mfp-prevent-close",t=function(){},u=!!window.jQuery,v=a(window),w=function(a,c){b.ev.on(o+a+p,c)},x=function(b,c,d,e){var f=document.createElement("div");return f.className="mfp-"+b,d&&(f.innerHTML=d),e?c&&c.appendChild(f):(f=a(f),c&&f.appendTo(c)),f},y=function(c,d){b.ev.triggerHandler(o+c,d),b.st.callbacks&&(c=c.charAt(0).toLowerCase()+c.slice(1),b.st.callbacks[c]&&b.st.callbacks[c].apply(b,a.isArray(d)?d:[d]))},z=function(c){return c===g&&b.currTemplate.closeBtn||(b.currTemplate.closeBtn=a(b.st.closeMarkup.replace("%title%",b.st.tClose)),g=c),b.currTemplate.closeBtn},A=function(){a.magnificPopup.instance||(b=new t,b.init(),a.magnificPopup.instance=b)},B=function(){var a=document.createElement("p").style,b=["ms","O","Moz","Webkit"];if(void 0!==a.transition)return!0;for(;b.length;)if(b.pop()+"Transition"in a)return!0;return!1};t.prototype={constructor:t,init:function(){var c=navigator.appVersion;b.isLowIE=b.isIE8=document.all&&!document.addEventListener,b.isAndroid=/android/gi.test(c),b.isIOS=/iphone|ipad|ipod/gi.test(c),b.supportsTransition=B(),b.probablyMobile=b.isAndroid||b.isIOS||/(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent),d=a(document),b.popupsCache={}},open:function(c){var e;if(c.isObj===!1){b.items=c.items.toArray(),b.index=0;var g,h=c.items;for(e=0;e<h.length;e++)if(g=h[e],g.parsed&&(g=g.el[0]),g===c.el[0]){b.index=e;break}}else b.items=a.isArray(c.items)?c.items:[c.items],b.index=c.index||0;if(b.isOpen)return void b.updateItemHTML();b.types=[],f="",c.mainEl&&c.mainEl.length?b.ev=c.mainEl.eq(0):b.ev=d,c.key?(b.popupsCache[c.key]||(b.popupsCache[c.key]={}),b.currTemplate=b.popupsCache[c.key]):b.currTemplate={},b.st=a.extend(!0,{},a.magnificPopup.defaults,c),b.fixedContentPos="auto"===b.st.fixedContentPos?!b.probablyMobile:b.st.fixedContentPos,b.st.modal&&(b.st.closeOnContentClick=!1,b.st.closeOnBgClick=!1,b.st.showCloseBtn=!1,b.st.enableEscapeKey=!1),b.bgOverlay||(b.bgOverlay=x("bg").on("click"+p,function(){b.close()}),b.wrap=x("wrap").attr("tabindex",-1).on("click"+p,function(a){b._checkIfClose(a.target)&&b.close()}),b.container=x("container",b.wrap)),b.contentContainer=x("content"),b.st.preloader&&(b.preloader=x("preloader",b.container,b.st.tLoading));var i=a.magnificPopup.modules;for(e=0;e<i.length;e++){var j=i[e];j=j.charAt(0).toUpperCase()+j.slice(1),b["init"+j].call(b)}y("BeforeOpen"),b.st.showCloseBtn&&(b.st.closeBtnInside?(w(l,function(a,b,c,d){c.close_replaceWith=z(d.type)}),f+=" mfp-close-btn-in"):b.wrap.append(z())),b.st.alignTop&&(f+=" mfp-align-top"),b.fixedContentPos?b.wrap.css({overflow:b.st.overflowY,overflowX:"hidden",overflowY:b.st.overflowY}):b.wrap.css({top:v.scrollTop(),position:"absolute"}),(b.st.fixedBgPos===!1||"auto"===b.st.fixedBgPos&&!b.fixedContentPos)&&b.bgOverlay.css({height:d.height(),position:"absolute"}),b.st.enableEscapeKey&&d.on("keyup"+p,function(a){27===a.keyCode&&b.close()}),v.on("resize"+p,function(){b.updateSize()}),b.st.closeOnContentClick||(f+=" mfp-auto-cursor"),f&&b.wrap.addClass(f);var k=b.wH=v.height(),n={};if(b.fixedContentPos&&b._hasScrollBar(k)){var o=b._getScrollbarSize();o&&(n.marginRight=o)}b.fixedContentPos&&(b.isIE7?a("body, html").css("overflow","hidden"):n.overflow="hidden");var r=b.st.mainClass;return b.isIE7&&(r+=" mfp-ie7"),r&&b._addClassToMFP(r),b.updateItemHTML(),y("BuildControls"),a("html").css(n),b.bgOverlay.add(b.wrap).prependTo(b.st.prependTo||a(document.body)),b._lastFocusedEl=document.activeElement,setTimeout(function(){b.content?(b._addClassToMFP(q),b._setFocus()):b.bgOverlay.addClass(q),d.on("focusin"+p,b._onFocusIn)},16),b.isOpen=!0,b.updateSize(k),y(m),c},close:function(){b.isOpen&&(y(i),b.isOpen=!1,b.st.removalDelay&&!b.isLowIE&&b.supportsTransition?(b._addClassToMFP(r),setTimeout(function(){b._close()},b.st.removalDelay)):b._close())},_close:function(){y(h);var c=r+" "+q+" ";if(b.bgOverlay.detach(),b.wrap.detach(),b.container.empty(),b.st.mainClass&&(c+=b.st.mainClass+" "),b._removeClassFromMFP(c),b.fixedContentPos){var e={marginRight:""};b.isIE7?a("body, html").css("overflow",""):e.overflow="",a("html").css(e)}d.off("keyup"+p+" focusin"+p),b.ev.off(p),b.wrap.attr("class","mfp-wrap").removeAttr("style"),b.bgOverlay.attr("class","mfp-bg"),b.container.attr("class","mfp-container"),!b.st.showCloseBtn||b.st.closeBtnInside&&b.currTemplate[b.currItem.type]!==!0||b.currTemplate.closeBtn&&b.currTemplate.closeBtn.detach(),b.st.autoFocusLast&&b._lastFocusedEl&&a(b._lastFocusedEl).focus(),b.currItem=null,b.content=null,b.currTemplate=null,b.prevHeight=0,y(j)},updateSize:function(a){if(b.isIOS){var c=document.documentElement.clientWidth/window.innerWidth,d=window.innerHeight*c;b.wrap.css("height",d),b.wH=d}else b.wH=a||v.height();b.fixedContentPos||b.wrap.css("height",b.wH),y("Resize")},updateItemHTML:function(){var c=b.items[b.index];b.contentContainer.detach(),b.content&&b.content.detach(),c.parsed||(c=b.parseEl(b.index));var d=c.type;if(y("BeforeChange",[b.currItem?b.currItem.type:"",d]),b.currItem=c,!b.currTemplate[d]){var f=b.st[d]?b.st[d].markup:!1;y("FirstMarkupParse",f),f?b.currTemplate[d]=a(f):b.currTemplate[d]=!0}e&&e!==c.type&&b.container.removeClass("mfp-"+e+"-holder");var g=b["get"+d.charAt(0).toUpperCase()+d.slice(1)](c,b.currTemplate[d]);b.appendContent(g,d),c.preloaded=!0,y(n,c),e=c.type,b.container.prepend(b.contentContainer),y("AfterChange")},appendContent:function(a,c){b.content=a,a?b.st.showCloseBtn&&b.st.closeBtnInside&&b.currTemplate[c]===!0?b.content.find(".mfp-close").length||b.content.append(z()):b.content=a:b.content="",y(k),b.container.addClass("mfp-"+c+"-holder"),b.contentContainer.append(b.content)},parseEl:function(c){var d,e=b.items[c];if(e.tagName?e={el:a(e)}:(d=e.type,e={data:e,src:e.src}),e.el){for(var f=b.types,g=0;g<f.length;g++)if(e.el.hasClass("mfp-"+f[g])){d=f[g];break}e.src=e.el.attr("data-mfp-src"),e.src||(e.src=e.el.attr("href"))}return e.type=d||b.st.type||"inline",e.index=c,e.parsed=!0,b.items[c]=e,y("ElementParse",e),b.items[c]},addGroup:function(a,c){var d=function(d){d.mfpEl=this,b._openClick(d,a,c)};c||(c={});var e="click.magnificPopup";c.mainEl=a,c.items?(c.isObj=!0,a.off(e).on(e,d)):(c.isObj=!1,c.delegate?a.off(e).on(e,c.delegate,d):(c.items=a,a.off(e).on(e,d)))},_openClick:function(c,d,e){var f=void 0!==e.midClick?e.midClick:a.magnificPopup.defaults.midClick;if(f||!(2===c.which||c.ctrlKey||c.metaKey||c.altKey||c.shiftKey)){var g=void 0!==e.disableOn?e.disableOn:a.magnificPopup.defaults.disableOn;if(g)if(a.isFunction(g)){if(!g.call(b))return!0}else if(v.width()<g)return!0;c.type&&(c.preventDefault(),b.isOpen&&c.stopPropagation()),e.el=a(c.mfpEl),e.delegate&&(e.items=d.find(e.delegate)),b.open(e)}},updateStatus:function(a,d){if(b.preloader){c!==a&&b.container.removeClass("mfp-s-"+c),d||"loading"!==a||(d=b.st.tLoading);var e={status:a,text:d};y("UpdateStatus",e),a=e.status,d=e.text,b.preloader.html(d),b.preloader.find("a").on("click",function(a){a.stopImmediatePropagation()}),b.container.addClass("mfp-s-"+a),c=a}},_checkIfClose:function(c){if(!a(c).hasClass(s)){var d=b.st.closeOnContentClick,e=b.st.closeOnBgClick;if(d&&e)return!0;if(!b.content||a(c).hasClass("mfp-close")||b.preloader&&c===b.preloader[0])return!0;if(c===b.content[0]||a.contains(b.content[0],c)){if(d)return!0}else if(e&&a.contains(document,c))return!0;return!1}},_addClassToMFP:function(a){b.bgOverlay.addClass(a),b.wrap.addClass(a)},_removeClassFromMFP:function(a){this.bgOverlay.removeClass(a),b.wrap.removeClass(a)},_hasScrollBar:function(a){return(b.isIE7?d.height():document.body.scrollHeight)>(a||v.height())},_setFocus:function(){(b.st.focus?b.content.find(b.st.focus).eq(0):b.wrap).focus()},_onFocusIn:function(c){return c.target===b.wrap[0]||a.contains(b.wrap[0],c.target)?void 0:(b._setFocus(),!1)},_parseMarkup:function(b,c,d){var e;d.data&&(c=a.extend(d.data,c)),y(l,[b,c,d]),a.each(c,function(c,d){if(void 0===d||d===!1)return!0;if(e=c.split("_"),e.length>1){var f=b.find(p+"-"+e[0]);if(f.length>0){var g=e[1];"replaceWith"===g?f[0]!==d[0]&&f.replaceWith(d):"img"===g?f.is("img")?f.attr("src",d):f.replaceWith(a("<img>").attr("src",d).attr("class",f.attr("class"))):f.attr(e[1],d)}}else b.find(p+"-"+c).html(d)})},_getScrollbarSize:function(){if(void 0===b.scrollbarSize){var a=document.createElement("div");a.style.cssText="width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;",document.body.appendChild(a),b.scrollbarSize=a.offsetWidth-a.clientWidth,document.body.removeChild(a)}return b.scrollbarSize}},a.magnificPopup={instance:null,proto:t.prototype,modules:[],open:function(b,c){return A(),b=b?a.extend(!0,{},b):{},b.isObj=!0,b.index=c||0,this.instance.open(b)},close:function(){return a.magnificPopup.instance&&a.magnificPopup.instance.close()},registerModule:function(b,c){c.options&&(a.magnificPopup.defaults[b]=c.options),a.extend(this.proto,c.proto),this.modules.push(b)},defaults:{disableOn:0,key:null,midClick:!1,mainClass:"",preloader:!0,focus:"",closeOnContentClick:!1,closeOnBgClick:!0,closeBtnInside:!0,showCloseBtn:!0,enableEscapeKey:!0,modal:!1,alignTop:!1,removalDelay:0,prependTo:null,fixedContentPos:"auto",fixedBgPos:"auto",overflowY:"auto",closeMarkup:'<button title="%title%" type="button" class="mfp-close">×</button>',tClose:"Close (Esc)",tLoading:"Loading...",autoFocusLast:!0}},a.fn.magnificPopup=function(c){A();var d=a(this);if("string"==typeof c)if("open"===c){var e,f=u?d.data("magnificPopup"):d[0].magnificPopup,g=parseInt(arguments[1],10)||0;f.items?e=f.items[g]:(e=d,f.delegate&&(e=e.find(f.delegate)),e=e.eq(g)),b._openClick({mfpEl:e},d,f)}else b.isOpen&&b[c].apply(b,Array.prototype.slice.call(arguments,1));else c=a.extend(!0,{},c),u?d.data("magnificPopup",c):d[0].magnificPopup=c,b.addGroup(d,c);return d};var C,D,E,F="inline",G=function(){E&&(D.after(E.addClass(C)).detach(),E=null)};a.magnificPopup.registerModule(F,{options:{hiddenClass:"hide",markup:"",tNotFound:"Content not found"},proto:{initInline:function(){b.types.push(F),w(h+"."+F,function(){G()})},getInline:function(c,d){if(G(),c.src){var e=b.st.inline,f=a(c.src);if(f.length){var g=f[0].parentNode;g&&g.tagName&&(D||(C=e.hiddenClass,D=x(C),C="mfp-"+C),E=f.after(D).detach().removeClass(C)),b.updateStatus("ready")}else b.updateStatus("error",e.tNotFound),f=a("<div>");return c.inlineElement=f,f}return b.updateStatus("ready"),b._parseMarkup(d,{},c),d}}});var H,I="ajax",J=function(){H&&a(document.body).removeClass(H)},K=function(){J(),b.req&&b.req.abort()};a.magnificPopup.registerModule(I,{options:{settings:null,cursor:"mfp-ajax-cur",tError:'<a href="%url%">The content</a> could not be loaded.'},proto:{initAjax:function(){b.types.push(I),H=b.st.ajax.cursor,w(h+"."+I,K),w("BeforeChange."+I,K)},getAjax:function(c){H&&a(document.body).addClass(H),b.updateStatus("loading");var d=a.extend({url:c.src,success:function(d,e,f){var g={data:d,xhr:f};y("ParseAjax",g),b.appendContent(a(g.data),I),c.finished=!0,J(),b._setFocus(),setTimeout(function(){b.wrap.addClass(q)},16),b.updateStatus("ready"),y("AjaxContentAdded")},error:function(){J(),c.finished=c.loadError=!0,b.updateStatus("error",b.st.ajax.tError.replace("%url%",c.src))}},b.st.ajax.settings);return b.req=a.ajax(d),""}}});var L,M=function(c){if(c.data&&void 0!==c.data.title)return c.data.title;var d=b.st.image.titleSrc;if(d){if(a.isFunction(d))return d.call(b,c);if(c.el)return c.el.attr(d)||""}return""};a.magnificPopup.registerModule("image",{options:{markup:'<div class="mfp-figure"><div class="mfp-close"></div><figure><div class="mfp-img"></div><figcaption><div class="mfp-bottom-bar"><div class="mfp-title"></div><div class="mfp-counter"></div></div></figcaption></figure></div>',cursor:"mfp-zoom-out-cur",titleSrc:"title",verticalFit:!0,tError:'<a href="%url%">The image</a> could not be loaded.'},proto:{initImage:function(){var c=b.st.image,d=".image";b.types.push("image"),w(m+d,function(){"image"===b.currItem.type&&c.cursor&&a(document.body).addClass(c.cursor)}),w(h+d,function(){c.cursor&&a(document.body).removeClass(c.cursor),v.off("resize"+p)}),w("Resize"+d,b.resizeImage),b.isLowIE&&w("AfterChange",b.resizeImage)},resizeImage:function(){var a=b.currItem;if(a&&a.img&&b.st.image.verticalFit){var c=0;b.isLowIE&&(c=parseInt(a.img.css("padding-top"),10)+parseInt(a.img.css("padding-bottom"),10)),a.img.css("max-height",b.wH-c)}},_onImageHasSize:function(a){a.img&&(a.hasSize=!0,L&&clearInterval(L),a.isCheckingImgSize=!1,y("ImageHasSize",a),a.imgHidden&&(b.content&&b.content.removeClass("mfp-loading"),a.imgHidden=!1))},findImageSize:function(a){var c=0,d=a.img[0],e=function(f){L&&clearInterval(L),L=setInterval(function(){return d.naturalWidth>0?void b._onImageHasSize(a):(c>200&&clearInterval(L),c++,void(3===c?e(10):40===c?e(50):100===c&&e(500)))},f)};e(1)},getImage:function(c,d){var e=0,f=function(){c&&(c.img[0].complete?(c.img.off(".mfploader"),c===b.currItem&&(b._onImageHasSize(c),b.updateStatus("ready")),c.hasSize=!0,c.loaded=!0,y("ImageLoadComplete")):(e++,200>e?setTimeout(f,100):g()))},g=function(){c&&(c.img.off(".mfploader"),c===b.currItem&&(b._onImageHasSize(c),b.updateStatus("error",h.tError.replace("%url%",c.src))),c.hasSize=!0,c.loaded=!0,c.loadError=!0)},h=b.st.image,i=d.find(".mfp-img");if(i.length){var j=document.createElement("img");j.className="mfp-img",c.el&&c.el.find("img").length&&(j.alt=c.el.find("img").attr("alt")),c.img=a(j).on("load.mfploader",f).on("error.mfploader",g),j.src=c.src,i.is("img")&&(c.img=c.img.clone()),j=c.img[0],j.naturalWidth>0?c.hasSize=!0:j.width||(c.hasSize=!1)}return b._parseMarkup(d,{title:M(c),img_replaceWith:c.img},c),b.resizeImage(),c.hasSize?(L&&clearInterval(L),c.loadError?(d.addClass("mfp-loading"),b.updateStatus("error",h.tError.replace("%url%",c.src))):(d.removeClass("mfp-loading"),b.updateStatus("ready")),d):(b.updateStatus("loading"),c.loading=!0,c.hasSize||(c.imgHidden=!0,d.addClass("mfp-loading"),b.findImageSize(c)),d)}}});var N,O=function(){return void 0===N&&(N=void 0!==document.createElement("p").style.MozTransform),N};a.magnificPopup.registerModule("zoom",{options:{enabled:!1,easing:"ease-in-out",duration:300,opener:function(a){return a.is("img")?a:a.find("img")}},proto:{initZoom:function(){var a,c=b.st.zoom,d=".zoom";if(c.enabled&&b.supportsTransition){var e,f,g=c.duration,j=function(a){var b=a.clone().removeAttr("style").removeAttr("class").addClass("mfp-animated-image"),d="all "+c.duration/1e3+"s "+c.easing,e={position:"fixed",zIndex:9999,left:0,top:0,"-webkit-backface-visibility":"hidden"},f="transition";return e["-webkit-"+f]=e["-moz-"+f]=e["-o-"+f]=e[f]=d,b.css(e),b},k=function(){b.content.css("visibility","visible")};w("BuildControls"+d,function(){if(b._allowZoom()){if(clearTimeout(e),b.content.css("visibility","hidden"),a=b._getItemToZoom(),!a)return void k();f=j(a),f.css(b._getOffset()),b.wrap.append(f),e=setTimeout(function(){f.css(b._getOffset(!0)),e=setTimeout(function(){k(),setTimeout(function(){f.remove(),a=f=null,y("ZoomAnimationEnded")},16)},g)},16)}}),w(i+d,function(){if(b._allowZoom()){if(clearTimeout(e),b.st.removalDelay=g,!a){if(a=b._getItemToZoom(),!a)return;f=j(a)}f.css(b._getOffset(!0)),b.wrap.append(f),b.content.css("visibility","hidden"),setTimeout(function(){f.css(b._getOffset())},16)}}),w(h+d,function(){b._allowZoom()&&(k(),f&&f.remove(),a=null)})}},_allowZoom:function(){return"image"===b.currItem.type},_getItemToZoom:function(){return b.currItem.hasSize?b.currItem.img:!1},_getOffset:function(c){var d;d=c?b.currItem.img:b.st.zoom.opener(b.currItem.el||b.currItem);var e=d.offset(),f=parseInt(d.css("padding-top"),10),g=parseInt(d.css("padding-bottom"),10);e.top-=a(window).scrollTop()-f;var h={width:d.width(),height:(u?d.innerHeight():d[0].offsetHeight)-g-f};return O()?h["-moz-transform"]=h.transform="translate("+e.left+"px,"+e.top+"px)":(h.left=e.left,h.top=e.top),h}}});var P="iframe",Q="//about:blank",R=function(a){if(b.currTemplate[P]){var c=b.currTemplate[P].find("iframe");c.length&&(a||(c[0].src=Q),b.isIE8&&c.css("display",a?"block":"none"))}};a.magnificPopup.registerModule(P,{options:{markup:'<div class="mfp-iframe-scaler"><div class="mfp-close"></div><iframe class="mfp-iframe" src="//about:blank" frameborder="0" allowfullscreen></iframe></div>',srcAction:"iframe_src",patterns:{youtube:{index:"youtube.com",id:"v=",src:"//www.youtube.com/embed/%id%?autoplay=1"},vimeo:{index:"vimeo.com/",id:"/",src:"//player.vimeo.com/video/%id%?autoplay=1"},gmaps:{index:"//maps.google.",src:"%id%&output=embed"}}},proto:{initIframe:function(){b.types.push(P),w("BeforeChange",function(a,b,c){b!==c&&(b===P?R():c===P&&R(!0))}),w(h+"."+P,function(){R()})},getIframe:function(c,d){var e=c.src,f=b.st.iframe;a.each(f.patterns,function(){return e.indexOf(this.index)>-1?(this.id&&(e="string"==typeof this.id?e.substr(e.lastIndexOf(this.id)+this.id.length,e.length):this.id.call(this,e)),e=this.src.replace("%id%",e),!1):void 0});var g={};return f.srcAction&&(g[f.srcAction]=e),b._parseMarkup(d,g,c),b.updateStatus("ready"),d}}});var S=function(a){var c=b.items.length;return a>c-1?a-c:0>a?c+a:a},T=function(a,b,c){return a.replace(/%curr%/gi,b+1).replace(/%total%/gi,c)};a.magnificPopup.registerModule("gallery",{options:{enabled:!1,arrowMarkup:'<button title="%title%" type="button" class="mfp-arrow mfp-arrow-%dir%"></button>',preload:[0,2],navigateByImgClick:!0,arrows:!0,tPrev:"Previous (Left arrow key)",tNext:"Next (Right arrow key)",tCounter:"%curr% of %total%"},proto:{initGallery:function(){var c=b.st.gallery,e=".mfp-gallery";return b.direction=!0,c&&c.enabled?(f+=" mfp-gallery",w(m+e,function(){c.navigateByImgClick&&b.wrap.on("click"+e,".mfp-img",function(){return b.items.length>1?(b.next(),!1):void 0}),d.on("keydown"+e,function(a){37===a.keyCode?b.prev():39===a.keyCode&&b.next()})}),w("UpdateStatus"+e,function(a,c){c.text&&(c.text=T(c.text,b.currItem.index,b.items.length))}),w(l+e,function(a,d,e,f){var g=b.items.length;e.counter=g>1?T(c.tCounter,f.index,g):""}),w("BuildControls"+e,function(){if(b.items.length>1&&c.arrows&&!b.arrowLeft){var d=c.arrowMarkup,e=b.arrowLeft=a(d.replace(/%title%/gi,c.tPrev).replace(/%dir%/gi,"left")).addClass(s),f=b.arrowRight=a(d.replace(/%title%/gi,c.tNext).replace(/%dir%/gi,"right")).addClass(s);e.click(function(){b.prev()}),f.click(function(){b.next()}),b.container.append(e.add(f))}}),w(n+e,function(){b._preloadTimeout&&clearTimeout(b._preloadTimeout),b._preloadTimeout=setTimeout(function(){b.preloadNearbyImages(),b._preloadTimeout=null},16)}),void w(h+e,function(){d.off(e),b.wrap.off("click"+e),b.arrowRight=b.arrowLeft=null})):!1},next:function(){b.direction=!0,b.index=S(b.index+1),b.updateItemHTML()},prev:function(){b.direction=!1,b.index=S(b.index-1),b.updateItemHTML()},goTo:function(a){b.direction=a>=b.index,b.index=a,b.updateItemHTML()},preloadNearbyImages:function(){var a,c=b.st.gallery.preload,d=Math.min(c[0],b.items.length),e=Math.min(c[1],b.items.length);for(a=1;a<=(b.direction?e:d);a++)b._preloadItem(b.index+a);for(a=1;a<=(b.direction?d:e);a++)b._preloadItem(b.index-a)},_preloadItem:function(c){if(c=S(c),!b.items[c].preloaded){var d=b.items[c];d.parsed||(d=b.parseEl(c)),y("LazyLoad",d),"image"===d.type&&(d.img=a('<img class="mfp-img" />').on("load.mfploader",function(){d.hasSize=!0}).on("error.mfploader",function(){d.hasSize=!0,d.loadError=!0,y("LazyLoadError",d)}).attr("src",d.src)),d.preloaded=!0}}}});var U="retina";a.magnificPopup.registerModule(U,{options:{replaceSrc:function(a){return a.src.replace(/\.\w+$/,function(a){return"@2x"+a})},ratio:1},proto:{initRetina:function(){if(window.devicePixelRatio>1){var a=b.st.retina,c=a.ratio;c=isNaN(c)?c():c,c>1&&(w("ImageHasSize."+U,function(a,b){b.img.css({"max-width":b.img[0].naturalWidth/c,width:"100%"})}),w("ElementParse."+U,function(b,d){d.src=a.replaceSrc(d,c)}))}}}}),A()});
|
assets/mag-popup/magnific-popup.css
ADDED
@@ -0,0 +1,351 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* Magnific Popup CSS */
|
2 |
+
.mfp-bg {
|
3 |
+
top: 0;
|
4 |
+
left: 0;
|
5 |
+
width: 100%;
|
6 |
+
height: 100%;
|
7 |
+
z-index: 1042;
|
8 |
+
overflow: hidden;
|
9 |
+
position: fixed;
|
10 |
+
background: #0b0b0b;
|
11 |
+
opacity: 0.8; }
|
12 |
+
|
13 |
+
.mfp-wrap {
|
14 |
+
top: 0;
|
15 |
+
left: 0;
|
16 |
+
width: 100%;
|
17 |
+
height: 100%;
|
18 |
+
z-index: 1043;
|
19 |
+
position: fixed;
|
20 |
+
outline: none !important;
|
21 |
+
-webkit-backface-visibility: hidden; }
|
22 |
+
|
23 |
+
.mfp-container {
|
24 |
+
text-align: center;
|
25 |
+
position: absolute;
|
26 |
+
width: 100%;
|
27 |
+
height: 100%;
|
28 |
+
left: 0;
|
29 |
+
top: 0;
|
30 |
+
padding: 0 8px;
|
31 |
+
box-sizing: border-box; }
|
32 |
+
|
33 |
+
.mfp-container:before {
|
34 |
+
content: '';
|
35 |
+
display: inline-block;
|
36 |
+
height: 100%;
|
37 |
+
vertical-align: middle; }
|
38 |
+
|
39 |
+
.mfp-align-top .mfp-container:before {
|
40 |
+
display: none; }
|
41 |
+
|
42 |
+
.mfp-content {
|
43 |
+
position: relative;
|
44 |
+
display: inline-block;
|
45 |
+
vertical-align: middle;
|
46 |
+
margin: 0 auto;
|
47 |
+
text-align: left;
|
48 |
+
z-index: 1045; }
|
49 |
+
|
50 |
+
.mfp-inline-holder .mfp-content,
|
51 |
+
.mfp-ajax-holder .mfp-content {
|
52 |
+
width: 100%;
|
53 |
+
cursor: auto; }
|
54 |
+
|
55 |
+
.mfp-ajax-cur {
|
56 |
+
cursor: progress; }
|
57 |
+
|
58 |
+
.mfp-zoom-out-cur, .mfp-zoom-out-cur .mfp-image-holder .mfp-close {
|
59 |
+
cursor: -moz-zoom-out;
|
60 |
+
cursor: -webkit-zoom-out;
|
61 |
+
cursor: zoom-out; }
|
62 |
+
|
63 |
+
.mfp-zoom {
|
64 |
+
cursor: pointer;
|
65 |
+
cursor: -webkit-zoom-in;
|
66 |
+
cursor: -moz-zoom-in;
|
67 |
+
cursor: zoom-in; }
|
68 |
+
|
69 |
+
.mfp-auto-cursor .mfp-content {
|
70 |
+
cursor: auto; }
|
71 |
+
|
72 |
+
.mfp-close,
|
73 |
+
.mfp-arrow,
|
74 |
+
.mfp-preloader,
|
75 |
+
.mfp-counter {
|
76 |
+
-webkit-user-select: none;
|
77 |
+
-moz-user-select: none;
|
78 |
+
user-select: none; }
|
79 |
+
|
80 |
+
.mfp-loading.mfp-figure {
|
81 |
+
display: none; }
|
82 |
+
|
83 |
+
.mfp-hide {
|
84 |
+
display: none !important; }
|
85 |
+
|
86 |
+
.mfp-preloader {
|
87 |
+
color: #CCC;
|
88 |
+
position: absolute;
|
89 |
+
top: 50%;
|
90 |
+
width: auto;
|
91 |
+
text-align: center;
|
92 |
+
margin-top: -0.8em;
|
93 |
+
left: 8px;
|
94 |
+
right: 8px;
|
95 |
+
z-index: 1044; }
|
96 |
+
.mfp-preloader a {
|
97 |
+
color: #CCC; }
|
98 |
+
.mfp-preloader a:hover {
|
99 |
+
color: #FFF; }
|
100 |
+
|
101 |
+
.mfp-s-ready .mfp-preloader {
|
102 |
+
display: none; }
|
103 |
+
|
104 |
+
.mfp-s-error .mfp-content {
|
105 |
+
display: none; }
|
106 |
+
|
107 |
+
button.mfp-close,
|
108 |
+
button.mfp-arrow {
|
109 |
+
overflow: visible;
|
110 |
+
cursor: pointer;
|
111 |
+
background: transparent;
|
112 |
+
border: 0;
|
113 |
+
-webkit-appearance: none;
|
114 |
+
display: block;
|
115 |
+
outline: none;
|
116 |
+
padding: 0;
|
117 |
+
z-index: 1046;
|
118 |
+
box-shadow: none;
|
119 |
+
touch-action: manipulation; }
|
120 |
+
|
121 |
+
button::-moz-focus-inner {
|
122 |
+
padding: 0;
|
123 |
+
border: 0; }
|
124 |
+
|
125 |
+
.mfp-close {
|
126 |
+
width: 44px;
|
127 |
+
height: 44px;
|
128 |
+
line-height: 44px;
|
129 |
+
position: absolute;
|
130 |
+
right: 0;
|
131 |
+
top: 0;
|
132 |
+
text-decoration: none;
|
133 |
+
text-align: center;
|
134 |
+
opacity: 0.65;
|
135 |
+
padding: 0 0 18px 10px;
|
136 |
+
color: #FFF;
|
137 |
+
font-style: normal;
|
138 |
+
font-size: 28px;
|
139 |
+
font-family: Arial, Baskerville, monospace; }
|
140 |
+
.mfp-close:hover,
|
141 |
+
.mfp-close:focus {
|
142 |
+
opacity: 1; }
|
143 |
+
.mfp-close:active {
|
144 |
+
top: 1px; }
|
145 |
+
|
146 |
+
.mfp-close-btn-in .mfp-close {
|
147 |
+
color: #333; }
|
148 |
+
|
149 |
+
.mfp-image-holder .mfp-close,
|
150 |
+
.mfp-iframe-holder .mfp-close {
|
151 |
+
color: #FFF;
|
152 |
+
right: -6px;
|
153 |
+
text-align: right;
|
154 |
+
padding-right: 6px;
|
155 |
+
width: 100%; }
|
156 |
+
|
157 |
+
.mfp-counter {
|
158 |
+
position: absolute;
|
159 |
+
top: 0;
|
160 |
+
right: 0;
|
161 |
+
color: #CCC;
|
162 |
+
font-size: 12px;
|
163 |
+
line-height: 18px;
|
164 |
+
white-space: nowrap; }
|
165 |
+
|
166 |
+
.mfp-arrow {
|
167 |
+
position: absolute;
|
168 |
+
opacity: 0.65;
|
169 |
+
margin: 0;
|
170 |
+
top: 50%;
|
171 |
+
margin-top: -55px;
|
172 |
+
padding: 0;
|
173 |
+
width: 90px;
|
174 |
+
height: 110px;
|
175 |
+
-webkit-tap-highlight-color: transparent; }
|
176 |
+
.mfp-arrow:active {
|
177 |
+
margin-top: -54px; }
|
178 |
+
.mfp-arrow:hover,
|
179 |
+
.mfp-arrow:focus {
|
180 |
+
opacity: 1; }
|
181 |
+
.mfp-arrow:before,
|
182 |
+
.mfp-arrow:after {
|
183 |
+
content: '';
|
184 |
+
display: block;
|
185 |
+
width: 0;
|
186 |
+
height: 0;
|
187 |
+
position: absolute;
|
188 |
+
left: 0;
|
189 |
+
top: 0;
|
190 |
+
margin-top: 35px;
|
191 |
+
margin-left: 35px;
|
192 |
+
border: medium inset transparent; }
|
193 |
+
.mfp-arrow:after {
|
194 |
+
border-top-width: 13px;
|
195 |
+
border-bottom-width: 13px;
|
196 |
+
top: 8px; }
|
197 |
+
.mfp-arrow:before {
|
198 |
+
border-top-width: 21px;
|
199 |
+
border-bottom-width: 21px;
|
200 |
+
opacity: 0.7; }
|
201 |
+
|
202 |
+
.mfp-arrow-left {
|
203 |
+
left: 0; }
|
204 |
+
.mfp-arrow-left:after {
|
205 |
+
border-right: 17px solid #FFF;
|
206 |
+
margin-left: 31px; }
|
207 |
+
.mfp-arrow-left:before {
|
208 |
+
margin-left: 25px;
|
209 |
+
border-right: 27px solid #3F3F3F; }
|
210 |
+
|
211 |
+
.mfp-arrow-right {
|
212 |
+
right: 0; }
|
213 |
+
.mfp-arrow-right:after {
|
214 |
+
border-left: 17px solid #FFF;
|
215 |
+
margin-left: 39px; }
|
216 |
+
.mfp-arrow-right:before {
|
217 |
+
border-left: 27px solid #3F3F3F; }
|
218 |
+
|
219 |
+
.mfp-iframe-holder {
|
220 |
+
padding-top: 40px;
|
221 |
+
padding-bottom: 40px; }
|
222 |
+
.mfp-iframe-holder .mfp-content {
|
223 |
+
line-height: 0;
|
224 |
+
width: 100%;
|
225 |
+
max-width: 900px; }
|
226 |
+
.mfp-iframe-holder .mfp-close {
|
227 |
+
top: -40px; }
|
228 |
+
|
229 |
+
.mfp-iframe-scaler {
|
230 |
+
width: 100%;
|
231 |
+
height: 0;
|
232 |
+
overflow: hidden;
|
233 |
+
padding-top: 56.25%; }
|
234 |
+
.mfp-iframe-scaler iframe {
|
235 |
+
position: absolute;
|
236 |
+
display: block;
|
237 |
+
top: 0;
|
238 |
+
left: 0;
|
239 |
+
width: 100%;
|
240 |
+
height: 100%;
|
241 |
+
box-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
|
242 |
+
background: #000; }
|
243 |
+
|
244 |
+
/* Main image in popup */
|
245 |
+
img.mfp-img {
|
246 |
+
width: auto;
|
247 |
+
max-width: 100%;
|
248 |
+
height: auto;
|
249 |
+
display: block;
|
250 |
+
line-height: 0;
|
251 |
+
box-sizing: border-box;
|
252 |
+
padding: 40px 0 40px;
|
253 |
+
margin: 0 auto; }
|
254 |
+
|
255 |
+
/* The shadow behind the image */
|
256 |
+
.mfp-figure {
|
257 |
+
line-height: 0; }
|
258 |
+
.mfp-figure:after {
|
259 |
+
content: '';
|
260 |
+
position: absolute;
|
261 |
+
left: 0;
|
262 |
+
top: 40px;
|
263 |
+
bottom: 40px;
|
264 |
+
display: block;
|
265 |
+
right: 0;
|
266 |
+
width: auto;
|
267 |
+
height: auto;
|
268 |
+
z-index: -1;
|
269 |
+
box-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
|
270 |
+
background: #444; }
|
271 |
+
.mfp-figure small {
|
272 |
+
color: #BDBDBD;
|
273 |
+
display: block;
|
274 |
+
font-size: 12px;
|
275 |
+
line-height: 14px; }
|
276 |
+
.mfp-figure figure {
|
277 |
+
margin: 0; }
|
278 |
+
|
279 |
+
.mfp-bottom-bar {
|
280 |
+
margin-top: -36px;
|
281 |
+
position: absolute;
|
282 |
+
top: 100%;
|
283 |
+
left: 0;
|
284 |
+
width: 100%;
|
285 |
+
cursor: auto; }
|
286 |
+
|
287 |
+
.mfp-title {
|
288 |
+
text-align: left;
|
289 |
+
line-height: 18px;
|
290 |
+
color: #F3F3F3;
|
291 |
+
word-wrap: break-word;
|
292 |
+
padding-right: 36px; }
|
293 |
+
|
294 |
+
.mfp-image-holder .mfp-content {
|
295 |
+
max-width: 100%; }
|
296 |
+
|
297 |
+
.mfp-gallery .mfp-image-holder .mfp-figure {
|
298 |
+
cursor: pointer; }
|
299 |
+
|
300 |
+
@media screen and (max-width: 800px) and (orientation: landscape), screen and (max-height: 300px) {
|
301 |
+
/**
|
302 |
+
* Remove all paddings around the image on small screen
|
303 |
+
*/
|
304 |
+
.mfp-img-mobile .mfp-image-holder {
|
305 |
+
padding-left: 0;
|
306 |
+
padding-right: 0; }
|
307 |
+
.mfp-img-mobile img.mfp-img {
|
308 |
+
padding: 0; }
|
309 |
+
.mfp-img-mobile .mfp-figure:after {
|
310 |
+
top: 0;
|
311 |
+
bottom: 0; }
|
312 |
+
.mfp-img-mobile .mfp-figure small {
|
313 |
+
display: inline;
|
314 |
+
margin-left: 5px; }
|
315 |
+
.mfp-img-mobile .mfp-bottom-bar {
|
316 |
+
background: rgba(0, 0, 0, 0.6);
|
317 |
+
bottom: 0;
|
318 |
+
margin: 0;
|
319 |
+
top: auto;
|
320 |
+
padding: 3px 5px;
|
321 |
+
position: fixed;
|
322 |
+
box-sizing: border-box; }
|
323 |
+
.mfp-img-mobile .mfp-bottom-bar:empty {
|
324 |
+
padding: 0; }
|
325 |
+
.mfp-img-mobile .mfp-counter {
|
326 |
+
right: 5px;
|
327 |
+
top: 3px; }
|
328 |
+
.mfp-img-mobile .mfp-close {
|
329 |
+
top: 0;
|
330 |
+
right: 0;
|
331 |
+
width: 35px;
|
332 |
+
height: 35px;
|
333 |
+
line-height: 35px;
|
334 |
+
background: rgba(0, 0, 0, 0.6);
|
335 |
+
position: fixed;
|
336 |
+
text-align: center;
|
337 |
+
padding: 0; } }
|
338 |
+
|
339 |
+
@media all and (max-width: 900px) {
|
340 |
+
.mfp-arrow {
|
341 |
+
-webkit-transform: scale(0.75);
|
342 |
+
transform: scale(0.75); }
|
343 |
+
.mfp-arrow-left {
|
344 |
+
-webkit-transform-origin: 0;
|
345 |
+
transform-origin: 0; }
|
346 |
+
.mfp-arrow-right {
|
347 |
+
-webkit-transform-origin: 100%;
|
348 |
+
transform-origin: 100%; }
|
349 |
+
.mfp-container {
|
350 |
+
padding-left: 6px;
|
351 |
+
padding-right: 6px; } }
|
assets/mediaelement/mediaelement-and-player.min.js
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*!
|
2 |
+
* MediaElement.js
|
3 |
+
* http://www.mediaelementjs.com/
|
4 |
+
*
|
5 |
+
* Wrapper that mimics native HTML5 MediaElement (audio and video)
|
6 |
+
* using a variety of technologies (pure JavaScript, Flash, iframe)
|
7 |
+
*
|
8 |
+
* Copyright 2010-2017, John Dyer (http://j.hn/)
|
9 |
+
* License: MIT
|
10 |
+
*
|
11 |
+
*/
|
12 |
+
!function e(t,n,i){function o(a,s){if(!n[a]){if(!t[a]){var l="function"==typeof require&&require;if(!s&&l)return l(a,!0);if(r)return r(a,!0);var d=new Error("Cannot find module '"+a+"'");throw d.code="MODULE_NOT_FOUND",d}var u=n[a]={exports:{}};t[a][0].call(u.exports,function(e){var n=t[a][1][e];return o(n||e)},u,u.exports,e,t,n,i)}return n[a].exports}for(var r="function"==typeof require&&require,a=0;a<i.length;a++)o(i[a]);return o}({1:[function(e,t,n){},{}],2:[function(e,t,n){(function(n){var i,o=void 0!==n?n:"undefined"!=typeof window?window:{},r=e(1);"undefined"!=typeof document?i=document:(i=o["__GLOBAL_DOCUMENT_CACHE@4"])||(i=o["__GLOBAL_DOCUMENT_CACHE@4"]=r),t.exports=i}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{1:1}],3:[function(e,t,n){(function(e){var n;n="undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:{},t.exports=n}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],4:[function(e,t,n){!function(e){function n(){}function i(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],l(e,this)}function o(e,t){for(;3===e._state;)e=e._value;0!==e._state?(e._handled=!0,i._immediateFn(function(){var n=1===e._state?t.onFulfilled:t.onRejected;if(null!==n){var i;try{i=n(e._value)}catch(e){return void a(t.promise,e)}r(t.promise,i)}else(1===e._state?r:a)(t.promise,e._value)})):e._deferreds.push(t)}function r(e,t){try{if(t===e)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var n=t.then;if(t instanceof i)return e._state=3,e._value=t,void s(e);if("function"==typeof n)return void l(function(e,t){return function(){e.apply(t,arguments)}}(n,t),e)}e._state=1,e._value=t,s(e)}catch(t){a(e,t)}}function a(e,t){e._state=2,e._value=t,s(e)}function s(e){2===e._state&&0===e._deferreds.length&&i._immediateFn(function(){e._handled||i._unhandledRejectionFn(e._value)});for(var t=0,n=e._deferreds.length;t<n;t++)o(e,e._deferreds[t]);e._deferreds=null}function l(e,t){var n=!1;try{e(function(e){n||(n=!0,r(t,e))},function(e){n||(n=!0,a(t,e))})}catch(e){if(n)return;n=!0,a(t,e)}}var d=setTimeout;i.prototype.catch=function(e){return this.then(null,e)},i.prototype.then=function(e,t){var i=new this.constructor(n);return o(this,new function(e,t,n){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.promise=n}(e,t,i)),i},i.all=function(e){var t=Array.prototype.slice.call(e);return new i(function(e,n){function i(r,a){try{if(a&&("object"==typeof a||"function"==typeof a)){var s=a.then;if("function"==typeof s)return void s.call(a,function(e){i(r,e)},n)}t[r]=a,0==--o&&e(t)}catch(e){n(e)}}if(0===t.length)return e([]);for(var o=t.length,r=0;r<t.length;r++)i(r,t[r])})},i.resolve=function(e){return e&&"object"==typeof e&&e.constructor===i?e:new i(function(t){t(e)})},i.reject=function(e){return new i(function(t,n){n(e)})},i.race=function(e){return new i(function(t,n){for(var i=0,o=e.length;i<o;i++)e[i].then(t,n)})},i._immediateFn="function"==typeof setImmediate&&function(e){setImmediate(e)}||function(e){d(e,0)},i._unhandledRejectionFn=function(e){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",e)},i._setImmediateFn=function(e){i._immediateFn=e},i._setUnhandledRejectionFn=function(e){i._unhandledRejectionFn=e},void 0!==t&&t.exports?t.exports=i:e.Promise||(e.Promise=i)}(this)},{}],5:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o=function(e){return e&&e.__esModule?e:{default:e}}(e(7)),r=e(15),a=e(27),s={lang:"en",en:r.EN};s.language=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];if(null!==t&&void 0!==t&&t.length){if("string"!=typeof t[0])throw new TypeError("Language code must be a string value");if(!/^[a-z]{2,3}((\-|_)[a-z]{2})?$/i.test(t[0]))throw new TypeError("Language code must have format 2-3 letters and. optionally, hyphen, underscore followed by 2 more letters");s.lang=t[0],void 0===s[t[0]]?(t[1]=null!==t[1]&&void 0!==t[1]&&"object"===i(t[1])?t[1]:{},s[t[0]]=(0,a.isObjectEmpty)(t[1])?r.EN:t[1]):null!==t[1]&&void 0!==t[1]&&"object"===i(t[1])&&(s[t[0]]=t[1])}return s.lang},s.t=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if("string"==typeof e&&e.length){var n=void 0,o=void 0,r=s.language(),l=function(e,t,n){if("object"!==(void 0===e?"undefined":i(e))||"number"!=typeof t||"number"!=typeof n)return e;return[function(){return arguments.length<=1?void 0:arguments[1]},function(){return 1===(arguments.length<=0?void 0:arguments[0])?arguments.length<=1?void 0:arguments[1]:arguments.length<=2?void 0:arguments[2]},function(){return 0===(arguments.length<=0?void 0:arguments[0])||1===(arguments.length<=0?void 0:arguments[0])?arguments.length<=1?void 0:arguments[1]:arguments.length<=2?void 0:arguments[2]},function(){return(arguments.length<=0?void 0:arguments[0])%10==1&&(arguments.length<=0?void 0:arguments[0])%100!=11?arguments.length<=1?void 0:arguments[1]:0!==(arguments.length<=0?void 0:arguments[0])?arguments.length<=2?void 0:arguments[2]:arguments.length<=3?void 0:arguments[3]},function(){return 1===(arguments.length<=0?void 0:arguments[0])||11===(arguments.length<=0?void 0:arguments[0])?arguments.length<=1?void 0:arguments[1]:2===(arguments.length<=0?void 0:arguments[0])||12===(arguments.length<=0?void 0:arguments[0])?arguments.length<=2?void 0:arguments[2]:(arguments.length<=0?void 0:arguments[0])>2&&(arguments.length<=0?void 0:arguments[0])<20?arguments.length<=3?void 0:arguments[3]:arguments.length<=4?void 0:arguments[4]},function(){return 1===(arguments.length<=0?void 0:arguments[0])?arguments.length<=1?void 0:arguments[1]:0===(arguments.length<=0?void 0:arguments[0])||(arguments.length<=0?void 0:arguments[0])%100>0&&(arguments.length<=0?void 0:arguments[0])%100<20?arguments.length<=2?void 0:arguments[2]:arguments.length<=3?void 0:arguments[3]},function(){return(arguments.length<=0?void 0:arguments[0])%10==1&&(arguments.length<=0?void 0:arguments[0])%100!=11?arguments.length<=1?void 0:arguments[1]:(arguments.length<=0?void 0:arguments[0])%10>=2&&((arguments.length<=0?void 0:arguments[0])%100<10||(arguments.length<=0?void 0:arguments[0])%100>=20)?arguments.length<=2?void 0:arguments[2]:[3]},function(){return(arguments.length<=0?void 0:arguments[0])%10==1&&(arguments.length<=0?void 0:arguments[0])%100!=11?arguments.length<=1?void 0:arguments[1]:(arguments.length<=0?void 0:arguments[0])%10>=2&&(arguments.length<=0?void 0:arguments[0])%10<=4&&((arguments.length<=0?void 0:arguments[0])%100<10||(arguments.length<=0?void 0:arguments[0])%100>=20)?arguments.length<=2?void 0:arguments[2]:arguments.length<=3?void 0:arguments[3]},function(){return 1===(arguments.length<=0?void 0:arguments[0])?arguments.length<=1?void 0:arguments[1]:(arguments.length<=0?void 0:arguments[0])>=2&&(arguments.length<=0?void 0:arguments[0])<=4?arguments.length<=2?void 0:arguments[2]:arguments.length<=3?void 0:arguments[3]},function(){return 1===(arguments.length<=0?void 0:arguments[0])?arguments.length<=1?void 0:arguments[1]:(arguments.length<=0?void 0:arguments[0])%10>=2&&(arguments.length<=0?void 0:arguments[0])%10<=4&&((arguments.length<=0?void 0:arguments[0])%100<10||(arguments.length<=0?void 0:arguments[0])%100>=20)?arguments.length<=2?void 0:arguments[2]:arguments.length<=3?void 0:arguments[3]},function(){return(arguments.length<=0?void 0:arguments[0])%100==1?arguments.length<=2?void 0:arguments[2]:(arguments.length<=0?void 0:arguments[0])%100==2?arguments.length<=3?void 0:arguments[3]:(arguments.length<=0?void 0:arguments[0])%100==3||(arguments.length<=0?void 0:arguments[0])%100==4?arguments.length<=4?void 0:arguments[4]:arguments.length<=1?void 0:arguments[1]},function(){return 1===(arguments.length<=0?void 0:arguments[0])?arguments.length<=1?void 0:arguments[1]:2===(arguments.length<=0?void 0:arguments[0])?arguments.length<=2?void 0:arguments[2]:(arguments.length<=0?void 0:arguments[0])>2&&(arguments.length<=0?void 0:arguments[0])<7?arguments.length<=3?void 0:arguments[3]:(arguments.length<=0?void 0:arguments[0])>6&&(arguments.length<=0?void 0:arguments[0])<11?arguments.length<=4?void 0:arguments[4]:arguments.length<=5?void 0:arguments[5]},function(){return 0===(arguments.length<=0?void 0:arguments[0])?arguments.length<=1?void 0:arguments[1]:1===(arguments.length<=0?void 0:arguments[0])?arguments.length<=2?void 0:arguments[2]:2===(arguments.length<=0?void 0:arguments[0])?arguments.length<=3?void 0:arguments[3]:(arguments.length<=0?void 0:arguments[0])%100>=3&&(arguments.length<=0?void 0:arguments[0])%100<=10?arguments.length<=4?void 0:arguments[4]:(arguments.length<=0?void 0:arguments[0])%100>=11?arguments.length<=5?void 0:arguments[5]:arguments.length<=6?void 0:arguments[6]},function(){return 1===(arguments.length<=0?void 0:arguments[0])?arguments.length<=1?void 0:arguments[1]:0===(arguments.length<=0?void 0:arguments[0])||(arguments.length<=0?void 0:arguments[0])%100>1&&(arguments.length<=0?void 0:arguments[0])%100<11?arguments.length<=2?void 0:arguments[2]:(arguments.length<=0?void 0:arguments[0])%100>10&&(arguments.length<=0?void 0:arguments[0])%100<20?arguments.length<=3?void 0:arguments[3]:arguments.length<=4?void 0:arguments[4]},function(){return(arguments.length<=0?void 0:arguments[0])%10==1?arguments.length<=1?void 0:arguments[1]:(arguments.length<=0?void 0:arguments[0])%10==2?arguments.length<=2?void 0:arguments[2]:arguments.length<=3?void 0:arguments[3]},function(){return 11!==(arguments.length<=0?void 0:arguments[0])&&(arguments.length<=0?void 0:arguments[0])%10==1?arguments.length<=1?void 0:arguments[1]:arguments.length<=2?void 0:arguments[2]},function(){return 1===(arguments.length<=0?void 0:arguments[0])?arguments.length<=1?void 0:arguments[1]:(arguments.length<=0?void 0:arguments[0])%10>=2&&(arguments.length<=0?void 0:arguments[0])%10<=4&&((arguments.length<=0?void 0:arguments[0])%100<10||(arguments.length<=0?void 0:arguments[0])%100>=20)?arguments.length<=2?void 0:arguments[2]:arguments.length<=3?void 0:arguments[3]},function(){return 1===(arguments.length<=0?void 0:arguments[0])?arguments.length<=1?void 0:arguments[1]:2===(arguments.length<=0?void 0:arguments[0])?arguments.length<=2?void 0:arguments[2]:8!==(arguments.length<=0?void 0:arguments[0])&&11!==(arguments.length<=0?void 0:arguments[0])?arguments.length<=3?void 0:arguments[3]:arguments.length<=4?void 0:arguments[4]},function(){return 0===(arguments.length<=0?void 0:arguments[0])?arguments.length<=1?void 0:arguments[1]:arguments.length<=2?void 0:arguments[2]},function(){return 1===(arguments.length<=0?void 0:arguments[0])?arguments.length<=1?void 0:arguments[1]:2===(arguments.length<=0?void 0:arguments[0])?arguments.length<=2?void 0:arguments[2]:3===(arguments.length<=0?void 0:arguments[0])?arguments.length<=3?void 0:arguments[3]:arguments.length<=4?void 0:arguments[4]},function(){return 0===(arguments.length<=0?void 0:arguments[0])?arguments.length<=1?void 0:arguments[1]:1===(arguments.length<=0?void 0:arguments[0])?arguments.length<=2?void 0:arguments[2]:arguments.length<=3?void 0:arguments[3]}][n].apply(null,[t].concat(e))};return void 0!==s[r]&&(n=s[r][e],null!==t&&"number"==typeof t&&(o=s[r]["mejs.plural-form"],n=l.apply(null,[n,t,o]))),!n&&s.en&&(n=s.en[e],null!==t&&"number"==typeof t&&(o=s.en["mejs.plural-form"],n=l.apply(null,[n,t,o]))),n=n||e,null!==t&&"number"==typeof t&&(n=n.replace("%1",t)),(0,a.escapeHTML)(n)}return e},o.default.i18n=s,"undefined"!=typeof mejsL10n&&o.default.i18n.language(mejsL10n.language,mejsL10n.strings),n.default=s},{15:15,27:27,7:7}],6:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(n,"__esModule",{value:!0});var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r=i(e(3)),a=i(e(2)),s=i(e(7)),l=e(27),d=e(28),u=e(8),c=e(25),f=function e(t,n,i){var f=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var p=this;i=Array.isArray(i)?i:null,p.defaults={renderers:[],fakeNodeName:"mediaelementwrapper",pluginPath:"build/",shimScriptAccess:"sameDomain"},n=Object.assign(p.defaults,n),p.mediaElement=a.default.createElement(n.fakeNodeName);var m=t,h=!1;if("string"==typeof t?p.mediaElement.originalNode=a.default.getElementById(t):(p.mediaElement.originalNode=t,m=t.id),void 0===p.mediaElement.originalNode||null===p.mediaElement.originalNode)return null;p.mediaElement.options=n,m=m||"mejs_"+Math.random().toString().slice(2),p.mediaElement.originalNode.setAttribute("id",m+"_from_mejs");var v=p.mediaElement.originalNode.tagName.toLowerCase();["video","audio"].indexOf(v)>-1&&!p.mediaElement.originalNode.getAttribute("preload")&&p.mediaElement.originalNode.setAttribute("preload","none"),p.mediaElement.originalNode.parentNode.insertBefore(p.mediaElement,p.mediaElement.originalNode),p.mediaElement.appendChild(p.mediaElement.originalNode);var g=function(e,t){if("https:"===r.default.location.protocol&&0===e.indexOf("http:")&&c.IS_IOS&&s.default.html5media.mediaTypes.indexOf(t)>-1){var n=new XMLHttpRequest;n.onreadystatechange=function(){if(4===this.readyState&&200===this.status){var t=(r.default.URL||r.default.webkitURL).createObjectURL(this.response);return p.mediaElement.originalNode.setAttribute("src",t),t}return e},n.open("GET",e),n.responseType="blob",n.send()}return e},y=void 0;if(null!==i)y=i;else if(null!==p.mediaElement.originalNode)switch(y=[],p.mediaElement.originalNode.nodeName.toLowerCase()){case"iframe":y.push({type:"",src:p.mediaElement.originalNode.getAttribute("src")});break;case"audio":case"video":var E=p.mediaElement.originalNode.children.length,b=p.mediaElement.originalNode.getAttribute("src");if(b){var S=p.mediaElement.originalNode,x=(0,d.formatType)(b,S.getAttribute("type"));y.push({type:x,src:g(b,x)})}for(var w=0;w<E;w++){var P=p.mediaElement.originalNode.children[w];if("source"===P.tagName.toLowerCase()){var T=P.getAttribute("src"),C=(0,d.formatType)(T,P.getAttribute("type"));y.push({type:C,src:g(T,C)})}}}p.mediaElement.id=m,p.mediaElement.renderers={},p.mediaElement.events={},p.mediaElement.promises=[],p.mediaElement.renderer=null,p.mediaElement.rendererName=null,p.mediaElement.changeRenderer=function(e,t){var n=f,i=Object.keys(t[0]).length>2?t[0]:t[0].src;if(void 0!==n.mediaElement.renderer&&null!==n.mediaElement.renderer&&n.mediaElement.renderer.name===e)return n.mediaElement.renderer.pause(),n.mediaElement.renderer.stop&&n.mediaElement.renderer.stop(),n.mediaElement.renderer.show(),n.mediaElement.renderer.setSrc(i),!0;void 0!==n.mediaElement.renderer&&null!==n.mediaElement.renderer&&(n.mediaElement.renderer.pause(),n.mediaElement.renderer.stop&&n.mediaElement.renderer.stop(),n.mediaElement.renderer.hide());var o=n.mediaElement.renderers[e],r=null;if(void 0!==o&&null!==o)return o.show(),o.setSrc(i),n.mediaElement.renderer=o,n.mediaElement.rendererName=e,!0;for(var a=n.mediaElement.options.renderers.length?n.mediaElement.options.renderers:u.renderer.order,s=0,l=a.length;s<l;s++){var d=a[s];if(d===e){r=u.renderer.renderers[d];var c=Object.assign(r.options,n.mediaElement.options);return o=r.create(n.mediaElement,c,t),o.name=e,n.mediaElement.renderers[r.name]=o,n.mediaElement.renderer=o,n.mediaElement.rendererName=e,o.show(),!0}}return!1},p.mediaElement.setSize=function(e,t){void 0!==p.mediaElement.renderer&&null!==p.mediaElement.renderer&&p.mediaElement.renderer.setSize(e,t)},p.mediaElement.generateError=function(e,t){e=e||"",t=Array.isArray(t)?t:[];var n=(0,l.createEvent)("error",p.mediaElement);n.message=e,n.urls=t,p.mediaElement.dispatchEvent(n),h=!0};var k=s.default.html5media.properties,_=s.default.html5media.methods,N=function(e,t,n,i){var o=e[t];Object.defineProperty(e,t,{get:function(){return n.apply(e,[o])},set:function(t){return o=i.apply(e,[t])}})},A=function(e){if("src"!==e){var t=""+e.substring(0,1).toUpperCase()+e.substring(1),n=function(){return void 0!==p.mediaElement.renderer&&null!==p.mediaElement.renderer&&"function"==typeof p.mediaElement.renderer["get"+t]?p.mediaElement.renderer["get"+t]():null},i=function(e){void 0!==p.mediaElement.renderer&&null!==p.mediaElement.renderer&&"function"==typeof p.mediaElement.renderer["set"+t]&&p.mediaElement.renderer["set"+t](e)};N(p.mediaElement,e,n,i),p.mediaElement["get"+t]=n,p.mediaElement["set"+t]=i}},L=function(){return void 0!==p.mediaElement.renderer&&null!==p.mediaElement.renderer?p.mediaElement.renderer.getSrc():null},F=function(e){var t=[];if("string"==typeof e)t.push({src:e,type:e?(0,d.getTypeFromFile)(e):""});else if("object"===(void 0===e?"undefined":o(e))&&void 0!==e.src){var n=(0,d.absolutizeUrl)(e.src),i=e.type,r=Object.assign(e,{src:n,type:""!==i&&null!==i&&void 0!==i||!n?i:(0,d.getTypeFromFile)(n)});t.push(r)}else if(Array.isArray(e))for(var a=0,s=e.length;a<s;a++){var c=(0,d.absolutizeUrl)(e[a].src),f=e[a].type,m=Object.assign(e[a],{src:c,type:""!==f&&null!==f&&void 0!==f||!c?f:(0,d.getTypeFromFile)(c)});t.push(m)}var h=u.renderer.select(t,p.mediaElement.options.renderers.length?p.mediaElement.options.renderers:[]),v=void 0;if(p.mediaElement.paused||(p.mediaElement.pause(),v=(0,l.createEvent)("pause",p.mediaElement),p.mediaElement.dispatchEvent(v)),p.mediaElement.originalNode.src=t[0].src||"",null!==h||!t[0].src)return t[0].src?p.mediaElement.changeRenderer(h.rendererName,t):null;p.mediaElement.generateError("No renderer found",t)},j=function(e,t){try{if("play"===e&&"native_dash"===p.mediaElement.rendererName){var n=p.mediaElement.renderer[e](t);n&&"function"==typeof n.then&&n.catch(function(){p.mediaElement.paused&&setTimeout(function(){var e=p.mediaElement.renderer.play();void 0!==e&&e.catch(function(){p.mediaElement.renderer.paused||p.mediaElement.renderer.pause()})},150)})}else p.mediaElement.renderer[e](t)}catch(e){p.mediaElement.generateError(e,y)}},I=function(e){p.mediaElement[e]=function(){for(var t=arguments.length,n=Array(t),i=0;i<t;i++)n[i]=arguments[i];return void 0!==p.mediaElement.renderer&&null!==p.mediaElement.renderer&&"function"==typeof p.mediaElement.renderer[e]&&(p.mediaElement.promises.length?Promise.all(p.mediaElement.promises).then(function(){j(e,n)}).catch(function(e){p.mediaElement.generateError(e,y)}):j(e,n)),null}};N(p.mediaElement,"src",L,F),p.mediaElement.getSrc=L,p.mediaElement.setSrc=F;for(var M=0,O=k.length;M<O;M++)A(k[M]);for(var D=0,V=_.length;D<V;D++)I(_[D]);return p.mediaElement.addEventListener=function(e,t){p.mediaElement.events[e]=p.mediaElement.events[e]||[],p.mediaElement.events[e].push(t)},p.mediaElement.removeEventListener=function(e,t){if(!e)return p.mediaElement.events={},!0;var n=p.mediaElement.events[e];if(!n)return!0;if(!t)return p.mediaElement.events[e]=[],!0;for(var i=0;i<n.length;i++)if(n[i]===t)return p.mediaElement.events[e].splice(i,1),!0;return!1},p.mediaElement.dispatchEvent=function(e){var t=p.mediaElement.events[e.type];if(t)for(var n=0;n<t.length;n++)t[n].apply(null,[e])},p.mediaElement.destroy=function(){var e=p.mediaElement.originalNode.cloneNode(!0),t=p.mediaElement.parentElement;e.removeAttribute("id"),e.remove(),p.mediaElement.remove(),t.append(e)},y.length&&(p.mediaElement.src=y),p.mediaElement.promises.length?Promise.all(p.mediaElement.promises).then(function(){p.mediaElement.options.success&&p.mediaElement.options.success(p.mediaElement,p.mediaElement.originalNode)}).catch(function(){h&&p.mediaElement.options.error&&p.mediaElement.options.error(p.mediaElement,p.mediaElement.originalNode)}):(p.mediaElement.options.success&&p.mediaElement.options.success(p.mediaElement,p.mediaElement.originalNode),h&&p.mediaElement.options.error&&p.mediaElement.options.error(p.mediaElement,p.mediaElement.originalNode)),p.mediaElement};r.default.MediaElement=f,s.default.MediaElement=f,n.default=f},{2:2,25:25,27:27,28:28,3:3,7:7,8:8}],7:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=function(e){return e&&e.__esModule?e:{default:e}}(e(3)),o={};o.version="4.2.8",o.html5media={properties:["volume","src","currentTime","muted","duration","paused","ended","buffered","error","networkState","readyState","seeking","seekable","currentSrc","preload","bufferedBytes","bufferedTime","initialTime","startOffsetTime","defaultPlaybackRate","playbackRate","played","autoplay","loop","controls"],readOnlyProperties:["duration","paused","ended","buffered","error","networkState","readyState","seeking","seekable"],methods:["load","play","pause","canPlayType"],events:["loadstart","durationchange","loadedmetadata","loadeddata","progress","canplay","canplaythrough","suspend","abort","error","emptied","stalled","play","playing","pause","waiting","seeking","seeked","timeupdate","ended","ratechange","volumechange"],mediaTypes:["audio/mp3","audio/ogg","audio/oga","audio/wav","audio/x-wav","audio/wave","audio/x-pn-wav","audio/mpeg","audio/mp4","video/mp4","video/webm","video/ogg","video/ogv"]},i.default.mejs=o,n.default=o},{3:3}],8:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.renderer=void 0;var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=function(e){return e&&e.__esModule?e:{default:e}}(e(7)),a=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.renderers={},this.order=[]}return o(e,[{key:"add",value:function(e){if(void 0===e.name)throw new TypeError("renderer must contain at least `name` property");this.renderers[e.name]=e,this.order.push(e.name)}},{key:"select",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=t.length;if(t=t.length?t:this.order,!n){var i=[/^(html5|native)/i,/^flash/i,/iframe$/i],o=function(e){for(var t=0,n=i.length;t<n;t++)if(i[t].test(e))return t;return i.length};t.sort(function(e,t){return o(e)-o(t)})}for(var r=0,a=t.length;r<a;r++){var s=t[r],l=this.renderers[s];if(null!==l&&void 0!==l)for(var d=0,u=e.length;d<u;d++)if("function"==typeof l.canPlayType&&"string"==typeof e[d].type&&l.canPlayType(e[d].type))return{rendererName:l.name,src:e[d].src}}return null}},{key:"order",set:function(e){if(!Array.isArray(e))throw new TypeError("order must be an array of strings.");this._order=e},get:function(){return this._order}},{key:"renderers",set:function(e){if(null!==e&&"object"!==(void 0===e?"undefined":i(e)))throw new TypeError("renderers must be an array of objects.");this._renderers=e},get:function(){return this._renderers}}]),e}(),s=n.renderer=new a;r.default.Renderers=s},{7:7}],9:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}var o=i(e(3)),r=i(e(2)),a=i(e(5)),s=e(16),l=i(s),d=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(e(25)),u=e(27),c=e(26),f=e(28);Object.assign(s.config,{usePluginFullScreen:!0,fullscreenText:null,useFakeFullscreen:!1}),Object.assign(l.default.prototype,{isFullScreen:!1,isNativeFullScreen:!1,isInIframe:!1,isPluginClickThroughCreated:!1,fullscreenMode:"",containerSizeTimeout:null,buildfullscreen:function(e){if(e.isVideo){e.isInIframe=o.default.location!==o.default.parent.location,e.detectFullscreenMode();var t=this,n=(0,u.isString)(t.options.fullscreenText)?t.options.fullscreenText:a.default.t("mejs.fullscreen"),i=r.default.createElement("div");if(i.className=t.options.classPrefix+"button "+t.options.classPrefix+"fullscreen-button",i.innerHTML='<button type="button" aria-controls="'+t.id+'" title="'+n+'" aria-label="'+n+'" tabindex="0"></button>',t.addControlElement(i,"fullscreen"),i.addEventListener("click",function(){d.HAS_TRUE_NATIVE_FULLSCREEN&&d.IS_FULLSCREEN||e.isFullScreen?e.exitFullScreen():e.enterFullScreen()}),e.fullscreenBtn=i,t.options.keyActions.push({keys:[70],action:function(e,t,n,i){i.ctrlKey||void 0!==e.enterFullScreen&&(e.isFullScreen?e.exitFullScreen():e.enterFullScreen())}}),t.exitFullscreenCallback=function(n){27===(n.which||n.keyCode||0)&&(d.HAS_TRUE_NATIVE_FULLSCREEN&&d.IS_FULLSCREEN||t.isFullScreen)&&e.exitFullScreen()},t.globalBind("keydown",t.exitFullscreenCallback),t.normalHeight=0,t.normalWidth=0,d.HAS_TRUE_NATIVE_FULLSCREEN){e.globalBind(d.FULLSCREEN_EVENT_NAME,function(){e.isFullScreen&&(d.isFullScreen()?(e.isNativeFullScreen=!0,e.setControlsSize()):(e.isNativeFullScreen=!1,e.exitFullScreen()))})}}},cleanfullscreen:function(e){e.exitFullScreen(),e.globalUnbind("keydown",e.exitFullscreenCallback)},detectFullscreenMode:function(){var e=null!==this.media.rendererName&&/(native|html5)/i.test(this.media.rendererName),t="";return d.HAS_TRUE_NATIVE_FULLSCREEN&&e?t="native-native":d.HAS_TRUE_NATIVE_FULLSCREEN&&!e?t="plugin-native":this.usePluginFullScreen&&d.SUPPORT_POINTER_EVENTS&&(t="plugin-click"),this.fullscreenMode=t,t},enterFullScreen:function(){var e=this,t=null!==e.media.rendererName&&/(html5|native)/i.test(e.media.rendererName),n=getComputedStyle(e.getElement(e.container));if(!1===e.options.useFakeFullscreen&&d.IS_IOS&&d.HAS_IOS_FULLSCREEN&&"function"==typeof e.media.originalNode.webkitEnterFullscreen&&e.media.originalNode.canPlayType((0,f.getTypeFromFile)(e.media.getSrc())))e.media.originalNode.webkitEnterFullscreen();else{if((0,c.addClass)(r.default.documentElement,e.options.classPrefix+"fullscreen"),(0,c.addClass)(e.getElement(e.container),e.options.classPrefix+"container-fullscreen"),e.normalHeight=parseFloat(n.height),e.normalWidth=parseFloat(n.width),"native-native"!==e.fullscreenMode&&"plugin-native"!==e.fullscreenMode||(d.requestFullScreen(e.getElement(e.container)),e.isInIframe&&setTimeout(function t(){if(e.isNativeFullScreen){var n=o.default.innerWidth||r.default.documentElement.clientWidth||r.default.body.clientWidth,i=screen.width;Math.abs(i-n)>.002*i?e.exitFullScreen():setTimeout(t,500)}},1e3)),e.getElement(e.container).style.width="100%",e.getElement(e.container).style.height="100%",e.containerSizeTimeout=setTimeout(function(){e.getElement(e.container).style.width="100%",e.getElement(e.container).style.height="100%",e.setControlsSize()},500),t)e.node.style.width="100%",e.node.style.height="100%";else for(var i=e.getElement(e.container).querySelectorAll("embed, object, video"),a=i.length,s=0;s<a;s++)i[s].style.width="100%",i[s].style.height="100%";e.options.setDimensions&&"function"==typeof e.media.setSize&&e.media.setSize(screen.width,screen.height);for(var l=e.getElement(e.layers).children,p=l.length,m=0;m<p;m++)l[m].style.width="100%",l[m].style.height="100%";e.fullscreenBtn&&((0,c.removeClass)(e.fullscreenBtn,e.options.classPrefix+"fullscreen"),(0,c.addClass)(e.fullscreenBtn,e.options.classPrefix+"unfullscreen")),e.setControlsSize(),e.isFullScreen=!0;var h=Math.min(screen.width/e.width,screen.height/e.height),v=e.getElement(e.container).querySelector("."+e.options.classPrefix+"captions-text");v&&(v.style.fontSize=100*h+"%",v.style.lineHeight="normal",e.getElement(e.container).querySelector("."+e.options.classPrefix+"captions-position").style.bottom=(screen.height-e.normalHeight)/2-e.getElement(e.controls).offsetHeight/2+h+15+"px");var g=(0,u.createEvent)("enteredfullscreen",e.getElement(e.container));e.getElement(e.container).dispatchEvent(g)}},exitFullScreen:function(){var e=null!==this.media.rendererName&&/(native|html5)/i.test(this.media.rendererName);if(clearTimeout(this.containerSizeTimeout),d.HAS_TRUE_NATIVE_FULLSCREEN&&(d.IS_FULLSCREEN||this.isFullScreen)&&d.cancelFullScreen(),(0,c.removeClass)(r.default.documentElement,this.options.classPrefix+"fullscreen"),(0,c.removeClass)(this.getElement(this.container),this.options.classPrefix+"container-fullscreen"),this.options.setDimensions){if(this.getElement(this.container).style.width=this.normalWidth+"px",this.getElement(this.container).style.height=this.normalHeight+"px",e)this.node.style.width=this.normalWidth+"px",this.node.style.height=this.normalHeight+"px";else for(var t=this.getElement(this.container).querySelectorAll("embed, object, video"),n=t.length,i=0;i<n;i++)t[i].style.width=this.normalWidth+"px",t[i].style.height=this.normalHeight+"px";"function"==typeof this.media.setSize&&this.media.setSize(this.normalWidth,this.normalHeight);for(var o=this.getElement(this.layers).children,a=o.length,s=0;s<a;s++)o[s].style.width=this.normalWidth+"px",o[s].style.height=this.normalHeight+"px"}this.fullscreenBtn&&((0,c.removeClass)(this.fullscreenBtn,this.options.classPrefix+"unfullscreen"),(0,c.addClass)(this.fullscreenBtn,this.options.classPrefix+"fullscreen")),this.setControlsSize(),this.isFullScreen=!1;var l=this.getElement(this.container).querySelector("."+this.options.classPrefix+"captions-text");l&&(l.style.fontSize="",l.style.lineHeight="",this.getElement(this.container).querySelector("."+this.options.classPrefix+"captions-position").style.bottom="");var f=(0,u.createEvent)("exitedfullscreen",this.getElement(this.container));this.getElement(this.container).dispatchEvent(f)}})},{16:16,2:2,25:25,26:26,27:27,28:28,3:3,5:5}],10:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}var o=i(e(2)),r=e(16),a=i(r),s=i(e(5)),l=e(27),d=e(26);Object.assign(r.config,{playText:null,pauseText:null}),Object.assign(a.default.prototype,{buildplaypause:function(e,t,n,i){function r(e){"play"===e?((0,d.removeClass)(p,a.options.classPrefix+"play"),(0,d.removeClass)(p,a.options.classPrefix+"replay"),(0,d.addClass)(p,a.options.classPrefix+"pause"),m.setAttribute("title",f),m.setAttribute("aria-label",f)):((0,d.removeClass)(p,a.options.classPrefix+"pause"),(0,d.removeClass)(p,a.options.classPrefix+"replay"),(0,d.addClass)(p,a.options.classPrefix+"play"),m.setAttribute("title",c),m.setAttribute("aria-label",c))}var a=this,u=a.options,c=(0,l.isString)(u.playText)?u.playText:s.default.t("mejs.play"),f=(0,l.isString)(u.pauseText)?u.pauseText:s.default.t("mejs.pause"),p=o.default.createElement("div");p.className=a.options.classPrefix+"button "+a.options.classPrefix+"playpause-button "+a.options.classPrefix+"play",p.innerHTML='<button type="button" aria-controls="'+a.id+'" title="'+c+'" aria-label="'+f+'" tabindex="0"></button>',p.addEventListener("click",function(){a.paused?a.play():a.pause()});var m=p.querySelector("button");a.addControlElement(p,"playpause"),r("pse"),i.addEventListener("loadedmetadata",function(){-1===i.rendererName.indexOf("flash")&&r("pse")}),i.addEventListener("play",function(){r("play")}),i.addEventListener("playing",function(){r("play")}),i.addEventListener("pause",function(){r("pse")}),i.addEventListener("ended",function(){e.options.loop||((0,d.removeClass)(p,a.options.classPrefix+"pause"),(0,d.removeClass)(p,a.options.classPrefix+"play"),(0,d.addClass)(p,a.options.classPrefix+"replay"),m.setAttribute("title",c),m.setAttribute("aria-label",c))})}})},{16:16,2:2,26:26,27:27,5:5}],11:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}var o=i(e(2)),r=e(16),a=i(r),s=i(e(5)),l=e(25),d=e(30),u=e(26);Object.assign(r.config,{enableProgressTooltip:!0,useSmoothHover:!0,forceLive:!1}),Object.assign(a.default.prototype,{buildprogress:function(e,t,n,i){var a=0,c=!1,f=!1,p=this,m=e.options.autoRewind,h=e.options.enableProgressTooltip?'<span class="'+p.options.classPrefix+'time-float"><span class="'+p.options.classPrefix+'time-float-current">00:00</span><span class="'+p.options.classPrefix+'time-float-corner"></span></span>':"",v=o.default.createElement("div");v.className=p.options.classPrefix+"time-rail",v.innerHTML='<span class="'+p.options.classPrefix+"time-total "+p.options.classPrefix+'time-slider"><span class="'+p.options.classPrefix+'time-buffering"></span><span class="'+p.options.classPrefix+'time-loaded"></span><span class="'+p.options.classPrefix+'time-current"></span><span class="'+p.options.classPrefix+'time-hovered no-hover"></span><span class="'+p.options.classPrefix+'time-handle"><span class="'+p.options.classPrefix+'time-handle-content"></span></span>'+h+"</span>",p.addControlElement(v,"progress"),p.options.keyActions.push({keys:[37,227],action:function(e){if(!isNaN(e.duration)&&e.duration>0){e.isVideo&&(e.showControls(),e.startControlsTimer()),e.getElement(e.container).querySelector("."+r.config.classPrefix+"time-total").focus();var t=Math.max(e.currentTime-e.options.defaultSeekBackwardInterval(e),0);e.setCurrentTime(t)}}},{keys:[39,228],action:function(e){if(!isNaN(e.duration)&&e.duration>0){e.isVideo&&(e.showControls(),e.startControlsTimer()),e.getElement(e.container).querySelector("."+r.config.classPrefix+"time-total").focus();var t=Math.min(e.currentTime+e.options.defaultSeekForwardInterval(e),e.duration);e.setCurrentTime(t)}}}),p.rail=t.querySelector("."+p.options.classPrefix+"time-rail"),p.total=t.querySelector("."+p.options.classPrefix+"time-total"),p.loaded=t.querySelector("."+p.options.classPrefix+"time-loaded"),p.current=t.querySelector("."+p.options.classPrefix+"time-current"),p.handle=t.querySelector("."+p.options.classPrefix+"time-handle"),p.timefloat=t.querySelector("."+p.options.classPrefix+"time-float"),p.timefloatcurrent=t.querySelector("."+p.options.classPrefix+"time-float-current"),p.slider=t.querySelector("."+p.options.classPrefix+"time-slider"),p.hovered=t.querySelector("."+p.options.classPrefix+"time-hovered"),p.buffer=t.querySelector("."+p.options.classPrefix+"time-buffering"),p.newTime=0,p.forcedHandlePause=!1,p.setTransformStyle=function(e,t){e.style.transform=t,e.style.webkitTransform=t,e.style.MozTransform=t,e.style.msTransform=t,e.style.OTransform=t},p.buffer.style.display="none";var g=function(t){var n=getComputedStyle(p.total),i=(0,u.offset)(p.total),o=p.total.offsetWidth,r=void 0!==n.webkitTransform?"webkitTransform":void 0!==n.mozTransform?"mozTransform ":void 0!==n.oTransform?"oTransform":void 0!==n.msTransform?"msTransform":"transform",a="WebKitCSSMatrix"in window?"WebKitCSSMatrix":"MSCSSMatrix"in window?"MSCSSMatrix":"CSSMatrix"in window?"CSSMatrix":void 0,s=0,f=0,m=0,h=void 0;if(h=t.originalEvent&&t.originalEvent.changedTouches?t.originalEvent.changedTouches[0].pageX:t.changedTouches?t.changedTouches[0].pageX:t.pageX,p.getDuration()){if(h<i.left?h=i.left:h>o+i.left&&(h=o+i.left),m=h-i.left,s=m/o,p.newTime=s<=.02?0:s*p.getDuration(),c&&null!==p.getCurrentTime()&&p.newTime.toFixed(4)!==p.getCurrentTime().toFixed(4)&&(p.setCurrentRailHandle(p.newTime),p.updateCurrent(p.newTime)),!l.IS_IOS&&!l.IS_ANDROID){if(m<0&&(m=0),p.options.useSmoothHover&&null!==a&&void 0!==window[a]){var v=new window[a](getComputedStyle(p.handle)[r]).m41,g=m/parseFloat(getComputedStyle(p.total).width)-v/parseFloat(getComputedStyle(p.total).width);p.hovered.style.left=v+"px",p.setTransformStyle(p.hovered,"scaleX("+g+")"),p.hovered.setAttribute("pos",m),g>=0?(0,u.removeClass)(p.hovered,"negative"):(0,u.addClass)(p.hovered,"negative")}if(p.timefloat){var y=p.timefloat.offsetWidth/2,E=mejs.Utils.offset(p.getElement(p.container)),b=getComputedStyle(p.timefloat);f=h-E.left<p.timefloat.offsetWidth?y:h-E.left>=p.getElement(p.container).offsetWidth-y?p.total.offsetWidth-y:m,(0,u.hasClass)(p.getElement(p.container),p.options.classPrefix+"long-video")&&(f+=parseFloat(b.marginLeft)/2+p.timefloat.offsetWidth/2),p.timefloat.style.left=f+"px",p.timefloatcurrent.innerHTML=(0,d.secondsToTimeCode)(p.newTime,e.options.alwaysShowHours,e.options.showTimecodeFrameCount,e.options.framesPerSecond,e.options.secondsDecimalLength,e.options.timeFormat),p.timefloat.style.display="block"}}}else l.IS_IOS||l.IS_ANDROID||!p.timefloat||(f=p.timefloat.offsetWidth+o>=p.getElement(p.container).offsetWidth?p.timefloat.offsetWidth/2:0,p.timefloat.style.left=f+"px",p.timefloat.style.left=f+"px",p.timefloat.style.display="block")},y=function(){new Date-a>=1e3&&p.play()},E=function(){c&&null!==p.getCurrentTime()&&p.newTime.toFixed(4)!==p.getCurrentTime().toFixed(4)&&(p.setCurrentTime(p.newTime),p.setCurrentRail(),p.updateCurrent(p.newTime)),p.forcedHandlePause&&(p.slider.focus(),p.play()),p.forcedHandlePause=!1};p.slider.addEventListener("focus",function(){e.options.autoRewind=!1}),p.slider.addEventListener("blur",function(){e.options.autoRewind=m}),p.slider.addEventListener("keydown",function(t){if(new Date-a>=1e3&&(f=p.paused),p.options.keyActions.length){var n=t.which||t.keyCode||0,o=p.getDuration(),r=e.options.defaultSeekForwardInterval(i),s=e.options.defaultSeekBackwardInterval(i),d=p.getCurrentTime(),u=p.getElement(p.container).querySelector("."+p.options.classPrefix+"volume-slider");if(38===n||40===n){u&&(u.style.display="block"),p.isVideo&&(p.showControls(),p.startControlsTimer());var c=38===n?Math.min(p.volume+.1,1):Math.max(p.volume-.1,0),m=c<=0;return p.setVolume(c),void p.setMuted(m)}switch(u&&(u.style.display="none"),n){case 37:p.getDuration()!==1/0&&(d-=s);break;case 39:p.getDuration()!==1/0&&(d+=r);break;case 36:d=0;break;case 35:d=o;break;case 13:case 32:return void(l.IS_FIREFOX&&(p.paused?p.play():p.pause()));default:return}d=d<0?0:d>=o?o:Math.floor(d),a=new Date,f||e.pause(),d<p.getDuration()&&!f&&setTimeout(y,1100),p.setCurrentTime(d),e.showControls(),t.preventDefault(),t.stopPropagation()}});var b=["mousedown","touchstart"];p.slider.addEventListener("dragstart",function(){return!1});for(var S=0,x=b.length;S<x;S++)p.slider.addEventListener(b[S],function(e){if(p.forcedHandlePause=!1,p.getDuration()!==1/0&&(1===e.which||0===e.which)){p.paused||(p.pause(),p.forcedHandlePause=!0),c=!0,g(e);for(var t=["mouseup","touchend"],n=0,i=t.length;n<i;n++)p.getElement(p.container).addEventListener(t[n],function(e){var t=e.target;(t===p.slider||t.closest("."+p.options.classPrefix+"time-slider"))&&g(e)});p.globalBind("mouseup.dur touchend.dur",function(){E(),c=!1,p.timefloat&&(p.timefloat.style.display="none")})}},!(!l.SUPPORT_PASSIVE_EVENT||"touchstart"!==b[S])&&{passive:!0});p.slider.addEventListener("mouseenter",function(e){e.target===p.slider&&p.getDuration()!==1/0&&(p.getElement(p.container).addEventListener("mousemove",function(e){var t=e.target;(t===p.slider||t.closest("."+p.options.classPrefix+"time-slider"))&&g(e)}),!p.timefloat||l.IS_IOS||l.IS_ANDROID||(p.timefloat.style.display="block"),p.hovered&&!l.IS_IOS&&!l.IS_ANDROID&&p.options.useSmoothHover&&(0,u.removeClass)(p.hovered,"no-hover"))}),p.slider.addEventListener("mouseleave",function(){p.getDuration()!==1/0&&(c||(p.timefloat&&(p.timefloat.style.display="none"),p.hovered&&p.options.useSmoothHover&&(0,u.addClass)(p.hovered,"no-hover")))}),p.broadcastCallback=function(n){var r=t.querySelector("."+p.options.classPrefix+"broadcast");if(p.options.forceLive||p.getDuration()===1/0){if(!r||p.options.forceLive){var a=o.default.createElement("span");a.className=p.options.classPrefix+"broadcast",a.innerText=s.default.t("mejs.live-broadcast"),p.slider.style.display="none",p.rail.appendChild(a)}}else r&&(p.slider.style.display="",r.remove()),e.setProgressRail(n),p.forcedHandlePause||e.setCurrentRail(n),function(){var t=p.getCurrentTime(),n=s.default.t("mejs.time-slider"),o=(0,d.secondsToTimeCode)(t,e.options.alwaysShowHours,e.options.showTimecodeFrameCount,e.options.framesPerSecond,e.options.secondsDecimalLength,e.options.timeFormat),r=p.getDuration();p.slider.setAttribute("role","slider"),p.slider.tabIndex=0,i.paused?(p.slider.setAttribute("aria-label",n),p.slider.setAttribute("aria-valuemin",0),p.slider.setAttribute("aria-valuemax",r),p.slider.setAttribute("aria-valuenow",t),p.slider.setAttribute("aria-valuetext",o)):(p.slider.removeAttribute("aria-label"),p.slider.removeAttribute("aria-valuemin"),p.slider.removeAttribute("aria-valuemax"),p.slider.removeAttribute("aria-valuenow"),p.slider.removeAttribute("aria-valuetext"))}()},i.addEventListener("progress",p.broadcastCallback),i.addEventListener("timeupdate",p.broadcastCallback),i.addEventListener("play",function(){p.buffer.style.display="none"}),i.addEventListener("playing",function(){p.buffer.style.display="none"}),i.addEventListener("seeking",function(){p.buffer.style.display=""}),i.addEventListener("seeked",function(){p.buffer.style.display="none"}),i.addEventListener("pause",function(){p.buffer.style.display="none"}),i.addEventListener("waiting",function(){p.buffer.style.display=""}),i.addEventListener("loadeddata",function(){p.buffer.style.display=""}),i.addEventListener("canplay",function(){p.buffer.style.display="none"}),i.addEventListener("error",function(){p.buffer.style.display="none"}),p.getElement(p.container).addEventListener("controlsresize",function(t){p.getDuration()!==1/0&&(e.setProgressRail(t),p.forcedHandlePause||e.setCurrentRail(t))})},cleanprogress:function(e,t,n,i){i.removeEventListener("progress",e.broadcastCallback),i.removeEventListener("timeupdate",e.broadcastCallback),e.rail&&e.rail.remove()},setProgressRail:function(e){var t=void 0!==e?e.detail.target||e.target:this.media,n=null;t&&t.buffered&&t.buffered.length>0&&t.buffered.end&&this.getDuration()?n=t.buffered.end(t.buffered.length-1)/this.getDuration():t&&void 0!==t.bytesTotal&&t.bytesTotal>0&&void 0!==t.bufferedBytes?n=t.bufferedBytes/t.bytesTotal:e&&e.lengthComputable&&0!==e.total&&(n=e.loaded/e.total),null!==n&&(n=Math.min(1,Math.max(0,n)),this.loaded&&this.setTransformStyle(this.loaded,"scaleX("+n+")"))},setCurrentRailHandle:function(e){this.setCurrentRailMain(this,e)},setCurrentRail:function(){this.setCurrentRailMain(this)},setCurrentRailMain:function(e,t){if(void 0!==e.getCurrentTime()&&e.getDuration()){var n=void 0===t?e.getCurrentTime():t;if(e.total&&e.handle){var i=parseFloat(getComputedStyle(e.total).width),o=Math.round(i*n/e.getDuration()),r=o-Math.round(e.handle.offsetWidth/2);if(r=r<0?0:r,e.setTransformStyle(e.current,"scaleX("+o/i+")"),e.setTransformStyle(e.handle,"translateX("+r+"px)"),e.options.useSmoothHover&&!(0,u.hasClass)(e.hovered,"no-hover")){var a=parseInt(e.hovered.getAttribute("pos"),10),s=(a=isNaN(a)?0:a)/i-r/i;e.hovered.style.left=r+"px",e.setTransformStyle(e.hovered,"scaleX("+s+")"),s>=0?(0,u.removeClass)(e.hovered,"negative"):(0,u.addClass)(e.hovered,"negative")}}}}})},{16:16,2:2,25:25,26:26,30:30,5:5}],12:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}var o=i(e(2)),r=e(16),a=i(r),s=e(30),l=e(26);Object.assign(r.config,{duration:0,timeAndDurationSeparator:"<span> | </span>"}),Object.assign(a.default.prototype,{buildcurrent:function(e,t,n,i){var r=this,a=o.default.createElement("div");a.className=r.options.classPrefix+"time",a.setAttribute("role","timer"),a.setAttribute("aria-live","off"),a.innerHTML='<span class="'+r.options.classPrefix+'currenttime">'+(0,s.secondsToTimeCode)(0,e.options.alwaysShowHours,e.options.showTimecodeFrameCount,e.options.framesPerSecond,e.options.secondsDecimalLength,e.options.timeFormat)+"</span>",r.addControlElement(a,"current"),e.updateCurrent(),r.updateTimeCallback=function(){r.controlsAreVisible&&e.updateCurrent()},i.addEventListener("timeupdate",r.updateTimeCallback)},cleancurrent:function(e,t,n,i){i.removeEventListener("timeupdate",e.updateTimeCallback)},buildduration:function(e,t,n,i){var r=this;if(t.lastChild.querySelector("."+r.options.classPrefix+"currenttime"))t.querySelector("."+r.options.classPrefix+"time").innerHTML+=r.options.timeAndDurationSeparator+'<span class="'+r.options.classPrefix+'duration">'+(0,s.secondsToTimeCode)(r.options.duration,r.options.alwaysShowHours,r.options.showTimecodeFrameCount,r.options.framesPerSecond,r.options.secondsDecimalLength,r.options.timeFormat)+"</span>";else{t.querySelector("."+r.options.classPrefix+"currenttime")&&(0,l.addClass)(t.querySelector("."+r.options.classPrefix+"currenttime").parentNode,r.options.classPrefix+"currenttime-container");var a=o.default.createElement("div");a.className=r.options.classPrefix+"time "+r.options.classPrefix+"duration-container",a.innerHTML='<span class="'+r.options.classPrefix+'duration">'+(0,s.secondsToTimeCode)(r.options.duration,r.options.alwaysShowHours,r.options.showTimecodeFrameCount,r.options.framesPerSecond,r.options.secondsDecimalLength,r.options.timeFormat)+"</span>",r.addControlElement(a,"duration")}r.updateDurationCallback=function(){r.controlsAreVisible&&e.updateDuration()},i.addEventListener("timeupdate",r.updateDurationCallback)},cleanduration:function(e,t,n,i){i.removeEventListener("timeupdate",e.updateDurationCallback)},updateCurrent:function(){var e=this.getCurrentTime();isNaN(e)&&(e=0);var t=(0,s.secondsToTimeCode)(e,this.options.alwaysShowHours,this.options.showTimecodeFrameCount,this.options.framesPerSecond,this.options.secondsDecimalLength,this.options.timeFormat);t.length>5?(0,l.addClass)(this.getElement(this.container),this.options.classPrefix+"long-video"):(0,l.removeClass)(this.getElement(this.container),this.options.classPrefix+"long-video"),this.getElement(this.controls).querySelector("."+this.options.classPrefix+"currenttime")&&(this.getElement(this.controls).querySelector("."+this.options.classPrefix+"currenttime").innerText=t)},updateDuration:function(){var e=this.getDuration();(isNaN(e)||e===1/0||e<0)&&(this.media.duration=this.options.duration=e=0),this.options.duration>0&&(e=this.options.duration);var t=(0,s.secondsToTimeCode)(e,this.options.alwaysShowHours,this.options.showTimecodeFrameCount,this.options.framesPerSecond,this.options.secondsDecimalLength,this.options.timeFormat);t.length>5?(0,l.addClass)(this.getElement(this.container),this.options.classPrefix+"long-video"):(0,l.removeClass)(this.getElement(this.container),this.options.classPrefix+"long-video"),this.getElement(this.controls).querySelector("."+this.options.classPrefix+"duration")&&e>0&&(this.getElement(this.controls).querySelector("."+this.options.classPrefix+"duration").innerHTML=t)}})},{16:16,2:2,26:26,30:30}],13:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}var o=i(e(2)),r=i(e(7)),a=i(e(5)),s=e(16),l=i(s),d=e(30),u=e(27),c=e(26);Object.assign(s.config,{startLanguage:"",tracksText:null,chaptersText:null,tracksAriaLive:!1,hideCaptionsButtonWhenEmpty:!0,toggleCaptionsButtonWhenOnlyOne:!1,slidesSelector:""}),Object.assign(l.default.prototype,{hasChapters:!1,buildtracks:function(e,t,n,i){if(this.findTracks(),e.tracks.length||e.trackFiles&&0!==!e.trackFiles.length){var r=this,s=r.options.tracksAriaLive?' role="log" aria-live="assertive" aria-atomic="false"':"",l=(0,u.isString)(r.options.tracksText)?r.options.tracksText:a.default.t("mejs.captions-subtitles"),d=(0,u.isString)(r.options.chaptersText)?r.options.chaptersText:a.default.t("mejs.captions-chapters"),f=null===e.trackFiles?e.tracks.length:e.trackFiles.length;if(r.domNode.textTracks)for(var p=r.domNode.textTracks.length-1;p>=0;p--)r.domNode.textTracks[p].mode="hidden";r.cleartracks(e),e.captions=o.default.createElement("div"),e.captions.className=r.options.classPrefix+"captions-layer "+r.options.classPrefix+"layer",e.captions.innerHTML='<div class="'+r.options.classPrefix+"captions-position "+r.options.classPrefix+'captions-position-hover"'+s+'><span class="'+r.options.classPrefix+'captions-text"></span></div>',e.captions.style.display="none",n.insertBefore(e.captions,n.firstChild),e.captionsText=e.captions.querySelector("."+r.options.classPrefix+"captions-text"),e.captionsButton=o.default.createElement("div"),e.captionsButton.className=r.options.classPrefix+"button "+r.options.classPrefix+"captions-button",e.captionsButton.innerHTML='<button type="button" aria-controls="'+r.id+'" title="'+l+'" aria-label="'+l+'" tabindex="0"></button><div class="'+r.options.classPrefix+"captions-selector "+r.options.classPrefix+'offscreen"><ul class="'+r.options.classPrefix+'captions-selector-list"><li class="'+r.options.classPrefix+'captions-selector-list-item"><input type="radio" class="'+r.options.classPrefix+'captions-selector-input" name="'+e.id+'_captions" id="'+e.id+'_captions_none" value="none" checked disabled><label class="'+r.options.classPrefix+"captions-selector-label "+r.options.classPrefix+'captions-selected" for="'+e.id+'_captions_none">'+a.default.t("mejs.none")+"</label></li></ul></div>",r.addControlElement(e.captionsButton,"tracks"),e.captionsButton.querySelector("."+r.options.classPrefix+"captions-selector-input").disabled=!1,e.chaptersButton=o.default.createElement("div"),e.chaptersButton.className=r.options.classPrefix+"button "+r.options.classPrefix+"chapters-button",e.chaptersButton.innerHTML='<button type="button" aria-controls="'+r.id+'" title="'+d+'" aria-label="'+d+'" tabindex="0"></button><div class="'+r.options.classPrefix+"chapters-selector "+r.options.classPrefix+'offscreen"><ul class="'+r.options.classPrefix+'chapters-selector-list"></ul></div>';for(var m=0,h=0;h<f;h++){var v=e.tracks[h].kind;e.tracks[h].src.trim()&&("subtitles"===v||"captions"===v?m++:"chapters"!==v||t.querySelector("."+r.options.classPrefix+"chapter-selector")||e.captionsButton.parentNode.insertBefore(e.chaptersButton,e.captionsButton))}e.trackToLoad=-1,e.selectedTrack=null,e.isLoadingTrack=!1;for(var g=0;g<f;g++){var y=e.tracks[g].kind;!e.tracks[g].src.trim()||"subtitles"!==y&&"captions"!==y||e.addTrackButton(e.tracks[g].trackId,e.tracks[g].srclang,e.tracks[g].label)}e.loadNextTrack();var E=["mouseenter","focusin"],b=["mouseleave","focusout"];if(r.options.toggleCaptionsButtonWhenOnlyOne&&1===m)e.captionsButton.addEventListener("click",function(t){var n="none";null===e.selectedTrack&&(n=e.tracks[0].trackId);var i=t.keyCode||t.which;e.setTrack(n,void 0!==i)});else{for(var S=e.captionsButton.querySelectorAll("."+r.options.classPrefix+"captions-selector-label"),x=e.captionsButton.querySelectorAll("input[type=radio]"),w=0,P=E.length;w<P;w++)e.captionsButton.addEventListener(E[w],function(){(0,c.removeClass)(this.querySelector("."+r.options.classPrefix+"captions-selector"),r.options.classPrefix+"offscreen")});for(var T=0,C=b.length;T<C;T++)e.captionsButton.addEventListener(b[T],function(){(0,c.addClass)(this.querySelector("."+r.options.classPrefix+"captions-selector"),r.options.classPrefix+"offscreen")});for(var k=0,_=x.length;k<_;k++)x[k].addEventListener("click",function(t){var n=t.keyCode||t.which;e.setTrack(this.value,void 0!==n)});for(var N=0,A=S.length;N<A;N++)S[N].addEventListener("click",function(e){var t=(0,c.siblings)(this,function(e){return"INPUT"===e.tagName})[0],n=(0,u.createEvent)("click",t);t.dispatchEvent(n),e.preventDefault()});e.captionsButton.addEventListener("keydown",function(e){e.stopPropagation()})}for(var L=0,F=E.length;L<F;L++)e.chaptersButton.addEventListener(E[L],function(){this.querySelector("."+r.options.classPrefix+"chapters-selector-list").children.length&&(0,c.removeClass)(this.querySelector("."+r.options.classPrefix+"chapters-selector"),r.options.classPrefix+"offscreen")});for(var j=0,I=b.length;j<I;j++)e.chaptersButton.addEventListener(b[j],function(){(0,c.addClass)(this.querySelector("."+r.options.classPrefix+"chapters-selector"),r.options.classPrefix+"offscreen")});e.chaptersButton.addEventListener("keydown",function(e){e.stopPropagation()}),e.options.alwaysShowControls?(0,c.addClass)(e.getElement(e.container).querySelector("."+r.options.classPrefix+"captions-position"),r.options.classPrefix+"captions-position-hover"):(e.getElement(e.container).addEventListener("controlsshown",function(){(0,c.addClass)(e.getElement(e.container).querySelector("."+r.options.classPrefix+"captions-position"),r.options.classPrefix+"captions-position-hover")}),e.getElement(e.container).addEventListener("controlshidden",function(){i.paused||(0,c.removeClass)(e.getElement(e.container).querySelector("."+r.options.classPrefix+"captions-position"),r.options.classPrefix+"captions-position-hover")})),i.addEventListener("timeupdate",function(){e.displayCaptions()}),""!==e.options.slidesSelector&&(e.slidesContainer=o.default.querySelectorAll(e.options.slidesSelector),i.addEventListener("timeupdate",function(){e.displaySlides()}))}},cleartracks:function(e){e&&(e.captions&&e.captions.remove(),e.chapters&&e.chapters.remove(),e.captionsText&&e.captionsText.remove(),e.captionsButton&&e.captionsButton.remove(),e.chaptersButton&&e.chaptersButton.remove())},rebuildtracks:function(){this.findTracks(),this.buildtracks(this,this.getElement(this.controls),this.getElement(this.layers),this.media)},findTracks:function(){var e=null===this.trackFiles?this.node.querySelectorAll("track"):this.trackFiles,t=e.length;this.tracks=[];for(var n=0;n<t;n++){var i=e[n],o=i.getAttribute("srclang").toLowerCase()||"",r=this.id+"_track_"+n+"_"+i.getAttribute("kind")+"_"+o;this.tracks.push({trackId:r,srclang:o,src:i.getAttribute("src"),kind:i.getAttribute("kind"),label:i.getAttribute("label")||"",entries:[],isLoaded:!1})}},setTrack:function(e,t){for(var n=this,i=n.captionsButton.querySelectorAll('input[type="radio"]'),o=n.captionsButton.querySelectorAll("."+n.options.classPrefix+"captions-selected"),r=n.captionsButton.querySelector('input[value="'+e+'"]'),a=0,s=i.length;a<s;a++)i[a].checked=!1;for(var l=0,d=o.length;l<d;l++)(0,c.removeClass)(o[l],n.options.classPrefix+"captions-selected");r.checked=!0;for(var f=(0,c.siblings)(r,function(e){return(0,c.hasClass)(e,n.options.classPrefix+"captions-selector-label")}),p=0,m=f.length;p<m;p++)(0,c.addClass)(f[p],n.options.classPrefix+"captions-selected");if("none"===e)n.selectedTrack=null,(0,c.removeClass)(n.captionsButton,n.options.classPrefix+"captions-enabled");else for(var h=0,v=n.tracks.length;h<v;h++){var g=n.tracks[h];if(g.trackId===e){null===n.selectedTrack&&(0,c.addClass)(n.captionsButton,n.options.classPrefix+"captions-enabled"),n.selectedTrack=g,n.captions.setAttribute("lang",n.selectedTrack.srclang),n.displayCaptions();break}}var y=(0,u.createEvent)("captionschange",n.media);y.detail.caption=n.selectedTrack,n.media.dispatchEvent(y),t||setTimeout(function(){n.getElement(n.container).focus()},500)},loadNextTrack:function(){this.trackToLoad++,this.trackToLoad<this.tracks.length?(this.isLoadingTrack=!0,this.loadTrack(this.trackToLoad)):(this.isLoadingTrack=!1,this.checkForTracks())},loadTrack:function(e){var t=this,n=t.tracks[e];void 0===n||void 0===n.src&&""===n.src||(0,c.ajax)(n.src,"text",function(e){n.entries="string"==typeof e&&/<tt\s+xml/gi.exec(e)?r.default.TrackFormatParser.dfxp.parse(e):r.default.TrackFormatParser.webvtt.parse(e),n.isLoaded=!0,t.enableTrackButton(n),t.loadNextTrack(),"slides"===n.kind?t.setupSlides(n):"chapters"!==n.kind||t.hasChapters||(t.drawChapters(n),t.hasChapters=!0)},function(){t.removeTrackButton(n.trackId),t.loadNextTrack()})},enableTrackButton:function(e){var t=this,n=e.srclang,i=o.default.getElementById(""+e.trackId);if(i){var s=e.label;""===s&&(s=a.default.t(r.default.language.codes[n])||n),i.disabled=!1;for(var l=(0,c.siblings)(i,function(e){return(0,c.hasClass)(e,t.options.classPrefix+"captions-selector-label")}),d=0,f=l.length;d<f;d++)l[d].innerHTML=s;if(t.options.startLanguage===n){i.checked=!0;var p=(0,u.createEvent)("click",i);i.dispatchEvent(p)}}},removeTrackButton:function(e){var t=o.default.getElementById(""+e);if(t){var n=t.closest("li");n&&n.remove()}},addTrackButton:function(e,t,n){""===n&&(n=a.default.t(r.default.language.codes[t])||t),this.captionsButton.querySelector("ul").innerHTML+='<li class="'+this.options.classPrefix+'captions-selector-list-item"><input type="radio" class="'+this.options.classPrefix+'captions-selector-input" name="'+this.id+'_captions" id="'+e+'" value="'+e+'" disabled><label class="'+this.options.classPrefix+'captions-selector-label"for="'+e+'">'+n+" (loading)</label></li>"},checkForTracks:function(){var e=!1;if(this.options.hideCaptionsButtonWhenEmpty){for(var t=0,n=this.tracks.length;t<n;t++){var i=this.tracks[t].kind;if(("subtitles"===i||"captions"===i)&&this.tracks[t].isLoaded){e=!0;break}}this.captionsButton.style.display=e?"":"none",this.setControlsSize()}},displayCaptions:function(){if(void 0!==this.tracks){var e=this.selectedTrack;if(null!==e&&e.isLoaded){var t=this.searchTrackPosition(e.entries,this.media.currentTime);if(t>-1)return this.captionsText.innerHTML=function(e){var t=o.default.createElement("div");t.innerHTML=e;for(var n=t.getElementsByTagName("script"),i=n.length;i--;)n[i].remove();for(var r=t.getElementsByTagName("*"),a=0,s=r.length;a<s;a++)for(var l=r[a].attributes,d=Array.prototype.slice.call(l),u=0,c=d.length;u<c;u++)d[u].name.startsWith("on")||d[u].value.startsWith("javascript")?r[a].remove():"style"===d[u].name&&r[a].removeAttribute(d[u].name);return t.innerHTML}(e.entries[t].text),this.captionsText.className=this.options.classPrefix+"captions-text "+(e.entries[t].identifier||""),this.captions.style.display="",void(this.captions.style.height="0px");this.captions.style.display="none"}else this.captions.style.display="none"}},setupSlides:function(e){this.slides=e,this.slides.entries.imgs=[this.slides.entries.length],this.showSlide(0)},showSlide:function(e){var t=this,n=this;if(void 0!==n.tracks&&void 0!==n.slidesContainer){var i=n.slides.entries[e].text,r=n.slides.entries[e].imgs;if(void 0===r||void 0===r.fadeIn){var a=o.default.createElement("img");a.src=i,a.addEventListener("load",function(){var e=t,i=(0,c.siblings)(e,function(e){return i(e)});e.style.display="none",n.slidesContainer.innerHTML+=e.innerHTML,(0,c.fadeIn)(n.slidesContainer.querySelector(a));for(var o=0,r=i.length;o<r;o++)(0,c.fadeOut)(i[o],400)}),n.slides.entries[e].imgs=r=a}else if(!(0,c.visible)(r)){var s=(0,c.siblings)(self,function(e){return s(e)});(0,c.fadeIn)(n.slidesContainer.querySelector(r));for(var l=0,d=s.length;l<d;l++)(0,c.fadeOut)(s[l])}}},displaySlides:function(){if(void 0!==this.slides){var e=this.slides,t=this.searchTrackPosition(e.entries,this.media.currentTime);t>-1&&this.showSlide(t)}},drawChapters:function(e){var t=this,n=e.entries.length;if(n){t.chaptersButton.querySelector("ul").innerHTML="";for(var i=0;i<n;i++)t.chaptersButton.querySelector("ul").innerHTML+='<li class="'+t.options.classPrefix+'chapters-selector-list-item" role="menuitemcheckbox" aria-live="polite" aria-disabled="false" aria-checked="false"><input type="radio" class="'+t.options.classPrefix+'captions-selector-input" name="'+t.id+'_chapters" id="'+t.id+"_chapters_"+i+'" value="'+e.entries[i].start+'" disabled><label class="'+t.options.classPrefix+'chapters-selector-label"for="'+t.id+"_chapters_"+i+'">'+e.entries[i].text+"</label></li>";for(var o=t.chaptersButton.querySelectorAll('input[type="radio"]'),r=t.chaptersButton.querySelectorAll("."+t.options.classPrefix+"chapters-selector-label"),a=0,s=o.length;a<s;a++)o[a].disabled=!1,o[a].checked=!1,o[a].addEventListener("click",function(e){var n=t.chaptersButton.querySelectorAll("li"),i=(0,c.siblings)(this,function(e){return(0,c.hasClass)(e,t.options.classPrefix+"chapters-selector-label")})[0];this.checked=!0,this.parentNode.setAttribute("aria-checked",!0),(0,c.addClass)(i,t.options.classPrefix+"chapters-selected"),(0,c.removeClass)(t.chaptersButton.querySelector("."+t.options.classPrefix+"chapters-selected"),t.options.classPrefix+"chapters-selected");for(var o=0,r=n.length;o<r;o++)n[o].setAttribute("aria-checked",!1);void 0===(e.keyCode||e.which)&&setTimeout(function(){t.getElement(t.container).focus()},500),t.media.setCurrentTime(parseFloat(this.value)),t.media.paused&&t.media.play()});for(var l=0,d=r.length;l<d;l++)r[l].addEventListener("click",function(e){var t=(0,c.siblings)(this,function(e){return"INPUT"===e.tagName})[0],n=(0,u.createEvent)("click",t);t.dispatchEvent(n),e.preventDefault()})}},searchTrackPosition:function(e,t){for(var n=0,i=e.length-1,o=void 0,r=void 0,a=void 0;n<=i;){if(o=n+i>>1,r=e[o].start,a=e[o].stop,t>=r&&t<a)return o;r<t?n=o+1:r>t&&(i=o-1)}return-1}}),r.default.language={codes:{af:"mejs.afrikaans",sq:"mejs.albanian",ar:"mejs.arabic",be:"mejs.belarusian",bg:"mejs.bulgarian",ca:"mejs.catalan",zh:"mejs.chinese","zh-cn":"mejs.chinese-simplified","zh-tw":"mejs.chines-traditional",hr:"mejs.croatian",cs:"mejs.czech",da:"mejs.danish",nl:"mejs.dutch",en:"mejs.english",et:"mejs.estonian",fl:"mejs.filipino",fi:"mejs.finnish",fr:"mejs.french",gl:"mejs.galician",de:"mejs.german",el:"mejs.greek",ht:"mejs.haitian-creole",iw:"mejs.hebrew",hi:"mejs.hindi",hu:"mejs.hungarian",is:"mejs.icelandic",id:"mejs.indonesian",ga:"mejs.irish",it:"mejs.italian",ja:"mejs.japanese",ko:"mejs.korean",lv:"mejs.latvian",lt:"mejs.lithuanian",mk:"mejs.macedonian",ms:"mejs.malay",mt:"mejs.maltese",no:"mejs.norwegian",fa:"mejs.persian",pl:"mejs.polish",pt:"mejs.portuguese",ro:"mejs.romanian",ru:"mejs.russian",sr:"mejs.serbian",sk:"mejs.slovak",sl:"mejs.slovenian",es:"mejs.spanish",sw:"mejs.swahili",sv:"mejs.swedish",tl:"mejs.tagalog",th:"mejs.thai",tr:"mejs.turkish",uk:"mejs.ukrainian",vi:"mejs.vietnamese",cy:"mejs.welsh",yi:"mejs.yiddish"}},r.default.TrackFormatParser={webvtt:{pattern:/^((?:[0-9]{1,2}:)?[0-9]{2}:[0-9]{2}([,.][0-9]{1,3})?) --\> ((?:[0-9]{1,2}:)?[0-9]{2}:[0-9]{2}([,.][0-9]{3})?)(.*)$/,parse:function(e){for(var t=e.split(/\r?\n/),n=[],i=void 0,o=void 0,r=void 0,a=0,s=t.length;a<s;a++){if((i=this.pattern.exec(t[a]))&&a<t.length){for(a-1>=0&&""!==t[a-1]&&(r=t[a-1]),o=t[++a],a++;""!==t[a]&&a<t.length;)o=o+"\n"+t[a],a++;o=o.trim().replace(/(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/gi,"<a href='$1' target='_blank'>$1</a>"),n.push({identifier:r,start:0===(0,d.convertSMPTEtoSeconds)(i[1])?.2:(0,d.convertSMPTEtoSeconds)(i[1]),stop:(0,d.convertSMPTEtoSeconds)(i[3]),text:o,settings:i[5]})}r=""}return n}},dfxp:{parse:function(e){var t=(e=$(e).filter("tt")).firstChild,n=t.querySelectorAll("p"),i=e.getElementById(""+t.attr("style")),o=[],r=void 0;if(i.length){i.removeAttribute("id");var a=i.attributes;if(a.length){r={};for(var s=0,l=a.length;s<l;s++)r[a[s].name.split(":")[1]]=a[s].value}}for(var u=0,c=n.length;u<c;u++){var f=void 0,p={start:null,stop:null,style:null,text:null};if(n.eq(u).attr("begin")&&(p.start=(0,d.convertSMPTEtoSeconds)(n.eq(u).attr("begin"))),!p.start&&n.eq(u-1).attr("end")&&(p.start=(0,d.convertSMPTEtoSeconds)(n.eq(u-1).attr("end"))),n.eq(u).attr("end")&&(p.stop=(0,d.convertSMPTEtoSeconds)(n.eq(u).attr("end"))),!p.stop&&n.eq(u+1).attr("begin")&&(p.stop=(0,d.convertSMPTEtoSeconds)(n.eq(u+1).attr("begin"))),r){f="";for(var m in r)f+=m+":"+r[m]+";"}f&&(p.style=f),0===p.start&&(p.start=.2),p.text=n.eq(u).innerHTML.trim().replace(/(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/gi,"<a href='$1' target='_blank'>$1</a>"),o.push(p)}return o}}}},{16:16,2:2,26:26,27:27,30:30,5:5,7:7}],14:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}var o=i(e(2)),r=e(16),a=i(r),s=i(e(5)),l=e(25),d=e(27),u=e(26);Object.assign(r.config,{muteText:null,unmuteText:null,allyVolumeControlText:null,hideVolumeOnTouchDevices:!0,audioVolume:"horizontal",videoVolume:"vertical",startVolume:.8}),Object.assign(a.default.prototype,{buildvolume:function(e,t,n,i){if(!l.IS_ANDROID&&!l.IS_IOS||!this.options.hideVolumeOnTouchDevices){var a=this,c=a.isVideo?a.options.videoVolume:a.options.audioVolume,f=(0,d.isString)(a.options.muteText)?a.options.muteText:s.default.t("mejs.mute"),p=(0,d.isString)(a.options.unmuteText)?a.options.unmuteText:s.default.t("mejs.unmute"),m=(0,d.isString)(a.options.allyVolumeControlText)?a.options.allyVolumeControlText:s.default.t("mejs.volume-help-text"),h=o.default.createElement("div");if(h.className=a.options.classPrefix+"button "+a.options.classPrefix+"volume-button "+a.options.classPrefix+"mute",h.innerHTML="horizontal"===c?'<button type="button" aria-controls="'+a.id+'" title="'+f+'" aria-label="'+f+'" tabindex="0"></button>':'<button type="button" aria-controls="'+a.id+'" title="'+f+'" aria-label="'+f+'" tabindex="0"></button><a href="javascript:void(0);" class="'+a.options.classPrefix+'volume-slider" aria-label="'+s.default.t("mejs.volume-slider")+'" aria-valuemin="0" aria-valuemax="100" role="slider" aria-orientation="vertical"><span class="'+a.options.classPrefix+'offscreen">'+m+'</span><div class="'+a.options.classPrefix+'volume-total"><div class="'+a.options.classPrefix+'volume-current"></div><div class="'+a.options.classPrefix+'volume-handle"></div></div></a>',a.addControlElement(h,"volume"),a.options.keyActions.push({keys:[38],action:function(e){var t=e.getElement(e.container).querySelector("."+r.config.classPrefix+"volume-slider");(t||e.getElement(e.container).querySelector("."+r.config.classPrefix+"volume-slider").matches(":focus"))&&(t.style.display="block"),e.isVideo&&(e.showControls(),e.startControlsTimer());var n=Math.min(e.volume+.1,1);e.setVolume(n),n>0&&e.setMuted(!1)}},{keys:[40],action:function(e){var t=e.getElement(e.container).querySelector("."+r.config.classPrefix+"volume-slider");t&&(t.style.display="block"),e.isVideo&&(e.showControls(),e.startControlsTimer());var n=Math.max(e.volume-.1,0);e.setVolume(n),n<=.1&&e.setMuted(!0)}},{keys:[77],action:function(e){e.getElement(e.container).querySelector("."+r.config.classPrefix+"volume-slider").style.display="block",e.isVideo&&(e.showControls(),e.startControlsTimer()),e.media.muted?e.setMuted(!1):e.setMuted(!0)}}),"horizontal"===c){var v=o.default.createElement("a");v.className=a.options.classPrefix+"horizontal-volume-slider",v.href="javascript:void(0);",v.setAttribute("aria-label",s.default.t("mejs.volume-slider")),v.setAttribute("aria-valuemin",0),v.setAttribute("aria-valuemax",100),v.setAttribute("role","slider"),v.innerHTML+='<span class="'+a.options.classPrefix+'offscreen">'+m+'</span><div class="'+a.options.classPrefix+'horizontal-volume-total"><div class="'+a.options.classPrefix+'horizontal-volume-current"></div><div class="'+a.options.classPrefix+'horizontal-volume-handle"></div></div>',h.parentNode.insertBefore(v,h.nextSibling)}var g=!1,y=!1,E=!1,b="vertical"===c?a.getElement(a.container).querySelector("."+a.options.classPrefix+"volume-slider"):a.getElement(a.container).querySelector("."+a.options.classPrefix+"horizontal-volume-slider"),S="vertical"===c?a.getElement(a.container).querySelector("."+a.options.classPrefix+"volume-total"):a.getElement(a.container).querySelector("."+a.options.classPrefix+"horizontal-volume-total"),x="vertical"===c?a.getElement(a.container).querySelector("."+a.options.classPrefix+"volume-current"):a.getElement(a.container).querySelector("."+a.options.classPrefix+"horizontal-volume-current"),w="vertical"===c?a.getElement(a.container).querySelector("."+a.options.classPrefix+"volume-handle"):a.getElement(a.container).querySelector("."+a.options.classPrefix+"horizontal-volume-handle"),P=function(e){if(null!==e&&!isNaN(e)&&void 0!==e){if(e=Math.max(0,e),0===(e=Math.min(e,1))){(0,u.removeClass)(h,a.options.classPrefix+"mute"),(0,u.addClass)(h,a.options.classPrefix+"unmute");var t=h.firstElementChild;t.setAttribute("title",p),t.setAttribute("aria-label",p)}else{(0,u.removeClass)(h,a.options.classPrefix+"unmute"),(0,u.addClass)(h,a.options.classPrefix+"mute");var n=h.firstElementChild;n.setAttribute("title",f),n.setAttribute("aria-label",f)}var i=100*e+"%",o=getComputedStyle(w);"vertical"===c?(x.style.bottom=0,x.style.height=i,w.style.bottom=i,w.style.marginBottom=-parseFloat(o.height)/2+"px"):(x.style.left=0,x.style.width=i,w.style.left=i,w.style.marginLeft=-parseFloat(o.width)/2+"px")}},T=function(e){var t=(0,u.offset)(S),n=getComputedStyle(S);E=!0;var i=null;if("vertical"===c){var o=parseFloat(n.height);if(i=(o-(e.pageY-t.top))/o,0===t.top||0===t.left)return}else{var r=parseFloat(n.width);i=(e.pageX-t.left)/r}i=Math.max(0,i),i=Math.min(i,1),P(i),a.setMuted(0===i),a.setVolume(i),e.preventDefault(),e.stopPropagation()},C=function(){a.muted?(P(0),(0,u.removeClass)(h,a.options.classPrefix+"mute"),(0,u.addClass)(h,a.options.classPrefix+"unmute")):(P(i.volume),(0,u.removeClass)(h,a.options.classPrefix+"unmute"),(0,u.addClass)(h,a.options.classPrefix+"mute"))};e.getElement(e.container).addEventListener("keydown",function(e){!!e.target.closest("."+a.options.classPrefix+"container")||"vertical"!==c||(b.style.display="none")}),h.addEventListener("mouseenter",function(e){e.target===h&&(b.style.display="block",y=!0,e.preventDefault(),e.stopPropagation())}),h.addEventListener("focusin",function(){b.style.display="block",y=!0}),h.addEventListener("focusout",function(e){e.relatedTarget&&(!e.relatedTarget||e.relatedTarget.matches("."+a.options.classPrefix+"volume-slider"))||"vertical"!==c||(b.style.display="none")}),h.addEventListener("mouseleave",function(){y=!1,g||"vertical"!==c||(b.style.display="none")}),h.addEventListener("focusout",function(){y=!1}),h.addEventListener("keydown",function(e){if(a.options.keyActions.length){var t=e.which||e.keyCode||0,n=i.volume;switch(t){case 38:n=Math.min(n+.1,1);break;case 40:n=Math.max(0,n-.1);break;default:return!0}g=!1,P(n),i.setVolume(n),e.preventDefault(),e.stopPropagation()}}),h.querySelector("button").addEventListener("click",function(){i.setMuted(!i.muted);var e=(0,d.createEvent)("volumechange",i);i.dispatchEvent(e)}),b.addEventListener("dragstart",function(){return!1}),b.addEventListener("mouseover",function(){y=!0}),b.addEventListener("focusin",function(){b.style.display="block",y=!0}),b.addEventListener("focusout",function(){y=!1,g||"vertical"!==c||(b.style.display="none")}),b.addEventListener("mousedown",function(e){T(e),a.globalBind("mousemove.vol",function(e){var t=e.target;g&&(t===b||t.closest("vertical"===c?"."+a.options.classPrefix+"volume-slider":"."+a.options.classPrefix+"horizontal-volume-slider"))&&T(e)}),a.globalBind("mouseup.vol",function(){g=!1,y||"vertical"!==c||(b.style.display="none")}),g=!0,e.preventDefault(),e.stopPropagation()}),i.addEventListener("volumechange",function(e){g||C(),function(){var e=Math.floor(100*i.volume);b.setAttribute("aria-valuenow",e),b.setAttribute("aria-valuetext",e+"%")}()});var k=!1;i.addEventListener("rendererready",function(){E||setTimeout(function(){k=!0,(0===e.options.startVolume||i.originalNode.muted)&&(i.setMuted(!0),e.options.startVolume=0),i.setVolume(e.options.startVolume),a.setControlsSize()},250)}),i.addEventListener("loadedmetadata",function(){setTimeout(function(){E||k||((0===e.options.startVolume||i.originalNode.muted)&&i.setMuted(!0),i.setVolume(e.options.startVolume),a.setControlsSize()),k=!1},250)}),(0===e.options.startVolume||i.originalNode.muted)&&(i.setMuted(!0),e.options.startVolume=0,C()),a.getElement(a.container).addEventListener("controlsresize",function(){C()})}}})},{16:16,2:2,25:25,26:26,27:27,5:5}],15:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});n.EN={"mejs.plural-form":1,"mejs.download-file":"Download File","mejs.install-flash":"You are using a browser that does not have Flash player enabled or installed. Please turn on your Flash player plugin or download the latest version from https://get.adobe.com/flashplayer/","mejs.fullscreen":"Fullscreen","mejs.play":"Play","mejs.pause":"Pause","mejs.time-slider":"Time Slider","mejs.time-help-text":"Use Left/Right Arrow keys to advance one second, Up/Down arrows to advance ten seconds.","mejs.live-broadcast":"Live Broadcast","mejs.volume-help-text":"Use Up/Down Arrow keys to increase or decrease volume.","mejs.unmute":"Unmute","mejs.mute":"Mute","mejs.volume-slider":"Volume Slider","mejs.video-player":"Video Player","mejs.audio-player":"Audio Player","mejs.captions-subtitles":"Captions/Subtitles","mejs.captions-chapters":"Chapters","mejs.none":"None","mejs.afrikaans":"Afrikaans","mejs.albanian":"Albanian","mejs.arabic":"Arabic","mejs.belarusian":"Belarusian","mejs.bulgarian":"Bulgarian","mejs.catalan":"Catalan","mejs.chinese":"Chinese","mejs.chinese-simplified":"Chinese (Simplified)","mejs.chinese-traditional":"Chinese (Traditional)","mejs.croatian":"Croatian","mejs.czech":"Czech","mejs.danish":"Danish","mejs.dutch":"Dutch","mejs.english":"English","mejs.estonian":"Estonian","mejs.filipino":"Filipino","mejs.finnish":"Finnish","mejs.french":"French","mejs.galician":"Galician","mejs.german":"German","mejs.greek":"Greek","mejs.haitian-creole":"Haitian Creole","mejs.hebrew":"Hebrew","mejs.hindi":"Hindi","mejs.hungarian":"Hungarian","mejs.icelandic":"Icelandic","mejs.indonesian":"Indonesian","mejs.irish":"Irish","mejs.italian":"Italian","mejs.japanese":"Japanese","mejs.korean":"Korean","mejs.latvian":"Latvian","mejs.lithuanian":"Lithuanian","mejs.macedonian":"Macedonian","mejs.malay":"Malay","mejs.maltese":"Maltese","mejs.norwegian":"Norwegian","mejs.persian":"Persian","mejs.polish":"Polish","mejs.portuguese":"Portuguese","mejs.romanian":"Romanian","mejs.russian":"Russian","mejs.serbian":"Serbian","mejs.slovak":"Slovak","mejs.slovenian":"Slovenian","mejs.spanish":"Spanish","mejs.swahili":"Swahili","mejs.swedish":"Swedish","mejs.tagalog":"Tagalog","mejs.thai":"Thai","mejs.turkish":"Turkish","mejs.ukrainian":"Ukrainian","mejs.vietnamese":"Vietnamese","mejs.welsh":"Welsh","mejs.yiddish":"Yiddish"}},{}],16:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(n,"__esModule",{value:!0}),n.config=void 0;var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),a=i(e(3)),s=i(e(2)),l=i(e(7)),d=i(e(6)),u=i(e(17)),c=i(e(5)),f=e(25),p=e(27),m=e(30),h=e(28),v=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(e(26));l.default.mepIndex=0,l.default.players={};var g=n.config={poster:"",showPosterWhenEnded:!1,showPosterWhenPaused:!1,defaultVideoWidth:480,defaultVideoHeight:270,videoWidth:-1,videoHeight:-1,defaultAudioWidth:400,defaultAudioHeight:40,defaultSeekBackwardInterval:function(e){return.05*e.getDuration()},defaultSeekForwardInterval:function(e){return.05*e.getDuration()},setDimensions:!0,audioWidth:-1,audioHeight:-1,loop:!1,autoRewind:!0,enableAutosize:!0,timeFormat:"",alwaysShowHours:!1,showTimecodeFrameCount:!1,framesPerSecond:25,alwaysShowControls:!1,hideVideoControlsOnLoad:!1,hideVideoControlsOnPause:!1,clickToPlayPause:!0,controlsTimeoutDefault:1500,controlsTimeoutMouseEnter:2500,controlsTimeoutMouseLeave:1e3,iPadUseNativeControls:!1,iPhoneUseNativeControls:!1,AndroidUseNativeControls:!1,features:["playpause","current","progress","duration","tracks","volume","fullscreen"],useDefaultControls:!1,isVideo:!0,stretching:"auto",classPrefix:"mejs__",enableKeyboard:!0,pauseOtherPlayers:!0,secondsDecimalLength:0,customError:null,keyActions:[{keys:[32,179],action:function(e){f.IS_FIREFOX||(e.paused||e.ended?e.play():e.pause())}}]};l.default.MepDefaults=g;var y=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var i="string"==typeof t?s.default.getElementById(t):t;if(!(this instanceof e))return new e(i,n);if(this.node=this.media=i,this.node){if(this.media.player)return this.media.player;if(this.hasFocus=!1,this.controlsAreVisible=!0,this.controlsEnabled=!0,this.controlsTimer=null,this.currentMediaTime=0,this.proxy=null,void 0===n){var o=this.node.getAttribute("data-mejsoptions");n=o?JSON.parse(o):{}}return this.options=Object.assign({},g,n),this.options.loop&&!this.media.getAttribute("loop")?(this.media.loop=!0,this.node.loop=!0):this.media.loop&&(this.options.loop=!0),this.options.timeFormat||(this.options.timeFormat="mm:ss",this.options.alwaysShowHours&&(this.options.timeFormat="hh:mm:ss"),this.options.showTimecodeFrameCount&&(this.options.timeFormat+=":ff")),(0,m.calculateTimeFormat)(0,this.options,this.options.framesPerSecond||25),this.id="mep_"+l.default.mepIndex++,l.default.players[this.id]=this,this.init(),this}}return r(e,[{key:"getElement",value:function(e){return e}},{key:"init",value:function(){var e=this,t=Object.assign({},e.options,{success:function(t,n){e._meReady(t,n)},error:function(t){e._handleError(t)}}),n=e.node.tagName.toLowerCase();if(e.isDynamic="audio"!==n&&"video"!==n&&"iframe"!==n,e.isVideo=e.isDynamic?e.options.isVideo:"audio"!==n&&e.options.isVideo,e.mediaFiles=null,e.trackFiles=null,f.IS_IPAD&&e.options.iPadUseNativeControls||f.IS_IPHONE&&e.options.iPhoneUseNativeControls)e.node.setAttribute("controls",!0),f.IS_IPAD&&e.node.getAttribute("autoplay")&&e.play();else if(!e.isVideo&&(e.isVideo||!e.options.features.length&&!e.options.useDefaultControls)||f.IS_ANDROID&&e.options.AndroidUseNativeControls)e.isVideo||e.options.features.length||e.options.useDefaultControls||(e.node.style.display="none");else{e.node.removeAttribute("controls");var i=e.isVideo?c.default.t("mejs.video-player"):c.default.t("mejs.audio-player"),o=s.default.createElement("span");if(o.className=e.options.classPrefix+"offscreen",o.innerText=i,e.media.parentNode.insertBefore(o,e.media),e.container=s.default.createElement("div"),e.getElement(e.container).id=e.id,e.getElement(e.container).className=e.options.classPrefix+"container "+e.options.classPrefix+"container-keyboard-inactive "+e.media.className,e.getElement(e.container).tabIndex=0,e.getElement(e.container).setAttribute("role","application"),e.getElement(e.container).setAttribute("aria-label",i),e.getElement(e.container).innerHTML='<div class="'+e.options.classPrefix+'inner"><div class="'+e.options.classPrefix+'mediaelement"></div><div class="'+e.options.classPrefix+'layers"></div><div class="'+e.options.classPrefix+'controls"></div></div>',e.getElement(e.container).addEventListener("focus",function(t){if(!e.controlsAreVisible&&!e.hasFocus&&e.controlsEnabled){e.showControls(!0);var n=(0,p.isNodeAfter)(t.relatedTarget,e.getElement(e.container))?"."+e.options.classPrefix+"controls ."+e.options.classPrefix+"button:last-child > button":"."+e.options.classPrefix+"playpause-button > button";e.getElement(e.container).querySelector(n).focus()}}),e.node.parentNode.insertBefore(e.getElement(e.container),e.node),e.options.features.length||e.options.useDefaultControls||(e.getElement(e.container).style.background="transparent",e.getElement(e.container).querySelector("."+e.options.classPrefix+"controls").style.display="none"),e.isVideo&&"fill"===e.options.stretching&&!v.hasClass(e.getElement(e.container).parentNode,e.options.classPrefix+"fill-container")){e.outerContainer=e.media.parentNode;var r=s.default.createElement("div");r.className=e.options.classPrefix+"fill-container",e.getElement(e.container).parentNode.insertBefore(r,e.getElement(e.container)),r.appendChild(e.getElement(e.container))}if(f.IS_ANDROID&&v.addClass(e.getElement(e.container),e.options.classPrefix+"android"),f.IS_IOS&&v.addClass(e.getElement(e.container),e.options.classPrefix+"ios"),f.IS_IPAD&&v.addClass(e.getElement(e.container),e.options.classPrefix+"ipad"),f.IS_IPHONE&&v.addClass(e.getElement(e.container),e.options.classPrefix+"iphone"),v.addClass(e.getElement(e.container),e.isVideo?e.options.classPrefix+"video":e.options.classPrefix+"audio"),f.IS_SAFARI&&!f.IS_IOS){v.addClass(e.getElement(e.container),e.options.classPrefix+"hide-cues");for(var a=e.node.cloneNode(),u=e.node.children,m=[],g=[],y=0,E=u.length;y<E;y++){var b=u[y];!function(){switch(b.tagName.toLowerCase()){case"source":var e={};Array.prototype.slice.call(b.attributes).forEach(function(t){e[t.name]=t.value}),e.type=(0,h.formatType)(e.src,e.type),m.push(e);break;case"track":b.mode="hidden",g.push(b);break;default:a.appendChild(b)}}()}e.node.remove(),e.node=e.media=a,m.length&&(e.mediaFiles=m),g.length&&(e.trackFiles=g)}e.getElement(e.container).querySelector("."+e.options.classPrefix+"mediaelement").appendChild(e.node),e.media.player=e,e.controls=e.getElement(e.container).querySelector("."+e.options.classPrefix+"controls"),e.layers=e.getElement(e.container).querySelector("."+e.options.classPrefix+"layers");var S=e.isVideo?"video":"audio",x=S.substring(0,1).toUpperCase()+S.substring(1);e.options[S+"Width"]>0||e.options[S+"Width"].toString().indexOf("%")>-1?e.width=e.options[S+"Width"]:""!==e.node.style.width&&null!==e.node.style.width?e.width=e.node.style.width:e.node.getAttribute("width")?e.width=e.node.getAttribute("width"):e.width=e.options["default"+x+"Width"],e.options[S+"Height"]>0||e.options[S+"Height"].toString().indexOf("%")>-1?e.height=e.options[S+"Height"]:""!==e.node.style.height&&null!==e.node.style.height?e.height=e.node.style.height:e.node.getAttribute("height")?e.height=e.node.getAttribute("height"):e.height=e.options["default"+x+"Height"],e.initialAspectRatio=e.height>=e.width?e.width/e.height:e.height/e.width,e.setPlayerSize(e.width,e.height),t.pluginWidth=e.width,t.pluginHeight=e.height}if(l.default.MepDefaults=t,new d.default(e.media,t,e.mediaFiles),void 0!==e.getElement(e.container)&&e.options.features.length&&e.controlsAreVisible&&!e.options.hideVideoControlsOnLoad){var w=(0,p.createEvent)("controlsshown",e.getElement(e.container));e.getElement(e.container).dispatchEvent(w)}}},{key:"showControls",value:function(e){var t=this;if(e=void 0===e||e,!t.controlsAreVisible&&t.isVideo){if(e)!function(){v.fadeIn(t.getElement(t.controls),200,function(){v.removeClass(t.getElement(t.controls),t.options.classPrefix+"offscreen");var e=(0,p.createEvent)("controlsshown",t.getElement(t.container));t.getElement(t.container).dispatchEvent(e)});for(var e=t.getElement(t.container).querySelectorAll("."+t.options.classPrefix+"control"),n=function(n,i){v.fadeIn(e[n],200,function(){v.removeClass(e[n],t.options.classPrefix+"offscreen")})},i=0,o=e.length;i<o;i++)n(i)}();else{v.removeClass(t.getElement(t.controls),t.options.classPrefix+"offscreen"),t.getElement(t.controls).style.display="",t.getElement(t.controls).style.opacity=1;for(var n=t.getElement(t.container).querySelectorAll("."+t.options.classPrefix+"control"),i=0,o=n.length;i<o;i++)v.removeClass(n[i],t.options.classPrefix+"offscreen"),n[i].style.display="";var r=(0,p.createEvent)("controlsshown",t.getElement(t.container));t.getElement(t.container).dispatchEvent(r)}t.controlsAreVisible=!0,t.setControlsSize()}}},{key:"hideControls",value:function(e,t){var n=this;if(e=void 0===e||e,!0===t||!(!n.controlsAreVisible||n.options.alwaysShowControls||n.paused&&4===n.readyState&&(!n.options.hideVideoControlsOnLoad&&n.currentTime<=0||!n.options.hideVideoControlsOnPause&&n.currentTime>0)||n.isVideo&&!n.options.hideVideoControlsOnLoad&&!n.readyState||n.ended)){if(e)!function(){v.fadeOut(n.getElement(n.controls),200,function(){v.addClass(n.getElement(n.controls),n.options.classPrefix+"offscreen"),n.getElement(n.controls).style.display="";var e=(0,p.createEvent)("controlshidden",n.getElement(n.container));n.getElement(n.container).dispatchEvent(e)});for(var e=n.getElement(n.container).querySelectorAll("."+n.options.classPrefix+"control"),t=function(t,i){v.fadeOut(e[t],200,function(){v.addClass(e[t],n.options.classPrefix+"offscreen"),e[t].style.display=""})},i=0,o=e.length;i<o;i++)t(i)}();else{v.addClass(n.getElement(n.controls),n.options.classPrefix+"offscreen"),n.getElement(n.controls).style.display="",n.getElement(n.controls).style.opacity=0;for(var i=n.getElement(n.container).querySelectorAll("."+n.options.classPrefix+"control"),o=0,r=i.length;o<r;o++)v.addClass(i[o],n.options.classPrefix+"offscreen"),i[o].style.display="";var a=(0,p.createEvent)("controlshidden",n.getElement(n.container));n.getElement(n.container).dispatchEvent(a)}n.controlsAreVisible=!1}}},{key:"startControlsTimer",value:function(e){var t=this;e=void 0!==e?e:t.options.controlsTimeoutDefault,t.killControlsTimer("start"),t.controlsTimer=setTimeout(function(){t.hideControls(),t.killControlsTimer("hide")},e)}},{key:"killControlsTimer",value:function(){null!==this.controlsTimer&&(clearTimeout(this.controlsTimer),delete this.controlsTimer,this.controlsTimer=null)}},{key:"disableControls",value:function(){this.killControlsTimer(),this.controlsEnabled=!1,this.hideControls(!1,!0)}},{key:"enableControls",value:function(){this.controlsEnabled=!0,this.showControls(!1)}},{key:"_setDefaultPlayer",value:function(){var e=this;e.proxy&&e.proxy.pause(),e.proxy=new u.default(e),e.media.addEventListener("loadedmetadata",function(){e.getCurrentTime()>0&&e.currentMediaTime>0&&(e.setCurrentTime(e.currentMediaTime),f.IS_IOS||f.IS_ANDROID||e.play())})}},{key:"_meReady",value:function(e,t){var n=this,i=t.getAttribute("autoplay"),o=!(void 0===i||null===i||"false"===i),r=null!==e.rendererName&&/(native|html5)/i.test(n.media.rendererName);if(n.getElement(n.controls)&&n.enableControls(),n.getElement(n.container)&&n.getElement(n.container).querySelector("."+n.options.classPrefix+"overlay-play")&&(n.getElement(n.container).querySelector("."+n.options.classPrefix+"overlay-play").style.display=""),!n.created){if(n.created=!0,n.media=e,n.domNode=t,!(f.IS_ANDROID&&n.options.AndroidUseNativeControls||f.IS_IPAD&&n.options.iPadUseNativeControls||f.IS_IPHONE&&n.options.iPhoneUseNativeControls)){if(!n.isVideo&&!n.options.features.length&&!n.options.useDefaultControls)return o&&r&&n.play(),void(n.options.success&&("string"==typeof n.options.success?a.default[n.options.success](n.media,n.domNode,n):n.options.success(n.media,n.domNode,n)));if(n.featurePosition={},n._setDefaultPlayer(),n.buildposter(n,n.getElement(n.controls),n.getElement(n.layers),n.media),n.buildkeyboard(n,n.getElement(n.controls),n.getElement(n.layers),n.media),n.buildoverlays(n,n.getElement(n.controls),n.getElement(n.layers),n.media),n.options.useDefaultControls){var d=["playpause","current","progress","duration","tracks","volume","fullscreen"];n.options.features=d.concat(n.options.features.filter(function(e){return-1===d.indexOf(e)}))}n.buildfeatures(n,n.getElement(n.controls),n.getElement(n.layers),n.media);var u=(0,p.createEvent)("controlsready",n.getElement(n.container));n.getElement(n.container).dispatchEvent(u),n.setPlayerSize(n.width,n.height),n.setControlsSize(),n.isVideo&&(n.clickToPlayPauseCallback=function(){if(n.options.clickToPlayPause){var e=n.getElement(n.container).querySelector("."+n.options.classPrefix+"overlay-button"),t=e.getAttribute("aria-pressed");n.paused&&t?n.pause():n.paused?n.play():n.pause(),e.setAttribute("aria-pressed",!t),n.getElement(n.container).focus()}},n.createIframeLayer(),n.media.addEventListener("click",n.clickToPlayPauseCallback),!f.IS_ANDROID&&!f.IS_IOS||n.options.alwaysShowControls?(n.getElement(n.container).addEventListener("mouseenter",function(){n.controlsEnabled&&(n.options.alwaysShowControls||(n.killControlsTimer("enter"),n.showControls(),n.startControlsTimer(n.options.controlsTimeoutMouseEnter)))}),n.getElement(n.container).addEventListener("mousemove",function(){n.controlsEnabled&&(n.controlsAreVisible||n.showControls(),n.options.alwaysShowControls||n.startControlsTimer(n.options.controlsTimeoutMouseEnter))}),n.getElement(n.container).addEventListener("mouseleave",function(){n.controlsEnabled&&(n.paused||n.options.alwaysShowControls||n.startControlsTimer(n.options.controlsTimeoutMouseLeave))})):n.node.addEventListener("touchstart",function(){n.controlsAreVisible?n.hideControls(!1):n.controlsEnabled&&n.showControls(!1)},!!f.SUPPORT_PASSIVE_EVENT&&{passive:!0}),n.options.hideVideoControlsOnLoad&&n.hideControls(!1),n.options.enableAutosize&&n.media.addEventListener("loadedmetadata",function(e){var t=void 0!==e?e.detail.target||e.target:n.media;n.options.videoHeight<=0&&!n.domNode.getAttribute("height")&&!n.domNode.style.height&&null!==t&&!isNaN(t.videoHeight)&&(n.setPlayerSize(t.videoWidth,t.videoHeight),n.setControlsSize(),n.media.setSize(t.videoWidth,t.videoHeight))})),n.media.addEventListener("play",function(){n.hasFocus=!0;for(var e in l.default.players)if(l.default.players.hasOwnProperty(e)){var t=l.default.players[e];t.id===n.id||!n.options.pauseOtherPlayers||t.paused||t.ended||(t.pause(),t.hasFocus=!1)}f.IS_ANDROID||f.IS_IOS||n.options.alwaysShowControls||!n.isVideo||n.hideControls()}),n.media.addEventListener("ended",function(){if(n.options.autoRewind)try{n.setCurrentTime(0),setTimeout(function(){var e=n.getElement(n.container).querySelector("."+n.options.classPrefix+"overlay-loading");e&&e.parentNode&&(e.parentNode.style.display="none")},20)}catch(e){}"function"==typeof n.media.renderer.stop?n.media.renderer.stop():n.pause(),n.setProgressRail&&n.setProgressRail(),n.setCurrentRail&&n.setCurrentRail(),n.options.loop?n.play():!n.options.alwaysShowControls&&n.controlsEnabled&&n.showControls()}),n.media.addEventListener("loadedmetadata",function(){(0,m.calculateTimeFormat)(n.getDuration(),n.options,n.options.framesPerSecond||25),n.updateDuration&&n.updateDuration(),n.updateCurrent&&n.updateCurrent(),n.isFullScreen||(n.setPlayerSize(n.width,n.height),n.setControlsSize())});var c=null;n.media.addEventListener("timeupdate",function(){isNaN(n.getDuration())||c===n.getDuration()||(c=n.getDuration(),(0,m.calculateTimeFormat)(c,n.options,n.options.framesPerSecond||25),n.updateDuration&&n.updateDuration(),n.updateCurrent&&n.updateCurrent(),n.setControlsSize())}),n.getElement(n.container).addEventListener("click",function(e){v.addClass(e.currentTarget,n.options.classPrefix+"container-keyboard-inactive")}),n.getElement(n.container).addEventListener("focusin",function(e){v.removeClass(e.currentTarget,n.options.classPrefix+"container-keyboard-inactive"),!n.isVideo||f.IS_ANDROID||f.IS_IOS||!n.controlsEnabled||n.options.alwaysShowControls||(n.killControlsTimer("enter"),n.showControls(),n.startControlsTimer(n.options.controlsTimeoutMouseEnter))}),n.getElement(n.container).addEventListener("focusout",function(e){setTimeout(function(){e.relatedTarget&&n.keyboardAction&&!e.relatedTarget.closest("."+n.options.classPrefix+"container")&&(n.keyboardAction=!1,!n.isVideo||n.options.alwaysShowControls||n.paused||n.startControlsTimer(n.options.controlsTimeoutMouseLeave))},0)}),setTimeout(function(){n.setPlayerSize(n.width,n.height),n.setControlsSize()},0),n.globalResizeCallback=function(){n.isFullScreen||f.HAS_TRUE_NATIVE_FULLSCREEN&&s.default.webkitIsFullScreen||n.setPlayerSize(n.width,n.height),n.setControlsSize()},n.globalBind("resize",n.globalResizeCallback)}o&&r&&n.play(),n.options.success&&("string"==typeof n.options.success?a.default[n.options.success](n.media,n.domNode,n):n.options.success(n.media,n.domNode,n))}}},{key:"_handleError",value:function(e,t,n){var i=this.getElement(this.layers).querySelector("."+this.options.classPrefix+"overlay-play");i&&(i.style.display="none"),this.options.error&&this.options.error(e,t,n),this.getElement(this.container).querySelector("."+this.options.classPrefix+"cannotplay")&&this.getElement(this.container).querySelector("."+this.options.classPrefix+"cannotplay").remove();var o=s.default.createElement("div");o.className=this.options.classPrefix+"cannotplay",o.style.width="100%",o.style.height="100%";var r="function"==typeof this.options.customError?this.options.customError(this.media,this.media.originalNode):this.options.customError,a="";if(!r){var d=this.media.originalNode.getAttribute("poster");if(d&&(a='<img src="'+d+'" alt="'+l.default.i18n.t("mejs.download-file")+'">'),e.message&&(r="<p>"+e.message+"</p>"),e.urls)for(var u=0,c=e.urls.length;u<c;u++){var f=e.urls[u];r+='<a href="'+f.src+'" data-type="'+f.type+'"><span>'+l.default.i18n.t("mejs.download-file")+": "+f.src+"</span></a>"}}r&&this.getElement(this.layers).querySelector("."+this.options.classPrefix+"overlay-error")&&(o.innerHTML=r,this.getElement(this.layers).querySelector("."+this.options.classPrefix+"overlay-error").innerHTML=""+a+o.outerHTML,this.getElement(this.layers).querySelector("."+this.options.classPrefix+"overlay-error").parentNode.style.display="block"),this.controlsEnabled&&this.disableControls()}},{key:"setPlayerSize",value:function(e,t){if(!this.options.setDimensions)return!1;switch(void 0!==e&&(this.width=e),void 0!==t&&(this.height=t),this.options.stretching){case"fill":this.isVideo?this.setFillMode():this.setDimensions(this.width,this.height);break;case"responsive":this.setResponsiveMode();break;case"none":this.setDimensions(this.width,this.height);break;default:!0===this.hasFluidMode()?this.setResponsiveMode():this.setDimensions(this.width,this.height)}}},{key:"hasFluidMode",value:function(){return-1!==this.height.toString().indexOf("%")||this.node&&this.node.style.maxWidth&&"none"!==this.node.style.maxWidth&&this.node.style.maxWidth!==this.width||this.node&&this.node.currentStyle&&"100%"===this.node.currentStyle.maxWidth}},{key:"setResponsiveMode",value:function(){var e=this,t=function(){for(var t=void 0,n=e.getElement(e.container);n;){try{if(f.IS_FIREFOX&&"html"===n.tagName.toLowerCase()&&a.default.self!==a.default.top&&null!==a.default.frameElement)return a.default.frameElement;t=n.parentElement}catch(e){t=n.parentElement}if(t&&v.visible(t))return t;n=t}return null}(),n=t?getComputedStyle(t,null):getComputedStyle(s.default.body,null),i=e.isVideo?e.node.videoWidth&&e.node.videoWidth>0?e.node.videoWidth:e.node.getAttribute("width")?e.node.getAttribute("width"):e.options.defaultVideoWidth:e.options.defaultAudioWidth,o=e.isVideo?e.node.videoHeight&&e.node.videoHeight>0?e.node.videoHeight:e.node.getAttribute("height")?e.node.getAttribute("height"):e.options.defaultVideoHeight:e.options.defaultAudioHeight,r=function(){var t=1;return e.isVideo?(t=e.node.videoWidth&&e.node.videoWidth>0&&e.node.videoHeight&&e.node.videoHeight>0?e.height>=e.width?e.node.videoWidth/e.node.videoHeight:e.node.videoHeight/e.node.videoWidth:e.initialAspectRatio,(isNaN(t)||t<.01||t>100)&&(t=1),t):t}(),l=parseFloat(n.height),d=void 0,u=parseFloat(n.width);if(d=e.isVideo?"100%"===e.height?parseFloat(u*o/i,10):e.height>=e.width?parseFloat(u/r,10):parseFloat(u*r,10):o,isNaN(d)&&(d=l),e.getElement(e.container).parentNode.length>0&&"body"===e.getElement(e.container).parentNode.tagName.toLowerCase()&&(u=a.default.innerWidth||s.default.documentElement.clientWidth||s.default.body.clientWidth,d=a.default.innerHeight||s.default.documentElement.clientHeight||s.default.body.clientHeight),d&&u){e.getElement(e.container).style.width=u+"px",e.getElement(e.container).style.height=d+"px",e.node.style.width="100%",e.node.style.height="100%",e.isVideo&&e.media.setSize&&e.media.setSize(u,d);for(var c=e.getElement(e.layers).children,p=0,m=c.length;p<m;p++)c[p].style.width="100%",c[p].style.height="100%"}}},{key:"setFillMode",value:function(){var e=this,t=a.default.self!==a.default.top&&null!==a.default.frameElement,n=function(){for(var t=void 0,n=e.getElement(e.container);n;){try{if(f.IS_FIREFOX&&"html"===n.tagName.toLowerCase()&&a.default.self!==a.default.top&&null!==a.default.frameElement)return a.default.frameElement;t=n.parentElement}catch(e){t=n.parentElement}if(t&&v.visible(t))return t;n=t}return null}(),i=n?getComputedStyle(n,null):getComputedStyle(s.default.body,null);"none"!==e.node.style.height&&e.node.style.height!==e.height&&(e.node.style.height="auto"),"none"!==e.node.style.maxWidth&&e.node.style.maxWidth!==e.width&&(e.node.style.maxWidth="none"),"none"!==e.node.style.maxHeight&&e.node.style.maxHeight!==e.height&&(e.node.style.maxHeight="none"),e.node.currentStyle&&("100%"===e.node.currentStyle.height&&(e.node.currentStyle.height="auto"),"100%"===e.node.currentStyle.maxWidth&&(e.node.currentStyle.maxWidth="none"),"100%"===e.node.currentStyle.maxHeight&&(e.node.currentStyle.maxHeight="none")),t||parseFloat(i.width)||(n.style.width=e.media.offsetWidth+"px"),t||parseFloat(i.height)||(n.style.height=e.media.offsetHeight+"px"),i=getComputedStyle(n);var o=parseFloat(i.width),r=parseFloat(i.height);e.setDimensions("100%","100%");var l=e.getElement(e.container).querySelector("."+e.options.classPrefix+"poster>img");l&&(l.style.display="");for(var d=e.getElement(e.container).querySelectorAll("object, embed, iframe, video"),u=e.height,c=e.width,p=o,m=u*o/c,h=c*r/u,g=r,y=h>o==!1,E=y?Math.floor(p):Math.floor(h),b=y?Math.floor(m):Math.floor(g),S=y?o+"px":E+"px",x=y?b+"px":r+"px",w=0,P=d.length;w<P;w++)d[w].style.height=x,d[w].style.width=S,e.media.setSize&&e.media.setSize(S,x),d[w].style.marginLeft=Math.floor((o-E)/2)+"px",d[w].style.marginTop=0}},{key:"setDimensions",value:function(e,t){e=(0,p.isString)(e)&&e.indexOf("%")>-1?e:parseFloat(e)+"px",t=(0,p.isString)(t)&&t.indexOf("%")>-1?t:parseFloat(t)+"px",this.getElement(this.container).style.width=e,this.getElement(this.container).style.height=t;for(var n=this.getElement(this.layers).children,i=0,o=n.length;i<o;i++)n[i].style.width=e,n[i].style.height=t}},{key:"setControlsSize",value:function(){var e=this;if(v.visible(e.getElement(e.container)))if(e.rail&&v.visible(e.rail)){for(var t=e.total?getComputedStyle(e.total,null):null,n=t?parseFloat(t.marginLeft)+parseFloat(t.marginRight):0,i=getComputedStyle(e.rail),o=parseFloat(i.marginLeft)+parseFloat(i.marginRight),r=0,a=v.siblings(e.rail,function(t){return t!==e.rail}),s=a.length,l=0;l<s;l++)r+=a[l].offsetWidth;r+=n+(0===n?2*o:o)+1,e.getElement(e.container).style.minWidth=r+"px";var d=(0,p.createEvent)("controlsresize",e.getElement(e.container));e.getElement(e.container).dispatchEvent(d)}else{for(var u=e.getElement(e.controls).children,c=0,f=0,m=u.length;f<m;f++)c+=u[f].offsetWidth;e.getElement(e.container).style.minWidth=c+"px"}}},{key:"addControlElement",value:function(e,t){if(void 0!==this.featurePosition[t]){var n=this.getElement(this.controls).children[this.featurePosition[t]-1];n.parentNode.insertBefore(e,n.nextSibling)}else{this.getElement(this.controls).appendChild(e);for(var i=this.getElement(this.controls).children,o=0,r=i.length;o<r;o++)if(e===i[o]){this.featurePosition[t]=o;break}}}},{key:"createIframeLayer",value:function(){var e=this;if(e.isVideo&&null!==e.media.rendererName&&e.media.rendererName.indexOf("iframe")>-1&&!s.default.getElementById(e.media.id+"-iframe-overlay")){var t=s.default.createElement("div"),n=s.default.getElementById(e.media.id+"_"+e.media.rendererName);t.id=e.media.id+"-iframe-overlay",t.className=e.options.classPrefix+"iframe-overlay",t.addEventListener("click",function(t){e.options.clickToPlayPause&&(e.paused?e.play():e.pause(),t.preventDefault(),t.stopPropagation())}),n.parentNode.insertBefore(t,n)}}},{key:"resetSize",value:function(){var e=this;setTimeout(function(){e.setPlayerSize(e.width,e.height),e.setControlsSize()},50)}},{key:"setPoster",value:function(e){if(this.getElement(this.container)){var t=this.getElement(this.container).querySelector("."+this.options.classPrefix+"poster");t||((t=s.default.createElement("div")).className=this.options.classPrefix+"poster "+this.options.classPrefix+"layer",this.getElement(this.layers).appendChild(t));var n=t.querySelector("img");!n&&e&&((n=s.default.createElement("img")).className=this.options.classPrefix+"poster-img",n.width="100%",n.height="100%",t.style.display="",t.appendChild(n)),e?(n.setAttribute("src",e),t.style.backgroundImage='url("'+e+'")',t.style.display=""):n?(t.style.backgroundImage="none",t.style.display="none",n.remove()):t.style.display="none"}else(f.IS_IPAD&&this.options.iPadUseNativeControls||f.IS_IPHONE&&this.options.iPhoneUseNativeControls||f.IS_ANDROID&&this.options.AndroidUseNativeControls)&&(this.media.originalNode.poster=e)}},{key:"changeSkin",value:function(e){this.getElement(this.container).className=this.options.classPrefix+"container "+e,this.setPlayerSize(this.width,this.height),this.setControlsSize()}},{key:"globalBind",value:function(e,t){var n=this.node?this.node.ownerDocument:s.default;if((e=(0,p.splitEvents)(e,this.id)).d)for(var i=e.d.split(" "),o=0,r=i.length;o<r;o++)i[o].split(".").reduce(function(e,i){return n.addEventListener(i,t,!1),i},"");if(e.w)for(var l=e.w.split(" "),d=0,u=l.length;d<u;d++)l[d].split(".").reduce(function(e,n){return a.default.addEventListener(n,t,!1),n},"")}},{key:"globalUnbind",value:function(e,t){var n=this.node?this.node.ownerDocument:s.default;if((e=(0,p.splitEvents)(e,this.id)).d)for(var i=e.d.split(" "),o=0,r=i.length;o<r;o++)i[o].split(".").reduce(function(e,i){return n.removeEventListener(i,t,!1),i},"");if(e.w)for(var l=e.w.split(" "),d=0,u=l.length;d<u;d++)l[d].split(".").reduce(function(e,n){return a.default.removeEventListener(n,t,!1),n},"")}},{key:"buildfeatures",value:function(e,t,n,i){for(var o=0,r=this.options.features.length;o<r;o++){var a=this.options.features[o];if(this["build"+a])try{this["build"+a](e,t,n,i)}catch(e){console.error("error building "+a,e)}}}},{key:"buildposter",value:function(e,t,n,i){var o=s.default.createElement("div");o.className=this.options.classPrefix+"poster "+this.options.classPrefix+"layer",n.appendChild(o);var r=i.originalNode.getAttribute("poster");""!==e.options.poster&&(r&&f.IS_IOS&&i.originalNode.removeAttribute("poster"),r=e.options.poster),r?this.setPoster(r):null!==this.media.renderer&&"function"==typeof this.media.renderer.getPosterUrl?this.setPoster(this.media.renderer.getPosterUrl()):o.style.display="none",i.addEventListener("play",function(){o.style.display="none"}),i.addEventListener("playing",function(){o.style.display="none"}),e.options.showPosterWhenEnded&&e.options.autoRewind&&i.addEventListener("ended",function(){o.style.display=""}),i.addEventListener("error",function(){o.style.display="none"}),e.options.showPosterWhenPaused&&i.addEventListener("pause",function(){e.ended||(o.style.display="")})}},{key:"buildoverlays",value:function(e,t,n,i){if(e.isVideo){var o=this,r=s.default.createElement("div"),a=s.default.createElement("div"),l=s.default.createElement("div");r.style.display="none",r.className=o.options.classPrefix+"overlay "+o.options.classPrefix+"layer",r.innerHTML='<div class="'+o.options.classPrefix+'overlay-loading"><span class="'+o.options.classPrefix+'overlay-loading-bg-img"></span></div>',n.appendChild(r),a.style.display="none",a.className=o.options.classPrefix+"overlay "+o.options.classPrefix+"layer",a.innerHTML='<div class="'+o.options.classPrefix+'overlay-error"></div>',n.appendChild(a),l.className=o.options.classPrefix+"overlay "+o.options.classPrefix+"layer "+o.options.classPrefix+"overlay-play",l.innerHTML='<div class="'+o.options.classPrefix+'overlay-button" role="button" tabindex="0" aria-label="'+c.default.t("mejs.play")+'" aria-pressed="false"></div>',l.addEventListener("click",function(){if(o.options.clickToPlayPause){var e=o.getElement(o.container).querySelector("."+o.options.classPrefix+"overlay-button"),t=e.getAttribute("aria-pressed");o.paused?o.play():o.pause(),e.setAttribute("aria-pressed",!!t),o.getElement(o.container).focus()}}),l.addEventListener("keydown",function(e){var t=e.keyCode||e.which||0;if(13===t||f.IS_FIREFOX&&32===t){var n=(0,p.createEvent)("click",l);return l.dispatchEvent(n),!1}}),n.appendChild(l),null!==o.media.rendererName&&(/(youtube|facebook)/i.test(o.media.rendererName)&&!(o.media.originalNode.getAttribute("poster")||e.options.poster||"function"==typeof o.media.renderer.getPosterUrl&&o.media.renderer.getPosterUrl())||f.IS_STOCK_ANDROID||o.media.originalNode.getAttribute("autoplay"))&&(l.style.display="none");var d=!1;i.addEventListener("play",function(){l.style.display="none",r.style.display="none",a.style.display="none",d=!1}),i.addEventListener("playing",function(){l.style.display="none",r.style.display="none",a.style.display="none",d=!1}),i.addEventListener("seeking",function(){l.style.display="none",r.style.display="",d=!1}),i.addEventListener("seeked",function(){l.style.display=o.paused&&!f.IS_STOCK_ANDROID?"":"none",r.style.display="none",d=!1}),i.addEventListener("pause",function(){r.style.display="none",f.IS_STOCK_ANDROID||d||(l.style.display=""),d=!1}),i.addEventListener("waiting",function(){r.style.display="",d=!1}),i.addEventListener("loadeddata",function(){r.style.display="",f.IS_ANDROID&&(i.canplayTimeout=setTimeout(function(){if(s.default.createEvent){var e=s.default.createEvent("HTMLEvents");return e.initEvent("canplay",!0,!0),i.dispatchEvent(e)}},300)),d=!1}),i.addEventListener("canplay",function(){r.style.display="none",clearTimeout(i.canplayTimeout),d=!1}),i.addEventListener("error",function(e){o._handleError(e,o.media,o.node),r.style.display="none",l.style.display="none",d=!0}),i.addEventListener("loadedmetadata",function(){o.controlsEnabled||o.enableControls()}),i.addEventListener("keydown",function(t){o.onkeydown(e,i,t),d=!1})}}},{key:"buildkeyboard",value:function(e,t,n,i){var o=this;o.getElement(o.container).addEventListener("keydown",function(){o.keyboardAction=!0}),o.globalKeydownCallback=function(t){var n=s.default.activeElement.closest("."+o.options.classPrefix+"container"),r=o.media.closest("."+o.options.classPrefix+"container");return o.hasFocus=!(!n||!r||n.id!==r.id),o.onkeydown(e,i,t)},o.globalClickCallback=function(e){o.hasFocus=!!e.target.closest("."+o.options.classPrefix+"container")},o.globalBind("keydown",o.globalKeydownCallback),o.globalBind("click",o.globalClickCallback)}},{key:"onkeydown",value:function(e,t,n){if(e.hasFocus&&e.options.enableKeyboard)for(var i=0,o=e.options.keyActions.length;i<o;i++)for(var r=e.options.keyActions[i],a=0,s=r.keys.length;a<s;a++)if(n.keyCode===r.keys[a])return r.action(e,t,n.keyCode,n),n.preventDefault(),void n.stopPropagation();return!0}},{key:"play",value:function(){this.proxy.play()}},{key:"pause",value:function(){this.proxy.pause()}},{key:"load",value:function(){this.proxy.load()}},{key:"setCurrentTime",value:function(e){this.proxy.setCurrentTime(e)}},{key:"getCurrentTime",value:function(){return this.proxy.currentTime}},{key:"getDuration",value:function(){return this.proxy.duration}},{key:"setVolume",value:function(e){this.proxy.volume=e}},{key:"getVolume",value:function(){return this.proxy.getVolume()}},{key:"setMuted",value:function(e){this.proxy.setMuted(e)}},{key:"setSrc",value:function(e){this.controlsEnabled||this.enableControls(),this.proxy.setSrc(e)}},{key:"getSrc",value:function(){return this.proxy.getSrc()}},{key:"canPlayType",value:function(e){return this.proxy.canPlayType(e)}},{key:"remove",value:function(){var e=this,t=e.media.rendererName,n=e.media.originalNode.src;for(var i in e.options.features){var r=e.options.features[i];if(e["clean"+r])try{e["clean"+r](e,e.getElement(e.layers),e.getElement(e.controls),e.media)}catch(e){console.error("error cleaning "+r,e)}}var a=e.node.getAttribute("width"),d=e.node.getAttribute("height");if(a?-1===a.indexOf("%")&&(a+="px"):a="auto",d?-1===d.indexOf("%")&&(d+="px"):d="auto",e.node.style.width=a,e.node.style.height=d,e.setPlayerSize(0,0),e.isDynamic?e.getElement(e.container).parentNode.insertBefore(e.node,e.getElement(e.container)):function(){e.node.setAttribute("controls",!0),e.node.setAttribute("id",e.node.getAttribute("id").replace("_"+t,"").replace("_from_mejs",""));var i=e.getElement(e.container).querySelector("."+e.options.classPrefix+"poster>img");if(i&&e.node.setAttribute("poster",i.src),delete e.node.autoplay,""!==e.media.canPlayType((0,h.getTypeFromFile)(n))&&e.node.setAttribute("src",n),~t.indexOf("iframe")){s.default.getElementById(e.media.id+"-iframe-overlay").remove()}var o=e.node.cloneNode();if(o.style.display="",e.getElement(e.container).parentNode.insertBefore(o,e.getElement(e.container)),e.node.remove(),e.mediaFiles)for(var r=0,a=e.mediaFiles.length;r<a;r++){var l=s.default.createElement("source");l.setAttribute("src",e.mediaFiles[r].src),l.setAttribute("type",e.mediaFiles[r].type),o.appendChild(l)}if(e.trackFiles)for(var d=function(t,n){var i=e.trackFiles[t],r=s.default.createElement("track");r.kind=i.kind,r.label=i.label,r.srclang=i.srclang,r.src=i.src,o.appendChild(r),r.addEventListener("load",function(){this.mode="showing",o.textTracks[t].mode="showing"})},u=0,c=e.trackFiles.length;u<c;u++)d(u);delete e.node,delete e.mediaFiles,delete e.trackFiles}(),"function"==typeof e.media.renderer.destroy&&e.media.renderer.destroy(),delete l.default.players[e.id],"object"===o(e.getElement(e.container))){e.getElement(e.container).parentNode.querySelector("."+e.options.classPrefix+"offscreen").remove(),e.getElement(e.container).remove()}e.globalUnbind("resize",e.globalResizeCallback),e.globalUnbind("keydown",e.globalKeydownCallback),e.globalUnbind("click",e.globalClickCallback),delete e.media.player}},{key:"paused",get:function(){return this.proxy.paused}},{key:"muted",get:function(){return this.proxy.muted},set:function(e){this.setMuted(e)}},{key:"ended",get:function(){return this.proxy.ended}},{key:"readyState",get:function(){return this.proxy.readyState}},{key:"currentTime",set:function(e){this.setCurrentTime(e)},get:function(){return this.getCurrentTime()}},{key:"duration",get:function(){return this.getDuration()}},{key:"volume",set:function(e){this.setVolume(e)},get:function(){return this.getVolume()}},{key:"src",set:function(e){this.setSrc(e)},get:function(){return this.getSrc()}}]),e}();a.default.MediaElementPlayer=y,l.default.MediaElementPlayer=y,n.default=y},{17:17,2:2,25:25,26:26,27:27,28:28,3:3,30:30,5:5,6:6,7:7}],17:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=function(e){return e&&e.__esModule?e:{default:e}}(e(3)),r=function(){function e(t){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.media=t.media,this.isVideo=t.isVideo,this.classPrefix=t.options.classPrefix,this.createIframeLayer=function(){return t.createIframeLayer()},this.setPoster=function(e){return t.setPoster(e)},this}return i(e,[{key:"play",value:function(){this.media.play()}},{key:"pause",value:function(){this.media.pause()}},{key:"load",value:function(){this.isLoaded||this.media.load(),this.isLoaded=!0}},{key:"setCurrentTime",value:function(e){this.media.setCurrentTime(e)}},{key:"getCurrentTime",value:function(){return this.media.currentTime}},{key:"getDuration",value:function(){return this.media.getDuration()}},{key:"setVolume",value:function(e){this.media.setVolume(e)}},{key:"getVolume",value:function(){return this.media.getVolume()}},{key:"setMuted",value:function(e){this.media.setMuted(e)}},{key:"setSrc",value:function(e){var t=document.getElementById(this.media.id+"-iframe-overlay");t&&t.remove(),this.media.setSrc(e),this.createIframeLayer(),null!==this.media.renderer&&"function"==typeof this.media.renderer.getPosterUrl&&this.setPoster(this.media.renderer.getPosterUrl())}},{key:"getSrc",value:function(){return this.media.getSrc()}},{key:"canPlayType",value:function(e){return this.media.canPlayType(e)}},{key:"paused",get:function(){return this.media.paused}},{key:"muted",set:function(e){this.setMuted(e)},get:function(){return this.media.muted}},{key:"ended",get:function(){return this.media.ended}},{key:"readyState",get:function(){return this.media.readyState}},{key:"currentTime",set:function(e){this.setCurrentTime(e)},get:function(){return this.getCurrentTime()}},{key:"duration",get:function(){return this.getDuration()}},{key:"volume",set:function(e){this.setVolume(e)},get:function(){return this.getVolume()}},{key:"src",set:function(e){this.setSrc(e)},get:function(){return this.getSrc()}}]),e}();n.default=r,o.default.DefaultPlayer=r},{3:3}],18:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}var o=i(e(3)),r=i(e(7)),a=i(e(16));"undefined"!=typeof jQuery?r.default.$=o.default.jQuery=o.default.$=jQuery:"undefined"!=typeof Zepto?r.default.$=o.default.Zepto=o.default.$=Zepto:"undefined"!=typeof ender&&(r.default.$=o.default.ender=o.default.$=ender),function(e){void 0!==e&&(e.fn.mediaelementplayer=function(t){return!1===t?this.each(function(){var t=e(this).data("mediaelementplayer");t&&t.remove(),e(this).removeData("mediaelementplayer")}):this.each(function(){e(this).data("mediaelementplayer",new a.default(this,t))}),this},e(document).ready(function(){e("."+r.default.MepDefaults.classPrefix+"player").mediaelementplayer()}))}(r.default.$)},{16:16,3:3,7:7}],19:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r=i(e(3)),a=i(e(7)),s=e(8),l=e(27),d=e(28),u=e(25),c=e(26),f={promise:null,load:function(e){return"undefined"!=typeof dashjs?f.promise=new Promise(function(e){e()}).then(function(){f._createPlayer(e)}):(e.options.path="string"==typeof e.options.path?e.options.path:"https://cdn.dashjs.org/latest/dash.all.min.js",f.promise=f.promise||(0,c.loadScript)(e.options.path),f.promise.then(function(){f._createPlayer(e)})),f.promise},_createPlayer:function(e){var t=dashjs.MediaPlayer().create();return r.default["__ready__"+e.id](t),t}},p={name:"native_dash",options:{prefix:"native_dash",dash:{path:"https://cdn.dashjs.org/latest/dash.all.min.js",debug:!1,drm:{},robustnessLevel:""}},canPlayType:function(e){return u.HAS_MSE&&["application/dash+xml"].indexOf(e.toLowerCase())>-1},create:function(e,t,n){var i=e.originalNode,d=e.id+"_"+t.prefix,u=i.autoplay,c=i.children,p=null,m=null;i.removeAttribute("type");for(var h=0,v=c.length;h<v;h++)c[h].removeAttribute("type");p=i.cloneNode(!0),t=Object.assign(t,e.options);for(var g=a.default.html5media.properties,y=a.default.html5media.events.concat(["click","mouseover","mouseout"]).filter(function(e){return"error"!==e}),E=function(t){var n=(0,l.createEvent)(t.type,e);e.dispatchEvent(n)},b=function(e){var n=""+e.substring(0,1).toUpperCase()+e.substring(1);p["get"+n]=function(){return null!==m?p[e]:null},p["set"+n]=function(n){if(-1===a.default.html5media.readOnlyProperties.indexOf(e))if("src"===e){var i="object"===(void 0===n?"undefined":o(n))&&n.src?n.src:n;if(p[e]=i,null!==m){m.reset();for(var r=0,s=y.length;r<s;r++)p.removeEventListener(y[r],E);m=f._createPlayer({options:t.dash,id:d}),n&&"object"===(void 0===n?"undefined":o(n))&&"object"===o(n.drm)&&(m.setProtectionData(n.drm),(0,l.isString)(t.dash.robustnessLevel)&&t.dash.robustnessLevel&&m.getProtectionController().setRobustnessLevel(t.dash.robustnessLevel)),m.attachSource(i),u&&m.play()}}else p[e]=n}},S=0,x=g.length;S<x;S++)b(g[S]);if(r.default["__ready__"+d]=function(n){e.dashPlayer=m=n;for(var i=dashjs.MediaPlayer.events,r=function(e){"loadedmetadata"===e&&(m.getDebug().setLogToBrowserConsole(t.dash.debug),m.initialize(),m.setScheduleWhilePaused(!1),m.setFastSwitchEnabled(!0),m.attachView(p),m.setAutoPlay(!1),"object"!==o(t.dash.drm)||a.default.Utils.isObjectEmpty(t.dash.drm)||(m.setProtectionData(t.dash.drm),(0,l.isString)(t.dash.robustnessLevel)&&t.dash.robustnessLevel&&m.getProtectionController().setRobustnessLevel(t.dash.robustnessLevel)),m.attachSource(p.getSrc())),p.addEventListener(e,E)},s=0,d=y.length;s<d;s++)r(y[s]);var u=function(t){if("error"===t.type.toLowerCase())e.generateError(t.message,p.src),console.error(t);else{var n=(0,l.createEvent)(t.type,e);n.data=t,e.dispatchEvent(n)}};for(var c in i)i.hasOwnProperty(c)&&m.on(i[c],function(e){return u(e)})},n&&n.length>0)for(var w=0,P=n.length;w<P;w++)if(s.renderer.renderers[t.prefix].canPlayType(n[w].type)){p.setAttribute("src",n[w].src),void 0!==n[w].drm&&(t.dash.drm=n[w].drm);break}p.setAttribute("id",d),i.parentNode.insertBefore(p,i),i.autoplay=!1,i.style.display="none",p.setSize=function(e,t){return p.style.width=e+"px",p.style.height=t+"px",p},p.hide=function(){return p.pause(),p.style.display="none",p},p.show=function(){return p.style.display="",p},p.destroy=function(){null!==m&&m.reset()};var T=(0,l.createEvent)("rendererready",p);return e.dispatchEvent(T),e.promises.push(f.load({options:t.dash,id:d})),p}};d.typeChecks.push(function(e){return~e.toLowerCase().indexOf(".mpd")?"application/dash+xml":null}),s.renderer.add(p)},{25:25,26:26,27:27,28:28,3:3,7:7,8:8}],20:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(n,"__esModule",{value:!0}),n.PluginDetector=void 0;var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r=i(e(3)),a=i(e(2)),s=i(e(7)),l=i(e(5)),d=e(8),u=e(27),c=e(25),f=e(28),p=n.PluginDetector={plugins:[],hasPluginVersion:function(e,t){var n=p.plugins[e];return t[1]=t[1]||0,t[2]=t[2]||0,n[0]>t[0]||n[0]===t[0]&&n[1]>t[1]||n[0]===t[0]&&n[1]===t[1]&&n[2]>=t[2]},addPlugin:function(e,t,n,i,o){p.plugins[e]=p.detectPlugin(t,n,i,o)},detectPlugin:function(e,t,n,i){var a=[0,0,0],s=void 0,l=void 0;if(null!==c.NAV.plugins&&void 0!==c.NAV.plugins&&"object"===o(c.NAV.plugins[e])){if((s=c.NAV.plugins[e].description)&&(void 0===c.NAV.mimeTypes||!c.NAV.mimeTypes[t]||c.NAV.mimeTypes[t].enabledPlugin))for(var d=0,u=(a=s.replace(e,"").replace(/^\s+/,"").replace(/\sr/gi,".").split(".")).length;d<u;d++)a[d]=parseInt(a[d].match(/\d+/),10)}else if(void 0!==r.default.ActiveXObject)try{(l=new ActiveXObject(n))&&(a=i(l))}catch(e){}return a}};p.addPlugin("flash","Shockwave Flash","application/x-shockwave-flash","ShockwaveFlash.ShockwaveFlash",function(e){var t=[],n=e.GetVariable("$version");return n&&(n=n.split(" ")[1].split(","),t=[parseInt(n[0],10),parseInt(n[1],10),parseInt(n[2],10)]),t});var m=function(e,t,n){var i={},o=!1;i.options=t,i.id=e.id+"_"+i.options.prefix,i.mediaElement=e,i.flashState={},i.flashApi=null,i.flashApiStack=[];for(var p=s.default.html5media.properties,m=function(e){i.flashState[e]=null;var t=""+e.substring(0,1).toUpperCase()+e.substring(1);i["get"+t]=function(){if(null!==i.flashApi){if("function"==typeof i.flashApi["get_"+e]){var t=i.flashApi["get_"+e]();return"buffered"===e?{start:function(){return 0},end:function(){return t},length:1}:t}return null}return null},i["set"+t]=function(t){if("src"===e&&(t=(0,f.absolutizeUrl)(t)),null!==i.flashApi&&void 0!==i.flashApi["set_"+e])try{i.flashApi["set_"+e](t)}catch(e){}else i.flashApiStack.push({type:"set",propName:e,value:t})}},h=0,v=p.length;h<v;h++)m(p[h]);var g=s.default.html5media.methods,y=function(e){i[e]=function(){if(o)if(null!==i.flashApi){if(i.flashApi["fire_"+e])try{i.flashApi["fire_"+e]()}catch(e){}}else i.flashApiStack.push({type:"call",methodName:e})}};g.push("stop");for(var E=0,b=g.length;E<b;E++)y(g[E]);for(var S=["rendererready"],x=0,w=S.length;x<w;x++){var P=(0,u.createEvent)(S[x],i);e.dispatchEvent(P)}r.default["__ready__"+i.id]=function(){if(i.flashReady=!0,i.flashApi=a.default.getElementById("__"+i.id),i.flashApiStack.length)for(var e=0,t=i.flashApiStack.length;e<t;e++){var n=i.flashApiStack[e];if("set"===n.type){var o=n.propName,r=""+o.substring(0,1).toUpperCase()+o.substring(1);i["set"+r](n.value)}else"call"===n.type&&i[n.methodName]()}},r.default["__event__"+i.id]=function(e,t){var n=(0,u.createEvent)(e,i);if(t)try{n.data=JSON.parse(t),n.details.data=JSON.parse(t)}catch(e){n.message=t}i.mediaElement.dispatchEvent(n)},i.flashWrapper=a.default.createElement("div"),-1===["always","sameDomain"].indexOf(i.options.shimScriptAccess)&&(i.options.shimScriptAccess="sameDomain");var T=e.originalNode.autoplay,C=["uid="+i.id,"autoplay="+T,"allowScriptAccess="+i.options.shimScriptAccess,"preload="+(e.originalNode.getAttribute("preload")||"")],k=null!==e.originalNode&&"video"===e.originalNode.tagName.toLowerCase(),_=k?e.originalNode.height:1,N=k?e.originalNode.width:1;e.originalNode.getAttribute("src")&&C.push("src="+e.originalNode.getAttribute("src")),!0===i.options.enablePseudoStreaming&&(C.push("pseudostreamstart="+i.options.pseudoStreamingStartQueryParam),C.push("pseudostreamtype="+i.options.pseudoStreamingType)),i.options.streamDelimiter&&C.push("streamdelimiter="+encodeURIComponent(i.options.streamDelimiter)),i.options.proxyType&&C.push("proxytype="+i.options.proxyType),e.appendChild(i.flashWrapper),e.originalNode.style.display="none";var A=[];if(c.IS_IE||c.IS_EDGE){var L=a.default.createElement("div");i.flashWrapper.appendChild(L),A=c.IS_EDGE?['type="application/x-shockwave-flash"','data="'+i.options.pluginPath+i.options.filename+'"','id="__'+i.id+'"','width="'+N+'"','height="'+_+"'\""]:['classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"','codebase="//download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab"','id="__'+i.id+'"','width="'+N+'"','height="'+_+'"'],k||A.push('style="clip: rect(0 0 0 0); position: absolute;"'),L.outerHTML="<object "+A.join(" ")+'><param name="movie" value="'+i.options.pluginPath+i.options.filename+"?x="+new Date+'" /><param name="flashvars" value="'+C.join("&")+'" /><param name="quality" value="high" /><param name="bgcolor" value="#000000" /><param name="wmode" value="transparent" /><param name="allowScriptAccess" value="'+i.options.shimScriptAccess+'" /><param name="allowFullScreen" value="true" /><div>'+l.default.t("mejs.install-flash")+"</div></object>"}else A=['id="__'+i.id+'"','name="__'+i.id+'"','play="true"','loop="false"','quality="high"','bgcolor="#000000"','wmode="transparent"','allowScriptAccess="'+i.options.shimScriptAccess+'"','allowFullScreen="true"','type="application/x-shockwave-flash"','pluginspage="//www.macromedia.com/go/getflashplayer"','src="'+i.options.pluginPath+i.options.filename+'"','flashvars="'+C.join("&")+'"'],k?(A.push('width="'+N+'"'),A.push('height="'+_+'"')):A.push('style="position: fixed; left: -9999em; top: -9999em;"'),i.flashWrapper.innerHTML="<embed "+A.join(" ")+">";if(i.flashNode=i.flashWrapper.lastChild,i.hide=function(){o=!1,k&&(i.flashNode.style.display="none")},i.show=function(){o=!0,k&&(i.flashNode.style.display="")},i.setSize=function(e,t){i.flashNode.style.width=e+"px",i.flashNode.style.height=t+"px",null!==i.flashApi&&"function"==typeof i.flashApi.fire_setSize&&i.flashApi.fire_setSize(e,t)},i.destroy=function(){i.flashNode.remove()},n&&n.length>0)for(var F=0,j=n.length;F<j;F++)if(d.renderer.renderers[t.prefix].canPlayType(n[F].type)){i.setSrc(n[F].src);break}return i};if(p.hasPluginVersion("flash",[10,0,0])){f.typeChecks.push(function(e){return(e=e.toLowerCase()).startsWith("rtmp")?~e.indexOf(".mp3")?"audio/rtmp":"video/rtmp":/\.og(a|g)/i.test(e)?"audio/ogg":~e.indexOf(".m3u8")?"application/x-mpegURL":~e.indexOf(".mpd")?"application/dash+xml":~e.indexOf(".flv")?"video/flv":null});var h={name:"flash_video",options:{prefix:"flash_video",filename:"mediaelement-flash-video.swf",enablePseudoStreaming:!1,pseudoStreamingStartQueryParam:"start",pseudoStreamingType:"byte",proxyType:"",streamDelimiter:""},canPlayType:function(e){return~["video/mp4","video/rtmp","audio/rtmp","rtmp/mp4","audio/mp4","video/flv","video/x-flv"].indexOf(e.toLowerCase())},create:m};d.renderer.add(h);var v={name:"flash_hls",options:{prefix:"flash_hls",filename:"mediaelement-flash-video-hls.swf"},canPlayType:function(e){return~["application/x-mpegurl","application/vnd.apple.mpegurl","audio/mpegurl","audio/hls","video/hls"].indexOf(e.toLowerCase())},create:m};d.renderer.add(v);var g={name:"flash_dash",options:{prefix:"flash_dash",filename:"mediaelement-flash-video-mdash.swf"},canPlayType:function(e){return~["application/dash+xml"].indexOf(e.toLowerCase())},create:m};d.renderer.add(g);var y={name:"flash_audio",options:{prefix:"flash_audio",filename:"mediaelement-flash-audio.swf"},canPlayType:function(e){return~["audio/mp3"].indexOf(e.toLowerCase())},create:m};d.renderer.add(y);var E={name:"flash_audio_ogg",options:{prefix:"flash_audio_ogg",filename:"mediaelement-flash-audio-ogg.swf"},canPlayType:function(e){return~["audio/ogg","audio/oga","audio/ogv"].indexOf(e.toLowerCase())},create:m};d.renderer.add(E)}},{2:2,25:25,27:27,28:28,3:3,5:5,7:7,8:8}],21:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r=i(e(3)),a=i(e(7)),s=e(8),l=e(27),d=e(25),u=e(28),c=e(26),f={promise:null,load:function(e){return"undefined"!=typeof flvjs?f.promise=new Promise(function(e){e()}).then(function(){f._createPlayer(e)}):(e.options.path="string"==typeof e.options.path?e.options.path:"https://cdn.jsdelivr.net/npm/flv.js@latest",f.promise=f.promise||(0,c.loadScript)(e.options.path),f.promise.then(function(){f._createPlayer(e)})),f.promise},_createPlayer:function(e){flvjs.LoggingControl.enableDebug=e.options.debug,flvjs.LoggingControl.enableVerbose=e.options.debug;var t=flvjs.createPlayer(e.options,e.configs);return r.default["__ready__"+e.id](t),t}},p={name:"native_flv",options:{prefix:"native_flv",flv:{path:"https://cdn.jsdelivr.net/npm/flv.js@latest",cors:!0,debug:!1}},canPlayType:function(e){return d.HAS_MSE&&["video/x-flv","video/flv"].indexOf(e.toLowerCase())>-1},create:function(e,t,n){var i=e.originalNode,d=e.id+"_"+t.prefix,u=null,c=null;u=i.cloneNode(!0),t=Object.assign(t,e.options);for(var p=a.default.html5media.properties,m=a.default.html5media.events.concat(["click","mouseover","mouseout"]).filter(function(e){return"error"!==e}),h=function(t){var n=(0,l.createEvent)(t.type,e);e.dispatchEvent(n)},v=function(e){var n=""+e.substring(0,1).toUpperCase()+e.substring(1);u["get"+n]=function(){return null!==c?u[e]:null},u["set"+n]=function(n){if(-1===a.default.html5media.readOnlyProperties.indexOf(e))if("src"===e){if(u[e]="object"===(void 0===n?"undefined":o(n))&&n.src?n.src:n,null!==c){var i={};i.type="flv",i.url=n,i.cors=t.flv.cors,i.debug=t.flv.debug,i.path=t.flv.path;var r=t.flv.configs;c.destroy();for(var s=0,l=m.length;s<l;s++)u.removeEventListener(m[s],h);(c=f._createPlayer({options:i,configs:r,id:d})).attachMediaElement(u),c.load()}}else u[e]=n}},g=0,y=p.length;g<y;g++)v(p[g]);if(r.default["__ready__"+d]=function(t){e.flvPlayer=c=t;for(var n=flvjs.Events,i=function(e){"loadedmetadata"===e&&(c.unload(),c.detachMediaElement(),c.attachMediaElement(u),c.load()),u.addEventListener(e,h)},o=0,r=m.length;o<r;o++)i(m[o]);var a=function(t){n.hasOwnProperty(t)&&c.on(n[t],function(){for(var i=arguments.length,o=Array(i),r=0;r<i;r++)o[r]=arguments[r];return function(t,n){if("error"===t){var i=n[0]+": "+n[1]+" "+n[2].msg;e.generateError(i,u.src)}else{var o=(0,l.createEvent)(t,e);o.data=n,e.dispatchEvent(o)}}(n[t],o)})};for(var s in n)a(s)},n&&n.length>0)for(var E=0,b=n.length;E<b;E++)if(s.renderer.renderers[t.prefix].canPlayType(n[E].type)){u.setAttribute("src",n[E].src);break}u.setAttribute("id",d),i.parentNode.insertBefore(u,i),i.autoplay=!1,i.style.display="none";var S={};S.type="flv",S.url=u.src,S.cors=t.flv.cors,S.debug=t.flv.debug,S.path=t.flv.path;var x=t.flv.configs;u.setSize=function(e,t){return u.style.width=e+"px",u.style.height=t+"px",u},u.hide=function(){return null!==c&&c.pause(),u.style.display="none",u},u.show=function(){return u.style.display="",u},u.destroy=function(){null!==c&&c.destroy()};var w=(0,l.createEvent)("rendererready",u);return e.dispatchEvent(w),e.promises.push(f.load({options:S,configs:x,id:d})),u}};u.typeChecks.push(function(e){return~e.toLowerCase().indexOf(".flv")?"video/flv":null}),s.renderer.add(p)},{25:25,26:26,27:27,28:28,3:3,7:7,8:8}],22:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r=i(e(3)),a=i(e(7)),s=e(8),l=e(27),d=e(25),u=e(28),c=e(26),f={promise:null,load:function(e){return"undefined"!=typeof Hls?f.promise=new Promise(function(e){e()}).then(function(){f._createPlayer(e)}):(e.options.path="string"==typeof e.options.path?e.options.path:"https://cdn.jsdelivr.net/npm/hls.js@latest",f.promise=f.promise||(0,c.loadScript)(e.options.path),f.promise.then(function(){f._createPlayer(e)})),f.promise},_createPlayer:function(e){var t=new Hls(e.options);return r.default["__ready__"+e.id](t),t}},p={name:"native_hls",options:{prefix:"native_hls",hls:{path:"https://cdn.jsdelivr.net/npm/hls.js@latest",autoStartLoad:!1,debug:!1}},canPlayType:function(e){return d.HAS_MSE&&["application/x-mpegurl","application/vnd.apple.mpegurl","audio/mpegurl","audio/hls","video/hls"].indexOf(e.toLowerCase())>-1},create:function(e,t,n){var i=e.originalNode,d=e.id+"_"+t.prefix,u=i.getAttribute("preload"),c=i.autoplay,p=null,m=null,h=0,v=n.length;m=i.cloneNode(!0),(t=Object.assign(t,e.options)).hls.autoStartLoad=u&&"none"!==u||c;for(var g=a.default.html5media.properties,y=a.default.html5media.events.concat(["click","mouseover","mouseout"]).filter(function(e){return"error"!==e}),E=function(t){var n=(0,l.createEvent)(t.type,e);e.dispatchEvent(n)},b=function(e){var n=""+e.substring(0,1).toUpperCase()+e.substring(1);m["get"+n]=function(){return null!==p?m[e]:null},m["set"+n]=function(n){if(-1===a.default.html5media.readOnlyProperties.indexOf(e))if("src"===e){if(m[e]="object"===(void 0===n?"undefined":o(n))&&n.src?n.src:n,null!==p){p.destroy();for(var i=0,r=y.length;i<r;i++)m.removeEventListener(y[i],E);(p=f._createPlayer({options:t.hls,id:d})).loadSource(n),p.attachMedia(m)}}else m[e]=n}},S=0,x=g.length;S<x;S++)b(g[S]);if(r.default["__ready__"+d]=function(t){e.hlsPlayer=p=t;for(var i=Hls.Events,o=function(t){if("loadedmetadata"===t){var n=e.originalNode.src;p.detachMedia(),p.loadSource(n),p.attachMedia(m)}m.addEventListener(t,E)},r=0,a=y.length;r<a;r++)o(y[r]);var s=void 0,d=void 0,u=function(t){i.hasOwnProperty(t)&&p.on(i[t],function(){for(var o=arguments.length,r=Array(o),a=0;a<o;a++)r[a]=arguments[a];return function(t,i){if("hlsError"===t){if(console.warn(i),(i=i[1]).fatal)switch(i.type){case"mediaError":var o=(new Date).getTime();if(!s||o-s>3e3)s=(new Date).getTime(),p.recoverMediaError();else if(!d||o-d>3e3)d=(new Date).getTime(),console.warn("Attempting to swap Audio Codec and recover from media error"),p.swapAudioCodec(),p.recoverMediaError();else{var r="Cannot recover, last media error recovery failed";e.generateError(r,m.src),console.error(r)}break;case"networkError":"manifestLoadError"===i.details&&h<v&&void 0!==n[h+1]?(m.setSrc(n[h++].src),m.load(),m.play()):(e.generateError("Network error",n),console.error("Network error"));break;default:p.destroy()}}else{var a=(0,l.createEvent)(t,e);a.data=i,e.dispatchEvent(a)}}(i[t],r)})};for(var c in i)u(c)},v>0)for(;h<v;h++)if(s.renderer.renderers[t.prefix].canPlayType(n[h].type)){m.setAttribute("src",n[h].src);break}"auto"===u||c||(m.addEventListener("play",function(){null!==p&&p.startLoad()}),m.addEventListener("pause",function(){null!==p&&p.stopLoad()})),m.setAttribute("id",d),i.parentNode.insertBefore(m,i),i.autoplay=!1,i.style.display="none",m.setSize=function(e,t){return m.style.width=e+"px",m.style.height=t+"px",m},m.hide=function(){return m.pause(),m.style.display="none",m},m.show=function(){return m.style.display="",m},m.destroy=function(){null!==p&&(p.stopLoad(),p.destroy())};var w=(0,l.createEvent)("rendererready",m);return e.dispatchEvent(w),e.promises.push(f.load({options:t.hls,id:d})),m}};u.typeChecks.push(function(e){return~e.toLowerCase().indexOf(".m3u8")?"application/x-mpegURL":null}),s.renderer.add(p)},{25:25,26:26,27:27,28:28,3:3,7:7,8:8}],23:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}var o=i(e(3)),r=i(e(2)),a=i(e(7)),s=e(8),l=e(27),d=e(25),u={name:"html5",options:{prefix:"html5"},canPlayType:function(e){var t=r.default.createElement("video");return d.IS_ANDROID&&/\/mp(3|4)$/i.test(e)||~["application/x-mpegurl","vnd.apple.mpegurl","audio/mpegurl","audio/hls","video/hls"].indexOf(e.toLowerCase())&&d.SUPPORTS_NATIVE_HLS?"yes":t.canPlayType?t.canPlayType(e.toLowerCase()).replace(/no/,""):""},create:function(e,t,n){var i=e.id+"_"+t.prefix,o=!1,d=null;void 0===e.originalNode||null===e.originalNode?(d=r.default.createElement("audio"),e.appendChild(d)):d=e.originalNode,d.setAttribute("id",i);for(var u=a.default.html5media.properties,c=function(e){var t=""+e.substring(0,1).toUpperCase()+e.substring(1);d["get"+t]=function(){return d[e]},d["set"+t]=function(t){-1===a.default.html5media.readOnlyProperties.indexOf(e)&&(d[e]=t)}},f=0,p=u.length;f<p;f++)c(u[f]);for(var m=a.default.html5media.events.concat(["click","mouseover","mouseout"]).filter(function(e){return"error"!==e}),h=function(t){d.addEventListener(t,function(t){if(o){var n=(0,l.createEvent)(t.type,t.target);e.dispatchEvent(n)}})},v=0,g=m.length;v<g;v++)h(m[v]);d.setSize=function(e,t){return d.style.width=e+"px",d.style.height=t+"px",d},d.hide=function(){return o=!1,d.style.display="none",d},d.show=function(){return o=!0,d.style.display="",d};var y=0,E=n.length;if(E>0)for(;y<E;y++)if(s.renderer.renderers[t.prefix].canPlayType(n[y].type)){d.setAttribute("src",n[y].src);break}d.addEventListener("error",function(t){4===t.target.error.code&&o&&(y<E&&void 0!==n[y+1]?(d.src=n[y++].src,d.load(),d.play()):e.generateError("Media error: Format(s) not supported or source(s) not found",n))});var b=(0,l.createEvent)("rendererready",d);return e.dispatchEvent(b),d}};o.default.HtmlMediaElement=a.default.HtmlMediaElement=u,s.renderer.add(u)},{2:2,25:25,27:27,3:3,7:7,8:8}],24:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}var o=i(e(3)),r=i(e(2)),a=i(e(7)),s=e(8),l=e(27),d=e(28),u=e(26),c={isIframeStarted:!1,isIframeLoaded:!1,iframeQueue:[],enqueueIframe:function(e){c.isLoaded="undefined"!=typeof YT&&YT.loaded,c.isLoaded?c.createIframe(e):(c.loadIframeApi(),c.iframeQueue.push(e))},loadIframeApi:function(){c.isIframeStarted||((0,u.loadScript)("https://www.youtube.com/player_api"),c.isIframeStarted=!0)},iFrameReady:function(){for(c.isLoaded=!0,c.isIframeLoaded=!0;c.iframeQueue.length>0;){var e=c.iframeQueue.pop();c.createIframe(e)}},createIframe:function(e){return new YT.Player(e.containerId,e)},getYouTubeId:function(e){var t="";e.indexOf("?")>0?""===(t=c.getYouTubeIdFromParam(e))&&(t=c.getYouTubeIdFromUrl(e)):t=c.getYouTubeIdFromUrl(e);return(t=t.substring(t.lastIndexOf("/")+1).split("?"))[0]},getYouTubeIdFromParam:function(e){if(void 0===e||null===e||!e.trim().length)return null;for(var t=e.split("?")[1].split("&"),n="",i=0,o=t.length;i<o;i++){var r=t[i].split("=");if("v"===r[0]){n=r[1];break}}return n},getYouTubeIdFromUrl:function(e){if(void 0===e||null===e||!e.trim().length)return null;return(e=e.split("?")[0]).substring(e.lastIndexOf("/")+1)},getYouTubeNoCookieUrl:function(e){if(void 0===e||null===e||!e.trim().length||-1===e.indexOf("//www.youtube"))return e;var t=e.split("/");return t[2]=t[2].replace(".com","-nocookie.com"),t.join("/")}},f={name:"youtube_iframe",options:{prefix:"youtube_iframe",youtube:{autoplay:0,controls:0,disablekb:1,end:0,loop:0,modestbranding:0,playsinline:0,rel:0,showinfo:0,start:0,iv_load_policy:3,nocookie:!1,imageQuality:null}},canPlayType:function(e){return~["video/youtube","video/x-youtube"].indexOf(e.toLowerCase())},create:function(e,t,n){var i={},s=[],d=null,u=!0,f=!1,p=null;i.options=t,i.id=e.id+"_"+t.prefix,i.mediaElement=e;for(var m=a.default.html5media.properties,h=function(t){var n=""+t.substring(0,1).toUpperCase()+t.substring(1);i["get"+n]=function(){if(null!==d){switch(t){case"currentTime":return d.getCurrentTime();case"duration":return d.getDuration();case"volume":return d.getVolume()/100;case"paused":return u;case"ended":return f;case"muted":return d.isMuted();case"buffered":var e=d.getVideoLoadedFraction(),n=d.getDuration();return{start:function(){return 0},end:function(){return e*n},length:1};case"src":return d.getVideoUrl();case"readyState":return 4}return null}return null},i["set"+n]=function(n){if(null!==d)switch(t){case"src":var o="string"==typeof n?n:n[0].src,r=c.getYouTubeId(o);e.originalNode.autoplay?d.loadVideoById(r):d.cueVideoById(r);break;case"currentTime":d.seekTo(n);break;case"muted":n?d.mute():d.unMute(),setTimeout(function(){var t=(0,l.createEvent)("volumechange",i);e.dispatchEvent(t)},50);break;case"volume":n,d.setVolume(100*n),setTimeout(function(){var t=(0,l.createEvent)("volumechange",i);e.dispatchEvent(t)},50);break;case"readyState":var a=(0,l.createEvent)("canplay",i);e.dispatchEvent(a)}else s.push({type:"set",prop
|