WP Photo Album Plus - Version 8.1.02.003

Version Description

= 8.1.02 =

  • 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.1.02.003
Comparing to
See all releases

Code changes from version 8.1.02.002 to 8.1.02.003

changelog.txt CHANGED
@@ -1,17 +1,22 @@
1
  WP Photo Album Plus Changelog
2
 
3
- = 8.2.01 =
4
 
5
  * Re-enabled update addressline.
6
  * Nicescroll options are now sanitized to prevent js crash after wrong edits.
7
-
 
 
 
 
 
8
 
9
  = 8.1.01 =
10
 
11
  * Lightbox on slide images did not always show the full list of items. Fixed.
12
- * You can now also send emails on backend uploads/imports. See: Advanced settings -> Email -> I -> Item 2: Mail on upload.
13
- Works only when frontend upload mailing is activated.
14
- Mails are sent 15 minutes after the first upload.
15
  You can also specify if preview thumbnails should be included.
16
  If no thumbnails should be shown in case of multiple photos, just the number of them is in the email.
17
  * Fixed a nicescroller issue.
1
  WP Photo Album Plus Changelog
2
 
3
+ = 8.1.02 =
4
 
5
  * Re-enabled update addressline.
6
  * Nicescroll options are now sanitized to prevent js crash after wrong edits.
7
+ * On Album Admin table, when set to collapsable and pagination is on,
8
+ now also all (grand)children of the albums on the list are included,
9
+ to avoid confusion when only a part of them are shown.
10
+ * New feature: Edit tags, To globally change or remove photo tags. Requires capability Tag edit. See Advanced settings -> Admin -> I
11
+ * New feature: Edit sequence, to chnage the sequence of the items in an album without having album access. Requires capability Sequence Edit.
12
+ * You can now globally switch off certain menu items in Advanced settings -> Admin -> VI.
13
 
14
  = 8.1.01 =
15
 
16
  * Lightbox on slide images did not always show the full list of items. Fixed.
17
+ * You can now also send emails on backend uploads/imports. See: Advanced settings -> Email -> I -> Item 2: Mail on upload.
18
+ Works only when frontend upload mailing is activated.
19
+ Mails are sent 15 minutes after the first upload.
20
  You can also specify if preview thumbnails should be included.
21
  If no thumbnails should be shown in case of multiple photos, just the number of them is in the email.
22
  * Fixed a nicescroller issue.
readme.txt CHANGED
@@ -134,7 +134,7 @@ See for the full changelog: <a href="http://www.wppa.nl/changelog/" >The documen
134
 
135
  == Upgrade Notice ==
136
 
137
- = 8.1.01 =
138
 
139
  * This version addresses various bug fixes, feature requests and security fixes.
140
 
134
 
135
  == Upgrade Notice ==
136
 
137
+ = 8.1.02 =
138
 
139
  * This version addresses various bug fixes, feature requests and security fixes.
140
 
wppa-admin-functions.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * gp admin functions
6
- * Version 8.1.00.008
7
  *
8
  */
9
 
@@ -555,7 +555,6 @@ function _wppa_sanitze_files( $root ) {
555
  }
556
 
557
  function wppa_admin_page_links( $curpage, $pagesize, $count, $link, $extra = '' ) {
558
- global $wppa_kses_maxi;
559
 
560
  if ( $pagesize < '1' ) return; // Pagination is off
561
 
@@ -600,7 +599,7 @@ global $wppa_kses_maxi;
600
  }
601
  $result .= '</div><br />&nbsp;';
602
 
603
- wppa_echo( $result, $wppa_kses_maxi );
604
  }
605
  }
606
 
@@ -898,20 +897,12 @@ global $warning_given_small;
898
 
899
  function wppa_admin_spinner() {
900
 
901
- $result = '<img' .
902
- ' id="wppa-admin-spinner"' .
903
- ' src="' . wppa_get_imgdir( wppa_use_svg( 'admin' ) ? 'loader.svg' : 'loader.gif' ) . '"' .
904
- ' alt="Spinner"' .
905
- ' style="' .
906
- 'position:fixed;' .
907
- 'left:50%;' .
908
- 'top:50%;' .
909
- 'margin-left:-33px;' .
910
- 'margin-top:-33px;' .
911
- 'z-index:9999999;' .
912
- '"' .
913
- ' />';
914
- echo $result;
915
  }
916
 
917
  // Export db table to .csv file
@@ -991,15 +982,22 @@ global $wpdb;
991
  $pendingcount = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->wppa_photos WHERE status = 'pending'" );
992
  $schedulecount = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->wppa_photos WHERE status = 'scheduled'" );
993
 
994
- echo sprintf(__('There are <strong>%d</strong> albums and <strong>%d</strong> photos in the system.', 'wp-photo-album-plus'), $albcount, $photocount);
995
- if ( $pendingcount ) echo ' '.sprintf(__('<strong>%d</strong> photos are pending moderation.', 'wp-photo-album-plus'), $pendingcount);
996
- if ( $schedulecount ) echo ' '.sprintf(__('<strong>%d</strong> photos are scheduled for later publishing.', 'wp-photo-album-plus'), $pendingcount);
 
 
 
 
 
997
 
998
  $lastalbum = $wpdb->get_row( "SELECT id, name FROM $wpdb->wppa_albums ORDER BY id DESC LIMIT 1", ARRAY_A );
999
- if ( $lastalbum ) echo '<br />'.sprintf(__('The most recently added album is <strong>%s</strong> (%d).', 'wp-photo-album-plus'), __(stripslashes($lastalbum['name']), 'wp-photo-album-plus'), $lastalbum['id']);
 
 
1000
  $lastphoto = $wpdb->get_row( "SELECT id, name, album FROM $wpdb->wppa_photos ORDER BY timestamp DESC LIMIT 1", ARRAY_A );
1001
  if ( ! $lastphoto ) {
1002
- echo '<br />'.__('There are no photos yet', 'wp-photo-album-plus');
1003
  return;
1004
  }
1005
  if ( $lastphoto['album'] < '1' ) {
@@ -1010,14 +1008,14 @@ global $wpdb;
1010
  $trashed = false;
1011
  $album = $lastphoto['album'];
1012
  }
1013
- $lastphotoalbum = $wpdb->get_row($wpdb->prepare( "SELECT id, name FROM $wpdb->wppa_albums WHERE id = %s", $album), ARRAY_A );
1014
  if ( $lastphoto ) {
1015
- echo '<br />'.sprintf(__('The most recently added photo is <strong>%s</strong> (%d)', 'wp-photo-album-plus'), __(stripslashes($lastphoto['name']), 'wp-photo-album-plus'), $lastphoto['id']);
1016
  if ( $lastphotoalbum ) {
1017
- echo ' '.sprintf(__('in album <strong>%s</strong> (%d).', 'wp-photo-album-plus'), __(stripslashes($lastphotoalbum['name']), 'wp-photo-album-plus'), $lastphotoalbum['id']);
1018
  }
1019
  if ( $trashed ) {
1020
- echo ' <span style="color:red" >' . __('Deleted', 'wp-photo-album-plus' ) . '</span>';
1021
  }
1022
  }
1023
  }
3
  * Package: wp-photo-album-plus
4
  *
5
  * gp admin functions
6
+ * Version 8.1.02.003
7
  *
8
  */
9
 
555
  }
556
 
557
  function wppa_admin_page_links( $curpage, $pagesize, $count, $link, $extra = '' ) {
 
558
 
559
  if ( $pagesize < '1' ) return; // Pagination is off
560
 
599
  }
600
  $result .= '</div><br />&nbsp;';
601
 
602
+ wppa_echo( $result );
603
  }
604
  }
605
 
897
 
898
  function wppa_admin_spinner() {
899
 
900
+ $result = '<img
901
+ id="wppa-admin-spinner"
902
+ src="' . esc_url( wppa_get_imgdir( wppa_use_svg( 'admin' ) ? 'loader.svg' : 'loader.gif' ) ) . '"
903
+ alt="Spinner"
904
+ />';
905
+ wppa_echo( $result );
 
 
 
 
 
 
 
 
906
  }
907
 
908
  // Export db table to .csv file
982
  $pendingcount = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->wppa_photos WHERE status = 'pending'" );
983
  $schedulecount = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->wppa_photos WHERE status = 'scheduled'" );
984
 
985
+ $result =
986
+ sprintf( __( 'There are <strong>%d</strong> albums and <strong>%d</strong> photos in the system.', 'wp-photo-album-plus'), $albcount, $photocount );
987
+ if ( $pendingcount ) {
988
+ $result .= ' ' . sprintf( __( '<strong>%d</strong> photos are pending moderation.', 'wp-photo-album-plus' ), $pendingcount );
989
+ }
990
+ if ( $schedulecount ) {
991
+ $result .= ' ' . sprintf( __( '<strong>%d</strong> photos are scheduled for later publishing.', 'wp-photo-album-plus' ), $pendingcount );
992
+ }
993
 
994
  $lastalbum = $wpdb->get_row( "SELECT id, name FROM $wpdb->wppa_albums ORDER BY id DESC LIMIT 1", ARRAY_A );
995
+ if ( $lastalbum ) {
996
+ $result .= '<br />' . sprintf( __( 'The most recently added album is <strong>%s</strong> (%d).', 'wp-photo-album-plus' ), sanitize_text_field( $lastalbum['name'] ), $lastalbum['id'] );
997
+ }
998
  $lastphoto = $wpdb->get_row( "SELECT id, name, album FROM $wpdb->wppa_photos ORDER BY timestamp DESC LIMIT 1", ARRAY_A );
999
  if ( ! $lastphoto ) {
1000
+ $result .= '<br />' . __( 'There are no photos yet', 'wp-photo-album-plus' );
1001
  return;
1002
  }
1003
  if ( $lastphoto['album'] < '1' ) {
1008
  $trashed = false;
1009
  $album = $lastphoto['album'];
1010
  }
1011
+ $lastphotoalbum = $wpdb->get_row( $wpdb->prepare( "SELECT id, name FROM $wpdb->wppa_albums WHERE id = %s", $album ), ARRAY_A );
1012
  if ( $lastphoto ) {
1013
+ $result .= '<br />' . sprintf( __( 'The most recently added photo is <strong>%s</strong> (%d)', 'wp-photo-album-plus' ), sanitize_text_field( $lastphoto['name'] ), $lastphoto['id'] );
1014
  if ( $lastphotoalbum ) {
1015
+ $result .= ' ' . sprintf( __( 'in album <strong>%s</strong> (%d).', 'wp-photo-album-plus' ), sanitize_text_field( $lastphotoalbum['name'] ), $lastphotoalbum['id'] );
1016
  }
1017
  if ( $trashed ) {
1018
+ $result .= ' <span style="color:red" >' . __( 'Deleted', 'wp-photo-album-plus' ) . '</span>';
1019
  }
1020
  }
1021
  }
wppa-admin-styles.css CHANGED
@@ -1,7 +1,7 @@
1
  /* admin-styles.css
2
  *
3
  * wp-photo-album-plus
4
- * version 8.1.01.003
5
  */
6
  #files_list, #files_list2
7
  {
@@ -132,7 +132,7 @@ ul.wppa_nav
132
  cursor: pointer;
133
  }
134
  .wppa-table thead td, .wppa-table tfoot td {
135
- font-weight: bold;
136
  font-size: 13px;
137
  line-height: 15px;
138
  }
@@ -496,3 +496,12 @@ border:1px solid black;
496
  #wppa-cloudinary-table td {
497
  height:11px;
498
  }
 
 
 
 
 
 
 
 
 
1
  /* admin-styles.css
2
  *
3
  * wp-photo-album-plus
4
+ * version 8.1.02.003
5
  */
6
  #files_list, #files_list2
7
  {
132
  cursor: pointer;
133
  }
134
  .wppa-table thead td, .wppa-table tfoot td {
135
+ font-weight: bold !important;
136
  font-size: 13px;
137
  line-height: 15px;
138
  }
496
  #wppa-cloudinary-table td {
497
  height:11px;
498
  }
499
+
500
+ #wppa-admin-spinner {
501
+ position:fixed;
502
+ left:50%;
503
+ top:50%;
504
+ margin-left:-33px;
505
+ margin-top:-33px;
506
+ z-index:9999999;
507
+ }
wppa-admin.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains the admin menu and startups the admin pages
6
- * Version 8.1.00.009
7
  *
8
  */
9
 
@@ -29,6 +29,8 @@ function wppa_add_admin() {
29
  $wp_roles->add_cap( 'administrator', 'wppa_export' );
30
  $wp_roles->add_cap( 'administrator', 'wppa_settings' );
31
  $wp_roles->add_cap( 'administrator', 'wppa_comments' );
 
 
32
  $wp_roles->add_cap( 'administrator', 'wppa_help' );
33
  }
34
 
@@ -55,28 +57,38 @@ function wppa_add_admin() {
55
  add_menu_page( 'WP Photo Album', __('Photo&thinsp;Albums', 'wp-photo-album-plus').$tot_pending, 'wppa_admin', 'wppa_admin_menu', 'wppa_admin', $icon_url ); //,'10' );
56
 
57
  // parent_slug page_title menu_title capability menu_slug function
58
- add_submenu_page( 'wppa_admin_menu', __('Album Admin', 'wp-photo-album-plus'), __('Album Admin', 'wp-photo-album-plus').$upl_pending,'wppa_admin', 'wppa_admin_menu', 'wppa_admin' );
59
  add_submenu_page( 'wppa_admin_menu', __('Upload Photos', 'wp-photo-album-plus'), __('Upload Photos', 'wp-photo-album-plus'), 'wppa_upload', 'wppa_upload_photos', 'wppa_page_upload' );
60
  // Uploader without album admin rights, but when the upload_edit switch set, may edit his own photos
61
  if ( ! current_user_can('wppa_admin') && wppa_opt( 'upload_edit') != '-none-' ) {
62
  add_submenu_page( 'wppa_admin_menu', __('Edit Photos', 'wp-photo-album-plus'), __('Edit Photos', 'wp-photo-album-plus'), 'wppa_upload', 'wppa_edit_photo', 'wppa_edit_photo' );
63
  }
64
  add_submenu_page( 'wppa_admin_menu', __('Import Photos', 'wp-photo-album-plus'), __('Import Photos', 'wp-photo-album-plus'), 'wppa_import', 'wppa_import_photos', 'wppa_page_import' );
65
- add_submenu_page( 'wppa_admin_menu', __('Moderate Photos', 'wp-photo-album-plus'), __('Moderate Photos', 'wp-photo-album-plus').(wppa_switch('moderate_bulk')?$upl_pending:$tot_pending), 'wppa_moderate', 'wppa_moderate_photos', 'wppa_page_moderate' );
66
  add_submenu_page( 'wppa_admin_menu', __('Export Photos', 'wp-photo-album-plus'), __('Export Photos', 'wp-photo-album-plus'), 'wppa_export', 'wppa_export_photos', 'wppa_page_export' );
67
  add_submenu_page( 'wppa_admin_menu', __('Settings', 'wp-photo-album-plus'), __('Settings', 'wp-photo-album-plus'), 'wppa_settings', 'wppa_options', 'wppa_page_options' );
68
  if ( wppa_switch( 'show_comments' ) ) {
69
  add_submenu_page( 'wppa_admin_menu', __('Manage comments', 'wp-photo-album-plus'), __('Comments', 'wp-photo-album-plus').$com_pending, 'wppa_comments', 'wppa_manage_comments', 'wppa_comment_admin' );
70
  }
71
- add_submenu_page( 'wppa_admin_menu', __('Search', 'wp-photo-album-plus'), __('Search', 'wp-photo-album-plus'), 'wppa_admin', 'wppa_search', 'wppa_search' );
72
- add_submenu_page( 'wppa_admin_menu', __('Help &amp; Info', 'wp-photo-album-plus'), __('Documentation', 'wp-photo-album-plus'), 'wppa_help', 'wppa_help', 'wppa_page_help' );
73
- if ( wppa_get_option( 'wppa_logfile_on_menu' ) == 'yes' ) {
 
 
 
 
74
  add_submenu_page( 'wppa_admin_menu', __('Logfile', 'wp-photo-album-plus'), __('Logfile', 'wp-photo-album-plus'), 'administrator', 'wppa_log', 'wppa_log_page' );
75
  }
76
  $hits = get_option( 'wppa_cache_hits', '0' );
77
  $miss = get_option( 'wppa_cache_misses', '1' );
78
  $perc = sprintf( '%5.2f', 100 * $hits / ( $hits + $miss ) );
79
- add_submenu_page( 'wppa_admin_menu', __('Cache', 'wp-photo-album-plus'), __('Cache', 'wp-photo-album-plus').' '. $perc . '%', 'wppa_admin', 'wppa_cache', 'wppa_page_cache' );
 
 
 
 
 
 
80
  }
81
 
82
  /* ADMIN STYLES */
@@ -271,6 +283,19 @@ function wppa_page_help() {
271
  _wppa_page_help();
272
  }
273
 
 
 
 
 
 
 
 
 
 
 
 
 
 
274
  /* GENERAL ADMIN */
275
 
276
  // General purpose admin functions
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains the admin menu and startups the admin pages
6
+ * Version 8.1.02.003
7
  *
8
  */
9
 
29
  $wp_roles->add_cap( 'administrator', 'wppa_export' );
30
  $wp_roles->add_cap( 'administrator', 'wppa_settings' );
31
  $wp_roles->add_cap( 'administrator', 'wppa_comments' );
32
+ $wp_roles->add_cap( 'administrator', 'wppa_edit_tags' );
33
+ $wp_roles->add_cap( 'administrator', 'wppa_edit_sequence' );
34
  $wp_roles->add_cap( 'administrator', 'wppa_help' );
35
  }
36
 
57
  add_menu_page( 'WP Photo Album', __('Photo&thinsp;Albums', 'wp-photo-album-plus').$tot_pending, 'wppa_admin', 'wppa_admin_menu', 'wppa_admin', $icon_url ); //,'10' );
58
 
59
  // parent_slug page_title menu_title capability menu_slug function
60
+ add_submenu_page( 'wppa_admin_menu', __('Album Admin', 'wp-photo-album-plus'), __('Album Admin', 'wp-photo-album-plus').$upl_pending,'wppa_admin', 'wppa_admin_menu', 'wppa_admin' );
61
  add_submenu_page( 'wppa_admin_menu', __('Upload Photos', 'wp-photo-album-plus'), __('Upload Photos', 'wp-photo-album-plus'), 'wppa_upload', 'wppa_upload_photos', 'wppa_page_upload' );
62
  // Uploader without album admin rights, but when the upload_edit switch set, may edit his own photos
63
  if ( ! current_user_can('wppa_admin') && wppa_opt( 'upload_edit') != '-none-' ) {
64
  add_submenu_page( 'wppa_admin_menu', __('Edit Photos', 'wp-photo-album-plus'), __('Edit Photos', 'wp-photo-album-plus'), 'wppa_upload', 'wppa_edit_photo', 'wppa_edit_photo' );
65
  }
66
  add_submenu_page( 'wppa_admin_menu', __('Import Photos', 'wp-photo-album-plus'), __('Import Photos', 'wp-photo-album-plus'), 'wppa_import', 'wppa_import_photos', 'wppa_page_import' );
67
+ add_submenu_page( 'wppa_admin_menu', __('Moderate Photos', 'wp-photo-album-plus'), __('Moderate Photos', 'wp-photo-album-plus').(wppa_switch('moderate_bulk')?$upl_pending:$tot_pending), 'wppa_moderate', 'wppa_moderate_photos', 'wppa_page_moderate' );
68
  add_submenu_page( 'wppa_admin_menu', __('Export Photos', 'wp-photo-album-plus'), __('Export Photos', 'wp-photo-album-plus'), 'wppa_export', 'wppa_export_photos', 'wppa_page_export' );
69
  add_submenu_page( 'wppa_admin_menu', __('Settings', 'wp-photo-album-plus'), __('Settings', 'wp-photo-album-plus'), 'wppa_settings', 'wppa_options', 'wppa_page_options' );
70
  if ( wppa_switch( 'show_comments' ) ) {
71
  add_submenu_page( 'wppa_admin_menu', __('Manage comments', 'wp-photo-album-plus'), __('Comments', 'wp-photo-album-plus').$com_pending, 'wppa_comments', 'wppa_manage_comments', 'wppa_comment_admin' );
72
  }
73
+ if ( wppa_switch( 'opt_menu_search' ) ) {
74
+ add_submenu_page( 'wppa_admin_menu', __('Search', 'wp-photo-album-plus'), __('Search', 'wp-photo-album-plus'), 'wppa_admin', 'wppa_search', 'wppa_search' );
75
+ }
76
+ if ( wppa_switch( 'opt_menu_doc' ) ) {
77
+ add_submenu_page( 'wppa_admin_menu', __('Help &amp; Info', 'wp-photo-album-plus'), __('Documentation', 'wp-photo-album-plus'), 'wppa_help', 'wppa_help', 'wppa_page_help' );
78
+ }
79
+ if ( wppa_switch( 'logfile_on_menu' ) ) {
80
  add_submenu_page( 'wppa_admin_menu', __('Logfile', 'wp-photo-album-plus'), __('Logfile', 'wp-photo-album-plus'), 'administrator', 'wppa_log', 'wppa_log_page' );
81
  }
82
  $hits = get_option( 'wppa_cache_hits', '0' );
83
  $miss = get_option( 'wppa_cache_misses', '1' );
84
  $perc = sprintf( '%5.2f', 100 * $hits / ( $hits + $miss ) );
85
+ add_submenu_page( 'wppa_admin_menu', __('Cache', 'wp-photo-album-plus'), __('Cache', 'wp-photo-album-plus').' '. $perc . '%', 'wppa_admin', 'wppa_cache', 'wppa_page_cache' );
86
+ if ( wppa_switch( 'opt_menu_edit_tags' ) ) {
87
+ add_submenu_page( 'wppa_admin_menu', __('Edit tags', 'wp-photo-album-plus'), __('Edit tags', 'wp-photo-album-plus'), 'wppa_edit_tags', 'wppa_edit_tags', 'wppa_tag_editor' );
88
+ }
89
+ if ( wppa_switch( 'opt_menu_edit_sequence' ) ) {
90
+ add_submenu_page( 'wppa_admin_menu', __('Edit Photo Sequence', 'wp-photo-album-plus'), __('Photo sequence', 'wp-photo-album-plus'), 'wppa_edit_sequence', 'wppa_edit_sequence', 'wppa_edit_sequence' );
91
+ }
92
  }
93
 
94
  /* ADMIN STYLES */
283
  _wppa_page_help();
284
  }
285
 
286
+ // Edit tags
287
+ function wppa_tag_editor() {
288
+ require_once 'wppa-edit-tags.php';
289
+ _wppa_edit_tags();
290
+ }
291
+
292
+ // Edit sequence
293
+ function wppa_edit_sequence() {
294
+ require_once 'wppa-edit-sequence.php';
295
+ require_once 'wppa-photo-admin-autosave.php';
296
+ _wppa_edit_sequence();
297
+ }
298
+
299
  /* GENERAL ADMIN */
300
 
301
  // General purpose admin functions
wppa-adminbar.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * enhances the admin bar with wppa+ menu
6
- * Version 8.0.08.007
7
  *
8
  */
9
 
@@ -90,7 +90,7 @@ function wppa_admin_bar_menu() {
90
  'href' => admin_url( 'admin.php?page=wppa_manage_comments' )
91
  );
92
  }
93
- if ( current_user_can( 'wppa_admin' ) ) {
94
  $menu_items['search'] = array(
95
  'parent' => $wppaplus,
96
  'title' => __( 'Search', 'wp-photo-album-plus' ) . $com_pending,
@@ -98,6 +98,21 @@ function wppa_admin_bar_menu() {
98
  );
99
  }
100
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
101
  $menu_items['opajaap'] = array(
102
  'parent' => $wppaplus,
103
  'title' => __( 'Documentation', 'wp-photo-album-plus' ),
3
  * Package: wp-photo-album-plus
4
  *
5
  * enhances the admin bar with wppa+ menu
6
+ * Version 8.1.02.003
7
  *
8
  */
9
 
90
  'href' => admin_url( 'admin.php?page=wppa_manage_comments' )
91
  );
92
  }
93
+ if ( current_user_can( 'wppa_admin' ) && wppa_switch( 'opt_menu_search' ) ) {
94
  $menu_items['search'] = array(
95
  'parent' => $wppaplus,
96
  'title' => __( 'Search', 'wp-photo-album-plus' ) . $com_pending,
98
  );
99
  }
