WP Photo Album Plus - Version 8.2.02.007

Version Description

= 8.1.08 =

  • This version addresses various bug fixes, feature requests and security fixes.
Download this release

Release Info

Developer opajaap
Plugin Icon wp plugin WP Photo Album Plus
Version 8.2.02.007
Comparing to
See all releases

Code changes from version 8.2.02.006 to 8.2.02.007

changelog.txt CHANGED
@@ -5,6 +5,7 @@ WP Photo Album Plus Changelog
5
  * Introduction of native blocks: Photo of the day, upload and simple slideshow. Usable for posts/pages and widgets.
6
  * Textual corrections. The use of 'subalbum' is now consistent.
7
  * Emai callback urls did not work when refuse unencrypted is enabled. Fixed.
 
8
 
9
  = 8.2.01 =
10
 
5
  * Introduction of native blocks: Photo of the day, upload and simple slideshow. Usable for posts/pages and widgets.
6
  * Textual corrections. The use of 'subalbum' is now consistent.
7
  * Emai callback urls did not work when refuse unencrypted is enabled. Fixed.
8
+ * The display of the album and photo admin page has been restructured.
9
 
10
  = 8.2.01 =
11
 
wppa-admin-styles.css CHANGED
@@ -1,7 +1,7 @@
1
  /* admin-styles.css
2
  *
3
  * wp-photo-album-plus
4
- * version 8.2.02.006
5
  */
6
  #files_list, #files_list2
7
  {
@@ -544,7 +544,7 @@ border:1px solid black;
544
  }
545
 
546
  .wppa-admin-button {
547
- margin: 6px !important;
548
  }
549
 
550
  /* Album admin new */
@@ -584,4 +584,64 @@ details.hidden {
584
  margin:0 -10;
585
  }
586
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
587
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  /* admin-styles.css
2
  *
3
  * wp-photo-album-plus
4
+ * version 8.2.02.007
5
  */
6
  #files_list, #files_list2
7
  {
544
  }
545
 
546
  .wppa-admin-button {
547
+ margin:0 1px !important;
548
  }
549
 
550
  /* Album admin new */
584
  margin:0 -10;
585
  }
586
 
587
+ .wppa-flex {
588
+ display: flex;
589
+ flex-flow: row wrap;
590
+ align-items: flex-start;
591
+ align-content: space-between;
592
+ padding: 10px;
593
+ }
594
+
595
+ .wppa-flex div {
596
+ max-width: 200px;
597
+ margin-right: 4px;
598
+ }
599
+
600
+ .wppa-flex div label {
601
+ font-size:0.8em;
602
+ font-weight: 600;
603
+ margin-bottom: 10px;
604
+ }
605
 
606
+ .wppa-flex div h4 {
607
+ font-size: 1.2em;
608
+ margin: 0 6px 0 0;
609
+ }
610
+
611
+ #wppa-action-container {
612
+ margin-top: 8px;
613
+ display: flex;
614
+ flex-flow: row wrap;
615
+ justify-content: space-between;
616
+ }
617
+
618
+ #wppa-action-container-left {
619
+ display: flex;
620
+ flex-basis: 50%;
621
+ align-items: flex-start;
622
+ margin-bottom: 8px;
623
+ }
624
+
625
+ #wppa-action-container-left input,
626
+ #wppa-action-container-left select {
627
+ margin-right: 8px;
628
+ }
629
+
630
+ #wppa-action-container-left input:last-of-type {
631
+ margin-right: 0;
632
+ }
633
+
634
+ #wppa-action-container-right {
635
+ display: flex;
636
+ align-items: flex-end;
637
+ }
638
+
639
+ #wppa-action-container-right input,
640
+ #wppa-action-container-right select {
641
+ margin-left: 8px;
642
+ align-self:baseline;
643
+ }
644
+
645
+ #wppa-action-container-right select:first-of-type {
646
+ margin-left: 0;
647
+ }
wppa-album-admin-autosave.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * create, edit and delete albums
6
- * Version 8.2.02.006
7
  *
8
  */
9
 
@@ -73,6 +73,7 @@ global $wppa_revno;
73
  // album edit page
74
  if ( wppa_get( 'tab' ) == 'edit' ) {
75
 
 
76
  if ( wppa_get( 'edit-id' ) ) {
77
 
78
  $ei = wppa_get( 'edit-id' );
@@ -95,6 +96,7 @@ global $wppa_revno;
95
  }
96
  }
97
 
 
98
  if ( wppa_get( 'edit-id' ) == 'single' ) {
99
 
100
  $txt = wppa_get( 'just-edit', __( 'Edit Single Photo', 'wp-photo-album-plus' ) );
@@ -105,6 +107,7 @@ global $wppa_revno;
105
  return;
106
  }
107
 
 
108
  if ( wppa_get( 'edit-id' ) == 'search' ) {
109
 
110
  if ( wppa_get( 'searchstring' ) ) {
@@ -148,6 +151,7 @@ global $wppa_revno;
148
  return;
149
  }
150
 
 
151
  if ( wppa_get( 'edit-id' ) == 'trash' ) {
152
 
153
  $h2 = __( 'Manage Trashed Photos', 'wp-photo-album-plus' );
@@ -164,6 +168,7 @@ global $wppa_revno;
164
  return;
165
  }
166
 
 
167
  if ( wppa_get( 'edit-id' ) == 'new' ) {
168
 
169
  if ( ! wppa_can_create_album() ) {
@@ -228,6 +233,8 @@ global $wppa_revno;
228
  $edit_id = $id;
229
  }
230
  }
 
 
231
  else {
232
  $edit_id = wppa_get( 'edit-id' );
233
  }
@@ -238,6 +245,8 @@ global $wppa_revno;
238
  wp_die( __( 'You have insufficient rights to edit this album', 'wp-photo-album-plus' ) );
239
  }
240
 
 
 
241
  // Apply new desc
242
  if ( wppa_get( 'applynewdesc' ) ) {
243
  if ( ! wp_verify_nonce( wppa_get( 'nonce' ), 'wppa-nonce' ) ) {
@@ -275,6 +284,7 @@ global $wppa_revno;
275
  }
276
  }
277
 
 
278
  $remark = sprintf( __( 'Album %s is not modified yet', 'wp-photo-album-plus' ), $edit_id );
279
 
280
  // Set all to pano
@@ -371,7 +381,10 @@ global $wppa_revno;
371
  }
372
  }
373
 
 
 
374
  // Get the album information
 
375
  $albuminfo = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->wppa_albums
376
  WHERE id = %s", $edit_id ), ARRAY_A );
377
 
@@ -408,242 +421,296 @@ global $wppa_revno;
408
  $tpviews = $treecounts['treephotoviews'];
409
  $nsub = $treecounts['selfalbums'];
410
 
411
- $br = wppa_is_phone() ? '<br>' : ' ';
412
 
413
- // Open the photo album admin page
414
- wppa_echo( '<div class="wrap">' );
 
415
 
416
- // The spinner to indicate busyness
417
- wppa_admin_spinner();
418
 
419
- // Local js functions
420
- {
421
- $the_js = '
422
- function wppaTryInheritCats( id ) {
423
 
424
- var query = "' . esc_js( __( 'Are you sure you want to inherit categories to all (grand)children of this album?', 'wp-photo-album-plus' ) ) . '";
425
- if ( confirm( query ) ) {
426
- wppaAjaxUpdateAlbum( id, \'inherit_cats\', Math.random() );
427
- }
428
  }
 
429
 
430
- function wppaTryAddCats( id ) {
431
 
432
- var query = "' . esc_js( __( 'Are you sure you want to add the categories to all (grand)children of this album?', 'wp-photo-album-plus' ) ) . '";
433
- if ( confirm( query ) ) {
434
- wppaAjaxUpdateAlbum( id, \'inhadd_cats\', Math.random() );
435
- }
436
  }
 
437
 
438
- function wppaTryApplyDeftags( id ) {
439
 
440
- var query = "' . esc_js( __( 'Are you sure you want to set the default tags to all photos in this album?', 'wp-photo-album-plus' ) ) . '";
441
- if ( confirm( query ) ) {
442
- wppaAjaxUpdateAlbum( id, \'set_deftags\', Math.random(), true );
443
- }
444
  }
 
445
 
446
- function wppaTryAddDeftags( id ) {
447
 
448
- var query = "' . esc_js( __( 'Are you sure you want to add the default tags to all photos in this album?', 'wp-photo-album-plus' ) ) . '";
449
- if ( confirm( query ) ) {
450
- wppaAjaxUpdateAlbum( id, \'add_deftags\', Math.random(), true );
451
- }
452
  }
 
453
 
454
- function wppaTryScheduleAll( id ) {
455
 
456
- var query;
457
- if ( ! jQuery( "#schedule-box" ).prop( "checked" ) ) {
458
- query = "' . esc_js( __( 'Please switch feature on and set date/time to schedule first', 'wp-photo-album-plus' ) ) . '";
459
- alert( query );
460
- return;
461
- }
462
- query = "' . esc_js( __( 'Are you sure you want to schedule all photos in this album?', 'wp-photo-album-plus' ) ) . '";
463
- if ( confirm( query ) ) {
464
- wppaAjaxUpdateAlbum( id, \'setallscheduled\', Math.random(), true );
465
- }
466
  }
 
467
 
468
- function wppaTryScheduledelAlb( id ) {
469
 
470
- wppaAjaxUpdateAlbum( id, "scheduledel", Math.random() );
471
- if ( ! jQuery( "#scheduledel" ).prop( "checked" ) ) {
472
- wppaAjaxUpdateAlbum( id, "removescheduledel", 0 );
473
- }
474
  }
 
475
 
476
- function wppaTrySetAllPanorama( id ) {
477
- var panoval = jQuery( "#pano-opt" ).val();
478
- if ( panoval == 0 || panoval == 1 || panoval == 2 ) {
479
- var url = "' . wppa_dbg_url(get_admin_url()) . 'admin.php?page=wppa_admin_menu&tab=edit&edit-id="+id+"&wppa-nonce=' . wp_create_nonce( 'wppa-nonce' ) . '&pano-val="+panoval;
480
- document.location = url;
481
- }
482
- else {
483
- alert("' . __( 'Please select a valid panorama mode', 'wp-photo-album-plus' ) . '");
484
- }
485
- }';
486
-
487
- wppa_add_inline_script( 'wppa-admin', $the_js );
488
  }
 
 
 
 
489
 
490
- // The header
491
- wppa_echo( '<h1 style="display:inline">' . __( wppa_get_album_name( $id ) ) . '</h1>' );
492
 
 
493
 
 
 
494
 
495
- $a = wppa_allow_uploads( $id );
496
- if ( $a ) {
497
- $full = false;
498
- }
499
- else {
500
- $full = true;
501
- }
502
 
503
- // Goto Upload
504
- if ( current_user_can( 'wppa_upload' ) ) {
505
-
506
- $onc = ( $full ?
507
- 'alert(\''.__( 'Change the upload limit or remove photos to enable new uploads.', 'wp-photo-album-plus' ).'\')' :
508
- 'document.location = \''.wppa_dbg_url(get_admin_url()).'/admin.php?page=wppa_upload_photos&wppa-set-album='.$id.'\''
509
- );
510
- $val = ( $full ?
511
- __( 'Album is full', 'wp-photo-album-plus' ) :
512
- __( 'Upload to this album', 'wp-photo-album-plus' ) . ( $a > '0' ? ' ' . sprintf( __( '(max %d)', 'wp-photo-album-plus' ), $a ) : '' )
513
- );
514
- $result = '
515
- <input
516
- type="button"
517
- class="wppa-admin-button button"
518
- onclick="' . $onc . '"
519
- value="' . $val .'"
520
- />';
521
- }
522
 
523
- // Goto Import
524
- if ( current_user_can( 'wppa_import' ) && ! $full ) {
525
 
526
- $onc = 'document.location = \''.wppa_dbg_url(get_admin_url()).'admin.php?page=wppa_import_photos&wppa-set-album='.$id.'\'';
527
- $val = __( 'Import to this album', 'wp-photo-album-plus' ) . ( $a > '0' ? ' ' . sprintf( __( '(max %d)', 'wp-photo-album-plus' ), $a ) : '' );
528
- $result .= '
529
- <input
530
- type="button"
531
- class="wppa-admin-button button"
532
- onclick="' . $onc . '"
533
- value="' . $val .'"
534
- />';
535
- }
536
 
537
- // Download album
538
- if ( wppa_switch( 'allow_download_album' ) && ( ! wppa_switch( 'download_album_is_restricted' ) || wppa_user_is( 'administrator' ) ) ) {
539
 
540
- $result .= '
541
- <input
542
- type="button"
543
- class="wppa-admin-button button"
544
- onclick="wppaAjaxDownloadAlbum( 0, ' . $albuminfo['id'] . ' );"
545
- value="' . esc_attr( __( 'Download album', 'wp-photo-album-plus' ) ).'"
546
- />
547
- <img
548
- id="dwnspin-0-' . $albuminfo['id'] . '"
549
- src="' . wppa_get_imgdir() . 'spinner.gif"
550
- style="margin-left:6px;display:none;height:18px;position:relative;bottom:-6px"
551
- alt="spinner"
552
- />' . $br;
553
- }
554
 
 
 
 
 
 
 
 
 
555
 
 
 
556
 
557
- wppa_echo( $result );
 
558
 
559
- $result = '
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
560
  <details class="wppa-toplevel-details">
561
  <summary class="toplevel wppa-summary-toplevel"> ' .
562
  __( 'the gallery settings', 'wp-photo-album-plus' ) . '
563
- </summary>';
564
 
565
- $result .=
566
- '<p class="description" style="margin:1em">' .
 
567
  __( 'All modifications are instantly updated on the server, except for those that require a button push.', 'wp-photo-album-plus' ) . ' ' .
568
- __( 'After entering/modification of text, click outside the textfield to get it updated.', 'wp-photo-album-plus' ) . ' ' .
569
- '<br>' . __( 'The <b style="color:#070" >Remark</b> fields keep you informed on the actions taken at the background.', 'wp-photo-album-plus' ) . '
570
- </p>
571
- <input
572
- type="hidden"
573
- id="album-nonce-' . $id . '"
574
- value="' . wp_create_nonce( 'wppa-nonce_' . $id ) . '"
575
- />';
576
- wppa_echo( $result );
577
 
578
- // The edit albuminfo panel
579
- $result = '
580
  <div
581
  id="albumitem-' . $id . '"
582
  class="wppa-table-wrap"
583
  style="width:100%;position:relative;"
584
- >';
585
-
586
- // Section 0
587
- $result .= '
588
- <!-- Album Section 0 static data -->';
589
-
590
- // More or less static data
591
- $result .= '<p style="margin:1em">';
592
-
593
- $result .=
594
- __( 'Album number:', 'wp-photo-album-plus' ) . ' ' .
595
- $id . '. ' .
596
-
597
- __( 'Crypt:', 'wp-photo-album-plus' ) . ' ' .
598
- $crypt . '. ' .
599
-
600
- $br .
601
-
602
- __( 'Created:', 'wp-photo-album-plus' ) . ' ' .
603
- wppa_local_date( '', $timestamp ) . ' ' . __( 'local time' , 'wp-photo-album-plus' ) . '. ' .
604
-
605
- $br .
606
-
607
- __( 'Modified:', 'wp-photo-album-plus' ) . ' ';
608
- if ( $modified > $timestamp ) {
609
- $result .= wppa_local_date( '', $modified ) . ' ' . __( 'local time' , 'wp-photo-album-plus' ) . '. ' . $br;
610
- }
611
- else {
612
- $result .= __( 'Not modified', 'wp-photo-album-plus' ) . '. ' . $br;
613
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
614
 
615
  // Views
616
  if ( wppa_switch( 'track_viewcounts' ) ) {
617
- $result .=
618
- __( 'Album Views:', 'wp-photo-album-plus' ) . ' ' . $views . ', ' .
619
- __( 'Photo views:', 'wp-photo-album-plus' ) . ' ' . $pviews . '. ';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
620
  if ( $nsub ) {
621
- $result .=
622
- __( 'Photo views inc subalbums:', 'wp-photo-album-plus' ) . ' ' . $tpviews . '. ' . $br;
 
 
 
 
 
 
 
623
  }
624
  }
625
 
626
  // Clicks
627
  if ( wppa_switch( 'track_clickcounts' ) ) {
628
  $click_arr = $wpdb->get_col( "SELECT clicks FROM $wpdb->wppa_photos WHERE album = $id" );
629
- $result .=
630
- __( 'Clicks:', 'wp-photo-album-plus' ) . ' ' . array_sum( $click_arr ) . '. ' . $br;
 
 
 
 
 
 
 
631
  }
632
 
633
- $result .= '</P>';
634
-
635
- $result .= '
636
- <!-- Album Section 1 simple settings -->';
637
 
638
- $result .= '<div style="display: flex; flex-flow: row wrap; align-items: flex-start; align-content: space-between; padding: 10px;">';
 
 
 
 
639
 
640
  // Owner
641
  {
642
- $result .= '
643
- <div style="max-width: 200px;margin-right: 4px;">
644
  <label
645
- for="albumowner"
646
- style="font-size:0.8em;font-weight: 600;margin-bottom: 10px;">' .
647
  __( 'Owned by:', 'wp-photo-album-plus' ) . '
648
  </label><br>';
649
 
@@ -689,16 +756,16 @@ global $wppa_revno;
689
  }
690
  }
691
  $result .= '
692
- </div>' . $br;
 
693
  }
694
 
695
  // Order # -->
696
  {
697
- $result .= '
698
- <div style="max-width: 200px;margin-right: 4px;">
699
  <label
700
- for="albumseqno"
701
- style="font-size:0.8em;font-weight: 600;margin-bottom: 10px;">' .
702
  __( 'Sequence number', 'wp-photo-album-plus' ) . '
703
  </label><br>
704
  <input
@@ -708,9 +775,8 @@ global $wppa_revno;
708
  onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'a_order\', this )"
709
  value="' . esc_attr( $a_order ) . '"' .
710
  ( wppa_opt( 'list_albums_by' ) != '1' && $a_order != '0' ? ' title="' . esc_attr( __( 'Album sequence number has only effect if you set the album sort order method to Order # in the Photo Albums -> Settings screen.', 'wp-photo-album-plus' )) . '"' : '' ) . '
711
- />&nbsp;';
712
- $result .= '
713
- </div>' . $br;
714
  }
715
 
716
  // Status
@@ -718,11 +784,10 @@ global $wppa_revno;
718
  $title = __( 'Set the frontend visibility of the album cover and items not including subalbums.', 'wp-photo-album-plus' ) . ' ' .
719
  __( 'Publish: visible for all, Private: visible for logged in only, Hidden: visible for admin only', 'wp-photo-album-plus' );
720
 
721
- $result .= '
722
- <div style="max-width: 200px;margin-right: 4px;">
723
  <label
724
- for="albumstatus"
725
- style="font-size:0.8em;font-weight: 600;margin-bottom: 10px;">' .
726
  __( 'Status', 'wp-photo-album-plus' ) . '
727
  </label><br>
728
  <select
@@ -740,16 +805,15 @@ global $wppa_revno;
740
  __( 'Hidden', 'wp-photo-album-plus' ) . '
741
  </option>
742
  </select>
743
- </div>' . $br;
744
  }
745
 
746
  // Parent
747
  {
748
- $result .= '
749
- <div style="max-width: 200px;margin-right: 4px;">
750
  <label
751
- for="wppa-parsel"
752
- style="font-size:0.8em;font-weight: 600;margin-bottom: 10px;">' .
753
  __( 'Parent album', 'wp-photo-album-plus' ) . '
754
  </label><br>';
755
  if ( wppa_extended_access() ) {
@@ -795,18 +859,17 @@ global $wppa_revno;
795
  '</select>';
796
  }
797
  $result .= '
798
- </div>' . $br;
 
799
  }
800
 
801
  // P-order-by
802
- {
803
  if ( ! wppa_switch( 'porder_restricted' ) || wppa_user_is( 'administrator' ) ) {
804
- $result .= '
805
  <div
806
  style="max-width: 200px;margin-right: 4px;">
807
  <label
808
  for="photo-order"
809
- style="font-size:0.8em;font-weight: 600;margin-bottom: 10px;"
810
  >' .
811
 
812
  __( 'Photo order:', 'wp-photo-album-plus' ) . '
@@ -866,7 +929,7 @@ global $wppa_revno;
866
  $result .= '
867
  </select>
868
  </div>';
869
- }
870
  }
871
 
872
  // Subalbum order
@@ -894,12 +957,10 @@ global $wppa_revno;
894
 
895
  $title = sprintf( __( 'The default is set in %s and is currently set to %s', 'wp-photo-album-plus' ), wppa_setting_path( 'b', 'misc', 1, 1 ), $dflt );
896
 
897
- $result .= '
898
- <div
899
- style="max-width: 200px;margin-right: 4px;">
900
  <label
901
- for="subalbumorder"
902
- style="font-size:0.8em;font-weight: 600;margin-bottom: 10px;">' .
903
  __( 'Subalbum sort order', 'wp-photo-album-plus' ) . '
904
  </label><br>
905
  <select
@@ -913,21 +974,20 @@ global $wppa_revno;
913
  }
914
  $result .= '
915
  </select>
916
- </div>' . $br;
 
917
  }
918
 
919
  // Alternative thumbnail size
920
- {
921
  if ( ! wppa_switch( 'alt_is_restricted' ) || wppa_user_is( 'administrator' ) ) {
922
  $title = sprintf( __( 'The alternate thumbnail size is set in %s and is currently set to %s', 'wp-photo-album-plus' ), wppa_setting_path( 'b', 'thumbs', 1, 2 ), wppa_opt( 'thumbsize_alt' ) );
923
 
924
  $sel = ' selected';
925
- $result .= '
926
  <div
927
  style="max-width: 200px;margin-right: 4px;">
928
  <label
929
- for="altthumb"
930
- style="font-size:0.8em;font-weight: 600;margin-bottom: 10px;">' .
931
  __( 'Use alt thumbsize', 'wp-photo-album-plus' ) . '
932
  </label><br>
933
  <select
@@ -942,75 +1002,69 @@ global $wppa_revno;
942
  __( 'yes', 'wp-photo-album-plus' ) . '
943
  </option>
944
  </select>
945
- </div>' . $br;
946
- }
947
  }
948
 
949
  // Cover type
950
- {
951
  if ( ! wppa_switch( 'covertype_is_restricted' ) || wppa_user_is( 'administrator' ) ) {
952
  $sel = ' selected';
953
  $title = sprintf( __( 'The default is set in %s and is currently set to %s', 'wp-photo-album-plus' ), wppa_setting_path( 'b', 'covers', 3, 4 ), wppa_opt( 'cover_type' ) );
954
 
955
- $result .= '<div
956
- style="max-width: 200px;margin-right: 4px;">
957
- <label
958
- for="covertype"
959
- style="font-size:0.8em;font-weight: 600;margin-bottom: 10px;">' .
960
- __( 'Cover&nbsp;Type', 'wp-photo-album-plus' ) . '
961
- </label><br>
962
- <select
963
- id="covertype"
964
- style="max-width:200px;"
965
- onchange="wppaAjaxUpdateAlbum( '. $id . ', \'cover_type\', this )"
966
- title="' . esc_attr( $title ) . '"
967
- >
968
- <option value=""' . ( $cover_type == '' ? $sel : '' ) . ' >' .
969
- __( '--- default ---', 'wp-photo-album-plus' ) . '
970
- </option>
971
- <option value="default"' . ( $cover_type == 'default' ? $sel : '' ) . ' >' .
972
- __( 'Standard', 'wp-photo-album-plus' ) . '
973
- </option>
974
- <option value="longdesc"' . ( $cover_type == 'longdesc' ? $sel : '' ) . ' >' .
975
- __( 'Long Descriptions', 'wp-photo-album-plus' ) . '
976
- </option>
977
- <option value="imagefactory"' . ( $cover_type == 'imagefactory' ? $sel : '' ) . ' >' .
978
- __( 'Image Factory', 'wp-photo-album-plus' ) . '
979
- </option>
980
- <option value="default-mcr"' . ( $cover_type == 'default-mcr' ? $sel : '' ) . ' >' .
981
- __( 'Standard mcr', 'wp-photo-album-plus' ) . '
982
- </option>
983
- <option value="longdesc-mcr"' . ( $cover_type == 'longdesc-mcr' ? $sel : '' ) . ' >' .
984
- __( 'Long Descriptions mcr', 'wp-photo-album-plus' ) . '
985
- </option>
986
- <option value="imagefactory-mcr"' . ( $cover_type == 'imagefactory-mcr' ? $sel : '' ) . ' >' .
987
- __( 'Image Factory mcr', 'wp-photo-album-plus' ) . '
988
- </option>
989
- </select></div>';
990
- }
991
  }
992
 
993
  // Cover photo
994
  {
995
- $result .= '
996
- <div
997
- style="max-width: 200px;margin-right: 4px;">
998
- <label
999
- style="font-size:0.8em;font-weight: 600;margin-bottom: 10px;">' .
1000
  __( 'Cover&nbsp;Photo:', 'wp-photo-album-plus' ) . '
1001
  </label><br>' .
1002
  wppa_main_photo( $main_photo, $cover_type ) . '
1003
- </div>' . $br;
1004
  }
1005
 
1006
  // Upload limit
1007
  {
1008
- $result .= '
1009
- <div
1010
- style="max-width: 200px;margin-right: 4px;">
1011
  <label
1012
- for="upload_limit_count"
1013
- style="font-size:0.8em;font-weight: 600;margin-bottom: 10px;">' .
1014
  __( 'Upload limit:', 'wp-photo-album-plus' ) . '
1015
  </label><br>';
1016
  $lims = explode( '/', $upload_limit );
@@ -1025,7 +1079,7 @@ global $wppa_revno;
1025
  type="text"
1026
  id="upload_limit_count"
1027
  value="' . $lims[0] . '"
1028
- style="max-width:50px;"
1029
  title="' . esc_attr( $title ) . '"
1030
  onchange="wppaRefreshAfter(); wppaAjaxUpdateAlbum( ' . $id . ', \'upload_limit_count\', this )"
1031
  />
@@ -1058,7 +1112,8 @@ global $wppa_revno;
1058
  $result .= '. ';
1059
  }
1060
  $result .= '
1061
- </div>' . $br;
 
1062
  }
1063
 
1064
  // Tree limit
@@ -1066,24 +1121,21 @@ global $wppa_revno;
1066
  $title = __( 'The upload limit for this album and all its (grand)children.', 'wp-photo-album-plus' ) . ' ' .
1067
  __( 'This setting overrules all other limits that may apply to this album or its (grand)children.', 'wp-photo-album-plus' ) . ' ' .
1068
  __( '0 means no limit.', 'wp-photo-album-plus' );
1069
- $result .= '
1070
- <div
1071
- style="max-width: 200px;margin-right: 4px;">
1072
  <label
1073
- for="uploadlimittree"
1074
- style="font-size:0.8em;font-weight: 600;margin-bottom: 10px;">' .
1075
  __( 'Tree upload limit', 'wp-photo-album-plus' ) . '
1076
  </label><br>
1077
- <input
1078
- type="number"
1079
- id="uploadlimittree"
1080
- min="0"
1081
- title="' . esc_attr( $title ) . '"
1082
- value="' . $tree_limit . '"
1083
- onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'upload_limit_tree\', this )"
1084
- style="cursor:pointer"/>' .
1085
-
1086
- '</div>' . $br;
1087
  }
1088
 
1089
  // Need this the next 5 items
@@ -1096,12 +1148,10 @@ global $wppa_revno;
1096
  $title = __( 'When set other than default, this setting will overrule the default settings.', 'wp-photo-album-plus' ) . ' ' .
1097
  sprintf( __( 'The default is set in %s and is currently %s', 'wp-photo-album-plus' ), wppa_setting_path( 'b', 'photos', 1, 4 ), ( wppa_switch( 'zoom_on' ) ? $yes : $no ) );
1098
 
1099
- $result .= '
1100
- <div
1101
- style="max-width: 200px;margin-right: 4px;">
1102
  <label
1103
- for="zoomable"
1104
- style="font-size:0.8em;font-weight: 600;margin-bottom: 10px;">' .
1105
  __( 'Photos are zoomable:', 'wp-photo-album-plus' ) . '
1106
  </label><br>
1107
  <select
@@ -1112,7 +1162,7 @@ global $wppa_revno;
1112
  <option value="on"'.($zoomable=='on'?' selected': '').'>' . $yes . '</option>
1113
  <option value="off"'.($zoomable=='off'?' selected': '').'>' . $no . '</option>
1114
  </select>
1115
- </div>' . $br;
1116
  }
1117
 
1118
  // Overrulable display options / next 4 items
@@ -1135,12 +1185,10 @@ global $wppa_revno;
1135
  wppa_setting_path( 'b', 'thumbs', 2, 1, wppa_switch( 'thumb_text_name' ) ? $yes : $no ) . ' ' . __( 'and' , 'wp-photo-album-plus' ) . '&#013;' .
1136
  wppa_setting_path( 'b', 'lightbox', 1, 3, wppa_switch( 'ovl_name' ) ? $yes : $no ) . '.';
1137
 
1138
- $result .= '
1139
- <div
1140
- style="max-width: 200px;margin-right: 4px;">
1141
  <label
1142
- for="showname"
1143
- style="font-size:0.8em;font-weight: 600;margin-bottom: 10px;">' .
1144
  __( 'Show names:', 'wp-photo-album-plus' ) . '
1145
  </label><br>
1146
  <select
@@ -1151,7 +1199,7 @@ global $wppa_revno;
1151
  <option value="1"'.($disp_opt[0]=='1'?' selected': '').'>' . $yes . '</option>
1152
  <option value="-1"'.($disp_opt[0]=='-1'?' selected': '').'>' . $no . '</option>
1153
  </select>
1154
- </div>' . $br;
1155
  }
1156
 
1157
  // Display description
@@ -1161,12 +1209,10 @@ global $wppa_revno;
1161
  wppa_setting_path( 'b', 'thumbs', 2, 3, wppa_switch( 'thumb_text_desc' ) ? $yes : $no ) . ' ' . __( 'and' , 'wp-photo-album-plus' ) . '&#013;' .
1162
  wppa_setting_path( 'b', 'lightbox', 1, 4, wppa_switch( 'ovl_desc' ) ? $yes : $no ) . '.';
1163
 
1164
- $result .= '
1165
- <div
1166
- style="max-width: 200px;margin-right: 4px;">
1167
  <label
1168
- for="showdesc"
1169
- style="font-size:0.8em;font-weight: 600;margin-bottom: 10px;">' .
1170
  __( 'Show descriptions:', 'wp-photo-album-plus' ) . '
1171
  </label><br>
1172
  <select
@@ -1177,7 +1223,7 @@ global $wppa_revno;
1177
  <option value="1"'.($disp_opt[1]=='1'?' selected': '').'>' . $yes . '</option>
1178
  <option value="-1"'.($disp_opt[1]=='-1'?' selected': '').'>' . $no . '</option>
1179
  </select>
1180
- </div>' . $br;
1181
  }
1182
 
1183
  // Display rating
@@ -1187,12 +1233,10 @@ global $wppa_revno;
1187
  wppa_setting_path( 'b', 'thumbs', 2, 3, wppa_switch( 'thumb_text_rating' ) ? $yes : $no ) . ' ' . __( 'and' , 'wp-photo-album-plus' ) . '&#013;' .
1188
  wppa_setting_path( 'b', 'lightbox', 1, 5, wppa_switch( 'ovl_rating' ) ? $yes : $no ) . '.';
1189
 
1190
- $result .= '
1191
- <div
1192
- style="max-width: 200px;margin-right: 4px;">
1193
  <label
1194
- for="showrating"
1195
- style="font-size:0.8em;font-weight: 600;margin-bottom: 10px;">' .
1196
  __( 'Show rating:', 'wp-photo-album-plus' ) . '
1197
  </label><br>
1198
  <select
@@ -1203,7 +1247,7 @@ global $wppa_revno;
1203
  <option value="1"'.($disp_opt[2]=='1'?' selected': '').'>' . $yes . '</option>
1204
  <option value="-1"'.($disp_opt[2]=='-1'?' selected': '').'>' . $no . '</option>
1205
  </select>
1206
- </div>' . $br;
1207
  }
1208
 
1209
  // Display comments
@@ -1212,12 +1256,10 @@ global $wppa_revno;
1212
  wppa_setting_path( 'b', 'general', 1, 4, wppa_switch( 'show_comments' ) ? $yes : $no ) . ' ' . __( 'and' , 'wp-photo-album-plus' ) . '&#013;' .
1213
  wppa_setting_path( 'b', 'thumbs', 2, 4, wppa_switch( 'thumb_text_comcount' ) ? $yes : $no ) . '.';
1214
 
1215
- $result .= '
1216
- <div
1217
- style="max-width: 200px;margin-right: 4px;">
1218
  <label
1219
- for="showcomments"
1220
- style="font-size:0.8em;font-weight: 600;margin-bottom: 10px;">' .
1221
  __( 'Show comments:', 'wp-photo-album-plus' ) . '
1222
  </label><br>
1223
  <select
@@ -1228,19 +1270,18 @@ global $wppa_revno;
1228
  <option value="1"'.($disp_opt[3]=='1'?' selected': '').'>' . $yes . '</option>
1229
  <option value="-1"'.($disp_opt[3]=='-1'?' selected': '').'>' . $no . '</option>
1230
  </select>
1231
- </div>' . $br;
1232
  }
1233
 
1234
  // Watermark
1235
  {
1236
  if ( wppa_switch( 'watermark_on' ) ) {
1237
 
1238
- $result .= '
1239
  <div
1240
  style="max-width: 200px;margin-right: 4px;">
1241
  <label
1242
- for="watermarkfile"
1243
- style="font-size:0.8em;font-weight: 600;margin-bottom: 10px;">' .
1244
  __( 'Watermark file:', 'wp-photo-album-plus' ) . '
1245
  </label><br>
1246
  <select
@@ -1249,12 +1290,11 @@ global $wppa_revno;
1249
  onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'wmfile\', this )" >' .
1250
  wppa_watermark_file_select( 'album', $id ) . '
1251
  </select>
1252
- </div>' . $br . '
1253
  <div
1254
  style="max-width: 200px;margin-right: 4px;">
1255
  <label
1256
- for="watermarkpos"
1257
- style="font-size:0.8em;font-weight: 600;margin-bottom: 10px;">' .
1258
  __( 'Watermark pos:', 'wp-photo-album-plus' ) . '
1259
  </label><br>
1260
  <select
@@ -1263,7 +1303,7 @@ global $wppa_revno;
1263
  onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'wmpos\', this )" >' .
1264
  wppa_watermark_pos_select( 'album', $id ) . '
1265
  </select>
1266
- </div>' . $br;
1267
  }
1268
  }
1269
 
@@ -1272,12 +1312,11 @@ global $wppa_revno;
1272
  if ( wppa_user_is( 'administrator' ) || $owner == wppa_get_user() ) {
1273
  $may_change = wppa_user_is( 'administrator' ) || current_user_can( 'wppa_moderate' );
1274
 
1275
- $result .= '
1276
  <div
1277
  style="max-width: 500px;margin-right: 4px;">
1278
  <label
1279
- for="scheduledel"
1280
- style="font-size:0.8em;font-weight: 600;margin-bottom: 10px;">' .
1281
  __( 'Delete at', 'wp-photo-album-plus' ) . '
1282
  </label><br>
1283
  <input
@@ -1294,38 +1333,36 @@ global $wppa_revno;
1294
  >' .
1295
  wppa_get_date_time_select_html( 'delalbum', $id, $may_change ) . '
1296
  </span>
1297
- </div>' . $br;
1298
  }
1299
  }
1300
 
1301
- $result .= '</div><div>';
1302
 
1303
- // Status
1304
- {
1305
- $result .= '<h3 style="margin-left:1em">' .
 
 
 
1306
  esc_html__( 'Remark', 'wp-photo-album-plus' ) . ':&nbsp;
1307
  <span
1308
  id="albumstatus-' . $id . '"
1309
  style="font-weight:bold;color:#00AA00">' .
1310
  esc_html( $remark ) . '
1311
- </span></h3>';
1312
- }
1313
-
1314
-
1315
 
 
 
 
 
 
 
1316
 
1317
-
1318
- wppa_echo( $result );
1319
-
1320
-
1321
-
1322
-
1323
- // Section 2
1324
- $result = '
1325
- <!-- Album Section 2 -->
1326
- <table class="wppa-table wppa-album-table" >
1327
- <tbody>
1328
-
1329
  <tr>
1330
  <td>' .
1331
  __( 'Name:', 'wp-photo-album-plus' ) . '
@@ -1346,17 +1383,21 @@ global $wppa_revno;
1346
  </td>
1347
  <td>
1348
  </td>
1349
- </tr>
 
1350
 
 
 
 
1351
  <tr>
1352
  <td>' .
1353
  __( 'Description:', 'wp-photo-album-plus' ) . '
1354
- </td>';
1355
- wppa_echo( $result );
 
 
 
1356
 
1357
- // WP Editor
1358
- if ( wppa_switch( 'use_wp_editor') ) {
1359
- wppa_echo( '<td>' );
1360
 
1361
  // Echos itsself, has no return option
1362
  wp_editor( $description,
@@ -1368,7 +1409,7 @@ global $wppa_revno;
1368
  )
1369
  );
1370
 
1371
- $result = '
1372
  <input
1373
  type="button"
1374
  class="button button-secundary"
@@ -1380,27 +1421,30 @@ global $wppa_revno;
1380
  src="' . wppa_get_imgdir() . 'spinner.gif"
1381
  alt="Spin"
1382
  style="visibility:hidden"
1383
- />
1384
- </td>';
1385
- }
1386
 
1387
- // Textarea
1388
- else {
1389
- $result = '
1390
- <td>
1391
  <textarea
1392
  style="width:100%;height:60px;"
1393
  onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'description\', this )"
1394
  >' .
1395
  esc_textarea( stripslashes( $description ) ) . '
1396
- </textarea>
1397
- </td>';
1398
- }
1399
- $result .= '
 
