WP Photo Album Plus - Version 8.2.02.009

Version Description

= 8.1.08 =

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

Release Info

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

Code changes from version 8.2.02.007 to 8.2.02.009

blocks/upload/editor.css CHANGED
@@ -11,4 +11,7 @@
11
  background: #fff;
12
  border: 1px solid #000;
13
  padding: 0 4px;
 
 
 
14
  }
11
  background: #fff;
12
  border: 1px solid #000;
13
  padding: 0 4px;
14
+ }
15
+ .wp-block-wp-photo-album-plus-upload select {
16
+ /* max-width: fit-content; */
17
  }
js/wppa-admin-scripts.js CHANGED
@@ -1,7 +1,7 @@
1
  /* admin-scripts.js */
2
  /* Package: wp-photo-album-plus
3
  /*
4
- /* Version 8.2.01.003
5
  /* Various js routines used in admin pages
6
  */
7
 
@@ -2086,4 +2086,41 @@ function wppaGetTinyMceContent( longId ) {
2086
  }
2087
 
2088
  return result;
2089
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  /* admin-scripts.js */
2
  /* Package: wp-photo-album-plus
3
  /*
4
+ /* Version 8.2.02.008
5
  /* Various js routines used in admin pages
6
  */
7
 
2086
  }
2087
 
2088
  return result;