100
 
101
+ if ( current_user_can( 'wppa_edit_tags' ) && wppa_switch( 'opt_menu_edit_tags' ) ) {
102
+ $menu_items['edit_tags'] = array(
103
+ 'parent' => $wppaplus,
104
+ 'title' => __( 'Edit tags', 'wp-photo-album-plus' ),
105
+ 'href' => admin_url( 'admin.php?page=wppa_edit_tags' )
106
+ );
107
+ }
108
+ if ( current_user_can( 'wppa_edit_sequence' ) && wppa_switch( 'opt_menu_edit_sequence' ) ) {
109
+ $menu_items['edit_squence'] = array(
110
+ 'parent' => $wppaplus,
111
+ 'title' => __('Edit Photo Sequence', 'wp-photo-album-plus' ),
112
+ 'href' => admin_url( 'admin.php?page=wppa_edit_sequence' )
113
+ );
114
+ }
115
+
116
  $menu_items['opajaap'] = array(
117
  'parent' => $wppaplus,
118
  'title' => __( 'Documentation', 'wp-photo-album-plus' ),
wppa-admins-choice-widget.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * display the admins-choice widget
6
- * Version 8.0.08.006
7
  *
8
  */
9
 
@@ -53,8 +53,8 @@ class AdminsChoice extends WP_Widget {
53
  }
54
  $result .= $widget_content . $after_widget;
55
 
56
- echo wppa_compress_html( $result );
57
- echo wppa_widget_timer( 'show', $widget_title );
58
 
59
  wppa( 'in_widget', false );
60
  }
@@ -78,22 +78,20 @@ class AdminsChoice extends WP_Widget {
78
 
79
  // Make sure the feature is enabled
80
  if ( wppa_opt( 'admins_choice' ) == 'none' ) {
81
- echo
82
- '<p style="color:red;" >' .
83
- __( 'Please enable this feature', 'wp-photo-album-plus' ) . ' ' . wppa_see_also( 'system', '1', '28' );
84
- '</p>';
85
  }
86
 
87
  // Defaults
88
  $instance = wppa_parse_args( (array) $instance, $this->get_defaults() );
89
 
90
  // Title
91
- echo
92
- wppa_widget_input( $this, 'title', $instance['title'], __( 'Title', 'wp-photo-album-plus' ) );
93
 
94
  // Loggedin only
95
- echo
96
- wppa_widget_checkbox( $this, 'logonly', $instance['logonly'], __( 'Show to logged in visitors only', 'wp-photo-album-plus' ) );
97
  }
98
 
99
  // Set defaults
3
  * Package: wp-photo-album-plus
4
  *
5
  * display the admins-choice widget
6
+ * Version 8.1.02.003
7
  *
8
  */
9
 
53
  }
54
  $result .= $widget_content . $after_widget;
55
 
56
+ wppa_echo( wppa_compress_html( $result ) );
57
+ wppa_echo( wppa_widget_timer( 'show', $widget_title ) );
58
 
59
  wppa( 'in_widget', false );
60
  }
78
 
79
  // Make sure the feature is enabled
80
  if ( wppa_opt( 'admins_choice' ) == 'none' ) {
81
+ wppa_echo( '
82
+ <p style="color:red;" >' .
83
+ __( 'Please enable this feature', 'wp-photo-album-plus' ) . ' ' . wppa_see_also( 'system', '1', '28' ) . '
84
+ </p>' );
85
  }
86
 
87
  // Defaults
88
  $instance = wppa_parse_args( (array) $instance, $this->get_defaults() );
89
 
90
  // Title
91
+ wppa_echo( wppa_widget_input( $this, 'title', $instance['title'], __( 'Title', 'wp-photo-album-plus' ) ) );
 
92
 
93
  // Loggedin only
94
+ wppa_echo( wppa_widget_checkbox( $this, 'logonly', $instance['logonly'], __( 'Show to logged in visitors only', 'wp-photo-album-plus' ) ) );
 
95
  }
96
 
97
  // Set defaults
wppa-ajax.php CHANGED
@@ -2,7 +2,7 @@
2
  /* wppa-ajax.php
3
  *
4
  * Functions used in ajax requests
5
- * Version 8.1.02.001
6
  *
7
  */
8
 
@@ -2988,10 +2988,20 @@ global $wppa;
2988
  case 'update-option':
2989
 
2990
  // Verify that we are legally here
2991
- if ( ! current_user_can( 'wppa_settings' ) ) {
 
 
 
 
 
 
 
 
2992
  wppa_echo( '||1||'.__( 'You do not have the rights to update settings', 'wp-photo-album-plus' ) );
2993
  wppa_exit();
2994
  }
 
 
2995
  $nonce = wppa_get( 'nonce' );
2996
  if ( ! wp_verify_nonce( $nonce, 'wppa-nonce' ) ) {
2997
  wppa_echo( '||1||'.__( 'Security check failure', 'wp-photo-album-plus' ) );
2
  /* wppa-ajax.php
3
  *
4
  * Functions used in ajax requests
5
+ * Version 8.1.02.003
6
  *
7
  */
8
 
2988
  case 'update-option':
2989
 
2990
  // Verify that we are legally here
2991
+ if ( current_user_can( 'wppa_settings' ) ) {
2992
+ // ok
2993
+ }
2994
+ elseif ( current_user_can( 'wppa_edit_tags' ) &&
2995
+ wppa_get( 'option' ) == 'tag_to_edit' ||
2996
+ wppa_get( 'option' ) == 'new_tag_value' ) {
2997
+ // ok
2998
+ }
2999
+ else {
3000
  wppa_echo( '||1||'.__( 'You do not have the rights to update settings', 'wp-photo-album-plus' ) );
3001
  wppa_exit();
3002
  }
3003
+
3004
+
3005
  $nonce = wppa_get( 'nonce' );
3006
  if ( ! wp_verify_nonce( $nonce, 'wppa-nonce' ) ) {
3007
  wppa_echo( '||1||'.__( 'Security check failure', 'wp-photo-album-plus' ) );
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.1.02.002
7
  *
8
  */
9
 
@@ -136,7 +136,7 @@ global $wppa_revno;
136
 
137
  wppa_echo( '
138
  <a href="#manage-photos">
139
- <div style="position:fixed;right:30px;bottom:30px;background-color:lightblue;" >
140
  &nbsp;' . __( 'Top of page', 'wp-photo-album-plus' ) . '&nbsp;
141
  </div>
142
  </a>
@@ -1519,6 +1519,7 @@ global $wppa_revno;
1519
  $result .= '
1520
  </h1>
1521
  <div style="clear:both;" ></div>';
 
1522
 
1523
  if ( wppa_get( 'bulk' ) )
1524
  wppa_album_photos_bulk( $edit_id );
@@ -1527,14 +1528,14 @@ global $wppa_revno;
1527
  else
1528
  wppa_album_photos( $edit_id );
1529
 
1530
- $result .= '
1531
  <br />
1532
  <a href="' . $back_url . '" >' .
1533
  $back_title .
1534
  '</a>
1535
 
1536
  <a href="#manage-photos">
1537
- <div style="position:fixed;right:30px;bottom:30px;background-color:lightblue;" >&nbsp;' . __( 'Top of page', 'wp-photo-album-plus' ) . '&nbsp;</div>
1538
  </a>
1539
  </div>';
1540
  wppa_echo( $result );
@@ -1676,71 +1677,111 @@ global $wppa_revno;
1676
  }
1677
  $style = wppa_get_option('wppa_album_table_'.wppa_get_user(), 'flat');
1678
 
1679
- ?>
1680
- <div class="wrap">
1681
- <?php wppa_admin_spinner() ?>
1682
- <img src="<?php echo WPPA_URL.'/img/album32.png' ?>" />
1683
- <h1 style="display:inline;" ><?php _e('Manage Albums', 'wp-photo-album-plus'); ?></h1>
1684
- <div style="clear:both;" >&nbsp;</div>
1685
- <?php
1686
  // The Create new album button
1687
  if ( wppa_can_create_top_album() ) {
1688
- $url = wppa_dbg_url(get_admin_url().'admin.php?page=wppa_admin_menu&amp;tab=edit&amp;edit-id=new&amp;wppa-nonce='.wp_create_nonce('wppa-nonce'));
1689
- $vfy = __('Are you sure you want to create a new album?', 'wp-photo-album-plus');
1690
- echo '<form method="post" action="'.get_admin_url().'admin.php?page=wppa_admin_menu&wppa-nonce='.wp_create_nonce('wppa-nonce').'" style="float:left; margin-right:12px;" >';
1691
- echo '<input type="hidden" name="tab" value="edit" />';
1692
- echo '<input type="hidden" name="edit-id" value="new" />';
1693
- $onc = 'onclick="return confirm(\''.$vfy.'\');"';
1694
- echo '<input type="submit" class="button-primary" '.$onc.' value="'.__('Create New Empty Album', 'wp-photo-album-plus').'" style="height:28px;" />';
1695
- echo '</form>';
 
 
 
 
 
 
 
 
 
 
 
 
1696
  }
1697
- // The switch to button(s)
1698
 
1699
- if ( $style == 'flat' ) { ?>
1700
- <input type="button" class="button-secundary" onclick="document.location='<?php echo wppa_dbg_url(get_admin_url().'admin.php?page=wppa_admin_menu&amp;switchto=collapsible') ?>'" value="<?php _e('Switch to Collapsable table', 'wp-photo-album-plus'); ?>" />
1701
- <?php }
1702
- else { ?>
1703
- <input type="button" class="button-secundary" onclick="document.location='<?php echo wppa_dbg_url(get_admin_url().'admin.php?page=wppa_admin_menu&amp;switchto=flat') ?>'" value="<?php _e('Switch to Flat table', 'wp-photo-album-plus'); ?>" />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1704
  <input
1705
  type="button"
1706
  class="button-secundary"
1707
  id="wppa-open-all"
1708
  style="display:inline;"
1709
- onclick=" jQuery('#wppa-close-all').css('display','inline');
1710
- jQuery(this).css('display','none');
1711
- jQuery('.wppa-alb-onoff').css('display','');
1712
- jQuery('.alb-arrow-off').css('display','');
1713
- jQuery('.alb-arrow-on').css('display','none');
1714
  "
1715
- value="<?php _e('Open all', 'wp-photo-album-plus'); ?>"
1716
  />
1717
  <input
1718
  type="button"
1719
  class="button-secundary"
1720
  id="wppa-close-all"
1721
- style="display:none;"
1722
- onclick=" jQuery('#wppa-open-all').css('display','inline');
1723
- jQuery(this).css('display','none');
1724
- jQuery('.wppa-alb-onoff').css('display','none');
1725
- jQuery('.alb-arrow-on').css('display','');
1726
- jQuery('.alb-arrow-off').css('display','none');
1727
  "
1728
- value="<?php _e('Close all', 'wp-photo-album-plus'); ?>"
1729
- />
1730
- <?php } ?>
 
 
 
1731
 
1732
- <?php echo __( 'Filter by', 'wp-photo-album-plus' ) . ': ' .
1733
- '<select onchange="document.location.href=\''.get_admin_url().'admin.php?page=wppa_admin_menu&switchto=flat&filter=\'+this.value" >';
 
 
1734
  $opts = $wpdb->get_col( "SELECT slug FROM $wpdb->wppa_index WHERE albums <> '' ORDER BY slug" );
1735
  $f = wppa_get( 'filter' );
1736
- echo '<option value="" ></option>';
 
1737
  foreach( $opts as $opt ) {
1738
- echo '<option value="' . $opt . '" ' . ( $f == $opt ? 'selected="selected" ' : '' ) . '>' . $opt . '</value>';
1739
  }
1740
- echo
1741
  '</select>';
 
 
 
 
1742
 
1743
- echo ' ' .
1744
  __( 'Edit album number', 'wp-photo-album-plus' ) . ' ' . '
1745
  <input
1746
  id="wppa-edit-albid"
@@ -1762,18 +1803,19 @@ global $wppa_revno;
1762
  };';
1763
  wppa_add_inline_script( 'wppa-admin', $the_js );
1764
 
1765
- ?>
1766
 
1767
- <br />
1768
- <?php // The table of existing albums
1769
- if ( $style == 'flat' ) wppa_admin_albums_flat();
1770
- else wppa_admin_albums_collapsible();
1771
- ?>
1772
- <br />
1773
 
1774
- <?php wppa_album_sequence( '0' ) ?>
1775
- </div>
1776
- <?php
 
 
 
 
 
 
1777
  }
1778
  }
1779
 
@@ -1783,66 +1825,36 @@ global $wpdb;
1783
 
1784
  // Init
1785
  $pagesize = wppa_opt( 'album_admin_pagesize' );
1786
- $page = '1';
1787
- $skips = '0';
1788
- $pages = '1';
1789
-
1790
- // Find out what page to show
1791
- if ( $pagesize ) {
1792
- if ( wppa_get( 'album-page-no' ) ) {
1793
- $page = wppa_get( 'album-page-no' );
1794
- $page = max( $page, '1' );
1795
- $skips = ( $page - 1 ) * $pagesize;
1796
- }
1797
- }
1798
 
1799
  // Read all albums, pre-ordered
1800
  $order_by = wppa_get_option( 'wppa_album_order_' . wppa_get_user(), 'id' );
1801
  $order_desc = wppa_get_option( 'wppa_album_order_' . wppa_get_user() . '_reverse' );
1802
- // A dynamic query is regarded as being insecure, so we make a switch statemnent with all possible sequences.
1803
- // $albums = $wpdb->get_results( "SELECT * FROM $wpdb->wppa_albums ORDER BY " . $order_by . ( $order_desc == 'yes' ? " DESC" : "" ) , ARRAY_A );
1804
- if ( $order_desc == 'yes' ) {
1805
- switch( $order_by ) {
1806
- case 'name':
1807
- $query = "SELECT * FROM $wpdb->wppa_albums ORDER BY name DESC";
1808
- break;
1809
- case 'description':
1810
- $query = "SELECT * FROM $wpdb->wppa_albums ORDER BY description DESC";
1811
- break;
1812
- case 'owner':
1813
- $query = "SELECT * FROM $wpdb->wppa_albums ORDER BY owner DESC";
1814
- break;
1815
- case 'a_order':
1816
- $query = "SELECT * FROM $wpdb->wppa_albums ORDER BY a_order DESC";
1817
- break;
1818
- case 'a_parent':
1819
- $query = "SELECT * FROM $wpdb->wppa_albums ORDER BY a_parent DESC";
1820
- break;
1821
- default:
1822
- $query = "SELECT * FROM $wpdb->wppa_albums ORDER BY id DESC";
1823
- }
1824
  }
1825
- else {
1826
- switch( $order_by ) {
1827
- case 'name':
1828
- $query = "SELECT * FROM $wpdb->wppa_albums ORDER BY name";
1829
- break;
1830
- case 'description':
1831
- $query = "SELECT * FROM $wpdb->wppa_albums ORDER BY description";
1832
- break;
1833
- case 'owner':
1834
- $query = "SELECT * FROM $wpdb->wppa_albums ORDER BY owner";
1835
- break;
1836
- case 'a_order':
1837
- $query = "SELECT * FROM $wpdb->wppa_albums ORDER BY a_order";
1838
- break;
1839
- case 'a_parent':
1840
- $query = "SELECT * FROM $wpdb->wppa_albums ORDER BY a_parent";
1841
- break;
1842
- default:
1843
- $query = "SELECT * FROM $wpdb->wppa_albums ORDER BY id";
1844
- }
1845
  }
 
1846
  $albums = $wpdb->get_results( $query, ARRAY_A );
1847
 
1848
  // Remove non accessible albums
@@ -1902,7 +1914,7 @@ global $wpdb;
1902
  else update_option('wppa_album_order_'.wppa_get_user().'_reverse', 'no');
1903
  }
1904
 
1905
- if ( ! empty($albums) ) {
1906
 
1907
  // Setup the sequence array
1908
  $seq = false;
@@ -1933,8 +1945,8 @@ global $wpdb;
1933
  }
1934
 
1935
  // Sort the seq array
1936
- if ( $num ) asort($seq, SORT_NUMERIC);
1937
- else asort($seq, SORT_REGULAR);
1938
 
1939
  // Reverse ?
1940
  if ( $reverse ) {
@@ -1947,279 +1959,168 @@ global $wpdb;
1947
  }
1948
  }
1949
 
1950
- $downimg = '<img src="'.wppa_get_imgdir().'down.png" alt="down" style=" height:12px; position:relative; top:2px; " />';
1951
- $upimg = '<img src="'.wppa_get_imgdir().'up.png" alt="up" style=" height:12px; position:relative; top:2px; " />';
1952
- $show_nl = wppa_opt( 'user_create_max_level' ) != '99';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1953
 
1954
- wppa_album_table_pagination( $page, $count );
 
1955
 
1956
- ?>
 
 
 
1957
 
1958
- <table class="wppa-table widefat wppa-setting-table" style="margin-top:12px;" >
1959
- <thead>
1960
- <tr>
1961
- <?php $url = get_admin_url().'admin.php?page=wppa_admin_menu&amp;order_by='; ?>
1962
- <td style="min-width: 50px;" title="<?php echo( $show_nl ?
1963
- esc_attr( __( 'The album id (the nesting level)', 'wp-photo-album-plus' ) ) :
1964
- esc_attr( __( 'The album id', 'wp-photo-album-plus' ) ) ) ?>" >
1965
- <a href="<?php echo wppa_dbg_url($url.'id') ?>">
1966
- <?php $show_nl ? _e( 'ID(nl)', 'wp-photo-album-plus' ) : _e( 'ID', 'wp-photo-album-plus' );
1967
- if ($order == 'id') {
1968
- if ( $reverse ) echo $upimg;
1969
- else echo $downimg;
1970
- }
1971
- ?>
1972
- </a>
1973
- </td>
1974
- <td style="min-width: 120px;">
1975
- <a href="<?php echo wppa_dbg_url($url.'name') ?>">
1976
- <?php _e('Name', 'wp-photo-album-plus');
1977
- if ($order == 'name') {
1978
- if ( $reverse ) echo $upimg;
1979
- else echo $downimg;
1980
- }
1981
- ?>
1982
- </a>
1983
- </td>
1984
- <td >
1985
- <a href="<?php echo wppa_dbg_url($url.'description') ?>">
1986
- <?php _e('Description', 'wp-photo-album-plus');
1987
- if ($order == 'description') {
1988
- if ( $reverse ) echo $upimg;
1989
- else echo $downimg;
1990
- }
1991
- ?>
1992
- </a>
1993
- </td>
1994
- <?php if (current_user_can('administrator')) { ?>
1995
- <td style="min-width: 100px;">
1996
- <a href="<?php echo wppa_dbg_url($url.'owner') ?>">
1997
- <?php _e('Owner', 'wp-photo-album-plus');
1998
- if ($order == 'owner') {
1999
- if ( $reverse ) echo $upimg;
2000
- else echo $downimg;
2001
  }
2002
- ?>
2003
- </a>
2004
- </td>
2005
- <?php } ?>
2006
- <td style="min-width: 100px;" >
2007
- <a href="<?php echo wppa_dbg_url($url.'a_order') ?>">
2008
- <?php _e('Order', 'wp-photo-album-plus');
2009
- if ($order == 'a_order') {
2010
- if ( $reverse ) echo $upimg;
2011
- else echo $downimg;
2012
  }
2013
- ?>
2014
- </a>
2015
- </td>
2016
- <td style="width: 120px;">
2017
- <a href="<?php echo wppa_dbg_url($url.'a_parent') ?>">
2018
- <?php _e('Parent', 'wp-photo-album-plus');
2019
- if ($order == 'a_parent') {
2020
- if ( $reverse ) echo $upimg;
2021
- else echo $downimg;
2022
  }
2023
- ?>
2024
- </a>
2025
- </td>
2026
- <td title="<?php echo esc_attr( __( 'Albums/Photos/Moderation required/Scheduled', 'wp-photo-album-plus' ) ) ?>" >
2027
- <?php _e('A/P/PM/S', 'wp-photo-album-plus'); ?>
2028
- </td>
2029
- <td ><?php _e('Edit', 'wp-photo-album-plus'); ?></td>
2030
- <td ><?php _e('Quick', 'wp-photo-album-plus'); ?></td>
2031
- <td ><?php _e('Bulk', 'wp-photo-album-plus'); ?></td>
2032
- <td ><?php echo ( ! wppa_switch( 'porder_restricted' ) || wppa_user_is( 'administrator' ) ? __('Seq', 'wp-photo-album-plus') : '' ) ?></td>
2033
- <td ><?php _e('CovImg', 'wp-photo-album-plus'); ?></td>
2034
- <?php
2035
- if ( current_user_can( 'wppa_upload' ) ) {
2036
- echo '<td >' . __('Upload', 'wp-photo-album-plus') . '</td>';
2037
- }
2038
- if ( current_user_can( 'wppa_import' ) ) {
2039
- echo '<td >' . __('Import', 'wp-photo-album-plus') . '</td>';
2040
- }
2041
- ?>
2042
- <td ><?php _e('Delete', 'wp-photo-album-plus'); ?></td>
2043
- <?php if ( wppa_can_create_album() ) echo '<td >'.__('Create', 'wp-photo-album-plus').'</td>'; ?>
2044
- </tr>
2045
- </thead>
2046
- <tbody>
2047
- <?php $alt = ' class="alternate" '; ?>
2048
-
2049
- <?php
2050
- $idx = '0';
2051
- foreach ( array_keys( $seq ) as $s ) {
2052
- $album = $albums[$s];
2053
-
2054
- if ( wppa_have_access( $album ) ) { // && ( wppa_user_is( 'administrator' ) || $album['owner'] != '--- public ---' ) ) {
2055
- $counts = wppa_get_treecounts_a($album['id'], true);
2056
- $pendcount = $counts['pendselfphotos'];
2057
- // $pendcount = $wpdb->get_var($wpdb->prepare("SELECT COUNT(*) FROM $wpdb->wppa_photos WHERE album=%s AND status=%s", $album['id'], 'pending'));
2058
- ?>
2059
- <tr <?php echo($alt); if ($pendcount) echo 'style="background-color:#ffdddd"' ?>>
2060
- <td><?php echo($album['id'] . ( $show_nl ? '('. wppa_get_nesting_level($album['id']).')' : '' ) ) ?></td>
2061
- <td><?php echo(esc_attr(__(stripslashes($album['name'])))) ?></td>
2062
- <td><small><?php echo(esc_attr(__(stripslashes($album['description'])))) ?></small></td>
2063
- <?php if (current_user_can('administrator')) { ?>
2064
- <td><?php echo($album['owner']); ?></td>
2065
- <?php } ?>
2066
- <td><?php echo($album['a_order']) ?></td>
2067
- <td><?php echo sanitize_text_field( wppa_get_album_name( $album['a_parent'], array( 'extended' => true ))) ?></td>
2068
- <?php $url = wppa_dbg_url(get_admin_url().'admin.php?page=wppa_admin_menu&amp;tab=edit&amp;edit-id='.$album['id']); ?>
2069
- <?php $na = $counts['selfalbums']; ?>
2070
- <?php $np = $counts['selfphotos']; ?>
2071
- <?php $nm = $counts['pendselfphotos']; ?>
2072
- <?php $ns = $counts['scheduledselfphotos']; ?>
2073
- <td><?php echo $na.'/'.$np.'/'.$nm.'/'.$ns; ?></td>
2074
-
2075
- <?php $url = wppa_ea_url($album['id']) ?>
2076
- <td><a href="<?php echo($url) ?>" class="wppaedit"><?php _e('Edit', 'wp-photo-album-plus'); ?></a></td>
2077
- <td><a href="<?php echo($url.'&amp;quick=1') ?>" class="wppaedit"><?php _e('Quick', 'wp-photo-album-plus'); ?></a></td>
2078
- <td><a href="<?php echo($url.'&amp;bulk=1#manage-photos') ?>" class="wppaedit"><?php _e('Bulk', 'wp-photo-album-plus'); ?></a></td>
2079
-
2080
- <?php if ( ! wppa_switch( 'porder_restricted' ) || wppa_user_is( 'administrator' ) ) {
2081
- ?>
2082
- <td><a href="<?php echo($url.'&amp;seq=1') ?>" class="wppaedit"><?php _e('Seq', 'wp-photo-album-plus'); ?></a></td>
2083
- <?php
2084
- }
2085
- else {
2086
- echo '<td></td>';
2087
- } ?>
2088
-
2089
- <?php
2090
- $covid = max( $album['main_photo'], '0' );
2091
- if ( $covid ) {
2092
- $curl = wppa_dbg_url(get_admin_url().'admin.php?page=wppa_admin_menu&amp;tab=edit&amp;edit-id=single&amp;photo='.$covid.'&amp;wppa-nonce='.wp_create_nonce('wppa-nonce').'&amp;just-edit='.__('Edit cover image', 'wp-photo-album-plus'));
2093
- echo '<td><a href="'.$curl.'" class="wppaedit">'.__('CovImg', 'wp-photo-album-plus').'</a></td>';
2094
- }
2095
- else {
2096
- echo '<td></td>';
2097
- }
2098
- ?>
2099
- <?php
2100
- if ( current_user_can( 'wppa_upload' ) ) {
2101
- echo '<td ><a href="' . get_admin_url().'/admin.php?page=wppa_upload_photos&wppa-set-album='.$album['id'] . '" class="wppaedit" >' . __('Upload', 'wp-photo-album-plus') . '</a></td>';
2102
- }
2103
- if ( current_user_can( 'wppa_import' ) ) {
2104
- echo '<td ><a href="' . get_admin_url().'/admin.php?page=wppa_import_photos&wppa-set-album='.$album['id'] . '" class="wppaedit" >' . __('Import', 'wp-photo-album-plus') . '</a></td>';
2105
- }
2106
- ?>
2107
-
2108
- <?php $url = wppa_ea_url($album['id'], 'del') ?>
2109
- <td><a href="<?php echo($url) ?>" class="wppadelete"><?php _e('Delete', 'wp-photo-album-plus'); ?></a></td>
2110
- <?php if ( wppa_can_create_album() ) {
2111
- $url = wppa_dbg_url(get_admin_url().'admin.php?page=wppa_admin_menu&amp;tab=edit&amp;edit-id=new&amp;parent_id='.$album['id'].'&amp;wppa-nonce='.wp_create_nonce('wppa-nonce'));
2112
- $onc = 'if (confirm(\''.__('Are you sure you want to create a subalbum?', 'wp-photo-album-plus').'\')) document.location=\''.$url.'\';';
2113
- echo '<td><a onclick="'.$onc.'" class="wppacreate">'.__('Create', 'wp-photo-album-plus').'</a></td>';
2114
- }
2115
-
2116
- ?>
2117
- </tr>
2118
- <?php if ($alt == '') { $alt = ' class="alternate" '; } else { $alt = '';}
2119
  }
2120
  $idx++;
2121
  }
 
 
 
 