1400
  <td>
1401
  </td>
1402
- </tr>
 
1403
 
 
 
 
1404
  <tr>
1405
  <td>' .
1406
  __( 'Categories:', 'wp-photo-album-plus' ) . '
@@ -1438,8 +1482,13 @@ global $wppa_revno;
1438
  </td>
1439
  <td>
1440
  </td>
1441
- </tr>
 
 
1442
 
 
 
 
1443
  <tr>
1444
  <td>
1445
  ' . __( 'Default photo tags:', 'wp-photo-album-plus' ) . '
@@ -1459,10 +1508,12 @@ global $wppa_revno;
1459
  </td>
1460
  <td>
1461
  </td>
1462
- </tr>';
 
1463
 
1464
  // Custom
1465
  if ( wppa_switch( 'album_custom_fields' ) ) {
 
1466
  $custom = wppa_get_album_item( $edit_id, 'custom' );
1467
  if ( $custom ) {
1468
  $custom_data = wppa_unserialize( $custom );
@@ -1497,10 +1548,12 @@ global $wppa_revno;
1497
  </tr>';
1498
  }
1499
  }
 
1500
  }
1501
 
1502
  // Link type
1503
- $result .= '
 
1504
  <tr>
1505
  <td>
1506
  ' . __( 'Link type:', 'wp-photo-album-plus' ) . '
@@ -1532,10 +1585,12 @@ global $wppa_revno;
1532
  <td>
1533
  </td>
1534
  </tr>';
 
 
1535
 
1536
  // Manually entered link
1537
  if ( ! wppa_switch( 'link_is_restricted' ) || wppa_user_is( 'administrator' ) ) {
1538
- $result .= '
1539
  <tr
1540
  id="link-url-tr"
1541
  style="' . ( $cover_linktype == 'manual' ? '' : 'display:none' ) . '"
@@ -1559,11 +1614,12 @@ global $wppa_revno;
1559
  <td>
1560
  </td>
1561
  </tr>';
 
1562
  }
1563
 
1564
  // Link page
1565
  if ( ! wppa_switch( 'link_is_restricted' ) || wppa_user_is( 'administrator' ) ) {
1566
- $result .= '
1567
  <tr>
1568
  <td>
1569
  ' . __( 'Link to:', 'wp-photo-album-plus' ) . '
@@ -1612,10 +1668,12 @@ global $wppa_revno;
1612
  <td>
1613
  </td>
1614
  </tr>';
 
1615
  }
1616
 
1617
  // Schedule
1618
- $result .= '
 
1619
  <tr>
1620
  <td>' .
1621
  __( 'Schedule:', 'wp-photo-album-plus' ) . ' ' .
@@ -1642,257 +1700,247 @@ global $wppa_revno;
1642
  <td>
1643
  </td>
1644
  </tr>';
 
 
1645
 
1646
- $result .= '
1647
- </tbody>
1648
- </table>';
1649
-
 
1650
 
1651
- wppa_echo( $result );
 
1652
 
1653
- // Section 3, Actions
1654
- $result = '
1655
- <!-- Album Section 3 -->
1656
- <table
1657
- class="wppa-table wppa-album-table"
1658
- >
1659
- <tbody>
1660
- <tr>
1661
- <td>';
1662
 
 
 
1663
 
1664
 
 
 
 
 
 
 
 
 
1665
 
 
 
 
 
 
1666
 
 
 
 
 
1667
 
 
 
 
 
 
 
 
 
1668
 
 
 
 
 
 
 
 
 
 
 
 
 
1669
 
 
 
 
 
 
 
 
 
1670
 
1671
- $result .= '
1672
- </td>
1673
- </tr>
1674
- </tbody>
1675
- </table>';
 
 
 
 
 
 
 
1676
 
1677
- $result .= '</details>'; //<div>';
1678
- wppa_echo( $result );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1679
 
 
 
 
 
1680
 
 
 
 
 
1681
 
1682
 