2089
+ }
2090
+
2091
+ // Init Imagick on photo admin page
2092
+ function wppaInitMagick(id) {
2093
+
2094
+ // Been here before for this id?
2095
+ if ( wppaCropper[id] ) return;
2096
+
2097
+ var image = document.querySelector("#fs-img-"+id);
2098
+ var button = document.getElementById("button-"+id);
2099
+ var ratio;
2100
+
2101
+ if ( wppaImageMagickDefaultAspect == 'ratio' ) {
2102
+ ratio = image.naturalWidth / image.naturalHeight;
2103
+ }
2104
+ else if ( wppaImageMagickDefaultAspect == 'NaN' ) {
2105
+ ratio = '';
2106
+ }
2107
+ else {
2108
+ ratio = wppaImageMagickDefaultAspect;
2109
+ }
2110
+
2111
+ wppaCropper[id] = new Cropper(image, {
2112
+ zoomable: false,
2113
+ viewMode: 2,
2114
+ background: false,
2115
+ dragMode: "move",
2116
+ responsive: true,
2117
+ movable: false,
2118
+ aspectRatio: ratio,
2119
+ });
2120
+
2121
+ button.onclick = function () {
2122
+ var data = wppaCropper[id].getData(true);
2123
+ var value=data.width+"x"+data.height+(data.x<0?"-":"+")+data.x+(data.y<0?"-":"+")+data.y;
2124
+ wppaTryMagick( id, "crop", value );
2125
+ };
2126
+ };
js/wppa-admin-scripts.min.js CHANGED
@@ -1 +1 @@
1
- function checkjQueryRev(e,t,a){var p=parseFloat(jQuery.fn.jquery);t.checked&&p<a&&(alert(e+"\nThe version of your jQuery library: "+p+" is too low for this feature. It requires version "+a),t.checked="")}function wppaReUpload(e,o,t,r){document.getElementById("wppa-re-up-form-"+o);var a=document.getElementById("wppa-re-up-file-"+o),u=document.getElementById("wppa-re-up-butn-"+o);e.preventDefault();a=a.files[0];if(a.type.match("image.*")){if(0==t.length)alert("Filename will be set to "+a.name);else if(a.name!=t&&!confirm("Filename is different.\nIf you continue, the filename will not be updated!.\n\nContinue?"))return void jQuery("#re-up-"+o).css("display","none");u.value="Uploading...",u.style.color="black";t=new FormData;t.append("photo",a,a.name);var l=new XMLHttpRequest,a="?action=wppa&wppa-action=update-photo&photo-id="+o+"&item=file&wppa-nonce="+document.getElementById("photo-nonce-"+o).value;l.open("POST",wppaAjaxUrl+a,!0),l.onload=function(){if(200===l.status){var e=wppaTrim(l.responseText).split("||");switch(""!=e[0]&&alert("The server returned unexpected output:\n"+e[0]),e[1]){case"0":var t,a,p,n=JSON.parse(e[2]);for(t in n)switch(p=n[t],t){case"remark":p=(p=(p=p.replace(/&lt;/g,"<")).replace(/&gt;/g,">")).replace(/\\/g,""),a="0"!=e[1]?'<span style="color:red;" >'+p+"</span>":'<span style="color:green;" >'+p+"</span>",r&&(a+=' <span style="color:blue;" >Reloading...</span>'),jQuery("#remark-"+o).html(a);break;case"photourl":wppaCropper[o]?wppaCropper[o].replace(p):jQuery("#photourl-"+o).attr("src",p),jQuery("#thumba-"+o).attr("href",p);break;case"thumburl":jQuery("#thumburl-"+o).attr("src",p);break;case"magickstack":jQuery("#magickstack-"+o).html(p),0<p.length?jQuery("#imstackbutton-"+o).css("display","inline"):jQuery("#imstackbutton-"+o).css("display","none");break;default:jQuery("#"+t+"-"+o).html(p)}u.value="Upload",jQuery("#re-up-"+o).css("display","none");break;case"99":document.getElementById("photoitem-"+o).innerHTML='<span style="color:red">'+e[2]+"</span>";break;default:document.getElementById("remark-"+o).innerHTML='<span style="color:red">'+e[2]+" ("+e[1]+")</span>",u.value="Error occured",u.style.color="red"}}else alert("An error occurred!")},l.send(t)}else alert("File is not an image file!")}jQuery(document).ready(function(){jQuery(window).on("DOMContentLoaded load resize scroll",function(){wppaMakeLazyVisible("windowon")}),wppaMakeLazyVisible("docready")});var _wppaRefreshAfter=!1;function wppaRefreshAfter(){_wppaRefreshAfter=!0}function wppaCheckWidgetMethod(){var e,t,a;if("4"==document.getElementById("wppa-wm").value?(document.getElementById("wppa-wp").style.visibility="visible","day-of-week"==(a=jQuery("#wppa-wp").val())||"day-of-month"==a||"day-of-year"==a?jQuery(".wppa-order").css("visibility",""):jQuery(".wppa-order").css("visibility","hidden")):(document.getElementById("wppa-wp").style.visibility="hidden",jQuery(".wppa-order").css("visibility","hidden")),"1"==document.getElementById("wppa-wm").value)for(e=document.getElementsByName("wppa-widget-photo"),t=0;t<e.length;)e[t].style.visibility="visible",t++;else for(e=document.getElementsByName("wppa-widget-photo"),t=0;t<e.length;)e[t].style.visibility="hidden",t++}function wppa_tablecookieon(e){wppa_setCookie("table_"+e,"on","365")}function wppa_tablecookieoff(e){wppa_setCookie("table_"+e,"off","365")}function wppaCookieCheckbox(e,t){e.checked?wppa_setCookie(t,"on","365"):wppa_setCookie(t,"off","365")}function wppa_move_up(e){document.location=wppa_moveup_url+e+"&wppa-nonce="+document.getElementById("wppa-nonce").value}function checkColor(e){var t=e.substr(5),e=jQuery("#"+t).val();jQuery("#colorbox-"+t).css("background-color",e)}function checkAll(e,t){e=document.getElementById(e);e&&(e.checked?jQuery(t).prop("checked",!0):jQuery(t).prop("checked",!1))}function impUpd(e,t){e.checked?(jQuery(t).val(wppa_update),jQuery(".hideifupdate").css("display","none")):(jQuery(t).val(wppa_import),jQuery(".hideifupdate").css("display",""))}function wppaAjaxDeletePhoto(t,e,a,p){wppaConsoleLog("imm="+p,"force");var n="",o="",n=e||'<div style="padding-left:5px;" >';a?o=a:aftrer="</div>",wppaFeAjaxLog("in");var r=wppaGetXmlHttp(),a=wppaAjaxUrl+"?action=wppa&wppa-action=delete-photo&photo-id="+t;a+="&wppa-nonce="+document.getElementById("photo-nonce-"+t).value,p&&(a+="&wppa-immediate=1"),r.open("GET",a,!0),r.send(),r.onreadystatechange=function(){switch(r.readyState){case 1:document.getElementById("remark-"+t).innerHTML="server connection established";break;case 2:document.getElementById("remark-"+t).innerHTML="request received";break;case 3:document.getElementById("remark-"+t).innerHTML="processing request";break;case 4:var e;200==r.status?("ER"==(e=wppaTrim(r.responseText).split("||"))[0]?(e[3]&&alert(e[3]),jQuery("#wppa-delete-"+t).css("text-decoration","line-through")):""!=e[0]&&alert("The server returned unexpected output:\n"+e[0]),0==e[1]?document.getElementById("remark-"+t).innerHTML=e[2]:(document.getElementById("photoitem-"+t).innerHTML=n+e[2]+o,wppaProcessFull(e[3],e[4])),jQuery(window).trigger("scroll"),wppaFeAjaxLog("out")):document.getElementById("photoitem-"+t).innerHTML=n+'<span style="color:red;" >Comm error '+r.status+": "+r.statusText+"</span>"+o}}}function wppaAjaxUndeletePhoto(t){wppaFeAjaxLog("in");var a=wppaGetXmlHttp(),e=wppaAjaxUrl+"?action=wppa&wppa-action=undelete-photo&photo-id="+t;e+="&wppa-nonce="+document.getElementById("photo-nonce-"+t).value,a.open("GET",e,!0),a.send(),a.onreadystatechange=function(){switch(a.readyState){case 1:document.getElementById("remark-"+t).innerHTML="server connection established";break;case 2:document.getElementById("remark-"+t).innerHTML="request received";break;case 3:document.getElementById("remark-"+t).innerHTML="processing request";break;case 4:var e;200==a.status?("ER"==(e=wppaTrim(a.responseText).split("||"))[0]?(e[3]&&alert(e[3]),jQuery("#wppa-delete-"+t).css("text-decoration","line-through")):""!=e[0]&&alert("The server returned unexpected output:\n"+e[0]),0==e[1]?document.getElementById("remark-"+t).innerHTML=e[2]:document.getElementById("photoitem-"+t).innerHTML='<div style="padding-left:5px;" >'+e[2]+"</div>",wppaFeAjaxLog("out")):document.getElementById("photoitem-"+t).innerHTML=before+'<span style="color:red;" >Comm error '+a.status+": "+a.statusText+"</span>"+after}}}function wppaAjaxApplyWatermark(t,e,a){wppaFeAjaxLog("in");var p=wppaGetXmlHttp();jQuery("#wppa-water-spin-"+t).css({visibility:"visible"});var n="action=wppa&wppa-action=watermark-photo&photo-id="+t;n+="&wppa-nonce="+document.getElementById("photo-nonce-"+t).value,e&&(n+="&wppa-watermark-file="+e),a&&(n+="&wppa-watermark-pos="+a),p.open("POST",wppaAjaxUrl,!0),p.setRequestHeader("Content-type","application/x-www-form-urlencoded"),p.send(n),p.onreadystatechange=function(){var e;4==p.readyState&&(200==p.status?(""!=(e=wppaTrim(p.responseText).split("||"))[0]&&alert("The server returned unexpected output:\n"+e[0]),"0"===e[1]?(document.getElementById("remark-"+t).innerHTML=e[2],setTimeout(function(){document.location.reload(!0)},500)):document.getElementById("remark-"+t).innerHTML='<span style="color:red">'+e[2]+"</span>",jQuery("#wppa-water-spin-"+t).css({visibility:"hidden"}),wppaFeAjaxLog("out")):document.getElementById("remark-"+t).innerHTML='<span style="color:red;" >Comm error '+p.status+": "+p.statusText+"</span>")}}function wppaAjaxUpdateIptc(l,e,t,a){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=update-iptc&photo-id="+l+"&item="+e+"&wppa-nonce="+document.getElementById("photo-nonce-"+l).value+"&value="+wppaEncode(t)+"&tagname="+a,async:!0,type:"POST",timeout:6e4,beforeSend:function(e){jQuery("#remark-"+l).html("Working, please wait...")},success:function(e,t,a){var p=wppaTrim(e).split("||");if(""!=p[0]&&alert("The server returned unexpected output:\n"+p[0]),"99"===p[1])jQuery("#photoitem-"+l).html(bef+'<span style="color:red">'+p[2]+"</span>"+aft);else{var n,o,r,u=JSON.parse(p[2]);for(n in u)switch(r=u[n],n){case"remark":r=(r=(r=r.replace(/&lt;/g,"<")).replace(/&gt;/g,">")).replace(/\\/g,""),o="0"!=p[1]?'<span style="color:red;" >'+r+"</span>":'<span style="color:green;" >'+r+"</span>",jQuery("#remark-"+l).html(o);break;case"photourl":wppaCropper[l]?wppaCropper[l].replace(r):jQuery("#photourl-"+l).attr("src",r),jQuery("#thumba-"+l).attr("href",r);break;case"thumburl":jQuery("#thumburl-"+l).attr("src",r);break;case"magickstack":jQuery("#magickstack-"+l).html(r),0<r.length?jQuery("#imstackbutton-"+l).css("display","inline"):jQuery("#imstackbutton-"+l).css("display","none")}}wppaFeAjaxLog("out")},error:function(e,t,a){jQuery("#remark-"+l).html('<span style="color:red;" >Comm error '+t+"</span>"),wppaConsoleLog("wppaAjaxUpdatePhoto failed. Error = "+a+", status = "+t,"force")},complete:function(e,t,a){jQuery("#wppa-admin-spinner").css("display","none"),jQuery(window).trigger("scroll")}})}function wppaAjaxUpdatePhoto(l,i,e,s,c,d){c=c||"",d=d||"",wppaFeAjaxLog("in"),jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=update-photo&photo-id="+l+"&item="+i+"&wppa-nonce="+document.getElementById("photo-nonce-"+l).value+"&value="+wppaEncode(e),async:!0,type:"POST",timeout:6e4,beforeSend:function(e){"description"==i&&jQuery("#wppa-photo-spin-"+l).css({visibility:"visible"}),jQuery("#remark-"+l).html("Working, please wait...")},success:function(e,t,a){var p=wppaTrim(e).split("||");if(""!=p[0]&&alert("The server returned unexpected output:\n"+p[0]),"99"===p[1])jQuery("#photoitem-"+l).html(c+'<span style="color:red">'+p[2]+"</span>"+d);else{var n,o,r,u=JSON.parse(p[2]);for(n in u)switch(r=u[n],n){case"remark":r=(r=(r=r.replace(/&lt;/g,"<")).replace(/&gt;/g,">")).replace(/\\/g,""),o="0"!=p[1]?'<span style="color:red;" >'+r+"</span>":'<span style="color:green;" >'+r+"</span>",s&&(o+=' <span style="color:blue;" >Reloading...</span>'),jQuery("#remark-"+l).html(o);break;case"photourl":wppaCropper[l]?wppaCropper[l].replace(r):jQuery("#photourl-"+l).attr("src",r),jQuery("#thumba-"+l).attr("href",r);break;case"thumburl":jQuery("#thumburl-"+l).attr("src",r);break;case"magickstack":jQuery("#magickstack-"+l).html(r),0<r.length?jQuery("#imstackbutton-"+l).css("display","inline"):jQuery("#imstackbutton-"+l).css("display","none");break;default:jQuery("#"+n+"-"+l).html(r)}}"description"==i&&jQuery("#wppa-photo-spin-"+l).css({visibility:"hidden"}),wppaFeAjaxLog("out")},error:function(e,t,a){jQuery("#remark-"+l).html('<span style="color:red;" >Comm error '+t+"</span>"),wppaConsoleLog("wppaAjaxUpdatePhoto failed. Error = "+a+", status = "+t,"force")},complete:function(e,t,a){var p=(p=document.location.href).replace(/&pano-val=./,"");s?setTimeout(function(){document.location.href=p},300):(jQuery("#wppa-admin-spinner").css("display","none"),jQuery(window).trigger("scroll"))}})}function wppaChangeScheduleAlbum(e,t){jQuery(t).prop("checked")?jQuery(".wppa-datetime-"+e).css("display","inline"):(jQuery(".wppa-datetime-"+e).css("display","none"),wppaAjaxUpdateAlbum(e,"scheduledtm",Math.rand()))}function wppaChangeScheduleDelAlbum(e,t){jQuery(t).prop("checked")?jQuery(".wppa-datetimedel-"+e).css("display","inline"):(jQuery(".wppa-datetimedel-"+e).css("display","none"),wppaAjaxUpdateAlbum(e,"scheduledel",Math.rand()))}var _wppaRefreshAfter=!1,wppaAjaxAlbumCount=0,wppaAlbumUpdateMatrix=new Array;function wppaAjaxUpdateAlbum(e,t,a,p){var n=0==jQuery("#wppaalbumdesc:visible").length;jQuery("#wppaalbumdesc-html").click();for(var o=wppaAlbumUpdateMatrix.length,r=0,u=!1,l=-1;r<o;)wppaAlbumUpdateMatrix[r][0]==e&&wppaAlbumUpdateMatrix[r][1]==t&&(u=!0,l=r),r++;u||(wppaAlbumUpdateMatrix[o]=[e,t,"undefined",!1,!1,p],l=o),a=a.value||a,wppaAlbumUpdateMatrix[l][3]=a,wppaAlbumUpdateMatrix[l][5]=p,wppaAjaxUpdateAlbumMonitor(n)}function wppaAjaxUpdateAlbumMonitor(e){for(var t=wppaAlbumUpdateMatrix.length,a=0;a<t;)wppaAlbumUpdateMatrix[a][2]==wppaAlbumUpdateMatrix[a][3]||wppaAlbumUpdateMatrix[a][4]||(wppaAlbumUpdateMatrix[a][4]=!0,_wppaAjaxUpdateAlbum(wppaAlbumUpdateMatrix[a][0],wppaAlbumUpdateMatrix[a][1],wppaAlbumUpdateMatrix[a][3],e,wppaAlbumUpdateMatrix[a][5])),a++;e&&jQuery("#wppaalbumdesc-tmce").click()}function _wppaAjaxUpdateAlbum(r,u,l,i,s){wppaAjaxAlbumCount++;jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=update-album&album-id="+r+"&item="+u+"&wppa-nonce="+document.getElementById("album-nonce-"+r).value+"&value="+wppaEncode(l),async:!0,type:"POST",timeout:6e4,beforeSend:function(e){"description"==u&&jQuery("#wppa-album-spin").css({visibility:"visible"}),jQuery("#albumstatus-"+r).html("Working, please wait... ("+wppaAjaxAlbumCount+")")},success:function(e,t,a){e=wppaTrim(e).split("||");if(wppaAjaxAlbumCount--,""!=e[0]&&alert("The server returned unexpected output:\n"+e[0]),"0"===e[1]?0==wppaAjaxAlbumCount?jQuery("#albumstatus-"+r).html(e[2]):jQuery("#albumstatus-"+r).html("Working, please wait... ("+wppaAjaxAlbumCount+")"):jQuery("#albumstatus-"+r).html='<span style="color:red">'+e[2]+" ("+e[1]+")</span>",void 0!==e[3]&&wppaProcessFull(e[3],e[4]),s&&"0"==e[1])return jQuery("#albumstatus-"+r).after('<span style="color:blue;font-weight:bold;"> Reloading...</span>'),jQuery("#wppa-admin-spinner").fadeIn(),void setTimeout(function(){wppaReload()},100);"cover_linktype"==u&&("manual"==l?jQuery("#link-url-tr").show():jQuery("#link-url-tr").hide()),"description"==u&&jQuery("#wppa-album-spin").css({visibility:"hidden"});for(var p=0,n=-1,o=wppaAlbumUpdateMatrix.length;p<o;)wppaAlbumUpdateMatrix[p][0]==r&&wppaAlbumUpdateMatrix[p][1]==u&&(n=p),p++;wppaAlbumUpdateMatrix[n][2]=l||0,wppaAlbumUpdateMatrix[n][4]=!1,wppaAlbumUpdateMatrix[n][5]=!1,wppaAjaxUpdateAlbumMonitor(i)},error:function(e,t,a){wppaAjaxAlbumCount--,jQuery("#albumstatus-"+r).html('<span style="color:red;" >Comm error '+t+"</span>"),wppaConsoleLog("_wppaAjaxUpdateAlbum failed. Error = "+a+", status = "+t,"force")},complete:function(e,t,a){}})}function wppaProcessFull(e,t){"full"==e&&(jQuery("#full").css("display",""),jQuery("#notfull").css("display","none")),"notfull"==e&&(jQuery("#full").css("display","none"),0<t?jQuery("#notfull").attr("value",wppaUploadToThisAlbum+" (max "+t+")"):jQuery("#notfull").attr("value",wppaUploadToThisAlbum),jQuery("#notfull").css("display",""))}function wppaAjaxUpdateCommentStatus(t,a,e){var p=wppaGetXmlHttp(),e=wppaAjaxUrl+"?action=wppa&wppa-action=update-comment-status&wppa-photo-id="+t+"&wppa-comment-id="+a+"&wppa-comment-status="+e+"&wppa-nonce="+document.getElementById("photo-nonce-"+t).value;p.onreadystatechange=function(){var e;4==p.readyState&&(200==p.status?(""!=(e=wppaTrim(p.responseText).split("||"))[0]&&alert("The server returned unexpected output:\n"+e[0]),"0"===e[1]?jQuery("#remark-"+t).html(e[2]):jQuery("#remark-"+t).html('<span style="color:red">'+e[2]+"</span>"),jQuery("#wppa-comment-spin-"+a).css("visibility","hidden")):jQuery("#remark-"+t).html('<span style="color:red;" >Comm error '+p.status+": "+p.statusText+"</span>"))},p.open("GET",e,!0),p.send()}function wppaAjaxUpdateOptionCheckBox(t,e){var a=wppaGetXmlHttp(),p=wppaAjaxUrl+"?action=wppa&wppa-action=update-option&wppa-option="+t;p+="&wppa-nonce="+document.getElementById("wppa-nonce").value,e.checked?p+="&value=yes":p+="&value=no",a.onreadystatechange=function(){switch(a.readyState){case 1:case 2:case 3:jQuery("#img_"+t).attr("src",wppaImageDirectory+"spinner.gif");break;case 4:var e=wppaTrim(a.responseText).split("||");""!=e[0]&&alert("The server returned unexpected output:\n"+e[0]),404!=a.status?("0"===e[1]?(jQuery("#img_"+t).attr("src",wppaImageDirectory+"tick.png"),jQuery("#img_"+t).attr("title",e[2])):(jQuery("#img_"+t).attr("src",wppaImageDirectory+"cross.png"),jQuery("#img_"+t).attr("title","Error #"+e[1]+", message: "+e[2]+", status: "+a.status)),e[3]&&alert(e[3]),_wppaRefreshAfter&&(_wppaRefreshAfter=!1,document.location.reload(!0))):(jQuery("#img_"+t).attr("src",wppaImageDirectory+"cross.png"),jQuery("#img_"+t).attr("title","Communication error, status = "+a.status)),wppaCheckInconsistencies()}},a.open("GET",p,!0),a.send()}var wppaAlwaysContinue=100;function wppaMaintenanceProc(p,e,r){if(!r&&!e&&"yes"==document.getElementById(p+"_continue").value)return document.getElementById(p+"_continue").value="no",document.getElementById(p+"_button").value="Start!",void(0<jQuery("#"+p+"_togo").html()&&(jQuery("#"+p+"_status").html("Pausing..."),jQuery("#"+p+"_button").css("display","none")));r||(document.getElementById(p+"_continue").value="yes",document.getElementById(p+"_button").value="Stop!",""==jQuery("#"+p+"_status").html()&&jQuery("#"+p+"_status").html("Wait...")),jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=maintenance&slug="+p+"&wppa-nonce="+jQuery("#wppa-nonce").val()+(r?"&wppa-cron=1":""),async:!0,type:"POST",timeout:3e5,beforeSend:function(e){},success:function(e,t,a){var p=e.split("||"),n=p[1],o=!1;return n?(10<p[0].length&&(alert("An error occurred:\n"+p[0]),o=!0),jQuery("#"+n+"_status").html(p[2]),jQuery("#"+n+"_togo").html(p[3]),jQuery("#"+n+"_button").css("display",""),o||"0"==p[3]?"reload"==p[4]?(alert("This page will now be reloaded to finish the operation. Please stay tuned..."),void wppaReload()):void setTimeout("wppaMaintenanceProc('"+n+"', false)",20):void(document.getElementById(n+"_continue")&&"yes"==document.getElementById(n+"_continue").value?setTimeout("wppaMaintenanceProc('"+n+"', true)",20):(r||jQuery("#"+n+"_status").html("Pending"),setTimeout(function(){wppaAjaxUpdateTogo(n)},1e3)))):(alert("The server returned unexpected output:\n"+e+"\nIf the current procedure has a Skip One button, press it before retrying. Reloading page..."),void wppaReload())},error:function(e,t,a){wppaConsoleLog("wppaMaintenanceProc failed. Slug = "+p+", Error = "+a+", status = "+t,"force"),jQuery("#"+p+"_status").html("Server error #"+(11-wppaAlwaysContinue));t=!1;--wppaAlwaysContinue<1&&(t=confirm("10 Server errors happened.\nDo you want to continue?"))&&(wppaAlwaysContinue=100),(t||0<wppaAlwaysContinue)&&("wppa_remake"==p&&wppaAjaxUpdateOptionValue("wppa_remake_skip_one",0),"wppa_regen_thumbs"==p&&wppaAjaxUpdateOptionValue("wppa_regen_thumbs_skip_one",0),"wppa_create_o1_files"==p&&wppaAjaxUpdateOptionValue("wppa_create_o1_files_skip_one",0),setTimeout("wppaMaintenanceProc('"+p+"', true)",2e3))},complete:function(e,t,a){}})}function wppaAjaxPopupWindow(e){switch(e){case"wppa_list_index":0;break;case"wppa_list_errorlog":0;break;case"wppa_list_rating":0;break;case"wppa_list_session":0;break;case"wppa_list_comments":0}var t=.9*wppaWindowWidth(),a=wppaGetXmlHttp(),p=wppaAjaxUrl,e="action=wppa&wppa-action=maintenancepopup&slug="+e;e+="&wppa-nonce="+document.getElementById("wppa-nonce").value,a.open("POST",p,!1),a.setRequestHeader("Content-type","application/x-www-form-urlencoded"),a.send(e),4==a.readyState&&200==a.status&&(a=(e=wppaEntityDecode(a.responseText).split("|"))[0],e[0]="",e=e.join("|").substring(1),t={modal:!0,resizable:!0,width:t,show:{effect:"fadeIn",duration:800},closeText:wppaCloseText},jQuery("#wppa-modal-container").html(e).dialog(t).dialog("open"),jQuery("#wppa-modal-container").css({width:"100%"}),jQuery(".ui-dialog").css({boxShadow:"0px 0px 5px 5px #aaaaaa",padding:"8px",backgroundColor:"#cccccc",boxSizing:"content-box",zIndex:"200200"}),jQuery(".ui-dialog-titlebar").css({lineHeight:"0px",height:"50px"}),jQuery(".ui-dialog-title").html("<h2>"+a+"</h2>"),jQuery(".ui-button").css({position:"absolute",top:"12px",right:"12px"}),jQuery(".ui-button").attr("title",wppaCloseText),jQuery(".ui-widget-overlay").css({backgroundColor:"transparent"}),setTimeout(function(){jQuery("#wppa-maintenance-list").niceScroll&&jQuery("#wppa-maintenance-list").niceScroll(".wppa-nicewrap",{})},1e3))}function wppaAjaxUpdateOptionValue(l,e,t){var a="action=wppa&wppa-action=update-option&wppa-option="+wppaEncode(l)+"&wppa-nonce="+document.getElementById("wppa-nonce").value;0!=e&&(a+="number"==typeof e?"&value="+e:t?"&value="+wppaGetSelectionEnumByClass("."+l,","):"&value="+wppaEncode(e.value)),jQuery.ajax({url:wppaAjaxUrl,data:a,async:!0,type:"POST",timeout:1e5,beforeSend:function(e){jQuery("#img_"+l.replace("#","H")).attr("src",wppaImageDirectory+"spinner.gif")},success:function(e,t,a){e=wppaTrim(e).split("||");if(""!=e[0])alert("The server returned unexpected output:\n"+e[0]);else if("0"===e[1]?(jQuery("#img_"+l.replace("#","H")).attr("src",wppaImageDirectory+"tick.png"),e[3]&&alert(e[3]),_wppaRefreshAfter&&(_wppaRefreshAfter=!1,document.location.reload(!0))):(jQuery("#img_"+l.replace("#","H")).attr("src",wppaImageDirectory+"cross.png"),e[3]&&alert(e[3])),jQuery("#img_"+l.replace("#","H")).attr("title",e[2]),e[4])for(var p,n,o,r=e[4].split(";"),u=0;u<r.length;)p=r[u].split(":"),n=jQuery("#"+p[0]).html(),o=p[1],""!=n&&""==o&&(o='<input type="button" class="button-secundary" style="border-radius:3px;font-size:11px;height:18px;margin: 0 4px;padding:0px;color:red;background-color:pink;" onclick="document.location.reload(true)" value="Reload" />'),jQuery("#"+p[0]).html(o),u++},error:function(e){jQuery("#img_"+l.replace("#","H")).attr("src",wppaImageDirectory+"cross.png"),jQuery("#img_"+l.replace("#","H")).attr("title","Communication error")},complete:function(e){wppaCheckInconsistencies(),"spinner_shape"!=l&&"icon_corner_style"!=l||(wppaAjaxGetSpinnerHtml("normal","wppa-spin-pre-1"),wppaAjaxGetSpinnerHtml("lightbox","wppa-spin-pre-2")),"svg_color"!=l&&"svg_bg_color"!=l||wppaAjaxGetSpinnerHtml("normal","wppa-spin-pre-1"),"ovl_svg_color"!=l&&"ovl_svg_bg_color"!=l||wppaAjaxGetSpinnerHtml("lightbox","wppa-spin-pre-2")}})}function wppaEncode(e){if(void 0!==e){if("number"==typeof e)return e;for(var t=(p=(p=e.replace(/#/g,"||HASH||")).replace(/&/g,"||AMP||")).split("+"),a=0,p="";a<t.length;)p+=t[a],++a<t.length&&(p+="||PLUS||");return p}}function wppaCheckInconsistencies(){jQuery("#use_thumb_popup").prop("checked")&&"lightbox"==jQuery("#thumb_linktype").val()?jQuery(".popup-lightbox-err").css("display",""):jQuery(".popup-lightbox-err").css("display","none")}function wppaGetXmlHttp(){return xmlhttp=window.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP"),xmlhttp}function wppaPhotoStatusChange(e){if(jQuery("#psdesc-"+e).css({display:"none"}),elm=document.getElementById("status-"+e),elm){if("pending"!=elm.value&&"scheduled"!=elm.value||jQuery("#photoitem-"+e).css({backgroundColor:"#ffebe8",borderColor:"#cc0000"}),"publish"==elm.value&&jQuery("#photoitem-"+e).css({backgroundColor:"#ffffe0",borderColor:"#e6db55"}),"featured"==elm.value){jQuery("#photoitem-"+e).css({backgroundColor:"#e0ffe0",borderColor:"#55ee55"});var t=document.getElementById("pname-"+e).value.split(".");if(1<t.length)for(var a=0;a<t.length;)"jpg"!=t[a]&&"JPG"!=t[a]||jQuery("#psdesc-"+e).css({display:""}),a++}"gold"==elm.value&&jQuery("#photoitem-"+e).css({backgroundColor:"#eeeecc",borderColor:"#ddddbb"}),"silver"==elm.value&&jQuery("#photoitem-"+e).css({backgroundColor:"#ffffff",borderColor:"#eeeeee"}),"bronze"==elm.value&&jQuery("#photoitem-"+e).css({backgroundColor:"#ddddbb",borderColor:"#ccccaa"}),"scheduled"==elm.value?jQuery(".wppa-datetime-"+e).css("display",""):jQuery(".wppa-datetime-"+e).css("display","none"),jQuery("#scheduledel-"+e).prop("checked")?jQuery(".wppa-del-datetime-"+e).css("display",""):jQuery(".wppa-del-datetime-"+e).css("display","none")}}function wppaSetComBgCol(e){"approved"==jQuery("#com-stat-"+e).val()?jQuery("#com-tr-"+e).css({backgroundColor:"#ffffe0"}):jQuery("#com-tr-"+e).css({backgroundColor:"#ffebe8"})}function wppaAddCat(e,t){wppaAddTag(e,t)}function wppaAddTag(e,t){t=document.getElementById(t);e&&(t.value?t.value+=","+e:t.value=e,"-clear-"==e&&(t.value=""))}function wppaRefresh(e){e=new String(document.location).split("#")[0]+"#"+e;document.location=e}function wppaReload(e){e?(url=document.location.href.split("#"),document.location.href=url[0]+e,setTimeout(function(){document.location.reload(!0)},10)):document.location.reload(!0)}var wppaFeCount=0;function wppaFeAjaxLog(e){"in"==e&&(0==wppaFeCount&&jQuery("#wppa-fe-exit").css("display","none"),wppaFeCount++,jQuery("#wppa-fe-count").html(wppaFeCount)),"out"==e&&(1==wppaFeCount&&(jQuery("#wppa-fe-count").html(""),jQuery("#wppa-fe-exit").css("display","inline"),wppaFeCount--),1<wppaFeCount&&(wppaFeCount--,jQuery("#wppa-fe-count").html(wppaFeCount)))}function wppaArrayToEnum(e,t){temp=e.sort(function(e,t){return e-t});for(var a,p="",n=-1,o=-2,r=0,u=!1,l=0;l<e.length;)0!=(a=e[l].valueOf())&&(r=n,a==++r?u=!0:u?(p+=n==o?t+n+t+a:t+t+n+t+a,u=!1):p+=t+a,u||(o=a,o++),n=a),l++;for(u&&(p+=".."+n);"."==p.substr(0,1);)p=p.substr(1);for(;p.substr(0,1)==t;)p=p.substr(1);return p}function wppaGetSelEnumToId(e,t){p=jQuery("."+e);var a=[];for(i=0,j=0;i<p.length;)p[i].selected&&(a[j]=p[i].value,j++),i++;jQuery("#"+t).val(wppaArrayToEnum(a,"."))}function wppaGetSelectionEnumByClass(e,t){var a,p=[],n=0,o=0;for(t=t||".",a=jQuery(e),o=n=0;n<a.length;)a[n].selected&&(p[o]=a[n].value,o++),n++;return wppaArrayToEnum(p,t)}function wppaEditSearch(e,t){t=jQuery("#"+t).val();0==t.length?alert("Please enter searchstring"):document.location.href=e+"&wppa-searchstring="+t}function wppaEditTrash(e){document.location.href=e}function wppaExportDbTable(p){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=export-table&table="+p,async:!0,type:"GET",timeout:1e5,beforeSend:function(e){jQuery("#"+p+"-spin").css("display","inline")},success:function(e,t,a){e=e.split("||");"0"==e[1]?document.location=e[2]:alert("Error: "+e[1]+"\n\n"+e[2])},error:function(e,t,a){alert("Export Db Table "+p+" failed. Error = "+a+", status = "+t)},complete:function(e,t,a){jQuery("#"+p+"-spin").css("display","none")}})}function wppaDismissAdminNotice(e,t){wppaAjaxUpdateOptionCheckBox(e,t),jQuery("#wppa-wr-").css("display","none")}function wppaAjaxUpdateTogo(n){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=gettogo&slug="+n,async:!0,type:"GET",timeout:1e5,beforeSend:function(e){wppaConsoleLog("Requesting togo for slug "+n,"force")},success:function(e,t,a){var p=e.split("|");jQuery("#"+n+"_togo").html(p[0]);e=jQuery("#"+n+"_status").html(),p=p[1];""!=e&&""==p&&(p='<input type="button" class="button-secundary" style="border-radius:3px;font-size:11px;height:18px;margin: 0 4px;padding:0px;color:red;background-color:pink;" onclick="document.location.reload(true)" value="Reload" />'),jQuery("#"+n+"_status").html(p),setTimeout(function(){wppaAjaxUpdateTogo(n)},1e3)},error:function(e){},complete:function(e){}})}function wppaIsEmpty(e){return(null==e||void 0===e||""==e||0==e)&&!0}function wppaTimedConfirm(e){var t={modal:!0,resizable:!1,width:400,show:{effect:"fadeIn",duration:800},closeText:"X",buttons:[{text:"NO",click:function(){jQuery(this).dialog("close")}},{text:"YES",click:function(){jQuery(this).dialog("close")}}]};jQuery("#wppa-modal-container").html(e).dialog(t).dialog("open"),jQuery(".ui-dialog").css({boxShadow:"0px 0px 5px 5px #aaaaaa",padding:"8px",backgroundColor:"#cccccc",boxSizing:"content-box",zIndex:"200200"}),jQuery(".ui-dialog-titlebar").css({lineHeight:"0px",height:"32px"}),jQuery(".ui-button").css({float:"right",position:"relative",bottom:"40px"}),jQuery(".ui-dialog-titlebar-close").css({display:"none"}),jQuery(".ui-widget-overlay").css({backgroundColor:"transparent"}),jQuery(".ui-button").attr("title",wppaCloseText),setTimeout(function(){jQuery(".ui-button").trigger("click")},6e4)}function wppaAjaxGetSpinnerHtml(e,p){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=update-option&wppa-option=getspinnerpreview&type="+e+"&wppa-nonce="+document.getElementById("wppa-nonce").value,async:!0,type:"GET",timeout:1e5,beforeSend:function(e){},success:function(e,t,a){e=e.split("|");jQuery("#"+p).html(e[0])},error:function(e){},complete:function(e){}})}function wppaDragHorizon(t){var a=0,p=0;function n(e){(e=e||window.event).preventDefault(),a=p-e.clientY,p=e.clientY,t.style.top=t.offsetTop-a+"px"}function o(){document.onmouseup=null,document.onmousemove=null}t.onmousedown=function(e){(e=e||window.event).preventDefault(),pos3=e.clientX,p=e.clientY,document.onmouseup=o,document.onmousemove=n}}function wppaBulkActionChange(e,t){wppa_setCookie("wppa_bulk_action",e.value,365),"wppa-bulk-move-to"==e.value||"wppa-bulk-copy-to"==e.value?jQuery("#wppa-bulk-album").css("display","inline"):jQuery("#wppa-bulk-album").css("display","none"),"wppa-bulk-status"==e.value?jQuery("#wppa-bulk-status").css("display","inline"):jQuery("#wppa-bulk-status").css("display","none"),"wppa-bulk-owner"==e.value?jQuery("#wppa-bulk-owner").css("display","inline"):jQuery("#wppa-bulk-owner").css("display","none")}function wppaBulkDoitOnClick(){var e=jQuery(".wppa-bulk-photo"),t=0;for(i=0;i<e.length;i++)e[i].checked&&t++;if(0==t)return alert("No photos selected"),!1;var a=document.getElementById("wppa-bulk-action").value;switch(a){case"":return alert("No action selected"),!1;case"wppa-bulk-delete":case"wppa-bulk-delete-immediate":case"wppa-bulk-undelete":break;case"wppa-bulk-move-to":case"wppa-bulk-copy-to":if(0==document.getElementById("wppa-bulk-album").value)return alert("No album selected"),!1;break;case"wppa-bulk-status":if(0==document.getElementById("wppa-bulk-status").value)return alert("No status selected"),!1;break;case"wppa-bulk-owner":if(0==documnet.getElementById("wppa-bulk-owner").value)return alert("No new owner selected"),!1;break;default:return alert("Unimplemented action requested: "+a),!1}return!0}function wppaSetThumbsize(e){e=e.value;wppa_setCookie("wppa_bulk_thumbsize",e,365),jQuery(".wppa-bulk-thumb").css("max-width",e+"px"),jQuery(".wppa-bulk-thumb").css("max-height",e/2+"px"),jQuery(".wppa-bulk-dec").css("height",e/2+"px")}function wppaToggleConfirmDelete(e){jQuery(e).prop("checked")?wppa_setCookie("wppaConfirmDelete","checked",365):wppa_setCookie("wppaConfirmDelete","unchecked",365)}function wppaToggleConfirmMove(e){jQuery(e).prop("checked")?wppa_setCookie("wppaConfirmMove","checked",365):wppa_setCookie("wppaConfirmMove","unchecked",365)}function wppaSetConfirmDelete(e){"checked"==wppa_getCookie("wppaConfirmDelete")?jQuery("#"+e).prop("checked",!0):jQuery("#"+e).prop("checked",!1)}function wppaSetConfirmMove(e){"checked"==wppa_getCookie("wppaConfirmMove")?jQuery("#"+e).prop("checked",!0):jQuery("#"+e).prop("checked",!1)}function wppaAjaxReplaceLog(){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=maintenancepopup&slug=wppa_list_errorlog&raw=1&wppa-nonce="+jQuery("#wppa-nonce").val(),async:!0,type:"GET",timeout:1e5,beforeSend:function(e){jQuery("#wppa-spinner").show()},success:function(e,t,a){e=wppaEntityDecode(e),jQuery("#wppa-logbody").html(e),jQuery("#wppa-spinner").hide()}})}function wppaTestAdminReady(){"complete"===document.readyState?jQuery("#wppa-admin-spinner").fadeOut():setTimeout("wppaTestAdminReady()",200)}function wppaCommentAdminUpdateHref(e){var t=encodeURIComponent(jQuery("#commenttext-"+e).val()),a=jQuery("#href-"+e).attr("href"),p=a.split("commenttext=");p[1]=t,a=p[0]+"commenttext="+p[1],jQuery("#href-"+e).attr("href",a),jQuery("#href-"+e).css("display","inline")}function wppaGetTinyMceContent(e){return"none"!=jQuery("#"+e).css("display")?jQuery("#"+e).val():tinymce.get(e).getContent()}jQuery(document).ready(function(){var e;document.getElementById("wppa-bulk-action")&&(e=wppa_getCookie("wppa_bulk_action"),"wppa-bulk-move-to"!=(document.getElementById("wppa-bulk-action").value=e)&&"wppa-bulk-copy-to"!=e||(jQuery("#wppa-bulk-album").css("display","inline"),document.getElementById("wppa-bulk-album").value=wppa_getCookie("wppa_bulk_album")),"wppa-bulk-status"==e&&(jQuery("#wppa-bulk-status").css("display","inline"),document.getElementById("wppa-bulk-status").value=wppa_getCookie("wppa_bulk_status")),"wppa-bulk-owner"==e&&(jQuery("#wppa-bulk-owner").css("display","inline"),document.getElementById("wppa-bulk-owner").value=wppa_getCookie("wppa_bulk_owner")))}),jQuery(document).ready(function(){setTimeout("wppaTestAdminReady()",200)});
1
+ function checkjQueryRev(e,t,a){var p=parseFloat(jQuery.fn.jquery);t.checked&&p<a&&(alert(e+"\nThe version of your jQuery library: "+p+" is too low for this feature. It requires version "+a),t.checked="")}function wppaReUpload(e,o,t,r){document.getElementById("wppa-re-up-form-"+o);var a=document.getElementById("wppa-re-up-file-"+o),u=document.getElementById("wppa-re-up-butn-"+o);e.preventDefault();a=a.files[0];if(a.type.match("image.*")){if(0==t.length)alert("Filename will be set to "+a.name);else if(a.name!=t&&!confirm("Filename is different.\nIf you continue, the filename will not be updated!.\n\nContinue?"))return void jQuery("#re-up-"+o).css("display","none");u.value="Uploading...",u.style.color="black";t=new FormData;t.append("photo",a,a.name);var i=new XMLHttpRequest,a="?action=wppa&wppa-action=update-photo&photo-id="+o+"&item=file&wppa-nonce="+document.getElementById("photo-nonce-"+o).value;i.open("POST",wppaAjaxUrl+a,!0),i.onload=function(){if(200===i.status){var e=wppaTrim(i.responseText).split("||");switch(""!=e[0]&&alert("The server returned unexpected output:\n"+e[0]),e[1]){case"0":var t,a,p,n=JSON.parse(e[2]);for(t in n)switch(p=n[t],t){case"remark":p=(p=(p=p.replace(/&lt;/g,"<")).replace(/&gt;/g,">")).replace(/\\/g,""),a="0"!=e[1]?'<span style="color:red;" >'+p+"</span>":'<span style="color:green;" >'+p+"</span>",r&&(a+=' <span style="color:blue;" >Reloading...</span>'),jQuery("#remark-"+o).html(a);break;case"photourl":wppaCropper[o]?wppaCropper[o].replace(p):jQuery("#photourl-"+o).attr("src",p),jQuery("#thumba-"+o).attr("href",p);break;case"thumburl":jQuery("#thumburl-"+o).attr("src",p);break;case"magickstack":jQuery("#magickstack-"+o).html(p),0<p.length?jQuery("#imstackbutton-"+o).css("display","inline"):jQuery("#imstackbutton-"+o).css("display","none");break;default:jQuery("#"+t+"-"+o).html(p)}u.value="Upload",jQuery("#re-up-"+o).css("display","none");break;case"99":document.getElementById("photoitem-"+o).innerHTML='<span style="color:red">'+e[2]+"</span>";break;default:document.getElementById("remark-"+o).innerHTML='<span style="color:red">'+e[2]+" ("+e[1]+")</span>",u.value="Error occured",u.style.color="red"}}else alert("An error occurred!")},i.send(t)}else alert("File is not an image file!")}jQuery(document).ready(function(){jQuery(window).on("DOMContentLoaded load resize scroll",function(){wppaMakeLazyVisible("windowon")}),wppaMakeLazyVisible("docready")});var _wppaRefreshAfter=!1;function wppaRefreshAfter(){_wppaRefreshAfter=!0}function wppaCheckWidgetMethod(){var e,t,a;if("4"==document.getElementById("wppa-wm").value?(document.getElementById("wppa-wp").style.visibility="visible","day-of-week"==(a=jQuery("#wppa-wp").val())||"day-of-month"==a||"day-of-year"==a?jQuery(".wppa-order").css("visibility",""):jQuery(".wppa-order").css("visibility","hidden")):(document.getElementById("wppa-wp").style.visibility="hidden",jQuery(".wppa-order").css("visibility","hidden")),"1"==document.getElementById("wppa-wm").value)for(e=document.getElementsByName("wppa-widget-photo"),t=0;t<e.length;)e[t].style.visibility="visible",t++;else for(e=document.getElementsByName("wppa-widget-photo"),t=0;t<e.length;)e[t].style.visibility="hidden",t++}function wppa_tablecookieon(e){wppa_setCookie("table_"+e,"on","365")}function wppa_tablecookieoff(e){wppa_setCookie("table_"+e,"off","365")}function wppaCookieCheckbox(e,t){e.checked?wppa_setCookie(t,"on","365"):wppa_setCookie(t,"off","365")}function wppa_move_up(e){document.location=wppa_moveup_url+e+"&wppa-nonce="+document.getElementById("wppa-nonce").value}function checkColor(e){var t=e.substr(5),e=jQuery("#"+t).val();jQuery("#colorbox-"+t).css("background-color",e)}function checkAll(e,t){e=document.getElementById(e);e&&(e.checked?jQuery(t).prop("checked",!0):jQuery(t).prop("checked",!1))}function impUpd(e,t){e.checked?(jQuery(t).val(wppa_update),jQuery(".hideifupdate").css("display","none")):(jQuery(t).val(wppa_import),jQuery(".hideifupdate").css("display",""))}function wppaAjaxDeletePhoto(t,e,a,p){wppaConsoleLog("imm="+p,"force");var n="",o="",n=e||'<div style="padding-left:5px;" >';a?o=a:aftrer="</div>",wppaFeAjaxLog("in");var r=wppaGetXmlHttp(),a=wppaAjaxUrl+"?action=wppa&wppa-action=delete-photo&photo-id="+t;a+="&wppa-nonce="+document.getElementById("photo-nonce-"+t).value,p&&(a+="&wppa-immediate=1"),r.open("GET",a,!0),r.send(),r.onreadystatechange=function(){switch(r.readyState){case 1:document.getElementById("remark-"+t).innerHTML="server connection established";break;case 2:document.getElementById("remark-"+t).innerHTML="request received";break;case 3:document.getElementById("remark-"+t).innerHTML="processing request";break;case 4:var e;200==r.status?("ER"==(e=wppaTrim(r.responseText).split("||"))[0]?(e[3]&&alert(e[3]),jQuery("#wppa-delete-"+t).css("text-decoration","line-through")):""!=e[0]&&alert("The server returned unexpected output:\n"+e[0]),0==e[1]?document.getElementById("remark-"+t).innerHTML=e[2]:(document.getElementById("photoitem-"+t).innerHTML=n+e[2]+o,wppaProcessFull(e[3],e[4])),jQuery(window).trigger("scroll"),wppaFeAjaxLog("out")):document.getElementById("photoitem-"+t).innerHTML=n+'<span style="color:red;" >Comm error '+r.status+": "+r.statusText+"</span>"+o}}}function wppaAjaxUndeletePhoto(t){wppaFeAjaxLog("in");var a=wppaGetXmlHttp(),e=wppaAjaxUrl+"?action=wppa&wppa-action=undelete-photo&photo-id="+t;e+="&wppa-nonce="+document.getElementById("photo-nonce-"+t).value,a.open("GET",e,!0),a.send(),a.onreadystatechange=function(){switch(a.readyState){case 1:document.getElementById("remark-"+t).innerHTML="server connection established";break;case 2:document.getElementById("remark-"+t).innerHTML="request received";break;case 3:document.getElementById("remark-"+t).innerHTML="processing request";break;case 4:var e;200==a.status?("ER"==(e=wppaTrim(a.responseText).split("||"))[0]?(e[3]&&alert(e[3]),jQuery("#wppa-delete-"+t).css("text-decoration","line-through")):""!=e[0]&&alert("The server returned unexpected output:\n"+e[0]),0==e[1]?document.getElementById("remark-"+t).innerHTML=e[2]:document.getElementById("photoitem-"+t).innerHTML='<div style="padding-left:5px;" >'+e[2]+"</div>",wppaFeAjaxLog("out")):document.getElementById("photoitem-"+t).innerHTML=before+'<span style="color:red;" >Comm error '+a.status+": "+a.statusText+"</span>"+after}}}function wppaAjaxApplyWatermark(t,e,a){wppaFeAjaxLog("in");var p=wppaGetXmlHttp();jQuery("#wppa-water-spin-"+t).css({visibility:"visible"});var n="action=wppa&wppa-action=watermark-photo&photo-id="+t;n+="&wppa-nonce="+document.getElementById("photo-nonce-"+t).value,e&&(n+="&wppa-watermark-file="+e),a&&(n+="&wppa-watermark-pos="+a),p.open("POST",wppaAjaxUrl,!0),p.setRequestHeader("Content-type","application/x-www-form-urlencoded"),p.send(n),p.onreadystatechange=function(){var e;4==p.readyState&&(200==p.status?(""!=(e=wppaTrim(p.responseText).split("||"))[0]&&alert("The server returned unexpected output:\n"+e[0]),"0"===e[1]?(document.getElementById("remark-"+t).innerHTML=e[2],setTimeout(function(){document.location.reload(!0)},500)):document.getElementById("remark-"+t).innerHTML='<span style="color:red">'+e[2]+"</span>",jQuery("#wppa-water-spin-"+t).css({visibility:"hidden"}),wppaFeAjaxLog("out")):document.getElementById("remark-"+t).innerHTML='<span style="color:red;" >Comm error '+p.status+": "+p.statusText+"</span>")}}function wppaAjaxUpdateIptc(i,e,t,a){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=update-iptc&photo-id="+i+"&item="+e+"&wppa-nonce="+document.getElementById("photo-nonce-"+i).value+"&value="+wppaEncode(t)+"&tagname="+a,async:!0,type:"POST",timeout:6e4,beforeSend:function(e){jQuery("#remark-"+i).html("Working, please wait...")},success:function(e,t,a){var p=wppaTrim(e).split("||");if(""!=p[0]&&alert("The server returned unexpected output:\n"+p[0]),"99"===p[1])jQuery("#photoitem-"+i).html(bef+'<span style="color:red">'+p[2]+"</span>"+aft);else{var n,o,r,u=JSON.parse(p[2]);for(n in u)switch(r=u[n],n){case"remark":r=(r=(r=r.replace(/&lt;/g,"<")).replace(/&gt;/g,">")).replace(/\\/g,""),o="0"!=p[1]?'<span style="color:red;" >'+r+"</span>":'<span style="color:green;" >'+r+"</span>",jQuery("#remark-"+i).html(o);break;case"photourl":wppaCropper[i]?wppaCropper[i].replace(r):jQuery("#photourl-"+i).attr("src",r),jQuery("#thumba-"+i).attr("href",r);break;case"thumburl":jQuery("#thumburl-"+i).attr("src",r);break;case"magickstack":jQuery("#magickstack-"+i).html(r),0<r.length?jQuery("#imstackbutton-"+i).css("display","inline"):jQuery("#imstackbutton-"+i).css("display","none")}}wppaFeAjaxLog("out")},error:function(e,t,a){jQuery("#remark-"+i).html('<span style="color:red;" >Comm error '+t+"</span>"),wppaConsoleLog("wppaAjaxUpdatePhoto failed. Error = "+a+", status = "+t,"force")},complete:function(e,t,a){jQuery("#wppa-admin-spinner").css("display","none"),jQuery(window).trigger("scroll")}})}function wppaAjaxUpdatePhoto(i,l,e,s,c,d){c=c||"",d=d||"",wppaFeAjaxLog("in"),jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=update-photo&photo-id="+i+"&item="+l+"&wppa-nonce="+document.getElementById("photo-nonce-"+i).value+"&value="+wppaEncode(e),async:!0,type:"POST",timeout:6e4,beforeSend:function(e){"description"==l&&jQuery("#wppa-photo-spin-"+i).css({visibility:"visible"}),jQuery("#remark-"+i).html("Working, please wait...")},success:function(e,t,a){var p=wppaTrim(e).split("||");if(""!=p[0]&&alert("The server returned unexpected output:\n"+p[0]),"99"===p[1])jQuery("#photoitem-"+i).html(c+'<span style="color:red">'+p[2]+"</span>"+d);else{var n,o,r,u=JSON.parse(p[2]);for(n in u)switch(r=u[n],n){case"remark":r=(r=(r=r.replace(/&lt;/g,"<")).replace(/&gt;/g,">")).replace(/\\/g,""),o="0"!=p[1]?'<span style="color:red;" >'+r+"</span>":'<span style="color:green;" >'+r+"</span>",s&&(o+=' <span style="color:blue;" >Reloading...</span>'),jQuery("#remark-"+i).html(o);break;case"photourl":wppaCropper[i]?wppaCropper[i].replace(r):jQuery("#photourl-"+i).attr("src",r),jQuery("#thumba-"+i).attr("href",r);break;case"thumburl":jQuery("#thumburl-"+i).attr("src",r);break;case"magickstack":jQuery("#magickstack-"+i).html(r),0<r.length?jQuery("#imstackbutton-"+i).css("display","inline"):jQuery("#imstackbutton-"+i).css("display","none");break;default:jQuery("#"+n+"-"+i).html(r)}}"description"==l&&jQuery("#wppa-photo-spin-"+i).css({visibility:"hidden"}),wppaFeAjaxLog("out")},error:function(e,t,a){jQuery("#remark-"+i).html('<span style="color:red;" >Comm error '+t+"</span>"),wppaConsoleLog("wppaAjaxUpdatePhoto failed. Error = "+a+", status = "+t,"force")},complete:function(e,t,a){var p=(p=document.location.href).replace(/&pano-val=./,"");s?setTimeout(function(){document.location.href=p},300):(jQuery("#wppa-admin-spinner").css("display","none"),jQuery(window).trigger("scroll"))}})}function wppaChangeScheduleAlbum(e,t){jQuery(t).prop("checked")?jQuery(".wppa-datetime-"+e).css("display","inline"):(jQuery(".wppa-datetime-"+e).css("display","none"),wppaAjaxUpdateAlbum(e,"scheduledtm",Math.rand()))}function wppaChangeScheduleDelAlbum(e,t){jQuery(t).prop("checked")?jQuery(".wppa-datetimedel-"+e).css("display","inline"):(jQuery(".wppa-datetimedel-"+e).css("display","none"),wppaAjaxUpdateAlbum(e,"scheduledel",Math.rand()))}var _wppaRefreshAfter=!1,wppaAjaxAlbumCount=0,wppaAlbumUpdateMatrix=new Array;function wppaAjaxUpdateAlbum(e,t,a,p){var n=0==jQuery("#wppaalbumdesc:visible").length;jQuery("#wppaalbumdesc-html").click();for(var o=wppaAlbumUpdateMatrix.length,r=0,u=!1,i=-1;r<o;)wppaAlbumUpdateMatrix[r][0]==e&&wppaAlbumUpdateMatrix[r][1]==t&&(u=!0,i=r),r++;u||(wppaAlbumUpdateMatrix[o]=[e,t,"undefined",!1,!1,p],i=o),a=a.value||a,wppaAlbumUpdateMatrix[i][3]=a,wppaAlbumUpdateMatrix[i][5]=p,wppaAjaxUpdateAlbumMonitor(n)}function wppaAjaxUpdateAlbumMonitor(e){for(var t=wppaAlbumUpdateMatrix.length,a=0;a<t;)wppaAlbumUpdateMatrix[a][2]==wppaAlbumUpdateMatrix[a][3]||wppaAlbumUpdateMatrix[a][4]||(wppaAlbumUpdateMatrix[a][4]=!0,_wppaAjaxUpdateAlbum(wppaAlbumUpdateMatrix[a][0],wppaAlbumUpdateMatrix[a][1],wppaAlbumUpdateMatrix[a][3],e,wppaAlbumUpdateMatrix[a][5])),a++;e&&jQuery("#wppaalbumdesc-tmce").click()}function _wppaAjaxUpdateAlbum(r,u,i,l,s){wppaAjaxAlbumCount++;jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=update-album&album-id="+r+"&item="+u+"&wppa-nonce="+document.getElementById("album-nonce-"+r).value+"&value="+wppaEncode(i),async:!0,type:"POST",timeout:6e4,beforeSend:function(e){"description"==u&&jQuery("#wppa-album-spin").css({visibility:"visible"}),jQuery("#albumstatus-"+r).html("Working, please wait... ("+wppaAjaxAlbumCount+")")},success:function(e,t,a){e=wppaTrim(e).split("||");if(wppaAjaxAlbumCount--,""!=e[0]&&alert("The server returned unexpected output:\n"+e[0]),"0"===e[1]?0==wppaAjaxAlbumCount?jQuery("#albumstatus-"+r).html(e[2]):jQuery("#albumstatus-"+r).html("Working, please wait... ("+wppaAjaxAlbumCount+")"):jQuery("#albumstatus-"+r).html='<span style="color:red">'+e[2]+" ("+e[1]+")</span>",void 0!==e[3]&&wppaProcessFull(e[3],e[4]),s&&"0"==e[1])return jQuery("#albumstatus-"+r).after('<span style="color:blue;font-weight:bold;"> Reloading...</span>'),jQuery("#wppa-admin-spinner").fadeIn(),void setTimeout(function(){wppaReload()},100);"cover_linktype"==u&&("manual"==i?jQuery("#link-url-tr").show():jQuery("#link-url-tr").hide()),"description"==u&&jQuery("#wppa-album-spin").css({visibility:"hidden"});for(var p=0,n=-1,o=wppaAlbumUpdateMatrix.length;p<o;)wppaAlbumUpdateMatrix[p][0]==r&&wppaAlbumUpdateMatrix[p][1]==u&&(n=p),p++;wppaAlbumUpdateMatrix[n][2]=i||0,wppaAlbumUpdateMatrix[n][4]=!1,wppaAlbumUpdateMatrix[n][5]=!1,wppaAjaxUpdateAlbumMonitor(l)},error:function(e,t,a){wppaAjaxAlbumCount--,jQuery("#albumstatus-"+r).html('<span style="color:red;" >Comm error '+t+"</span>"),wppaConsoleLog("_wppaAjaxUpdateAlbum failed. Error = "+a+", status = "+t,"force")},complete:function(e,t,a){}})}function wppaProcessFull(e,t){"full"==e&&(jQuery("#full").css("display",""),jQuery("#notfull").css("display","none")),"notfull"==e&&(jQuery("#full").css("display","none"),0<t?jQuery("#notfull").attr("value",wppaUploadToThisAlbum+" (max "+t+")"):jQuery("#notfull").attr("value",wppaUploadToThisAlbum),jQuery("#notfull").css("display",""))}function wppaAjaxUpdateCommentStatus(t,a,e){var p=wppaGetXmlHttp(),e=wppaAjaxUrl+"?action=wppa&wppa-action=update-comment-status&wppa-photo-id="+t+"&wppa-comment-id="+a+"&wppa-comment-status="+e+"&wppa-nonce="+document.getElementById("photo-nonce-"+t).value;p.onreadystatechange=function(){var e;4==p.readyState&&(200==p.status?(""!=(e=wppaTrim(p.responseText).split("||"))[0]&&alert("The server returned unexpected output:\n"+e[0]),"0"===e[1]?jQuery("#remark-"+t).html(e[2]):jQuery("#remark-"+t).html('<span style="color:red">'+e[2]+"</span>"),jQuery("#wppa-comment-spin-"+a).css("visibility","hidden")):jQuery("#remark-"+t).html('<span style="color:red;" >Comm error '+p.status+": "+p.statusText+"</span>"))},p.open("GET",e,!0),p.send()}function wppaAjaxUpdateOptionCheckBox(t,e){var a=wppaGetXmlHttp(),p=wppaAjaxUrl+"?action=wppa&wppa-action=update-option&wppa-option="+t;p+="&wppa-nonce="+document.getElementById("wppa-nonce").value,e.checked?p+="&value=yes":p+="&value=no",a.onreadystatechange=function(){switch(a.readyState){case 1:case 2:case 3:jQuery("#img_"+t).attr("src",wppaImageDirectory+"spinner.gif");break;case 4:var e=wppaTrim(a.responseText).split("||");""!=e[0]&&alert("The server returned unexpected output:\n"+e[0]),404!=a.status?("0"===e[1]?(jQuery("#img_"+t).attr("src",wppaImageDirectory+"tick.png"),jQuery("#img_"+t).attr("title",e[2])):(jQuery("#img_"+t).attr("src",wppaImageDirectory+"cross.png"),jQuery("#img_"+t).attr("title","Error #"+e[1]+", message: "+e[2]+", status: "+a.status)),e[3]&&alert(e[3]),_wppaRefreshAfter&&(_wppaRefreshAfter=!1,document.location.reload(!0))):(jQuery("#img_"+t).attr("src",wppaImageDirectory+"cross.png"),jQuery("#img_"+t).attr("title","Communication error, status = "+a.status)),wppaCheckInconsistencies()}},a.open("GET",p,!0),a.send()}var wppaAlwaysContinue=100;function wppaMaintenanceProc(p,e,r){if(!r&&!e&&"yes"==document.getElementById(p+"_continue").value)return document.getElementById(p+"_continue").value="no",document.getElementById(p+"_button").value="Start!",void(0<jQuery("#"+p+"_togo").html()&&(jQuery("#"+p+"_status").html("Pausing..."),jQuery("#"+p+"_button").css("display","none")));r||(document.getElementById(p+"_continue").value="yes",document.getElementById(p+"_button").value="Stop!",""==jQuery("#"+p+"_status").html()&&jQuery("#"+p+"_status").html("Wait...")),jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=maintenance&slug="+p+"&wppa-nonce="+jQuery("#wppa-nonce").val()+(r?"&wppa-cron=1":""),async:!0,type:"POST",timeout:3e5,beforeSend:function(e){},success:function(e,t,a){var p=e.split("||"),n=p[1],o=!1;return n?(10<p[0].length&&(alert("An error occurred:\n"+p[0]),o=!0),jQuery("#"+n+"_status").html(p[2]),jQuery("#"+n+"_togo").html(p[3]),jQuery("#"+n+"_button").css("display",""),o||"0"==p[3]?"reload"==p[4]?(alert("This page will now be reloaded to finish the operation. Please stay tuned..."),void wppaReload()):void setTimeout("wppaMaintenanceProc('"+n+"', false)",20):void(document.getElementById(n+"_continue")&&"yes"==document.getElementById(n+"_continue").value?setTimeout("wppaMaintenanceProc('"+n+"', true)",20):(r||jQuery("#"+n+"_status").html("Pending"),setTimeout(function(){wppaAjaxUpdateTogo(n)},1e3)))):(alert("The server returned unexpected output:\n"+e+"\nIf the current procedure has a Skip One button, press it before retrying. Reloading page..."),void wppaReload())},error:function(e,t,a){wppaConsoleLog("wppaMaintenanceProc failed. Slug = "+p+", Error = "+a+", status = "+t,"force"),jQuery("#"+p+"_status").html("Server error #"+(11-wppaAlwaysContinue));t=!1;--wppaAlwaysContinue<1&&(t=confirm("10 Server errors happened.\nDo you want to continue?"))&&(wppaAlwaysContinue=100),(t||0<wppaAlwaysContinue)&&("wppa_remake"==p&&wppaAjaxUpdateOptionValue("wppa_remake_skip_one",0),"wppa_regen_thumbs"==p&&wppaAjaxUpdateOptionValue("wppa_regen_thumbs_skip_one",0),"wppa_create_o1_files"==p&&wppaAjaxUpdateOptionValue("wppa_create_o1_files_skip_one",0),setTimeout("wppaMaintenanceProc('"+p+"', true)",2e3))},complete:function(e,t,a){}})}function wppaAjaxPopupWindow(e){switch(e){case"wppa_list_index":0;break;case"wppa_list_errorlog":0;break;case"wppa_list_rating":0;break;case"wppa_list_session":0;break;case"wppa_list_comments":0}var t=.9*wppaWindowWidth(),a=wppaGetXmlHttp(),p=wppaAjaxUrl,e="action=wppa&wppa-action=maintenancepopup&slug="+e;e+="&wppa-nonce="+document.getElementById("wppa-nonce").value,a.open("POST",p,!1),a.setRequestHeader("Content-type","application/x-www-form-urlencoded"),a.send(e),4==a.readyState&&200==a.status&&(a=(e=wppaEntityDecode(a.responseText).split("|"))[0],e[0]="",e=e.join("|").substring(1),t={modal:!0,resizable:!0,width:t,show:{effect:"fadeIn",duration:800},closeText:wppaCloseText},jQuery("#wppa-modal-container").html(e).dialog(t).dialog("open"),jQuery("#wppa-modal-container").css({width:"100%"}),jQuery(".ui-dialog").css({boxShadow:"0px 0px 5px 5px #aaaaaa",padding:"8px",backgroundColor:"#cccccc",boxSizing:"content-box",zIndex:"200200"}),jQuery(".ui-dialog-titlebar").css({lineHeight:"0px",height:"50px"}),jQuery(".ui-dialog-title").html("<h2>"+a+"</h2>"),jQuery(".ui-button").css({position:"absolute",top:"12px",right:"12px"}),jQuery(".ui-button").attr("title",wppaCloseText),jQuery(".ui-widget-overlay").css({backgroundColor:"transparent"}),setTimeout(function(){jQuery("#wppa-maintenance-list").niceScroll&&jQuery("#wppa-maintenance-list").niceScroll(".wppa-nicewrap",{})},1e3))}function wppaAjaxUpdateOptionValue(i,e,t){var a="action=wppa&wppa-action=update-option&wppa-option="+wppaEncode(i)+"&wppa-nonce="+document.getElementById("wppa-nonce").value;0!=e&&(a+="number"==typeof e?"&value="+e:t?"&value="+wppaGetSelectionEnumByClass("."+i,","):"&value="+wppaEncode(e.value)),jQuery.ajax({url:wppaAjaxUrl,data:a,async:!0,type:"POST",timeout:1e5,beforeSend:function(e){jQuery("#img_"+i.replace("#","H")).attr("src",wppaImageDirectory+"spinner.gif")},success:function(e,t,a){e=wppaTrim(e).split("||");if(""!=e[0])alert("The server returned unexpected output:\n"+e[0]);else if("0"===e[1]?(jQuery("#img_"+i.replace("#","H")).attr("src",wppaImageDirectory+"tick.png"),e[3]&&alert(e[3]),_wppaRefreshAfter&&(_wppaRefreshAfter=!1,document.location.reload(!0))):(jQuery("#img_"+i.replace("#","H")).attr("src",wppaImageDirectory+"cross.png"),e[3]&&alert(e[3])),jQuery("#img_"+i.replace("#","H")).attr("title",e[2]),e[4])for(var p,n,o,r=e[4].split(";"),u=0;u<r.length;)p=r[u].split(":"),n=jQuery("#"+p[0]).html(),o=p[1],""!=n&&""==o&&(o='<input type="button" class="button-secundary" style="border-radius:3px;font-size:11px;height:18px;margin: 0 4px;padding:0px;color:red;background-color:pink;" onclick="document.location.reload(true)" value="Reload" />'),jQuery("#"+p[0]).html(o),u++},error:function(e){jQuery("#img_"+i.replace("#","H")).attr("src",wppaImageDirectory+"cross.png"),jQuery("#img_"+i.replace("#","H")).attr("title","Communication error")},complete:function(e){wppaCheckInconsistencies(),"spinner_shape"!=i&&"icon_corner_style"!=i||(wppaAjaxGetSpinnerHtml("normal","wppa-spin-pre-1"),wppaAjaxGetSpinnerHtml("lightbox","wppa-spin-pre-2")),"svg_color"!=i&&"svg_bg_color"!=i||wppaAjaxGetSpinnerHtml("normal","wppa-spin-pre-1"),"ovl_svg_color"!=i&&"ovl_svg_bg_color"!=i||wppaAjaxGetSpinnerHtml("lightbox","wppa-spin-pre-2")}})}function wppaEncode(e){if(void 0!==e){if("number"==typeof e)return e;for(var t=(p=(p=e.replace(/#/g,"||HASH||")).replace(/&/g,"||AMP||")).split("+"),a=0,p="";a<t.length;)p+=t[a],++a<t.length&&(p+="||PLUS||");return p}}function wppaCheckInconsistencies(){jQuery("#use_thumb_popup").prop("checked")&&"lightbox"==jQuery("#thumb_linktype").val()?jQuery(".popup-lightbox-err").css("display",""):jQuery(".popup-lightbox-err").css("display","none")}function wppaGetXmlHttp(){return xmlhttp=window.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP"),xmlhttp}function wppaPhotoStatusChange(e){if(jQuery("#psdesc-"+e).css({display:"none"}),elm=document.getElementById("status-"+e),elm){if("pending"!=elm.value&&"scheduled"!=elm.value||jQuery("#photoitem-"+e).css({backgroundColor:"#ffebe8",borderColor:"#cc0000"}),"publish"==elm.value&&jQuery("#photoitem-"+e).css({backgroundColor:"#ffffe0",borderColor:"#e6db55"}),"featured"==elm.value){jQuery("#photoitem-"+e).css({backgroundColor:"#e0ffe0",borderColor:"#55ee55"});var t=document.getElementById("pname-"+e).value.split(".");if(1<t.length)for(var a=0;a<t.length;)"jpg"!=t[a]&&"JPG"!=t[a]||jQuery("#psdesc-"+e).css({display:""}),a++}"gold"==elm.value&&jQuery("#photoitem-"+e).css({backgroundColor:"#eeeecc",borderColor:"#ddddbb"}),"silver"==elm.value&&jQuery("#photoitem-"+e).css({backgroundColor:"#ffffff",borderColor:"#eeeeee"}),"bronze"==elm.value&&jQuery("#photoitem-"+e).css({backgroundColor:"#ddddbb",borderColor:"#ccccaa"}),"scheduled"==elm.value?jQuery(".wppa-datetime-"+e).css("display",""):jQuery(".wppa-datetime-"+e).css("display","none"),jQuery("#scheduledel-"+e).prop("checked")?jQuery(".wppa-del-datetime-"+e).css("display",""):jQuery(".wppa-del-datetime-"+e).css("display","none")}}function wppaSetComBgCol(e){"approved"==jQuery("#com-stat-"+e).val()?jQuery("#com-tr-"+e).css({backgroundColor:"#ffffe0"}):jQuery("#com-tr-"+e).css({backgroundColor:"#ffebe8"})}function wppaAddCat(e,t){wppaAddTag(e,t)}function wppaAddTag(e,t){t=document.getElementById(t);e&&(t.value?t.value+=","+e:t.value=e,"-clear-"==e&&(t.value=""))}function wppaRefresh(e){e=new String(document.location).split("#")[0]+"#"+e;document.location=e}function wppaReload(e){e?(url=document.location.href.split("#"),document.location.href=url[0]+e,setTimeout(function(){document.location.reload(!0)},10)):document.location.reload(!0)}var wppaFeCount=0;function wppaFeAjaxLog(e){"in"==e&&(0==wppaFeCount&&jQuery("#wppa-fe-exit").css("display","none"),wppaFeCount++,jQuery("#wppa-fe-count").html(wppaFeCount)),"out"==e&&(1==wppaFeCount&&(jQuery("#wppa-fe-count").html(""),jQuery("#wppa-fe-exit").css("display","inline"),wppaFeCount--),1<wppaFeCount&&(wppaFeCount--,jQuery("#wppa-fe-count").html(wppaFeCount)))}function wppaArrayToEnum(e,t){temp=e.sort(function(e,t){return e-t});for(var a,p="",n=-1,o=-2,r=0,u=!1,i=0;i<e.length;)0!=(a=e[i].valueOf())&&(r=n,a==++r?u=!0:u?(p+=n==o?t+n+t+a:t+t+n+t+a,u=!1):p+=t+a,u||(o=a,o++),n=a),i++;for(u&&(p+=".."+n);"."==p.substr(0,1);)p=p.substr(1);for(;p.substr(0,1)==t;)p=p.substr(1);return p}function wppaGetSelEnumToId(e,t){p=jQuery("."+e);var a=[];for(i=0,j=0;i<p.length;)p[i].selected&&(a[j]=p[i].value,j++),i++;jQuery("#"+t).val(wppaArrayToEnum(a,"."))}function wppaGetSelectionEnumByClass(e,t){var a,p=[],n=0,o=0;for(t=t||".",a=jQuery(e),o=n=0;n<a.length;)a[n].selected&&(p[o]=a[n].value,o++),n++;return wppaArrayToEnum(p,t)}function wppaEditSearch(e,t){t=jQuery("#"+t).val();0==t.length?alert("Please enter searchstring"):document.location.href=e+"&wppa-searchstring="+t}function wppaEditTrash(e){document.location.href=e}function wppaExportDbTable(p){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=export-table&table="+p,async:!0,type:"GET",timeout:1e5,beforeSend:function(e){jQuery("#"+p+"-spin").css("display","inline")},success:function(e,t,a){e=e.split("||");"0"==e[1]?document.location=e[2]:alert("Error: "+e[1]+"\n\n"+e[2])},error:function(e,t,a){alert("Export Db Table "+p+" failed. Error = "+a+", status = "+t)},complete:function(e,t,a){jQuery("#"+p+"-spin").css("display","none")}})}function wppaDismissAdminNotice(e,t){wppaAjaxUpdateOptionCheckBox(e,t),jQuery("#wppa-wr-").css("display","none")}function wppaAjaxUpdateTogo(n){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=gettogo&slug="+n,async:!0,type:"GET",timeout:1e5,beforeSend:function(e){wppaConsoleLog("Requesting togo for slug "+n,"force")},success:function(e,t,a){var p=e.split("|");jQuery("#"+n+"_togo").html(p[0]);e=jQuery("#"+n+"_status").html(),p=p[1];""!=e&&""==p&&(p='<input type="button" class="button-secundary" style="border-radius:3px;font-size:11px;height:18px;margin: 0 4px;padding:0px;color:red;background-color:pink;" onclick="document.location.reload(true)" value="Reload" />'),jQuery("#"+n+"_status").html(p),setTimeout(function(){wppaAjaxUpdateTogo(n)},1e3)},error:function(e){},complete:function(e){}})}function wppaIsEmpty(e){return(null==e||void 0===e||""==e||0==e)&&!0}function wppaTimedConfirm(e){var t={modal:!0,resizable:!1,width:400,show:{effect:"fadeIn",duration:800},closeText:"X",buttons:[{text:"NO",click:function(){jQuery(this).dialog("close")}},{text:"YES",click:function(){jQuery(this).dialog("close")}}]};jQuery("#wppa-modal-container").html(e).dialog(t).dialog("open"),jQuery(".ui-dialog").css({boxShadow:"0px 0px 5px 5px #aaaaaa",padding:"8px",backgroundColor:"#cccccc",boxSizing:"content-box",zIndex:"200200"}),jQuery(".ui-dialog-titlebar").css({lineHeight:"0px",height:"32px"}),jQuery(".ui-button").css({float:"right",position:"relative",bottom:"40px"}),jQuery(".ui-dialog-titlebar-close").css({display:"none"}),jQuery(".ui-widget-overlay").css({backgroundColor:"transparent"}),jQuery(".ui-button").attr("title",wppaCloseText),setTimeout(function(){jQuery(".ui-button").trigger("click")},6e4)}function wppaAjaxGetSpinnerHtml(e,p){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=update-option&wppa-option=getspinnerpreview&type="+e+"&wppa-nonce="+document.getElementById("wppa-nonce").value,async:!0,type:"GET",timeout:1e5,beforeSend:function(e){},success:function(e,t,a){e=e.split("|");jQuery("#"+p).html(e[0])},error:function(e){},complete:function(e){}})}function wppaDragHorizon(t){var a=0,p=0;function n(e){(e=e||window.event).preventDefault(),a=p-e.clientY,p=e.clientY,t.style.top=t.offsetTop-a+"px"}function o(){document.onmouseup=null,document.onmousemove=null}t.onmousedown=function(e){(e=e||window.event).preventDefault(),pos3=e.clientX,p=e.clientY,document.onmouseup=o,document.onmousemove=n}}function wppaBulkActionChange(e,t){wppa_setCookie("wppa_bulk_action",e.value,365),"wppa-bulk-move-to"==e.value||"wppa-bulk-copy-to"==e.value?jQuery("#wppa-bulk-album").css("display","inline"):jQuery("#wppa-bulk-album").css("display","none"),"wppa-bulk-status"==e.value?jQuery("#wppa-bulk-status").css("display","inline"):jQuery("#wppa-bulk-status").css("display","none"),"wppa-bulk-owner"==e.value?jQuery("#wppa-bulk-owner").css("display","inline"):jQuery("#wppa-bulk-owner").css("display","none")}function wppaBulkDoitOnClick(){var e=jQuery(".wppa-bulk-photo"),t=0;for(i=0;i<e.length;i++)e[i].checked&&t++;if(0==t)return alert("No photos selected"),!1;var a=document.getElementById("wppa-bulk-action").value;switch(a){case"":return alert("No action selected"),!1;case"wppa-bulk-delete":case"wppa-bulk-delete-immediate":case"wppa-bulk-undelete":break;case"wppa-bulk-move-to":case"wppa-bulk-copy-to":if(0==document.getElementById("wppa-bulk-album").value)return alert("No album selected"),!1;break;case"wppa-bulk-status":if(0==document.getElementById("wppa-bulk-status").value)return alert("No status selected"),!1;break;case"wppa-bulk-owner":if(0==documnet.getElementById("wppa-bulk-owner").value)return alert("No new owner selected"),!1;break;default:return alert("Unimplemented action requested: "+a),!1}return!0}function wppaSetThumbsize(e){e=e.value;wppa_setCookie("wppa_bulk_thumbsize",e,365),jQuery(".wppa-bulk-thumb").css("max-width",e+"px"),jQuery(".wppa-bulk-thumb").css("max-height",e/2+"px"),jQuery(".wppa-bulk-dec").css("height",e/2+"px")}function wppaToggleConfirmDelete(e){jQuery(e).prop("checked")?wppa_setCookie("wppaConfirmDelete","checked",365):wppa_setCookie("wppaConfirmDelete","unchecked",365)}function wppaToggleConfirmMove(e){jQuery(e).prop("checked")?wppa_setCookie("wppaConfirmMove","checked",365):wppa_setCookie("wppaConfirmMove","unchecked",365)}function wppaSetConfirmDelete(e){"checked"==wppa_getCookie("wppaConfirmDelete")?jQuery("#"+e).prop("checked",!0):jQuery("#"+e).prop("checked",!1)}function wppaSetConfirmMove(e){"checked"==wppa_getCookie("wppaConfirmMove")?jQuery("#"+e).prop("checked",!0):jQuery("#"+e).prop("checked",!1)}function wppaAjaxReplaceLog(){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=maintenancepopup&slug=wppa_list_errorlog&raw=1&wppa-nonce="+jQuery("#wppa-nonce").val(),async:!0,type:"GET",timeout:1e5,beforeSend:function(e){jQuery("#wppa-spinner").show()},success:function(e,t,a){e=wppaEntityDecode(e),jQuery("#wppa-logbody").html(e),jQuery("#wppa-spinner").hide()}})}function wppaTestAdminReady(){"complete"===document.readyState?jQuery("#wppa-admin-spinner").fadeOut():setTimeout("wppaTestAdminReady()",200)}function wppaCommentAdminUpdateHref(e){var t=encodeURIComponent(jQuery("#commenttext-"+e).val()),a=jQuery("#href-"+e).attr("href"),p=a.split("commenttext=");p[1]=t,a=p[0]+"commenttext="+p[1],jQuery("#href-"+e).attr("href",a),jQuery("#href-"+e).css("display","inline")}function wppaGetTinyMceContent(e){return"none"!=jQuery("#"+e).css("display")?jQuery("#"+e).val():tinymce.get(e).getContent()}function wppaInitMagick(t){var e,a,p;wppaCropper[t]||(e=document.querySelector("#fs-img-"+t),a=document.getElementById("button-"+t),p="ratio"==wppaImageMagickDefaultAspect?e.naturalWidth/e.naturalHeight:"NaN"==wppaImageMagickDefaultAspect?"":wppaImageMagickDefaultAspect,wppaCropper[t]=new Cropper(e,{zoomable:!1,viewMode:2,background:!1,dragMode:"move",responsive:!0,movable:!1,aspectRatio:p}),a.onclick=function(){var e=wppaCropper[t].getData(!0),e=e.width+"x"+e.height+(e.x<0?"-":"+")+e.x+(e.y<0?"-":"+")+e.y;wppaTryMagick(t,"crop",e)})}jQuery(document).ready(function(){var e;document.getElementById("wppa-bulk-action")&&(e=wppa_getCookie("wppa_bulk_action"),"wppa-bulk-move-to"!=(document.getElementById("wppa-bulk-action").value=e)&&"wppa-bulk-copy-to"!=e||(jQuery("#wppa-bulk-album").css("display","inline"),document.getElementById("wppa-bulk-album").value=wppa_getCookie("wppa_bulk_album")),"wppa-bulk-status"==e&&(jQuery("#wppa-bulk-status").css("display","inline"),document.getElementById("wppa-bulk-status").value=wppa_getCookie("wppa_bulk_status")),"wppa-bulk-owner"==e&&(jQuery("#wppa-bulk-owner").css("display","inline"),document.getElementById("wppa-bulk-owner").value=wppa_getCookie("wppa_bulk_owner")))}),jQuery(document).ready(function(){setTimeout("wppaTestAdminReady()",200)});
wppa-admin-styles.css CHANGED
@@ -1,7 +1,7 @@
1
  /* admin-styles.css
2
  *
3
  * wp-photo-album-plus
4
- * version 8.2.02.007
5
  */
6
  #files_list, #files_list2
7
  {
@@ -606,6 +606,18 @@ details.hidden {
606
  .wppa-flex div h4 {
607
  font-size: 1.2em;
608
  margin: 0 6px 0 0;
 
 
 
 
 
 
 
 
 
 
 
 
609
  }
610
 
611
  #wppa-action-container {
1
  /* admin-styles.css
2
  *
3
  * wp-photo-album-plus
4
+ * version 8.2.02.009
5
  */
6
  #files_list, #files_list2
7
  {
606
  .wppa-flex div h4 {
607
  font-size: 1.2em;
608
  margin: 0 6px 0 0;
609
+
610
+ padding: 0 8px;
611
+ line-height: 2;
612
+ min-height: 30px;
613
+
614
+ background: rgba(255, 255, 255, 0.5);
615
+ border-color: rgba(220, 220, 222, 0.75);
616
+ border-radius: 4px;
617
+ border-style: solid;
618
+ border-width: 1px;
619
+ box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
620
+ color: rgba(44, 51, 56, 0.5);
621
  }
622
 
623
  #wppa-action-container {
wppa-album-admin-autosave.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * create, edit and delete albums
6
- * Version 8.2.02.007
7
  *
8
  */
9
 
@@ -579,8 +579,7 @@ global $wppa_revno;
579
  </div>'); // end action-container
580
  /* End header */
581
 
582
- /* First details block - standard settings */
583
- {
584
  wppa_echo( '
585
  <details class="wppa-toplevel-details">
586
  <summary class="toplevel wppa-summary-toplevel"> ' .
@@ -595,1323 +594,1340 @@ global $wppa_revno;
595
  <br>' . __( 'The <b style="color:#070" >Remark</b> fields keep you informed on the actions taken at the background.', 'wp-photo-album-plus' ) . '
596
  </h2>' );
597
 
598
- // The edit albuminfo panel with border
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
599
  wppa_echo( '
600
  <div
601
  id="albumitem-' . $id . '"
602
- class="wppa-table-wrap"
603
- style="width:100%;position:relative;"
604
  >' );
605
 
606
  // Section 0: More or less static data
607
  {
608
- $result = '
609
- <!-- Album Section 0 static data -->
610
- <div class="wppa-flex">' .
611
-
612
- // Album number, crypt, timestamp and modified
613
- '<div>
614
- <label>' .
615
- __( 'Album number', 'wp-photo-album-plus' ) . '
616
- </label><br>
617
- <h4>' .
618
- $id . '
619
- </h4>
620
- </div>
621
- <div>
622
- <label>' .
623
- __( 'Crypt', 'wp-photo-album-plus' ) . '
624
- </label><br>
625
- <h4>' .
626
- $crypt . '
627
- </h4>
628
- </div>
629
- <div>
630
- <label>' .
631
- __( 'Created', 'wp-photo-album-plus' ) . '
632
- </label><br>
633
- <h4>' .
634
- wppa_local_date( '', $timestamp ) . '
635
- </h4>
636
- </div>
637
- <div>
638
- <label>' .
639
- __( 'Modified', 'wp-photo-album-plus' ) . '
640
- </label><br>
641
- <h4>';
642
- if ( $modified > $timestamp ) {
643
- $result .= wppa_local_date( '', $modified );
644
- }
645
- else {
646
- $result .= __( 'Not modified', 'wp-photo-album-plus' );
647
- }
648
- $result .= '
649
- </h4>
650
- </div>';
651
 
652
- // Views
653
- if ( wppa_switch( 'track_viewcounts' ) ) {
654
- $result .= '
 
 
 
 
 
 
655
  <div>
656
  <label>' .
657
- __( 'Album Views', 'wp-photo-album-plus' ) . '
658
  </label><br>
659
  <h4>' .
660
- $views . '
661
  </h4>
662
  </div>
663
  <div>
664
  <label>' .
665
- __( 'Photo views', 'wp-photo-album-plus' ) . '
666
  </label><br>
667
  <h4>' .
668
- $pviews . '
 
 
 
 
 
 
 
 
 
 
 
 
 
 
669
  </h4>
670
  </div>';
671
- if ( $nsub ) {
 
 
672
  $result .= '
673
  <div>
674
  <label>' .
675
- __( 'Inc subalbums', 'wp-photo-album-plus' ) . '
 
 
 
 
 
 
 
 
676
  </label><br>
677
  <h4>' .
678
- $tpviews . '
679
  </h4>
680
  </div>';
 
 
 
 
 
 
 
 
 
 
 
681
  }
682
- }
683
 
684
- // Clicks
685
- if ( wppa_switch( 'track_clickcounts' ) ) {
686
- $click_arr = $wpdb->get_col( "SELECT clicks FROM $wpdb->wppa_photos WHERE album = $id" );
687
- $result .= '
688
- <div>
689
- <label>' .
690
- __( 'Clicks:', 'wp-photo-album-plus' ) . '
691
- </label><br>
692
- <h4>' .
693
- array_sum( $click_arr ) . '
694
- </h4>
695
- </div>';
696
- }
697
 
698
- $result .= '</div>';
699
- wppa_echo( $result );
700
  }
701
 
702
  // Section 1: Short settable items
703
  {
704
- wppa_echo( '
705
- <!-- Album Section 1 simple settings -->
706
- <div class="wppa-flex">' );
707
 
708
- // Owner
709
- {
710
- $result = '
711
- <div>
712
- <label
713
- for="albumowner">' .
714
- __( 'Owned by:', 'wp-photo-album-plus' ) . '
715
- </label><br>';
716
-
717
- if ( ! wppa_user_is( 'administrator' ) ) {
718
- if ( $owner == '--- public ---' ) {
719
- $result .= __( '--- public ---', 'wp-photo-album-plus' );
720
- }
721
- else {
722
- $result .= $owner;
723
- }
724
- }
725
- else {
726
- if ( wppa_get_user_count() > wppa_opt( 'max_users' ) ) {
727
- $result .= '
728
- <input
729
- id="albumowner"
730
- type="text"
731
- value="' . esc_attr( $owner ) . '"
732
- onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'owner\', this )"
733
- />';
734
- }
735
- else {
736
- if ( wppa_switch( 'user_upload_on' ) ) {
737
  if ( $owner == '--- public ---' ) {
738
- $title = __( 'Frontend upload to this album is open to visitors', 'wp-photo-album-plus' );
739
  }
740
  else {
741
- $title = __( 'Frontend upload to this album is open for the owner and the admin', 'wp-photo-album-plus' );
742
  }
743
  }
744
  else {
745
- $title = '';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
746
  }
747
- $result .= '
748
- <select
749
- id="albumowner"
750
- onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'owner\', this )"
751
- style="max-width:200px;"
752
- title="' . esc_attr( $title ) . '"
753
- >' .
754
- wppa_get_user_select( $owner ) . '
755
- </select>';
756
- }
757
  }
758
- $result .= '
759
- </div>';
760
- wppa_echo( $result );
761
- }
762
 
763
- // Order # -->
764
- {
765
- wppa_echo( '
766
- <div>
767
- <label
768
- for="albumseqno">' .
769
- __( 'Sequence number', 'wp-photo-album-plus' ) . '
770
- </label><br>
771
- <input
772
- id="albumseqno"
773
- type="text"
774
- style="width:50px;cursor:pointer"
775
- onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'a_order\', this )"
776
- value="' . esc_attr( $a_order ) . '"' .
777
- ( wppa_opt( 'list_albums_by' ) != '1' && $a_order != '0' ? ' title="' . esc_attr( __( 'Album sequence number has only effect if you set the album sort order method to Order # in the Photo Albums -> Settings screen.', 'wp-photo-album-plus' )) . '"' : '' ) . '
778
- />&nbsp;
779
- </div>' );
780
- }
781
-
782
- // Status
783
- {
784
- $title = __( 'Set the frontend visibility of the album cover and items not including subalbums.', 'wp-photo-album-plus' ) . ' ' .
785
- __( 'Publish: visible for all, Private: visible for logged in only, Hidden: visible for admin only', 'wp-photo-album-plus' );
786
 
787
- wppa_echo( '
788
- <div>
789
- <label
790
- for="albumstatus">' .
791
- __( 'Status', 'wp-photo-album-plus' ) . '
792
- </label><br>
793
- <select
794
- style="max-width:200px;"
795
- id="albumstatus"
796
- onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'status\', this )"
797
- title="' . esc_attr( $title ) . '" >
798
- <option value="publish"' . ( $status == 'publish' ? ' selected' : '' ) . '>' .
799
- __( 'Publish', 'wp-photo-album-plus' ) . '
800
- </option>
801
- <option value="private"' . ( $status == 'private' ? ' selected' : '' ) . '>' .
802
- __( 'Private', 'wp-photo-album-plus' ) . '
803
- </option>
804
- <option value="hidden"' . ( $status == 'hidden' ? ' selected' : '' ) . '>' .
805
- __( 'Hidden', 'wp-photo-album-plus' ) . '
806
- </option>
807
- </select>
808
- </div>' );
809
- }
810
 
811
- // Parent
812
- {
813
- $result = '
814
- <div>
815
- <label
816
- for="wppa-parsel">' .
817
- __( 'Parent album', 'wp-photo-album-plus' ) . '
818
- </label><br>';
819
- if ( wppa_extended_access() ) {
820
- $result .=
821
- wppa_album_select_a( array( 'checkaccess' => true,
822
- 'exclude' => $id,
823
- 'selected' => $a_parent,
824
- 'addselected' => true,
825
- 'addnone' => true,
826
- 'addseparate' => true,
827
- 'disableancestors' => true,
828
- 'path' => true,
829
- 'sort' => true,
830
- 'tagopen' => '<select' .
831
- ' id="wppa-parsel"' .
832
- ' style="max-width:200px;"' .
833
- ' onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'a_parent\', this )"' .
834
- ' >',
835
- 'tagid' => 'wppa-parsel',
836
- 'tagonchange' => 'wppaAjaxUpdateAlbum( ' . $id . ', \'a_parent\', this )',
837
- 'tagstyle' => 'font-size:13px;height:20px;cursor:pointer;',
838
- )
839
- ) .
840
- '</select>';
841
  }
842
- else {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
843
  $result .= '
844
- <select
845
- id="wppa-parsel"
846
- style="max-width:200px;"
847
- onchange="wppaAjaxUpdateAlbum( '. $id . ', \'a_parent\', this )"
848
- >' .
849
- wppa_album_select_a( array( 'checkaccess' => true,
850
- 'exclude' => $id,
851
- 'selected' => $a_parent,
852
- 'addnone' => wppa_can_create_top_album(),
853
- 'addselected' => true,
854
- 'disableancestors' => true,
855
- 'path' => true,
856
- 'sort' => true,
857
- )
858
- ) .
859
- '</select>';
860
  }
861
- $result .= '
862
- </div>';
863
- wppa_echo( $result );
864
- }
865
 
866
- // P-order-by
867
- if ( ! wppa_switch( 'porder_restricted' ) || wppa_user_is( 'administrator' ) ) {
868
- $result = '
869
- <div
870
- style="max-width: 200px;margin-right: 4px;">
871
- <label
872
- for="photo-order"
873
- >' .
874
-
875
- __( 'Photo order:', 'wp-photo-album-plus' ) . '
876
- </label><br>';
877
- $options = array( __( '--- default ---', 'wp-photo-album-plus' ),
878
- __( 'Order #', 'wp-photo-album-plus' ),
879
- __( 'Name', 'wp-photo-album-plus' ),
880
- __( 'Random', 'wp-photo-album-plus' ),
881
- __( 'Rating mean value', 'wp-photo-album-plus' ),
882
- __( 'Number of votes', 'wp-photo-album-plus' ),
883
- __( 'Timestamp', 'wp-photo-album-plus' ),
884
- __( 'EXIF Date', 'wp-photo-album-plus' ),
885
- __( 'Order # desc', 'wp-photo-album-plus' ),
886
- __( 'Name desc', 'wp-photo-album-plus' ),
887
- __( 'Rating mean value desc', 'wp-photo-album-plus' ),
888
- __( 'Number of votes desc', 'wp-photo-album-plus' ),
889
- __( 'Timestamp desc', 'wp-photo-album-plus' ),
890
- __( 'EXIF Date desc', 'wp-photo-album-plus' )
891
- );
892
- $values = array( '0',
893
- '1',
894
- '2',
895
- '3',
896
- '4',
897
- '6',
898
- '5',
899
- '7',
900
- '-1',
901
- '-2',
902
- '-4',
903
- '-6',
904
- '-5',
905
- '-7'
906
- );
907
 
908
- $dflt = '';
909
- $df = wppa_opt( 'list_photos_by' );
910
- if ( $df == '0' ) $dflt = __( 'not specified', 'wp-photo-album-plus' );
911
- else foreach( array_keys( $values ) as $key ) {
912
- if ( $df == $values[$key] ) {
913
- $dflt = $options[$key];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
914
  }
915
- }
916
- $title = sprintf( __( 'The default is set in %s and is currently set to %s', 'wp-photo-album-plus' ), wppa_setting_path( 'b', 'misc', 1, 2 ), $dflt );
917
 
918
- $result .= '
919
- <select
920
- id="photo-order"
921
- style="max-width:200px;"
922
- onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'p_order_by\', this )"
923
- title="' . esc_attr( $title ) . '"
924
- >';
925
- foreach ( array_keys( $options ) as $key ) {
926
- $sel = $values[$key] == $p_order_by ? ' selected' : '';
927
- $result .= '<option value="' . $values[$key] . '"' . $sel . '>' . $options[$key] . '</option>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
928
  }
929
- $result .= '
930
- </select>
931
- </div>';
932
- wppa_echo( $result );
933
- }
934
 
935
- // Subalbum order
936
- {
937
- $sel = ' selected';
938
- $opts = array(
939
- __( '--- default ---', 'wp-photo-album-plus' ),
940
- __( 'Random', 'wp-photo-album-plus' ),
941
- __( 'Order #', 'wp-photo-album-plus' ),
942
- __( 'Order # reverse', 'wp-photo-album-plus' ),
943
- __( 'Name', 'wp-photo-album-plus' ),
944
- __( 'Name reverse', 'wp-photo-album-plus' ),
945
- __( 'Timestamp', 'wp-photo-album-plus' ),
946
- __( 'Timestamp reverse', 'wp-photo-album-plus' ),
947
- );
948
- $vals = array( '0', '3', '1', '-1', '2', '-2', '5', '-5' );
949
 
950
- $df = wppa_opt( 'list_albums_by' );
951
- if ( $df == '0' ) $dflt = __( 'not specified', 'wp-photo-album-plus' );
952
- else foreach( array_keys( $vals ) as $key ) {
953
- if ( $df == $vals[$key] ) {
954
- $dflt = $opts[$key];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
955
  }
956
- }
957
 
958
- $title = sprintf( __( 'The default is set in %s and is currently set to %s', 'wp-photo-album-plus' ), wppa_setting_path( 'b', 'misc', 1, 1 ), $dflt );
959
-
960
- $result = '
961
- <div>
962
- <label
963
- for="subalbumorder">' .
964
- __( 'Subalbum sort order', 'wp-photo-album-plus' ) . '
965
- </label><br>
966
- <select
967
- id="subalbumorder"
968
- style="max-width:200px;"
969
- onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'suba_order_by\', this )"
970
- title="' . esc_attr( $title ) . '"
971
- >';
972
- for ( $i = 0; $i < 7; $i++ ) {
973
- $result .= '<option value="' . esc_attr( $vals[$i] ) . '" ' . ( $suba_order_by == $vals[$i] ? $sel : '' ) . ' >' . $opts[$i] . '</option>';
974
- }
975
- $result .= '
976
- </select>
977
- </div>';
978
- wppa_echo( $result );
979
- }
980
 
981
- // Alternative thumbnail size
982
- if ( ! wppa_switch( 'alt_is_restricted' ) || wppa_user_is( 'administrator' ) ) {
983
- $title = sprintf( __( 'The alternate thumbnail size is set in %s and is currently set to %s', 'wp-photo-album-plus' ), wppa_setting_path( 'b', 'thumbs', 1, 2 ), wppa_opt( 'thumbsize_alt' ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
984
 
985
- $sel = ' selected';
986
- wppa_echo( '
987
- <div
988
- style="max-width: 200px;margin-right: 4px;">
989
- <label
990
- for="altthumb">' .
991
- __( 'Use alt thumbsize', 'wp-photo-album-plus' ) . '
992
- </label><br>
993
- <select
994
- id="altthumb"
995
- onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'alt_thumbsize\', this )"
996
- title="' . esc_attr( $title ) . '"
997
- >
998
- <option value="0"' . ( $alt_thumbsize ? '' : $sel ) . ' >' .
999
- __( 'no', 'wp-photo-album-plus' ) . '
1000
- </option>
1001
- <option value="yes"' . ( $alt_thumbsize ? $sel : '' ) . ' >' .
1002
- __( 'yes', 'wp-photo-album-plus' ) . '
1003
- </option>
1004
- </select>
1005
- </div>' );
1006
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1007
 
1008
- // Cover type
1009
- if ( ! wppa_switch( 'covertype_is_restricted' ) || wppa_user_is( 'administrator' ) ) {
1010
- $sel = ' selected';
1011
- $title = sprintf( __( 'The default is set in %s and is currently set to %s', 'wp-photo-album-plus' ), wppa_setting_path( 'b', 'covers', 3, 4 ), wppa_opt( 'cover_type' ) );
 
 
 
 
 
 
1012
 
1013
- wppa_echo( '
1014
- <div
1015
- style="max-width: 200px;margin-right: 4px;">
1016
- <label
1017
- for="covertype">' .
1018
- __( 'Cover&nbsp;Type', 'wp-photo-album-plus' ) . '
1019
- </label><br>
1020
- <select
1021
- id="covertype"
1022
- style="max-width:200px;"
1023
- onchange="wppaAjaxUpdateAlbum( '. $id . ', \'cover_type\', this )"
1024
- title="' . esc_attr( $title ) . '"
1025
- >
1026
- <option value=""' . ( $cover_type == '' ? $sel : '' ) . ' >' .
1027
- __( '--- default ---', 'wp-photo-album-plus' ) . '
1028
- </option>
1029
- <option value="default"' . ( $cover_type == 'default' ? $sel : '' ) . ' >' .
1030
- __( 'Standard', 'wp-photo-album-plus' ) . '
1031
- </option>
1032
- <option value="longdesc"' . ( $cover_type == 'longdesc' ? $sel : '' ) . ' >' .
1033
- __( 'Long Descriptions', 'wp-photo-album-plus' ) . '
1034
- </option>
1035
- <option value="imagefactory"' . ( $cover_type == 'imagefactory' ? $sel : '' ) . ' >' .
1036
- __( 'Image Factory', 'wp-photo-album-plus' ) . '
1037
- </option>
1038
- <option value="default-mcr"' . ( $cover_type == 'default-mcr' ? $sel : '' ) . ' >' .
1039
- __( 'Standard mcr', 'wp-photo-album-plus' ) . '
1040
- </option>
1041
- <option value="longdesc-mcr"' . ( $cover_type == 'longdesc-mcr' ? $sel : '' ) . ' >' .
1042
- __( 'Long Descriptions mcr', 'wp-photo-album-plus' ) . '
1043
- </option>
1044
- <option value="imagefactory-mcr"' . ( $cover_type == 'imagefactory-mcr' ? $sel : '' ) . ' >' .
1045
- __( 'Image Factory mcr', 'wp-photo-album-plus' ) . '
1046
- </option>
1047
- </select>
1048
- </div>' );
1049
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1050
 
1051
- // Cover photo
1052
- {
1053
- wppa_echo( '
1054
- <div>
1055
- <label>' .
1056
- __( 'Cover&nbsp;Photo:', 'wp-photo-album-plus' ) . '
1057
- </label><br>' .
1058
- wppa_main_photo( $main_photo, $cover_type ) . '
1059
- </div>' );
1060
- }
 
 
 
 
 
 
 
 
 
 
 
1061
 
1062
- // Upload limit
1063
- {
1064
- $result = '
1065
- <div>
1066
- <label
1067
- for="upload_limit_count">' .
1068
- __( 'Upload limit:', 'wp-photo-album-plus' ) . '
1069
- </label><br>';
1070
- $lims = explode( '/', $upload_limit );
1071
- if ( ! is_array( $lims ) ) {
1072
- $lims = array( '0', '0' );
1073
  }
1074
- if ( wppa_user_is( 'administrator' ) ) {
1075
- $sel = ' selected';
1076
- $title = __( 'Set the upload limit (0 means unlimited).', 'wp-photo-album-plus' );
1077
- $result .= '
1078
- <input
1079
- type="text"
1080
- id="upload_limit_count"
1081
- value="' . $lims[0] . '"
1082
- style="max-width:50px;cursor:pointer;"
1083
- title="' . esc_attr( $title ) . '"
1084
- onchange="wppaRefreshAfter(); wppaAjaxUpdateAlbum( ' . $id . ', \'upload_limit_count\', this )"
1085
- />
1086
- <select
1087
- style="max-width:150px;vertical-align:baseline"
1088
- onchange="wppaRefreshAfter(); wppaAjaxUpdateAlbum( ' . $id . ', \'upload_limit_time\', this )" >
1089
- <option value="0"' . ( $lims[1] == '0' ? $sel : '' ) . ' >' . __( 'for ever', 'wp-photo-album-plus' ) . '</option>
1090
- <option value="3600"' . ( $lims[1] == '3600' ? $sel : '' ) . ' >' . __( 'per hour', 'wp-photo-album-plus' ) . '</option>
1091
- <option value="86400"' . ( $lims[1] == '86400' ? $sel : '' ) . ' >' . __( 'per day', 'wp-photo-album-plus' ) . '</option>
1092
- <option value="604800"' . ( $lims[1] == '604800' ? $sel : '' ) . ' >' . __( 'per week', 'wp-photo-album-plus' ) . '</option>
1093
- <option value="2592000"' . ( $lims[1] == '2592000' ? $sel : '' ) . ' >' . __( 'per month', 'wp-photo-album-plus' ) . '</option>
1094
- <option value="31536000"' . ( $lims[1] == '31536000' ? $sel : '' ) . ' >' . __( 'per year', 'wp-photo-album-plus' ) . '</option>
1095
- </select>';
1096
  }
1097
- else {
1098
- if ( $lims[0] == '0' ) {
1099
- $result .= __( 'Unlimited', 'wp-photo-album-plus' );
 
 
1100
  }
1101
- else {
1102
- $result .= $lims[0] . '&nbsp;';
1103
- switch ( $lims[1] ) {
1104
- case '3600': $result .= __( 'per hour', 'wp-photo-album-plus' ); break;
1105
- case '86400': $result .= __( 'per day', 'wp-photo-album-plus' ); break;
1106
- case '604800': $result .= __( 'per week', 'wp-photo-album-plus' ); break;
1107
- case '2592000': $result .= __( 'per month', 'wp-photo-album-plus' ); break;
1108
- case '31536000': $result .= __( 'per year', 'wp-photo-album-plus' ); break;
1109
- default: $result .= sprintf( 'per %d seconds', $lims[1] );
1110
  }
1111
  }
1112
- $result .= '. ';
 
1113
  }
1114
- $result .= '
1115
- </div>';
1116
- wppa_echo( $result );
1117
- }
1118
 
1119
- // Tree limit
1120
- {
1121
- $title = __( 'The upload limit for this album and all its (grand)children.', 'wp-photo-album-plus' ) . ' ' .
1122
- __( 'This setting overrules all other limits that may apply to this album or its (grand)children.', 'wp-photo-album-plus' ) . ' ' .
1123
- __( '0 means no limit.', 'wp-photo-album-plus' );
1124
- wppa_echo( '
1125
- <div>
1126
- <label
1127
- for="uploadlimittree">' .
1128
- __( 'Tree upload limit', 'wp-photo-album-plus' ) . '
1129
- </label><br>
1130
- <input
1131
- type="text"
1132
- id="uploadlimittree"
1133
- title="' . esc_attr( $title ) . '"
1134
- value="' . $tree_limit . '"
1135
- onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'upload_limit_tree\', this )"
1136
- style="cursor:pointer;max-width:50px;"
1137
- />
1138
- </div>' );
1139
- }
 
 
1140
 
1141
- // Need this the next 5 items
1142
- $yes = __( 'yes', 'wp-photo-album-plus' );
1143
- $no = __( 'no', 'wp-photo-album-plus' );
1144
- $def = __( 'default', 'wp-photo-album-plus' );
 
 
1145
 
1146
- // Zoomable
1147
- {
1148
- $title = __( 'When set other than default, this setting will overrule the default settings.', 'wp-photo-album-plus' ) . ' ' .
1149
- sprintf( __( 'The default is set in %s and is currently %s', 'wp-photo-album-plus' ), wppa_setting_path( 'b', 'photos', 1, 4 ), ( wppa_switch( 'zoom_on' ) ? $yes : $no ) );
 
 
 
 
 
 
 
 
 
 
 
 
1150
 
1151
- wppa_echo( '
1152
- <div>
1153
- <label
1154
- for="zoomable">' .
1155
- __( 'Photos are zoomable:', 'wp-photo-album-plus' ) . '
1156
- </label><br>
1157
- <select
1158
- id="zoomable"
1159
- onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'zoomable\', this )"
1160
- title="' . esc_attr( $title ) . '" >
1161
- <option value=""'.($zoomable==''?' selected': '').'>' . $def . '</option>
1162
- <option value="on"'.($zoomable=='on'?' selected': '').'>' . $yes . '</option>
1163
- <option value="off"'.($zoomable=='off'?' selected': '').'>' . $no . '</option>
1164
- </select>
1165
- </div>' );
1166
- }
1167
 
1168
- // Overrulable display options / next 4 items
1169
- if ( $displayopts ) {
1170
- $disp_opt = explode( ',', $displayopts );
1171
- }
1172
- for ( $i = 0; $i < 4; $i++ ) {
1173
- if ( ! isset( $disp_opt[$i] ) ) {
1174
- $disp_opt[$i] = '0';
 
 
 
 
 
 
 
 
1175
  }
1176
- }
1177
 
1178
- $title_head = __( 'When set other than default, this setting will overrule the default settings.', 'wp-photo-album-plus' ) . '&#013;' .
1179
- __( 'The defaults are set in', 'wp-photo-album-plus' ). ':&#013;';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1180
 
1181
- // Display name
1182
- {
1183
- $title = $title_head .
1184
- wppa_setting_path( 'b', 'slide', 1, 17, wppa_switch( 'show_full_name' ) ? $yes : $no ) . ',&#013;' .
1185
- wppa_setting_path( 'b', 'thumbs', 2, 1, wppa_switch( 'thumb_text_name' ) ? $yes : $no ) . ' ' . __( 'and' , 'wp-photo-album-plus' ) . '&#013;' .
1186
- wppa_setting_path( 'b', 'lightbox', 1, 3, wppa_switch( 'ovl_name' ) ? $yes : $no ) . '.';
1187
 
1188
- wppa_echo( '
1189
- <div>
1190
- <label
1191
- for="showname">' .
1192
- __( 'Show names:', 'wp-photo-album-plus' ) . '
1193
- </label><br>
1194
- <select
1195
- id="showname"
1196
- onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'displayopt0\', this )"
1197
- title="' . esc_attr( $title ) . '">
1198
- <option value="0"'.($disp_opt[0]=='0'?' selected': '').'>' . $def . '</option>
1199
- <option value="1"'.($disp_opt[0]=='1'?' selected': '').'>' . $yes . '</option>
1200
- <option value="-1"'.($disp_opt[0]=='-1'?' selected': '').'>' . $no . '</option>
1201
- </select>
1202
- </div>' );
1203
- }
 
 
 
 
 
 
 
 
 
 
 
 
1204
 
1205
- // Display description
1206
- {
1207
- $title = $title_head .
1208
- wppa_setting_path( 'b', 'slide', 1, 20, wppa_switch( 'show_full_desc' ) ? $yes : $no ) . ',&#013;' .
1209
- wppa_setting_path( 'b', 'thumbs', 2, 3, wppa_switch( 'thumb_text_desc' ) ? $yes : $no ) . ' ' . __( 'and' , 'wp-photo-album-plus' ) . '&#013;' .
1210
- wppa_setting_path( 'b', 'lightbox', 1, 4, wppa_switch( 'ovl_desc' ) ? $yes : $no ) . '.';
1211
 
1212
- wppa_echo( '
1213
- <div>
1214
- <label
1215
- for="showdesc">' .
1216
- __( 'Show descriptions:', 'wp-photo-album-plus' ) . '
1217
- </label><br>
1218
- <select
1219
- id="showdesc"
1220
- onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'displayopt1\', this )"
1221
- title="' . esc_attr( $title ) . '" >
1222
- <option value="0"'.($disp_opt[1]=='0'?' selected': '').'>' . $def . '</option>
1223
- <option value="1"'.($disp_opt[1]=='1'?' selected': '').'>' . $yes . '</option>
1224
- <option value="-1"'.($disp_opt[1]=='-1'?' selected': '').'>' . $no . '</option>
1225
- </select>
1226
- </div>' );
1227
- }
 
 
 
 
 
 
 
 
 
 
1228
 
1229
- // Display rating
1230
- {
1231
- $title = $title_head .
1232
- wppa_setting_path( 'b', 'general', 1, 5, wppa_switch( 'rating_on' ) ? $yes : $no ) . ',&#013;' .
1233
- wppa_setting_path( 'b', 'thumbs', 2, 3, wppa_switch( 'thumb_text_rating' ) ? $yes : $no ) . ' ' . __( 'and' , 'wp-photo-album-plus' ) . '&#013;' .
1234
- wppa_setting_path( 'b', 'lightbox', 1, 5, wppa_switch( 'ovl_rating' ) ? $yes : $no ) . '.';
1235
 
 
 
1236
  wppa_echo( '
1237
- <div>
1238
- <label
1239
- for="showrating">' .
1240
- __( 'Show rating:', 'wp-photo-album-plus' ) . '
1241
- </label><br>
1242
- <select
1243
- id="showrating"
1244
- onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'displayopt2\', this )"
1245
- title="' . esc_attr( $title ) . '" >
1246
- <option value="0"'.($disp_opt[2]=='0'?' selected': '').'>' . $def . '</option>
1247
- <option value="1"'.($disp_opt[2]=='1'?' selected': '').'>' . $yes . '</option>
1248
- <option value="-1"'.($disp_opt[2]=='-1'?' selected': '').'>' . $no . '</option>
1249
- </select>
1250
- </div>' );
1251
- }
1252
-
1253
- // Display comments
1254
- {
1255
- $title = $title_head .
1256
- wppa_setting_path( 'b', 'general', 1, 4, wppa_switch( 'show_comments' ) ? $yes : $no ) . ' ' . __( 'and' , 'wp-photo-album-plus' ) . '&#013;' .
1257
- wppa_setting_path( 'b', 'thumbs', 2, 4, wppa_switch( 'thumb_text_comcount' ) ? $yes : $no ) . '.';
1258
 
 
 
1259
  wppa_echo( '
1260
- <div>
1261
- <label
1262
- for="showcomments">' .
1263
- __( 'Show comments:', 'wp-photo-album-plus' ) . '
1264
- </label><br>
1265
- <select
1266
- id="showcomments"
1267
- onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'displayopt3\', this )"
1268
- title="' . esc_attr( $title ) . '" >
1269
- <option value="0"'.($disp_opt[3]=='0'?' selected': '').'>' . $def . '</option>
1270
- <option value="1"'.($disp_opt[3]=='1'?' selected': '').'>' . $yes . '</option>
1271
- <option value="-1"'.($disp_opt[3]=='-1'?' selected': '').'>' . $no . '</option>
1272
- </select>
1273
- </div>' );
1274
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1275
 
1276
- // Watermark
1277
- {
1278
- if ( wppa_switch( 'watermark_on' ) ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1279
 
1280
- wppa_echo( '
1281
- <div
1282
- style="max-width: 200px;margin-right: 4px;">
1283
- <label
1284
- for="watermarkfile">' .
1285
- __( 'Watermark file:', 'wp-photo-album-plus' ) . '
1286
- </label><br>
1287
- <select
1288
- id="watermarkfile"
1289
- style="max-width:200px"
1290
- onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'wmfile\', this )" >' .
1291
- wppa_watermark_file_select( 'album', $id ) . '
1292
- </select>
1293
- </div>
1294
- <div
1295
- style="max-width: 200px;margin-right: 4px;">
1296
- <label
1297
- for="watermarkpos">' .
1298
- __( 'Watermark pos:', 'wp-photo-album-plus' ) . '
1299
- </label><br>
1300
- <select
1301
- id="watermarkpos"
1302
- style="max-width:200px"
1303
- onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'wmpos\', this )" >' .
1304
- wppa_watermark_pos_select( 'album', $id ) . '
1305
- </select>
1306
- </div>' );
1307
- }
1308
- }
1309
-
1310
- // Schedule for delete
1311
- {
1312
- if ( wppa_user_is( 'administrator' ) || $owner == wppa_get_user() ) {
1313
- $may_change = wppa_user_is( 'administrator' ) || current_user_can( 'wppa_moderate' );
1314
-
1315
- wppa_echo( '
1316
- <div
1317
- style="max-width: 500px;margin-right: 4px;">
1318
- <label
1319
- for="scheduledel">' .
1320
- __( 'Delete at', 'wp-photo-album-plus' ) . '
1321
- </label><br>
1322
- <input
1323
- type="checkbox"
1324
- id="scheduledel"' .
1325
- ( $scheduledel ? ' checked="checked"' : '' ) .
1326
- ( $may_change ? '' : ' disabled' ) . '
1327
- onchange="wppaChangeScheduleDelAlbum( ' . $id . ', this );"
1328
- />
1329
- <input type="hidden" value="" id="wppa-dummy-del" />
1330
- <span
1331
- class="wppa-datetimedel-' . $id . '"' .
1332
- ( $albuminfo['scheduledel'] ? '' : ' style="display:none"' ) . '
1333
- >' .
1334
- wppa_get_date_time_select_html( 'delalbum', $id, $may_change ) . '
1335
- </span>
1336
- </div>' );
1337
- }
1338
- }
1339
-
1340
- }
1341
-
1342
- // End Section 1: Short settable items, wppa-flex div
1343
- wppa_echo( '</div>' );
1344
-
1345
- // Status - Remark - field
1346
- wppa_echo( '
1347
- <h3 style="margin-left:1em">' .
1348
- esc_html__( 'Remark', 'wp-photo-album-plus' ) . ':&nbsp;
1349
- <span
1350
- id="albumstatus-' . $id . '"
1351
- style="font-weight:bold;color:#00AA00">' .
1352
- esc_html( $remark ) . '
1353
- </span>
1354
- </h3>' );
1355
-
1356
- // Section 2: name, description, custom, links
1357
- {
1358
- wppa_echo( '
1359
- <!-- Album Section 2 -->
1360
- <table class="wppa-table wppa-album-table">
1361
- <tbody>' );
1362
-
1363
- // Name
1364
- {
1365
- wppa_echo( '
1366
- <tr>
1367
- <td>' .
1368
- __( 'Name:', 'wp-photo-album-plus' ) . '
1369
- </td>
1370
- <td>
1371
- <input
1372
- type="text"
1373
- style="width:100%;"
1374
- onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'name\', this )"
1375
- value="' . esc_attr( $name ) . '"
1376
- />
1377
- <span class="description" >' .
1378
- __( 'Type the name of the album. Do not leave this empty.', 'wp-photo-album-plus' ) . '
1379
- </span>
1380
- <span style="float:right">' .
1381
- __( 'Name slug', 'wp-photo-album-plus' ) . ': ' . $sname . '
1382
- </span>
1383
- </td>
1384
- <td>
1385
- </td>
1386
- </tr>' );
1387
- }
1388
 
1389
- // Description
1390
- {
1391
- wppa_echo( '
1392
- <tr>
1393
- <td>' .
1394
- __( 'Description:', 'wp-photo-album-plus' ) . '
1395
- </td>
1396
- <td>' );
 
 
1397
 
1398
- // WP Editor
1399
- if ( wppa_switch( 'use_wp_editor') ) {
 
 
 
 
1400
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1401
 
1402
- // Echos itsself, has no return option
1403
- wp_editor( $description,
1404
- 'wppaalbumdesc',
1405
- array( 'wpautop' => true,
1406
- 'media_buttons' => false,
1407
- 'textarea_rows' => '6',
1408
- 'tinymce' => true
1409
- )
1410
- );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1411
 
1412
- wppa_echo( '
1413
- <input
1414
- type="button"
1415
- class="button button-secundary"
1416
- value="' . esc_attr( __( 'Update Album description', 'wp-photo-album-plus' ) ) . '"
1417
- onclick="wppaAjaxUpdateAlbum( ' . $id . ', \'description\', wppaGetTinyMceContent(\'wppaalbumdesc\') )"
1418
- />
1419
- <img
1420
- id="wppa-album-spin"
1421
- src="' . wppa_get_imgdir() . 'spinner.gif"
1422
- alt="Spin"
1423
- style="visibility:hidden"
1424
- />' );
1425
  }
1426
-
1427
- // Textarea
1428
  else {
1429
- wppa_echo( '
1430
- <textarea
1431
- style="width:100%;height:60px;"
1432
- onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'description\', this )"
1433
- >' .
1434
- esc_textarea( stripslashes( $description ) ) . '
1435
- </textarea>' );
1436
  }
1437
-
1438
- wppa_echo( '
1439
- </td>
1440
- <td>
1441
- </td>
1442
- </tr>' );
1443
- }
1444
-
1445
- // Categories
1446
- {
1447
- $result = '
1448
- <tr>
1449
- <td>' .
1450
- __( 'Categories:', 'wp-photo-album-plus' ) . '
1451
- </td>
1452
- <td>
1453
- <input
1454
- id="cats"
1455
- type="text"
1456
- style="width:100%;"
1457
- onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'cats\', this )"
1458
- value="' . esc_attr( $cats ) . '"
1459
- />
1460
- <br>
1461
- <span class="description" >' .
1462
- __( 'Separate categories with commas.', 'wp-photo-album-plus' ) . '
1463
- </span>
1464
- <select
1465
- onchange="wppaAddCat( this.value, \'cats\' ); wppaAjaxUpdateAlbum( ' . $id . ', \'cats\', document.getElementById( \'cats\' ) )"
1466
- >';
1467
- $catlist = wppa_get_catlist();
1468
- if ( is_array( $catlist ) ) {
1469
  $result .= '
1470
- <option value="" >' . __( '- select to add -', 'wp-photo-album-plus' ) . '</option>';
1471
- foreach ( $catlist as $cat ) {
1472
- $result .= '
1473
- <option value="' . esc_attr( $cat['cat'] ) . '" >' . htmlspecialchars( $cat['cat'] ) . '</option>';
1474
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1475
  }
1476
- else {
1477
- $result .= '
1478
- <option value="0" >' . __( 'No categories yet', 'wp-photo-album-plus' ) . '</option>';
1479
- }
1480
- $result .= '
1481
- </select>
1482
- </td>
1483
- <td>
1484
- </td>
1485
- </tr>';
1486
- wppa_echo( $result );
1487
- }
1488
-
1489
- // Default photo tags
1490
- {
1491
- wppa_echo( '
1492
- <tr>
1493
- <td>
1494
- ' . __( 'Default photo tags:', 'wp-photo-album-plus' ) . '
1495
- </td>
1496
- <td>
1497
- <input
1498
- type="text"
1499
- id="default_tags"
1500
- value="' . esc_attr( $default_tags ) . '"
1501
- style="width:100%"
1502
- onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'default_tags\', this )"
1503
- />
1504
- <br>
1505
- <span class="description">' .
1506
- __( 'Enter the tags that you want to be assigned to new photos in this album.', 'wp-photo-album-plus' ) . '
1507
- </span>
1508
- </td>
1509
- <td>
1510
- </td>
1511
- </tr>' );
1512
- }
1513
-
1514
- // Custom
1515
- if ( wppa_switch( 'album_custom_fields' ) ) {
1516
- $result = '';
1517
- $custom = wppa_get_album_item( $edit_id, 'custom' );
1518
- if ( $custom ) {
1519
- $custom_data = wppa_unserialize( $custom );
1520
- }
1521
- else {
1522
- $custom_data = array( '', '', '', '', '', '', '', '', '', '' );
1523
- }
1524
- foreach( array_keys( $custom_data ) as $key ) {
1525
- if ( wppa_opt( 'album_custom_caption_' . $key ) ) {
1526
- $result .= '
1527
- <tr>
1528
- <td>
1529
- ' . apply_filters( 'translate_text', wppa_opt( 'album_custom_caption_' . $key ) ) . '
1530
- <small style="float:right" >
1531
- (w#cc' . $key . ')
1532
- </small>:
1533
- </td>
1534
- <td>
1535
- <input
1536
- type="text"
1537
- style="width:100%;"
1538
- id="album_custom_' . $key . '-' . $id . '"
1539
- onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'album_custom_' . $key . '\', this );"
1540
- value="' . esc_attr( stripslashes( $custom_data[$key] ) ) . '"
1541
- />
1542
- </td>
1543
- <td>
1544
- <small>
1545
- (w#cd' . $key . ')
1546
- </small>
1547
- </td>
1548
- </tr>';
1549
  }
 
1550
  }
1551
- wppa_echo( $result );
1552
- }
1553
 
1554
- // Link type
1555
- {
1556
- $result = '
1557
- <tr>
1558
- <td>
1559
- ' . __( 'Link type:', 'wp-photo-album-plus' ) . '
1560
- </td>
1561
- <td>';
1562
- $sel = ' selected';
1563
- $lt = $cover_linktype;
1564
- $result .= '
1565
- <select onchange="wppaAjaxUpdateAlbum( '. $id . ', \'cover_linktype\', this )" >
1566
- <option value="content"' . ( $lt == 'content' ? $sel : '' ) . ' >' . __( 'the subalbums and thumbnails', 'wp-photo-album-plus' ) . '</option>
1567
- <option value="albums"' . ( $lt == 'albums' ? $sel : '' ) . ' >' . __( 'the subalbums', 'wp-photo-album-plus' ) . '</option>
1568
- <option value="thumbs"' . ( $lt == 'thumbs' ? $sel : '' ) . ' >' . __( 'the thumbnails', 'wp-photo-album-plus' ) . '</option>
1569
- <option value="slide"' . ( $lt == 'slide' ? $sel : '' ) . ' >' . __( 'the album photos as slideshow', 'wp-photo-album-plus' ) . '</option>
1570
- <option value="page"' . ( $lt == 'page' ? $sel : '' ) . ' >' . __( 'the link page with a clean url', 'wp-photo-album-plus' ) . '</option>
1571
- <option value="none"' . ( $lt == 'none' ? $sel : '' ) . ' >' . __( 'no link at all', 'wp-photo-album-plus' ) . '</option>
1572
- <option value="manual"' . ( $lt == 'manual' ? $sel : '' ) . ' >' . __( 'manually entered', 'wp-photo-album-plus' ) . '</option>
1573
- </select>
1574
- <br>
1575
- <span class="description">';
1576
- if ( wppa_switch( 'auto_page' ) ) {
1577
- $result .= __( 'If you select "the link page with a clean url", select an Auto Page of one of the photos in this album.', 'wp-photo-album-plus' );
1578
- }
1579
- else {
1580
- $result .= __( 'If you select "the link page with a clean url", make sure you enter the correct shortcode on the target page.', 'wp-photo-album-plus' );
1581
- }
1582
- $result .= '
1583
- </span>
1584
- </td>
1585
- <td>
1586
- </td>
1587
- </tr>';
1588
- wppa_echo( $result );
1589
- }
1590
 
1591
- // Manually entered link
1592
- if ( ! wppa_switch( 'link_is_restricted' ) || wppa_user_is( 'administrator' ) ) {
1593
- $result = '
1594
- <tr
1595
- id="link-url-tr"
1596
- style="' . ( $cover_linktype == 'manual' ? '' : 'display:none' ) . '"
1597
- >
1598
- <td>
1599
- ' . __( 'Link target (url):', 'wp-photo-album-plus' ) . '
1600
- </td>
1601
- <td>
1602
- <input
1603
- type="text"
1604
- id="cover_link"
1605
- value="' . esc_attr( $cover_link ) . '"
1606
- style="width:100%"
1607
- onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'cover_link\', this )"
1608
- />
1609
- <br>
1610
- <span class="description">' .
1611
- __( 'Enter the url you want the title to link to when you selected Link type manually entered.', 'wp-photo-album-plus' ) . '
1612
- </span>
1613
- </td>
1614
- <td>
1615
- </td>
1616
- </tr>';
1617
- wppa_echo( $result );
1618
- }
1619
 
1620
- // Link page
1621
- if ( ! wppa_switch( 'link_is_restricted' ) || wppa_user_is( 'administrator' ) ) {
1622
- $result = '
1623
- <tr>
1624
- <td>
1625
- ' . __( 'Link to:', 'wp-photo-album-plus' ) . '
1626
- </td>
1627
- <td>';
1628
- $query = "SELECT ID, post_type, post_title, post_date FROM $wpdb->posts
1629
- WHERE ( post_type = 'page' OR post_type = 'post' )
1630
- AND post_status = 'publish'
1631
- ORDER BY post_title ASC";
1632
- $pages = $wpdb->get_results( $query, ARRAY_A );
1633
- if ( empty( $pages ) ) {
1634
- _e( 'There are no posts/pages (yet) to link to.', 'wp-photo-album-plus' );
1635
- }
1636
- else {
1637
- $linkpage = $albuminfo['cover_linkpage'];
1638
- if ( ! is_numeric( $linkpage ) ) {
1639
- $linkpage = '0';
1640
  }
 
 
 
 
 
1641
 
1642
- $result .= '
1643
- <select
1644
- onchange="wppaAjaxUpdateAlbum( '. $id . ' , \'cover_linkpage\', this )"
1645
- style="max-width:100%;"
1646
- >
1647
- <option value="0"' . ( $linkpage == '0' ? $sel : '' ) . ' >' .
1648
- __( '--- the same page or post ---', 'wp-photo-album-plus' ) .
1649
- '</option>';
1650
- foreach ( $pages as $page ) {
1651
- $result .= '
1652
- <option
1653
- value="' . $page['ID'] . '"' .
1654
- ( $linkpage == $page['ID'] ? ' selected' : '' ) . '>' .
1655
- __( htmlspecialchars( $page['post_title'] ) ) .
1656
- ( $page['post_type'] == 'post' ? ' (' . htmlspecialchars( $page['post_date'] ) . ')' : '' ) .
1657
  '</option>';
1658
- }
1659
- $result .= '
1660
- </select>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1661
  <br>
1662
  <span class="description" >' .
1663
- __( 'If you want, you can link the title to a WP page or post instead of the album\'s content. If so, select the page the title links to.', 'wp-photo-album-plus' ) .
1664
- '</span>';
1665
- }
1666
- $result .= '
1667
- </td>
1668
- <td>
1669
- </td>
1670
- </tr>';
1671
- wppa_echo( $result );
1672
- }
1673
-
1674
- // Schedule
1675
- {
1676
- $result = '
1677
- <tr>
1678
- <td>' .
1679
- __( 'Schedule:', 'wp-photo-album-plus' ) . ' ' .
1680
- '<input
1681
- type="checkbox"
1682
- id="schedule-box"' .
1683
- ( $albuminfo['scheduledtm'] ? ' checked="checked"' : '' ) . '
1684
- onchange="wppaChangeScheduleAlbum(' . $id . ', this );"
1685
- />
1686
- </td>
1687
- <td>
1688
- <input type="hidden" value="" id="wppa-dummy" />
1689
- <span
1690
- class="wppa-datetime-' . $id . '"' .
1691
- ( $albuminfo['scheduledtm'] ? '' : ' style="display:none"' ) .
1692
- ' >' .
1693
- wppa_get_date_time_select_html( 'album', $id, true ) .
1694
- '</span>
1695
- <br>
1696
- <span class="description" >' .
1697
- __( 'If enabled, new photos will have their status set scheduled for publication on the date/time specified here.', 'wp-photo-album-plus' ) .
1698
- '</span>
1699
- </td>
1700
- <td>
1701
- </td>
1702
- </tr>';
1703
- wppa_echo( $result );
1704
- }
1705
 
1706
- // End Section 2
1707
- wppa_echo( '
1708
- </tbody>
1709
- </table>' );
1710
  }
1711
 
1712
- // End albuminfo panel with border
1713
- wppa_echo( '</div>' );
1714
-
1715
-
1716
- /* End First details block - standard settings */
1717
- }
1718
-
1719
 
1720
- /* Second details block - related album options */
1721
- {
1722
- wppa_echo( '
1723
- <details class="wppa-toplevel-details">
1724
- <summary class="toplevel wppa-summary-toplevel"> '.
1725
- __( 'related album options', 'wp-photo-album-plus' ) . '
1726
- </summary>
1727
- <div class="wppa-table-wrap">' );
1728
 
1729
- // Explanation
1730
  wppa_echo( '
1731
- <h2 class="description" style="margin:1em">' .
1732
- __( 'The following buttons perform actions on albums related to this album', 'wp-photo-album-plus' ) . '
1733
- </h2>' );
1734
-
1735
- // Create subalbum
1736
- if ( wppa_can_create_album() ) {
1737
- $url = get_admin_url() . 'admin.php?page=wppa_admin_menu&amp;tab=edit&amp;edit-id=new&amp;parent_id=' . $albuminfo['id'] . '&amp;wppa-nonce=' . wp_create_nonce( 'wppa-nonce' );
1738
- $onc = 'if (confirm(\''.__( 'Are you sure you want to create a subalbum?', 'wp-photo-album-plus' ).'\')) document.location=\''.$url.'\';';
1739
 
 
1740
  wppa_echo( '
1741
- <input
1742
- type="button"
1743
- class="wppa-admin-button button"
1744
- onclick="' . $onc . '"
1745
- value="' . esc_attr( __( 'Create child', 'wp-photo-album-plus' ) ) . '"
1746
- />' );
1747
- }
1748
 
1749
- // Create sibling
1750
- if ( $albuminfo['a_parent'] > '0' && wppa_can_create_album() ||
1751
- $albuminfo['a_parent'] < '1' && wppa_can_create_top_album() ) {
1752
- $url = wppa_dbg_url( get_admin_url() .
1753
- 'admin.php' .
1754
- '?page=wppa_admin_menu' .
1755
- '&amp;tab=edit' .
1756
- '&amp;edit-id=new' .
1757
- '&amp;parent_id=' . $albuminfo['a_parent'] .
1758
- '&amp;is-sibling-of=' . $albuminfo['id'] .
1759
- '&amp;wppa-nonce=' . wp_create_nonce( 'wppa-nonce' ) );
1760
- $onc = 'if (confirm(\''.__( 'Are you sure you want to create a subalbum?', 'wp-photo-album-plus' ).'\')) document.location=\''.$url.'\';';
1761
 
1762
- wppa_echo( '
1763
- <input
1764
- type="button"
1765
- class="wppa-admin-button button"
1766
- onclick="' . $onc . '"
1767
- value="' . esc_attr( __( 'Create sibling', 'wp-photo-album-plus' ) ) . '"
1768
- />' );
1769
- }
1770
 
1771
- // Edit parent
1772
- if ( $albuminfo['a_parent'] > '0' && wppa_album_exists( $albuminfo['a_parent'] ) && wppa_have_access( $albuminfo['a_parent'] ) ) {
1773
- $url = wppa_dbg_url( get_admin_url() . 'admin.php?page=wppa_admin_menu&amp;tab=edit&amp;edit-id=' . $albuminfo['a_parent'] . '&amp;wppa-nonce=' . wp_create_nonce( 'wppa-nonce' ) );
1774
- $onc = 'document.location=\''.$url.'\';';
1775
- wppa_echo( '
1776
- <input
1777
- type="button"
1778
- class="wppa-admin-button button"
1779
- onclick="' . $onc . '"
1780
- value="' . esc_attr( __( 'Edit parent', 'wp-photo-album-plus' ) ) . '"
1781
- />' );
1782
- }
1783
 
1784
- // Inherit cats
1785
- if ( $has_children ) {
1786
- wppa_echo( '
1787
- <input
1788
- type="button"
1789
- class="wppa-admin-button button"
1790
- title="' . esc_attr( __( 'Apply categories to all (grand)children.', 'wp-photo-album-plus' ) ) . '"
1791
- onclick="wppaTryInheritCats( ' . $id . ' )"
1792
- value="' . esc_attr( __( 'Apply Cats to subalbums', 'wp-photo-album-plus' ) ) . '"
1793
- />
1794
- <input
1795
- type="button"
1796
- class="wppa-admin-button button"
1797
- title="' . esc_attr( __( 'Add categories to all (grand)children.', 'wp-photo-album-plus' ) ) . '"
1798
- onclick="wppaTryAddCats( ' . $id . ' )"
1799
- value="' . esc_attr( __( 'Add Cats to subalbums', 'wp-photo-album-plus' ) ) . '"
1800
- />' );
1801
- }
1802
-
1803
- // Subalbums sequence
1804
- if ( $has_children ) {
1805
- wppa_album_sequence( $edit_id );
1806
- }
1807
 
1808
- wppa_echo( '
1809
- </div>
1810
- </details>' );
1811
- }
 
 
 
 
 
 
 
 
1812
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1813
 
1814
- /* Third details block - all items actions */
1815
- {
1816
- wppa_echo( '
1817
- <details class="wppa-toplevel-details">
1818
- <summary class="toplevel wppa-summary-toplevel"> ' .
1819
- __( 'all item actions', 'wp-photo-album-plus' ) . '
1820
- </summary>
1821
- <div class="wppa-table-wrap">' );
1822
 
1823
- // Explanation
1824
  wppa_echo( '
1825
- <h2 class="description" style="margin:1em">' .
1826
- __( 'The following buttons perform actions onto all items in this album', 'wp-photo-album-plus' ) . '
1827
- </h2>' );
1828
 
1829
- // Apply default tags
1830
- wppa_echo( '
1831
- <input
1832
- type="button"
1833
- class="wppa-admin-button button"
1834
- title="' . esc_attr( __( 'Tag all photos in this album with the default tags.', 'wp-photo-album-plus' ) ) . '"
1835
- onclick="wppaTryApplyDeftags( ' . $id . ' )"
1836
- value="' . esc_attr( __( 'Apply default tags', 'wp-photo-album-plus' ) ) . '"
1837
- />
1838
- <input
1839
- type="button"
1840
- class="wppa-admin-button button"
1841
- title="' . esc_attr( __( 'Add the default tags to all photos in this album.', 'wp-photo-album-plus' ) ) . '"
1842
- onclick="wppaTryAddDeftags( ' . $id . ' )"
1843
- value="' . esc_attr( __( 'Add default tags', 'wp-photo-album-plus' ) ) . '"
1844
- />' );
1845
 
1846
- // Schedule all
1847
  wppa_echo( '
1848
- <input
1849
- type="button"
1850
- class="wppa-admin-button button"
1851
- title="' . esc_attr( __( 'Schedule all photos in this album for later publishing.', 'wp-photo-album-plus' ) ) . '"
1852
- onclick="wppaTryScheduleAll( ' . $id . ' )"
1853
- value="' . esc_attr( __( 'Schedule all', 'wp-photo-album-plus' ) ) . '"
1854
- />' );
1855
 
1856
- // Reset Ratings
1857
- if ( wppa_switch( 'rating_on') ) {
1858
- $onc = 'if (confirm(\'' . esc_js( __( 'Are you sure you want to clear the ratings in this album?', 'wp-photo-album-plus' ) ) . '\')) { wppaRefreshAfter(); wppaAjaxUpdateAlbum( ' . $id . ', \'clear_ratings\', 0 ); }';
1859
  wppa_echo( '
1860
- <input
1861
- type="button"
1862
- class="wppa-admin-button button"
1863
- onclick="' . $onc . '"
1864
- value="' . esc_attr( __( 'Reset ratings', 'wp-photo-album-plus' ) ) . '"
1865
- />' );
1866
- }
1867
 
1868
- // Apply New photo desc
1869
- if ( wppa_switch( 'apply_newphoto_desc') ) {
1870
- $onc = 'if ( confirm(\'Are you sure you want to set the description of all photos to \n\n'.esc_js(wppa_opt( 'newphoto_description')).'\')) document.location=\''.wppa_ea_url($albuminfo['id'], 'edit').'&applynewdesc=1\'';
1871
- wppa_echo( '
1872
- <input
1873
- type="button"
1874
- class="wppa-admin-button button"
1875
- onclick="' . $onc . '"
1876
- value="' . esc_attr( __( 'Apply new photo desc', 'wp-photo-album-plus' ) ) . '"
1877
- />' );
1878
- }
 
 
 
 
 
 
 
1879
 
1880
- // Remake all
1881
- if ( wppa_user_is( 'administrator' ) ) {
1882
- $onc = 'if ( confirm(\'Are you sure you want to remake the files for all photos in this album?\')) document.location=\''.wppa_ea_url($albuminfo['id'], 'edit').'&remakealbum=1\'';
1883
- wppa_echo( '
1884
- <input
1885
- type="button"
1886
- class="wppa-admin-button button"
1887
- onclick="' . $onc . '"
1888
- value="' . esc_attr( __( 'Remake all', 'wp-photo-album-plus' ) ) . '"
1889
- />' );
1890
- }
1891
 
1892
- // Set all to pano
1893
- if ( wppa_switch( 'enable_panorama' ) ) {
 
 
 
 
 
 
 
 
 
1894
 
1895
- wppa_echo( '
1896
- <input
1897
- type="button"
1898
- class="wppa-admin-button button"
1899
- onclick="wppaTrySetAllPanorama(' . $albuminfo['id'] . ')"
1900
- value="' . esc_attr( __( 'Set all to panorama', 'wp-photo-album-plus' ) ).':"
1901
- />
1902
- <select id="pano-opt"
1903
- style="margin-top:6px;">
1904
- <option value="9" disabled selected>' . __( 'Select a mode', 'wp-photo-album-plus' ) . '</option>
1905
- <option value="0">' . __( '- none -', 'wp-photo-album-plus' ) . '</option>
1906
- <option value="1">' . __( '360&deg; Spheric', 'wp-photo-album-plus' ) . '</option>
1907
- <option value="2">' . __( 'Non 360&deg; Flat', 'wp-photo-album-plus' ) . '</option>
1908
- </select>' );
1909
- }
1910
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1911
  wppa_echo( '
1912
- </div>
1913
- </details>' );
1914
- }
1915
 
1916
  // End of outer details block
1917
  wppa_echo( '
@@ -1965,6 +1981,8 @@ global $wppa_revno;
1965
  <div style="position:fixed;right:30px;bottom:30px;background-color:lightblue;float:right" >&nbsp;' . __( 'Top of page', 'wp-photo-album-plus' ) . '&nbsp;</div>
1966
  </a>
1967
  </div>' );
 
 
1968
  } // End tab is Edit
1969
 
1970
  // Comment moderate
3
  * Package: wp-photo-album-plus
4
  *
5
  * create, edit and delete albums
6
+ * Version 8.2.02.009
7
  *
8
  */
9
 
579
  </div>'); // end action-container
580
  /* End header */
581
 
582
+ /* Main nody album admin */
 
583
  wppa_echo( '
584
  <details class="wppa-toplevel-details">
585
  <summary class="toplevel wppa-summary-toplevel"> ' .
594
  <br>' . __( 'The <b style="color:#070" >Remark</b> fields keep you informed on the actions taken at the background.', 'wp-photo-album-plus' ) . '
595
  </h2>' );
596
 
597
+ // The tabs
598
+ wppa_echo('
599
+ <div id="tabs" style="margin-bottom:23px">
600
+ <ul class="widefat wppa-setting-tabs">
601
+ <li class="wppa-albumadmin-tab active" onclick="wppaChangeAlbumAdminTab(this,\'#albumitem-' . $id . '\');">' . __( 'General Album Settings', 'wp-photo-album-plus' ) . '</li>
602
+ <li class="wppa-albumadmin-tab" onclick="wppaChangeAlbumAdminTab(this,\'#subalbumitem-' . $id . '\');">' . __( 'Subalbums', 'wp-photo-album-plus' ) . '</li>
603
+ <li class="wppa-albumadmin-tab" onclick="wppaChangeAlbumAdminTab(this,\'#albumactions-' . $id . '\');">' . __( 'Album actions', 'wp-photo-album-plus' ) . '</li>
604
+ </ul>
605
+ <div style="clear:both"></div>
606
+ </div>');
607
+
608
+ // The script for the tabs to operate
609
+ $the_js = '
610
+ function wppaChangeAlbumAdminTab(elm,tabid) {
611
+ jQuery(".wppa-albumadmin-tab").removeClass(\'active\');
612
+ jQuery(elm).addClass(\'active\');
613
+ jQuery(".wppa-tabcontent").hide();
614
+ jQuery(tabid).show();
615
+ }';
616
+ wppa_add_inline_script( 'wppa-admin', $the_js );
617
+
618
+ // Tab 1: General Album Settings
619
  wppa_echo( '
620
  <div
621
  id="albumitem-' . $id . '"
622
+ class="wppa-table-wrap wppa-tabcontent"
623
+ style="width:100%;position:relative;background-color:#ddd;padding-bottom:12px;padding-left:12px;"
624
  >' );
625
 
626
  // Section 0: More or less static data
627
  {
628
+ $result = '
629
+ <!-- Album Section 0 static data -->
630
+ <div class="wppa-flex">' .
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
631
 
632
+ // Album number, crypt, timestamp and modified
633
+ '<div>
634
+ <label>' .
635
+ __( 'Album number', 'wp-photo-album-plus' ) . '
636
+ </label><br>
637
+ <h4>' .
638
+ $id . '
639
+ </h4>
640
+ </div>
641
  <div>
642
  <label>' .
643
+ __( 'Crypt', 'wp-photo-album-plus' ) . '
644
  </label><br>
645
  <h4>' .
646
+ $crypt . '
647
  </h4>
648
  </div>
649
  <div>
650
  <label>' .
651
+ __( 'Created', 'wp-photo-album-plus' ) . '
652
  </label><br>
653
  <h4>' .
654
+ wppa_local_date( '', $timestamp ) . '
655
+ </h4>
656
+ </div>
657
+ <div>
658
+ <label>' .
659
+ __( 'Modified', 'wp-photo-album-plus' ) . '
660
+ </label><br>
661
+ <h4>';
662
+ if ( $modified > $timestamp ) {
663
+ $result .= wppa_local_date( '', $modified );
664
+ }
665
+ else {
666
+ $result .= __( 'Not modified', 'wp-photo-album-plus' );
667
+ }
668
+ $result .= '
669
  </h4>
670
  </div>';
671
+
672
+ // Views
673
+ if ( wppa_switch( 'track_viewcounts' ) ) {
674
  $result .= '
675
  <div>
676
  <label>' .
677
+ __( 'Album Views', 'wp-photo-album-plus' ) . '
678
+ </label><br>
679
+ <h4>' .
680
+ $views . '
681
+ </h4>
682
+ </div>
683
+ <div>
684
+ <label>' .
685
+ __( 'Photo views', 'wp-photo-album-plus' ) . '
686
  </label><br>
687
  <h4>' .
688
+ $pviews . '
689
  </h4>
690
  </div>';
691
+ if ( $nsub ) {
692
+ $result .= '
693
+ <div>
694
+ <label>' .
695
+ __( 'Inc subalbums', 'wp-photo-album-plus' ) . '
696
+ </label><br>
697
+ <h4>' .
698
+ $tpviews . '
699
+ </h4>
700
+ </div>';
701
+ }
702
  }
 
703
 
704
+ // Clicks
705
+ if ( wppa_switch( 'track_clickcounts' ) ) {
706
+ $click_arr = $wpdb->get_col( "SELECT clicks FROM $wpdb->wppa_photos WHERE album = $id" );
707
+ $result .= '
708
+ <div>
709
+ <label>' .
710
+ __( 'Clicks:', 'wp-photo-album-plus' ) . '
711
+ </label><br>
712
+ <h4>' .
713
+ array_sum( $click_arr ) . '
714
+ </h4>
715
+ </div>';
716
+ }
717
 
718
+ $result .= '</div>';
719
+ wppa_echo( $result );
720
  }
721
 
722
  // Section 1: Short settable items
723
  {
724
+ wppa_echo( '
725
+ <!-- Album Section 1 simple settings -->
726
+ <div class="wppa-flex">' );
727
 
728
+ // Owner
729
+ {
730
+ $result = '
731
+ <div>
732
+ <label
733
+ for="albumowner">' .
734
+ __( 'Owned by:', 'wp-photo-album-plus' ) . '
735
+ </label><br>';
736
+
737
+ if ( ! wppa_user_is( 'administrator' ) ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
738
  if ( $owner == '--- public ---' ) {
739
+ $result .= __( '--- public ---', 'wp-photo-album-plus' );
740
  }
741
  else {
742
+ $result .= $owner;
743
  }
744
  }
745
  else {
746
+ if ( wppa_get_user_count() > wppa_opt( 'max_users' ) ) {
747
+ $result .= '
748
+ <input
749
+ id="albumowner"
750
+ type="text"
751
+ value="' . esc_attr( $owner ) . '"
752
+ onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'owner\', this )"
753
+ />';
754
+ }
755
+ else {
756
+ if ( wppa_switch( 'user_upload_on' ) ) {
757
+ if ( $owner == '--- public ---' ) {
758
+ $title = __( 'Frontend upload to this album is open to visitors', 'wp-photo-album-plus' );
759
+ }
760
+ else {
761
+ $title = __( 'Frontend upload to this album is open for the owner and the admin', 'wp-photo-album-plus' );
762
+ }
763
+ }
764
+ else {
765
+ $title = '';
766
+ }
767
+ $result .= '
768
+ <select
769
+ id="albumowner"
770
+ onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'owner\', this )"
771
+ style="max-width:200px;"
772
+ title="' . esc_attr( $title ) . '"
773
+ >' .
774
+ wppa_get_user_select( $owner ) . '
775
+ </select>';
776
+ }
777
  }
778
+ $result .= '
779
+ </div>';
780
+ wppa_echo( $result );
 
 
 
 
 
 
 
781
  }
 
 
 
 
782
 
783
+ // Order # -->
784
+ {
785
+ wppa_echo( '
786
+ <div>
787
+ <label
788
+ for="albumseqno">' .
789
+ __( 'Sequence number', 'wp-photo-album-plus' ) . '
790
+ </label><br>
791
+ <input
792
+ id="albumseqno"
793
+ type="text"
794
+ style="width:50px;cursor:pointer"
795
+ onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'a_order\', this )"
796
+ value="' . esc_attr( $a_order ) . '"' .
797
+ ( wppa_opt( 'list_albums_by' ) != '1' && $a_order != '0' ? ' title="' . esc_attr( __( 'Album sequence number has only effect if you set the album sort order method to Order # in the Photo Albums -> Settings screen.', 'wp-photo-album-plus' )) . '"' : '' ) . '
798
+ />&nbsp;
799
+ </div>' );
800
+ }
 
 
 
 
 
801
 
802
+ // Status
803
+ {
804
+ $title = __( 'Set the frontend visibility of the album cover and items not including subalbums.', 'wp-photo-album-plus' ) . ' ' .
805
+ __( 'Publish: visible for all, Private: visible for logged in only, Hidden: visible for admin only', 'wp-photo-album-plus' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
806
 
807
+ wppa_echo( '
808
+ <div>
809
+ <label
810
+ for="albumstatus">' .
811
+ __( 'Status', 'wp-photo-album-plus' ) . '
812
+ </label><br>
813
+ <select
814
+ style="max-width:200px;"
815
+ id="albumstatus"
816
+ onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'status\', this )"
817
+ title="' . esc_attr( $title ) . '" >
818
+ <option value="publish"' . ( $status == 'publish' ? ' selected' : '' ) . '>' .
819
+ __( 'Publish', 'wp-photo-album-plus' ) . '
820
+ </option>
821
+ <option value="private"' . ( $status == 'private' ? ' selected' : '' ) . '>' .
822
+ __( 'Private', 'wp-photo-album-plus' ) . '
823
+ </option>
824
+ <option value="hidden"' . ( $status == 'hidden' ? ' selected' : '' ) . '>' .
825
+ __( 'Hidden', 'wp-photo-album-plus' ) . '
826
+ </option>
827
+ </select>
828
+ </div>' );
 
 
 
 
 
 
 
 
829
  }
830
+
831
+ // Parent
832
+ {
833
+ $result = '
834
+ <div>
835
+ <label
836
+ for="wppa-parsel">' .
837
+ __( 'Parent album', 'wp-photo-album-plus' ) . '
838
+ </label><br>';
839
+ if ( wppa_extended_access() ) {
840
+ $result .=
841
+ wppa_album_select_a( array( 'checkaccess' => true,
842
+ 'exclude' => $id,
843
+ 'selected' => $a_parent,
844
+ 'addselected' => true,
845
+ 'addnone' => true,
846
+ 'addseparate' => true,
847
+ 'disableancestors' => true,
848
+ 'path' => true,
849
+ 'sort' => true,
850
+ 'tagopen' => '<select' .
851
+ ' id="wppa-parsel"' .
852
+ ' style="max-width:200px;"' .
853
+ ' onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'a_parent\', this )"' .
854
+ ' >',
855
+ 'tagid' => 'wppa-parsel',
856
+ 'tagonchange' => 'wppaAjaxUpdateAlbum( ' . $id . ', \'a_parent\', this )',
857
+ 'tagstyle' => 'font-size:13px;height:20px;cursor:pointer;',
858
+ )
859
+ ) .
860
+ '</select>';
861
+ }
862
+ else {
863
+ $result .= '
864
+ <select
865
+ id="wppa-parsel"
866
+ style="max-width:200px;"
867
+ onchange="wppaAjaxUpdateAlbum( '. $id . ', \'a_parent\', this )"
868
+ >' .
869
+ wppa_album_select_a( array( 'checkaccess' => true,
870
+ 'exclude' => $id,
871
+ 'selected' => $a_parent,
872
+ 'addnone' => wppa_can_create_top_album(),
873
+ 'addselected' => true,
874
+ 'disableancestors' => true,
875
+ 'path' => true,
876
+ 'sort' => true,
877
+ )
878
+ ) .
879
+ '</select>';
880
+ }
881
  $result .= '
882
+ </div>';
883
+ wppa_echo( $result );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
884
  }
 
 
 
 
885
 
886
+ // P-order-by
887
+ if ( ! wppa_switch( 'porder_restricted' ) || wppa_user_is( 'administrator' ) ) {
888
+ $result = '
889
+ <div
890
+ style="max-width: 200px;margin-right: 4px;">
891
+ <label
892
+ for="photo-order"
893
+ >' .
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
894
 
895
+ __( 'Photo order:', 'wp-photo-album-plus' ) . '
896
+ </label><br>';
897
+ $options = array( __( '--- default ---', 'wp-photo-album-plus' ),
898
+ __( 'Order #', 'wp-photo-album-plus' ),
899
+ __( 'Name', 'wp-photo-album-plus' ),
900
+ __( 'Random', 'wp-photo-album-plus' ),
901
+ __( 'Rating mean value', 'wp-photo-album-plus' ),
902
+ __( 'Number of votes', 'wp-photo-album-plus' ),
903
+ __( 'Timestamp', 'wp-photo-album-plus' ),
904
+ __( 'EXIF Date', 'wp-photo-album-plus' ),
905
+ __( 'Order # desc', 'wp-photo-album-plus' ),
906
+ __( 'Name desc', 'wp-photo-album-plus' ),
907
+ __( 'Rating mean value desc', 'wp-photo-album-plus' ),
908
+ __( 'Number of votes desc', 'wp-photo-album-plus' ),
909
+ __( 'Timestamp desc', 'wp-photo-album-plus' ),
910
+ __( 'EXIF Date desc', 'wp-photo-album-plus' )
911
+ );
912
+ $values = array( '0',
913
+ '1',
914
+ '2',
915
+ '3',
916
+ '4',
917
+ '6',
918
+ '5',
919
+ '7',
920
+ '-1',
921
+ '-2',
922
+ '-4',
923
+ '-6',
924
+ '-5',
925
+ '-7'
926
+ );
927
+
928
+ $dflt = '';
929
+ $df = wppa_opt( 'list_photos_by' );
930
+ if ( $df == '0' ) $dflt = __( 'not specified', 'wp-photo-album-plus' );
931
+ else foreach( array_keys( $values ) as $key ) {
932
+ if ( $df == $values[$key] ) {
933
+ $dflt = $options[$key];
934
+ }
935
  }
936
+ $title = sprintf( __( 'The default is set in %s and is currently set to %s', 'wp-photo-album-plus' ), wppa_setting_path( 'b', 'misc', 1, 2 ), $dflt );
 
937
 
938
+ $result .= '
939
+ <select
940
+ id="photo-order"
941
+ style="max-width:200px;"
942
+ onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'p_order_by\', this )"
943
+ title="' . esc_attr( $title ) . '"
944
+ >';
945
+ foreach ( array_keys( $options ) as $key ) {
946
+ $sel = $values[$key] == $p_order_by ? ' selected' : '';
947
+ $result .= '<option value="' . $values[$key] . '"' . $sel . '>' . $options[$key] . '</option>';
948
+ }
949
+ $result .= '
950
+ </select>
951
+ </div>';
952
+ wppa_echo( $result );
953
+ }
954
+
955
+ // Subalbum order
956
+ {
957
+ $sel = ' selected';
958
+ $opts = array(
959
+ __( '--- default ---', 'wp-photo-album-plus' ),
960
+ __( 'Random', 'wp-photo-album-plus' ),
961
+ __( 'Order #', 'wp-photo-album-plus' ),
962
+ __( 'Order # reverse', 'wp-photo-album-plus' ),
963
+ __( 'Name', 'wp-photo-album-plus' ),
964
+ __( 'Name reverse', 'wp-photo-album-plus' ),
965
+ __( 'Timestamp', 'wp-photo-album-plus' ),
966
+ __( 'Timestamp reverse', 'wp-photo-album-plus' ),
967
+ );
968
+ $vals = array( '0', '3', '1', '-1', '2', '-2', '5', '-5' );
969
+
970
+ $df = wppa_opt( 'list_albums_by' );
971
+ if ( $df == '0' ) $dflt = __( 'not specified', 'wp-photo-album-plus' );
972
+ else foreach( array_keys( $vals ) as $key ) {
973
+ if ( $df == $vals[$key] ) {
974
+ $dflt = $opts[$key];
975
  }
976
+ }
 
 
 
 
977
 
978
+ $title = sprintf( __( 'The default is set in %s and is currently set to %s', 'wp-photo-album-plus' ), wppa_setting_path( 'b', 'misc', 1, 1 ), $dflt );
 
 
 
 
 
 
 
 
 
 
 
 
 
979
 
980
+ $result = '
981
+ <div>
982
+ <label
983
+ for="subalbumorder">' .
984
+ __( 'Subalbum sort order', 'wp-photo-album-plus' ) . '
985
+ </label><br>
986
+ <select
987
+ id="subalbumorder"
988
+ style="max-width:200px;"
989
+ onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'suba_order_by\', this )"
990
+ title="' . esc_attr( $title ) . '"
991
+ >';
992
+ for ( $i = 0; $i < 7; $i++ ) {
993
+ $result .= '<option value="' . esc_attr( $vals[$i] ) . '" ' . ( $suba_order_by == $vals[$i] ? $sel : '' ) . ' >' . $opts[$i] . '</option>';
994
+ }
995
+ $result .= '
996
+ </select>
997
+ </div>';
998
+ wppa_echo( $result );
999
  }
 
1000
 
1001
+ // Alternative thumbnail size
1002
+ if ( ! wppa_switch( 'alt_is_restricted' ) || wppa_user_is( 'administrator' ) ) {
1003
+ $title = sprintf( __( 'The alternate thumbnail size is set in %s and is currently set to %s', 'wp-photo-album-plus' ), wppa_setting_path( 'b', 'thumbs', 1, 2 ), wppa_opt( 'thumbsize_alt' ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1004
 
1005
+ $sel = ' selected';
1006
+ wppa_echo( '
1007
+ <div
1008
+ style="max-width: 200px;margin-right: 4px;">
1009
+ <label
1010
+ for="altthumb">' .
1011
+ __( 'Use alt thumbsize', 'wp-photo-album-plus' ) . '
1012
+ </label><br>
1013
+ <select
1014
+ id="altthumb"
1015
+ onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'alt_thumbsize\', this )"
1016
+ title="' . esc_attr( $title ) . '"
1017
+ >
1018
+ <option value="0"' . ( $alt_thumbsize ? '' : $sel ) . ' >' .
1019
+ __( 'no', 'wp-photo-album-plus' ) . '
1020
+ </option>
1021
+ <option value="yes"' . ( $alt_thumbsize ? $sel : '' ) . ' >' .
1022
+ __( 'yes', 'wp-photo-album-plus' ) . '
1023
+ </option>
1024
+ </select>
1025
+ </div>' );
1026
+ }
1027
 
1028
+ // Cover type
1029
+ if ( ! wppa_switch( 'covertype_is_restricted' ) || wppa_user_is( 'administrator' ) ) {
1030
+ $sel = ' selected';
1031
+ $title = sprintf( __( 'The default is set in %s and is currently set to %s', 'wp-photo-album-plus' ), wppa_setting_path( 'b', 'covers', 3, 4 ), wppa_opt( 'cover_type' ) );
1032
+
1033
+ wppa_echo( '
1034
+ <div
1035
+ style="max-width: 200px;margin-right: 4px;">
1036
+ <label
1037
+ for="covertype">' .
1038
+ __( 'Cover&nbsp;Type', 'wp-photo-album-plus' ) . '
1039
+ </label><br>
1040
+ <select
1041
+ id="covertype"
1042
+ style="max-width:200px;"
1043
+ onchange="wppaAjaxUpdateAlbum( '. $id . ', \'cover_type\', this )"
1044
+ title="' . esc_attr( $title ) . '"
1045
+ >
1046
+ <option value=""' . ( $cover_type == '' ? $sel : '' ) . ' >' .
1047
+ __( '--- default ---', 'wp-photo-album-plus' ) . '
1048
+ </option>
1049
+ <option value="default"' . ( $cover_type == 'default' ? $sel : '' ) . ' >' .
1050
+ __( 'Standard', 'wp-photo-album-plus' ) . '
1051
+ </option>
1052
+ <option value="longdesc"' . ( $cover_type == 'longdesc' ? $sel : '' ) . ' >' .
1053
+ __( 'Long Descriptions', 'wp-photo-album-plus' ) . '
1054
+ </option>
1055
+ <option value="imagefactory"' . ( $cover_type == 'imagefactory' ? $sel : '' ) . ' >' .
1056
+ __( 'Image Factory', 'wp-photo-album-plus' ) . '
1057
+ </option>
1058
+ <option value="default-mcr"' . ( $cover_type == 'default-mcr' ? $sel : '' ) . ' >' .
1059
+ __( 'Standard mcr', 'wp-photo-album-plus' ) . '
1060
+ </option>
1061
+ <option value="longdesc-mcr"' . ( $cover_type == 'longdesc-mcr' ? $sel : '' ) . ' >' .
1062
+ __( 'Long Descriptions mcr', 'wp-photo-album-plus' ) . '
1063
+ </option>
1064
+ <option value="imagefactory-mcr"' . ( $cover_type == 'imagefactory-mcr' ? $sel : '' ) . ' >' .
1065
+ __( 'Image Factory mcr', 'wp-photo-album-plus' ) . '
1066
+ </option>
1067
+ </select>
1068
+ </div>' );
1069
+ }
1070
 
1071
+ // Cover photo
1072
+ {
1073
+ wppa_echo( '
1074
+ <div>
1075
+ <label>' .
1076
+ __( 'Cover&nbsp;Photo:', 'wp-photo-album-plus' ) . '
1077
+ </label><br>' .
1078
+ wppa_main_photo( $main_photo, $cover_type ) . '
1079
+ </div>' );
1080
+ }
1081
 
1082
+ // Upload limit
1083
+ {
1084
+ $result = '
1085
+ <div>
1086
+ <label
1087
+ for="upload_limit_count">' .
1088
+ __( 'Upload limit:', 'wp-photo-album-plus' ) . '
1089
+ </label><br>';
1090
+ $lims = explode( '/', $upload_limit );
1091
+ if ( ! is_array( $lims ) ) {
1092
+ $lims = array( '0', '0' );
1093
+ }
1094
+ if ( wppa_user_is( 'administrator' ) ) {
1095
+ $sel = ' selected';
1096
+ $title = __( 'Set the upload limit (0 means unlimited).', 'wp-photo-album-plus' );
1097
+ $result .= '
1098
+ <input
1099
+ type="text"
1100
+ id="upload_limit_count"
1101
+ value="' . $lims[0] . '"
1102
+ style="max-width:50px;cursor:pointer;"
1103
+ title="' . esc_attr( $title ) . '"
1104
+ onchange="wppaRefreshAfter(); wppaAjaxUpdateAlbum( ' . $id . ', \'upload_limit_count\', this )"
1105
+ />
1106
+ <select
1107
+ style="max-width:150px;vertical-align:baseline"
1108
+ onchange="wppaRefreshAfter(); wppaAjaxUpdateAlbum( ' . $id . ', \'upload_limit_time\', this )" >
1109
+ <option value="0"' . ( $lims[1] == '0' ? $sel : '' ) . ' >' . __( 'for ever', 'wp-photo-album-plus' ) . '</option>
1110
+ <option value="3600"' . ( $lims[1] == '3600' ? $sel : '' ) . ' >' . __( 'per hour', 'wp-photo-album-plus' ) . '</option>
1111
+ <option value="86400"' . ( $lims[1] == '86400' ? $sel : '' ) . ' >' . __( 'per day', 'wp-photo-album-plus' ) . '</option>
1112
+ <option value="604800"' . ( $lims[1] == '604800' ? $sel : '' ) . ' >' . __( 'per week', 'wp-photo-album-plus' ) . '</option>
1113
+ <option value="2592000"' . ( $lims[1] == '2592000' ? $sel : '' ) . ' >' . __( 'per month', 'wp-photo-album-plus' ) . '</option>
1114
+ <option value="31536000"' . ( $lims[1] == '31536000' ? $sel : '' ) . ' >' . __( 'per year', 'wp-photo-album-plus' ) . '</option>
1115
+ </select>';
1116
+ }
1117
+ else {
1118
+ if ( $lims[0] == '0' ) {
1119
+ $result .= __( 'Unlimited', 'wp-photo-album-plus' );
1120
+ }
1121
+ else {
1122
+ $result .= $lims[0] . '&nbsp;';
1123
+ switch ( $lims[1] ) {
1124
+ case '3600': $result .= __( 'per hour', 'wp-photo-album-plus' ); break;
1125
+ case '86400': $result .= __( 'per day', 'wp-photo-album-plus' ); break;
1126
+ case '604800': $result .= __( 'per week', 'wp-photo-album-plus' ); break;
1127
+ case '2592000': $result .= __( 'per month', 'wp-photo-album-plus' ); break;
1128
+ case '31536000': $result .= __( 'per year', 'wp-photo-album-plus' ); break;
1129
+ default: $result .= sprintf( 'per %d seconds', $lims[1] );
1130
+ }
1131
+ }
1132
+ $result .= '. ';
1133
+ }
1134
+ $result .= '
1135
+ </div>';
1136
+ wppa_echo( $result );
1137
+ }
1138
 
1139
+ // Tree limit
1140
+ {
1141
+ $title = __( 'The upload limit for this album and all its (grand)children.', 'wp-photo-album-plus' ) . ' ' .
1142
+ __( 'This setting overrules all other limits that may apply to this album or its (grand)children.', 'wp-photo-album-plus' ) . ' ' .
1143
+ __( '0 means no limit.', 'wp-photo-album-plus' );
1144
+ wppa_echo( '
1145
+ <div>
1146
+ <label
1147
+ for="uploadlimittree">' .
1148
+ __( 'Tree upload limit', 'wp-photo-album-plus' ) . '
1149
+ </label><br>
1150
+ <input
1151
+ type="text"
1152
+ id="uploadlimittree"
1153
+ title="' . esc_attr( $title ) . '"
1154
+ value="' . $tree_limit . '"
1155
+ onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'upload_limit_tree\', this )"
1156
+ style="cursor:pointer;max-width:50px;"
1157
+ />
1158
+ </div>' );
1159
+ }
1160
 
1161
+ // Need this the next 5 items
1162
+ {
1163
+ $yes = __( 'yes', 'wp-photo-album-plus' );
1164
+ $no = __( 'no', 'wp-photo-album-plus' );
1165
+ $def = __( 'default', 'wp-photo-album-plus' );
 
 
 
 
 
 
1166
  }
1167
+
1168
+ // Zoomable
1169
+ {
1170
+ $title = __( 'When set other than default, this setting will overrule the default settings.', 'wp-photo-album-plus' ) . ' ' .
1171
+ sprintf( __( 'The default is set in %s and is currently %s', 'wp-photo-album-plus' ), wppa_setting_path( 'b', 'photos', 1, 4 ), ( wppa_switch( 'zoom_on' ) ? $yes : $no ) );
1172
+
1173
+ wppa_echo( '
1174
+ <div>
1175
+ <label
1176
+ for="zoomable">' .
1177
+ __( 'Photos are zoomable:', 'wp-photo-album-plus' ) . '
1178
+ </label><br>
1179
+ <select
1180
+ id="zoomable"
1181
+ onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'zoomable\', this )"
1182
+ title="' . esc_attr( $title ) . '" >
1183
+ <option value=""'.($zoomable==''?' selected': '').'>' . $def . '</option>
1184
+ <option value="on"'.($zoomable=='on'?' selected': '').'>' . $yes . '</option>
1185
+ <option value="off"'.($zoomable=='off'?' selected': '').'>' . $no . '</option>
1186
+ </select>
1187
+ </div>' );
 
1188
  }
1189
+
1190
+ // Overrulable display options / next 4 items
1191
+ {
1192
+ if ( $displayopts ) {
1193
+ $disp_opt = explode( ',', $displayopts );
1194
  }
1195
+ for ( $i = 0; $i < 4; $i++ ) {
1196
+ if ( ! isset( $disp_opt[$i] ) ) {
1197
+ $disp_opt[$i] = '0';
 
 
 
 
 
 
1198
  }
1199
  }
1200
+ $title_head = __( 'When set other than default, this setting will overrule the default settings.', 'wp-photo-album-plus' ) . '&#013;' .
1201
+ __( 'The defaults are set in', 'wp-photo-album-plus' ). ':&#013;';
1202
  }
 
 
 
 
1203
 
1204
+ // Display name
1205
+ {
1206
+ $title = $title_head .
1207
+ wppa_setting_path( 'b', 'slide', 1, 17, wppa_switch( 'show_full_name' ) ? $yes : $no ) . ',&#013;' .
1208
+ wppa_setting_path( 'b', 'thumbs', 2, 1, wppa_switch( 'thumb_text_name' ) ? $yes : $no ) . ' ' . __( 'and' , 'wp-photo-album-plus' ) . '&#013;' .
1209
+ wppa_setting_path( 'b', 'lightbox', 1, 3, wppa_switch( 'ovl_name' ) ? $yes : $no ) . '.';
1210
+
1211
+ wppa_echo( '
1212
+ <div>
1213
+ <label
1214
+ for="showname">' .
1215
+ __( 'Show names:', 'wp-photo-album-plus' ) . '
1216
+ </label><br>
1217
+ <select
1218
+ id="showname"
1219
+ onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'displayopt0\', this )"
1220
+ title="' . esc_attr( $title ) . '">
1221
+ <option value="0"'.($disp_opt[0]=='0'?' selected': '').'>' . $def . '</option>
1222
+ <option value="1"'.($disp_opt[0]=='1'?' selected': '').'>' . $yes . '</option>
1223
+ <option value="-1"'.($disp_opt[0]=='-1'?' selected': '').'>' . $no . '</option>
1224
+ </select>
1225
+ </div>' );
1226
+ }
1227
 
1228
+ // Display description
1229
+ {
1230
+ $title = $title_head .
1231
+ wppa_setting_path( 'b', 'slide', 1, 20, wppa_switch( 'show_full_desc' ) ? $yes : $no ) . ',&#013;' .
1232
+ wppa_setting_path( 'b', 'thumbs', 2, 3, wppa_switch( 'thumb_text_desc' ) ? $yes : $no ) . ' ' . __( 'and' , 'wp-photo-album-plus' ) . '&#013;' .
1233
+ wppa_setting_path( 'b', 'lightbox', 1, 4, wppa_switch( 'ovl_desc' ) ? $yes : $no ) . '.';
1234
 
1235
+ wppa_echo( '
1236
+ <div>
1237
+ <label
1238
+ for="showdesc">' .
1239
+ __( 'Show descriptions:', 'wp-photo-album-plus' ) . '
1240
+ </label><br>
1241
+ <select
1242
+ id="showdesc"
1243
+ onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'displayopt1\', this )"
1244
+ title="' . esc_attr( $title ) . '" >
1245
+ <option value="0"'.($disp_opt[1]=='0'?' selected': '').'>' . $def . '</option>
1246
+ <option value="1"'.($disp_opt[1]=='1'?' selected': '').'>' . $yes . '</option>
1247
+ <option value="-1"'.($disp_opt[1]=='-1'?' selected': '').'>' . $no . '</option>
1248
+ </select>
1249
+ </div>' );
1250
+ }
1251
 
1252
+ // Display rating
1253
+ {
1254
+ $title = $title_head .
1255
+ wppa_setting_path( 'b', 'general', 1, 5, wppa_switch( 'rating_on' ) ? $yes : $no ) . ',&#013;' .
1256
+ wppa_setting_path( 'b', 'thumbs', 2, 3, wppa_switch( 'thumb_text_rating' ) ? $yes : $no ) . ' ' . __( 'and' , 'wp-photo-album-plus' ) . '&#013;' .
1257
+ wppa_setting_path( 'b', 'lightbox', 1, 5, wppa_switch( 'ovl_rating' ) ? $yes : $no ) . '.';
 
 
 
 
 
 
 
 
 
 
1258
 
1259
+ wppa_echo( '
1260
+ <div>
1261
+ <label
1262
+ for="showrating">' .
1263
+ __( 'Show rating:', 'wp-photo-album-plus' ) . '
1264
+ </label><br>
1265
+ <select
1266
+ id="showrating"
1267
+ onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'displayopt2\', this )"
1268
+ title="' . esc_attr( $title ) . '" >
1269
+ <option value="0"'.($disp_opt[2]=='0'?' selected': '').'>' . $def . '</option>
1270
+ <option value="1"'.($disp_opt[2]=='1'?' selected': '').'>' . $yes . '</option>
1271
+ <option value="-1"'.($disp_opt[2]=='-1'?' selected': '').'>' . $no . '</option>
1272
+ </select>
1273
+ </div>' );
1274
  }
 
1275
 
1276
+ // Display comments
1277
+ {
1278
+ $title = $title_head .
1279
+ wppa_setting_path( 'b', 'general', 1, 4, wppa_switch( 'show_comments' ) ? $yes : $no ) . ' ' . __( 'and' , 'wp-photo-album-plus' ) . '&#013;' .
1280
+ wppa_setting_path( 'b', 'thumbs', 2, 4, wppa_switch( 'thumb_text_comcount' ) ? $yes : $no ) . '.';
1281
+
1282
+ wppa_echo( '
1283
+ <div>
1284
+ <label
1285
+ for="showcomments">' .
1286
+ __( 'Show comments:', 'wp-photo-album-plus' ) . '
1287
+ </label><br>
1288
+ <select
1289
+ id="showcomments"
1290
+ onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'displayopt3\', this )"
1291
+ title="' . esc_attr( $title ) . '" >
1292
+ <option value="0"'.($disp_opt[3]=='0'?' selected': '').'>' . $def . '</option>
1293
+ <option value="1"'.($disp_opt[3]=='1'?' selected': '').'>' . $yes . '</option>
1294
+ <option value="-1"'.($disp_opt[3]=='-1'?' selected': '').'>' . $no . '</option>
1295
+ </select>
1296
+ </div>' );
1297
+ }
1298
 
1299
+ // Watermark
1300
+ if ( wppa_switch( 'watermark_on' ) ) {
 
 
 
 
1301
 
1302
+ wppa_echo( '
1303
+ <div
1304
+ style="max-width: 200px;margin-right: 4px;">
1305
+ <label
1306
+ for="watermarkfile">' .
1307
+ __( 'Watermark file:', 'wp-photo-album-plus' ) . '
1308
+ </label><br>
1309
+ <select
1310
+ id="watermarkfile"
1311
+ style="max-width:200px"
1312
+ onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'wmfile\', this )" >' .
1313
+ wppa_watermark_file_select( 'album', $id ) . '
1314
+ </select>
1315
+ </div>
1316
+ <div
1317
+ style="max-width: 200px;margin-right: 4px;">
1318
+ <label
1319
+ for="watermarkpos">' .
1320
+ __( 'Watermark pos:', 'wp-photo-album-plus' ) . '
1321
+ </label><br>
1322
+ <select
1323
+ id="watermarkpos"
1324
+ style="max-width:200px"
1325
+ onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'wmpos\', this )" >' .
1326
+ wppa_watermark_pos_select( 'album', $id ) . '
1327
+ </select>
1328
+ </div>' );
1329
+ }
1330
 
1331
+ // Schedule for delete
1332
+ if ( wppa_user_is( 'administrator' ) || $owner == wppa_get_user() ) {
1333
+ $may_change = wppa_user_is( 'administrator' ) || current_user_can( 'wppa_moderate' );
 
 
 
1334
 
1335
+ wppa_echo( '
1336
+ <div
1337
+ style="max-width: 500px;margin-right: 4px;">
1338
+ <label
1339
+ for="scheduledel">' .
1340
+ __( 'Delete at', 'wp-photo-album-plus' ) . '
1341
+ </label><br>
1342
+ <input
1343
+ type="checkbox"
1344
+ id="scheduledel"' .
1345
+ ( $scheduledel ? ' checked="checked"' : '' ) .
1346
+ ( $may_change ? '' : ' disabled' ) . '
1347
+ onchange="wppaChangeScheduleDelAlbum( ' . $id . ', this );"
1348
+ />
1349
+ <input type="hidden" value="" id="wppa-dummy-del" />
1350
+ <span
1351
+ class="wppa-datetimedel-' . $id . '"' .
1352
+ ( $albuminfo['scheduledel'] ? '' : ' style="display:none"' ) . '
1353
+ >' .
1354
+ wppa_get_date_time_select_html( 'delalbum', $id, $may_change ) . '
1355
+ </span>
1356
+ </div>' );
1357
+ }
1358
+ wppa_echo( '</div>' );
1359
+ }
1360
+ // End Section 1: Short settable items, wppa-flex div
1361
 
 
 
 
 
 
 
1362
 
1363
+ // Status - Remark - field
1364
+ {
1365
  wppa_echo( '
1366
+ <h3 style="margin-left:1em">' .
1367
+ esc_html__( 'Remark', 'wp-photo-album-plus' ) . ':&nbsp;
1368
+ <span
1369
+ id="albumstatus-' . $id . '"
1370
+ style="font-weight:bold;color:#00AA00">' .
1371
+ esc_html( $remark ) . '
1372
+ </span>
1373
+ </h3>' );
1374
+ }
 
 
 
 
 
 
 
 
 
 
 
 
1375
 
1376
+ // Section 2: name, description, custom, links
1377
+ {
1378
  wppa_echo( '
1379
+ <!-- Album Section 2 -->
1380
+ <table class="wppa-table wppa-album-table">
1381
+ <tbody>' );
1382
+
1383
+ // Name
1384
+ {
1385
+ wppa_echo( '
1386
+ <tr>
1387
+ <td>' .
1388
+ __( 'Name:', 'wp-photo-album-plus' ) . '
1389
+ </td>
1390
+ <td>
1391
+ <input
1392
+ type="text"
1393
+ style="width:100%;"
1394
+ onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'name\', this )"
1395
+ value="' . esc_attr( $name ) . '"
1396
+ />
1397
+ <span class="description" >' .
1398
+ __( 'Type the name of the album. Do not leave this empty.', 'wp-photo-album-plus' ) . '
1399
+ </span>
1400
+ <span style="float:right">' .
1401
+ __( 'Name slug', 'wp-photo-album-plus' ) . ': ' . $sname . '
1402
+ </span>
1403
+ </td>
1404
+ <td>
1405
+ </td>
1406
+ </tr>' );
1407
+ }
1408
 
1409
+ // Description
1410
+ {
1411
+ wppa_echo( '
1412
+ <tr>
1413
+ <td>' .
1414
+ __( 'Description:', 'wp-photo-album-plus' ) . '
1415
+ </td>
1416
+ <td>' );
1417
+
1418
+ // WP Editor
1419
+ if ( wppa_switch( 'use_wp_editor') ) {
1420
+
1421
+
1422
+ // Echos itsself, has no return option
1423
+ wp_editor( $description,
1424
+ 'wppaalbumdesc',
1425
+ array( 'wpautop' => true,
1426
+ 'media_buttons' => false,
1427
+ 'textarea_rows' => '6',
1428
+ 'tinymce' => true
1429
+ )
1430
+ );
1431
 
1432
+ wppa_echo( '
1433
+ <input
1434
+ type="button"
1435
+ class="button button-secundary"
1436
+ value="' . esc_attr( __( 'Update Album description', 'wp-photo-album-plus' ) ) . '"
1437
+ onclick="wppaAjaxUpdateAlbum( ' . $id . ', \'description\', wppaGetTinyMceContent(\'wppaalbumdesc\') )"
1438
+ />
1439
+ <img
1440
+ id="wppa-album-spin"
1441
+ src="' . wppa_get_imgdir() . 'spinner.gif"
1442
+ alt="Spin"
1443
+ style="visibility:hidden"
1444
+ />' );
1445
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1446
 
1447
+ // Textarea
1448
+ else {
1449
+ wppa_echo( '
1450
+ <textarea
1451
+ style="width:100%;height:60px;"
1452
+ onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'description\', this )"
1453
+ >' .
1454
+ esc_textarea( stripslashes( $description ) ) . '
1455
+ </textarea>' );
1456
+ }
1457
 
1458
+ wppa_echo( '
1459
+ </td>
1460
+ <td>
1461
+ </td>
1462
+ </tr>' );
1463
+ }
1464
 
1465
+ // Categories
1466
+ {
1467
+ $result = '
1468
+ <tr>
1469
+ <td>' .
1470
+ __( 'Categories:', 'wp-photo-album-plus' ) . '
1471
+ </td>
1472
+ <td>
1473
+ <input
1474
+ id="cats"
1475
+ type="text"
1476
+ style="width:100%;"
1477
+ onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'cats\', this )"
1478
+ value="' . esc_attr( $cats ) . '"
1479
+ />
1480
+ <br>
1481
+ <span class="description" >' .
1482
+ __( 'Separate categories with commas.', 'wp-photo-album-plus' ) . '
1483
+ </span>
1484
+ <select
1485
+ onchange="wppaAddCat( this.value, \'cats\' ); wppaAjaxUpdateAlbum( ' . $id . ', \'cats\', document.getElementById( \'cats\' ) )"
1486
+ >';
1487
+ $catlist = wppa_get_catlist();
1488
+ if ( is_array( $catlist ) ) {
1489
+ $result .= '
1490
+ <option value="" >' . __( '- select to add -', 'wp-photo-album-plus' ) . '</option>';
1491
+ foreach ( $catlist as $cat ) {
1492
+ $result .= '
1493
+ <option value="' . esc_attr( $cat['cat'] ) . '" >' . htmlspecialchars( $cat['cat'] ) . '</option>';
1494
+ }
1495
+ }
1496
+ else {
1497
+ $result .= '
1498
+ <option value="0" >' . __( 'No categories yet', 'wp-photo-album-plus' ) . '</option>';
1499
+ }
1500
+ $result .= '
1501
+ </select>
1502
+ </td>
1503
+ <td>
1504
+ </td>
1505
+ </tr>';
1506
+ wppa_echo( $result );
1507
+ }
1508
 
1509
+ // Default photo tags
1510
+ {
1511
+ wppa_echo( '
1512
+ <tr>
1513
+ <td>
1514
+ ' . __( 'Default photo tags:', 'wp-photo-album-plus' ) . '
1515
+ </td>
1516
+ <td>
1517
+ <input
1518
+ type="text"
1519
+ id="default_tags"
1520
+ value="' . esc_attr( $default_tags ) . '"
1521
+ style="width:100%"
1522
+ onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'default_tags\', this )"
1523
+ />
1524
+ <br>
1525
+ <span class="description">' .
1526
+ __( 'Enter the tags that you want to be assigned to new photos in this album.', 'wp-photo-album-plus' ) . '
1527
+ </span>
1528
+ </td>
1529
+ <td>
1530
+ </td>
1531
+ </tr>' );
1532
+ }
1533
 
1534
+ // Custom
1535
+ if ( wppa_switch( 'album_custom_fields' ) ) {
1536
+ $result = '';
1537
+ $custom = wppa_get_album_item( $edit_id, 'custom' );
1538
+ if ( $custom ) {
1539
+ $custom_data = wppa_unserialize( $custom );
 
 
 
 
 
 
 
1540
  }
 
 
1541
  else {
1542
+ $custom_data = array( '', '', '', '', '', '', '', '', '', '' );
 
 
 
 
 
 
1543
  }
1544
+ foreach( array_keys( $custom_data ) as $key ) {
1545
+ if ( wppa_opt( 'album_custom_caption_' . $key ) ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1546
  $result .= '
1547
+ <tr>
1548
+ <td>
1549
+ ' . apply_filters( 'translate_text', wppa_opt( 'album_custom_caption_' . $key ) ) . '
1550
+ <small style="float:right" >
1551
+ (w#cc' . $key . ')
1552
+ </small>:
1553
+ </td>
1554
+ <td>
1555
+ <input
1556
+ type="text"
1557
+ style="width:100%;"
1558
+ id="album_custom_' . $key . '-' . $id . '"
1559
+ onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'album_custom_' . $key . '\', this );"
1560
+ value="' . esc_attr( stripslashes( $custom_data[$key] ) ) . '"
1561
+ />
1562
+ </td>
1563
+ <td>
1564
+ <small>
1565
+ (w#cd' . $key . ')
1566
+ </small>
1567
+ </td>
1568
+ </tr>';
1569
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1570
  }
1571
+ wppa_echo( $result );
1572
  }
 
 
1573
 
1574
+ // Link type
1575
+ {
1576
+ $result = '
1577
+ <tr>
1578
+ <td>
1579
+ ' . __( 'Link type:', 'wp-photo-album-plus' ) . '
1580
+ </td>
1581
+ <td>';
1582
+ $sel = ' selected';
1583
+ $lt = $cover_linktype;
1584
+ $result .= '
1585
+ <select onchange="wppaAjaxUpdateAlbum( '. $id . ', \'cover_linktype\', this )" >
1586
+ <option value="content"' . ( $lt == 'content' ? $sel : '' ) . ' >' . __( 'the subalbums and thumbnails', 'wp-photo-album-plus' ) . '</option>
1587
+ <option value="albums"' . ( $lt == 'albums' ? $sel : '' ) . ' >' . __( 'the subalbums', 'wp-photo-album-plus' ) . '</option>
1588
+ <option value="thumbs"' . ( $lt == 'thumbs' ? $sel : '' ) . ' >' . __( 'the thumbnails', 'wp-photo-album-plus' ) . '</option>
1589
+ <option value="slide"' . ( $lt == 'slide' ? $sel : '' ) . ' >' . __( 'the album photos as slideshow', 'wp-photo-album-plus' ) . '</option>
1590
+ <option value="page"' . ( $lt == 'page' ? $sel : '' ) . ' >' . __( 'the link page with a clean url', 'wp-photo-album-plus' ) . '</option>
1591
+ <option value="none"' . ( $lt == 'none' ? $sel : '' ) . ' >' . __( 'no link at all', 'wp-photo-album-plus' ) . '</option>
1592
+ <option value="manual"' . ( $lt == 'manual' ? $sel : '' ) . ' >' . __( 'manually entered', 'wp-photo-album-plus' ) . '</option>
1593
+ </select>
1594
+ <br>
1595
+ <span class="description">';
1596
+ if ( wppa_switch( 'auto_page' ) ) {
1597
+ $result .= __( 'If you select "the link page with a clean url", select an Auto Page of one of the photos in this album.', 'wp-photo-album-plus' );
1598
+ }
1599
+ else {
1600
+ $result .= __( 'If you select "the link page with a clean url", make sure you enter the correct shortcode on the target page.', 'wp-photo-album-plus' );
1601
+ }
1602
+ $result .= '
1603
+ </span>
1604
+ </td>
1605
+ <td>
1606
+ </td>
1607
+ </tr>';
1608
+ wppa_echo( $result );
1609
+ }
1610
 
1611
+ // Manually entered link
1612
+ if ( ! wppa_switch( 'link_is_restricted' ) || wppa_user_is( 'administrator' ) ) {
1613
+ $result = '
1614
+ <tr
1615
+ id="link-url-tr"
1616
+ style="' . ( $cover_linktype == 'manual' ? '' : 'display:none' ) . '"
1617
+ >
1618
+ <td>
1619
+ ' . __( 'Link target (url):', 'wp-photo-album-plus' ) . '
1620
+ </td>
1621
+ <td>
1622
+ <input
1623
+ type="text"
1624
+ id="cover_link"
1625
+ value="' . esc_attr( $cover_link ) . '"
1626
+ style="width:100%"
1627
+ onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'cover_link\', this )"
1628
+ />
1629
+ <br>
1630
+ <span class="description">' .
1631
+ __( 'Enter the url you want the title to link to when you selected Link type manually entered.', 'wp-photo-album-plus' ) . '
1632
+ </span>
1633
+ </td>
1634
+ <td>
1635
+ </td>
1636
+ </tr>';
1637
+ wppa_echo( $result );
1638
+ }
1639
 
1640
+ // Link page
1641
+ if ( ! wppa_switch( 'link_is_restricted' ) || wppa_user_is( 'administrator' ) ) {
1642
+ $result = '
1643
+ <tr>
1644
+ <td>
1645
+ ' . __( 'Link to:', 'wp-photo-album-plus' ) . '
1646
+ </td>
1647
+ <td>';
1648
+ $query = "SELECT ID, post_type, post_title, post_date FROM $wpdb->posts
1649
+ WHERE ( post_type = 'page' OR post_type = 'post' )
1650
+ AND post_status = 'publish'
1651
+ ORDER BY post_title ASC";
1652
+ $pages = $wpdb->get_results( $query, ARRAY_A );
1653
+ if ( empty( $pages ) ) {
1654
+ _e( 'There are no posts/pages (yet) to link to.', 'wp-photo-album-plus' );
 
 
 
 
 
1655
  }
1656
+ else {
1657
+ $linkpage = $albuminfo['cover_linkpage'];
1658
+ if ( ! is_numeric( $linkpage ) ) {
1659
+ $linkpage = '0';
1660
+ }
1661
 
1662
+ $result .= '
1663
+ <select
1664
+ onchange="wppaAjaxUpdateAlbum( '. $id . ' , \'cover_linkpage\', this )"
1665
+ style="max-width:100%;"
1666
+ >
1667
+ <option value="0"' . ( $linkpage == '0' ? $sel : '' ) . ' >' .
1668
+ __( '--- the same page or post ---', 'wp-photo-album-plus' ) .
 
 
 
 
 
 
 
 
1669
  '</option>';
1670
+ foreach ( $pages as $page ) {
1671
+ $result .= '
1672
+ <option
1673
+ value="' . $page['ID'] . '"' .
1674
+ ( $linkpage == $page['ID'] ? ' selected' : '' ) . '>' .
1675
+ __( htmlspecialchars( $page['post_title'] ) ) .
1676
+ ( $page['post_type'] == 'post' ? ' (' . htmlspecialchars( $page['post_date'] ) . ')' : '' ) .
1677
+ '</option>';
1678
+ }
1679
+ $result .= '
1680
+ </select>
1681
+ <br>
1682
+ <span class="description" >' .
1683
+ __( 'If you want, you can link the title to a WP page or post instead of the album\'s content. If so, select the page the title links to.', 'wp-photo-album-plus' ) .
1684
+ '</span>';
1685
+ }
1686
+ $result .= '
1687
+ </td>
1688
+ <td>
1689
+ </td>
1690
+ </tr>';
1691
+ wppa_echo( $result );
1692
+ }
1693
+
1694
+ // Schedule
1695
+ {
1696
+ $result = '
1697
+ <tr>
1698
+ <td>' .
1699
+ __( 'Schedule:', 'wp-photo-album-plus' ) . ' ' .
1700
+ '<input
1701
+ type="checkbox"
1702
+ id="schedule-box"' .
1703
+ ( $albuminfo['scheduledtm'] ? ' checked="checked"' : '' ) . '
1704
+ onchange="wppaChangeScheduleAlbum(' . $id . ', this );"
1705
+ />
1706
+ </td>
1707
+ <td>
1708
+ <input type="hidden" value="" id="wppa-dummy" />
1709
+ <span
1710
+ class="wppa-datetime-' . $id . '"' .
1711
+ ( $albuminfo['scheduledtm'] ? '' : ' style="display:none"' ) .
1712
+ ' >' .
1713
+ wppa_get_date_time_select_html( 'album', $id, true ) .
1714
+ '</span>
1715
  <br>
1716
  <span class="description" >' .
1717
+ __( 'If enabled, new photos will have their status set scheduled for publication on the date/time specified here.', 'wp-photo-album-plus' ) .
1718
+ '</span>
1719
+ </td>
1720
+ <td>
1721
+ </td>
1722
+ </tr>';
1723
+ wppa_echo( $result );
1724
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1725
 
1726
+ // End Section 2
1727
+ wppa_echo( '
1728
+ </tbody>
1729
+ </table>' );
1730
  }
1731
 
1732
+ // End Tab 1
1733
+ wppa_echo( '
1734
+ </div>' ); // Tab 1
 
 
 
 
1735
 
 
 
 
 
 
 
 
 
1736
 
1737
+ // Tab 2: Subalbums
1738
  wppa_echo( '
1739
+ <div id="subalbumitem-' . $id . '"
1740
+ class="wppa-table-wrap wppa-tabcontent"
1741
+ style="width:100%;position:relative;display:none;background-color:#ddd;padding-bottom:12px;padding-left:12px;"
1742
+ >' );
 
 
 
 
1743
 
1744
+ // Explanation
1745
  wppa_echo( '
1746
+ <h2 class="description" style="margin:1em">' .
1747
+ __( 'The following buttons perform actions on albums related to this album', 'wp-photo-album-plus' ) . '
1748
+ </h2>' );
 
 
 
 
1749
 
1750
+ // Create subalbum
1751
+ if ( wppa_can_create_album() ) {
1752
+ $url = get_admin_url() . 'admin.php?page=wppa_admin_menu&amp;tab=edit&amp;edit-id=new&amp;parent_id=' . $albuminfo['id'] . '&amp;wppa-nonce=' . wp_create_nonce( 'wppa-nonce' );
1753
+ $onc = 'if (confirm(\''.__( 'Are you sure you want to create a subalbum?', 'wp-photo-album-plus' ).'\')) document.location=\''.$url.'\';';
 
 
 
 
 
 
 
 
1754
 
1755
+ wppa_echo( '
1756
+ <input
1757
+ type="button"
1758
+ class="wppa-admin-button button"
1759
+ onclick="' . $onc . '"
1760
+ value="' . esc_attr( __( 'Create child', 'wp-photo-album-plus' ) ) . '"
1761
+ />' );
1762
+ }
1763
 
1764
+ // Create sibling
1765
+ if ( $albuminfo['a_parent'] > '0' && wppa_can_create_album() ||
1766
+ $albuminfo['a_parent'] < '1' && wppa_can_create_top_album() ) {
1767
+ $url = wppa_dbg_url( get_admin_url() .
1768
+ 'admin.php' .
1769
+ '?page=wppa_admin_menu' .
1770
+ '&amp;tab=edit' .
1771
+ '&amp;edit-id=new' .
1772
+ '&amp;parent_id=' . $albuminfo['a_parent'] .
1773
+ '&amp;is-sibling-of=' . $albuminfo['id'] .
1774
+ '&amp;wppa-nonce=' . wp_create_nonce( 'wppa-nonce' ) );
1775
+ $onc = 'if (confirm(\''.__( 'Are you sure you want to create a subalbum?', 'wp-photo-album-plus' ).'\')) document.location=\''.$url.'\';';
1776
 
1777
+ wppa_echo( '
1778
+ <input
1779
+ type="button"
1780
+ class="wppa-admin-button button"
1781
+ onclick="' . $onc . '"
1782
+ value="' . esc_attr( __( 'Create sibling', 'wp-photo-album-plus' ) ) . '"
1783
+ />' );
1784
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1785
 
1786
+ // Edit parent
1787
+ if ( $albuminfo['a_parent'] > '0' && wppa_album_exists( $albuminfo['a_parent'] ) && wppa_have_access( $albuminfo['a_parent'] ) ) {
1788
+ $url = wppa_dbg_url( get_admin_url() . 'admin.php?page=wppa_admin_menu&amp;tab=edit&amp;edit-id=' . $albuminfo['a_parent'] . '&amp;wppa-nonce=' . wp_create_nonce( 'wppa-nonce' ) );
1789
+ $onc = 'document.location=\''.$url.'\';';
1790
+ wppa_echo( '
1791
+ <input
1792
+ type="button"
1793
+ class="wppa-admin-button button"
1794
+ onclick="' . $onc . '"
1795
+ value="' . esc_attr( __( 'Edit parent', 'wp-photo-album-plus' ) ) . '"
1796
+ />' );
1797
+ }
1798
 
1799
+ // Inherit cats
1800
+ if ( $has_children ) {
1801
+ wppa_echo( '
1802
+ <input
1803
+ type="button"
1804
+ class="wppa-admin-button button"
1805
+ title="' . esc_attr( __( 'Apply categories to all (grand)children.', 'wp-photo-album-plus' ) ) . '"
1806
+ onclick="wppaTryInheritCats( ' . $id . ' )"
1807
+ value="' . esc_attr( __( 'Apply Cats to subalbums', 'wp-photo-album-plus' ) ) . '"
1808
+ />
1809
+ <input
1810
+ type="button"
1811
+ class="wppa-admin-button button"
1812
+ title="' . esc_attr( __( 'Add categories to all (grand)children.', 'wp-photo-album-plus' ) ) . '"
1813
+ onclick="wppaTryAddCats( ' . $id . ' )"
1814
+ value="' . esc_attr( __( 'Add Cats to subalbums', 'wp-photo-album-plus' ) ) . '"
1815
+ />' );
1816
+ }
1817
 
1818
+ // Subalbums sequence
1819
+ if ( $has_children ) {
1820
+ wppa_album_sequence( $edit_id );
1821
+ }
 
 
 
 
1822
 
1823
+ // End Tab 2
1824
  wppa_echo( '
1825
+ </div>' );
 
 
1826
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1827
 
1828
+ // Tab 3: Album Actions
1829
  wppa_echo( '
1830
+ <div
1831
+ id="albumactions-' . $id . '"
1832
+ class="wppa-table-wrap wppa-tabcontent"
1833
+ style="width:100%;position:relative;display:none;background-color:#ddd;padding-bottom:12px;padding-left:12px;"
1834
+ >' );
 
 
1835
 
1836
+ // Explanation
 
 
1837
  wppa_echo( '
1838
+ <h2 class="description" style="margin:1em">' .
1839
+ __( 'The following buttons perform actions onto all items in this album', 'wp-photo-album-plus' ) . '
1840
+ </h2>' );
 
 
 
 
1841
 
1842
+ // Apply default tags
1843
+ {
1844
+ wppa_echo( '
1845
+ <input
1846
+ type="button"
1847
+ class="wppa-admin-button button"
1848
+ title="' . esc_attr( __( 'Tag all photos in this album with the default tags.', 'wp-photo-album-plus' ) ) . '"
1849
+ onclick="wppaTryApplyDeftags( ' . $id . ' )"
1850
+ value="' . esc_attr( __( 'Apply default tags', 'wp-photo-album-plus' ) ) . '"
1851
+ />
1852
+ <input
1853
+ type="button"
1854
+ class="wppa-admin-button button"
1855
+ title="' . esc_attr( __( 'Add the default tags to all photos in this album.', 'wp-photo-album-plus' ) ) . '"
1856
+ onclick="wppaTryAddDeftags( ' . $id . ' )"
1857
+ value="' . esc_attr( __( 'Add default tags', 'wp-photo-album-plus' ) ) . '"
1858
+ />' );
1859
+ }
1860
 
1861
+ // Schedule all
1862
+ {
1863
+ wppa_echo( '
1864
+ <input
1865
+ type="button"
1866
+ class="wppa-admin-button button"
1867
+ title="' . esc_attr( __( 'Schedule all photos in this album for later publishing.', 'wp-photo-album-plus' ) ) . '"
1868
+ onclick="wppaTryScheduleAll( ' . $id . ' )"
1869
+ value="' . esc_attr( __( 'Schedule all', 'wp-photo-album-plus' ) ) . '"
1870
+ />' );
1871
+ }
1872
 
1873
+ // Reset Ratings
1874
+ if ( wppa_switch( 'rating_on') ) {
1875
+ $onc = 'if (confirm(\'' . esc_js( __( 'Are you sure you want to clear the ratings in this album?', 'wp-photo-album-plus' ) ) . '\')) { wppaRefreshAfter(); wppaAjaxUpdateAlbum( ' . $id . ', \'clear_ratings\', 0 ); }';
1876
+ wppa_echo( '
1877
+ <input
1878
+ type="button"
1879
+ class="wppa-admin-button button"
1880
+ onclick="' . $onc . '"
1881
+ value="' . esc_attr( __( 'Reset ratings', 'wp-photo-album-plus' ) ) . '"
1882
+ />' );
1883
+ }
1884
 
1885
+ // Apply New photo desc
1886
+ if ( wppa_switch( 'apply_newphoto_desc') ) {
1887
+ $onc = 'if ( confirm(\'Are you sure you want to set the description of all photos to \n\n'.esc_js(wppa_opt( 'newphoto_description')).'\')) document.location=\''.wppa_ea_url($albuminfo['id'], 'edit').'&applynewdesc=1\'';
1888
+ wppa_echo( '
1889
+ <input
1890
+ type="button"
1891
+ class="wppa-admin-button button"
1892
+ onclick="' . $onc . '"
1893
+ value="' . esc_attr( __( 'Apply new photo desc', 'wp-photo-album-plus' ) ) . '"
1894
+ />' );
1895
+ }
 
 
 
 
1896
 
1897
+ // Remake all
1898
+ if ( wppa_user_is( 'administrator' ) ) {
1899
+ $onc = 'if ( confirm(\'Are you sure you want to remake the files for all photos in this album?\')) document.location=\''.wppa_ea_url($albuminfo['id'], 'edit').'&remakealbum=1\'';
1900
+ wppa_echo( '
1901
+ <input
1902
+ type="button"
1903
+ class="wppa-admin-button button"
1904
+ onclick="' . $onc . '"
1905
+ value="' . esc_attr( __( 'Remake all', 'wp-photo-album-plus' ) ) . '"
1906
+ />' );
1907
+ }
1908
+
1909
+ // Set all to pano
1910
+ if ( wppa_switch( 'enable_panorama' ) ) {
1911
+
1912
+ wppa_echo( '
1913
+ <input
1914
+ type="button"
1915
+ class="wppa-admin-button button"
1916
+ onclick="wppaTrySetAllPanorama(' . $albuminfo['id'] . ')"
1917
+ value="' . esc_attr( __( 'Set all to panorama', 'wp-photo-album-plus' ) ).':"
1918
+ />
1919
+ <select id="pano-opt"
1920
+ style="">
1921
+ <option value="9" disabled selected>' . __( 'Select a mode', 'wp-photo-album-plus' ) . '</option>
1922
+ <option value="0">' . __( '- none -', 'wp-photo-album-plus' ) . '</option>
1923
+ <option value="1">' . __( '360&deg; Spheric', 'wp-photo-album-plus' ) . '</option>
1924
+ <option value="2">' . __( 'Non 360&deg; Flat', 'wp-photo-album-plus' ) . '</option>
1925
+ </select>' );
1926
+ }
1927
+
1928
+ // End Tab 3
1929
  wppa_echo( '
1930
+ </div>' );
 
 
1931
 
1932
  // End of outer details block
1933
  wppa_echo( '
1981
  <div style="position:fixed;right:30px;bottom:30px;background-color:lightblue;float:right" >&nbsp;' . __( 'Top of page', 'wp-photo-album-plus' ) . '&nbsp;</div>
1982
  </a>
1983
  </div>' );
1984
+
1985
+
1986
  } // End tab is Edit
1987
 
1988
  // Comment moderate
wppa-init.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * This file loads required php files and contains all functions used in init actions.
6
  *
7
- * Version 8.2.01.005
8
  */
9
 
10
  /* LOAD SIDEBAR WIDGETS */
@@ -477,6 +477,7 @@ global $_gallery;
477
  if ( !empty( $wppa_album_gallery_texts_albums ) ) return;
478
 
479
  $wppa_album_gallery_texts_albums = array(
 
480
  __( 'Renew Album', 'wp-photo-album-plus' ),
481
  __( 'renew album', 'wp-photo-album-plus' ),
482
  __( 'A new album', 'wp-photo-album-plus' ),
@@ -498,6 +499,7 @@ global $_gallery;
498
  );
499
 
500
  $wppa_album_gallery_texts_gallery = array(
 
501
  __( 'Renew Gallery', 'wp-photo-album-plus' ),
502
  __( 'renew gallery', 'wp-photo-album-plus' ),
503
  __( 'A new gallery', 'wp-photo-album-plus' ),
@@ -526,6 +528,11 @@ add_action( 'plugins_loaded', 'wppa_filter_translate', 1 );
526
  // This must be done after wppa_filter_translate() has completed to avoid endless recursion
527
  function wppa_activate_albtogal_conversion() {
528
 
 
 
 
 
 
529
  add_filter( 'gettext', 'wppa_album_to_gallery', 100 );
530
  }
531
  add_action( 'plugins_loaded', 'wppa_activate_albtogal_conversion', 20 );
4
  *
5
  * This file loads required php files and contains all functions used in init actions.
6
  *
7
+ * Version 8.2.02.008
8
  */
9
 
10
  /* LOAD SIDEBAR WIDGETS */
477
  if ( !empty( $wppa_album_gallery_texts_albums ) ) return;
478
 
479
  $wppa_album_gallery_texts_albums = array(
480
+ __( 'of the album', 'wp-photo-album-plus' ),
481
  __( 'Renew Album', 'wp-photo-album-plus' ),
482
  __( 'renew album', 'wp-photo-album-plus' ),
483
  __( 'A new album', 'wp-photo-album-plus' ),
499
  );
500
 
501
  $wppa_album_gallery_texts_gallery = array(
502
+ __( 'of the gallery', 'wp-photo-album-plus' ),
503
  __( 'Renew Gallery', 'wp-photo-album-plus' ),
504
  __( 'renew gallery', 'wp-photo-album-plus' ),
505
  __( 'A new gallery', 'wp-photo-album-plus' ),
528
  // This must be done after wppa_filter_translate() has completed to avoid endless recursion
529
  function wppa_activate_albtogal_conversion() {
530
 
531
+ // Keep it album?
532
+ if ( get_option( 'wppa_album_use_gallery', 'no' ) == 'no' ) {
533
+ return;
534
+ }
535
+
536
  add_filter( 'gettext', 'wppa_album_to_gallery', 100 );
537
  }
538
  add_action( 'plugins_loaded', 'wppa_activate_albtogal_conversion', 20 );
wppa-photo-admin-autosave.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * edit and delete photos
6
- * Version 8.2.02.007
7
  *
8
  */
9
 
@@ -995,8 +995,8 @@ function wppaToggleExif( id, count ) {
995
  if ( is_file( $dp ) ) {
996
  $txt = '
997
  <span id="photox-' . $id . '">' . wppa_get_photox( $id ) . '</span> x
998
- <span id="photoy-' . $id . '">' . wppa_get_photoy( $id ) . '</span>
999
- <span id="photofilesize-' . $id . '">: ' . wppa_get_filesize( $dp ) . '</span>';
1000
  }
1001
  else {
1002
  $txt = '
@@ -1021,8 +1021,8 @@ function wppaToggleExif( id, count ) {
1021
  if ( is_file( $tp ) ) {
1022
  $txt = '
1023
  <span id="thumbx-' . $id . '">' . wppa_get_thumbx( $id ) . '</span> x
1024
- <span id="thumby-' . $id . '">' . wppa_get_thumby( $id ) . '</span>
1025
- <span id="thumbfilesize-' . $id . '">: ' . wppa_get_filesize( $tp ) . '</span>
1026
  &nbsp;
1027
  <input
1028
  type="checkbox"' .
@@ -1097,6 +1097,7 @@ function wppaToggleExif( id, count ) {
1097
  __( 'Video width', 'wp-photo-album-plus' ) . '
1098
  </label><br>
1099
  <input
 
1100
  style="width:50px;margin:0 4px"
1101
  onchange="wppaAjaxUpdatePhoto( ' . strval( intval( $id ) ) . ', \'videox\', this.value)"
1102
  value="' . esc_attr( $videox ) . '"
@@ -1111,6 +1112,7 @@ function wppaToggleExif( id, count ) {
1111
  __( 'Video height', 'wp-photo-album-plus' ) . '
1112
  </label><br>
1113
  <input
 
1114
  style="width:50px;margin:0 4px"
1115
  onchange="wppaAjaxUpdatePhoto( ' . strval( intval( $id ) ) . ', \'videoy\', this.value)"
1116
  value="' . esc_attr( $videoy ) . '"
@@ -1766,7 +1768,7 @@ function wppaToggleExif( id, count ) {
1766
 
1767
  wppa_echo( '<div style="padding:0 20px;">
1768
  <details class="wppa-sublevel-details">
1769
- <summary class="toplevel wppa-summary-sublevel"> '.
1770
  __( 'ImageMagick commands', 'wp-photo-album-plus' ) . '
1771
  </summary>
1772
 
@@ -1785,7 +1787,7 @@ function wppaToggleExif( id, count ) {
1785
  <td>' );
1786
 
1787
  // --- Actions ---
1788
-
1789
  // Rotate left
1790
  wppa_echo( '
1791
  <input
@@ -2025,7 +2027,8 @@ function wppaToggleExif( id, count ) {
2025
 
2026
  // Set cropbox aspect ratio
2027
  $ratio = ( $photoy ? ( $photox / $photoy ) : 'NaN' );
2028
- $dflt = wppa_opt( 'image_magick_ratio' );
 
2029
  wppa_echo( '
2030
  <select
2031
  onchange="wppaCropper[' . $id . '].setAspectRatio(this.value)"
@@ -2058,8 +2061,9 @@ function wppaToggleExif( id, count ) {
2058
  $value = $dflt;
2059
  }
2060
 
2061
- $the_js = 'jQuery(document).ready(function(){wppaCropper[' . $id . '].setAspectRatio(' . $value . ');});';
2062
- wppa_add_inline_script( 'wppa-admin', $the_js );
 
2063
 
2064
  wppa_echo( '
2065
  </td>
@@ -2075,12 +2079,12 @@ function wppaToggleExif( id, count ) {
2075
  </span>
2076
  <input
2077
  type="button"
2078
- class="wppa-admin-button"
2079
  id="imstackbutton-' . strval( intval( $id ) ) . '"
2080
  onclick="wppaTryMagick( ' . strval( intval( $id ) ) . ', \'magickundo\' )"
2081
  value="' . esc_attr( __( 'Undo', 'wp-photo-album-plus' ) ) . '"
2082
  title="' . esc_attr( __( 'Undo last Magick command', 'wp-photo-album-plus' ) ) . '"
2083
- style="' . ( $magickstack ? 'display:inline;' : 'display:none;' ) . '"
2084
  />
2085
  </td>
2086
  </tr>' );
@@ -2096,42 +2100,7 @@ function wppaToggleExif( id, count ) {
2096
  id="fs-img-' . $id . '"
2097
  src="' . esc_url( wppa_get_photo_url( $id ) ) . '"
2098
  style="float:left;max-width:100%"
2099
- />' );
2100
-
2101
- $the_js = '
2102
-
2103
- /* jQuery(document).ready(function() { */
2104
- window.addEventListener("DOMContentLoaded", function () {
2105
-
2106
- /* Responive does not always works correcly, */
2107
- /* so we do a manual replace after resizing the window */
2108
- window.addEventListener("resize", function(){
2109
- var c = wppaCropper[' . $id . '];
2110
- var url = document.getElementById("fs-img-' . $id . '").src;
2111
- c.replace(url);
2112
- });
2113
-
2114
- var image = document.querySelector("#fs-img-' . $id . '");
2115
- var button = document.getElementById("button-' . $id . '");
2116
-
2117
- wppaCropper[' . $id . '] = new Cropper(image, {
2118
- zoomable: false,
2119
- viewMode: 2,
2120
- background: false,
2121
- dragMode: "move",
2122
- responsive: true,
2123
- movable: false,
2124
- });
2125
-
2126
- button.onclick = function () {
2127
- var data = wppaCropper[' . $id . '].getData(true);
2128
- var value=data.width+"x"+data.height+(data.x<0?"-":"+")+data.x+(data.y<0?"-":"+")+data.y;
2129
- wppaTryMagick( "' . $id . '", \'crop\', value );
2130
- };
2131
- });';
2132
- wppa_add_inline_script( 'wppa-admin', $the_js );
2133
-
2134
- wppa_echo( '
2135
  </div>
2136
  </td>
2137
  </tr>
3
  * Package: wp-photo-album-plus
4
  *
5
  * edit and delete photos
6
+ * Version 8.2.02.009
7
  *
8
  */
9
 
995
  if ( is_file( $dp ) ) {
996
  $txt = '
997
  <span id="photox-' . $id . '">' . wppa_get_photox( $id ) . '</span> x
998
+ <span id="photoy-' . $id . '">' . wppa_get_photoy( $id ) . '</span>:
999
+ (<span id="photofilesize-' . $id . '">' . wppa_get_filesize( $dp ) . '</span>)';
1000
  }
1001
  else {
1002
  $txt = '
1021
  if ( is_file( $tp ) ) {
1022
  $txt = '
1023
  <span id="thumbx-' . $id . '">' . wppa_get_thumbx( $id ) . '</span> x
1024
+ <span id="thumby-' . $id . '">' . wppa_get_thumby( $id ) . '</span>:
1025
+ (<span id="thumbfilesize-' . $id . '">' . wppa_get_filesize( $tp ) . '</span>)
1026
  &nbsp;
1027
  <input
1028
  type="checkbox"' .
1097
  __( 'Video width', 'wp-photo-album-plus' ) . '
1098
  </label><br>
1099
  <input
1100
+ type="text"
1101
  style="width:50px;margin:0 4px"
1102
  onchange="wppaAjaxUpdatePhoto( ' . strval( intval( $id ) ) . ', \'videox\', this.value)"
1103
  value="' . esc_attr( $videox ) . '"
1112
  __( 'Video height', 'wp-photo-album-plus' ) . '
1113
  </label><br>
1114
  <input
1115
+ type="text"
1116
  style="width:50px;margin:0 4px"
1117
  onchange="wppaAjaxUpdatePhoto( ' . strval( intval( $id ) ) . ', \'videoy\', this.value)"
1118
  value="' . esc_attr( $videoy ) . '"
1768
 
1769
  wppa_echo( '<div style="padding:0 20px;">
1770
  <details class="wppa-sublevel-details">
1771
+ <summary class="toplevel wppa-summary-sublevel" onclick="if(!jQuery(this).parent().prop(\'open\'))wppaInitMagick(\''.$id.'\')"> '.
1772
  __( 'ImageMagick commands', 'wp-photo-album-plus' ) . '
1773
  </summary>
1774
 
1787
  <td>' );
1788
 
1789
  // --- Actions ---
1790
+ {
1791
  // Rotate left
1792
  wppa_echo( '
1793
  <input
2027
 
2028
  // Set cropbox aspect ratio
2029
  $ratio = ( $photoy ? ( $photox / $photoy ) : 'NaN' );
2030
+ $dflt = wppa_opt( 'image_magick_ratio' );
2031
+ wppa_log('obs', 'default = '.wppa_opt( 'image_magick_ratio' ));
2032
  wppa_echo( '
2033
  <select
2034
  onchange="wppaCropper[' . $id . '].setAspectRatio(this.value)"
2061
  $value = $dflt;
2062
  }
2063
 
2064
+ // $the_js = 'jQuery(document).ready(function(){wppaCropper[' . $id . '].setAspectRatio(' . $value . ');});';
2065
+ // wppa_add_inline_script( 'wppa-admin', $the_js );
2066
+ }
2067
 
2068
  wppa_echo( '
2069
  </td>
2079
  </span>
2080
  <input
2081
  type="button"
2082
+ class="wppa-admin-button button"
2083
  id="imstackbutton-' . strval( intval( $id ) ) . '"
2084
  onclick="wppaTryMagick( ' . strval( intval( $id ) ) . ', \'magickundo\' )"
2085
  value="' . esc_attr( __( 'Undo', 'wp-photo-album-plus' ) ) . '"
2086
  title="' . esc_attr( __( 'Undo last Magick command', 'wp-photo-album-plus' ) ) . '"
2087
+ style="margin-left:4px;' . ( $magickstack ? 'display:inline;' : 'display:none;' ) . '"
2088
  />
2089
  </td>
2090
  </tr>' );
2100
  id="fs-img-' . $id . '"
2101
  src="' . esc_url( wppa_get_photo_url( $id ) ) . '"
2102
  style="float:left;max-width:100%"
2103
+ />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2104
  </div>
2105
  </td>
2106
  </tr>
wppa-scripts.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * This file contains all functions for activating javascript
6
  *
7
- * Version 8.2.02.005
8
  */
9
 
10
  // Place all wppa related js declarations in the header, both admin and frontend
@@ -243,6 +243,10 @@ global $wpdb;
243
  wppaUploadToThisAlbum = "' . esc_js( __( 'Upload to this album', 'wp-photo-album-plus' ) ) . '",
244
  wppaCloseText = "' . esc_js( __( 'Close!', 'wp-photo-album-plus' ) ) . '",
245
  wppaCropper = [],';
 
 
 
 
246
 
247
  // Find ajax url
248
  $method = wppa_opt( 'ajax_method' );
4
  *
5
  * This file contains all functions for activating javascript
6
  *
7
+ * Version 8.2.02.008
8
  */
9
 
10
  // Place all wppa related js declarations in the header, both admin and frontend
243
  wppaUploadToThisAlbum = "' . esc_js( __( 'Upload to this album', 'wp-photo-album-plus' ) ) . '",
244
  wppaCloseText = "' . esc_js( __( 'Close!', 'wp-photo-album-plus' ) ) . '",
245
  wppaCropper = [],';
246
+
247
+ /* ImageMagick */
248
+ $result .= '
249
+ wppaImageMagickDefaultAspect = "' . wppa_opt( 'image_magick_ratio' ) . '",';
250
 
251
  // Find ajax url
252
  $method = wppa_opt( 'ajax_method' );
wppa-setting-see-also.php CHANGED
@@ -72,7 +72,7 @@ global $wppa_subtab_names;
72
  '3' => __( 'Thumbnail layout settings', 'wp-photo-album-plus' ),
73
  ),
74
  'slide' => array(
75
- '1' => __( 'Sllideshow component specifications', 'wp-photo-album-plus' ),
76
  '2' => __( 'Slideshow component sequence', 'wp-photo-album-plus' ),
77
  '3' => __( 'Slideshow layout settings', 'wp-photo-album-plus' ),
78
  '4' => __( 'Slideshow dynamic behaviour', 'wp-photo-album-plus' ),
72
  '3' => __( 'Thumbnail layout settings', 'wp-photo-album-plus' ),
73
  ),
74
  'slide' => array(
75
+ '1' => __( 'Slideshow component specifications', 'wp-photo-album-plus' ),
76
  '2' => __( 'Slideshow component sequence', 'wp-photo-album-plus' ),
77
  '3' => __( 'Slideshow layout settings', 'wp-photo-album-plus' ),
78
  '4' => __( 'Slideshow dynamic behaviour', 'wp-photo-album-plus' ),
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.2.02.006
9
  *
10
  */
11
 
@@ -822,7 +822,7 @@ static $allowed_tags;
822
  'style' => true,
823
  ) ),
824
  'option' => array_merge( $sa, array(
825
- 'selected' =>true,
826
  'value' => true,
827
  'disabled' => true,
828
  ) ),
5
  * Contains wrappers for standard php functions
6
  * For security and bug reasons
7
  *
8
+ * Version 8.2.02.008
9
  *
10
  */
11
 
822
  'style' => true,
823
  ) ),
824
  'option' => array_merge( $sa, array(
825
+ 'selected' => true,
826
  'value' => true,
827
  'disabled' => true,
828
  ) ),
wppa.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  * Plugin Name: WP Photo Album Plus
4
  * Description: Easily manage and display your photo albums and slideshows within your WordPress site.
5
- * Version: 8.2.02.007
6
  * Author: J.N. Breetvelt a.k.a. OpaJaap
7
  * Author URI: http://wppa.opajaap.nl/
8
  * Plugin URI: http://wordpress.org/extend/plugins/wp-photo-album-plus/
@@ -24,7 +24,7 @@ global $wp_version;
24
 
25
  /* WPPA GLOBALS */
26
  global $wppa_api_version;
27
- $wppa_api_version = '8.2.02.007'; // WPPA software version
28
  global $wppa_revno;
29
  $wppa_revno = str_replace( '.', '', $wppa_api_version ); // WPPA db version
30
 
2
  /*
3
  * Plugin Name: WP Photo Album Plus
4
  * Description: Easily manage and display your photo albums and slideshows within your WordPress site.
5
+ * Version: 8.2.02.009
6
  * Author: J.N. Breetvelt a.k.a. OpaJaap
7
  * Author URI: http://wppa.opajaap.nl/
8
  * Plugin URI: http://wordpress.org/extend/plugins/wp-photo-album-plus/
24
 
25
  /* WPPA GLOBALS */
26
  global $wppa_api_version;
27
+ $wppa_api_version = '8.2.02.009'; // WPPA software version
28
  global $wppa_revno;
29
  $wppa_revno = str_replace( '.', '', $wppa_api_version ); // WPPA db version
30