2122
 
2123
- wppa_search_edit();
2124
- wppa_trash_edit();
2125
 
2126
- ?>
2127
- </tbody>
2128
- <tfoot>
2129
- <tr>
2130
- <?php $url = get_admin_url().'admin.php?page=wppa_admin_menu&amp;order_by='; ?>
2131
- <td >
2132
- <a href="<?php echo wppa_dbg_url($url.'id') ?>">
2133
- <?php $show_nl ? _e( 'ID(nl)', 'wp-photo-album-plus' ) : _e( 'ID', 'wp-photo-album-plus' );
2134
- if ($order == 'id') {
2135
- if ( $reverse ) echo $upimg;
2136
- else echo $downimg;
2137
- }
2138
- ?>
2139
- </a>
2140
- </td>
2141
- <td style="width: 120px;">
2142
- <a href="<?php echo wppa_dbg_url($url.'name') ?>">
2143
- <?php _e('Name', 'wp-photo-album-plus');
2144
- if ($order == 'name') {
2145
- if ( $reverse ) echo $upimg;
2146
- else echo $downimg;
2147
- }
2148
- ?>
2149
- </a>
2150
- </td>
2151
- <td >
2152
- <a href="<?php echo wppa_dbg_url($url.'description') ?>">
2153
- <?php _e('Description', 'wp-photo-album-plus');
2154
- if ($order == 'description') {
2155
- if ( $reverse ) echo $upimg;
2156
- else echo $downimg;
2157
- }
2158
- ?>
2159
- </a>
2160
- </td>
2161
- <?php if (current_user_can('administrator')) { ?>
2162
- <td style="width: 100px;">
2163
- <a href="<?php echo wppa_dbg_url($url.'owner') ?>">
2164
- <?php _e('Owner', 'wp-photo-album-plus');
2165
- if ($order == 'owner') {
2166
- if ( $reverse ) echo $upimg;
2167
- else echo $downimg;
2168
- }
2169
- ?>
2170
- </a>
2171
- </td>
2172
- <?php } ?>
2173
- <td >
2174
- <a href="<?php echo wppa_dbg_url($url.'a_order') ?>">
2175
- <?php _e('Order', 'wp-photo-album-plus');
2176
- if ($order == 'a_order') {
2177
- if ( $reverse ) echo $upimg;
2178
- else echo $downimg;
2179
- }
2180
- ?>
2181
- </a>
2182
- </td>
2183
- <td style="width: 120px;">
2184
- <a href="<?php echo wppa_dbg_url($url.'a_parent') ?>">
2185
- <?php _e('Parent', 'wp-photo-album-plus');
2186
- if ($order == 'a_parent') {
2187
- if ( $reverse ) echo $upimg;
2188
- else echo $downimg;
2189
- }
2190
- ?>
2191
- </a>
2192
- </td>
2193
- <td title="<?php echo esc_attr( __( 'Albums/Photos/Moderation required/Scheduled', 'wp-photo-album-plus' ) ) ?>" >
2194
- <?php _e( 'A/P/PM/S', 'wp-photo-album-plus' ); ?>
2195
- </td>
2196
- <td ><?php _e('Edit', 'wp-photo-album-plus'); ?></td>
2197
- <td ><?php _e('Quick', 'wp-photo-album-plus'); ?></td>
2198
- <td ><?php _e('Bulk', 'wp-photo-album-plus'); ?></td>
2199
- <td ><?php echo ( ! wppa_switch( 'porder_restricted' ) || wppa_user_is( 'administrator' ) ? __('Seq', 'wp-photo-album-plus') : '' ) ?></td>
2200
- <td ><?php _e('CovImg', 'wp-photo-album-plus'); ?></td>
2201
- <?php
2202
- if ( current_user_can( 'wppa_upload' ) ) {
2203
- echo '<td >' . __('Upload', 'wp-photo-album-plus') . '</td>';
2204
- }
2205
- if ( current_user_can( 'wppa_import' ) ) {
2206
- echo '<td >' . __('Import', 'wp-photo-album-plus') . '</td>';
2207
- }
2208
- ?>
2209
- <td ><?php _e('Delete', 'wp-photo-album-plus'); ?></td>
2210
- <?php if ( wppa_can_create_album() ) echo '<td >'.__('Create', 'wp-photo-album-plus').'</td>'; ?>
2211
- </tr>
2212
  </tfoot>
 
 
2213
 
2214
- </table>
2215
- <?php
2216
- wppa_album_table_pagination( $page, $count );
2217
- wppa_album_admin_footer();
2218
 
2219
- } else {
2220
- ?>
2221
- <p><?php _e('No albums yet.', 'wp-photo-album-plus'); ?></p>
2222
- <?php
 
2223
  }
2224
  }
2225
 
@@ -2229,66 +2130,35 @@ global $wpdb;
2229
 
2230
  // Init
2231
  $pagesize = wppa_opt( 'album_admin_pagesize' );
2232
- $page = '1';
2233
- $skips = '0';
2234
- $pages = '1';
2235
  $show_nl = wppa_opt( 'user_create_max_level' ) != '99';
2236
 
2237
- // Find out what page to show
2238
- if ( $pagesize ) {
2239
- $page = wppa_get( 'album-page-no' );
2240
- if ( $page ) {
2241
- $page = max( $page, '1' );
2242
- $skips = ( $page - 1 ) * $pagesize;
2243
- }
2244
- }
2245
-
2246
  // Read all albums, pre-ordered
2247
- // $albums = $wpdb->get_results( "SELECT * FROM $wpdb->wppa_albums ORDER BY " . wppa_get_option( 'wppa_album_order_'.wppa_get_user(), 'id' ) . ( wppa_get_option( 'wppa_album_order_' . wppa_get_user() . '_reverse' ) == 'yes' ? " DESC" : "" ) , ARRAY_A );
2248
  $order_by = wppa_get_option( 'wppa_album_order_' . wppa_get_user(), 'id' );
2249
  $order_desc = wppa_get_option( 'wppa_album_order_' . wppa_get_user() . '_reverse' );
2250
- // A dynamic query is regarded as being insecure, so we make a switch statemnent with all possible sequences.
2251
- if ( $order_desc == 'yes' ) {
2252
- switch( $order_by ) {
2253
- case 'name':
2254
- $query = "SELECT * FROM $wpdb->wppa_albums ORDER BY name DESC";
2255
- break;
2256
- case 'description':
2257
- $query = "SELECT * FROM $wpdb->wppa_albums ORDER BY description DESC";
2258
- break;
2259
- case 'owner':
2260
- $query = "SELECT * FROM $wpdb->wppa_albums ORDER BY owner DESC";
2261
- break;
2262
- case 'a_order':
2263
- $query = "SELECT * FROM $wpdb->wppa_albums ORDER BY a_order DESC";
2264
- break;
2265
- case 'a_parent':
2266
- $query = "SELECT * FROM $wpdb->wppa_albums ORDER BY a_parent DESC";
2267
- break;
2268
- default:
2269
- $query = "SELECT * FROM $wpdb->wppa_albums ORDER BY id DESC";
2270
- }
2271
  }
2272
- else {
2273
- switch( $order_by ) {
2274
- case 'name':
2275
- $query = "SELECT * FROM $wpdb->wppa_albums ORDER BY name";
2276
- break;
2277
- case 'description':
2278
- $query = "SELECT * FROM $wpdb->wppa_albums ORDER BY description";
2279
- break;
2280
- case 'owner':
2281
- $query = "SELECT * FROM $wpdb->wppa_albums ORDER BY owner";
2282
- break;
2283
- case 'a_order':
2284
- $query = "SELECT * FROM $wpdb->wppa_albums ORDER BY a_order";
2285
- break;
2286
- case 'a_parent':
2287
- $query = "SELECT * FROM $wpdb->wppa_albums ORDER BY a_parent";
2288
- break;
2289
- default:
2290
- $query = "SELECT * FROM $wpdb->wppa_albums ORDER BY id";
2291
- }
2292
  }
2293
  $albums = $wpdb->get_results( $query, ARRAY_A );
2294
 
@@ -2320,15 +2190,12 @@ global $wpdb;
2320
  while ( ! $done ) {
2321
 
2322
  $done = true;
2323
-
2324
  foreach ( $albums as $a ) {
2325
 
2326
  $parent = $a['a_parent'];
2327
-
2328
  if ( $parent > '0' ) {
2329
 
2330
  $found = false;
2331
-
2332
  foreach ( $albums as $p ) {
2333
 
2334
  if ( $p['id'] == $parent ) {
@@ -2346,23 +2213,30 @@ global $wpdb;
2346
  }
2347
  }
2348
 
 
 
 
 
 
 
 
 
2349
  // Find the ordering method
2350
- $reverse = false;
 
2351
  $order = wppa_get( 'order_by' );
2352
  if ( ! $order ) {
2353
- $order = wppa_get_option('wppa_album_order_'.wppa_get_user(), 'id');
2354
- $reverse = (wppa_get_option('wppa_album_order_'.wppa_get_user().'_reverse') == 'yes');
2355
  }
2356
  else {
2357
- $old_order = wppa_get_option('wppa_album_order_'.wppa_get_user(), 'id');
2358
- $reverse = (wppa_get_option('wppa_album_order_'.wppa_get_user().'_reverse') == 'yes');
2359
  if ( $old_order == $order ) {
2360
  $reverse = ! $reverse;
2361
  }
2362
  else $reverse = false;
2363
- update_option('wppa_album_order_'.wppa_get_user(), $order);
2364
- if ( $reverse ) update_option('wppa_album_order_'.wppa_get_user().'_reverse', 'yes');
2365
- else update_option('wppa_album_order_'.wppa_get_user().'_reverse', 'no');
2366
  }
2367
 
2368
  if ( ! empty( $albums ) ) {
@@ -2410,246 +2284,155 @@ global $wpdb;
2410
  }
2411
  }
2412
 
2413
- $downimg = '<img src="'.wppa_get_imgdir().'down.png" alt="down" style=" height:12px; position:relative; top:2px; " />';
2414
- $upimg = '<img src="'.wppa_get_imgdir().'up.png" alt="up" style=" height:12px; position:relative; top:2px; " />';
2415
-
2416
- wppa_album_table_pagination( $page, $count );
2417
 
2418
- ?>
2419
  <table class="widefat wppa-table wppa-setting-table" style="margin-top:12px;" >
2420
- <thead>
2421
- <tr>
2422
- <td colspan="6" >
2423
- <img src="<?php echo wppa_get_imgdir().'backarrow.gif' ?>" style="height:16px;" title="<?php _e('Collapse subalbums', 'wp-photo-album-plus') ?>" />
2424
- <img src="<?php echo wppa_get_imgdir().'arrow.gif' ?>" style="height:16px;" title="<?php _e('Expand subalbums', 'wp-photo-album-plus') ?>" />
2425
- </td>
2426
- <?php $url = get_admin_url().'admin.php?page=wppa_admin_menu&amp;order_by='; ?>
2427
- <td style="min-width: 50px;" title="<?php echo ( $show_nl ?
2428
- esc_attr( __( 'The album id (the nesting level)', 'wp-photo-album-plus' ) ) :
2429
- esc_attr( __( 'The album id', 'wp-photo-album-plus' ) ) ) ?>" >
2430
- <a href="<?php echo wppa_dbg_url($url.'id') ?>">
2431
- <?php $show_nl ? _e( 'ID(nl)', 'wp-photo-album-plus' ) : _e( 'ID', 'wp-photo-album-plus' );
2432
- if ($order == 'id') {
2433
- if ( $reverse ) echo $upimg;
2434
- else echo $downimg;
2435
- }
2436
- ?>
2437
- </a>
2438
- </td>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2439
 
2440
- <td style="min-width: 120px;">
2441
- <a href="<?php echo wppa_dbg_url($url.'name') ?>">
2442
- <?php _e('Name', 'wp-photo-album-plus');
2443
- if ($order == 'name') {
2444
- if ( $reverse ) echo $upimg;
2445
- else echo $downimg;
2446
- }
2447
- ?>
2448
- </a>
2449
- </td>
2450
- <td >
2451
- <a href="<?php echo wppa_dbg_url($url.'description') ?>">
2452
- <?php _e('Description', 'wp-photo-album-plus');
2453
- if ($order == 'description') {
2454
- if ( $reverse ) echo $upimg;
2455
- else echo $downimg;
2456
- }
2457
- ?>
2458
- </a>
2459
- </td>
2460
- <?php if (current_user_can('administrator')) { ?>
2461
- <td style="min-width: 100px;">
2462
- <a href="<?php echo wppa_dbg_url($url.'owner') ?>">
2463
- <?php _e('Owner', 'wp-photo-album-plus');
2464
- if ($order == 'owner') {
2465
- if ( $reverse ) echo $upimg;
2466
- else echo $downimg;
2467
- }
2468
- ?>
2469
- </a>
2470
- </td>
2471
- <?php } ?>
2472
- <td style="min-width: 100px;" >
2473
- <a href="<?php echo wppa_dbg_url($url.'a_order') ?>">
2474
- <?php _e('Order', 'wp-photo-album-plus');
2475
- if ($order == 'a_order') {
2476
- if ( $reverse ) echo $upimg;
2477
- else echo $downimg;
2478
- }
2479
- ?>
2480
- </a>
2481
- </td>
2482
- <td style="width: 120px;">
2483
- <a href="<?php echo wppa_dbg_url($url.'a_parent') ?>">
2484
- <?php _e('Parent', 'wp-photo-album-plus');
2485
- if ($order == 'a_parent') {
2486
- if ( $reverse ) echo $upimg;
2487
- else echo $downimg;
2488
- }
2489
- ?>
2490
- </a>
2491
- </td>
2492
- <td title="<?php echo esc_attr( __('Albums/Photos/Moderation required/Scheduled', 'wp-photo-album-plus') ) ?>" >
2493
- <?php _e('A/P/PM/S', 'wp-photo-album-plus'); ?>
2494
- </td>
2495
- <td ><?php _e('Edit', 'wp-photo-album-plus'); ?></td>
2496
- <td ><?php _e('Quick', 'wp-photo-album-plus'); ?></td>
2497
- <td ><?php _e('Bulk', 'wp-photo-album-plus'); ?></td>
2498
- <td ><?php echo ( ! wppa_switch( 'porder_restricted' ) || wppa_user_is( 'administrator' ) ? __('Seq', 'wp-photo-album-plus') : '' ) ?></td>
2499
- <td ><?php _e('CovImg', 'wp-photo-album-plus'); ?></td>
2500
- <?php
2501
- if ( current_user_can( 'wppa_upload' ) ) {
2502
- echo '<td >' . __('Upload', 'wp-photo-album-plus') . '</td>';
2503
- }
2504
- if ( current_user_can( 'wppa_import' ) ) {
2505
- echo '<td >' . __('Import', 'wp-photo-album-plus') . '</td>';
2506
- }
2507
- ?>
2508
- <td ><?php _e('Delete', 'wp-photo-album-plus'); ?></td>
2509
- <?php if ( wppa_can_create_album() ) echo '<td >'.__('Create', 'wp-photo-album-plus').'</td>'; ?>
2510
- </tr>
2511
- </thead>
2512
- <tbody>
2513
 
2514
- <?php wppa_do_albumlist('0', '0', $albums, $seq); ?>
2515
- <?php if ( $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->wppa_albums WHERE a_parent = '-1'" ) > 0 ) { ?>
 
 
2516
  <tr>
2517
- <td colspan="<?php echo ( '19' + ( current_user_can( 'wppa_upload' ) ? '1' : '0' ) + ( current_user_can( 'wppa_import' ) ? '1' : '0' ) ) ?>" >
2518
- <em>
2519
- <?php _e('The following albums are ---separate--- and do not show up in the generic album display', 'wp-photo-album-plus'); ?>
2520
  </em>
2521
  </td>
2522
- </tr>
2523
- <?php wppa_do_albumlist('-1', '0', $albums, $seq); ?>
2524
- <?php }
2525
 
2526
- wppa_search_edit( true );
2527
- wppa_trash_edit( true );
 
2528
 
2529
- ?>
2530
- </tbody>
2531
- <tfoot>
2532
- <tr>
2533
- <td colspan="6" >
2534
- <img src="<?php echo wppa_get_imgdir().'backarrow.gif' ?>" style="height:16px;" title="<?php echo esc_attr( __('Collapse subalbums', 'wp-photo-album-plus') ) ?>" />
2535
- <img src="<?php echo wppa_get_imgdir().'arrow.gif' ?>" style="height:16px;" title="<?php echo esc_attr( __('Expand subalbums', 'wp-photo-album-plus') ) ?>" />
2536
- </td>
2537
- <?php $url = get_admin_url().'admin.php?page=wppa_admin_menu&amp;order_by='; ?>
2538
- <td style="min-width: 50px;" title="<?php echo ( $show_nl ?
2539
- esc_attr( __( 'The album id (the nesting level)', 'wp-photo-album-plus' ) ) :
2540
- esc_attr( __( 'The album id', 'wp-photo-album-plus' ) ) ) ?>" >
2541
- <a href="<?php echo wppa_dbg_url($url.'id') ?>">
2542
- <?php $show_nl ? _e( 'ID(nl)', 'wp-photo-album-plus' ) : _e( 'ID', 'wp-photo-album-plus' );
2543
- if ($order == 'id') {
2544
- if ( $reverse ) echo $upimg;
2545
- else echo $downimg;
2546
- }
2547
- ?>
2548
- </a>
2549
- </td>
2550
 
2551
- <td style="min-width: 120px;">
2552
- <a href="<?php echo wppa_dbg_url($url.'name') ?>">
2553
- <?php _e('Name', 'wp-photo-album-plus');
2554
- if ($order == 'name') {
2555
- if ( $reverse ) echo $upimg;
2556
- else echo $downimg;
2557
- }
2558
- ?>
2559
- </a>
2560
- </td>
2561
- <td >
2562
- <a href="<?php echo wppa_dbg_url($url.'description') ?>">
2563
- <?php _e('Description', 'wp-photo-album-plus');
2564
- if ($order == 'description') {
2565
- if ( $reverse ) echo $upimg;
2566
- else echo $downimg;
2567
- }
2568
- ?>
2569
- </a>
2570
- </td>
2571
- <?php if (current_user_can('administrator')) { ?>
2572
- <td style="min-width: 100px;">
2573
- <a href="<?php echo wppa_dbg_url($url.'owner') ?>">
2574
- <?php _e('Owner', 'wp-photo-album-plus');
2575
- if ($order == 'owner') {
2576
- if ( $reverse ) echo $upimg;
2577
- else echo $downimg;
2578
- }
2579
- ?>
2580
- </a>
2581
- </td>
2582
- <?php } ?>
2583
- <td style="min-width: 100px;" >
2584
- <a href="<?php echo wppa_dbg_url($url.'a_order') ?>">
2585
- <?php _e('Order', 'wp-photo-album-plus');
2586
- if ($order == 'a_order') {
2587
- if ( $reverse ) echo $upimg;
2588
- else echo $downimg;
2589
- }
2590
- ?>
2591
- </a>
2592
- </td>
2593
- <td style="width: 120px;">
2594
- <a href="<?php echo wppa_dbg_url($url.'a_parent') ?>">
2595
- <?php _e('Parent', 'wp-photo-album-plus');
2596
- if ($order == 'a_parent') {
2597
- if ( $reverse ) echo $upimg;
2598
- else echo $downimg;
2599
- }
2600
- ?>
2601
- </a>
2602
- </td>
2603
- <td title="<?php _e('Albums/Photos/Moderation required/Scheduled', 'wp-photo-album-plus') ?>" >
2604
- <?php _e('A/P/PM/S', 'wp-photo-album-plus'); ?>
2605
- </td>
2606
- <td ><?php _e('Edit', 'wp-photo-album-plus'); ?></td>
2607
- <td ><?php _e('Quick', 'wp-photo-album-plus'); ?></td>
2608
- <td ><?php _e('Bulk', 'wp-photo-album-plus'); ?></td>
2609
- <td ><?php echo ( ! wppa_switch( 'porder_restricted' ) || wppa_user_is( 'administrator' ) ? __('Seq', 'wp-photo-album-plus') : '' ) ?></td>
2610
- <td ><?php _e('CovImg', 'wp-photo-album-plus'); ?></td>
2611
- <?php
2612
- if ( current_user_can( 'wppa_upload' ) ) {
2613
- echo '<td >' . __('Upload', 'wp-photo-album-plus') . '</td>';
2614
- }
2615
- if ( current_user_can( 'wppa_import' ) ) {
2616
- echo '<td >' . __('Import', 'wp-photo-album-plus') . '</td>';
2617
- }
2618
- ?>
2619
- <td ><?php _e('Delete', 'wp-photo-album-plus'); ?></td>
2620
- <?php if ( wppa_can_create_album() ) echo '<td >'.__('Create', 'wp-photo-album-plus').'</td>'; ?>
2621
- </tr>
2622
  </tfoot>
 
 
2623
 
2624
- </table>
2625
- <?php
2626
- $the_js = '
2627
- function checkArrows() {
2628
- elms = jQuery(".alb-arrow-off");
2629
- for(i=0;i<elms.length;i++) {
2630
- elm = elms[i];
2631
- if ( elm.parentNode.parentNode.style.display == "none" ) elm.style.display = "none";
2632
- }
2633
- elms = jQuery(".alb-arrow-on");
2634
- for(i=0;i<elms.length;i++) {
2635
- elm = elms[i];
2636
- if ( elm.parentNode.parentNode.style.display == "none" ) elm.style.display = "";
2637
- }
2638
- }';
2639
 
2640
- wppa_add_inline_script( 'wppa-admin', $the_js );
2641
 
2642
- wppa_album_table_pagination( $page, $count );
2643
- wppa_album_admin_footer();
 
 
 
 
 
 
 
 
 
 
 
2644
 
2645
- } else {
2646
- ?>
2647
- <p><?php _e('No albums yet.', 'wp-photo-album-plus'); ?></p>
2648
- <?php
2649
  }
2650
  }
2651
 