1683
- wppa_echo( '
 
 
1684
  <details class="wppa-toplevel-details">
1685
- <summary class="toplevel wppa-summary-toplevel"> '.
1686
- __( 'related album options', 'wp-photo-album-plus' ) . '
1687
  </summary>
1688
  <div class="wppa-table-wrap">' );
1689
 
1690
- wppa_echo( '<p style="margin:1em">' . __( 'The following buttons perform actions on albums related to this album', 'wp-photo-album-plus' ) . '</p>' );
1691
-
1692
- // Create subalbum
1693
- if ( wppa_can_create_album() ) {
1694
- $url = get_admin_url() . 'admin.php?page=wppa_admin_menu&amp;tab=edit&amp;edit-id=new&amp;parent_id=' . $albuminfo['id'] . '&amp;wppa-nonce=' . wp_create_nonce( 'wppa-nonce' );
1695
- $onc = 'if (confirm(\''.__( 'Are you sure you want to create a subalbum?', 'wp-photo-album-plus' ).'\')) document.location=\''.$url.'\';';
1696
-
1697
- $result = '
1698
- <input
1699
- type="button"
1700
- class="wppa-admin-button button"
1701
- onclick="' . $onc . '"
1702
- value="' . esc_attr( __( 'Create child', 'wp-photo-album-plus' ) ) . '"
1703
- />';
1704
- }
1705
-
1706
- // Create sibling
1707
- if ( $albuminfo['a_parent'] > '0' && wppa_can_create_album() ||
1708
- $albuminfo['a_parent'] < '1' && wppa_can_create_top_album() ) {
1709
- $url = wppa_dbg_url( get_admin_url() .
1710
- 'admin.php' .
1711
- '?page=wppa_admin_menu' .
1712
- '&amp;tab=edit' .
1713
- '&amp;edit-id=new' .
1714
- '&amp;parent_id=' . $albuminfo['a_parent'] .
1715
- '&amp;is-sibling-of=' . $albuminfo['id'] .
1716
- '&amp;wppa-nonce=' . wp_create_nonce( 'wppa-nonce' ) );
1717
- $onc = 'if (confirm(\''.__( 'Are you sure you want to create a subalbum?', 'wp-photo-album-plus' ).'\')) document.location=\''.$url.'\';';
1718
 
1719
- $result .= '
 
1720
  <input
1721
  type="button"
1722
  class="wppa-admin-button button"
1723
- onclick="' . $onc . '"
1724
- value="' . esc_attr( __( 'Create sibling', 'wp-photo-album-plus' ) ) . '"
1725
- />';
1726
- }
1727
-
1728
- // Edit parent
1729
- if ( $albuminfo['a_parent'] > '0' && wppa_album_exists( $albuminfo['a_parent'] ) && wppa_have_access( $albuminfo['a_parent'] ) ) {
1730
- $url = wppa_dbg_url( get_admin_url() . 'admin.php?page=wppa_admin_menu&amp;tab=edit&amp;edit-id=' . $albuminfo['a_parent'] . '&amp;wppa-nonce=' . wp_create_nonce( 'wppa-nonce' ) );
1731
- $onc = 'document.location=\''.$url.'\';';
1732
- $result .= '
1733
  <input
1734
  type="button"
1735
  class="wppa-admin-button button"
1736
- onclick="' . $onc . '"
1737
- value="' . esc_attr( __( 'Edit parent', 'wp-photo-album-plus' ) ) . '"
1738
- />' . $br;
1739
- }
1740
 
1741
- // Inherit cats
1742
- $has_children = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $wpdb->wppa_albums WHERE a_parent = %d", $id ) );
1743
- if ( $has_children ) {
1744
- $result .= '
1745
  <input
1746
  type="button"
1747
  class="wppa-admin-button button"
1748
- title="' . esc_attr( __( 'Apply categories to all (grand)children.', 'wp-photo-album-plus' ) ) . '"
1749
- onclick="wppaTryInheritCats( ' . $id . ' )"
1750
- value="' . esc_attr( __( 'Apply Cats to subalbums', 'wp-photo-album-plus' ) ) . '"
1751
- />' . $br . '
1752
- <input
1753
- type="button"
1754
- class="wppa-admin-button button"
1755
- title="' . esc_attr( __( 'Add categories to all (grand)children.', 'wp-photo-album-plus' ) ) . '"
1756
- onclick="wppaTryAddCats( ' . $id . ' )"
1757
- value="' . esc_attr( __( 'Add Cats to subalbums', 'wp-photo-album-plus' ) ) . '"
1758
- />' . $br;
1759
- }
1760
-
1761
- wppa_echo( $result );
1762
-
1763
- // Subalbums sequence
1764
- if ( $has_children ) {
1765
- wppa_album_sequence( $edit_id );
1766
- }
1767
-
1768
- wppa_echo( '</div></details>' );
1769
-
1770
- wppa_echo( '
1771
- <details class="wppa-toplevel-details">
1772
- <summary class="toplevel wppa-summary-toplevel">
1773
- all item actions
1774
- </summary>
1775
- <div class="wppa-table-wrap">' );
1776
-
1777
- wppa_echo( '<p style="margin:1em">' . __( 'The following buttons perform actions onto all items in this album', 'wp-photo-album-plus' ) . '</p>' );
1778
-
1779
-
1780
- // Apply default tags
1781
- $result = '
1782
- <input
1783
- type="button"
1784
- class="wppa-admin-button button"
1785
- title="' . esc_attr( __( 'Tag all photos in this album with the default tags.', 'wp-photo-album-plus' ) ) . '"
1786
- onclick="wppaTryApplyDeftags( ' . $id . ' )"
1787
- value="' . esc_attr( __( 'Apply default tags', 'wp-photo-album-plus' ) ) . '"
1788
- />' . $br . '
1789
- <input
1790
- type="button"
1791
- class="wppa-admin-button button"
1792
- title="' . esc_attr( __( 'Add the default tags to all photos in this album.', 'wp-photo-album-plus' ) ) . '"
1793
- onclick="wppaTryAddDeftags( ' . $id . ' )"
1794
- value="' . esc_attr( __( 'Add default tags', 'wp-photo-album-plus' ) ) . '"
1795
- />' . $br;
1796
-
1797
- // Schedule all
1798
- $result .= '
1799
- <input
1800
- type="button"
1801
- class="wppa-admin-button button"
1802
- title="' . esc_attr( __( 'Schedule all photos in this album for later publishing.', 'wp-photo-album-plus' ) ) . '"
1803
- onclick="wppaTryScheduleAll( ' . $id . ' )"
1804
- value="' . esc_attr( __( 'Schedule all', 'wp-photo-album-plus' ) ) . '"
1805
- />' . $br;
1806
-
1807
- // Reset Ratings
1808
- if ( wppa_switch( 'rating_on') ) {
1809
- $onc = 'if (confirm(\''.__( 'Are you sure you want to clear the ratings in this album?', 'wp-photo-album-plus' ).'\')) { wppaRefreshAfter(); wppaAjaxUpdateAlbum( ' . $id . ', \'clear_ratings\', 0 ); }';
1810
- $result .= '
1811
- <input
1812
- type="button"
1813
- class="wppa-admin-button button"
1814
- onclick="' . $onc . '"
1815
- value="' . esc_attr( __( 'Reset ratings', 'wp-photo-album-plus' ) ) . '"
1816
- />' . $br;
1817
- }
1818
-
1819
- // Apply New photo desc
1820
- if ( wppa_switch( 'apply_newphoto_desc') ) {
1821
- $onc = 'if ( confirm(\'Are you sure you want to set the description of all photos to \n\n'.esc_js(wppa_opt( 'newphoto_description')).'\')) document.location=\''.wppa_ea_url($albuminfo['id'], 'edit').'&applynewdesc=1\'';
1822
- $result .= '
1823
- <input
1824
- type="button"
1825
- class="wppa-admin-button button"
1826
- onclick="' . $onc . '"
1827
- value="' . esc_attr( __( 'Apply new photo desc', 'wp-photo-album-plus' ) ) . '"
1828
- />' . $br;
1829
- }
1830
-
1831
- // Remake all
1832
- if ( wppa_user_is( 'administrator' ) ) {
1833
- $onc = 'if ( confirm(\'Are you sure you want to remake the files for all photos in this album?\')) document.location=\''.wppa_ea_url($albuminfo['id'], 'edit').'&remakealbum=1\'';
1834
- $result .= '
1835
- <input
1836
- type="button"
1837
- class="wppa-admin-button button"
1838
- onclick="' . $onc . '"
1839
- value="' . esc_attr( __( 'Remake all', 'wp-photo-album-plus' ) ) . '"
1840
- />' . $br;
1841
- }
1842
-
1843
-
1844
- // Set all to pano
1845
- if ( wppa_switch( 'enable_panorama' ) ) {
1846
-
1847
- $result .= '
1848
- <input
1849
- type="button"
1850
- class="wppa-admin-button button"
1851
- onclick="wppaTrySetAllPanorama(' . $albuminfo['id'] . ')"
1852
- value="' . esc_attr( __( 'Set all to panorama', 'wp-photo-album-plus' ) ).':"
1853
- />
1854
-
1855
- <select id="pano-opt"
1856
- style="margin-top:6px;">
1857
- <option value="9" disabled selected>' . __( 'Select a mode', 'wp-photo-album-plus' ) . '</option>
1858
- <option value="0">' . __( '- none -', 'wp-photo-album-plus' ) . '</option>
1859
- <option value="1">' . __( '360&deg; Spheric', 'wp-photo-album-plus' ) . '</option>
1860
- <option value="2">' . __( 'Non 360&deg; Flat', 'wp-photo-album-plus' ) . '</option>
1861
- </select>' . $br;
1862
- }
1863
-
1864
- wppa_echo( $result );
1865
 
 
 
 
 
 
 
 
 
 
 
 
1866
 
1867
- wppa_echo( '</div></details>' );
 
 
 
 
 
 
 
 
 
 
1868
 
 
 
1869
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1870
 
 
 
 
 
1871
 
1872
- // Manage photos section
 
 
1873
 
1874
- wppa_echo( '
1875
- <details class="wppa-toplevel-details">
1876
- <summary class="toplevel wppa-summary-toplevel"> ' .
1877
- __( 'the photo details', 'wp-photo-album-plus' ) . '
1878
- </summary>
1879
- <div class="wppa-table-wrap">' );
1880
- /*
1881
- wppa_echo( '<h3>' );
1882
-
1883
- if ( wppa_get( 'bulk' ) )
1884
- $result = __( 'Copy / move / delete / edit name / edit description / change status', 'wp-photo-album-plus' );
1885
- elseif ( wppa_get( 'seq' ) )
1886
- $result = __( 'Change sequence order by drag and drop', 'wp-photo-album-plus' );
1887
- elseif ( wppa_get( 'quick' ) )
1888
- $result = __( 'Edit photo information except copy and move', 'wp-photo-album-plus' );
1889
- else
1890
- $result = __( 'Edit photo information', 'wp-photo-album-plus' );
1891
- $result .= '
 
1892
 
1893
- </h3><div style="clear:both"></div>';
1894
- // wppa_echo( $result );
1895
- */
 
1896
 
1897
  if ( wppa_get( 'bulk' ) )
1898
  wppa_album_photos_bulk( $edit_id );
@@ -1901,9 +1949,13 @@ wppa_echo( '<p style="margin:1em">' . __( 'The following buttons perform actions
1901
  else
1902
  wppa_album_photos( $edit_id );
1903
 
1904
- wppa_echo( '</div></details>' );
 
 
 
1905
 
1906
- $result = '
 
1907
  <br>
1908
  <a href="' . $back_url . '" >' .
1909
  $back_title .
@@ -1912,9 +1964,8 @@ wppa_echo( '<p style="margin:1em">' . __( 'The following buttons perform actions
1912
  <a href="#manage-photos">
1913
  <div style="position:fixed;right:30px;bottom:30px;background-color:lightblue;float:right" >&nbsp;' . __( 'Top of page', 'wp-photo-album-plus' ) . '&nbsp;</div>
1914
  </a>
1915
- </div>';
1916
- wppa_echo( $result );
1917
- }
1918
 
1919
  // Comment moderate
1920
  elseif ( wppa_get( 'tab' ) == 'cmod' ) {
@@ -1976,7 +2027,7 @@ wppa_echo( '<p style="margin:1em">' . __( 'The following buttons perform actions
1976
  </p>
1977
  <form name="wppa-del-form" action="' . esc_url( wppa_dbg_url( get_admin_url() . 'admin.php?page=wppa_admin_menu' ) ) . '" method="post">' .
1978
  wp_nonce_field( 'wppa-nonce', 'wppa-nonce' ) . '
1979
- <p>' .
1980
  __( 'What would you like to do with photos currently in the album?', 'wp-photo-album-plus' ) . '<br>
1981
  <input type="radio" name="wppa-del-photos" value="delete" checked="checked" />' . __( 'Delete', 'wp-photo-album-plus' ) . '<br>
1982
  <input type="radio" name="wppa-del-photos" value="move" />' . __( 'Move to:', 'wp-photo-album-plus' ) . '
@@ -1989,7 +2040,7 @@ wppa_echo( '<p style="margin:1em">' . __( 'The following buttons perform actions
1989
  'sort' => true,
1990
  ) ) . '
1991
  </select>
1992
- </p>
1993
 
1994
  <input
1995
  type="hidden"
@@ -2052,148 +2103,153 @@ wppa_echo( '<p style="margin:1em">' . __( 'The following buttons perform actions
2052
  }
2053
  $style = wppa_get_option('wppa_album_table_'.wppa_get_user(), 'flat');
2054
 
2055
- $result = '
 
 
 
2056
  <div class="wrap">' .
2057
  wppa_admin_spinner() . '
2058
- <h1 class="wp-heading-inline">' . __( 'Manage Albums', 'wp-photo-album-plus' ) . '</h1>';
2059
 
2060
  // The Create new album button
2061
  if ( wppa_can_create_top_album() ) {
2062
  $url = get_admin_url() . 'admin.php?page=wppa_admin_menu&tab=edit&edit-id=new&wppa-nonce=' . wp_create_nonce( 'wppa-nonce' );
2063
  $vfy = __( 'Are you sure you want to create a new album?', 'wp-photo-album-plus' );
2064
- $result .= '
2065
  <a
2066
  onclick="return confirm(\'' . $vfy . '\');"
2067
  href="' . $url . '"
2068
  class="page-title-action">' .
2069
  __( 'Add New', 'wp-photo-album-plus' ) . '
2070
- </a><br>';
2071
- }
2072
-
2073
- // The switch to flat/collapsable button(s)
2074
- $result .= '<p style="float:left">';
2075
- if ( $style == 'flat' ) {
2076
- $result .= '
2077
- <input
2078
- type="button"
2079
- class="button button-secundary"
2080
- onclick="document.location=\'' . wppa_dbg_url( get_admin_url() . 'admin.php?page=wppa_admin_menu&amp;switchto=collapsible' ) . '\'"
2081
- value="' . esc_attr__( 'Switch to Collapsable table', 'wp-photo-album-plus' ) . '"
2082
- />';
2083
- }
2084
- else {
2085
- $result .= '
2086
- <input
2087
- type="button"
2088
- class="button button-secundary"
2089
- onclick="document.location=\'' . wppa_dbg_url( get_admin_url() . 'admin.php?page=wppa_admin_menu&amp;switchto=flat ' ) . '\'"
2090
- value="' . esc_attr__( 'Switch to Flat table', 'wp-photo-album-plus' ) . '"
2091
- />';
2092
  }
2093
 
2094
- // The open all/close all buttons
2095
- if ( $style != 'flat' ) {
2096
- $result .= '
2097
- <input
2098
- type="button"
2099
- class="button button-secundary"
2100
- id="wppa-open-all"
2101
- style="display:inline"
2102
- onclick=" jQuery(\'#wppa-close-all\').css(\'display\',\'inline\');
2103
- jQuery(this).css(\'display\',\'none\');
2104
- jQuery(\'.wppa-alb-onoff\').css(\'display\',\'\');
2105
- jQuery(\'.alb-arrow-off\').css(\'display\',\'\');
2106
- jQuery(\'.alb-arrow-on\').css(\'display\',\'none\');
2107
- "
2108
- value="' . esc_attr__( 'Open all', 'wp-photo-album-plus' ) . '"
2109
- />
2110
- <input
2111
- type="button"
2112
- class="button button-secundary"
2113
- id="wppa-close-all"
2114
- style="display:inline"
2115
- onclick=" jQuery(\'#wppa-open-all\').css(\'display\',\'inline\');
2116
- jQuery(this).css(\'display\',\'none\');
2117
- jQuery(\'.wppa-alb-onoff\').css(\'display\',\'none\');
2118
- jQuery(\'.alb-arrow-on\').css(\'display\',\'\');
2119
- jQuery(\'.alb-arrow-off\').css(\'display\',\'none\');
2120
- "
2121
- value="' . esc_attr__( 'Close all', 'wp-photo-album-plus' ) . '"
2122
- />';
2123
- }
2124
- $result .= '</p>';
2125
 
2126
- // Edit by id
2127
- if ( wppa_has_many_albums() ) {
2128
- $result .= '
2129
- <p style="float:right">
2130
- <input
2131
- id="wppa-edit-albid"
2132
- type="number"
2133
- min="1"
2134
- placeholder="' . __( 'Album id', 'wp-photo-album-plus' ) . '"
2135
- title="' . __( 'Enter the number of the album you want to edit', 'wp-photo-album-plus' ) . '"
2136
- style="width:120px;cursor:pointer"
 
 
 
2137
  />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2138
  <input
2139
  type="button"
 
2140
  value="' . __( 'Edit album', 'wp-photo-album-plus' ) . '"
2141
  onclick="wppaGoEditAlbNo();"
2142
- />
2143
- </p>';
2144
- }
2145
- else {
2146
- $albids = $wpdb->get_col( "SELECT id FROM $wpdb->wppa_albums ORDER BY id" );
2147
- if ( ! wppa_user_is( 'administrator' ) ) foreach( array_keys( $albids ) as $key ) {
2148
- if ( ! wppa_have_access( $albids[$key] ) ) {
2149
- unset( $albids[$key] );
2150
- }
2151
- }
2152
- $result .= '
2153
- <p style="float:right">
2154
  <select
2155
- id="wppa-edit-albid"
2156
- title="' . __( 'Select the number of the album you want to edit', 'wp-photo-album-plus' ) . '"
2157
- style="width:120px;cursor:pointer;vertical-align:baseline"
2158
- />
2159
- <option value="" selected disabled>' . __( 'Album id', 'wp-photo-album-plus' ) . '</option>';
2160
- foreach( $albids as $alb ) {
2161
- $result .= '<option value="' . $alb . '">' . $alb . '</option>';
2162
  }
2163
- $result .= '
2164
  </select>
2165
  <input
2166
  type="button"
2167
- class="button button-secundary"
2168
- value="' . __( 'Edit album', 'wp-photo-album-plus' ) . '"
2169
- onclick="wppaGoEditAlbNo();"
2170
- />
2171
- </p>';
 
 
 
2172
  }
2173
 
2174
- // Filter by searchword
2175
- $opts = $wpdb->get_col( "SELECT slug FROM $wpdb->wppa_index WHERE albums <> '' ORDER BY slug" );
2176
- $f = wppa_get( 'filter' );
2177
- $result .= '
2178
- <p style="float:right;">
2179
- <select
2180
- id="wppa-edit-filter"
2181
- title="' . __( 'Select an album search word', 'wp-photo-album-plus' ) . '"
2182
- style="vertical-align:baseline">
2183
- <option value="" selected disabled>' . __( 'Filter by', 'wp-photo-album-plus' ) . '</option>';
2184
- foreach( $opts as $opt ) {
2185
- $result .= '<option value="' . $opt . '"' . ( $f == $opt ? ' selected ' : '' ) . '>' . $opt . '</option>';
2186
- }
2187
- $result .=
2188
- '</select>
2189
- <input
2190
- type="button"
2191
- class="button button-secundary"
2192
- onclick="wppaGoApplyFilter();"
2193
- value="' . __( 'Apply filter', 'wp-photo-album-plus' ) . '"
2194
- />
2195
- </p>';
2196
-
2197
  $the_js = '
2198
  function wppaGoEditAlbNo() {
2199
  var id = parseInt(document.getElementById("wppa-edit-albid").value);
@@ -2209,7 +2265,7 @@ wppa_echo( '<p style="margin:1em">' . __( 'The following buttons perform actions
2209
  function wppaGoApplyFilter() {
2210
  var filter = document.getElementById("wppa-edit-filter").value;
2211
  if(filter) {
2212
- document.location.href="'.get_admin_url().'admin.php?page=wppa_admin_menu&switchto=flat&filter="+filter;
2213
  }
2214
  else {
2215
  alert("' . __( 'Please select a filter token', 'wp-photo-album-plus' ) . '");
@@ -2217,11 +2273,13 @@ wppa_echo( '<p style="margin:1em">' . __( 'The following buttons perform actions
2217
  };';
2218
  wppa_add_inline_script( 'wppa-admin', $the_js );
2219
 
2220
- wppa_echo( $result );
2221
-
2222
  // The table of existing albums
2223
- if ( $style == 'flat' ) wppa_admin_albums_flat();
2224
- else wppa_admin_albums_collapsible();
 
 
 
 
2225
 
2226
  wppa_echo( '<br>' );
2227
 
@@ -2532,7 +2590,7 @@ global $wpdb;
2532
 
2533
  }
2534
  else {
2535
- wppa_echo( '<p>' . __( 'No albums yet.', 'wp-photo-album-plus' ) . '</p>' );
2536
  }
2537
  }
2538
 
@@ -2839,7 +2897,7 @@ global $wpdb;
2839
  wppa_add_inline_script( 'wppa-admin', $the_js );
2840
  }
2841
  else {
2842
- wppa_echo( '<p>' . __( 'No albums yet.', 'wp-photo-album-plus' ) . '</p>' );
2843
  }
2844
  }
2845
 
@@ -3436,7 +3494,7 @@ global $wpdb;
3436
  }
3437
 
3438
  $result = '
3439
- <h2>' .
3440
  __( 'Manage album order', 'wp-photo-album-plus' ) . '
3441
  -
3442
  <small>
3
  * Package: wp-photo-album-plus
4
  *
5
  * create, edit and delete albums
6
+ * Version 8.2.02.007
7
  *
8
  */
9
 
73
  // album edit page
74
  if ( wppa_get( 'tab' ) == 'edit' ) {
75
 
76
+ // Edit any album, check for type is implemented c.q. existence and rights
77
  if ( wppa_get( 'edit-id' ) ) {
78
 
79
  $ei = wppa_get( 'edit-id' );
96
  }
97
  }
98
 
99
+ // Edit single photo
100
  if ( wppa_get( 'edit-id' ) == 'single' ) {
101
 
102
  $txt = wppa_get( 'just-edit', __( 'Edit Single Photo', 'wp-photo-album-plus' ) );
107
  return;
108
  }
109
 
110
+ // Edit by search token
111
  if ( wppa_get( 'edit-id' ) == 'search' ) {
112
 
113
  if ( wppa_get( 'searchstring' ) ) {
151
  return;
152
  }
153
 
154
+ // Edit trashed photos
155
  if ( wppa_get( 'edit-id' ) == 'trash' ) {
156
 
157
  $h2 = __( 'Manage Trashed Photos', 'wp-photo-album-plus' );
168
  return;
169
  }
170
 
171
+ // Edit new album
172
  if ( wppa_get( 'edit-id' ) == 'new' ) {
173
 
174
  if ( ! wppa_can_create_album() ) {
233
  $edit_id = $id;
234
  }
235
  }
236
+
237
+ // Edit by album id
238
  else {
239
  $edit_id = wppa_get( 'edit-id' );
240
  }
245
  wp_die( __( 'You have insufficient rights to edit this album', 'wp-photo-album-plus' ) );
246
  }
247
 
248
+ /* Start pre-edit actions */
249
+
250
  // Apply new desc
251
  if ( wppa_get( 'applynewdesc' ) ) {
252
  if ( ! wp_verify_nonce( wppa_get( 'nonce' ), 'wppa-nonce' ) ) {
284
  }
285
  }
286
 
287
+ // Prepare update message
288
  $remark = sprintf( __( 'Album %s is not modified yet', 'wp-photo-album-plus' ), $edit_id );
289
 
290
  // Set all to pano
381
  }
382
  }
383
 
384
+ /* End pre-edit operations */
385
+
386
  // Get the album information
387
+ {
388
  $albuminfo = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->wppa_albums
389
  WHERE id = %s", $edit_id ), ARRAY_A );
390
 
421
  $tpviews = $treecounts['treephotoviews'];
422
  $nsub = $treecounts['selfalbums'];
423
 
424
+ $has_children = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $wpdb->wppa_albums WHERE a_parent = %d", $id ) );
425
 
426
+ // Get number of allowed uploads, -1 is unlimited
427
+ $a = wppa_allow_uploads( $id );
428
+ $full = $a ? false : true;
429
 
430
+ }
 
431
 
432
+ // Local js functions
433
+ {
434
+ $the_js = '
435
+ function wppaTryInheritCats( id ) {
436
 
437
+ var query = "' . esc_js( __( 'Are you sure you want to inherit categories to all (grand)children of this album?', 'wp-photo-album-plus' ) ) . '";
438
+ if ( confirm( query ) ) {
439
+ wppaAjaxUpdateAlbum( id, \'inherit_cats\', Math.random() );
 
440
  }
441
+ }
442
 
443
+ function wppaTryAddCats( id ) {
444
 
445
+ var query = "' . esc_js( __( 'Are you sure you want to add the categories to all (grand)children of this album?', 'wp-photo-album-plus' ) ) . '";
446
+ if ( confirm( query ) ) {
447
+ wppaAjaxUpdateAlbum( id, \'inhadd_cats\', Math.random() );
 
448
  }
449
+ }
450
 
451
+ function wppaTryApplyDeftags( id ) {
452
 
453
+ var query = "' . esc_js( __( 'Are you sure you want to set the default tags to all photos in this album?', 'wp-photo-album-plus' ) ) . '";
454
+ if ( confirm( query ) ) {
455
+ wppaAjaxUpdateAlbum( id, \'set_deftags\', Math.random(), true );
 
456
  }
457
+ }
458
 
459
+ function wppaTryAddDeftags( id ) {
460
 
461
+ var query = "' . esc_js( __( 'Are you sure you want to add the default tags to all photos in this album?', 'wp-photo-album-plus' ) ) . '";
462
+ if ( confirm( query ) ) {
463
+ wppaAjaxUpdateAlbum( id, \'add_deftags\', Math.random(), true );
 
464
  }
465
+ }
466
 
467
+ function wppaTryScheduleAll( id ) {
468
 
469
+ var query;
470
+ if ( ! jQuery( "#schedule-box" ).prop( "checked" ) ) {
471
+ query = "' . esc_js( __( 'Please switch feature on and set date/time to schedule first', 'wp-photo-album-plus' ) ) . '";
472
+ alert( query );
473
+ return;
474
+ }
475
+ query = "' . esc_js( __( 'Are you sure you want to schedule all photos in this album?', 'wp-photo-album-plus' ) ) . '";
476
+ if ( confirm( query ) ) {
477
+ wppaAjaxUpdateAlbum( id, \'setallscheduled\', Math.random(), true );
 
478
  }
479
+ }
480
 
481
+ function wppaTryScheduledelAlb( id ) {
482
 
483
+ wppaAjaxUpdateAlbum( id, "scheduledel", Math.random() );
484
+ if ( ! jQuery( "#scheduledel" ).prop( "checked" ) ) {
485
+ wppaAjaxUpdateAlbum( id, "removescheduledel", 0 );
 
486
  }
487
+ }
488
 
489
+ function wppaTrySetAllPanorama( id ) {
490
+ var panoval = jQuery( "#pano-opt" ).val();
491
+ if ( panoval == 0 || panoval == 1 || panoval == 2 ) {
492
+ var url = "' . wppa_dbg_url(get_admin_url()) . 'admin.php?page=wppa_admin_menu&tab=edit&edit-id="+id+"&wppa-nonce=' . wp_create_nonce( 'wppa-nonce' ) . '&pano-val="+panoval;
493
+ document.location = url;
 
 
 
 
 
 
 
494
  }
495
+ else {
496
+ alert("' . __( 'Please select a valid panorama mode', 'wp-photo-album-plus' ) . '");
497
+ }
498
+ }';
499
 
500
+ wppa_add_inline_script( 'wppa-admin', $the_js );
501
+ }
502
 
503
+ /* The actual page lay-out starts here */
504
 
505
+ // Open the photo album admin page
506
+ wppa_echo( '<div class="wrap">' );
507
 
508
+ // The spinner to indicate busyness
509
+ wppa_admin_spinner();
 
 
 
 
 
510
 
511
+ // The nonce field for security
512
+ wppa_echo( '<input type="hidden" id="album-nonce-' . $id . '" value="' . wp_create_nonce( 'wppa-nonce_' . $id ) . '" />' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
513
 
514
+ // The header
515
+ wppa_echo( '<h1 style="display:inline">' . __( wppa_get_album_name( $id ) ) . '</h1>' );
516
 
517
+ /* Start header buttons */
518
+ wppa_echo( '
519
+ <div id="wppa-action-container">
520
+ <div id="wppa-action-container-left">');
 
 
 
 
 
 
521
 
522
+ // Goto Upload
523
+ if ( current_user_can( 'wppa_upload' ) ) {
524
 
525
+ $onc = ( $full ?
526
+ 'alert(\''.__( 'Change the upload limit or remove photos to enable new uploads.', 'wp-photo-album-plus' ).'\')' :
527
+ 'document.location = \''.wppa_dbg_url(get_admin_url()).'/admin.php?page=wppa_upload_photos&wppa-set-album='.$id.'\''
528
+ );
529
+ $val = ( $full ?
530
+ __( 'Album is full', 'wp-photo-album-plus' ) :
531
+ __( 'Upload to this album', 'wp-photo-album-plus' ) . ( $a > '0' ? ' ' . sprintf( __( '(max %d)', 'wp-photo-album-plus' ), $a ) : '' )
532
+ );
 
 
 
 
 
 
533
 
534
+ wppa_echo( '
535
+ <input
536
+ type="button"
537
+ class="wppa-admin-button button"
538
+ onclick="' . $onc . '"
539
+ value="' . $val .'"
540
+ />' );
541
+ }
542
 
543
+ // Goto Import
544
+ if ( current_user_can( 'wppa_import' ) && ! $full ) {
545
 
546
+ $onc = 'document.location = \''.wppa_dbg_url(get_admin_url()).'admin.php?page=wppa_import_photos&wppa-set-album='.$id.'\'';
547
+ $val = __( 'Import to this album', 'wp-photo-album-plus' ) . ( $a > '0' ? ' ' . sprintf( __( '(max %d)', 'wp-photo-album-plus' ), $a ) : '' );
548
 
549
+ wppa_echo( '
550
+ <input
551
+ type="button"
552
+ class="wppa-admin-button button"
553
+ onclick="' . $onc . '"
554
+ value="' . $val .'"
555
+ />' );
556
+ }
557
+ wppa_echo( '
558
+ </div>' ); // end action-container-left
559
+
560
+ // Download album
561
+ if ( wppa_switch( 'allow_download_album' ) && ( ! wppa_switch( 'download_album_is_restricted' ) || wppa_user_is( 'administrator' ) ) ) {
562
+ wppa_echo( '
563
+ <div id="wppa-action-container-right">
564
+ <input
565
+ type="button"
566
+ class="wppa-admin-button button"
567
+ onclick="wppaAjaxDownloadAlbum( 0, ' . $albuminfo['id'] . ' );"
568
+ value="' . esc_attr( __( 'Download album', 'wp-photo-album-plus' ) ).'"
569
+ />
570
+ <img
571
+ id="dwnspin-0-' . $albuminfo['id'] . '"
572
+ src="' . wppa_get_imgdir() . 'spinner.gif"
573
+ style="margin-left:6px;display:none;height:18px;position:relative;bottom:-6px"
574
+ alt="spinner"
575
+ />
576
+ </div>' ); // end action-container-right
577
+ }
578
+ wppa_echo( '
579
+ </div>'); // end action-container
580
+ /* End header */
581
+
582
+ /* First details block - standard settings */
583
+ {
584
+ wppa_echo( '
585
  <details class="wppa-toplevel-details">
586
  <summary class="toplevel wppa-summary-toplevel"> ' .
587
  __( 'the gallery settings', 'wp-photo-album-plus' ) . '
588
+ </summary>' );
589
 
590
+ // Expalanation
591
+ wppa_echo( '
592
+ <h2 class="description" style="margin:1em">' .
593
  __( 'All modifications are instantly updated on the server, except for those that require a button push.', 'wp-photo-album-plus' ) . ' ' .
594
+ __( 'After entering/modification of text, click outside the textfield to get it updated.', 'wp-photo-album-plus' ) . '
595
+ <br>' . __( 'The <b style="color:#070" >Remark</b> fields keep you informed on the actions taken at the background.', 'wp-photo-album-plus' ) . '
596
+ </h2>' );
 
 
 
 
 
 
597
 
598
+ // The edit albuminfo panel with border
599
+ wppa_echo( '
600
  <div
601
  id="albumitem-' . $id . '"
602
  class="wppa-table-wrap"
603
  style="width:100%;position:relative;"
604
+ >' );
605
+
606
+ // Section 0: More or less static data
607
+ {
608
+ $result = '
609
+ <!-- Album Section 0 static data -->
610
+ <div class="wppa-flex">' .
611
+
612
+ // Album number, crypt, timestamp and modified
613
+ '<div>
614
+ <label>' .
615
+ __( 'Album number', 'wp-photo-album-plus' ) . '
616
+ </label><br>
617
+ <h4>' .
618
+ $id . '
619
+ </h4>
620
+ </div>
621
+ <div>
622
+ <label>' .
623
+ __( 'Crypt', 'wp-photo-album-plus' ) . '
624
+ </label><br>
625
+ <h4>' .
626
+ $crypt . '
627
+ </h4>
628
+ </div>
629
+ <div>
630
+ <label>' .
631
+ __( 'Created', 'wp-photo-album-plus' ) . '
632
+ </label><br>
633
+ <h4>' .
634
+ wppa_local_date( '', $timestamp ) . '
635
+ </h4>
636
+ </div>
637
+ <div>
638
+ <label>' .
639
+ __( 'Modified', 'wp-photo-album-plus' ) . '
640
+ </label><br>
641
+ <h4>';
642
+ if ( $modified > $timestamp ) {
643
+ $result .= wppa_local_date( '', $modified );
644
+ }
645
+ else {
646
+ $result .= __( 'Not modified', 'wp-photo-album-plus' );
647
+ }
648
+ $result .= '
649
+ </h4>
650
+ </div>';
651
 
652
  // Views
653
  if ( wppa_switch( 'track_viewcounts' ) ) {
654
+ $result .= '
655
+ <div>
656
+ <label>' .
657
+ __( 'Album Views', 'wp-photo-album-plus' ) . '
658
+ </label><br>
659
+ <h4>' .
660
+ $views . '
661
+ </h4>
662
+ </div>
663
+ <div>
664
+ <label>' .
665
+ __( 'Photo views', 'wp-photo-album-plus' ) . '
666
+ </label><br>
667
+ <h4>' .
668
+ $pviews . '
669
+ </h4>
670
+ </div>';
671
  if ( $nsub ) {
672
+ $result .= '
673
+ <div>
674
+ <label>' .
675
+ __( 'Inc subalbums', 'wp-photo-album-plus' ) . '
676
+ </label><br>
677
+ <h4>' .
678
+ $tpviews . '
679
+ </h4>
680
+ </div>';
681
  }
682
  }
683
 
684
  // Clicks
685
  if ( wppa_switch( 'track_clickcounts' ) ) {
686
  $click_arr = $wpdb->get_col( "SELECT clicks FROM $wpdb->wppa_photos WHERE album = $id" );
687
+ $result .= '
688
+ <div>
689
+ <label>' .
690
+ __( 'Clicks:', 'wp-photo-album-plus' ) . '
691
+ </label><br>
692
+ <h4>' .
693
+ array_sum( $click_arr ) . '
694
+ </h4>
695
+ </div>';
696
  }
697
 
698
+ $result .= '</div>';
699
+ wppa_echo( $result );
700
+ }
 
701
 
702
+ // Section 1: Short settable items
703
+ {
704
+ wppa_echo( '
705
+ <!-- Album Section 1 simple settings -->
706
+ <div class="wppa-flex">' );
707
 
708
  // Owner
709
  {
710
+ $result = '
711
+ <div>
712
  <label
713
+ for="albumowner">' .
 
714
  __( 'Owned by:', 'wp-photo-album-plus' ) . '
715
  </label><br>';
716
 
756
  }
757
  }
758
  $result .= '
759
+ </div>';
760
+ wppa_echo( $result );
761
  }
762
 
763
  // Order # -->
764
  {
765
+ wppa_echo( '
766
+ <div>
767
  <label
768
+ for="albumseqno">' .
 
769
  __( 'Sequence number', 'wp-photo-album-plus' ) . '
770
  </label><br>
771
  <input
775
  onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'a_order\', this )"
776
  value="' . esc_attr( $a_order ) . '"' .
777
  ( wppa_opt( 'list_albums_by' ) != '1' && $a_order != '0' ? ' title="' . esc_attr( __( 'Album sequence number has only effect if you set the album sort order method to Order # in the Photo Albums -> Settings screen.', 'wp-photo-album-plus' )) . '"' : '' ) . '
778
+ />&nbsp;
779
+ </div>' );
 
780
  }
781
 
782
  // Status
784
  $title = __( 'Set the frontend visibility of the album cover and items not including subalbums.', 'wp-photo-album-plus' ) . ' ' .
785
  __( 'Publish: visible for all, Private: visible for logged in only, Hidden: visible for admin only', 'wp-photo-album-plus' );
786
 
787
+ wppa_echo( '
788
+ <div>
789
  <label
790
+ for="albumstatus">' .
 
791
  __( 'Status', 'wp-photo-album-plus' ) . '
792
  </label><br>
793
  <select
805
  __( 'Hidden', 'wp-photo-album-plus' ) . '
806
  </option>
807
  </select>
808
+ </div>' );
809
  }
810
 
811
  // Parent
812
  {
813
+ $result = '
814
+ <div>
815
  <label
816
+ for="wppa-parsel">' .
 
817
  __( 'Parent album', 'wp-photo-album-plus' ) . '
818
  </label><br>';
819
  if ( wppa_extended_access() ) {
859
  '</select>';
860
  }
861
  $result .= '
862
+ </div>';
863
+ wppa_echo( $result );
864
  }
865
 
866
  // P-order-by
 
867
  if ( ! wppa_switch( 'porder_restricted' ) || wppa_user_is( 'administrator' ) ) {
868
+ $result = '
869
  <div
870
  style="max-width: 200px;margin-right: 4px;">
871
  <label
872
  for="photo-order"
 
873
  >' .
874
 
875
  __( 'Photo order:', 'wp-photo-album-plus' ) . '
929
  $result .= '
930
  </select>
931
  </div>';
932
+ wppa_echo( $result );
933
  }
934
 
935
  // Subalbum order
957
 
958
  $title = sprintf( __( 'The default is set in %s and is currently set to %s', 'wp-photo-album-plus' ), wppa_setting_path( 'b', 'misc', 1, 1 ), $dflt );
959
 
960
+ $result = '
961
+ <div>
 
962
  <label
963
+ for="subalbumorder">' .
 
964
  __( 'Subalbum sort order', 'wp-photo-album-plus' ) . '
965
  </label><br>
966
  <select
974
  }
975
  $result .= '
976
  </select>
977
+ </div>';
978
+ wppa_echo( $result );
979
  }
980
 
981
  // Alternative thumbnail size
 
982
  if ( ! wppa_switch( 'alt_is_restricted' ) || wppa_user_is( 'administrator' ) ) {
983
  $title = sprintf( __( 'The alternate thumbnail size is set in %s and is currently set to %s', 'wp-photo-album-plus' ), wppa_setting_path( 'b', 'thumbs', 1, 2 ), wppa_opt( 'thumbsize_alt' ) );
984
 
985
  $sel = ' selected';
986
+ wppa_echo( '
987
  <div
988
  style="max-width: 200px;margin-right: 4px;">
989
  <label
990
+ for="altthumb">' .
 
991
  __( 'Use alt thumbsize', 'wp-photo-album-plus' ) . '
992
  </label><br>
993
  <select
1002
  __( 'yes', 'wp-photo-album-plus' ) . '
1003
  </option>
1004
  </select>
1005
+ </div>' );
 
1006
  }
1007
 
1008
  // Cover type
 
1009
  if ( ! wppa_switch( 'covertype_is_restricted' ) || wppa_user_is( 'administrator' ) ) {
1010
  $sel = ' selected';
1011
  $title = sprintf( __( 'The default is set in %s and is currently set to %s', 'wp-photo-album-plus' ), wppa_setting_path( 'b', 'covers', 3, 4 ), wppa_opt( 'cover_type' ) );
1012
 
1013
+ wppa_echo( '
1014
+ <div
1015
+ style="max-width: 200px;margin-right: 4px;">
1016
+ <label
1017
+ for="covertype">' .
1018
+ __( 'Cover&nbsp;Type', 'wp-photo-album-plus' ) . '
1019
+ </label><br>
1020
+ <select
1021
+ id="covertype"
1022
+ style="max-width:200px;"
1023
+ onchange="wppaAjaxUpdateAlbum( '. $id . ', \'cover_type\', this )"
1024
+ title="' . esc_attr( $title ) . '"
1025
+ >
1026
+ <option value=""' . ( $cover_type == '' ? $sel : '' ) . ' >' .
1027
+ __( '--- default ---', 'wp-photo-album-plus' ) . '
1028
+ </option>
1029
+ <option value="default"' . ( $cover_type == 'default' ? $sel : '' ) . ' >' .
1030
+ __( 'Standard', 'wp-photo-album-plus' ) . '
1031
+ </option>
1032
+ <option value="longdesc"' . ( $cover_type == 'longdesc' ? $sel : '' ) . ' >' .
1033
+ __( 'Long Descriptions', 'wp-photo-album-plus' ) . '
1034
+ </option>
1035
+ <option value="imagefactory"' . ( $cover_type == 'imagefactory' ? $sel : '' ) . ' >' .
1036
+ __( 'Image Factory', 'wp-photo-album-plus' ) . '
1037
+ </option>
1038
+ <option value="default-mcr"' . ( $cover_type == 'default-mcr' ? $sel : '' ) . ' >' .
1039
+ __( 'Standard mcr', 'wp-photo-album-plus' ) . '
1040
+ </option>
1041
+ <option value="longdesc-mcr"' . ( $cover_type == 'longdesc-mcr' ? $sel : '' ) . ' >' .
1042
+ __( 'Long Descriptions mcr', 'wp-photo-album-plus' ) . '
1043
+ </option>
1044
+ <option value="imagefactory-mcr"' . ( $cover_type == 'imagefactory-mcr' ? $sel : '' ) . ' >' .
1045
+ __( 'Image Factory mcr', 'wp-photo-album-plus' ) . '
1046
+ </option>
1047
+ </select>
1048
+ </div>' );
1049
  }
1050
 
1051
  // Cover photo
1052
  {
1053
+ wppa_echo( '
1054
+ <div>
1055
+ <label>' .
 
 
1056
  __( 'Cover&nbsp;Photo:', 'wp-photo-album-plus' ) . '
1057
  </label><br>' .
1058
  wppa_main_photo( $main_photo, $cover_type ) . '
1059
+ </div>' );
1060
  }
1061
 
1062
  // Upload limit
1063
  {
1064
+ $result = '
1065
+ <div>
 
1066
  <label
1067
+ for="upload_limit_count">' .
 
1068
  __( 'Upload limit:', 'wp-photo-album-plus' ) . '
1069
  </label><br>';
1070
  $lims = explode( '/', $upload_limit );
1079
  type="text"
1080
  id="upload_limit_count"
1081
  value="' . $lims[0] . '"
1082
+ style="max-width:50px;cursor:pointer;"
1083
  title="' . esc_attr( $title ) . '"
1084
  onchange="wppaRefreshAfter(); wppaAjaxUpdateAlbum( ' . $id . ', \'upload_limit_count\', this )"
1085
  />
1112
  $result .= '. ';
1113
  }
1114
  $result .= '
1115
+ </div>';
1116
+ wppa_echo( $result );
1117
  }
1118
 
1119
  // Tree limit
1121
  $title = __( 'The upload limit for this album and all its (grand)children.', 'wp-photo-album-plus' ) . ' ' .
1122
  __( 'This setting overrules all other limits that may apply to this album or its (grand)children.', 'wp-photo-album-plus' ) . ' ' .
1123
  __( '0 means no limit.', 'wp-photo-album-plus' );
1124
+ wppa_echo( '
1125
+ <div>
 
1126
  <label
1127
+ for="uploadlimittree">' .
 
1128
  __( 'Tree upload limit', 'wp-photo-album-plus' ) . '
1129
  </label><br>
1130
+ <input
1131
+ type="text"
1132
+ id="uploadlimittree"
1133
+ title="' . esc_attr( $title ) . '"
1134
+ value="' . $tree_limit . '"
1135
+ onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'upload_limit_tree\', this )"
1136
+ style="cursor:pointer;max-width:50px;"
1137
+ />
1138
+ </div>' );
 
1139
  }
1140
 
1141
  // Need this the next 5 items
1148
  $title = __( 'When set other than default, this setting will overrule the default settings.', 'wp-photo-album-plus' ) . ' ' .
1149
  sprintf( __( 'The default is set in %s and is currently %s', 'wp-photo-album-plus' ), wppa_setting_path( 'b', 'photos', 1, 4 ), ( wppa_switch( 'zoom_on' ) ? $yes : $no ) );
1150
 
1151
+ wppa_echo( '
1152
+ <div>
 
1153
  <label
1154
+ for="zoomable">' .
 
1155
  __( 'Photos are zoomable:', 'wp-photo-album-plus' ) . '
1156
  </label><br>
1157
  <select
1162
  <option value="on"'.($zoomable=='on'?' selected': '').'>' . $yes . '</option>
1163
  <option value="off"'.($zoomable=='off'?' selected': '').'>' . $no . '</option>
1164
  </select>
1165
+ </div>' );
1166
  }
1167
 
1168
  // Overrulable display options / next 4 items
1185
  wppa_setting_path( 'b', 'thumbs', 2, 1, wppa_switch( 'thumb_text_name' ) ? $yes : $no ) . ' ' . __( 'and' , 'wp-photo-album-plus' ) . '&#013;' .
1186
  wppa_setting_path( 'b', 'lightbox', 1, 3, wppa_switch( 'ovl_name' ) ? $yes : $no ) . '.';
1187
 
1188
+ wppa_echo( '
1189
+ <div>
 
1190
  <label
1191
+ for="showname">' .
 
1192
  __( 'Show names:', 'wp-photo-album-plus' ) . '
1193
  </label><br>
1194
  <select
1199
  <option value="1"'.($disp_opt[0]=='1'?' selected': '').'>' . $yes . '</option>
1200
  <option value="-1"'.($disp_opt[0]=='-1'?' selected': '').'>' . $no . '</option>
1201
  </select>
1202
+ </div>' );
1203
  }
1204
 
1205
  // Display description
1209
  wppa_setting_path( 'b', 'thumbs', 2, 3, wppa_switch( 'thumb_text_desc' ) ? $yes : $no ) . ' ' . __( 'and' , 'wp-photo-album-plus' ) . '&#013;' .
1210
  wppa_setting_path( 'b', 'lightbox', 1, 4, wppa_switch( 'ovl_desc' ) ? $yes : $no ) . '.';
1211
 
1212
+ wppa_echo( '
1213
+ <div>
 
1214
  <label
1215
+ for="showdesc">' .
 
1216
  __( 'Show descriptions:', 'wp-photo-album-plus' ) . '
1217
  </label><br>
1218
  <select
1223
  <option value="1"'.($disp_opt[1]=='1'?' selected': '').'>' . $yes . '</option>
1224
  <option value="-1"'.($disp_opt[1]=='-1'?' selected': '').'>' . $no . '</option>
1225
  </select>
1226
+ </div>' );
1227
  }
1228
 
1229
  // Display rating
1233
  wppa_setting_path( 'b', 'thumbs', 2, 3, wppa_switch( 'thumb_text_rating' ) ? $yes : $no ) . ' ' . __( 'and' , 'wp-photo-album-plus' ) . '&#013;' .
1234
  wppa_setting_path( 'b', 'lightbox', 1, 5, wppa_switch( 'ovl_rating' ) ? $yes : $no ) . '.';
1235
 
1236
+ wppa_echo( '
1237
+ <div>
 
1238
  <label
1239
+ for="showrating">' .
 
1240
  __( 'Show rating:', 'wp-photo-album-plus' ) . '
1241
  </label><br>
1242
  <select
1247
  <option value="1"'.($disp_opt[2]=='1'?' selected': '').'>' . $yes . '</option>
1248
  <option value="-1"'.($disp_opt[2]=='-1'?' selected': '').'>' . $no . '</option>
1249
  </select>
1250
+ </div>' );
1251
  }
1252
 
1253
  // Display comments
1256
  wppa_setting_path( 'b', 'general', 1, 4, wppa_switch( 'show_comments' ) ? $yes : $no ) . ' ' . __( 'and' , 'wp-photo-album-plus' ) . '&#013;' .
1257
  wppa_setting_path( 'b', 'thumbs', 2, 4, wppa_switch( 'thumb_text_comcount' ) ? $yes : $no ) . '.';
1258
 
1259
+ wppa_echo( '
1260
+ <div>
 
1261
  <label
1262
+ for="showcomments">' .
 
1263
  __( 'Show comments:', 'wp-photo-album-plus' ) . '
1264
  </label><br>
1265
  <select
1270
  <option value="1"'.($disp_opt[3]=='1'?' selected': '').'>' . $yes . '</option>
1271
  <option value="-1"'.($disp_opt[3]=='-1'?' selected': '').'>' . $no . '</option>
1272
  </select>
1273
+ </div>' );
1274
  }
1275
 
1276
  // Watermark
1277
  {
1278
  if ( wppa_switch( 'watermark_on' ) ) {
1279
 
1280
+ wppa_echo( '
1281
  <div
1282
  style="max-width: 200px;margin-right: 4px;">
1283
  <label
1284
+ for="watermarkfile">' .
 
1285
  __( 'Watermark file:', 'wp-photo-album-plus' ) . '
1286
  </label><br>
1287
  <select
1290
  onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'wmfile\', this )" >' .
1291
  wppa_watermark_file_select( 'album', $id ) . '
1292
  </select>
1293
+ </div>
1294
  <div
1295
  style="max-width: 200px;margin-right: 4px;">
1296
  <label
1297
+ for="watermarkpos">' .
 
1298
  __( 'Watermark pos:', 'wp-photo-album-plus' ) . '
1299
  </label><br>
1300
  <select
1303
  onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'wmpos\', this )" >' .
1304
  wppa_watermark_pos_select( 'album', $id ) . '
1305
  </select>
1306
+ </div>' );
1307
  }
1308
  }
1309
 
1312
  if ( wppa_user_is( 'administrator' ) || $owner == wppa_get_user() ) {
1313
  $may_change = wppa_user_is( 'administrator' ) || current_user_can( 'wppa_moderate' );
1314
 
1315
+ wppa_echo( '
1316
  <div
1317
  style="max-width: 500px;margin-right: 4px;">
1318
  <label
1319
+ for="scheduledel">' .
 
1320
  __( 'Delete at', 'wp-photo-album-plus' ) . '
1321
  </label><br>
1322
  <input
1333
  >' .
1334
  wppa_get_date_time_select_html( 'delalbum', $id, $may_change ) . '
1335
  </span>
1336
+ </div>' );
1337
  }
1338
  }
1339
 
1340
+ }
1341
 
1342
+ // End Section 1: Short settable items, wppa-flex div
1343
+ wppa_echo( '</div>' );
1344
+
1345
+ // Status - Remark - field
1346
+ wppa_echo( '
1347
+ <h3 style="margin-left:1em">' .
1348
  esc_html__( 'Remark', 'wp-photo-album-plus' ) . ':&nbsp;
1349
  <span
1350
  id="albumstatus-' . $id . '"
1351
  style="font-weight:bold;color:#00AA00">' .
1352
  esc_html( $remark ) . '
1353
+ </span>
1354
+ </h3>' );
 
 
1355
 
1356
+ // Section 2: name, description, custom, links
1357
+ {
1358
+ wppa_echo( '
1359
+ <!-- Album Section 2 -->
1360
+ <table class="wppa-table wppa-album-table">
1361
+ <tbody>' );
1362
 
1363
+ // Name
1364
+ {
1365
+ wppa_echo( '
 
 
 
 
 
 
 
 
 
1366
  <tr>
1367
  <td>' .
1368
  __( 'Name:', 'wp-photo-album-plus' ) . '
1383
  </td>
1384
  <td>
1385
  </td>
1386
+ </tr>' );
1387
+ }
1388
 
1389
+ // Description
1390
+ {
1391
+ wppa_echo( '
1392
  <tr>
1393
  <td>' .
1394
  __( 'Description:', 'wp-photo-album-plus' ) . '
1395
+ </td>
1396
+ <td>' );
1397
+
1398
+ // WP Editor
1399
+ if ( wppa_switch( 'use_wp_editor') ) {
1400
 
 
 
 
1401
 
1402
  // Echos itsself, has no return option
1403
  wp_editor( $description,
1409
  )
1410
  );
1411
 
1412
+ wppa_echo( '
1413
  <input
1414
  type="button"
1415
  class="button button-secundary"
1421
  src="' . wppa_get_imgdir() . 'spinner.gif"
1422
  alt="Spin"
1423
  style="visibility:hidden"
1424
+ />' );
1425
+ }
 
1426
 
1427
+ // Textarea
1428
+ else {
1429
+ wppa_echo( '
 
1430
  <textarea
1431
  style="width:100%;height:60px;"
1432
  onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'description\', this )"
1433
  >' .
1434
  esc_textarea( stripslashes( $description ) ) . '
1435
+ </textarea>' );
1436
+ }
1437
+
1438
+ wppa_echo( '
1439
+ </td>
1440
  <td>
1441
  </td>
1442
+ </tr>' );
1443
+ }
1444
 
1445
+ // Categories
1446
+ {
1447
+ $result = '
1448
  <tr>
1449
  <td>' .
1450
  __( 'Categories:', 'wp-photo-album-plus' ) . '
1482
  </td>
1483
  <td>
1484
  </td>
1485
+ </tr>';
1486
+ wppa_echo( $result );
1487
+ }
1488
 
1489
+ // Default photo tags
1490
+ {
1491
+ wppa_echo( '
1492
  <tr>
1493
  <td>
1494
  ' . __( 'Default photo tags:', 'wp-photo-album-plus' ) . '
1508
  </td>
1509
  <td>
1510
  </td>
1511
+ </tr>' );
1512
+ }
1513
 
1514
  // Custom
1515
  if ( wppa_switch( 'album_custom_fields' ) ) {
1516
+ $result = '';
1517
  $custom = wppa_get_album_item( $edit_id, 'custom' );
1518
  if ( $custom ) {
1519
  $custom_data = wppa_unserialize( $custom );
1548
  </tr>';
1549
  }
1550
  }
1551
+ wppa_echo( $result );
1552
  }
1553
 
1554
  // Link type
1555
+ {
1556
+ $result = '
1557
  <tr>
1558
  <td>
1559
  ' . __( 'Link type:', 'wp-photo-album-plus' ) . '
1585
  <td>
1586
  </td>
1587
  </tr>';
1588
+ wppa_echo( $result );
1589
+ }
1590
 
1591
  // Manually entered link
1592
  if ( ! wppa_switch( 'link_is_restricted' ) || wppa_user_is( 'administrator' ) ) {
1593
+ $result = '
1594
  <tr
1595
  id="link-url-tr"
1596
  style="' . ( $cover_linktype == 'manual' ? '' : 'display:none' ) . '"
1614
  <td>
1615
  </td>
1616
  </tr>';
1617
+ wppa_echo( $result );
1618
  }
1619
 
1620
  // Link page
1621
  if ( ! wppa_switch( 'link_is_restricted' ) || wppa_user_is( 'administrator' ) ) {
1622
+ $result = '
1623
  <tr>
1624
  <td>
1625
  ' . __( 'Link to:', 'wp-photo-album-plus' ) . '
1668
  <td>
1669
  </td>
1670
  </tr>';
1671
+ wppa_echo( $result );
1672
  }
1673
 
1674
  // Schedule
1675
+ {
1676
+ $result = '
1677
  <tr>
1678
  <td>' .
1679
  __( 'Schedule:', 'wp-photo-album-plus' ) . ' ' .
1700
  <td>
1701
  </td>
1702
  </tr>';
1703
+ wppa_echo( $result );
1704
+ }
1705
 
1706
+ // End Section 2
1707
+ wppa_echo( '
1708
+ </tbody>
1709
+ </table>' );
1710
+ }
1711
 
1712
+ // End albuminfo panel with border
1713
+ wppa_echo( '</div>' );
1714
 
 
 
 
 
 
 
 
 
 
1715
 
1716
+ /* End First details block - standard settings */
1717
+ }
1718
 
1719
 
1720
+ /* Second details block - related album options */
1721
+ {
1722
+ wppa_echo( '
1723
+ <details class="wppa-toplevel-details">
1724
+ <summary class="toplevel wppa-summary-toplevel"> '.
1725
+ __( 'related album options', 'wp-photo-album-plus' ) . '
1726
+ </summary>
1727
+ <div class="wppa-table-wrap">' );
1728
 
1729
+ // Explanation
1730
+ wppa_echo( '
1731
+ <h2 class="description" style="margin:1em">' .
1732
+ __( 'The following buttons perform actions on albums related to this album', 'wp-photo-album-plus' ) . '
1733
+ </h2>' );
1734
 
1735
+ // Create subalbum
1736
+ if ( wppa_can_create_album() ) {
1737
+ $url = get_admin_url() . 'admin.php?page=wppa_admin_menu&amp;tab=edit&amp;edit-id=new&amp;parent_id=' . $albuminfo['id'] . '&amp;wppa-nonce=' . wp_create_nonce( 'wppa-nonce' );
1738
+ $onc = 'if (confirm(\''.__( 'Are you sure you want to create a subalbum?', 'wp-photo-album-plus' ).'\')) document.location=\''.$url.'\';';
1739
 
1740
+ wppa_echo( '
1741
+ <input
1742
+ type="button"
1743
+ class="wppa-admin-button button"
1744
+ onclick="' . $onc . '"
1745
+ value="' . esc_attr( __( 'Create child', 'wp-photo-album-plus' ) ) . '"
1746
+ />' );
1747
+ }
1748
 
1749
+ // Create sibling
1750
+ if ( $albuminfo['a_parent'] > '0' && wppa_can_create_album() ||
1751
+ $albuminfo['a_parent'] < '1' && wppa_can_create_top_album() ) {
1752
+ $url = wppa_dbg_url( get_admin_url() .
1753
+ 'admin.php' .
1754
+ '?page=wppa_admin_menu' .
1755
+ '&amp;tab=edit' .
1756
+ '&amp;edit-id=new' .
1757
+ '&amp;parent_id=' . $albuminfo['a_parent'] .
1758
+ '&amp;is-sibling-of=' . $albuminfo['id'] .
1759
+ '&amp;wppa-nonce=' . wp_create_nonce( 'wppa-nonce' ) );
1760
+ $onc = 'if (confirm(\''.__( 'Are you sure you want to create a subalbum?', 'wp-photo-album-plus' ).'\')) document.location=\''.$url.'\';';
1761
 
1762
+ wppa_echo( '
1763
+ <input
1764
+ type="button"
1765
+ class="wppa-admin-button button"
1766
+ onclick="' . $onc . '"
1767
+ value="' . esc_attr( __( 'Create sibling', 'wp-photo-album-plus' ) ) . '"
1768
+ />' );
1769
+ }
1770
 
1771
+ // Edit parent
1772
+ if ( $albuminfo['a_parent'] > '0' && wppa_album_exists( $albuminfo['a_parent'] ) && wppa_have_access( $albuminfo['a_parent'] ) ) {
1773
+ $url = wppa_dbg_url( get_admin_url() . 'admin.php?page=wppa_admin_menu&amp;tab=edit&amp;edit-id=' . $albuminfo['a_parent'] . '&amp;wppa-nonce=' . wp_create_nonce( 'wppa-nonce' ) );
1774
+ $onc = 'document.location=\''.$url.'\';';
1775
+ wppa_echo( '
1776
+ <input
1777
+ type="button"
1778
+ class="wppa-admin-button button"
1779
+ onclick="' . $onc . '"
1780
+ value="' . esc_attr( __( 'Edit parent', 'wp-photo-album-plus' ) ) . '"
1781
+ />' );
1782
+ }
1783
 
1784
+ // Inherit cats
1785
+ if ( $has_children ) {
1786
+ wppa_echo( '
1787
+ <input
1788
+ type="button"
1789
+ class="wppa-admin-button button"
1790
+ title="' . esc_attr( __( 'Apply categories to all (grand)children.', 'wp-photo-album-plus' ) ) . '"
1791
+ onclick="wppaTryInheritCats( ' . $id . ' )"
1792
+ value="' . esc_attr( __( 'Apply Cats to subalbums', 'wp-photo-album-plus' ) ) . '"
1793
+ />
1794
+ <input
1795
+ type="button"
1796
+ class="wppa-admin-button button"
1797
+ title="' . esc_attr( __( 'Add categories to all (grand)children.', 'wp-photo-album-plus' ) ) . '"
1798
+ onclick="wppaTryAddCats( ' . $id . ' )"
1799
+ value="' . esc_attr( __( 'Add Cats to subalbums', 'wp-photo-album-plus' ) ) . '"
1800
+ />' );
1801
+ }
1802
 
1803
+ // Subalbums sequence
1804
+ if ( $has_children ) {
1805
+ wppa_album_sequence( $edit_id );
1806
+ }
1807
 
1808
+ wppa_echo( '
1809
+ </div>
1810
+ </details>' );
1811
+ }
1812
 
1813
 
1814
+ /* Third details block - all items actions */
1815
+ {
1816
+ wppa_echo( '
1817
  <details class="wppa-toplevel-details">
1818
+ <summary class="toplevel wppa-summary-toplevel"> ' .
1819
+ __( 'all item actions', 'wp-photo-album-plus' ) . '
1820
  </summary>
1821
  <div class="wppa-table-wrap">' );
1822
 
1823
+ // Explanation
1824
+ wppa_echo( '
1825
+ <h2 class="description" style="margin:1em">' .
1826
+ __( 'The following buttons perform actions onto all items in this album', 'wp-photo-album-plus' ) . '
1827
+ </h2>' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1828
 
1829
+ // Apply default tags
1830
+ wppa_echo( '
1831
  <input
1832
  type="button"
1833
  class="wppa-admin-button button"
1834
+ title="' . esc_attr( __( 'Tag all photos in this album with the default tags.', 'wp-photo-album-plus' ) ) . '"
1835
+ onclick="wppaTryApplyDeftags( ' . $id . ' )"
1836
+ value="' . esc_attr( __( 'Apply default tags', 'wp-photo-album-plus' ) ) . '"
1837
+ />
 
 
 
 
 
 
1838
  <input
1839
  type="button"
1840
  class="wppa-admin-button button"
1841
+ title="' . esc_attr( __( 'Add the default tags to all photos in this album.', 'wp-photo-album-plus' ) ) . '"
1842
+ onclick="wppaTryAddDeftags( ' . $id . ' )"
1843
+ value="' . esc_attr( __( 'Add default tags', 'wp-photo-album-plus' ) ) . '"
1844
+ />' );
1845
 
1846
+ // Schedule all
1847
+ wppa_echo( '
 
 
1848
  <input
1849
  type="button"
1850
  class="wppa-admin-button button"
1851
+ title="' . esc_attr( __( 'Schedule all photos in this album for later publishing.', 'wp-photo-album-plus' ) ) . '"
1852
+ onclick="wppaTryScheduleAll( ' . $id . ' )"
1853
+ value="' . esc_attr( __( 'Schedule all', 'wp-photo-album-plus' ) ) . '"
1854
+ />' );
1855
+
1856
+ // Reset Ratings
1857
+ if ( wppa_switch( 'rating_on') ) {
1858
+ $onc = 'if (confirm(\'' . esc_js( __( 'Are you sure you want to clear the ratings in this album?', 'wp-photo-album-plus' ) ) . '\')) { wppaRefreshAfter(); wppaAjaxUpdateAlbum( ' . $id . ', \'clear_ratings\', 0 ); }';
1859
+ wppa_echo( '
1860
+ <input
1861
+ type="button"
1862
+ class="wppa-admin-button button"
1863
+ onclick="' . $onc . '"
1864
+ value="' . esc_attr( __( 'Reset ratings', 'wp-photo-album-plus' ) ) . '"
1865
+ />' );
1866
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1867
 
1868
+ // Apply New photo desc
1869
+ if ( wppa_switch( 'apply_newphoto_desc') ) {
1870
+ $onc = 'if ( confirm(\'Are you sure you want to set the description of all photos to \n\n'.esc_js(wppa_opt( 'newphoto_description')).'\')) document.location=\''.wppa_ea_url($albuminfo['id'], 'edit').'&applynewdesc=1\'';
1871
+ wppa_echo( '
1872
+ <input
1873
+ type="button"
1874
+ class="wppa-admin-button button"
1875
+ onclick="' . $onc . '"
1876
+ value="' . esc_attr( __( 'Apply new photo desc', 'wp-photo-album-plus' ) ) . '"
1877
+ />' );
1878
+ }
1879
 
1880
+ // Remake all
1881
+ if ( wppa_user_is( 'administrator' ) ) {
1882
+ $onc = 'if ( confirm(\'Are you sure you want to remake the files for all photos in this album?\')) document.location=\''.wppa_ea_url($albuminfo['id'], 'edit').'&remakealbum=1\'';
1883
+ wppa_echo( '
1884
+ <input
1885
+ type="button"
1886
+ class="wppa-admin-button button"
1887
+ onclick="' . $onc . '"
1888
+ value="' . esc_attr( __( 'Remake all', 'wp-photo-album-plus' ) ) . '"
1889
+ />' );
1890
+ }
1891
 
1892
+ // Set all to pano
1893
+ if ( wppa_switch( 'enable_panorama' ) ) {
1894
 
1895
+ wppa_echo( '
1896
+ <input
1897
+ type="button"
1898
+ class="wppa-admin-button button"
1899
+ onclick="wppaTrySetAllPanorama(' . $albuminfo['id'] . ')"
1900
+ value="' . esc_attr( __( 'Set all to panorama', 'wp-photo-album-plus' ) ).':"
1901
+ />
1902
+ <select id="pano-opt"
1903
+ style="margin-top:6px;">
1904
+ <option value="9" disabled selected>' . __( 'Select a mode', 'wp-photo-album-plus' ) . '</option>
1905
+ <option value="0">' . __( '- none -', 'wp-photo-album-plus' ) . '</option>
1906
+ <option value="1">' . __( '360&deg; Spheric', 'wp-photo-album-plus' ) . '</option>
1907
+ <option value="2">' . __( 'Non 360&deg; Flat', 'wp-photo-album-plus' ) . '</option>
1908
+ </select>' );
1909
+ }
1910
 
1911
+ wppa_echo( '
1912
+ </div>
1913
+ </details>' );
1914
+ }
1915
 
1916
+ // End of outer details block
1917
+ wppa_echo( '
1918
+ </details>' );
1919
 
1920
+ /* Manage photos section */
1921
+ {
1922
+ wppa_echo( '
1923
+ <div class="wppa-table-wrap" style="margin-top:20px;clear:both;position:relative;">' );
1924
+
1925
+ wppa_echo( '<h2 style="padding-left:12px">' );
1926
+
1927
+ if ( wppa_get( 'bulk' ) )
1928
+ $result = __( 'Copy / move / delete / edit name / edit description / change status', 'wp-photo-album-plus' );
1929
+ elseif ( wppa_get( 'seq' ) )
1930
+ $result = __( 'Change sequence order by drag and drop', 'wp-photo-album-plus' );
1931
+ elseif ( wppa_get( 'quick' ) )
1932
+ $result = __( 'Edit photo information except copy and move', 'wp-photo-album-plus' );
1933
+ elseif ( is_numeric( wppa_get( 'edit-id' ) ) ) {
1934
+ $result = sprintf( __( 'Edit/Moderate photos from album %s by %s', 'wp-photo-album-plus' ),
1935
+ '<i>' . sanitize_text_field( wppa_get_album_name( $id ) ) . '</i>',
1936
+ '<i>' . sanitize_user( wppa_get_album_item( $id, 'owner' ) ) . '</i>' );
1937
+ }
1938
+ else $result = '';
1939
 
1940
+ $result .= '
1941
+ </h2>
1942
+ <div style="clear:both"></div>';
1943
+ wppa_echo( $result );
1944
 
1945
  if ( wppa_get( 'bulk' ) )
1946
  wppa_album_photos_bulk( $edit_id );
1949
  else
1950
  wppa_album_photos( $edit_id );
1951
 
1952
+ wppa_echo( '
1953
+ </div>
1954
+ </details>' );
1955
+ }
1956
 
1957
+ /* Footer of the page */
1958
+ wppa_echo( '
1959
  <br>
1960
  <a href="' . $back_url . '" >' .
1961
  $back_title .
1964
  <a href="#manage-photos">
1965
  <div style="position:fixed;right:30px;bottom:30px;background-color:lightblue;float:right" >&nbsp;' . __( 'Top of page', 'wp-photo-album-plus' ) . '&nbsp;</div>
1966
  </a>
1967
+ </div>' );
1968
+ } // End tab is Edit
 
1969
 
1970
  // Comment moderate
1971
  elseif ( wppa_get( 'tab' ) == 'cmod' ) {
2027
  </p>
2028
  <form name="wppa-del-form" action="' . esc_url( wppa_dbg_url( get_admin_url() . 'admin.php?page=wppa_admin_menu' ) ) . '" method="post">' .
2029
  wp_nonce_field( 'wppa-nonce', 'wppa-nonce' ) . '
2030
+ <h2>' .
2031
  __( 'What would you like to do with photos currently in the album?', 'wp-photo-album-plus' ) . '<br>
2032
  <input type="radio" name="wppa-del-photos" value="delete" checked="checked" />' . __( 'Delete', 'wp-photo-album-plus' ) . '<br>
2033
  <input type="radio" name="wppa-del-photos" value="move" />' . __( 'Move to:', 'wp-photo-album-plus' ) . '
2040
  'sort' => true,
2041
  ) ) . '
2042
  </select>
2043
+ </h2>
2044
 
2045
  <input
2046
  type="hidden"
2103
  }
2104
  $style = wppa_get_option('wppa_album_table_'.wppa_get_user(), 'flat');
2105
 
2106
+
2107
+
2108
+ /* The album admin table of albums page start */
2109
+ wppa_echo( '
2110
  <div class="wrap">' .
2111
  wppa_admin_spinner() . '
2112
+ <h1 class="wp-heading-inline">' . __( 'Manage Albums', 'wp-photo-album-plus' ) . '</h1>' );
2113
 
2114
  // The Create new album button
2115
  if ( wppa_can_create_top_album() ) {
2116
  $url = get_admin_url() . 'admin.php?page=wppa_admin_menu&tab=edit&edit-id=new&wppa-nonce=' . wp_create_nonce( 'wppa-nonce' );
2117
  $vfy = __( 'Are you sure you want to create a new album?', 'wp-photo-album-plus' );
2118
+ wppa_echo( '
2119
  <a
2120
  onclick="return confirm(\'' . $vfy . '\');"
2121
  href="' . $url . '"
2122
  class="page-title-action">' .
2123
  __( 'Add New', 'wp-photo-album-plus' ) . '
2124
+ </a>
2125
+ <br>' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2126
  }
2127
 
2128
+ /* The header buttons / sewlection boxes */
2129
+ {
2130
+ wppa_echo( '
2131
+ <div id="wppa-action-container">
2132
+ <div id="wppa-action-container-left">' );
2133
+
2134
+ // The switch to flat/collapsable button(s)
2135
+ if ( $style == 'flat' ) {
2136
+ wppa_echo( '
2137
+ <input
2138
+ type="button"
2139
+ class="button"
2140
+ onclick="document.location=\'' . wppa_dbg_url( get_admin_url() . 'admin.php?page=wppa_admin_menu&amp;switchto=collapsible' ) . '\'"
2141
+ value="' . esc_attr__( 'Switch to Collapsable table', 'wp-photo-album-plus' ) . '"
2142
+ />' );
2143
+ }
2144
+ else {
2145
+ wppa_echo( '
2146
+ <input
2147
+ type="button"
2148
+ class="button"
2149
+ onclick="document.location=\'' . wppa_dbg_url( get_admin_url() . 'admin.php?page=wppa_admin_menu&amp;switchto=flat ' ) . '\'"
2150
+ value="' . esc_attr__( 'Switch to Flat table', 'wp-photo-album-plus' ) . '"
2151
+ />' );
2152
+ }
 
 
 
 
 
 
2153
 
2154
+ // The open all/close all buttons
2155
+ if ( $style != 'flat' ) {
2156
+ wppa_echo( '
2157
+ <input
2158
+ type="button"
2159
+ class="button"
2160
+ id="wppa-open-all"
2161
+ onclick=" jQuery(\'#wppa-close-all\').css(\'display\',\'inline\');
2162
+ jQuery(this).css(\'display\',\'none\');
2163
+ jQuery(\'.wppa-alb-onoff\').css(\'display\',\'\');
2164
+ jQuery(\'.alb-arrow-off\').css(\'display\',\'\');
2165
+ jQuery(\'.alb-arrow-on\').css(\'display\',\'none\');
2166
+ "
2167
+ value="' . esc_attr__( 'Open all', 'wp-photo-album-plus' ) . '"
2168
  />
2169
+ <input
2170
+ type="button"
2171
+ class="button"
2172
+ id="wppa-close-all"
2173
+ onclick=" jQuery(\'#wppa-open-all\').css(\'display\',\'inline\');
2174
+ jQuery(this).css(\'display\',\'none\');
2175
+ jQuery(\'.wppa-alb-onoff\').css(\'display\',\'none\');
2176
+ jQuery(\'.alb-arrow-on\').css(\'display\',\'\');
2177
+ jQuery(\'.alb-arrow-off\').css(\'display\',\'none\');
2178
+ "
2179
+ value="' . esc_attr__( 'Close all', 'wp-photo-album-plus' ) . '"
2180
+ />' );
2181
+ }
2182
+
2183
+ wppa_echo( '
2184
+ </div>
2185
+ <div id= "wppa-action-container-right">' );
2186
+
2187
+ // Edit by id
2188
+ if ( wppa_has_many_albums() ) {
2189
+ wppa_echo( '
2190
+ <input
2191
+ id="wppa-edit-albid"
2192
+ type="number"
2193
+ min="1"
2194
+ placeholder="' . __( 'Album id', 'wp-photo-album-plus' ) . '"
2195
+ title="' . __( 'Enter the number of the album you want to edit', 'wp-photo-album-plus' ) . '"
2196
+ style="width:120px;cursor:pointer"
2197
+ />' );
2198
+ }
2199
+ else {
2200
+ $albids = $wpdb->get_col( "SELECT id FROM $wpdb->wppa_albums ORDER BY id" );
2201
+ if ( ! wppa_user_is( 'administrator' ) ) foreach( array_keys( $albids ) as $key ) {
2202
+ if ( ! wppa_have_access( $albids[$key] ) ) {
2203
+ unset( $albids[$key] );
2204
+ }
2205
+ }
2206
+ wppa_echo( '
2207
+ <select
2208
+ id="wppa-edit-albid"
2209
+ title="' . __( 'Select the number of the album you want to edit', 'wp-photo-album-plus' ) . '"
2210
+ styles="width:120px;cursor:pointer;vertical-align:baseline"
2211
+ />
2212
+ <option value="" selected disabled>' . __( 'Album id', 'wp-photo-album-plus' ) . '</option>' );
2213
+ foreach( $albids as $alb ) {
2214
+ wppa_echo( '<option value="' . $alb . '">' . $alb . '</option>' );
2215
+ }
2216
+ wppa_echo( '
2217
+ </select>' );
2218
+ }
2219
+ wppa_echo( '
2220
  <input
2221
  type="button"
2222
+ class="button"
2223
  value="' . __( 'Edit album', 'wp-photo-album-plus' ) . '"
2224
  onclick="wppaGoEditAlbNo();"
2225
+ />' );
2226
+
2227
+ // Filter by searchword
2228
+ $opts = $wpdb->get_col( "SELECT slug FROM $wpdb->wppa_index WHERE albums <> '' ORDER BY slug" );
2229
+ $f = wppa_get( 'filter' );
2230
+ wppa_echo( '
 
 
 
 
 
 
2231
  <select
2232
+ id="wppa-edit-filter"
2233
+ title="' . __( 'Select an album search word', 'wp-photo-album-plus' ) . '"
2234
+ >
2235
+ <option value="" selected disabled>' . __( 'Filter by', 'wp-photo-album-plus' ) . '</option>' );
2236
+ foreach( $opts as $opt ) {
2237
+ wppa_echo( '<option value="' . $opt . '"' . ( $f == $opt ? ' selected ' : '' ) . '>' . $opt . '</option>' );
 
2238
  }
2239
+ wppa_echo( '
2240
  </select>
2241
  <input
2242
  type="button"
2243
+ class="button"
2244
+ onclick="wppaGoApplyFilter();"
2245
+ value="' . __( 'Apply filter', 'wp-photo-album-plus' ) . '"
2246
+ />' );
2247
+ wppa_echo( '
2248
+ </div>
2249
+ </div>' );
2250
+ /* End header buttons / seecion boxes */
2251
  }
2252
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2253
  $the_js = '
2254
  function wppaGoEditAlbNo() {
2255
  var id = parseInt(document.getElementById("wppa-edit-albid").value);
2265
  function wppaGoApplyFilter() {
2266
  var filter = document.getElementById("wppa-edit-filter").value;
2267
  if(filter) {
2268
+ document.location.href="' . get_admin_url() . 'admin.php?page=wppa_admin_menu&switchto=flat&filter="+filter;
2269
  }
2270
  else {
2271
  alert("' . __( 'Please select a filter token', 'wp-photo-album-plus' ) . '");
2273
  };';
2274
  wppa_add_inline_script( 'wppa-admin', $the_js );
2275
 
 
 
2276
  // The table of existing albums
2277
+ if ( $style == 'flat' ) {
2278
+ wppa_admin_albums_flat();
2279
+ }
2280
+ else {
2281
+ wppa_admin_albums_collapsible();
2282
+ }
2283
 
2284
  wppa_echo( '<br>' );
2285
 
2590
 
2591
  }
2592
  else {
2593
+ wppa_echo( '<h2>' . __( 'No albums yet.', 'wp-photo-album-plus' ) . '</h2>' );
2594
  }
2595
  }
2596
 
2897
  wppa_add_inline_script( 'wppa-admin', $the_js );
2898
  }
2899
  else {
2900
+ wppa_echo( '<h2>' . __( 'No albums yet.', 'wp-photo-album-plus' ) . '</h2>' );
2901
  }
2902
  }
2903
 
3494
  }
3495
 
3496
  $result = '
3497
+ <h2 style="margin:1em">' .
3498
  __( 'Manage album order', 'wp-photo-album-plus' ) . '
3499
  -
3500
  <small>
wppa-photo-admin-autosave.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * edit and delete photos
6
- * Version 8.2.02.006
7
  *
8
  */
9
 
@@ -550,1894 +550,2199 @@ function wppaToggleExif( id, count ) {
550
  'cenlft' => __( 'center - left' , 'wp-photo-album-plus' ), 'cencen' => __( 'center - center' , 'wp-photo-album-plus' ), 'cenrht' => __( 'center - right' , 'wp-photo-album-plus' ),
551
  'botlft' => __( 'bottom - left' , 'wp-photo-album-plus' ), 'botcen' => __( 'bottom - center' , 'wp-photo-album-plus' ), 'botrht' => __( 'bottom - right' , 'wp-photo-album-plus' ), );
552
 
 
 
 
 
 
 
 
 
 
 
 
 
553
  // Album for moderate
554
  if ( $modalbum != $album && $album && ! wppa_get( 'just-edit' ) && wppa_get( 'edit-id' ) != 'trash' ) {
555
- wppa_echo( '<h1>' . sprintf( __( 'Edit/Moderate photos from album %s by %s', 'wp-photo-album-plus' ),
556
- '<i>' . sanitize_text_field( wppa_get_album_name( $album ) ) . '</i>',
557
- '<i>' . sanitize_user( wppa_get_album_item( $album, 'owner' ) ) . '</i>' ) . '</h1>' );
558
  $modalbum = $album;
559
  }
560
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
561
  // Anchor for scroll to
562
  wppa_echo( '<a id="photo_' . $id . '"></a>' );
563
 
564
- // The photo data
565
- wppa_echo( '
566
- <div
567
- id="photoitem-' . $id . '"
568
- class="wppa-table-wrap"
569
- style="width:100%"
570
- >' .
571
-
572
- // Photo specific nonce field
573
- '<input
574
- type="hidden"
575
- id="photo-nonce-' . $id . '"
576
- value="' . wp_create_nonce( 'wppa-nonce_' . $id ) . '"
577
- />' );
578
-
579
- // Section 1
580
  wppa_echo( '
581
- <table
582
- class="wppa-table wppa-photo-table"
583
- >
584
- <tbody>
585
- <tr>
586
- <td>' );
587
- // -- Preview thumbnail ---
588
- // If ImageMagick is enabled...
589
- // Fake 'for social media' to use the local file here, not cloudinary.
590
- // Files from cloudinary do not reload, even with ?ver=...
591
- if ( wppa_can_admin_magick( $id ) ) {
592
- wppa( 'for_sm', true );
593
- }
594
-
595
- $src = wppa_get_thumb_url( $id, false );
596
- $big = wppa_get_photo_url( $id, false );
597
-
598
- if ( wppa_can_admin_magick( $id ) ) {
599
- wppa( 'for_sm', false );
600
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
601
 
602
- if ( $is_video ) {
603
- reset( $is_video );
604
- $big = str_replace( 'xxx', current( $is_video ), $big );
605
- wppa_echo( '
606
- <a
607
- href="' . esc_attr( $big ) . '"
608
- target="_blank"
609
- title="' . esc_attr( __( 'Preview fullsize video' , 'wp-photo-album-plus' ) ) . '"
610
- >' .
611
- wppa_get_video_html( array( 'id' => $id,
612
- 'tagid' => 'video-' . $id,
613
  'width' => '160',
614
- 'height' => '160' * wppa_get_videoy( $id ) / wppa_get_videox( $id ),
615
- 'controls' => false,
616
- 'use_thumb' => true
617
- ) ) . '
618
- </a>' );
619
- }
620
- else {
621
- if ( $has_audio ) {
622
- $src = wppa_get_thumb_url( $id );
623
- $big = wppa_get_photo_url( $id );
624
- }
625
- wppa_echo( '
626
- <a
627
- id="thumba-' . $id . '"
628
- href="' . esc_attr( $big ) . '"
629
- target="_blank"
630
- title="' . esc_attr( __( 'Preview fullsize photo', 'wp-photo-album-plus' ) ) . '"
631
- >
632
- <img
633
- id="thumburl-' . $id . '"' .
634
- ( wppa_lazy() && $count > '1' ? ' data-' : ' ' ) . 'src="' . esc_url( $src ) . '"
635
- alt="' . esc_attr( $name ) . '"
636
- style="max-width:160px;vertical-align:middle"
637
- />
638
- </a>' );
639
 
640
- if ( $has_audio ) {
641
- $audio = wppa_get_audio_html( array( 'id' => $id,
642
- 'tagid' => 'audio-' . $id,
643
- 'width' => '160',
644
- 'controls' => true
645
- ) );
646
- wppa_echo( '
647
- <br>' .
648
- ( $audio ? $audio :
649
- '<span style="color:red">' .
650
- esc_html__( 'Audio disabled', 'wp-photo-album-plus' ) .
651
- '</span>' ) );
652
- }
653
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
654
  wppa_echo( '
655
- </td>' );
656
-
657
- if ( wppa_is_phone() ) {
658
- wppa_echo( '</tr><tr>' );
 
 
 
 
659
  }
660
 
661
- // --- More or less static data ---
 
 
 
 
 
 
662
  wppa_echo( '
663
- <td>' .
 
 
 
 
 
 
 
 
664
 
665
- // ID
666
- 'ID = ' . strval( intval( $id ) ) . '. ' .
 
 
 
 
 
 
 
 
 
 
 
 
 
667
 
668
- // Crypt
669
- __( 'Crypt:', 'wp-photo-album-plus' ) . ' ' . htmlspecialchars( $crypt ) . '. ' . $br .
 
 
 
 
 
 
 
 
 
 
670
 
671
- // Filename
672
- __( 'Filename:', 'wp-photo-album-plus' ) . ' ' . htmlspecialchars( $filename ) . '. ' . $br .
 
 
 
 
 
 
 
 
 
 
 
 
673
 
674
- // Upload
675
- __( 'Upload:', 'wp-photo-album-plus' ) . ' ' . htmlspecialchars( wppa_local_date( '', $timestamp ) ) . ' ' .
676
- __( 'local time', 'wp-photo-album-plus' ) . '. ' ) . $br;
 
 
 
 
 
 
 
 
 
677
 
678
- // Owner
679
- if ( $owner_editable ) {
680
- wppa_echo(
681
- __( 'Owned by:', 'wp-photo-album-plus' ) . '
682
- <input
683
- type="text"
684
- onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'owner\', this.value )"
685
- value="' . esc_attr( $owner ) . '"
686
- />' . $br );
687
- }
688
- else {
689
- wppa_echo( __( 'By:', 'wp-photo-album-plus' ) . ' ' . htmlspecialchars( $owner ) . '.' . $br );
690
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
691
 
692
- // Album
693
- $deleted = false;
694
- if ( $album <= '-9' ) {
695
- $album = - ( $album + '9' );
696
- $deleted = true;
697
- }
698
- wppa_echo( sprintf( __( 'Album: %d (%s).', 'wp-photo-album-plus' ), strval( intval( $album ) ), htmlspecialchars( wppa_get_album_name( $album ) ) ) . $br );
 
 
 
 
 
 
699
 
700
- // Modified
701
- if ( $deleted ) {
702
- wppa_echo( '
703
- <span style="color:red">' .
704
- __( 'Trashed', 'wp-photo-album-plus' ) . '
705
- </span>' );
706
- }
707
- else {
708
- if ( $modified > $timestamp ) {
709
- wppa_echo(
710
- __( 'Modified:', 'wp-photo-album-plus' ) . '
711
- <span id="modified-' . $id . '">' .
712
- wppa_local_date( '', $modified ) . '
713
- </span>' .
714
- __( 'local time', 'wp-photo-album-plus' ) );
715
- }
716
- else {
717
- wppa_echo( __( 'Not modified', 'wp-photo-album-plus' ) );
718
- }
719
- }
720
- wppa_echo( '.' . $br );
721
 
722
- // Exif
723
- wppa_echo( __( 'EXIF Date:', 'wp-photo-album-plus' ) );
724
- if ( wppa_user_is( 'administrator' ) ) { // Admin may edit exif date
725
- wppa_echo( '
726
- <input
727
- type="text"
728
- style="width:125px"
729
- onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'exifdtm\', this.value)"
730
- value="' . esc_attr( $exifdtm ) . '"
731
- />' );
732
- }
733
- else {
734
- wppa_echo( esc_html( $exifdtm ) . '.' );
735
- }
736
- wppa_echo( $br );
737
 
738
- // Location
739
- if ( $photo['location'] || wppa_switch( 'geo_edit' ) ) {
740
- wppa_echo(
741
- __( 'Location:' , 'wp-photo-album-plus' ) . ' ' );
742
- $loc = $location ? $location : '///';
743
- $geo = explode( '/', $loc );
 
 
 
 
 
 
744
 
745
- wppa_echo( esc_html( $geo['0'].' '.$geo['1'].'. ' ) );
 
 
 
 
 
 
 
 
 
 
 
746
 
747
- if ( wppa_switch( 'geo_edit' ) ) {
748
- wppa_echo(
749
- __( 'Lat:', 'wp-photo-album-plus' ) . '
750
- <input
751
- type="text"
752
- style="width:100px"
753
- id="lat-' . $id . '"
754
- onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'lat\', this.value)"
755
- value="' . esc_attr( $geo['2'] ) . '"
756
- />' .
757
- __( 'Lon:', 'wp-photo-album-plus' ) . '
758
- <input type="text"
759
- style="width:100px"
760
- id="lon-' . $id . '"
761
- onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'lon\', this.value)"
762
- value="' . esc_attr( $geo['3'] ) . '"
763
- />' . $br );
764
- }
765
- }
 
766
 
767
- // Changeable p_order
768
- wppa_echo( __( 'Photo sort order #:', 'wp-photo-album-plus' ) );
769
- if ( $sortby_orderno && ( ! wppa_switch( 'porder_restricted' ) || wppa_user_is( 'administrator' ) ) ) {
770
- wppa_echo( '
771
- <input
772
- type="text"
773
- id="porder-' . $id . '"
774
- value="' . esc_attr( $p_order ) . '"
775
- style="width:30px"
776
- onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'p_order\', this.value)"
777
- />' . $br );
778
- }
779
- else {
780
- wppa_echo( ' ' . $p_order . '.' . $br );
781
- }
782
 
783
- // Rating
784
- $entries = wppa_get_rating_count_by_id( $id );
785
- if ( $entries ) {
786
 
787
- if ( wppa_opt( 'rating_display_type' ) == 'likes' ) {
788
- wppa_echo( __( 'Likes:', 'wp-photo-album-plus' ) . ' ' . strval( intval( $entries ) ) . '.' . $br );
789
- }
790
- else {
791
- wppa_echo(
792
- __( 'Rating:', 'wp-photo-album-plus' ) . ' ' .
793
- __( 'Entries:', 'wp-photo-album-plus' ) . ' ' . strval( intval( $entries ) ) .
794
- ', ' .
795
- __( 'Mean value:', 'wp-photo-album-plus' ) .
796
- ' ' .
797
- wppa_get_rating_by_id( $id, 'nolabel' ) .
798
- '.' . $br );
799
- }
800
- }
801
- else {
802
- wppa_echo( __( 'No ratings for this photo.', 'wp-photo-album-plus' ) . $br );
803
- }
804
- $dislikes = wppa_dislike_get( $id );
805
- if ( $dislikes ) {
806
- wppa_echo(
807
- '<span style="color:red">' .
808
- sprintf( _n( 'Disliked by %d visitor', 'Disliked by %d visitors', $dislikes, 'wp-photo-album-plus' ), $dislikes ) . '. ' .
809
- '</span>' . $br );
810
- }
811
- $pending = wppa_pendrat_get( $id );
812
- if ( $pending ) {
813
- wppa_echo(
814
- '<span style="color:orange">' .
815
- sprintf( __( '%d pending votes.', 'wp-photo-album-plus' ), $pending ) . ' ' .
816
- '</span>' . $br );
817
- }
818
 
819
- // Views
820
- if ( wppa_switch( 'track_viewcounts' ) ) {
821
- wppa_echo(
822
- __( 'Views' , 'wp-photo-album-plus' ) . ': ' .
823
- htmlspecialchars( $views ) .
824
- '.' . $br );
825
- }
 
 
 
 
 
 
 
826
 
827
- // Clicks
828
- if ( wppa_switch( 'track_clickcounts' ) ) {
829
- wppa_echo(
830
- __( 'Clicks', 'wp-photo-album-plus' ) . ': ' .
831
- htmlspecialchars( $clicks ) .
832
- '.' . $br );
833
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
834
 
835
- // Downloads
836
- wppa_echo(
837
- __( 'Downloads', 'wp-photo-album-plus' ) . ': ' .
838
- htmlspecialchars( $dlcount ) .
839
- '.' . $br );
840
-
841
- // Status
842
- wppa_echo( '<br>' .
843
- __( 'Status:' , 'wp-photo-album-plus' ) . ' ' );
844
- if ( ( current_user_can( 'wppa_admin' ) || current_user_can( 'wppa_moderate' ) ) ) {
845
- if ( wppa_switch( 'ext_status_restricted' ) && ! wppa_user_is( 'administrator' ) ) {
846
- $dis = ' disabled';
847
- }
848
- else {
849
- $dis = '';
 
 
 
 
 
 
 
850
  }
851
- $sel = ' selected';
852
- wppa_echo( '
853
- <select
854
- id="status-' . $id . '"
855
- onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'status\', this.value); wppaPhotoStatusChange( ' . $id . ' )">
856
- <option value="pending"' . ( $status == 'pending' ? $sel : '' ) . ' >' .
857
- __( 'Pending', 'wp-photo-album-plus' ) . '
858
- </option>
859
- <option value="publish"' . ( $status =='publish' ? $sel : '' ) . ' >' .
860
- __( 'Publish', 'wp-photo-album-plus' ) . '
861
- </option>
862
- <option value="featured"' . ( $status == 'featured' ? $sel : '' ) . $dis . ' >' .
863
- __( 'Featured', 'wp-photo-album-plus' ) . '
864
- </option>
865
- <option value="gold"' . ( $status == 'gold' ? $sel : '' ) . $dis . ' >' .
866
- __( 'Gold', 'wp-photo-album-plus' ) . '
867
- </option>
868
- <option value="silver"' . ( $status == 'silver' ? $sel : '' ) . $dis . ' >' .
869
- __( 'Silver', 'wp-photo-album-plus' ) . '
870
- </option>
871
- <option value="bronze"' . ( $status == 'bronze' ? $sel : '' ) . $dis . ' >' .
872
- __( 'Bronze', 'wp-photo-album-plus' ) . '
873
- </option>
874
- <option value="scheduled"' . ( $status == 'scheduled' ? $sel : '' ) . $dis . ' >' .
875
- __( 'Scheduled', 'wp-photo-album-plus' ) . '
876
- </option>
877
- <option value="private"' . ( $status == 'private' ? $sel : '' ) . $dis . ' >' .
878
- __( 'Private', 'wp-photo-album-plus' ) . '
879
- </option>
880
- </select>' .
881
- wppa_get_date_time_select_html( 'photo', $id, true ) );
882
- }
883
- else {
884
- wppa_echo( '
885
- <input
886
- type="hidden"
887
- id="status-' . $id . '"
888
- value="' . esc_attr( $status ) . '"
889
- />' );
890
- if ( $status == 'pending' ) $s = __( 'Pending', 'wp-photo-album-plus' );
891
- elseif ( $status == 'publish' ) $s = __( 'Publish', 'wp-photo-album-plus' );
892
- elseif ( $status == 'featured' ) $s = __( 'Featured', 'wp-photo-album-plus' );
893
- elseif ( $status == 'gold' ) $s = __( 'Gold', 'wp-photo-album-plus' );
894
- elseif ( $status == 'silver' ) $s = __( 'Silver', 'wp-photo-album-plus' );
895
- elseif ( $status == 'bronze' ) $s = __( 'Bronze', 'wp-photo-album-plus' );
896
- elseif ( $status == 'scheduled' ) $s = __( 'Scheduled', 'wp-photo-album-plus' );
897
- elseif ( $status == 'private' ) $s = __( 'Private', 'wp-photo-album-plus' );
898
- wppa_echo( $s .
899
- wppa_get_date_time_select_html( 'photo', $id, false ) . '
900
- <span id="psdesc-' . $id . '" class="description" style="display:none">' .
901
- __( 'Note: Featured photos should have a descriptive name; a name a search engine will look for!', 'wp-photo-album-plus' ) . '
902
- </span>' );
903
- }
904
- wppa_echo( $br );
905
-
906
- // Schedule for delete
907
- if ( wppa_user_is( 'administrator' ) || $owner == wppa_get_user() ) {
908
- $may_change = wppa_user_is( 'administrator' ) || current_user_can( 'wppa_moderate' );
909
-
910
- wppa_echo(
911
- __( 'Delete at', 'wp-photo-album-plus' ) . '
912
- <input
913
- type="checkbox"
914
- id="scheduledel-' . $id . '"' .
915
- ( $scheduledel ? ' checked' : '' ) .
916
- ( $may_change ? '' : ' disabled' ) . '
917
- onchange="wppaTryScheduledel( ' . $id . ' )"
918
- /> ' .
919
- wppa_get_date_time_select_html( 'delphoto', $id, $may_change ) . $br );
920
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
921
 
922
- // Update status field
923
- wppa_echo(
924
- __( 'Remark:', 'wp-photo-album-plus' ) . '
925
- <span
926
- id="remark-' . $id . '"
927
- style="font-weight:bold;color:#00AA00">' .
928
- ( $is_video ? sprintf( __( 'Video %s is not modified yet', 'wp-photo-album-plus' ), $id ) :
929
- sprintf( __( 'Photo %s is not modified yet', 'wp-photo-album-plus' ), $id ) ) . '
930
- </span>' );
931
-
932
- // New Line
933
- wppa_echo( $br . '<br>' );
934
-
935
- // --- Available files ---
936
- wppa_echo(
937
- __( 'Available files:', 'wp-photo-album-plus' ) . $br );
938
-
939
- // Pdf
940
- if ( wppa_is_pdf( $id ) ) {
941
- $sp = wppa_get_source_path( $id );
942
- $fs = wppa_get_filesize( $sp );
943
- wppa_echo( __( 'Document file:', 'wp-photo-album-plus' ) . ' ' . $fs . ' ' );
944
- }
945
 
946
- // Source
947
- wppa_echo( __( 'Source file:', 'wp-photo-album-plus' ) . ' ' );
948
- $sp = wppa_get_o1_source_path( $id );
949
- if ( ! wppa_is_file( $sp ) ) {
950
- $sp = wppa_get_source_path( $id );
951
- }
952
- if ( wppa_is_pdf( $id ) ) {
953
- $sp = wppa_strip_ext( $sp ) . '.jpg';
954
- if ( ! wppa_is_file( $sp ) ) {
955
- $sp = wppa_strip_ext( $sp ) . '.png';
956
- }
957
- }
958
- if ( is_file( $sp ) ) {
959
- $ima = getimagesize( $sp );
960
- wppa_echo(
961
- $ima['0'] . ' x ' . $ima['1'] . ' (' . sprintf('%4.2fMp', ( $ima['0'] * $ima['1'] ) / ( 1024 * 1024 ) ) . ') ' .
962
- wppa_get_filesize( $sp ) . '.' . $br );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
963
  }
964
  else {
965
- wppa_echo( __( 'Unavailable', 'wp-photo-album-plus' ) . '.' . $br );
 
 
966
  }
 
 
 
 
 
 
 
 
 
 
967
 
968
- // Display
969
- wppa_echo(
970
- ( $is_video || $has_audio ? __( 'Poster file:', 'wp-photo-album-plus' ) : __( 'Display file:', 'wp-photo-album-plus' ) ) . ' ' );
971
- $dp = wppa_get_photo_path( $id );
972
- if ( is_file( $dp ) ) {
973
- wppa_echo( '
974
- <span id="photox-' . $id . '">' . wppa_get_photox( $id ) . '</span> x
975
- <span id="photoy-' . $id . '">' . wppa_get_photoy( $id ) . '</span>
976
- <span id="photofilesize-' . $id . '">' . wppa_get_filesize( $dp ) . '</span>.' . $br );
977
- }
978
- else {
979
- wppa_echo( '
980
- <span style="color:red">' .
981
- __( 'Unavailable', 'wp-photo-album-plus' ) . '.
982
- </span>.' . $br );
983
- }
984
 
985
- // Thumbnail
986
- if ( ! $is_video ) {
987
- wppa_echo( __( 'Thumbnail file:', 'wp-photo-album-plus' ) . ' ' );
988
- $tp = wppa_get_thumb_path( $id );
989
- if ( is_file( $tp ) ) {
990
- wppa_echo( '
991
- <span id="thumbx-' . $id . '">' . wppa_get_thumbx( $id ) . '</span> x
992
- <span id="thumby-' . $id . '">' . wppa_get_thumby( $id ) . '</span>
993
- <span id="thumbfilesize-' . $id . '">' . wppa_get_filesize( $tp ) . '</span>.
994
- <input
995
- type="checkbox"' .
996
- ( $thumblock ? ' checked' : '' ) . '
997
- onchange="wppaAjaxUpdatePhoto( ' . strval( intval( $id ) ) . ', \'thumblock\', jQuery(this).prop(\'checked\') ? 1 : 0 )" /> ' .
998
- __( 'Locked', 'wp-photo-album-plus' ) . '.' . $br );
999
- }
1000
- else {
1001
- wppa_echo( '
1002
- <span style="color:red">' .
1003
- __( 'Unavailable', 'wp-photo-album-plus' ) . '.
1004
- </span>.' . $br );
1005
- }
1006
- }
1007
 
1008
- wppa_echo( $br );
1009
-
1010
- // Local CDN
1011
- if ( wppa_cdn( 'admin' ) == 'local' ) {
1012
- wppa_echo( __( 'Local CDN files', 'wp-photo-album-plus' ) . ':<span id="cdnfiles-' . $id . '">' . $br );
1013
- $files = wppa_cdn_files( $id );
1014
- if ( is_array( $files ) ) {
1015
- foreach( $files as $file ) {
1016
- if ( basename( $file ) != 'index.php' ) {
1017
- $t = explode( '.', basename( $file ) );
1018
- $t = explode( '-', $t[0] );
1019
- $x = $t[0];
1020
- $y = $t[1];
1021
- $size = filesize( $file );
1022
- wppa_echo( '
1023
- <a
1024
- href="' . wppa_cdn_url( $id, $x, $y ) . '"
1025
- target="_blank"
1026
- >' .
1027
- basename( $file ) .
1028
- '</a> ' .
1029
- sprintf( '%4.2fkB', $size / 1024 ) . $br );
1030
- }
1031
- }
1032
- }
1033
- wppa_echo( '</span>' );
1034
- }
1035
 
1036
- // New line
1037
- wppa_echo( '<br>' );
 
 
 
 
 
 
 
 
 
 
 
1038
 
1039
- // Video
1040
- if ( $b_is_video ) {
1041
- wppa_echo(
1042
- __( 'Video size:', 'wp-photo-album-plus' ) . ' ' .
1043
- __( 'Width:', 'wp-photo-album-plus' ) . '
1044
- <input
1045
- style="width:50px;margin:0 4px"
1046
- onchange="wppaAjaxUpdatePhoto( ' . strval( intval( $id ) ) . ', \'videox\', this.value)"
1047
- value="' . esc_attr( $videox ) . '"
1048
- />' .
1049
- sprintf( __( 'pix, (0=default:%s)', 'wp-photo-album-plus' ), wppa_opt( 'video_width' ) ) .
1050
- __( 'Height:', 'wp-photo-album-plus' ) . '
1051
- <input
1052
- style="width:50px;margin:0 4px"
1053
- onchange="wppaAjaxUpdatePhoto( ' . strval( intval( $id ) ) . ', \'videoy\', this.value)"
1054
- value="' . esc_attr( $videoy ) . '"
1055
- />' .
1056
- sprintf( __( 'pix, (0=default:%s)', 'wp-photo-album-plus' ), wppa_opt( 'video_height' ) ) .
1057
- '. ' );
1058
-
1059
- if ( $duration ) {
1060
- $duration = intval( $duration * 100 ) / 100;
1061
- if ( $duration < 120.0 ) {
1062
- wppa_echo( sprintf( __( 'Duration: %s seconds', 'wp-photo-album-plus' ) ,$duration ) . '. ' );
1063
- }
1064
- else {
1065
- wppa_echo( sprintf( __( 'Duration: %s minutes and %s seconds', 'wp-photo-album-plus' ),
1066
- sprintf( '%d', floor( $duration / 60 ) ),
1067
- sprintf( '%4.2f', $duration % 60 ) ) .
1068
- '. ' );
1069
- }
1070
- }
1071
 
1072
- wppa_echo( __( 'Formats:', 'wp-photo-album-plus' ) . ' ' );
1073
- $c = 0;
1074
- foreach ( $is_video as $fmt ) {
1075
- wppa_echo(
1076
- $fmt . ' ' .
1077
- __( 'Filesize:', 'wp-photo-album-plus' ) . ' ' .
1078
- wppa_get_filesize( str_replace( 'xxx', $fmt, wppa_get_photo_path( $id, false ) ) ) );
1079
- $c++;
1080
- if ( is_array( $is_video ) && $c == count( $is_video ) ) {
1081
- wppa_echo( '. ' );
1082
- }
1083
- else {
1084
- wppa_echo( ', ' );
1085
- }
1086
- }
1087
- }
1088
- wppa_echo( $br );
1089
-
1090
- // Audio
1091
- if ( $b_has_audio ) {
1092
- wppa_echo( __( 'Formats:', 'wp-photo-album-plus' ) . ' ' );
1093
- $c = 0;
1094
- foreach ( $has_audio as $fmt ) {
1095
- wppa_echo(
1096
- $fmt . ' ' .
1097
- __( 'Filesize:', 'wp-photo-album-plus' ) . ' ' .
1098
- wppa_get_filesize( str_replace( 'xxx', $fmt, wppa_get_photo_path( $id, false ) ) ) );
1099
- $c++;
1100
- if ( is_array( $is_video ) && $c == count( $is_video ) ) {
1101
- wppa_echo( '. ' );
1102
- }
1103
- else {
1104
- wppa_echo( ', ' );
1105
- }
1106
- }
1107
- }
1108
 
 
 
1109
  wppa_echo( '
1110
- </td>
1111
- </tr>
1112
- </tbody>
1113
- </table>' );
 
 
 
 
 
 
 
 
 
1114
 
1115
- wppa_echo( '<!-- Section 2 -->' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1116
 
1117
- if ( ( wppa_switch( 'enable_stereo' ) && ! $is_multi ) ||
1118
- ( wppa_switch( 'enable_panorama' ) ) ||
1119
- ( is_file( wppa_get_photo_path( $id ) ) && wppa_switch( 'watermark_on' ) )
1120
- ) {
1121
- wppa_echo( '
1122
- <table
1123
- class="wppa-table wppa-photo-table"
1124
- style="width:100%"
1125
- >
1126
- <tbody>
1127
- <tr>
1128
- <td>' );
1129
-
1130
- // Stereo
1131
- if ( wppa_switch( 'enable_stereo' ) && ! $is_multi ) {
1132
- wppa_echo(
1133
- __( 'Stereophoto:', 'wp-photo-album-plus' ) . '
1134
- <select
1135
- id="stereo-' . $id . '"
1136
- onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'stereo\', this.value, true)"
1137
- >
1138
- <option value="0"' . ( $stereo == '0' ? ' selected' : '' ) . '>' .
1139
- __( 'no stereo image or ready anaglyph', 'wp-photo-album-plus' ) . '
1140
- </option>
1141
- <option value="1"' . ( $stereo == '1' ? ' selected' : '' ) . '>' .
1142
- __( 'Left - right stereo image', 'wp-photo-album-plus' ) . '
1143
- </option>
1144
- <option value="-1"' . ( $stereo == '-1' ? ' selected' : '' ) . '>' .
1145
- __( 'Right - left stereo image', 'wp-photo-album-plus' ) . '
1146
- </option>
1147
- </select>' .
1148
- $br .
1149
- __( 'Images:', 'wp-photo-album-plus' ) . ' ' );
1150
 
1151
- $files = wppa_glob( WPPA_UPLOAD_PATH . '/stereo/' . $id . '-*.*' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1152
 
1153
- if ( empty( $files ) ) {
1154
- wppa_echo( __( 'None', 'wp-photo-album-plus' ) . '. ' );
1155
- }
1156
- else {
1157
- sort( $files );
1158
- $c = 0;
1159
- foreach ( $files as $file ) {
1160
- wppa_echo( '
1161
- <a href="' . str_replace( WPPA_UPLOAD_PATH, WPPA_UPLOAD_URL, $file ) . '" target="_blank">' .
1162
- basename( $file ) . '
1163
- </a>' );
1164
- $c++;
1165
- if ( $c == count( $files ) ) {
1166
- wppa_echo( '. ' );
1167
- }
1168
- else {
1169
- wppa_echo( ', ' );
1170
- }
1171
- }
1172
- }
1173
- wppa_echo( $br );
1174
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1175
 
1176
- // Panorama
1177
- if ( wppa_switch( 'enable_panorama' ) && ! $b_is_video ) {
1178
- $can_panorama = $photoy && $photox / $photoy >= 1.999;
1179
- if ( $can_panorama ) {
1180
- wppa_echo(
1181
- __( 'Panorama' ) . ':
1182
- <select onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'panorama\', this.value, true )">
1183
- <option value="0"' . ( $panorama == '0' ? ' selected' : '' ) . '>' . __( '- none -', 'wp-photo-album-plus' ) . '</option>
1184
- <option value="1"' . ( $panorama == '1' ? ' selected' : '' ) . '>' . __( '360&deg; Spheric', 'wp-photo-album-plus' ) . '</option>
1185
- <option value="2"' . ( $panorama == '2' ? ' selected' : '' ) . '>' . __( 'Non 360&deg; Flat', 'wp-photo-album-plus' ) . '</option>
1186
- </select>' );
1187
-
1188
- $source_file = wppa_get_source_path( $id );
1189
- if ( wppa_is_file( $source_file ) ) {
1190
- $source_file_sizes = wppa_getimagesize( $source_file );
1191
-
1192
- if ( $panorama == '1' && $source_file_sizes[0] / $source_file_sizes[1] > 2.001 ) {
1193
- wppa_echo(
1194
- '. ' . __( 'Make 360 from', 'wp-photo-album-plus' ) . ': ' . '
1195
- <select
1196
- onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'make360\', this.value, true)"
1197
- title="' . esc_attr( __( 'Select the closest angle you originally made the panorama', 'wp-photo-album-plus' ) ) . '"
1198
- >
1199
- <option value="">'.__('Select', 'wp-photo-album-plus' ).'</option>' );
1200
- $t = array( 120, 150, 180, 210, 240, 270, 300, 330, 340, 350, 360, 370, 380, 390, 400, 410, 420, 430, 440, 450 );
1201
- foreach( $t as $v ) {
1202
- wppa_echo( '<option value="'.$v.'" '.($v==$angle?'selected':'').'>'.$v.'&deg;</option>' );
1203
- }
1204
- wppa_echo( '
1205
- <option value="0">' . __( 'Undo', 'wp-photo-album-plus' ) . '</option>
1206
- </select>' );
1207
- }
1208
- }
1209
- }
1210
- else {
1211
- wppa_echo( __( 'Too narrow for panorama.', 'wp-photo-album-plus' ) );
1212
- }
1213
- wppa_echo( $br );
1214
- }
1215
 
1216
- // Watermark
1217
- if ( wppa_switch( 'watermark_on' ) ) {
1218
 
1219
- // Get the current watermark file settings
1220
- $temp = wppa_get_water_file_and_pos( $id );
1221
- $wmfile = isset( $temp['file'] ) ? $temp['file'] : '';
1222
- $wmpos = isset( $temp['pos'] ) && isset ( $wms[$temp['pos']] ) ? $wms[$temp['pos']] : '';
1223
 
1224
- $user = wppa_get_user();
1225
- $has_source = wppa_is_file( wppa_get_source_path( $id ) );
1226
- $can_remove = ( wppa_opt( 'watermark_file' ) == '--- none ---' ) ? '1' : '0';
1227
- if ( wppa_switch( 'watermark_user' ) || current_user_can( 'wppa_settings' ) ) {
1228
- wppa_echo( ' ' . __( 'Watermark:', 'wp-photo-album-plus' ) . ' ' );
1229
- wppa_echo( '
1230
- <select
1231
- id="wmfsel_' . $id . '"
1232
- onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'wppa_watermark_file_' . $user . '\', this.value)"
1233
- >' .
1234
- wppa_watermark_file_select( 'user', $album ) . '
1235
- </select>' .
1236
- __( 'Pos:', 'wp-photo-album-plus' ) . '
1237
- <select
1238
- id="wmpsel_' . $id . '"
1239
- onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'wppa_watermark_pos_' . $user . '\', this.value)"
1240
- >' .
1241
- wppa_watermark_pos_select( 'user', $album ) . '
1242
- </select>
1243
- <input
1244
- type="button"
1245
- class="wppa-admin-button"
1246
- value="' . esc_attr( __( 'Apply watermark', 'wp-photo-album-plus' ) ) . '"
1247
- onclick="wppaTryWatermark( ' . $id . ', ' . $has_source . ', ' . $can_remove . ' )"
1248
- />
1249
- <img
1250
- id="wppa-water-spin-' . $id . '"
1251
- src="' . wppa_get_imgdir() . 'spinner.gif"
1252
- alt="Spin"
1253
- style="visibility:hidden"
1254
- />' );
1255
- }
1256
- elseif ( basename( $wmfile ) != '--- none ---' ) {
1257
- wppa_echo(
1258
- __( 'Watermark:', 'wp-photo-album-plus' ) . ' ' .
1259
- __( 'File:', 'wp-photo-album-plus' ) . ' ' . strip_tags( basename( $wmfile ) ) . ' ' .
1260
- __( 'Pos:', 'wp-photo-album-plus' ) . ' ' . strip_tags( $wmpos ) );
1261
- }
1262
- wppa_echo( $br );
1263
  }
 
 
 
 
 
 
 
 
1264
 
 
 
 
 
1265
  wppa_echo( '
1266
- </td>
1267
- </tr>
1268
- </tbody>
1269
- </table>' );
1270
- }
1271
-
1272
-
1273
- wppa_echo( '
1274
- <!-- Section 3 -->
1275
- <table
1276
- class="wppa-table wppa-photo-table"
1277
- style="width:100%">
1278
- <tbody>
1279
- <tr>
1280
- <td>' );
1281
 
1282
- // --- Actions ---
 
 
1283
 
1284
- // Rotate
1285
- if ( ! $b_is_video ) {
1286
- if ( ! wppa_can_admin_magick( $id ) ) {
1287
  wppa_echo( '
1288
- <input
1289
- type="button"
1290
- class="wppa-admin-button"
1291
- onclick="wppaTryRotLeft( ' . $id . ' )"
1292
- value="' . esc_attr( __( 'Rotate left', 'wp-photo-album-plus' ) ) . '"
1293
- />
1294
- <input
1295
- type="button"
1296
- class="wppa-admin-button"
1297
- onclick="wppaTryRot180( ' . $id . ' )"
1298
- value="' . esc_attr( __( 'Rotate 180&deg;', 'wp-photo-album-plus' ) ) . '"
1299
- />
1300
- <input
1301
- type="button"
1302
- class="wppa-admin-button"
1303
- onclick="wppaTryRotRight( ' . $id . ' )"
1304
- value="' . esc_attr( __( 'Rotate right', 'wp-photo-album-plus' ) ) . '"
1305
- />
1306
- <input
1307
- type="button"
1308
- class="wppa-admin-button"
1309
- onclick="wppaTryFlip( ' . $id . ' )"
1310
- value="' . esc_attr( __( 'Flip', 'wp-photo-album-plus' ) ) . '&thinsp;&#8212;"
1311
- />
1312
- <input
1313
- type="button"
1314
- class="wppa-admin-button"
1315
- onclick="wppaTryFlop( ' . $id . ' )"
1316
- value="' . esc_attr( __( 'Flip', 'wp-photo-album-plus' ) ) . ' |"
1317
- />' );
1318
  }
1319
  }
 
 
1320
 
1321
- // Remake displayfiles
1322
- if ( ! $is_video ) {
1323
- wppa_echo( '
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1324
  <input
1325
  type="button"
1326
- class="wppa-admin-button"
1327
- title="' . esc_attr( __( 'Remake display file and thumbnail file', 'wp-photo-album-plus' ) ) . '"
1328
- onclick="wppaAjaxUpdatePhoto( ' . $id . ', \'remake\', 0 )"
1329
- value="' . esc_attr( __( 'Remake files', 'wp-photo-album-plus' ) ) . '"
1330
- />' );
1331
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1332
 
1333
- // Remake thumbnail
1334
- if ( ! $is_video ) {
1335
- wppa_echo( '
 
 
 
 
 
 
1336
  <input
1337
- type="button"
1338
- class="wppa-admin-button"
1339
- title="' . esc_attr( __( 'Remake thumbnail file', 'wp-photo-album-plus' ) ) . '"
1340
- onclick="wppaAjaxUpdatePhoto( ' . $id . ', \'remakethumb\', 0 )"
1341
- value="' . esc_attr( __( 'Remake thumbnail file', 'wp-photo-album-plus' ) ) . '"
1342
- />' );
1343
- }
 
 
 
1344
 
1345
- // Move/copy
1346
- if ( ! $quick ) {
1347
-
1348
- $max = wppa_opt( 'photo_admin_max_albums' );
1349
- if ( ! $max || wppa_get_total_album_count() < $max ) {
1350
-
1351
- // If not done yet, get the album options html with the current album excluded
1352
- if ( ! isset( $album_select[$album] ) ) {
1353
- $album_select[$album] = wppa_album_select_a( array( 'checkaccess' => true,
1354
- 'path' => true,
1355
- 'exclude' => $album,
1356
- 'selected' => '0',
1357
- 'addpleaseselect' => true,
1358
- 'sort' => true,
1359
- )
1360
- );
1361
- }
1362
 
1363
- wppa_echo(
1364
- __( 'Target album for copy/move:', 'wp-photo-album-plus' ) . '
1365
- <select
1366
- id="target-' . $id . '"
1367
- style="max-width:350px">' .
1368
- $album_select[$album] . '
1369
- </select>' . $br );
1370
- }
1371
- else {
1372
- wppa_echo(
1373
- __( 'Target album for copy/move:', 'wp-photo-album-plus' ) . '
1374
- <input
1375
- id="target-' . $id . '"
1376
- type="number"
1377
- style="height:20px"
1378
- placeholder="' . __( 'Album id', 'wp-photo-album-plus' ) . '"
1379
- />' . $br );
1380
- }
1381
- wppa_echo( $br );
1382
 
1383
- wppa_echo( '
1384
- <input
1385
- type="button"
1386
- class="wppa-admin-button"
1387
- onclick="wppaTryMove( ' . $id . ', ' . $b_is_video . ' )"
1388
- value="' . ( $b_is_video ? $mvt : $mpt ) . '"
1389
- />
1390
- <input
1391
- type="button"
1392
- class="wppa-admin-button"
1393
- onclick="wppaTryCopy( ' . $id . ', ' . $b_is_video . ' )"
1394
- value="' . ( $b_is_video ? $cvt : $cpt ) . '"
1395
- />' );
1396
- }
1397
 
1398
- // Delete
1399
- if ( wppa_user_is( 'administrator' ) || wppa_get_photo_item( $id, 'owner' ) == wppa_get_user() ) {
1400
- if ( ! wppa( 'front_edit' ) ) {
1401
- wppa_echo( '
1402
- <input
1403
- type="button"
1404
- class="wppa-admin-button"
1405
- style="color:' . ( $deleted ? 'green' : 'red' ) . '"
1406
- onclick="wppaTry' . ( $deleted ? 'Undelete' : 'Delete' ) . '( ' . $id . ', ' . $b_is_video . ' )"' .
1407
- ( $deleted ?
1408
- ' value="' . ( $b_is_video ? esc_attr( __( 'Undelete video', 'wp-photo-album-plus' ) ) : esc_attr( __( 'Undelete photo', 'wp-photo-album-plus' ) ) ) .'"' :
1409
- ' value="' . ( $b_is_video ? esc_attr( __( 'Delete video', 'wp-photo-album-plus' ) ) : esc_attr( __( 'Delete photo', 'wp-photo-album-plus' ) ) ) . '"' ) . '
1410
- />' .
1411
- $br );
1412
-
1413
- if ( $deleted ) {
1414
- wppa_echo( '
1415
- <input
1416
- type="button"
1417
- class="wppa-admin-button"
1418
- style="color:red"
1419
- onclick="wppaTryDelete( ' . $id . ', ' . $b_is_video . ', true )"
1420
- value="' . esc_attr( __( 'Remove permanently', 'wp-photo-album-plus' ) ) . '"
1421
- />' . $br );
1422
- }
1423
- }
1424
  }
1425
 
1426
- // Re-upload
1427
- if ( wppa_user_is( 'administrator' ) || ! wppa_switch( 'reup_is_restricted' ) ) {
1428
- wppa_echo( '
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1429
  <input
1430
- type="button"
1431
- class="wppa-admin-button"
1432
- onclick="jQuery( \'#re-up-' . $id . '\' ).css( \'display\', \'inline-block\' )"
1433
- value="' . esc_attr( __( 'Re-upload file', 'wp-photo-album-plus' ) ) . '"
1434
  />
1435
-
1436
- <div id="re-up-' . $id . '" style="display:none">
1437
- <form
1438
- id="wppa-re-up-form-' . $id . '"
1439
- onsubmit="wppaReUpload( event, ' . $id . ', \'' . $filename . '\' )"
1440
- >
1441
- <input
1442
- type="file"
1443
- id="wppa-re-up-file-' . $id . '"
1444
- />
1445
- <input
1446
- type="submit"
1447
- id="wppa-re-up-butn-' . $id . '"
1448
- value="' . esc_attr( __( 'Upload', 'wp-photo-album-plus' ) ) . '"
1449
- />
1450
- </form>
1451
- </div>' . $br );
1452
- }
1453
 
1454
  wppa_echo( '
1455
- </td>
1456
- </tr>
1457
- </tbody>
1458
- </table>' );
1459
-
1460
- // Section 3a ImageMagick editing commands
1461
- if ( wppa_can_admin_magick( $id ) && ! $quick ) {
1462
-
1463
- // wppa_echo( '<fieldset style="padding:6px;border:1px solid lightgray;margin:2px 20px 20px"><legend>' . __( '<b>ImageMagick</b> commands.', 'wp-photo-album-plus' ) . '</legend>
1464
- wppa_echo( '<div style="padding:0 20px;">
1465
- <details class="wppa-sublevel-details">
1466
- <summary class="toplevel wppa-summary-sublevel"> '.
1467
- __( 'ImageMagick commands', 'wp-photo-album-plus' ) . '
1468
- </summary>
1469
-
1470
- <table
1471
- class="wppa-table wppa-photo-table"
1472
- style="border:1px solid lightgray;margin:2px 20px 20px 0"
1473
- >
1474
- <tbody>
1475
- <tr>
1476
- <td>' .
1477
- __( 'The operations are executed upon the display file.', 'wp-photo-album-plus' ) . ' ' .
1478
- __( 'A new thumbnail image will be created from the display file.', 'wp-photo-album-plus' ) . '
1479
- </td>
1480
- </tr>
1481
- <tr>
1482
- <td>' );
1483
-
1484
- // --- Actions ---
1485
 
1486
- // Rotate left
1487
- wppa_echo( '
 
 
 
 
 
 
1488
  <input
1489
  type="button"
1490
- class="wppa-admin-button"
1491
- onclick="wppaTryMagick( ' . $id . ', \'magickrotleft\' )"
1492
  value="' . esc_attr( __( 'Rotate left', 'wp-photo-album-plus' ) ) . '"
1493
- />' );
1494
-
1495
- // Rotat 180
1496
- wppa_echo( '
 
 
1497
  <input
1498
  type="button"
1499
- class="wppa-admin-button"
1500
- onclick="wppaTryMagick( ' . $id . ', \'magickrot180\' )"
1501
  value="' . esc_attr( __( 'Rotate 180&deg;', 'wp-photo-album-plus' ) ) . '"
1502
- />' );
1503
-
1504
- // Rotate right
1505
- wppa_echo( '
 
 
1506
  <input
1507
  type="button"
1508
- class="wppa-admin-button"
1509
- onclick="wppaTryMagick( ' . $id . ', \'magickrotright\' )"
1510
  value="' . esc_attr( __( 'Rotate right', 'wp-photo-album-plus' ) ) . '"
1511
- />' );
1512
-
1513
- // Flip
1514
- wppa_echo( '
 
 
1515
  <input
1516
  type="button"
1517
- class="wppa-admin-button"
1518
- onclick="wppaTryMagick( ' . $id . ', \'magickflip\' )"
1519
  value="' . esc_attr( __( 'Flip', 'wp-photo-album-plus' ) ) . '&thinsp;&#8212;"
1520
- title="-flip"
1521
- />' );
1522
-
1523
- // Flop
1524
- wppa_echo( '
 
1525
  <input
1526
  type="button"
1527
- class="wppa-admin-button"
1528
- onclick="wppaTryMagick( ' . $id . ', \'magickflop\' )"
1529
- value="' . esc_attr( __( 'Flop', 'wp-photo-album-plus' ) ) . ' |"
1530
- title="-flop"
1531
- />' );
 
 
1532
 
1533
- // Enhance
1534
- wppa_echo( '
1535
- <input
1536
- type="button"
1537
- class="wppa-admin-button"
1538
- onclick="wppaTryMagick( ' . $id . ', \'enhance\' )"
1539
- value="' . esc_attr( __( 'Enhance', 'wp-photo-album-plus' ) ) . '"
1540
- title="-enhance"
1541
- />' );
 
 
 
 
 
 
 
1542
 
1543
- // Sharpen
1544
- wppa_echo( '
1545
- <input
1546
- type="button"
1547
- class="wppa-admin-button"
1548
- onclick="wppaTryMagick( ' . $id . ', \'sharpen\' )"
1549
- value="' . esc_attr( __( 'Sharpen', 'wp-photo-album-plus' ) ) . '"
1550
- title="-sharpen 0x1"
1551
- />' );
 
 
 
 
 
 
 
1552
 
1553
- // Blur
1554
- wppa_echo( '
 
 
 
 
 
 
1555
  <input
1556
  type="button"
1557
- class="wppa-admin-button"
1558
- onclick="wppaTryMagick( ' . $id . ', \'blur\' )"
1559
- value="' . esc_attr( __( 'Blur', 'wp-photo-album-plus' ) ) . '"
1560
- title="-blur 0x1"
1561
- />' );
 
 
 
1562
 
1563
- // Auto gamma
1564
  wppa_echo( '
1565
- <input
1566
- type="button"
1567
- class="wppa-admin-button"
1568
- onclick="wppaTryMagick( ' . $id . ', \'auto-gamma\' )"
1569
- value="' . esc_attr( __( 'Auto Gamma', 'wp-photo-album-plus' ) ) . '"
1570
- title="-auto-gamma"
1571
- />' );
 
 
 
 
 
 
 
 
1572
 
1573
- // Auto level
1574
- wppa_echo( '
1575
- <input
1576
- type="button"
1577
- class="wppa-admin-button"
1578
- onclick="wppaTryMagick( ' . $id . ', \'auto-level\' )"
1579
- value="' . esc_attr( __( 'Auto Level', 'wp-photo-album-plus' ) ) . '"
1580
- title="-auto-level"
1581
- />' );
 
 
 
 
1582
 
1583
- // Contrast+
1584
- wppa_echo( '
1585
- <input
1586
- type="button"
1587
- class="wppa-admin-button"
1588
- onclick="wppaTryMagick( ' . $id . ', \'contrast-p\' )"
1589
- value="' . esc_attr( __( 'Contrast+', 'wp-photo-album-plus' ) ) . '"
1590
- title="-brightness-contrast 0x5"
1591
- />' );
 
 
 
 
 
 
 
 
 
 
1592
 
1593
- // Contrast-
1594
- wppa_echo( '
1595
- <input
1596
- type="button"
1597
- class="wppa-admin-button"
1598
- onclick="wppaTryMagick( ' . $id . ', \'contrast-m\' )"
1599
- value="' . esc_attr( __( 'Contrast-', 'wp-photo-album-plus' ) ) . '"
1600
- title="-brightness-contrast 0x-5"
1601
- />' );
1602
 
1603
- // Brightness+
1604
- wppa_echo( '
1605
- <input
1606
- type="button"
1607
- class="wppa-admin-button"
1608
- onclick="wppaTryMagick( ' . $id . ', \'brightness-p\' )"
1609
- value="' . esc_attr( __( 'Brightness+', 'wp-photo-album-plus' ) ) . '"
1610
- title="-brightness-contrast 5"
1611
- />' );
1612
 
1613
- // Brightness-
1614
- wppa_echo( '
1615
- <input
1616
- type="button"
1617
- class="wppa-admin-button"
1618
- onclick="wppaTryMagick( ' . $id . ', \'brightness-m\' )"
1619
- value="' . esc_attr( __( 'Brightness-', 'wp-photo-album-plus' ) ) . '"
1620
- title="-brightness-contrast -5"
1621
- />' );
1622
 
1623
- // Despeckle
1624
- wppa_echo( '
1625
- <input
1626
- type="button"
1627
- class="wppa-admin-button"
1628
- onclick="wppaTryMagick( ' . $id . ', \'despeckle\' )"
1629
- value="' . esc_attr( __( 'Despeckle', 'wp-photo-album-plus' ) ) . '"
1630
- title="-despeckle"
1631
- />' );
 
 
 
 
1632
 
1633
- // Lenear gray
1634
- wppa_echo( '
1635
- <input
1636
- type="button"
1637
- class="wppa-admin-button"
1638
- onclick="wppaTryMagick( ' . $id . ', \'lineargray\' )"
1639
- value="' . esc_attr( __( 'Linear gray', 'wp-photo-album-plus' ) ) . '"
1640
- title="-colorspace gray"
1641
- />' );
1642
 
1643
- // Non-linear gray
1644
- wppa_echo( '
1645
- <input
1646
- type="button"
1647
- class="wppa-admin-button"
1648
- onclick="wppaTryMagick( ' . $id . ', \'nonlineargray\' )"
1649
- value="' . esc_attr( __( 'Non-linear gray', 'wp-photo-album-plus' ) ) . '"
1650
- title="-grayscale Rec709Luma"
1651
- />' );
1652
 
1653
- // Charcoal
1654
- wppa_echo( '
1655
- <input
1656
- type="button"
1657
- class="wppa-admin-button"
1658
- onclick="wppaTryMagick( ' . $id . ', \'charcoal\' )"
1659
- value="' . esc_attr( __( 'Charcoal', 'wp-photo-album-plus' ) ) . '"
1660
- title="-charcoal"
1661
- />' );
1662
 
1663
- // Paint
1664
- wppa_echo( '
1665
- <input
1666
- type="button"
1667
- class="wppa-admin-button"
1668
- onclick="wppaTryMagick( ' . $id . ', \'paint\' )"
1669
- value="' . esc_attr( __( 'Paint', 'wp-photo-album-plus' ) ) . '"
1670
- title="-paint"
1671
- />' );
1672
 
1673
- // Sepia
1674
- wppa_echo( '
1675
- <input
1676
- type="button"
1677
- class="wppa-admin-button"
1678
- onclick="wppaTryMagick( ' . $id . ', \'sepia\' )"
1679
- value="' . esc_attr( __( 'Sepia', 'wp-photo-album-plus' ) ) . '"
1680
- title="-sepia-tone 80%"
1681
- />' );
1682
 
1683
- // Show/hide wppa-horizon
1684
- wppa_echo( '
1685
- <input
1686
- type="button"
1687
- class="wppa-admin-button"
1688
- onclick="wppaToggleHorizon()"
1689
- value="' . esc_attr( 'Show/hide horizon', 'wp-photo-album-plus' ) . '"
1690
- title="' . esc_attr( 'Toggle horizon reference line on/off', 'wp-photo-album-plus' ) . '"
1691
- />' );
1692
 
1693
- // Anticlock 0.5 deg
1694
- wppa_echo( '
1695
- <input
1696
- type="button"
1697
- class="wppa-admin-button"
1698
- onclick="wppaTryMagick( ' . $id . ', \'skyleft\' )"
1699
- value="' . esc_attr( '0.5&deg;', 'wp-photo-album-plus' ) . '"
1700
- title="' . esc_attr( 'Rotate image by 0.5&deg; anticlockwise', 'wp-photo-album-plus' ) . '"
1701
- />' );
1702
 
1703
- // Clockwise 0.5 deg
1704
- wppa_echo( '
1705
- <input
1706
- type="button"
1707
- class="wppa-admin-button"
1708
- onclick="wppaTryMagick( ' . $id . ', \'skyright\' )"
1709
- value="' . esc_attr( '-0.5&deg;', 'wp-photo-album-plus' ) . '"
1710
- title="' . esc_attr( 'Rotate image by 0.5&deg; clockwise', 'wp-photo-album-plus' ) . '"
1711
- />' );
1712
 
1713
- // Crop
1714
- wppa_echo( '
1715
- <input
1716
- type="button"
1717
- class="wppa-admin-button"
1718
- id="button-' . $id . '"
1719
- value="Crop"
1720
- title=""
1721
- />' );
1722
 
1723
- // Set cropbox aspect ratio
1724
- $ratio = ( $photoy ? ( $photox / $photoy ) : 'NaN' );
1725
- $dflt = wppa_opt( 'image_magick_ratio' );
1726
- wppa_echo( '
1727
- <select
1728
- onchange="wppaCropper[' . $id . '].setAspectRatio(this.value)"
1729
- title="' . __( 'Aspect ratio of cropped image', 'wp-photo-album-plus' ) . '"
1730
- >
1731
- <option value="NaN"' . ( $dflt == 'NaN' ? ' selected' : '' ) . '>' . __( 'free', 'wp-photo-album-plus' ) . '</option>
1732
- <option value="' . $ratio . '"' . ( $dflt == 'ratio' ? ' selected' : '' ) . '>' . __( 'original', 'wp-photo-album-plus' ) . '</option>
1733
- <option value="1"' . ( $dflt == '1' ? ' selected' : '' ) . '>' . __( 'square', 'wp-photo-album-plus' ) . '</option>
1734
- <option value="1.25"' . ( $dflt == '1.25' ? ' selected' : '' ) . '>4:5 ' . __( 'landscape', 'wp-photo-album-plus' ) . '</option>
1735
- <option value="1.33333"' . ( $dflt == '1.33333' ? ' selected' : '' ) . '>3:4 ' . __( 'landscape', 'wp-photo-album-plus' ) . '</option>
1736
- <option value="1.5"' . ( $dflt == '1.5' ? ' selected' : '' ) . '>2:3 ' . __( 'landscape', 'wp-photo-album-plus' ) . '</option>
1737
- <option value="1.6"' . ( $dflt == '1.6' ? ' selected' : '' ) . '>5:8 ' . __( 'landscape', 'wp-photo-album-plus' ) . '</option>
1738
- <option value="1.77777"' . ( $dflt == '1.77777' ? ' selected' : '' ) . '>9:16 ' . __( 'landscape', 'wp-photo-album-plus' ) . '</option>
1739
- <option value="2"' . ( $dflt == '2' ? ' selected' : '' ) . '>1:2 ' . __( 'landscape', 'wp-photo-album-plus' ) . '</option>
1740
- <option value="0.8"' . ( $dflt == '0.8' ? ' selected' : '' ) . '>4:5 ' . __( 'portrait', 'wp-photo-album-plus' ) . '</option>
1741
- <option value="0.75"' . ( $dflt == '0.75' ? ' selected' : '' ) . '>3:4 ' . __( 'portrait', 'wp-photo-album-plus' ) . '</option>
1742
- <option value="0.66667"' . ( $dflt == '0.66667' ? ' selected' : '' ) . '>2:3 ' . __( 'portrait', 'wp-photo-album-plus' ) . '</option>
1743
- <option value="0.625"' . ( $dflt == '0.625' ? ' selected' : '' ) . '>5:8 ' . __( 'portrait', 'wp-photo-album-plus' ) . '</option>
1744
- <option value="0.5625"' . ( $dflt == '0.5625' ? ' selected' : '' ) . '>9:16 ' . __( 'portrait', 'wp-photo-album-plus' ) . '</option>
1745
- <option value="0.5"' . ( $dflt == '0.5' ? ' selected' : '' ) . '>1:2 ' . __( 'portrait', 'wp-photo-album-plus' ) . '</option>
1746
- </select>' . $br );
1747
-
1748
- if ( $dflt == 'ratio' ) {
1749
- $value = $ratio;
1750
- }
1751
- elseif ( $dflt == 'free' ) {
1752
- $value = '';
1753
- }
1754
- else {
1755
- $value = $dflt;
1756
- }
1757
 
1758
- $the_js = 'jQuery(document).ready(function(){wppaCropper[' . $id . '].setAspectRatio(' . $value . ');});';
1759
- wppa_add_inline_script( 'wppa-admin', $the_js );
 
 
 
 
 
 
 
1760
 
1761
- wppa_echo( '
1762
- </td>
1763
- </tr>
1764
- <tr>
1765
- <td>' .
1766
- __( '<b>ImageMagick</b> command stack', 'wp-photo-album-plus' ) . ':
1767
- <span
1768
- id="magickstack-' . strval( intval( $id ) ). '"
1769
- style="color:blue"
1770
- >' .
1771
- sanitize_text_field( $magickstack ) . '
1772
- </span>
1773
- <input
1774
- type="button"
1775
- class="wppa-admin-button"
1776
- id="imstackbutton-' . strval( intval( $id ) ) . '"
1777
- onclick="wppaTryMagick( ' . strval( intval( $id ) ) . ', \'magickundo\' )"
1778
- value="' . esc_attr( __( 'Undo', 'wp-photo-album-plus' ) ) . '"
1779
- title="' . esc_attr( __( 'Undo last Magick command', 'wp-photo-album-plus' ) ) . '"
1780
- style="' . ( $magickstack ? 'display:inline;' : 'display:none;' ) . '"
1781
- />
1782
- </td>
1783
- </tr>' );
1784
 
1785
- // Fake 'for social media' to use the local file here, not cloudinary. Files from cloudinary do not reload, even with ?ver=...
1786
- wppa( 'for_sm', true );
1787
- wppa_echo( '
1788
- <tr>
1789
- <td>
1790
- <div
1791
- class="wppa-cropper-container-wrapper">
1792
- <img
1793
- id="fs-img-' . $id . '"
1794
- src="' . esc_url( wppa_get_photo_url( $id ) ) . '"
1795
- style="float:left;max-width:100%"
1796
  />' );
1797
 
1798
- $the_js = '
1799
-
1800
- /* jQuery(document).ready(function() { */
1801
- window.addEventListener("DOMContentLoaded", function () {
1802
-
1803
- /* Responive does not always works correcly, */
1804
- /* so we do a manual replace after resizing the window */
1805
- window.addEventListener("resize", function(){
1806
- var c = wppaCropper[' . $id . '];
1807
- var url = document.getElementById("fs-img-' . $id . '").src;
1808
- c.replace(url);
1809
- });
1810
-
1811
- var image = document.querySelector("#fs-img-' . $id . '");
1812
- var button = document.getElementById("button-' . $id . '");
1813
-
1814
- wppaCropper[' . $id . '] = new Cropper(image, {
1815
- zoomable: false,
1816
- viewMode: 2,
1817
- background: false,
1818
- dragMode: "move",
1819
- responsive: true,
1820
- movable: false,
1821
- });
1822
-
1823
- button.onclick = function () {
1824
- var data = wppaCropper[' . $id . '].getData(true);
1825
- var value=data.width+"x"+data.height+(data.x<0?"-":"+")+data.x+(data.y<0?"-":"+")+data.y;
1826
- wppaTryMagick( "' . $id . '", \'crop\', value );
1827
- };
1828
- });';
1829
- wppa_add_inline_script( 'wppa-admin', $the_js );
1830
 
1831
- wppa_echo( '
1832
- </div>
1833
- </td>
1834
- </tr>
1835
- </tbody>
1836
- </table>
1837
- </details></div>' );
1838
- //</fieldset>' );
1839
- }
1840
 
1841
- // Reset switch
1842
- wppa( 'for_sm', false );
 
 
 
 
 
 
 
1843
 
1844
- // Section 4
1845
- wppa_echo( '
1846
- <!-- Section 4 -->
1847
- <table
1848
- class="wppa-table wppa-photo-table"
1849
- style="width:100%"
1850
- >
1851
- <tbody>' );
1852
-
1853
- // Name
1854
- wppa_echo( '
1855
- <tr>
1856
- <td>' .
1857
- __( 'Photoname:' , 'wp-photo-album-plus' ) . '
1858
- </td>
1859
- <td>
1860
- <input
1861
- type="text"
1862
- style="width:100%"
1863
- id="pname-' . $id . '"
1864
- onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'name\', this.value)"
1865
- value="' . esc_attr( stripslashes( $name ) ) . '"
1866
- />
1867
- <br>
1868
- <span style="float:right">' .
1869
- __( 'Name slug', 'wp-photo-album-plus' ) . ': ' . $sname . '
1870
- </span>
1871
- </td>
1872
- <td>
1873
- </td>
1874
- </tr>' );
1875
 
1876
- // Description editable
1877
- if ( ! wppa_switch( 'desc_is_restricted' ) || wppa_user_is( 'administrator' ) ) {
1878
- wppa_echo( '
1879
- <tr>
1880
- <td>' .
1881
- __( 'Description:', 'wp-photo-album-plus' ) . '
1882
- </td>' );
1883
-
1884
- // WP editor
1885
- if ( wppa_switch( 'use_wp_editor' ) ) {
1886
- $alfaid = wppa_alfa_id( $id );
1887
- wppa_echo( '<td>' );
1888
- wp_editor( $description,
1889
- 'wppaphotodesc'.$alfaid,
1890
- array( 'wpautop' => true,
1891
- 'media_buttons' => false,
1892
- 'textarea_rows' => '6',
1893
- 'tinymce' => true
1894
- )
1895
- );
1896
- wppa_echo( '
1897
  <input
1898
  type="button"
1899
- style="clear:left"
1900
- class="button button-secundary"
1901
- value="' . esc_attr( __( 'Update Photo description', 'wp-photo-album-plus' ) ) . '"
1902
- onclick="wppaAjaxUpdatePhoto( ' . $id . ', \'description\', wppaGetTinyMceContent(\'wppaphotodesc' . $alfaid . '\') )"
1903
- />
1904
- <img
1905
- id="wppa-photo-spin-' . $id . '"
1906
- src="' . wppa_get_imgdir() . 'spinner.gif"
1907
- style="visibility:hidden"
1908
- />
1909
- </td>
1910
- <td>
1911
- </td>' );
1912
- }
1913
 
1914
- // Textarea
1915
- else {
1916
- wppa_echo( '
1917
- <td>
1918
- <textarea
1919
- style="width:100%;height:60px"
1920
- onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'description\', this.value)"
1921
- >' .
1922
- esc_textarea( stripslashes( $description ) ) . '
1923
- </textarea>
1924
- </td>
1925
- <td>
1926
- </td>' );
1927
- }
1928
 
1929
- wppa_echo( '</tr>' );
1930
- }
 
 
 
 
 
 
 
1931
 
1932
- // Description not editable
1933
- else {
1934
- wppa_echo( '
1935
- <tr>
1936
- <td>' .
1937
- __( 'Description:', 'wp-photo-album-plus' ) . '
1938
- </td>
1939
- <td>
1940
- <textarea
1941
- style="width:100%;height:60px"
1942
- readonly
1943
- onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'description\', this.value)"
1944
- >' .
1945
- esc_textarea( stripslashes( $description ) ) . '
1946
- </textarea>
1947
- </td>
1948
- <td>
1949
- </td>
1950
- </tr>' );
1951
- }
1952
 
1953
- // Tags
1954
- $allowed = ! wppa_switch( 'newtags_is_restricted' ) || wppa_user_is( 'administrator' );
1955
- wppa_echo( '
1956
- <tr>
1957
- <td>' .
1958
- __( 'Tags:', 'wp-photo-album-plus' ) . '
1959
- </td>
1960
- <td>
1961
- <input
1962
- id="tags-' . $id . '"
1963
- type="text"
1964
- style="width:100%"
1965
- onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'tags\', this.value)"
1966
- value="' . esc_attr( $tags ) . '"' .
1967
- ( $allowed ? '' : ' readonly="readonly"' ) . '
1968
- />' );
1969
- if ( $allowed ) {
1970
- wppa_echo( '
1971
- <br>
1972
- <span class="description">' .
1973
- __( 'Separate tags with commas.', 'wp-photo-album-plus' ) . '
1974
- </span>' );
1975
- }
1976
- wppa_echo( '
1977
- <select
1978
- onchange="wppaAddTag( this.value, \'tags-' . $id . '\' ); wppaAjaxUpdatePhoto( ' . $id . ', \'tags\', document.getElementById( \'tags-' . $id . '\' ).value )">' );
1979
 
1980
- if ( wppa_switch( 'predef_tags_only' ) ) {
1981
- $keys = explode( ',', trim( wppa_opt( 'minimum_tags' ) ) );
1982
- $taglist = array();
1983
- foreach ( $keys as $key ) {
1984
- $taglist[$key]['tag'] = $key;
1985
- }
1986
- }
1987
- else {
1988
- $taglist = wppa_get_taglist();
1989
- }
1990
 
1991
- if ( is_array( $taglist ) ) {
1992
- wppa_echo( '<option value="">' . __( '- select to add -', 'wp-photo-album-plus' ) . '</option>' );
1993
- foreach ( $taglist as $tag ) {
1994
- wppa_echo( '<option value="' . esc_attr( $tag['tag'] ) . '">' . htmlspecialchars( $tag['tag'] ) . '</option>' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1995
  }
1996
- if ( ! $allowed ) {
1997
- wppa_echo( '<option value="-clear-">' . __( '- clear -', 'wp-photo-album-plus' ) . '</option>' );
 
 
 
1998
  }
1999
- }
2000
- else {
2001
- wppa_echo( '<option value="0">' . __( 'No tags yet', 'wp-photo-album-plus' ) . '</option>' );
2002
- }
2003
- wppa_echo( '
2004
- </select>
2005
- </td>
2006
- <td>
2007
- </td>
2008
- </tr>' );
2009
-
2010
- // Custom
2011
- if ( wppa_switch( 'custom_fields' ) ) {
2012
- $custom = wppa_get_photo_item( $photo['id'], 'custom' );
2013
- if ( $custom ) {
2014
- $custom_data = wppa_unserialize( $custom );
2015
- }
2016
- else {
2017
- $custom_data = array( '', '', '', '', '', '', '', '', '', '' );
2018
- }
2019
- foreach( array_keys( $custom_data ) as $key ) {
2020
- if ( wppa_opt( 'custom_caption_' . $key ) ) {
2021
- wppa_echo( '
2022
- <tr>
2023
- <td>' .
2024
- apply_filters( 'translate_text', wppa_opt( 'custom_caption_' . $key ) ) . '
2025
- <small style="float:right">
2026
- (w#cc' . $key . ')
2027
- </small>:
2028
- </td>
2029
- <td>
2030
- <input
2031
- type="text"
2032
- style="width:100%"
2033
- id="custom_' . $key . '-' . $id . '"
2034
- onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'custom_' . $key . '\', this.value)"
2035
- value="' . esc_attr( stripslashes( $custom_data[$key] ) ) . '"
2036
- />
2037
- </td>
2038
- <td>
2039
- <small>(w#cd' . $key . ')</small>
2040
- </td>
2041
- </tr>' );
2042
- }
2043
- }
2044
- }
2045
 
2046
- // -- Auto Page --
2047
- if ( wppa_switch( 'auto_page' ) && ( current_user_can( 'edit_posts' ) || current_user_can( 'edit_pages' ) ) ) {
2048
- $appl = get_permalink( wppa_get_the_auto_page( $id ) );
2049
- wppa_echo( '
2050
- <tr>
2051
- <td>' .
2052
- __( 'Autopage Permalink:', 'wp-photo-album-plus' ) . '
2053
- </td>
2054
- <td>
2055
- <a href="' . $appl . '" target="_blank">' .
2056
- $appl . '
2057
- </a>
2058
- </td>
2059
- <td>
2060
- </td>
2061
- </tr>' );
2062
- }
2063
 
2064
- // -- Link url --
2065
- if ( ! wppa_switch( 'link_is_restricted' ) || wppa_user_is( 'administrator' ) ) {
2066
- wppa_echo( '
2067
- <tr>
2068
- <td>' .
2069
- __( 'Photo specific link url:', 'wp-photo-album-plus' ) . '
2070
- </td>
2071
- <td>
2072
- <input
2073
- type="text"
2074
- id="pislink-' . $id . '"
2075
- style="width:100%"
2076
- onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'linkurl\', this.value)"
2077
- value="' . esc_attr( $linkurl ) . '"
2078
- />
2079
- </td>
2080
- <td>
2081
- <select
2082
- id="pistarget-' . $id . '"
2083
- onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'linktarget\', this.value)"
2084
- >
2085
- <option
2086
- value="_self"' .
2087
- ( $linktarget == '_self' ? ' selected' : '' ) . '
2088
- >' .
2089
- __( 'Same tab', 'wp-photo-album-plus' ) . '
2090
- </option>
2091
- <option
2092
- value="_blank"' .
2093
- ( $linktarget == '_blank' ? ' selected' : '' ) . '
2094
  >' .
2095
- __( 'New tab', 'wp-photo-album-plus' ) . '
2096
- </option>
2097
- </select>
2098
- <input
2099
- type="button"
2100
- onclick="window.open( jQuery( \'#pislink-' . $id . '\' ).val(), jQuery( \'#pistarget-' . $id . '\' ).val() )"
2101
- value="' . __( 'Tryit!', 'wp-photo-album-plus' ) . '"
2102
- />
2103
- </td>
2104
- </tr>' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2105
 
2106
- // -- Link title --
2107
  wppa_echo( '
2108
  <tr>
2109
  <td>' .
2110
- __( 'Photo specific link title:', 'wp-photo-album-plus' ) . '
2111
  </td>
2112
  <td>
2113
  <input
2114
  type="text"
2115
  style="width:100%"
2116
- onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'linktitle\', this.value)"
2117
- value="' . esc_attr( $linktitle ) . '"
2118
- />' );
2119
- if ( current_user_can( 'wppa_settings' ) ) {
2120
- wppa_echo( '
2121
- <br>
2122
- <span class="description">' .
2123
- sprintf( __( 'If you want this link to be used, check \'PS Overrule\' checkbox in %s.' , 'wp-photo-album-plus' ), wppa_setting_path( 'b', 'links', 2 ) ) . '
2124
- </span>' );
2125
- }
2126
- wppa_echo( '
2127
  </td>
2128
  <td>
2129
  </td>
2130
  </tr>' );
2131
- }
2132
 
2133
- // -- Custom ALT field --
2134
- if ( wppa_opt( 'alt_type' ) == 'custom' ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2135
  wppa_echo( '
2136
  <tr>
2137
  <td>' .
2138
- __( 'HTML Alt attribute:' , 'wp-photo-album-plus' ) . '
2139
  </td>
2140
  <td>
2141
  <input
 
2142
  type="text"
2143
  style="width:100%"
2144
- onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'alt\', this.value)"
2145
- value="' . esc_attr( $alt ) . '"
2146
- />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2147
  </td>
2148
  <td>
2149
  </td>
2150
  </tr>' );
2151
- }
2152
 
2153
- // If Quick, skip the following items for speed and space
2154
- if ( ! $quick ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2155
 
2156
- // Shortcode
2157
- if ( current_user_can( 'edit_posts' ) || current_user_can( 'edit_pages' ) ) {
 
2158
  wppa_echo( '
2159
  <tr>
2160
  <td>' .
2161
- __( 'Single image shortcode', 'wp-photo-album-plus' ) . ':
2162
  </td>
2163
  <td>
2164
- [wppa type="photo" photo="' . $id .'"]
 
 
2165
  </td>
2166
  <td>
2167
- <small>' .
2168
- sprintf( __( 'See %s The documentation %s for more shortcode options.', 'wp-photo-album-plus' ),
2169
- '<a href="https://wppa.nl/shortcode-reference/" target="_blank">',
2170
- '</a>'
2171
- ) . '
2172
- </small>
2173
  </td>
2174
  </tr>' );
2175
  }
2176
 
2177
- // Source permalink
2178
- if ( is_file( wppa_get_source_path( $id ) ) ) {
2179
- $spl = wppa_get_source_pl( $id );
2180
  wppa_echo( '
2181
  <tr>
2182
  <td>' .
2183
- __( 'Permalink', 'wp-photo-album-plus' ) . ':
2184
  </td>
2185
  <td>
2186
- <a href="' . esc_attr( $spl ) . '" target="_blank">' . htmlspecialchars( $spl ) . '</a>
 
 
 
 
 
 
2187
  </td>
2188
  <td>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2189
  </td>
2190
  </tr>' );
2191
- }
2192
-
2193
- // High resolution url
2194
- $hru = htmlspecialchars( wppa_get_hires_url( $id ) );
2195
- wppa_echo( '
2196
- <tr>
2197
- <td>' .
2198
- __( 'High resolution url', 'wp-photo-album-plus' ) . ':
2199
- </td>
2200
- <td>
2201
- <a href="' . esc_attr( $hru ) . '" target="_blank">' . $hru . '</a>
2202
- </td>
2203
- <td>
2204
- </td>
2205
- </tr>' );
2206
 
2207
- // Display file
2208
- if ( is_file( wppa_get_photo_path( $id ) ) ) {
2209
- $lru = wppa_fix_poster_ext( wppa_get_lores_url( $id ), $id );
2210
  wppa_echo( '
2211
  <tr>
2212
  <td>' .
2213
- __( 'Display file url', 'wp-photo-album-plus' ) . ':
2214
  </td>
2215
  <td>
2216
- <a href="' . esc_attr( $lru ) . '" target="_blank">' . $lru . '</a>
 
 
 
 
 
 
 
 
 
 
 
 
 
2217
  </td>
2218
  <td>
2219
  </td>
2220
  </tr>' );
2221
  }
2222
 
2223
- // Thumbnail
2224
- if ( is_file( wppa_get_thumb_path( $id ) ) ) {
2225
- $tnu = wppa_fix_poster_ext( wppa_get_tnres_url( $id ), $id );
2226
  wppa_echo( '
2227
  <tr>
2228
  <td>' .
2229
- __( 'Thumbnail file url', 'wp-photo-album-plus' ) . ':
2230
  </td>
2231
  <td>
2232
- <a href="' . esc_attr( $tnu ) . '" target="_blank">' . $tnu . '</a>
 
 
 
 
 
2233
  </td>
2234
  <td>
2235
  </td>
2236
  </tr>' );
2237
  }
2238
- }
2239
- wppa_echo( '
2240
- </tbody>
2241
- </table>' );
2242
-
2243
- wppa_echo( '<!-- Section 5 -->' );
2244
 
2245
- // IPTC
2246
- if ( ! $quick ) {
2247
- $iptcs = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->wppa_iptc
2248
- WHERE photo = %s
2249
- ORDER BY tag, id", $id ), ARRAY_A );
2250
- if ( ! empty( $iptcs ) ) {
2251
- wppa_echo( '
2252
- <table><tbody><tr><td><input
2253
- type="button"
2254
- id="wppa-iptc-button-' . $id . '"
2255
- class="button button-secundary"
2256
- value="' . esc_attr( sprintf( __( 'Show %d IPTC items', 'wp-photo-album-plus' ), count( $iptcs ) ) ) . '"
2257
- onclick="wppaToggleIptc( ' . $id . ', ' . count( $iptcs ) . ' )"
2258
- /></td></tr></tbody></table>
2259
- <table
2260
- id="wppa-iptc-' . $id . '"
2261
- class="wppa-table wppa-photo-table"
2262
- style="clear:both;width:99%;display:none"
2263
- >
2264
- <thead>
2265
- <tr style="font-weight:bold">
2266
- <td style="padding:0 4px">' . __( 'IPTC tag', 'wp-photo-album-plus' ) . '</td>
2267
- <td style="padding:0 4px">' . __( 'Description', 'wp-photo-album-plus' ) . '</td>
2268
- <td style="padding:0 4px">' . __( 'Value', 'wp-photo-album-plus' ) . '</td>
2269
- </tr>
2270
- </thead>
2271
- <tbody>' );
2272
 
2273
- foreach ( $iptcs as $iptc ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2274
 
 
 
 
2275
  wppa_echo( '
2276
- <tr id="iptc-tr-' . $iptc['id'] . '">
2277
- <td style="padding:0 4px">' . $iptc['tag'] . '</td>
2278
- <td style="padding:0 4px">' . esc_html( wppa_iptc_tagname( $iptc['tag'] ) ) . ':</td>
2279
- <td style="padding:0 4px">
2280
- <input
2281
- type="text"
2282
- style="width:500px"
2283
- value="' . esc_attr( $iptc['description'] ) . '"
2284
- onchange="wppaAjaxUpdateIptc(\'' . $id . '\', \'' . $iptc['id'] . '\', this.value, \'' . $iptc['tag'] . '\')"
2285
- />
2286
  </td>
2287
  </tr>' );
2288
  }
2289
 
2290
- wppa_echo( '
2291
- </tbody>
2292
- </table>' );
2293
- }
2294
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2295
 
2296
- // Exif
2297
- if ( ! $quick ) {
2298
- $exifs = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->wppa_exif
2299
- WHERE photo = %s
2300
- ORDER BY tag, id", $id ), ARRAY_A );
2301
- if ( ! empty( $exifs ) ) {
2302
- $brand = wppa_get_camera_brand( $id );
 
 
 
 
 
 
 
 
 
2303
  wppa_echo( '
2304
- <table><tbody><tr><td><input
2305
- type="button"
2306
- id="wppa-exif-button-' . $id . '"
2307
- class="button button-secundary"
2308
- value="' . esc_attr( sprintf( __( 'Show %d EXIF items', 'wp-photo-album-plus' ), count( $exifs ) ) ) . '"
2309
- onclick="wppaToggleExif( ' . $id . ', ' . count( $exifs ) . ' )"
2310
- /></td></tr></tbody></table>
2311
- <table
2312
- id="wppa-exif-' . $id . '"
2313
- class="wppa-table wppa-photo-table"
2314
- style="clear:both;width:99%;display:none"
2315
- >
2316
- <thead>
2317
- <tr style="font-weight:bold">
2318
- <td style="padding:0 4px">' . __( 'Exif tag', 'wp-photo-album-plus' ) . '</td>
2319
- <td style="padding:0 4px">' . __( 'Brand', 'wp-photo-album-plus' ) . '</td>
2320
- <td style="padding:0 4px">' . __( 'Description', 'wp-photo-album-plus' ) . '</td>
2321
- <td style="padding:0 4px">' . __( 'Raw value', 'wp-photo-album-plus' ) . '</td>
2322
- <td style="padding:0 4px">' . __( 'Formatted value', 'wp-photo-album-plus' ) . '</td>
2323
- </tr>
2324
- </thead>
2325
- <tbody>' );
 
 
 
 
 
 
 
 
 
 
 
 
2326
 
2327
- foreach ( $exifs as $exif ) {
2328
- $desc = $exif['description'];
2329
- if ( is_serialized( $desc ) ) {
2330
- $desc = 'Array(' . count( wppa_unserialize( $desc ) ) . ')';
 
 
 
 
 
 
 
 
 
2331
  }
2332
- wppa_echo( '
2333
- <tr id="exif-tr-' . $exif['id'] . '">
2334
- <td style="padding:0 4px">'.$exif['tag'].'</td>' );
2335
 
2336
- if ( $brand && $exif['brand'] ) {
2337
- wppa_echo( '
2338
- <td style="padding:0 4px">' . $brand . '</td>
2339
- <td style="padding:0 4px">' . wppa_exif_tagname( $exif['tag'], $brand, 'brandonly' ) . ':</td>' );
2340
- }
2341
- else {
2342
- wppa_echo( '
2343
- <td style="padding:0 4px"></td>
2344
- <td style="padding:0 4px">' . wppa_exif_tagname( $exif['tag'] ) . ':</td>' );
2345
- }
2346
 
2347
- $raw_value = wp_kses( $desc, 'post' );
2348
- if ( strlen( $raw_value ) > 50 ) {
2349
- $raw_value = substr( $raw_value, 0, 47 ) . '...';
2350
- }
2351
- $formatted_value = wp_kses( wppa_format_exif( $exif['tag'], $exif['description'], $brand ), 'post' );
2352
- if ( strlen( $formatted_value ) > 50 ) {
2353
- $formatted_value = substr( $formatted_value, 0, 47 ) . '...';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2354
  }
2355
  wppa_echo( '
2356
- <td style="padding:0 4px">' . $raw_value . '</td>
2357
- <td style="padding:0 4px">' . $formatted_value . '</td>
2358
- </tr>' );
2359
 
2360
- }
 
 
 
 
 
 
 
 
 
2361
 
2362
- wppa_echo( '
2363
- </tbody>
2364
- </table>' );
2365
- }
2366
- }
 
 
 
 
 
 
 
2367
 
2368
- wppa_echo( '<!-- Section 6 -->' );
2369
 
2370
- // Comments
2371
- if ( ! $quick ) {
2372
- $comments = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->wppa_comments
2373
- WHERE photo = %s
2374
- ORDER BY timestamp DESC ", $id ), ARRAY_A );
2375
- if ( ! empty( $comments ) ) {
2376
- wppa_echo( '
2377
- <table
2378
- class="wppa-table wppa-photo-table"
2379
- style="width:100%"
2380
- >
2381
- <thead>
2382
- <tr style="font-weight:bold">
2383
- <td style="padding:0 4px">#</td>
2384
- <td style="padding:0 4px">User</td>
2385
- <td style="padding:0 4px">Time since</td>
2386
- <td style="padding:0 4px">Status</td>
2387
- <td style="padding:0 4px">Comment</td>
2388
- </tr>
2389
- </thead>
2390
- <tbody>' );
2391
 
2392
- foreach ( $comments as $comment ) {
2393
- wppa_echo( '
2394
- <tr id="com-tr-' . $comment['id'] . '">
2395
- <td style="padding:0 4px">'.$comment['id'].'</td>
2396
- <td style="padding:0 4px">'.$comment['user'].'</td>
2397
- <td style="padding:0 4px">'.wppa_get_time_since( $comment['timestamp'] ).'</td>' );
2398
- if ( current_user_can( 'wppa_comments' ) || current_user_can( 'wppa_moderate' ) || ( wppa_get_user() == $photo['owner'] && wppa_switch( 'owner_moderate_comment' ) ) ) {
2399
- $p = ( $comment['status'] == 'pending' ) ? ' selected' : '';
2400
- $a = ( $comment['status'] == 'approved' ) ? ' selected' : '';
2401
- $s = ( $comment['status'] == 'spam' ) ? ' selected' : '';
2402
- $t = ( $comment['status'] == 'trash' ) ? ' selected' : '';
2403
- wppa_echo( '
2404
- <td style="padding:0 4px">
2405
- <select
2406
- id="com-stat-' . $comment['id'] . '"
2407
- style="background-color:' . ( $comment['status'] == 'approved' ? '#ffffe0' : '#ffebe8' ) . '"
2408
- onchange="wppaAjaxUpdateCommentStatus( '.$id.', '.$comment['id'].', this.value );wppaSetComBgCol(' . $comment['id'] . ')"
2409
- >
2410
- <option value="pending"' . $p . '>' . __( 'Pending' , 'wp-photo-album-plus' ) . '</option>
2411
- <option value="approved"' . $a . '>' . __( 'Approved' , 'wp-photo-album-plus' ) . '</option>
2412
- <option value="spam"' . $s . '>' . __( 'Spam' , 'wp-photo-album-plus' ) . '</option>
2413
- <option value="trash"' . $t . '>' . __( 'Trash' , 'wp-photo-album-plus' ) . '</option>
2414
- </select >
2415
- </td>' );
2416
- }
2417
- else {
2418
- wppa_echo( '<td style="padding:0 4px">' );
2419
- if ( $comment['status'] == 'pending' ) $s = __( 'Pending' , 'wp-photo-album-plus' );
2420
- elseif ( $comment['status'] == 'approved' ) $s = __( 'Approved' , 'wp-photo-album-plus' );
2421
- elseif ( $comment['status'] == 'spam' ) $s = __( 'Spam' , 'wp-photo-album-plus' );
2422
- elseif ( $comment['status'] == 'trash' ) $s = __( 'Trash' , 'wp-photo-album-plus' );
2423
- wppa_echo( '</td>' );
2424
- }
2425
- wppa_echo( '<td style="padding:0 4px">' . $comment['comment'] . '</td>
2426
- </tr>' );
2427
- }
2428
 
 
 
 
 
 
 
2429
  wppa_echo( '
2430
- </tbody>
2431
- </table>' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2432
  }
2433
- }
2434
 
2435
- wppa_add_inline_script( 'wppa-admin', 'wppaPhotoStatusChange('.$id.');' );
2436
 
2437
- wppa_echo( '
2438
- <div style="clear:both"></div>
2439
- </div>
2440
- <div style="clear:both;margin-top:7px"></div>' );
 
 
2441
 
2442
  } /* foreach photo */
2443
 
3
  * Package: wp-photo-album-plus
4
  *
5
  * edit and delete photos
6
+ * Version 8.2.02.007
7
  *
8
  */
9
 
550
  'cenlft' => __( 'center - left' , 'wp-photo-album-plus' ), 'cencen' => __( 'center - center' , 'wp-photo-album-plus' ), 'cenrht' => __( 'center - right' , 'wp-photo-album-plus' ),
551
  'botlft' => __( 'bottom - left' , 'wp-photo-album-plus' ), 'botcen' => __( 'bottom - center' , 'wp-photo-album-plus' ), 'botrht' => __( 'bottom - right' , 'wp-photo-album-plus' ), );
552
 
553
+ // If ImageMagick is enabled...
554
+ // Fake 'for social media' to use the local file here, not cloudinary.
555
+ // Files from cloudinary do not reload, even with ?ver=...
556
+ if ( wppa_can_admin_magick( $id ) ) {
557
+ wppa( 'for_sm', true );
558
+ }
559
+ $src = wppa_get_thumb_url( $id, false );
560
+ $big = wppa_get_photo_url( $id, false );
561
+ if ( wppa_can_admin_magick( $id ) ) {
562
+ wppa( 'for_sm', false );
563
+ }
564
+
565
  // Album for moderate
566
  if ( $modalbum != $album && $album && ! wppa_get( 'just-edit' ) && wppa_get( 'edit-id' ) != 'trash' ) {
 
 
 
567
  $modalbum = $album;
568
  }
569
 
570
+ // May user change status?
571
+ if ( ( current_user_can( 'wppa_admin' ) || current_user_can( 'wppa_moderate' ) ) ) {
572
+ if ( wppa_switch( 'ext_status_restricted' ) && ! wppa_user_is( 'administrator' ) ) {
573
+ $may_edit_status = false;
574
+ }
575
+ else {
576
+ $may_edit_status = true;
577
+ }
578
+ }
579
+ else {
580
+ $may_edit_status = false;
581
+ }
582
+ // May user change planned delete item?
583
+ $may_change_delete = wppa_user_is( 'administrator' ) || current_user_can( 'wppa_moderate' );
584
+
585
+ // May user change photo sequence no?
586
+ $may_change_porder = wppa_user_is( 'administrator' ) || ! wppa_switch( 'porder_restricted' );
587
+
588
+
589
  // Anchor for scroll to
590
  wppa_echo( '<a id="photo_' . $id . '"></a>' );
591
 
592
+ /* Start the actual display area for the photo settings */
593
+ {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
594
  wppa_echo( '
595
+ <div
596
+ id="photoitem-' . $id . '"
597
+ class="wppa-table-wrap"
598
+ style="display:block;padding:20px"
599
+ >' .
600
+
601
+ // Photo specific nonce field
602
+ '<input
603
+ type="hidden"
604
+ id="photo-nonce-' . $id . '"
605
+ value="' . wp_create_nonce( 'wppa-nonce_' . $id ) . '"
606
+ />' );
607
+
608
+ // Section 1
609
+
610
+ // -- Preview thumbnail and photo name ---
611
+ {
612
+ wppa_echo( '
613
+ <div>' );
614
+ if ( $is_video ) {
615
+ reset( $is_video );
616
+ $big = str_replace( 'xxx', current( $is_video ), $big );
617
+ wppa_echo( '
618
+ <a
619
+ href="' . esc_attr( $big ) . '"
620
+ target="_blank"
621
+ title="' . esc_attr( __( 'Preview fullsize video' , 'wp-photo-album-plus' ) ) . '"
622
+ >' .
623
+ wppa_get_video_html( array( 'id' => $id,
624
+ 'tagid' => 'video-' . $id,
625
+ 'width' => '160',
626
+ 'height' => '160' * wppa_get_videoy( $id ) / wppa_get_videox( $id ),
627
+ 'controls' => false,
628
+ 'use_thumb' => true
629
+ ) ) . '
630
+ </a>' );
631
+ }
632
+ else {
633
+ if ( $has_audio ) {
634
+ $src = wppa_get_thumb_url( $id );
635
+ $big = wppa_get_photo_url( $id );
636
+ }
637
+ wppa_echo( '
638
+ <a
639
+ id="thumba-' . $id . '"
640
+ href="' . esc_attr( $big ) . '"
641
+ target="_blank"
642
+ title="' . esc_attr( __( 'Preview fullsize photo', 'wp-photo-album-plus' ) ) . '"
643
+ >
644
+ <img
645
+ id="thumburl-' . $id . '"' .
646
+ ( wppa_lazy() && $count > '1' ? ' data-' : ' ' ) . 'src="' . esc_url( $src ) . '"
647
+ alt="' . esc_attr( $name ) . '"
648
+ style="max-width:160px;vertical-align:middle"
649
+ />
650
+ </a>' );
651
 
652
+ if ( $has_audio ) {
653
+ $audio = wppa_get_audio_html( array( 'id' => $id,
654
+ 'tagid' => 'audio-' . $id,
 
 
 
 
 
 
 
 
655
  'width' => '160',
656
+ 'controls' => true
657
+ ) );
658
+ wppa_echo( '
659
+ <br>' .
660
+ ( $audio ? $audio :
661
+ '<span style="color:red">' .
662
+ esc_html__( 'Audio disabled', 'wp-photo-album-plus' ) .
663
+ '</span>' ) );
664
+ }
665
+ }
666
+ wppa_echo( '<h1 style="display:inline;margin-left:20px;vertical-align:bottom;">' . wppa_get_photo_name( $id ) . '</h1>' );
667
+ wppa_echo( '
668
+ </div>' );
669
+ }
 
 
 
 
 
 
 
 
 
 
 
670
 
671
+ // --- More or less static data ---
672
+ {
673
+ wppa_echo( '
674
+ <div class="wppa-flex">' .
675
+
676
+ // ID
677
+ '<div>
678
+ <label>' .
679
+ __( 'Id', 'wp-photo-album-plus' ) . '
680
+ </label><br>
681
+ <h4>' .
682
+ strval( intval( $id ) ) . '
683
+ </h4>
684
+ </div>' .
685
+
686
+ // Crypt
687
+ '<div>
688
+ <label>' .
689
+ __( 'Crypt', 'wp-photo-album-plus' ) . '
690
+ </label><br>
691
+ <h4>' .
692
+ htmlspecialchars( $crypt ) . '
693
+ </h4>
694
+ </div>' .
695
+
696
+ // Filename
697
+ '<div style="max-width: 500px;">
698
+ <label>' .
699
+ __( 'Filename', 'wp-photo-album-plus' ) . '
700
+ </label><br>
701
+ <h4>' .
702
+ htmlspecialchars( $filename ) . '
703
+ </h4>
704
+ </div>' .
705
+
706
+ // Upload
707
+ '<div>
708
+ <label>' .
709
+ __( 'Upload', 'wp-photo-album-plus' ) . '
710
+ </label><br>
711
+ <h4>' .
712
+ htmlspecialchars( wppa_local_date( '', $timestamp ) ) . '
713
+ </h4>
714
+ </div>' );
715
+
716
+ // Owner
717
+ if ( ! $owner_editable ) {
718
  wppa_echo( '
719
+ <div>
720
+ <label>' .
721
+ __( 'Owner', 'wp-photo-album-plus' ) . '
722
+ </label><br>
723
+ <h4>' .
724
+ htmlspecialchars( $owner ) . '
725
+ </h4>
726
+ </div>' );
727
  }
728
 
729
+ // Album
730
+ {
731
+ $deleted = false;
732
+ if ( $album <= '-9' ) {
733
+ $album = - ( $album + '9' );
734
+ $deleted = true;
735
+ }
736
  wppa_echo( '
737
+ <div style="max-width: 500px;margin-right: 4px;">
738
+ <label>' .
739
+ __( 'Album', 'wp-photo-album-plus' ) . '
740
+ </label><br>
741
+ <h4>' .
742
+ htmlspecialchars( wppa_get_album_name( $album ) ) . '(' . strval( intval( $album ) ) . ')
743
+ </h4>
744
+ </div>' );
745
+ }
746
 
747
+ // Modified
748
+ {
749
+ $txt = wppa_local_date( '', $modified );
750
+ if ( $deleted ) $txt = __( 'Trashed', 'wp-photo-album-plus' );
751
+ if ( $timestamp >= $modified ) $txt = __( 'Not modified', 'wp-photo-album-plus' );
752
+ wppa_echo( '
753
+ <div>
754
+ <label>' .
755
+ __( 'Modified', 'wp-photo-album-plus' ) . '
756
+ </label><br>
757
+ <h4>' .
758
+ $txt . '
759
+ </h4>
760
+ </div>' );
761
+ }
762
 
763
+ // Exif
764
+ if ( ! wppa_user_is( 'administrator' ) ) {
765
+ wppa_echo( '
766
+ <div>
767
+ <label>' .
768
+ __( 'EXIF Date', 'wp-photo-album-plus' ) . '
769
+ </label><br>
770
+ <h4>' .
771
+ esc_html( $exifdtm ) . '
772
+ </h4>
773
+ </div>' );
774
+ }
775
 
776
+ // Location
777
+ if ( $photo['location'] && ! wppa_switch( 'geo_edit' ) ) {
778
+ $loc = $location ? $location : '///';
779
+ $geo = explode( '/', $loc );
780
+ wppa_echo( '
781
+ <div>
782
+ <label>' .
783
+ __( 'Location:' , 'wp-photo-album-plus' ) . '
784
+ </label>
785
+ <h4>' .
786
+ esc_html( $geo['0'].' '.$geo['1'].'. ' ) . '
787
+ </h4>
788
+ </div>' );
789
+ }
790
 
791
+ // P_order
792
+ if ( $sortby_orderno && ! $may_change_porder ) {
793
+ wppa_echo( '
794
+ <div>
795
+ <label>' .
796
+ __( 'Photo sort order #:', 'wp-photo-album-plus' ) . '
797
+ </label>
798
+ <h4>' .
799
+ $p_order . '
800
+ </h4>
801
+ </div>' );
802
+ }
803
 
804
+ // Rating
805
+ {
806
+ $entries = wppa_get_rating_count_by_id( $id );
807
+ if ( $entries ) {
808
+ if ( wppa_opt( 'rating_display_type' ) == 'likes' ) {
809
+ $label = __( 'Likes', 'wp-photo-album-plus' );
810
+ $value = strval( intval( $entries ) );
811
+ }
812
+ else {
813
+ $label = __( 'Rating (#, avg)', 'wp-photo-album-plus' );
814
+ $value = wppa_get_rating_by_id( $id, 'nolabel' );
815
+ }
816
+ }
817
+ else {
818
+ $label = __( 'Rating', 'wp-photo-album-plus' );
819
+ $value = __( 'None', 'wp-photo-album-plus' );
820
+ }
821
+ wppa_echo( '
822
+ <div>
823
+ <label>' .
824
+ $label . '
825
+ </label>
826
+ <h4>' .
827
+ $value . '
828
+ </h4>
829
+ </div>' );
830
+ }
831
 
832
+ // Dislikes
833
+ $dislikes = wppa_dislike_get( $id );
834
+ if ( $dislikes ) {
835
+ wppa_echo( '
836
+ <div>
837
+ <label>' .
838
+ __( 'Dislikes', 'wp-photo-album-plus' ) . '
839
+ </label>
840
+ <h4>' .
841
+ strval( intval( $dislikes ) ) . '
842
+ </h4>
843
+ </div>' );
844
+ }
845
 
846
+ // Pending votes
847
+ $pending = wppa_pendrat_get( $id );
848
+ if ( $pending ) {
849
+ wppa_echo( '
850
+ <div>
851
+ <label>' .
852
+ __( 'Pending votes', 'wp-photo-album-plus' ) . '
853
+ </label>
854
+ <h4>' .
855
+ strval( intval( $pending ) ) . '
856
+ </h4>
857
+ </div>' );
858
+ }
 
 
 
 
 
 
 
 
859
 
860
+ // Views
861
+ if ( wppa_switch( 'track_viewcounts' ) ) {
862
+ wppa_echo( '
863
+ <div>
864
+ <label>' .
865
+ __( 'Views', 'wp-photo-album-plus' ) . '
866
+ </label>
867
+ <h4>' .
868
+ strval( intval( $views ) ) . '
869
+ </h4>
870
+ </div>' );
871
+ }
 
 
 
872
 
873
+ // Clicks
874
+ if ( wppa_switch( 'track_clickcounts' ) ) {
875
+ wppa_echo( '
876
+ <div>
877
+ <label>' .
878
+ __( 'Clicks', 'wp-photo-album-plus' ) . '
879
+ </label>
880
+ <h4>' .
881
+ strval( intval( $clicks ) ) . '
882
+ </h4>
883
+ </div>' );
884
+ }
885
 
886
+ // Downloads
887
+ {
888
+ wppa_echo( '
889
+ <div>
890
+ <label>' .
891
+ __( 'Downloads', 'wp-photo-album-plus' ) . '
892
+ </label>
893
+ <h4>' .
894
+ strval( intval( $dlcount ) ) . '
895
+ </h4>
896
+ </div>' );
897
+ }
898
 
899
+ // Status
900
+ if ( ! $may_edit_status ) {
901
+ if ( $status == 'pending' ) $s = __( 'Pending', 'wp-photo-album-plus' );
902
+ elseif ( $status == 'publish' ) $s = __( 'Publish', 'wp-photo-album-plus' );
903
+ elseif ( $status == 'featured' ) $s = __( 'Featured', 'wp-photo-album-plus' );
904
+ elseif ( $status == 'gold' ) $s = __( 'Gold', 'wp-photo-album-plus' );
905
+ elseif ( $status == 'silver' ) $s = __( 'Silver', 'wp-photo-album-plus' );
906
+ elseif ( $status == 'bronze' ) $s = __( 'Bronze', 'wp-photo-album-plus' );
907
+ elseif ( $status == 'scheduled' ) $s = __( 'Scheduled', 'wp-photo-album-plus' );
908
+ elseif ( $status == 'private' ) $s = __( 'Private', 'wp-photo-album-plus' );
909
+ wppa_echo( '
910
+ <div>
911
+ <label>' .
912
+ __( 'Status', 'wp-photo-album-plus' ) . '
913
+ </label>
914
+ <h4>' .
915
+ $s . '
916
+ </h4>
917
+ </div>' );
918
+ }
919
 
920
+ // Schedule for delete
921
+ if ( ! wppa_user_is( 'administrator' ) && $owner != wppa_get_user() ) {
922
+ if ( $scheduledel ) {
923
+ wppa_echo( '
924
+ <div>
925
+ <label>' .
926
+ __( 'Delete at', 'wp-photo-album-plus' ) . '
927
+ </label>
928
+ <h4>' .
929
+ wppa_get_date_time_select_html( 'delphoto', $id, false ) . '
930
+ </h4>
931
+ </div>' );
932
+ }
933
+ }
 
934
 
935
+ wppa_echo( '
936
+ </div>' );
937
+ }
938
 
939
+ // --- Available files ---
940
+ {
941
+ wppa_echo( '
942
+ <div class="wppa-flex">' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
943
 
944
+ // Pdf
945
+ if ( wppa_is_pdf( $id ) ) {
946
+ $sp = wppa_get_source_path( $id );
947
+ $fs = wppa_get_filesize( $sp );
948
+ wppa_echo( '
949
+ <div>
950
+ <label>' .
951
+ __( 'Document file', 'wp-photo-album-plus' ) . '
952
+ </label><br>
953
+ <h4>' .
954
+ $fs . '
955
+ </h4>
956
+ </div>' );
957
+ }
958
 
959
+ // Source
960
+ $sp = wppa_get_o1_source_path( $id );
961
+ if ( ! wppa_is_file( $sp ) ) {
962
+ $sp = wppa_get_source_path( $id );
963
+ }
964
+ if ( wppa_is_pdf( $id ) ) {
965
+ $sp = wppa_strip_ext( $sp ) . '.jpg';
966
+ if ( ! wppa_is_file( $sp ) ) {
967
+ $sp = wppa_strip_ext( $sp ) . '.png';
968
+ }
969
+ }
970
+ if ( is_file( $sp ) ) {
971
+ $ima = getimagesize( $sp );
972
+ $txt = $ima['0'] . ' x ' . $ima['1'] . ' (' . sprintf('%4.2fMp', ( $ima['0'] * $ima['1'] ) / ( 1024 * 1024 ) ) . ') ' . wppa_get_filesize( $sp ) . '.' . $br;
973
+ }
974
+ else {
975
+ $txt = __( 'Unavailable', 'wp-photo-album-plus' );
976
+ }
977
+ wppa_echo( '
978
+ <div style="max-width:300px">
979
+ <label>' .
980
+ __( 'Source file', 'wp-photo-album-plus' ) . '
981
+ </label><br>
982
+ <h4>' .
983
+ $txt . '
984
+ </h4>
985
+ </div>' );
986
+
987
+ // Display
988
+ if ( $is_video || $has_audio ) {
989
+ $lbl = __( 'Poster file', 'wp-photo-album-plus' );
990
+ }
991
+ else {
992
+ $lbl = __( 'Display file', 'wp-photo-album-plus' );
993
+ }
994
+ $dp = wppa_get_photo_path( $id );
995
+ if ( is_file( $dp ) ) {
996
+ $txt = '
997
+ <span id="photox-' . $id . '">' . wppa_get_photox( $id ) . '</span> x
998
+ <span id="photoy-' . $id . '">' . wppa_get_photoy( $id ) . '</span>
999
+ <span id="photofilesize-' . $id . '">: ' . wppa_get_filesize( $dp ) . '</span>';
1000
+ }
1001
+ else {
1002
+ $txt = '
1003
+ <span style="color:red">' .
1004
+ __( 'Unavailable', 'wp-photo-album-plus' ) . '
1005
+ </span>';
1006
+ }
1007
+ wppa_echo( '
1008
+ <div style="max-width:300px">
1009
+ <label>' .
1010
+ $lbl . '
1011
+ </label><br>
1012
+ <h4>' .
1013
+ $txt . '
1014
+ </h4>
1015
+ </div>' );
1016
+
1017
+ // Thumbnail
1018
+ if ( ! $is_video ) {
1019
+ $lbl = __( 'Thumbnail file', 'wp-photo-album-plus' );
1020
+ $tp = wppa_get_thumb_path( $id );
1021
+ if ( is_file( $tp ) ) {
1022
+ $txt = '
1023
+ <span id="thumbx-' . $id . '">' . wppa_get_thumbx( $id ) . '</span> x
1024
+ <span id="thumby-' . $id . '">' . wppa_get_thumby( $id ) . '</span>
1025
+ <span id="thumbfilesize-' . $id . '">: ' . wppa_get_filesize( $tp ) . '</span>
1026
+ &nbsp;
1027
+ <input
1028
+ type="checkbox"' .
1029
+ ( $thumblock ? ' checked' : '' ) . '
1030
+ onchange="wppaAjaxUpdatePhoto( ' . strval( intval( $id ) ) . ', \'thumblock\', jQuery(this).prop(\'checked\') ? 1 : 0 )" /> ' .
1031
+ __( 'Locked', 'wp-photo-album-plus' );
1032
+ }
1033
+ else {
1034
+ $txt = '
1035
+ <span style="color:red">' .
1036
+ __( 'Unavailable', 'wp-photo-album-plus' ) . '.
1037
+ </span>';
1038
+ }
1039
+ wppa_echo( '
1040
+ <div style="max-width:300px">
1041
+ <label>' .
1042
+ $lbl . '
1043
+ </label><br>
1044
+ <h4>' .
1045
+ $txt . '
1046
+ </h4>
1047
+ </div>' );
1048
+ }
1049
 
1050
+ // Local CDN
1051
+ if ( wppa_cdn( 'admin' ) == 'local' ) {
1052
+ $lbl = __( 'Local CDN files', 'wp-photo-album-plus' );
1053
+ $txt = '<span id="cdnfiles-' . $id . '">';
1054
+
1055
+ $files = wppa_cdn_files( $id );
1056
+ if ( !empty( $files ) ) {
1057
+ foreach( $files as $file ) {
1058
+ if ( basename( $file ) != 'index.php' ) {
1059
+ $t = explode( '.', basename( $file ) );
1060
+ $t = explode( '-', $t[0] );
1061
+ $x = $t[0];
1062
+ $y = $t[1];
1063
+ $size = filesize( $file );
1064
+ $txt .= '
1065
+ <a
1066
+ href="' . wppa_cdn_url( $id, $x, $y ) . '"
1067
+ target="_blank"
1068
+ >' .
1069
+ basename( $file ) .
1070
+ '</a> ' .
1071
+ sprintf( '%4.2fkB', $size / 1024 ) . '<br>';
1072
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1073
  }
1074
+ }
1075
+ else {
1076
+ $txt .= __( 'None', 'wp-photo-album-plus' );
1077
+ }
1078
+ $txt .= '</span>';
1079
+ wppa_echo( '
1080
+ <div>
1081
+ <label>' .
1082
+ $lbl . '
1083
+ </label><br>
1084
+ <h4>' .
1085
+ $txt . '
1086
+ </h4>
1087
+ </div>' );
1088
+ }
1089
 
1090
+ // Video
1091
+ if ( $b_is_video ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1092
 
1093
+ // Width
1094
+ wppa_echo( '
1095
+ <div>
1096
+ <label>' .
1097
+ __( 'Video width', 'wp-photo-album-plus' ) . '
1098
+ </label><br>
1099
+ <input
1100
+ style="width:50px;margin:0 4px"
1101
+ onchange="wppaAjaxUpdatePhoto( ' . strval( intval( $id ) ) . ', \'videox\', this.value)"
1102
+ value="' . esc_attr( $videox ) . '"
1103
+ />px
1104
+ <br>' . sprintf( __( '(0=default:%s)', 'wp-photo-album-plus' ), wppa_opt( 'video_width' ) ) . '
1105
+ </div>' );
1106
+
1107
+ // Height
1108
+ wppa_echo( '
1109
+ <div>
1110
+ <label>' .
1111
+ __( 'Video height', 'wp-photo-album-plus' ) . '
1112
+ </label><br>
1113
+ <input
1114
+ style="width:50px;margin:0 4px"
1115
+ onchange="wppaAjaxUpdatePhoto( ' . strval( intval( $id ) ) . ', \'videoy\', this.value)"
1116
+ value="' . esc_attr( $videoy ) . '"
1117
+ />px
1118
+ <br>' . sprintf( __( '(0=default:%s)', 'wp-photo-album-plus' ), wppa_opt( 'video_height' ) ) . '
1119
+ </div>' );
1120
+
1121
+ // Duratiuon
1122
+ if ( $duration ) {
1123
+ $lbl = __( 'Duration', 'wp-photo-album-plus' );
1124
+ $duration = intval( $duration * 100 ) / 100;
1125
+ if ( $duration < 120.0 ) {
1126
+ $txt = sprintf( __( '%s seconds', 'wp-photo-album-plus' ) ,$duration );
1127
  }
1128
  else {
1129
+ $txt = sprintf( __( '%s minutes and %s seconds', 'wp-photo-album-plus' ),
1130
+ sprintf( '%d', floor( $duration / 60 ) ),
1131
+ sprintf( '%4.2f', $duration % 60 ) );
1132
  }
1133
+ wppa_echo( '
1134
+ <div>
1135
+ <label>' .
1136
+ $lbl . '
1137
+ </label><br>
1138
+ <h4>' .
1139
+ $txt . '
1140
+ </h4>
1141
+ </div>' );
1142
+ }
1143
 
1144
+ // Formats
1145
+ $txt = '';
1146
+ foreach ( $is_video as $fmt ) {
1147
+ $txt .= $fmt . ' (' . wppa_get_filesize( str_replace( 'xxx', $fmt, wppa_get_photo_path( $id, false ) ) ) . ')<br>';
1148
+ }
1149
+ wppa_echo( '
1150
+ <div>
1151
+ <label>' .
1152
+ __( 'Formats', 'wp-photo-album-plus' ) . '
1153
+ </label><br>
1154
+ <h4>' .
1155
+ $txt . '
1156
+ </h4>
1157
+ </div>' );
1158
+ }
 
1159
 
1160
+ // Audio
1161
+ if ( $b_has_audio ) {
1162
+ $txt = '';
1163
+ foreach ( $has_audio as $fmt ) {
1164
+ $txt .= $fmt . ' (' . wppa_get_filesize( str_replace( 'xxx', $fmt, wppa_get_photo_path( $id, false ) ) ) . ')<br>';
1165
+ }
1166
+ wppa_echo( '
1167
+ <div>
1168
+ <label>' .
1169
+ __( 'Formats', 'wp-photo-album-plus' ) . '
1170
+ </label><br>
1171
+ <h4>' .
1172
+ $txt . '
1173
+ </h4>
1174
+ </div>' );
1175
+ }
 
 
 
 
 
 
1176
 
1177
+ wppa_echo( '</div>' );
1178
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1179
 
1180
+ // Update status field
1181
+ {
1182
+ wppa_echo( '
1183
+ <h3 style="margin-left:1em">' .
1184
+ __( 'Remark:', 'wp-photo-album-plus' ) . '
1185
+ <span
1186
+ id="remark-' . $id . '"
1187
+ style="font-weight:bold;color:#00AA00">' .
1188
+ ( $is_video ? sprintf( __( 'Video %s is not modified yet', 'wp-photo-album-plus' ), $id ) :
1189
+ sprintf( __( 'Photo %s is not modified yet', 'wp-photo-album-plus' ), $id ) ) . '
1190
+ </span>
1191
+ </h3>' );
1192
+ }
1193
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1194
 
1195
+ wppa_echo( '<!-- Section 2 simple settings -->
1196
+ <div class="wppa-flex">' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1197
 
1198
+ // Owner
1199
+ if ( $owner_editable ) {
1200
  wppa_echo( '
1201
+ <div>
1202
+ <label
1203
+ for="owner-' . $id . '">' .
1204
+ __( 'Owned by:', 'wp-photo-album-plus' ) . '
1205
+ </label><br>
1206
+ <input
1207
+ id="owner-' . $id . '"
1208
+ type="text"
1209
+ onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'owner\', this.value )"
1210
+ value="' . esc_attr( $owner ) . '"
1211
+ />
1212
+ </div>' );
1213
+ }
1214
 
1215
+ // Exif date-time
1216
+ if ( wppa_user_is( 'administrator' ) ) { // Admin may edit exif date
1217
+ wppa_echo( '
1218
+ <div>
1219
+ <label
1220
+ for="exifdtm-' . $id . '">' .
1221
+ __( 'EXIF Date:', 'wp-photo-album-plus' ) . '
1222
+ </label><br>
1223
+ <input
1224
+ id="exifdtm-' . $id . '"
1225
+ type="text"
1226
+ style="width:125px"
1227
+ onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'exifdtm\', this.value)"
1228
+ value="' . esc_attr( $exifdtm ) . '"
1229
+ />
1230
+ </div>' );
1231
+ }
1232
 
1233
+ // Location
1234
+ if ( wppa_switch( 'geo_edit' ) ) {
1235
+ $loc = $location ? $location : '///';
1236
+ $geo = explode( '/', $loc );
1237
+ wppa_echo( '
1238
+ <div>
1239
+ <label
1240
+ for="lat-' . $id . '">' .
1241
+ __( 'Location Lat:' , 'wp-photo-album-plus' ) . esc_html( $geo['0'] ) . '
1242
+ </label><br>
1243
+ <input
1244
+ id="lat-' . $id . '"
1245
+ type="text"
1246
+ style="width:100px"
1247
+ onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'lat\', this.value)"
1248
+ value="' . esc_attr( $geo['2'] ) . '"
1249
+ />
1250
+ </div>
1251
+ <div>
1252
+ <label
1253
+ for="lon-' . $id . '">' .
1254
+ __( 'Location Lon:' , 'wp-photo-album-plus' ) . esc_html( $geo['1'] ) . '
1255
+ </label><br>
1256
+ <input
1257
+ id="lon-' . $id . '"
1258
+ type="text"
1259
+ style="width:100px"
1260
+ onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'lon\', this.value)"
1261
+ value="' . esc_attr( $geo['3'] ) . '"
1262
+ />
1263
+ </div>' );
1264
+ }
 
1265
 
1266
+ // Changeable p_order
1267
+ if ( $sortby_orderno && $may_change_porder ) {
1268
+ wppa_echo( '
1269
+ <div>
1270
+ <label
1271
+ for="porder-' . $id . '">' .
1272
+ __( 'Photo sort order #:', 'wp-photo-album-plus' ) . '
1273
+ </label><br>
1274
+ <input
1275
+ type="text"
1276
+ id="porder-' . $id . '"
1277
+ value="' . esc_attr( $p_order ) . '"
1278
+ style="width:100px"
1279
+ onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'p_order\', this.value)"
1280
+ />
1281
+ </div>' );
1282
+ }
1283
 
1284
+ // Status
1285
+ if ( $may_edit_status ) {
1286
+ $sel = ' selected';
1287
+ if ( wppa_switch( 'ext_status_restricted' ) && ! wppa_user_is( 'administrator' ) ) {
1288
+ $dis = ' disabled';
1289
+ }
1290
+ else {
1291
+ $dis = '';
1292
+ }
1293
+ wppa_echo( '
1294
+ <div>
1295
+ <label
1296
+ for="status-' . $id . '">' .
1297
+ __( 'Status' , 'wp-photo-album-plus' ) . '
1298
+ </label><br>
1299
+ <select
1300
+ id="status-' . $id . '"
1301
+ onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'status\', this.value); wppaPhotoStatusChange( ' . $id . ' )">
1302
+ <option value="pending"' . ( $status == 'pending' ? $sel : '' ) . ' >' .
1303
+ __( 'Pending', 'wp-photo-album-plus' ) . '
1304
+ </option>
1305
+ <option value="publish"' . ( $status =='publish' ? $sel : '' ) . ' >' .
1306
+ __( 'Publish', 'wp-photo-album-plus' ) . '
1307
+ </option>
1308
+ <option value="featured"' . ( $status == 'featured' ? $sel : '' ) . $dis . ' >' .
1309
+ __( 'Featured', 'wp-photo-album-plus' ) . '
1310
+ </option>
1311
+ <option value="gold"' . ( $status == 'gold' ? $sel : '' ) . $dis . ' >' .
1312
+ __( 'Gold', 'wp-photo-album-plus' ) . '
1313
+ </option>
1314
+ <option value="silver"' . ( $status == 'silver' ? $sel : '' ) . $dis . ' >' .
1315
+ __( 'Silver', 'wp-photo-album-plus' ) . '
1316
+ </option>
1317
+ <option value="bronze"' . ( $status == 'bronze' ? $sel : '' ) . $dis . ' >' .
1318
+ __( 'Bronze', 'wp-photo-album-plus' ) . '
1319
+ </option>
1320
+ <option value="scheduled"' . ( $status == 'scheduled' ? $sel : '' ) . $dis . ' >' .
1321
+ __( 'Scheduled', 'wp-photo-album-plus' ) . '
1322
+ </option>
1323
+ <option value="private"' . ( $status == 'private' ? $sel : '' ) . $dis . ' >' .
1324
+ __( 'Private', 'wp-photo-album-plus' ) . '
1325
+ </option>
1326
+ </select>' .
1327
+ wppa_get_date_time_select_html( 'photo', $id, true ) . '
1328
+ <span id="psdesc-' . $id . '" class="description" style="display:none">' .
1329
+ __( 'Note: Featured photos should have a descriptive name; a name a search engine will look for!', 'wp-photo-album-plus' ) . '
1330
+ </span>
1331
+ </div>' );
1332
+ }
1333
 
1334
+ // Stereo
1335
+ if ( wppa_switch( 'enable_stereo' ) && ! $is_multi ) {
1336
+ wppa_echo( '
1337
+ <div>
1338
+ <label
1339
+ for="stereo-' . $id . '">' .
1340
+ __( 'Stereophoto', 'wp-photo-album-plus' ) . '
1341
+ </label><br>
1342
+ <select
1343
+ id="stereo-' . $id . '"
1344
+ onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'stereo\', this.value, true)"
1345
+ >
1346
+ <option value="0"' . ( $stereo == '0' ? ' selected' : '' ) . '>' .
1347
+ __( 'No stereo image', 'wp-photo-album-plus' ) . '
1348
+ </option>
1349
+ <option value="1"' . ( $stereo == '1' ? ' selected' : '' ) . '>' .
1350
+ __( 'Left - right stereo image', 'wp-photo-album-plus' ) . '
1351
+ </option>
1352
+ <option value="-1"' . ( $stereo == '-1' ? ' selected' : '' ) . '>' .
1353
+ __( 'Right - left stereo image', 'wp-photo-album-plus' ) . '
1354
+ </option>
1355
+ </select>
1356
+ </div>' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1357
 
1358
+ /*
1359
+ __( 'Images:', 'wp-photo-album-plus' ) . ' ' );
1360
 
1361
+ $files = wppa_glob( WPPA_UPLOAD_PATH . '/stereo/' . $id . '-*.*' );
 
 
 
1362
 
1363
+ if ( empty( $files ) ) {
1364
+ wppa_echo( __( 'None', 'wp-photo-album-plus' ) . '. ' );
1365
+ }
1366
+ else {
1367
+ sort( $files );
1368
+ $c = 0;
1369
+ foreach ( $files as $file ) {
1370
+ wppa_echo( '
1371
+ <a href="' . str_replace( WPPA_UPLOAD_PATH, WPPA_UPLOAD_URL, $file ) . '" target="_blank">' .
1372
+ basename( $file ) . '
1373
+ </a>' );
1374
+ $c++;
1375
+ if ( $c == count( $files ) ) {
1376
+ wppa_echo( '. ' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1377
  }
1378
+ else {
1379
+ wppa_echo( ', ' );
1380
+ }
1381
+ }
1382
+ }
1383
+ wppa_echo( $br );
1384
+ */
1385
+ }
1386
 
1387
+ // Panorama
1388
+ if ( wppa_switch( 'enable_panorama' ) && ! $b_is_video ) {
1389
+ $can_panorama = $photoy && $photox / $photoy >= 1.999;
1390
+ if ( $can_panorama ) {
1391
  wppa_echo( '
1392
+ <div>
1393
+ <label
1394
+ for="panorama-' . $id . '">' .
1395
+ __( 'Panorama', 'wp-photo-album-plus' ) . '
1396
+ </label><br>
1397
+ <select
1398
+ id="panorama-' . $id . '"
1399
+ onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'panorama\', this.value, true )">
1400
+ <option value="0"' . ( $panorama == '0' ? ' selected' : '' ) . '>' . __( '- none -', 'wp-photo-album-plus' ) . '</option>
1401
+ <option value="1"' . ( $panorama == '1' ? ' selected' : '' ) . '>' . __( '360&deg; Spheric', 'wp-photo-album-plus' ) . '</option>
1402
+ <option value="2"' . ( $panorama == '2' ? ' selected' : '' ) . '>' . __( 'Non 360&deg; Flat', 'wp-photo-album-plus' ) . '</option>
1403
+ </select>
1404
+ </div>' );
 
 
1405
 
1406
+ $source_file = wppa_get_source_path( $id );
1407
+ if ( wppa_is_file( $source_file ) ) {
1408
+ $source_file_sizes = wppa_getimagesize( $source_file );
1409
 
1410
+ if ( $panorama == '1' && $source_file_sizes[0] / $source_file_sizes[1] > 2.001 ) {
1411
+ $t = array( 120, 150, 180, 210, 240, 270, 300, 330, 340, 350, 360, 370, 380, 390, 400, 410, 420, 430, 440, 450 );
 
1412
  wppa_echo( '
1413
+ <div>
1414
+ <label
1415
+ for="make360-' . $id . '">' .
1416
+ __( 'Make 360 from', 'wp-photo-album-plus' ) . '
1417
+ </label><br>
1418
+ <select
1419
+ onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'make360\', this.value, true)"
1420
+ id="make360-' . $id . '"
1421
+ title="' . esc_attr( __( 'Select the closest angle you originally made the panorama', 'wp-photo-album-plus' ) ) . '">
1422
+ <option value="">'.__('Select', 'wp-photo-album-plus' ).'</option>' );
1423
+ foreach( $t as $v ) {
1424
+ wppa_echo( '<option value="'.$v.'" '.($v==$angle?'selected':'').'>'.$v.'&deg;</option>' );
1425
+ }
1426
+ wppa_echo( '
1427
+ <option value="0">' . __( 'Undo', 'wp-photo-album-plus' ) . '</option>
1428
+ </select>
1429
+ </div>' );
 
 
 
 
 
 
 
 
 
 
 
 
 
1430
  }
1431
  }
1432
+ }
1433
+ }
1434
 
1435
+ // Watermark
1436
+ if ( wppa_switch( 'watermark_on' ) ) {
1437
+
1438
+ // Get the current watermark file settings
1439
+ $temp = wppa_get_water_file_and_pos( $id );
1440
+ $wmfile = isset( $temp['file'] ) ? $temp['file'] : '';
1441
+ $wmpos = isset( $temp['pos'] ) && isset ( $wms[$temp['pos']] ) ? $wms[$temp['pos']] : '';
1442
+
1443
+ $user = wppa_get_user();
1444
+ $has_source = wppa_is_file( wppa_get_source_path( $id ) );
1445
+ $can_remove = ( wppa_opt( 'watermark_file' ) == '--- none ---' ) ? '1' : '0';
1446
+ if ( wppa_switch( 'watermark_user' ) || current_user_can( 'wppa_settings' ) ) {
1447
+ wppa_echo( '
1448
+ <div>
1449
+ <label
1450
+ for="wmfsel_' . $id . '">' .
1451
+ __( 'Watermark', 'wp-photo-album-plus' ) . '
1452
+ </label><br>
1453
+ <select
1454
+ id="wmfsel_' . $id . '"
1455
+ onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'wppa_watermark_file_' . $user . '\', this.value)"
1456
+ >' .
1457
+ wppa_watermark_file_select( 'user', $album ) . '
1458
+ </select>
1459
+ </div>
1460
+ <div>
1461
+ <label
1462
+ for="wmpsel_' . $id . '">' .
1463
+ __( 'Position', 'wp-photo-album-plus' ) . '
1464
+ </label><br>
1465
+ <select
1466
+ id="wmpsel_' . $id . '"
1467
+ onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'wppa_watermark_pos_' . $user . '\', this.value)"
1468
+ >' .
1469
+ wppa_watermark_pos_select( 'user', $album ) . '
1470
+ </select>
1471
+ </div>
1472
+ <div>
1473
+ <label>
1474
+ &nbsp;
1475
+ </label><br>
1476
  <input
1477
  type="button"
1478
+ class="button wppa-admin-button"
1479
+ value="' . esc_attr( __( 'Apply watermark', 'wp-photo-album-plus' ) ) . '"
1480
+ onclick="wppaTryWatermark( ' . $id . ', ' . $has_source . ', ' . $can_remove . ' )"
1481
+ />
1482
+ <img
1483
+ id="wppa-water-spin-' . $id . '"
1484
+ src="' . wppa_get_imgdir() . 'spinner.gif"
1485
+ alt="Spin"
1486
+ style="visibility:hidden"
1487
+ />
1488
+ </div>' );
1489
+ }
1490
+ /*
1491
+ elseif ( basename( $wmfile ) != '--- none ---' ) {
1492
+ wppa_echo(
1493
+ __( 'Watermark:', 'wp-photo-album-plus' ) . ' ' .
1494
+ __( 'File:', 'wp-photo-album-plus' ) . ' ' . strip_tags( basename( $wmfile ) ) . ' ' .
1495
+ __( 'Pos:', 'wp-photo-album-plus' ) . ' ' . strip_tags( $wmpos ) );
1496
+ }
1497
+ */
1498
+ }
1499
 
1500
+ // Schedule for delete
1501
+ if ( wppa_user_is( 'administrator' ) || $owner == wppa_get_user() ) {
1502
+ if ( $may_change_delete ) {
1503
+ wppa_echo( '
1504
+ <div style="max-width: 500px;">
1505
+ <label
1506
+ for="scheduledel-' . $id . '">' .
1507
+ __( 'Delete at', 'wp-photo-album-plus' ) . '
1508
+ </label><br>
1509
  <input
1510
+ type="checkbox"
1511
+ id="scheduledel-' . $id . '"' .
1512
+ ( $scheduledel ? ' checked' : '' ) .
1513
+ ( $may_change_delete ? '' : ' disabled' ) . '
1514
+ onchange="wppaTryScheduledel( ' . $id . ' )"
1515
+ /> ' .
1516
+ wppa_get_date_time_select_html( 'delphoto', $id, true ) . '
1517
+ </div>' );
1518
+ }
1519
+ }
1520
 
1521
+ wppa_echo( '
1522
+ </div>
1523
+ <!-- End section 2 simple settings -->' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1524
 
1525
+ wppa_echo( '
1526
+ <!-- Section 3, Actions -->
1527
+ <div class="wppa-flex">' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1528
 
1529
+ // Move/copy
1530
+ if ( ! $quick ) {
 
 
 
 
 
 
 
 
 
 
 
 
1531
 
1532
+ $max = wppa_opt( 'photo_admin_max_albums' );
1533
+ if ( ! $max || wppa_get_total_album_count() < $max ) {
1534
+
1535
+ // If not done yet, get the album options html with the current album excluded
1536
+ if ( ! isset( $album_select[$album] ) ) {
1537
+ $album_select[$album] = wppa_album_select_a( array( 'checkaccess' => true,
1538
+ 'path' => true,
1539
+ 'exclude' => $album,
1540
+ 'selected' => '0',
1541
+ 'addpleaseselect' => true,
1542
+ 'sort' => true,
1543
+ )
1544
+ );
 
 
 
 
 
 
 
 
 
 
 
 
 
1545
  }
1546
 
1547
+ wppa_echo( '
1548
+ <div style="max-width:400px;">
1549
+ <label>' .
1550
+ __( 'Target album for copy/move:', 'wp-photo-album-plus' ) . '
1551
+ </label><br>
1552
+ <select
1553
+ id="target-' . $id . '"
1554
+ style="max-width:350px">' .
1555
+ $album_select[$album] . '
1556
+ </select>
1557
+ </div>' );
1558
+ }
1559
+ else {
1560
+ wppa_echo( '
1561
+ <div>
1562
+ <label>' .
1563
+ __( 'Target album for copy/move:', 'wp-photo-album-plus' ) . '
1564
+ </label><br>
1565
  <input
1566
+ id="target-' . $id . '"
1567
+ type="number"
1568
+ style="height:20px"
1569
+ placeholder="' . __( 'Album id', 'wp-photo-album-plus' ) . '"
1570
  />
1571
+ </div>' );
1572
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1573
 
1574
  wppa_echo( '
1575
+ <div style="max-width:500px;">
1576
+ <label>
1577
+ &nbsp;
1578
+ </label><br>
1579
+ <input
1580
+ type="button"
1581
+ class="wppa-admin-button button"
1582
+ onclick="wppaTryMove( ' . $id . ', ' . $b_is_video . ' )"
1583
+ value="' . ( $b_is_video ? $mvt : $mpt ) . '"
1584
+ />
1585
+ <input
1586
+ type="button"
1587
+ class="wppa-admin-button button"
1588
+ onclick="wppaTryCopy( ' . $id . ', ' . $b_is_video . ' )"
1589
+ value="' . ( $b_is_video ? $cvt : $cpt ) . '"
1590
+ />
1591
+ </div>' );
1592
+ }
 
 
 
 
 
 
 
 
 
 
 
 
1593
 
1594
+ // Rotate
1595
+ if ( ! $b_is_video ) {
1596
+ if ( ! wppa_can_admin_magick( $id ) ) {
1597
+ wppa_echo( '
1598
+ <div>
1599
+ <label>
1600
+ &nbsp;
1601
+ </label><br>
1602
  <input
1603
  type="button"
1604
+ class="wppa-admin-button button"
1605
+ onclick="wppaTryRotLeft( ' . $id . ' )"
1606
  value="' . esc_attr( __( 'Rotate left', 'wp-photo-album-plus' ) ) . '"
1607
+ />
1608
+ </div>
1609
+ <div>
1610
+ <label>
1611
+ &nbsp;
1612
+ </label><br>
1613
  <input
1614
  type="button"
1615
+ class="wppa-admin-button button"
1616
+ onclick="wppaTryRot180( ' . $id . ' )"
1617
  value="' . esc_attr( __( 'Rotate 180&deg;', 'wp-photo-album-plus' ) ) . '"
1618
+ />
1619
+ </div>
1620
+ <div>
1621
+ <label>
1622
+ &nbsp;
1623
+ </label><br>
1624
  <input
1625
  type="button"
1626
+ class="wppa-admin-button button"
1627
+ onclick="wppaTryRotRight( ' . $id . ' )"
1628
  value="' . esc_attr( __( 'Rotate right', 'wp-photo-album-plus' ) ) . '"
1629
+ />
1630
+ </div>
1631
+ <div>
1632
+ <label>
1633
+ &nbsp;
1634
+ </label><br>
1635
  <input
1636
  type="button"
1637
+ class="wppa-admin-button button"
1638
+ onclick="wppaTryFlip( ' . $id . ' )"
1639
  value="' . esc_attr( __( 'Flip', 'wp-photo-album-plus' ) ) . '&thinsp;&#8212;"
1640
+ />
1641
+ </div>
1642
+ <div>
1643
+ <label>
1644
+ &nbsp;
1645
+ </label><br>
1646
  <input
1647
  type="button"
1648
+ class="wppa-admin-button button"
1649
+ onclick="wppaTryFlop( ' . $id . ' )"
1650
+ value="' . esc_attr( __( 'Flip', 'wp-photo-album-plus' ) ) . ' |"
1651
+ />
1652
+ </div>' );
1653
+ }
1654
+ }
1655
 
1656
+ // Remake displayfiles
1657
+ if ( ! $is_video ) {
1658
+ wppa_echo( '
1659
+ <div>
1660
+ <label>
1661
+ &nbsp;
1662
+ </label><br>
1663
+ <input
1664
+ type="button"
1665
+ class="wppa-admin-button button"
1666
+ title="' . esc_attr( __( 'Remake display file and thumbnail file', 'wp-photo-album-plus' ) ) . '"
1667
+ onclick="wppaAjaxUpdatePhoto( ' . $id . ', \'remake\', 0 )"
1668
+ value="' . esc_attr( __( 'Remake files', 'wp-photo-album-plus' ) ) . '"
1669
+ />
1670
+ </div>' );
1671
+ }
1672
 
1673
+ // Remake thumbnail
1674
+ if ( ! $is_video ) {
1675
+ wppa_echo( '
1676
+ <div style="max-width:500px;">
1677
+ <label>
1678
+ &nbsp;
1679
+ </label><br>
1680
+ <input
1681
+ type="button"
1682
+ class="wppa-admin-button button"
1683
+ title="' . esc_attr( __( 'Remake thumbnail file', 'wp-photo-album-plus' ) ) . '"
1684
+ onclick="wppaAjaxUpdatePhoto( ' . $id . ', \'remakethumb\', 0 )"
1685
+ value="' . esc_attr( __( 'Remake thumbnail file', 'wp-photo-album-plus' ) ) . '"
1686
+ />
1687
+ </div>' );
1688
+ }
1689
 
1690
+ // Delete
1691
+ if ( wppa_user_is( 'administrator' ) || wppa_get_photo_item( $id, 'owner' ) == wppa_get_user() ) {
1692
+ if ( ! wppa( 'front_edit' ) ) {
1693
+ wppa_echo( '
1694
+ <div>
1695
+ <label>
1696
+ &nbsp;
1697
+ </label><br>
1698
  <input
1699
  type="button"
1700
+ class="wppa-admin-button button"
1701
+ style="color:' . ( $deleted ? 'green' : 'red' ) . '"
1702
+ onclick="wppaTry' . ( $deleted ? 'Undelete' : 'Delete' ) . '( ' . $id . ', ' . $b_is_video . ' )"' .
1703
+ ( $deleted ?
1704
+ ' value="' . ( $b_is_video ? esc_attr( __( 'Undelete video', 'wp-photo-album-plus' ) ) : esc_attr( __( 'Undelete photo', 'wp-photo-album-plus' ) ) ) .'"' :
1705
+ ' value="' . ( $b_is_video ? esc_attr( __( 'Delete video', 'wp-photo-album-plus' ) ) : esc_attr( __( 'Delete photo', 'wp-photo-album-plus' ) ) ) . '"' ) . '
1706
+ />
1707
+ </div>' );
1708
 
1709
+ if ( $deleted ) {
1710
  wppa_echo( '
1711
+ <div>
1712
+ <label>
1713
+ &nbsp;
1714
+ </label><br>
1715
+ <input
1716
+ type="button"
1717
+ class="wppa-admin-button button"
1718
+ style="color:red"
1719
+ onclick="wppaTryDelete( ' . $id . ', ' . $b_is_video . ', true )"
1720
+ value="' . esc_attr( __( 'Remove permanently', 'wp-photo-album-plus' ) ) . '"
1721
+ />
1722
+ </div>' );
1723
+ }
1724
+ }
1725
+ }
1726
 
1727
+ // Re-upload
1728
+ if ( wppa_user_is( 'administrator' ) || ! wppa_switch( 'reup_is_restricted' ) ) {
1729
+ wppa_echo( '
1730
+ <div style="max-width:500px;">
1731
+ <label>
1732
+ &nbsp;
1733
+ </label><br>
1734
+ <input
1735
+ type="button"
1736
+ class="wppa-admin-button button"
1737
+ onclick="jQuery( \'#re-up-' . $id . '\' ).css( \'display\', \'inline-block\' )"
1738
+ value="' . esc_attr( __( 'Re-upload file', 'wp-photo-album-plus' ) ) . '"
1739
+ />
1740
 
1741
+ <div id="re-up-' . $id . '" style="display:none">
1742
+ <form
1743
+ id="wppa-re-up-form-' . $id . '"
1744
+ onsubmit="wppaReUpload( event, ' . $id . ', \'' . $filename . '\' )"
1745
+ >
1746
+ <input
1747
+ type="file"
1748
+ id="wppa-re-up-file-' . $id . '"
1749
+ />
1750
+ <input
1751
+ type="submit"
1752
+ class="wppa-admin-button button"
1753
+ id="wppa-re-up-butn-' . $id . '"
1754
+ value="' . esc_attr( __( 'Upload', 'wp-photo-album-plus' ) ) . '"
1755
+ />
1756
+ </form>
1757
+ </div>
1758
+ </div>' );
1759
+ }
1760
 
1761
+ wppa_echo( '
1762
+ </div>' );
 
 
 
 
 
 
 
1763
 
1764
+ // Section 3a ImageMagick editing commands
1765
+ if ( wppa_can_admin_magick( $id ) && ! $quick ) {
 
 
 
 
 
 
 
1766
 
1767
+ wppa_echo( '<div style="padding:0 20px;">
1768
+ <details class="wppa-sublevel-details">
1769
+ <summary class="toplevel wppa-summary-sublevel"> '.
1770
+ __( 'ImageMagick commands', 'wp-photo-album-plus' ) . '
1771
+ </summary>
 
 
 
 
1772
 
1773
+ <table
1774
+ class="wppa-table wppa-photo-table"
1775
+ style="border:1px solid lightgray;margin:2px 20px 20px 0"
1776
+ >
1777
+ <tbody>
1778
+ <tr>
1779
+ <td>' .
1780
+ __( 'The operations are executed upon the display file.', 'wp-photo-album-plus' ) . ' ' .
1781
+ __( 'A new thumbnail image will be created from the display file.', 'wp-photo-album-plus' ) . '
1782
+ </td>
1783
+ </tr>
1784
+ <tr>
1785
+ <td>' );
1786
 
1787
+ // --- Actions ---
 
 
 
 
 
 
 
 
1788
 
1789
+ // Rotate left
1790
+ wppa_echo( '
1791
+ <input
1792
+ type="button"
1793
+ class="wppa-admin-button button"
1794
+ onclick="wppaTryMagick( ' . $id . ', \'magickrotleft\' )"
1795
+ value="' . esc_attr( __( 'Rotate left', 'wp-photo-album-plus' ) ) . '"
1796
+ />' );
 
1797
 
1798
+ // Rotat 180
1799
+ wppa_echo( '
1800
+ <input
1801
+ type="button"
1802
+ class="wppa-admin-button button"
1803
+ onclick="wppaTryMagick( ' . $id . ', \'magickrot180\' )"
1804
+ value="' . esc_attr( __( 'Rotate 180&deg;', 'wp-photo-album-plus' ) ) . '"
1805
+ />' );
 
1806
 
1807
+ // Rotate right
1808
+ wppa_echo( '
1809
+ <input
1810
+ type="button"
1811
+ class="wppa-admin-button button"
1812
+ onclick="wppaTryMagick( ' . $id . ', \'magickrotright\' )"
1813
+ value="' . esc_attr( __( 'Rotate right', 'wp-photo-album-plus' ) ) . '"
1814
+ />' );
 
1815
 
1816
+ // Flip
1817
+ wppa_echo( '
1818
+ <input
1819
+ type="button"
1820
+ class="wppa-admin-button button"
1821
+ onclick="wppaTryMagick( ' . $id . ', \'magickflip\' )"
1822
+ value="' . esc_attr( __( 'Flip', 'wp-photo-album-plus' ) ) . '&thinsp;&#8212;"
1823
+ title="-flip"
1824
+ />' );
1825
 
1826
+ // Flop
1827
+ wppa_echo( '
1828
+ <input
1829
+ type="button"
1830
+ class="wppa-admin-button button"
1831
+ onclick="wppaTryMagick( ' . $id . ', \'magickflop\' )"
1832
+ value="' . esc_attr( __( 'Flop', 'wp-photo-album-plus' ) ) . ' |"
1833
+ title="-flop"
1834
+ />' );
1835
 
1836
+ // Enhance
1837
+ wppa_echo( '
1838
+ <input
1839
+ type="button"
1840
+ class="wppa-admin-button button"
1841
+ onclick="wppaTryMagick( ' . $id . ', \'enhance\' )"
1842
+ value="' . esc_attr( __( 'Enhance', 'wp-photo-album-plus' ) ) . '"
1843
+ title="-enhance"
1844
+ />' );
1845
 
1846
+ // Sharpen
1847
+ wppa_echo( '
1848
+ <input
1849
+ type="button"
1850
+ class="wppa-admin-button button"
1851
+ onclick="wppaTryMagick( ' . $id . ', \'sharpen\' )"
1852
+ value="' . esc_attr( __( 'Sharpen', 'wp-photo-album-plus' ) ) . '"
1853
+ title="-sharpen 0x1"
1854
+ />' );
1855
 
1856
+ // Blur
1857
+ wppa_echo( '
1858
+ <input
1859
+ type="button"
1860
+ class="wppa-admin-button button"
1861
+ onclick="wppaTryMagick( ' . $id . ', \'blur\' )"
1862
+ value="' . esc_attr( __( 'Blur', 'wp-photo-album-plus' ) ) . '"
1863
+ title="-blur 0x1"
1864
+ />' );
1865
 
1866
+ // Auto gamma
1867
+ wppa_echo( '
1868
+ <input
1869
+ type="button"
1870
+ class="wppa-admin-button button"
1871
+ onclick="wppaTryMagick( ' . $id . ', \'auto-gamma\' )"
1872
+ value="' . esc_attr( __( 'Auto Gamma', 'wp-photo-album-plus' ) ) . '"
1873
+ title="-auto-gamma"
1874
+ />' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1875
 
1876
+ // Auto level
1877
+ wppa_echo( '
1878
+ <input
1879
+ type="button"
1880
+ class="wppa-admin-button button"
1881
+ onclick="wppaTryMagick( ' . $id . ', \'auto-level\' )"
1882
+ value="' . esc_attr( __( 'Auto Level', 'wp-photo-album-plus' ) ) . '"
1883
+ title="-auto-level"
1884
+ />' );
1885
 
1886
+ // Contrast+
1887
+ wppa_echo( '
1888
+ <input
1889
+ type="button"
1890
+ class="wppa-admin-button button"
1891
+ onclick="wppaTryMagick( ' . $id . ', \'contrast-p\' )"
1892
+ value="' . esc_attr( __( 'Contrast+', 'wp-photo-album-plus' ) ) . '"
1893
+ title="-brightness-contrast 0x5"
1894
+ />' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1895
 
1896
+ // Contrast-
1897
+ wppa_echo( '
1898
+ <input
1899
+ type="button"
1900
+ class="wppa-admin-button button"
1901
+ onclick="wppaTryMagick( ' . $id . ', \'contrast-m\' )"
1902
+ value="' . esc_attr( __( 'Contrast-', 'wp-photo-album-plus' ) ) . '"
1903
+ title="-brightness-contrast 0x-5"
 
 
 
1904
  />' );
1905
 
1906
+ // Brightness+
1907
+ wppa_echo( '
1908
+ <input
1909
+ type="button"
1910
+ class="wppa-admin-button button"
1911
+ onclick="wppaTryMagick( ' . $id . ', \'brightness-p\' )"
1912
+ value="' . esc_attr( __( 'Brightness+', 'wp-photo-album-plus' ) ) . '"
1913
+ title="-brightness-contrast 5"
1914
+ />' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1915
 
1916
+ // Brightness-
1917
+ wppa_echo( '
1918
+ <input
1919
+ type="button"
1920
+ class="wppa-admin-button button"
1921
+ onclick="wppaTryMagick( ' . $id . ', \'brightness-m\' )"
1922
+ value="' . esc_attr( __( 'Brightness-', 'wp-photo-album-plus' ) ) . '"
1923
+ title="-brightness-contrast -5"
1924
+ />' );
1925
 
1926
+ // Despeckle
1927
+ wppa_echo( '
1928
+ <input
1929
+ type="button"
1930
+ class="wppa-admin-button button"
1931
+ onclick="wppaTryMagick( ' . $id . ', \'despeckle\' )"
1932
+ value="' . esc_attr( __( 'Despeckle', 'wp-photo-album-plus' ) ) . '"
1933
+ title="-despeckle"
1934
+ />' );
1935
 
1936
+ // Lenear gray
1937
+ wppa_echo( '
1938
+ <input
1939
+ type="button"
1940
+ class="wppa-admin-button button"
1941
+ onclick="wppaTryMagick( ' . $id . ', \'lineargray\' )"
1942
+ value="' . esc_attr( __( 'Linear gray', 'wp-photo-album-plus' ) ) . '"
1943
+ title="-colorspace gray"
1944
+ />' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1945
 
1946
+ // Non-linear gray
1947
+ wppa_echo( '
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1948
  <input
1949
  type="button"
1950
+ class="wppa-admin-button button"
1951
+ onclick="wppaTryMagick( ' . $id . ', \'nonlineargray\' )"
1952
+ value="' . esc_attr( __( 'Non-linear gray', 'wp-photo-album-plus' ) ) . '"
1953
+ title="-grayscale Rec709Luma"
1954
+ />' );
 
 
 
 
 
 
 
 
 
1955
 
1956
+ // Charcoal
1957
+ wppa_echo( '
1958
+ <input
1959
+ type="button"
1960
+ class="wppa-admin-button button"
1961
+ onclick="wppaTryMagick( ' . $id . ', \'charcoal\' )"
1962
+ value="' . esc_attr( __( 'Charcoal', 'wp-photo-album-plus' ) ) . '"
1963
+ title="-charcoal"
1964
+ />' );
 
 
 
 
 
1965
 
1966
+ // Paint
1967
+ wppa_echo( '
1968
+ <input
1969
+ type="button"
1970
+ class="wppa-admin-button button"
1971
+ onclick="wppaTryMagick( ' . $id . ', \'paint\' )"
1972
+ value="' . esc_attr( __( 'Paint', 'wp-photo-album-plus' ) ) . '"
1973
+ title="-paint"
1974
+ />' );
1975
 
1976
+ // Sepia
1977
+ wppa_echo( '
1978
+ <input
1979
+ type="button"
1980
+ class="wppa-admin-button button"
1981
+ onclick="wppaTryMagick( ' . $id . ', \'sepia\' )"
1982
+ value="' . esc_attr( __( 'Sepia', 'wp-photo-album-plus' ) ) . '"
1983
+ title="-sepia-tone 80%"
1984
+ />' );
 
 
 
 
 
 
 
 
 
 
 
1985
 
1986
+ // Show/hide wppa-horizon
1987
+ wppa_echo( '
1988
+ <input
1989
+ type="button"
1990
+ class="wppa-admin-button button"
1991
+ onclick="wppaToggleHorizon()"
1992
+ value="' . esc_attr( 'Show/hide horizon', 'wp-photo-album-plus' ) . '"
1993
+ title="' . esc_attr( 'Toggle horizon reference line on/off', 'wp-photo-album-plus' ) . '"
1994
+ />' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1995
 
1996
+ // Anticlock 0.5 deg
1997
+ wppa_echo( '
1998
+ <input
1999
+ type="button"
2000
+ class="wppa-admin-button button"
2001
+ onclick="wppaTryMagick( ' . $id . ', \'skyleft\' )"
2002
+ value="' . esc_attr( '0.5&deg;', 'wp-photo-album-plus' ) . '"
2003
+ title="' . esc_attr( 'Rotate image by 0.5&deg; anticlockwise', 'wp-photo-album-plus' ) . '"
2004
+ />' );
 
2005
 
2006
+ // Clockwise 0.5 deg
2007
+ wppa_echo( '
2008
+ <input
2009
+ type="button"
2010
+ class="wppa-admin-button button"
2011
+ onclick="wppaTryMagick( ' . $id . ', \'skyright\' )"
2012
+ value="' . esc_attr( '-0.5&deg;', 'wp-photo-album-plus' ) . '"
2013
+ title="' . esc_attr( 'Rotate image by 0.5&deg; clockwise', 'wp-photo-album-plus' ) . '"
2014
+ />' );
2015
+
2016
+ // Crop
2017
+ wppa_echo( '
2018
+ <input
2019
+ type="button"
2020
+ class="wppa-admin-button button"
2021
+ id="button-' . $id . '"
2022
+ value="Crop"
2023
+ title=""
2024
+ />' );
2025
+
2026
+ // Set cropbox aspect ratio
2027
+ $ratio = ( $photoy ? ( $photox / $photoy ) : 'NaN' );
2028
+ $dflt = wppa_opt( 'image_magick_ratio' );
2029
+ wppa_echo( '
2030
+ <select
2031
+ onchange="wppaCropper[' . $id . '].setAspectRatio(this.value)"
2032
+ title="' . __( 'Aspect ratio of cropped image', 'wp-photo-album-plus' ) . '"
2033
+ >
2034
+ <option value="NaN"' . ( $dflt == 'NaN' ? ' selected' : '' ) . '>' . __( 'free', 'wp-photo-album-plus' ) . '</option>
2035
+ <option value="' . $ratio . '"' . ( $dflt == 'ratio' ? ' selected' : '' ) . '>' . __( 'original', 'wp-photo-album-plus' ) . '</option>
2036
+ <option value="1"' . ( $dflt == '1' ? ' selected' : '' ) . '>' . __( 'square', 'wp-photo-album-plus' ) . '</option>
2037
+ <option value="1.25"' . ( $dflt == '1.25' ? ' selected' : '' ) . '>4:5 ' . __( 'landscape', 'wp-photo-album-plus' ) . '</option>
2038
+ <option value="1.33333"' . ( $dflt == '1.33333' ? ' selected' : '' ) . '>3:4 ' . __( 'landscape', 'wp-photo-album-plus' ) . '</option>
2039
+ <option value="1.5"' . ( $dflt == '1.5' ? ' selected' : '' ) . '>2:3 ' . __( 'landscape', 'wp-photo-album-plus' ) . '</option>
2040
+ <option value="1.6"' . ( $dflt == '1.6' ? ' selected' : '' ) . '>5:8 ' . __( 'landscape', 'wp-photo-album-plus' ) . '</option>
2041
+ <option value="1.77777"' . ( $dflt == '1.77777' ? ' selected' : '' ) . '>9:16 ' . __( 'landscape', 'wp-photo-album-plus' ) . '</option>
2042
+ <option value="2"' . ( $dflt == '2' ? ' selected' : '' ) . '>1:2 ' . __( 'landscape', 'wp-photo-album-plus' ) . '</option>
2043
+ <option value="0.8"' . ( $dflt == '0.8' ? ' selected' : '' ) . '>4:5 ' . __( 'portrait', 'wp-photo-album-plus' ) . '</option>
2044
+ <option value="0.75"' . ( $dflt == '0.75' ? ' selected' : '' ) . '>3:4 ' . __( 'portrait', 'wp-photo-album-plus' ) . '</option>
2045
+ <option value="0.66667"' . ( $dflt == '0.66667' ? ' selected' : '' ) . '>2:3 ' . __( 'portrait', 'wp-photo-album-plus' ) . '</option>
2046
+ <option value="0.625"' . ( $dflt == '0.625' ? ' selected' : '' ) . '>5:8 ' . __( 'portrait', 'wp-photo-album-plus' ) . '</option>
2047
+ <option value="0.5625"' . ( $dflt == '0.5625' ? ' selected' : '' ) . '>9:16 ' . __( 'portrait', 'wp-photo-album-plus' ) . '</option>
2048
+ <option value="0.5"' . ( $dflt == '0.5' ? ' selected' : '' ) . '>1:2 ' . __( 'portrait', 'wp-photo-album-plus' ) . '</option>
2049
+ </select>' . $br );
2050
+
2051
+ if ( $dflt == 'ratio' ) {
2052
+ $value = $ratio;
2053
  }
2054
+ elseif ( $dflt == 'free' ) {
2055
+ $value = '';
2056
+ }
2057
+ else {
2058
+ $value = $dflt;
2059
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2060
 
2061
+ $the_js = 'jQuery(document).ready(function(){wppaCropper[' . $id . '].setAspectRatio(' . $value . ');});';
2062
+ wppa_add_inline_script( 'wppa-admin', $the_js );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2063
 
2064
+ wppa_echo( '
2065
+ </td>
2066
+ </tr>
2067
+ <tr>
2068
+ <td>' .
2069
+ __( '<b>ImageMagick</b> command stack', 'wp-photo-album-plus' ) . ':
2070
+ <span
2071
+ id="magickstack-' . strval( intval( $id ) ). '"
2072
+ style="color:blue"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2073
  >' .
2074
+ sanitize_text_field( $magickstack ) . '
2075
+ </span>
2076
+ <input
2077
+ type="button"
2078
+ class="wppa-admin-button"
2079
+ id="imstackbutton-' . strval( intval( $id ) ) . '"
2080
+ onclick="wppaTryMagick( ' . strval( intval( $id ) ) . ', \'magickundo\' )"
2081
+ value="' . esc_attr( __( 'Undo', 'wp-photo-album-plus' ) ) . '"
2082
+ title="' . esc_attr( __( 'Undo last Magick command', 'wp-photo-album-plus' ) ) . '"
2083
+ style="' . ( $magickstack ? 'display:inline;' : 'display:none;' ) . '"
2084
+ />
2085
+ </td>
2086
+ </tr>' );
2087
+
2088
+ // Fake 'for social media' to use the local file here, not cloudinary. Files from cloudinary do not reload, even with ?ver=...
2089
+ wppa( 'for_sm', true );
2090
+ wppa_echo( '
2091
+ <tr>
2092
+ <td>
2093
+ <div
2094
+ class="wppa-cropper-container-wrapper">
2095
+ <img
2096
+ id="fs-img-' . $id . '"
2097
+ src="' . esc_url( wppa_get_photo_url( $id ) ) . '"
2098
+ style="float:left;max-width:100%"
2099
+ />' );
2100
+
2101
+ $the_js = '
2102
+
2103
+ /* jQuery(document).ready(function() { */
2104
+ window.addEventListener("DOMContentLoaded", function () {
2105
+
2106
+ /* Responive does not always works correcly, */
2107
+ /* so we do a manual replace after resizing the window */
2108
+ window.addEventListener("resize", function(){
2109
+ var c = wppaCropper[' . $id . '];
2110
+ var url = document.getElementById("fs-img-' . $id . '").src;
2111
+ c.replace(url);
2112
+ });
2113
+
2114
+ var image = document.querySelector("#fs-img-' . $id . '");
2115
+ var button = document.getElementById("button-' . $id . '");
2116
+
2117
+ wppaCropper[' . $id . '] = new Cropper(image, {
2118
+ zoomable: false,
2119
+ viewMode: 2,
2120
+ background: false,
2121
+ dragMode: "move",
2122
+ responsive: true,
2123
+ movable: false,
2124
+ });
2125
+
2126
+ button.onclick = function () {
2127
+ var data = wppaCropper[' . $id . '].getData(true);
2128
+ var value=data.width+"x"+data.height+(data.x<0?"-":"+")+data.x+(data.y<0?"-":"+")+data.y;
2129
+ wppaTryMagick( "' . $id . '", \'crop\', value );
2130
+ };
2131
+ });';
2132
+ wppa_add_inline_script( 'wppa-admin', $the_js );
2133
+
2134
+ wppa_echo( '
2135
+ </div>
2136
+ </td>
2137
+ </tr>
2138
+ </tbody>
2139
+ </table>
2140
+ </details></div>' );
2141
+ }
2142
+
2143
+ // Reset switch
2144
+ wppa( 'for_sm', false );
2145
+
2146
+ // Section 4
2147
+ wppa_echo( '
2148
+ <!-- Section 4 -->
2149
+ <table
2150
+ class="wppa-table wppa-photo-table"
2151
+ style="width:100%"
2152
+ >
2153
+ <tbody>' );
2154
 
2155
+ // Name
2156
  wppa_echo( '
2157
  <tr>
2158
  <td>' .
2159
+ __( 'Photoname:' , 'wp-photo-album-plus' ) . '
2160
  </td>
2161
  <td>
2162
  <input
2163
  type="text"
2164
  style="width:100%"
2165
+ id="pname-' . $id . '"
2166
+ onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'name\', this.value)"
2167
+ value="' . esc_attr( stripslashes( $name ) ) . '"
2168
+ />
2169
+ <br>
2170
+ <span style="float:right">' .
2171
+ __( 'Name slug', 'wp-photo-album-plus' ) . ': ' . $sname . '
2172
+ </span>
 
 
 
2173
  </td>
2174
  <td>
2175
  </td>
2176
  </tr>' );
 
2177
 
2178
+ // Description editable
2179
+ if ( ! wppa_switch( 'desc_is_restricted' ) || wppa_user_is( 'administrator' ) ) {
2180
+ wppa_echo( '
2181
+ <tr>
2182
+ <td>' .
2183
+ __( 'Description:', 'wp-photo-album-plus' ) . '
2184
+ </td>' );
2185
+
2186
+ // WP editor
2187
+ if ( wppa_switch( 'use_wp_editor' ) ) {
2188
+ $alfaid = wppa_alfa_id( $id );
2189
+ wppa_echo( '<td>' );
2190
+ wp_editor( $description,
2191
+ 'wppaphotodesc'.$alfaid,
2192
+ array( 'wpautop' => true,
2193
+ 'media_buttons' => false,
2194
+ 'textarea_rows' => '6',
2195
+ 'tinymce' => true
2196
+ )
2197
+ );
2198
+ wppa_echo( '
2199
+ <input
2200
+ type="button"
2201
+ style="clear:left"
2202
+ class="button button-secundary"
2203
+ value="' . esc_attr( __( 'Update Photo description', 'wp-photo-album-plus' ) ) . '"
2204
+ onclick="wppaAjaxUpdatePhoto( ' . $id . ', \'description\', wppaGetTinyMceContent(\'wppaphotodesc' . $alfaid . '\') )"
2205
+ />
2206
+ <img
2207
+ id="wppa-photo-spin-' . $id . '"
2208
+ src="' . wppa_get_imgdir() . 'spinner.gif"
2209
+ style="visibility:hidden"
2210
+ />
2211
+ </td>
2212
+ <td>
2213
+ </td>' );
2214
+ }
2215
+
2216
+ // Textarea
2217
+ else {
2218
+ wppa_echo( '
2219
+ <td>
2220
+ <textarea
2221
+ style="width:100%;height:60px"
2222
+ onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'description\', this.value)"
2223
+ >' .
2224
+ esc_textarea( stripslashes( $description ) ) . '
2225
+ </textarea>
2226
+ </td>
2227
+ <td>
2228
+ </td>' );
2229
+ }
2230
+
2231
+ wppa_echo( '</tr>' );
2232
+ }
2233
+
2234
+ // Description not editable
2235
+ else {
2236
+ wppa_echo( '
2237
+ <tr>
2238
+ <td>' .
2239
+ __( 'Description:', 'wp-photo-album-plus' ) . '
2240
+ </td>
2241
+ <td>
2242
+ <textarea
2243
+ style="width:100%;height:60px"
2244
+ readonly
2245
+ onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'description\', this.value)"
2246
+ >' .
2247
+ esc_textarea( stripslashes( $description ) ) . '
2248
+ </textarea>
2249
+ </td>
2250
+ <td>
2251
+ </td>
2252
+ </tr>' );
2253
+ }
2254
+
2255
+ // Tags
2256
+ $allowed = ! wppa_switch( 'newtags_is_restricted' ) || wppa_user_is( 'administrator' );
2257
  wppa_echo( '
2258
  <tr>
2259
  <td>' .
2260
+ __( 'Tags:', 'wp-photo-album-plus' ) . '
2261
  </td>
2262
  <td>
2263
  <input
2264
+ id="tags-' . $id . '"
2265
  type="text"
2266
  style="width:100%"
2267
+ onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'tags\', this.value)"
2268
+ value="' . esc_attr( $tags ) . '"' .
2269
+ ( $allowed ? '' : ' readonly="readonly"' ) . '
2270
+ />' );
2271
+ if ( $allowed ) {
2272
+ wppa_echo( '
2273
+ <br>
2274
+ <span class="description">' .
2275
+ __( 'Separate tags with commas.', 'wp-photo-album-plus' ) . '
2276
+ </span>' );
2277
+ }
2278
+ wppa_echo( '
2279
+ <select
2280
+ onchange="wppaAddTag( this.value, \'tags-' . $id . '\' ); wppaAjaxUpdatePhoto( ' . $id . ', \'tags\', document.getElementById( \'tags-' . $id . '\' ).value )">' );
2281
+
2282
+ if ( wppa_switch( 'predef_tags_only' ) ) {
2283
+ $keys = explode( ',', trim( wppa_opt( 'minimum_tags' ) ) );
2284
+ $taglist = array();
2285
+ foreach ( $keys as $key ) {
2286
+ $taglist[$key]['tag'] = $key;
2287
+ }
2288
+ }
2289
+ else {
2290
+ $taglist = wppa_get_taglist();
2291
+ }
2292
+
2293
+ if ( is_array( $taglist ) ) {
2294
+ wppa_echo( '<option value="">' . __( '- select to add -', 'wp-photo-album-plus' ) . '</option>' );
2295
+ foreach ( $taglist as $tag ) {
2296
+ wppa_echo( '<option value="' . esc_attr( $tag['tag'] ) . '">' . htmlspecialchars( $tag['tag'] ) . '</option>' );
2297
+ }
2298
+ if ( ! $allowed ) {
2299
+ wppa_echo( '<option value="-clear-">' . __( '- clear -', 'wp-photo-album-plus' ) . '</option>' );
2300
+ }
2301
+ }
2302
+ else {
2303
+ wppa_echo( '<option value="0">' . __( 'No tags yet', 'wp-photo-album-plus' ) . '</option>' );
2304
+ }
2305
+ wppa_echo( '
2306
+ </select>
2307
  </td>
2308
  <td>
2309
  </td>
2310
  </tr>' );
 
2311
 
2312
+ // Custom
2313
+ if ( wppa_switch( 'custom_fields' ) ) {
2314
+ $custom = wppa_get_photo_item( $photo['id'], 'custom' );
2315
+ if ( $custom ) {
2316
+ $custom_data = wppa_unserialize( $custom );
2317
+ }
2318
+ else {
2319
+ $custom_data = array( '', '', '', '', '', '', '', '', '', '' );
2320
+ }
2321
+ foreach( array_keys( $custom_data ) as $key ) {
2322
+ if ( wppa_opt( 'custom_caption_' . $key ) ) {
2323
+ wppa_echo( '
2324
+ <tr>
2325
+ <td>' .
2326
+ apply_filters( 'translate_text', wppa_opt( 'custom_caption_' . $key ) ) . '
2327
+ <small style="float:right">
2328
+ (w#cc' . $key . ')
2329
+ </small>:
2330
+ </td>
2331
+ <td>
2332
+ <input
2333
+ type="text"
2334
+ style="width:100%"
2335
+ id="custom_' . $key . '-' . $id . '"
2336
+ onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'custom_' . $key . '\', this.value)"
2337
+ value="' . esc_attr( stripslashes( $custom_data[$key] ) ) . '"
2338
+ />
2339
+ </td>
2340
+ <td>
2341
+ <small>(w#cd' . $key . ')</small>
2342
+ </td>
2343
+ </tr>' );
2344
+ }
2345
+ }
2346
+ }
2347
 
2348
+ // -- Auto Page --
2349
+ if ( wppa_switch( 'auto_page' ) && ( current_user_can( 'edit_posts' ) || current_user_can( 'edit_pages' ) ) ) {
2350
+ $appl = get_permalink( wppa_get_the_auto_page( $id ) );
2351
  wppa_echo( '
2352
  <tr>
2353
  <td>' .
2354
+ __( 'Autopage Permalink:', 'wp-photo-album-plus' ) . '
2355
  </td>
2356
  <td>
2357
+ <a href="' . $appl . '" target="_blank">' .
2358
+ $appl . '
2359
+ </a>
2360
  </td>
2361
  <td>
 
 
 
 
 
 
2362
  </td>
2363
  </tr>' );
2364
  }
2365
 
2366
+ // -- Link url --
2367
+ if ( ! wppa_switch( 'link_is_restricted' ) || wppa_user_is( 'administrator' ) ) {
 
2368
  wppa_echo( '
2369
  <tr>
2370
  <td>' .
2371
+ __( 'Photo specific link url:', 'wp-photo-album-plus' ) . '
2372
  </td>
2373
  <td>
2374
+ <input
2375
+ type="text"
2376
+ id="pislink-' . $id . '"
2377
+ style="width:100%"
2378
+ onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'linkurl\', this.value)"
2379
+ value="' . esc_attr( $linkurl ) . '"
2380
+ />
2381
  </td>
2382
  <td>
2383
+ <select
2384
+ id="pistarget-' . $id . '"
2385
+ onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'linktarget\', this.value)"
2386
+ >
2387
+ <option
2388
+ value="_self"' .
2389
+ ( $linktarget == '_self' ? ' selected' : '' ) . '
2390
+ >' .
2391
+ __( 'Same tab', 'wp-photo-album-plus' ) . '
2392
+ </option>
2393
+ <option
2394
+ value="_blank"' .
2395
+ ( $linktarget == '_blank' ? ' selected' : '' ) . '
2396
+ >' .
2397
+ __( 'New tab', 'wp-photo-album-plus' ) . '
2398
+ </option>
2399
+ </select>
2400
+ <input
2401
+ type="button"
2402
+ class="button wppa-admin-button"
2403
+ onclick="window.open( jQuery( \'#pislink-' . $id . '\' ).val(), jQuery( \'#pistarget-' . $id . '\' ).val() )"
2404
+ value="' . __( 'Tryit!', 'wp-photo-album-plus' ) . '"
2405
+ />
2406
  </td>
2407
  </tr>' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2408
 
2409
+ // -- Link title --
 
 
2410
  wppa_echo( '
2411
  <tr>
2412
  <td>' .
2413
+ __( 'Photo specific link title:', 'wp-photo-album-plus' ) . '
2414
  </td>
2415
  <td>
2416
+ <input
2417
+ type="text"
2418
+ style="width:100%"
2419
+ onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'linktitle\', this.value)"
2420
+ value="' . esc_attr( $linktitle ) . '"
2421
+ />' );
2422
+ if ( current_user_can( 'wppa_settings' ) ) {
2423
+ wppa_echo( '
2424
+ <br>
2425
+ <span class="description">' .
2426
+ sprintf( __( 'If you want this link to be used, check \'PS Overrule\' checkbox in %s.' , 'wp-photo-album-plus' ), wppa_setting_path( 'b', 'links', 2 ) ) . '
2427
+ </span>' );
2428
+ }
2429
+ wppa_echo( '
2430
  </td>
2431
  <td>
2432
  </td>
2433
  </tr>' );
2434
  }
2435
 
2436
+ // -- Custom ALT field --
2437
+ if ( wppa_opt( 'alt_type' ) == 'custom' ) {
 
2438
  wppa_echo( '
2439
  <tr>
2440
  <td>' .
2441
+ __( 'HTML Alt attribute:' , 'wp-photo-album-plus' ) . '
2442
  </td>
2443
  <td>
2444
+ <input
2445
+ type="text"
2446
+ style="width:100%"
2447
+ onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'alt\', this.value)"
2448
+ value="' . esc_attr( $alt ) . '"
2449
+ />
2450
  </td>
2451
  <td>
2452
  </td>
2453
  </tr>' );
2454
  }
 
 
 
 
 
 
2455
 
2456
+ // If Quick, skip the following items for speed and space
2457
+ if ( ! $quick ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2458
 
2459
+ // Shortcode
2460
+ if ( current_user_can( 'edit_posts' ) || current_user_can( 'edit_pages' ) ) {
2461
+ wppa_echo( '
2462
+ <tr>
2463
+ <td>' .
2464
+ __( 'Single image shortcode', 'wp-photo-album-plus' ) . ':
2465
+ </td>
2466
+ <td>
2467
+ [wppa type="photo" photo="' . $id .'"]
2468
+ </td>
2469
+ <td>
2470
+ <small>' .
2471
+ sprintf( __( 'See %s The documentation %s for more shortcode options.', 'wp-photo-album-plus' ),
2472
+ '<a href="https://wppa.nl/shortcode-reference/" target="_blank">',
2473
+ '</a>'
2474
+ ) . '
2475
+ </small>
2476
+ </td>
2477
+ </tr>' );
2478
+ }
2479
 
2480
+ // Source permalink
2481
+ if ( is_file( wppa_get_source_path( $id ) ) ) {
2482
+ $spl = wppa_get_source_pl( $id );
2483
  wppa_echo( '
2484
+ <tr>
2485
+ <td>' .
2486
+ __( 'Permalink', 'wp-photo-album-plus' ) . ':
2487
+ </td>
2488
+ <td>
2489
+ <a href="' . esc_attr( $spl ) . '" target="_blank">' . htmlspecialchars( $spl ) . '</a>
2490
+ </td>
2491
+ <td>
 
 
2492
  </td>
2493
  </tr>' );
2494
  }
2495
 
2496
+ // High resolution url
2497
+ $hru = htmlspecialchars( wppa_get_hires_url( $id ) );
2498
+ wppa_echo( '
2499
+ <tr>
2500
+ <td>' .
2501
+ __( 'High resolution url', 'wp-photo-album-plus' ) . ':
2502
+ </td>
2503
+ <td>
2504
+ <a href="' . esc_attr( $hru ) . '" target="_blank">' . $hru . '</a>
2505
+ </td>
2506
+ <td>
2507
+ </td>
2508
+ </tr>' );
2509
+
2510
+ // Display file
2511
+ if ( is_file( wppa_get_photo_path( $id ) ) ) {
2512
+ $lru = wppa_fix_poster_ext( wppa_get_lores_url( $id ), $id );
2513
+ wppa_echo( '
2514
+ <tr>
2515
+ <td>' .
2516
+ __( 'Display file url', 'wp-photo-album-plus' ) . ':
2517
+ </td>
2518
+ <td>
2519
+ <a href="' . esc_attr( $lru ) . '" target="_blank">' . $lru . '</a>
2520
+ </td>
2521
+ <td>
2522
+ </td>
2523
+ </tr>' );
2524
+ }
2525
 
2526
+ // Thumbnail
2527
+ if ( is_file( wppa_get_thumb_path( $id ) ) ) {
2528
+ $tnu = wppa_fix_poster_ext( wppa_get_tnres_url( $id ), $id );
2529
+ wppa_echo( '
2530
+ <tr>
2531
+ <td>' .
2532
+ __( 'Thumbnail file url', 'wp-photo-album-plus' ) . ':
2533
+ </td>
2534
+ <td>
2535
+ <a href="' . esc_attr( $tnu ) . '" target="_blank">' . $tnu . '</a>
2536
+ </td>
2537
+ <td>
2538
+ </td>
2539
+ </tr>' );
2540
+ }
2541
+ }
2542
  wppa_echo( '
2543
+ </tbody>
2544
+ </table>' );
2545
+
2546
+ wppa_echo( '<!-- Section 5 -->' );
2547
+
2548
+ // IPTC
2549
+ if ( ! $quick ) {
2550
+ $iptcs = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->wppa_iptc
2551
+ WHERE photo = %s
2552
+ ORDER BY tag, id", $id ), ARRAY_A );
2553
+ if ( ! empty( $iptcs ) ) {
2554
+ wppa_echo( '
2555
+ <table><tbody><tr><td><input
2556
+ type="button"
2557
+ id="wppa-iptc-button-' . $id . '"
2558
+ class="button button-secundary"
2559
+ value="' . esc_attr( sprintf( __( 'Show %d IPTC items', 'wp-photo-album-plus' ), count( $iptcs ) ) ) . '"
2560
+ onclick="wppaToggleIptc( ' . $id . ', ' . count( $iptcs ) . ' )"
2561
+ /></td></tr></tbody></table>
2562
+ <table
2563
+ id="wppa-iptc-' . $id . '"
2564
+ class="wppa-table wppa-photo-table"
2565
+ style="clear:both;width:99%;display:none"
2566
+ >
2567
+ <thead>
2568
+ <tr style="font-weight:bold">
2569
+ <td style="padding:0 4px">' . __( 'IPTC tag', 'wp-photo-album-plus' ) . '</td>
2570
+ <td style="padding:0 4px">' . __( 'Description', 'wp-photo-album-plus' ) . '</td>
2571
+ <td style="padding:0 4px">' . __( 'Value', 'wp-photo-album-plus' ) . '</td>
2572
+ </tr>
2573
+ </thead>
2574
+ <tbody>' );
2575
+
2576
+ foreach ( $iptcs as $iptc ) {
2577
 
2578
+ wppa_echo( '
2579
+ <tr id="iptc-tr-' . $iptc['id'] . '">
2580
+ <td style="padding:0 4px">' . $iptc['tag'] . '</td>
2581
+ <td style="padding:0 4px">' . esc_html( wppa_iptc_tagname( $iptc['tag'] ) ) . ':</td>
2582
+ <td style="padding:0 4px">
2583
+ <input
2584
+ type="text"
2585
+ style="width:500px"
2586
+ value="' . esc_attr( $iptc['description'] ) . '"
2587
+ onchange="wppaAjaxUpdateIptc(\'' . $id . '\', \'' . $iptc['id'] . '\', this.value, \'' . $iptc['tag'] . '\')"
2588
+ />
2589
+ </td>
2590
+ </tr>' );
2591
  }
 
 
 
2592
 
2593
+ wppa_echo( '
2594
+ </tbody>
2595
+ </table>' );
2596
+ }
2597
+ }
 
 
 
 
 
2598
 
2599
+ // Exif
2600
+ if ( ! $quick ) {
2601
+ $exifs = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->wppa_exif
2602
+ WHERE photo = %s
2603
+ ORDER BY tag, id", $id ), ARRAY_A );
2604
+ if ( ! empty( $exifs ) ) {
2605
+ $brand = wppa_get_camera_brand( $id );
2606
+ wppa_echo( '
2607
+ <table><tbody><tr><td><input
2608
+ type="button"
2609
+ id="wppa-exif-button-' . $id . '"
2610
+ class="button button-secundary"
2611
+ value="' . esc_attr( sprintf( __( 'Show %d EXIF items', 'wp-photo-album-plus' ), count( $exifs ) ) ) . '"
2612
+ onclick="wppaToggleExif( ' . $id . ', ' . count( $exifs ) . ' )"
2613
+ /></td></tr></tbody></table>
2614
+ <table
2615
+ id="wppa-exif-' . $id . '"
2616
+ class="wppa-table wppa-photo-table"
2617
+ style="clear:both;width:99%;display:none"
2618
+ >
2619
+ <thead>
2620
+ <tr style="font-weight:bold">
2621
+ <td style="padding:0 4px">' . __( 'Exif tag', 'wp-photo-album-plus' ) . '</td>
2622
+ <td style="padding:0 4px">' . __( 'Brand', 'wp-photo-album-plus' ) . '</td>
2623
+ <td style="padding:0 4px">' . __( 'Description', 'wp-photo-album-plus' ) . '</td>
2624
+ <td style="padding:0 4px">' . __( 'Raw value', 'wp-photo-album-plus' ) . '</td>
2625
+ <td style="padding:0 4px">' . __( 'Formatted value', 'wp-photo-album-plus' ) . '</td>
2626
+ </tr>
2627
+ </thead>
2628
+ <tbody>' );
2629
+
2630
+ foreach ( $exifs as $exif ) {
2631
+ $desc = $exif['description'];
2632
+ if ( is_serialized( $desc ) ) {
2633
+ $desc = 'Array(' . count( wppa_unserialize( $desc ) ) . ')';
2634
  }
2635
  wppa_echo( '
2636
+ <tr id="exif-tr-' . $exif['id'] . '">
2637
+ <td style="padding:0 4px">'.$exif['tag'].'</td>' );
 
2638
 
2639
+ if ( $brand && $exif['brand'] ) {
2640
+ wppa_echo( '
2641
+ <td style="padding:0 4px">' . $brand . '</td>
2642
+ <td style="padding:0 4px">' . wppa_exif_tagname( $exif['tag'], $brand, 'brandonly' ) . ':</td>' );
2643
+ }
2644
+ else {
2645
+ wppa_echo( '
2646
+ <td style="padding:0 4px"></td>
2647
+ <td style="padding:0 4px">' . wppa_exif_tagname( $exif['tag'] ) . ':</td>' );
2648
+ }
2649
 
2650
+ $raw_value = wp_kses( $desc, 'post' );
2651
+ if ( strlen( $raw_value ) > 50 ) {
2652
+ $raw_value = substr( $raw_value, 0, 47 ) . '...';
2653
+ }
2654
+ $formatted_value = wp_kses( wppa_format_exif( $exif['tag'], $exif['description'], $brand ), 'post' );
2655
+ if ( strlen( $formatted_value ) > 50 ) {
2656
+ $formatted_value = substr( $formatted_value, 0, 47 ) . '...';
2657
+ }
2658
+ wppa_echo( '
2659
+ <td style="padding:0 4px">' . $raw_value . '</td>
2660
+ <td style="padding:0 4px">' . $formatted_value . '</td>
2661
+ </tr>' );
2662
 
2663
+ }
2664
 
2665
+ wppa_echo( '
2666
+ </tbody>
2667
+ </table>' );
2668
+ }
2669
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2670
 
2671
+ wppa_echo( '<!-- Section 6 -->' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2672
 
2673
+ // Comments
2674
+ if ( ! $quick ) {
2675
+ $comments = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->wppa_comments
2676
+ WHERE photo = %s
2677
+ ORDER BY timestamp DESC ", $id ), ARRAY_A );
2678
+ if ( ! empty( $comments ) ) {
2679
  wppa_echo( '
2680
+ <table
2681
+ class="wppa-table wppa-photo-table"
2682
+ style="width:100%"
2683
+ >
2684
+ <thead>
2685
+ <tr style="font-weight:bold">
2686
+ <td style="padding:0 4px">#</td>
2687
+ <td style="padding:0 4px">User</td>
2688
+ <td style="padding:0 4px">Time since</td>
2689
+ <td style="padding:0 4px">Status</td>
2690
+ <td style="padding:0 4px">Comment</td>
2691
+ </tr>
2692
+ </thead>
2693
+ <tbody>' );
2694
+
2695
+ foreach ( $comments as $comment ) {
2696
+ wppa_echo( '
2697
+ <tr id="com-tr-' . $comment['id'] . '">
2698
+ <td style="padding:0 4px">'.$comment['id'].'</td>
2699
+ <td style="padding:0 4px">'.$comment['user'].'</td>
2700
+ <td style="padding:0 4px">'.wppa_get_time_since( $comment['timestamp'] ).'</td>' );
2701
+ if ( current_user_can( 'wppa_comments' ) || current_user_can( 'wppa_moderate' ) || ( wppa_get_user() == $photo['owner'] && wppa_switch( 'owner_moderate_comment' ) ) ) {
2702
+ $p = ( $comment['status'] == 'pending' ) ? ' selected' : '';
2703
+ $a = ( $comment['status'] == 'approved' ) ? ' selected' : '';
2704
+ $s = ( $comment['status'] == 'spam' ) ? ' selected' : '';
2705
+ $t = ( $comment['status'] == 'trash' ) ? ' selected' : '';
2706
+ wppa_echo( '
2707
+ <td style="padding:0 4px">
2708
+ <select
2709
+ id="com-stat-' . $comment['id'] . '"
2710
+ style="background-color:' . ( $comment['status'] == 'approved' ? '#ffffe0' : '#ffebe8' ) . '"
2711
+ onchange="wppaAjaxUpdateCommentStatus( '.$id.', '.$comment['id'].', this.value );wppaSetComBgCol(' . $comment['id'] . ')"
2712
+ >
2713
+ <option value="pending"' . $p . '>' . __( 'Pending' , 'wp-photo-album-plus' ) . '</option>
2714
+ <option value="approved"' . $a . '>' . __( 'Approved' , 'wp-photo-album-plus' ) . '</option>
2715
+ <option value="spam"' . $s . '>' . __( 'Spam' , 'wp-photo-album-plus' ) . '</option>
2716
+ <option value="trash"' . $t . '>' . __( 'Trash' , 'wp-photo-album-plus' ) . '</option>
2717
+ </select >
2718
+ </td>' );
2719
+ }
2720
+ else {
2721
+ wppa_echo( '<td style="padding:0 4px">' );
2722
+ if ( $comment['status'] == 'pending' ) $s = __( 'Pending' , 'wp-photo-album-plus' );
2723
+ elseif ( $comment['status'] == 'approved' ) $s = __( 'Approved' , 'wp-photo-album-plus' );
2724
+ elseif ( $comment['status'] == 'spam' ) $s = __( 'Spam' , 'wp-photo-album-plus' );
2725
+ elseif ( $comment['status'] == 'trash' ) $s = __( 'Trash' , 'wp-photo-album-plus' );
2726
+ wppa_echo( '</td>' );
2727
+ }
2728
+ wppa_echo( '<td style="padding:0 4px">' . $comment['comment'] . '</td>
2729
+ </tr>' );
2730
+ }
2731
+
2732
+ wppa_echo( '
2733
+ </tbody>
2734
+ </table>' );
2735
+ }
2736
  }
 
2737
 
2738
+ wppa_add_inline_script( 'wppa-admin', 'wppaPhotoStatusChange('.$id.');' );
2739
 
2740
+ wppa_echo( '
2741
+ <div style="clear:both"></div>
2742
+ </div>
2743
+ <div style="clear:both;margin-top:7px"></div>' );
2744
+ }
2745
+ /* End the actual display area for the photo settings */
2746
 
2747
  } /* foreach photo */
2748
 
wppa.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  * Plugin Name: WP Photo Album Plus
4
  * Description: Easily manage and display your photo albums and slideshows within your WordPress site.
5
- * Version: 8.2.02.006
6
  * Author: J.N. Breetvelt a.k.a. OpaJaap
7
  * Author URI: http://wppa.opajaap.nl/
8
  * Plugin URI: http://wordpress.org/extend/plugins/wp-photo-album-plus/
@@ -24,7 +24,7 @@ global $wp_version;
24
 
25
  /* WPPA GLOBALS */
26
  global $wppa_api_version;
27
- $wppa_api_version = '8.2.02.006'; // WPPA software version
28
  global $wppa_revno;
29
  $wppa_revno = str_replace( '.', '', $wppa_api_version ); // WPPA db version
30
 
2
  /*
3
  * Plugin Name: WP Photo Album Plus
4
  * Description: Easily manage and display your photo albums and slideshows within your WordPress site.
5
+ * Version: 8.2.02.007
6
  * Author: J.N. Breetvelt a.k.a. OpaJaap
7
  * Author URI: http://wppa.opajaap.nl/
8
  * Plugin URI: http://wordpress.org/extend/plugins/wp-photo-album-plus/
24
 
25
  /* WPPA GLOBALS */
26
  global $wppa_api_version;
27
+ $wppa_api_version = '8.2.02.007'; // WPPA software version
28
  global $wppa_revno;
29
  $wppa_revno = str_replace( '.', '', $wppa_api_version ); // WPPA db version
30