2652
- function wppa_search_edit( $collapsible = false, $return = false ) {
 
2653
 
2654
  $doit = false;
2655
  if ( current_user_can( 'wppa_admin' ) && current_user_can( 'wppa_moderate' ) ) $doit = true;
@@ -2657,64 +2440,59 @@ function wppa_search_edit( $collapsible = false, $return = false ) {
2657
 
2658
  if ( ! $doit ) return;
2659
 
2660
- $result =
2661
- '<tr>' .
2662
- '<td colspan="' . ( ( $collapsible ? '20' : '14' ) + ( current_user_can( 'wppa_upload' ) ? '1' : '0' ) + ( current_user_can( 'wppa_import' ) ? '1' : '0' ) ) . '" >' .
2663
- '<em>' .
2664
- __( 'Search for photos to edit', 'wp-photo-album-plus' ) .
2665
- '</em>' .
2666
- ' ' .
2667
- '<small>' .
2668
- __( 'Enter search words seperated by commas. Photos will meet all search words by their names, descriptions, translated keywords and/or tags.', 'wp-photo-album-plus' ) .
2669
- '</small>' .
2670
- '</td>' .
2671
- '</tr>' .
2672
- '<tr class="alternate" >' .
2673
- ( $collapsible ? '<td></td>' : '' ) .
2674
- '<td id="src-alb" >' .
2675
- __( 'Any', 'wp-photo-album-plus' ) .
2676
- '</td>' .
2677
- ( $collapsible ? '<td></td><td></td><td></td><td></td><td></td>' : '' ) .
2678
- '<td>' .
2679
- __( 'Search for', 'wp-photo-album-plus' ) .
2680
- '</td>' .
2681
- '<td colspan="4" >';
2682
- $value = wppa_get( 'searchstring' );
2683
- $result .=
2684
- '<a id="wppa-edit-search-tag" />' .
2685
- '<input' .
2686
- ' type="text"' .
2687
- ' id="wppa-edit-search"' .
2688
- ' name="wppa-edit-search"' .
2689
- ' style="width:100%;padding:2px;color:black;background-color:#ccffcc;"' .
2690
- ' value="' . $value . '"' .
2691
- ' />' .
2692
- '</td>';
2693
- if ( current_user_can( 'wppa_admin' ) && current_user_can( 'wppa_moderate' ) ) {
2694
- $result .= '<td></td>';
2695
- }
2696
- $result .=
2697
- '<td>' .
2698
- '<a class="wppaedit" onclick="wppaEditSearch(\'' . wppa_ea_url( 'search' ) . '\', \'wppa-edit-search\' )" >' .
2699
- '<b>' . __( 'Edit', 'wp-photo-album-plus' ) . '</b>' .
2700
- '</a>' .
2701
- '</td>' .
2702
- '<td>' .
2703
- '<a class="wppaedit" onclick="wppaEditSearch(\'' . wppa_ea_url( 'search' ) . '&amp;quick' . '\', \'wppa-edit-search\' )" >' .
2704
- '<b>' . __( 'Quick', 'wp-photo-album-plus' ) . '</b>' .
2705
- '</a>' .
2706
- '</td>' .
2707
- '<td>' .
2708
- '<a class="wppaedit" onclick="wppaEditSearch(\'' . wppa_ea_url( 'search' ) . '&amp;bulk=1' . '\', \'wppa-edit-search\' )" >' .
2709
- '<b>' . __( 'Bulk', 'wp-photo-album-plus' ) . '</b>' .
2710
- '</a>' .
2711
- '</td>' .
2712
- '<td></td><td></td><td></td>' .
2713
- '<td colspan="' . strval( 1 + ( current_user_can( 'wppa_upload' ) ? 1 : 0 ) + ( current_user_can( 'wppa_import' ) ? 1 : 0 ) ) . '"></td>' .
2714
- '</tr>';
2715
-
2716
- if ( $return ) return $result;
2717
- else echo $result;
2718
  }
2719
 
2720
  function wppa_trash_edit( $collapsible = false ) {
@@ -2727,41 +2505,36 @@ global $wpdb;
2727
 
2728
  if ( ! $trashed ) $doit = false;
2729
 
2730
- if ( ! $doit ) return;
2731
-
2732
- $result =
2733
- '<tr>';
2734
- if ( $collapsible ) {
2735
- $result .= '<td></td>';
2736
- }
2737
- $result .=
2738
- '<td>' .
2739
- __( 'Any', 'wp-photo-album-plus' ) .
2740
- '</td>';
2741
- if ( $collapsible ) {
2742
- $result .= '<td></td><td></td><td></td><td></td><td></td>';
2743
- }
2744
- $result .=
2745
- '<td colspan="4" >' .
2746
- sprintf( __( 'There are %s trashed photos that can be rescued', 'wp-photo-album-plus' ), $trashed ) .
2747
- '</td>' .
2748
- '<td>' .
2749
- '</td>' .
2750
- '<td></td>' .
2751
- '<td>' .
2752
- '<a class="wppaedit" onclick="wppaEditTrash( \'' . wppa_ea_url( 'trash' ) . '\' );" >' .
2753
- '<b>' . __( 'Edit', 'wp-photo-album-plus' ) . '</b>' .
2754
- '</a>' .
2755
- '</td>' .
2756
- '<td>' .
2757
- '<a class="wppaedit" onclick="wppaEditTrash( \'' . wppa_ea_url( 'trash' ) . '&amp;quick' . '\' );" >' .
2758
- '<b>' . __( 'Quick', 'wp-photo-album-plus' ) . '</b>' .
2759
- '</a>' .
2760
- '</td>' .
2761
- '<td></td><td></td><td></td><td></td>' .
2762
- '</tr>';
2763
-
2764
- echo $result;
2765
  }
2766
 
2767
  function wppa_album_table_pagination( $page, $count ) {
@@ -2814,7 +2587,7 @@ global $wpdb;
2814
 
2815
  $result .= '</div>';
2816
 
2817
- echo $result;
2818
  }
2819
 
2820
  function wppa_do_albumlist( $parent, $nestinglevel, $albums, $seq ) {
@@ -2825,189 +2598,188 @@ global $wpdb;
2825
 
2826
  $alt = true;
2827
 
2828
- foreach ( array_keys( $seq ) as $s ) { // Obey the global sequence
2829
- $album = $albums[$s];
2830
- $id = $album['id'];
2831
- if ( $album['a_parent'] == $parent ) {
2832
- // if ( wppa_have_access( $album ) ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2833
 
2834
- $counts = wppa_get_treecounts_a( $id, true );
2835
- $pendcount = $counts['pendselfphotos'];
2836
- $schedulecount = $counts['scheduledselfphotos'];
2837
- $haschildren = wppa_have_accessible_children( $album );
2838
- {
2839
- $class = '';
2840
- if ( $parent != '0' && $parent != '-1' ) {
2841
- $class .= 'wppa-alb-onoff ';
2842
- $class .= 'wppa-alb-on-' . $parent . ' ';
2843
- $par = $parent;
2844
- while ( $par != '0' && $par != '-1' ) {
2845
- $class .= 'wppa-alb-off-' . $par . ' ';
2846
- $par = wppa_get_parentalbumid( $par );
2847
- }
2848
- }
2849
- if ( $alt ) $class .= ' alternate';
2850
- $style = '';
2851
- if ( $pendcount ) $style .= 'background-color:#ffdddd; ';
2852
- if ( $parent != '0' && $parent != '-1' ) $style .= 'display:none; ';
2853
-
2854
- $onclickon =
2855
- 'jQuery(\'.wppa-alb-on-'.$id.'\').css(\'display\',\'\');' .
2856
- 'jQuery(\'#alb-arrow-on-'.$id.'\').css(\'display\',\'none\');' .
2857
- 'jQuery(\'#alb-arrow-off-'.$id.'\').css(\'display\',\'\');' .
2858
- 'wppa_setCookie(\'alb-arrow-'.$id.'\',\'on\',365)';
2859
- $onclickoff =
2860
- 'jQuery(\'.wppa-alb-off-'.$id.'\').css(\'display\',\'none\');' .
2861
- 'jQuery(\'#alb-arrow-on-'.$id.'\').css(\'display\',\'\');' .
2862
- 'jQuery(\'#alb-arrow-off-'.$id.'\').css(\'display\',\'none\');' .
2863
- 'checkArrows();' .
2864
- 'wppa_setCookie(\'alb-arrow-'.$id.'\',\'off\',365)';
2865
- $indent = $nestinglevel;
2866
- if ( $indent > '5' ) $indent = 5;
2867
-
2868
- // Open the album line
2869
- echo '
2870
- <tr
2871
- id="alb-' . $id . '"
2872
- class="' . $class . '"
2873
- style="' . $style . '"
2874
- >';
2875
-
2876
- // Fillers before the arrow
2877
- $i = 0;
2878
- while ( $i < $indent ) {
2879
- echo '<td style="padding:2px;" ></td>';
2880
- $i++;
2881
- }
2882
 
2883
- // The arrow image td element
2884
- echo '
2885
- <td style="padding:2px; text-align:center;" >';
2886
-
2887
- // Only if the album has children the arrow will show up
2888
- if ( $haschildren ) {
2889
- echo '
2890
- <img
2891
- id="alb-arrow-off-' . $id . '"
2892
- class="alb-arrow-off"
2893
- style="height:16px; display:none;"
2894
- src="' . wppa_get_imgdir() . 'backarrow.gif' . '"
2895
- onclick="' . $onclickoff . '"
2896
- title="' . esc_attr( __( 'Collapse subalbums', 'wp-photo-album-plus' ) ) . '"
2897
- />
2898
- <img
2899
- id="alb-arrow-on-' . $id . '"
2900
- class="alb-arrow-on"
2901
- style="height:16px;"
2902
- src="' . wppa_get_imgdir() . 'arrow.gif' . '"
2903
- onclick="' . $onclickon . '"
2904
- title="' . esc_attr( __( 'Expand subalbums', 'wp-photo-album-plus' ) ) . '"
2905
- />';
2906
-
2907
- // Open subalbums by clicking the open button if it was before (cookie), and if it is visible (!)
2908
- if ( wppa_get_cookie( 'alb-arrow-' . $id ) == 'on' ) {
2909
- $the_js = '
2910
- jQuery(document).ready(function(){
2911
- if (jQuery("#alb-'.$id.'").css("display")!=="none") {
2912
- jQuery("#alb-arrow-on-'.$id.'").trigger("click");
2913
- }
2914
- else {
2915
- wppa_setCookie("alb-arrow-'.$id.'","off",365);
2916
- }
2917
- });';
2918
- wppa_add_inline_script( 'wppa-admin', $the_js );
2919
  }
2920
- }
 
 
 
 
 
 
2921
 
2922
- // Close the arrow image td element
2923
- echo '</td>';
 
2924
 
2925
- // The album id td element
2926
- echo '<td style="padding:2px;" >' . $id . ( $show_nl ? '(' . wppa_get_nesting_level( $album['id'] ) . ')' : '' ) . '</td>';
 
2927
 
2928
- // Fillers after the arrow
2929
- $i = $indent;
2930
- while ( $i < 5 ) {
2931
- echo '<td style="padding:2px;" ></td>';
2932
- $i++;
2933
- }
2934
 
2935
- // The album name
2936
- echo '<td>' . esc_attr( __( stripslashes( $album['name'] ) ) ) . '</td>';
2937
-
2938
- /* HBI */ ?>
2939
- <td><small><?php echo(esc_attr(__(stripslashes($album['description'])))) ?></small></td>
2940
- <?php if (current_user_can('administrator')) { ?>
2941
- <td><?php echo($album['owner']); ?></td>
2942
- <?php } ?>
2943
- <td><?php echo($album['a_order']) ?></td>
2944
- <td><?php echo sanitize_text_field(wppa_get_album_name($album['a_parent'], array( 'extended' => true ))) ?></td>
2945
- <?php $url = wppa_dbg_url(get_admin_url().'admin.php?page=wppa_admin_menu&amp;tab=edit&amp;edit-id='.$id); ?>
2946
- <?php $na = $counts['selfalbums']; ?>
2947
- <?php $np = $counts['selfphotos']; ?>
2948
- <?php $nm = $counts['pendselfphotos']; ?>
2949
- <?php $ns = $counts['scheduledselfphotos']; ?>
2950
- <td><?php echo $na.'/'.$np.'/'.$nm.'/'.$ns; ?></td>
2951
-
2952
- <?php if ( wppa_have_access( $album['id'] ) ) {// if ( $album['owner'] == wppa_get_user() || wppa_user_is('administrator') ) { ?>
2953
- <?php $url = wppa_ea_url($id) ?>
2954
- <td><a href="<?php echo($url) ?>" class="wppaedit"><?php _e('Edit', 'wp-photo-album-plus'); ?></a></td>
2955
- <td><a href="<?php echo($url.'&amp;quick=1') ?>" class="wppaedit"><?php _e('Quick', 'wp-photo-album-plus'); ?></a></td>
2956
- <td><a href="<?php echo($url.'&amp;bulk=1#manage-photos') ?>" class="wppaedit"><?php _e('Bulk', 'wp-photo-album-plus'); ?></a></td>
2957
-
2958
- <?php if ( ! wppa_switch( 'porder_restricted' ) || wppa_user_is( 'administrator' ) ) {
2959
- ?>
2960
- <td><a href="<?php echo($url.'&amp;seq=1') ?>" class="wppaedit"><?php _e('Seq', 'wp-photo-album-plus'); ?></a></td>
2961
- <?php
2962
- }
2963
- else {
2964
- echo '<td></td>';
2965
- } ?>
2966
-
2967
- <?php
2968
- $covid = max( $album['main_photo'], '0' );
2969
- if ( $covid ) {
2970
- $curl = wppa_dbg_url(get_admin_url().'admin.php?page=wppa_admin_menu&amp;tab=edit&amp;edit-id=single&amp;photo='.$covid.'&amp;wppa-nonce='.wp_create_nonce('wppa-nonce').'&amp;just-edit='.__('Edit cover image', 'wp-photo-album-plus'));
2971
- echo '<td><a href="'.$curl.'" class="wppaedit">'.__('CovImg', 'wp-photo-album-plus').'</a></td>';
2972
- }
2973
- else {
2974
- echo '<td></td>';
2975
- }
2976
- if ( current_user_can( 'wppa_upload' ) ) {
2977
- echo '<td ><a href="' . get_admin_url().'/admin.php?page=wppa_upload_photos&wppa-set-album='.$id . '" class="wppaedit" >' . __('Upload', 'wp-photo-album-plus') . '</a></td>';
2978
- }
2979
- if ( current_user_can( 'wppa_import' ) ) {
2980
- echo '<td ><a href="' . get_admin_url().'/admin.php?page=wppa_import_photos&wppa-set-album='.$id . '" class="wppaedit" >' . __('Import', 'wp-photo-album-plus') . '</a></td>';
2981
- }
2982
- ?>
2983
- <?php $url = wppa_ea_url($id, 'del') ?>
2984
- <td>
2985
- <?php if ( wppa_user_is( 'administrator' ) || wppa_get_user() == $album['owner'] ) {
2986
- echo '<a href="' . esc_url($url) . '" class="wppadelete" >' . __('Delete', 'wp-photo-album-plus') . '</a>';
2987
- }
2988
- ?>
2989
- </td>
2990
- <?php if ( wppa_can_create_album() ) {
2991
- $url = wppa_dbg_url(get_admin_url().'admin.php?page=wppa_admin_menu&amp;tab=edit&amp;edit-id=new&amp;parent_id='.$id.'&amp;wppa-nonce='.wp_create_nonce('wppa-nonce'));
2992
- $onc = 'if (confirm(\''.__('Are you sure you want to create a subalbum?', 'wp-photo-album-plus').'\')) document.location=\''.$url.'\';';
2993
- echo '<td><a onclick="'.$onc.'" class="wppacreate">'.__('Create', 'wp-photo-album-plus').'</a></td>';
2994
- }
2995
- }
2996
- else {
2997
- if ( wppa_can_create_album() ) echo '<td></td>';
2998
- if ( current_user_can( 'wppa_upload' ) ) echo '<td></td>';
2999
- if ( current_user_can( 'wppa_import' ) ) echo '<td></td>';
3000
- echo '<td></td><td></td><td></td><td></td><td></td><td></td>';
3001
- } ?>
3002
-
3003
- </tr>
3004
- <?php if ($alt == '') { $alt = ' class="alternate" '; } else { $alt = '';}
3005
- if ( $haschildren ) wppa_do_albumlist($id, $nestinglevel+'1', $albums, $seq);
3006
  }
3007
- // }
3008
- }
3009
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3010
 
 
 
 
3011
  }
3012
 
3013
  function wppa_have_accessible_children( $alb ) {
@@ -3068,7 +2840,6 @@ global $wpdb;
3068
 
3069
  // Now delete the album
3070
  $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->wppa_albums WHERE id = %d", $id ) );
3071
- // wppa_delete_album_source( $id );
3072
  wppa_index_remove( 'album', $id );
3073
  wppa_clear_catlist();
3074
  wppa_clear_cache( array( 'album' => $id ) );
@@ -3076,7 +2847,7 @@ global $wpdb;
3076
 
3077
  $msg = __( 'Album Deleted.' , 'wp-photo-album-plus');
3078
  if ( wppa( 'ajax' ) ) {
3079
- echo $msg;
3080
  }
3081
  else {
3082
  wppa_update_message( $msg );
@@ -3212,8 +2983,6 @@ global $wpdb;
3212
  $albums = $wpdb->get_results( $wpdb->prepare( $query, $parent ), ARRAY_A );
3213
  }
3214
 
3215
- // $albums = $wpdb->get_results( $wpdb->prepare( $query, $parent ), ARRAY_A );
3216
-
3217
  // Anything to do here ?
3218
  if ( empty ( $albums ) ) {
3219
  return;
@@ -3229,330 +2998,337 @@ global $wpdb;
3229
  // Check album order
3230
  if ( $albumorder_col != 'a_order' ) {
3231
  if ( $parent == '0') {
3232
- echo '<br />';
3233
- _e( 'You can edit top-level album sequence number here when you set the album sequence to "Order #" or "Order # desc" in Basic settings -> Misc -> I -> Item 1.' );
 
3234
  }
3235
  else {
3236
- _e( 'You can edit sub-album sequence number here when you set the album sequence to "Order #" or "Order # desc" in the "Sub album sort order:" selection box above.' );
 
3237
  }
3238
- echo '<br />';
 
 
3239
  return;
3240
  }
3241
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3242
 
 
 
 
 
 
3243
 
3244
- echo
3245
- '<h2>' .
3246
- __( 'Manage album order', 'wp-photo-album-plus' ) .
3247
- ' - ' .
3248
- '<small>' .
3249
- '<i>' .
3250
- __( 'Change sequence order by drag and drop, or use the up/down arrows.', 'wp-photo-album-plus' ) .
3251
- '</i>' .
3252
- ' ' .
3253
- __( 'Do not leave this page unless the bar is entirely green.', 'wp-photo-album-plus' ) .
3254
- '</small>' .
3255
- '</h2>';
3256
-
3257
- echo
3258
- '<table>' .
3259
- '<thead>' .
3260
- '<tr>' .
3261
- '<th>' .
3262
- __( 'Color', 'wp-photo-album-plus' ) .
3263
- '</th>' .
3264
- '<th>' .
3265
- __( 'Meaning', 'wp-photo-album-plus' ) .
3266
- '</th>' .
3267
- '</tr>' .
3268
- '</thead>' .
3269
- '<tbody>' .
3270
- '<tr>' .
3271
- '<td>' .
3272
- '<div style="background-color:green;height:12px;" ></div>' .
3273
- '</td>' .
3274
- '<td>' .
3275
- __( 'Up to date', 'wp-photo-album-plus' ) .
3276
- '</td>' .
3277
- '</tr>' .
3278
- '<tr>' .
3279
- '<td>' .
3280
- '<div style="background-color:yellow;height:12px;" ></div>' .
3281
- '</td>' .
3282
- '<td>' .
3283
- __( 'Updating', 'wp-photo-album-plus' ) .
3284
- '</td>' .
3285
- '</tr>' .
3286
- '<tr>' .
3287
- '<td>' .
3288
- '<div style="background-color:orange;height:12px;" ></div>' .
3289
- '</td>' .
3290
- '<td>' .
3291
- __( 'Needs update', 'wp-photo-album-plus' ) .
3292
- '</td>' .
3293
- '</tr>' .
3294
- '<tr>' .
3295
- '<td>' .
3296
- '<div style="background-color:red;height:12px;" ></div>' .
3297
- '</td>' .
3298
- '<td>' .
3299
- __( 'Error', 'wp-photo-album-plus' ) .
3300
- '</td>' .
3301
- '</tr>' .
3302
- '</tbody>' .
3303
- '</table>';
3304
-
3305
-
3306
- $the_js = '
3307
- jQuery( function() {
3308
- jQuery( "#sortable-albums" ).sortable( {
3309
- cursor: "move",
3310
- placeholder: "sortable-placeholder-albums",
3311
- stop: function( event, ui ) { wppaDoRenumber(); }
3312
- } );
3313
- } );
3314
- var wppaRenumberPending = false;
3315
- var wppaAjaxInProgress = 0;
3316
-
3317
- function wppaDoRenumber() {
3318
-
3319
- // Busy?
3320
- if ( wppaAjaxInProgress > 0 ) {
3321
- wppaRenumberPending = true;
3322
- }
3323
-
3324
- // Not busy
3325
- else {
3326
- _wppaDoRenumber();
3327
- }
3328
  }
 
 
3329
 
3330
- function _wppaDoRenumber() {
3331
-
3332
- // Init
3333
- var ids = jQuery( ".wppa-sort-item-albums" );
3334
- var seq = jQuery( ".wppa-sort-seqn-albums" );
3335
- var descend = ' . ( $is_descending ? 'true' : 'false' ) . ';
3336
-
3337
- // Mark needs update
3338
- var idx = 0;
3339
- while ( idx < ids.length ) {
3340
- var newvalue;
3341
- if ( descend ) newvalue = ids.length - idx;
3342
- else newvalue = idx + 1;
3343
- var oldvalue = seq[idx].value;
3344
- var album = ids[idx].value;
3345
- if ( newvalue != oldvalue ) {
3346
- jQuery( "#wppa-pb-"+idx ).css({backgroundColor:"orange"});
3347
- }
3348
- idx++;
3349
- }
3350
-
3351
- // Process
3352
- var idx = 0;
3353
- while ( idx < ids.length ) {
3354
- var newvalue;
3355
- if ( descend ) newvalue = ids.length - idx;
3356
- else newvalue = idx + 1;
3357
- var oldvalue = seq[idx].value;
3358
- var album = ids[idx].value;
3359
- if ( newvalue != oldvalue ) {
3360
- wppaDoSeqUpdateAlbum( album, newvalue );
3361
- jQuery( "#wppa-pb-"+idx ).css({backgroundColor:"yellow"});
3362
- wppaLastAlbum = album;
3363
- }
3364
- idx++;
3365
- }
3366
  }
 
 
 
3367
 
3368
- function wppaDoSeqUpdateAlbum( album, seqno ) {
3369
-
3370
- var data = "action=wppa" +
3371
- "&wppa-action=update-album" +
3372
- "&album-id=" + album +
3373
- "&item=a_order" +
3374
- "&wppa-nonce=" + document.getElementById( "album-nonce-" + album ).value +
3375
- "&value=" + seqno;
3376
- var xmlhttp = new XMLHttpRequest();
3377
-
3378
- xmlhttp.onreadystatechange = function() {
3379
- if ( xmlhttp.readyState == 4 && xmlhttp.status != 404 ) {
3380
- var ArrValues = xmlhttp.responseText.split( "||" );
3381
- if ( ArrValues[0] != "" ) {
3382
- alert( "The server returned unexpected output:\n" + ArrValues[0] );
 
 
 
 
 
 
 
3383
  }
3384
- switch ( ArrValues[1] ) {
3385
- case "0": // No error
3386
- var i = seqno - 1;
3387
- var descend = ' . ( $is_descending ? 'true' : 'false' ) . ';
3388
- if ( descend ) {
3389
- i = ' . count( $albums ) . ' - seqno;
3390
- }
3391
- jQuery( "#wppa-album-seqno-" + album ).html( seqno );
3392
- if ( wppaRenumberPending ) {
3393
- jQuery( "#wppa-pb-"+i ).css({backgroundColor:"orange"});
3394
- }
3395
- else {
3396
- jQuery( "#wppa-pb-"+i ).css({backgroundColor:"green"});
3397
- }
3398
- if ( wppaLastAlbum = album ) {
3399
- wppaRenumberBusy = false;
3400
- }
3401
- break;
3402
- default: // Any error
3403
- jQuery( "#wppa-album-seqno-" + album ).html( "<span style=\'color:red\' >Err:" + ArrValues[1] + "</span>" );
3404
- break;
3405
  }
3406
- wppaAjaxInProgress--;
3407
-
3408
- // No longer busy?
3409
- if ( wppaAjaxInProgress == 0 ) {
3410
-
3411
- if ( wppaRenumberPending ) {
3412
-
3413
- // Redo
3414
- wppaRenumberPending = false;
3415
- wppaDoRenumber();
3416
- }
3417
  }
3418
- }
 
 
 
 
 
 
3419
  }
3420
- xmlhttp.open( "POST",wppaAjaxUrl,true );
3421
- xmlhttp.setRequestHeader( "Content-type","application/x-www-form-urlencoded" );
3422
- xmlhttp.send( data );
3423
- wppaAjaxInProgress++;
3424
-
3425
- jQuery( "#wppa-sort-seqn-albums-" + album ).prop( "value", seqno ); // set hidden value to new value to prevent duplicate action
3426
- var spinnerhtml = "<img src=\'" + wppaImageDirectory + "spinner.gif\' />";
3427
- jQuery( "#wppa-album-seqno-" + album ).html( spinnerhtml );
3428
- }';
3429
-
3430
- wppa_add_inline_script( 'wppa-admin', $the_js );
3431
 
3432
- ?>
 
3433
 
3434
- <br />
3435
 
3436
- <div id="wppa-progbar" style="width:100%;height:12px;" >
3437
- <?php
3438
- $c = count( $albums );
3439
- $l = 100 / $c;
3440
- $i = 0;
3441
- while( $i < $c ) {
3442
- echo
3443
- '<div' .
3444
- ' id="wppa-pb-' . $i . '"' .
3445
- ' style="display:inline;float:left;background-color:green;height:12px;width:' . $l . '%;"' .
3446
- ' >' .
3447
- '</div>';
3448
- $i++;
3449
  }
3450
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3451
  </div>
 
 
3452
 
3453
- <br />
3454
-
3455
- <div class="widefat" style="max-width:600px;" >
3456
- <div id="sortable-albums">
3457
- <?php foreach ( $albums as $album ) {
3458
- $cover_photo_id = wppa_get_coverphoto_id( $album['id'] );
3459
- echo '
3460
- <div' .
3461
- ' id="albumitem-' . $album['id'] .'"' .
3462
- ' class="ui-state-default-albums"' .
3463
- ' style="background-color:#eeeeee;cursor:move;"' .
3464
- ' >' .
3465
- '<div' .
3466
- ' style="height:100%;width:25%;float:left;text-align:center;overflow:hidden;" >';
3467
- if ( wppa_is_video( $cover_photo_id ) ) {
3468
- echo
3469
- wppa_get_video_html( array( 'id' => $cover_photo_id,
3470
- 'height' => '50',
3471
- 'margin_top' => '5',
3472
- 'margin_bottom' => '5',
3473
- 'controls' => false,
3474
- ) );
3475
- }
3476
- else {
3477
- echo
3478
- '<img' .
3479
- ' class="wppa-cover-image"' .
3480
- ' src="' . esc_url( wppa_get_thumb_url( wppa_get_coverphoto_id( $album['id'] ) ) ) . '"' .
3481
- ' style="max-height:50px; margin: 5px;"' .
3482
- ' />';
3483
- }
3484
- $albid = strval( intval( $album['id'] ) );
3485
- echo
3486
- '</div>' .
3487
- '<div style="height:100%;width:40%;float:left;font-size:12px;overflow:hidden;" >' .
3488
- '<b>' . htmlspecialchars( wppa_get_album_name( $albid ) ) . '</b>' .
3489
- '<br />' .
3490
- wppa_get_album_desc( $albid ) .
3491
- '</div>' .
3492
- '<div style="float:right;width:10%;" >' .
3493
- '<table>' .
3494
- '<tr><td>' .
3495
- '<img' .
3496
- ' src="' . esc_url( wppa_get_imgdir( 'up.png' ) ) . '"' .
3497
- ' title="' . esc_attr( __( 'To top', 'wp-photo-album-plus' ) ) . '"' .
3498
- ' style="cursor:pointer;"' .
3499
- ' onclick="' .
3500
- 'jQuery( \'#albumitem-' . $albid . '\' ).parent().prepend(jQuery( \'#albumitem-' . $albid . '\' ));' .
3501
- 'wppaDoRenumber();' .
3502
- '"' .
3503
- ' />' .
3504
- '</td></tr>' .
3505
- '<tr><td>' .
3506
- '<img' .
3507
- ' src="' . esc_url( wppa_get_imgdir( 'up.png' ) ) . '"' .
3508
- ' title="' . esc_attr( __( 'One up', 'wp-photo-album-plus' ) ) . '"' .
3509
- ' style="cursor:pointer;width:24px;"' .
3510
- ' onclick="' .
3511
- 'jQuery( \'#albumitem-' . $albid . '\' ).prev().before(jQuery( \'#albumitem-' . $albid . '\' ));' .
3512
- 'wppaDoRenumber();' .
3513
- '"' .
3514
- ' />' .
3515
- '</td></tr>' .
3516
- '<tr><td>' .
3517
- '<img' .
3518
- ' src="' . esc_url( wppa_get_imgdir( 'down.png' ) ) . '"' .
3519
- ' title="' . esc_attr( __( 'One down', 'wp-photo-album-plus' ) ) . '"' .
3520
- ' style="cursor:pointer;width:24px;"' .
3521
- ' onclick="' .
3522
- 'jQuery( \'#albumitem-' . $albid . '\' ).next().after(jQuery( \'#albumitem-' . $albid . '\' ));' .
3523
- 'wppaDoRenumber();' .
3524
- '"' .
3525
- ' />' .
3526
- '</td></tr>' .
3527
- '<tr><td>' .
3528
- '<img' .
3529
- ' src="' . esc_url( wppa_get_imgdir( 'down.png' ) ) . '"' .
3530
- ' title="' . esc_attr( __( 'To bottom', 'wp-photo-album-plus' ) ) . '"' .
3531
- ' style="cursor:pointer;"' .
3532
- ' onclick="' .
3533
- 'jQuery( \'#albumitem-' . $albid . '\' ).parent().append(jQuery( \'#albumitem-' . $albid . '\' ));' .
3534
- 'wppaDoRenumber();' .
3535
- '"' .
3536
- ' />' .
3537
- '</td></tr>' .
3538
- '</table>' .
3539
- '</div>' .
3540
- '<div style="float:right; width:25%;" >' .
3541
- '<span> ' . __( 'Id:' , 'wp-photo-album-plus' ) . ' ' . $albid . '</span>' .
3542
- '<span> - ' . __( 'Ord:' , 'wp-photo-album-plus' ) . '</span>' .
3543
- '<span id="wppa-album-seqno-' . $albid . '" > ' . $album['a_order'] . '</span>' .
3544
- '<br />' .
3545
- '<a href="' . esc_url( wppa_ea_url( $albid ) ) . '" style="position:absolute;bottom:0;" >' . __( 'Edit', 'wp-photo-album-plus' ) . '</a>' .
3546
- '</div>' .
3547
- '<input type="hidden" id="album-nonce-' . $albid . '" value="' . wp_create_nonce( 'wppa-nonce_' . $albid ) . '" />' .
3548
- '<input type="hidden" class="wppa-sort-item-albums" value="' . $albid . '" />' .
3549
- '<input type="hidden" class="wppa-sort-seqn-albums" id="wppa-sort-seqn-albums-' . $albid . '" value="' . $album['a_order'] . '" />' .
3550
- '</div>';
3551
- } ?>
3552
- </div>
3553
- <div style="clear:both;"></div>
3554
- </div>
3555
- <?php
3556
  }
3557
 
3558
  // Search admin menu item
@@ -3561,9 +3337,9 @@ function _wppa_search() {
3561
  // Rememeber where we came from
3562
  update_option( 'wppa_search_page', 'wppa_search' );
3563
 
3564
- echo '
3565
  <div class="wrap" >
3566
- <img src="' . esc_attr( WPPA_URL . '/img/magnifier-large.png' ) . '" />
3567
  <h1 style="display:inline;" >' . __( 'Search photos', 'wp-photo-album-plus' ) . '</h1>
3568
  <div style="clear:both;" >&nbsp;</div>
3569
 
@@ -3589,9 +3365,11 @@ function _wppa_search() {
3589
  <col style="width:0px;" >
3590
  </colgroup>
3591
  <tbody>' .
3592
- wppa_search_edit( false, true ) . '
3593
  </tbody>
3594
  </table>
3595
  </div>';
 
 
3596
  }
3597
 
3
  * Package: wp-photo-album-plus
4
  *
5
  * create, edit and delete albums
6
+ * Version 8.1.02.003
7
  *
8
  */
9
 
136
 
137
  wppa_echo( '
138
  <a href="#manage-photos">
139
+ <div style="position:fixed;right:30px;bottom:30px;background-color:lightblue;float:right" >
140
  &nbsp;' . __( 'Top of page', 'wp-photo-album-plus' ) . '&nbsp;
141
  </div>
142
  </a>
1519
  $result .= '
1520
  </h1>
1521
  <div style="clear:both;" ></div>';
1522
+ wppa_echo( $result );
1523
 
1524
  if ( wppa_get( 'bulk' ) )
1525
  wppa_album_photos_bulk( $edit_id );
1528
  else
1529
  wppa_album_photos( $edit_id );
1530
 
1531
+ $result = '
1532
  <br />
1533
  <a href="' . $back_url . '" >' .
1534
  $back_title .
1535
  '</a>
1536
 
1537
  <a href="#manage-photos">
1538
+ <div style="position:fixed;right:30px;bottom:30px;background-color:lightblue;float:right" >&nbsp;' . __( 'Top of page', 'wp-photo-album-plus' ) . '&nbsp;</div>
1539
  </a>
1540
  </div>';
1541
  wppa_echo( $result );
1677
  }
1678
  $style = wppa_get_option('wppa_album_table_'.wppa_get_user(), 'flat');
1679
 
1680
+ $result = '
1681
+ <div class="wrap">' .
1682
+ wppa_admin_spinner() . '
1683
+ <img src="' . WPPA_URL . '/img/album32.png" />
1684
+ <h1 style="display:inline;" >' . __( 'Manage Albums', 'wp-photo-album-plus' ) . '</h1>
1685
+ <div style="clear:both;" ></div>';
1686
+
1687
  // The Create new album button
1688
  if ( wppa_can_create_top_album() ) {
1689
+ $url = wppa_dbg_url( get_admin_url() . 'admin.php?page=wppa_admin_menu&amp;tab=edit&amp;edit-id=new&amp;wppa-nonce=' . wp_create_nonce( 'wppa-nonce' ) );
1690
+ $vfy = __( 'Are you sure you want to create a new album?', 'wp-photo-album-plus' );
1691
+ $result .= '
1692
+ <form
1693
+ method="post"
1694
+ action="'.get_admin_url().'admin.php?page=wppa_admin_menu&wppa-nonce=' . wp_create_nonce( 'wppa-nonce' ) . '"
1695
+ style="float:left; margin-right:12px;"
1696
+ >
1697
+ <input type="hidden" name="tab" value="edit" />
1698
+ <input type="hidden" name="edit-id" value="new" />
1699
+ <input type="submit"
1700
+ class="button-primary"
1701
+ onclick="return confirm(\'' . $vfy . '\');"
1702
+ value="' . esc_attr__( 'Create New Empty Album', 'wp-photo-album-plus' ) . '"
1703
+ style="height:28px;"
1704
+ />
1705
+ </form>';
1706
+ if ( wppa_is_mobile() ) {
1707
+ $result .= '<br />';
1708
+ }
1709
  }
 
1710
 
1711
+ // The switch to button(s)
1712
+ if ( $style == 'flat' ) {
1713
+ $result .= '
1714
+ <input
1715
+ type="button"
1716
+ class="button-secundary"
1717
+ onclick="document.location=\'' . wppa_dbg_url( get_admin_url() . 'admin.php?page=wppa_admin_menu&amp;switchto=collapsible' ) . '\'"
1718
+ value="' . esc_attr__( 'Switch to Collapsable table', 'wp-photo-album-plus' ) . '"
1719
+ />';
1720
+ }
1721
+ else {
1722
+ $result .= '
1723
+ <input
1724
+ type="button"
1725
+ class="button-secundary"
1726
+ onclick="document.location=\'' . wppa_dbg_url( get_admin_url() . 'admin.php?page=wppa_admin_menu&amp;switchto=flat ' ) . '\'"
1727
+ value="' . esc_attr__( 'Switch to Flat table', 'wp-photo-album-plus' ) . '"
1728
+ />';
1729
+ }
1730
+ if ( wppa_is_mobile() ) {
1731
+ $result .= '<br />';
1732
+ }
1733
+ if ( $style != 'flat' ) {
1734
+ $result .= '
1735
  <input
1736
  type="button"
1737
  class="button-secundary"
1738
  id="wppa-open-all"
1739
  style="display:inline;"
1740
+ onclick=" jQuery(\'#wppa-close-all\').css(\'display\',\'inline\');
1741
+ jQuery(this).css(\'display\',\'none\');
1742
+ jQuery(\'.wppa-alb-onoff\').css(\'display\',\'\');
1743
+ jQuery(\'.alb-arrow-off\').css(\'display\',\'\');
1744
+ jQuery(\'.alb-arrow-on\').css(\'display\',\'none\');
1745
  "
1746
+ value="' . esc_attr__( 'Open all', 'wp-photo-album-plus' ) . '"
1747
  />
1748
  <input
1749
  type="button"
1750
  class="button-secundary"
1751
  id="wppa-close-all"
1752
+ style="display:inline;"
1753
+ onclick=" jQuery(\'#wppa-open-all\').css(\'display\',\'inline\');
1754
+ jQuery(this).css(\'display\',\'none\');
1755
+ jQuery(\'.wppa-alb-onoff\').css(\'display\',\'none\');
1756
+ jQuery(\'.alb-arrow-on\').css(\'display\',\'\');
1757
+ jQuery(\'.alb-arrow-off\').css(\'display\',\'none\');
1758
  "
1759
+ value="' . esc_attr__( 'Close all', 'wp-photo-album-plus' ) . '"
1760
+ />';
1761
+ if ( wppa_is_mobile() ) {
1762
+ $result .= '<br />';
1763
+ }
1764
+ }
1765
 
1766
+ $result .= ' ' . __( 'Filter by', 'wp-photo-album-plus' ) . ': ' . '
1767
+ <select
1768
+ onchange="document.location.href=\''.get_admin_url().'admin.php?page=wppa_admin_menu&switchto=flat&filter=\'+this.value"
1769
+ >';
1770
  $opts = $wpdb->get_col( "SELECT slug FROM $wpdb->wppa_index WHERE albums <> '' ORDER BY slug" );
1771
  $f = wppa_get( 'filter' );
1772
+ $result .= '
1773
+ <option value="" ></option>';
1774
  foreach( $opts as $opt ) {
1775
+ $result .= '<option value="' . $opt . '" ' . ( $f == $opt ? 'selected="selected" ' : '' ) . '>' . $opt . '</value>';
1776
  }
1777
+ $result .=
1778
  '</select>';
1779
+ if ( wppa_is_mobile() ) {
1780
+ $result .= '<br />';
1781
+ }
1782
+
1783
 
1784
+ $result .= ' ' .
1785
  __( 'Edit album number', 'wp-photo-album-plus' ) . ' ' . '
1786
  <input
1787
  id="wppa-edit-albid"
1803
  };';
1804
  wppa_add_inline_script( 'wppa-admin', $the_js );
1805
 
 
1806
 
1807
+ $result .= '<br />';
1808
+ wppa_echo( $result );
 
 
 
 
1809
 
1810
+ // The table of existing albums
1811
+ if ( $style == 'flat' ) wppa_admin_albums_flat();
1812
+ else wppa_admin_albums_collapsible();
1813
+
1814
+ wppa_echo( '<br />' );
1815
+
1816
+ wppa_album_sequence( '0' );
1817
+
1818
+ wppa_echo( '</div>' );
1819
  }
1820
  }
1821
 
1825
 
1826
  // Init
1827
  $pagesize = wppa_opt( 'album_admin_pagesize' );
1828
+ $page = wppa_get( 'album-page-no', '1' );
1829
+ $skips = ( $page - 1 ) * $pagesize;
 
 
 
 
 
 
 
 
 
 
1830
 
1831
  // Read all albums, pre-ordered
1832
  $order_by = wppa_get_option( 'wppa_album_order_' . wppa_get_user(), 'id' );
1833
  $order_desc = wppa_get_option( 'wppa_album_order_' . wppa_get_user() . '_reverse' );
1834
+
1835
+ switch( $order_by ) {
1836
+ case 'name':
1837
+ $query = "SELECT * FROM $wpdb->wppa_albums ORDER BY name";
1838
+ break;
1839
+ case 'description':
1840
+ $query = "SELECT * FROM $wpdb->wppa_albums ORDER BY description";
1841
+ break;
1842
+ case 'owner':
1843
+ $query = "SELECT * FROM $wpdb->wppa_albums ORDER BY owner";
1844
+ break;
1845
+ case 'a_order':
1846
+ $query = "SELECT * FROM $wpdb->wppa_albums ORDER BY a_order";
1847
+ break;
1848
+ case 'a_parent':
1849
+ $query = "SELECT * FROM $wpdb->wppa_albums ORDER BY a_parent";
1850
+ break;
1851
+ default:
1852
+ $query = "SELECT * FROM $wpdb->wppa_albums ORDER BY id";
 
 
 
1853
  }
1854
+ if ( $order_desc == 'yes' ) {
1855
+ $query .= " DESC";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1856
  }
1857
+
1858
  $albums = $wpdb->get_results( $query, ARRAY_A );
1859
 
1860
  // Remove non accessible albums
1914
  else update_option('wppa_album_order_'.wppa_get_user().'_reverse', 'no');
1915
  }
1916
 
1917
+ if ( ! empty( $albums ) ) {
1918
 
1919
  // Setup the sequence array
1920
  $seq = false;
1945
  }
1946
 
1947
  // Sort the seq array
1948
+ if ( $num ) asort( $seq, SORT_NUMERIC );
1949
+ else asort( $seq, SORT_REGULAR );
1950
 
1951
  // Reverse ?
1952
  if ( $reverse ) {
1959
  }
1960
  }
1961
 
1962
+ $downimg = '<img src="'.wppa_get_imgdir().'down.png" alt="down" style=" height:12px; position:relative; top:2px; " />';
1963
+ $upimg = '<img src="'.wppa_get_imgdir().'up.png" alt="up" style=" height:12px; position:relative; top:2px; " />';
1964
+ $show_nl = wppa_opt( 'user_create_max_level' ) != '99';
1965
+ $url = get_admin_url().'admin.php?page=wppa_admin_menu&amp;order_by=';
1966
+
1967
+ $result = wppa_album_table_pagination( $page, $count ) . '
1968
+ <table
1969
+ class="wppa-table widefat wppa-setting-table striped"
1970
+ style="margin-top:12px;"
1971
+ >
1972
+ <thead>';
1973
+ $thead_body = '
1974
+ <tr>
1975
+ <td
1976
+ style="min-width:75px;"
1977
+ title="' . ( $show_nl ? esc_attr( __( 'The album id (the nesting level)', 'wp-photo-album-plus' ) ) :
1978
+ esc_attr( __( 'The album id', 'wp-photo-album-plus' ) ) ) . '"
1979
+ >
1980
+ <a href="' . wppa_dbg_url( $url . 'id' ) . '">' .
1981
+ ( $show_nl ? __( 'ID(nl)', 'wp-photo-album-plus' ) : __( 'ID', 'wp-photo-album-plus' ) ) .
1982
+ ( $order == 'id' && $reverse ? $upimg : $downimg ) . '
1983
+ </a>
1984
+ </td>
1985
+ <td
1986
+ style="min-width: 120px;"
1987
+ >
1988
+ <a href="' . wppa_dbg_url( $url . 'name' ) . '">' .
1989
+ __( 'Name', 'wp-photo-album-plus' ) .
1990
+ ( $order == 'name' && $reverse ? $upimg : $downimg ) . '
1991
+ </a>
1992
+ </td>
1993
+ <td>
1994
+ <a href="' . wppa_dbg_url( $url . 'description' ) . '">' .
1995
+ __( 'Description', 'wp-photo-album-plus' ) .
1996
+ ( $order == 'description' && $reverse ? $upimg : $downimg ) . '
1997
+ </a>
1998
+ </td>';
1999
+ if ( current_user_can( 'administrator' ) ) {
2000
+ $thead_body .= '
2001
+ <td style="min-width: 100px;">
2002
+ <a href="' . wppa_dbg_url( $url . 'owner' ) . '">' .
2003
+ __( 'Owner', 'wp-photo-album-plus' ) .
2004
+ ( $order == 'owner' && $reverse ? $upimg : $downimg ) . '
2005
+ </a>
2006
+ </td>';
2007
+ }
2008
+ $thead_body .= '
2009
+ <td
2010
+ style="min-width: 100px;"
2011
+ >
2012
+ <a href="' . wppa_dbg_url( $url . 'a_order' ) . '">' .
2013
+ __( 'Order', 'wp-photo-album-plus' ) .
2014
+ ( $order == 'a_order' && $reverse ? $upimg : $downimg ) . '
2015
+ </a>
2016
+ </td>
2017
+ <td
2018
+ style="width: 120px;"
2019
+ >
2020
+ <a href="' . wppa_dbg_url( $url . 'a_parent' ) . '">' .
2021
+ __( 'Parent', 'wp-photo-album-plus' ) .
2022
+ ( $order == 'a_parent' && $reverse ? $upimg : $downimg ) . '
2023
+ </a>
2024
+ </td>
2025
+ <td
2026
+ title="' . esc_attr( __( 'Albums/Photos/Moderation required/Scheduled', 'wp-photo-album-plus' ) ) . '"
2027
+ >' .
2028
+ __( 'A/P/PM/S', 'wp-photo-album-plus' ) . '
2029
+ </td>
2030
+ <td>' . __( 'Edit', 'wp-photo-album-plus' ) . '</td>
2031
+ <td>' . __( 'Quick', 'wp-photo-album-plus') . '</td>
2032
+ <td>' . __( 'Bulk', 'wp-photo-album-plus' ) . '</td>
2033
+ <td>' . ( ! wppa_switch( 'porder_restricted' ) || wppa_user_is( 'administrator' ) ? __( 'Seq', 'wp-photo-album-plus' ) : '' ) . '</td>
2034
+ <td>' . __( 'CovImg', 'wp-photo-album-plus' ) . '</td>' .
2035
+ ( current_user_can( 'wppa_upload' ) ? '<td>' . __( 'Upload', 'wp-photo-album-plus' ) . '</td>' : '' ) .
2036
+ ( current_user_can( 'wppa_import' ) ? '<td>' . __( 'Import', 'wp-photo-album-plus' ) . '</td>' : '' ) . '
2037
+ <td >' . __( 'Delete', 'wp-photo-album-plus' ) . '</td>' .
2038
+ ( wppa_can_create_album() ? '<td>' . __( 'Create', 'wp-photo-album-plus' ) . '</td>' : '' ) . '
2039
+ </tr>';
2040
+ $result .= $thead_body;
2041
+ $result .= '
2042
+ </thead>';
2043
 
2044
+ // So far, output header
2045
+ wppa_echo( $result );
2046
 
2047
+ $alt = ' class="alternate" ';
2048
+ $idx = '0';
2049
+ $result = '<tbody>';
2050
+ $mayseq = ! wppa_switch( 'porder_restricted' ) || wppa_user_is( 'administrator' );
2051
 
2052
+ foreach ( array_keys( $seq ) as $s ) {
2053
+ $album = $albums[$s];
2054
+ $id = $album['id'];
2055
+ $counts = wppa_get_treecounts_a( $id, true );
2056
+ $url = wppa_dbg_url( get_admin_url() . 'admin.php?page=wppa_admin_menu&amp;tab=edit&amp;edit-id=' . $id );
2057
+ $na = $counts['selfalbums'];
2058
+ $np = $counts['selfphotos'];
2059
+ $nm = $counts['pendselfphotos'];
2060
+ $ns = $counts['scheduledselfphotos'];
2061
+ $covid = max( $album['main_photo'], '0' );
2062
+ $curl = get_admin_url() . 'admin.php?page=wppa_admin_menu&amp;tab=edit&amp;edit-id=single&amp;photo=' . $covid . '&amp;wppa-nonce=' . wp_create_nonce( 'wppa-nonce' ) . '&amp;just-edit=' . __( 'Edit cover image', 'wp-photo-album-plus' );
2063
+
2064
+ if ( wppa_have_access( $album ) ) {
2065
+ $pendcount = $counts['pendselfphotos'];
2066
+ $url = wppa_ea_url( $id );
2067
+ $delurl = wppa_ea_url( $id, 'del' );
2068
+ $creurl = get_admin_url() . 'admin.php?page=wppa_admin_menu&amp;tab=edit&amp;edit-id=new&amp;parent_id=' . $id . '&amp;wppa-nonce=' . wp_create_nonce( 'wppa-nonce' );
2069
+ $creonc = 'if (confirm(\''.esc_js(__('Are you sure you want to create a subalbum?', 'wp-photo-album-plus')).'\')) document.location=\''.$creurl.'\';';
2070
+
2071
+ $result .= '
2072
+ <tr ' . $alt . ( $pendcount ? 'style="background-color:#ffdddd"' : '' ) . '>
2073
+ <td>' . $id . ( $show_nl ? '(' . wppa_get_nesting_level( $id ) . ')' : '' ) . '</td>
2074
+ <td>' . $album['name'] . '</td>
2075
+ <td><small>' . esc_html( $album['description'] ) . '</small></td>' .
2076
+ ( current_user_can( 'administrator' ) ? '<td>' . $album['owner'] . '</td>' : '' ) . '
2077
+ <td>' . $album['a_order'] . '</td>
2078
+ <td>' . wppa_get_album_name( $album['a_parent'], array( 'extended' => true ) ) . '</td>
2079
+ <td>' . $na . '/' . $np . '/' . $nm . '/' . $ns . '</td>
2080
+ <td><a href="' . $url . '" class="wppaedit">' . __( 'Edit', 'wp-photo-album-plus' ) . '</a></td>
2081
+ <td><a href="' . $url . '&amp;quick=1" class="wppaedit">' . __( 'Quick', 'wp-photo-album-plus' ) . '</a></td>
2082
+ <td><a href="' . $url . '&amp;bulk=1#manage-photos" class="wppaedit">' . __( 'Bulk', 'wp-photo-album-plus' ) . '</a></td>
2083
+ <td>' . ( $mayseq ? '<a href="' . $url . '&amp;seq=1" class="wppaedit">' . __( 'Seq', 'wp-photo-album-plus' ) . '</a>' : '' ) . '</td>
2084
+ <td>' . ( $covid ? '<a href="' . $curl . '" class="wppaedit">' . __( 'CovImg', 'wp-photo-album-plus' ) . '</a>' : '' ) . '</td>';
2085
+ if ( current_user_can( 'wppa_upload' ) ) {
2086
+ $result .= '<td ><a href="' . get_admin_url() . '/admin.php?page=wppa_upload_photos&wppa-set-album=' . $id . '" class="wppaedit" >' . __( 'Upload', 'wp-photo-album-plus' ) . '</a></td>';
 
 
 
 
 
 
 
 
2087
  }
2088
+ if ( current_user_can( 'wppa_import' ) ) {
2089
+ $result .= '<td ><a href="' . get_admin_url() . '/admin.php?page=wppa_import_photos&wppa-set-album=' . $id . '" class="wppaedit" >' . __( 'Import', 'wp-photo-album-plus' ) . '</a></td>';
 
 
 
 
 
 
 
 
2090
  }
2091
+ $result .= '
2092
+ <td><a href="' . $delurl . '" class="wppadelete">' . __( 'Delete', 'wp-photo-album-plus' ) . '</a></td>';
2093
+ if ( wppa_can_create_album() ) {
2094
+ $result .= '<td><a onclick="' . $creonc . '" class="wppacreate">' . __( 'Create', 'wp-photo-album-plus' ) . '</a></td>';
 
 
 
 
 
2095
  }
2096
+ $result .= '
2097
+ </tr>';
2098
+ if ( $alt == '' ) { $alt = ' class="alternate" '; } else { $alt = ''; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2099
  }
2100
  $idx++;
2101
  }
2102
+ $result .=
2103
+ wppa_search_edit( false ) .
2104
+ wppa_trash_edit( false ) . '
2105
+ </tbody>';
2106
 
2107
+ // Output tbody
2108
+ wppa_echo( $result );
2109
 
2110
+ $result = '
2111
+ <tfoot>' .
2112
+ $thead_body . '
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2113
  </tfoot>
2114
+ </table>' .
2115
+ wppa_album_table_pagination( $page, $count );
2116
 
2117
+ wppa_echo( $result );
 
 
 
2118
 
2119
+ wppa_album_admin_footer();
2120
+
2121
+ }
2122
+ else {
2123
+ wppa_echo( '<p>' . __( 'No albums yet.', 'wp-photo-album-plus' ) . '</p>' );
2124
  }
2125
  }
2126
 
2130
 
2131
  // Init
2132
  $pagesize = wppa_opt( 'album_admin_pagesize' );
2133
+ $page = wppa_get( 'album-page-no', '1' );
2134
+ $skips = ( $page - 1 ) * $pagesize;
 
2135
  $show_nl = wppa_opt( 'user_create_max_level' ) != '99';
2136
 
 
 
 
 
 
 
 
 
 
2137
  // Read all albums, pre-ordered
 
2138
  $order_by = wppa_get_option( 'wppa_album_order_' . wppa_get_user(), 'id' );
2139
  $order_desc = wppa_get_option( 'wppa_album_order_' . wppa_get_user() . '_reverse' );
2140
+
2141
+ switch( $order_by ) {
2142
+ case 'name':
2143
+ $query = "SELECT * FROM $wpdb->wppa_albums ORDER BY name";
2144
+ break;
2145
+ case 'description':
2146
+ $query = "SELECT * FROM $wpdb->wppa_albums ORDER BY description";
2147
+ break;
2148
+ case 'owner':
2149
+ $query = "SELECT * FROM $wpdb->wppa_albums ORDER BY owner";
2150
+ break;
2151
+ case 'a_order':
2152
+ $query = "SELECT * FROM $wpdb->wppa_albums ORDER BY a_order";
2153
+ break;
2154
+ case 'a_parent':
2155
+ $query = "SELECT * FROM $wpdb->wppa_albums ORDER BY a_parent";
2156
+ break;
2157
+ default:
2158
+ $query = "SELECT * FROM $wpdb->wppa_albums ORDER BY id";
 
 
2159
  }
2160
+ if ( $order_desc == 'yes' ) {
2161
+ $query .= " DESC";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2162
  }
2163
  $albums = $wpdb->get_results( $query, ARRAY_A );
2164
 
2190
  while ( ! $done ) {
2191
 
2192
  $done = true;
 
2193
  foreach ( $albums as $a ) {
2194
 
2195
  $parent = $a['a_parent'];
 
2196
  if ( $parent > '0' ) {
2197
 
2198
  $found = false;
 
2199
  foreach ( $albums as $p ) {
2200
 
2201
  if ( $p['id'] == $parent ) {
2213
  }
2214
  }
2215
 
2216
+ // Make sure all (grand)children are in when pagination is on
2217
+ if ( $pagesize ) {
2218
+ $current_ids = implode( '.', array_column( $albums, 'id' ) );
2219
+ $all_ids = array_unique( explode( '.', wppa_alb_to_enum_children( $current_ids ) ) );
2220
+ $albums = $wpdb->get_results( "SELECT * FROM $wpdb->wppa_albums
2221
+ WHERE id in (" . implode( ',', $all_ids ) . ")", ARRAY_A );
2222
+ }
2223
+
2224
  // Find the ordering method
2225
+ $reverse = wppa_get_option( 'wppa_album_order_' . wppa_get_user() . '_reverse', 'no' ) == 'yes';
2226
+
2227
  $order = wppa_get( 'order_by' );
2228
  if ( ! $order ) {
2229
+ $order = wppa_get_option( 'wppa_album_order_' . wppa_get_user(), 'id' );
 
2230
  }
2231
  else {
2232
+ $old_order = wppa_get_option( 'wppa_album_order_' . wppa_get_user(), 'id' );
 
2233
  if ( $old_order == $order ) {
2234
  $reverse = ! $reverse;
2235
  }
2236
  else $reverse = false;
2237
+ update_option( 'wppa_album_order_' . wppa_get_user(), $order );
2238
+ if ( $reverse ) update_option( 'wppa_album_order_' . wppa_get_user() . '_reverse', 'yes' );
2239
+ else update_option( 'wppa_album_order_' . wppa_get_user() . '_reverse', 'no' );
2240
  }
2241
 
2242
  if ( ! empty( $albums ) ) {
2284
  }
2285
  }
2286
 
2287
+ $downimg = '<img src="'.wppa_get_imgdir().'down.png" alt="down" style=" height:12px; position:relative; top:2px; " />';
2288
+ $upimg = '<img src="'.wppa_get_imgdir().'up.png" alt="up" style=" height:12px; position:relative; top:2px; " />';
2289
+ $url = get_admin_url() . 'admin.php?page=wppa_admin_menu&amp;order_by=';
 
2290
 
2291
+ $result = wppa_album_table_pagination( $page, $count ) . '
2292
  <table class="widefat wppa-table wppa-setting-table" style="margin-top:12px;" >
2293
+ <thead>';
2294
+ $thead_body = '
2295
+ <tr>
2296
+ <td colspan="6" >
2297
+ <img src="' . wppa_get_imgdir() . 'backarrow.gif" style="height:16px;" title="' . __( 'Collapse subalbums', 'wp-photo-album-plus' ) . '" />
2298
+ <img src="' . wppa_get_imgdir() . 'arrow.gif" style="height:16px;" title="' . __( 'Expand subalbums', 'wp-photo-album-plus' ) . '" />
2299
+ </td>
2300
+ <td
2301
+ style="min-width:75px;"
2302
+ title="' . ( $show_nl ? esc_attr( __( 'The album id (the nesting level)', 'wp-photo-album-plus' ) ) :
2303
+ esc_attr( __( 'The album id', 'wp-photo-album-plus' ) ) ) . '"
2304
+ >
2305
+ <a href="' . wppa_dbg_url( $url . 'id' ) . '">' .
2306
+ ( $show_nl ? __( 'ID(nl)', 'wp-photo-album-plus' ) : __( 'ID', 'wp-photo-album-plus' ) ) .
2307
+ ( $order == 'id' && $reverse ? $upimg : $downimg ) . '
2308
+ </a>
2309
+ </td>
2310
+ <td
2311
+ style="min-width: 120px;"
2312
+ >
2313
+ <a href="' . wppa_dbg_url( $url . 'name' ) . '">' .
2314
+ __( 'Name', 'wp-photo-album-plus' ) .
2315
+ ( $order == 'name' && $reverse ? $upimg : $downimg ) . '
2316
+ </a>
2317
+ </td>
2318
+ <td>
2319
+ <a href="' . wppa_dbg_url( $url . 'description' ) . '">' .
2320
+ __( 'Description', 'wp-photo-album-plus' ) .
2321
+ ( $order == 'description' && $reverse ? $upimg : $downimg ) . '
2322
+ </a>
2323
+ </td>';
2324
+ if ( current_user_can( 'administrator' ) ) {
2325
+ $thead_body .= '
2326
+ <td style="min-width: 100px;">
2327
+ <a href="' . wppa_dbg_url( $url . 'owner' ) . '">' .
2328
+ __( 'Owner', 'wp-photo-album-plus' ) .
2329
+ ( $order == 'owner' && $reverse ? $upimg : $downimg ) . '
2330
+ </a>
2331
+ </td>';
2332
+ }
2333
+ $thead_body .= '
2334
+ <td
2335
+ style="min-width: 100px;"
2336
+ >
2337
+ <a href="' . wppa_dbg_url( $url . 'a_order' ) . '">' .
2338
+ __( 'Order', 'wp-photo-album-plus' ) .
2339
+ ( $order == 'a_order' && $reverse ? $upimg : $downimg ) . '
2340
+ </a>
2341
+ </td>
2342
+ <td
2343
+ style="width: 120px;"
2344
+ >
2345
+ <a href="' . wppa_dbg_url( $url . 'a_parent' ) . '">' .
2346
+ __( 'Parent', 'wp-photo-album-plus' ) .
2347
+ ( $order == 'a_parent' && $reverse ? $upimg : $downimg ) . '
2348
+ </a>
2349
+ </td>
2350
+ <td
2351
+ title="' . esc_attr( __( 'Albums/Photos/Moderation required/Scheduled', 'wp-photo-album-plus' ) ) . '"
2352
+ >' .
2353
+ __( 'A/P/PM/S', 'wp-photo-album-plus' ) . '
2354
+ </td>
2355
+ <td>' . __( 'Edit', 'wp-photo-album-plus' ) . '</td>
2356
+ <td>' . __( 'Quick', 'wp-photo-album-plus') . '</td>
2357
+ <td>' . __( 'Bulk', 'wp-photo-album-plus' ) . '</td>
2358
+ <td>' . ( ! wppa_switch( 'porder_restricted' ) || wppa_user_is( 'administrator' ) ? __( 'Seq', 'wp-photo-album-plus' ) : '' ) . '</td>
2359
+ <td>' . __( 'CovImg', 'wp-photo-album-plus' ) . '</td>' .
2360
+ ( current_user_can( 'wppa_upload' ) ? '<td>' . __( 'Upload', 'wp-photo-album-plus' ) . '</td>' : '' ) .
2361
+ ( current_user_can( 'wppa_import' ) ? '<td>' . __( 'Import', 'wp-photo-album-plus' ) . '</td>' : '' ) . '
2362
+ <td >' . __( 'Delete', 'wp-photo-album-plus' ) . '</td>' .
2363
+ ( wppa_can_create_album() ? '<td>' . __( 'Create', 'wp-photo-album-plus' ) . '</td>' : '' ) . '
2364
+ </tr>';
2365
+ $result .= $thead_body;
2366
+ $result .= '
2367
+ </thead>';
2368
 
2369
+ // So far, output header
2370
+ wppa_echo( $result );
2371
+
2372
+ $result = '
2373
+ <tbody>';
2374
+
2375
+ wppa_echo( $result );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2376
 
2377
+ wppa_do_albumlist( '0', '0', $albums, $seq );
2378
+
2379
+ if ( $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->wppa_albums WHERE a_parent = '-1'" ) > 0 ) {
2380
+ $result = '
2381
  <tr>
2382
+ <td colspan="' . ( '19' + ( current_user_can( 'wppa_upload' ) ? '1' : '0' ) + ( current_user_can( 'wppa_import' ) ? '1' : '0' ) ) . '" >
2383
+ <em>' .
2384
+ __( 'The following albums are ---separate--- and do not show up in the generic album display', 'wp-photo-album-plus' ) . '
2385
  </em>
2386
  </td>
2387
+ </tr>';
 
 
2388
 
2389
+ wppa_echo( $result );
2390
+ wppa_do_albumlist( '-1', '0', $albums, $seq );
2391
+ }
2392
 
2393
+ $result =
2394
+ wppa_search_edit( true ) .
2395
+ wppa_trash_edit( true ) . '
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2396
 
2397
+ </tbody>';
2398
+
2399
+ // Output tbody
2400
+ wppa_echo( $result );
2401
+
2402
+ $result = '
2403
+ <tfoot>' .
2404
+ $thead_body . '
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2405
  </tfoot>
2406
+ </table>' .
2407
+ wppa_album_table_pagination( $page, $count );
2408
 
2409
+ wppa_echo( $result );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2410
 
2411
+ wppa_album_admin_footer();
2412
 
2413
+ $the_js = '
2414
+ function checkArrows() {
2415
+ elms = jQuery(".alb-arrow-off");
2416
+ for(i=0;i<elms.length;i++) {
2417
+ elm = elms[i];
2418
+ if ( elm.parentNode.parentNode.style.display == "none" ) elm.style.display = "none";
2419
+ }
2420
+ elms = jQuery(".alb-arrow-on");
2421
+ for(i=0;i<elms.length;i++) {
2422
+ elm = elms[i];
2423
+ if ( elm.parentNode.parentNode.style.display == "none" ) elm.style.display = "";
2424
+ }
2425
+ }';
2426
 
2427
+ wppa_add_inline_script( 'wppa-admin', $the_js );
2428
+ }
2429
+ else {
2430
+ wppa_echo( '<p>' . __( 'No albums yet.', 'wp-photo-album-plus' ) . '</p>' );
2431
  }
2432
  }
2433
 
2434
+
2435
+ function wppa_search_edit( $collapsible = false ) {
2436
 
2437
  $doit = false;
2438
  if ( current_user_can( 'wppa_admin' ) && current_user_can( 'wppa_moderate' ) ) $doit = true;
2440
 
2441
  if ( ! $doit ) return;
2442
 
2443
+ $value = wppa_get( 'searchstring' );
2444
+
2445
+ $result = '
2446
+ <tr>
2447
+ <td colspan="' . ( ( $collapsible ? '20' : '14' ) + ( current_user_can( 'wppa_upload' ) ? '1' : '0' ) + ( current_user_can( 'wppa_import' ) ? '1' : '0' ) ) . '" >
2448
+ <em>' .
2449
+ __( 'Search for photos to edit', 'wp-photo-album-plus' ) . '
2450
+ </em>
2451
+ <small>' .
2452
+ __( 'Enter search words seperated by commas. Photos will meet all search words by their names, descriptions, translated keywords and/or tags.', 'wp-photo-album-plus' ) . '
2453
+ </small>
2454
+ </td>
2455
+ </tr>
2456
+ <tr class="alternate" >' .
2457
+ ( $collapsible ? '<td></td>' : '' ) . '
2458
+ <td id="src-alb" >' .
2459
+ __( 'Any', 'wp-photo-album-plus' ) . '
2460
+ </td>' .
2461
+ ( $collapsible ? '<td></td><td></td><td></td><td></td><td></td>' : '' ) . '
2462
+ <td>' .
2463
+ __( 'Search for', 'wp-photo-album-plus' ) . '
2464
+ </td>
2465
+ <td colspan="4" >
2466
+ <a id="wppa-edit-search-tag" />
2467
+ <input
2468
+ type="text"
2469
+ id="wppa-edit-search"
2470
+ name="wppa-edit-search"
2471
+ style="width:100%;padding:2px;color:black;background-color:#ccffcc;"
2472
+ value="' . $value . '"
2473
+ />
2474
+ </td>' .
2475
+ ( current_user_can( 'wppa_admin' ) && current_user_can( 'wppa_moderate' ) ? '<td></td>' : '' ) . '
2476
+ <td>
2477
+ <a class="wppaedit" onclick="wppaEditSearch(\'' . wppa_ea_url( 'search' ) . '\', \'wppa-edit-search\' )" >
2478
+ <span style="font-weight:bold">' . __( 'Edit', 'wp-photo-album-plus' ) . '</span>
2479
+ </a>
2480
+ </td>
2481
+ <td>
2482
+ <a class="wppaedit" onclick="wppaEditSearch(\'' . wppa_ea_url( 'search' ) . '&amp;quick' . '\', \'wppa-edit-search\' )" >
2483
+ <span style="font-weight:bold">' . __( 'Quick', 'wp-photo-album-plus' ) . '</span>
2484
+ </a>
2485
+ </td>
2486
+ <td>
2487
+ <a class="wppaedit" onclick="wppaEditSearch(\'' . wppa_ea_url( 'search' ) . '&amp;bulk=1' . '\', \'wppa-edit-search\' )" >
2488
+ <span style="font-weight:bold">' . __( 'Bulk', 'wp-photo-album-plus' ) . '</span>
2489
+ </a>
2490
+ </td>
2491
+ <td></td><td></td><td></td>
2492
+ <td colspan="' . strval( 1 + ( current_user_can( 'wppa_upload' ) ? 1 : 0 ) + ( current_user_can( 'wppa_import' ) ? 1 : 0 ) ) . '"></td>
2493
+ </tr>';
2494
+
2495
+ return $result;
 
 
 
 
 
2496
  }
2497
 
2498
  function wppa_trash_edit( $collapsible = false ) {
2505
 
2506
  if ( ! $trashed ) $doit = false;
2507
 
2508
+ if ( ! $doit ) return '';
2509
+
2510
+ $result = '
2511
+ <tr>' .
2512
+ ( $collapsible ? '<td></td>' : '' ) . '
2513
+ <td>' . __( 'Any', 'wp-photo-album-plus' ) . '</td>' .
2514
+ ( $collapsible ? '<td></td><td></td><td></td><td></td><td></td>' : '' ) . '
2515
+ <td colspan="4" >' .
2516
+ sprintf( __( 'There are %s trashed photos that can be rescued', 'wp-photo-album-plus' ), $trashed ) . '
2517
+ </td>
2518
+ <td>
2519
+ </td>
2520
+ <td></td>
2521
+ <td>
2522
+ <a class="wppaedit" onclick="wppaEditTrash( \'' . wppa_ea_url( 'trash' ) . '\' );">
2523
+ <span style="font-weight:bold">' . __( 'Edit', 'wp-photo-album-plus' ) . '</span>
2524
+ </a>
2525
+ </td>
2526
+ <td>
2527
+ <a class="wppaedit" onclick="wppaEditTrash( \'' . wppa_ea_url( 'trash' ) . '&amp;quick' . '\' );">
2528
+ <span style="font-weight:bold">' . __( 'Quick', 'wp-photo-album-plus' ) . '</span>
2529
+ </a>
2530
+ </td>
2531
+ <td colspan="4"></td>' .
2532
+ ( current_user_can( 'wppa_upload' ) ? '<td></td>' : '' ) .
2533
+ ( current_user_can( 'wppa_import' ) ? '<td></td>' : '' ) .
2534
+ ( wppa_can_create_album() ? '<td></td>' : '' ) . '
2535
+ </tr>';
2536
+
2537
+ return $result;
 
 
 
 
 
2538
  }
2539
 
2540
  function wppa_album_table_pagination( $page, $count ) {
2587
 
2588
  $result .= '</div>';
2589
 
2590
+ return $result;
2591
  }
2592
 
2593
  function wppa_do_albumlist( $parent, $nestinglevel, $albums, $seq ) {
2598
 
2599
  $alt = true;
2600
 
2601
+ foreach ( array_keys( $seq ) as $s ) { // Obey the global sequence
2602
+ $album = $albums[$s];
2603
+ $id = $album['id'];
2604
+ if ( $album['a_parent'] == $parent ) {
2605
+
2606
+ $counts = wppa_get_treecounts_a( $id, true );
2607
+ $pendcount = $counts['pendselfphotos'];
2608
+ $schedulecount = $counts['scheduledselfphotos'];
2609
+ $haschildren = wppa_have_accessible_children( $album );
2610
+
2611
+ $class = '';
2612
+ if ( $parent != '0' && $parent != '-1' ) {
2613
+ $class .= 'wppa-alb-onoff ';
2614
+ $class .= 'wppa-alb-on-' . $parent . ' ';
2615
+ $par = $parent;
2616
+ while ( $par != '0' && $par != '-1' ) {
2617
+ $class .= 'wppa-alb-off-' . $par . ' ';
2618
+ $par = wppa_get_parentalbumid( $par );
2619
+ }
2620
+ }
2621
+ if ( $alt ) $class .= ' alternate';
2622
+ $style = '';
2623
+ if ( $pendcount ) $style .= 'background-color:#ffdddd; ';
2624
+ if ( $parent != '0' && $parent != '-1' ) $style .= 'display:none; ';
2625
+
2626
+ $onclickon =
2627
+ 'jQuery(\'.wppa-alb-on-'.$id.'\').css(\'display\',\'\');' .
2628
+ 'jQuery(\'#alb-arrow-on-'.$id.'\').css(\'display\',\'none\');' .
2629
+ 'jQuery(\'#alb-arrow-off-'.$id.'\').css(\'display\',\'\');' .
2630
+ 'wppa_setCookie(\'alb-arrow-'.$id.'\',\'on\',365)';
2631
+ $onclickoff =
2632
+ 'jQuery(\'.wppa-alb-off-'.$id.'\').css(\'display\',\'none\');' .
2633
+ 'jQuery(\'#alb-arrow-on-'.$id.'\').css(\'display\',\'\');' .
2634
+ 'jQuery(\'#alb-arrow-off-'.$id.'\').css(\'display\',\'none\');' .
2635
+ 'checkArrows();' .
2636
+ 'wppa_setCookie(\'alb-arrow-'.$id.'\',\'off\',365)';
2637
+ $indent = $nestinglevel;
2638
+ if ( $indent > '5' ) $indent = 5;
2639
+
2640
+ // Open the album line
2641
+ $result = '
2642
+ <tr
2643
+ id="alb-' . $id . '"
2644
+ class="' . $class . '"
2645
+ style="' . $style . '"
2646
+ >';
2647
 
2648
+ // Fillers before the arrow
2649
+ $i = 0;
2650
+ while ( $i < $indent ) {
2651
+ $result .= '<td style="padding:2px;" ></td>';
2652
+ $i++;
2653
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2654
 
2655
+ // The arrow image td element
2656
+ $result .= '
2657
+ <td style="padding:2px; text-align:center;" >';
2658
+
2659
+ // Only if the album has children the arrow will show up
2660
+ if ( $haschildren ) {
2661
+ $result .= '
2662
+ <img
2663
+ id="alb-arrow-off-' . $id . '"
2664
+ class="alb-arrow-off"
2665
+ style="height:16px; display:none;"
2666
+ src="' . wppa_get_imgdir() . 'backarrow.gif' . '"
2667
+ onclick="' . $onclickoff . '"
2668
+ title="' . esc_attr( __( 'Collapse subalbums', 'wp-photo-album-plus' ) ) . '"
2669
+ />
2670
+ <img
2671
+ id="alb-arrow-on-' . $id . '"
2672
+ class="alb-arrow-on"
2673
+ style="height:16px;"
2674
+ src="' . wppa_get_imgdir() . 'arrow.gif' . '"
2675
+ onclick="' . $onclickon . '"
2676
+ title="' . esc_attr( __( 'Expand subalbums', 'wp-photo-album-plus' ) ) . '"
2677
+ />';
2678
+
2679
+ // Open subalbums by clicking the open button if it was before (cookie), and if it is visible (!)
2680
+ if ( wppa_get_cookie( 'alb-arrow-' . $id ) == 'on' ) {
2681
+ $the_js = '
2682
+ jQuery(document).ready(function(){
2683
+ if (jQuery("#alb-'.$id.'").css("display")!=="none") {
2684
+ jQuery("#alb-arrow-on-'.$id.'").trigger("click");
 
 
 
 
 
 
2685
  }
2686
+ else {
2687
+ wppa_setCookie("alb-arrow-'.$id.'","off",365);
2688
+ }
2689
+ });';
2690
+ wppa_add_inline_script( 'wppa-admin', $the_js );
2691
+ }
2692
+ }
2693
 
2694
+ // Close the arrow image td element
2695
+ $result .= '
2696
+ </td>';
2697
 
2698
+ // The album id td element
2699
+ $result .= '
2700
+ <td style="padding:2px;" >' . $id . ( $show_nl ? '(' . wppa_get_nesting_level( $album['id'] ) . ')' : '' ) . '</td>';
2701
 
2702
+ // Fillers after the arrow
2703
+ $i = $indent;
2704
+ while ( $i < 5 ) {
2705
+ $result .= '<td style="padding:2px;" ></td>';
2706
+ $i++;
2707
+ }
2708
 
2709
+ $url = get_admin_url() . 'admin.php?page=wppa_admin_menu&amp;tab=edit&amp;edit-id=' . $id;
2710
+ $na = $counts['selfalbums'];
2711
+ $np = $counts['selfphotos'];
2712
+ $nm = $counts['pendselfphotos'];
2713
+ $ns = $counts['scheduledselfphotos'];
2714
+
2715
+ // The album name
2716
+ $result .= '
2717
+ <td>' . sanitize_text_field( $album['name'] ) . '</td>
2718
+ <td><small>' . sanitize_text_field( $album['description'] ) . '</small></td>' .
2719
+ ( current_user_can( 'administrator' ) ? '<td>' . $album['owner'] . '</td>' : '' ) . '
2720
+ <td>' . $album['a_order'] . '</td>
2721
+ <td>' . sanitize_text_field( wppa_get_album_name( $album['a_parent'], array( 'extended' => true ) ) ) . '</td>
2722
+ <td>' . $na . '/' . $np . '/' . $nm . '/' . $ns . '</td>';
2723
+
2724
+ if ( wppa_have_access( $album['id'] ) ) {
2725
+ $url = wppa_ea_url($id);
2726
+
2727
+ $result .= '
2728
+ <td><a href="' . $url . '" class="wppaedit">' . __( 'Edit', 'wp-photo-album-plus' ) . '</a></td>
2729
+ <td><a href="' . $url . '&amp;quick=1" class="wppaedit">' . __( 'Quick', 'wp-photo-album-plus' ) . '</a></td>
2730
+ <td><a href="' . $url . '&amp;bulk=1#manage-photos" class="wppaedit">' . __( 'Bulk', 'wp-photo-album-plus' ) . '</a></td>';
2731
+
2732
+ if ( ! wppa_switch( 'porder_restricted' ) || wppa_user_is( 'administrator' ) ) {
2733
+ $result .= '
2734
+ <td><a href="' . $url . '&amp;seq=1" class="wppaedit">' . __( 'Seq', 'wp-photo-album-plus' ) . '</a></td>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2735
  }
2736
+ else {
2737
+ $result .= '<td></td>';
2738
+ }
2739
+
2740
+ $covid = max( $album['main_photo'], '0' );
2741
+ if ( $covid ) {
2742
+ $curl = get_admin_url() . 'admin.php?page=wppa_admin_menu&amp;tab=edit&amp;edit-id=single&amp;photo=' . $covid . '&amp;wppa-nonce=' . wp_create_nonce( 'wppa-nonce' ) . '&amp;just-edit=' . __( 'Edit cover image', 'wp-photo-album-plus' );
2743
+ $result .= '<td><a href="' . $curl . '" class="wppaedit">' . __( 'CovImg', 'wp-photo-album-plus' ) . '</a></td>';
2744
+ }
2745
+ else {
2746
+ $result .= '<td></td>';
2747
+ }
2748
+ if ( current_user_can( 'wppa_upload' ) ) {
2749
+ $result .= '<td ><a href="' . get_admin_url() . '/admin.php?page=wppa_upload_photos&wppa-set-album=' . $id . '" class="wppaedit" >' . __( 'Upload', 'wp-photo-album-plus' ) . '</a></td>';
2750
+ }
2751
+ if ( current_user_can( 'wppa_import' ) ) {
2752
+ $result .= '<td ><a href="' . get_admin_url() . '/admin.php?page=wppa_import_photos&wppa-set-album=' . $id . '" class="wppaedit" >' . __( 'Import', 'wp-photo-album-plus' ) . '</a></td>';
2753
+ }
2754
+ if ( wppa_user_is( 'administrator' ) || wppa_get_user() == $album['owner'] ) {
2755
+ $url = wppa_ea_url( $id, 'del' );
2756
+ $result .= '<td><a href="' . $url . '" class="wppadelete" >' . __( 'Delete', 'wp-photo-album-plus' ) . '</a></td>';
2757
+ }
2758
+ else {
2759
+ $result .= '<td></td>';
2760
+ }
2761
+ if ( wppa_can_create_album() ) {
2762
+ $url = get_admin_url() . 'admin.php?page=wppa_admin_menu&amp;tab=edit&amp;edit-id=new&amp;parent_id=' . $id . '&amp;wppa-nonce=' . wp_create_nonce( 'wppa-nonce' );
2763
+ $onc = 'if (confirm(\''.__( 'Are you sure you want to create a subalbum?', 'wp-photo-album-plus' ).'\')) document.location=\''.$url.'\';';
2764
+ $result .= '<td><a onclick="' . $onc . '" class="wppacreate">' . __( 'Create', 'wp-photo-album-plus' ) . '</a></td>';
2765
+ }
2766
+ }
2767
+ else {
2768
+ if ( wppa_can_create_album() ) $result .= '<td></td>';
2769
+ if ( current_user_can( 'wppa_upload' ) ) $result .= '<td></td>';
2770
+ if ( current_user_can( 'wppa_import' ) ) $result .= '<td></td>';
2771
+ $result .= '<td></td><td></td><td></td><td></td><td></td><td></td>';
2772
+ }
2773
+
2774
+ $result .= '
2775
+ </tr>';
2776
+ if ( $alt == '' ) { $alt = ' class="alternate" '; } else { $alt = '';}
2777
+
2778
+ wppa_echo( $result );
2779
 
2780
+ if ( $haschildren ) wppa_do_albumlist( $id, $nestinglevel + '1', $albums, $seq );
2781
+ }
2782
+ }
2783
  }
2784
 
2785
  function wppa_have_accessible_children( $alb ) {
2840
 
2841
  // Now delete the album
2842
  $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->wppa_albums WHERE id = %d", $id ) );
 
2843
  wppa_index_remove( 'album', $id );
2844
  wppa_clear_catlist();
2845
  wppa_clear_cache( array( 'album' => $id ) );
2847
 
2848
  $msg = __( 'Album Deleted.' , 'wp-photo-album-plus');
2849
  if ( wppa( 'ajax' ) ) {
2850
+ wppa_echo( $msg );
2851
  }
2852
  else {
2853
  wppa_update_message( $msg );
2983
  $albums = $wpdb->get_results( $wpdb->prepare( $query, $parent ), ARRAY_A );
2984
  }
2985
 
 
 
2986
  // Anything to do here ?
2987
  if ( empty ( $albums ) ) {
2988
  return;
2998
  // Check album order
2999
  if ( $albumorder_col != 'a_order' ) {
3000
  if ( $parent == '0') {
3001
+ $result = '
3002
+ <br />' .
3003
+ __( 'You can edit top-level album sequence number here when you set the album sequence to "Order #" or "Order # desc" in Basic settings -> Misc -> I -> Item 1.' );
3004
  }
3005
  else {
3006
+ $result =
3007
+ __( 'You can edit sub-album sequence number here when you set the album sequence to "Order #" or "Order # desc" in the "Sub album sort order:" selection box above.' );
3008
  }
3009
+ $result .= '<br />';
3010
+
3011
+ wppa_echo( $result );
3012
  return;
3013
  }
3014
 
3015
+ $result = '
3016
+ <h2>' .
3017
+ __( 'Manage album order', 'wp-photo-album-plus' ) . '
3018
+ -
3019
+ <small>
3020
+ <i>' .
3021
+ __( 'Change sequence order by drag and drop, or use the up/down arrows.', 'wp-photo-album-plus' ) . '
3022
+ </i>' .
3023
+ __( 'Do not leave this page unless the bar is entirely green.', 'wp-photo-album-plus' ) . '
3024
+ </small>
3025
+ </h2>
3026
+
3027
+ <table>
3028
+ <thead>
3029
+ <tr>
3030
+ <th>' .
3031
+ __( 'Color', 'wp-photo-album-plus' ) . '
3032
+ </th>
3033
+ <th>' .
3034
+ __( 'Meaning', 'wp-photo-album-plus' ) . '
3035
+ </th>
3036
+ </tr>
3037
+ </thead>
3038
+ <tbody>
3039
+ <tr>
3040
+ <td>
3041
+ <div style="background-color:green;height:12px;" ></div>
3042
+ </td>
3043
+ <td>' .
3044
+ __( 'Up to date', 'wp-photo-album-plus' ) . '
3045
+ </td>
3046
+ </tr>
3047
+ <tr>
3048
+ <td>
3049
+ <div style="background-color:yellow;height:12px;" ></div>
3050
+ </td>
3051
+ <td>' .
3052
+ __( 'Updating', 'wp-photo-album-plus' ) . '
3053
+ </td>
3054
+ </tr>
3055
+ <tr>
3056
+ <td>
3057
+ <div style="background-color:orange;height:12px;" ></div>
3058
+ </td>
3059
+ <td>' .
3060
+ __( 'Needs update', 'wp-photo-album-plus' ) . '
3061
+ </td>
3062
+ </tr>
3063
+ <tr>
3064
+ <td>
3065
+ <div style="background-color:red;height:12px;" ></div>
3066
+ </td>
3067
+ <td>' .
3068
+ __( 'Error', 'wp-photo-album-plus' ) . '
3069
+ </td>
3070
+ </tr>
3071
+ </tbody>
3072
+ </table>';
3073
+ wppa_echo( $result );
3074
+
3075
+
3076
+ $the_js = '
3077
+ jQuery( function() {
3078
+ jQuery( "#sortable-albums" ).sortable( {
3079
+ cursor: "move",
3080
+ placeholder: "sortable-placeholder-albums",
3081
+ stop: function( event, ui ) { wppaDoRenumber(); }
3082
+ } );
3083
+ } );
3084
+ var wppaRenumberPending = false;
3085
+ var wppaAjaxInProgress = 0;
3086
+
3087
+ function wppaDoRenumber() {
3088
+
3089
+ // Busy?
3090
+ if ( wppaAjaxInProgress > 0 ) {
3091
+ wppaRenumberPending = true;
3092
+ }
3093
 
3094
+ // Not busy
3095
+ else {
3096
+ _wppaDoRenumber();
3097
+ }
3098
+ }
3099
 
3100
+ function _wppaDoRenumber() {
3101
+
3102
+ // Init
3103
+ var ids = jQuery( ".wppa-sort-item-albums" );
3104
+ var seq = jQuery( ".wppa-sort-seqn-albums" );
3105
+ var descend = ' . ( $is_descending ? 'true' : 'false' ) . ';
3106
+
3107
+ // Mark needs update
3108
+ var idx = 0;
3109
+ while ( idx < ids.length ) {
3110
+ var newvalue;
3111
+ if ( descend ) newvalue = ids.length - idx;
3112
+ else newvalue = idx + 1;
3113
+ var oldvalue = seq[idx].value;
3114
+ var album = ids[idx].value;
3115
+ if ( newvalue != oldvalue ) {
3116
+ jQuery( "#wppa-pb-"+idx ).css({backgroundColor:"orange"});
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3117
  }
3118
+ idx++;
3119
+ }
3120
 
3121
+ // Process
3122
+ var idx = 0;
3123
+ while ( idx < ids.length ) {
3124
+ var newvalue;
3125
+ if ( descend ) newvalue = ids.length - idx;
3126
+ else newvalue = idx + 1;
3127
+ var oldvalue = seq[idx].value;
3128
+ var album = ids[idx].value;
3129
+ if ( newvalue != oldvalue ) {
3130
+ wppaDoSeqUpdateAlbum( album, newvalue );
3131
+ jQuery( "#wppa-pb-"+idx ).css({backgroundColor:"yellow"});
3132
+ wppaLastAlbum = album;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3133
  }
3134
+ idx++;
3135
+ }
3136
+ }
3137
 
3138
+ function wppaDoSeqUpdateAlbum( album, seqno ) {
3139
+
3140
+ var data = "action=wppa" +
3141
+ "&wppa-action=update-album" +
3142
+ "&album-id=" + album +
3143
+ "&item=a_order" +
3144
+ "&wppa-nonce=" + document.getElementById( "album-nonce-" + album ).value +
3145
+ "&value=" + seqno;
3146
+ var xmlhttp = new XMLHttpRequest();
3147
+
3148
+ xmlhttp.onreadystatechange = function() {
3149
+ if ( xmlhttp.readyState == 4 && xmlhttp.status != 404 ) {
3150
+ var ArrValues = xmlhttp.responseText.split( "||" );
3151
+ if ( ArrValues[0] != "" ) {
3152
+ alert( "The server returned unexpected output:\n" + ArrValues[0] );
3153
+ }
3154
+ switch ( ArrValues[1] ) {
3155
+ case "0": // No error
3156
+ var i = seqno - 1;
3157
+ var descend = ' . ( $is_descending ? 'true' : 'false' ) . ';
3158
+ if ( descend ) {
3159
+ i = ' . count( $albums ) . ' - seqno;
3160
  }
3161
+ jQuery( "#wppa-album-seqno-" + album ).html( seqno );
3162
+ if ( wppaRenumberPending ) {
3163
+ jQuery( "#wppa-pb-"+i ).css({backgroundColor:"orange"});
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3164
  }
3165
+ else {
3166
+ jQuery( "#wppa-pb-"+i ).css({backgroundColor:"green"});
 
 
 
 
 
 
 
 
 
3167
  }
3168
+ if ( wppaLastAlbum = album ) {
3169
+ wppaRenumberBusy = false;
3170
+ }
3171
+ break;
3172
+ default: // Any error
3173
+ jQuery( "#wppa-album-seqno-" + album ).html( "<span style=\'color:red\' >Err:" + ArrValues[1] + "</span>" );
3174
+ break;
3175
  }
3176
+ wppaAjaxInProgress--;
 
 
 
 
 
 
 
 
 
 
3177
 
3178
+ // No longer busy?
3179
+ if ( wppaAjaxInProgress == 0 ) {
3180
 
3181
+ if ( wppaRenumberPending ) {
3182
 
3183
+ // Redo
3184
+ wppaRenumberPending = false;
3185
+ wppaDoRenumber();
3186
+ }
 
 
 
 
 
 
 
 
 
3187
  }
3188
+ }
3189
+ }
3190
+ xmlhttp.open( "POST",wppaAjaxUrl,true );
3191
+ xmlhttp.setRequestHeader( "Content-type","application/x-www-form-urlencoded" );
3192
+ xmlhttp.send( data );
3193
+ wppaAjaxInProgress++;
3194
+
3195
+ jQuery( "#wppa-sort-seqn-albums-" + album ).prop( "value", seqno ); // set hidden value to new value to prevent duplicate action
3196
+ var spinnerhtml = "<img src=\'" + wppaImageDirectory + "spinner.gif\' />";
3197
+ jQuery( "#wppa-album-seqno-" + album ).html( spinnerhtml );
3198
+ }';
3199
+
3200
+ wppa_add_inline_script( 'wppa-admin', $the_js );
3201
+
3202
+ $result = '
3203
+ <br />
3204
+ <div id="wppa-progbar" style="width:100%;height:12px;" >';
3205
+
3206
+ $c = count( $albums );
3207
+ $l = 100 / $c;
3208
+ $i = 0;
3209
+ while( $i < $c ) {
3210
+ $result .= '
3211
+ <div
3212
+ id="wppa-pb-' . $i . '"
3213
+ style="display:inline;float:left;background-color:green;height:12px;width:' . $l . '%;"
3214
+ >
3215
+ </div>';
3216
+ $i++;
3217
+ }
3218
+ $result .= '
3219
+ </div>
3220
+
3221
+ <br />
3222
+
3223
+ <div class="widefat" style="max-width:600px;" >
3224
+ <div id="sortable-albums">';
3225
+
3226
+ foreach ( $albums as $album ) {
3227
+ $cover_photo_id = wppa_get_coverphoto_id( $album['id'] );
3228
+ $result .= '
3229
+ <div
3230
+ id="albumitem-' . $album['id'] . '"
3231
+ class="ui-state-default-albums"
3232
+ style="background-color:#eeeeee;cursor:move;"
3233
+ >
3234
+ <div
3235
+ style="height:100%;width:25%;float:left;text-align:center;overflow:hidden;"
3236
+ >';
3237
+ if ( wppa_is_video( $cover_photo_id ) ) {
3238
+ $result .=
3239
+ wppa_get_video_html( array( 'id' => $cover_photo_id,
3240
+ 'height' => '50',
3241
+ 'margin_top' => '5',
3242
+ 'margin_bottom' => '5',
3243
+ 'controls' => false,
3244
+ ) );
3245
+ }
3246
+ else {
3247
+ $result .= '
3248
+ <img
3249
+ class="wppa-cover-image"
3250
+ src="' . wppa_get_thumb_url( wppa_get_coverphoto_id( $album['id'] ) ) . '"
3251
+ style="max-height:50px; margin: 5px;"
3252
+ />';
3253
+ }
3254
+ $albid = strval( intval( $album['id'] ) );
3255
+ $result .= '
3256
+ </div>
3257
+ <div style="height:100%;width:40%;float:left;font-size:12px;overflow:hidden;" >
3258
+ <b>' . htmlspecialchars( wppa_get_album_name( $albid ) ) . '</b>
3259
+ <br />' .
3260
+ wppa_get_album_desc( $albid ) . '
3261
+ </div>
3262
+ <div style="float:right;width:10%;" >
3263
+ <table>
3264
+ <tr>
3265
+ <td>
3266
+ <img
3267
+ src="' . wppa_get_imgdir( 'up.png' ) . '"
3268
+ title="' . esc_attr( __( 'To top', 'wp-photo-album-plus' ) ) . '"
3269
+ style="cursor:pointer;"
3270
+ onclick="
3271
+ jQuery( \'#albumitem-' . $albid . '\' ).parent().prepend(jQuery( \'#albumitem-' . $albid . '\' ));
3272
+ wppaDoRenumber();"
3273
+ />
3274
+ </td>
3275
+ </tr>
3276
+ <tr>
3277
+ <td>
3278
+ <img
3279
+ src="' . wppa_get_imgdir( 'up.png' ) . '"
3280
+ title="' . esc_attr( __( 'One up', 'wp-photo-album-plus' ) ) . '"
3281
+ style="cursor:pointer;width:24px;"
3282
+ onclick="
3283
+ jQuery( \'#albumitem-' . $albid . '\' ).prev().before(jQuery( \'#albumitem-' . $albid . '\' ));
3284
+ wppaDoRenumber();"
3285
+ />
3286
+ </td>
3287
+ </tr>
3288
+ <tr>
3289
+ <td>
3290
+ <img
3291
+ src="' . wppa_get_imgdir( 'down.png' ) . '"
3292
+ title="' . esc_attr( __( 'One down', 'wp-photo-album-plus' ) ) . '"
3293
+ style="cursor:pointer;width:24px;"
3294
+ onclick="
3295
+ jQuery( \'#albumitem-' . $albid . '\' ).next().after(jQuery( \'#albumitem-' . $albid . '\' ));
3296
+ wppaDoRenumber();"
3297
+ />
3298
+ </td>
3299
+ </tr>
3300
+ <tr>
3301
+ <td>
3302
+ <img
3303
+ src="' . esc_url( wppa_get_imgdir( 'down.png' ) ) . '"
3304
+ title="' . esc_attr( __( 'To bottom', 'wp-photo-album-plus' ) ) . '"
3305
+ style="cursor:pointer;"
3306
+ onclick="
3307
+ jQuery( \'#albumitem-' . $albid . '\' ).parent().append(jQuery( \'#albumitem-' . $albid . '\' ));
3308
+ wppaDoRenumber();"
3309
+ />
3310
+ </td>
3311
+ </tr>
3312
+ </table>
3313
+ </div>
3314
+ <div style="float:right; width:25%;" >
3315
+ <span> ' . __( 'Id:' , 'wp-photo-album-plus' ) . ' ' . $albid . '</span>
3316
+ <span> - ' . __( 'Ord:' , 'wp-photo-album-plus' ) . '</span>
3317
+ <span id="wppa-album-seqno-' . $albid . '" > ' . $album['a_order'] . '</span>
3318
+ <br />
3319
+ <a href="' . wppa_ea_url( $albid ) . '" style="position:absolute;bottom:0;" >' . __( 'Edit', 'wp-photo-album-plus' ) . '</a>
3320
+ </div>
3321
+ <input type="hidden" id="album-nonce-' . $albid . '" value="' . wp_create_nonce( 'wppa-nonce_' . $albid ) . '" />
3322
+ <input type="hidden" class="wppa-sort-item-albums" value="' . $albid . '" />
3323
+ <input type="hidden" class="wppa-sort-seqn-albums" id="wppa-sort-seqn-albums-' . $albid . '" value="' . $album['a_order'] . '" />
3324
+ </div>';
3325
+ }
3326
+ $result .= '
3327
  </div>
3328
+ <div style="clear:both;"></div>
3329
+ </div>';
3330
 
3331
+ wppa_echo( $result );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3332
  }
3333
 
3334
  // Search admin menu item
3337
  // Rememeber where we came from
3338
  update_option( 'wppa_search_page', 'wppa_search' );
3339
 
3340
+ $result = '
3341
  <div class="wrap" >
3342
+ <img src="' . WPPA_URL . '/img/magnifier-large.png' . '" />
3343
  <h1 style="display:inline;" >' . __( 'Search photos', 'wp-photo-album-plus' ) . '</h1>
3344
  <div style="clear:both;" >&nbsp;</div>
3345
 
3365
  <col style="width:0px;" >
3366
  </colgroup>
3367
  <tbody>' .
3368
+ wppa_search_edit( false ) . '
3369
  </tbody>
3370
  </table>
3371
  </div>';
3372
+
3373
+ wppa_echo( $result );
3374
  }
3375
 
wppa-defaults.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains default settings
6
- * Version 8.1.01.002
7
  *
8
  */
9
 
@@ -1228,6 +1228,11 @@ horizrailenabled:false,";
1228
 
1229
  'wppa_use_wp_upload_dir_locations' => 'no',
1230
 
 
 
 
 
 
1231
  );
1232
 
1233
  if ( $force ) {
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains default settings
6
+ * Version 8.1.02.003
7
  *
8
  */
9
 
1228
 
1229
  'wppa_use_wp_upload_dir_locations' => 'no',
1230
 
1231
+ 'wppa_opt_menu_search' => 'yes',
1232
+ 'wppa_opt_menu_doc' => 'yes',
1233
+ 'wppa_opt_menu_edit_tags' => 'yes',
1234
+ 'wppa_opt_menu_edit_sequence' => 'yes',
1235
+
1236
  );
1237
 
1238
  if ( $force ) {
wppa-edit-sequence.php ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /* wppa-edit-sequence.php
3
+ * Package: wp-photo-album-plus
4
+ *
5
+ * Contains the admin menu and startups the admin pages
6
+ * Version 8.1.02.003
7
+ *
8
+ */
9
+
10
+ if ( ! defined( 'ABSPATH' ) ) die( "Can't load this file directly" );
11
+
12
+ function _wppa_edit_sequence() {
13
+
14
+ $album = wppa_get( 'album', '0' );
15
+ $iconurl = WPPA_URL.'/img/camera32.png';
16
+
17
+ $result = '
18
+ <div class="wrap">
19
+
20
+ <img id="icon-photos" src="' . $iconurl . '" />
21
+ <h1>' . esc_html__( 'Edit photo sequence', 'wp-photo-album-plus' ) . '
22
+ <span style="font-size:0.5em">' . esc_html( __( 'A subset of Album Admin page', 'wp-photo-album-plus' ) ) . '</span>
23
+ </h1>
24
+
25
+ <select
26
+ id="wppa-edit-sequence-album"
27
+ >' .
28
+ wppa_album_select_a( array( 'addpleaseselect' => true,
29
+ 'path' => true,
30
+ 'selected' => $album,
31
+ ) ) . '
32
+ </select>
33
+ <input
34
+ type="button"
35
+ class="button-primary"
36
+ onclick="wppaGoEditSequence()"
37
+ value="' . esc_attr( __( 'Go edit sequence', 'wp-photo-album-plus' ) ) . '"
38
+ />
39
+
40
+ </div>
41
+ ';
42
+
43
+ wppa_echo( $result );
44
+
45
+ if ( $album ) {
46
+ wppa_album_photos_sequence( $album );
47
+ }
48
+
49
+ $the_js = '
50
+ function wppaGoEditSequence() {
51
+ var album = jQuery(\'#wppa-edit-sequence-album\').val();
52
+ if (album) {
53
+ var url = document.location.href+\'&album=\'+album;
54
+ document.location.href = url;
55
+ }
56
+ else {
57
+ alert(\'Please select an album first\');
58
+ }
59
+ }';
60
+ wppa_add_inline_script( 'wppa-admin', $the_js );
61
+ }
wppa-edit-tags.php ADDED
@@ -0,0 +1,230 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /* wppa-edit-tags.php
3
+ * Package: wp-photo-album-plus
4
+ *
5
+ * Version 8.1.02.003
6
+ *
7
+ */
8
+
9
+ if ( ! defined( 'ABSPATH' ) ) die( "Can't load this file directly" );
10
+
11
+
12
+ function _wppa_edit_tags() {
13
+
14
+ // Legal here?
15
+ if ( ! current_user_can( 'wppa_edit_tags' ) ) {
16
+ wp_die( 'Insuffucient rights' );
17
+ }
18
+
19
+ // Init
20
+ $iconurl = WPPA_URL . '/img/settings32.png';
21
+ $tags = wppa_get_taglist();
22
+ $opts = array(__('-select a tag-', 'wp-photo-album-plus'));
23
+ $vals = array( '' );
24
+ if ( $tags ) foreach( array_keys( $tags ) as $tag ) {
25
+ $opts[] = $tag;
26
+ $vals[] = $tag;
27
+ }
28
+
29
+ $result = '
30
+ <div class="wrap">
31
+ <img id="icon-album" src="' . esc_url( $iconurl ) . '" />
32
+ <h1 style="display:inline" >' . __( 'Edit Photo Tag', 'wp-photo-album-plus' ) . '
33
+ <span style="font-size:0.5em;" >' . __( 'A subset of WP Photo Album Plus Settings', 'wp-photo-album-plus' ) . '</span>
34
+ </h1>';
35
+
36
+ wp_nonce_field('wppa-nonce', 'wppa-nonce');
37
+
38
+ $result .= '
39
+ <div style="display:none;" >' .
40
+ wppa_edit_doit_button( 'dummy', 'dummy' ) . '
41
+ </div>
42
+ <input type="hidden" name="wppa-key" id="wppa-key" value="" />
43
+ <input type="hidden" name="wppa-sub" id="wppa-sub" value="" />
44
+
45
+ <div id="wppa_table_8" style="" >
46
+ <table class="widefat wppa-table wppa-setting-table">
47
+ <thead style="font-weight: bold; " class="wppa_table_8">
48
+ <tr>
49
+ <td>' . __('Name', 'wp-photo-album-plus') . '</td>
50
+ <td>' . __('Description', 'wp-photo-album-plus') . '</td>
51
+ <td>' . __('Tag to change', 'wp-photo-album-plus') . '</td>
52
+ <td>' . __('Change into', 'wp-photo-album-plus') . '</td>
53
+ <td>' . __('Do it!', 'wp-photo-album-plus') . '</td>
54
+ <td>' . __('Status', 'wp-photo-album-plus') . '</td>
55
+ <td>' . __('To Go', 'wp-photo-album-plus') . '</td>
56
+ </tr>
57
+ </thead>
58
+ <tbody class="wppa_table_8">
59
+ <tr
60
+ class="wppa-setting" style="color:#333;"
61
+ >
62
+ <td>' . __( 'Edit tag', 'wp-photo-album-plus' ) . '</td>
63
+ <td>' . __( 'Globally change a tagname.', 'wp-photo-album-plus' ) . '</td>
64
+ <td>' .
65
+ wppa_tag_select( $opts, $vals, '', '', false, '', '600') . '
66
+ </td>
67
+ <td>
68
+ <input
69
+ id="new_tag_value"
70
+ type="text"
71
+ style="float:left;width:75%;height:20px;font-size:11px;margin:0;padding:0 0 0 6px;"
72
+ value="' . esc_attr( trim( wppa_get_option( 'wppa_new_tag_value' ), ',' ) ) . '"
73
+ onchange="wppaAjaxUpdateOptionValue(\'new_tag_value\',this);"
74
+ />
75
+ <img
76
+ id="' . esc_attr( 'img_' . str_replace( '#', 'H', 'new_tag_value' ) ) . '"
77
+ src="' . esc_url( wppa_get_imgdir() . 'star.ico' ) . '"
78
+ title="' . esc_attr( __( 'Setting unmodified', 'wp-photo-album-plus' ) ) . '"
79
+ style="padding:0 4px;float:left;height:16px;width:16px;"
80
+ />
81
+ </td>
82
+ <td>' .
83
+ wppa_maintenance_edit_button( 'wppa_edit_tag' ) . '
84
+ </td>
85
+ <td>' .
86
+ wppa_edit_status_field( 'wppa_edit_tag' ) . '
87
+ </td>
88
+ <td>' .
89
+ wppa_edit_togo_field( 'wppa_edit_tag' ) . '
90
+ </td>
91
+ </tr>
92
+ </tbody>
93
+ </table>
94
+ </div>
95
+ </div>';
96
+
97
+ wppa_echo( $result );
98
+
99
+ }
100
+
101
+
102
+ // The tag selection box
103
+ function wppa_tag_select( $options, $values ) {
104
+
105
+ if ( ! is_array( $options ) ) {
106
+ $result = __('There is nothing to select.', 'wp-photo-album-plus');
107
+ return $result;
108
+ }
109
+
110
+ $result = '
111
+ <select
112
+ style="float:left; font-size: 11px; height: 20px; margin: 0px; padding: 0px; max-width:600px;"
113
+ id="tag_to_edit"
114
+ onchange="wppaAjaxUpdateOptionValue(\'tag_to_edit\', this);"
115
+ >';
116
+
117
+
118
+ $val = get_option( 'wppa_tag_to_edit' );
119
+ $idx = 0;
120
+ $cnt = count( $options );
121
+
122
+ while ( $idx < $cnt ) {
123
+
124
+ $result .= '
125
+ <option
126
+ value="' . esc_attr( $values[$idx] ) . '"' .
127
+ ( $val == $values[$idx] ? ' selected="selected"' : '' ) . '
128
+ >' .
129
+ $options[$idx] . '
130
+ </option>';
131
+ $idx++;
132
+ }
133
+
134
+ $result .= '
135
+ </select>
136
+ <img
137
+ id="img_tag_to_edit"
138
+ src="' . wppa_get_imgdir() . 'star.ico"
139
+ style="padding:0 4px; float:left; height:16px; width:16px;"
140
+ />';
141
+
142
+ return $result;
143
+ }
144
+
145
+
146
+
147
+
148
+ function wppa_edit_doit_button( $label = '', $key = '', $sub = '', $height = '18', $fontsize = '11' ) {
149
+
150
+ if ( $label == '' ) $label = __('Do it!', 'wp-photo-album-plus');
151
+
152
+ $result = '
153
+ <input
154
+ type="submit"
155
+ class="button-primary"
156
+ style="float:left;font-size:' . $fontsize . 'px;height:' . $height . 'px;margin: 0 4px; padding: 0px; line-height:12px;"
157
+ name="wppa_settings_submit"
158
+ value="&nbsp;' . $label . '&nbsp;"
159
+ onclick="';
160
+ if ( $key ) $result .= 'document.getElementById(\'wppa-key\').value=\''.$key.'\';';
161
+ if ( $sub ) $result .= 'document.getElementById(\'wppa-sub\').value=\''.$sub.'\';';
162
+ $result .= 'if ( confirm(\''.__('Are you sure?', 'wp-photo-album-plus').'\')) return true; else return false;" />';
163
+
164
+ return $result;
165
+ }
166
+
167
+
168
+
169
+
170
+
171
+
172
+ function wppa_maintenance_edit_button( $slug ) {
173
+
174
+ $label = __( 'Start!', 'wp-photo-album-plus' );
175
+ $me = wppa_get_user();
176
+ $user = wppa_get_option( $slug.'_user', $me );
177
+
178
+ if ( $user && $user != $me ) {
179
+ $label = __('Locked!', 'wp-photo-album-plus');
180
+ $locked = true;
181
+ }
182
+ else {
183
+ $locked = false;
184
+ }
185
+
186
+ $result = '
187
+ <input
188
+ id="' . $slug . '_button"
189
+ type="button"
190
+ class="button-secundary"
191
+ style="float:left; border-radius:3px; font-size: 11px; height: 18px; margin: 0 4px; padding: 0 6px;"
192
+ value="' . esc_attr( $label ) . '"';
193
+ if ( ! $locked ) {
194
+ $result .= '
195
+ onclick="if ( jQuery(\'#' . $slug . '_status\').html() != \'\' || confirm(\'' . __( 'Are you sure?', 'wp-photo-album-plus' ) . '\') ) wppaMaintenanceProc(\'' . $slug . '\', false );"
196
+ />';
197
+ }
198
+ else {
199
+ $result .= '
200
+ onclick="alert(\'Is currently being executed by '.$user.'.\')" />';
201
+ }
202
+ $result .= '
203
+ <input
204
+ id="' . $slug . '_continue"
205
+ type="hidden"
206
+ value="no"
207
+ />';
208
+
209
+ return $result;
210
+ }
211
+
212
+ function wppa_edit_status_field( $slug ) {
213
+ $result = '<span id="'.$slug.'_status" >'.wppa_get_option( $slug.'_status', '' ).'</span>';
214
+ return $result;
215
+ }
216
+
217
+ function wppa_edit_togo_field( $slug ) {
218
+ $togo = wppa_get_option($slug.'_togo', '' );
219
+ $is_cron = wppa_get_option($slug.'_user', '' ) == 'cron-job';
220
+ $result = '<span id="'.$slug.'_togo" >' . $togo . '</span>';
221
+ if ( $togo || $is_cron ) {
222
+ $result .= '<script>wppaAjaxUpdateTogo(\'' . $slug . '\');</script>';
223
+ }
224
+ return $result;
225
+ }
226
+
227
+
228
+
229
+
230
+
wppa-input.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains functions for sanitizing and formatting user input
6
- * Version 8.1.01.004
7
  *
8
  */
9
 
@@ -279,7 +279,6 @@ function wppa_get_get_filter( $name ) {
279
  // Retrieve a get- or post- variable, sanitized and post-processed
280
  function wppa_get( $xname, $default = false, $filter = false ) {
281
  global $wpdb;
282
- global $wppa_kses_maxi;
283
 
284
  // Sanitize
285
  $xname = sanitize_text_field( $xname );
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains functions for sanitizing and formatting user input
6
+ * Version 8.1.02.003
7
  *
8
  */
9
 
279
  // Retrieve a get- or post- variable, sanitized and post-processed
280
  function wppa_get( $xname, $default = false, $filter = false ) {
281
  global $wpdb;
 
282
 
283
  // Sanitize
284
  $xname = sanitize_text_field( $xname );
wppa-maintenance.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains (not yet, but in the future maybe) all the maintenance routines
6
- * Version 8.1.01.002
7
  *
8
  */
9
 
@@ -1198,6 +1198,7 @@ global $wppa_endtime;
1198
  case 'wppa_covert_usertags':
1199
  case 'wppa_sanitize_tags':
1200
  case 'wppa_sanitize_cats':
 
1201
  wppa_clear_catlist();
1202
  wppa_schedule_maintenance_proc( 'wppa_remake_index_photos' );
1203
  break;
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains (not yet, but in the future maybe) all the maintenance routines
6
+ * Version 8.1.02.003
7
  *
8
  */
9
 
1198
  case 'wppa_covert_usertags':
1199
  case 'wppa_sanitize_tags':
1200
  case 'wppa_sanitize_cats':
1201
+ wppa_clear_taglist();
1202
  wppa_clear_catlist();
1203
  wppa_schedule_maintenance_proc( 'wppa_remake_index_photos' );
1204
  break;
wppa-setting-see-also.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * manage all options
6
- * Version 8.0.10.004
7
  *
8
  */
9
 
@@ -128,6 +128,7 @@ global $wppa_subtab_names;
128
  '4' => __('Admin Functionality restrictions for non administrators' , 'wp-photo-album-plus'),
129
  '5' => __('Miscellaneous limiting settings' , 'wp-photo-album-plus'),
130
  '6' => __('Miscellaneous admin related settings', 'wp-photo-album-plus' ),
 
131
  ),
132
  'maintenance' => array(
133
  '1' => __('Regular maintenance procedures', 'wp-photo-album-plus'),
3
  * Package: wp-photo-album-plus
4
  *
5
  * manage all options
6
+ * Version 8.1.02.003
7
  *
8
  */
9
 
128
  '4' => __('Admin Functionality restrictions for non administrators' , 'wp-photo-album-plus'),
129
  '5' => __('Miscellaneous limiting settings' , 'wp-photo-album-plus'),
130
  '6' => __('Miscellaneous admin related settings', 'wp-photo-album-plus' ),
131
+ '7' => __('Optional menu items', 'wp-photo-album-plus'),
132
  ),
133
  'maintenance' => array(
134
  '1' => __('Regular maintenance procedures', 'wp-photo-album-plus'),
wppa-settings-autosave.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * manage all options
6
- * Version 8.1.01.002
7
  *
8
  */
9
 
@@ -7246,6 +7246,8 @@ global $wppa_subtab_names;
7246
  __('Settings', 'wp-photo-album-plus') => 'auto;',
7247
  __('Comments', 'wp-photo-album-plus') => 'auto;',
7248
  __('Documentation', 'wp-photo-album-plus') => 'auto;',
 
 
7249
  __('Membership', 'wp-photo-album-plus') => 'auto;',
7250
  );
7251
 
@@ -7260,6 +7262,8 @@ global $wppa_subtab_names;
7260
  'wppa_settings',
7261
  'wppa_comments',
7262
  'wppa_help',
 
 
7263
  'wppa_medal',
7264
  );
7265
  $opts = array( '',
@@ -8060,6 +8064,49 @@ global $wppa_subtab_names;
8060
  $html = wppa_select($slug, $opts, $vals);
8061
  wppa_setting_new($slug, '13', $name, $desc, $html, $help);
8062
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8063
  wppa_setting_box_footer_new();
8064
  }
8065
  }
3
  * Package: wp-photo-album-plus
4
  *
5
  * manage all options
6
+ * Version 8.1.02.003
7
  *
8
  */
9
 
7246
  __('Settings', 'wp-photo-album-plus') => 'auto;',
7247
  __('Comments', 'wp-photo-album-plus') => 'auto;',
7248
  __('Documentation', 'wp-photo-album-plus') => 'auto;',
7249
+ __('Tag edit', 'wp-photo-album-plus') => 'auto;',
7250
+ __('Sequence edit', 'wp-photo-album-plus') => 'auto',
7251
  __('Membership', 'wp-photo-album-plus') => 'auto;',
7252
  );
7253
 
7262
  'wppa_settings',
7263
  'wppa_comments',
7264
  'wppa_help',
7265
+ 'wppa_edit_tags',
7266
+ 'wppa_edit_sequence',
7267
  'wppa_medal',
7268
  );
7269
  $opts = array( '',
8064
  $html = wppa_select($slug, $opts, $vals);
8065
  wppa_setting_new($slug, '13', $name, $desc, $html, $help);
8066
 
8067
+ wppa_setting_box_footer_new();
8068
+ }
8069
+ // Optional menu items
8070
+ {
8071
+ $desc = $wppa_subtab_names[$tab]['7'];
8072
+ wppa_setting_tab_description($desc);
8073
+ wppa_setting_box_header_new($tab);
8074
+
8075
+ $name = __('Search', 'wp-photo-album-plus');
8076
+ $desc = __('Search bar like on album table page', 'wp-photo-album-plus');
8077
+ $help = '';
8078
+ $slug = 'wppa_opt_menu_search';
8079
+ $html = wppa_checkbox($slug);
8080
+ wppa_setting_new($slug, '1', $name, $desc, $html, $help);
8081
+
8082
+ $name = __('Logfile', 'wp-photo-album-plus');
8083
+ $desc = __('List logfile', 'wp-photo-album-plus');
8084
+ $help = '';
8085
+ $slug = 'wppa_logfile_on_menu';
8086
+ $html = wppa_checkbox($slug);
8087
+ wppa_setting_new($slug, '2', $name, $desc, $html, $help);
8088
+
8089
+ $name = __('Documentation', 'wp-photo-album-plus');
8090
+ $desc = __('Link to documentation site', 'wp-photo-album-plus');
8091
+ $help = '';
8092
+ $slug = 'wppa_opt_menu_doc';
8093
+ $html = wppa_checkbox($slug);
8094
+ wppa_setting_new($slug, '3', $name, $desc, $html, $help);
8095
+
8096
+ $name = __('Edit tags', 'wp-photo-album-plus');
8097
+ $desc = __('Easy way to global edit tags. Requires capability "wppa_edit_tags"', 'wp-photo-album-plus');
8098
+ $help = '';
8099
+ $slug = 'wppa_opt_menu_edit_tags';
8100
+ $html = wppa_checkbox($slug);
8101
+ wppa_setting_new($slug, '4', $name, $desc, $html, $help);
8102
+
8103
+ $name = __('Photo sequence', 'wp-photo-album-plus');
8104
+ $desc = __('Rearrange photos of an album. Requires capability "wppa_edit_sequence"', 'wp-photo-album-plus');
8105
+ $help = '';
8106
+ $slug = 'wppa_opt_menu_edit_sequence';
8107
+ $html = wppa_checkbox($slug);
8108
+ wppa_setting_new($slug, '5', $name, $desc, $html, $help);
8109
+
8110
  wppa_setting_box_footer_new();
8111
  }
8112
  }
wppa-utils.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains low-level utility routines
6
- * Version 8.1.02.001
7
  *
8
  */
9
 
@@ -1203,7 +1203,7 @@ global $wpdb;
1203
  }
1204
  }
1205
  }
1206
- echo esc_html__( sprintf( '%d source file extensions repaired', 'wp-photo-album-plus' ), $count );
1207
  update_option('wppa_sourcefile_fix_start', '-1');
1208
  }
1209
 
@@ -1527,8 +1527,8 @@ function wppa_series_to_array($xtxt) {
1527
  }
1528
  return $result;
1529
  }
1530
- function wppa_stx_err($msg) {
1531
- echo esc_html( 'Syntax error in album specification. ' . $msg );
1532
  wppa_log( 'err', $msg, true );
1533
  }
1534
 
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains low-level utility routines
6
+ * Version 8.1.02.003
7
  *
8
  */
9
 
1203
  }
1204
  }
1205
  }
1206
+ wppa_echo( __( sprintf( '%d source file extensions repaired', 'wp-photo-album-plus' ), $count ) );
1207
  update_option('wppa_sourcefile_fix_start', '-1');
1208
  }
1209
 
1527
  }
1528
  return $result;
1529
  }
1530
+ function wppa_stx_err( $msg ) {
1531
+ wppa_echo( __( 'Syntax error in album specification.', 'wp-photo-album-plus' ) . ' ' . $msg );
1532
  wppa_log( 'err', $msg, true );
1533
  }
1534
 
wppa-wrappers.php CHANGED
@@ -5,7 +5,7 @@
5
  * Contains wrappers for standard php functions
6
  * For security and bug reasons
7
  *
8
- * Version 8.1.02.002
9
  *
10
  */
11
 
@@ -734,6 +734,8 @@ static $allowed_tags;
734
  'onclick' => true,
735
  'style' => true,
736
  'data-rel' => true,
 
 
737
  ),
738
  'audio' => array(
739
  'id' => true,
@@ -776,6 +778,9 @@ static $allowed_tags;
776
  'placeholder' => true,
777
  'srcset' => true,
778
  'onload' => true,
 
 
 
779
  ),
780
  'input' => array(
781
  'id' => true,
@@ -789,6 +794,7 @@ static $allowed_tags;
789
  'onchange' => true,
790
  'name' => true,
791
  'checked' => true,
 
792
  ),
793
  'option' => array(
794
  'class' => true,
@@ -827,7 +833,12 @@ static $allowed_tags;
827
  'onchange' => true,
828
  'name' => true,
829
  ),
830
- 'thead' => array(),
 
 
 
 
 
831
  'tr' => array(
832
  'id' => true,
833
  'style' => true,
5
  * Contains wrappers for standard php functions
6
  * For security and bug reasons
7
  *
8
+ * Version 8.1.02.003
9
  *
10
  */
11
 
734
  'onclick' => true,
735
  'style' => true,
736
  'data-rel' => true,
737
+ 'class' => true,
738
+ 'name' => true,
739
  ),
740
  'audio' => array(
741
  'id' => true,
778
  'placeholder' => true,
779
  'srcset' => true,
780
  'onload' => true,
781
+ 'class' => true,
782
+ 'title' => true,
783
+ 'onclick' => true,
784
  ),
785
  'input' => array(
786
  'id' => true,
794
  'onchange' => true,
795
  'name' => true,
796
  'checked' => true,
797
+ 'min' => true,
798
  ),
799
  'option' => array(
800
  'class' => true,
833
  'onchange' => true,
834
  'name' => true,
835
  ),
836
+ 'thead' => array(
837
+ 'style' => true,
838
+ ),
839
+ 'tfoot' => array(
840
+ 'style' => true,
841
+ ),
842
  'tr' => array(
843
  'id' => true,
844
  'style' => true,
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.1.02.002
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.1.02.002'; // 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.1.02.003
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.1.02.003'; // WPPA software version
28
  global $wppa_revno;
29
  $wppa_revno = str_replace( '.', '', $wppa_api_version ); // WPPA db version
30