diff --git a/wp-content/plugins/nextgen-gallery/.hg_archival.txt b/wp-content/plugins/nextgen-gallery/.hg_archival.txt new file mode 100644 index 0000000000000000000000000000000000000000..c1ddfd79405027a8540c236e365d9b0558891eff --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/.hg_archival.txt @@ -0,0 +1,4 @@ +repo: 2b82bc45fbe039c6f4c9f0c667e9cd1ee4d84cbb +node: ca2225de1b2aff836e1fe9d7ff3a0f42820524ce +branch: default +tag: 2.1.2 diff --git a/wp-content/plugins/nextgen-gallery/.hgignore b/wp-content/plugins/nextgen-gallery/.hgignore new file mode 100644 index 0000000000000000000000000000000000000000..05a2ff461ac5cb0066ce18717c931227f5ef9a18 --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/.hgignore @@ -0,0 +1,4 @@ +syntax: glob + +package.* +\.idea diff --git a/wp-content/plugins/nextgen-gallery/.hgsub b/wp-content/plugins/nextgen-gallery/.hgsub new file mode 100644 index 0000000000000000000000000000000000000000..a73849e5e7713c54b1749d539dfa1f9bd0e6ea4d --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/.hgsub @@ -0,0 +1 @@ +pope = https://bitbucket.org/photocrati/pope-framework diff --git a/wp-content/plugins/nextgen-gallery/.hgsubstate b/wp-content/plugins/nextgen-gallery/.hgsubstate new file mode 100644 index 0000000000000000000000000000000000000000..6b10a07832f97e9984a3e4696c88fd7642930d0e --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/.hgsubstate @@ -0,0 +1 @@ +1195e4b40c1123d4a20aeb29bc66e6daf9f49deb pope diff --git a/wp-content/plugins/nextgen-gallery/.hgtags b/wp-content/plugins/nextgen-gallery/.hgtags new file mode 100644 index 0000000000000000000000000000000000000000..9ed4d8bab9f5252a12971d23a7954ea4fc1068f4 --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/.hgtags @@ -0,0 +1,309 @@ +c22f21a2bd8d8bf6aa9e021a591de31a156a77ea 1.9.3 +19435d5f5312eda6df6700de6d21439538f7fb76 1.9.4 +d3d16785c99c14526ea3596bf0e2c22a93dda93f 1.9.5b1 +c0a33c2622b8bdbd7ae90c3cffa787687c0be675 1.9.5 +1426e43fc1b089e56dc57b1f7472d8f2f2585499 1.9.6 +06fdf04bbdb6d45033cef62bc07537f37af9fb7c 2.0-iteration1-beta1 +d1894508dbf7271cd69021575a1fdb3ac408fa74 2.0-iteration2-beta1 +6bff912e4d52efb830bfc2b47b99af1067116154 1.9.7 +84846e44fc7f163109f0cc6b47b279553e63b67d 1.9.9 +420d79fe7fe2e3378fd6653611fab5f1e3cf8423 1.9.8 +7d5b62598117470b89f6622612264468d1b20ad6 1.9.10 +34c750705305641be27f539a38ced81c565b3ce5 1.9.11b2 +002fd0379c6f40a89c76b6ac2447c3af155fb252 1.9.11 +bc47cb99b1005165faf8e11e7d32a52a6a41d2c6 1.9.12 +5ba21de4f312312d9f25828736db1b55ccca9c42 1.9.13-beta1 +6a3aa937e2bc3cd2c4eaafa52d5a5c62c6c50530 1.9.13-beta2 +cc3551eed9ae269d444aa399b8e40bf02bee81d8 1.9.13 +e6aa8d5e387e7375d2bb9e4acdffce076c69f87a 2.0-iteration6-beta1 +3c916309e0d751f91a397ce323bd4c4092e0973f 2.0-iteration6-beta3 +564694987bf896a18a6be6ee5749c077d919d035 2.0-iteration6-beta4 +db33ec1a44411c98502ef3dee24c78cf147268ed 2.0-iteration6-beta5 +db33ec1a44411c98502ef3dee24c78cf147268ed 2.0-iteration6-beta5 +7e545ff9d3b60b198d449e3f4f3c59f560ad02a8 2.0-iteration6-beta5 +42ff66da2b7c00a26773537b3d9cf263b6396f40 2.0-beta1 +f0881a953d1a60a5cebdda6b94d5a5752be38ed8 2.0-beta2 +ce764d49e2513451cbf2e72d42793e8ee4817a61 2.0-beta3 +2700628c807ce3119c3ff55da354f3daa75d6ebb 2.0-beta4 +4f4cdd0c7e46da14f253ad095b4a6e0a21166b78 2.0-beta5 +46242ec25f37e06636032f4ac75959452d205728 2.0-beta6 +5212acff7f5bcd1bb904d090479fe89cfd8fad42 2.0-beta7 +b1cb40ac16f74cada18f715c9f8d84bff6948a44 2.0-beta8 +bb1d0e65ed013ed96537f8674fbe0f9dfeb2ade5 2.0-beta9 +aed1d6581a316594483ca76f4d484cbf2c8e7241 2.0-beta10 +929be7639219e8ddbb3b06a7b47f1a4151e28f27 2.0-beta11 +46e783c3ae321a850a27a88eb14f681b0180904a 2.0-beta12 +af57a34e5c5134a5a906bd99b97e4b0144f0e2ec 2.0 +af57a34e5c5134a5a906bd99b97e4b0144f0e2ec 2.0 +c3739d04ae4c82f31cd98f0934fce1580ca95678 2.0 +c3739d04ae4c82f31cd98f0934fce1580ca95678 2.0 +fb360f3d8afd8194cd888c7ed4039b5019c6ce20 2.0 +2f0b48591a3dbb5853b7493579ee23685f155a34 2.0.1 +bfffda28db28e7ba1a123059584173c915d21d61 2.0.2 +48073ff55922a08e0dca5a51ccd8a548e8f4c24a 2.0.3 +f889eade3645a81b7b2af3d08f9d421ea98a1b99 2.0.4 +3904ab5d5140cb0d1a3f0dfd9e45d84b6e3d5190 2.0.5 +61f8f12cd5a5d8d09f3a01d53d01e48c43048b81 2.0.6 +61f8f12cd5a5d8d09f3a01d53d01e48c43048b81 2.0.6 +f2d8aa640e3e2611e29d5a11c41d2b7b64977bcb 2.0.6 +5befa4717c0244fdb61bbe4091659c37551e738d 2.0.7 +5befa4717c0244fdb61bbe4091659c37551e738d 2.0.7 +c116c3ea1e840a94a66c7b8f67f52ecc8de4c0ec 2.0.7 +14a1e19df9bf59949a0bacb741ed25d1260acac7 2.0.8 +096a346600cea8632a92c786b528fda4b20d8f78 2.0.9 +5d97253586d1b72228e8f0c179f9d7ad661ac771 2.0.10 +df53553eede7745c2d2ca69579d218240b768651 2.0.11 +db99493f28d4f062db9c472cd054fb756fd2bca7 2.0.12 +cd8233a6ecd0d08010bae08e5eacdfd522e1adba 2.0.13 +d5547264e3a7fbc037ca7553dd3f17c9a8e39b26 2.0.14 +851ab728a3735c67cface37c176cf0db25d020a5 2.0.15 +f579aa82e13f4318ae7afe37eabdcf151002497c 2.0.16 +0e6f234b6b9d25b7a89e5286eb6aa2b71e022ca0 2.0.17 +3b180e1586788fddb3ad00ee421bb8f8c370cdbf 2.0.18 +2e44327019e9d5131af5f954eb75ce5c147e53ab 2.0.19 +d3a62347a815bff6c0ea4af296e18882c36bbb2e 2.0.21 +d3a62347a815bff6c0ea4af296e18882c36bbb2e 2.0.21 +ade5e5d6faf79108aba4978282973f8e32dd1dfa 2.0.21 +f99a9099f9be8d2f364cef6b5e177f6a2a250cdc 2.0.22 +cd34a50e1a6a4b0ba6166894d00d3206f8e843ff 2.0.23 +60f42f617a6bacb14439f5b436402cea4186084c 2.0.24 +c6de7e0e9f0aca49ee34d00d52f4a42156985725 2.0.25 +846f4eb17466a6920e5a3f4f3df89111f83e734e 2.0.26 +7eb85961e1928030452ad4f3d98f2d9da2d158e9 2.0.27 +982f8fc14a798f506b8e9d4e9beedee5edad0639 2.0.29 +f60119c6c3dc2c636d611b30ba56ba0683188ad3 2.0.30 +f60119c6c3dc2c636d611b30ba56ba0683188ad3 2.0.30 +64106868412b49e838af99d00147a0eef65c8828 2.0.30 +429dd6107f6ee8a43572dd9c4000f2e49755fce8 2.0.31 +429dd6107f6ee8a43572dd9c4000f2e49755fce8 2.0.31 +2a6d926c7d2ebe80741f184013578a56278b4c83 2.0.31 +38d33d179d4eeb98a55bca96c69de62d49664abf 2.0.33 +bba219ef10ec07e7af4ab49e4eae0d224c6ba17c 2.0.37 +cd17101d71594f3baf193c5e0c3e2db3fbd64014 2.0.39 +f74e74f116ff27a904c30f24654eb348ee612893 2.0.40 +0cc07acf8440979cfd1ab635b696b180fee0f6e4 2.0.44 +fd6936d39e6d0133b376287478d70c46b241e4c6 2.0.45 +d015157e9e7de7cc4694a943e5045184b7173601 2.0.46 +b410131a1d593808c9efb02cf72e3b24f6542ae1 2.0.52 +92d4f189eb24104af078fad20f2d000d481fb95a 2.0.52 +ead7d7906f7a938d3daaf20be6b633296115a341 2.0.54.2 +207059dbea8ba0ee8909ed2596302ad997c03d16 2.0.54.4 +bd2e322ca9e0f9ef7710038e64450efc348ea376 2.0.54.5 +404f302ca87ba8bff7f4a828213d11ab9254422d 2.0.54.6 +1b68903a9c7d6e231e2b35bd6801f7d67e6df354 2.0.54.7 +c241ac13b2426992407d2d51d1c0c747375039c3 2.0.54.8 +82278277251cabe56cda3fe7544a4052dd04836a 2.0.55 +8f79cc47e1530659ed6ed298811bd4e8667b8d4e 2.0.55.1 +3adc27e4bed931356e3603fbc08a278ebd4e2682 2.0.55.2 +0ceab169e5f53d060494ae7a6934b6082549898d 2.0.56 +7c52d89d6d526e6e33389ea4c82329684d7e45f0 2.0.56.4 +ff95be805f513a732d37fdd3c62275faa04c1696 2.0.56.5 +1dbc17567eadf6e635f0953985a1eb3f0f3fbbec 2.0.57 +c438496f392706712c2b38cb5ab539c62d6f9103 2.0.57.1 +a1f3a060336d3ac67924c2c06ac8eb485e873074 2.0.58 +000103cae336eb6e4d7705b0ece1249b5c22964a 2.0.58.2 +24fdeaadfc89bf3a8309446af24021b207a1afe8 2.0.58.3 +8e6097a6204f54795328b0cfca803038d7433617 2.0.58.4 +5d35fb1a8f41f6a6b52307e5d991fb869698614b 2.0.59 +e016fcbe0b07f4994797a9ab9e84705ab2441101 2.0.59.1 +2a6981ecbb6bf46391a0a64222e0fbc3d7cab074 2.0.60 +ef431a89c92211853e693a4d209a3d6a511ef1ff 2.0.61 +4c1fd5674af6ca926d7acc75a2cb51bb0feb5c34 2.0.61 +5cc53b5be0da58c2e96d239af9d719d253589c16 2.0.62.1 +6a660ce057c6980c28cab088c0457b462b91b9dc 2.0.62.3 +0668bbbd518657a90ee0fa40b0601fcf6cee0bfc 2.0.62.6 +b2d8da06c7761dc9620bd1e491dd0659acaffd5a 2.0.62.7 +620dc0a22e82fb269f758f5e8239a9683bd3dcce 2.0.62.8 +f88a399a5fdaed2ffcff0ff679b25d48304b30a3 2.0.62.9 +b26123de4855a9134dabd59ebf4adaf0491726c5 2.0.63 +d0dddf7c18e0a0536983fc6ccf5ca9f5d6080a18 2.0.64 +639d48bdd1f1fe488bbc7072c2b6c3b29aeb3f50 2.0.65 +29e7f91672a777c556847b018f360053df407609 2.0.65.1 +d6ff5031601b089d33df7bfe13cdb2935c53f55d 2.0.65.2 +6a4843460822dd54588f5fed9b928ec89509cc48 2.0.65.3 +490410496a31a44a7a555a625d49c5da9c335136 2.0.65.4 +fc8cb29df38667baeb022158645d47ec23c06cb8 2.0.65.5 +c6786f6395ac9462b3918792942b856a22c28ebd 2.0.65.6 +dceaca7bc530ef21126fe73bb512edfd5be61666 2.0.65.7 +e15eba4fa6032b0c6067700f932a4fa94d6c3a13 2.0.66 +75af4a95b4f3badb32fdd90c7e612c4eb38db01a 2.0.66.1 +5255fc3ca4c4f9e5d97c69927e74b2c2d25e0d72 2.0.66.2 +06e409045799e4a7bb0c4dc082046f6353609ab8 2.0.66.3 +5b24ed5da369a383c1b9f66b588d9ccfc33b321d 2.0.66.4 +d0b373c06ba870167f55b72c7f2a69f424733133 2.0.66.5 +cf3bf794fdf5bf7665c4874f584c32b44e0e5cff 2.0.66.6 +11d840dcb069bc940e5a0971133b4e438b4322c9 2.0.66.7 +b4b3408e4673c917f97d55cff5fa185f30197693 2.0.66.8 +b4b3408e4673c917f97d55cff5fa185f30197693 2.0.66.8 +c6dc1a3145896dc12fe83900399ce1ffc47e459e 2.0.66.8 +7b51dc2ea9544bcb6f48e92f840c79ac926e9e5a 2.0.67 +16bb48e7fcfc174e0eb18b559c0643a6e6fca74f 2.0.66.9 +7ecee015aecfccc5e53e08ff2a992aeb2a184492 2.0.66.10 +161a4634d5ba1d55d87509fe0c61f81ef498e69c 2.0.66.11 +713beb74fbb52e91726ecd26965d0e10a54ef2f8 2.0.66.12 +3b23e9c1316a926bc223cfabe7b7b529cbd6f56a 2.0.66.13 +e1071a97c2db5ef292789b8232707694ae9c4422 2.0.66.14 +811fedd98a08a4fa7aad7879ac07c38ff6a24ab5 2.0.66.15 +7cf1b53aba8dfe5ba152ba42d467d92f3cf4407f 2.0.67.1 +cab310a032e3a2dbf0e137350e6e8fd090844456 2.0.67.2 +6b32a3da0e5c824098517ff70fcaadc80bb22ccc 2.0.66.16 +1f4057a5c7c6e6cd8157b25bca06f001513ada62 2.0.66.17 +1f4057a5c7c6e6cd8157b25bca06f001513ada62 2.0.66.17 +f447a64022561d94f2d8010cca5ee44a4a5d4529 2.0.66.17 +28d378a49056646ad60ca92973041aeac6c9734a 2.0.66.18 +95086d9897747465df2f2e1b0c9161ea4fff42c6 2.0.67.3 +f2e372d7fcae2646e0034aa1a8db37f8f206835e 2.0.66.19 +159088a02c7f9d43f9679c18e0da6be594d8d8ac 2.0.66.20 +1f6375fc996139e90b19e2d22d1c3b1034bee996 2.0.66.21 +1eb83c0b5439c7e60a5279622840119626b0b45a 2.0.66.23 +33c5a650b970cf20e673dc51d3a7698d757920b0 2.0.66.24 +8c3f88621705d800206cd8ff979ae2c81e089d4e 2.0.66.24 +6d08560d0f08e1e434eccf2dfa01199cea9838a9 2.0.66.25 +0b251dfc7a93b4ef95534251d2f69cb6b044cf34 2.0.67.4 +d58801a35758711d07494b0d47763946a8a914f2 2.0.66.26 +93305e7e8412c29b2854337f9b85f796d88fa775 2.0.66.27 +5346464bcf4cf6f307e180a6a5fba0adcf4fb7a0 2.0.67.5 +6920fdb52a0919eb0be0126dca8b09361235039b 2.0.67.7 +4455dda0c4fa7cc32cd75b6f01f30ba9757462e6 2.0.67.8 +e70a74de6a4fcd239a40c5dddba1cadeae1c8457 2.0.67.9 +0f5133910e05d9c6dc839673990a249166f3a695 2.0.67.10 +6fc2222e6f4abe7f911b91057a6467686001c0d8 2.0.67.11 +2cf32f49bcf19e2617f2a3bd1239c64b89872ed2 2.0.66.28 +6d08560d0f08e1e434eccf2dfa01199cea9838a9 2.0.66.25 +2ffa42aedc9165fd9ac858f2418862739f261699 2.0.66.29 +949cbe602073d8547045003cceb31253a78b251f 2.0.66.29 +cd0b56cb68df7055ef402d8da7108493125d2361 2.0.67.12 +d3c286994e9bc95bee465ecb2c53882b527d57d7 2.0.67.13 +4b1fed1745ab51f7789d53685919eadd365d43f8 2.0.67.14 +5e9b6061c8cd27fb6eed97774416b02eb23938b0 2.0.67.16 +1cc0f2e25f257ea8dfecaab770eab3de6e2848e3 2.0.67.17 +b43e4536b6d0c07e12d5a457fb1563ec40952be9 2.0.67.18 +45449d377063659c69aeed08193bc88f51d36f36 2.0.67.19 +1354e95ceec8f0ad4f28c23ab1dd84ddca620b1d 2.0.67.20 +dcb0b4844a9c896a2eea408db7a0a800f482fc40 2.0.67.21 +1eda34d12dc5bae92f0714a41d8011e951e5ead3 2.0.67.22 +cab765af36d43e0caa3c382c51fbdb781810f2f3 2.0.67.23 +6211ef47de31b78ceef00e78e30d0ef9d3221b7a 2.0.67.24 +8bc0cba4b34edbd6fb48cad0d540dda7d08225b1 2.0.67.26 +0e897a40d66324dc262d53b6f3a925816dff7e7c 2.0.67.27 +0e897a40d66324dc262d53b6f3a925816dff7e7c 2.0.67.27 +0000000000000000000000000000000000000000 2.0.67.27 +0000000000000000000000000000000000000000 2.0.67.27 +b045341bb4763840f92f2997af14735d5ccc7b21 2.0.67.27 +f8bd76179730647293b4f32fb336d759f3331f58 2.0.67.28 +3f85b27606d93e391308ac50f0ae07eec9cce8dc 2.0.67.29 +42c79d7df1d748348bd6feeb21a2801bd9f24c35 2.0.67.30 +849394381c0840787e529153c462e00113170277 2.0.67.31 +9521b8d90e7ee1447881bbac447d37c791a1067c 2.0.67.32 +1aa57a6fb0746d69db3639e6dbf44d48ed83a25b 2.0.67.33 +d5c572a9d9cb8aa45702704e22192a621a05f2c6 2.0.67.34 +2ffa42aedc9165fd9ac858f2418862739f261699 2.0.66.29 +0000000000000000000000000000000000000000 2.0.66.29 +4766b97c22d40138789d2969a289ded6d844cb51 2.0.66.30 +9ee1d4e286ed344e2ebd7fd9424775ed4a6fe683 2.0.66.31 +3b267081e928e8b2f0fa77c9cdff43d7f2ff81a7 2.0.66.32 +61ba38119eebb76163d29b26d30a965eb6d33f93 2.0.66.33 +39943959828f13f2d9f49d2791c6f31b435b8751 2.0.66.33 +382242955a9d85b12c5b1052748625c70f6a37c8 2.0.66.34 +f996791ca541dfd92c660c97b3f01506c8d35f35 2.0.66.35 +be2299587ba8093dcffe8d9224fb6a03d08bddf1 2.0.66.36 +382242955a9d85b12c5b1052748625c70f6a37c8 2.0.66.34 +0000000000000000000000000000000000000000 2.0.66.34 +0000000000000000000000000000000000000000 2.0.66.34 +9f89a707661af34bb80f2c58da665c794f3607af 2.0.66.34 +05525c1fb8922394ce9709a8e665cca269f0989a 2.0.66.37 +6997c67275ae046f82bdae451e5b166f76e90207 2.0.67.36 +b7fae9b29a12a41543005a251fd756d4ffe8da16 2.0.67.38 +81b769da4fc178329246a7ef05433d5b7c7f540c 2.0.67.39 +a78cb8f1502737e00a05f24274579e8cd20acdb9 2.0.67.40 +7ca063412bb72ccde21b25dcc8d6d54de170a386 2.0.67.41 +fa96f40ef50718908002f9b405dd290675daafed 2.0.67.41-alt +2c67ef76a6282c203696e7501dfe1499ca473534 2.0.67.42 +245ee7f983fde0a6c70b466d9560e74c79a573cf 2.0.67.43 +c178e0563779660cf944182027836c7909bae722 2.0.67.44 +174a151589ed413c7e6d23fbad0169705d9b2956 2.0.67.45 +f833125e12e6c35ba487dfb149c0614b4438dce4 2.0.67.47 +f4738872252cc10118414ec39e1578c57b978a5b 2.0.67.48 +aa2ab5a0581ed5700a717a5d189d111ad119c7c4 2.0.67.49 +90fdca781ded6f430d83ee48c394328073adcea6 2.0.67.50 +90fdca781ded6f430d83ee48c394328073adcea6 2.0.67.50 +0000000000000000000000000000000000000000 2.0.67.50 +0000000000000000000000000000000000000000 2.0.67.50 +032fa0d44eecfbb3b5e107a15d6cfd180ccd2184 2.0.67.50 +8be94df6613b22e88b53f7ae783b90a3dc910244 2.0.67.51 +9cd1c5e93e411d8a84a79149d3caf55a13e4e19f 2.0.67.52 +c09fa13af96ac095303c06ddd82b2b754e41c25a 2.0.67.53 +6934a755a628f2d692460ca3e7cdd5fb6d550453 2.0.67.54 +288a9fd5cc277ca0207f8e65e8b4d2f0aa2db24c 2.0.67.55 +af11484c4bdece42fbfabf0bc3106e7cefc987ec 2.0.67.56 +3a5df6576c2588d7f6b91db97826ef255a3c02c5 2.0.67.57 +22578e5cb3c259bc33699a4e8b0e5f137bd412a3 2.0.67.58 +9a2918fccaa5e350f4edf4aba8441925d3908850 2.0.67.59 +cdfcf5afab7c2c489d3271ad9b13f05cc1ad2ca4 2.0.67.60 +9255c425b91f2717f2b6ca51abe078289a73e01f 2.0.67.61 +b4fabcf80dd00667179355ac47b12a920c047c2d 2.0.67.62 +b4fabcf80dd00667179355ac47b12a920c047c2d 2.0.67.62 +0000000000000000000000000000000000000000 2.0.67.62 +0000000000000000000000000000000000000000 2.0.67.62 +ce5295230db4b8810fd10777a97cc73b73642714 2.0.67.62 +278e683552f094f855af5c280136c29b38add140 2.0.67.63 +32c7eff8d9fcb236b61a1a88c7b854ab666bb014 2.0.68 +e614357ef4c42015595284ba805b88a440e10ca4 2.0.70 +4bdfeeddc58169e129fa414591440e1bf62f3365 2.0.71 +4d7a4df8f2588a8d4867a9730b3da0fc2dfd3487 2.0.72 +4d7a4df8f2588a8d4867a9730b3da0fc2dfd3487 2.0.72 +0000000000000000000000000000000000000000 2.0.72 +0000000000000000000000000000000000000000 2.0.72 +c6e2e1431af5d6cd7bc49c07e167a71d937c921e 2.0.72 +2c16ebb1e99e48ad53b7c71865bdb4f828901a03 2.0.73 +4e20a2d2c0ca46a04c95f5487eabd8d02e1cbfd3 2.0.73.1 +45cd2911f1f2a9cba9736c3d08f52d994c0eb6f7 2.0.74 +5b35e496669ed583d00e9b0ce68677c7fce17699 2.0.74.1 +24b9a32da4a94238b4283dd5922c96000c456a4d 2.0.75 +fffa3417c7d12b9bd2bcbfc52802bfa165580acc 2.0.76.1 +58411c3486e97429110b14323050e507908ba1f0 2.0.76.2 +33e049382f939a9f4a69563f9c19a17fcd711c05 2.0.76.3 +8994240050c95ef9467b0677b2a4fedd7f43ce2a 2.0.76.4 +9ce01a2939098a9f6fd3dc3a75b89a7b8d50ea7a 2.1 +bfedd0b35f2026e255c69d07edfa75228261aeb1 2.0.77 +05de352a0fad8913965b5434e65272d2e44febe6 2.0.77.2 +a43f86ad7c62aa9eb883c1c8f2ee7156a726c7af 2.0.78 +86abe906475fb25234fab869d03082a0a0fcba5a 2.0.78.2 +24a7242440216b0e9de87a2a9cac9a9ad5679681 2.0.78.3 +4966ecb00b551d0257f794fc234556dc4e5c923c 2.0.78.4 +67a69544d2ae3025ea018743d86d6890f4cea09e 2.0.78.5 +2ed5f4d1c1b86dc355dbec73ee023858d16f5932 2.0.77.3 +a1941ca75c83c8ef644221154d41c5e65adb00b8 2.0.79 +db1dd16a6bc94fd7a5977ec7ab61b65f155bb33c 2.0.80 +f0c7bc4fea8cb00d38e5fffdbb920f88908a80e8 2.0.81 +1a42ef072397b4bd239d88574027b2ebb404a45a 2.0.82 +03a4df18fc95feb9f44a4e68964c530c5a25d9be 2.0.83 +418fdc5a7f2c04283fb3c36e9b8b7028c6aec0b4 2.0.84 +81bac66ab1d3525ccb8fe4162719a429e1ab43d1 2.1.84 +81bac66ab1d3525ccb8fe4162719a429e1ab43d1 2.1.84 +0000000000000000000000000000000000000000 2.1.84 +7457ec34e37f2ea76e7e5ec71a9347ae3b2e3d45 2.0.85 +3c1f28c9074eb71bf7abd95f5d5c4f363cef70c9 2.0.86 +7244ee054fa09a29c9a1eef693b6c40c528a64c1 2.0.87 +b85e6518695f82db0a26331e97aef3f8a4c84b6b 2.0.88 +5c529c48a6c7a3127e15a551358ded95b5f91738 2.0.89 +5a7da0ec89905f6a7c2b939c17e312974bc9c825 2.0.90 +641022ad985167e2f9789787c67e39d2c4f836bf 2.0.91 +cee255e599142af94ea042d446fa7ce1ae53d20c 2.0.92 +86f5629d63b2e52b119726895ddd2f541c1888eb 2.1.0 +86f5629d63b2e52b119726895ddd2f541c1888eb 2.1.0 +0000000000000000000000000000000000000000 2.1.0 +0000000000000000000000000000000000000000 2.1.0 +37ff3526d2471627b17b51d1bd6568def35e99e0 2.1.0 +37ff3526d2471627b17b51d1bd6568def35e99e0 2.1.0 +0000000000000000000000000000000000000000 2.1.0 +0000000000000000000000000000000000000000 2.1.0 +75383700145e5f627c989cb1134fec0030bcf857 2.1.0 +1ee69bf2d06e0ac6e8d74ab5fafe00cc66bffe15 2.1.1 +cbe47e4cefc75558b857c50d3efcbc8ce27a5636 2.1.2 +cbe47e4cefc75558b857c50d3efcbc8ce27a5636 2.1.2 +0000000000000000000000000000000000000000 2.1.2 +0000000000000000000000000000000000000000 2.1.2 +2fca6018f85c86f32518b4e601fba84823127dfb 2.1.2 +2fca6018f85c86f32518b4e601fba84823127dfb 2.1.2 +0000000000000000000000000000000000000000 2.1.2 diff --git a/wp-content/plugins/nextgen-gallery/changelog.txt b/wp-content/plugins/nextgen-gallery/changelog.txt index 244a836e2973b4786f06bf19e00e470cd7a3888a..24ee23d2782bc88b80dec6b247cb10d74370065b 100644 --- a/wp-content/plugins/nextgen-gallery/changelog.txt +++ b/wp-content/plugins/nextgen-gallery/changelog.txt @@ -1,6 +1,164 @@ NextGEN Gallery by Photocrati Media += V2.1.2 - 07.20.2015 = +* NEW: Ability to import from Media Library +* NEW: Added filter 'ngg_datamapper_table_name' +* NEW: Added filter `ngg_legacy_template_directories` for legacy template locator (thanks Ross McKay) +* NEW: Pagination available onManage Images page +* NEW: Added filter ngg_manage_images_items_per_page_array to control pagination options +* NEW: Added filters 'ngg_load_frontend_logic' and 'ngg_get_modules_to_load' +* NEW: Added filter 'ngg_add_page_shortcode' to control Manage Galleries > 'Create new page' content +* NEW: Added filter 'ngg_manage_albums_items_order' +* Changed: Removed PHP4 support +* Fixed: Ability to set NextGEN Image as Featured Image +* Fixed: Don't use resource manager in download requests for WP Photo Shelter +* Fixed: Updated custom jQuery-UI styling to resemble WordPress postbox styling +* Fixed: Styled plupload buttons to resemble WordPress buttons +* Fixed: Removed 'fixed' class from manage galleries table. Allows columns to adjust to content +* Fixed: Removed note about flash support and fixed typoe (thanks Rene Wolf) +* Fixed: Fixed typo in nggallery.po +* Fixed: Cache results of lookup_columns() to avoid multiple identical queries; thanks go to Alex Bradaric +* Fixed: Better WP-CPI detection +* Fixed: Removed unnecessary calls to parent::initialize() +* Fixed: Adjusted album-compact template to always include p.ngg-album-gallery-image-counter +* Fixed: Replaced empty gallery rendering in is_feed() with a link +* Fixed: Removed default settings for imagerotator, which is no longer supported +* Fixed: Optimizated scanning of images when importing a gallery +* Fixed: When a gallery is deleted, ensure that DB and filesystem are purged +* Fixed: Removed Insert Gallery Window box shadow +* Fixed: Ensure that file_exists() calls are prefixed with @ + += V2.1.0 - 05.18.2015 = +* NEW: Album breadcrumbs and pagination +* NEW: Ability to override builtin MVC templates +* NEW: Robust transient management +* NEW: Added the ability to set post thumbnails via XML-RPC module +* NEW: Added 'ngg_get_image_size_params' filter to control image generation +* NEW: Added 'ngg_basic_tagcloud_title' and 'ngg_basic_tagcloud_excluded_display_types' filters +* NEW: Added ngg_manage_images_items_per_page filter +* NEW: Added "ngg_get_image_url" filter +* NEW: Including Ukranian and Polish translations +* NEW: The ability to set template in widgets +* Changed: Default thumbnail dimensions set to 240x160 +* Changed: Product now adheres to Pope 0.12 and provides get_modules_to_load() +* Changed: Updated translations +* Changed: Removed link to capsman plugin in Roles accordion +* Changed: Taxnomies now use internationalized strings +* Changed: Image date/time meta data fields are stored as UNIX timestamps +* Secured: Uploading zips +* Fixed: Various PHP warnings and notices +* Fixed: Compatibility fixes for WPML +* Fixed: Ensure that backup image functionality fails gracefully +* Fixed: WP option 'ngg_do_upgrade' updated in every HTTP request +* Fixed; Empty $_SERVER['PATHINFO'] causing multiple routing issues +* Fixed: "Manage Galleries" display image alttext in the filename column +* Fixed: Various issues with the tag cloud display type +* Fixed: Integrity check when updating from 1.9.x +* Fixed: Image filenames substituting spaces for + which is only proper in the query string +* Fixed: Insert Gallery Window not working with nested levels of gzip compression +* Fixed: Imagebrowser as lightbox effect not working with pagination +* Fixed: Compatibility with MultiVerso Advanced File Sharing +* Fixed: "Add page" button not displaying on the next immediate page load +* Fixed: Double-escaping of non-latin characters +* Fixed: Imagebrowser pagination with custom templates +* Fixed: Custom CSS is enqueued late to ensure it's one of the last stylesheets loaded +* Fixed: Fixed watermarking PNG images +* Fixed: Using the "Import Metadata" bulk action overwrites existing data +* Fixed: Seconds were not retained from CaptureTime EXIF field +* Fixed: Conflicts created by our TinyMCE plugin +* Fixed: Image mapper setting gid to gallery name, not the unique ID +* Fixed: Restored nggdb->get_random_images(), nggdb->search_for_file, and nggdb->find_all_albums() +* Fixed: Allow gallery slug as parameter to nggdb::get_gallery() +* Fixed: Don't minify Plupload's i18n JavaScript +* Fixed: Custom template images not being given their full effect code attributes +* Fixed: When importing galleries from folders, allow symlinks +* Fixed: Use of C_Gallery_Mapper in C_Image_Wrapper +* Fixed: Properly handle themes that don't call wp_footer() or wp_print_footer_scripts() +* Fixed: Warning about missing style.php file on Network Admin -> Gallery page +* Fixed: Warning about getimagesize() failure when backing up an image + += v2.0.79 - 03.20.2015 = +* Secured: Sanitized C_Displayed_Gallery->_add_find_in_set_column() third parameter + += V2.0.78 - 03.12.2015 = +* Secured: AJAX actions for uploading images and importing folders now uses nonce checks + += V2.0.77 - 03.05.2015 = +* NEW: Added "ngg_get_image_url" filter +* Changed: Use a more reliable means of excluding Pro/Plus modules from using minified static resources +* Fixed: Imagebrowser pagination with custom templates +* Fixed: Custom CSS is enqueued late to ensure it's one of the last stylesheets loaded +* Fixed: Fixed watermarking PNG images +* Fixed: Using the "Import Metadata" bulk action overwrites existing data +* Fixed: Seconds were not retained from CaptureTime EXIF field +* Fixed: Conflicts created by our TinyMCE plugin +* Fixed: Image mapper setting gid to gallery name, not the unique ID +* Fixed: Restored nggdb->get_random_images(), nggdb->search_for_file, and nggdb->find_all_albums() +* Fixed: Allow gallery slug as parameter to nggdb::get_gallery() +* Fixed: Don't minify Plupload's i18n JavaScript +* Fixed: Custom template images not being given their full effect code attributes + += V2.0.76 - 02.24.2015 = +* Fixed: Compatibility checks for very old versions of NextGEN Pro +* Fixed: Zero-byte downloads in WooCommerce and WPE-Commerce +* Fixed: Invalid URL being enqueued if a custom lightbox is selected with no URL provided +* Fixed: Restored a method to nggAdmin to fix compatibility with NextGen Public Uploader +* Fixed: Bug preventing source='recent' from displaying images in the correct order +* Fixed: Include more quotation symbols in our shortcode manager (foreign language shortcodes) +* Fixed: WPML/ATP compatibility issue +* Fixed: $nggdb->get_gallery() returning a different result than before + += V2.0.74 - 02.20.2015 = +* Changed: Removed jQuery Lightbox and Highslide due to incompatible licensing with GPL + += V2.0.71 - 02.19.2015 = +* NEW: Module files are compiled into a single package file to reduce disk I/O +* NEW: All CSS stylesheets and Javascript source files are minified to reduce latency +* NEW: All lightboxes are configured using an in-memory management class. +* NEW: Uses Pope 2.0, benefiting from the new caching capabilities +* NEW: NextGEN Gallery's functionality is disabled if NextGEN Pro is incompatible +* NEW: Added ngg_effect_code filter +* Changed: Updated FontAwesome to 4.3.0 +* Changed: Updated select2 to 3.5.2 +* Changed: Removed PicLens / CoolIris integration +* Changed: Removed JSON API. Please use XML-RPC API instead +* Changed: For performance reasons, we cache FS & url lookups/calculations +* Changed: Greatly reduced the # of sql queries, and eliminated anything redundant +* Changed: For performance reasons, we cache datamapper and SQL queries +* Changed: Don't enqueue scripts or styles unless we require them +* Changed: Reduce the number of resources we enqueue for every HTTP request +* Changed: Ngg_Store now uses cookies instead of localStorage +* Changed: Insert Gallery Window is routed using wp-admin/admin_init +* Changed: Removed unused code from ngglegacy module. Created wrappers for commonly-used functions +* Changed: LZW module removed +* Changed: Legacy template drop-down selection now using select2 +* Secured: Restrict folder browsing to NGG_IMPORT_ROOT constant +* Fixed: Compatibility issue with PHP's transparent ZLIB compression +* Fixed: Imagebrowser as lightbox effect not working when non-default permalink slug used +* Fixed: Angled quotations marks used in shortcode parameters +* Fixed: Compatibility between ImageBrowser display type and TwentyFifteen theme +* Fixed: Allow pagination to retain query string url parameters when linking to other pages +* Fixed: Fixed pagination issues with slideshow galleries displayed as thumbnails +* Fixed: Fix C_GalleryStorage_Driver_Base->import_gallery_from_fs() not checking imgBackup +* Fixed: Fixed problem with default settings being applied multiple times +* Fixed: Fallback to "full" image sizes if "backup" images aren't available +* Fixed: Use M_DataMapper's serialization methods throughout the codebase +* Fixed: Conflict with WordPress SEO and get_the_excerpt() call +* Fixed: Don't run Resource Manager on wp-login.php or wp-sign.php +* Fixed: TinyMCE Image Editor conflict with Insert Gallery Window placeholder images +* Fixed: Fix Shutter positioning when admin bar is displayed +* Fixed: Allow deselection of a legacy template +* Fixed: Prevent conflicts when using imagebrowser as a lightbox effect +* Fixed: Pagination not working for slideshows using thumbnail integration + += V2.0.66.33 - 11.24.2014 = +* Fixed: Broken NextGEN Pro ecommerce-related shortcodes +* Fixed: Spanish PO file + += V2.0.66.31 - 11.21.2014 = +* Fixed: Broken shortcodes with WordPress 4.0.1 + = V2.0.66.29 - 09.17.2014 = * NEW: Added skip_excluding_globally_excluded_images property to displayed gallery objects * Fixed: SQL generation for random image selection @@ -10,7 +168,7 @@ by Photocrati Media * Fixed: Ability to override image files using XML-RPC = V2.0.66.27 - 08.18.2014 = -* Fixed: Missing class.frame_communication_option_handerl.php error +* Fixed: Missing class.frame_communication_option_handler.php error = V2.0.66.26 - 08.18.2014 = * NEW: Added fault tolerance to bulk action AJAX requests diff --git a/wp-content/plugins/nextgen-gallery/nggallery.php b/wp-content/plugins/nextgen-gallery/nggallery.php index 66b33a18a5865cd5855ff2c17c2408171842bfbd..d5456f34b5a9c9e13bafc6304304c4fd4bbefc04 100755 --- a/wp-content/plugins/nextgen-gallery/nggallery.php +++ b/wp-content/plugins/nextgen-gallery/nggallery.php @@ -3,8 +3,8 @@ if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You /** * Plugin Name: NextGEN Gallery by Photocrati - * Description: The most popular gallery plugin for WordPress and one of the most popular plugins of all time with over 9 million downloads. - * Version: 2.0.66.29 + * Description: The most popular gallery plugin for WordPress and one of the most popular plugins of all time with over 12 million downloads. + * Version: 2.1.2 * Author: Photocrati Media * Plugin URI: http://www.nextgen-gallery.com * Author URI: http://www.photocrati.com @@ -30,9 +30,9 @@ if (!function_exists('nextgen_esc_url')) { * presume it needs http:// appended (unless a relative * link starting with /, # or ? or a php file). */ - + if ( strpos($url, ':') === false && ! in_array( $url[0], array( '/', '#', '?' ) ) && - ! preg_match('/^[a-z0-9-]+?\.php/i', $url) ) + ! preg_match('/^[a-z0-9-]+?\.php/i', $url) ) $url = 'http://' . $url; // Replace ampersands and single quotes only when displaying. @@ -40,7 +40,6 @@ if (!function_exists('nextgen_esc_url')) { $url = wp_kses_normalize_entities( $url ); $url = str_replace( '&', '&', $url ); $url = str_replace( "'", ''', $url ); - $url = str_replace( '%', '%25', $url ); $url = str_replace( ' ', '%20', $url ); } @@ -79,6 +78,8 @@ class C_NextGEN_Bootstrap var $_settings_option_name = 'ngg_options'; var $_pope_loaded = FALSE; static $debug = FALSE; + var $minimum_ngg_pro_version = '2.0.5'; + var $minimum_ngg_plus_version = '1.0.1'; static function shutdown($exception=NULL) { @@ -137,38 +138,46 @@ class C_NextGEN_Bootstrap function __construct() { - // Boostrap set_exception_handler(__CLASS__.'::shutdown'); - $this->_define_constants(); - $this->_load_non_pope(); - $this->_register_hooks(); - $this->_load_pope(); + // We only load the plugin if we're outside of the activation request, loaded in an iframe + // by WordPress. Reason being, if WP_DEBUG is enabled, and another Pope-based plugin (such as + // the photocrati theme or NextGEN Pro/Plus), then PHP will output strict warnings + if ($this->is_not_activating()) { + $this->_define_constants(); + $this->_load_non_pope(); + $this->_register_hooks(); + $this->_load_pope(); + } + } + + function is_not_activating() + { + return !$this->is_activating(); + } + + function is_activating() + { + $retval = strpos($_SERVER['REQUEST_URI'], 'plugins.php') !== FALSE && isset($_REQUEST['action']) && $_REQUEST['action'] == 'activate'; + if (!$retval && strpos($_SERVER['REQUEST_URI'], 'update.php') !== FALSE && isset($_REQUEST['action']) && $_REQUEST['action'] == 'install-plugin' && isset($_REQUEST['plugin']) && strpos($_REQUEST['plugin'], 'nextgen-gallery') === 0) { + $retval = TRUE; + } + if (!$retval && strpos($_SERVER['REQUEST_URI'], 'update.php') !== FALSE && isset($_REQUEST['action']) && $_REQUEST['action'] == 'activate-plugin' && isset($_REQUEST['plugin']) && strpos($_REQUEST['plugin'], 'nextgen-gallery') === 0) { + $retval = TRUE; + } + + return $retval; } function _load_non_pope() { // Load caching component - include_once('non_pope/class.photocrati_cache.php'); - C_Photocrati_Cache::get_instance(); - C_Photocrati_Cache::get_instance('displayed_galleries'); - C_Photocrati_Cache::get_instance('displayed_gallery_rendering'); + include_once('non_pope/class.photocrati_transient_manager.php'); - C_Photocrati_Cache::$enabled = PHOTOCRATI_CACHE; - - if (isset($_REQUEST['ngg_flush'])) { - C_Photocrati_Cache::flush('all'); + if (isset($_REQUEST['ngg_flush']) OR isset($_REQUEST['ngg_flush_expired'])) { + C_Photocrati_Transient_Manager::flush(); die("Flushed all caches"); } - elseif (isset($_REQUEST['ngg_force_update'])) { - C_Photocrati_Cache::$do_not_lookup = TRUE; - C_Photocrati_Cache::$force_update = TRUE; - $_SERVER['QUERY_STRING'] = str_replace('ngg_force_update=1', '', $_SERVER['QUERY_STRING']); - } - elseif (isset($_REQUEST['ngg_flush_expired'])) { - C_Photocrati_Cache::flush('all', TRUE); - die("Flushed all expired items from the cache"); - } // Load Settings Manager include_once('non_pope/class.photocrati_settings_manager.php'); @@ -199,28 +208,76 @@ class C_NextGEN_Bootstrap if ($this->_pope_loaded) return; // Pope requires a a higher limit - $tmp = ini_get('xdebug.max_nesting_level'); - if ($tmp && (int)$tmp <= 300) @ini_set('xdebug.max_nesting_level', 300); + $tmp = ini_get('xdebug.max_nesting_level'); + if ($tmp && (int)$tmp <= 300) @ini_set('xdebug.max_nesting_level', 300); // Include pope framework require_once(implode( DIRECTORY_SEPARATOR, array(NGG_PLUGIN_DIR, 'pope','lib','autoload.php') )); + // Enable/disable pope caching. For now, the pope cache will not be used in multisite environments + if (class_exists('C_Pope_Cache')) { + if ((C_Pope_Cache::$enabled = NGG_POPE_CACHE)) { + $blogid = (is_multisite() ? get_current_blog_id() : NULL); + if (isset($_SERVER['SERVER_ADDR'])) + $cache_key_prefix = abs(crc32((implode('|', array($blogid, site_url(), AUTH_KEY, $_SERVER['SERVER_ADDR']))))); + else + $cache_key_prefix = abs(crc32(implode('|', array($blogid, site_url(), AUTH_KEY)))); + + C_Pope_Cache::set_driver('C_Pope_Cache_SingleFile'); + C_Pope_Cache::add_key_prefix($cache_key_prefix); + } + } + + // Enforce interfaces + if (property_exists('ExtensibleObject', 'enforce_interfaces')) ExtensibleObject::$enforce_interfaces = EXTENSIBLE_OBJECT_ENFORCE_INTERFACES; + // Get the component registry $this->_registry = C_Component_Registry::get_instance(); // Add the default Pope factory utility, C_Component_Factory $this->_registry->add_utility('I_Component_Factory', 'C_Component_Factory'); + // Blacklist any modules which are known NOT to work with this version of NextGEN Gallery + // We need to check if we have this ability as it's only available with Pope 0.9 + if (method_exists($this->_registry, 'blacklist_module_file')) { + $this->_registry->blacklist_module_file('module.nextgen_pro_lightbox_legacy.php'); + $this->_registry->blacklist_module_file('module.protect_image.php'); + // TODO: Add module id for protect image + } + + // If Pro is incompatible, then we need to blacklist all of Pro's modules + // TODO: Pope needs a better way of introspecting into a product's list of provided modules + if ($this->is_pro_incompatible()) { + $pro_modules = array( + 'photocrati-comments', + 'photocrati-galleria', + 'photocrati-nextgen_pro_slideshow', + 'photocrati-nextgen_pro_horizontal_filmstrip', + 'photocrati-nextgen_pro_thumbnail_grid', + 'photocrati-nextgen_pro_blog_gallery', + 'photocrati-nextgen_pro_film', + 'photocrati-nextgen_pro_masonry', + 'photocrati-nextgen_pro_albums', + 'photocrati-nextgen_pro_lightbox', + 'photocrati-nextgen_pro_lightbox_legacy', + 'photocrati-nextgen_pro_ecommerce', + 'photocrati-paypal_express_checkout', + 'photocrati-paypal_standard', + 'photocrati-stripe' + ); + foreach ($pro_modules as $mod) $this->_registry->blacklist_module_file($mod); + } + // Load embedded products. Each product is expected to load any // modules required - $this->_registry->add_module_path(NGG_PRODUCT_DIR, true, false); + $this->_registry->add_module_path(NGG_PRODUCT_DIR, 2, false); $this->_registry->load_all_products(); - // Give third-party plugins that opportunity to include their own products - // and modules - do_action('load_nextgen_gallery_modules', $this->_registry); + // Give third-party plugins that opportunity to include their own products + // and modules + do_action('load_nextgen_gallery_modules', $this->_registry); // Initializes all loaded modules $this->_registry->initialize_all_modules(); @@ -228,6 +285,36 @@ class C_NextGEN_Bootstrap $this->_pope_loaded = TRUE; } + function is_pro_compatible() + { + $retval = TRUE; + + if (defined('NEXTGEN_GALLERY_PRO_VERSION')) $retval = FALSE; + if (defined('NEXTGEN_GALLERY_PRO_PLUGIN_BASENAME') && !defined('NGG_PRO_PLUGIN_VERSION')) $retval = FALSE; // 1.0 - 1.0.6 + if (defined('NGG_PRO_PLUGIN_VERSION') && version_compare(NGG_PRO_PLUGIN_VERSION, $this->minimum_ngg_pro_version) < 0) $retval = FALSE; + if (defined('NGG_PLUS_PLUGIN_VERSION') && version_compare(NGG_PLUS_PLUGIN_VERSION, $this->minimum_ngg_plus_version) < 0) $retval = FALSE; + + return $retval; + } + + function is_pro_incompatible() + { + return !$this->is_pro_compatible(); + } + + function render_incompatibility_warning() + { + echo '<div class="updated error"><p>'; + echo esc_html( + sprintf( + __("NextGEN Gallery %s is incompatible with this version of NextGEN Pro. Please update NextGEN Pro to version %s or higher to restore NextGEN Pro functionality.", + 'nggallery' + ), + NGG_PLUGIN_VERSION, $this->minimum_ngg_pro_version + )); + echo '</p></div>'; + } + /** * Registers hooks for the WordPress framework necessary for instantiating @@ -235,9 +322,6 @@ class C_NextGEN_Bootstrap */ function _register_hooks() { - // Register the activation routines - add_action('activate_'.NGG_PLUGIN_BASENAME, array(get_class(), 'activate')); - // Register the deactivation routines add_action('deactivate_'.NGG_PLUGIN_BASENAME, array(get_class(), 'deactivate')); @@ -249,32 +333,97 @@ class C_NextGEN_Bootstrap add_filter('pre_update_site_option_'.$this->_settings_option_name, array(&$this, 'persist_settings')); // This plugin uses jQuery extensively - if (NGG_FIX_JQUERY) { - add_action('wp_enqueue_scripts', array(&$this, 'fix_jquery')); - add_action('wp_print_scripts', array(&$this, 'fix_jquery')); - } + if (NGG_FIX_JQUERY) { + add_action('wp_enqueue_scripts', array(&$this, 'fix_jquery')); + add_action('wp_print_scripts', array(&$this, 'fix_jquery')); + } // If the selected stylesheet is using an unsafe path, then notify the user - add_action('all_admin_notices', array(&$this, 'display_stylesheet_notice')); + add_action('all_admin_notices', array(&$this, 'display_stylesheet_notice')); // Delete displayed gallery transients periodically - add_filter('cron_schedules', array(&$this, 'add_ngg_schedule')); - add_action('ngg_delete_expired_transients', array(&$this, 'delete_expired_transients')); - add_action('wp', array(&$this, 'schedule_cron_jobs')); + if (NGG_CRON_ENABLED) { + add_filter('cron_schedules', array(&$this, 'add_ngg_schedule')); + add_action('ngg_delete_expired_transients', array(&$this, 'delete_expired_transients')); + add_action('wp', array(&$this, 'schedule_cron_jobs')); + } // Update modules add_action('init', array(&$this, 'update'), PHP_INT_MAX-1); // Start the plugin! add_action('init', array(&$this, 'route'), 11); + + // Flush pope cache + add_action('init', array(&$this, 'flush_pope_cache')); + + // Display a warning if an compatible version of NextGEN Pro is installed alongside this + // version of NextGEN Gallery + if ($this->is_pro_incompatible()) { + add_filter('http_request_args', array(&$this, 'fix_autoupdate_api_requests'), 10, 2); + add_action('all_admin_notices', array(&$this, 'render_incompatibility_warning')); + } + + add_filter('ngg_load_frontend_logic', array($this, 'disable_frontend_logic'), -10, 2); + } + + function disable_frontend_logic($enabled, $module_id) + { + if (is_admin()) + $enabled = FALSE; + return $enabled; + } + + function fix_autoupdate_api_requests($args, $url) + { + // Is this an HTTP request to the licensing server? + if (preg_match("/api_act=/", $url)) { + $args['autoupdate'] = TRUE; + + // If we're supposed to pass all Pro modules, then include them here + if (preg_match("/api_act=(ckups|cklic)/", $url) && isset($args['body']) && is_array($args['body']) && isset($args['body']['module-list'])) { + $pro_modules = array( + 'photocrati-comments', + 'photocrati-galleria', + 'photocrati-nextgen_pro_slideshow', + 'photocrati-nextgen_pro_horizontal_filmstrip', + 'photocrati-nextgen_pro_thumbnail_grid', + 'photocrati-nextgen_pro_blog_gallery', + 'photocrati-nextgen_pro_film', + 'photocrati-nextgen_pro_masonry', + 'photocrati-nextgen_pro_albums', + 'photocrati-auto_update', + 'photocrati-auto_update-admin', + 'photocrati-nextgen_pro_lightbox', + 'photocrati-nextgen_pro_lightbox_legacy', + 'photocrati-nextgen_pro_ecommerce', + 'photocrati-paypal_express_checkout', + 'photocrati-paypal_standard', + 'photocrati-stripe' + ); + foreach ($pro_modules as $mod) { + if (!isset($args['body']['module-list'][$mod])) $args['body']['module-list'][$mod] = '0.1'; + } + } + } + return $args; + } + + function flush_pope_cache() + { + if (is_user_logged_in() && current_user_can('manage_options') && isset($_REQUEST['ngg_flush_pope_cache'])) { + C_Pope_Cache::get_instance()->flush(); + print "Flushed pope cache"; + exit; + } } - function schedule_cron_jobs() - { - if (!wp_next_scheduled('ngg_delete_expired_transients')) { - wp_schedule_event(time(), 'ngg_custom', 'ngg_delete_expired_transients'); - } - } + function schedule_cron_jobs() + { + if (!wp_next_scheduled('ngg_delete_expired_transients')) { + wp_schedule_event(time(), 'ngg_custom', 'ngg_delete_expired_transients'); + } + } /** * Defines a new cron schedule @@ -297,7 +446,7 @@ class C_NextGEN_Bootstrap */ function delete_expired_transients() { - C_Photocrati_Cache::flush('all', TRUE); + C_Photocrati_Transient_Manager::flush(); } /** @@ -318,35 +467,35 @@ class C_NextGEN_Bootstrap */ function fix_jquery() { - global $wp_scripts; - - // Determine which version of jQuery to include - $src = '/wp-includes/js/jquery/jquery.js'; - - // Ensure that jQuery is always set to the default - if (isset($wp_scripts->registered['jquery'])) { - $jquery = $wp_scripts->registered['jquery']; - - // There's an exception to the rule. We'll allow the same - // version of jQuery as included with WP to be fetched from - // Google AJAX libraries, as we have a systematic means of verifying - // that won't cause any troubles - $version = preg_quote($jquery->ver, '#'); - if (!preg_match("#ajax\\.googleapis\\.com/ajax/libs/jquery/{$version}/jquery\\.min\\.js#", $jquery->src)) { - $jquery->src = FALSE; - if (array_search('jquery-core', $jquery->deps) === FALSE) { - $jquery->deps[] = 'jquery-core'; - } - if (array_search('jquery-migrate', $jquery->deps) === FALSE) { - $jquery->deps[] = 'jquery-migrate'; - } - } - } - - // Ensure that jquery-core is used, as WP intended - if (isset($wp_scripts->registered['jquery-core'])) { - $wp_scripts->registered['jquery-core']->src = $src; - } + global $wp_scripts; + + // Determine which version of jQuery to include + $src = '/wp-includes/js/jquery/jquery.js'; + + // Ensure that jQuery is always set to the default + if (isset($wp_scripts->registered['jquery'])) { + $jquery = $wp_scripts->registered['jquery']; + + // There's an exception to the rule. We'll allow the same + // version of jQuery as included with WP to be fetched from + // Google AJAX libraries, as we have a systematic means of verifying + // that won't cause any troubles + $version = preg_quote($jquery->ver, '#'); + if (!preg_match("#ajax\\.googleapis\\.com/ajax/libs/jquery/{$version}/jquery\\.min\\.js#", $jquery->src)) { + $jquery->src = FALSE; + if (array_search('jquery-core', $jquery->deps) === FALSE) { + $jquery->deps[] = 'jquery-core'; + } + if (array_search('jquery-migrate', $jquery->deps) === FALSE) { + $jquery->deps[] = 'jquery-migrate'; + } + } + } + + // Ensure that jquery-core is used, as WP intended + if (isset($wp_scripts->registered['jquery-core'])) { + $wp_scripts->registered['jquery-core']->src = $src; + } wp_enqueue_script('jquery'); } @@ -356,19 +505,19 @@ class C_NextGEN_Bootstrap */ function display_stylesheet_notice() { - if (C_NextGen_Style_Manager::get_instance()->is_directory_unsafe()) { - $styles = C_NextGen_Style_Manager::get_instance(); - $filename = $styles->get_selected_stylesheet(); - $abspath = $styles->find_selected_stylesheet_abspath(); - $newpath = $styles->new_dir; + if (C_NextGen_Style_Manager::get_instance()->is_directory_unsafe()) { + $styles = C_NextGen_Style_Manager::get_instance(); + $filename = $styles->get_selected_stylesheet(); + $abspath = $styles->find_selected_stylesheet_abspath(); + $newpath = $styles->new_dir; - echo "<div class='updated error'> + echo "<div class='updated error'> <h3>WARNING: NextGEN Gallery Stylesheet NOT Upgrade-safe</h3> <p> <strong>{$filename}</strong> is currently stored in <strong>{$abspath}</strong>, which isn't upgrade-safe. Please move the stylesheet to <strong>{$newpath}</strong> to ensure that your customizations persist after updates. </p></div>"; - } + } } /** @@ -376,13 +525,13 @@ class C_NextGEN_Bootstrap */ function update() { - if ((!(defined('DOING_AJAX') && DOING_AJAX)) && !isset($_REQUEST['doing_wp_cron'])) { + if ((!(defined('DOING_AJAX') && DOING_AJAX)) && !isset($_REQUEST['doing_wp_cron'])) { - $this->_load_pope(); + $this->_load_pope(); - // Try updating all modules - C_Photocrati_Installer::update(); - } + // Try updating all modules + C_Photocrati_Installer::update(); + } } /** @@ -392,21 +541,24 @@ class C_NextGEN_Bootstrap function route() { $this->_load_pope(); - $router = C_Router::get_instance(); - do_action_ref_array('ngg_routes', array(&$router)); + $router = C_Router::get_instance(); + + // Set context to path if subdirectory install + $parts = parse_url($router->get_base_url(FALSE)); + if (isset($parts['path'])) { + $parts = explode('/index.php', $parts['path']); + $router->context = array_shift($parts); + } + + // Provide a means for modules/third-parties to configure routes + do_action_ref_array('ngg_routes', array(&$router)); + + // Serve the routes if (!$router->serve_request() && $router->has_parameter_segments()) { return $router->passthru(); } } - /** - * Run the installer - */ - static function activate($network=FALSE) - { - C_Photocrati_Installer::update(); - } - /** * Run the uninstaller */ @@ -426,12 +578,12 @@ class C_NextGEN_Bootstrap define('NGG_PLUGIN_DIR', $this->directory_path()); define('NGG_PLUGIN_URL', $this->path_uri()); define('NGG_TESTS_DIR', implode(DIRECTORY_SEPARATOR, array(rtrim(NGG_PLUGIN_DIR, "/\\"), 'tests'))); - define('NGG_PRODUCT_DIR', implode(DIRECTORY_SEPARATOR, array(rtrim(NGG_PLUGIN_DIR, "/\\"), 'products'))); - define('NGG_MODULE_DIR', implode(DIRECTORY_SEPARATOR, array(rtrim(NGG_PRODUCT_DIR, "/\\"), 'photocrati_nextgen', 'modules'))); + define('NGG_PRODUCT_DIR', implode(DIRECTORY_SEPARATOR, array(rtrim(NGG_PLUGIN_DIR, "/\\"), 'products'))); + define('NGG_MODULE_DIR', implode(DIRECTORY_SEPARATOR, array(rtrim(NGG_PRODUCT_DIR, "/\\"), 'photocrati_nextgen', 'modules'))); define('NGG_PRODUCT_URL', path_join(str_replace("\\", '/', NGG_PLUGIN_URL), 'products')); define('NGG_MODULE_URL', path_join(str_replace("\\", '/', NGG_PRODUCT_URL), 'photocrati_nextgen/modules')); define('NGG_PLUGIN_STARTED_AT', microtime()); - define('NGG_PLUGIN_VERSION', '2.0.66.29'); + define('NGG_PLUGIN_VERSION', '2.1.2'); if (!defined('NGG_HIDE_STRICT_ERRORS')) { define('NGG_HIDE_STRICT_ERRORS', TRUE); @@ -452,6 +604,9 @@ class C_NextGEN_Bootstrap // User definable constants if (!defined('NGG_IMPORT_ROOT')) { $path = WP_CONTENT_DIR; + if (defined('NEXTGEN_GALLERY_IMPORT_ROOT')) { + $path = NEXTGEN_GALLERY_IMPORT_ROOT; + } define('NGG_IMPORT_ROOT', $path); } @@ -459,25 +614,34 @@ class C_NextGEN_Bootstrap if (!defined('PHOTOCRATI_CACHE')) { define('PHOTOCRATI_CACHE', TRUE); } - if (!defined('PHOTOCRATI_CACHE_TTL')) { - define('PHOTOCRATI_CACHE_TTL', 3600); - } + if (!defined('PHOTOCRATI_CACHE_TTL')) { + define('PHOTOCRATI_CACHE_TTL', 1800); + } - // Cron job - if (!defined('NGG_CRON_SCHEDULE')) { - define('NGG_CRON_SCHEDULE', 1800); - } + // Cron job + if (!defined('NGG_CRON_SCHEDULE')) { + define('NGG_CRON_SCHEDULE', 900); + } + + if (!defined('NGG_CRON_ENABLED')) { + define('NGG_CRON_ENABLED', TRUE); + } + + // Don't enforce interfaces + if (!defined('EXTENSIBLE_OBJECT_ENFORCE_INTERFACES')) { + define('EXTENSIBLE_OBJECT_ENFORCE_INTERFACES', FALSE); + } - // Don't enforce interfaces - if (!defined('EXTENSIBLE_OBJECT_ENFORCE_INTERFACES')) { - define('EXTENSIBLE_OBJECT_ENFORCE_INTERFACES', FALSE); - } + // Fix jquery + if (!defined('NGG_FIX_JQUERY')) { + define('NGG_FIX_JQUERY', TRUE); + } - // Fix jquery - if (!defined('NGG_FIX_JQUERY')) { - define('NGG_FIX_JQUERY', TRUE); - } - } + // Use Pope's new caching mechanism? + if (!defined('NGG_POPE_CACHE')) { + define('NGG_POPE_CACHE', FALSE); + } + } /** * Defines the NextGEN Test Suite @@ -496,13 +660,13 @@ class C_NextGEN_Bootstrap require_once(path_join($tests_dir, 'mocks.php')); // Define the NextGEN Test Suite - $suites['nextgen'] = array( + $suites['nextgen'] = array( // path_join($tests_dir, 'mvc'), - path_join($tests_dir, 'datamapper'), - path_join($tests_dir, 'nextgen_data'), - path_join($tests_dir, 'gallery_display') - ); - } + path_join($tests_dir, 'datamapper'), + path_join($tests_dir, 'nextgen_data'), + path_join($tests_dir, 'gallery_display') + ); + } return $suites; } diff --git a/wp-content/plugins/nextgen-gallery/non_pope/class.nextgen_shortcode_manager.php b/wp-content/plugins/nextgen-gallery/non_pope/class.nextgen_shortcode_manager.php index 0614d85ee35bed6d8e2698f365a782cf87cdc7bc..2ae9cb3bec3ac06d59d596c41e042b0d758b2a34 100644 --- a/wp-content/plugins/nextgen-gallery/non_pope/class.nextgen_shortcode_manager.php +++ b/wp-content/plugins/nextgen-gallery/non_pope/class.nextgen_shortcode_manager.php @@ -63,25 +63,25 @@ class C_NextGen_Shortcode_Manager */ function deactivate_all($content) { - // There is a bug in Wordpress itself: when a hook recurses any hooks meant to execute after it are discarded. - // For example the following code, despite expectations, will NOT display 'bar' as bar() is never executed. - // See https://core.trac.wordpress.org/ticket/17817 for more information. - /* function foo() { - * remove_action('foo', 'foo'); - * } - * function bar() { - * echo('bar'); - * } - * add_action('foo', 'foo'); - * add_action('foo', 'bar'); - * do_action('foo'); - */ - $this->_runlevel += 1; - if ($this->_runlevel > 1 && defined('WP_DEBUG') && WP_DEBUG && !is_admin() && !$this->_has_warned) - { - $this->_has_warned = TRUE; - error_log('Sorry, but recursing filters on "the_content" breaks NextGEN Gallery. Please see https://core.trac.wordpress.org/ticket/17817 and NGG_DISABLE_FILTER_THE_CONTENT'); - } + // There is a bug in Wordpress itself: when a hook recurses any hooks meant to execute after it are discarded. + // For example the following code, despite expectations, will NOT display 'bar' as bar() is never executed. + // See https://core.trac.wordpress.org/ticket/17817 for more information. + /* function foo() { + * remove_action('foo', 'foo'); + * } + * function bar() { + * echo('bar'); + * } + * add_action('foo', 'foo'); + * add_action('foo', 'bar'); + * do_action('foo'); + */ + $this->_runlevel += 1; + if ($this->_runlevel > 1 && defined('WP_DEBUG') && WP_DEBUG && !is_admin() && !$this->_has_warned) + { + $this->_has_warned = TRUE; + error_log('Sorry, but recursing filters on "the_content" breaks NextGEN Gallery. Please see https://core.trac.wordpress.org/ticket/17817 and NGG_DISABLE_FILTER_THE_CONTENT'); + } foreach (array_keys($this->_shortcodes) as $shortcode) { $this->deactivate($shortcode); @@ -133,7 +133,7 @@ class C_NextGen_Shortcode_Manager function activate($shortcode) { if (isset($this->_shortcodes[$shortcode])) { - add_shortcode($shortcode, $this->_shortcodes[$shortcode]); + add_shortcode($shortcode, array(&$this, "{$shortcode}__callback")); } } @@ -156,4 +156,38 @@ class C_NextGen_Shortcode_Manager if (isset($this->_shortcodes[$shortcode])) remove_shortcode($shortcode); } + + function __call($method, $params) + { + $retval = NULL; + + if (strpos($method, '__callback') !== FALSE) { + $parts = explode('__callback', $method); + $shortcode = $parts[0]; + $inner_content = isset($params[1]) ? $params[1] : ''; + $params = isset($params[0]) ? $params[0] : array(); + $retval = $this->callback_wrapper($shortcode, $params, $inner_content); + } + + return $retval; + } + + function callback_wrapper($shortcode, $params, $inner_content) + { + $retval = ''; + + if (is_array($params)) + { + foreach ($params as $key => &$val) { + $val = trim($val, "„“‚‘«»“”"); + $val = preg_replace("/^(&[^;]+;)?(.*)/", '\2', $val); + $val = preg_replace("/(&[^;]+;)?$/", '', $val); + } + } + + if (isset($this->_shortcodes[$shortcode])) + $retval = call_user_func($this->_shortcodes[$shortcode], $params, $inner_content); + + return $retval; + } } \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/non_pope/class.nextgen_style_manager.php b/wp-content/plugins/nextgen-gallery/non_pope/class.nextgen_style_manager.php index 81145b6d909132869f3d74348ed04c45ba1381a3..961b441a33357c49c42c9b8b8478e5ce1b0951e4 100644 --- a/wp-content/plugins/nextgen-gallery/non_pope/class.nextgen_style_manager.php +++ b/wp-content/plugins/nextgen-gallery/non_pope/class.nextgen_style_manager.php @@ -27,6 +27,11 @@ class C_NextGen_Style_Manager // This is where all stylesheets should be stored $this->add_directory($this->new_dir); + // We also check wp-content/ngg/styles + $this->add_directory(implode(DIRECTORY_SEPARATOR, array( + WP_CONTENT_DIR, 'ngg', 'styles' + ))); + // We check the parent theme directory. Needed for child themes $this->add_directory(rtrim(get_template_directory(), "/\\"), TRUE); @@ -173,8 +178,7 @@ class C_NextGen_Style_Manager } } - if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') - $retval = str_replace('/', DIRECTORY_SEPARATOR, $retval); + $retval = str_replace('/', DIRECTORY_SEPARATOR, $retval); return $retval; } @@ -185,11 +189,22 @@ class C_NextGen_Style_Manager */ function get_selected_stylesheet_url($selected=FALSE) { - if (!$selected) $selected = $this->get_selected_stylesheet(); + if (!$selected) + $selected = $this->get_selected_stylesheet(); + $abspath = $this->find_selected_stylesheet_abspath($selected); + + // default_dir is the only resource loaded from inside the plugin directory + $type = 'content'; + $url = content_url(); + if (0 === strpos($abspath, $this->default_dir)) + { + $type = 'plugins'; + $url = plugins_url(); + } $retval = str_replace( - C_Fs::get_instance()->get_document_root('content'), - content_url(), + C_Fs::get_instance()->get_document_root($type), + $url, $this->find_selected_stylesheet_abspath($selected) ); diff --git a/wp-content/plugins/nextgen-gallery/non_pope/class.photocrati_installer.php b/wp-content/plugins/nextgen-gallery/non_pope/class.photocrati_installer.php index 2a3f4094b33d5ea5087b5bb110ad85b148a34c6b..e1a07f2ee5eaf7c7a2184ba54b55c75630cf2bc1 100644 --- a/wp-content/plugins/nextgen-gallery/non_pope/class.photocrati_installer.php +++ b/wp-content/plugins/nextgen-gallery/non_pope/class.photocrati_installer.php @@ -1,5 +1,40 @@ <?php +/** + * Class C_Gallery_Display_Installer + * + * This is a class added to 2.0.68 for compatiblity reasons, and can be removed after NextGEN Pro 2.2 is released + */ +class C_Gallery_Display_Installer +{ + static $_proxy = NULL; + + function get_proxy() + { + if (!self::$_proxy) { + self::$_proxy = new C_Display_Type_Installer; + } + return self::$_proxy; + } + + function install($reset=FALSE) + { + $this->get_proxy()->install($reset); + } + + function uninstall() + { + $this->get_proxy()->uninstall(); + } + + + function __call($method, $args) + { + $klass = new ReflectionMethod($this->get_proxy(), $method); + return $klass->invokeArgs($this->get_proxy(), $args); + } +} + if (!class_exists('C_Photocrati_Installer')) { class C_Photocrati_Installer @@ -79,7 +114,7 @@ if (!class_exists('C_Photocrati_Installer')) static function done_upgrade() { - update_option('ngg_doing_upgrade', FALSE); + delete_option('ngg_doing_upgrade'); } static function update($reset=FALSE) @@ -87,6 +122,21 @@ if (!class_exists('C_Photocrati_Installer')) $local_settings = C_NextGen_Settings::get_instance(); $global_settings = C_NextGen_Global_Settings::get_instance(); + // Somehow some installations are missing several default settings + // Because gallerystorage_driver is essential to know we do a 'soft' reset here + // by filling in any missing options from the default settings + if (is_null($local_settings->gallerystorage_driver)) { + $settings_installer = new C_NextGen_Settings_Installer(); + + $local_settings->reset(); + $settings_installer->install_local_settings(); + $local_settings->save(); + + $global_settings->reset(); + $settings_installer->install_global_settings(); + $global_settings->save(); + } + // This is a specific hack/work-around/fix and can probably be removed sometime after 2.0.20's release // // NextGen 2x was not multisite compatible until 2.0.18. Users that upgraded before this @@ -119,19 +169,26 @@ if (!class_exists('C_Photocrati_Installer')) } } + // Get last module list and current module list. Compare... $last_module_list = self::_get_last_module_list($reset); $current_module_list = self::_generate_module_info(); + $diff = array_diff($current_module_list, $last_module_list); + $do_upgrade = (count($diff)>0 || count($last_module_list) != count($current_module_list)); + $can_upgrade = $do_upgrade ? self::can_do_upgrade() : FALSE; + if ($can_upgrade && !$diff) $diff = $current_module_list; + + if ($can_upgrade && $do_upgrade) { - if (count(($modules = array_diff($current_module_list, $last_module_list))) > 0 && self::can_do_upgrade()) - { // Clear APC cache if (function_exists('apc_clear_cache')) { @apc_clear_cache('opcode'); apc_clear_cache(); } - // The cache should be flushed - C_Photocrati_Cache::flush('all'); + // We flush ALL transients + wp_cache_flush(); + global $wpdb; + $wpdb->query("DELETE FROM {$wpdb->options} WHERE option_name LIKE '_transient%'"); // Remove all NGG created cron jobs self::refresh_cron(); @@ -146,16 +203,13 @@ if (!class_exists('C_Photocrati_Installer')) // is the only singleton that will be used by other Pope applications C_Component_Factory::$_instances = array(); - foreach ($modules as $module_name) { + foreach ($diff as $module_name) { if (($handler = self::get_handler_instance(array_shift(explode('|', $module_name))))) { if (method_exists($handler, 'install')) $handler->install($reset); } } - // Update the module list - update_option('pope_module_list', $current_module_list); - // NOTE & TODO: if the above section that declares $global_settings_to_keep is removed this should also // Since a hard-reset of the settings was forced we must again re-apply our previously saved values if (isset($global_settings_to_keep)) { @@ -167,8 +221,6 @@ if (!class_exists('C_Photocrati_Installer')) // Save any changes settings $global_settings->save(); $local_settings->save(); - - self::done_upgrade(); } // Another workaround to an issue caused by NextGen's lack of multisite compatibility. It's possible @@ -182,6 +234,12 @@ if (!class_exists('C_Photocrati_Installer')) $local_settings->gallerypath = $settings_installer->gallerypath_replace($global_settings->gallerypath); $local_settings->save(); } + + // Update the module list, and remove the update flag + if ($can_upgrade) { + update_option('pope_module_list', $current_module_list); + self::done_upgrade(); + } } static function _get_last_module_list($reset=FALSE) @@ -204,10 +262,21 @@ if (!class_exists('C_Photocrati_Installer')) { $retval = array(); $registry = C_Component_Registry::get_instance(); - foreach ($registry->get_module_list() as $module_id) { - $module_version = $registry->get_module($module_id)->module_version; - $retval[] = "{$module_id}|{$module_version}"; + $products = array('photocrati-nextgen'); + foreach ($registry->get_product_list() as $product_id) { + if ($product_id != 'photocrati-nextgen') $products[] = $product_id; } + + foreach ($products as $product_id) { + foreach ($registry->get_module_list($product_id) as $module_id) { + if (($module = $registry->get_module($module_id))) { + $module_version = $module->module_version; + $module_string = "{$module_id}|{$module_version}"; + if (!in_array($module_string, $retval)) $retval[] = $module_string; + } + } + } + return $retval; } diff --git a/wp-content/plugins/nextgen-gallery/non_pope/class.photocrati_resource_manager.php b/wp-content/plugins/nextgen-gallery/non_pope/class.photocrati_resource_manager.php index b12b48500cada192ee7ae409524b5098b6e86fb0..d29c770e6114e43bcea6d5f9c0592f085c6bd544 100644 --- a/wp-content/plugins/nextgen-gallery/non_pope/class.photocrati_resource_manager.php +++ b/wp-content/plugins/nextgen-gallery/non_pope/class.photocrati_resource_manager.php @@ -4,7 +4,7 @@ class C_Photocrati_Resource_Manager { static $instance = NULL; - public $marker = '<!-- ngg_resource_manager_marker -->'; + public $marker = '<!-- ngg_resource_manager_marker -->'; var $buffer = ''; var $styles = ''; @@ -24,23 +24,29 @@ class C_Photocrati_Resource_Manager // Validate the request $this->validate_request(); add_action('init', array(&$this, 'start_buffer'), -1); - add_action('wp_footer', array(&$this, 'print_marker'), -1); + add_action('wp_footer', array(&$this, 'print_marker'), -1); } - /** - * Created early as possible in the wp_footer action this is the string to which we - * will move JS resources after - */ - function print_marker() - { - print $this->marker; - } + /** + * Created early as possible in the wp_footer action this is the string to which we + * will move JS resources after + */ + function print_marker() + { + // is_feed() is important to not break Wordpress feeds and the WooCommerce api + if ($this->valid_request && !is_feed()) print $this->marker; + } /** * Determines if the resource manager should perform it's routines for this request * @return bool */ function validate_request() + { + $this->valid_request = $this->is_valid_request(); + } + + function is_valid_request() { $retval = TRUE; @@ -48,18 +54,21 @@ class C_Photocrati_Resource_Manager if (isset($_REQUEST['page']) && !preg_match("#^(ngg|nextgen)#", $_REQUEST['page'])) $retval = FALSE; } - if (strpos($_SERVER['REQUEST_URI'], 'wp-admin/update') !== FALSE) $retval = FALSE; + if (preg_match("#wp-admin/update|wp-login|wp-signup#", $_SERVER['REQUEST_URI'])) $retval = FALSE; else if (isset($_GET['display_gallery_iframe'])) $retval = FALSE; - else if (defined('WP_ADMIN') && WP_ADMIN && defined('DOING_AJAX') && DOING_AJAX) $retval = FALSE; + else if (defined('WP_ADMIN') && WP_ADMIN && defined('DOING_AJAX') && DOING_AJAX) $retval = FALSE; else if (preg_match("/(js|css|xsl|xml|kml)$/", $_SERVER['REQUEST_URI'])) $retval = FALSE; - else if (preg_match("#/feed(/?)$#i", $_SERVER['REQUEST_URI']) || !empty($_GET['feed'])) $retval = FALSE; + else if (preg_match("#/feed(/?)$#i", $_SERVER['REQUEST_URI']) || !empty($_GET['feed'])) $retval = FALSE; elseif (preg_match("/\\.(\\w{3,4})$/", $_SERVER['REQUEST_URI'], $match)) { if (!in_array($match[1], array('htm', 'html', 'php'))) { $retval = FALSE; } } + elseif ((isset($_SERVER['PATH_INFO']) && strpos($_SERVER['PATH_INFO'], 'nextgen-pro-lightbox-gallery') !== FALSE) OR strpos($_SERVER['REQUEST_URI'], 'nextgen-pro-lightbox-gallery') !== FALSE) { + $retval = FALSE; + } - $this->valid_request = $retval; + return $retval; } /** @@ -67,8 +76,8 @@ class C_Photocrati_Resource_Manager */ function start_buffer() { - if (defined('NGG_DISABLE_RESOURCE_MANAGER') && NGG_DISABLE_RESOURCE_MANAGER) - return; + if (defined('NGG_DISABLE_RESOURCE_MANAGER') && NGG_DISABLE_RESOURCE_MANAGER) + return; if (apply_filters('run_ngg_resource_manager', $this->valid_request)) { ob_start(array(&$this, 'output_buffer_handler')); @@ -127,19 +136,20 @@ class C_Photocrati_Resource_Manager function move_resources() { if ($this->valid_request) { + // Move stylesheets to head if ($this->styles) { $this->buffer = str_ireplace('</head>', $this->styles.'</head>', $this->buffer); } - // Move the scripts to the bottom of the page - if ($this->scripts) { - $this->buffer = str_ireplace($this->marker, $this->marker . $this->scripts, $this->buffer); - } + // Move the scripts to the bottom of the page + if ($this->scripts) { + $this->buffer = str_ireplace($this->marker, $this->marker . $this->scripts, $this->buffer); + } - if ($this->other_output) { - $this->buffer = str_replace($this->marker, $this->marker . $this->other_output, $this->buffer); - } + if ($this->other_output) { + $this->buffer = str_replace($this->marker, $this->marker . $this->other_output, $this->buffer); + } } } @@ -172,15 +182,17 @@ class C_Photocrati_Resource_Manager // The output_buffer() function has been called in the PHP shutdown callback // This will allow us to print the scripts ourselves and manipulate the buffer if ($in_shutdown === TRUE) { - ob_start(); - if (!did_action('wp_footer')) { - wp_footer(); + if ($this->valid_request) { + ob_start(); + if (!did_action('wp_footer')) { + wp_footer(); + } + else { + wp_print_footer_scripts(); + } + $this->other_output = ob_get_clean(); + $this->buffer = str_ireplace('</body>', $this->marker.'</body>', $this->buffer); } - else { - wp_print_footer_scripts(); - } - $this->other_output = ob_get_clean(); - } // W3TC isn't activated and we're not in the shutdown callback. diff --git a/wp-content/plugins/nextgen-gallery/non_pope/class.photocrati_transient_manager.php b/wp-content/plugins/nextgen-gallery/non_pope/class.photocrati_transient_manager.php new file mode 100644 index 0000000000000000000000000000000000000000..0447e86cb25a63fa58bf98ccbef44730d38c5a57 --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/non_pope/class.photocrati_transient_manager.php @@ -0,0 +1,170 @@ +<?php + +class C_Photocrati_Transient_Manager +{ + private $_groups = array(); + static $_instance = NULL; + + /** + * @return C_Photocrati_Transient_Manager + */ + static function get_instance() + { + if (!self::$_instance) { + $klass = get_class(); + self::$_instance = new $klass; + } + return self::$_instance; + } + + function __construct() + { + global $_wp_using_ext_object_cache; + + $this->_groups = get_option('ngg_transient_groups', array('__counter' => 1)); + if ($_wp_using_ext_object_cache) $this->_tracker = get_option('photocrati_cache_tracker', array()); + register_shutdown_function(array(&$this, '_update_tracker')); + } + + function delete_tracked($group=NULL) + { + global $_wp_using_ext_object_cache; + if ($_wp_using_ext_object_cache) { + if ($group) { + if (is_array($this->_tracker) && isset($this->_tracker[$this->get_group_id($group)])) { + foreach ($this->_tracker[$this->get_group_id($group)] as $key) { + delete_transient($this->get_group_id($group).'__'.$key); + } + unset($this->_tracker[$this->get_group_id($group)]); + } + } + else foreach($this->_groups as $group => $data) $this->delete_tracked($group); + } + } + + function _update_tracker() + { + global $_wp_using_ext_object_cache; + if ($_wp_using_ext_object_cache) { + delete_option('photocrati_cache_tracker'); + add_option('photocrati_cache_tracker', $this->_tracker, '', 'no'); + } + } + + function add_group($group_or_groups) + { + $updated = FALSE; + $groups = is_array($group_or_groups) ? $group_or_groups : array($group_or_groups); + foreach ($groups as $group) { + if (!isset($this->_groups[$group])) { + $id = $this->_groups['__counter'] += 1; + $this->_groups[$group] = array('id' => $id, 'enabled' => TRUE); + $updated = TRUE; + } + } + if ($updated) update_option('ngg_transient_groups', $this->_groups); + + } + + function get_group_id($group_name) + { + $this->add_group($group_name); + + return $this->_groups[$group_name]['id']; + } + + function generate_key($group, $params=array()) + { + if (is_object($params)) $params = (array) $params; + if (is_array($params)) { + foreach ($params as &$param) $param = @json_encode($param); + $params = implode('', $params); + } + + return $this->get_group_id($group).'__'.str_replace('-', '_', crc32($params)); + } + + function get($key, $default=NULL, $lookup=NULL) + { + $retval = $default; + + if (is_null($lookup)) { + if (defined('PHOTOCRATI_CACHE')) { + $lookup = PHOTOCRATI_CACHE; + } + } + + if ($lookup) { + $retval = json_decode(get_transient($key)); + if (is_object($retval)) $retval = (array) $retval; + if (is_null($retval)) $retval = $default; + } + + return $retval; + } + + function _track_key($key) + { + global $_wp_using_ext_object_cache; + if ($_wp_using_ext_object_cache) { + $parts = explode('__', $key); + $group = $parts[0]; + $id = $parts[1]; + if (!isset($this->_tracker[$group])) $this->_tracker[$group] = array(); + $this->_tracker[$group][] = $id; + } + } + + function set($key, $value, $ttl=0) + { + $retval = FALSE; + $enabled = TRUE; + if (defined('PHOTOCRATI_CACHE')) $enabled = PHOTOCRATI_CACHE; + if (defined('PHOTOCRATI_CACHE_TTL') && !$ttl) $ttl = PHOTOCRATI_CACHE_TTL; + if ($enabled) { + $retval = set_transient($key, json_encode($value), $ttl); + if ($retval) $this->_track_key($key); + } + + return $retval; + } + + function delete($key) + { + return delete_transient($key); + } + + function clear($group=NULL) + { + if (is_string($group) && !empty($group)) + { + global $wpdb; + $query = "DELETE FROM {$wpdb->options} WHERE option_name LIKE '_transient%' AND option_name LIKE '%{$this->get_group_id($group)}__%'"; + $wpdb->query($query); + $this->delete_tracked($group); + } + else foreach ($this->_groups as $name => $params) { + $this->clear($name); + } + } + + static function update($key, $value, $ttl=NULL) + { + return self::get_instance()->set($key, $value, $ttl); + } + + static function fetch($key, $default=NULL) + { + return self::get_instance()->get($key, $default); + } + + static function flush($group=NULL) + { + return self::get_instance()->clear($group); + } + + static function create_key($group, $params=array()) + { + return self::get_instance()->generate_key($group, $params); + } +} \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/pope/lib/autoload.php b/wp-content/plugins/nextgen-gallery/pope/lib/autoload.php index 7961f530d8df6dd38c7e16d70be925406f74ec95..8e243ae0c3a5957c1239885a67400d778b255fd0 100755 --- a/wp-content/plugins/nextgen-gallery/pope/lib/autoload.php +++ b/wp-content/plugins/nextgen-gallery/pope/lib/autoload.php @@ -1,7 +1,8 @@ <?php if (!defined('POPE_VERSION')) { - define('POPE_VERSION', '0.6'); + define('POPE_VERSION', '0.12'); + require_once('class.pope_cache.php'); require_once('class.extensibleobject.php'); require_once('interface.component.php'); require_once('class.component.php'); diff --git a/wp-content/plugins/nextgen-gallery/pope/lib/class.base_module.php b/wp-content/plugins/nextgen-gallery/pope/lib/class.base_module.php index 5230657cef03afed0af0bb4485a0d0636b412351..39a4392617081a68c79efbddcdcde3ff8fa7ad5e 100755 --- a/wp-content/plugins/nextgen-gallery/pope/lib/class.base_module.php +++ b/wp-content/plugins/nextgen-gallery/pope/lib/class.base_module.php @@ -1,6 +1,6 @@ <?php -if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You are not allowed to call this page directly.'); } +if (!defined('POPE_VERSION')) { die('Use autoload.php'); } /** * A Module will register utilities and adapters to provide it's functionality, @@ -9,7 +9,7 @@ if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You * Registered an adapter for the I_Component_Factory interface to add new * factory methods is the most common use of an adapter. */ -abstract class C_Base_Module extends C_Component +abstract class C_Base_Module { var $module_id; var $module_name; @@ -19,24 +19,37 @@ abstract class C_Base_Module extends C_Component var $module_author; var $module_author_uri; var $module_type_list = null; + var $initialized = FALSE; - function __construct($context=FALSE) + function __construct() { - if ($context) { - parent::__construct(__EXTOBJ_NO_INIT__, $context); - } - else { - parent::__construct(__EXTOBJ_NO_INIT__); - } + // TODO: This is here to be compatible with the theme. Once the theme doesn't make use of $this->object + // when it doesn't have to, we can remove this circular reference + $this->object = $this; + + @$this->define(); } + function initialize() + { + + } + + function get_registry() + { + return C_Component_Registry::get_instance(); + } + + function _get_registry() + { + return C_Component_Registry::get_instance(); + } + /** * Defines the module */ function define($id='pope-module', $name='Pope Module', $description='', $version='', $uri='', $author='', $author_uri='', $context=FALSE) { - parent::define($context); - $this->implement('I_Pope_Module'); $this->module_id = $id; $this->module_name = $name; $this->module_description = $description; @@ -46,11 +59,22 @@ abstract class C_Base_Module extends C_Component $this->module_author_uri = $author_uri; $this->get_registry()->add_module($this->module_id, $this); + } + + function load() + { + @include_once($this->get_package_abspath()); $this->_register_utilities(); $this->_register_adapters(); $this->_register_hooks(); - } + } + + function get_package_abspath() + { + $module_abspath = $this->get_registry()->get_module_path($this->module_id); + return str_replace('module.', 'package.module.', $module_abspath); + } /** * I/O can be expensive to run repeatedly, so when a module is created we cache a listing of every file provided diff --git a/wp-content/plugins/nextgen-gallery/pope/lib/class.base_product.php b/wp-content/plugins/nextgen-gallery/pope/lib/class.base_product.php index e4be5999fcf884eb10ff2577bdde0a0677e78fee..8dfae88b562f1edf40485abd582c755eec0dbd74 100755 --- a/wp-content/plugins/nextgen-gallery/pope/lib/class.base_product.php +++ b/wp-content/plugins/nextgen-gallery/pope/lib/class.base_product.php @@ -1,6 +1,6 @@ <?php -if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You are not allowed to call this page directly.'); } +if (!defined('POPE_VERSION')) { die('Use autoload.php'); } /** * A Product is a collection of modules with some meta data. diff --git a/wp-content/plugins/nextgen-gallery/pope/lib/class.component.php b/wp-content/plugins/nextgen-gallery/pope/lib/class.component.php index a02db5d8020026941e9ed3f95aa0a4faafa8c062..6a7cc3840bd0abdbc60f664cfd2f22b18888df4e 100755 --- a/wp-content/plugins/nextgen-gallery/pope/lib/class.component.php +++ b/wp-content/plugins/nextgen-gallery/pope/lib/class.component.php @@ -1,5 +1,7 @@ <?php +if (!defined('POPE_VERSION')) { die('Use autoload.php'); } + /** * Pope is a component-based framework. All classes should inherit this class. */ @@ -25,8 +27,19 @@ class C_Component extends ExtensibleObject { $this->get_registry()->apply_adapters($this); $this->adapted = TRUE; + register_shutdown_function(array(&$this, 'update_cache')); + $this->_method_map_cache = (array)C_Pope_Cache::get( + array($this->context, $this->_mixin_priorities, $this->_disabled_map), + $this->_method_map_cache + ); } + // Updates the cache for this component + function update_cache() + { + C_Pope_Cache::set(array($this->context, $this->_mixin_priorities, $this->_disabled_map), $this->_method_map_cache); + } + /** * Determines if the component has one or more particular contexts assigned * @param string|array $context diff --git a/wp-content/plugins/nextgen-gallery/pope/lib/class.component_factory.php b/wp-content/plugins/nextgen-gallery/pope/lib/class.component_factory.php index 01d8c72af5b225bc13db3fc73861739009cce2c5..614a9124b4b406afdce3c804a77a24184ab79bc8 100755 --- a/wp-content/plugins/nextgen-gallery/pope/lib/class.component_factory.php +++ b/wp-content/plugins/nextgen-gallery/pope/lib/class.component_factory.php @@ -1,5 +1,7 @@ <?php +if (!defined('POPE_VERSION')) { die('Use autoload.php'); } + /** * A factory for hatching (instantiating) components */ diff --git a/wp-content/plugins/nextgen-gallery/pope/lib/class.component_registry.php b/wp-content/plugins/nextgen-gallery/pope/lib/class.component_registry.php index 6658520fd7964769bca8790a39e48f5c1ea999c1..624cf64726ae77222a625c0548e0a7ab73d1e3ef 100755 --- a/wp-content/plugins/nextgen-gallery/pope/lib/class.component_registry.php +++ b/wp-content/plugins/nextgen-gallery/pope/lib/class.component_registry.php @@ -1,12 +1,22 @@ <?php +if (!defined('POPE_VERSION')) { die('Use autoload.php'); } + + /** * A registry of registered products, modules, adapters, and utilities. + * + * + * How the registry gets initialized: + * 1) Each product tells the registry where to find products and modules + * 2) We load all products */ class C_Component_Registry { static $_instance = NULL; - var $_meta_info = array(); /* Contains a cached mapping of module_id -> module_info (including the path the module was installed to) */ + var $_searched_paths = array(); + var $_blacklist = array(); + var $_meta_info = array(); var $_default_path = NULL; var $_modules = array(); var $_products = array(); @@ -16,13 +26,14 @@ class C_Component_Registry var $_module_type_cache_count = 0; + /** * This is a singleton object */ private function __construct() { - // Create an autoloader - spl_autoload_register(array($this, '_module_autoload'), TRUE); + // Create an autoloader + spl_autoload_register(array($this, '_module_autoload'), TRUE); } @@ -39,130 +50,58 @@ class C_Component_Registry return self::$_instance; } - /** - * Saves the registry to disk - * @param string $config_file - */ - function save($config_file) - { - $fp = FALSE; - $retval = TRUE; - - try { - $fp = fopen($config_file, 'w'); - fwrite($fp, json_encode(array( - 'modules' => $this->_modules, - 'products' => $this->_products, - 'adapters' => $this->_adapters, - 'utilities'=> $this->_utilities - ))); - } - catch (Exception $e) { - if ($fp) fclose($fp); - $retval = FALSE; - } - if ($fp) fclose($fp); - - return $retval; - } - - - function load($config_file) - { - $fp = FALSE; - $retval = TRUE; + function require_module_file($module_file_abspath) + { + // We don't include (require) module files that have the same name. This + // avoids loading module.autoupdate.php from two products + static $already_required = array(); + $relpath = basename($module_file_abspath); + if (!in_array($relpath, $already_required)) { + @require_once($module_file_abspath); + $already_required[] = $relpath; + } + } - try { - $fp = fopen($config_file); - $json = json_decode(fread($fp), TRUE); - $this->_modules = array_merge($this->_modules, $json['modules']); - $this->_products = array_merge($this->_products, $json['products']); - $this->_adapters = array_merge($this->_adapters, $json['adapters']); - $this->_utilities = array_merge($this->_utilities, $json['utilities']); - } - catch (Exception $e) { - if ($fp) fclose($fp); - $retval = FALSE; - } - if ($fp) fclose($fp); + function has_searched_path_before($abspath) + { + return in_array($abspath, $this->_searched_paths); + } - return $retval; - } + function mark_as_searched_path($abspath) + { + $this->_searched_paths[] = $abspath; + } /** * Adds a path in the search paths for loading modules * @param string $path - * @param bool $recurse - note, it will only recurse 1 level in the hierarchy + * @param bool $recurse - TRUE, FALSE, or the number of levels to recurse * @param bool $load_all - loads all modules found in the path */ function add_module_path($path, $recurse = false, $load_all = false) { - if ($this->get_default_module_path() == null) - { - $this->set_default_module_path($path); - } + if (!$recurse || (!$this->has_searched_path_before($path))) { - $scan = $this->_scan_module_path($path, $recurse); + // If no default module path has been set, then set one now + if ($this->get_default_module_path() == null) { + $this->set_default_module_path($path); + } - if ($scan != null) - { - $this->_meta_info = array_merge($this->_meta_info, $scan); + // We we've been passed a module file, then include it + if (@file_exists($path) && is_file($path)) { + $this->require_module_file($path); + } - if ($load_all) - { - $module_list = array_keys($scan); - $load_list = array(); - $count = count($module_list); - $ret = true; + // Recursively find product and module files in this path + else foreach ($this->find_product_and_module_files($path, $recurse) as $file_abspath) { + $this->require_module_file($file_abspath); + } - for ($i = 0; $i < $count; $i++) - { - $module_id = $module_list[$i]; - $info = isset($scan[$module_id]) ? $scan[$module_id] : null; - $before_index = null; + $this->mark_as_searched_path($path); + } - if (isset($info['before-list'])) - { - $before_list = $info['before-list']; - - foreach ($before_list as $before_module) - { - $load_index = array_search($before_module, $load_list); - - if ($load_index !== false) - { - if ($before_index === null || $load_index < $before_index) - { - $before_index = $load_index; - } - } - } - } - - if ($before_index !== null) - { - array_splice($load_list, $before_index, 0, array($module_id)); - } - else - { - $load_list[] = $module_id; - } - } - - foreach ($load_list as $module_id) - { - $loaded = $this->load_module($module_id); - $ret = $ret && $loaded; - } - - return $ret; - } - - return true; - } - - return false; + if ($load_all) $this->load_all_modules(); } @@ -172,7 +111,7 @@ class C_Component_Registry */ function get_default_module_path() { - return $this->_default_path; + return $this->_default_path; } @@ -182,7 +121,7 @@ class C_Component_Registry */ function set_default_module_path($path) { - $this->_default_path = $path; + $this->_default_path = $path; } @@ -193,15 +132,15 @@ class C_Component_Registry */ function get_module_path($module_id) { - if (isset($this->_meta_info[$module_id])) { - $info = $this->_meta_info[$module_id]; + if (isset($this->_meta_info[$module_id])) { + $info = $this->_meta_info[$module_id]; - if (isset($info['path'])) { - return $info['path']; - } - } + if (isset($info['path'])) { + return $info['path']; + } + } - return null; + return null; } @@ -212,38 +151,51 @@ class C_Component_Registry */ function get_module_dir($module_id) { - $path = $this->get_module_path($module_id); + $path = $this->get_module_path($module_id); - if ($path != null) { - return dirname($path); - } + if ($path != null) { + return dirname($path); + } - return null; + return null; } + function is_module_loaded($module_id) + { + return (isset($this->_meta_info[$module_id]) && isset($this->_meta_info[$module_id]['loaded']) && $this->_meta_info[$module_id]['loaded']); + } + /** * Loads a module's code according to its dependency list * @param string $module_id */ function load_module($module_id) { - return $this->_load_module_internal($module_id); + $retval = FALSE; + + if (($module = $this->get_module($module_id)) && !$this->is_module_loaded($module_id) && !$this->is_blacklisted($module_id)) { + $module->load(); + $retval = $this->_meta_info[$module_id]['loaded'] = TRUE; + + } + + return $retval; } function load_all_modules($type = null) { - $modules = $this->get_known_module_list(); - $ret = true; + $modules = $this->get_known_module_list(); + $ret = true; - foreach ($modules as $module_id) - { - if ($type == null || $this->get_module_meta($module_id, 'type') == $type) { - $ret = $this->load_module($module_id) && $ret; - } - } + foreach ($modules as $module_id) + { + if ($type == null || $this->get_module_meta($module_id, 'type') == $type) { + $ret = $this->load_module($module_id) && $ret; + } + } - return $ret; + return $ret; } @@ -253,31 +205,32 @@ class C_Component_Registry */ function initialize_module($module_id) { - $retval = FALSE; - if (isset($this->_modules[$module_id])) { - $module = $this->_modules[$module_id]; + $retval = FALSE; - if (!$module->initialized) { - if ($module->has_method('initialize')) - $module->initialize(); + if (isset($this->_modules[$module_id])) { + $module = $this->_modules[$module_id]; - $module->initialized = true; - } - $retval = TRUE; - } - return $retval; + if ($this->is_module_loaded($module_id) && !$module->initialized) { + if (method_exists($module, 'initialize')) + $module->initialize(); + + $module->initialized = true; + } + $retval = TRUE; + } + return $retval; } - /** - * Initializes an already loaded product - * @param string $product_id - * @return bool - */ - function initialize_product($product_id) - { - return $this->initialize_module($product_id); - } + /** + * Initializes an already loaded product + * @param string $product_id + * @return bool + */ + function initialize_product($product_id) + { + return $this->initialize_module($product_id); + } /** @@ -285,12 +238,12 @@ class C_Component_Registry */ function initialize_all_modules() { - $module_list = $this->get_module_list(); + $module_list = $this->get_loaded_module_list(); - foreach ($module_list as $module_id) - { - $this->initialize_module($module_id); - } + foreach ($module_list as $module_id) + { + $this->initialize_module($module_id); + } } @@ -301,9 +254,19 @@ class C_Component_Registry */ function add_module($module_id, $module_object) { - if (!isset($this->_modules[$module_id])) { - $this->_modules[$module_id] = $module_object; - } + if (!isset($this->_modules[$module_id])) { + $this->_modules[$module_id] = $module_object; + } + + if (!isset($this->_meta_info[$module_id])) { + $klass = new ReflectionClass($module_object); + + $this->_meta_info[$module_id] = array( + 'path' => $klass->getFileName(), + 'type' => $klass->isSubclassOf('C_Base_Product') ? 'product' : 'module', + 'loaded' => FALSE + ); + } } @@ -313,9 +276,9 @@ class C_Component_Registry */ function del_module($module_id) { - if (isset($this->_modules[$module_id])) { - unset($this->_modules[$module_id]); - } + if (isset($this->_modules[$module_id])) { + unset($this->_modules[$module_id]); + } } @@ -326,41 +289,142 @@ class C_Component_Registry */ function get_module($module_id) { - if (isset($this->_modules[$module_id])) { - return $this->_modules[$module_id]; - } + if (isset($this->_modules[$module_id])) { + return $this->_modules[$module_id]; + } - return null; + return null; } function get_module_meta($module_id, $meta_name) { - $meta = $this->get_module_meta_list($module_id); + $meta = $this->get_module_meta_list($module_id); - if (isset($meta[$meta_name])) { - return $meta[$meta_name]; - } + if (isset($meta[$meta_name])) { + return $meta[$meta_name]; + } - return null; + return null; } function get_module_meta_list($module_id) { - if (isset($this->_meta_info[$module_id])) { - return $this->_meta_info[$module_id]; - } + if (isset($this->_meta_info[$module_id])) { + return $this->_meta_info[$module_id]; + } - return null; + return null; } /** - * Retrieves a list of instantiated module ids + * Retrieves a list of instantiated module ids, in their "loaded" order as defined by a product + * * @return array */ - function get_module_list() - { - return array_keys($this->_modules); - } + function get_module_list($for_product_id=FALSE) + { + $retval = $module_list = array(); + // As of May 1, 2015, there's a new standard. A product will provide get_provided_modules() and get_modules_to_load(). + + // As of Feb 10, 2015, there's no standard way across Pope products to an "ordered" list of modules + // that the product provides. + // + // The "standard" going forward will insist that all Product classes will provide either: + // A) a static property called "modules" + // B) an instance method called "define_modules", which returns a list of modules, and as well, sets + // a static property called "modules'. + // + // IMPORTANT! + // The Photocrati Theme, as of version 4.1.8, doesn't follow this standard. But both NextGEN Pro and Plus do. + + // Following the standard above, collect all modules provided by a product + $problematic_product_id = FALSE; + foreach ($this->get_product_list() as $product_id) { + $modules = array(); + + // Try getting the list of modules using the "standard" described above + $obj = $this->get_product($product_id); + try{ + $klass = new ReflectionClass($obj); + if ($klass->hasMethod('get_modules_to_load')) { + $modules = $obj->get_modules_provided(); + } + elseif ($klass->hasProperty('modules')) { + $modules = $klass->getStaticPropertyValue('modules'); + } + + if (!$modules && $klass->hasMethod('define_modules')) { + $modules = $obj->define_modules(); + if ($klass->hasProperty('modules')) { + $modules = $klass->getStaticPropertyValue('modules'); + } + } + } + + // We've encountered a product that doesn't follow the standard. For these exceptions, we'll have to + // make an educated guess - if the module path is in the product's default module path, we know that + // it belongs to the product + catch (ReflectionException $ex) { + $modules = array(); + } + + if (!$modules) { + $product_path = $this->get_product_module_path($product_id); + foreach ($this->_modules as $module_id => $module) { + if (strpos($this->get_module_path($module_id), $product_path) !== FALSE) { + $modules[] = $module_id; + } + } + if (!$modules) $problematic_product_id = $product_id; + } + + $module_list[$product_id] = $modules; + } + + // If we have a problematic product, that is, one that we can't find it's ordered list of modules + // that it provides, then we have one last fallback: get a list of modules that Pope is aware of, but hasn't + // added to $module_list[$product_id] yet + if ($problematic_product_id) { + $modules = array(); + foreach (array_keys($this->_modules) as $module_id) { + $assigned = FALSE; + foreach (array_keys($module_list) as $product_id) { + if (in_array($module_id, $module_list[$product_id])) { + $assigned =TRUE; + break; + } + } + if (!$assigned) $modules[] = $module_id; + } + $module_list[$problematic_product_id] = $modules; + } + + // Now that we know which products provide which modules, we can serve the request. + if (!$for_product_id) { + foreach (array_values($module_list) as $modules) { + $retval = array_merge($retval, $modules); + } + } + else $retval = $module_list[$for_product_id]; + + // Final fallback...if all else fails, just return the list of all modules + // that Pope is aware of + if (!$retval) $retval = array_keys($this->_modules); + + + return $retval; + } + + function get_loaded_module_list() + { + $retval = array(); + + foreach ($this->get_module_list() as $module_id) { + if ($this->is_module_loaded($module_id)) $retval[] = $module_id; + } + + return $retval; + } /** * Retrieves a list of registered module ids, including those that aren't loaded (i.e. get_module() call with those unloaded ids will fail) @@ -368,18 +432,18 @@ class C_Component_Registry */ function get_known_module_list() { - return array_keys($this->_meta_info); + return array_keys($this->_meta_info); } function load_product($product_id) { - return $this->load_module($product_id); + return $this->load_module($product_id); } function load_all_products() { - return $this->load_all_modules('product'); + return $this->load_all_modules('product'); } /** @@ -389,9 +453,9 @@ class C_Component_Registry */ function add_product($product_id, $product_object) { - if (!isset($this->_products[$product_id])) { - $this->_products[$product_id] = $product_object; - } + if (!isset($this->_products[$product_id])) { + $this->_products[$product_id] = $product_object; + } } @@ -401,9 +465,9 @@ class C_Component_Registry */ function del_product($product_id) { - if (isset($this->_products[$product_id])) { - unset($this->_products[$product_id]); - } + if (isset($this->_products[$product_id])) { + unset($this->_products[$product_id]); + } } @@ -414,31 +478,31 @@ class C_Component_Registry */ function get_product($product_id) { - if (isset($this->_products[$product_id])) { - return $this->_products[$product_id]; - } + if (isset($this->_products[$product_id])) { + return $this->_products[$product_id]; + } - return null; + return null; } function get_product_meta($product_id, $meta_name) { - $meta = $this->get_product_meta_list($product_id); + $meta = $this->get_product_meta_list($product_id); - if (isset($meta[$meta_name])) { - return $meta[$meta_name]; - } + if (isset($meta[$meta_name])) { + return $meta[$meta_name]; + } - return null; + return null; } function get_product_meta_list($product_id) { - if (isset($this->_meta_info[$product_id]) && $this->_meta_info[$product_id]['type'] == 'product') { - return $this->_meta_info[$product_id]; - } + if (isset($this->_meta_info[$product_id]) && $this->_meta_info[$product_id]['type'] == 'product') { + return $this->_meta_info[$product_id]; + } - return null; + return null; } @@ -449,17 +513,26 @@ class C_Component_Registry */ function get_product_module_path($product_id) { - if (isset($this->_meta_info[$product_id])) { - $info = $this->_meta_info[$product_id]; + if (isset($this->_meta_info[$product_id])) { + $info = $this->_meta_info[$product_id]; - if (isset($info['product-module-path'])) { - return $info['product-module-path']; - } - } + if (isset($info['product-module-path'])) { + return $info['product-module-path']; + } + } - return null; + return null; } + function blacklist_module_file($relpath) + { + if (!in_array($relpath, $this->_blacklist)) $this->_blacklist[] = $relpath; + } + + function is_blacklisted($filename) + { + return in_array($filename, $this->_blacklist); + } /** * Sets the module installation path for a specific product (Note: this is just the generic root container path for modules of this product) @@ -468,9 +541,9 @@ class C_Component_Registry */ function set_product_module_path($product_id, $module_path) { - if (isset($this->_meta_info[$product_id])) { - $this->_meta_info[$product_id]['product-module-path'] = $module_path; - } + if (isset($this->_meta_info[$product_id])) { + $this->_meta_info[$product_id]['product-module-path'] = $module_path; + } } @@ -480,7 +553,7 @@ class C_Component_Registry */ function get_product_list() { - return array_keys($this->_products); + return array_keys($this->_products); } /** @@ -489,18 +562,18 @@ class C_Component_Registry */ function get_known_product_list() { - $list = array_keys($this->_meta_info); - $return = array(); + $list = array_keys($this->_meta_info); + $return = array(); - foreach ($list as $module_id) - { - if ($this->get_product_meta_list($module_id) != null) - { - $return[] = $module_id; - } - } + foreach ($list as $module_id) + { + if ($this->get_product_meta_list($module_id) != null) + { + $return[] = $module_id; + } + } - return $return; + return $return; } @@ -551,6 +624,8 @@ class C_Component_Registry unset($this->_adapters[$interface][$context][$index]); } } + + } @@ -570,8 +645,8 @@ class C_Component_Registry // Determine what context apply to the current component $applied_contexts = array('all'); if ($component->context) { - $applied_contexts[] = $component->context; - $applied_contexts = $this->_flatten_array($applied_contexts); + $applied_contexts[] = $component->context; + $applied_contexts = $this->_flatten_array($applied_contexts); } // Iterate through each of the components contexts and apply the @@ -579,7 +654,7 @@ class C_Component_Registry foreach ($applied_contexts as $context) { if (isset($contexts[$context])) { foreach ($contexts[$context] as $adapter) { - $component->add_mixin($adapter, TRUE); + $component->add_mixin($adapter, FALSE); } } @@ -633,16 +708,16 @@ class C_Component_Registry } } - /** - * Gets the class name of the component providing a utility implementation - * @param string $interface - * @param string|array $context - * @return string - */ - function get_utility_class_name($interface, $context=FALSE) - { - return $this->_retrieve_utility_class($interface, $context); - } + /** + * Gets the class name of the component providing a utility implementation + * @param string $interface + * @param string|array $context + * @return string + */ + function get_utility_class_name($interface, $context=FALSE) + { + return $this->_retrieve_utility_class($interface, $context); + } /** @@ -656,226 +731,104 @@ class C_Component_Registry { if (!$context) $context='all'; $class = $this->_retrieve_utility_class($interface, $context); - return call_user_func("{$class}::get_instance", $context); + return call_user_func("{$class}::get_instance", $context); } - /** - * Flattens an array of arrays to a single array - * @param array $array - * @param array $parent (optional) - * @param bool $exclude_duplicates (optional - defaults to TRUE) - * @return array - */ - function _flatten_array($array, $parent=NULL, $exclude_duplicates=TRUE) - { - if (is_array($array)) { - - // We're to add each element to the parent array - if ($parent) { - foreach ($array as $index => $element) { - foreach ($this->_flatten_array($array) as $sub_element) { - if ($exclude_duplicates) { - if (!in_array($sub_element, $parent)) { - $parent[] = $sub_element; - } - } - else $parent[] = $sub_element; - } - } - $array = $parent; - } - - // We're starting the process.. - else { - $index = 0; - while (isset($array[$index])) { - $element = $array[$index]; - if (is_array($element)) { - $array = $this->_flatten_array($element, $array); - unset($array[$index]); - } - $index += 1; - } - $array = array_values($array); - } - } - else { - $array = array($array); - } - - return $array; - } - - /** - * Returns a list of paths under a specific location, optionally by regex matching their names - * @param string $path starting path - * @param string $regex matched against file basename, not full path - * @param int $recurse recurse level + * Flattens an array of arrays to a single array + * @param array $array + * @param array $parent (optional) + * @param bool $exclude_duplicates (optional - defaults to TRUE) + * @return array */ - function _get_file_list($path, $recurse = null, $regex = null) - { - $path = str_replace(array('\\', '/'), DIRECTORY_SEPARATOR, $path); - $file_list = array(); - - if (is_dir($path)) { - - if ($dh = opendir($path)) { - - if (substr($path, -1) != DIRECTORY_SEPARATOR) { - $path .= DIRECTORY_SEPARATOR; - } + function _flatten_array($array, $parent=NULL, $exclude_duplicates=TRUE) + { + if (is_array($array)) { - rewinddir($dh); + // We're to add each element to the parent array + if ($parent) { + foreach ($array as $index => $element) { + foreach ($this->_flatten_array($array) as $sub_element) { + if ($exclude_duplicates) { + if (!in_array($sub_element, $parent)) { + $parent[] = $sub_element; + } + } + else $parent[] = $sub_element; + } + } + $array = $parent; + } - while (($file = readdir($dh)) !== false) { - if ($file != '.' && $file != '..') { - $file_path = $path . $file; + // We're starting the process.. + else { + $index = 0; + while (isset($array[$index])) { + $element = $array[$index]; + if (is_array($element)) { + $array = $this->_flatten_array($element, $array); + unset($array[$index]); + } + $index += 1; + } + $array = array_values($array); + } + } + else { + $array = array($array); + } - if ($regex == null || preg_match($regex, $file)) { - $file_list[] = $file_path; - } + return $array; + } - if ($recurse > 0) { - $file_list = array_merge($file_list, $this->_get_file_list($file_path, $recurse - 1, $regex)); - } - } - } + function find_product_and_module_files($abspath, $recursive=FALSE) + { + $retval = array(); + static $recursive_level = 0; + $recursive_level++; + + $abspath = str_replace(array('\\', '/'), DIRECTORY_SEPARATOR, $abspath); + $contents = @scandir($abspath); + if ($contents) foreach ($contents as $filename) { + if ($filename == '.' || $filename == '..') continue; + $filename_abspath = $abspath.DIRECTORY_SEPARATOR.$filename; + + // Is this a subdirectory? + // We don't use is_dir(), as it's less efficient than just checking for a 'dot' in the filename. + // The problem is that we're assuming that our directories won't contain a 'dot'. + if ($recursive && strpos($filename, '.') === FALSE) { + + // The recursive parameter can either be set to TRUE or the number of levels to navigate + // If we reach the max number of recursive levels we're supported to navigate, then we try + // to guess if there's a module or product file under the directory with the same name as + // the directory + if ($recursive === TRUE || (is_int($recursive) && $recursive_level <= $recursive)) { + $retval = array_merge($retval, $this->find_product_and_module_files($filename_abspath, $recursive)); + } - closedir($dh); + elseif (@file_exists(($module_abspath = $filename_abspath.DIRECTORY_SEPARATOR.'module.'.$filename.'.php'))) { + $filename = 'module.'.$filename.'.php'; + $filename_abspath = $module_abspath; } + elseif (@file_exists(($product_abspath = $filename_abspath.DIRECTORY_SEPARATOR.'product.'.$filename.'.php'))) { + $filename = 'product.'.$filename.'.php'; + $filename_abspath = $module_abspath; + } + } - return $file_list; + if ((strpos($filename, 'module.') === 0 OR strpos($filename, 'product.') === 0) AND !$this->is_blacklisted($filename)) { + $retval[] = $filename_abspath; + } } - /** - * Searches a path for valid module definitions and stores their dependency lists - * @param string $path - * @param bool $recurse - note, it will only recurse 1 level in the hierarchy - */ - function _scan_module_path($path, $recurse = false) - { - $path = str_replace(array('\\', '/'), DIRECTORY_SEPARATOR, $path); - $base = basename($path); - $regex = '/^(?:module|product)\\..*\\.php$/'; - $result = array(); - - if (is_file($path) && preg_match($regex, $base)) - { - $result[] = $path; - } - else - { - $result = $this->_get_file_list($path, $recurse ? 1 : 0, $regex); - } - - if ($result != null) - { - $scan = array(); - - foreach ($result as $module_path) - { - $module_dir = basename(dirname($module_path)); - - if (strpos($module_dir, '__') === 0) - { - continue; - } - - // XXX might be necessary to use fopen/fread for very large module files - $module_content = file_get_contents($module_path); - $match = null; - - if (preg_match('/\/(?:\*)+\s*\{\s*(?P<type>Module|Product):\s*(?P<id>[\w-_]+)\s*(?:,\s*Depends:\s*\{(?P<depends>.*)\})?\s*(,\s*Before:\s*\{(?P<before>.*)\})?\s*\}/m', $module_content, $match) > 0) - { - $module_type = $match['type']; - $module_id = $match['id']; - $module_deps = isset($match['depends']) ? $match['depends'] : null; - $module_before = isset($match['before']) ? $match['before'] : null; - $module_info = array('type' => strtolower($module_type), 'id' => $module_id, 'path' => $module_path); - - if ($module_deps != null) - { - $module_deps = array_map('trim', explode(',', $module_deps)); - $module_info['dependency-list'] = $module_deps; - } - - if ($module_before != null) - { - $module_before = array_map('trim', explode(',', $module_before)); - $module_info['before-list'] = $module_before; - } - - $scan[$module_id] = $module_info; - } - else die("{$module_path} is not a valid Pope module"); - } - - return $scan; - } - - return null; - } + $this->mark_as_searched_path($abspath); + $recursive_level--; - /** - * Loads a module's code according to its dependency list and taking into consideration circular references - * @param string $module_id - * @param array $load_path - */ - function _load_module_internal($module_id, $load_path = null) - { - if ($this->get_module($module_id) != null) - { - // Module already loaded - return true; - } - - if (!is_array($load_path)) - { - $load_path = (array) $load_path; - } - - if (isset($this->_meta_info[$module_id])) - { - $module_info = $this->_meta_info[$module_id]; - - if (isset($module_info['dependency-list'])) - { - $module_deps = $module_info['dependency-list']; - $load_path[] = $module_id; - - foreach ($module_deps as $module_dep_id) - { - if (in_array($module_dep_id, $load_path)) - { - // Circular reference - continue; - } - - if (!$this->_load_module_internal($module_dep_id, $load_path)) - { - return false; - } - } - } - if (isset($module_info['path'])) - { - $module_path = $module_info['path']; - - if (is_file($module_path)) - { - include_once($module_path); - - return true; - } - } - } - - return false; - } + return $retval; + } /** @@ -911,33 +864,44 @@ class C_Component_Registry */ function _module_autoload($name) { - if ($this->_module_type_cache == null || count($this->_modules) > $this->_module_type_cache_count) - { - $this->_module_type_cache_count = count($this->_modules); - $modules = $this->_modules; - - foreach ($modules as $module_id => $module) - { - $dir = $this->get_module_dir($module_id); - $type_list = $module->get_type_list(); - - foreach ($type_list as $type => $filename) - { - $this->_module_type_cache[strtolower($type)] = $dir . DIRECTORY_SEPARATOR . $filename; - } - } - } - - $name = strtolower($name); - - if (isset($this->_module_type_cache[$name])) - { - $module_filename = $this->_module_type_cache[$name]; - - if (file_exists($module_filename)) - { - include_once($module_filename); - } - } + // Pope classes are always prefixed + if (strpos($name, 'C_') !== 0 && strpos($name, 'A_') !== 0 && strpos($name, 'Mixin_') !== 0) { + return; + } + + if ($this->_module_type_cache == null || count($this->_modules) > $this->_module_type_cache_count) + { + $this->_module_type_cache_count = count($this->_modules); + $modules = $this->_modules; + + $keys = array(); + foreach ($modules as $mod => $properties) $keys[$mod] = $properties->module_version; + if (!($this->_module_type_cache = C_Pope_Cache::get($keys, array()))) { + foreach ($modules as $module_id => $module) + { + $dir = $this->get_module_dir($module_id); + $type_list = $module->get_type_list(); + + foreach ($type_list as $type => $filename) + { + $this->_module_type_cache[strtolower($type)] = $dir . DIRECTORY_SEPARATOR . $filename; + } + } + C_Pope_Cache::set($keys, $this->_module_type_cache); + } + elseif (is_object($this->_module_type_cache)) $this->_module_type_cache = get_object_vars($this->_module_type_cache); + } + + $name = strtolower($name); + + if (isset($this->_module_type_cache[$name])) + { + $module_filename = $this->_module_type_cache[$name]; + + if (file_exists($module_filename)) + { + require_once($module_filename); + } + } } } diff --git a/wp-content/plugins/nextgen-gallery/pope/lib/class.extensibleobject.php b/wp-content/plugins/nextgen-gallery/pope/lib/class.extensibleobject.php index f1cee52ce97d2ad3087dde47cfa4136c448dd458..e5eb51f72324e8fba01d6b3c102f4d37e8e941fa 100755 --- a/wp-content/plugins/nextgen-gallery/pope/lib/class.extensibleobject.php +++ b/wp-content/plugins/nextgen-gallery/pope/lib/class.extensibleobject.php @@ -1,10 +1,8 @@ <?php -define('__EXTOBJ_STATIC__', '__STATICALLY_CALLED__'); -define('__EXTOBJ_NO_INIT__', '__NO_INIT__'); -if (!defined('EXTENSIBLE_OBJECT_ENFORCE_INTERFACES')) { - define('EXTENSIBLE_OBJECT_ENFORCE_INTERFACES', TRUE); -} +include_once('class.pope_cache.php'); + +define('__EXTOBJ_NO_INIT__', '__NO_INIT__'); /** @@ -78,29 +76,16 @@ class PopeHelpers */ class ExtensibleObject extends PopeHelpers { - const METHOD_PROPERTY_RUN='run'; - const METHOD_PROPERTY_RUN_POST_HOOKS='run_post_hooks'; - const METHOD_PROPERTY_RUN_PRE_HOOKS='run_pre_hooks'; - const METHOD_PROPERTY_RETURN_VALUE='return_value'; + static $enforce_interfaces=TRUE; - var $_mixins = array(); + var $_mixins = array(); var $_mixin_priorities = array(); - var $_pre_hooks = array(); - var $_global_pre_hooks = array(); - var $_global_post_hooks= array(); - var $_post_hooks = array(); var $_method_map_cache = array(); - var $_interfaces = array(); - var $_overrides = array(); - var $_aliases = array(); - var $_method_properties = array(); - var $_throw_error = TRUE; + var $_disabled_map = array(); + var $_interfaces = array(); + var $_throw_error = TRUE; var $_wrapped_instance = FALSE; - var $object = NULL; - var $_disabled_pre_hooks = array(); - var $_disabled_post_hooks = array(); - var $_disabled_mixins = array(); - + var $object = NULL; /** * Defines a new ExtensibleObject. Any subclass should call this constructor. @@ -111,142 +96,30 @@ class ExtensibleObject extends PopeHelpers */ function __construct() { - // Mixins access their parent class by accessing $this->object. - // Sometimes users mistakenly use $this->object within the parent object - // itself. As it's becoming a common mistake, we define a $this->object - // property which points to the current instance (itself) - $this->object = $this; - - $args = func_get_args(); - $define_instance = TRUE; - $init_instance = TRUE; - - // The first argument could be a flag to ExtensibleObject - // which indicates that only static-like methods will be called - if (count($args) >= 1) { - $first_arg = $args[0]; - if (is_string($first_arg)) { - switch ($first_arg) { - case __EXTOBJ_STATIC__: - { - $define_instance = FALSE; - $init_instance = FALSE; - - if (method_exists($this, 'define_class')) { - $this->call_callback($this, 'define_class', $args); - } - elseif (method_exists($this, 'define_static')) { - $this->call_callback($this, 'define_static', $args); - } - - break; - } - case __EXTOBJ_NO_INIT__: - { - $init_instance = FALSE; - - break; - } - } - } - } - - // Are we to define instance methods? - if ($define_instance) - { - if (method_exists($this, 'define_instance')) - { - $reflection = new ReflectionMethod($this, 'define_instance'); - $reflection->invokeArgs($this, $args); - // call_user_func_array(array($this, 'define_instance'), $args); - } - elseif (method_exists($this, 'define')) { - $reflection = new ReflectionMethod($this, 'define'); - $reflection->invokeArgs($this, $args); - // call_user_func_array(array($this, 'define'), $args); - } - - if (EXTENSIBLE_OBJECT_ENFORCE_INTERFACES) $this->_enforce_interface_contracts(); - - if ($init_instance) - { - // Initialize the state of the object - if (method_exists($this, 'initialize')) { - $reflection = new ReflectionMethod($this, 'initialize'); - $reflection->invokeArgs($this, $args); - // call_user_func_array(array($this, 'initialize'), $args); - } - } - } - } - - /** - * Disabled prehooks for a particular method - * @param string $method - */ - function disable_pre_hooks($method) - { - $this->_disabled_pre_hooks[] = $method; - return $this; - } + // TODO This can be removed in the future. The Photocrati Theme currently requires this. + $this->object = $this; + $args = func_get_args(); - /** - * Enable prehooks for a particular method - * @param string $method - */ - function enable_pre_hooks($method) - { - $index = array_search($method, $this->_disabled_pre_hooks); - if ($index !== FALSE) { - unset($this->_disabled_pre_hooks[$index]); + // Define the instance + if (method_exists($this, 'define_instance')) + { + $reflection = new ReflectionMethod($this, 'define_instance'); + $reflection->invokeArgs($this, $args); } - return $this; - } - - /** - * Disabled posthooks for a particular method - * @param string $method - */ - function disable_post_hooks($method) - { - $this->_disabled_post_hooks[] = $method; - return $this; - } - - - /** - * Enable post-hooks for a particular method - * @param string $method - */ - function enable_post_hooks($method) - { - $index = array_search($method, $this->_disabled_post_hooks); - if ($index !== FALSE) { - unset($this->_disabled_post_hooks[$index]); + elseif (method_exists($this, 'define')) { + $reflection = new ReflectionMethod($this, 'define'); + $reflection->invokeArgs($this, $args); } - return $this; - } + if (self::$enforce_interfaces) $this->_enforce_interface_contracts(); - /** - * Determines if post hooks are enabled for a particular method - * @param string $method - * @return bool - */ - function are_post_hooks_enabled($method) - { - return !empty($this->_post_hooks) && (!in_array($method, $this->_disabled_post_hooks)); - } - - - /** - * Determines if pre hooks are enabled for a particular method - * @param string $method - * @return bool - */ - function are_pre_hooks_enabled($method) - { - return !empty($this->_pre_hooks) && (!in_array($method, $this->_disabled_pre_hooks)); + if (!isset($args[0]) || $args[0] != __EXTOBJ_NO_INIT__) { + // Initialize the state of the object + if (method_exists($this, 'initialize')) { + $reflection = new ReflectionMethod($this, 'initialize'); + $reflection->invokeArgs($this, $args); + } + } } @@ -264,12 +137,13 @@ class ExtensibleObject extends PopeHelpers // we might as well wait till the method is called to // save memory. Instead, the _call() method calls the // _instantiate_mixin() method below. - $this->_mixins[$class] = FALSE; // new $class(); + $this->_mixins[$class] = NULL; // new $class(); array_unshift($this->_mixin_priorities, $class); - $this->_flush_cache(); - // Should we instantiate the object now? + // Instantiate the mixin immediately, if requested if ($instantiate) $this->_instantiate_mixin($class); + $this->_flush_cache(); + } else $retval = FALSE; @@ -284,7 +158,7 @@ class ExtensibleObject extends PopeHelpers */ function has_mixin($klass) { - return (isset($this->_mixins[$klass])); + return array_key_exists($klass, $this->_mixins); } @@ -293,19 +167,19 @@ class ExtensibleObject extends PopeHelpers * @param string $class * @return mixed */ - function _instantiate_mixin($class) + function &_instantiate_mixin($class) { $retval = FALSE; - if ($this->_mixins[$class]) + if (isset($this->_mixins[$class])) $retval = $this->_mixins[$class]; else { $obj= new $class(); - $obj->object = &$this; + $obj->object = $this; $retval = $this->_mixins[$class] = &$obj; if (method_exists($obj, 'initialize')) $obj->initialize(); + unset($obj->object); } - return $retval; } @@ -319,15 +193,8 @@ class ExtensibleObject extends PopeHelpers { unset($this->_mixins[$class]); $index = array_search($class, $this->_mixin_priorities); - if ($index !== FALSE) { - unset($this->_mixin_priorities[$index]); - foreach ($this->_disabled_mixins as $method => $disabled_mixins) { - $index = array_search($class, $disabled_mixins); - if (is_int($index)) unset($this->_disabled_mixins[$method][$index]); - } - $this->_flush_cache(); - } - + unset($this->_mixin_priorities[$index]); + $this->_flush_cache(); } @@ -337,35 +204,6 @@ class ExtensibleObject extends PopeHelpers } - /** - * Replaces an extension methods with that of another class. - * @param string $method - * @param string $class - * @param string $new_method - */ - function replace_method($method, $class, $new_method=FALSE) - { - if (!$new_method) $new_method = $method; - $this->_overrides[$method] = $class; - $this->add_pre_hook($method, "replacement_{$method}_{$class}_{$new_method}", $class, $new_method); - $this->_flush_cache(); - - } - - - /** - * Restores a method that was replaced by a former call to replace_method() - * @param string $method - */ - function restore_method($method) - { - $class = $this->_overrides[$method]; - unset($this->_overrides[$method]); - $this->del_pre_hook($method, $class); - $this->_flush_cache(); - } - - /** * Returns the Mixin which provides the specified method * @param string $method @@ -376,19 +214,21 @@ class ExtensibleObject extends PopeHelpers // If it's cached, then we've got it easy if ($this->is_cached($method)) { - - $object = $this->_method_map_cache[$method]; - $retval = get_class($object); + $klass = $this->_method_map_cache[$method]; + return $return_obj ? $this->_instantiate_mixin($klass) : $klass; } // Otherwise, we have to look it up else { - foreach ($this->get_mixin_priorities($method) as $klass) { - $object = $this->_instantiate_mixin($klass); - if (method_exists($object, $method)) { - $retval = $return_obj ? $object : get_class($object); - $this->_cache_method($object, $method); - break; + foreach ($this->_mixin_priorities as $class_name) { + if (method_exists($class_name, $method) && !$this->is_mixin_disabled_for($method, $class_name)) { + $object = $this->_instantiate_mixin($class_name); + $this->_cache_method($class_name, $method); + $retval = $return_obj ? $object : $class_name; + break; + } + elseif (!class_exists($class_name)) { + throw new RuntimeException("{$class_name} does not exist."); } } } @@ -396,6 +236,37 @@ class ExtensibleObject extends PopeHelpers return $retval; } + function is_mixin_disabled_for($method, $mixin_klass) + { + $retval = FALSE; + + if (isset($this->_disabled_map[$method])) { + $retval = in_array($mixin_klass, $this->_disabled_map[$method]); + } + + return $retval; + } + + function disable_mixin_for($method, $mixin_klass) + { + if (!isset($this->_disabled_map[$method])) { + $this->_disabled_map[$method] = array($mixin_klass); + } + else if (!in_array($mixin_klass, $this->_disabled_map[$method])) { + array_push($this->_disabled_map[$method], $mixin_klass); + } + + unset($this->_method_map_cache[$method]); + } + + function enable_mixin_for($method, $mixin_klass) + { + if (isset($this->_disabled_map[$method])) { + if (($index = array_search($mixin_klass, $this->_disabled_map[$method])) !== FALSE) { + unset($this->_disabled_map[$method][$index]); + } + } + } /** * When an ExtensibleObject is instantiated, it checks whether all @@ -430,142 +301,6 @@ class ExtensibleObject extends PopeHelpers $this->_interfaces[] = $interface; } - - /** - * Adds a hook that gets executed before every method call - * @param string $name - * @param string $class - * @param string $hook_method - */ - function add_global_pre_hook($name, $class, $hook_method) - { - $this->add_pre_hook('*', $name, $class, $hook_method); - } - - /** - * Adds a hook that gets executed after every method call - * - * @param string $name - * @param string $class - * @param string $hook_method - */ - function add_global_post_hook($name, $class, $hook_method) - { - $this->add_pre_hook('*', $name, $class, $hook_method); - } - - - /** - * Adds a hook that will get executed before a particular method call - * @param string $method - * @param string $name - * @param string $class - * @param string $hook_method - */ - function add_pre_hook($method, $name, $class, $hook_method=FALSE) - { - if (!$hook_method) $hook_method = $method; - - // Is this a global pre hook? - if ($method == '*') { - $this->_global_pre_hooks[$name] = array( - new $class, - $hook_method - ); - } - - // This is a method-specific pre hook - else { - if (!isset($this->_pre_hooks[$method])) { - $this->_pre_hooks[$method] = array(); - } - - $this->_pre_hooks[$method][$name] = array( - new $class, - $hook_method - ); - } - } - - - /** - * Adds a hook to be called after a particular method call - * @param string $method - * @param string $hook_name - * @param string $class - * @param string $hook_method - */ - function add_post_hook($method, $hook_name, $class, $hook_method=FALSE) - { - // Is this a global post hook? - if ($method == '*') { - $this->_post_hooks[$hook_name] = array( - new $class, - $hook_method - ); - } - - // This is a method-specific post hook - else { - if (!$hook_method) $hook_method = $method; - - if (!isset($this->_post_hooks[$method])) { - $this->_post_hooks[$method] = array(); - } - - $this->_post_hooks[$method][$hook_name] = array( - new $class, - $hook_method - ); - } - } - - - /** - * Deletes a hook that's executed before the specified method - * @param string $method - * @param string $name - */ - function del_pre_hook($method, $name) - { - - unset($this->_pre_hooks[$method][$name]); - } - - /** - * Deletes all pre hooks registered - **/ - function del_pre_hooks($method=FALSE) - { - if (!$method) - $this->_pre_hooks = array(); - else - unset($this->_pre_hooks[$method]); - } - - - /** - * Deletes a hook that's executed after the specified method - * @param string $method - * @param string $name - */ - function del_post_hook($method, $name) - { - unset($this->_post_hooks[$method][$name]); - } - - /** - * Deletes all post hooks - */ - function del_post_hooks($method=FALSE) - { - if (!$method) - $this->_post_hooks = array(); - else - unset($this->_post_hooks[$method]); - } - - /** * Wraps a class within an ExtensibleObject class. * @param string $klass @@ -594,7 +329,7 @@ class ExtensibleObject extends PopeHelpers /** * Returns the name of the class which this ExtensibleObject wraps - * @return object + * @return string */ function &get_wrapped_instance() { @@ -657,7 +392,9 @@ class ExtensibleObject extends PopeHelpers function &__get($property) { $retval = NULL; - if ($this->is_wrapper()) { + + if ($property == 'object') return $this; + else if ($this->is_wrapper()) { try { $reflected_prop = new ReflectionProperty($this->_wrapped_instance, $property); @@ -706,6 +443,7 @@ class ExtensibleObject extends PopeHelpers function &__set($property, $value) { $retval = NULL; + if ($this->is_wrapper()) { try { $reflected_prop = new ReflectionProperty($this->_wrapped_instance, $property); @@ -754,93 +492,32 @@ class ExtensibleObject extends PopeHelpers */ function __call($method, $args) { - $this->reset_method_properties($method, $args); - - // Run pre hooks? - if ($this->are_pre_hooks_enabled($method) && $this->get_method_property($method, self::METHOD_PROPERTY_RUN_PRE_HOOKS)) { - - // Combine global and method-specific pre hooks - $prehooks = $this->_global_pre_hooks; - if (isset($this->_pre_hooks[$method])) { - $prehooks = array_merge($prehooks, $this->_pre_hooks[$method]); - } - - // Apply each hook - foreach ($prehooks as $hook_name => $hook) { - $method_args = $this->get_method_property($method, 'arguments', $args); - $this->_run_prehook( - $hook_name, - $method, - $hook[0], - $hook[1], - $method_args - ); - } - } - - // Are we to run the actual method? A pre hook might have told us - // not to - if ($this->get_method_property($method, self::METHOD_PROPERTY_RUN) && !isset($this->_overrides[$method])) - { - if (($this->get_mixin_providing($method))) { - $this->set_method_property( - $method, - self::METHOD_PROPERTY_RETURN_VALUE, - $this->_exec_cached_method($method, $this->get_method_property($method, 'arguments')) - ); - } - - // This is NOT a wrapped class, and no extensions provide the method - else { - // Perhaps this is a wrapper and the wrapped object - // provides this method - if ($this->is_wrapper() && $this->wrapped_class_provides($method)) - { - $object = $this->add_wrapped_instance_method($method); - $this->set_method_property( - $method, - self::METHOD_PROPERTY_RETURN_VALUE, - call_user_func_array( - array(&$object, $method), - $this->get_method_property($method, 'arguments') - ) - ); - } - elseif ($this->_throw_error) { - throw new Exception("`{$method}` not defined for " . get_class()); - } - else { - return FALSE; - } - } - } - - // Are we to run post hooks? A pre hook might have told us not to - if ($this->are_post_hooks_enabled($method) && $this->get_method_property($method, self::METHOD_PROPERTY_RUN_POST_HOOKS)) { + $retval = NULL; - // Combine global and method-specific post hooks - $posthooks = $this->_global_post_hooks; - if (isset($this->_post_hooks[$method])) { - $posthooks = array_merge($posthooks, $this->_post_hooks[$method]); - } + if (($this->get_mixin_providing($method))) { + $retval = $this->_exec_cached_method($method, $args); + } - // Apply each hook - foreach ($posthooks as $hook_name => $hook) { - $method_args = $this->get_method_property($method, 'arguments', $args); - $this->_run_post_hook( - $hook_name, - $method, - $hook[0], - $hook[1], - $method_args + // This is NOT a wrapped class, and no extensions provide the method + else { + // Perhaps this is a wrapper and the wrapped object + // provides this method + if ($this->is_wrapper() && $this->wrapped_class_provides($method)) + { + $object = $this->add_wrapped_instance_method($method); + $retval = call_user_func_array( + array(&$object, $method), + $args ); - } - } + } + elseif ($this->_throw_error) { + if (defined('POPE_DEBUG') && POPE_DEBUG) + print_r(debug_backtrace()); + throw new Exception("`{$method}` not defined for " . get_class()); + } + } - // Get return value, clear all method properties, and then return - $retval = $this->get_method_property($method, self::METHOD_PROPERTY_RETURN_VALUE); - $this->remove_method_properties($method); - return $retval; + return $retval; } @@ -873,8 +550,7 @@ class ExtensibleObject extends PopeHelpers $body = str_replace('$this->object->$', '$this->object->', $body); // Define method for mixin - $wrapped_klass = get_class($this->get_wrapped_instance()); - $mixin_klass = "Mixin_AutoGen_{$wrapped_klass}_{$method}"; + $mixin_klass = "Mixin_AutoGen_{$method}"; if (!class_exists($mixin_klass)) { eval("class {$mixin_klass} extends Mixin{ {$body} @@ -882,7 +558,7 @@ class ExtensibleObject extends PopeHelpers } $this->add_mixin($mixin_klass); $retval = $this->_instantiate_mixin($mixin_klass); - $this->_cache_method($retval, $method); + $this->_cache_method($mixin_klass, $method); } @@ -919,48 +595,14 @@ class ExtensibleObject extends PopeHelpers /** * Caches the path to the extension which provides a particular method - * @param string $object + * @param string $klass * @param string $method */ - function _cache_method($object, $method) + function _cache_method($klass, $method) { - $this->_method_map_cache[$method] = $object; + $this->_method_map_cache[$method] = $klass; } - - /** - * Gets a list of mixins by their priority, excluding disabled mixins - * @param string $method - * @return array - */ - function get_mixin_priorities($method) - { - $retval = array(); - foreach ($this->_mixin_priorities as $mixin) { - if ($this->is_mixin_disabled($method, $mixin)) - continue; - $retval[] = $mixin; - } - return $retval; - } - - - /** - * Determines if a mixin is disabled for a particular method - * @param string $method - * @param string $mixin - * @return boolean - */ - function is_mixin_disabled($method, $mixin) - { - $retval = FALSE; - if (isset($this->_disabled_mixins[$method])) - if (in_array($mixin, $this->_disabled_mixins[$method]) !== FALSE) - $retval = TRUE; - return $retval; - } - - /** * Flushes the method cache */ @@ -1001,138 +643,6 @@ class ExtensibleObject extends PopeHelpers return $retval; } - - /** - * Runs a particular pre hook for the specified method. The return value - * is assigned to the "[hook_name]_prehook_retval" method property - * @param string $hook_name - * @param string $method_called - * @param Ext $object - * @param string $hook_method - * - */ - function _run_prehook($hook_name, $method_called, $object, $hook_method, &$args) - { - $object->object = &$this; - $object->method_called = $method_called; - - // Are we STILL to execute pre hooks? A pre-executed hook might have changed this - if ($this->get_method_property($method_called, 'run_pre_hooks')) - { - $reflection = new ReflectionMethod($object, $hook_method); - $this->set_method_property( - $method_called, - $hook_name . '_prehook_retval', - $reflection->invokeArgs($object, $args) - ); - } - } - - /** - * Runs the specified post hook for the specified method - * @param string $hook_name - * @param string $method_called - * @param Ext $object - * @param string $hook_method - */ - function _run_post_hook($hook_name, $method_called, $object, $hook_method, &$args) - { - $object->object = &$this; - $object->method_called = $method_called; - - // Are we STILL to execute post hooks? A post-executed hook might have changed this - if ($this->get_method_property($method_called, 'run_post_hooks')) - { - $reflection = new ReflectionMethod($object, $hook_method); - $this->set_method_property( - $method_called, - $hook_name . '_post_hook_retval', - $reflection->invokeArgs($object, $args) - ); - } - } - - /** - * Returns TRUE if a pre-hook has been registered for the specified method - * @param string $method - * @return boolean - */ - function have_prehook_for($method, $name = null) - { - if (is_null($name)) { - return isset($this->_pre_hooks[$method]); - } else { - return isset($this->_pre_hooks[$method][$name]); - } - - } - - - /** - * Returns TRUE if a posthook has been registered for the specified method - * @param string $method - * @return boolean - */ - function have_posthook_for($method, $name = null) - { - $retval = FALSE; - - if (isset($this->_post_hooks[$method])) { - if (!$name) $retval = TRUE; - else $retval = isset($this->_post_hooks[$method][$name]); - } - - return $retval; - } - - /** - * Disables a mixin for a particular method. This ensures that even though - * mixin provides a particular method, it won't be used to provide the - * implementation - * @param string $method - * @param string $klass - */ - function disable_mixin($method, $klass) - { - unset($this->_method_map_cache[$method]); - if (!isset($this->_disabled_mixins[$method])) { - $this->_disabled_mixins[$method] = array(); - } - $this->_disabled_mixins[$method][] = $klass; - } - - - /** - * Enable a mixin for a particular method, that was previously disabled - * @param string $method - * @param string $klass - */ - function enable_mixin($method, $klass) - { - unset($this->_method_map_cache[$method]); - if (isset($this->_disabled_mixins[$method])) { - $index = array_search($klass, $this->_disabled_mixins[$method]); - if ($index !== FALSE) unset($this->_disabled_mixins[$method][$index]); - } - } - - - /** - * Gets a list of mixins that are currently disabled for a particular method - * @see disable_mixin() - * @param string $method - * @return array - */ - function get_disabled_mixins_for($method) - { - $retval = array(); - if (isset($this->_disabled_mixins[$method])) { - $retval = $this->_disabled_mixins[$method]; - } - return $retval; - } - - /** * Executes a cached method * @param string $method @@ -1141,93 +651,13 @@ class ExtensibleObject extends PopeHelpers */ function _exec_cached_method($method, $args=array()) { - $object = $this->_method_map_cache[$method]; - $object->object = &$this; + $klass = $this->_method_map_cache[$method]; + $object = $this->_instantiate_mixin($klass); + $object->object = $this; $reflection = new ReflectionMethod($object, $method); return $reflection->invokeArgs($object, $args); } - - /** - * Sets the value of a method property - * @param string $method - * @param string $property - * @param mixed $value - */ - function set_method_property($method, $property, $value) - { - if (!isset($this->_method_properties[$method])) { - $this->_method_properties[$method] = array(); - } - - return $this->_method_properties[$method][$property] = $value; - } - - - /** - * Gets the value of a method property - * @param string $method - * @param string $property - */ - function get_method_property($method, $property, $default=NULL) - { - $retval = NULL; - - if (isset($this->_method_properties[$method][$property])) { - $retval = $this->_method_properties[$method][$property]; - } - - if (is_null($retval)) $retval=$default; - - return $retval; - } - - - /** - * Clears all method properties to have their default values. This is called - * before every method call (before pre-hooks) - * @param string $method - */ - function reset_method_properties($method, $args=array()) - { - $this->_method_properties[$method] = array( - 'run' => TRUE, - 'run_pre_hooks' => TRUE, - 'run_post_hooks' => TRUE, - 'arguments' => $args - ); - } - - /** - * Removes the cache of the method properties - * @param $method - */ - function remove_method_properties($method) - { - unset($this->_method_properties[$method]); - } - - /** - * Gets all method properties - * @return array - */ - function get_method_properties($method) - { - return $this->_method_properties[$method]; - } - - /** - * Sets all method properties - * @param $method - * @param $props - */ - function set_method_properties($method, $props) - { - foreach ($props as $key => $value) { - $this->set_method_property($method, $key, $value); - } - } - /** * Returns TRUE if the ExtensibleObject has decided to implement a * particular interface @@ -1283,6 +713,34 @@ class ExtensibleObject extends PopeHelpers return $methods; } } + + function get_parent_mixin_providing($method, $return_obj=FALSE, $levels=1) + { + $disabled_mixins = array(); + + for ($i=0; $i<$levels; $i++) { + if (($klass = $this->get_mixin_providing($method))) { + $this->disable_mixin_for($method, $klass); + $disabled_mixins[] = $klass; + + // Get the method map cache + $orig_method_map = $this->_method_map_cache; + $this->_method_map_cache = (array)C_Pope_Cache::get( + array($this->context, $this->_mixin_priorities, $this->_disabled_map), + $this->_method_map_cache + ); + } + } + + $retval = $this->get_mixin_providing($method, $return_obj); + + // Re-enable mixins + foreach ($disabled_mixins as $klass) { + $this->enable_mixin_for($method, $klass); + } + + return $retval; + } } @@ -1316,39 +774,41 @@ class Mixin extends PopeHelpers { $retval = NULL; - // To simulate a 'parent' call, we remove the current extension from the - // ExtensibleObject that is providing the method's implementation, re-emit - // the call on the instance to trigger the implementation from the previously - // added extension, and then restore things by re-adding the current extension. - // It's complicated, but it works. - - // We need to determine the name of the extension. Because PHP 5.2 is - // missing get_called_class(), we have to look it up in the backtrace - $backtrace = debug_backtrace(); - $klass = get_class($backtrace[0]['object']); - - // Get the method properties. We'll store this afterwards. - $props = $this->object->get_method_properties($method); + // To simulate a 'parent' call, we remove the current mixin providing the + // implementation. + $klass = $this->object->get_mixin_providing($method); // Perform the routine described above... - $this->object->disable_pre_hooks($method); - $this->object->disable_post_hooks($method); - $this->object->disable_mixin($method, $klass); + $this->object->disable_mixin_for($method, $klass); + + // Get the method map cache + $orig_method_map = $this->object->_method_map_cache; + $this->object->_method_map_cache = (array)C_Pope_Cache::get( + array($this->object->context, $this->object->_mixin_priorities, $this->object->_disabled_map), + $this->object->_method_map_cache + ); // Call anchor $args = func_get_args(); // Remove $method parameter array_shift($args); + + // Execute the method $retval = $this->object->call_method($method, $args); - // Re-enable hooks - $this->object->enable_pre_hooks($method); - $this->object->enable_post_hooks($method); - $this->object->enable_mixin($method, $klass); + // Cache the method map for this configuration of mixins + C_Pope_Cache::set( + array($this->object->context, $this->object->_mixin_priorities, $this->object->_disabled_map), + $this->object->_method_map_cache + ); + + // Re-enable mixins; +// $this->object->add_mixin($klass); + $this->object->enable_mixin_for($method, $klass); - // Re-set all method properties - $this->object->set_method_properties($method, $props); + // Restore the original method map + $this->object->_method_map_cache = $orig_method_map; return $retval; } @@ -1377,43 +837,4 @@ class Mixin extends PopeHelpers { return $this->object->$property; } -} - -/** - * An extension which has the purpose of being used as a hook - */ -class Hook extends Mixin -{ - // Similiar to a mixin's call_parent method. - // If a hook needs to call the method that it applied the - // Hook n' Anchor pattern to, then this method should be called - function call_anchor() - { - // Disable hooks, so that we call the anchor point - $this->object->disable_pre_hooks($this->method_called); - $this->object->disable_post_hooks($this->method_called); - - // Call anchor - $args = func_get_args(); - $retval = $this->object->call_method($this->method_called, $args); - - // Re-enable hooks - $this->object->enable_pre_hooks($this->method_called); - $this->object->enable_post_hooks($this->method_called); - - return $retval; - } - - /** - * Provides an alias for call_anchor, as there's no parent - * to call in the context of a hook. - */ - function call_parent($method) - { - $args = func_get_args(); - return call_user_func_array( - array(&$this, 'call_anchor'), - $args - ); - } -}; \ No newline at end of file +} \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/pope/lib/class.pope_cache.php b/wp-content/plugins/nextgen-gallery/pope/lib/class.pope_cache.php new file mode 100644 index 0000000000000000000000000000000000000000..a7f895615e5c4a81fabc550e782f748ccaebacb0 --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/pope/lib/class.pope_cache.php @@ -0,0 +1,334 @@ +<?php + +class C_Pope_Cache +{ + static $_instance = NULL; + static $_driver = NULL; + static $key_prefix = array('pope'); + static $enabled = TRUE; // the cache is not used at all + static $do_not_lookup = FALSE; // no lookups are made to the cache + static $force_update = FALSE; // force the cache to be updated + protected $_queue = array(); + + static function &get_instance($driver='C_Pope_Cache_SingleFile') + { + if (!isset(self::$_instance)) + self::$_instance = new C_Pope_Cache($driver); + + return self::$_instance; + } + + function __construct($driver = 'C_Pope_Cache_SingleFile') + { + if (is_null(self::$_driver)) + self::set_driver($driver); + } + + static function set_driver($class_name) + { + self::$_driver = $class_name; + } + + static function add_key_prefix($prefix) + { + self::$key_prefix[] = $prefix; + $driver = self::$_driver; + return call_user_func("{$driver}::add_key_prefix", $prefix); + } + + static function get($params, $default=NULL) + { + if (!self::$enabled) + return $default; + $cache = self::get_instance(); + $key = $cache->get_key_from_params($params); + if (self::$do_not_lookup) + return $default; + else + return $cache->lookup($key, $default); + } + + static function set($params, $value) + { + if (self::$enabled) + { + $cache = self::get_instance(); + $key = $cache->get_key_from_params($params); + $cache->update($key, $value); + } + } + + function get_key_from_params($params) + { + return md5(json_encode($params)); + } + + function lookup($key, $default=NULL) + { + $driver = self::$_driver; + return call_user_func("{$driver}::lookup", $key, $default); + } + + function update($key, $value) + { + $driver = self::$_driver; + return call_user_func("{$driver}::update", $key, $value); + } + + function flush() + { + $driver = self::$_driver; + return call_user_func("{$driver}::flush"); + } + +} + +interface I_Pope_Cache_Driver +{ + public static function add_key_prefix($prefix); + public static function flush(); + public static function lookup($key, $default = NULL); + public static function update($key, $value); +} + +class C_Pope_Cache_MultiFile implements I_Pope_Cache_Driver +{ + static $initialized = FALSE; + static $cache_dir = NULL; + static $use_cache_subdir = TRUE; + + public static function initialize() + { + if (self::$initialized) + return; + + if (is_null(self::$cache_dir)) + self::set_cache_dir(); + + self::$initialized = TRUE; + } + + public static function add_key_prefix($prefix) + { + self::set_cache_dir(); + } + + public static function lookup($key, $default=NULL) + { + self::initialize(); + + $filename = self::get_filename_from_key($key); + + if (@file_exists($filename)) + return json_decode(@file_get_contents($filename)); + else + return $default; + } + + public static function update($key, $value) + { + self::initialize(); + + // TODO: log/warn users their cache dir can't be used + if (@file_exists(self::$cache_dir) && !@is_dir(self::$cache_dir)) + return; + + $filename = self::get_filename_from_key($key); + + if (@file_exists($filename) && C_Pope_Cache::$force_update == FALSE) + return; + + @file_put_contents($filename, json_encode($value)); + } + + public static function flush() + { + self::initialize(); + + $dir = self::$cache_dir; + if (@file_exists($dir) && @is_dir($dir)) + { + foreach (@scandir($dir) as $file) { + if ($file == '.' || $file == '..') + continue; + $file = self::join_paths($dir, $file); + if (is_dir($file) && self::$use_cache_subdir) + { + self::flush($dir); + } + else { + if (!self::$use_cache_subdir && strpos(basename($file), implode('_', C_Pope_Cache::$key_prefix) . '_') === 0) + @unlink($file); + elseif (self::$use_cache_subdir) + @unlink($file); + } + } + } + } + + public static function set_cache_dir() + { + if (defined('POPE_CACHE_DIR')) + { + self::$cache_dir = POPE_CACHE_DIR; + if (!@file_exists(self::$cache_dir)) + @mkdir(self::$cache_dir, 0777, TRUE); + } + else { + if (self::$use_cache_subdir) + { + self::$cache_dir = self::join_paths(sys_get_temp_dir(), C_Pope_cache::$key_prefix); + if (!@file_exists(self::$cache_dir)) + { + // if we can't create a subdirectory we fallback to prefixing filenames (eg /tmp/pope_$key) + $mkdir_result = @mkdir(self::$cache_dir, 0777, TRUE); + if (FALSE === $mkdir_result) + { + self::$use_cache_subdir = FALSE; + self::$cache_dir = self::join_paths(sys_get_temp_dir()); + } + } + } + else { + self::$cache_dir = self::join_paths(sys_get_temp_dir()); + } + } + + $func = function_exists('wp_is_writable') ? 'wp_is_writable' : 'is_writable'; + if (!@$func(self::$cache_dir)) + C_Pope_Cache::$enabled = FALSE; + } + + public static function get_filename_from_key($key) + { + if (self::$use_cache_subdir) + $filename = self::join_paths(self::$cache_dir, $key); + else + $filename = self::join_paths(self::$cache_dir) . DIRECTORY_SEPARATOR . implode('_', C_Pope_Cache::$key_prefix) . '_' . $key; + return $filename; + } + + public static function join_paths() + { + $args = func_get_args(); + foreach ($args as &$arg) { + if (is_array($arg)) + $arg = implode(DIRECTORY_SEPARATOR, $arg); + } + return implode(DIRECTORY_SEPARATOR, $args); + } +} + +function C_Pope_Cache_SingleFile_Shutdown() +{ + $filename = C_Pope_Cache_SingleFile::get_filename(); + @file_put_contents( + $filename, + json_encode(C_Pope_Cache_SingleFile::$cache) + ); +} + +class C_Pope_Cache_SingleFile implements I_Pope_Cache_Driver +{ + static $initialized = FALSE; + static $cache_dir = NULL; + static $cache = array(); + static $writepending = FALSE; + + public static function initialize() + { + if (self::$initialized) + return; + + if (is_null(self::$cache_dir)) + self::set_cache_dir(); + + $filename = self::get_filename(); + if (@file_exists($filename)) + self::$cache = json_decode(@file_get_contents($filename), TRUE); + + if (!is_array(self::$cache)) + self::$cache = array(); + + register_shutdown_function('C_Pope_Cache_SingleFile_Shutdown'); + + self::$initialized = TRUE; + } + + public static function add_key_prefix($prefix) + { + self::set_cache_dir(); + } + + public static function lookup($key, $default=NULL) + { + self::initialize(); + + if (!empty(self::$cache[$key])) + return self::$cache[$key]; + else + return $default; + } + + public static function update($key, $value) + { + self::initialize(); + + $dupe = FALSE; + + if (!empty(self::$cache[$key])) { + if (self::$cache[$key] == $value) + $dupe = TRUE; + } + + if ($dupe == TRUE && C_Pope_Cache::$force_update == FALSE) + return; + + self::$cache[$key] = $value; + self::$writepending = TRUE; + } + + public static function flush() + { + self::initialize(); + $filename = self::get_filename(); + if (@file_exists($filename)) + @unlink($filename); + } + + public static function get_filename() + { + if (count(C_Pope_Cache::$key_prefix) == 1) + C_Pope_Cache::add_key_prefix('cache'); + $filename = implode('_', C_Pope_Cache::$key_prefix); + return self::join_paths(self::$cache_dir, $filename); + } + + public static function set_cache_dir() + { + if (defined('POPE_CACHE_DIR')) + { + self::$cache_dir = POPE_CACHE_DIR; + if (!@file_exists(self::$cache_dir)) + @mkdir(self::$cache_dir, 0777, TRUE); + } + else { + self::$cache_dir = self::join_paths(sys_get_temp_dir()); + } + + $func = function_exists('wp_is_writable') ? 'wp_is_writable' : 'is_writable'; + if (!@$func(self::$cache_dir)) + C_Pope_Cache::$enabled = FALSE; + } + + public static function join_paths() + { + $args = func_get_args(); + foreach ($args as &$arg) { + if (is_array($arg)) + $arg = implode(DIRECTORY_SEPARATOR, $arg); + } + return implode(DIRECTORY_SEPARATOR, $args); + } +} + diff --git a/wp-content/plugins/nextgen-gallery/pope/lib/interface.component.php b/wp-content/plugins/nextgen-gallery/pope/lib/interface.component.php index b054d3f3888da3e73901f259f24e4a43aef2fb56..e31f6a474a1ebd61d2f9d90fe48db668c0cbc80c 100644 --- a/wp-content/plugins/nextgen-gallery/pope/lib/interface.component.php +++ b/wp-content/plugins/nextgen-gallery/pope/lib/interface.component.php @@ -1,5 +1,7 @@ <?php +if (!defined('POPE_VERSION')) { die('Use autoload.php'); } + /** * Provides a generic interface to be registered with an adapter to modify any * component (within a particular context, if desired) diff --git a/wp-content/plugins/nextgen-gallery/pope/lib/interface.component_factory.php b/wp-content/plugins/nextgen-gallery/pope/lib/interface.component_factory.php index 57cf3f2b66e8ed22a8f770b779aae56ffb5afca1..5aed056e752d6d382f92e2ed378cb40cb840aa9d 100755 --- a/wp-content/plugins/nextgen-gallery/pope/lib/interface.component_factory.php +++ b/wp-content/plugins/nextgen-gallery/pope/lib/interface.component_factory.php @@ -1,5 +1,7 @@ <?php +if (!defined('POPE_VERSION')) { die('Use autoload.php'); } + interface I_Component_Factory { diff --git a/wp-content/plugins/nextgen-gallery/pope/lib/interface.pope_module.php b/wp-content/plugins/nextgen-gallery/pope/lib/interface.pope_module.php index cfa5c5c5e79fb41f0b7cd384b7b39becebbd191f..b3f5f3be198755df3bc58ebbeb5eae643525ef6c 100644 --- a/wp-content/plugins/nextgen-gallery/pope/lib/interface.pope_module.php +++ b/wp-content/plugins/nextgen-gallery/pope/lib/interface.pope_module.php @@ -1,5 +1,7 @@ <?php +if (!defined('POPE_VERSION')) { die('Use autoload.php'); } + interface I_Pope_Module { diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/class.nextgen_product_installer.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/class.nextgen_product_installer.php index 7f9a1ee68e66fd6d7de2799fbd26c11f4081fa8c..0f251b850d5ccbfb7424a49127523f3ffa094cd3 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/class.nextgen_product_installer.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/class.nextgen_product_installer.php @@ -14,14 +14,43 @@ class C_NextGen_Product_Installer return $pope_modules_list; } + function get_modules_to_load_for($product_id) + { + $modules = array(); + + $obj = C_Component_Registry::get_instance()->get_product($product_id); + try { + $klass = new ReflectionClass( $obj ); + if ( $klass->hasMethod( 'get_modules_to_load' ) ) { + $modules = $obj->get_modules_to_load(); + } elseif ( $klass->hasProperty( 'modules' ) ) { + $modules = $klass->getStaticPropertyValue( 'modules' ); + } + + if ( ! $modules && $klass->hasMethod( 'define_modules' ) ) { + $modules = $obj->define_modules(); + if ( $klass->hasProperty( 'modules' ) ) { + $modules = $klass->getStaticPropertyValue( 'modules' ); + } + } + } + catch (ReflectionException $ex) { + // Oh oh... + } + + return $modules; + } + function uninstall($hard) { // remove this products modules from the pope_module_list registry + $registry = C_Component_Registry::get_instance(); + $nextgen_product = $registry->get_product('photocrati-nextgen'); $pope_modules_list = get_option('pope_module_list', array()); - $pope_modules_list = $this->_filter_modules($pope_modules_list, P_Photocrati_NextGen::$modules); + $pope_modules_list = $this->_filter_modules($pope_modules_list, $nextgen_product->get_modules_to_load()); // run each modules respective uninstall routines - foreach (P_Photocrati_NextGen::$modules as $module_name) { + foreach ($nextgen_product->get_modules_to_load() as $module_name) { if (($handler = C_Photocrati_Installer::get_handler_instance($module_name))) { if (method_exists($handler, 'uninstall')) $handler->uninstall($hard); } @@ -44,7 +73,7 @@ class C_NextGen_Product_Installer if (FALSE !== $pro_version) { - $pope_modules_list = $this->_filter_modules($pope_modules_list, P_Photocrati_NextGen_Pro::$modules); + $pope_modules_list = $this->_filter_modules($pope_modules_list, $this->get_modules_to_load_for('photocrati-nextgen-pro')); $search = array_search('photocrati-nextgen-pro|' . $pro_version, $pope_modules_list); if (FALSE !== $search) unset($pope_modules_list[$search]); diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ajax/module.ajax.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ajax/module.ajax.php index 263716933c11963769b76608df1e8073a886d0d6..c2d3e949f5312f53346573aed74bdb88fbb000be 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ajax/module.ajax.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ajax/module.ajax.php @@ -1,5 +1,7 @@ <?php +define('NGG_AJAX_SLUG', 'photocrati_ajax'); + /* { Module: photocrati-ajax, @@ -8,96 +10,118 @@ */ class M_Ajax extends C_Base_Module { - function define() - { - parent::define( - 'photocrati-ajax', - 'AJAX', - 'Provides AJAX functionality', - '0.7', - 'http://www.photocrati.com', - 'Photocrati Media', - 'http://www.photocrati.com' - ); - - include_once('class.ajax_option_handler.php'); + function define() + { + parent::define( + 'photocrati-ajax', + 'AJAX', + 'Provides AJAX functionality', + '0.8', + 'http://www.photocrati.com', + 'Photocrati Media', + 'http://www.photocrati.com' + ); C_NextGen_Settings::get_instance()->add_option_handler('C_Ajax_Option_Handler', array( 'ajax_slug', 'ajax_url', 'ajax_js_url' )); + if (is_multisite()) C_NextGen_Global_Settings::get_instance()->add_option_handler('C_Ajax_Option_Handler', array( 'ajax_slug', 'ajax_url', 'ajax_js_url' )); + } - include_once('class.ajax_installer.php'); - C_Photocrati_Installer::add_handler($this->module_id, 'C_Ajax_Installer'); - } - - function _register_adapters() - { - $this->get_registry()->add_adapter('I_Router', 'A_Ajax_Routes'); - } + function _register_utilities() + { + $this->get_registry()->add_utility('I_Ajax_Controller', 'C_Ajax_Controller'); - function _register_utilities() - { - $this->get_registry()->add_utility('I_Ajax_Controller', 'C_Ajax_Controller'); + } - } + /** + * Hooks into the WordPress framework + */ + function _register_hooks() + { + add_action('init', array(get_class(), 'register_scripts'), 9); + add_action('ngg_routes', array(&$this, 'define_routes')); + add_action('init', array(&$this, 'serve_ajax_request')); + } - /** - * Hooks into the WordPress framework - */ - function _register_hooks() + function serve_ajax_request() { - add_action('init', array(&$this, 'enqueue_scripts'), 9); + if (isset($_REQUEST[NGG_AJAX_SLUG])) { + $controller = C_Ajax_Controller::get_instance(); + $controller->index_action(); + throw new E_Clean_Exit; + } } + function define_routes($router) + { + $app = $router->create_app('/photocrati_ajax'); + $app->route('/', 'I_Ajax_Controller#index'); + } - /** - * Loads a single script to provide the photocrati_ajax settings to the web browser - */ - function enqueue_scripts() - { + /** + * Loads a single script to provide the photocrati_ajax settings to the web browser + */ + static function register_scripts() + { $settings = C_NextGen_Settings::get_instance(); - $router = $this->get_registry()->get_utility('I_Router'); + $router = C_Router::get_instance(); - wp_register_script('photocrati_ajax', $settings->ajax_js_url); - wp_enqueue_script('photocrati_ajax'); + wp_register_script('photocrati_ajax', $router->get_static_url('photocrati-ajax#ajax.min.js'), array('jquery')); $vars = array( - 'url' => $router->get_url($settings->ajax_slug, FALSE), + 'url' => $settings->get('ajax_url'), 'wp_home_url' => $router->get_base_url('home'), 'wp_site_url' => $router->get_base_url('site'), 'wp_root_url' => $router->get_base_url('root'), 'wp_plugins_url' => $router->get_base_url('plugins'), 'wp_content_url' => $router->get_base_url('content'), - 'wp_includes_url' => includes_url() + 'wp_includes_url' => includes_url(), + 'ngg_param_slug' => C_NextGen_Settings::get_instance()->get('router_param_slug', 'nggallery') ); wp_localize_script('photocrati_ajax', 'photocrati_ajax', $vars); - - if (defined('NGG_SKIP_LOAD_SCRIPTS') && NGG_SKIP_LOAD_SCRIPTS) - return; - - wp_register_script('persist-js', $router->get_static_url('photocrati-ajax#persist.js')); - wp_register_script('store-js', $router->get_static_url('photocrati-ajax#store.js')); - wp_register_script('ngg-store-js', $router->get_static_url('photocrati-ajax#ngg_store.js'), array('jquery', 'persist-js', 'store-js')); - - wp_enqueue_script('ngg-store-js'); - } + } function get_type_list() { return array( - 'A_Ajax_Routes' => 'adapter.ajax_routes.php', 'C_Ajax_Installer' => 'class.ajax_installer.php', 'C_Ajax_Controller' => 'class.ajax_controller.php', - 'I_Ajax_Controller' => 'interface.ajax_controller.php', 'M_Ajax' => 'module.ajax.php' ); } } +class C_Ajax_Option_Handler { + private $slug = NGG_AJAX_SLUG; + + function get_router() { + return C_Router::get_instance(); + } + + function get( $key, $default = null ) { + $retval = $default; + + switch ( $key ) { + case 'ajax_slug': + $retval = $this->slug; + break; + case 'ajax_url': + $retval = site_url( "/?{$this->slug}=1" ); + if ( is_ssl() && strpos( $retval, 'https' ) === false ) { + $retval = str_replace( 'http', 'https', $retval ); + } + break; + } + + return $retval; + } +} + new M_Ajax(); diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ajax/package.module.ajax.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ajax/package.module.ajax.php new file mode 100644 index 0000000000000000000000000000000000000000..4c723bfa653b1f0239a2a4e1754af0dd489bef05 --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ajax/package.module.ajax.php @@ -0,0 +1,72 @@ +<?php +class C_Ajax_Controller extends C_MVC_Controller +{ + static $_instances = array(); + public function define($context = FALSE) + { + parent::define($context); + $this->implement('I_Ajax_Controller'); + } + public function index_action() + { + $retval = NULL; + // Inform the MVC framework what type of content we're returning + $this->set_content_type('json'); + // Start an output buffer to avoid displaying any PHP warnings/errors + ob_start(); + // Get the action requested & find and execute the related method + if ($action = $this->param('action')) { + $method = "{$action}_action"; + if ($this->has_method($method)) { + $retval = $this->call_method($method); + } else { + $retval = array('error' => 'Not a valid AJAX action'); + } + } else { + $retval = array('error' => 'No action specified'); + } + // Flush the buffer + $buffer_limit = 0; + $zlib = ini_get('zlib.output_compression'); + if (!is_numeric($zlib) && $zlib == 'On') { + $buffer_limit = 1; + } else { + if (is_numeric($zlib) && $zlib > 0) { + $buffer_limit = 1; + } + } + while (ob_get_level() != $buffer_limit) { + ob_end_clean(); + } + // Return the JSON to the browser + echo json_encode($retval); + } + /** + * Returns an instance of this class + * @param string $context + * @return C_Ajax_Controller + */ + static function get_instance($context = FALSE) + { + if (!isset(self::$_instances[$context])) { + $klass = get_class(); + self::$_instances[$context] = new $klass($context); + } + return self::$_instances[$context]; + } + public function validate_ajax_request($action = NULL, $check_token = false) + { + // TODO: remove this. Pro 2.1's proofing calls validate_ajax_request() with a null $action + if (!$action) { + return TRUE; + } + $valid_request = false; + $security = $this->get_registry()->get_utility('I_Security_Manager'); + $sec_actor = $security->get_current_actor(); + $sec_token = $security->get_request_token($action); + if ($sec_actor->is_allowed($action) && (!$check_token || $sec_token->check_current_request())) { + $valid_request = true; + } + return $valid_request; + } +} \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ajax/static/ajax.min.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ajax/static/ajax.min.js new file mode 100644 index 0000000000000000000000000000000000000000..35b7016d57452a6ce93f2691c139e665d9d6ebc9 --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ajax/static/ajax.min.js @@ -0,0 +1,55 @@ + +EasyCookie=(function(){var EPOCH='Thu, 01-Jan-1970 00:00:01 GMT',RATIO=1000*60*60*24,KEYS=['expires','path','domain'],esc=escape,un=unescape,doc=document,me;var get_now=function(){var r=new Date();r.setTime(r.getTime());return r;} + var cookify=function(c_key,c_val){var i,key,val,r=[],opt=(arguments.length>2)?arguments[2]:{};r.push(esc(c_key)+'='+esc(c_val));for(i=0;i<KEYS.length;i++){key=KEYS[i];if(val=opt[key]) + r.push(key+'='+val);} + if(opt.secure) + r.push('secure');return r.join('; ');} + var alive=function(){var k='__EC_TEST__',v=new Date();v=v.toGMTString();this.set(k,v);this.enabled=(this.remove(k)==v);return this.enabled;} + me={set:function(key,val){var opt=(arguments.length>2)?arguments[2]:{},now=get_now(),expire_at,cfg={};if(opt.expires){opt.expires*=RATIO;cfg.expires=new Date(now.getTime()+opt.expires);cfg.expires=cfg.expires.toGMTString();} + var keys=['path','domain','secure'];for(i=0;i<keys.length;i++) + if(opt[keys[i]]) + cfg[keys[i]]=opt[keys[i]];var r=cookify(key,val,cfg);doc.cookie=r;return val;},has:function(key){key=esc(key);var c=doc.cookie,ofs=c.indexOf(key+'='),len=ofs+key.length+1,sub=c.substring(0,key.length);return((!ofs&&key!=sub)||ofs<0)?false:true;},get:function(key){key=esc(key);var c=doc.cookie,ofs=c.indexOf(key+'='),len=ofs+key.length+1,sub=c.substring(0,key.length),end;if((!ofs&&key!=sub)||ofs<0) + return null;end=c.indexOf(';',len);if(end<0) + end=c.length;return un(c.substring(len,end));},remove:function(k){var r=me.get(k),opt={expires:EPOCH};doc.cookie=cookify(k,'',opt);return r;},keys:function(){var c=doc.cookie,ps=c.split('; '),i,p,r=[];for(i=0;i<ps.length;i++){p=ps[i].split('=');r.push(un(p[0]));} + return r;},all:function(){var c=doc.cookie,ps=c.split('; '),i,p,r=[];for(i=0;i<ps.length;i++){p=ps[i].split('=');r.push([un(p[0]),un(p[1])]);} + return r;},version:'0.2.1',enabled:false};me.enabled=alive.call(me);return me;}()); + +window.Ngg_Store = { + + get: function(key){ + return EasyCookie.get(key); + }, + + set: function(key, value){ + if (typeof(value) == 'object') { + value = JSON.stringify(value); + } + return EasyCookie.set(key, value, { + expires: 10, + path: '/', + secure: false + }); + }, + + del: function(key){ + EasyCookie.remove(key); + return !this.has(key); + }, + + has: function(key){ + var value = this.get(key); + return typeof(value) != 'undefined' && value != null; + }, + + save: function(){ + return true; + } +}; + +jQuery(function($){ + +$(window).unload(function(){ + Ngg_Store.save(); +}) + +}); diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/module.attach_to_post.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/module.attach_to_post.php index 48d6dcedc6f15b152660fa8da9badc3ffef0ba34..05b5d92898a5beb372c76302649ec1fe013cf732 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/module.attach_to_post.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/module.attach_to_post.php @@ -12,6 +12,7 @@ class M_Attach_To_Post extends C_Base_Module { var $attach_to_post_tinymce_plugin = 'NextGEN_AttachToPost'; var $_event_publisher = NULL; + static $substitute_placeholders = TRUE; /** * Defines the module @@ -23,14 +24,13 @@ class M_Attach_To_Post extends C_Base_Module 'photocrati-attach_to_post', 'Attach To Post', 'Provides the "Attach to Post" interface for displaying galleries and albums', - '0.10', + '0.11', 'http://www.nextgen-gallery.com', 'Photocrati Media', 'http://www.photocrati.com', $context ); - include_once('class.attach_to_post_option_handler.php'); C_NextGen_Settings::get_instance()->add_option_handler('C_Attach_To_Post_Option_Handler', array( 'attach_to_post_url', 'gallery_preview_url', @@ -42,20 +42,12 @@ class M_Attach_To_Post extends C_Base_Module 'attach_to_post_display_tab_js_url' )); - include_once('class.attach_to_post_installer.php'); C_Photocrati_Installer::add_handler($this->module_id, 'C_Attach_To_Post_Installer'); - - // Set WP_ADMIN=true for better compatibility with certain themes & plugins. - // Unfortunately as of 3.9 in a multisite environment this causes problems. - if (self::is_atp_url() && (!defined('MULTISITE') || (defined('MULTISITE') && !MULTISITE))) - define('WP_ADMIN', true); } - // We only register our display-type settings forms when IS_ADMIN, but Wordpress 3.9 introduced a problem - // with doing this on multisite sub-sites. Now we register our forms when is_atp_url() is true OR is_admin() static function is_atp_url() { - return (strpos(strtolower($_SERVER['REQUEST_URI']), '/nextgen-attach_to_post') !== false) ? TRUE : FALSE; + return (strpos(strtolower($_SERVER['REQUEST_URI']), NGG_ATTACH_TO_POST_SLUG) !== false) ? TRUE : FALSE; } /** @@ -82,7 +74,6 @@ class M_Attach_To_Post extends C_Base_Module $this->get_registry()->add_utility( 'I_Attach_To_Post_Controller', 'C_Attach_Controller' -// 'C_Attach_To_Post_Proxy_Controller' ); } @@ -96,11 +87,6 @@ class M_Attach_To_Post extends C_Base_Module 'I_Installer', 'A_Attach_To_Post_Installer' ); - // Provides routing for the Attach To Post interface - $this->get_registry()->add_adapter( - 'I_Router', 'A_Attach_To_Post_Routes' - ); - // Provides AJAX actions for the Attach To Post interface $this->get_registry()->add_adapter( 'I_Ajax_Controller', 'A_Attach_To_Post_Ajax' @@ -116,37 +102,101 @@ class M_Attach_To_Post extends C_Base_Module function _register_hooks() { + add_action('ngg_routes', array(&$this, 'define_routes'), 2); + + // We use two hooks here because we need it to execute for both the post-new.php + // page and ATP interface + add_action('plugins_loaded', array(&$this, 'fix_ie11'), 1); + add_action('admin_init', array(&$this, 'fix_ie11'), PHP_INT_MAX-1); + add_action('admin_enqueue_scripts', array(&$this, 'fix_ie11'), 1); + add_action('admin_enqueue_scripts', array(&$this, 'fix_ie11'), PHP_INT_MAX-1); + + // Emit frame communication events + add_action('ngg_created_new_gallery', array(&$this, 'new_gallery_event')); + add_action('ngg_after_new_images_added',array(&$this, 'images_added_event')); + add_action('ngg_page_event', array(&$this, 'nextgen_page_event')); + add_action('ngg_manage_tags', array(&$this, 'manage_tags_event')); + + // Admin-only hooks if (is_admin()) { add_action( 'admin_enqueue_scripts', array(&$this, 'enqueue_static_resources'), 1 ); + + add_action('admin_init', array(&$this, 'route_insert_gallery_window')); + + // TODO: In 2.0.69, we're going to change the ATP placeholder urls + if (FALSE) { + add_filter('the_editor_content', array(&$this, 'fix_preview_images')); + } + } - // Add hook to delete displayed galleries when removed from a post - add_action('pre_post_update', array(&$this, 'locate_stale_displayed_galleries')); - add_action('before_delete_post', array(&$this, 'locate_stale_displayed_galleries')); - add_action('post_updated', array(&$this, 'cleanup_displayed_galleries')); - add_action('after_delete_post', array(&$this, 'cleanup_displayed_galleries')); + // Frontend-only hooks + if (!is_admin()) { + // Add hook to subsitute displayed gallery placeholders + add_filter('the_content', array(&$this, 'substitute_placeholder_imgs'), PHP_INT_MAX, 1); + } + } - // Add hook to subsitute displayed gallery placeholders - add_filter('the_content', array(&$this, 'substitute_placeholder_imgs'), PHP_INT_MAX, 1); + /** + * In 2.0.66.X and earlier, ATP placeholder images used a different url than + * what 2.0.69 uses. Therefore, we need to convert those + * @param $content + * + * @return mixed + */ + function fix_preview_images($content) + { + $content = str_replace( + site_url('/'.NGG_ATTACH_TO_POST_SLUG.'/preview/id--'), + admin_url('/?'.NGG_ATTACH_TO_POST_SLUG.'='.NGG_ATTACH_TO_POST_SLUG.'/preview/id--'), + $content + ); - // Emit frame communication events - add_action('ngg_created_new_gallery', array(&$this, 'new_gallery_event')); - add_action('ngg_after_new_images_added',array(&$this, 'images_added_event')); - add_action('ngg_page_event', array(&$this, 'nextgen_page_event')); - add_action('ngg_manage_tags', array(&$this, 'manage_tags_event')); + $content = str_replace( + site_url('/index.php/'.NGG_ATTACH_TO_POST_SLUG.'/preview/id--'), + admin_url('/?'.NGG_ATTACH_TO_POST_SLUG.'='.NGG_ATTACH_TO_POST_SLUG.'/preview/id--'), + $content + ); - // We use two hooks here because we need it to execute for both the post-new.php - // page and ATP interface - add_action('plugins_loaded', array(&$this, 'fix_ie11'), 1); - add_action('admin_init', array(&$this, 'fix_ie11'), PHP_INT_MAX-1); - add_action('admin_enqueue_scripts', array(&$this, 'fix_ie11'), 1); - add_action('admin_enqueue_scripts', array(&$this, 'fix_ie11'), PHP_INT_MAX-1); + return $content; } + /** + * Route the IGW requests using wp-admin + * @throws E_Clean_Exit + */ + function route_insert_gallery_window() + { + if (isset($_REQUEST[NGG_ATTACH_TO_POST_SLUG])) { + $controller = C_Attach_Controller::get_instance(); + if ($_REQUEST[NGG_ATTACH_TO_POST_SLUG] == 'js') { + $controller->display_tab_js_action(); + } + elseif (strpos($_REQUEST[NGG_ATTACH_TO_POST_SLUG], '/preview') !== FALSE) { + $controller->preview_action(); + } + else { + $controller->index_action(); + } + + throw new E_Clean_Exit; + } + } + + function define_routes($router) + { + $app = $router->create_app('/'.NGG_ATTACH_TO_POST_SLUG); + $app->rewrite('/preview/{id}', '/preview/id--{id}'); + $app->rewrite('/display_tab_js/{id}', '/display_tab_js/id--{id}'); + $app->route('/preview', 'I_Attach_To_Post_Controller#preview'); + $app->route('/display_tab_js', 'I_Attach_To_Post_Controller#display_tab_js'); + $app->route('/', 'I_Attach_To_Post_Controller#index'); + } + /** * WordPress sets the X-UA-Compatible header to IE=edge. Unfortunately, this causes problems with Plupload, * so we have the send this header @@ -167,21 +217,28 @@ class M_Attach_To_Post extends C_Base_Module */ function substitute_placeholder_imgs($content) { - // The placeholder MUST have a gallery instance id - if (preg_match_all("#<img.*http(s)?://(.*)/" . NGG_ATTACH_TO_POST_SLUG . "/preview/id--(\\d+).*>#mi", $content, $matches, PREG_SET_ORDER)) - { + $content = $this->fix_preview_images($content); + + // To match ATP entries we compare the stored url against a generic path; entries MUST have a gallery ID + if (preg_match_all("#<img.*http(s)?://(.*)?".NGG_ATTACH_TO_POST_SLUG."(=|/)preview(/|&|&)id(=|--)(\\d+).*?>#mi", $content, $matches, PREG_SET_ORDER)) { + $mapper = C_Displayed_Gallery_Mapper::get_instance(); foreach ($matches as $match) { // Find the displayed gallery - $displayed_gallery_id = $match[3]; + $displayed_gallery_id = $match[6]; $displayed_gallery = $mapper->find($displayed_gallery_id, TRUE); // Get the content for the displayed gallery $retval = '<p>'._('Invalid Displayed Gallery').'</p>'; if ($displayed_gallery) { - $renderer = $this->get_registry()->get_utility('I_Displayed_Gallery_Renderer'); - $retval = $renderer->render($displayed_gallery, TRUE); + $retval = ''; + $renderer = C_Displayed_Gallery_Renderer::get_instance(); + if (defined('NGG_SHOW_DISPLAYED_GALLERY_ERRORS') && NGG_SHOW_DISPLAYED_GALLERY_ERRORS && $displayed_gallery->is_invalid()) { + $retval .= var_export($displayed_gallery->get_errors(), TRUE); + } + if (self::$substitute_placeholders) $retval .= $renderer->render($displayed_gallery, TRUE); } + $content = str_replace($match[0], $retval, $content); } } @@ -189,12 +246,13 @@ class M_Attach_To_Post extends C_Base_Module return $content; } + /** * Enqueues static resources required by the Attach to Post interface */ function enqueue_static_resources() { - $router = $this->get_registry()->get_utility('I_Router'); + $router = C_Router::get_instance(); // Enqueue resources needed at post/page level if (preg_match("/\/wp-admin\/(post|post-new)\.php$/", $_SERVER['SCRIPT_NAME'])) { @@ -217,7 +275,7 @@ class M_Attach_To_Post extends C_Base_Module */ function _enqueue_tinymce_resources() { - wp_localize_script( + wp_localize_script( 'media-editor', 'nextgen_gallery_attach_to_post_url', C_NextGen_Settings::get_instance()->attach_to_post_url @@ -265,7 +323,9 @@ class M_Attach_To_Post extends C_Base_Module function add_attach_to_post_tinymce_plugin($plugins) { global $wp_version; - $router = $this->get_registry()->get_utility('I_Router'); + $router = C_Router::get_instance(); + + wp_enqueue_script('photocrati_ajax'); if ($wp_version >= 3.9) $file = $router->get_static_url('photocrati-attach_to_post#ngg_attach_to_post_tinymce_plugin.js'); @@ -289,55 +349,13 @@ class M_Attach_To_Post extends C_Base_Module } - /** - * Locates the ids of displayed galleries that have been - * removed from the post, and flags then for cleanup (deletion) - * @global array $displayed_galleries_to_cleanup - * @param int $post_id - */ - function locate_stale_displayed_galleries($post_id) - { - global $displayed_galleries_to_cleanup; - $displayed_galleries_to_cleanup = array(); - $post = get_post($post_id); - $gallery_preview_url = C_NextGen_Settings::get_instance()->get('gallery_preview_url'); - $preview_url = preg_quote($gallery_preview_url, '#'); - if (preg_match_all("#{$preview_url}/id--(\d+)#", html_entity_decode($post->post_content), $matches, PREG_SET_ORDER)) { - foreach ($matches as $match) { - $preview_url = preg_quote($match[0], '/'); - // The post was edited, and the displayed gallery placeholder was removed - if (isset($_REQUEST['post_content']) && (!preg_match("/{$preview_url}/", $_POST['post_content']))) { - $displayed_galleries_to_cleanup[] = intval($match[1]); - } - // The post was deleted - elseif (!isset($_REQUEST['action'])) { - $displayed_galleries_to_cleanup[] = intval($match[1]); - } - } - } - } - - /** - * Deletes any displayed galleries that are no longer associated with - * a post/page - * @global array $displayed_galleries_to_cleanup - * @param int $post_id - */ - function cleanup_displayed_galleries($post_id) - { - global $displayed_galleries_to_cleanup; - $mapper = $this->get_registry()->get_utility('I_Displayed_Gallery_Mapper'); - foreach ($displayed_galleries_to_cleanup as $id) $mapper->destroy($id); - } - - /** * Notify frames that a new gallery has been created * @param int $gallery_id */ function new_gallery_event($gallery_id) { - $gallery = $this->get_registry()->get_utility('I_Gallery_Mapper')->find($gallery_id); + $gallery = C_Gallery_Mapper::get_instance()->find($gallery_id); if ($gallery) { $this->_get_frame_event_publisher()->add_event(array( 'event' => 'new_gallery', @@ -388,14 +406,55 @@ class M_Attach_To_Post extends C_Base_Module return array( 'A_Attach_To_Post_Ajax' => 'adapter.attach_to_post_ajax.php', 'C_Attach_To_Post_Installer' => 'class.attach_to_post_installer.php', - 'A_Attach_To_Post_Routes' => 'adapter.attach_to_post_routes.php', 'A_Gallery_Storage_Frame_Event' => 'adapter.gallery_storage_frame_event.php', 'C_Attach_Controller' => 'class.attach_controller.php', 'C_Attach_To_Post_Proxy_Controller' => 'class.attach_to_post_proxy_controller.php', - 'I_Attach_To_Post_Controller' => 'interface.attach_to_post_controller.php', 'Mixin_Attach_To_Post_Display_Tab' => 'mixin.attach_to_post_display_tab.php' ); } } +class C_Attach_To_Post_Option_Handler +{ + function get_router() + { + return C_Router::get_instance(); + } + + function get($key, $default=NULL) + { + $retval = $default; + + switch ($key) { + case 'attach_to_post_url': + $retval = admin_url('/?'.NGG_ATTACH_TO_POST_SLUG.'=1'); + break; + case 'gallery_preview_url': + // TODO: This url will be used in 2.0.69 + if (FALSE) $retval = admin_url('/?'.NGG_ATTACH_TO_POST_SLUG.'='.NGG_ATTACH_TO_POST_SLUG.'/preview'); + else $retval = $this->get_router()->get_url('/'.NGG_ATTACH_TO_POST_SLUG.'/preview', FALSE); + break; + case 'attach_to_post_display_tab_js_url': + $retval = admin_url('/?'.NGG_ATTACH_TO_POST_SLUG.'=js'); + break; + } + + if (is_ssl() && strpos($retval, 'https') === FALSE) $retval = str_replace('http', 'https', $retval); + + return $retval; + } +} + +class C_Attach_To_Post_Installer +{ + function install() + { + // Delete cached values. Needed for 2.0.7 and less + $settings = C_NextGen_Settings::get_instance(); + $settings->delete('attach_to_post_url'); + $settings->delete('gallery_preview_url'); + $settings->delete('attach_to_post_display_tab_js_url'); + } +} + new M_Attach_To_Post(); diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/package.module.attach_to_post.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/package.module.attach_to_post.php new file mode 100644 index 0000000000000000000000000000000000000000..e17dcb47b72a48a2d4d27efebe382ab5d1fde34f --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/package.module.attach_to_post.php @@ -0,0 +1,693 @@ +<?php +/** + * Provides AJAX actions for the Attach To Post interface + * TODO: Need to add authorization checks to each action + */ +class A_Attach_To_Post_Ajax extends Mixin +{ + public $attach_to_post = NULL; + /** + * Retrieves the attach to post controller + */ + public function get_attach_to_post() + { + if (is_null($this->attach_to_post)) { + $this->attach_to_post = C_Attach_Controller::get_instance(); + } + return $this->attach_to_post; + } + /** + * Returns a list of image sources for the Attach to Post interface + * @return type + */ + public function get_attach_to_post_sources_action() + { + $response = array(); + if ($this->object->validate_ajax_request('nextgen_edit_displayed_gallery')) { + $response['sources'] = $this->get_attach_to_post()->get_sources(); + } + return $response; + } + /** + * Gets existing galleries + * @return array + */ + public function get_existing_galleries_action() + { + $this->debug = TRUE; + $response = array(); + if ($this->object->validate_ajax_request('nextgen_edit_displayed_gallery')) { + $limit = $this->object->param('limit'); + $offset = $this->object->param('offset'); + // We return the total # of galleries, so that the client can make + // pagination requests + $mapper = C_Gallery_Mapper::get_instance(); + $response['total'] = $mapper->count(); + $response['limit'] = $limit = $limit ? $limit : 0; + $response['offset'] = $offset = $offset ? $offset : 0; + // Get the galleries + $mapper->select(); + if ($limit) { + $mapper->limit($limit, $offset); + } + $response['items'] = $mapper->run_query(); + } else { + $response['error'] = 'insufficient access'; + } + $this->debug = FALSE; + return $response; + } + /** + * Gets existing albums + * @return array + */ + public function get_existing_albums_action() + { + $response = array(); + if ($this->object->validate_ajax_request('nextgen_edit_displayed_gallery')) { + $limit = $this->object->param('limit'); + $offset = $this->object->param('offset'); + // We return the total # of albums, so that the client can make pagination requests + $mapper = C_Album_Mapper::get_instance(); + $response['total'] = $mapper->count(); + $response['limit'] = $limit = $limit ? $limit : 0; + $response['offset'] = $offset = $offset ? $offset : 0; + // Get the albums + $mapper->select(); + if ($limit) { + $mapper->limit($limit, $offset); + } + $response['items'] = $mapper->run_query(); + } + return $response; + } + /** + * Gets existing image tags + * @return array + */ + public function get_existing_image_tags_action() + { + $response = array(); + if ($this->object->validate_ajax_request('nextgen_edit_displayed_gallery')) { + $limit = $this->object->param('limit'); + $offset = $this->object->param('offset'); + $response['limit'] = $limit = $limit ? $limit : 0; + $response['offset'] = $offset = $offset ? $offset : 0; + $response['items'] = array(); + $params = array('number' => $limit, 'offset' => $offset, 'fields' => 'names'); + foreach (get_terms('ngg_tag', $params) as $term) { + $response['items'][] = array('id' => $term, 'title' => $term, 'name' => $term); + } + $response['total'] = count(get_terms('ngg_tag', array('fields' => 'ids'))); + } + return $response; + } + /** + * Gets entities (such as images) for a displayed gallery (attached gallery) + */ + public function get_displayed_gallery_entities_action() + { + $response = array(); + if ($this->object->validate_ajax_request('nextgen_edit_displayed_gallery') && ($params = $this->object->param('displayed_gallery'))) { + $limit = $this->object->param('limit'); + $offset = $this->object->param('offset'); + $factory = C_Component_Factory::get_instance(); + $displayed_gallery = $factory->create('displayed_gallery'); + foreach ($params as $key => $value) { + $displayed_gallery->{$key} = $value; + } + $response['limit'] = $limit = $limit ? $limit : 0; + $response['offset'] = $offset = $offset ? $offset : 0; + $response['total'] = $displayed_gallery->get_entity_count('both'); + $response['items'] = $displayed_gallery->get_entities($limit, $offset, FALSE, 'both'); + $controller = C_Display_Type_Controller::get_instance(); + $storage = C_Gallery_Storage::get_instance(); + $image_mapper = C_Image_Mapper::get_instance(); + $settings = C_NextGen_Settings::get_instance(); + foreach ($response['items'] as &$entity) { + $image = $entity; + if (in_array($displayed_gallery->source, array('album', 'albums'))) { + // Set the alttext of the preview image to the + // name of the gallery or album + if ($image = $image_mapper->find($entity->previewpic)) { + if ($entity->is_album) { + $image->alttext = sprintf(__('Album: %s', 'nggallery'), $entity->name); + } else { + $image->alttext = sprintf(__('Gallery: %s', 'nggallery'), $entity->title); + } + } + // Prefix the id of an album with 'a' + if ($entity->is_album) { + $id = $entity->{$entity->id_field}; + $entity->{$entity->id_field} = 'a' . $id; + } + } + // Get the thumbnail + $entity->thumb_url = $storage->get_image_url($image, 'thumb', TRUE); + $entity->thumb_html = $storage->get_image_html($image, 'thumb'); + $entity->max_width = $settings->thumbwidth; + $entity->max_height = $settings->thumbheight; + } + } else { + $response['error'] = __('Missing parameters', 'nggallery'); + } + return $response; + } + /** + * Saves the displayed gallery + */ + public function save_displayed_gallery_action() + { + $response = array(); + $mapper = C_Displayed_Gallery_Mapper::get_instance(); + // Do we have fields to work with? + if ($this->object->validate_ajax_request('nextgen_edit_displayed_gallery', true) && ($params = json_decode($this->object->param('displayed_gallery')))) { + // Existing displayed gallery ? + if ($id = $this->object->param('id')) { + $displayed_gallery = $mapper->find($id, TRUE); + if ($displayed_gallery) { + foreach ($params as $key => $value) { + $displayed_gallery->{$key} = $value; + } + } + } else { + $factory = C_Component_Factory::get_instance(); + $displayed_gallery = $factory->create('displayed_gallery', $params, $mapper); + } + // Save the changes + if ($displayed_gallery) { + if ($displayed_gallery->save()) { + $response['displayed_gallery'] = $displayed_gallery->get_entity(); + } else { + $response['validation_errors'] = $this->get_attach_to_post()->show_errors_for($displayed_gallery, TRUE); + } + } else { + $response['error'] = __('Displayed gallery does not exist', 'nggallery'); + } + } else { + $response['error'] = __('Invalid request', 'nggallery'); + } + return $response; + } +} +class A_Gallery_Storage_Frame_Event extends Mixin +{ + public function generate_thumbnail($image, $params = null, $skip_defaults = false) + { + $retval = $this->call_parent('generate_thumbnail', $image, $params, $skip_defaults); + if (is_admin() && ($image = C_Image_Mapper::get_instance()->find($image))) { + $controller = C_Display_Type_Controller::get_instance(); + $storage = C_Gallery_Storage::get_instance(); + $app = C_Router::get_instance()->get_routed_app(); + $image->thumb_url = $controller->set_param_for($app->get_routed_url(TRUE), 'timestamp', time(), NULL, $storage->get_thumb_url($image)); + $event = new stdClass(); + $event->pid = $image->{$image->id_field}; + $event->id_field = $image->id_field; + $event->thumb_url = $image->thumb_url; + C_Frame_Event_Publisher::get_instance()->add_event(array('event' => 'thumbnail_modified', 'image' => $event)); + } + return $retval; + } +} +class C_Attach_Controller extends C_NextGen_Admin_Page_Controller +{ + static $_instances = array(); + public $_displayed_gallery; + public $_marked_scripts; + public $_is_rendering; + static function &get_instance($context = 'all') + { + if (!isset(self::$_instances[$context])) { + $klass = get_class(); + self::$_instances[$context] = new $klass($context); + } + return self::$_instances[$context]; + } + public function define($context) + { + if (!is_array($context)) { + $context = array($context); + } + array_unshift($context, 'ngg_attach_to_post'); + parent::define($context); + $this->add_mixin('Mixin_Attach_To_Post'); + $this->add_mixin('Mixin_Attach_To_Post_Display_Tab'); + $this->implement('I_Attach_To_Post_Controller'); + } + public function initialize() + { + parent::initialize(); + $this->_load_displayed_gallery(); + $this->_marked_scripts = array(); + if (did_action('wp_print_scripts')) { + $this->_handle_scripts(); + } else { + add_action('wp_print_scripts', array($this, '_handle_scripts'), 9999); + } + } + public function _handle_scripts() + { + if (is_admin() && $this->_is_rendering) { + global $wp_scripts; + $queue = $wp_scripts->queue; + $marked = $this->_marked_scripts; + foreach ($marked as $tag => $value) { + $this->_handle_script($tag, $queue); + } + foreach ($queue as $extra) { + wp_dequeue_script($extra); + } + } + } + public function _handle_script($tag, &$queue) + { + global $wp_scripts; + $registered = $wp_scripts->registered; + $idx = array_search($tag, $queue); + if ($idx !== false) { + unset($queue[$idx]); + } + if (isset($registered[$tag])) { + $script = $registered[$tag]; + if ($script->deps) { + foreach ($script->deps as $dep) { + $this->_handle_script($dep, $queue); + } + } + } + } +} +class Mixin_Attach_To_Post extends Mixin +{ + public function _load_displayed_gallery() + { + $mapper = C_Displayed_Gallery_Mapper::get_instance(); + if (!($this->object->_displayed_gallery = $mapper->find($this->object->param('id'), TRUE))) { + if (!empty($_REQUEST['id'])) { + $this->object->_displayed_gallery = $mapper->find($_REQUEST['id'], TRUE); + } + if (empty($this->object->_displayed_gallery)) { + $this->object->_displayed_gallery = $mapper->create(); + } + } + } + public function mark_script($script_tag) + { + $this->object->_marked_scripts[$script_tag] = true; + } + public function enqueue_backend_resources() + { + $this->call_parent('enqueue_backend_resources'); + $this->mark_script('jquery-ui-accordion'); + $this->mark_script('nextgen_display_settings_page_placeholder_stub'); + $this->mark_script('iris'); + $this->mark_script('wp-color-picker'); + $this->mark_script('nextgen_admin_page'); + $this->mark_script('select2'); + // Enqueue frame event publishing + wp_enqueue_script('frame_event_publisher'); + $this->object->mark_script('frame_event_publisher'); + // Enqueue JQuery UI libraries + wp_enqueue_script('jquery-ui-tabs'); + wp_enqueue_script('jquery-ui-sortable'); + wp_enqueue_script('jquery-ui-tooltip'); + wp_enqueue_script('ngg_tabs', $this->get_static_url('photocrati-attach_to_post#ngg_tabs.js')); + $this->object->mark_script('jquery-ui-tabs'); + $this->object->mark_script('jquery-ui-sortable'); + $this->object->mark_script('jquery-ui-tooltip'); + $this->object->mark_script('ngg_tabs'); + // Ensure select2 + wp_enqueue_style('select2'); + wp_enqueue_script('select2'); + $this->object->mark_script('select2'); + // Ensure that the Photocrati AJAX library is loaded + wp_enqueue_script('photocrati_ajax'); + $this->object->mark_script('photocrati_ajax'); + // Enqueue logic for the Attach to Post interface as a whole + wp_enqueue_script('ngg_attach_to_post', $this->get_static_url('photocrati-attach_to_post#attach_to_post.js')); + wp_enqueue_style('ngg_attach_to_post', $this->get_static_url('photocrati-attach_to_post#attach_to_post.css')); + $this->object->mark_script('ngg_attach_to_post'); + // Enqueue backbone.js library, required by the Attach to Post display tab + wp_enqueue_script('backbone'); + // provided by WP + $this->object->mark_script('backbone'); + // Ensure underscore sting, a helper utility + wp_enqueue_script('underscore.string', $this->get_static_url('photocrati-attach_to_post#underscore.string.js'), array('underscore'), '2.3.0'); + $this->object->mark_script('underscore.string'); + // Enqueue the backbone app for the display tab + $settings = C_NextGen_Settings::get_instance(); + $preview_url = $settings->gallery_preview_url; + $display_tab_js_url = $settings->attach_to_post_display_tab_js_url; + if ($this->object->_displayed_gallery->id()) { + $display_tab_js_url .= '&id=' . $this->object->_displayed_gallery->id(); + } + wp_enqueue_script('ngg_display_tab', $display_tab_js_url, array('backbone', 'underscore.string', 'photocrati_ajax')); + wp_localize_script('ngg_display_tab', 'ngg_displayed_gallery_preview_url', $settings->gallery_preview_url); + $this->object->mark_script('ngg_display_tab'); + // TODO: for now mark Pro scripts to ensure they are enqueued properly, remove this after Pro upgrade with tagging added + $display_types = array('photocrati-nextgen_pro_slideshow', 'photocrati-nextgen_pro_horizontal_filmstrip', 'photocrati-nextgen_pro_thumbnail_grid', 'photocrati-nextgen_pro_blog_gallery', 'photocrati-nextgen_pro_film'); + foreach ($display_types as $display_type) { + $this->object->mark_script($display_type . '-js'); + } + $this->object->mark_script('nextgen_pro_albums_settings_script'); + } + /** + * Renders the interface + */ + public function index_action($return = FALSE) + { + $this->object->enqueue_backend_resources(); + $this->object->do_not_cache(); + // Enqueue resources + return $this->object->render_view('photocrati-attach_to_post#attach_to_post', array('page_title' => $this->object->_get_page_title(), 'tabs' => $this->object->_get_main_tabs()), $return); + } + /** + * Displays a preview image for the displayed gallery + */ + public function preview_action() + { + $found_preview_pic = FALSE; + $dyn_thumbs = C_Dynamic_Thumbnails_Manager::get_instance(); + $storage = C_Gallery_Storage::get_instance(); + $image_mapper = C_Image_Mapper::get_instance(); + // Get the first entity from the displayed gallery. We will use this + // for a preview pic + $entity = array_pop($this->object->_displayed_gallery->get_included_entities(1)); + $image = FALSE; + if ($entity) { + // This is an album or gallery + if (isset($entity->previewpic)) { + $image = (int) $entity->previewpic; + if ($image = $image_mapper->find($image)) { + $found_preview_pic = TRUE; + } + } else { + if (isset($entity->galleryid)) { + $image = $entity; + $found_preview_pic = TRUE; + } + } + } + // Were we able to find a preview pic? If so, then render it + $image_size = $dyn_thumbs->get_size_name(array('width' => 200, 'height' => 200, 'quality' => 90, 'type' => 'jpg')); + $found_preview_pic = $storage->render_image($image, $image_size, TRUE); + // Render invalid image if no preview pic is found + if (!$found_preview_pic) { + $filename = $this->object->get_static_abspath('photocrati-attach_to_post#invalid_image.png'); + $this->set_content_type('image/png'); + readfile($filename); + $this->render(); + } + } + /** + * Returns the page title of the Attach to Post interface + * @return string + */ + public function _get_page_title() + { + return __('NextGEN Gallery - Attach To Post', 'nggallery'); + } + /** + * Returns the main tabs displayed on the Attach to Post interface + * @returns array + */ + public function _get_main_tabs() + { + $retval = array(); + $security = $this->get_registry()->get_utility('I_Security_Manager'); + $sec_actor = $security->get_current_actor(); + if ($sec_actor->is_allowed('NextGEN Manage gallery')) { + $retval['displayed_tab'] = array('content' => $this->object->_render_display_tab(), 'title' => __('Display Galleries', 'nggallery')); + } + if ($sec_actor->is_allowed('NextGEN Upload images')) { + $retval['create_tab'] = array('content' => $this->object->_render_create_tab(), 'title' => __('Add Gallery / Images', 'nggallery')); + } + if ($sec_actor->is_allowed('NextGEN Manage others gallery') && $sec_actor->is_allowed('NextGEN Manage gallery')) { + $retval['galleries_tab'] = array('content' => $this->object->_render_galleries_tab(), 'title' => __('Manage Galleries', 'nggallery')); + } + if ($sec_actor->is_allowed('NextGEN Edit album')) { + $retval['albums_tab'] = array('content' => $this->object->_render_albums_tab(), 'title' => __('Manage Albums', 'nggallery')); + } + if ($sec_actor->is_allowed('NextGEN Manage tags')) { + $retval['tags_tab'] = array('content' => $this->object->_render_tags_tab(), 'title' => __('Manage Tags', 'nggallery')); + } + return $retval; + } + /** + * Renders a NextGen Gallery page in an iframe, suited for the attach to post + * interface + * @param string $page + * @return string + */ + public function _render_ngg_page_in_frame($page, $tab_id = null) + { + $frame_url = admin_url("/admin.php?page={$page}&attach_to_post"); + $frame_url = nextgen_esc_url($frame_url); + if ($tab_id) { + $tab_id = " id='ngg-iframe-{$tab_id}'"; + } + return "<iframe name='{$page}' frameBorder='0'{$tab_id} class='ngg-attach-to-post ngg-iframe-page-{$page}' scrolling='no' src='{$frame_url}'></iframe>"; + } + /** + * Renders the display tab for adjusting how images/galleries will be + * displayed + * @return type + */ + public function _render_display_tab() + { + return $this->object->render_partial('photocrati-attach_to_post#display_tab', array('messages' => array(), 'tabs' => $this->object->_get_display_tabs()), TRUE); + } + /** + * Renders the tab used primarily for Gallery and Image creation + * @return type + */ + public function _render_create_tab() + { + return $this->object->_render_ngg_page_in_frame('ngg_addgallery', 'create_tab'); + } + /** + * Renders the tab used for Managing Galleries + * @return string + */ + public function _render_galleries_tab() + { + return $this->object->_render_ngg_page_in_frame('nggallery-manage-gallery', 'galleries_tab'); + } + /** + * Renders the tab used for Managing Albums + */ + public function _render_albums_tab() + { + return $this->object->_render_ngg_page_in_frame('nggallery-manage-album', 'albums_tab'); + } + /** + * Renders the tab used for Managing Albums + * @return string + */ + public function _render_tags_tab() + { + return $this->object->_render_ngg_page_in_frame('nggallery-tags', 'tags_tab'); + } +} +/** + * Provides the "Display Tab" for the Attach To Post interface/controller + */ +class Mixin_Attach_To_Post_Display_Tab extends Mixin +{ + /** + * Renders the JS required for the Backbone-based Display Tab + */ + public function display_tab_js_action($return = FALSE) + { + // Cache appropriately + $this->object->do_not_cache(); + // Ensure that JS is returned + $this->object->set_content_type('javascript'); + $buffer_limit = 0; + $zlib = ini_get('zlib.output_compression'); + if (!is_numeric($zlib) && $zlib == 'On') { + $buffer_limit = 1; + } else { + if (is_numeric($zlib) && $zlib > 0) { + $buffer_limit = 1; + } + } + while (ob_get_level() != $buffer_limit) { + ob_end_clean(); + } + // Get all entities used by the display tab + $context = 'attach_to_post'; + $gallery_mapper = $this->get_registry()->get_utility('I_Gallery_Mapper', $context); + $album_mapper = $this->get_registry()->get_utility('I_Album_Mapper', $context); + $image_mapper = $this->get_registry()->get_utility('I_Image_Mapper', $context); + $display_type_mapper = $this->get_registry()->get_utility('I_Display_Type_Mapper', $context); + $sources = C_Displayed_Gallery_Source_Manager::get_instance(); + $security = $this->get_registry()->get_utility('I_Security_Manager'); + // Get the nextgen tags + global $wpdb; + $tags = $wpdb->get_results("SELECT DISTINCT name AS 'id', name FROM {$wpdb->terms}\n WHERE term_id IN (\n SELECT term_id FROM {$wpdb->term_taxonomy}\n WHERE taxonomy = 'ngg_tag'\n )"); + $all_tags = new stdClass(); + $all_tags->name = 'All'; + $all_tags->id = 'All'; + array_unshift($tags, $all_tags); + $display_types = array(); + foreach ($display_type_mapper->find_all() as $display_type) { + if (isset($display_type->hidden_from_ui) && $display_type->hidden_from_ui) { + continue; + } + $display_types[] = $display_type; + } + usort($display_types, array($this->object, '_display_type_list_sort')); + $output = $this->object->render_view('photocrati-attach_to_post#display_tab_js', array('displayed_gallery' => json_encode($this->object->_displayed_gallery->get_entity()), 'sources' => json_encode($sources->get_all()), 'gallery_primary_key' => $gallery_mapper->get_primary_key_column(), 'galleries' => json_encode($gallery_mapper->find_all()), 'albums' => json_encode($album_mapper->find_all()), 'tags' => json_encode($tags), 'display_types' => json_encode($display_types), 'sec_token' => $security->get_request_token('nextgen_edit_displayed_gallery')->get_json(), 'image_primary_key' => $image_mapper->get_primary_key_column()), $return); + return $output; + } + public function _display_type_list_sort($type_1, $type_2) + { + $order_1 = $type_1->view_order; + $order_2 = $type_2->view_order; + if ($order_1 == null) { + $order_1 = NGG_DISPLAY_PRIORITY_BASE; + } + if ($order_2 == null) { + $order_2 = NGG_DISPLAY_PRIORITY_BASE; + } + if ($order_1 > $order_2) { + return 1; + } + if ($order_1 < $order_2) { + return -1; + } + return 0; + } + /** + * Gets a list of tabs to render for the "Display" tab + */ + public function _get_display_tabs() + { + // The ATP requires more memmory than some applications, somewhere around 60MB. + // Because it's such an important feature of NextGEN Gallery, we temporarily disable + // any memory limits + if (!extension_loaded('suhosin')) { + @ini_set('memory_limit', -1); + } + return array($this->object->_render_display_types_tab(), $this->object->_render_display_source_tab(), $this->object->_render_display_settings_tab(), $this->object->_render_preview_tab()); + } + /** + * Renders the accordion tab, "What would you like to display?" + */ + public function _render_display_source_tab() + { + return $this->object->render_partial('photocrati-attach_to_post#accordion_tab', array('id' => 'source_tab', 'title' => __('What would you like to display?', 'nggallery'), 'content' => $this->object->_render_display_source_tab_contents()), TRUE); + } + /** + * Renders the contents of the source tab + * @return string + */ + public function _render_display_source_tab_contents() + { + return $this->object->render_partial('photocrati-attach_to_post#display_tab_source', array(), TRUE); + } + /** + * Renders the accordion tab for selecting a display type + * @return string + */ + public function _render_display_types_tab() + { + return $this->object->render_partial('photocrati-attach_to_post#accordion_tab', array('id' => 'display_type_tab', 'title' => __('Select a display type', 'nggallery'), 'content' => $this->object->_render_display_type_tab_contents()), TRUE); + } + /** + * Renders the contents of the display type tab + */ + public function _render_display_type_tab_contents() + { + return $this->object->render_partial('photocrati-attach_to_post#display_tab_type', array(), TRUE); + } + /** + * Renders the display settings tab for the Attach to Post interface + * @return type + */ + public function _render_display_settings_tab() + { + return $this->object->render_partial('photocrati-attach_to_post#accordion_tab', array('id' => 'display_settings_tab', 'title' => __('Customize the display settings', 'nggallery'), 'content' => $this->object->_render_display_settings_contents()), TRUE); + } + /** + * If editing an existing displayed gallery, retrieves the name + * of the display type + * @return string + */ + public function _get_selected_display_type_name() + { + $retval = ''; + if ($this->object->_displayed_gallery) { + $retval = $this->object->_displayed_gallery->display_type; + } + return $retval; + } + /** + * Is the displayed gallery that's being edited using the specified display + * type? + * @param string $name name of the display type + * @return bool + */ + public function is_displayed_gallery_using_display_type($name) + { + $retval = FALSE; + if ($this->object->_displayed_gallery) { + $retval = $this->object->_displayed_gallery->display_type == $name; + } + return $retval; + } + /** + * Renders the contents of the display settings tab + * @return string + */ + public function _render_display_settings_contents() + { + $retval = array(); + // Get all display setting forms + $form_manager = C_Form_Manager::get_instance(); + $forms = $form_manager->get_forms(NGG_DISPLAY_SETTINGS_SLUG, TRUE); + // Display each form + foreach ($forms as $form) { + // Enqueue the form's static resources + $form->enqueue_static_resources(); + // Determine which classes to use for the form's "class" attribute + $model = $form->get_model(); + $current = $this->object->is_displayed_gallery_using_display_type($model->name); + $css_class = $current ? 'display_settings_form' : 'display_settings_form hidden'; + // If this form is used to provide the display settings for the current + // displayed gallery, then we need to override the forms settings + // with the displayed gallery settings + if ($current) { + $settings = $this->array_merge_assoc($model->settings, $this->object->_displayed_gallery->display_settings, TRUE); + $model->settings = $settings; + } + // Output the display settings form + $retval[] = $this->object->render_partial('photocrati-attach_to_post#display_settings_form', array('settings' => $form->render(), 'display_type_name' => $model->name, 'css_class' => $css_class), TRUE); + } + // In addition, we'll render a form that will be displayed when no + // display type has been selected in the Attach to Post interface + // Render the default "no display type selected" view + $css_class = $this->object->_get_selected_display_type_name() ? 'display_settings_form hidden' : 'display_settings_form'; + $retval[] = $this->object->render_partial('photocrati-attach_to_post#no_display_type_selected', array('no_display_type_selected' => __('No display type selected', 'nggallery'), 'css_class' => $css_class), TRUE); + // Return all display setting forms + return implode(' +', $retval); + } + /** + * Renders the tab used to preview included images + * @return string + */ + public function _render_preview_tab() + { + return $this->object->render_partial('photocrati-attach_to_post#accordion_tab', array('id' => 'preview_tab', 'title' => __('Sort or Exclude Images', 'nggallery'), 'content' => $this->object->_render_preview_tab_contents()), TRUE); + } + /** + * Renders the contents of the "Preview" tab. + * @return string + */ + public function _render_preview_tab_contents() + { + return $this->object->render_partial('photocrati-attach_to_post#preview_tab', array(), TRUE); + } +} \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/static/attach_to_post.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/static/attach_to_post.css index ed61fc02b222025b43dc8a4852b432811d3eee43..9dc74e6f0cbf1930d8885682486a5632d37e343f 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/static/attach_to_post.css +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/static/attach_to_post.css @@ -12,6 +12,7 @@ body { -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; filter: alpha(opacity=0); opacity: 0.0; + height: 100%; } .entity_errors { @@ -33,6 +34,11 @@ body { border: 0px; background: none; min-height: 100%; + overflow: hidden; +} + +#attach_to_post_tabs div.main_menu_tab { + overflow: hidden; } .ui-tabs-panel { diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/static/attach_to_post.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/static/attach_to_post.js index d047b8f17dc9512b34c7194c546a2068d7154167..10db0e0d09d18b3a0120c3578cbe114e88b7c423 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/static/attach_to_post.js +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/static/attach_to_post.js @@ -1,3 +1,6 @@ +// Give this window an ID +this.id = 'ngg-attach_to_post'; + // Provides a function to close the TinyMCE popup window function close_attach_to_post_window() { diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/static/attach_to_post.min.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/static/attach_to_post.min.css new file mode 100644 index 0000000000000000000000000000000000000000..57597ea332e0404a9a2a0f4e92fca56ccf3c6671 --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/static/attach_to_post.min.css @@ -0,0 +1 @@ +html,body{width:100%;min-height:100%;padding:0;margin:0;font-size:13px}body{position:absolute;visibility:hidden;-ms-filter:"alpha(opacity=0)";filter:alpha(opacity=0);opacity:0;height:100%}.entity_errors{color:red}.entity_errors ul{margin-left:30px}.entity_errors ul li{list-style-type:disc}.ui-helper-reset{font-size:13px}#attach_to_post_tabs{border:0;background:none;min-height:100%;overflow:hidden}#attach_to_post_tabs div.main_menu_tab{overflow:hidden}.ui-tabs-panel{min-height:100%}.ui-widget-header{border:0;border-bottom:1px solid #dfdfdf;background:none}iframe{width:100%;min-height:100%;border:0;padding:0;margin:0;background:transparent}#displayed_gallery_source{width:400px}#source_configuration td{vertical-align:top}#source_configuration .chzn-choices input[type=text]{height:auto !important}#slug_configuration #slug_label{width:52px}#slug_configuration #slug_column input[type=text]{width:498px}.display_type_preview{float:left;width:25%}.display_type_preview .image_container{width:100%;vertical-align:middle;text-align:center;font-size:12px;font-weight:600}.display_type_preview .image_container p{display:inline-block}#preview_tab_content .previewed_entity{width:100%;border-bottom:solid 1px #e0e0d6;background-color:#fafaf0}#preview_tab_content .previewed_entity .container{padding-top:15px}#preview_tab_content .previewed_entity.header{background-color:#f0f0e6;padding-bottom:5px;padding-top:5px}#preview_tab_content .header label{font-size:12px;color:#649664;font-weight:600}#preview_tab_content .ui-sortable-helper{background:none}#preview_tab_content ul{list-style-type:none;display:block;border:solid 2px #e0e0d6;padding:0;position:relative}#preview_tab_content .inclusion_checkbox{margin-right:7px;display:block;float:left}#preview_tab_content .image_container{background-color:white;background-repeat:no-repeat;background-position:center center;padding:19px;margin:7px;border:solid 1px black;display:block;vertical-align:middle;text-align:center;position:relative}#preview_tab_content .image_container img{border:0}#preview_tab_content #entity_list li{float:left}#preview_tab_content #entity_list .ui-state-default{background:none;border:0}#preview_tab_content .placeholder{background-color:#e0ddc1;position:relative}#preview_tab_content #entity_list .exclude_container{display:block;text-align:center;margin:0 auto;color:black;font-weight:normal;position:absolute;bottom:2px;left:0;width:100%}#preview_tab_content .header_row{margin-bottom:5px}#preview_tab_content .header_row strong{width:70px;display:inline-block}#preview_tab_content .header_row .separator{display:inline-block;margin:0 5px}#preview_tab_content .header_row .selected{font-weight:bold}#preview_tab_content #entity_list li.clear{float:none;clear:both}.clear{clear:both;float:none}table{font-size:13px}#display_settings_form table tr td:first-child{vertical-align:top;text-align:right;padding-right:7px;width:180px}#display_settings_form table td{text-align:left}#display_settings_form table textarea{height:60px}#display_settings_form textarea,#display_settings_form input[type=text],#display_settings_form input[type=number],#display_settings_form select{width:157px}#display_settings_form .ngg_slideshow_gallery_width,#display_settings_form .ngg_slideshow_gallery_height,#display_settings_form .ngg_thumbnail_dimension_width,#display_settings_form .ngg_thumbnail_dimension_height{width:65px !important}#display_settings_form .nextgen_settings_colorpicker{width:85px !important;text-align:center}.ui-tabs{visibility:visible;position:relative}.ui-tabs .ui-tabs-hide{display:block !important;visibility:hidden;position:absolute;top:-5000px}.ui-tabs .main_menu_tab{overflow:visible}.ui-tabs .ui-tabs-nav li.ui-tabs-active a,.ui-tabs .ui-tabs-nav li.ui-state-disabled a,.ui-tabs .ui-tabs-nav li.ui-tabs-loading a{cursor:pointer}.select2-result-label{white-space:nowrap}.select2-results{font-family:'segoe ui',Arial,sans-serif;font-size:13px}.refresh_button{float:right} \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/static/attach_to_post.min.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/static/attach_to_post.min.js new file mode 100644 index 0000000000000000000000000000000000000000..cbe7d70eb622af580cc8641baa0f7400d5618287 --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/static/attach_to_post.min.js @@ -0,0 +1 @@ +eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('v.h=\'n-R\';b x(){j.Z.W.V.X(i)}b U(q,l,s){4 $5=c(l.T);4 7=$5.A().8()/3;4 u=$5.A().F(\'#S\').8();4 t=c(q.p).8();4 P=$5.8();2(7<u)7=u;2(7<t)7=t;2(P<7){$5.8(7);4 9=$5.g(\'h\');2(9&&9.O(\'n-6-\')==0){4 f=9.y(11);2(f){c(\'#\'+f).8(7)}}}2(s!=D)k s(q,l,7);I k C}b Y(5){4 $5=c(5);4 9=$5.g(\'h\');4 d={};2(9&&9.O(\'n-6-\')==0){4 f=9.y(11);2(f){4 m=c(p);d.w=m.w()-z;2(i.j){4 E=c(i.j.p);d.B=E.F(\'.10\').8()-z}I{d.B=m.8()}2(Q(i.K)!=\'D\'){K.1j(d)}}}k d}c(b($){$(\'#1q\').1r();$(\'.o 1p\').1o(\'G\',b(e){2($(v).g(\'h\')==\'1l\'){$(\'#12\').1m(\'1n\')}});$(\'.o\').o({1t:C,1s:1y,1x:\'1w\'});$(\'.L-1u-1v a\').G(b(e){4 r=e.M?e.M:e.1k;2($(r).j().18(\'L-19-17\')){4 6=$(r.16+\' 6\');2(6.13>0){2(6[0].N.J!=6.g(\'H\')){6[0].N.J=6.g(\'H\')}}}});$(v).14(b(e){2(e.15==1a)x();k});$(\'1b\').1h({1i:\'1g\',1f:\'1c\'}).1d({1e:1.0})});',62,97,'||if||var|frame|iframe|new_height|height|frame_id||function|jQuery|measures||tab_id|attr|id|window|parent|return|current_window|jDoc|ngg|accordion|document|parent_window|element|callback|parent_height|new_height_body|this|scrollTop|close_attach_to_post_window|substr|40|contents|scrollHeight|true|undefined|jparDoc|find|click|src|else|location|console|ui|target|contentDocument|indexOf|current_height|typeof|attach_to_post|wpbody|frameElement|adjust_height_for_frame|windowManager|activeEditor|close|ngg_get_measures_for_frame|tinyMCE|ngg_attach_to_post_window||preview_area|length|keydown|keyCode|hash|active|hasClass|state|27|body|visible|animate|opacity|visibility|static|css|position|log|srcElement|preview_tab|trigger|opened|bind|h3|attach_to_post_tabs|ngg_tabs|autoHeight|clearStyle|tabs|nav|content|heightStyle|false'.split('|'),0,{})) diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/static/attach_to_post_dialog.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/static/attach_to_post_dialog.css index 991c35baa816d49ce743eefe27d89ce57a94668a..5053082cc188fa84c5b3a6006bf31f10be7fe1ef 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/static/attach_to_post_dialog.css +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/static/attach_to_post_dialog.css @@ -54,3 +54,10 @@ right: 30px !important; } +#ngg_attach_to_post_dialog-body { + -webkit-border-radius: 0px; + -moz-border-radius: 0px; + border-radius: 0px; + background: rgba(255, 255, 255, 0.6); + border-top: none; +} diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/static/attach_to_post_dialog.min.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/static/attach_to_post_dialog.min.css new file mode 100644 index 0000000000000000000000000000000000000000..381d62ec54f8c7796060e381d8f545b47659d47f --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/static/attach_to_post_dialog.min.css @@ -0,0 +1 @@ +#ngg_attach_to_post_dialog-title{display:none}#ngg_attach_to_post_dialog-head{min-height:0;height:0}#ngg_attach_to_post_dialog-head .mce-close{position:absolute;top:6px !important;right:20px !important;z-index:2}.ngg_attach_to_post_window{position:relative;border:0 !important}.ngg_attach_to_post_window .mceResize,.ngg_attach_to_post_window .mceTop,.ngg_attach_to_post_window .mceBottom,.ngg_attach_to_post_window .mceLeft,.ngg_attach_to_post_window .mceRight,.ngg_attach_to_post_window .mceCenter{background:transparent !important;border:0 !important}.ngg_attach_to_post_window .mceMiddle span{padding-top:6px !important}.ngg_attach_to_post_window .mceTop{display:block !important;height:0 !important;font-size:0 !important}.ngg_attach_to_post_window .mceClose{background:url('uploader-icons.png') !important;display:block !important;margin:0 !important;padding:0 !important;width:15px !important;height:15px !important;background-position:-100px 0 !important;position:absolute !important;top:44px !important;right:30px !important}#ngg_attach_to_post_dialog-body{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;background:rgba(255,255,255,.6);border-top:0} \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/static/iframely.min.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/static/iframely.min.css new file mode 100644 index 0000000000000000000000000000000000000000..a92894a5fa76c83481cb90c44136de7231c8147f --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/static/iframely.min.css @@ -0,0 +1 @@ +html#iframely{background:white !important}#iframely,#iframely body{padding:0;width:100%;height:100%}#iframely{-ms-filter:"alpha(opacity=0)";filter:alpha(opacity=0);opacity:0;background-position:center center;background-repeat:no-repeat;position:absolute;visibility:hidden}#iframely #wpbody-content{float:none;padding:0}#iframely h2,#iframely #icon-nextgen-gallery{display:none} \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/static/iframely.min.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/static/iframely.min.js new file mode 100644 index 0000000000000000000000000000000000000000..214019bfaa8b424b226d648fc82e18ee9e386a80 --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/static/iframely.min.js @@ -0,0 +1 @@ +eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('5(7.v){E.D(\'d\')[0].A=\'4\';i(b($){$(\'#C\').d($(\'#j\').d($(\'#j-z\').d($(\'#y\'))));$(\'u\').w(b(){$(x).B("<J L=\'M\' F=\'N\' K=\'1\'/>")});c 2=7.2;5(2==k||a(2.6)=="9"){5(7!=k&&a(7.6)!="9"){2=7}}c l=G;5(l){5(a(2.6)!="9"){2.6(2,7,h)}}o{5(a(2.6)!="9"){2.6(2,7,b(){$(\'#4\').p({t:\'s\',q:\'m\'}).r({n:1.0})})}}})}b h(f,8,H){c $8=i(8);5(a($8.e(\'4\'))==\'9\')$8.e(\'4\',{g:1});c 4=$8.e(\'4\');5(4.g==3){i(\'#4\').p({t:\'s\',q:\'m\'}).r({n:1.0})}o{4.g+=1;O(b(){f.6(f,8,h)},I)}}',51,51,'||parent||iframely|if|adjust_height_for_frame|window|current_window|undefined|typeof|function|var|html|data|parent_window|attempts|iframely_callback|jQuery|wpbody|null|recursive_check|visible|opacity|else|css|visibility|animate|static|position|form|frameElement|each|this|ngg_page_content|content|id|append|wpwrap|getElementsByTagName|document|name|true|new_height|400|input|value|type|hidden|attach_to_post|setTimeout'.split('|'),0,{})) diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/static/ngg_attach_to_post_tinymce_plugin.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/static/ngg_attach_to_post_tinymce_plugin.js index e14feab551e580028c48c09b205be673507f4ea2..57105965d697c672334e39d6967f1b1e2a40a449 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/static/ngg_attach_to_post_tinymce_plugin.js +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/static/ngg_attach_to_post_tinymce_plugin.js @@ -1,5 +1,10 @@ // Self-executing function to create and register the TinyMCE plugin (function(siteurl) { + window.id = 'wordpress-post-page'; + + tinyMCE.addI18n('en.ngg_attach_to_post', { + title: 'Attach NextGEN Gallery to Post' + }); // Create the plugin. We'll register it afterwards tinymce.create('tinymce.plugins.NextGEN_AttachToPost', { @@ -33,6 +38,7 @@ editor.windowManager.open = function(one, two) { var modal = editor.windowManager.nggOldOpen(one, two); modal.on('close', self.wm_close_event); + return modal; }; // Register a new TinyMCE command @@ -78,11 +84,13 @@ } }, - wm_close_event: function() { - // Restore scrolling for the main content window when the attach to post interface is closed - jQuery('html,body').css('overflow', 'auto'); - tinyMCE.activeEditor.selection.select(tinyMCE.activeEditor.dom.select('p')[0]); - tinyMCE.activeEditor.selection.collapse(0); + wm_close_event: function(e) { + if (e.target._id == 'ngg_attach_to_post_dialog') { + // Restore scrolling for the main content window when the attach to post interface is closed + jQuery('html,body').css('overflow', 'auto'); + tinyMCE.activeEditor.selection.select(tinyMCE.activeEditor.dom.select('p')[0]); + tinyMCE.activeEditor.selection.collapse(0); + } }, /** @@ -92,7 +100,7 @@ // Determine the attach to post url var attach_to_post_url = nextgen_gallery_attach_to_post_url; if (typeof(id) != 'undefined') { - attach_to_post_url += "?id=" + this.id; + attach_to_post_url += "&id=" + this.id; } var win = window; diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/static/ngg_attach_to_post_tinymce_plugin.min.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/static/ngg_attach_to_post_tinymce_plugin.min.js new file mode 100644 index 0000000000000000000000000000000000000000..021f27252dc74ccd8fc8dcd67888b1a83b4b3ac5 --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/static/ngg_attach_to_post_tinymce_plugin.min.js @@ -0,0 +1 @@ +eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('(7(w){1f.4=\'1o-1w-1q\';n.1m(\'1E.h\',{t:\'1d D H 1z Q\'});b.1v(\'b.v.8\',{w:w,1C:7(){m{1F:\'D H\',1t:\'1G 1k\',1A:\'N://P.1r.J\',1D:\'N://P.1y-1x.J\',1u:\'0.1\'}},1B:7(2,S){3 a=j;2.c.12=2.c.G;2.c.G=7(X,W){3 C=2.c.12(X,W);C.T(\'1l\',a.M);m C};2.1i(\'h\',j.A,{2:2,Z:2.v.8});2.1g(\'8\',{t:\'h.t\',1h:\'h\',1s:S+\'/1n.1p\'});2.V.1N+=",U";2.V.23="U";2.T(\'24\',7(e){6(e.r.25==\'22\'){6(a.13(e.r).21(\'1Y\')>=0){2.14.1Z.27(e);3 4=e.r.26.29(/\\d+$/);6(4)4=4.2a();3 28=b.1H(a,{2:2,Z:2.v.8,4:4});a.A(4)}}})},13:7(l){3 B=l.O(\'K\')?l.O(\'K\'):l.1W;6(B){m B}1M{m""}},M:7(e){6(e.r.1K==\'11\'){9(\'1a,1b\').u(\'s\',\'1c\');n.E.Y.L(n.E.14.L(\'p\')[0]);n.E.Y.1I(0)}},A:7(4){3 F=1J;6(1O(4)!=\'1P\'){F+="&4="+j.4}3 5=1f;1U(5.z!=1V&&5.z!=5){5=5.z}5=9(5);3 k=5.17();3 q=5.R();3 i=1T;3 o=1e;3 15=1S;3 19=1e;3 g=k-(k*0.16);3 f=q-(q*0.16);6(g<15){g=k-10}6(f<19){f=q-10}6(i>g){i=g}6(o>f){o=f}j.2.c.G({1R:F,4:\'11\',17:i,R:o,t:"D H - 1d 1Q Q"});9(\'1a,1b\').u(\'s\',\'I\');9(\'#18\').u(\'s-y\',\'1c\');9(\'#18\').u(\'s-x\',\'I\')}});b.1X.20(\'8\',b.v.8)})(1j.1L);',62,135,'||editor|var|id|win|if|function|NextGEN_AttachToPost|jQuery|self|tinymce|windowManager|||maxHeight|maxWidth|ngg_attach_to_post|popupWidth|this|winWidth|node|return|tinyMCE|popupHeight||winHeight|target|overflow|title|css|plugins|siteurl|||parent|render_attach_to_post_interface|class_name|modal|NextGEN|activeEditor|attach_to_post_url|open|Gallery|hidden|com|class|select|wm_close_event|http|getAttribute|www|Post|height|plugin_url|on|shortcode|settings|two|one|selection|plugin||ngg_attach_to_post_dialog|nggOldOpen|get_class_name|dom|minWidth|05|width|ngg_attach_to_post_dialog_ifr|minHeight|html|body|auto|Attach|600|window|addButton|cmd|addCommand|photocrati_ajax|Media|close|addI18n|atp_button|wordpress|png|page|photocrati|image|author|version|create|post|gallery|nextgen|to|authorurl|init|getInfo|infourl|en|longname|Photocrati|extend|collapse|nextgen_gallery_attach_to_post_url|_id|wp_site_url|else|extended_valid_elements|typeof|undefined|To|url|800|1200|while|null|className|PluginManager|ngg_displayed_gallery|events|add|indexOf|IMG|custom_elements|mouseup|tagName|src|cancel|obj|match|pop'.split('|'),0,{})) diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/static/ngg_attach_to_post_tinymce_plugin_wp38_compat.min.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/static/ngg_attach_to_post_tinymce_plugin_wp38_compat.min.js new file mode 100644 index 0000000000000000000000000000000000000000..984528107c7eeffc4f0831cc54afec836beda196 --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/static/ngg_attach_to_post_tinymce_plugin_wp38_compat.min.js @@ -0,0 +1 @@ +eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('(8(X){o.1K(\'1L.m\',{A:\'1j P Q 1M 1e\'});i.1N(\'i.z.c\',{X:X,1J:8(){L{1I:\'P Q\',1E:\'1F 1G\',1H:\'1s://1t.1O.1u\',1P:\'1s://1t.17-1W.1u\',1X:\'0.1\'}},1Y:8(3,15){3.1V(\'m\',a.U,{3:3,1x:3.z.c});3.1D(\'c\',{A:\'m.A\',1U:\'m\',1R:15+\'/17.1S\'});3.12.1T+=",1r";3.12.1Z="1r";2 g=a;2 l=1y;2 M;3.1B.1w(8(3,e){7(e.j.1o==\'1f\'){7(g.I(e.j).1i(\'1m\')>=0){M=O(8(){l=1n},1A)}}});3.1C.1w(8(3,e){7(!l&&e.j.1o==\'1f\'){7(g.I(e.j).1i(\'1m\')>=0){3.K.11.1z(e);3.K.11.25(e);2 6=e.j.2n.2l(/\\d+$/);7(6)6=6.2i();2 k=i.2j(g,{3:3,1x:3.z.c,6:6});g.U.E(k)}}2o(M);l=1y})},I:8(u){2 F=u.1q(\'16\')?u.1q(\'16\'):u.2v;7(F)L F;W L""},U:8(6){2 S=2w;7(2u(a.6)!=\'20\'){S+="?6="+a.6}a.3.R.2t.N(8(4){2 v=\'#\';7(4.T&&4.T.19)v+=4.T.19;W 7(4.V&&4.V.6)v+=4.V.6;2 b=8(Y,b){2 k=9(Y);7(k.2q==0){O(8(){b.E(C,Y,b)},5)}W{k.2s(\'2h\')}}O(8(){b.E(C,v,b)},5);9(\'18,G\').w(\'B\',\'1a\')});a.3.R.27.N(8(4){9(\'18,G\').w(\'B\',\'1v\');o.H.13.1b(o.H.K.1b(\'p\')[0]);o.H.13.24(0)});2 1c=9(\'<t 21="22:23;"><t 6="1l" 28="-1" 29=""></t></t>\');1c.2e(9(2f.G));2 4=2d;2c(4.D!=C&&4.D!=4){4=4.D}4=9(4);2 r=4.1k();2 s=4.14();2 n=2a;2 q=1p;2 1g=2b;2 1d=1p;2 f=r-(r*0.1h);2 h=s-(s*0.1h);7(f<1g){f=r-10}7(h<1d){h=s-10}7(n>f){n=f}7(q>h){q=h}2 J=a.3.R.2r({2k:S,6:\'1l\',1k:n,14:q,2m:1n,A:"P Q - 1j 26 1e"});9(\'#\'+J.6+\'Z\').w(\'B-y\',\'1v\');9(\'#\'+J.6+\'Z\').w(\'B-x\',\'1a\')}});i.2p.N(\'c\',i.z.c)})(1Q.2g);',62,157,'||var|editor|win||id|if|function|jQuery|this|callback|NextGEN_AttachToPost|||maxWidth|self|maxHeight|tinymce|target|obj|drag_in_progress|ngg_attach_to_post|popupWidth|tinyMCE||popupHeight|winWidth|winHeight|div|node|window_selector|css|||plugins|title|overflow|null|parent|call|class_name|body|activeEditor|get_class_name|popup|dom|return|click_timer|add|setTimeout|NextGEN|Gallery|windowManager|attach_to_post_url|params|render_attach_to_post_interface|features|else|siteurl|selector|_ifr||events|settings|selection|height|plugin_url|class|nextgen|html|mce_window_id|hidden|select|popupDialog|minHeight|Post|IMG|minWidth|05|indexOf|Attach|width|ngg_attach_to_post_dialog|ngg_displayed_gallery|true|tagName|600|getAttribute|shortcode|http|www|com|auto|addToTop|plugin|false|cancel|250|onMouseDown|onMouseUp|addButton|author|Photocrati|Media|authorurl|longname|getInfo|addI18n|en|to|create|photocrati|infourl|photocrati_ajax|image|gif|extended_valid_elements|cmd|addCommand|gallery|version|init|custom_elements|undefined|style|display|none|collapse|stop|To|onClose|tabindex|action|1200|800|while|window|appendTo|document|wp_site_url|ngg_attach_to_post_window|pop|extend|file|match|inline|src|clearTimeout|PluginManager|length|open|addClass|onOpen|typeof|className|nextgen_gallery_attach_to_post_url'.split('|'),0,{})) diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/static/ngg_tabs.min.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/static/ngg_tabs.min.js new file mode 100644 index 0000000000000000000000000000000000000000..dceab8738c2d0476931b15e475bc4d42ca952285 --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/static/ngg_tabs.min.js @@ -0,0 +1 @@ +eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('x(3($){$.1.2=3(f){5.y(f);6 i=0;5.p(\'.m\').A(3(){w(i==0)$.1.2.a(5);v $.1.2.b(5);i++});5.s(\'t\',3(u,9){$.1.2.b($.1.2.7(9.C));$.1.2.a($.1.2.7(9.J))})};$.1.2.b=3(4){4=$(4);h(3(){4.j({k:\'c\',l:\'K\',e:-I,g:\'D\',r:0})},0)};$.1.2.a=3(4){4=$(4);h(3(){4.j({k:\'c\',l:\'H\',e:0,g:\'L\',r:\'E%\'})},0)};$.1.2.7=3(8){6 o=8.B(\'q-n\');6 d=8.G(\'F\').p(\'.m[q-n="\'+o+\'"]\');z d}});',48,48,'|fn|ngg_tabs|function|tab|this|var|get_tab_by_li|list_item|ui|show_tab|hide_tab|block|active_tab|top|options|visibility|setTimeout||css|display|position|main_menu_tab|labelledby|active_id|find|aria|height|bind|tabsactivate|event|else|if|jQuery|tabs|return|each|attr|oldTab|hidden|100|div|parents|static|1000|newTab|absolute|visible'.split('|'),0,{})) diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/static/underscore.string.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/static/underscore.string.js index 965a477b7029e70de0ef30f4325093fd6eb35543..60be8cca8ce16e37c9f80ff1b7082e8452c7002b 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/static/underscore.string.js +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/static/underscore.string.js @@ -476,8 +476,8 @@ }, toSentence: function(array, separator, lastSeparator, serial) { - separator = separator || ', ' - lastSeparator = lastSeparator || ' and ' + separator = separator || ', '; + lastSeparator = lastSeparator || ' and '; var a = array.slice(), lastMember = a.pop(); if (array.length > 2 && serial) lastSeparator = _s.rtrim(separator) + lastSeparator; diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/static/underscore.string.min.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/static/underscore.string.min.js new file mode 100644 index 0000000000000000000000000000000000000000..2254c3b52c56f3f8c1da905652214067c6c64e8c --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/static/underscore.string.min.js @@ -0,0 +1 @@ +eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('!r(1E,y){\'3O 3P\';E 2l=y.1M.1l;E 2d=y.1M.3Q;E 2a=y.1M.3R;E 2e=r(1X){l 1X*1||0};E 1f=r(h,U){p(U<1)l\'\';E 1q=\'\';2f(U>0){p(U&1)1q+=h;U>>=1,h+=h}l 1q};E M=[].M;E 1z=r(K){p(K==v)l\'\\\\s\';L p(K.1X)l K.1X;L l\'[\'+C.2O(K)+\']\'};E 1K={3M:\'<\',3I:\'>\',3J:\'"\',3K:"\'",3L:\'&\'};E 2s={};1g(E 2E 2g 1K){2s[1K[2E]]=2E}E T=(r(){r 1U(2V){l 3T.1M.1L.1j(2V).M(8,-1).1r()}E 2L=1f;E 11=r(){p(!11.1Z.2n(1h[0])){11.1Z[1h[0]]=11.2N(1h[0])}l 11.2T.1j(v,11.1Z[1h[0]],1h)};11.2T=r(12,1i){E 2o=1,2U=12.t,1V=\'\',D,27=[],i,k,B,1b,2z,2u;1g(i=0;i<2U;i++){1V=1U(12[i]);p(1V===\'2p\'){27.14(12[i])}L p(1V===\'1O\'){B=12[i];p(B[2]){D=1i[2o];1g(k=0;k<B[2].t;k++){p(!D.2n(B[2][k])){1w V 1u(T(\'[O.T] 3Z "%s" 3Y 2M 3U\',B[2][k]))}D=D[B[2][k]]}}L p(B[1]){D=1i[B[1]]}L{D=1i[2o++]}p(/[^s]/.2v(B[8])&&(1U(D)!=\'1e\')){1w V 1u(T(\'[O.T] 3W 1e 3H 44 %s\',1U(D)))}2Y(B[8]){P\'b\':D=D.1L(2);Y;P\'c\':D=y.1P(D);Y;P\'d\':D=2K(D,10);Y;P\'e\':D=B[7]?D.2J(B[7]):D.2J();Y;P\'f\':D=B[7]?2I(D).2j(B[7]):2I(D);Y;P\'o\':D=D.1L(8);Y;P\'s\':D=((D=y(D))&&B[7]?D.2t(0,B[7]):D);Y;P\'u\':D=23.3r(D);Y;P\'x\':D=D.1L(16);Y;P\'X\':D=D.1L(16).1k();Y}D=(/[3q]/.2v(B[8])&&B[3]&&D>=0?\'+\'+D:D);2z=B[4]?B[4]==\'0\'?\'0\':B[4].1y(1):\' \';2u=B[6]-y(D).t;1b=B[6]?2L(2z,2u):\'\';27.14(B[5]?D+1b:1b+D)}}l 27.1c(\'\')};11.1Z={};11.2N=r(1R){E 1m=1R,B=[],12=[],24=0;2f(1m){p((B=/^[^\\2C]+/.1p(1m))!==v){12.14(B[0])}L p((B=/^\\2C{2}/.1p(1m))!==v){12.14(\'%\')}L p((B=/^\\2C(?:([1-9]\\d*)\\$|\\(([^\\)]+)\\))?(\\+)?(0|\'[^$])?(-)?(\\d+)?(?:\\.(\\d+))?([b-3n])/.1p(1m))!==v){p(B[2]){24|=1;E 1G=[],1s=B[2],18=[];p((18=/^([a-21][a-21\\d]*)/i.1p(1s))!==v){1G.14(18[1]);2f((1s=1s.2t(18[0].t))!==\'\'){p((18=/^\\.([a-21][a-21\\d]*)/i.1p(1s))!==v){1G.14(18[1])}L p((18=/^\\[(\\d+)\\]/.1p(1s))!==v){1G.14(18[1])}L{1w V 1u(\'[O.T] 2q?\')}}}L{1w V 1u(\'[O.T] 2q?\')}B[2]=1G}L{24|=2}p(24===3){1w V 1u(\'[O.T] 45 3D 35 3E 3F 3B 2M (3w) 3x\')}12.14(B)}L{1w V 1u(\'[O.T] 2q?\')}1m=1m.2t(B[0].t)}l 12};l 11})();E C={4v:\'2.3.0\',2F:r(h){p(h==v)h=\'\';l(/^\\s*$/).2v(h)},4q:r(h){p(h==v)l\'\';l y(h).J(/<\\/?[^>]+>/g,\'\')},2Q:r(h){h=h==v?\'\':y(h);l h.1y(0).1k()+h.M(1)},4r:r(h,1J){p(h==v)l[];h=y(h);1J=~~1J;l 1J>0?h.B(V 1A(\'.{1,\'+1J+\'}\',\'g\')):[h]},4A:r(h){l C.3f(h).J(/\\s+/g,\' \')},4z:r(h,1n){p(h==v||1n==v)l 0;l y(h).1H(1n).t-1},2k:r(h){p(h==v)l[];l y(h).1H(\'\')},4B:r(h){p(h==v)l\'\';l y(h).J(/\\S/g,r(c){l c===c.1k()?c.1r():c.1k()})},4C:r(h){p(h==v)l\'\';l y(h).J(/[&<>"\']/g,r(m){l\'&\'+2s[m]+\';\'})},4p:r(h){p(h==v)l\'\';l y(h).J(/\\&([^;]+);/g,r(2H,1D){E B;p(1D 2g 1K){l 1K[1D]}L p(B=1D.B(/^#x([\\4l-4m-F]+)$/)){l y.1P(2K(B[1],16))}L p(B=1D.B(/^#(\\d+)$/)){l y.1P(~~B[1])}L{l 2H}})},2O:r(h){p(h==v)l\'\';l y(h).J(/([.*+?^=!:${}()|[\\]\\/\\\\])/g,\'\\\\$1\')},2A:r(h,i,2P,1n){E 2y=C.2k(h);2y.2A(~~i,~~2P,1n);l 2y.1c(\'\')},4j:r(h,i,1n){l C.2A(h,i,0,1n)},29:r(h,2B){p(2B===\'\')l 1Y;p(h==v)l 28;l y(h).26(2B)!==-1},1c:r(){E 1t=M.1j(1h),Q=1t.48();p(Q==v)Q=\'\';l 1t.1c(Q)},47:r(h){p(h==v)l[];l y(h).1H("\\n")},2m:r(h){l C.2k(h).2m().1c(\'\')},4a:r(h,1d){p(1d===\'\')l 1Y;p(h==v||1d==v)l 28;h=y(h);1d=y(1d);l h.t>=1d.t&&h.M(0,1d.t)===1d},4c:r(h,19){p(19===\'\')l 1Y;p(h==v||19==v)l 28;h=y(h);19=y(19);l h.t>=19.t&&h.M(h.t-19.t)===19},4o:r(h){p(h==v)l\'\';h=y(h);l h.M(0,-1)+y.1P(h.4t(h.t-1)+1)},2S:r(h){p(h==v)l\'\';l y(h).J(/(?:^|\\s)\\S/g,r(c){l c.1k()})},4D:r(h){l C.1l(h).J(/[-O\\s]+(.)?/g,r(B,c){l c.1k()})},2R:r(h){l C.1l(h).J(/([a-z\\d])([A-Z]+)/g,\'$4F$2\').J(/[-\\s]+/g,\'O\').1r()},36:r(h){l C.1l(h).J(/([A-Z])/g,\'-$1\').J(/[-O\\s]+/g,\'-\').1r()},3v:r(h){l C.2S(y(h).J(/O/g,\' \')).J(/\\s/g,\'\')},4b:r(h){l C.2Q(C.2R(h).J(/4h$/,\'\').J(/O/g,\' \'))},1l:r(h,K){p(h==v)l\'\';p(!K&&2l)l 2l.1j(h);K=1z(K);l y(h).J(V 1A(\'\\^\'+K+\'+|\'+K+\'+$\',\'g\'),\'\')},3g:r(h,K){p(h==v)l\'\';p(!K&&2a)l 2a.1j(h);K=1z(K);l y(h).J(V 1A(\'^\'+K+\'+\'),\'\')},1N:r(h,K){p(h==v)l\'\';p(!K&&2d)l 2d.1j(h);K=1z(K);l y(h).J(V 1A(K+\'+$\'),\'\')},3y:r(h,t,1Q){p(h==v)l\'\';h=y(h);1Q=1Q||\'...\';t=~~t;l h.t>t?h.M(0,t)+1Q:h},3G:r(h,t,1o){p(h==v)l\'\';h=y(h);t=~~t;1o=1o!=v?y(1o):\'...\';p(h.t<=t)l h;E 2G=r(c){l c.1k()!==c.1r()?\'A\':\' \'},13=h.M(0,t+1).J(/.(?=\\W*\\w*$)/g,2G);p(13.M(13.t-2).B(/\\w\\w/))13=13.J(/\\s*\\S+$/,\'\');L 13=C.1N(13.M(0,13.t-1));l(13+1o).t>h.t?h:h.M(0,13.t)+1o},41:r(h,2D){p(C.2F(h))l[];l C.1l(h,2D).1H(2D||/\\s+/)},1b:r(h,t,N,2W){h=h==v?\'\':y(h);t=~~t;E 1a=0;p(!N)N=\' \';L p(N.t>1)N=N.1y(0);2Y(2W){P\'3l\':1a=t-h.t;l h+1f(N,1a);P\'3j\':1a=t-h.t;l 1f(N,23.40(1a/2))+h+1f(N,23.42(1a/2));43:1a=t-h.t;l 1f(N,1a)+h}},3c:r(h,t,N){l C.1b(h,t,N)},38:r(h,t,N){l C.1b(h,t,N,\'3l\')},3d:r(h,t,N){l C.1b(h,t,N,\'3j\')},T:T,3A:r(1R,1i){1i.3z(1R);l T.2X(v,1i)},3X:r(h,1W){p(h==v||h==\'\')l 0;h=y(h);E 2i=2e(2e(h).2j(~~1W));l 2i===0&&!h.B(/^0+$/)?4E.49:2i},4g:r(1e,3k,3h,1T){p(4k(1e)||1e==v)l\'\';1e=1e.2j(~~3k);1T=1T||\',\';E 1S=1e.1H(\'.\'),33=1S[0],1W=1S[1]?(3h||\'.\')+1S[1]:\'\';l 33.J(/(\\d)(?=(?:\\d{3})+$)/g,\'$1\'+1T)+1W},4d:r(h,H){p(h==v)l\'\';h=y(h);H=H!=v?y(H):H;E R=!H?-1:h.26(H);l~R?h.M(R+H.t,h.t):h},46:r(h,H){p(h==v)l\'\';h=y(h);H=H!=v?y(H):H;E R=!H?-1:h.34(H);l~R?h.M(R+H.t,h.t):h},4e:r(h,H){p(h==v)l\'\';h=y(h);H=H!=v?y(H):H;E R=!H?-1:h.26(H);l~R?h.M(0,R):h},4f:r(h,H){p(h==v)l\'\';h+=\'\';H=H!=v?\'\'+H:H;E R=h.34(H);l~R?h.M(0,R):h},31:r(1O,Q,1v,32){Q=Q||\', \';1v=1v||\' 35 \';E a=1O.M(),2w=a.3e();p(1O.t>2&&32)1v=C.1N(Q)+1v;l a.t?a.1c(Q)+1v+2w:2w},4i:r(){E 1t=M.1j(1h);1t[3]=1Y;l C.31.2X(C,1t)},4s:r(h){p(h==v)l\'\';E 2r="G�1B��G� G�I�G�I�G�I�G�I�G�I�G�I�G�1B��G�1B��G�I�G�I�G�I�G�4u�I�G�I�G�I�G�I�G�1B��G�1B��G�I�G�I�G�I�G�I�G�4y�I�G�I�G�4x�I�G�I�G�I�G�I�G�I�G�4w",2Z="4n",3i=V 1A(1z(2r),\'g\');h=y(h).1r().J(3i,r(c){E 30=2r.26(c);l 2Z.1y(30)||\'-\'});l C.36(h.J(/[^\\w\\s-]/g,\'\'))},37:r(h,2b){l[2b,h,2b].1c(\'\')},3a:r(h){l C.37(h,\'"\')},1I:r(){E 1q={};1g(E 1C 2g 22){p(!22.2n(1C)||1C.B(/^(?:29|39|2m)$/))3u;1q[1C]=22[1C]}l 1q},20:r(h,U,Q){p(h==v)l\'\';U=~~U;p(Q==v)l 1f(y(h),U);1g(E 20=[];U>0;20[--U]=h){}l 20.1c(Q)},3o:r(17,15){p(17==v&&15==v)l 0;p(17==v)l y(15).t;p(15==v)l y(17).t;17=y(17);15=y(15);E 1x=[],25,1F;1g(E i=0;i<=15.t;i++)1g(E j=0;j<=17.t;j++){p(i&&j)p(17.1y(j-1)===15.1y(i-1))1F=25;L 1F=23.3m(1x[j],1x[j-1],25)+1;L 1F=i+j;25=1x[j];1x[j]=1F}l 1x.3e()}};C.3f=C.1l;C.3p=C.3g;C.3t=C.1N;C.3s=C.3d;C.3C=C.3c;C.3V=C.38;C.39=C.29;C.q=C.3a;p(2c 1I!==\'3b\'){p(2c 2h!==\'3b\'&&2h.1I){2h.1I=C}1I.C=C}L p(2c 2x===\'r\'&&2x.3S){2x(\'3N.2p\',[],r(){l C})}L{1E.O=1E.O||{};1E.O.2p=1E.O.h=C}}(22,y);',62,290,'|||||||||||||||||str||||return||||if||function||length||null|||String|||match|_s|arg|var||�|sep|�|replace|characters|else|slice|padStr|_|case|separator|pos||sprintf|qty|new|||break|||str_format|parse_tree|template|push|str2||str1|field_match|ends|padlen|pad|join|starts|number|strRepeat|for|arguments|argv|call|toUpperCase|trim|_fmt|substr|pruneStr|exec|result|toLowerCase|replacement_field|args|Error|lastSeparator|throw|current|charAt|defaultToWhiteSpace|RegExp|�|prop|entityCode|root|value|field_list|split|exports|step|escapeChars|toString|prototype|rtrim|array|fromCharCode|truncateStr|fmt|parts|tsep|get_type|node_type|decimals|source|true|cache|repeat|z_|this|Math|arg_names|prev|indexOf|output|false|include|nativeTrimLeft|wrapper|typeof|nativeTrimRight|parseNumber|while|in|module|num|toFixed|chars|nativeTrim|reverse|hasOwnProperty|cursor|string|huh|from|reversedEscapeChars|substring|pad_length|test|lastMember|define|arr|pad_character|splice|needle|x25|delimiter|key|isBlank|tmpl|entity|parseFloat|toExponential|parseInt|str_repeat|not|parse|escapeRegExp|howmany|capitalize|underscored|titleize|format|tree_length|variable|type|apply|switch|to|index|toSentence|serial|fnums|lastIndexOf|and|dasherize|surround|rpad|contains|quote|undefined|lpad|lrpad|pop|strip|ltrim|dsep|regex|both|dec|right|min|fosuxX|levenshtein|lstrip|def|abs|center|rstrip|continue|classify|yet|supported|truncate|unshift|vsprintf|is|rjust|positional|named|placeholders|prune|but|gt|quot|apos|amp|lt|underscore|use|strict|trimRight|trimLeft|amd|Object|exist|ljust|expecting|toNumber|does|property|ceil|words|floor|default|found|mixing|strRightBack|lines|shift|NaN|startsWith|humanize|endsWith|strRight|strLeft|strLeftBack|numberFormat|_id|toSentenceSerial|insert|isNaN|da|fA|aaaaaaaaceeeeeiiiilnoooooouuuunczz|succ|unescapeHTML|stripTags|chop|slugify|charCodeAt|ª�|VERSION|º|º�|µ�|count|clean|swapCase|escapeHTML|camelize|Number|1_'.split('|'),0,{})) diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/templates/accordion_tab.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/templates/accordion_tab.php index 3c34314231b45fccce7cf962ef29d6fe0fb58e48..e26269f70df2ea9237f00323c7dce07a0bcd97e4 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/templates/accordion_tab.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/templates/accordion_tab.php @@ -1,4 +1,4 @@ -<h3 class="accordion_tab" id="<?php echo esc_attr($id) ?>"><a href="#"><?php echo_h($title) ?></a></h3> -<div id="<?php echo esc_attr($id) ?>_content"> +<h3 class="accordion_tab" id="<?php esc_attr_e($id) ?>"><a href="#"><?php esc_html_e($title) ?></a></h3> +<div id="<?php esc_attr_e($id) ?>_content"> <?php echo $content ?> </div> \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/templates/attach_to_post.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/templates/attach_to_post.php index 8b3767debab3f3c262bfc2383474feb6b420089a..24f078b9057a5d425be56715ee54113d3d3a5faa 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/templates/attach_to_post.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/templates/attach_to_post.php @@ -1,7 +1,7 @@ <!DOCTYPE html> <html> <head> - <title><?php echo_h($page_title)?></title> + <title><?php esc_html_e($page_title)?></title> <?php wp_print_styles(); wp_print_scripts(); @@ -9,21 +9,22 @@ </head> <body> <div id="attach_to_post_tabs"> - <div class='ui-tabs-icon'><span class="nextgen_logo"><?php echo_h('NextGEN')?></span> <span class="nextgen_logo_sub"><?php echo_h('Gallery')?></span></div> + <div class='ui-tabs-icon'><span class="nextgen_logo"><?php esc_html_e('NextGEN')?></span> <span class="nextgen_logo_sub"><?php esc_html_e('Gallery')?></span></div> <ul> <?php foreach ($tabs as $id => $tab_params): ?> <li> <a href='#<?php echo esc_attr($id)?>'> - <?php echo_h($tab_params['title']) ?> + <?php esc_html_e($tab_params['title']) ?> </a> </li> <?php endforeach ?> </ul> <?php reset($tabs); foreach ($tabs as $id => $tab_params): ?> - <div class="main_menu_tab" id="<?php echo esc_attr($id) ?>"><?php echo $tab_params['content'] ?></div> + <div class="main_menu_tab" id="<?php esc_attr_e($id) ?>"><?php echo $tab_params['content'] ?></div> <?php endforeach ?> </div> + <div id="adminmenu" style="display:none;" data-wp-responsive="true"></div> <?php wp_print_footer_scripts() ?> </body> </html> diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/templates/display_tab_js.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/templates/display_tab_js.php index c841e17ab5ff7a41b3138b1a85928ffb923c61b5..8a9c0cf215511196cc7b4c28efae305958c39cca 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/templates/display_tab_js.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/templates/display_tab_js.php @@ -133,7 +133,7 @@ jQuery(function($){ }); this.$el.append(option.render().el); }, this); - if (this.multiple) this.$el.prop('multiple', true); + if (this.multiple) this.$el.prop('multiple', true).attr('multiple', 'multiple'); if (this.width) this.$el.width(this.width); return this; }, @@ -161,7 +161,7 @@ jQuery(function($){ value: this.value_field == 'id' ? this.model.id : this.model.get(this.value_field), }); if (self.model.get('selected') == true) { - this.$el.attr('selected', 'selected'); + this.$el.prop('selected', true).attr('selected', 'selected'); } return this; } @@ -175,7 +175,7 @@ jQuery(function($){ initialize: function(options) { this.options = options || {}; this.collection = this.options.collection; - if (!this.options.multiple) this.options.include_blank = true; + this.options.include_blank = true; this.select_tag = new Ngg.Views.SelectTag(this.options); this.collection.on('change', this.selection_changed, this); }, @@ -202,42 +202,23 @@ jQuery(function($){ var container = this.select_tag.$el.select2('container').detach(); this.$el.append(container); this.$el.detach(); - } else this.select_tag.$el.select2(this.select2_opts); - // Hack for multi-select elements - if (this.options.multiple && this.collection.selected().length == 0) - this.select_tag.$el.select2('val', ''); + // Ensure that values are pre-populated + if (this.options.multiple) { + var selected = []; + _.each(this.collection.selected_ids(), function(id){ + selected.push(id.toString()); + }); + if (selected.length == 0) selected = ''; + this.select_tag.$el.select2('val', selected); + } + // For IE, ensure that the text field has a width this.$el.find('.select2-input').width(this.options.width-20); - // For IE8, ensure that the selection is being displayed - if (!this.options.multiple) { - var selected_value = this.$el.find('.select2-choice span:first'); - if (selected_value.text().length == 0 && this.collection.selected().length > 0) { - var selected_item = this.collection.selected().pop(); - selected_value.text(selected_item.get(this.select_tag.text_field)); - } - } - else { - var selected_values = this.$el.find('.select2-search-choice'); - if (this.collection.selected().length > 0 && selected_values.length == 0) { - this.select_tag.$el.select2('val', ''); - var data = []; - var value_field = this.select_tag.value_field; - _.each(this.collection.selected(), function(item){ - var value = value_field == 'id' ? item.id : item.get(value_field); - data.push({ - id: value, - text: item.get(this.select_tag.text_field) - }); - }, this); - this.select_tag.$el.select2('data', data); - } - } - return this; } }); @@ -772,6 +753,7 @@ jQuery(function($){ var preview_image_relpath = this.model.get('preview_image_relpath'); if (typeof installed_at_version == 'undefined') { baseurl = photocrati_ajax.wp_site_url; + baseurl = baseurl.replace(/(.*)\/index\.php$/i, "$1"); // those who installed 2.0.66.3 lack the 'installed_at_version' setting but have a // plugin-relative path if (preview_image_relpath.indexOf('/nextgen-gallery') == 0) { @@ -779,7 +761,6 @@ jQuery(function($){ } } - var img = $('<img/>').attr({ src: baseurl + '/' + preview_image_relpath, title: this.model.get('title'), @@ -1438,7 +1419,7 @@ jQuery(function($){ self.displayed_gallery.set('id', id); var editor = parent.tinyMCE.activeEditor; var preview_url = ngg_displayed_gallery_preview_url + '/id--'+id; - var snippet = "<img class='ngg_displayed_gallery mceItem' src='" + preview_url + "'/>"; + var snippet = "<img data-mce-placeholder='1' class='ngg_displayed_gallery mceItem' src='" + preview_url + "'/>"; if (editor.getContent().indexOf(preview_url) < 0) editor.execCommand('mceInsertContent', false, snippet); else { diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/templates/no_display_type_selected.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/templates/no_display_type_selected.php index 445f2fb651466aaa79e45aeedaa2c1db17873922..85a46950da866e9e4f04f161b65fb5ce01215a1d 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/templates/no_display_type_selected.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/templates/no_display_type_selected.php @@ -1,3 +1,3 @@ -<p class="<?php echo esc_attr($css_class) ?>"> - <?php echo_h($no_display_type_selected)?> +<p class="<?php esc_attr_e($css_class) ?>"> + <?php esc_html_e($no_display_type_selected)?> </p> \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/cache/module.cache.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/cache/module.cache.php index 9b809021eedc6729b7bcbf504f97b26d08a39eaa..9d367c7c8a29fd01812e662cc60e53040321678b 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/cache/module.cache.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/cache/module.cache.php @@ -33,8 +33,7 @@ class M_Cache extends C_Base_Module function get_type_list() { return array( - 'C_Cache' => 'class.cache.php', - 'I_Cache' => 'interface.cache.php' + 'C_Cache' => 'class.cache.php' ); } } diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/cache/package.module.cache.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/cache/package.module.cache.php new file mode 100644 index 0000000000000000000000000000000000000000..0519dd883ce99a73d34ada4aa7cfa76c67b02b21 --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/cache/package.module.cache.php @@ -0,0 +1,66 @@ +<?php +class C_Cache extends C_Component +{ + public static $_instances = array(); + public function define($context = FALSE) + { + parent::define($context); + $this->add_mixin('Mixin_Cache'); + $this->implement('I_Cache'); + } + public static function get_instance($context = False) + { + if (!isset(self::$_instances[$context])) { + self::$_instances[$context] = new C_Cache($context); + } + return self::$_instances[$context]; + } +} +class Mixin_Cache extends Mixin +{ + /** + * Empties a directory of all of its content + * + * @param string $directory Absolute path + * @param bool $recursive Remove files from subdirectories of the cache + * @param string $regex (optional) Only remove files matching pattern; '/^.+\.png$/i' will match all .png + */ + public function flush_directory($directory, $recursive = TRUE, $regex = NULL) + { + // It is possible that the cache directory has not been created yet + if (!is_dir($directory)) { + return; + } + if ($recursive) { + $directory = new DirectoryIterator($directory); + } else { + $directory = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($directory), RecursiveIteratorIterator::CHILD_FIRST); + } + if (!is_null($regex)) { + $iterator = RegexIterator($directory, $regex, RecursiveRegexIterator::GET_MATCH); + } else { + $iterator = $directory; + } + foreach ($iterator as $file) { + if ($file->isFile() || $file->isLink()) { + @unlink($file->getPathname()); + } elseif ($file->isDir() && !$file->isDot() && $recursive) { + @rmdir($file->getPathname()); + } + } + } + /** + * Flushes cache from all available galleries + * + * @param array $galleries When provided only the requested galleries' cache is flushed + */ + public function flush_galleries($galleries = array()) + { + if (empty($galleries)) { + $galleries = C_Gallery_Mapper::get_instance()->find_all(); + } + foreach ($galleries as $gallery) { + C_Gallery_Storage::get_instance()->flush_cache($gallery); + } + } +} \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/datamapper/module.datamapper.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/datamapper/module.datamapper.php index 0544724834fdfc6f249645aa4fe173f7fd1656c9..1ec480e641ebba9737c531112572898b18068f48 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/datamapper/module.datamapper.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/datamapper/module.datamapper.php @@ -14,13 +14,12 @@ class M_DataMapper extends C_Base_Module 'photocrati-datamapper', 'DataMapper', 'Provides a database abstraction layer following the DataMapper pattern', - '0.6', + '0.8', 'http://www.photocrati.com', 'Photocrati Media', 'http://www.photocrati.com' ); - include_once('class.datamapper_installer.php'); C_Photocrati_Installer::add_handler($this->module_id, 'C_Datamapper_Installer'); } @@ -192,6 +191,49 @@ class M_DataMapper extends C_Base_Module } } + /** + * Unserializes data using our proprietary format + * @param string $value + * @return mixed + */ + static function unserialize($value) + { + $retval = NULL; + if (is_string($value)) + { + $retval = stripcslashes($value); + + if (strlen($value) > 1) + { + // We can't always rely on base64_decode() or json_decode() to return FALSE as their documentation + // claims so check if $retval begins with a: as that indicates we have a serialized PHP object. + if (strpos($retval, 'a:') === 0) + { + $er = error_reporting(0); + $retval = unserialize($value); + error_reporting($er); + } + else { + // We use json_decode() here because PHP's unserialize() is not Unicode safe. + $retval = json_decode(base64_decode($retval), TRUE); + } + } + } + + return $retval; + } + + /** + * Serializes the data + * @param mixed $value + * @return string + */ + static function serialize($value) + { + //Using json_encode here because PHP's serialize is not Unicode safe + return base64_encode(json_encode($value)); + } + function get_type_list() { return array( @@ -202,12 +244,22 @@ class M_DataMapper extends C_Base_Module 'C_Customtable_Datamapper_Driver' => 'class.customtable_datamapper_driver.php', 'C_Datamapper_Driver_Base' => 'class.datamapper_driver_base.php', 'C_Datamapper_Model' => 'class.datamapper_model.php', - 'I_Custompost_Datamapper' => 'interface.custompost_datamapper.php', - 'I_Customtable_Datamapper' => 'interface.customtable_datamapper.php', - 'I_Datamapper_Driver' => 'interface.datamapper_driver.php', - 'I_Datamapper_Model' => 'interface.datamapper_model.php', 'M_Datamapper' => 'module.datamapper.php' ); } } + +class C_DataMapper_Installer +{ + function __construct() + { + $this->settings = C_NextGen_Settings::get_instance(); + } + + function install() + { + $this->settings->set_default_value('datamapper_driver', 'custom_post_datamapper'); + } +} + new M_DataMapper(); diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/datamapper/package.module.datamapper.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/datamapper/package.module.datamapper.php new file mode 100644 index 0000000000000000000000000000000000000000..845e0d756e9305f1e364dfe494ee6604add5f4cb --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/datamapper/package.module.datamapper.php @@ -0,0 +1,1794 @@ +<?php +class A_DataMapper_Factory extends Mixin +{ + public function datamapper_model($mapper, $properties = array(), $context = FALSE) + { + return new C_DataMapper_Model($mapper, $properties = array(), $context); + } + public function datamapper($object_name, $context = FALSE) + { + return new C_DataMapper($object_name, $context); + } + public function custom_table_datamapper($object_name, $context = FALSE) + { + return new C_CustomTable_DataMapper_Driver($object_name, $context); + } + public function custom_post_datamapper($object_name, $context = FALSE) + { + return new C_CustomPost_DataMapper_Driver($object_name, $context); + } +} +class Mixin_CustomPost_DataMapper_Driver extends Mixin +{ + /** + * Returns a list of querable table columns for posts + * @return array + */ + public function _get_querable_table_columns() + { + return array('name', 'author', 'date', 'title', 'modified', 'menu_order', 'parent', 'ID', 'rand', 'comment_count'); + } + /** + * Used to select which fields should be returned. NOT currently used by + * this implementation of the datamapper driver + * @param type $fields + * @return C_DataMapper_Driver_Base + */ + public function select($fields = '*') + { + $this->object->_query_args = array('post_type' => $this->object->get_object_name(), 'paged' => FALSE, 'fields' => $fields, 'post_status' => 'any', 'datamapper' => TRUE, 'posts_per_page' => -1, 'is_select' => TRUE, 'is_delete' => FALSE); + return $this->object; + } + /** + * Specifies an order clause + * @param type $order_by + * @param type $direction + * @return C_DataMapper_Driver_Base + */ + public function order_by($order_by, $direction = 'ASC') + { + // Make an exception for the rand() method + $order_by = preg_replace('/rand\\(\\s*\\)/', 'rand', $order_by); + if (in_array($order_by, $this->object->_get_querable_table_columns())) { + $this->object->_query_args['orderby'] = $order_by; + } else { + // ordering by a meta value + $this->object->_query_args['orderby'] = 'meta_value'; + $this->object->_query_args['meta_key'] = $order_by; + } + $this->object->_query_args['order'] = $direction; + return $this->object; + } + /** + * Specifies a limit and optional offset + * @param integer $max + * @param integer $offset + * @return C_DataMapper_Driver_Base + */ + public function limit($max, $offset = FALSE) + { + if ($max) { + $this->object->_query_args['paged'] = TRUE; + $this->object->_query_args['offset'] = $offset; + $this->object->_query_args['posts_per_page'] = $max; + } + return $this->object; + } + /** + * Specifies a list of columns to group by + * @param array|string $columns + */ + public function group_by($columns = array()) + { + if (!isset($this->object->_query_args['group_by_columns'])) { + $this->object->_query_args['group_by_columns'] = $columns; + } else { + $this->object->_query_args['group_by_columns'] = array_merge($this->object->_query_args['group_by_columns'], $columns); + } + return $this->object; + } + /** + * Adds a WP_Query where clause + * @param array $where_clauses + * @param string $join + */ + public function _add_where_clause($where_clauses, $join) + { + foreach ($where_clauses as $clause) { + // $clause => array( + // 'column' => 'ID', + // 'value' => 1210, + // 'compare' => '=' + // ) + // Determine where what the where clause is comparing + switch ($clause['column']) { + case 'author': + case 'author_id': + $this->object->_query_args['author'] = $clause['value']; + break; + case 'author_name': + $this->object->_query_args['author_name'] = $clause['value']; + break; + case 'cat': + case 'cat_id': + case 'category_id': + switch ($clause['compare']) { + case '=': + case 'BETWEEN': + case 'IN': + if (!isset($this->object->_query_args['category__in'])) { + $this->object->_query_args['category__in'] = array(); + } + $this->object->_query_args['category__in'][] = $clause['value']; + break; + case '!=': + case 'NOT BETWEEN': + case 'NOT IN': + if (!isset($this->object->_query_args['category__not_in'])) { + $this->object->_query_args['category__not_in'] = array(); + } + $this->object->_query_args['category__not_in'][] = $clause['value']; + break; + } + break; + case 'category_name': + $this->object->_query_args['category_name'] = $clause['value']; + break; + case 'post_id': + case $this->object->get_primary_key_column(): + switch ($clause['compare']) { + case '=': + case 'IN': + case 'BETWEEN': + if (!isset($this->object->_query_args['post__in'])) { + $this->object->_query_args['post__in'] = array(); + } + $this->object->_query_args['post__in'][] = $clause['value']; + break; + default: + if (!isset($this->object->_query_args['post__not_in'])) { + $this->object->_query_args['post__not_in'] = array(); + } + $this->object->_query_args['post__not_in'][] = $clause['value']; + break; + } + break; + case 'pagename': + case 'postname': + case 'page_name': + case 'post_name': + if ($clause['compare'] == 'LIKE') { + $this->object->_query_args['page_name__like'] = $clause['value']; + } elseif ($clause['compare'] == '=') { + $this->object->_query_args['pagename'] = $clause['value']; + } elseif ($clause['compare'] == 'IN') { + $this->object->_query_args['page_name__in'] = $clause['value']; + } + break; + case 'post_title': + // Post title uses custom WHERE clause + if ($clause['compare'] == 'LIKE') { + $this->object->_query_args['post_title__like'] = $clause['value']; + } else { + $this->object->_query_args['post_title'] = $clause['value']; + } + break; + default: + // Must be metadata + $clause['key'] = $clause['column']; + unset($clause['column']); + // Convert values to array, when required + if (in_array($clause['compare'], array('IN', 'BETWEEN'))) { + $clause['value'] = explode(',', $clause['value']); + foreach ($clause['value'] as &$val) { + if (!is_numeric($val)) { + // In the _parse_where_clause() method, we + // quote the strings and add slashes + $val = stripslashes($val); + $val = substr($val, 1, strlen($val) - 2); + } + } + } + if (!isset($this->object->_query_args['meta_query'])) { + $this->object->_query_args['meta_query'] = array(); + } + $this->object->_query_args['meta_query'][] = $clause; + break; + } + } + // If any where clauses have been added, specify how the conditions + // will be conbined/joined + if (isset($this->object->_query_args['meta_query'])) { + $this->object->_query_args['meta_query']['relation'] = $join; + } + } + /** + * Destroys/deletes an entity from the database + * @param stdObject|C_DataMapper_Model $entity + * @return type + */ + public function destroy($entity, $skip_trash = TRUE) + { + $retval = FALSE; + $key = $this->object->get_primary_key_column(); + // Find the id of the entity + if (is_object($entity) && isset($entity->{$key})) { + $id = (int) $entity->{$key}; + } else { + $id = (int) $entity; + } + // If we have an ID, then delete the post + if (is_integer($id)) { + // TODO: We assume that we can skip the trash. Is that correct? + // FYI, Deletes postmeta as wells + if (is_object(wp_delete_post($id, TRUE))) { + $retval = TRUE; + } + } + return $retval; + } + /** + * Converts a post to an entity + * @param \stdClass $post + * @param boolean $model + * @return \stdClass + */ + public function convert_post_to_entity($post, $model = FALSE) + { + $entity = new stdClass(); + // Unserialize the post_content_filtered field + if (is_string($post->post_content_filtered)) { + if ($post_content = $this->object->unserialize($post->post_content_filtered)) { + foreach ($post_content as $key => $value) { + $post->{$key} = $value; + } + } + } + // Unserialize the post content field + if (is_string($post->post_content)) { + if ($post_content = $this->object->unserialize($post->post_content)) { + foreach ($post_content as $key => $value) { + $post->{$key} = $value; + } + } + } + // Copy post fields to entity + unset($post->post_content); + unset($post->post_content_filtered); + foreach ($post as $key => $value) { + $entity->{$key} = $value; + } + $this->object->_convert_to_entity($entity); + return $model ? $this->object->convert_to_model($entity) : $entity; + } + /** + * Converts an entity to a post + * @param type $entity + * @return type + */ + public function _convert_entity_to_post($entity) + { + // Was a model passed instead of an entity? + $post = $entity; + if (!$entity instanceof stdClass) { + $post = $entity->get_entity(); + } + // Create the post content + $post_content = clone $post; + foreach ($this->object->_table_columns as $column) { + unset($post_content->{$column}); + } + unset($post->id_field); + unset($post->post_content_filtered); + unset($post->post_content); + $post->post_content = $this->object->serialize($post_content); + $post->post_content_filtered = $post->post_content; + $post->post_type = $this->object->get_object_name(); + // Sometimes an entity can contain a data stored in an array or object + // Those will be removed from the post, and serialized in the + // post_content field + foreach ($post as $key => $value) { + if (in_array(strtolower(gettype($value)), array('object', 'array'))) { + unset($post->{$key}); + } + } + // A post required a title + if (!property_exists($post, 'post_title')) { + $post->post_title = $this->object->get_post_title($post); + } + // A post also requires an excerpt + if (!property_exists($post, 'post_excerpt')) { + $post->post_excerpt = $this->object->get_post_excerpt($post); + } + return $post; + } + /** + * Returns the WordPress database class + * @global wpdb $wpdb + * @return wpdb + */ + public function _wpdb() + { + global $wpdb; + return $wpdb; + } + /** + * Flush and update all postmeta for a particular post + * @param int $post_id + */ + public function _flush_and_update_postmeta($post_id, $entity, $omit = array()) + { + // We need to insert post meta data for each property + // Unfortunately, that means flushing all existing postmeta + // and then inserting new values. Depending on the number of + // properties, this could be slow. So, we directly access the database + /* @var $wpdb wpdb */ + global $wpdb; + if (!is_array($omit)) { + $omit = array($omit); + } + // By default, we omit creating meta values for columns in the posts table + $omit = array_merge($omit, $this->object->_table_columns); + // Delete the existing meta values + $wpdb->query($wpdb->prepare("DELETE FROM {$wpdb->postmeta} WHERE post_id = %s", $post_id)); + // Create query for new meta values + $sql_parts = array(); + foreach ($entity as $key => $value) { + if (in_array($key, $omit)) { + continue; + } + if (is_array($value) or is_object($value)) { + $value = $this->object->serialize($value); + } + $sql_parts[] = $wpdb->prepare('(%s, %s, %s)', $post_id, $key, $value); + } + $wpdb->query("INSERT INTO {$wpdb->postmeta} (post_id, meta_key, meta_value) VALUES " . implode(',', $sql_parts)); + } + /** + * Saves an entity to the database + * @param stdObject $entity + */ + public function _save_entity($entity) + { + $post = $this->object->_convert_entity_to_post($entity); + $primary_key = $this->object->get_primary_key_column(); + // TODO: unsilence this. Wordpress 3.9-beta2 is generating an error that should be corrected before its + // final release. + if ($post_id = @wp_insert_post($post)) { + $new_entity = $this->object->find($post_id, TRUE); + foreach ($new_entity->get_entity() as $key => $value) { + $entity->{$key} = $value; + } + // Save properties as post meta + $this->object->_flush_and_update_postmeta($post_id, $entity instanceof stdClass ? $entity : $entity->get_entity()); + $entity->{$primary_key} = $post_id; + } + $entity->id_field = $primary_key; + return $post_id; + } + /** + * Determines whether the current statement is SELECT + * @return boolean + */ + public function is_select_statement() + { + return isset($this->object->_query_args['is_select']) && $this->object->_query_args['is_select']; + } + /** + * Determines whether the current statement is DELETE + * @return type + */ + public function is_delete_statement() + { + return isset($this->object->_query_args['is_delete']) && $this->object->_query_args['is_delete']; + } + /** + * Starts a new DELETE statement + */ + public function delete() + { + $this->object->select(); + $this->object->_query_args['is_select'] = FALSE; + $this->object->_query_args['is_delete'] = TRUE; + return $this->object; + } + /** + * Runs the query + * @param string $sql optionally run the specified query + * @return array + */ + public function run_query($sql = FALSE, $model = FALSE, $convert_to_entities = TRUE) + { + $retval = array(); + $results = array(); + // All of our custom fields are stored as post meta, but is also stored as a serialized + // value in the post_content field. Because of this, we don't need to look up and cache the + // post meta values + $this->object->_query_args['update_post_meta_cache'] = FALSE; + $this->object->_query_args['update_post_meta_cache'] = FALSE; + $this->object->_query_args['no_found_posts'] = FALSE; + // Don't cache any manual SQL query + if ($sql) { + $this->object->_query_args['cache_results'] = FALSE; + $this->object->_query_args['custom_sql'] = $sql; + } + // If this is a select query, then try fetching the results from cache + $cache_key = md5(json_encode($this->object->_query_args)); + if ($this->is_select_statement() && $this->object->_use_cache) { + $results = $this->object->get_from_cache($cache_key); + } + // Execute the query + if (!$results) { + $query = new WP_Query(array('datamapper' => TRUE)); + if (isset($this->object->debug)) { + $this->object->_query_args['debug'] = TRUE; + } + $query->query_vars = $this->object->_query_args; + add_action('pre_get_posts', array(&$this, 'set_query_args'), PHP_INT_MAX - 1, 1); + $results = $query->get_posts(); + // Cache the result + if ($this->is_select_statement()) { + $this->object->cache($cache_key, $results); + } + remove_action('pre_get_posts', array(&$this, 'set_query_args'), PHP_INT_MAX - 1, 1); + } + // Convert the result + if ($convert_to_entities) { + foreach ($results as $row) { + $retval[] = $this->object->convert_post_to_entity($row, $model); + } + } else { + $retval = $results; + } + // Ensure that we return an empty array when there are no results + if (!$retval) { + $retval = array(); + } + return $retval; + } + /** + * Ensure that the query args are set. We need to do this in case a third-party + * plugin overrides our query + * @param $query + */ + public function set_query_args($query) + { + if ($query->get('datamapper')) { + $query->query_vars = $this->object->_query_args; + } + } + /** + * Fetches the last row + * @param array $conditions + * @return C_DataMapper_Entity + */ + public function find_last($conditions = array(), $model = FALSE) + { + $retval = NULL; + // Get row number for the last row + $table_name = $this->object->_clean_column($this->object->get_table_name()); + $object_name = $this->object->_clean_column($this->object->get_object_name()); + $sql = $this->_wpdb()->prepare("SELECT COUNT(*) FROM {$table_name} WHERE post_type = %s", $object_name); + $count = $this->_wpdb()->get_var($sql); + $offset = $count - 1; + $results = $this->select()->where_and($conditions)->limit(1, $offset)->run_query(); + if ($results) { + $retval = $model ? $this->object->convert_to_model($results[0]) : $results[0]; + } + return $retval; + } + /** + * Returns the number of total records/entities that exist + * @return int + */ + public function count() + { + $this->object->select($this->object->get_primary_key_column()); + $retval = $this->object->run_query(FALSE, FALSE, FALSE); + return count($retval); + } + /** + * Returns the title of the post. Used when post_title is not set + * @param stdClass $entity + * @return string + */ + public function get_post_title($entity) + { + return "Untitled {$this->object->get_object_name()}"; + } + /** + * Returns the excerpt of the post. Used when post_excerpt is not set + * @param stdClass $entity + * @return string + */ + public function get_post_excerpt($entity) + { + return ''; + } +} +class C_DataMapper_Driver_Base extends C_Component +{ + public $_object_name; + public $_model_factory_method = FALSE; + public $_columns = array(); + public $_table_columns = array(); + public $_serialized_columns = array(); + public function define($object_name = FALSE, $context = FALSE) + { + parent::define($context); + $this->add_mixin('Mixin_DataMapper_Driver_Base'); + $this->implement('I_DataMapper_Driver'); + $this->_object_name = $object_name; + } + public function initialize() + { + parent::initialize(); + $this->_cache = array(); + if ($this->has_method('define_columns')) { + $this->define_columns(); + } + $this->lookup_columns(); + } + /** + * Gets the object name + * @return string + */ + public function get_object_name() + { + return $this->_object_name; + } + /** + * Gets the name of the table + * @global string $table_prefix + * @return string + */ + public function get_table_name() + { + global $table_prefix; + return apply_filters('ngg_datamapper_table_name', $table_prefix . $this->_object_name, $this->_object_name); + } + /** + * Looks up using SQL the columns existing in the database + */ + public function lookup_columns() + { + // Avoid doing multiple SHOW COLUMNS if we can help it + $key = C_Photocrati_Transient_Manager::create_key('col_in_' . $this->get_table_name(), 'columns'); + $this->_table_columns = C_Photocrati_Transient_Manager::fetch($key, FALSE); + if (!$this->_table_columns) { + global $wpdb; + $this->_table_columns = array(); + $sql = "SHOW COLUMNS FROM `{$this->get_table_name()}`"; + foreach ($wpdb->get_results($sql) as $row) { + $this->_table_columns[] = $row->Field; + } + C_Photocrati_Transient_Manager::update($key, $this->_table_columns); + } + return $this->_table_columns; + } + /** + * Determines whether a column is present for the table + * @param string $column_name + * @return string + */ + public function has_column($column_name) + { + if (empty($this->object->_table_columns)) { + $this->object->lookup_columns(); + } + return array_search($column_name, $this->object->_table_columns) !== FALSE; + } + /** + * Sets the name of the factory method used to create a model for this entity + * @param string $method_name + */ + public function set_model_factory_method($method_name) + { + $this->_model_factory_method = $method_name; + } + /** + * Gets the name of the factory method used to create a model for this entity + */ + public function get_model_factory_method() + { + return $this->_model_factory_method; + } + /** + * Gets the name of the primary key column + * @return string + */ + public function get_primary_key_column() + { + return $this->_primary_key_column; + } + /** + * Gets the class name of the driver used + * @return string + */ + public function get_driver_class_name() + { + return get_called_class(); + } + public function cache($key, $results) + { + if ($this->object->_use_cache) { + $this->_cache[$key] = $results; + } + } + public function get_from_cache($key, $default = NULL) + { + if ($this->object->_use_cache && isset($this->_cache[$key])) { + return $this->_cache[$key]; + } else { + return $default; + } + } +} +class C_CustomTable_DataMapper_Driver_Mixin extends Mixin +{ + /** + * Gets the name of the primary key column + * @return string + */ + public function get_primary_key_column() + { + return $this->object->_primary_key_column; + } + /** + * Selects which fields to collect from the table. + * NOTE: Not protected from SQL injection - DO NOT let your users + * specify DB columns + * @param string $fields + */ + public function select($fields = NULL) + { + // Create a fresh slate + $this->object->_init(); + if (!$fields or $fields == '*') { + $fields = $this->get_table_name() . '.*'; + } + $this->object->_select_clause = "SELECT {$fields}"; + return $this->object; + } + /** + * Determines whether we're going to execute a SELECT statement + * @return boolean + */ + public function is_select_statement() + { + return $this->object->_select_clause ? TRUE : FALSE; + } + /** + * Determines if we're going to be executing a DELETE statement + * @return type + */ + public function is_delete_statement() + { + return $this->object->_delete_clause ? TRUE : FALSE; + } + /** + * Start a delete statement + */ + public function delete() + { + // Create a fresh slate + $this->object->_init(); + $this->object->_delete_clause = 'DELETE'; + return $this->object; + } + /** + * Orders the results of the query + * This method may be used multiple of times to order by more than column + * @param $order_by + * @param $direction + */ + public function order_by($order_by, $direction = 'ASC') + { + // We treat the rand() function as an exception + if (preg_match('/rand\\(\\s*\\)/', $order_by)) { + $order = 'rand()'; + } else { + $order_by = $this->object->_clean_column($order_by); + // If the order by clause is a column, then it should be backticked + if ($this->object->has_column($order_by)) { + $order_by = "`{$order_by}`"; + } + $direction = $this->object->_clean_column($direction); + $order = "{$order_by} {$direction}"; + } + $this->object->_order_clauses[] = $order; + return $this->object; + } + /** + * Specifies a limit and optional offset + * @param integer $max + * @param integer $offset + */ + public function limit($max, $offset = 0) + { + if ($offset) { + $limit = $this->_wpdb()->prepare('LIMIT %d, %d', max(0, $offset), $max); + } else { + $limit = $this->_wpdb()->prepare('LIMIT %d', max(0, $max)); + } + if ($limit) { + $this->object->_limit_clause = $limit; + } + return $this->object; + } + /** + * Specifics a group by clause for one or more columns + * @param array|string $columns + */ + public function group_by($columns = array()) + { + if (!is_array($columns)) { + $columns = array($columns); + } + $this->object->_group_by_columns = array_merge($this->object->_group_by_columns, $columns); + return $this->object; + } + /** + * Adds a where clause to the driver + * @param array $where_clauses + * @param string $join + */ + public function _add_where_clause($where_clauses, $join) + { + $clauses = array(); + foreach ($where_clauses as $clause) { + extract($clause); + if ($this->object->has_column($column)) { + $column = "`{$column}`"; + } + if (!is_array($value)) { + $value = array($value); + } + foreach ($value as $index => $v) { + $v = $clause['type'] == 'numeric' ? $v : "'{$v}'"; + $value[$index] = $v; + } + if ($compare == 'BETWEEN') { + $value = "{$value[0]} AND {$value[1]}"; + } else { + $value = implode(', ', $value); + if (strpos($compare, 'IN') !== FALSE) { + $value = "({$value})"; + } + } + $clauses[] = "{$column} {$compare} {$value}"; + } + $this->object->_where_clauses[] = implode(" {$join} ", $clauses); + } + /** + * Returns the total number of entities known + * @return type + */ + public function count() + { + $retval = 0; + $key = $this->object->get_primary_key_column(); + $results = $this->object->run_query("SELECT COUNT(`{$key}`) AS `{$key}` FROM `{$this->object->get_table_name()}`"); + if ($results && isset($results[0]->{$key})) { + $retval = (int) $results[0]->{$key}; + } + return $retval; + } + /** + * Returns the generated SQL query to be executed + * @return string + */ + public function get_generated_query($no_entities = FALSE) + { + $sql = array(); + if ($this->object->is_select_statement()) { + $sql[] = $this->object->_select_clause; + } elseif ($this->object->is_delete_statement()) { + $sql[] = $this->object->_delete_clause; + } + $sql[] = 'FROM `' . $this->object->get_table_name() . '`'; + $where_clauses = array(); + foreach ($this->object->_where_clauses as $where) { + $where_clauses[] = '(' . $where . ')'; + } + if ($where_clauses) { + $sql[] = 'WHERE ' . implode(' AND ', $where_clauses); + } + if ($this->object->is_select_statement()) { + if ($this->object->_group_by_columns) { + $sql[] = 'GROUP BY ' . implode(', ', $this->object->_group_by_columns); + } + if ($this->object->_order_clauses) { + $sql[] = 'ORDER BY ' . implode(', ', $this->object->_order_clauses); + } + if ($this->object->_limit_clause) { + $sql[] = $this->object->_limit_clause; + } + } + return implode(' ', $sql); + } + /** + * Run the query + * @param $sql optionally run the specified SQL insteads + * return + */ + public function run_query($sql = FALSE, $model = FALSE, $no_entities = FALSE) + { + $results = FALSE; + $retval = array(); + // Or generate SQL query + if (!$sql) { + $sql = $this->object->get_generated_query($no_entities); + } + // If we have a SQL statement to execute, then heck, execute it! + if ($sql) { + if ($this->object->debug) { + var_dump($sql); + } + // Try getting the result from cache first + if ($this->is_select_statement() && $this->object->_use_cache) { + $results = $this->object->get_from_cache($sql); + } + } + if (!$results) { + $this->_wpdb()->query($sql); + $results = $this->_wpdb()->last_result; + if ($this->is_select_statement()) { + $this->object->cache($sql, $results); + } + } + if ($results) { + $retval = array(); + // For each row, create an entity, update it's properties, and add it to the result set + if ($no_entities) { + $retval = $results; + } else { + $id_field = $this->get_primary_key_column(); + foreach ($results as $row) { + if ($row) { + if (isset($row->{$id_field})) { + if ($model) { + $retval[] = $this->object->convert_to_model($row); + } else { + $retval[] = $this->object->_convert_to_entity($row); + } + } + } + } + } + } elseif ($this->object->debug) { + var_dump('No entities returned from query'); + } + // Just a safety check + if (!$retval) { + $retval = array(); + } + return $retval; + } + /** + * Stores the entity + * @param stdClass $entity + */ + public function _save_entity($entity) + { + $retval = FALSE; + unset($entity->id_field); + $primary_key = $this->object->get_primary_key_column(); + if (isset($entity->{$primary_key}) && $entity->{$primary_key} > 0) { + if ($this->object->_update($entity)) { + $retval = intval($entity->{$primary_key}); + } + } else { + $retval = $this->object->_create($entity); + if ($retval) { + $new_entity = $this->object->find($retval); + foreach ($new_entity as $key => $value) { + $entity->{$key} = $value; + } + } + } + $entity->id_field = $primary_key; + return $retval; + } + /** + * Converts an entity to something suitable for inserting into + * a database column + * @param stdObject $entity + * @return array + */ + public function _convert_to_table_data($entity) + { + $data = (array) $entity; + foreach ($data as $key => $value) { + if (is_array($value)) { + $data[$key] = $this->object->serialize($value); + } + } + return $data; + } + /** + * Destroys/deletes an entity + * @param stdObject|C_DataMapper_Model|int $entity + * @return boolean + */ + public function destroy($entity) + { + $retval = FALSE; + $key = $this->object->get_primary_key_column(); + // Find the id of the entity + if (is_object($entity) && isset($entity->{$key})) { + $id = (int) $entity->{$key}; + } else { + $id = (int) $entity; + } + // If we have an ID, then delete the post + if (is_numeric($id)) { + $sql = $this->object->_wpdb()->prepare("DELETE FROM `{$this->object->get_table_name()}` WHERE {$key} = %s", $id); + $retval = $this->object->_wpdb()->query($sql); + } + return $retval; + } + /** + * Creates a new record in the database + * @param stdObject $entity + * @return boolean + */ + public function _create($entity) + { + $retval = FALSE; + $id = $this->object->_wpdb()->insert($this->object->get_table_name(), $this->object->_convert_to_table_data($entity)); + if ($id) { + $key = $this->object->get_primary_key_column(); + $retval = $entity->{$key} = intval($this->object->_wpdb()->insert_id); + } + return $retval; + } + /** + * Updates a record in the database + * @param stdObject $entity + */ + public function _update($entity) + { + $key = $this->object->get_primary_key_column(); + return $this->object->_wpdb()->update($this->object->get_table_name(), $this->object->_convert_to_table_data($entity), array($key => $entity->{$key})); + } + /** + * Fetches the last row + * @param array $conditions + * @return C_DataMapper_Entity + */ + public function find_last($conditions = array(), $model = FALSE) + { + $retval = NULL; + // Get row number for the last row + $table_name = $this->object->_clean_column($this->object->get_table_name()); + $count = $this->_wpdb()->get_var("SELECT COUNT(*) FROM `{$table_name}`"); + $offset = $count - 1; + $results = $this->select()->where_and($conditions)->limit(1, $offset)->run_query(); + if ($results) { + $retval = $model ? $this->object->convert_to_model($results[0]) : $results[0]; + } + return $retval; + } + public function _add_column($column_name, $datatype, $default_value = NULL) + { + $sql = "ALTER TABLE `{$this->get_table_name()}` ADD COLUMN `{$column_name}` {$datatype}"; + if ($default_value) { + if (is_string($default_value)) { + $default_value = str_replace('\'', '\\\'', $default_value); + } + $sql .= ' NOT NULL DEFAULT ' . (is_string($default_value) ? "'{$default_value}" : "{$default_value}"); + } + return $this->object->_wpdb()->query($sql) ? TRUE : FALSE; + } + public function _remove_column($column_name) + { + $sql = "ALTER TABLE `{$this->get_table_name()}` DROP COLUMN `{$column_name}`"; + return $this->object->_wpdb()->query($sql) ? TRUE : FALSE; + } + /** + * Migrates the schema of the database + */ + public function migrate() + { + if (!$this->object->_columns) { + throw new E_ColumnsNotDefinedException("Columns not defined for {$this->get_table_name()}"); + } + $added = FALSE; + $removed = FALSE; + // Add any missing columns + foreach ($this->object->_columns as $key => $properties) { + if (!in_array($key, $this->object->_table_columns)) { + if ($this->object->_add_column($key, $properties['type'], $properties['default_value'])) { + $added = TRUE; + } + } + } + // Remove any columns not defined + // foreach ($this->object->_table_columns as $key) { + // if (!isset($this->object->_columns[$key])) { + // $this->object->_remove_column($key); + // $removed = TRUE; + // } + // } + if ($added or $removed) { + // var_dump($this->object->_table_columns); + $this->object->lookup_columns(); + } + } + public function _init() + { + $this->object->_where_clauses = array(); + $this->object->_order_clauses = array(); + $this->object->_group_by_columns = array(); + $this->object->_limit_clause = ''; + $this->object->_select_clause = ''; + } +} +class C_CustomTable_DataMapper_Driver extends C_DataMapper_Driver_Base +{ + /** + * The WordPress Database Connection + * @var wpdb + */ + public $_where_clauses = array(); + public $_order_clauses = array(); + public $_group_by_columns = array(); + public $_limit_clause = ''; + public $_select_clause = ''; + public $_delete_clause = ''; + public $_use_cache = TRUE; + public function define($object_name = FALSE, $context = FALSE) + { + parent::define($object_name, $context); + $this->add_mixin('C_CustomTable_DataMapper_Driver_Mixin'); + $this->implement('I_CustomTable_DataMapper'); + } + public function initialize($object_name = FALSE) + { + parent::initialize($object_name); + if (!isset($this->_primary_key_column)) { + $this->_primary_key_column = $this->_lookup_primary_key_column(); + } + $this->migrate(FALSE); + } + /** + * Returns the database connection object for WordPress + * @global wpdb $wpdb + * @return wpdb + */ + public function _wpdb() + { + global $wpdb; + return $wpdb; + } + /** + * Looks up the primary key column for this table + */ + public function _lookup_primary_key_column() + { + $key = $this->_wpdb()->get_row("SHOW INDEX FROM {$this->get_table_name()} WHERE Key_name='PRIMARY'", ARRAY_A); + if (!$key) { + throw new Exception("Please specify the primary key for {$this->get_table_name()}"); + } + return $key['Column_name']; + } +} +/** + * Thrown when an entity does not exist + */ +class E_EntityNotFoundException extends E_NggErrorException +{ +} +class E_ColumnsNotDefinedException extends E_NggErrorException +{ +} +/** + * Thrown when an invalid data type is used as an entity, such as an associative + * array which is not yet supported due to a problem with references and the + * call_user_func_array() function. + */ +class E_InvalidEntityException extends E_NggErrorException +{ + public function __construct($message_or_previous = FALSE, $code = 0, $previous = NULL) + { + // We don't know if we have been passed a message yet or not + $message = FALSE; + // Determine if the first parameter is a string or exception + if ($message_or_previous) { + if (is_string($message_or_previous)) { + $message = $message_or_previous; + } else { + $previous = $message_or_previous; + } + } + // If no message was provided, create a default message + if (!$message) { + $message = 'Invalid data type used for entity. Please use stdClass + or a subclass of C_DataMapper_Model. Arrays will be supported in + the future.'; + } + parent::__construct($message, $code); + } +} +class Mixin_DataMapper_Driver_Base extends Mixin +{ + /** + * Used to clean column or table names in a SQL query + * @param string $val + * @return string + */ + public function _clean_column($val) + { + return str_replace(array(';', '\'', '"', '`'), array(''), $val); + } + /** + * Notes that a particular columns is serialized, and should be unserialized when converted to an entity + * @param $column + */ + public function add_serialized_column($column) + { + $this->object->_serialized_columns[] = $column; + } + public function unserialize_columns($object) + { + foreach ($this->object->_serialized_columns as $column) { + if (isset($object->{$column}) && is_string($object->{$column})) { + $object->{$column} = $this->unserialize($object->{$column}); + } + } + } + /** + * Serializes the data + * @param mixed $value + * @return string + */ + public function serialize($value) + { + return M_DataMapper::serialize($value); + } + /** + * Unserializes data using our proprietary format + * @param string $value + * @return mixed + */ + public function unserialize($value) + { + return M_DataMapper::unserialize($value); + } + /** + * Finds a partiular entry by id + * @param int|stdClass|C_DataMapper_Model $entity + * @return C_DataMapper_Entity + */ + public function find($entity, $model = FALSE) + { + $retval = NULL; + // Get primary key of the entity + $pkey = $this->object->get_primary_key_column(); + if (!is_numeric($entity)) { + $entity = isset($entity->{$pkey}) ? intval($entity->{$pkey}) : FALSE; + } + // If we have an entity ID, then get the record + if ($entity) { + $results = $this->object->select()->where_and(array("{$pkey} = %d", $entity))->limit(1, 0)->run_query(); + if ($results) { + $retval = $model ? $this->object->convert_to_model($results[0]) : $results[0]; + } + } + return $retval; + } + /** + * Fetches the first row + * @param array $conditions + * @return C_DataMapper_Entity + */ + public function find_first($conditions = array(), $model = FALSE) + { + $results = $this->object->select()->where_and($conditions)->limit(1, 0)->run_query(); + if ($results) { + return $model ? $this->object->convert_to_model($results[0]) : $results[0]; + } else { + return NULL; + } + } + /** + * Queries all rows + * @param array $conditions + * @return array + */ + public function find_all($conditions = array(), $model = FALSE) + { + // Sometimes users will forget that the first parameter is conditions, and think it's $model instead + if ($conditions === TRUE) { + $conditions = array(); + $model = TRUE; + } + if ($conditions === FALSE) { + $conditions = array(); + $model = FALSE; + } + $results = $this->object->select()->where_and($conditions)->run_query(); + if ($results && $model) { + foreach ($results as &$r) { + $r = $this->object->convert_to_model($r); + } + } + return $results; + } + /** + * Filters the query using conditions: + * E.g. + * array("post_title = %s", "Foo") + * array( + * array("post_title = %s", "Foo"), + * + * ) + */ + public function where_and($conditions = array()) + { + return $this->object->_where($conditions, 'AND'); + } + public function where_or($conditions = array()) + { + return $this->object->where($conditions, 'OR'); + } + public function where($conditions = array()) + { + return $this->object->_where($conditions, 'AND'); + } + /** Parses the where clauses + * They could look like the following: + * + * array( + * "post_id = 1" + * array("post_id = %d", 1), + * ) + * + * or simply "post_id = 1" + * @param array|string $conditions + * @param string $operator + * @return ExtensibleObject + */ + public function _where($conditions = array(), $operator) + { + $where_clauses = array(); + // If conditions is not an array, make it one + if (!is_array($conditions)) { + $conditions = array($conditions); + } elseif (!empty($conditions) && !is_array($conditions[0])) { + // Just a single condition was passed, but with a bind + $conditions = array($conditions); + } + // Iterate through each condition + foreach ($conditions as $condition) { + if (is_string($condition)) { + $clause = $this->object->_parse_where_clause($condition); + if ($clause) { + $where_clauses[] = $clause; + } + } else { + $clause = array_shift($condition); + $clause = $this->object->_parse_where_clause($clause, $condition); + if ($clause) { + $where_clauses[] = $clause; + } + } + } + // Add where clause to query + if ($where_clauses) { + $this->object->_add_where_clause($where_clauses, $operator); + } + return $this->object; + } + /** + * Parses a where clause and returns an associative array + * representing the query + * + * E.g. parse_where_clause("post_title = %s", "Foo Bar") + * + * @global wpdb $wpdb + * @param string $condition + * @return array + */ + public function _parse_where_clause($condition) + { + $column = ''; + $operator = ''; + $value = ''; + $numeric = TRUE; + // Substitute any placeholders + global $wpdb; + $binds = func_get_args(); + $binds = isset($binds[1]) ? $binds[1] : array(); + // first argument is the condition + foreach ($binds as &$bind) { + // A bind could be an array, used for the 'IN' operator + // or a simple scalar value. We need to convert arrays + // into scalar values + if (is_object($bind)) { + $bind = (array) $bind; + } + if (is_array($bind) && !empty($bind)) { + foreach ($bind as &$val) { + if (!is_numeric($val)) { + $val = '"' . addslashes($val) . '"'; + $numeric = FALSE; + } + } + $bind = implode(',', $bind); + } else { + if (is_array($bind) && empty($bind)) { + $bind = 'NULL'; + } else { + if (!is_numeric($bind)) { + $numeric = FALSE; + } + } + } + } + if ($binds) { + $condition = $wpdb->prepare($condition, $binds); + } + // Parse the where clause + if (preg_match('/^[^\\s]+/', $condition, $match)) { + $column = trim(array_shift($match)); + $condition = str_replace($column, '', $condition); + } + if (preg_match('/(NOT )?IN|(NOT )?LIKE|(NOT )?BETWEEN|[=!<>]+/i', $condition, $match)) { + $operator = trim(array_shift($match)); + $condition = str_replace($operator, '', $condition); + $operator = strtolower($operator); + $value = trim($condition); + } + // Values will automatically be quoted, so remove them + // If the value is part of an IN clause or BETWEEN clause and + // has multiple values, we attempt to split the values apart into an + // array and iterate over them individually + if ($operator == 'in') { + $values = preg_split('/\'?\\s?(,)\\s?\'?/i', $value); + } elseif ($operator == 'between') { + $values = preg_split('/\'?\\s?(AND)\\s?\'?/i', $value); + } + // If there's a single value, treat it as an array so that we + // can still iterate + if (empty($values)) { + $values = array($value); + } + foreach ($values as $index => $value) { + $value = preg_replace('/^(\\()?\'/', '', $value); + $value = preg_replace('/\'(\\))?$/', '', $value); + $values[$index] = $value; + } + if (count($values) > 1) { + $value = $values; + } + // Return the WP Query meta query parameters + $retval = array('column' => $column, 'value' => $value, 'compare' => strtoupper($operator), 'type' => $numeric ? 'numeric' : 'string'); + return $retval; + } + /** + * Converts a stdObject to an Entity + * @param stdObject $stdObject + * @return stdObject + */ + public function _convert_to_entity($stdObject) + { + // Add name of the id_field to the entity, and convert + // the ID to an integer + $stdObject->id_field = $key = $this->object->get_primary_key_column(); + // Cast columns to their appropriate data type + $this->cast_columns($stdObject); + // Strip slashes + $this->strip_slashes($stdObject); + // Unserialize columns + $this->unserialize_columns($stdObject); + // Set defaults for this entity + if (!$this->has_default_values($stdObject)) { + $this->object->set_defaults($stdObject); + $stdObject->__defaults_set = TRUE; + } + return $stdObject; + } + public function strip_slashes($stdObject) + { + foreach (get_object_vars($stdObject) as $key => $value) { + if (is_string($value)) { + $stdObject->{$key} = str_replace('\\\'', '\'', str_replace('\\"', '"', str_replace('\\\\', '\\', $value))); + } elseif (is_object($value)) { + $stdObject->{$key} = $this->strip_slashes_deep($value); + } elseif (is_array($value)) { + $stdObject->{$key} = $this->strip_slashes_deep($value); + } + } + return $stdObject; + } + public function strip_slashes_deep($input) + { + $retval = $input; + if (is_object($input)) { + foreach (get_object_vars($input) as $key => $value) { + $retval->{$key} = $this->strip_slashes_deep($value); + } + } elseif (is_array($input)) { + foreach ($input as $key => $value) { + $retval[$key] = $this->strip_slashes_deep($value); + } + } elseif (is_string($input)) { + $retval = str_replace('\\\'', '\'', str_replace('\\"', '"', str_replace('\\\\', '\\', $input))); + } + return $retval; + } + /** + * Converts a stdObject entity to a model + * @param stdObject $stdObject + */ + public function convert_to_model($stdObject, $context = FALSE) + { + // Create a factory + $retval = NULL; + try { + $this->object->_convert_to_entity($stdObject); + } catch (Exception $ex) { + throw new E_InvalidEntityException($ex); + } + $retval = $this->object->create($stdObject, $context); + return $retval; + } + /** + * Creates a new model + * @param stdClass|array $properties + * @return C_DataMapper_Model + */ + public function create($properties = array(), $context = FALSE) + { + $entity = $properties; + $factory = C_Component_Factory::get_instance(); + if (!is_object($properties)) { + $entity = new stdClass(); + foreach ($properties as $k => $v) { + $entity->{$k} = $v; + } + } + return $factory->create($this->object->get_model_factory_method(), $entity, $this->object, $context); + } + /** + * Determines whether an object is actually a model + * @param mixed $obj + * @return bool + */ + public function is_model($obj) + { + return is_subclass_of($obj, 'C_DataMapper_Model') or get_class($obj) == 'C_DataMapper_Model'; + } + /** + * Saves an entity + * @param stdClass|C_DataMapper_Model $entity + * @return bool + */ + public function save($entity) + { + $retval = FALSE; + $model = $entity; + // Attempt to use something else, most likely an associative array + // TODO: Support assocative arrays. The trick is to support references + // with dynamic calls using __call() and call_user_func_array(). + if (is_array($entity)) { + throw new E_InvalidEntityException(); + } elseif (!$this->object->is_model($entity)) { + unset($entity->__defaults_set); + $model = $this->object->convert_to_model($entity); + } + // Validate the model + $model->validate(); + if ($model->is_valid()) { + $saved_entity = $model->get_entity(); + unset($saved_entity->_errors); + $retval = $this->object->_save_entity($saved_entity); + } + // We always return the same type of entity that we given + if (get_class($entity) == 'stdClass') { + $model->get_entity(); + } + return $retval; + } + /** + * Gets validation errors for the entity + * @param stdClass|C_DataMapper_Model $entity + * @return array + */ + public function get_errors($entity) + { + $model = $entity; + if (!$this->object->is_model($entity)) { + $model = $this->object->convert_to_model($entity); + } + $model->validate(); + return $model->get_errors(); + } + /** + * Called to set defaults for the record/model/entity. + * Subclasses and adapters should extend this method to provide their + * implementation. The implementation should make use of the + * _set_default_value() method + */ + public function set_defaults() + { + } + public function has_default_values($entity) + { + return isset($entity->__defaults_set) && $entity->__defaults_set == TRUE; + } + /** + * If a field has no value, then use the default value. + * @param stdClass|C_DataMapper_Model $object + */ + public function _set_default_value($object) + { + $array = NULL; + $field = NULL; + $default_value = NULL; + // The first argument MUST be an object + if (!is_object($object)) { + throw new E_InvalidEntityException(); + } + // This method has two signatures: + // 1) _set_default_value($object, $field, $default_value) + // 2) _set_default_value($object, $array_field, $field, $default_value) + // Handle #1 + $args = func_get_args(); + if (count($args) == 4) { + list($object, $array, $field, $default_value) = $args; + if (!isset($object->{$array})) { + $object->{$array} = array(); + $object->{$array}[$field] = NULL; + } else { + $arr =& $object->{$array}; + if (!isset($arr[$field])) { + $arr[$field] = NULL; + } + } + $array =& $object->{$array}; + $value =& $array[$field]; + if ($value === '' or is_null($value)) { + $value = $default_value; + } + } else { + list($object, $field, $default_value) = $args; + if (!isset($object->{$field})) { + $object->{$field} = NULL; + } + $value = $object->{$field}; + if ($value === '' or is_null($value)) { + $object->{$field} = $default_value; + } + } + } + public function define_column($name, $type, $default_value = NULL) + { + $this->object->_columns[$name] = array('type' => $type, 'default_value' => $default_value); + } + public function has_defined_column($name) + { + $columns = $this->object->_columns; + return isset($columns[$name]); + } + public function cast_columns($entity) + { + foreach ($this->object->_columns as $key => $properties) { + $value = property_exists($entity, $key) ? $entity->{$key} : NULL; + $default_value = $properties['default_value']; + if (!is_null($value) && $value !== $default_value) { + $column_type = $this->object->_columns[$key]['type']; + if (preg_match('/varchar|text/i', $column_type)) { + if (!is_array($value) && !is_object($value)) { + $entity->{$key} = strval($value); + } + } else { + if (preg_match('/decimal|numeric|double/i', $column_type)) { + $entity->{$key} = doubleval($value); + } else { + if (preg_match('/float/i', $column_type)) { + $entity->{$key} = floatval($value); + } else { + if (preg_match('/int/i', $column_type)) { + $entity->{$key} = intval($value); + } else { + if (preg_match('/bool/i', $column_type)) { + $entity->{$key} = $value ? TRUE : FALSE; + } + } + } + } + } + } else { + $entity->{$key} = $default_value; + } + } + return $entity; + } +} +class C_CustomPost_DataMapper_Driver extends C_DataMapper_Driver_Base +{ + public $_query_args = array(); + public $_primary_key_column = 'ID'; + static $_post_table_columns = array(); + public $_use_cache = TRUE; + public function define($object_name = FALSE, $context = FALSE) + { + if (strlen($object_name) > 20) { + throw new Exception('The custom post name can be no longer than 20 characters long'); + } + parent::define($object_name, $context); + $this->add_mixin('Mixin_CustomPost_DataMapper_Driver'); + $this->implement('I_CustomPost_DataMapper'); + } + public function lookup_columns() + { + if (empty(self::$_post_table_columns)) { + $columns = parent::lookup_columns(); + foreach ($columns as $column) { + self::$_post_table_columns[] = $column; + } + } else { + foreach (self::$_post_table_columns as $column) { + $this->_table_columns[] = $column; + } + } + } + /** + * Gets the name of the table + * @global string $table_prefix + * @return string + */ + public function get_table_name() + { + global $table_prefix; + return $table_prefix . 'posts'; + } +} +class C_DataMapper_Model extends C_Component +{ + public $_mapper; + public $_stdObject; + /** + * Define the model + */ + public function define($mapper = NULL, $properties = array(), $context = FALSE) + { + parent::define($context); + $this->add_mixin('Mixin_Validation'); + $this->add_mixin('Mixin_DataMapper_Model_Instance_Methods'); + $this->add_mixin('Mixin_DataMapper_Model_Validation'); + $this->implement('I_DataMapper_Model'); + } + /** + * Creates a new entity for the specified mapper + * @param C_DataMapper_Driver_Base $mapper + * @param array|stdClass $properties + * @param string $context + */ + public function initialize($mapper = NULL, $properties = FALSE) + { + $this->_mapper = $mapper; + $this->_stdObject = $properties ? (object) $properties : new stdClass(); + parent::initialize(); + if (!$this->has_default_values()) { + $this->set_defaults(); + $this->_stdObject->__defaults_set = TRUE; + } + } + public function has_default_values() + { + return isset($this->_stdObject->__defaults_set) && $this->_stdObject->__defaults_set == TRUE; + } + /** + * Gets the data mapper for the entity + * @return C_DataMapper_Driver_Base + */ + public function get_mapper() + { + return $this->_mapper; + } + /** + * Gets a property of the model + */ + public function &__get($property) + { + if (isset($this->_stdObject->{$property})) { + $retval =& $this->_stdObject->{$property}; + return $retval; + } else { + // We need to assign NULL to a variable first, since only + // variables can be returned by reference + $retval = NULL; + return $retval; + } + } + /** + * Sets a property for the model + */ + public function &__set($property, $value) + { + $retval = $this->_stdObject->{$property} = $value; + return $retval; + } + public function __isset($property_name) + { + return isset($this->_stdObject->{$property_name}); + } + /** + * Saves the entity + * @param type $updated_attributes + */ + public function save($updated_attributes = array()) + { + $this->update_attributes($updated_attributes); + return $this->get_mapper()->save($this->get_entity()); + } + /** + * Updates the attributes for an object + */ + public function update_attributes($array = array()) + { + foreach ($array as $key => $value) { + $this->_stdObject->{$key} = $value; + } + } + /** + * Sets the default values for this model + */ + public function set_defaults() + { + $mapper = $this->get_mapper(); + if ($mapper->has_method('set_defaults')) { + $mapper->set_defaults($this); + } + } + /** + * Destroys or deletes the entity + */ + public function destroy() + { + return $this->get_mapper()->destroy($this->_stdObject); + } + /** + * Determines whether the object is new or existing + * @return type + */ + public function is_new() + { + return $this->id() ? FALSE : TRUE; + } + /** + * Gets/sets the primary key + */ + public function id($value = NULL) + { + $key = $this->get_mapper()->get_primary_key_column(); + if ($value) { + $this->__set($key, $value); + } + return $this->__get($key); + } +} +/** + * This mixin should be overwritten by other modules + */ +class Mixin_DataMapper_Model_Validation extends Mixin +{ + public function validation() + { + return $this->object->is_valid(); + } +} +class Mixin_DataMapper_Model_Instance_Methods extends Mixin +{ + /** + * Returns the associated entity + */ + public function &get_entity() + { + return $this->object->_stdObject; + } +} \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/dynamic_stylesheet/module.dynamic_stylesheet.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/dynamic_stylesheet/module.dynamic_stylesheet.php index f7e349d902b7e4b43913fc99b96dda54bf6fa1fb..8a3ec5a6a8cd357691c4f0c0136cf8e56cc2633c 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/dynamic_stylesheet/module.dynamic_stylesheet.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/dynamic_stylesheet/module.dynamic_stylesheet.php @@ -3,9 +3,12 @@ /* { Module: photocrati-dynamic_stylesheet, - Depends: { photocrati-mvc, photocrati-lzw } + Depends: { photocrati-mvc } } */ + +if (!defined('NGG_INLINE_DYNAMIC_CSS')) define('NGG_INLINE_DYNAMIC_CSS', TRUE); + class M_Dynamic_Stylesheet extends C_Base_Module { function define($context=FALSE) @@ -21,7 +24,6 @@ class M_Dynamic_Stylesheet extends C_Base_Module $context ); - include_once('class.dynamic_stylesheet_installer.php'); C_Photocrati_Installer::add_handler($this->module_id, 'C_Dynamic_Stylesheet_Installer'); } @@ -32,22 +34,48 @@ class M_Dynamic_Stylesheet extends C_Base_Module ); } - function _register_adapters() + function _register_hooks() + { + add_action('ngg_routes', array(&$this, 'define_routes')); + add_filter('ngg_non_minified_files', array(&$this, 'do_not_minify'), 10, 2); + } + + function do_not_minify($path, $module) { - $this->get_registry()->add_adapter( - 'I_Router', 'A_Dynamic_Stylesheet_Routes' - ); + $retval = FALSE; + + if ($module == $this->module_id) $retval = TRUE; + + return $retval; } + function define_routes($router) + { + $app = $router->create_app('/nextgen-dcss'); + $app->rewrite('/{\d}/{*}', '/index--{1}/data--{2}'); + $app->route('/', 'I_Dynamic_Stylesheet#index'); + } + function get_type_list() { return array( - 'A_Dynamic_Stylesheet_Routes' => 'adapter.dynamic_stylesheet_routes.php', 'C_Dynamic_Stylesheet_Installer' => 'class.dynamic_stylesheet_installer.php', - 'C_Dynamic_Stylesheet_Controller' => 'class.dynamic_stylesheet_controller.php', - 'I_Dynamic_Stylesheet' => 'interface.dynamic_stylesheet.php' + 'C_Dynamic_Stylesheet_Controller' => 'class.dynamic_stylesheet_controller.php' ); } } +class C_Dynamic_Stylesheet_Installer +{ + function __construct() + { + $this->settings = C_NextGen_Settings::get_instance(); + } + + function install() + { + $this->settings->set_default_value('dynamic_stylesheet_slug', 'nextgen-dcss'); + } +} + new M_Dynamic_Stylesheet; diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/dynamic_stylesheet/package.module.dynamic_stylesheet.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/dynamic_stylesheet/package.module.dynamic_stylesheet.php new file mode 100644 index 0000000000000000000000000000000000000000..86ae56f22abe7c6094fda9ecd3bb663de62730a4 --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/dynamic_stylesheet/package.module.dynamic_stylesheet.php @@ -0,0 +1,120 @@ +<?php +class C_Dynamic_Stylesheet_Controller extends C_MVC_Controller +{ + static $_instances = array(); + public $_known_templates = array(); + public $_app = NULL; + public function define($context = FALSE) + { + parent::define($context); + $this->add_mixin('Mixin_Dynamic_Stylesheet_Instance_Methods'); + $this->add_mixin('Mixin_Dynamic_Stylesheet_Actions'); + $this->implement('I_Dynamic_Stylesheet'); + } + public function initialize() + { + parent::initialize(); + $this->_app = C_NextGen_Settings::get_instance()->dynamic_stylesheet_slug; + } + static function &get_instance($context = FALSE) + { + if (!isset(self::$_instances[$context])) { + $klass = get_class(); + self::$_instances[$context] = new $klass($context); + } + return self::$_instances[$context]; + } +} +/** + * Provides instance methods for the dynamic stylesheet utility + */ +class Mixin_Dynamic_Stylesheet_Instance_Methods extends Mixin +{ + /** + * Registers a template with the dynamic stylesheet utility. A template + * must be registered before it can be loaded + * @param string $name + * @param string $template + */ + public function register($name, $template) + { + $this->object->_known_templates[$name] = $template; + } + /** + * Finds a registered template by name + * @param string $name + * @return int + */ + public function get_css_template_index($name) + { + return array_search($name, array_keys($this->object->_known_templates)); + } + public function get_css_template($index) + { + $keys = array_keys($this->object->_known_templates); + return $this->object->_known_templates[$keys[$index]]; + } + /** + * Loads a template, along with the dynamic variables to be interpolated + * @param string $name + * @param array $vars + */ + public function enqueue($name, $data = array()) + { + if (($index = $this->object->get_css_template_index($name)) !== FALSE) { + if (is_subclass_of($data, 'C_DataMapper_Model')) { + $data = $data->get_entity(); + } + if (defined('NGG_INLINE_DYNAMIC_CSS') && NGG_INLINE_DYNAMIC_CSS) { + $css = $this->render_view($this->object->get_css_template($index), $data, TRUE); + wp_enqueue_style('ngg_dyncss', $this->get_static_url('photocrati-dynamic_stylesheet#blank.css')); + wp_add_inline_style('ngg_dyncss', $css); + } else { + $data = $this->object->encode($data); + wp_enqueue_style('dyncss-' . $index . $data . '@dynamic', $this->object->get_router()->get_url("/{$this->object->_app}", FALSE) . "?index={$index}&data={$data}"); + } + } + } + /** + * Encodes $data + * + * base64 encoding uses '==' to denote the end of the sequence, but keep it out of the url + * @param $data + * @return string + */ + public function encode($data) + { + $data = json_encode($data); + $data = base64_encode($data); + $data = str_replace('/', '\\', $data); + $data = rtrim($data, '='); + return $data; + } + /** + * Decodes $data + * + * @param $data + * @return array|mixed + */ + public function decode($data) + { + $data = str_replace('\\', '/', $data); + $data = base64_decode($data . '=='); + $data = json_decode($data); + return $data; + } +} +/** + * Provides controller actions for the dynamic stylesheet + */ +class Mixin_Dynamic_Stylesheet_Actions extends Mixin +{ + public function index_action() + { + $this->set_content_type('css'); + if (($data = $this->param('data')) !== FALSE && ($index = $this->param('index')) !== FALSE) { + $data = $this->object->decode($data); + $this->render_view($this->object->get_css_template($index), $data); + } + } +} \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/dynamic_stylesheet/static/blank.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/dynamic_stylesheet/static/blank.css new file mode 100644 index 0000000000000000000000000000000000000000..85962502b47d27c021f3a792ff05550c0346018a --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/dynamic_stylesheet/static/blank.css @@ -0,0 +1 @@ +/* Intentionally blank */ \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/dynamic_thumbnails/module.dynamic_thumbnails.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/dynamic_thumbnails/module.dynamic_thumbnails.php index 2209802c8960e0fc1f69996111bf37e78825e5d3..88f5c0592bdca6521c5a0960c60dfd0417389fcb 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/dynamic_thumbnails/module.dynamic_thumbnails.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/dynamic_thumbnails/module.dynamic_thumbnails.php @@ -13,41 +13,68 @@ class M_Dynamic_Thumbnails extends C_Base_Module 'photocrati-dynamic_thumbnails', 'Dynamic Thumbnails', 'Adds support for dynamic thumbnails', - '0.5', + '0.6', 'http://www.nextgen-gallery.com', 'Photocrati Media', 'http://www.photocrati.com' ); - include_once('class.dynamic_thumbnails_installer.php'); C_Photocrati_Installer::add_handler($this->module_id, 'C_Dynamic_Thumbnails_Installer'); } function _register_adapters() { - $this->get_registry()->add_adapter('I_Router', 'A_Dynamic_Thumbnail_Routes'); $this->get_registry()->add_adapter('I_GalleryStorage_Driver', 'A_Dynamic_Thumbnails_Storage_Driver'); } function _register_utilities() { $this->get_registry()->add_utility('I_Dynamic_Thumbnails_Manager', 'C_Dynamic_Thumbnails_Manager'); - $this->get_registry()->add_utility('I_Dynamic_Thumbnails_Controller', 'C_Dynamic_Thumbnails_Controller'); + if (apply_filters('ngg_load_frontend_logic', TRUE, $this->module_id)) + $this->get_registry()->add_utility('I_Dynamic_Thumbnails_Controller', 'C_Dynamic_Thumbnails_Controller'); } + function _register_hooks() + { + add_action('ngg_routes', array(&$this, 'define_routes')); + } + + function define_routes($router) + { + $app = $router->create_app('/nextgen-image'); + + // The C_Dynamic_Thumbnails Controller was created before the new + // router implementation was conceptualized. It uses it's own mechanism + // to parse the REQUEST_URI. It should be refactored to use the router's + // parameter mechanism, but for now - we'll just removed the segments + // from the router's visibility, and let the Dynamic Thumbnails Controller + // do it's own parsing + $app->rewrite('/{*}', '/'); + $app->route('/', 'I_Dynamic_Thumbnails_Controller#index'); + } + function get_type_list() { return array( 'A_Dynamic_Thumbnails_Storage_Driver' => 'adapter.dynamic_thumbnails_storage_driver.php', - 'A_Dynamic_Thumbnail_Routes' => 'adapter.dynamic_thumbnail_routes.php', 'C_Dynamic_Thumbnails_Installer' => 'class.dynamic_thumbnails_installer.php', 'C_Dynamic_Thumbnails_Controller' => 'class.dynamic_thumbnails_controller.php', - 'C_Dynamic_Thumbnails_Manager' => 'class.dynamic_thumbnails_manager.php', - 'I_Dynamic_Thumbnails_Controller' => 'interface.dynamic_thumbnails_controller.php', - 'I_Dynamic_Thumbnails_Manager' => 'interface.dynamic_thumbnails_manager.php' + 'C_Dynamic_Thumbnails_Manager' => 'class.dynamic_thumbnails_manager.php' ); } +} +class C_Dynamic_Thumbnails_Installer +{ + function __construct() + { + $this->settings = C_NextGen_Settings::get_instance(); + } + + function install() + { + $this->settings->set_default_value('dynamic_thumbnail_slug', 'nextgen-image'); + } } new M_Dynamic_Thumbnails(); diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/dynamic_thumbnails/package.module.dynamic_thumbnails.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/dynamic_thumbnails/package.module.dynamic_thumbnails.php new file mode 100644 index 0000000000000000000000000000000000000000..9b6016b1c6e7def39e2037b2ada90f178646f856 --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/dynamic_thumbnails/package.module.dynamic_thumbnails.php @@ -0,0 +1,498 @@ +<?php +class A_Dynamic_Thumbnails_Storage_Driver extends Mixin +{ + public function get_image_abspath($image, $size = FALSE, $check_existance = FALSE) + { + $retval = NULL; + $dynthumbs = C_Dynamic_Thumbnails_Manager::get_instance(); + if ($dynthumbs && $dynthumbs->is_size_dynamic($size)) { + // If we have the id, get the actual image entity + if (is_numeric($image)) { + $image = $this->object->_image_mapper->find($image); + } + // Ensure we have the image entity - user could have passed in an + // incorrect id + if (is_object($image)) { + if ($folder_path = $this->object->get_cache_abspath($image->galleryid)) { + $params = $dynthumbs->get_params_from_name($size, true); + $image_filename = $dynthumbs->get_image_name($image, $params); + $image_path = implode(DIRECTORY_SEPARATOR, array(rtrim($folder_path, '\\/'), $image_filename)); + if ($check_existance) { + if (@file_exists($image_path)) { + $retval = $image_path; + } + } else { + $retval = $image_path; + } + } + } + } else { + $retval = $this->call_parent('get_image_abspath', $image, $size, $check_existance); + } + return $retval; + } + public function get_image_url($image, $size = 'full', $check_existance = FALSE) + { + $retval = NULL; + $abspath = FALSE; + $dynthumbs = C_Dynamic_Thumbnails_Manager::get_instance(); + if ($dynthumbs && $dynthumbs->is_size_dynamic($size)) { + $abspath = $this->object->get_image_abspath($image, $size, true); + // If abspath is NULL, then we assume we're dealing with a dynamic image + if ($abspath == null) { + $params = $dynthumbs->get_params_from_name($size, true); + $retval = $dynthumbs->get_image_url($image, $params); + } else { + $check_existance = FALSE; + } + } + if ($retval == null) { + $retval = $this->call_parent('get_image_url', $image, $size, $check_existance, $abspath); + } + // Try generating the thumbnail + if ($retval == null) { + $params = array('watermark' => false, 'reflection' => false, 'crop' => true); + $result = $this->generate_image_size($image, $size, $params); + if ($result) { + $retval = $this->call_parent('get_image_url', $image, $size, $check_existance); + } + } + return $retval; + } + public function get_image_dimensions($image, $size = 'full') + { + $retval = $this->call_parent('get_image_dimensions', $image, $size); + if ($retval == null) { + $dynthumbs = C_Dynamic_Thumbnails_Manager::get_instance(); + if ($dynthumbs && $dynthumbs->is_size_dynamic($size)) { + $new_dims = $this->object->calculate_image_size_dimensions($image, $size); + $retval = array('width' => $new_dims['real_width'], 'height' => $new_dims['real_height']); + } + } + return $retval; + } + public function get_image_size_params($image, $size, $params = null, $skip_defaults = false) + { + $dynthumbs = C_Dynamic_Thumbnails_Manager::get_instance(); + if ($dynthumbs && $dynthumbs->is_size_dynamic($size)) { + $named_params = $dynthumbs->get_params_from_name($size, true); + foreach ($named_params as $param_name => $param_value) { + $params[$param_name] = $param_value; + } + } + return $this->call_parent('get_image_size_params', $image, $size, $params, $skip_defaults); + } +} +class C_Dynamic_Thumbnails_Controller extends C_MVC_Controller +{ + static $_instances = array(); + public function define($context = FALSE) + { + parent::define($context); + $this->implement('I_Dynamic_Thumbnails_Controller'); + } + /** + * Returns an instance of this class + * + * @param string $context + * @return C_Dynamic_Thumbnails_Controller + */ + static function get_instance($context = FALSE) + { + if (!isset(self::$_instances[$context])) { + $klass = get_class(); + self::$_instances[$context] = new $klass($context); + } + return self::$_instances[$context]; + } + public function index_action() + { + $dynthumbs = C_Dynamic_Thumbnails_Manager::get_instance(); + $uri = $_SERVER['REQUEST_URI']; + $params = $dynthumbs->get_params_from_uri($uri); + $request_params = $params; + if ($params != null) { + $storage = C_Gallery_Storage::get_instance(); + // Note, URLs should always include quality setting when returned by Gallery Storage component + // this sanity check is mostly for manually testing URLs + if (!isset($params['quality'])) { + } + $image_id = $params['image']; + $size = $dynthumbs->get_size_name($params); + $abspath = $storage->get_image_abspath($image_id, $size, true); + $valid = true; + // Render invalid image if hash check fails + if ($abspath == null) { + $uri_plain = $dynthumbs->get_uri_from_params($request_params); + $hash = wp_hash($uri_plain); + if (strpos($uri, $hash) === false) { + $valid = false; + $filename = $this->object->find_static_file('invalid_image.png'); + $this->set_content_type('image/png'); + readfile($filename); + $this->render(); + } + } + if ($valid) { + $storage->render_image($image_id, $size); + } + } + } +} +class Mixin_Dynamic_Thumbnails_Manager extends Mixin +{ + public function get_route_name() + { + return C_NextGen_Settings::get_instance()->get('dynamic_thumbnail_slug'); + } + public function _get_params_sanitized($params) + { + if (isset($params['rotation'])) { + $rotation = intval($params['rotation']); + if ($rotation && in_array(abs($rotation), array(90, 180, 270))) { + $rotation = $rotation % 360; + if ($rotation < 0) { + $rotation = 360 - $rotation; + } + $params['rotation'] = $rotation; + } else { + unset($params['rotation']); + } + } + if (isset($params['flip'])) { + $flip = strtolower($params['flip']); + if (in_array($flip, array('h', 'v', 'hv'))) { + $params['flip'] = $flip; + } else { + unset($params['flip']); + } + } + return $params; + } + public function get_uri_from_params($params) + { + $params = $this->object->_get_params_sanitized($params); + $image = isset($params['image']) ? $params['image'] : null; + $image_id = is_scalar($image) ? (int) $image : $image->pid; + $image_width = isset($params['width']) ? $params['width'] : null; + $image_height = isset($params['height']) ? $params['height'] : null; + $image_quality = isset($params['quality']) ? $params['quality'] : null; + $image_type = isset($params['type']) ? $params['type'] : null; + $image_crop = isset($params['crop']) ? $params['crop'] : null; + $image_watermark = isset($params['watermark']) ? $params['watermark'] : null; + $image_rotation = isset($params['rotation']) ? $params['rotation'] : null; + $image_flip = isset($params['flip']) ? $params['flip'] : null; + $image_reflection = isset($params['reflection']) ? $params['reflection'] : null; + $router = C_Router::get_instance(); + $uri = null; + $uri .= '/'; + $uri .= $this->object->get_route_name() . '/'; + $uri .= strval($image_id) . '/'; + $uri .= strval($image_width) . 'x' . strval($image_height); + if ($image_quality != null) { + $uri .= 'x' . strval($image_quality); + } + $uri .= '/'; + if ($image_type != null) { + $uri .= $image_type . '/'; + } + if ($image_crop) { + $uri .= 'crop/'; + } + if ($image_watermark) { + $uri .= 'watermark/'; + } + if ($image_rotation) { + $uri .= 'rotation-' . $image_rotation . '/'; + } + if ($image_flip) { + $uri .= 'flip-' . $image_flip . '/'; + } + if ($image_reflection) { + $uri .= 'reflection/'; + } + return $uri; + } + public function get_image_uri($image, $params) + { + $params['image'] = $image; + $uri = $this->object->get_uri_from_params($params); + if (substr($uri, -1) != '/') { + $uri .= '/'; + } + $uri .= wp_hash($uri) . '/'; + return $uri; + } + public function get_image_url($image, $params) + { + return C_Router::get_instance()->get_url($this->object->get_image_uri($image, $params), FALSE, 'root'); + } + public function get_params_from_uri($uri) + { + $regex = '/\\/?' . $this->object->get_route_name() . '\\/(\\d+)(?:\\/(.*))?/'; + $match = null; + // XXX move this URL clean up to I_Router? + $uri = preg_replace('/\\/index.php\\//', '/', $uri, 1); + $uri = trim($uri, '/'); + if (@preg_match($regex, $uri, $match) > 0) { + $image_id = $match[1]; + $uri_args = isset($match[2]) ? explode('/', $match[2]) : array(); + $params = array('image' => $image_id); + foreach ($uri_args as $uri_arg) { + $uri_arg_set = explode('-', $uri_arg); + $uri_arg_name = array_shift($uri_arg_set); + $uri_arg_value = $uri_arg_set ? array_shift($uri_arg_set) : null; + $size_match = null; + if ($uri_arg == 'watermark') { + $params['watermark'] = true; + } else { + if ($uri_arg_name == 'rotation') { + $params['rotation'] = $uri_arg_value; + } else { + if ($uri_arg_name == 'flip') { + $params['flip'] = $uri_arg_value; + } else { + if ($uri_arg == 'reflection') { + $params['reflection'] = true; + } else { + if ($uri_arg == 'crop') { + $params['crop'] = true; + } else { + if (in_array(strtolower($uri_arg), array('gif', 'jpg', 'png'))) { + $params['type'] = $uri_arg; + } else { + if (preg_match('/(\\d+)x(\\d+)(?:x(\\d+))?/i', $uri_arg, $size_match) > 0) { + $params['width'] = $size_match[1]; + $params['height'] = $size_match[2]; + if (isset($size_match[3])) { + $params['quality'] = $size_match[3]; + } + } + } + } + } + } + } + } + } + return $this->object->_get_params_sanitized($params); + } + return null; + } + public function _get_name_prefix_list() + { + return array('id' => 'nggid0', 'size' => 'ngg0dyn-', 'flags' => '00f0', 'flag' => array('w0' => 'watermark', 'c0' => 'crop', 'r1' => 'rotation', 'f1' => 'flip', 'r0' => 'reflection', 't0' => 'type'), 'flag_len' => 2, 'max_value_length' => 15); + } + public function get_name_from_params($params, $only_size_name = false, $id_in_name = true) + { + $prefix_list = $this->object->_get_name_prefix_list(); + $id_prefix = $prefix_list['id']; + $size_prefix = $prefix_list['size']; + $flags_prefix = $prefix_list['flags']; + $flags = $prefix_list['flag']; + $max_value_length = $prefix_list['max_value_length']; + $params = $this->object->_get_params_sanitized($params); + $image = isset($params['image']) ? $params['image'] : null; + $image_width = isset($params['width']) ? $params['width'] : null; + $image_height = isset($params['height']) ? $params['height'] : null; + $image_quality = isset($params['quality']) ? $params['quality'] : null; + $extension = null; + $name = null; + // if $only_size_name is false then we include the file name and image id for the image + if (!$only_size_name) { + if (is_int($image)) { + $imap = C_Image_Mapper::get_instance(); + $image = $imap->find($image); + } + if ($image != null) { + // this is used to remove the extension and then add it back at the end of the name + $extension = M_I18n::mb_pathinfo($image->filename, PATHINFO_EXTENSION); + if ($extension != null) { + $extension = '.' . $extension; + } + $name .= M_I18n::mb_basename($image->filename, $extension); + $name .= '-'; + if ($id_in_name) { + $image_id = strval($image->pid); + $id_len = min($max_value_length, strlen($image_id)); + $id_len_hex = dechex($id_len); + // sanity check, should never occurr if $max_value_length is not messed up, ensure only 1 character is used to encode length or else skip parameter + if (strlen($id_len_hex) == 1) { + $name .= $id_prefix . $id_len . substr($image_id, 0, $id_len); + $name .= '-'; + } + } + } + } + $name .= $size_prefix; + $name .= strval($image_width) . 'x' . strval($image_height); + if ($image_quality != null) { + $name .= 'x' . $image_quality; + } + $name .= '-'; + $name .= $flags_prefix; + foreach ($flags as $flag_prefix => $flag_name) { + $flag_value = 0; + if (isset($params[$flag_name])) { + $flag_value = $params[$flag_name]; + if (!is_string($flag_value)) { + // only strings or ints allowed, sprintf is required because intval(0) returns '' and not '0' + $flag_value = intval($flag_value); + $flag_value = sprintf('%d', $flag_value); + } + } + $flag_value = strval($flag_value); + $flag_len = min($max_value_length, strlen($flag_value)); + $flag_len_hex = dechex($flag_len); + // sanity check, should never occurr if $max_value_length is not messed up, ensure only 1 character is used to encode length or else skip parameter + if (strlen($flag_len_hex) == 1) { + $name .= $flag_prefix . $flag_len . substr($flag_value, 0, $flag_len); + } + } + $name .= $extension; + return $name; + } + public function get_size_name($params) + { + $name = $this->object->get_name_from_params($params, true); + return $name; + } + public function get_image_name($image, $params) + { + $params['image'] = $image; + $name = $this->object->get_name_from_params($params); + return $name; + } + public function get_params_from_name($name, $is_only_size_name = false) + { + $prefix_list = $this->object->_get_name_prefix_list(); + $id_prefix = $prefix_list['id']; + $size_prefix = $prefix_list['size']; + $flags_prefix = $prefix_list['flags']; + $max_value_length = $prefix_list['max_value_length']; + $size_name = null; + $id_name = null; + $params = array(); + if (!$is_only_size_name) { + $extension = M_I18n::mb_pathinfo($name, PATHINFO_EXTENSION); + if ($extension != null) { + $extension = '.' . $extension; + } + $name = M_I18n::mb_basename($name, $extension); + } + $size_index = strrpos($name, $size_prefix); + if ($size_index > 0 || $size_index === 0) { + // check if name contains dynamic size/params info by looking for prefix + $size_name = substr($name, $size_index); + } + if (!$is_only_size_name) { + // name should contain the image id, search for prefix + $id_index = strrpos($name, $id_prefix); + if ($id_index > 0 || $id_index === 0) { + if ($size_index > 0 && $size_index > $id_index) { + $id_name = substr($name, $id_index, $size_index - $id_index); + } else { + $id_name = substr($name, $id_index); + } + } + } + // Double check we got a correct dynamic size/params string + if (substr($size_name, 0, strlen($size_prefix)) == $size_prefix) { + $flags = $prefix_list['flag']; + // get the length of the flag id (the key in the $flags array) in the string (how many characters to consume) + $flag_id_len = $prefix_list['flag_len']; + $params_str = substr($size_name, strlen($size_prefix)); + $params_parts = explode('-', $params_str); + // $param_part is a single param, separated by '-' + foreach ($params_parts as $param_part) { + // Parse WxHxQ - Q=quality + $param_size = explode('x', $param_part); + $param_size_count = count($param_size); + if (substr($param_part, 0, strlen($flags_prefix)) == $flags_prefix) { + /* Set flags, using $flags keys as prefixes */ + // move string pointer up (after the main flags prefix) + $param_flags = substr($param_part, strlen($flags_prefix)); + $param_flags_len = strlen($param_flags); + $flags_todo = $flags; + while (true) { + // ensure we don't run into an infinite loop ;) + if (count($flags_todo) == 0 || strlen($param_flags) == 0) { + break; + } + // get the flag prefix (a key in the $flags array) using flag id length + $flag_prefix = substr($param_flags, 0, $flag_id_len); + // move string pointer up (after the single flag prefix) + $param_flags = substr($param_flags, $flag_id_len); + // get the length of the flag value in the string (how many characters to consume) + // flag value length is stored in a single hexadecimal character next to the flag prefix + $flag_value_len = min(hexdec(substr($param_flags, 0, 1)), min($max_value_length, strlen($param_flags) - 1)); + // get the flag value + $flag_value = substr($param_flags, 1, $flag_value_len); + // move string pointer up (after the entire flag) + $param_flags = substr($param_flags, $flag_value_len + 1); + // make sure the flag is supported + if (isset($flags[$flag_prefix])) { + $flag_name = $flags[$flag_prefix]; + if (is_numeric($flag_value)) { + // convert numerical flags to integers + $flag_value = intval($flag_value); + } + $params[$flag_name] = $flag_value; + if (isset($flags_todo[$flag_prefix])) { + unset($flags_todo[$flag_prefix]); + } + } else { + } + } + } else { + if ($param_size_count == 2 || $param_size_count == 3) { + // Set W H Q + $params['width'] = intval($param_size[0]); + $params['height'] = intval($param_size[1]); + if (isset($param_size[2]) && intval($param_size[2]) > 0) { + $params['quality'] = intval($param_size[2]); + } + } + } + } + } + // Double check we got a correct id string + if (substr($id_name, 0, strlen($id_prefix)) == $id_prefix) { + // move string pointer up (after the prefix) + $id_name = substr($id_name, strlen($id_prefix)); + // get the length of the image id in the string (how many characters to consume) + $id_len = min(hexdec(substr($id_name, 0, 1)), min($max_value_length, strlen($id_name) - 1)); + // get the id based on old position and id length + $image_id = intval(substr($id_name, 1, $id_len)); + if ($image_id > 0) { + $params['image'] = $image_id; + } + } + return $this->object->_get_params_sanitized($params); + } + public function is_size_dynamic($name, $is_only_size_name = false) + { + $params = $this->object->get_params_from_name($name, $is_only_size_name); + if (isset($params['width']) && isset($params['height'])) { + return true; + } + return false; + } +} +class C_Dynamic_Thumbnails_Manager extends C_Component +{ + static $_instances = array(); + public function define($context = FALSE) + { + parent::define($context); + $this->implement('I_Dynamic_Thumbnails_Manager'); + $this->add_mixin('Mixin_Dynamic_Thumbnails_Manager'); + } + static function get_instance($context = False) + { + if (!isset(self::$_instances[$context])) { + self::$_instances[$context] = new C_Dynamic_Thumbnails_Manager($context); + } + return self::$_instances[$context]; + } +} \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/frame_communication/module.frame_communication.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/frame_communication/module.frame_communication.php index 6d736f97794a5dab46e914799285ec6c35d0c7e7..5fe37aa3dc9ad5f34ffed70d9362a6db341b9119 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/frame_communication/module.frame_communication.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/frame_communication/module.frame_communication.php @@ -22,7 +22,6 @@ class M_Frame_Communication extends C_Base_Module $context ); - include_once('class.frame_communication_option_handler.php'); C_NextGen_Settings::get_instance()->add_option_handler('C_Frame_Communication_Option_Handler', array( 'frame_event_cookie_name', )); @@ -46,7 +45,7 @@ class M_Frame_Communication extends C_Base_Module function enqueue_admin_scripts() { - $router = $this->get_registry()->get_utility('I_Router'); + $router = C_Router::get_instance(); wp_register_script( 'frame_event_publisher', @@ -62,10 +61,17 @@ class M_Frame_Communication extends C_Base_Module { return array( 'C_Frame_Communication_Option_Handler' => 'class.frame_communication_option_handler.php', - 'C_Frame_Event_Publisher' => 'class.frame_event_publisher.php', - 'I_Frame_Event_Publisher' => 'interface.frame_event_publisher.php' + 'C_Frame_Event_Publisher' => 'class.frame_event_publisher.php' ); } } +class C_Frame_Communication_Option_Handler +{ + function get($key, $default='X-Frame-Events') + { + return 'X-Frame-Events'; + } +} + new M_Frame_Communication(); diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/frame_communication/package.module.frame_communication.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/frame_communication/package.module.frame_communication.php new file mode 100644 index 0000000000000000000000000000000000000000..e46abf3514f2e245f53c949f4a1cc4411e0bbcfc --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/frame_communication/package.module.frame_communication.php @@ -0,0 +1,69 @@ +<?php +class C_Frame_Event_Publisher extends C_Component +{ + static $_instances = array(); + public $setting_name = NULL; + public function define($context = FALSE) + { + parent::define($context); + $this->add_mixin('Mixin_Frame_Event_Publisher'); + $this->implement('I_Frame_Event_Publisher'); + } + public function initialize() + { + parent::initialize(); + $this->setting_name = C_NextGen_Settings::get_instance()->frame_event_cookie_name; + } + /** + * Gets an instance of the publisher + * @param string $context + * @return C_Frame_Event_Publisher + */ + static function get_instance($context = FALSE) + { + if (!isset(self::$_instances[$context])) { + $klass = get_class(); + self::$_instances[$context] = new $klass($context); + } + return self::$_instances[$context]; + } +} +class Mixin_Frame_Event_Publisher extends Mixin +{ + /** + * Encodes data for a setting + * @param array $data + * @return string + */ + public function _encode($data) + { + return rawurlencode(json_encode($data)); + } + /** + * Decodes data from a setting + * @param string $data + * @return array + */ + public function _decode($data) + { + return (array) json_decode(rawurldecode($data)); + } + /** + * Adds a setting to the frame events + * @param type $data + * @return type + */ + public function add_event($data) + { + $id = md5(serialize($data)); + $data['context'] = $this->object->context; + $write_cookie = TRUE; + if (defined('XMLRPC_REQUEST')) { + $write_cookie = XMLRPC_REQUEST == FALSE; + } + if ($write_cookie) { + setrawcookie($this->object->setting_name . '_' . $id, $this->object->_encode($data)); + } + return $data; + } +} \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/frame_communication/static/frame_event_publisher.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/frame_communication/static/frame_event_publisher.js index 2246c85b205b20d74b31affe9094190fee18f2ac..dbff6c2a359e840813cfb1d3db00be6dfc01d265 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/frame_communication/static/frame_event_publisher.js +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/frame_communication/static/frame_event_publisher.js @@ -4,6 +4,8 @@ window.Frame_Event_Publisher = { received: [], initialized: false, children: {}, + window: false, + ajax_handlers_setup: false, is_parent: function(){ return self.parent.document === self.document; @@ -14,12 +16,14 @@ window.Frame_Event_Publisher = { }, setup_ajax_handlers: function() { - var publisher = this; - jQuery(document).ajaxComplete(function(e, xhr, settings) { - setTimeout(function() { - publisher.ajax_handler(); - }, 0); - }); + if (!this.ajax_handlers_setup) { + var publisher = this; + jQuery(document).ajaxComplete(function(e, xhr, settings) { + setTimeout(function() { + publisher.ajax_handler(); + }, 0); + }); + } }, ajax_handler: function() { @@ -28,7 +32,9 @@ window.Frame_Event_Publisher = { initialize: function(){ this.setup_ajax_handlers(); - if (this.id.length == 0) this.id = "Unknown"; + this.window = window; + if (typeof(this.window.id) != 'undefined' && this.window.id.length != null && this.window.id.length > 0) this.id = this.window.id; + else this.id == 'Unknown'; this.received = this.get_events(document.cookie); this.initialized = true; if (this.is_parent()) this.emit(this.received, true); @@ -41,15 +47,26 @@ window.Frame_Event_Publisher = { broadcast: function(events, child){ if (!this.initialized) events = this.initialize(); - if (this.is_child()) { - if (arguments.length <= 1) child = window; - this.find_parent(child).register_child(child.Frame_Event_Publisher); - this.notify_parent(events, child); - } - else { - if (arguments.length == 0) events = this.received; - this.notify_children(events); - } + + if (this.id == "Unknown") { + this.initialized = false; + setTimeout(function(){ + this.broadcast(events, child); + }, 100); + } + // Broad cast events + else { + if (this.is_child()) { + if (arguments.length <= 1) child = window; + this.find_parent(child).register_child(child.Frame_Event_Publisher); + this.notify_parent(events, child); + } + else { + if (arguments.length == 0) events = this.received; + this.notify_children(events); + } + } + }, @@ -155,8 +172,8 @@ window.Frame_Event_Publisher = { } }); } -} +}; jQuery(function($){ - Frame_Event_Publisher.broadcast(); + Frame_Event_Publisher.broadcast(); }); diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/frame_communication/static/frame_event_publisher.min.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/frame_communication/static/frame_event_publisher.min.js new file mode 100644 index 0000000000000000000000000000000000000000..6abd3b7ac17fa2f597206bd71c9096c885e55fdf --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/frame_communication/static/frame_event_publisher.min.js @@ -0,0 +1 @@ +eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('b.w={6:b.1c,P:\'X-L-1j\',d:[],z:p,o:{},b:p,14:p,J:4(){j R.K.f===R.f},1b:4(){j!3.J()},16:4(){8(!3.14){5 m=3;x(f).1i(4(e,1f,1e){19(4(){m.18()},0)})}},18:4(){3.q(3.A(f.h))},12:4(){3.16();3.b=b;8(l(3.b.6)!=\'g\'&&3.b.6.r!=1g&&3.b.6.r>0)3.6=3.b.6;I 3.6==\'15\';3.d=3.A(f.h);3.z=13;8(3.J())3.u(3.d,13);j 3.d},S:4(7){3.o[7.6]=7},q:4(a,7){8(!3.z)a=3.12();8(3.6=="15"){3.z=p;19(4(){3.q(a,7)},1d)}I{8(3.1b()){8(W.r<=1)7=b;3.N(7).S(7.w);3.1a(a,7)}I{8(W.r==0)a=3.d;3.17(a)}}},1a:4(a,7){3.N(7).q(a,7)},17:4(a){3.u(a);C(5 M U 3.o){5 7=3.o[M];B{7.u(a)}O(v){8(l(k)!="g")k.H(v);1h 3.o.M}}},N:4(7){5 n=7;B{1m(n.f!==n.K.f)n=n.K}O(v){8(l(k)!="g")k.H(v)}j n.w},u:4(a,s){8(l(s)=="g")s=p;C(5 c U a){5 9=a[c];8(!s&&!3.G(c)){8(l(k)!="g")k.H("1k "+c+":"+9.9+" 1u "+3.6);3.Q(c,a[c])}}},G:4(6){j 3.d[6]!=g},Q:4(6,9){5 t=9.F+\':\'+9.9;9.6=6;8(l(b)!="g")x(b).1y(t,9);3.d[6]=9},A:4(h){5 E={};5 D=h.1A(\' \');B{C(5 i=0;i<D.r;i++){5 11=D[i];5 y=11.1n(/X-L-Y([^=]+)=(.*)/);8(y){5 c=y[1];5 10=y[2].1o(/;$/,\'\');E[c]=1p.1r(1q(10));5 P=\'X-L-Y\'+c;3.Z(P)}}}O(1B){}j E},Z:4(h){5 V=1s 1z();f.h=h+\'=; 1v=\'+V.1x()+\';\'},1l:4(t,T){5 m=3;x(b).1t(t,4(e,9){5 F=9.F;5 c=9.6;8(!m.G(c)){T.1w(m,9);m.d[c]=9}})}};x(4($){w.q()});',62,100,'|||this|function|var|id|child|if|event|events|window|event_id|received||document|undefined|cookie||return|console|typeof|publisher|retval|children|false|broadcast|length|forced|signal|emit|ex|Frame_Event_Publisher|jQuery|parts|initialized|get_events|try|for|cookies|frame_events|context|has_received_event|log|else|is_parent|parent|Frame|index|find_parent|catch|cookie_name|trigger_event|self|register_child|callback|in|date|arguments||Events_|delete_cookie|event_data|current_cookie|initialize|true|ajax_handlers_setup|Unknown|setup_ajax_handlers|notify_children|ajax_handler|setTimeout|notify_parent|is_child|name|100|settings|xhr|null|delete|ajaxComplete|Events|Emitting|listen_for|while|match|replace|JSON|unescape|parse|new|bind|to|expires|call|toGMTString|trigger|Date|split|Exception'.split('|'),0,{})) diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/fs/module.fs.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/fs/module.fs.php index 876256cfac75217c95860fc66931af1e46003116..187a9abcef4294a71409edaa6f1372d3dc29be3a 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/fs/module.fs.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/fs/module.fs.php @@ -27,8 +27,7 @@ class M_Fs extends C_Base_Module function get_type_list() { return array( - 'C_Fs' => 'class.fs.php', - 'I_Fs' => 'interface.fs.php' + 'C_Fs' => 'class.fs.php' ); } } diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/fs/package.module.fs.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/fs/package.module.fs.php new file mode 100644 index 0000000000000000000000000000000000000000..a8bebff23a83e3639f704bd5eb2963997b4c0952 --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/fs/package.module.fs.php @@ -0,0 +1,368 @@ +<?php +class C_Fs extends C_Component +{ + static $_instances = array(); + public $_document_root; + /** + * Gets an instance of the FS utility + * @param mixed $context + * @return C_Fs + */ + static function &get_instance($context = FALSE) + { + if (!isset(self::$_instances[$context])) { + $klass = get_class(); + self::$_instances[$context] = new $klass($context); + } + return self::$_instances[$context]; + } + /** + * Defines the instance of the FS utility + * @param mixed $context the context in this case is the product + */ + public function define($context = FALSE) + { + parent::define($context); + $this->add_mixin('Mixin_Fs_Instance_Methods'); + $this->implement('I_Fs'); + } + public function initialize() + { + parent::initialize(); + $this->_document_root = $this->set_document_root(ABSPATH); + } +} +class Mixin_Fs_Instance_Methods extends Mixin +{ + public function add_trailing_slash($path) + { + return rtrim($path, '/\\') . DIRECTORY_SEPARATOR; + } + /** + * Returns a calculated path to a file + * @param string $path + * @param string $module + * @param boolean $relpath + * @returns string + */ + public function get_abspath($path, $module = FALSE, $relpath = FALSE) + { + // Wel'l assume that we're to calculate the path relative to + // the site document root + $retval = $path; + if (strpos($path, $this->get_document_root()) === FALSE) { + $retval = $this->join_paths($this->get_document_root(), $path); + } + // If a module is provided, then we should calculate the path + // relative to the module directory + if ($module) { + if ($module_dir = $this->get_registry()->get_module_dir($module)) { + $retval = $this->join_paths($module_dir, $path); + } else { + $retval = $this->join_path($this->get_document_root(), $module, $path); + } + } + // Return the calculated path relative to the document root + if ($relpath) { + $retval = $this->object->remove_path_segment($retval, $this->get_document_root()); + } + return $retval; + } + /** + * Returns a calculated relpath to a particular file + * @param string $path + * @param string $module + * @return string + */ + public function get_relpath($path, $module = FALSE) + { + return $this->object->get_abspath($path, $module, TRUE); + } + /** + * Removes a path segment from a url or filesystem path + * @param string $path + * @param string $segment + * @return string + */ + public function remove_path_segment($path, $segment) + { + $parts = explode($segment, rtrim($path, '/\\')); + return $this->join_paths($parts); + } + /** + * Gets the absolute path to a file/directory for a specific Pope product + * + * If the path doesn't exist, then NULL is returned + * @param string $path + * @param string $module + * @returns string|NULL + */ + public function find_abspath($path, $module = FALSE, $relpath = FALSE, $search_paths = array()) + { + $retval = NULL; + // Ensure that we weren't passed a module id in the path + if (!$module) { + list($path, $module) = $this->object->parse_formatted_path($path); + } + if (@file_exists($path)) { + $retval = $path; + } else { + // Ensure that we know where to search for the file + if (!$search_paths) { + $search_paths = $this->object->get_search_paths($path, $module); + } + // See if the file is located under one of the search paths directly + foreach ($search_paths as $dir) { + if (@file_exists($this->join_paths($dir, $path))) { + $retval = $this->join_paths($dir, $path); + break; + } + } + // Use rglob to find the file + if (!$retval) { + foreach ($search_paths as $dir) { + if ($retval = $this->object->_rglob($dir, $path)) { + break; + } + } + } + // Return the relative path if we're to do so + if ($relpath) { + $retval = $this->object->remove_path_segment($retval, $this->get_document_root()); + } + } + return $retval; + } + /** + * Returns a list of directories to search for a particular filename + * @param string $path + * @param string $module + * @return array + */ + public function get_search_paths($path, $module = FALSE) + { + $append_module = FALSE; + // Ensure that we weren't passed a module id in the path + if (!$module) { + list($path, $module) = $this->object->parse_formatted_path($path); + } + // Directories to search + $directories = array(); + // If a name of a module has been provided, then we need to search within + // that directory first + if ($module) { + // Were we given a module id? + if ($module_dir = $this->get_registry()->get_module_dir($module)) { + $directories[] = $module_dir; + } else { + $append_module = TRUE; + } + } + // Add product's module directories + foreach ($this->get_registry()->get_product_list() as $product_id) { + $product_dir = $this->get_registry()->get_product_module_path($product_id); + if ($append_module) { + $directories[] = $this->join_paths($product_dir, $module); + } + $directories[] = $product_dir; + } + // If all else fails, we search from the document root + $directories[] = $this->get_document_root(); + return $directories; + } + /** + * Searches for a file recursively + * + * @param string $base_path + * @param string $file + * @return string + */ + public function _rglob($base_path, $file) + { + $retval = NULL; + $results = @file_exists($this->join_paths($base_path, $file)); + // Must be located in a sub-directory + if (!$results) { + // the modules cache a list of all their files when they are initialized. Ask POPE for our current + // modules and inspect their file listing to determine which module provides what we need + $modules = $this->object->get_registry()->get_module_list(); + foreach ($modules as $module) { + $module_file_list = array_values($this->object->get_registry()->get_module($module)->get_type_list()); + $module_dir = $this->object->get_registry()->get_module_dir($module); + $variations = array($file, ltrim($file, DIRECTORY_SEPARATOR)); + foreach ($variations as $variant) { + if (in_array($variant, $module_file_list)) { + $retval = $this->join_paths($module_dir, $variant); + break 2; + } + } + } + } else { + $retval = $this->join_paths($base_path, $file); + } + return $retval; + } + /** + * Gets the relative path to a file/directory for a specific Pope product. + * If the path doesn't exist, then NULL is returned + * @param type $path + * @param type $module + * @returns string|NULL + */ + public function find_relpath($path, $module = FALSE) + { + return $this->object->find_abspath($path, $module, TRUE); + } + public function delete($abspath) + { + $retval = FALSE; + if (file_exists($abspath)) { + // Delete single file + if (is_file($abspath)) { + @unlink($abspath); + } else { + foreach (scandir($abspath) as $relpath) { + if (in_array($relpath, array('.', '..'))) { + continue; + } + $sub_abspath = $this->join_paths($abspath, $relpath); + $this->object->delete($sub_abspath); + } + } + $retval = !file_exists($abspath); + } + return $retval; + } + /** + * Joins multiple path segments together + * @return string + */ + public function join_paths() + { + $segments = array(); + $retval = array(); + $protocol = NULL; + $params = func_get_args(); + $this->_flatten_array($params, $segments); + foreach ($segments as $segment) { + $segment = trim($segment, '/\\'); + $pieces = array_values(preg_split('#[/\\\\]#', $segment)); + // determine if each piece should be appended to $retval + foreach ($pieces as $ndx => $val) { + if ($val === '') { + continue; + } + $one = array_search($val, $retval); + $two = array_search($val, $pieces); + $one = FALSE === $one ? 0 : count($one) + 1; + $two = FALSE === $two ? 0 : count($two) + 1; + if (!empty($protocol)) { + $existing_val = isset($retval[$ndx]) ? $retval[$ndx] : NULL; + if ($existing_val !== $val || $two >= $one) { + $retval[] = $val; + } + } else { + $existing_val = isset($retval[$ndx]) ? $retval[$ndx] : NULL; + if ($existing_val !== $val && $two >= $one) { + $retval[] = $val; + } + } + } + } + // Join the paths together + $retval = implode(DIRECTORY_SEPARATOR, $retval); + if (strpos($retval, $this->get_document_root()) !== 0) { + $retval = DIRECTORY_SEPARATOR . trim($retval, '/\\'); + } + return $retval; + } + public function _flatten_array($obj, &$arr) + { + if (is_array($obj)) { + foreach ($obj as $inner_obj) { + $this->_flatten_array($inner_obj, $arr); + } + } elseif ($obj) { + $arr[] = $obj; + } + } + /** + * Parses the path for a module and filename + * @param string $str + */ + public function parse_formatted_path($str) + { + $module = FALSE; + $path = $str; + $parts = explode('#', $path); + if (count($parts) > 1) { + $module = array_shift($parts); + $path = array_shift($parts); + } + return array($path, $module); + } + /** + * Gets the document root for this application + * @return string + */ + public function get_document_root($type = 'root') + { + $retval = NULL; + switch ($type) { + case 'plugins': + case 'plugin': + $retval = WP_PLUGIN_DIR; + break; + case 'plugins_mu': + case 'plugin_mu': + $retval = WPMU_PLUGIN_DIR; + break; + case 'templates': + case 'template': + case 'themes': + case 'theme': + $retval = get_template_directory(); + break; + case 'styles': + case 'style': + case 'stylesheets': + case 'stylesheet': + $retval = get_stylesheet_directory(); + break; + case 'content': + $retval = WP_CONTENT_DIR; + break; + case 'gallery': + case 'galleries': + $root_type = defined('NGG_GALLERY_ROOT_TYPE') ? NGG_GALLERY_ROOT_TYPE : 'site'; + if ($root_type == 'content') { + $retval = WP_CONTENT_DIR; + } else { + $retval = $this->_document_root; + } + break; + default: + $retval = $this->_document_root; + } + if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { + $retval = str_replace('/', DIRECTORY_SEPARATOR, $retval); + } + return $retval; + } + /** + * Sets the document root for this application + * @param type $value + * @return type + */ + public function set_document_root($value) + { + // some web servers like home.pl and PhpStorm put the document root in "/" or (even weirder) "//" + if ($value == DIRECTORY_SEPARATOR . DIRECTORY_SEPARATOR) { + $value = DIRECTORY_SEPARATOR; + } + if ($value !== DIRECTORY_SEPARATOR) { + $value = rtrim($value, '/\\'); + } + return $this->_document_root = $value; + } +} \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/i18n/lang/nggallery-el.mo b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/i18n/lang/nggallery-el.mo new file mode 100644 index 0000000000000000000000000000000000000000..afc2d2ce920b760aefc89a5c08a66497ca8be4bf Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/i18n/lang/nggallery-el.mo differ diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/i18n/lang/nggallery-pl_PL.mo b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/i18n/lang/nggallery-pl_PL.mo new file mode 100644 index 0000000000000000000000000000000000000000..50d6a06de3959f608c1af733657f69c5c02765ea Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/i18n/lang/nggallery-pl_PL.mo differ diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/i18n/lang/nggallery-ru_RU.mo b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/i18n/lang/nggallery-ru_RU.mo index fb0346e0b9d5ef910ab920ee0d295e7d52865234..e45671be3371a84be711606a82f2451fe3d3c5d7 100644 Binary files a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/i18n/lang/nggallery-ru_RU.mo and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/i18n/lang/nggallery-ru_RU.mo differ diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/i18n/lang/nggallery-uk.mo b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/i18n/lang/nggallery-uk.mo new file mode 100644 index 0000000000000000000000000000000000000000..775fd2d98e2a845c9b63f7fc187c57ac9fa0bdcb Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/i18n/lang/nggallery-uk.mo differ diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/i18n/lang/nggallery.po b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/i18n/lang/nggallery.po index 0e9b8abd3bd85135fe59353e7e3624004532c097..6ad7352e2142551ebfbed0de846ad876fa02a220 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/i18n/lang/nggallery.po +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/i18n/lang/nggallery.po @@ -1,110 +1,122 @@ # NextGEN Gallery base (English) .po source -# Copyright (C) 2014 Photocrati Media +# Copyright (C) 2015 Photocrati Media # This file is distributed under the same license as the NextGEN Gallery package. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: NextGEN Gallery\n" -"Report-Msgid-Bugs-To: \n" +"Report-Msgid-Bugs-To: http://wordpress.org/support/plugin/nextgen-gallery\n" "POT-Creation-Date: 2014-02-20 19:45-0800\n" -"PO-Revision-Date: 2014-02-20 19:45-0800\n" +"PO-Revision-Date: 2015-01-15 15:04+08\n" "Last-Translator: Photocrati Media\n" "Language-Team: Photocrati Media\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: nggallery.php:290 +#: nggallery.php:289 +#, php-format +msgid "NextGEN Gallery %s is incompatible with this version of NextGEN Pro. Please update NextGEN Pro to version %s or higher to restore NextGEN Gallery functionality." +msgstr "" + +#: nggallery.php:372 #, php-format msgid "Every %d seconds" msgstr "" -#: products/photocrati_nextgen/modules/attach_to_post/adapter.attach_to_post_ajax.php:157 +#: products/photocrati_nextgen/modules/attach_to_post/adapter.attach_to_post_ajax.php:160 #, php-format msgid "Album: %s" msgstr "" -#: products/photocrati_nextgen/modules/attach_to_post/adapter.attach_to_post_ajax.php:159 +#: products/photocrati_nextgen/modules/attach_to_post/adapter.attach_to_post_ajax.php:162 #, php-format msgid "Gallery: %s" msgstr "" -#: products/photocrati_nextgen/modules/attach_to_post/adapter.attach_to_post_ajax.php:177 +#: products/photocrati_nextgen/modules/attach_to_post/adapter.attach_to_post_ajax.php:180 msgid "Missing parameters" msgstr "" -#: products/photocrati_nextgen/modules/attach_to_post/adapter.attach_to_post_ajax.php:213 +#: products/photocrati_nextgen/modules/attach_to_post/adapter.attach_to_post_ajax.php:216 msgid "Displayed gallery does not exist" msgstr "" -#: products/photocrati_nextgen/modules/attach_to_post/adapter.attach_to_post_ajax.php:216 +#: products/photocrati_nextgen/modules/attach_to_post/adapter.attach_to_post_ajax.php:219 msgid "Invalid request" msgstr "" -#: products/photocrati_nextgen/modules/attach_to_post/class.attach_controller.php:248 +#: products/photocrati_nextgen/modules/attach_to_post/class.attach_controller.php:263 msgid "NextGEN Gallery - Attach To Post" msgstr "" -#: products/photocrati_nextgen/modules/attach_to_post/class.attach_controller.php:266 +#: products/photocrati_nextgen/modules/attach_to_post/class.attach_controller.php:281 msgid "Display Galleries" msgstr "" -#: products/photocrati_nextgen/modules/attach_to_post/class.attach_controller.php:273 +#: products/photocrati_nextgen/modules/attach_to_post/class.attach_controller.php:288 #: products/photocrati_nextgen/modules/nextgen_addgallery_page/adapter.nextgen_addgallery_controller.php:7 #: products/photocrati_nextgen/modules/ngglegacy/admin/admin.php:188 msgid "Add Gallery / Images" msgstr "" -#: products/photocrati_nextgen/modules/attach_to_post/class.attach_controller.php:280 +#: products/photocrati_nextgen/modules/attach_to_post/class.attach_controller.php:295 #: products/photocrati_nextgen/modules/ngglegacy/admin/admin.php:156 #: products/photocrati_nextgen/modules/ngglegacy/admin/admin.php:190 +#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-galleries.php:167 msgid "Manage Galleries" msgid_plural "Manage Galleries" msgstr[0] "" msgstr[1] "" -#: products/photocrati_nextgen/modules/attach_to_post/class.attach_controller.php:287 -#: products/photocrati_nextgen/modules/ngglegacy/admin/album.php:404 +#: products/photocrati_nextgen/modules/attach_to_post/class.attach_controller.php:302 +#: products/photocrati_nextgen/modules/ngglegacy/admin/admin.php:157 +#: products/photocrati_nextgen/modules/ngglegacy/admin/admin.php:192 +#: products/photocrati_nextgen/modules/ngglegacy/admin/album.php:437 msgid "Manage Albums" msgid_plural "Manage Albums" msgstr[0] "" msgstr[1] "" -#: products/photocrati_nextgen/modules/attach_to_post/class.attach_controller.php:294 +#: products/photocrati_nextgen/modules/attach_to_post/class.attach_controller.php:309 #: products/photocrati_nextgen/modules/ngglegacy/admin/admin.php:158 #: products/photocrati_nextgen/modules/ngglegacy/admin/admin.php:194 msgid "Manage Tags" msgstr "" -#: products/photocrati_nextgen/modules/attach_to_post/mixin.attach_to_post_display_tab.php:115 +#: products/photocrati_nextgen/modules/attach_to_post/mixin.attach_to_post_display_tab.php:119 msgid "What would you like to display?" msgstr "" -#: products/photocrati_nextgen/modules/attach_to_post/mixin.attach_to_post_display_tab.php:139 +#: products/photocrati_nextgen/modules/attach_to_post/mixin.attach_to_post_display_tab.php:143 msgid "Select a display type" msgstr "" -#: products/photocrati_nextgen/modules/attach_to_post/mixin.attach_to_post_display_tab.php:162 +#: products/photocrati_nextgen/modules/attach_to_post/mixin.attach_to_post_display_tab.php:166 msgid "Customize the display settings" msgstr "" -#: products/photocrati_nextgen/modules/attach_to_post/mixin.attach_to_post_display_tab.php:253 +#: products/photocrati_nextgen/modules/attach_to_post/mixin.attach_to_post_display_tab.php:257 msgid "No display type selected" msgstr "" -#: products/photocrati_nextgen/modules/attach_to_post/mixin.attach_to_post_display_tab.php:271 +#: products/photocrati_nextgen/modules/attach_to_post/mixin.attach_to_post_display_tab.php:275 msgid "Sort or Exclude Images" msgstr "" -#: products/photocrati_nextgen/modules/attach_to_post/module.attach_to_post.php:192 +#: products/photocrati_nextgen/modules/attach_to_post/module.attach_to_post.php:232 msgid "Invalid Displayed Gallery" msgstr "" -#: products/photocrati_nextgen/modules/attach_to_post/module.attach_to_post.php:299 +#: products/photocrati_nextgen/modules/attach_to_post/module.attach_to_post.php:347 msgid "Attach NextGEN Gallery to Post" msgstr "" +#: products/photocrati_nextgen/modules/attach_to_post/templates/attach_to_post.php:12 +msgid "NextGEN" +msgstr "" + #: products/photocrati_nextgen/modules/attach_to_post/templates/display_tab.php:10 #: products/photocrati_nextgen/modules/nextgen_admin/templates/nextgen_admin_page.php:25 msgid "Save" @@ -120,9 +132,7 @@ msgid "(optional)" msgstr "" #: products/photocrati_nextgen/modules/attach_to_post/templates/display_tab_js.php:657 -msgid "" -"Sets an SEO-friendly name to this gallery for URLs. Currently only in use by " -"the Pro Lightbox." +msgid "Sets an SEO-friendly name to this gallery for URLs. Currently only in use by the Pro Lightbox." msgstr "" #: products/photocrati_nextgen/modules/attach_to_post/templates/display_tab_js.php:658 @@ -138,157 +148,208 @@ msgid "Select a gallery" msgstr "" #: products/photocrati_nextgen/modules/attach_to_post/templates/display_tab_js.php:1293 +#: products/photocrati_nextgen/modules/nextgen_gallery_display/class.displayed_gallery_source_manager.php:31 msgid "Galleries" msgstr "" #: products/photocrati_nextgen/modules/attach_to_post/templates/display_tab_js.php:1317 +#: products/photocrati_nextgen/modules/nextgen_gallery_display/class.displayed_gallery_source_manager.php:39 msgid "Albums" msgstr "" -#: products/photocrati_nextgen/modules/lightbox/adapter.lightbox_library_form.php:34 +#: products/photocrati_nextgen/modules/nextgen_other_options/adapter.custom_lightbox_form.php:31 msgid "Code" msgstr "" -#: products/photocrati_nextgen/modules/lightbox/adapter.lightbox_library_form.php:48 +#: products/photocrati_nextgen/modules/nextgen_other_options/adapter.custom_lightbox_form.php:45 msgid "Stylesheet URL" msgstr "" -#: products/photocrati_nextgen/modules/lightbox/adapter.lightbox_library_form.php:62 +#: products/photocrati_nextgen/modules/nextgen_other_options/adapter.custom_lightbox_form.php:59 msgid "Javascript URL" msgstr "" -#: products/photocrati_nextgen/modules/lightbox/class.lightbox_installer.php:122 +#: products/photocrati_nextgen/modules/lightbox/class.lightbox_library_manager.php:29 +#: products/photocrati_nextgen/modules/nextgen_basic_singlepic/adapter.nextgen_basic_singlepic_form.php:127 +#: products/photocrati_nextgen/modules/ngglegacy/admin/media-upload.php:252 +#: products/photocrati_nextgen/modules/ngglegacy/admin/publish.php:47 +msgid "None" +msgstr "" + +#: products/photocrati_nextgen/modules/lightbox/class.lightbox_library_manager.php:34 +msgid "jQuery Lightbox" +msgstr "" + +#: products/photocrati_nextgen/modules/lightbox/class.lightbox_library_manager.php:81 msgid "ltr" msgstr "" -#: products/photocrati_nextgen/modules/lightbox/class.lightbox_installer.php:123 -#: products/photocrati_nextgen/modules/lightbox/class.lightbox_installer.php:180 +#: products/photocrati_nextgen/modules/lightbox/class.lightbox_library_manager.php:82 +#: products/photocrati_nextgen/modules/lightbox/class.lightbox_library_manager.php:147 msgid "Loading..." msgstr "" -#: products/photocrati_nextgen/modules/lightbox/class.lightbox_installer.php:124 -#: products/photocrati_nextgen/modules/lightbox/class.lightbox_installer.php:173 +#: products/photocrati_nextgen/modules/lightbox/class.lightbox_library_manager.php:83 +#: products/photocrati_nextgen/modules/lightbox/class.lightbox_library_manager.php:140 msgid "Previous" msgstr "" -#: products/photocrati_nextgen/modules/lightbox/class.lightbox_installer.php:125 -#: products/photocrati_nextgen/modules/lightbox/class.lightbox_installer.php:174 +#: products/photocrati_nextgen/modules/lightbox/class.lightbox_library_manager.php:84 +#: products/photocrati_nextgen/modules/lightbox/class.lightbox_library_manager.php:141 +#: products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/templates/nextgen_basic_imagebrowser.php:49 +#: products/photocrati_nextgen/modules/ngglegacy/view/imagebrowser-caption.php:29 +#: products/photocrati_nextgen/modules/ngglegacy/view/imagebrowser-exif.php:33 +#: products/photocrati_nextgen/modules/ngglegacy/view/imagebrowser.php:29 msgid "Next" msgstr "" -#: products/photocrati_nextgen/modules/lightbox/class.lightbox_installer.php:126 -#: products/photocrati_nextgen/modules/lightbox/class.lightbox_installer.php:131 +#: products/photocrati_nextgen/modules/lightbox/class.lightbox_library_manager.php:85 +#: products/photocrati_nextgen/modules/lightbox/class.lightbox_library_manager.php:90 msgid "Move" msgstr "" -#: products/photocrati_nextgen/modules/lightbox/class.lightbox_installer.php:127 -#: products/photocrati_nextgen/modules/lightbox/class.lightbox_installer.php:175 -#: products/photocrati_nextgen/modules/lightbox/class.lightbox_installer.php:198 +#: products/photocrati_nextgen/modules/lightbox/class.lightbox_library_manager.php:86 +#: products/photocrati_nextgen/modules/lightbox/class.lightbox_library_manager.php:142 +#: products/photocrati_nextgen/modules/lightbox/class.lightbox_library_manager.php:169 msgid "Close" msgstr "" -#: products/photocrati_nextgen/modules/lightbox/class.lightbox_installer.php:128 +#: products/photocrati_nextgen/modules/lightbox/class.lightbox_library_manager.php:87 msgid "Resize" msgstr "" -#: products/photocrati_nextgen/modules/lightbox/class.lightbox_installer.php:129 +#: products/photocrati_nextgen/modules/lightbox/class.lightbox_library_manager.php:88 msgid "Play" msgstr "" -#: products/photocrati_nextgen/modules/lightbox/class.lightbox_installer.php:130 +#: products/photocrati_nextgen/modules/lightbox/class.lightbox_library_manager.php:89 msgid "Pause" msgstr "" -#: products/photocrati_nextgen/modules/lightbox/class.lightbox_installer.php:132 +#: products/photocrati_nextgen/modules/lightbox/class.lightbox_library_manager.php:91 msgid "1:1" msgstr "" -#: products/photocrati_nextgen/modules/lightbox/class.lightbox_installer.php:133 +#: products/photocrati_nextgen/modules/lightbox/class.lightbox_library_manager.php:92 msgid "Close (esc)" msgstr "" -#: products/photocrati_nextgen/modules/lightbox/class.lightbox_installer.php:134 +#: products/photocrati_nextgen/modules/lightbox/class.lightbox_library_manager.php:93 msgid "Pause slideshow (spacebar)" msgstr "" -#: products/photocrati_nextgen/modules/lightbox/class.lightbox_installer.php:135 +#: products/photocrati_nextgen/modules/lightbox/class.lightbox_library_manager.php:94 msgid "Click to cancel" msgstr "" -#: products/photocrati_nextgen/modules/lightbox/class.lightbox_installer.php:136 +#: products/photocrati_nextgen/modules/lightbox/class.lightbox_library_manager.php:95 msgid "Click to bring to front" msgstr "" -#: products/photocrati_nextgen/modules/lightbox/class.lightbox_installer.php:137 +#: products/photocrati_nextgen/modules/lightbox/class.lightbox_library_manager.php:96 msgid "Expand to actual size (f)" msgstr "" -#: products/photocrati_nextgen/modules/lightbox/class.lightbox_installer.php:138 +#: products/photocrati_nextgen/modules/lightbox/class.lightbox_library_manager.php:97 msgid "Powered by Highslide JS" msgstr "" -#: products/photocrati_nextgen/modules/lightbox/class.lightbox_installer.php:139 +#: products/photocrati_nextgen/modules/lightbox/class.lightbox_library_manager.php:98 msgid "Play slideshow (spacebar)" msgstr "" -#: products/photocrati_nextgen/modules/lightbox/class.lightbox_installer.php:140 +#: products/photocrati_nextgen/modules/lightbox/class.lightbox_library_manager.php:99 msgid "Previous (arrow left)" msgstr "" -#: products/photocrati_nextgen/modules/lightbox/class.lightbox_installer.php:141 +#: products/photocrati_nextgen/modules/lightbox/class.lightbox_library_manager.php:100 msgid "Next (arrow right)" msgstr "" -#: products/photocrati_nextgen/modules/lightbox/class.lightbox_installer.php:142 +#: products/photocrati_nextgen/modules/lightbox/class.lightbox_library_manager.php:101 msgid "Image %1 of %2" msgstr "" -#: products/photocrati_nextgen/modules/lightbox/class.lightbox_installer.php:143 +#: products/photocrati_nextgen/modules/lightbox/class.lightbox_library_manager.php:102 msgid "Go to the Highslide JS homepage" msgstr "" -#: products/photocrati_nextgen/modules/lightbox/class.lightbox_installer.php:144 +#: products/photocrati_nextgen/modules/lightbox/class.lightbox_library_manager.php:103 msgid "Click to close image, click and drag to move. Use arrow keys for next and previous." msgstr "" -#: products/photocrati_nextgen/modules/lightbox/class.lightbox_installer.php:158 +#: products/photocrati_nextgen/modules/lightbox/class.lightbox_library_manager.php:55 +msgid "Fancybox" +msgstr "" + +#: products/photocrati_nextgen/modules/lightbox/class.lightbox_library_manager.php:69 +msgid "Highslide" +msgstr "" + +#: products/photocrati_nextgen/modules/lightbox/class.lightbox_library_manager.php:110 +msgid "Shutter" +msgstr "" + +#: products/photocrati_nextgen/modules/lightbox/class.lightbox_library_manager.php:121 +#: products/photocrati_nextgen/modules/ngglegacy/admin/admin.php:299 msgid "L O A D I N G" msgstr "" -#: products/photocrati_nextgen/modules/lightbox/class.lightbox_installer.php:159 +#: products/photocrati_nextgen/modules/lightbox/class.lightbox_library_manager.php:122 +#: products/photocrati_nextgen/modules/ngglegacy/admin/admin.php:300 msgid "Click to Close" msgstr "" -#: products/photocrati_nextgen/modules/lightbox/class.lightbox_installer.php:176 +#: products/photocrati_nextgen/modules/lightbox/class.lightbox_library_manager.php:129 +msgid "Shutter Reloaded" +msgstr "" + +#: products/photocrati_nextgen/modules/lightbox/class.lightbox_library_manager.php:143 msgid "Full Size" msgstr "" -#: products/photocrati_nextgen/modules/lightbox/class.lightbox_installer.php:177 +#: products/photocrati_nextgen/modules/lightbox/class.lightbox_library_manager.php:144 msgid "Fit to Screen" msgstr "" -#: products/photocrati_nextgen/modules/lightbox/class.lightbox_installer.php:178 -#: products/photocrati_nextgen/modules/lightbox/class.lightbox_installer.php:196 +#: products/photocrati_nextgen/modules/lightbox/class.lightbox_library_manager.php:145 +#: products/photocrati_nextgen/modules/lightbox/class.lightbox_library_manager.php:167 +#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-galleries.php:460 +#: products/photocrati_nextgen/modules/ngglegacy/admin/overview.php:308 msgid "Image" msgstr "" -#: products/photocrati_nextgen/modules/lightbox/class.lightbox_installer.php:179 -#: products/photocrati_nextgen/modules/lightbox/class.lightbox_installer.php:197 +#: products/photocrati_nextgen/modules/lightbox/class.lightbox_library_manager.php:146 +#: products/photocrati_nextgen/modules/lightbox/class.lightbox_library_manager.php:168 +#: products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/templates/nextgen_basic_imagebrowser.php:55 +#: products/photocrati_nextgen/modules/ngglegacy/view/imagebrowser-caption.php:31 +#: products/photocrati_nextgen/modules/ngglegacy/view/imagebrowser-exif.php:35 +#: products/photocrati_nextgen/modules/ngglegacy/view/imagebrowser.php:31 msgid "of" msgstr "" -#: products/photocrati_nextgen/modules/lightbox/class.lightbox_installer.php:194 +#: products/photocrati_nextgen/modules/lightbox/class.lightbox_library_manager.php:165 msgid "Next >" msgstr "" -#: products/photocrati_nextgen/modules/lightbox/class.lightbox_installer.php:195 +#: products/photocrati_nextgen/modules/lightbox/class.lightbox_library_manager.php:166 msgid "< Prev" msgstr "" -#: products/photocrati_nextgen/modules/lightbox/class.lightbox_installer.php:199 +#: products/photocrati_nextgen/modules/lightbox/class.lightbox_library_manager.php:170 msgid "This feature requires inline frames. You have iframes disabled or your browser does not support them." msgstr "" +#: products/photocrati_nextgen/modules/lightbox/class.lightbox_library_manager.php:110 +msgid "Thickbox" +msgstr "" + +#: products/photocrati_nextgen/modules/lightbox/class.lightbox_library_manager.php:180 +#: products/photocrati_nextgen/modules/nextgen_other_options/adapter.image_options_form.php:22 +#: products/photocrati_nextgen/modules/ngglegacy/admin/thumbnails-template.php:76 +msgid "Custom" +msgstr "" + #: products/photocrati_nextgen/modules/nextgen_addgallery_page/adapter.import_folder_form.php:7 #: products/photocrati_nextgen/modules/nextgen_addgallery_page/templates/import_folder.php:6 msgid "Import Folder" @@ -307,14 +368,12 @@ msgid "Image generation failed" msgstr "" #: products/photocrati_nextgen/modules/nextgen_addgallery_page/adapter.nextgen_addgallery_ajax.php:73 -#: products/photocrati_nextgen/modules/nextgen_addgallery_page/adapter.nextgen_addgallery_ajax.php:160 +#: products/photocrati_nextgen/modules/nextgen_addgallery_page/adapter.nextgen_addgallery_ajax.php:159 msgid "An unexpected error occured." msgstr "" #: products/photocrati_nextgen/modules/nextgen_addgallery_page/adapter.nextgen_addgallery_ajax.php:80 -msgid "" -"No permissions to upload images. Try refreshing the page or ensuring that " -"your user account has sufficient roles/privileges." +msgid "No permissions to upload images. Try refreshing the page or ensuring that your user account has sufficient roles/privileges." msgstr "" #: products/photocrati_nextgen/modules/nextgen_addgallery_page/adapter.nextgen_addgallery_ajax.php:123 @@ -326,19 +385,15 @@ msgid "No directory specified." msgstr "" #: products/photocrati_nextgen/modules/nextgen_addgallery_page/adapter.nextgen_addgallery_ajax.php:131 -msgid "" -"No permissions to browse folders. Try refreshing the page or ensuring that " -"your user account has sufficient roles/privileges." +msgid "No permissions to browse folders. Try refreshing the page or ensuring that your user account has sufficient roles/privileges." msgstr "" -#: products/photocrati_nextgen/modules/nextgen_addgallery_page/adapter.nextgen_addgallery_ajax.php:165 +#: products/photocrati_nextgen/modules/nextgen_addgallery_page/adapter.nextgen_addgallery_ajax.php:163 msgid "No folder specified" msgstr "" -#: products/photocrati_nextgen/modules/nextgen_addgallery_page/adapter.nextgen_addgallery_ajax.php:169 -msgid "" -"No permissions to import folders. Try refreshing the page or ensuring that " -"your user account has sufficient roles/privileges." +#: products/photocrati_nextgen/modules/nextgen_addgallery_page/adapter.nextgen_addgallery_ajax.php:166 +msgid "No permissions to import folders. Try refreshing the page or ensuring that your user account has sufficient roles/privileges." msgstr "" #: products/photocrati_nextgen/modules/nextgen_addgallery_page/adapter.upload_images_form.php:7 @@ -346,9 +401,7 @@ msgid "Upload Images" msgstr "" #: products/photocrati_nextgen/modules/nextgen_addgallery_page/templates/import_folder.php:1 -msgid "" -"Select a folder to import. The folder name will be used as the title of the " -"gallery." +msgid "Select a folder to import. The folder name will be used as the title of the gallery." msgstr "" #: products/photocrati_nextgen/modules/nextgen_addgallery_page/templates/import_folder.php:5 @@ -356,10 +409,7 @@ msgid "Keep images in original location." msgstr "" #: products/photocrati_nextgen/modules/nextgen_addgallery_page/templates/import_folder.php:5 -msgid "" -"Caution: If you keep images in the original folder and later delete the " -"gallery, the images in that folder might be deleted depending on your " -"settings." +msgid "Caution: If you keep images in the original folder and later delete the gallery, the images in that folder might be deleted depending on your settings." msgstr "" #: products/photocrati_nextgen/modules/nextgen_addgallery_page/templates/import_folder.php:39 @@ -375,10 +425,19 @@ msgstr "" msgid "Done! Successfully imported %s images" msgstr "" +#: products/photocrati_nextgen/modules/attach_to_post/templates/attach_to_post.php:12 #: products/photocrati_nextgen/modules/nextgen_addgallery_page/templates/upload_images.php:2 +#: products/photocrati_nextgen/modules/ngglegacy/admin/admin.php:154 +#: products/photocrati_nextgen/modules/ngglegacy/admin/admin.php:167 #: products/photocrati_nextgen/modules/ngglegacy/admin/admin.php:185 +#: products/photocrati_nextgen/modules/ngglegacy/admin/admin.php:375 +#: products/photocrati_nextgen/modules/ngglegacy/admin/admin.php:432 +#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-galleries.php:456 +#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-images.php:285 +#: products/photocrati_nextgen/modules/ngglegacy/admin/overview.php:314 #: products/photocrati_nextgen/modules/ngglegacy/lib/rewrite.php:217 #: products/photocrati_nextgen/modules/ngglegacy/lib/rewrite.php:226 +#, php-format msgid "Gallery" msgid_plural "Galleries" msgstr[0] "" @@ -389,40 +448,40 @@ msgid "Create a new gallery" msgstr "" #: products/photocrati_nextgen/modules/nextgen_addgallery_page/templates/upload_images.php:13 -msgid "You browser doesn't have Flash, Silverlight, HTML5, or HTML4 support." +msgid "Your browser doesn't have Flash, Silverlight, HTML5, or HTML4 support." msgstr "" -#: products/photocrati_nextgen/modules/nextgen_addgallery_page/templates/upload_images.php:99 +#: products/photocrati_nextgen/modules/nextgen_addgallery_page/templates/upload_images.php:114 msgid "Drag image and ZIP files here or click <strong>Add Files</strong>" msgstr "" -#: products/photocrati_nextgen/modules/nextgen_addgallery_page/templates/upload_images.php:149 +#: products/photocrati_nextgen/modules/nextgen_addgallery_page/templates/upload_images.php:164 #, php-format msgid "%s images were uploaded successfully" msgstr "" -#: products/photocrati_nextgen/modules/nextgen_addgallery_page/templates/upload_images.php:152 +#: products/photocrati_nextgen/modules/nextgen_addgallery_page/templates/upload_images.php:167 msgid "1 image was uploaded successfully" msgstr "" -#: products/photocrati_nextgen/modules/nextgen_addgallery_page/templates/upload_images.php:155 +#: products/photocrati_nextgen/modules/nextgen_addgallery_page/templates/upload_images.php:170 msgid "0 images were uploaded" msgstr "" -#: products/photocrati_nextgen/modules/nextgen_addgallery_page/templates/upload_images.php:169 +#: products/photocrati_nextgen/modules/nextgen_addgallery_page/templates/upload_images.php:184 msgid "Upload complete" msgstr "" -#: products/photocrati_nextgen/modules/nextgen_addgallery_page/templates/upload_images.php:191 -msgid "" -"An unexpected error occured. This is most likely due to a server " -"misconfiguration. Check your PHP error log or ask your hosting provider for " -"assistance." +#: products/photocrati_nextgen/modules/nextgen_addgallery_page/templates/upload_images.php:206 +msgid "An unexpected error occured. This is most likely due to a server misconfiguration. Check your PHP error log or ask your hosting provider for assistance." +msgstr "" + +#: products/photocrati_nextgen/modules/nextgen_admin/class.admin_notification_manager.php:121 +msgid "Not a valid notice name" msgstr "" #: products/photocrati_nextgen/modules/nextgen_admin/class.form.php:226 -#: products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_thumbnail_form.php:167 -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:537 +#: products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_thumbnail_form.php:131 msgid "Enable AJAX pagination" msgstr "" @@ -431,11 +490,7 @@ msgid "Override thumbnail settings" msgstr "" #: products/photocrati_nextgen/modules/nextgen_admin/class.form.php:240 -msgid "" -"This does not affect existing thumbnails; overriding the thumbnail settings " -"will create an additional set of thumbnails. To change the size of existing " -"thumbnails please visit 'Manage Galleries' and choose 'Create new " -"thumbnails' for all images in the gallery." +msgid "This does not affect existing thumbnails; overriding the thumbnail settings will create an additional set of thumbnails. To change the size of existing thumbnails please visit 'Manage Galleries' and choose 'Create new thumbnails' for all images in the gallery." msgstr "" #: products/photocrati_nextgen/modules/nextgen_admin/class.form.php:248 @@ -443,10 +498,6 @@ msgstr "" msgid "Thumbnail dimensions" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:431 -msgid "Thumbnail quality" -msgstr "" - #: products/photocrati_nextgen/modules/nextgen_admin/class.form.php:274 msgid "Thumbnail crop" msgstr "" @@ -461,7 +512,6 @@ msgstr "" #: products/photocrati_nextgen/modules/nextgen_admin/class.form.php:320 #: products/photocrati_nextgen/modules/nextgen_basic_singlepic/adapter.nextgen_basic_singlepic_form.php:83 -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:456 msgid "Image quality" msgstr "" @@ -497,23 +547,23 @@ msgstr "" msgid "Average" msgstr "" -#: products/photocrati_nextgen/modules/nextgen_admin/class.nextgen_admin_page_controller.php:100 +#: products/photocrati_nextgen/modules/nextgen_admin/class.nextgen_admin_page_controller.php:79 msgid "Clear" msgstr "" -#: products/photocrati_nextgen/modules/nextgen_admin/class.nextgen_admin_page_controller.php:101 +#: products/photocrati_nextgen/modules/nextgen_admin/class.nextgen_admin_page_controller.php:80 msgid "Default" msgstr "" -#: products/photocrati_nextgen/modules/nextgen_admin/class.nextgen_admin_page_controller.php:102 +#: products/photocrati_nextgen/modules/nextgen_admin/class.nextgen_admin_page_controller.php:81 msgid "Select Color" msgstr "" -#: products/photocrati_nextgen/modules/nextgen_admin/class.nextgen_admin_page_controller.php:103 +#: products/photocrati_nextgen/modules/nextgen_admin/class.nextgen_admin_page_controller.php:82 msgid "Current Color" msgstr "" -#: products/photocrati_nextgen/modules/nextgen_admin/class.nextgen_admin_page_controller.php:174 +#: products/photocrati_nextgen/modules/nextgen_admin/class.nextgen_admin_page_controller.php:144 msgid "Saved successfully" msgstr "" @@ -521,7 +571,7 @@ msgstr "" #: products/photocrati_nextgen/modules/nextgen_basic_singlepic/templates/nextgen_basic_singlepic_settings_radio.php:16 #: products/photocrati_nextgen/modules/nextgen_other_options/adapter.image_options_form.php:122 #: products/photocrati_nextgen/modules/nextgen_other_options/adapter.miscellaneous_form.php:24 -#: products/photocrati_nextgen/modules/nextgen_other_options/adapter.miscellaneous_form.php:30 +#: products/photocrati_nextgen/modules/nextgen_other_options/adapter.miscellaneous_form.php:29 #: products/photocrati_nextgen/modules/nextgen_other_options/templates/image_options_tab.php:40 #: products/photocrati_nextgen/modules/nextgen_other_options/templates/image_options_tab.php:65 #: products/photocrati_nextgen/modules/nextgen_other_options/templates/image_options_tab.php:191 @@ -538,7 +588,7 @@ msgstr "" #: products/photocrati_nextgen/modules/nextgen_basic_singlepic/templates/nextgen_basic_singlepic_settings_radio.php:24 #: products/photocrati_nextgen/modules/nextgen_other_options/adapter.image_options_form.php:123 #: products/photocrati_nextgen/modules/nextgen_other_options/adapter.miscellaneous_form.php:23 -#: products/photocrati_nextgen/modules/nextgen_other_options/adapter.miscellaneous_form.php:29 +#: products/photocrati_nextgen/modules/nextgen_other_options/adapter.miscellaneous_form.php:28 #: products/photocrati_nextgen/modules/nextgen_other_options/templates/image_options_tab.php:47 #: products/photocrati_nextgen/modules/nextgen_other_options/templates/image_options_tab.php:72 #: products/photocrati_nextgen/modules/nextgen_other_options/templates/image_options_tab.php:198 @@ -551,11 +601,11 @@ msgstr "" msgid "No" msgstr "" -#: products/photocrati_nextgen/modules/nextgen_basic_album/class.nextgen_basic_album_installer.php:9 +#: products/photocrati_nextgen/modules/nextgen_basic_album/module.nextgen_basic_album.php:168 msgid "NextGEN Basic Compact Album" msgstr "" -#: products/photocrati_nextgen/modules/nextgen_basic_album/class.nextgen_basic_album_installer.php:18 +#: products/photocrati_nextgen/modules/nextgen_basic_album/module.nextgen_basic_album.php:177 msgid "NextGEN Basic Extended Album" msgstr "" @@ -586,194 +636,102 @@ msgstr "" msgid "Photos" msgstr "" -#: products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_gallery_mapper.php:93 -msgid "[Show PicLens]" -msgstr "" - -#: products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_slideshow_form.php:62 +#: products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_slideshow_form.php:47 msgid "Interval" msgstr "" -#: products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_slideshow_form.php:66 +#: products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_slideshow_form.php:51 msgid "# of seconds" msgstr "" -#: products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_slideshow_form.php:97 +#: products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_slideshow_form.php:82 msgid "Maximum dimensions" msgstr "" -#: products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_slideshow_form.php:98 +#: products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_slideshow_form.php:83 msgid "Certain themes may allow images to flow over their container if this setting is too large" msgstr "" -#: products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_slideshow_form.php:109 -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:765 -msgid "Enable flash slideshow" -msgstr "" - -#: products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_slideshow_form.php:111 -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:767 -msgid "Integrate the flash based slideshow for all flash supported devices" -msgstr "" - -#: products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_slideshow_form.php:120 -msgid "Shuffle" -msgstr "" - -#: products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_slideshow_form.php:132 -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:782 -msgid "Show next image on click" -msgstr "" - -#: products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_slideshow_form.php:144 -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:786 -msgid "Show navigation bar" -msgstr "" - -#: products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_slideshow_form.php:156 -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:790 -msgid "Show loading icon" -msgstr "" - -#: products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_slideshow_form.php:168 -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:794 -msgid "Use watermark logo" -msgstr "" - -#: products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_slideshow_form.php:170 -msgid "" -"Use the watermark image in the Flash object. Note: this does not watermark " -"the image itself, and cannot be applied with text watermarks" -msgstr "" - -#: products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_slideshow_form.php:180 -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:799 -msgid "Stretch image" -msgstr "" - -#: products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_slideshow_form.php:222 -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:827 -msgid "Use slow zooming effect" -msgstr "" - -#: products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_slideshow_form.php:234 -msgid "Background music (url)" -msgstr "" - -#: products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_slideshow_form.php:247 -msgid "Try XHTML validation" -msgstr "" - -#: products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_slideshow_form.php:259 -msgid "Background" -msgstr "" - -#: products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_slideshow_form.php:271 -msgid "Texts / buttons" -msgstr "" - -#: products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_slideshow_form.php:283 -msgid "Rollover / active" -msgstr "" - -#: products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_slideshow_form.php:295 -msgid "Screen" -msgstr "" - -#: products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_slideshow_form.php:313 +#: products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_slideshow_form.php:100 msgid "Show thumbnail link" msgstr "" -#: products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_slideshow_form.php:329 +#: products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_slideshow_form.php:116 msgid "Thumbnail link text" msgstr "" -#: products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_thumbnail_form.php:65 +#: products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_thumbnail_form.php:63 msgid "Images per page" msgstr "" -#: products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_thumbnail_form.php:67 +#: products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_thumbnail_form.php:65 msgid "0 will display all images at once" msgstr "" -#: products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_thumbnail_form.php:85 +#: products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_thumbnail_form.php:83 msgid "Number of columns to display" msgstr "" -#: products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_thumbnail_form.php:89 +#: products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_thumbnail_form.php:87 msgid "# of columns" msgstr "" -#: products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_thumbnail_form.php:105 -msgid "Piclens link text" -msgstr "" - -#: products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_thumbnail_form.php:123 -msgid "Show piclens link" -msgstr "" - -#: products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_thumbnail_form.php:139 +#: products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_thumbnail_form.php:103 msgid "Add Hidden Images" msgstr "" -#: products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_thumbnail_form.php:141 -msgid "" -"If pagination is used this option will show all images in the modal window " -"(Thickbox, Lightbox etc.) This increases page load." +#: products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_thumbnail_form.php:105 +msgid "If pagination is used this option will show all images in the modal window (Thickbox, Lightbox etc.) This increases page load." msgstr "" -#: products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_thumbnail_form.php:150 +#: products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_thumbnail_form.php:114 msgid "Use imagebrowser effect" msgstr "" -#: products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_thumbnail_form.php:152 -msgid "" -"When active each image in the gallery will link to an imagebrowser display " -"and lightbox effects will not be applied." +#: products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_thumbnail_form.php:116 +msgid "When active each image in the gallery will link to an imagebrowser display and lightbox effects will not be applied." msgstr "" -#: products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_thumbnail_form.php:169 +#: products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_thumbnail_form.php:133 msgid "Browse images without reloading the page." msgstr "" -#: products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_thumbnail_form.php:184 +#: products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_thumbnail_form.php:148 msgid "Show slideshow link" msgstr "" -#: products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_thumbnail_form.php:200 +#: products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_thumbnail_form.php:164 msgid "Slideshow link text" msgstr "" -#: products/photocrati_nextgen/modules/nextgen_basic_gallery/class.nextgen_basic_gallery_installer.php:9 +#: products/photocrati_nextgen/modules/nextgen_basic_gallery/module.nextgen_basic_gallery.php:325 msgid "NextGEN Basic Thumbnails" msgstr "" -#: products/photocrati_nextgen/modules/nextgen_basic_gallery/class.nextgen_basic_gallery_installer.php:19 +#: products/photocrati_nextgen/modules/nextgen_basic_gallery/module.nextgen_basic_gallery.php:335 msgid "NextGEN Basic Slideshow" msgstr "" -#: products/photocrati_nextgen/modules/nextgen_basic_gallery/templates/slideshow/index.php:35 -msgid "" -"Slideshows require the <a href=\"http://www.macromedia.com/go/" -"getflashplayer\">Flash Player</a> and a <a href=\"http://www." -"mozilla.com/firefox/\">browser with Javascript support</a>." +#: products/photocrati_nextgen/modules/nextgen_basic_gallery/module.nextgen_basic_gallery.php:366 +#, php-format +msgid "Flash slideshow support has been removed from NextGEN Gallery. Please see <a href='%s'>this blog post</a> for more information." msgstr "" #: products/photocrati_nextgen/modules/nextgen_basic_gallery/templates/slideshow/nextgen_basic_slideshow_settings_gallery_dimensions.php:15 #: products/photocrati_nextgen/modules/nextgen_basic_singlepic/adapter.nextgen_basic_singlepic_form.php:39 #: products/photocrati_nextgen/modules/nextgen_basic_singlepic/templates/nextgen_basic_singlepic_settings_dimensions.php:13 -#: products/photocrati_nextgen/modules/widget/templates/form_slideshow.php:52 +#: products/photocrati_nextgen/modules/widget/templates/form_slideshow.php:65 msgid "Width" msgstr "" #: products/photocrati_nextgen/modules/nextgen_basic_gallery/templates/slideshow/nextgen_basic_slideshow_settings_gallery_dimensions.php:23 #: products/photocrati_nextgen/modules/nextgen_basic_singlepic/adapter.nextgen_basic_singlepic_form.php:41 #: products/photocrati_nextgen/modules/nextgen_basic_singlepic/templates/nextgen_basic_singlepic_settings_dimensions.php:20 -#: products/photocrati_nextgen/modules/widget/templates/form_slideshow.php:40 +#: products/photocrati_nextgen/modules/widget/templates/form_slideshow.php:53 msgid "Height" msgstr "" -#: products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/class.nextgen_basic_imagebrowser_installer.php:9 +#: products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/module.nextgen_basic_imagebrowser.php:174 msgid "NextGEN Basic ImageBrowser" msgstr "" @@ -784,13 +742,6 @@ msgstr "" msgid "Back" msgstr "" -#: products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/templates/nextgen_basic_imagebrowser.php:49 -#: products/photocrati_nextgen/modules/ngglegacy/view/imagebrowser-caption.php:29 -#: products/photocrati_nextgen/modules/ngglegacy/view/imagebrowser-exif.php:33 -#: products/photocrati_nextgen/modules/ngglegacy/view/imagebrowser.php:29 -msgid "Next" -msgstr "" - #: products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/templates/nextgen_basic_imagebrowser.php:55 #: products/photocrati_nextgen/modules/ngglegacy/admin/manage.php:89 #: products/photocrati_nextgen/modules/ngglegacy/lib/rewrite.php:220 @@ -800,13 +751,6 @@ msgstr "" msgid "Picture" msgstr "" -#: products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/templates/nextgen_basic_imagebrowser.php:55 -#: products/photocrati_nextgen/modules/ngglegacy/view/imagebrowser-caption.php:31 -#: products/photocrati_nextgen/modules/ngglegacy/view/imagebrowser-exif.php:35 -#: products/photocrati_nextgen/modules/ngglegacy/view/imagebrowser.php:31 -msgid "of" -msgstr "" - #: products/photocrati_nextgen/modules/nextgen_basic_singlepic/adapter.nextgen_basic_singlepic_form.php:54 msgid "Link" msgstr "" @@ -847,7 +791,19 @@ msgstr "" msgid "Float" msgstr "" -#: products/photocrati_nextgen/modules/nextgen_basic_singlepic/class.nextgen_basic_singlepic_installer.php:9 +#: products/photocrati_nextgen/modules/nextgen_basic_singlepic/adapter.nextgen_basic_singlepic_form.php:128 +#: products/photocrati_nextgen/modules/ngglegacy/admin/media-upload.php:254 +#: products/photocrati_nextgen/modules/ngglegacy/admin/publish.php:49 +msgid "Left" +msgstr "" + +#: products/photocrati_nextgen/modules/nextgen_basic_singlepic/adapter.nextgen_basic_singlepic_form.php:129 +#: products/photocrati_nextgen/modules/ngglegacy/admin/media-upload.php:258 +#: products/photocrati_nextgen/modules/ngglegacy/admin/publish.php:53 +msgid "Right" +msgstr "" + +#: products/photocrati_nextgen/modules/nextgen_basic_singlepic/module.nextgen_basic_singlepic.php:140 msgid "NextGEN Basic SinglePic" msgstr "" @@ -863,7 +819,11 @@ msgstr "" msgid "The display type that the tagcloud will point its results to" msgstr "" -#: products/photocrati_nextgen/modules/nextgen_basic_tagcloud/class.nextgen_basic_tagcloud_installer.php:12 +#: products/photocrati_nextgen/modules/nextgen_basic_tagcloud/class.taxonomy_controller.php:114 +msgid "Images tagged "%s"" +msgstr "" + +#: products/photocrati_nextgen/modules/nextgen_basic_tagcloud/module.nextgen_basic_tagcloud.php:163 msgid "NextGEN Basic TagCloud" msgstr "" @@ -875,15 +835,17 @@ msgstr "" msgid "Use a legacy template when rendering (not recommended)." msgstr "" -#: products/photocrati_nextgen/modules/nextgen_data/class.gallerystorage_driver_base.php:639 -#: products/photocrati_nextgen/modules/nextgen_data/class.ngglegacy_gallerystorage_driver.php:677 +#: products/photocrati_nextgen/modules/nextgen_basic_templates/adapter.nextgen_basic_template_form.php:210 +msgid "No template selected" +msgstr "" + +#: products/photocrati_nextgen/modules/nextgen_data/class.gallerystorage_driver_base.php:648 +#: products/photocrati_nextgen/modules/nextgen_data/class.ngglegacy_gallerystorage_driver.php:706 #: products/photocrati_nextgen/modules/ngglegacy/lib/multisite.php:23 -msgid "" -"Sorry, you have used your space allocation. Please delete some files to " -"upload more files." +msgid "Sorry, you have used your space allocation. Please delete some files to upload more files." msgstr "" -#: products/photocrati_nextgen/modules/nextgen_data/class.gallerystorage_driver_base.php:1083 +#: products/photocrati_nextgen/modules/nextgen_data/class.gallerystorage_driver_base.php:1092 msgid "Could not calculate resized image dimensions" msgstr "" @@ -932,7 +894,7 @@ msgstr "" #: products/photocrati_nextgen/modules/nextgen_data/class.nextgen_metadata.php:543 #: products/photocrati_nextgen/modules/nextgen_other_options/adapter.image_options_form.php:26 -#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-sort.php:114 +#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-sort.php:109 #: products/photocrati_nextgen/modules/ngglegacy/lib/meta.php:456 msgid "Date/Time" msgstr "" @@ -959,7 +921,7 @@ msgid "Shutter speed" msgstr "" #: products/photocrati_nextgen/modules/nextgen_data/class.nextgen_metadata.php:548 -#: products/photocrati_nextgen/modules/ngglegacy/admin/album.php:678 +#: products/photocrati_nextgen/modules/ngglegacy/admin/album.php:707 #: products/photocrati_nextgen/modules/ngglegacy/lib/meta.php:461 #: products/photocrati_nextgen/modules/widget/templates/form_gallery.php:4 #: products/photocrati_nextgen/modules/widget/templates/form_mediarss.php:3 @@ -968,17 +930,16 @@ msgid "Title" msgstr "" #: products/photocrati_nextgen/modules/nextgen_data/class.nextgen_metadata.php:549 -#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-galleries.php:459 +#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-galleries.php:458 #: products/photocrati_nextgen/modules/ngglegacy/admin/manage.php:409 -#: products/photocrati_nextgen/modules/ngglegacy/admin/style.php:132 #: products/photocrati_nextgen/modules/ngglegacy/lib/meta.php:462 msgid "Author" msgstr "" #: products/photocrati_nextgen/modules/nextgen_data/class.nextgen_metadata.php:550 +#: products/photocrati_nextgen/modules/nextgen_gallery_display/class.displayed_gallery_source_manager.php:47 #: products/photocrati_nextgen/modules/nextgen_other_options/adapter.image_options_form.php:51 #: products/photocrati_nextgen/modules/ngglegacy/admin/manage.php:175 -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:389 #: products/photocrati_nextgen/modules/ngglegacy/lib/meta.php:463 msgid "Tags" msgstr "" @@ -1098,93 +1059,82 @@ msgstr "" msgid "Flash" msgstr "" -#: products/photocrati_nextgen/modules/nextgen_data/class.ngglegacy_gallerystorage_driver.php:242 +#: products/photocrati_nextgen/modules/nextgen_data/class.ngglegacy_gallerystorage_driver.php:261 msgid "Invalid image file. Acceptable formats: JPG, GIF, and PNG." msgstr "" -#: products/photocrati_nextgen/modules/nextgen_data/class.ngglegacy_gallerystorage_driver.php:666 +#: products/photocrati_nextgen/modules/nextgen_data/class.ngglegacy_gallerystorage_driver.php:693 #, php-format msgid "Unable to create directory %s." msgstr "" -#: products/photocrati_nextgen/modules/nextgen_data/class.ngglegacy_gallerystorage_driver.php:671 -#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:928 -#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:1126 -#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:1211 +#: products/photocrati_nextgen/modules/nextgen_data/class.ngglegacy_gallerystorage_driver.php:698 #, php-format -msgid "" -"Unable to write to directory %s. Is this directory writable by the server?" +msgid "Unable to write to directory %s. Is this directory writable by the server?" msgstr "" -#: products/photocrati_nextgen/modules/nextgen_data/class.ngglegacy_gallerystorage_driver.php:700 -#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:1251 +#: products/photocrati_nextgen/modules/nextgen_data/class.ngglegacy_gallerystorage_driver.php:732 #, php-format msgid "Failed to copy database row for picture %s" msgstr "" -#: products/photocrati_nextgen/modules/nextgen_data/class.ngglegacy_gallerystorage_driver.php:712 +#: products/photocrati_nextgen/modules/nextgen_data/class.ngglegacy_gallerystorage_driver.php:746 #, php-format msgid "Failed to get image path for %s" msgstr "" -#: products/photocrati_nextgen/modules/nextgen_data/class.ngglegacy_gallerystorage_driver.php:730 -#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:1237 +#: products/photocrati_nextgen/modules/nextgen_data/class.ngglegacy_gallerystorage_driver.php:779 #, php-format msgid "Failed to copy image %1$s to %2$s" msgstr "" -#: products/photocrati_nextgen/modules/nextgen_data/class.ngglegacy_gallerystorage_driver.php:734 -#, php-format -msgid "Copied image %1$s to %2$s" -msgstr "" - -#: products/photocrati_nextgen/modules/nextgen_data/class.ngglegacy_gallerystorage_driver.php:742 -#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:1263 -#, php-format -msgid "" -"Image %1$s (%2$s) copied as image %3$s (%4$s) » The file already " -"existed in the destination gallery." -msgstr "" - -#: products/photocrati_nextgen/modules/nextgen_data/class.ngglegacy_gallerystorage_driver.php:746 -#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:1266 -#, php-format -msgid "Image %1$s (%2$s) copied as image %3$s (%4$s)" -msgstr "" - -#: products/photocrati_nextgen/modules/nextgen_data/class.ngglegacy_gallerystorage_driver.php:759 +#: products/photocrati_nextgen/modules/nextgen_data/class.ngglegacy_gallerystorage_driver.php:803 #, php-format msgid "Copied %1$s picture(s) to gallery %2$s ." msgstr "" -#: products/photocrati_nextgen/modules/nextgen_data/class.ngglegacy_gallerystorage_driver.php:786 +#: products/photocrati_nextgen/modules/nextgen_data/class.ngglegacy_gallerystorage_driver.php:830 msgid "Could not find image" msgstr "" -#: products/photocrati_nextgen/modules/nextgen_data/class.ngglegacy_gallerystorage_driver.php:791 -#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:388 +#: products/photocrati_nextgen/modules/nextgen_data/class.ngglegacy_gallerystorage_driver.php:835 +#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:385 msgid " is not writeable" msgstr "" -#: products/photocrati_nextgen/modules/nextgen_data/class.ngglegacy_gallerystorage_driver.php:796 +#: products/photocrati_nextgen/modules/nextgen_data/class.ngglegacy_gallerystorage_driver.php:840 msgid "Backup file does not exist" msgstr "" -#: products/photocrati_nextgen/modules/nextgen_data/class.ngglegacy_gallerystorage_driver.php:801 +#: products/photocrati_nextgen/modules/nextgen_data/class.ngglegacy_gallerystorage_driver.php:845 msgid "Could not restore original image" msgstr "" #: products/photocrati_nextgen/modules/nextgen_gallery_display/adapter.display_settings_controller.php:17 -#: products/photocrati_nextgen/modules/nextgen_gallery_display/module.nextgen_gallery_display.php:244 -#: products/photocrati_nextgen/modules/nextgen_gallery_display/module.nextgen_gallery_display.php:302 +#: products/photocrati_nextgen/modules/nextgen_gallery_display/module.nextgen_gallery_display.php:310 +#: products/photocrati_nextgen/modules/nextgen_gallery_display/module.nextgen_gallery_display.php:366 msgid "Gallery Settings" msgstr "" -#: products/photocrati_nextgen/modules/nextgen_gallery_display/class.displayed_gallery.php:73 +#: products/photocrati_nextgen/modules/nextgen_gallery_display/class.displayed_gallery.php:74 msgid "Source not compatible with selected display type" msgstr "" -#: products/photocrati_nextgen/modules/nextgen_gallery_display/module.nextgen_gallery_display.php:301 +#: products/photocrati_nextgen/modules/nextgen_gallery_display/class.displayed_gallery_renderer.php:206 +#: products/photocrati_nextgen/modules/nextgen_gallery_display/class.displayed_gallery_renderer.php:208 +#: products/photocrati_nextgen/modules/nextgen_gallery_display/class.displayed_gallery_renderer.php:212 +msgid "We cannot display this gallery" +msgstr "" + +#: products/photocrati_nextgen/modules/nextgen_gallery_display/class.displayed_gallery_source_manager.php:55 +msgid "Random Images" +msgstr "" + +#: products/photocrati_nextgen/modules/nextgen_gallery_display/class.displayed_gallery_source_manager.php:64 +msgid "Recent Images" +msgstr "" + +#: products/photocrati_nextgen/modules/nextgen_gallery_display/module.nextgen_gallery_display.php:365 msgid "NextGEN Gallery & Album Settings" msgstr "" @@ -1197,21 +1147,14 @@ msgstr "" msgid "Image Options" msgstr "" -#: products/photocrati_nextgen/modules/nextgen_other_options/adapter.image_options_form.php:22 -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:588 -#: products/photocrati_nextgen/modules/ngglegacy/admin/thumbnails-template.php:76 -msgid "Custom" -msgstr "" - #: products/photocrati_nextgen/modules/nextgen_other_options/adapter.image_options_form.php:23 -#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-sort.php:111 -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:549 +#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-sort.php:106 msgid "Image ID" msgstr "" #: products/photocrati_nextgen/modules/nextgen_other_options/adapter.image_options_form.php:24 -#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-images.php:570 -#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-sort.php:112 +#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-images.php:574 +#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-sort.php:107 #: products/photocrati_nextgen/modules/ngglegacy/admin/manage.php:165 msgid "Filename" msgstr "" @@ -1221,19 +1164,16 @@ msgid "Alt/Title Text" msgstr "" #: products/photocrati_nextgen/modules/nextgen_other_options/adapter.image_options_form.php:38 -#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-sort.php:115 -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:557 +#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-sort.php:110 msgid "Ascending" msgstr "" #: products/photocrati_nextgen/modules/nextgen_other_options/adapter.image_options_form.php:39 -#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-sort.php:116 -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:558 +#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-sort.php:111 msgid "Descending" msgstr "" #: products/photocrati_nextgen/modules/nextgen_other_options/adapter.image_options_form.php:50 -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:388 msgid "Categories" msgstr "" @@ -1254,8 +1194,7 @@ msgid "Delete Image Files?" msgstr "" #: products/photocrati_nextgen/modules/nextgen_other_options/adapter.image_options_form.php:90 -msgid "" -"When enabled, image files will be removed after a Gallery has been deleted" +msgid "When enabled, image files will be removed after a Gallery has been deleted" msgstr "" #: products/photocrati_nextgen/modules/nextgen_other_options/adapter.image_options_form.php:92 @@ -1263,9 +1202,7 @@ msgid "Show Related Images on Posts?" msgstr "" #: products/photocrati_nextgen/modules/nextgen_other_options/adapter.image_options_form.php:93 -msgid "" -"When enabled, related images will be appended to each post by matching the " -"posts tags/categories to image tags" +msgid "When enabled, related images will be appended to each post by matching the posts tags/categories to image tags" msgstr "" #: products/photocrati_nextgen/modules/nextgen_other_options/adapter.image_options_form.php:95 @@ -1309,9 +1246,7 @@ msgid "What should images be resized to?" msgstr "" #: products/photocrati_nextgen/modules/nextgen_other_options/adapter.image_options_form.php:114 -msgid "" -"After images are uploaded, they will be resized to the above dimensions and " -"quality" +msgid "After images are uploaded, they will be resized to the above dimensions and quality" msgstr "" #: products/photocrati_nextgen/modules/nextgen_other_options/adapter.image_options_form.php:115 @@ -1334,7 +1269,7 @@ msgstr "" msgid "Lightbox Effects" msgstr "" -#: products/photocrati_nextgen/modules/nextgen_other_options/adapter.lightbox_manager_form.php:38 +#: products/photocrati_nextgen/modules/nextgen_other_options/adapter.lightbox_manager_form.php:32 msgid "What effect would you like to use?" msgstr "" @@ -1347,48 +1282,46 @@ msgid "Add MediaRSS link?" msgstr "" #: products/photocrati_nextgen/modules/nextgen_other_options/adapter.miscellaneous_form.php:22 -msgid "" -"When enabled, adds a MediaRSS link to your header. Third-party web services " -"can use this to publish your galleries" +msgid "When enabled, adds a MediaRSS link to your header. Third-party web services can use this to publish your galleries" msgstr "" -#: products/photocrati_nextgen/modules/nextgen_other_options/adapter.miscellaneous_form.php:27 +#: products/photocrati_nextgen/modules/nextgen_other_options/adapter.miscellaneous_form.php:26 msgid "Display galleries in feeds" msgstr "" -#: products/photocrati_nextgen/modules/nextgen_other_options/adapter.miscellaneous_form.php:28 -msgid "" -"NextGEN hides its gallery displays in feeds other than MediaRSS. This " -"enables image galleries in feeds." +#: products/photocrati_nextgen/modules/nextgen_other_options/adapter.miscellaneous_form.php:27 +msgid "NextGEN hides its gallery displays in feeds other than MediaRSS. This enables image galleries in feeds." msgstr "" -#: products/photocrati_nextgen/modules/nextgen_other_options/adapter.miscellaneous_form.php:32 +#: products/photocrati_nextgen/modules/nextgen_other_options/adapter.miscellaneous_form.php:30 msgid "Clear image cache" msgstr "" -#: products/photocrati_nextgen/modules/nextgen_other_options/adapter.miscellaneous_form.php:33 +#: products/photocrati_nextgen/modules/nextgen_other_options/adapter.miscellaneous_form.php:31 msgid "" "Completely clear the NextGEN cache of all image modifications?\n" "\n" "Choose [Cancel] to Stop, [OK] to proceed." msgstr "" -#: products/photocrati_nextgen/modules/nextgen_other_options/adapter.miscellaneous_form.php:38 +#: products/photocrati_nextgen/modules/nextgen_other_options/adapter.miscellaneous_form.php:36 msgid "Permalink slug" msgstr "" -#: products/photocrati_nextgen/modules/nextgen_other_options/adapter.miscellaneous_form.php:45 +#: products/photocrati_nextgen/modules/nextgen_other_options/adapter.miscellaneous_form.php:43 msgid "Maximum image count" msgstr "" +#: products/photocrati_nextgen/modules/nextgen_other_options/adapter.miscellaneous_form.php:45 +msgid "This is the maximum limit of images that NextGEN will restrict itself to querying" +msgstr "" + #: products/photocrati_nextgen/modules/nextgen_other_options/adapter.miscellaneous_form.php:47 -msgid "" -"This is the maximum limit of images that NextGEN will restrict itself to " -"querying" +msgid "Note: This limit will not apply to slideshow widgets or random galleries if/when those galleries specify their own image limits" msgstr "" #: products/photocrati_nextgen/modules/nextgen_other_options/adapter.other_options_controller.php:22 -#: products/photocrati_nextgen/modules/nextgen_other_options/module.nextgen_other_options.php:39 +#: products/photocrati_nextgen/modules/nextgen_other_options/module.nextgen_other_options.php:69 msgid "Other Options" msgstr "" @@ -1401,8 +1334,7 @@ msgid "Reset all options to default settings" msgstr "" #: products/photocrati_nextgen/modules/nextgen_other_options/adapter.reset_form.php:16 -msgid "" -"Replace all existing options and gallery options with their default settings" +msgid "Replace all existing options and gallery options with their default settings" msgstr "" #: products/photocrati_nextgen/modules/nextgen_other_options/adapter.reset_form.php:17 @@ -1507,9 +1439,7 @@ msgid "An absolute or relative (to the site document root) file system path" msgstr "" #: products/photocrati_nextgen/modules/nextgen_other_options/adapter.watermarks_form.php:71 -msgid "" -"An absolute or relative (to the site document root) file system path or an " -"HTTP url" +msgid "An absolute or relative (to the site document root) file system path or an HTTP url" msgstr "" #: products/photocrati_nextgen/modules/nextgen_other_options/adapter.watermarks_form.php:74 @@ -1537,9 +1467,7 @@ msgid "Opacity:" msgstr "" #: products/photocrati_nextgen/modules/nextgen_other_options/adapter.watermarks_form.php:126 -msgid "" -"Please note: You can only activate the watermark under Manage Gallery. This " -"action cannot be undone." +msgid "Please note: You can only activate the watermark under Manage Gallery. This action cannot be undone." msgstr "" #: products/photocrati_nextgen/modules/nextgen_other_options/adapter.watermarks_form.php:127 @@ -1562,32 +1490,23 @@ msgstr "" msgid "Refresh preview image" msgstr "" -#: products/photocrati_nextgen/modules/nextgen_other_options/templates/lightbox_library_tab.php:34 -#: products/photocrati_nextgen/modules/nextgen_other_options/templates/lightbox_library_tab.php:37 -msgid "(Show Advanced Settings)" -msgstr "" - -#: products/photocrati_nextgen/modules/nextgen_other_options/templates/lightbox_library_tab.php:35 -msgid "(Hide Advanced Settings)" -msgstr "" - -#: products/photocrati_nextgen/modules/nextgen_other_options/templates/lightbox_library_tab.php:56 +#: products/photocrati_nextgen/modules/nextgen_other_options/templates/lightbox_library_tab.php:31 msgid "What must the lightbox be applied to?" msgstr "" -#: products/photocrati_nextgen/modules/nextgen_other_options/templates/lightbox_library_tab.php:60 +#: products/photocrati_nextgen/modules/nextgen_other_options/templates/lightbox_library_tab.php:35 msgid "Only apply to NextGEN images" msgstr "" -#: products/photocrati_nextgen/modules/nextgen_other_options/templates/lightbox_library_tab.php:61 +#: products/photocrati_nextgen/modules/nextgen_other_options/templates/lightbox_library_tab.php:36 msgid "Only apply to NextGEN and WordPress images" msgstr "" -#: products/photocrati_nextgen/modules/nextgen_other_options/templates/lightbox_library_tab.php:62 +#: products/photocrati_nextgen/modules/nextgen_other_options/templates/lightbox_library_tab.php:37 msgid "Try to apply to all images" msgstr "" -#: products/photocrati_nextgen/modules/nextgen_other_options/templates/lightbox_library_tab.php:63 +#: products/photocrati_nextgen/modules/nextgen_other_options/templates/lightbox_library_tab.php:38 msgid "Try to apply to all images that link to image files" msgstr "" @@ -1600,19 +1519,19 @@ msgstr "" msgid "All stylesheets must contain a <a href='#' onclick='%s'>file header</a>" msgstr "" -#: products/photocrati_nextgen/modules/nextgen_settings/class.nextgen_settings_installer.php:43 +#: products/photocrati_nextgen/modules/nextgen_settings/module.nextgen_settings.php:76 msgid "Related Images" msgstr "" -#: products/photocrati_nextgen/modules/nextgen_settings/class.nextgen_settings_installer.php:63 +#: products/photocrati_nextgen/modules/nextgen_settings/module.nextgen_settings.php:96 msgid "[Show slideshow]" msgstr "" -#: products/photocrati_nextgen/modules/nextgen_settings/class.nextgen_settings_installer.php:64 +#: products/photocrati_nextgen/modules/nextgen_settings/module.nextgen_settings.php:97 msgid "[Show thumbnails]" msgstr "" -#: products/photocrati_nextgen/modules/nextgen_xmlrpc/module.nextgen_xmlrpc.php:425 +#: products/photocrati_nextgen/modules/nextgen_xmlrpc/module.nextgen_xmlrpc.php:428 msgid "Sorry, you must be able to manage galleries" msgstr "" @@ -1625,154 +1544,59 @@ msgstr "" msgid "Network settings" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/admin.php:301 +#: products/photocrati_nextgen/modules/ngglegacy/admin/admin.php:276 msgid "You do not have the correct permission" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/admin.php:302 +#: products/photocrati_nextgen/modules/ngglegacy/admin/admin.php:277 msgid "Unexpected Error" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/admin.php:303 +#: products/photocrati_nextgen/modules/ngglegacy/admin/admin.php:278 msgid "A failure occurred" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/admin.php:307 -msgid "You have attempted to queue too many files." -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/admin.php:308 -msgid "This file exceeds the maximum upload size for this site." -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/admin.php:309 -msgid "This file is empty. Please try another." -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/admin.php:310 -msgid "This file type is not allowed. Please try another." -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/admin.php:311 -msgid "This file is not an image. Please try another." -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/admin.php:312 -msgid "Memory exceeded. Please try another smaller file." -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/admin.php:313 -msgid "This is larger than the maximum size. Please try another." -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/admin.php:314 -msgid "An error occurred in the upload. Please try again later." -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/admin.php:315 -msgid "" -"There was a configuration error. Please contact the server administrator." -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/admin.php:316 -msgid "You may only upload 1 file." -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/admin.php:317 -msgid "HTTP error." -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/admin.php:318 -msgid "Upload failed." -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/admin.php:319 -msgid "IO error." -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/admin.php:320 -msgid "Security error." -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/admin.php:321 -msgid "File canceled." -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/admin.php:322 -msgid "Upload stopped." -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/admin.php:323 -msgid "Dismiss" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/admin.php:324 -msgid "Crunching…" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/admin.php:325 -msgid "moved to the trash." -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/admin.php:326 -#, php-format -msgid "“%s” has failed to upload due to an error" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/admin.php:348 -msgid "L O A D I N G" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/admin.php:349 -msgid "Click to Close" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/admin.php:458 -msgid "" -"<a href=\"http://www.nextgen-gallery.com\" target=\"_blank\">Introduction</a>" +#: products/photocrati_nextgen/modules/ngglegacy/admin/admin.php:379 +msgid "<a href=\"http://www.nextgen-gallery.com\" target=\"_blank\">Introduction</a>" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/admin.php:461 -msgid "" -"<a href=\"http://www.nextgen-gallery.com/languages\" target=\"_blank" -"\">Languages</a>" +#: products/photocrati_nextgen/modules/ngglegacy/admin/admin.php:382 +msgid "<a href=\"http://www.nextgen-gallery.com/languages\" target=\"_blank\">Languages</a>" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/admin.php:466 +#: products/photocrati_nextgen/modules/ngglegacy/admin/admin.php:387 msgid "Get help with NextGEN Gallery" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/admin.php:470 +#: products/photocrati_nextgen/modules/ngglegacy/admin/admin.php:391 msgid "More Help & Info" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/admin.php:472 -msgid "" -"<a href=\"http://wordpress.org/tags/nextgen-gallery?forum_id=10\" target=" -"\"_blank\">Support Forums</a>" +#: products/photocrati_nextgen/modules/ngglegacy/admin/admin.php:393 +msgid "<a href=\"http://wordpress.org/tags/nextgen-gallery?forum_id=10\" target=\"_blank\">Support Forums</a>" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/admin.php:473 +#: products/photocrati_nextgen/modules/ngglegacy/admin/admin.php:394 msgid "FAQ" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/admin.php:474 +#: products/photocrati_nextgen/modules/ngglegacy/admin/admin.php:395 msgid "Feature request" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/admin.php:475 +#: products/photocrati_nextgen/modules/ngglegacy/admin/admin.php:396 msgid "Get your language pack" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/admin.php:476 +#: products/photocrati_nextgen/modules/ngglegacy/admin/admin.php:397 msgid "Contribute development" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/admin.php:477 +#: products/photocrati_nextgen/modules/ngglegacy/admin/admin.php:398 msgid "Download latest version" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/ajax.php:360 +#: products/photocrati_nextgen/modules/ngglegacy/admin/ajax.php:288 #, php-format msgid "Could create image with %s x %s pixel" msgstr "" @@ -1782,7 +1606,7 @@ msgstr "" #: products/photocrati_nextgen/modules/ngglegacy/admin/album.php:239 #: products/photocrati_nextgen/modules/ngglegacy/admin/edit-thumbnail.php:19 #: products/photocrati_nextgen/modules/ngglegacy/admin/edit-thumbnail.php:22 -#: products/photocrati_nextgen/modules/ngglegacy/admin/manage.php:618 +#: products/photocrati_nextgen/modules/ngglegacy/admin/manage.php:598 #: products/photocrati_nextgen/modules/ngglegacy/admin/publish.php:7 #: products/photocrati_nextgen/modules/ngglegacy/admin/publish.php:10 #: products/photocrati_nextgen/modules/ngglegacy/admin/publish.php:13 @@ -1796,8 +1620,6 @@ msgstr "" #: products/photocrati_nextgen/modules/ngglegacy/admin/album.php:180 #: products/photocrati_nextgen/modules/ngglegacy/admin/album.php:209 #: products/photocrati_nextgen/modules/ngglegacy/admin/album.php:253 -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:178 -#: products/photocrati_nextgen/modules/ngglegacy/admin/style.php:24 msgid "Update Successfully" msgstr "" @@ -1805,220 +1627,207 @@ msgstr "" msgid "Album deleted" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/album.php:389 +#: products/photocrati_nextgen/modules/ngglegacy/admin/album.php:423 #: products/photocrati_nextgen/modules/ngglegacy/admin/roles.php:55 msgid "Edit Album" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/album.php:410 -#: products/photocrati_nextgen/modules/ngglegacy/admin/album.php:459 +#: products/photocrati_nextgen/modules/ngglegacy/admin/album.php:443 +#: products/photocrati_nextgen/modules/ngglegacy/admin/album.php:492 msgid "Select album" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/album.php:412 +#: products/photocrati_nextgen/modules/ngglegacy/admin/album.php:445 msgid "No album selected" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/album.php:423 -#: products/photocrati_nextgen/modules/ngglegacy/admin/edit-thumbnail.php:166 -#: products/photocrati_nextgen/modules/ngglegacy/admin/rotate.php:94 +#: products/photocrati_nextgen/modules/ngglegacy/admin/album.php:456 +#: products/photocrati_nextgen/modules/ngglegacy/admin/edit-thumbnail.php:177 +#: products/photocrati_nextgen/modules/ngglegacy/admin/rotate.php:102 #: products/photocrati_nextgen/modules/ngglegacy/admin/wpmu.php:112 msgid "Update" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/album.php:425 +#: products/photocrati_nextgen/modules/ngglegacy/admin/album.php:458 msgid "Edit album" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/album.php:428 -#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-galleries.php:187 +#: products/photocrati_nextgen/modules/ngglegacy/admin/album.php:461 +#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-galleries.php:186 #: products/photocrati_nextgen/modules/ngglegacy/admin/manage.php:361 #: products/photocrati_nextgen/modules/ngglegacy/admin/manage.php:363 -#: products/photocrati_nextgen/modules/ngglegacy/admin/tags.php:227 +#: products/photocrati_nextgen/modules/ngglegacy/admin/tags.php:226 msgid "Delete" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/album.php:432 +#: products/photocrati_nextgen/modules/ngglegacy/admin/album.php:465 msgid "Add new album" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/album.php:434 +#: products/photocrati_nextgen/modules/ngglegacy/admin/album.php:467 msgid "Add" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/album.php:445 +#: products/photocrati_nextgen/modules/ngglegacy/admin/album.php:478 msgid "Show / hide used galleries" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/album.php:445 +#: products/photocrati_nextgen/modules/ngglegacy/admin/album.php:478 msgid "[Show all]" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/album.php:446 +#: products/photocrati_nextgen/modules/ngglegacy/admin/album.php:479 msgid "Maximize the widget content" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/album.php:446 +#: products/photocrati_nextgen/modules/ngglegacy/admin/album.php:479 msgid "[Maximize]" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/album.php:447 +#: products/photocrati_nextgen/modules/ngglegacy/admin/album.php:480 msgid "Minimize the widget content" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/album.php:447 +#: products/photocrati_nextgen/modules/ngglegacy/admin/album.php:480 msgid "[Minimize]" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/album.php:449 -msgid "" -"After you create and select a album, you can drag and drop a gallery or " -"another album into your new album below" +#: products/photocrati_nextgen/modules/ngglegacy/admin/album.php:482 +msgid "After you create and select a album, you can drag and drop a gallery or another album into your new album below" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/album.php:475 +#: products/photocrati_nextgen/modules/ngglegacy/admin/album.php:508 msgid "Select gallery" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/album.php:500 +#: products/photocrati_nextgen/modules/ngglegacy/admin/album.php:533 msgid "Album ID" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/album.php:513 +#: products/photocrati_nextgen/modules/ngglegacy/admin/album.php:546 msgid "No album selected!" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/album.php:534 +#: products/photocrati_nextgen/modules/ngglegacy/admin/album.php:567 msgid "Album name:" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/album.php:540 +#: products/photocrati_nextgen/modules/ngglegacy/admin/album.php:573 msgid "Album description:" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/album.php:546 +#: products/photocrati_nextgen/modules/ngglegacy/admin/album.php:579 msgid "Select a preview image:" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/album.php:549 -#: products/photocrati_nextgen/modules/ngglegacy/admin/album.php:552 -#: products/photocrati_nextgen/modules/ngglegacy/admin/templates/manage_gallery/gallery_preview_image_field.php:3 -msgid "No picture" +#: products/photocrati_nextgen/modules/ngglegacy/admin/album.php:592 +msgid "Page Link to" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/album.php:563 -msgid "Page Link to" +#: products/photocrati_nextgen/modules/ngglegacy/admin/album.php:616 +msgid "There are no pages to link to" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/album.php:582 -#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-galleries.php:337 -#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-galleries.php:366 -#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-galleries.php:397 -#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-images.php:406 -#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-images.php:442 -#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-images.php:471 -#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-images.php:502 +#: products/photocrati_nextgen/modules/ngglegacy/admin/album.php:611 +#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-galleries.php:336 +#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-galleries.php:365 +#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-galleries.php:396 +#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-images.php:410 +#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-images.php:446 +#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-images.php:475 +#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-images.php:506 msgid "OK" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/album.php:584 -#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-galleries.php:339 -#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-galleries.php:368 -#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-galleries.php:399 -#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-images.php:408 -#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-images.php:444 -#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-images.php:473 -#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-images.php:504 +#: products/photocrati_nextgen/modules/ngglegacy/admin/album.php:613 +#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-galleries.php:338 +#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-galleries.php:367 +#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-galleries.php:398 +#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-images.php:412 +#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-images.php:448 +#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-images.php:477 +#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-images.php:508 msgid "Cancel" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/album.php:677 +#: products/photocrati_nextgen/modules/ngglegacy/admin/album.php:706 msgid "Name" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/album.php:679 +#: products/photocrati_nextgen/modules/ngglegacy/admin/album.php:708 #: products/photocrati_nextgen/modules/ngglegacy/lib/rewrite.php:229 msgid "Page" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/edit-thumbnail.php:116 +#: products/photocrati_nextgen/modules/ngglegacy/admin/edit-thumbnail.php:127 msgid "Select with the mouse the area for the new thumbnail" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/edit-thumbnail.php:130 +#: products/photocrati_nextgen/modules/ngglegacy/admin/edit-thumbnail.php:141 msgid "Thumbnail updated" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/edit-thumbnail.php:135 +#: products/photocrati_nextgen/modules/ngglegacy/admin/edit-thumbnail.php:146 msgid "Error updating thumbnail" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/edit-thumbnail.php:151 +#: products/photocrati_nextgen/modules/ngglegacy/admin/edit-thumbnail.php:162 msgid "Select the area for the thumbnail from the picture on the left." msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:39 +#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:44 msgid "No valid gallery name!" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:46 #: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:55 -#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:80 -#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:780 -#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:788 +#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:83 msgid "Directory" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:46 +#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:55 msgid "didn't exist. Please create first the main gallery folder " msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:47 #: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:56 msgid "Check this link, if you didn't know how to set the permission :" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:55 -#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:80 -msgid "is not writeable !" +#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:79 +#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:88 +msgid "Unable to create directory " msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:76 -#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:85 -#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:736 -#: products/photocrati_nextgen/modules/ngglegacy/lib/core.php:101 -msgid "Unable to create directory " +#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:83 +msgid "is not writeable !" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:89 +#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:92 msgid "The server setting Safe-Mode is on !" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:90 +#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:93 msgid "If you have problems, please create directory" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:91 +#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:94 msgid "and the thumbnails directory" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:91 +#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:94 msgid "with permission 777 manually !" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:116 +#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:119 #, php-format -msgid "" -"Gallery ID %1$s successfully created. You can show this gallery in your post " -"or page with the shortcode %2$s.<br/>" +msgid "Gallery ID %1$s successfully created. You can show this gallery in your post or page with the shortcode %2$s.<br/>" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:119 -#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:853 +#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:122 +#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:692 msgid "Edit gallery" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:188 +#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:189 msgid "Error while creating thumbnail." msgstr "" @@ -2026,186 +1835,79 @@ msgstr "" msgid "Error while resizing image." msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:326 +#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:324 msgid "Error while rotating image." msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:361 +#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:358 msgid "Error while applying watermark to image." msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:385 +#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:382 msgid "Object didn't contain correct data" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:391 +#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:388 msgid "File do not exists" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:395 +#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:392 msgid "Couldn't restore original image" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:511 +#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:514 msgid "(Error : Couldn't not update data base)" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:518 +#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:521 msgid "(Error : Couldn't not update meta data)" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:527 +#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:530 msgid "(Error : Couldn't not find image)" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:670 -msgid "No valid URL path " -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:686 -msgid "Import via cURL failed." -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:703 -msgid "Uploaded file was no or a faulty zip file ! The server recognized : " -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:720 -msgid "Could not get a valid foldername" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:731 -#, php-format -msgid "" -"Unable to create directory %s. Is its parent directory writable by the " -"server?" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:746 -msgid "Zip-File successfully unpacked" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:882 -#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:982 -msgid "No gallery selected !" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:890 -#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:1007 -msgid "Failure in database, no gallery path set !" +#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:620 +msgid "Directory <strong>%s</strong> doesn`t exist!" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:914 -#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:1001 -msgid "is no valid image file!" +#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:628 +msgid "Directory <strong>%s</strong> contains no pictures" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:935 -#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:1024 -msgid "Error, the file could not be moved to : " +#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:644 +msgid "Database error. Could not add gallery!" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:940 -#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:1028 -msgid "Error, the file permissions could not be set" -msgstr "" +#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:651 +msgid "Gallery <strong>%s</strong> successfully created!" +msgid_plural "Galleries <strong>%s</strong> successfully created!" +msgstr[0] "" +msgstr[1] "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:848 -#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:958 +#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:687 #: products/photocrati_nextgen/modules/ngglegacy/admin/manage-galleries.php:111 -#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-galleries.php:189 +#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-galleries.php:188 #: products/photocrati_nextgen/modules/ngglegacy/admin/manage-images.php:238 #: products/photocrati_nextgen/modules/ngglegacy/admin/manage-images.php:322 -#: products/photocrati_nextgen/modules/ngglegacy/admin/manage.php:660 -#: products/photocrati_nextgen/modules/ngglegacy/admin/manage.php:738 +#: products/photocrati_nextgen/modules/ngglegacy/admin/manage.php:640 +#: products/photocrati_nextgen/modules/ngglegacy/admin/manage.php:718 msgid "Create new thumbnails" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:963 -msgid " Image(s) successfully added" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:990 -msgid "Invalid upload. Error Code : " -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:1066 -#, php-format -msgid "" -"SAFE MODE Restriction in effect! You need to create the folder <strong>%s</" -"strong> manually" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:1067 -#, php-format -msgid "" -"When safe_mode is on, PHP checks to see if the owner (%s) of the current " -"script matches the owner (%s) of the file to be operated on by a file " -"function or its directory" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:1120 -#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:1197 -msgid "The destination gallery does not exist" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:1151 -#, php-format -msgid "Failed to move image %1$s to %2$s" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:1171 -#, php-format -msgid "Moved %1$s picture(s) to gallery : %2$s ." -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:1275 +#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:690 #, php-format -msgid "Copied %1$s picture(s) to gallery: %2$s ." -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:1383 -msgid "The uploaded file exceeds the upload_max_filesize directive in php.ini" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:1386 -msgid "" -"The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in " -"the HTML form" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:1389 -msgid "The uploaded file was only partially uploaded" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:1392 -msgid "No file was uploaded" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:1395 -msgid "Missing a temporary folder" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:1398 -msgid "Failed to write file to disk" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:1401 -msgid "File upload stopped by extension" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:1404 -msgid "Unknown upload error" -msgstr "" +msgid "One picture successfully added" +msgid_plural "%s pictures successfully added" +msgstr[0] "" +msgstr[1] "" #: products/photocrati_nextgen/modules/ngglegacy/admin/install.php:20 msgid "Sorry, NextGEN Gallery works only with a role called administrator" msgstr "" #: products/photocrati_nextgen/modules/ngglegacy/admin/install.php:92 -msgid "" -"NextGEN Gallery : Tables could not created, please check your database " -"settings" +msgid "NextGEN Gallery : Tables could not created, please check your database settings" msgstr "" #: products/photocrati_nextgen/modules/ngglegacy/admin/manage-galleries.php:99 @@ -2214,11 +1916,11 @@ msgid "No images selected" msgstr "" #: products/photocrati_nextgen/modules/ngglegacy/admin/manage-galleries.php:107 -#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-galleries.php:190 +#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-galleries.php:189 #: products/photocrati_nextgen/modules/ngglegacy/admin/manage-images.php:234 #: products/photocrati_nextgen/modules/ngglegacy/admin/manage-images.php:323 -#: products/photocrati_nextgen/modules/ngglegacy/admin/manage.php:641 -#: products/photocrati_nextgen/modules/ngglegacy/admin/manage.php:722 +#: products/photocrati_nextgen/modules/ngglegacy/admin/manage.php:621 +#: products/photocrati_nextgen/modules/ngglegacy/admin/manage.php:702 msgid "Resize images" msgstr "" @@ -2231,114 +1933,109 @@ msgid "" msgstr "" #: products/photocrati_nextgen/modules/ngglegacy/admin/manage-galleries.php:154 -#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-galleries.php:197 +#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-galleries.php:196 msgid "Add new gallery" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-galleries.php:171 -#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-galleries.php:174 -#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-images.php:272 -#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-images.php:275 +#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-galleries.php:170 +#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-galleries.php:173 +#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-images.php:271 +#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-images.php:274 msgid "Search Images" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-galleries.php:186 +#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-galleries.php:185 #: products/photocrati_nextgen/modules/ngglegacy/admin/manage-images.php:320 msgid "Bulk actions" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-galleries.php:188 +#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-galleries.php:187 #: products/photocrati_nextgen/modules/ngglegacy/admin/manage-images.php:321 #: products/photocrati_nextgen/modules/ngglegacy/admin/manage.php:571 -#: products/photocrati_nextgen/modules/ngglegacy/admin/manage.php:686 +#: products/photocrati_nextgen/modules/ngglegacy/admin/manage.php:666 msgid "Set watermark" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-galleries.php:191 +#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-galleries.php:190 #: products/photocrati_nextgen/modules/ngglegacy/admin/manage-images.php:326 #: products/photocrati_nextgen/modules/ngglegacy/admin/manage.php:576 -#: products/photocrati_nextgen/modules/ngglegacy/admin/manage.php:706 +#: products/photocrati_nextgen/modules/ngglegacy/admin/manage.php:686 msgid "Import metadata" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-galleries.php:192 +#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-galleries.php:191 #: products/photocrati_nextgen/modules/ngglegacy/admin/manage-images.php:324 #: products/photocrati_nextgen/modules/ngglegacy/admin/manage.php:566 -#: products/photocrati_nextgen/modules/ngglegacy/admin/manage.php:683 +#: products/photocrati_nextgen/modules/ngglegacy/admin/manage.php:663 msgid "Recover from backup" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-galleries.php:194 +#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-galleries.php:193 #: products/photocrati_nextgen/modules/ngglegacy/admin/manage-images.php:335 msgid "Apply" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-galleries.php:262 -#: products/photocrati_nextgen/modules/ngglegacy/admin/tags.php:253 +#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-galleries.php:261 +#: products/photocrati_nextgen/modules/ngglegacy/admin/tags.php:252 msgid "Edit" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-galleries.php:309 -#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-images.php:379 +#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-galleries.php:308 +#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-images.php:383 msgid "No entries found" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-galleries.php:327 +#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-galleries.php:326 msgid "New Gallery" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-galleries.php:329 +#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-galleries.php:328 msgid "Create a new , empty gallery below the folder" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-galleries.php:331 +#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-galleries.php:330 msgid "Allowed characters for file and folder names are" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-galleries.php:357 -#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-images.php:462 +#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-galleries.php:356 +#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-images.php:466 msgid "Resize Images to" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-galleries.php:361 -#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-images.php:466 -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:453 +#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-galleries.php:360 +#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-images.php:470 msgid "Width x height (in pixel). NextGEN Gallery will keep ratio size" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-galleries.php:385 -#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-images.php:490 +#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-galleries.php:384 +#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-images.php:494 #: products/photocrati_nextgen/modules/ngglegacy/admin/publish.php:40 -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:416 msgid "Width x height (in pixel)" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-galleries.php:391 -#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-images.php:496 -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:426 +#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-galleries.php:390 +#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-images.php:500 msgid "Set fix dimension" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-galleries.php:393 -#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-images.php:498 -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:428 +#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-galleries.php:392 +#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-images.php:502 msgid "Ignore the aspect ratio, no portrait thumbnails" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-galleries.php:456 -#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-images.php:568 +#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-galleries.php:455 +#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-images.php:572 #: products/photocrati_nextgen/modules/ngglegacy/admin/manage.php:155 msgid "ID" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-galleries.php:458 -#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-images.php:571 +#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-galleries.php:457 +#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-images.php:575 #: products/photocrati_nextgen/modules/ngglegacy/admin/media-upload.php:245 -#: products/photocrati_nextgen/modules/ngglegacy/admin/style.php:134 msgid "Description" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-galleries.php:460 +#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-galleries.php:459 msgid "Page ID" msgstr "" @@ -2379,13 +2076,16 @@ msgid "" " 'Cancel' to stop, 'OK' to proceed." msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-images.php:269 +#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-images.php:268 #, php-format msgid "Search results for “%s”" msgstr "" +#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-images.php:297 +msgid "Click to toggle" +msgstr "" + #: products/photocrati_nextgen/modules/ngglegacy/admin/manage-images.php:298 -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:488 msgid "Gallery settings" msgstr "" @@ -2399,14 +2099,7 @@ msgstr "" #: products/photocrati_nextgen/modules/ngglegacy/admin/manage-images.php:306 #: products/photocrati_nextgen/modules/ngglegacy/admin/manage-images.php:341 -#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-images.php:386 -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:400 -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:436 -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:478 -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:563 -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:598 -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:708 -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:861 +#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-images.php:390 msgid "Save Changes" msgstr "" @@ -2442,53 +2135,53 @@ msgstr "" msgid "Sort gallery" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-images.php:402 +#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-images.php:406 msgid "Enter the tags" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-images.php:426 +#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-images.php:430 msgid "Select the destination gallery:" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-images.php:569 +#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-images.php:573 #: products/photocrati_nextgen/modules/ngglegacy/admin/manage.php:160 #: products/photocrati_nextgen/modules/ngglegacy/admin/media-upload.php:266 msgid "Thumbnail" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-images.php:571 +#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-images.php:575 msgid "Alt & Title Text" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-images.php:572 +#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-images.php:576 msgid "Tags (comma separated list)" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-sort.php:35 +#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-sort.php:34 msgid "Sort order changed" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-sort.php:97 +#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-sort.php:92 msgid "Sort Gallery" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-sort.php:101 +#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-sort.php:96 msgid "Update Sort Order" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-sort.php:104 +#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-sort.php:99 msgid "Back to gallery" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-sort.php:109 +#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-sort.php:104 msgid "Presort" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-sort.php:110 +#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-sort.php:105 msgid "Unsorted" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-sort.php:113 +#: products/photocrati_nextgen/modules/ngglegacy/admin/manage-sort.php:108 #: products/photocrati_nextgen/modules/ngglegacy/admin/media-upload.php:241 msgid "Alt/Title text" msgstr "" @@ -2586,72 +2279,65 @@ msgstr "" msgid "Create new page:" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/manage.php:606 +#: products/photocrati_nextgen/modules/ngglegacy/admin/manage.php:586 msgid "Gallery deleted successfully " msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/manage.php:677 -#: products/photocrati_nextgen/modules/ngglegacy/admin/manage.php:680 +#: products/photocrati_nextgen/modules/ngglegacy/admin/manage.php:657 +#: products/photocrati_nextgen/modules/ngglegacy/admin/manage.php:660 msgid "Rotate images" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/manage.php:702 +#: products/photocrati_nextgen/modules/ngglegacy/admin/manage.php:682 msgid "Pictures deleted successfully " msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/manage.php:800 +#: products/photocrati_nextgen/modules/ngglegacy/admin/manage.php:778 msgid "Tags changed" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/manage.php:840 +#: products/photocrati_nextgen/modules/ngglegacy/admin/manage.php:818 msgid "Update successful" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/manage.php:875 +#: products/photocrati_nextgen/modules/ngglegacy/admin/manage.php:853 msgid "New gallery page ID" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/manage.php:875 +#: products/photocrati_nextgen/modules/ngglegacy/admin/manage.php:853 msgid "created" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/manage.php:913 +#: products/photocrati_nextgen/modules/ngglegacy/admin/manage.php:891 msgid "Published a new post" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/manage.php:1060 +#: products/photocrati_nextgen/modules/ngglegacy/admin/manage.php:1022 +msgid "1 item" +msgid_plural "%s items" +msgstr[0] "" +msgstr[1] "" + +#: products/photocrati_nextgen/modules/ngglegacy/admin/manage.php:1038 msgid "Go to the first page" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/manage.php:1067 +#: products/photocrati_nextgen/modules/ngglegacy/admin/manage.php:1045 msgid "Go to the previous page" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/manage.php:1076 +#: products/photocrati_nextgen/modules/ngglegacy/admin/manage.php:1054 msgid "Current page" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/manage.php:1087 +#: products/photocrati_nextgen/modules/ngglegacy/admin/manage.php:1065 msgid "Go to the next page" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/manage.php:1094 +#: products/photocrati_nextgen/modules/ngglegacy/admin/manage.php:1072 msgid "Go to the last page" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/manage.php:1046 -#, php-format -msgid "1 item" -msgid_plural "%s items" -msgstr[0] "" -msgstr[1] "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/manage.php:1046 -#, php-format -msgctxt "paging" -msgid "%1$s of %2$s" -msgstr "" - #: products/photocrati_nextgen/modules/ngglegacy/admin/media-upload.php:11 msgid "NextGEN Gallery" msgstr "" @@ -2664,6 +2350,11 @@ msgstr "" msgid "Select »" msgstr "" +#: products/photocrati_nextgen/modules/ngglegacy/admin/media-upload.php:229 +#: products/photocrati_nextgen/modules/widget/templates/form_gallery.php:15 +msgid "Show" +msgstr "" + #: products/photocrati_nextgen/modules/ngglegacy/admin/media-upload.php:230 msgid "Hide" msgstr "" @@ -2677,32 +2368,12 @@ msgstr "" msgid "Alignment" msgstr "" -#: products/photocrati_nextgen/modules/nextgen_basic_singlepic/adapter.nextgen_basic_singlepic_form.php:127 -#: products/photocrati_nextgen/modules/ngglegacy/admin/media-upload.php:252 -#: products/photocrati_nextgen/modules/ngglegacy/admin/publish.php:47 -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:583 -msgid "None" -msgstr "" - -#: products/photocrati_nextgen/modules/nextgen_basic_singlepic/adapter.nextgen_basic_singlepic_form.php:128 -#: products/photocrati_nextgen/modules/ngglegacy/admin/media-upload.php:254 -#: products/photocrati_nextgen/modules/ngglegacy/admin/publish.php:49 -msgid "Left" -msgstr "" - #: products/photocrati_nextgen/modules/ngglegacy/admin/media-upload.php:256 #: products/photocrati_nextgen/modules/ngglegacy/admin/publish.php:51 msgid "Center" msgstr "" -#: products/photocrati_nextgen/modules/nextgen_basic_singlepic/adapter.nextgen_basic_singlepic_form.php:129 -#: products/photocrati_nextgen/modules/ngglegacy/admin/media-upload.php:258 -#: products/photocrati_nextgen/modules/ngglegacy/admin/publish.php:53 -msgid "Right" -msgstr "" - #: products/photocrati_nextgen/modules/ngglegacy/admin/media-upload.php:262 -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:690 msgid "Size" msgstr "" @@ -2747,36 +2418,24 @@ msgid "Server Settings" msgstr "" #: products/photocrati_nextgen/modules/ngglegacy/admin/overview.php:97 -msgid "" -"NextGEN Gallery is one of the most popular Wordpress plugins of all time " -"with over 9 million downloads. It is developed and supported by Photocrati " -"Media. We'd like to offer a special thanks to Alex Rabe, who first developed " -"the plugin and maintained it through 2011." +msgid "NextGEN Gallery is one of the most popular WordPress plugins of all time with over 12 million downloads." +msgstr "" + +#: products/photocrati_nextgen/modules/ngglegacy/admin/overview.php:97 +msgid "It is developed and supported by Photocrati Media. We'd like to offer a special thanks to Alex Rabe, who first developed the plugin and maintained it through 2011." msgstr "" #: products/photocrati_nextgen/modules/ngglegacy/admin/overview.php:98 -msgid "" -"<strong>NEED HELP?</strong> If you need help or assistance please visit the " -"<a href='http://wordpress.org/support/plugin/nextgen-gallery'>NextGEN " -"Gallery forums on WordPress.org</a>. Please note that we actively monitor " -"and participate in the forums, but given that NextGEN Gallery is a free " -"product, we don't guarantee replies to support queries." +msgid "<strong>NEED HELP?</strong> If you need help or assistance please visit the <a href='http://wordpress.org/support/plugin/nextgen-gallery'>NextGEN Gallery forums on WordPress.org</a>. Please note that we actively monitor and participate in the forums, but given that NextGEN Gallery is a free product, we don't guarantee replies to support queries." msgstr "" #: products/photocrati_nextgen/modules/ngglegacy/admin/overview.php:99 -msgid "" -"<strong>EXTENDING NEXTGEN?</strong> There are many third party plugins that " -"add displays and functionality for NextGEN Gallery. See our <a href='http://" -"www.nextgen-gallery.com/nextgen-gallery-extension-plugins/'>Complete List of " -"NextGEN Extension Plugins</a>." +msgid "<strong>EXTENDING NEXTGEN?</strong> There are many third party plugins that add displays and functionality for NextGEN Gallery. See our <a href='http://www.nextgen-gallery.com/nextgen-gallery-extension-plugins/'>Complete List of NextGEN Extension Plugins</a>." msgstr "" #: products/photocrati_nextgen/modules/ngglegacy/admin/overview.php:107 #, php-format -msgid "" -"This plugin is primarily developed, maintained, supported and documented by " -"<a href=\"%s\" target=\"_blank\">Photocrati Media</a> with a lot of love & " -"effort. Any kind of contribution would be highly appreciated. Thanks!" +msgid "This plugin is primarily developed, maintained, supported and documented by <a href=\"%s\" target=\"_blank\">Photocrati Media</a> with a lot of love & effort. Any kind of contribution would be highly appreciated. Thanks!" msgstr "" #: products/photocrati_nextgen/modules/ngglegacy/admin/overview.php:112 @@ -2819,9 +2478,7 @@ msgstr "" #: products/photocrati_nextgen/modules/ngglegacy/admin/overview.php:226 #, php-format -msgid "" -"Newsfeed could not be loaded. Check the <a href=\"%s\">front page</a> to " -"check for updates." +msgid "Newsfeed could not be loaded. Check the <a href=\"%s\">front page</a> to check for updates." msgstr "" #: products/photocrati_nextgen/modules/ngglegacy/admin/overview.php:238 @@ -2832,14 +2489,20 @@ msgstr "" msgid "At a Glance" msgstr "" +#: products/photocrati_nextgen/modules/ngglegacy/admin/overview.php:320 +#: products/photocrati_nextgen/modules/ngglegacy/lib/rewrite.php:223 +msgid "Album" +msgid_plural "Albums" +msgstr[0] "" +msgstr[1] "" + #: products/photocrati_nextgen/modules/ngglegacy/admin/overview.php:360 msgid "Storage Space" msgstr "" #: products/photocrati_nextgen/modules/ngglegacy/admin/overview.php:364 #, php-format -msgid "" -"<a href=\"%1$s\" title=\"Manage Uploads\" class=\"musublink\">%2$sMB</a>" +msgid "<a href=\"%1$s\" title=\"Manage Uploads\" class=\"musublink\">%2$sMB</a>" msgstr "" #: products/photocrati_nextgen/modules/ngglegacy/admin/overview.php:365 @@ -2848,9 +2511,7 @@ msgstr "" #: products/photocrati_nextgen/modules/ngglegacy/admin/overview.php:372 #, php-format -msgid "" -"<a href=\"%1$s\" title=\"Manage Uploads\" class=\"musublink\">%2$sMB (%3$s%%)" -"</a>" +msgid "<a href=\"%1$s\" title=\"Manage Uploads\" class=\"musublink\">%2$sMB (%3$s%%)</a>" msgstr "" #: products/photocrati_nextgen/modules/ngglegacy/admin/overview.php:373 @@ -2953,11 +2614,7 @@ msgid "PHP XML support" msgstr "" #: products/photocrati_nextgen/modules/ngglegacy/admin/overview.php:495 -msgid "" -"NextGEN Gallery contains some functions which are only available under PHP " -"5.2. You are using the old PHP 4 version, upgrade now! It's no longer " -"supported by the PHP group. Many shared hosting providers offer both PHP 4 " -"and PHP 5, running simultaneously. Ask your provider if they can do this." +msgid "NextGEN Gallery contains some functions which are only available under PHP 5.2. You are using the old PHP 4 version, upgrade now! It's no longer supported by the PHP group. Many shared hosting providers offer both PHP 4 and PHP 5, running simultaneously. Ask your provider if they can do this." msgstr "" #: products/photocrati_nextgen/modules/ngglegacy/admin/publish.php:35 @@ -2977,13 +2634,7 @@ msgid "Draft" msgstr "" #: products/photocrati_nextgen/modules/ngglegacy/admin/roles.php:26 -msgid "" -"Select the lowest role which should be able to access the following " -"capabilities. NextGEN Gallery supports the standard roles from WordPress." -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/roles.php:27 -msgid "For a more flexible user management you can use the" +msgid "Select the lowest role which should be able to access the following capabilities. NextGEN Gallery supports the standard roles from WordPress." msgstr "" #: products/photocrati_nextgen/modules/ngglegacy/admin/roles.php:31 @@ -3022,893 +2673,214 @@ msgstr "" msgid "NextGEN Attach Interface" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/rotate.php:60 +#: products/photocrati_nextgen/modules/ngglegacy/admin/rotate.php:68 msgid "Image rotated" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/rotate.php:62 +#: products/photocrati_nextgen/modules/ngglegacy/admin/rotate.php:70 msgid "Error rotating thumbnail" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/rotate.php:85 +#: products/photocrati_nextgen/modules/ngglegacy/admin/rotate.php:93 msgid "90° clockwise" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/rotate.php:86 +#: products/photocrati_nextgen/modules/ngglegacy/admin/rotate.php:94 msgid "90° counter-clockwise" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/rotate.php:87 +#: products/photocrati_nextgen/modules/ngglegacy/admin/rotate.php:95 msgid "Flip vertically" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/rotate.php:88 +#: products/photocrati_nextgen/modules/ngglegacy/admin/rotate.php:96 msgid "Flip horizontally" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:22 -#: products/photocrati_nextgen/modules/ngglegacy/admin/upgrade.php:204 -#, php-format -msgid "Rebuild image structure : %s / %s images" +#: products/photocrati_nextgen/modules/ngglegacy/admin/showmeta.php:29 +msgid "Meta Data" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:23 -#: products/photocrati_nextgen/modules/ngglegacy/admin/upgrade.php:205 -#, php-format -msgid "Rebuild gallery structure : %s / %s galleries" +#: products/photocrati_nextgen/modules/ngglegacy/admin/showmeta.php:34 +#: products/photocrati_nextgen/modules/ngglegacy/admin/showmeta.php:60 +#: products/photocrati_nextgen/modules/ngglegacy/admin/showmeta.php:85 +#: products/photocrati_nextgen/modules/ngglegacy/admin/showmeta.php:109 +msgid "Tag" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:24 -#: products/photocrati_nextgen/modules/ngglegacy/admin/upgrade.php:206 -#, php-format -msgid "Rebuild album structure : %s / %s albums" +#: products/photocrati_nextgen/modules/ngglegacy/admin/showmeta.php:35 +#: products/photocrati_nextgen/modules/ngglegacy/admin/showmeta.php:61 +#: products/photocrati_nextgen/modules/ngglegacy/admin/showmeta.php:86 +#: products/photocrati_nextgen/modules/ngglegacy/admin/showmeta.php:110 +msgid "Value" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:81 -#: products/photocrati_nextgen/modules/ngglegacy/admin/upgrade.php:263 -msgid "Done." +#: products/photocrati_nextgen/modules/ngglegacy/admin/showmeta.php:49 +msgid "No meta data saved" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:196 -msgid "Cache cleared" +#: products/photocrati_nextgen/modules/ngglegacy/admin/showmeta.php:55 +msgid "EXIF Data" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:315 -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:334 -msgid "General Options" +#: products/photocrati_nextgen/modules/ngglegacy/admin/showmeta.php:74 +msgid "No exif data" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:317 -msgid "Image" -msgid_plural "Images" -msgstr[0] "" -msgstr[1] "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:319 -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:572 -msgid "Effects" +#: products/photocrati_nextgen/modules/ngglegacy/admin/showmeta.php:81 +msgid "IPTC Data" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:320 -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:614 -msgid "Watermark" +#: products/photocrati_nextgen/modules/ngglegacy/admin/showmeta.php:105 +msgid "XMP Data" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:340 -#: products/photocrati_nextgen/modules/ngglegacy/admin/wpmu.php:54 -msgid "Gallery path" +#: products/photocrati_nextgen/modules/ngglegacy/admin/tags.php:41 +msgid "Most popular" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:342 -msgid "This is the default path for all galleries" +#: products/photocrati_nextgen/modules/ngglegacy/admin/tags.php:42 +msgid "Least used" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:345 -msgid "Delete image files" +#: products/photocrati_nextgen/modules/ngglegacy/admin/tags.php:43 +msgid "Alphabetical" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:347 -msgid "Delete files, when removing a gallery in the database" +#: products/photocrati_nextgen/modules/ngglegacy/admin/tags.php:99 +msgid "Manage image tags" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:350 -msgid "Activate permalinks" +#: products/photocrati_nextgen/modules/ngglegacy/admin/tags.php:111 +msgid "Existing Tags" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:352 -msgid "" -"When you activate this option, you need to update your permalink structure " -"one time." +#: products/photocrati_nextgen/modules/ngglegacy/admin/tags.php:115 +msgid "Search tags" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:353 -msgid "Gallery slug name :" +#: products/photocrati_nextgen/modules/ngglegacy/admin/tags.php:119 +msgid "Go" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:357 -msgid "Create new URL friendly image slugs" +#: products/photocrati_nextgen/modules/ngglegacy/admin/tags.php:124 +msgid "Sort Order:" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:358 -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:474 -msgid "Proceed now" +#: products/photocrati_nextgen/modules/ngglegacy/admin/tags.php:159 +#: products/photocrati_nextgen/modules/ngglegacy/admin/tags.php:163 +#: products/photocrati_nextgen/modules/ngglegacy/admin/tags.php:176 +msgid "Previous tags" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:361 -msgid "Select graphic library" +#: products/photocrati_nextgen/modules/ngglegacy/admin/tags.php:172 +msgid "Next tags" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:362 -msgid "GD Library" +#: products/photocrati_nextgen/modules/ngglegacy/admin/tags.php:184 +msgid "Rename Tag" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:363 -msgid "ImageMagick (Experimental). Path to the library :" +#: products/photocrati_nextgen/modules/ngglegacy/admin/tags.php:192 +msgid "Enter the tag to rename and its new value. You can use this feature to merge tags too. Click \"Rename\" and all posts which use this tag will be updated." msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:368 -msgid "Activate Media RSS feed" +#: products/photocrati_nextgen/modules/ngglegacy/admin/tags.php:193 +#: products/photocrati_nextgen/modules/ngglegacy/admin/tags.php:241 +msgid "You can specify multiple tags to rename by separating them with commas." msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:370 -msgid "" -"A RSS feed will be added to you blog header. Useful for CoolIris/PicLens" +#: products/photocrati_nextgen/modules/ngglegacy/admin/tags.php:197 +msgid "Tag(s) to rename:" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:373 -msgid "Activate PicLens/CoolIris support" +#: products/photocrati_nextgen/modules/ngglegacy/admin/tags.php:201 +msgid "New tag name(s):" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:375 -msgid "" -"When you activate this option, some javascript is added to your site footer. " -"Make sure that wp_footer is called in your theme." +#: products/photocrati_nextgen/modules/ngglegacy/admin/tags.php:204 +msgid "Rename" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:378 -msgid "Tags / Categories" +#: products/photocrati_nextgen/modules/ngglegacy/admin/tags.php:210 +msgid "Delete Tag" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:381 -msgid "Activate related images" +#: products/photocrati_nextgen/modules/ngglegacy/admin/tags.php:218 +msgid "Enter the name of the tag to delete. This tag will be removed from all posts." msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:383 -msgid "This option will append related images to every post" +#: products/photocrati_nextgen/modules/ngglegacy/admin/tags.php:219 +msgid "You can specify multiple tags to delete by separating them with commas" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:387 -msgid "Match with" +#: products/photocrati_nextgen/modules/ngglegacy/admin/tags.php:223 +msgid "Tag(s) to delete:" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:393 -msgid "Max. number of images" +#: products/photocrati_nextgen/modules/ngglegacy/admin/tags.php:232 +msgid "Edit Tag Slug" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:395 -msgid "0 will show all images" +#: products/photocrati_nextgen/modules/ngglegacy/admin/tags.php:240 +msgid "Enter the tag name to edit and its new slug. This will be used in tagcloud links. <a href=\"http://codex.wordpress.org/Glossary#Slug\" target=\"_blank\">Slug definition</a>" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:399 -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:435 -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:477 -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:562 -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:597 -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:860 -msgid "More settings" +#: products/photocrati_nextgen/modules/ngglegacy/admin/tags.php:245 +msgid "Tag(s) to match:" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:409 -msgid "Thumbnail settings" +#: products/photocrati_nextgen/modules/ngglegacy/admin/tags.php:249 +msgid "Slug(s) to set:" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:413 -msgid "" -"Please note : If you change the settings, you need to recreate the " -"thumbnails under -> Manage Gallery ." +#: products/photocrati_nextgen/modules/ngglegacy/admin/templates/manage_gallery/gallery_create_page_field.php:3 +msgid "Main Page (no parent)" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:422 -msgid "These values are maximum values " +#: products/photocrati_nextgen/modules/ngglegacy/admin/templates/manage_gallery/gallery_create_page_field.php:10 +msgid "Add page" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:445 -msgid "Image settings" +#: products/photocrati_nextgen/modules/ngglegacy/admin/templates/manage_gallery/gallery_link_to_page_field.php:3 +msgid "Not linked" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:451 -msgid "Resize Images" +#: products/photocrati_nextgen/modules/ngglegacy/admin/templates/manage_gallery/gallery_preview_image_field.php:3 +msgid "No picture" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:460 -msgid "Backup original images" +#: products/photocrati_nextgen/modules/ngglegacy/admin/thumbnails-template.php:103 +msgid "These are maximum values" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:462 -msgid "Creates a backup for inserted images" +#: products/photocrati_nextgen/modules/ngglegacy/admin/wpmu.php:33 +msgid "Update successfully" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:465 -msgid "Automatically resize" +#: products/photocrati_nextgen/modules/ngglegacy/admin/wpmu.php:48 +msgid "Network Options" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:467 -msgid "Automatically resize images on upload." +#: products/photocrati_nextgen/modules/ngglegacy/admin/wpmu.php:54 +msgid "Gallery path" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:470 -msgid "Single picture" +#: products/photocrati_nextgen/modules/ngglegacy/admin/wpmu.php:56 +msgid "This is the default path for all blogs. With the placeholder %BLOG_ID% you can organize the folder structure better." msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:473 -msgid "Clear cache folder" +#: products/photocrati_nextgen/modules/ngglegacy/admin/wpmu.php:57 +#, php-format +msgid "The default setting should be %s" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:494 -msgid "Deactivate gallery page link" +#: products/photocrati_nextgen/modules/ngglegacy/admin/wpmu.php:61 +msgid "Enable upload quota check" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:496 -msgid "" -"The album will not link to a gallery subpage. The gallery is shown on the " -"same page." -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:500 -msgid "Number of images per page" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:502 -msgid "0 will disable pagination, all images on one page" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:506 -msgid "Number of columns" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:508 -msgid "" -"0 will display as much as possible based on the width of your theme. Setting " -"normally only required for captions below the images" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:512 -msgid "Integrate slideshow" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:519 -msgid "Show first" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:525 -msgid "Show ImageBrowser" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:527 -msgid "The gallery will open the ImageBrowser instead the effect." -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:531 -msgid "Add hidden images" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:533 -msgid "" -"If pagination is used, this option will still show all images in the modal " -"window (Thickbox, Lightbox etc.). Note : This increases the page load" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:539 -msgid "" -"Browse images without reload the page. Note : Works only in combination with " -"Shutter effect" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:543 -msgid "Sort options" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:546 -msgid "Sort thumbnails" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:548 -msgid "Custom order" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:550 -msgid "File name" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:551 -msgid "Alt / Title text" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:552 -#: products/photocrati_nextgen/modules/ngglegacy/view/imagebrowser-exif.php:58 -msgid "Date / Time" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:556 -msgid "Sort direction" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:576 -msgid "" -"Here you can select the thumbnail effect, NextGEN Gallery will integrate the " -"required HTML code in the images. Please note that only the Shutter and " -"Thickbox effect will automatic added to your theme." -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:577 -msgid "With the placeholder" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:577 -msgid "" -"you can activate a navigation through the images (depend on the effect). " -"Change the code line only , when you use a different thumbnail effect or you " -"know what you do." -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:580 -msgid "JavaScript Thumbnail effect" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:584 -msgid "Thickbox" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:585 -msgid "Lightbox" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:586 -msgid "Highslide" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:587 -msgid "Shutter" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:593 -msgid "Link Code line" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:615 -msgid "" -"Please note : You can only activate the watermark under -> Manage Gallery . " -"This action cannot be undone." -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:620 -msgid "Preview" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:622 -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:627 -msgid "Position" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:647 -msgid "Offset" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:663 -msgid "Use image as watermark" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:666 -msgid "URL to file" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:668 -msgid "The accessing of URL files is disabled at your server (allow_url_fopen)" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:671 -msgid "Use text as watermark" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:674 -msgid "Font" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:683 -msgid "This function will not work, cause you need the FreeType library" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:685 -msgid "" -"You can upload more fonts in the folder <strong>nggallery/fonts</strong>" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:694 -msgid "Color" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:696 -msgid "(hex w/o #)" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:699 -msgid "Text" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:703 -msgid "Opaque" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:724 -msgid "Default size (W x H)" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:729 -msgid "Duration time" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:730 -msgid "sec." -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:733 -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:810 -msgid "Transition / Fade effect" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:736 -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:813 -#: products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_slideshow_form.php:200 -msgid "fade" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:737 -msgid "blindX" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:738 -msgid "cover" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:739 -msgid "scrollUp" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:740 -msgid "scrollDown" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:741 -msgid "shuffle" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:742 -msgid "toss" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:743 -msgid "wipe" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:745 -msgid "See here for more information about the effects :" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:749 -msgid "Settings for the JW Image Rotator" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:758 -msgid "" -"The path to JW Image Rotator is not defined, the slideshow will not work." -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:770 -msgid "Path to the JW Image Rotator (URL)" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:773 -msgid "Search now" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:774 -msgid "Press the button below to search for the JW Image Rotator" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:778 -msgid "Shuffle mode" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:796 -msgid "You can change the logo at the watermark settings" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:802 -#: products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_slideshow_form.php:182 -msgid "true" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:803 -#: products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_slideshow_form.php:183 -msgid "false" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:804 -#: products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_slideshow_form.php:184 -msgid "fit" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:805 -#: products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_slideshow_form.php:185 -msgid "none" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:814 -#: products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_slideshow_form.php:201 -msgid "bgfade" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:815 -#: products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_slideshow_form.php:202 -msgid "slowfade" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:816 -#: products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_slideshow_form.php:203 -msgid "circles" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:817 -#: products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_slideshow_form.php:204 -msgid "bubbles" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:818 -#: products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_slideshow_form.php:205 -msgid "blocks" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:819 -#: products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_slideshow_form.php:206 -msgid "fluids" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:820 -#: products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_slideshow_form.php:207 -msgid "flash" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:821 -#: products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_slideshow_form.php:208 -msgid "lines" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:831 -msgid "Background Color" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:836 -msgid "Texts / Buttons Color" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:841 -msgid "Rollover / Active Color" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:846 -msgid "Screen Color" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:851 -msgid "Background music (URL)" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:855 -msgid "Try XHTML validation (with CDATA)" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:857 -msgid "" -"Important : Could causes problem at some browser. Please recheck your page." -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/showmeta.php:29 -msgid "Meta Data" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/showmeta.php:34 -#: products/photocrati_nextgen/modules/ngglegacy/admin/showmeta.php:60 -#: products/photocrati_nextgen/modules/ngglegacy/admin/showmeta.php:85 -#: products/photocrati_nextgen/modules/ngglegacy/admin/showmeta.php:109 -msgid "Tag" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/showmeta.php:35 -#: products/photocrati_nextgen/modules/ngglegacy/admin/showmeta.php:61 -#: products/photocrati_nextgen/modules/ngglegacy/admin/showmeta.php:86 -#: products/photocrati_nextgen/modules/ngglegacy/admin/showmeta.php:110 -msgid "Value" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/showmeta.php:49 -msgid "No meta data saved" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/showmeta.php:55 -msgid "EXIF Data" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/showmeta.php:74 -msgid "No exif data" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/showmeta.php:81 -msgid "IPTC Data" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/showmeta.php:105 -msgid "XMP Data" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/style.php:11 -msgid "(From the theme folder)" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/style.php:43 -msgid "You do not have sufficient permissions to edit templates for this blog." -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/style.php:52 -msgid "CSS file successfully updated" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/style.php:91 -msgid "Activate and use style sheet:" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/style.php:111 -msgid "Activate" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/style.php:121 -#, php-format -msgid "Editing <strong>%s</strong>" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/style.php:123 -#, php-format -msgid "Browsing <strong>%s</strong>" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/style.php:133 -msgid "Version" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/style.php:136 -msgid "" -"Tip : Copy your stylesheet (nggallery.css) to your theme folder, so it will " -"be not lost during a upgrade" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/style.php:138 -msgid "" -"Your theme contain a NextGEN Gallery stylesheet (nggallery.css), this file " -"will be used" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/style.php:140 -msgid "" -"Tip No. 2: Use the color picker below to help you find the right color " -"scheme for your gallery!" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/style.php:156 -msgid "Update File" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/style.php:159 -msgid "If this file were writable you could edit it." -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/style.php:164 -msgid "Oops, no such file exists! Double check the name and try again, merci." -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/tags.php:41 -msgid "Most popular" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/tags.php:42 -msgid "Least used" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/tags.php:43 -msgid "Alphabetical" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/tags.php:100 -msgid "Manage image tags" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/tags.php:112 -msgid "Existing Tags" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/tags.php:116 -msgid "Search tags" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/tags.php:120 -msgid "Go" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/tags.php:125 -msgid "Sort Order:" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/tags.php:160 -#: products/photocrati_nextgen/modules/ngglegacy/admin/tags.php:164 -#: products/photocrati_nextgen/modules/ngglegacy/admin/tags.php:177 -msgid "Previous tags" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/tags.php:173 -msgid "Next tags" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/tags.php:185 -msgid "Rename Tag" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/tags.php:193 -msgid "" -"Enter the tag to rename and its new value. You can use this feature to " -"merge tags too. Click \"Rename\" and all posts which use this tag will be " -"updated." -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/tags.php:194 -#: products/photocrati_nextgen/modules/ngglegacy/admin/tags.php:242 -msgid "You can specify multiple tags to rename by separating them with commas." -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/tags.php:198 -msgid "Tag(s) to rename:" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/tags.php:202 -msgid "New tag name(s):" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/tags.php:205 -msgid "Rename" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/tags.php:211 -msgid "Delete Tag" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/tags.php:219 -msgid "" -"Enter the name of the tag to delete. This tag will be removed from all " -"posts." -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/tags.php:220 -msgid "You can specify multiple tags to delete by separating them with commas" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/tags.php:224 -msgid "Tag(s) to delete:" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/tags.php:233 -msgid "Edit Tag Slug" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/tags.php:241 -msgid "" -"Enter the tag name to edit and its new slug. This will be used in tagcloud " -"links. <a href=\"http://codex.wordpress.org/Glossary#Slug\" target=\"_blank" -"\">Slug definition</a>" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/tags.php:246 -msgid "Tag(s) to match:" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/tags.php:250 -msgid "Slug(s) to set:" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/templates/manage_gallery/gallery_create_page_field.php:3 -msgid "Main Page (no parent)" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/templates/manage_gallery/gallery_create_page_field.php:10 -msgid "Add page" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/templates/manage_gallery/gallery_link_to_page_field.php:3 -msgid "Not linked" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/thumbnails-template.php:103 -msgid "These are maximum values" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/upgrade.php:61 -msgid "" -"Some folders/files could not renamed, please recheck the permission and " -"rescan the folder in the manage gallery section." -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/upgrade.php:63 -msgid "Rename failed" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/upgrade.php:159 -#: products/photocrati_nextgen/modules/ngglegacy/admin/upgrade.php:178 -msgid "Upgrade NextGEN Gallery" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/upgrade.php:160 -msgid "The script detect that you upgrade from a older version." -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/upgrade.php:161 -msgid "" -"Your database tables for NextGEN Gallery is out-of-date, and must be " -"upgraded before you can continue." -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/upgrade.php:162 -msgid "" -"If you would like to downgrade later, please make first a complete backup of " -"your database and the images." -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/upgrade.php:163 -msgid "The upgrade process may take a while, so please be patient." -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/upgrade.php:164 -msgid "Start upgrade now" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/upgrade.php:180 -msgid "Upgrade finished..." -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/upgrade.php:181 -msgid "Continue" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/wpmu.php:33 -msgid "Update successfully" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/wpmu.php:48 -msgid "Network Options" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/wpmu.php:56 -msgid "" -"This is the default path for all blogs. With the placeholder %BLOG_ID% you " -"can organize the folder structure better." -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/wpmu.php:57 -#, php-format -msgid "The default setting should be %s" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/wpmu.php:61 -msgid "Enable upload quota check" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/admin/wpmu.php:63 -msgid "Should work if the gallery is bellow the blog.dir" +#: products/photocrati_nextgen/modules/ngglegacy/admin/wpmu.php:63 +msgid "Should work if the gallery is bellow the blog.dir" msgstr "" #: products/photocrati_nextgen/modules/ngglegacy/admin/wpmu.php:67 @@ -3951,37 +2923,34 @@ msgstr "" msgid "Choose the default style for the galleries." msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/lib/core.php:396 +#: products/photocrati_nextgen/modules/ngglegacy/lib/core.php:214 #, php-format -msgid "" -"Note : Based on your server memory limit you should not upload larger images " -"then <strong>%d x %d</strong> pixel" +msgid "Note : Based on your server memory limit you should not upload larger images then <strong>%d x %d</strong> pixel" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/lib/ngg-db.php:337 -#: products/photocrati_nextgen/modules/ngglegacy/lib/ngg-db.php:338 +#: products/photocrati_nextgen/modules/ngglegacy/lib/ngg-db.php:208 +#: products/photocrati_nextgen/modules/ngglegacy/lib/ngg-db.php:209 msgid "Album overview" msgstr "" #: products/photocrati_nextgen/modules/ngglegacy/lib/post-thumbnail.php:68 -#: products/photocrati_nextgen/modules/ngglegacy/lib/post-thumbnail.php:70 +#: products/photocrati_nextgen/modules/ngglegacy/lib/post-thumbnail.php:69 msgid "Set NextGEN featured image" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/lib/post-thumbnail.php:328 -#: products/photocrati_nextgen/modules/ngglegacy/lib/post-thumbnail.php:329 +#: products/photocrati_nextgen/modules/ngglegacy/lib/post-thumbnail.php:326 +#: products/photocrati_nextgen/modules/ngglegacy/lib/post-thumbnail.php:327 msgid "Set featured image" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/lib/post-thumbnail.php:356 +#: products/photocrati_nextgen/modules/ngglegacy/lib/post-thumbnail.php:354 msgid "Remove featured image" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/lib/rewrite.php:223 -msgid "Album" -msgid_plural "Albums" -msgstr[0] "" -msgstr[1] "" +#: products/photocrati_nextgen/modules/ngglegacy/lib/rewrite.php:215 +#: products/photocrati_nextgen/modules/widget/class.widget_slideshow.php:81 +msgid "Slideshow" +msgstr "" #: products/photocrati_nextgen/modules/ngglegacy/lib/tags.php:35 msgid "No new tag specified!" @@ -4014,8 +2983,7 @@ msgstr "" #: products/photocrati_nextgen/modules/ngglegacy/lib/tags.php:143 #, php-format -msgid "" -"Merge tag(s) «%1$s» to «%2$s». %3$s objects edited." +msgid "Merge tag(s) «%1$s» to «%2$s». %3$s objects edited." msgstr "" #: products/photocrati_nextgen/modules/ngglegacy/lib/tags.php:146 @@ -4035,76 +3003,51 @@ msgstr "" msgid "%1s tag(s) deleted." msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/lib/tags.php:206 +#: products/photocrati_nextgen/modules/ngglegacy/lib/tags.php:208 msgid "No new slug(s) specified!" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/lib/tags.php:218 +#: products/photocrati_nextgen/modules/ngglegacy/lib/tags.php:220 msgid "Tags number and slugs number isn't the same!" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/lib/tags.php:245 +#: products/photocrati_nextgen/modules/ngglegacy/lib/tags.php:247 msgid "No slug edited." msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/lib/tags.php:247 +#: products/photocrati_nextgen/modules/ngglegacy/lib/tags.php:249 #, php-format msgid "%s slug(s) edited." msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/nggallery.php:64 -msgid "" -"<strong>Translation by : </strong><a target=\"_blank\" href=\"http://www." -"nextgen-gallery.com/languages/\">See here</a>" +#: products/photocrati_nextgen/modules/ngglegacy/nggallery.php:60 +msgid "<strong>Translation by : </strong><a target=\"_blank\" href=\"http://www.nextgen-gallery.com/languages/\">See here</a>" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/nggallery.php:65 -msgid "" -"<strong>This translation is not yet updated for Version 1.9.0</strong>. If " -"you would like to help with translation, download the current po from the " -"plugin folder and read <a href=\"http://www.nextgen-gallery.com/languages/" -"\">here</a> how you can translate the plugin." -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/nggallery.php:158 -msgid "" -"Sorry, NextGEN Gallery works only with a Memory Limit of 16 MB or higher" +#: products/photocrati_nextgen/modules/ngglegacy/nggallery.php:122 +msgid "Sorry, NextGEN Gallery works only with a Memory Limit of 16 MB or higher" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/nggallery.php:184 +#: products/photocrati_nextgen/modules/ngglegacy/nggallery.php:148 msgid "Picture tag" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/nggallery.php:185 +#: products/photocrati_nextgen/modules/ngglegacy/nggallery.php:149 msgid "Picture tag: %2$l." msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/nggallery.php:186 +#: products/photocrati_nextgen/modules/ngglegacy/nggallery.php:150 msgid "Separate picture tags with commas." msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/nggallery.php:317 +#: products/photocrati_nextgen/modules/ngglegacy/nggallery.php:279 msgid "Get help" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/nggallery.php:318 +#: products/photocrati_nextgen/modules/ngglegacy/nggallery.php:280 msgid "Contribute" msgstr "" -#: products/photocrati_nextgen/modules/ngglegacy/nggfunctions.php:29 -msgid "[Gallery not found]" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/nggfunctions.php:163 -msgid "Related images for" -msgstr "" - -#: products/photocrati_nextgen/modules/ngglegacy/view/gallery-caption.php:32 -#: products/photocrati_nextgen/modules/ngglegacy/view/gallery.php:32 -#: products/photocrati_nextgen/modules/widget/class.widget_mediarss.php:93 -msgid "[View with PicLens]" -msgstr "" - #: products/photocrati_nextgen/modules/ngglegacy/view/imagebrowser-exif.php:38 msgid "Meta data" msgstr "" @@ -4117,6 +3060,10 @@ msgstr "" msgid "Focal Length" msgstr "" +#: products/photocrati_nextgen/modules/ngglegacy/view/imagebrowser-exif.php:58 +msgid "Date / Time" +msgstr "" + #: products/photocrati_nextgen/modules/ngglegacy/xml/media-rss.php:50 msgid "No galleries have been yet created." msgstr "" @@ -4171,22 +3118,7 @@ msgstr "" msgid "NextGEN Slideshow" msgstr "" -#: products/photocrati_nextgen/modules/widget/class.widget_slideshow.php:76 -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:321 -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:521 -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:721 -#: products/photocrati_nextgen/modules/ngglegacy/lib/rewrite.php:215 -msgid "Slideshow" -msgstr "" - -#: products/photocrati_nextgen/modules/widget/templates/form_gallery.php:15 -#: products/photocrati_nextgen/modules/ngglegacy/admin/media-upload.php:229 -msgid "Show" -msgstr "" - #: products/photocrati_nextgen/modules/widget/templates/form_gallery.php:26 -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:316 -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:520 msgid "Thumbnails" msgstr "" @@ -4195,8 +3127,6 @@ msgid "Original images" msgstr "" #: products/photocrati_nextgen/modules/widget/templates/form_gallery.php:42 -#: products/photocrati_nextgen/modules/ngglegacy/admin/settings.php:822 -#: products/photocrati_nextgen/modules/nextgen_basic_gallery/adapter.nextgen_basic_slideshow_form.php:209 msgid "random" msgstr "" @@ -4259,3 +3189,28 @@ msgstr "" #: products/photocrati_nextgen/modules/widget/templates/form_slideshow.php:23 msgid "All images" msgstr "" + +#: products/photocrati_nextgen/modules/widget/templates/form_slideshow.php:40 +msgid "Limit" +msgstr "" + +#. Plugin Name of the plugin/theme +msgid "NextGEN Gallery by Photocrati" +msgstr "" + +#. Plugin URI of the plugin/theme +msgid "http://www.nextgen-gallery.com" +msgstr "" + +#. Description of the plugin/theme +msgid "The most popular gallery plugin for WordPress and one of the most popular plugins of all time with over 12 million downloads." +msgstr "" + +#. Author of the plugin/theme +msgid "Photocrati Media" +msgstr "" + +#. Author URI of the plugin/theme +msgid "http://www.photocrati.com" +msgstr "" + diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/i18n/module.i18n.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/i18n/module.i18n.php index 8e3ff529495b9c9143ce7a35e716650ebb4f4424..203fe8a05b036c26ad837c5d4890769866f77094 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/i18n/module.i18n.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/i18n/module.i18n.php @@ -26,6 +26,7 @@ class M_I18N extends C_Base_Module $this->get_registry()->add_adapter('I_Image_Mapper', 'A_I18N_Image_Translation'); $this->get_registry()->add_adapter('I_Album_Mapper', 'A_I18N_Album_Translation'); $this->get_registry()->add_adapter('I_Gallery_Mapper', 'A_I18N_Gallery_Translation'); + $this->get_registry()->add_adapter('I_Displayed_Gallery', 'A_I18N_Displayed_Gallery_Translation'); // qTranslate requires we disable "Hide Untranslated Content" during routed app requests like // photocrati-ajax, when uploading new images, or retrieving dynamically altered (watermarked) images @@ -109,7 +110,7 @@ class M_I18N extends C_Base_Module { if (function_exists('icl_register_string')) { - $gallery = $this->get_registry()->get_utility('I_Gallery_Mapper')->find($gallery_id); + $gallery = C_Gallery_Mapper::get_instance()->find($gallery_id); if ($gallery) { icl_register_string('plugin_ngg', 'gallery_' . $gallery->{$gallery->id_field} . '_name', $gallery->title, TRUE); @@ -190,9 +191,56 @@ class M_I18N extends C_Base_Module return $in; } + static function mb_pathinfo($path, $options=null) + { + $ret = array( + 'dirname' => '', + 'basename' => '', + 'extension' => '', + 'filename' => '' + ); + $pathinfo = array(); + if (preg_match('%^(.*?)[\\\\/]*(([^/\\\\]*?)(\.([^\.\\\\/]+?)|))[\\\\/\.]*$%im', $path, $pathinfo)) + { + if (array_key_exists(1, $pathinfo)) + $ret['dirname'] = $pathinfo[1]; + if (array_key_exists(2, $pathinfo)) + $ret['basename'] = $pathinfo[2]; + if (array_key_exists(5, $pathinfo)) + $ret['extension'] = $pathinfo[5]; + if (array_key_exists(3, $pathinfo)) + $ret['filename'] = $pathinfo[3]; + } + switch ($options) { + case PATHINFO_DIRNAME: + case 'dirname': + return $ret['dirname']; + case PATHINFO_BASENAME: + case 'basename': + return $ret['basename']; + case PATHINFO_EXTENSION: + case 'extension': + return $ret['extension']; + case PATHINFO_FILENAME: + case 'filename': + return $ret['filename']; + default: + return $ret; + } + } + + static function mb_basename($path) + { + $separator = " qq "; + $path = preg_replace("/[^ ]/u", $separator . "\$0" . $separator, $path); + $base = basename($path); + return str_replace($separator, "", $base); + } + function get_type_list() { return array( + 'A_I18N_Displayed_Gallery_Translation' => 'adapter.i18n_displayed_gallery_translation.php', 'A_I18N_Image_Translation' => 'adapter.i18n_image_translation.php', 'A_I18N_Album_Translation' => 'adapter.i18n_album_translation.php', 'A_I18N_Gallery_Translation' => 'adapter.i18n_gallery_translation.php', diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/i18n/package.module.i18n.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/i18n/package.module.i18n.php new file mode 100644 index 0000000000000000000000000000000000000000..da6f549e27700519c194166e1bf131e54caeb4d9 --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/i18n/package.module.i18n.php @@ -0,0 +1,82 @@ +<?php +class A_I18N_Album_Translation extends Mixin +{ + public function set_defaults($entity) + { + $this->call_parent('set_defaults', $entity); + if (!is_admin()) { + if (!empty($entity->name)) { + $entity->name = M_I18N::translate($entity->name, 'album_' . $entity->{$entity->id_field} . '_name'); + } + if (!empty($entity->albumdesc)) { + $entity->albumdesc = M_I18N::translate($entity->albumdesc, 'album_' . $entity->{$entity->id_field} . '_description'); + } + // these fields are set when the album is a child to another album + if (!empty($entity->title)) { + $entity->title = M_I18N::translate($entity->title, 'album_' . $entity->{$entity->id_field} . '_name'); + } + if (!empty($entity->galdesc)) { + $entity->galdesc = M_I18N::translate($entity->galdesc, 'album_' . $entity->{$entity->id_field} . '_description'); + } + } + } +} +class A_I18N_Displayed_Gallery_Translation extends Mixin +{ + public function _get_image_entities($source_obj, $limit, $offset, $id_only, $returns) + { + $results = $this->call_parent('_get_image_entities', $source_obj, $limit, $offset, $id_only, $returns); + if (!is_admin() && in_array('image', $source_obj->returns)) { + foreach ($results as $entity) { + if (!empty($entity->description)) { + $entity->description = M_I18N::translate($entity->description, 'pic_' . $entity->pid . '_description'); + } + if (!empty($entity->alttext)) { + $entity->alttext = M_I18N::translate($entity->alttext, 'pic_' . $entity->pid . '_alttext'); + } + } + } + return $results; + } +} +class A_I18N_Gallery_Translation extends Mixin +{ + public function set_defaults($entity) + { + $this->call_parent('set_defaults', $entity); + if (!is_admin()) { + if (!empty($entity->title)) { + $entity->title = M_I18N::translate($entity->title, 'gallery_' . $entity->{$entity->id_field} . '_name'); + } + if (!empty($entity->galdesc)) { + $entity->galdesc = M_I18N::translate($entity->galdesc, 'gallery_' . $entity->{$entity->id_field} . '_description'); + } + } + } +} +class A_I18N_Image_Translation extends Mixin +{ + public function set_defaults($entity) + { + $this->call_parent('set_defaults', $entity); + if (!is_admin()) { + if (!empty($entity->description)) { + $entity->description = M_I18N::translate($entity->description, 'pic_' . $entity->{$entity->id_field} . '_description'); + } + if (!empty($entity->alttext)) { + $entity->alttext = M_I18N::translate($entity->alttext, 'pic_' . $entity->{$entity->id_field} . '_alttext'); + } + } + } +} +class A_I18N_Routing_App extends Mixin +{ + public function execute_route_handler($handler) + { + if (!empty($GLOBALS['q_config']) && defined('QTRANS_INIT')) { + global $q_config; + $q_config['hide_untranslated'] = 0; + } + return $this->call_parent('execute_route_handler', $handler); + } +} \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/module.lightbox.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/module.lightbox.php index e41180876b645bd66c92c754f035af84fc0513b2..f54fae496f5dfdf78e11cec421070111c0870db1 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/module.lightbox.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/module.lightbox.php @@ -1,19 +1,15 @@ <?php - /*** - { - Module: photocrati-lightbox, - Depends: { photocrati-nextgen_admin } - } -***/ +{ +Module: photocrati-lightbox, +Depends: { photocrati-nextgen_admin } +} + ***/ define('NGG_LIGHTBOX_OPTIONS_SLUG', 'ngg_lightbox_options'); -define('NGG_LIGHTBOX_ADVANCED_OPTIONS_SLUG', 'ngg_lightbox_advanced_options'); class M_Lightbox extends C_Base_Module { - static $_registered_lightboxes; - function define() { parent::define( @@ -25,297 +21,35 @@ class M_Lightbox extends C_Base_Module 'Photocrati Media', 'http://www.photocrati.com' ); - - include_once('class.lightbox_installer.php'); - C_Photocrati_Installer::add_handler($this->module_id, 'C_Lightbox_Installer'); - } - - function initialize() - { - parent::initialize(); - if (is_admin()) { - add_action('admin_init', array(&$this, 'add_all_lightbox_forms')); - } } /** - * Adds a configuration form to each library + * Registers hooks for the WordPress framework */ - function add_all_lightbox_forms() + function _register_hooks() { - foreach ($this->get_registry()->get_utility('I_Lightbox_Library_Mapper')->find_all() as $lib) { - $this->get_registry()->add_adapter('I_Form', 'A_Lightbox_Library_Form', $lib->name); - C_Form_Manager::get_instance()->add_form(NGG_LIGHTBOX_ADVANCED_OPTIONS_SLUG, $lib->name); - } + if (!is_admin()) + add_action('wp_enqueue_scripts', array(C_Lightbox_Library_Manager::get_instance(), 'maybe_enqueue')); + add_action('init', array(&$this, '_register_custom_post_type')); } - function _register_utilities() - { - // Provides a utility to perform CRUD operations for Lightbox libraries - $this->get_registry()->add_utility( - 'I_Lightbox_Library_Mapper', - 'C_Lightbox_Library_Mapper' - ); - } - - function _register_adapters() - { - // Provides factory methods for instantiating lightboxes - $this->get_registry()->add_adapter('I_Component_Factory', 'A_Lightbox_Factory'); - - // Provides an installer for lightbox libraries - $this->get_registry()->add_adapter('I_Installer', 'A_Lightbox_Installer'); - } - - /** - * Registers hooks for the WordPress framework - */ - function _register_hooks() - { - add_action('wp_enqueue_scripts', array($this, '_register_resources')); - add_action('wp_footer', array($this, '_enqueue_resources'), 3); - add_action('init', array(&$this, '_register_custom_post_type')); - } - - /** - * Registers the custom post type saved for lightbox libraries - */ - function _register_custom_post_type() - { - register_post_type('lightbox_library', array( - 'label' => 'Lightbox Library', - 'publicly_queryable' => FALSE, - 'exclude_from_search' => TRUE, - )); - } - /** - * Parses certain paths through get_static_url - * - * @param string $url - * @return string Resulting URL + * Registers the custom post type saved for lightbox libraries */ - static function _handle_url($url) + function _register_custom_post_type() { - $router = C_Component_Registry::get_instance()->get_utility('I_Router'); - if (0 !== strpos($url, '/') - && 0 !== strpos($url, 'wordpress#') - && 0 !== strpos($url, 'http://') - && 0 !== strpos($url, 'https://')) - { - $url = $router->get_static_url($url); - } - elseif (strpos($url, '/') === 0) { - $url = home_url($url); - } - - return $url; + register_post_type('lightbox_library', array( + 'label' => 'Lightbox Library', + 'publicly_queryable' => FALSE, + 'exclude_from_search' => TRUE, + )); } - /** - * Registers or enqueues resources for a given lightbox library - * - * @param object $library Lightbox library - */ - static function _register_library_resources($library, $register = TRUE) - { - if ($library) { - $i = 0; - foreach (explode("\n", $library->scripts) as $script) { - if (empty($script)) - continue; - - $script = self::_handle_url($script); - - // if _registered_lightboxes exist we should register rather than enqueue - if ($register) - { - // if the module is "wordpress" we leave the rest to Wordpress and only ask that it enqueue - // whatever the name of the resource requested may be. - if (0 === strpos($script, 'wordpress#')) - { - self::$_registered_lightboxes[] = substr($script, 10); - } else { - wp_register_script( - $library->name . '-' . $i, - $script, - array('ngg_common') - ); - self::$_registered_lightboxes[] = $library->name . '-' . $i; - } - } - else { - // same as above, but enqueue now rather than register for later - if (0 === strpos($script, 'wordpress#')) - { - wp_enqueue_script(substr($script, 10)); - } else { - wp_enqueue_script( - $library->name . '-' . $i, - $script, - array('ngg_common') - ); - } - } - - if ($i == 0 AND isset($library->values)) - { - foreach ($library->values as $name => $value) { - if (empty($value)) - continue; - $value = self::_handle_url($value); - self::_add_script_data( - $library->name . '-0', - $name, - $value, - FALSE - ); - } - } - - if ($i == 0 && !empty($library->i18n)) - { - wp_localize_script( - $library->name . '-0', - 'ngg_lightbox_i18n', - $library->i18n - ); - } - $i += 1; - } - - // in 2.0.41 this field was renamed; use the old attribute as a fallback - if (empty($library->styles) && !empty($library->css_stylesheets)) - $library->styles = $library->css_stylesheets; - - $i = 0; - foreach (explode("\n", $library->styles) as $style) { - if (empty($style)) - continue; - $style = self::_handle_url($style); - if (0 === strpos($style, 'wordpress#')) - { - wp_enqueue_style(substr($style, 10)); - } - else { - wp_enqueue_style( - $library->name . '-' . $i, - $style - ); - } - $i += 1; - } - } - } - - /** - * Registers our static settings resources so the ATP module can find them later - */ - function _register_resources() - { - $router = $this->get_registry()->get_utility('I_Router'); - $settings = C_NextGen_Settings::get_instance(); - $thumbEffectContext = isset($settings->thumbEffectContext) ? $settings->thumbEffectContext : ''; - - wp_register_script( - 'nextgen_lightbox_context', - $router->get_static_url('photocrati-lightbox#lightbox_context.js') - ); - wp_enqueue_script('nextgen_lightbox_context'); - - if ($thumbEffectContext != null && $thumbEffectContext != 'nextgen_images') { - $mapper = $this->object->get_registry()->get_utility('I_Lightbox_Library_Mapper'); - $library = $mapper->find_by_name($settings->thumbEffect); - - // Make the path to the static resources available for libraries - // Shutter-Reloaded in particular depends on this - $this->_add_script_data( - 'ngg_common', - 'nextgen_lightbox_settings', - array('static_path' => $this->get_registry()->get_utility('I_Fs')->find_static_abspath('', 'photocrati-lightbox'), 'context' => $thumbEffectContext), - TRUE, - true - ); - - self::_register_library_resources($library); - } - } - - function _enqueue_resources() - { - if (defined('NGG_SKIP_LOAD_SCRIPTS') && NGG_SKIP_LOAD_SCRIPTS) - return; - - foreach (((array)self::$_registered_lightboxes) as $library) { - wp_enqueue_script($library); - } - } - - /** - * Adds data to the DOM which is then accessible by a script -- borrowed from display type controller class - * @param string $handle - * @param string $object_name - * @param mixed $object_value - * @param bool $define - */ - function _add_script_data($handle, $object_name, $object_value, $define=TRUE, $override=FALSE) - { - $retval = FALSE; - - // wp_localize_script allows you to add data to the DOM, associated - // with a particular script. You can even call wp_localize_script - // multiple times to add multiple objects to the DOM. However, there - // are a few problems with wp_localize_script: - // - // - If you call it with the same object_name more than once, you're - // overwritting the first call. - // - You cannot namespace your objects due to the "var" keyword always - // - being used. - // - // To circumvent the above issues, we're going to use the WP_Scripts - // object to workaround the above issues - global $wp_scripts; - - // Has the script been registered or enqueued yet? - if (isset($wp_scripts->registered[$handle])) { - - // Get the associated data with this script - $script = &$wp_scripts->registered[$handle]; - $data = isset($script->extra['data']) ? $script->extra['data'] : ''; - - // Construct the addition - $addition = $define ? "\nvar {$object_name} = " . json_encode($object_value) . ';' : - "\n{$object_name} = " . json_encode($object_value) . ';'; - - // Add the addition - if ($override) { - $data .= $addition; - $retval = TRUE; - } - else if (strpos($data, $object_name) === FALSE) { - $data .= $addition; - $retval = TRUE; - } - - $script->extra['data'] = $data; - - unset($script); - } - - return $retval; - } - - function get_type_list() { return array( - 'A_Lightbox_Factory' => 'adapter.lightbox_factory.php', - 'C_Lightbox_Installer' => 'class.lightbox_installer.php', - 'A_Lightbox_Library_Form' => 'adapter.lightbox_library_form.php', - 'C_Lightbox_Library' => 'class.lightbox_library.php', - 'C_Lightbox_Library_Mapper' => 'class.lightbox_library_mapper.php', - 'I_Lightbox_Library' => 'interface.lightbox_library.php', - 'I_Lightbox_Library_Mapper' => 'interface.lightbox_library_mapper.php' + 'C_Lightbox_Installer' => 'class.lightbox_legacy_installer.php', + 'C_Lightbox_Library_Manager' => 'class.lightbox_library_manager.php' ); } } diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/package.module.lightbox.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/package.module.lightbox.php new file mode 100644 index 0000000000000000000000000000000000000000..704ba39d3901b186e1a61f1850f5ddade3cdb13e --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/package.module.lightbox.php @@ -0,0 +1,298 @@ +<?php +class C_Lightbox_Installer_Mapper +{ + public function find_by_name() + { + return NULL; + } +} +class C_Lightbox_Installer +{ + public function __construct() + { + $this->mapper = new C_Lightbox_Installer_Mapper(); + } + public function install_lightbox($name, $title, $code, $stylesheet_paths = array(), $script_paths = array(), $values = array(), $i18n = array()) + { + $lightbox = new stdClass(); + $lightbox->name = $name; + $lightbox->title = $title; + $lightbox->code = $code; + $lightbox->values = $values; + $lightbox->i18n = $i18n; + $lightbox->styles = implode(' +', $stylesheet_paths); + $lightbox->scripts = implode(' +', $script_paths); + C_Lightbox_Library_Manager::get_instance()->register($name, $lightbox); + } +} +class C_Lightbox_Library_Manager +{ + private $_lightboxes = array(); + private $_registered_defaults = FALSE; + /** + * @var C_Lightbox_Library_Manager + */ + static $_instance = NULL; + static function get_instance() + { + if (!isset(self::$_instance)) { + $klass = get_class(); + self::$_instance = new $klass(); + } + return self::$_instance; + } + public function register_defaults() + { + $settings = C_NextGen_Settings::get_instance(); + $fs = C_Fs::get_instance(); + $router = C_Router::get_instance(); + // Add none as an option + $none = new stdClass(); + $none->title = __('None', 'nggallery'); + $this->register('none', $none); + // Add Fancybox + $fancybox = new stdClass(); + $fancybox->title = __('Fancybox', 'nggallery'); + $fancybox->code = 'class="ngg-fancybox" rel="%GALLERY_NAME%"'; + $fancybox->styles = array('photocrati-lightbox#fancybox/jquery.fancybox-1.3.4.css'); + $fancybox->scripts = array('photocrati-lightbox#fancybox/jquery.easing-1.3.pack.js', 'photocrati-lightbox#fancybox/jquery.fancybox-1.3.4.pack.js', 'photocrati-lightbox#fancybox/nextgen_fancybox_init.js'); + $this->register('fancybox', $fancybox); + // Add Shutter + $shutter = new stdClass(); + $shutter->title = __('Shutter', 'nggallery'); + $shutter->code = 'class="shutterset_%GALLERY_NAME%"'; + $shutter->styles = array('photocrati-lightbox#shutter/shutter.css'); + $shutter->scripts = array('photocrati-lightbox#shutter/shutter.js', 'photocrati-lightbox#shutter/nextgen_shutter.js'); + $shutter->values = array('nextgen_shutter_i18n' => array('msgLoading' => __('L O A D I N G', 'nggallery'), 'msgClose' => __('Click to Close', 'nggallery'))); + $this->register('shutter', $shutter); + // Add shutter reloaded + $shutter2 = new stdClass(); + $shutter2->title = __('Shutter Reloaded', 'nggallery'); + $shutter2->code = 'class="shutterset_%GALLERY_NAME%"'; + $shutter2->styles = array('photocrati-lightbox#shutter_reloaded/shutter.css'); + $shutter2->scripts = array('photocrati-lightbox#shutter_reloaded/shutter.js', 'photocrati-lightbox#shutter_reloaded/nextgen_shutter_reloaded.js'); + $shutter2->values = array('nextgen_shutter2_i18n' => array(__('Previous', 'nggallery'), __('Next', 'nggallery'), __('Close', 'nggallery'), __('Full Size', 'nggallery'), __('Fit to Screen', 'nggallery'), __('Image', 'nggallery'), __('of', 'nggallery'), __('Loading...', 'nggallery'))); + $this->register('shutter2', $shutter2); + // Add Thickbox + $thickbox = new stdClass(); + $thickbox->title = __('Thickbox', 'nggallery'); + $thickbox->code = 'class=\'thickbox\' rel=\'%GALLERY_NAME%\''; + $thickbox->styles = array('wordpress#thickbox'); + $thickbox->scripts = array('photocrati-lightbox#thickbox/nextgen_thickbox_init.js', 'wordpress#thickbox'); + $thickbox->values = array('nextgen_thickbox_i18n' => array('next' => __('Next >', 'nggallery'), 'prev' => __('< Prev', 'nggallery'), 'image' => __('Image', 'nggallery'), 'of' => __('of', 'nggallery'), 'close' => __('Close', 'nggallery'), 'noiframes' => __('This feature requires inline frames. You have iframes disabled or your browser does not support them.', 'nggallery'))); + $this->register('thickbox', $thickbox); + // Allow third parties to integrate + do_action('ngg_registered_default_lightboxes'); + // Add custom option + $custom = new stdClass(); + $custom->title = __('Custom', 'nggallery'); + $custom->code = $settings->thumbEffectCode; + $custom->styles = $settings->thumbEffectStyles; + $custom->scripts = $settings->thumbEffectScripts; + $this->register('custom_lightbox', $custom); + $this->_registered_defaults = TRUE; + } + public function register($name, $properties) + { + // We'll use an object to represent the lightbox + $object = $properties; + if (!is_object($properties)) { + $object = new stdClass(); + foreach ($properties as $k => $v) { + $object->{$k} = $v; + } + } + // Set default properties + $object->name = $name; + if (!isset($object->title)) { + $object->title = $name; + } + if (!isset($object->code)) { + $object->code = ''; + } + if (!isset($object->scripts)) { + $object->scripts = array(); + } + if (!isset($object->styles)) { + $object->styles = array(); + } + if (!isset($object->values)) { + $object->values = array(); + } + $this->_lightboxes[$name] = $object; + } + public function deregister($name) + { + unset($this->_lightboxes[$name]); + } + public function get($name) + { + if (!$this->_registered_defaults) { + $this->register_defaults(); + } + $retval = NULL; + if (isset($this->_lightboxes[$name])) { + $retval = $this->_lightboxes[$name]; + } + return $retval; + } + /** + * Returns which lightbox effect has been chosen + * + * Highslide and jQuery.Lightbox were removed in 2.0.73 due to licensing. If a user has selected + * either of those options we silently make their selection fallback to Fancybox + * @return null|string + */ + public function get_selected() + { + $settings = C_NextGen_Settings::get_instance(); + if (in_array($settings->thumbEffect, array('highslide', 'lightbox'))) { + $settings->thumbEffect = 'fancybox'; + } + return $this->get($settings->thumbEffect); + } + public function get_selected_context() + { + return C_NextGen_Settings::get_instance()->thumbEffectContext; + } + public function get_all() + { + if (!$this->_registered_defaults) { + $this->register_defaults(); + } + return array_values($this->_lightboxes); + } + public function is_registered($name) + { + return !is_null($this->get($name)); + } + public function maybe_enqueue() + { + $settings = C_NextGen_Settings::get_instance(); + $thumbEffectContext = isset($settings->thumbEffectContext) ? $settings->thumbEffectContext : ''; + if ($thumbEffectContext != 'nextgen_images') { + $this->enqueue(); + } + } + public function enqueue($lightbox = NULL) + { + $router = C_Router::get_instance(); + $settings = C_NextGen_Settings::get_instance(); + $thumbEffectContext = isset($settings->thumbEffectContext) ? $settings->thumbEffectContext : ''; + // If no lightbox has been provided, get the selected lightbox + if (!$lightbox) { + $lightbox = $this->get_selected(); + } else { + $lightbox = $this->get($lightbox); + } + if (!wp_script_is('ngg_lightbox_context')) { + wp_enqueue_script('ngg_lightbox_context', $router->get_static_url('photocrati-lightbox#lightbox_context.js'), array('ngg_common', 'photocrati_ajax'), NULL, TRUE); + } + // Make the path to the static resources available for libraries + // Shutter-Reloaded in particular depends on this + $this->_add_script_data('ngg_common', 'nextgen_lightbox_settings', array('static_path' => $router->get_static_url('', 'photocrati-lightbox'), 'context' => $thumbEffectContext), TRUE, TRUE); + // Enqueue lightbox resources, only if we have a configured lightbox + if ($lightbox) { + // Enqueue stylesheets + for ($i = 0; $i < count($lightbox->styles); $i++) { + $src = $lightbox->styles[$i]; + if (strpos($src, 'wordpress#') === 0) { + wp_enqueue_style(@array_pop(explode('wordpress#', $src))); + } else { + if (!empty($src)) { + wp_enqueue_style($lightbox->name . "-{$i}", $this->_handle_url($src)); + } + } + } + // Enqueue scripts + for ($i = 0; $i < count($lightbox->scripts); $i++) { + $src = $lightbox->scripts[$i]; + $handle = $lightbox->name . "-{$i}"; + if (strpos($src, 'wordpress#') === 0) { + $handle = @array_pop(explode('wordpress#', $src)); + wp_enqueue_script($handle); + } else { + if (!empty($src)) { + wp_enqueue_script($handle, $this->_handle_url($src), array('ngg_lightbox_context'), NULL, TRUE); + } + } + if ($i == 0 and isset($lightbox->values)) { + foreach ($lightbox->values as $name => $value) { + if (empty($value)) { + continue; + } + $this->_add_script_data($handle, $name, $value, FALSE); + } + } + } + } + } + /** + * Parses certain paths through get_static_url + * + * @param string $url + * @return string Resulting URL + */ + static function _handle_url($url, $type = 'script') + { + $router = C_Router::get_instance(); + if (0 !== strpos($url, '/') && 0 !== strpos($url, 'wordpress#') && 0 !== strpos($url, 'http://') && 0 !== strpos($url, 'https://')) { + $url = $router->get_static_url($url); + } elseif (strpos($url, '/') === 0) { + $url = home_url($url); + } + return $url; + } + /** + * Adds data to the DOM which is then accessible by a script -- borrowed from display type controller class + * @param string $handle + * @param string $object_name + * @param mixed $object_value + * @param bool $define + */ + public function _add_script_data($handle, $object_name, $object_value, $define = TRUE, $override = FALSE) + { + $retval = FALSE; + // wp_localize_script allows you to add data to the DOM, associated + // with a particular script. You can even call wp_localize_script + // multiple times to add multiple objects to the DOM. However, there + // are a few problems with wp_localize_script: + // + // - If you call it with the same object_name more than once, you're + // overwritting the first call. + // - You cannot namespace your objects due to the "var" keyword always + // - being used. + // + // To circumvent the above issues, we're going to use the WP_Scripts + // object to workaround the above issues + global $wp_scripts; + // Has the script been registered or enqueued yet? + if (isset($wp_scripts->registered[$handle])) { + // Get the associated data with this script + $script =& $wp_scripts->registered[$handle]; + $data = isset($script->extra['data']) ? $script->extra['data'] : ''; + // Construct the addition + $addition = $define ? "\nvar {$object_name} = " . json_encode($object_value) . ';' : "\n{$object_name} = " . json_encode($object_value) . ';'; + // Add the addition + if ($override) { + $data .= $addition; + $retval = TRUE; + } else { + if (strpos($data, $object_name) === FALSE) { + $data .= $addition; + $retval = TRUE; + } + } + $script->extra['data'] = $data; + unset($script); + } + return $retval; + } + public function deregister_all() + { + $this->_lightboxes = array(); + $this->_registered_defaults = FALSE; + } +} \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/jquery.fancybox-1.3.4.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/jquery.fancybox-1.3.4.css index e59be37cf4f9bd1d20b5d45fd96ef06ea7ca7acc..bc0f15fd1631c27f675a4fe77c46ad12d9b7d0b6 100755 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/jquery.fancybox-1.3.4.css +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/jquery.fancybox-1.3.4.css @@ -1,366 +1,366 @@ -/* - * FancyBox - jQuery Plugin - * Simple and fancy lightbox alternative - * - * Examples and documentation at: http://fancybox.net - * - * Copyright (c) 2008 - 2010 Janis Skarnelis - * That said, it is hardly a one-person project. Many people have submitted bugs, code, and offered their advice freely. Their support is greatly appreciated. - * - * Version: 1.3.4 (11/11/2010) - * Requires: jQuery v1.3+ - * - * Dual licensed under the MIT and GPL licenses: - * http://www.opensource.org/licenses/mit-license.php - * http://www.gnu.org/licenses/gpl.html - */ - -#fancybox-loading { - position: fixed; - top: 50%; - left: 50%; - width: 40px; - height: 40px; - margin-top: -20px; - margin-left: -20px; - cursor: pointer; - overflow: hidden; - z-index: 1104; - display: none; -} - -#fancybox-loading div { - position: absolute; - top: 0; - left: 0; - width: 40px; - height: 480px; - background-image: url('fancybox.png'); -} - -#fancybox-overlay { - position: absolute; - top: 0; - left: 0; - width: 100%; - z-index: 1100; - display: none; -} - -#fancybox-tmp { - padding: 0; - margin: 0; - border: 0; - overflow: auto; - display: none; -} - -#fancybox-wrap { - position: absolute; - top: 0; - left: 0; - padding: 20px; - z-index: 1101; - outline: none; - display: none; -} - -#fancybox-outer { - position: relative; - width: 100%; - height: 100%; - background: #fff; -} - -#fancybox-content { - width: 0; - height: 0; - padding: 0; - outline: none; - position: relative; - overflow: hidden; - z-index: 1102; - border: 0px solid #fff; -} - -#fancybox-hide-sel-frame { - position: absolute; - top: 0; - left: 0; - width: 100%; - height: 100%; - background: transparent; - z-index: 1101; -} - -#fancybox-close { - position: absolute; - top: -15px; - right: -15px; - width: 30px; - height: 30px; - background: transparent url('fancybox.png') -40px 0px; - cursor: pointer; - z-index: 1103; - display: none; -} - -#fancybox-error { - color: #444; - font: normal 12px/20px Arial; - padding: 14px; - margin: 0; -} - -#fancybox-img { - width: 100%; - height: 100%; - padding: 0; - margin: 0; - border: none; - outline: none; - line-height: 0; - vertical-align: top; -} - -#fancybox-frame { - width: 100%; - height: 100%; - border: none; - display: block; -} - -#fancybox-left, #fancybox-right { - position: absolute; - bottom: 0px; - height: 100%; - width: 35%; - cursor: pointer; - outline: none; - background: transparent url('blank.gif'); - z-index: 1102; - display: none; -} - -#fancybox-left { - left: 0px; -} - -#fancybox-right { - right: 0px; -} - -#fancybox-left-ico, #fancybox-right-ico { - position: absolute; - top: 50%; - left: -9999px; - width: 30px; - height: 30px; - margin-top: -15px; - cursor: pointer; - z-index: 1102; - display: block; -} - -#fancybox-left-ico { - background-image: url('fancybox.png'); - background-position: -40px -30px; -} - -#fancybox-right-ico { - background-image: url('fancybox.png'); - background-position: -40px -60px; -} - -#fancybox-left:hover, #fancybox-right:hover { - visibility: visible; /* IE6 */ -} - -#fancybox-left:hover span { - left: 20px; -} - -#fancybox-right:hover span { - left: auto; - right: 20px; -} - -.fancybox-bg { - position: absolute; - padding: 0; - margin: 0; - border: 0; - width: 20px; - height: 20px; - z-index: 1001; -} - -#fancybox-bg-n { - top: -20px; - left: 0; - width: 100%; - background-image: url('fancybox-x.png'); -} - -#fancybox-bg-ne { - top: -20px; - right: -20px; - background-image: url('fancybox.png'); - background-position: -40px -162px; -} - -#fancybox-bg-e { - top: 0; - right: -20px; - height: 100%; - background-image: url('fancybox-y.png'); - background-position: -20px 0px; -} - -#fancybox-bg-se { - bottom: -20px; - right: -20px; - background-image: url('fancybox.png'); - background-position: -40px -182px; -} - -#fancybox-bg-s { - bottom: -20px; - left: 0; - width: 100%; - background-image: url('fancybox-x.png'); - background-position: 0px -20px; -} - -#fancybox-bg-sw { - bottom: -20px; - left: -20px; - background-image: url('fancybox.png'); - background-position: -40px -142px; -} - -#fancybox-bg-w { - top: 0; - left: -20px; - height: 100%; - background-image: url('fancybox-y.png'); -} - -#fancybox-bg-nw { - top: -20px; - left: -20px; - background-image: url('fancybox.png'); - background-position: -40px -122px; -} - -#fancybox-title { - font-family: Helvetica; - font-size: 12px; - z-index: 1102; -} - -.fancybox-title-inside { - padding-bottom: 10px; - text-align: center; - color: #333; - background: #fff; - position: relative; -} - -.fancybox-title-outside { - padding-top: 10px; - color: #fff; -} - -.fancybox-title-over { - position: absolute; - bottom: 0; - left: 0; - color: #FFF; - text-align: left; -} - -#fancybox-title-over { - padding: 10px; - background-image: url('fancy_title_over.png'); - display: block; -} - -.fancybox-title-float { - position: absolute; - left: 0; - bottom: -20px; - height: 32px; -} - -#fancybox-title-float-wrap { - border: none; - border-collapse: collapse; - width: auto; -} - -#fancybox-title-float-wrap td { - border: none; - white-space: nowrap; -} - -#fancybox-title-float-left { - padding: 0 0 0 15px; - background: url('fancybox.png') -40px -90px no-repeat; -} - -#fancybox-title-float-main { - color: #FFF; - line-height: 29px; - font-weight: bold; - padding: 0 0 3px 0; - background: url('fancybox-x.png') 0px -40px; -} - -#fancybox-title-float-right { - padding: 0 0 0 15px; - background: url('fancybox.png') -55px -90px no-repeat; -} - -/* IE6 */ - -.fancybox-ie6 #fancybox-close { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_close.png', sizingMethod='scale'); } - -.fancybox-ie6 #fancybox-left-ico { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_nav_left.png', sizingMethod='scale'); } -.fancybox-ie6 #fancybox-right-ico { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_nav_right.png', sizingMethod='scale'); } - -.fancybox-ie6 #fancybox-title-over { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_over.png', sizingMethod='scale'); zoom: 1; } -.fancybox-ie6 #fancybox-title-float-left { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_left.png', sizingMethod='scale'); } -.fancybox-ie6 #fancybox-title-float-main { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_main.png', sizingMethod='scale'); } -.fancybox-ie6 #fancybox-title-float-right { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_right.png', sizingMethod='scale'); } - -.fancybox-ie6 #fancybox-bg-w, .fancybox-ie6 #fancybox-bg-e, .fancybox-ie6 #fancybox-left, .fancybox-ie6 #fancybox-right, #fancybox-hide-sel-frame { - height: expression(this.parentNode.clientHeight + "px"); -} - -#fancybox-loading.fancybox-ie6 { - position: absolute; margin-top: 0; - top: expression( (-20 + (document.documentElement.clientHeight ? document.documentElement.clientHeight/2 : document.body.clientHeight/2 ) + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop )) + 'px'); -} - -#fancybox-loading.fancybox-ie6 div { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_loading.png', sizingMethod='scale'); } - -/* IE6, IE7, IE8 */ - -.fancybox-ie .fancybox-bg { background: transparent !important; } - -.fancybox-ie #fancybox-bg-n { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_n.png', sizingMethod='scale'); } -.fancybox-ie #fancybox-bg-ne { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_ne.png', sizingMethod='scale'); } -.fancybox-ie #fancybox-bg-e { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_e.png', sizingMethod='scale'); } -.fancybox-ie #fancybox-bg-se { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_se.png', sizingMethod='scale'); } -.fancybox-ie #fancybox-bg-s { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_s.png', sizingMethod='scale'); } -.fancybox-ie #fancybox-bg-sw { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_sw.png', sizingMethod='scale'); } -.fancybox-ie #fancybox-bg-w { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_w.png', sizingMethod='scale'); } -.fancybox-ie #fancybox-bg-nw { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_nw.png', sizingMethod='scale'); } - -/* Note: Prevents issues with "style resets" or themes that apply 'box-sizing: border-box' to everything */ -#fancybox-wrap, #fancybox-content, #fancybox-outer { - box-sizing: content-box; - -moz-box-sizing: content-box; - -webkit-box-sizing: content-box; +/* + * FancyBox - jQuery Plugin + * Simple and fancy lightbox alternative + * + * Examples and documentation at: http://fancybox.net + * + * Copyright (c) 2008 - 2010 Janis Skarnelis + * That said, it is hardly a one-person project. Many people have submitted bugs, code, and offered their advice freely. Their support is greatly appreciated. + * + * Version: 1.3.4 (11/11/2010) + * Requires: jQuery v1.3+ + * + * Dual licensed under the MIT and GPL licenses: + * http://www.opensource.org/licenses/mit-license.php + * http://www.gnu.org/licenses/gpl.html + */ + +#fancybox-loading { + position: fixed; + top: 50%; + left: 50%; + width: 40px; + height: 40px; + margin-top: -20px; + margin-left: -20px; + cursor: pointer; + overflow: hidden; + z-index: 1104; + display: none; +} + +#fancybox-loading div { + position: absolute; + top: 0; + left: 0; + width: 40px; + height: 480px; + background-image: url('fancybox.png'); +} + +#fancybox-overlay { + position: absolute; + top: 0; + left: 0; + width: 100%; + z-index: 1100; + display: none; +} + +#fancybox-tmp { + padding: 0; + margin: 0; + border: 0; + overflow: auto; + display: none; +} + +#fancybox-wrap { + position: absolute; + top: 0; + left: 0; + padding: 20px; + z-index: 1101; + outline: none; + display: none; +} + +#fancybox-outer { + position: relative; + width: 100%; + height: 100%; + background: #fff; +} + +#fancybox-content { + width: 0; + height: 0; + padding: 0; + outline: none; + position: relative; + overflow: hidden; + z-index: 1102; + border: 0px solid #fff; +} + +#fancybox-hide-sel-frame { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + background: transparent; + z-index: 1101; +} + +#fancybox-close { + position: absolute; + top: -15px; + right: -15px; + width: 30px; + height: 30px; + background: transparent url('fancybox.png') -40px 0px; + cursor: pointer; + z-index: 1103; + display: none; +} + +#fancybox-error { + color: #444; + font: normal 12px/20px Arial; + padding: 14px; + margin: 0; +} + +#fancybox-img { + width: 100%; + height: 100%; + padding: 0; + margin: 0; + border: none; + outline: none; + line-height: 0; + vertical-align: top; +} + +#fancybox-frame { + width: 100%; + height: 100%; + border: none; + display: block; +} + +#fancybox-left, #fancybox-right { + position: absolute; + bottom: 0px; + height: 100%; + width: 35%; + cursor: pointer; + outline: none; + background: transparent url('blank.gif'); + z-index: 1102; + display: none; +} + +#fancybox-left { + left: 0px; +} + +#fancybox-right { + right: 0px; +} + +#fancybox-left-ico, #fancybox-right-ico { + position: absolute; + top: 50%; + left: -9999px; + width: 30px; + height: 30px; + margin-top: -15px; + cursor: pointer; + z-index: 1102; + display: block; +} + +#fancybox-left-ico { + background-image: url('fancybox.png'); + background-position: -40px -30px; +} + +#fancybox-right-ico { + background-image: url('fancybox.png'); + background-position: -40px -60px; +} + +#fancybox-left:hover, #fancybox-right:hover { + visibility: visible; /* IE6 */ +} + +#fancybox-left:hover span { + left: 20px; +} + +#fancybox-right:hover span { + left: auto; + right: 20px; +} + +.fancybox-bg { + position: absolute; + padding: 0; + margin: 0; + border: 0; + width: 20px; + height: 20px; + z-index: 1001; +} + +#fancybox-bg-n { + top: -20px; + left: 0; + width: 100%; + background-image: url('fancybox-x.png'); +} + +#fancybox-bg-ne { + top: -20px; + right: -20px; + background-image: url('fancybox.png'); + background-position: -40px -162px; +} + +#fancybox-bg-e { + top: 0; + right: -20px; + height: 100%; + background-image: url('fancybox-y.png'); + background-position: -20px 0px; +} + +#fancybox-bg-se { + bottom: -20px; + right: -20px; + background-image: url('fancybox.png'); + background-position: -40px -182px; +} + +#fancybox-bg-s { + bottom: -20px; + left: 0; + width: 100%; + background-image: url('fancybox-x.png'); + background-position: 0px -20px; +} + +#fancybox-bg-sw { + bottom: -20px; + left: -20px; + background-image: url('fancybox.png'); + background-position: -40px -142px; +} + +#fancybox-bg-w { + top: 0; + left: -20px; + height: 100%; + background-image: url('fancybox-y.png'); +} + +#fancybox-bg-nw { + top: -20px; + left: -20px; + background-image: url('fancybox.png'); + background-position: -40px -122px; +} + +#fancybox-title { + font-family: Helvetica; + font-size: 12px; + z-index: 1102; +} + +.fancybox-title-inside { + padding-bottom: 10px; + text-align: center; + color: #333; + background: #fff; + position: relative; +} + +.fancybox-title-outside { + padding-top: 10px; + color: #fff; +} + +.fancybox-title-over { + position: absolute; + bottom: 0; + left: 0; + color: #FFF; + text-align: left; +} + +#fancybox-title-over { + padding: 10px; + background-image: url('fancy_title_over.png'); + display: block; +} + +.fancybox-title-float { + position: absolute; + left: 0; + bottom: -20px; + height: 32px; +} + +#fancybox-title-float-wrap { + border: none; + border-collapse: collapse; + width: auto; +} + +#fancybox-title-float-wrap td { + border: none; + white-space: nowrap; +} + +#fancybox-title-float-left { + padding: 0 0 0 15px; + background: url('fancybox.png') -40px -90px no-repeat; +} + +#fancybox-title-float-main { + color: #FFF; + line-height: 29px; + font-weight: bold; + padding: 0 0 3px 0; + background: url('fancybox-x.png') 0px -40px; +} + +#fancybox-title-float-right { + padding: 0 0 0 15px; + background: url('fancybox.png') -55px -90px no-repeat; +} + +/* IE6 */ + +.fancybox-ie6 #fancybox-close { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_close.png', sizingMethod='scale'); } + +.fancybox-ie6 #fancybox-left-ico { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_nav_left.png', sizingMethod='scale'); } +.fancybox-ie6 #fancybox-right-ico { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_nav_right.png', sizingMethod='scale'); } + +.fancybox-ie6 #fancybox-title-over { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_over.png', sizingMethod='scale'); zoom: 1; } +.fancybox-ie6 #fancybox-title-float-left { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_left.png', sizingMethod='scale'); } +.fancybox-ie6 #fancybox-title-float-main { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_main.png', sizingMethod='scale'); } +.fancybox-ie6 #fancybox-title-float-right { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_right.png', sizingMethod='scale'); } + +.fancybox-ie6 #fancybox-bg-w, .fancybox-ie6 #fancybox-bg-e, .fancybox-ie6 #fancybox-left, .fancybox-ie6 #fancybox-right, #fancybox-hide-sel-frame { + height: expression(this.parentNode.clientHeight + "px"); +} + +#fancybox-loading.fancybox-ie6 { + position: absolute; margin-top: 0; + top: expression( (-20 + (document.documentElement.clientHeight ? document.documentElement.clientHeight/2 : document.body.clientHeight/2 ) + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop )) + 'px'); +} + +#fancybox-loading.fancybox-ie6 div { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_loading.png', sizingMethod='scale'); } + +/* IE6, IE7, IE8 */ + +.fancybox-ie .fancybox-bg { background: transparent !important; } + +.fancybox-ie #fancybox-bg-n { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_n.png', sizingMethod='scale'); } +.fancybox-ie #fancybox-bg-ne { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_ne.png', sizingMethod='scale'); } +.fancybox-ie #fancybox-bg-e { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_e.png', sizingMethod='scale'); } +.fancybox-ie #fancybox-bg-se { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_se.png', sizingMethod='scale'); } +.fancybox-ie #fancybox-bg-s { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_s.png', sizingMethod='scale'); } +.fancybox-ie #fancybox-bg-sw { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_sw.png', sizingMethod='scale'); } +.fancybox-ie #fancybox-bg-w { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_w.png', sizingMethod='scale'); } +.fancybox-ie #fancybox-bg-nw { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_nw.png', sizingMethod='scale'); } + +/* Note: Prevents issues with "style resets" or themes that apply 'box-sizing: border-box' to everything */ +#fancybox-wrap, #fancybox-content, #fancybox-outer { + box-sizing: content-box; + -moz-box-sizing: content-box; + -webkit-box-sizing: content-box; } \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/jquery.fancybox-1.3.4.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/jquery.fancybox-1.3.4.js index be77275376b7083d0df61b1ebe93a101ed52bebf..a8520051dc780846e034c9c5ef7a72ce107e9c6c 100755 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/jquery.fancybox-1.3.4.js +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/jquery.fancybox-1.3.4.js @@ -1,1156 +1,1156 @@ -/* - * FancyBox - jQuery Plugin - * Simple and fancy lightbox alternative - * - * Examples and documentation at: http://fancybox.net - * - * Copyright (c) 2008 - 2010 Janis Skarnelis - * That said, it is hardly a one-person project. Many people have submitted bugs, code, and offered their advice freely. Their support is greatly appreciated. - * - * Version: 1.3.4 (11/11/2010) - * Requires: jQuery v1.3+ - * - * Dual licensed under the MIT and GPL licenses: - * http://www.opensource.org/licenses/mit-license.php - * http://www.gnu.org/licenses/gpl.html - */ - -;(function($) { - var tmp, loading, overlay, wrap, outer, content, close, title, nav_left, nav_right, - - selectedIndex = 0, selectedOpts = {}, selectedArray = [], currentIndex = 0, currentOpts = {}, currentArray = [], - - ajaxLoader = null, imgPreloader = new Image(), imgRegExp = /\.(jpg|gif|png|bmp|jpeg)(.*)?$/i, swfRegExp = /[^\.]\.(swf)\s*$/i, - - loadingTimer, loadingFrame = 1, - - titleHeight = 0, titleStr = '', start_pos, final_pos, busy = false, fx = $.extend($('<div/>')[0], { prop: 0 }), - - isIE6 = $.browser.msie && $.browser.version < 7 && !window.XMLHttpRequest, - - /* - * Private methods - */ - - _abort = function() { - loading.hide(); - - imgPreloader.onerror = imgPreloader.onload = null; - - if (ajaxLoader) { - ajaxLoader.abort(); - } - - tmp.empty(); - }, - - _error = function() { - if (false === selectedOpts.onError(selectedArray, selectedIndex, selectedOpts)) { - loading.hide(); - busy = false; - return; - } - - selectedOpts.titleShow = false; - - selectedOpts.width = 'auto'; - selectedOpts.height = 'auto'; - - tmp.html( '<p id="fancybox-error">The requested content cannot be loaded.<br />Please try again later.</p>' ); - - _process_inline(); - }, - - _start = function() { - var obj = selectedArray[ selectedIndex ], - href, - type, - title, - str, - emb, - ret; - - _abort(); - - selectedOpts = $.extend({}, $.fn.fancybox.defaults, (typeof $(obj).data('fancybox') == 'undefined' ? selectedOpts : $(obj).data('fancybox'))); - - ret = selectedOpts.onStart(selectedArray, selectedIndex, selectedOpts); - - if (ret === false) { - busy = false; - return; - } else if (typeof ret == 'object') { - selectedOpts = $.extend(selectedOpts, ret); - } - - title = selectedOpts.title || (obj.nodeName ? $(obj).attr('title') : obj.title) || ''; - - if (obj.nodeName && !selectedOpts.orig) { - selectedOpts.orig = $(obj).children("img:first").length ? $(obj).children("img:first") : $(obj); - } - - if (title === '' && selectedOpts.orig && selectedOpts.titleFromAlt) { - title = selectedOpts.orig.attr('alt'); - } - - href = selectedOpts.href || (obj.nodeName ? $(obj).attr('href') : obj.href) || null; - - if ((/^(?:javascript)/i).test(href) || href == '#') { - href = null; - } - - if (selectedOpts.type) { - type = selectedOpts.type; - - if (!href) { - href = selectedOpts.content; - } - - } else if (selectedOpts.content) { - type = 'html'; - - } else if (href) { - if (href.match(imgRegExp)) { - type = 'image'; - - } else if (href.match(swfRegExp)) { - type = 'swf'; - - } else if ($(obj).hasClass("iframe")) { - type = 'iframe'; - - } else if (href.indexOf("#") === 0) { - type = 'inline'; - - } else { - type = 'ajax'; - } - } - - if (!type) { - _error(); - return; - } - - if (type == 'inline') { - obj = href.substr(href.indexOf("#")); - type = $(obj).length > 0 ? 'inline' : 'ajax'; - } - - selectedOpts.type = type; - selectedOpts.href = href; - selectedOpts.title = title; - - if (selectedOpts.autoDimensions) { - if (selectedOpts.type == 'html' || selectedOpts.type == 'inline' || selectedOpts.type == 'ajax') { - selectedOpts.width = 'auto'; - selectedOpts.height = 'auto'; - } else { - selectedOpts.autoDimensions = false; - } - } - - if (selectedOpts.modal) { - selectedOpts.overlayShow = true; - selectedOpts.hideOnOverlayClick = false; - selectedOpts.hideOnContentClick = false; - selectedOpts.enableEscapeButton = false; - selectedOpts.showCloseButton = false; - } - - selectedOpts.padding = parseInt(selectedOpts.padding, 10); - selectedOpts.margin = parseInt(selectedOpts.margin, 10); - - tmp.css('padding', (selectedOpts.padding + selectedOpts.margin)); - - $('.fancybox-inline-tmp').unbind('fancybox-cancel').bind('fancybox-change', function() { - $(this).replaceWith(content.children()); - }); - - switch (type) { - case 'html' : - tmp.html( selectedOpts.content ); - _process_inline(); - break; - - case 'inline' : - if ( $(obj).parent().is('#fancybox-content') === true) { - busy = false; - return; - } - - $('<div class="fancybox-inline-tmp" />') - .hide() - .insertBefore( $(obj) ) - .bind('fancybox-cleanup', function() { - $(this).replaceWith(content.children()); - }).bind('fancybox-cancel', function() { - $(this).replaceWith(tmp.children()); - }); - - $(obj).appendTo(tmp); - - _process_inline(); - break; - - case 'image': - busy = false; - - $.fancybox.showActivity(); - - imgPreloader = new Image(); - - imgPreloader.onerror = function() { - _error(); - }; - - imgPreloader.onload = function() { - busy = true; - - imgPreloader.onerror = imgPreloader.onload = null; - - _process_image(); - }; - - imgPreloader.src = href; - break; - - case 'swf': - selectedOpts.scrolling = 'no'; - - str = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="' + selectedOpts.width + '" height="' + selectedOpts.height + '"><param name="movie" value="' + href + '"></param>'; - emb = ''; - - $.each(selectedOpts.swf, function(name, val) { - str += '<param name="' + name + '" value="' + val + '"></param>'; - emb += ' ' + name + '="' + val + '"'; - }); - - str += '<embed src="' + href + '" type="application/x-shockwave-flash" width="' + selectedOpts.width + '" height="' + selectedOpts.height + '"' + emb + '></embed></object>'; - - tmp.html(str); - - _process_inline(); - break; - - case 'ajax': - busy = false; - - $.fancybox.showActivity(); - - selectedOpts.ajax.win = selectedOpts.ajax.success; - - ajaxLoader = $.ajax($.extend({}, selectedOpts.ajax, { - url : href, - data : selectedOpts.ajax.data || {}, - error : function(XMLHttpRequest, textStatus, errorThrown) { - if ( XMLHttpRequest.status > 0 ) { - _error(); - } - }, - success : function(data, textStatus, XMLHttpRequest) { - var o = typeof XMLHttpRequest == 'object' ? XMLHttpRequest : ajaxLoader; - if (o.status == 200) { - if ( typeof selectedOpts.ajax.win == 'function' ) { - ret = selectedOpts.ajax.win(href, data, textStatus, XMLHttpRequest); - - if (ret === false) { - loading.hide(); - return; - } else if (typeof ret == 'string' || typeof ret == 'object') { - data = ret; - } - } - - tmp.html( data ); - _process_inline(); - } - } - })); - - break; - - case 'iframe': - _show(); - break; - } - }, - - _process_inline = function() { - var - w = selectedOpts.width, - h = selectedOpts.height; - - if (w.toString().indexOf('%') > -1) { - w = parseInt( ($(window).width() - (selectedOpts.margin * 2)) * parseFloat(w) / 100, 10) + 'px'; - - } else { - w = w == 'auto' ? 'auto' : w + 'px'; - } - - if (h.toString().indexOf('%') > -1) { - h = parseInt( ($(window).height() - (selectedOpts.margin * 2)) * parseFloat(h) / 100, 10) + 'px'; - - } else { - h = h == 'auto' ? 'auto' : h + 'px'; - } - - tmp.wrapInner('<div style="width:' + w + ';height:' + h + ';overflow: ' + (selectedOpts.scrolling == 'auto' ? 'auto' : (selectedOpts.scrolling == 'yes' ? 'scroll' : 'hidden')) + ';position:relative;"></div>'); - - selectedOpts.width = tmp.width(); - selectedOpts.height = tmp.height(); - - _show(); - }, - - _process_image = function() { - selectedOpts.width = imgPreloader.width; - selectedOpts.height = imgPreloader.height; - - $("<img />").attr({ - 'id' : 'fancybox-img', - 'src' : imgPreloader.src, - 'alt' : selectedOpts.title - }).appendTo( tmp ); - - _show(); - }, - - _show = function() { - var pos, equal; - - loading.hide(); - - if (wrap.is(":visible") && false === currentOpts.onCleanup(currentArray, currentIndex, currentOpts)) { - $.event.trigger('fancybox-cancel'); - - busy = false; - return; - } - - busy = true; - - $(content.add( overlay )).unbind(); - - $(window).unbind("resize.fb scroll.fb"); - $(document).unbind('keydown.fb'); - - if (wrap.is(":visible") && currentOpts.titlePosition !== 'outside') { - wrap.css('height', wrap.height()); - } - - currentArray = selectedArray; - currentIndex = selectedIndex; - currentOpts = selectedOpts; - - if (currentOpts.overlayShow) { - overlay.css({ - 'background-color' : currentOpts.overlayColor, - 'opacity' : currentOpts.overlayOpacity, - 'cursor' : currentOpts.hideOnOverlayClick ? 'pointer' : 'auto', - 'height' : $(document).height() - }); - - if (!overlay.is(':visible')) { - if (isIE6) { - $('select:not(#fancybox-tmp select)').filter(function() { - return this.style.visibility !== 'hidden'; - }).css({'visibility' : 'hidden'}).one('fancybox-cleanup', function() { - this.style.visibility = 'inherit'; - }); - } - - overlay.show(); - } - } else { - overlay.hide(); - } - - final_pos = _get_zoom_to(); - - _process_title(); - - if (wrap.is(":visible")) { - $( close.add( nav_left ).add( nav_right ) ).hide(); - - pos = wrap.position(), - - start_pos = { - top : pos.top, - left : pos.left, - width : wrap.width(), - height : wrap.height() - }; - - equal = (start_pos.width == final_pos.width && start_pos.height == final_pos.height); - - content.fadeTo(currentOpts.changeFade, 0.3, function() { - var finish_resizing = function() { - content.html( tmp.contents() ).fadeTo(currentOpts.changeFade, 1, _finish); - }; - - $.event.trigger('fancybox-change'); - - content - .empty() - .removeAttr('filter') - .css({ - 'border-width' : currentOpts.padding, - 'width' : final_pos.width - currentOpts.padding * 2, - 'height' : selectedOpts.autoDimensions ? 'auto' : final_pos.height - titleHeight - currentOpts.padding * 2 - }); - - if (equal) { - finish_resizing(); - - } else { - fx.prop = 0; - - $(fx).animate({prop: 1}, { - duration : currentOpts.changeSpeed, - easing : currentOpts.easingChange, - step : _draw, - complete : finish_resizing - }); - } - }); - - return; - } - - wrap.removeAttr("style"); - - content.css('border-width', currentOpts.padding); - - if (currentOpts.transitionIn == 'elastic') { - start_pos = _get_zoom_from(); - - content.html( tmp.contents() ); - - wrap.show(); - - if (currentOpts.opacity) { - final_pos.opacity = 0; - } - - fx.prop = 0; - - $(fx).animate({prop: 1}, { - duration : currentOpts.speedIn, - easing : currentOpts.easingIn, - step : _draw, - complete : _finish - }); - - return; - } - - if (currentOpts.titlePosition == 'inside' && titleHeight > 0) { - title.show(); - } - - content - .css({ - 'width' : final_pos.width - currentOpts.padding * 2, - 'height' : selectedOpts.autoDimensions ? 'auto' : final_pos.height - titleHeight - currentOpts.padding * 2 - }) - .html( tmp.contents() ); - - wrap - .css(final_pos) - .fadeIn( currentOpts.transitionIn == 'none' ? 0 : currentOpts.speedIn, _finish ); - }, - - _format_title = function(title) { - if (title && title.length) { - if (currentOpts.titlePosition == 'float') { - return '<table id="fancybox-title-float-wrap" cellpadding="0" cellspacing="0"><tr><td id="fancybox-title-float-left"></td><td id="fancybox-title-float-main">' + title + '</td><td id="fancybox-title-float-right"></td></tr></table>'; - } - - return '<div id="fancybox-title-' + currentOpts.titlePosition + '">' + title + '</div>'; - } - - return false; - }, - - _process_title = function() { - titleStr = currentOpts.title || ''; - titleHeight = 0; - - title - .empty() - .removeAttr('style') - .removeClass(); - - if (currentOpts.titleShow === false) { - title.hide(); - return; - } - - titleStr = $.isFunction(currentOpts.titleFormat) ? currentOpts.titleFormat(titleStr, currentArray, currentIndex, currentOpts) : _format_title(titleStr); - - if (!titleStr || titleStr === '') { - title.hide(); - return; - } - - title - .addClass('fancybox-title-' + currentOpts.titlePosition) - .html( titleStr ) - .appendTo( 'body' ) - .show(); - - switch (currentOpts.titlePosition) { - case 'inside': - title - .css({ - 'width' : final_pos.width - (currentOpts.padding * 2), - 'marginLeft' : currentOpts.padding, - 'marginRight' : currentOpts.padding - }); - - titleHeight = title.outerHeight(true); - - title.appendTo( outer ); - - final_pos.height += titleHeight; - break; - - case 'over': - title - .css({ - 'marginLeft' : currentOpts.padding, - 'width' : final_pos.width - (currentOpts.padding * 2), - 'bottom' : currentOpts.padding - }) - .appendTo( outer ); - break; - - case 'float': - title - .css('left', parseInt((title.width() - final_pos.width - 40)/ 2, 10) * -1) - .appendTo( wrap ); - break; - - default: - title - .css({ - 'width' : final_pos.width - (currentOpts.padding * 2), - 'paddingLeft' : currentOpts.padding, - 'paddingRight' : currentOpts.padding - }) - .appendTo( wrap ); - break; - } - - title.hide(); - }, - - _set_navigation = function() { - if (currentOpts.enableEscapeButton || currentOpts.enableKeyboardNav) { - $(document).bind('keydown.fb', function(e) { - if (e.keyCode == 27 && currentOpts.enableEscapeButton) { - e.preventDefault(); - $.fancybox.close(); - - } else if ((e.keyCode == 37 || e.keyCode == 39) && currentOpts.enableKeyboardNav && e.target.tagName !== 'INPUT' && e.target.tagName !== 'TEXTAREA' && e.target.tagName !== 'SELECT') { - e.preventDefault(); - $.fancybox[ e.keyCode == 37 ? 'prev' : 'next'](); - } - }); - } - - if (!currentOpts.showNavArrows) { - nav_left.hide(); - nav_right.hide(); - return; - } - - if ((currentOpts.cyclic && currentArray.length > 1) || currentIndex !== 0) { - nav_left.show(); - } - - if ((currentOpts.cyclic && currentArray.length > 1) || currentIndex != (currentArray.length -1)) { - nav_right.show(); - } - }, - - _finish = function () { - if (!$.support.opacity) { - content.get(0).style.removeAttribute('filter'); - wrap.get(0).style.removeAttribute('filter'); - } - - if (selectedOpts.autoDimensions) { - content.css('height', 'auto'); - } - - wrap.css('height', 'auto'); - - if (titleStr && titleStr.length) { - title.show(); - } - - if (currentOpts.showCloseButton) { - close.show(); - } - - _set_navigation(); - - if (currentOpts.hideOnContentClick) { - content.bind('click', $.fancybox.close); - } - - if (currentOpts.hideOnOverlayClick) { - overlay.bind('click', $.fancybox.close); - } - - $(window).bind("resize.fb", $.fancybox.resize); - - if (currentOpts.centerOnScroll) { - $(window).bind("scroll.fb", $.fancybox.center); - } - - if (currentOpts.type == 'iframe') { - $('<iframe id="fancybox-frame" name="fancybox-frame' + new Date().getTime() + '" frameborder="0" hspace="0" ' + ($.browser.msie ? 'allowtransparency="true""' : '') + ' scrolling="' + selectedOpts.scrolling + '" src="' + currentOpts.href + '"></iframe>').appendTo(content); - } - - wrap.show(); - - busy = false; - - $.fancybox.center(); - - currentOpts.onComplete(currentArray, currentIndex, currentOpts); - - _preload_images(); - }, - - _preload_images = function() { - var href, - objNext; - - if ((currentArray.length -1) > currentIndex) { - href = currentArray[ currentIndex + 1 ].href; - - if (typeof href !== 'undefined' && href.match(imgRegExp)) { - objNext = new Image(); - objNext.src = href; - } - } - - if (currentIndex > 0) { - href = currentArray[ currentIndex - 1 ].href; - - if (typeof href !== 'undefined' && href.match(imgRegExp)) { - objNext = new Image(); - objNext.src = href; - } - } - }, - - _draw = function(pos) { - var dim = { - width : parseInt(start_pos.width + (final_pos.width - start_pos.width) * pos, 10), - height : parseInt(start_pos.height + (final_pos.height - start_pos.height) * pos, 10), - - top : parseInt(start_pos.top + (final_pos.top - start_pos.top) * pos, 10), - left : parseInt(start_pos.left + (final_pos.left - start_pos.left) * pos, 10) - }; - - if (typeof final_pos.opacity !== 'undefined') { - dim.opacity = pos < 0.5 ? 0.5 : pos; - } - - wrap.css(dim); - - content.css({ - 'width' : dim.width - currentOpts.padding * 2, - 'height' : dim.height - (titleHeight * pos) - currentOpts.padding * 2 - }); - }, - - _get_viewport = function() { - return [ - $(window).width() - (currentOpts.margin * 2), - $(window).height() - (currentOpts.margin * 2), - $(document).scrollLeft() + currentOpts.margin, - $(document).scrollTop() + currentOpts.margin - ]; - }, - - _get_zoom_to = function () { - var view = _get_viewport(), - to = {}, - resize = currentOpts.autoScale, - double_padding = currentOpts.padding * 2, - ratio; - - if (currentOpts.width.toString().indexOf('%') > -1) { - to.width = parseInt((view[0] * parseFloat(currentOpts.width)) / 100, 10); - } else { - to.width = currentOpts.width + double_padding; - } - - if (currentOpts.height.toString().indexOf('%') > -1) { - to.height = parseInt((view[1] * parseFloat(currentOpts.height)) / 100, 10); - } else { - to.height = currentOpts.height + double_padding; - } - - if (resize && (to.width > view[0] || to.height > view[1])) { - if (selectedOpts.type == 'image' || selectedOpts.type == 'swf') { - ratio = (currentOpts.width ) / (currentOpts.height ); - - if ((to.width ) > view[0]) { - to.width = view[0]; - to.height = parseInt(((to.width - double_padding) / ratio) + double_padding, 10); - } - - if ((to.height) > view[1]) { - to.height = view[1]; - to.width = parseInt(((to.height - double_padding) * ratio) + double_padding, 10); - } - - } else { - to.width = Math.min(to.width, view[0]); - to.height = Math.min(to.height, view[1]); - } - } - - to.top = parseInt(Math.max(view[3] - 20, view[3] + ((view[1] - to.height - 40) * 0.5)), 10); - to.left = parseInt(Math.max(view[2] - 20, view[2] + ((view[0] - to.width - 40) * 0.5)), 10); - - return to; - }, - - _get_obj_pos = function(obj) { - var pos = obj.offset(); - - pos.top += parseInt( obj.css('paddingTop'), 10 ) || 0; - pos.left += parseInt( obj.css('paddingLeft'), 10 ) || 0; - - pos.top += parseInt( obj.css('border-top-width'), 10 ) || 0; - pos.left += parseInt( obj.css('border-left-width'), 10 ) || 0; - - pos.width = obj.width(); - pos.height = obj.height(); - - return pos; - }, - - _get_zoom_from = function() { - var orig = selectedOpts.orig ? $(selectedOpts.orig) : false, - from = {}, - pos, - view; - - if (orig && orig.length) { - pos = _get_obj_pos(orig); - - from = { - width : pos.width + (currentOpts.padding * 2), - height : pos.height + (currentOpts.padding * 2), - top : pos.top - currentOpts.padding - 20, - left : pos.left - currentOpts.padding - 20 - }; - - } else { - view = _get_viewport(); - - from = { - width : currentOpts.padding * 2, - height : currentOpts.padding * 2, - top : parseInt(view[3] + view[1] * 0.5, 10), - left : parseInt(view[2] + view[0] * 0.5, 10) - }; - } - - return from; - }, - - _animate_loading = function() { - if (!loading.is(':visible')){ - clearInterval(loadingTimer); - return; - } - - $('div', loading).css('top', (loadingFrame * -40) + 'px'); - - loadingFrame = (loadingFrame + 1) % 12; - }; - - /* - * Public methods - */ - - $.fn.fancybox = function(options) { - if (!$(this).length) { - return this; - } - - $(this) - .data('fancybox', $.extend({}, options, ($.metadata ? $(this).metadata() : {}))) - .unbind('click.fb') - .bind('click.fb', function(e) { - e.preventDefault(); - - if (busy) { - return; - } - - busy = true; - - $(this).blur(); - - selectedArray = []; - selectedIndex = 0; - - var rel = $(this).attr('rel') || ''; - - if (!rel || rel == '' || rel === 'nofollow') { - selectedArray.push(this); - - } else { - selectedArray = $("a[rel=" + rel + "], area[rel=" + rel + "]"); - selectedIndex = selectedArray.index( this ); - } - - _start(); - - return; - }); - - return this; - }; - - $.fancybox = function(obj) { - var opts; - - if (busy) { - return; - } - - busy = true; - opts = typeof arguments[1] !== 'undefined' ? arguments[1] : {}; - - selectedArray = []; - selectedIndex = parseInt(opts.index, 10) || 0; - - if ($.isArray(obj)) { - for (var i = 0, j = obj.length; i < j; i++) { - if (typeof obj[i] == 'object') { - $(obj[i]).data('fancybox', $.extend({}, opts, obj[i])); - } else { - obj[i] = $({}).data('fancybox', $.extend({content : obj[i]}, opts)); - } - } - - selectedArray = jQuery.merge(selectedArray, obj); - - } else { - if (typeof obj == 'object') { - $(obj).data('fancybox', $.extend({}, opts, obj)); - } else { - obj = $({}).data('fancybox', $.extend({content : obj}, opts)); - } - - selectedArray.push(obj); - } - - if (selectedIndex > selectedArray.length || selectedIndex < 0) { - selectedIndex = 0; - } - - _start(); - }; - - $.fancybox.showActivity = function() { - clearInterval(loadingTimer); - - loading.show(); - loadingTimer = setInterval(_animate_loading, 66); - }; - - $.fancybox.hideActivity = function() { - loading.hide(); - }; - - $.fancybox.next = function() { - return $.fancybox.pos( currentIndex + 1); - }; - - $.fancybox.prev = function() { - return $.fancybox.pos( currentIndex - 1); - }; - - $.fancybox.pos = function(pos) { - if (busy) { - return; - } - - pos = parseInt(pos); - - selectedArray = currentArray; - - if (pos > -1 && pos < currentArray.length) { - selectedIndex = pos; - _start(); - - } else if (currentOpts.cyclic && currentArray.length > 1) { - selectedIndex = pos >= currentArray.length ? 0 : currentArray.length - 1; - _start(); - } - - return; - }; - - $.fancybox.cancel = function() { - if (busy) { - return; - } - - busy = true; - - $.event.trigger('fancybox-cancel'); - - _abort(); - - selectedOpts.onCancel(selectedArray, selectedIndex, selectedOpts); - - busy = false; - }; - - // Note: within an iframe use - parent.$.fancybox.close(); - $.fancybox.close = function() { - if (busy || wrap.is(':hidden')) { - return; - } - - busy = true; - - if (currentOpts && false === currentOpts.onCleanup(currentArray, currentIndex, currentOpts)) { - busy = false; - return; - } - - _abort(); - - $(close.add( nav_left ).add( nav_right )).hide(); - - $(content.add( overlay )).unbind(); - - $(window).unbind("resize.fb scroll.fb"); - $(document).unbind('keydown.fb'); - - content.find('iframe').attr('src', isIE6 && /^https/i.test(window.location.href || '') ? 'javascript:void(false)' : 'about:blank'); - - if (currentOpts.titlePosition !== 'inside') { - title.empty(); - } - - wrap.stop(); - - function _cleanup() { - overlay.fadeOut('fast'); - - title.empty().hide(); - wrap.hide(); - - $.event.trigger('fancybox-cleanup'); - - content.empty(); - - currentOpts.onClosed(currentArray, currentIndex, currentOpts); - - currentArray = selectedOpts = []; - currentIndex = selectedIndex = 0; - currentOpts = selectedOpts = {}; - - busy = false; - } - - if (currentOpts.transitionOut == 'elastic') { - start_pos = _get_zoom_from(); - - var pos = wrap.position(); - - final_pos = { - top : pos.top , - left : pos.left, - width : wrap.width(), - height : wrap.height() - }; - - if (currentOpts.opacity) { - final_pos.opacity = 1; - } - - title.empty().hide(); - - fx.prop = 1; - - $(fx).animate({ prop: 0 }, { - duration : currentOpts.speedOut, - easing : currentOpts.easingOut, - step : _draw, - complete : _cleanup - }); - - } else { - wrap.fadeOut( currentOpts.transitionOut == 'none' ? 0 : currentOpts.speedOut, _cleanup); - } - }; - - $.fancybox.resize = function() { - if (overlay.is(':visible')) { - overlay.css('height', $(document).height()); - } - - $.fancybox.center(true); - }; - - $.fancybox.center = function() { - var view, align; - - if (busy) { - return; - } - - align = arguments[0] === true ? 1 : 0; - view = _get_viewport(); - - if (!align && (wrap.width() > view[0] || wrap.height() > view[1])) { - return; - } - - wrap - .stop() - .animate({ - 'top' : parseInt(Math.max(view[3] - 20, view[3] + ((view[1] - content.height() - 40) * 0.5) - currentOpts.padding)), - 'left' : parseInt(Math.max(view[2] - 20, view[2] + ((view[0] - content.width() - 40) * 0.5) - currentOpts.padding)) - }, typeof arguments[0] == 'number' ? arguments[0] : 200); - }; - - $.fancybox.init = function() { - if ($("#fancybox-wrap").length) { - return; - } - - $('body').append( - tmp = $('<div id="fancybox-tmp"></div>'), - loading = $('<div id="fancybox-loading"><div></div></div>'), - overlay = $('<div id="fancybox-overlay"></div>'), - wrap = $('<div id="fancybox-wrap"></div>') - ); - - outer = $('<div id="fancybox-outer"></div>') - .append('<div class="fancybox-bg" id="fancybox-bg-n"></div><div class="fancybox-bg" id="fancybox-bg-ne"></div><div class="fancybox-bg" id="fancybox-bg-e"></div><div class="fancybox-bg" id="fancybox-bg-se"></div><div class="fancybox-bg" id="fancybox-bg-s"></div><div class="fancybox-bg" id="fancybox-bg-sw"></div><div class="fancybox-bg" id="fancybox-bg-w"></div><div class="fancybox-bg" id="fancybox-bg-nw"></div>') - .appendTo( wrap ); - - outer.append( - content = $('<div id="fancybox-content"></div>'), - close = $('<a id="fancybox-close"></a>'), - title = $('<div id="fancybox-title"></div>'), - - nav_left = $('<a href="javascript:;" id="fancybox-left"><span class="fancy-ico" id="fancybox-left-ico"></span></a>'), - nav_right = $('<a href="javascript:;" id="fancybox-right"><span class="fancy-ico" id="fancybox-right-ico"></span></a>') - ); - - close.click($.fancybox.close); - loading.click($.fancybox.cancel); - - nav_left.click(function(e) { - e.preventDefault(); - $.fancybox.prev(); - }); - - nav_right.click(function(e) { - e.preventDefault(); - $.fancybox.next(); - }); - - if ($.fn.mousewheel) { - wrap.bind('mousewheel.fb', function(e, delta) { - if (busy) { - e.preventDefault(); - - } else if ($(e.target).get(0).clientHeight == 0 || $(e.target).get(0).scrollHeight === $(e.target).get(0).clientHeight) { - e.preventDefault(); - $.fancybox[ delta > 0 ? 'prev' : 'next'](); - } - }); - } - - if (!$.support.opacity) { - wrap.addClass('fancybox-ie'); - } - - if (isIE6) { - loading.addClass('fancybox-ie6'); - wrap.addClass('fancybox-ie6'); - - $('<iframe id="fancybox-hide-sel-frame" src="' + (/^https/i.test(window.location.href || '') ? 'javascript:void(false)' : 'about:blank' ) + '" scrolling="no" border="0" frameborder="0" tabindex="-1"></iframe>').prependTo(outer); - } - }; - - $.fn.fancybox.defaults = { - padding : 10, - margin : 40, - opacity : false, - modal : false, - cyclic : false, - scrolling : 'auto', // 'auto', 'yes' or 'no' - - width : 560, - height : 340, - - autoScale : true, - autoDimensions : true, - centerOnScroll : false, - - ajax : {}, - swf : { wmode: 'transparent' }, - - hideOnOverlayClick : true, - hideOnContentClick : false, - - overlayShow : true, - overlayOpacity : 0.7, - overlayColor : '#777', - - titleShow : true, - titlePosition : 'float', // 'float', 'outside', 'inside' or 'over' - titleFormat : null, - titleFromAlt : false, - - transitionIn : 'fade', // 'elastic', 'fade' or 'none' - transitionOut : 'fade', // 'elastic', 'fade' or 'none' - - speedIn : 300, - speedOut : 300, - - changeSpeed : 300, - changeFade : 'fast', - - easingIn : 'swing', - easingOut : 'swing', - - showCloseButton : true, - showNavArrows : true, - enableEscapeButton : true, - enableKeyboardNav : true, - - onStart : function(){}, - onCancel : function(){}, - onComplete : function(){}, - onCleanup : function(){}, - onClosed : function(){}, - onError : function(){} - }; - - $(document).ready(function() { - $.fancybox.init(); - }); - +/* + * FancyBox - jQuery Plugin + * Simple and fancy lightbox alternative + * + * Examples and documentation at: http://fancybox.net + * + * Copyright (c) 2008 - 2010 Janis Skarnelis + * That said, it is hardly a one-person project. Many people have submitted bugs, code, and offered their advice freely. Their support is greatly appreciated. + * + * Version: 1.3.4 (11/11/2010) + * Requires: jQuery v1.3+ + * + * Dual licensed under the MIT and GPL licenses: + * http://www.opensource.org/licenses/mit-license.php + * http://www.gnu.org/licenses/gpl.html + */ + +;(function($) { + var tmp, loading, overlay, wrap, outer, content, close, title, nav_left, nav_right, + + selectedIndex = 0, selectedOpts = {}, selectedArray = [], currentIndex = 0, currentOpts = {}, currentArray = [], + + ajaxLoader = null, imgPreloader = new Image(), imgRegExp = /\.(jpg|gif|png|bmp|jpeg)(.*)?$/i, swfRegExp = /[^\.]\.(swf)\s*$/i, + + loadingTimer, loadingFrame = 1, + + titleHeight = 0, titleStr = '', start_pos, final_pos, busy = false, fx = $.extend($('<div/>')[0], { prop: 0 }), + + isIE6 = $.browser.msie && $.browser.version < 7 && !window.XMLHttpRequest, + + /* + * Private methods + */ + + _abort = function() { + loading.hide(); + + imgPreloader.onerror = imgPreloader.onload = null; + + if (ajaxLoader) { + ajaxLoader.abort(); + } + + tmp.empty(); + }, + + _error = function() { + if (false === selectedOpts.onError(selectedArray, selectedIndex, selectedOpts)) { + loading.hide(); + busy = false; + return; + } + + selectedOpts.titleShow = false; + + selectedOpts.width = 'auto'; + selectedOpts.height = 'auto'; + + tmp.html( '<p id="fancybox-error">The requested content cannot be loaded.<br />Please try again later.</p>' ); + + _process_inline(); + }, + + _start = function() { + var obj = selectedArray[ selectedIndex ], + href, + type, + title, + str, + emb, + ret; + + _abort(); + + selectedOpts = $.extend({}, $.fn.fancybox.defaults, (typeof $(obj).data('fancybox') == 'undefined' ? selectedOpts : $(obj).data('fancybox'))); + + ret = selectedOpts.onStart(selectedArray, selectedIndex, selectedOpts); + + if (ret === false) { + busy = false; + return; + } else if (typeof ret == 'object') { + selectedOpts = $.extend(selectedOpts, ret); + } + + title = selectedOpts.title || (obj.nodeName ? $(obj).attr('title') : obj.title) || ''; + + if (obj.nodeName && !selectedOpts.orig) { + selectedOpts.orig = $(obj).children("img:first").length ? $(obj).children("img:first") : $(obj); + } + + if (title === '' && selectedOpts.orig && selectedOpts.titleFromAlt) { + title = selectedOpts.orig.attr('alt'); + } + + href = selectedOpts.href || (obj.nodeName ? $(obj).attr('href') : obj.href) || null; + + if ((/^(?:javascript)/i).test(href) || href == '#') { + href = null; + } + + if (selectedOpts.type) { + type = selectedOpts.type; + + if (!href) { + href = selectedOpts.content; + } + + } else if (selectedOpts.content) { + type = 'html'; + + } else if (href) { + if (href.match(imgRegExp)) { + type = 'image'; + + } else if (href.match(swfRegExp)) { + type = 'swf'; + + } else if ($(obj).hasClass("iframe")) { + type = 'iframe'; + + } else if (href.indexOf("#") === 0) { + type = 'inline'; + + } else { + type = 'ajax'; + } + } + + if (!type) { + _error(); + return; + } + + if (type == 'inline') { + obj = href.substr(href.indexOf("#")); + type = $(obj).length > 0 ? 'inline' : 'ajax'; + } + + selectedOpts.type = type; + selectedOpts.href = href; + selectedOpts.title = title; + + if (selectedOpts.autoDimensions) { + if (selectedOpts.type == 'html' || selectedOpts.type == 'inline' || selectedOpts.type == 'ajax') { + selectedOpts.width = 'auto'; + selectedOpts.height = 'auto'; + } else { + selectedOpts.autoDimensions = false; + } + } + + if (selectedOpts.modal) { + selectedOpts.overlayShow = true; + selectedOpts.hideOnOverlayClick = false; + selectedOpts.hideOnContentClick = false; + selectedOpts.enableEscapeButton = false; + selectedOpts.showCloseButton = false; + } + + selectedOpts.padding = parseInt(selectedOpts.padding, 10); + selectedOpts.margin = parseInt(selectedOpts.margin, 10); + + tmp.css('padding', (selectedOpts.padding + selectedOpts.margin)); + + $('.fancybox-inline-tmp').unbind('fancybox-cancel').bind('fancybox-change', function() { + $(this).replaceWith(content.children()); + }); + + switch (type) { + case 'html' : + tmp.html( selectedOpts.content ); + _process_inline(); + break; + + case 'inline' : + if ( $(obj).parent().is('#fancybox-content') === true) { + busy = false; + return; + } + + $('<div class="fancybox-inline-tmp" />') + .hide() + .insertBefore( $(obj) ) + .bind('fancybox-cleanup', function() { + $(this).replaceWith(content.children()); + }).bind('fancybox-cancel', function() { + $(this).replaceWith(tmp.children()); + }); + + $(obj).appendTo(tmp); + + _process_inline(); + break; + + case 'image': + busy = false; + + $.fancybox.showActivity(); + + imgPreloader = new Image(); + + imgPreloader.onerror = function() { + _error(); + }; + + imgPreloader.onload = function() { + busy = true; + + imgPreloader.onerror = imgPreloader.onload = null; + + _process_image(); + }; + + imgPreloader.src = href; + break; + + case 'swf': + selectedOpts.scrolling = 'no'; + + str = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="' + selectedOpts.width + '" height="' + selectedOpts.height + '"><param name="movie" value="' + href + '"></param>'; + emb = ''; + + $.each(selectedOpts.swf, function(name, val) { + str += '<param name="' + name + '" value="' + val + '"></param>'; + emb += ' ' + name + '="' + val + '"'; + }); + + str += '<embed src="' + href + '" type="application/x-shockwave-flash" width="' + selectedOpts.width + '" height="' + selectedOpts.height + '"' + emb + '></embed></object>'; + + tmp.html(str); + + _process_inline(); + break; + + case 'ajax': + busy = false; + + $.fancybox.showActivity(); + + selectedOpts.ajax.win = selectedOpts.ajax.success; + + ajaxLoader = $.ajax($.extend({}, selectedOpts.ajax, { + url : href, + data : selectedOpts.ajax.data || {}, + error : function(XMLHttpRequest, textStatus, errorThrown) { + if ( XMLHttpRequest.status > 0 ) { + _error(); + } + }, + success : function(data, textStatus, XMLHttpRequest) { + var o = typeof XMLHttpRequest == 'object' ? XMLHttpRequest : ajaxLoader; + if (o.status == 200) { + if ( typeof selectedOpts.ajax.win == 'function' ) { + ret = selectedOpts.ajax.win(href, data, textStatus, XMLHttpRequest); + + if (ret === false) { + loading.hide(); + return; + } else if (typeof ret == 'string' || typeof ret == 'object') { + data = ret; + } + } + + tmp.html( data ); + _process_inline(); + } + } + })); + + break; + + case 'iframe': + _show(); + break; + } + }, + + _process_inline = function() { + var + w = selectedOpts.width, + h = selectedOpts.height; + + if (w.toString().indexOf('%') > -1) { + w = parseInt( ($(window).width() - (selectedOpts.margin * 2)) * parseFloat(w) / 100, 10) + 'px'; + + } else { + w = w == 'auto' ? 'auto' : w + 'px'; + } + + if (h.toString().indexOf('%') > -1) { + h = parseInt( ($(window).height() - (selectedOpts.margin * 2)) * parseFloat(h) / 100, 10) + 'px'; + + } else { + h = h == 'auto' ? 'auto' : h + 'px'; + } + + tmp.wrapInner('<div style="width:' + w + ';height:' + h + ';overflow: ' + (selectedOpts.scrolling == 'auto' ? 'auto' : (selectedOpts.scrolling == 'yes' ? 'scroll' : 'hidden')) + ';position:relative;"></div>'); + + selectedOpts.width = tmp.width(); + selectedOpts.height = tmp.height(); + + _show(); + }, + + _process_image = function() { + selectedOpts.width = imgPreloader.width; + selectedOpts.height = imgPreloader.height; + + $("<img />").attr({ + 'id' : 'fancybox-img', + 'src' : imgPreloader.src, + 'alt' : selectedOpts.title + }).appendTo( tmp ); + + _show(); + }, + + _show = function() { + var pos, equal; + + loading.hide(); + + if (wrap.is(":visible") && false === currentOpts.onCleanup(currentArray, currentIndex, currentOpts)) { + $.event.trigger('fancybox-cancel'); + + busy = false; + return; + } + + busy = true; + + $(content.add( overlay )).unbind(); + + $(window).unbind("resize.fb scroll.fb"); + $(document).unbind('keydown.fb'); + + if (wrap.is(":visible") && currentOpts.titlePosition !== 'outside') { + wrap.css('height', wrap.height()); + } + + currentArray = selectedArray; + currentIndex = selectedIndex; + currentOpts = selectedOpts; + + if (currentOpts.overlayShow) { + overlay.css({ + 'background-color' : currentOpts.overlayColor, + 'opacity' : currentOpts.overlayOpacity, + 'cursor' : currentOpts.hideOnOverlayClick ? 'pointer' : 'auto', + 'height' : $(document).height() + }); + + if (!overlay.is(':visible')) { + if (isIE6) { + $('select:not(#fancybox-tmp select)').filter(function() { + return this.style.visibility !== 'hidden'; + }).css({'visibility' : 'hidden'}).one('fancybox-cleanup', function() { + this.style.visibility = 'inherit'; + }); + } + + overlay.show(); + } + } else { + overlay.hide(); + } + + final_pos = _get_zoom_to(); + + _process_title(); + + if (wrap.is(":visible")) { + $( close.add( nav_left ).add( nav_right ) ).hide(); + + pos = wrap.position(), + + start_pos = { + top : pos.top, + left : pos.left, + width : wrap.width(), + height : wrap.height() + }; + + equal = (start_pos.width == final_pos.width && start_pos.height == final_pos.height); + + content.fadeTo(currentOpts.changeFade, 0.3, function() { + var finish_resizing = function() { + content.html( tmp.contents() ).fadeTo(currentOpts.changeFade, 1, _finish); + }; + + $.event.trigger('fancybox-change'); + + content + .empty() + .removeAttr('filter') + .css({ + 'border-width' : currentOpts.padding, + 'width' : final_pos.width - currentOpts.padding * 2, + 'height' : selectedOpts.autoDimensions ? 'auto' : final_pos.height - titleHeight - currentOpts.padding * 2 + }); + + if (equal) { + finish_resizing(); + + } else { + fx.prop = 0; + + $(fx).animate({prop: 1}, { + duration : currentOpts.changeSpeed, + easing : currentOpts.easingChange, + step : _draw, + complete : finish_resizing + }); + } + }); + + return; + } + + wrap.removeAttr("style"); + + content.css('border-width', currentOpts.padding); + + if (currentOpts.transitionIn == 'elastic') { + start_pos = _get_zoom_from(); + + content.html( tmp.contents() ); + + wrap.show(); + + if (currentOpts.opacity) { + final_pos.opacity = 0; + } + + fx.prop = 0; + + $(fx).animate({prop: 1}, { + duration : currentOpts.speedIn, + easing : currentOpts.easingIn, + step : _draw, + complete : _finish + }); + + return; + } + + if (currentOpts.titlePosition == 'inside' && titleHeight > 0) { + title.show(); + } + + content + .css({ + 'width' : final_pos.width - currentOpts.padding * 2, + 'height' : selectedOpts.autoDimensions ? 'auto' : final_pos.height - titleHeight - currentOpts.padding * 2 + }) + .html( tmp.contents() ); + + wrap + .css(final_pos) + .fadeIn( currentOpts.transitionIn == 'none' ? 0 : currentOpts.speedIn, _finish ); + }, + + _format_title = function(title) { + if (title && title.length) { + if (currentOpts.titlePosition == 'float') { + return '<table id="fancybox-title-float-wrap" cellpadding="0" cellspacing="0"><tr><td id="fancybox-title-float-left"></td><td id="fancybox-title-float-main">' + title + '</td><td id="fancybox-title-float-right"></td></tr></table>'; + } + + return '<div id="fancybox-title-' + currentOpts.titlePosition + '">' + title + '</div>'; + } + + return false; + }, + + _process_title = function() { + titleStr = currentOpts.title || ''; + titleHeight = 0; + + title + .empty() + .removeAttr('style') + .removeClass(); + + if (currentOpts.titleShow === false) { + title.hide(); + return; + } + + titleStr = $.isFunction(currentOpts.titleFormat) ? currentOpts.titleFormat(titleStr, currentArray, currentIndex, currentOpts) : _format_title(titleStr); + + if (!titleStr || titleStr === '') { + title.hide(); + return; + } + + title + .addClass('fancybox-title-' + currentOpts.titlePosition) + .html( titleStr ) + .appendTo( 'body' ) + .show(); + + switch (currentOpts.titlePosition) { + case 'inside': + title + .css({ + 'width' : final_pos.width - (currentOpts.padding * 2), + 'marginLeft' : currentOpts.padding, + 'marginRight' : currentOpts.padding + }); + + titleHeight = title.outerHeight(true); + + title.appendTo( outer ); + + final_pos.height += titleHeight; + break; + + case 'over': + title + .css({ + 'marginLeft' : currentOpts.padding, + 'width' : final_pos.width - (currentOpts.padding * 2), + 'bottom' : currentOpts.padding + }) + .appendTo( outer ); + break; + + case 'float': + title + .css('left', parseInt((title.width() - final_pos.width - 40)/ 2, 10) * -1) + .appendTo( wrap ); + break; + + default: + title + .css({ + 'width' : final_pos.width - (currentOpts.padding * 2), + 'paddingLeft' : currentOpts.padding, + 'paddingRight' : currentOpts.padding + }) + .appendTo( wrap ); + break; + } + + title.hide(); + }, + + _set_navigation = function() { + if (currentOpts.enableEscapeButton || currentOpts.enableKeyboardNav) { + $(document).bind('keydown.fb', function(e) { + if (e.keyCode == 27 && currentOpts.enableEscapeButton) { + e.preventDefault(); + $.fancybox.close(); + + } else if ((e.keyCode == 37 || e.keyCode == 39) && currentOpts.enableKeyboardNav && e.target.tagName !== 'INPUT' && e.target.tagName !== 'TEXTAREA' && e.target.tagName !== 'SELECT') { + e.preventDefault(); + $.fancybox[ e.keyCode == 37 ? 'prev' : 'next'](); + } + }); + } + + if (!currentOpts.showNavArrows) { + nav_left.hide(); + nav_right.hide(); + return; + } + + if ((currentOpts.cyclic && currentArray.length > 1) || currentIndex !== 0) { + nav_left.show(); + } + + if ((currentOpts.cyclic && currentArray.length > 1) || currentIndex != (currentArray.length -1)) { + nav_right.show(); + } + }, + + _finish = function () { + if (!$.support.opacity) { + content.get(0).style.removeAttribute('filter'); + wrap.get(0).style.removeAttribute('filter'); + } + + if (selectedOpts.autoDimensions) { + content.css('height', 'auto'); + } + + wrap.css('height', 'auto'); + + if (titleStr && titleStr.length) { + title.show(); + } + + if (currentOpts.showCloseButton) { + close.show(); + } + + _set_navigation(); + + if (currentOpts.hideOnContentClick) { + content.bind('click', $.fancybox.close); + } + + if (currentOpts.hideOnOverlayClick) { + overlay.bind('click', $.fancybox.close); + } + + $(window).bind("resize.fb", $.fancybox.resize); + + if (currentOpts.centerOnScroll) { + $(window).bind("scroll.fb", $.fancybox.center); + } + + if (currentOpts.type == 'iframe') { + $('<iframe id="fancybox-frame" name="fancybox-frame' + new Date().getTime() + '" frameborder="0" hspace="0" ' + ($.browser.msie ? 'allowtransparency="true""' : '') + ' scrolling="' + selectedOpts.scrolling + '" src="' + currentOpts.href + '"></iframe>').appendTo(content); + } + + wrap.show(); + + busy = false; + + $.fancybox.center(); + + currentOpts.onComplete(currentArray, currentIndex, currentOpts); + + _preload_images(); + }, + + _preload_images = function() { + var href, + objNext; + + if ((currentArray.length -1) > currentIndex) { + href = currentArray[ currentIndex + 1 ].href; + + if (typeof href !== 'undefined' && href.match(imgRegExp)) { + objNext = new Image(); + objNext.src = href; + } + } + + if (currentIndex > 0) { + href = currentArray[ currentIndex - 1 ].href; + + if (typeof href !== 'undefined' && href.match(imgRegExp)) { + objNext = new Image(); + objNext.src = href; + } + } + }, + + _draw = function(pos) { + var dim = { + width : parseInt(start_pos.width + (final_pos.width - start_pos.width) * pos, 10), + height : parseInt(start_pos.height + (final_pos.height - start_pos.height) * pos, 10), + + top : parseInt(start_pos.top + (final_pos.top - start_pos.top) * pos, 10), + left : parseInt(start_pos.left + (final_pos.left - start_pos.left) * pos, 10) + }; + + if (typeof final_pos.opacity !== 'undefined') { + dim.opacity = pos < 0.5 ? 0.5 : pos; + } + + wrap.css(dim); + + content.css({ + 'width' : dim.width - currentOpts.padding * 2, + 'height' : dim.height - (titleHeight * pos) - currentOpts.padding * 2 + }); + }, + + _get_viewport = function() { + return [ + $(window).width() - (currentOpts.margin * 2), + $(window).height() - (currentOpts.margin * 2), + $(document).scrollLeft() + currentOpts.margin, + $(document).scrollTop() + currentOpts.margin + ]; + }, + + _get_zoom_to = function () { + var view = _get_viewport(), + to = {}, + resize = currentOpts.autoScale, + double_padding = currentOpts.padding * 2, + ratio; + + if (currentOpts.width.toString().indexOf('%') > -1) { + to.width = parseInt((view[0] * parseFloat(currentOpts.width)) / 100, 10); + } else { + to.width = currentOpts.width + double_padding; + } + + if (currentOpts.height.toString().indexOf('%') > -1) { + to.height = parseInt((view[1] * parseFloat(currentOpts.height)) / 100, 10); + } else { + to.height = currentOpts.height + double_padding; + } + + if (resize && (to.width > view[0] || to.height > view[1])) { + if (selectedOpts.type == 'image' || selectedOpts.type == 'swf') { + ratio = (currentOpts.width ) / (currentOpts.height ); + + if ((to.width ) > view[0]) { + to.width = view[0]; + to.height = parseInt(((to.width - double_padding) / ratio) + double_padding, 10); + } + + if ((to.height) > view[1]) { + to.height = view[1]; + to.width = parseInt(((to.height - double_padding) * ratio) + double_padding, 10); + } + + } else { + to.width = Math.min(to.width, view[0]); + to.height = Math.min(to.height, view[1]); + } + } + + to.top = parseInt(Math.max(view[3] - 20, view[3] + ((view[1] - to.height - 40) * 0.5)), 10); + to.left = parseInt(Math.max(view[2] - 20, view[2] + ((view[0] - to.width - 40) * 0.5)), 10); + + return to; + }, + + _get_obj_pos = function(obj) { + var pos = obj.offset(); + + pos.top += parseInt( obj.css('paddingTop'), 10 ) || 0; + pos.left += parseInt( obj.css('paddingLeft'), 10 ) || 0; + + pos.top += parseInt( obj.css('border-top-width'), 10 ) || 0; + pos.left += parseInt( obj.css('border-left-width'), 10 ) || 0; + + pos.width = obj.width(); + pos.height = obj.height(); + + return pos; + }, + + _get_zoom_from = function() { + var orig = selectedOpts.orig ? $(selectedOpts.orig) : false, + from = {}, + pos, + view; + + if (orig && orig.length) { + pos = _get_obj_pos(orig); + + from = { + width : pos.width + (currentOpts.padding * 2), + height : pos.height + (currentOpts.padding * 2), + top : pos.top - currentOpts.padding - 20, + left : pos.left - currentOpts.padding - 20 + }; + + } else { + view = _get_viewport(); + + from = { + width : currentOpts.padding * 2, + height : currentOpts.padding * 2, + top : parseInt(view[3] + view[1] * 0.5, 10), + left : parseInt(view[2] + view[0] * 0.5, 10) + }; + } + + return from; + }, + + _animate_loading = function() { + if (!loading.is(':visible')){ + clearInterval(loadingTimer); + return; + } + + $('div', loading).css('top', (loadingFrame * -40) + 'px'); + + loadingFrame = (loadingFrame + 1) % 12; + }; + + /* + * Public methods + */ + + $.fn.fancybox = function(options) { + if (!$(this).length) { + return this; + } + + $(this) + .data('fancybox', $.extend({}, options, ($.metadata ? $(this).metadata() : {}))) + .unbind('click.fb') + .bind('click.fb', function(e) { + e.preventDefault(); + + if (busy) { + return; + } + + busy = true; + + $(this).blur(); + + selectedArray = []; + selectedIndex = 0; + + var rel = $(this).attr('rel') || ''; + + if (!rel || rel == '' || rel === 'nofollow') { + selectedArray.push(this); + + } else { + selectedArray = $("a[rel=" + rel + "], area[rel=" + rel + "]"); + selectedIndex = selectedArray.index( this ); + } + + _start(); + + return; + }); + + return this; + }; + + $.fancybox = function(obj) { + var opts; + + if (busy) { + return; + } + + busy = true; + opts = typeof arguments[1] !== 'undefined' ? arguments[1] : {}; + + selectedArray = []; + selectedIndex = parseInt(opts.index, 10) || 0; + + if ($.isArray(obj)) { + for (var i = 0, j = obj.length; i < j; i++) { + if (typeof obj[i] == 'object') { + $(obj[i]).data('fancybox', $.extend({}, opts, obj[i])); + } else { + obj[i] = $({}).data('fancybox', $.extend({content : obj[i]}, opts)); + } + } + + selectedArray = jQuery.merge(selectedArray, obj); + + } else { + if (typeof obj == 'object') { + $(obj).data('fancybox', $.extend({}, opts, obj)); + } else { + obj = $({}).data('fancybox', $.extend({content : obj}, opts)); + } + + selectedArray.push(obj); + } + + if (selectedIndex > selectedArray.length || selectedIndex < 0) { + selectedIndex = 0; + } + + _start(); + }; + + $.fancybox.showActivity = function() { + clearInterval(loadingTimer); + + loading.show(); + loadingTimer = setInterval(_animate_loading, 66); + }; + + $.fancybox.hideActivity = function() { + loading.hide(); + }; + + $.fancybox.next = function() { + return $.fancybox.pos( currentIndex + 1); + }; + + $.fancybox.prev = function() { + return $.fancybox.pos( currentIndex - 1); + }; + + $.fancybox.pos = function(pos) { + if (busy) { + return; + } + + pos = parseInt(pos); + + selectedArray = currentArray; + + if (pos > -1 && pos < currentArray.length) { + selectedIndex = pos; + _start(); + + } else if (currentOpts.cyclic && currentArray.length > 1) { + selectedIndex = pos >= currentArray.length ? 0 : currentArray.length - 1; + _start(); + } + + return; + }; + + $.fancybox.cancel = function() { + if (busy) { + return; + } + + busy = true; + + $.event.trigger('fancybox-cancel'); + + _abort(); + + selectedOpts.onCancel(selectedArray, selectedIndex, selectedOpts); + + busy = false; + }; + + // Note: within an iframe use - parent.$.fancybox.close(); + $.fancybox.close = function() { + if (busy || wrap.is(':hidden')) { + return; + } + + busy = true; + + if (currentOpts && false === currentOpts.onCleanup(currentArray, currentIndex, currentOpts)) { + busy = false; + return; + } + + _abort(); + + $(close.add( nav_left ).add( nav_right )).hide(); + + $(content.add( overlay )).unbind(); + + $(window).unbind("resize.fb scroll.fb"); + $(document).unbind('keydown.fb'); + + content.find('iframe').attr('src', isIE6 && /^https/i.test(window.location.href || '') ? 'javascript:void(false)' : 'about:blank'); + + if (currentOpts.titlePosition !== 'inside') { + title.empty(); + } + + wrap.stop(); + + function _cleanup() { + overlay.fadeOut('fast'); + + title.empty().hide(); + wrap.hide(); + + $.event.trigger('fancybox-cleanup'); + + content.empty(); + + currentOpts.onClosed(currentArray, currentIndex, currentOpts); + + currentArray = selectedOpts = []; + currentIndex = selectedIndex = 0; + currentOpts = selectedOpts = {}; + + busy = false; + } + + if (currentOpts.transitionOut == 'elastic') { + start_pos = _get_zoom_from(); + + var pos = wrap.position(); + + final_pos = { + top : pos.top , + left : pos.left, + width : wrap.width(), + height : wrap.height() + }; + + if (currentOpts.opacity) { + final_pos.opacity = 1; + } + + title.empty().hide(); + + fx.prop = 1; + + $(fx).animate({ prop: 0 }, { + duration : currentOpts.speedOut, + easing : currentOpts.easingOut, + step : _draw, + complete : _cleanup + }); + + } else { + wrap.fadeOut( currentOpts.transitionOut == 'none' ? 0 : currentOpts.speedOut, _cleanup); + } + }; + + $.fancybox.resize = function() { + if (overlay.is(':visible')) { + overlay.css('height', $(document).height()); + } + + $.fancybox.center(true); + }; + + $.fancybox.center = function() { + var view, align; + + if (busy) { + return; + } + + align = arguments[0] === true ? 1 : 0; + view = _get_viewport(); + + if (!align && (wrap.width() > view[0] || wrap.height() > view[1])) { + return; + } + + wrap + .stop() + .animate({ + 'top' : parseInt(Math.max(view[3] - 20, view[3] + ((view[1] - content.height() - 40) * 0.5) - currentOpts.padding)), + 'left' : parseInt(Math.max(view[2] - 20, view[2] + ((view[0] - content.width() - 40) * 0.5) - currentOpts.padding)) + }, typeof arguments[0] == 'number' ? arguments[0] : 200); + }; + + $.fancybox.init = function() { + if ($("#fancybox-wrap").length) { + return; + } + + $('body').append( + tmp = $('<div id="fancybox-tmp"></div>'), + loading = $('<div id="fancybox-loading"><div></div></div>'), + overlay = $('<div id="fancybox-overlay"></div>'), + wrap = $('<div id="fancybox-wrap"></div>') + ); + + outer = $('<div id="fancybox-outer"></div>') + .append('<div class="fancybox-bg" id="fancybox-bg-n"></div><div class="fancybox-bg" id="fancybox-bg-ne"></div><div class="fancybox-bg" id="fancybox-bg-e"></div><div class="fancybox-bg" id="fancybox-bg-se"></div><div class="fancybox-bg" id="fancybox-bg-s"></div><div class="fancybox-bg" id="fancybox-bg-sw"></div><div class="fancybox-bg" id="fancybox-bg-w"></div><div class="fancybox-bg" id="fancybox-bg-nw"></div>') + .appendTo( wrap ); + + outer.append( + content = $('<div id="fancybox-content"></div>'), + close = $('<a id="fancybox-close"></a>'), + title = $('<div id="fancybox-title"></div>'), + + nav_left = $('<a href="javascript:;" id="fancybox-left"><span class="fancy-ico" id="fancybox-left-ico"></span></a>'), + nav_right = $('<a href="javascript:;" id="fancybox-right"><span class="fancy-ico" id="fancybox-right-ico"></span></a>') + ); + + close.click($.fancybox.close); + loading.click($.fancybox.cancel); + + nav_left.click(function(e) { + e.preventDefault(); + $.fancybox.prev(); + }); + + nav_right.click(function(e) { + e.preventDefault(); + $.fancybox.next(); + }); + + if ($.fn.mousewheel) { + wrap.bind('mousewheel.fb', function(e, delta) { + if (busy) { + e.preventDefault(); + + } else if ($(e.target).get(0).clientHeight == 0 || $(e.target).get(0).scrollHeight === $(e.target).get(0).clientHeight) { + e.preventDefault(); + $.fancybox[ delta > 0 ? 'prev' : 'next'](); + } + }); + } + + if (!$.support.opacity) { + wrap.addClass('fancybox-ie'); + } + + if (isIE6) { + loading.addClass('fancybox-ie6'); + wrap.addClass('fancybox-ie6'); + + $('<iframe id="fancybox-hide-sel-frame" src="' + (/^https/i.test(window.location.href || '') ? 'javascript:void(false)' : 'about:blank' ) + '" scrolling="no" border="0" frameborder="0" tabindex="-1"></iframe>').prependTo(outer); + } + }; + + $.fn.fancybox.defaults = { + padding : 10, + margin : 40, + opacity : false, + modal : false, + cyclic : false, + scrolling : 'auto', // 'auto', 'yes' or 'no' + + width : 560, + height : 340, + + autoScale : true, + autoDimensions : true, + centerOnScroll : false, + + ajax : {}, + swf : { wmode: 'transparent' }, + + hideOnOverlayClick : true, + hideOnContentClick : false, + + overlayShow : true, + overlayOpacity : 0.7, + overlayColor : '#777', + + titleShow : true, + titlePosition : 'float', // 'float', 'outside', 'inside' or 'over' + titleFormat : null, + titleFromAlt : false, + + transitionIn : 'fade', // 'elastic', 'fade' or 'none' + transitionOut : 'fade', // 'elastic', 'fade' or 'none' + + speedIn : 300, + speedOut : 300, + + changeSpeed : 300, + changeFade : 'fast', + + easingIn : 'swing', + easingOut : 'swing', + + showCloseButton : true, + showNavArrows : true, + enableEscapeButton : true, + enableKeyboardNav : true, + + onStart : function(){}, + onCancel : function(){}, + onComplete : function(){}, + onCleanup : function(){}, + onClosed : function(){}, + onError : function(){} + }; + + $(document).ready(function() { + $.fancybox.init(); + }); + })(jQuery); \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/jquery.fancybox-1.3.4.min.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/jquery.fancybox-1.3.4.min.css new file mode 100644 index 0000000000000000000000000000000000000000..61a99a4e83c0302fec4f2c9782a735358adeb381 --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/jquery.fancybox-1.3.4.min.css @@ -0,0 +1 @@ +#fancybox-loading{position:fixed;top:50%;left:50%;width:40px;height:40px;margin-top:-20px;margin-left:-20px;cursor:pointer;overflow:hidden;z-index:1104;display:none}#fancybox-loading div{position:absolute;top:0;left:0;width:40px;height:480px;background-image:url('fancybox.png')}#fancybox-overlay{position:absolute;top:0;left:0;width:100%;z-index:1100;display:none}#fancybox-tmp{padding:0;margin:0;border:0;overflow:auto;display:none}#fancybox-wrap{position:absolute;top:0;left:0;padding:20px;z-index:1101;outline:0;display:none}#fancybox-outer{position:relative;width:100%;height:100%;background:#fff}#fancybox-content{width:0;height:0;padding:0;outline:0;position:relative;overflow:hidden;z-index:1102;border:0 solid #fff}#fancybox-hide-sel-frame{position:absolute;top:0;left:0;width:100%;height:100%;background:transparent;z-index:1101}#fancybox-close{position:absolute;top:-15px;right:-15px;width:30px;height:30px;background:transparent url('fancybox.png') -40px 0;cursor:pointer;z-index:1103;display:none}#fancybox-error{color:#444;font:normal 12px/20px Arial;padding:14px;margin:0}#fancybox-img{width:100%;height:100%;padding:0;margin:0;border:0;outline:0;line-height:0;vertical-align:top}#fancybox-frame{width:100%;height:100%;border:0;display:block}#fancybox-left,#fancybox-right{position:absolute;bottom:0;height:100%;width:35%;cursor:pointer;outline:0;background:transparent url('blank.gif');z-index:1102;display:none}#fancybox-left{left:0}#fancybox-right{right:0}#fancybox-left-ico,#fancybox-right-ico{position:absolute;top:50%;left:-9999px;width:30px;height:30px;margin-top:-15px;cursor:pointer;z-index:1102;display:block}#fancybox-left-ico{background-image:url('fancybox.png');background-position:-40px -30px}#fancybox-right-ico{background-image:url('fancybox.png');background-position:-40px -60px}#fancybox-left:hover,#fancybox-right:hover{visibility:visible}#fancybox-left:hover span{left:20px}#fancybox-right:hover span{left:auto;right:20px}.fancybox-bg{position:absolute;padding:0;margin:0;border:0;width:20px;height:20px;z-index:1001}#fancybox-bg-n{top:-20px;left:0;width:100%;background-image:url('fancybox-x.png')}#fancybox-bg-ne{top:-20px;right:-20px;background-image:url('fancybox.png');background-position:-40px -162px}#fancybox-bg-e{top:0;right:-20px;height:100%;background-image:url('fancybox-y.png');background-position:-20px 0}#fancybox-bg-se{bottom:-20px;right:-20px;background-image:url('fancybox.png');background-position:-40px -182px}#fancybox-bg-s{bottom:-20px;left:0;width:100%;background-image:url('fancybox-x.png');background-position:0 -20px}#fancybox-bg-sw{bottom:-20px;left:-20px;background-image:url('fancybox.png');background-position:-40px -142px}#fancybox-bg-w{top:0;left:-20px;height:100%;background-image:url('fancybox-y.png')}#fancybox-bg-nw{top:-20px;left:-20px;background-image:url('fancybox.png');background-position:-40px -122px}#fancybox-title{font-family:Helvetica;font-size:12px;z-index:1102}.fancybox-title-inside{padding-bottom:10px;text-align:center;color:#333;background:#fff;position:relative}.fancybox-title-outside{padding-top:10px;color:#fff}.fancybox-title-over{position:absolute;bottom:0;left:0;color:#FFF;text-align:left}#fancybox-title-over{padding:10px;background-image:url('fancy_title_over.png');display:block}.fancybox-title-float{position:absolute;left:0;bottom:-20px;height:32px}#fancybox-title-float-wrap{border:0;border-collapse:collapse;width:auto}#fancybox-title-float-wrap td{border:0;white-space:nowrap}#fancybox-title-float-left{padding:0 0 0 15px;background:url('fancybox.png') -40px -90px no-repeat}#fancybox-title-float-main{color:#FFF;line-height:29px;font-weight:bold;padding:0 0 3px 0;background:url('fancybox-x.png') 0 -40px}#fancybox-title-float-right{padding:0 0 0 15px;background:url('fancybox.png') -55px -90px no-repeat}.fancybox-ie6 #fancybox-close{background:transparent;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_close.png',sizingMethod='scale')}.fancybox-ie6 #fancybox-left-ico{background:transparent;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_nav_left.png',sizingMethod='scale')}.fancybox-ie6 #fancybox-right-ico{background:transparent;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_nav_right.png',sizingMethod='scale')}.fancybox-ie6 #fancybox-title-over{background:transparent;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_over.png',sizingMethod='scale');zoom:1}.fancybox-ie6 #fancybox-title-float-left{background:transparent;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_left.png',sizingMethod='scale')}.fancybox-ie6 #fancybox-title-float-main{background:transparent;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_main.png',sizingMethod='scale')}.fancybox-ie6 #fancybox-title-float-right{background:transparent;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_right.png',sizingMethod='scale')}.fancybox-ie6 #fancybox-bg-w,.fancybox-ie6 #fancybox-bg-e,.fancybox-ie6 #fancybox-left,.fancybox-ie6 #fancybox-right,#fancybox-hide-sel-frame{height:expression(this.parentNode.clientHeight+"px")}#fancybox-loading.fancybox-ie6{position:absolute;margin-top:0;top:expression((-20+(document.documentElement.clientHeight ? document.documentElement.clientHeight/2:document.body.clientHeight/2)+(ignoreMe=document.documentElement.scrollTop ? document.documentElement.scrollTop:document.body.scrollTop))+'px')}#fancybox-loading.fancybox-ie6 div{background:transparent;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_loading.png',sizingMethod='scale')}.fancybox-ie .fancybox-bg{background:transparent !important}.fancybox-ie #fancybox-bg-n{filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_n.png',sizingMethod='scale')}.fancybox-ie #fancybox-bg-ne{filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_ne.png',sizingMethod='scale')}.fancybox-ie #fancybox-bg-e{filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_e.png',sizingMethod='scale')}.fancybox-ie #fancybox-bg-se{filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_se.png',sizingMethod='scale')}.fancybox-ie #fancybox-bg-s{filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_s.png',sizingMethod='scale')}.fancybox-ie #fancybox-bg-sw{filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_sw.png',sizingMethod='scale')}.fancybox-ie #fancybox-bg-w{filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_w.png',sizingMethod='scale')}.fancybox-ie #fancybox-bg-nw{filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_nw.png',sizingMethod='scale')}#fancybox-wrap,#fancybox-content,#fancybox-outer{box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box} \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/jquery.fancybox-1.3.4.min.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/jquery.fancybox-1.3.4.min.js new file mode 100644 index 0000000000000000000000000000000000000000..9e9df6e67d3a74dfa1ee449153602ab428c16434 --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/jquery.fancybox-1.3.4.min.js @@ -0,0 +1 @@ +eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}(';(d($){P H,X,Y,q,1E,y,11,f,1H,1G,T=0,9={},Q=[],O=0,4={},K=[],29=1L,13=22 2b(),2j=/\\.(58|57|56|59|5a)(.*)?$/i,3z=/[^\\.]\\.(1N)\\s*$/i,2t,2u=1,1s=0,1c=\'\',U,F,D=t,1w=$.1k($(\'<l/>\')[0],{1t:0}),2D=$.34.3L&&$.34.5c<7&&!16.1x,2p=d(){X.L();13.3h=13.3r=1L;6(29){29.5b()}H.1u()},2o=d(){6(t===9.3F(Q,T,9)){X.L();D=t;r}9.30=t;9.b=\'R\';9.c=\'R\';H.17(\'<p z="8-4b">55 54 y 4Z 4Y 4X.<50 />51 53 52 5d.</p>\');1U()},1Y=d(){P g=Q[T],k,E,f,23,2z,1a;2p();9=$.1k({},$.2F.8.4t,(Z $(g).W(\'8\')==\'21\'?9:$(g).W(\'8\')));1a=9.3X(Q,T,9);6(1a===t){D=t;r}A 6(Z 1a==\'1A\'){9=$.1k(9,1a)}f=9.f||(g.3s?$(g).1Q(\'f\'):g.f)||\'\';6(g.3s&&!9.1e){9.1e=$(g).1X("2c:3C").N?$(g).1X("2c:3C"):$(g)}6(f===\'\'&&9.1e&&9.3J){f=9.1e.1Q(\'3Y\')}k=9.k||(g.3s?$(g).1Q(\'k\'):g.k)||1L;6((/^(?:2a)/i).2N(k)||k==\'#\'){k=1L}6(9.E){E=9.E;6(!k){k=9.y}}A 6(9.y){E=\'17\'}A 6(k){6(k.2k(2j)){E=\'32\'}A 6(k.2k(3z)){E=\'1N\'}A 6($(g).5p("1j")){E=\'1j\'}A 6(k.1R("#")===0){E=\'1z\'}A{E=\'15\'}}6(!E){2o();r}6(E==\'1z\'){g=k.5o(k.1R("#"));E=$(g).N>0?\'1z\':\'15\'}9.E=E;9.k=k;9.f=f;6(9.1J){6(9.E==\'17\'||9.E==\'1z\'||9.E==\'15\'){9.b=\'R\';9.c=\'R\'}A{9.1J=t}}6(9.4v){9.31=I;9.2M=t;9.33=t;9.2K=t;9.2S=t}9.v=B(9.v,10);9.1b=B(9.1b,10);H.G(\'v\',(9.v+9.1b));$(\'.8-1z-H\').1r(\'8-1T\').1f(\'8-3R\',d(){$(V).3i(y.1X())});43(E){1m\'17\':H.17(9.y);1U();1g;1m\'1z\':6($(g).5q().1q(\'#8-y\')===I){D=t;r}$(\'<l 18="8-1z-H" />\').L().5r($(g)).1f(\'8-2T\',d(){$(V).3i(y.1X())}).1f(\'8-1T\',d(){$(V).3i(H.1X())});$(g).1i(H);1U();1g;1m\'32\':D=t;$.8.2X();13=22 2b();13.3h=d(){2o()};13.3r=d(){D=I;13.3h=13.3r=1L;3V()};13.1h=k;1g;1m\'1N\':9.1F=\'4q\';23=\'<1A 5n="5m:5h-5g-5f-4W-5j" b="\'+9.b+\'" c="\'+9.c+\'"><2x 1V="5l" 3K="\'+k+\'"></2x>\';2z=\'\';$.5k(9.1N,d(1V,3l){23+=\'<2x 1V="\'+1V+\'" 3K="\'+3l+\'"></2x>\';2z+=\' \'+1V+\'="\'+3l+\'"\'});23+=\'<3A 1h="\'+k+\'" E="4N/x-4L-4K" b="\'+9.b+\'" c="\'+9.c+\'"\'+2z+\'></3A></1A>\';H.17(23);1U();1g;1m\'15\':D=t;$.8.2X();9.15.3j=9.15.41;29=$.15($.1k({},9.15,{4U:k,W:9.15.W||{},4b:d(1x,3w,4Q){6(1x.3S>0){2o()}},41:d(W,3w,1x){P o=Z 1x==\'1A\'?1x:29;6(o.3S==3y){6(Z 9.15.3j==\'d\'){1a=9.15.3j(k,W,3w,1x);6(1a===t){X.L();r}A 6(Z 1a==\'4V\'||Z 1a==\'1A\'){W=1a}}H.17(W);1U()}}}));1g;1m\'1j\':2f();1g}},1U=d(){P w=9.b,h=9.c;6(w.2B().1R(\'%\')>-1){w=B(($(16).b()-(9.1b*2))*2w(w)/2v,10)+\'1Z\'}A{w=w==\'R\'?\'R\':w+\'1Z\'}6(h.2B().1R(\'%\')>-1){h=B(($(16).c()-(9.1b*2))*2w(h)/2v,10)+\'1Z\'}A{h=h==\'R\'?\'R\':h+\'1Z\'}H.4O(\'<l 1I="b:\'+w+\';c:\'+h+\';4T: \'+(9.1F==\'R\'?\'R\':(9.1F==\'4M\'?\'2C\':\'2n\'))+\';38:4R;"></l>\');9.b=H.b();9.c=H.c();2f()},3V=d(){9.b=13.b;9.c=13.c;$("<2c />").1Q({\'z\':\'8-2c\',\'1h\':13.1h,\'3Y\':9.f}).1i(H);2f()},2f=d(){P m,2O;X.L();6(q.1q(":1O")&&t===4.3g(K,O,4)){$.2q.2s(\'8-1T\');D=t;r}D=I;$(y.1S(Y)).1r();$(16).1r("1B.14 2C.14");$(1o).1r(\'2W.14\');6(q.1q(":1O")&&4.1n!==\'5z\'){q.G(\'c\',q.c())}K=Q;O=T;4=9;6(4.31){Y.G({\'62-63\':4.3N,\'19\':4.3H,\'5v\':4.2M?\'64\':\'R\',\'c\':$(1o).c()});6(!Y.1q(\':1O\')){6(2D){$(\'3P:65(#8-H 3P)\').2e(d(){r V.1I.2R!==\'2n\'}).G({\'2R\':\'2n\'}).61(\'8-2T\',d(){V.1I.2R=\'5V\'})}Y.1d()}}A{Y.L()}F=3I();47();6(q.1q(":1O")){$(11.1S(1H).1S(1G)).L();m=q.38(),U={M:m.M,J:m.J,b:q.b(),c:q.c()};2O=(U.b==F.b&&U.c==F.c);y.3Q(4.36,0.3,d(){P 2P=d(){y.17(H.2Q()).3Q(4.36,1,2h)};$.2q.2s(\'8-3R\');y.1u().3e(\'2e\').G({\'26-b\':4.v,\'b\':F.b-4.v*2,\'c\':9.1J?\'R\':F.c-1s-4.v*2});6(2O){2P()}A{1w.1t=0;$(1w).2d({1t:1},{3v:4.3B,3u:4.5Z,3t:2r,3q:2P})}});r}q.3e("1I");y.G(\'26-b\',4.v);6(4.2Z==\'4B\'){U=2V();y.17(H.2Q());q.1d();6(4.19){F.19=0}1w.1t=0;$(1w).2d({1t:1},{3v:4.3c,3u:4.42,3t:2r,3q:2h});r}6(4.1n==\'2U\'&&1s>0){f.1d()}y.G({\'b\':F.b-4.v*2,\'c\':9.1J?\'R\':F.c-1s-4.v*2}).17(H.2Q());q.G(F).67(4.2Z==\'4d\'?0:4.3c,2h)},46=d(f){6(f&&f.N){6(4.1n==\'1D\'){r\'<4a z="8-f-1D-q" 68="0" 6g="0"><49><1P z="8-f-1D-J"></1P><1P z="8-f-1D-6h">\'+f+\'</1P><1P z="8-f-1D-3p"></1P></49></4a>\'}r\'<l z="8-f-\'+4.1n+\'">\'+f+\'</l>\'}r t},47=d(){1c=4.f||\'\';1s=0;f.1u().3e(\'1I\').6f();6(4.30===t){f.L();r}1c=$.6e(4.2Y)?4.2Y(1c,K,O,4):46(1c);6(!1c||1c===\'\'){f.L();r}f.2I(\'8-f-\'+4.1n).17(1c).1i(\'4h\').1d();43(4.1n){1m\'2U\':f.G({\'b\':F.b-(4.v*2),\'44\':4.v,\'69\':4.v});1s=f.5E(I);f.1i(1E);F.c+=1s;1g;1m\'5F\':f.G({\'44\':4.v,\'b\':F.b-(4.v*2),\'5C\':4.v}).1i(1E);1g;1m\'1D\':f.G(\'J\',B((f.b()-F.b-40)/2,10)*-1).1i(q);1g;5x:f.G({\'b\':F.b-(4.v*2),\'4y\':4.v,\'5w\':4.v}).1i(q);1g}f.L()},3D=d(){6(4.2K||4.3o){$(1o).1f(\'2W.14\',d(e){6(e.2g==27&&4.2K){e.1v();$.8.11()}A 6((e.2g==37||e.2g==39)&&4.3o&&e.1M.3a!==\'5A\'&&e.1M.3a!==\'5H\'&&e.1M.3a!==\'5P\'){e.1v();$.8[e.2g==37?\'2L\':\'2J\']()}})}6(!4.3W){1H.L();1G.L();r}6((4.2H&&K.N>1)||O!==0){1H.1d()}6((4.2H&&K.N>1)||O!=(K.N-1)){1G.1d()}},2h=d(){6(!$.4D.19){y.1W(0).1I.3E(\'2e\');q.1W(0).1I.3E(\'2e\')}6(9.1J){y.G(\'c\',\'R\')}q.G(\'c\',\'R\');6(1c&&1c.N){f.1d()}6(4.2S){11.1d()}3D();6(4.33){y.1f(\'1p\',$.8.11)}6(4.2M){Y.1f(\'1p\',$.8.11)}$(16).1f("1B.14",$.8.1B);6(4.4z){$(16).1f("2C.14",$.8.2A)}6(4.E==\'1j\'){$(\'<1j z="8-3f" 1V="8-3f\'+22 5D().5M()+\'" 4n="0" 5K="0" \'+($.34.3L?\'5S="I""\':\'\')+\' 1F="\'+9.1F+\'" 1h="\'+4.k+\'"></1j>\').1i(y)}q.1d();D=t;$.8.2A();4.3O(K,O,4);3M()},3M=d(){P k,25;6((K.N-1)>O){k=K[O+1].k;6(Z k!==\'21\'&&k.2k(2j)){25=22 2b();25.1h=k}}6(O>0){k=K[O-1].k;6(Z k!==\'21\'&&k.2k(2j)){25=22 2b();25.1h=k}}},2r=d(m){P 24={b:B(U.b+(F.b-U.b)*m,10),c:B(U.c+(F.c-U.c)*m,10),M:B(U.M+(F.M-U.M)*m,10),J:B(U.J+(F.J-U.J)*m,10)};6(Z F.19!==\'21\'){24.19=m<0.5?0.5:m}q.G(24);y.G({\'b\':24.b-4.v*2,\'c\':24.c-(1s*m)-4.v*2})},2l=d(){r[$(16).b()-(4.1b*2),$(16).c()-(4.1b*2),$(1o).5U()+4.1b,$(1o).5T()+4.1b]},3I=d(){P u=2l(),C={},1B=4.4x,1C=4.v*2,2m;6(4.b.2B().1R(\'%\')>-1){C.b=B((u[0]*2w(4.b))/2v,10)}A{C.b=4.b+1C}6(4.c.2B().1R(\'%\')>-1){C.c=B((u[1]*2w(4.c))/2v,10)}A{C.c=4.c+1C}6(1B&&(C.b>u[0]||C.c>u[1])){6(9.E==\'32\'||9.E==\'1N\'){2m=(4.b)/(4.c);6((C.b)>u[0]){C.b=u[0];C.c=B(((C.b-1C)/2m)+1C,10)}6((C.c)>u[1]){C.c=u[1];C.b=B(((C.c-1C)*2m)+1C,10)}}A{C.b=1K.3T(C.b,u[0]);C.c=1K.3T(C.c,u[1])}}C.M=B(1K.2i(u[3]-20,u[3]+((u[1]-C.c-40)*0.5)),10);C.J=B(1K.2i(u[2]-20,u[2]+((u[0]-C.b-40)*0.5)),10);r C},4w=d(g){P m=g.5Y();m.M+=B(g.G(\'6d\'),10)||0;m.J+=B(g.G(\'4y\'),10)||0;m.M+=B(g.G(\'26-M-b\'),10)||0;m.J+=B(g.G(\'26-J-b\'),10)||0;m.b=g.b();m.c=g.c();r m},2V=d(){P 1e=9.1e?$(9.1e):t,2y={},m,u;6(1e&&1e.N){m=4w(1e);2y={b:m.b+(4.v*2),c:m.c+(4.v*2),M:m.M-4.v-20,J:m.J-4.v-20}}A{u=2l();2y={b:4.v*2,c:4.v*2,M:B(u[3]+u[1]*0.5,10),J:B(u[2]+u[0]*0.5,10)}}r 2y},4s=d(){6(!X.1q(\':1O\')){4o(2t);r}$(\'l\',X).G(\'M\',(2u*-40)+\'1Z\');2u=(2u+1)%12};$.2F.8=d(4E){6(!$(V).N){r V}$(V).W(\'8\',$.1k({},4E,($.4F?$(V).4F():{}))).1r(\'1p.14\').1f(\'1p.14\',d(e){e.1v();6(D){r}D=I;$(V).5Q();Q=[];T=0;P 1l=$(V).1Q(\'1l\')||\'\';6(!1l||1l==\'\'||1l===\'5R\'){Q.4p(V)}A{Q=$("a[1l="+1l+"], 5N[1l="+1l+"]");T=Q.4e(V)}1Y();r});r V};$.8=d(g){P 1y;6(D){r}D=I;1y=Z 28[1]!==\'21\'?28[1]:{};Q=[];T=B(1y.4e,10)||0;6($.5L(g)){5J(P i=0,j=g.N;i<j;i++){6(Z g[i]==\'1A\'){$(g[i]).W(\'8\',$.1k({},1y,g[i]))}A{g[i]=$({}).W(\'8\',$.1k({y:g[i]},1y))}}Q=4H.5O(Q,g)}A{6(Z g==\'1A\'){$(g).W(\'8\',$.1k({},1y,g))}A{g=$({}).W(\'8\',$.1k({y:g},1y))}Q.4p(g)}6(T>Q.N||T<0){T=0}1Y()};$.8.2X=d(){4o(2t);X.1d();2t=6b(4s,66)};$.8.6c=d(){X.L()};$.8.2J=d(){r $.8.m(O+1)};$.8.2L=d(){r $.8.m(O-1)};$.8.m=d(m){6(D){r}m=B(m);Q=K;6(m>-1&&m<K.N){T=m;1Y()}A 6(4.2H&&K.N>1){T=m>=K.N?0:K.N-1;1Y()}r};$.8.1T=d(){6(D){r}D=I;$.2q.2s(\'8-1T\');2p();9.3Z(Q,T,9);D=t};$.8.11=d(){6(D||q.1q(\':2n\')){r}D=I;6(4&&t===4.3g(K,O,4)){D=t;r}2p();$(11.1S(1H).1S(1G)).L();$(y.1S(Y)).1r();$(16).1r("1B.14 2C.14");$(1o).1r(\'2W.14\');y.60(\'1j\').1Q(\'1h\',2D&&/^4C/i.2N(16.4u.k||\'\')?\'2a:4i(t)\':\'4j:4f\');6(4.1n!==\'2U\'){f.1u()}q.4r();d 3k(){Y.4g(\'45\');f.1u().L();q.L();$.2q.2s(\'8-2T\');y.1u();4.3x(K,O,4);K=9=[];O=T=0;4=9={};D=t}6(4.35==\'4B\'){U=2V();P m=q.38();F={M:m.M,J:m.J,b:q.b(),c:q.c()};6(4.19){F.19=1}f.1u().L();1w.1t=1;$(1w).2d({1t:0},{3v:4.3d,3u:4.48,3t:2r,3q:3k})}A{q.4g(4.35==\'4d\'?0:4.3d,3k)}};$.8.1B=d(){6(Y.1q(\':1O\')){Y.G(\'c\',$(1o).c())}$.8.2A(I)};$.8.2A=d(){P u,3m;6(D){r}3m=28[0]===I?1:0;u=2l();6(!3m&&(q.b()>u[0]||q.c()>u[1])){r}q.4r().2d({\'M\':B(1K.2i(u[3]-20,u[3]+((u[1]-y.c()-40)*0.5)-4.v)),\'J\':B(1K.2i(u[2]-20,u[2]+((u[0]-y.b()-40)*0.5)-4.v))},Z 28[0]==\'5e\'?28[0]:3y)};$.8.3G=d(){6($("#8-q").N){r}$(\'4h\').3n(H=$(\'<l z="8-H"></l>\'),X=$(\'<l z="8-X"><l></l></l>\'),Y=$(\'<l z="8-Y"></l>\'),q=$(\'<l z="8-q"></l>\'));1E=$(\'<l z="8-1E"></l>\').3n(\'<l 18="8-S" z="8-S-n"></l><l 18="8-S" z="8-S-5t"></l><l 18="8-S" z="8-S-e"></l><l 18="8-S" z="8-S-5u"></l><l 18="8-S" z="8-S-s"></l><l 18="8-S" z="8-S-4P"></l><l 18="8-S" z="8-S-w"></l><l 18="8-S" z="8-S-4I"></l>\').1i(q);1E.3n(y=$(\'<l z="8-y"></l>\'),11=$(\'<a z="8-11"></a>\'),f=$(\'<l z="8-f"></l>\'),1H=$(\'<a k="2a:;" z="8-J"><2E 18="4m-2G" z="8-J-2G"></2E></a>\'),1G=$(\'<a k="2a:;" z="8-3p"><2E 18="4m-2G" z="8-3p-2G"></2E></a>\'));11.1p($.8.11);X.1p($.8.1T);1H.1p(d(e){e.1v();$.8.2L()});1G.1p(d(e){e.1v();$.8.2J()});6($.2F.4l){q.1f(\'4l.14\',d(e,4G){6(D){e.1v()}A 6($(e.1M).1W(0).4k==0||$(e.1M).1W(0).4S===$(e.1M).1W(0).4k){e.1v();$.8[4G>0?\'2L\':\'2J\']()}})}6(!$.4D.19){q.2I(\'8-4J\')}6(2D){X.2I(\'8-4A\');q.2I(\'8-4A\');$(\'<1j z="8-L-5i-3f" 1h="\'+(/^4C/i.2N(16.4u.k||\'\')?\'2a:4i(t)\':\'4j:4f\')+\'" 1F="4q" 26="0" 4n="0" 5G="-1"></1j>\').5I(1E)}};$.2F.8.4t={v:10,1b:40,19:t,4v:t,2H:t,1F:\'R\',b:5B,c:6a,4x:I,1J:I,4z:t,15:{},1N:{5W:\'5X\'},2M:I,33:t,31:I,3H:0.7,3N:\'#5y\',30:I,1n:\'1D\',2Y:1L,3J:t,2Z:\'4c\',35:\'4c\',3c:3b,3d:3b,3B:3b,36:\'45\',42:\'3U\',48:\'3U\',2S:I,3W:I,2K:I,3o:I,3X:d(){},3Z:d(){},3O:d(){},3g:d(){},3x:d(){},3F:d(){}};$(1o).5s(d(){$.8.3G()})})(4H);',62,390,'||||currentOpts||if||fancybox|selectedOpts||width|height|function||title|obj||||href|div|pos||||wrap|return||false|view|padding|||content|id|else|parseInt|to|busy|type|final_pos|css|tmp|true|left|currentArray|hide|top|length|currentIndex|var|selectedArray|auto|bg|selectedIndex|start_pos|this|data|loading|overlay|typeof||close||imgPreloader|fb|ajax|window|html|class|opacity|ret|margin|titleStr|show|orig|bind|break|src|appendTo|iframe|extend|rel|case|titlePosition|document|click|is|unbind|titleHeight|prop|empty|preventDefault|fx|XMLHttpRequest|opts|inline|object|resize|double_padding|float|outer|scrolling|nav_right|nav_left|style|autoDimensions|Math|null|target|swf|visible|td|attr|indexOf|add|cancel|_process_inline|name|get|children|_start|px||undefined|new|str|dim|objNext|border||arguments|ajaxLoader|javascript|Image|img|animate|filter|_show|keyCode|_finish|max|imgRegExp|match|_get_viewport|ratio|hidden|_error|_abort|event|_draw|trigger|loadingTimer|loadingFrame|100|parseFloat|param|from|emb|center|toString|scroll|isIE6|span|fn|ico|cyclic|addClass|next|enableEscapeButton|prev|hideOnOverlayClick|test|equal|finish_resizing|contents|visibility|showCloseButton|cleanup|inside|_get_zoom_from|keydown|showActivity|titleFormat|transitionIn|titleShow|overlayShow|image|hideOnContentClick|browser|transitionOut|changeFade||position||tagName|300|speedIn|speedOut|removeAttr|frame|onCleanup|onerror|replaceWith|win|_cleanup|val|align|append|enableKeyboardNav|right|complete|onload|nodeName|step|easing|duration|textStatus|onClosed|200|swfRegExp|embed|changeSpeed|first|_set_navigation|removeAttribute|onError|init|overlayOpacity|_get_zoom_to|titleFromAlt|value|msie|_preload_images|overlayColor|onComplete|select|fadeTo|change|status|min|swing|_process_image|showNavArrows|onStart|alt|onCancel||success|easingIn|switch|marginLeft|fast|_format_title|_process_title|easingOut|tr|table|error|fade|none|index|blank|fadeOut|body|void|about|clientHeight|mousewheel|fancy|frameborder|clearInterval|push|no|stop|_animate_loading|defaults|location|modal|_get_obj_pos|autoScale|paddingLeft|centerOnScroll|ie6|elastic|https|support|options|metadata|delta|jQuery|nw|ie|flash|shockwave|yes|application|wrapInner|sw|errorThrown|relative|scrollHeight|overflow|url|string|96B8|loaded|be|cannot|br|Please|again|try|requested|The|png|gif|jpg|bmp|jpeg|abort|version|later|number|11cf|AE6D|D27CDB6E|sel|444553540000|each|movie|clsid|classid|substr|hasClass|parent|insertBefore|ready|ne|se|cursor|paddingRight|default|777|outside|INPUT|560|bottom|Date|outerHeight|over|tabindex|TEXTAREA|prependTo|for|hspace|isArray|getTime|area|merge|SELECT|blur|nofollow|allowtransparency|scrollTop|scrollLeft|inherit|wmode|transparent|offset|easingChange|find|one|background|color|pointer|not||fadeIn|cellpadding|marginRight|340|setInterval|hideActivity|paddingTop|isFunction|removeClass|cellspacing|main'.split('|'),0,{})) diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/nextgen_fancybox_init.min.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/nextgen_fancybox_init.min.js new file mode 100644 index 0000000000000000000000000000000000000000..829781f59a378e0fb43e9d505b9062b7aa1f51bc --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/nextgen_fancybox_init.min.js @@ -0,0 +1 @@ +eval(function(p,a,c,k,e,d){e=function(c){return c.toString(36)};if(!''.replace(/^/,String)){while(c--){d[c.toString(a)]=k[c]||c.toString(a)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('8(0($){3 1=0(){3 4=7($,$(".a-2"));4.2({5:\'6\',9:0(){$(\'#2-h\').f(\'e-c\',d)}})};$(i).g(\'b\',1);1()});',19,19,'function|nextgen_fancybox_init|fancybox|var|selector|titlePosition|inside|nextgen_lightbox_filter_selector|jQuery|onComplete|ngg|refreshed|index|10000|z|css|bind|wrap|this'.split('|'),0,{})) diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/lightbox_context.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/lightbox_context.js index 6313bf2528da19698c70cbbb274fe263d8129e6c..fea7b5e47f8408e180aabcb6ee6ef7303f715d1e 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/lightbox_context.js +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/lightbox_context.js @@ -21,6 +21,7 @@ function nextgen_lightbox_filter_selector($, selector) } selector = selector.not('.gallery_link'); + selector = selector.not('.use_imagebrowser_effect'); } return selector; diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/lightbox_context.min.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/lightbox_context.min.js new file mode 100644 index 0000000000000000000000000000000000000000..29778522612d97f74ff04335c6532d2aafedbb61 --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/lightbox_context.min.js @@ -0,0 +1 @@ +eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('h l($,0){5(d&&d.2){7 2=d.2;5(2==\'p\'){0=0.b($(\'a > 8\').c())}f 5(2==\'o\'){0=0.b($(\'a[1] > 8\').c().q(h(){7 1=$(n).m(\'1\').k();7 6=1.g(1.i-3);7 9=1.g(1.i-4);j(6==\'y\'||6==\'z\'||6==\'A\'||9==\'r\'||9==\'B\')}))}f 5(2==\'x\'){0=0.b($(\'a > 8[w*="s-t-"]\').c())}0=0.e(\'.u\');0=0.e(\'.v\')}j 0}',38,38,'selector|href|context|||if|ext|var|img|ext2||add|parent|nextgen_lightbox_settings|not|else|substring|function|length|return|toLowerCase|nextgen_lightbox_filter_selector|attr|this|all_images_direct|all_images|filter|tiff|wp|image|gallery_link|use_imagebrowser_effect|class|nextgen_and_wp_images|jpg|gif|png|jpeg'.split('|'),0,{})) diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/shutter/nextgen_shutter.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/shutter/nextgen_shutter.js index 4482972adb966716ca5c6dc40bb3267c5890cd5a..84388f0290d16ceedd16730c96920d4453004be5 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/shutter/nextgen_shutter.js +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/shutter/nextgen_shutter.js @@ -4,8 +4,8 @@ jQuery(function($) { selector.addClass('shutterset'); window.shutterSettings = { imageCount: true, - msgLoading: ngg_lightbox_i18n.msgLoading, - msgClose: ngg_lightbox_i18n.msgClose + msgLoading: nextgen_shutter_i18n.msgLoading, + msgClose: nextgen_shutter_i18n.msgClose }; shutterReloaded.init(); }; diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/shutter/nextgen_shutter.min.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/shutter/nextgen_shutter.min.js new file mode 100644 index 0000000000000000000000000000000000000000..e3d6f9059d9d6188d25b94a1c88ffcbda294a826 --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/shutter/nextgen_shutter.min.js @@ -0,0 +1 @@ +eval(function(p,a,c,k,e,d){e=function(c){return c.toString(36)};if(!''.replace(/^/,String)){while(c--){d[c.toString(a)]=k[c]||c.toString(a)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('c(a($){0 3=a(){0 7=g($,$([]));7.e(\'f\');1.d={b:9,5:4.5,6:4.6};r.o()};$(p).h(\'q\',3);0 2=\'n\';m(i($(1).8(2))==\'j\'){$(1).8(2,9)}k{l}3()});',28,28,'var|window|flag|callback|nextgen_shutter_i18n|msgLoading|msgClose|selector|data|true|function|imageCount|jQuery|shutterSettings|addClass|shutterset|nextgen_lightbox_filter_selector|bind|typeof|undefined|else|return|if|shutter|init|this|refreshed|shutterReloaded'.split('|'),0,{})) diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/shutter/shutter.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/shutter/shutter.js index 6a1b8d1a7a96d0994fbb7e5de3201da37444402a..28580da8362dfc969c69ec1b4d79ce1be964d6a6 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/shutter/shutter.js +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/shutter/shutter.js @@ -52,7 +52,7 @@ shutterReloaded = { shfile = L.href.slice(L.href.lastIndexOf('/')+1); T = ( L.title && L.title != shfile ) ? L.title : ''; - shutterLinks[i] = {link:L.href,num:inset,set:setid,title:T} + shutterLinks[i] = {link:L.href,num:inset,set:setid,title:T}; L.onclick = new Function('shutterReloaded.make("' + i + '");return false;'); } @@ -156,7 +156,7 @@ shutterReloaded = { WB = document.createElement('div'); WB.setAttribute('id','shWaitBar'); WB.style.top = t.Top + 'px'; - WB.style.marginTop =(t.pgHeight/2) + 'px' + WB.style.marginTop =(t.pgHeight/2) + 'px'; WB.innerHTML = t.msgLoading; S.appendChild(WB); }, @@ -196,6 +196,12 @@ shutterReloaded = { t.wHeight = ( (t.wHeight - deH) > 1 && (t.wHeight - deH) < 30 ) ? deH : t.wHeight; } else t.wHeight = ( deH > 0 ) ? deH : dbH; + // check & adjust for Wordpress admin bar + if (document.getElementsByTagName("body")[0].className.match(/admin-bar/) + && document.getElementById('wpadminbar') !== null) { + t.wHeight = t.wHeight - document.getElementById('wpadminbar').offsetHeight; + } + var deW = document.documentElement ? document.documentElement.clientWidth : 0; var dbW = window.innerWidth ? window.innerWidth : document.body.clientWidth; t.wWidth = ( deW > 1 ) ? deW : dbW; @@ -249,6 +255,13 @@ shutterReloaded = { itop = (shHeight - TI.height) * 0.45; mtop = (itop > 3) ? Math.floor(itop) : 3; + + // check & adjust for Wordpress admin bar + if (document.getElementsByTagName("body")[0].className.match(/admin-bar/) + && document.getElementById('wpadminbar') !== null) { + mtop = mtop + document.getElementById('wpadminbar').offsetHeight; + } + D.style.top = t.Top + mtop + 'px'; W.style.visibility = 'visible'; }, @@ -269,7 +282,7 @@ shutterReloaded = { handleArrowKeys : function(e) { var code = 0; - if (!e) var e = window.event + if (!e) var e = window.event; if (e.keyCode) code = e.keyCode; else if (e.which) code = e.which; @@ -289,8 +302,8 @@ shutterReloaded = { break; } } -} -shutterOnload = function(){shutterReloaded.init('sh');} +}; +shutterOnload = function(){shutterReloaded.init('sh');}; if (typeof shutterOnload == 'function') { if ('undefined' != typeof jQuery) jQuery(document).ready(function(){shutterOnload();}); diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/shutter/shutter.min.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/shutter/shutter.min.css new file mode 100644 index 0000000000000000000000000000000000000000..310144a149c814cbcda8c7e5921f46ff53cb5223 --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/shutter/shutter.min.css @@ -0,0 +1 @@ +#shDisplay div#shTitle{font:normal 12px/17px 'Lucida Grande',Verdana,sans-serif;color:#fff;text-align:center;margin:0 auto}#shDisplay div#shCount{color:#999;font:normal 10px/12px 'Lucida Grande',Verdana,sans-serif}#shDisplay div#shTitle a{text-decoration:none;font:bold 16pt 'Courier New',Courier,fixed;letter-spacing:-2px;margin:0 10px;width:26px;color:#999}#shDisplay div#shTitle a:hover{color:#fff;border:0}#shDisplay div#shNext{float:right}#shDisplay div#shPrev{float:left}body{height:100%}#shShutter *,#shDisplay *{padding:0;margin:0}div#shShutter,div#shDisplay{top:0;left:0;width:100%;position:absolute}div#shShutter{height:100%;z-index:10000;background-color:#000;opacity:.8;filter:alpha(opacity=80)}div#shDisplay{display:block;background-color:transparent;z-index:10002}div#shDisplay img#shTopImg{margin:0 auto;border:1px solid #555;background:transparent;display:block;max-width:none;max-height:none;float:none;padding:2px;cursor:pointer}div#shDisplay div#shWrap{visibility:hidden}div#shWaitBar{font:bold 32px 'Lucida Grande','Lucida Sans Unicode',Verdana,sans-serif;height:36px;width:100%;left:0;cursor:default;opacity:.999;filter:alpha(opacity=100);z-index:10001;margin-top:160px;color:#ae0a0a;text-align:center} \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/shutter/shutter.min.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/shutter/shutter.min.js new file mode 100644 index 0000000000000000000000000000000000000000..527ee92a162b7d6300ad1a25a04160db1291059f --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/shutter/shutter.min.js @@ -0,0 +1 @@ +eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('l={I:c(a){q 6.w(a)},2A:c(){7 t=J,s=1J;t.2e=s.2e||0;t.1M=s.1M||\'L O A D I N G\';t.20=s.20||\'3h 3c 33\'},2x:c(a){7 t=J,L,T,11,i,m,z,1F,1O,3j,k,2B;d={},M={};5(\'32\'!=B 1J)1J={};t.2w=B 3b!=\'1a\'?1h:1D;1m(i=0;i<6.2W.R;i++){L=6.2W[i];11=(L.y.12(\'?\')==-1)?L.y.1K(-4).Z():L.y.38(0,L.y.12(\'?\')).1K(-4).Z();5(11!=\'.36\'&&11!=\'.34\'&&11!=\'.35\'&&11!=\'3n\')2l;5(a==\'2t\'&&L.1f.Z().12(\'3k\')==-1)2l;5(a==\'3d\'&&L.1U.Z().12(\'2I\')==-1)2l;5(L.1f.Z().12(\'3m\')!=-1)z=L.1f.2J(/\\s/g,\'2E\');o 5(L.1U.Z().12(\'2I[\')!=-1)z=L.1U.2J(/\\s/g,\'2E\');o z=0,1F=-1;5(z){5(!M[z])M[z]=[];1F=M[z].3a(i)}1O=L.y.1K(L.y.3f(\'/\')+1);T=(L.13&&L.13!=1O)?L.13:\'\';d[i]={1i:L.y,F:1F,1j:z,13:T};L.X=17 1q(\'l.1k("\'+i+\'");q 1D;\')}t.2A()},1k:c(b,2k){7 t=J,1E,1s,U=\'\',V=\'\',2a,24,D,S,W,3l=-1,1W,1V;5(!t.n){5(B 8.2r!=\'1a\')t.n=8.2r;o t.n=(6.v.1z>0)?6.v.1z:6.x.1z}5(8.1x){7 14=8.1x;5(B(14.1y)!=\'1a\'){7 1A=14.1y(8.2F);t.n=t.n+1A.1z}}5(B t.1d==\'1a\')t.1d=2R.3i(6.v.26,6.x.26);5(2k)t.1c=(2k>0)?1:0;o t.1c=1J.1c||0;5(t.1l)t.1l=Q;5(t.2w==1h)8.3g=17 1q(\'l.2g("\'+b+\'");\');o 8.2q=17 1q(\'l.2g("\'+b+\'");\');6.v.9.2f=\'2n\';5(!t.1v){t.2X();t.1v=1h}5(!(S=t.I(\'19\'))){S=6.1Q(\'j\');S.21(\'p\',\'19\');6.K(\'x\')[0].1S(S);t.1X()}5(!(D=t.I(\'1C\'))){D=6.1Q(\'j\');D.21(\'p\',\'1C\');D.9.28=t.n+\'C\';6.K(\'x\')[0].1S(D)}S.9.E=t.1d+\'C\';7 29=t.3x?\' | \':\'\';5(d[b].F>1){1E=M[d[b].1j][d[b].F-2];U=\'<a y="#" p="2H" X="l.1k(\'+1E+\');q 1D">&2v;&2v;</a>\'+29;2a=17 2s();2a.1r=d[1E].1i}o{U=\'\'}5(d[b].F!=-1&&d[b].F<(M[d[b].1j].R)){1s=M[d[b].1j][d[b].F];V=\'<a y="#" p="2K" X="l.1k(\'+1s+\');q 1D">&2u;&2u;</a>\'+29;24=17 2s();24.1r=d[1s].1i}o{V=\'\'}1W=((d[b].F>0)&&t.2e)?\'<j p="3B">&Y;(&Y;\'+d[b].F+\'&Y;/&Y;\'+M[d[b].1j].R+\'&Y;)&Y;</j>\':\'\';1V=\'<j p="2S"><j p="3A">\'+U+\'</j><j p="3D">\'+V+\'</j><j p="3C">\'+d[b].13+\'</j>\'+1W+\'</j>\';D.2p=\'<j p="1t"><2B 1r="\'+d[b].1i+\'" p="1B" 13="\'+t.20+\'" 1b="l.31();" X="l.2o();" />\'+1V+\'</j>\';6.2C=c(2i){l.2M(2i)};6.w(\'1B\').1r=d[b].1i;8.2c(c(){l.2z()},3E)},2z:c(){7 t=J,S,r,W;5((W=t.I(\'1t\'))&&W.9.H==\'1I\')q;5(!(S=t.I(\'19\')))q;5(t.I(\'1T\'))q;r=6.1Q(\'j\');r.21(\'p\',\'1T\');r.9.28=t.n+\'C\';r.9.3y=(t.1d/2)+\'C\';r.2p=t.1M;S.1S(r)},2o:c(){7 t=J,D,S;5(D=t.I(\'1C\'))D.1N.1L(D);5(S=t.I(\'19\'))S.1N.1L(S);t.1X(1h);8.25(0,t.n);8.2q=t.1c=t.n=t.1v=Q;6.v.9.2f=\'\';6.2C=Q},2g:c(b){7 t=J;5(t.1l)q;5(!t.I(\'19\'))q;7 W=t.I(\'1t\');5(W)W.9.H=\'2n\';8.2c(c(){l.1l=Q},3o);8.2c(17 1q(\'l.1v = Q;l.1k("\'+b+\'");\'),3z);t.1l=1h},2X:c(){7 t=J;7 1n=8.2U?8.2U:0;7 1g=6.x.1P?6.x.1P:0;7 15=6.v?6.v.1P:0;5(1n>0){t.u=((1n-1g)>1&&(1n-1g)<30)?1g:1n;t.u=((t.u-15)>1&&(t.u-15)<30)?15:t.u}o t.u=(15>0)?15:1g;5(6.K("x")[0].1f.2Q(/2P-2N/)&&6.w(\'1G\')!==Q){t.u=t.u-6.w(\'1G\').2O}7 1Y=6.v?6.v.2Y:0;7 2Z=8.2V?8.2V:6.x.2Y;t.18=(1Y>1)?1Y:2Z},31:c(){7 t=J,S=t.I(\'19\'),D=t.I(\'1C\'),f=t.I(\'1B\'),T=t.I(\'2S\'),3t=t.I(\'3u\'),W,r,u,18,P,1u,1H,1p,2m=0;5(!S)q;5((W=t.I(\'1t\'))&&W.9.H==\'1I\')q;5(r=t.I(\'1T\'))r.1N.1L(r);S.9.h=D.9.h=\'\';T.9.h=(f.h-4)+\'C\';P=t.u-2G;5(8.1x){7 14=8.1x;5(B(14.1y)!=\'1a\'){7 1A=14.1y(8.2F);P=1A.26-2G}}5(t.1c){5(f.h>(t.18-10))S.9.h=D.9.h=f.h+10+\'C\';6.v.9.2f=\'\'}o{8.25(0,t.n);5(f.E>P){f.h=f.h*(P/f.E);f.E=P;2m=1}5(f.h>(t.18-16)){f.E=f.E*((t.18-16)/f.h);f.h=t.18-16;2m=1}T.9.h=(f.h-4)+\'C\'}1u=t.n+f.E+10;5(1u>t.1d)S.9.E=1u+\'C\';8.25(0,t.n);1H=(P-f.E)*0.3v;1p=(1H>3)?2R.3w(1H):3;5(6.K("x")[0].1f.2Q(/2P-2N/)&&6.w(\'1G\')!==Q){1p=1p+6.w(\'1G\').2O}D.9.28=t.n+1p+\'C\';W.9.H=\'1I\'},1X:c(2y){7 22=6.K(\'3q\');7 2j=6.K(\'32\');7 23=6.K(\'3r\');7 2b=6.K(\'3s\');7 1e=(2y)?\'1I\':\'2n\';1m(i=0;i<22.R;i++)22[i].9.H=1e;1m(i=0;i<2j.R;i++)2j[i].9.H=1e;1m(i=0;i<23.R;i++)23[i].9.H=1e;1m(i=0;i<2b.R;i++)2b[i].9.H=1e},2M:c(e){7 1w=0;5(!e)7 e=8.2i;5(e.2L)1w=e.2L;o 5(e.2T)1w=e.2T;7 V=6.w(\'2H\');7 U=6.w(\'2K\');7 1Z=6.w(\'1B\');3p(1w){1R 39:5(U)U.X();2h;1R 37:5(V)V.X();2h;1R 27:5(1Z)1Z.X();2h}}};1o=c(){l.2x(\'2t\')};5(B 1o==\'c\'){5(\'1a\'!=B 2D)2D(6).3e(c(){1o()});o 5(B 8.1b!=\'c\')8.1b=1o;o{2d=8.1b;8.1b=c(){5(2d){2d()};1o()}}}',62,227,'|||||if|document|var|window|style||ln|function|shutterLinks||TI||width||div||shutterReloaded||Top|else|id|return|WB|||wHeight|documentElement|getElementById|body|href|setid||typeof|px||height|num||visibility||this|getElementsByTagName||shutterSets|||shHeight|null|length|||prevlink|nextlink||onclick|nbsp|toLowerCase||ext|indexOf|title|container|deH||new|wWidth|shShutter|undefined|onload|FS|pgHeight|vis|className|dbH|true|link|set|make|resizing|for|wiH|shutterOnload|mtop|Function|src|next|shWrap|maxHeight|VP|code|parent|ngg_get_measures_for_frame|scrollTop|measures|shTopImg|shDisplay|false|prev|inset|wpadminbar|itop|visible|shutterSettings|slice|removeChild|msgLoading|parentNode|shfile|clientHeight|createElement|case|appendChild|shWaitBar|rel|NavBar|imgNum|hideTags|deW|closelink|msgClose|setAttribute|sel|emb|nextimg|scrollTo|scrollHeight||top|dv|previmg|ifr|setTimeout|oldonld|imageCount|overflowX|resize|break|event|obj|fs|continue|resized|hidden|hideShutter|innerHTML|onresize|pageYOffset|Image|sh|gt|lt|mobileOS|init|arg|loading|settings|img|onkeydown|jQuery|_|frameElement|50|prevpic|lightbox|replace|nextpic|keyCode|handleArrowKeys|bar|offsetHeight|admin|match|Math|shTitle|which|innerHeight|innerWidth|links|_viewPort|clientWidth|dbW||showImg|object|Close|png|gif|jpg||substring||push|orientation|to|lb|ready|lastIndexOf|onorientationchange|Click|max|shMenuPre|shutter|fsarg|shutterset|jpeg|500|switch|select|embed|iframe|NB|shNavBar|45|floor|textBtns|marginTop|100|shPrev|shCount|shName|shNext|1000'.split('|'),0,{})) diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/shutter_reloaded/nextgen_shutter_reloaded.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/shutter_reloaded/nextgen_shutter_reloaded.js index 4cc4b008efcaffd799d3d1911bd1d4b5dbb36c97..715c9dd9fbc5e59e7b78e1ffb15ba99dd16e7876 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/shutter_reloaded/nextgen_shutter_reloaded.js +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/shutter_reloaded/nextgen_shutter_reloaded.js @@ -2,17 +2,17 @@ jQuery(function($){ var callback = function(){ var selector = nextgen_lightbox_filter_selector($, $([])); selector.addClass('shutterset'); - if (typeof ngg_lightbox_i18n != 'undefined') { - shutterReloaded.L10n = ngg_lightbox_i18n; + if (typeof nextgen_shutter2_i18n != 'undefined') { + shutterReloaded.L10n = nextgen_shutter2_i18n; } shutterReloaded.Init(); - }; - $(this).bind('refreshed', callback); + }; + $(this).bind('refreshed', callback); - var flag = 'shutterReloaded'; - if (typeof($(window).data(flag)) == 'undefined') - $(window).data(flag, true); - else return; + var flag = 'shutterReloaded'; + if (typeof($(window).data(flag)) == 'undefined') + $(window).data(flag, true); + else return; - callback(); + callback(); }); diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/shutter_reloaded/nextgen_shutter_reloaded.min.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/shutter_reloaded/nextgen_shutter_reloaded.min.js new file mode 100644 index 0000000000000000000000000000000000000000..0439a22da90101cb2d890850d050974885564083 --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/shutter_reloaded/nextgen_shutter_reloaded.min.js @@ -0,0 +1 @@ +eval(function(p,a,c,k,e,d){e=function(c){return c.toString(36)};if(!''.replace(/^/,String)){while(c--){d[c.toString(a)]=k[c]||c.toString(a)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('e(5($){3 1=5(){3 6=g($,$([]));6.d(\'c\');7(8 4!=\'b\'){0.f=4}0.n()};$(m).h(\'k\',1);3 2=\'0\';7(8($(a).9(2))==\'b\')$(a).9(2,l);j i;1()});',24,24,'shutterReloaded|callback|flag|var|nextgen_shutter2_i18n|function|selector|if|typeof|data|window|undefined|shutterset|addClass|jQuery|L10n|nextgen_lightbox_filter_selector|bind|return|else|refreshed|true|this|Init'.split('|'),0,{})) diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/shutter_reloaded/shutter.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/shutter_reloaded/shutter.js index 4eb46910414701d49c3b4660b008a04b981083cb..00d0cb53f71b227c13e61a6be87add763daebb17 100755 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/shutter_reloaded/shutter.js +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/shutter_reloaded/shutter.js @@ -1,287 +1,283 @@ /* -Shutter Reloaded -http://www.laptoptips.ca/javascripts/shutter-reloaded/ -Version: 2.0.1 + Shutter Reloaded + http://www.laptoptips.ca/javascripts/shutter-reloaded/ + Version: 2.0.1 -Acknowledgement: some ideas are from: Shutter by Andrew Sutherland - http://code.jalenack.com, WordPress - http://wordpress.org, Lightbox by Lokesh Dhakar - http://www.huddletogether.com, the icons are from Crystal Project Icons, Everaldo Coelho, http://www.everaldo.com + Acknowledgement: some ideas are from: Shutter by Andrew Sutherland - http://code.jalenack.com, WordPress - http://wordpress.org, Lightbox by Lokesh Dhakar - http://www.huddletogether.com, the icons are from Crystal Project Icons, Everaldo Coelho, http://www.everaldo.com -Released under the GPL, http://www.gnu.org/copyleft/gpl.html + Released under the GPL, http://www.gnu.org/copyleft/gpl.html - Copyright (C) 2007 Andrew Ozz + Copyright (C) 2007 Andrew Ozz - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. -*/ + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + */ // Compute path to images var imagePath = nextgen_lightbox_settings.static_path + '/shutter_reloaded/images/'; -if (typeof(window.console) != 'undefined') { - console.log(imagePath); -} - shutterReloaded = { // *************************************************************************** // edit below to change the text buttons/titles for the menu (use html entities for non-ascii characters) - L10n : ['Previous','Next','Close','Full Size','Fit to Screen','Image','of','Loading...'], + L10n : ['Previous','Next','Close','Full Size','Fit to Screen','Image','of','Loading...'], // change to "true/false" to enable/disable showing the number of images in a set. - imageCount : true, + imageCount : true, // change to true/false to enable/disable text buttons instead of images - textBtns : false, + textBtns : false, // change the path to Shutter's image buttons directory if needed - shImgDir : imagePath, + shImgDir : imagePath, // *************************************************************************** - I : function (a) { - return document.getElementById(a); - }, - - Init : function (a) { - var L, T, ext, i, setid, inset, shfile, shMenuPre, k, img; - for ( i = 0; i < document.links.length; i++ ) { - L = document.links[i]; - ext = ( L.href.indexOf('?') == -1 ) ? L.href.slice(-4).toLowerCase() : L.href.substring( 0, L.href.indexOf('?') ).slice(-4).toLowerCase(); - if ( ext != '.jpg' && ext != '.png' && ext != '.gif' && ext != 'jpeg' ) continue; - if ( a == 'sh' && L.className.toLowerCase().indexOf('shutter') == -1 ) continue; - if ( a == 'lb' && L.rel.toLowerCase().indexOf('lightbox') == -1 ) continue; - - if ( L.className.toLowerCase().indexOf('shutterset') != -1 ) - setid = ( L.className.indexOf(' ') != -1 ) ? L.className.slice(0,L.className.indexOf(' ')) : L.className; - else if ( L.rel.toLowerCase().indexOf('lightbox[') != -1 ) - setid = L.rel; - else setid = 0, inset = -1; - - if( setid ) { - if ( ! shutterSets[setid] ) shutterSets[setid] = []; - inset = shutterSets[setid].push(i); - } - - shfile = L.href.slice(L.href.lastIndexOf('/')+1); - T = ( L.title && L.title != shfile ) ? L.title : ''; - - shutterLinks[i] = {link:L.href,num:inset,set:setid,title:T} - L.onclick = new Function('shutterReloaded.Make("'+i+'");return false;'); - } - - if ( ! this.textBtns ) { - shMenuPre = ['close.gif','prev.gif','next.gif','resize1.gif','resize2.gif','loading.gif']; - for ( k = 0; k < shMenuPre.length; k++ ) { - img = new Image(); - img.src = this.shImgDir+shMenuPre[k]; - } - } - }, - - Make : function(ln,fs) { - var prev, next, prevlink = '', nextlink = '', previmg, nextimg, prevbtn, nextbtn, D, S, W, NB, fsarg = '', imgNum, closebtn, fsbtn, fsLink; - - if ( ! this.Top ) { - if ( typeof window.pageYOffset != 'undefined' ) this.Top = window.pageYOffset; - else this.Top = (document.documentElement.scrollTop > 0) ? document.documentElement.scrollTop : document.body.scrollTop; - } - - if ( typeof this.pgHeight == 'undefined' ) - this.pgHeight = Math.max(document.documentElement.scrollHeight,document.body.scrollHeight); - - if ( fs ) this.FS = true; - else this.FS = null; - - if ( this.resizing ) this.resizing = null; - window.onresize = new Function('shutterReloaded.Resize("'+ln+'");'); - - document.documentElement.style.overflowX = 'hidden'; - if ( ! this.VP ) { - this._viewPort(); - this.VP = true; - } - - if ( ! (S = this.I('shShutter')) ) { - S = document.createElement('div'); - S.setAttribute('id','shShutter'); - document.getElementsByTagName('body')[0].appendChild(S); - this.fixTags(); - } - - if ( ! (D = this.I('shDisplay')) ) { - D = document.createElement('div'); - D.setAttribute('id','shDisplay'); - D.style.top = this.Top + 'px'; - document.getElementsByTagName('body')[0].appendChild(D); - } - - S.style.height = this.pgHeight + 'px'; - - var dv = this.textBtns ? ' | ' : ''; - if ( shutterLinks[ln].num > 1 ) { - prev = shutterSets[shutterLinks[ln].set][shutterLinks[ln].num - 2]; - prevbtn = this.textBtns ? this.L10n[0] : '<img src="'+this.shImgDir+'prev.gif" title="'+this.L10n[0]+'" />'; - prevlink = '<a href="#" onclick="shutterReloaded.Make('+prev+');return false">'+prevbtn+'</a>'+dv; - previmg = new Image(); - previmg.src = shutterLinks[prev].link; - } - - if ( shutterLinks[ln].num != -1 && shutterLinks[ln].num < (shutterSets[shutterLinks[ln].set].length) ) { - next = shutterSets[shutterLinks[ln].set][shutterLinks[ln].num]; - nextbtn = this.textBtns ? this.L10n[1] : '<img src="'+this.shImgDir+'next.gif" title="'+this.L10n[1]+'" />'; - nextlink = '<a href="#" onclick="shutterReloaded.Make('+next+');return false">'+nextbtn+'</a>'+dv; - nextimg = new Image(); - nextimg.src = shutterLinks[next].link; - } - - closebtn = this.textBtns ? this.L10n[2] : '<img src="'+this.shImgDir+'close.gif" title="'+this.L10n[2]+'" />'; - - imgNum = ( (shutterLinks[ln].num > 0) && this.imageCount ) ? ' '+this.L10n[5]+' '+shutterLinks[ln].num+' '+this.L10n[6]+' '+shutterSets[shutterLinks[ln].set].length : ''; - if ( imgNum && this.textBtns ) imgNum += ' |'; - - if ( this.FS ) { - fsbtn = this.textBtns ? this.L10n[4] : '<img src="'+this.shImgDir+'resize2.gif" title="'+this.L10n[4]+'" />'; - } else { - fsbtn = this.textBtns ? this.L10n[3] : '<img src="'+this.shImgDir+'resize1.gif" title="'+this.L10n[3]+'" />'; - fsarg = ',1'; - } - - fsLink = '<span id="fullSize"><a href="#" onclick="shutterReloaded.Make('+ln+fsarg+');return false">'+fsbtn+'</a>'+dv+'</span>'; - - if ( ! (NB = this.I('shNavBar')) ) { - NB = document.createElement('div'); - NB.setAttribute('id','shNavBar'); - document.getElementsByTagName('body')[0].appendChild(NB); - } - - NB.innerHTML = dv+prevlink+'<a href="#" onclick="shutterReloaded.hideShutter();return false">'+closebtn+'</a>'+dv+fsLink+nextlink+imgNum; - - D.innerHTML = '<div id="shWrap"><img src="'+shutterLinks[ln].link+'" id="shTopImg" onload="shutterReloaded.ShowImg();" onclick="shutterReloaded.hideShutter();" /><div id="shTitle">'+shutterLinks[ln].title+'</div></div>'; - - window.setTimeout(function(){shutterReloaded.loading();},2000); - }, - - loading : function() { - var S, WB, W; - if ( (W = this.I('shWrap')) && W.style.visibility == 'visible' ) return; - if ( ! (S = this.I('shShutter')) ) return; - if ( this.I('shWaitBar') ) return; - WB = document.createElement('div'); - WB.setAttribute('id','shWaitBar'); - WB.style.top = this.Top + 'px'; - WB.innerHTML = '<img src="'+this.shImgDir+'loading.gif" title="'+this.L10n[7]+'" />'; - S.appendChild(WB); - }, - - hideShutter : function() { - var D, S, NB; - if ( D = this.I('shDisplay') ) D.parentNode.removeChild(D); - if ( S = this.I('shShutter') ) S.parentNode.removeChild(S); - if ( NB = this.I('shNavBar') ) NB.parentNode.removeChild(NB); - this.fixTags(true); - window.scrollTo(0,this.Top); - window.onresize = this.FS = this.Top = this.VP = null; - document.documentElement.style.overflowX = ''; - }, - - Resize : function(ln) { - if ( this.resizing ) return; - if ( ! this.I('shShutter') ) return; - var W = this.I('shWrap'); - if ( W ) W.style.visibility = 'hidden'; - - window.setTimeout(function(){shutterReloaded.resizing = null},500); - window.setTimeout(new Function('shutterReloaded.VP = null;shutterReloaded.Make("'+ln+'");'),100); - this.resizing = true; - }, - - _viewPort : function() { - var wiH = window.innerHeight ? window.innerHeight : 0; - var dbH = document.body.clientHeight ? document.body.clientHeight : 0; - var deH = document.documentElement ? document.documentElement.clientHeight : 0; - - if( wiH > 0 ) { - this.wHeight = ( (wiH - dbH) > 1 && (wiH - dbH) < 30 ) ? dbH : wiH; - this.wHeight = ( (this.wHeight - deH) > 1 && (this.wHeight - deH) < 30 ) ? deH : this.wHeight; - } else this.wHeight = ( deH > 0 ) ? deH : dbH; - - var deW = document.documentElement ? document.documentElement.clientWidth : 0; - var dbW = window.innerWidth ? window.innerWidth : document.body.clientWidth; - this.wWidth = ( deW > 1 ) ? deW : dbW; - }, - - ShowImg : function() { - var S, W, WB, D, T, TI, NB, wHeight, wWidth, capH, shHeight, maxHeight, itop, mtop, resized = 0; - if ( ! (S = this.I('shShutter')) ) return; - if ( (W = this.I('shWrap')) && W.style.visibility == 'visible' ) return; - if ( WB = this.I('shWaitBar') ) WB.parentNode.removeChild(WB); - - D = this.I('shDisplay'); - TI = this.I('shTopImg'); - T = this.I('shTitle'); - NB = this.I('shNavBar'); - S.style.width = D.style.width = ''; - T.style.width = (TI.width - 4) + 'px'; - - capH = NB.offsetHeight ? T.offsetHeight + NB.offsetHeight : 30; - shHeight = this.wHeight - 7 - capH; - - if ( this.FS ) { - if ( TI.width > (this.wWidth - 10) ) - S.style.width = D.style.width = TI.width + 10 + 'px'; + I : function (a) { + return document.getElementById(a); + }, + + Init : function (a) { + var L, T, ext, i, setid, inset, shfile, shMenuPre, k, img; + for ( i = 0; i < document.links.length; i++ ) { + L = document.links[i]; + ext = ( L.href.indexOf('?') == -1 ) ? L.href.slice(-4).toLowerCase() : L.href.substring( 0, L.href.indexOf('?') ).slice(-4).toLowerCase(); + if ( ext != '.jpg' && ext != '.png' && ext != '.gif' && ext != 'jpeg' ) continue; + if ( a == 'sh' && L.className.toLowerCase().indexOf('shutter') == -1 ) continue; + if ( a == 'lb' && L.rel.toLowerCase().indexOf('lightbox') == -1 ) continue; + + if ( L.className.toLowerCase().indexOf('shutterset') != -1 ) + setid = ( L.className.indexOf(' ') != -1 ) ? L.className.slice(0,L.className.indexOf(' ')) : L.className; + else if ( L.rel.toLowerCase().indexOf('lightbox[') != -1 ) + setid = L.rel; + else setid = 0, inset = -1; + + if( setid ) { + if ( ! shutterSets[setid] ) shutterSets[setid] = []; + inset = shutterSets[setid].push(i); + } + + shfile = L.href.slice(L.href.lastIndexOf('/')+1); + T = ( L.title && L.title != shfile ) ? L.title : ''; + + shutterLinks[i] = {link:L.href,num:inset,set:setid,title:T}; + L.onclick = new Function('shutterReloaded.Make("'+i+'");return false;'); + } + + if ( ! this.textBtns ) { + shMenuPre = ['close.gif','prev.gif','next.gif','resize1.gif','resize2.gif','loading.gif']; + for ( k = 0; k < shMenuPre.length; k++ ) { + img = new Image(); + img.src = this.shImgDir+shMenuPre[k]; + } + } + }, + + Make : function(ln,fs) { + var prev, next, prevlink = '', nextlink = '', previmg, nextimg, prevbtn, nextbtn, D, S, W, NB, fsarg = '', imgNum, closebtn, fsbtn, fsLink; + + if ( ! this.Top ) { + if ( typeof window.pageYOffset != 'undefined' ) this.Top = window.pageYOffset; + else this.Top = (document.documentElement.scrollTop > 0) ? document.documentElement.scrollTop : document.body.scrollTop; + } + + if ( typeof this.pgHeight == 'undefined' ) + this.pgHeight = Math.max(document.documentElement.scrollHeight,document.body.scrollHeight); + + if ( fs ) this.FS = true; + else this.FS = null; + + if ( this.resizing ) this.resizing = null; + window.onresize = new Function('shutterReloaded.Resize("'+ln+'");'); + + document.documentElement.style.overflowX = 'hidden'; + if ( ! this.VP ) { + this._viewPort(); + this.VP = true; + } + + if ( ! (S = this.I('shShutter')) ) { + S = document.createElement('div'); + S.setAttribute('id','shShutter'); + document.getElementsByTagName('body')[0].appendChild(S); + this.fixTags(); + } + + if ( ! (D = this.I('shDisplay')) ) { + D = document.createElement('div'); + D.setAttribute('id','shDisplay'); + D.style.top = this.Top + 'px'; + document.getElementsByTagName('body')[0].appendChild(D); + } + + S.style.height = this.pgHeight + 'px'; + + var dv = this.textBtns ? ' | ' : ''; + if ( shutterLinks[ln].num > 1 ) { + prev = shutterSets[shutterLinks[ln].set][shutterLinks[ln].num - 2]; + prevbtn = this.textBtns ? this.L10n[0] : '<img src="'+this.shImgDir+'prev.gif" title="'+this.L10n[0]+'" />'; + prevlink = '<a href="#" onclick="shutterReloaded.Make('+prev+');return false">'+prevbtn+'</a>'+dv; + previmg = new Image(); + previmg.src = shutterLinks[prev].link; + } + + if ( shutterLinks[ln].num != -1 && shutterLinks[ln].num < (shutterSets[shutterLinks[ln].set].length) ) { + next = shutterSets[shutterLinks[ln].set][shutterLinks[ln].num]; + nextbtn = this.textBtns ? this.L10n[1] : '<img src="'+this.shImgDir+'next.gif" title="'+this.L10n[1]+'" />'; + nextlink = '<a href="#" onclick="shutterReloaded.Make('+next+');return false">'+nextbtn+'</a>'+dv; + nextimg = new Image(); + nextimg.src = shutterLinks[next].link; + } + + closebtn = this.textBtns ? this.L10n[2] : '<img src="'+this.shImgDir+'close.gif" title="'+this.L10n[2]+'" />'; + + imgNum = ( (shutterLinks[ln].num > 0) && this.imageCount ) ? ' '+this.L10n[5]+' '+shutterLinks[ln].num+' '+this.L10n[6]+' '+shutterSets[shutterLinks[ln].set].length : ''; + if ( imgNum && this.textBtns ) imgNum += ' |'; + + if ( this.FS ) { + fsbtn = this.textBtns ? this.L10n[4] : '<img src="'+this.shImgDir+'resize2.gif" title="'+this.L10n[4]+'" />'; + } else { + fsbtn = this.textBtns ? this.L10n[3] : '<img src="'+this.shImgDir+'resize1.gif" title="'+this.L10n[3]+'" />'; + fsarg = ',1'; + } + + fsLink = '<span id="fullSize"><a href="#" onclick="shutterReloaded.Make('+ln+fsarg+');return false">'+fsbtn+'</a>'+dv+'</span>'; + + if ( ! (NB = this.I('shNavBar')) ) { + NB = document.createElement('div'); + NB.setAttribute('id','shNavBar'); + document.getElementsByTagName('body')[0].appendChild(NB); + } + + NB.innerHTML = dv+prevlink+'<a href="#" onclick="shutterReloaded.hideShutter();return false">'+closebtn+'</a>'+dv+fsLink+nextlink+imgNum; + + D.innerHTML = '<div id="shWrap"><img src="'+shutterLinks[ln].link+'" id="shTopImg" onload="shutterReloaded.ShowImg();" onclick="shutterReloaded.hideShutter();" /><div id="shTitle">'+shutterLinks[ln].title+'</div></div>'; + + window.setTimeout(function(){shutterReloaded.loading();},2000); + }, + + loading : function() { + var S, WB, W; + if ( (W = this.I('shWrap')) && W.style.visibility == 'visible' ) return; + if ( ! (S = this.I('shShutter')) ) return; + if ( this.I('shWaitBar') ) return; + WB = document.createElement('div'); + WB.setAttribute('id','shWaitBar'); + WB.style.top = this.Top + 'px'; + WB.innerHTML = '<img src="'+this.shImgDir+'loading.gif" title="'+this.L10n[7]+'" />'; + S.appendChild(WB); + }, + + hideShutter : function() { + var D, S, NB; + if ( D = this.I('shDisplay') ) D.parentNode.removeChild(D); + if ( S = this.I('shShutter') ) S.parentNode.removeChild(S); + if ( NB = this.I('shNavBar') ) NB.parentNode.removeChild(NB); + this.fixTags(true); + window.scrollTo(0,this.Top); + window.onresize = this.FS = this.Top = this.VP = null; document.documentElement.style.overflowX = ''; - } else { - window.scrollTo(0,this.Top); - if ( TI.height > shHeight ) { - TI.width = TI.width * (shHeight / TI.height); - TI.height = shHeight; - resized = 1; - } - if ( TI.width > (this.wWidth - 16) ) { - TI.height = TI.height * ((this.wWidth - 16) / TI.width); - TI.width = this.wWidth - 16; - resized = 1; - } - T.style.width = (TI.width - 4) + 'px'; - NB.style.bottom = '0px'; + }, + + Resize : function(ln) { + if ( this.resizing ) return; + if ( ! this.I('shShutter') ) return; + var W = this.I('shWrap'); + if ( W ) W.style.visibility = 'hidden'; + + window.setTimeout(function(){shutterReloaded.resizing = null},500); + window.setTimeout(new Function('shutterReloaded.VP = null;shutterReloaded.Make("'+ln+'");'),100); + this.resizing = true; + }, + + _viewPort : function() { + var wiH = window.innerHeight ? window.innerHeight : 0; + var dbH = document.body.clientHeight ? document.body.clientHeight : 0; + var deH = document.documentElement ? document.documentElement.clientHeight : 0; + + if( wiH > 0 ) { + this.wHeight = ( (wiH - dbH) > 1 && (wiH - dbH) < 30 ) ? dbH : wiH; + this.wHeight = ( (this.wHeight - deH) > 1 && (this.wHeight - deH) < 30 ) ? deH : this.wHeight; + } else this.wHeight = ( deH > 0 ) ? deH : dbH; + + var deW = document.documentElement ? document.documentElement.clientWidth : 0; + var dbW = window.innerWidth ? window.innerWidth : document.body.clientWidth; + this.wWidth = ( deW > 1 ) ? deW : dbW; + }, + + ShowImg : function() { + var S, W, WB, D, T, TI, NB, wHeight, wWidth, capH, shHeight, maxHeight, itop, mtop, resized = 0; + if ( ! (S = this.I('shShutter')) ) return; + if ( (W = this.I('shWrap')) && W.style.visibility == 'visible' ) return; + if ( WB = this.I('shWaitBar') ) WB.parentNode.removeChild(WB); + + D = this.I('shDisplay'); + TI = this.I('shTopImg'); + T = this.I('shTitle'); + NB = this.I('shNavBar'); + S.style.width = D.style.width = ''; + T.style.width = (TI.width - 4) + 'px'; + + capH = NB.offsetHeight ? T.offsetHeight + NB.offsetHeight : 30; + shHeight = this.wHeight - 7 - capH; + + if ( this.FS ) { + if ( TI.width > (this.wWidth - 10) ) + S.style.width = D.style.width = TI.width + 10 + 'px'; + document.documentElement.style.overflowX = ''; + } else { + window.scrollTo(0,this.Top); + if ( TI.height > shHeight ) { + TI.width = TI.width * (shHeight / TI.height); + TI.height = shHeight; + resized = 1; + } + if ( TI.width > (this.wWidth - 16) ) { + TI.height = TI.height * ((this.wWidth - 16) / TI.width); + TI.width = this.wWidth - 16; + resized = 1; + } + T.style.width = (TI.width - 4) + 'px'; + NB.style.bottom = '0px'; + } + + maxHeight = this.Top + TI.height + capH + 10; + if ( maxHeight > this.pgHeight ) S.style.height = maxHeight + 'px'; + window.scrollTo(0,this.Top); + if ( (this.FS && (TI.height > shHeight || TI.width > this.wWidth)) || resized ) this.I('fullSize').style.display = 'inline'; + + itop = (shHeight - TI.height) * 0.45; + mtop = (itop > 3) ? Math.floor(itop) : 3; + D.style.top = this.Top + mtop + 'px'; + NB.style.bottom = '0'; + W.style.visibility = 'visible'; + }, + + fixTags : function(arg) { + var sel = document.getElementsByTagName('select'); + var obj = document.getElementsByTagName('object'); + var emb = document.getElementsByTagName('embed'); + + if ( arg ) var vis = 'visible'; + else var vis = 'hidden'; + + for (i = 0; i < sel.length; i++) sel[i].style.visibility = vis; + for (i = 0; i < obj.length; i++) obj[i].style.visibility = vis; + for (i = 0; i < emb.length; i++) emb[i].style.visibility = vis; } - - maxHeight = this.Top + TI.height + capH + 10; - if ( maxHeight > this.pgHeight ) S.style.height = maxHeight + 'px'; - window.scrollTo(0,this.Top); - if ( (this.FS && (TI.height > shHeight || TI.width > this.wWidth)) || resized ) this.I('fullSize').style.display = 'inline'; - - itop = (shHeight - TI.height) * 0.45; - mtop = (itop > 3) ? Math.floor(itop) : 3; - D.style.top = this.Top + mtop + 'px'; - NB.style.bottom = '0'; - W.style.visibility = 'visible'; - }, - - fixTags : function(arg) { - var sel = document.getElementsByTagName('select'); - var obj = document.getElementsByTagName('object'); - var emb = document.getElementsByTagName('embed'); - - if ( arg ) var vis = 'visible'; - else var vis = 'hidden'; - - for (i = 0; i < sel.length; i++) sel[i].style.visibility = vis; - for (i = 0; i < obj.length; i++) obj[i].style.visibility = vis; - for (i = 0; i < emb.length; i++) emb[i].style.visibility = vis; - } -} +}; var shutterLinks = {}, shutterSets = {}; if (typeof shutterOnload == 'function') { - oldonload = window.onload; - if( typeof window.onload != 'function' ) window.onload = shutterOnload; - else window.onload = function(){shutterOnload();if(oldonload){oldonload();}}; + oldonload = window.onload; + if( typeof window.onload != 'function' ) window.onload = shutterOnload; + else window.onload = function(){shutterOnload();if(oldonload){oldonload();}}; } diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/shutter_reloaded/shutter.min.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/shutter_reloaded/shutter.min.css new file mode 100644 index 0000000000000000000000000000000000000000..65afd82881a3c77bc9811bdeb62b3e3124086fa3 --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/shutter_reloaded/shutter.min.css @@ -0,0 +1 @@ +#shNavBar a{color:#aaf;text-decoration:none}#shNavBar a:hover{color:#fff}#shDisplay div#shTitle{font:normal 12px/17px 'Lucida Grande',Verdana,sans-serif;color:#fff;text-align:center;margin:0 auto}div#shNavBar{font:normal 12px/12px 'Lucida Grande',Verdana,sans-serif;color:#999;position:fixed;left:0;bottom:0;background-color:#2e2e2e;width:100%;padding:4px 0 5px;text-align:center;cursor:pointer;z-index:10011}body{height:100%}#shShutter *,#shDisplay *{padding:0;margin:0}div#shShutter,div#shDisplay{top:0;left:0;width:100%;position:absolute}div#shShutter{height:100%;z-index:10000;background-color:#000;opacity:.8;filter:alpha(opacity=80)}div#shDisplay{display:block;background-color:transparent;z-index:10002}div#shDisplay img#shTopImg{margin:0 auto;border:1px solid #555;background:transparent;display:block;max-width:none;max-height:none}div#shDisplay div#shWrap{visibility:hidden}div#shWaitBar{position:absolute;width:100px;left:50%;margin-left:-50px;margin-top:120px}#shWaitBar img{border:0}#fullSize{display:none}#shNavBar img{border:0;vertical-align:middle;margin:0 2px;opacity:.6;filter:alpha(opacity=60)}#shNavBar img:hover{opacity:.999;filter:alpha(opacity=100)}* html div#shNavBar{_position:absolute;_top:expression(eval(document.compatMode && document.compatMode=='CSS1Compat') ? document.documentElement.scrollTop+document.documentElement.clientHeight-this.clientHeight:document.body.scrollTop+document.body.clientHeight-this.clientHeight);_left:expression(eval(document.compatMode&&document.compatMode=='CSS1Compat') ? document.documentElement.scrollLeft:document.body.scrollLeft)} \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/shutter_reloaded/shutter.min.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/shutter_reloaded/shutter.min.js new file mode 100644 index 0000000000000000000000000000000000000000..96e7665e3759b665a81ff6c71a1d47ddcd027bf2 --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/shutter_reloaded/shutter.min.js @@ -0,0 +1 @@ +eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('e 2p=2T.2U+\'/2S/2R/\';q={m:[\'2P\',\'2Q\',\'2V\',\'2W 32\',\'31 2Z 2X\',\'1z\',\'2O\',\'2Y...\'],2j:1e,z:19,F:2p,I:n(a){o b.33(a)},2H:n(a){e L,T,17,i,A,1w,1T,1x,k,u;1j(i=0;i<b.2o.O;i++){L=b.2o[i];17=(L.s.M(\'?\')==-1)?L.s.1u(-4).V():L.s.2F(0,L.s.M(\'?\')).1u(-4).V();9(17!=\'.2I\'&&17!=\'.2M\'&&17!=\'.p\'&&17!=\'2J\')1W;9(a==\'2N\'&&L.12.V().M(\'2K\')==-1)1W;9(a==\'2L\'&&L.1V.V().M(\'2q\')==-1)1W;9(L.12.V().M(\'2G\')!=-1)A=(L.12.M(\' \')!=-1)?L.12.1u(0,L.12.M(\' \')):L.12;B 9(L.1V.V().M(\'2q[\')!=-1)A=L.1V;B A=0,1w=-1;9(A){9(!N[A])N[A]=[];1w=N[A].34(i)}1T=L.s.1u(L.s.3h(\'/\')+1);T=(L.r&&L.r!=1T)?L.r:\'\';h[i]={1A:L.s,J:1w,1c:A,r:T};L.11=U 27(\'q.14("\'+i+\'");o 19;\')}9(!8.z){1x=[\'2k.p\',\'18.p\',\'15.p\',\'2s.p\',\'2i.p\',\'1l.p\'];1j(k=0;k<1x.O;k++){u=U 1z();u.y=8.F+1x[k]}}},14:n(f,2g){e 18,15,1K=\'\',1R=\'\',24,20,1Z,22,D,S,W,j,1Q=\'\',1g,1J,1t,1I;9(!8.t){9(1v g.2t!=\'2v\')8.t=g.2t;B 8.t=(b.v.1Y>0)?b.v.1Y:b.E.1Y}9(1v 8.1H==\'2v\')8.1H=2y.38(b.v.2w,b.E.2w);9(2g)8.1a=1e;B 8.1a=1h;9(8.1d)8.1d=1h;g.2E=U 27(\'q.2A("\'+f+\'");\');b.v.c.1U=\'1L\';9(!8.1o){8.2l();8.1o=1e}9(!(S=8.I(\'Y\'))){S=b.1r(\'K\');S.1m(\'H\',\'Y\');b.Z(\'E\')[0].1n(S);8.1P()}9(!(D=8.I(\'1G\'))){D=b.1r(\'K\');D.1m(\'H\',\'1G\');D.c.21=8.t+\'G\';b.Z(\'E\')[0].1n(D)}S.c.w=8.1H+\'G\';e 13=8.z?\' | \':\'\';9(h[f].J>1){18=N[h[f].1c][h[f].J-2];1Z=8.z?8.m[0]:\'<u y="\'+8.F+\'18.p" r="\'+8.m[0]+\'" />\';1K=\'<a s="#" 11="q.14(\'+18+\');o 19">\'+1Z+\'</a>\'+13;24=U 1z();24.y=h[18].1A}9(h[f].J!=-1&&h[f].J<(N[h[f].1c].O)){15=N[h[f].1c][h[f].J];22=8.z?8.m[1]:\'<u y="\'+8.F+\'15.p" r="\'+8.m[1]+\'" />\';1R=\'<a s="#" 11="q.14(\'+15+\');o 19">\'+22+\'</a>\'+13;20=U 1z();20.y=h[15].1A}1J=8.z?8.m[2]:\'<u y="\'+8.F+\'2k.p" r="\'+8.m[2]+\'" />\';1g=((h[f].J>0)&&8.2j)?\' \'+8.m[5]+\'&26;\'+h[f].J+\'&26;\'+8.m[6]+\'&26;\'+N[h[f].1c].O:\'\';9(1g&&8.z)1g+=\' |\';9(8.1a){1t=8.z?8.m[4]:\'<u y="\'+8.F+\'2i.p" r="\'+8.m[4]+\'" />\'}B{1t=8.z?8.m[3]:\'<u y="\'+8.F+\'2s.p" r="\'+8.m[3]+\'" />\';1Q=\',1\'}1I=\'<2C H="2f"><a s="#" 11="q.14(\'+f+1Q+\');o 19">\'+1t+\'</a>\'+13+\'</2C>\';9(!(j=8.I(\'1C\'))){j=b.1r(\'K\');j.1m(\'H\',\'1C\');b.Z(\'E\')[0].1n(j)}j.1O=13+1K+\'<a s="#" 11="q.2e();o 19">\'+1J+\'</a>\'+13+1I+1R+1g;D.1O=\'<K H="1y"><u y="\'+h[f].1A+\'" H="2z" 1k="q.2n();" 11="q.2e();" /><K H="2D">\'+h[f].r+\'</K></K>\';g.2d(n(){q.1l()},37)},1l:n(){e S,x,W;9((W=8.I(\'1y\'))&&W.c.R==\'1B\')o;9(!(S=8.I(\'Y\')))o;9(8.I(\'2b\'))o;x=b.1r(\'K\');x.1m(\'H\',\'2b\');x.c.21=8.t+\'G\';x.1O=\'<u y="\'+8.F+\'1l.p" r="\'+8.m[7]+\'" />\';S.1n(x)},2e:n(){e D,S,j;9(D=8.I(\'1G\'))D.1F.1E(D);9(S=8.I(\'Y\'))S.1F.1E(S);9(j=8.I(\'1C\'))j.1F.1E(j);8.1P(1e);g.2a(0,8.t);g.2E=8.1a=8.t=8.1o=1h;b.v.c.1U=\'\'},2A:n(f){9(8.1d)o;9(!8.I(\'Y\'))o;e W=8.I(\'1y\');9(W)W.c.R=\'1L\';g.2d(n(){q.1d=1h},3d);g.2d(U 27(\'q.1o = 1h;q.14("\'+f+\'");\'),39);8.1d=1e},2l:n(){e 1b=g.2h?g.2h:0;e 1f=b.E.29?b.E.29:0;e X=b.v?b.v.29:0;9(1b>0){8.C=((1b-1f)>1&&(1b-1f)<30)?1f:1b;8.C=((8.C-X)>1&&(8.C-X)<30)?X:8.C}B 8.C=(X>0)?X:1f;e 28=b.v?b.v.2u:0;e 2r=g.2m?g.2m:b.E.2u;8.P=(28>1)?28:2r},2n:n(){e S,W,x,D,T,d,j,C,P,1D,Q,1p,1s,1N,1q=0;9(!(S=8.I(\'Y\')))o;9((W=8.I(\'1y\'))&&W.c.R==\'1B\')o;9(x=8.I(\'2b\'))x.1F.1E(x);D=8.I(\'1G\');d=8.I(\'2z\');T=8.I(\'2D\');j=8.I(\'1C\');S.c.l=D.c.l=\'\';T.c.l=(d.l-4)+\'G\';1D=j.1M?T.1M+j.1M:30;Q=8.C-7-1D;9(8.1a){9(d.l>(8.P-10))S.c.l=D.c.l=d.l+10+\'G\';b.v.c.1U=\'\'}B{g.2a(0,8.t);9(d.w>Q){d.l=d.l*(Q/d.w);d.w=Q;1q=1}9(d.l>(8.P-16)){d.w=d.w*((8.P-16)/d.l);d.l=8.P-16;1q=1}T.c.l=(d.l-4)+\'G\';j.c.2x=\'3c\'}1p=8.t+d.w+1D+10;9(1p>8.1H)S.c.w=1p+\'G\';g.2a(0,8.t);9((8.1a&&(d.w>Q||d.l>8.P))||1q)8.I(\'2f\').c.3e=\'3f\';1s=(Q-d.w)*0.3b;1N=(1s>3)?2y.3a(1s):3;D.c.21=8.t+1N+\'G\';j.c.2x=\'0\';W.c.R=\'1B\'},1P:n(2B){e 25=b.Z(\'3g\');e 1S=b.Z(\'36\');e 23=b.Z(\'35\');9(2B)e 1i=\'1B\';B e 1i=\'1L\';1j(i=0;i<25.O;i++)25[i].c.R=1i;1j(i=0;i<1S.O;i++)1S[i].c.R=1i;1j(i=0;i<23.O;i++)23[i].c.R=1i}};e h={},N={};9(1v 1X==\'n\'){2c=g.1k;9(1v g.1k!=\'n\')g.1k=1X;B g.1k=n(){1X();9(2c){2c()}}}',62,204,'||||||||this|if||document|style|TI|var|ln|window|shutterLinks||NB||width|L10n|function|return|gif|shutterReloaded|title|href|Top|img|documentElement|height|WB|src|textBtns|setid|else|wHeight||body|shImgDir|px|id||num|div||indexOf|shutterSets|length|wWidth|shHeight|visibility|||new|toLowerCase||deH|shShutter|getElementsByTagName||onclick|className|dv|Make|next||ext|prev|false|FS|wiH|set|resizing|true|dbH|imgNum|null|vis|for|onload|loading|setAttribute|appendChild|VP|maxHeight|resized|createElement|itop|fsbtn|slice|typeof|inset|shMenuPre|shWrap|Image|link|visible|shNavBar|capH|removeChild|parentNode|shDisplay|pgHeight|fsLink|closebtn|prevlink|hidden|offsetHeight|mtop|innerHTML|fixTags|fsarg|nextlink|obj|shfile|overflowX|rel|continue|shutterOnload|scrollTop|prevbtn|nextimg|top|nextbtn|emb|previmg|sel|nbsp|Function|deW|clientHeight|scrollTo|shWaitBar|oldonload|setTimeout|hideShutter|fullSize|fs|innerHeight|resize2|imageCount|close|_viewPort|innerWidth|ShowImg|links|imagePath|lightbox|dbW|resize1|pageYOffset|clientWidth|undefined|scrollHeight|bottom|Math|shTopImg|Resize|arg|span|shTitle|onresize|substring|shutterset|Init|jpg|jpeg|shutter|lb|png|sh|of|Previous|Next|images|shutter_reloaded|nextgen_lightbox_settings|static_path|Close|Full|Screen|Loading|to||Fit|Size|getElementById|push|embed|object|2000|max|100|floor|45|0px|500|display|inline|select|lastIndexOf'.split('|'),0,{})) diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/thickbox/nextgen_thickbox_init.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/thickbox/nextgen_thickbox_init.js index 5ec30c72f8a2ac3992926f375683915481b56e36..d3ba39747d9aa2ebabf24cecd608de12f7f0e729 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/thickbox/nextgen_thickbox_init.js +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/thickbox/nextgen_thickbox_init.js @@ -1,9 +1,6 @@ -jQuery(function($) { - var selector = nextgen_lightbox_filter_selector($, $([])); - selector.addClass('thickbox'); - - if (typeof ngg_lightbox_i18n == 'undefined') { - // for backwards compatibility, ngg_lightbox_i18n may not exist and we should just use the English defaults +if (typeof window.thickboxL10n == 'undefined') { + if (typeof nextgen_thickbox_i18n == 'undefined') { + // for backwards compatibility, nextgen_thickbox_i18n may not exist and we should just use the English defaults window.thickboxL10n = { loadingAnimation: photocrati_ajax.wp_includes_url + '/wp-includes/js/thickbox/loadingAnimation.gif', closeImage: photocrati_ajax.wp_includes_url + '/wp-includes/js/thickbox/tb-close.png', @@ -18,12 +15,17 @@ jQuery(function($) { window.thickboxL10n = { loadingAnimation: photocrati_ajax.wp_includes_url + '/wp-includes/js/thickbox/loadingAnimation.gif', closeImage: photocrati_ajax.wp_includes_url + '/wp-includes/js/thickbox/tb-close.png', - next: ngg_lightbox_i18n.next, - prev: ngg_lightbox_i18n.prev, - image: ngg_lightbox_i18n.image, - of: ngg_lightbox_i18n.of, - close: ngg_lightbox_i18n.close, - noiframes: ngg_lightbox_i18n.noiframes + next: nextgen_thickbox_i18n.next, + prev: nextgen_thickbox_i18n.prev, + image: nextgen_thickbox_i18n.image, + of: nextgen_thickbox_i18n.of, + close: nextgen_thickbox_i18n.close, + noiframes: nextgen_thickbox_i18n.noiframes }; } -}); +} + +jQuery(function($) { + var selector = nextgen_lightbox_filter_selector($, $([])); + selector.addClass('thickbox'); +}); \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/thickbox/nextgen_thickbox_init.min.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/thickbox/nextgen_thickbox_init.min.js new file mode 100644 index 0000000000000000000000000000000000000000..22621d9ba387710b5b3a14f1180d6208d9ab8f98 --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/thickbox/nextgen_thickbox_init.min.js @@ -0,0 +1 @@ +eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('n(k c.a==\'i\'){n(k 0==\'i\'){c.a={7:9.6+\'/8-4/3/1/7.h\',g:9.6+\'/8-4/3/1/m-2.l\',b:\'v &w;\',e:\'&x; t\',d:\'y\',5:\'5\',2:\'z\',f:\'r o s p q. u P K J L A M O N I H.\'}}C{c.a={7:9.6+\'/8-4/3/1/7.h\',g:9.6+\'/8-4/3/1/m-2.l\',b:0.b,e:0.e,d:0.d,5:0.5,2:0.2,f:0.f}}}F(G($){E j=D($,$([]));j.B(\'1\')});',52,52,'nextgen_thickbox_i18n|thickbox|close|js|includes|of|wp_includes_url|loadingAnimation|wp|photocrati_ajax|thickboxL10n|next|window|image|prev|noiframes|closeImage|gif|undefined|selector|typeof|png|tb|if|feature|inline|frames|This|requires|Prev|You|Next|gt|lt|Image|Close|your|addClass|else|nextgen_lightbox_filter_selector|var|jQuery|function|them|support|disabled|iframes|or|browser|not|does|have'.split('|'),0,{})) diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mediarss/module.mediarss.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mediarss/module.mediarss.php index 3ad9a8594deadbc20ec4a106f75a85a4f00a7d90..02969f08846e9d109012cbd8cdc87b1b1ea4e4d3 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mediarss/module.mediarss.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mediarss/module.mediarss.php @@ -20,11 +20,6 @@ class M_MediaRss extends C_Base_Module ); } - function _register_adapters() - { - $this->get_registry()->add_adapter('I_Router', 'A_MediaRss_Routes'); - } - function _register_utilities() { $this->get_registry()->add_utility( @@ -32,12 +27,28 @@ class M_MediaRss extends C_Base_Module ); } + function _register_hooks() + { + add_action('ngg_routes', array(&$this, 'define_routes')); + } + + function define_routes($router) + { + $app = $router->create_app('/nextgen-mediarss'); + $app->route( + '/', + array( + 'controller' => 'I_MediaRSS_Controller', + 'action' => 'index', + 'context' => FALSE + ) + ); + } + function get_type_list() { return array( - 'A_Mediarss_Routes' => 'adapter.mediarss_routes.php', - 'C_Mediarss_Controller' => 'class.mediarss_controller.php', - 'I_Mediarss_Controller' => 'interface.mediarss_controller.php' + 'C_Mediarss_Controller' => 'class.mediarss_controller.php' ); } diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mediarss/package.module.mediarss.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mediarss/package.module.mediarss.php new file mode 100644 index 0000000000000000000000000000000000000000..8e8ea10d1cd8979c76bd51a88f6eea6cb74dce89 --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mediarss/package.module.mediarss.php @@ -0,0 +1,134 @@ +<?php +class Mixin_MediaRSS_Controller extends Mixin +{ + /** + * Renders a MediaRSS feed + */ + public function index_action() + { + $this->object->set_content_type('xml'); + if ($this->object->param('source')) { + $method = 'render_' . $this->object->param('source'); + if ($this->object->has_method($method)) { + $this->object->{$method}(); + } + } else { + $this->object->http_error('No source specified'); + } + } + public function render_latest_images() + { + $this->object->set_param('params', json_encode(array('source' => 'recent'))); + $this->object->render_displayed_gallery(); + } + /** + * Renders a feed for a displayed gallery + */ + public function render_displayed_gallery() + { + $displayed_gallery = NULL; + $mapper = C_Displayed_Gallery_Mapper::get_instance(); + $template = $this->object->param('template'); + if (!in_array($template, array('mediarss_feed', 'playlist_feed'))) { + $template = 'mediarss_feed'; + } + $template = 'photocrati-mediarss#' . $template; + // Find the displayed gallery by it's database id + if ($id = $this->object->param('id')) { + $displayed_gallery = $mapper->find($id, TRUE); + } elseif ($transient_id = $this->object->param('transient_id')) { + // retrieve by transient id + $factory = C_Component_Factory::get_instance(); + $displayed_gallery = $factory->create('displayed_gallery', NULL, $mapper); + $displayed_gallery->apply_transient($transient_id); + } elseif ($params = $this->object->param('params')) { + // Create the displayed gallery based on the URL parameters + $factory = C_Component_Factory::get_instance(); + $displayed_gallery = $factory->create('displayed_gallery', json_decode($params), $mapper); + } + // Assuming we have a displayed gallery, display it! + if ($displayed_gallery) { + $storage = C_Gallery_Storage::get_instance(); + $this->render_view($template, array('storage' => $storage, 'images' => $displayed_gallery->get_included_entities(), 'feed_title' => $this->object->_get_feed_title($displayed_gallery), 'feed_description' => $this->object->_get_feed_description($displayed_gallery), 'feed_link' => $this->object->_get_feed_link($displayed_gallery), 'generator' => $this->object->_get_feed_generator($displayed_gallery), 'copyright' => $this->object->_get_feed_copyright($displayed_gallery))); + } else { + $this->object->http_error('Invalid ID', 404); + } + } + /** + * Gets the name of the feed generator + * @param C_Displayed_Gallery $displayed_gallery + * @return string + */ + public function _get_feed_generator($displayed_gallery) + { + return 'NextGEN Gallery [http://nextgen-gallery.com]'; + } + /** + * Gets the copyright for the feed + */ + public function _get_feed_copyright($displayed_gallery) + { + $base_url = $this->object->get_base_url(); + $blog_name = get_option('blogname'); + return "Copyright (C) {$blog_name} ({$base_url})"; + } + /** + * Gets the Site URL + * @return string + */ + public function get_base_url() + { + $router = C_Router::get_instance(); + return $router->get_base_url('home'); + } + /** + * Gets a description for the feed + * @param C_Displayed_Gallery $displayed_gallery + * @return string + */ + public function _get_feed_description($displayed_gallery) + { + return ''; + } + /** + * Gets a link for the feed + * @param C_Displayed_Gallery $displayed_gallery + * @return string + */ + public function _get_feed_link($displayed_gallery) + { + return $this->object->get_base_url(); + } + /** + * Gets a title for the feed + * @param C_Displayed_Gallery $displayed_gallery + * @return string + */ + public function _get_feed_title($displayed_gallery) + { + // Get gallery titles + $gallery_titles = array(); + foreach ($displayed_gallery->get_galleries() as $gallery) { + $gallery_titles[] = $gallery->title; + } + return 'Images from: ' . implode(', ', $gallery_titles); + } +} +class C_MediaRSS_Controller extends C_MVC_Controller +{ + static $_instances = array(); + public function define($context = FALSE) + { + parent::define($context); + $this->add_mixin('Mixin_MediaRSS_Controller'); + $this->implement('I_MediaRSS_Controller'); + } + static function get_instance($context = FALSE) + { + if (!isset(self::$_instances[$context])) { + $klass = get_class(); + self::$_instances[$context] = new $klass($context); + } + return self::$_instances[$context]; + } +} \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mediarss/templates/mediarss_feed.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mediarss/templates/mediarss_feed.php index 0b0e9a3d5fe05d55ae47bc05ff2909c9d1092e99..d09a56dd911ef43a6266ed094f634637d8506d94 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mediarss/templates/mediarss_feed.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mediarss/templates/mediarss_feed.php @@ -1,9 +1,9 @@ <?php echo('<?xml version="1.0" encoding="UTF-8"?>');?> <rss version='2.0' xmlns:media='http://search.yahoo.com/mrss/'> <channel> - <generator><![CDATA[<?php echo_h($generator)?>]]></generator> - <title><?php echo_h($feed_title) ?></title> - <description><?php echo_h($feed_description) ?></description> + <generator><![CDATA[<?php esc_html_e($generator)?>]]></generator> + <title><?php esc_html_e($feed_title) ?></title> + <description><?php esc_html_e($feed_description) ?></description> <link><![CDATA[<?php echo nextgen_esc_url($feed_link)?>]]></link> <?php foreach($images as $image): ?> <?php @@ -14,20 +14,20 @@ $height = $thumb_size['height']; ?> <item> - <title><![CDATA[<?php echo_h($image->alttext)?>]]></title> - <description><![CDATA[<?php echo_h($image->description)?>]]></description> + <title><![CDATA[<?php esc_html_e($image->alttext)?>]]></title> + <description><![CDATA[<?php esc_html_e($image->description)?>]]></description> <link><![CDATA[<?php echo nextgen_esc_url($image_url)?>]]></link> - <guid>image-id:<?php echo_h($image->id_field)?></guid> + <guid>image-id:<?php esc_html_e($image->id_field)?></guid> <media:content url="<?php echo nextgen_esc_url($image_url)?>" medium="image" /> - <media:title><![CDATA[<?php echo_h($image->alttext)?>]]></media:title> + <media:title><![CDATA[<?php esc_html_e($image->alttext)?>]]></media:title> <?php if (isset($description)): ?> - <media:description><![CDDATA[<?php echo_h($image->description)?>]]></media:description> + <media:description><![CDDATA[<?php esc_html_e($image->description)?>]]></media:description> <?php endif ?> - <media:thumbnail width="<?php echo esc_attr($width)?>" height="<?php echo esc_attr($height)?>" url="<?php echo nextgen_esc_url($thumb_url) ?>"/> + <media:thumbnail width="<?php esc_attr_e($width)?>" height="<?php esc_attr_e($height)?>" url="<?php echo nextgen_esc_url($thumb_url) ?>"/> <?php if (isset($tagnames)): ?> - <media:keywords><![CDATA[<?php echo_h($tagnames)?>]]></media:keywords> + <media:keywords><![CDATA[<?php esc_html_e($tagnames)?>]]></media:keywords> <?php endif ?> - <media:copyright><![CDATA[<?php echo_h($copyright)?>]]></media:copyright> + <media:copyright><![CDATA[<?php esc_html_e($copyright)?>]]></media:copyright> </item> <?php endforeach ?> </channel> diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mvc/README.txt b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mvc/README.txt new file mode 100644 index 0000000000000000000000000000000000000000..082c31de4902bcae54965b1888eb1e28b116884d --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mvc/README.txt @@ -0,0 +1,85 @@ + +VIEW ELEMENTS + +Elements are sub-pieces of a template/view identified by a "unique" ID. The ID is unique in the sense that it uniquely defines the "origin" or creator for the element itself. + +For instance if you have a module called pro_lightbox and specific adapter for trigger buttons and you add an element for it the unique ID identifying the element could be nextgen_pro_lightbox.trigger_buttons + +The ID doesn't however need to be unique in the view itself, meaning you can have multiple elements with the same ID if for instance the element is being rendered for multiple images. We might add an extra "context" parameter to elements together to the ID if we want to uniquely identify element objects. + +Example of how elements are initiated: + +$elem = $this->start_element('flash_cont'); +echo 'cont'; +$this->start_element('flash_test'); +echo 'test'; +$this->start_element('flash_stuff'); +echo 'stuff'; +$this->end_element(); +$this->end_element(); +$this->end_element(); + +var_dump($elem); + +This would create this output: + +object(C_MVC_View_Element)#775 (3) { + ["_id"]=>string(10) "flash_cont" + ["_type"]=>string(7) "element" + ["_list"]=>array(2) { + [0]=>string(4) "cont" + [1]=>object(C_MVC_View_Element)#768 (3) { + ["_id"]=>string(10) "flash_test" + ["_type"]=>string(7) "element" + ["_list"]=>array(2) { + [0]=>string(4) "test" + [1]=>object(C_MVC_View_Element)#769 (3) { + ["_id"]=>string(11) "flash_stuff" + ["_type"]=>string(7) "element" + ["_list"]=>array(1) { + [0]=>string(5) "stuff" + } + } + } + } + } +} + +The way the MVC view will render these is by creating a root View Element that contains the entire template rendered in the view and which is then "rasterized" e.g. converted to markup/text ready for output + +The rendering from template to element will occur in the render_object() method while rasterization will occur in a method called rasterize_object() + +Elements created for templates will have ID corresponding to template name/path so for instance _id would equal 'photocrati-nextgen_basic_gallery#slideshow/index' this way adapters adapting rasterize_object() can easily distinguish between for which template rasterization is occurring and act accordingly (for instance trigger buttons being enabled only for certain display types) + +Sub-templates will also be automatically rendered to elements meaning image/before and image/after etc. will become sub-elements of the root template element. I don't think this will affect performance much but if so we could easily replace the before/after mechanism to use elements directly + +So for instance instead of: +$this->include_template('image/before'); +<div class="image">...</div> +$this->include_template('image/after'); + +We would have: +$this->start_element('nextgen_gallery.image'); +$this->include_template('image/before'); +<div class="image">...</div> +$this->include_template('image/after'); +$this->end_element(); + +Then you could have an adapter like: + + function rasterize_object($root_element) + { + if ($root_element->get_id() == 'photocrati-nextgen_basic_gallery#slideshow/index') + { + $list = $root_element->find('nextgen_gallery.image'); + + foreach ($list as $element) + { + $element->append('<div>description</div>'); + } + } + } + +This would reduce the amount of elements overall and improve performance and possibly readability. Then the before/after templates could be left untouched as in the example above. + + diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mvc/module.mvc.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mvc/module.mvc.php index 65884e5af8015353d87fcc0f97facb5e5a8cc0fb..8161b963ca4666f45449faea54da65b5b7a3abd4 100755 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mvc/module.mvc.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mvc/module.mvc.php @@ -8,10 +8,9 @@ ***/ /** - * TODO: The file below should be deprecated. We should use an example template + * TODO: The file below should be deprecated. We should use an existing template * engine, such as Twig */ -require_once('template_helper.php'); class M_MVC extends C_Base_Module { @@ -27,7 +26,6 @@ class M_MVC extends C_Base_Module "http://www.photocrati.com" ); - include_once('class.mvc_option_handler.php'); C_NextGen_Settings::get_instance()->add_option_handler('C_Mvc_Option_Handler', array( 'mvc_template_dir', 'mvc_template_dirname', @@ -65,11 +63,47 @@ class M_MVC extends C_Base_Module 'C_Mvc_Installer' => 'class.mvc_installer.php', 'C_Mvc_Controller' => 'class.mvc_controller.php', 'C_Mvc_View' => 'class.mvc_view.php', - 'C_Mvc_View_Element' => 'class.mvc_view_element.php', - 'I_Mvc_Controller' => 'interface.mvc_controller.php', - 'I_Mvc_View' => 'interface.mvc_view.php' + 'C_Mvc_View_Element' => 'class.mvc_view_element.php' ); } } +class C_Mvc_Option_Handler +{ + function get($option, $default=NULL) + { + $retval = $default; + + switch ($option) { + case 'mvc_template_dir': + case 'mvc_template_dirname': + $retval = '/templates'; + break; + case 'mvc_static_dirname': + case 'mvc_static_dir': + $retval = '/static'; + break; + } + + return $retval; + } +} + +// These functions do NOT work when the Adminer plugin is installed, and being +// viewed. As there's no need to use these functions when viewing Adminer, we'll +// just skip this +if (strpos($_SERVER['REQUEST_URI'], 'adminer') === FALSE) { + + if (!function_exists('echo_safe_html')) { + function echo_safe_html($html, $extra_tags = null) + { + $tags = array('<a>', '<abbr>', '<acronym>', '<address>', '<b>', '<base>', '<basefont>', '<big>', '<blockquote>', '<br>', '<br/>', '<caption>', '<center>', '<cite>', '<code>', '<col>', '<colgroup>', '<dd>', '<del>', '<dfn>', '<dir>', '<div>', '<dl>', '<dt>', '<em>', '<fieldset>', '<font>', '<h1>', '<h2>', '<h3>', '<h4>', '<h5>', '<h6>', '<hr>', '<i>', '<ins>', '<label>', '<legend>', '<li>', '<menu>', '<noframes>', '<noscript>', '<ol>', '<optgroup>', '<option>', '<p>', '<pre>', '<q>', '<s>', '<samp>', '<select>', '<small>', '<span>', '<strike>', '<strong>', '<sub>', '<sup>', '<table>', '<tbody>', '<td>', '<tfoot>', '<th>', '<thead>', '<tr>', '<tt>', '<u>', '<ul>'); + $html = preg_replace('/\\s+on\\w+=(["\']).*?\\1/i', '', $html); + $html = preg_replace('/(<\/[^>]+?>)(<[^>\/][^>]*?>)/', '$1 $2', $html); + $html = strip_tags($html, implode('', $tags)); + echo $html; + } + } +} + new M_MVC(); diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mvc/package.module.mvc.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mvc/package.module.mvc.php new file mode 100644 index 0000000000000000000000000000000000000000..e08330a013f7c92f7b78dedb849e080ebf556004 --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mvc/package.module.mvc.php @@ -0,0 +1,720 @@ +<?php +class A_MVC_Factory extends Mixin +{ + public function mvc_view($template, $params = array(), $engine = 'php', $context = FALSE) + { + return new C_MVC_View($template, $params, $engine, $context); + } +} +class A_MVC_Fs extends Mixin +{ + static $_lookups = array(); + static $_non_minified_modules = array(); + public function _get_cache_key() + { + return C_Photocrati_Transient_Manager::create_key('MVC', 'find_static_abspath'); + } + public function initialize() + { + register_shutdown_function(array(&$this, 'cache_lookups')); + self::$_lookups = C_Photocrati_Transient_Manager::fetch($this->_get_cache_key(), array()); + self::$_non_minified_modules = apply_filters('ngg_non_minified_modules', array()); + } + public function cache_lookups() + { + C_Photocrati_Transient_Manager::update($this->_get_cache_key(), self::$_lookups); + } + /** + * Gets the absolute path to a static resource. If it doesn't exist, then NULL is returned + * + * @param string $path + * @param string $module + * @param string $relative + * @return string|NULL + */ + public function find_static_abspath($path, $module = FALSE, $relative = FALSE, &$found_root = FALSE) + { + $retval = NULL; + $key = $this->_get_static_abspath_key($path, $module, $relative); + // Have we looked up this resource before? + if (isset(self::$_lookups[$key])) { + $retval = self::$_lookups[$key]; + } else { + // Get the module if we haven't got one yet + if (!$module) { + list($path, $module) = $this->object->parse_formatted_path($path); + } + // Lookup the module directory + $mod_dir = $this->object->get_registry()->get_module_dir($module); + $filter = has_filter('ngg_non_minified_files') ? apply_filters('ngg_non_minified_files', $path, $module) : FALSE; + if (!defined('SCRIPT_DEBUG')) { + define('SCRIPT_DEBUG', FALSE); + } + if (!SCRIPT_DEBUG && !in_array($module, self::$_non_minified_modules) && strpos($path, 'min.') === FALSE && strpos($path, 'pack.') === FALSE && strpos($path, 'packed.') === FALSE && preg_match('/\\.(js|css)$/', $path) && !$filter) { + $path = preg_replace('#\\.[^\\.]+$#', '.min\\0', $path); + } + // Create the absolute path to the file + $path = $this->object->join_paths($mod_dir, C_NextGen_Settings::get_instance()->get('mvc_static_dirname'), $path); + if ($relative) { + $original_length = strlen($path); + $roots = array('plugins', 'plugins_mu', 'templates', 'stylesheets'); + $found_root = FALSE; + foreach ($roots as $root) { + $path = str_replace($this->object->get_document_root($root), '', $path); + if (strlen($path) != $original_length) { + $found_root = $root; + break; + } + } + } + // Cache result + $retval = self::$_lookups[$key] = $path; + } + return $retval; + } + public function _get_static_abspath_key($path, $module = FALSE, $relative = FALSE) + { + $key = $path; + if ($module) { + $key .= '|' . $module; + } + if ($relative) { + $key .= 'r'; + } + global $wpdb; + if ($wpdb) { + $key .= '|' . $wpdb->blogid; + } + return $key; + } + /** + * Gets the relative path to a static resource. If it doesn't exist, then NULL is returned + * + * @param string $path + * @param string $module + * @return string|NULL + */ + public function find_static_relpath($path, $module = FALSE) + { + return $this->object->find_static_abspath($path, $module, TRUE); + } +} +class A_MVC_Router extends Mixin +{ + static $_lookups = array(); + public function initialize() + { + register_shutdown_function(array(&$this, 'cache_lookups')); + self::$_lookups = C_Photocrati_Transient_Manager::fetch($this->_get_cache_key(), array()); + } + public function _get_cache_key() + { + return C_Photocrati_Transient_Manager::create_key('MVC', 'get_static_url'); + } + public function cache_lookups() + { + C_Photocrati_Transient_Manager::update($this->_get_cache_key(), self::$_lookups); + } + public function _get_static_url_key($path, $module = FALSE) + { + $parts = array($path, $module, $this->object->get_base_url('plugins'), $this->object->get_base_url('plugins_mu'), $this->object->get_base_url('templates'), $this->object->get_base_url('stylesheets')); + return implode('|', $parts); + } + /** + * First tries to find the static file in the 'static' folder + * @param string $path + * @param string $module + * @return string + */ + public function get_static_url($path, $module = FALSE) + { + $retval = NULL; + $key = $this->object->_get_static_url_key($path, $module); + /// Have we looked up this url before? + if (isset(self::$_lookups[$key])) { + $retval = self::$_lookups[$key]; + } else { + $fs = C_Fs::get_instance(); + $path = $fs->find_static_abspath($path, $module); + $original_length = strlen($path); + $roots = array('plugins', 'plugins_mu', 'templates', 'stylesheets'); + $found_root = FALSE; + foreach ($roots as $root) { + $path = str_replace($fs->get_document_root($root), '', $path); + if (strlen($path) != $original_length) { + $found_root = $root; + break; + } + } + // We found the root so we know what base url to prepend + if ($found_root) { + $retval = self::$_lookups[$key] = $this->object->join_paths($this->object->get_base_url($found_root), str_replace('\\', '/', $path)); + } else { + $retval = self::$_lookups[$key] = $this->object->join_paths($this->object->get_base_url('root'), str_replace('\\', '/', $path)); + } + } + return $retval; + } +} +if (preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { + die('You are not allowed to call this page directly.'); +} +class Mixin_MVC_Controller_Defaults extends Mixin +{ + // Provide a default view + public function index_action($return = FALSE) + { + return $this->render_view('photocrati-mvc#index', array(), $return); + } +} +/** + * Provides actions that are executed based on the requested url + */ +abstract class C_MVC_Controller extends C_Component +{ + public $_content_type = 'text/html'; + public $message = ''; + public $debug = FALSE; + public function define($context = FALSE) + { + parent::define($context); + $this->add_mixin('Mixin_MVC_Controller_Defaults'); + $this->add_mixin('Mixin_MVC_Controller_Instance_Methods'); + $this->implement('I_MVC_Controller'); + } +} +/** + * Adds methods for MVC Controller + */ +class Mixin_MVC_Controller_Instance_Methods extends Mixin +{ + public function set_content_type($type) + { + switch ($type) { + case 'html': + case 'xhtml': + $type = 'text/html'; + break; + case 'xml': + $type = 'text/xml'; + break; + case 'rss': + case 'rss2': + $type = 'application/rss+xml'; + break; + case 'css': + $type = 'text/css'; + break; + case 'javascript': + case 'jscript': + case 'emcascript': + $type = 'text/javascript'; + break; + case 'json': + $type = 'application/json'; + break; + case 'jpeg': + case 'jpg': + case 'jpe': + $type = 'image/jpeg'; + break; + case 'gif': + $type = 'image/gif'; + break; + case 'png': + $type = 'image/x-png'; + break; + case 'tiff': + case 'tif': + $type = 'image/tiff'; + break; + case 'pdf': + $type = 'application/pdf'; + break; + } + $this->object->_content_type = $type; + return $type; + } + public function do_not_cache() + { + if (!headers_sent()) { + header('Cache-Control: no-cache'); + header('Pragma: no-cache'); + } + } + public function expires($time) + { + $time = strtotime($time); + if (!headers_sent()) { + header('Expires: ' . strftime('%a, %d %b %Y %H:%M:%S %Z', $time)); + } + } + public function http_error($message, $code = 501) + { + $this->message = $message; + $method = "http_{$code}_action"; + $this->{$method}(); + } + public function is_valid_request($method) + { + return TRUE; + } + public function is_post_request() + { + return 'POST' == $this->object->get_router()->get_request_method(); + } + public function is_get_request() + { + return 'GET' == $this->object->get_router()->get_request_method(); + } + public function is_delete_request() + { + return 'DELETE' == $this->object->get_router()->get_request_method(); + } + public function is_put_request() + { + return 'PUT' == $this->object->get_router()->get_request_method(); + } + public function is_custom_request($type) + { + return strtolower($type) == strtolower($this->object->get_router()->get_request_method()); + } + public function get_router() + { + return C_Router::get_instance(); + } + public function get_routed_app() + { + return $this->object->get_router()->get_routed_app(); + } + /** + * Returns the value of a parameters + * @param string $key + * @return mixed + */ + public function param($key, $prefix = NULL, $default = NULL) + { + return $this->object->get_routed_app()->get_parameter($key, $prefix, $default); + } + public function set_param($key, $value, $id = NULL, $use_prefix = FALSE) + { + return $this->object->get_routed_app()->set_parameter($key, $value, $id, $use_prefix); + } + public function set_param_for($url, $key, $value, $id = NULL, $use_prefix = FALSE) + { + return $this->object->get_routed_app()->set_parameter($key, $value, $id, $use_prefix, $url); + } + public function remove_param($key, $id = NULL) + { + return $this->object->get_routed_app()->remove_parameter($key, $id); + } + public function remove_param_for($url, $key, $id = NULL) + { + $app = $this->object->get_routed_app(); + $retval = $app->remove_parameter($key, $id, $url); + return $retval; + } + /** + * Gets the routed url, generated by the Routing App + * @return string + */ + public function get_routed_url($with_qs = FALSE) + { + return $this->object->get_routed_app()->get_app_url(FALSE, $with_qs); + } + /** + * Gets the absolute path of a static resource + * @param string $path + * @param string $module + * @param boolean $relative + * @return string + */ + public function get_static_abspath($path, $module = FALSE, $relative = FALSE) + { + return C_Fs::get_instance()->find_static_abspath($path, $module); + } + /** + * Gets the relative path of a static resource + * @param string $path + * @param string $module + * @return string + */ + public function get_static_relpath($path, $module = FALSE) + { + return C_Fs::get_instance()->find_static_abspath($path, $module, TRUE); + } + public function get_static_url($path, $module = FALSE) + { + return C_Router::get_instance()->get_static_url($path, $module); + } + /** + * Renders a template and outputs the response headers + * @param string $name + * @param array $vars + */ + public function render_view($name, $vars = array(), $return = FALSE) + { + $this->object->render(); + return $this->object->render_partial($name, $vars, $return); + } + /** + * Outputs the response headers + */ + public function render() + { + if (!headers_sent()) { + header('Content-Type: ' . $this->object->_content_type . '; charset=' . get_option('blog_charset'), true); + } + } + /** + * Renders a view + */ + public function render_partial($template, $params = array(), $return = FALSE, $context = NULL) + { + // We'll use the name of the view as the context if one hasn't been provided + if (is_null($context)) { + $context = $template; + } + $view = $this->object->create_view($template, $params, $context); + return $view->render($return); + } + public function create_view($template, $params = array(), $context = NULL) + { + $factory = C_Component_Factory::get_instance(); + $view = $factory->create('mvc_view', $template, $params, NULL, $context); + return $view; + } +} +class C_MVC_View extends C_Component +{ + public $_template = ''; + public $_engine = ''; + public $_params = array(); + public $_queue = array(); + public function define($template, $params = array(), $engine = 'php', $context = FALSE) + { + parent::define($context); + $this->implement('I_MVC_View'); + $this->add_mixin('Mixin_Mvc_View_Instance_Methods'); + } + /** + * Initialize the view with some parameters + * @param array $params + * @param context $context + */ + public function initialize($template, $params = array(), $engine = 'php', $context = FALSE) + { + parent::initialize($context); + $this->_template = $template; + $this->_params = (array) $params; + $this->_engine = $engine; + } +} +class Mixin_Mvc_View_Instance_Methods extends Mixin +{ + /** + * Returns the variables to be used in the template + * @return array + */ + public function get_template_vars() + { + $retval = array(); + foreach ($this->object->_params as $key => $value) { + if (strpos($key, '_template') !== FALSE) { + $value = $this->object->get_template_abspath($value); + } + $retval[$key] = $value; + } + return $retval; + } + /** + * Returns the abspath of the template to be rendered + * @param string $key + * @return string + */ + public function get_template_abspath($value = NULL) + { + if (!$value) { + $value = $this->object->_template; + } + if ($value[0] == '/' && @file_exists($value)) { + } else { + $value = $this->object->find_template_abspath($value); + } + return $value; + } + /** + * Renders the view (template) + * @param string $__return + * @return string|NULL + */ + public function render($return = FALSE) + { + $element = $this->object->render_object(); + $content = $this->object->rasterize_object($element); + if (!$return) { + echo $content; + } + return $content; + } + public function render_object() + { + // We use underscores to prefix local variables to avoid conflicts wth + // template vars + $__element = $this->start_element($this->object->_template, 'template', $this->object); + extract($this->object->get_template_vars()); + include $this->object->get_template_abspath(); + $this->end_element(); + return $__element; + } + public function rasterize_object($element) + { + return $element->rasterize(); + } + public function start_element($id, $type = null, $context = null) + { + if ($type == null) { + $type = 'element'; + } + $count = count($this->object->_queue); + $element = new C_MVC_View_Element($id, $type); + if ($context != null) { + if (!is_array($context)) { + $context = array('object' => $context); + } + foreach ($context as $context_name => $context_value) { + $element->set_context($context_name, $context_value); + } + } + $this->object->_queue[] = $element; + if ($count > 0) { + $old_element = $this->object->_queue[$count - 1]; + $content = ob_get_contents(); + ob_clean(); + $old_element->append($content); + $old_element->append($element); + } + ob_start(); + return $element; + } + public function end_element() + { + $content = ob_get_clean(); + $element = array_pop($this->object->_queue); + if ($content != null) { + $element->append($content); + } + return $element; + } + /** + * Renders a sub-template for the view + * @param string $__template + * @param array $__params + * @param string $__return + * @return NULL + */ + public function include_template($__template, $__params = null, $__return = FALSE) + { + // We use underscores to prefix local variables to avoid conflicts wth + // template vars + if ($__params == null) { + $__params = array(); + } + $__params['template_origin'] = $this->object->_template; + $__target = $this->object->get_template_abspath($__template); + $__origin_target = $this->object->get_template_abspath($this->object->_template); + $__image_before_target = $this->object->get_template_abspath('photocrati-nextgen_gallery_display#image/before'); + $__image_after_target = $this->object->get_template_abspath('photocrati-nextgen_gallery_display#image/after'); + if ($__origin_target != $__target) { + if ($__target == $__image_before_target) { + $__image = isset($__params['image']) ? $__params['image'] : null; + $this->start_element('nextgen_gallery.image_panel', 'item', $__image); + } + if ($__target == $__image_after_target) { + $this->end_element(); + } + extract($__params); + include $__target; + if ($__target == $__image_before_target) { + $__image = isset($__params['image']) ? $__params['image'] : null; + $this->start_element('nextgen_gallery.image', 'item', $__image); + } + if ($__target == $__image_after_target) { + $this->end_element(); + } + } + } + /** + * Gets the absolute path of an MVC template file + * + * @param string $path + * @param string $module + * @return string + */ + public function find_template_abspath($path, $module = FALSE) + { + $fs = C_Fs::get_instance(); + $settings = C_NextGen_Settings::get_instance(); + // We also accept module_name#path, which needs parsing. + if (!$module) { + list($path, $module) = $fs->parse_formatted_path($path); + } + // Append the suffix + $path = $path . '.php'; + // First check if the template is in the override dir + if (!($retval = $this->object->get_template_override_abspath($module, $path))) { + $retval = $fs->join_paths($this->object->get_registry()->get_module_dir($module), $settings->mvc_template_dirname, $path); + } + if (!@file_exists($retval)) { + throw new RuntimeException("{$retval} is not a valid MVC template"); + } + return $retval; + } + public function get_template_override_dir($module = NULL) + { + $fs = C_Fs::get_instance(); + $dir = $fs->join_paths(WP_CONTENT_DIR, 'ngg'); + if (!@file_exists($dir)) { + wp_mkdir_p($dir); + } + $dir = $fs->join_paths($dir, 'modules'); + if (!@file_exists($dir)) { + wp_mkdir_p($dir); + } + if ($module) { + $dir = $fs->join_paths($dir, $module); + if (!@file_exists($dir)) { + wp_mkdir_p($dir); + } + $dir = $fs->join_paths($dir, 'templates'); + if (!@file_exists($dir)) { + wp_mkdir_p($dir); + } + } + return $dir; + } + public function get_template_override_abspath($module, $filename) + { + $fs = C_Fs::get_instance(); + $retval = NULL; + $abspath = $fs->join_paths($this->object->get_template_override_dir($module), $filename); + if (@file_exists($abspath)) { + $retval = $abspath; + } + return $retval; + } + /** + * Adds a template parameter + * @param $key + * @param $value + */ + public function set_param($key, $value) + { + $this->object->_params[$key] = $value; + } + /** + * Removes a template parameter + * @param $key + */ + public function remove_param($key) + { + unset($this->object->_params[$key]); + } + /** + * Gets the value of a template parameter + * @param $key + * @param null $default + * @return mixed + */ + public function get_param($key, $default = NULL) + { + if (isset($this->object->_params[$key])) { + return $this->object->_params[$key]; + } else { + return $default; + } + } +} +class C_MVC_View_Element +{ + public $_id; + public $_type; + public $_list; + public $_context; + public function __construct($id, $type = null) + { + $this->_id = $id; + $this->_type = $type; + $this->_list = array(); + $this->_context = array(); + } + public function get_id() + { + return $this->_id; + } + public function append($child) + { + $this->_list[] = $child; + } + public function insert($child, $position = 0) + { + array_splice($this->_list, $position, 0, $child); + } + public function delete($child) + { + $index = array_search($child, $this->_list); + if ($index !== false) { + array_splice($this->_list, $index, 1); + } + } + public function find($id, $recurse = false) + { + $list = array(); + $this->_find($list, $id, $recurse); + return $list; + } + public function _find(array &$list, $id, $recurse = false) + { + foreach ($this->_list as $index => $element) { + if ($element instanceof C_MVC_View_Element) { + if ($element->get_id() == $id) { + $list[] = $element; + } + if ($recurse) { + $element->_find($list, $id, $recurse); + } + } + } + } + public function get_context($name) + { + if (isset($this->_context[$name])) { + return $this->_context[$name]; + } + return null; + } + public function set_context($name, $value) + { + $this->_context[$name] = $value; + } + public function get_object() + { + return $this->get_context('object'); + } + // XXX not implemented + public function parse() + { + } + public function rasterize() + { + $ret = null; + foreach ($this->_list as $index => $element) { + if ($element instanceof C_MVC_View_Element) { + $ret .= $element->rasterize(); + } else { + $ret .= (string) $element; + } + } + return $ret; + } +} \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mvc/templates/404.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mvc/templates/404.php index edba2907f1cface59d32e2525008859ddc6425c4..a7e424ac09487e3dd93e5267f09833beaaf9e105 100755 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mvc/templates/404.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mvc/templates/404.php @@ -1,9 +1,9 @@ <html> <head> - <title>Error 404: <?php echo_h($message) ?></title> + <title>Error 404: <?php esc_html_e($message) ?></title> </head> <body> - <h1>Error 404: <?php echo_h($message) ?></h1> + <h1>Error 404: <?php esc_html_e($message) ?></h1> <p>We're sorry, but the page you've requested cannot be found.</p> </body> </html> \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mvc/templates/500.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mvc/templates/500.php index 0f8ae69ba946fc344805ff28d157c7eb12ab0737..9c349dca606b2d7b0cbd1f57d00f3feaf63ea4cf 100755 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mvc/templates/500.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mvc/templates/500.php @@ -1,9 +1,9 @@ <html> <head> - <title>Error 500 <?php echo_h($message) ?></title> + <title>Error 500 <?php esc_html_e($message) ?></title> </head> <body> - <h1>Error: <?php echo_h($message) ?></h1> + <h1>Error: <?php esc_html_e($message) ?></h1> <p>You requested something the server doesn't understand.</p> </body> </html> \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/module.nextgen_addgallery_page.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/module.nextgen_addgallery_page.php index 7ac8e67b50bc2e5757a231b82b59bc6af5c3ffe3..bff58b140f9b75c3d384c1c6c7370e066c66e612 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/module.nextgen_addgallery_page.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/module.nextgen_addgallery_page.php @@ -21,14 +21,26 @@ class M_NextGen_AddGallery_Page extends C_Base_Module 'http://www.photocrati.com' ); } + + function initialize() + { + $forms = C_Form_Manager::get_instance(); + $settings = C_NextGen_Settings::get_instance(); + $forms->add_form(NGG_ADD_GALLERY_SLUG, 'upload_images'); + if (!is_multisite() || (is_multisite() && $settings->get('wpmuImportFolder'))) + { + $forms->add_form(NGG_ADD_GALLERY_SLUG, 'import_media_library'); + $forms->add_form(NGG_ADD_GALLERY_SLUG, 'import_folder'); + } + } function get_type_list() { return array( + 'A_Import_Media_Library_Form' => 'adapter.import_media_library_form.php', 'A_Import_Folder_Form' => 'adapter.import_folder_form.php', 'A_Nextgen_Addgallery_Ajax' => 'adapter.nextgen_addgallery_ajax.php', 'A_Nextgen_Addgallery_Controller' => 'adapter.nextgen_addgallery_controller.php', - 'A_Nextgen_Addgallery_Forms' => 'adapter.nextgen_addgallery_forms.php', 'A_Nextgen_Addgallery_Pages' => 'adapter.nextgen_addgallery_pages.php', 'A_Upload_Images_Form' => 'adapter.upload_images_form.php', ); @@ -36,9 +48,19 @@ class M_NextGen_AddGallery_Page extends C_Base_Module function _register_adapters() { - $this->get_registry()->add_adapter('I_Page_Manager', 'A_NextGen_AddGallery_Pages'); - $this->get_registry()->add_adapter('I_Form_Manager', 'A_NextGen_AddGallery_Forms'); + // AJAX operations aren't admin requests $this->get_registry()->add_adapter('I_Ajax_Controller', 'A_NextGen_AddGallery_Ajax'); + + if (is_admin()) { + $this->get_registry()->add_adapter('I_Page_Manager', 'A_NextGen_AddGallery_Pages'); + $this->get_registry()->add_adapter('I_NextGen_Admin_Page', 'A_NextGen_AddGallery_Controller', NGG_ADD_GALLERY_SLUG); + $this->get_registry()->add_adapter('I_Form', 'A_Upload_Images_Form', 'upload_images'); + if (!is_multisite() || (is_multisite() && C_NextGen_Settings::get_instance()->get('wpmuImportFolder'))) + { + $this->get_registry()->add_adapter('I_Form', 'A_Import_Folder_Form', 'import_folder'); + $this->get_registry()->add_adapter('I_Form', 'A_Import_Media_Library_Form', 'import_media_library'); + } + } } function _register_hooks() @@ -48,16 +70,53 @@ class M_NextGen_AddGallery_Page extends C_Base_Module function register_scripts() { - if (is_admin()) { - $router = $this->_get_registry()->get_utility('I_Router'); - wp_register_script('browserplus', $router->get_static_url('photocrati-nextgen_addgallery_page#browserplus-2.4.21.min.js')); - wp_register_script('ngg.plupload.moxie', $router->get_static_url('photocrati-nextgen_addgallery_page#plupload-2.1.1/moxie.min.js')); - wp_register_script('ngg.plupload.full', $router->get_static_url('photocrati-nextgen_addgallery_page#plupload-2.1.1/plupload.full.min.js'), array('ngg.plupload.moxie')); - wp_register_script('ngg.plupload.queue', $router->get_static_url('photocrati-nextgen_addgallery_page#plupload-2.1.1/jquery.plupload.queue/jquery.plupload.queue.min.js'), array('ngg.plupload.full')); - wp_register_style('ngg.plupload.queue', $router->get_static_url('photocrati-nextgen_addgallery_page#plupload-2.1.1/jquery.plupload.queue/css/jquery.plupload.queue.css')); - wp_register_style('nextgen_addgallery_page', $router->get_static_url('photocrati-nextgen_addgallery_page#styles.css')); - wp_register_script('jquery.filetree', $router->get_static_url('photocrati-nextgen_addgallery_page#jquery.filetree/jquery.filetree.js'), array('jquery')); - wp_register_style('jquery.filetree', $router->get_static_url('photocrati-nextgen_addgallery_page#jquery.filetree/jquery.filetree.css')); + if (is_admin()) + { + $router = C_Router::get_instance(); + wp_register_script( + 'browserplus', + $router->get_static_url('photocrati-nextgen_addgallery_page#browserplus-2.4.21.min.js') + ); + wp_register_script( + 'ngg.plupload.moxie', + $router->get_static_url('photocrati-nextgen_addgallery_page#plupload-2.1.1/moxie.min.js') + ); + wp_register_script( + 'ngg.plupload.full', + $router->get_static_url('photocrati-nextgen_addgallery_page#plupload-2.1.1/plupload.dev.min.js'), + array('ngg.plupload.moxie') + ); + wp_register_script( + 'ngg.plupload.queue', + $router->get_static_url('photocrati-nextgen_addgallery_page#plupload-2.1.1/jquery.plupload.queue/jquery.plupload.queue.min.js'), + array('ngg.plupload.full') + ); + wp_register_style( + 'ngg.plupload.queue', + $router->get_static_url('photocrati-nextgen_addgallery_page#plupload-2.1.1/jquery.plupload.queue/css/jquery.plupload.queue.css') + ); + wp_register_style( + 'nextgen_addgallery_page', + $router->get_static_url('photocrati-nextgen_addgallery_page#styles.css') + ); + wp_register_script( + 'jquery.filetree', + $router->get_static_url('photocrati-nextgen_addgallery_page#jquery.filetree/jquery.filetree.js'), + array('jquery') + ); + wp_register_style( + 'jquery.filetree', + $router->get_static_url('photocrati-nextgen_addgallery_page#jquery.filetree/jquery.filetree.css') + ); + wp_register_script( + 'nextgen_media_library_import-js', + $router->get_static_url('photocrati-nextgen_addgallery_page#media-library-import.js'), + array('jquery', 'ngg_progressbar') + ); + wp_register_style( + 'nextgen_media_library_import-css', + $router->get_static_url('photocrati-nextgen_addgallery_page#media-library-import.css') + ); } } } diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/package.module.nextgen_addgallery_page.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/package.module.nextgen_addgallery_page.php new file mode 100644 index 0000000000000000000000000000000000000000..aec54b2a20504f12df6e4b61868ad6f60f7c1501 --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/package.module.nextgen_addgallery_page.php @@ -0,0 +1,426 @@ +<?php +class A_Import_Folder_Form extends Mixin +{ + public function get_title() + { + return __('Import Folder', 'nggallery'); + } + public function enqueue_static_resources() + { + wp_enqueue_style('jquery.filetree'); + wp_enqueue_style('ngg_progressbar'); + wp_enqueue_script('jquery.filetree'); + wp_enqueue_script('ngg_progressbar'); + } + public function render() + { + return $this->object->render_partial('photocrati-nextgen_addgallery_page#import_folder', array('browse_sec_token' => C_WordPress_Security_Manager::get_instance()->get_request_token('nextgen_upload_image'), 'import_sec_token' => C_WordPress_Security_Manager::get_instance()->get_request_token('nextgen_upload_image')), TRUE); + } +} +class A_Import_Media_Library_Form extends Mixin +{ + public function get_title() + { + return __('Import from WordPress Media Library', 'nggallery'); + } + public function enqueue_static_resources() + { + wp_enqueue_media(); + wp_enqueue_script('nextgen_media_library_import-js'); + wp_enqueue_style('nextgen_media_library_import-css'); + $i18n_array = array('title' => __('Import Images into NextGen Gallery', 'nggallery'), 'import_multiple' => __('Import %s images', 'nggallery'), 'import_singular' => __('Import 1 image', 'nggallery'), 'imported_multiple' => __('%s images were uploaded successfully', 'nggallery'), 'imported_singular' => __('1 image was uploaded successfully', 'nggallery'), 'imported_none' => __('0 images were uploaded', 'nggallery'), 'progress_title' => __('Importing gallery', 'nggallery'), 'in_progress' => __('In Progress...', 'nggallery'), 'gritter_title' => __('Upload complete', 'nggallery'), 'gritter_error' => __('An unexpected error occured. This is most likely due to a server misconfiguration. Check your PHP error log or ask your hosting provider for assistance.', 'nggallery')); + foreach (C_WordPress_Security_Manager::get_instance()->get_request_token('nextgen_upload_image')->get_request_list() as $name => $value) { + $i18n_array['sectoken'][$name] = $value; + } + wp_localize_script('nextgen_media_library_import-js', 'ngg_importml_i18n', $i18n_array); + } + public function render() + { + $i18n = array('select-images-to-continue' => __('Please make a selection to continue', 'nggallery'), 'select-opener' => __('Select images', 'nggallery'), 'selected-image-import' => __('Import %d image(s)', 'nggallery')); + return $this->object->render_partial('photocrati-nextgen_addgallery_page#import_media_library', array('i18n' => $i18n, 'galleries' => $this->object->get_galleries()), TRUE); + } + public function get_galleries() + { + $security = $this->get_registry()->get_utility('I_Security_Manager'); + $sec_actor = $security->get_current_actor(); + $galleries = array(); + if ($sec_actor->is_allowed('nextgen_edit_gallery')) { + $galleries = C_Gallery_Mapper::get_instance()->find_all(); + if (!$sec_actor->is_allowed('nextgen_edit_gallery_unowned')) { + $galleries_all = $galleries; + $galleries = array(); + foreach ($galleries_all as $gallery) { + if ($sec_actor->is_user() && $sec_actor->get_entity_id() == (int) $gallery->author) { + $galleries[] = $gallery; + } + } + } + } + return $galleries; + } +} +class A_NextGen_AddGallery_Ajax extends Mixin +{ + public function cookie_dump_action() + { + foreach ($_COOKIE as $key => &$value) { + if (is_string($value)) { + $value = stripslashes($value); + } + } + return array('success' => 1, 'cookies' => $_COOKIE); + } + public function upload_image_action() + { + $retval = array(); + $created_gallery = FALSE; + $gallery_id = intval($this->param('gallery_id')); + $gallery_name = urldecode($this->param('gallery_name')); + $gallery_mapper = C_Gallery_Mapper::get_instance(); + $error = FALSE; + if ($this->validate_ajax_request('nextgen_upload_image', TRUE)) { + // We need to create a gallery + if ($gallery_id == 0) { + if (strlen($gallery_name) > 0) { + $gallery = $gallery_mapper->create(array('title' => $gallery_name)); + if (!$gallery->save()) { + $retval['error'] = $gallery->get_errors(); + $error = TRUE; + } else { + $created_gallery = TRUE; + $gallery_id = $gallery->id(); + } + } else { + $error = TRUE; + $retval['error'] = __('No gallery name specified', 'nggallery'); + } + } + // Upload the image to the gallery + if (!$error) { + $retval['gallery_id'] = $gallery_id; + $storage = C_Gallery_Storage::get_instance(); + try { + if ($storage->is_zip()) { + if ($results = $storage->upload_zip($gallery_id)) { + $retval = $results; + } else { + $retval['error'] = __('Failed to extract images from ZIP', 'nggallery'); + } + } elseif ($image = $storage->upload_image($gallery_id)) { + $retval['image_ids'] = array($image->id()); + } else { + $retval['error'] = __('Image generation failed', 'nggallery'); + $error = TRUE; + } + } catch (E_NggErrorException $ex) { + $retval['error'] = $ex->getMessage(); + $error = TRUE; + if ($created_gallery) { + $gallery_mapper->destroy($gallery_id); + } + } catch (Exception $ex) { + $retval['error'] = __('An unexpected error occured.', 'nggallery'); + $retval['error_details'] = $ex->getMessage(); + $error = TRUE; + } + } + } else { + $retval['error'] = __('No permissions to upload images. Try refreshing the page or ensuring that your user account has sufficient roles/privileges.', 'nggallery'); + $error = TRUE; + } + if ($error) { + return $retval; + } else { + $retval['gallery_name'] = esc_html($gallery_name); + } + return $retval; + } + public function get_import_root_abspath() + { + if (is_multisite()) { + $root = C_Gallery_Storage::get_instance()->get_upload_abspath(); + } else { + $root = NGG_IMPORT_ROOT; + } + $root = str_replace('/', DIRECTORY_SEPARATOR, $root); + return untrailingslashit($root); + } + public function browse_folder_action() + { + $retval = array(); + $html = array(); + if ($this->validate_ajax_request('nextgen_upload_image', TRUE)) { + if ($dir = urldecode($this->param('dir'))) { + $fs = C_Fs::get_instance(); + $root = $this->get_import_root_abspath(); + if ($dir != '.' && $dir != '..') { + $browse_path = $fs->join_paths($root, $dir); + if (@file_exists($browse_path)) { + $files = scandir($browse_path); + natcasesort($files); + if (count($files) > 2) { + /* The 2 accounts for . and .. */ + $html[] = '<ul class="jqueryFileTree" style="display: none;">'; + foreach ($files as $file) { + $file_path = $fs->join_paths($browse_path, $file); + $rel_file_path = str_replace($root, '', $file_path); + if (@file_exists($file_path) && $file != '.' && $file != '..' && is_dir($file_path)) { + $html[] = '<li class="directory collapsed"><a href="#" rel="' . htmlentities($rel_file_path) . '/">' . htmlentities($file) . '</a></li>'; + } + } + $html[] = '</ul>'; + } + $retval['html'] = implode(' +', $html); + } else { + $retval['error'] = __('Directory does not exist.', 'nggallery'); + } + } else { + $retval['error'] = __('No permissions to browse folders. Try refreshing the page or ensuring that your user account has sufficient roles/privileges.', 'nggallery'); + } + } else { + $retval['error'] = __('No directory specified.', 'nggallery'); + } + } else { + $retval['error'] = __('No permissions to browse folders. Try refreshing the page or ensuring that your user account has sufficient roles/privileges.', 'nggallery'); + } + return $retval; + } + public function import_folder_action() + { + $retval = array(); + if ($this->validate_ajax_request('nextgen_upload_image', TRUE)) { + if ($folder = $this->param('folder')) { + $storage = C_Gallery_Storage::get_instance(); + $fs = C_Fs::get_instance(); + try { + $keep_files = $this->param('keep_location') == 'on'; + $root = $this->get_import_root_abspath(); + if ($folder != '.' && $folder != '..') { + $import_path = $fs->join_paths($root, $folder); + $retval = $storage->import_gallery_from_fs($import_path, FALSE, !$keep_files); + if (!$retval) { + $retval = array('error' => 'Could not import folder. No images found.'); + } + } else { + $retval['error'] = __('No permissions to import folders. Try refreshing the page or ensuring that your user account has sufficient roles/privileges.', 'nggallery'); + } + } catch (E_NggErrorException $ex) { + $retval['error'] = $ex->getMessage(); + } catch (Exception $ex) { + $retval['error'] = __('An unexpected error occured.', 'nggallery'); + $retval['error_details'] = $ex->getMessage(); + } + } else { + $retval['error'] = __('No folder specified', 'nggallery'); + } + } else { + $retval['error'] = __('No permissions to import folders. Try refreshing the page or ensuring that your user account has sufficient roles/privileges.', 'nggallery'); + } + return $retval; + } + public function import_media_library_action() + { + $retval = array(); + $created_gallery = FALSE; + $gallery_id = intval($this->param('gallery_id')); + $gallery_name = urldecode($this->param('gallery_name')); + $gallery_mapper = C_Gallery_Mapper::get_instance(); + $image_mapper = C_Image_Mapper::get_instance(); + $attachment_ids = $this->param('attachment_ids'); + if ($this->validate_ajax_request('nextgen_upload_image', TRUE)) { + if (empty($attachment_ids) || !is_array($attachment_ids)) { + $retval['error'] = __('An unexpected error occured.', 'nggallery'); + } + if (empty($retval['error']) && $gallery_id == 0) { + if (strlen($gallery_name) > 0) { + $gallery = $gallery_mapper->create(array('title' => $gallery_name)); + if (!$gallery->save()) { + $retval['error'] = $gallery->get_errors(); + } else { + $created_gallery = TRUE; + $gallery_id = $gallery->id(); + } + } else { + $retval['error'] = __('No gallery name specified', 'nggallery'); + } + } + if (empty($retval['error'])) { + $retval['gallery_id'] = $gallery_id; + $storage = C_Gallery_Storage::get_instance(); + foreach ($attachment_ids as $id) { + try { + $abspath = get_attached_file($id); + $file_data = @file_get_contents($abspath); + $file_name = M_I18n::mb_basename($abspath); + $attachment = get_post($id); + if (empty($file_data)) { + $retval['error'] = __('Image generation failed', 'nggallery'); + break; + } + $image = $storage->upload_base64_image($gallery_id, $file_data, $file_name); + if ($image) { + // Potentially import metadata from WordPress + $image = $image_mapper->find($image->id()); + if (!empty($attachment->post_excerpt)) { + $image->alttext = $attachment->post_excerpt; + } + if (!empty($attachment->post_content)) { + $image->description = $attachment->post_content; + } + $image = apply_filters('ngg_medialibrary_imported_image', $image, $attachment); + $image_mapper->save($image); + } else { + $retval['error'] = __('Image generation failed', 'nggallery'); + break; + } + $retval['image_ids'][] = $image->{$image->id_field}; + } catch (E_NggErrorException $ex) { + $retval['error'] = $ex->getMessage(); + if ($created_gallery) { + $gallery_mapper->destroy($gallery_id); + } + } catch (Exception $ex) { + $retval['error'] = __('An unexpected error occured.', 'nggallery'); + $retval['error_details'] = $ex->getMessage(); + } + } + } + } else { + $retval['error'] = __('No permissions to upload images. Try refreshing the page or ensuring that your user account has sufficient roles/privileges.', 'nggallery'); + } + if (!empty($retval['error'])) { + return $retval; + } else { + $retval['gallery_name'] = esc_html($gallery_name); + } + return $retval; + } +} +class A_NextGen_AddGallery_Controller extends Mixin +{ + public function get_page_title() + { + return __('Add Gallery / Images', 'nggallery'); + } + public function get_required_permission() + { + return 'NextGEN Upload images'; + } + public function enqueue_backend_resources() + { + $this->call_parent('enqueue_backend_resources'); + wp_enqueue_style('nextgen_addgallery_page'); + wp_enqueue_script('nextgen_addgallery_page'); + wp_enqueue_script('frame_event_publisher'); + } + public function show_save_button() + { + return FALSE; + } +} +class A_NextGen_AddGallery_Pages extends Mixin +{ + public function setup() + { + $this->object->add(NGG_ADD_GALLERY_SLUG, array('adapter' => 'A_NextGen_AddGallery_Controller', 'parent' => NGGFOLDER, 'add_menu' => TRUE, 'before' => 'nggallery-manage-gallery')); + return $this->call_parent('setup'); + } +} +class A_Upload_Images_Form extends Mixin +{ + public function get_title() + { + return __('Upload Images', 'nggallery'); + } + /** + * Plupload stores its i18n JS *mostly* as "en.js" or "ar.js" - but some as zh_CN.js so we must check both if the + * first does not match. + * + * @return bool|string + */ + public function _find_plupload_i18n() + { + $fs = C_Fs::get_instance(); + $router = C_Router::get_instance(); + $locale = get_locale(); + $dir = $fs->find_static_abspath('photocrati-nextgen_addgallery_page#plupload-2.1.1/i18n') . DIRECTORY_SEPARATOR; + $tmp = explode('_', $locale, 2); + $retval = FALSE; + if (file_exists($dir . $tmp[0] . '.js')) { + $retval = $tmp[0]; + } else { + if (file_exists($dir . $locale . '.js')) { + $retval = $locale; + } + } + if ($retval) { + $retval = $router->get_static_url('photocrati-nextgen_addgallery_page#plupload-2.1.1/i18n/' . $retval . '.js'); + } + return $retval; + } + public function enqueue_static_resources() + { + wp_enqueue_style('ngg.plupload.queue'); + wp_enqueue_script('browserplus'); + wp_enqueue_script('ngg.plupload.queue'); + $i18n = $this->_find_plupload_i18n(); + if (!empty($i18n)) { + wp_enqueue_script('ngg.plupload.i18n', $i18n, array('ngg.plupload.full')); + } + } + public function render() + { + return $this->object->render_partial('photocrati-nextgen_addgallery_page#upload_images', array('plupload_options' => json_encode($this->object->get_plupload_options()), 'galleries' => $this->object->get_galleries(), 'sec_token' => C_WordPress_Security_Manager::get_instance()->get_request_token('nextgen_upload_image')), TRUE); + } + public function get_plupload_options() + { + $retval = array(); + $retval['runtimes'] = 'gears,browserplus,html5,flash,silverlight,html4'; + $retval['max_file_size'] = strval(round((int) wp_max_upload_size() / 1024)) . 'kb'; + $retval['filters'] = $this->object->get_plupload_filters(); + $retval['flash_swf_url'] = includes_url('js/plupload/plupload.flash.swf'); + $retval['silverlight_xap_url'] = includes_url('js/plupload/plupload.silverlight.xap'); + $retval['debug'] = TRUE; + $retval['prevent_duplicates'] = TRUE; + return $retval; + } + public function get_plupload_filters() + { + $retval = new stdClass(); + $retval->mime_types = array(); + $imgs = new stdClass(); + $imgs->title = 'Image files'; + $imgs->extensions = 'jpg,jpeg,gif,png,JPG,JPEG,GIF,PNG'; + $retval->mime_types[] = $imgs; + $settings = C_NextGen_Settings::get_instance(); + if (!is_multisite() || is_multisite() && $settings->get('wpmuZipUpload')) { + $zips = new stdClass(); + $zips->title = 'Zip files'; + $zips->extensions = 'zip,ZIP'; + $retval->mime_types[] = $zips; + } + $retval->xss_protection = TRUE; + return $retval; + } + public function get_galleries() + { + $security = $this->get_registry()->get_utility('I_Security_Manager'); + $sec_actor = $security->get_current_actor(); + $galleries = array(); + if ($sec_actor->is_allowed('nextgen_edit_gallery')) { + $gallery_mapper = C_Gallery_Mapper::get_instance(); + $galleries = $gallery_mapper->find_all(); + if (!$sec_actor->is_allowed('nextgen_edit_gallery_unowned')) { + $galleries_all = $galleries; + $galleries = array(); + foreach ($galleries_all as $gallery) { + if ($sec_actor->is_user() && $sec_actor->get_entity_id() == (int) $gallery->author) { + $galleries[] = $gallery; + } + } + } + } + return $galleries; + } +} \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/jquery.filetree/jquery.filetree.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/jquery.filetree/jquery.filetree.css index aaed0443c1a4e65a6e4311ab0fe92d96db7195bf..db969e2de0ec5399af3375e93bc7d818eaeb8a53 100755 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/jquery.filetree/jquery.filetree.css +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/jquery.filetree/jquery.filetree.css @@ -1,95 +1,95 @@ -UL.jqueryFileTree { - font-family: Verdana, sans-serif; - font-size: 11px; - line-height: 18px; - padding: 0px; - margin: 0px; -} - -UL.jqueryFileTree LI { - list-style: none; - padding: 0px; - padding-left: 20px; - margin: 0px; - white-space: nowrap; -} - -UL.jqueryFileTree A { - color: #333; - text-decoration: none; - display: block; - padding: 0px 2px; -} - -UL.jqueryFileTree A:hover { - background: #BDF; -} - -UL.jqueryFileTree A.selected_folder { - background-color: #EEEEEE; -} - -/* Core Styles */ -.jqueryFileTree LI.directory { background: url(images/directory.png) left top no-repeat; } -.jqueryFileTree LI.expanded { background: url(images/folder_open.png) left top no-repeat; } -.jqueryFileTree LI.file { background: url(images/file.png) left top no-repeat; } -.jqueryFileTree LI.wait { background: url(images/spinner.gif) left top no-repeat; } -/* File Extensions*/ -.jqueryFileTree LI.ext_3gp { background: url(images/film.png) left top no-repeat; } -.jqueryFileTree LI.ext_afp { background: url(images/code.png) left top no-repeat; } -.jqueryFileTree LI.ext_afpa { background: url(images/code.png) left top no-repeat; } -.jqueryFileTree LI.ext_asp { background: url(images/code.png) left top no-repeat; } -.jqueryFileTree LI.ext_aspx { background: url(images/code.png) left top no-repeat; } -.jqueryFileTree LI.ext_avi { background: url(images/film.png) left top no-repeat; } -.jqueryFileTree LI.ext_bat { background: url(images/application.png) left top no-repeat; } -.jqueryFileTree LI.ext_bmp { background: url(images/picture.png) left top no-repeat; } -.jqueryFileTree LI.ext_c { background: url(images/code.png) left top no-repeat; } -.jqueryFileTree LI.ext_cfm { background: url(images/code.png) left top no-repeat; } -.jqueryFileTree LI.ext_cgi { background: url(images/code.png) left top no-repeat; } -.jqueryFileTree LI.ext_com { background: url(images/application.png) left top no-repeat; } -.jqueryFileTree LI.ext_cpp { background: url(images/code.png) left top no-repeat; } -.jqueryFileTree LI.ext_css { background: url(images/css.png) left top no-repeat; } -.jqueryFileTree LI.ext_doc { background: url(images/doc.png) left top no-repeat; } -.jqueryFileTree LI.ext_exe { background: url(images/application.png) left top no-repeat; } -.jqueryFileTree LI.ext_gif { background: url(images/picture.png) left top no-repeat; } -.jqueryFileTree LI.ext_fla { background: url(images/flash.png) left top no-repeat; } -.jqueryFileTree LI.ext_h { background: url(images/code.png) left top no-repeat; } -.jqueryFileTree LI.ext_htm { background: url(images/html.png) left top no-repeat; } -.jqueryFileTree LI.ext_html { background: url(images/html.png) left top no-repeat; } -.jqueryFileTree LI.ext_jar { background: url(images/java.png) left top no-repeat; } -.jqueryFileTree LI.ext_jpg { background: url(images/picture.png) left top no-repeat; } -.jqueryFileTree LI.ext_jpeg { background: url(images/picture.png) left top no-repeat; } -.jqueryFileTree LI.ext_js { background: url(images/script.png) left top no-repeat; } -.jqueryFileTree LI.ext_lasso { background: url(images/code.png) left top no-repeat; } -.jqueryFileTree LI.ext_log { background: url(images/txt.png) left top no-repeat; } -.jqueryFileTree LI.ext_m4p { background: url(images/music.png) left top no-repeat; } -.jqueryFileTree LI.ext_mov { background: url(images/film.png) left top no-repeat; } -.jqueryFileTree LI.ext_mp3 { background: url(images/music.png) left top no-repeat; } -.jqueryFileTree LI.ext_mp4 { background: url(images/film.png) left top no-repeat; } -.jqueryFileTree LI.ext_mpg { background: url(images/film.png) left top no-repeat; } -.jqueryFileTree LI.ext_mpeg { background: url(images/film.png) left top no-repeat; } -.jqueryFileTree LI.ext_ogg { background: url(images/music.png) left top no-repeat; } -.jqueryFileTree LI.ext_pcx { background: url(images/picture.png) left top no-repeat; } -.jqueryFileTree LI.ext_pdf { background: url(images/pdf.png) left top no-repeat; } -.jqueryFileTree LI.ext_php { background: url(images/php.png) left top no-repeat; } -.jqueryFileTree LI.ext_png { background: url(images/picture.png) left top no-repeat; } -.jqueryFileTree LI.ext_ppt { background: url(images/ppt.png) left top no-repeat; } -.jqueryFileTree LI.ext_psd { background: url(images/psd.png) left top no-repeat; } -.jqueryFileTree LI.ext_pl { background: url(images/script.png) left top no-repeat; } -.jqueryFileTree LI.ext_py { background: url(images/script.png) left top no-repeat; } -.jqueryFileTree LI.ext_rb { background: url(images/ruby.png) left top no-repeat; } -.jqueryFileTree LI.ext_rbx { background: url(images/ruby.png) left top no-repeat; } -.jqueryFileTree LI.ext_rhtml { background: url(images/ruby.png) left top no-repeat; } -.jqueryFileTree LI.ext_rpm { background: url(images/linux.png) left top no-repeat; } -.jqueryFileTree LI.ext_ruby { background: url(images/ruby.png) left top no-repeat; } -.jqueryFileTree LI.ext_sql { background: url(images/db.png) left top no-repeat; } -.jqueryFileTree LI.ext_swf { background: url(images/flash.png) left top no-repeat; } -.jqueryFileTree LI.ext_tif { background: url(images/picture.png) left top no-repeat; } -.jqueryFileTree LI.ext_tiff { background: url(images/picture.png) left top no-repeat; } -.jqueryFileTree LI.ext_txt { background: url(images/txt.png) left top no-repeat; } -.jqueryFileTree LI.ext_vb { background: url(images/code.png) left top no-repeat; } -.jqueryFileTree LI.ext_wav { background: url(images/music.png) left top no-repeat; } -.jqueryFileTree LI.ext_wmv { background: url(images/film.png) left top no-repeat; } -.jqueryFileTree LI.ext_xls { background: url(images/xls.png) left top no-repeat; } -.jqueryFileTree LI.ext_xml { background: url(images/code.png) left top no-repeat; } +UL.jqueryFileTree { + font-family: Verdana, sans-serif; + font-size: 11px; + line-height: 18px; + padding: 0px; + margin: 0px; +} + +UL.jqueryFileTree LI { + list-style: none; + padding: 0px; + padding-left: 20px; + margin: 0px; + white-space: nowrap; +} + +UL.jqueryFileTree A { + color: #333; + text-decoration: none; + display: block; + padding: 0px 2px; +} + +UL.jqueryFileTree A:hover { + background: #BDF; +} + +UL.jqueryFileTree A.selected_folder { + background-color: #EEEEEE; +} + +/* Core Styles */ +.jqueryFileTree LI.directory { background: url(images/directory.png) left top no-repeat; } +.jqueryFileTree LI.expanded { background: url(images/folder_open.png) left top no-repeat; } +.jqueryFileTree LI.file { background: url(images/file.png) left top no-repeat; } +.jqueryFileTree LI.wait { background: url(images/spinner.gif) left top no-repeat; } +/* File Extensions*/ +.jqueryFileTree LI.ext_3gp { background: url(images/film.png) left top no-repeat; } +.jqueryFileTree LI.ext_afp { background: url(images/code.png) left top no-repeat; } +.jqueryFileTree LI.ext_afpa { background: url(images/code.png) left top no-repeat; } +.jqueryFileTree LI.ext_asp { background: url(images/code.png) left top no-repeat; } +.jqueryFileTree LI.ext_aspx { background: url(images/code.png) left top no-repeat; } +.jqueryFileTree LI.ext_avi { background: url(images/film.png) left top no-repeat; } +.jqueryFileTree LI.ext_bat { background: url(images/application.png) left top no-repeat; } +.jqueryFileTree LI.ext_bmp { background: url(images/picture.png) left top no-repeat; } +.jqueryFileTree LI.ext_c { background: url(images/code.png) left top no-repeat; } +.jqueryFileTree LI.ext_cfm { background: url(images/code.png) left top no-repeat; } +.jqueryFileTree LI.ext_cgi { background: url(images/code.png) left top no-repeat; } +.jqueryFileTree LI.ext_com { background: url(images/application.png) left top no-repeat; } +.jqueryFileTree LI.ext_cpp { background: url(images/code.png) left top no-repeat; } +.jqueryFileTree LI.ext_css { background: url(images/css.png) left top no-repeat; } +.jqueryFileTree LI.ext_doc { background: url(images/doc.png) left top no-repeat; } +.jqueryFileTree LI.ext_exe { background: url(images/application.png) left top no-repeat; } +.jqueryFileTree LI.ext_gif { background: url(images/picture.png) left top no-repeat; } +.jqueryFileTree LI.ext_fla { background: url(images/flash.png) left top no-repeat; } +.jqueryFileTree LI.ext_h { background: url(images/code.png) left top no-repeat; } +.jqueryFileTree LI.ext_htm { background: url(images/html.png) left top no-repeat; } +.jqueryFileTree LI.ext_html { background: url(images/html.png) left top no-repeat; } +.jqueryFileTree LI.ext_jar { background: url(images/java.png) left top no-repeat; } +.jqueryFileTree LI.ext_jpg { background: url(images/picture.png) left top no-repeat; } +.jqueryFileTree LI.ext_jpeg { background: url(images/picture.png) left top no-repeat; } +.jqueryFileTree LI.ext_js { background: url(images/script.png) left top no-repeat; } +.jqueryFileTree LI.ext_lasso { background: url(images/code.png) left top no-repeat; } +.jqueryFileTree LI.ext_log { background: url(images/txt.png) left top no-repeat; } +.jqueryFileTree LI.ext_m4p { background: url(images/music.png) left top no-repeat; } +.jqueryFileTree LI.ext_mov { background: url(images/film.png) left top no-repeat; } +.jqueryFileTree LI.ext_mp3 { background: url(images/music.png) left top no-repeat; } +.jqueryFileTree LI.ext_mp4 { background: url(images/film.png) left top no-repeat; } +.jqueryFileTree LI.ext_mpg { background: url(images/film.png) left top no-repeat; } +.jqueryFileTree LI.ext_mpeg { background: url(images/film.png) left top no-repeat; } +.jqueryFileTree LI.ext_ogg { background: url(images/music.png) left top no-repeat; } +.jqueryFileTree LI.ext_pcx { background: url(images/picture.png) left top no-repeat; } +.jqueryFileTree LI.ext_pdf { background: url(images/pdf.png) left top no-repeat; } +.jqueryFileTree LI.ext_php { background: url(images/php.png) left top no-repeat; } +.jqueryFileTree LI.ext_png { background: url(images/picture.png) left top no-repeat; } +.jqueryFileTree LI.ext_ppt { background: url(images/ppt.png) left top no-repeat; } +.jqueryFileTree LI.ext_psd { background: url(images/psd.png) left top no-repeat; } +.jqueryFileTree LI.ext_pl { background: url(images/script.png) left top no-repeat; } +.jqueryFileTree LI.ext_py { background: url(images/script.png) left top no-repeat; } +.jqueryFileTree LI.ext_rb { background: url(images/ruby.png) left top no-repeat; } +.jqueryFileTree LI.ext_rbx { background: url(images/ruby.png) left top no-repeat; } +.jqueryFileTree LI.ext_rhtml { background: url(images/ruby.png) left top no-repeat; } +.jqueryFileTree LI.ext_rpm { background: url(images/linux.png) left top no-repeat; } +.jqueryFileTree LI.ext_ruby { background: url(images/ruby.png) left top no-repeat; } +.jqueryFileTree LI.ext_sql { background: url(images/db.png) left top no-repeat; } +.jqueryFileTree LI.ext_swf { background: url(images/flash.png) left top no-repeat; } +.jqueryFileTree LI.ext_tif { background: url(images/picture.png) left top no-repeat; } +.jqueryFileTree LI.ext_tiff { background: url(images/picture.png) left top no-repeat; } +.jqueryFileTree LI.ext_txt { background: url(images/txt.png) left top no-repeat; } +.jqueryFileTree LI.ext_vb { background: url(images/code.png) left top no-repeat; } +.jqueryFileTree LI.ext_wav { background: url(images/music.png) left top no-repeat; } +.jqueryFileTree LI.ext_wmv { background: url(images/film.png) left top no-repeat; } +.jqueryFileTree LI.ext_xls { background: url(images/xls.png) left top no-repeat; } +.jqueryFileTree LI.ext_xml { background: url(images/code.png) left top no-repeat; } .jqueryFileTree LI.ext_zip { background: url(images/zip.png) left top no-repeat; } \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/jquery.filetree/jquery.filetree.min.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/jquery.filetree/jquery.filetree.min.css new file mode 100644 index 0000000000000000000000000000000000000000..85f34f9e730acb184f84cf9ebe662e8e35dd1c30 --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/jquery.filetree/jquery.filetree.min.css @@ -0,0 +1 @@ +UL.jqueryFileTree{font-family:Verdana,sans-serif;font-size:11px;line-height:18px;padding:0;margin:0}UL.jqueryFileTree LI{list-style:none;padding:0;padding-left:20px;margin:0;white-space:nowrap}UL.jqueryFileTree A{color:#333;text-decoration:none;display:block;padding:0 2px}UL.jqueryFileTree A:hover{background:#BDF}UL.jqueryFileTree A.selected_folder{background-color:#eee}.jqueryFileTree LI.directory{background:url(images/directory.png) left top no-repeat}.jqueryFileTree LI.expanded{background:url(images/folder_open.png) left top no-repeat}.jqueryFileTree LI.file{background:url(images/file.png) left top no-repeat}.jqueryFileTree LI.wait{background:url(images/spinner.gif) left top no-repeat}.jqueryFileTree LI.ext_3gp{background:url(images/film.png) left top no-repeat}.jqueryFileTree LI.ext_afp{background:url(images/code.png) left top no-repeat}.jqueryFileTree LI.ext_afpa{background:url(images/code.png) left top no-repeat}.jqueryFileTree LI.ext_asp{background:url(images/code.png) left top no-repeat}.jqueryFileTree LI.ext_aspx{background:url(images/code.png) left top no-repeat}.jqueryFileTree LI.ext_avi{background:url(images/film.png) left top no-repeat}.jqueryFileTree LI.ext_bat{background:url(images/application.png) left top no-repeat}.jqueryFileTree LI.ext_bmp{background:url(images/picture.png) left top no-repeat}.jqueryFileTree LI.ext_c{background:url(images/code.png) left top no-repeat}.jqueryFileTree LI.ext_cfm{background:url(images/code.png) left top no-repeat}.jqueryFileTree LI.ext_cgi{background:url(images/code.png) left top no-repeat}.jqueryFileTree LI.ext_com{background:url(images/application.png) left top no-repeat}.jqueryFileTree LI.ext_cpp{background:url(images/code.png) left top no-repeat}.jqueryFileTree LI.ext_css{background:url(images/css.png) left top no-repeat}.jqueryFileTree LI.ext_doc{background:url(images/doc.png) left top no-repeat}.jqueryFileTree LI.ext_exe{background:url(images/application.png) left top no-repeat}.jqueryFileTree LI.ext_gif{background:url(images/picture.png) left top no-repeat}.jqueryFileTree LI.ext_fla{background:url(images/flash.png) left top no-repeat}.jqueryFileTree LI.ext_h{background:url(images/code.png) left top no-repeat}.jqueryFileTree LI.ext_htm{background:url(images/html.png) left top no-repeat}.jqueryFileTree LI.ext_html{background:url(images/html.png) left top no-repeat}.jqueryFileTree LI.ext_jar{background:url(images/java.png) left top no-repeat}.jqueryFileTree LI.ext_jpg{background:url(images/picture.png) left top no-repeat}.jqueryFileTree LI.ext_jpeg{background:url(images/picture.png) left top no-repeat}.jqueryFileTree LI.ext_js{background:url(images/script.png) left top no-repeat}.jqueryFileTree LI.ext_lasso{background:url(images/code.png) left top no-repeat}.jqueryFileTree LI.ext_log{background:url(images/txt.png) left top no-repeat}.jqueryFileTree LI.ext_m4p{background:url(images/music.png) left top no-repeat}.jqueryFileTree LI.ext_mov{background:url(images/film.png) left top no-repeat}.jqueryFileTree LI.ext_mp3{background:url(images/music.png) left top no-repeat}.jqueryFileTree LI.ext_mp4{background:url(images/film.png) left top no-repeat}.jqueryFileTree LI.ext_mpg{background:url(images/film.png) left top no-repeat}.jqueryFileTree LI.ext_mpeg{background:url(images/film.png) left top no-repeat}.jqueryFileTree LI.ext_ogg{background:url(images/music.png) left top no-repeat}.jqueryFileTree LI.ext_pcx{background:url(images/picture.png) left top no-repeat}.jqueryFileTree LI.ext_pdf{background:url(images/pdf.png) left top no-repeat}.jqueryFileTree LI.ext_php{background:url(images/php.png) left top no-repeat}.jqueryFileTree LI.ext_png{background:url(images/picture.png) left top no-repeat}.jqueryFileTree LI.ext_ppt{background:url(images/ppt.png) left top no-repeat}.jqueryFileTree LI.ext_psd{background:url(images/psd.png) left top no-repeat}.jqueryFileTree LI.ext_pl{background:url(images/script.png) left top no-repeat}.jqueryFileTree LI.ext_py{background:url(images/script.png) left top no-repeat}.jqueryFileTree LI.ext_rb{background:url(images/ruby.png) left top no-repeat}.jqueryFileTree LI.ext_rbx{background:url(images/ruby.png) left top no-repeat}.jqueryFileTree LI.ext_rhtml{background:url(images/ruby.png) left top no-repeat}.jqueryFileTree LI.ext_rpm{background:url(images/linux.png) left top no-repeat}.jqueryFileTree LI.ext_ruby{background:url(images/ruby.png) left top no-repeat}.jqueryFileTree LI.ext_sql{background:url(images/db.png) left top no-repeat}.jqueryFileTree LI.ext_swf{background:url(images/flash.png) left top no-repeat}.jqueryFileTree LI.ext_tif{background:url(images/picture.png) left top no-repeat}.jqueryFileTree LI.ext_tiff{background:url(images/picture.png) left top no-repeat}.jqueryFileTree LI.ext_txt{background:url(images/txt.png) left top no-repeat}.jqueryFileTree LI.ext_vb{background:url(images/code.png) left top no-repeat}.jqueryFileTree LI.ext_wav{background:url(images/music.png) left top no-repeat}.jqueryFileTree LI.ext_wmv{background:url(images/film.png) left top no-repeat}.jqueryFileTree LI.ext_xls{background:url(images/xls.png) left top no-repeat}.jqueryFileTree LI.ext_xml{background:url(images/code.png) left top no-repeat}.jqueryFileTree LI.ext_zip{background:url(images/zip.png) left top no-repeat} \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/jquery.filetree/jquery.filetree.min.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/jquery.filetree/jquery.filetree.min.js new file mode 100644 index 0000000000000000000000000000000000000000..fc89e05b04cf189215e52c9e699a67768a356b60 --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/jquery.filetree/jquery.filetree.min.js @@ -0,0 +1 @@ +eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('0(S)(5($){$.K($.10,{11:5(o,h){0(!o)L o={};0(o.g==3)o.g=\'/\';0(o.i==3)o.i=\'x.12\';0(o.9==3)o.9=\'B\';0(o.m==3)o.m=F;0(o.e==3)o.e=F;0(o.r==3)o.r=J;0(o.f==3)o.f=J;0(o.p==3)o.p=P;0(o.y==3)o.y=\'13...\';0(o.8==3)o.8={};$(1).Z(5(){5 v(c,t){$(c).b(\'u\');$(".x.z").U();L 8=$.K(o.8,{Y:t});$.X(o.i,8,5(7){0(14(7)!=\'15\')7=1c.1a(7);I=7.w;$(c).4(\'.z\').w(\'\');$(c).a(\'u\').19(I);0(o.g==t)$(c).4(\'6:E\').18();k $(c).4(\'6:E\').16({n:o.m,s:o.r});G(c)})}5 G(t){$(t).4(\'D A\').T(o.9,5(){0($(1).2().H(\'V\')){0($(1).2().H(\'d\')){0(!o.p){$(1).2().2().4(\'6\').W({n:o.e,s:o.f});$(1).2().2().4(\'D.V\').a(\'q\').b(\'d\')}$(1).2().4(\'6\').U();v($(1).2(),N($(1).l(\'j\').17(/.*\\//)));$(1).2().a(\'d\').b(\'q\')}k{$(1).2().4(\'6\').W({n:o.e,s:o.f});$(1).2().a(\'q\').b(\'d\')}h($(1).l(\'j\'),P)}k{h($(1).l(\'j\'),C)}R C});0(o.9.1b!=\'B\')$(t).4(\'D A\').T(\'B\',5(){R C})}$(1).w(\'<M Q="x z"><O Q="u">\'+o.y+\'<O></M>\');v($(1),N(o.g))})}})})(S);',62,75,'if|this|parent|undefined|find|function|UL|response|post_params|folderEvent|removeClass|addClass||collapsed|collapseSpeed|collapseEasing|root||script|rel|else|attr|expandSpeed|duration||multiFolder|expanded|expandEasing|easing||wait|showTree|html|jqueryFileTree|loadMessage|start||click|false|LI|hidden|500|bindTree|hasClass|data|null|extend|var|ul|escape|li|true|class|return|jQuery|bind|remove|directory|slideUp|post|dir|each|fn|fileTree|php|Loading|typeof|object|slideDown|match|show|append|parse|toLowerCase|JSON'.split('|'),0,{})) diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/media-library-import.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/media-library-import.css new file mode 100644 index 0000000000000000000000000000000000000000..ed4a10f3fc9809c7dc5362fb17f22a09f0b73096 --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/media-library-import.css @@ -0,0 +1,27 @@ +#ngg-importML-selected-image-import.hidden { + display: none; +} + +#ngg-importML-select-opener.hidden { + display: none; +} + +#ngg-importML-gallery-selection { + display: inline-block; +} + +#ngg-importML-selected-image-import { + vertical-align: middle; +} + +#ngg-importML-select-opener { + vertical-align: middle; +} + +#ngg-importML-gallery-name { + vertical-align: middle; +} + +#ngg-importML-gallery-select { + vertical-align: middle; +} \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/media-library-import.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/media-library-import.js new file mode 100644 index 0000000000000000000000000000000000000000..fcaad0b2859835f6a11a7a0e939faf191a4576eb --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/media-library-import.js @@ -0,0 +1,205 @@ +(function($) { + var ngg_importml = { + + ml_data: null, + import_ids: [], + + selectors: { + ml_btn_import: $('#ngg-importML-selected-image-import'), + ml_btn_select: $('#ngg-importML-select-opener'), + gallery_select: $('#ngg-importML-gallery-id'), + gallery_name: $('#ngg-importML-gallery-name') + }, + + initialize: function() { + this.methods.initialize(); + this.methods.set_events(); + }, + + methods: { + + initialize: function() { + ngg_importml.ml_dialog = top.wp.media.frames.ngg_importml = top.wp.media({ + multiple: true, + title: ngg_importml_i18n.title, + button: { text: ngg_importml_i18n.button_text } + }); + }, + + urlencode: function(str) { + str = (str + '').toString(); + return encodeURIComponent(str) + .replace(/!/g, '%21') + .replace(/'/g, '%27') + .replace(/\(/g, '%28') + .replace(/\)/g, '%29') + .replace(/\*/g, '%2A') + .replace(/%20/g, '+'); + }, + + import: { + + import_count: 0, + + params: { + action: 'import_media_library' + }, + + start: function() { + // prevent the impatient from causing simultaneous ongoing posts + ngg_importml.selectors.ml_btn_import.attr('disabled', true); + ngg_importml.selectors.ml_btn_select.attr('disabled', true); + + ngg_importml.methods.import.params.gallery_id = ngg_importml.methods.urlencode(ngg_importml.selectors.gallery_select.val()); + ngg_importml.methods.import.params.gallery_name = ngg_importml.methods.urlencode(ngg_importml.selectors.gallery_name.val()); + + Object.keys(ngg_importml_i18n.sectoken).forEach(function(key) { + ngg_importml.methods.import.params[key] = ngg_importml_i18n.sectoken[key]; + }); + + ngg_importml.progress_bar = $.nggProgressBar({ + title: ngg_importml_i18n.progress_title, + infinite: true, + starting_value: ngg_importml_i18n.in_progress + }); + + $(ngg_importml).trigger('send_ajax'); + }, + + done: function() { + ngg_importml.progress_bar.close(100); + ngg_importml.selectors.ml_btn_import.attr('disabled', false); + ngg_importml.selectors.ml_btn_select.attr('disabled', false); + + delete ngg_importml.methods.import.params.gallery_id; + delete ngg_importml.methods.import.params.gallery_name; + + var msg = ngg_importml_i18n.imported_multiple.replace('%s', ngg_importml.methods.import.import_count); + if (ngg_importml.methods.import.import_count == 1) { + msg = ngg_importml_i18n.imported_singular; + } + + $.gritter.add({ + title: ngg_importml_i18n.gritter_title, + text: msg, + sticky: true + }); + + ngg_importml.methods.import.import_count = 0; + + // Empty the current selection & revert to the default state + ngg_importml.ml_dialog.trigger('reset'); + ngg_importml.import_ids = []; + ngg_importml.selectors.ml_btn_import.fadeOut(); + }, + + send_ajax: function() { + var params = ngg_importml.methods.import.params; + params.attachment_ids = [ngg_importml.import_ids.pop()]; + + $.post(photocrati_ajax.url, params, function(data) { + if (typeof data.error == 'undefined') { + ngg_importml.methods.import.import_count++; + + // If we created a new gallery, ensure it's now in the drop-down list, and select it + if (ngg_importml.selectors.gallery_select.find('option[value="' + data.gallery_id + '"]').length == 0) { + ngg_importml.methods.import.params.gallery_id = data.gallery_id; + var option = $('<option/>').attr('value', data.gallery_id).html(data.gallery_name); + ngg_importml.selectors.gallery_select.append(option); + ngg_importml.selectors.gallery_select.val(data.gallery_id); + option.prop('selected', true); + ngg_importml.selectors.gallery_name.val('').fadeOut(); + } + } else { + $.gritter.add({ + title: ngg_importml_i18n.gritter_error, + text: data.error, + sticky: true + }); + } + if (ngg_importml.import_ids.length == 0) { + ngg_importml.methods.import.done(); + } else { + $(ngg_importml).trigger('send_ajax'); + } + }, 'json'); + } + }, + + set_events: function() { + + $(ngg_importml).on('send_ajax', function() { + ngg_importml.methods.import.send_ajax(); + }); + + // Captures selected images and records their ID + ngg_importml.ml_dialog.on('select', function () { + ngg_importml.import_ids = []; + ngg_importml.ml_data = ngg_importml.ml_dialog.state().get('selection'); + ngg_importml.ml_data.map(function(image) { + image = image.toJSON(); + ngg_importml.import_ids.push(image.id); + }); + var msg = ngg_importml_i18n.import_multiple.replace('%s', ngg_importml.import_ids.length); + if (ngg_importml.import_ids.length == 1) { + msg = ngg_importml_i18n.import_singular; + } + ngg_importml.selectors.ml_btn_import.html(msg); + ngg_importml.selectors.ml_btn_import.fadeIn(); + }); + + // Opens Media Library dialog to select images for import + ngg_importml.selectors.ml_btn_select.on('click', function(event) { + event.preventDefault(); + ngg_importml.ml_dialog.open(); + }); + + // Import selected images + ngg_importml.selectors.ml_btn_import.on('click', function(event) { + event.preventDefault(); + ngg_importml.methods.import.start(); + }); + + // Show/hide MediaLibrary import buttons if a gallery is selected + ngg_importml.selectors.gallery_select.on('change', function() { + if (parseInt(this.value) == 0) { + ngg_importml.selectors.gallery_name.fadeIn().focus(); + if (ngg_importml.selectors.gallery_name.val().length == 0) { + ngg_importml.selectors.ml_btn_import.fadeOut(); + ngg_importml.selectors.ml_btn_select.fadeOut(); + } + } else { + ngg_importml.selectors.gallery_name.fadeOut(400, function() { + ngg_importml.selectors.gallery_select.focus(); + ngg_importml.selectors.ml_btn_select.fadeIn(); + if (ngg_importml.import_ids.length > 0) { + ngg_importml.selectors.ml_btn_import.fadeIn(); + } + }); + } + }); + + // Ensure the gallery name is filled in if "create new gallery" is selected + ngg_importml.selectors.gallery_name.on('keyup', function() { + if (ngg_importml.selectors.gallery_name.val().length > 0) { + ngg_importml.selectors.gallery_name.removeClass('error'); + ngg_importml.selectors.ml_btn_select.fadeIn(); + if (ngg_importml.import_ids.length > 0) { + ngg_importml.selectors.ml_btn_import.fadeIn(); + } + } else { + ngg_importml.selectors.ml_btn_import.fadeOut(); + ngg_importml.selectors.ml_btn_select.fadeOut(); + } + }); + } + } + }; + + $(document).ready(function() { + window.ngg_importml = ngg_importml; + ngg_importml.initialize(); + window.Frame_Event_Publisher.broadcast(); + }); + +})(jQuery); diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/media-library-import.min.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/media-library-import.min.css new file mode 100644 index 0000000000000000000000000000000000000000..5eee5d64260f67f087e6cc94c395c975c63a2b7b --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/media-library-import.min.css @@ -0,0 +1 @@ +#ngg-importML-selected-image-import.hidden{display:none}#ngg-importML-select-opener.hidden{display:none}#ngg-importML-gallery-selection{display:inline-block}#ngg-importML-selected-image-import{vertical-align:middle}#ngg-importML-select-opener{vertical-align:middle}#ngg-importML-gallery-name{vertical-align:middle}#ngg-importML-gallery-select{vertical-align:middle} \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/media-library-import.min.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/media-library-import.min.js new file mode 100644 index 0000000000000000000000000000000000000000..5aebd3cd4d0010b2c78bc611f1eb089567b1ad42 --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/media-library-import.min.js @@ -0,0 +1 @@ +eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('(5($){r 2={J:1q,c:[],3:{9:$(\'#F-C-W-u-6\'),f:$(\'#F-C-Q-1r\'),j:$(\'#F-C-17-10\'),7:$(\'#F-C-17-1m\')},A:5(){L.4.A();L.4.Z()},4:{A:5(){2.v=19.16.Y.1n.2=19.16.Y({1s:k,w:8.w,1t:{K:8.1y}})},H:5(B){B=(B+\'\').1z();1l 1w(B).h(/!/g,\'%21\').h(/\'/g,\'%27\').h(/\\(/g,\'%28\').h(/\\)/g,\'%29\').h(/\\*/g,\'%1u\').h(/%20/g,\'+\')},6:{q:0,a:{1v:\'1A\'},P:5(){2.3.9.x(\'D\',k);2.3.f.x(\'D\',k);2.4.6.a.l=2.4.H(2.3.j.o());2.4.6.a.7=2.4.H(2.3.7.o());1d.1b(8.R).1e(5(G){2.4.6.a[G]=8.R[G]});2.12=$.1i({w:8.1j,1f:k,1h:8.1k});$(2).I(\'t\')},S:5(){2.12.1c(1x);2.3.9.x(\'D\',14);2.3.f.x(\'D\',14);13 2.4.6.a.l;13 2.4.6.a.7;r p=8.1W.h(\'%s\',2.4.6.q);b(2.4.6.q==1){p=8.1X}$.X.T({w:8.1V,K:p,O:k});2.4.6.q=0;2.v.I(\'1B\');2.c=[];2.3.9.i()},t:5(){r a=2.4.6.a;a.1S=[2.c.1T()];$.1Y(1Z.26,a,5(e){b(25 e.N==\'24\'){2.4.6.q++;b(2.3.j.22(\'y[M="\'+e.l+\'"]\').d==0){2.4.6.a.l=e.l;r y=$(\'<y/>\').x(\'M\',e.l).15(e.7);2.3.j.1H(y);2.3.j.o(e.l);y.1J(\'W\',k);2.3.7.o(\'\').i()}}E{$.X.T({w:8.1O,K:e.N,O:k})}b(2.c.d==0){2.4.6.S()}E{$(2).I(\'t\')}},\'1K\')}},Z:5(){$(2).m(\'t\',5(){2.4.6.t()});2.v.m(\'Q\',5(){2.c=[];2.J=2.v.1L().2a(\'1G\');2.J.1Q(5(u){u=u.1D();2.c.1C(u.10)});r p=8.1F.h(\'%s\',2.c.d);b(2.c.d==1){p=8.1U}2.3.9.15(p);2.3.9.n()});2.3.f.m(\'11\',5(z){z.18();2.v.1E()});2.3.9.m(\'11\',5(z){z.18();2.4.6.P()});2.3.j.m(\'1M\',5(){b(1N(L.M)==0){2.3.7.n().U();b(2.3.7.o().d==0){2.3.9.i();2.3.f.i()}}E{2.3.7.i(1I,5(){2.3.j.U();2.3.f.n();b(2.c.d>0){2.3.9.n()}})}});2.3.7.m(\'1R\',5(){b(2.3.7.o().d>0){2.3.7.23(\'N\');2.3.f.n();b(2.c.d>0){2.3.9.n()}}E{2.3.9.i();2.3.f.i()}})}}};$(1g).1a(5(){V.2=2;2.A();V.1o.1p()})})(1P);',62,135,'||ngg_importml|selectors|methods|function|import|gallery_name|ngg_importml_i18n|ml_btn_import|params|if|import_ids|length|data|ml_btn_select||replace|fadeOut|gallery_select|true|gallery_id|on|fadeIn|val|msg|import_count|var||send_ajax|image|ml_dialog|title|attr|option|event|initialize|str|importML|disabled|else|ngg|key|urlencode|trigger|ml_data|text|this|value|error|sticky|start|select|sectoken|done|add|focus|window|selected|gritter|media|set_events|id|click|progress_bar|delete|false|html|wp|gallery|preventDefault|top|ready|keys|close|Object|forEach|infinite|document|starting_value|nggProgressBar|progress_title|in_progress|return|name|frames|Frame_Event_Publisher|broadcast|null|opener|multiple|button|2A|action|encodeURIComponent|100|button_text|toString|import_media_library|reset|push|toJSON|open|import_multiple|selection|append|400|prop|json|state|change|parseInt|gritter_error|jQuery|map|keyup|attachment_ids|pop|import_singular|gritter_title|imported_multiple|imported_singular|post|photocrati_ajax|||find|removeClass|undefined|typeof|url||||get'.split('|'),0,{})) diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/plupload-2.1.1/jquery.plupload.queue/css/jquery.plupload.queue.min.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/plupload-2.1.1/jquery.plupload.queue/css/jquery.plupload.queue.min.css new file mode 100644 index 0000000000000000000000000000000000000000..d969e51b96c5d0825057c7dc7507b605bcd64fb3 --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/plupload-2.1.1/jquery.plupload.queue/css/jquery.plupload.queue.min.css @@ -0,0 +1 @@ +.plupload_button{display:-moz-inline-box;display:inline-block;font:normal 12px sans-serif;text-decoration:none;color:#42454a;border:1px solid #bababa;padding:2px 8px 3px 20px;margin-right:4px;background:#f3f3f3 url('../img/buttons.png') no-repeat 0 center;outline:0;-moz-border-radius:3px;-khtml-border-radius:3px;-webkit-border-radius:3px;border-radius:3px}.plupload_button:hover{color:#000;text-decoration:none}.plupload_disabled,a.plupload_disabled:hover{color:#737373;border-color:#c5c5c5;background:#ededed url('../img/buttons-disabled.png') no-repeat 0 center;cursor:default}.plupload_add{background-position:-181px center}.plupload_wrapper{font:normal 11px Verdana,sans-serif;width:100%}.plupload_container{padding:8px;background:url('../img/transp50.png')}.plupload_container input{border:1px solid #DDD;font:normal 11px Verdana,sans-serif;width:98%}.plupload_header{background:#2a2c2e url('../img/backgrounds.gif') repeat-x}.plupload_header_content{background:url('../img/backgrounds.gif') no-repeat 0 -317px;min-height:56px;padding-left:60px;color:#FFF}.plupload_header_title{font:normal 18px sans-serif;padding:6px 0 3px}.plupload_header_text{font:normal 12px sans-serif}.plupload_filelist{margin:0;padding:0;list-style:none}.plupload_scroll .plupload_filelist{height:185px;background:#f5f5f5;overflow-y:scroll}.plupload_filelist li{padding:10px 8px;background:#f5f5f5 url('../img/backgrounds.gif') repeat-x 0 -156px;border-bottom:1px solid #DDD}.plupload_filelist_header,.plupload_filelist_footer{background:#dfdfdf;padding:8px 8px;color:#42454a}.plupload_filelist_header{border-top:1px solid #EEE;border-bottom:1px solid #cdcdcd}.plupload_filelist_footer{border-top:1px solid #FFF;height:22px;line-height:20px;vertical-align:middle}.plupload_file_name{float:left;overflow:hidden}.plupload_file_status{color:#777}.plupload_file_status span{color:#42454a}.plupload_file_size,.plupload_file_status,.plupload_progress{float:right;width:80px}.plupload_file_size,.plupload_file_status,.plupload_file_action{text-align:right}.plupload_filelist .plupload_file_name{width:205px;white-space:nowrap;text-overflow:ellipsis}.plupload_file_action{float:right;width:16px;height:16px;margin-left:15px}.plupload_file_action *{display:none;width:16px;height:16px}li.plupload_uploading{background:#ecf3dc url('../img/backgrounds.gif') repeat-x 0 -238px}li.plupload_done{color:#AAA}li.plupload_delete a{background:url('../img/delete.gif')}li.plupload_failed a{background:url('../img/error.gif');cursor:default}li.plupload_done a{background:url('../img/done.gif');cursor:default}.plupload_progress,.plupload_upload_status{display:none}.plupload_progress_container{margin-top:3px;border:1px solid #CCC;background:#FFF;padding:1px}.plupload_progress_bar{width:0;height:7px;background:#cdeb8b}.plupload_scroll .plupload_filelist_header .plupload_file_action,.plupload_scroll .plupload_filelist_footer .plupload_file_action{margin-right:17px}.plupload_clear,.plupload_clearer{clear:both}.plupload_clearer,.plupload_progress_bar{display:block;font-size:0;line-height:0}li.plupload_droptext{background:transparent;text-align:center;vertical-align:middle;border:0;line-height:165px} \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/plupload-2.1.1/jquery.plupload.queue/jquery.plupload.queue.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/plupload-2.1.1/jquery.plupload.queue/jquery.plupload.queue.js index 576920af254e9c2521876f57c153f5ffe68b9bfd..d77302ef2073e3799d2514b62236e02c9b5bed16 100755 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/plupload-2.1.1/jquery.plupload.queue/jquery.plupload.queue.js +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/plupload-2.1.1/jquery.plupload.queue/jquery.plupload.queue.js @@ -90,6 +90,7 @@ used as it is. } }); + // The below has been edited to change the classes given to the Add Files / Start Upload buttons target.prepend( '<div class="plupload_wrapper plupload_scroll">' + '<div id="' + id + '_container" class="plupload_container">' + @@ -115,8 +116,8 @@ used as it is. '<div class="plupload_filelist_footer">' + '<div class="plupload_file_name">' + '<div class="plupload_buttons">' + - '<a href="#" class="plupload_button plupload_add" id="' + id + '_browse">' + _('Add Files') + '</a>' + - '<a href="#" class="plupload_button plupload_start">' + _('Start Upload') + '</a>' + + '<a href="#" class="button-primary" id="' + id + '_browse">' + _('Add Files') + '</a>' + + '<a href="#" class="button-primary plupload_start" id="' + id + '_upload">' + _('Start Upload') + '</a>' + '</div>' + '<span class="plupload_upload_status"></span>' + '</div>' + diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/plupload-2.1.1/jquery.plupload.queue/jquery.plupload.queue.min.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/plupload-2.1.1/jquery.plupload.queue/jquery.plupload.queue.min.js index a38f914ad788482ba33b5131dc78daa2a31ba695..e143f32d3e57429508d14ae7eaaa4adfa85ab259 100755 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/plupload-2.1.1/jquery.plupload.queue/jquery.plupload.queue.min.js +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/plupload-2.1.1/jquery.plupload.queue/jquery.plupload.queue.min.js @@ -1 +1 @@ -;(function(e,t){function r(e){return plupload.translate(e)||e}function i(t,n){n.contents().each(function(t,n){n=e(n),n.is(".plupload")||n.remove()}),n.prepend('<div class="plupload_wrapper plupload_scroll"><div id="'+t+'_container" class="plupload_container">'+'<div class="plupload">'+'<div class="plupload_header">'+'<div class="plupload_header_content">'+'<div class="plupload_header_title">'+r("Select files")+"</div>"+'<div class="plupload_header_text">'+r("Add files to the upload queue and click the start button.")+"</div>"+"</div>"+"</div>"+'<div class="plupload_content">'+'<div class="plupload_filelist_header">'+'<div class="plupload_file_name">'+r("Filename")+"</div>"+'<div class="plupload_file_action"> </div>'+'<div class="plupload_file_status"><span>'+r("Status")+"</span></div>"+'<div class="plupload_file_size">'+r("Size")+"</div>"+'<div class="plupload_clearer"> </div>'+"</div>"+'<ul id="'+t+'_filelist" class="plupload_filelist"></ul>'+'<div class="plupload_filelist_footer">'+'<div class="plupload_file_name">'+'<div class="plupload_buttons">'+'<a href="#" class="plupload_button plupload_add" id="'+t+'_browse">'+r("Add Files")+"</a>"+'<a href="#" class="plupload_button plupload_start">'+r("Start Upload")+"</a>"+"</div>"+'<span class="plupload_upload_status"></span>'+"</div>"+'<div class="plupload_file_action"></div>'+'<div class="plupload_file_status"><span class="plupload_total_status">0%</span></div>'+'<div class="plupload_file_size"><span class="plupload_total_file_size">0 b</span></div>'+'<div class="plupload_progress">'+'<div class="plupload_progress_container">'+'<div class="plupload_progress_bar"></div>'+"</div>"+"</div>"+'<div class="plupload_clearer"> </div>'+"</div>"+"</div>"+"</div>"+"</div>"+'<input type="hidden" id="'+t+'_count" name="'+t+'_count" value="0" />'+"</div>")}var n={};e.fn.pluploadQueue=function(s){return s?(this.each(function(){function c(t){var n;t.status==plupload.DONE&&(n="plupload_done"),t.status==plupload.FAILED&&(n="plupload_failed"),t.status==plupload.QUEUED&&(n="plupload_delete"),t.status==plupload.UPLOADING&&(n="plupload_uploading");var r=e("#"+t.id).attr("class",n).find("a").css("display","block");t.hint&&r.attr("title",t.hint)}function h(){e("span.plupload_total_status",a).html(u.total.percent+"%"),e("div.plupload_progress_bar",a).css("width",u.total.percent+"%"),e("span.plupload_upload_status",a).html(t.sprintf(r("Uploaded %d/%d files"),u.total.uploaded,u.files.length))}function p(){var n=e("ul.plupload_filelist",a).html(""),i=0,s;e.each(u.files,function(t,r){s="",r.status==plupload.DONE&&(r.target_name&&(s+='<input type="hidden" name="'+f+"_"+i+'_tmpname" value="'+plupload.xmlEncode(r.target_name)+'" />'),s+='<input type="hidden" name="'+f+"_"+i+'_name" value="'+plupload.xmlEncode(r.name)+'" />',s+='<input type="hidden" name="'+f+"_"+i+'_status" value="'+(r.status==plupload.DONE?"done":"failed")+'" />',i++,e("#"+f+"_count").val(i)),n.append('<li id="'+r.id+'">'+'<div class="plupload_file_name"><span>'+r.name+"</span></div>"+'<div class="plupload_file_action"><a href="#"></a></div>'+'<div class="plupload_file_status">'+r.percent+"%</div>"+'<div class="plupload_file_size">'+plupload.formatSize(r.size)+"</div>"+'<div class="plupload_clearer"> </div>'+s+"</li>"),c(r),e("#"+r.id+".plupload_delete a").click(function(t){e("#"+r.id).remove(),u.removeFile(r),t.preventDefault()})}),e("span.plupload_total_file_size",a).html(plupload.formatSize(u.total.size)),u.total.queued===0?e("span.plupload_add_text",a).html(r("Add Files")):e("span.plupload_add_text",a).html(t.sprintf(r("%d files queued"),u.total.queued)),e("a.plupload_start",a).toggleClass("plupload_disabled",u.files.length==u.total.uploaded+u.total.failed),n[0].scrollTop=n[0].scrollHeight,h(),!u.files.length&&u.features.dragdrop&&u.settings.dragdrop&&e("#"+f+"_filelist").append('<li class="plupload_droptext">'+r("Drag files here.")+"</li>")}function d(){delete n[f],u.destroy(),a.html(l),u=a=l=null}var u,a,f,l;a=e(this),f=a.attr("id"),f||(f=plupload.guid(),a.attr("id",f)),l=a.html(),i(f,a),s=e.extend({dragdrop:!0,browse_button:f+"_browse",container:f},s),s.dragdrop&&(s.drop_element=f+"_filelist"),u=new plupload.Uploader(s),n[f]=u,u.bind("UploadFile",function(t,n){e("#"+n.id).addClass("plupload_current_file")}),u.bind("Init",function(t,n){!s.unique_names&&s.rename&&a.on("click","#"+f+"_filelist div.plupload_file_name span",function(n){var r=e(n.target),i,s,o,u="";i=t.getFile(r.parents("li")[0].id),o=i.name,s=/^(.+)(\.[^.]+)$/.exec(o),s&&(o=s[1],u=s[2]),r.hide().after('<input type="text" />'),r.next().val(o).focus().blur(function(){r.show().next().remove()}).keydown(function(t){var n=e(this);t.keyCode==13&&(t.preventDefault(),i.name=n.val()+u,r.html(i.name),n.blur())})}),e("#"+f+"_container").attr("title","Using runtime: "+n.runtime),e("a.plupload_start",a).click(function(t){e(this).hasClass("plupload_disabled")||u.start(),t.preventDefault()}),e("a.plupload_stop",a).click(function(e){e.preventDefault(),u.stop()}),e("a.plupload_start",a).addClass("plupload_disabled")}),u.bind("Error",function(t,n){var i=n.file,s;i&&(s=n.message,n.details&&(s+=" ("+n.details+")"),n.code==plupload.FILE_SIZE_ERROR&&alert(r("Error: File too large:")+" "+i.name),n.code==plupload.FILE_EXTENSION_ERROR&&alert(r("Error: Invalid file extension:")+" "+i.name),i.hint=s,e("#"+i.id).attr("class","plupload_failed").find("a").css("display","block").attr("title",s)),n.code===plupload.INIT_ERROR&&setTimeout(function(){d()},1)}),u.bind("PostInit",function(t){t.settings.dragdrop&&t.features.dragdrop&&e("#"+f+"_filelist").append('<li class="plupload_droptext">'+r("Drag files here.")+"</li>")}),u.init(),u.bind("StateChanged",function(){u.state===plupload.STARTED?(e("li.plupload_delete a,div.plupload_buttons",a).hide(),e("span.plupload_upload_status,div.plupload_progress,a.plupload_stop",a).css("display","block"),e("span.plupload_upload_status",a).html("Uploaded "+u.total.uploaded+"/"+u.files.length+" files"),s.multiple_queues&&e("span.plupload_total_status,span.plupload_total_file_size",a).show()):(p(),e("a.plupload_stop,div.plupload_progress",a).hide(),e("a.plupload_delete",a).css("display","block"),s.multiple_queues&&u.total.uploaded+u.total.failed==u.files.length&&(e(".plupload_buttons,.plupload_upload_status",a).css("display","inline"),e(".plupload_start",a).addClass("plupload_disabled"),e("span.plupload_total_status,span.plupload_total_file_size",a).hide()))}),u.bind("FilesAdded",p),u.bind("FilesRemoved",function(){var t=e("#"+f+"_filelist").scrollTop();p(),e("#"+f+"_filelist").scrollTop(t)}),u.bind("FileUploaded",function(e,t){c(t)}),u.bind("UploadProgress",function(t,n){e("#"+n.id+" div.plupload_file_status",a).html(n.percent+"%"),c(n),h()}),s.setup&&s.setup(u)}),this):n[e(this[0]).attr("id")]}})(jQuery,mOxie); \ No newline at end of file +eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('(c($,o){q X={};c h(1B){1C g.2c(1B)||1B}c 1U(4,8){8.2i().1a(c(i,N){N=$(N);9(!N.2l(\'.g\')){N.1l()}});8.2p(\'<3 7="2n 2O">\'+\'<3 4="\'+4+\'1V" 7="2v">\'+\'<3 7="g">\'+\'<3 7="2s">\'+\'<3 7="2w">\'+\'<3 7="2A">\'+h(\'29 l\')+\'</3>\'+\'<3 7="2e">\'+h(\'1i l 2m 1Y 2a 2k 2q I 1Y 1W 19.\')+\'</3>\'+\'</3>\'+\'</3>\'+\'<3 7="2j">\'+\'<3 7="2o">\'+\'<3 7="R">\'+h(\'2g\')+\'</3>\'+\'<3 7="1f">&14;</3>\'+\'<3 7="T"><f>\'+h(\'2d\')+\'</f></3>\'+\'<3 7="1h">\'+h(\'2b\')+\'</3>\'+\'<3 7="1k">&14;</3>\'+\'</3>\'+\'<1d 4="\'+4+\'v" 7="1N"></1d>\'+\'<3 7="2f">\'+\'<3 7="R">\'+\'<3 7="1w">\'+\'<a 1j="#" 7="19-1Z" 4="\'+4+\'1I">\'+h(\'1i 1T\')+\'</a>\'+\'<a 1j="#" 7="19-1Z M" 4="\'+4+\'2G">\'+h(\'2y 2z\')+\'</a>\'+\'</3>\'+\'<f 7="F"></f>\'+\'</3>\'+\'<3 7="1f"></3>\'+\'<3 7="T"><f 7="12">0%</f></3>\'+\'<3 7="1h"><f 7="11">0 b</f></3>\'+\'<3 7="1s">\'+\'<3 7="2B">\'+\'<3 7="1O"></3>\'+\'</3>\'+\'</3>\'+\'<3 7="1k">&14;</3>\'+\'</3>\'+\'</3>\'+\'</3>\'+\'</3>\'+\'<H J="Z" 4="\'+4+\'1m" j="\'+4+\'1m" V="0" />\'+\'</3>\')}$.2x.2t=c(k){9(k){B.1a(c(){q 6,8,4,S;8=$(B);4=8.t(\'4\');9(!4){4=g.2u();8.t(\'4\',4)}S=8.n();1U(4,8);k=$.2C({z:2D,2K:4+\'1I\',2L:4},k);9(k.z){k.2M=4+\'v\'}6=2N g.2J(k);X[4]=6;c W(5){q w;9(5.C==g.1p){w=\'2I\'}9(5.C==g.2E){w=\'28\'}9(5.C==g.2F){w=\'17\'}9(5.C==g.2r){w=\'2H\'}q 1J=$(\'#\'+5.4).t(\'7\',w).27(\'a\').y(\'K\',\'18\');9(5.1q){1J.t(\'1e\',5.1q)}}c 1t(){$(\'f.12\',8).n(6.m.U+\'%\');$(\'3.1O\',8).y(\'2h\',6.m.U+\'%\');$(\'f.F\',8).n(o.1D(h(\'1F %d/%d l\'),6.m.16,6.l.G))}c Q(){q 10=$(\'1d.1N\',8).n(\'\'),E=0,x;$.1a(6.l,c(i,5){x=\'\';9(5.C==g.1p){9(5.1M){x+=\'<H J="Z" j="\'+4+\'h\'+E+\'3m" V="\'+g.1L(5.1M)+\'" />\'}x+=\'<H J="Z" j="\'+4+\'h\'+E+\'3n" V="\'+g.1L(5.j)+\'" />\';x+=\'<H J="Z" j="\'+4+\'h\'+E+\'3o" V="\'+(5.C==g.1p?\'3p\':\'1v\')+\'" />\';E++;$(\'#\'+4+\'1m\').1o(E)}10.1A(\'<u 4="\'+5.4+\'">\'+\'<3 7="R"><f>\'+5.j+\'</f></3>\'+\'<3 7="1f"><a 1j="#"></a></3>\'+\'<3 7="T">\'+5.U+\'%</3>\'+\'<3 7="1h">\'+g.1S(5.1R)+\'</3>\'+\'<3 7="1k">&14;</3>\'+x+\'</u>\');W(5);$(\'#\'+5.4+\'.17 a\').I(c(e){$(\'#\'+5.4).1l();6.3l(5);e.Y()})});$(\'f.11\',8).n(g.1S(6.m.1R));9(6.m.1g===0){$(\'f.1H\',8).n(h(\'1i 1T\'))}1y{$(\'f.1H\',8).n(o.1D(h(\'%d l 1g\'),6.m.1g))}$(\'a.M\',8).3k(\'P\',6.l.G==(6.m.16+6.m.1v));10[0].O=10[0].3g;1t();9(!6.l.G&&6.21.z&&6.k.z){$(\'#\'+4+\'v\').1A(\'<u 7="1X">\'+h("26 l 1P.")+\'</u>\')}}c 1x(){3f X[4];6.1x();8.n(S);6=8=S=3h}6.p("3i",c(r,5){$(\'#\'+5.4).1u(\'3r\')});6.p(\'3j\',c(r,23){9(!k.3q&&k.3t){8.3y(\'I\',\'#\'+4+\'v 3.R f\',c(e){q D=$(e.8),5,L,j,1n="";5=r.3z(D.3w(\'u\')[0].4);j=5.j;L=/^(.+)(\\.[^.]+)$/.3s(j);9(L){j=L[1];1n=L[2]}D.15().3v(\'<H J="3u" />\');D.1G().1o(j).3x().25(c(){D.1E().1G().1l()}).3d(c(e){q 1c=$(B);9(e.2P==13){e.Y();5.j=1c.1o()+1n;D.n(5.j);1c.25()}})})}$(\'#\'+4+\'1V\').t(\'1e\',\'2X 22: \'+23.22);$(\'a.M\',8).I(c(e){9(!$(B).2Y(\'P\')){6.1W()}e.Y()});$(\'a.1r\',8).I(c(e){e.Y();6.2Z()});$(\'a.M\',8).1u(\'P\')});6.p("1b",c(r,s){q 5=s.5,A;9(5){A=s.A;9(s.20){A+=" ("+s.20+")"}9(s.1z==g.30){24(h("1b: 2W 2V 2R:")+" "+5.j)}9(s.1z==g.2Q){24(h("1b: 2S 5 2T:")+" "+5.j)}5.1q=A;$(\'#\'+5.4).t(\'7\',\'28\').27(\'a\').y(\'K\',\'18\').t(\'1e\',A)}9(s.1z===g.2U){31(c(){1x()},1)}});6.p("32",c(r){9(r.k.z&&r.21.z){$(\'#\'+4+\'v\').1A(\'<u 7="1X">\'+h("26 l 1P.")+\'</u>\')}});6.39();6.p(\'3a\',c(){9(6.3b===g.3c){$(\'u.17 a,3.1w\',8).15();$(\'f.F,3.1s,a.1r\',8).y(\'K\',\'18\');$(\'f.F\',8).n(\'1F \'+6.m.16+\'/\'+6.l.G+\' l\');9(k.1Q){$(\'f.12,f.11\',8).1E()}}1y{Q();$(\'a.1r,3.1s\',8).15();$(\'a.17\',8).y(\'K\',\'18\');9(k.1Q&&6.m.16+6.m.1v==6.l.G){$(".1w,.F",8).y("K","38");$(".M",8).1u("P");$(\'f.12,f.11\',8).15()}}});6.p(\'37\',Q);6.p(\'33\',c(){q O=$(\'#\'+4+\'v\').O();Q();$(\'#\'+4+\'v\').O(O)});6.p(\'34\',c(r,5){W(5)});6.p("35",c(r,5){$(\'#\'+5.4+\' 3.T\',8).n(5.U+\'%\');W(5);1t()});9(k.1K){k.1K(6)}});1C B}1y{1C X[$(B[0]).t(\'4\')]}}})(36,3e);',62,222,'|||div|id|file|uploader|class|target|if|||function|||span|plupload|_||name|settings|files|total|html||bind|var|up|err|attr|li|_filelist|actionClass|inputHTML|css|dragdrop|message|this|status|targetSpan|inputCount|plupload_upload_status|length|input|click|type|display|parts|plupload_start|node|scrollTop|plupload_disabled|updateList|plupload_file_name|contents_bak|plupload_file_status|percent|value|handleStatus|uploaders|preventDefault|hidden|fileList|plupload_total_file_size|plupload_total_status||nbsp|hide|uploaded|plupload_delete|block|button|each|Error|targetInput|ul|title|plupload_file_action|queued|plupload_file_size|Add|href|plupload_clearer|remove|_count|ext|val|DONE|hint|plupload_stop|plupload_progress|updateTotalProgress|addClass|failed|plupload_buttons|destroy|else|code|append|str|return|sprintf|show|Uploaded|next|plupload_add_text|_browse|icon|setup|xmlEncode|target_name|plupload_filelist|plupload_progress_bar|here|multiple_queues|size|formatSize|Files|renderUI|_container|start|plupload_droptext|the|primary|details|features|runtime|res|alert|blur|Drag|find|plupload_failed|Select|upload|Size|translate|Status|plupload_header_text|plupload_filelist_footer|Filename|width|contents|plupload_content|queue|is|to|plupload_wrapper|plupload_filelist_header|prepend|and|UPLOADING|plupload_header|pluploadQueue|guid|plupload_container|plupload_header_content|fn|Start|Upload|plupload_header_title|plupload_progress_container|extend|true|FAILED|QUEUED|_upload|plupload_uploading|plupload_done|Uploader|browse_button|container|drop_element|new|plupload_scroll|keyCode|FILE_EXTENSION_ERROR|large|Invalid|extension|INIT_ERROR|too|File|Using|hasClass|stop|FILE_SIZE_ERROR|setTimeout|PostInit|FilesRemoved|FileUploaded|UploadProgress|jQuery|FilesAdded|inline|init|StateChanged|state|STARTED|keydown|mOxie|delete|scrollHeight|null|UploadFile|Init|toggleClass|removeFile|_tmpname|_name|_status|done|unique_names|plupload_current_file|exec|rename|text|after|parents|focus|on|getFile'.split('|'),0,{})) diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/plupload-2.1.1/moxie.min.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/plupload-2.1.1/moxie.min.js index 99e119ef3d87cc84cf55f9871a7309079c44c441..c893f09395a946537927269499f6ceb34a0d6ffe 100755 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/plupload-2.1.1/moxie.min.js +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/plupload-2.1.1/moxie.min.js @@ -1,15 +1 @@ -/** - * mOxie - multi-runtime File API & XMLHttpRequest L2 Polyfill - * v1.2.0 - * - * Copyright 2013, Moxiecode Systems AB - * Released under GPL License. - * - * License: http://www.plupload.com/license - * Contributing: http://www.plupload.com/contributing - * - * Date: 2014-01-16 - */ -!function(e,t){"use strict";function n(e,t){for(var n,i=[],r=0;r<e.length;++r){if(n=s[e[r]]||o(e[r]),!n)throw"module definition dependecy not found: "+e[r];i.push(n)}t.apply(null,i)}function i(e,i,r){if("string"!=typeof e)throw"invalid module definition, module id must be defined and be a string";if(i===t)throw"invalid module definition, dependencies must be specified";if(r===t)throw"invalid module definition, definition function must be specified";n(i,function(){s[e]=r.apply(null,arguments)})}function r(e){return!!s[e]}function o(t){for(var n=e,i=t.split(/[.\/]/),r=0;r<i.length;++r){if(!n[i[r]])return;n=n[i[r]]}return n}function a(n){for(var i=0;i<n.length;i++){for(var r=e,o=n[i],a=o.split(/[.\/]/),u=0;u<a.length-1;++u)r[a[u]]===t&&(r[a[u]]={}),r=r[a[u]];r[a[a.length-1]]=s[o]}}var s={},u="moxie/core/utils/Basic",c="moxie/core/I18n",l="moxie/core/utils/Mime",d="moxie/core/utils/Env",f="moxie/core/utils/Dom",p="moxie/core/Exceptions",h="moxie/core/EventTarget",m="moxie/core/utils/Encode",g="moxie/runtime/Runtime",v="moxie/runtime/RuntimeClient",y="moxie/file/Blob",w="moxie/file/File",E="moxie/file/FileInput",_="moxie/file/FileDrop",x="moxie/runtime/RuntimeTarget",R="moxie/file/FileReader",b="moxie/core/utils/Url",T="moxie/file/FileReaderSync",S="moxie/xhr/FormData",A="moxie/xhr/XMLHttpRequest",O="moxie/runtime/Transporter",I="moxie/image/Image",D="moxie/runtime/html5/Runtime",N="moxie/runtime/html5/file/Blob",L="moxie/core/utils/Events",M="moxie/runtime/html5/file/FileInput",C="moxie/runtime/html5/file/FileDrop",F="moxie/runtime/html5/file/FileReader",H="moxie/runtime/html5/xhr/XMLHttpRequest",P="moxie/runtime/html5/utils/BinaryReader",k="moxie/runtime/html5/image/JPEGHeaders",U="moxie/runtime/html5/image/ExifParser",B="moxie/runtime/html5/image/JPEG",z="moxie/runtime/html5/image/PNG",G="moxie/runtime/html5/image/ImageInfo",q="moxie/runtime/html5/image/MegaPixel",X="moxie/runtime/html5/image/Image",j="moxie/runtime/flash/Runtime",V="moxie/runtime/flash/file/Blob",W="moxie/runtime/flash/file/FileInput",Y="moxie/runtime/flash/file/FileReader",$="moxie/runtime/flash/file/FileReaderSync",J="moxie/runtime/flash/xhr/XMLHttpRequest",Z="moxie/runtime/flash/runtime/Transporter",K="moxie/runtime/flash/image/Image",Q="moxie/runtime/silverlight/Runtime",et="moxie/runtime/silverlight/file/Blob",tt="moxie/runtime/silverlight/file/FileInput",nt="moxie/runtime/silverlight/file/FileDrop",it="moxie/runtime/silverlight/file/FileReader",rt="moxie/runtime/silverlight/file/FileReaderSync",ot="moxie/runtime/silverlight/xhr/XMLHttpRequest",at="moxie/runtime/silverlight/runtime/Transporter",st="moxie/runtime/silverlight/image/Image",ut="moxie/runtime/html4/Runtime",ct="moxie/runtime/html4/file/FileInput",lt="moxie/runtime/html4/file/FileReader",dt="moxie/runtime/html4/xhr/XMLHttpRequest",ft="moxie/runtime/html4/image/Image";i(u,[],function(){var e=function(e){var t;return e===t?"undefined":null===e?"null":e.nodeType?"node":{}.toString.call(e).match(/\s([a-z|A-Z]+)/)[1].toLowerCase()},t=function(i){var r;return n(arguments,function(o,s){s>0&&n(o,function(n,o){n!==r&&(e(i[o])===e(n)&&~a(e(n),["array","object"])?t(i[o],n):i[o]=n)})}),i},n=function(e,t){var n,i,r,o;if(e){try{n=e.length}catch(a){n=o}if(n===o){for(i in e)if(e.hasOwnProperty(i)&&t(e[i],i)===!1)return}else for(r=0;n>r;r++)if(t(e[r],r)===!1)return}},i=function(t){var n;if(!t||"object"!==e(t))return!0;for(n in t)return!1;return!0},r=function(t,n){function i(r){"function"===e(t[r])&&t[r](function(e){++r<o&&!e?i(r):n(e)})}var r=0,o=t.length;"function"!==e(n)&&(n=function(){}),t&&t.length||n(),i(r)},o=function(e,t){var i=0,r=e.length,o=new Array(r);n(e,function(e,n){e(function(e){if(e)return t(e);var a=[].slice.call(arguments);a.shift(),o[n]=a,i++,i===r&&(o.unshift(null),t.apply(this,o))})})},a=function(e,t){if(t){if(Array.prototype.indexOf)return Array.prototype.indexOf.call(t,e);for(var n=0,i=t.length;i>n;n++)if(t[n]===e)return n}return-1},s=function(t,n){var i=[];"array"!==e(t)&&(t=[t]),"array"!==e(n)&&(n=[n]);for(var r in t)-1===a(t[r],n)&&i.push(t[r]);return i.length?i:!1},u=function(e,t){var i=[];return n(e,function(e){-1!==a(e,t)&&i.push(e)}),i.length?i:null},c=function(e){var t,n=[];for(t=0;t<e.length;t++)n[t]=e[t];return n},l=function(){var e=0;return function(t){var n=(new Date).getTime().toString(32),i;for(i=0;5>i;i++)n+=Math.floor(65535*Math.random()).toString(32);return(t||"o_")+n+(e++).toString(32)}}(),d=function(e){return e?String.prototype.trim?String.prototype.trim.call(e):e.toString().replace(/^\s*/,"").replace(/\s*$/,""):e},f=function(e){if("string"!=typeof e)return e;var t={t:1099511627776,g:1073741824,m:1048576,k:1024},n;return e=/^([0-9]+)([mgk]?)$/.exec(e.toLowerCase().replace(/[^0-9mkg]/g,"")),n=e[2],e=+e[1],t.hasOwnProperty(n)&&(e*=t[n]),e};return{guid:l,typeOf:e,extend:t,each:n,isEmptyObj:i,inSeries:r,inParallel:o,inArray:a,arrayDiff:s,arrayIntersect:u,toArray:c,trim:d,parseSizeStr:f}}),i(c,[u],function(e){var t={};return{addI18n:function(n){return e.extend(t,n)},translate:function(e){return t[e]||e},_:function(e){return this.translate(e)},sprintf:function(t){var n=[].slice.call(arguments,1);return t.replace(/%[a-z]/g,function(){var t=n.shift();return"undefined"!==e.typeOf(t)?t:""})}}}),i(l,[u,c],function(e,t){var n="application/msword,doc dot,application/pdf,pdf,application/pgp-signature,pgp,application/postscript,ps ai eps,application/rtf,rtf,application/vnd.ms-excel,xls xlb,application/vnd.ms-powerpoint,ppt pps pot,application/zip,zip,application/x-shockwave-flash,swf swfl,application/vnd.openxmlformats-officedocument.wordprocessingml.document,docx,application/vnd.openxmlformats-officedocument.wordprocessingml.template,dotx,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,xlsx,application/vnd.openxmlformats-officedocument.presentationml.presentation,pptx,application/vnd.openxmlformats-officedocument.presentationml.template,potx,application/vnd.openxmlformats-officedocument.presentationml.slideshow,ppsx,application/x-javascript,js,application/json,json,audio/mpeg,mp3 mpga mpega mp2,audio/x-wav,wav,audio/x-m4a,m4a,audio/ogg,oga ogg,audio/aiff,aiff aif,audio/flac,flac,audio/aac,aac,audio/ac3,ac3,audio/x-ms-wma,wma,image/bmp,bmp,image/gif,gif,image/jpeg,jpg jpeg jpe,image/photoshop,psd,image/png,png,image/svg+xml,svg svgz,image/tiff,tiff tif,text/plain,asc txt text diff log,text/html,htm html xhtml,text/css,css,text/csv,csv,text/rtf,rtf,video/mpeg,mpeg mpg mpe m2v,video/quicktime,qt mov,video/mp4,mp4,video/x-m4v,m4v,video/x-flv,flv,video/x-ms-wmv,wmv,video/avi,avi,video/webm,webm,video/3gpp,3gpp 3gp,video/3gpp2,3g2,video/vnd.rn-realvideo,rv,video/ogg,ogv,video/x-matroska,mkv,application/vnd.oasis.opendocument.formula-template,otf,application/octet-stream,exe",i={mimes:{},extensions:{},addMimeType:function(e){var t=e.split(/,/),n,i,r;for(n=0;n<t.length;n+=2){for(r=t[n+1].split(/ /),i=0;i<r.length;i++)this.mimes[r[i]]=t[n];this.extensions[t[n]]=r}},extList2mimes:function(t,n){var i=this,r,o,a,s,u=[];for(o=0;o<t.length;o++)for(r=t[o].extensions.split(/\s*,\s*/),a=0;a<r.length;a++){if("*"===r[a])return[];if(s=i.mimes[r[a]])-1===e.inArray(s,u)&&u.push(s);else{if(!n||!/^\w+$/.test(r[a]))return[];u.push("."+r[a])}}return u},mimes2exts:function(t){var n=this,i=[];return e.each(t,function(t){if("*"===t)return i=[],!1;var r=t.match(/^(\w+)\/(\*|\w+)$/);r&&("*"===r[2]?e.each(n.extensions,function(e,t){new RegExp("^"+r[1]+"/").test(t)&&[].push.apply(i,n.extensions[t])}):n.extensions[t]&&[].push.apply(i,n.extensions[t]))}),i},mimes2extList:function(n){var i=[],r=[];return"string"===e.typeOf(n)&&(n=e.trim(n).split(/\s*,\s*/)),r=this.mimes2exts(n),i.push({title:t.translate("Files"),extensions:r.length?r.join(","):"*"}),i.mimes=n,i},getFileExtension:function(e){var t=e&&e.match(/\.([^.]+)$/);return t?t[1].toLowerCase():""},getFileMime:function(e){return this.mimes[this.getFileExtension(e)]||""}};return i.addMimeType(n),i}),i(d,[u],function(e){function t(e,t,n){var i=0,r=0,o=0,a={dev:-6,alpha:-5,a:-5,beta:-4,b:-4,RC:-3,rc:-3,"#":-2,p:1,pl:1},s=function(e){return e=(""+e).replace(/[_\-+]/g,"."),e=e.replace(/([^.\d]+)/g,".$1.").replace(/\.{2,}/g,"."),e.length?e.split("."):[-8]},u=function(e){return e?isNaN(e)?a[e]||-7:parseInt(e,10):0};for(e=s(e),t=s(t),r=Math.max(e.length,t.length),i=0;r>i;i++)if(e[i]!=t[i]){if(e[i]=u(e[i]),t[i]=u(t[i]),e[i]<t[i]){o=-1;break}if(e[i]>t[i]){o=1;break}}if(!n)return o;switch(n){case">":case"gt":return o>0;case">=":case"ge":return o>=0;case"<=":case"le":return 0>=o;case"==":case"=":case"eq":return 0===o;case"<>":case"!=":case"ne":return 0!==o;case"":case"<":case"lt":return 0>o;default:return null}}var n=function(e){var t="",n="?",i="function",r="undefined",o="object",a="major",s="model",u="name",c="type",l="vendor",d="version",f="architecture",p="console",h="mobile",m="tablet",g={has:function(e,t){return-1!==t.toLowerCase().indexOf(e.toLowerCase())},lowerize:function(e){return e.toLowerCase()}},v={rgx:function(){for(var t,n=0,a,s,u,c,l,d,f=arguments;n<f.length;n+=2){var p=f[n],h=f[n+1];if(typeof t===r){t={};for(u in h)c=h[u],typeof c===o?t[c[0]]=e:t[c]=e}for(a=s=0;a<p.length;a++)if(l=p[a].exec(this.getUA())){for(u=0;u<h.length;u++)d=l[++s],c=h[u],typeof c===o&&c.length>0?2==c.length?t[c[0]]=typeof c[1]==i?c[1].call(this,d):c[1]:3==c.length?t[c[0]]=typeof c[1]!==i||c[1].exec&&c[1].test?d?d.replace(c[1],c[2]):e:d?c[1].call(this,d,c[2]):e:4==c.length&&(t[c[0]]=d?c[3].call(this,d.replace(c[1],c[2])):e):t[c]=d?d:e;break}if(l)break}return t},str:function(t,i){for(var r in i)if(typeof i[r]===o&&i[r].length>0){for(var a=0;a<i[r].length;a++)if(g.has(i[r][a],t))return r===n?e:r}else if(g.has(i[r],t))return r===n?e:r;return t}},y={browser:{oldsafari:{major:{1:["/8","/1","/3"],2:"/4","?":"/"},version:{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}}},device:{sprint:{model:{"Evo Shift 4G":"7373KT"},vendor:{HTC:"APA",Sprint:"Sprint"}}},os:{windows:{version:{ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2000:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",RT:"ARM"}}}},w={browser:[[/(opera\smini)\/((\d+)?[\w\.-]+)/i,/(opera\s[mobiletab]+).+version\/((\d+)?[\w\.-]+)/i,/(opera).+version\/((\d+)?[\w\.]+)/i,/(opera)[\/\s]+((\d+)?[\w\.]+)/i],[u,d,a],[/\s(opr)\/((\d+)?[\w\.]+)/i],[[u,"Opera"],d,a],[/(kindle)\/((\d+)?[\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?((\d+)?[\w\.]+)*/i,/(avant\s|iemobile|slim|baidu)(?:browser)?[\/\s]?((\d+)?[\w\.]*)/i,/(?:ms|\()(ie)\s((\d+)?[\w\.]+)/i,/(rekonq)((?:\/)[\w\.]+)*/i,/(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron)\/((\d+)?[\w\.-]+)/i],[u,d,a],[/(trident).+rv[:\s]((\d+)?[\w\.]+).+like\sgecko/i],[[u,"IE"],d,a],[/(yabrowser)\/((\d+)?[\w\.]+)/i],[[u,"Yandex"],d,a],[/(comodo_dragon)\/((\d+)?[\w\.]+)/i],[[u,/_/g," "],d,a],[/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?((\d+)?[\w\.]+)/i],[u,d,a],[/(dolfin)\/((\d+)?[\w\.]+)/i],[[u,"Dolphin"],d,a],[/((?:android.+)crmo|crios)\/((\d+)?[\w\.]+)/i],[[u,"Chrome"],d,a],[/((?:android.+))version\/((\d+)?[\w\.]+)\smobile\ssafari/i],[[u,"Android Browser"],d,a],[/version\/((\d+)?[\w\.]+).+?mobile\/\w+\s(safari)/i],[d,a,[u,"Mobile Safari"]],[/version\/((\d+)?[\w\.]+).+?(mobile\s?safari|safari)/i],[d,a,u],[/webkit.+?(mobile\s?safari|safari)((\/[\w\.]+))/i],[u,[a,v.str,y.browser.oldsafari.major],[d,v.str,y.browser.oldsafari.version]],[/(konqueror)\/((\d+)?[\w\.]+)/i,/(webkit|khtml)\/((\d+)?[\w\.]+)/i],[u,d,a],[/(navigator|netscape)\/((\d+)?[\w\.-]+)/i],[[u,"Netscape"],d,a],[/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?((\d+)?[\w\.\+]+)/i,/(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix)\/((\d+)?[\w\.-]+)/i,/(mozilla)\/((\d+)?[\w\.]+).+rv\:.+gecko\/\d+/i,/(uc\s?browser|polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|qqbrowser)[\/\s]?((\d+)?[\w\.]+)/i,/(links)\s\(((\d+)?[\w\.]+)/i,/(gobrowser)\/?((\d+)?[\w\.]+)*/i,/(ice\s?browser)\/v?((\d+)?[\w\._]+)/i,/(mosaic)[\/\s]((\d+)?[\w\.]+)/i],[u,d,a]],engine:[[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m)\/([\w\.]+)/i,/(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i,/(icab)[\/\s]([23]\.[\d\.]+)/i],[u,d],[/rv\:([\w\.]+).*(gecko)/i],[d,u]],os:[[/(windows)\snt\s6\.2;\s(arm)/i,/(windows\sphone(?:\sos)*|windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i],[u,[d,v.str,y.os.windows.version]],[/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i],[[u,"Windows"],[d,v.str,y.os.windows.version]],[/\((bb)(10);/i],[[u,"BlackBerry"],d],[/(blackberry)\w*\/?([\w\.]+)*/i,/(tizen)\/([\w\.]+)/i,/(android|webos|palm\os|qnx|bada|rim\stablet\sos|meego)[\/\s-]?([\w\.]+)*/i],[u,d],[/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]+)*/i],[[u,"Symbian"],d],[/mozilla.+\(mobile;.+gecko.+firefox/i],[[u,"Firefox OS"],d],[/(nintendo|playstation)\s([wids3portablevu]+)/i,/(mint)[\/\s\(]?(\w+)*/i,/(joli|[kxln]?ubuntu|debian|[open]*suse|gentoo|arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk)[\/\s-]?([\w\.-]+)*/i,/(hurd|linux)\s?([\w\.]+)*/i,/(gnu)\s?([\w\.]+)*/i],[u,d],[/(cros)\s[\w]+\s([\w\.]+\w)/i],[[u,"Chromium OS"],d],[/(sunos)\s?([\w\.]+\d)*/i],[[u,"Solaris"],d],[/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]+)*/i],[u,d],[/(ip[honead]+)(?:.*os\s*([\w]+)*\slike\smac|;\sopera)/i],[[u,"iOS"],[d,/_/g,"."]],[/(mac\sos\sx)\s?([\w\s\.]+\w)*/i],[u,[d,/_/g,"."]],[/(haiku)\s(\w+)/i,/(aix)\s((\d)(?=\.|\)|\s)[\w\.]*)*/i,/(macintosh|mac(?=_powerpc)|plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos)/i,/(unix)\s?([\w\.]+)*/i],[u,d]]},E=function(e){var n=e||(window&&window.navigator&&window.navigator.userAgent?window.navigator.userAgent:t);this.getBrowser=function(){return v.rgx.apply(this,w.browser)},this.getEngine=function(){return v.rgx.apply(this,w.engine)},this.getOS=function(){return v.rgx.apply(this,w.os)},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS()}},this.getUA=function(){return n},this.setUA=function(e){return n=e,this},this.setUA(n)};return(new E).getResult()}(),i=function(){var t={define_property:function(){return!1}(),create_canvas:function(){var e=document.createElement("canvas");return!(!e.getContext||!e.getContext("2d"))}(),return_response_type:function(t){try{if(-1!==e.inArray(t,["","text","document"]))return!0;if(window.XMLHttpRequest){var n=new XMLHttpRequest;if(n.open("get","/"),"responseType"in n)return n.responseType=t,n.responseType!==t?!1:!0}}catch(i){}return!1},use_data_uri:function(){var e=new Image;return e.onload=function(){t.use_data_uri=1===e.width&&1===e.height},setTimeout(function(){e.src="data:image/gif;base64,R0lGODlhAQABAIAAAP8AAAAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw=="},1),!1}(),use_data_uri_over32kb:function(){return t.use_data_uri&&("IE"!==r.browser||r.version>=9)},use_data_uri_of:function(e){return t.use_data_uri&&33e3>e||t.use_data_uri_over32kb()},use_fileinput:function(){var e=document.createElement("input");return e.setAttribute("type","file"),!e.disabled}};return function(n){var i=[].slice.call(arguments);return i.shift(),"function"===e.typeOf(t[n])?t[n].apply(this,i):!!t[n]}}(),r={can:i,browser:n.browser.name,version:parseFloat(n.browser.major),os:n.os.name,osVersion:n.os.version,verComp:t,swf_url:"../flash/Moxie.swf",xap_url:"../silverlight/Moxie.xap",global_event_dispatcher:"moxie.core.EventTarget.instance.dispatchEvent"};return r.OS=r.os,r}),i(f,[d],function(e){var t=function(e){return"string"!=typeof e?e:document.getElementById(e)},n=function(e,t){if(!e.className)return!1;var n=new RegExp("(^|\\s+)"+t+"(\\s+|$)");return n.test(e.className)},i=function(e,t){n(e,t)||(e.className=e.className?e.className.replace(/\s+$/,"")+" "+t:t)},r=function(e,t){if(e.className){var n=new RegExp("(^|\\s+)"+t+"(\\s+|$)");e.className=e.className.replace(n,function(e,t,n){return" "===t&&" "===n?" ":""})}},o=function(e,t){return e.currentStyle?e.currentStyle[t]:window.getComputedStyle?window.getComputedStyle(e,null)[t]:void 0},a=function(t,n){function i(e){var t,n,i=0,r=0;return e&&(n=e.getBoundingClientRect(),t="CSS1Compat"===s.compatMode?s.documentElement:s.body,i=n.left+t.scrollLeft,r=n.top+t.scrollTop),{x:i,y:r}}var r=0,o=0,a,s=document,u,c;if(t=t,n=n||s.body,t&&t.getBoundingClientRect&&"IE"===e.browser&&(!s.documentMode||s.documentMode<8))return u=i(t),c=i(n),{x:u.x-c.x,y:u.y-c.y};for(a=t;a&&a!=n&&a.nodeType;)r+=a.offsetLeft||0,o+=a.offsetTop||0,a=a.offsetParent;for(a=t.parentNode;a&&a!=n&&a.nodeType;)r-=a.scrollLeft||0,o-=a.scrollTop||0,a=a.parentNode;return{x:r,y:o}},s=function(e){return{w:e.offsetWidth||e.clientWidth,h:e.offsetHeight||e.clientHeight}};return{get:t,hasClass:n,addClass:i,removeClass:r,getStyle:o,getPos:a,getSize:s}}),i(p,[u],function(e){function t(e,t){var n;for(n in e)if(e[n]===t)return n;return null}return{RuntimeError:function(){function n(e){this.code=e,this.name=t(i,e),this.message=this.name+": RuntimeError "+this.code}var i={NOT_INIT_ERR:1,NOT_SUPPORTED_ERR:9,JS_ERR:4};return e.extend(n,i),n.prototype=Error.prototype,n}(),OperationNotAllowedException:function(){function t(e){this.code=e,this.name="OperationNotAllowedException"}return e.extend(t,{NOT_ALLOWED_ERR:1}),t.prototype=Error.prototype,t}(),ImageError:function(){function n(e){this.code=e,this.name=t(i,e),this.message=this.name+": ImageError "+this.code}var i={WRONG_FORMAT:1,MAX_RESOLUTION_ERR:2};return e.extend(n,i),n.prototype=Error.prototype,n}(),FileException:function(){function n(e){this.code=e,this.name=t(i,e),this.message=this.name+": FileException "+this.code}var i={NOT_FOUND_ERR:1,SECURITY_ERR:2,ABORT_ERR:3,NOT_READABLE_ERR:4,ENCODING_ERR:5,NO_MODIFICATION_ALLOWED_ERR:6,INVALID_STATE_ERR:7,SYNTAX_ERR:8};return e.extend(n,i),n.prototype=Error.prototype,n}(),DOMException:function(){function n(e){this.code=e,this.name=t(i,e),this.message=this.name+": DOMException "+this.code}var i={INDEX_SIZE_ERR:1,DOMSTRING_SIZE_ERR:2,HIERARCHY_REQUEST_ERR:3,WRONG_DOCUMENT_ERR:4,INVALID_CHARACTER_ERR:5,NO_DATA_ALLOWED_ERR:6,NO_MODIFICATION_ALLOWED_ERR:7,NOT_FOUND_ERR:8,NOT_SUPPORTED_ERR:9,INUSE_ATTRIBUTE_ERR:10,INVALID_STATE_ERR:11,SYNTAX_ERR:12,INVALID_MODIFICATION_ERR:13,NAMESPACE_ERR:14,INVALID_ACCESS_ERR:15,VALIDATION_ERR:16,TYPE_MISMATCH_ERR:17,SECURITY_ERR:18,NETWORK_ERR:19,ABORT_ERR:20,URL_MISMATCH_ERR:21,QUOTA_EXCEEDED_ERR:22,TIMEOUT_ERR:23,INVALID_NODE_TYPE_ERR:24,DATA_CLONE_ERR:25};return e.extend(n,i),n.prototype=Error.prototype,n}(),EventException:function(){function t(e){this.code=e,this.name="EventException"}return e.extend(t,{UNSPECIFIED_EVENT_TYPE_ERR:0}),t.prototype=Error.prototype,t}()}}),i(h,[p,u],function(e,t){function n(){var n={};t.extend(this,{uid:null,init:function(){this.uid||(this.uid=t.guid("uid_"))},addEventListener:function(e,i,r,o){var a=this,s;return e=t.trim(e),/\s/.test(e)?(t.each(e.split(/\s+/),function(e){a.addEventListener(e,i,r,o)}),void 0):(e=e.toLowerCase(),r=parseInt(r,10)||0,s=n[this.uid]&&n[this.uid][e]||[],s.push({fn:i,priority:r,scope:o||this}),n[this.uid]||(n[this.uid]={}),n[this.uid][e]=s,void 0)},hasEventListener:function(e){return e?!(!n[this.uid]||!n[this.uid][e]):!!n[this.uid]},removeEventListener:function(e,i){e=e.toLowerCase();var r=n[this.uid]&&n[this.uid][e],o;if(r){if(i){for(o=r.length-1;o>=0;o--)if(r[o].fn===i){r.splice(o,1);break}}else r=[];r.length||(delete n[this.uid][e],t.isEmptyObj(n[this.uid])&&delete n[this.uid])}},removeAllEventListeners:function(){n[this.uid]&&delete n[this.uid]},dispatchEvent:function(i){var r,o,a,s,u={},c=!0,l;if("string"!==t.typeOf(i)){if(s=i,"string"!==t.typeOf(s.type))throw new e.EventException(e.EventException.UNSPECIFIED_EVENT_TYPE_ERR);i=s.type,s.total!==l&&s.loaded!==l&&(u.total=s.total,u.loaded=s.loaded),u.async=s.async||!1}if(-1!==i.indexOf("::")?function(e){r=e[0],i=e[1]}(i.split("::")):r=this.uid,i=i.toLowerCase(),o=n[r]&&n[r][i]){o.sort(function(e,t){return t.priority-e.priority}),a=[].slice.call(arguments),a.shift(),u.type=i,a.unshift(u);var d=[];t.each(o,function(e){a[0].target=e.scope,u.async?d.push(function(t){setTimeout(function(){t(e.fn.apply(e.scope,a)===!1)},1)}):d.push(function(t){t(e.fn.apply(e.scope,a)===!1)})}),d.length&&t.inSeries(d,function(e){c=!e})}return c},bind:function(){this.addEventListener.apply(this,arguments)},unbind:function(){this.removeEventListener.apply(this,arguments)},unbindAll:function(){this.removeAllEventListeners.apply(this,arguments)},trigger:function(){return this.dispatchEvent.apply(this,arguments)},convertEventPropsToHandlers:function(e){var n;"array"!==t.typeOf(e)&&(e=[e]);for(var i=0;i<e.length;i++)n="on"+e[i],"function"===t.typeOf(this[n])?this.addEventListener(e[i],this[n]):"undefined"===t.typeOf(this[n])&&(this[n]=null)}})}return n.instance=new n,n}),i(m,[],function(){var e=function(e){return unescape(encodeURIComponent(e))},t=function(e){return decodeURIComponent(escape(e))},n=function(e,n){if("function"==typeof window.atob)return n?t(window.atob(e)):window.atob(e);var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",r,o,a,s,u,c,l,d,f=0,p=0,h="",m=[];if(!e)return e;e+="";do s=i.indexOf(e.charAt(f++)),u=i.indexOf(e.charAt(f++)),c=i.indexOf(e.charAt(f++)),l=i.indexOf(e.charAt(f++)),d=s<<18|u<<12|c<<6|l,r=255&d>>16,o=255&d>>8,a=255&d,m[p++]=64==c?String.fromCharCode(r):64==l?String.fromCharCode(r,o):String.fromCharCode(r,o,a);while(f<e.length);return h=m.join(""),n?t(h):h},i=function(t,n){if(n&&e(t),"function"==typeof window.btoa)return window.btoa(t);var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",r,o,a,s,u,c,l,d,f=0,p=0,h="",m=[];if(!t)return t;do r=t.charCodeAt(f++),o=t.charCodeAt(f++),a=t.charCodeAt(f++),d=r<<16|o<<8|a,s=63&d>>18,u=63&d>>12,c=63&d>>6,l=63&d,m[p++]=i.charAt(s)+i.charAt(u)+i.charAt(c)+i.charAt(l);while(f<t.length);h=m.join("");var g=t.length%3;return(g?h.slice(0,g-3):h)+"===".slice(g||3)};return{utf8_encode:e,utf8_decode:t,atob:n,btoa:i}}),i(g,[u,f,h],function(e,t,n){function i(n,r,a,s,u){var c=this,l,d=e.guid(r+"_"),f=u||"browser";n=n||{},o[d]=this,a=e.extend({access_binary:!1,access_image_binary:!1,display_media:!1,do_cors:!1,drag_and_drop:!1,filter_by_extension:!0,resize_image:!1,report_upload_progress:!1,return_response_headers:!1,return_response_type:!1,return_status_code:!0,send_custom_headers:!1,select_file:!1,select_folder:!1,select_multiple:!0,send_binary_string:!1,send_browser_cookies:!0,send_multipart:!0,slice_blob:!1,stream_upload:!1,summon_file_dialog:!1,upload_filesize:!0,use_http_method:!0},a),n.preferred_caps&&(f=i.getMode(s,n.preferred_caps,f)),l=function(){var t={};return{exec:function(e,n,i,r){return l[n]&&(t[e]||(t[e]={context:this,instance:new l[n]}),t[e].instance[i])?t[e].instance[i].apply(this,r):void 0},removeInstance:function(e){delete t[e]},removeAllInstances:function(){var n=this;e.each(t,function(t,i){"function"===e.typeOf(t.instance.destroy)&&t.instance.destroy.call(t.context),n.removeInstance(i)})}}}(),e.extend(this,{initialized:!1,uid:d,type:r,mode:i.getMode(s,n.required_caps,f),shimid:d+"_container",clients:0,options:n,can:function(t,n){var r=arguments[2]||a;if("string"===e.typeOf(t)&&"undefined"===e.typeOf(n)&&(t=i.parseCaps(t)),"object"===e.typeOf(t)){for(var o in t)if(!this.can(o,t[o],r))return!1;return!0}return"function"===e.typeOf(r[t])?r[t].call(this,n):n===r[t]},getShimContainer:function(){var n,i=t.get(this.shimid);return i||(n=this.options.container?t.get(this.options.container):document.body,i=document.createElement("div"),i.id=this.shimid,i.className="moxie-shim moxie-shim-"+this.type,e.extend(i.style,{position:"absolute",top:"0px",left:"0px",width:"1px",height:"1px",overflow:"hidden"}),n.appendChild(i),n=null),i},getShim:function(){return l},shimExec:function(e,t){var n=[].slice.call(arguments,2);return c.getShim().exec.call(this,this.uid,e,t,n)},exec:function(e,t){var n=[].slice.call(arguments,2);return c[e]&&c[e][t]?c[e][t].apply(this,n):c.shimExec.apply(this,arguments)},destroy:function(){if(c){var e=t.get(this.shimid);e&&e.parentNode.removeChild(e),l&&l.removeAllInstances(),this.unbindAll(),delete o[this.uid],this.uid=null,d=c=l=e=null}}}),this.mode&&n.required_caps&&!this.can(n.required_caps)&&(this.mode=!1)}var r={},o={};return i.order="html5,flash,silverlight,html4",i.getRuntime=function(e){return o[e]?o[e]:!1},i.addConstructor=function(e,t){t.prototype=n.instance,r[e]=t},i.getConstructor=function(e){return r[e]||null},i.getInfo=function(e){var t=i.getRuntime(e);return t?{uid:t.uid,type:t.type,mode:t.mode,can:function(){return t.can.apply(t,arguments)}}:null},i.parseCaps=function(t){var n={};return"string"!==e.typeOf(t)?t||{}:(e.each(t.split(","),function(e){n[e]=!0}),n)},i.can=function(e,t){var n,r=i.getConstructor(e),o;return r?(n=new r({required_caps:t}),o=n.mode,n.destroy(),!!o):!1},i.thatCan=function(e,t){var n=(t||i.order).split(/\s*,\s*/);for(var r in n)if(i.can(n[r],e))return n[r];return null},i.getMode=function(t,n,i){var r=null;if("undefined"===e.typeOf(i)&&(i="browser"),n&&!e.isEmptyObj(t)){if(e.each(n,function(n,i){if(t.hasOwnProperty(i)){var o=t[i](n);if("string"==typeof o&&(o=[o]),r){if(!(r=e.arrayIntersect(r,o)))return r=!1}else r=o}}),r)return-1!==e.inArray(i,r)?i:r[0];if(r===!1)return!1}return i},i.capTrue=function(){return!0},i.capFalse=function(){return!1},i.capTest=function(e){return function(){return!!e}},i}),i(v,[p,u,g],function(e,t,n){return function i(){var i;t.extend(this,{connectRuntime:function(r){function o(t){var s,u;return t.length?(s=t.shift(),(u=n.getConstructor(s))?(i=new u(r),i.bind("Init",function(){i.initialized=!0,setTimeout(function(){i.clients++,a.trigger("RuntimeInit",i)},1)}),i.bind("Error",function(){i.destroy(),o(t)}),i.mode?(i.init(),void 0):(i.trigger("Error"),void 0)):(o(t),void 0)):(a.trigger("RuntimeError",new e.RuntimeError(e.RuntimeError.NOT_INIT_ERR)),i=null,void 0)}var a=this,s;if("string"===t.typeOf(r)?s=r:"string"===t.typeOf(r.ruid)&&(s=r.ruid),s){if(i=n.getRuntime(s))return i.clients++,i;throw new e.RuntimeError(e.RuntimeError.NOT_INIT_ERR)}o((r.runtime_order||n.order).split(/\s*,\s*/))},getRuntime:function(){return i&&i.uid?i:(i=null,null)},disconnectRuntime:function(){i&&--i.clients<=0&&(i.destroy(),i=null)}})}}),i(y,[u,m,v],function(e,t,n){function i(o,a){function s(t,n,o){var a,s=r[this.uid];return"string"===e.typeOf(s)&&s.length?(a=new i(null,{type:o,size:n-t}),a.detach(s.substr(t,a.size)),a):null}n.call(this),o&&this.connectRuntime(o),a?"string"===e.typeOf(a)&&(a={data:a}):a={},e.extend(this,{uid:a.uid||e.guid("uid_"),ruid:o,size:a.size||0,type:a.type||"",slice:function(e,t,n){return this.isDetached()?s.apply(this,arguments):this.getRuntime().exec.call(this,"Blob","slice",this.getSource(),e,t,n)},getSource:function(){return r[this.uid]?r[this.uid]:null},detach:function(e){this.ruid&&(this.getRuntime().exec.call(this,"Blob","destroy",r[this.uid]),this.disconnectRuntime(),this.ruid=null),e=e||"";var n=e.match(/^data:([^;]*);base64,/);n&&(this.type=n[1],e=t.atob(e.substring(e.indexOf("base64,")+7))),this.size=e.length,r[this.uid]=e},isDetached:function(){return!this.ruid&&"string"===e.typeOf(r[this.uid])},destroy:function(){this.detach(),delete r[this.uid]}}),a.data?this.detach(a.data):r[this.uid]=a}var r={};return i}),i(w,[u,l,y],function(e,t,n){function i(i,r){var o,a;if(r||(r={}),a=r.type&&""!==r.type?r.type:t.getFileMime(r.name),r.name)o=r.name.replace(/\\/g,"/"),o=o.substr(o.lastIndexOf("/")+1);else{var s=a.split("/")[0];o=e.guid((""!==s?s:"file")+"_"),t.extensions[a]&&(o+="."+t.extensions[a][0])}n.apply(this,arguments),e.extend(this,{type:a||"",name:o||e.guid("file_"),lastModifiedDate:r.lastModifiedDate||(new Date).toLocaleString()})}return i.prototype=n.prototype,i}),i(E,[u,l,f,p,h,c,w,g,v],function(e,t,n,i,r,o,a,s,u){function c(r){var c=this,d,f,p;if(-1!==e.inArray(e.typeOf(r),["string","node"])&&(r={browse_button:r}),f=n.get(r.browse_button),!f)throw new i.DOMException(i.DOMException.NOT_FOUND_ERR);p={accept:[{title:o.translate("All Files"),extensions:"*"}],name:"file",multiple:!1,required_caps:!1,container:f.parentNode||document.body},r=e.extend({},p,r),"string"==typeof r.required_caps&&(r.required_caps=s.parseCaps(r.required_caps)),"string"==typeof r.accept&&(r.accept=t.mimes2extList(r.accept)),d=n.get(r.container),d||(d=document.body),"static"===n.getStyle(d,"position")&&(d.style.position="relative"),d=f=null,u.call(c),e.extend(c,{uid:e.guid("uid_"),ruid:null,shimid:null,files:null,init:function(){c.convertEventPropsToHandlers(l),c.bind("RuntimeInit",function(t,i){c.ruid=i.uid,c.shimid=i.shimid,c.bind("Ready",function(){c.trigger("Refresh")},999),c.bind("Change",function(){var t=i.exec.call(c,"FileInput","getFiles");c.files=[],e.each(t,function(e){return 0===e.size?!0:(c.files.push(new a(c.ruid,e)),void 0)})},999),c.bind("Refresh",function(){var t,o,a,s;a=n.get(r.browse_button),s=n.get(i.shimid),a&&(t=n.getPos(a,n.get(r.container)),o=n.getSize(a),s&&e.extend(s.style,{top:t.y+"px",left:t.x+"px",width:o.w+"px",height:o.h+"px"})),s=a=null}),i.exec.call(c,"FileInput","init",r)}),c.connectRuntime(e.extend({},r,{required_caps:{select_file:!0}}))},disable:function(t){var n=this.getRuntime();n&&n.exec.call(this,"FileInput","disable","undefined"===e.typeOf(t)?!0:t)},refresh:function(){c.trigger("Refresh")},destroy:function(){var t=this.getRuntime();t&&(t.exec.call(this,"FileInput","destroy"),this.disconnectRuntime()),"array"===e.typeOf(this.files)&&e.each(this.files,function(e){e.destroy()}),this.files=null}})}var l=["ready","change","cancel","mouseenter","mouseleave","mousedown","mouseup"];return c.prototype=r.instance,c}),i(_,[c,f,p,u,w,v,h,l],function(e,t,n,i,r,o,a,s){function u(n){var a=this,u;"string"==typeof n&&(n={drop_zone:n}),u={accept:[{title:e.translate("All Files"),extensions:"*"}],required_caps:{drag_and_drop:!0}},n="object"==typeof n?i.extend({},u,n):u,n.container=t.get(n.drop_zone)||document.body,"static"===t.getStyle(n.container,"position")&&(n.container.style.position="relative"),"string"==typeof n.accept&&(n.accept=s.mimes2extList(n.accept)),o.call(a),i.extend(a,{uid:i.guid("uid_"),ruid:null,files:null,init:function(){a.convertEventPropsToHandlers(c),a.bind("RuntimeInit",function(e,t){a.ruid=t.uid,a.bind("Drop",function(){var e=t.exec.call(a,"FileDrop","getFiles");a.files=[],i.each(e,function(e){a.files.push(new r(a.ruid,e))})},999),t.exec.call(a,"FileDrop","init",n),a.dispatchEvent("ready")}),a.connectRuntime(n)},destroy:function(){var e=this.getRuntime();e&&(e.exec.call(this,"FileDrop","destroy"),this.disconnectRuntime()),this.files=null}})}var c=["ready","dragenter","dragleave","drop","error"];return u.prototype=a.instance,u}),i(x,[u,v,h],function(e,t,n){function i(){this.uid=e.guid("uid_"),t.call(this),this.destroy=function(){this.disconnectRuntime(),this.unbindAll()}}return i.prototype=n.instance,i}),i(R,[u,m,p,h,y,w,x],function(e,t,n,i,r,o,a){function s(){function i(e,i){function l(e){o.readyState=s.DONE,o.error=e,o.trigger("error"),d()}function d(){c.destroy(),c=null,o.trigger("loadend")}function f(t){c.bind("Error",function(e,t){l(t)}),c.bind("Progress",function(e){o.result=t.exec.call(c,"FileReader","getResult"),o.trigger(e)}),c.bind("Load",function(e){o.readyState=s.DONE,o.result=t.exec.call(c,"FileReader","getResult"),o.trigger(e),d()}),t.exec.call(c,"FileReader","read",e,i)}if(c=new a,this.convertEventPropsToHandlers(u),this.readyState===s.LOADING)return l(new n.DOMException(n.DOMException.INVALID_STATE_ERR));if(this.readyState=s.LOADING,this.trigger("loadstart"),i instanceof r)if(i.isDetached()){var p=i.getSource();switch(e){case"readAsText":case"readAsBinaryString":this.result=p;break;case"readAsDataURL":this.result="data:"+i.type+";base64,"+t.btoa(p)}this.readyState=s.DONE,this.trigger("load"),d()}else f(c.connectRuntime(i.ruid));else l(new n.DOMException(n.DOMException.NOT_FOUND_ERR))}var o=this,c;e.extend(this,{uid:e.guid("uid_"),readyState:s.EMPTY,result:null,error:null,readAsBinaryString:function(e){i.call(this,"readAsBinaryString",e)},readAsDataURL:function(e){i.call(this,"readAsDataURL",e)},readAsText:function(e){i.call(this,"readAsText",e) -},abort:function(){this.result=null,-1===e.inArray(this.readyState,[s.EMPTY,s.DONE])&&(this.readyState===s.LOADING&&(this.readyState=s.DONE),c&&c.getRuntime().exec.call(this,"FileReader","abort"),this.trigger("abort"),this.trigger("loadend"))},destroy:function(){this.abort(),c&&(c.getRuntime().exec.call(this,"FileReader","destroy"),c.disconnectRuntime()),o=c=null}})}var u=["loadstart","progress","load","abort","error","loadend"];return s.EMPTY=0,s.LOADING=1,s.DONE=2,s.prototype=i.instance,s}),i(b,[],function(){var e=function(t,n){for(var i=["source","scheme","authority","userInfo","user","pass","host","port","relative","path","directory","file","query","fragment"],r=i.length,o={http:80,https:443},a={},s=/^(?:([^:\/?#]+):)?(?:\/\/()(?:(?:()(?:([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?))?()(?:(()(?:(?:[^?#\/]*\/)*)()(?:[^?#]*))(?:\\?([^#]*))?(?:#(.*))?)/,u=s.exec(t||"");r--;)u[r]&&(a[i[r]]=u[r]);if(!a.scheme){n&&"string"!=typeof n||(n=e(n||document.location.href)),a.scheme=n.scheme,a.host=n.host,a.port=n.port;var c="";/^[^\/]/.test(a.path)&&(c=n.path,/(\/|\/[^\.]+)$/.test(c)?c+="/":c=c.replace(/\/[^\/]+$/,"/")),a.path=c+(a.path||"")}return a.port||(a.port=o[a.scheme]||80),a.port=parseInt(a.port,10),a.path||(a.path="/"),delete a.source,a},t=function(t){var n={http:80,https:443},i=e(t);return i.scheme+"://"+i.host+(i.port!==n[i.scheme]?":"+i.port:"")+i.path+(i.query?i.query:"")},n=function(t){function n(e){return[e.scheme,e.host,e.port].join("/")}return"string"==typeof t&&(t=e(t)),n(e())===n(t)};return{parseUrl:e,resolveUrl:t,hasSameOrigin:n}}),i(T,[u,v,m],function(e,t,n){return function(){function i(e,t){if(!t.isDetached()){var i=this.connectRuntime(t.ruid).exec.call(this,"FileReaderSync","read",e,t);return this.disconnectRuntime(),i}var r=t.getSource();switch(e){case"readAsBinaryString":return r;case"readAsDataURL":return"data:"+t.type+";base64,"+n.btoa(r);case"readAsText":for(var o="",a=0,s=r.length;s>a;a++)o+=String.fromCharCode(r[a]);return o}}t.call(this),e.extend(this,{uid:e.guid("uid_"),readAsBinaryString:function(e){return i.call(this,"readAsBinaryString",e)},readAsDataURL:function(e){return i.call(this,"readAsDataURL",e)},readAsText:function(e){return i.call(this,"readAsText",e)}})}}),i(S,[p,u,y],function(e,t,n){function i(){var e,i=[];t.extend(this,{append:function(r,o){var a=this,s=t.typeOf(o);o instanceof n?e={name:r,value:o}:"array"===s?(r+="[]",t.each(o,function(e){a.append(r,e)})):"object"===s?t.each(o,function(e,t){a.append(r+"["+t+"]",e)}):"null"===s||"undefined"===s||"number"===s&&isNaN(o)?a.append(r,"false"):i.push({name:r,value:o.toString()})},hasBlob:function(){return!!this.getBlob()},getBlob:function(){return e&&e.value||null},getBlobName:function(){return e&&e.name||null},each:function(n){t.each(i,function(e){n(e.value,e.name)}),e&&n(e.value,e.name)},destroy:function(){e=null,i=[]}})}return i}),i(A,[u,p,h,m,b,g,x,y,T,S,d,l],function(e,t,n,i,r,o,a,s,u,c,l,d){function f(){this.uid=e.guid("uid_")}function p(){function n(e,t){return y.hasOwnProperty(e)?1===arguments.length?l.can("define_property")?y[e]:v[e]:(l.can("define_property")?y[e]=t:v[e]=t,void 0):void 0}function u(t){function i(){k.destroy(),k=null,s.dispatchEvent("loadend"),s=null}function r(r){k.bind("LoadStart",function(e){n("readyState",p.LOADING),s.dispatchEvent("readystatechange"),s.dispatchEvent(e),I&&s.upload.dispatchEvent(e)}),k.bind("Progress",function(e){n("readyState")!==p.LOADING&&(n("readyState",p.LOADING),s.dispatchEvent("readystatechange")),s.dispatchEvent(e)}),k.bind("UploadProgress",function(e){I&&s.upload.dispatchEvent({type:"progress",lengthComputable:!1,total:e.total,loaded:e.loaded})}),k.bind("Load",function(t){n("readyState",p.DONE),n("status",Number(r.exec.call(k,"XMLHttpRequest","getStatus")||0)),n("statusText",h[n("status")]||""),n("response",r.exec.call(k,"XMLHttpRequest","getResponse",n("responseType"))),~e.inArray(n("responseType"),["text",""])?n("responseText",n("response")):"document"===n("responseType")&&n("responseXML",n("response")),U=r.exec.call(k,"XMLHttpRequest","getAllResponseHeaders"),s.dispatchEvent("readystatechange"),n("status")>0?(I&&s.upload.dispatchEvent(t),s.dispatchEvent(t)):(N=!0,s.dispatchEvent("error")),i()}),k.bind("Abort",function(e){s.dispatchEvent(e),i()}),k.bind("Error",function(e){N=!0,n("readyState",p.DONE),s.dispatchEvent("readystatechange"),D=!0,s.dispatchEvent(e),i()}),r.exec.call(k,"XMLHttpRequest","send",{url:E,method:_,async:w,user:R,password:b,headers:x,mimeType:S,encoding:T,responseType:s.responseType,withCredentials:s.withCredentials,options:P},t)}var s=this;M=(new Date).getTime(),k=new a,"string"==typeof P.required_caps&&(P.required_caps=o.parseCaps(P.required_caps)),P.required_caps=e.extend({},P.required_caps,{return_response_type:s.responseType}),t instanceof c&&(P.required_caps.send_multipart=!0),L||(P.required_caps.do_cors=!0),P.ruid?r(k.connectRuntime(P)):(k.bind("RuntimeInit",function(e,t){r(t)}),k.bind("RuntimeError",function(e,t){s.dispatchEvent("RuntimeError",t)}),k.connectRuntime(P))}function g(){n("responseText",""),n("responseXML",null),n("response",null),n("status",0),n("statusText",""),M=C=null}var v=this,y={timeout:0,readyState:p.UNSENT,withCredentials:!1,status:0,statusText:"",responseType:"",responseXML:null,responseText:null,response:null},w=!0,E,_,x={},R,b,T=null,S=null,A=!1,O=!1,I=!1,D=!1,N=!1,L=!1,M,C,F=null,H=null,P={},k,U="",B;e.extend(this,y,{uid:e.guid("uid_"),upload:new f,open:function(o,a,s,u,c){var l;if(!o||!a)throw new t.DOMException(t.DOMException.SYNTAX_ERR);if(/[\u0100-\uffff]/.test(o)||i.utf8_encode(o)!==o)throw new t.DOMException(t.DOMException.SYNTAX_ERR);if(~e.inArray(o.toUpperCase(),["CONNECT","DELETE","GET","HEAD","OPTIONS","POST","PUT","TRACE","TRACK"])&&(_=o.toUpperCase()),~e.inArray(_,["CONNECT","TRACE","TRACK"]))throw new t.DOMException(t.DOMException.SECURITY_ERR);if(a=i.utf8_encode(a),l=r.parseUrl(a),L=r.hasSameOrigin(l),E=r.resolveUrl(a),(u||c)&&!L)throw new t.DOMException(t.DOMException.INVALID_ACCESS_ERR);if(R=u||l.user,b=c||l.pass,w=s||!0,w===!1&&(n("timeout")||n("withCredentials")||""!==n("responseType")))throw new t.DOMException(t.DOMException.INVALID_ACCESS_ERR);A=!w,O=!1,x={},g.call(this),n("readyState",p.OPENED),this.convertEventPropsToHandlers(["readystatechange"]),this.dispatchEvent("readystatechange")},setRequestHeader:function(r,o){var a=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","content-transfer-encoding","date","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","user-agent","via"];if(n("readyState")!==p.OPENED||O)throw new t.DOMException(t.DOMException.INVALID_STATE_ERR);if(/[\u0100-\uffff]/.test(r)||i.utf8_encode(r)!==r)throw new t.DOMException(t.DOMException.SYNTAX_ERR);return r=e.trim(r).toLowerCase(),~e.inArray(r,a)||/^(proxy\-|sec\-)/.test(r)?!1:(x[r]?x[r]+=", "+o:x[r]=o,!0)},getAllResponseHeaders:function(){return U||""},getResponseHeader:function(t){return t=t.toLowerCase(),N||~e.inArray(t,["set-cookie","set-cookie2"])?null:U&&""!==U&&(B||(B={},e.each(U.split(/\r\n/),function(t){var n=t.split(/:\s+/);2===n.length&&(n[0]=e.trim(n[0]),B[n[0].toLowerCase()]={header:n[0],value:e.trim(n[1])})})),B.hasOwnProperty(t))?B[t].header+": "+B[t].value:null},overrideMimeType:function(i){var r,o;if(~e.inArray(n("readyState"),[p.LOADING,p.DONE]))throw new t.DOMException(t.DOMException.INVALID_STATE_ERR);if(i=e.trim(i.toLowerCase()),/;/.test(i)&&(r=i.match(/^([^;]+)(?:;\scharset\=)?(.*)$/))&&(i=r[1],r[2]&&(o=r[2])),!d.mimes[i])throw new t.DOMException(t.DOMException.SYNTAX_ERR);F=i,H=o},send:function(n,r){if(P="string"===e.typeOf(r)?{ruid:r}:r?r:{},this.convertEventPropsToHandlers(m),this.upload.convertEventPropsToHandlers(m),this.readyState!==p.OPENED||O)throw new t.DOMException(t.DOMException.INVALID_STATE_ERR);if(n instanceof s)P.ruid=n.ruid,S=n.type||"application/octet-stream";else if(n instanceof c){if(n.hasBlob()){var o=n.getBlob();P.ruid=o.ruid,S=o.type||"application/octet-stream"}}else"string"==typeof n&&(T="UTF-8",S="text/plain;charset=UTF-8",n=i.utf8_encode(n));this.withCredentials||(this.withCredentials=P.required_caps&&P.required_caps.send_browser_cookies&&!L),I=!A&&this.upload.hasEventListener(),N=!1,D=!n,A||(O=!0),u.call(this,n)},abort:function(){if(N=!0,A=!1,~e.inArray(n("readyState"),[p.UNSENT,p.OPENED,p.DONE]))n("readyState",p.UNSENT);else{if(n("readyState",p.DONE),O=!1,!k)throw new t.DOMException(t.DOMException.INVALID_STATE_ERR);k.getRuntime().exec.call(k,"XMLHttpRequest","abort",D),D=!0}},destroy:function(){k&&("function"===e.typeOf(k.destroy)&&k.destroy(),k=null),this.unbindAll(),this.upload&&(this.upload.unbindAll(),this.upload=null)}})}var h={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",306:"Reserved",307:"Temporary Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Request Entity Too Large",414:"Request-URI Too Long",415:"Unsupported Media Type",416:"Requested Range Not Satisfiable",417:"Expectation Failed",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",426:"Upgrade Required",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",510:"Not Extended"};f.prototype=n.instance;var m=["loadstart","progress","abort","error","load","timeout","loadend"],g=1,v=2;return p.UNSENT=0,p.OPENED=1,p.HEADERS_RECEIVED=2,p.LOADING=3,p.DONE=4,p.prototype=n.instance,p}),i(O,[u,m,v,h],function(e,t,n,i){function r(){function i(){l=d=0,c=this.result=null}function o(t,n){var i=this;u=n,i.bind("TransportingProgress",function(t){d=t.loaded,l>d&&-1===e.inArray(i.state,[r.IDLE,r.DONE])&&a.call(i)},999),i.bind("TransportingComplete",function(){d=l,i.state=r.DONE,c=null,i.result=u.exec.call(i,"Transporter","getAsBlob",t||"")},999),i.state=r.BUSY,i.trigger("TransportingStarted"),a.call(i)}function a(){var e=this,n,i=l-d;f>i&&(f=i),n=t.btoa(c.substr(d,f)),u.exec.call(e,"Transporter","receive",n,l)}var s,u,c,l,d,f;n.call(this),e.extend(this,{uid:e.guid("uid_"),state:r.IDLE,result:null,transport:function(t,n,r){var a=this;if(r=e.extend({chunk_size:204798},r),(s=r.chunk_size%3)&&(r.chunk_size+=3-s),f=r.chunk_size,i.call(this),c=t,l=t.length,"string"===e.typeOf(r)||r.ruid)o.call(a,n,this.connectRuntime(r));else{var u=function(e,t){a.unbind("RuntimeInit",u),o.call(a,n,t)};this.bind("RuntimeInit",u),this.connectRuntime(r)}},abort:function(){var e=this;e.state=r.IDLE,u&&(u.exec.call(e,"Transporter","clear"),e.trigger("TransportingAborted")),i.call(e)},destroy:function(){this.unbindAll(),u=null,this.disconnectRuntime(),i.call(this)}})}return r.IDLE=0,r.BUSY=1,r.DONE=2,r.prototype=i.instance,r}),i(I,[u,f,p,T,A,g,v,O,d,h,y,w,m],function(e,t,n,i,r,o,a,s,u,c,l,d,f){function p(){function i(e){e||(e=this.getRuntime().exec.call(this,"Image","getInfo")),this.size=e.size,this.width=e.width,this.height=e.height,this.type=e.type,this.meta=e.meta,""===this.name&&(this.name=e.name)}function c(t){var i=e.typeOf(t);try{if(t instanceof p){if(!t.size)throw new n.DOMException(n.DOMException.INVALID_STATE_ERR);m.apply(this,arguments)}else if(t instanceof l){if(!~e.inArray(t.type,["image/jpeg","image/png"]))throw new n.ImageError(n.ImageError.WRONG_FORMAT);g.apply(this,arguments)}else if(-1!==e.inArray(i,["blob","file"]))c.call(this,new d(null,t),arguments[1]);else if("string"===i)/^data:[^;]*;base64,/.test(t)?c.call(this,new l(null,{data:t}),arguments[1]):v.apply(this,arguments);else{if("node"!==i||"img"!==t.nodeName.toLowerCase())throw new n.DOMException(n.DOMException.TYPE_MISMATCH_ERR);c.call(this,t.src,arguments[1])}}catch(r){this.trigger("error",r)}}function m(t,n){var i=this.connectRuntime(t.ruid);this.ruid=i.uid,i.exec.call(this,"Image","loadFromImage",t,"undefined"===e.typeOf(n)?!0:n)}function g(t,n){function i(e){r.ruid=e.uid,e.exec.call(r,"Image","loadFromBlob",t)}var r=this;r.name=t.name||"",t.isDetached()?(this.bind("RuntimeInit",function(e,t){i(t)}),n&&"string"==typeof n.required_caps&&(n.required_caps=o.parseCaps(n.required_caps)),this.connectRuntime(e.extend({required_caps:{access_image_binary:!0,resize_image:!0}},n))):i(this.connectRuntime(t.ruid))}function v(e,t){var n=this,i;i=new r,i.open("get",e),i.responseType="blob",i.onprogress=function(e){n.trigger(e)},i.onload=function(){g.call(n,i.response,!0)},i.onerror=function(e){n.trigger(e)},i.onloadend=function(){i.destroy()},i.bind("RuntimeError",function(e,t){n.trigger("RuntimeError",t)}),i.send(null,t)}a.call(this),e.extend(this,{uid:e.guid("uid_"),ruid:null,name:"",size:0,width:0,height:0,type:"",meta:{},clone:function(){this.load.apply(this,arguments)},load:function(){this.bind("Load Resize",function(){i.call(this)},999),this.convertEventPropsToHandlers(h),c.apply(this,arguments)},downsize:function(t,i,r,o){try{if(!this.size)throw new n.DOMException(n.DOMException.INVALID_STATE_ERR);if(this.width>p.MAX_RESIZE_WIDTH||this.height>p.MAX_RESIZE_HEIGHT)throw new n.ImageError(n.ImageError.MAX_RESOLUTION_ERR);(!t&&!i||"undefined"===e.typeOf(r))&&(r=!1),t=t||this.width,i=i||this.height,o="undefined"===e.typeOf(o)?!0:!!o,this.getRuntime().exec.call(this,"Image","downsize",t,i,r,o)}catch(a){this.trigger("error",a)}},crop:function(e,t,n){this.downsize(e,t,!0,n)},getAsCanvas:function(){if(!u.can("create_canvas"))throw new n.RuntimeError(n.RuntimeError.NOT_SUPPORTED_ERR);var e=this.connectRuntime(this.ruid);return e.exec.call(this,"Image","getAsCanvas")},getAsBlob:function(e,t){if(!this.size)throw new n.DOMException(n.DOMException.INVALID_STATE_ERR);return e||(e="image/jpeg"),"image/jpeg"!==e||t||(t=90),this.getRuntime().exec.call(this,"Image","getAsBlob",e,t)},getAsDataURL:function(e,t){if(!this.size)throw new n.DOMException(n.DOMException.INVALID_STATE_ERR);return this.getRuntime().exec.call(this,"Image","getAsDataURL",e,t)},getAsBinaryString:function(e,t){var n=this.getAsDataURL(e,t);return f.atob(n.substring(n.indexOf("base64,")+7))},embed:function(i){function r(){if(u.can("create_canvas")){var t=a.getAsCanvas();if(t)return i.appendChild(t),t=null,a.destroy(),o.trigger("embedded"),void 0}var r=a.getAsDataURL(c,l);if(!r)throw new n.ImageError(n.ImageError.WRONG_FORMAT);if(u.can("use_data_uri_of",r.length))i.innerHTML='<img src="'+r+'" width="'+a.width+'" height="'+a.height+'" />',a.destroy(),o.trigger("embedded");else{var d=new s;d.bind("TransportingComplete",function(){v=o.connectRuntime(this.result.ruid),o.bind("Embedded",function(){e.extend(v.getShimContainer().style,{top:"0px",left:"0px",width:a.width+"px",height:a.height+"px"}),v=null},999),v.exec.call(o,"ImageView","display",this.result.uid,m,g),a.destroy()}),d.transport(f.atob(r.substring(r.indexOf("base64,")+7)),c,e.extend({},h,{required_caps:{display_media:!0},runtime_order:"flash,silverlight",container:i}))}}var o=this,a,c,l,d,h=arguments[1]||{},m=this.width,g=this.height,v;try{if(!(i=t.get(i)))throw new n.DOMException(n.DOMException.INVALID_NODE_TYPE_ERR);if(!this.size)throw new n.DOMException(n.DOMException.INVALID_STATE_ERR);if(this.width>p.MAX_RESIZE_WIDTH||this.height>p.MAX_RESIZE_HEIGHT)throw new n.ImageError(n.ImageError.MAX_RESOLUTION_ERR);if(c=h.type||this.type||"image/jpeg",l=h.quality||90,d="undefined"!==e.typeOf(h.crop)?h.crop:!1,h.width)m=h.width,g=h.height||m;else{var y=t.getSize(i);y.w&&y.h&&(m=y.w,g=y.h)}return a=new p,a.bind("Resize",function(){r.call(o)}),a.bind("Load",function(){a.downsize(m,g,d,!1)}),a.clone(this,!1),a}catch(w){this.trigger("error",w)}},destroy:function(){this.ruid&&(this.getRuntime().exec.call(this,"Image","destroy"),this.disconnectRuntime()),this.unbindAll()}})}var h=["progress","load","error","resize","embedded"];return p.MAX_RESIZE_WIDTH=6500,p.MAX_RESIZE_HEIGHT=6500,p.prototype=c.instance,p}),i(D,[u,p,g,d],function(e,t,n,i){function r(t){var r=this,s=n.capTest,u=n.capTrue,c=e.extend({access_binary:s(window.FileReader||window.File&&window.File.getAsDataURL),access_image_binary:function(){return r.can("access_binary")&&!!a.Image},display_media:s(i.can("create_canvas")||i.can("use_data_uri_over32kb")),do_cors:s(window.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest),drag_and_drop:s(function(){var e=document.createElement("div");return("draggable"in e||"ondragstart"in e&&"ondrop"in e)&&("IE"!==i.browser||i.version>9)}()),filter_by_extension:s(function(){return"Chrome"===i.browser&&i.version>=28||"IE"===i.browser&&i.version>=10}()),return_response_headers:u,return_response_type:function(e){return"json"===e&&window.JSON?!0:i.can("return_response_type",e)},return_status_code:u,report_upload_progress:s(window.XMLHttpRequest&&(new XMLHttpRequest).upload),resize_image:function(){return r.can("access_binary")&&i.can("create_canvas")},select_file:function(){return i.can("use_fileinput")&&window.File},select_folder:function(){return r.can("select_file")&&"Chrome"===i.browser&&i.version>=21},select_multiple:function(){return!(!r.can("select_file")||"Safari"===i.browser&&"Windows"===i.os||"iOS"===i.os&&i.verComp(i.osVersion,"7.0.4","<"))},send_binary_string:s(window.XMLHttpRequest&&((new XMLHttpRequest).sendAsBinary||window.Uint8Array&&window.ArrayBuffer)),send_custom_headers:s(window.XMLHttpRequest),send_multipart:function(){return!!(window.XMLHttpRequest&&(new XMLHttpRequest).upload&&window.FormData)||r.can("send_binary_string")},slice_blob:s(window.File&&(File.prototype.mozSlice||File.prototype.webkitSlice||File.prototype.slice)),stream_upload:function(){return r.can("slice_blob")&&r.can("send_multipart")},summon_file_dialog:s(function(){return"Firefox"===i.browser&&i.version>=4||"Opera"===i.browser&&i.version>=12||"IE"===i.browser&&i.version>=10||!!~e.inArray(i.browser,["Chrome","Safari"])}()),upload_filesize:u},arguments[2]);n.call(this,t,arguments[1]||o,c),e.extend(this,{init:function(){this.trigger("Init")},destroy:function(e){return function(){e.call(r),e=r=null}}(this.destroy)}),e.extend(this.getShim(),a)}var o="html5",a={};return n.addConstructor(o,r),a}),i(N,[D,y],function(e,t){function n(){function e(e,t,n){var i;if(!window.File.prototype.slice)return(i=window.File.prototype.webkitSlice||window.File.prototype.mozSlice)?i.call(e,t,n):null;try{return e.slice(),e.slice(t,n)}catch(r){return e.slice(t,n-t)}}this.slice=function(){return new t(this.getRuntime().uid,e.apply(this,arguments))}}return e.Blob=n}),i(L,[u],function(e){function t(){this.returnValue=!1}function n(){this.cancelBubble=!0}var i={},r="moxie_"+e.guid(),o=function(o,a,s,u){var c,l;a=a.toLowerCase(),o.addEventListener?(c=s,o.addEventListener(a,c,!1)):o.attachEvent&&(c=function(){var e=window.event;e.target||(e.target=e.srcElement),e.preventDefault=t,e.stopPropagation=n,s(e)},o.attachEvent("on"+a,c)),o[r]||(o[r]=e.guid()),i.hasOwnProperty(o[r])||(i[o[r]]={}),l=i[o[r]],l.hasOwnProperty(a)||(l[a]=[]),l[a].push({func:c,orig:s,key:u})},a=function(t,n,o){var a,s;if(n=n.toLowerCase(),t[r]&&i[t[r]]&&i[t[r]][n]){a=i[t[r]][n];for(var u=a.length-1;u>=0&&(a[u].orig!==o&&a[u].key!==o||(t.removeEventListener?t.removeEventListener(n,a[u].func,!1):t.detachEvent&&t.detachEvent("on"+n,a[u].func),a[u].orig=null,a[u].func=null,a.splice(u,1),o===s));u--);if(a.length||delete i[t[r]][n],e.isEmptyObj(i[t[r]])){delete i[t[r]];try{delete t[r]}catch(c){t[r]=s}}}},s=function(t,n){t&&t[r]&&e.each(i[t[r]],function(e,i){a(t,i,n)})};return{addEvent:o,removeEvent:a,removeAllEvents:s}}),i(M,[D,u,f,L,l,d],function(e,t,n,i,r,o){function a(){var e=[],a;t.extend(this,{init:function(s){var u=this,c=u.getRuntime(),l,d,f,p,h,m;a=s,e=[],f=a.accept.mimes||r.extList2mimes(a.accept,c.can("filter_by_extension")),d=c.getShimContainer(),d.innerHTML='<input id="'+c.uid+'" type="file" style="font-size:999px;opacity:0;"'+(a.multiple&&c.can("select_multiple")?"multiple":"")+(a.directory&&c.can("select_folder")?"webkitdirectory directory":"")+(f?' accept="'+f.join(",")+'"':"")+" />",l=n.get(c.uid),t.extend(l.style,{position:"absolute",top:0,left:0,width:"100%",height:"100%"}),p=n.get(a.browse_button),c.can("summon_file_dialog")&&("static"===n.getStyle(p,"position")&&(p.style.position="relative"),h=parseInt(n.getStyle(p,"z-index"),10)||1,p.style.zIndex=h,d.style.zIndex=h-1,i.addEvent(p,"click",function(e){var t=n.get(c.uid);t&&!t.disabled&&t.click(),e.preventDefault()},u.uid)),m=c.can("summon_file_dialog")?p:d,i.addEvent(m,"mouseover",function(){u.trigger("mouseenter")},u.uid),i.addEvent(m,"mouseout",function(){u.trigger("mouseleave")},u.uid),i.addEvent(m,"mousedown",function(){u.trigger("mousedown")},u.uid),i.addEvent(n.get(a.container),"mouseup",function(){u.trigger("mouseup")},u.uid),l.onchange=function g(){if(e=[],a.directory?t.each(this.files,function(t){"."!==t.name&&e.push(t)}):e=[].slice.call(this.files),"IE"!==o.browser)this.value="";else{var n=this.cloneNode(!0);this.parentNode.replaceChild(n,this),n.onchange=g}u.trigger("change")},u.trigger({type:"ready",async:!0}),d=null},getFiles:function(){return e},disable:function(e){var t=this.getRuntime(),i;(i=n.get(t.uid))&&(i.disabled=!!e)},destroy:function(){var t=this.getRuntime(),r=t.getShim(),o=t.getShimContainer();i.removeAllEvents(o,this.uid),i.removeAllEvents(a&&n.get(a.container),this.uid),i.removeAllEvents(a&&n.get(a.browse_button),this.uid),o&&(o.innerHTML=""),r.removeInstance(this.uid),e=a=o=r=null}})}return e.FileInput=a}),i(C,[D,u,f,L,l],function(e,t,n,i,r){function o(){function e(e){for(var n=[],i=0;i<e.length;i++)[].push.apply(n,e[i].extensions.split(/\s*,\s*/));return-1===t.inArray("*",n)?n:[]}function o(e){var n=r.getFileExtension(e.name);return!n||!d.length||-1!==t.inArray(n,d)}function a(e,n){var i=[];t.each(e,function(e){var t=e.webkitGetAsEntry();if(t)if(t.isFile){var n=e.getAsFile();o(n)&&l.push(n)}else i.push(t)}),i.length?s(i,n):n()}function s(e,n){var i=[];t.each(e,function(e){i.push(function(t){u(e,t)})}),t.inSeries(i,function(){n()})}function u(e,t){e.isFile?e.file(function(e){o(e)&&l.push(e),t()},function(){t()}):e.isDirectory?c(e,t):t()}function c(e,t){function n(e){r.readEntries(function(t){t.length?([].push.apply(i,t),n(e)):e()},e)}var i=[],r=e.createReader();n(function(){s(i,t)})}var l=[],d=[],f;t.extend(this,{init:function(n){var r=this,s;f=n,d=e(f.accept),s=f.container,i.addEvent(s,"dragover",function(e){e.preventDefault(),e.stopPropagation(),e.dataTransfer.dropEffect="copy"},r.uid),i.addEvent(s,"drop",function(e){e.preventDefault(),e.stopPropagation(),l=[],e.dataTransfer.items&&e.dataTransfer.items[0].webkitGetAsEntry?a(e.dataTransfer.items,function(){r.trigger("drop")}):(t.each(e.dataTransfer.files,function(e){o(e)&&l.push(e)}),r.trigger("drop"))},r.uid),i.addEvent(s,"dragenter",function(e){e.preventDefault(),e.stopPropagation(),r.trigger("dragenter")},r.uid),i.addEvent(s,"dragleave",function(e){e.preventDefault(),e.stopPropagation(),r.trigger("dragleave")},r.uid)},getFiles:function(){return l},destroy:function(){i.removeAllEvents(f&&n.get(f.container),this.uid),l=d=f=null}})}return e.FileDrop=o}),i(F,[D,m,u],function(e,t,n){function i(){function e(e){return t.atob(e.substring(e.indexOf("base64,")+7))}var i,r=!1;n.extend(this,{read:function(e,t){var o=this;i=new window.FileReader,i.addEventListener("progress",function(e){o.trigger(e)}),i.addEventListener("load",function(e){o.trigger(e)}),i.addEventListener("error",function(e){o.trigger(e,i.error)}),i.addEventListener("loadend",function(){i=null}),"function"===n.typeOf(i[e])?(r=!1,i[e](t.getSource())):"readAsBinaryString"===e&&(r=!0,i.readAsDataURL(t.getSource()))},getResult:function(){return i&&i.result?r?e(i.result):i.result:null},abort:function(){i&&i.abort()},destroy:function(){i=null}})}return e.FileReader=i}),i(H,[D,u,l,b,w,y,S,p,d],function(e,t,n,i,r,o,a,s,u){function c(){function e(e,t){var n=this,i,r;i=t.getBlob().getSource(),r=new window.FileReader,r.onload=function(){t.append(t.getBlobName(),new o(null,{type:i.type,data:r.result})),f.send.call(n,e,t)},r.readAsBinaryString(i)}function c(){return!window.XMLHttpRequest||"IE"===u.browser&&u.version<8?function(){for(var e=["Msxml2.XMLHTTP.6.0","Microsoft.XMLHTTP"],t=0;t<e.length;t++)try{return new ActiveXObject(e[t])}catch(n){}}():new window.XMLHttpRequest}function l(e){var t=e.responseXML,n=e.responseText;return"IE"===u.browser&&n&&t&&!t.documentElement&&/[^\/]+\/[^\+]+\+xml/.test(e.getResponseHeader("Content-Type"))&&(t=new window.ActiveXObject("Microsoft.XMLDOM"),t.async=!1,t.validateOnParse=!1,t.loadXML(n)),t&&("IE"===u.browser&&0!==t.parseError||!t.documentElement||"parsererror"===t.documentElement.tagName)?null:t}function d(e){var t="----moxieboundary"+(new Date).getTime(),n="--",i="\r\n",r="",a=this.getRuntime();if(!a.can("send_binary_string"))throw new s.RuntimeError(s.RuntimeError.NOT_SUPPORTED_ERR);return p.setRequestHeader("Content-Type","multipart/form-data; boundary="+t),e.each(function(e,a){r+=e instanceof o?n+t+i+'Content-Disposition: form-data; name="'+a+'"; filename="'+unescape(encodeURIComponent(e.name||"blob"))+'"'+i+"Content-Type: "+(e.type||"application/octet-stream")+i+i+e.getSource()+i:n+t+i+'Content-Disposition: form-data; name="'+a+'"'+i+i+unescape(encodeURIComponent(e))+i}),r+=n+t+n+i}var f=this,p,h;t.extend(this,{send:function(n,r){var s=this,l="Mozilla"===u.browser&&u.version>=4&&u.version<7,f="Android Browser"===u.browser,m=!1;if(h=n.url.replace(/^.+?\/([\w\-\.]+)$/,"$1").toLowerCase(),p=c(),p.open(n.method,n.url,n.async,n.user,n.password),r instanceof o)r.isDetached()&&(m=!0),r=r.getSource();else if(r instanceof a){if(r.hasBlob())if(r.getBlob().isDetached())r=d.call(s,r),m=!0;else if((l||f)&&"blob"===t.typeOf(r.getBlob().getSource())&&window.FileReader)return e.call(s,n,r),void 0;if(r instanceof a){var g=new window.FormData;r.each(function(e,t){e instanceof o?g.append(t,e.getSource()):g.append(t,e)}),r=g}}p.upload?(n.withCredentials&&(p.withCredentials=!0),p.addEventListener("load",function(e){s.trigger(e)}),p.addEventListener("error",function(e){s.trigger(e)}),p.addEventListener("progress",function(e){s.trigger(e)}),p.upload.addEventListener("progress",function(e){s.trigger({type:"UploadProgress",loaded:e.loaded,total:e.total})})):p.onreadystatechange=function v(){switch(p.readyState){case 1:break;case 2:break;case 3:var e,t;try{i.hasSameOrigin(n.url)&&(e=p.getResponseHeader("Content-Length")||0),p.responseText&&(t=p.responseText.length)}catch(r){e=t=0}s.trigger({type:"progress",lengthComputable:!!e,total:parseInt(e,10),loaded:t});break;case 4:p.onreadystatechange=function(){},0===p.status?s.trigger("error"):s.trigger("load")}},t.isEmptyObj(n.headers)||t.each(n.headers,function(e,t){p.setRequestHeader(t,e)}),""!==n.responseType&&"responseType"in p&&(p.responseType="json"!==n.responseType||u.can("return_response_type","json")?n.responseType:"text"),m?p.sendAsBinary?p.sendAsBinary(r):function(){for(var e=new Uint8Array(r.length),t=0;t<r.length;t++)e[t]=255&r.charCodeAt(t);p.send(e.buffer)}():p.send(r),s.trigger("loadstart")},getStatus:function(){try{if(p)return p.status}catch(e){}return 0},getResponse:function(e){var t=this.getRuntime();try{switch(e){case"blob":var i=new r(t.uid,p.response),o=p.getResponseHeader("Content-Disposition");if(o){var a=o.match(/filename=([\'\"'])([^\1]+)\1/);a&&(h=a[2])}return i.name=h,i.type||(i.type=n.getFileMime(h)),i;case"json":return u.can("return_response_type","json")?p.response:200===p.status&&window.JSON?JSON.parse(p.responseText):null;case"document":return l(p);default:return""!==p.responseText?p.responseText:null}}catch(s){return null}},getAllResponseHeaders:function(){try{return p.getAllResponseHeaders()}catch(e){}return""},abort:function(){p&&p.abort()},destroy:function(){f=h=null}})}return e.XMLHttpRequest=c}),i(P,[],function(){return function(){function e(e,t){var n=r?0:-8*(t-1),i=0,a;for(a=0;t>a;a++)i|=o.charCodeAt(e+a)<<Math.abs(n+8*a);return i}function n(e,t,n){n=3===arguments.length?n:o.length-t-1,o=o.substr(0,t)+e+o.substr(n+t)}function i(e,t,i){var o="",a=r?0:-8*(i-1),s;for(s=0;i>s;s++)o+=String.fromCharCode(255&t>>Math.abs(a+8*s));n(o,e,i)}var r=!1,o;return{II:function(e){return e===t?r:(r=e,void 0)},init:function(e){r=!1,o=e},SEGMENT:function(e,t,i){switch(arguments.length){case 1:return o.substr(e,o.length-e-1);case 2:return o.substr(e,t);case 3:n(i,e,t);break;default:return o}},BYTE:function(t){return e(t,1)},SHORT:function(t){return e(t,2)},LONG:function(n,r){return r===t?e(n,4):(i(n,r,4),void 0)},SLONG:function(t){var n=e(t,4);return n>2147483647?n-4294967296:n},STRING:function(t,n){var i="";for(n+=t;n>t;t++)i+=String.fromCharCode(e(t,1));return i}}}}),i(k,[P],function(e){return function t(n){var i=[],r,o,a,s=0;if(r=new e,r.init(n),65496===r.SHORT(0)){for(o=2;o<=n.length;)if(a=r.SHORT(o),a>=65488&&65495>=a)o+=2;else{if(65498===a||65497===a)break;s=r.SHORT(o+2)+2,a>=65505&&65519>=a&&i.push({hex:a,name:"APP"+(15&a),start:o,length:s,segment:r.SEGMENT(o,s)}),o+=s}return r.init(null),{headers:i,restore:function(e){var t,n;for(r.init(e),o=65504==r.SHORT(2)?4+r.SHORT(4):2,n=0,t=i.length;t>n;n++)r.SEGMENT(o,0,i[n].segment),o+=i[n].length;return e=r.SEGMENT(),r.init(null),e},strip:function(e){var n,i,o;for(i=new t(e),n=i.headers,i.purge(),r.init(e),o=n.length;o--;)r.SEGMENT(n[o].start,n[o].length,"");return e=r.SEGMENT(),r.init(null),e},get:function(e){for(var t=[],n=0,r=i.length;r>n;n++)i[n].name===e.toUpperCase()&&t.push(i[n].segment);return t},set:function(e,t){var n=[],r,o,a;for("string"==typeof t?n.push(t):n=t,r=o=0,a=i.length;a>r&&(i[r].name===e.toUpperCase()&&(i[r].segment=n[o],i[r].length=n[o].length,o++),!(o>=n.length));r++);},purge:function(){i=[],r.init(null),r=null}}}}}),i(U,[u,P],function(e,n){return function i(){function i(e,n){var i=a.SHORT(e),r,o,s,u,d,f,p,h,m=[],g={};for(r=0;i>r;r++)if(p=f=e+12*r+2,s=n[a.SHORT(p)],s!==t){switch(u=a.SHORT(p+=2),d=a.LONG(p+=2),p+=4,m=[],u){case 1:case 7:for(d>4&&(p=a.LONG(p)+c.tiffHeader),o=0;d>o;o++)m[o]=a.BYTE(p+o);break;case 2:d>4&&(p=a.LONG(p)+c.tiffHeader),g[s]=a.STRING(p,d-1);continue;case 3:for(d>2&&(p=a.LONG(p)+c.tiffHeader),o=0;d>o;o++)m[o]=a.SHORT(p+2*o);break;case 4:for(d>1&&(p=a.LONG(p)+c.tiffHeader),o=0;d>o;o++)m[o]=a.LONG(p+4*o);break;case 5:for(p=a.LONG(p)+c.tiffHeader,o=0;d>o;o++)m[o]=a.LONG(p+4*o)/a.LONG(p+4*o+4);break;case 9:for(p=a.LONG(p)+c.tiffHeader,o=0;d>o;o++)m[o]=a.SLONG(p+4*o);break;case 10:for(p=a.LONG(p)+c.tiffHeader,o=0;d>o;o++)m[o]=a.SLONG(p+4*o)/a.SLONG(p+4*o+4);break;default:continue}h=1==d?m[0]:m,g[s]=l.hasOwnProperty(s)&&"object"!=typeof h?l[s][h]:h}return g}function r(){var e=c.tiffHeader;return a.II(18761==a.SHORT(e)),42!==a.SHORT(e+=2)?!1:(c.IFD0=c.tiffHeader+a.LONG(e+=2),u=i(c.IFD0,s.tiff),"ExifIFDPointer"in u&&(c.exifIFD=c.tiffHeader+u.ExifIFDPointer,delete u.ExifIFDPointer),"GPSInfoIFDPointer"in u&&(c.gpsIFD=c.tiffHeader+u.GPSInfoIFDPointer,delete u.GPSInfoIFDPointer),!0)}function o(e,t,n){var i,r,o,u=0;if("string"==typeof t){var l=s[e.toLowerCase()];for(var d in l)if(l[d]===t){t=d;break}}i=c[e.toLowerCase()+"IFD"],r=a.SHORT(i);for(var f=0;r>f;f++)if(o=i+12*f+2,a.SHORT(o)==t){u=o+8;break}return u?(a.LONG(u,n),!0):!1}var a,s,u,c={},l;return a=new n,s={tiff:{274:"Orientation",270:"ImageDescription",271:"Make",272:"Model",305:"Software",34665:"ExifIFDPointer",34853:"GPSInfoIFDPointer"},exif:{36864:"ExifVersion",40961:"ColorSpace",40962:"PixelXDimension",40963:"PixelYDimension",36867:"DateTimeOriginal",33434:"ExposureTime",33437:"FNumber",34855:"ISOSpeedRatings",37377:"ShutterSpeedValue",37378:"ApertureValue",37383:"MeteringMode",37384:"LightSource",37385:"Flash",37386:"FocalLength",41986:"ExposureMode",41987:"WhiteBalance",41990:"SceneCaptureType",41988:"DigitalZoomRatio",41992:"Contrast",41993:"Saturation",41994:"Sharpness"},gps:{0:"GPSVersionID",1:"GPSLatitudeRef",2:"GPSLatitude",3:"GPSLongitudeRef",4:"GPSLongitude"}},l={ColorSpace:{1:"sRGB",0:"Uncalibrated"},MeteringMode:{0:"Unknown",1:"Average",2:"CenterWeightedAverage",3:"Spot",4:"MultiSpot",5:"Pattern",6:"Partial",255:"Other"},LightSource:{1:"Daylight",2:"Fliorescent",3:"Tungsten",4:"Flash",9:"Fine weather",10:"Cloudy weather",11:"Shade",12:"Daylight fluorescent (D 5700 - 7100K)",13:"Day white fluorescent (N 4600 -5400K)",14:"Cool white fluorescent (W 3900 - 4500K)",15:"White fluorescent (WW 3200 - 3700K)",17:"Standard light A",18:"Standard light B",19:"Standard light C",20:"D55",21:"D65",22:"D75",23:"D50",24:"ISO studio tungsten",255:"Other"},Flash:{0:"Flash did not fire.",1:"Flash fired.",5:"Strobe return light not detected.",7:"Strobe return light detected.",9:"Flash fired, compulsory flash mode",13:"Flash fired, compulsory flash mode, return light not detected",15:"Flash fired, compulsory flash mode, return light detected",16:"Flash did not fire, compulsory flash mode",24:"Flash did not fire, auto mode",25:"Flash fired, auto mode",29:"Flash fired, auto mode, return light not detected",31:"Flash fired, auto mode, return light detected",32:"No flash function",65:"Flash fired, red-eye reduction mode",69:"Flash fired, red-eye reduction mode, return light not detected",71:"Flash fired, red-eye reduction mode, return light detected",73:"Flash fired, compulsory flash mode, red-eye reduction mode",77:"Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected",79:"Flash fired, compulsory flash mode, red-eye reduction mode, return light detected",89:"Flash fired, auto mode, red-eye reduction mode",93:"Flash fired, auto mode, return light not detected, red-eye reduction mode",95:"Flash fired, auto mode, return light detected, red-eye reduction mode"},ExposureMode:{0:"Auto exposure",1:"Manual exposure",2:"Auto bracket"},WhiteBalance:{0:"Auto white balance",1:"Manual white balance"},SceneCaptureType:{0:"Standard",1:"Landscape",2:"Portrait",3:"Night scene"},Contrast:{0:"Normal",1:"Soft",2:"Hard"},Saturation:{0:"Normal",1:"Low saturation",2:"High saturation"},Sharpness:{0:"Normal",1:"Soft",2:"Hard"},GPSLatitudeRef:{N:"North latitude",S:"South latitude"},GPSLongitudeRef:{E:"East longitude",W:"West longitude"}},{init:function(e){return c={tiffHeader:10},e!==t&&e.length?(a.init(e),65505===a.SHORT(0)&&"EXIF\0"===a.STRING(4,5).toUpperCase()?r():!1):!1 -},TIFF:function(){return u},EXIF:function(){var t;if(t=i(c.exifIFD,s.exif),t.ExifVersion&&"array"===e.typeOf(t.ExifVersion)){for(var n=0,r="";n<t.ExifVersion.length;n++)r+=String.fromCharCode(t.ExifVersion[n]);t.ExifVersion=r}return t},GPS:function(){var t;return t=i(c.gpsIFD,s.gps),t.GPSVersionID&&"array"===e.typeOf(t.GPSVersionID)&&(t.GPSVersionID=t.GPSVersionID.join(".")),t},setExif:function(e,t){return"PixelXDimension"!==e&&"PixelYDimension"!==e?!1:o("exif",e,t)},getBinary:function(){return a.SEGMENT()},purge:function(){a.init(null),a=u=null,c={}}}}}),i(B,[u,p,k,P,U],function(e,t,n,i,r){function o(o){function a(){for(var e=0,t,n;e<=u.length;){if(t=c.SHORT(e+=2),t>=65472&&65475>=t)return e+=5,{height:c.SHORT(e),width:c.SHORT(e+=2)};n=c.SHORT(e+=2),e+=n-2}return null}function s(){d&&l&&c&&(d.purge(),l.purge(),c.init(null),u=f=l=d=c=null)}var u,c,l,d,f,p;if(u=o,c=new i,c.init(u),65496!==c.SHORT(0))throw new t.ImageError(t.ImageError.WRONG_FORMAT);l=new n(o),d=new r,p=!!d.init(l.get("app1")[0]),f=a.call(this),e.extend(this,{type:"image/jpeg",size:u.length,width:f&&f.width||0,height:f&&f.height||0,setExif:function(t,n){return p?("object"===e.typeOf(t)?e.each(t,function(e,t){d.setExif(t,e)}):d.setExif(t,n),l.set("app1",d.getBinary()),void 0):!1},writeHeaders:function(){return arguments.length?l.restore(arguments[0]):u=l.restore(u)},stripHeaders:function(e){return l.strip(e)},purge:function(){s.call(this)}}),p&&(this.meta={tiff:d.TIFF(),exif:d.EXIF(),gps:d.GPS()})}return o}),i(z,[p,u,P],function(e,t,n){function i(i){function r(){var e,t;return e=a.call(this,8),"IHDR"==e.type?(t=e.start,{width:u.LONG(t),height:u.LONG(t+=4)}):null}function o(){u&&(u.init(null),s=d=c=l=u=null)}function a(e){var t,n,i,r;return t=u.LONG(e),n=u.STRING(e+=4,4),i=e+=4,r=u.LONG(e+t),{length:t,type:n,start:i,CRC:r}}var s,u,c,l,d;s=i,u=new n,u.init(s),function(){var t=0,n=0,i=[35152,20039,3338,6666];for(n=0;n<i.length;n++,t+=2)if(i[n]!=u.SHORT(t))throw new e.ImageError(e.ImageError.WRONG_FORMAT)}(),d=r.call(this),t.extend(this,{type:"image/png",size:s.length,width:d.width,height:d.height,purge:function(){o.call(this)}}),o.call(this)}return i}),i(G,[u,p,B,z],function(e,t,n,i){return function(r){var o=[n,i],a;a=function(){for(var e=0;e<o.length;e++)try{return new o[e](r)}catch(n){}throw new t.ImageError(t.ImageError.WRONG_FORMAT)}(),e.extend(this,{type:"",size:0,width:0,height:0,setExif:function(){},writeHeaders:function(e){return e},stripHeaders:function(e){return e},purge:function(){}}),e.extend(this,a),this.purge=function(){a.purge(),a=null}}}),i(q,[],function(){function e(e,i,r){var o=e.naturalWidth,a=e.naturalHeight,s=r.width,u=r.height,c=r.x||0,l=r.y||0,d=i.getContext("2d");t(e)&&(o/=2,a/=2);var f=1024,p=document.createElement("canvas");p.width=p.height=f;for(var h=p.getContext("2d"),m=n(e,o,a),g=0;a>g;){for(var v=g+f>a?a-g:f,y=0;o>y;){var w=y+f>o?o-y:f;h.clearRect(0,0,f,f),h.drawImage(e,-y,-g);var E=y*s/o+c<<0,_=Math.ceil(w*s/o),x=g*u/a/m+l<<0,R=Math.ceil(v*u/a/m);d.drawImage(p,0,0,w,v,E,x,_,R),y+=f}g+=f}p=h=null}function t(e){var t=e.naturalWidth,n=e.naturalHeight;if(t*n>1048576){var i=document.createElement("canvas");i.width=i.height=1;var r=i.getContext("2d");return r.drawImage(e,-t+1,0),0===r.getImageData(0,0,1,1).data[3]}return!1}function n(e,t,n){var i=document.createElement("canvas");i.width=1,i.height=n;var r=i.getContext("2d");r.drawImage(e,0,0);for(var o=r.getImageData(0,0,1,n).data,a=0,s=n,u=n;u>a;){var c=o[4*(u-1)+3];0===c?s=u:a=u,u=s+a>>1}i=null;var l=u/n;return 0===l?1:l}return{isSubsampled:t,renderTo:e}}),i(X,[D,u,p,m,w,G,q,l,d],function(e,t,n,i,r,o,a,s,u){function c(){function e(){if(!E&&!y)throw new n.ImageError(n.DOMException.INVALID_STATE_ERR);return E||y}function c(e){return i.atob(e.substring(e.indexOf("base64,")+7))}function l(e,t){return"data:"+(t||"")+";base64,"+i.btoa(e)}function d(e){var t=this;y=new Image,y.onerror=function(){g.call(this),t.trigger("error",new n.ImageError(n.ImageError.WRONG_FORMAT))},y.onload=function(){t.trigger("load")},y.src=/^data:[^;]*;base64,/.test(e)?e:l(e,x.type)}function f(e,t){var i=this,r;return window.FileReader?(r=new FileReader,r.onload=function(){t(this.result)},r.onerror=function(){i.trigger("error",new n.FileException(n.FileException.NOT_READABLE_ERR))},r.readAsDataURL(e),void 0):t(e.getAsDataURL())}function p(n,i,r,o){var a=this,s,u,c=0,l=0,d,f,p,g;if(b=o,g=this.meta&&this.meta.tiff&&this.meta.tiff.Orientation||1,-1!==t.inArray(g,[5,6,7,8])){var v=n;n=i,i=v}return d=e(),u=r?Math.max:Math.min,s=u(n/d.width,i/d.height),s>1&&(!r||o)?(this.trigger("Resize"),void 0):(E||(E=document.createElement("canvas")),f=Math.round(d.width*s),p=Math.round(d.height*s),r?(E.width=n,E.height=i,f>n&&(c=Math.round((f-n)/2)),p>i&&(l=Math.round((p-i)/2))):(E.width=f,E.height=p),b||m(E.width,E.height,g),h.call(this,d,E,-c,-l,f,p),this.width=E.width,this.height=E.height,R=!0,a.trigger("Resize"),void 0)}function h(e,t,n,i,r,o){if("iOS"===u.OS)a.renderTo(e,t,{width:r,height:o,x:n,y:i});else{var s=t.getContext("2d");s.drawImage(e,n,i,r,o)}}function m(e,t,n){switch(n){case 5:case 6:case 7:case 8:E.width=t,E.height=e;break;default:E.width=e,E.height=t}var i=E.getContext("2d");switch(n){case 2:i.translate(e,0),i.scale(-1,1);break;case 3:i.translate(e,t),i.rotate(Math.PI);break;case 4:i.translate(0,t),i.scale(1,-1);break;case 5:i.rotate(.5*Math.PI),i.scale(1,-1);break;case 6:i.rotate(.5*Math.PI),i.translate(0,-t);break;case 7:i.rotate(.5*Math.PI),i.translate(e,-t),i.scale(-1,1);break;case 8:i.rotate(-.5*Math.PI),i.translate(-e,0)}}function g(){w&&(w.purge(),w=null),_=y=E=x=null,R=!1}var v=this,y,w,E,_,x,R=!1,b=!0;t.extend(this,{loadFromBlob:function(e){var t=this,i=t.getRuntime(),r=arguments.length>1?arguments[1]:!0;if(!i.can("access_binary"))throw new n.RuntimeError(n.RuntimeError.NOT_SUPPORTED_ERR);return x=e,e.isDetached()?(_=e.getSource(),d.call(this,_),void 0):(f.call(this,e.getSource(),function(e){r&&(_=c(e)),d.call(t,e)}),void 0)},loadFromImage:function(e,t){this.meta=e.meta,x=new r(null,{name:e.name,size:e.size,type:e.type}),d.call(this,t?_=e.getAsBinaryString():e.getAsDataURL())},getInfo:function(){var t=this.getRuntime(),n;return!w&&_&&t.can("access_image_binary")&&(w=new o(_)),n={width:e().width||0,height:e().height||0,type:x.type||s.getFileMime(x.name),size:_&&_.length||x.size||0,name:x.name||"",meta:w&&w.meta||this.meta||{}}},downsize:function(){p.apply(this,arguments)},getAsCanvas:function(){return E&&(E.id=this.uid+"_canvas"),E},getAsBlob:function(e,t){return e!==this.type&&p.call(this,this.width,this.height,!1),new r(null,{name:x.name||"",type:e,data:v.getAsBinaryString.call(this,e,t)})},getAsDataURL:function(e){var t=arguments[1]||90;if(!R)return y.src;if("image/jpeg"!==e)return E.toDataURL("image/png");try{return E.toDataURL("image/jpeg",t/100)}catch(n){return E.toDataURL("image/jpeg")}},getAsBinaryString:function(e,t){if(!R)return _||(_=c(v.getAsDataURL(e,t))),_;if("image/jpeg"!==e)_=c(v.getAsDataURL(e,t));else{var n;t||(t=90);try{n=E.toDataURL("image/jpeg",t/100)}catch(i){n=E.toDataURL("image/jpeg")}_=c(n),w&&(_=w.stripHeaders(_),b&&(w.meta&&w.meta.exif&&w.setExif({PixelXDimension:this.width,PixelYDimension:this.height}),_=w.writeHeaders(_)),w.purge(),w=null)}return R=!1,_},destroy:function(){v=null,g.call(this),this.getRuntime().getShim().removeInstance(this.uid)}})}return e.Image=c}),i(j,[u,d,f,p,g],function(e,t,n,i,r){function o(){var e;try{e=navigator.plugins["Shockwave Flash"],e=e.description}catch(t){try{e=new ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version")}catch(n){e="0.0"}}return e=e.match(/\d+/g),parseFloat(e[0]+"."+e[1])}function a(a){var c=this,l;a=e.extend({swf_url:t.swf_url},a),r.call(this,a,s,{access_binary:function(e){return e&&"browser"===c.mode},access_image_binary:function(e){return e&&"browser"===c.mode},display_media:r.capTrue,do_cors:r.capTrue,drag_and_drop:!1,report_upload_progress:function(){return"client"===c.mode},resize_image:r.capTrue,return_response_headers:!1,return_response_type:function(t){return"json"===t&&window.JSON?!0:!e.arrayDiff(t,["","text","document"])||"browser"===c.mode},return_status_code:function(t){return"browser"===c.mode||!e.arrayDiff(t,[200,404])},select_file:r.capTrue,select_multiple:r.capTrue,send_binary_string:function(e){return e&&"browser"===c.mode},send_browser_cookies:function(e){return e&&"browser"===c.mode},send_custom_headers:function(e){return e&&"browser"===c.mode},send_multipart:r.capTrue,slice_blob:r.capTrue,stream_upload:function(e){return e&&"browser"===c.mode},summon_file_dialog:!1,upload_filesize:function(t){return e.parseSizeStr(t)<=2097152||"client"===c.mode},use_http_method:function(t){return!e.arrayDiff(t,["GET","POST"])}},{access_binary:function(e){return e?"browser":"client"},access_image_binary:function(e){return e?"browser":"client"},report_upload_progress:function(e){return e?"browser":"client"},return_response_type:function(t){return e.arrayDiff(t,["","text","json","document"])?"browser":["client","browser"]},return_status_code:function(t){return e.arrayDiff(t,[200,404])?"browser":["client","browser"]},send_binary_string:function(e){return e?"browser":"client"},send_browser_cookies:function(e){return e?"browser":"client"},send_custom_headers:function(e){return e?"browser":"client"},stream_upload:function(e){return e?"client":"browser"},upload_filesize:function(t){return e.parseSizeStr(t)>=2097152?"client":"browser"}},"client"),o()<10&&(this.mode=!1),e.extend(this,{getShim:function(){return n.get(this.uid)},shimExec:function(e,t){var n=[].slice.call(arguments,2);return c.getShim().exec(this.uid,e,t,n)},init:function(){var n,r,o;o=this.getShimContainer(),e.extend(o.style,{position:"absolute",top:"-8px",left:"-8px",width:"9px",height:"9px",overflow:"hidden"}),n='<object id="'+this.uid+'" type="application/x-shockwave-flash" data="'+a.swf_url+'" ',"IE"===t.browser&&(n+='classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" '),n+='width="100%" height="100%" style="outline:0"><param name="movie" value="'+a.swf_url+'" />'+'<param name="flashvars" value="uid='+escape(this.uid)+"&target="+t.global_event_dispatcher+'" />'+'<param name="wmode" value="transparent" />'+'<param name="allowscriptaccess" value="always" />'+"</object>","IE"===t.browser?(r=document.createElement("div"),o.appendChild(r),r.outerHTML=n,r=o=null):o.innerHTML=n,l=setTimeout(function(){c&&!c.initialized&&c.trigger("Error",new i.RuntimeError(i.RuntimeError.NOT_INIT_ERR))},5e3)},destroy:function(e){return function(){e.call(c),clearTimeout(l),a=l=e=c=null}}(this.destroy)},u)}var s="flash",u={};return r.addConstructor(s,a),u}),i(V,[j,y],function(e,t){var n={slice:function(e,n,i,r){var o=this.getRuntime();return 0>n?n=Math.max(e.size+n,0):n>0&&(n=Math.min(n,e.size)),0>i?i=Math.max(e.size+i,0):i>0&&(i=Math.min(i,e.size)),e=o.shimExec.call(this,"Blob","slice",n,i,r||""),e&&(e=new t(o.uid,e)),e}};return e.Blob=n}),i(W,[j],function(e){var t={init:function(e){this.getRuntime().shimExec.call(this,"FileInput","init",{name:e.name,accept:e.accept,multiple:e.multiple}),this.trigger("ready")}};return e.FileInput=t}),i(Y,[j,m],function(e,t){function n(e,n){switch(n){case"readAsText":return t.atob(e,"utf8");case"readAsBinaryString":return t.atob(e);case"readAsDataURL":return e}return null}var i="",r={read:function(e,t){var r=this,o=r.getRuntime();return"readAsDataURL"===e&&(i="data:"+(t.type||"")+";base64,"),r.bind("Progress",function(t,r){r&&(i+=n(r,e))}),o.shimExec.call(this,"FileReader","readAsBase64",t.uid)},getResult:function(){return i},destroy:function(){i=null}};return e.FileReader=r}),i($,[j,m],function(e,t){function n(e,n){switch(n){case"readAsText":return t.atob(e,"utf8");case"readAsBinaryString":return t.atob(e);case"readAsDataURL":return e}return null}var i={read:function(e,t){var i,r=this.getRuntime();return(i=r.shimExec.call(this,"FileReaderSync","readAsBase64",t.uid))?("readAsDataURL"===e&&(i="data:"+(t.type||"")+";base64,"+i),n(i,e,t.type)):null}};return e.FileReaderSync=i}),i(J,[j,u,y,w,T,S,O],function(e,t,n,i,r,o,a){var s={send:function(e,i){function r(){e.transport=l.mode,l.shimExec.call(c,"XMLHttpRequest","send",e,i)}function s(e,t){l.shimExec.call(c,"XMLHttpRequest","appendBlob",e,t.uid),i=null,r()}function u(e,t){var n=new a;n.bind("TransportingComplete",function(){t(this.result)}),n.transport(e.getSource(),e.type,{ruid:l.uid})}var c=this,l=c.getRuntime();if(t.isEmptyObj(e.headers)||t.each(e.headers,function(e,t){l.shimExec.call(c,"XMLHttpRequest","setRequestHeader",t,e.toString())}),i instanceof o){var d;if(i.each(function(e,t){e instanceof n?d=t:l.shimExec.call(c,"XMLHttpRequest","append",t,e)}),i.hasBlob()){var f=i.getBlob();f.isDetached()?u(f,function(e){f.destroy(),s(d,e)}):s(d,f)}else i=null,r()}else i instanceof n?i.isDetached()?u(i,function(e){i.destroy(),i=e.uid,r()}):(i=i.uid,r()):r()},getResponse:function(e){var n,o,a=this.getRuntime();if(o=a.shimExec.call(this,"XMLHttpRequest","getResponseAsBlob")){if(o=new i(a.uid,o),"blob"===e)return o;try{if(n=new r,~t.inArray(e,["","text"]))return n.readAsText(o);if("json"===e&&window.JSON)return JSON.parse(n.readAsText(o))}finally{o.destroy()}}return null},abort:function(e){var t=this.getRuntime();t.shimExec.call(this,"XMLHttpRequest","abort"),this.dispatchEvent("readystatechange"),this.dispatchEvent("abort")}};return e.XMLHttpRequest=s}),i(Z,[j,y],function(e,t){var n={getAsBlob:function(e){var n=this.getRuntime(),i=n.shimExec.call(this,"Transporter","getAsBlob",e);return i?new t(n.uid,i):null}};return e.Transporter=n}),i(K,[j,u,O,y,T],function(e,t,n,i,r){var o={loadFromBlob:function(e){function t(e){r.shimExec.call(i,"Image","loadFromBlob",e.uid),i=r=null}var i=this,r=i.getRuntime();if(e.isDetached()){var o=new n;o.bind("TransportingComplete",function(){t(o.result.getSource())}),o.transport(e.getSource(),e.type,{ruid:r.uid})}else t(e.getSource())},loadFromImage:function(e){var t=this.getRuntime();return t.shimExec.call(this,"Image","loadFromImage",e.uid)},getAsBlob:function(e,t){var n=this.getRuntime(),r=n.shimExec.call(this,"Image","getAsBlob",e,t);return r?new i(n.uid,r):null},getAsDataURL:function(){var e=this.getRuntime(),t=e.Image.getAsBlob.apply(this,arguments),n;return t?(n=new r,n.readAsDataURL(t)):null}};return e.Image=o}),i(Q,[u,d,f,p,g],function(e,t,n,i,r){function o(e){var t=!1,n=null,i,r,o,a,s,u=0;try{try{n=new ActiveXObject("AgControl.AgControl"),n.IsVersionSupported(e)&&(t=!0),n=null}catch(c){var l=navigator.plugins["Silverlight Plug-In"];if(l){for(i=l.description,"1.0.30226.2"===i&&(i="2.0.30226.2"),r=i.split(".");r.length>3;)r.pop();for(;r.length<4;)r.push(0);for(o=e.split(".");o.length>4;)o.pop();do a=parseInt(o[u],10),s=parseInt(r[u],10),u++;while(u<o.length&&a===s);s>=a&&!isNaN(a)&&(t=!0)}}}catch(d){t=!1}return t}function a(a){var c=this,l;a=e.extend({xap_url:t.xap_url},a),r.call(this,a,s,{access_binary:r.capTrue,access_image_binary:r.capTrue,display_media:r.capTrue,do_cors:r.capTrue,drag_and_drop:!1,report_upload_progress:r.capTrue,resize_image:r.capTrue,return_response_headers:function(e){return e&&"client"===c.mode},return_response_type:function(e){return"json"!==e?!0:!!window.JSON},return_status_code:function(t){return"client"===c.mode||!e.arrayDiff(t,[200,404])},select_file:r.capTrue,select_multiple:r.capTrue,send_binary_string:r.capTrue,send_browser_cookies:function(e){return e&&"browser"===c.mode},send_custom_headers:function(e){return e&&"client"===c.mode},send_multipart:r.capTrue,slice_blob:r.capTrue,stream_upload:!0,summon_file_dialog:!1,upload_filesize:r.capTrue,use_http_method:function(t){return"client"===c.mode||!e.arrayDiff(t,["GET","POST"])}},{return_response_headers:function(e){return e?"client":"browser"},return_status_code:function(t){return e.arrayDiff(t,[200,404])?"client":["client","browser"]},send_browser_cookies:function(e){return e?"browser":"client"},send_custom_headers:function(e){return e?"client":"browser"},use_http_method:function(t){return e.arrayDiff(t,["GET","POST"])?"client":["client","browser"]}}),o("2.0.31005.0")&&"Opera"!==t.browser||(this.mode=!1),e.extend(this,{getShim:function(){return n.get(this.uid).content.Moxie},shimExec:function(e,t){var n=[].slice.call(arguments,2);return c.getShim().exec(this.uid,e,t,n)},init:function(){var e;e=this.getShimContainer(),e.innerHTML='<object id="'+this.uid+'" data="data:application/x-silverlight," type="application/x-silverlight-2" width="100%" height="100%" style="outline:none;">'+'<param name="source" value="'+a.xap_url+'"/>'+'<param name="background" value="Transparent"/>'+'<param name="windowless" value="true"/>'+'<param name="enablehtmlaccess" value="true"/>'+'<param name="initParams" value="uid='+this.uid+",target="+t.global_event_dispatcher+'"/>'+"</object>",l=setTimeout(function(){c&&!c.initialized&&c.trigger("Error",new i.RuntimeError(i.RuntimeError.NOT_INIT_ERR))},"Windows"!==t.OS?1e4:5e3)},destroy:function(e){return function(){e.call(c),clearTimeout(l),a=l=e=c=null}}(this.destroy)},u)}var s="silverlight",u={};return r.addConstructor(s,a),u}),i(et,[Q,u,V],function(e,t,n){return e.Blob=t.extend({},n)}),i(tt,[Q],function(e){var t={init:function(e){function t(e){for(var t="",n=0;n<e.length;n++)t+=(""!==t?"|":"")+e[n].title+" | *."+e[n].extensions.replace(/,/g,";*.");return t}this.getRuntime().shimExec.call(this,"FileInput","init",t(e.accept),e.name,e.multiple),this.trigger("ready")}};return e.FileInput=t}),i(nt,[Q,f,L],function(e,t,n){var i={init:function(){var e=this,i=e.getRuntime(),r;return r=i.getShimContainer(),n.addEvent(r,"dragover",function(e){e.preventDefault(),e.stopPropagation(),e.dataTransfer.dropEffect="copy"},e.uid),n.addEvent(r,"dragenter",function(e){e.preventDefault();var n=t.get(i.uid).dragEnter(e);n&&e.stopPropagation()},e.uid),n.addEvent(r,"drop",function(e){e.preventDefault();var n=t.get(i.uid).dragDrop(e);n&&e.stopPropagation()},e.uid),i.shimExec.call(this,"FileDrop","init")}};return e.FileDrop=i}),i(it,[Q,u,Y],function(e,t,n){return e.FileReader=t.extend({},n)}),i(rt,[Q,u,$],function(e,t,n){return e.FileReaderSync=t.extend({},n)}),i(ot,[Q,u,J],function(e,t,n){return e.XMLHttpRequest=t.extend({},n)}),i(at,[Q,u,Z],function(e,t,n){return e.Transporter=t.extend({},n)}),i(st,[Q,u,K],function(e,t,n){return e.Image=t.extend({},n,{getInfo:function(){var e=this.getRuntime(),n=["tiff","exif","gps"],i={meta:{}},r=e.shimExec.call(this,"Image","getInfo");return r.meta&&t.each(n,function(e){var t=r.meta[e],n,o,a,s;if(t&&t.keys)for(i.meta[e]={},o=0,a=t.keys.length;a>o;o++)n=t.keys[o],s=t[n],s&&(/^(\d|[1-9]\d+)$/.test(s)?s=parseInt(s,10):/^\d*\.\d+$/.test(s)&&(s=parseFloat(s)),i.meta[e][n]=s)}),i.width=parseInt(r.width,10),i.height=parseInt(r.height,10),i.size=parseInt(r.size,10),i.type=r.type,i.name=r.name,i}})}),i(ut,[u,p,g,d],function(e,t,n,i){function r(t){var r=this,s=n.capTest,u=n.capTrue;n.call(this,t,o,{access_binary:s(window.FileReader||window.File&&File.getAsDataURL),access_image_binary:!1,display_media:s(a.Image&&(i.can("create_canvas")||i.can("use_data_uri_over32kb"))),do_cors:!1,drag_and_drop:!1,filter_by_extension:s(function(){return"Chrome"===i.browser&&i.version>=28||"IE"===i.browser&&i.version>=10}()),resize_image:function(){return a.Image&&r.can("access_binary")&&i.can("create_canvas")},report_upload_progress:!1,return_response_headers:!1,return_response_type:function(t){return"json"===t&&window.JSON?!0:!!~e.inArray(t,["text","document",""])},return_status_code:function(t){return!e.arrayDiff(t,[200,404])},select_file:function(){return i.can("use_fileinput")},select_multiple:!1,send_binary_string:!1,send_custom_headers:!1,send_multipart:!0,slice_blob:!1,stream_upload:function(){return r.can("select_file")},summon_file_dialog:s(function(){return"Firefox"===i.browser&&i.version>=4||"Opera"===i.browser&&i.version>=12||!!~e.inArray(i.browser,["Chrome","Safari"])}()),upload_filesize:u,use_http_method:function(t){return!e.arrayDiff(t,["GET","POST"])}}),e.extend(this,{init:function(){this.trigger("Init")},destroy:function(e){return function(){e.call(r),e=r=null}}(this.destroy)}),e.extend(this.getShim(),a)}var o="html4",a={};return n.addConstructor(o,r),a}),i(ct,[ut,u,f,L,l,d],function(e,t,n,i,r,o){function a(){function e(){var r=this,l=r.getRuntime(),d,f,p,h,m,g;g=t.guid("uid_"),d=l.getShimContainer(),a&&(p=n.get(a+"_form"),p&&t.extend(p.style,{top:"100%"})),h=document.createElement("form"),h.setAttribute("id",g+"_form"),h.setAttribute("method","post"),h.setAttribute("enctype","multipart/form-data"),h.setAttribute("encoding","multipart/form-data"),t.extend(h.style,{overflow:"hidden",position:"absolute",top:0,left:0,width:"100%",height:"100%"}),m=document.createElement("input"),m.setAttribute("id",g),m.setAttribute("type","file"),m.setAttribute("name",c.name||"Filedata"),m.setAttribute("accept",u.join(",")),t.extend(m.style,{fontSize:"999px",opacity:0}),h.appendChild(m),d.appendChild(h),t.extend(m.style,{position:"absolute",top:0,left:0,width:"100%",height:"100%"}),"IE"===o.browser&&o.version<10&&t.extend(m.style,{filter:"progid:DXImageTransform.Microsoft.Alpha(opacity=0)"}),m.onchange=function(){var t;this.value&&(t=this.files?this.files[0]:{name:this.value},s=[t],this.onchange=function(){},e.call(r),r.bind("change",function i(){var e=n.get(g),t=n.get(g+"_form"),o;r.unbind("change",i),r.files.length&&e&&t&&(o=r.files[0],e.setAttribute("id",o.uid),t.setAttribute("id",o.uid+"_form"),t.setAttribute("target",o.uid+"_iframe")),e=t=null},998),m=h=null,r.trigger("change"))},l.can("summon_file_dialog")&&(f=n.get(c.browse_button),i.removeEvent(f,"click",r.uid),i.addEvent(f,"click",function(e){m&&!m.disabled&&m.click(),e.preventDefault()},r.uid)),a=g,d=p=f=null}var a,s=[],u=[],c;t.extend(this,{init:function(t){var o=this,a=o.getRuntime(),s;c=t,u=t.accept.mimes||r.extList2mimes(t.accept,a.can("filter_by_extension")),s=a.getShimContainer(),function(){var e,r,u;e=n.get(t.browse_button),a.can("summon_file_dialog")&&("static"===n.getStyle(e,"position")&&(e.style.position="relative"),r=parseInt(n.getStyle(e,"z-index"),10)||1,e.style.zIndex=r,s.style.zIndex=r-1),u=a.can("summon_file_dialog")?e:s,i.addEvent(u,"mouseover",function(){o.trigger("mouseenter")},o.uid),i.addEvent(u,"mouseout",function(){o.trigger("mouseleave")},o.uid),i.addEvent(u,"mousedown",function(){o.trigger("mousedown")},o.uid),i.addEvent(n.get(t.container),"mouseup",function(){o.trigger("mouseup")},o.uid),e=null}(),e.call(this),s=null,o.trigger({type:"ready",async:!0})},getFiles:function(){return s},disable:function(e){var t;(t=n.get(a))&&(t.disabled=!!e)},destroy:function(){var e=this.getRuntime(),t=e.getShim(),r=e.getShimContainer();i.removeAllEvents(r,this.uid),i.removeAllEvents(c&&n.get(c.container),this.uid),i.removeAllEvents(c&&n.get(c.browse_button),this.uid),r&&(r.innerHTML=""),t.removeInstance(this.uid),a=s=u=c=r=t=null}})}return e.FileInput=a}),i(lt,[ut,F],function(e,t){return e.FileReader=t}),i(dt,[ut,u,f,b,p,L,y,S],function(e,t,n,i,r,o,a,s){function u(){function e(e){var t=this,i,r,a,s,u=!1;if(l){if(i=l.id.replace(/_iframe$/,""),r=n.get(i+"_form")){for(a=r.getElementsByTagName("input"),s=a.length;s--;)switch(a[s].getAttribute("type")){case"hidden":a[s].parentNode.removeChild(a[s]);break;case"file":u=!0}a=[],u||r.parentNode.removeChild(r),r=null}setTimeout(function(){o.removeEvent(l,"load",t.uid),l.parentNode&&l.parentNode.removeChild(l);var n=t.getRuntime().getShimContainer();n.children.length||n.parentNode.removeChild(n),n=l=null,e()},1)}}var u,c,l;t.extend(this,{send:function(d,f){function p(){var n=m.getShimContainer()||document.body,r=document.createElement("div");r.innerHTML='<iframe id="'+g+'_iframe" name="'+g+'_iframe" src="javascript:""" style="display:none"></iframe>',l=r.firstChild,n.appendChild(l),o.addEvent(l,"load",function(){var n;try{n=l.contentWindow.document||l.contentDocument||window.frames[l.id].document,/^4(0[0-9]|1[0-7]|2[2346])\s/.test(n.title)?u=n.title.replace(/^(\d+).*$/,"$1"):(u=200,c=t.trim(n.body.innerHTML),h.trigger({type:"progress",loaded:c.length,total:c.length}),w&&h.trigger({type:"uploadprogress",loaded:w.size||1025,total:w.size||1025}))}catch(r){if(!i.hasSameOrigin(d.url))return e.call(h,function(){h.trigger("error")}),void 0;u=404}e.call(h,function(){h.trigger("load")})},h.uid)}var h=this,m=h.getRuntime(),g,v,y,w;if(u=c=null,f instanceof s&&f.hasBlob()){if(w=f.getBlob(),g=w.uid,y=n.get(g),v=n.get(g+"_form"),!v)throw new r.DOMException(r.DOMException.NOT_FOUND_ERR)}else g=t.guid("uid_"),v=document.createElement("form"),v.setAttribute("id",g+"_form"),v.setAttribute("method",d.method),v.setAttribute("enctype","multipart/form-data"),v.setAttribute("encoding","multipart/form-data"),v.setAttribute("target",g+"_iframe"),m.getShimContainer().appendChild(v);f instanceof s&&f.each(function(e,n){if(e instanceof a)y&&y.setAttribute("name",n);else{var i=document.createElement("input");t.extend(i,{type:"hidden",name:n,value:e}),y?v.insertBefore(i,y):v.appendChild(i)}}),v.setAttribute("action",d.url),p(),v.submit(),h.trigger("loadstart")},getStatus:function(){return u},getResponse:function(e){if("json"===e&&"string"===t.typeOf(c)&&window.JSON)try{return JSON.parse(c.replace(/^\s*<pre[^>]*>/,"").replace(/<\/pre>\s*$/,""))}catch(n){return null}return c},abort:function(){var t=this;l&&l.contentWindow&&(l.contentWindow.stop?l.contentWindow.stop():l.contentWindow.document.execCommand?l.contentWindow.document.execCommand("Stop"):l.src="about:blank"),e.call(this,function(){t.dispatchEvent("abort")})}})}return e.XMLHttpRequest=u}),i(ft,[ut,X],function(e,t){return e.Image=t}),a([u,c,l,d,f,p,h,m,g,v,y,w,E,_,x,R,b,T,S,A,O,I,L])}(this);;(function(){"use strict";var e={},t=moxie.core.utils.Basic.inArray;return function n(r){var i,s;for(i in r)s=typeof r[i],s==="object"&&!~t(i,["Exceptions","Env","Mime"])?n(r[i]):s==="function"&&(e[i]=r[i])}(window.moxie),e.Env=window.moxie.core.utils.Env,e.Mime=window.moxie.core.utils.Mime,e.Exceptions=window.moxie.core.Exceptions,window.mOxie=e,window.o||(window.o=e),e})(); \ No newline at end of file +eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('(c(dO,2A){"i2 hI";u 8y={};c g4(6a,3J){u 5S,dp=[];1B(u i=0;i<6a.T;++i){5S=8y[6a[i]]||gb(6a[i]);if(!5S){26\'5S 63 k2 5n k4: \'+6a[i]}dp.2G(5S)}3J.2v(Q,dp)}c 1v(id,bt,63){if(2J id!==\'2x\'){26\'df 5S 63, 5S id dW be gg lX be a 2x\'}if(bt===2A){26\'df 5S 63, bt dW be fX\'}if(63===2A){26\'df 5S 63, 63 c dW be fX\'}g4(bt,c(){8y[id]=63.2v(Q,1T)})}c gg(id){l!!8y[id]}c gb(id){u 1q=dO;u 52=id.3x(/[.\\/]/);1B(u fi=0;fi<52.T;++fi){if(!1q[52[fi]]){l}1q=1q[52[fi]]}l 1q}c iG(6a){1B(u i=0;i<6a.T;i++){u 1q=dO;u id=6a[i];u 52=id.3x(/[.\\/]/);1B(u fi=0;fi<52.T-1;++fi){if(1q[52[fi]]===2A){1q[52[fi]]={}}1q=1q[52[fi]]}1q[52[52.T-1]]=8y[id]}}1v(\'F/O/1a/G\',[],c(){u 1F=c(o){u 4v;if(o===4v){l\'2A\'}Y if(o===Q){l\'Q\'}Y if(o.cE){l\'3o\'}l({}).7f.V(o).3f(/\\s([a-z|A-Z]+)/)[1].3q()};u 1k=c(1q){u 4v;2f(1T,c(gZ,i){if(i>0){2f(gZ,c(P,2B){if(P!==4v){if(1F(1q[2B])===1F(P)&&!!~2t(1F(P),[\'2D\',\'4y\'])){1k(1q[2B],P)}Y{1q[2B]=P}}})}});l 1q};u 2f=c(1p,3J){u T,2B,i,4v;if(1p){37{T=1p.T}3k(ex){T=4v}if(T===4v){1B(2B in 1p){if(1p.6k(2B)){if(3J(1p[2B],2B)===1f){l}}}}Y{1B(i=0;i<T;i++){if(3J(1p[i],i)===1f){l}}}}};u 6o=c(1p){u 6t;if(!1p||1F(1p)!==\'4y\'){l 1t}1B(6t in 1p){l 1f}l 1t};u 8G=c(3B,cb){u i=0,T=3B.T;if(1F(cb)!==\'c\'){cb=c(){}}if(!3B||!3B.T){cb()}c dL(i){if(1F(3B[i])===\'c\'){3B[i](c(2C){++i<T&&!2C?dL(i):cb(2C)})}}dL(i)};u bK=c(3B,cb){u 3A=0,4M=3B.T,bx=1d e5(4M);2f(3B,c(fn,i){fn(c(2C){if(2C){l cb(2C)}u 2y=[].3h.V(1T);2y.9q();bx[i]=2y;3A++;if(3A===4M){bx.fJ(Q);cb.2v(f,bx)}})})};u 2t=c(dS,2D){if(2D){if(e5.2n.4x){l e5.2n.4x.V(2D,dS)}1B(u i=0,T=2D.T;i<T;i++){if(2D[i]===dS){l i}}}l-1};u 4a=c(6W,2D){u 9w=[];if(1F(6W)!==\'2D\'){6W=[6W]}if(1F(2D)!==\'2D\'){2D=[2D]}1B(u i in 6W){if(2t(6W[i],2D)===-1){9w.2G(6W[i])}}l 9w.T?9w:1f};u bs=c(ea,eB){u 1N=[];2f(ea,c(83){if(2t(83,eB)!==-1){1N.2G(83)}});l 1N.T?1N:Q};u bZ=c(1p){u i,76=[];1B(i=0;i<1p.T;i++){76[i]=1p[i]}l 76};u 2W=(c(){u f1=0;l c(9J){u 2W=1d ar().ca().7f(32),i;1B(i=0;i<5;i++){2W+=39.sl(39.s2()*s3).7f(32)}l(9J||\'oa\')+2W+(f1++).7f(32)}}());u 4H=c(1Q){if(!1Q){l 1Q}l 5T.2n.4H?5T.2n.4H.V(1Q):1Q.7f().3p(/^\\s*/,\'\').3p(/\\s*$/,\'\')};u 9z=c(1z){if(2J(1z)!==\'2x\'){l 1z}u dR={t:ou,g:oC,m:nc,k:bd},av;1z=/^([0-9]+)([ng]?)$/.1C(1z.3q().3p(/[^0-pV]/g,\'\'));av=1z[2];1z=+1z[1];if(dR.6k(av)){1z*=dR[av]}l 1z};l{2W:2W,1F:1F,1k:1k,2f:2f,6o:6o,8G:8G,bK:bK,2t:2t,4a:4a,bs:bs,bZ:bZ,4H:4H,9z:9z}});1v("F/O/55",["F/O/1a/G"],c(G){u c1={};l{pm:c(hR){l G.1k(c1,hR)},54:c(1Q){l c1[1Q]||1Q},6p:c(1Q){l f.54(1Q)},po:c(1Q){u 2y=[].3h.V(1T,1);l 1Q.3p(/%[a-z]/g,c(){u P=2y.9q();l G.1F(P)!==\'2A\'?P:\'\'})}}});1v("F/O/1a/27",["F/O/1a/G","F/O/55"],c(G,55){u aw=""+"2Q/pj,67 pi,"+"2Q/hT,hT,"+"2Q/hN-bA,hN,"+"2Q/pw,ps ai pU,"+"2Q/aR,aR,"+"2Q/5l.ms-nL,nG nC,"+"2Q/5l.ms-nm,oz oD oE,"+"2Q/eP,eP,"+"2Q/x-g5-2c,gI ok,"+"2Q/5l.7V-7N.fo.2j,oo,"+"2Q/5l.7V-7N.fo.bV,oi,"+"2Q/5l.7V-7N.ss.sp,sn,"+"2Q/5l.7V-7N.c5.s5,sj,"+"2Q/5l.7V-7N.c5.bV,rj,"+"2Q/5l.7V-7N.c5.rp,kc,"+"2Q/x-eV,js,"+"2Q/4m,4m,"+"5P/d4,ki kC kz kA,"+"5P/x-fw,fw,"+"5P/x-fv,fv,"+"5P/bU,kI bU,"+"5P/fQ,fQ kp,"+"5P/fK,fK,"+"5P/fL,fL,"+"5P/gP,gP,"+"5P/x-ms-gR,gR,"+"1S/gp,gp,"+"1S/ch,ch,"+"1S/4r,m4 4r m3,"+"1S/m0,m1,"+"1S/8x,8x,"+"1S/gk+hc,gk m7,"+"1S/6H,6H mA,"+"4b/eu,mZ bu 4b 9w mY,"+"4b/6f,l7 6f l4,"+"4b/eI,eI,"+"4b/eU,eU,"+"4b/aR,aR,"+"4o/d4,d4 kW n9 kk,"+"4o/iX,qt ko,"+"4o/i4,i4,"+"4o/x-hO,hO,"+"4o/x-hU,hU,"+"4o/x-ms-fq,fq,"+"4o/hQ,hQ,"+"4o/hP,hP,"+"4o/hS,hS k6,"+"4o/k5,k3,"+"4o/5l.rn-k9,rv,"+"4o/bU,kf,"+"4o/x-ke,kd,"+"2Q/5l.k1.jR.jS-bV,jP,"+"2Q/az-ax,jM";u 27={2O:{},1h:{},hL:c(aw){u 42=aw.3x(/,/),i,ii,44;1B(i=0;i<42.T;i+=2){44=42[i+1].3x(/ /);1B(ii=0;ii<44.T;ii++){f.2O[44[ii]]=42[i]}f.1h[42[i]]=44}},dI:c(c3,hJ){u L=f,44,i,ii,K,2O=[];1B(i=0;i<c3.T;i++){44=c3[i].1h.3x(/\\s*,\\s*/);1B(ii=0;ii<44.T;ii++){if(44[ii]===\'*\'){l[]}K=L.2O[44[ii]];if(!K){if(hJ&&/^\\w+$/.3G(44[ii])){2O.2G(\'.\'+44[ii])}Y{l[]}}Y if(G.2t(K,2O)===-1){2O.2G(K)}}}l 2O},hM:c(2O){u L=f,4i=[];G.2f(2O,c(3I){if(3I===\'*\'){4i=[];l 1f}u m=3I.3f(/^(\\w+)\\/(\\*|\\w+)$/);if(m){if(m[2]===\'*\'){G.2f(L.1h,c(76,3I){if((1d ct(\'^\'+m[1]+\'/\')).3G(3I)){[].2G.2v(4i,L.1h[3I])}})}Y if(L.1h[3I]){[].2G.2v(4i,L.1h[3I])}}});l 4i},c0:c(2O){u 2u=[],4i=[];if(G.1F(2O)===\'2x\'){2O=G.4H(2O).3x(/\\s*,\\s*/)}4i=f.hM(2O);2u.2G({7u:55.54(\'c2\'),1h:4i.T?4i.78(\',\'):\'*\'});2u.2O=2O;l 2u},cg:c(9L){u 3U=9L&&9L.3f(/\\.([^.]+)$/);if(3U){l 3U[1].3q()}l\'\'},by:c(9L){l f.2O[f.cg(9L)]||\'\'}};27.hL(aw);l 27});1v("F/O/1a/1e",["F/O/1a/G"],c(G){u 6Q=(c(2A){u 92=\'\',bL=\'?\',bS=\'c\',i9=\'2A\',am=\'4y\',3E=\'a4\',jW=\'hX\',2s=\'R\',kh=\'K\',kD=\'hZ\',2p=\'1R\',kE=\'kB\',kG=\'kK\',kJ=\'9v\',kH=\'ky\';u bO={bP:c(i8,i7){l i7.3q().4x(i8.3q())!==-1},kx:c(1Q){l 1Q.3q()}};u 62={aD:c(){1B(u 1N,i=0,j,k,p,q,3U,3f,2y=1T;i<2y.T;i+=2){u 8A=2y[i],5p=2y[i+1];if(2J(1N)===i9){1N={};1B(p in 5p){q=5p[p];if(2J(q)===am){1N[q[0]]=2A}Y{1N[q]=2A}}}1B(j=k=0;j<8A.T;j++){3U=8A[j].1C(f.cX());if(!!3U){1B(p=0;p<5p.T;p++){3f=3U[++k];q=5p[p];if(2J(q)===am&&q.T>0){if(q.T==2){if(2J(q[1])==bS){1N[q[0]]=q[1].V(f,3f)}Y{1N[q[0]]=q[1]}}Y if(q.T==3){if(2J(q[1])===bS&&!(q[1].1C&&q[1].3G)){1N[q[0]]=3f?q[1].V(f,3f,q[2]):2A}Y{1N[q[0]]=3f?3f.3p(q[1],q[2]):2A}}Y if(q.T==4){1N[q[0]]=3f?q[3].V(f,3f.3p(q[1],q[2])):2A}}Y{1N[q]=3f?3f:2A}}2l}}if(!!3U)2l}l 1N},1Q:c(1Q,7m){1B(u i in 7m){if(2J(7m[i])===am&&7m[i].T>0){1B(u j=0;j<7m[i].T;j++){if(bO.bP(7m[i][j],1Q)){l(i===bL)?2A:i}}}Y if(bO.bP(7m[i],1Q)){l(i===bL)?2A:i}}l 1Q}};u 9u={1n:{bM:{a4:{\'1\':[\'/8\',\'/1\',\'/3\'],\'2\':\'/4\',\'?\':\'/\'},1R:{\'1.0\':\'/8\',\'1.2\':\'/1\',\'1.3\':\'/3\',\'2.0\':\'/h0\',\'2.0.2\':\'/gY\',\'2.0.3\':\'/gq\',\'2.0.4\':\'/kl\',\'?\':\'/\'}}},kj:{kq:{hX:{\'kr ks 4G\':\'jw\'},hZ:{\'j3\':\'j8\',\'i0\':\'i0\'}}},os:{7k:{1R:{\'jd\':\'4.90\',\'61 3.11\':\'ja.51\',\'61 4.0\':\'jC.0\',\'jF\':\'61 5.0\',\'jk\':[\'61 5.1\',\'61 5.2\'],\'jl\':\'61 6.0\',\'7\':\'61 6.1\',\'8\':\'61 6.2\',\'8.1\':\'61 6.3\',\'jt\':\'jp\'}}}};u aC={1n:[[/(aB\\jB)\\/((\\d+)?[\\w\\.-]+)/i,/(aB\\s[jo]+).+1R\\/((\\d+)?[\\w\\.-]+)/i,/(aB).+1R\\/((\\d+)?[\\w\\.]+)/i,/(aB)[\\/\\s]+((\\d+)?[\\w\\.]+)/i],[2s,2p,3E],[/\\s(jq)\\/((\\d+)?[\\w\\.]+)/i],[[2s,\'a3\'],2p,3E],[/(jr)\\/((\\d+)?[\\w\\.]+)/i,/(jg|jz|iC|j0|iZ)[\\/\\s]?((\\d+)?[\\w\\.]+)*/i,/(iP\\s|iQ|iR|je)(?:1n)?[\\/\\s]?((\\d+)?[\\w\\.]*)/i,/(?:ms|\\()(ie)\\s((\\d+)?[\\w\\.]+)/i,/(mo)((?:\\/)[\\w\\.]+)*/i,/(mp|mk|mq|mr|mw|mt|mh|m5|m6|mg)\\/((\\d+)?[\\w\\.-]+)/i],[2s,2p,3E],[/(iu).+rv[:\\s]((\\d+)?[\\w\\.]+).+mc\\ma/i],[[2s,\'46\'],2p,3E],[/(mb)\\/((\\d+)?[\\w\\.]+)/i],[[2s,\'n0\'],2p,3E],[/(n1)\\/((\\d+)?[\\w\\.]+)/i],[[2s,/6p/g,\' \'],2p,3E],[/(n7|n8|n5|[n3]{5}\\s?1n)\\/v?((\\d+)?[\\w\\.]+)/i],[2s,2p,3E],[/(mS)\\/((\\d+)?[\\w\\.]+)/i],[[2s,\'mH\'],2p,3E],[/((?:cM.+)mI|mG)\\/((\\d+)?[\\w\\.]+)/i],[[2s,\'7D\'],2p,3E],[/((?:cM.+))1R\\/((\\d+)?[\\w\\.]+)\\iM\\mF/i],[[2s,\'ht hr\'],2p,3E],[/1R\\/((\\d+)?[\\w\\.]+).+?9v\\/\\w+\\s(9G)/i],[2p,3E,[2s,\'mC b5\']],[/1R\\/((\\d+)?[\\w\\.]+).+?(9v\\s?9G|9G)/i],[2p,3E,2s],[/bQ.+?(9v\\s?9G|9G)((\\/[\\w\\.]+))/i],[2s,[3E,62.1Q,9u.1n.bM.a4],[2p,62.1Q,9u.1n.bM.1R]],[/(mJ)\\/((\\d+)?[\\w\\.]+)/i,/(bQ|il)\\/((\\d+)?[\\w\\.]+)/i],[2s,2p,3E],[/(89|mK)\\/((\\d+)?[\\w\\.-]+)/i],[[2s,\'mP\'],2p,3E],[/(mL)/i,/(lb|lm|ln|ll|lk|kU\\kV|kT|kS)[\\/\\s]?((\\d+)?[\\w\\.\\+]+)/i,/(ff|kQ|k-l2|lR|lU|lT|lD)\\/((\\d+)?[\\w\\.-]+)/i,/(fs)\\/((\\d+)?[\\w\\.]+).+rv\\:.+cH\\/\\d+/i,/(lA\\s?1n|lB|iD|lC|io|ls|iE|iv|iF|lS)[\\/\\s]?((\\d+)?[\\w\\.]+)/i,/(ig)\\s\\(((\\d+)?[\\w\\.]+)/i,/(lo)\\/?((\\d+)?[\\w\\.]+)*/i,/(kZ\\s?1n)\\/v?((\\d+)?[\\w\\.6p]+)/i,/(lf)[\\/\\s]((\\d+)?[\\w\\.]+)/i],[2s,2p,3E]],d2:[[/(mN)\\/([\\w\\.]+)/i,/(bQ|iu|iC|iF|iE|iD|iv)\\/([\\w\\.]+)/i,/(il|jY|ig)[\\/\\s]\\(?([\\w\\.]+)/i,/(io)[\\/\\s]([23]\\.[\\d\\.]+)/i],[2s,2p],[/rv\\:([\\w\\.]+).*(cH)/i],[2p,2s]],os:[[/(7k)\\kb\\s6\\.2;\\s(kg)/i,/(7k\\k8(?:\\aE)*|7k\\iM|7k)[\\s\\/]?([mB\\d\\.\\s]+\\w)/i],[2s,[2p,62.1Q,9u.os.7k.1R]],[/(gm(?=3|9|n)|gm\\k7\\s)([nt\\d\\.]+)/i],[[2s,\'dc\'],[2p,62.1Q,9u.os.7k.1R]],[/\\((bb)(10);/i],[[2s,\'jV\'],2p],[/(kM)\\w*\\/?([\\w\\.]+)*/i,/(kn)\\/([\\w\\.]+)/i,/(cM|mz|m2\\os|m8|mf|m9\\mD\\aE|mQ)[\\/\\s-]?([\\w\\.]+)*/i],[2s,2p],[/(mR\\s?os|l9|kX(?=;))[\\/\\s-]?([\\w\\.]+)*/i],[[2s,\'l3\'],2p],[/fs.+\\(9v;.+cH.+ff/i],[[2s,\'di 9K\'],2p],[/(lI|lG)\\s([ml]+)/i,/(lE)[\\/\\s\\(]?(\\w+)*/i,/(lF|[lz]?ly|lr|[8M]*lq|lu|lv|lx|lw|lH|lV|lW|lQ|lL)[\\/\\s-]?([\\w\\.-]+)*/i,/(lK|lJ)\\s?([\\w\\.]+)*/i,/(lM)\\s?([\\w\\.]+)*/i],[2s,2p],[/(lN)\\s[\\w]+\\s([\\w\\.]+\\w)/i],[[2s,\'lP 9K\'],2p],[/(lO)\\s?([\\w\\.]+\\d)*/i],[[2s,\'lp\'],2p],[/\\s([l0-]{0,4}kY|l1)\\s?([\\w\\.]+)*/i],[2s,2p],[/(ip[kR]+)(?:.*os\\s*([\\w]+)*\\kP\\l5|;\\l6)/i],[[2s,\'dV\'],[2p,/6p/g,\'.\']],[/(ep\\aE\\sx)\\s?([\\w\\s\\.]+\\w)*/i],[2s,[2p,/6p/g,\'.\']],[/(lj)\\s(\\w+)/i,/(li)\\s((\\d)(?=\\.|\\)|\\s)[\\w\\.]*)*/i,/(lh|ep(?=lg)|l8\\s9|la|ld|os\\/2|lc|lY|lZ\\aE)/i,/(mM)\\s?([\\w\\.]+)*/i],[2s,2p]]};u 6Q=c(aI){u 9A=aI||((1A&&1A.89&&1A.89.ew)?1A.89.ew:92);f.gz=c(){l 62.aD.2v(f,aC.1n)};f.gx=c(){l 62.aD.2v(f,aC.d2)};f.gB=c(){l 62.aD.2v(f,aC.os)};f.84=c(){l{9A:f.cX(),1n:f.gz(),d2:f.gx(),os:f.gB()}};f.cX=c(){l 9A};f.gG=c(aI){9A=aI;l f};f.gG(9A)};l 1d 6Q().84()})();c gH(5X,5A,cq){u i=0,x=0,5o=0,gE={\'mV\':-6,\'dK\':-5,\'a\':-5,\'mU\':-4,\'b\':-4,\'mX\':-3,\'rc\':-3,\'#\':-2,\'p\':1,\'pl\':1},co=c(v){v=(\'\'+v).3p(/[6p\\-+]/g,\'.\');v=v.3p(/([^.\\d]+)/g,\'.$1.\').3p(/\\.{2,}/g,\'.\');l(!v.T?[-8]:v.3x(\'.\'))},cp=c(v){l!v?0:(dP(v)?gE[v]||-7:4O(v,10))};5X=co(5X);5A=co(5A);x=39.4L(5X.T,5A.T);1B(i=0;i<x;i++){if(5X[i]==5A[i]){8I}5X[i]=cp(5X[i]);5A[i]=cp(5A[i]);if(5X[i]<5A[i]){5o=-1;2l}Y if(5X[i]>5A[i]){5o=1;2l}}if(!cq){l 5o}4N(cq){1y\'>\':1y\'gt\':l(5o>0);1y\'>=\':1y\'ge\':l(5o>=0);1y\'<=\':1y\'le\':l(5o<=0);1y\'==\':1y\'=\':1y\'eq\':l(5o===0);1y\'<>\':1y\'!=\':1y\'ne\':l(5o!==0);1y\'\':1y\'<\':1y\'lt\':l(5o<0);9r:l Q}}u 1J=(c(){u 3t={cm:(c(){l 1f}()),72:(c(){u el=2j.4h(\'34\');l!!(el.6g&&el.6g(\'2d\'))}()),4U:c(1O){37{if(G.2t(1O,[\'\',\'4b\',\'2j\'])!==-1){l 1t}Y if(1A.1j){u 2g=1d 1j();2g.8M(\'1V\',\'/\');if(\'1O\'in 2g){2g.1O=1O;if(2g.1O!==1O){l 1f}l 1t}}}3k(ex){}l 1f},ae:(c(){u du=1d 1K();du.8B=c(){3t.ae=(du.1g===1&&du.1i===1)};81(c(){du.2L="J:1S/ch;4c,mi=="},1);l 1f}()),b6:c(){l 3t.ae&&(1e.1n!==\'46\'||1e.1R>=9)},fp:c(gu){l(3t.ae&&gu<mx||3t.b6())},dT:c(){u el=2j.4h(\'1P\');el.3n(\'K\',\'1b\');l!el.8V}};l c(3D){u 2y=[].3h.V(1T);2y.9q();l G.1F(3t[3D])===\'c\'?3t[3D].2v(f,2y):!!3t[3D]}}());u 1e={1J:1J,1n:6Q.1n.R,1R:dz(6Q.1n.a4),os:6Q.os.R,eX:6Q.os.1R,eQ:gH,9o:"../2c/dn.gI",as:"../2Y/dn.kO",dQ:"F.O.2q.3Q.31"};1e.9K=1e.os;l 1e});1v(\'F/O/1a/1l\',[\'F/O/1a/1e\'],c(1e){u 1V=c(id){if(2J id!==\'2x\'){l id}l 2j.mj(id)};u bF=c(1p,R){if(!1p.5Z){l 1f}u a9=1d ct("(^|\\\\s+)"+R+"(\\\\s+|$)");l a9.3G(1p.5Z)};u cl=c(1p,R){if(!bF(1p,R)){1p.5Z=!1p.5Z?R:1p.5Z.3p(/\\s+$/,\'\')+\' \'+R}};u ck=c(1p,R){if(1p.5Z){u a9=1d ct("(^|\\\\s+)"+R+"(\\\\s+|$)");1p.5Z=1p.5Z.3p(a9,c($0,$1,$2){l $1===\' \'&&$2===\' \'?\' \':\'\'})}};u 5U=c(1p,R){if(1p.gX){l 1p.gX[R]}Y if(1A.gV){l 1A.gV(1p,Q)[R]}};u bG=c(3o,8f){u x=0,y=0,3C,67=2j,aW,br;3o=3o;8f=8f||67.6N;c cx(3o){u 9Y,ad,x=0,y=0;if(3o){ad=3o.h8();9Y=67.j6==="j7"?67.al:67.6N;x=ad.6C+9Y.gM;y=ad.3r+9Y.gL}l{x:x,y:y}}if(3o&&3o.h8&&1e.1n===\'46\'&&(!67.h6||67.h6<8)){aW=cx(3o);br=cx(8f);l{x:aW.x-br.x,y:aW.y-br.y}}3C=3o;3M(3C&&3C!=8f&&3C.cE){x+=3C.jI||0;y+=3C.jj||0;3C=3C.ju}3C=3o.5g;3M(3C&&3C!=8f&&3C.cE){x-=3C.gM||0;y-=3C.gL||0;3C=3C.5g}l{x:x,y:y}};u 9c=c(3o){l{w:3o.jn||3o.jm,h:3o.jh||3o.ji}};l{1V:1V,bF:bF,cl:cl,ck:ck,5U:5U,bG:bG,9c:9c}});1v(\'F/O/36\',[\'F/O/1a/G\'],c(G){c 9s(1p,P){u 2B;1B(2B in 1p){if(1p[2B]===P){l 2B}}l Q}l{2N:(c(){u 4D={9N:1,8s:9,jv:4};c 2N(2b){f.2b=2b;f.R=9s(4D,2b);f.bE=f.R+": 2N "+f.2b}G.1k(2N,4D);2N.2n=4q.2n;l 2N}()),7C:(c(){c 7C(2b){f.2b=2b;f.R=\'7C\'}G.1k(7C,{jG:1});7C.2n=4q.2n;l 7C}()),2Z:(c(){u 4D={7h:1,ci:2};c 2Z(2b){f.2b=2b;f.R=9s(4D,2b);f.bE=f.R+": 2Z "+f.2b}G.1k(2Z,4D);2Z.2n=4q.2n;l 2Z}()),6h:(c(){u 4D={9I:1,cL:2,gS:3,fB:4,jH:5,gO:6,4p:7,7I:8};c 6h(2b){f.2b=2b;f.R=9s(4D,2b);f.bE=f.R+": 6h "+f.2b}G.1k(6h,4D);6h.2n=4q.2n;l 6h}()),1E:(c(){u 4D={jJ:1,jE:2,jD:3,jy:4,jx:5,jA:6,gO:7,9I:8,8s:9,jf:10,4p:11,7I:12,jK:13,j9:14,cF:15,iV:16,fk:17,cL:18,iW:19,gS:20,iT:21,iU:22,iS:23,fl:24,iY:25};c 1E(2b){f.2b=2b;f.R=9s(4D,2b);f.bE=f.R+": 1E "+f.2b}G.1k(1E,4D);1E.2n=4q.2n;l 1E}()),68:(c(){c 68(2b){f.2b=2b;f.R=\'68\'}G.1k(68,{gh:0});68.2n=4q.2n;l 68}())}});1v(\'F/O/2q\',[\'F/O/36\',\'F/O/1a/G\'],c(x,G){c 2q(){u 3v={};G.1k(f,{M:Q,2h:c(){if(!f.M){f.M=G.2W(\'4k\')}},4e:c(K,fn,66,7b){u L=f,3L;K=G.4H(K);if(/\\s/.3G(K)){G.2f(K.3x(/\\s+/),c(K){L.4e(K,fn,66,7b)});l}K=K.3q();66=4O(66,10)||0;3L=3v[f.M]&&3v[f.M][K]||[];3L.2G({fn:fn,66:66,7b:7b||f});if(!3v[f.M]){3v[f.M]={}}3v[f.M][K]=3L},eD:c(K){l K?!!(3v[f.M]&&3v[f.M][K]):!!3v[f.M]},aF:c(K,fn){K=K.3q();u 3L=3v[f.M]&&3v[f.M][K],i;if(3L){if(fn){1B(i=3L.T-1;i>=0;i--){if(3L[i].fn===fn){3L.ir(i,1);2l}}}Y{3L=[]}if(!3L.T){4S 3v[f.M][K];if(G.6o(3v[f.M])){4S 3v[f.M]}}}},fM:c(){if(3v[f.M]){4S 3v[f.M]}},31:c(K){u M,3L,2y,5J,4f={},1N=1t,4v;if(G.1F(K)!==\'2x\'){5J=K;if(G.1F(5J.K)===\'2x\'){K=5J.K;if(5J.3Y!==4v&&5J.3X!==4v){4f.3Y=5J.3Y;4f.3X=5J.3X}4f.5x=5J.5x||1f}Y{26 1d x.68(x.68.gh)}}if(K.4x(\'::\')!==-1){(c(76){M=76[0];K=76[1]}(K.3x(\'::\')))}Y{M=f.M}K=K.3q();3L=3v[M]&&3v[M][K];if(3L){3L.j5(c(a,b){l b.66-a.66});2y=[].3h.V(1T);2y.9q();4f.K=K;2y.fJ(4f);u 3B=[];G.2f(3L,c(7W){2y[0].1q=7W.7b;if(4f.5x){3B.2G(c(cb){81(c(){cb(7W.fn.2v(7W.7b,2y)===1f)},1)})}Y{3B.2G(c(cb){cb(7W.fn.2v(7W.7b,2y)===1f)})}});if(3B.T){G.8G(3B,c(5t){1N=!5t})}}l 1N},2k:c(){f.4e.2v(f,1T)},dd:c(){f.aF.2v(f,1T)},6X:c(){f.fM.2v(f,1T)},1m:c(){l f.31.2v(f,1T)},6l:c(75){u h;if(G.1F(75)!==\'2D\'){75=[75]}1B(u i=0;i<75.T;i++){h=\'on\'+75[i];if(G.1F(f[h])===\'c\'){f.4e(75[i],f[h])}Y if(G.1F(f[h])===\'2A\'){f[h]=Q}}}})}2q.3Q=1d 2q();l 2q});1v(\'F/O/1a/1X\',[],c(){u 6b=c(1Q){l cc(c4(1Q))};u 9B=c(fN){l kv(fI(fN))};u 43=c(J,7d){if(2J(1A.43)===\'c\'){l 7d?9B(1A.43(J)):1A.43(J)}u 5w="fR+/=";u o1,o2,o3,h1,h2,h3,h4,4W,i=0,ac=0,b4="",69=[];if(!J){l J}J+=\'\';do{h1=5w.4x(J.65(i++));h2=5w.4x(J.65(i++));h3=5w.4x(J.65(i++));h4=5w.4x(J.65(i++));4W=h1<<18|h2<<12|h3<<6|h4;o1=4W>>16≈o2=4W>>8≈o3=4W≈if(h3==64){69[ac++]=5T.6P(o1)}Y if(h4==64){69[ac++]=5T.6P(o1,o2)}Y{69[ac++]=5T.6P(o1,o2,o3)}}3M(i<J.T);b4=69.78(\'\');l 7d?9B(b4):b4};u 5Q=c(J,7d){if(7d){6b(J)}if(2J(1A.5Q)===\'c\'){l 1A.5Q(J)}u 5w="fR+/=";u o1,o2,o3,h1,h2,h3,h4,4W,i=0,ac=0,aV="",69=[];if(!J){l J}do{o1=J.8R(i++);o2=J.8R(i++);o3=J.8R(i++);4W=o1<<16|o2<<8|o3;h1=4W>>18&aZ;h2=4W>>12&aZ;h3=4W>>6&aZ;h4=4W&aZ;69[ac++]=5w.65(h1)+5w.65(h2)+5w.65(h3)+5w.65(h4)}3M(i<J.T);aV=69.78(\'\');u r=J.T%3;l(r?aV.3h(0,r-3):aV)+\'===\'.3h(r||3)};l{6b:6b,9B:9B,43:43,5Q:5Q}});1v(\'F/H/1c\',["F/O/1a/G","F/O/1a/1l","F/O/2q"],c(G,1l,2q){u cr={},9y={};c 1c(X,K,3t,79,g9){u L=f,6w,4X=G.2W(K+\'6p\'),5v=g9||\'1n\';X=X||{};9y[4X]=f;3t=G.1k({5d:1f,6I:1f,7x:1f,7K:1f,82:1f,8W:1t,7U:1f,7P:1f,7R:1f,4U:1f,77:1t,6S:1f,5M:1f,cT:1f,7z:1t,6y:1f,7Q:1t,6V:1t,7y:1f,7A:1f,5m:1f,7X:1t,8t:1t},3t);if(X.g7){5v=1c.d0(79,X.g7,5v)}6w=(c(){u 73={};l{1C:c(M,1o,fn,2y){if(6w[1o]){if(!73[M]){73[M]={fW:f,3Q:1d 6w[1o]()}}if(73[M].3Q[fn]){l 73[M].3Q[fn].2v(f,2y)}}},8U:c(M){4S 73[M]},f6:c(){u L=f;G.2f(73,c(1p,M){if(G.1F(1p.3Q.1x)===\'c\'){1p.3Q.1x.V(1p.fW)}L.8U(M)})}}}());G.1k(f,{aq:1f,M:4X,K:K,1u:1c.d0(79,(X.2V),5v),6n:4X+\'ka\',ba:0,X:X,1J:c(3D,P){u 9x=1T[2]||3t;if(G.1F(3D)===\'2x\'&&G.1F(P)===\'2A\'){3D=1c.8H(3D)}if(G.1F(3D)===\'4y\'){1B(u 2B in 3D){if(!f.1J(2B,3D[2B],9x)){l 1f}}l 1t}if(G.1F(9x[3D])===\'c\'){l 9x[3D].V(f,P)}Y{l(P===9x[3D])}},4w:c(){u 1Z,1I=1l.1V(f.6n);if(!1I){1Z=f.X.1Z?1l.1V(f.X.1Z):2j.6N;1I=2j.4h(\'6G\');1I.id=f.6n;1I.5Z=\'F-6D F-6D-\'+f.K;G.1k(1I.3a,{4z:\'9g\',3r:\'a5\',6C:\'a5\',1g:\'g2\',1i:\'g2\',dC:\'5F\'});1Z.6L(1I);1Z=Q}l 1I},53:c(){l 6w},3j:c(5c,5r){u 2y=[].3h.V(1T,2);l L.53().1C.V(f,f.M,5c,5r,2y)},1C:c(5c,5r){u 2y=[].3h.V(1T,2);if(L[5c]&&L[5c][5r]){l L[5c][5r].2v(f,2y)}l L.3j.2v(f,1T)},1x:c(){if(!L){l}u 1I=1l.1V(f.6n);if(1I){1I.5g.8D(1I)}if(6w){6w.f6()}f.6X();4S 9y[f.M];f.M=Q;4X=L=6w=1I=Q}});if(f.1u&&X.2V&&!f.1J(X.2V)){f.1u=1f}}1c.7M=\'2i,2c,2Y,4Y\';1c.1L=c(M){l 9y[M]?9y[M]:1f};1c.95=c(K,5y){5y.2n=2q.3Q;cr[K]=5y};1c.bJ=c(K){l cr[K]||Q};1c.9D=c(M){u H=1c.1L(M);if(H){l{M:H.M,K:H.K,1u:H.1u,1J:c(){l H.1J.2v(H,1T)}}}l Q};1c.8H=c(bh){u cG={};if(G.1F(bh)!==\'2x\'){l bh||{}}G.2f(bh.3x(\',\'),c(2B){cG[2B]=1t});l cG};1c.1J=c(K,3t){u H,5y=1c.bJ(K),1u;if(5y){H=1d 5y({2V:3t});1u=H.1u;H.1x();l!!1u}l 1f};1c.rr=c(3t,fY){u b8=(fY||1c.7M).3x(/\\s*,\\s*/);1B(u i in b8){if(1c.1J(b8[i],3t)){l b8[i]}}l Q};1c.d0=c(79,cS,5v){u 1u=Q;if(G.1F(5v)===\'2A\'){5v=\'1n\'}if(cS&&!G.6o(79)){G.2f(cS,c(P,3D){if(79.6k(3D)){u 8h=79[3D](P);if(2J(8h)===\'2x\'){8h=[8h]}if(!1u){1u=8h}Y if(!(1u=G.bs(1u,8h))){l(1u=1f)}}});if(1u){l G.2t(5v,1u)!==-1?5v:1u[0]}Y if(1u===1f){l 1f}}l 5v};1c.38=c(){l 1t};1c.rt=c(){l 1f};1c.dB=c(gc){l c(){l!!gc}};l 1c});1v(\'F/H/2U\',[\'F/O/36\',\'F/O/1a/G\',\'F/H/1c\'],c(x,G,1c){l c 2U(){u H;G.1k(f,{40:c(X){u 1o=f,1U;c bk(42){u K,5y;if(!42.T){1o.1m(\'2N\',1d x.2N(x.2N.9N));H=Q;l}K=42.9q();5y=1c.bJ(K);if(!5y){bk(42);l}H=1d 5y(X);H.2k(\'dD\',c(){H.aq=1t;81(c(){H.ba++;1o.1m(\'7e\',H)},1)});H.2k(\'4q\',c(){H.1x();bk(42)});if(!H.1u){H.1m(\'4q\');l}H.2h()}if(G.1F(X)===\'2x\'){1U=X}Y if(G.1F(X.1U)===\'2x\'){1U=X.1U}if(1U){H=1c.1L(1U);if(H){H.ba++;l H}Y{26 1d x.2N(x.2N.9N)}}bk((X.fm||1c.7M).3x(/\\s*,\\s*/))},1L:c(){if(H&&H.M){l H}H=Q;l Q},5B:c(){if(H&&--H.ba<=0){H.1x();H=Q}}})}});1v(\'F/1b/1w\',[\'F/O/1a/G\',\'F/O/1a/1X\',\'F/H/2U\'],c(G,1X,2U){u 5E={};c 1w(1U,U){c ga(2P,3S,K){u U,J=5E[f.M];if(G.1F(J)!==\'2x\'||!J.T){l Q}U=1d 1w(Q,{K:K,1z:3S-2P});U.b9(J.7o(2P,U.1z));l U}2U.V(f);if(1U){f.40(1U)}if(!U){U={}}Y if(G.1F(U)===\'2x\'){U={J:U}}G.1k(f,{M:U.M||G.2W(\'4k\'),1U:1U,1z:U.1z||0,K:U.K||\'\',3h:c(2P,3S,K){if(f.50()){l ga.2v(f,1T)}l f.1L().1C.V(f,\'1w\',\'3h\',f.3H(),2P,3S,K)},3H:c(){if(!5E[f.M]){l Q}l 5E[f.M]},b9:c(J){if(f.1U){f.1L().1C.V(f,\'1w\',\'1x\',5E[f.M]);f.5B();f.1U=Q}J=J||\'\';u 3U=J.3f(/^J:([^;]*);4c,/);if(3U){f.K=3U[1];J=1X.43(J.8w(J.4x(\'4c,\')+7))}f.1z=J.T;5E[f.M]=J},50:c(){l!f.1U&&G.1F(5E[f.M])===\'2x\'},1x:c(){f.b9();4S 5E[f.M]}});if(U.J){f.b9(U.J)}Y{5E[f.M]=U}}l 1w});1v(\'F/1b/1Y\',[\'F/O/1a/G\',\'F/O/1a/27\',\'F/1b/1w\'],c(G,27,1w){c 1Y(1U,1b){u R,K;if(!1b){1b={}}if(1b.K&&1b.K!==\'\'){K=1b.K}Y{K=27.by(1b.R)}if(1b.R){R=1b.R.3p(/\\\\/g,\'/\');R=R.7o(R.ry(\'/\')+1)}Y{u 9J=K.3x(\'/\')[0];R=G.2W((9J!==\'\'?9J:\'1b\')+\'6p\');if(27.1h[K]){R+=\'.\'+27.1h[K][0]}}1w.2v(f,1T);G.1k(f,{K:K||\'\',R:R||G.2W(\'rx\'),fT:1b.fT||(1d ar()).rw()})}1Y.2n=1w.2n;l 1Y});1v(\'F/1b/2F\',[\'F/O/1a/G\',\'F/O/1a/27\',\'F/O/1a/1l\',\'F/O/36\',\'F/O/2q\',\'F/O/55\',\'F/1b/1Y\',\'F/H/1c\',\'F/H/2U\'],c(G,27,1l,x,2q,55,1Y,1c,2U){u 4V=[\'7l\',\'8X\',\'ro\',\'bX\',\'ce\',\'8P\',\'8O\'];c 2F(X){u L=f,1Z,2o,7n;if(G.2t(G.1F(X),[\'2x\',\'3o\'])!==-1){X={6A:X}}2o=1l.1V(X.6A);if(!2o){26 1d x.1E(x.1E.9I)}7n={2u:[{7u:55.54(\'fE c2\'),1h:\'*\'}],R:\'1b\',8a:1f,2V:1f,1Z:2o.5g||2j.6N};X=G.1k({},7n,X);if(2J(X.2V)===\'2x\'){X.2V=1c.8H(X.2V)}if(2J(X.2u)===\'2x\'){X.2u=27.c0(X.2u)}1Z=1l.1V(X.1Z);if(!1Z){1Z=2j.6N}if(1l.5U(1Z,\'4z\')===\'aA\'){1Z.3a.4z=\'8T\'}1Z=2o=Q;2U.V(L);G.1k(L,{M:G.2W(\'4k\'),1U:Q,6n:Q,3e:Q,2h:c(){L.6l(4V);L.2k(\'7e\',c(e,H){L.1U=H.M;L.6n=H.6n;L.2k("rm",c(){L.1m("bY")},6Z);L.2k("rf",c(){u 3e=H.1C.V(L,\'2F\',\'8S\');L.3e=[];G.2f(3e,c(1b){if(1b.1z===0){l 1t}L.3e.2G(1d 1Y(L.1U,1b))})},6Z);L.2k(\'bY\',c(){u bI,1z,2o,1I;2o=1l.1V(X.6A);1I=1l.1V(H.6n);if(2o){bI=1l.bG(2o,1l.1V(X.1Z));1z=1l.9c(2o);if(1I){G.1k(1I.3a,{3r:bI.y+\'px\',6C:bI.x+\'px\',1g:1z.w+\'px\',1i:1z.h+\'px\'})}}1I=2o=Q});H.1C.V(L,\'2F\',\'2h\',X)});L.40(G.1k({},X,{2V:{5M:1t}}))},aN:c(4E){u H=f.1L();if(H){H.1C.V(f,\'2F\',\'aN\',G.1F(4E)===\'2A\'?1t:4E)}},re:c(){L.1m("bY")},1x:c(){u H=f.1L();if(H){H.1C.V(f,\'2F\',\'1x\');f.5B()}if(G.1F(f.3e)===\'2D\'){G.2f(f.3e,c(1b){1b.1x()})}f.3e=Q}})}2F.2n=2q.3Q;l 2F});1v(\'F/1b/3F\',[\'F/O/55\',\'F/O/1a/1l\',\'F/O/36\',\'F/O/1a/G\',\'F/1b/1Y\',\'F/H/2U\',\'F/O/2q\',\'F/O/1a/27\'],c(55,1l,x,G,1Y,2U,2q,27){u 4V=[\'7l\',\'9R\',\'cK\',\'9F\',\'2C\'];c 3F(X){u L=f,7n;if(2J(X)===\'2x\'){X={fF:X}}7n={2u:[{7u:55.54(\'fE c2\'),1h:\'*\'}],2V:{82:1t}};X=2J(X)===\'4y\'?G.1k({},7n,X):7n;X.1Z=1l.1V(X.fF)||2j.6N;if(1l.5U(X.1Z,\'4z\')===\'aA\'){X.1Z.3a.4z=\'8T\'}if(2J(X.2u)===\'2x\'){X.2u=27.c0(X.2u)}2U.V(L);G.1k(L,{M:G.2W(\'4k\'),1U:Q,3e:Q,2h:c(){L.6l(4V);L.2k(\'7e\',c(e,H){L.1U=H.M;L.2k("rd",c(){u 3e=H.1C.V(L,\'3F\',\'8S\');L.3e=[];G.2f(3e,c(1b){L.3e.2G(1d 1Y(L.1U,1b))})},6Z);H.1C.V(L,\'3F\',\'2h\',X);L.31(\'7l\')});L.40(X)},1x:c(){u H=f.1L();if(H){H.1C.V(f,\'3F\',\'1x\');f.5B()}f.3e=Q}})}3F.2n=2q.3Q;l 3F});1v(\'F/H/59\',[\'F/O/1a/G\',\'F/H/2U\',"F/O/2q"],c(G,2U,2q){c 59(){f.M=G.2W(\'4k\');2U.V(f);f.1x=c(){f.5B();f.6X()}}59.2n=2q.3Q;l 59});1v(\'F/1b/1H\',[\'F/O/1a/G\',\'F/O/1a/1X\',\'F/O/36\',\'F/O/2q\',\'F/1b/1w\',\'F/1b/1Y\',\'F/H/59\'],c(G,1X,x,2q,1w,1Y,59){u 4V=[\'9E\',\'5D\',\'4u\',\'3z\',\'2C\',\'8k\'];c 1H(){u L=f,2e;G.1k(f,{M:G.2W(\'4k\'),35:1H.92,1N:Q,2C:Q,5b:c(U){6s.V(f,\'5b\',U)},4l:c(U){6s.V(f,\'4l\',U)},5e:c(U){6s.V(f,\'5e\',U)},3z:c(){f.1N=Q;if(G.2t(f.35,[1H.92,1H.3Z])!==-1){l}Y if(f.35===1H.5C){f.35=1H.3Z}if(2e){2e.1L().1C.V(f,\'1H\',\'3z\')}f.1m(\'3z\');f.1m(\'8k\')},1x:c(){f.3z();if(2e){2e.1L().1C.V(f,\'1H\',\'1x\');2e.5B()}L=2e=Q}});c 6s(op,U){2e=1d 59();c 2C(5t){L.35=1H.3Z;L.2C=5t;L.1m(\'2C\');6m()}c 6m(){2e.1x();2e=Q;L.1m(\'8k\')}c 1C(H){2e.2k(\'4q\',c(e,5t){2C(5t)});2e.2k(\'dt\',c(e){L.1N=H.1C.V(2e,\'1H\',\'84\');L.1m(e)});2e.2k(\'9S\',c(e){L.35=1H.3Z;L.1N=H.1C.V(2e,\'1H\',\'84\');L.1m(e);6m()});H.1C.V(2e,\'1H\',\'2w\',op,U)}f.6l(4V);if(f.35===1H.5C){l 2C(1d x.1E(x.1E.4p))}f.35=1H.5C;f.1m(\'9E\');if(U 3u 1w){if(U.50()){u 2L=U.3H();4N(op){1y\'5e\':1y\'5b\':f.1N=2L;2l;1y\'4l\':f.1N=\'J:\'+U.K+\';4c,\'+1X.5Q(2L);2l}f.35=1H.3Z;f.1m(\'4u\');6m()}Y{1C(2e.40(U.1U))}}Y{2C(1d x.1E(x.1E.9I))}}}1H.92=0;1H.5C=1;1H.3Z=2;1H.2n=2q.3Q;l 1H});1v(\'F/O/1a/4j\',[],c(){u 6u=c(2H,5G){u 2B=[\'d9\',\'6r\',\'rb\',\'rg\',\'6x\',\'e8\',\'7G\',\'5j\',\'8T\',\'41\',\'aJ\',\'1b\',\'c8\',\'rh\'],i=2B.T,bg={fy:80,fz:fG},3w={},8A=/^(?:([^:\\/?#]+):)?(?:\\/\\/()(?:(?:()(?:([^:@]*):?([^:@]*))?@)?([^:\\/?#]*)(?::(\\d*))?))?()(?:(()(?:(?:[^?#\\/]*\\/)*)()(?:[^?#]*))(?:\\\\?([^#]*))?(?:#(.*))?)/,m=8A.1C(2H||\'\');3M(i--){if(m[i]){3w[2B[i]]=m[i]}}if(!3w.6r){if(!5G||2J(5G)===\'2x\'){5G=6u(5G||2j.rl.rk)}3w.6r=5G.6r;3w.7G=5G.7G;3w.5j=5G.5j;u 41=\'\';if(/^[^\\/]/.3G(3w.41)){41=5G.41;if(!/(\\/|\\/[^\\.]+)$/.3G(41)){41=41.3p(/\\/[^\\/]+$/,\'/\')}Y{41+=\'/\'}}3w.41=41+(3w.41||\'\')}if(!3w.5j){3w.5j=bg[3w.6r]||80}3w.5j=4O(3w.5j,10);if(!3w.41){3w.41="/"}4S 3w.d9;l 3w};u bl=c(2H){u bg={fy:80,fz:fG},4g=6u(2H);l 4g.6r+\'://\'+4g.7G+(4g.5j!==bg[4g.6r]?\':\'+4g.5j:\'\')+4g.41+(4g.c8?4g.c8:\'\')};u 8g=c(2H){c b7(2H){l[2H.6r,2H.7G,2H.5j].78(\'/\')}if(2J 2H===\'2x\'){2H=6u(2H)}l b7(6u())===b7(2H)};l{6u:6u,bl:bl,8g:8g}});1v(\'F/1b/33\',[\'F/O/1a/G\',\'F/H/2U\',\'F/O/1a/1X\'],c(G,2U,1X){l c(){2U.V(f);G.1k(f,{M:G.2W(\'4k\'),5b:c(U){l 6s.V(f,\'5b\',U)},4l:c(U){l 6s.V(f,\'4l\',U)},5e:c(U){l 6s.V(f,\'5e\',U)}});c 6s(op,U){if(U.50()){u 2L=U.3H();4N(op){1y\'5b\':l 2L;1y\'4l\':l\'J:\'+U.K+\';4c,\'+1X.5Q(2L);1y\'5e\':u bu=\'\';1B(u i=0,T=2L.T;i<T;i++){bu+=5T.6P(2L[i])}l bu}}Y{u 1N=f.40(U.1U).1C.V(f,\'33\',\'2w\',op,U);f.5B();l 1N}}}});1v("F/2g/3i",["F/O/36","F/O/1a/G","F/1b/1w"],c(x,G,1w){c 3i(){u 3m,bo=[];G.1k(f,{6q:c(R,P){u L=f,7B=G.1F(P);if(P 3u 1w){3m={R:R,P:P}}Y if(\'2D\'===7B){R+=\'[]\';G.2f(P,c(P){L.6q(R,P)})}Y if(\'4y\'===7B){G.2f(P,c(P,2B){L.6q(R+\'[\'+2B+\']\',P)})}Y if(\'Q\'===7B||\'2A\'===7B||\'ri\'===7B&&dP(P)){L.6q(R,"1f")}Y{bo.2G({R:R,P:P.7f()})}},8u:c(){l!!f.6F()},6F:c(){l 3m&&3m.P||Q},hf:c(){l 3m&&3m.R||Q},2f:c(cb){G.2f(bo,c(cO){cb(cO.P,cO.R)});if(3m){cb(3m.P,3m.R)}},1x:c(){3m=Q;bo=[]}})}l 3i});1v("F/2g/1j",["F/O/1a/G","F/O/36","F/O/2q","F/O/1a/1X","F/O/1a/4j","F/H/1c","F/H/59","F/1b/1w","F/1b/33","F/2g/3i","F/O/1a/1e","F/O/1a/27"],c(G,x,2q,1X,4j,1c,59,1w,33,3i,1e,27){u ee={48:\'rA\',rQ:\'rP rO\',rN:\'rR\',6K:\'rS\',rV:\'rU\',rT:\'rM\',rL:\'rE-rD rC\',rB:\'hb 5z\',rF:\'rG 5z\',rK:\'hW 5z\',rJ:\'rI-rH\',ra:\'r9 qG\',qF:\'qE qD\',qH:\'qI qL\',qK:\'gK\',qJ:\'qC e0\',qB:\'6v na\',qs:\'qr gT\',qq:\'qv\',qw:\'qA qz\',qy:\'gj bp\',qx:\'qM\',qN:\'r3 bB\',r2:\'r1\',7a:\'6v gK\',r0:\'r4 6v r5\',r8:\'6v r7\',r6:\'gT qZ bB\',qY:\'bp gw\',qR:\'qQ\',qP:\'qO\',qS:\'hB bB\',h0:\'qT cR\',rX:\'bp gs gW qW\',qV:\'bp-qU gW rW\',sc:\'t3 t2 ay\',gY:\'t1 t0 6v t4\',gq:\'t5 cR\',t8:\'t7 gs\',t6:\'sZ\',sY:\'cR sR\',sQ:\'sP bB\',sO:\'sS sT 4q\',sX:\'6v sW\',ta:\'gj gv\',sV:\'sU t9\',tc:\'gv gw\',tp:\'tn ts 6v tt\',tu:\'tl td tb\',tk:\'tj ti\',th:\'6v tf\'};c cI(){f.M=G.2W(\'4k\')}cI.2n=2q.3Q;u 4V=[\'9E\',\'5D\',\'3z\',\'2C\',\'4u\',\'cW\',\'8k\'];u tm=1,tv=2;c 1j(){u L=f,5p={cW:0,35:1j.bw,5W:1f,6e:0,cu:"",1O:"",aj:Q,5Y:Q,6d:Q},91=1t,cs,bH,8q={},cB,cC,cz=Q,8C=Q,97=1f,7F=1f,94=1f,8Z=1f,7E=1f,93=1f,cw,fb,es=Q,ez=Q,1G={},1s,7w=\'\',7c;G.1k(f,5p,{M:G.2W(\'4k\'),4A:1d cI(),8M:c(4n,2H,5x,6x,8N){u 4g;if(!4n||!2H){26 1d x.1E(x.1E.7I)}if(/[\\ei-\\eh]/.3G(4n)||1X.6b(4n)!==4n){26 1d x.1E(x.1E.7I)}if(!!~G.2t(4n.9b(),[\'gA\',\'to\',\'96\',\'tq\',\'sM\',\'98\',\'sf\',\'h9\',\'f5\'])){bH=4n.9b()}if(!!~G.2t(bH,[\'gA\',\'h9\',\'f5\'])){26 1d x.1E(x.1E.cL)}2H=1X.6b(2H);4g=4j.6u(2H);93=4j.8g(4g);cs=4j.bl(2H);if((6x||8N)&&!93){26 1d x.1E(x.1E.cF)}cB=6x||4g.6x;cC=8N||4g.e8;91=5x||1t;if(91===1f&&(2r(\'cW\')||2r(\'5W\')||2r(\'1O\')!=="")){26 1d x.1E(x.1E.cF)}97=!91;7F=1f;8q={};8m.V(f);2r(\'35\',1j.9a);f.6l([\'7g\']);f.31(\'7g\')},9X:c(2S,P){u em=["2u-9j","2u-8i","et-88-eg-2E","et-88-eg-4n","se","dA-T","en","eo","dA-ej-8i","sd","sN","7G","sg-si","b7","sk","te","sb","ej-8i","sa","6x-s1","s0"];if(2r(\'35\')!==1j.9a||7F){26 1d x.1E(x.1E.4p)}if(/[\\ei-\\eh]/.3G(2S)||1X.6b(2S)!==2S){26 1d x.1E(x.1E.7I)}2S=G.4H(2S).3q();if(!!~G.2t(2S,em)||/^(rZ\\-|rY\\-)/.3G(2S)){l 1f}if(!8q[2S]){8q[2S]=P}Y{8q[2S]+=\', \'+P}l 1t},an:c(){l 7w||\'\'},ak:c(2S){2S=2S.3q();if(7E||!!~G.2t(2S,[\'bv-en\',\'bv-eo\'])){l Q}if(7w&&7w!==\'\'){if(!7c){7c={};G.2f(7w.3x(/\\r\\n/),c(ek){u 71=ek.3x(/:\\s+/);if(71.T===2){71[0]=G.4H(71[0]);7c[71[0].3q()]={2S:71[0],P:G.4H(71[1])}}})}if(7c.6k(2S)){l 7c[2S].2S+\': \'+7c[2S].P}}l Q},s8:c(3I){u 3U,9j;if(!!~G.2t(2r(\'35\'),[1j.5C,1j.3Z])){26 1d x.1E(x.1E.4p)}3I=G.4H(3I.3q());if(/;/.3G(3I)&&(3U=3I.3f(/^([^;]+)(?:;\\s7\\=)?(.*)$/))){3I=3U[1];if(3U[2]){9j=3U[2]}}if(!27.2O[3I]){26 1d x.1E(x.1E.7I)}es=3I;ez=9j},3R:c(J,X){if(G.1F(X)===\'2x\'){1G={1U:X}}Y if(!X){1G={}}Y{1G=X}f.6l(4V);f.4A.6l(4V);if(f.35!==1j.9a||7F){26 1d x.1E(x.1E.4p)}if(J 3u 1w){1G.1U=J.1U;8C=J.K||\'2Q/az-ax\'}Y if(J 3u 3i){if(J.8u()){u U=J.6F();1G.1U=U.1U;8C=U.K||\'2Q/az-ax\'}}Y if(2J J===\'2x\'){cz=\'ev-8\';8C=\'4b/eu;9j=ev-8\';J=1X.6b(J)}if(!f.5W){f.5W=(1G.2V&&1G.2V.7Q)&&!93}94=(!97&&f.4A.eD());7E=1f;8Z=!J;if(!97){7F=1t}e9.V(f,J)},3z:c(){7E=1t;97=1f;if(!~G.2t(2r(\'35\'),[1j.bw,1j.9a,1j.3Z])){2r(\'35\',1j.3Z);7F=1f;if(1s){1s.1L().1C.V(1s,\'1j\',\'3z\',8Z)}Y{26 1d x.1E(x.1E.4p)}8Z=1t}Y{2r(\'35\',1j.bw)}},1x:c(){if(1s){if(G.1F(1s.1x)===\'c\'){1s.1x()}1s=Q}f.6X();if(f.4A){f.4A.6X();f.4A=Q}}});c 2r(6t,P){if(!5p.6k(6t)){l}if(1T.T===1){l 1e.1J(\'cm\')?5p[6t]:L[6t]}Y{if(1e.1J(\'cm\')){5p[6t]=P}Y{L[6t]=P}}}c e9(J){u L=f;cw=1d ar().ca();1s=1d 59();c 6m(){1s.1x();1s=Q;L.31(\'8k\');L=Q}c 1C(H){1s.2k(\'sG\',c(e){2r(\'35\',1j.5C);L.31(\'7g\');L.31(e);if(94){L.4A.31(e)}});1s.2k(\'dt\',c(e){if(2r(\'35\')!==1j.5C){2r(\'35\',1j.5C);L.31(\'7g\')}L.31(e)});1s.2k(\'hC\',c(e){if(94){L.4A.31({K:\'5D\',hz:1f,3Y:e.3Y,3X:e.3X})}});1s.2k(\'9S\',c(e){2r(\'35\',1j.3Z);2r(\'6e\',sF(H.1C.V(1s,\'1j\',\'cn\')||0));2r(\'cu\',ee[2r(\'6e\')]||"");2r(\'6d\',H.1C.V(1s,\'1j\',\'b2\',2r(\'1O\')));if(!!~G.2t(2r(\'1O\'),[\'4b\',\'\'])){2r(\'5Y\',2r(\'6d\'))}Y if(2r(\'1O\')===\'2j\'){2r(\'aj\',2r(\'6d\'))}7w=H.1C.V(1s,\'1j\',\'an\');L.31(\'7g\');if(2r(\'6e\')>0){if(94){L.4A.31(e)}L.31(e)}Y{7E=1t;L.31(\'2C\')}6m()});1s.2k(\'sD\',c(e){L.31(e);6m()});1s.2k(\'4q\',c(e){7E=1t;2r(\'35\',1j.3Z);L.31(\'7g\');8Z=1t;L.31(e);6m()});H.1C.V(1s,\'1j\',\'3R\',{2H:cs,4n:bH,5x:91,6x:cB,8N:cC,2E:8q,sq:8C,8i:cz,1O:L.1O,5W:L.5W,X:1G},J)}if(2J(1G.2V)===\'2x\'){1G.2V=1c.8H(1G.2V)}1G.2V=G.1k({},1G.2V,{4U:L.1O});if(J 3u 3i){1G.2V.6V=1t}if(!93){1G.2V.7K=1t}if(1G.1U){1C(1s.40(1G))}Y{1s.2k(\'7e\',c(e,H){1C(H)});1s.2k(\'2N\',c(e,5t){L.31(\'2N\',5t)});1s.40(1G)}}c 8m(){2r(\'5Y\',"");2r(\'aj\',Q);2r(\'6d\',Q);2r(\'6e\',0);2r(\'cu\',"");cw=fb=Q}}1j.bw=0;1j.9a=1;1j.so=2;1j.5C=3;1j.3Z=4;1j.2n=2q.3Q;l 1j});1v("F/H/2a",["F/O/1a/G","F/O/1a/1X","F/H/2U","F/O/2q"],c(G,1X,2U,2q){c 2a(){u cy,70,9f,6T,6R,9e;2U.V(f);G.1k(f,{M:G.2W(\'4k\'),4E:2a.a7,1N:Q,9n:c(J,K,X){u L=f;X=G.1k({9U:st},X);if((cy=X.9U%3)){X.9U+=3-cy}9e=X.9U;8m.V(f);9f=J;6T=J.T;if(G.1F(X)===\'2x\'||X.1U){cv.V(L,K,f.40(X))}Y{u cb=c(e,H){L.dd("7e",cb);cv.V(L,K,H)};f.2k("7e",cb);f.40(X)}},3z:c(){u L=f;L.4E=2a.a7;if(70){70.1C.V(L,\'2a\',\'sv\');L.1m("su")}8m.V(L)},1x:c(){f.6X();70=Q;f.5B();8m.V(f)}});c 8m(){6T=6R=0;9f=f.1N=Q}c cv(K,H){u L=f;70=H;L.2k("qo",c(e){6R=e.3X;if(6R<6T&&G.2t(L.4E,[2a.a7,2a.3Z])===-1){cA.V(L)}},6Z);L.2k("a6",c(){6R=6T;L.4E=2a.3Z;9f=Q;L.1N=70.1C.V(L,\'2a\',\'5H\',K||\'\')},6Z);L.4E=2a.fe;L.1m("oh");cA.V(L)}c cA(){u L=f,74,cD=6T-6R;if(9e>cD){9e=cD}74=1X.5Q(9f.7o(6R,9e));70.1C.V(L,\'2a\',\'of\',74,6T)}}2a.a7=0;2a.fe=1;2a.3Z=2;2a.2n=2q.3Q;l 2a});1v("F/1S/1K",["F/O/1a/G","F/O/1a/1l","F/O/36","F/1b/33","F/2g/1j","F/H/1c","F/H/2U","F/H/2a","F/O/1a/1e","F/O/2q","F/1b/1w","F/1b/1Y","F/O/1a/1X"],c(G,1l,x,33,1j,1c,2U,2a,1e,2q,1w,1Y,1X){u 4V=[\'5D\',\'4u\',\'2C\',\'oj\',\'d5\'];c 1K(){2U.V(f);G.1k(f,{M:G.2W(\'4k\'),1U:Q,R:"",1z:0,1g:0,1i:0,K:"",1D:{},8E:c(){f.4u.2v(f,1T)},4u:c(){f.2k(\'9S bi\',c(){fj.V(f)},6Z);f.6l(4V);8Y.2v(f,1T)},9k:c(1g,1i,49,5a){37{if(!f.1z){26 1d x.1E(x.1E.4p)}if(f.1g>1K.cY||f.1i>1K.cZ){26 1d x.2Z(x.2Z.ci)}if(!1g&&!1i||G.1F(49)===\'2A\'){49=1f}1g=1g||f.1g;1i=1i||f.1i;5a=(G.1F(5a)===\'2A\'?1t:!!5a);f.1L().1C.V(f,\'1K\',\'9k\',1g,1i,49,5a)}3k(ex){f.1m(\'2C\',ex)}},49:c(1g,1i,5a){f.9k(1g,1i,1t,5a)},bq:c(){if(!1e.1J(\'72\')){26 1d x.2N(x.2N.8s)}u H=f.40(f.1U);l H.1C.V(f,\'1K\',\'bq\')},5H:c(K,2R){if(!f.1z){26 1d x.1E(x.1E.4p)}if(!K){K=\'1S/4r\'}if(K===\'1S/4r\'&&!2R){2R=90}l f.1L().1C.V(f,\'1K\',\'5H\',K,2R)},4J:c(K,2R){if(!f.1z){26 1d x.1E(x.1E.4p)}l f.1L().1C.V(f,\'1K\',\'4J\',K,2R)},bC:c(K,2R){u 3O=f.4J(K,2R);l 1X.43(3O.8w(3O.4x(\'4c,\')+7))},om:c(el){u L=f,3P,K,2R,49,X=1T[1]||{},1g=f.1g,1i=f.1i,H;c fg(){if(1e.1J(\'72\')){u 34=3P.bq();if(34){el.6L(34);34=Q;3P.1x();L.1m(\'d5\');l}}u 3O=3P.4J(K,2R);if(!3O){26 1d x.2Z(x.2Z.7h)}if(1e.1J(\'fp\',3O.T)){el.6M=\'<29 2L="\'+3O+\'" 1g="\'+3P.1g+\'" 1i="\'+3P.1i+\'" />\';3P.1x();L.1m(\'d5\')}Y{u tr=1d 2a();tr.2k("a6",c(){H=L.40(f.1N.1U);L.2k("ol",c(){G.1k(H.4w().3a,{3r:\'a5\',6C:\'a5\',1g:3P.1g+\'px\',1i:3P.1i+\'px\'});H=Q},6Z);H.1C.V(L,"od","eH",f.1N.M,1g,1i);3P.1x()});tr.9n(1X.43(3O.8w(3O.4x(\'4c,\')+7)),K,G.1k({},X,{2V:{7x:1t},fm:\'2c,2Y\',1Z:el}))}}37{if(!(el=1l.1V(el))){26 1d x.1E(x.1E.fl)}if(!f.1z){26 1d x.1E(x.1E.4p)}if(f.1g>1K.cY||f.1i>1K.cZ){26 1d x.2Z(x.2Z.ci)}K=X.K||f.K||\'1S/4r\';2R=X.2R||90;49=G.1F(X.49)!==\'2A\'?X.49:1f;if(X.1g){1g=X.1g;1i=X.1i||1g}Y{u 9d=1l.9c(el);if(9d.w&&9d.h){1g=9d.w;1i=9d.h}}3P=1d 1K();3P.2k("bi",c(){fg.V(L)});3P.2k("9S",c(){3P.9k(1g,1i,49,1f)});3P.8E(f,1f);l 3P}3k(ex){f.1m(\'2C\',ex)}},1x:c(){if(f.1U){f.1L().1C.V(f,\'1K\',\'1x\');f.5B()}f.6X()}});c fj(3b){if(!3b){3b=f.1L().1C.V(f,\'1K\',\'9D\')}f.1z=3b.1z;f.1g=3b.1g;f.1i=3b.1i;f.K=3b.K;f.1D=3b.1D;if(f.R===\'\'){f.R=3b.R}}c 8Y(2L){u a2=G.1F(2L);37{if(2L 3u 1K){if(!2L.1z){26 1d x.1E(x.1E.4p)}f2.2v(f,1T)}Y if(2L 3u 1w){if(!~G.2t(2L.K,[\'1S/4r\',\'1S/8x\'])){26 1d x.2Z(x.2Z.7h)}cU.2v(f,1T)}Y if(G.2t(a2,[\'U\',\'1b\'])!==-1){8Y.V(f,1d 1Y(Q,2L),1T[1])}Y if(a2===\'2x\'){if(/^J:[^;]*;4c,/.3G(2L)){8Y.V(f,1d 1w(Q,{J:2L}),1T[1])}Y{eN.2v(f,1T)}}Y if(a2===\'3o\'&&2L.o7.3q()===\'29\'){8Y.V(f,2L.2L,1T[1])}Y{26 1d x.1E(x.1E.fk)}}3k(ex){f.1m(\'2C\',ex)}}c f2(29,8z){u H=f.40(29.1U);f.1U=H.M;H.1C.V(f,\'1K\',\'9T\',29,(G.1F(8z)===\'2A\'?1t:8z))}c cU(U,X){u L=f;L.R=U.R||\'\';c 1C(H){L.1U=H.M;H.1C.V(L,\'1K\',\'aT\',U)}if(U.50()){f.2k(\'7e\',c(e,H){1C(H)});if(X&&2J(X.2V)===\'2x\'){X.2V=1c.8H(X.2V)}f.40(G.1k({2V:{6I:1t,7U:1t}},X))}Y{1C(f.40(U.1U))}}c eN(2H,X){u L=f,2g;2g=1d 1j();2g.8M(\'1V\',2H);2g.1O=\'U\';2g.o9=c(e){L.1m(e)};2g.8B=c(){cU.V(L,2g.6d,1t)};2g.dg=c(e){L.1m(e)};2g.o8=c(){2g.1x()};2g.2k(\'2N\',c(e,5t){L.1m(\'2N\',5t)});2g.3R(Q,X)}}1K.cY=eG;1K.cZ=eG;1K.2n=2q.3Q;l 1K});1v("F/H/2i/1c",["F/O/1a/G","F/O/36","F/H/1c","F/O/1a/1e"],c(G,x,1c,1e){u K="2i",1h={};c f0(X){u I=f,3K=1c.dB,8b=1c.38;u 3t=G.1k({5d:3K(1A.1H||1A.1Y&&1A.1Y.4J),6I:c(){l I.1J(\'5d\')&&!!1h.1K},7x:3K(1e.1J(\'72\')||1e.1J(\'b6\')),7K:3K(1A.1j&&\'5W\'in 1d 1j()),82:3K(c(){u 6G=2j.4h(\'6G\');l((\'oq\'in 6G)||(\'or\'in 6G&&\'oI\'in 6G))&&(1e.1n!==\'46\'||1e.1R>9)}()),8W:3K(c(){l(1e.1n===\'7D\'&&1e.1R>=28)||(1e.1n===\'46\'&&1e.1R>=10)}()),7R:8b,4U:c(1O){if(1O===\'4m\'&&!!1A.5h){l 1t}l 1e.1J(\'4U\',1O)},77:8b,7P:3K(1A.1j&&1d 1j().4A),7U:c(){l I.1J(\'5d\')&&1e.1J(\'72\')},5M:c(){l 1e.1J(\'dT\')&&1A.1Y},cT:c(){l I.1J(\'5M\')&&1e.1n===\'7D\'&&1e.1R>=21},7z:c(){l I.1J(\'5M\')&&!(1e.1n===\'b5\'&&1e.os===\'dc\')&&!(1e.os===\'dV\'&&1e.eQ(1e.eX,"7.0.4",\'<\'))},6y:3K(1A.1j&&(1d 1j().bR||(1A.hq&&1A.oH))),6S:3K(1A.1j),6V:c(){l!!(1A.1j&&1d 1j().4A&&1A.3i)||I.1J(\'6y\')},7y:3K(1A.1Y&&(1Y.2n.eR||1Y.2n.eW||1Y.2n.3h)),7A:c(){l I.1J(\'7y\')&&I.1J(\'6V\')},5m:3K(c(){l(1e.1n===\'di\'&&1e.1R>=4)||(1e.1n===\'a3\'&&1e.1R>=12)||(1e.1n===\'46\'&&1e.1R>=10)||!!~G.2t(1e.1n,[\'7D\',\'b5\'])}()),7X:8b},1T[2]);1c.V(f,X,(1T[1]||K),3t);G.1k(f,{2h:c(){f.1m("dD")},1x:(c(1x){l c(){1x.V(I);1x=I=Q}}(f.1x))});G.1k(f.53(),1h)}1c.95(K,f0);l 1h});1v("F/H/2i/1b/1w",["F/H/2i/1c","F/1b/1w"],c(1h,1w){c eT(){c eS(U,2P,3S){u d3;if(1A.1Y.2n.3h){37{U.3h();l U.3h(2P,3S)}3k(e){l U.3h(2P,3S-2P)}}Y if((d3=1A.1Y.2n.eW||1A.1Y.2n.eR)){l d3.V(U,2P,3S)}Y{l Q}}f.3h=c(){l 1d 1w(f.1L().M,eS.2v(f,1T))}}l(1h.1w=eT)});1v(\'F/O/1a/1W\',[\'F/O/1a/G\'],c(G){u 4T={},M=\'oF\'+G.2W();c 4R(){f.oJ=1f}c 5f(){f.oK=1t}u 3g=c(1p,R,3J,2B){u 5k,85;R=R.3q();if(1p.4e){5k=3J;1p.4e(R,5k,1f)}Y if(1p.iK){5k=c(){u 4f=1A.oN;if(!4f.1q){4f.1q=4f.oM}4f.4R=4R;4f.5f=5f;3J(4f)};1p.iK(\'on\'+R,5k)}if(!1p[M]){1p[M]=G.2W()}if(!4T.6k(1p[M])){4T[1p[M]]={}}85=4T[1p[M]];if(!85.6k(R)){85[R]=[]}85[R].2G({5k:5k,d1:3J,2B:2B})};u 7Y=c(1p,R,3J){u K,4v;R=R.3q();if(1p[M]&&4T[1p[M]]&&4T[1p[M]][R]){K=4T[1p[M]][R]}Y{l}1B(u i=K.T-1;i>=0;i--){if(K[i].d1===3J||K[i].2B===3J){if(1p.aF){1p.aF(R,K[i].5k,1f)}Y if(1p.iO){1p.iO(\'on\'+R,K[i].5k)}K[i].d1=Q;K[i].5k=Q;K.ir(i,1);if(3J!==4v){2l}}}if(!K.T){4S 4T[1p[M]][R]}if(G.6o(4T[1p[M]])){4S 4T[1p[M]];37{4S 1p[M]}3k(e){1p[M]=4v}}};u 5i=c(1p,2B){if(!1p||!1p[M]){l}G.2f(4T[1p[M]],c(85,R){7Y(1p,R,2B)})};l{3g:3g,7Y:7Y,5i:5i}});1v("F/H/2i/1b/2F",["F/H/2i/1c","F/O/1a/G","F/O/1a/1l","F/O/1a/1W","F/O/1a/27","F/O/1a/1e"],c(1h,G,1l,1W,27,1e){c 2F(){u 3y=[],1G;G.1k(f,{2h:c(X){u 1o=f,I=1o.1L(),1P,1I,2O,2o,4C,3r;1G=X;3y=[];2O=1G.2u.2O||27.dI(1G.2u,I.1J(\'8W\'));1I=I.4w();1I.6M=\'<1P id="\'+I.M+\'" K="1b" 3a="ot-1z:ec;da:0;"\'+(1G.8a&&I.1J(\'7z\')?\'8a\':\'\')+(1G.aJ&&I.1J(\'cT\')?\'oy aJ\':\'\')+(2O?\' 2u="\'+2O.78(\',\')+\'"\':\'\')+\' />\';1P=1l.1V(I.M);G.1k(1P.3a,{4z:\'9g\',3r:0,6C:0,1g:\'48%\',1i:\'48%\'});2o=1l.1V(1G.6A);if(I.1J(\'5m\')){if(1l.5U(2o,\'4z\')===\'aA\'){2o.3a.4z=\'8T\'}4C=4O(1l.5U(2o,\'z-7r\'),10)||1;2o.3a.4C=4C;1I.3a.4C=4C-1;1W.3g(2o,\'8K\',c(e){u 1P=1l.1V(I.M);if(1P&&!1P.8V){1P.8K()}e.4R()},1o.M)}3r=I.1J(\'5m\')?2o:1I;1W.3g(3r,\'i1\',c(){1o.1m(\'bX\')},1o.M);1W.3g(3r,\'hj\',c(){1o.1m(\'ce\')},1o.M);1W.3g(3r,\'8P\',c(){1o.1m(\'8P\')},1o.M);1W.3g(1l.1V(1G.1Z),\'8O\',c(){1o.1m(\'8O\')},1o.M);1P.a8=c aa(){3y=[];if(1G.aJ){G.2f(f.3e,c(1b){if(1b.R!=="."){3y.2G(1b)}})}Y{3y=[].3h.V(f.3e)}if(1e.1n!==\'46\'){f.P=\'\'}Y{u 8E=f.oB(1t);f.5g.oA(8E,f);8E.a8=aa}1o.1m(\'8X\')};1o.1m({K:\'7l\',5x:1t});1I=Q},8S:c(){l 3y},aN:c(4E){u I=f.1L(),1P;if((1P=1l.1V(I.M))){1P.8V=!!4E}},1x:c(){u I=f.1L(),6D=I.53(),1I=I.4w();1W.5i(1I,f.M);1W.5i(1G&&1l.1V(1G.1Z),f.M);1W.5i(1G&&1l.1V(1G.6A),f.M);if(1I){1I.6M=\'\'}6D.8U(f.M);3y=1G=1I=6D=Q}})}l(1h.2F=2F)});1v("F/H/2i/1b/3F",["F/H/2i/1c","F/O/1a/G","F/O/1a/1l","F/O/1a/1W","F/O/1a/27"],c(1h,G,1l,1W,27){c 3F(){u 3y=[],8F=[],1G;G.1k(f,{2h:c(X){u 1o=f,57;1G=X;8F=ix(1G.2u);57=1G.1Z;1W.3g(57,\'gn\',c(e){e.4R();e.5f();e.8c.gl=\'go\'},1o.M);1W.3g(57,\'9F\',c(e){e.4R();e.5f();3y=[];if(e.8c.42&&e.8c.42[0].iB){is(e.8c.42,c(){1o.1m("9F")})}Y{G.2f(e.8c.3e,c(1b){if(aK(1b)){3y.2G(1b)}});1o.1m("9F")}},1o.M);1W.3g(57,\'9R\',c(e){e.4R();e.5f();1o.1m("9R")},1o.M);1W.3g(57,\'cK\',c(e){e.4R();e.5f();1o.1m("cK")},1o.M)},8S:c(){l 3y},1x:c(){1W.5i(1G&&1l.1V(1G.1Z),f.M);3y=8F=1G=Q}});c ix(2u){u 4i=[];1B(u i=0;i<2u.T;i++){[].2G.2v(4i,2u[i].1h.3x(/\\s*,\\s*/))}l G.2t(\'*\',4i)===-1?4i:[]}c aK(1b){u 44=27.cg(1b.R);l!44||!8F.T||G.2t(44,8F)!==-1}c is(42,cb){u 5K=[];G.2f(42,c(83){u 4Z=83.iB();if(4Z){if(4Z.ij){u 1b=83.nX();if(aK(1b)){3y.2G(1b)}}Y{5K.2G(4Z)}}});if(5K.T){cP(5K,cb)}Y{cb()}}c cP(5K,cb){u 3B=[];G.2f(5K,c(4Z){3B.2G(c(8r){ik(4Z,8r)})});G.8G(3B,c(){cb()})}c ik(4Z,cb){if(4Z.ij){4Z.1b(c(1b){if(aK(1b)){3y.2G(1b)}cb()},c(){cb()})}Y if(4Z.np){iq(4Z,cb)}Y{cb()}}c iq(iH,cb){u 5K=[],iL=iH.nu();c cQ(8r){iL.nv(c(cN){if(cN.T){[].2G.2v(5K,cN);cQ(8r)}Y{8r()}},8r)}cQ(c(){cP(5K,cb)})}}l(1h.3F=3F)});1v("F/H/2i/1b/1H",["F/H/2i/1c","F/O/1a/1X","F/O/1a/G"],c(1h,1X,G){c 1H(){u 2e,aO=1f;G.1k(f,{2w:c(op,U){u 1q=f;2e=1d 1A.1H();2e.4e(\'5D\',c(e){1q.1m(e)});2e.4e(\'4u\',c(e){1q.1m(e)});2e.4e(\'2C\',c(e){1q.1m(e,2e.2C)});2e.4e(\'8k\',c(){2e=Q});if(G.1F(2e[op])===\'c\'){aO=1f;2e[op](U.3H())}Y if(op===\'5b\'){aO=1t;2e.4l(U.3H())}},84:c(){l 2e&&2e.1N?(aO?7t(2e.1N):2e.1N):Q},3z:c(){if(2e){2e.3z()}},1x:c(){2e=Q}});c 7t(1Q){l 1X.43(1Q.8w(1Q.4x(\'4c,\')+7))}}l(1h.1H=1H)});1v("F/H/2i/2g/1j",["F/H/2i/1c","F/O/1a/G","F/O/1a/27","F/O/1a/4j","F/1b/1Y","F/1b/1w","F/2g/3i","F/O/36","F/O/1a/1e"],c(1h,G,27,4j,1Y,1w,3i,x,1e){c 1j(){u L=f,1s,7O;G.1k(f,{3R:c(1D,J){u 1q=f,hx=(1e.1n===\'nn\'&&1e.1R>=4&&1e.1R<7),hy=1e.1n===\'ht hr\',ao=1f;7O=1D.2H.3p(/^.+?\\/([\\w\\-\\.]+)$/,\'$1\').3q();1s=hg();1s.8M(1D.4n,1D.2H,1D.5x,1D.6x,1D.8N);if(J 3u 1w){if(J.50()){ao=1t}J=J.3H()}Y if(J 3u 3i){if(J.8u()){if(J.6F().50()){J=hi.V(1q,J);ao=1t}Y if((hx||hy)&&G.1F(J.6F().3H())===\'U\'&&1A.1H){hp.V(1q,1D,J);l}}if(J 3u 3i){u fd=1d 1A.3i();J.2f(c(P,R){if(P 3u 1w){fd.6q(R,P.3H())}Y{fd.6q(R,P)}});J=fd}}if(1s.4A){if(1D.5W){1s.5W=1t}1s.4e(\'4u\',c(e){1q.1m(e)});1s.4e(\'2C\',c(e){1q.1m(e)});1s.4e(\'5D\',c(e){1q.1m(e)});1s.4A.4e(\'5D\',c(e){1q.1m({K:\'hC\',3X:e.3X,3Y:e.3Y})})}Y{1s.hA=c nd(){4N(1s.35){1y 1:2l;1y 2:2l;1y 3:u 3Y,3X;37{if(4j.8g(1D.2H)){3Y=1s.ak(\'5z-hB\')||0}if(1s.5Y){3X=1s.5Y.T}}3k(ex){3Y=3X=0}1q.1m({K:\'5D\',hz:!!3Y,3Y:4O(3Y,10),3X:3X});2l;1y 4:1s.hA=c(){};if(1s.6e===0){1q.1m(\'2C\')}Y{1q.1m(\'4u\')}2l}}}if(!G.6o(1D.2E)){G.2f(1D.2E,c(P,2S){1s.9X(2S,P)})}if(""!==1D.1O&&\'1O\'in 1s){if(\'4m\'===1D.1O&&!1e.1J(\'4U\',\'4m\')){1s.1O=\'4b\'}Y{1s.1O=1D.1O}}if(!ao){1s.3R(J)}Y{if(1s.bR){1s.bR(J)}Y{(c(){u bN=1d hq(J.T);1B(u i=0;i<J.T;i++){bN[i]=(J.8R(i)&ap)}1s.3R(bN.nl)}())}}1q.1m(\'9E\')},cn:c(){37{if(1s){l 1s.6e}}3k(ex){}l 0},b2:c(1O){u I=f.1L();37{4N(1O){1y\'U\':u 1b=1d 1Y(I.M,1s.6d);u cf=1s.ak(\'5z-cd\');if(cf){u 3f=cf.3f(/hn=([\\\'\\"\'])([^\\1]+)\\1/);if(3f){7O=3f[2]}}1b.R=7O;if(!1b.K){1b.K=27.by(7O)}l 1b;1y\'4m\':if(!1e.1J(\'4U\',\'4m\')){l 1s.6e===6K&&!!1A.5h?5h.cj(1s.5Y):Q}l 1s.6d;1y\'2j\':l hd(1s);9r:l 1s.5Y!==\'\'?1s.5Y:Q}}3k(ex){l Q}},an:c(){37{l 1s.an()}3k(ex){}l\'\'},3z:c(){if(1s){1s.3z()}},1x:c(){L=7O=Q}});c hp(1D,J){u 1q=f,U,fr;U=J.6F().3H();fr=1d 1A.1H();fr.8B=c(){J.6q(J.hf(),1d 1w(Q,{K:U.K,J:fr.1N}));L.3R.V(1q,1D,J)};fr.5b(U)}c hg(){if(1A.1j&&!(1e.1n===\'46\'&&1e.1R<8)){l 1d 1A.1j()}Y{l(c(){u c7=[\'nR.he.6.0\',\'dG.he\'];1B(u i=0;i<c7.T;i++){37{l 1d aH(c7[i])}3k(ex){}}})()}}c hd(2g){u 4F=2g.aj;u c9=2g.5Y;if(1e.1n===\'46\'&&c9&&4F&&!4F.al&&/[^\\/]+\\/[^\\+]+\\+hc/.3G(2g.ak("5z-ay"))){4F=1d 1A.aH("dG.nS");4F.5x=1f;4F.nT=1f;4F.nW(c9)}if(4F){if((1e.1n===\'46\'&&4F.nU!==0)||!4F.al||4F.al.nM==="nF"){l Q}}l 4F}c hi(fd){u 7H=\'----nD\'+1d ar().ca(),8Q=\'--\',58=\'\\r\\n\',5u=\'\',I=f.1L();if(!I.1J(\'6y\')){26 1d x.2N(x.2N.8s)}1s.9X(\'5z-ay\',\'5u/1M-J; 7H=\'+7H);fd.2f(c(P,R){if(P 3u 1w){5u+=8Q+7H+58+\'5z-cd: 1M-J; R="\'+R+\'"; hn="\'+cc(c4(P.R||\'U\'))+\'"\'+58+\'5z-ay: \'+(P.K||\'2Q/az-ax\')+58+58+P.3H()+58}Y{5u+=8Q+7H+58+\'5z-cd: 1M-J; R="\'+R+\'"\'+58+58+cc(c4(P))+58}});5u+=8Q+7H+8Q+58;l 5u}}l(1h.1j=1j)});1v("F/H/2i/1a/4s",[],c(){l c(){u 6j=1f,56;c 2w(1r,1z){u mv=6j?0:-8*(1z-1),bW=0,i;1B(i=0;i<1z;i++){bW|=(56.8R(1r+i)<<39.hk(mv+i*8))}l bW}c bT(3T,1r,T){T=1T.T===3?T:56.T-1r-1;56=56.7o(0,1r)+3T+56.7o(T+1r)}c hG(1r,4M,1z){u 1Q=\'\',mv=6j?0:-8*(1z-1),i;1B(i=0;i<1z;i++){1Q+=5T.6P((4M>>39.hk(mv+i*8))&dX)}bT(1Q,1r,1z)}l{6j:c(7M){if(7M===2A){l 6j}Y{6j=7M}},2h:c(hF){6j=1f;56=hF},6Y:c(1r,T,3T){4N(1T.T){1y 1:l 56.7o(1r,56.T-1r-1);1y 2:l 56.7o(1r,T);1y 3:bT(3T,1r,T);2l;9r:l 56}},eL:c(1r){l 2w(1r,1)},3d:c(1r){l 2w(1r,2)},3s:c(1r,4M){if(4M===2A){l 2w(1r,4)}Y{hG(1r,4M,4)}},aG:c(1r){u 4M=2w(1r,4);l(4M>pW?4M-q0:4M)},b3:c(1r,1z){u 1Q=\'\';1B(1z+=1r;1r<1z;1r++){1Q+=5T.6P(2w(1r,1))}l 1Q}}}});1v("F/H/2i/1S/8j",["F/H/2i/1a/4s"],c(4s){l c 8j(J){u 2E=[],2w,1r,47,T=0;2w=1d 4s();2w.2h(J);if(2w.3d(0)!==f8){l}1r=2;3M(1r<=J.T){47=2w.3d(1r);if(47>=pZ&&47<=pY){1r+=2;8I}if(47===pX||47===pQ){2l}T=2w.3d(1r+2)+2;if(47>=ha&&47<=pP){2E.2G({a1:47,R:\'pI\'+(47&ib),2P:1r,T:T,3T:2w.6Y(1r,T)})}1r+=T}2w.2h(Q);l{2E:2E,dq:c(J){u 4L,i;2w.2h(J);1r=2w.3d(2)==pH?4+2w.3d(4):2;1B(i=0,4L=2E.T;i<4L;i++){2w.6Y(1r,0,2E[i].3T);1r+=2E[i].T}J=2w.6Y();2w.2h(Q);l J},f9:c(J){u 2E,at,i;at=1d 8j(J);2E=at.2E;at.4Q();2w.2h(J);i=2E.T;3M(i--){2w.6Y(2E[i].2P,2E[i].T,\'\')}J=2w.6Y();2w.2h(Q);l J},1V:c(R){u 2D=[];1B(u i=0,4L=2E.T;i<4L;i++){if(2E[i].R===R.9b()){2D.2G(2E[i].3T)}}l 2D},bv:c(R,3T){u 2D=[],i,ii,4L;if(2J(3T)===\'2x\'){2D.2G(3T)}Y{2D=3T}1B(i=ii=0,4L=2E.T;i<4L;i++){if(2E[i].R===R.9b()){2E[i].3T=2D[ii];2E[i].T=2D[ii].T;ii++}if(ii>=2D.T){2l}}},4Q:c(){2E=[];2w.2h(Q);2w=Q}}}});1v("F/H/2i/1S/99",["F/O/1a/G","F/H/2i/1a/4s"],c(G,4s){l c 99(){u J,8n,5s,3c={},aS;J=1d 4s();8n={6H:{pF:\'fD\',pJ:\'pK\',pO:\'pN\',pM:\'pL\',q1:\'q2\',qi:\'a0\',qh:\'9Q\'},8l:{qg:\'8d\',qf:\'i5\',qj:\'d7\',qk:\'d8\',qn:\'qm\',ql:\'qe\',qd:\'q6\',q5:\'q4\',q3:\'q7\',q8:\'qc\',qb:\'i6\',qa:\'hV\',q9:\'2X\',pE:\'pD\',p5:\'hE\',p4:\'hs\',p3:\'hv\',p2:\'p6\',p7:\'ia\',pb:\'iI\',pa:\'iJ\'},9W:{hl:\'9i\',hm:\'iy\',p9:\'p8\',p1:\'it\',p0:\'oT\'}};aS={\'i5\':{1:\'oS\',0:\'oR\'},\'i6\':{0:\'oQ\',1:\'oU\',2:\'oV\',3:\'oZ\',4:\'oY\',5:\'oX\',6:\'hW\',dX:\'e0\'},\'hV\':{1:\'hH\',2:\'oW\',3:\'pc\',4:\'2X\',9:\'pd hK\',10:\'pv hK\',11:\'pu\',12:\'hH au (D pt - pr)\',13:\'pz aL au (N pC -pB)\',14:\'pA aL au (W pq - pp)\',15:\'ph au (pg pf - pe)\',17:\'aP 3W A\',18:\'aP 3W B\',19:\'aP 3W C\',20:\'qu\',21:\'pk\',22:\'pn\',23:\'pG\',24:\'pR pS pT\',dX:\'e0\'},\'2X\':{hl:\'2X dM 5n dY.\',hm:\'2X 3N.\',oP:\'ho l 3W 5n 4P.\',oO:\'ho l 3W 4P.\',nI:\'2X 3N, 7s 2c 1u\',nJ:\'2X 3N, 7s 2c 1u, l 3W 5n 4P\',ib:\'2X 3N, 7s 2c 1u, l 3W 4P\',nK:\'2X dM 5n dY, 7s 2c 1u\',nH:\'2X dM 5n dY, 7p 1u\',nE:\'2X 3N, 7p 1u\',nN:\'2X 3N, 7p 1u, l 3W 5n 4P\',nV:\'2X 3N, 7p 1u, l 3W 4P\',nO:\'hb 2c c\',nP:\'2X 3N, 5O-5V 5L 1u\',nQ:\'2X 3N, 5O-5V 5L 1u, l 3W 5n 4P\',nB:\'2X 3N, 5O-5V 5L 1u, l 3W 4P\',nA:\'2X 3N, 7s 2c 1u, 5O-5V 5L 1u\',ni:\'2X 3N, 7s 2c 1u, 5O-5V 5L 1u, l 3W 5n 4P\',nj:\'2X 3N, 7s 2c 1u, 5O-5V 5L 1u, l 3W 4P\',nk:\'2X 3N, 7p 1u, 5O-5V 5L 1u\',nh:\'2X 3N, 7p 1u, l 3W 5n 4P, 5O-5V 5L 1u\',nb:\'2X 3N, 7p 1u, l 3W 4P, 5O-5V 5L 1u\'},\'hE\':{0:\'dr hD\',1:\'hu hD\',2:\'dr nf\'},\'hs\':{0:\'dr aL hw\',1:\'hu aL hw\'},\'hv\':{0:\'aP\',1:\'nw\',2:\'nx\',3:\'ny nz\'},\'ia\':{0:\'dZ\',1:\'ic\',2:\'iA\'},\'iI\':{0:\'dZ\',1:\'nr iN\',2:\'nY iN\'},\'iJ\':{0:\'dZ\',1:\'ic\',2:\'iA\'},\'iy\':{N:\'ox im\',S:\'ov im\'},\'it\':{E:\'oL eF\',W:\'oG eF\'}};c ag(dN,eK){u T=J.3d(dN),i,ii,2I,K,3A,7Z,2m,P,5q=[],8J={};1B(i=0;i<T;i++){2m=7Z=dN+12*i+2;2I=eK[J.3d(2m)];if(2I===2A){8I}K=J.3d(2m+=2);3A=J.3s(2m+=2);2m+=4;5q=[];4N(K){1y 1:1y 7:if(3A>4){2m=J.3s(2m)+3c.4B}1B(ii=0;ii<3A;ii++){5q[ii]=J.eL(2m+ii)}2l;1y 2:if(3A>4){2m=J.3s(2m)+3c.4B}8J[2I]=J.b3(2m,3A-1);8I;1y 3:if(3A>2){2m=J.3s(2m)+3c.4B}1B(ii=0;ii<3A;ii++){5q[ii]=J.3d(2m+ii*2)}2l;1y 4:if(3A>1){2m=J.3s(2m)+3c.4B}1B(ii=0;ii<3A;ii++){5q[ii]=J.3s(2m+ii*4)}2l;1y 5:2m=J.3s(2m)+3c.4B;1B(ii=0;ii<3A;ii++){5q[ii]=J.3s(2m+ii*4)/J.3s(2m+ii*4+4)}2l;1y 9:2m=J.3s(2m)+3c.4B;1B(ii=0;ii<3A;ii++){5q[ii]=J.aG(2m+ii*4)}2l;1y 10:2m=J.3s(2m)+3c.4B;1B(ii=0;ii<3A;ii++){5q[ii]=J.aG(2m+ii*4)/J.aG(2m+ii*4+4)}2l;9r:8I}P=(3A==1?5q[0]:5q);if(aS.6k(2I)&&2J P!=\'4y\'){8J[2I]=aS[2I][P]}Y{8J[2I]=P}}l 8J}c eE(){u 1r=3c.4B;J.6j(J.3d(1r)==ob);if(J.3d(1r+=2)!==nZ){l 1f}3c.fh=3c.4B+J.3s(1r+=2);5s=ag(3c.fh,8n.6H);if(\'a0\'in 5s){3c.f4=3c.4B+5s.a0;4S 5s.a0}if(\'9Q\'in 5s){3c.f3=3c.4B+5s.9Q;4S 5s.9Q}l 1t}c f7(dm,2I,P){u 2m,T,7Z,af=0;if(2J(2I)===\'2x\'){u dk=8n[dm.3q()];1B(u a1 in dk){if(dk[a1]===2I){2I=a1;2l}}}2m=3c[dm.3q()+\'oc\'];T=J.3d(2m);1B(u i=0;i<T;i++){7Z=2m+12*i+2;if(J.3d(7Z)==2I){af=7Z+8;2l}}if(!af){l 1f}J.3s(af,P);l 1t}l{2h:c(3T){3c={4B:10};if(3T===2A||!3T.T){l 1f}J.2h(3T);if(J.3d(0)===ha&&J.b3(4,5).9b()==="dv\\0"){l eE()}l 1f},ft:c(){l 5s},dv:c(){u 6i;6i=ag(3c.f4,8n.8l);if(6i.8d&&G.1F(6i.8d)===\'2D\'){1B(u i=0,dH=\'\';i<6i.8d.T;i++){dH+=5T.6P(6i.8d[i])}6i.8d=dH}l 6i},5R:c(){u 5R;5R=ag(3c.f3,8n.9W);if(5R.9i&&G.1F(5R.9i)===\'2D\'){5R.9i=5R.9i.78(\'.\')}l 5R},87:c(2I,P){if(2I!==\'d7\'&&2I!==\'d8\'){l 1f}l f7(\'8l\',2I,P)},fa:c(){l J.6Y()},4Q:c(){J.2h(Q);J=5s=Q;3c={}}}}});1v("F/H/2i/1S/7S",["F/O/1a/G","F/O/36","F/H/2i/1S/8j","F/H/2i/1a/4s","F/H/2i/1S/99"],c(G,x,8j,4s,99){c 7S(5I){u 4t,30,4K,45,4I,bn;c bD(){u 1r=0,47,T;3M(1r<=4t.T){47=30.3d(1r+=2);if(47>=sz&&47<=sA){1r+=5;l{1i:30.3d(1r),1g:30.3d(1r+=2)}}T=30.3d(1r+=2);1r+=T-2}l Q}4t=5I;30=1d 4s();30.2h(4t);if(30.3d(0)!==f8){26 1d x.2Z(x.2Z.7h)}4K=1d 8j(5I);45=1d 99();bn=!!45.2h(4K.1V(\'fc\')[0]);4I=bD.V(f);G.1k(f,{K:\'1S/4r\',1z:4t.T,1g:4I&&4I.1g||0,1i:4I&&4I.1i||0,87:c(2I,P){if(!bn){l 1f}if(G.1F(2I)===\'4y\'){G.2f(2I,c(P,2I){45.87(2I,P)})}Y{45.87(2I,P)}4K.bv(\'fc\',45.fa())},dl:c(){if(!1T.T){l(4t=4K.dq(4t))}l 4K.dq(1T[0])},d6:c(5I){l 4K.f9(5I)},4Q:c(){6c.V(f)}});if(bn){f.1D={6H:45.ft(),8l:45.dv(),9W:45.5R()}}c 6c(){if(!45||!4K||!30){l}45.4Q();4K.4Q();30.2h(Q);4t=4I=4K=45=30=Q}}l 7S});1v("F/H/2i/1S/7T",["F/O/36","F/O/1a/G","F/H/2i/1a/4s"],c(x,G,4s){c 7T(5I){u 4t,30,4K,45,4I;4t=5I;30=1d 4s();30.2h(4t);(c(){u 1r=0,i=0,bA=[sB,sC,sJ,sK];1B(i=0;i<bA.T;i++,1r+=2){if(bA[i]!=30.3d(1r)){26 1d x.2Z(x.2Z.7h)}}}());c bD(){u 74,1r;74=e6.V(f,8);if(74.K==\'sI\'){1r=74.2P;l{1g:30.3s(1r),1i:30.3s(1r+=4)}}l Q}c 6c(){if(!30){l}30.2h(Q);4t=4I=4K=45=30=Q}4I=bD.V(f);G.1k(f,{K:\'1S/8x\',1z:4t.T,1g:4I.1g,1i:4I.1i,4Q:c(){6c.V(f)}});6c.V(f);c e6(1r){u T,K,2P,b0;T=30.3s(1r);K=30.b3(1r+=4,4);2P=1r+=4;b0=30.3s(1r+T);l{T:T,K:K,2P:2P,b0:b0}}}l 7T});1v("F/H/2i/1S/aY",["F/O/1a/G","F/O/36","F/H/2i/1S/7S","F/H/2i/1S/7T"],c(G,x,7S,7T){l c(5I){u dE=[7S,7T],4d;4d=(c(){1B(u i=0;i<dE.T;i++){37{l 1d dE[i](5I)}3k(ex){}}26 1d x.2Z(x.2Z.7h)}());G.1k(f,{K:\'\',1z:0,1g:0,1i:0,87:c(){},dl:c(J){l J},d6:c(J){l J},4Q:c(){}});G.1k(f,4d);f.4Q=c(){4d.4Q();4d=Q}}});1v("F/H/2i/1S/bf",[],c(){c fO(29,34,X){u iw=29.ed,ih=29.eb;u 1g=X.1g,1i=X.1i;u x=X.x||0,y=X.y||0;u 2K=34.6g(\'2d\');if(db(29)){iw/=2;ih/=2}u d=bd;u 7J=2j.4h(\'34\');7J.1g=7J.1i=d;u bc=7J.6g(\'2d\');u de=e7(29,iw,ih);u sy=0;3M(sy<ih){u sh=sy+d>ih?ih-sy:d;u sx=0;3M(sx<iw){u sw=sx+d>iw?iw-sx:d;bc.s4(0,0,d,d);bc.9H(29,-sx,-sy);u dx=(sx*1g/iw+x)<<0;u dw=39.eA(sw*1g/iw);u dy=(sy*1i/ih/de+y)<<0;u dh=39.eA(sh*1i/ih/de);2K.9H(7J,0,0,sw,sh,dx,dy,dw,dh);sx+=d}sy+=d}7J=bc=Q}c db(29){u iw=29.ed,ih=29.eb;if(iw*ih>bd*bd){u 34=2j.4h(\'34\');34.1g=34.1i=1;u 2K=34.6g(\'2d\');2K.9H(29,-iw+1,0);l 2K.gy(0,0,1,1).J[3]===0}Y{l 1f}}c e7(29,iw,ih){u 34=2j.4h(\'34\');34.1g=1;34.1i=ih;u 2K=34.6g(\'2d\');2K.9H(29,0,0);u J=2K.gy(0,0,1,ih).J;u sy=0;u ey=ih;u py=ih;3M(py>sy){u dK=J[(py-1)*4+3];if(dK===0){ey=py}Y{sy=py}py=(ey+sy)>>1}34=Q;u dF=(py/ih);l(dF===0)?1:dF}l{rz:db,g6:fO}});1v("F/H/2i/1S/1K",["F/H/2i/1c","F/O/1a/G","F/O/36","F/O/1a/1X","F/1b/1Y","F/H/2i/1S/aY","F/H/2i/1S/bf","F/O/1a/27","F/O/1a/1e"],c(1h,G,x,1X,1Y,aY,bf,27,1e){c fV(){u me=f,4d,3V,2z,3l,3m,7L=1f,aX=1t;G.1k(f,{aT:c(U){u 1o=f,I=1o.1L(),fH=1T.T>1?1T[1]:1t;if(!I.1J(\'5d\')){26 1d x.2N(x.2N.8s)}3m=U;if(U.50()){3l=U.3H();b1.V(f,3l);l}Y{fA.V(f,U.3H(),c(3O){if(fH){3l=7t(3O)}b1.V(1o,3O)})}},9T:c(29,8z){f.1D=29.1D;3m=1d 1Y(Q,{R:29.R,1z:29.1z,K:29.K});b1.V(f,8z?(3l=29.bC()):29.4J())},9D:c(){u I=f.1L(),3b;if(!3V&&3l&&I.1J(\'6I\')){3V=1d aY(3l)}3b={1g:bm().1g||0,1i:bm().1i||0,K:3m.K||27.by(3m.R),1z:3l&&3l.T||3m.1z||0,R:3m.R||\'\',1D:3V&&3V.1D||f.1D||{}};l 3b},9k:c(){dU.2v(f,1T)},bq:c(){if(2z){2z.id=f.M+\'2z\'}l 2z},5H:c(K,2R){if(K!==f.K){dU.V(f,f.1g,f.1i,1f)}l 1d 1Y(Q,{R:3m.R||\'\',K:K,J:me.bC.V(f,K,2R)})},4J:c(K){u 2R=1T[1]||90;if(!7L){l 4d.2L}if(\'1S/4r\'!==K){l 2z.8v(\'1S/8x\')}Y{37{l 2z.8v(\'1S/4r\',2R/48)}3k(ex){l 2z.8v(\'1S/4r\')}}},bC:c(K,2R){if(!7L){if(!3l){3l=7t(me.4J(K,2R))}l 3l}if(\'1S/4r\'!==K){3l=7t(me.4J(K,2R))}Y{u 3O;if(!2R){2R=90}37{3O=2z.8v(\'1S/4r\',2R/48)}3k(ex){3O=2z.8v(\'1S/4r\')}3l=7t(3O);if(3V){3l=3V.d6(3l);if(aX){if(3V.1D&&3V.1D.8l){3V.87({d7:f.1g,d8:f.1i})}3l=3V.dl(3l)}3V.4Q();3V=Q}}7L=1f;l 3l},1x:c(){me=Q;6c.V(f);f.1L().53().8U(f.M)}});c bm(){if(!2z&&!4d){26 1d x.2Z(x.1E.4p)}l 2z||4d}c 7t(1Q){l 1X.43(1Q.8w(1Q.4x(\'4c,\')+7))}c fx(1Q,K){l\'J:\'+(K||\'\')+\';4c,\'+1X.5Q(1Q)}c b1(1Q){u 1o=f;4d=1d 1K();4d.dg=c(){6c.V(f);1o.1m(\'2C\',1d x.2Z(x.2Z.7h))};4d.8B=c(){1o.1m(\'4u\')};4d.2L=/^J:[^;]*;4c,/.3G(1Q)?1Q:fx(1Q,3m.K)}c fA(1b,3J){u 1o=f,fr;if(1A.1H){fr=1d 1H();fr.8B=c(){3J(f.1N)};fr.dg=c(){1o.1m(\'2C\',1d x.6h(x.6h.fB))};fr.4l(1b)}Y{l 3J(1b.4J())}}c dU(1g,1i,49,5a){u L=f,60,e4,x=0,y=0,29,8p,8e,6O;aX=5a;6O=(f.1D&&f.1D.6H&&f.1D.6H.fD)||1;if(G.2t(6O,[5,6,7,8])!==-1){u fC=1g;1g=1i;1i=fC}29=bm();e4=!49?39.ds:39.4L;60=e4(1g/29.1g,1i/29.1i);if(60>1&&(!49||5a)){f.1m(\'bi\');l}if(!2z){2z=2j.4h("34")}8p=39.aU(29.1g*60);8e=39.aU(29.1i*60);if(49){2z.1g=1g;2z.1i=1i;if(8p>1g){x=39.aU((8p-1g)/2)}if(8e>1i){y=39.aU((8e-1i)/2)}}Y{2z.1g=8p;2z.1i=8e}if(!aX){gd(2z.1g,2z.1i,6O)}g8.V(f,29,2z,-x,-y,8p,8e);f.1g=2z.1g;f.1i=2z.1i;7L=1t;L.1m(\'bi\')}c g8(29,34,x,y,w,h){if(1e.9K===\'dV\'){bf.g6(29,34,{1g:w,1i:h,x:x,y:y})}Y{u 2K=34.6g(\'2d\');2K.9H(29,x,y,w,h)}}c gd(1g,1i,6O){4N(6O){1y 5:1y 6:1y 7:1y 8:2z.1g=1i;2z.1i=1g;2l;9r:2z.1g=1g;2z.1i=1i}u 2K=2z.6g(\'2d\');4N(6O){1y 2:2K.54(1g,0);2K.60(-1,1);2l;1y 3:2K.54(1g,1i);2K.9p(39.9l);2l;1y 4:2K.54(0,1i);2K.60(1,-1);2l;1y 5:2K.9p(0.5*39.9l);2K.60(1,-1);2l;1y 6:2K.9p(0.5*39.9l);2K.54(0,-1i);2l;1y 7:2K.9p(0.5*39.9l);2K.54(1g,-1i);2K.60(-1,1);2l;1y 8:2K.9p(-0.5*39.9l);2K.54(-1g,0);2l}}c 6c(){if(3V){3V.4Q();3V=Q}3l=4d=2z=3m=Q;7L=1f}}l(1h.1K=fV)});1v("F/H/2c/1c",["F/O/1a/G","F/O/1a/1e","F/O/1a/1l","F/O/36","F/H/1c"],c(G,1e,1l,x,1c){u K=\'2c\',1h={};c g0(){u 1R;37{1R=89.gC[\'rq 2X\'];1R=1R.eC}3k(e1){37{1R=1d aH(\'g3.g3\').rs(\'$1R\')}3k(e2){1R=\'0.0\'}}1R=1R.3f(/\\d+/g);l dz(1R[0]+\'.\'+1R[1])}c gN(X){u I=f,6z;X=G.1k({9o:1e.9o},X);1c.V(f,X,K,{5d:c(P){l P&&I.1u===\'1n\'},6I:c(P){l P&&I.1u===\'1n\'},7x:1c.38,7K:1c.38,82:1f,7P:c(){l I.1u===\'2T\'},7U:1c.38,7R:1f,4U:c(1O){if(1O===\'4m\'&&!!1A.5h){l 1t}l!G.4a(1O,[\'\',\'4b\',\'2j\'])||I.1u===\'1n\'},77:c(2b){l I.1u===\'1n\'||!G.4a(2b,[6K,7a])},5M:1c.38,7z:1c.38,6y:c(P){l P&&I.1u===\'1n\'},7Q:c(P){l P&&I.1u===\'1n\'},6S:c(P){l P&&I.1u===\'1n\'},6V:1c.38,7y:1c.38,7A:c(P){l P&&I.1u===\'1n\'},5m:1f,7X:c(1z){l G.9z(1z)<=g1||I.1u===\'2T\'},8t:c(6E){l!G.4a(6E,[\'96\',\'98\'])}},{5d:c(P){l P?\'1n\':\'2T\'},6I:c(P){l P?\'1n\':\'2T\'},7P:c(P){l P?\'1n\':\'2T\'},4U:c(1O){l G.4a(1O,[\'\',\'4b\',\'4m\',\'2j\'])?\'1n\':[\'2T\',\'1n\']},77:c(2b){l G.4a(2b,[6K,7a])?\'1n\':[\'2T\',\'1n\']},6y:c(P){l P?\'1n\':\'2T\'},7Q:c(P){l P?\'1n\':\'2T\'},6S:c(P){l P?\'1n\':\'2T\'},7A:c(P){l P?\'2T\':\'1n\'},7X:c(1z){l G.9z(1z)>=g1?\'2T\':\'1n\'}},\'2T\');if(g0()<10){f.1u=1f}G.1k(f,{53:c(){l 1l.1V(f.M)},3j:c(5c,5r){u 2y=[].3h.V(1T,2);l I.53().1C(f.M,5c,5r,2y)},2h:c(){u 6f,el,1Z;1Z=f.4w();G.1k(1Z.3a,{4z:\'9g\',3r:\'-fZ\',6C:\'-fZ\',1g:\'fU\',1i:\'fU\',dC:\'5F\'});6f=\'<4y id="\'+f.M+\'" K="2Q/x-g5-2c" J="\'+X.9o+\'" \';if(1e.1n===\'46\'){6f+=\'jO="jT:jX-kF-kL-jL-kw" \'}6f+=\'1g="48%" 1i="48%" 3a="i3:0">\'+\'<5N R="ku" P="\'+X.9o+\'" />\'+\'<5N R="kt" P="M=\'+fI(f.M)+\'&1q=\'+1e.dQ+\'" />\'+\'<5N R="kN" P="j4" />\'+\'<5N R="j2" P="jc" />\'+\'</4y>\';if(1e.1n===\'46\'){el=2j.4h(\'6G\');1Z.6L(el);el.j1=6f;el=1Z=Q}Y{1Z.6M=6f}6z=81(c(){if(I&&!I.aq){I.1m("4q",1d x.2N(x.2N.9N))}},hY)},1x:(c(1x){l c(){1x.V(I);hh(6z);X=6z=1x=I=Q}}(f.1x))},1h)}1c.95(K,gN);l 1h});1v("F/H/2c/1b/1w",["F/H/2c/1c","F/1b/1w"],c(1h,1w){u gJ={3h:c(U,2P,3S,K){u L=f.1L();if(2P<0){2P=39.4L(U.1z+2P,0)}Y if(2P>0){2P=39.ds(2P,U.1z)}if(3S<0){3S=39.4L(U.1z+3S,0)}Y if(3S>0){3S=39.ds(3S,U.1z)}U=L.3j.V(f,\'1w\',\'3h\',2P,3S,K||\'\');if(U){U=1d 1w(L.M,U)}l U}};l(1h.1w=gJ)});1v("F/H/2c/1b/2F",["F/H/2c/1c"],c(1h){u 2F={2h:c(X){f.1L().3j.V(f,\'2F\',\'2h\',{R:X.R,2u:X.2u,8a:X.8a});f.1m(\'7l\')}};l(1h.2F=2F)});1v("F/H/2c/1b/1H",["F/H/2c/1c","F/O/1a/1X"],c(1h,1X){u 9M=\'\';c 9V(J,op){4N(op){1y\'5e\':l 1X.43(J,\'7d\');1y\'5b\':l 1X.43(J);1y\'4l\':l J}l Q}u 1H={2w:c(op,U){u 1q=f,L=1q.1L();if(op===\'4l\'){9M=\'J:\'+(U.K||\'\')+\';4c,\'}1q.2k(\'dt\',c(e,J){if(J){9M+=9V(J,op)}});l L.3j.V(f,\'1H\',\'h5\',U.M)},84:c(){l 9M},1x:c(){9M=Q}};l(1h.1H=1H)});1v("F/H/2c/1b/33",["F/H/2c/1c","F/O/1a/1X"],c(1h,1X){c 9V(J,op){4N(op){1y\'5e\':l 1X.43(J,\'7d\');1y\'5b\':l 1X.43(J);1y\'4l\':l J}l Q}u 33={2w:c(op,U){u 1N,L=f.1L();1N=L.3j.V(f,\'33\',\'h5\',U.M);if(!1N){l Q}if(op===\'4l\'){1N=\'J:\'+(U.K||\'\')+\';4c,\'+1N}l 9V(1N,op,U.K)}};l(1h.33=33)});1v("F/H/2c/2g/1j",["F/H/2c/1c","F/O/1a/G","F/1b/1w","F/1b/1Y","F/1b/33","F/2g/3i","F/H/2a"],c(1h,G,1w,1Y,33,3i,2a){u 1j={3R:c(1D,J){u 1q=f,L=1q.1L();c 3R(){1D.9n=L.1u;L.3j.V(1q,\'1j\',\'3R\',1D,J)}c 9P(R,U){L.3j.V(1q,\'1j\',\'9P\',R,U.M);J=Q;3R()}c dJ(U,cb){u tr=1d 2a();tr.2k("a6",c(){cb(f.1N)});tr.9n(U.3H(),U.K,{1U:L.M})}if(!G.6o(1D.2E)){G.2f(1D.2E,c(P,2S){L.3j.V(1q,\'1j\',\'9X\',2S,P.7f())})}if(J 3u 3i){u 9O;J.2f(c(P,R){if(P 3u 1w){9O=R}Y{L.3j.V(1q,\'1j\',\'6q\',R,P)}});if(!J.8u()){J=Q;3R()}Y{u U=J.6F();if(U.50()){dJ(U,c(ab){U.1x();9P(9O,ab)})}Y{9P(9O,U)}}}Y if(J 3u 1w){if(J.50()){dJ(J,c(ab){J.1x();J=ab.M;3R()})}Y{J=J.M;3R()}}Y{3R()}},b2:c(1O){u 6U,U,L=f.1L();U=L.3j.V(f,\'1j\',\'jb\');if(U){U=1d 1Y(L.M,U);if(\'U\'===1O){l U}37{6U=1d 33();if(!!~G.2t(1O,["","4b"])){l 6U.5e(U)}Y if(\'4m\'===1O&&!!1A.5h){l 5h.cj(6U.5e(U))}}mm{U.1x()}}l Q},3z:c(my){u L=f.1L();L.3j.V(f,\'1j\',\'3z\');f.31(\'7g\');f.31(\'3z\')}};l(1h.1j=1j)});1v("F/H/2c/H/2a",["F/H/2c/1c","F/1b/1w"],c(1h,1w){u 2a={5H:c(K){u L=f.1L(),U=L.3j.V(f,\'2a\',\'5H\',K);if(U){l 1d 1w(L.M,U)}l Q}};l(1h.2a=2a)});1v("F/H/2c/1S/1K",["F/H/2c/1c","F/O/1a/G","F/H/2a","F/1b/1w","F/1b/33"],c(1h,G,2a,1w,33){u 1K={aT:c(U){u 1o=f,L=1o.1L();c 1C(gr){L.3j.V(1o,\'1K\',\'aT\',gr.M);1o=L=Q}if(U.50()){u tr=1d 2a();tr.2k("a6",c(){1C(tr.1N.3H())});tr.9n(U.3H(),U.K,{1U:L.M})}Y{1C(U.3H())}},9T:c(29){u L=f.1L();l L.3j.V(f,\'1K\',\'9T\',29.M)},5H:c(K,2R){u L=f.1L(),U=L.3j.V(f,\'1K\',\'5H\',K,2R);if(U){l 1d 1w(L.M,U)}l Q},4J:c(){u L=f.1L(),U=L.1K.5H.2v(f,1T),6U;if(!U){l Q}6U=1d 33();l 6U.4l(U)}};l(1h.1K=1K)});1v("F/H/2Y/1c",["F/O/1a/G","F/O/1a/1e","F/O/1a/1l","F/O/36","F/H/1c"],c(G,1e,1l,x,1c){u K="2Y",1h={};c iz(1R){u 9t=1f,88=Q,9C,7j,8o,9m,aQ,7r=0;37{37{88=1d aH(\'gF.gF\');if(88.mW(1R)){9t=1t}88=Q}3k(e){u e3=89.gC["n2 n6-n4"];if(e3){9C=e3.eC;if(9C==="1.0.er.2"){9C="2.0.er.2"}7j=9C.3x(".");3M(7j.T>3){7j.eY()}3M(7j.T<4){7j.2G(0)}8o=1R.3x(".");3M(8o.T>4){8o.eY()}do{9m=4O(8o[7r],10);aQ=4O(7j[7r],10);7r++}3M(7r<8o.T&&9m===aQ);if(9m<=aQ&&!dP(9m)){9t=1t}}}}3k(e2){9t=1f}l 9t}c eO(X){u I=f,6z;X=G.1k({as:1e.as},X);1c.V(f,X,K,{5d:1c.38,6I:1c.38,7x:1c.38,7K:1c.38,82:1f,7P:1c.38,7U:1c.38,7R:c(P){l P&&I.1u===\'2T\'},4U:c(1O){if(1O!==\'4m\'){l 1t}Y{l!!1A.5h}},77:c(2b){l I.1u===\'2T\'||!G.4a(2b,[6K,7a])},5M:1c.38,7z:1c.38,6y:1c.38,7Q:c(P){l P&&I.1u===\'1n\'},6S:c(P){l P&&I.1u===\'2T\'},6V:1c.38,7y:1c.38,7A:1t,5m:1f,7X:1c.38,8t:c(6E){l I.1u===\'2T\'||!G.4a(6E,[\'96\',\'98\'])}},{7R:c(P){l P?\'2T\':\'1n\'},77:c(2b){l G.4a(2b,[6K,7a])?\'2T\':[\'2T\',\'1n\']},7Q:c(P){l P?\'1n\':\'2T\'},6S:c(P){l P?\'2T\':\'1n\'},8t:c(6E){l G.4a(6E,[\'96\',\'98\'])?\'2T\':[\'2T\',\'1n\']}});if(!iz(\'2.0.mE.0\')||1e.1n===\'a3\'){f.1u=1f}G.1k(f,{53:c(){l 1l.1V(f.M).dA.dn},3j:c(5c,5r){u 2y=[].3h.V(1T,2);l I.53().1C(f.M,5c,5r,2y)},2h:c(){u 1Z;1Z=f.4w();1Z.6M=\'<4y id="\'+f.M+\'" J="J:2Q/x-2Y," K="2Q/x-2Y-2" 1g="48%" 1i="48%" 3a="i3:eJ;">\'+\'<5N R="d9" P="\'+X.as+\'"/>\'+\'<5N R="k0" P="jU"/>\'+\'<5N R="jN" P="1t"/>\'+\'<5N R="jQ" P="1t"/>\'+\'<5N R="sm" P="M=\'+f.M+\',1q=\'+1e.dQ+\'"/>\'+\'</4y>\';6z=81(c(){if(I&&!I.aq){I.1m("4q",1d x.2N(x.2N.9N))}},1e.9K!==\'dc\'?km:hY)},1x:(c(1x){l c(){1x.V(I);hh(6z);X=6z=1x=I=Q}}(f.1x))},1h)}1c.95(K,eO);l 1h});1v("F/H/2Y/1b/1w",["F/H/2Y/1c","F/O/1a/G","F/H/2c/1b/1w"],c(1h,G,1w){l(1h.1w=G.1k({},1w))});1v("F/H/2Y/1b/2F",["F/H/2Y/1c"],c(1h){u 2F={2h:c(X){c gD(2u){u 9h=\'\';1B(u i=0;i<2u.T;i++){9h+=(9h!==\'\'?\'|\':\'\')+2u[i].7u+" | *."+2u[i].1h.3p(/,/g,\';*.\')}l 9h}f.1L().3j.V(f,\'2F\',\'2h\',gD(X.2u),X.R,X.8a);f.1m(\'7l\')}};l(1h.2F=2F)});1v("F/H/2Y/1b/3F",["F/H/2Y/1c","F/O/1a/1l","F/O/1a/1W"],c(1h,1l,1W){u 3F={2h:c(){u 1o=f,L=1o.1L(),57;57=L.4w();1W.3g(57,\'gn\',c(e){e.4R();e.5f();e.8c.gl=\'go\'},1o.M);1W.3g(57,\'9R\',c(e){e.4R();u 9Z=1l.1V(L.M).mu(e);if(9Z){e.5f()}},1o.M);1W.3g(57,\'9F\',c(e){e.4R();u 9Z=1l.1V(L.M).mn(e);if(9Z){e.5f()}},1o.M);l L.3j.V(f,\'3F\',\'2h\')}};l(1h.3F=3F)});1v("F/H/2Y/1b/1H",["F/H/2Y/1c","F/O/1a/G","F/H/2c/1b/1H"],c(1h,G,1H){l(1h.1H=G.1k({},1H))});1v("F/H/2Y/1b/33",["F/H/2Y/1c","F/O/1a/G","F/H/2c/1b/33"],c(1h,G,33){l(1h.33=G.1k({},33))});1v("F/H/2Y/2g/1j",["F/H/2Y/1c","F/O/1a/G","F/H/2c/2g/1j"],c(1h,G,1j){l(1h.1j=G.1k({},1j))});1v("F/H/2Y/H/2a",["F/H/2Y/1c","F/O/1a/G","F/H/2c/H/2a"],c(1h,G,2a){l(1h.2a=G.1k({},2a))});1v("F/H/2Y/1S/1K",["F/H/2Y/1c","F/O/1a/G","F/H/2c/1S/1K"],c(1h,G,1K){l(1h.1K=G.1k({},1K,{9D:c(){u L=f.1L(),gU=[\'6H\',\'8l\',\'9W\'],3b={1D:{}},6B=L.3j.V(f,\'1K\',\'9D\');if(6B.1D){G.2f(gU,c(bz){u 1D=6B.1D[bz],2I,i,T,P;if(1D&&1D.dj){3b.1D[bz]={};1B(i=0,T=1D.dj.T;i<T;i++){2I=1D.dj[i];P=1D[2I];if(P){if(/^(\\d|[1-9]\\d+)$/.3G(P)){P=4O(P,10)}Y if(/^\\d*\\.\\d+$/.3G(P)){P=dz(P)}3b.1D[bz][2I]=P}}}})}3b.1g=4O(6B.1g,10);3b.1i=4O(6B.1i,10);3b.1z=4O(6B.1z,10);3b.K=6B.K;3b.R=6B.R;l 3b}}))});1v("F/H/4Y/1c",["F/O/1a/G","F/O/36","F/H/1c","F/O/1a/1e"],c(G,x,1c,1e){u K=\'4Y\',1h={};c ef(X){u I=f,3K=1c.dB,8b=1c.38;1c.V(f,X,K,{5d:3K(1A.1H||1A.1Y&&1Y.4J),6I:1f,7x:3K(1h.1K&&(1e.1J(\'72\')||1e.1J(\'b6\'))),7K:1f,82:1f,8W:3K(c(){l(1e.1n===\'7D\'&&1e.1R>=28)||(1e.1n===\'46\'&&1e.1R>=10)}()),7U:c(){l 1h.1K&&I.1J(\'5d\')&&1e.1J(\'72\')},7P:1f,7R:1f,4U:c(1O){if(1O===\'4m\'&&!!1A.5h){l 1t}l!!~G.2t(1O,[\'4b\',\'2j\',\'\'])},77:c(2b){l!G.4a(2b,[6K,7a])},5M:c(){l 1e.1J(\'dT\')},7z:1f,6y:1f,6S:1f,6V:1t,7y:1f,7A:c(){l I.1J(\'5M\')},5m:3K(c(){l(1e.1n===\'di\'&&1e.1R>=4)||(1e.1n===\'a3\'&&1e.1R>=12)||!!~G.2t(1e.1n,[\'7D\',\'b5\'])}()),7X:8b,8t:c(6E){l!G.4a(6E,[\'96\',\'98\'])}});G.1k(f,{2h:c(){f.1m("dD")},1x:(c(1x){l c(){1x.V(I);1x=I=Q}}(f.1x))});G.1k(f.53(),1h)}1c.95(K,ef);l 1h});1v("F/H/4Y/1b/2F",["F/H/4Y/1c","F/O/1a/G","F/O/1a/1l","F/O/1a/1W","F/O/1a/27","F/O/1a/1e"],c(1h,G,1l,1W,27,1e){c 2F(){u 4X,3y=[],aM=[],1G;c c6(){u 1o=f,I=1o.1L(),1I,2o,8L,1M,1P,M;M=G.2W(\'4k\');1I=I.4w();if(4X){8L=1l.1V(4X+\'7q\');if(8L){G.1k(8L.3a,{3r:\'48%\'})}}1M=2j.4h(\'1M\');1M.3n(\'id\',M+\'7q\');1M.3n(\'4n\',\'sE\');1M.3n(\'gf\',\'5u/1M-J\');1M.3n(\'8i\',\'5u/1M-J\');G.1k(1M.3a,{dC:\'5F\',4z:\'9g\',3r:0,6C:0,1g:\'48%\',1i:\'48%\'});1P=2j.4h(\'1P\');1P.3n(\'id\',M);1P.3n(\'K\',\'1b\');1P.3n(\'R\',1G.R||\'sH\');1P.3n(\'2u\',aM.78(\',\'));G.1k(1P.3a,{sr:\'ec\',da:0});1M.6L(1P);1I.6L(1M);G.1k(1P.3a,{4z:\'9g\',3r:0,6C:0,1g:\'48%\',1i:\'48%\'});if(1e.1n===\'46\'&&1e.1R<10){G.1k(1P.3a,{9h:"qX:qp.dG.oe(da=0)"})}1P.a8=c(){u 1b;if(!f.P){l}if(f.3e){1b=f.3e[0]}Y{1b={R:f.P}}3y=[1b];f.a8=c(){};c6.V(1o);1o.2k(\'8X\',c aa(){u 1P=1l.1V(M),1M=1l.1V(M+\'7q\'),1b;1o.dd(\'8X\',aa);if(1o.3e.T&&1P&&1M){1b=1o.3e[0];1P.3n(\'id\',1b.M);1M.3n(\'id\',1b.M+\'7q\');1M.3n(\'1q\',1b.M+\'2M\')}1P=1M=Q},o5);1P=1M=Q;1o.1m(\'8X\')};if(I.1J(\'5m\')){2o=1l.1V(1G.6A);1W.7Y(2o,\'8K\',1o.M);1W.3g(2o,\'8K\',c(e){if(1P&&!1P.8V){1P.8K()}e.4R()},1o.M)}4X=M;1I=8L=2o=Q}G.1k(f,{2h:c(X){u 1o=f,I=1o.1L(),1I;1G=X;aM=X.2u.2O||27.dI(X.2u,I.1J(\'8W\'));1I=I.4w();(c(){u 2o,4C,3r;2o=1l.1V(X.6A);if(I.1J(\'5m\')){if(1l.5U(2o,\'4z\')===\'aA\'){2o.3a.4z=\'8T\'}4C=4O(1l.5U(2o,\'z-7r\'),10)||1;2o.3a.4C=4C;1I.3a.4C=4C-1}3r=I.1J(\'5m\')?2o:1I;1W.3g(3r,\'i1\',c(){1o.1m(\'bX\')},1o.M);1W.3g(3r,\'hj\',c(){1o.1m(\'ce\')},1o.M);1W.3g(3r,\'8P\',c(){1o.1m(\'8P\')},1o.M);1W.3g(1l.1V(X.1Z),\'8O\',c(){1o.1m(\'8O\')},1o.M);2o=Q}());c6.V(f);1I=Q;1o.1m({K:\'7l\',5x:1t})},8S:c(){l 3y},aN:c(4E){u 1P;if((1P=1l.1V(4X))){1P.8V=!!4E}},1x:c(){u I=f.1L(),6D=I.53(),1I=I.4w();1W.5i(1I,f.M);1W.5i(1G&&1l.1V(1G.1Z),f.M);1W.5i(1G&&1l.1V(1G.6A),f.M);if(1I){1I.6M=\'\'}6D.8U(f.M);4X=3y=aM=1G=1I=6D=Q}})}l(1h.2F=2F)});1v("F/H/4Y/1b/1H",["F/H/4Y/1c","F/H/2i/1b/1H"],c(1h,1H){l(1h.1H=1H)});1v("F/H/4Y/2g/1j",["F/H/4Y/1c","F/O/1a/G","F/O/1a/1l","F/O/1a/4j","F/O/36","F/O/1a/1W","F/1b/1w","F/2g/3i"],c(1h,G,1l,4j,x,1W,1w,3i){c 1j(){u 7v,6J,2M;c ah(cb){u 1q=f,M,1M,7i,i,cJ=1f;if(!2M){l}M=2M.id.3p(/2M$/,\'\');1M=1l.1V(M+\'7q\');if(1M){7i=1M.no(\'1P\');i=7i.T;3M(i--){4N(7i[i].nq(\'K\')){1y\'5F\':7i[i].5g.8D(7i[i]);2l;1y\'1b\':cJ=1t;2l}}7i=[];if(!cJ){1M.5g.8D(1M)}1M=Q}81(c(){1W.7Y(2M,\'4u\',1q.M);if(2M.5g){2M.5g.8D(2M)}u 1I=1q.1L().4w();if(!1I.ow.T){1I.5g.8D(1I)}1I=2M=Q;cb()},1)}G.1k(f,{3R:c(1D,J){u 1q=f,I=1q.1L(),M,1M,1P,U;7v=6J=Q;c fS(){u 1Z=I.4w()||2j.6N,cV=2j.4h(\'6G\');cV.6M=\'<eM id="\'+M+\'2M" R="\'+M+\'2M" 2L="eV:&eZ;&eZ;" 3a="eH:eJ"></eM>\';2M=cV.o6;1Z.6L(2M);1W.3g(2M,\'4u\',c(){u el;37{el=2M.86.2j||2M.o0||1A.o4[2M.id].2j;if(/^4(0[0-9]|1[0-7]|2[sL])\\s/.3G(el.7u)){7v=el.7u.3p(/^(\\d+).*$/,\'$1\')}Y{7v=6K;6J=G.4H(el.6N.6M);1q.1m({K:\'5D\',3X:6J.T,3Y:6J.T});if(U){1q.1m({K:\'tg\',3X:U.1z||fP,3Y:U.1z||fP})}}}3k(ex){if(4j.8g(1D.2H)){7v=7a}Y{ah.V(1q,c(){1q.1m(\'2C\')});l}}ah.V(1q,c(){1q.1m(\'4u\')})},1q.M)}if(J 3u 3i&&J.8u()){U=J.6F();M=U.M;1P=1l.1V(M);1M=1l.1V(M+\'7q\');if(!1M){26 1d x.1E(x.1E.9I)}}Y{M=G.2W(\'4k\');1M=2j.4h(\'1M\');1M.3n(\'id\',M+\'7q\');1M.3n(\'4n\',1D.4n);1M.3n(\'gf\',\'5u/1M-J\');1M.3n(\'8i\',\'5u/1M-J\');1M.3n(\'1q\',M+\'2M\');I.4w().6L(1M)}if(J 3u 3i){J.2f(c(P,R){if(P 3u 1w){if(1P){1P.3n(\'R\',R)}}Y{u 5F=2j.4h(\'1P\');G.1k(5F,{K:\'5F\',R:R,P:P});if(1P){1M.og(5F,1P)}Y{1M.6L(5F)}}})}1M.3n("5r",1D.2H);fS();1M.jZ();1q.1m(\'9E\')},cn:c(){l 7v},b2:c(1O){if(\'4m\'===1O){if(G.1F(6J)===\'2x\'&&!!1A.5h){37{l 5h.cj(6J.3p(/^\\s*<gi[^>]*>/,\'\').3p(/<\\/gi>\\s*$/,\'\'))}3k(ex){l Q}}}Y if(\'2j\'===1O){}l 6J},3z:c(){u 1q=f;if(2M&&2M.86){if(2M.86.h7){2M.86.h7()}Y if(2M.86.2j.fu){2M.86.2j.fu(\'md\')}Y{2M.2L="mT:mO"}}ah.V(f,c(){1q.31(\'3z\')})}})}l(1h.1j=1j)});1v("F/H/4Y/1S/1K",["F/H/4Y/1c","F/H/2i/1S/1K"],c(1h,1K){l(1h.1K=1K)});iG(["F/O/1a/G","F/O/55","F/O/1a/27","F/O/1a/1e","F/O/1a/1l","F/O/36","F/O/2q","F/O/1a/1X","F/H/1c","F/H/2U","F/1b/1w","F/1b/1Y","F/1b/2F","F/1b/3F","F/H/59","F/1b/1H","F/O/1a/4j","F/1b/33","F/2g/3i","F/2g/1j","F/H/2a","F/1S/1K","F/O/1a/1W"])})(f);(c(){"i2 hI";u o={},2t=F.O.1a.G.2t;(c gQ(ns){u R,bj;1B(R in ns){bj=2J(ns[R]);if(bj===\'4y\'&&!~2t(R,[\'36\',\'1e\',\'27\'])){gQ(ns[R])}Y if(bj===\'c\'){o[R]=ns[R]}}})(1A.F);o.1e=1A.F.O.1a.1e;o.27=1A.F.O.1a.27;o.36=1A.F.O.36;1A.ru=o;if(!1A.o){1A.o=o}l o})();',62,1830,'||||||||||||function|||this||||||return|||||||||var|||||||||||moxie|Basic|runtime||data|type|self|uid||core|value|null|name||length|blob|call||options|else||||||||||||utils|file|Runtime|new|Env|false|width|extensions|height|XMLHttpRequest|extend|Dom|trigger|browser|comp|obj|target|idx|_xhr|true|mode|define|Blob|destroy|case|size|window|for|exec|meta|DOMException|typeOf|_options|FileReader|shimContainer|can|Image|getRuntime|form|result|responseType|input|str|version|image|arguments|ruid|get|Events|Encode|File|container|||||||throw|Mime||img|Transporter|code|flash||_fr|each|xhr|init|html5|document|bind|break|offset|prototype|browseButton|VERSION|EventTarget|_p|NAME|inArray|accept|apply|read|string|args|_canvas|undefined|key|error|array|headers|FileInput|push|url|tag|typeof|ctx|src|_iframe|RuntimeError|mimes|start|application|quality|header|client|RuntimeClient|required_caps|guid|Flash|silverlight|ImageError|_br|dispatchEvent||FileReaderSync|canvas|readyState|Exceptions|try|capTrue|Math|style|info|offsets|SHORT|files|match|addEvent|slice|FormData|shimExec|catch|_binStr|_blob|setAttribute|node|replace|toLowerCase|top|LONG|caps|instanceof|eventpool|uri|split|_files|abort|count|queue|parent|cap|MAJOR|FileDrop|test|getSource|mime|callback|Test|list|while|fired|dataUrl|imgCopy|instance|send|end|segment|matches|_imgInfo|light|loaded|total|DONE|connectRuntime|path|items|atob|ext|_ep|IE|marker|100|crop|arrayDiff|text|base64|_img|addEventListener|evt|urlp|createElement|exts|Url|uid_|readAsDataURL|json|method|video|INVALID_STATE_ERR|Error|jpeg|BinaryReader|_binstr|load|undef|getShimContainer|indexOf|object|position|upload|tiffHeader|zIndex|namecodes|state|rXML||trim|_info|getAsDataURL|_hm|max|num|switch|parseInt|detected|purge|preventDefault|delete|eventhash|return_response_type|dispatches|bits|_uid|html4|entry|isDetached||fragments|getShim|translate|I18n|bin|dropZone|crlf|RuntimeTarget|preserveHeaders|readAsBinaryString|component|access_binary|readAsText|stopPropagation|parentNode|JSON|removeAllEvents|port|func|vnd|summon_file_dialog|not|compare|props|values|action|Tiff|err|multipart|defaultMode|b64|async|constructor|Content|v2|disconnectRuntime|LOADING|progress|blobpool|hidden|currentUrl|getAsBlob|binstr|tmpEvt|entries|reduction|select_file|param|red|audio|btoa|GPS|module|String|getStyle|eye|withCredentials|v1|responseText|className|scale|NT|mapper|definition||charAt|priority|doc|EventException|tmp_arr|ids|utf8_encode|_purge|response|status|html|getContext|FileException|Exif|II|hasOwnProperty|convertEventPropsToHandlers|loadEnd|shimid|isEmptyObj|_|append|scheme|_read|prop|parseUrl|Not|_shim|user|send_binary_string|initTimer|browse_button|rawInfo|left|shim|methods|getBlob|div|tiff|access_image_binary|_response|200|appendChild|innerHTML|body|orientation|fromCharCode|UAParser|_pos|send_custom_headers|_size|frs|send_multipart|needles|unbindAll|SEGMENT|999|_runtime|pair|create_canvas|objpool|chunk|handlers|arr|return_status_code|join|modeCaps|404|scope|_responseHeadersBag|utf8|RuntimeInit|toString|readystatechange|WRONG_FORMAT|inputs|actualVerArray|windows|ready|map|defaults|substr|auto|_form|index|compulsory|_toBinary|title|_status|_responseHeaders|display_media|slice_blob|select_multiple|stream_upload|valueType|OperationNotAllowedException|Chrome|_error_flag|_send_flag|host|boundary|SYNTAX_ERR|tmpCanvas|do_cors|_modified|order|officedocument|_filename|report_upload_progress|send_browser_cookies|return_response_headers|JPEG|PNG|resize_image|openxmlformats|handler|upload_filesize|removeEvent|tagOffset||setTimeout|drag_and_drop|item|getResult|events|contentWindow|setExif|control|navigator|multiple|True|dataTransfer|ExifVersion|destHeight|root|hasSameOrigin|capMode|encoding|JPEGHeaders|loadend|exif|_reset|tags|reqVerArray|destWidth|_headers|cbcb|NOT_SUPPORTED_ERR|use_http_method|hasBlob|toDataURL|substring|png|modules|exact|regex|onload|_mimeType|removeChild|clone|_allowedExts|inSeries|parseCaps|continue|hash|click|currForm|open|password|mouseup|mousedown|dashdash|charCodeAt|getFiles|relative|removeInstance|disabled|filter_by_extension|change|_load|_upload_complete_flag||_async|EMPTY|_same_origin_flag|_upload_events_flag|addConstructor|GET|_sync_flag|POST|ExifParser|OPENED|toUpperCase|getSize|dimensions|_chunk_size|_data|absolute|filter|GPSVersionID|charset|downsize|PI|requiredVersionPart|transport|swf_url|rotate|shift|default|_findKey|isVersionSupported|maps|mobile|diff|refCaps|runtimes|parseSizeStr|ua|utf8_decode|actualVer|getInfo|loadstart|drop|safari|drawImage|NOT_FOUND_ERR|prefix|OS|fileName|_result|NOT_INIT_ERR|blobField|appendBlob|GPSInfoIFDPointer|dragenter|Load|loadFromImage|chunk_size|_formatData|gps|setRequestHeader|bodyElm|flag|ExifIFDPointer|hex|srcType|Opera|major|0px|TransportingComplete|IDLE|onchange|regExp|onChange|attachedBlob||rect|use_data_uri|valueOffset|extractTags|cleanup||responseXML|getResponseHeader|documentElement|OBJ_TYPE|getAllResponseHeaders|mustSendAsBinary|0xff|initialized|Date|xap_url|jpegHeaders|fluorescent|mul|mimeData|stream|Type|octet|static|opera|regexes|rgx|sos|removeEventListener|SLONG|ActiveXObject|uastring|directory|_isAcceptable|white|_mimes|disable|_convertToBinary|Standard|actualVersionPart|rtf|tagDescs|loadFromBlob|round|enc|nodeRect|_preserveHeaders|ImageInfo|0x3f|CRC|_preload|getResponse|STRING|dec|Safari|use_data_uri_over32kb|origin|types|detach|clients||tmpCtx|1024||MegaPixel|ports|capStr|Resize|itemType|initialize|resolveUrl|_getImg|hasExif|_fields|Request|getAsCanvas|rootRect|arrayIntersect|dependencies|txt|set|UNSENT|cbArgs|getFileMime|grp|signature|Required|getAsBinaryString|_getDimensions|message|hasClass|getPos|_method|pos|getConstructor|inParallel|UNKNOWN|oldsafari|ui8a|util|has|webkit|sendAsBinary|FUNC_TYPE|putstr|ogg|template|sum|mouseenter|Refresh|toArray|mimes2extList|i18n|Files|filters|encodeURIComponent|presentationml|addInput|progIDs|query|rText|getTime||unescape|Disposition|mouseleave|disposition|getFileExtension|gif|MAX_RESOLUTION_ERR|parse|removeClass|addClass|define_property|getStatus|prepVersion|numVersion|operator|runtimeConstructors|_url|RegExp|statusText|_run|_start_time|getIEPos|mod|_encoding|_transport|_user|_password|bytesLeft|nodeType|INVALID_ACCESS_ERR|capObj|gecko|XMLHttpRequestUpload|hasFile|dragleave|SECURITY_ERR|android|moreEntries|field|_readEntries|getEntries|Failed|requiredCaps|select_folder|_loadFromBlob|temp|timeout|getUA|MAX_RESIZE_WIDTH|MAX_RESIZE_HEIGHT|getMode|orig|engine|blobSlice|mpeg|embedded|stripHeaders|PixelXDimension|PixelYDimension|source|opacity|detectSubsampling|Windows|unbind|vertSquashRatio|invalid|onerror||Firefox|keys|tmpTags|writeHeaders|ifd|Moxie||defs|restore|Auto|min|Progress||EXIF||||parseFloat|content|capTest|overflow|Init|_cs|ratio|Microsoft|exifVersion|extList2mimes|attachBlob|alpha|callNext|did|IFD_offset|exports|isNaN|global_event_dispatcher|muls|needle|use_fileinput|_downsize|iOS|must|255|fire|Normal|Other|||plugin|mathFn|Array|_getChunkAt|detectVerticalSquash|pass|_doXHR|array1|naturalHeight|999px|naturalWidth|httpCode|Html4Runtime|request|uffff|u0100|transfer|line||uaHeaders|cookie|cookie2|mac||30226|_finalMime|access|plain|UTF|userAgent|||_finalCharset|ceil|array2|description|hasEventListener|getIFDOffsets|longitude|6500|display|css|none|tags2extract|BYTE|iframe|_loadFromUrl|SilverlightRuntime|zip|verComp|mozSlice|w3cBlobSlice|HTML5Blob|csv|javascript|webkitSlice|osVersion|pop|quot|Html5Runtime|counter|_loadFromImage|gpsIFD|exifIFD|TRACK|removeAllInstances|setTag|0xFFD8|strip|getBinary|_timeoutset_time|app1||BUSY|firefox|onResize|IFD0||_updateInfo|TYPE_MISMATCH_ERR|INVALID_NODE_TYPE_ERR|runtime_order||wordprocessingml|use_data_uri_of|wmv||mozilla|TIFF|execCommand|m4a|wav|_toDataUrl|http|https|_readAsDataUrl|NOT_READABLE_ERR|tmp|Orientation|All|drop_zone|443|asBinary|escape|unshift|flac|aac|removeAllEventListeners|str_data|renderImageToCanvas|1025|aiff|ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789|createIframe|lastModifiedDate|9px|HTML5Image|context|specified|runtimeOrder|8px|getShimVersion|2097152|1px|ShockwaveFlash|require|shockwave|renderTo|preferred_caps|_drawToCanvas|preferredMode|_sliceDetached|resolve|expr|_rotateToOrientaion||enctype|defined|UNSPECIFIED_EVENT_TYPE_ERR|pre|Bad|svg|dropEffect|win|dragover|copy|bmp|417|srcBlob|Entity||bytes|Gateway|Timeout|getEngine|getImageData|getBrowser|CONNECT|getOS|plugins|toFilters|vm|AgControl|setUA|version_compare|swf|FlashBlob|Found|scrollTop|scrollLeft|FlashRuntime|NO_MODIFICATION_ALLOWED_ERR|ac3|addAlias|wma|ABORT_ERR|Proxy|grps|getComputedStyle|Too|currentStyle|416|arg|412|||||readAsBase64|documentMode|stop|getBoundingClientRect|TRACE|0xFFE1|No|xml|_getDocument|XMLHTTP|getBlobName|_getNativeXHR|clearTimeout|_prepareMultipart|mouseout|abs|0x0000|0x0001|filename|Strobe|_preloadAndSend|Uint8Array|Browser|WhiteBalance|Android|Manual|SceneCaptureType|balance|isGecko2_5_6|isAndroidBrowser|lengthComputable|onreadystatechange|Length|UploadProgress|exposure|ExposureMode|binData|write|Daylight|strict|addMissingExtensions|weather|addMimeType|mimes2exts|pgp|m4v|webm|avi|pack|3gpp|pdf|flv|LightSource|Partial|model|5000|vendor|Sprint|mouseover|use|outline|mp4|ColorSpace|MeteringMode|str2|str1|UNDEF_TYPE|Contrast|0x000F|Soft||||links|||isFile|_readEntry|khtml|latitude||icab||_readDirEntry|splice|_readItems|GPSLongitudeRef|trident|w3m||_extractExts|GPSLatitudeRef|isInstalled|Hard|webkitGetAsEntry|netfront|lynx|amaya|netsurf|expose|dirEntry|Saturation|Sharpness|attachEvent|dirReader|smobile|saturation|detachEvent|avant|iemobile|slim|TIMEOUT_ERR|URL_MISMATCH_ERR|QUOTA_EXCEEDED_ERR|VALIDATION_ERR|NETWORK_ERR|quicktime|DATA_CLONE_ERR|blazer|jasmine|outerHTML|allowscriptaccess|HTC|transparent|sort|compatMode|CSS1Compat|APA|NAMESPACE_ERR|NT3|getResponseAsBlob|always|ME|baidu|INUSE_ATTRIBUTE_ERR|lunascape|offsetHeight|clientHeight|offsetTop|XP|Vista|clientWidth|offsetWidth|mobiletab|ARM|opr|kindle||RT|offsetParent|JS_ERR|7373KT|INVALID_CHARACTER_ERR|WRONG_DOCUMENT_ERR|maxthon|NO_DATA_ALLOWED_ERR|smini|NT4|HIERARCHY_REQUEST_ERR|DOMSTRING_SIZE_ERR|2000|NOT_ALLOWED_ERR|ENCODING_ERR|offsetLeft|INDEX_SIZE_ERR|INVALID_MODIFICATION_ERR|96b8|exe|windowless|classid|otf|enablehtmlaccess|opendocument|formula|clsid|Transparent|BlackBerry|MODEL|d27cdb6e|tasman|submit|background|oasis|dependecy|3g2|found|3gpp2|3gp|s9x|sphone|realvideo|_container|snt|ppsx|mkv|matroska|ogv|arm|TYPE|mp3|device|m2v|419|10000|tizen|mov|aif|sprint|Evo|Shift|flashvars|movie|decodeURIComponent|444553540000|lowerize|tablet|mpega|mp2|architecture|mpga|VENDOR|ARCHITECTURE|ae6d|CONSOLE|TABLET|oga|MOBILE|console|11cf|blackberry|wmode|xap|slike|seamonkey|honead|conkeror|minimo|maemo|sbrowser|mpg|s60|bsd|ice|frentopc|dragonfly|meleon|Symbian|xhtml|smac|sopera|htm|plan|symbos|minix|icedragon|amigaos|beos||mosaic|_powerpc|macintosh|aix|haiku|fennec|chimera|iceweasel|camino|gobrowser|Solaris|suse|debian|doris||gentoo|arch|fedora|slackware|ubuntu|kxln|uc|polaris|dillo|phoenix|mint|joli|playstation|mandriva|nintendo|linux|hurd|zenwalk|gnu|cros|sunos|Chromium|redhat|icecat|qqbrowser|firebird|iceape|centos|pclinuxos|and|morphos|risc|photoshop|psd|palm|jpe|jpg|ovibrowser|bolt|svgz|qnx|rim|sgecko|yabrowser|like|Stop||bada|iron|skyfire|R0lGODlhAQABAIAAAP8AAAAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw|getElementById|flock|wids3portablevu|finally|dragDrop|rekonq|chromium|rockmelt|midori||silk|dragEnter||epiphany|33000|upload_complete_flag|webos|tif|ntce|Mobile|stablet|31005|ssafari|crios|Dolphin|crmo|konqueror|netscape|swiftfox|unix|presto|blank|Netscape|meego|symbian|dolfin|about|beta|dev|IsVersionSupported|RC|log|asc|Yandex|comodo_dragon|Silverlight|tizenoka|In|arora|Plug|chrome|omniweb|mpe|Modified|0x005F|1048576|onReadyStateChange||bracket|mgk|0x005D|0x004D|0x004F|0x0059|buffer|powerpoint|Mozilla|getElementsByTagName|isDirectory|getAttribute|Low|||createReader|readEntries|Landscape|Portrait|Night|scene|0x0049|0x0047|xlb|moxieboundary|0x0019|parsererror|xls|0x0018|0x0009|0x000D|0x0010|excel|tagName|0x001D|0x0020|0x0041|0x0045|Msxml2|XMLDOM|validateOnParse|parseError|0x001F|loadXML|getAsFile|High|0x002A|contentDocument||||frames|998|firstChild|nodeName|onloadend|onprogress|o_|0x4949|IFD|ImageView|Alpha|receive|insertBefore|TransportingStarted|dotx|resize|swfl|Embedded|embed||docx||draggable|ondragstart||font|1099511627776|South|children|North|webkitdirectory|ppt|replaceChild|cloneNode|1073741824|pps|pot|moxie_|West|ArrayBuffer|ondrop|returnValue|cancelBubble|East|srcElement|event|0x0007|0x0005|Unknown|Uncalibrated|sRGB|GPSLongitude|Average|CenterWeightedAverage|Fliorescent|Pattern|MultiSpot|Spot|0x0004|0x0003|0xA404|0xA406|0xA403|0xA402|DigitalZoomRatio|0xA408|GPSLatitude|0x0002|0xA40A|0xA409|Tungsten|Fine|3700K|3200|WW|White|dot|msword|D65||addI18n|D75|sprintf|4500K|3900|7100K||5700|Shade|Cloudy|postscript|||Day|Cool|5400K|4600|FocalLength|0x920A|0x0112|D50|0xFFE0|APP|0x010E|ImageDescription|Model|0x0110|Make|0x010F|0xFFEF|0xFFD9|ISO|studio|tungsten|eps|9mkg|2147483647|0xFFDA|0xFFD7|0xFFD0|4294967296|0x0131|Software|0x9201|ISOSpeedRatings|0x8827|FNumber|ShutterSpeedValue|0x9202|0x9209|0x9208|0x9207|ApertureValue|0x829D|ExposureTime|0xA001|0x9000|0x8825|0x8769|0xA002|0xA003|0x829A|DateTimeOriginal|0x9003|TransportingProgress|DXImageTransform|306|Use|305||D55|Reserved|307|401|400|Redirect|Temporary|304|See|Choices|Multiple|300|Used|301|Moved|303|302|Permanently|Unauthorized|402|Gone|410|Conflict|409|411|Precondition|URI|414|Large|progid|408|Authentication|405|Forbidden|403|Payment|Method|Allowed|407|Acceptable|406|IM|226|authority||Drop|refresh|Change|userInfo|fragment|number|potx|href|location|Ready||cancel|slideshow|Shockwave|thatCan|GetVariable|capFalse|mOxie||toLocaleString|file_|lastIndexOf|isSubsampled|Continue|204|Information|Authoritative|Non|205|Reset|Status|Multi|207|206|203|Accepted|102|Protocols|Switching|101|Processing|OK|202|Created|201|Long|413|sec|proxy|via|agent|random|65535|clearRect|presentation||scharset|overrideMimeType||upgrade|trailer|415|date|connection|PUT|keep||alive|pptx|referer|floor|initParams|xlsx|HEADERS_RECEIVED|sheet|mimeType|fontSize|spreadsheetml|204798|TransportingAborted|clear||||0xFFC0|0xFFC3|0x8950|0x4E47|Abort|post|Number|LoadStart|Filedata|IHDR|0x0D0A|0x1A0A|2346|OPTIONS|expect|500|Upgrade|426|Dependency|Internal|Server|Service|503|Implemented|501|424|Locked|Range|Requested|Media|Unsupported|Satisfiable|Expectation|423|Unprocessable|422|Unavailable|502|Negotiates|504|Also||Extended|uploadprogress|510|Storage|Insufficient|507|Variant|NATIVE|HTTP|DELETE|505|HEAD||Version|Supported|506|RUNTIME'.split('|'),0,{})) diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/plupload-2.1.1/plupload.dev.min.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/plupload-2.1.1/plupload.dev.min.js new file mode 100644 index 0000000000000000000000000000000000000000..4a7b56480591e4d1893c47c001b1e675e7812a05 --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/plupload-2.1.1/plupload.dev.min.js @@ -0,0 +1 @@ +eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}(';(6(2M,o,1d){j 1F=2M.5h,2F={};6 3o(9){j T=9.1q,1A={};6 2E(1e,l,51){j 3K={2e:\'3d\',5U:\'2g\',5w:\'2g\',5S:\'5Y\',22:\'4q\',4l:\'3t\',2v:\'3t\',31:\'5P\',5K:\'5J\',5H:\'5l\'};7(3K[1e]){1A[3K[1e]]=l}t 7(!51){1A[1e]=l}}7(1C(T)===\'4H\'){8.x(T.3r(/\\s*,\\s*/),6(1e){2E(1e,F)})}t 7(1C(T)===\'41\'){8.x(T,6(l,1e){2E(1e,l)})}t 7(T===F){7(!9.28){1A.2g=F}7(9.2k>0){1A.3d=F}7(9.1w.2r){1A.2g=F}8.x(9,6(l,1e){2E(1e,!!l,F)})}r 1A}j 8={5L:\'2.1.1\',1n:1,1u:2,2D:1,3z:2,2z:4,2w:5,5N:-29,4V:-5M,5X:-43,5u:-4Q,2L:-5b,4f:-5s,4u:-5T,4c:-5z,5I:-5W,5e:-5k,5f:-5d,5r:o.5p,4M:o.4M,1z:o.1z,Z:o.Z,2I:o.2I,2u:6 2u(1S){j 2l=[],18;7(o.1z(1S)!==\'3F\'){1S=[1S]}j i=1S.B;4h(i--){18=o.2u(1S[i]);7(18){2l.1c(18)}}r 2l.B?2l:X},x:o.x,4P:o.4P,4J:o.4J,5C:6(2s){j 3x={\'<\':\'5A\',\'>\':\'5x\',\'&\':\'5F\',\'"\':\'5G\',\'\\\'\':\'#39\'},53=/[<>&\\"\\\']/g;r 2s?(\'\'+2s).1J(53,6(2t){r 3x[2t]?\'&\'+3x[2t]+\';\':2t}):2s},56:o.56,26:o.26,4z:o.4z,S:o.S,4o:o.4o,45:o.45,2p:o.2p,2q:o.2q,44:o.44,3V:o.3V,4v:o.4v,3Q:o.3Q,5y:6(m){j i,2d;2d=[/[\\43-\\5B]/g,\'A\',/[\\5E-\\5D]/g,\'a\',/\\5O/g,\'C\',/\\62/g,\'c\',/[\\61-\\60]/g,\'E\',/[\\63-\\64]/g,\'e\',/[\\66-\\65]/g,\'I\',/[\\5Z-\\5R]/g,\'i\',/\\5Q/g,\'N\',/\\5V/g,\'n\',/[\\67-\\5c]/g,\'O\',/[\\58-\\59]/g,\'o\',/[\\5a-\\5v]/g,\'U\',/[\\5q-\\5o]/g,\'u\'];1E(i=0;i<2d.B;i+=2){m=m.1J(2d[i],2d[i+1])}m=m.1J(/\\s+/g,\'5t\');m=m.1J(/[^a-5n-5m\\-\\.]+/5g,\'\');r m},4K:6(1b,3S){j 2b=\'\';8.x(3S,6(l,m){2b+=(2b?\'&\':\'\')+3N(m)+\'=\'+3N(l)});7(2b){1b+=(1b.5i(\'?\')>0?\'&\':\'?\')+2b}r 1b},5j:6(k){7(k===1d||/\\D/.3q(k)){r 8.S(\'N/A\')}6 1M(4G,3g){r Q.1M(4G*Q.3h(10,3g))/Q.3h(10,3g)}j 1s=Q.3h(2c,4);7(k>1s){r 1M(k/1s,1)+" "+8.S(\'77\')}7(k>(1s/=2c)){r 1M(k/1s,1)+" "+8.S(\'76\')}7(k>(1s/=2c)){r 1M(k/1s,1)+" "+8.S(\'75\')}7(k>2c){r Q.1M(k/2c)+" "+8.S(\'78\')}r k+" "+8.S(\'b\')},3v:o.79,7c:6(3e,1i){j f,R;f=V 8.2J(3e);R=o.1t.7b(f.3X().1q,1i||3e.1i);f.11();r R},2o:6(m,v){2F[m]=v}};8.2o(\'1B\',6(M,3,v){7(M.B&&!M.3T.3q(3.m)){d.q(\'1k\',{1r:8.4u,1v:8.S(\'1x 7a 1l.\'),3:3});v(14)}t{v(F)}});8.2o(\'1R\',6(2a,3,v){j 1d;2a=8.3v(2a);7(3.k!==1d&&2a&&3.k>2a){d.q(\'1k\',{1r:8.4f,1v:8.S(\'1x k 1l.\'),3:3});v(14)}t{v(F)}});8.2o(\'1Z\',6(l,3,v){7(l){j 2n=d.p.B;4h(2n--){7(3.m===d.p[2n].m&&3.k===d.p[2n].k){d.q(\'1k\',{1r:8.4c,1v:8.S(\'74 3 1l.\'),3:3});v(14);r}}}v(F)});8.2J=6(1H){j 1X=8.2I(),9,p=[],1j={},1f=[],1D=[],2m,z,1Q=14,w;6 2O(){j 3,3b=0,i;7(d.12==8.1u){1E(i=0;i<p.B;i++){7(!3&&p[i].H==8.2D){3=p[i];7(d.q("4b",3)){3.H=8.3z;d.q("4j",3)}}t{3b++}}7(3b==p.B){7(d.12!==8.1n){d.12=8.1n;d.q("2H")}d.q("73",p)}}}6 3y(3){3.1N=3.k>0?Q.1W(3.K/3.k*29):29;2i()}6 2i(){j i,3;z.3a();1E(i=0;i<p.B;i++){3=p[i];7(3.k!==1d){z.k+=3.2A;z.K+=3.K*3.2A/3.k}t{z.k=1d}7(3.H==8.2w){z.2B++}t 7(3.H==8.2z){z.3f++}t{z.3j++}}7(z.k===1d){z.1N=p.B>0?Q.1W(z.2B/p.B*29):0}t{z.3i=Q.1W(z.K/((+V 3u()-2m||1)/4X.0));z.1N=z.k>0?Q.1W(z.K/z.k*29):0}}6 2N(){j 3c=1f[0]||1D[0];7(3c){r 3c.6X().1X}r 14}6 3M(3,4a){7(3.19){j 1g=o.1t.2h(3.19);7(1g){r 1g.27(4a)}}r 14}6 3W(){d.J(\'4C\',3Y);d.J(\'3G\',4U);d.J(\'4b\',40);d.J(\'4j\',57);d.J(\'2y\',4y);d.J(\'2H\',4x);d.J(\'32\',2i);d.J(\'1k\',4w);d.J(\'4E\',4Z);d.J(\'2T\',4A)}6 3I(9,v){j h=d,1m=0,1a=[];j 1H={6W:9.M.1B,2W:9.1i,2Y:9.1q,1j:1j,30:9.1Y,3m:9.21};8.x(9.1i.3r(/\\s*,\\s*/),6(R){7(9[R]){1H[R]=9[R]}});7(9.23){8.x(9.23,6(18){1a.1c(6(v){j 13=V o.6V(8.Z({},1H,{m:9.3B,7e:9.22,38:9.38,23:18}));13.4k=6(){j 1g=o.1t.2h(d.19);o.Z(h.T,{2e:1g.27(\'3d\'),28:1g.27(\'6Y\'),22:1g.27(\'4q\')});1m++;1f.1c(d);v()};13.6Z=6(){h.3H(d.p)};13.J(\'4r 4s 4t 4p\',6(e){7(!1Q){7(9.3k){7(\'4r\'===e.W){o.2p(18,9.3k)}t 7(\'4s\'===e.W){o.2q(18,9.3k)}}7(9.3s){7(\'4t\'===e.W){o.2p(18,9.3s)}t 7(\'4p\'===e.W){o.2q(18,9.3s)}}}});13.J(\'1l 4n\',6(){13=X;v()});13.L()})})}7(9.2v){8.x(9.2v,6(18){1a.1c(6(v){j 1o=V o.72(8.Z({},1H,{71:18}));1o.4k=6(){j 1g=o.1t.2h(d.19);h.T.4l=1g.27(\'3t\');1m++;1D.1c(d);v()};1o.70=6(){h.3H(d.p)};1o.J(\'1l 4n\',6(){1o=X;v()});1o.L()})})}o.3C(1a,6(){7(1C(v)===\'6\'){v(1m)}})}6 52(y,1K,v){j 1I=V o.7d();7n{1I.4T=6(){1I.7m(1K.7p,1K.7f,1K.4g,1K.48)};1I.7i=6(){v(d.7k(y.W,1K.7g));d.11()};1I.4D=6(){v(y)};1I.7o(y)}7h(7l){v(y)}}6 2K(G,l,L){j h=d,3p=14;6 3n(G,l,L){j 42=9[G];7j(G){16\'1R\':7(G===\'1R\'){9.1R=9.M.1R=l}1O;16\'2k\':7(l=8.3v(l)){9[G]=l}1O;16\'M\':7(8.1z(l)===\'3F\'){l={1B:l}}7(L){8.Z(9.M,l)}t{9.M=l}7(l.1B){9.M.1B.3T=(6(M){j 2x=[];8.x(M,6(3U){8.x(3U.6T.3r(/,/),6(1P){7(/^\\s*\\*\\s*$/.3q(1P)){2x.1c(\'\\\\.*\')}t{2x.1c(\'\\\\.\'+1P.1J(V 3O(\'[\'+(\'/^$.*+?|()[]{}\\\\\'.1J(/./g,\'\\\\$&\'))+\']\',\'g\'),\'\\\\$&\'))}})});r V 3O(\'(\'+2x.6o(\'|\')+\')$\',\'i\')}(9.M.1B))}1O;16\'1w\':7(L){8.Z(9.1w,l,{2r:F})}t{9.1w=l}1O;16\'1Z\':9.1Z=9.M.1Z=!!l;1O;16\'23\':16\'2v\':l=8.2u(l);16\'38\':16\'1i\':16\'22\':16\'1Y\':16\'21\':9[G]=l;7(!L){3p=F}1O;6U:9[G]=l}7(!L){h.q(\'6n\',G,l,42)}}7(1C(G)===\'41\'){8.x(G,6(l,G){3n(G,l,L)})}t{3n(G,l,L)}7(L){9.1q=3o(8.Z({},9));1j=3o(8.Z({},9,{1q:F}))}t 7(3p){h.q(\'2T\');3I.17(h,9,6(1m){7(1m){h.R=o.1t.2h(2N()).W;h.q(\'20\',{R:h.R});h.q(\'4R\')}t{h.q(\'1k\',{1r:8.2L,1v:8.S(\'20 1l.\')})}})}}6 3Y(f,3Z){[].1c.4B(p,3Z);f.q(\'32\');f.36()}6 40(f,3){7(9.6m){j 3w=3.m.6l(/\\.([^.]+)$/),1P="6p";7(3w){1P=3w[1]}3.35=3.Y+\'.\'+1P}}6 57(f,3){j 1b=f.9.1b,1h=f.9.2k,2U=f.9.3E,T=f.T,P=0,y;7(3.K){P=3.K=1h*Q.6q(3.K/1h)}6 34(){7(2U-->0){1F(2j,4X)}t{3.K=P;f.q(\'1k\',{1r:8.4V,1v:8.S(\'6u 1k.\'),3:3,2Q:w.2P,H:w.H,37:w.33()})}}6 2j(){j 1p,1T,15,1V;7(3.H==8.2w||3.H==8.2z||f.12==8.1n){r}15={m:3.35||3.m};7(1h&&T.2e&&y.k>1h){1V=Q.2S(1h,y.k-P);1p=y.4F(P,P+1V)}t{1V=y.k;1p=y}7(1h&&T.2e){7(f.9.4e){15.6t=Q.1W(P/1h);15.2e=Q.1W(y.k/1h)}t{15.P=P;15.z=y.k}}w=V o.6s();7(w.50){w.50.6r=6(e){3.K=Q.2S(3.k,P+e.K);f.q(\'2y\',3)}}w.4T=6(){7(w.H>=4Q){34();r}2U=f.9.3E;7(1V<y.k){1p.11();P+=1V;3.K=Q.2S(P,y.k);f.q(\'6k\',3,{P:3.K,z:y.k,2Q:w.2P,H:w.H,37:w.33()});7(o.6j.68===\'6b 6a\'){f.q(\'2y\',3)}}t{3.K=3.k}1p=1T=X;7(!P||P>=y.k){7(3.k!=3.2A){y.11();y=X}f.q(\'2y\',3);3.H=8.2w;f.q(\'4E\',3,{2Q:w.2P,H:w.H,37:w.33()})}t{1F(2j,1)}};w.4D=6(){34()};w.69=6(){d.11();w=X};7(f.9.28&&T.28){15.m=3.35||3.m;w.4O("4N",1b,F);8.x(f.9.31,6(l,m){w.2X(m,l)});1T=V o.6d();8.x(8.Z(15,f.9.4L),6(l,m){1T.4I(m,l)});1T.4I(f.9.3B,1p);w.55(1T,{2W:f.9.1i,2Y:f.9.1q,1j:1j,30:f.9.1Y,3m:f.9.21})}t{1b=8.4K(f.9.1b,8.Z(15,f.9.4L));w.4O("4N",1b,F);w.2X(\'6e-6i\',\'6h/6g-6f\');8.x(f.9.31,6(l,m){w.2X(m,l)});w.55(1p,{2W:f.9.1i,2Y:f.9.1q,1j:1j,30:f.9.1Y,3m:f.9.21})}}y=3.1L();7(f.9.1w.2r&&3M(y,\'2g\')&&!!~o.26(y.W,[\'4S/6v\',\'4S/6w\'])){52.17(d,y,f.9.1w,6(3A){y=3A;3.k=3A.k;2j()})}t{2j()}}6 4y(f,3){3y(3)}6 4x(f){7(f.12==8.1u){2m=(+V 3u())}t 7(f.12==8.1n){1E(j i=f.p.B-1;i>=0;i--){7(f.p[i].H==8.3z){f.p[i].H=8.2D;2i()}}}}6 4U(){7(w){w.6M()}}6 4Z(f){2i();1F(6(){2O.17(f)},1)}6 4w(f,1G){7(1G.3){1G.3.H=8.2z;3y(1G.3);7(f.12==8.1u){f.q(\'3G\');1F(6(){2O.17(f)},1)}}}6 4A(f){f.2Z();8.x(p,6(3){3.11()});p=[];7(1f.B){8.x(1f,6(13){13.11()});1f=[]}7(1D.B){8.x(1D,6(1o){1o.11()});1D=[]}1j={};1Q=14;2m=w=X;z.3a()}9={1i:o.1t.6L,3E:0,2k:0,28:F,22:F,3B:\'3\',1Y:\'47/4m.6K\',21:\'47/4m.6J\',M:{1B:[],1Z:14,1R:0},1w:{2r:14,48:F,4g:14},4e:F};2K.17(d,1H,X,F);z=V 8.4d();8.Z(d,{Y:1X,1X:1X,12:8.1n,T:{},R:X,p:p,9:9,z:z,L:6(){j h=d;7(1C(9.3J)=="6"){9.3J(h)}t{8.x(9.3J,6(1U,m){h.J(m,1U)})}7(!9.23||!9.1b){d.q(\'1k\',{1r:8.2L,1v:8.S(\'20 1l.\')});r}3W.17(d);3I.17(d,9,6(1m){7(1C(9.L)=="6"){9.L(h)}t{8.x(9.L,6(1U,m){h.J(m,1U)})}7(1m){h.R=o.1t.2h(2N()).W;h.q(\'20\',{R:h.R});h.q(\'4R\')}t{h.q(\'1k\',{1r:8.2L,1v:8.S(\'20 1l.\')})}})},2K:6(G,l){2K.17(d,G,l,!d.R)},3X:6(G){7(!G){r 9}r 9[G]},36:6(){7(1f.B){8.x(1f,6(13){13.q(\'4i\')})}d.q(\'4i\')},24:6(){7(d.12!=8.1u){d.12=8.1u;d.q(\'2H\');2O.17(d)}},2Z:6(){7(d.12!=8.1n){d.12=8.1n;d.q(\'2H\');d.q(\'3G\')}},6N:6(){1Q=2R[0]!==1d?2R[0]:F;7(1f.B){8.x(1f,6(13){13.6O(1Q)})}d.q(\'6S\',1Q)},6R:6(Y){j i;1E(i=p.B-1;i>=0;i--){7(p[i].Y===Y){r p[i]}}},3H:6(3,2f){j h=d,1a=[],p=[],19;6 4Y(3,v){j 1a=[];o.x(h.9.M,6(3R,m){7(2F[m]){1a.1c(6(v){2F[m].17(h,3R,3,6(3P){v(!3P)})})}});o.3C(1a,v)}6 1y(3){j W=o.1z(3);7(3 3D o.1x){7(!3.19&&!3.6Q()){7(!19){r 14}3.19=19;3.6P(19)}1y(V 8.1x(3))}t 7(3 3D o.6I){1y(3.1L());3.11()}t 7(3 3D 8.1x){7(2f){3.m=2f}1a.1c(6(v){4Y(3,6(1G){7(!1G){p.1c(3);h.q("6H",3)}1F(v,1)})})}t 7(o.26(W,[\'3\',\'y\'])!==-1){1y(V o.1x(X,3))}t 7(W===\'6A\'&&o.1z(3.p)===\'6z\'){o.x(3.p,1y)}t 7(W===\'3F\'){2f=X;o.x(3,1y)}}19=2N();1y(3);7(1a.B){o.3C(1a,6(){7(p.B){h.q("4C",p)}})}},6y:6(3){j Y=1C(3)===\'4H\'?3:3.Y;1E(j i=p.B-1;i>=0;i--){7(p[i].Y===Y){r d.2C(i,1)[0]}}},2C:6(24,B){j 2G=p.2C(24===1d?0:24,B===1d?p.B:B);j 2V=14;7(d.12==8.1u){2V=F;d.2Z()}d.q("6x",2G);8.x(2G,6(3){3.11()});d.q("32");d.36();7(2V){d.24()}r 2G},J:6(m,1U,54){j h=d;8.2J.4W.J.17(d,m,6(){j 15=[].4F.17(2R);15.2C(0,1,h);r 1U.4B(d,15)},0,54)},11:6(){d.q(\'2T\');9=z=X;d.6B()}})};8.2J.4W=o.6C.6G;8.1x=(6(){j 25={};6 49(3){8.Z(d,{Y:8.2I(),m:3.m||3.2f,W:3.W||\'\',k:3.k||3.46,2A:3.k||3.46,K:0,1N:0,H:8.2D,3L:3.3L||(V 3u()).6F(),6E:6(){j 3=d.1L().1L();r o.26(o.1z(3),[\'y\',\'3\'])!==-1?3:X},1L:6(){7(!25[d.Y]){r X}r 25[d.Y]},11:6(){j 3l=d.1L();7(3l){3l.11();6D 25[d.Y]}}});25[d.Y]=3}r 49}());8.4d=6(){j h=d;h.k=0;h.K=0;h.2B=0;h.3f=0;h.3j=0;h.1N=0;h.3i=0;h.3a=6(){h.k=h.K=h.2B=h.3f=h.3j=h.1N=h.3i=0}};2M.8=8}(2M,6c));',62,460,'|||file|||function|if|plupload|settings||||this||up||self||var|size|value|name|||files|trigger|return||else||cb|xhr|each|blob|total||length||||true|option|status||bind|loaded|init|filters|||offset|Math|runtime|translate|features||new|type|null|id|extend||destroy|state|fileInput|false|args|case|call|el|ruid|queue|url|push|undef|feature|fileInputs|info|chunkSize|runtimes|preferred_caps|Error|error|inited|STOPPED|fileDrop|chunkBlob|required_features|code|boundary|Runtime|STARTED|message|resize|File|resolveFile|typeOf|caps|mime_types|typeof|fileDrops|for|delay|err|options|img|replace|params|getSource|round|percent|break|ext|disabled|max_file_size|ids|formData|func|curChunkSize|ceil|uid|flash_swf_url|prevent_duplicates|Init|silverlight_xap_url|multi_selection|browse_button|start|filepool|inArray|can|multipart|100|maxSize|query|1024|lookup|chunks|fileName|send_binary_string|getInfo|calc|uploadNextChunk|chunk_size|els|startTime|ii|addFileFilter|addClass|removeClass|enabled|str|chr|get|drop_element|DONE|extensionsRegExp|UploadProgress|FAILED|origSize|uploaded|splice|QUEUED|resolve|fileFilters|removed|StateChanged|guid|Uploader|setOption|INIT_ERROR|window|getRUID|uploadNext|responseText|response|arguments|min|Destroy|retries|restartRequired|runtime_order|setRequestHeader|required_caps|stop|swf_url|headers|QueueChanged|getAllResponseHeaders|handleError|target_name|refresh|responseHeaders|container||reset|count|ctrl|slice_blob|config|failed|precision|pow|bytesPerSec|queued|browse_button_hover|src|xap_url|_setOption|normalizeCaps|reinitRequired|test|split|browse_button_active|drag_and_drop|Date|parseSize|matches|xmlEncodeChars|calcFile|UPLOADING|resizedBlob|file_data_name|inSeries|instanceof|max_retries|array|CancelUpload|addFile|initControls|preinit|map|lastModifiedDate|runtimeCan|encodeURIComponent|RegExp|res|removeAllEvents|rule|items|regexp|filter|addEvent|bindEventListeners|getOption|onFilesAdded|filteredFiles|onBeforeUpload|object|oldValue|300|getStyle|hasClass|fileSize|js|preserve_headers|PluploadFile|cap|BeforeUpload|FILE_DUPLICATE_ERROR|QueueProgress|send_chunk_number|FILE_SIZE_ERROR|crop|while|Refresh|UploadFile|onready|dragdrop|Moxie|runtimeerror|isEmptyObj|mouseup|select_multiple|mouseenter|mouseleave|mousedown|FILE_EXTENSION_ERROR|removeEvent|onError|onStateChanged|onUploadProgress|addI18n|onDestroy|apply|FilesAdded|onerror|FileUploaded|slice|num|string|append|getSize|buildUrl|multipart_params|ua|post|open|getPos|400|PostInit|image|onload|onCancelUpload|HTTP_ERROR|prototype|1000|filterFile|onFileUploaded|upload|strict|resizeImage|xmlEncodeRegExp|scope|send|toArray|onUploadFile|362|370|331|500|330|702|IMAGE_MEMORY_ERROR|IMAGE_DIMENSIONS_ERROR|gi|setTimeout|indexOf|formatSize|701|summon_file_dialog|9_|z0|374|mimes|371|mimeTypes|600|_|SECURITY_ERROR|334|pngresize|gt|cleanName|602|lt|306|xmlEncode|346|340|amp|quot|triggerDialog|IMAGE_FORMAT_ERROR|send_binary|canSendBinary|VERSION|200|GENERIC_ERROR|307|send_custom_headers|321|357|progress|601|jpgresize|361|700|IO_ERROR|report_upload_progress|354|313|310|347|350|353|317|314|322|browser|onloadend|Browser|Android|mOxie|FormData|Content|stream|octet|application|Type|Env|ChunkUploaded|match|unique_names|OptionChanged|join|part|floor|onprogress|XMLHttpRequest|chunk|HTTP|jpeg|png|FilesRemoved|removeFile|filelist|node|unbindAll|EventTarget|delete|getNative|toLocaleString|instance|FileFiltered|Blob|xap|swf|order|abort|disableBrowse|disable|connectRuntime|isDetached|getFile|DisableBrowse|extensions|default|FileInput|accept|getRuntime|send_multipart|onchange|ondrop|drop_zone|FileDrop|UploadComplete|Duplicate|mb|gb|tb|kb|parseSizeStr|extension|thatCan|predictRuntime|Image|multiple|height|quality|catch|onresize|switch|getAsBlob|ex|downsize|try|load|width'.split('|'),0,{})) diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/styles.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/styles.css index ee99f9ba8f70e9d181267499014121495c169582..bc362ab6cfee2f09a9037f8b9e45c5e154af1c44 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/styles.css +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/styles.css @@ -1,5 +1,5 @@ #gallery_selection { - background-color: #EFEFEF; + background-color: #fff; padding: 7px; } @@ -9,6 +9,10 @@ top: -1px; } +#gallery_selection .plupload_buttons a { + margin-right: 4px; +} + #gallery_name { width: auto; min-width: 200px; diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/styles.min.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/styles.min.css new file mode 100644 index 0000000000000000000000000000000000000000..fc0bf8ea102f2371a747dbc953c3b779fd99551d --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/styles.min.css @@ -0,0 +1 @@ +#gallery_selection{background-color:#fff;padding:7px}#gallery_selection label{font-weight:600;position:relative;top:-1px}#gallery_selection .plupload_buttons a{margin-right:4px}#gallery_name{width:auto;min-width:200px}#gallery_name.error{border:solid 1px red}#upload_images_content{padding:0}#upload_images_content .plupload_container{padding:0}.plupload_header{display:none}.plupload_buttons{display:inline}.plupload_droptext{font-size:16px;color:silver} \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/templates/import_folder.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/templates/import_folder.php index 7501cef2ea4d216c07d084efa70b31b5bb3ae966..b18bbcdbb7ffe411e96ff7ff5f3ab4cd326ba0ec 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/templates/import_folder.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/templates/import_folder.php @@ -13,11 +13,15 @@ $(window).data('ready', true); else return; + // Post params + var browse_params = <?php echo $browse_sec_token->get_json() ?>; + browse_params.action = 'browse_folder'; + // Render file browser $('#file_browser').fileTree({ root: '/', script: photocrati_ajax.url, - post_params: {action: 'browse_folder', token: ''} + post_params: browse_params }, function(file){ selected_folder = file; $('#file_browser a').each(function(){ @@ -42,11 +46,11 @@ }); // Start importing process - var post_params = { - action: 'import_folder', - folder: selected_folder, - keep_location: $('#import_keep_location').is(":checked") ? 'on' : 'off' - }; + var post_params = <?php echo $import_sec_token->get_json()?>; + post_params.action = 'import_folder'; + post_params.folder = selected_folder; + post_params.keep_location = $('#import_keep_location').is(":checked") ? 'on' : 'off'; + $.post(photocrati_ajax.url, post_params, function(response){ if (typeof(response) != 'object') response = JSON.parse(response); if (typeof(response.error) == 'string') { diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/templates/import_media_library.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/templates/import_media_library.php new file mode 100644 index 0000000000000000000000000000000000000000..ac157d51cf445ce28b87a2928ee855e1848f1425 --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/templates/import_media_library.php @@ -0,0 +1,16 @@ +<?php $i18n['isavalidvar'] = true; // make my editor shutup about invalid variables ?> +<div id="ngg-importML-gallery-selection"> + <label for="ngg-importML-gallery-id"><?php _e('Gallery', 'nggallery'); ?></label> + <select id="ngg-importML-gallery-id"> + <option value="0"><?php _e('Create a new gallery', 'nggallery'); ?></option> + <?php foreach ($galleries as $gallery): ?> + <option value="<?php echo esc_attr($gallery->{$gallery->id_field}) ?>"><?php echo esc_attr($gallery->title) ?></option> + <?php endforeach ?> + </select> + <input type="text" id="ngg-importML-gallery-name" name="gallery_name"/> +</div> + +<button id='ngg-importML-select-opener' + class='button-primary hidden'><?php echo $i18n['select-opener']; ?></button> +<button id='ngg-importML-selected-image-import' + class='button-primary hidden'><?php echo $i18n['import_singular']; ?></button> \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/templates/upload_images.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/templates/upload_images.php index 7e2a2cf12e94101fb90ad790ca98bde36b802faa..65938256bf037561019f43c81c8239f7f94a1082 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/templates/upload_images.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/templates/upload_images.php @@ -10,7 +10,7 @@ </div> <div id="uploader"> - <p><?php _e("You browser doesn't have Flash, Silverlight, HTML5, or HTML4 support.", 'nggallery'); ?></p> + <p><?php _e("Your browser doesn't have Silverlight, HTML5, or HTML4 support.", 'nggallery'); ?></p> </div> <script type="text/javascript"> // Listen for events emitted in other frames @@ -43,8 +43,11 @@ // Sets the plupload url with necessary parameters in the QS window.set_plupload_url = function(gallery_id, gallery_name) { - var qs = "?action=upload_image&gallery_id="+urlencode(gallery_id); + var qs = "&action=upload_image&gallery_id="+urlencode(gallery_id); qs += "&gallery_name="+urlencode(gallery_name); + <?php foreach ($sec_token->get_request_list() as $name=>$value): ?> + qs += "&<?php echo $name?>=<?php echo $value?>"; + <?php endforeach ?> return photocrati_ajax.url + qs; }; @@ -227,7 +230,7 @@ var option = $('<option/>').attr('value', response.gallery_id).html(response.gallery_name); $gallery_id.append(option); $gallery_id.val(response.gallery_id); - option.attr('selected', 'selected'); + option.prop('selected', true); } // our Frame-Event-Publisher hooks onto the jQuery ajaxComplete action which plupload diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/module.nextgen_admin.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/module.nextgen_admin.php index 0e1cbd186d07d20d7ae2631d8830f3167c9ee0be..e57be548c5e78102c250ffd7b57a5d237b4d79a7 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/module.nextgen_admin.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/module.nextgen_admin.php @@ -19,16 +19,14 @@ class M_NextGen_Admin extends C_Base_Module 'photocrati-nextgen_admin', 'NextGEN Administration', 'Provides a framework for adding Administration pages', - '0.7', + '0.9', 'http://www.nextgen-gallery.com', 'Photocrati Media', 'http://www.photocrati.com' ); - include_once('class.nextgen_admin_installer.php'); C_Photocrati_Installer::add_handler($this->module_id, 'C_NextGen_Admin_Installer'); - include_once('class.nextgen_admin_option_handler.php'); C_NextGen_Settings::get_instance()->add_option_handler('C_NextGen_Admin_Option_Handler', array( 'jquery_ui_theme', 'jquery_ui_theme_version', @@ -46,28 +44,28 @@ class M_NextGen_Admin extends C_Base_Module */ function _register_utilities() { - // Provides a NextGEN Administation page - $this->get_registry()->add_utility( - 'I_NextGen_Admin_Page', - 'C_NextGen_Admin_Page_Controller' - ); + // Provides a NextGEN Administation page + $this->get_registry()->add_utility( + 'I_NextGen_Admin_Page', + 'C_NextGen_Admin_Page_Controller' + ); - $this->get_registry()->add_utility( - 'I_Page_Manager', - 'C_Page_Manager' - ); + $this->get_registry()->add_utility( + 'I_Page_Manager', + 'C_Page_Manager' + ); - // Provides a form manager - $this->get_registry()->add_utility( - 'I_Form_Manager', - 'C_Form_Manager' - ); + // Provides a form manager + $this->get_registry()->add_utility( + 'I_Form_Manager', + 'C_Form_Manager' + ); - // Provides a form - $this->get_registry()->add_utility( - 'I_Form', - 'C_Form' - ); + // Provides a form + $this->get_registry()->add_utility( + 'I_Form', + 'C_Form' + ); } /** @@ -80,15 +78,13 @@ class M_NextGen_Admin extends C_Base_Module 'A_MVC_Validation' ); - $this->get_registry()->add_adapter( - 'I_Router', - 'A_NextGen_Settings_Routes' - ); - - $this->get_registry()->add_adapter( - 'I_Page_Manager', - 'A_NextGen_Admin_Default_Pages' - ); + if (is_admin()) { + $this->get_registry('I_NextGen_Admin_Page', 'A_Fs_Access_Page', NGG_FS_ACCESS_SLUG); + $this->get_registry()->add_adapter( + 'I_Page_Manager', + 'A_NextGen_Admin_Default_Pages' + ); + } } /** @@ -101,11 +97,27 @@ class M_NextGen_Admin extends C_Base_Module // Provides menu options for managing NextGEN Settings add_action('admin_menu', array(&$this, 'add_menu_pages'), 999); + + // Define routes + add_action('ngg_routes', array(&$this, 'define_routes')); + + // Provides admin notices + $notices = C_Admin_Notification_Manager::get_instance(); + add_action('init', array($notices, 'serve_ajax_request')); + add_action('admin_footer', array($notices, 'enqueue_scripts')); + add_action('all_admin_notices', array($notices, 'render')); } + function define_routes($router) + { + // TODO: Why is this in the nextgen-admin module? Shouldn't it be in the other options module? + $router->create_app('/nextgen-settings') + ->route('/update_watermark_preview', 'I_Settings_Manager_Controller#watermark_update'); + } + function register_scripts() { - $router = $this->get_registry()->get_utility('I_Router'); + $router = C_Router::get_instance(); wp_register_script('gritter', $router->get_static_url('photocrati-nextgen_admin#gritter/gritter.min.js'), array('jquery')); wp_register_style('gritter', $router->get_static_url('photocrati-nextgen_admin#gritter/css/gritter.css')); wp_register_script('ngg_progressbar', $router->get_static_url('photocrati-nextgen_admin#ngg_progressbar.js'), array('gritter')); @@ -123,6 +135,8 @@ class M_NextGen_Admin extends C_Base_Module wp_enqueue_script('ngg_progressbar'); wp_enqueue_style('ngg_progressbar'); } + + wp_register_style('ngg-jquery-ui', $router->get_static_url('photocrati-nextgen_admin#jquery-ui/jquery-ui-1.10.4.custom.css')); } /** @@ -131,14 +145,14 @@ class M_NextGen_Admin extends C_Base_Module */ function add_menu_pages() { - $this->get_registry()->get_utility('I_Page_Manager')->setup(); + C_Page_Manager::get_instance()->setup(); } function get_type_list() { return array( 'A_Fs_Access_Page' => 'adapter.fs_access_page.php', - 'A_Mvc_Validation' => 'adapter.mvc_validation.php', + 'A_MVC_Validation' => 'adapter.mvc_validation.php', 'C_Nextgen_Admin_Installer' => 'class.nextgen_admin_installer.php', 'A_Nextgen_Admin_Default_Pages' => 'adapter.nextgen_admin_default_pages.php', 'A_Nextgen_Settings_Routes' => 'adapter.nextgen_settings_routes.php', @@ -146,13 +160,72 @@ class M_NextGen_Admin extends C_Base_Module 'C_Form_Manager' => 'class.form_manager.php', 'C_Nextgen_Admin_Page_Controller' => 'class.nextgen_admin_page_controller.php', 'C_Page_Manager' => 'class.page_manager.php', - 'I_Form' => 'interface.form.php', - 'I_Form_Manager' => 'interface.form_manager.php', - 'I_Nextgen_Admin_Page' => 'interface.nextgen_admin_page.php', - 'I_Nextgen_Settings' => 'interface.nextgen_settings.php', - 'I_Page_Manager' => 'interface.page_manager.php' + 'C_Admin_Notification_Manager' => 'class.admin_notification_manager.php' ); } } +class C_NextGen_Admin_Installer +{ + function install() + { + $settings = C_NextGen_Settings::get_instance(); + + // In version 0.2 of this module and earlier, the following values + // were statically set rather than dynamically using a handler. Therefore, we need + // to delete those static values + $module_name = 'photocrati-nextgen_admin'; + $modules = get_option('pope_module_list', array()); + if (!$modules) { + $modules = $settings->get('pope_module_list', array()); + } + + $cleanup = FALSE; + foreach ($modules as $module) { + if (strpos($module, $module_name) !== FALSE) { + if (version_compare(array_pop(explode('|', $module)), '0.3') == -1) { + $cleanup = TRUE; + } + break; + } + } + + if ($cleanup) { + $keys = array( + 'jquery_ui_theme', + 'jquery_ui_theme_version', + 'jquery_ui_theme_url' + ); + foreach ($keys as $key) $settings->delete($key); + } + } +} + +class C_NextGen_Admin_Option_Handler +{ + function get_router() + { + return C_Router::get_instance(); + } + + function get($key, $default=NULL) + { + $retval = $default; + + switch ($key) { + case 'jquery_ui_theme': + $retval = 'jquery-ui-nextgen'; + break; + case 'jquery_ui_theme_version': + $retval = '1.8'; + break; + case 'jquery_ui_theme_url': + $retval = $this->get_router()->get_static_url('photocrati-nextgen_admin#jquery-ui/jquery-ui-1.10.4.custom.css'); + break; + } + + return $retval; + } +} + new M_NextGen_Admin(); diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/package.module.nextgen_admin.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/package.module.nextgen_admin.php new file mode 100644 index 0000000000000000000000000000000000000000..c848f9fb224aebcf7cc75008965ed5a7109847a4 --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/package.module.nextgen_admin.php @@ -0,0 +1,905 @@ +<?php +// TODO: Finish the implementation +class A_Fs_Access_Page extends Mixin +{ + public function index_action() + { + $router = C_Router::get_instance(); + $url = $this->param('uri') ? $router->get_url($this->param('uri')) : admin_url('/admin.php?' . $router->get_querystring()); + // Request filesystem credentials from user + $creds = request_filesystem_credentials($url, '', FALSE, ABSPATH, array()); + if (WP_Filesystem($creds)) { + global $wp_filesystem; + } + } + /** + * Determines whether the given paths are writable + * @return boolean + */ + public function are_paths_writable() + { + $retval = TRUE; + $path = $this->object->param('path'); + if (!is_array($path)) { + $path = array($path); + } + foreach ($path as $p) { + if (!is_writable($p)) { + $retval = FALSE; + break; + } + } + return $retval; + } +} +/** + * Provides validation for datamapper entities within an MVC controller + */ +class A_MVC_Validation extends Mixin +{ + public function show_errors_for($entity, $return = FALSE) + { + $retval = ''; + if ($entity->is_invalid()) { + $retval = $this->object->render_partial('photocrati-nextgen_admin#entity_errors', array('entity' => $entity), $return); + } + return $retval; + } + public function show_success_for($entity, $message, $return = FALSE) + { + $retval = ''; + if ($entity->is_valid()) { + $retval = $this->object->render_partial('photocrati-nextgen_admin#entity_saved', array('entity' => $entity, 'message' => $message)); + } + return $retval; + } +} +class A_NextGen_Admin_Default_Pages extends Mixin +{ + public function setup() + { + $this->object->add(NGG_FS_ACCESS_SLUG, array('adapter' => 'A_Fs_Access_Page', 'parent' => NGGFOLDER, 'add_menu' => FALSE)); + return $this->call_parent('setup'); + } +} +class C_Admin_Notification_Manager +{ + public $_notifications = array(); + public $_displayed_notice = FALSE; + public $_dismiss_url = NULL; + static $_instance = NULL; + static function get_instance() + { + if (!isset(self::$_instance)) { + $klass = get_class(); + self::$_instance = new $klass(); + } + return self::$_instance; + } + public function __construct() + { + $this->_dismiss_url = site_url('/?ngg_dismiss_notice=1'); + } + public function has_displayed_notice() + { + return $this->_displayed_notice; + } + public function add($name, $handler) + { + $this->_notifications[$name] = $handler; + } + public function remove($name) + { + unset($this->_notifications[$name]); + } + public function render() + { + $output = array(); + foreach (array_keys($this->_notifications) as $notice) { + if ($html = $this->render_notice($notice)) { + $output[] = $html; + } + } + echo implode(' +', $output); + } + public function is_dismissed($name) + { + $retval = FALSE; + $settings = C_NextGen_Settings::get_instance(); + $dismissed = $settings->get('dismissed_notifications', array()); + if (isset($dismissed[$name])) { + if ($id = get_current_user_id()) { + if (in_array($id, $dismissed[$name])) { + $retval = TRUE; + } else { + if (in_array('unknown', $dismissed[$name])) { + $retval = TRUE; + } + } + } + } + return $retval; + } + public function dismiss($name) + { + $retval = FALSE; + if ($handler = $this->get_handler_instance($name)) { + $has_method = method_exists($handler, 'is_dismissable'); + if ($has_method && $handler->is_dismissable() || !$has_method) { + $settings = C_NextGen_Settings::get_instance(); + $dismissed = $settings->get('dismissed_notifications', array()); + if (!isset($dismissed[$name])) { + $dismissed[$name] = array(); + } + $user_id = get_current_user_id(); + $dismissed[$name][] = $user_id ? $user_id : 'unknown'; + $settings->set('dismissed_notifications', $dismissed); + $settings->save(); + $retval = TRUE; + } + } + return $retval; + } + public function get_handler_instance($name) + { + $retval = NULL; + if (isset($this->_notifications[$name]) && ($handler = $this->_notifications[$name])) { + if (class_exists($handler)) { + $retval = call_user_func(array($handler, 'get_instance'), $name); + } + } + return $retval; + } + public function enqueue_scripts() + { + if ($this->has_displayed_notice()) { + $router = C_Router::get_instance(); + wp_enqueue_script('ngg_admin_notices', $router->get_static_url('photocrati-nextgen_admin#admin_notices.js'), array(), FALSE, TRUE); + wp_localize_script('ngg_admin_notices', 'ngg_dismiss_url', $this->_dismiss_url); + } + } + public function serve_ajax_request() + { + $retval = array('failure' => TRUE); + if (isset($_REQUEST['ngg_dismiss_notice'])) { + header('Content-Type: application/json'); + // ob_start(); + if (isset($_REQUEST['name']) && $this->dismiss($_REQUEST['name'])) { + $retval = array('success' => TRUE); + } else { + $retval['msg'] = __('Not a valid notice name', 'nggallery'); + } + // ob_end_clean(); + echo json_encode($retval); + throw new E_Clean_Exit(); + } + } + public function render_notice($name) + { + $retval = ''; + if (($handler = $this->get_handler_instance($name)) && !$this->is_dismissed($name)) { + // Does the handler want to render? + $has_method = method_exists($handler, 'is_renderable'); + if ($has_method && $handler->is_renderable() || !$has_method) { + $view = new C_MVC_View('photocrati-nextgen_admin#admin_notice', array('css_class' => method_exists($handler, 'get_css_class') ? $handler->get_css_class() : 'updated', 'is_dismissable' => method_exists($handler, 'is_dismissable') ? $handler->is_dismissable() : FALSE, 'html' => method_exists($handler, 'render') ? $handler->render() : '', 'notice_name' => $name)); + $retval = $view->render(TRUE); + $this->_displayed_notice = TRUE; + } + } + return $retval; + } +} +class C_Form extends C_MVC_Controller +{ + static $_instances = array(); + public $page = NULL; + /** + * Gets an instance of a form + * @param string $context + * @return C_Form + */ + static function &get_instance($context) + { + if (!isset(self::$_instances[$context])) { + $klass = get_class(); + self::$_instances[$context] = new $klass($context); + } + return self::$_instances[$context]; + } + /** + * Defines the form + * @param string $context + */ + public function define($context) + { + parent::define($context); + $this->add_mixin('Mixin_Form_Instance_Methods'); + $this->add_mixin('Mixin_Form_Field_Generators'); + $this->implement('I_Form'); + } +} +class Mixin_Form_Instance_Methods extends Mixin +{ + /** + * Enqueues any static resources required by the form + */ + public function enqueue_static_resources() + { + } + /** + * Gets a list of fields to render + * @return array + */ + public function _get_field_names() + { + return array(); + } + public function get_id() + { + return $this->object->context; + } + public function get_title() + { + return $this->object->context; + } + /** + * Saves the form/model + * @param array $attributes + * @return type + */ + public function save_action($attributes = array()) + { + if (!$attributes) { + $attributes = array(); + } + if ($this->object->has_method('get_model') && $this->object->get_model()) { + return $this->object->get_model()->save($attributes); + } else { + return TRUE; + } + } + /** + * Returns the rendered form + */ + public function render($wrap = TRUE) + { + $fields = array(); + foreach ($this->object->_get_field_names() as $field) { + $method = "_render_{$field}_field"; + if ($this->object->has_method($method)) { + $fields[] = $this->object->{$method}($this->object->get_model()); + } + } + return $this->object->render_partial('photocrati-nextgen_admin#form', array('fields' => $fields, 'wrap' => $wrap), TRUE); + } + public function get_model() + { + return $this->object->page->has_method('get_model') ? $this->object->page->get_model() : NULL; + } +} +/** + * Provides some default field generators for forms to use + */ +class Mixin_Form_Field_Generators extends Mixin +{ + public function _render_select_field($display_type, $name, $label, $options = array(), $value, $text = '', $hidden = FALSE) + { + return $this->object->render_partial('photocrati-nextgen_admin#field_generator/nextgen_settings_field_select', array('display_type_name' => $display_type->name, 'name' => $name, 'label' => $label, 'options' => $options, 'value' => $value, 'text' => $text, 'hidden' => $hidden), True); + } + public function _render_radio_field($display_type, $name, $label, $value, $text = '', $hidden = FALSE) + { + return $this->object->render_partial('photocrati-nextgen_admin#field_generator/nextgen_settings_field_radio', array('display_type_name' => $display_type->name, 'name' => $name, 'label' => $label, 'value' => $value, 'text' => $text, 'hidden' => $hidden), True); + } + public function _render_number_field($display_type, $name, $label, $value, $text = '', $hidden = FALSE, $placeholder = '', $min = NULL, $max = NULL) + { + return $this->object->render_partial('photocrati-nextgen_admin#field_generator/nextgen_settings_field_number', array('display_type_name' => $display_type->name, 'name' => $name, 'label' => $label, 'value' => $value, 'text' => $text, 'hidden' => $hidden, 'placeholder' => $placeholder, 'min' => $min, 'max' => $max), True); + } + public function _render_text_field($display_type, $name, $label, $value, $text = '', $hidden = FALSE, $placeholder = '') + { + return $this->object->render_partial('photocrati-nextgen_admin#field_generator/nextgen_settings_field_text', array('display_type_name' => $display_type->name, 'name' => $name, 'label' => $label, 'value' => $value, 'text' => $text, 'hidden' => $hidden, 'placeholder' => $placeholder), True); + } + public function _render_textarea_field($display_type, $name, $label, $value, $text = '', $hidden = FALSE, $placeholder = '') + { + return $this->object->render_partial('photocrati-nextgen_admin#field_generator/nextgen_settings_field_textarea', array('display_type_name' => $display_type->name, 'name' => $name, 'label' => $label, 'value' => $value, 'text' => $text, 'hidden' => $hidden, 'placeholder' => $placeholder), True); + } + public function _render_color_field($display_type, $name, $label, $value, $text = '', $hidden = FALSE) + { + return $this->object->render_partial('photocrati-nextgen_admin#field_generator/nextgen_settings_field_color', array('display_type_name' => $display_type->name, 'name' => $name, 'label' => $label, 'value' => $value, 'text' => $text, 'hidden' => $hidden), True); + } + public function _render_ajax_pagination_field($display_type) + { + return $this->object->_render_radio_field($display_type, 'ajax_pagination', __('Enable AJAX pagination', 'nggallery'), isset($display_type->settings['ajax_pagination']) ? $display_type->settings['ajax_pagination'] : FALSE); + } + public function _render_thumbnail_override_settings_field($display_type) + { + $hidden = !(isset($display_type->settings['override_thumbnail_settings']) ? $display_type->settings['override_thumbnail_settings'] : FALSE); + $override_field = $this->_render_radio_field($display_type, 'override_thumbnail_settings', __('Override thumbnail settings', 'nggallery'), isset($display_type->settings['override_thumbnail_settings']) ? $display_type->settings['override_thumbnail_settings'] : FALSE, __('This does not affect existing thumbnails; overriding the thumbnail settings will create an additional set of thumbnails. To change the size of existing thumbnails please visit \'Manage Galleries\' and choose \'Create new thumbnails\' for all images in the gallery.', 'nggallery')); + $dimensions_field = $this->object->render_partial('photocrati-nextgen_admin#field_generator/thumbnail_settings', array('display_type_name' => $display_type->name, 'name' => 'thumbnail_dimensions', 'label' => __('Thumbnail dimensions', 'nggallery'), 'thumbnail_width' => isset($display_type->settings['thumbnail_width']) ? $display_type->settings['thumbnail_width'] : 0, 'thumbnail_height' => isset($display_type->settings['thumbnail_height']) ? $display_type->settings['thumbnail_height'] : 0, 'hidden' => $hidden ? 'hidden' : '', 'text' => ''), TRUE); + /* + $qualities = array(); + for ($i = 100; $i > 40; $i -= 5) { $qualities[$i] = "{$i}%"; } + $quality_field = $this->_render_select_field( + $display_type, + 'thumbnail_quality', + __('Thumbnail quality', 'nggallery'), + $qualities, + isset($display_type->settings['thumbnail_quality']) ? $display_type->settings['thumbnail_quality'] : 100, + '', + $hidden + ); + */ + $crop_field = $this->_render_radio_field($display_type, 'thumbnail_crop', __('Thumbnail crop', 'nggallery'), isset($display_type->settings['thumbnail_crop']) ? $display_type->settings['thumbnail_crop'] : FALSE, '', $hidden); + /* + $watermark_field = $this->_render_radio_field( + $display_type, + 'thumbnail_watermark', + __('Thumbnail watermark', 'nggallery'), + isset($display_type->settings['thumbnail_watermark']) ? $display_type->settings['thumbnail_watermark'] : FALSE, + '', + $hidden + ); + */ + $everything = $override_field . $dimensions_field . $crop_field; + return $everything; + } + /** + * Renders the thumbnail override settings field(s) + * + * @param C_Display_Type $display_type + * @return string + */ + public function _render_image_override_settings_field($display_type) + { + $hidden = !(isset($display_type->settings['override_image_settings']) ? $display_type->settings['override_image_settings'] : FALSE); + $override_field = $this->_render_radio_field($display_type, 'override_image_settings', __('Override image settings', 'nggallery'), isset($display_type->settings['override_image_settings']) ? $display_type->settings['override_image_settings'] : 0, __('Overriding the image settings will create an additional set of images', 'nggallery')); + $qualities = array(); + for ($i = 100; $i > 40; $i -= 5) { + $qualities[$i] = "{$i}%"; + } + $quality_field = $this->_render_select_field($display_type, 'image_quality', __('Image quality', 'nggallery'), $qualities, $display_type->settings['image_quality'], '', $hidden); + $crop_field = $this->_render_radio_field($display_type, 'image_crop', __('Image crop', 'nggallery'), $display_type->settings['image_crop'], '', $hidden); + $watermark_field = $this->_render_radio_field($display_type, 'image_watermark', __('Image watermark', 'nggallery'), $display_type->settings['image_watermark'], '', $hidden); + $everything = $override_field . $quality_field . $crop_field . $watermark_field; + return $everything; + } + /** + * Renders a pair of fields for width and width-units (px, em, etc) + * + * @param C_Display_Type $display_type + * @return string + */ + public function _render_width_and_unit_field($display_type) + { + return $this->object->render_partial('photocrati-nextgen_admin#field_generator/nextgen_settings_field_width_and_unit', array('display_type_name' => $display_type->name, 'name' => 'width', 'label' => __('Gallery width', 'nggallery'), 'value' => $display_type->settings['width'], 'text' => __('An empty or 0 setting will make the gallery full width', 'nggallery'), 'placeholder' => __('(optional)', 'nggallery'), 'unit_name' => 'width_unit', 'unit_value' => $display_type->settings['width_unit'], 'options' => array('px' => __('Pixels', 'nggallery'), '%' => __('Percent', 'nggallery'))), TRUE); + } + public function _get_aspect_ratio_options() + { + return array('first_image' => __('First Image', 'nggallery'), 'image_average' => __('Average', 'nggallery'), '1.5' => '3:2 [1.5]', '1.333' => '4:3 [1.333]', '1.777' => '16:9 [1.777]', '1.6' => '16:10 [1.6]', '1.85' => '1.85:1 [1.85]', '2.39' => '2.39:1 [2.39]', '1.81' => '1.81:1 [1.81]', '1' => '1:1 (Square) [1]'); + } +} +class C_Form_Manager extends C_Component +{ + static $_instances = array(); + public $_forms = array(); + /** + * Returns an instance of the form manager + * @returns C_Form_Manager + */ + static function &get_instance($context = FALSE) + { + if (!isset(self::$_instances[$context])) { + $klass = get_class(); + self::$_instances[$context] = new $klass($context); + } + return self::$_instances[$context]; + } + /** + * Defines the instance + * @param mixed $context + */ + public function define($context = FALSE) + { + parent::define($context); + $this->add_mixin('Mixin_Form_Manager'); + $this->implement('I_Form_Manager'); + } +} +class Mixin_Form_Manager extends Mixin +{ + /** + * Adds one or more + * @param type $type + * @param type $form_names + * @return type + */ + public function add_form($type, $form_names) + { + if (!isset($this->object->_forms[$type])) { + $this->object->_forms[$type] = array(); + } + if (!is_array($form_names)) { + $form_names = array($form_names); + } + foreach ($form_names as $form) { + $this->object->_forms[$type][] = $form; + } + return $this->object->get_form_count($type); + } + /** + * Alias for add_form() method + * @param string $type + * @param string|array $form_names + * @return int + */ + public function add_forms($type, $form_names) + { + return $this->object->add_form($type, $form_names); + } + /** + * Removes one or more forms of a particular type + * @param string $type + * @param string|array $form_names + * @return int number of forms remaining for the type + */ + public function remove_form($type, $form_names) + { + $retval = 0; + if (isset($this->object->_forms[$type])) { + foreach ($form_names as $form) { + if ($index = array_search($form, $this->object->_forms[$type])) { + unsset($this->object->_forms[$type][$index]); + } + } + $retval = $this->object->get_form_count($type); + } + return $retval; + } + /** + * Alias for remove_form() method + * @param string $type + * @param string|array $form_names + * @return int + */ + public function remove_forms($type, $form_names) + { + return $this->object->remove_form($type, $form_names); + } + /** + * Gets known form types + * @return type + */ + public function get_known_types() + { + return array_keys($this->object->_forms); + } + /** + * Gets forms of a particular type + * @param string $type + * @return array + */ + public function get_forms($type, $instantiate = FALSE) + { + $retval = array(); + if (isset($this->object->_forms[$type])) { + if (!$instantiate) { + $retval = $this->object->_forms[$type]; + } else { + foreach ($this->object->_forms[$type] as $context) { + $retval[] = $this->get_registry()->get_utility('I_Form', $context); + } + } + } + return $retval; + } + /** + * Gets the number of forms registered for a particular type + * @param string $type + * @return int + */ + public function get_form_count($type) + { + $retval = 0; + if (isset($this->object->_forms[$type])) { + $retval = count($this->object->_forms[$type]); + } + return $retval; + } + /** + * Gets the index of a particular form + * @param string $type + * @param string $name + * @return FALSE|int + */ + public function get_form_index($type, $name) + { + $retval = FALSE; + if ($this->object->get_form_count($type) > 0) { + $retval = array_search($name, $this->object->_forms[$type]); + } + return $retval; + } + /** + * Adds one or more forms before a form already registered + * @param string $type + * @param string $before + * @param string|array $form_names + * @param int $offset + * @return int + */ + public function add_form_before($type, $before, $form_names, $offset = 0) + { + $retval = 0; + $index = FALSE; + $use_add = FALSE; + // Append the forms + if ($this->object->get_form_count($type) == 0) { + $use_add = TRUE; + } else { + if (($index = $this->object->get_form_index($type, $name)) == FALSE) { + $use_add = FALSE; + } + } + if ($use_add) { + $this->object->add_forms($type, $form_names); + } else { + $before = array_slice($this->object->get_forms($type), 0, $offset); + $after = array_slice($this->object->get_forms($type), $offset); + $this->object->_forms[$type] = array_merge($before, $form_names, $after); + $retval = $this->object->get_form_count($type); + } + return $retval; + } + /** + * Adds one or more forms after an existing form + * @param string $type + * @param string $after + * @param string|array $form_names + * @return int + */ + public function add_form_after($type, $after, $form_names) + { + return $this->object->add_form_before($type, $after, $form_names, 1); + } +} +if (!class_exists('C_NextGen_Admin_Installer')) { +} +class C_NextGen_Admin_Page_Controller extends C_MVC_Controller +{ + static $_instances = array(); + static function &get_instance($context = FALSE) + { + if (!isset(self::$_instances[$context])) { + $klass = get_class(); + self::$_instances[$context] = new $klass($context); + } + return self::$_instances[$context]; + } + public function define($context = FALSE) + { + if (is_array($context)) { + $this->name = $context[0]; + } else { + $this->name = $context; + } + parent::define($context); + $this->add_mixin('Mixin_NextGen_Admin_Page_Instance_Methods'); + $this->implement('I_NextGen_Admin_Page'); + } +} +class Mixin_NextGen_Admin_Page_Instance_Methods extends Mixin +{ + /** + * Authorizes the request + */ + public function is_authorized_request($privilege = NULL) + { + if (!$privilege) { + $privilege = $this->object->get_required_permission(); + } + $security = $this->get_registry()->get_utility('I_Security_Manager'); + $retval = $sec_token = $security->get_request_token(str_replace(array(' ', ' +', ' '), '_', $privilege)); + $sec_actor = $security->get_current_actor(); + // Ensure that the user has permission to access this page + if (!$sec_actor->is_allowed($privilege)) { + $retval = FALSE; + } + // Ensure that nonce is valid + if ($this->object->is_post_request() && !$sec_token->check_current_request()) { + $retval = FALSE; + } + return $retval; + } + /** + * Returns the permission required to access this page + * @return string + */ + public function get_required_permission() + { + return $this->object->name; + } + /** + * Enqueues resources required by a NextGEN Admin page + */ + public function enqueue_backend_resources() + { + wp_enqueue_script('jquery'); + $this->object->enqueue_jquery_ui_theme(); + wp_enqueue_script('photocrati_ajax'); + wp_enqueue_script('jquery-ui-accordion'); + wp_enqueue_script('nextgen_display_settings_page_placeholder_stub', $this->get_static_url('photocrati-nextgen_admin#jquery.placeholder.min.js'), array('jquery'), '2.0.7', TRUE); + wp_register_script('iris', $this->get_router()->get_url('/wp-admin/js/iris.min.js', FALSE, TRUE), array('jquery-ui-draggable', 'jquery-ui-slider', 'jquery-touch-punch')); + wp_register_script('wp-color-picker', $this->get_router()->get_url('/wp-admin/js/color-picker.js', FALSE, TRUE), array('iris')); + wp_localize_script('wp-color-picker', 'wpColorPickerL10n', array('clear' => __('Clear', 'nggallery'), 'defaultString' => __('Default', 'nggallery'), 'pick' => __('Select Color', 'nggallery'), 'current' => __('Current Color', 'nggallery'))); + wp_enqueue_script('nextgen_admin_page', $this->get_static_url('photocrati-nextgen_admin#nextgen_admin_page.js'), array('wp-color-picker')); + wp_enqueue_style('nextgen_admin_page', $this->get_static_url('photocrati-nextgen_admin#nextgen_admin_page.css'), array('wp-color-picker')); + // Ensure select2 + wp_enqueue_style('select2'); + wp_enqueue_script('select2'); + } + public function enqueue_jquery_ui_theme() + { + $settings = C_NextGen_Settings::get_instance(); + wp_enqueue_style($settings->jquery_ui_theme, is_ssl() ? str_replace('http:', 'https:', $settings->jquery_ui_theme_url) : $settings->jquery_ui_theme_url, NULL, $settings->jquery_ui_theme_version); + } + /** + * Returns the page title + * @return string + */ + public function get_page_title() + { + return $this->object->name; + } + /** + * Returns the page heading + * @return string + */ + public function get_page_heading() + { + return $this->object->get_page_title(); + } + /** + * Returns the type of forms to render on this page + * @return string + */ + public function get_form_type() + { + return is_array($this->object->context) ? $this->object->context[0] : $this->object->context; + } + public function get_success_message() + { + return __('Saved successfully', 'nggallery'); + } + /** + * Returns an accordion tab, encapsulating the form + * @param I_Form $form + */ + public function to_accordion_tab($form) + { + return $this->object->render_partial('photocrati-nextgen_admin#accordion_tab', array('id' => $form->get_id(), 'title' => $form->get_title(), 'content' => $form->render(TRUE)), TRUE); + } + /** + * Returns the + * @return type + */ + public function get_forms() + { + $forms = array(); + $form_manager = C_Form_Manager::get_instance(); + foreach ($form_manager->get_forms($this->object->get_form_type()) as $form) { + $forms[] = $this->get_registry()->get_utility('I_Form', $form); + } + return $forms; + } + /** + * Gets the action to be executed + * @return string + */ + public function _get_action() + { + $retval = preg_quote($this->object->param('action'), '/'); + $retval = strtolower(preg_replace('/[^\\w]/', '_', $retval)); + return preg_replace('/_{2,}/', '_', $retval) . '_action'; + } + /** + * Returns the template to be rendered for the index action + * @return string + */ + public function index_template() + { + return 'photocrati-nextgen_admin#nextgen_admin_page'; + } + public function show_save_button() + { + return TRUE; + } + /** + * Renders a NextGEN Admin Page using jQuery Accordions + */ + public function index_action() + { + $this->object->enqueue_backend_resources(); + if ($token = $this->object->is_authorized_request()) { + // Get each form. Validate it and save any changes if this is a post + // request + $tabs = array(); + $errors = array(); + $action = $this->object->_get_action(); + $success = $this->param('message'); + if ($success) { + $success = $this->object->get_success_message(); + } else { + $success = $this->object->is_post_request() ? $this->object->get_success_message() : ''; + } + // First, process the Post request + if ($this->object->is_post_request() && $this->has_method($action)) { + $this->object->{$action}($this->object->param($this->context)); + } + foreach ($this->object->get_forms() as $form) { + $form->page = $this->object; + $form->enqueue_static_resources(); + if ($this->object->is_post_request()) { + if ($form->has_method($action)) { + $form->{$action}($this->object->param($form->context)); + } + } + $tabs[] = $this->object->to_accordion_tab($form); + if ($form->has_method('get_model') && $form->get_model()) { + if ($form->get_model()->is_invalid()) { + if ($form_errors = $this->object->show_errors_for($form->get_model(), TRUE)) { + $errors[] = $form_errors; + } + $form->get_model()->clear_errors(); + } + } + } + // Render the view + $this->render_partial($this->object->index_template(), array('page_heading' => $this->object->get_page_heading(), 'tabs' => $tabs, 'errors' => $errors, 'success' => $success, 'form_header' => $token->get_form_html(), 'show_save_button' => $this->object->show_save_button(), 'model' => $this->object->has_method('get_model') ? $this->get_model() : NULL)); + } else { + $this->render_view('photocrati-nextgen_admin#not_authorized', array('name' => $this->object->name, 'title' => $this->object->get_page_title())); + } + } +} +class C_Page_Manager extends C_Component +{ + static $_instance = NULL; + public $_pages = array(); + /** + * Gets an instance of the Page Manager + * @param string $context + * @return C_Page_Manager + */ + static function &get_instance($context = FALSE) + { + if (is_null(self::$_instance)) { + $klass = get_class(); + self::$_instance = new $klass($context); + } + return self::$_instance; + } + /** + * Defines the instance of the Page Manager + * @param type $context + */ + public function define($context = FALSE) + { + parent::define($context); + $this->add_mixin('Mixin_Page_Manager'); + $this->implement('I_Page_Manager'); + } +} +class Mixin_Page_Manager extends Mixin +{ + public function add($slug, $properties = array()) + { + if (!isset($properties['adapter'])) { + $properties['adapter'] = NULL; + } + if (!isset($properties['parent'])) { + $properties['parent'] = NULL; + } + if (!isset($properties['add_menu'])) { + $properties['add_menu'] = TRUE; + } + if (!isset($properties['before'])) { + $properties['before'] = NULL; + } + if (!isset($properties['url'])) { + $properties['url'] = NULL; + } + $this->object->_pages[$slug] = $properties; + } + public function move_page($slug, $other_slug, $after = false) + { + $page_list = $this->object->_pages; + if (isset($page_list[$slug]) && isset($page_list[$other_slug])) { + $slug_list = array_keys($page_list); + $item_list = array_values($page_list); + $slug_idx = array_search($slug, $slug_list); + $item = $page_list[$slug]; + unset($slug_list[$slug_idx]); + unset($item_list[$slug_idx]); + $slug_list = array_values($slug_list); + $item_list = array_values($item_list); + $other_idx = array_search($other_slug, $slug_list); + array_splice($slug_list, $other_idx, 0, array($slug)); + array_splice($item_list, $other_idx, 0, array($item)); + $this->object->_pages = array_combine($slug_list, $item_list); + } + } + public function remove($slug) + { + unset($this->object->_pages[$slug]); + } + public function get_all() + { + return $this->object->_pages; + } + public function setup() + { + $registry = $this->get_registry(); + $controllers = array(); + foreach ($this->object->_pages as $slug => $properties) { + $page_title = 'Unnamed Page'; + $menu_title = 'Unnamed Page'; + $permission = NULL; + $callback = NULL; + // There's two type of pages we can have. Some are powered by our controllers, and others + // are powered by WordPress, such as a custom post type page. + // Is this powered by a controller? If so, we expect an adapter + if ($properties['adapter']) { + $controllers[$slug] = $registry->get_utility('I_NextGen_Admin_Page', $slug); + $menu_title = $controllers[$slug]->get_page_heading(); + $page_title = $controllers[$slug]->get_page_title(); + $permission = $controllers[$slug]->get_required_permission(); + $callback = array(&$controllers[$slug], 'index_action'); + } elseif ($properties['url']) { + $slug = $properties['url']; + if (isset($properties['menu_title'])) { + $menu_title = $properties['menu_title']; + } + if (isset($properties['permission'])) { + $permission = $properties['permission']; + } + } + // Are we to add a menu? + if ($properties['add_menu'] && current_user_can($permission)) { + add_submenu_page($properties['parent'], $page_title, $menu_title, $permission, $slug, $callback); + if ($properties['before']) { + global $submenu; + if (empty($submenu[$properties['parent']])) { + $parent = null; + } else { + $parent = $submenu[$properties['parent']]; + } + $item_index = -1; + $before_index = -1; + if ($parent != null) { + foreach ($parent as $index => $menu) { + // under add_submenu_page, $menu_slug is index 2 + // $submenu[$parent_slug][] = array ( $menu_title, $capability, $menu_slug, $page_title ); + if ($menu[2] == $slug) { + $item_index = $index; + } else { + if ($menu[2] == $properties['before']) { + $before_index = $index; + } + } + } + } + if ($item_index > -1 && $before_index > -1) { + $item = $parent[$item_index]; + unset($parent[$item_index]); + $parent = array_values($parent); + if ($item_index < $before_index) { + $before_index--; + } + array_splice($parent, $before_index, 0, array($item)); + $submenu[$properties['parent']] = $parent; + } + } + } + } + } +} \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/admin_notices.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/admin_notices.js new file mode 100644 index 0000000000000000000000000000000000000000..0abc23e74542cd5136dd32db6c0bca5418bf7a23 --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/admin_notices.js @@ -0,0 +1,18 @@ +jQuery(function($){ + $('.ngg_admin_notice .dismiss').click(function(e){ + e.preventDefault(); + + var $notice = $(this).parents('.ngg_admin_notice'); + var $notice_name = $notice.attr('data-notification-name'); + if ($notice_name.length > 0) { + var url = ngg_dismiss_url+'&name='+$notice_name; + $.post(url, function(response){ + if (typeof(response) != 'object') response = JSON.parse(response); + if (response.success) { + $notice.fadeOut(); + } + else alert(response.msg); + }); + } + }); +}); \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/admin_notices.min.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/admin_notices.min.js new file mode 100644 index 0000000000000000000000000000000000000000..dff36997e4f0f7116b14248c3844f1526d5036dc --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/admin_notices.min.js @@ -0,0 +1 @@ +eval(function(p,a,c,k,e,d){e=function(c){return c.toString(36)};if(!''.replace(/^/,String)){while(c--){d[c.toString(a)]=k[c]||c.toString(a)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('g(3($){$(\'.9 .f\').h(3(e){e.i();4 $5=$(j).d(\'.9\');4 $6=$5.a(\'b-c-7\');2($6.k>0){4 8=v+\'&7=\'+$6;$.u(8,3(1){2(q(1)!=\'m\')1=n.o(1);2(1.t){$5.p()}r l(1.s)})}})});',32,32,'|response|if|function|var|notice|notice_name|name|url|ngg_admin_notice|attr|data|notification|parents||dismiss|jQuery|click|preventDefault|this|length|alert|object|JSON|parse|fadeOut|typeof|else|msg|success|post|ngg_dismiss_url'.split('|'),0,{})) diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/gritter/css/gritter.min.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/gritter/css/gritter.min.css new file mode 100644 index 0000000000000000000000000000000000000000..0b5b793f63a44c6ccfc51fabb7b9d31ec845be00 --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/gritter/css/gritter.min.css @@ -0,0 +1 @@ +#gritter-notice-wrapper{position:fixed;top:30px;right:20px;width:301px;z-index:999999}#gritter-notice-wrapper.top-left{left:20px;right:auto}#gritter-notice-wrapper.bottom-right{top:auto;left:auto;bottom:20px;right:20px}#gritter-notice-wrapper.bottom-left{top:auto;right:auto;bottom:20px;left:20px}.gritter-item-wrapper{position:relative;margin:0 0 10px 0;background:url('../images/ie-spacer.gif')}.gritter-top{background:url(../images/gritter.png) no-repeat left -30px;height:10px}.hover .gritter-top{background-position:right -30px}.gritter-bottom{background:url(../images/gritter.png) no-repeat left bottom;height:8px;margin:0}.hover .gritter-bottom{background-position:bottom right}.gritter-item{display:block;background:url(../images/gritter.png) no-repeat left -40px;color:#eee;padding:2px 11px 8px 11px;font-size:11px;font-family:verdana}.hover .gritter-item{background-position:right -40px}.gritter-item p{padding:0;margin:0;word-wrap:break-word}.gritter-close{display:none;position:absolute;top:5px;right:3px;background:url(../images/gritter.png) no-repeat left top;cursor:pointer;width:30px;height:30px}.gritter-title{font-size:14px;font-weight:bold;padding:0 0 7px 0;display:block;text-shadow:1px 1px 0 #000}.gritter-image{width:48px;height:48px;float:left}.gritter-with-image,.gritter-without-image{padding:0}.gritter-with-image{width:220px;float:right}.gritter-light .gritter-item,.gritter-light .gritter-bottom,.gritter-light .gritter-top,.gritter-light .gritter-close{background-image:url(../images/gritter-light.png);color:#222}.gritter-light .gritter-title{text-shadow:none} \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/jquery-ui/jquery-ui-1.10.4.custom.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/jquery-ui/jquery-ui-1.10.4.custom.css index 91b943bff2924cf1919cf49413f22d913eb749fe..bdf3113325871da5ff5e45d14aef1a1f3bc369aa 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/jquery-ui/jquery-ui-1.10.4.custom.css +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/jquery-ui/jquery-ui-1.10.4.custom.css @@ -163,12 +163,12 @@ display: block; cursor: pointer; position: relative; - margin-top: 2px; + margin-top: 10px; padding: .5em .5em .5em .7em; + border: 1px solid #e5e5e5; min-height: 0; /* support: IE7 */ } .ui-accordion .ui-accordion-icons { - padding-left: 2.2em; } .ui-accordion .ui-accordion-noicons { padding-left: .7em; @@ -178,14 +178,20 @@ } .ui-accordion .ui-accordion-header .ui-accordion-header-icon { position: absolute; - left: .5em; + right: .5em; + left: initial; top: 50%; margin-top: -8px; + color: #a0a5aa; } .ui-accordion .ui-accordion-content { padding: 1em 2.2em; + border: 1px solid #e5e5e5; border-top: 0; overflow: auto; + margin: 0 0 10px 0; + -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04) + box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04); } .ui-autocomplete { position: absolute; @@ -819,8 +825,7 @@ body .ui-tooltip { .ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { - border: 1px solid #dfdfdf; - background: #f5f5f5 url(images/ui-bg_flat_0_f5f5f5_40x100.png) 50% 50% repeat-x; + background: #fff; font-weight: normal; color: #222; } @@ -836,8 +841,6 @@ body .ui-tooltip { .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { - border: 1px solid #dfdfdf; - background: #e1e1e1 url(images/ui-bg_flat_0_e1e1e1_40x100.png) 50% 50% repeat-x; font-weight: normal; color: #222; } @@ -855,8 +858,7 @@ body .ui-tooltip { .ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { - border: 1px solid #dfdfdf; - background: #e1e1e1 url(images/ui-bg_flat_65_e1e1e1_40x100.png) 50% 50% repeat-x; + background: #fff; font-weight: normal; color: #222; } @@ -937,7 +939,7 @@ body .ui-tooltip { background-image: url(images/ui-icons_eee_256x240.png); } .ui-state-default .ui-icon { - background-image: url(images/ui-icons_222_256x240.png); + background-image: url(images/ui-icons_999999_256x240.png); } .ui-state-hover .ui-icon, .ui-state-focus .ui-icon { @@ -1268,4 +1270,30 @@ body .ui-tooltip { /* Necessary w/WP 3.9's new dialogs */ .ui-autocomplete { z-index: 250; +} + +/* WP 4.1-beta1 makes the accordion fonts & margin huge */ +h3.ui-accordion-header.ui-state-default, +h3.ui-accordion-header { + margin: 3px 0 0 0; + font-size: 14px; + font-weight: 600; + line-height: 20px; +} + +h3.ui-accordion-header a:focus, +h3.ui-accordion-header:focus { + outline: none; + box-shadow: none; +} + +h3.ui-accordion-header.ui-state-active .ui-accordion-header-icon { +} + +h3.ui-accordion-header.ui-state-active { + border-bottom: 1px solid #eee; +} + +div.accordion { + margin-top: 10px; } \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/jquery-ui/jquery-ui-1.10.4.custom.min.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/jquery-ui/jquery-ui-1.10.4.custom.min.css new file mode 100644 index 0000000000000000000000000000000000000000..1f243285c4abce4c893a0e2d3e66d8cff334f8bd --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/jquery-ui/jquery-ui-1.10.4.custom.min.css @@ -0,0 +1,6 @@ +/*! jQuery UI - v1.10.4 - 2014-02-04 + * * http://jqueryui.com + * * Includes: jquery.ui.core.css, jquery.ui.resizable.css, jquery.ui.selectable.css, jquery.ui.accordion.css, jquery.ui.autocomplete.css, jquery.ui.button.css, jquery.ui.datepicker.css, jquery.ui.dialog.css, jquery.ui.menu.css, jquery.ui.progressbar.css, jquery.ui.slider.css, jquery.ui.spinner.css, jquery.ui.tabs.css, jquery.ui.tooltip.css, jquery.ui.theme.css + * * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=%22Open%20Sans%22%2C%20sans-serif&fwDefault=normal&fsDefault=13px&cornerRadius=0&bgColorHeader=%23333&bgTextureHeader=flat&bgImgOpacityHeader=0&borderColorHeader=%23333&fcHeader=%23eee&iconColorHeader=%23eee&bgColorContent=%23fff&bgTextureContent=flat&bgImgOpacityContent=0&borderColorContent=%23eee&fcContent=%23333333&iconColorContent=%23cccccc&bgColorDefault=%23f5f5f5&bgTextureDefault=flat&bgImgOpacityDefault=0&borderColorDefault=%23dfdfdf&fcDefault=%23222&iconColorDefault=%23222&bgColorHover=%23e1e1e1&bgTextureHover=flat&bgImgOpacityHover=0&borderColorHover=%23dfdfdf&fcHover=%23222&iconColorHover=%23222&bgColorActive=%23e1e1e1&bgTextureActive=flat&bgImgOpacityActive=65&borderColorActive=%23dfdfdf&fcActive=%23222&iconColorActive=%23222&bgColorHighlight=%23e1e1e1&bgTextureHighlight=flat&bgImgOpacityHighlight=55&borderColorHighlight=%23dfdfdf&fcHighlight=%23222&iconColorHighlight=%23222&bgColorError=%23D54E21&bgTextureError=flat&bgImgOpacityError=0&borderColorError=%23D54E21&fcError=%23eee&iconColorError=%23eee&bgColorOverlay=%23333&bgTextureOverlay=flat&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=%23aaaaaa&bgTextureShadow=flat&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=2px&offsetTopShadow=-2px&offsetLeftShadow=-2px&cornerRadiusShadow=2px + * * Copyright 2014 jQuery Foundation and other contributors; Licensed MIT */ + .ui-helper-hidden{display:none}.ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:before,.ui-helper-clearfix:after{content:"";display:table;border-collapse:collapse}.ui-helper-clearfix:after{clear:both}.ui-helper-clearfix{min-height:0}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}.ui-front{z-index:100}.ui-state-disabled{cursor:default !important}.ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-overlay{position:fixed;top:0;left:0;width:100%;height:100%}.ui-resizable{position:relative}.ui-resizable-handle{position:absolute;font-size:.1px;display:block}.ui-resizable-disabled .ui-resizable-handle,.ui-resizable-autohide .ui-resizable-handle{display:none}.ui-resizable-n{cursor:n-resize;height:7px;width:100%;top:-5px;left:0}.ui-resizable-s{cursor:s-resize;height:7px;width:100%;bottom:-5px;left:0}.ui-resizable-e{cursor:e-resize;width:7px;right:-5px;top:0;height:100%}.ui-resizable-w{cursor:w-resize;width:7px;left:-5px;top:0;height:100%}.ui-resizable-se{cursor:se-resize;width:12px;height:12px;right:1px;bottom:1px}.ui-resizable-sw{cursor:sw-resize;width:9px;height:9px;left:-5px;bottom:-5px}.ui-resizable-nw{cursor:nw-resize;width:9px;height:9px;left:-5px;top:-5px}.ui-resizable-ne{cursor:ne-resize;width:9px;height:9px;right:-5px;top:-5px}.ui-selectable-helper{position:absolute;z-index:100;border:1px dotted black}.ui-accordion .ui-accordion-header{display:block;cursor:pointer;position:relative;margin-top:10px;padding:.5em .5em .5em .7em;border:1px solid #e5e5e5;min-height:0}.ui-accordion .ui-accordion-noicons{padding-left:.7em}.ui-accordion .ui-accordion-icons .ui-accordion-icons{padding-left:2.2em}.ui-accordion .ui-accordion-header .ui-accordion-header-icon{position:absolute;right:.5em;left:initial;top:50%;margin-top:-8px;color:#a0a5aa}.ui-accordion .ui-accordion-content{padding:1em 2.2em;border:1px solid #e5e5e5;border-top:0;overflow:auto;margin:0 0 10px 0;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.04) box-shadow:0 1px 1px rgba(0,0,0,.04)}.ui-autocomplete{position:absolute;top:0;left:0;cursor:default}.ui-button{display:inline-block;position:relative;padding:0;line-height:normal;margin-right:.1em;cursor:pointer;vertical-align:middle;text-align:center;overflow:visible}.ui-button,.ui-button:link,.ui-button:visited,.ui-button:hover,.ui-button:active{text-decoration:none}.ui-button-icon-only{width:2.2em}button.ui-button-icon-only{width:2.4em}.ui-button-icons-only{width:3.4em}button.ui-button-icons-only{width:3.7em}.ui-button .ui-button-text{display:block;line-height:normal}.ui-button-text-only .ui-button-text{padding:.4em 1em}.ui-button-icon-only .ui-button-text,.ui-button-icons-only .ui-button-text{padding:.4em;text-indent:-9999999px}.ui-button-text-icon-primary .ui-button-text,.ui-button-text-icons .ui-button-text{padding:.4em 1em .4em 2.1em}.ui-button-text-icon-secondary .ui-button-text,.ui-button-text-icons .ui-button-text{padding:.4em 2.1em .4em 1em}.ui-button-text-icons .ui-button-text{padding-left:2.1em;padding-right:2.1em}input.ui-button{padding:.4em 1em}.ui-button-icon-only .ui-icon,.ui-button-text-icon-primary .ui-icon,.ui-button-text-icon-secondary .ui-icon,.ui-button-text-icons .ui-icon,.ui-button-icons-only .ui-icon{position:absolute;top:50%;margin-top:-8px}.ui-button-icon-only .ui-icon{left:50%;margin-left:-8px}.ui-button-text-icon-primary .ui-button-icon-primary,.ui-button-text-icons .ui-button-icon-primary,.ui-button-icons-only .ui-button-icon-primary{left:.5em}.ui-button-text-icon-secondary .ui-button-icon-secondary,.ui-button-text-icons .ui-button-icon-secondary,.ui-button-icons-only .ui-button-icon-secondary{right:.5em}.ui-buttonset{margin-right:7px}.ui-buttonset .ui-button{margin-left:0;margin-right:-.3em}input.ui-button::-moz-focus-inner,button.ui-button::-moz-focus-inner{border:0;padding:0}.ui-datepicker{width:17em;padding:.2em .2em 0;display:none}.ui-datepicker .ui-datepicker-header{position:relative;padding:.2em 0}.ui-datepicker .ui-datepicker-prev,.ui-datepicker .ui-datepicker-next{position:absolute;top:2px;width:1.8em;height:1.8em}.ui-datepicker .ui-datepicker-prev-hover,.ui-datepicker .ui-datepicker-next-hover{top:1px}.ui-datepicker .ui-datepicker-prev{left:2px}.ui-datepicker .ui-datepicker-next{right:2px}.ui-datepicker .ui-datepicker-prev-hover{left:1px}.ui-datepicker .ui-datepicker-next-hover{right:1px}.ui-datepicker .ui-datepicker-prev span,.ui-datepicker .ui-datepicker-next span{display:block;position:absolute;left:50%;margin-left:-8px;top:50%;margin-top:-8px}.ui-datepicker .ui-datepicker-title{margin:0 2.3em;line-height:1.8em;text-align:center}.ui-datepicker .ui-datepicker-title select{font-size:1em;margin:1px 0}.ui-datepicker select.ui-datepicker-month,.ui-datepicker select.ui-datepicker-year{width:49%}.ui-datepicker table{width:100%;font-size:.9em;border-collapse:collapse;margin:0 0 .4em}.ui-datepicker th{padding:.7em .3em;text-align:center;font-weight:bold;border:0}.ui-datepicker td{border:0;padding:1px}.ui-datepicker td span,.ui-datepicker td a{display:block;padding:.2em;text-align:right;text-decoration:none}.ui-datepicker .ui-datepicker-buttonpane{background-image:none;margin:.7em 0 0 0;padding:0 .2em;border-left:0;border-right:0;border-bottom:0}.ui-datepicker .ui-datepicker-buttonpane button{float:right;margin:.5em .2em .4em;cursor:pointer;padding:.2em .6em .3em .6em;width:auto;overflow:visible}.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current{float:left}.ui-datepicker.ui-datepicker-multi{width:auto}.ui-datepicker-multi .ui-datepicker-group{float:left}.ui-datepicker-multi .ui-datepicker-group table{width:95%;margin:0 auto .4em}.ui-datepicker-multi-2 .ui-datepicker-group{width:50%}.ui-datepicker-multi-3 .ui-datepicker-group{width:33.3%}.ui-datepicker-multi-4 .ui-datepicker-group{width:25%}.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header{border-left-width:0}.ui-datepicker-multi .ui-datepicker-buttonpane{clear:left}.ui-datepicker-row-break{clear:both;width:100%;font-size:0}.ui-datepicker-rtl{direction:rtl}.ui-datepicker-rtl .ui-datepicker-prev{right:2px;left:auto}.ui-datepicker-rtl .ui-datepicker-next{left:2px;right:auto}.ui-datepicker-rtl .ui-datepicker-prev:hover{right:1px;left:auto}.ui-datepicker-rtl .ui-datepicker-next:hover{left:1px;right:auto}.ui-datepicker-rtl .ui-datepicker-buttonpane{clear:right}.ui-datepicker-rtl .ui-datepicker-buttonpane button{float:left}.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,.ui-datepicker-rtl .ui-datepicker-group{float:right}.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header{border-right-width:0;border-left-width:1px}.ui-dialog{overflow:hidden;position:absolute;top:0;left:0;padding:.2em;outline:0}.ui-dialog .ui-dialog-titlebar{padding:.4em 1em;position:relative}.ui-dialog .ui-dialog-title{float:left;margin:.1em 0;white-space:nowrap;width:90%;overflow:hidden;text-overflow:ellipsis}.ui-dialog .ui-dialog-titlebar-close{position:absolute;right:.3em;top:50%;width:20px;margin:-10px 0 0 0;padding:1px;height:20px}.ui-dialog .ui-dialog-content{position:relative;border:0;padding:.5em 1em;background:none;overflow:auto}.ui-dialog .ui-dialog-buttonpane{text-align:left;border-width:1px 0 0 0;background-image:none;margin-top:.5em;padding:.3em 1em .5em .4em}.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset{float:right}.ui-dialog .ui-dialog-buttonpane button{margin:.5em .4em .5em 0;cursor:pointer}.ui-dialog .ui-resizable-se{width:12px;height:12px;right:-5px;bottom:-5px;background-position:16px 16px}.ui-draggable .ui-dialog-titlebar{cursor:move}.ui-menu{list-style:none;padding:2px;margin:0;display:block;outline:0}.ui-menu .ui-menu{margin-top:-3px;position:absolute}.ui-menu .ui-menu-item{margin:0;padding:0;width:100%;list-style-image:url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)}.ui-menu .ui-menu-divider{margin:5px -2px 5px -2px;height:0;font-size:0;line-height:0;border-width:1px 0 0 0}.ui-menu .ui-menu-item a{text-decoration:none;display:block;padding:2px .4em;line-height:1.5;min-height:0;font-weight:normal}.ui-menu .ui-menu-item a.ui-state-focus,.ui-menu .ui-menu-item a.ui-state-active{font-weight:normal;margin:-1px}.ui-menu .ui-state-disabled{font-weight:normal;margin:.4em 0 .2em;line-height:1.5}.ui-menu .ui-state-disabled a{cursor:default}.ui-menu-icons{position:relative}.ui-menu-icons .ui-menu-item a{position:relative;padding-left:2em}.ui-menu .ui-icon{position:absolute;top:.2em;left:.2em}.ui-menu .ui-menu-icon{position:static;float:right}.ui-progressbar{height:2em;text-align:left;overflow:hidden}.ui-progressbar .ui-progressbar-value{margin:-1px;height:100%}.ui-progressbar .ui-progressbar-overlay{background:url("images/animated-overlay.gif");height:100%;filter:alpha(opacity=25);opacity:.25}.ui-progressbar-indeterminate .ui-progressbar-value{background-image:none}.ui-slider{position:relative;text-align:left}.ui-slider .ui-slider-handle{position:absolute;z-index:2;width:1.2em;height:1.2em;cursor:default}.ui-slider .ui-slider-range{position:absolute;z-index:1;font-size:.7em;display:block;border:0;background-position:0 0}.ui-slider.ui-state-disabled .ui-slider-handle,.ui-slider.ui-state-disabled .ui-slider-range{filter:inherit}.ui-slider-horizontal{height:.8em}.ui-slider-horizontal .ui-slider-handle{top:-.3em;margin-left:-.6em}.ui-slider-horizontal .ui-slider-range{top:0;height:100%}.ui-slider-horizontal .ui-slider-range-min{left:0}.ui-slider-horizontal .ui-slider-range-max{right:0}.ui-slider-vertical{width:.8em;height:100px}.ui-slider-vertical .ui-slider-handle{left:-.3em;margin-left:0;margin-bottom:-.6em}.ui-slider-vertical .ui-slider-range{left:0;width:100%}.ui-slider-vertical .ui-slider-range-min{bottom:0}.ui-slider-vertical .ui-slider-range-max{top:0}.ui-spinner{position:relative;display:inline-block;overflow:hidden;padding:0;vertical-align:middle}.ui-spinner-input{border:0;background:none;color:inherit;padding:0;margin:.2em 0;vertical-align:middle;margin-left:.4em;margin-right:22px}.ui-spinner-button{width:16px;height:50%;font-size:.5em;padding:0;margin:0;text-align:center;position:absolute;cursor:default;display:block;overflow:hidden;right:0}.ui-spinner a.ui-spinner-button{border-top:0;border-bottom:0;border-right:0}.ui-spinner .ui-icon{position:absolute;margin-top:-8px;top:50%;left:0}.ui-spinner-up{top:0}.ui-spinner-down{bottom:0}.ui-spinner .ui-icon-triangle-1-s{background-position:-65px -16px}.ui-tabs{position:relative;padding:.2em}.ui-tabs .ui-tabs-nav{margin:0;padding:.2em .2em 0}.ui-tabs .ui-tabs-nav li{list-style:none;float:left;position:relative;top:0;margin:1px .2em 0 0;border-bottom-width:0;padding:0;white-space:nowrap}.ui-tabs .ui-tabs-nav .ui-tabs-anchor{float:left;padding:.5em 1em;text-decoration:none}.ui-tabs .ui-tabs-nav li.ui-tabs-active{margin-bottom:-1px;padding-bottom:1px}.ui-tabs .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor,.ui-tabs .ui-tabs-nav li.ui-state-disabled .ui-tabs-anchor,.ui-tabs .ui-tabs-nav li.ui-tabs-loading .ui-tabs-anchor{cursor:text}.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor{cursor:pointer}.ui-tabs .ui-tabs-panel{display:block;border-width:0;padding:1em 1.4em;background:none}.ui-tooltip{padding:8px;position:absolute;z-index:9999;max-width:300px;-webkit-box-shadow:0 0 5px #aaa;box-shadow:0 0 5px #aaa}body .ui-tooltip{border-width:2px}.ui-widget{font-family:"Open Sans",sans-serif;font-size:13px}.ui-widget .ui-widget{font-size:1em}.ui-widget input,.ui-widget select,.ui-widget textarea,.ui-widget button{font-family:"Open Sans",sans-serif;font-size:1em}.ui-widget-content{border:1px solid #eee;background:#fff url(images/ui-bg_flat_0_fff_40x100.png) 50% 50% repeat-x;color:#333}.ui-widget-content a{color:#333}.ui-widget-header{border:1px solid #333;background:#333 url(images/ui-bg_flat_0_333_40x100.png) 50% 50% repeat-x;color:#eee;font-weight:bold}.ui-widget-header a{color:#eee}.ui-state-default,.ui-widget-content .ui-state-default,.ui-widget-header .ui-state-default{background:#fff;font-weight:normal;color:#222}.ui-state-default a,.ui-state-default a:link,.ui-state-default a:visited{color:#222;text-decoration:none}.ui-state-hover,.ui-widget-content .ui-state-hover,.ui-widget-header .ui-state-hover,.ui-state-focus,.ui-widget-content .ui-state-focus,.ui-widget-header .ui-state-focus{font-weight:normal;color:#222}.ui-state-hover a,.ui-state-hover a:hover,.ui-state-hover a:link,.ui-state-hover a:visited,.ui-state-focus a,.ui-state-focus a:hover,.ui-state-focus a:link,.ui-state-focus a:visited{color:#222;text-decoration:none}.ui-state-active,.ui-widget-content .ui-state-active,.ui-widget-header .ui-state-active{background:#fff;font-weight:normal;color:#222}.ui-state-active a,.ui-state-active a:link,.ui-state-active a:visited{color:#222;text-decoration:none}.ui-state-highlight,.ui-widget-content .ui-state-highlight,.ui-widget-header .ui-state-highlight{border:1px solid #dfdfdf;background:#e1e1e1 url(images/ui-bg_flat_55_e1e1e1_40x100.png) 50% 50% repeat-x;color:#222}.ui-state-highlight a,.ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a{color:#222}.ui-state-error,.ui-widget-content .ui-state-error,.ui-widget-header .ui-state-error{border:1px solid #d54e21;background:#d54e21 url(images/ui-bg_flat_0_D54E21_40x100.png) 50% 50% repeat-x;color:#eee}.ui-state-error a,.ui-widget-content .ui-state-error a,.ui-widget-header .ui-state-error a{color:#eee}.ui-state-error-text,.ui-widget-content .ui-state-error-text,.ui-widget-header .ui-state-error-text{color:#eee}.ui-priority-primary,.ui-widget-content .ui-priority-primary,.ui-widget-header .ui-priority-primary{font-weight:bold}.ui-priority-secondary,.ui-widget-content .ui-priority-secondary,.ui-widget-header .ui-priority-secondary{opacity:.7;filter:Alpha(Opacity=70);font-weight:normal}.ui-state-disabled,.ui-widget-content .ui-state-disabled,.ui-widget-header .ui-state-disabled{opacity:.35;filter:Alpha(Opacity=35);background-image:none}.ui-state-disabled .ui-icon{filter:Alpha(Opacity=35)}.ui-icon{width:16px;height:16px}.ui-icon,.ui-widget-content .ui-icon{background-image:url(images/ui-icons_cccccc_256x240.png)}.ui-widget-header .ui-icon{background-image:url(images/ui-icons_eee_256x240.png)}.ui-state-default .ui-icon{background-image:url(images/ui-icons_999999_256x240.png)}.ui-state-hover .ui-icon,.ui-state-focus .ui-icon{background-image:url(images/ui-icons_222_256x240.png)}.ui-state-active .ui-icon{background-image:url(images/ui-icons_222_256x240.png)}.ui-state-highlight .ui-icon{background-image:url(images/ui-icons_222_256x240.png)}.ui-state-error .ui-icon,.ui-state-error-text .ui-icon{background-image:url(images/ui-icons_eee_256x240.png)}.ui-icon-blank{background-position:16px 16px}.ui-icon-carat-1-n{background-position:0 0}.ui-icon-carat-1-ne{background-position:-16px 0}.ui-icon-carat-1-e{background-position:-32px 0}.ui-icon-carat-1-se{background-position:-48px 0}.ui-icon-carat-1-s{background-position:-64px 0}.ui-icon-carat-1-sw{background-position:-80px 0}.ui-icon-carat-1-w{background-position:-96px 0}.ui-icon-carat-1-nw{background-position:-112px 0}.ui-icon-carat-2-n-s{background-position:-128px 0}.ui-icon-carat-2-e-w{background-position:-144px 0}.ui-icon-triangle-1-n{background-position:0 -16px}.ui-icon-triangle-1-ne{background-position:-16px -16px}.ui-icon-triangle-1-e{background-position:-32px -16px}.ui-icon-triangle-1-se{background-position:-48px -16px}.ui-icon-triangle-1-s{background-position:-64px -16px}.ui-icon-triangle-1-sw{background-position:-80px -16px}.ui-icon-triangle-1-w{background-position:-96px -16px}.ui-icon-triangle-1-nw{background-position:-112px -16px}.ui-icon-triangle-2-n-s{background-position:-128px -16px}.ui-icon-triangle-2-e-w{background-position:-144px -16px}.ui-icon-arrow-1-n{background-position:0 -32px}.ui-icon-arrow-1-ne{background-position:-16px -32px}.ui-icon-arrow-1-e{background-position:-32px -32px}.ui-icon-arrow-1-se{background-position:-48px -32px}.ui-icon-arrow-1-s{background-position:-64px -32px}.ui-icon-arrow-1-sw{background-position:-80px -32px}.ui-icon-arrow-1-w{background-position:-96px -32px}.ui-icon-arrow-1-nw{background-position:-112px -32px}.ui-icon-arrow-2-n-s{background-position:-128px -32px}.ui-icon-arrow-2-ne-sw{background-position:-144px -32px}.ui-icon-arrow-2-e-w{background-position:-160px -32px}.ui-icon-arrow-2-se-nw{background-position:-176px -32px}.ui-icon-arrowstop-1-n{background-position:-192px -32px}.ui-icon-arrowstop-1-e{background-position:-208px -32px}.ui-icon-arrowstop-1-s{background-position:-224px -32px}.ui-icon-arrowstop-1-w{background-position:-240px -32px}.ui-icon-arrowthick-1-n{background-position:0 -48px}.ui-icon-arrowthick-1-ne{background-position:-16px -48px}.ui-icon-arrowthick-1-e{background-position:-32px -48px}.ui-icon-arrowthick-1-se{background-position:-48px -48px}.ui-icon-arrowthick-1-s{background-position:-64px -48px}.ui-icon-arrowthick-1-sw{background-position:-80px -48px}.ui-icon-arrowthick-1-w{background-position:-96px -48px}.ui-icon-arrowthick-1-nw{background-position:-112px -48px}.ui-icon-arrowthick-2-n-s{background-position:-128px -48px}.ui-icon-arrowthick-2-ne-sw{background-position:-144px -48px}.ui-icon-arrowthick-2-e-w{background-position:-160px -48px}.ui-icon-arrowthick-2-se-nw{background-position:-176px -48px}.ui-icon-arrowthickstop-1-n{background-position:-192px -48px}.ui-icon-arrowthickstop-1-e{background-position:-208px -48px}.ui-icon-arrowthickstop-1-s{background-position:-224px -48px}.ui-icon-arrowthickstop-1-w{background-position:-240px -48px}.ui-icon-arrowreturnthick-1-w{background-position:0 -64px}.ui-icon-arrowreturnthick-1-n{background-position:-16px -64px}.ui-icon-arrowreturnthick-1-e{background-position:-32px -64px}.ui-icon-arrowreturnthick-1-s{background-position:-48px -64px}.ui-icon-arrowreturn-1-w{background-position:-64px -64px}.ui-icon-arrowreturn-1-n{background-position:-80px -64px}.ui-icon-arrowreturn-1-e{background-position:-96px -64px}.ui-icon-arrowreturn-1-s{background-position:-112px -64px}.ui-icon-arrowrefresh-1-w{background-position:-128px -64px}.ui-icon-arrowrefresh-1-n{background-position:-144px -64px}.ui-icon-arrowrefresh-1-e{background-position:-160px -64px}.ui-icon-arrowrefresh-1-s{background-position:-176px -64px}.ui-icon-arrow-4{background-position:0 -80px}.ui-icon-arrow-4-diag{background-position:-16px -80px}.ui-icon-extlink{background-position:-32px -80px}.ui-icon-newwin{background-position:-48px -80px}.ui-icon-refresh{background-position:-64px -80px}.ui-icon-shuffle{background-position:-80px -80px}.ui-icon-transfer-e-w{background-position:-96px -80px}.ui-icon-transferthick-e-w{background-position:-112px -80px}.ui-icon-folder-collapsed{background-position:0 -96px}.ui-icon-folder-open{background-position:-16px -96px}.ui-icon-document{background-position:-32px -96px}.ui-icon-document-b{background-position:-48px -96px}.ui-icon-note{background-position:-64px -96px}.ui-icon-mail-closed{background-position:-80px -96px}.ui-icon-mail-open{background-position:-96px -96px}.ui-icon-suitcase{background-position:-112px -96px}.ui-icon-comment{background-position:-128px -96px}.ui-icon-person{background-position:-144px -96px}.ui-icon-print{background-position:-160px -96px}.ui-icon-trash{background-position:-176px -96px}.ui-icon-locked{background-position:-192px -96px}.ui-icon-unlocked{background-position:-208px -96px}.ui-icon-bookmark{background-position:-224px -96px}.ui-icon-tag{background-position:-240px -96px}.ui-icon-home{background-position:0 -112px}.ui-icon-flag{background-position:-16px -112px}.ui-icon-calendar{background-position:-32px -112px}.ui-icon-cart{background-position:-48px -112px}.ui-icon-pencil{background-position:-64px -112px}.ui-icon-clock{background-position:-80px -112px}.ui-icon-disk{background-position:-96px -112px}.ui-icon-calculator{background-position:-112px -112px}.ui-icon-zoomin{background-position:-128px -112px}.ui-icon-zoomout{background-position:-144px -112px}.ui-icon-search{background-position:-160px -112px}.ui-icon-wrench{background-position:-176px -112px}.ui-icon-gear{background-position:-192px -112px}.ui-icon-heart{background-position:-208px -112px}.ui-icon-star{background-position:-224px -112px}.ui-icon-link{background-position:-240px -112px}.ui-icon-cancel{background-position:0 -128px}.ui-icon-plus{background-position:-16px -128px}.ui-icon-plusthick{background-position:-32px -128px}.ui-icon-minus{background-position:-48px -128px}.ui-icon-minusthick{background-position:-64px -128px}.ui-icon-close{background-position:-80px -128px}.ui-icon-closethick{background-position:-96px -128px}.ui-icon-key{background-position:-112px -128px}.ui-icon-lightbulb{background-position:-128px -128px}.ui-icon-scissors{background-position:-144px -128px}.ui-icon-clipboard{background-position:-160px -128px}.ui-icon-copy{background-position:-176px -128px}.ui-icon-contact{background-position:-192px -128px}.ui-icon-image{background-position:-208px -128px}.ui-icon-video{background-position:-224px -128px}.ui-icon-script{background-position:-240px -128px}.ui-icon-alert{background-position:0 -144px}.ui-icon-info{background-position:-16px -144px}.ui-icon-notice{background-position:-32px -144px}.ui-icon-help{background-position:-48px -144px}.ui-icon-check{background-position:-64px -144px}.ui-icon-bullet{background-position:-80px -144px}.ui-icon-radio-on{background-position:-96px -144px}.ui-icon-radio-off{background-position:-112px -144px}.ui-icon-pin-w{background-position:-128px -144px}.ui-icon-pin-s{background-position:-144px -144px}.ui-icon-play{background-position:0 -160px}.ui-icon-pause{background-position:-16px -160px}.ui-icon-seek-next{background-position:-32px -160px}.ui-icon-seek-prev{background-position:-48px -160px}.ui-icon-seek-end{background-position:-64px -160px}.ui-icon-seek-start{background-position:-80px -160px}.ui-icon-seek-first{background-position:-80px -160px}.ui-icon-stop{background-position:-96px -160px}.ui-icon-eject{background-position:-112px -160px}.ui-icon-volume-off{background-position:-128px -160px}.ui-icon-volume-on{background-position:-144px -160px}.ui-icon-power{background-position:0 -176px}.ui-icon-signal-diag{background-position:-16px -176px}.ui-icon-signal{background-position:-32px -176px}.ui-icon-battery-0{background-position:-48px -176px}.ui-icon-battery-1{background-position:-64px -176px}.ui-icon-battery-2{background-position:-80px -176px}.ui-icon-battery-3{background-position:-96px -176px}.ui-icon-circle-plus{background-position:0 -192px}.ui-icon-circle-minus{background-position:-16px -192px}.ui-icon-circle-close{background-position:-32px -192px}.ui-icon-circle-triangle-e{background-position:-48px -192px}.ui-icon-circle-triangle-s{background-position:-64px -192px}.ui-icon-circle-triangle-w{background-position:-80px -192px}.ui-icon-circle-triangle-n{background-position:-96px -192px}.ui-icon-circle-arrow-e{background-position:-112px -192px}.ui-icon-circle-arrow-s{background-position:-128px -192px}.ui-icon-circle-arrow-w{background-position:-144px -192px}.ui-icon-circle-arrow-n{background-position:-160px -192px}.ui-icon-circle-zoomin{background-position:-176px -192px}.ui-icon-circle-zoomout{background-position:-192px -192px}.ui-icon-circle-check{background-position:-208px -192px}.ui-icon-circlesmall-plus{background-position:0 -208px}.ui-icon-circlesmall-minus{background-position:-16px -208px}.ui-icon-circlesmall-close{background-position:-32px -208px}.ui-icon-squaresmall-plus{background-position:-48px -208px}.ui-icon-squaresmall-minus{background-position:-64px -208px}.ui-icon-squaresmall-close{background-position:-80px -208px}.ui-icon-grip-dotted-vertical{background-position:0 -224px}.ui-icon-grip-dotted-horizontal{background-position:-16px -224px}.ui-icon-grip-solid-vertical{background-position:-32px -224px}.ui-icon-grip-solid-horizontal{background-position:-48px -224px}.ui-icon-gripsmall-diagonal-se{background-position:-64px -224px}.ui-icon-grip-diagonal-se{background-position:-80px -224px}.ui-corner-all,.ui-corner-top,.ui-corner-left,.ui-corner-tl{border-top-left-radius:0}.ui-corner-all,.ui-corner-top,.ui-corner-right,.ui-corner-tr{border-top-right-radius:0}.ui-corner-all,.ui-corner-bottom,.ui-corner-left,.ui-corner-bl{border-bottom-left-radius:0}.ui-corner-all,.ui-corner-bottom,.ui-corner-right,.ui-corner-br{border-bottom-right-radius:0}.ui-widget-overlay{background:#333 url(images/ui-bg_flat_0_333_40x100.png) 50% 50% repeat-x;opacity:.3;filter:Alpha(Opacity=30)}.ui-widget-shadow{margin:-2px 0 0 -2px;padding:2px;background:#aaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;opacity:.3;filter:Alpha(Opacity=30);border-radius:2px}.ui-tabs-nav .ui-corner-top{-khtml-border-top-left-radius:4px;-khtml-border-top-right-radius:4px;-moz-border-radius-topleft:4px;-moz-border-radius-topright:4px;-webkit-border-top-left-radius:4px;-webkit-border-top-right-radius:4px;border-top-left-radius:4px;border-top-right-radius:4px;border:1px solid #dfdfdf}.ngg_settings_template_wrapper .ui-combobox-input{padding:0 !important}.ui-tabs .ui-tabs-nav li{background:white;font-family:"HelveticaNeue-Light","Helvetica Neue Light","Helvetica Neue",sans-serif;margin-bottom:-1px;margin-right:.5em}.ui-tabs .ui-tabs-nav li a{color:#aaa;outline:0;font-size:120%}.ui-tabs .ui-tabs-nav li a:hover{color:#d54e21}.ui-tabs .ui-tabs-nav li.ui-tabs-active{padding-bottom:-1px}.ui-tabs .ui-tabs-nav li.ui-tabs-active a{color:#464646}.ui-tabs .ui-tabs-nav li.ui-tabs-selected{border-top:1px solid #8a8a8a;border-right:1px solid #8a8a8a;border-left:1px solid #8a8a8a;border-bottom:1px solid #fff}.ui-tabs-icon+ul.ui-tabs-nav{-moz-border-radius-bottomleft:0;-webkit-border-bottom-left-radius:0;-khtml-border-bottom-left-radius:0;border-bottom-left-radius:0}.ui-tabs-icon{float:left;background:url('images/nextgen-logo-small.jpg') no-repeat left center;font-size:18px;font-family:HelveticaNeue-Light,'Helvetica Neue Light','Helvetica Neue',sans-serif;width:200px;height:40px}.ui-tabs-icon .nextgen_logo{display:none}.ui-tabs-icon .nextgen_logo_sub{display:none;font-size:14px}.ui-widget-overlay{background:#000 50% 50% repeat-x;opacity:.4;filter:Alpha(Opacity=40);filter:-\9}.ui-widget select{height:2em}.ui-autocomplete{z-index:250}h3.ui-accordion-header.ui-state-default,h3.ui-accordion-header{margin:3px 0 0 0;font-size:14px;font-weight:600;line-height:20px}h3.ui-accordion-header a:focus,h3.ui-accordion-header:focus{outline:0;box-shadow:none}h3.ui-accordion-header.ui-state-active{border-bottom:1px solid #eee}div.accordion{margin-top:10px} \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/jquery-ui/jquery-ui-1.9.1.custom.min.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/jquery-ui/jquery-ui-1.9.1.custom.min.css new file mode 100644 index 0000000000000000000000000000000000000000..01b096090ff51444f51f8a87b5a37b5f94c1f443 --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/jquery-ui/jquery-ui-1.9.1.custom.min.css @@ -0,0 +1,6 @@ +/*! jQuery UI - v1.9.1 - 2012-11-05 +* http://jqueryui.com +* Includes: jquery.ui.core.css, jquery.ui.resizable.css, jquery.ui.selectable.css, jquery.ui.accordion.css, jquery.ui.autocomplete.css, jquery.ui.button.css, jquery.ui.datepicker.css, jquery.ui.dialog.css, jquery.ui.menu.css, jquery.ui.progressbar.css, jquery.ui.slider.css, jquery.ui.spinner.css, jquery.ui.tabs.css, jquery.ui.tooltip.css +* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=sans-serif&fwDefault=normal&fsDefault=12px&cornerRadius=4px&bgColorHeader=ececec&bgTextureHeader=03_highlight_soft.png&bgImgOpacityHeader=75&borderColorHeader=dfdfdf&fcHeader=333333&iconColorHeader=999999&bgColorContent=ffffff&bgTextureContent=01_flat.png&bgImgOpacityContent=75&borderColorContent=dfdfdf&fcContent=333333&iconColorContent=333333&bgColorDefault=ececec&bgTextureDefault=04_highlight_hard.png&bgImgOpacityDefault=75&borderColorDefault=dfdfdf&fcDefault=333333&iconColorDefault=333333&bgColorHover=ececec&bgTextureHover=06_inset_hard.png&bgImgOpacityHover=75&borderColorHover=cccccc&fcHover=000000&iconColorHover=333333&bgColorActive=ececec&bgTextureActive=01_flat.png&bgImgOpacityActive=65&borderColorActive=dfdfdf&fcActive=333333&iconColorActive=333333&bgColorHighlight=ffffe0&bgTextureHighlight=02_glass.png&bgImgOpacityHighlight=55&borderColorHighlight=e6db55&fcHighlight=333333&iconColorHighlight=21759b&bgColorError=ffebe8&bgTextureError=02_glass.png&bgImgOpacityError=95&borderColorError=cc0000&fcError=cc0000&iconColorError=cc0000&bgColorOverlay=aaaaaa&bgTextureOverlay=01_flat.png&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=01_flat.png&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=3px +* Copyright (c) 2012 jQuery Foundation and other contributors Licensed MIT */ + .ui-helper-hidden{display:none}.ui-helper-hidden-accessible{position:absolute !important;clip:rect(1px 1px 1px 1px);clip:rect(1px,1px,1px,1px)}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:before,.ui-helper-clearfix:after{content:"";display:table}.ui-helper-clearfix:after{clear:both}.ui-helper-clearfix{zoom:1}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}.ui-state-disabled{cursor:default !important}.ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-overlay{position:absolute;top:0;left:0;width:100%;height:100%}.ui-resizable{position:relative}.ui-resizable-handle{position:absolute;font-size:.1px;display:block}.ui-resizable-disabled .ui-resizable-handle,.ui-resizable-autohide .ui-resizable-handle{display:none}.ui-resizable-n{cursor:n-resize;height:7px;width:100%;top:-5px;left:0}.ui-resizable-s{cursor:s-resize;height:7px;width:100%;bottom:-5px;left:0}.ui-resizable-e{cursor:e-resize;width:7px;right:-5px;top:0;height:100%}.ui-resizable-w{cursor:w-resize;width:7px;left:-5px;top:0;height:100%}.ui-resizable-se{cursor:se-resize;width:12px;height:12px;right:1px;bottom:1px}.ui-resizable-sw{cursor:sw-resize;width:9px;height:9px;left:-5px;bottom:-5px}.ui-resizable-nw{cursor:nw-resize;width:9px;height:9px;left:-5px;top:-5px}.ui-resizable-ne{cursor:ne-resize;width:9px;height:9px;right:-5px;top:-5px}.ui-selectable-helper{position:absolute;z-index:100;border:1px dotted black}.ui-accordion .ui-accordion-header{display:block;cursor:pointer;position:relative;margin-top:2px;padding:.5em .5em .5em .7em;zoom:1}.ui-accordion .ui-accordion-icons{padding-left:2.2em}.ui-accordion .ui-accordion-noicons{padding-left:.7em}.ui-accordion .ui-accordion-icons .ui-accordion-icons{padding-left:2.2em}.ui-accordion .ui-accordion-header .ui-accordion-header-icon{position:absolute;left:.5em;top:50%;margin-top:-8px}.ui-accordion .ui-accordion-content{padding:1em 2.2em;border-top:0;overflow:auto;zoom:1}.ui-autocomplete{position:absolute;top:0;cursor:default}* html .ui-autocomplete{width:1px}.ui-button{display:inline-block;position:relative;padding:0;margin-right:.1em;cursor:pointer;text-align:center;zoom:1;overflow:visible}.ui-button,.ui-button:link,.ui-button:visited,.ui-button:hover,.ui-button:active{text-decoration:none}.ui-button-icon-only{width:2.2em}button.ui-button-icon-only{width:2.4em}.ui-button-icons-only{width:3.4em}button.ui-button-icons-only{width:3.7em}.ui-button .ui-button-text{display:block;line-height:1.4}.ui-button-text-only .ui-button-text{padding:.4em 1em}.ui-button-icon-only .ui-button-text,.ui-button-icons-only .ui-button-text{padding:.4em;text-indent:-9999999px}.ui-button-text-icon-primary .ui-button-text,.ui-button-text-icons .ui-button-text{padding:.4em 1em .4em 2.1em}.ui-button-text-icon-secondary .ui-button-text,.ui-button-text-icons .ui-button-text{padding:.4em 2.1em .4em 1em}.ui-button-text-icons .ui-button-text{padding-left:2.1em;padding-right:2.1em}input.ui-button{padding:.4em 1em}.ui-button-icon-only .ui-icon,.ui-button-text-icon-primary .ui-icon,.ui-button-text-icon-secondary .ui-icon,.ui-button-text-icons .ui-icon,.ui-button-icons-only .ui-icon{position:absolute;top:50%;margin-top:-8px}.ui-button-icon-only .ui-icon{left:50%;margin-left:-8px}.ui-button-text-icon-primary .ui-button-icon-primary,.ui-button-text-icons .ui-button-icon-primary,.ui-button-icons-only .ui-button-icon-primary{left:.5em}.ui-button-text-icon-secondary .ui-button-icon-secondary,.ui-button-text-icons .ui-button-icon-secondary,.ui-button-icons-only .ui-button-icon-secondary{right:.5em}.ui-button-text-icons .ui-button-icon-secondary,.ui-button-icons-only .ui-button-icon-secondary{right:.5em}.ui-buttonset{margin-right:7px}.ui-buttonset .ui-button{margin-left:0;margin-right:-.3em}button.ui-button::-moz-focus-inner{border:0;padding:0}.ui-datepicker{width:17em;padding:.2em .2em 0;display:none}.ui-datepicker .ui-datepicker-header{position:relative;padding:.2em 0}.ui-datepicker .ui-datepicker-prev,.ui-datepicker .ui-datepicker-next{position:absolute;top:2px;width:1.8em;height:1.8em}.ui-datepicker .ui-datepicker-prev-hover,.ui-datepicker .ui-datepicker-next-hover{top:1px}.ui-datepicker .ui-datepicker-prev{left:2px}.ui-datepicker .ui-datepicker-next{right:2px}.ui-datepicker .ui-datepicker-prev-hover{left:1px}.ui-datepicker .ui-datepicker-next-hover{right:1px}.ui-datepicker .ui-datepicker-prev span,.ui-datepicker .ui-datepicker-next span{display:block;position:absolute;left:50%;margin-left:-8px;top:50%;margin-top:-8px}.ui-datepicker .ui-datepicker-title{margin:0 2.3em;line-height:1.8em;text-align:center}.ui-datepicker .ui-datepicker-title select{font-size:1em;margin:1px 0}.ui-datepicker select.ui-datepicker-month-year{width:100%}.ui-datepicker select.ui-datepicker-month,.ui-datepicker select.ui-datepicker-year{width:49%}.ui-datepicker table{width:100%;font-size:.9em;border-collapse:collapse;margin:0 0 .4em}.ui-datepicker th{padding:.7em .3em;text-align:center;font-weight:bold;border:0}.ui-datepicker td{border:0;padding:1px}.ui-datepicker td span,.ui-datepicker td a{display:block;padding:.2em;text-align:right;text-decoration:none}.ui-datepicker .ui-datepicker-buttonpane{background-image:none;margin:.7em 0 0 0;padding:0 .2em;border-left:0;border-right:0;border-bottom:0}.ui-datepicker .ui-datepicker-buttonpane button{float:right;margin:.5em .2em .4em;cursor:pointer;padding:.2em .6em .3em .6em;width:auto;overflow:visible}.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current{float:left}.ui-datepicker.ui-datepicker-multi{width:auto}.ui-datepicker-multi .ui-datepicker-group{float:left}.ui-datepicker-multi .ui-datepicker-group table{width:95%;margin:0 auto .4em}.ui-datepicker-multi-2 .ui-datepicker-group{width:50%}.ui-datepicker-multi-3 .ui-datepicker-group{width:33.3%}.ui-datepicker-multi-4 .ui-datepicker-group{width:25%}.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header{border-left-width:0}.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header{border-left-width:0}.ui-datepicker-multi .ui-datepicker-buttonpane{clear:left}.ui-datepicker-row-break{clear:both;width:100%;font-size:0}.ui-datepicker-rtl{direction:rtl}.ui-datepicker-rtl .ui-datepicker-prev{right:2px;left:auto}.ui-datepicker-rtl .ui-datepicker-next{left:2px;right:auto}.ui-datepicker-rtl .ui-datepicker-prev:hover{right:1px;left:auto}.ui-datepicker-rtl .ui-datepicker-next:hover{left:1px;right:auto}.ui-datepicker-rtl .ui-datepicker-buttonpane{clear:right}.ui-datepicker-rtl .ui-datepicker-buttonpane button{float:left}.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current{float:right}.ui-datepicker-rtl .ui-datepicker-group{float:right}.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header{border-right-width:0;border-left-width:1px}.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header{border-right-width:0;border-left-width:1px}.ui-datepicker-cover{position:absolute;z-index:-1;filter:mask();top:-4px;left:-4px;width:200px;height:200px}.ui-dialog{position:absolute;padding:.2em;width:300px;overflow:hidden}.ui-dialog .ui-dialog-titlebar{padding:.4em 1em;position:relative}.ui-dialog .ui-dialog-title{float:left;margin:.1em 16px .1em 0}.ui-dialog .ui-dialog-titlebar-close{position:absolute;right:.3em;top:50%;width:19px;margin:-10px 0 0 0;padding:1px;height:18px}.ui-dialog .ui-dialog-titlebar-close span{display:block}.ui-dialog .ui-dialog-titlebar-close:hover,.ui-dialog .ui-dialog-titlebar-close:focus{padding:0}.ui-dialog .ui-dialog-content{position:relative;border:0;padding:.5em 1em;background:none;overflow:auto;zoom:1}.ui-dialog .ui-dialog-buttonpane{text-align:left;border-width:1px 0 0 0;background-image:none;margin:.5em 0 0 0;padding:.3em 1em .5em .4em}.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset{float:right}.ui-dialog .ui-dialog-buttonpane button{margin:.5em .4em .5em 0;cursor:pointer}.ui-dialog .ui-resizable-se{width:14px;height:14px;right:3px;bottom:3px}.ui-draggable .ui-dialog-titlebar{cursor:move}.ui-menu{list-style:none;padding:2px;margin:0;display:block;outline:0}.ui-menu .ui-menu{margin-top:-3px;position:absolute}.ui-menu .ui-menu-item{margin:0;padding:0;zoom:1;width:100%}.ui-menu .ui-menu-divider{margin:5px -2px 5px -2px;height:0;font-size:0;line-height:0;border-width:1px 0 0 0}.ui-menu .ui-menu-item a{text-decoration:none;display:block;padding:2px .4em;line-height:1.5;zoom:1;font-weight:normal}.ui-menu .ui-menu-item a.ui-state-focus,.ui-menu .ui-menu-item a.ui-state-active{font-weight:normal;margin:-1px}.ui-menu .ui-state-disabled{font-weight:normal;margin:.4em 0 .2em;line-height:1.5}.ui-menu .ui-state-disabled a{cursor:default}.ui-menu-icons{position:relative}.ui-menu-icons .ui-menu-item a{position:relative;padding-left:2em}.ui-menu .ui-icon{position:absolute;top:.2em;left:.2em}.ui-menu .ui-menu-icon{position:static;float:right}.ui-progressbar{height:2em;text-align:left;overflow:hidden}.ui-progressbar .ui-progressbar-value{margin:-1px;height:100%}.ui-slider{position:relative;text-align:left}.ui-slider .ui-slider-handle{position:absolute;z-index:2;width:1.2em;height:1.2em;cursor:default}.ui-slider .ui-slider-range{position:absolute;z-index:1;font-size:.7em;display:block;border:0;background-position:0 0}.ui-slider-horizontal{height:.8em}.ui-slider-horizontal .ui-slider-handle{top:-.3em;margin-left:-.6em}.ui-slider-horizontal .ui-slider-range{top:0;height:100%}.ui-slider-horizontal .ui-slider-range-min{left:0}.ui-slider-horizontal .ui-slider-range-max{right:0}.ui-slider-vertical{width:.8em;height:100px}.ui-slider-vertical .ui-slider-handle{left:-.3em;margin-left:0;margin-bottom:-.6em}.ui-slider-vertical .ui-slider-range{left:0;width:100%}.ui-slider-vertical .ui-slider-range-min{bottom:0}.ui-slider-vertical .ui-slider-range-max{top:0}.ui-spinner{position:relative;display:inline-block;overflow:hidden;padding:0;vertical-align:middle}.ui-spinner-input{border:0;background:none;padding:0;margin:.2em 0;vertical-align:middle;margin-left:.4em;margin-right:22px}.ui-spinner-button{width:16px;height:50%;font-size:.5em;padding:0;margin:0;text-align:center;position:absolute;cursor:default;display:block;overflow:hidden;right:0}.ui-spinner a.ui-spinner-button{border-top:0;border-bottom:0;border-right:0}.ui-spinner .ui-icon{position:absolute;margin-top:-8px;top:50%;left:0}.ui-spinner-up{top:0}.ui-spinner-down{bottom:0}.ui-spinner .ui-icon-triangle-1-s{background-position:-65px -16px}.ui-tabs{position:relative;padding:.2em;zoom:1}.ui-tabs .ui-tabs-nav{margin:0;padding:.2em .2em 0}.ui-tabs .ui-tabs-nav li{list-style:none;float:left;position:relative;top:0;margin:1px .2em 0 0;border-bottom:0;padding:0;white-space:nowrap}.ui-tabs .ui-tabs-nav li a{float:left;padding:.5em 1em;text-decoration:none}.ui-tabs .ui-tabs-nav li.ui-tabs-active{margin-bottom:-1px;padding-bottom:1px}.ui-tabs .ui-tabs-nav li.ui-tabs-active a,.ui-tabs .ui-tabs-nav li.ui-state-disabled a,.ui-tabs .ui-tabs-nav li.ui-tabs-loading a{cursor:text}.ui-tabs .ui-tabs-nav li a,.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active a{cursor:pointer}.ui-tabs .ui-tabs-panel{display:block;border-width:0;padding:1em 1.4em;background:none}.ui-tooltip{padding:8px;position:absolute;z-index:9999;max-width:300px;-webkit-box-shadow:0 0 5px #aaa;box-shadow:0 0 5px #aaa}* html .ui-tooltip{background-image:none}body .ui-tooltip{border-width:2px}.ui-widget{font-family:sans-serif;font-size:12px}.ui-widget .ui-widget{font-size:1em}.ui-widget input,.ui-widget select,.ui-widget textarea,.ui-widget button{font-family:sans-serif;font-size:1em}.ui-widget-content{border:1px solid #dfdfdf;background:#fff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x;color:#333}.ui-widget-content a{color:#333}.ui-widget-header{border:1px solid #dfdfdf;background:#ececec url(images/ui-bg_highlight-soft_75_ececec_1x100.png) 50% 50% repeat-x;color:#333;font-weight:bold}.ui-widget-header a{color:#333}.ui-state-default,.ui-widget-content .ui-state-default,.ui-widget-header .ui-state-default{border:1px solid #dfdfdf;background:#ececec url(images/ui-bg_highlight-hard_75_ececec_1x100.png) 50% 50% repeat-x;font-weight:normal;color:#333}.ui-state-default a,.ui-state-default a:link,.ui-state-default a:visited{color:#333;text-decoration:none}.ui-state-hover,.ui-widget-content .ui-state-hover,.ui-widget-header .ui-state-hover,.ui-state-focus,.ui-widget-content .ui-state-focus,.ui-widget-header .ui-state-focus{border:1px solid #ccc;background:#ececec url(images/ui-bg_inset-hard_75_ececec_1x100.png) 50% 50% repeat-x;font-weight:normal;color:#000}.ui-state-hover a,.ui-state-hover a:hover,.ui-state-hover a:link,.ui-state-hover a:visited{color:#000;text-decoration:none}.ui-state-active,.ui-widget-content .ui-state-active,.ui-widget-header .ui-state-active{border:1px solid #dfdfdf;background:#ececec url(images/ui-bg_flat_65_ececec_40x100.png) 50% 50% repeat-x;font-weight:normal;color:#333}.ui-state-active a,.ui-state-active a:link,.ui-state-active a:visited{color:#333;text-decoration:none}.ui-state-highlight,.ui-widget-content .ui-state-highlight,.ui-widget-header .ui-state-highlight{border:1px solid #e6db55;background:#ffffe0 url(images/ui-bg_glass_55_ffffe0_1x400.png) 50% 50% repeat-x;color:#333}.ui-state-highlight a,.ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a{color:#333}.ui-state-error,.ui-widget-content .ui-state-error,.ui-widget-header .ui-state-error{border:1px solid #c00;background:#ffebe8 url(images/ui-bg_glass_95_ffebe8_1x400.png) 50% 50% repeat-x;color:#c00}.ui-state-error a,.ui-widget-content .ui-state-error a,.ui-widget-header .ui-state-error a{color:#c00}.ui-state-error-text,.ui-widget-content .ui-state-error-text,.ui-widget-header .ui-state-error-text{color:#c00}.ui-priority-primary,.ui-widget-content .ui-priority-primary,.ui-widget-header .ui-priority-primary{font-weight:bold}.ui-priority-secondary,.ui-widget-content .ui-priority-secondary,.ui-widget-header .ui-priority-secondary{opacity:.7;filter:Alpha(Opacity=70);font-weight:normal}.ui-state-disabled,.ui-widget-content .ui-state-disabled,.ui-widget-header .ui-state-disabled{opacity:.35;filter:Alpha(Opacity=35);background-image:none}.ui-state-disabled .ui-icon{filter:Alpha(Opacity=35)}.ui-icon{width:16px;height:16px;background-image:url(images/ui-icons_333333_256x240.png)}.ui-widget-content .ui-icon{background-image:url(images/ui-icons_333333_256x240.png)}.ui-widget-header .ui-icon{background-image:url(images/ui-icons_999999_256x240.png)}.ui-state-default .ui-icon{background-image:url(images/ui-icons_333333_256x240.png)}.ui-state-hover .ui-icon,.ui-state-focus .ui-icon{background-image:url(images/ui-icons_333333_256x240.png)}.ui-state-active .ui-icon{background-image:url(images/ui-icons_333333_256x240.png)}.ui-state-highlight .ui-icon{background-image:url(images/ui-icons_21759b_256x240.png)}.ui-state-error .ui-icon,.ui-state-error-text .ui-icon{background-image:url(images/ui-icons_cc0000_256x240.png)}.ui-icon-carat-1-n{background-position:0 0}.ui-icon-carat-1-ne{background-position:-16px 0}.ui-icon-carat-1-e{background-position:-32px 0}.ui-icon-carat-1-se{background-position:-48px 0}.ui-icon-carat-1-s{background-position:-64px 0}.ui-icon-carat-1-sw{background-position:-80px 0}.ui-icon-carat-1-w{background-position:-96px 0}.ui-icon-carat-1-nw{background-position:-112px 0}.ui-icon-carat-2-n-s{background-position:-128px 0}.ui-icon-carat-2-e-w{background-position:-144px 0}.ui-icon-triangle-1-n{background-position:0 -16px}.ui-icon-triangle-1-ne{background-position:-16px -16px}.ui-icon-triangle-1-e{background-position:-32px -16px}.ui-icon-triangle-1-se{background-position:-48px -16px}.ui-icon-triangle-1-s{background-position:-64px -16px}.ui-icon-triangle-1-sw{background-position:-80px -16px}.ui-icon-triangle-1-w{background-position:-96px -16px}.ui-icon-triangle-1-nw{background-position:-112px -16px}.ui-icon-triangle-2-n-s{background-position:-128px -16px}.ui-icon-triangle-2-e-w{background-position:-144px -16px}.ui-icon-arrow-1-n{background-position:0 -32px}.ui-icon-arrow-1-ne{background-position:-16px -32px}.ui-icon-arrow-1-e{background-position:-32px -32px}.ui-icon-arrow-1-se{background-position:-48px -32px}.ui-icon-arrow-1-s{background-position:-64px -32px}.ui-icon-arrow-1-sw{background-position:-80px -32px}.ui-icon-arrow-1-w{background-position:-96px -32px}.ui-icon-arrow-1-nw{background-position:-112px -32px}.ui-icon-arrow-2-n-s{background-position:-128px -32px}.ui-icon-arrow-2-ne-sw{background-position:-144px -32px}.ui-icon-arrow-2-e-w{background-position:-160px -32px}.ui-icon-arrow-2-se-nw{background-position:-176px -32px}.ui-icon-arrowstop-1-n{background-position:-192px -32px}.ui-icon-arrowstop-1-e{background-position:-208px -32px}.ui-icon-arrowstop-1-s{background-position:-224px -32px}.ui-icon-arrowstop-1-w{background-position:-240px -32px}.ui-icon-arrowthick-1-n{background-position:0 -48px}.ui-icon-arrowthick-1-ne{background-position:-16px -48px}.ui-icon-arrowthick-1-e{background-position:-32px -48px}.ui-icon-arrowthick-1-se{background-position:-48px -48px}.ui-icon-arrowthick-1-s{background-position:-64px -48px}.ui-icon-arrowthick-1-sw{background-position:-80px -48px}.ui-icon-arrowthick-1-w{background-position:-96px -48px}.ui-icon-arrowthick-1-nw{background-position:-112px -48px}.ui-icon-arrowthick-2-n-s{background-position:-128px -48px}.ui-icon-arrowthick-2-ne-sw{background-position:-144px -48px}.ui-icon-arrowthick-2-e-w{background-position:-160px -48px}.ui-icon-arrowthick-2-se-nw{background-position:-176px -48px}.ui-icon-arrowthickstop-1-n{background-position:-192px -48px}.ui-icon-arrowthickstop-1-e{background-position:-208px -48px}.ui-icon-arrowthickstop-1-s{background-position:-224px -48px}.ui-icon-arrowthickstop-1-w{background-position:-240px -48px}.ui-icon-arrowreturnthick-1-w{background-position:0 -64px}.ui-icon-arrowreturnthick-1-n{background-position:-16px -64px}.ui-icon-arrowreturnthick-1-e{background-position:-32px -64px}.ui-icon-arrowreturnthick-1-s{background-position:-48px -64px}.ui-icon-arrowreturn-1-w{background-position:-64px -64px}.ui-icon-arrowreturn-1-n{background-position:-80px -64px}.ui-icon-arrowreturn-1-e{background-position:-96px -64px}.ui-icon-arrowreturn-1-s{background-position:-112px -64px}.ui-icon-arrowrefresh-1-w{background-position:-128px -64px}.ui-icon-arrowrefresh-1-n{background-position:-144px -64px}.ui-icon-arrowrefresh-1-e{background-position:-160px -64px}.ui-icon-arrowrefresh-1-s{background-position:-176px -64px}.ui-icon-arrow-4{background-position:0 -80px}.ui-icon-arrow-4-diag{background-position:-16px -80px}.ui-icon-extlink{background-position:-32px -80px}.ui-icon-newwin{background-position:-48px -80px}.ui-icon-refresh{background-position:-64px -80px}.ui-icon-shuffle{background-position:-80px -80px}.ui-icon-transfer-e-w{background-position:-96px -80px}.ui-icon-transferthick-e-w{background-position:-112px -80px}.ui-icon-folder-collapsed{background-position:0 -96px}.ui-icon-folder-open{background-position:-16px -96px}.ui-icon-document{background-position:-32px -96px}.ui-icon-document-b{background-position:-48px -96px}.ui-icon-note{background-position:-64px -96px}.ui-icon-mail-closed{background-position:-80px -96px}.ui-icon-mail-open{background-position:-96px -96px}.ui-icon-suitcase{background-position:-112px -96px}.ui-icon-comment{background-position:-128px -96px}.ui-icon-person{background-position:-144px -96px}.ui-icon-print{background-position:-160px -96px}.ui-icon-trash{background-position:-176px -96px}.ui-icon-locked{background-position:-192px -96px}.ui-icon-unlocked{background-position:-208px -96px}.ui-icon-bookmark{background-position:-224px -96px}.ui-icon-tag{background-position:-240px -96px}.ui-icon-home{background-position:0 -112px}.ui-icon-flag{background-position:-16px -112px}.ui-icon-calendar{background-position:-32px -112px}.ui-icon-cart{background-position:-48px -112px}.ui-icon-pencil{background-position:-64px -112px}.ui-icon-clock{background-position:-80px -112px}.ui-icon-disk{background-position:-96px -112px}.ui-icon-calculator{background-position:-112px -112px}.ui-icon-zoomin{background-position:-128px -112px}.ui-icon-zoomout{background-position:-144px -112px}.ui-icon-search{background-position:-160px -112px}.ui-icon-wrench{background-position:-176px -112px}.ui-icon-gear{background-position:-192px -112px}.ui-icon-heart{background-position:-208px -112px}.ui-icon-star{background-position:-224px -112px}.ui-icon-link{background-position:-240px -112px}.ui-icon-cancel{background-position:0 -128px}.ui-icon-plus{background-position:-16px -128px}.ui-icon-plusthick{background-position:-32px -128px}.ui-icon-minus{background-position:-48px -128px}.ui-icon-minusthick{background-position:-64px -128px}.ui-icon-close{background-position:-80px -128px}.ui-icon-closethick{background-position:-96px -128px}.ui-icon-key{background-position:-112px -128px}.ui-icon-lightbulb{background-position:-128px -128px}.ui-icon-scissors{background-position:-144px -128px}.ui-icon-clipboard{background-position:-160px -128px}.ui-icon-copy{background-position:-176px -128px}.ui-icon-contact{background-position:-192px -128px}.ui-icon-image{background-position:-208px -128px}.ui-icon-video{background-position:-224px -128px}.ui-icon-script{background-position:-240px -128px}.ui-icon-alert{background-position:0 -144px}.ui-icon-info{background-position:-16px -144px}.ui-icon-notice{background-position:-32px -144px}.ui-icon-help{background-position:-48px -144px}.ui-icon-check{background-position:-64px -144px}.ui-icon-bullet{background-position:-80px -144px}.ui-icon-radio-on{background-position:-96px -144px}.ui-icon-radio-off{background-position:-112px -144px}.ui-icon-pin-w{background-position:-128px -144px}.ui-icon-pin-s{background-position:-144px -144px}.ui-icon-play{background-position:0 -160px}.ui-icon-pause{background-position:-16px -160px}.ui-icon-seek-next{background-position:-32px -160px}.ui-icon-seek-prev{background-position:-48px -160px}.ui-icon-seek-end{background-position:-64px -160px}.ui-icon-seek-start{background-position:-80px -160px}.ui-icon-seek-first{background-position:-80px -160px}.ui-icon-stop{background-position:-96px -160px}.ui-icon-eject{background-position:-112px -160px}.ui-icon-volume-off{background-position:-128px -160px}.ui-icon-volume-on{background-position:-144px -160px}.ui-icon-power{background-position:0 -176px}.ui-icon-signal-diag{background-position:-16px -176px}.ui-icon-signal{background-position:-32px -176px}.ui-icon-battery-0{background-position:-48px -176px}.ui-icon-battery-1{background-position:-64px -176px}.ui-icon-battery-2{background-position:-80px -176px}.ui-icon-battery-3{background-position:-96px -176px}.ui-icon-circle-plus{background-position:0 -192px}.ui-icon-circle-minus{background-position:-16px -192px}.ui-icon-circle-close{background-position:-32px -192px}.ui-icon-circle-triangle-e{background-position:-48px -192px}.ui-icon-circle-triangle-s{background-position:-64px -192px}.ui-icon-circle-triangle-w{background-position:-80px -192px}.ui-icon-circle-triangle-n{background-position:-96px -192px}.ui-icon-circle-arrow-e{background-position:-112px -192px}.ui-icon-circle-arrow-s{background-position:-128px -192px}.ui-icon-circle-arrow-w{background-position:-144px -192px}.ui-icon-circle-arrow-n{background-position:-160px -192px}.ui-icon-circle-zoomin{background-position:-176px -192px}.ui-icon-circle-zoomout{background-position:-192px -192px}.ui-icon-circle-check{background-position:-208px -192px}.ui-icon-circlesmall-plus{background-position:0 -208px}.ui-icon-circlesmall-minus{background-position:-16px -208px}.ui-icon-circlesmall-close{background-position:-32px -208px}.ui-icon-squaresmall-plus{background-position:-48px -208px}.ui-icon-squaresmall-minus{background-position:-64px -208px}.ui-icon-squaresmall-close{background-position:-80px -208px}.ui-icon-grip-dotted-vertical{background-position:0 -224px}.ui-icon-grip-dotted-horizontal{background-position:-16px -224px}.ui-icon-grip-solid-vertical{background-position:-32px -224px}.ui-icon-grip-solid-horizontal{background-position:-48px -224px}.ui-icon-gripsmall-diagonal-se{background-position:-64px -224px}.ui-icon-grip-diagonal-se{background-position:-80px -224px}.ui-corner-all,.ui-corner-top,.ui-corner-left,.ui-corner-tl{-moz-border-radius-topleft:4px;-webkit-border-top-left-radius:4px;-khtml-border-top-left-radius:4px;border-top-left-radius:4px}.ui-corner-all,.ui-corner-top,.ui-corner-right,.ui-corner-tr{-moz-border-radius-topright:4px;-webkit-border-top-right-radius:4px;-khtml-border-top-right-radius:4px;border-top-right-radius:4px}.ui-corner-all,.ui-corner-bottom,.ui-corner-left,.ui-corner-bl{-moz-border-radius-bottomleft:4px;-webkit-border-bottom-left-radius:4px;-khtml-border-bottom-left-radius:4px;border-bottom-left-radius:4px}.ui-corner-all,.ui-corner-bottom,.ui-corner-right,.ui-corner-br{-moz-border-radius-bottomright:4px;-webkit-border-bottom-right-radius:4px;-khtml-border-bottom-right-radius:4px;border-bottom-right-radius:4px}.ui-widget-overlay{background:#aaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;opacity:.3;filter:Alpha(Opacity=30)}.ui-widget-shadow{margin:-8px 0 0 -8px;padding:8px;background:#aaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;opacity:.3;filter:Alpha(Opacity=30);-moz-border-radius:3px;-khtml-border-radius:3px;-webkit-border-radius:3px;border-radius:3px}.ui-icon{float:left}.ui-accordion .ui-accordion-header{font-size:1.17em;text-shadow:#fff 0 1px 0;font-family:Georgia,"Times New Roman","Bitstream Charter",Times,serif;line-height:1}.ui-tabs .ui-tabs-nav li{background:white;font-family:"HelveticaNeue-Light","Helvetica Neue Light","Helvetica Neue",sans-serif;margin-bottom:-1px;margin-right:.5em}.ui-tabs .ui-tabs-nav li a{color:#aaa;outline:0;font-size:120%}.ui-tabs .ui-tabs-nav li a:hover{color:#d54e21}.ui-tabs .ui-tabs-nav li.ui-tabs-active{padding-bottom:-1px}.ui-tabs .ui-tabs-nav li.ui-tabs-active a{color:#464646}.ui-tabs .ui-tabs-nav li.ui-tabs-selected{border-top:1px solid #8a8a8a;border-right:1px solid #8a8a8a;border-left:1px solid #8a8a8a;border-bottom:1px solid #fff}.ui-tabs-icon+ul.ui-tabs-nav{-moz-border-radius-bottomleft:0;-webkit-border-bottom-left-radius:0;-khtml-border-bottom-left-radius:0;border-bottom-left-radius:0}.ui-tabs-icon{float:left;background:url('images/nextgen-logo-small.jpg') no-repeat left center;font-size:18px;font-family:HelveticaNeue-Light,'Helvetica Neue Light','Helvetica Neue',sans-serif;width:200px;height:40px}.ui-tabs-icon .nextgen_logo{display:none}.ui-tabs-icon .nextgen_logo_sub{display:none;font-size:14px}.ui-widget-overlay{background:#000 50% 50% repeat-x;opacity:.4;filter:Alpha(Opacity=40);filter:-\9}.ui-widget select{height:2em} \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/jquery.nextgen_radio_toggle.min.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/jquery.nextgen_radio_toggle.min.js new file mode 100644 index 0000000000000000000000000000000000000000..06460c0926a160860d97ea6b660a67e28671a40a --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/jquery.nextgen_radio_toggle.min.js @@ -0,0 +1 @@ +eval(function(p,a,c,k,e,d){e=function(c){return c.toString(36)};if(!''.replace(/^/,String)){while(c--){d[c.toString(a)]=k[c]||c.toString(a)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('(1($){$.8.9=1(2,3){7 0.5(1(){6 $0=$(0);$0.a(\'g\',1(){b($0.2()==2){3.e(\'4\')}d{3.c(\'4\')}})})}})(f);',17,17,'this|function|val|target|slow|each|var|return|fn|nextgen_radio_toggle_tr|bind|if|hide|else|show|jQuery|change'.split('|'),0,{})) diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/nextgen_admin_page.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/nextgen_admin_page.js index a3747ed2f4f1984e9b914d6474d8e815f9562f8b..4a90db6bd3bc24a99d07462689e28aed27e7b73c 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/nextgen_admin_page.js +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/nextgen_admin_page.js @@ -4,63 +4,68 @@ jQuery(function($){ $('.accordion').accordion({ clearStyle: true, autoHeight: false, - heightStyle: 'content' + heightStyle: 'content', + collapsible: true, + icons: { + header: 'ui-icon-triangle-1-s', + activeHeader: 'ui-icon-triangle-1-n' + } }); - // When a submit button is clicked... - $('input[type="submit"], button[type="submit"]').click(function(e){ - var $button = $(this); - var message = false; + // When a submit button is clicked... + $('input[type="submit"], button[type="submit"]').click(function(e){ + var $button = $(this); + var message = false; - // Check if a confirmation dialog is required - if ((message = $button.attr('data-confirm'))) { - if (!confirm(message)) { - e.preventDefault(); - return; - } - } + // Check if a confirmation dialog is required + if ((message = $button.attr('data-confirm'))) { + if (!confirm(message)) { + e.preventDefault(); + return; + } + } - // Check if this is a proxy button for another field - if ($button.attr('name').indexOf('_proxy') != -1) { + // Check if this is a proxy button for another field + if ($button.attr('name').indexOf('_proxy') != -1) { - // Get the value to set - var value = $button.attr('data-proxy-value'); - if (!value) value = $button.attr('value'); + // Get the value to set + var value = $button.attr('data-proxy-value'); + if (!value) value = $button.attr('value'); - // Get the name of the field that is being proxied - var field_name = $button.attr('name').replace('_proxy', ''); + // Get the name of the field that is being proxied + var field_name = $button.attr('name').replace('_proxy', ''); - // Try getting the existing field - var $field = $('input[name="'+field_name+'"]'); - if ($field.length > 0) $field.val(value); - else { - $field = $('<input/>').attr({ - type: 'hidden', - name: field_name, - value: value - }); - $button.parents('form').append($field); - } - } - }); - - - // Toggle the advanced settings - $('.nextgen_advanced_toggle_link').on('click', function(e){ - e.preventDefault(); - var form_id = '#'+$(this).attr('rel'); - var btn = $(this); - $(form_id).toggle(500, 'swing', function(){ - if ($(this).hasClass('hidden')) { - $(this).removeClass('hidden'); - btn.text(btn.attr('active_label')); - } - else { - $(this).addClass('hidden'); - btn.text(btn.attr('hidden_label')); - } - }); - }); + // Try getting the existing field + var $field = $('input[name="'+field_name+'"]'); + if ($field.length > 0) $field.val(value); + else { + $field = $('<input/>').attr({ + type: 'hidden', + name: field_name, + value: value + }); + $button.parents('form').append($field); + } + } + }); + + + // Toggle the advanced settings + $('.nextgen_advanced_toggle_link').on('click', function(e){ + e.preventDefault(); + var form_id = '#'+$(this).attr('rel'); + var btn = $(this); + $(form_id).toggle(500, 'swing', function(){ + if ($(this).hasClass('hidden')) { + $(this).removeClass('hidden'); + btn.text(btn.attr('active_label')); + } + else { + $(this).addClass('hidden'); + btn.text(btn.attr('hidden_label')); + } + }); + }); $('input.nextgen_settings_field_colorpicker').wpColorPicker(); $('#ngg_page_content').css('visibility', 'visible'); diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/nextgen_admin_page.min.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/nextgen_admin_page.min.css new file mode 100644 index 0000000000000000000000000000000000000000..7fab7d9ae47662b9344ea5d23d0a7131313e3aa8 --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/nextgen_admin_page.min.css @@ -0,0 +1 @@ +.hidden{display:none}.nextgen_advanced_toggle_link{font-size:11px;position:relative;bottom:5px;color:#444}.url_field{width:400px}.nextgen_settings_colorpicker{width:85px !important;text-align:center;margin-left:50px}#nextgen_settings_wmXpos,#nextgen_settings_wmYpos{width:65px !important}table.nextgen_settings_position{width:auto !important}span.tooltip,label.tooltip{outline:0;background-image:url('information.png');background-repeat:no-repeat;padding-left:18px;padding-bottom:4px}#poststuff .ui-accordion h3{padding-left:25px}#lightbox_effects_content table tr td:first-child{vertical-align:top;text-align:right;padding-right:7px;padding-top:5px}#lightbox_effects_content tr{height:28px} \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/nextgen_admin_page.min.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/nextgen_admin_page.min.js new file mode 100644 index 0000000000000000000000000000000000000000..66e0eba555d143e44ceed3a88670b708fc70e766 --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/nextgen_admin_page.min.js @@ -0,0 +1 @@ +eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('C(a($){$(\'.t\').t({z:x,A:p,E:\'L\',J:x,I:{G:\'r-v-j-1-s\',H:\'r-v-j-1-n\'}});$(\'d[f="q"], 4[f="q"]\').l(a(e){5 $4=$(6);5 g=p;7((g=$4.2(\'i-o\'))){7(!o(g)){e.k();F}}7($4.2(\'c\').K(\'y\')!=-1){5 3=$4.2(\'i-D-3\');7(!3)3=$4.2(\'3\');5 h=$4.2(\'c\').B(\'y\',\'\');5 $8=$(\'d[c="\'+h+\'"]\');7($8.14>0)$8.13(3);w{$8=$(\'<d/>\').2({f:\'b\',c:h,3:3});$4.M(\'11\').10($8)}}});$(\'.15\').16(\'l\',a(e){e.k();5 m=\'#\'+$(6).2(\'17\');5 9=$(6);$(m).Z(Y,\'R\',a(){7($(6).Q(\'b\')){$(6).P(\'b\');9.u(9.2(\'N\'))}w{$(6).O(\'b\');9.u(9.2(\'S\'))}})});$(\'d.T\').X();$(\'#W\').V(\'U\',\'12\')});',62,70,'||attr|value|button|var|this|if|field|btn|function|hidden|name|input||type|message|field_name|data|triangle|preventDefault|click|form_id||confirm|false|submit|ui||accordion|text|icon|else|true|_proxy|clearStyle|autoHeight|replace|jQuery|proxy|heightStyle|return|header|activeHeader|icons|collapsible|indexOf|content|parents|active_label|addClass|removeClass|hasClass|swing|hidden_label|nextgen_settings_field_colorpicker|visibility|css|ngg_page_content|wpColorPicker|500|toggle|append|form|visible|val|length|nextgen_advanced_toggle_link|on|rel'.split('|'),0,{})) diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/ngg_progressbar.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/ngg_progressbar.js index 27fef37d9cc2cb9f613d835cc2f9c8117ed285a9..e4ec1856c8461c8c94f106dbb57a67a359461966 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/ngg_progressbar.js +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/ngg_progressbar.js @@ -54,7 +54,7 @@ // Closes the progress bar close: function(delay){ if (typeof(delay) == 'undefined') delay = 1000; - var gritter = this.find_gritter(window) + var gritter = this.find_gritter(window); var gritter_id = this.gritter_id; setTimeout(function(){ gritter.remove(gritter_id); diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/ngg_progressbar.min.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/ngg_progressbar.min.css new file mode 100644 index 0000000000000000000000000000000000000000..6386ae1135189c6de312c35b4167aa82691c94b6 --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/ngg_progressbar.min.css @@ -0,0 +1 @@ +.ngg_progressbar{width:100%;background:#292929;border:1px solid #111;border-radius:5px;overflow:hidden;box-shadow:0 0 5px #333;height:25px}.ngg_progressbar div{width:0;text-align:right;color:white;background-image:url('animation.gif');border:solid 1px darkolivegreen;overflow:hidden;border-radius:5px;height:100%;font-size:12px;padding-top:3px;font-family:Helvetica,Arial}.ngg_progressbar.infinite div{width:100%;text-align:center} \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/ngg_progressbar.min.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/ngg_progressbar.min.js new file mode 100644 index 0000000000000000000000000000000000000000..a53405bea364906d0d8279712559121a260fb0d6 --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/ngg_progressbar.min.js @@ -0,0 +1 @@ +eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('(2($){$.z=2(4){c g={s:{q:0,j:G,D:\'N L...\',I:\'J!\'},B:2(4){1.4=$.K(1.s,4);1.b=1.n(l).M({g:1,H:O,r:1.4.r,6:"<a F=\'i\'><a></a></a>",});1.v(l);8(1.4.j){1.5.w(\'.i\').E(\'j\')}1.A(1.4.q)},A:2(3,6){8(o(6)==\'m\')6=3;8(13(3)){6=3;3=Z}3=3+"%";1.x.Y({10:3}).6(6)},11:2(e){8(o(e)==\'m\')e=12;c f=1.n(l);c b=1.b;14(2(){f.X(b)},e)},h:2(9){c 7=9;W{R(7.t!==7.u.t)7=7.u}P(C){8(o(y)!="m")y.Q(C)}d 7},n:2(9){d 1.h(9).k.f},v:2(9){c p=\'#f-S-\'+1.b;1.5=$(p);8(1.5.T==0){1.5=1.h(9).k(p)}1.x=1.5.w(\'.i:V a\');1.5.U(\'z\',1);d 1.5}};g.B(4);d g}})(k);',62,67,'|this|function|percent|options|gritter_el|text|retval|if|win|div|gritter_id|var|return|delay|gritter|progressBar|find_parent|ngg_progressbar|infinite|jQuery|window|undefined|find_gritter|typeof|selector|starting_value|title|defaults|document|parent|find_gritter_el|find|status_el|console|nggProgressBar|set|init|ex|in_progress_text|addClass|class|false|sticky|finished_text|Done|extend|progress|add|In|true|catch|log|while|item|length|data|first|try|remove|animate|100|width|close|1000|isNaN|setTimeout'.split('|'),0,{})) diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/select2/select2.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/select2/select2.css index 3eae7318e18bd3fad4c7b2917e1438ebd3704b8d..a57e15dedd044fdbaf1c1fb249bd20c88be774a8 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/select2/select2.css +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/select2/select2.css @@ -1,30 +1,28 @@ /* -Version: @@ver@@ Timestamp: @@timestamp@@ +Version: 3.5.2 Timestamp: Sat Nov 1 14:43:36 EDT 2014 */ .select2-container { + margin: 0; position: relative; display: inline-block; /* inline-block for ie7 */ zoom: 1; *display: inline; - vertical-align: top; + vertical-align: middle; } .select2-container, .select2-drop, .select2-search, -.select2-search input{ - /* - Force border-box so that % widths fit the parent - container without overlap because of margin/padding. - - More Info : http://www.quirksmode.org/css/box.html - */ - -webkit-box-sizing: border-box; /* webkit */ - -khtml-box-sizing: border-box; /* konqueror */ - -moz-box-sizing: border-box; /* firefox */ - -ms-box-sizing: border-box; /* ie */ - box-sizing: border-box; /* css3 */ +.select2-search input { + /* + Force border-box so that % widths fit the parent + container without overlap because of margin/padding. + More Info : http://www.quirksmode.org/css/box.html + */ + -webkit-box-sizing: border-box; /* webkit */ + -moz-box-sizing: border-box; /* firefox */ + box-sizing: border-box; /* css3 */ } .select2-container .select2-choice { @@ -40,58 +38,67 @@ Version: @@ver@@ Timestamp: @@timestamp@@ color: #444; text-decoration: none; - -webkit-border-radius: 4px; - -moz-border-radius: 4px; - border-radius: 4px; + border-radius: 4px; + + background-clip: padding-box; - -webkit-background-clip: padding-box; - -moz-background-clip: padding; - background-clip: padding-box; + -webkit-touch-callout: none; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; background-color: #fff; - background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #eeeeee), color-stop(0.5, white)); - background-image: -webkit-linear-gradient(center bottom, #eeeeee 0%, white 50%); - background-image: -moz-linear-gradient(center bottom, #eeeeee 0%, white 50%); - background-image: -o-linear-gradient(bottom, #eeeeee 0%, #ffffff 50%); - background-image: -ms-linear-gradient(top, #ffffff 0%, #eeeeee 50%); + background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #eee), color-stop(0.5, #fff)); + background-image: -webkit-linear-gradient(center bottom, #eee 0%, #fff 50%); + background-image: -moz-linear-gradient(center bottom, #eee 0%, #fff 50%); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr = '#ffffff', endColorstr = '#eeeeee', GradientType = 0); - background-image: linear-gradient(top, #ffffff 0%, #eeeeee 50%); + background-image: linear-gradient(to top, #eee 0%, #fff 50%); +} + +html[dir="rtl"] .select2-container .select2-choice { + padding: 0 8px 0 0; } .select2-container.select2-drop-above .select2-choice { border-bottom-color: #aaa; - -webkit-border-radius:0 0 4px 4px; - -moz-border-radius:0 0 4px 4px; - border-radius:0 0 4px 4px; + border-radius: 0 0 4px 4px; + + background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #eee), color-stop(0.9, #fff)); + background-image: -webkit-linear-gradient(center bottom, #eee 0%, #fff 90%); + background-image: -moz-linear-gradient(center bottom, #eee 0%, #fff 90%); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#eeeeee', GradientType=0); + background-image: linear-gradient(to bottom, #eee 0%, #fff 90%); +} - background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #eeeeee), color-stop(0.9, white)); - background-image: -webkit-linear-gradient(center bottom, #eeeeee 0%, white 90%); - background-image: -moz-linear-gradient(center bottom, #eeeeee 0%, white 90%); - background-image: -o-linear-gradient(bottom, #eeeeee 0%, white 90%); - background-image: -ms-linear-gradient(top, #eeeeee 0%,#ffffff 90%); - filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#eeeeee',GradientType=0 ); - background-image: linear-gradient(top, #eeeeee 0%,#ffffff 90%); +.select2-container.select2-allowclear .select2-choice .select2-chosen { + margin-right: 42px; } -.select2-container .select2-choice span { +.select2-container .select2-choice > .select2-chosen { margin-right: 26px; display: block; overflow: hidden; white-space: nowrap; - -ms-text-overflow: ellipsis; - -o-text-overflow: ellipsis; - text-overflow: ellipsis; + text-overflow: ellipsis; + float: none; + width: auto; +} + +html[dir="rtl"] .select2-container .select2-choice > .select2-chosen { + margin-left: 26px; + margin-right: 0; } .select2-container .select2-choice abbr { - display: block; + display: none; width: 12px; height: 12px; position: absolute; - right: 26px; + right: 24px; top: 8px; font-size: 1px; @@ -102,14 +109,37 @@ Version: @@ver@@ Timestamp: @@timestamp@@ cursor: pointer; outline: 0; } + +.select2-container.select2-allowclear .select2-choice abbr { + display: inline-block; +} + .select2-container .select2-choice abbr:hover { background-position: right -11px; cursor: pointer; } +.select2-drop-mask { + border: 0; + margin: 0; + padding: 0; + position: fixed; + left: 0; + top: 0; + min-height: 100%; + min-width: 100%; + height: auto; + width: auto; + opacity: 0; + z-index: 9998; + /* styles required for IE to work */ + background-color: #fff; + filter: alpha(opacity=0); +} + .select2-drop { width: 100%; - margin-top:-1px; + margin-top: -1px; position: absolute; z-index: 9999; top: 100%; @@ -119,14 +149,10 @@ Version: @@ver@@ Timestamp: @@timestamp@@ border: 1px solid #aaa; border-top: 0; - -webkit-border-radius: 0 0 4px 4px; - -moz-border-radius: 0 0 4px 4px; - border-radius: 0 0 4px 4px; + border-radius: 0 0 4px 4px; -webkit-box-shadow: 0 4px 5px rgba(0, 0, 0, .15); - -moz-box-shadow: 0 4px 5px rgba(0, 0, 0, .15); - -o-box-shadow: 0 4px 5px rgba(0, 0, 0, .15); - box-shadow: 0 4px 5px rgba(0, 0, 0, .15); + box-shadow: 0 4px 5px rgba(0, 0, 0, .15); } .select2-drop.select2-drop-above { @@ -134,18 +160,32 @@ Version: @@ver@@ Timestamp: @@timestamp@@ border-top: 1px solid #aaa; border-bottom: 0; - -webkit-border-radius: 4px 4px 0 0; - -moz-border-radius: 4px 4px 0 0; - border-radius: 4px 4px 0 0; + border-radius: 4px 4px 0 0; -webkit-box-shadow: 0 -4px 5px rgba(0, 0, 0, .15); - -moz-box-shadow: 0 -4px 5px rgba(0, 0, 0, .15); - -o-box-shadow: 0 -4px 5px rgba(0, 0, 0, .15); - box-shadow: 0 -4px 5px rgba(0, 0, 0, .15); + box-shadow: 0 -4px 5px rgba(0, 0, 0, .15); } -.select2-container .select2-choice div { - display: block; +.select2-drop-active { + border: 1px solid #5897fb; + border-top: none; +} + +.select2-drop.select2-drop-above.select2-drop-active { + border-top: 1px solid #5897fb; +} + +.select2-drop-auto-width { + border-top: 1px solid #aaa; + width: auto; +} + +.select2-drop-auto-width .select2-search { + padding-top: 4px; +} + +.select2-container .select2-choice .select2-arrow { + display: inline-block; width: 18px; height: 100%; position: absolute; @@ -153,31 +193,38 @@ Version: @@ver@@ Timestamp: @@timestamp@@ top: 0; border-left: 1px solid #aaa; - -webkit-border-radius: 0 4px 4px 0; - -moz-border-radius: 0 4px 4px 0; - border-radius: 0 4px 4px 0; + border-radius: 0 4px 4px 0; - -webkit-background-clip: padding-box; - -moz-background-clip: padding; - background-clip: padding-box; + background-clip: padding-box; background: #ccc; background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #ccc), color-stop(0.6, #eee)); background-image: -webkit-linear-gradient(center bottom, #ccc 0%, #eee 60%); background-image: -moz-linear-gradient(center bottom, #ccc 0%, #eee 60%); - background-image: -o-linear-gradient(bottom, #ccc 0%, #eee 60%); - background-image: -ms-linear-gradient(top, #cccccc 0%, #eeeeee 60%); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr = '#eeeeee', endColorstr = '#cccccc', GradientType = 0); - background-image: linear-gradient(top, #cccccc 0%, #eeeeee 60%); + background-image: linear-gradient(to top, #ccc 0%, #eee 60%); } -.select2-container .select2-choice div b { +html[dir="rtl"] .select2-container .select2-choice .select2-arrow { + left: 0; + right: auto; + + border-left: none; + border-right: 1px solid #aaa; + border-radius: 4px 0 0 4px; +} + +.select2-container .select2-choice .select2-arrow b { display: block; width: 100%; height: 100%; background: url('select2.png') no-repeat 0 1px; } +html[dir="rtl"] .select2-container .select2-choice .select2-arrow b { + background-position: 2px 1px; +} + .select2-search { display: inline-block; width: 100%; @@ -192,12 +239,6 @@ Version: @@ver@@ Timestamp: @@timestamp@@ white-space: nowrap; } -.select2-search-hidden { - display: block; - position: absolute; - left: -10000px; -} - .select2-search input { width: 100%; height: auto !important; @@ -210,21 +251,26 @@ Version: @@ver@@ Timestamp: @@timestamp@@ font-size: 1em; border: 1px solid #aaa; - -webkit-border-radius: 0; - -moz-border-radius: 0; - border-radius: 0; + border-radius: 0; -webkit-box-shadow: none; - -moz-box-shadow: none; - box-shadow: none; + box-shadow: none; background: #fff url('select2.png') no-repeat 100% -22px; - background: url('select2.png') no-repeat 100% -22px, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, white), color-stop(0.99, #eeeeee)); - background: url('select2.png') no-repeat 100% -22px, -webkit-linear-gradient(center bottom, white 85%, #eeeeee 99%); - background: url('select2.png') no-repeat 100% -22px, -moz-linear-gradient(center bottom, white 85%, #eeeeee 99%); - background: url('select2.png') no-repeat 100% -22px, -o-linear-gradient(bottom, white 85%, #eeeeee 99%); - background: url('select2.png') no-repeat 100% -22px, -ms-linear-gradient(top, #ffffff 85%, #eeeeee 99%); - background: url('select2.png') no-repeat 100% -22px, linear-gradient(top, #ffffff 85%, #eeeeee 99%); + background: url('select2.png') no-repeat 100% -22px, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, #fff), color-stop(0.99, #eee)); + background: url('select2.png') no-repeat 100% -22px, -webkit-linear-gradient(center bottom, #fff 85%, #eee 99%); + background: url('select2.png') no-repeat 100% -22px, -moz-linear-gradient(center bottom, #fff 85%, #eee 99%); + background: url('select2.png') no-repeat 100% -22px, linear-gradient(to bottom, #fff 85%, #eee 99%) 0 0; +} + +html[dir="rtl"] .select2-search input { + padding: 4px 5px 4px 20px; + + background: #fff url('select2.png') no-repeat -37px -22px; + background: url('select2.png') no-repeat -37px -22px, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, #fff), color-stop(0.99, #eee)); + background: url('select2.png') no-repeat -37px -22px, -webkit-linear-gradient(center bottom, #fff 85%, #eee 99%); + background: url('select2.png') no-repeat -37px -22px, -moz-linear-gradient(center bottom, #fff 85%, #eee 99%); + background: url('select2.png') no-repeat -37px -22px, linear-gradient(to bottom, #fff 85%, #eee 99%) 0 0; } .select2-drop.select2-drop-above .select2-search input { @@ -233,12 +279,10 @@ Version: @@ver@@ Timestamp: @@timestamp@@ .select2-search input.select2-active { background: #fff url('select2-spinner.gif') no-repeat 100%; - background: url('select2-spinner.gif') no-repeat 100%, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, white), color-stop(0.99, #eeeeee)); - background: url('select2-spinner.gif') no-repeat 100%, -webkit-linear-gradient(center bottom, white 85%, #eeeeee 99%); - background: url('select2-spinner.gif') no-repeat 100%, -moz-linear-gradient(center bottom, white 85%, #eeeeee 99%); - background: url('select2-spinner.gif') no-repeat 100%, -o-linear-gradient(bottom, white 85%, #eeeeee 99%); - background: url('select2-spinner.gif') no-repeat 100%, -ms-linear-gradient(top, #ffffff 85%, #eeeeee 99%); - background: url('select2-spinner.gif') no-repeat 100%, linear-gradient(top, #ffffff 85%, #eeeeee 99%); + background: url('select2-spinner.gif') no-repeat 100%, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, #fff), color-stop(0.99, #eee)); + background: url('select2-spinner.gif') no-repeat 100%, -webkit-linear-gradient(center bottom, #fff 85%, #eee 99%); + background: url('select2-spinner.gif') no-repeat 100%, -moz-linear-gradient(center bottom, #fff 85%, #eee 99%); + background: url('select2-spinner.gif') no-repeat 100%, linear-gradient(to bottom, #fff 85%, #eee 99%) 0 0; } .select2-container-active .select2-choice, @@ -246,47 +290,66 @@ Version: @@ver@@ Timestamp: @@timestamp@@ border: 1px solid #5897fb; outline: none; - -webkit-box-shadow: 0 0 5px rgba(0,0,0,.3); - -moz-box-shadow: 0 0 5px rgba(0,0,0,.3); - -o-box-shadow: 0 0 5px rgba(0,0,0,.3); - box-shadow: 0 0 5px rgba(0,0,0,.3); + -webkit-box-shadow: 0 0 5px rgba(0, 0, 0, .3); + box-shadow: 0 0 5px rgba(0, 0, 0, .3); } .select2-dropdown-open .select2-choice { - border: 1px solid #aaa; border-bottom-color: transparent; -webkit-box-shadow: 0 1px 0 #fff inset; - -moz-box-shadow: 0 1px 0 #fff inset; - -o-box-shadow: 0 1px 0 #fff inset; - box-shadow: 0 1px 0 #fff inset; - - -webkit-border-bottom-left-radius: 0; - -moz-border-radius-bottomleft: 0; - border-bottom-left-radius: 0; + box-shadow: 0 1px 0 #fff inset; - -webkit-border-bottom-right-radius: 0; - -moz-border-radius-bottomright: 0; - border-bottom-right-radius: 0; + border-bottom-left-radius: 0; + border-bottom-right-radius: 0; background-color: #eee; - background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, white), color-stop(0.5, #eeeeee)); - background-image: -webkit-linear-gradient(center bottom, white 0%, #eeeeee 50%); - background-image: -moz-linear-gradient(center bottom, white 0%, #eeeeee 50%); - background-image: -o-linear-gradient(bottom, white 0%, #eeeeee 50%); - background-image: -ms-linear-gradient(top, #ffffff 0%,#eeeeee 50%); - filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#eeeeee', endColorstr='#ffffff',GradientType=0 ); - background-image: linear-gradient(top, #ffffff 0%,#eeeeee 50%); + background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #fff), color-stop(0.5, #eee)); + background-image: -webkit-linear-gradient(center bottom, #fff 0%, #eee 50%); + background-image: -moz-linear-gradient(center bottom, #fff 0%, #eee 50%); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeeee', endColorstr='#ffffff', GradientType=0); + background-image: linear-gradient(to top, #fff 0%, #eee 50%); +} + +.select2-dropdown-open.select2-drop-above .select2-choice, +.select2-dropdown-open.select2-drop-above .select2-choices { + border: 1px solid #5897fb; + border-top-color: transparent; + + background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #fff), color-stop(0.5, #eee)); + background-image: -webkit-linear-gradient(center top, #fff 0%, #eee 50%); + background-image: -moz-linear-gradient(center top, #fff 0%, #eee 50%); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeeee', endColorstr='#ffffff', GradientType=0); + background-image: linear-gradient(to bottom, #fff 0%, #eee 50%); } -.select2-dropdown-open .select2-choice div { +.select2-dropdown-open .select2-choice .select2-arrow { background: transparent; border-left: none; filter: none; } -.select2-dropdown-open .select2-choice div b { +html[dir="rtl"] .select2-dropdown-open .select2-choice .select2-arrow { + border-right: none; +} + +.select2-dropdown-open .select2-choice .select2-arrow b { background-position: -18px 1px; } +html[dir="rtl"] .select2-dropdown-open .select2-choice .select2-arrow b { + background-position: -16px 1px; +} + +.select2-hidden-accessible { + border: 0; + clip: rect(0 0 0 0); + height: 1px; + margin: -1px; + overflow: hidden; + padding: 0; + position: absolute; + width: 1px; +} + /* results */ .select2-results { max-height: 200px; @@ -295,23 +358,23 @@ Version: @@ver@@ Timestamp: @@timestamp@@ position: relative; overflow-x: hidden; overflow-y: auto; + -webkit-tap-highlight-color: rgba(0, 0, 0, 0); +} + +html[dir="rtl"] .select2-results { + padding: 0 4px 0 0; + margin: 4px 0 4px 4px; } .select2-results ul.select2-result-sub { margin: 0; + padding-left: 0; } -.select2-results ul.select2-result-sub > li .select2-result-label { padding-left: 20px } -.select2-results ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 40px } -.select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 60px } -.select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 80px } -.select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 100px } -.select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 110px } -.select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 120px } - .select2-results li { list-style: none; display: list-item; + background-image: none; } .select2-results li.select2-result-with-children > .select2-result-label { @@ -322,28 +385,55 @@ Version: @@ver@@ Timestamp: @@timestamp@@ padding: 3px 7px 4px; margin: 0; cursor: pointer; + + min-height: 1em; + + -webkit-touch-callout: none; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; } +.select2-results-dept-1 .select2-result-label { padding-left: 20px } +.select2-results-dept-2 .select2-result-label { padding-left: 40px } +.select2-results-dept-3 .select2-result-label { padding-left: 60px } +.select2-results-dept-4 .select2-result-label { padding-left: 80px } +.select2-results-dept-5 .select2-result-label { padding-left: 100px } +.select2-results-dept-6 .select2-result-label { padding-left: 110px } +.select2-results-dept-7 .select2-result-label { padding-left: 120px } + .select2-results .select2-highlighted { background: #3875d7; color: #fff; } + .select2-results li em { background: #feffde; font-style: normal; } + .select2-results .select2-highlighted em { background: transparent; } + +.select2-results .select2-highlighted ul { + background: #fff; + color: #000; +} + .select2-results .select2-no-results, .select2-results .select2-searching, +.select2-results .select2-ajax-error, .select2-results .select2-selection-limit { background: #f4f4f4; display: list-item; + padding-left: 5px; } /* -disabled look for already selected choices in the results dropdown +disabled look for disabled choices in the results dropdown +*/ .select2-results .select2-disabled.select2-highlighted { color: #666; background: #f4f4f4; @@ -351,12 +441,12 @@ disabled look for already selected choices in the results dropdown cursor: default; } .select2-results .select2-disabled { - background: #f4f4f4; - display: list-item; - cursor: default; + background: #f4f4f4; + display: list-item; + cursor: default; } -*/ -.select2-results .select2-disabled { + +.select2-results .select2-selected { display: none; } @@ -364,6 +454,10 @@ disabled look for already selected choices in the results dropdown background: #f4f4f4 url('select2-spinner.gif') no-repeat 100%; } +.select2-results .select2-ajax-error { + background: rgba(255, 50, 50, .2); +} + .select2-more-results { background: #f4f4f4; display: list-item; @@ -378,14 +472,14 @@ disabled look for already selected choices in the results dropdown cursor: default; } -.select2-container.select2-container-disabled .select2-choice div { +.select2-container.select2-container-disabled .select2-choice .select2-arrow { background-color: #f4f4f4; background-image: none; border-left: 0; } .select2-container.select2-container-disabled .select2-choice abbr { - display: none + display: none; } @@ -395,7 +489,7 @@ disabled look for already selected choices in the results dropdown height: auto !important; height: 1%; margin: 0; - padding: 0; + padding: 0 5px 0 0; position: relative; border: 1px solid #aaa; @@ -403,16 +497,18 @@ disabled look for already selected choices in the results dropdown overflow: hidden; background-color: #fff; - background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(1%, #eeeeee), color-stop(15%, #ffffff)); - background-image: -webkit-linear-gradient(top, #eeeeee 1%, #ffffff 15%); - background-image: -moz-linear-gradient(top, #eeeeee 1%, #ffffff 15%); - background-image: -o-linear-gradient(top, #eeeeee 1%, #ffffff 15%); - background-image: -ms-linear-gradient(top, #eeeeee 1%, #ffffff 15%); - background-image: linear-gradient(top, #eeeeee 1%, #ffffff 15%); + background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(1%, #eee), color-stop(15%, #fff)); + background-image: -webkit-linear-gradient(top, #eee 1%, #fff 15%); + background-image: -moz-linear-gradient(top, #eee 1%, #fff 15%); + background-image: linear-gradient(to bottom, #eee 1%, #fff 15%); +} + +html[dir="rtl"] .select2-container-multi .select2-choices { + padding: 0 0 0 5px; } .select2-locked { - padding: 3px 5px 3px 5px !important; + padding: 3px 5px 3px 5px !important; } .select2-container-multi .select2-choices { @@ -423,15 +519,17 @@ disabled look for already selected choices in the results dropdown border: 1px solid #5897fb; outline: none; - -webkit-box-shadow: 0 0 5px rgba(0,0,0,.3); - -moz-box-shadow: 0 0 5px rgba(0,0,0,.3); - -o-box-shadow: 0 0 5px rgba(0,0,0,.3); - box-shadow: 0 0 5px rgba(0,0,0,.3); + -webkit-box-shadow: 0 0 5px rgba(0, 0, 0, .3); + box-shadow: 0 0 5px rgba(0, 0, 0, .3); } .select2-container-multi .select2-choices li { float: left; list-style: none; } +html[dir="rtl"] .select2-container-multi .select2-choices li +{ + float: right; +} .select2-container-multi .select2-choices .select2-search-field { margin: 0; padding: 0; @@ -439,7 +537,6 @@ disabled look for already selected choices in the results dropdown } .select2-container-multi .select2-choices .select2-search-field input { - height: 15px; padding: 5px; margin: 1px 0; @@ -449,9 +546,7 @@ disabled look for already selected choices in the results dropdown outline: 0; border: 0; -webkit-box-shadow: none; - -moz-box-shadow: none; - -o-box-shadow: none; - box-shadow: none; + box-shadow: none; background: transparent !important; } @@ -473,28 +568,32 @@ disabled look for already selected choices in the results dropdown cursor: default; border: 1px solid #aaaaaa; - -webkit-border-radius: 3px; - -moz-border-radius: 3px; - border-radius: 3px; + border-radius: 3px; - -webkit-box-shadow: 0 0 2px #ffffff inset, 0 1px 0 rgba(0,0,0,0.05); - -moz-box-shadow: 0 0 2px #ffffff inset, 0 1px 0 rgba(0,0,0,0.05); - box-shadow: 0 0 2px #ffffff inset, 0 1px 0 rgba(0,0,0,0.05); + -webkit-box-shadow: 0 0 2px #fff inset, 0 1px 0 rgba(0, 0, 0, 0.05); + box-shadow: 0 0 2px #fff inset, 0 1px 0 rgba(0, 0, 0, 0.05); - -webkit-background-clip: padding-box; - -moz-background-clip: padding; - background-clip: padding-box; + background-clip: padding-box; + + -webkit-touch-callout: none; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; background-color: #e4e4e4; - filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#eeeeee', endColorstr='#f4f4f4', GradientType=0 ); - background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(20%, #f4f4f4), color-stop(50%, #f0f0f0), color-stop(52%, #e8e8e8), color-stop(100%, #eeeeee)); - background-image: -webkit-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%); - background-image: -moz-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%); - background-image: -o-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%); - background-image: -ms-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%); - background-image: linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%); -} -.select2-container-multi .select2-choices .select2-search-choice span { + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeeee', endColorstr='#f4f4f4', GradientType=0); + background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(20%, #f4f4f4), color-stop(50%, #f0f0f0), color-stop(52%, #e8e8e8), color-stop(100%, #eee)); + background-image: -webkit-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eee 100%); + background-image: -moz-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eee 100%); + background-image: linear-gradient(to bottom, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eee 100%); +} +html[dir="rtl"] .select2-container-multi .select2-choices .select2-search-choice +{ + margin: 3px 5px 3px 0; + padding: 3px 18px 3px 5px; +} +.select2-container-multi .select2-choices .select2-search-choice .select2-chosen { cursor: default; } .select2-container-multi .select2-choices .select2-search-choice-focus { @@ -513,20 +612,29 @@ disabled look for already selected choices in the results dropdown outline: none; background: url('select2.png') right top no-repeat; } +html[dir="rtl"] .select2-search-choice-close { + right: auto; + left: 3px; +} .select2-container-multi .select2-search-choice-close { left: 3px; } +html[dir="rtl"] .select2-container-multi .select2-search-choice-close { + left: auto; + right: 2px; +} + .select2-container-multi .select2-choices .select2-search-choice .select2-search-choice-close:hover { - background-position: right -11px; + background-position: right -11px; } .select2-container-multi .select2-choices .select2-search-choice-focus .select2-search-choice-close { background-position: right -11px; } /* disabled styles */ -.select2-container-multi.select2-container-disabled .select2-choices{ +.select2-container-multi.select2-container-disabled .select2-choices { background-color: #f4f4f4; background-image: none; border: 1px solid #ddd; @@ -540,34 +648,57 @@ disabled look for already selected choices in the results dropdown background-color: #f4f4f4; } -.select2-container-multi.select2-container-disabled .select2-choices .select2-search-choice .select2-search-choice-close { - display: none; +.select2-container-multi.select2-container-disabled .select2-choices .select2-search-choice .select2-search-choice-close { display: none; + background: none; } /* end multiselect */ .select2-result-selectable .select2-match, -.select2-result-unselectable .select2-result-selectable .select2-match { +.select2-result-unselectable .select2-match { text-decoration: underline; } -.select2-result-unselectable .select2-match { - text-decoration: none; + +.select2-offscreen, .select2-offscreen:focus { + clip: rect(0 0 0 0) !important; + width: 1px !important; + height: 1px !important; + border: 0 !important; + margin: 0 !important; + padding: 0 !important; + overflow: hidden !important; + position: absolute !important; + outline: 0 !important; + left: 0px !important; + top: 0px !important; +} + +.select2-display-none { + display: none; } -.select2-offscreen { +.select2-measure-scrollbar { position: absolute; + top: -10000px; left: -10000px; + width: 100px; + height: 100px; + overflow: scroll; } /* Retina-ize icons */ -@media only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min-resolution: 144dpi) { - .select2-search input, .select2-search-choice-close, .select2-container .select2-choice abbr, .select2-container .select2-choice div b { - background-image: url('select2x2.png') !important; - background-repeat: no-repeat !important; - background-size: 60px 40px !important; - } - .select2-search input { - background-position: 100% -21px !important; - } -} \ No newline at end of file +@media only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min-resolution: 2dppx) { + .select2-search input, + .select2-search-choice-close, + .select2-container .select2-choice abbr, + .select2-container .select2-choice .select2-arrow b { + background-image: url('select2x2.png') !important; + background-repeat: no-repeat !important; + background-size: 60px 40px !important; + } + + .select2-search input { + background-position: 100% -21px !important; + } +} diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/select2/select2.min.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/select2/select2.min.css new file mode 100644 index 0000000000000000000000000000000000000000..d118e5c09e65a785f938fb4aeb06ce4be9b5e6af --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/select2/select2.min.css @@ -0,0 +1 @@ +.select2-container{margin:0;position:relative;display:inline-block;zoom:1;*display:inline;vertical-align:middle}.select2-container,.select2-drop,.select2-search,.select2-search input{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.select2-container .select2-choice{display:block;height:26px;padding:0 0 0 8px;overflow:hidden;position:relative;border:1px solid #aaa;white-space:nowrap;line-height:26px;color:#444;text-decoration:none;border-radius:4px;background-clip:padding-box;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-color:#fff;background-image:-webkit-gradient(linear,left bottom,left top,color-stop(0,#eee),color-stop(0.5,#fff));background-image:-webkit-linear-gradient(center bottom,#eee 0,#fff 50%);background-image:-moz-linear-gradient(center bottom,#eee 0,#fff 50%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff',endColorstr='#eeeeee',GradientType=0);background-image:linear-gradient(to top,#eee 0,#fff 50%)}html[dir="rtl"] .select2-container .select2-choice{padding:0 8px 0 0}.select2-container.select2-drop-above .select2-choice{border-bottom-color:#aaa;border-radius:0 0 4px 4px;background-image:-webkit-gradient(linear,left bottom,left top,color-stop(0,#eee),color-stop(0.9,#fff));background-image:-webkit-linear-gradient(center bottom,#eee 0,#fff 90%);background-image:-moz-linear-gradient(center bottom,#eee 0,#fff 90%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff',endColorstr='#eeeeee',GradientType=0);background-image:linear-gradient(to bottom,#eee 0,#fff 90%)}.select2-container.select2-allowclear .select2-choice .select2-chosen{margin-right:42px}.select2-container .select2-choice>.select2-chosen{margin-right:26px;display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;float:none;width:auto}html[dir="rtl"] .select2-container .select2-choice>.select2-chosen{margin-left:26px;margin-right:0}.select2-container .select2-choice abbr{display:none;width:12px;height:12px;position:absolute;right:24px;top:8px;font-size:1px;text-decoration:none;border:0;background:url('select2.png') right top no-repeat;cursor:pointer;outline:0}.select2-container.select2-allowclear .select2-choice abbr{display:inline-block}.select2-container .select2-choice abbr:hover{background-position:right -11px;cursor:pointer}.select2-drop-mask{border:0;margin:0;padding:0;position:fixed;left:0;top:0;min-height:100%;min-width:100%;height:auto;width:auto;opacity:0;z-index:9998;background-color:#fff;filter:alpha(opacity=0)}.select2-drop{width:100%;margin-top:-1px;position:absolute;z-index:9999;top:100%;background:#fff;color:#000;border:1px solid #aaa;border-top:0;border-radius:0 0 4px 4px;-webkit-box-shadow:0 4px 5px rgba(0,0,0,.15);box-shadow:0 4px 5px rgba(0,0,0,.15)}.select2-drop.select2-drop-above{margin-top:1px;border-top:1px solid #aaa;border-bottom:0;border-radius:4px 4px 0 0;-webkit-box-shadow:0 -4px 5px rgba(0,0,0,.15);box-shadow:0 -4px 5px rgba(0,0,0,.15)}.select2-drop-active{border:1px solid #5897fb;border-top:0}.select2-drop.select2-drop-above.select2-drop-active{border-top:1px solid #5897fb}.select2-drop-auto-width{border-top:1px solid #aaa;width:auto}.select2-drop-auto-width .select2-search{padding-top:4px}.select2-container .select2-choice .select2-arrow{display:inline-block;width:18px;height:100%;position:absolute;right:0;top:0;border-left:1px solid #aaa;border-radius:0 4px 4px 0;background-clip:padding-box;background:#ccc;background-image:-webkit-gradient(linear,left bottom,left top,color-stop(0,#ccc),color-stop(0.6,#eee));background-image:-webkit-linear-gradient(center bottom,#ccc 0,#eee 60%);background-image:-moz-linear-gradient(center bottom,#ccc 0,#eee 60%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeeee',endColorstr='#cccccc',GradientType=0);background-image:linear-gradient(to top,#ccc 0,#eee 60%)}html[dir="rtl"] .select2-container .select2-choice .select2-arrow{left:0;right:auto;border-left:0;border-right:1px solid #aaa;border-radius:4px 0 0 4px}.select2-container .select2-choice .select2-arrow b{display:block;width:100%;height:100%;background:url('select2.png') no-repeat 0 1px}html[dir="rtl"] .select2-container .select2-choice .select2-arrow b{background-position:2px 1px}.select2-search{display:inline-block;width:100%;min-height:26px;margin:0;padding-left:4px;padding-right:4px;position:relative;z-index:10000;white-space:nowrap}.select2-search input{width:100%;height:auto !important;min-height:26px;padding:4px 20px 4px 5px;margin:0;outline:0;font-family:sans-serif;font-size:1em;border:1px solid #aaa;border-radius:0;-webkit-box-shadow:none;box-shadow:none;background:#fff url('select2.png') no-repeat 100% -22px;background:url('select2.png') no-repeat 100% -22px,-webkit-gradient(linear,left bottom,left top,color-stop(0.85,#fff),color-stop(0.99,#eee));background:url('select2.png') no-repeat 100% -22px,-webkit-linear-gradient(center bottom,#fff 85%,#eee 99%);background:url('select2.png') no-repeat 100% -22px,-moz-linear-gradient(center bottom,#fff 85%,#eee 99%);background:url('select2.png') no-repeat 100% -22px,linear-gradient(to bottom,#fff 85%,#eee 99%) 0 0}html[dir="rtl"] .select2-search input{padding:4px 5px 4px 20px;background:#fff url('select2.png') no-repeat -37px -22px;background:url('select2.png') no-repeat -37px -22px,-webkit-gradient(linear,left bottom,left top,color-stop(0.85,#fff),color-stop(0.99,#eee));background:url('select2.png') no-repeat -37px -22px,-webkit-linear-gradient(center bottom,#fff 85%,#eee 99%);background:url('select2.png') no-repeat -37px -22px,-moz-linear-gradient(center bottom,#fff 85%,#eee 99%);background:url('select2.png') no-repeat -37px -22px,linear-gradient(to bottom,#fff 85%,#eee 99%) 0 0}.select2-drop.select2-drop-above .select2-search input{margin-top:4px}.select2-search input.select2-active{background:#fff url('select2-spinner.gif') no-repeat 100%;background:url('select2-spinner.gif') no-repeat 100%,-webkit-gradient(linear,left bottom,left top,color-stop(0.85,#fff),color-stop(0.99,#eee));background:url('select2-spinner.gif') no-repeat 100%,-webkit-linear-gradient(center bottom,#fff 85%,#eee 99%);background:url('select2-spinner.gif') no-repeat 100%,-moz-linear-gradient(center bottom,#fff 85%,#eee 99%);background:url('select2-spinner.gif') no-repeat 100%,linear-gradient(to bottom,#fff 85%,#eee 99%) 0 0}.select2-container-active .select2-choice,.select2-container-active .select2-choices{border:1px solid #5897fb;outline:0;-webkit-box-shadow:0 0 5px rgba(0,0,0,.3);box-shadow:0 0 5px rgba(0,0,0,.3)}.select2-dropdown-open .select2-choice{border-bottom-color:transparent;-webkit-box-shadow:0 1px 0 #fff inset;box-shadow:0 1px 0 #fff inset;border-bottom-left-radius:0;border-bottom-right-radius:0;background-color:#eee;background-image:-webkit-gradient(linear,left bottom,left top,color-stop(0,#fff),color-stop(0.5,#eee));background-image:-webkit-linear-gradient(center bottom,#fff 0,#eee 50%);background-image:-moz-linear-gradient(center bottom,#fff 0,#eee 50%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeeee',endColorstr='#ffffff',GradientType=0);background-image:linear-gradient(to top,#fff 0,#eee 50%)}.select2-dropdown-open.select2-drop-above .select2-choice,.select2-dropdown-open.select2-drop-above .select2-choices{border:1px solid #5897fb;border-top-color:transparent;background-image:-webkit-gradient(linear,left top,left bottom,color-stop(0,#fff),color-stop(0.5,#eee));background-image:-webkit-linear-gradient(center top,#fff 0,#eee 50%);background-image:-moz-linear-gradient(center top,#fff 0,#eee 50%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeeee',endColorstr='#ffffff',GradientType=0);background-image:linear-gradient(to bottom,#fff 0,#eee 50%)}.select2-dropdown-open .select2-choice .select2-arrow{background:transparent;border-left:0;filter:none}html[dir="rtl"] .select2-dropdown-open .select2-choice .select2-arrow{border-right:0}.select2-dropdown-open .select2-choice .select2-arrow b{background-position:-18px 1px}html[dir="rtl"] .select2-dropdown-open .select2-choice .select2-arrow b{background-position:-16px 1px}.select2-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.select2-results{max-height:200px;padding:0 0 0 4px;margin:4px 4px 4px 0;position:relative;overflow-x:hidden;overflow-y:auto;-webkit-tap-highlight-color:rgba(0,0,0,0)}html[dir="rtl"] .select2-results{padding:0 4px 0 0;margin:4px 0 4px 4px}.select2-results ul.select2-result-sub{margin:0;padding-left:0}.select2-results li{list-style:none;display:list-item;background-image:none}.select2-results li.select2-result-with-children>.select2-result-label{font-weight:bold}.select2-results .select2-result-label{padding:3px 7px 4px;margin:0;cursor:pointer;min-height:1em;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.select2-results-dept-1 .select2-result-label{padding-left:20px}.select2-results-dept-2 .select2-result-label{padding-left:40px}.select2-results-dept-3 .select2-result-label{padding-left:60px}.select2-results-dept-4 .select2-result-label{padding-left:80px}.select2-results-dept-5 .select2-result-label{padding-left:100px}.select2-results-dept-6 .select2-result-label{padding-left:110px}.select2-results-dept-7 .select2-result-label{padding-left:120px}.select2-results .select2-highlighted{background:#3875d7;color:#fff}.select2-results li em{background:#feffde;font-style:normal}.select2-results .select2-highlighted em{background:transparent}.select2-results .select2-highlighted ul{background:#fff;color:#000}.select2-results .select2-no-results,.select2-results .select2-searching,.select2-results .select2-ajax-error,.select2-results .select2-selection-limit{background:#f4f4f4;display:list-item;padding-left:5px}.select2-results .select2-disabled.select2-highlighted{color:#666;background:#f4f4f4;display:list-item;cursor:default}.select2-results .select2-disabled{background:#f4f4f4;display:list-item;cursor:default}.select2-results .select2-selected{display:none}.select2-more-results.select2-active{background:#f4f4f4 url('select2-spinner.gif') no-repeat 100%}.select2-results .select2-ajax-error{background:rgba(255,50,50,.2)}.select2-more-results{background:#f4f4f4;display:list-item}.select2-container.select2-container-disabled .select2-choice{background-color:#f4f4f4;background-image:none;border:1px solid #ddd;cursor:default}.select2-container.select2-container-disabled .select2-choice .select2-arrow{background-color:#f4f4f4;background-image:none;border-left:0}.select2-container.select2-container-disabled .select2-choice abbr{display:none}.select2-container-multi .select2-choices{height:auto !important;height:1%;margin:0;padding:0 5px 0 0;position:relative;border:1px solid #aaa;cursor:text;overflow:hidden;background-color:#fff;background-image:-webkit-gradient(linear,0% 0,0% 100%,color-stop(1%,#eee),color-stop(15%,#fff));background-image:-webkit-linear-gradient(top,#eee 1%,#fff 15%);background-image:-moz-linear-gradient(top,#eee 1%,#fff 15%);background-image:linear-gradient(to bottom,#eee 1%,#fff 15%)}html[dir="rtl"] .select2-container-multi .select2-choices{padding:0 0 0 5px}.select2-locked{padding:3px 5px 3px 5px !important}.select2-container-multi .select2-choices{min-height:26px}.select2-container-multi.select2-container-active .select2-choices{border:1px solid #5897fb;outline:0;-webkit-box-shadow:0 0 5px rgba(0,0,0,.3);box-shadow:0 0 5px rgba(0,0,0,.3)}.select2-container-multi .select2-choices li{float:left;list-style:none}html[dir="rtl"] .select2-container-multi .select2-choices li{float:right}.select2-container-multi .select2-choices .select2-search-field{margin:0;padding:0;white-space:nowrap}.select2-container-multi .select2-choices .select2-search-field input{padding:5px;margin:1px 0;font-family:sans-serif;font-size:100%;color:#666;outline:0;border:0;-webkit-box-shadow:none;box-shadow:none;background:transparent !important}.select2-container-multi .select2-choices .select2-search-field input.select2-active{background:#fff url('select2-spinner.gif') no-repeat 100% !important}.select2-default{color:#999 !important}.select2-container-multi .select2-choices .select2-search-choice{padding:3px 5px 3px 18px;margin:3px 0 3px 5px;position:relative;line-height:13px;color:#333;cursor:default;border:1px solid #aaa;border-radius:3px;-webkit-box-shadow:0 0 2px #fff inset,0 1px 0 rgba(0,0,0,.05);box-shadow:0 0 2px #fff inset,0 1px 0 rgba(0,0,0,.05);background-clip:padding-box;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-color:#e4e4e4;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeeee',endColorstr='#f4f4f4',GradientType=0);background-image:-webkit-gradient(linear,0% 0,0% 100%,color-stop(20%,#f4f4f4),color-stop(50%,#f0f0f0),color-stop(52%,#e8e8e8),color-stop(100%,#eee));background-image:-webkit-linear-gradient(top,#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);background-image:-moz-linear-gradient(top,#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);background-image:linear-gradient(to bottom,#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%)}html[dir="rtl"] .select2-container-multi .select2-choices .select2-search-choice{margin:3px 5px 3px 0;padding:3px 18px 3px 5px}.select2-container-multi .select2-choices .select2-search-choice .select2-chosen{cursor:default}.select2-container-multi .select2-choices .select2-search-choice-focus{background:#d4d4d4}.select2-search-choice-close{display:block;width:12px;height:13px;position:absolute;right:3px;top:4px;font-size:1px;outline:0;background:url('select2.png') right top no-repeat}html[dir="rtl"] .select2-search-choice-close{right:auto;left:3px}.select2-container-multi .select2-search-choice-close{left:3px}html[dir="rtl"] .select2-container-multi .select2-search-choice-close{left:auto;right:2px}.select2-container-multi .select2-choices .select2-search-choice .select2-search-choice-close:hover{background-position:right -11px}.select2-container-multi .select2-choices .select2-search-choice-focus .select2-search-choice-close{background-position:right -11px}.select2-container-multi.select2-container-disabled .select2-choices{background-color:#f4f4f4;background-image:none;border:1px solid #ddd;cursor:default}.select2-container-multi.select2-container-disabled .select2-choices .select2-search-choice{padding:3px 5px 3px 5px;border:1px solid #ddd;background-image:none;background-color:#f4f4f4}.select2-container-multi.select2-container-disabled .select2-choices .select2-search-choice .select2-search-choice-close{display:none;background:none}.select2-result-selectable .select2-match,.select2-result-unselectable .select2-match{text-decoration:underline}.select2-offscreen,.select2-offscreen:focus{clip:rect(0 0 0 0) !important;width:1px !important;height:1px !important;border:0 !important;margin:0 !important;padding:0 !important;overflow:hidden !important;position:absolute !important;outline:0 !important;left:0 !important;top:0 !important}.select2-display-none{display:none}.select2-measure-scrollbar{position:absolute;top:-10000px;left:-10000px;width:100px;height:100px;overflow:scroll}@media only screen and (-webkit-min-device-pixel-ratio:1.5),only screen and (min-resolution:2dppx){.select2-search input,.select2-search-choice-close,.select2-container .select2-choice abbr,.select2-container .select2-choice .select2-arrow b{background-image:url('select2x2.png') !important;background-repeat:no-repeat !important;background-size:60px 40px !important}.select2-search input{background-position:100% -21px !important}} \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/select2/select2.modded.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/select2/select2.modded.js index 9f2a11ebc8c54bfde5993e7828768848b67b42b3..16a49cf7b9f6f93d029856fa991437869cc7b393 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/select2/select2.modded.js +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/select2/select2.modded.js @@ -1,41 +1,41 @@ /* -Copyright 2012 Igor Vaynberg - -Version: @@ver@@ Timestamp: @@timestamp@@ - -This software is licensed under the Apache License, Version 2.0 (the "Apache License") or the GNU -General Public License version 2 (the "GPL License"). You may choose either license to govern your -use of this software only upon the condition that you accept all of the terms of either the Apache -License or the GPL License. - -You may obtain a copy of the Apache License and the GPL License at: - - http://www.apache.org/licenses/LICENSE-2.0 - http://www.gnu.org/licenses/gpl-2.0.html - -Unless required by applicable law or agreed to in writing, software distributed under the -Apache License or the GPL Licesnse is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -CONDITIONS OF ANY KIND, either express or implied. See the Apache License and the GPL License for -the specific language governing permissions and limitations under the Apache License and the GPL License. -*/ - (function ($) { - if(typeof $.fn.each2 == "undefined"){ - $.fn.extend({ - /* - * 4-10 times faster .each replacement - * use it carefully, as it overrides jQuery context of element on each iteration - */ - each2 : function (c) { - var j = $([0]), i = -1, l = this.length; - while ( - ++i < l - && (j.context = j[0] = this[i]) - && c.call(j[0], i, j) !== false //"this"=DOM, i=index, j=jQuery object - ); - return this; - } - }); - } + Copyright 2012 Igor Vaynberg + + Version: 3.5.2 Timestamp: Sat Nov 1 14:43:36 EDT 2014 + + This software is licensed under the Apache License, Version 2.0 (the "Apache License") or the GNU + General Public License version 2 (the "GPL License"). You may choose either license to govern your + use of this software only upon the condition that you accept all of the terms of either the Apache + License or the GPL License. + + You may obtain a copy of the Apache License and the GPL License at: + + http://www.apache.org/licenses/LICENSE-2.0 + http://www.gnu.org/licenses/gpl-2.0.html + + Unless required by applicable law or agreed to in writing, software distributed under the + Apache License or the GPL License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + CONDITIONS OF ANY KIND, either express or implied. See the Apache License and the GPL License for + the specific language governing permissions and limitations under the Apache License and the GPL License. + */ +(function ($) { + if(typeof $.fn.each2 == "undefined") { + $.extend($.fn, { + /* + * 4-10 times faster .each replacement + * use it carefully, as it overrides jQuery context of element on each iteration + */ + each2 : function (c) { + var j = $([0]), i = -1, l = this.length; + while ( + ++i < l + && (j.context = j[0] = this[i]) + && c.call(j[0], i, j) !== false //"this"=DOM, i=index, j=jQuery object + ); + return this; + } + }); + } })(jQuery); (function ($, undefined) { @@ -46,85 +46,105 @@ the specific language governing permissions and limitations under the Apache Lic return; } - var KEY, AbstractSelect2, SingleSelect2, MultiSelect2, nextUid, sizer, - lastMousePosition, $document; - - KEY = { - TAB: 9, - ENTER: 13, - ESC: 27, - SPACE: 32, - LEFT: 37, - UP: 38, - RIGHT: 39, - DOWN: 40, - SHIFT: 16, - CTRL: 17, - ALT: 18, - PAGE_UP: 33, - PAGE_DOWN: 34, - HOME: 36, - END: 35, - BACKSPACE: 8, - DELETE: 46, - isArrow: function (k) { - k = k.which ? k.which : k; - switch (k) { - case KEY.LEFT: - case KEY.RIGHT: - case KEY.UP: - case KEY.DOWN: - return true; - } - return false; - }, - isControl: function (e) { - var k = e.which; - switch (k) { - case KEY.SHIFT: - case KEY.CTRL: - case KEY.ALT: - return true; - } + var AbstractSelect2, SingleSelect2, MultiSelect2, nextUid, sizer, + lastMousePosition={x:0,y:0}, $document, scrollBarDimensions, + + KEY = { + TAB: 9, + ENTER: 13, + ESC: 27, + SPACE: 32, + LEFT: 37, + UP: 38, + RIGHT: 39, + DOWN: 40, + SHIFT: 16, + CTRL: 17, + ALT: 18, + PAGE_UP: 33, + PAGE_DOWN: 34, + HOME: 36, + END: 35, + BACKSPACE: 8, + DELETE: 46, + isArrow: function (k) { + k = k.which ? k.which : k; + switch (k) { + case KEY.LEFT: + case KEY.RIGHT: + case KEY.UP: + case KEY.DOWN: + return true; + } + return false; + }, + isControl: function (e) { + var k = e.which; + switch (k) { + case KEY.SHIFT: + case KEY.CTRL: + case KEY.ALT: + return true; + } - if (e.metaKey) return true; + if (e.metaKey) return true; - return false; + return false; + }, + isFunctionKey: function (k) { + k = k.which ? k.which : k; + return k >= 112 && k <= 123; + } }, - isFunctionKey: function (k) { - k = k.which ? k.which : k; - return k >= 112 && k <= 123; - } - }; + MEASURE_SCROLLBAR_TEMPLATE = "<div class='select2-measure-scrollbar'></div>", + + DIACRITICS = {"\u24B6":"A","\uFF21":"A","\u00C0":"A","\u00C1":"A","\u00C2":"A","\u1EA6":"A","\u1EA4":"A","\u1EAA":"A","\u1EA8":"A","\u00C3":"A","\u0100":"A","\u0102":"A","\u1EB0":"A","\u1EAE":"A","\u1EB4":"A","\u1EB2":"A","\u0226":"A","\u01E0":"A","\u00C4":"A","\u01DE":"A","\u1EA2":"A","\u00C5":"A","\u01FA":"A","\u01CD":"A","\u0200":"A","\u0202":"A","\u1EA0":"A","\u1EAC":"A","\u1EB6":"A","\u1E00":"A","\u0104":"A","\u023A":"A","\u2C6F":"A","\uA732":"AA","\u00C6":"AE","\u01FC":"AE","\u01E2":"AE","\uA734":"AO","\uA736":"AU","\uA738":"AV","\uA73A":"AV","\uA73C":"AY","\u24B7":"B","\uFF22":"B","\u1E02":"B","\u1E04":"B","\u1E06":"B","\u0243":"B","\u0182":"B","\u0181":"B","\u24B8":"C","\uFF23":"C","\u0106":"C","\u0108":"C","\u010A":"C","\u010C":"C","\u00C7":"C","\u1E08":"C","\u0187":"C","\u023B":"C","\uA73E":"C","\u24B9":"D","\uFF24":"D","\u1E0A":"D","\u010E":"D","\u1E0C":"D","\u1E10":"D","\u1E12":"D","\u1E0E":"D","\u0110":"D","\u018B":"D","\u018A":"D","\u0189":"D","\uA779":"D","\u01F1":"DZ","\u01C4":"DZ","\u01F2":"Dz","\u01C5":"Dz","\u24BA":"E","\uFF25":"E","\u00C8":"E","\u00C9":"E","\u00CA":"E","\u1EC0":"E","\u1EBE":"E","\u1EC4":"E","\u1EC2":"E","\u1EBC":"E","\u0112":"E","\u1E14":"E","\u1E16":"E","\u0114":"E","\u0116":"E","\u00CB":"E","\u1EBA":"E","\u011A":"E","\u0204":"E","\u0206":"E","\u1EB8":"E","\u1EC6":"E","\u0228":"E","\u1E1C":"E","\u0118":"E","\u1E18":"E","\u1E1A":"E","\u0190":"E","\u018E":"E","\u24BB":"F","\uFF26":"F","\u1E1E":"F","\u0191":"F","\uA77B":"F","\u24BC":"G","\uFF27":"G","\u01F4":"G","\u011C":"G","\u1E20":"G","\u011E":"G","\u0120":"G","\u01E6":"G","\u0122":"G","\u01E4":"G","\u0193":"G","\uA7A0":"G","\uA77D":"G","\uA77E":"G","\u24BD":"H","\uFF28":"H","\u0124":"H","\u1E22":"H","\u1E26":"H","\u021E":"H","\u1E24":"H","\u1E28":"H","\u1E2A":"H","\u0126":"H","\u2C67":"H","\u2C75":"H","\uA78D":"H","\u24BE":"I","\uFF29":"I","\u00CC":"I","\u00CD":"I","\u00CE":"I","\u0128":"I","\u012A":"I","\u012C":"I","\u0130":"I","\u00CF":"I","\u1E2E":"I","\u1EC8":"I","\u01CF":"I","\u0208":"I","\u020A":"I","\u1ECA":"I","\u012E":"I","\u1E2C":"I","\u0197":"I","\u24BF":"J","\uFF2A":"J","\u0134":"J","\u0248":"J","\u24C0":"K","\uFF2B":"K","\u1E30":"K","\u01E8":"K","\u1E32":"K","\u0136":"K","\u1E34":"K","\u0198":"K","\u2C69":"K","\uA740":"K","\uA742":"K","\uA744":"K","\uA7A2":"K","\u24C1":"L","\uFF2C":"L","\u013F":"L","\u0139":"L","\u013D":"L","\u1E36":"L","\u1E38":"L","\u013B":"L","\u1E3C":"L","\u1E3A":"L","\u0141":"L","\u023D":"L","\u2C62":"L","\u2C60":"L","\uA748":"L","\uA746":"L","\uA780":"L","\u01C7":"LJ","\u01C8":"Lj","\u24C2":"M","\uFF2D":"M","\u1E3E":"M","\u1E40":"M","\u1E42":"M","\u2C6E":"M","\u019C":"M","\u24C3":"N","\uFF2E":"N","\u01F8":"N","\u0143":"N","\u00D1":"N","\u1E44":"N","\u0147":"N","\u1E46":"N","\u0145":"N","\u1E4A":"N","\u1E48":"N","\u0220":"N","\u019D":"N","\uA790":"N","\uA7A4":"N","\u01CA":"NJ","\u01CB":"Nj","\u24C4":"O","\uFF2F":"O","\u00D2":"O","\u00D3":"O","\u00D4":"O","\u1ED2":"O","\u1ED0":"O","\u1ED6":"O","\u1ED4":"O","\u00D5":"O","\u1E4C":"O","\u022C":"O","\u1E4E":"O","\u014C":"O","\u1E50":"O","\u1E52":"O","\u014E":"O","\u022E":"O","\u0230":"O","\u00D6":"O","\u022A":"O","\u1ECE":"O","\u0150":"O","\u01D1":"O","\u020C":"O","\u020E":"O","\u01A0":"O","\u1EDC":"O","\u1EDA":"O","\u1EE0":"O","\u1EDE":"O","\u1EE2":"O","\u1ECC":"O","\u1ED8":"O","\u01EA":"O","\u01EC":"O","\u00D8":"O","\u01FE":"O","\u0186":"O","\u019F":"O","\uA74A":"O","\uA74C":"O","\u01A2":"OI","\uA74E":"OO","\u0222":"OU","\u24C5":"P","\uFF30":"P","\u1E54":"P","\u1E56":"P","\u01A4":"P","\u2C63":"P","\uA750":"P","\uA752":"P","\uA754":"P","\u24C6":"Q","\uFF31":"Q","\uA756":"Q","\uA758":"Q","\u024A":"Q","\u24C7":"R","\uFF32":"R","\u0154":"R","\u1E58":"R","\u0158":"R","\u0210":"R","\u0212":"R","\u1E5A":"R","\u1E5C":"R","\u0156":"R","\u1E5E":"R","\u024C":"R","\u2C64":"R","\uA75A":"R","\uA7A6":"R","\uA782":"R","\u24C8":"S","\uFF33":"S","\u1E9E":"S","\u015A":"S","\u1E64":"S","\u015C":"S","\u1E60":"S","\u0160":"S","\u1E66":"S","\u1E62":"S","\u1E68":"S","\u0218":"S","\u015E":"S","\u2C7E":"S","\uA7A8":"S","\uA784":"S","\u24C9":"T","\uFF34":"T","\u1E6A":"T","\u0164":"T","\u1E6C":"T","\u021A":"T","\u0162":"T","\u1E70":"T","\u1E6E":"T","\u0166":"T","\u01AC":"T","\u01AE":"T","\u023E":"T","\uA786":"T","\uA728":"TZ","\u24CA":"U","\uFF35":"U","\u00D9":"U","\u00DA":"U","\u00DB":"U","\u0168":"U","\u1E78":"U","\u016A":"U","\u1E7A":"U","\u016C":"U","\u00DC":"U","\u01DB":"U","\u01D7":"U","\u01D5":"U","\u01D9":"U","\u1EE6":"U","\u016E":"U","\u0170":"U","\u01D3":"U","\u0214":"U","\u0216":"U","\u01AF":"U","\u1EEA":"U","\u1EE8":"U","\u1EEE":"U","\u1EEC":"U","\u1EF0":"U","\u1EE4":"U","\u1E72":"U","\u0172":"U","\u1E76":"U","\u1E74":"U","\u0244":"U","\u24CB":"V","\uFF36":"V","\u1E7C":"V","\u1E7E":"V","\u01B2":"V","\uA75E":"V","\u0245":"V","\uA760":"VY","\u24CC":"W","\uFF37":"W","\u1E80":"W","\u1E82":"W","\u0174":"W","\u1E86":"W","\u1E84":"W","\u1E88":"W","\u2C72":"W","\u24CD":"X","\uFF38":"X","\u1E8A":"X","\u1E8C":"X","\u24CE":"Y","\uFF39":"Y","\u1EF2":"Y","\u00DD":"Y","\u0176":"Y","\u1EF8":"Y","\u0232":"Y","\u1E8E":"Y","\u0178":"Y","\u1EF6":"Y","\u1EF4":"Y","\u01B3":"Y","\u024E":"Y","\u1EFE":"Y","\u24CF":"Z","\uFF3A":"Z","\u0179":"Z","\u1E90":"Z","\u017B":"Z","\u017D":"Z","\u1E92":"Z","\u1E94":"Z","\u01B5":"Z","\u0224":"Z","\u2C7F":"Z","\u2C6B":"Z","\uA762":"Z","\u24D0":"a","\uFF41":"a","\u1E9A":"a","\u00E0":"a","\u00E1":"a","\u00E2":"a","\u1EA7":"a","\u1EA5":"a","\u1EAB":"a","\u1EA9":"a","\u00E3":"a","\u0101":"a","\u0103":"a","\u1EB1":"a","\u1EAF":"a","\u1EB5":"a","\u1EB3":"a","\u0227":"a","\u01E1":"a","\u00E4":"a","\u01DF":"a","\u1EA3":"a","\u00E5":"a","\u01FB":"a","\u01CE":"a","\u0201":"a","\u0203":"a","\u1EA1":"a","\u1EAD":"a","\u1EB7":"a","\u1E01":"a","\u0105":"a","\u2C65":"a","\u0250":"a","\uA733":"aa","\u00E6":"ae","\u01FD":"ae","\u01E3":"ae","\uA735":"ao","\uA737":"au","\uA739":"av","\uA73B":"av","\uA73D":"ay","\u24D1":"b","\uFF42":"b","\u1E03":"b","\u1E05":"b","\u1E07":"b","\u0180":"b","\u0183":"b","\u0253":"b","\u24D2":"c","\uFF43":"c","\u0107":"c","\u0109":"c","\u010B":"c","\u010D":"c","\u00E7":"c","\u1E09":"c","\u0188":"c","\u023C":"c","\uA73F":"c","\u2184":"c","\u24D3":"d","\uFF44":"d","\u1E0B":"d","\u010F":"d","\u1E0D":"d","\u1E11":"d","\u1E13":"d","\u1E0F":"d","\u0111":"d","\u018C":"d","\u0256":"d","\u0257":"d","\uA77A":"d","\u01F3":"dz","\u01C6":"dz","\u24D4":"e","\uFF45":"e","\u00E8":"e","\u00E9":"e","\u00EA":"e","\u1EC1":"e","\u1EBF":"e","\u1EC5":"e","\u1EC3":"e","\u1EBD":"e","\u0113":"e","\u1E15":"e","\u1E17":"e","\u0115":"e","\u0117":"e","\u00EB":"e","\u1EBB":"e","\u011B":"e","\u0205":"e","\u0207":"e","\u1EB9":"e","\u1EC7":"e","\u0229":"e","\u1E1D":"e","\u0119":"e","\u1E19":"e","\u1E1B":"e","\u0247":"e","\u025B":"e","\u01DD":"e","\u24D5":"f","\uFF46":"f","\u1E1F":"f","\u0192":"f","\uA77C":"f","\u24D6":"g","\uFF47":"g","\u01F5":"g","\u011D":"g","\u1E21":"g","\u011F":"g","\u0121":"g","\u01E7":"g","\u0123":"g","\u01E5":"g","\u0260":"g","\uA7A1":"g","\u1D79":"g","\uA77F":"g","\u24D7":"h","\uFF48":"h","\u0125":"h","\u1E23":"h","\u1E27":"h","\u021F":"h","\u1E25":"h","\u1E29":"h","\u1E2B":"h","\u1E96":"h","\u0127":"h","\u2C68":"h","\u2C76":"h","\u0265":"h","\u0195":"hv","\u24D8":"i","\uFF49":"i","\u00EC":"i","\u00ED":"i","\u00EE":"i","\u0129":"i","\u012B":"i","\u012D":"i","\u00EF":"i","\u1E2F":"i","\u1EC9":"i","\u01D0":"i","\u0209":"i","\u020B":"i","\u1ECB":"i","\u012F":"i","\u1E2D":"i","\u0268":"i","\u0131":"i","\u24D9":"j","\uFF4A":"j","\u0135":"j","\u01F0":"j","\u0249":"j","\u24DA":"k","\uFF4B":"k","\u1E31":"k","\u01E9":"k","\u1E33":"k","\u0137":"k","\u1E35":"k","\u0199":"k","\u2C6A":"k","\uA741":"k","\uA743":"k","\uA745":"k","\uA7A3":"k","\u24DB":"l","\uFF4C":"l","\u0140":"l","\u013A":"l","\u013E":"l","\u1E37":"l","\u1E39":"l","\u013C":"l","\u1E3D":"l","\u1E3B":"l","\u017F":"l","\u0142":"l","\u019A":"l","\u026B":"l","\u2C61":"l","\uA749":"l","\uA781":"l","\uA747":"l","\u01C9":"lj","\u24DC":"m","\uFF4D":"m","\u1E3F":"m","\u1E41":"m","\u1E43":"m","\u0271":"m","\u026F":"m","\u24DD":"n","\uFF4E":"n","\u01F9":"n","\u0144":"n","\u00F1":"n","\u1E45":"n","\u0148":"n","\u1E47":"n","\u0146":"n","\u1E4B":"n","\u1E49":"n","\u019E":"n","\u0272":"n","\u0149":"n","\uA791":"n","\uA7A5":"n","\u01CC":"nj","\u24DE":"o","\uFF4F":"o","\u00F2":"o","\u00F3":"o","\u00F4":"o","\u1ED3":"o","\u1ED1":"o","\u1ED7":"o","\u1ED5":"o","\u00F5":"o","\u1E4D":"o","\u022D":"o","\u1E4F":"o","\u014D":"o","\u1E51":"o","\u1E53":"o","\u014F":"o","\u022F":"o","\u0231":"o","\u00F6":"o","\u022B":"o","\u1ECF":"o","\u0151":"o","\u01D2":"o","\u020D":"o","\u020F":"o","\u01A1":"o","\u1EDD":"o","\u1EDB":"o","\u1EE1":"o","\u1EDF":"o","\u1EE3":"o","\u1ECD":"o","\u1ED9":"o","\u01EB":"o","\u01ED":"o","\u00F8":"o","\u01FF":"o","\u0254":"o","\uA74B":"o","\uA74D":"o","\u0275":"o","\u01A3":"oi","\u0223":"ou","\uA74F":"oo","\u24DF":"p","\uFF50":"p","\u1E55":"p","\u1E57":"p","\u01A5":"p","\u1D7D":"p","\uA751":"p","\uA753":"p","\uA755":"p","\u24E0":"q","\uFF51":"q","\u024B":"q","\uA757":"q","\uA759":"q","\u24E1":"r","\uFF52":"r","\u0155":"r","\u1E59":"r","\u0159":"r","\u0211":"r","\u0213":"r","\u1E5B":"r","\u1E5D":"r","\u0157":"r","\u1E5F":"r","\u024D":"r","\u027D":"r","\uA75B":"r","\uA7A7":"r","\uA783":"r","\u24E2":"s","\uFF53":"s","\u00DF":"s","\u015B":"s","\u1E65":"s","\u015D":"s","\u1E61":"s","\u0161":"s","\u1E67":"s","\u1E63":"s","\u1E69":"s","\u0219":"s","\u015F":"s","\u023F":"s","\uA7A9":"s","\uA785":"s","\u1E9B":"s","\u24E3":"t","\uFF54":"t","\u1E6B":"t","\u1E97":"t","\u0165":"t","\u1E6D":"t","\u021B":"t","\u0163":"t","\u1E71":"t","\u1E6F":"t","\u0167":"t","\u01AD":"t","\u0288":"t","\u2C66":"t","\uA787":"t","\uA729":"tz","\u24E4":"u","\uFF55":"u","\u00F9":"u","\u00FA":"u","\u00FB":"u","\u0169":"u","\u1E79":"u","\u016B":"u","\u1E7B":"u","\u016D":"u","\u00FC":"u","\u01DC":"u","\u01D8":"u","\u01D6":"u","\u01DA":"u","\u1EE7":"u","\u016F":"u","\u0171":"u","\u01D4":"u","\u0215":"u","\u0217":"u","\u01B0":"u","\u1EEB":"u","\u1EE9":"u","\u1EEF":"u","\u1EED":"u","\u1EF1":"u","\u1EE5":"u","\u1E73":"u","\u0173":"u","\u1E77":"u","\u1E75":"u","\u0289":"u","\u24E5":"v","\uFF56":"v","\u1E7D":"v","\u1E7F":"v","\u028B":"v","\uA75F":"v","\u028C":"v","\uA761":"vy","\u24E6":"w","\uFF57":"w","\u1E81":"w","\u1E83":"w","\u0175":"w","\u1E87":"w","\u1E85":"w","\u1E98":"w","\u1E89":"w","\u2C73":"w","\u24E7":"x","\uFF58":"x","\u1E8B":"x","\u1E8D":"x","\u24E8":"y","\uFF59":"y","\u1EF3":"y","\u00FD":"y","\u0177":"y","\u1EF9":"y","\u0233":"y","\u1E8F":"y","\u00FF":"y","\u1EF7":"y","\u1E99":"y","\u1EF5":"y","\u01B4":"y","\u024F":"y","\u1EFF":"y","\u24E9":"z","\uFF5A":"z","\u017A":"z","\u1E91":"z","\u017C":"z","\u017E":"z","\u1E93":"z","\u1E95":"z","\u01B6":"z","\u0225":"z","\u0240":"z","\u2C6C":"z","\uA763":"z","\u0386":"\u0391","\u0388":"\u0395","\u0389":"\u0397","\u038A":"\u0399","\u03AA":"\u0399","\u038C":"\u039F","\u038E":"\u03A5","\u03AB":"\u03A5","\u038F":"\u03A9","\u03AC":"\u03B1","\u03AD":"\u03B5","\u03AE":"\u03B7","\u03AF":"\u03B9","\u03CA":"\u03B9","\u0390":"\u03B9","\u03CC":"\u03BF","\u03CD":"\u03C5","\u03CB":"\u03C5","\u03B0":"\u03C5","\u03C9":"\u03C9","\u03C2":"\u03C3"}; $document = $(document); nextUid=(function() { var counter=1; return function() { return counter++; }; }()); - function indexOf(value, array) { - var i = 0, l = array.length, v; - if (typeof value === "undefined") { - return -1; + function reinsertElement(element) { + var placeholder = $(document.createTextNode('')); + + element.before(placeholder); + placeholder.before(element); + placeholder.remove(); + } + + function stripDiacritics(str) { + // Used 'uni range + named function' from http://jsperf.com/diacritics/18 + function match(a) { + return DIACRITICS[a] || a; } - if (value.constructor === String) { - for (; i < l; i = i + 1) if (value.localeCompare(array[i]) === 0) return i; - } else { - for (; i < l; i = i + 1) { - v = array[i]; - if (v.constructor === String) { - if (v.localeCompare(value) === 0) return i; - } else { - if (v === value) return i; - } - } + return str.replace(/[^\u0000-\u007E]/g, match); + } + + function indexOf(value, array) { + var i = 0, l = array.length; + for (; i < l; i = i + 1) { + if (equal(value, array[i])) return i; } return -1; } + function measureScrollbar () { + var $template = $( MEASURE_SCROLLBAR_TEMPLATE ); + $template.appendTo(document.body); + + var dim = { + width: $template.width() - $template[0].clientWidth, + height: $template.height() - $template[0].clientHeight + }; + $template.remove(); + + return dim; + } + /** - * Compares equality of a and b taking into account that a and b may be strings, in which case localeCompare is used + * Compares equality of a and b * @param a * @param b */ @@ -132,22 +152,24 @@ the specific language governing permissions and limitations under the Apache Lic if (a === b) return true; if (a === undefined || b === undefined) return false; if (a === null || b === null) return false; - if (a.constructor === String) return a.localeCompare(b) === 0; - if (b.constructor === String) return b.localeCompare(a) === 0; + // Check whether 'a' or 'b' is a string (primitive or object). + // The concatenation of an empty string (+'') converts its argument to a string's primitive. + if (a.constructor === String) return a+'' === b+''; // a+'' - in case 'a' is a String object + if (b.constructor === String) return b+'' === a+''; // b+'' - in case 'b' is a String object return false; } /** - * Splits the string into an array of values, trimming each value. An empty array is returned for nulls or empty + * Splits the string into an array of values, transforming each value. An empty array is returned for nulls or empty * strings * @param string * @param separator */ - function splitVal(string, separator) { + function splitVal(string, separator, transform) { var val, i, l; if (string === null || string.length < 1) return []; val = string.split(separator); - for (i = 0, l = val.length; i < l; i = i + 1) val[i] = $.trim(val[i]); + for (i = 0, l = val.length; i < l; i = i + 1) val[i] = transform(val[i]); return val; } @@ -157,12 +179,12 @@ the specific language governing permissions and limitations under the Apache Lic function installKeyUpChangeEvent(element) { var key="keyup-change-value"; - element.bind("keydown", function () { + element.on("keydown", function () { if ($.data(element, key) === undefined) { $.data(element, key, element.val()); } }); - element.bind("keyup", function () { + element.on("keyup", function () { var val= $.data(element, key); if (val !== undefined && element.val() !== val) { $.removeData(element, key); @@ -171,9 +193,6 @@ the specific language governing permissions and limitations under the Apache Lic }); } - $document.bind("mousemove", function (e) { - lastMousePosition = {x: e.pageX, y: e.pageY}; - }); /** * filters mouse events so an event is fired only if the mouse moved. @@ -182,7 +201,7 @@ the specific language governing permissions and limitations under the Apache Lic * the elements under the pointer are scrolled. */ function installFilteredMouseMove(element) { - element.bind("mousemove", function (e) { + element.on("mousemove", function (e) { var lastpos = lastMousePosition; if (lastpos === undefined || lastpos.x !== e.pageX || lastpos.y !== e.pageY) { $(e.target).trigger("mousemove-filtered", e); @@ -211,27 +230,61 @@ the specific language governing permissions and limitations under the Apache Lic }; } - /** - * A simple implementation of a thunk - * @param formula function used to lazily initialize the thunk - * @return {Function} - */ - function thunk(formula) { - var evaluated = false, - value; - return function() { - if (evaluated === false) { value = formula(); evaluated = true; } - return value; - }; - }; - function installDebouncedScroll(threshold, element) { var notify = debounce(threshold, function (e) { element.trigger("scroll-debounced", e);}); - element.bind("scroll", function (e) { + element.on("scroll", function (e) { if (indexOf(e.target, element.get()) >= 0) notify(e); }); } + function focus($el) { + if ($el[0] === document.activeElement) return; + + /* set the focus in a 0 timeout - that way the focus is set after the processing + of the current event has finished - which seems like the only reliable way + to set focus */ + window.setTimeout(function() { + var el=$el[0], pos=$el.val().length, range; + + $el.focus(); + + /* make sure el received focus so we do not error out when trying to manipulate the caret. + sometimes modals or others listeners may steal it after its set */ + var isVisible = (el.offsetWidth > 0 || el.offsetHeight > 0); + if (isVisible && el === document.activeElement) { + + /* after the focus is set move the caret to the end, necessary when we val() + just before setting focus */ + if(el.setSelectionRange) + { + el.setSelectionRange(pos, pos); + } + else if (el.createTextRange) { + range = el.createTextRange(); + range.collapse(false); + range.select(); + } + } + }, 0); + } + + function getCursorInfo(el) { + el = $(el)[0]; + var offset = 0; + var length = 0; + if ('selectionStart' in el) { + offset = el.selectionStart; + length = el.selectionEnd - offset; + } else if ('selection' in document) { + el.focus(); + var sel = document.selection.createRange(); + length = document.selection.createRange().text.length; + sel.moveStart('character', -el.value.length); + offset = sel.text.length - length; + } + return { offset: offset, length: length }; + } + function killEvent(event) { event.preventDefault(); event.stopPropagation(); @@ -243,53 +296,105 @@ the specific language governing permissions and limitations under the Apache Lic function measureTextWidth(e) { if (!sizer){ - var style = e[0].currentStyle || window.getComputedStyle(e[0], null); - sizer = $("<div></div>").css({ - position: "absolute", - left: "-10000px", - top: "-10000px", - display: "none", - fontSize: style.fontSize, - fontFamily: style.fontFamily, - fontStyle: style.fontStyle, - fontWeight: style.fontWeight, - letterSpacing: style.letterSpacing, - textTransform: style.textTransform, - whiteSpace: "nowrap" - }); - $("body").append(sizer); + var style = e[0].currentStyle || window.getComputedStyle(e[0], null); + sizer = $(document.createElement("div")).css({ + position: "absolute", + left: "-10000px", + top: "-10000px", + display: "none", + fontSize: style.fontSize, + fontFamily: style.fontFamily, + fontStyle: style.fontStyle, + fontWeight: style.fontWeight, + letterSpacing: style.letterSpacing, + textTransform: style.textTransform, + whiteSpace: "nowrap" + }); + sizer.attr("class","select2-sizer"); + $(document.body).append(sizer); } sizer.text(e.val()); return sizer.width(); } - function markMatch(text, term, markup) { - var match=text.toUpperCase().indexOf(term.toUpperCase()), + function syncCssClasses(dest, src, adapter) { + var classes, replacements = [], adapted; + + classes = $.trim(dest.attr("class")); + + if (classes) { + classes = '' + classes; // for IE which returns object + + $(classes.split(/\s+/)).each2(function() { + if (this.indexOf("select2-") === 0) { + replacements.push(this); + } + }); + } + + classes = $.trim(src.attr("class")); + + if (classes) { + classes = '' + classes; // for IE which returns object + + $(classes.split(/\s+/)).each2(function() { + if (this.indexOf("select2-") !== 0) { + adapted = adapter(this); + + if (adapted) { + replacements.push(adapted); + } + } + }); + } + + dest.attr("class", replacements.join(" ")); + } + + + function markMatch(text, term, markup, escapeMarkup) { + var match=stripDiacritics(text.toUpperCase()).indexOf(stripDiacritics(term.toUpperCase())), tl=term.length; if (match<0) { - markup.push(text); + markup.push(escapeMarkup(text)); return; } - markup.push(text.substring(0, match)); + markup.push(escapeMarkup(text.substring(0, match))); markup.push("<span class='select2-match'>"); - markup.push(text.substring(match, match + tl)); + markup.push(escapeMarkup(text.substring(match, match + tl))); markup.push("</span>"); - markup.push(text.substring(match + tl, text.length)); + markup.push(escapeMarkup(text.substring(match + tl, text.length))); + } + + function defaultEscapeMarkup(markup) { + var replace_map = { + '\\': '\', + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''', + "/": '/' + }; + + return String(markup).replace(/[&<>"'\/\\]/g, function (match) { + return replace_map[match]; + }); } /** * Produces an ajax-based query function * - * @param options object containing configuration paramters + * @param options object containing configuration parameters + * @param options.params parameter map for the transport ajax call, can contain such options as cache, jsonpCallback, etc. see $.ajax * @param options.transport function that will be used to execute the ajax request. must be compatible with parameters supported by $.ajax * @param options.url url for the data * @param options.data a function(searchTerm, pageNumber, context) that should return an object containing query string parameters for the above url. - * @param options.dataType request data type: ajax, jsonp, other datatatypes supported by jQuery's $.ajax function or the transport function if specified - * @param options.traditional a boolean flag that should be true if you wish to use the traditional style of param serialization for the ajax request + * @param options.dataType request data type: ajax, jsonp, other datatypes supported by jQuery's $.ajax function or the transport function if specified * @param options.quietMillis (optional) milliseconds to wait before making the ajaxRequest, helps debounce the ajax function if invoked too often - * @param options.results a function(remoteData, pageNumber) that converts data returned form the remote request to the format expected by Select2. + * @param options.results a function(remoteData, pageNumber, query) that converts data returned form the remote request to the format expected by Select2. * The expected format is an object containing the following keys: * results array of objects that will be used as choices * more (optional) boolean indicating whether there are more results available @@ -297,39 +402,61 @@ the specific language governing permissions and limitations under the Apache Lic */ function ajax(options) { var timeout, // current scheduled but not yet executed request - requestSequence = 0, // sequence used to drop out-of-order responses handler = null, - quietMillis = options.quietMillis || 100; + quietMillis = options.quietMillis || 100, + ajaxUrl = options.url, + self = this; return function (query) { window.clearTimeout(timeout); timeout = window.setTimeout(function () { - requestSequence += 1; // increment the sequence - var requestNumber = requestSequence, // this request's sequence number - data = options.data, // ajax data function - transport = options.transport || $.ajax, - traditional = options.traditional || false, - type = options.type || 'GET'; // set type of request (GET or POST) - - data = data.call(this, query.term, query.page, query.context); - - if( null !== handler) { handler.abort(); } + var data = options.data, // ajax data function + url = ajaxUrl, // ajax url string or function + transport = options.transport || $.fn.select2.ajaxDefaults.transport, + // deprecated - to be removed in 4.0 - use params instead + deprecated = { + type: options.type || 'GET', // set type of request (GET or POST) + cache: options.cache || false, + jsonpCallback: options.jsonpCallback||undefined, + dataType: options.dataType||"json" + }, + params = $.extend({}, $.fn.select2.ajaxDefaults.params, deprecated); + + data = data ? data.call(self, query.term, query.page, query.context) : null; + url = (typeof url === 'function') ? url.call(self, query.term, query.page, query.context) : url; + + if (handler && typeof handler.abort === "function") { handler.abort(); } + + if (options.params) { + if ($.isFunction(options.params)) { + $.extend(params, options.params.call(self)); + } else { + $.extend(params, options.params); + } + } - handler = transport.call(null, { - url: options.url, + $.extend(params, { + url: url, dataType: options.dataType, data: data, - type: type, - traditional: traditional, success: function (data) { - if (requestNumber < requestSequence) { - return; - } - // TODO 3.0 - replace query.page with query so users have access to term, page, etc. - var results = options.results(data, query.page); + // TODO - replace query.page with query so users have access to term, page, etc. + // added query as third paramter to keep backwards compatibility + var results = options.results(data, query.page, query); + query.callback(results); + }, + error: function(jqXHR, textStatus, errorThrown){ + var results = { + hasError: true, + jqXHR: jqXHR, + textStatus: textStatus, + errorThrown: errorThrown + }; + query.callback(results); } }); + handler = transport.call(self, params); }, quietMillis); }; } @@ -342,7 +469,7 @@ the specific language governing permissions and limitations under the Apache Lic * * If the array form is used it is assumed that it contains objects with 'id' and 'text' keys. * - * If the object form is used ti is assumed that it contains 'data' and 'text' keys. The 'data' key should contain + * If the object form is used it is assumed that it contains 'data' and 'text' keys. The 'data' key should contain * an array of objects that will be used as choices. These objects must contain at least an 'id' key. The 'text' * key can either be a String in which case it is expected that each element in the 'data' array has a key with the * value of 'text' which will be used to match choices. Alternatively, text can be a function(item) that can extract @@ -351,22 +478,33 @@ the specific language governing permissions and limitations under the Apache Lic function local(options) { var data = options, // data elements dataText, + tmp, text = function (item) { return ""+item.text; }; // function used to retrieve the text portion of a data item that is matched against the search - if (!$.isArray(data)) { - text = data.text; + if ($.isArray(data)) { + tmp = data; + data = { results: tmp }; + } + + if ($.isFunction(data) === false) { + tmp = data; + data = function() { return tmp; }; + } + + var dataItem = data(); + if (dataItem.text) { + text = dataItem.text; // if text is not a function we assume it to be a key name if (!$.isFunction(text)) { - dataText = data.text; // we need to store this in a separate variable because in the next step data gets reset and data.text is no longer available - text = function (item) { return item[dataText]; }; + dataText = dataItem.text; // we need to store this in a separate variable because in the next step data gets reset and data.text is no longer available + text = function (item) { return item[dataText]; }; } - data = data.results; } return function (query) { var t = query.term, filtered = { results: [] }, process; if (t === "") { - query.callback({results: data}); + query.callback(data()); return; } @@ -380,41 +518,37 @@ the specific language governing permissions and limitations under the Apache Lic } group.children=[]; $(datum.children).each2(function(i, childDatum) { process(childDatum, group.children); }); - if (group.children.length || query.matcher(t, text(group))) { + if (group.children.length || query.matcher(t, text(group), datum)) { collection.push(group); } } else { - if (query.matcher(t, text(datum))) { + if (query.matcher(t, text(datum), datum)) { collection.push(datum); } } }; - $(data).each2(function(i, datum) { process(datum, filtered.results); }); + $(data().results).each2(function(i, datum) { process(datum, filtered.results); }); query.callback(filtered); }; } // TODO javadoc function tags(data) { - // TODO even for a function we should probably return a wrapper that does the same object/string check as - // the function for arrays. otherwise only functions that return objects are supported. - if ($.isFunction(data)) { - return data; - } - - // if not a function we assume it to be an array - + var isFunc = $.isFunction(data); return function (query) { var t = query.term, filtered = {results: []}; - $(data).each(function () { - var isObject = this.text !== undefined, - text = isObject ? this.text : this; - if (t === "" || query.matcher(t, text)) { - filtered.results.push(isObject ? this : {id: this, text: this}); - } - }); - query.callback(filtered); + var result = isFunc ? data(query) : data; + if ($.isArray(result)) { + $(result).each(function () { + var isObject = this.text !== undefined, + text = isObject ? this.text : this; + if (t === "" || query.matcher(t, text)) { + filtered.results.push(isObject ? this : {id: this, text: this}); + } + }); + query.callback(filtered); + } }; } @@ -429,11 +563,24 @@ the specific language governing permissions and limitations under the Apache Lic function checkFormatter(formatter, formatterName) { if ($.isFunction(formatter)) return true; if (!formatter) return false; - throw new Error("formatterName must be a function or a falsy value"); + if (typeof(formatter) === 'string') return true; + throw new Error(formatterName +" must be a string, function, or falsy value"); } - function evaluate(val) { - return $.isFunction(val) ? val() : val; + /** + * Returns a given value + * If given a function, returns its output + * + * @param val string|function + * @param context value of "this" to be passed to function + * @returns {*} + */ + function evaluate(val, context) { + if ($.isFunction(val)) { + var args = Array.prototype.slice.call(arguments, 2); + return val.apply(context, args); + } + return val; } function countResults(results) { @@ -484,7 +631,7 @@ the specific language governing permissions and limitations under the Apache Lic input = input.substring(index + separator.length); if (token.length > 0) { - token = opts.createSearchChoice(token, selection); + token = opts.createSearchChoice.call(this, token, selection); if (token !== undefined && token !== null && opts.id(token) !== undefined && opts.id(token) !== null) { dupe = false; for (i = 0, l = selection.length; i < l; i++) { @@ -498,38 +645,17 @@ the specific language governing permissions and limitations under the Apache Lic } } - if (original.localeCompare(input) != 0) return input; + if (original!==input) return input; } - /** - * blurs any Select2 container that has focus when an element outside them was clicked or received focus - * - * also takes care of clicks on label tags that point to the source element - */ - $document.ready(function () { - $document.bind("mousedown touchend", function (e) { - var target = $(e.target).closest("div.select2-container").get(0), attr; - if (target) { - $document.find("div.select2-container-active").each(function () { - if (this !== target) $(this).data("select2").blur(); - }); - } else { - target = $(e.target).closest("div.select2-drop").get(0); - $document.find("div.select2-drop-active").each(function () { - if (this !== target) $(this).data("select2").blur(); - }); - } + function cleanupJQueryElements() { + var self = this; - target=$(e.target); - attr = target.attr("for"); - if ("LABEL" === e.target.tagName && attr && attr.length > 0) { - attr = attr.replace(/([\[\].])/g,'\\$1'); /* escapes [, ], and . so properly selects the id */ - target = $("#"+attr); - target = target.data("select2"); - if (target !== undefined) { target.focus(); e.preventDefault();} - } + $.each(arguments, function (i, element) { + self[element].remove(); + self[element] = null; }); - }); + } /** * Creates a new class @@ -568,59 +694,98 @@ the specific language governing permissions and limitations under the Apache Lic // destroy if called on an existing component if (opts.element.data("select2") !== undefined && opts.element.data("select2") !== null) { - this.destroy(); + opts.element.data("select2").destroy(); } - this.enabled=true; this.container = this.createContainer(); + this.liveRegion = $('.select2-hidden-accessible'); + if (this.liveRegion.length == 0) { + this.liveRegion = $("<span>", { + role: "status", + "aria-live": "polite" + }) + .addClass("select2-hidden-accessible") + .appendTo(document.body); + } + this.containerId="s2id_"+(opts.element.attr("id") || "autogen"+nextUid()); - this.containerSelector="#"+this.containerId.replace(/([;&,\.\+\*\~':"\!\^#$%@\[\]\(\)=>\|])/g, '\\$1'); + this.containerEventName= this.containerId + .replace(/([.])/g, '_') + .replace(/([;&,\-\.\+\*\~':"\!\^#$%@\[\]\(\)=>\|])/g, '\\$1'); this.container.attr("id", this.containerId); - // cache the body so future lookups are cheap - this.body = thunk(function() { return opts.element.closest("body"); }); + this.container.attr("title", opts.element.attr("title")); - if (opts.element.attr("class") !== undefined) { - this.container.addClass(opts.element.attr("class").replace(/validate\[[\S ]+] ?/, '')); - } + this.body = $(document.body); - this.container.css(evaluate(opts.containerCss)); - this.container.addClass(evaluate(opts.containerCssClass)); + syncCssClasses(this.container, this.opts.element, this.opts.adaptContainerCssClass); + + this.container.attr("style", opts.element.attr("style")); + this.container.css(evaluate(opts.containerCss, this.opts.element)); + this.container.addClass(evaluate(opts.containerCssClass, this.opts.element)); + + this.elementTabIndex = this.opts.element.attr("tabindex"); // swap container for the element this.opts.element .data("select2", this) - .hide() - .before(this.container); + .attr("tabindex", "-1") + .before(this.container) + .on("click.select2", killEvent); // do not leak click events + this.container.data("select2", this); this.dropdown = this.container.find(".select2-drop"); - this.dropdown.addClass(evaluate(opts.dropdownCssClass)); + + syncCssClasses(this.dropdown, this.opts.element, this.opts.adaptDropdownCssClass); + + this.dropdown.addClass(evaluate(opts.dropdownCssClass, this.opts.element)); this.dropdown.data("select2", this); + this.dropdown.on("click", killEvent); this.results = results = this.container.find(resultsSelector); this.search = search = this.container.find("input.select2-input"); - search.attr("tabIndex", this.opts.element.attr("tabIndex")); - + this.queryCount = 0; this.resultsPage = 0; this.context = null; // initialize the container this.initContainer(); - this.initContainerWidth(); + + this.container.on("click", killEvent); installFilteredMouseMove(this.results); - this.dropdown.delegate(resultsSelector, "mousemove-filtered", this.bind(this.highlightUnderEvent)); + + this.dropdown.on("mousemove-filtered", resultsSelector, this.bind(this.highlightUnderEvent)); + this.dropdown.on("touchstart touchmove touchend", resultsSelector, this.bind(function (event) { + this._touchEvent = true; + this.highlightUnderEvent(event); + })); + this.dropdown.on("touchmove", resultsSelector, this.bind(this.touchMoved)); + this.dropdown.on("touchstart touchend", resultsSelector, this.bind(this.clearTouchMoved)); + + // Waiting for a click event on touch devices to select option and hide dropdown + // otherwise click will be triggered on an underlying element + this.dropdown.on('click', this.bind(function (event) { + if (this._touchEvent) { + this._touchEvent = false; + this.selectHighlighted(); + } + })); installDebouncedScroll(80, this.results); - this.dropdown.delegate(resultsSelector, "scroll-debounced", this.bind(this.loadMoreIfNeeded)); + this.dropdown.on("scroll-debounced", resultsSelector, this.bind(this.loadMoreIfNeeded)); + + // do not propagate change event from the search field out of the component + $(this.container).on("change", ".select2-input", function(e) {e.stopPropagation();}); + $(this.dropdown).on("change", ".select2-input", function(e) {e.stopPropagation();}); // if jquery.mousewheel plugin is installed we can prevent out-of-bounds scrolling of results via mousewheel if ($.fn.mousewheel) { results.mousewheel(function (e, delta, deltaX, deltaY) { - var top = results.scrollTop(), height; + var top = results.scrollTop(); if (deltaY > 0 && top - deltaY <= 0) { results.scrollTop(0); killEvent(e); @@ -632,24 +797,24 @@ the specific language governing permissions and limitations under the Apache Lic } installKeyUpChangeEvent(search); - search.bind("keyup-change", this.bind(this.updateResults)); - search.bind("focus", function () { search.addClass("select2-focused"); if (search.val() === " ") search.val(""); }); - search.bind("blur", function () { search.removeClass("select2-focused");}); + search.on("keyup-change input paste", this.bind(this.updateResults)); + search.on("focus", function () { search.addClass("select2-focused"); }); + search.on("blur", function () { search.removeClass("select2-focused");}); - this.dropdown.delegate(resultsSelector, "mouseup", this.bind(function (e) { - if ($(e.target).closest(".select2-result-selectable:not(.select2-disabled)").length > 0) { + this.dropdown.on("mouseup", resultsSelector, this.bind(function (e) { + if ($(e.target).closest(".select2-result-selectable").length > 0) { this.highlightUnderEvent(e); this.selectHighlighted(e); - } else { - this.focusSearch(); } - killEvent(e); })); // trap all mouse events from leaving the dropdown. sometimes there may be a modal that is listening // for mouse events outside of itself so it can close itself. since the dropdown is now outside the select2's // dom it will trigger the popup close, which is not what we want - this.dropdown.bind("click mouseup mousedown", function (e) { e.stopPropagation(); }); + // focusin can cause focus wars between modals and select2 since the dropdown is outside the modal. + this.dropdown.on("click mouseup mousedown touchstart touchend focusin", function (e) { e.stopPropagation(); }); + + this.nextSearchTerm = undefined; if ($.isFunction(this.opts.initSelection)) { // initialize selection based on the current value of the source element @@ -660,25 +825,97 @@ the specific language governing permissions and limitations under the Apache Lic this.monitorSource(); } - if (opts.element.is(":disabled") || opts.element.is("[readonly='readonly']")) this.disable(); + if (opts.maximumInputLength !== null) { + this.search.attr("maxlength", opts.maximumInputLength); + } + + var disabled = opts.element.prop("disabled"); + if (disabled === undefined) disabled = false; + this.enable(!disabled); + + var readonly = opts.element.prop("readonly"); + if (readonly === undefined) readonly = false; + this.readonly(readonly); + + // Calculate size of scrollbar + scrollBarDimensions = scrollBarDimensions || measureScrollbar(); + + this.autofocus = opts.element.prop("autofocus"); + opts.element.prop("autofocus", false); + if (this.autofocus) this.focus(); + + this.search.attr("placeholder", opts.searchInputPlaceholder); }, // abstract destroy: function () { - var select2 = this.opts.element.data("select2"); + var element=this.opts.element, select2 = element.data("select2"), self = this; + + this.close(); + + if (element.length && element[0].detachEvent && self._sync) { + element.each(function () { + if (self._sync) { + this.detachEvent("onpropertychange", self._sync); + } + }); + } + if (this.propertyObserver) { + this.propertyObserver.disconnect(); + this.propertyObserver = null; + } + this._sync = null; + if (select2 !== undefined) { select2.container.remove(); + select2.liveRegion.remove(); select2.dropdown.remove(); - select2.opts.element + element + .show() .removeData("select2") - .unbind(".select2") - .show(); + .off(".select2") + .prop("autofocus", this.autofocus || false); + if (this.elementTabIndex) { + element.attr({tabindex: this.elementTabIndex}); + } else { + element.removeAttr("tabindex"); + } + element.show(); + } + + cleanupJQueryElements.call(this, + "container", + "liveRegion", + "dropdown", + "results", + "search" + ); + }, + + // abstract + optionToData: function(element) { + if (element.is("option")) { + return { + id:element.prop("value"), + text:element.text(), + element: element.get(), + css: element.attr("class"), + disabled: element.prop("disabled"), + locked: equal(element.attr("locked"), "locked") || equal(element.data("locked"), true) + }; + } else if (element.is("optgroup")) { + return { + text:element.attr("label"), + children:[], + element: element.get(), + css: element.attr("class") + }; } }, // abstract prepareOpts: function (opts) { - var element, select, idKey, ajaxUrl; + var element, select, idKey, ajaxUrl, self = this; element = opts.element; @@ -697,33 +934,45 @@ the specific language governing permissions and limitations under the Apache Lic opts = $.extend({}, { populateResults: function(container, results, query) { - var populate, data, result, children, id=this.opts.id, self=this; + var populate, id=this.opts.id, liveRegion=this.liveRegion; populate=function(results, container, depth) { - var i, l, result, selectable, compound, node, label, innerContainer, formatted; + var i, l, result, selectable, disabled, compound, node, label, innerContainer, formatted; + + results = opts.sortResults(results, container, query); + + // collect the created nodes for bulk append + var nodes = []; for (i = 0, l = results.length; i < l; i = i + 1) { result=results[i]; - selectable=id(result) !== undefined; + + disabled = (result.disabled === true); + selectable = (!disabled) && (id(result) !== undefined); + compound=result.children && result.children.length > 0; node=$("<li></li>"); node.addClass("select2-results-dept-"+depth); node.addClass("select2-result"); node.addClass(selectable ? "select2-result-selectable" : "select2-result-unselectable"); + if (disabled) { node.addClass("select2-disabled"); } if (compound) { node.addClass("select2-result-with-children"); } node.addClass(self.opts.formatResultCssClass(result)); + node.attr("role", "presentation"); - label=$("<div></div>"); + label=$(document.createElement("div")); label.addClass("select2-result-label"); + label.attr("id", "select2-result-label-" + nextUid()); + label.attr("role", "option"); - formatted=opts.formatResult(result, label, query); + formatted=opts.formatResult(result, label, query, self.opts.escapeMarkup); if (formatted!==undefined) { - label.html(self.opts.escapeMarkup(formatted)); + label.html(formatted); + node.append(label); } - node.append(label); if (compound) { @@ -734,8 +983,12 @@ the specific language governing permissions and limitations under the Apache Lic } node.data("select2-data", result); - container.append(node); + nodes.push(node[0]); } + + // bulk append the created nodes + container.append(nodes); + liveRegion.text(opts.formatMatches(results.length)); }; populate(results, container, 0); @@ -747,20 +1000,27 @@ the specific language governing permissions and limitations under the Apache Lic opts.id = function (e) { return e[idKey]; }; } + if ($.isArray(opts.element.data("select2Tags"))) { + if ("tags" in opts) { + throw "tags specified as both an attribute 'data-select2-tags' and in options of Select2 " + opts.element.attr("id"); + } + opts.tags=opts.element.data("select2Tags"); + } + if (select) { opts.query = this.bind(function (query) { var data = { results: [], more: false }, term = query.term, - children, firstChild, process; + children, placeholderOption, process; process=function(element, collection) { var group; if (element.is("option")) { if (query.matcher(term, element.text(), element)) { - collection.push({id:element.attr("value"), text:element.text(), element: element.get(), css: element.attr("class")}); + collection.push(self.optionToData(element)); } } else if (element.is("optgroup")) { - group={text:element.attr("label"), children:[], element: element.get(), css: element.attr("class")}; + group=self.optionToData(element); element.children().each2(function(i, elm) { process(elm, group.children); }); if (group.children.length>0) { collection.push(group); @@ -772,9 +1032,9 @@ the specific language governing permissions and limitations under the Apache Lic // ignore the placeholder option if there is one if (this.getPlaceholder() !== undefined && children.length > 0) { - firstChild = children[0]; - if ($(firstChild).text() === "") { - children=children.not(firstChild); + placeholderOption = this.getPlaceholderOption(); + if (placeholderOption) { + children=children.not(placeholderOption); } } @@ -782,35 +1042,38 @@ the specific language governing permissions and limitations under the Apache Lic query.callback(data); }); - // this is needed because inside val() we construct choices from options and there id is hardcoded + // this is needed because inside val() we construct choices from options and their id is hardcoded opts.id=function(e) { return e.id; }; - opts.formatResultCssClass = function(data) { return data.css; } } else { if (!("query" in opts)) { + if ("ajax" in opts) { ajaxUrl = opts.element.data("ajax-url"); if (ajaxUrl && ajaxUrl.length > 0) { opts.ajax.url = ajaxUrl; } - opts.query = ajax(opts.ajax); + opts.query = ajax.call(opts.element, opts.ajax); } else if ("data" in opts) { opts.query = local(opts.data); } else if ("tags" in opts) { opts.query = tags(opts.tags); if (opts.createSearchChoice === undefined) { - opts.createSearchChoice = function (term) { return {id: term, text: term}; }; + opts.createSearchChoice = function (term) { return {id: $.trim(term), text: $.trim(term)}; }; + } + if (opts.initSelection === undefined) { + opts.initSelection = function (element, callback) { + var data = []; + $(splitVal(element.val(), opts.separator, opts.transformVal)).each(function () { + var obj = { id: this, text: this }, + tags = opts.tags; + if ($.isFunction(tags)) tags=tags(); + $(tags).each(function() { if (equal(this.id, obj.id)) { obj = this; return false; } }); + data.push(obj); + }); + + callback(data); + }; } - opts.initSelection = function (element, callback) { - var data = []; - $(splitVal(element.val(), opts.separator)).each(function () { - var id = this, text = this, tags=opts.tags; - if ($.isFunction(tags)) tags=tags(); - $(tags).each(function() { if (equal(this.id, id)) { text = this.text; return false; } }); - data.push({id: id, text: text}); - }); - - callback(data); - }; } } } @@ -818,6 +1081,16 @@ the specific language governing permissions and limitations under the Apache Lic throw "query function not defined for Select2 " + opts.element.attr("id"); } + if (opts.createSearchChoicePosition === 'top') { + opts.createSearchChoicePosition = function(list, item) { list.unshift(item); }; + } + else if (opts.createSearchChoicePosition === 'bottom') { + opts.createSearchChoicePosition = function(list, item) { list.push(item); }; + } + else if (typeof(opts.createSearchChoicePosition) !== "function") { + throw "invalid createSearchChoicePosition option must be 'top', 'bottom' or a custom function"; + } + return opts; }, @@ -826,11 +1099,60 @@ the specific language governing permissions and limitations under the Apache Lic */ // abstract monitorSource: function () { - this.opts.element.bind("change.select2", this.bind(function (e) { + var el = this.opts.element, observer, self = this; + + el.on("change.select2", this.bind(function (e) { if (this.opts.element.data("select2-change-triggered") !== true) { this.initSelection(); } })); + + this._sync = this.bind(function () { + + // sync enabled state + var disabled = el.prop("disabled"); + if (disabled === undefined) disabled = false; + this.enable(!disabled); + + var readonly = el.prop("readonly"); + if (readonly === undefined) readonly = false; + this.readonly(readonly); + + if (this.container) { + syncCssClasses(this.container, this.opts.element, this.opts.adaptContainerCssClass); + this.container.addClass(evaluate(this.opts.containerCssClass, this.opts.element)); + } + + if (this.dropdown) { + syncCssClasses(this.dropdown, this.opts.element, this.opts.adaptDropdownCssClass); + this.dropdown.addClass(evaluate(this.opts.dropdownCssClass, this.opts.element)); + } + + }); + + // IE8-10 (IE9/10 won't fire propertyChange via attachEventListener) + if (el.length && el[0].attachEvent) { + el.each(function() { + this.attachEvent("onpropertychange", self._sync); + }); + } + + // safari, chrome, firefox, IE11 + observer = window.MutationObserver || window.WebKitMutationObserver|| window.MozMutationObserver; + if (observer !== undefined) { + if (this.propertyObserver) { delete this.propertyObserver; this.propertyObserver = null; } + this.propertyObserver = new observer(function (mutations) { + $.each(mutations, self._sync); + }); + this.propertyObserver.observe(el.get(0), { attributes:true, subtree:false }); + } + }, + + // abstract + triggerSelect: function(data) { + var evt = $.Event("select2-selecting", { val: this.id(data), object: data, choice: data }); + this.opts.element.trigger(evt); + return !evt.isDefaultPrevented(); }, /** @@ -850,99 +1172,173 @@ the specific language governing permissions and limitations under the Apache Lic // so here we trigger the click event manually this.opts.element.click(); - // ValidationEngine ignorea the change event and listens instead to blur + // ValidationEngine ignores the change event and listens instead to blur // so here we trigger the blur event manually if so desired if (this.opts.blurOnChange) this.opts.element.blur(); }, + //abstract + isInterfaceEnabled: function() + { + return this.enabledInterface === true; + }, + + // abstract + enableInterface: function() { + var enabled = this._enabled && !this._readonly, + disabled = !enabled; + + if (enabled === this.enabledInterface) return false; + + this.container.toggleClass("select2-container-disabled", disabled); + this.close(); + this.enabledInterface = enabled; + + return true; + }, // abstract - enable: function() { - if (this.enabled) return; + enable: function(enabled) { + if (enabled === undefined) enabled = true; + if (this._enabled === enabled) return; + this._enabled = enabled; - this.enabled=true; - this.container.removeClass("select2-container-disabled"); - this.opts.element.removeAttr("disabled"); + this.opts.element.prop("disabled", !enabled); + this.enableInterface(); }, // abstract disable: function() { - if (!this.enabled) return; + this.enable(false); + }, - this.close(); + // abstract + readonly: function(enabled) { + if (enabled === undefined) enabled = false; + if (this._readonly === enabled) return; + this._readonly = enabled; - this.enabled=false; - this.container.addClass("select2-container-disabled"); - this.opts.element.attr("disabled", "disabled"); + this.opts.element.prop("readonly", enabled); + this.enableInterface(); }, // abstract opened: function () { - return this.container.hasClass("select2-dropdown-open"); + return (this.container) ? this.container.hasClass("select2-dropdown-open") : false; }, // abstract positionDropdown: function() { - var offset = this.container.offset(), - height = this.container.outerHeight(false), - width = this.container.outerWidth(false), - dropHeight = this.dropdown.outerHeight(false), - viewPortRight = $(window).scrollLeft() + document.documentElement.clientWidth, - viewportBottom = $(window).scrollTop() + document.documentElement.clientHeight, + var $dropdown = this.dropdown, + container = this.container, + offset = container.offset(), + height = container.outerHeight(false), + width = container.outerWidth(false), + dropHeight = $dropdown.outerHeight(false), + $window = $(window), + windowWidth = $window.width(), + windowHeight = $window.height(), + viewPortRight = $window.scrollLeft() + windowWidth, + viewportBottom = $window.scrollTop() + windowHeight, dropTop = offset.top + height, dropLeft = offset.left, enoughRoomBelow = dropTop + dropHeight <= viewportBottom, - enoughRoomAbove = (offset.top - dropHeight) >= this.body().scrollTop(), - dropWidth = this.dropdown.outerWidth(false), - enoughRoomOnRight = dropLeft + dropWidth <= viewPortRight, - aboveNow = this.dropdown.hasClass("select2-drop-above"), + enoughRoomAbove = (offset.top - dropHeight) >= $window.scrollTop(), + dropWidth = $dropdown.outerWidth(false), + enoughRoomOnRight = function() { + return dropLeft + dropWidth <= viewPortRight; + }, + enoughRoomOnLeft = function() { + return offset.left + viewPortRight + container.outerWidth(false) > dropWidth; + }, + aboveNow = $dropdown.hasClass("select2-drop-above"), bodyOffset, above, - css; + changeDirection, + css, + resultsListNode; + + // always prefer the current above/below alignment, unless there is not enough room + if (aboveNow) { + above = true; + if (!enoughRoomAbove && enoughRoomBelow) { + changeDirection = true; + above = false; + } + } else { + above = false; + if (!enoughRoomBelow && enoughRoomAbove) { + changeDirection = true; + above = true; + } + } - // console.log("below/ droptop:", dropTop, "dropHeight", dropHeight, "sum", (dropTop+dropHeight)+" viewport bottom", viewportBottom, "enough?", enoughRoomBelow); - // console.log("above/ offset.top", offset.top, "dropHeight", dropHeight, "top", (offset.top-dropHeight), "scrollTop", this.body().scrollTop(), "enough?", enoughRoomAbove); + //if we are changing direction we need to get positions when dropdown is hidden; + if (changeDirection) { + $dropdown.hide(); + offset = this.container.offset(); + height = this.container.outerHeight(false); + width = this.container.outerWidth(false); + dropHeight = $dropdown.outerHeight(false); + viewPortRight = $window.scrollLeft() + windowWidth; + viewportBottom = $window.scrollTop() + windowHeight; + dropTop = offset.top + height; + dropLeft = offset.left; + dropWidth = $dropdown.outerWidth(false); + $dropdown.show(); + + // fix so the cursor does not move to the left within the search-textbox in IE + this.focusSearch(); + } - // fix positioning when body has an offset and is not position: static + if (this.opts.dropdownAutoWidth) { + resultsListNode = $('.select2-results', $dropdown)[0]; + $dropdown.addClass('select2-drop-auto-width'); + $dropdown.css('width', ''); + // Add scrollbar width to dropdown if vertical scrollbar is present + dropWidth = $dropdown.outerWidth(false) + (resultsListNode.scrollHeight === resultsListNode.clientHeight ? 0 : scrollBarDimensions.width); + dropWidth > width ? width = dropWidth : dropWidth = width; + dropHeight = $dropdown.outerHeight(false); + } + else { + this.container.removeClass('select2-drop-auto-width'); + } + + //console.log("below/ droptop:", dropTop, "dropHeight", dropHeight, "sum", (dropTop+dropHeight)+" viewport bottom", viewportBottom, "enough?", enoughRoomBelow); + //console.log("above/ offset.top", offset.top, "dropHeight", dropHeight, "top", (offset.top-dropHeight), "scrollTop", this.body.scrollTop(), "enough?", enoughRoomAbove); - if (this.body().css('position') !== 'static') { - bodyOffset = this.body().offset(); + // fix positioning when body has an offset and is not position: static + if (this.body.css('position') !== 'static') { + bodyOffset = this.body.offset(); dropTop -= bodyOffset.top; dropLeft -= bodyOffset.left; } - // always prefer the current above/below alignment, unless there is not enough room - - if (aboveNow) { - above = true; - if (!enoughRoomAbove && enoughRoomBelow) above = false; - } else { - above = false; - if (!enoughRoomBelow && enoughRoomAbove) above = true; + if (!enoughRoomOnRight() && enoughRoomOnLeft()) { + dropLeft = offset.left + this.container.outerWidth(false) - dropWidth; } - if (!enoughRoomOnRight) { - dropLeft = offset.left + width - dropWidth; - } + css = { + left: dropLeft, + width: width + }; if (above) { - dropTop = offset.top - dropHeight; + css.top = offset.top - dropHeight; + css.bottom = 'auto'; this.container.addClass("select2-drop-above"); - this.dropdown.addClass("select2-drop-above"); + $dropdown.addClass("select2-drop-above"); } else { + css.top = dropTop; + css.bottom = 'auto'; this.container.removeClass("select2-drop-above"); - this.dropdown.removeClass("select2-drop-above"); + $dropdown.removeClass("select2-drop-above"); } + css = $.extend(css, evaluate(this.opts.dropdownCss, this.opts.element)); - css = $.extend({ - top: dropTop, - left: dropLeft, - width: width - }, evaluate(this.opts.dropdownCss)); - - this.dropdown.css(css); + $dropdown.css(css); }, // abstract @@ -951,7 +1347,9 @@ the specific language governing permissions and limitations under the Apache Lic if (this.opened()) return false; - event = $.Event("open"); + if (this._enabled === false || this._readonly === true) return false; + + event = $.Event("select2-opening"); this.opts.element.trigger(event); return !event.isDefaultPrevented(); }, @@ -974,7 +1372,13 @@ the specific language governing permissions and limitations under the Apache Lic if (!this.shouldOpen()) return false; - window.setTimeout(this.bind(this.opening), 1); + this.opening(); + + // Only bind the document mousemove when the dropdown is visible + $document.on("mousemove.select2Event", function (e) { + lastMousePosition.x = e.pageX; + lastMousePosition.y = e.pageY; + }); return true; }, @@ -984,73 +1388,110 @@ the specific language governing permissions and limitations under the Apache Lic */ // abstract opening: function() { - var cid = this.containerId, selector = this.containerSelector, - scroll = "scroll." + cid, resize = "resize." + cid; - - this.container.parents().each(function() { - $(this).bind(scroll, function() { - var s2 = $(selector); - if (s2.length == 0) { - $(this).unbind(scroll); - } - s2.select2("close"); - }); - }); + var cid = this.containerEventName, + scroll = "scroll." + cid, + resize = "resize."+cid, + orient = "orientationchange."+cid, + mask; - window.setTimeout(function() { - // this is done inside a timeout because IE will sometimes fire a resize event while opening - // the dropdown and that causes this handler to immediately close it. this way the dropdown - // has a chance to fully open before we start listening to resize events - $(window).bind(resize, function() { - var s2 = $(selector); - if (s2.length == 0) { - $(window).unbind(resize); - } - s2.select2("close"); - }) - }, 10); + this.container.addClass("select2-dropdown-open").addClass("select2-container-active"); this.clearDropdownAlignmentPreference(); - if (this.search.val() === " ") { this.search.val(""); } + if(this.dropdown[0] !== this.body.children().last()[0]) { + this.dropdown.detach().appendTo(this.body); + } + + // create the dropdown mask if doesn't already exist + mask = $("#select2-drop-mask"); + if (mask.length === 0) { + mask = $(document.createElement("div")); + mask.attr("id","select2-drop-mask").attr("class","select2-drop-mask"); + mask.hide(); + mask.appendTo(this.body); + mask.on("mousedown touchstart click", function (e) { + // Prevent IE from generating a click event on the body + reinsertElement(mask); + + var dropdown = $("#select2-drop"), self; + if (dropdown.length > 0) { + self=dropdown.data("select2"); + if (self.opts.selectOnBlur) { + self.selectHighlighted({noFocus: true}); + } + self.close(); + e.preventDefault(); + e.stopPropagation(); + } + }); + } - this.container.addClass("select2-dropdown-open").addClass("select2-container-active"); + // ensure the mask is always right before the dropdown + if (this.dropdown.prev()[0] !== mask[0]) { + this.dropdown.before(mask); + } - this.updateResults(true); + // move the global id to the correct dropdown + $("#select2-drop").removeAttr("id"); + this.dropdown.attr("id", "select2-drop"); - if(this.dropdown[0] !== this.body().children().last()[0]) { - this.dropdown.detach().appendTo(this.body()); - } + // show the elements + mask.show(); + this.positionDropdown(); this.dropdown.show(); - this.positionDropdown(); + this.dropdown.addClass("select2-drop-active"); - this.ensureHighlightVisible(); + // attach listeners to events that can change the position of the container and thus require + // the position of the dropdown to be updated as well so it does not come unglued from the container + var that = this; + this.container.parents().add(window).each(function () { + $(this).on(resize+" "+scroll+" "+orient, function (e) { + if (that.opened()) that.positionDropdown(); + }); + }); + - this.focusSearch(); }, // abstract close: function () { if (!this.opened()) return; - var self = this; + var cid = this.containerEventName, + scroll = "scroll." + cid, + resize = "resize."+cid, + orient = "orientationchange."+cid; - this.container.parents().each(function() { - $(this).unbind("scroll." + self.containerId); - }); - $(window).unbind("resize." + this.containerId); + // unbind event listeners + this.container.parents().add(window).each(function () { $(this).off(scroll).off(resize).off(orient); }); this.clearDropdownAlignmentPreference(); + $("#select2-drop-mask").hide(); + this.dropdown.removeAttr("id"); // only the active dropdown has the select2-drop id this.dropdown.hide(); this.container.removeClass("select2-dropdown-open").removeClass("select2-container-active"); this.results.empty(); + + // Now that the dropdown is closed, unbind the global document mousemove event + $document.off("mousemove.select2Event"); + this.clearSearch(); + this.search.removeClass("select2-active"); + this.opts.element.trigger($.Event("select2-close")); + }, - this.opts.element.trigger($.Event("close")); + /** + * Opens control, sets input value, and updates results. + */ + // abstract + externalSearch: function (term) { + this.open(); + this.search.val(term); + this.updateResults(false); }, // abstract @@ -1058,9 +1499,14 @@ the specific language governing permissions and limitations under the Apache Lic }, + //abstract + getMaximumSelectionSize: function() { + return evaluate(this.opts.maximumSelectionSize, this.opts.element); + }, + // abstract ensureHighlightVisible: function () { - var results = this.results, children, index, child, hb, rb, y, more; + var results = this.results, children, index, child, hb, rb, y, more, topOffset; index = this.highlight(); @@ -1076,11 +1522,13 @@ the specific language governing permissions and limitations under the Apache Lic return; } - children = results.find(".select2-result-selectable"); + children = this.findHighlightableChoices().find('.select2-result-label'); child = $(children[index]); - hb = child.offset().top + child.outerHeight(true); + topOffset = (child.offset() || {}).top || 0; + + hb = topOffset + child.outerHeight(true); // if this is the last child lets also make sure select2-more-results is visible if (index === children.length - 1) { @@ -1090,11 +1538,11 @@ the specific language governing permissions and limitations under the Apache Lic } } - rb = results.offset().top + results.outerHeight(true); + rb = results.offset().top + results.outerHeight(false); if (hb > rb) { results.scrollTop(results.scrollTop() + (hb - rb)); } - y = child.offset().top - results.offset().top; + y = topOffset - results.offset().top; // make sure the top of the element is visible if (y < 0 && child.css('display') != 'none' ) { @@ -1102,15 +1550,20 @@ the specific language governing permissions and limitations under the Apache Lic } }, + // abstract + findHighlightableChoices: function() { + return this.results.find(".select2-result-selectable:not(.select2-disabled):not(.select2-selected)"); + }, + // abstract moveHighlight: function (delta) { - var choices = this.results.find(".select2-result-selectable"), + var choices = this.findHighlightableChoices(), index = this.highlight(); while (index > -1 && index < choices.length) { index += delta; var choice = $(choices[index]); - if (choice.hasClass("select2-result-selectable") && !choice.hasClass("select2-disabled")) { + if (choice.hasClass("select2-result-selectable") && !choice.hasClass("select2-disabled") && !choice.hasClass("select2-selected")) { this.highlight(index); break; } @@ -1119,7 +1572,9 @@ the specific language governing permissions and limitations under the Apache Lic // abstract highlight: function (index) { - var choices = this.results.find(".select2-result-selectable").not(".select2-disabled"); + var choices = this.findHighlightableChoices(), + choice, + data; if (arguments.length === 0) { return indexOf(choices.filter(".select2-highlighted")[0], choices.get()); @@ -1128,27 +1583,50 @@ the specific language governing permissions and limitations under the Apache Lic if (index >= choices.length) index = choices.length - 1; if (index < 0) index = 0; - choices.removeClass("select2-highlighted"); + this.removeHighlight(); + + choice = $(choices[index]); + choice.addClass("select2-highlighted"); + + // ensure assistive technology can determine the active choice + this.search.attr("aria-activedescendant", choice.find(".select2-result-label").attr("id")); - $(choices[index]).addClass("select2-highlighted"); this.ensureHighlightVisible(); + this.liveRegion.text(choice.text()); + + data = choice.data("select2-data"); + if (data) { + this.opts.element.trigger({ type: "select2-highlight", val: this.id(data), choice: data }); + } + }, + + removeHighlight: function() { + this.results.find(".select2-highlighted").removeClass("select2-highlighted"); + }, + + touchMoved: function() { + this._touchMoved = true; + }, + + clearTouchMoved: function() { + this._touchMoved = false; }, // abstract countSelectableResults: function() { - return this.results.find(".select2-result-selectable").not(".select2-disabled").length; + return this.findHighlightableChoices().length; }, // abstract highlightUnderEvent: function (event) { var el = $(event.target).closest(".select2-result-selectable"); if (el.length > 0 && !el.is(".select2-highlighted")) { - var choices = this.results.find('.select2-result-selectable'); + var choices = this.findHighlightableChoices(); this.highlight(choices.index(el)); } else if (el.length == 0) { - // if we are over an unselectable item remove al highlights - this.results.find(".select2-highlighted").removeClass("select2-highlighted"); + // if we are over an unselectable item remove all highlights + this.removeHighlight(); } }, @@ -1157,7 +1635,6 @@ the specific language governing permissions and limitations under the Apache Lic var results = this.results, more = results.find("li.select2-more-results"), below, // pixels the element is below the scroll fold, below==0 is when the element is starting to be visible - offset = -1, // index of first element without data page = this.resultsPage + 1, self=this, term=this.search.val(), @@ -1166,30 +1643,34 @@ the specific language governing permissions and limitations under the Apache Lic if (more.length === 0) return; below = more.offset().top - results.offset().top - results.height(); - if (below <= 0) { + if (below <= this.opts.loadMorePadding) { more.addClass("select2-active"); this.opts.query({ - term: term, - page: page, - context: context, - matcher: this.opts.matcher, - callback: this.bind(function (data) { + element: this.opts.element, + term: term, + page: page, + context: context, + matcher: this.opts.matcher, + callback: this.bind(function (data) { - // ignore a response if the select2 has been closed before it was received - if (!self.opened()) return; + // ignore a response if the select2 has been closed before it was received + if (!self.opened()) return; - self.opts.populateResults.call(this, results, data.results, {term: term, page: page, context:context}); + self.opts.populateResults.call(this, results, data.results, {term: term, page: page, context:context}); + self.postprocessResults(data, false, false); - if (data.more===true) { - more.detach().appendTo(results).text(self.opts.formatLoadMore(page+1)); - window.setTimeout(function() { self.loadMoreIfNeeded(); }, 10); - } else { - more.remove(); - } - self.positionDropdown(); - self.resultsPage = page; - })}); + if (data.more===true) { + more.detach().appendTo(results).html(self.opts.escapeMarkup(evaluate(self.opts.formatLoadMore, self.opts.element, page+1))); + window.setTimeout(function() { self.loadMoreIfNeeded(); }, 10); + } else { + more.remove(); + } + self.positionDropdown(); + self.resultsPage = page; + self.context = data.context; + this.opts.element.trigger({ type: "select2-loaded", items: data }); + })}); } }, @@ -1205,46 +1686,81 @@ the specific language governing permissions and limitations under the Apache Lic */ // abstract updateResults: function (initial) { - var search = this.search, results = this.results, opts = this.opts, data, self=this, input; + var search = this.search, + results = this.results, + opts = this.opts, + data, + self = this, + input, + term = search.val(), + lastTerm = $.data(this.container, "select2-last-term"), + // sequence number used to drop out-of-order responses + queryNumber; + + // prevent duplicate queries against the same term + if (initial !== true && lastTerm && equal(term, lastTerm)) return; + + $.data(this.container, "select2-last-term", term); // if the search is currently hidden we do not alter the results if (initial !== true && (this.showSearchInput === false || !this.opened())) { return; } - search.addClass("select2-active"); - function postRender() { - results.scrollTop(0); search.removeClass("select2-active"); self.positionDropdown(); + if (results.find('.select2-no-results,.select2-selection-limit,.select2-searching').length) { + self.liveRegion.text(results.text()); + } + else { + self.liveRegion.text(self.opts.formatMatches(results.find('.select2-result-selectable:not(".select2-selected")').length)); + } } function render(html) { - results.html(self.opts.escapeMarkup(html)); + results.html(html); postRender(); } - if (opts.maximumSelectionSize >=1) { + queryNumber = ++this.queryCount; + + var maxSelSize = this.getMaximumSelectionSize(); + if (maxSelSize >=1) { data = this.data(); - if ($.isArray(data) && data.length >= opts.maximumSelectionSize && checkFormatter(opts.formatSelectionTooBig, "formatSelectionTooBig")) { - render("<li class='select2-selection-limit'>" + opts.formatSelectionTooBig(opts.maximumSelectionSize) + "</li>"); - return; + if ($.isArray(data) && data.length >= maxSelSize && checkFormatter(opts.formatSelectionTooBig, "formatSelectionTooBig")) { + render("<li class='select2-selection-limit'>" + evaluate(opts.formatSelectionTooBig, opts.element, maxSelSize) + "</li>"); + return; } } if (search.val().length < opts.minimumInputLength) { if (checkFormatter(opts.formatInputTooShort, "formatInputTooShort")) { - render("<li class='select2-no-results'>" + opts.formatInputTooShort(search.val(), opts.minimumInputLength) + "</li>"); + render("<li class='select2-no-results'>" + evaluate(opts.formatInputTooShort, opts.element, search.val(), opts.minimumInputLength) + "</li>"); } else { render(""); } + if (initial && this.showSearch) this.showSearch(true); return; } - else if (opts.formatSearching()) { - render("<li class='select2-searching'>" + opts.formatSearching() + "</li>"); + + if (opts.maximumInputLength && search.val().length > opts.maximumInputLength) { + if (checkFormatter(opts.formatInputTooLong, "formatInputTooLong")) { + render("<li class='select2-no-results'>" + evaluate(opts.formatInputTooLong, opts.element, search.val(), opts.maximumInputLength) + "</li>"); + } else { + render(""); + } + return; + } + + if (opts.formatSearching && this.findHighlightableChoices().length === 0) { + render("<li class='select2-searching'>" + evaluate(opts.formatSearching, opts.element) + "</li>"); } + search.addClass("select2-active"); + + this.removeHighlight(); + // give the tokenizer a chance to pre-process the input input = this.tokenize(); if (input != undefined && input != null) { @@ -1252,50 +1768,67 @@ the specific language governing permissions and limitations under the Apache Lic } this.resultsPage = 1; + opts.query({ - term: search.val(), - page: this.resultsPage, - context: null, - matcher: opts.matcher, - callback: this.bind(function (data) { - var def; // default choice - - // ignore a response if the select2 has been closed before it was received - if (!this.opened()) return; - - // save context, if any - this.context = (data.context===undefined) ? null : data.context; - - // create a default choice and prepend it to the list - if (this.opts.createSearchChoice && search.val() !== "") { - def = this.opts.createSearchChoice.call(null, search.val(), data.results); - if (def !== undefined && def !== null && self.id(def) !== undefined && self.id(def) !== null) { - if ($(data.results).filter( - function () { - return equal(self.id(this), self.id(def)); - }).length === 0) { - data.results.unshift(def); + element: opts.element, + term: search.val(), + page: this.resultsPage, + context: null, + matcher: opts.matcher, + callback: this.bind(function (data) { + var def; // default choice + + // ignore old responses + if (queryNumber != this.queryCount) { + return; + } + + // ignore a response if the select2 has been closed before it was received + if (!this.opened()) { + this.search.removeClass("select2-active"); + return; + } + + // handle ajax error + if(data.hasError !== undefined && checkFormatter(opts.formatAjaxError, "formatAjaxError")) { + render("<li class='select2-ajax-error'>" + evaluate(opts.formatAjaxError, opts.element, data.jqXHR, data.textStatus, data.errorThrown) + "</li>"); + return; + } + + // save context, if any + this.context = (data.context===undefined) ? null : data.context; + // create a default choice and prepend it to the list + if (this.opts.createSearchChoice && search.val() !== "") { + def = this.opts.createSearchChoice.call(self, search.val(), data.results); + if (def !== undefined && def !== null && self.id(def) !== undefined && self.id(def) !== null) { + if ($(data.results).filter( + function () { + return equal(self.id(this), self.id(def)); + }).length === 0) { + this.opts.createSearchChoicePosition(data.results, def); + } } } - } - if (data.results.length === 0 && checkFormatter(opts.formatNoMatches, "formatNoMatches")) { - render("<li class='select2-no-results'>" + opts.formatNoMatches(search.val()) + "</li>"); - return; - } + if (data.results.length === 0 && checkFormatter(opts.formatNoMatches, "formatNoMatches")) { + render("<li class='select2-no-results'>" + evaluate(opts.formatNoMatches, opts.element, search.val()) + "</li>"); + return; + } - results.empty(); - self.opts.populateResults.call(this, results, data.results, {term: search.val(), page: this.resultsPage, context:null}); + results.empty(); + self.opts.populateResults.call(this, results, data.results, {term: search.val(), page: this.resultsPage, context:null}); - if (data.more === true && checkFormatter(opts.formatLoadMore, "formatLoadMore")) { - results.append("<li class='select2-more-results'>" + self.opts.escapeMarkup(opts.formatLoadMore(this.resultsPage)) + "</li>"); - window.setTimeout(function() { self.loadMoreIfNeeded(); }, 10); - } + if (data.more === true && checkFormatter(opts.formatLoadMore, "formatLoadMore")) { + results.append("<li class='select2-more-results'>" + opts.escapeMarkup(evaluate(opts.formatLoadMore, opts.element, this.resultsPage)) + "</li>"); + window.setTimeout(function() { self.loadMoreIfNeeded(); }, 10); + } - this.postprocessResults(data, initial); + this.postprocessResults(data, initial); - postRender(); - })}); + postRender(); + + this.opts.element.trigger({ type: "select2-loaded", items: data }); + })}); }, // abstract @@ -1305,50 +1838,64 @@ the specific language governing permissions and limitations under the Apache Lic // abstract blur: function () { + // if selectOnBlur == true, select the currently highlighted option + if (this.opts.selectOnBlur) + this.selectHighlighted({noFocus: true}); + this.close(); this.container.removeClass("select2-container-active"); - this.dropdown.removeClass("select2-drop-active"); // synonymous to .is(':focus'), which is available in jquery >= 1.6 if (this.search[0] === document.activeElement) { this.search.blur(); } this.clearSearch(); this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus"); - this.opts.element.triggerHandler("blur"); }, // abstract focusSearch: function () { - // need to do it here as well as in timeout so it works in IE - this.search.show(); - this.search.focus(); - - /* we do this in a timeout so that current event processing can complete before this code is executed. - this makes sure the search field is focussed even if the current event would blur it */ - window.setTimeout(this.bind(function () { - // reset the value so IE places the cursor at the end of the input box - this.search.show(); - this.search.focus(); - this.search.val(this.search.val()); - }), 10); + focus(this.search); }, // abstract - selectHighlighted: function () { + selectHighlighted: function (options) { + if (this._touchMoved) { + this.clearTouchMoved(); + return; + } var index=this.highlight(), - highlighted=this.results.find(".select2-highlighted").not(".select2-disabled"), - data = highlighted.closest('.select2-result-selectable').data("select2-data"); + highlighted=this.results.find(".select2-highlighted"), + data = highlighted.closest('.select2-result').data("select2-data"); + if (data) { - highlighted.addClass("select2-disabled"); this.highlight(index); - this.onSelect(data); + this.onSelect(data, options); + } else if (options && options.noFocus) { + this.close(); } }, // abstract getPlaceholder: function () { + var placeholderOption; return this.opts.element.attr("placeholder") || - this.opts.element.attr("data-placeholder") || // jquery 1.4 compat - this.opts.element.data("placeholder") || - this.opts.placeholder; + this.opts.element.attr("data-placeholder") || // jquery 1.4 compat + this.opts.element.data("placeholder") || + this.opts.placeholder || + ((placeholderOption = this.getPlaceholderOption()) !== undefined ? placeholderOption.text() : undefined); + }, + + // abstract + getPlaceholderOption: function() { + if (this.select) { + var firstOption = this.select.children('option').first(); + if (this.opts.placeholderOption !== undefined ) { + //Determine the placeholder option based on the specified placeholderOption setting + return (this.opts.placeholderOption === "first" && firstOption) || + (typeof this.opts.placeholderOption === "function" && this.opts.placeholderOption(this.select)); + } else if ($.trim(firstOption.text()) === "" && firstOption.val() === "") { + //No explicit placeholder option specified, use the first if it's blank + return firstOption; + } + } }, /** @@ -1360,7 +1907,7 @@ the specific language governing permissions and limitations under the Apache Lic // abstract initContainerWidth: function () { function resolveContainerWidth() { - var style, attrs, matches, i, l; + var style, attrs, matches, i, l, attr; if (this.opts.width === "off") { return null; @@ -1372,8 +1919,8 @@ the specific language governing permissions and limitations under the Apache Lic if (style !== undefined) { attrs = style.split(';'); for (i = 0, l = attrs.length; i < l; i = i + 1) { - matches = attrs[i].replace(/\s/g, '') - .match(/width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/); + attr = attrs[i].replace(/\s/g, ''); + matches = attr.match(/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i); if (matches !== null && matches.length >= 1) return matches[1]; } @@ -1394,12 +1941,12 @@ the specific language governing permissions and limitations under the Apache Lic return this.opts.width(); } else { return this.opts.width; - } + } }; var width = resolveContainerWidth.call(this); if (width !== null) { - this.container.attr("style", "width: "+width); + this.container.css("width", width); } } }); @@ -1408,53 +1955,129 @@ the specific language governing permissions and limitations under the Apache Lic // single - createContainer: function () { - var container = $("<div></div>", { + createContainer: function () { + var container = $(document.createElement("div")).attr({ "class": "select2-container" }).html([ - " <a href='javascript:void(0)' onclick='return false;' class='select2-choice'>", - " <span></span><abbr class='select2-search-choice-close' style='display:none;'></abbr>", - " <div><b></b></div>" , + "<a href='javascript:void(0)' class='select2-choice' tabindex='-1'>", + " <span class='select2-chosen'> </span><abbr class='select2-search-choice-close'></abbr>", + " <span class='select2-arrow' role='presentation'><b role='presentation'></b></span>", "</a>", - " <div class='select2-drop select2-offscreen'>" , - " <div class='select2-search'>" , - " <input type='text' autocomplete='off' class='select2-input'/>" , - " </div>" , - " <ul class='select2-results'>" , - " </ul>" , + "<label for='' class='select2-offscreen'></label>", + "<input class='select2-focusser select2-offscreen' type='text' aria-haspopup='true' role='button' />", + "<div class='select2-drop select2-display-none'>", + " <div class='select2-search'>", + " <label for='' class='select2-offscreen'></label>", + " <input type='text' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' class='select2-input' role='combobox' aria-expanded='true'", + " aria-autocomplete='list' />", + " </div>", + " <ul class='select2-results' role='listbox'>", + " </ul>", "</div>"].join("")); return container; }, + // single + enableInterface: function() { + if (this.parent.enableInterface.apply(this, arguments)) { + this.focusser.prop("disabled", !this.isInterfaceEnabled()); + } + }, + // single opening: function () { - this.search.show(); + var el, range, len; + + if (this.opts.minimumResultsForSearch >= 0) { + this.showSearch(true); + } + this.parent.opening.apply(this, arguments); - this.dropdown.removeClass("select2-offscreen"); + + if (this.showSearchInput !== false) { + // IE appends focusser.val() at the end of field :/ so we manually insert it at the beginning using a range + // all other browsers handle this just fine + + this.search.val(this.focusser.val()); + } + if (this.opts.shouldFocusInput(this)) { + this.search.focus(); + // move the cursor to the end after focussing, otherwise it will be at the beginning and + // new text will appear *before* focusser.val() + el = this.search.get(0); + if (el.createTextRange) { + range = el.createTextRange(); + range.collapse(false); + range.select(); + } else if (el.setSelectionRange) { + len = this.search.val().length; + el.setSelectionRange(len, len); + } + } + + // initializes search's value with nextSearchTerm (if defined by user) + // ignore nextSearchTerm if the dropdown is opened by the user pressing a letter + if(this.search.val() === "") { + if(this.nextSearchTerm != undefined){ + this.search.val(this.nextSearchTerm); + this.search.select(); + } + } + + this.focusser.prop("disabled", true).val(""); + this.updateResults(true); + this.opts.element.trigger($.Event("select2-open")); }, // single close: function () { if (!this.opened()) return; this.parent.close.apply(this, arguments); - this.dropdown.removeAttr("style").addClass("select2-offscreen").insertAfter(this.selection).show(); + + this.focusser.prop("disabled", false); + + if (this.opts.shouldFocusInput(this)) { + this.focusser.focus(); + } }, // single focus: function () { - this.close(); - this.selection.focus(); + if (this.opened()) { + this.close(); + } else { + this.focusser.prop("disabled", false); + if (this.opts.shouldFocusInput(this)) { + this.focusser.focus(); + } + } }, // single isFocused: function () { - return this.selection[0] === document.activeElement; + return this.container.hasClass("select2-container-active"); }, // single cancel: function () { this.parent.cancel.apply(this, arguments); - this.selection.focus(); + this.focusser.prop("disabled", false); + + if (this.opts.shouldFocusInput(this)) { + this.focusser.focus(); + } + }, + + // single + destroy: function() { + $("label[for='" + this.focusser.attr('id') + "']") + .attr('for', this.opts.element.attr("id")); + this.parent.destroy.apply(this, arguments); + + cleanupJQueryElements.call(this, + "selection", + "focusser" + ); }, // single @@ -1463,12 +2086,53 @@ the specific language governing permissions and limitations under the Apache Lic var selection, container = this.container, dropdown = this.dropdown, - clickingInside = false; + idSuffix = nextUid(), + elementLabel; + + if (this.opts.minimumResultsForSearch < 0) { + this.showSearch(false); + } else { + this.showSearch(true); + } this.selection = selection = container.find(".select2-choice"); - this.search.bind("keydown", this.bind(function (e) { - if (!this.enabled) return; + this.focusser = container.find(".select2-focusser"); + + // add aria associations + selection.find(".select2-chosen").attr("id", "select2-chosen-"+idSuffix); + this.focusser.attr("aria-labelledby", "select2-chosen-"+idSuffix); + this.results.attr("id", "select2-results-"+idSuffix); + this.search.attr("aria-owns", "select2-results-"+idSuffix); + + // rewrite labels from original element to focusser + this.focusser.attr("id", "s2id_autogen"+idSuffix); + + elementLabel = $("label[for='" + this.opts.element.attr("id") + "']"); + this.opts.element.focus(this.bind(function () { this.focus(); })); + + this.focusser.prev() + .text(elementLabel.text()) + .attr('for', this.focusser.attr('id')); + + // Ensure the original element retains an accessible name + var originalTitle = this.opts.element.attr("title"); + this.opts.element.attr("title", (originalTitle || elementLabel.text())); + + this.focusser.attr("tabindex", this.elementTabIndex); + + // write label for search field using the label from the focusser element + this.search.attr("id", this.focusser.attr('id') + '_search'); + + this.search.prev() + .text($("label[for='" + this.focusser.attr('id') + "']").text()) + .attr('for', this.search.attr('id')); + + this.search.on("keydown", this.bind(function (e) { + if (!this.isInterfaceEnabled()) return; + + // filter 229 keyCodes (input method editor is processing key input) + if (229 == e.keyCode) return; if (e.which === KEY.PAGE_UP || e.which === KEY.PAGE_DOWN) { // prevent the page from scrolling @@ -1476,132 +2140,164 @@ the specific language governing permissions and limitations under the Apache Lic return; } - if (this.opened()) { - switch (e.which) { - case KEY.UP: - case KEY.DOWN: - this.moveHighlight((e.which === KEY.UP) ? -1 : 1); - killEvent(e); - return; - case KEY.TAB: - case KEY.ENTER: - this.selectHighlighted(); - killEvent(e); - return; - case KEY.ESC: - this.cancel(e); - killEvent(e); - return; - } - } else { - - if (e.which === KEY.TAB || KEY.isControl(e) || KEY.isFunctionKey(e) || e.which === KEY.ESC) { + switch (e.which) { + case KEY.UP: + case KEY.DOWN: + this.moveHighlight((e.which === KEY.UP) ? -1 : 1); + killEvent(e); return; - } - - if (this.opts.openOnEnter === false && e.which === KEY.ENTER) { + case KEY.ENTER: + this.selectHighlighted(); + killEvent(e); return; - } + case KEY.TAB: + this.selectHighlighted({noFocus: true}); + return; + case KEY.ESC: + this.cancel(e); + killEvent(e); + return; + } + })); + + this.search.on("blur", this.bind(function(e) { + // a workaround for chrome to keep the search field focussed when the scroll bar is used to scroll the dropdown. + // without this the search field loses focus which is annoying + if (document.activeElement === this.body.get(0)) { + window.setTimeout(this.bind(function() { + if (this.opened()) { + this.search.focus(); + } + }), 0); + } + })); + + this.focusser.on("keydown", this.bind(function (e) { + if (!this.isInterfaceEnabled()) return; + + if (e.which === KEY.TAB || KEY.isControl(e) || KEY.isFunctionKey(e) || e.which === KEY.ESC) { + return; + } + + if (this.opts.openOnEnter === false && e.which === KEY.ENTER) { + killEvent(e); + return; + } + + if (e.which == KEY.DOWN || e.which == KEY.UP + || (e.which == KEY.ENTER && this.opts.openOnEnter)) { + + if (e.altKey || e.ctrlKey || e.shiftKey || e.metaKey) return; this.open(); + killEvent(e); + return; + } - if (e.which === KEY.ENTER) { - // do not propagate the event otherwise we open, and propagate enter which closes - return; + if (e.which == KEY.DELETE || e.which == KEY.BACKSPACE) { + if (this.opts.allowClear) { + this.clear(); } + killEvent(e); + return; } })); - this.search.bind("focus", this.bind(function() { - this.selection.attr("tabIndex", "-1"); - })); - this.search.bind("blur", this.bind(function() { - if (!this.opened()) this.container.removeClass("select2-container-active"); - window.setTimeout(this.bind(function() { - // restore original tab index - var ti=this.opts.element.attr("tabIndex"); - if (ti) { - this.selection.attr("tabIndex", ti); - } else { - this.selection.removeAttr("tabIndex"); - } - }), 10); + + installKeyUpChangeEvent(this.focusser); + this.focusser.on("keyup-change input", this.bind(function(e) { + if (this.opts.minimumResultsForSearch >= 0) { + e.stopPropagation(); + if (this.opened()) return; + this.open(); + } })); - selection.delegate("abbr", "mousedown", this.bind(function (e) { - if (!this.enabled) return; + selection.on("mousedown touchstart", "abbr", this.bind(function (e) { + if (!this.isInterfaceEnabled()) { + return; + } + this.clear(); killEventImmediately(e); this.close(); - this.triggerChange(); - this.selection.focus(); + + if (this.selection) { + this.selection.focus(); + } })); - selection.bind("mousedown", this.bind(function (e) { - clickingInside = true; + selection.on("mousedown touchstart", this.bind(function (e) { + // Prevent IE from generating a click event on the body + reinsertElement(selection); + + if (!this.container.hasClass("select2-container-active")) { + this.opts.element.trigger($.Event("select2-focus")); + } if (this.opened()) { this.close(); - this.selection.focus(); - } else if (this.enabled) { + } else if (this.isInterfaceEnabled()) { this.open(); } - clickingInside = false; + killEvent(e); })); - dropdown.bind("mousedown", this.bind(function() { this.search.focus(); })); + dropdown.on("mousedown touchstart", this.bind(function() { + if (this.opts.shouldFocusInput(this)) { + this.search.focus(); + } + })); - selection.bind("focus", this.bind(function() { - this.container.addClass("select2-container-active"); - // hide the search so the tab key does not focus on it - this.search.attr("tabIndex", "-1"); + selection.on("focus", this.bind(function(e) { + killEvent(e); })); - selection.bind("blur", this.bind(function() { + this.focusser.on("focus", this.bind(function(){ + if (!this.container.hasClass("select2-container-active")) { + this.opts.element.trigger($.Event("select2-focus")); + } + this.container.addClass("select2-container-active"); + })).on("blur", this.bind(function() { if (!this.opened()) { this.container.removeClass("select2-container-active"); + this.opts.element.trigger($.Event("select2-blur")); } - window.setTimeout(this.bind(function() { this.search.attr("tabIndex", this.opts.element.attr("tabIndex")); }), 10); })); - - selection.bind("keydown", this.bind(function(e) { - if (!this.enabled) return; - - if (e.which == KEY.DOWN || e.which == KEY.UP - || (e.which == KEY.ENTER && this.opts.openOnEnter)) { - this.open(); - killEvent(e); - return; + this.search.on("focus", this.bind(function(){ + if (!this.container.hasClass("select2-container-active")) { + this.opts.element.trigger($.Event("select2-focus")); } - - if (e.which == KEY.DELETE || e.which == KEY.BACKSPACE) { - if (this.opts.allowClear) { - this.clear(); - } - killEvent(e); - return; - } - })); - selection.bind("keypress", this.bind(function(e) { - var key = String.fromCharCode(e.which); - this.search.val(key); - this.open(); + this.container.addClass("select2-container-active"); })); + this.initContainerWidth(); + this.opts.element.hide(); this.setPlaceholder(); - this.search.bind("focus", this.bind(function() { - this.container.addClass("select2-container-active"); - })); }, // single - clear: function() { - this.opts.element.val(""); - this.selection.find("span").empty(); - this.selection.removeData("select2-data"); - this.setPlaceholder(); + clear: function(triggerChange) { + var data=this.selection.data("select2-data"); + if (data) { // guard against queued quick consecutive clicks + var evt = $.Event("select2-clearing"); + this.opts.element.trigger(evt); + if (evt.isDefaultPrevented()) { + return; + } + var placeholderOption = this.getPlaceholderOption(); + this.opts.element.val(placeholderOption ? placeholderOption.val() : ""); + this.selection.find(".select2-chosen").empty(); + this.selection.removeData("select2-data"); + this.setPlaceholder(); + + if (triggerChange !== false){ + this.opts.element.trigger({ type: "select2-removed", val: this.id(data), choice: data }); + this.triggerChange({removed:data}); + } + } }, /** @@ -1610,7 +2306,8 @@ the specific language governing permissions and limitations under the Apache Lic // single initSelection: function () { var selected; - if (this.opts.element.val() === "" && this.opts.element.text() === "") { + if (this.isPlaceholderOptionSelected()) { + this.updateSelection(null); this.close(); this.setPlaceholder(); } else { @@ -1620,52 +2317,93 @@ the specific language governing permissions and limitations under the Apache Lic self.updateSelection(selected); self.close(); self.setPlaceholder(); + self.nextSearchTerm = self.opts.nextSearchTerm(selected, self.search.val()); } }); } }, + isPlaceholderOptionSelected: function() { + var placeholderOption; + if (this.getPlaceholder() === undefined) return false; // no placeholder specified so no option should be considered + return ((placeholderOption = this.getPlaceholderOption()) !== undefined && placeholderOption.prop("selected")) + || (this.opts.element.val() === "") + || (this.opts.element.val() === undefined) + || (this.opts.element.val() === null); + }, + // single prepareOpts: function () { - var opts = this.parent.prepareOpts.apply(this, arguments); + var opts = this.parent.prepareOpts.apply(this, arguments), + self=this; if (opts.element.get(0).tagName.toLowerCase() === "select") { // install the selection initializer opts.initSelection = function (element, callback) { - var selected = element.find("option[selected]"); + var selected = element.find("option").filter(function() { return this.selected && !this.disabled }); // a single select box always has a value, no need to null check 'selected' - if ($.isFunction(callback)) - callback({id: selected.attr("value"), text: selected.text(), element:selected}); + callback(self.optionToData(selected)); + }; + } else if ("data" in opts) { + // install default initSelection when applied to hidden input and data is local + opts.initSelection = opts.initSelection || function (element, callback) { + var id = element.val(); + //search in data by id, storing the actual matching item + var match = null; + opts.query({ + matcher: function(term, text, el){ + var is_match = equal(id, opts.id(el)); + if (is_match) { + match = el; + } + return is_match; + }, + callback: !$.isFunction(callback) ? $.noop : function() { + callback(match); + } + }); }; } return opts; }, + // single + getPlaceholder: function() { + // if a placeholder is specified on a single select without a valid placeholder option ignore it + if (this.select) { + if (this.getPlaceholderOption() === undefined) { + return undefined; + } + } + + return this.parent.getPlaceholder.apply(this, arguments); + }, + // single setPlaceholder: function () { var placeholder = this.getPlaceholder(); - if (this.opts.element.val() === "" && placeholder !== undefined) { + if (this.isPlaceholderOptionSelected() && placeholder !== undefined) { - // check for a first blank option if attached to a select - if (this.select && this.select.find("option:first").text() !== "") return; + // check for a placeholder option if attached to a select + if (this.select && this.getPlaceholderOption() === undefined) return; - this.selection.find("span").html(this.opts.escapeMarkup(placeholder)); + this.selection.find(".select2-chosen").html(this.opts.escapeMarkup(placeholder)); this.selection.addClass("select2-default"); - this.selection.find("abbr").hide(); + this.container.removeClass("select2-allowclear"); } }, // single - postprocessResults: function (data, initial) { + postprocessResults: function (data, initial, noHighlightUpdate) { var selected = 0, self = this, showSearchInput = true; // find the selected element in the result list - this.results.find(".select2-result-selectable").each2(function (i, elm) { + this.findHighlightableChoices().each2(function (i, elm) { if (equal(self.id(elm.data("select2-data")), self.opts.element.val())) { selected = i; return false; @@ -1673,56 +2411,94 @@ the specific language governing permissions and limitations under the Apache Lic }); // and highlight it + if (noHighlightUpdate !== false) { + if (initial === true && selected >= 0) { + this.highlight(selected); + } else { + this.highlight(0); + } + } - this.highlight(selected); - - // hide the search box if this is the first we got the results and there are a few of them + // hide the search box if this is the first we got the results and there are enough of them for search if (initial === true) { - showSearchInput = this.showSearchInput = countResults(data.results) >= this.opts.minimumResultsForSearch; - this.dropdown.find(".select2-search")[showSearchInput ? "removeClass" : "addClass"]("select2-search-hidden"); - - //add "select2-with-searchbox" to the container if search box is shown - $(this.dropdown, this.container)[showSearchInput ? "addClass" : "removeClass"]("select2-with-searchbox"); + var min = this.opts.minimumResultsForSearch; + if (min >= 0) { + this.showSearch(countResults(data.results) >= min); + } } + }, + // single + showSearch: function(showSearchInput) { + if (this.showSearchInput === showSearchInput) return; + + this.showSearchInput = showSearchInput; + + this.dropdown.find(".select2-search").toggleClass("select2-search-hidden", !showSearchInput); + this.dropdown.find(".select2-search").toggleClass("select2-offscreen", !showSearchInput); + //add "select2-with-searchbox" to the container if search box is shown + $(this.dropdown, this.container).toggleClass("select2-with-searchbox", showSearchInput); }, // single - onSelect: function (data) { - var old = this.opts.element.val(); + onSelect: function (data, options) { + + if (!this.triggerSelect(data)) { return; } + + var old = this.opts.element.val(), + oldData = this.data(); this.opts.element.val(this.id(data)); this.updateSelection(data); + + this.opts.element.trigger({ type: "select2-selected", val: this.id(data), choice: data }); + + this.nextSearchTerm = this.opts.nextSearchTerm(data, this.search.val()); this.close(); - this.selection.focus(); - if (!equal(old, this.id(data))) { this.triggerChange(); } + if ((!options || !options.noFocus) && this.opts.shouldFocusInput(this)) { + this.focusser.focus(); + } + + if (!equal(old, this.id(data))) { + this.triggerChange({ added: data, removed: oldData }); + } }, // single updateSelection: function (data) { - var container=this.selection.find("span"), formatted; + var container=this.selection.find(".select2-chosen"), formatted, cssClass; this.selection.data("select2-data", data); container.empty(); - formatted=this.opts.formatSelection(data, container); + if (data !== null) { + formatted=this.opts.formatSelection(data, container, this.opts.escapeMarkup); + } if (formatted !== undefined) { - container.append(this.opts.escapeMarkup(formatted)); + container.append(formatted); + } + cssClass=this.opts.formatSelectionCssClass(data, container); + if (cssClass !== undefined) { + container.addClass(cssClass); } this.selection.removeClass("select2-default"); if (this.opts.allowClear && this.getPlaceholder() !== undefined) { - this.selection.find("abbr").show(); + this.container.addClass("select2-allowclear"); } }, // single val: function () { - var val, data = null, self = this; + var val, + triggerChange = false, + data = null, + self = this, + oldData = this.data(); if (arguments.length === 0) { return this.opts.element.val(); @@ -1730,29 +2506,39 @@ the specific language governing permissions and limitations under the Apache Lic val = arguments[0]; + if (arguments.length > 1) { + triggerChange = arguments[1]; + } + if (this.select) { this.select .val(val) - .find("option[selected]").each2(function (i, elm) { - data = {id: elm.attr("value"), text: elm.text()}; + .find("option").filter(function() { return this.selected }).each2(function (i, elm) { + data = self.optionToData(elm); return false; }); this.updateSelection(data); this.setPlaceholder(); + if (triggerChange) { + this.triggerChange({added: data, removed:oldData}); + } } else { + // val is an id. !val is true for [undefined,null,'',0] - 0 is legal + if (!val && val !== 0) { + this.clear(triggerChange); + return; + } if (this.opts.initSelection === undefined) { throw new Error("cannot call val() if initSelection() is not defined"); } - // val is an id. !val is true for [undefined,null,''] - if (!val) { - this.clear(); - return; - } this.opts.element.val(val); this.opts.initSelection(this.opts.element, function(data){ self.opts.element.val(!data ? "" : self.id(data)); self.updateSelection(data); self.setPlaceholder(); + if (triggerChange) { + self.triggerChange({added: data, removed:oldData}); + } }); } }, @@ -1760,22 +2546,31 @@ the specific language governing permissions and limitations under the Apache Lic // single clearSearch: function () { this.search.val(""); + this.focusser.val(""); }, // single data: function(value) { - var data; + var data, + triggerChange = false; if (arguments.length === 0) { data = this.selection.data("select2-data"); if (data == undefined) data = null; return data; } else { - if (!value || value === "") { - this.clear(); + if (arguments.length > 1) { + triggerChange = arguments[1]; + } + if (!value) { + this.clear(triggerChange); } else { + data = this.data(); this.opts.element.val(!value ? "" : this.id(value)); this.updateSelection(value); + if (triggerChange) { + this.triggerChange({added: value, removed:data}); + } } } } @@ -1785,45 +2580,110 @@ the specific language governing permissions and limitations under the Apache Lic // multi createContainer: function () { - var container = $("<div></div>", { + var container = $(document.createElement("div")).attr({ "class": "select2-container select2-container-multi" }).html([ - " <ul class='select2-choices'>", - //"<li class='select2-search-choice'><span>California</span><a href="javascript:void(0)" class="select2-search-choice-close"></a></li>" , - " <li class='select2-search-field'>" , - " <input type='text' autocomplete='off' class='select2-input'>" , - " </li>" , - "</ul>" , - "<div class='select2-drop select2-drop-multi' style='display:none;'>" , - " <ul class='select2-results'>" , - " </ul>" , + "<ul class='select2-choices'>", + " <li class='select2-search-field'>", + " <label for='' class='select2-offscreen'></label>", + " <input type='text' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' class='select2-input'>", + " </li>", + "</ul>", + "<div class='select2-drop select2-drop-multi select2-display-none'>", + " <ul class='select2-results'>", + " </ul>", "</div>"].join("")); - return container; + return container; }, // multi prepareOpts: function () { - var opts = this.parent.prepareOpts.apply(this, arguments); + var opts = this.parent.prepareOpts.apply(this, arguments), + self=this; // TODO validate placeholder is a string if specified - if (opts.element.get(0).tagName.toLowerCase() === "select") { - // install sthe selection initializer - opts.initSelection = function (element,callback) { + // install the selection initializer + opts.initSelection = function (element, callback) { var data = []; - element.find("option[selected]").each2(function (i, elm) { - data.push({id: elm.attr("value"), text: elm.text(), element: elm}); - }); - if ($.isFunction(callback)) - callback(data); + element.find("option").filter(function() { return this.selected && !this.disabled }).each2(function (i, elm) { + data.push(self.optionToData(elm)); + }); + callback(data); + }; + } else if ("data" in opts) { + // install default initSelection when applied to hidden input and data is local + opts.initSelection = opts.initSelection || function (element, callback) { + var ids = splitVal(element.val(), opts.separator, opts.transformVal); + //search in data by array of ids, storing matching items in a list + var matches = []; + opts.query({ + matcher: function(term, text, el){ + var is_match = $.grep(ids, function(id) { + return equal(id, opts.id(el)); + }).length; + if (is_match) { + matches.push(el); + } + return is_match; + }, + callback: !$.isFunction(callback) ? $.noop : function() { + // reorder matches based on the order they appear in the ids array because right now + // they are in the order in which they appear in data array + var ordered = []; + for (var i = 0; i < ids.length; i++) { + var id = ids[i]; + for (var j = 0; j < matches.length; j++) { + var match = matches[j]; + if (equal(id, opts.id(match))) { + ordered.push(match); + matches.splice(j, 1); + break; + } + } + } + callback(ordered); + } + }); }; } return opts; }, + // multi + selectChoice: function (choice) { + + var selected = this.container.find(".select2-search-choice-focus"); + if (selected.length && choice && choice[0] == selected[0]) { + + } else { + if (selected.length) { + this.opts.element.trigger("choice-deselected", selected); + } + selected.removeClass("select2-search-choice-focus"); + if (choice && choice.length) { + this.close(); + choice.addClass("select2-search-choice-focus"); + this.opts.element.trigger("choice-selected", choice); + } + } + }, + + // multi + destroy: function() { + $("label[for='" + this.search.attr('id') + "']") + .attr('for', this.opts.element.attr("id")); + this.parent.destroy.apply(this, arguments); + + cleanupJQueryElements.call(this, + "searchContainer", + "selection" + ); + }, + // multi initContainer: function () { @@ -1832,55 +2692,112 @@ the specific language governing permissions and limitations under the Apache Lic this.searchContainer = this.container.find(".select2-search-field"); this.selection = selection = this.container.find(selector); - this.search.bind("keydown", this.bind(function (e) { - if (!this.enabled) return; + var _this = this; + this.selection.on("click", ".select2-container:not(.select2-container-disabled) .select2-search-choice:not(.select2-locked)", function (e) { + _this.search[0].focus(); + _this.selectChoice($(this)); + }); - if (e.which === KEY.BACKSPACE && this.search.val() === "") { - this.close(); + // rewrite labels from original element to focusser + this.search.attr("id", "s2id_autogen"+nextUid()); - var choices, - selected = selection.find(".select2-search-choice-focus"); - if (selected.length > 0) { - this.unselect(selected.first()); - this.search.width(10); - killEvent(e); - return; + this.search.prev() + .text($("label[for='" + this.opts.element.attr("id") + "']").text()) + .attr('for', this.search.attr('id')); + this.opts.element.focus(this.bind(function () { this.focus(); })); + + this.search.on("input paste", this.bind(function() { + if (this.search.attr('placeholder') && this.search.val().length == 0) return; + if (!this.isInterfaceEnabled()) return; + if (!this.opened()) { + this.open(); + } + })); + + this.search.attr("tabindex", this.elementTabIndex); + + this.keydowns = 0; + this.search.on("keydown", this.bind(function (e) { + if (!this.isInterfaceEnabled()) return; + + ++this.keydowns; + var selected = selection.find(".select2-search-choice-focus"); + var prev = selected.prev(".select2-search-choice:not(.select2-locked)"); + var next = selected.next(".select2-search-choice:not(.select2-locked)"); + var pos = getCursorInfo(this.search); + + if (selected.length && + (e.which == KEY.LEFT || e.which == KEY.RIGHT || e.which == KEY.BACKSPACE || e.which == KEY.DELETE || e.which == KEY.ENTER)) { + var selectedChoice = selected; + if (e.which == KEY.LEFT && prev.length) { + selectedChoice = prev; + } + else if (e.which == KEY.RIGHT) { + selectedChoice = next.length ? next : null; + } + else if (e.which === KEY.BACKSPACE) { + if (this.unselect(selected.first())) { + this.search.width(10); + selectedChoice = prev.length ? prev : next; + } + } else if (e.which == KEY.DELETE) { + if (this.unselect(selected.first())) { + this.search.width(10); + selectedChoice = next.length ? next : null; + } + } else if (e.which == KEY.ENTER) { + selectedChoice = null; } - choices = selection.find(".select2-search-choice:not(.select2-locked)"); - if (choices.length > 0) { - choices.last().addClass("select2-search-choice-focus"); + this.selectChoice(selectedChoice); + killEvent(e); + if (!selectedChoice || !selectedChoice.length) { + this.open(); } + return; + } else if (((e.which === KEY.BACKSPACE && this.keydowns == 1) + || e.which == KEY.LEFT) && (pos.offset == 0 && !pos.length)) { + + this.selectChoice(selection.find(".select2-search-choice:not(.select2-locked)").last()); + killEvent(e); + return; } else { - selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus"); + this.selectChoice(null); } if (this.opened()) { switch (e.which) { - case KEY.UP: - case KEY.DOWN: - this.moveHighlight((e.which === KEY.UP) ? -1 : 1); - killEvent(e); - return; - case KEY.ENTER: - case KEY.TAB: - this.selectHighlighted(); - killEvent(e); - return; - case KEY.ESC: - this.cancel(e); - killEvent(e); - return; + case KEY.UP: + case KEY.DOWN: + this.moveHighlight((e.which === KEY.UP) ? -1 : 1); + killEvent(e); + return; + case KEY.ENTER: + this.selectHighlighted(); + killEvent(e); + return; + case KEY.TAB: + this.selectHighlighted({noFocus:true}); + this.close(); + return; + case KEY.ESC: + this.cancel(e); + killEvent(e); + return; } } if (e.which === KEY.TAB || KEY.isControl(e) || KEY.isFunctionKey(e) - || e.which === KEY.BACKSPACE || e.which === KEY.ESC) { + || e.which === KEY.BACKSPACE || e.which === KEY.ESC) { return; } - if (this.opts.openOnEnter === false && e.which === KEY.ENTER) { - return; + if (e.which === KEY.ENTER) { + if (this.opts.openOnEnter === false) { + return; + } else if (e.altKey || e.ctrlKey || e.shiftKey || e.metaKey) { + return; + } } this.open(); @@ -1889,56 +2806,67 @@ the specific language governing permissions and limitations under the Apache Lic // prevent the page from scrolling killEvent(e); } + + if (e.which === KEY.ENTER) { + // prevent form from being submitted + killEvent(e); + } + })); - this.search.bind("keyup", this.bind(this.resizeSearch)); + this.search.on("keyup", this.bind(function (e) { + this.keydowns = 0; + this.resizeSearch(); + }) + ); - this.search.bind("blur", this.bind(function(e) { + this.search.on("blur", this.bind(function(e) { this.container.removeClass("select2-container-active"); this.search.removeClass("select2-focused"); - this.clearSearch(); + this.selectChoice(null); + if (!this.opened()) this.clearSearch(); e.stopImmediatePropagation(); + this.opts.element.trigger($.Event("select2-blur")); })); - this.container.delegate(selector, "mousedown", this.bind(function (e) { - if (!this.enabled) return; + this.container.on("click", selector, this.bind(function (e) { + if (!this.isInterfaceEnabled()) return; if ($(e.target).closest(".select2-search-choice").length > 0) { // clicked inside a select2 search choice, do not open return; } + this.selectChoice(null); this.clearPlaceholder(); + if (!this.container.hasClass("select2-container-active")) { + this.opts.element.trigger($.Event("select2-focus")); + } this.open(); this.focusSearch(); e.preventDefault(); })); - this.container.delegate(selector, "focus", this.bind(function () { - if (!this.enabled) return; + this.container.on("focus", selector, this.bind(function () { + if (!this.isInterfaceEnabled()) return; + if (!this.container.hasClass("select2-container-active")) { + this.opts.element.trigger($.Event("select2-focus")); + } this.container.addClass("select2-container-active"); this.dropdown.addClass("select2-drop-active"); this.clearPlaceholder(); })); + this.initContainerWidth(); + this.opts.element.hide(); + // set the placeholder if necessary this.clearSearch(); }, // multi - enable: function() { - if (this.enabled) return; - - this.parent.enable.apply(this, arguments); - - this.search.removeAttr("disabled"); - }, - - // multi - disable: function() { - if (!this.enabled) return; - - this.parent.disable.apply(this, arguments); - - this.search.attr("disabled", true); + enableInterface: function() { + if (this.parent.enableInterface.apply(this, arguments)) { + this.search.prop("disabled", !this.isInterfaceEnabled()); + } }, // multi @@ -1965,16 +2893,16 @@ the specific language governing permissions and limitations under the Apache Lic // multi clearSearch: function () { - var placeholder = this.getPlaceholder(); + var placeholder = this.getPlaceholder(), + maxWidth = this.getMaxSearchWidth(); if (placeholder !== undefined && this.getVal().length === 0 && this.search.hasClass("select2-focused") === false) { this.search.val(placeholder).addClass("select2-default"); // stretch the search box to full width of the container so as much of the placeholder is visible as possible - this.resizeSearch(); + // we could call this.resizeSearch(), but we do not because that requires a sizer and we do not want to create one so early because of a firefox bug, see #944 + this.search.width(maxWidth > 0 ? maxWidth : this.container.css("width")); } else { - // we set this to " " instead of "" and later clear it on focus() because there is a firefox bug - // that does not properly render the caret when the field starts out blank - this.search.val(" ").width(10); + this.search.val("").width(10); } }, @@ -1982,19 +2910,32 @@ the specific language governing permissions and limitations under the Apache Lic clearPlaceholder: function () { if (this.search.hasClass("select2-default")) { this.search.val("").removeClass("select2-default"); - } else { - // work around for the space character we set to avoid firefox caret bug - if (this.search.val() === " ") this.search.val(""); } }, // multi opening: function () { + this.clearPlaceholder(); // should be done before super so placeholder is not used to search + this.resizeSearch(); + this.parent.opening.apply(this, arguments); - this.clearPlaceholder(); - this.resizeSearch(); this.focusSearch(); + + // initializes search's value with nextSearchTerm (if defined by user) + // ignore nextSearchTerm if the dropdown is opened by the user pressing a letter + if(this.search.val() === "") { + if(this.nextSearchTerm != undefined){ + this.search.val(this.nextSearchTerm); + this.search.select(); + } + } + + this.updateResults(true); + if (this.opts.shouldFocusInput(this)) { + this.search.focus(); + } + this.opts.element.trigger($.Event("select2-open")); }, // multi @@ -2034,9 +2975,10 @@ the specific language governing permissions and limitations under the Apache Lic self.postprocessResults(); }, + // multi tokenize: function() { var input = this.search.val(); - input = this.opts.tokenizer(input, this.data(), this.bind(this.onSelect), this.opts); + input = this.opts.tokenizer.call(this, input, this.data(), this.bind(this.onSelect), this.opts); if (input != null && input != undefined) { this.search.val(input); if (input.length > 0) { @@ -2047,9 +2989,21 @@ the specific language governing permissions and limitations under the Apache Lic }, // multi - onSelect: function (data) { + onSelect: function (data, options) { + + if (!this.triggerSelect(data) || data.text === "") { return; } + this.addSelectedChoice(data); - if (this.select || !this.opts.closeOnSelect) this.postprocessResults(); + + this.opts.element.trigger({ type: "selected", val: this.id(data), choice: data }); + + // keep track of the search's value before it gets cleared + this.nextSearchTerm = this.opts.nextSearchTerm(data, this.search.val()); + + this.clearSearch(); + this.updateResults(); + + if (this.select || !this.opts.closeOnSelect) this.postprocessResults(data, false, this.opts.closeOnSelect===true); if (this.opts.closeOnSelect) { this.close(); @@ -2058,10 +3012,23 @@ the specific language governing permissions and limitations under the Apache Lic if (this.countSelectableResults()>0) { this.search.width(10); this.resizeSearch(); + if (this.getMaximumSelectionSize() > 0 && this.val().length >= this.getMaximumSelectionSize()) { + // if we reached max selection size repaint the results so choices + // are replaced with the max selection reached message + this.updateResults(true); + } else { + // initializes search's value with nextSearchTerm and update search result + if(this.nextSearchTerm != undefined){ + this.search.val(this.nextSearchTerm); + this.updateResults(); + this.search.select(); + } + } this.positionDropdown(); } else { // if nothing left to select close this.close(); + this.search.width(10); } } @@ -2069,7 +3036,8 @@ the specific language governing permissions and limitations under the Apache Lic // added we do not need to check if this is a new element before firing change this.triggerChange({ added: data }); - this.focusSearch(); + if (!options || !options.noFocus) + this.focusSearch(); }, // multi @@ -2083,7 +3051,7 @@ the specific language governing permissions and limitations under the Apache Lic enabledItem = $( "<li class='select2-search-choice'>" + " <div></div>" + - " <a href='#' onclick='return false;' class='select2-search-choice-close' tabindex='-1'></a>" + + " <a href='#' class='select2-search-choice-close' tabindex='-1'></a>" + "</li>"), disabledItem = $( "<li class='select2-search-choice select2-locked'>" + @@ -2092,31 +3060,34 @@ the specific language governing permissions and limitations under the Apache Lic var choice = enableChoice ? enabledItem : disabledItem, id = this.id(data), val = this.getVal(), - formatted; + formatted, + cssClass; - formatted=this.opts.formatSelection(data, choice.find("div")); + formatted=this.opts.formatSelection(data, choice.find("div"), this.opts.escapeMarkup); if (formatted != undefined) { - choice.find("div").replaceWith("<div>"+this.opts.escapeMarkup(formatted)+"</div>"); + choice.find("div").replaceWith($("<div></div>").html(formatted)); + } + cssClass=this.opts.formatSelectionCssClass(data, choice.find("div")); + if (cssClass != undefined) { + choice.addClass(cssClass); } if(enableChoice){ - choice.find(".select2-search-choice-close") - .bind("mousedown", killEvent) - .bind("click dblclick", this.bind(function (e) { - if (!this.enabled) return; - - $(e.target).closest(".select2-search-choice").fadeOut('fast', this.bind(function(){ - this.unselect($(e.target)); - this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus"); - this.close(); - this.focusSearch(); - })).dequeue(); - killEvent(e); - })).bind("focus", this.bind(function () { - if (!this.enabled) return; - this.container.addClass("select2-container-active"); - this.dropdown.addClass("select2-drop-active"); - })); + choice.find(".select2-search-choice-close") + .on("mousedown", killEvent) + .on("click dblclick", this.bind(function (e) { + if (!this.isInterfaceEnabled()) return; + + this.unselect($(e.target)); + this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus"); + killEvent(e); + this.close(); + this.focusSearch(); + })).on("focus", this.bind(function () { + if (!this.isInterfaceEnabled()) return; + this.container.addClass("select2-container-active"); + this.dropdown.addClass("select2-drop-active"); + })); } choice.data("select2-data", data); @@ -2131,7 +3102,6 @@ the specific language governing permissions and limitations under the Apache Lic var val = this.getVal(), data, index; - selected = selected.closest(".select2-search-choice"); if (selected.length === 0) { @@ -2140,57 +3110,83 @@ the specific language governing permissions and limitations under the Apache Lic data = selected.data("select2-data"); - index = indexOf(this.id(data), val); + if (!data) { + // prevent a race condition when the 'x' is clicked really fast repeatedly the event can be queued + // and invoked on an element already removed + return; + } - if (index >= 0) { + var evt = $.Event("select2-removing"); + evt.val = this.id(data); + evt.choice = data; + this.opts.element.trigger(evt); + + if (evt.isDefaultPrevented()) { + return false; + } + + while((index = indexOf(this.id(data), val)) >= 0) { val.splice(index, 1); this.setVal(val); if (this.select) this.postprocessResults(); } + selected.remove(); + + this.opts.element.trigger({ type: "select2-removed", val: this.id(data), choice: data }); this.triggerChange({ removed: data }); + + return true; }, // multi - postprocessResults: function () { + postprocessResults: function (data, initial, noHighlightUpdate) { var val = this.getVal(), - choices = this.results.find(".select2-result-selectable"), + choices = this.results.find(".select2-result"), compound = this.results.find(".select2-result-with-children"), self = this; choices.each2(function (i, choice) { var id = self.id(choice.data("select2-data")); if (indexOf(id, val) >= 0) { - choice.addClass("select2-disabled").removeClass("select2-result-selectable"); - } else { - choice.removeClass("select2-disabled").addClass("select2-result-selectable"); + choice.addClass("select2-selected"); + // mark all children of the selected parent as selected + choice.find(".select2-result-selectable").addClass("select2-selected"); } }); - compound.each2(function(i, e) { - if (!e.is('.select2-result-selectable') && e.find(".select2-result-selectable").length==0) { // FIX FOR HIRECHAL DATA - e.addClass("select2-disabled"); - } else { - e.removeClass("select2-disabled"); + compound.each2(function(i, choice) { + // hide an optgroup if it doesn't have any selectable children + if (!choice.is('.select2-result-selectable') + && choice.find(".select2-result-selectable:not(.select2-selected)").length === 0) { + choice.addClass("select2-selected"); } }); - if (this.highlight() == -1){ - choices.each2(function (i, choice) { - if (!choice.hasClass("select2-disabled") && choice.hasClass("select2-result-selectable")) { - self.highlight(0); - return false; + if (this.highlight() == -1 && noHighlightUpdate !== false && this.opts.closeOnSelect === true){ + self.highlight(0); + } + + //If all results are chosen render formatNoMatches + if(!this.opts.createSearchChoice && !choices.filter('.select2-result:not(.select2-selected)').length > 0){ + if(!data || data && !data.more && this.results.find(".select2-no-results").length === 0) { + if (checkFormatter(self.opts.formatNoMatches, "formatNoMatches")) { + this.results.append("<li class='select2-no-results'>" + evaluate(self.opts.formatNoMatches, self.opts.element, self.search.val()) + "</li>"); } - }); + } } }, // multi - resizeSearch: function () { + getMaxSearchWidth: function() { + return this.selection.width() - getSideBorderPadding(this.search); + }, + // multi + resizeSearch: function () { var minimumWidth, left, maxWidth, containerLeft, searchWidth, - sideBorderPadding = getSideBorderPadding(this.search); + sideBorderPadding = getSideBorderPadding(this.search); minimumWidth = measureTextWidth(this.search) + 10; @@ -2200,6 +3196,7 @@ the specific language governing permissions and limitations under the Apache Lic containerLeft = this.selection.offset().left; searchWidth = maxWidth - (left - containerLeft) - sideBorderPadding; + if (searchWidth < minimumWidth) { searchWidth = maxWidth - sideBorderPadding; } @@ -2207,7 +3204,12 @@ the specific language governing permissions and limitations under the Apache Lic if (searchWidth < 40) { searchWidth = maxWidth - sideBorderPadding; } - this.search.width(searchWidth); + + if (searchWidth <= 0) { + searchWidth = minimumWidth; + } + + this.search.width(Math.floor(searchWidth)); }, // multi @@ -2218,7 +3220,7 @@ the specific language governing permissions and limitations under the Apache Lic return val === null ? [] : val; } else { val = this.opts.element.val(); - return splitVal(val, this.opts.separator); + return splitVal(val, this.opts.separator, this.opts.transformVal); } }, @@ -2238,19 +3240,47 @@ the specific language governing permissions and limitations under the Apache Lic }, // multi - val: function () { - var val, data = [], self=this; + buildChangeDetails: function (old, current) { + var current = current.slice(0), + old = old.slice(0); + + // remove intersection from each array + for (var i = 0; i < current.length; i++) { + for (var j = 0; j < old.length; j++) { + if (equal(this.opts.id(current[i]), this.opts.id(old[j]))) { + current.splice(i, 1); + if(i>0){ + i--; + } + old.splice(j, 1); + j--; + } + } + } + + return {added: current, removed: old}; + }, + + + // multi + val: function (val, triggerChange) { + var oldData, self=this; if (arguments.length === 0) { return this.getVal(); } - val = arguments[0]; + oldData=this.data(); + if (!oldData.length) oldData=[]; - if (!val) { + // val is an id. !val is true for [undefined,null,'',0] - 0 is legal + if (!val && val !== 0) { this.opts.element.val(""); this.updateSelection([]); this.clearSearch(); + if (triggerChange) { + this.triggerChange({added: this.data(), removed: oldData}); + } return; } @@ -2258,20 +3288,23 @@ the specific language governing permissions and limitations under the Apache Lic this.setVal(val); if (this.select) { - this.select.find("option[selected]").each(function () { - data.push({id: $(this).attr("value"), text: $(this).text()}); - }); - this.updateSelection(data); + this.opts.initSelection(this.select, this.bind(this.updateSelection)); + if (triggerChange) { + this.triggerChange(this.buildChangeDetails(oldData, this.data())); + } } else { if (this.opts.initSelection === undefined) { - throw new Error("val() cannot be called if initSelection() is not defined") + throw new Error("val() cannot be called if initSelection() is not defined"); } this.opts.initSelection(this.opts.element, function(data){ - var ids=$(data).map(self.id); + var ids=$.map(data, self.id); self.setVal(ids); self.updateSelection(data); self.clearSearch(); + if (triggerChange) { + self.triggerChange(self.buildChangeDetails(oldData, self.data())); + } }); } this.clearSearch(); @@ -2302,7 +3335,6 @@ the specific language governing permissions and limitations under the Apache Lic this.resizeSearch(); // update selection - this.selection.find(".select2-search-choice").each(function() { val.push(self.opts.id($(this).data("select2-data"))); }); @@ -2311,19 +3343,23 @@ the specific language governing permissions and limitations under the Apache Lic }, // multi - data: function(values) { - var self=this, ids; + data: function(values, triggerChange) { + var self=this, ids, old; if (arguments.length === 0) { - return this.selection - .find(".select2-search-choice") - .map(function() { return $(this).data("select2-data"); }) - .get(); + return this.selection + .children(".select2-search-choice") + .map(function() { return $(this).data("select2-data"); }) + .get(); } else { + old = this.data(); if (!values) { values = []; } - ids = $.map(values, function(e) { return self.opts.id(e)}); + ids = $.map(values, function(e) { return self.opts.id(e); }); this.setVal(ids); this.updateSelection(values); this.clearSearch(); + if (triggerChange) { + this.triggerChange(this.buildChangeDetails(old, this.data())); + } } } }); @@ -2333,7 +3369,11 @@ the specific language governing permissions and limitations under the Apache Lic var args = Array.prototype.slice.call(arguments, 0), opts, select2, - value, multiple, allowedMethods = ["val", "destroy", "opened", "open", "close", "focus", "isFocused", "container", "onSortStart", "onSortEnd", "enable", "disable", "positionDropdown", "data"]; + method, value, multiple, + allowedMethods = ["val", "destroy", "opened", "open", "close", "focus", "isFocused", "container", "dropdown", "onSortStart", "onSortEnd", "enable", "disable", "readonly", "positionDropdown", "data", "search"], + valueMethods = ["opened", "isFocused", "container", "dropdown"], + propertyMethods = ["val", "data"], + methodsMap = { search: "externalSearch" }; this.each(function () { if (args.length === 0 || typeof(args[0]) === "object") { @@ -2341,13 +3381,13 @@ the specific language governing permissions and limitations under the Apache Lic opts.element = $(this); if (opts.element.get(0).tagName.toLowerCase() === "select") { - multiple = opts.element.attr("multiple"); + multiple = opts.element.prop("multiple"); } else { multiple = opts.multiple || false; if ("tags" in opts) {opts.multiple = multiple = true;} } - select2 = multiple ? new MultiSelect2() : new SingleSelect2(); + select2 = multiple ? new window.Select2["class"].multi() : new window.Select2["class"].single(); select2.init(opts); } else if (typeof(args[0]) === "string") { @@ -2358,12 +3398,22 @@ the specific language governing permissions and limitations under the Apache Lic value = undefined; select2 = $(this).data("select2"); if (select2 === undefined) return; - if (args[0] === "container") { - value=select2.container; + + method=args[0]; + + if (method === "container") { + value = select2.container; + } else if (method === "dropdown") { + value = select2.dropdown; } else { - value = select2[args[0]].apply(select2, args.slice(1)); + if (methodsMap[method]) method = methodsMap[method]; + + value = select2[method].apply(select2, args.slice(1)); + } + if (indexOf(args[0], valueMethods) >= 0 + || (indexOf(args[0], propertyMethods) >= 0 && args.length == 1)) { + return false; // abort the iteration, ready to return first matched value } - if (value !== undefined) {return false;} } else { throw "Invalid arguments to select2 plugin: " + args; } @@ -2374,43 +3424,100 @@ the specific language governing permissions and limitations under the Apache Lic // plugin defaults, accessible to users $.fn.select2.defaults = { width: "copy", + loadMorePadding: 0, closeOnSelect: true, openOnEnter: true, containerCss: {}, dropdownCss: {}, containerCssClass: "", dropdownCssClass: "", - formatResult: function(result, container, query) { + formatResult: function(result, container, query, escapeMarkup) { var markup=[]; - markMatch(result.text, query.term, markup); + markMatch(this.text(result), query.term, markup, escapeMarkup); return markup.join(""); }, - formatSelection: function (data, container) { - return data ? data.text : undefined; + transformVal: function(val) { + return $.trim(val); }, - formatResultCssClass: function(data) {return undefined;}, - formatNoMatches: function () { return "No matches found"; }, - formatInputTooShort: function (input, min) { var n = min - input.length; return "Please enter " + n + " more character" + (n == 1? "" : "s"); }, - formatSelectionTooBig: function (limit) { return "You can only select " + limit + " item" + (limit == 1 ? "" : "s"); }, - formatLoadMore: function (pageNumber) { return "Loading more results..."; }, - formatSearching: function () { return "Searching..."; }, + formatSelection: function (data, container, escapeMarkup) { + return data ? escapeMarkup(this.text(data)) : undefined; + }, + sortResults: function (results, container, query) { + return results; + }, + formatResultCssClass: function(data) {return data.css;}, + formatSelectionCssClass: function(data, container) {return undefined;}, minimumResultsForSearch: 0, minimumInputLength: 0, + maximumInputLength: null, maximumSelectionSize: 0, - id: function (e) { return e.id; }, + id: function (e) { return e == undefined ? null : e.id; }, + text: function (e) { + if (e && this.data && this.data.text) { + if ($.isFunction(this.data.text)) { + return this.data.text(e); + } else { + return e[this.data.text]; + } + } else { + return e.text; + } + }, matcher: function(term, text) { - return text.toUpperCase().indexOf(term.toUpperCase()) >= 0; + return stripDiacritics(''+text).toUpperCase().indexOf(stripDiacritics(''+term).toUpperCase()) >= 0; }, separator: ",", tokenSeparators: [], tokenizer: defaultTokenizer, - escapeMarkup: function (markup) { - if (markup && typeof(markup) === "string") { - return markup.replace(/&/g, "&"); + escapeMarkup: defaultEscapeMarkup, + blurOnChange: false, + selectOnBlur: false, + adaptContainerCssClass: function(c) { return c; }, + adaptDropdownCssClass: function(c) { return null; }, + nextSearchTerm: function(selectedObject, currentSearchTerm) { return undefined; }, + searchInputPlaceholder: '', + createSearchChoicePosition: 'top', + shouldFocusInput: function (instance) { + // Attempt to detect touch devices + var supportsTouchEvents = (('ontouchstart' in window) || + (navigator.msMaxTouchPoints > 0)); + + // Only devices which support touch events should be special cased + if (!supportsTouchEvents) { + return true; } - return markup; - }, - blurOnChange: false + + // Never focus the input if search is disabled + if (instance.opts.minimumResultsForSearch < 0) { + return false; + } + + return true; + } + }; + + $.fn.select2.locales = []; + + $.fn.select2.locales['en'] = { + formatMatches: function (matches) { if (matches === 1) { return "One result is available, press enter to select it."; } return matches + " results are available, use up and down arrow keys to navigate."; }, + formatNoMatches: function () { return "No matches found"; }, + formatAjaxError: function (jqXHR, textStatus, errorThrown) { return "Loading failed"; }, + formatInputTooShort: function (input, min) { var n = min - input.length; return "Please enter " + n + " or more character" + (n == 1 ? "" : "s"); }, + formatInputTooLong: function (input, max) { var n = input.length - max; return "Please delete " + n + " character" + (n == 1 ? "" : "s"); }, + formatSelectionTooBig: function (limit) { return "You can only select " + limit + " item" + (limit == 1 ? "" : "s"); }, + formatLoadMore: function (pageNumber) { return "Loading more results…"; }, + formatSearching: function () { return "Searching…"; } + }; + + $.extend($.fn.select2.defaults, $.fn.select2.locales['en']); + + $.fn.select2.ajaxDefaults = { + transport: $.ajax, + params: { + type: "GET", + cache: false, + dataType: "json" + } }; // exports @@ -2421,7 +3528,9 @@ the specific language governing permissions and limitations under the Apache Lic tags: tags }, util: { debounce: debounce, - markMatch: markMatch + markMatch: markMatch, + escapeMarkup: defaultEscapeMarkup, + stripDiacritics: stripDiacritics }, "class": { "abstract": AbstractSelect2, "single": SingleSelect2, diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/select2/select2.modded.min.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/select2/select2.modded.min.js new file mode 100644 index 0000000000000000000000000000000000000000..3e5adad15feaea34b4fcbc6a66af6defb4d60261 --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/select2/select2.modded.min.js @@ -0,0 +1 @@ +eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('(5($){if(3i $.fn.2D=="1h"){$.3a($.fn,{2D:5(c){14 j=$([0]),i=-1,l=3.1d;6N(++i<l&&(j.21=j[0]=3[i])&&c.1Z(j[0],i,j)!==1e);11 3}})}})(8F);(5($,1h){"9I g1";if(1J.4m!==1h){11}14 5C,7R,79,4A,3F,6s={x:0,y:0},$1X,68,1m={5h:9,3u:13,5m:27,fd:32,5o:37,4t:38,5Y:39,5j:40,aL:16,9Q:17,9N:18,82:33,86:34,fE:36,gY:35,4D:8,6i:46,gU:5(k){k=k.1x?k.1x:k;6k(k){2d 1m.5o:2d 1m.5Y:2d 1m.4t:2d 1m.5j:11 1l}11 1e},7W:5(e){14 k=e.1x;6k(k){2d 1m.aL:2d 1m.9Q:2d 1m.9N:11 1l}if(e.7Y)11 1l;11 1e},84:5(k){k=k.1x?k.1x:k;11 k>=gP&&k<=gQ}},8K="<1U 1t=\'6-gS-gR\'></1U>",8L={"\\h1":"A","\\h2":"A","\\he":"A","\\hh":"A","\\ha":"A","\\h9":"A","\\h6":"A","\\h8":"A","\\h7":"A","\\gM":"A","\\gL":"A","\\gp":"A","\\go":"A","\\gr":"A","\\gn":"A","\\gg":"A","\\gj":"A","\\gv":"A","\\gw":"A","\\gI":"A","\\gD":"A","\\gy":"A","\\gx":"A","\\gz":"A","\\gA":"A","\\gB":"A","\\gC":"A","\\gE":"A","\\gJ":"A","\\gK":"A","\\gH":"A","\\gF":"A","\\gG":"A","\\gk":"gl","\\gi":"8h","\\gf":"8h","\\gh":"8h","\\gm":"gs","\\gu":"gq","\\h5":"9F","\\h3":"9F","\\h4":"hg","\\hf":"B","\\hc":"B","\\hd":"B","\\gN":"B","\\gO":"B","\\gT":"B","\\gZ":"B","\\h0":"B","\\gX":"C","\\gV":"C","\\gW":"C","\\ge":"C","\\gd":"C","\\fx":"C","\\fy":"C","\\fw":"C","\\fv":"C","\\ft":"C","\\fu":"C","\\fz":"D","\\fA":"D","\\fF":"D","\\fG":"D","\\fD":"D","\\fB":"D","\\fC":"D","\\fs":"D","\\fr":"D","\\fg":"D","\\fh":"D","\\ff":"D","\\fe":"D","\\fb":"8M","\\fc":"8M","\\fi":"96","\\fp":"96","\\fq":"E","\\fo":"E","\\fm":"E","\\fk":"E","\\fl":"E","\\fH":"E","\\fI":"E","\\g3":"E","\\g4":"E","\\g2":"E","\\fZ":"E","\\g0":"E","\\g5":"E","\\g6":"E","\\gb":"E","\\gc":"E","\\ga":"E","\\g9":"E","\\g7":"E","\\g8":"E","\\fY":"E","\\fX":"E","\\fN":"E","\\fa":"E","\\fO":"E","\\fM":"E","\\fL":"E","\\fJ":"E","\\fK":"E","\\fP":"F","\\fQ":"F","\\fV":"F","\\fW":"F","\\fU":"F","\\fT":"G","\\fR":"G","\\fS":"G","\\hi":"G","\\hj":"G","\\iO":"G","\\iP":"G","\\iN":"G","\\iM":"G","\\iK":"G","\\iL":"G","\\iQ":"G","\\iR":"G","\\iW":"G","\\iX":"H","\\iV":"H","\\iU":"H","\\iS":"H","\\iT":"H","\\iJ":"H","\\iI":"H","\\iy":"H","\\iz":"H","\\ix":"H","\\iw":"H","\\ir":"H","\\iu":"H","\\iv":"I","\\iA":"I","\\iB":"I","\\iG":"I","\\iH":"I","\\iF":"I","\\iE":"I","\\iC":"I","\\iD":"I","\\iY":"I","\\iZ":"I","\\jk":"I","\\jl":"I","\\jj":"I","\\ji":"I","\\jg":"I","\\jh":"I","\\jm":"I","\\jn":"I","\\js":"J","\\jt":"J","\\jr":"J","\\jq":"J","\\jo":"K","\\jp":"K","\\jf":"K","\\je":"K","\\j4":"K","\\j5":"K","\\j3":"K","\\j2":"K","\\j0":"K","\\j1":"K","\\j6":"K","\\j7":"K","\\jc":"K","\\jd":"L","\\jb":"L","\\ja":"L","\\j8":"L","\\j9":"L","\\iq":"L","\\ip":"L","\\hG":"L","\\hH":"L","\\hF":"L","\\hE":"L","\\hC":"L","\\hD":"L","\\hI":"L","\\hJ":"L","\\hO":"L","\\hP":"L","\\hN":"hM","\\hK":"hL","\\hB":"M","\\hA":"M","\\hp":"M","\\hq":"M","\\ho":"M","\\hn":"M","\\hk":"M","\\hl":"N","\\hm":"N","\\hr":"N","\\hs":"N","\\hy":"N","\\hz":"N","\\hx":"N","\\hw":"N","\\ht":"N","\\hu":"N","\\hQ":"N","\\hR":"N","\\ic":"N","\\ie":"N","\\ib":"N","\\ia":"i8","\\i9":"ig","\\ih":"O","\\im":"O","\\io":"O","\\il":"O","\\ik":"O","\\ii":"O","\\ij":"O","\\i7":"O","\\i6":"O","\\hW":"O","\\hX":"O","\\hV":"O","\\hU":"O","\\hS":"O","\\hT":"O","\\hY":"O","\\hZ":"O","\\i4":"O","\\i5":"O","\\i3":"O","\\i2":"O","\\i0":"O","\\i1":"O","\\ju":"O","\\dA":"O","\\bt":"O","\\bw":"O","\\bl":"O","\\bk":"O","\\bm":"O","\\bn":"O","\\bp":"O","\\bx":"O","\\bI":"O","\\bK":"O","\\bF":"O","\\bz":"O","\\bB":"O","\\bD":"O","\\aY":"O","\\aW":"O","\\aU":"O","\\b3":"b5","\\b4":"b9","\\cw":"cr","\\cM":"P","\\cE":"P","\\cG":"P","\\cF":"P","\\c1":"P","\\c0":"P","\\bV":"P","\\bO":"P","\\bN":"P","\\cd":"Q","\\cc":"Q","\\cb":"Q","\\c8":"Q","\\c9":"Q","\\c7":"R","\\c6":"R","\\c4":"R","\\c5":"R","\\ca":"R","\\cg":"R","\\ch":"R","\\cf":"R","\\ce":"R","\\c3":"R","\\c2":"R","\\bS":"R","\\bT":"R","\\bR":"R","\\bQ":"R","\\bP":"R","\\bU":"S","\\bZ":"S","\\bY":"S","\\bW":"S","\\bX":"S","\\ci":"S","\\cj":"S","\\cD":"S","\\cB":"S","\\cC":"S","\\cH":"S","\\cI":"S","\\cN":"S","\\cO":"S","\\cL":"S","\\cJ":"S","\\cK":"T","\\cA":"T","\\cz":"T","\\cp":"T","\\cq":"T","\\co":"T","\\cn":"T","\\ck":"T","\\cl":"T","\\cs":"T","\\cx":"T","\\cy":"T","\\bM":"T","\\cv":"T","\\ct":"cu","\\cP":"U","\\bA":"U","\\b7":"U","\\b6":"U","\\ba":"U","\\bb":"U","\\bg":"U","\\bf":"U","\\bc":"U","\\bd":"U","\\bi":"U","\\aZ":"U","\\aS":"U","\\aV":"U","\\aX":"U","\\b1":"U","\\b0":"U","\\b2":"U","\\aT":"U","\\bh":"U","\\bL":"U","\\bC":"U","\\bj":"U","\\bE":"U","\\bJ":"U","\\bH":"U","\\by":"U","\\bo":"U","\\bq":"U","\\br":"U","\\bs":"U","\\f9":"U","\\eq":"U","\\er":"V","\\ep":"V","\\es":"V","\\et":"V","\\eh":"V","\\eg":"V","\\e5":"V","\\e6":"e4","\\e3":"W","\\cQ":"W","\\e2":"W","\\ef":"W","\\eb":"W","\\f0":"W","\\eX":"W","\\eU":"W","\\f5":"W","\\f3":"X","\\f4":"X","\\eT":"X","\\eI":"X","\\eJ":"Y","\\eH":"Y","\\eF":"Y","\\eN":"Y","\\dZ":"Y","\\de":"Y","\\df":"Y","\\dd":"Y","\\dc":"Y","\\d9":"Y","\\da":"Y","\\dh":"Y","\\dm":"Y","\\dn":"Y","\\dl":"Z","\\dk":"Z","\\di":"Z","\\d8":"Z","\\d7":"Z","\\cX":"Z","\\cR":"Z","\\cS":"Z","\\cT":"Z","\\d5":"Z","\\d6":"Z","\\d4":"Z","\\d3":"Z","\\dM":"a","\\dL":"a","\\dT":"a","\\dG":"a","\\dB":"a","\\dC":"a","\\dD":"a","\\dE":"a","\\dF":"a","\\dy":"a","\\dx":"a","\\ds":"a","\\dr":"a","\\dq":"a","\\dt":"a","\\du":"a","\\dw":"a","\\dv":"a","\\dH":"a","\\dI":"a","\\dS":"a","\\dU":"a","\\dV":"a","\\dX":"a","\\dW":"a","\\dR":"a","\\dQ":"a","\\dK":"a","\\dJ":"a","\\dN":"a","\\dP":"a","\\dO":"a","\\dp":"a","\\do":"a","\\d2":"aa","\\d1":"ae","\\d0":"ae","\\cZ":"ae","\\cY":"ao","\\cU":"au","\\cV":"av","\\cW":"av","\\dj":"ay","\\dg":"b","\\db":"b","\\dY":"b","\\eM":"b","\\eO":"b","\\eP":"b","\\eR":"b","\\eQ":"b","\\eL":"c","\\eK":"c","\\eE":"c","\\eD":"c","\\eG":"c","\\eS":"c","\\f6":"c","\\f8":"c","\\f7":"c","\\f2":"c","\\f1":"c","\\eW":"c","\\eV":"d","\\eY":"d","\\eZ":"d","\\eC":"d","\\eB":"d","\\ea":"d","\\e9":"d","\\ec":"d","\\ed":"d","\\ee":"d","\\e8":"d","\\e7":"d","\\e1":"d","\\e0":"dz","\\ev":"dz","\\eu":"e","\\ew":"e","\\ey":"e","\\eA":"e","\\ez":"e","\\ek":"e","\\ej":"e","\\ei":"e","\\eo":"e","\\bu":"e","\\bv":"e","\\bG":"e","\\b8":"e","\\fj":"e","\\lq":"e","\\oX":"e","\\oY":"e","\\oW":"e","\\oV":"e","\\oT":"e","\\oU":"e","\\oZ":"e","\\p0":"e","\\p5":"e","\\p4":"e","\\p3":"e","\\p1":"e","\\p2":"e","\\oS":"e","\\oR":"e","\\oI":"f","\\oJ":"f","\\oH":"f","\\oG":"f","\\oE":"f","\\oF":"g","\\oK":"g","\\oL":"g","\\oQ":"g","\\oP":"g","\\oO":"g","\\oM":"g","\\oN":"g","\\p6":"g","\\p7":"g","\\ps":"g","\\pr":"g","\\pq":"g","\\po":"g","\\pp":"h","\\pu":"h","\\pv":"h","\\pB":"h","\\pA":"h","\\pz":"h","\\pw":"h","\\py":"h","\\pn":"h","\\pm":"h","\\pd":"h","\\pe":"h","\\pb":"h","\\pa":"h","\\p8":"hv","\\p9":"i","\\pf":"i","\\pg":"i","\\pl":"i","\\pk":"i","\\pj":"i","\\ph":"i","\\pi":"i","\\oD":"i","\\oC":"i","\\nU":"i","\\nV":"i","\\nT":"i","\\nS":"i","\\nQ":"i","\\nR":"i","\\nW":"i","\\nX":"i","\\o2":"i","\\o1":"j","\\o0":"j","\\nY":"j","\\nZ":"j","\\nP":"j","\\nO":"k","\\nF":"k","\\nG":"k","\\nE":"k","\\nD":"k","\\nB":"k","\\nC":"k","\\nH":"k","\\nI":"k","\\nN":"k","\\pD":"k","\\nM":"k","\\nL":"k","\\nJ":"l","\\nK":"l","\\o3":"l","\\o4":"l","\\ot":"l","\\os":"l","\\oq":"l","\\om":"l","\\op":"l","\\ov":"l","\\ow":"l","\\oB":"l","\\oA":"l","\\oz":"l","\\ox":"l","\\oy":"l","\\ol":"l","\\ok":"l","\\o9":"lj","\\oa":"m","\\o8":"m","\\o7":"m","\\o5":"m","\\o6":"m","\\ob":"m","\\oc":"m","\\oj":"n","\\oh":"n","\\og":"n","\\od":"n","\\oe":"n","\\pC":"n","\\qn":"n","\\qO":"n","\\qN":"n","\\qM":"n","\\qQ":"n","\\qV":"n","\\qU":"n","\\qT":"n","\\qS":"n","\\qL":"n","\\qK":"nj","\\qD":"o","\\qC":"o","\\qB":"o","\\qz":"o","\\qX":"o","\\qE":"o","\\qF":"o","\\qJ":"o","\\qI":"o","\\qH":"o","\\qG":"o","\\qW":"o","\\r7":"o","\\r8":"o","\\r6":"o","\\r5":"o","\\qZ":"o","\\r2":"o","\\qY":"o","\\r4":"o","\\r9":"o","\\pX":"o","\\pW":"o","\\pV":"o","\\pU":"o","\\pY":"o","\\pZ":"o","\\q4":"o","\\qy":"o","\\q3":"o","\\q2":"o","\\q1":"o","\\pS":"o","\\pR":"o","\\pI":"o","\\pJ":"o","\\pE":"o","\\pF":"o","\\pK":"o","\\pQ":"o","\\pP":"o","\\pO":"o","\\pM":"oi","\\qw":"ou","\\qt":"oo","\\qk":"p","\\qj":"p","\\qb":"p","\\qa":"p","\\q9":"p","\\q7":"p","\\q8":"p","\\qd":"p","\\qi":"p","\\qh":"q","\\qg":"q","\\qe":"q","\\qf":"q","\\qc":"q","\\qs":"r","\\qu":"r","\\qv":"r","\\qr":"r","\\qq":"r","\\qm":"r","\\ql":"r","\\qo":"r","\\qp":"r","\\q6":"r","\\q5":"r","\\pN":"r","\\pL":"r","\\pG":"r","\\pH":"r","\\q0":"r","\\pT":"s","\\qx":"s","\\qA":"s","\\r0":"s","\\r1":"s","\\r3":"s","\\qR":"s","\\qP":"s","\\nz":"s","\\kQ":"s","\\kR":"s","\\kP":"s","\\kO":"s","\\kM":"s","\\kN":"s","\\kS":"s","\\kT":"s","\\kY":"t","\\kX":"t","\\kW":"t","\\kU":"t","\\kV":"t","\\kL":"t","\\kK":"t","\\kA":"t","\\kB":"t","\\kz":"t","\\ky":"t","\\kw":"t","\\kx":"t","\\kC":"t","\\kD":"t","\\kI":"kJ","\\kH":"u","\\kG":"u","\\kE":"u","\\kF":"u","\\kZ":"u","\\l0":"u","\\ln":"u","\\lo":"u","\\lm":"u","\\ll":"u","\\lh":"u","\\lk":"u","\\lp":"u","\\nA":"u","\\lw":"u","\\jv":"u","\\lv":"u","\\lu":"u","\\lr":"u","\\ls":"u","\\lg":"u","\\lf":"u","\\l5":"u","\\l6":"u","\\l4":"u","\\l3":"u","\\l1":"u","\\l2":"u","\\l7":"u","\\l8":"u","\\ld":"u","\\le":"u","\\lc":"u","\\lb":"v","\\l9":"v","\\la":"v","\\kv":"v","\\ku":"v","\\jQ":"v","\\jR":"v","\\jP":"jO","\\jM":"w","\\jN":"w","\\jS":"w","\\jT":"w","\\jY":"w","\\jX":"w","\\jW":"w","\\jU":"w","\\jV":"w","\\jL":"w","\\jK":"x","\\jA":"x","\\jB":"x","\\jz":"x","\\jy":"y","\\jw":"y","\\jx":"y","\\jC":"y","\\jD":"y","\\jI":"y","\\jJ":"y","\\jH":"y","\\jG":"y","\\jE":"y","\\jF":"y","\\jZ":"y","\\k0":"y","\\kl":"y","\\km":"y","\\kk":"z","\\kj":"z","\\kh":"z","\\ki":"z","\\kn":"z","\\ko":"z","\\kt":"z","\\ks":"z","\\kr":"z","\\kp":"z","\\kq":"z","\\kg":"z","\\kf":"z","\\k5":"\\k6","\\k4":"\\k3","\\k1":"\\k2","\\k7":"\\8E","\\k8":"\\8E","\\kd":"\\ke","\\kc":"\\8D","\\kb":"\\8D","\\k9":"\\ka","\\lx":"\\ly","\\mU":"\\mV","\\mT":"\\mS","\\mQ":"\\7v","\\mR":"\\7v","\\mW":"\\7v","\\mX":"\\n2","\\n1":"\\7w","\\n0":"\\7w","\\mY":"\\7w","\\8B":"\\8B","\\mZ":"\\mP"};$1X=$(1X);4A=(5(){14 8C=1;11 5(){11 8C++}}());5 7g(12){14 2k=$(1X.mO(\'\'));12.6u(2k);2k.6u(12);2k.3r()}5 4i(8J){5 26(a){11 8L[a]||a}11 8J.5i(/[^\\mE-\\mF]/g,26)}5 2m(25,7o){14 i=0,l=7o.1d;1N(;i<l;i=i+1){if(2s(25,7o[i]))11 i}11-1}5 8N(){14 $4v=$(8K);$4v.4T(1X.2V);14 8w={1r:$4v.1r()-$4v[0].mD,3l:$4v.3l()-$4v[0].8S};$4v.3r();11 8w}5 2s(a,b){if(a===b)11 1l;if(a===1h||b===1h)11 1e;if(a===1o||b===1o)11 1e;if(a.3f===7c)11 a+\'\'===b+\'\';if(b.3f===7c)11 b+\'\'===a+\'\';11 1e}5 6Z(4o,3e,8v){14 19,i,l;if(4o===1o||4o.1d<1)11[];19=4o.5O(3e);1N(i=0,l=19.1d;i<l;i=i+1)19[i]=8v(19[i]);11 19}5 7T(12){11 12.2I(1e)-12.1r()}5 75(12){14 5k="4F-2W-25";12.on("6o",5(){if($.7(12,5k)===1h){$.7(12,5k,12.19())}});12.on("4F",5(){14 19=$.7(12,5k);if(19!==1h&&12.19()!==19){$.7e(12,5k);12.1L("4F-2W")}})}5 9j(12){12.on("5f",5(e){14 6y=6s;if(6y===1h||6y.x!==e.9d||6y.y!==e.9i){$(e.4C).1L("5f-2X",e)}})}5 6g(5r,fn,6F){6F=6F||1h;14 4y;11 5(){14 28=1K;1J.97(4y);4y=1J.51(5(){fn.2h(6F,28)},5r)}}5 8r(9l,12){14 9h=6g(9l,5(e){12.1L("3y-8s",e)});12.on("3y",5(e){if(2m(e.4C,12.2r())>=0)9h(e)})}5 1s($el){if($el[0]===1X.69)11;1J.51(5(){14 el=$el[0],4J=$el.19().1d,3Z;$el.1s();14 9f=(el.mC>0||el.mA>0);if(9f&&el===1X.69){if(el.63){el.63(4J,4J)}1k if(el.64){3Z=el.64();3Z.aA(1e);3Z.1A()}}},0)}5 9Y(el){el=$(el)[0];14 1I=0;14 1d=0;if(\'8P\'in el){1I=el.8P;1d=el.mB-1I}1k if(\'1q\'in 1X){el.1s();14 7B=1X.1q.9n();1d=1X.1q.9n().1j.1d;7B.mG(\'7X\',-el.25.1d);1I=7B.1j.1d-1d}11{1I:1I,1d:1d}}5 1O(2p){2p.5Q();2p.4Q()}5 aH(2p){2p.5Q();2p.9M()}5 a0(e){if(!3F){14 2c=e[0].mH||1J.mM(e[0],1o);3F=$(1X.5v("1U")).1Y({8U:"mN",2Q:"-9w",23:"-9w",62:"65",9t:2c.9t,9p:2c.9p,9q:2c.9q,9r:2c.9r,9b:2c.9b,8W:2c.8W,mL:"mK"});3F.1f("1t","6-3F");$(1X.2V).48(3F)}3F.1j(e.19());11 3F.1r()}5 5l(73,8V,8R){14 3d,6A=[],6H;3d=$.4W(73.1f("1t"));if(3d){3d=\'\'+3d;$(3d.5O(/\\s+/)).2D(5(){if(3.2m("6-")===0){6A.1Q(3)}})}3d=$.4W(8V.1f("1t"));if(3d){3d=\'\'+3d;$(3d.5O(/\\s+/)).2D(5(){if(3.2m("6-")!==0){6H=8R(3);if(6H){6A.1Q(6H)}}})}73.1f("1t",6A.5p(" "))}5 6r(1j,1C,2L,2a){14 26=4i(1j.6L()).2m(4i(1C.6L())),7d=1C.1d;if(26<0){2L.1Q(2a(1j));11}2L.1Q(2a(1j.56(0,26)));2L.1Q("<45 1t=\'6-26\'>");2L.1Q(2a(1j.56(26,26+7d)));2L.1Q("</45>");2L.1Q(2a(1j.56(26+7d,1j.1d)))}5 8k(2L){14 99={\'\\\\\':\'\\',\'&\':\'&mI;\',\'<\':\'<\',\'>\':\'>\',\'"\':\'&mJ;\',"\'":\''\',"/":\'/\'};11 7c(2L).5i(/[&<>"\'\\/\\\\]/g,5(26){11 99[26]})}5 2Y(1H){14 4y,5w=1o,5r=1H.5r||n3,4p=1H.3o,1c=3;11 5(1p){1J.97(4y);4y=1J.51(5(){14 7=1H.7,3o=4p,5c=1H.5c||$.fn.6.7F.5c,93={2o:1H.2o||\'aE\',7n:1H.7n||1e,91:1H.91||1h,5J:1H.5J||"aR"},31=$.3a({},$.fn.6.7F.31,93);7=7?7.1Z(1c,1p.1C,1p.2M,1p.21):1o;3o=(3i 3o===\'5\')?3o.1Z(1c,1p.1C,1p.2M,1p.21):3o;if(5w&&3i 5w.95==="5"){5w.95()}if(1H.31){if($.2N(1H.31)){$.3a(31,1H.31.1Z(1c))}1k{$.3a(31,1H.31)}}$.3a(31,{3o:3o,5J:1H.5J,7:7,n4:5(7){14 1b=1H.1b(7,1p.2M,1p);1p.1V(1b)},9y:5(5d,5b,58){14 1b={aB:1l,5d:5d,5b:5b,58:58};1p.1V(1b)}});5w=5c.1Z(1c,31)},5r)}}5 5R(1H){14 7=1H,8f,5t,1j=5(2J){11""+2J.1j};if($.5S(7)){5t=7;7={1b:5t}}if($.2N(7)===1e){5t=7;7=5(){11 5t}}14 6O=7();if(6O.1j){1j=6O.1j;if(!$.2N(1j)){8f=6O.1j;1j=5(2J){11 2J[8f]}}}11 5(1p){14 t=1p.1C,2X={1b:[]},3X;if(t===""){1p.1V(7());11}3X=5(2A,4E){14 2F,1f;2A=2A[0];if(2A.1F){2F={};1N(1f in 2A){if(2A.nq(1f))2F[1f]=2A[1f]}2F.1F=[];$(2A.1F).2D(5(i,94){3X(94,2F.1F)});if(2F.1F.1d||1p.30(t,1j(2F),2A)){4E.1Q(2F)}}1k{if(1p.30(t,1j(2A),2A)){4E.1Q(2A)}}};$(7().1b).2D(5(i,2A){3X(2A,2X.1b)});1p.1V(2X)}}5 29(7){14 9a=$.2N(7);11 5(1p){14 t=1p.1C,2X={1b:[]};14 1y=9a?7(1p):7;if($.5S(1y)){$(1y).2j(5(){14 8c=3.1j!==1h,1j=8c?3.1j:3;if(t===""||1p.30(t,1j)){2X.1b.1Q(8c?3:{id:3,1j:3})}});1p.1V(2X)}}}5 3N(6E,90){if($.2N(6E))11 1l;if(!6E)11 1e;if(3i(6E)===\'4o\')11 1l;3b 3q 5z(90+" 8y be a 4o, 5, or nr 25")}5 2b(19,21){if($.2N(19)){14 28=9B.3J.59.1Z(1K,2);11 19.2h(21,28)}11 19}5 7h(1b){14 6z=0;$.2j(1b,5(i,2J){if(2J.1F){6z+=7h(2J.1F)}1k{6z++}});11 6z}5 a8(1z,1q,8Z,4){14 8Y=1z,6G=1e,3c,1E,i,l,3e;if(!4.3K||!4.57||4.57.1d<1)11 1h;6N(1l){1E=-1;1N(i=0,l=4.57.1d;i<l;i++){3e=4.57[i];1E=1z.2m(3e);if(1E>=0)54}if(1E<0)54;3c=1z.56(0,1E);1z=1z.56(1E+3e.1d);if(3c.1d>0){3c=4.3K.1Z(3,3c,1q);if(3c!==1h&&3c!==1o&&4.id(3c)!==1h&&4.id(3c)!==1o){6G=1e;1N(i=0,l=1q.1d;i<l;i++){if(2s(4.id(3c),4.id(1q[i]))){6G=1l;54}}if(!6G)8Z(3c)}}}if(8Y!==1z)11 1z}5 6p(){14 1c=3;$.2j(1K,5(i,12){1c[12].3r();1c[12]=1o})}5 61(83,9o){14 3f=5(){};3f.3J=3q 83;3f.3J.3f=3f;3f.3J.2w=83.3J;3f.3J=$.3a(3f.3J,9o);11 3f}5C=61(np,{1w:5(9u){14 1c=3;11 5(){9u.2h(1c,1K)}},aq:5(4){14 1b,15,3O=".6-1b";3.4=4=3.4M(4);3.id=4.id;if(4.12.7("6")!==1h&&4.12.7("6")!==1o){4.12.7("6").4d()}3.1a=3.74();3.2Z=$(\'.6-6J-9m\');if(3.2Z.1d==0){3.2Z=$("<45>",{3H:"nn","4b-nl":"nm"}).1v("6-6J-9m").4T(1X.2V)}3.7Q="ns"+(4.12.1f("id")||"nt"+4A());3.7A=3.7Q.5i(/([.])/g,\'ny\').5i(/([;&,\\-\\.\\+\\*\\~\':"\\!\\^#$%@\\[\\]\\(\\)=>\\|])/g,\'\\\\$1\');3.1a.1f("id",3.7Q);3.1a.1f("6c",4.12.1f("6c"));3.2V=$(1X.2V);5l(3.1a,3.4.12,3.4.7E);3.1a.1f("2c",4.12.1f("2c"));3.1a.1Y(2b(4.9H,3.4.12));3.1a.1v(2b(4.7l,3.4.12));3.55=3.4.12.1f("3R");3.4.12.7("6",3).1f("3R","-1").6u(3.1a).on("3n.6",1O);3.1a.7("6",3);3.1i=3.1a.1u(".6-1R");5l(3.1i,3.4.12,3.4.7D);3.1i.1v(2b(4.7k,3.4.12));3.1i.7("6",3);3.1i.on("3n",1O);3.1b=1b=3.1a.1u(3O);3.15=15=3.1a.1u("1z.6-1z");3.7q=0;3.4h=0;3.21=1o;3.7U();3.1a.on("3n",1O);9j(3.1b);3.1i.on("5f-2X",3O,3.1w(3.5K));3.1i.on("4k 9x 85",3O,3.1w(5(2p){3.7P=1l;3.5K(2p)}));3.1i.on("9x",3O,3.1w(3.aw));3.1i.on("4k 85",3O,3.1w(3.7I));3.1i.on(\'3n\',3.1w(5(2p){if(3.7P){3.7P=1e;3.3t()}}));8r(80,3.1b);3.1i.on("3y-8s",3O,3.1w(3.5V));$(3.1a).on("2W",".6-1z",5(e){e.4Q()});$(3.1i).on("2W",".6-1z",5(e){e.4Q()});if($.fn.8u){1b.8u(5(e,7t,nx,5g){14 23=1b.2K();if(5g>0&&23-5g<=0){1b.2K(0);1O(e)}1k if(5g<0&&1b.2r(0).7a-1b.2K()+5g<=1b.3l()){1b.2K(1b.2r(0).7a-1b.3l());1O(e)}})}75(15);15.on("4F-2W 1z 9T",3.1w(3.3V));15.on("1s",5(){15.1v("6-5y")});15.on("3v",5(){15.1W("6-5y")});3.1i.on("8q",3O,3.1w(5(e){if($(e.4C).5e(".6-1y-2S").1d>0){3.5K(e);3.3t(e)}}));3.1i.on("3n 8q 4B 4k 85 nw",5(e){e.4Q()});3.2t=1h;if($.2N(3.4.1T)){3.1T();3.9k()}if(4.4Y!==1o){3.15.1f("nu",4.4Y)}14 1B=4.12.24("1B");if(1B===1h)1B=1e;3.5a(!1B);14 2q=4.12.24("2q");if(2q===1h)2q=1e;3.2q(2q);68=68||8N();3.4H=4.12.24("4H");4.12.24("4H",1e);if(3.4H)3.1s();3.15.1f("2k",4.ad)},4d:5(){14 12=3.4.12,6=12.7("6"),1c=3;3.1D();if(12.1d&&12[0].8I&&1c.42){12.2j(5(){if(1c.42){3.8I("8Q",1c.42)}})}if(3.3I){3.3I.nv();3.3I=1o}3.42=1o;if(6!==1h){6.1a.3r();6.2Z.3r();6.1i.3r();12.4U().7e("6").2O(".6").24("4H",3.4H||1e);if(3.55){12.1f({3R:3.55})}1k{12.7J("3R")}12.4U()}6p.1Z(3,"1a","2Z","1i","1b","15")},4L:5(12){if(12.is("3W")){11{id:12.24("25"),1j:12.1j(),12:12.2r(),1Y:12.1f("1t"),1B:12.24("1B"),3k:2s(12.1f("3k"),"3k")||2s(12.7("3k"),1l)}}1k if(12.is("8H")){11{1j:12.1f("1P"),1F:[],12:12.2r(),1Y:12.1f("1t")}}},4M:5(4){14 12,1A,8i,4p,1c=3;12=4.12;if(12.2r(0).6D.6C()==="1A"){3.1A=1A=4.12}if(1A){$.2j(["id","3B","2Y","1p","3K","1T","7","29"],5(){if(3 in 4){3b 3q 5z("nk \'"+3+"\' is 2g ni 1N 4m a4 a3 4I a <1A> 12.")}})}4=$.3a({},{7p:5(1a,1b,1p){14 6U,id=3.4.id,2Z=3.2Z;6U=5(1b,1a,7O){14 i,l,1y,2S,1B,4P,2E,1P,5F,2P;1b=4.ag(1b,1a,1p);14 89=[];1N(i=0,l=1b.1d;i<l;i=i+1){1y=1b[i];1B=(1y.1B===1l);2S=(!1B)&&(id(1y)!==1h);4P=1y.1F&&1y.1F.1d>0;2E=$("<li></li>");2E.1v("6-1b-n9-"+7O);2E.1v("6-1y");2E.1v(2S?"6-1y-2S":"6-1y-na");if(1B){2E.1v("6-1B")}if(4P){2E.1v("6-1y-7Z-1F")}2E.1v(1c.4.af(1y));2E.1f("3H","7z");1P=$(1X.5v("1U"));1P.1v("6-1y-1P");1P.1f("id","6-1y-1P-"+4A());1P.1f("3H","3W");2P=4.at(1y,1P,1p,1c.4.2a);if(2P!==1h){1P.3w(2P);2E.48(1P)}if(4P){5F=$("<3S></3S>");5F.1v("6-1y-n8");6U(1y.1F,5F,7O+1);2E.48(5F)}2E.7("6-7",1y);89.1Q(2E[0])}1a.48(89);2Z.1j(4.8o(1b.1d))};6U(1b,1a,0)}},$.fn.6.7b,4);if(3i(4.id)!=="5"){8i=4.id;4.id=5(e){11 e[8i]}}if($.5S(4.12.7("8A"))){if("29"in 4){3b"29 n7 as n5 an n6 \'7-6-29\' 9J in 1H of 4m "+4.12.1f("id")}4.29=4.12.7("8A")}if(1A){4.1p=3.1w(5(1p){14 7={1b:[],20:1e},1C=1p.1C,1F,2e,3X;3X=5(12,4E){14 2F;if(12.is("3W")){if(1p.30(1C,12.1j(),12)){4E.1Q(1c.4L(12))}}1k if(12.is("8H")){2F=1c.4L(12);12.1F().2D(5(i,3j){3X(3j,2F.1F)});if(2F.1F.1d>0){4E.1Q(2F)}}};1F=12.1F();if(3.3Y()!==1h&&1F.1d>0){2e=3.4f();if(2e){1F=1F.2g(2e)}}1F.2D(5(i,3j){3X(3j,7.1b)});1p.1V(7)});4.id=5(e){11 e.id}}1k{if(!("1p"in 4)){if("2Y"in 4){4p=4.12.7("2Y-3o");if(4p&&4p.1d>0){4.2Y.3o=4p}4.1p=2Y.1Z(4.12,4.2Y)}1k if("7"in 4){4.1p=5R(4.7)}1k if("29"in 4){4.1p=29(4.29);if(4.3K===1h){4.3K=5(1C){11{id:$.4W(1C),1j:$.4W(1C)}}}if(4.1T===1h){4.1T=5(12,1V){14 7=[];$(6Z(12.19(),4.3e,4.6P)).2j(5(){14 5X={id:3,1j:3},29=4.29;if($.2N(29))29=29();$(29).2j(5(){if(2s(3.id,5X.id)){5X=3;11 1e}});7.1Q(5X)});1V(7)}}}}}if(3i(4.1p)!=="5"){3b"1p 5 2g 7N 1N 4m "+4.12.1f("id")}if(4.3Q===\'23\'){4.3Q=5(5u,2J){5u.nb(2J)}}1k if(4.3Q===\'6e\'){4.3Q=5(5u,2J){5u.1Q(2J)}}1k if(3i(4.3Q)!=="5"){3b"nc 3Q 3W 8y be \'23\', \'6e\' or a nh 5"}11 4},9k:5(){14 el=3.4.12,6t,1c=3;el.on("2W.6",3.1w(5(e){if(3.4.12.7("6-2W-87")!==1l){3.1T()}}));3.42=3.1w(5(){14 1B=el.24("1B");if(1B===1h)1B=1e;3.5a(!1B);14 2q=el.24("2q");if(2q===1h)2q=1e;3.2q(2q);if(3.1a){5l(3.1a,3.4.12,3.4.7E);3.1a.1v(2b(3.4.7l,3.4.12))}if(3.1i){5l(3.1i,3.4.12,3.4.7D);3.1i.1v(2b(3.4.7k,3.4.12))}});if(el.1d&&el[0].9s){el.2j(5(){3.9s("8Q",1c.42)})}6t=1J.ng||1J.nf||1J.nd;if(6t!==1h){if(3.3I){9V 3.3I;3.3I=1o}3.3I=3q 6t(5(8T){$.2j(8T,1c.42)});3.3I.ne(el.2r(0),{mz:1l,my:1e})}},8m:5(7){14 2U=$.2x("6-lT",{19:3.id(7),a5:7,1g:7});3.4.12.1L(2U);11!2U.6M()},1G:5(4N){4N=4N||{};4N=$.3a({},4N,{2o:"2W",19:3.19()});3.4.12.7("6-2W-87",1l);3.4.12.1L(4N);3.4.12.7("6-2W-87",1e);3.4.12.3n();if(3.4.ab)3.4.12.3v()},2B:5(){11 3.8l===1l},4l:5(){14 2n=3.6f&&!3.6q,1B=!2n;if(2n===3.8l)11 1e;3.1a.6b("6-1a-1B",1B);3.1D();3.8l=2n;11 1l},5a:5(2n){if(2n===1h)2n=1l;if(3.6f===2n)11;3.6f=2n;3.4.12.24("1B",!2n);3.4l()},a6:5(){3.5a(1e)},2q:5(2n){if(2n===1h)2n=1e;if(3.6q===2n)11;3.6q=2n;3.4.12.24("2q",2n);3.4l()},22:5(){11(3.1a)?3.1a.2y("6-1i-2l"):1e},3L:5(){14 $1i=3.1i,1a=3.1a,1I=1a.1I(),3l=1a.3D(1e),1r=1a.2I(1e),52=$1i.3D(1e),$1J=$(1J),7i=$1J.1r(),7f=$1J.3l(),60=$1J.9g()+7i,77=$1J.2K()+7f,5I=1I.23+3l,4X=1I.2Q,8d=5I+52<=77,8e=(1I.23-52)>=$1J.2K(),3C=$1i.2I(1e),8X=5(){11 4X+3C<=60},9c=5(){11 1I.2Q+60+1a.2I(1e)>3C},98=$1i.2y("6-1R-2C"),6a,2C,5Z,1Y,6n;if(98){2C=1l;if(!8e&&8d){5Z=1l;2C=1e}}1k{2C=1e;if(!8d&&8e){5Z=1l;2C=1l}}if(5Z){$1i.4q();1I=3.1a.1I();3l=3.1a.3D(1e);1r=3.1a.2I(1e);52=$1i.3D(1e);60=$1J.9g()+7i;77=$1J.2K()+7f;5I=1I.23+3l;4X=1I.2Q;3C=$1i.2I(1e);$1i.4U();3.4w()}if(3.4.lU){6n=$(\'.6-1b\',$1i)[0];$1i.1v(\'6-1R-4Z-1r\');$1i.1Y(\'1r\',\'\');3C=$1i.2I(1e)+(6n.7a===6n.8S?0:68.1r);3C>1r?1r=3C:3C=1r;52=$1i.3D(1e)}1k{3.1a.1W(\'6-1R-4Z-1r\')}if(3.2V.1Y(\'8U\')!==\'lS\'){6a=3.2V.1I();5I-=6a.23;4X-=6a.2Q}if(!8X()&&9c()){4X=1I.2Q+3.1a.2I(1e)-3C}1Y={2Q:4X,1r:1r};if(2C){1Y.23=1I.23-52;1Y.6e=\'4Z\';3.1a.1v("6-1R-2C");$1i.1v("6-1R-2C")}1k{1Y.23=5I;1Y.6e=\'4Z\';3.1a.1W("6-1R-2C");$1i.1W("6-1R-2C")}1Y=$.3a(1Y,2b(3.4.ai,3.4.12));$1i.1Y(1Y)},9e:5(){14 2p;if(3.22())11 1e;if(3.6f===1e||3.6q===1l)11 1e;2p=$.2x("6-4a");3.4.12.1L(2p);11!2p.6M()},7K:5(){3.1a.1W("6-1R-2C");3.1i.1W("6-1R-2C")},2l:5(){if(!3.9e())11 1e;3.4a();$1X.on("5f.8O",5(e){6s.x=e.9d;6s.y=e.9i});11 1l},4a:5(){14 3G=3.7A,3y="3y."+3G,50="50."+3G,6m="8p."+3G,2i;3.1a.1v("6-1i-2l").1v("6-1a-1S");3.7K();if(3.1i[0]!==3.2V.1F().6j()[0]){3.1i.aC().4T(3.2V)}2i=$("#6-1R-2i");if(2i.1d===0){2i=$(1X.5v("1U"));2i.1f("id","6-1R-2i").1f("1t","6-1R-2i");2i.4q();2i.4T(3.2V);2i.on("4B 4k 3n",5(e){7g(2i);14 1i=$("#6-1R"),1c;if(1i.1d>0){1c=1i.7("6");if(1c.4.7C){1c.3t({4n:1l})}1c.1D();e.5Q();e.4Q()}})}if(3.1i.3m()[0]!==2i[0]){3.1i.6u(2i)}$("#6-1R").7J("id");3.1i.1f("id","6-1R");2i.4U();3.3L();3.1i.4U();3.3L();3.1i.1v("6-1R-1S");14 7j=3;3.1a.8x().8z(1J).2j(5(){$(3).on(50+" "+3y+" "+6m,5(e){if(7j.22())7j.3L()})})},1D:5(){if(!3.22())11;14 3G=3.7A,3y="3y."+3G,50="50."+3G,6m="8p."+3G;3.1a.8x().8z(1J).2j(5(){$(3).2O(3y).2O(50).2O(6m)});3.7K();$("#6-1R-2i").4q();3.1i.7J("id");3.1i.4q();3.1a.1W("6-1i-2l").1W("6-1a-1S");3.1b.67();$1X.2O("5f.8O");3.2v();3.15.1W("6-1S");3.4.12.1L($.2x("6-1D"))},a1:5(1C){3.2l();3.15.19(1C);3.3V(1e)},2v:5(){},6S:5(){11 2b(3.4.a2,3.4.12)},8G:5(){14 1b=3.1b,1F,1E,5H,hb,5U,y,20,5W;1E=3.2R();if(1E<0)11;if(1E==0){1b.2K(0);11}1F=3.41().1u(\'.6-1y-1P\');5H=$(1F[1E]);5W=(5H.1I()||{}).23||0;hb=5W+5H.3D(1l);if(1E===1F.1d-1){20=1b.1u("li.6-20-1b");if(20.1d>0){hb=20.1I().23+20.3D(1l)}}5U=1b.1I().23+1b.3D(1e);if(hb>5U){1b.2K(1b.2K()+(hb-5U))}y=5W-1b.1I().23;if(y<0&&5H.1Y(\'62\')!=\'65\'){1b.2K(1b.2K()+y)}},41:5(){11 3.1b.1u(".6-1y-2S:2g(.6-1B):2g(.6-1n)")},8b:5(7t){14 2f=3.41(),1E=3.2R();6N(1E>-1&&1E<2f.1d){1E+=7t;14 1g=$(2f[1E]);if(1g.2y("6-1y-2S")&&!1g.2y("6-1B")&&!1g.2y("6-1n")){3.2R(1E);54}}},2R:5(1E){14 2f=3.41(),1g,7;if(1K.1d===0){11 2m(2f.4O(".6-3E")[0],2f.2r())}if(1E>=2f.1d)1E=2f.1d-1;if(1E<0)1E=0;3.5N();1g=$(2f[1E]);1g.1v("6-3E");3.15.1f("4b-lR",1g.1u(".6-1y-1P").1f("id"));3.8G();3.2Z.1j(1g.1j());7=1g.7("6-7");if(7){3.4.12.1L({2o:"6-2R",19:3.id(7),1g:7})}},5N:5(){3.1b.1u(".6-3E").1W("6-3E")},aw:5(){3.7y=1l},7I:5(){3.7y=1e},az:5(){11 3.41().1d},5K:5(2p){14 el=$(2p.4C).5e(".6-1y-2S");if(el.1d>0&&!el.is(".6-3E")){14 2f=3.41();3.2R(2f.1E(el))}1k if(el.1d==0){3.5N()}},5V:5(){14 1b=3.1b,20=1b.1u("li.6-20-1b"),7s,2M=3.4h+1,1c=3,1C=3.15.19(),21=3.21;if(20.1d===0)11;7s=20.1I().23-1b.1I().23-1b.3l();if(7s<=3.4.aG){20.1v("6-1S");3.4.1p({12:3.4.12,1C:1C,2M:2M,21:21,30:3.4.30,1V:3.1w(5(7){if(!1c.22())11;1c.4.7p.1Z(3,1b,7.1b,{1C:1C,2M:2M,21:21});1c.4x(7,1e,1e);if(7.20===1l){20.aC().4T(1b).3w(1c.4.2a(2b(1c.4.5q,1c.4.12,2M+1)));1J.51(5(){1c.5V()},10)}1k{20.3r()}1c.3L();1c.4h=2M;1c.21=7.21;3.4.12.1L({2o:"6-aF",aI:7})})})}},8a:5(){},3V:5(3z){14 15=3.15,1b=3.1b,4=3.4,7,1c=3,1z,1C=15.19(),7u=$.7(3.1a,"6-6j-1C"),7r;if(3z!==1l&&7u&&2s(1C,7u))11;$.7(3.1a,"6-6j-1C",1C);if(3z!==1l&&(3.3g===1e||!3.22())){11}5 7x(){15.1W("6-1S");1c.3L();if(1b.1u(\'.6-no-1b,.6-1q-53,.6-aK\').1d){1c.2Z.1j(1b.1j())}1k{1c.2Z.1j(1c.4.8o(1b.1u(\'.6-1y-2S:2g(".6-1n")\').1d))}}5 3A(3w){1b.3w(3w);7x()}7r=++3.7q;14 5T=3.6S();if(5T>=1){7=3.7();if($.5S(7)&&7.1d>=5T&&3N(4.6l,"6l")){3A("<li 1t=\'6-1q-53\'>"+2b(4.6l,4.12,5T)+"</li>");11}}if(15.19().1d<4.7G){if(3N(4.6V,"6V")){3A("<li 1t=\'6-no-1b\'>"+2b(4.6V,4.12,15.19(),4.7G)+"</li>")}1k{3A("")}if(3z&&3.4g)3.4g(1l);11}if(4.4Y&&15.19().1d>4.4Y){if(3N(4.6w,"6w")){3A("<li 1t=\'6-no-1b\'>"+2b(4.6w,4.12,15.19(),4.4Y)+"</li>")}1k{3A("")}11}if(4.71&&3.41().1d===0){3A("<li 1t=\'6-aK\'>"+2b(4.71,4.12)+"</li>")}15.1v("6-1S");3.5N();1z=3.8a();if(1z!=1h&&1z!=1o){15.19(1z)}3.4h=1;4.1p({12:4.12,1C:15.19(),2M:3.4h,21:1o,30:4.30,1V:3.1w(5(7){14 3T;if(7r!=3.7q){11}if(!3.22()){3.15.1W("6-1S");11}if(7.aB!==1h&&3N(4.6Q,"6Q")){3A("<li 1t=\'6-2Y-9y\'>"+2b(4.6Q,4.12,7.5d,7.5b,7.58)+"</li>");11}3.21=(7.21===1h)?1o:7.21;if(3.4.3K&&15.19()!==""){3T=3.4.3K.1Z(1c,15.19(),7.1b);if(3T!==1h&&3T!==1o&&1c.id(3T)!==1h&&1c.id(3T)!==1o){if($(7.1b).4O(5(){11 2s(1c.id(3),1c.id(3T))}).1d===0){3.4.3Q(7.1b,3T)}}}if(7.1b.1d===0&&3N(4.4u,"4u")){3A("<li 1t=\'6-no-1b\'>"+2b(4.4u,4.12,15.19())+"</li>");11}1b.67();1c.4.7p.1Z(3,1b,7.1b,{1C:15.19(),2M:3.4h,21:1o});if(7.20===1l&&3N(4.5q,"5q")){1b.48("<li 1t=\'6-20-1b\'>"+4.2a(2b(4.5q,4.12,3.4h))+"</li>");1J.51(5(){1c.5V()},10)}3.4x(7,3z);7x();3.4.12.1L({2o:"6-aF",aI:7})})})},4G:5(){3.1D()},3v:5(){if(3.4.7C)3.3t({4n:1l});3.1D();3.1a.1W("6-1a-1S");if(3.15[0]===1X.69){3.15.3v()}3.2v();3.1q.1u(".6-15-1g-1s").1W("6-15-1g-1s")},4w:5(){1s(3.15)},3t:5(1H){if(3.7y){3.7I();11}14 1E=3.2R(),3E=3.1b.1u(".6-3E"),7=3E.5e(\'.6-1y\').7("6-7");if(7){3.2R(1E);3.6W(7,1H)}1k if(1H&&1H.4n){3.1D()}},3Y:5(){14 2e;11 3.4.12.1f("2k")||3.4.12.1f("7-2k")||3.4.12.7("2k")||3.4.2k||((2e=3.4f())!==1h?2e.1j():1h)},4f:5(){if(3.1A){14 5n=3.1A.1F(\'3W\').6h();if(3.4.2e!==1h){11(3.4.2e==="6h"&&5n)||(3i 3.4.2e==="5"&&3.4.2e(3.1A))}1k if($.4W(5n.1j())===""&&5n.19()===""){11 5n}}},8n:5(){5 aP(){14 2c,6v,2z,i,l,1f;if(3.4.1r==="2O"){11 1o}1k if(3.4.1r==="12"){11 3.4.12.2I(1e)===0?\'4Z\':3.4.12.2I(1e)+\'px\'}1k if(3.4.1r==="8t"||3.4.1r==="aM"){2c=3.4.12.1f(\'2c\');if(2c!==1h){6v=2c.5O(\';\');1N(i=0,l=6v.1d;i<l;i=i+1){1f=6v[i].5i(/\\s/g,\'\');2z=1f.26(/^1r:(([-+]?([0-9]*\\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i);if(2z!==1o&&2z.1d>=1)11 2z[1]}}if(3.4.1r==="aM"){2c=3.4.12.1Y(\'1r\');if(2c.2m("%")>0)11 2c;11(3.4.12.2I(1e)===0?\'4Z\':3.4.12.2I(1e)+\'px\')}11 1o}1k if($.2N(3.4.1r)){11 3.4.1r()}1k{11 3.4.1r}};14 1r=aP.1Z(3);if(1r!==1o){3.1a.1Y("1r",1r)}}});7R=61(5C,{74:5(){14 1a=$(1X.5v("1U")).1f({"1t":"6-1a"}).3w(["<a 9z=\'lP:lQ(0)\' 1t=\'6-1g\' 3R=\'-1\'>"," <45 1t=\'6-4e\'>&#lV;</45><72 1t=\'6-15-1g-1D\'></72>"," <45 1t=\'6-9K\' 3H=\'7z\'><b 3H=\'7z\'></b></45>","</a>","<1P 1N=\'\' 1t=\'6-5D\'></1P>","<1z 1t=\'6-1M 6-5D\' 2o=\'1j\' 4b-lW=\'1l\' 3H=\'m1\' />","<1U 1t=\'6-1R 6-62-65\'>"," <1U 1t=\'6-15\'>"," <1P 1N=\'\' 1t=\'6-5D\'></1P>"," <1z 2o=\'1j\' 8g=\'2O\' aN=\'2O\' aQ=\'2O\' 9R=\'1e\' 1t=\'6-1z\' 3H=\'m0\' 4b-lZ=\'1l\'"," 4b-8g=\'5u\' />"," </1U>"," <3S 1t=\'6-1b\' 3H=\'lX\'>"," </3S>","</1U>"].5p(""));11 1a},4l:5(){if(3.2w.4l.2h(3,1K)){3.1M.24("1B",!3.2B())}},4a:5(){14 el,3Z,66;if(3.4.4z>=0){3.4g(1l)}3.2w.4a.2h(3,1K);if(3.3g!==1e){3.15.19(3.1M.19())}if(3.4.3M(3)){3.15.1s();el=3.15.2r(0);if(el.64){3Z=el.64();3Z.aA(1e);3Z.1A()}1k if(el.63){66=3.15.19().1d;el.63(66,66)}}if(3.15.19()===""){if(3.2t!=1h){3.15.19(3.2t);3.15.1A()}}3.1M.24("1B",1l).19("");3.3V(1l);3.4.12.1L($.2x("6-2l"))},1D:5(){if(!3.22())11;3.2w.1D.2h(3,1K);3.1M.24("1B",1e);if(3.4.3M(3)){3.1M.1s()}},1s:5(){if(3.22()){3.1D()}1k{3.1M.24("1B",1e);if(3.4.3M(3)){3.1M.1s()}}},6x:5(){11 3.1a.2y("6-1a-1S")},4G:5(){3.2w.4G.2h(3,1K);3.1M.24("1B",1e);if(3.4.3M(3)){3.1M.1s()}},4d:5(){$("1P[1N=\'"+3.1M.1f(\'id\')+"\']").1f(\'1N\',3.4.12.1f("id"));3.2w.4d.2h(3,1K);6p.1Z(3,"1q","1M")},7U:5(){14 1q,1a=3.1a,1i=3.1i,4V=4A(),6d;if(3.4.4z<0){3.4g(1e)}1k{3.4g(1l)}3.1q=1q=1a.1u(".6-1g");3.1M=1a.1u(".6-1M");1q.1u(".6-4e").1f("id","6-4e-"+4V);3.1M.1f("4b-lY","6-4e-"+4V);3.1b.1f("id","6-1b-"+4V);3.15.1f("4b-lO","6-1b-"+4V);3.1M.1f("id","9S"+4V);6d=$("1P[1N=\'"+3.4.12.1f("id")+"\']");3.4.12.1s(3.1w(5(){3.1s()}));3.1M.3m().1j(6d.1j()).1f(\'1N\',3.1M.1f(\'id\'));14 aD=3.4.12.1f("6c");3.4.12.1f("6c",(aD||6d.1j()));3.1M.1f("3R",3.55);3.15.1f("id",3.1M.1f(\'id\')+\'lN\');3.15.3m().1j($("1P[1N=\'"+3.1M.1f(\'id\')+"\']").1j()).1f(\'1N\',3.15.1f(\'id\'));3.15.on("6o",3.1w(5(e){if(!3.2B())11;if(lD==e.lE)11;if(e.1x===1m.82||e.1x===1m.86){1O(e);11}6k(e.1x){2d 1m.4t:2d 1m.5j:3.8b((e.1x===1m.4t)?-1:1);1O(e);11;2d 1m.3u:3.3t();1O(e);11;2d 1m.5h:3.3t({4n:1l});11;2d 1m.5m:3.4G(e);1O(e);11}}));3.15.on("3v",3.1w(5(e){if(1X.69===3.2V.2r(0)){1J.51(3.1w(5(){if(3.22()){3.15.1s()}}),0)}}));3.1M.on("6o",3.1w(5(e){if(!3.2B())11;if(e.1x===1m.5h||1m.7W(e)||1m.84(e)||e.1x===1m.5m){11}if(3.4.6Y===1e&&e.1x===1m.3u){1O(e);11}if(e.1x==1m.5j||e.1x==1m.4t||(e.1x==1m.3u&&3.4.6Y)){if(e.9X||e.9W||e.9U||e.7Y)11;3.2l();1O(e);11}if(e.1x==1m.6i||e.1x==1m.4D){if(3.4.aJ){3.5s()}1O(e);11}}));75(3.1M);3.1M.on("4F-2W 1z",3.1w(5(e){if(3.4.4z>=0){e.4Q();if(3.22())11;3.2l()}}));1q.on("4B 4k","72",3.1w(5(e){if(!3.2B()){11}3.5s();aH(e);3.1D();if(3.1q){3.1q.1s()}}));1q.on("4B 4k",3.1w(5(e){7g(1q);if(!3.1a.2y("6-1a-1S")){3.4.12.1L($.2x("6-1s"))}if(3.22()){3.1D()}1k if(3.2B()){3.2l()}1O(e)}));1i.on("4B 4k",3.1w(5(){if(3.4.3M(3)){3.15.1s()}}));1q.on("1s",3.1w(5(e){1O(e)}));3.1M.on("1s",3.1w(5(){if(!3.1a.2y("6-1a-1S")){3.4.12.1L($.2x("6-1s"))}3.1a.1v("6-1a-1S")})).on("3v",3.1w(5(){if(!3.22()){3.1a.1W("6-1a-1S");3.4.12.1L($.2x("6-3v"))}}));3.15.on("1s",3.1w(5(){if(!3.1a.2y("6-1a-1S")){3.4.12.1L($.2x("6-1s"))}3.1a.1v("6-1a-1S")}));3.8n();3.4.12.4q();3.4r()},5s:5(1G){14 7=3.1q.7("6-7");if(7){14 2U=$.2x("6-lC");3.4.12.1L(2U);if(2U.6M()){11}14 2e=3.4f();3.4.12.19(2e?2e.19():"");3.1q.1u(".6-4e").67();3.1q.7e("6-7");3.4r();if(1G!==1e){3.4.12.1L({2o:"6-3h",19:3.id(7),1g:7});3.1G({3h:7})}}},1T:5(){14 1n;if(3.78()){3.2u(1o);3.1D();3.4r()}1k{14 1c=3;3.4.1T.1Z(1o,3.4.12,5(1n){if(1n!==1h&&1n!==1o){1c.2u(1n);1c.1D();1c.4r();1c.2t=1c.4.2t(1n,1c.15.19())}})}},78:5(){14 2e;if(3.3Y()===1h)11 1e;11((2e=3.4f())!==1h&&2e.24("1n"))||(3.4.12.19()==="")||(3.4.12.19()===1h)||(3.4.12.19()===1o)},4M:5(){14 4=3.2w.4M.2h(3,1K),1c=3;if(4.12.2r(0).6D.6C()==="1A"){4.1T=5(12,1V){14 1n=12.1u("3W").4O(5(){11 3.1n&&!3.1B});1V(1c.4L(1n))}}1k if("7"in 4){4.1T=4.1T||5(12,1V){14 id=12.19();14 26=1o;4.1p({30:5(1C,1j,el){14 4K=2s(id,4.id(el));if(4K){26=el}11 4K},1V:!$.2N(1V)?$.9P:5(){1V(26)}})}}11 4},3Y:5(){if(3.1A){if(3.4f()===1h){11 1h}}11 3.2w.3Y.2h(3,1K)},4r:5(){14 2k=3.3Y();if(3.78()&&2k!==1h){if(3.1A&&3.4f()===1h)11;3.1q.1u(".6-4e").3w(3.4.2a(2k));3.1q.1v("6-5A");3.1a.1W("6-aO")}},4x:5(7,3z,6I){14 1n=0,1c=3,3g=1l;3.41().2D(5(i,3j){if(2s(1c.id(3j.7("6-7")),1c.4.12.19())){1n=i;11 1e}});if(6I!==1e){if(3z===1l&&1n>=0){3.2R(1n)}1k{3.2R(0)}}if(3z===1l){14 5E=3.4.4z;if(5E>=0){3.4g(7h(7.1b)>=5E)}}},4g:5(3g){if(3.3g===3g)11;3.3g=3g;3.1i.1u(".6-15").6b("6-15-6J",!3g);3.1i.1u(".6-15").6b("6-5D",!3g);$(3.1i,3.1a).6b("6-7Z-lB",3g)},6W:5(7,1H){if(!3.8m(7)){11}14 2H=3.4.12.19(),2T=3.7();3.4.12.19(3.id(7));3.2u(7);3.4.12.1L({2o:"6-1n",19:3.id(7),1g:7});3.2t=3.4.2t(7,3.15.19());3.1D();if((!1H||!1H.4n)&&3.4.3M(3)){3.1M.1s()}if(!2s(2H,3.id(7))){3.1G({44:7,3h:2T})}},2u:5(7){14 1a=3.1q.1u(".6-4e"),2P,3P;3.1q.7("6-7",7);1a.67();if(7!==1o){2P=3.4.7H(7,1a,3.4.2a)}if(2P!==1h){1a.48(2P)}3P=3.4.7L(7,1a);if(3P!==1h){1a.1v(3P)}3.1q.1W("6-5A");if(3.4.aJ&&3.3Y()!==1h){3.1a.1v("6-aO")}},19:5(){14 19,1G=1e,7=1o,1c=3,2T=3.7();if(1K.1d===0){11 3.4.12.19()}19=1K[0];if(1K.1d>1){1G=1K[1]}if(3.1A){3.1A.19(19).1u("3W").4O(5(){11 3.1n}).2D(5(i,3j){7=1c.4L(3j);11 1e});3.2u(7);3.4r();if(1G){3.1G({44:7,3h:2T})}}1k{if(!19&&19!==0){3.5s(1G);11}if(3.4.1T===1h){3b 3q 5z("ah 1Z 19() if 1T() is 2g 7N")}3.4.12.19(19);3.4.1T(3.4.12,5(7){1c.4.12.19(!7?"":1c.id(7));1c.2u(7);1c.4r();if(1G){1c.1G({44:7,3h:2T})}})}},2v:5(){3.15.19("");3.1M.19("")},7:5(25){14 7,1G=1e;if(1K.1d===0){7=3.1q.7("6-7");if(7==1h)7=1o;11 7}1k{if(1K.1d>1){1G=1K[1]}if(!25){3.5s(1G)}1k{7=3.7();3.4.12.19(!25?"":3.id(25));3.2u(25);if(1G){3.1G({44:25,3h:7})}}}}});79=61(5C,{74:5(){14 1a=$(1X.5v("1U")).1f({"1t":"6-1a 6-1a-6T"}).3w(["<3S 1t=\'6-2f\'>"," <li 1t=\'6-15-9O\'>"," <1P 1N=\'\' 1t=\'6-5D\'></1P>"," <1z 2o=\'1j\' 8g=\'2O\' aN=\'2O\' aQ=\'2O\' 9R=\'1e\' 1t=\'6-1z\'>"," </li>","</3S>","<1U 1t=\'6-1R 6-1R-6T 6-62-65\'>"," <3S 1t=\'6-1b\'>"," </3S>","</1U>"].5p(""));11 1a},4M:5(){14 4=3.2w.4M.2h(3,1K),1c=3;if(4.12.2r(0).6D.6C()==="1A"){4.1T=5(12,1V){14 7=[];12.1u("3W").4O(5(){11 3.1n&&!3.1B}).2D(5(i,3j){7.1Q(1c.4L(3j))});1V(7)}}1k if("7"in 4){4.1T=4.1T||5(12,1V){14 2G=6Z(12.19(),4.3e,4.6P);14 2z=[];4.1p({30:5(1C,1j,el){14 4K=$.lz(2G,5(id){11 2s(id,4.id(el))}).1d;if(4K){2z.1Q(el)}11 4K},1V:!$.2N(1V)?$.9P:5(){14 88=[];1N(14 i=0;i<2G.1d;i++){14 id=2G[i];1N(14 j=0;j<2z.1d;j++){14 26=2z[j];if(2s(id,4.id(26))){88.1Q(26);2z.6R(j,1);54}}}1V(88)}})}}11 4},4j:5(1g){14 1n=3.1a.1u(".6-15-1g-1s");if(1n.1d&&1g&&1g[0]==1n[0]){}1k{if(1n.1d){3.4.12.1L("1g-lA",1n)}1n.1W("6-15-1g-1s");if(1g&&1g.1d){3.1D();1g.1v("6-15-1g-1s");3.4.12.1L("1g-1n",1g)}}},4d:5(){$("1P[1N=\'"+3.15.1f(\'id\')+"\']").1f(\'1N\',3.4.12.1f("id"));3.2w.4d.2h(3,1K);6p.1Z(3,"43","1q")},7U:5(){14 5P=".6-2f",1q;3.43=3.1a.1u(".6-15-9O");3.1q=1q=3.1a.1u(5P);14 7V=3;3.1q.on("3n",".6-1a:2g(.6-1a-1B) .6-15-1g:2g(.6-3k)",5(e){7V.15[0].1s();7V.4j($(3))});3.15.1f("id","9S"+4A());3.15.3m().1j($("1P[1N=\'"+3.4.12.1f("id")+"\']").1j()).1f(\'1N\',3.15.1f(\'id\'));3.4.12.1s(3.1w(5(){3.1s()}));3.15.on("1z 9T",3.1w(5(){if(3.15.1f(\'2k\')&&3.15.19().1d==0)11;if(!3.2B())11;if(!3.22()){3.2l()}}));3.15.1f("3R",3.55);3.5M=0;3.15.on("6o",3.1w(5(e){if(!3.2B())11;++3.5M;14 1n=1q.1u(".6-15-1g-1s");14 3m=1n.3m(".6-15-1g:2g(.6-3k)");14 4s=1n.4s(".6-15-1g:2g(.6-3k)");14 4J=9Y(3.15);if(1n.1d&&(e.1x==1m.5o||e.1x==1m.5Y||e.1x==1m.4D||e.1x==1m.6i||e.1x==1m.3u)){14 3s=1n;if(e.1x==1m.5o&&3m.1d){3s=3m}1k if(e.1x==1m.5Y){3s=4s.1d?4s:1o}1k if(e.1x===1m.4D){if(3.6B(1n.6h())){3.15.1r(10);3s=3m.1d?3m:4s}}1k if(e.1x==1m.6i){if(3.6B(1n.6h())){3.15.1r(10);3s=4s.1d?4s:1o}}1k if(e.1x==1m.3u){3s=1o}3.4j(3s);1O(e);if(!3s||!3s.1d){3.2l()}11}1k if(((e.1x===1m.4D&&3.5M==1)||e.1x==1m.5o)&&(4J.1I==0&&!4J.1d)){3.4j(1q.1u(".6-15-1g:2g(.6-3k)").6j());1O(e);11}1k{3.4j(1o)}if(3.22()){6k(e.1x){2d 1m.4t:2d 1m.5j:3.8b((e.1x===1m.4t)?-1:1);1O(e);11;2d 1m.3u:3.3t();1O(e);11;2d 1m.5h:3.3t({4n:1l});3.1D();11;2d 1m.5m:3.4G(e);1O(e);11}}if(e.1x===1m.5h||1m.7W(e)||1m.84(e)||e.1x===1m.4D||e.1x===1m.5m){11}if(e.1x===1m.3u){if(3.4.6Y===1e){11}1k if(e.9X||e.9W||e.9U||e.7Y){11}}3.2l();if(e.1x===1m.82||e.1x===1m.86){1O(e)}if(e.1x===1m.3u){1O(e)}}));3.15.on("4F",3.1w(5(e){3.5M=0;3.5x()}));3.15.on("3v",3.1w(5(e){3.1a.1W("6-1a-1S");3.15.1W("6-5y");3.4j(1o);if(!3.22())3.2v();e.9M();3.4.12.1L($.2x("6-3v"))}));3.1a.on("3n",5P,3.1w(5(e){if(!3.2B())11;if($(e.4C).5e(".6-15-1g").1d>0){11}3.4j(1o);3.5L();if(!3.1a.2y("6-1a-1S")){3.4.12.1L($.2x("6-1s"))}3.2l();3.4w();e.5Q()}));3.1a.on("1s",5P,3.1w(5(){if(!3.2B())11;if(!3.1a.2y("6-1a-1S")){3.4.12.1L($.2x("6-1s"))}3.1a.1v("6-1a-1S");3.1i.1v("6-1R-1S");3.5L()}));3.8n();3.4.12.4q();3.2v()},4l:5(){if(3.2w.4l.2h(3,1K)){3.15.24("1B",!3.2B())}},1T:5(){14 7;if(3.4.12.19()===""&&3.4.12.1j()===""){3.2u([]);3.1D();3.2v()}if(3.1A||3.4.12.19()!==""){14 1c=3;3.4.1T.1Z(1o,3.4.12,5(7){if(7!==1h&&7!==1o){1c.2u(7);1c.1D();1c.2v()}})}},2v:5(){14 2k=3.3Y(),3U=3.9Z();if(2k!==1h&&3.4S().1d===0&&3.15.2y("6-5y")===1e){3.15.19(2k).1v("6-5A");3.15.1r(3U>0?3U:3.1a.1Y("1r"))}1k{3.15.19("").1r(10)}},5L:5(){if(3.15.2y("6-5A")){3.15.19("").1W("6-5A")}},4a:5(){3.5L();3.5x();3.2w.4a.2h(3,1K);3.4w();if(3.15.19()===""){if(3.2t!=1h){3.15.19(3.2t);3.15.1A()}}3.3V(1l);if(3.4.3M(3)){3.15.1s()}3.4.12.1L($.2x("6-2l"))},1D:5(){if(!3.22())11;3.2w.1D.2h(3,1K)},1s:5(){3.1D();3.15.1s()},6x:5(){11 3.15.2y("6-5y")},2u:5(7){14 2G=[],2X=[],1c=3;$(7).2j(5(){if(2m(1c.id(3),2G)<0){2G.1Q(1c.id(3));2X.1Q(3)}});7=2X;3.1q.1u(".6-15-1g").3r();$(7).2j(5(){1c.7S(3)});1c.4x()},8a:5(){14 1z=3.15.19();1z=3.4.a9.1Z(3,1z,3.7(),3.1w(3.6W),3.4);if(1z!=1o&&1z!=1h){3.15.19(1z);if(1z.1d>0){3.2l()}}},6W:5(7,1H){if(!3.8m(7)||7.1j===""){11}3.7S(7);3.4.12.1L({2o:"1n",19:3.id(7),1g:7});3.2t=3.4.2t(7,3.15.19());3.2v();3.3V();if(3.1A||!3.4.5B)3.4x(7,1e,3.4.5B===1l);if(3.4.5B){3.1D();3.15.1r(10)}1k{if(3.az()>0){3.15.1r(10);3.5x();if(3.6S()>0&&3.19().1d>=3.6S()){3.3V(1l)}1k{if(3.2t!=1h){3.15.19(3.2t);3.3V();3.15.1A()}}3.3L()}1k{3.1D();3.15.1r(10)}}3.1G({44:7});if(!1H||!1H.4n)3.4w()},4G:5(){3.1D();3.4w()},7S:5(7){14 81=!7.3k,9A=$("<li 1t=\'6-15-1g\'>"+" <1U></1U>"+" <a 9z=\'#\' 1t=\'6-15-1g-1D\' 3R=\'-1\'></a>"+"</li>"),9E=$("<li 1t=\'6-15-1g 6-3k\'>"+"<1U></1U>"+"</li>");14 1g=81?9A:9E,id=3.id(7),19=3.4S(),2P,3P;2P=3.4.7H(7,1g.1u("1U"),3.4.2a);if(2P!=1h){1g.1u("1U").lF($("<1U></1U>").3w(2P))}3P=3.4.7L(7,1g.1u("1U"));if(3P!=1h){1g.1v(3P)}if(81){1g.1u(".6-15-1g-1D").on("4B",1O).on("3n lG",3.1w(5(e){if(!3.2B())11;3.6B($(e.4C));3.1q.1u(".6-15-1g-1s").1W("6-15-1g-1s");1O(e);3.1D();3.4w()})).on("1s",3.1w(5(){if(!3.2B())11;3.1a.1v("6-1a-1S");3.1i.1v("6-1R-1S")}))}1g.7("6-7",7);1g.lL(3.43);19.1Q(id);3.4c(19)},6B:5(1n){14 19=3.4S(),7,1E;1n=1n.5e(".6-15-1g");if(1n.1d===0){3b"al lM: "+1n+". lK be .6-15-1g"}7=1n.7("6-7");if(!7){11}14 2U=$.2x("6-lJ");2U.19=3.id(7);2U.1g=7;3.4.12.1L(2U);if(2U.6M()){11 1e}6N((1E=2m(3.id(7),19))>=0){19.6R(1E,1);3.4c(19);if(3.1A)3.4x()}1n.3r();3.4.12.1L({2o:"6-3h",19:3.id(7),1g:7});3.1G({3h:7});11 1l},4x:5(7,3z,6I){14 19=3.4S(),2f=3.1b.1u(".6-1y"),4P=3.1b.1u(".6-1y-7Z-1F"),1c=3;2f.2D(5(i,1g){14 id=1c.id(1g.7("6-7"));if(2m(id,19)>=0){1g.1v("6-1n");1g.1u(".6-1y-2S").1v("6-1n")}});4P.2D(5(i,1g){if(!1g.is(\'.6-1y-2S\')&&1g.1u(".6-1y-2S:2g(.6-1n)").1d===0){1g.1v("6-1n")}});if(3.2R()==-1&&6I!==1e&&3.4.5B===1l){1c.2R(0)}if(!3.4.3K&&!2f.4O(\'.6-1y:2g(.6-1n)\').1d>0){if(!7||7&&!7.20&&3.1b.1u(".6-no-1b").1d===0){if(3N(1c.4.4u,"4u")){3.1b.48("<li 1t=\'6-no-1b\'>"+2b(1c.4.4u,1c.4.12,1c.15.19())+"</li>")}}}},9Z:5(){11 3.1q.1r()-7T(3.15)},5x:5(){14 6X,2Q,3U,8j,3x,70=7T(3.15);6X=a0(3.15)+10;2Q=3.15.1I().2Q;3U=3.1q.1r();8j=3.1q.1I().2Q;3x=3U-(2Q-8j)-70;if(3x<6X){3x=3U-70}if(3x<40){3x=3U-70}if(3x<=0){3x=6X}3.15.1r(lH.lI(3x))},4S:5(){14 19;if(3.1A){19=3.1A.19();11 19===1o?[]:19}1k{19=3.4.12.19();11 6Z(19,3.4.3e,3.4.6P)}},4c:5(19){14 4R;if(3.1A){3.1A.19(19)}1k{4R=[];$(19).2j(5(){if(2m(3,4R)<0)4R.1Q(3)});3.4.12.19(4R.1d===0?"":4R.5p(3.4.3e))}},6K:5(2H,49){14 49=49.59(0),2H=2H.59(0);1N(14 i=0;i<49.1d;i++){1N(14 j=0;j<2H.1d;j++){if(2s(3.4.id(49[i]),3.4.id(2H[j]))){49.6R(i,1);if(i>0){i--}2H.6R(j,1);j--}}}11{44:49,3h:2H}},19:5(19,1G){14 2T,1c=3;if(1K.1d===0){11 3.4S()}2T=3.7();if(!2T.1d)2T=[];if(!19&&19!==0){3.4.12.19("");3.2u([]);3.2v();if(1G){3.1G({44:3.7(),3h:2T})}11}3.4c(19);if(3.1A){3.4.1T(3.1A,3.1w(3.2u));if(1G){3.1G(3.6K(2T,3.7()))}}1k{if(3.4.1T===1h){3b 3q 5z("19() ah be m2 if 1T() is 2g 7N")}3.4.1T(3.4.12,5(7){14 2G=$.7M(7,1c.id);1c.4c(2G);1c.2u(7);1c.2v();if(1G){1c.1G(1c.6K(2T,1c.7()))}})}3.2v()},ac:5(){if(3.1A){3b 3q 5z("m3 of mp is 2g mq a4 a3 4I <1A>. mo 4I <1z 2o=\'6J\'/> mn.")}3.15.1r(0);3.43.4q()},a7:5(){14 19=[],1c=3;3.43.4U();3.43.4T(3.43.2w());3.5x();3.1q.1u(".6-15-1g").2j(5(){19.1Q(1c.4.id($(3).7("6-7")))});3.4c(19);3.1G()},7:5(5G,1G){14 1c=3,2G,2H;if(1K.1d===0){11 3.1q.1F(".6-15-1g").7M(5(){11 $(3).7("6-7")}).2r()}1k{2H=3.7();if(!5G){5G=[]}2G=$.7M(5G,5(e){11 1c.4.id(e)});3.4c(2G);3.2u(5G);3.2v();if(1G){3.1G(3.6K(2H,3.7()))}}}});$.fn.6=5(){14 28=9B.3J.59.1Z(1K,0),4,6,3p,25,3B,ar=["19","4d","22","2l","1D","1s","6x","1a","1i","ac","a7","5a","a6","2q","3L","7","15"],ap=["22","6x","1a","1i"],am=["19","7"],7m={15:"a1"};3.2j(5(){if(28.1d===0||3i(28[0])==="a5"){4=28.1d===0?{}:$.3a({},28[0]);4.12=$(3);if(4.12.2r(0).6D.6C()==="1A"){3B=4.12.24("3B")}1k{3B=4.3B||1e;if("29"in 4){4.3B=3B=1l}}6=3B?3q 1J.4m["1t"].6T():3q 1J.4m["1t"].9v();6.aq(4)}1k if(3i(28[0])==="4o"){if(2m(28[0],ar)<0){3b"mk 3p: "+28[0]}25=1h;6=$(3).7("6");if(6===1h)11;3p=28[0];if(3p==="1a"){25=6.1a}1k if(3p==="1i"){25=6.1i}1k{if(7m[3p])3p=7m[3p];25=6[3p].2h(6,28.59(1))}if(2m(28[0],ap)>=0||(2m(28[0],am)>=0&&28.1d==1)){11 1e}}1k{3b"al 1K 4I 6 ml: "+28}});11(25===1h)?3:25};$.fn.6.7b={1r:"8t",aG:0,5B:1l,6Y:1l,9H:{},ai:{},7l:"",7k:"",at:5(1y,1a,1p,2a){14 2L=[];6r(3.1j(1y),1p.1C,2L,2a);11 2L.5p("")},6P:5(19){11 $.4W(19)},7H:5(7,1a,2a){11 7?2a(3.1j(7)):1h},ag:5(1b,1a,1p){11 1b},af:5(7){11 7.1Y},7L:5(7,1a){11 1h},4z:0,7G:0,4Y:1o,a2:0,id:5(e){11 e==1h?1o:e.id},1j:5(e){if(e&&3.7&&3.7.1j){if($.2N(3.7.1j)){11 3.7.1j(e)}1k{11 e[3.7.1j]}}1k{11 e.1j}},30:5(1C,1j){11 4i(\'\'+1j).6L().2m(4i(\'\'+1C).6L())>=0},3e:",",57:[],a9:a8,2a:8k,ab:1e,7C:1e,7E:5(c){11 c},7D:5(c){11 1o},2t:5(mr,ms){11 1h},ad:\'\',3Q:\'23\',3M:5(ak){14 aj=((\'mx\'in 1J)||(mw.mv>0));if(!aj){11 1l}if(ak.4.4z<0){11 1e}11 1l}};$.fn.6.76=[];$.fn.6.76[\'en\']={8o:5(2z){if(2z===1){11"mt 1y is 9G, mu 9C 4I 1A it."}11 2z+" 1b mj 9G, 9I mi 9J m8 9K m9 4I m7."},4u:5(){11"m6 2z m4"},6Q:5(5d,5b,58){11"ax m5"},6V:5(1z,5E){14 n=5E-1z.1d;11"9L 9C "+n+" or 20 7X"+(n==1?"":"s")},6w:5(1z,9D){14 n=1z.1d-9D;11"9L 9V "+n+" 7X"+(n==1?"":"s")},6l:5(53){11"ma mb mg 1A "+53+" 2J"+(53==1?"":"s")},5q:5(mh){11"ax 20 mf��"},71:5(){11"me��"}};$.3a($.fn.6.7b,$.fn.6.76[\'en\']);$.fn.6.7F={5c:$.2Y,31:{2o:"aE",7n:1e,5J:"aR"}};1J.4m={1p:{2Y:2Y,5R:5R,29:29},mc:{6g:6g,6r:6r,2a:8k,4i:4i},"1t":{"md":5C,"9v":7R,"6T":79}}}(8F));',62,1684,'|||this|opts|function|select2|data||||||||||||||||||||||||||||||||||||||||||||||||||||||||return|element||var|search||||val|container|results|self|length|false|attr|choice|undefined|dropdown|text|else|true|KEY|selected|null|query|selection|width|focus|class|find|addClass|bind|which|result|input|select|disabled|term|close|index|children|triggerChange|options|offset|window|arguments|trigger|focusser|for|killEvent|label|push|drop|active|initSelection|div|callback|removeClass|document|css|call|more|context|opened|top|prop|value|match||args|tags|escapeMarkup|evaluate|style|case|placeholderOption|choices|not|apply|mask|each|placeholder|open|indexOf|enabled|type|event|readonly|get|equal|nextSearchTerm|updateSelection|clearSearch|parent|Event|hasClass|matches|datum|isInterfaceEnabled|above|each2|node|group|ids|old|outerWidth|item|scrollTop|markup|page|isFunction|off|formatted|left|highlight|selectable|oldData|evt|body|change|filtered|ajax|liveRegion|matcher|params|||||||||extend|throw|token|classes|separator|constructor|showSearchInput|removed|typeof|elm|locked|height|prev|click|url|method|new|remove|selectedChoice|selectHighlighted|ENTER|blur|html|searchWidth|scroll|initial|render|multiple|dropWidth|outerHeight|highlighted|sizer|cid|role|propertyObserver|prototype|createSearchChoice|positionDropdown|shouldFocusInput|checkFormatter|resultsSelector|cssClass|createSearchChoicePosition|tabindex|ul|def|maxWidth|updateResults|option|process|getPlaceholder|range||findHighlightableChoices|_sync|searchContainer|added|span|||append|current|opening|aria|setVal|destroy|chosen|getPlaceholderOption|showSearch|resultsPage|stripDiacritics|selectChoice|touchstart|enableInterface|Select2|noFocus|string|ajaxUrl|hide|setPlaceholder|next|UP|formatNoMatches|template|focusSearch|postprocessResults|timeout|minimumResultsForSearch|nextUid|mousedown|target|BACKSPACE|collection|keyup|cancel|autofocus|to|pos|is_match|optionToData|prepareOpts|details|filter|compound|stopPropagation|unique|getVal|appendTo|show|idSuffix|trim|dropLeft|maximumInputLength|auto|resize|setTimeout|dropHeight|limit|break|elementTabIndex|substring|tokenSeparators|errorThrown|slice|enable|textStatus|transport|jqXHR|closest|mousemove|deltaY|TAB|replace|DOWN|key|syncCssClasses|ESC|firstOption|LEFT|join|formatLoadMore|quietMillis|clear|tmp|list|createElement|handler|resizeSearch|focused|Error|default|closeOnSelect|AbstractSelect2|offscreen|min|innerContainer|values|child|dropTop|dataType|highlightUnderEvent|clearPlaceholder|keydowns|removeHighlight|split|selector|preventDefault|local|isArray|maxSelSize|rb|loadMoreIfNeeded|topOffset|obj|RIGHT|changeDirection|viewPortRight|clazz|display|setSelectionRange|createTextRange|none|len|empty|scrollBarDimensions|activeElement|bodyOffset|toggleClass|title|elementLabel|bottom|_enabled|debounce|first|DELETE|last|switch|formatSelectionTooBig|orient|resultsListNode|keydown|cleanupJQueryElements|_readonly|markMatch|lastMousePosition|observer|before|attrs|formatInputTooLong|isFocused|lastpos|count|replacements|unselect|toLowerCase|tagName|formatter|ctx|dupe|adapted|noHighlightUpdate|hidden|buildChangeDetails|toUpperCase|isDefaultPrevented|while|dataItem|transformVal|formatAjaxError|splice|getMaximumSelectionSize|multi|populate|formatInputTooShort|onSelect|minimumWidth|openOnEnter|splitVal|sideBorderPadding|formatSearching|abbr|dest|createContainer|installKeyUpChangeEvent|locales|viewportBottom|isPlaceholderOptionSelected|MultiSelect2|scrollHeight|defaults|String|tl|removeData|windowHeight|reinsertElement|countResults|windowWidth|that|dropdownCssClass|containerCssClass|methodsMap|cache|array|populateResults|queryCount|queryNumber|below|delta|lastTerm|u03B9|u03C5|postRender|_touchMoved|presentation|containerEventName|sel|selectOnBlur|adaptDropdownCssClass|adaptContainerCssClass|ajaxDefaults|minimumInputLength|formatSelection|clearTouchMoved|removeAttr|clearDropdownAlignmentPreference|formatSelectionCssClass|map|defined|depth|_touchEvent|containerId|SingleSelect2|addSelectedChoice|getSideBorderPadding|initContainer|_this|isControl|character|metaKey|with||enableChoice|PAGE_UP|SuperClass|isFunctionKey|touchend|PAGE_DOWN|triggered|ordered|nodes|tokenize|moveHighlight|isObject|enoughRoomBelow|enoughRoomAbove|dataText|autocomplete|AE|idKey|containerLeft|defaultEscapeMarkup|enabledInterface|triggerSelect|initContainerWidth|formatMatches|orientationchange|mouseup|installDebouncedScroll|debounced|copy|mousewheel|transform|dim|parents|must|add|select2Tags|u03C9|counter|u03A5|u0399|jQuery|ensureHighlightVisible|optgroup|detachEvent|str|MEASURE_SCROLLBAR_TEMPLATE|DIACRITICS|DZ|measureScrollbar|select2Event|selectionStart|onpropertychange|adapter|clientHeight|mutations|position|src|textTransform|enoughRoomOnRight|original|selectCallback|formatterName|jsonpCallback||deprecated|childDatum|abort|Dz|clearTimeout|aboveNow|replace_map|isFunc|letterSpacing|enoughRoomOnLeft|pageX|shouldOpen|isVisible|scrollLeft|notify|pageY|installFilteredMouseMove|monitorSource|threshold|accessible|createRange|methods|fontFamily|fontStyle|fontWeight|attachEvent|fontSize|func|single|10000px|touchmove|error|href|enabledItem|Array|enter|max|disabledItem|AV|available|containerCss|use|and|arrow|Please|stopImmediatePropagation|ALT|field|noop|CTRL|spellcheck|s2id_autogen|paste|shiftKey|delete|ctrlKey|altKey|getCursorInfo|getMaxSearchWidth|measureTextWidth|externalSearch|maximumSelectionSize|attached|when|object|disable|onSortEnd|defaultTokenizer|tokenizer||blurOnChange|onSortStart|searchInputPlaceholder||formatResultCssClass|sortResults|cannot|dropdownCss|supportsTouchEvents|instance|Invalid|propertyMethods|||valueMethods|init|allowedMethods||formatResult|||touchMoved|Loading||countSelectableResults|collapse|hasError|detach|originalTitle|GET|loaded|loadMorePadding|killEventImmediately|items|allowClear|searching|SHIFT|resolve|autocorrect|allowclear|resolveContainerWidth|autocapitalize|json|u01D7|u01D3|uA74C|u01D5|uA74A|u01D9|u019F|u01DB|u016E|u1EE6|u0170|u01A2|uA74E|OI|u00DA|u00D9|u1E17|OO|u00DB|u0168|u1E7A|u016C||u016A|u1E78|u0214|u00DC|u1EEA|u1EDA|u1EDC|u1EE0|u1EDE|u1EE4|u1EE2|u1E72|u0172|u1E76|u020E|u1EBD|u0113|u01A0|u1ECC|u1EF0|u00D8|uFF35|u01FE|u01AF|u0186|u1EE8|u01EC|u1E15|u1EEC|u1ED8|u1EEE|u01EA|u0216|u023E|uA754|uA752|uA782|uA7A6|uA75A|u024C|u2C64|u24C8|uA750|u015A|u1E64|u1E9E|uFF33|u2C63|u01A4|u1E5E|u0156|u0154|u1E58|uFF32|u24C7|uA758|u024A|u0158|uA756|uFF31|u24C6|u1E5C|u1E5A|u0210|u0212|u015C|u1E60|u1E70|u1E6E||u0162|u021A|u0164|u1E6C|OU|u0166|uA728|TZ|uA786|u0222|u01AC|u01AE|u1E6A|uFF34|u1E66|u1E62|u0160|uFF30|u1E56|u1E54|u1E68|u0218|uA784|u24C9|uA7A8|u24C5|u015E|u2C7E|u24CA|uFF37|u1E92|u1E94|u01B5|uA737|uA739|uA73B|u017D|uA735|u01E3|u01FD|u00E6|uA733|uA762|u2C6B|u0224|u2C7F|u017B|u1E90|u1EF6|u1EF4|uFF42|u0178|u1E8E|u1EF8|u0232|u24D1|u01B3|u0179|uA73D|uFF3A|u24CF|u024E|u1EFE|u0250|u2C65|u1EB1|u0103|u0101|u1EAF|u1EB5|u0227|u1EB3|u00E3|u1EA9||u020C|u00E1|u00E2|u1EA7|u1EA5|u1EAB|u00E0|u01E1|u00E4|u1EAD|u1EA1|uFF41|u24D0|u1EB7|u0105|u1E01|u0203|u0201|u01DF|u1E9A|u1EA3|u00E5|u01CE|u01FB|u1E03|u0176|u01F3|uA77A|u1E80|u24CC|VY|u0245|uA760|u0257|u0256|u1E13|u1E11|u0174|u1E0F|u0111|u018C|u1E82|uA75E|u01B2|u1EC5|u1EBF|u1EC1||||u1EC3|uFF36|u0244|u24CB|u1E7C|u1E7E|u24D4|u01C6|uFF45||u00E8|u00EA|u00E9|u1E0D|u010F|u0109|u0107|u1EF2|u010B|uFF39|u1E8C|u24CE|uFF43|u24D2|u1E05|u00DD|u1E07|u0180|u0253|u0183|u010D|u1E8A|u1E88|u24D3|u2184|u1E84|uFF44|u1E0B|u1E86|uA73F|u023C|u24CD|uFF38|u2C72|u00E7|u0188|u1E09|u1E74|u1E1C|u01F1|u01C4|SPACE|uA779|u0189|u018B|u018A|u01F2|u0115|u00C9|u00CA|u00C8||uFF25|u01C5|u24BA|u0110|u1E0E|u023B|uA73E|u0187|u1E08|u010C|u00C7|u24B9|uFF24|u1E10|u1E12|u1E0C|HOME|u1E0A|u010E|u1EC0|u1EBE|u0190|u018E|u1E1A|u1E18|u0228|u0118|u24BB|uFF26|uFF27|u01F4|u24BC|uA77B|u1E1E|u0191|u1EC6|u1EB8|u0112|u1E14|strict|u1EBC|u1EC4|u1EC2|u1E16|u0114|u0204|u0206|u011A|u1EBA|u0116|u00CB|u010A|u0108|u01FC|u1EB2|u01E2|u00C6|u0226|uA732|AA|uA734|u1EB4|u1EB0|u0102|AU|u1EAE|AO||uA736|u01E0|u00C4|u01FA|u00C5|u01CD|u0200|u0202|u1EA0|u1EA2|u1EAC|u023A|u2C6F|u0104|u01DE|u1EB6|u1E00|u0100|u00C3|u1E04|u1E06|112|123|scrollbar|measure|u0243|isArrow|uFF23|u0106|u24B8|END|u0182|u0181|u24B6|uFF21|uA73A|uA73C|uA738|u1EA4|u1EA8|u1EAA|u1EA6|u00C2||uFF22|u1E02|u00C0|u24B7|AY|u00C1|u011C|u1E20|u019C|u24C3|uFF2E|u2C6E|u1E42|u1E3E|u1E40|u01F8|u0143|u0145|u1E4A||u1E46|u0147|u00D1|u1E44|uFF2D|u24C2|u023D|u2C62|u0141|u1E3A|u013B|u1E3C|u2C60|uA748|u01C8|Lj|LJ|u01C7|uA746|uA780|u1E48|u0220|u014C|u1E50|u1E4E|u022C|u00D5|u1E4C|u1E52|u014E|u1ECE|u0150|u022A|u00D6|u022E|u0230|u1ED4|u1ED6|NJ|u01CB|u01CA|uA7A4|u019D||uA790||Nj|u24C4|u1ED2|u1ED0|u00D4|u00D3|uFF2F||u00D2|u1E38|u1E36|u2C75|||uA78D|u24BE|u2C67|u0126|u1E28|u1E2A|uFF29|u00CC|u012C|u0130|u012A|u0128|u00CD|u00CE|u1E24|u021E|u01E4|u0193|u0122|u01E6|u011E|u0120|uA7A0|uA77D|u1E22|u1E26|u0124|uFF28|uA77E|u24BD|u00CF|u1E2E|u2C69|uA740|u0198|u1E34|u1E32|u0136|uA742|uA744|u0139|u013D|u013F|uFF2C|uA7A2|u24C1|u01E8|u1E30|u1ECA|u012E|u020A|u0208|u1EC8|u01CF|u1E2C|u0197|u24C0|uFF2B|u0248|u0134|u24BF|uFF2A|u01D1|u1EE7|uFF59|u1EF3|u24E8|u1E8D|uFF58|u1E8B|u00FD|u0177|u1EF7|u1E99|u00FF|u1E8F|u1EF9|u0233|u24E7|u2C73|u24E6|uFF57|vy|uA761|uA75F|u028C|u1E81|u1E83|u1E98|u1E89|u1E85|u1E87|u0175|u1EF5|u01B4|u0389|u0397|u0395|u0388|u0386|u0391|u038A|u03AA|u038F|u03A9|u03AB|u038E|u038C|u039F|uA763|u2C6C|u017A|u1E91|uFF5A|u24E9|u024F|u1EFF|u017C|u017E|u0225|u0240|u01B6|u1E95|u1E93|u028B|u1E7F|u01AD|u0288|u0167|u1E6F|u0163|u1E71|u2C66|uA787|u00F9|u00FA|uFF55|u24E4|uA729|tz|u021B|u1E6D|u023F|uA7A9|u015F|u0219|u1E63|u1E69|uA785|u1E9B|u1E97|u0165|u1E6B|uFF54|u24E3|u00FB|u0169|u1EF1|u1EE5|u1EED|u1EEF|u1EEB|u1EE9|u1E73|u0173|uFF56|u1E7D|u24E5|u0289|u1E77|u1E75|u01B0|u0217|u00FC|||u01DC|u016D|u1E7B|u1E79|u016B|u01D8|u0117|u01D4|u0215||u0171|u016F|u01DA|u03AC|u03B1|grep|deselected|searchbox|clearing|229|keyCode|replaceWith|dblclick|Math|floor|removing|Must|insertBefore|argument|_search|owns|javascript|void|activedescendant|static|selecting|dropdownAutoWidth|160|haspopup|listbox|labelledby|expanded|combobox|button|called|Sorting|found|failed|No|navigate|down|keys|You|can|util|abstract|Searching�|results�|only|pageNumber|up|are|Unknown|plugin||instead|Attach|elements|supported|selectedObject|currentSearchTerm|One|press|msMaxTouchPoints|navigator|ontouchstart|subtree|attributes|offsetHeight|selectionEnd|offsetWidth|clientWidth|u0000|u007E|moveStart|currentStyle|amp|quot|nowrap|whiteSpace|getComputedStyle|absolute|createTextNode|u03C3|u03AF|u03CA|u03B7|u03AE|u03AD|u03B5|u0390|u03CC|u03B0|u03C2|u03CB|u03CD|u03BF|100|success|both|attribute|specified|sub|dept|unselectable|unshift|invalid|MozMutationObserver|observe|WebKitMutationObserver|MutationObserver|custom|allowed||Option|live|polite|status||Object|hasOwnProperty|falsy|s2id_|autogen|maxlength|disconnect|focusin|deltaX|_|u1E67|u01D6|u0137|u1E35|u1E33|u01E9|uFF4B|u1E31|u0199|u2C6A|u24DB|uFF4C|uA7A3|uA745|uA741|u24DA|u0249|u1ECB|u012F|u020B|u0209|u1EC9|u01D0|u1E2D|u0268|u0135|u01F0|uFF4A|u24D9|u0131|u0140|u013A|u1E41|u1E43|u1E3F|uFF4D|u01C9|u24DC|u0271|u026F|u0144|u00F1||u01F9|uFF4E||u24DD|uA747|uA781|u013C|||u1E3D|u1E39||u1E37|u013E||u1E3B|u017F|u2C61|uA749|u026B|u019A|u0142|u1E2F|u00EF|uA77C|u24D6|u0192|u1E1F|u24D5|uFF46|uFF47|u01F5|u0121|u01E7|u011F|u1E21|u011D|u01DD|u025B|u0207|u1EB9|u0205|u011B|u00EB|u1EBB|u1EC7|u0229|u1E1B|u0247|u1E19|u0119|u1E1D|u0123|u01E5|u0195|u24D8|u0265|u2C76||u0127|u2C68|uFF49|u00EC|u012B|u012D|u0129|u00EE|u00ED|u1E96|u1E2B|uA77F|u24D7|u1D79|uA7A1|u0260||uFF48|u0125|u1E25||u1E29|u021F|u1E27|u1E23|u1E45|uA743|u00F8|u01FF|uA75B|uA7A7|u01EB|u01ED|u0254|u027D|u01A3|u024D|u0275|uA74D|uA74B|u1ED9|u1ECD|u24E2|u020D|u01D2|u0151|u1ECF|u020F|u01A1|uA783|u1EE3|u1EDF|u1EE1|u1EDD|u1E5F|u0157|u1D7D|uA751|u01A5|u1E57|u1E55|uA759|uA753|u024B|uA757|uFF51|u24E0|uA755|uFF50|u24DF|u0213|u0211|u0148|u1E5B|u1E5D|u0159|u1E59|u24E1|uA74F|uFF52|u0155|u0223|uFF53|u1EDB|u00F3|u00DF|u00F2|uFF4F|u24DE|u1ED3|u1ED1|u1E4D|u00F5|u1ED5|u1ED7|u01CC|uA7A5|u1E4B|u0146|u1E47|u0161|u1E49|u1E61|uA791|u0149|u0272|u019E|u022D|u00F4|u0231|u014F|u015B|u1E65|u022F|u015D|u00F6|u1E53|u1E51|u1E4F|u014D|u022B'.split('|'),0,{})) diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/templates/accordion_tab.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/templates/accordion_tab.php index 3c34314231b45fccce7cf962ef29d6fe0fb58e48..e26269f70df2ea9237f00323c7dce07a0bcd97e4 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/templates/accordion_tab.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/templates/accordion_tab.php @@ -1,4 +1,4 @@ -<h3 class="accordion_tab" id="<?php echo esc_attr($id) ?>"><a href="#"><?php echo_h($title) ?></a></h3> -<div id="<?php echo esc_attr($id) ?>_content"> +<h3 class="accordion_tab" id="<?php esc_attr_e($id) ?>"><a href="#"><?php esc_html_e($title) ?></a></h3> +<div id="<?php esc_attr_e($id) ?>_content"> <?php echo $content ?> </div> \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/templates/admin_notice.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/templates/admin_notice.php new file mode 100644 index 0000000000000000000000000000000000000000..aefb5ac7c16dc872e192b6e0bc8d71e5b5c1294a --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/templates/admin_notice.php @@ -0,0 +1,6 @@ +<div data-notification-name="<?php esc_attr_e($notice_name)?>" class="ngg_admin_notice <?php esc_attr_e($css_class)?>"> + <p><?php echo $html ?></p> + <?php if ($is_dismissable): ?> + <p><a class='dismiss' href="#"><?php esc_html_e(__('Dismiss', 'nggallery')) ?></a></p> + <?php endif ?> +</div> \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/templates/entity_errors.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/templates/entity_errors.php index c4b3237443b92b41c1f7c9f6582fef83fcbc9ec5..25ab064c3dd48df446026618cd1b682bae650f17 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/templates/entity_errors.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/templates/entity_errors.php @@ -3,7 +3,7 @@ <ul> <?php foreach($entity->get_errors() as $property => $errors): ?> <?php foreach ($errors as $error): ?> - <li><?php echo_h($error) ?></li> + <li><?php esc_html_e($error) ?></li> <?php endforeach ?> <?php endforeach ?> </ul> diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/templates/entity_saved.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/templates/entity_saved.php index 4f26e34d2167f1007c3df328f19ac01cd345d0b0..5960521506fe879e9c5adff489c3dab39a5df533 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/templates/entity_saved.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/templates/entity_saved.php @@ -1,3 +1,3 @@ <div class='success updated'> - <p><?php echo_h($message) ?> saved successfully</p> + <p><?php esc_html_e($message) ?> saved successfully</p> </div> diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/templates/field_generator/nextgen_settings_field_select.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/templates/field_generator/nextgen_settings_field_select.php index b310b207faa038774eef60a057cd632f151723c4..a50edcc5bf09743932503e19db1a93a81f537c35 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/templates/field_generator/nextgen_settings_field_select.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/templates/field_generator/nextgen_settings_field_select.php @@ -11,7 +11,7 @@ name="<?php print esc_attr($display_type_name . '[' . $name . ']'); ?>" class="<?php print esc_attr($display_type_name . '_' . $name); ?>"> <?php foreach ($options as $key => $val) { ?> - <option value='<?php print esc_attr($key); ?>' <?php selected($key, $value); ?>><?php print htmlentities(_($val)); ?></option> + <option value='<?php print esc_attr($key); ?>' <?php selected($key, $value); ?>><?php print esc_html__($val); ?></option> <?php } ?> </select> </td> diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/templates/nextgen_admin_page.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/templates/nextgen_admin_page.php index 0ac9e86ef0f2517ceeb57eb3c4d955c66752f11d..4f718f8716cdc9aec1578e2df76df86090e9598f 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/templates/nextgen_admin_page.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/templates/nextgen_admin_page.php @@ -1,29 +1,29 @@ <div class="wrap" id='ngg_page_content' style='position: relative; visibility: hidden;'> - <h2><?php echo_h($page_heading)?></h2> - <?php if ($errors): ?> - <?php foreach ($errors as $msg): ?> - <?php echo $msg ?> - <?php endforeach ?> - <?php endif ?> - <?php if ($success AND empty($errors)): ?> - <div class='success updated'> - <p><?php echo_h($success);?></p> - </div> - <?php endif ?> - <form method="POST" action="<?php echo nextgen_esc_url($_SERVER['REQUEST_URI'])?>"> - <?php if (isset($form_header)): ?> - <?php echo $form_header."\n"; ?> - <?php endif ?> - <input type="hidden" name="action"/> - <div class="accordion" id="nextgen_admin_accordion"> - <?php foreach($tabs as $tab): ?> - <?php echo $tab ?> - <?php endforeach ?> - </div> + <h2><?php esc_html_e($page_heading)?></h2> + <?php if ($errors): ?> + <?php foreach ($errors as $msg): ?> + <?php echo $msg ?> + <?php endforeach ?> + <?php endif ?> + <?php if ($success AND empty($errors)): ?> + <div class='success updated'> + <p><?php esc_html_e($success);?></p> + </div> + <?php endif ?> + <form method="POST" action="<?php echo nextgen_esc_url($_SERVER['REQUEST_URI'])?>"> + <?php if (isset($form_header)): ?> + <?php echo $form_header."\n"; ?> + <?php endif ?> + <input type="hidden" name="action"/> + <div class="accordion" id="nextgen_admin_accordion"> + <?php foreach($tabs as $tab): ?> + <?php echo $tab ?> + <?php endforeach ?> + </div> <?php if ($show_save_button): ?> - <p> - <button type="submit" name='action_proxy' value="Save" class="button-primary"><?php _e('Save', 'nggallery'); ?></button> - </p> + <p> + <button type="submit" name='action_proxy' data-proxy-value="save" value="Save" class="button-primary"><?php _e('Save', 'nggallery'); ?></button> + </p> <?php endif ?> - </form> + </form> </div> diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/module.nextgen_basic_album.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/module.nextgen_basic_album.php index 56f07572501df8e6ffa5cb557200ae3569458118..86b552e99ef72dc43fcd804ee154667dd1d963bf 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/module.nextgen_basic_album.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/module.nextgen_basic_album.php @@ -18,16 +18,32 @@ class M_NextGen_Basic_Album extends C_Base_Module 'photocrati-nextgen_basic_album', 'NextGEN Basic Album', "Provides support for NextGEN's Basic Album", - '0.9', + '0.10', 'http://nextgen-gallery.com', 'Photocrati Media', 'http://www.photocrati.com' ); - include_once('class.nextgen_basic_album_installer.php'); C_Photocrati_Installer::add_handler($this->module_id, 'C_NextGen_Basic_Album_Installer'); } + function initialize() + { + parent::initialize(); + + if (is_admin()) { + $forms = C_Form_Manager::get_instance(); + $forms->add_form( + NGG_DISPLAY_SETTINGS_SLUG, + NGG_BASIC_COMPACT_ALBUM + ); + $forms->add_form( + NGG_DISPLAY_SETTINGS_SLUG, + NGG_BASIC_EXTENDED_ALBUM + ); + } + } + function _register_adapters() { @@ -37,16 +53,28 @@ class M_NextGen_Basic_Album extends C_Base_Module 'A_NextGen_Basic_Album' ); - // Add a controller for displaying albums on the front-end - $this->get_registry()->add_adapter( - 'I_Display_Type_Controller', - 'A_NextGen_Basic_Album_Controller', - array( - NGG_BASIC_COMPACT_ALBUM, - NGG_BASIC_EXTENDED_ALBUM, - $this->module_id - ) - ); + if (apply_filters('ngg_load_frontend_logic', TRUE, $this->module_id)) + { + // Add a controller for displaying albums on the front-end + $this->get_registry()->add_adapter( + 'I_Display_Type_Controller', + 'A_NextGen_Basic_Album_Controller', + array( + NGG_BASIC_COMPACT_ALBUM, + NGG_BASIC_EXTENDED_ALBUM, + $this->module_id + ) + ); + + // Add a generic adapter for display types to do late url rewriting + $this->get_registry()->add_adapter( + 'I_Displayed_Gallery_Renderer', + 'A_NextGen_Basic_Album_Routes' + ); + + $this->get_registry()->add_adapter('I_MVC_View', 'A_NextGen_Album_Breadcrumbs'); + } + // Add a mapper for setting the defaults for the album $this->get_registry()->add_adapter( @@ -54,12 +82,6 @@ class M_NextGen_Basic_Album extends C_Base_Module 'A_NextGen_Basic_Album_Mapper' ); - // Add a generic adapter for display types to do late url rewriting - $this->get_registry()->add_adapter( - 'I_Displayed_Gallery_Renderer', - 'A_NextGen_Basic_Album_Routes' - ); - if (M_Attach_To_Post::is_atp_url() || is_admin()) { // Add a display settings form for each display type @@ -80,23 +102,16 @@ class M_NextGen_Basic_Album extends C_Base_Module 'I_Routing_App', 'A_NextGen_Basic_Album_Urls' ); - - if (M_Attach_To_Post::is_atp_url() || is_admin()) - { - $this->get_registry()->add_adapter( - 'I_Form_Manager', - 'A_NextGen_Basic_Album_Forms' - ); - } } function _register_hooks() { - if (!defined('NGG_DISABLE_LEGACY_SHORTCODES') || !NGG_DISABLE_LEGACY_SHORTCODES) + if (apply_filters('ngg_load_frontend_logic', TRUE, $this->module_id) + && (!defined('NGG_DISABLE_LEGACY_SHORTCODES') || !NGG_DISABLE_LEGACY_SHORTCODES)) { C_NextGen_Shortcode_Manager::add('album', array(&$this, 'ngglegacy_shortcode')); + C_NextGen_Shortcode_Manager::add('nggalbum', array(&$this, 'ngglegacy_shortcode')); } - C_NextGen_Shortcode_Manager::add('nggalbum', array(&$this, 'ngglegacy_shortcode')); } /** @@ -126,17 +141,16 @@ class M_NextGen_Basic_Album extends C_Base_Module unset($params['id']); - $renderer = $this->get_registry()->get_utility('I_Displayed_Gallery_Renderer'); + $renderer = C_Displayed_Gallery_Renderer::get_instance(); return $renderer->display_images($params, $inner_content); } function get_type_list() { return array( + 'A_NextGen_Album_Breadcrumbs' => 'adapter.nextgen_album_breadcrumbs.php', 'A_Nextgen_Basic_Album' => 'adapter.nextgen_basic_album.php', 'A_Nextgen_Basic_Album_Controller' => 'adapter.nextgen_basic_album_controller.php', - 'A_Nextgen_Basic_Album_Forms' => 'adapter.nextgen_basic_album_forms.php', - 'C_Nextgen_Basic_Album_Installer' => 'class.nextgen_basic_album_installer.php', 'A_Nextgen_Basic_Album_Mapper' => 'adapter.nextgen_basic_album_mapper.php', 'A_Nextgen_Basic_Album_Routes' => 'adapter.nextgen_basic_album_routes.php', 'A_Nextgen_Basic_Album_Urls' => 'adapter.nextgen_basic_album_urls.php', @@ -147,5 +161,41 @@ class M_NextGen_Basic_Album extends C_Base_Module } } +class C_NextGen_Basic_Album_Installer extends C_Gallery_Display_Installer +{ + function install() + { + $this->install_display_type( + NGG_BASIC_COMPACT_ALBUM, array( + 'title' => __('NextGEN Basic Compact Album', 'nggallery'), + 'entity_types' => array('album', 'gallery'), + 'preview_image_relpath' => 'photocrati-nextgen_basic_album#compact_preview.jpg', + 'default_source' => 'albums', + 'view_order' => NGG_DISPLAY_PRIORITY_BASE + 200, + )); + + $this->install_display_type( + NGG_BASIC_EXTENDED_ALBUM, array( + 'title' => __('NextGEN Basic Extended Album', 'nggallery'), + 'entity_types' => array('album', 'gallery'), + 'preview_image_relpath' => 'photocrati-nextgen_basic_album#extended_preview.jpg', + 'default_source' => 'albums', + 'view_order' => NGG_DISPLAY_PRIORITY_BASE + 210 + )); + } +} + +function nggShowAlbum($albumID, $template = 'extend', $gallery_template = '') +{ + $renderer = C_Displayed_Gallery_Renderer::get_instance(); + $retval = $renderer->display_images(array( + 'album_ids' => array($albumID), + 'display_type' => 'photocrati-nextgen_basic_extended_album', + 'template' => $template, + 'gallery_display_template' => $gallery_template + )); + + return apply_filters('ngg_show_album_content', $retval, $albumID); +} new M_NextGen_Basic_Album(); \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/package.module.nextgen_basic_album.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/package.module.nextgen_basic_album.php new file mode 100644 index 0000000000000000000000000000000000000000..fef48d0de625c8ea789b372df9c2825b694239e3 --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/package.module.nextgen_basic_album.php @@ -0,0 +1,609 @@ +<?php +class A_NextGen_Album_Breadcrumbs extends Mixin +{ + public $breadcrumb_cache = array(); + public function are_breadcrumbs_enabled($display_settings) + { + $retval = FALSE; + if (isset($display_settings['enable_breadcrumbs']) && $display_settings['enable_breadcrumbs']) { + $retval = TRUE; + } elseif (isset($display_settings['original_settings']) && $this->are_breadcrumbs_enabled($display_settings['original_settings'])) { + $retval = TRUE; + } + return $retval; + } + public function get_original_album_entities($display_settings) + { + $retval = array(); + if (isset($display_settings['original_album_entities'])) { + $retval = $display_settings['original_album_entities']; + } elseif (isset($display_settings['original_settings']) && $this->get_original_album_entities($display_settings['original_settings'])) { + $retval = $this->get_original_album_entities($display_settings['original_settings']); + } + return $retval; + } + public function render_object() + { + $root_element = $this->call_parent('render_object'); + if ($displayed_gallery = $this->object->get_param('displayed_gallery')) { + $ds = $displayed_gallery->display_settings; + if ($this->are_breadcrumbs_enabled($ds) && ($original_entities = $this->get_original_album_entities($ds))) { + $original_entities = $this->get_original_album_entities($ds); + if (!empty($ds['original_album_id'])) { + $ids = $ds['original_album_id']; + } else { + $ids = $displayed_gallery->container_ids; + } + $breadcrumbs = $this->object->generate_breadcrumb($ids, $original_entities); + foreach ($root_element->find('nextgen_gallery.gallery_container', TRUE) as $container) { + $container->insert($breadcrumbs); + } + } + } + return $root_element; + } + public function render_legacy_template_breadcrumbs($displayed_gallery, $entities, $gallery_id = FALSE) + { + $ds = $displayed_gallery->display_settings; + if (!empty($entities) && !empty($ds['template']) && $this->are_breadcrumbs_enabled($ds)) { + if ($gallery_id) { + $ids = array($gallery_id); + } elseif (!empty($ds['original_album_id'])) { + $ids = $ds['original_album_id']; + } else { + $ids = $displayed_gallery->container_ids; + } + if (!empty($ds['original_album_entities'])) { + $breadcrumb_entities = $ds['original_album_entities']; + } else { + $breadcrumb_entities = $entities; + } + return $this->object->generate_breadcrumb($ids, $breadcrumb_entities); + } else { + return ''; + } + } + public function find_gallery_parent($gallery_id, $sortorder) + { + $map = C_Album_Mapper::get_instance(); + $found = array(); + foreach ($sortorder as $order) { + if (strpos($order, 'a') === 0) { + $album_id = ltrim($order, 'a'); + if (empty($this->breadcrumb_cache[$order])) { + $album = $map->find($album_id); + $this->breadcrumb_cache[$order] = $album; + if (in_array($gallery_id, $album->sortorder)) { + $found[] = $album; + break; + } else { + $found = $this->find_gallery_parent($gallery_id, $album->sortorder, $found); + if ($found) { + $found[] = $album; + } + } + } + } + } + return $found; + } + public function generate_breadcrumb($gallery_id = NULL, $entities) + { + $found = array(); + $router = C_Router::get_instance(); + $app = $router->get_routed_app(); + if (is_array($gallery_id)) { + $gallery_id = array_shift($gallery_id); + } + foreach ($entities as $ndx => $entity) { + $tmpid = (isset($entity->albumdesc) ? 'a' : '') . $entity->{$entity->id_field}; + $this->breadcrumb_cache[$tmpid] = $entity; + if (isset($entity->albumdesc) && in_array($gallery_id, $entity->sortorder)) { + $found[] = $entity; + break; + } + } + if (empty($found)) { + foreach ($entities as $entity) { + if (!empty($entity->sortorder)) { + $found = $this->object->find_gallery_parent($gallery_id, $entity->sortorder); + } + if (!empty($found)) { + $found[] = $entity; + break; + } + } + } + $found = array_reverse($found); + if (strpos($gallery_id, 'a') === 0) { + $album_found = FALSE; + foreach ($found as $found_item) { + if ($found_item->{$found_item->id_field} == $gallery_id) { + $album_found = TRUE; + } + } + if (!$album_found) { + $album_id = ltrim($gallery_id, 'a'); + $album = C_Album_Mapper::get_instance()->find($album_id); + $found[] = $album; + $this->breadcrumb_cache[$gallery_id] = $album; + } + } else { + $gallery_found = FALSE; + foreach ($entities as $entity) { + if (isset($entity->is_gallery) && $entity->is_gallery && $gallery_id == $entity->{$entity->id_field}) { + $gallery_found = TRUE; + $found[] = $entity; + break; + } + } + if (!$gallery_found) { + $gallery = C_Gallery_Mapper::get_instance()->find($gallery_id); + $found[] = $gallery; + $this->breadcrumb_cache[$gallery->{$gallery->id_field}] = $gallery; + } + } + $crumbs = array(); + if (!empty($found)) { + $end = end($found); + reset($found); + foreach ($found as $found_item) { + $type = isset($found_item->albumdesc) ? 'album' : 'gallery'; + $id = ($type == 'album' ? 'a' : '') . $found_item->{$found_item->id_field}; + $entity = $this->breadcrumb_cache[$id]; + $link = NULL; + if ($type == 'album') { + $name = $entity->name; + if ($entity->pageid > 0) { + $link = @get_page_link($entity->pageid); + } + if (empty($link) && $found_item !== $end) { + $link = $app->get_routed_url(); + $link = $app->strip_param_segments($link); + $link = $app->set_parameter_value('album', $entity->slug, NULL, FALSE, $link); + } + } else { + $name = $entity->title; + } + $crumbs[] = array('type' => $type, 'name' => $name, 'url' => $link); + } + } + // free this memory immediately + $this->breadcrumb_cache = array(); + $view = new C_MVC_View('photocrati-nextgen_basic_album#breadcrumbs', array('breadcrumbs' => $crumbs, 'divisor' => apply_filters('ngg_breadcrumb_separator', ' » '))); + return $view->render(TRUE); + } +} +/** + * Provides validation for NextGen Basic Albums + */ +class A_NextGen_Basic_Album extends Mixin +{ + public function validation() + { + $ngglegacy_albums = array(NGG_BASIC_COMPACT_ALBUM, NGG_BASIC_EXTENDED_ALBUM); + if (in_array($this->object->name, $ngglegacy_albums)) { + $this->object->validates_presence_of('gallery_display_type'); + $this->object->validates_numericality_of('galleries_per_page'); + } + return $this->call_parent('validation'); + } + public function get_order() + { + return NGG_DISPLAY_PRIORITY_BASE + NGG_DISPLAY_PRIORITY_STEP; + } +} +class A_NextGen_Basic_Album_Controller extends Mixin_NextGen_Basic_Pagination +{ + public $albums = array(); + /** + * Renders the front-end for the NextGen Basic Album display type + * + * @param $displayed_gallery + * @param bool $return + */ + public function index_action($displayed_gallery, $return = FALSE) + { + $display_settings = $displayed_gallery->display_settings; + // We need to fetch the album containers selected in the Attach + // to Post interface. We need to do this, because once we fetch the + // included entities, we need to iterate over each entity and assign it + // a parent_id, which is the album that it belongs to. We need to do this + // because the link to the gallery, is not /nggallery/gallery--id, but + // /nggallery/album--id/gallery--id + $parent_albums = $displayed_gallery->get_albums(); + // Are we to display a gallery? Ensure our 'gallery' isn't just a paginated album view + $gallery = $gallery_slug = $this->param('gallery'); + if ($gallery && strpos($gallery, 'nggpage--') !== 0) { + // basic albums only support one per post + if (isset($GLOBALS['nggShowGallery'])) { + return; + } + $GLOBALS['nggShowGallery'] = TRUE; + // Try finding the gallery by slug first. If nothing is found, we assume that + // the user passed in a gallery id instead + $mapper = C_Gallery_Mapper::get_instance(); + $result = reset($mapper->select()->where(array('slug = %s', $gallery))->limit(1)->run_query()); + if ($result) { + $gallery = $result->{$result->id_field}; + } + $renderer = C_Displayed_Gallery_Renderer::get_instance('inner'); + $gallery_params = array('source' => 'galleries', 'container_ids' => array($gallery), 'display_type' => $display_settings['gallery_display_type'], 'original_display_type' => $displayed_gallery->display_type, 'original_settings' => $display_settings, 'original_album_entities' => $parent_albums); + if (!empty($display_settings['gallery_display_template'])) { + $gallery_params['template'] = $display_settings['gallery_display_template']; + } + add_filter('ngg_displayed_gallery_rendering', array($this, 'add_breadcrumbs_to_legacy_templates'), 10, 2); + $output = $renderer->display_images($gallery_params, $return); + remove_filter('ngg_displayed_gallery_rendering', array($this, 'add_breadcrumbs_to_legacy_templates')); + return $output; + } else { + if ($album = $this->param('album')) { + $mapper = C_Album_Mapper::get_instance(); + $result = array_pop($mapper->select()->where(array('slug = %s', $album))->limit(1)->run_query()); + $album_sub = $result ? $result->{$result->id_field} : null; + if ($album_sub != null) { + $album = $album_sub; + } + $displayed_gallery->entity_ids = array(); + $displayed_gallery->sortorder = array(); + $displayed_gallery->container_ids = ($album === '0' or $album === 'all') ? array() : array($album); + $displayed_gallery->display_settings['original_album_id'] = 'a' . $album_sub; + $displayed_gallery->display_settings['original_album_entities'] = $parent_albums; + } + } + // Get the albums + // TODO: This should probably be moved to the elseif block above + $this->albums = $displayed_gallery->get_albums(); + // None of the above: Display the main album. Get the settings required for display + $current_page = (int) $this->param('page', $displayed_gallery->id(), 1); + $offset = $display_settings['galleries_per_page'] * ($current_page - 1); + $entities = $displayed_gallery->get_included_entities($display_settings['galleries_per_page'], $offset); + // If there are entities to be displayed + if ($entities) { + $pagination_result = $this->object->create_pagination($current_page, $displayed_gallery->get_entity_count(), $display_settings['galleries_per_page'], urldecode($this->object->param('ajax_pagination_referrer'))); + if (!empty($display_settings['template'])) { + // Add additional parameters + $this->object->remove_param('ajax_pagination_referrer'); + $display_settings['current_page'] = $current_page; + $display_settings['entities'] =& $entities; + $display_settings['pagination_prev'] = $pagination_result['prev']; + $display_settings['pagination_next'] = $pagination_result['next']; + $display_settings['pagination'] = $pagination_result['output']; + $this->object->add_mixin('A_NextGen_Album_Breadcrumbs'); + $breadcrumbs = $this->object->render_legacy_template_breadcrumbs($displayed_gallery, $entities); + // Render legacy template + $this->object->add_mixin('Mixin_NextGen_Basic_Templates'); + $display_settings = $this->prepare_legacy_album_params($displayed_gallery->get_entity(), $display_settings); + $retval = $this->object->legacy_render($display_settings['template'], $display_settings, $return, 'album'); + if (!empty($breadcrumbs)) { + $retval = $breadcrumbs . $retval; + } + return $retval; + } else { + $params = $display_settings; + $albums = $this->prepare_legacy_album_params($displayed_gallery->get_entity(), array('entities' => $entities)); + $params['pagination'] = $pagination_result['output']; + $params['image_gen_params'] = $albums['image_gen_params']; + $params['galleries'] = $albums['galleries']; + $params['displayed_gallery'] = $displayed_gallery; + $params = $this->object->prepare_display_parameters($displayed_gallery, $params); + switch ($displayed_gallery->display_type) { + case NGG_BASIC_COMPACT_ALBUM: + $template = 'compact'; + break; + case NGG_BASIC_EXTENDED_ALBUM: + $template = 'extended'; + break; + } + return $this->object->render_view("photocrati-nextgen_basic_album#{$template}", $params, $return); + } + } else { + return $this->object->render_partial('photocrati-nextgen_gallery_display#no_images_found', array(), $return); + } + } + public function add_breadcrumbs_to_legacy_templates($html, $displayed_gallery) + { + $this->object->add_mixin('A_NextGen_Album_Breadcrumbs'); + $original_album_entities = array(); + if (isset($displayed_gallery->display_settings['original_album_entities'])) { + $original_album_entities = $displayed_gallery->display_settings['original_album_entities']; + } elseif (isset($displayed_gallery->display_settings['original_settings']) && isset($displayed_gallery->display_settings['original_settings']['original_album_entities'])) { + $original_album_entities = $displayed_gallery->display_settings['original_settings']['original_album_entities']; + } + $breadcrumbs = $this->object->render_legacy_template_breadcrumbs($displayed_gallery, $original_album_entities, $displayed_gallery->conatiner_ids); + if (!empty($breadcrumbs)) { + $html = $breadcrumbs . $html; + } + return $html; + } + /** + * Gets the parent album for the entity being displayed + * @param int $entity_id + * @return stdClass (album) + */ + public function get_parent_album_for($entity_id) + { + $retval = NULL; + foreach ($this->albums as $album) { + if (in_array($entity_id, $album->sortorder)) { + $retval = $album; + break; + } + } + return $retval; + } + public function prepare_legacy_album_params($displayed_gallery, $params) + { + $image_mapper = C_Image_Mapper::get_instance(); + $storage = C_Gallery_Storage::get_instance(); + $image_gen = C_Dynamic_Thumbnails_Manager::get_instance(); + if (empty($displayed_gallery->display_settings['override_thumbnail_settings'])) { + // legacy templates expect these dimensions + $image_gen_params = array('width' => 91, 'height' => 68, 'crop' => TRUE); + } else { + // use settings requested by user + $image_gen_params = array('width' => $displayed_gallery->display_settings['thumbnail_width'], 'height' => $displayed_gallery->display_settings['thumbnail_height'], 'quality' => isset($displayed_gallery->display_settings['thumbnail_quality']) ? $displayed_gallery->display_settings['thumbnail_quality'] : 100, 'crop' => isset($displayed_gallery->display_settings['thumbnail_crop']) ? $displayed_gallery->display_settings['thumbnail_crop'] : NULL, 'watermark' => isset($displayed_gallery->display_settings['thumbnail_watermark']) ? $displayed_gallery->display_settings['thumbnail_watermark'] : NULL); + } + // so user templates can know how big the images are expected to be + $params['image_gen_params'] = $image_gen_params; + // Transform entities + $params['galleries'] = $params['entities']; + unset($params['entities']); + foreach ($params['galleries'] as &$gallery) { + // Get the preview image url + $gallery->previewurl = ''; + if ($gallery->previewpic && $gallery->previewpic > 0) { + if ($image = $image_mapper->find(intval($gallery->previewpic))) { + $gallery->previewurl = $storage->get_image_url($image, $image_gen->get_size_name($image_gen_params), TRUE); + $gallery->previewname = $gallery->name; + } + } + // Get the page link. If the entity is an album, then the url will + // look like /nggallery/album--slug. + $id_field = $gallery->id_field; + if ($gallery->is_album) { + if ($gallery->pageid > 0) { + $gallery->pagelink = @get_page_link($gallery->pageid); + } else { + $pagelink = $this->object->get_routed_url(TRUE); + $pagelink = $this->object->remove_param_for($pagelink, 'album'); + $pagelink = $this->object->remove_param_for($pagelink, 'gallery'); + $pagelink = $this->object->remove_param_for($pagelink, 'nggpage'); + $pagelink = $this->object->set_param_for($pagelink, 'album', $gallery->slug); + $gallery->pagelink = $pagelink; + } + } else { + if ($gallery->pageid > 0) { + $gallery->pagelink = @get_page_link($gallery->pageid); + } + if (empty($gallery->pagelink)) { + $pagelink = $this->object->get_routed_url(TRUE); + $parent_album = $this->object->get_parent_album_for($gallery->{$id_field}); + if ($parent_album) { + $pagelink = $this->object->remove_param_for($pagelink, 'album'); + $pagelink = $this->object->remove_param_for($pagelink, 'gallery'); + $pagelink = $this->object->remove_param_for($pagelink, 'nggpage'); + $pagelink = $this->object->set_param_for($pagelink, 'album', $parent_album->slug); + } else { + if ($displayed_gallery->container_ids === array('0') || $displayed_gallery->container_ids === array('')) { + $pagelink = $this->object->set_param_for($pagelink, 'album', 'all'); + } else { + $pagelink = $this->object->remove_param_for($pagelink, 'nggpage'); + $pagelink = $this->object->set_param_for($pagelink, 'album', 'album'); + } + } + $gallery->pagelink = $this->object->set_param_for($pagelink, 'gallery', $gallery->slug); + } + } + // Let plugins modify the gallery + $gallery = apply_filters('ngg_album_galleryobject', $gallery); + } + $params['album'] = reset($this->albums); + $params['albums'] = $this->albums; + // Clean up + unset($storage); + unset($image_mapper); + unset($image_gen); + unset($image_gen_params); + return $params; + } + public function _get_js_lib_url() + { + return $this->object->get_static_url('photocrati-nextgen_basic_album#init.js'); + } + /** + * Enqueues all static resources required by this display type + * + * @param C_Displayed_Gallery $displayed_gallery + */ + public function enqueue_frontend_resources($displayed_gallery) + { + $this->call_parent('enqueue_frontend_resources', $displayed_gallery); + wp_enqueue_style('nextgen_basic_album_style', $this->object->get_static_url('photocrati-nextgen_basic_album#nextgen_basic_album.css')); + wp_enqueue_style('nextgen_pagination_style', $this->get_static_url('photocrati-nextgen_pagination#style.css')); + wp_enqueue_script('jquery.dotdotdot', $this->object->get_static_url('photocrati-nextgen_basic_album#jquery.dotdotdot-1.5.7-packed.js'), array('jquery')); + $ds = $displayed_gallery->display_settings; + if (!empty($ds['enable_breadcrumbs']) && $ds['enable_breadcrumbs'] || !empty($ds['original_settings']['enable_breadcrumbs']) && $ds['original_settings']['enable_breadcrumbs']) { + wp_enqueue_style('nextgen_basic_album_breadcrumbs_style', $this->object->get_static_url('photocrati-nextgen_basic_album#breadcrumbs.css')); + } + $this->enqueue_ngg_styles(); + } +} +class A_NextGen_Basic_Album_Mapper extends Mixin +{ + public function set_defaults($entity) + { + $this->call_parent('set_defaults', $entity); + if (isset($entity->name) && in_array($entity->name, array(NGG_BASIC_COMPACT_ALBUM, NGG_BASIC_EXTENDED_ALBUM))) { + // Set defaults for both display (album) types + $settings = C_NextGen_Settings::get_instance(); + $this->object->_set_default_value($entity, 'settings', 'galleries_per_page', $settings->galPagedGalleries); + $this->object->_set_default_value($entity, 'settings', 'enable_breadcrumbs', 1); + $this->object->_set_default_value($entity, 'settings', 'disable_pagination', 0); + $this->object->_set_default_value($entity, 'settings', 'template', ''); + // Thumbnail dimensions -- only used by extended albums + if ($entity->name == NGG_BASIC_EXTENDED_ALBUM) { + $this->_set_default_value($entity, 'settings', 'override_thumbnail_settings', 0); + $this->_set_default_value($entity, 'settings', 'thumbnail_width', $settings->thumbwidth); + $this->_set_default_value($entity, 'settings', 'thumbnail_height', $settings->thumbheight); + $this->_set_default_value($entity, 'settings', 'thumbnail_quality', $settings->thumbquality); + $this->_set_default_value($entity, 'settings', 'thumbnail_crop', $settings->thumbfix); + $this->_set_default_value($entity, 'settings', 'thumbnail_watermark', 0); + } + if (defined('NGG_BASIC_THUMBNAILS')) { + $this->object->_set_default_value($entity, 'settings', 'gallery_display_type', NGG_BASIC_THUMBNAILS); + } + $this->object->_set_default_value($entity, 'settings', 'gallery_display_template', ''); + $this->object->_set_default_value($entity, 'settings', 'ngg_triggers_display', 'never'); + } + } +} +class A_NextGen_Basic_Album_Routes extends Mixin +{ + public function render($displayed_gallery, $return = FALSE, $mode = NULL) + { + $do_rewrites = FALSE; + $app = NULL; + // Get display types + $original_display_type = isset($displayed_gallery->display_settings['original_display_type']) ? $displayed_gallery->display_settings['original_display_type'] : ''; + $display_type = $displayed_gallery->display_type; + // If we're viewing an album, rewrite the urls + $regex = '/photocrati-nextgen_basic_\\w+_album/'; + if (preg_match($regex, $display_type)) { + $do_rewrites = TRUE; + // Get router + $router = C_Router::get_instance(); + $app = $router->get_routed_app(); + $slug = '/' . C_NextGen_Settings::get_instance()->router_param_slug; + $app->rewrite("{*}{$slug}/page/{\\d}{*}", "{1}{$slug}/nggpage--{2}{3}", FALSE, TRUE); + $app->rewrite("{*}{$slug}/pid--{*}", "{1}{$slug}/pid--{2}", FALSE, TRUE); + // avoid conflicts with imagebrowser + $app->rewrite("{*}{$slug}/{\\w}/{\\w}/{\\w}{*}", "{1}{$slug}/album--{2}/gallery--{3}/{4}{5}", FALSE, TRUE); + $app->rewrite("{*}{$slug}/{\\w}/{\\w}", "{1}{$slug}/album--{2}/gallery--{3}", FALSE, TRUE); + } elseif (preg_match($regex, $original_display_type)) { + $do_rewrites = TRUE; + // Get router + $router = C_Router::get_instance(); + $app = $router->get_routed_app(); + $slug = '/' . C_NextGen_Settings::get_instance()->router_param_slug; + $app->rewrite("{*}{$slug}/album--{\\w}", "{1}{$slug}/{2}"); + $app->rewrite("{*}{$slug}/album--{\\w}/gallery--{\\w}", "{1}{$slug}/{2}/{3}"); + $app->rewrite("{*}{$slug}/album--{\\w}/gallery--{\\w}/{*}", "{1}{$slug}/{2}/{3}/{4}"); + } + // Perform rewrites + if ($do_rewrites && $app) { + $app->do_rewrites(); + } + return $this->call_parent('render', $displayed_gallery, $return, $mode); + } +} +class A_NextGen_Basic_Album_Urls extends Mixin +{ + public function create_parameter_segment($key, $value, $id = NULL, $use_prefix = FALSE) + { + if ($key == 'nggpage') { + return 'page/' . $value; + } elseif ($key == 'album') { + return $value; + } elseif ($key == 'gallery') { + return $value; + } else { + return $this->call_parent('create_parameter_segment', $key, $value, $id, $use_prefix); + } + } + public function remove_parameter($key, $id = NULL, $url = FALSE) + { + $retval = $this->call_parent('remove_parameter', $key, $id, $url); + $settings = C_NextGen_Settings::get_instance(); + $param_slug = preg_quote($settings->router_param_slug, '#'); + if (preg_match("#(/{$param_slug}/.*)album--#", $retval, $matches)) { + $retval = str_replace($matches[0], $matches[1], $retval); + } + if (preg_match("#(/{$param_slug}/.*)gallery--#", $retval, $matches)) { + $retval = str_replace($matches[0], $matches[1], $retval); + } + return $retval; + } +} +class Mixin_NextGen_Basic_Album_Form extends Mixin_Display_Type_Form +{ + public function _get_field_names() + { + return array('nextgen_basic_album_gallery_display_type', 'nextgen_basic_album_galleries_per_page', 'nextgen_basic_album_enable_breadcrumbs', 'nextgen_basic_templates_template'); + } + /** + * Renders the Gallery Display Type field + * @param C_Display_Type $display_type + */ + public function _render_nextgen_basic_album_gallery_display_type_field($display_type) + { + $mapper = C_Display_Type_Mapper::get_instance(); + return $this->render_partial('photocrati-nextgen_basic_album#nextgen_basic_album_gallery_display_type', array('display_type_name' => $display_type->name, 'gallery_display_type_label' => __('Display galleries as', 'nggallery'), 'gallery_display_type_help' => __('How would you like galleries to be displayed?', 'nggallery'), 'gallery_display_type' => $display_type->settings['gallery_display_type'], 'galleries_per_page_label' => __('Galleries per page', 'nggallery'), 'galleries_per_page' => $display_type->settings['galleries_per_page'], 'display_types' => $mapper->find_by_entity_type('image')), TRUE); + } + /** + * Renders the Galleries Per Page field + * @param C_Display_Type $display_type + */ + public function _render_nextgen_basic_album_galleries_per_page_field($display_type) + { + return $this->_render_number_field($display_type, 'galleries_per_page', __('Items per page', 'nggallery'), $display_type->settings['galleries_per_page'], __('Maximum number of galleries or sub-albums to appear on a single page', 'nggallery'), FALSE, '', 0); + } + public function _render_nextgen_basic_album_enable_breadcrumbs_field($display_type) + { + return $this->_render_radio_field($display_type, 'enable_breadcrumbs', __('Enable breadcrumbs', 'nggallery'), isset($display_type->settings['enable_breadcrumbs']) ? $display_type->settings['enable_breadcrumbs'] : FALSE); + } +} +class A_NextGen_Basic_Extended_Album_Form extends Mixin_NextGen_Basic_Album_Form +{ + public function get_display_type_name() + { + return NGG_BASIC_EXTENDED_ALBUM; + } + /** + * Returns a list of fields to render on the settings page + */ + public function _get_field_names() + { + $fields = parent::_get_field_names(); + $fields[] = 'thumbnail_override_settings'; + return $fields; + } + /** + * Enqueues static resources required by this form + */ + public function enqueue_static_resources() + { + wp_enqueue_script('nextgen_basic_extended_albums_settings_script', $this->object->get_static_url('photocrati-nextgen_basic_album#extended_settings.js'), array('jquery.nextgen_radio_toggle')); + $atp = C_Attach_Controller::get_instance(); + if ($atp != null) { + $atp->mark_script('nextgen_basic_extended_albums_settings_script'); + } + } +} +class A_NextGen_Basic_Compact_Album_Form extends Mixin_NextGen_Basic_Album_Form +{ + public function get_display_type_name() + { + return NGG_BASIC_COMPACT_ALBUM; + } + /** + * Returns a list of fields to render on the settings page + */ + public function _get_field_names() + { + $fields = parent::_get_field_names(); + $fields[] = 'thumbnail_override_settings'; + return $fields; + } + /** + * Enqueues static resources required by this form + */ + public function enqueue_static_resources() + { + wp_enqueue_script('nextgen_basic_compact_albums_settings_script', $this->object->get_static_url('photocrati-nextgen_basic_album#compact_settings.js'), array('jquery.nextgen_radio_toggle')); + $atp = C_Attach_Controller::get_instance(); + if ($atp != null) { + $atp->mark_script('nextgen_basic_compact_albums_settings_script'); + } + } +} \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/static/breadcrumbs.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/static/breadcrumbs.css new file mode 100644 index 0000000000000000000000000000000000000000..281e78c86f893cfaa4c7836e534ca9f1c170634b --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/static/breadcrumbs.css @@ -0,0 +1,23 @@ +.ngg-breadcrumbs { + list-style: none; + overflow: hidden; + margin: 0; + padding: .5em 0 .5em 0; +} + +.ngg-breadcrumbs li { + float: left; + padding: 0 .3em 0 .15em; + margin: 0; + vertical-align: middle; + border: none; + list-style-type: none; +} + +.ngg-breadcrumbs li a { +} + +.ngg-breadcrumbs .ngg-breadcrumb-divisor { + margin: 0; + padding: 0 0 0 .15em; +} \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/static/breadcrumbs.min.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/static/breadcrumbs.min.css new file mode 100644 index 0000000000000000000000000000000000000000..0f65feaa821156429677aa41670308c9788d5353 --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/static/breadcrumbs.min.css @@ -0,0 +1 @@ +.ngg-breadcrumbs{list-style:none;overflow:hidden;margin:0;padding:.5em 0 .5em 0}.ngg-breadcrumbs li{float:left;padding:0 .3em 0 .15em;margin:0;vertical-align:middle;border:0;list-style-type:none}.ngg-breadcrumbs .ngg-breadcrumb-divisor{margin:0;padding:0 0 0 .15em} \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/static/compact_settings.min.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/static/compact_settings.min.js new file mode 100644 index 0000000000000000000000000000000000000000..5eeee88221626fbfe6f7bb885828d1c53f1b4720 --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/static/compact_settings.min.js @@ -0,0 +1 @@ +eval(function(p,a,c,k,e,d){e=function(c){return c.toString(36)};if(!''.replace(/^/,String)){while(c--){d[c.toString(a)]=k[c]||c.toString(a)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('7(5($){$(\'4[3="6-b[8]"]\').2(\'1\',$(\'#0-9\')).2(\'1\',$(\'#0-a\'))});',12,12,'tr_photocrati||nextgen_radio_toggle_tr|name|input|function|photocrati|jQuery|override_thumbnail_settings|nextgen_basic_compact_album_thumbnail_dimensions|nextgen_basic_compact_album_thumbnail_crop|nextgen_basic_compact_album'.split('|'),0,{})) diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/static/extended_settings.min.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/static/extended_settings.min.js new file mode 100644 index 0000000000000000000000000000000000000000..1fd68e07e15f753018bbd1f63cca8e62262c8d6d --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/static/extended_settings.min.js @@ -0,0 +1 @@ +eval(function(p,a,c,k,e,d){e=function(c){return c.toString(36)};if(!''.replace(/^/,String)){while(c--){d[c.toString(a)]=k[c]||c.toString(a)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('7(5($){$(\'4[3="6-b[8]"]\').2(\'1\',$(\'#0-9\')).2(\'1\',$(\'#0-a\'))});',12,12,'tr_photocrati||nextgen_radio_toggle_tr|name|input|function|photocrati|jQuery|override_thumbnail_settings|nextgen_basic_extended_album_thumbnail_dimensions|nextgen_basic_extended_album_thumbnail_crop|nextgen_basic_extended_album'.split('|'),0,{})) diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/static/init.min.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/static/init.min.js new file mode 100644 index 0000000000000000000000000000000000000000..55495b756ea0a16946bc8fb707150d136ee19689 --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/static/init.min.js @@ -0,0 +1 @@ +eval(function(p,a,c,k,e,d){e=function(c){return c.toString(36)};if(!''.replace(/^/,String)){while(c--){d[c.toString(a)]=k[c]||c.toString(a)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('6(2($){$(\'.3-7-5\').4();$(\'.3-8\').9(2(){$(c).b(\'a\',1.0)})});',13,13,'||function|ngg|dotdotdot|desc|jQuery|album|albumoverview|each|opacity|css|this'.split('|'),0,{})) diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/static/jquery.dotdotdot-1.5.7-packed.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/static/jquery.dotdotdot-1.5.7-packed.js index c469b84297d5653836c7279a9b085a37ebfcd7c9..67ef39d494645af967e6690e55866bba3cc8d63a 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/static/jquery.dotdotdot-1.5.7-packed.js +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/static/jquery.dotdotdot-1.5.7-packed.js @@ -1,15 +1,15 @@ -/* - * jQuery dotdotdot 1.5.7 - * - * Copyright (c) 2013 Fred Heusschen - * www.frebsite.nl - * - * Plugin website: - * dotdotdot.frebsite.nl - * - * Dual licensed under the MIT and GPL licenses. - * http://en.wikipedia.org/wiki/MIT_License - * http://en.wikipedia.org/wiki/GNU_General_Public_License - */ - +/* + * jQuery dotdotdot 1.5.7 + * + * Copyright (c) 2013 Fred Heusschen + * www.frebsite.nl + * + * Plugin website: + * dotdotdot.frebsite.nl + * + * Dual licensed under the MIT and GPL licenses. + * http://en.wikipedia.org/wiki/MIT_License + * http://en.wikipedia.org/wiki/GNU_General_Public_License + */ + (function(a){function c(a,b,c){var d=a.children(),e=!1;a.empty();for(var g=0,h=d.length;h>g;g++){var i=d.eq(g);if(a.append(i),c&&a.append(c),f(a,b)){i.remove(),e=!0;break}c&&c.remove()}return e}function d(b,c,g,h,i){var j=b.contents(),k=!1;b.empty();for(var l="table, thead, tbody, tfoot, tr, col, colgroup, object, embed, param, ol, ul, dl, select, optgroup, option, textarea, script, style",m=0,n=j.length;n>m&&!k;m++){var o=j[m],p=a(o);void 0!==o&&(b.append(p),i&&b[b.is(l)?"after":"append"](i),3==o.nodeType?f(g,h)&&(k=e(p,c,g,h,i)):k=d(p,c,g,h,i),k||i&&i.remove())}return k}function e(a,b,c,d,h){var k=!1,l=a[0];if(l===void 0)return!1;for(var m="letter"==d.wrap?"":" ",n=j(l).split(m),o=-1,p=-1,q=0,r=n.length-1;r>=q;){var s=Math.floor((q+r)/2);if(s==p)break;p=s,i(l,n.slice(0,p+1).join(m)+d.ellipsis),f(c,d)?r=p:(o=p,q=p)}if(-1==o||1==n.length&&0==n[0].length){var u=a.parent();a.remove();var v=h?h.length:0;if(u.contents().size()>v){var w=u.contents().eq(-1-v);k=e(w,b,c,d,h)}else{var l=u.prev().contents().eq(-1)[0];if(l!==void 0){var t=g(j(l),d);i(l,t),u.remove(),k=!0}}}else{var t=g(n.slice(0,o+1).join(m),d);k=!0,i(l,t)}return k}function f(a,b){return a.innerHeight()>b.maxHeight}function g(b,c){for(;a.inArray(b.slice(-1),c.lastCharacter.remove)>-1;)b=b.slice(0,-1);return 0>a.inArray(b.slice(-1),c.lastCharacter.noEllipsis)&&(b+=c.ellipsis),b}function h(a){return{width:a.innerWidth(),height:a.innerHeight()}}function i(a,b){a.innerText?a.innerText=b:a.nodeValue?a.nodeValue=b:a.textContent&&(a.textContent=b)}function j(a){return a.innerText?a.innerText:a.nodeValue?a.nodeValue:a.textContent?a.textContent:""}function k(b,c){return b===void 0?!1:b?"string"==typeof b?(b=a(b,c),b.length?b:!1):"object"==typeof b?b.jquery===void 0?!1:b:!1:!1}function l(a){for(var b=a.innerHeight(),c=["paddingTop","paddingBottom"],d=0,e=c.length;e>d;d++){var f=parseInt(a.css(c[d]),10);isNaN(f)&&(f=0),b-=f}return b}function m(a,b){return a?(b="string"==typeof b?"dotdotdot: "+b:["dotdotdot:",b],window.console!==void 0&&window.console.log!==void 0&&window.console.log(b),!1):!1}if(!a.fn.dotdotdot){a.fn.dotdotdot=function(e){if(0==this.length)return e&&e.debug===!1||m(!0,'No element found for "'+this.selector+'".'),this;if(this.length>1)return this.each(function(){a(this).dotdotdot(e)});var g=this;g.data("dotdotdot")&&g.trigger("destroy.dot"),g.bind_events=function(){return g.bind("update.dot",function(b,e){b.preventDefault(),b.stopPropagation(),j.maxHeight="number"==typeof j.height?j.height:l(g),j.maxHeight+=j.tolerance,e!==void 0&&(("string"==typeof e||e instanceof HTMLElement)&&(e=a("<div />").append(e).contents()),e instanceof a&&(i=e)),q=g.wrapInner('<div class="dotdotdot" />').children(),q.empty().append(i.clone(!0)).css({height:"auto",width:"auto",border:"none",padding:0,margin:0});var h=!1,k=!1;return n.afterElement&&(h=n.afterElement.clone(!0),n.afterElement.remove()),f(q,j)&&(k="children"==j.wrap?c(q,j,h):d(q,g,q,j,h)),q.replaceWith(q.contents()),q=null,a.isFunction(j.callback)&&j.callback.call(g[0],k,i),n.isTruncated=k,k}).bind("isTruncated.dot",function(a,b){return a.preventDefault(),a.stopPropagation(),"function"==typeof b&&b.call(g[0],n.isTruncated),n.isTruncated}).bind("originalContent.dot",function(a,b){return a.preventDefault(),a.stopPropagation(),"function"==typeof b&&b.call(g[0],i),i}).bind("destroy.dot",function(a){a.preventDefault(),a.stopPropagation(),g.unwatch().unbind_events().empty().append(i).data("dotdotdot",!1)}),g},g.unbind_events=function(){return g.unbind(".dot"),g},g.watch=function(){if(g.unwatch(),"window"==j.watch){var b=a(window),c=b.width(),d=b.height();b.bind("resize.dot"+n.dotId,function(){c==b.width()&&d==b.height()&&j.windowResizeFix||(c=b.width(),d=b.height(),p&&clearInterval(p),p=setTimeout(function(){g.trigger("update.dot")},10))})}else o=h(g),p=setInterval(function(){var a=h(g);(o.width!=a.width||o.height!=a.height)&&(g.trigger("update.dot"),o=h(g))},100);return g},g.unwatch=function(){return a(window).unbind("resize.dot"+n.dotId),p&&clearInterval(p),g};var i=g.contents(),j=a.extend(!0,{},a.fn.dotdotdot.defaults,e),n={},o={},p=null,q=null;return n.afterElement=k(j.after,g),n.isTruncated=!1,n.dotId=b++,g.data("dotdotdot",!0).bind_events().trigger("update.dot"),j.watch&&g.watch(),g},a.fn.dotdotdot.defaults={ellipsis:"... ",wrap:"word",lastCharacter:{remove:[" ",",",";",".","!","?"],noEllipsis:[]},tolerance:0,callback:null,after:null,height:null,watch:!1,windowResizeFix:!0,debug:!1};var b=1,n=a.fn.html;a.fn.html=function(a){return a!==void 0?this.data("dotdotdot")&&"function"!=typeof a?this.trigger("update",[a]):n.call(this,a):n.call(this)};var o=a.fn.text;a.fn.text=function(b){if(b!==void 0){if(this.data("dotdotdot")){var c=a("<div />");return c.text(b),b=c.html(),c.remove(),this.trigger("update",[b])}return o.call(this,b)}return o.call(this)}}})(jQuery); \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/static/nextgen_basic_album.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/static/nextgen_basic_album.css index a4e71d0210c5cd7dfaa21857eca8f5811b607410..a9ee2c884e7a34d2579e0b42f3553e34d89adc88 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/static/nextgen_basic_album.css +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/static/nextgen_basic_album.css @@ -120,4 +120,4 @@ .ngg-clear { clear: both; float: none; -} +} \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/static/nextgen_basic_album.min.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/static/nextgen_basic_album.min.css new file mode 100644 index 0000000000000000000000000000000000000000..b00b2709825b0d2f51f1a0eca0de79bdd1af0e2e --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/static/nextgen_basic_album.min.css @@ -0,0 +1 @@ +.ngg-albumoverview{margin-top:10px;width:100%;clear:both;display:block !important}.ngg-album{height:100%;overflow:hidden;padding:5px;margin-bottom:5px;border:1px solid #ccc}.ngg-albumtitle{text-align:left;font-weight:bold;margin:0;padding:0;font-size:1.4em;margin-bottom:10px}.ngg-thumbnail{float:left;margin-right:12px}.ngg-thumbnail img{background-color:#fff;border:1px solid #a9a9a9;margin:4px 0 4px 5px;padding:4px;position:relative}.ngg-thumbnail img:hover{background-color:#a9a9a9}.ngg-description{text-align:left}.ngg-album-compact{float:left;padding:0 12px 4px 0 !important;margin:0 !important;text-align:left}.ngg-album-compact a{border:0}.ngg-album-compactbox{margin:0 !important;padding:8px !important;box-sizing:border-box;-moz-box-sizing:border-box;position:relative;border:1px solid gray;border-radius:6px;z-index:1}.ngg-album-compactbox:before{content:' ';position:absolute;top:0;left:0;right:0;bottom:-7px;border-bottom:1px solid gray;border-radius:6px;z-index:-1}.ngg-album-compactbox:after{content:' ';position:absolute;top:0;left:0;right:0;bottom:-4px;border-bottom:1px solid gray;border-radius:6px;z-index:-1}.ngg-album-compactbox .Thumb{margin:0 !important;padding:0 !important;border:1px solid black !important}.ngg-album-compact h4{font-size:15px;font-weight:bold;margin:0;margin-top:10px}.ngg-album-compact h4 .ngg-album-desc{overflow:hidden;display:block;height:54px}.ngg-album-compact p{font-size:11px;margin:0}.ngg-clear{clear:both;float:none} \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/templates/breadcrumbs.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/templates/breadcrumbs.php new file mode 100644 index 0000000000000000000000000000000000000000..f17af0a1aaf42b1ee83f280cac1584d98fb90375 --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/templates/breadcrumbs.php @@ -0,0 +1,17 @@ +<ul class="ngg-breadcrumbs"> + <?php + $end = end($breadcrumbs); + reset($breadcrumbs); + foreach ($breadcrumbs as $crumb) { ?> + <li class="ngg-breadcrumb"> + <?php if (!is_null($crumb['url'])) { ?> + <a href="<?php echo $crumb['url']; ?>"><?php esc_html_e($crumb['name']); ?></a> + <?php } else { ?> + <?php esc_html_e($crumb['name']); ?> + <?php } ?> + <?php if ($crumb !== $end) { ?> + <span class="ngg-breadcrumb-divisor"><?php echo $divisor; ?></span> + <?php } ?> + </li> + <?php } ?> +</ul> \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/templates/compact.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/templates/compact.php index 3c0f615ea64c6a6c446ddce250c63892543ddd06..dedf96d6a44dc8bdda7ab45e0613c2dc079387a3 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/templates/compact.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/templates/compact.php @@ -20,7 +20,7 @@ <a class="ngg-album-desc" title="<?php echo esc_attr($gallery->title); ?>" href="<?php echo nextgen_esc_url($gallery->pagelink); ?>" - <?php echo $max_width; ?>> + <?php echo $max_width; ?>> <?php echo_safe_html($gallery->title); ?> </a> </h4> @@ -34,5 +34,6 @@ </div> <?php } ?> <br class="ngg-clear"/> + <?php echo $pagination ?> </div> <?php $this->end_element(); ?> diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/templates/extended.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/templates/extended.php index 50048d57cc0ba97206c595483fea5894843cd276..543570846f9c6fc5b8f07a344d86b2096c4f2864 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/templates/extended.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/templates/extended.php @@ -18,5 +18,6 @@ </div> </div> <?php } ?> + <?php echo $pagination ?> </div> <?php $this->end_element(); ?> diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/templates/nextgen_basic_album_gallery_display_type.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/templates/nextgen_basic_album_gallery_display_type.php index 2e20a82e4b400885acf679a1683dd77f70bafc30..9f4c1fcdfce398a61a2247cdd482fa8c46861b57 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/templates/nextgen_basic_album_gallery_display_type.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_album/templates/nextgen_basic_album_gallery_display_type.php @@ -2,19 +2,19 @@ <td> <label for="<?php echo esc_attr($display_type_name) ?>_gallery_display_type" class="tooltip" - title="<?php echo_h($gallery_display_type_help)?>"> - <?php echo_h($gallery_display_type_label)?> + title="<?php esc_attr_e($gallery_display_type_help)?>"> + <?php esc_html_e($gallery_display_type_label)?> </label> </td> <td> <select style="width: 400px" - id="<?php echo esc_attr($display_type_name) ?>_gallery_display_type" - name="<?php echo esc_attr($display_type_name)?>[gallery_display_type]"> + id="<?php esc_attr_e($display_type_name) ?>_gallery_display_type" + name="<?php esc_attr_e($display_type_name)?>[gallery_display_type]"> <?php foreach ($display_types as $display_type): ?> - <option value="<?php echo esc_attr($display_type->name) ?>" + <option value="<?php esc_attr_e($display_type->name) ?>" <?php selected($display_type->name, $gallery_display_type) ?>> - <?php echo_h(__($display_type->title, 'nggallery')); ?> + <?php esc_html_e(__($display_type->title, 'nggallery')); ?> </option> <?php endforeach ?> </select> diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/module.nextgen_basic_gallery.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/module.nextgen_basic_gallery.php index 409f8d474daaa3e3929a20e2537e6dbe057d44ed..86fd55208557a17cd01d4dd68f45304282d0adcb 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/module.nextgen_basic_gallery.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/module.nextgen_basic_gallery.php @@ -25,31 +25,39 @@ class M_NextGen_Basic_Gallery extends C_Base_Module 'photocrati-nextgen_basic_gallery', 'NextGEN Basic Gallery', "Provides NextGEN Gallery's basic thumbnail/slideshow integrated gallery", - '0.11', + '0.13', 'http://www.nextgen-gallery.com', 'Photocrati Media', 'http://www.photocrati.com' ); - include_once('class.nextgen_basic_gallery_installer.php'); C_Photocrati_Installer::add_handler($this->module_id, 'C_NextGen_Basic_Gallery_Installer'); } + function initialize() + { + parent::initialize(); + if (is_admin()) { + $forms = C_Form_Manager::get_instance(); + $forms->add_form(NGG_DISPLAY_SETTINGS_SLUG, NGG_BASIC_THUMBNAILS); + $forms->add_form(NGG_DISPLAY_SETTINGS_SLUG, NGG_BASIC_SLIDESHOW); + } + + } + function get_type_list() { return array( - 'A_Nextgen_Basic_Gallery_Forms' => 'adapter.nextgen_basic_gallery_forms.php', 'C_Nextgen_Basic_Gallery_Installer' => 'class.nextgen_basic_gallery_installer.php', 'A_Nextgen_Basic_Gallery_Mapper' => 'adapter.nextgen_basic_gallery_mapper.php', - 'A_Nextgen_Basic_Gallery_Routes' => 'adapter.nextgen_basic_gallery_routes.php', 'A_Nextgen_Basic_Gallery_Urls' => 'adapter.nextgen_basic_gallery_urls.php', 'A_Nextgen_Basic_Gallery_Validation' => 'adapter.nextgen_basic_gallery_validation.php', 'A_Nextgen_Basic_Slideshow_Controller' => 'adapter.nextgen_basic_slideshow_controller.php', 'A_Nextgen_Basic_Slideshow_Form' => 'adapter.nextgen_basic_slideshow_form.php', 'A_Nextgen_Basic_Thumbnail_Form' => 'adapter.nextgen_basic_thumbnail_form.php', 'A_Nextgen_Basic_Thumbnails_Controller' => 'adapter.nextgen_basic_thumbnails_controller.php', - 'Hook_Nextgen_Basic_Gallery_Integration' => 'hook.nextgen_basic_gallery_integration.php', - 'Mixin_Nextgen_Basic_Gallery_Controller' => 'mixin.nextgen_basic_gallery_controller.php' + 'Mixin_Nextgen_Basic_Gallery_Controller' => 'mixin.nextgen_basic_gallery_controller.php', + 'A_NextGen_Basic_Gallery_Controller' => 'adapter.nextgen_basic_gallery_controller.php' ); } @@ -70,18 +78,33 @@ class M_NextGen_Basic_Gallery extends C_Base_Module NGG_BASIC_THUMBNAILS ); } - - // Provides the controllers for the display types - $this->get_registry()->add_adapter( - 'I_Display_Type_Controller', - 'A_NextGen_Basic_Slideshow_Controller', - NGG_BASIC_SLIDESHOW - ); - $this->get_registry()->add_adapter( - 'I_Display_Type_Controller', - 'A_NextGen_Basic_Thumbnails_Controller', - NGG_BASIC_THUMBNAILS - ); + + // Frontend-only components + if (apply_filters('ngg_load_frontend_logic', TRUE, $this->module_id)) + { + // Provides the controllers for the display types + $this->get_registry()->add_adapter( + 'I_Display_Type_Controller', + 'A_NextGen_Basic_Slideshow_Controller', + NGG_BASIC_SLIDESHOW + ); + $this->get_registry()->add_adapter( + 'I_Display_Type_Controller', + 'A_NextGen_Basic_Thumbnails_Controller', + NGG_BASIC_THUMBNAILS + ); + + $this->get_registry()->add_adapter( + 'I_Display_Type_Controller', + 'A_NextGen_Basic_Gallery_Controller', + NGG_BASIC_SLIDESHOW + ); + $this->get_registry()->add_adapter( + 'I_Display_Type_Controller', + 'A_NextGen_Basic_Gallery_Controller', + NGG_BASIC_THUMBNAILS + ); + } // Provide defaults for the display types $this->get_registry()->add_adapter( @@ -100,40 +123,39 @@ class M_NextGen_Basic_Gallery extends C_Base_Module 'I_Routing_App', 'A_NextGen_Basic_Gallery_Urls' ); - - // Provides routing logic for the display types - $this->get_registry()->add_adapter( - 'I_Router', - 'A_NextGen_Basic_Gallery_Routes' - ); - - if (M_Attach_To_Post::is_atp_url() || is_admin()) - { - // Adds the settings forms - $this->get_registry()->add_adapter( - 'I_Form_Manager', - 'A_NextGen_Basic_Gallery_Forms' - ); - } } function _register_hooks() { - if (!defined('NGG_DISABLE_LEGACY_SHORTCODES') || !NGG_DISABLE_LEGACY_SHORTCODES) + if (apply_filters('ngg_load_frontend_logic', TRUE, $this->module_id) + && (!defined('NGG_DISABLE_LEGACY_SHORTCODES') || !NGG_DISABLE_LEGACY_SHORTCODES)) { C_NextGen_Shortcode_Manager::add('random', array(&$this, 'render_random_images')); C_NextGen_Shortcode_Manager::add('recent', array(&$this, 'render_recent_images')); C_NextGen_Shortcode_Manager::add('thumb', array(&$this, 'render_thumb_shortcode')); C_NextGen_Shortcode_Manager::add('slideshow', array(&$this, 'render_slideshow')); + C_NextGen_Shortcode_Manager::add('nggallery', array(&$this, 'render')); + C_NextGen_Shortcode_Manager::add('nggtags', array(&$this, 'render_based_on_tags')); + C_NextGen_Shortcode_Manager::add('nggslideshow', array(&$this, 'render_slideshow')); + C_NextGen_Shortcode_Manager::add('nggrandom', array(&$this, 'render_random_images')); + C_NextGen_Shortcode_Manager::add('nggrecent', array(&$this, 'render_recent_images')); + C_NextGen_Shortcode_Manager::add('nggthumb', array(&$this, 'render_thumb_shortcode')); } - C_NextGen_Shortcode_Manager::add('nggallery', array(&$this, 'render')); - C_NextGen_Shortcode_Manager::add('nggtags', array(&$this, 'render_based_on_tags')); - C_NextGen_Shortcode_Manager::add('nggslideshow', array(&$this, 'render_slideshow')); - C_NextGen_Shortcode_Manager::add('nggrandom', array(&$this, 'render_random_images')); - C_NextGen_Shortcode_Manager::add('nggrecent', array(&$this, 'render_recent_images')); - C_NextGen_Shortcode_Manager::add('nggthumb', array(&$this, 'render_thumb_shortcode')); + + add_action('ngg_routes', array(&$this, 'define_routes')); } + function define_routes($router) + { + $slug = '/'.C_NextGen_Settings::get_instance()->router_param_slug; + $router->rewrite("{*}{$slug}{*}/image/{*}", "{1}{$slug}{2}/pid--{3}"); + $router->rewrite("{*}{$slug}{*}/slideshow/{*}", "{1}{$slug}{2}/show--" . NGG_BASIC_SLIDESHOW . "/{3}"); + $router->rewrite("{*}{$slug}{*}/thumbnails/{*}", "{1}{$slug}{2}/show--". NGG_BASIC_THUMBNAILS . "/{3}"); + $router->rewrite("{*}{$slug}{*}/show--slide/{*}", "{1}{$slug}{2}/show--" . NGG_BASIC_SLIDESHOW . "/{3}"); + $router->rewrite("{*}{$slug}{*}/show--gallery/{*}", "{1}{$slug}{2}/show--" . NGG_BASIC_THUMBNAILS . "/{3}"); + $router->rewrite("{*}{$slug}{*}/page/{\\d}{*}", "{1}{$slug}{2}/nggpage--{3}{4}"); + } + /** * Gets a value from the parameter array, and if not available, uses the default value * @@ -164,7 +186,7 @@ class M_NextGen_Basic_Gallery extends C_Base_Module unset($params['id']); unset($params['images']); - $renderer = $this->get_registry()->get_utility('I_Displayed_Gallery_Renderer'); + $renderer = C_Displayed_Gallery_Renderer::get_instance(); return $renderer->display_images($params, $inner_content); } @@ -175,7 +197,7 @@ class M_NextGen_Basic_Gallery extends C_Base_Module $params['display_type'] = $this->_get_param('display_type', NGG_BASIC_THUMBNAILS, $params); unset($params['gallery']); - $renderer = $this->get_registry()->get_utility('I_Displayed_Gallery_Renderer'); + $renderer = C_Displayed_Gallery_Renderer::get_instance(); return $renderer->display_images($params, $inner_content); } @@ -196,7 +218,7 @@ class M_NextGen_Basic_Gallery extends C_Base_Module unset($params['max']); unset($params['id']); - $renderer = $this->get_registry()->get_utility('I_Displayed_Gallery_Renderer'); + $renderer = C_Displayed_Gallery_Renderer::get_instance(); return $renderer->display_images($params, $inner_content); } @@ -215,7 +237,7 @@ class M_NextGen_Basic_Gallery extends C_Base_Module unset($params['max']); unset($params['id']); - $renderer = $this->get_registry()->get_utility('I_Displayed_Gallery_Renderer'); + $renderer = C_Displayed_Gallery_Renderer::get_instance(); return $renderer->display_images($params, $inner_content); } @@ -226,7 +248,7 @@ class M_NextGen_Basic_Gallery extends C_Base_Module $params['display_type'] = $this->_get_param('display_type', NGG_BASIC_THUMBNAILS, $params); unset($params['id']); - $renderer = $this->get_registry()->get_utility('I_Displayed_Gallery_Renderer'); + $renderer = C_Displayed_Gallery_Renderer::get_instance(); return $renderer->display_images($params, $inner_content); } @@ -238,9 +260,85 @@ class M_NextGen_Basic_Gallery extends C_Base_Module $params['gallery_height'] = $this->_get_param('h', NULL, $params); unset($params['id'], $params['w'], $params['h']); - $renderer = $this->get_registry()->get_utility('I_Displayed_Gallery_Renderer'); + $renderer = C_Displayed_Gallery_Renderer::get_instance(); return $renderer->display_images($params, $inner_content); } } +/** + * Wrapper to I_Displayed_Gallery_Renderer->display_images(); this will display + * a basic thumbnails gallery + * + * @param int $galleryID Gallery ID + * @param string $template Path to template file + * @param bool $images_per_page Basic thumbnails setting + */ +function nggShowGallery($galleryID, $template = '', $images_per_page = FALSE) +{ + $args = array( + 'source' => 'galleries', + 'container_ids' => $galleryID + ); + + if (apply_filters('ngg_show_imagebrowser_first', FALSE, $galleryID)) + $args['display_type'] = NGG_BASIC_IMAGEBROWSER; + else + $args['display_type'] = NGG_BASIC_THUMBNAILS; + + if (!empty($template)) + $args['template'] = $template; + if (!empty($images_per_page)) + $args['images_per_page'] = $images_per_page; + + echo C_Displayed_Gallery_Renderer::get_instance()->display_images($args); +} + + +/** + * Wrapper to I_Displayed_Gallery_Renderer->display_images(); this will display + * a basic slideshow gallery + * + * @param int $galleryID Gallery ID + * @param int $width Gallery width + * @param int $height Gallery height + */ +function nggShowSlideshow($galleryID, $width, $height) +{ + $args = array( + 'source' => 'galleries', + 'container_ids' => $galleryID, + 'gallery_width' => $width, + 'gallery_height' => $height, + 'display_type' => NGG_BASIC_SLIDESHOW + ); + + echo C_Displayed_Gallery_Renderer::get_instance()->display_images($args); +} + +class C_NextGen_Basic_Gallery_Installer extends C_Gallery_Display_Installer +{ + function install() + { + $this->install_display_type(NGG_BASIC_THUMBNAILS, + array( + 'title' => __('NextGEN Basic Thumbnails', 'nggallery'), + 'entity_types' => array('image'), + 'preview_image_relpath' => 'photocrati-nextgen_basic_gallery#thumb_preview.jpg', + 'default_source' => 'galleries', + 'view_order' => NGG_DISPLAY_PRIORITY_BASE + ) + ); + + $this->install_display_type(NGG_BASIC_SLIDESHOW, + array( + 'title' => __('NextGEN Basic Slideshow', 'nggallery'), + 'entity_types' => array('image'), + 'preview_image_relpath' => 'photocrati-nextgen_basic_gallery#slideshow_preview.jpg', + 'default_source' => 'galleries', + 'view_order' => NGG_DISPLAY_PRIORITY_BASE + 10 + ) + ); + } +} + new M_NextGen_Basic_Gallery; diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/package.module.nextgen_basic_gallery.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/package.module.nextgen_basic_gallery.php new file mode 100644 index 0000000000000000000000000000000000000000..651c842d3bac3db1c3eb054eb272276cf1365b66 --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/package.module.nextgen_basic_gallery.php @@ -0,0 +1,559 @@ +<?php +class A_NextGen_Basic_Gallery_Controller extends Mixin +{ + public function index_action($displayed_gallery, $return = FALSE) + { + $retval = ''; + $call_parent = TRUE; + $show = $this->object->param('show'); + $pid = $this->object->param('pid'); + if (!empty($pid) && isset($displayed_gallery->display_settings['use_imagebrowser_effect']) && intval($displayed_gallery->display_settings['use_imagebrowser_effect'])) { + $show = NGG_BASIC_IMAGEBROWSER; + } + // Are we to display a different display type? + if (!empty($show)) { + $params = (array) $displayed_gallery->get_entity(); + $ds = $params['display_settings']; + if ((!empty($ds['show_slideshow_link']) || !empty($ds['show_thumbnail_link']) || !empty($ds['use_imagebrowser_effect'])) && $show != $this->object->context) { + // Render the new display type + $renderer = C_Displayed_Gallery_Renderer::get_instance(); + $displayed_gallery->original_display_type = $displayed_gallery->display_type; + $displayed_gallery->original_settings = $displayed_gallery->display_settings; + $displayed_gallery->display_type = $show; + $params = (array) $displayed_gallery->get_entity(); + $params['display_settings'] = array(); + $retval = $renderer->display_images($params, $return); + $call_parent = FALSE; + } + } + return $call_parent ? $this->call_parent('index_action', $displayed_gallery, $return) : $retval; + } + /** + * Returns a url to view the displayed gallery using an alternate display + * type + * @param C_Displayed_Gallery $displayed_gallery + * @param string $display_type + * @return string + */ + public function get_url_for_alternate_display_type($displayed_gallery, $display_type, $origin_url = FALSE) + { + if (!$origin_url && !empty($displayed_gallery->display_settings['original_display_type']) && !empty($_SERVER['ORIG_REQUEST_URI'])) { + $origin_url = $_SERVER['ORIG_REQUEST_URI']; + } + $url = $origin_url ? $origin_url : $this->object->get_routed_url(TRUE); + $url = $this->object->remove_param_for($url, 'show', $displayed_gallery->id()); + $url = $this->object->set_param_for($url, 'show', $display_type, $displayed_gallery->id()); + return $url; + } +} +/** + * Sets default values for the NextGen Basic Slideshow display type + */ +class A_NextGen_Basic_Gallery_Mapper extends Mixin +{ + public function set_defaults($entity) + { + $this->call_parent('set_defaults', $entity); + if (isset($entity->name)) { + if ($entity->name == NGG_BASIC_SLIDESHOW) { + $this->set_slideshow_defaults($entity); + } else { + if ($entity->name == NGG_BASIC_THUMBNAILS) { + $this->set_thumbnail_defaults($entity); + } + } + } + } + public function set_slideshow_defaults($entity) + { + $settings = C_NextGen_Settings::get_instance(); + $this->object->_set_default_value($entity, 'settings', 'gallery_width', $settings->irWidth); + $this->object->_set_default_value($entity, 'settings', 'gallery_height', $settings->irHeight); + $this->object->_set_default_value($entity, 'settings', 'thumbnail_width', $settings->thumbwidth); + $this->object->_set_default_value($entity, 'settings', 'thumbnail_height', $settings->thumbheight); + $this->object->_set_default_value($entity, 'settings', 'cycle_interval', $settings->irRotatetime); + $this->object->_set_default_value($entity, 'settings', 'cycle_effect', $settings->slideFx); + $this->object->_set_default_value($entity, 'settings', 'effect_code', $settings->thumbCode); + $this->object->_set_default_value($entity, 'settings', 'show_thumbnail_link', $settings->galShowSlide ? 1 : 0); + $this->object->_set_default_value($entity, 'settings', 'thumbnail_link_text', $settings->galTextGallery); + $this->object->_set_default_value($entity, 'settings', 'template', ''); + // Part of the pro-modules + $this->object->_set_default_value($entity, 'settings', 'ngg_triggers_display', 'never'); + } + public function set_thumbnail_defaults($entity) + { + $settings = C_NextGen_Settings::get_instance(); + $this->object->_set_default_value($entity, 'settings', 'images_per_page', $settings->galImages); + $this->object->_set_default_value($entity, 'settings', 'number_of_columns', $settings->galColumns); + $this->object->_set_default_value($entity, 'settings', 'thumbnail_width', $settings->thumbwidth); + $this->object->_set_default_value($entity, 'settings', 'thumbnail_height', $settings->thumbheight); + $this->object->_set_default_value($entity, 'settings', 'show_all_in_lightbox', $settings->galHiddenImg); + $this->object->_set_default_value($entity, 'settings', 'ajax_pagination', $settings->galAjaxNav); + $this->object->_set_default_value($entity, 'settings', 'use_imagebrowser_effect', $settings->galImgBrowser); + $this->object->_set_default_value($entity, 'settings', 'template', ''); + $this->object->_set_default_value($entity, 'settings', 'display_no_images_error', 1); + // TODO: Should this be called enable pagination? + $this->object->_set_default_value($entity, 'settings', 'disable_pagination', 0); + // Alternative view support + $this->object->_set_default_value($entity, 'settings', 'show_slideshow_link', $settings->galShowSlide ? 1 : 0); + $this->object->_Set_default_value($entity, 'settings', 'slideshow_link_text', $settings->galTextSlide); + // override thumbnail settings + $this->object->_set_default_value($entity, 'settings', 'override_thumbnail_settings', 0); + $this->object->_set_default_value($entity, 'settings', 'thumbnail_quality', '100'); + $this->object->_set_default_value($entity, 'settings', 'thumbnail_crop', 1); + $this->object->_set_default_value($entity, 'settings', 'thumbnail_watermark', 0); + // Part of the pro-modules + $this->object->_set_default_value($entity, 'settings', 'ngg_triggers_display', 'never'); + } +} +class A_NextGen_Basic_Gallery_Urls extends Mixin +{ + public function create_parameter_segment($key, $value, $id = NULL, $use_prefix = FALSE) + { + if ($key == 'show') { + if ($value == NGG_BASIC_SLIDESHOW) { + $value = 'slideshow'; + } elseif ($value == NGG_BASIC_THUMBNAILS) { + $value = 'thumbnails'; + } elseif ($value == NGG_BASIC_IMAGEBROWSER) { + $value = 'imagebrowser'; + } + return $value; + } elseif ($key == 'nggpage') { + return 'page/' . $value; + } else { + return $this->call_parent('create_parameter_segment', $key, $value, $id, $use_prefix); + } + } + public function set_parameter_value($key, $value, $id = NULL, $use_prefix = FALSE, $url = FALSE) + { + $retval = $this->call_parent('set_parameter_value', $key, $value, $id, $use_prefix, $url); + return $this->_set_ngglegacy_page_parameter($retval, $key, $value, $id, $use_prefix); + } + public function remove_parameter($key, $id = NULL, $url = FALSE) + { + $retval = $this->call_parent('remove_parameter', $key, $id, $url); + $retval = $this->_set_ngglegacy_page_parameter($retval, $key); + // For some reason, we're not removing our parameters the way we should. Our routing system seems to be + // a bit broken and so I'm adding an exception here. + // TODO: Our parameter manipulations need to be flawless. Look into route cause + if ($key == 'show') { + $uri = explode('?', $retval); + $uri = $uri[0]; + $settings = C_NextGen_Settings::get_instance(); + $regex = '#/' . $settings->router_param_slug . '.*(/?(slideshow|thumbnails|imagebrowser)/?)#'; + if (preg_match($regex, $retval, $matches)) { + $retval = str_replace($matches[1], '', $retval); + } + } + return $retval; + } + public function _set_ngglegacy_page_parameter($retval, $key, $value = NULL, $id = NULL, $use_prefix = NULL) + { + // Get the settings manager + $settings = C_NextGen_Settings::get_instance(); + // Create regex pattern + $param_slug = preg_quote($settings->router_param_slug, '#'); + if ($key == 'nggpage') { + $regex = "#(/{$param_slug}/.*)(/?page/\\d+/?)(.*)#"; + if (preg_match($regex, $retval, $matches)) { + $new_segment = $value ? "/page/{$value}" : ''; + $retval = rtrim(str_replace($matches[0], rtrim($matches[1], '/') . $new_segment . ltrim($matches[3], '/'), $retval), '/'); + } + } + # Convert the nggpage parameter to a slug + if (preg_match("#(/{$param_slug}/.*)nggpage--(.*)#", $retval, $matches)) { + $retval = rtrim(str_replace($matches[0], rtrim($matches[1], '/') . '/page/' . ltrim($matches[2], '/'), $retval), '/'); + } + # Convert the show parameter to a slug + if (preg_match("#(/{$param_slug}/.*)show--(.*)#", $retval, $matches)) { + $retval = rtrim(str_replace($matches[0], rtrim($matches[1], '/') . '/' . $matches[2], $retval), '/'); + $retval = str_replace(NGG_BASIC_SLIDESHOW, 'slideshow', $retval); + $retval = str_replace(NGG_BASIC_THUMBNAILS, 'thumbnails', $retval); + $retval = str_replace(NGG_BASIC_IMAGEBROWSER, 'imagebrowser', $retval); + } + return $retval; + } +} +class A_NextGen_Basic_Gallery_Validation extends Mixin +{ + public function validation() + { + if ($this->object->name == NGG_BASIC_THUMBNAILS) { + $this->object->validates_presence_of('thumbnail_width'); + $this->object->validates_presence_of('thumbnail_height'); + $this->object->validates_numericality_of('thumbnail_width'); + $this->object->validates_numericality_of('thumbnail_height'); + $this->object->validates_numericality_of('images_per_page'); + } else { + if ($this->object->name == NGG_BASIC_SLIDESHOW) { + $this->object->validates_presence_of('gallery_width'); + $this->object->validates_presence_of('gallery_height'); + $this->object->validates_numericality_of('gallery_width'); + $this->object->validates_numericality_of('gallery_height'); + } + } + return $this->call_parent('validation'); + } +} +class A_NextGen_Basic_Slideshow_Controller extends Mixin +{ + /** + * Displays the ngglegacy thumbnail gallery. + * This method deprecates the use of the nggShowGallery() function. + * @param stdClass|C_Displayed_Gallery|C_DataMapper_Model $displayed_gallery + */ + public function index_action($displayed_gallery, $return = FALSE) + { + // Get the images to be displayed + $current_page = (int) $this->param('nggpage', 1); + if ($images = $displayed_gallery->get_included_entities()) { + // Get the gallery storage component + $storage = C_Gallery_Storage::get_instance(); + // Create parameter list for the view + $params = $displayed_gallery->display_settings; + $params['storage'] =& $storage; + $params['images'] =& $images; + $params['displayed_gallery_id'] = $displayed_gallery->id(); + $params['current_page'] = $current_page; + $params['effect_code'] = $this->object->get_effect_code($displayed_gallery); + $params['anchor'] = 'ngg-slideshow-' . $displayed_gallery->id() . '-' . rand(1, getrandmax()) . $current_page; + $gallery_width = $displayed_gallery->display_settings['gallery_width']; + $gallery_height = $displayed_gallery->display_settings['gallery_height']; + $params['aspect_ratio'] = $gallery_width / $gallery_height; + $params['placeholder'] = $this->object->get_static_url('photocrati-nextgen_basic_gallery#slideshow/placeholder.gif'); + // Are we to generate a thumbnail link? + if ($displayed_gallery->display_settings['show_thumbnail_link']) { + $params['thumbnail_link'] = $this->object->get_url_for_alternate_display_type($displayed_gallery, NGG_BASIC_THUMBNAILS); + } + $params = $this->object->prepare_display_parameters($displayed_gallery, $params); + $retval = $this->object->render_partial('photocrati-nextgen_basic_gallery#slideshow/index', $params, $return); + } else { + $retval = $this->object->render_partial('photocrati-nextgen_gallery_display#no_images_found', array(), $return); + } + return $retval; + } + /** + * Enqueues all static resources required by this display type + * @param C_Displayed_Gallery $displayed_gallery + */ + public function enqueue_frontend_resources($displayed_gallery) + { + $resource = defined('SCRIPT_DEBUG') ? 'jquery.cycle.all.min.js' : 'jquery.cycle.all.js'; + wp_register_script('jquery-cycle', $this->get_static_url("photocrati-nextgen_basic_gallery#slideshow/{$resource}"), array('jquery')); + wp_enqueue_script('jquery-cycle'); + wp_enqueue_style('nextgen_basic_slideshow_style', $this->get_static_url('photocrati-nextgen_basic_gallery#slideshow/nextgen_basic_slideshow.css')); + wp_enqueue_script('waitforimages', $this->get_static_url('photocrati-nextgen_basic_gallery#slideshow/jquery.waitforimages.js'), array('jquery')); + $this->call_parent('enqueue_frontend_resources', $displayed_gallery); + $this->enqueue_ngg_styles(); + } + /** + * Provides the url of the JavaScript library required for + * NextGEN Basic Slideshow to display + * @return string + */ + public function _get_js_lib_url() + { + return $this->get_static_url('photocrati-nextgen_basic_gallery#slideshow/nextgen_basic_slideshow.js'); + } +} +/** + * Provides the display settings form for the NextGen Basic Slideshow + */ +class A_NextGen_Basic_Slideshow_Form extends Mixin_Display_Type_Form +{ + public function get_display_type_name() + { + return NGG_BASIC_SLIDESHOW; + } + public function enqueue_static_resources() + { + wp_enqueue_script('nextgen_basic_slideshow_settings-js', $this->get_static_url('photocrati-nextgen_basic_gallery#slideshow/nextgen_basic_slideshow_settings.js'), array('jquery.nextgen_radio_toggle')); + $atp = C_Attach_Controller::get_instance(); + if ($atp != null) { + $atp->mark_script('nextgen_basic_slideshow_settings-js'); + } + } + /** + * Returns a list of fields to render on the settings page + */ + public function _get_field_names() + { + return array('nextgen_basic_slideshow_gallery_dimensions', 'nextgen_basic_slideshow_cycle_effect', 'nextgen_basic_slideshow_cycle_interval', 'nextgen_basic_slideshow_show_thumbnail_link', 'nextgen_basic_slideshow_thumbnail_link_text'); + } + public function _render_nextgen_basic_slideshow_cycle_interval_field($display_type) + { + return $this->_render_number_field($display_type, 'cycle_interval', __('Interval', 'nggallery'), $display_type->settings['cycle_interval'], '', FALSE, __('# of seconds', 'nggallery'), 1); + } + public function _render_nextgen_basic_slideshow_cycle_effect_field($display_type) + { + return $this->_render_select_field($display_type, 'cycle_effect', 'Effect', array('fade' => 'fade', 'blindX' => 'blindX', 'cover' => 'cover', 'scrollUp' => 'scrollUp', 'scrollDown' => 'scrollDown', 'shuffle' => 'shuffle', 'toss' => 'toss', 'wipe' => 'wipe'), $display_type->settings['cycle_effect'], '', FALSE); + } + public function _render_nextgen_basic_slideshow_gallery_dimensions_field($display_type) + { + return $this->render_partial('photocrati-nextgen_basic_gallery#slideshow/nextgen_basic_slideshow_settings_gallery_dimensions', array('display_type_name' => $display_type->name, 'gallery_dimensions_label' => __('Maximum dimensions', 'nggallery'), 'gallery_dimensions_tooltip' => __('Certain themes may allow images to flow over their container if this setting is too large', 'nggallery'), 'gallery_width' => $display_type->settings['gallery_width'], 'gallery_height' => $display_type->settings['gallery_height']), True); + } + /** + * Renders the show_thumbnail_link settings field + * + * @param C_Display_Type $display_type + * @return string + */ + public function _render_nextgen_basic_slideshow_show_thumbnail_link_field($display_type) + { + return $this->_render_radio_field($display_type, 'show_thumbnail_link', __('Show thumbnail link', 'nggallery'), $display_type->settings['show_thumbnail_link']); + } + /** + * Renders the thumbnail_link_text settings field + * + * @param C_Display_Type $display_type + * @return string + */ + public function _render_nextgen_basic_slideshow_thumbnail_link_text_field($display_type) + { + return $this->_render_text_field($display_type, 'thumbnail_link_text', __('Thumbnail link text', 'nggallery'), $display_type->settings['thumbnail_link_text'], '', !empty($display_type->settings['show_thumbnail_link']) ? FALSE : TRUE); + } +} +class A_NextGen_Basic_Thumbnail_Form extends Mixin_Display_Type_Form +{ + public function get_display_type_name() + { + return NGG_BASIC_THUMBNAILS; + } + /** + * Enqueues static resources required by this form + */ + public function enqueue_static_resources() + { + wp_enqueue_style('nextgen_basic_thumbnails_settings', $this->object->get_static_url('photocrati-nextgen_basic_gallery#thumbnails/nextgen_basic_thumbnails_settings.css'), false); + wp_enqueue_script('nextgen_basic_thumbnails_settings', $this->object->get_static_url('photocrati-nextgen_basic_gallery#thumbnails/nextgen_basic_thumbnails_settings.js'), array('jquery.nextgen_radio_toggle')); + $atp = C_Attach_Controller::get_instance(); + if ($atp != null) { + $atp->mark_script('nextgen_basic_thumbnails_settings'); + } + } + /** + * Returns a list of fields to render on the settings page + */ + public function _get_field_names() + { + return array('thumbnail_override_settings', 'nextgen_basic_thumbnails_images_per_page', 'nextgen_basic_thumbnails_number_of_columns', 'nextgen_basic_thumbnails_ajax_pagination', 'nextgen_basic_thumbnails_hidden', 'nextgen_basic_thumbnails_imagebrowser_effect', 'nextgen_basic_thumbnails_show_slideshow_link', 'nextgen_basic_thumbnails_slideshow_link_text', 'nextgen_basic_templates_template'); + } + /** + * Renders the images_per_page settings field + * + * @param C_Display_Type $display_type + * @return string + */ + public function _render_nextgen_basic_thumbnails_images_per_page_field($display_type) + { + return $this->_render_number_field($display_type, 'images_per_page', __('Images per page', 'nggallery'), $display_type->settings['images_per_page'], __('0 will display all images at once', 'nggallery'), FALSE, '# of images', 0); + } + /** + * Renders the number_of_columns settings field + * + * @param C_Display_Type $display_type + * @return string + */ + public function _render_nextgen_basic_thumbnails_number_of_columns_field($display_type) + { + return $this->_render_number_field($display_type, 'number_of_columns', __('Number of columns to display', 'nggallery'), $display_type->settings['number_of_columns'], '', FALSE, __('# of columns', 'nggallery'), 0); + } + /** + * Renders the 'Add hidden images' settings field + * + * @param C_Display_Type $display_type + * @return string + */ + public function _render_nextgen_basic_thumbnails_hidden_field($display_type) + { + return $this->_render_radio_field($display_type, 'show_all_in_lightbox', __('Add Hidden Images', 'nggallery'), $display_type->settings['show_all_in_lightbox'], __('If pagination is used this option will show all images in the modal window (Thickbox, Lightbox etc.) This increases page load.', 'nggallery')); + } + public function _render_nextgen_basic_thumbnails_imagebrowser_effect_field($display_type) + { + return $this->_render_radio_field($display_type, 'use_imagebrowser_effect', __('Use imagebrowser effect', 'nggallery'), $display_type->settings['use_imagebrowser_effect'], __('When active each image in the gallery will link to an imagebrowser display and lightbox effects will not be applied.', 'nggallery')); + } + /** + * Renders the AJAX pagination settings field + * + * @param C_Display_Type $display_type + * @return string + */ + public function _render_nextgen_basic_thumbnails_ajax_pagination_field($display_type) + { + return $this->_render_radio_field($display_type, 'ajax_pagination', __('Enable AJAX pagination', 'nggallery'), $display_type->settings['ajax_pagination'], __('Browse images without reloading the page.', 'nggallery')); + } + /** + * Renders the show_slideshow_link settings field + * + * @param C_Display_Type $display_type + * @return string + */ + public function _render_nextgen_basic_thumbnails_show_slideshow_link_field($display_type) + { + return $this->_render_radio_field($display_type, 'show_slideshow_link', __('Show slideshow link', 'nggallery'), $display_type->settings['show_slideshow_link']); + } + /** + * Renders the slideshow_link_text settings field + * + * @param C_Display_Type $display_type + * @return string + */ + public function _render_nextgen_basic_thumbnails_slideshow_link_text_field($display_type) + { + return $this->_render_text_field($display_type, 'slideshow_link_text', __('Slideshow link text', 'nggallery'), $display_type->settings['slideshow_link_text'], '', !empty($display_type->settings['show_slideshow_link']) ? FALSE : TRUE); + } +} +class A_NextGen_Basic_Thumbnails_Controller extends Mixin +{ + /** + * Adds framework support for thumbnails + */ + public function initialize() + { + $this->add_mixin('Mixin_NextGen_Basic_Pagination'); + } + /** + * Displays the ngglegacy thumbnail gallery. + * This method deprecates the use of the nggShowGallery() function. + * @param stdClass|C_Displayed_Gallery|C_DataMapper_Model $displayed_gallery + */ + public function index_action($displayed_gallery, $return = FALSE) + { + $display_settings = $displayed_gallery->display_settings; + $gallery_id = $displayed_gallery->id(); + $transient_id = $displayed_gallery->transient_id; + // We must use the transient_id to identify the gallery + if ($display_settings['ajax_pagination']) { + $gallery_id = $transient_id; + } + if (!$display_settings['disable_pagination']) { + $current_page = (int) $this->param('nggpage', $gallery_id, 1); + } else { + $current_page = 1; + } + $offset = $display_settings['images_per_page'] * ($current_page - 1); + $storage = C_Gallery_Storage::get_instance(); + $total = $displayed_gallery->get_entity_count(); + // Get the images to be displayed + if ($display_settings['images_per_page'] > 0 && $display_settings['show_all_in_lightbox']) { + // the "Add Hidden Images" feature works by loading ALL images and then marking the ones not on this page + // as hidden (style="display: none") + $images = $displayed_gallery->get_included_entities(); + $i = 0; + foreach ($images as &$image) { + if ($i < $display_settings['images_per_page'] * ($current_page - 1)) { + $image->hidden = TRUE; + } elseif ($i >= $display_settings['images_per_page'] * $current_page) { + $image->hidden = TRUE; + } + $i++; + } + } else { + // just display the images for this page, as normal + $images = $displayed_gallery->get_included_entities($display_settings['images_per_page'], $offset); + } + if (in_array($displayed_gallery->source, array('random_images', 'recent_images'))) { + $display_settings['disable_pagination'] = TRUE; + } + // Are there images to display? + if ($images) { + // Create pagination + if ($display_settings['images_per_page'] && !$display_settings['disable_pagination']) { + $pagination_result = $this->object->create_pagination($current_page, $total, $display_settings['images_per_page'], urldecode($this->object->param('ajax_pagination_referrer'))); + $this->object->remove_param('ajax_pagination_referrer'); + $pagination_prev = $pagination_result['prev']; + $pagination_next = $pagination_result['next']; + $pagination = $pagination_result['output']; + } else { + list($pagination_prev, $pagination_next, $pagination) = array(NULL, NULL, NULL); + } + $thumbnail_size_name = 'thumbnail'; + if ($display_settings['override_thumbnail_settings']) { + $dynthumbs = C_Dynamic_Thumbnails_Manager::get_instance(); + if ($dynthumbs != null) { + $dyn_params = array('width' => $display_settings['thumbnail_width'], 'height' => $display_settings['thumbnail_height']); + if ($display_settings['thumbnail_quality']) { + $dyn_params['quality'] = $display_settings['thumbnail_quality']; + } + if ($display_settings['thumbnail_crop']) { + $dyn_params['crop'] = true; + } + if ($display_settings['thumbnail_watermark']) { + $dyn_params['watermark'] = true; + } + $thumbnail_size_name = $dynthumbs->get_size_name($dyn_params); + } + } + // Generate a slideshow link + $slideshow_link = ''; + if ($display_settings['show_slideshow_link']) { + // origin_url is necessary for ajax operations. slideshow_link_origin will NOT always exist. + $origin_url = $this->object->param('ajax_pagination_referrer'); + $slideshow_link = $this->object->get_url_for_alternate_display_type($displayed_gallery, NGG_BASIC_SLIDESHOW, $origin_url); + } + // This setting 1) points all images to an imagebrowser display & 2) disables the lightbox effect + if ($display_settings['use_imagebrowser_effect']) { + // // this hook *MUST* be removed later; it should not apply to galleries that may come after this one! + // $storage->add_post_hook( + // 'get_image_url', + // 'imagebrowser alternate url replacer', + // 'Hook_NextGen_Basic_Imagebrowser_Alt_URLs', + // 'get_image_url' + // ); + // $effect_code = ''; + $effect_code = 'class=\'use_imagebrowser_effect\''; + } else { + $effect_code = $this->object->get_effect_code($displayed_gallery); + } + // The render functions require different processing + if (!empty($display_settings['template'])) { + $this->object->add_mixin('A_NextGen_Basic_Template_Form'); + $this->object->add_mixin('Mixin_NextGen_Basic_Templates'); + $params = $this->object->prepare_legacy_parameters($images, $displayed_gallery, array('next' => empty($pagination_next) ? FALSE : $pagination_next, 'prev' => empty($pagination_prev) ? FALSE : $pagination_prev, 'pagination' => $pagination, 'slideshow_link' => $slideshow_link, 'effect_code' => $effect_code)); + $output = $this->object->legacy_render($display_settings['template'], $params, $return, 'gallery'); + } else { + $params = $display_settings; + $params['storage'] =& $storage; + $params['images'] =& $images; + $params['displayed_gallery_id'] = $gallery_id; + $params['transient_id'] = $displayed_gallery->transient_id; + $params['current_page'] = $current_page; + $params['effect_code'] = $effect_code; + $params['pagination'] = $pagination; + $params['thumbnail_size_name'] = $thumbnail_size_name; + $params['slideshow_link'] = $slideshow_link; + $params = $this->object->prepare_display_parameters($displayed_gallery, $params); + $output = $this->object->render_view('photocrati-nextgen_basic_gallery#thumbnails/index', $params, $return); + } + return $output; + } else { + if ($display_settings['display_no_images_error']) { + return $this->object->render_partial('photocrati-nextgen_gallery_display#no_images_found', array(), $return); + } + } + } + /** + * Enqueues all static resources required by this display type + * @param C_Displayed_Gallery $displayed_gallery + */ + public function enqueue_frontend_resources($displayed_gallery) + { + $this->call_parent('enqueue_frontend_resources', $displayed_gallery); + wp_enqueue_style('nextgen_basic_thumbnails_style', $this->get_static_url('photocrati-nextgen_basic_gallery#thumbnails/nextgen_basic_thumbnails.css')); + if ($displayed_gallery->display_settings['ajax_pagination']) { + wp_enqueue_script('nextgen-basic-thumbnails-ajax-pagination', $this->object->get_static_url('photocrati-nextgen_basic_gallery#thumbnails/ajax_pagination.js')); + } + wp_enqueue_style('nextgen_pagination_style', $this->get_static_url('photocrati-nextgen_pagination#style.css')); + $this->enqueue_ngg_styles(); + } + /** + * Provides the url of the JavaScript library required for + * NextGEN Basic Thumbnails to display + * @return string + */ + public function _get_js_lib_url() + { + return $this->object->get_static_url('photocrati-nextgen_basic_gallery#thumbnails/nextgen_basic_thumbnails.js'); + } +} \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/slideshow/imagerotator.swf b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/slideshow/imagerotator.swf index 6c2d76f32a78e6cec140b53bddf336cd987bcdc4..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 Binary files a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/slideshow/imagerotator.swf and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/slideshow/imagerotator.swf differ diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/slideshow/jquery.cycle.all.min.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/slideshow/jquery.cycle.all.min.js index 57f08336eaeaa08e5ef78f5251e16959f6e2cf00..fdd67797e972ba854b70168709720b5053796a5a 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/slideshow/jquery.cycle.all.min.js +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/slideshow/jquery.cycle.all.min.js @@ -1,10 +1 @@ -/*! - * jQuery Cycle Plugin (with Transition Definitions) - * Examples and documentation at: http://jquery.malsup.com/cycle/ - * Copyright (c) 2007-2010 M. Alsup - * Version: 2.9999.6 (11-SEP-2012) - * Dual licensed under the MIT and GPL licenses. - * http://jquery.malsup.com/license.html - * Requires: jQuery v1.3.2 or later - */ -(function(a,b){function d(b){if(a.fn.cycle.debug)e(b)}function e(){if(window.console&&console.log)console.log("[cycle] "+Array.prototype.join.call(arguments," "))}function f(b,c,d){var e=a(b).data("cycle.opts");var f=!!b.cyclePause;if(f&&e.paused)e.paused(b,e,c,d);else if(!f&&e.resumed)e.resumed(b,e,c,d)}function g(c,d,g){function k(b,c,d){if(!b&&c===true){var f=a(d).data("cycle.opts");if(!f){e("options not found, can not resume");return false}if(d.cycleTimeout){clearTimeout(d.cycleTimeout);d.cycleTimeout=0}n(f.elements,f,1,!f.backwards)}}if(c.cycleStop===b)c.cycleStop=0;if(d===b||d===null)d={};if(d.constructor==String){switch(d){case"destroy":case"stop":var h=a(c).data("cycle.opts");if(!h)return false;c.cycleStop++;if(c.cycleTimeout)clearTimeout(c.cycleTimeout);c.cycleTimeout=0;if(h.elements)a(h.elements).stop();a(c).removeData("cycle.opts");if(d=="destroy")i(c,h);return false;case"toggle":c.cyclePause=c.cyclePause===1?0:1;k(c.cyclePause,g,c);f(c);return false;case"pause":c.cyclePause=1;f(c);return false;case"resume":c.cyclePause=0;k(false,g,c);f(c);return false;case"prev":case"next":h=a(c).data("cycle.opts");if(!h){e('options not found, "prev/next" ignored');return false}a.fn.cycle[d](h);return false;default:d={fx:d}}return d}else if(d.constructor==Number){var j=d;d=a(c).data("cycle.opts");if(!d){e("options not found, can not advance slide");return false}if(j<0||j>=d.elements.length){e("invalid slide index: "+j);return false}d.nextSlide=j;if(c.cycleTimeout){clearTimeout(c.cycleTimeout);c.cycleTimeout=0}if(typeof g=="string")d.oneTimeFx=g;n(d.elements,d,1,j>=d.currSlide);return false}return d}function h(b,c){if(!a.support.opacity&&c.cleartype&&b.style.filter){try{b.style.removeAttribute("filter")}catch(d){}}}function i(b,c){if(c.next)a(c.next).unbind(c.prevNextEvent);if(c.prev)a(c.prev).unbind(c.prevNextEvent);if(c.pager||c.pagerAnchorBuilder)a.each(c.pagerAnchors||[],function(){this.unbind().remove()});c.pagerAnchors=null;a(b).unbind("mouseenter.cycle mouseleave.cycle");if(c.destroy)c.destroy(c)}function j(c,d,g,i,j){var o;var s=a.extend({},a.fn.cycle.defaults,i||{},a.metadata?c.metadata():a.meta?c.data():{});var t=a.isFunction(c.data)?c.data(s.metaAttr):null;if(t)s=a.extend(s,t);if(s.autostop)s.countdown=s.autostopCount||g.length;var u=c[0];c.data("cycle.opts",s);s.$cont=c;s.stopCount=u.cycleStop;s.elements=g;s.before=s.before?[s.before]:[];s.after=s.after?[s.after]:[];if(!a.support.opacity&&s.cleartype)s.after.push(function(){h(this,s)});if(s.continuous)s.after.push(function(){n(g,s,0,!s.backwards)});k(s);if(!a.support.opacity&&s.cleartype&&!s.cleartypeNoBg)r(d);if(c.css("position")=="static")c.css("position","relative");if(s.width)c.width(s.width);if(s.height&&s.height!="auto")c.height(s.height);if(s.startingSlide!==b){s.startingSlide=parseInt(s.startingSlide,10);if(s.startingSlide>=g.length||s.startSlide<0)s.startingSlide=0;else o=true}else if(s.backwards)s.startingSlide=g.length-1;else s.startingSlide=0;if(s.random){s.randomMap=[];for(var v=0;v<g.length;v++)s.randomMap.push(v);s.randomMap.sort(function(a,b){return Math.random()-.5});if(o){for(var w=0;w<g.length;w++){if(s.startingSlide==s.randomMap[w]){s.randomIndex=w}}}else{s.randomIndex=1;s.startingSlide=s.randomMap[1]}}else if(s.startingSlide>=g.length)s.startingSlide=0;s.currSlide=s.startingSlide||0;var x=s.startingSlide;d.css({position:"absolute",top:0,left:0}).hide().each(function(b){var c;if(s.backwards)c=x?b<=x?g.length+(b-x):x-b:g.length-b;else c=x?b>=x?g.length-(b-x):x-b:g.length-b;a(this).css("z-index",c)});a(g[x]).css("opacity",1).show();h(g[x],s);if(s.fit){if(!s.aspect){if(s.width)d.width(s.width);if(s.height&&s.height!="auto")d.height(s.height)}else{d.each(function(){var b=a(this);var c=s.aspect===true?b.width()/b.height():s.aspect;if(s.width&&b.width()!=s.width){b.width(s.width);b.height(s.width/c)}if(s.height&&b.height()<s.height){b.height(s.height);b.width(s.height*c)}})}}if(s.center&&(!s.fit||s.aspect)){d.each(function(){var b=a(this);b.css({"margin-left":s.width?(s.width-b.width())/2+"px":0,"margin-top":s.height?(s.height-b.height())/2+"px":0})})}if(s.center&&!s.fit&&!s.slideResize){d.each(function(){var b=a(this);b.css({"margin-left":s.width?(s.width-b.width())/2+"px":0,"margin-top":s.height?(s.height-b.height())/2+"px":0})})}var y=(s.containerResize||s.containerResizeHeight)&&!c.innerHeight();if(y){var z=0,A=0;for(var B=0;B<g.length;B++){var C=a(g[B]),D=C[0],E=C.outerWidth(),F=C.outerHeight();if(!E)E=D.offsetWidth||D.width||C.attr("width");if(!F)F=D.offsetHeight||D.height||C.attr("height");z=E>z?E:z;A=F>A?F:A}if(s.containerResize&&z>0&&A>0)c.css({width:z+"px",height:A+"px"});if(s.containerResizeHeight&&A>0)c.css({height:A+"px"})}var G=false;if(s.pause)c.bind("mouseenter.cycle",function(){G=true;this.cyclePause++;f(u,true)}).bind("mouseleave.cycle",function(){if(G)this.cyclePause--;f(u,true)});if(l(s)===false)return false;var H=false;i.requeueAttempts=i.requeueAttempts||0;d.each(function(){var b=a(this);this.cycleH=s.fit&&s.height?s.height:b.height()||this.offsetHeight||this.height||b.attr("height")||0;this.cycleW=s.fit&&s.width?s.width:b.width()||this.offsetWidth||this.width||b.attr("width")||0;if(b.is("img")){var c=a.browser.msie&&this.cycleW==28&&this.cycleH==30&&!this.complete;var d=a.browser.mozilla&&this.cycleW==34&&this.cycleH==19&&!this.complete;var f=a.browser.opera&&(this.cycleW==42&&this.cycleH==19||this.cycleW==37&&this.cycleH==17)&&!this.complete;var g=this.cycleH===0&&this.cycleW===0&&!this.complete;if(c||d||f||g){if(j.s&&s.requeueOnImageNotLoaded&&++i.requeueAttempts<100){e(i.requeueAttempts," - img slide not loaded, requeuing slideshow: ",this.src,this.cycleW,this.cycleH);setTimeout(function(){a(j.s,j.c).cycle(i)},s.requeueTimeout);H=true;return false}else{e("could not determine size of image: "+this.src,this.cycleW,this.cycleH)}}}return true});if(H)return false;s.cssBefore=s.cssBefore||{};s.cssAfter=s.cssAfter||{};s.cssFirst=s.cssFirst||{};s.animIn=s.animIn||{};s.animOut=s.animOut||{};d.not(":eq("+x+")").css(s.cssBefore);a(d[x]).css(s.cssFirst);if(s.timeout){s.timeout=parseInt(s.timeout,10);if(s.speed.constructor==String)s.speed=a.fx.speeds[s.speed]||parseInt(s.speed,10);if(!s.sync)s.speed=s.speed/2;var I=s.fx=="none"?0:s.fx=="shuffle"?500:250;while(s.timeout-s.speed<I)s.timeout+=s.speed}if(s.easing)s.easeIn=s.easeOut=s.easing;if(!s.speedIn)s.speedIn=s.speed;if(!s.speedOut)s.speedOut=s.speed;s.slideCount=g.length;s.currSlide=s.lastSlide=x;if(s.random){if(++s.randomIndex==g.length)s.randomIndex=0;s.nextSlide=s.randomMap[s.randomIndex]}else if(s.backwards)s.nextSlide=s.startingSlide===0?g.length-1:s.startingSlide-1;else s.nextSlide=s.startingSlide>=g.length-1?0:s.startingSlide+1;if(!s.multiFx){var J=a.fn.cycle.transitions[s.fx];if(a.isFunction(J))J(c,d,s);else if(s.fx!="custom"&&!s.multiFx){e("unknown transition: "+s.fx,"; slideshow terminating");return false}}var K=d[x];if(!s.skipInitializationCallbacks){if(s.before.length)s.before[0].apply(K,[K,K,s,true]);if(s.after.length)s.after[0].apply(K,[K,K,s,true])}if(s.next)a(s.next).bind(s.prevNextEvent,function(){return p(s,1)});if(s.prev)a(s.prev).bind(s.prevNextEvent,function(){return p(s,0)});if(s.pager||s.pagerAnchorBuilder)q(g,s);m(s,g);return s}function k(b){b.original={before:[],after:[]};b.original.cssBefore=a.extend({},b.cssBefore);b.original.cssAfter=a.extend({},b.cssAfter);b.original.animIn=a.extend({},b.animIn);b.original.animOut=a.extend({},b.animOut);a.each(b.before,function(){b.original.before.push(this)});a.each(b.after,function(){b.original.after.push(this)})}function l(b){var c,f,g=a.fn.cycle.transitions;if(b.fx.indexOf(",")>0){b.multiFx=true;b.fxs=b.fx.replace(/\s*/g,"").split(",");for(c=0;c<b.fxs.length;c++){var h=b.fxs[c];f=g[h];if(!f||!g.hasOwnProperty(h)||!a.isFunction(f)){e("discarding unknown transition: ",h);b.fxs.splice(c,1);c--}}if(!b.fxs.length){e("No valid transitions named; slideshow terminating.");return false}}else if(b.fx=="all"){b.multiFx=true;b.fxs=[];for(var i in g){if(g.hasOwnProperty(i)){f=g[i];if(g.hasOwnProperty(i)&&a.isFunction(f))b.fxs.push(i)}}}if(b.multiFx&&b.randomizeEffects){var j=Math.floor(Math.random()*20)+30;for(c=0;c<j;c++){var k=Math.floor(Math.random()*b.fxs.length);b.fxs.push(b.fxs.splice(k,1)[0])}d("randomized fx sequence: ",b.fxs)}return true}function m(b,c){b.addSlide=function(d,e){var f=a(d),g=f[0];if(!b.autostopCount)b.countdown++;c[e?"unshift":"push"](g);if(b.els)b.els[e?"unshift":"push"](g);b.slideCount=c.length;if(b.random){b.randomMap.push(b.slideCount-1);b.randomMap.sort(function(a,b){return Math.random()-.5})}f.css("position","absolute");f[e?"prependTo":"appendTo"](b.$cont);if(e){b.currSlide++;b.nextSlide++}if(!a.support.opacity&&b.cleartype&&!b.cleartypeNoBg)r(f);if(b.fit&&b.width)f.width(b.width);if(b.fit&&b.height&&b.height!="auto")f.height(b.height);g.cycleH=b.fit&&b.height?b.height:f.height();g.cycleW=b.fit&&b.width?b.width:f.width();f.css(b.cssBefore);if(b.pager||b.pagerAnchorBuilder)a.fn.cycle.createPagerAnchor(c.length-1,g,a(b.pager),c,b);if(a.isFunction(b.onAddSlide))b.onAddSlide(f);else f.hide()}}function n(c,e,f,g){function q(){var a=0,b=e.timeout;if(e.timeout&&!e.continuous){a=o(c[e.currSlide],c[e.nextSlide],e,g);if(e.fx=="shuffle")a-=e.speedOut}else if(e.continuous&&h.cyclePause)a=10;if(a>0)h.cycleTimeout=setTimeout(function(){n(c,e,0,!e.backwards)},a)}var h=e.$cont[0],i=c[e.currSlide],j=c[e.nextSlide];if(f&&e.busy&&e.manualTrump){d("manualTrump in go(), stopping active transition");a(c).stop(true,true);e.busy=0;clearTimeout(h.cycleTimeout)}if(e.busy){d("transition active, ignoring new tx request");return}if(h.cycleStop!=e.stopCount||h.cycleTimeout===0&&!f)return;if(!f&&!h.cyclePause&&!e.bounce&&(e.autostop&&--e.countdown<=0||e.nowrap&&!e.random&&e.nextSlide<e.currSlide)){if(e.end)e.end(e);return}var k=false;if((f||!h.cyclePause)&&e.nextSlide!=e.currSlide){k=true;var l=e.fx;i.cycleH=i.cycleH||a(i).height();i.cycleW=i.cycleW||a(i).width();j.cycleH=j.cycleH||a(j).height();j.cycleW=j.cycleW||a(j).width();if(e.multiFx){if(g&&(e.lastFx===b||++e.lastFx>=e.fxs.length))e.lastFx=0;else if(!g&&(e.lastFx===b||--e.lastFx<0))e.lastFx=e.fxs.length-1;l=e.fxs[e.lastFx]}if(e.oneTimeFx){l=e.oneTimeFx;e.oneTimeFx=null}a.fn.cycle.resetState(e,l);if(e.before.length)a.each(e.before,function(a,b){if(h.cycleStop!=e.stopCount)return;b.apply(j,[i,j,e,g])});var m=function(){e.busy=0;a.each(e.after,function(a,b){if(h.cycleStop!=e.stopCount)return;b.apply(j,[i,j,e,g])});if(!h.cycleStop){q()}};d("tx firing("+l+"); currSlide: "+e.currSlide+"; nextSlide: "+e.nextSlide);e.busy=1;if(e.fxFn)e.fxFn(i,j,e,m,g,f&&e.fastOnEvent);else if(a.isFunction(a.fn.cycle[e.fx]))a.fn.cycle[e.fx](i,j,e,m,g,f&&e.fastOnEvent);else a.fn.cycle.custom(i,j,e,m,g,f&&e.fastOnEvent)}else{q()}if(k||e.nextSlide==e.currSlide){var p;e.lastSlide=e.currSlide;if(e.random){e.currSlide=e.nextSlide;if(++e.randomIndex==c.length){e.randomIndex=0;e.randomMap.sort(function(a,b){return Math.random()-.5})}e.nextSlide=e.randomMap[e.randomIndex];if(e.nextSlide==e.currSlide)e.nextSlide=e.currSlide==e.slideCount-1?0:e.currSlide+1}else if(e.backwards){p=e.nextSlide-1<0;if(p&&e.bounce){e.backwards=!e.backwards;e.nextSlide=1;e.currSlide=0}else{e.nextSlide=p?c.length-1:e.nextSlide-1;e.currSlide=p?0:e.nextSlide+1}}else{p=e.nextSlide+1==c.length;if(p&&e.bounce){e.backwards=!e.backwards;e.nextSlide=c.length-2;e.currSlide=c.length-1}else{e.nextSlide=p?0:e.nextSlide+1;e.currSlide=p?c.length-1:e.nextSlide-1}}}if(k&&e.pager)e.updateActivePagerLink(e.pager,e.currSlide,e.activePagerClass)}function o(a,b,c,e){if(c.timeoutFn){var f=c.timeoutFn.call(a,a,b,c,e);while(c.fx!="none"&&f-c.speed<250)f+=c.speed;d("calculated timeout: "+f+"; speed: "+c.speed);if(f!==false)return f}return c.timeout}function p(b,c){var d=c?1:-1;var e=b.elements;var f=b.$cont[0],g=f.cycleTimeout;if(g){clearTimeout(g);f.cycleTimeout=0}if(b.random&&d<0){b.randomIndex--;if(--b.randomIndex==-2)b.randomIndex=e.length-2;else if(b.randomIndex==-1)b.randomIndex=e.length-1;b.nextSlide=b.randomMap[b.randomIndex]}else if(b.random){b.nextSlide=b.randomMap[b.randomIndex]}else{b.nextSlide=b.currSlide+d;if(b.nextSlide<0){if(b.nowrap)return false;b.nextSlide=e.length-1}else if(b.nextSlide>=e.length){if(b.nowrap)return false;b.nextSlide=0}}var h=b.onPrevNextEvent||b.prevNextClick;if(a.isFunction(h))h(d>0,b.nextSlide,e[b.nextSlide]);n(e,b,1,c);return false}function q(b,c){var d=a(c.pager);a.each(b,function(e,f){a.fn.cycle.createPagerAnchor(e,f,d,b,c)});c.updateActivePagerLink(c.pager,c.startingSlide,c.activePagerClass)}function r(b){function c(a){a=parseInt(a,10).toString(16);return a.length<2?"0"+a:a}function e(b){for(;b&&b.nodeName.toLowerCase()!="html";b=b.parentNode){var d=a.css(b,"background-color");if(d&&d.indexOf("rgb")>=0){var e=d.match(/\d+/g);return"#"+c(e[0])+c(e[1])+c(e[2])}if(d&&d!="transparent")return d}return"#ffffff"}d("applying clearType background-color hack");b.each(function(){a(this).css("background-color",e(this))})}"use strict";var c="2.9999.6";if(a.support===b){a.support={opacity:!a.browser.msie}}a.expr[":"].paused=function(a){return a.cyclePause};a.fn.cycle=function(b,c){var f={s:this.selector,c:this.context};if(this.length===0&&b!="stop"){if(!a.isReady&&f.s){e("DOM not ready, queuing slideshow");a(function(){a(f.s,f.c).cycle(b,c)});return this}e("terminating; zero elements found by selector"+(a.isReady?"":" (DOM not ready)"));return this}return this.each(function(){var h=g(this,b,c);if(h===false)return;h.updateActivePagerLink=h.updateActivePagerLink||a.fn.cycle.updateActivePagerLink;if(this.cycleTimeout)clearTimeout(this.cycleTimeout);this.cycleTimeout=this.cyclePause=0;this.cycleStop=0;var i=a(this);var k=h.slideExpr?a(h.slideExpr,this):i.children();var l=k.get();if(l.length<2){e("terminating; too few slides: "+l.length);return}var m=j(i,k,l,h,f);if(m===false)return;var p=m.continuous?10:o(l[m.currSlide],l[m.nextSlide],m,!m.backwards);if(p){p+=m.delay||0;if(p<10)p=10;d("first timeout: "+p);this.cycleTimeout=setTimeout(function(){n(l,m,0,!h.backwards)},p)}})};a.fn.cycle.resetState=function(b,c){c=c||b.fx;b.before=[];b.after=[];b.cssBefore=a.extend({},b.original.cssBefore);b.cssAfter=a.extend({},b.original.cssAfter);b.animIn=a.extend({},b.original.animIn);b.animOut=a.extend({},b.original.animOut);b.fxFn=null;a.each(b.original.before,function(){b.before.push(this)});a.each(b.original.after,function(){b.after.push(this)});var d=a.fn.cycle.transitions[c];if(a.isFunction(d))d(b.$cont,a(b.elements),b)};a.fn.cycle.updateActivePagerLink=function(b,c,d){a(b).each(function(){a(this).children().removeClass(d).eq(c).addClass(d)})};a.fn.cycle.next=function(a){p(a,1)};a.fn.cycle.prev=function(a){p(a,0)};a.fn.cycle.createPagerAnchor=function(b,c,e,g,h){var i;if(a.isFunction(h.pagerAnchorBuilder)){i=h.pagerAnchorBuilder(b,c);d("pagerAnchorBuilder("+b+", el) returned: "+i)}else i='<a href="#">'+(b+1)+"</a>";if(!i)return;var j=a(i);if(j.parents("body").length===0){var k=[];if(e.length>1){e.each(function(){var b=j.clone(true);a(this).append(b);k.push(b[0])});j=a(k)}else{j.appendTo(e)}}h.pagerAnchors=h.pagerAnchors||[];h.pagerAnchors.push(j);var l=function(c){c.preventDefault();h.nextSlide=b;var d=h.$cont[0],e=d.cycleTimeout;if(e){clearTimeout(e);d.cycleTimeout=0}var f=h.onPagerEvent||h.pagerClick;if(a.isFunction(f))f(h.nextSlide,g[h.nextSlide]);n(g,h,1,h.currSlide<b)};if(/mouseenter|mouseover/i.test(h.pagerEvent)){j.hover(l,function(){})}else{j.bind(h.pagerEvent,l)}if(!/^click/.test(h.pagerEvent)&&!h.allowPagerClickBubble)j.bind("click.cycle",function(){return false});var m=h.$cont[0];var o=false;if(h.pauseOnPagerHover){j.hover(function(){o=true;m.cyclePause++;f(m,true,true)},function(){if(o)m.cyclePause--;f(m,true,true)})}};a.fn.cycle.hopsFromLast=function(a,b){var c,d=a.lastSlide,e=a.currSlide;if(b)c=e>d?e-d:a.slideCount-d;else c=e<d?d-e:d+a.slideCount-e;return c};a.fn.cycle.commonReset=function(b,c,d,e,f,g){a(d.elements).not(b).hide();if(typeof d.cssBefore.opacity=="undefined")d.cssBefore.opacity=1;d.cssBefore.display="block";if(d.slideResize&&e!==false&&c.cycleW>0)d.cssBefore.width=c.cycleW;if(d.slideResize&&f!==false&&c.cycleH>0)d.cssBefore.height=c.cycleH;d.cssAfter=d.cssAfter||{};d.cssAfter.display="none";a(b).css("zIndex",d.slideCount+(g===true?1:0));a(c).css("zIndex",d.slideCount+(g===true?0:1))};a.fn.cycle.custom=function(b,c,d,e,f,g){var h=a(b),i=a(c);var j=d.speedIn,k=d.speedOut,l=d.easeIn,m=d.easeOut;i.css(d.cssBefore);if(g){if(typeof g=="number")j=k=g;else j=k=1;l=m=null}var n=function(){i.animate(d.animIn,j,l,function(){e()})};h.animate(d.animOut,k,m,function(){h.css(d.cssAfter);if(!d.sync)n()});if(d.sync)n()};a.fn.cycle.transitions={fade:function(b,c,d){c.not(":eq("+d.currSlide+")").css("opacity",0);d.before.push(function(b,c,d){a.fn.cycle.commonReset(b,c,d);d.cssBefore.opacity=0});d.animIn={opacity:1};d.animOut={opacity:0};d.cssBefore={top:0,left:0}}};a.fn.cycle.ver=function(){return c};a.fn.cycle.defaults={activePagerClass:"activeSlide",after:null,allowPagerClickBubble:false,animIn:null,animOut:null,aspect:false,autostop:0,autostopCount:0,backwards:false,before:null,center:null,cleartype:!a.support.opacity,cleartypeNoBg:false,containerResize:1,containerResizeHeight:0,continuous:0,cssAfter:null,cssBefore:null,delay:0,easeIn:null,easeOut:null,easing:null,end:null,fastOnEvent:0,fit:0,fx:"fade",fxFn:null,height:"auto",manualTrump:true,metaAttr:"cycle",next:null,nowrap:0,onPagerEvent:null,onPrevNextEvent:null,pager:null,pagerAnchorBuilder:null,pagerEvent:"click.cycle",pause:0,pauseOnPagerHover:0,prev:null,prevNextEvent:"click.cycle",random:0,randomizeEffects:1,requeueOnImageNotLoaded:true,requeueTimeout:250,rev:0,shuffle:null,skipInitializationCallbacks:false,slideExpr:null,slideResize:1,speed:1e3,speedIn:null,speedOut:null,startingSlide:b,sync:1,timeout:4e3,timeoutFn:null,updateActivePagerLink:null,width:null}})(jQuery);(function(a){"use strict";a.fn.cycle.transitions.none=function(b,c,d){d.fxFn=function(b,c,d,e){a(c).show();a(b).hide();e()}};a.fn.cycle.transitions.fadeout=function(b,c,d){c.not(":eq("+d.currSlide+")").css({display:"block",opacity:1});d.before.push(function(b,c,d,e,f,g){a(b).css("zIndex",d.slideCount+(g!==true?1:0));a(c).css("zIndex",d.slideCount+(g!==true?0:1))});d.animIn.opacity=1;d.animOut.opacity=0;d.cssBefore.opacity=1;d.cssBefore.display="block";d.cssAfter.zIndex=0};a.fn.cycle.transitions.scrollUp=function(b,c,d){b.css("overflow","hidden");d.before.push(a.fn.cycle.commonReset);var e=b.height();d.cssBefore.top=e;d.cssBefore.left=0;d.cssFirst.top=0;d.animIn.top=0;d.animOut.top=-e};a.fn.cycle.transitions.scrollDown=function(b,c,d){b.css("overflow","hidden");d.before.push(a.fn.cycle.commonReset);var e=b.height();d.cssFirst.top=0;d.cssBefore.top=-e;d.cssBefore.left=0;d.animIn.top=0;d.animOut.top=e};a.fn.cycle.transitions.scrollLeft=function(b,c,d){b.css("overflow","hidden");d.before.push(a.fn.cycle.commonReset);var e=b.width();d.cssFirst.left=0;d.cssBefore.left=e;d.cssBefore.top=0;d.animIn.left=0;d.animOut.left=0-e};a.fn.cycle.transitions.scrollRight=function(b,c,d){b.css("overflow","hidden");d.before.push(a.fn.cycle.commonReset);var e=b.width();d.cssFirst.left=0;d.cssBefore.left=-e;d.cssBefore.top=0;d.animIn.left=0;d.animOut.left=e};a.fn.cycle.transitions.scrollHorz=function(b,c,d){b.css("overflow","hidden").width();d.before.push(function(b,c,d,e){if(d.rev)e=!e;a.fn.cycle.commonReset(b,c,d);d.cssBefore.left=e?c.cycleW-1:1-c.cycleW;d.animOut.left=e?-b.cycleW:b.cycleW});d.cssFirst.left=0;d.cssBefore.top=0;d.animIn.left=0;d.animOut.top=0};a.fn.cycle.transitions.scrollVert=function(b,c,d){b.css("overflow","hidden");d.before.push(function(b,c,d,e){if(d.rev)e=!e;a.fn.cycle.commonReset(b,c,d);d.cssBefore.top=e?1-c.cycleH:c.cycleH-1;d.animOut.top=e?b.cycleH:-b.cycleH});d.cssFirst.top=0;d.cssBefore.left=0;d.animIn.top=0;d.animOut.left=0};a.fn.cycle.transitions.slideX=function(b,c,d){d.before.push(function(b,c,d){a(d.elements).not(b).hide();a.fn.cycle.commonReset(b,c,d,false,true);d.animIn.width=c.cycleW});d.cssBefore.left=0;d.cssBefore.top=0;d.cssBefore.width=0;d.animIn.width="show";d.animOut.width=0};a.fn.cycle.transitions.slideY=function(b,c,d){d.before.push(function(b,c,d){a(d.elements).not(b).hide();a.fn.cycle.commonReset(b,c,d,true,false);d.animIn.height=c.cycleH});d.cssBefore.left=0;d.cssBefore.top=0;d.cssBefore.height=0;d.animIn.height="show";d.animOut.height=0};a.fn.cycle.transitions.shuffle=function(b,c,d){var e,f=b.css("overflow","visible").width();c.css({left:0,top:0});d.before.push(function(b,c,d){a.fn.cycle.commonReset(b,c,d,true,true,true)});if(!d.speedAdjusted){d.speed=d.speed/2;d.speedAdjusted=true}d.random=0;d.shuffle=d.shuffle||{left:-f,top:15};d.els=[];for(e=0;e<c.length;e++)d.els.push(c[e]);for(e=0;e<d.currSlide;e++)d.els.push(d.els.shift());d.fxFn=function(b,c,d,e,f){if(d.rev)f=!f;var g=f?a(b):a(c);a(c).css(d.cssBefore);var h=d.slideCount;g.animate(d.shuffle,d.speedIn,d.easeIn,function(){var c=a.fn.cycle.hopsFromLast(d,f);for(var i=0;i<c;i++){if(f)d.els.push(d.els.shift());else d.els.unshift(d.els.pop())}if(f){for(var j=0,k=d.els.length;j<k;j++)a(d.els[j]).css("z-index",k-j+h)}else{var l=a(b).css("z-index");g.css("z-index",parseInt(l,10)+1+h)}g.animate({left:0,top:0},d.speedOut,d.easeOut,function(){a(f?this:b).hide();if(e)e()})})};a.extend(d.cssBefore,{display:"block",opacity:1,top:0,left:0})};a.fn.cycle.transitions.turnUp=function(b,c,d){d.before.push(function(b,c,d){a.fn.cycle.commonReset(b,c,d,true,false);d.cssBefore.top=c.cycleH;d.animIn.height=c.cycleH;d.animOut.width=c.cycleW});d.cssFirst.top=0;d.cssBefore.left=0;d.cssBefore.height=0;d.animIn.top=0;d.animOut.height=0};a.fn.cycle.transitions.turnDown=function(b,c,d){d.before.push(function(b,c,d){a.fn.cycle.commonReset(b,c,d,true,false);d.animIn.height=c.cycleH;d.animOut.top=b.cycleH});d.cssFirst.top=0;d.cssBefore.left=0;d.cssBefore.top=0;d.cssBefore.height=0;d.animOut.height=0};a.fn.cycle.transitions.turnLeft=function(b,c,d){d.before.push(function(b,c,d){a.fn.cycle.commonReset(b,c,d,false,true);d.cssBefore.left=c.cycleW;d.animIn.width=c.cycleW});d.cssBefore.top=0;d.cssBefore.width=0;d.animIn.left=0;d.animOut.width=0};a.fn.cycle.transitions.turnRight=function(b,c,d){d.before.push(function(b,c,d){a.fn.cycle.commonReset(b,c,d,false,true);d.animIn.width=c.cycleW;d.animOut.left=b.cycleW});a.extend(d.cssBefore,{top:0,left:0,width:0});d.animIn.left=0;d.animOut.width=0};a.fn.cycle.transitions.zoom=function(b,c,d){d.before.push(function(b,c,d){a.fn.cycle.commonReset(b,c,d,false,false,true);d.cssBefore.top=c.cycleH/2;d.cssBefore.left=c.cycleW/2;a.extend(d.animIn,{top:0,left:0,width:c.cycleW,height:c.cycleH});a.extend(d.animOut,{width:0,height:0,top:b.cycleH/2,left:b.cycleW/2})});d.cssFirst.top=0;d.cssFirst.left=0;d.cssBefore.width=0;d.cssBefore.height=0};a.fn.cycle.transitions.fadeZoom=function(b,c,d){d.before.push(function(b,c,d){a.fn.cycle.commonReset(b,c,d,false,false);d.cssBefore.left=c.cycleW/2;d.cssBefore.top=c.cycleH/2;a.extend(d.animIn,{top:0,left:0,width:c.cycleW,height:c.cycleH})});d.cssBefore.width=0;d.cssBefore.height=0;d.animOut.opacity=0};a.fn.cycle.transitions.blindX=function(b,c,d){var e=b.css("overflow","hidden").width();d.before.push(function(b,c,d){a.fn.cycle.commonReset(b,c,d);d.animIn.width=c.cycleW;d.animOut.left=b.cycleW});d.cssBefore.left=e;d.cssBefore.top=0;d.animIn.left=0;d.animOut.left=e};a.fn.cycle.transitions.blindY=function(b,c,d){var e=b.css("overflow","hidden").height();d.before.push(function(b,c,d){a.fn.cycle.commonReset(b,c,d);d.animIn.height=c.cycleH;d.animOut.top=b.cycleH});d.cssBefore.top=e;d.cssBefore.left=0;d.animIn.top=0;d.animOut.top=e};a.fn.cycle.transitions.blindZ=function(b,c,d){var e=b.css("overflow","hidden").height();var f=b.width();d.before.push(function(b,c,d){a.fn.cycle.commonReset(b,c,d);d.animIn.height=c.cycleH;d.animOut.top=b.cycleH});d.cssBefore.top=e;d.cssBefore.left=f;d.animIn.top=0;d.animIn.left=0;d.animOut.top=e;d.animOut.left=f};a.fn.cycle.transitions.growX=function(b,c,d){d.before.push(function(b,c,d){a.fn.cycle.commonReset(b,c,d,false,true);d.cssBefore.left=this.cycleW/2;d.animIn.left=0;d.animIn.width=this.cycleW;d.animOut.left=0});d.cssBefore.top=0;d.cssBefore.width=0};a.fn.cycle.transitions.growY=function(b,c,d){d.before.push(function(b,c,d){a.fn.cycle.commonReset(b,c,d,true,false);d.cssBefore.top=this.cycleH/2;d.animIn.top=0;d.animIn.height=this.cycleH;d.animOut.top=0});d.cssBefore.height=0;d.cssBefore.left=0};a.fn.cycle.transitions.curtainX=function(b,c,d){d.before.push(function(b,c,d){a.fn.cycle.commonReset(b,c,d,false,true,true);d.cssBefore.left=c.cycleW/2;d.animIn.left=0;d.animIn.width=this.cycleW;d.animOut.left=b.cycleW/2;d.animOut.width=0});d.cssBefore.top=0;d.cssBefore.width=0};a.fn.cycle.transitions.curtainY=function(b,c,d){d.before.push(function(b,c,d){a.fn.cycle.commonReset(b,c,d,true,false,true);d.cssBefore.top=c.cycleH/2;d.animIn.top=0;d.animIn.height=c.cycleH;d.animOut.top=b.cycleH/2;d.animOut.height=0});d.cssBefore.height=0;d.cssBefore.left=0};a.fn.cycle.transitions.cover=function(b,c,d){var e=d.direction||"left";var f=b.css("overflow","hidden").width();var g=b.height();d.before.push(function(b,c,d){a.fn.cycle.commonReset(b,c,d);if(e=="right")d.cssBefore.left=-f;else if(e=="up")d.cssBefore.top=g;else if(e=="down")d.cssBefore.top=-g;else d.cssBefore.left=f});d.animIn.left=0;d.animIn.top=0;d.cssBefore.top=0;d.cssBefore.left=0};a.fn.cycle.transitions.uncover=function(b,c,d){var e=d.direction||"left";var f=b.css("overflow","hidden").width();var g=b.height();d.before.push(function(b,c,d){a.fn.cycle.commonReset(b,c,d,true,true,true);if(e=="right")d.animOut.left=f;else if(e=="up")d.animOut.top=-g;else if(e=="down")d.animOut.top=g;else d.animOut.left=-f});d.animIn.left=0;d.animIn.top=0;d.cssBefore.top=0;d.cssBefore.left=0};a.fn.cycle.transitions.toss=function(b,c,d){var e=b.css("overflow","visible").width();var f=b.height();d.before.push(function(b,c,d){a.fn.cycle.commonReset(b,c,d,true,true,true);if(!d.animOut.left&&!d.animOut.top)a.extend(d.animOut,{left:e*2,top:-f/2,opacity:0});else d.animOut.opacity=0});d.cssBefore.left=0;d.cssBefore.top=0;d.animIn.left=0};a.fn.cycle.transitions.wipe=function(b,c,d){var e=b.css("overflow","hidden").width();var f=b.height();d.cssBefore=d.cssBefore||{};var g;if(d.clip){if(/l2r/.test(d.clip))g="rect(0px 0px "+f+"px 0px)";else if(/r2l/.test(d.clip))g="rect(0px "+e+"px "+f+"px "+e+"px)";else if(/t2b/.test(d.clip))g="rect(0px "+e+"px 0px 0px)";else if(/b2t/.test(d.clip))g="rect("+f+"px "+e+"px "+f+"px 0px)";else if(/zoom/.test(d.clip)){var h=parseInt(f/2,10);var i=parseInt(e/2,10);g="rect("+h+"px "+i+"px "+h+"px "+i+"px)"}}d.cssBefore.clip=d.cssBefore.clip||g||"rect(0px 0px 0px 0px)";var j=d.cssBefore.clip.match(/(\d+)/g);var k=parseInt(j[0],10),l=parseInt(j[1],10),m=parseInt(j[2],10),n=parseInt(j[3],10);d.before.push(function(b,c,d){if(b==c)return;var g=a(b),h=a(c);a.fn.cycle.commonReset(b,c,d,true,true,false);d.cssAfter.display="block";var i=1,j=parseInt(d.speedIn/13,10)-1;(function o(){var a=k?k-parseInt(i*(k/j),10):0;var b=n?n-parseInt(i*(n/j),10):0;var c=m<f?m+parseInt(i*((f-m)/j||1),10):f;var d=l<e?l+parseInt(i*((e-l)/j||1),10):e;h.css({clip:"rect("+a+"px "+d+"px "+c+"px "+b+"px)"});i++<=j?setTimeout(o,13):g.css("display","none")})()});a.extend(d.cssBefore,{display:"block",opacity:1,top:0,left:0});d.animIn={left:0};d.animOut={left:0}}})(jQuery) +eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}(';(8($,1R){"4t 4v";q 3m=\'2.5q.6\';7($.24===1R){$.24={18:!($.2R.4l)}}8 1I(s){7($.A.u.1I)1m(s)}8 1m(){7(5X.3n&&3n.1m)3n.1m(\'[u] \'+5A.5B.5K.4d(5L,\' \'))}$.5S[\':\'].2k=8(1e){J 1e.1p};$.A.u=8(S,1L){q o={s:G.4H,c:G.5R};7(G.Q===0&&S!=\'31\'){7(!$.4G&&o.s){1m(\'4I 1n 4O, 5N 32\');$(8(){$(o.s,o.c).u(S,1L)});J G}1m(\'2O; 5O 1y 39 5P 4H\'+($.4G?\'\':\' (4I 1n 4O)\'));J G}J G.1h(8(){q 4=4u(G,S,1L);7(4===K)J;4.29=4.29||$.A.u.29;7(G.1c)2c(G.1c);G.1c=G.1p=0;G.1M=0;q $9=$(G);q $I=4.3L?$(4.3L,G):$9.4f();q C=$I.5r();7(C.Q<2){1m(\'2O; 5e 5h I: \'+C.Q);J}q 1N=57($9,$I,C,4,o);7(1N===K)J;q 2b=1N.2C?10:3I(C[1N.11],C[1N.T],1N,!1N.1t);7(2b){2b+=(1N.59||0);7(2b<10)2b=10;1I(\'1l 1f: \'+2b);G.1c=2M(8(){1P(C,1N,0,!4.1t)},2b)}})};8 1V(9,3g,3j){q 4=$(9).1Q(\'u.4\');q 2k=!!9.1p;7(2k&&4.2k)4.2k(9,4,3g,3j);N 7(!2k&&4.55)4.55(9,4,3g,3j)}8 4u(9,S,1L){7(9.1M===1R)9.1M=0;7(S===1R||S===Y)S={};7(S.3Q==4q){5s(S){1Z\'2i\':1Z\'31\':q 4=$(9).1Q(\'u.4\');7(!4)J K;9.1M++;7(9.1c)2c(9.1c);9.1c=0;7(4.1y)$(4.1y).31();$(9).5p(\'u.4\');7(S==\'2i\')2i(9,4);J K;1Z\'5o\':9.1p=(9.1p===1)?0:1;3q(9.1p,1L,9);1V(9);J K;1Z\'3E\':9.1p=1;1V(9);J K;1Z\'4F\':9.1p=0;3q(K,1L,9);1V(9);J K;1Z\'1Y\':1Z\'m\':4=$(9).1Q(\'u.4\');7(!4){1m(\'S 1n 39, "1Y/m" 5v\');J K}$.A.u[S](4);J K;5t:S={Z:S}}J S}N 7(S.3Q==5w){q 2o=S;S=$(9).1Q(\'u.4\');7(!S){1m(\'S 1n 39, 4N 1n 2h 1b\');J K}7(2o<0||2o>=S.1y.Q){1m(\'5g 1b 2y: \'+2o);J K}S.T=2o;7(9.1c){2c(9.1c);9.1c=0}7(3l 1L==\'5j\')S.35=1L;1P(S.1y,S,1,2o>=S.11);J K}J S;8 3q(4L,1L,9){7(!4L&&1L===H){q S=$(9).1Q(\'u.4\');7(!S){1m(\'S 1n 39, 4N 1n 4F\');J K}7(9.1c){2c(9.1c);9.1c=0}1P(S.1y,S,1,!S.1t)}}}8 3p(1e,4){7(!$.24.18&&4.2F&&1e.4x.4w){5x{1e.4x.5W(\'4w\')}5V(5U){}}}8 2i(9,4){7(4.m)$(4.m).3e(4.2x);7(4.1Y)$(4.1Y).3e(4.2x);7(4.1E||4.21)$.1h(4.2v||[],8(){G.3e().5T()});4.2v=Y;$(9).3e(\'3G.u 50.u\');7(4.2i)4.2i(4)}8 57($9,$I,C,S,o){q 3v;q 4=$.1i({},$.A.u.56,S||{},$.5b?$9.5b():$.2X?$9.1Q():{});q 2X=$.1K($9.1Q)?$9.1Q(4.4X):Y;7(2X)4=$.1i(4,2X);7(4.3h)4.3D=4.3z||C.Q;q 9=$9[0];$9.1Q(\'u.4\',4);4.$9=$9;4.38=9.1M;4.1y=C;4.R=4.R?[4.R]:[];4.1a=4.1a?[4.1a]:[];7(!$.24.18&&4.2F)4.1a.O(8(){3p(G,4)});7(4.2C)4.1a.O(8(){1P(C,4,0,!4.1t)});45(4);7(!$.24.18&&4.2F&&!4.3V)3A($I);7($9.P(\'3c\')==\'5y\')$9.P(\'3c\',\'5z\');7(4.F)$9.F(4.F);7(4.D&&4.D!=\'2S\')$9.D(4.D);7(4.1d!==1R){4.1d=1k(4.1d,10);7(4.1d>=C.Q||4.5J<0)4.1d=0;N 3v=H}N 7(4.1t)4.1d=C.Q-1;N 4.1d=0;7(4.1s){4.1z=[];1C(q i=0;i<C.Q;i++)4.1z.O(i);4.1z.3J(8(a,b){J 22.1s()-0.5});7(3v){1C(q 2E=0;2E<C.Q;2E++){7(4.1d==4.1z[2E]){4.1o=2E}}}N{4.1o=1;4.1d=4.1z[1]}}N 7(4.1d>=C.Q)4.1d=0;4.11=4.1d||0;q 1l=4.1d;$I.P({3c:\'41\',E:0,B:0}).2e().1h(8(i){q z;7(4.1t)z=1l?i<=1l?C.Q+(i-1l):1l-i:C.Q-i;N z=1l?i>=1l?C.Q-(i-1l):1l-i:C.Q-i;$(G).P(\'z-2y\',z)});$(C[1l]).P(\'18\',1).3f();3p(C[1l],4);7(4.1H){7(!4.2G){7(4.F)$I.F(4.F);7(4.D&&4.D!=\'2S\')$I.D(4.D)}N{$I.1h(8(){q $1b=$(G);q 3r=(4.2G===H)?$1b.F()/$1b.D():4.2G;7(4.F&&$1b.F()!=4.F){$1b.F(4.F);$1b.D(4.F/3r)}7(4.D&&$1b.D()<4.D){$1b.D(4.D);$1b.F(4.D*3r)}})}}7(4.3W&&((!4.1H)||4.2G)){$I.1h(8(){q $1b=$(G);$1b.P({"2I-B":4.F?((4.F-$1b.F())/2)+"14":0,"2I-E":4.D?((4.D-$1b.D())/2)+"14":0})})}7(4.3W&&!4.1H&&!4.2L){$I.1h(8(){q $1b=$(G);$1b.P({"2I-B":4.F?((4.F-$1b.F())/2)+"14":0,"2I-E":4.D?((4.D-$1b.D())/2)+"14":0})})}q 4Y=(4.3R||4.3S)&&!$9.5H();7(4Y){q 2q=0,1W=0;1C(q j=0;j<C.Q;j++){q $e=$(C[j]),e=$e[0],w=$e.5F(),h=$e.5G();7(!w)w=e.46||e.F||$e.2P(\'F\');7(!h)h=e.4E||e.D||$e.2P(\'D\');2q=w>2q?w:2q;1W=h>1W?h:1W}7(4.3R&&2q>0&&1W>0)$9.P({F:2q+\'14\',D:1W+\'14\'});7(4.3S&&1W>0)$9.P({D:1W+\'14\'})}q 2u=K;7(4.3E)$9.2s(\'3G.u\',8(){2u=H;G.1p++;1V(9,H)}).2s(\'50.u\',8(){7(2u)G.1p--;1V(9,H)});7(48(4)===K)J K;q 3B=K;S.3b=S.3b||0;$I.1h(8(){q $1e=$(G);G.U=(4.1H&&4.D)?4.D:($1e.D()||G.4E||G.D||$1e.2P(\'D\')||0);G.V=(4.1H&&4.F)?4.F:($1e.F()||G.46||G.F||$1e.2P(\'F\')||0);7($1e.5I(\'4i\')){q 4p=($.2R.4l&&G.V==28&&G.U==30&&!G.2N);q 4c=($.2R.5E&&G.V==34&&G.U==19&&!G.2N);q 4e=($.2R.5D&&((G.V==42&&G.U==19)||(G.V==37&&G.U==17))&&!G.2N);q 4h=(G.U===0&&G.V===0&&!G.2N);7(4p||4c||4e||4h){7(o.s&&4.4z&&++S.3b<5C){1m(S.3b,\' - 4i 1b 1n 5M, 5Q 32: \',G.3Y,G.V,G.U);2M(8(){$(o.s,o.c).u(S)},4.4S);3B=H;J K}N{1m(\'5i 1n 5f 5k 5m 5n: \'+G.3Y,G.V,G.U)}}}J H});7(3B)J K;4.y=4.y||{};4.1w=4.1w||{};4.1v=4.1v||{};4.M=4.M||{};4.L=4.L||{};$I.1n(\':33(\'+1l+\')\').P(4.y);$($I[1l]).P(4.1v);7(4.1f){4.1f=1k(4.1f,10);7(4.1g.3Q==4q)4.1g=$.Z.5u[4.1g]||1k(4.1g,10);7(!4.3d)4.1g=4.1g/2;q 4k=4.Z==\'2w\'?0:4.Z==\'26\'?5l:3N;4a((4.1f-4.1g)<4k)4.1f+=4.1g}7(4.3U)4.25=4.2f=4.3U;7(!4.1F)4.1F=4.1g;7(!4.1G)4.1G=4.1g;4.1B=C.Q;4.11=4.3y=1l;7(4.1s){7(++4.1o==C.Q)4.1o=0;4.T=4.1z[4.1o]}N 7(4.1t)4.T=4.1d===0?(C.Q-1):4.1d-1;N 4.T=4.1d>=(C.Q-1)?0:4.1d+1;7(!4.2m){q 2r=$.A.u.W[4.Z];7($.1K(2r))2r($9,$I,4);N 7(4.Z!=\'3C\'&&!4.2m){1m(\'4o 2Z: \'+4.Z,\'; 32 2O\');J K}}q 2d=$I[1l];7(!4.4y){7(4.R.Q)4.R[0].36(2d,[2d,2d,4,H]);7(4.1a.Q)4.1a[0].36(2d,[2d,2d,4,H])}7(4.m)$(4.m).2s(4.2x,8(){J 2h(4,1)});7(4.1Y)$(4.1Y).2s(4.2x,8(){J 2h(4,0)});7(4.1E||4.21)4n(C,4);44(4,C);J 4}8 45(4){4.1u={R:[],1a:[]};4.1u.y=$.1i({},4.y);4.1u.1w=$.1i({},4.1w);4.1u.M=$.1i({},4.M);4.1u.L=$.1i({},4.L);$.1h(4.R,8(){4.1u.R.O(G)});$.1h(4.1a,8(){4.1u.1a.O(G)})}8 48(4){q i,1T,2a=$.A.u.W;7(4.Z.4V(\',\')>0){4.2m=H;4.1q=4.Z.6i(/\\s*/g,\'\').6P(\',\');1C(i=0;i<4.1q.Q;i++){q Z=4.1q[i];1T=2a[Z];7(!1T||!2a.3F(Z)||!$.1K(1T)){1m(\'6O 4o 2Z: \',Z);4.1q.40(i,1);i--}}7(!4.1q.Q){1m(\'6R 6H W 6Y; 32 2O.\');J K}}N 7(4.Z==\'6M\'){4.2m=H;4.1q=[];1C(q p 4m 2a){7(2a.3F(p)){1T=2a[p];7(2a.3F(p)&&$.1K(1T))4.1q.O(p)}}}7(4.2m&&4.4D){q 4j=22.4g(22.1s()*20)+30;1C(i=0;i<4j;i++){q 47=22.4g(22.1s()*4.1q.Q);4.1q.O(4.1q.40(47,1)[0])}1I(\'6X Z 6V: \',4.1q)}J H}8 44(4,C){4.6W=8(43,2z){q $s=$(43),s=$s[0];7(!4.3z)4.3D++;C[2z?\'3s\':\'O\'](s);7(4.C)4.C[2z?\'3s\':\'O\'](s);4.1B=C.Q;7(4.1s){4.1z.O(4.1B-1);4.1z.3J(8(a,b){J 22.1s()-0.5})}$s.P(\'3c\',\'41\');$s[2z?\'76\':\'3Z\'](4.$9);7(2z){4.11++;4.T++}7(!$.24.18&&4.2F&&!4.3V)3A($s);7(4.1H&&4.F)$s.F(4.F);7(4.1H&&4.D&&4.D!=\'2S\')$s.D(4.D);s.U=(4.1H&&4.D)?4.D:$s.D();s.V=(4.1H&&4.F)?4.F:$s.F();$s.P(4.y);7(4.1E||4.21)$.A.u.3w(C.Q-1,s,$(4.1E),C,4);7($.1K(4.4r))4.4r($s);N $s.2e()}}$.A.u.4b=8(4,Z){Z=Z||4.Z;4.R=[];4.1a=[];4.y=$.1i({},4.1u.y);4.1w=$.1i({},4.1u.1w);4.M=$.1i({},4.1u.M);4.L=$.1i({},4.1u.L);4.2n=Y;$.1h(4.1u.R,8(){4.R.O(G)});$.1h(4.1u.1a,8(){4.1a.O(G)});q 2r=$.A.u.W[Z];7($.1K(2r))2r(4.$9,$(4.1y),4)};8 1P(C,4,1U,X){q p=4.$9[0],x=C[4.11],m=C[4.T];7(1U&&4.2B&&4.3P){1I(\'3P 4m 1P(), 75 49 2Z\');$(C).31(H,H);4.2B=0;2c(p.1c)}7(4.2B){1I(\'2Z 49, 74 6U 1T 6K\');J}7(p.1M!=4.38||p.1c===0&&!1U)J;7(!1U&&!p.1p&&!4.3M&&((4.3h&&(--4.3D<=0))||(4.2T&&!4.1s&&4.T<4.11))){7(4.3T)4.3T(4);J}q 2J=K;7((1U||!p.1p)&&(4.T!=4.11)){2J=H;q Z=4.Z;x.U=x.U||$(x).D();x.V=x.V||$(x).F();m.U=m.U||$(m).D();m.V=m.V||$(m).F();7(4.2m){7(X&&(4.23===1R||++4.23>=4.1q.Q))4.23=0;N 7(!X&&(4.23===1R||--4.23<0))4.23=4.1q.Q-1;Z=4.1q[4.23]}7(4.35){Z=4.35;4.35=Y}$.A.u.4b(4,Z);7(4.R.Q)$.1h(4.R,8(i,o){7(p.1M!=4.38)J;o.36(m,[x,m,4,X])});q 1a=8(){4.2B=0;$.1h(4.1a,8(i,o){7(p.1M!=4.38)J;o.36(m,[x,m,4,X])});7(!p.1M){3O()}};1I(\'1T 6J(\'+Z+\'); 11: \'+4.11+\'; T: \'+4.T);4.2B=1;7(4.2n)4.2n(x,m,4,1a,X,1U&&4.2Q);N 7($.1K($.A.u[4.Z]))$.A.u[4.Z](x,m,4,1a,X,1U&&4.2Q);N $.A.u.3C(x,m,4,1a,X,1U&&4.2Q)}N{3O()}7(2J||4.T==4.11){q 1S;4.3y=4.11;7(4.1s){4.11=4.T;7(++4.1o==C.Q){4.1o=0;4.1z.3J(8(a,b){J 22.1s()-0.5})}4.T=4.1z[4.1o];7(4.T==4.11)4.T=(4.11==4.1B-1)?0:4.11+1}N 7(4.1t){1S=(4.T-1)<0;7(1S&&4.3M){4.1t=!4.1t;4.T=1;4.11=0}N{4.T=1S?(C.Q-1):4.T-1;4.11=1S?0:4.T+1}}N{1S=(4.T+1)==C.Q;7(1S&&4.3M){4.1t=!4.1t;4.T=C.Q-2;4.11=C.Q-1}N{4.T=1S?0:4.T+1;4.11=1S?C.Q-1:4.T-1}}}7(2J&&4.1E)4.29(4.1E,4.11,4.3i);8 3O(){q 2j=0,1f=4.1f;7(4.1f&&!4.2C){2j=3I(C[4.11],C[4.T],4,X);7(4.Z==\'26\')2j-=4.1G}N 7(4.2C&&p.1p)2j=10;7(2j>0)p.1c=2M(8(){1P(C,4,0,!4.1t)},2j)}}$.A.u.29=8(1E,11,3H){$(1E).1h(8(){$(G).4f().6N(3H).33(11).6S(3H)})};8 3I(x,m,4,X){7(4.3K){q t=4.3K.4d(x,x,m,4,X);4a(4.Z!=\'2w\'&&(t-4.1g)<3N)t+=4.1g;1I(\'77 1f: \'+t+\'; 1g: \'+4.1g);7(t!==K)J t}J 4.1f}$.A.u.m=8(4){2h(4,1)};$.A.u.1Y=8(4){2h(4,0)};8 2h(4,3k){q 2W=3k?1:-1;q C=4.1y;q p=4.$9[0],1f=p.1c;7(1f){2c(1f);p.1c=0}7(4.1s&&2W<0){4.1o--;7(--4.1o==-2)4.1o=C.Q-2;N 7(4.1o==-1)4.1o=C.Q-1;4.T=4.1z[4.1o]}N 7(4.1s){4.T=4.1z[4.1o]}N{4.T=4.11+2W;7(4.T<0){7(4.2T)J K;4.T=C.Q-1}N 7(4.T>=C.Q){7(4.2T)J K;4.T=0}}q 1D=4.4A||4.6Q;7($.1K(1D))1D(2W>0,4.T,C[4.T]);1P(C,4,1,3k);J K}8 4n(C,4){q $p=$(4.1E);$.1h(C,8(i,o){$.A.u.3w(i,o,$p,C,4)});4.29(4.1E,4.1d,4.3i)}$.A.u.3w=8(i,1e,$p,C,4){q a;7($.1K(4.21)){a=4.21(i,1e);1I(\'21(\'+i+\', 1e) 6G: \'+a)}N a=\'<a 6I="#">\'+(i+1)+\'</a>\';7(!a)J;q $a=$(a);7($a.6L(\'6T\').Q===0){q 3t=[];7($p.Q>1){$p.1h(8(){q $2U=$a.2U(H);$(G).73($2U);3t.O($2U[0])});$a=$(3t)}N{$a.3Z($p)}}4.2v=4.2v||[];4.2v.O($a);q 3X=8(e){e.72();4.T=i;q p=4.$9[0],1f=p.1c;7(1f){2c(1f);p.1c=0}q 1D=4.4R||4.71;7($.1K(1D))1D(4.T,C[4.T]);1P(C,4,1,4.11<i)};7(/3G|70/i.2g(4.2Y)){$a.51(3X,8(){})}N{$a.2s(4.2Y,3X)}7(!/^2H/.2g(4.2Y)&&!4.58)$a.2s(\'2H.u\',8(){J K});q 9=4.$9[0];q 2u=K;7(4.4C){$a.51(8(){2u=H;9.1p++;1V(9,H,H)},8(){7(2u)9.1p--;1V(9,H,H)})}};$.A.u.4Q=8(4,X){q 2l,l=4.3y,c=4.11;7(X)2l=c>l?c-l:4.1B-l;N 2l=c<l?l-c:l+4.1B-c;J 2l};8 3A($I){1I(\'5Y 6Z 3o-3x 6E\');8 2K(s){s=1k(s,10).6d(16);J s.Q<2?\'0\'+s:s}8 4s(e){1C(;e&&e.6c.6b()!=\'6a\';e=e.6e){q v=$.P(e,\'3o-3x\');7(v&&v.4V(\'2D\')>=0){q 2D=v.4J(/\\d+/g);J\'#\'+2K(2D[0])+2K(2D[1])+2K(2D[2])}7(v&&v!=\'6f\')J v}J\'#6F\'}$I.1h(8(){$(G).P(\'3o-3x\',4s(G))})}$.A.u.12=8(x,m,4,w,h,1J){$(4.1y).1n(x).2e();7(3l 4.y.18==\'1R\')4.y.18=1;4.y.1X=\'2p\';7(4.2L&&w!==K&&m.V>0)4.y.F=m.V;7(4.2L&&h!==K&&m.U>0)4.y.D=m.U;4.1w=4.1w||{};4.1w.1X=\'2w\';$(x).P(\'2A\',4.1B+(1J===H?1:0));$(m).P(\'2A\',4.1B+(1J===H?0:1))};$.A.u.3C=8(x,m,4,1D,X,2V){q $l=$(x),$n=$(m);q 1F=4.1F,1G=4.1G,25=4.25,2f=4.2f;$n.P(4.y);7(2V){7(3l 2V==\'6h\')1F=1G=2V;N 1F=1G=1;25=2f=Y}q A=8(){$n.3a(4.M,1F,25,8(){1D()})};$l.3a(4.L,1G,2f,8(){$l.P(4.1w);7(!4.3d)A()});7(4.3d)A()};$.A.u.W={5d:8($9,$I,4){$I.1n(\':33(\'+4.11+\')\').P(\'18\',0);4.R.O(8(x,m,4){$.A.u.12(x,m,4);4.y.18=0});4.M={18:1};4.L={18:0};4.y={E:0,B:0}}};$.A.u.3m=8(){J 3m};$.A.u.56={3i:\'6g\',1a:Y,58:K,M:Y,L:Y,2G:K,3h:0,3z:0,1t:K,R:Y,3W:Y,2F:!$.24.18,3V:K,3R:1,3S:0,2C:0,1w:Y,y:Y,59:0,25:Y,2f:Y,3U:Y,3T:Y,2Q:0,1H:0,Z:\'5d\',2n:Y,D:\'2S\',3P:H,4X:\'u\',m:Y,2T:0,4R:Y,4A:Y,1E:Y,21:Y,2Y:\'2H.u\',3E:0,4C:0,1Y:Y,2x:\'2H.u\',1s:0,4D:1,4z:H,4S:3N,1J:0,26:Y,4y:K,3L:Y,2L:1,1g:69,1F:Y,1G:Y,1d:1R,3d:1,1f:68,3K:Y,29:Y,F:Y}})(52);(8($){"4t 4v";$.A.u.W.2w=8($9,$I,4){4.2n=8(x,m,4,1a){$(m).3f();$(x).2e();1a()}};$.A.u.W.62=8($9,$I,4){$I.1n(\':33(\'+4.11+\')\').P({1X:\'2p\',\'18\':1});4.R.O(8(x,m,4,w,h,1J){$(x).P(\'2A\',4.1B+(1J!==H?1:0));$(m).P(\'2A\',4.1B+(1J!==H?0:1))});4.M.18=1;4.L.18=0;4.y.18=1;4.y.1X=\'2p\';4.1w.2A=0};$.A.u.W.61=8($9,$I,4){$9.P(\'1r\',\'1x\');4.R.O($.A.u.12);q h=$9.D();4.y.E=h;4.y.B=0;4.1v.E=0;4.M.E=0;4.L.E=-h};$.A.u.W.60=8($9,$I,4){$9.P(\'1r\',\'1x\');4.R.O($.A.u.12);q h=$9.D();4.1v.E=0;4.y.E=-h;4.y.B=0;4.M.E=0;4.L.E=h};$.A.u.W.5Z=8($9,$I,4){$9.P(\'1r\',\'1x\');4.R.O($.A.u.12);q w=$9.F();4.1v.B=0;4.y.B=w;4.y.E=0;4.M.B=0;4.L.B=0-w};$.A.u.W.63=8($9,$I,4){$9.P(\'1r\',\'1x\');4.R.O($.A.u.12);q w=$9.F();4.1v.B=0;4.y.B=-w;4.y.E=0;4.M.B=0;4.L.B=w};$.A.u.W.64=8($9,$I,4){$9.P(\'1r\',\'1x\').F();4.R.O(8(x,m,4,X){7(4.1J)X=!X;$.A.u.12(x,m,4);4.y.B=X?(m.V-1):(1-m.V);4.L.B=X?-x.V:x.V});4.1v.B=0;4.y.E=0;4.M.B=0;4.L.E=0};$.A.u.W.67=8($9,$I,4){$9.P(\'1r\',\'1x\');4.R.O(8(x,m,4,X){7(4.1J)X=!X;$.A.u.12(x,m,4);4.y.E=X?(1-m.U):(m.U-1);4.L.E=X?x.U:-x.U});4.1v.E=0;4.y.B=0;4.M.E=0;4.L.B=0};$.A.u.W.66=8($9,$I,4){4.R.O(8(x,m,4){$(4.1y).1n(x).2e();$.A.u.12(x,m,4,K,H);4.M.F=m.V});4.y.B=0;4.y.E=0;4.y.F=0;4.M.F=\'3f\';4.L.F=0};$.A.u.W.65=8($9,$I,4){4.R.O(8(x,m,4){$(4.1y).1n(x).2e();$.A.u.12(x,m,4,H,K);4.M.D=m.U});4.y.B=0;4.y.E=0;4.y.D=0;4.M.D=\'3f\';4.L.D=0};$.A.u.W.26=8($9,$I,4){q i,w=$9.P(\'1r\',\'53\').F();$I.P({B:0,E:0});4.R.O(8(x,m,4){$.A.u.12(x,m,4,H,H,H)});7(!4.4P){4.1g=4.1g/2; 4.4P=H}4.1s=0;4.26=4.26||{B:-w,E:15};4.C=[];1C(i=0;i<$I.Q;i++)4.C.O($I[i]);1C(i=0;i<4.11;i++)4.C.O(4.C.4M());4.2n=8(x,m,4,1D,X){7(4.1J)X=!X;q $1e=X?$(x):$(m);$(m).P(4.y);q 1O=4.1B;$1e.3a(4.26,4.1F,4.25,8(){q 2l=$.A.u.4Q(4,X);1C(q k=0;k<2l;k++){7(X)4.C.O(4.C.4M());N 4.C.3s(4.C.6j())}7(X){1C(q i=0,3u=4.C.Q;i<3u;i++)$(4.C[i]).P(\'z-2y\',3u-i+1O)}N{q z=$(x).P(\'z-2y\');$1e.P(\'z-2y\',1k(z,10)+1+1O)}$1e.3a({B:0,E:0},4.1G,4.2f,8(){$(X?G:x).2e();7(1D)1D()})})};$.1i(4.y,{1X:\'2p\',18:1,E:0,B:0})};$.A.u.W.6k=8($9,$I,4){4.R.O(8(x,m,4){$.A.u.12(x,m,4,H,K);4.y.E=m.U;4.M.D=m.U;4.L.F=m.V});4.1v.E=0;4.y.B=0;4.y.D=0;4.M.E=0;4.L.D=0};$.A.u.W.6y=8($9,$I,4){4.R.O(8(x,m,4){$.A.u.12(x,m,4,H,K);4.M.D=m.U;4.L.E=x.U});4.1v.E=0;4.y.B=0;4.y.E=0;4.y.D=0;4.L.D=0};$.A.u.W.6x=8($9,$I,4){4.R.O(8(x,m,4){$.A.u.12(x,m,4,K,H);4.y.B=m.V;4.M.F=m.V});4.y.E=0;4.y.F=0;4.M.B=0;4.L.F=0};$.A.u.W.6w=8($9,$I,4){4.R.O(8(x,m,4){$.A.u.12(x,m,4,K,H);4.M.F=m.V;4.L.B=x.V});$.1i(4.y,{E:0,B:0,F:0});4.M.B=0;4.L.F=0};$.A.u.W.4K=8($9,$I,4){4.R.O(8(x,m,4){$.A.u.12(x,m,4,K,K,H);4.y.E=m.U/2;4.y.B=m.V/2;$.1i(4.M,{E:0,B:0,F:m.V,D:m.U});$.1i(4.L,{F:0,D:0,E:x.U/2,B:x.V/2})});4.1v.E=0;4.1v.B=0;4.y.F=0;4.y.D=0};$.A.u.W.6z=8($9,$I,4){4.R.O(8(x,m,4){$.A.u.12(x,m,4,K,K);4.y.B=m.V/2;4.y.E=m.U/2;$.1i(4.M,{E:0,B:0,F:m.V,D:m.U})});4.y.F=0;4.y.D=0;4.L.18=0};$.A.u.W.6A=8($9,$I,4){q w=$9.P(\'1r\',\'1x\').F();4.R.O(8(x,m,4){$.A.u.12(x,m,4);4.M.F=m.V;4.L.B=x.V});4.y.B=w;4.y.E=0;4.M.B=0;4.L.B=w};$.A.u.W.6D=8($9,$I,4){q h=$9.P(\'1r\',\'1x\').D();4.R.O(8(x,m,4){$.A.u.12(x,m,4);4.M.D=m.U;4.L.E=x.U});4.y.E=h;4.y.B=0;4.M.E=0;4.L.E=h};$.A.u.W.6C=8($9,$I,4){q h=$9.P(\'1r\',\'1x\').D();q w=$9.F();4.R.O(8(x,m,4){$.A.u.12(x,m,4);4.M.D=m.U;4.L.E=x.U});4.y.E=h;4.y.B=w;4.M.E=0;4.M.B=0;4.L.E=h;4.L.B=w};$.A.u.W.6B=8($9,$I,4){4.R.O(8(x,m,4){$.A.u.12(x,m,4,K,H);4.y.B=G.V/2;4.M.B=0;4.M.F=G.V;4.L.B=0});4.y.E=0;4.y.F=0};$.A.u.W.6v=8($9,$I,4){4.R.O(8(x,m,4){$.A.u.12(x,m,4,H,K);4.y.E=G.U/2;4.M.E=0;4.M.D=G.U;4.L.E=0});4.y.D=0;4.y.B=0};$.A.u.W.6u=8($9,$I,4){4.R.O(8(x,m,4){$.A.u.12(x,m,4,K,H,H);4.y.B=m.V/2;4.M.B=0;4.M.F=G.V;4.L.B=x.V/2;4.L.F=0});4.y.E=0;4.y.F=0};$.A.u.W.6o=8($9,$I,4){4.R.O(8(x,m,4){$.A.u.12(x,m,4,H,K,H);4.y.E=m.U/2;4.M.E=0;4.M.D=m.U;4.L.E=x.U/2;4.L.D=0});4.y.D=0;4.y.B=0};$.A.u.W.6n=8($9,$I,4){q d=4.4W||\'B\';q w=$9.P(\'1r\',\'1x\').F();q h=$9.D();4.R.O(8(x,m,4){$.A.u.12(x,m,4);7(d==\'4T\')4.y.B=-w;N 7(d==\'4U\')4.y.E=h;N 7(d==\'4Z\')4.y.E=-h;N 4.y.B=w});4.M.B=0;4.M.E=0;4.y.E=0;4.y.B=0};$.A.u.W.6m=8($9,$I,4){q d=4.4W||\'B\';q w=$9.P(\'1r\',\'1x\').F();q h=$9.D();4.R.O(8(x,m,4){$.A.u.12(x,m,4,H,H,H);7(d==\'4T\')4.L.B=w;N 7(d==\'4U\')4.L.E=-h;N 7(d==\'4Z\')4.L.E=h;N 4.L.B=-w});4.M.B=0;4.M.E=0;4.y.E=0;4.y.B=0};$.A.u.W.6l=8($9,$I,4){q w=$9.P(\'1r\',\'53\').F();q h=$9.D();4.R.O(8(x,m,4){$.A.u.12(x,m,4,H,H,H);7(!4.L.B&&!4.L.E)$.1i(4.L,{B:w*2,E:-h/2,18:0});N 4.L.18=0});4.y.B=0;4.y.E=0;4.M.B=0};$.A.u.W.6p=8($9,$I,4){q w=$9.P(\'1r\',\'1x\').F();q h=$9.D();4.y=4.y||{};q 1j;7(4.1j){7(/6q/.2g(4.1j))1j=\'27(1A 1A \'+h+\'14 1A)\';N 7(/6t/.2g(4.1j))1j=\'27(1A \'+w+\'14 \'+h+\'14 \'+w+\'14)\';N 7(/6s/.2g(4.1j))1j=\'27(1A \'+w+\'14 1A 1A)\';N 7(/6r/.2g(4.1j))1j=\'27(\'+h+\'14 \'+w+\'14 \'+h+\'14 1A)\';N 7(/4K/.2g(4.1j)){q E=1k(h/2,10);q B=1k(w/2,10);1j=\'27(\'+E+\'14 \'+B+\'14 \'+E+\'14 \'+B+\'14)\'}}4.y.1j=4.y.1j||1j||\'27(1A 1A 1A 1A)\';q d=4.y.1j.4J(/(\\d+)/g);q t=1k(d[0],10),r=1k(d[1],10),b=1k(d[2],10),l=1k(d[3],10);4.R.O(8(x,m,4){7(x==m)J;q $x=$(x),$m=$(m);$.A.u.12(x,m,4,H,H,K);4.1w.1X=\'2p\';q 2t=1,1O=1k((4.1F/13),10)-1;(8 f(){q 4B=t?t-1k(2t*(t/1O),10):0;q 54=l?l-1k(2t*(l/1O),10):0;q 5a=b<h?b+1k(2t*((h-b)/1O||1),10):h;q 5c=r<w?r+1k(2t*((w-r)/1O||1),10):w;$m.P({1j:\'27(\'+4B+\'14 \'+5c+\'14 \'+5a+\'14 \'+54+\'14)\'});(2t++<=1O)?2M(f,13):$x.P(\'1X\',\'2w\')})()});$.1i(4.y,{1X:\'2p\',18:1,E:0,B:0});4.M={B:0};4.L={B:0}}})(52);',62,442,'||||opts|||if|function|cont|||||||||||||next||||var||||cycle|||curr|cssBefore||fn|left|els|height|top|width|this|true|slides|return|false|animOut|animIn|else|push|css|length|before|options|nextSlide|cycleH|cycleW|transitions|fwd|null|fx||currSlide|commonReset||px||||opacity||after|slide|cycleTimeout|startingSlide|el|timeout|speed|each|extend|clip|parseInt|first|log|not|randomIndex|cyclePause|fxs|overflow|random|backwards|original|cssFirst|cssAfter|hidden|elements|randomMap|0px|slideCount|for|cb|pager|speedIn|speedOut|fit|debug|rev|isFunction|arg2|cycleStop|opts2|count|go|data|undefined|roll|tx|manual|triggerPause|maxh|display|prev|case||pagerAnchorBuilder|Math|lastFx|support|easeIn|shuffle|rect||updateActivePagerLink|txs|startTime|clearTimeout|e0|hide|easeOut|test|advance|destroy|ms|paused|hops|multiFx|fxFn|num|block|maxw|init|bind|step|pauseFlag|pagerAnchors|none|prevNextEvent|index|prepend|zIndex|busy|continuous|rgb|cnt|cleartype|aspect|click|margin|changed|hex|slideResize|setTimeout|complete|terminating|attr|fastOnEvent|browser|auto|nowrap|clone|speedOverride|val|meta|pagerEvent|transition||stop|slideshow|eq||oneTimeFx|apply||stopCount|found|animate|requeueAttempts|position|sync|unbind|show|byHover|autostop|activePagerClass|onPager|moveForward|typeof|ver|console|background|removeFilter|checkInstantResume|ratio|unshift|arr|len|startingSlideSpecified|createPagerAnchor|color|lastSlide|autostopCount|clearTypeFix|requeue|custom|countdown|pause|hasOwnProperty|mouseenter|clsName|getTimeout|sort|timeoutFn|slideExpr|bounce|250|queueNext|manualTrump|constructor|containerResize|containerResizeHeight|end|easing|cleartypeNoBg|center|pagerFn|src|appendTo|splice|absolute||newSlide|exposeAddSlide|saveOriginalOpts|offsetWidth|r2|supportMultiTransitions|active|while|resetState|loadingFF|call|loadingOp|children|floor|loadingOther|img|r1|buffer|msie|in|buildPager|unknown|loadingIE|String|onAddSlide|getBg|use|handleArguments|strict|filter|style|skipInitializationCallbacks|requeueOnImageNotLoaded|onPrevNextEvent|tt|pauseOnPagerHover|randomizeEffects|offsetHeight|resume|isReady|selector|DOM|match|zoom|isPaused|shift|can|ready|speedAdjusted|hopsFromLast|onPagerEvent|requeueTimeout|right|up|indexOf|direction|metaAttr|reshape|down|mouseleave|hover|jQuery|visible|ll|resumed|defaults|buildOptions|allowPagerClickBubble|delay|bb|metadata|rr|fade|too|determine|invalid|few|could|string|size|500|of|image|toggle|removeData|9999|get|switch|default|speeds|ignored|Number|try|static|relative|Array|prototype|100|opera|mozilla|outerWidth|outerHeight|innerHeight|is|startSlide|join|arguments|loaded|queuing|zero|by|requeuing|context|expr|remove|smother|catch|removeAttribute|window|applying|scrollLeft|scrollDown|scrollUp|fadeout|scrollRight|scrollHorz|slideY|slideX|scrollVert|4000|1000|html|toLowerCase|nodeName|toString|parentNode|transparent|activeSlide|number|replace|pop|turnUp|toss|uncover|cover|curtainY|wipe|l2r|b2t|t2b|r2l|curtainX|growY|turnRight|turnLeft|turnDown|fadeZoom|blindX|growX|blindZ|blindY|hack|ffffff|returned|valid|href|firing|request|parents|all|removeClass|discarding|split|prevNextClick|No|addClass|body|new|sequence|addSlide|randomized|named|clearType|mouseover|pagerClick|preventDefault|append|ignoring|stopping|prependTo|calculated'.split('|'),0,{})) diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/slideshow/jquery.waitforimages.min.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/slideshow/jquery.waitforimages.min.js new file mode 100644 index 0000000000000000000000000000000000000000..7fe2fc1722aab214265c0fd75d2eed5dfee9bbe0 --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/slideshow/jquery.waitforimages.min.js @@ -0,0 +1 @@ +eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('(6($){3 v=\'l\';$.l={D:[\'11\',\'X\',\'15\',\'1a\']};$.Q[\':\'].o=6(8){9(!$(8).B(\'7[5!=""]\')){k w}3 7=n F();7.5=8.5;k!7.16};$.O.l=6(a,b,c){3 h=0;3 j=0;9($.N(m[0])){a=m[0].M;b=m[0].e;c=m[0].c}a=a||$.H;b=b||$.H;c=!!c;9(!$.x(a)||!$.x(b)){P n L(\'S R T I K.\')}k f.e(6(){3 8=$(f);3 d=[];3 y=$.l.D||[];3 z=/J\\(\\s*([\'"]?)(.*?)\\1\\s*\\)/g;9(c){8.A(\'*\').14().e(6(){3 4=$(f);9(4.B(\'7:o\')){d.p({5:4.U(\'5\'),4:4[0]})}$.e(y,6(i,E){3 r=4.17(E);3 q;9(!r){k 19}18(q=z.13(r)){d.p({5:q[2],4:4[0]})}})})}W{8.A(\'7:o\').e(6(){d.p({5:f.5,4:f})})}h=d.Y;j=0;9(h===0){a.t(8[0])}$.e(d,6(i,7){3 u=n F();$(u).10(\'C.\'+v+\' Z.\'+v,6(G){j++;b.t(7.4,j,h,G.V==\'C\');9(j==h){a.t(8[0]);k w}});u.5=7.5})})}}(12));',62,73,'|||var|element|src|function|img|obj|if|finishedCallback|eachCallback|waitForAll|allImgs|each|this||allImgsLength||allImgsLoaded|return|waitForImages|arguments|new|uncached|push|match|propertyValue||call|image|eventNamespace|false|isFunction|hasImgProperties|matchUrl|find|is|load|hasImageProperties|property|Image|event|noop|was|url|supplied|TypeError|finished|isPlainObject|fn|throw|expr|invalid|An|callback|attr|type|else|listStyleImage|length|error|bind|backgroundImage|jQuery|exec|andSelf|borderImage|complete|css|while|true|borderCornerImage'.split('|'),0,{})) diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/slideshow/nextgen_basic_slideshow.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/slideshow/nextgen_basic_slideshow.js index f9c9eeb4732d2908b5932063c56064d49bf40c26..c323501a12700bf603dffd3f0a834745b8bdde1e 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/slideshow/nextgen_basic_slideshow.js +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/slideshow/nextgen_basic_slideshow.js @@ -29,7 +29,7 @@ jQuery.fn.nggShowSlideshow = function(args) { self.show(); if (placeholder) { - self.prepend('<img class="image-placeholder" src="' + placeholder + '" width="' + s.width + '" height="' + s.height + '" style="width: ' + s.width + 'px; height: ' + s.height + 'px;" />'); + self.prepend('<img class="image-placeholder" src="' + placeholder + '" width="' + s.width + '" height="' + s.height + '" style="width: ' + s.width + 'px; height: auto;" />'); } if (self.children().length > 1) { diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/slideshow/nextgen_basic_slideshow.min.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/slideshow/nextgen_basic_slideshow.min.css new file mode 100644 index 0000000000000000000000000000000000000000..a83415d8811014638aa555a42598e0c448c74cd3 --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/slideshow/nextgen_basic_slideshow.min.css @@ -0,0 +1 @@ +#page{overflow:visible}.slideshow{margin-left:auto;margin-right:auto;text-align:center;outline:0}.ngg-slideshow{overflow:hidden;position:relative;margin-left:auto;margin-right:auto;text-align:center;clear:both;z-index:0}.ngg-slideshow *{vertical-align:middle}.ngg-slideshow img{max-width:100% !important;max-height:100%;width:auto;height:auto;border:0}.ngg-slideshow .ngg-gallery-slideshow-image{position:relative;width:100% !important;height:100% !important;max-width:100% !important;max-height:100% !important}.ngg-slideshow .image-placeholder{visibility:hidden}.ngg-slideshow-loader{display:table-cell;text-align:center;vertical-align:middle}.ngg-slideshow-loader img{background:none !important;border:0 none !important;margin:auto !important} \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/slideshow/nextgen_basic_slideshow.min.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/slideshow/nextgen_basic_slideshow.min.js new file mode 100644 index 0000000000000000000000000000000000000000..03ee290b1c961b1289367fc399c1e6772a075ade --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/slideshow/nextgen_basic_slideshow.min.js @@ -0,0 +1 @@ +eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('0.D.C=4(j){2 t={h:1,5:B,a:z,d:\'A\',E:\'\',g:F};2 s=0.K({},t,j);2 6=b.6;0(6+\'-y\').I().k();2 p=0(6);2 9=0(6+\'-7-c\');2 3=b;0(9).G(4(){2 c=9.H().L();2 8=p.x(\'f-8\');9.k();c.u(3);3.w();q(8){3.v(\'<n J="7-8" W="\'+8+\'" 5="\'+s.5+\'" a="\'+s.a+\'" 11="5: \'+s.5+\'10; a: Z;" />\')}q(3.Y().12>1){3.M({d:s.d,13:\'.l-9-17-7\',16:r,14:r,X:1,g:s.g,Q:3,P:4(O,e,N,R){0(e).S().V(\'U.l-T-15\').o(4(){0(b).m(\'i\').o(4(){0(b).f(\'7-h\',0(e).m(\'n\').f(\'7-h\'))})})}})}})};',62,70,'jQuery||var|self|function|width|selector|image|placeholder|gallery|height|this|list|fx|nextSlideElement|data|timeout|id||args|remove|ngg|find|img|each|container|if|false||defaults|appendTo|prepend|show|attr|loader|400|fade|600|nggShowSlideshow|fn|domain|5000|waitForImages|contents|empty|class|extend|detach|cycle|options|currSlideElement|after|next|forwardFlag|parent|trigger|div|siblings|src|fit|children|auto|px|style|length|slideExpr|containerResize|buttons|slideResize|slideshow'.split('|'),0,{})) diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/slideshow/nextgen_basic_slideshow_settings.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/slideshow/nextgen_basic_slideshow_settings.js index d4d9e63c075b9519fc27063fea04c5dfc79a2690..d6c827137141910b7f842bb70eef8bac86ec9618 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/slideshow/nextgen_basic_slideshow_settings.js +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/slideshow/nextgen_basic_slideshow_settings.js @@ -1,20 +1,4 @@ jQuery(function($) { $('input[name="photocrati-nextgen_basic_slideshow[show_thumbnail_link]"]') .nextgen_radio_toggle_tr('1', $('#tr_photocrati-nextgen_basic_slideshow_thumbnail_link_text')); - - $('input[name="photocrati-nextgen_basic_slideshow[flash_enabled]"]') - .nextgen_radio_toggle_tr('1', $('#tr_photocrati-nextgen_basic_slideshow_flash_background_music')) - .nextgen_radio_toggle_tr('1', $('#tr_photocrati-nextgen_basic_slideshow_flash_stretch_image')) - .nextgen_radio_toggle_tr('1', $('#tr_photocrati-nextgen_basic_slideshow_flash_transition_effect')) - .nextgen_radio_toggle_tr('1', $('#tr_photocrati-nextgen_basic_slideshow_flash_shuffle')) - .nextgen_radio_toggle_tr('1', $('#tr_photocrati-nextgen_basic_slideshow_flash_next_on_click')) - .nextgen_radio_toggle_tr('1', $('#tr_photocrati-nextgen_basic_slideshow_flash_navigation_bar')) - .nextgen_radio_toggle_tr('1', $('#tr_photocrati-nextgen_basic_slideshow_flash_loading_icon')) - .nextgen_radio_toggle_tr('1', $('#tr_photocrati-nextgen_basic_slideshow_flash_watermark_logo')) - .nextgen_radio_toggle_tr('1', $('#tr_photocrati-nextgen_basic_slideshow_flash_slow_zoom')) - .nextgen_radio_toggle_tr('1', $('#tr_photocrati-nextgen_basic_slideshow_flash_xhtml_validation')) - .nextgen_radio_toggle_tr('1', $('#tr_photocrati-nextgen_basic_slideshow_flash_background_color')) - .nextgen_radio_toggle_tr('1', $('#tr_photocrati-nextgen_basic_slideshow_flash_text_color')) - .nextgen_radio_toggle_tr('1', $('#tr_photocrati-nextgen_basic_slideshow_flash_rollover_color')) - .nextgen_radio_toggle_tr('1', $('#tr_photocrati-nextgen_basic_slideshow_flash_screen_color')); }); \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/slideshow/nextgen_basic_slideshow_settings.min.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/slideshow/nextgen_basic_slideshow_settings.min.js new file mode 100644 index 0000000000000000000000000000000000000000..fb8b81c615917e58aca2347a56fdeac3336a4103 --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/slideshow/nextgen_basic_slideshow_settings.min.js @@ -0,0 +1 @@ +eval(function(p,a,c,k,e,d){e=function(c){return c.toString(36)};if(!''.replace(/^/,String)){while(c--){d[c.toString(a)]=k[c]||c.toString(a)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('4(3($){$(\'2[0="5-6[a]"]\').9(\'1\',$(\'#7-8\'))});',11,11,'name||input|function|jQuery|photocrati|nextgen_basic_slideshow|tr_photocrati|nextgen_basic_slideshow_thumbnail_link_text|nextgen_radio_toggle_tr|show_thumbnail_link'.split('|'),0,{})) diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/ajax_pagination.min.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/ajax_pagination.min.js new file mode 100644 index 0000000000000000000000000000000000000000..9a739aa1600ffa726350336a78c2ed242af3b783 --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/ajax_pagination.min.js @@ -0,0 +1 @@ +eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('H(4($){s={G:F,m:4(){3 b=7;$(\'u\').E(\'I\',\'a.J-N, a.M, a.L\',4(e){3 $7=$(7);3 $5=$7.K(\'.9-D:w\');3 p=$5.j(\'o\').i(\'9-5-\',\'\').i(/-\\d+$/,\'\');h($5.x(\'9-C-B-y\'))v;e.A();b.g(z);$.O($7.j(\'Z\'),4(l){3 n=$(l);$5.11(n.12(\'13[o*="9-5-\'+p+\'"]\'));$(Y).S(\'R\')}).Q(4(){b.g(T)})})},U:4(k){3 f={};3 6=k.c(\'?\');h(6.q==2){6=6[1].c(\'&\');W(3 t V 6){3 8=6[t].c(\'=\');f[8[0]]=8.q==2?8[1]:\'\'}}v f},g:4(r){$(\'u, a\').14(\'10\',r?\'P\':\'X\')}};s.m()});',62,67,'|||var|function|gallery|url_parts|this|param|ngg||self|split|||url_params|toggle_busy|if|replace|attr|url|response|init|html|id|gallery_id|length|busy|NggAjaxNavigation|key|body|return|first|hasClass|none|true|preventDefault|pagination|ajax|galleryoverview|on|null|loading_image|jQuery|click|page|parents|next|prev|numbers|get|wait|always|refreshed|trigger|false|get_querystring_params_from_url|in|for|auto|document|href|cursor|replaceWith|find|div|css'.split('|'),0,{})) diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/nextgen_basic_thumbnails.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/nextgen_basic_thumbnails.js index 139597f9cb07c5d48bed18984ec4747f4b4f3438..71d54130cd90fa0ee4322a86e67e539a6f4f1f8f 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/nextgen_basic_thumbnails.js +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/nextgen_basic_thumbnails.js @@ -1,2 +1,50 @@ +jQuery(function($) { + var ngg_imagebrowser_init = function() { + var imagebrowser_links = $('a.use_imagebrowser_effect'); + imagebrowser_links.click(function(e) { + e.preventDefault(); + var success = true; + var $this = $(this); + var image_id = $this.attr('data-image-id'); + var image_slug = $this.attr('data-image-slug'); + var url = window.location.toString(); + url = url.split('/' + photocrati_ajax.ngg_param_slug + '/').shift(); + if (url.substr(-1) == '/') + url = url.substr(0, url.length - 1); + image_id = image_slug ? image_slug : image_id; + try { + if (!image_id) + image_id = parseInt($this.parents('.ngg-gallery-thumbnail-box').attr('id').match(/\d+/).join('')); + } catch (ex) { + success = false; + } + + if (success) { + // Custom permalinks are disabled. So we have to redirect to /index.php/nggallery/image/n?qs=1 + if (photocrati_ajax.wp_root_url.indexOf('index.php') >= 0) { + url = photocrati_ajax.wp_root_url + "/" + photocrati_ajax.ngg_param_slug + "/image/" + image_id; + if (window.location.toString().indexOf('?') >= 0) + url += '?'+window.location.toString().split('?').pop(); + } else { + // Just append the slug + url += "/"+photocrati_ajax.ngg_param_slug+"/image/"+image_id; + } + window.location = url; + } + }); + + // Unregister any onclick handlers added after the above has executed to avoid conflicts + if (imagebrowser_links.length > 0) { + setTimeout(function() { + imagebrowser_links.each(function() { + this.onclick = null; + }); + }, 200); + } + }; + + $(this).bind('refreshed', ngg_imagebrowser_init); + ngg_imagebrowser_init(); +}); diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/nextgen_basic_thumbnails.min.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/nextgen_basic_thumbnails.min.css new file mode 100644 index 0000000000000000000000000000000000000000..74feefb5d6fc27a03ae6369391d32e90827965d2 --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/nextgen_basic_thumbnails.min.css @@ -0,0 +1 @@ +.ngg-galleryoverview{overflow:hidden;margin-top:10px;width:100%;clear:both;display:block !important}.ngg-galleryoverview .desc{margin:0 10px 10px 0;padding:5px}.ngg-gallery-thumbnail-box{float:left;margin-right:5px}.ngg-template-caption .ngg-gallery-thumbnail-box{margin-right:0}.ngg-gallery-thumbnail{float:left;text-align:center}.ngg-gallery-thumbnail img{background-color:#fff;border:1px solid #a9a9a9;display:block;margin:4px 0 4px 4px;padding:4px;position:relative}.ngg-gallery-thumbnail img:hover{background-color:#a9a9a9}.ngg-gallery-thumbnail span{font-size:90%;padding-left:5px;display:block}.ngg-galleryoverview ul li:before{content:'' !important}.ngg-gallery-list{list-style-type:none;padding:0 !important;text-indent:0 !important}.ngg-galleryoverview div.pic img{width:100%;border:0;border-radius:0}.ngg-gallery-list li{float:left;margin:0 2px 0 2px !important;overflow:hidden}.ngg-gallery-list li a{border:1px solid #ccc;display:block;padding:2px}.ngg-gallery-list li.selected a{-moz-background-inline-policy:continuous;-moz-background-origin:padding;background:#000 none repeat scroll 0 0}.ngg-gallery-list li img{height:40px;width:40px}li.ngg-next,li.ngg-prev{height:40px;width:40px;font-size:3.5em}li.ngg-next a,li.ngg-prev a{padding-top:10px;border:0;text-decoration:none} \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/nextgen_basic_thumbnails.min.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/nextgen_basic_thumbnails.min.js new file mode 100644 index 0000000000000000000000000000000000000000..3f33ef6696a3e52a40024b7908ce5591373e32f8 --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/nextgen_basic_thumbnails.min.js @@ -0,0 +1 @@ +eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('C(8($){4 i=8(){4 f=$(\'a.B\');f.A(8(e){e.D();4 l=E;4 $5=$(5);4 3=$5.k(\'m-c-r\');4 h=$5.k(\'m-c-z\');4 2=b.9.g();2=2.q(\'/\'+7.j+\'/\').H();6(2.p(-1)==\'/\')2=2.p(0,2.s-1);3=h?h:3;t{6(!3)3=v($5.x(\'.y-w-G-L\').k(\'r\').T(/\\d+/).V(\'\'))}U(W){l=S}6(l){6(7.o.n(\'R.K\')>=0){2=7.o+"/"+7.j+"/c/"+3;6(b.9.g().n(\'?\')>=0)2+=\'?\'+b.9.g().q(\'?\').M()}N{2+="/"+7.j+"/c/"+3}b.9=2}});6(f.s>0){O(8(){f.P(8(){5.J=Q})},I)}};$(5).u(\'F\',i);i()});',59,59,'||url|image_id|var|this|if|photocrati_ajax|function|location||window|image|||imagebrowser_links|toString|image_slug|ngg_imagebrowser_init|ngg_param_slug|attr|success|data|indexOf|wp_root_url|substr|split|id|length|try|bind|parseInt|gallery|parents|ngg|slug|click|use_imagebrowser_effect|jQuery|preventDefault|true|refreshed|thumbnail|shift|200|onclick|php|box|pop|else|setTimeout|each|null|index|false|match|catch|join|ex'.split('|'),0,{})) diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/nextgen_basic_thumbnails_settings.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/nextgen_basic_thumbnails_settings.js index e36f55833d2c6bd20a95133eb7ca93eb495e25c4..ad886ffeaa82617d376c5d7c491f84a3f16cfb42 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/nextgen_basic_thumbnails_settings.js +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/nextgen_basic_thumbnails_settings.js @@ -3,9 +3,6 @@ jQuery(function($) { .nextgen_radio_toggle_tr('1', $('#tr_photocrati-nextgen_basic_thumbnails_thumbnail_dimensions')) .nextgen_radio_toggle_tr('1', $('#tr_photocrati-nextgen_basic_thumbnails_thumbnail_crop')); - $('input[name="photocrati-nextgen_basic_thumbnails[show_piclens_link]"]') - .nextgen_radio_toggle_tr('1', $('#tr_photocrati-nextgen_basic_thumbnails_piclens_link_text')); - $('input[name="photocrati-nextgen_basic_thumbnails[show_slideshow_link]"]') .nextgen_radio_toggle_tr('1', $('#tr_photocrati-nextgen_basic_thumbnails_slideshow_link_text')) }); diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/nextgen_basic_thumbnails_settings.min.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/nextgen_basic_thumbnails_settings.min.css new file mode 100644 index 0000000000000000000000000000000000000000..e2fb82de8c3ec4b75e424d056d1baa7ecf6ea94d --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/nextgen_basic_thumbnails_settings.min.css @@ -0,0 +1 @@ +.nextgen-thumb-size-custom br{display:none} \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/nextgen_basic_thumbnails_settings.min.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/nextgen_basic_thumbnails_settings.min.js new file mode 100644 index 0000000000000000000000000000000000000000..fc249d4b83e221a5fdf16bc43c8d33b03ec827af --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/static/thumbnails/nextgen_basic_thumbnails_settings.min.js @@ -0,0 +1 @@ +eval(function(p,a,c,k,e,d){e=function(c){return c.toString(36)};if(!''.replace(/^/,String)){while(c--){d[c.toString(a)]=k[c]||c.toString(a)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('9(8($){$(\'4[3="6-5[7]"]\').0(\'1\',$(\'#2-a\')).0(\'1\',$(\'#2-b\'));$(\'4[3="6-5[d]"]\').0(\'1\',$(\'#2-c\'))});',14,14,'nextgen_radio_toggle_tr||tr_photocrati|name|input|nextgen_basic_thumbnails|photocrati|override_thumbnail_settings|function|jQuery|nextgen_basic_thumbnails_thumbnail_dimensions|nextgen_basic_thumbnails_thumbnail_crop|nextgen_basic_thumbnails_slideshow_link_text|show_slideshow_link'.split('|'),0,{})) diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/templates/slideshow/index.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/templates/slideshow/index.php index fe41b16c82bf3163362567b04980653aee08ddff..ff0011da1da6495051906a491311f3d82d7d7fc7 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/templates/slideshow/index.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/templates/slideshow/index.php @@ -1,202 +1,93 @@ <?php $this->start_element('nextgen_gallery.gallery_container', 'container', $displayed_gallery); ?> -<?php if ($show_thumbnail_link): ?> -<!-- Thumbnails Link --> -<div class="slideshowlink"> - <a href='<?php esc_attr_e($thumbnail_link) ?>'><?php echo_h($thumbnail_link_text) ?></a> -</div> -<?php endif ?> -<?php if ($flash_enabled): ?> - <!-- Display Flash Slideshow --> +<?php if ($show_thumbnail_link) { ?> + <!-- Thumbnails Link --> + <div class="slideshowlink"> + <a href='<?php esc_attr_e($thumbnail_link); ?>'><?php esc_html_e($thumbnail_link_text); ?></a> + </div> +<?php } ?> +<div class="ngg-slideshow-image-list ngg-slideshow-nojs" id="<?php esc_attr_e($anchor); ?>-image-list"> <?php - // Configure slideshow parameters - $width = $gallery_width; - $height = $gallery_height; - - if ($cycle_interval == 0) - $cycle_interval = 1; - - if ($flash_background_color && $flash_background_color[0] == '#') - $flash_background_color = substr($flash_background_color, 1); - - if ($flash_text_color && $flash_text_color[0] == '#') - $flash_text_color = substr($flash_text_color, 1); - - if ($flash_rollover_color && $flash_rollover_color[0] == '#') - $flash_rollover_color = substr($flash_rollover_color, 1); - - if ($flash_screen_color && $flash_screen_color[0] == '#') - $flash_screen_color = substr($flash_screen_color, 1); - - // init the flash output - $swfobject = new swfobject( $flash_path, 'so' . $displayed_gallery_id, $width, $height, '7.0.0', 'false'); - - $swfobject->message = '<p>' . __('Slideshows require the <a href="http://www.macromedia.com/go/getflashplayer">Flash Player</a> and a <a href="http://www.mozilla.com/firefox/">browser with Javascript support</a>.', 'nggallery') . '</p>'; - - $swfobject->add_params('wmode', 'opaque'); - $swfobject->add_params('allowfullscreen', 'true'); - $swfobject->add_params('bgcolor', $flash_screen_color, 'FFFFFF', 'string', '#'); - $swfobject->add_attributes('styleclass', 'slideshow'); - $swfobject->add_attributes('name', 'so' . $displayed_gallery_id); - - // adding the flash parameter - $swfobject->add_flashvars( 'file', urlencode ( $mediarss_link ) ); - $swfobject->add_flashvars( 'shuffle', (!empty($flash_shuffle) ? TRUE : FALSE), '', 'bool'); - - // option has oposite meaning : true should switch to next image - $swfobject->add_flashvars( 'linkfromdisplay', !$flash_next_on_click, 'false', 'bool'); - $swfobject->add_flashvars( 'shownavigation', $flash_navigation_bar, 'true', 'bool'); - $swfobject->add_flashvars( 'showicons', $flash_loading_icon, 'true', 'bool'); - $swfobject->add_flashvars( 'kenburns', $flash_slow_zoom, 'false', 'bool'); - $swfobject->add_flashvars( 'overstretch', $flash_stretch_image, 'false', 'string'); - $swfobject->add_flashvars( 'rotatetime', $cycle_interval, 5, 'int'); - $swfobject->add_flashvars( 'transition', $flash_transition_effect, 'random', 'string'); - - $swfobject->add_flashvars( 'backcolor', $flash_background_color, 'FFFFFF', 'string', '0x'); - $swfobject->add_flashvars( 'frontcolor', $flash_text_color, '000000', 'string', '0x'); - $swfobject->add_flashvars( 'lightcolor', $flash_rollover_color, '000000', 'string', '0x'); - $swfobject->add_flashvars( 'screencolor', $flash_screen_color, '000000', 'string', '0x'); - if ($flash_watermark_logo) { - $ngg_options = C_NextGen_Settings::get_instance(); - $swfobject->add_flashvars( 'logo', $ngg_options['wmPath'], '', 'string'); - } - - - $swfobject->add_flashvars( 'audio', $flash_background_music, '', 'string'); - $swfobject->add_flashvars( 'width', $width, '260'); - $swfobject->add_flashvars( 'height', $height, '320'); - ?> - - <div class="slideshow" id="gallery_<?php echo_h($displayed_gallery_id) ?>"> - <?php echo $swfobject->output(); ?> - </div> - <script type="text/javascript" defer="defer"> - <?php if ($flash_xhtml_validation): ?> - <!-- - <?php endif ?> - jQuery(function($){ - <?php echo $swfobject->javascript(); ?> - }); - <?php if ($flash_xhtml_validation): ?> - --> - <?php endif ?> - </script> - -<?php else: ?> - <?php // Display JQuery Cycle Slideshow ?> - <div class="ngg-slideshow-image-list ngg-slideshow-nojs" id="<?php echo_h($anchor)?>-image-list"> - <?php - - $this->include_template('photocrati-nextgen_gallery_display#list/before'); - - ?> - <?php for ($i=0; $i<count($images); $i++): ?> - - <?php - // Determine image dimensions - $image = $images[$i]; - $image_size = $storage->get_original_dimensions($image); - - if ($image_size == null) { - $image_size['width'] = $image->meta_data['width']; - $image_size['height'] = $image->meta_data['height']; - } - - // Determine whether an image is hidden or not - if (isset($image->hidden) && $image->hidden) { - $image->style = 'style="display: none;"'; - } - else { - $image->style = ''; + $this->include_template('photocrati-nextgen_gallery_display#list/before'); + for ($i = 0; $i < count($images); $i++) { + // Determine image dimensions + $image = $images[$i]; + $image_size = $storage->get_original_dimensions($image); + if ($image_size == null) + { + $image_size['width'] = $image->meta_data['width']; + $image_size['height'] = $image->meta_data['height']; + } + + // Determine whether an image is hidden or not + if (isset($image->hidden) && $image->hidden) { + $image->style = 'style="display: none;"'; + } + else { + $image->style = ''; + } + + // Determine image aspect ratio + $image_ratio = $image_size['width'] / $image_size['height']; + if ($image_ratio > $aspect_ratio) + { + if ($image_size['width'] > $gallery_width) + { + $image_size['width'] = $gallery_width; + $image_size['height'] = (int) round($gallery_width / $image_ratio); } - - // Determine image aspect ratio - $image_ratio = $image_size['width'] / $image_size['height']; - if ($image_ratio > $aspect_ratio) { - if ($image_size['width'] > $gallery_width) { - $image_size['width'] = $gallery_width; - $image_size['height'] = (int) round($gallery_width / $image_ratio); - } + } + else { + if ($image_size['height'] > $gallery_height) + { + $image_size['width'] = (int) round($gallery_height * $image_ratio); + $image_size['height'] = $gallery_height; } - else { - if ($image_size['height'] > $gallery_height) { - $image_size['width'] = (int) round($gallery_height * $image_ratio); - $image_size['height'] = $gallery_height; - } - } - ?> - - <?php - - $template_params = array( - 'index' => $i, - 'class' => 'ngg-gallery-slideshow-image' - ); - $template_params = array_merge(get_defined_vars(), $template_params); - - $this->include_template('photocrati-nextgen_gallery_display#image/before', $template_params); - - ?> - - <img data-image-id='<?php echo esc_attr($image->pid); ?>' - title="<?php echo esc_attr($image->description)?>" - alt="<?php echo esc_attr($image->alttext)?>" - src="<?php echo esc_attr($storage->get_image_url($image, 'full', TRUE))?>" - width="<?php echo esc_attr($image_size['width'])?>" - height="<?php echo esc_attr($image_size['height'])?>" - /> - - <?php - - $this->include_template('photocrati-nextgen_gallery_display#image/after', $template_params); - - ?> - - <?php endfor ?> - - <?php - - $this->include_template('photocrati-nextgen_gallery_display#list/after'); - + } + + $template_params = array( + 'index' => $i, + 'class' => 'ngg-gallery-slideshow-image' + ); + $template_params = array_merge(get_defined_vars(), $template_params); + $this->include_template('photocrati-nextgen_gallery_display#image/before', $template_params); ?> - </div> - - <?php - - $this->include_template('photocrati-nextgen_gallery_display#container/before'); - + <img data-image-id='<?php echo esc_attr($image->pid); ?>' + title="<?php echo esc_attr($image->description)?>" + alt="<?php echo esc_attr($image->alttext)?>" + src="<?php echo esc_attr($storage->get_image_url($image, 'full', TRUE))?>" + width="<?php echo esc_attr($image_size['width'])?>" + height="<?php echo esc_attr($image_size['height'])?>"/> + <?php + $this->include_template('photocrati-nextgen_gallery_display#image/after', $template_params); + } + $this->include_template('photocrati-nextgen_gallery_display#list/after'); ?> - <div - class="ngg-galleryoverview ngg-slideshow" - id="<?php echo_h($anchor)?>" - data-placeholder="<?php echo nextgen_esc_url($placeholder)?>" - style="max-width:<?php echo_h($gallery_width) ?>px; max-height:<?php echo_h($gallery_height) ?>px;"> - - <div - class="ngg-slideshow-loader" - id="<?php echo_h($anchor)?>-loader" - style="width:<?php echo_h($gallery_width) ?>px; height:<?php echo_h($gallery_height) ?>px;"> - <img src="<?php echo_h(NGGALLERY_URLPATH) ?>images/loader.gif" alt="" /> - </div> +</div> +<?php $this->include_template('photocrati-nextgen_gallery_display#container/before'); ?> +<div class="ngg-galleryoverview ngg-slideshow" + id="<?php esc_attr_e($anchor); ?>" + data-placeholder="<?php echo nextgen_esc_url($placeholder); ?>" + style="max-width: <?php esc_attr_e($gallery_width); ?>px; max-height: <?php esc_attr_e($gallery_height); ?>px;"> + <div class="ngg-slideshow-loader" + id="<?php esc_attr_e($anchor); ?>-loader" + style="width: <?php esc_attr_e($gallery_width); ?>px; height: <?php esc_attr_e($gallery_height); ?>px;"> + <img src="<?php esc_attr_e(NGGALLERY_URLPATH); ?>images/loader.gif" alt=""/> </div> - <?php - - $this->include_template('photocrati-nextgen_gallery_display#container/after'); - - ?> - <script type="text/javascript"> - jQuery('#<?php echo_h($anchor)?>-image-list').hide().removeClass('ngg-slideshow-nojs'); - jQuery(function($){ - jQuery('#<?php echo_h($anchor); ?>').nggShowSlideshow({ - id: '<?php echo_h($displayed_gallery_id); ?>', - fx: '<?php echo_h($cycle_effect); ?>', - width: <?php echo_h($gallery_width); ?>, - height: <?php echo_h($gallery_height); ?>, - domain: '<?php echo_h(trailingslashit(home_url())); ?>', - timeout: <?php echo_h(intval($cycle_interval) * 1000); ?> +</div> +<?php $this->include_template('photocrati-nextgen_gallery_display#container/after'); ?> +<script type="text/javascript"> + jQuery('#<?php esc_attr_e($anchor); ?>-image-list').hide().removeClass('ngg-slideshow-nojs'); + jQuery(function($) { + jQuery('#<?php esc_attr_e($anchor); ?>').nggShowSlideshow({ + id: '<?php esc_attr_e($displayed_gallery_id); ?>', + fx: '<?php esc_attr_e($cycle_effect); ?>', + width: <?php esc_attr_e($gallery_width); ?>, + height: <?php esc_attr_e($gallery_height); ?>, + domain: '<?php esc_attr_e(trailingslashit(home_url())); ?>', + timeout: <?php esc_attr_e(intval($cycle_interval) * 1000); ?> }); }); - </script> -<?php endif ?> +</script> <?php $this->end_element(); ?> diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/templates/slideshow/nextgen_basic_slideshow_settings_gallery_dimensions.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/templates/slideshow/nextgen_basic_slideshow_settings_gallery_dimensions.php index 8670ca897366c8431e6c6888903eafa3715df139..37180e24fdf5d99270ea72e164ef16719bab0b42 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/templates/slideshow/nextgen_basic_slideshow_settings_gallery_dimensions.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/templates/slideshow/nextgen_basic_slideshow_settings_gallery_dimensions.php @@ -3,7 +3,7 @@ <label for='<?php echo esc_attr($display_type_name); ?>_gallery_width' class="tooltip" title="<?php echo $gallery_dimensions_tooltip; ?>"> - <?php echo_h($gallery_dimensions_label); ?> + <?php esc_html_e($gallery_dimensions_label); ?> </label> </td> <td> diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/templates/thumbnails/index.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/templates/thumbnails/index.php index 4a007e9adccd18f4385174f0e7299cdbdb8adcd6..9d22bf27228a40b3dffd1020432c453303750e2c 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/templates/thumbnails/index.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_gallery/templates/thumbnails/index.php @@ -5,7 +5,7 @@ $this->start_element('nextgen_gallery.gallery_container', 'container', $displaye ?> <div class="ngg-galleryoverview<?php if (!intval($ajax_pagination)) echo ' ngg-ajax-pagination-none'; ?>" - id="ngg-gallery-<?php echo_h($displayed_gallery_id)?>-<?php echo_h($current_page)?>"> + id="ngg-gallery-<?php esc_attr_e($displayed_gallery_id)?>-<?php esc_attr_e($current_page)?>"> <?php if (!empty($slideshow_link)): ?> <div class="slideshowlink"> @@ -13,15 +13,6 @@ $this->start_element('nextgen_gallery.gallery_container', 'container', $displaye </div> <?php endif ?> - - <?php if ($show_piclens_link): ?> - <!-- Piclense link --> - <div class="piclenselink"> - <a class="piclenselink" href="<?php esc_attr_e($piclens_link) ?>"> - <?php echo_h($piclens_link_text); ?> - </a> - </div> - <?php endif ?> <?php $this->start_element('nextgen_gallery.image_list_container', 'container', $images); @@ -43,7 +34,7 @@ $this->start_element('nextgen_gallery.gallery_container', 'container', $displaye $this->start_element('nextgen_gallery.image_panel', 'item', $image); ?> - <div id="<?php echo_h('ngg-image-' . $i) ?>" class="ngg-gallery-thumbnail-box" <?php if ($style) echo $style; ?>> + <div id="<?php echo esc_attr('ngg-image-' . $i) ?>" class="ngg-gallery-thumbnail-box" <?php if ($style) echo $style; ?>> <?php $this->start_element('nextgen_gallery.image', 'item', $image); diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/module.nextgen_basic_imagebrowser.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/module.nextgen_basic_imagebrowser.php index 03e9fdeaaf77ab99978fd44736fdbac21ae6ec9b..62f0cbcf159c45971545730716ebccc2d56c766d 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/module.nextgen_basic_imagebrowser.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/module.nextgen_basic_imagebrowser.php @@ -19,16 +19,26 @@ class M_NextGen_Basic_ImageBrowser extends C_Base_Module 'photocrati-nextgen_basic_imagebrowser', 'NextGEN Basic ImageBrowser', 'Provides the NextGEN Basic ImageBrowser Display Type', - '0.9', + '0.10', 'http://www.nextgen-gallery.com', 'Photocrati Media', 'http://www.photocrati.com' ); - include_once('class.nextgen_basic_imagebrowser_installer.php'); C_Photocrati_Installer::add_handler($this->module_id, 'C_NextGen_Basic_ImageBrowser_Installer'); } + function initialize() + { + parent::initialize(); + if (is_admin()) { + $forms = C_Form_Manager::get_instance(); + $forms->add_form( + NGG_DISPLAY_SETTINGS_SLUG, NGG_BASIC_IMAGEBROWSER + ); + } + } + /** * Register adapters required for the NextGen Basic ImageBrowser */ @@ -43,17 +53,6 @@ class M_NextGen_Basic_ImageBrowser extends C_Base_Module 'I_Display_Type', 'A_NextGen_Basic_ImageBrowser' ); - // Add rendering logic - $this->get_registry()->add_adapter( - 'I_Display_Type_Controller', 'A_NextGen_Basic_ImageBrowser_Controller', - $this->module_id - ); - - // Add imagebrowser routes - $this->get_registry()->add_adapter( - 'I_Routing_App', 'A_NextGen_Basic_ImageBrowser_Routes' - ); - // Add imagebrowser ngglegacy-compatible urls $this->get_registry()->add_adapter( 'I_Routing_App', 'A_NextGen_Basic_ImageBrowser_Urls' @@ -67,23 +66,37 @@ class M_NextGen_Basic_ImageBrowser extends C_Base_Module 'A_NextGen_Basic_ImageBrowser_Form', $this->module_id ); - // Provides the setting forms + } + + if (apply_filters('ngg_load_frontend_logic', TRUE, $this->module_id)) + { + // Add rendering logic $this->get_registry()->add_adapter( - 'I_Form_Manager', - 'A_NextGen_Basic_ImageBrowser_Forms' + 'I_Display_Type_Controller', + 'A_NextGen_Basic_ImageBrowser_Controller', + $this->module_id ); } } function _register_hooks() { - if (!defined('NGG_DISABLE_LEGACY_SHORTCODES') || !NGG_DISABLE_LEGACY_SHORTCODES) - { + if (apply_filters('ngg_load_frontend_logic', TRUE, $this->module_id) + && (!defined('NGG_DISABLE_LEGACY_SHORTCODES') || !NGG_DISABLE_LEGACY_SHORTCODES)) + { C_NextGen_Shortcode_Manager::add('imagebrowser', array(&$this, 'render_shortcode')); + C_NextGen_Shortcode_Manager::add('nggimagebrowser', array(&$this, 'render_shortcode')); } - C_NextGen_Shortcode_Manager::add('nggimagebrowser', array(&$this, 'render_shortcode')); + + add_action('ngg_routes', array(&$this, 'define_routes')); } + function define_routes($router) + { + $slug = '/'.C_NextGen_Settings::get_instance()->router_param_slug; + $router->rewrite("{*}{$slug}{*}/image/{\\w}", "{1}{$slug}{2}/pid--{3}"); + } + /** * Gets a value from the parameter array, and if not available, uses the default value * @@ -105,7 +118,7 @@ class M_NextGen_Basic_ImageBrowser extends C_Base_Module unset($params['id']); - $renderer = $this->get_registry()->get_utility('I_Displayed_Gallery_Renderer'); + $renderer = C_Displayed_Gallery_Renderer::get_instance(); return $renderer->display_images($params, $inner_content); } @@ -115,14 +128,61 @@ class M_NextGen_Basic_ImageBrowser extends C_Base_Module 'A_Nextgen_Basic_Imagebrowser' => 'adapter.nextgen_basic_imagebrowser.php', 'A_Nextgen_Basic_Imagebrowser_Controller' => 'adapter.nextgen_basic_imagebrowser_controller.php', 'A_Nextgen_Basic_Imagebrowser_Form' => 'adapter.nextgen_basic_imagebrowser_form.php', - 'A_Nextgen_Basic_Imagebrowser_Forms' => 'adapter.nextgen_basic_imagebrowser_forms.php', 'C_Nextgen_Basic_Imagebrowser_Installer' => 'class.nextgen_basic_imagebrowser_installer.php', 'A_Nextgen_Basic_Imagebrowser_Mapper' => 'adapter.nextgen_basic_imagebrowser_mapper.php', - 'A_Nextgen_Basic_Imagebrowser_Routes' => 'adapter.nextgen_basic_imagebrowser_routes.php', 'A_Nextgen_Basic_Imagebrowser_Urls' => 'adapter.nextgen_basic_imagebrowser_urls.php', - 'Hook_NextGen_Basic_Imagebrowser_Alt_URLs' => 'hook.nextgen_basic_imagebrowser_alt_urls.php' ); } } +/** + * Show an image browser. Ngglegacy function + * @param $galleryID + * @param string $template + */ +function nggShowImageBrowser($galleryID, $template = '') +{ + $renderer = C_Displayed_Gallery_Renderer::get_instance(); + $retval = $renderer->display_images(array( + 'gallery_ids' => array($galleryID), + 'display_type' => 'photocrati-nextgen_basic_imagebrowser', + 'template' => $template + )); + + return apply_filters('ngg_show_imagebrowser_content', $retval, $galleryID); +} + +/** + * Create an image browser from a list of image objects. Ngglegacy function + * @param $picturelist + * @param string $template + */ +function nggCreateImageBrowser($picturelist, $template = '') +{ + $renderer = C_Displayed_Gallery_Renderer::get_instance(); + $image_ids = array(); + foreach ($picturelist as $image) $image_ids[] = $image->pid; + return $renderer->display_images(array( + 'image_ids' => $image_ids, + 'display_type' => 'photocrati-nextgen_basic_imagebrowser', + 'template' => $template + )); +} + +class C_NextGen_Basic_ImageBrowser_Installer extends C_Gallery_Display_Installer +{ + function install() + { + $this->install_display_type( + NGG_BASIC_IMAGEBROWSER, array( + 'title' => __('NextGEN Basic ImageBrowser', 'nggallery'), + 'entity_types' => array('image'), + 'preview_image_relpath' => 'photocrati-nextgen_basic_imagebrowser#preview.jpg', + 'default_source' => 'galleries', + 'view_order' => NGG_DISPLAY_PRIORITY_BASE + 20 + ) + ); + } +} + new M_NextGen_Basic_ImageBrowser(); \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/package.module.nextgen_basic_imagebrowser.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/package.module.nextgen_basic_imagebrowser.php new file mode 100644 index 0000000000000000000000000000000000000000..719d7779452fee3f92d5b479092655e32983a2e7 --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/package.module.nextgen_basic_imagebrowser.php @@ -0,0 +1,191 @@ +<?php +/** + * Adds validation for the NextGen Basic ImageBrowser display type + */ +class A_NextGen_Basic_ImageBrowser extends Mixin +{ + public function validation() + { + return $this->call_parent('validation'); + } +} +/** + * Provides rendering logic for the NextGen Basic ImageBrowser + */ +class A_NextGen_Basic_ImageBrowser_Controller extends Mixin +{ + /** + * Renders the front-end display for the imagebrowser display type + * + * @param C_Displayed_Gallery $displayed_gallery + * @param bool $return + * @return string + */ + public function index_action($displayed_gallery, $return = FALSE) + { + $picture_list = array(); + foreach ($displayed_gallery->get_included_entities() as $image) { + $picture_list[$image->{$image->id_field}] = $image; + } + if ($picture_list) { + $retval = $this->render_image_browser($displayed_gallery, $picture_list); + if ($return) { + return $retval; + } else { + echo $retval; + } + } else { + return $this->object->render_partial('photocrati-nextgen_gallery_display#no_images_found', array(), $return); + } + } + /** + * Returns the rendered template of an image browser display + * + * @param C_Displayed_Gallery + * @param array $picture_list + * @return string Rendered HTML (probably) + */ + public function render_image_browser($displayed_gallery, $picture_list) + { + $display_settings = $displayed_gallery->display_settings; + $storage = C_Gallery_Storage::get_instance(); + $imap = C_Image_Mapper::get_instance(); + $application = C_Router::get_instance()->get_routed_app(); + // the pid may be a slug so we must track it & the slug target's database id + $pid = $this->object->param('pid'); + $numeric_pid = NULL; + // makes the upcoming which-image-am-I loop easier + $picture_array = array(); + foreach ($picture_list as $picture) { + $picture_array[] = $picture->{$imap->get_primary_key_column()}; + } + // Determine which image in the list we need to display + if (!empty($pid)) { + if (is_numeric($pid) && !empty($picture_list[$pid])) { + $numeric_pid = intval($pid); + } else { + // in the case it's a slug we need to search for the pid + foreach ($picture_list as $key => $picture) { + if ($picture->image_slug == $pid) { + $numeric_pid = $key; + break; + } + } + } + } else { + reset($picture_array); + $numeric_pid = current($picture_array); + } + // get ids to the next and previous images + $total = count($picture_array); + $key = array_search($numeric_pid, $picture_array); + if (!$key) { + $numeric_pid = reset($picture_array); + $key = key($picture_array); + } + // for "viewing image #13 of $total" + $picture_list_pos = $key + 1; + // our image to display + $picture = new C_Image_Wrapper($imap->find($numeric_pid), $displayed_gallery, TRUE); + $picture = apply_filters('ngg_image_object', $picture, $numeric_pid); + // determine URI to the next & previous images + $back_pid = $key >= 1 ? $picture_array[$key - 1] : end($picture_array); + // 'show' is set when using the imagebrowser as an alternate view to a thumbnail or slideshow + // for which the basic-gallery module will rewrite the show parameter into existence as long as 'image' + // is set. We remove 'show' here so navigation appears fluid. + $current_url = $application->get_routed_url(TRUE); + if ($this->object->param('ajax_pagination_referrer')) { + $current_url = $this->object->param('ajax_pagination_referrer'); + } + $prev_image_link = $this->object->set_param_for($current_url, 'pid', $picture_list[$back_pid]->image_slug); + $prev_image_link = $this->object->remove_param_for($prev_image_link, 'show', $displayed_gallery->id()); + $next_pid = $key < $total - 1 ? $picture_array[$key + 1] : reset($picture_array); + $next_image_link = $this->object->set_param_for($current_url, 'pid', $picture_list[$next_pid]->image_slug); + $next_image_link = $this->object->remove_param_for($next_image_link, 'show', $displayed_gallery->id()); + // css class + $anchor = 'ngg-imagebrowser-' . $displayed_gallery->id() . '-' . (get_the_ID() == false ? 0 : get_the_ID()); + // try to read EXIF data, but fallback to the db presets + $meta = new C_NextGen_Metadata($picture); + $meta->sanitize(); + $meta_results = array('exif' => $meta->get_EXIF(), 'iptc' => $meta->get_IPTC(), 'xmp' => $meta->get_XMP(), 'db' => $meta->get_saved_meta()); + $meta_results['exif'] = $meta_results['exif'] == false ? $meta_results['db'] : $meta_results['exif']; + // disable triggers IF we're rendering inside of an ajax-pagination request; var set in common.js + if (!empty($_POST['ajax_referrer'])) { + $displayed_gallery->display_settings['ngg_triggers_display'] = 'never'; + } + if (!empty($display_settings['template'])) { + $this->object->add_mixin('Mixin_NextGen_Basic_Templates'); + $picture->href_link = $picture->get_href_link(); + $picture->previous_image_link = $prev_image_link; + $picture->previous_pid = $back_pid; + $picture->next_image_link = $next_image_link; + $picture->next_pid = $next_pid; + $picture->number = $picture_list_pos; + $picture->total = $total; + $picture->anchor = $anchor; + return $this->object->legacy_render($display_settings['template'], array('image' => $picture, 'meta' => $meta, 'exif' => $meta_results['exif'], 'iptc' => $meta_results['iptc'], 'xmp' => $meta_results['xmp'], 'db' => $meta_results['db'], 'displayed_gallery' => $displayed_gallery), TRUE, 'imagebrowser'); + } else { + $params = $display_settings; + $params['anchor'] = $anchor; + $params['image'] = $picture; + $params['storage'] =& $storage; + $params['previous_pid'] = $back_pid; + $params['next_pid'] = $next_pid; + $params['number'] = $picture_list_pos; + $params['total'] = $total; + $params['previous_image_link'] = $prev_image_link; + $params['next_image_link'] = $next_image_link; + $params['effect_code'] = $this->object->get_effect_code($displayed_gallery); + $params = $this->object->prepare_display_parameters($displayed_gallery, $params); + return $this->object->render_partial('photocrati-nextgen_basic_imagebrowser#nextgen_basic_imagebrowser', $params, TRUE); + } + } + /** + * Enqueues all static resources required by this display type + * + * @param C_Displayed_Gallery $displayed_gallery + */ + public function enqueue_frontend_resources($displayed_gallery) + { + $this->call_parent('enqueue_frontend_resources', $displayed_gallery); + wp_enqueue_style('nextgen_basic_imagebrowser_style', $this->get_static_url('photocrati-nextgen_basic_imagebrowser#style.css')); + $this->enqueue_ngg_styles(); + } +} +class A_NextGen_Basic_ImageBrowser_Form extends Mixin_Display_Type_Form +{ + public function get_display_type_name() + { + return NGG_BASIC_IMAGEBROWSER; + } + /** + * Returns a list of fields to render on the settings page + */ + public function _get_field_names() + { + return array('ajax_pagination', 'nextgen_basic_templates_template'); + } +} +class A_NextGen_Basic_ImageBrowser_Mapper extends Mixin +{ + public function set_defaults($entity) + { + $this->call_parent('set_defaults', $entity); + if (isset($entity->name) && $entity->name == NGG_BASIC_IMAGEBROWSER) { + $this->object->_set_default_value($entity, 'settings', 'template', ''); + // Part of the pro-modules + $this->object->_set_default_value($entity, 'settings', 'ngg_triggers_display', 'never'); + } + } +} +class A_NextGen_Basic_ImageBrowser_Urls extends Mixin +{ + public function create_parameter_segment($key, $value, $id = NULL, $use_prefix = FALSE) + { + if ($key == 'pid') { + return "image/{$value}"; + } else { + return $this->call_parent('create_parameter_segment', $key, $value, $id, $use_prefix); + } + } +} \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/static/style.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/static/style.css index a5ce7885317a78a9647c431b604a32412a91771a..89d61cfa4f85b617bf8be981d205fdb47a21a199 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/static/style.css +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/static/style.css @@ -26,7 +26,7 @@ .ngg-imagebrowser img { max-width: 100%; - margin: 0; + margin: 0 auto; padding: 0; border: none; } diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/static/style.min.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/static/style.min.css new file mode 100644 index 0000000000000000000000000000000000000000..5fc11c692a6705734f3507da902d5b1ebbab867d --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/static/style.min.css @@ -0,0 +1 @@ +.ngg-imagebrowser h3{text-align:center}.ngg-imagebrowser-desc{clear:both}.ngg-imagebrowser .pic{max-width:100%;margin-top:10px;margin-bottom:10px;border:1px solid #a9a9a9}.ngg-imagebrowser .pic a{display:block !important;font-size:0;margin:5px;text-align:center}.ngg-imagebrowser img{max-width:100%;margin:0 auto;padding:0;border:0}.ngg-imagebrowser-nav{padding:5px}.ngg-imagebrowser-nav .back{float:left;border:1px solid #ddd;padding:3px 7px}.ngg-imagebrowser-nav .next{float:right;border:1px solid #ddd;padding:3px 7px}.ngg-imagebrowser-nav .counter{text-align:center;font-size:.9em !important}.exif-data{margin-left:auto !important;margin-right:auto !important} \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/templates/nextgen_basic_imagebrowser.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/templates/nextgen_basic_imagebrowser.php index 37cff40bd4fb841e394cdb66784e62a3f003b3f2..cadfacf539a76b7fedd643a2c580aa0a67bedd24 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/templates/nextgen_basic_imagebrowser.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/templates/nextgen_basic_imagebrowser.php @@ -66,11 +66,7 @@ </div> <?php $this->end_element(); ?> <script type='text/javascript'> - jQuery(function($){ - new NggPaginatedGallery( - '<?php echo $displayed_gallery->id() ?>', - $('.ngg-imagebrowser'), - $('#<?php echo $anchor ?> .ngg-browser-prev, #<?php echo $anchor ?> .ngg-browser-next') - ) + jQuery(function($) { + new NggPaginatedGallery('<?php echo $displayed_gallery->id() ?>', '.ngg-imagebrowser'); }); </script> \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_singlepic/module.nextgen_basic_singlepic.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_singlepic/module.nextgen_basic_singlepic.php index e7e8f7801511b6696dcc40b0c9a9430363eb9a5b..398b908e24faa1d0cf10e3ea5f35778082e65cc1 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_singlepic/module.nextgen_basic_singlepic.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_singlepic/module.nextgen_basic_singlepic.php @@ -17,26 +17,29 @@ class M_NextGen_Basic_Singlepic extends C_Base_Module NGG_BASIC_SINGLEPIC, 'NextGen Basic Singlepic', 'Provides a singlepic gallery for NextGEN Gallery', - '0.9', + '0.11', 'http://www.photocrati.com', 'Photocrati Media', 'http://www.photocrati.com' ); - include_once('class.nextgen_basic_singlepic_installer.php'); C_Photocrati_Installer::add_handler($this->module_id, 'C_NextGen_Basic_SinglePic_Installer'); } + function initialize() + { + parent::initialize(); + if (is_admin()) { + $forms = C_Form_Manager::get_instance(); + $forms->add_form( + NGG_DISPLAY_SETTINGS_SLUG, NGG_BASIC_SINGLEPIC + ); + } + } + function _register_adapters() { - // Provides settings fields and frontend rendering - $this->get_registry()->add_adapter( - 'I_Display_Type_Controller', - 'A_NextGen_Basic_Singlepic_Controller', - $this->module_id - ); - // Provides default values for the display type $this->get_registry()->add_adapter( 'I_Display_Type_Mapper', @@ -51,24 +54,30 @@ class M_NextGen_Basic_Singlepic extends C_Base_Module 'A_NextGen_Basic_SinglePic_Form', $this->module_id ); - // Adds the setting forms + } + + if (apply_filters('ngg_load_frontend_logic', TRUE, $this->module_id)) + { + // Provides settings fields and frontend rendering $this->get_registry()->add_adapter( - 'I_Form_Manager', - 'A_NextGen_Basic_SinglePic_Forms' + 'I_Display_Type_Controller', + 'A_NextGen_Basic_Singlepic_Controller', + $this->module_id ); } } function _register_hooks() { - if (!defined('NGG_DISABLE_LEGACY_SHORTCODES') || !NGG_DISABLE_LEGACY_SHORTCODES) + if (apply_filters('ngg_load_frontend_logic', TRUE, $this->module_id) + && (!defined('NGG_DISABLE_LEGACY_SHORTCODES') || !NGG_DISABLE_LEGACY_SHORTCODES)) { C_NextGen_Shortcode_Manager::add('singlepic', array(&$this, 'render_singlepic')); - } - C_NextGen_Shortcode_Manager::add('nggsinglepic', array(&$this, 'render_singlepic')); + C_NextGen_Shortcode_Manager::add('nggsinglepic', array(&$this, 'render_singlepic')); - // enqueue the singlepic CSS if an inline image has the ngg-singlepic class - add_filter('the_content', array(&$this, 'enqueue_singlepic_css'), PHP_INT_MAX, 1); + // enqueue the singlepic CSS if an inline image has the ngg-singlepic class + add_filter('the_content', array(&$this, 'enqueue_singlepic_css'), PHP_INT_MAX, 1); + } } /** @@ -80,7 +89,7 @@ class M_NextGen_Basic_Singlepic extends C_Base_Module function enqueue_singlepic_css($content) { if (preg_match("#<img.*ngg-singlepic.*>#", $content, $matches)) { - $router = $this->get_registry()->get_utility('I_Router'); + $router = C_Router::get_instance(); wp_enqueue_style( 'nextgen_basic_singlepic_style', $router->get_static_url(NGG_BASIC_SINGLEPIC . '#nextgen_basic_singlepic.css') @@ -109,7 +118,7 @@ class M_NextGen_Basic_Singlepic extends C_Base_Module $params['image_ids'] = $this->_get_param('id', NULL, $params); unset($params['id']); - $renderer = $this->get_registry()->get_utility('I_Displayed_Gallery_Renderer'); + $renderer = C_Displayed_Gallery_Renderer::get_instance(); return $renderer->display_images($params, $inner_content); } @@ -119,11 +128,26 @@ class M_NextGen_Basic_Singlepic extends C_Base_Module 'A_Nextgen_Basic_Singlepic' => 'adapter.nextgen_basic_singlepic.php', 'A_Nextgen_Basic_Singlepic_Controller' => 'adapter.nextgen_basic_singlepic_controller.php', 'A_Nextgen_Basic_Singlepic_Form' => 'adapter.nextgen_basic_singlepic_form.php', - 'A_Nextgen_Basic_Singlepic_Forms' => 'adapter.nextgen_basic_singlepic_forms.php', 'C_NextGen_Basic_SinglePic_Installer' => 'class.nextgen_basic_singlepic_installer.php', 'A_Nextgen_Basic_Singlepic_Mapper' => 'adapter.nextgen_basic_singlepic_mapper.php' ); } } +class C_NextGen_Basic_SinglePic_Installer extends C_Gallery_Display_Installer +{ + function install() + { + $this->install_display_type( + NGG_BASIC_SINGLEPIC, array( + 'title' => __('NextGEN Basic SinglePic', 'nggallery'), + 'entity_types' => array('image'), + 'preview_image_relpath' => 'photocrati-nextgen_basic_singlepic#preview.gif', + 'default_source' => 'galleries', + 'view_order' => NGG_DISPLAY_PRIORITY_BASE + 60, + 'hidden_from_ui' => TRUE + )); + } +} + new M_NextGen_Basic_Singlepic(); diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_singlepic/package.module.nextgen_basic_singlepic.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_singlepic/package.module.nextgen_basic_singlepic.php new file mode 100644 index 0000000000000000000000000000000000000000..ba1b57da93f4d767ecf74102f73354da1b515273 --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_singlepic/package.module.nextgen_basic_singlepic.php @@ -0,0 +1,220 @@ +<?php +class A_NextGen_Basic_Singlepic extends Mixin +{ + public function validation() + { + if ($this->object->name == NGG_BASIC_SINGLEPIC) { + } + return $this->call_parent('validation'); + } +} +class A_NextGen_Basic_Singlepic_Controller extends Mixin +{ + /** + * Displays the 'singlepic' display type + * + * @param stdClass|C_Displayed_Gallery|C_DataMapper_Model $displayed_gallery + */ + public function index_action($displayed_gallery, $return = FALSE) + { + $storage = C_Gallery_Storage::get_instance(); + $dynthumbs = C_Dynamic_Thumbnails_Manager::get_instance(); + $display_settings = $displayed_gallery->display_settings; + // use this over get_included_entities() so we can display images marked 'excluded' + $displayed_gallery->skip_excluding_globally_excluded_images = TRUE; + $image = array_shift($displayed_gallery->get_entities(1, FALSE, FALSE, 'included')); + if (!$image) { + return $this->object->render_partial('photocrati-nextgen_gallery_display#no_images_found', array(), $return); + } + switch ($display_settings['float']) { + case 'left': + $display_settings['float'] = 'ngg-left'; + break; + case 'right': + $display_settings['float'] = 'ngg-right'; + break; + case 'center': + $display_settings['float'] = 'ngg-center'; + break; + default: + $display_settings['float'] = ''; + break; + } + $params = array(); + if (!empty($display_settings['link'])) { + $target = $display_settings['link_target']; + $effect_code = ''; + } else { + $display_settings['link'] = $storage->get_image_url($image, 'full', TRUE); + $target = '_self'; + $effect_code = $this->object->get_effect_code($displayed_gallery); + } + $params['target'] = $target; + // mode is a legacy parameter + if (!is_array($display_settings['mode'])) { + $display_settings['mode'] = explode(',', $display_settings['mode']); + } + if (in_array('web20', $display_settings['mode'])) { + $display_settings['display_reflection'] = TRUE; + } + if (in_array('watermark', $display_settings['mode'])) { + $display_settings['display_watermark'] = TRUE; + } + if (isset($display_settings['w'])) { + $display_settings['width'] = $display_settings['w']; + } elseif (isset($display_settings['h'])) { + unset($display_settings['width']); + } + if (isset($display_settings['h'])) { + $display_settings['height'] = $display_settings['h']; + } elseif (isset($display_settings['w'])) { + unset($display_settings['height']); + } + // legacy assumed no width/height meant full size unlike generate_thumbnail: force a full resolution + if (!isset($display_settings['width']) && !isset($display_settings['height'])) { + $display_settings['width'] = $image->meta_data['width']; + } + if (isset($display_settings['width'])) { + $params['width'] = $display_settings['width']; + } + if (isset($display_settings['height'])) { + $params['height'] = $display_settings['height']; + } + $params['quality'] = $display_settings['quality']; + $params['crop'] = $display_settings['crop']; + $params['watermark'] = $display_settings['display_watermark']; + $params['reflection'] = $display_settings['display_reflection']; + // Fall back to full in case dynamic images aren't available + $size = 'full'; + if ($dynthumbs != null) { + $size = $dynthumbs->get_size_name($params); + } + $thumbnail_url = $storage->get_image_url($image, $size); + if (!empty($display_settings['template'])) { + $this->object->add_mixin('A_NextGen_Basic_Template_Form'); + $this->object->add_mixin('Mixin_NextGen_Basic_Templates'); + $params = $this->object->prepare_legacy_parameters(array($image), $displayed_gallery, array('single_image' => TRUE)); + // the wrapper is a lazy-loader that calculates variables when requested. We here override those to always + // return the same precalculated settings provided + $params['image']->container[0]->_cache_overrides['caption'] = $displayed_gallery->inner_content; + $params['image']->container[0]->_cache_overrides['classname'] = 'ngg-singlepic ' . $display_settings['float']; + $params['image']->container[0]->_cache_overrides['imageURL'] = $display_settings['link']; + $params['image']->container[0]->_cache_overrides['thumbnailURL'] = $thumbnail_url; + $params['target'] = $target; + // if a link is present we temporarily must filter out the effect code + if (empty($effect_code)) { + add_filter('ngg_get_thumbcode', array(&$this, 'strip_thumbcode'), 10); + } + $retval = $this->object->legacy_render($display_settings['template'], $params, $return, 'singlepic'); + if (empty($effect_code)) { + remove_filter('ngg_get_thumbcode', array(&$this, 'strip_thumbcode'), 10); + } + return $retval; + } else { + $params = $display_settings; + $params['storage'] =& $storage; + $params['image'] =& $image; + $params['effect_code'] = $effect_code; + $params['inner_content'] = $displayed_gallery->inner_content; + $params['settings'] = $display_settings; + $params['thumbnail_url'] = $thumbnail_url; + $params['target'] = $target; + $params = $this->object->prepare_display_parameters($displayed_gallery, $params); + return $this->object->render_partial('photocrati-nextgen_basic_singlepic#nextgen_basic_singlepic', $params, $return); + } + } + /** + * Intentionally disable the application of the effect code + */ + public function strip_thumbcode($thumbcode) + { + return ''; + } + /** + * Enqueues all static resources required by this display type + * + * @param C_Displayed_Gallery $displayed_gallery + */ + public function enqueue_frontend_resources($displayed_gallery) + { + $this->call_parent('enqueue_frontend_resources', $displayed_gallery); + wp_enqueue_style('nextgen_basic_singlepic_style', $this->get_static_url('photocrati-nextgen_basic_singlepic#nextgen_basic_singlepic.css')); + $this->enqueue_ngg_styles(); + } +} +class A_NextGen_Basic_SinglePic_Form extends Mixin_Display_Type_Form +{ + /** + * Returns the name of the display type + * @return string + */ + public function get_display_type_name() + { + return NGG_BASIC_SINGLEPIC; + } + /** + * Returns the name of the fields to render for the SinglePic + */ + public function _get_field_names() + { + return array('nextgen_basic_singlepic_dimensions', 'nextgen_basic_singlepic_link', 'nextgen_basic_singlepic_link_target', 'nextgen_basic_singlepic_float', 'nextgen_basic_singlepic_quality', 'nextgen_basic_singlepic_crop', 'nextgen_basic_singlepic_display_watermark', 'nextgen_basic_singlepic_display_reflection', 'nextgen_basic_templates_template'); + } + public function _render_nextgen_basic_singlepic_dimensions_field($display_type) + { + return $this->object->render_partial('photocrati-nextgen_basic_singlepic#nextgen_basic_singlepic_settings_dimensions', array('display_type_name' => $display_type->name, 'dimensions_label' => __('Thumbnail dimensions', 'nggallery'), 'width_label' => __('Width'), 'width' => $display_type->settings['width'], 'height_label' => __('Height'), 'height' => $display_type->settings['height']), True); + } + public function _render_nextgen_basic_singlepic_link_field($display_type) + { + return $this->object->render_partial('photocrati-nextgen_basic_singlepic#nextgen_basic_singlepic_settings_link', array('display_type_name' => $display_type->name, 'link_label' => __('Link'), 'link' => $display_type->settings['link']), True); + } + public function _render_nextgen_basic_singlepic_link_target_field($display_type) + { + return $this->_render_select_field($display_type, 'link_target', __('Link target', 'nggallery'), array('_self' => __('Self', 'nggallery'), '_blank' => __('Blank', 'nggallery'), '_parent' => __('Parent', 'nggallery'), '_top' => __('Top', 'nggallery')), $display_type->settings['link_target']); + } + public function _render_nextgen_basic_singlepic_quality_field($display_type) + { + return $this->object->render_partial('photocrati-nextgen_basic_singlepic#nextgen_basic_singlepic_settings_quality', array('display_type_name' => $display_type->name, 'quality_label' => __('Image quality', 'nggallery'), 'quality' => $display_type->settings['quality']), True); + } + public function _render_nextgen_basic_singlepic_display_watermark_field($display_type) + { + return $this->_render_radio_field($display_type, 'display_watermark', __('Display watermark', 'nggallery'), $display_type->settings['display_watermark']); + } + public function _render_nextgen_basic_singlepic_display_reflection_field($display_type) + { + return $this->_render_radio_field($display_type, 'display_reflection', __('Display reflection', 'nggallery'), $display_type->settings['display_reflection']); + } + public function _render_nextgen_basic_singlepic_crop_field($display_type) + { + return $this->_render_radio_field($display_type, 'crop', __('Crop thumbnail', 'nggallery'), $display_type->settings['crop']); + } + public function _render_nextgen_basic_singlepic_float_field($display_type) + { + return $this->_render_select_field($display_type, 'float', __('Float', 'nggallery'), array('' => __('None', 'nggallery'), 'left' => __('Left', 'nggallery'), 'right' => __('Right', 'nggallery')), $display_type->settings['float']); + } +} +class A_NextGen_Basic_SinglePic_Mapper extends Mixin +{ + /** + * Sets default values for SinglePic settings + * @param stdClass|C_DataMapper_Model $entity + */ + public function set_defaults($entity) + { + $this->call_parent('set_defaults', $entity); + if (isset($entity->name) && $entity->name == NGG_BASIC_SINGLEPIC) { + $this->object->_set_default_value($entity, 'settings', 'width', ''); + $this->object->_set_default_value($entity, 'settings', 'height', ''); + $this->object->_set_default_value($entity, 'settings', 'mode', ''); + $this->object->_set_default_value($entity, 'settings', 'display_watermark', 0); + $this->object->_set_default_value($entity, 'settings', 'display_reflection', 0); + $this->object->_set_default_value($entity, 'settings', 'float', ''); + $this->object->_set_default_value($entity, 'settings', 'link', ''); + $this->object->_set_default_value($entity, 'settings', 'link_target', '_blank'); + $this->object->_set_default_value($entity, 'settings', 'quality', 100); + $this->object->_set_default_value($entity, 'settings', 'crop', 0); + $this->object->_set_default_value($entity, 'settings', 'template', ''); + // Part of the pro-modules + $this->object->_set_default_value($entity, 'settings', 'ngg_triggers_display', 'never'); + } + } +} \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_singlepic/static/nextgen_basic_singlepic.min.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_singlepic/static/nextgen_basic_singlepic.min.css new file mode 100644 index 0000000000000000000000000000000000000000..37404e947f34cb4790955c20c3aade3c96a9dd99 --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_singlepic/static/nextgen_basic_singlepic.min.css @@ -0,0 +1 @@ +.ngg-gallery-singlepic-image{margin:0 auto 1em auto}.ngg-gallery-singlepic-image a{max-width:100%}.ngg-gallery-singlepic-image img{margin:0;max-width:100%;border:0}.ngg-singlepic{background-color:#fff;display:block;padding:4px}.ngg-left{float:left;margin-right:10px}.ngg-right{float:right;margin-left:10px}.ngg-center{margin-left:auto !important;margin-right:auto !important}.ngg-gallery-singlepic-image .ngg-trigger-buttons{margin:5px 0 0 0} \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_singlepic/templates/nextgen_basic_singlepic_settings_dimensions.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_singlepic/templates/nextgen_basic_singlepic_settings_dimensions.php index 46054ec742ecb34dd83ee0ce16a3474bd0fe4186..9d9f3c98de32909c1f3f430fb2f05fa220004820 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_singlepic/templates/nextgen_basic_singlepic_settings_dimensions.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_singlepic/templates/nextgen_basic_singlepic_settings_dimensions.php @@ -1,7 +1,7 @@ <tr> <td> <label for='<?php echo esc_attr($display_type_name); ?>_image_dimensions'> - <?php echo_h($dimensions_label); ?> + <?php esc_html_e($dimensions_label); ?> </label> </td> <td> diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_singlepic/templates/nextgen_basic_singlepic_settings_link.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_singlepic/templates/nextgen_basic_singlepic_settings_link.php index 92ec7948efb364113dac7b910ddc84f757730e78..cedbbed7df6cdc3e863bcfd536c1a5a09d5e343c 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_singlepic/templates/nextgen_basic_singlepic_settings_link.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_singlepic/templates/nextgen_basic_singlepic_settings_link.php @@ -1,7 +1,7 @@ <tr> <td> <label for='<?php echo esc_attr($display_type_name); ?>_link'> - <?php echo_h($link_label); ?> + <?php esc_html_e($link_label); ?> </label> </td> <td> diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_singlepic/templates/nextgen_basic_singlepic_settings_quality.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_singlepic/templates/nextgen_basic_singlepic_settings_quality.php index afa0a064a773f153cd1c0c240fbe485f58933859..f2f6ad4fbcd8a601723cd7e7522896a9dc5f4118 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_singlepic/templates/nextgen_basic_singlepic_settings_quality.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_singlepic/templates/nextgen_basic_singlepic_settings_quality.php @@ -1,7 +1,7 @@ <tr> <td> <label for='<?php echo esc_attr($display_type_name); ?>_quality'> - <?php echo_h($quality_label); ?> + <?php esc_html_e($quality_label); ?> </label> </td> <td> diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_tagcloud/module.nextgen_basic_tagcloud.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_tagcloud/module.nextgen_basic_tagcloud.php index 9b7aa58eb5c6821732c50e532381276eccdb65d6..beabeaba8995c318fb6b2ce64cdf2051125facec 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_tagcloud/module.nextgen_basic_tagcloud.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_tagcloud/module.nextgen_basic_tagcloud.php @@ -17,30 +17,35 @@ class M_NextGen_Basic_Tagcloud extends C_Base_Module NGG_BASIC_TAGCLOUD, 'NextGen Basic Tagcloud', 'Provides a tagcloud for NextGEN Gallery', - '0.9', + '0.11', 'http://www.photocrati.com', 'Photocrati Media', 'http://www.photocrati.com' ); - include_once('class.nextgen_basic_tagcloud_installer.php'); C_Photocrati_Installer::add_handler($this->module_id, 'C_NextGen_Basic_Tagcloud_Installer'); } + function initialize() + { + parent::initialize(); + if (is_admin()) { + $forms = C_Form_Manager::get_instance(); + $forms->add_form( + NGG_DISPLAY_SETTINGS_SLUG, NGG_BASIC_TAGCLOUD + ); + } + + } + function _register_utilities() { - $this->get_registry()->add_utility('I_Taxonomy_Controller', 'C_Taxonomy_Controller'); + if (apply_filters('ngg_load_frontend_logic', TRUE, $this->module_id)) + $this->get_registry()->add_utility('I_Taxonomy_Controller', 'C_Taxonomy_Controller'); } function _register_adapters() { - // Provides settings fields and frontend rendering - $this->get_registry()->add_adapter( - 'I_Display_Type_Controller', - 'A_NextGen_Basic_Tagcloud_Controller', - $this->module_id - ); - // Provides validation for the display type $this->get_registry()->add_adapter( 'I_Display_Type', @@ -53,18 +58,6 @@ class M_NextGen_Basic_Tagcloud extends C_Base_Module 'A_NextGen_Basic_TagCloud_Mapper' ); - // Add routing for ngglegacy routes - $this->get_registry()->add_adapter( - 'I_Routing_App', - 'A_NextGen_Basic_TagCloud_Routes' - ); - - // Add legacy urls - $this->get_registry()->add_adapter( - 'I_Routing_App', - 'A_NextGen_Basic_TagCloud_Urls' - ); - if (M_Attach_To_Post::is_atp_url() || is_admin()) { // Adds a display settings form @@ -73,32 +66,52 @@ class M_NextGen_Basic_Tagcloud extends C_Base_Module 'A_NextGen_Basic_TagCloud_Form', $this->module_id ); - // Provides the forms for the settings + } + + if (apply_filters('ngg_load_frontend_logic', TRUE, $this->module_id)) + { + // Provides settings fields and frontend rendering + $this->get_registry()->add_adapter( + 'I_Display_Type_Controller', + 'A_NextGen_Basic_Tagcloud_Controller', + $this->module_id + ); + + // Add legacy urls $this->get_registry()->add_adapter( - 'I_Form_Manager', - 'A_NextGen_Basic_TagCloud_Forms' + 'I_Routing_App', + 'A_NextGen_Basic_TagCloud_Urls' ); } } function _register_hooks() { - if (!defined('NGG_DISABLE_LEGACY_SHORTCODES') || !NGG_DISABLE_LEGACY_SHORTCODES) + if (apply_filters('ngg_load_frontend_logic', TRUE, $this->module_id) + && (!defined('NGG_DISABLE_LEGACY_SHORTCODES') || !NGG_DISABLE_LEGACY_SHORTCODES)) { C_NextGen_Shortcode_Manager::add('tagcloud', array(&$this, 'render_shortcode')); + C_NextGen_Shortcode_Manager::add('nggtagcloud', array(&$this, 'render_shortcode')); + + add_filter( + 'the_posts', + array( + C_Taxonomy_Controller::get_instance(), + 'detect_ngg_tag'), + -10, + 2 + ); } - C_NextGen_Shortcode_Manager::add('nggtagcloud', array(&$this, 'render_shortcode')); - - add_filter( - 'the_posts', - array( - $this->get_registry()->get_utility('I_Taxonomy_Controller'), - 'detect_ngg_tag'), - -10, - 2 - ); + + add_action('ngg_routes', array(&$this, 'define_routes')); } + function define_routes($router) + { + $slug = '/'.C_NextGen_Settings::get_instance()->router_param_slug; + $router->rewrite("{*}{$slug}{*}/tags/{\\w}{*}", "{1}{$slug}{2}/gallerytag--{3}{4}"); + } + /** * Gets a value from the parameter array, and if not available, uses the default value * @@ -124,7 +137,7 @@ class M_NextGen_Basic_Tagcloud extends C_Base_Module $params['source'] = $this->_get_param('source', 'tags', $params); $params['display_type'] = $this->_get_param('display_type', NGG_BASIC_TAGCLOUD, $params); - $renderer = $this->get_registry()->get_utility('I_Displayed_Gallery_Renderer'); + $renderer = C_Displayed_Gallery_Renderer::get_instance(); return $renderer->display_images($params, $inner_content); } @@ -134,15 +147,32 @@ class M_NextGen_Basic_Tagcloud extends C_Base_Module 'A_Nextgen_Basic_Tagcloud' => 'adapter.nextgen_basic_tagcloud.php', 'A_Nextgen_Basic_Tagcloud_Controller' => 'adapter.nextgen_basic_tagcloud_controller.php', 'A_Nextgen_Basic_Tagcloud_Form' => 'adapter.nextgen_basic_tagcloud_form.php', - 'A_Nextgen_Basic_Tagcloud_Forms' => 'adapter.nextgen_basic_tagcloud_forms.php', 'C_NextGen_Basic_Tagcloud_Installer' => 'class.nextgen_basic_tagcloud_installer.php', 'A_Nextgen_Basic_Tagcloud_Mapper' => 'adapter.nextgen_basic_tagcloud_mapper.php', - 'A_Nextgen_Basic_Tagcloud_Routes' => 'adapter.nextgen_basic_tagcloud_routes.php', 'A_Nextgen_Basic_Tagcloud_Urls' => 'adapter.nextgen_basic_tagcloud_urls.php', - 'I_Taxonomy_Controller' => 'interface.taxonomy_controller.php', 'C_Taxonomy_Controller' => 'class.taxonomy_controller.php' ); } } +class C_NextGen_Basic_Tagcloud_Installer extends C_Gallery_Display_Installer +{ + /** + * Installs the display type for NextGEN Basic Tagcloud + */ + function install() + { + $this->install_display_type( + NGG_BASIC_TAGCLOUD, array( + 'title' => __('NextGEN Basic TagCloud', 'nggallery'), + 'entity_types' => array('image'), + 'preview_image_relpath' => 'photocrati-nextgen_basic_tagcloud#preview.gif', + 'default_source' => 'tags', + 'view_order' => NGG_DISPLAY_PRIORITY_BASE + 100 + ) + + ); + } +} + new M_NextGen_Basic_Tagcloud(); diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_tagcloud/package.module.nextgen_basic_tagcloud.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_tagcloud/package.module.nextgen_basic_tagcloud.php new file mode 100644 index 0000000000000000000000000000000000000000..cbc32d0d8955689b887861c81bf1f1e0add8fe20 --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_tagcloud/package.module.nextgen_basic_tagcloud.php @@ -0,0 +1,245 @@ +<?php +class A_NextGen_Basic_Tagcloud extends Mixin +{ + public function validation() + { + if ($this->object->name == NGG_BASIC_TAGCLOUD) { + $this->object->validates_presence_of('display_type'); + } + return $this->call_parent('validation'); + } +} +class A_NextGen_Basic_Tagcloud_Controller extends Mixin +{ + /** + * Displays the 'tagcloud' display type + * + * @param stdClass|C_Displayed_Gallery|C_DataMapper_Model $displayed_gallery + */ + public function index_action($displayed_gallery, $return = FALSE) + { + $display_settings = $displayed_gallery->display_settings; + $application = C_Router::get_instance()->get_routed_app(); + $tag = urldecode($this->param('gallerytag')); + // we're looking at a tag, so show images w/that tag as a thumbnail gallery + if (!is_home() && !empty($tag)) { + return C_Displayed_Gallery_Renderer::get_instance()->display_images(array('source' => 'tags', 'container_ids' => array(esc_attr($tag)), 'display_type' => $display_settings['display_type'], 'original_display_type' => $displayed_gallery->display_type, 'original_settings' => $display_settings)); + } + $defaults = array('exclude' => '', 'format' => 'list', 'include' => $displayed_gallery->get_term_ids_for_tags(), 'largest' => 22, 'link' => 'view', 'number' => $display_settings['number'], 'order' => 'ASC', 'orderby' => 'name', 'smallest' => 8, 'taxonomy' => 'ngg_tag', 'unit' => 'pt'); + $args = wp_parse_args('', $defaults); + // Always query top tags + $tags = get_terms($args['taxonomy'], array_merge($args, array('orderby' => 'count', 'order' => 'DESC'))); + foreach ($tags as $key => $tag) { + $tags[$key]->link = $this->object->set_param_for($application->get_routed_url(TRUE), 'gallerytag', $tag->slug); + $tags[$key]->id = $tag->term_id; + } + $params = $display_settings; + $params['inner_content'] = $displayed_gallery->inner_content; + $params['storage'] =& $storage; + $params['tagcloud'] = wp_generate_tag_cloud($tags, $args); + $params['displayed_gallery_id'] = $displayed_gallery->id(); + $params = $this->object->prepare_display_parameters($displayed_gallery, $params); + return $this->object->render_partial('photocrati-nextgen_basic_tagcloud#nextgen_basic_tagcloud', $params, $return); + } + /** + * Enqueues all static resources required by this display type + * + * @param C_Displayed_Gallery $displayed_gallery + */ + public function enqueue_frontend_resources($displayed_gallery) + { + $this->call_parent('enqueue_frontend_resources', $displayed_gallery); + wp_enqueue_style('photocrati-nextgen_basic_tagcloud-style', $this->get_static_url('photocrati-nextgen_basic_tagcloud#nextgen_basic_tagcloud.css')); + $this->enqueue_ngg_styles(); + } +} +class A_NextGen_Basic_Tagcloud_Form extends Mixin_Display_Type_Form +{ + public function get_display_type_name() + { + return NGG_BASIC_TAGCLOUD; + } + public function _get_field_names() + { + return array('nextgen_basic_tagcloud_number', 'nextgen_basic_tagcloud_display_type'); + } + public function enqueue_static_resources() + { + $path = 'photocrati-nextgen_basic_tagcloud#settings.css'; + wp_enqueue_style('nextgen_basic_tagcloud_settings-css', $this->get_static_url($path)); + $atp = C_Attach_Controller::get_instance(); + if (!is_null($atp)) { + $atp->mark_script($path); + } + } + public function _render_nextgen_basic_tagcloud_number_field($display_type) + { + return $this->_render_number_field($display_type, 'number', __('Maximum number of tags', 'nggallery'), $display_type->settings['number']); + } + public function _render_nextgen_basic_tagcloud_display_type_field($display_type) + { + $types = array(); + $skip_types = array(NGG_BASIC_TAGCLOUD, NGG_BASIC_SINGLEPIC, NGG_BASIC_COMPACT_ALBUM, NGG_BASIC_EXTENDED_ALBUM); + $skip_types = apply_filters('ngg_basic_tagcloud_excluded_display_types', $skip_types); + $mapper = C_Display_Type_Mapper::get_instance(); + $display_types = $mapper->find_all(); + foreach ($display_types as $dt) { + if (in_array($dt->name, $skip_types)) { + continue; + } + $types[$dt->name] = $dt->title; + } + return $this->_render_select_field($display_type, 'display_type', __('Display type', 'nggallery'), $types, $display_type->settings['display_type'], __('The display type that the tagcloud will point its results to', 'nggallery')); + } +} +class A_NextGen_Basic_TagCloud_Mapper extends Mixin +{ + public function set_defaults($entity) + { + $this->call_parent('set_defaults', $entity); + if (isset($entity->name) && $entity->name == NGG_BASIC_TAGCLOUD) { + $this->object->_set_default_value($entity, 'settings', 'display_type', NGG_BASIC_THUMBNAILS); + $this->object->_set_default_value($entity, 'settings', 'number', 45); + $this->object->_set_default_value($entity, 'settings', 'ngg_triggers_display', 'never'); + } + } +} +class A_NextGen_Basic_TagCloud_Urls extends Mixin +{ + public function create_parameter_segment($key, $value, $id, $use_prefix) + { + if ($key == 'gallerytag') { + return 'tags/' . $value; + } else { + return $this->call_parent('create_parameter_segment', $key, $value, $id, $use_prefix); + } + } + public function set_parameter_value($key, $value, $id = NULL, $use_prefix = FALSE, $url = FALSE) + { + $retval = $this->call_parent('set_parameter_value', $key, $value, $id, $use_prefix, $url); + return $this->_set_tag_cloud_parameters($retval, $key, $id); + } + public function remove_parameter($key, $id = NULL, $url = FALSE) + { + $retval = $this->call_parent('remove_parameter', $key, $id, $url); + $retval = $this->_set_tag_cloud_parameters($retval, $key, $id); + return $retval; + } + public function _set_tag_cloud_parameters($retval, $key, $id = NULL) + { + // Get the settings manager + $settings = C_NextGen_Settings::get_instance(); + // Create the regex pattern + $sep = preg_quote($settings->router_param_separator, '#'); + if ($id) { + $id = preg_quote($id, '#') . $sep; + } + $prefix = preg_quote($settings->router_param_prefix, '#'); + $regex = implode('', array('#//?', $id ? "({$id})?" : "(\\w+{$sep})?", "({$prefix})?gallerytag{$sep}([\\w-_]+)/?#")); + // Replace any page parameters with the ngglegacy equivalent + if (preg_match($regex, $retval, $matches)) { + $retval = rtrim(str_replace($matches[0], "/tags/{$matches[3]}/", $retval), '/'); + } + return $retval; + } +} +class C_Taxonomy_Controller extends C_MVC_Controller +{ + static $_instances = array(); + protected $ngg_tag_detection_has_run = FALSE; + /** + * Returns an instance of this class + * + * @param string $context + * @return C_Taxonomy_Controller + */ + static function get_instance($context = FALSE) + { + if (!isset(self::$_instances[$context])) { + $klass = get_class(); + self::$_instances[$context] = new $klass($context); + } + return self::$_instances[$context]; + } + public function define($context = FALSE) + { + parent::define($context); + $this->implement('I_Taxonomy_Controller'); + } + /** + * Returns the rendered HTML of a gallery based on the provided tag + * + * @param string $tag + * @return string + */ + public function index_action($tag) + { + $mapper = C_Display_Type_Mapper::get_instance(); + // Respect the global display type setting + $display_type = $mapper->find_by_name(NGG_BASIC_TAGCLOUD, TRUE); + $display_type = !empty($display_type->settings['display_type']) ? $display_type->settings['display_type'] : NGG_BASIC_THUMBNAILS; + return "[ngg_images source='tags' container_ids='{$tag}' slug='{$tag}' display_type='{$display_type}']"; + } + /** + * Determines if the current page is /ngg_tag/{*} + * + * @param $posts Wordpress post objects + * @return array Wordpress post objects + */ + public function detect_ngg_tag($posts, $wp_query_local) + { + global $wp; + global $wp_query; + $wp_query_orig = false; + if ($wp_query_local != null && $wp_query_local != $wp_query) { + $wp_query_orig = $wp_query; + $wp_query = $wp_query_local; + } + // This appears to be necessary for multisite installations, but I can't imagine why. More hackery.. + $tag = urldecode(get_query_var('ngg_tag') ? get_query_var('ngg_tag') : get_query_var('name')); + if (!$this->ngg_tag_detection_has_run && !is_admin() && !empty($tag) && (stripos($wp->request, 'ngg_tag') === 0 || isset($wp_query->query_vars['page_id']) && $wp_query->query_vars['page_id'] === 'ngg_tag')) { + $this->ngg_tag_detection_has_run = TRUE; + // Wordpress somewhat-correctly generates several notices, so silence them as they're really unnecessary + if (!defined('WP_DEBUG') || !WP_DEBUG) { + error_reporting(0); + } + // Without this all url generated from this page lacks the /ngg_tag/(slug) section of the URL + add_filter('ngg_wprouting_add_post_permalink', '__return_false'); + // create in-code a fake post; we feed it back to Wordpress as the sole result of the "the_posts" filter + $posts = NULL; + $posts[] = $this->create_ngg_tag_post($tag); + $wp_query->is_404 = FALSE; + $wp_query->is_page = TRUE; + $wp_query->is_singular = TRUE; + $wp_query->is_home = FALSE; + $wp_query->is_archive = FALSE; + $wp_query->is_category = FALSE; + unset($wp_query->query['error']); + $wp_query->query_vars['error'] = ''; + } + if ($wp_query_orig !== false) { + $wp_query = $wp_query_orig; + } + return $posts; + } + public function create_ngg_tag_post($tag) + { + $title = sprintf(__('Images tagged "%s"', 'nggallery'), $tag); + $title = apply_filters('ngg_basic_tagcloud_title', $title, $tag); + $post = new stdClass(); + $post->post_author = FALSE; + $post->post_name = 'ngg_tag'; + $post->guid = get_bloginfo('wpurl') . '/' . 'ngg_tag'; + $post->post_title = $title; + $post->post_content = $this->index_action($tag); + $post->ID = FALSE; + $post->post_type = 'page'; + $post->post_status = 'publish'; + $post->comment_status = 'closed'; + $post->ping_status = 'closed'; + $post->comment_count = 0; + $post->post_date = current_time('mysql'); + $post->post_date_gmt = current_time('mysql', 1); + return $post; + } +} \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_tagcloud/static/nextgen_basic_tagcloud.min.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_tagcloud/static/nextgen_basic_tagcloud.min.css new file mode 100644 index 0000000000000000000000000000000000000000..e8f694854b52fdb6446710b2f0bfc4c720e852a9 --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_tagcloud/static/nextgen_basic_tagcloud.min.css @@ -0,0 +1 @@ +.ngg-tagcloud{display:inline-block}.ngg-tagcloud ul.wp-tag-cloud{margin:0;padding:0}.ngg-tagcloud ul.wp-tag-cloud li{list-style:none;float:left;height:30pt;margin:0 4px 0 0;padding:0}.ngg-tagcloud ul.wp-tag-cloud li a{display:table-cell;display:block\9;vertical-align:bottom;height:30pt} \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_tagcloud/static/settings.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_tagcloud/static/settings.css new file mode 100644 index 0000000000000000000000000000000000000000..cfb7a178bc80a3628325c04f3871cdeef24a5480 --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_tagcloud/static/settings.css @@ -0,0 +1,3 @@ +select#photocrati-nextgen_basic_tagcloud_display_type { + width: 235px; +} \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_tagcloud/static/settings.min.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_tagcloud/static/settings.min.css new file mode 100644 index 0000000000000000000000000000000000000000..339b6a652b197ebb50f6bc727af4804778b80ba3 --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_tagcloud/static/settings.min.css @@ -0,0 +1 @@ +select#photocrati-nextgen_basic_tagcloud_display_type{width:235px} \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_templates/module.nextgen_basic_templates.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_templates/module.nextgen_basic_templates.php index dec839a5a90a411adb28e6c2e71608537473f195..6de4c0fdd8fa9104ac3b56453f57fe2d7f34521d 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_templates/module.nextgen_basic_templates.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_templates/module.nextgen_basic_templates.php @@ -15,7 +15,7 @@ class M_NextGen_Basic_Templates extends C_Base_Module 'photocrati-nextgen_basic_templates', 'NextGen Basic Templates', 'Provides a NextGen-Legacy compatible thumbnail gallery for NextGEN Gallery', - '0.4', + '0.5', 'http://www.photocrati.com', 'Photocrati Media', 'http://www.photocrati.com' @@ -43,7 +43,6 @@ class M_NextGen_Basic_Templates extends C_Base_Module return array( 'A_Nextgen_Basic_Template_Form' => 'adapter.nextgen_basic_template_form.php', 'C_Legacy_Template_Locator' => 'class.legacy_template_locator.php', - 'I_Legacy_Template_Locator' => 'interface.legacy_template_locator.php', 'Mixin_Nextgen_Basic_Templates' => 'mixin.nextgen_basic_templates.php' ); } diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_templates/package.module.nextgen_basic_templates.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_templates/package.module.nextgen_basic_templates.php new file mode 100644 index 0000000000000000000000000000000000000000..7d2c61de31009ac7db6a184ac4cef1ad2f4ccd38 --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_templates/package.module.nextgen_basic_templates.php @@ -0,0 +1,325 @@ +<?php +class A_NextGen_Basic_Template_Form extends Mixin +{ + /** + * Renders 'template' settings field + * + * @param $display_type + * @return mixed + */ + public function _render_nextgen_basic_templates_template_field($display_type) + { + switch ($display_type->name) { + case 'photocrati-nextgen_basic_singlepic': + $prefix = 'singlepic'; + break; + case 'photocrati-nextgen_basic_thumbnails': + $prefix = 'gallery'; + break; + case 'photocrati-nextgen_basic_slideshow': + $prefix = 'gallery'; + break; + case 'photocrati-nextgen_basic_imagebrowser': + $prefix = 'imagebrowser'; + break; + case NGG_BASIC_COMPACT_ALBUM: + $prefix = 'album'; + break; + case NGG_BASIC_EXTENDED_ALBUM: + $prefix = 'album'; + break; + default: + $prefix = FALSE; + break; + } + // ensure the current file is in the list + $templates = $this->object->_get_available_templates($prefix); + if (!isset($templates[$display_type->settings['template']])) { + $templates[$display_type->settings['template']] = $display_type->settings['template']; + } + return $this->object->render_partial('photocrati-nextgen_basic_templates#nextgen_basic_templates_settings_template', array('display_type_name' => $display_type->name, 'template_label' => __('Template', 'nggallery'), 'template_text' => __('Use a legacy template when rendering (not recommended).', 'nggallery'), 'chosen_file' => $display_type->settings['template'], 'templates' => $templates), True); + } + /** + * Retrieves listing of available templates + * + * Override this function to modify or add to the available templates listing, array format + * is array(file_abspath => label) + * @return array + */ + public function _get_available_templates($prefix = FALSE) + { + $templates = array(); + foreach (C_Legacy_Template_Locator::get_instance()->find_all($prefix) as $label => $files) { + foreach ($files as $file) { + $tmp = explode(DIRECTORY_SEPARATOR, $file); + $templates[$file] = "{$label}: " . end($tmp); + } + } + asort($templates); + return $templates; + } + /** + * Returns the parameter objects necessary for legacy template rendering (legacy_render()) + * + * @param $images + * @param $displayed_gallery + * @param array $params + * + * @return array + */ + public function prepare_legacy_parameters($images, $displayed_gallery, $params = array()) + { + // setup + $image_map = C_Image_Mapper::get_instance(); + $gallery_map = C_Gallery_Mapper::get_instance(); + $image_key = $image_map->get_primary_key_column(); + $gallery_key = $gallery_map->get_primary_key_column(); + $pid = $this->object->param('pid'); + // because picture_list implements ArrayAccess any array-specific actions must be taken on + // $picture_list->container or they won't do anything + $picture_list = new C_Image_Wrapper_Collection(); + $current_pid = NULL; + // begin processing + $current_page = @get_the_ID() == FALSE ? 0 : @get_the_ID(); + // determine what the "current image" is; used mostly for carousel + if (!is_numeric($pid) && !empty($pid)) { + $picture = $image_map->find_first(array('image_slug = %s', $pid)); + $pid = $picture->{$image_key}; + } + // create our new wrappers + foreach ($images as &$image) { + if ($image && isset($params['effect_code'])) { + if (is_object($image)) { + $image->thumbcode = $params['effect_code']; + } elseif (is_array($image)) { + $image['thumbcode'] = $params['effect_code']; + } + } + $new_image = new C_Image_Wrapper($image, $displayed_gallery); + if ($pid == $new_image->{$image_key}) { + $current_pid = $new_image; + } + $picture_list[] = $new_image; + } + reset($picture_list->container); + // assign current_pid + $current_pid = is_null($current_pid) ? current($picture_list->container) : $current_pid; + foreach ($picture_list as &$image) { + if (isset($image->hidden) && $image->hidden) { + $tmp = $displayed_gallery->display_settings['number_of_columns']; + $image->style = $tmp > 0 ? 'style="width:' . floor(100 / $tmp) . '%;display: none;"' : 'style="display: none;"'; + } + } + // find our gallery to build the new one on + $orig_gallery = $gallery_map->find(current($picture_list->container)->galleryid); + // create the 'gallery' object + $gallery = new stdclass(); + $gallery->ID = $displayed_gallery->id(); + $gallery->name = stripslashes($orig_gallery->name); + $gallery->title = stripslashes($orig_gallery->title); + $gallery->description = html_entity_decode(stripslashes($orig_gallery->galdesc)); + $gallery->pageid = $orig_gallery->pageid; + if (!empty($displayed_gallery->display_settings['ajax_pagination'])) { + $gallery_id = $displayed_gallery->transient_id; + } else { + $gallery_id = $displayed_gallery->id(); + } + $gallery->anchor = 'ngg-gallery-' . $gallery_id . '-' . $current_page; + $gallery->displayed_gallery =& $displayed_gallery; + $gallery->columns = @intval($displayed_gallery->display_settings['number_of_columns']); + $gallery->imagewidth = $gallery->columns > 0 ? 'style="width:' . floor(100 / $gallery->columns) . '%;"' : ''; + if (!empty($displayed_gallery->display_settings['show_slideshow_link'])) { + $gallery->show_slideshow = TRUE; + $gallery->slideshow_link = $params['slideshow_link']; + $gallery->slideshow_link_text = $displayed_gallery->display_settings['slideshow_link_text']; + } else { + $gallery->show_slideshow = FALSE; + } + $gallery = apply_filters('ngg_gallery_object', $gallery, 4); + // build our array of things to return + $return = array('registry' => C_Component_Registry::get_instance(), 'gallery' => $gallery); + // single_image is an internally added flag + if (!empty($params['single_image'])) { + $return['image'] = $picture_list[0]; + } else { + $return['current'] = $current_pid; + $return['images'] = $picture_list->container; + } + // this is expected to always exist + if (!empty($params['pagination'])) { + $return['pagination'] = $params['pagination']; + } else { + $return['pagination'] = NULL; + } + $return['next'] = $params['next']; + $return['prev'] = $params['prev']; + return $return; + } + public function enqueue_static_resources() + { + wp_enqueue_style('ngg_template_settings', $this->get_static_url('photocrati-nextgen_basic_templates#ngg_template_settings.css')); + wp_enqueue_script('ngg_template_settings', $this->get_static_url('photocrati-nextgen_basic_templates#ngg_template_settings.js'), array('select2'), $this->module_version, TRUE); + wp_localize_script('ngg_template_settings', 'ngg_template_settings', array('placeholder_text' => __('No template selected'))); + $atp = C_Attach_Controller::get_instance(); + if ($atp != null) { + $atp->mark_script('ngg_template_settings'); + } + } +} +/** + * Provides a utility to locate legacy templates + */ +class C_Legacy_Template_Locator extends C_Component +{ + static $_instances = array(); + public function define($context = FALSE) + { + parent::define($context); + $this->add_mixin('Mixin_Legacy_Template_Locator'); + $this->implement('I_Legacy_Template_Locator'); + } + static function get_instance($context = FALSE) + { + if (!isset(self::$_instances[$context])) { + $klass = get_class(); + self::$_instances[$context] = new $klass($context); + } + return self::$_instances[$context]; + } +} +/** + * Provides instance methods for the legacy template locator + */ +class Mixin_Legacy_Template_Locator extends Mixin +{ + /** + * Returns an array of template storing directories + * + * @return array Template storing directories + */ + public function get_template_directories() + { + return apply_filters('ngg_legacy_template_directories', array('Child Theme' => get_stylesheet_directory() . DIRECTORY_SEPARATOR . 'nggallery' . DIRECTORY_SEPARATOR, 'Parent Theme' => get_template_directory() . DIRECTORY_SEPARATOR . 'nggallery' . DIRECTORY_SEPARATOR, 'NextGEN Legacy' => NGGALLERY_ABSPATH . 'view' . DIRECTORY_SEPARATOR, 'NextGEN Overrides' => implode(DIRECTORY_SEPARATOR, array(WP_CONTENT_DIR, 'ngg', 'legacy', 'templates')))); + } + /** + * Returns an array of all available template files + * + * @return array All available template files + */ + public function find_all($prefix = FALSE) + { + $files = array(); + foreach ($this->object->get_template_directories() as $label => $dir) { + $tmp = $this->object->get_templates_from_dir($dir, $prefix); + if (!$tmp) { + continue; + } + $files[$label] = $tmp; + } + return $files; + } + /** + * Recursively scans $dir for files ending in .php + * + * @param string $dir Directory + * @return array All php files in $dir + */ + public function get_templates_from_dir($dir, $prefix = FALSE) + { + if (!is_dir($dir)) { + return; + } + $dir = new RecursiveDirectoryIterator($dir); + $iterator = new RecursiveIteratorIterator($dir); + // convert single-item arrays to string + if (is_array($prefix) && count($prefix) <= 1) { + $prefix = end($prefix); + } + // we can filter results by allowing a set of prefixes, one prefix, or by showing all available files + if (is_array($prefix)) { + $str = implode('|', $prefix); + $regex_iterator = new RegexIterator($iterator, "/({$str})-.+\\.php\$/i", RecursiveRegexIterator::GET_MATCH); + } elseif (is_string($prefix)) { + $regex_iterator = new RegexIterator($iterator, "#(.*)[/\\\\]{$prefix}\\-?.*\\.php\$#i", RecursiveRegexIterator::GET_MATCH); + } else { + $regex_iterator = new RegexIterator($iterator, '/^.+\\.php$/i', RecursiveRegexIterator::GET_MATCH); + } + $files = array(); + foreach ($regex_iterator as $filename) { + $files[] = reset($filename); + } + return $files; + } + /** + * Find a particular template by name + * @param $template + */ + public function find($template_name) + { + $template_abspath = FALSE; + // hook into the render feature to allow other plugins to include templates + $custom_template = apply_filters('ngg_render_template', FALSE, $template_name); + if ($custom_template === FALSE) { + $custom_template = $template_name; + } + // Ensure we have a PHP extension + if (strpos($custom_template, '.php') === FALSE) { + $custom_template .= '.php'; + } + // Find the abspath of the template to render + if (!@file_exists($custom_template)) { + foreach ($this->object->get_template_directories() as $dir) { + if ($template_abspath) { + break; + } + $filename = implode(DIRECTORY_SEPARATOR, array(rtrim($dir, '/\\'), $custom_template)); + if (@file_exists($filename)) { + $template_abspath = $filename; + } elseif (strpos($custom_template, '-template') === FALSE) { + $filename = implode(DIRECTORY_SEPARATOR, array(rtrim($dir, '/\\'), str_replace('.php', '', $custom_template) . '-template.php')); + if (@file_exists($filename)) { + $template_abspath = $filename; + } + } + } + } else { + // An absolute path was already given + $template_abspath = $custom_template; + } + return $template_abspath; + } +} +class Mixin_NextGen_Basic_Templates extends Mixin +{ + /** + * Renders NextGen-Legacy style templates + * + * @param string $template_name File name + * @param array $vars Specially formatted array of parameters + * @param bool $callback + * @param bool $return + */ + public function legacy_render($template_name, $vars = array(), $return = FALSE, $prefix = NULL) + { + $retval = '[Not a valid template]'; + $template_locator = C_Legacy_Template_Locator::get_instance(); + // search first for files with their prefix + $template_abspath = $template_locator->find($prefix . '-' . $template_name); + if (!$template_abspath) { + $template_abspath = $template_locator->find($template_name); + } + if ($template_abspath) { + // render the template + extract($vars); + if ($return) { + ob_start(); + } + include $template_abspath; + if ($return) { + $retval = ob_get_contents(); + ob_end_clean(); + } + } + return $retval; + } +} \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_templates/static/ngg_template_settings.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_templates/static/ngg_template_settings.js index 717ee97c1b4aa53eda8bf8c9673b1924ca18fc48..d0d7cd19d1147254ae4ea02096fda71cde5fabb0 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_templates/static/ngg_template_settings.js +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_templates/static/ngg_template_settings.js @@ -1,114 +1,7 @@ -(function( $ ) { - $.widget("ui.combobox", { - _create: function() { - var input, - that = this, - select = this.element.hide(), - selected = select.children(":selected"), - value = selected.val() ? selected.text() : "", - wrapper = this.wrapper = $("<span>").addClass("ui-combobox") - .insertAfter(select); - - function removeIfInvalid(element) { - var value = $(element).val(), - matcher = new RegExp("^" + $.ui.autocomplete.escapeRegex(value) + "$", "i" ), - valid = false; - - select.children("option").each(function() { - if ($(this).text().match(matcher)) { - this.selected = valid = true; - return false; - } - }); - - if (!valid) { - var new_option = new Option(value, value, true, true); - select.append(new_option); - select.val(value); - $(element).val(value); - input.data('autocomplete').term = value; - return true; - } - } - - input = $("<input>").appendTo(wrapper) - .val(value) - .attr("title", "") - .addClass("ui-state-default ui-combobox-input") - .autocomplete({ - delay: 0, - minLength: 0, - source: function(request, response) { - var matcher = new RegExp($.ui.autocomplete.escapeRegex(request.term), "i"); - response(select.children("option").map(function() { - var text = $(this).text(); - if (!request.term || matcher.test(text)) { - var label = text; - if (request.term != '' && matcher.test(label)) { - label = label.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)(" + $.ui.autocomplete.escapeRegex(request.term) + ")(?![^<>]*>)(?![^&;]+;)", "gi"), "<strong>$1</strong>"); - } - return { - label: label, - value: text, - option: this - }; - } - })); - }, - select: function(event, ui) { - ui.item.option.selected = true; - that._trigger("selected", event, { - item: ui.item.option - }); - }, - change: function(event, ui) { - if (!ui.item) { - return removeIfInvalid(this); - } - } - }) - .addClass("ui-widget ui-widget-content ui-corner-left"); - var autocomplete = input.data("autocomplete"); - if (autocomplete) autocomplete._renderItem = function(ul, item) { - return $("<li>").data("item.autocomplete", item) - .append("<a>" + item.label + "</a>") - .appendTo(ul); - }; - - $("<a>").attr("tabIndex", -1) - .attr("title", "Show All Items") - .appendTo(wrapper) - .button({ - icons: { primary: "ui-icon-triangle-1-s" }, - text: false - }) - .removeClass("ui-corner-all") - .addClass("ui-corner-right ui-combobox-toggle") - .click(function() { - // close if already visible - if (input.autocomplete("widget").is(":visible")) { - input.autocomplete("close"); - removeIfInvalid(input); - return; - } - - // work around a bug (likely same cause as #5265) - $(this).blur(); - - // pass empty string as value to search for, displaying all results - input.autocomplete("search", ""); - input.focus(); - }); - }, - - destroy: function() { - this.wrapper.remove(); - this.element.show(); - $.Widget.prototype.destroy.call( this ); - } +jQuery(function($){ + $('.ngg_settings_template').select2({ + placeholder: ngg_template_settings.placeholder_text, + allowClear: true, + width: 350 }); -})(jQuery); - -jQuery(function($) { - $(".ngg_settings_template").combobox(); -}); +}); \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_templates/static/ngg_template_settings.min.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_templates/static/ngg_template_settings.min.css new file mode 100644 index 0000000000000000000000000000000000000000..e658b1a288e0fc82dcba60d05cd4b41d8d3c34af --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_templates/static/ngg_template_settings.min.css @@ -0,0 +1 @@ +.ngg_settings_template_wrapper .ui-combobox{position:relative;display:inline-block}.ngg_settings_template_wrapper .ui-combobox-toggle{position:absolute;top:0;bottom:0;margin-left:-1px}.ngg_settings_template_wrapper .ui-combobox-input{margin:0;padding:.3em;width:365px}.ngg_settings_template_wrapper .ui-helper-hidden-accessible{display:none} \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_templates/static/ngg_template_settings.min.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_templates/static/ngg_template_settings.min.js new file mode 100644 index 0000000000000000000000000000000000000000..ebb576dfa5d9fefc6c83f7ca0629d19020df973e --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_templates/static/ngg_template_settings.min.js @@ -0,0 +1 @@ +eval(function(p,a,c,k,e,d){e=function(c){return c.toString(36)};if(!''.replace(/^/,String)){while(c--){d[c.toString(a)]=k[c]||c.toString(a)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('3(2($){$(\'.1\').0({4:5.9,8:7,6:a})});',11,11,'select2|ngg_settings_template|function|jQuery|placeholder|ngg_template_settings|width|true|allowClear|placeholder_text|350'.split('|'),0,{})) diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_templates/templates/nextgen_basic_templates_settings_template.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_templates/templates/nextgen_basic_templates_settings_template.php index c4dcf78e33f33879c732c058820f810d856ca813..0a1b0f600ee23b84cd898092489fe962aa8f68d3 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_templates/templates/nextgen_basic_templates_settings_template.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_basic_templates/templates/nextgen_basic_templates_settings_template.php @@ -2,8 +2,8 @@ <td> <label for='<?php echo esc_attr($display_type_name); ?>_template' class='tooltip' - title="<?php echo_h($template_text); ?>"> - <?php echo_h($template_label); ?> + title="<?php esc_html_e($template_text); ?>"> + <?php esc_html_e($template_label); ?> </label> </td> <td> @@ -11,10 +11,12 @@ <select name='<?php echo esc_attr($display_type_name); ?>[template]' id='<?php echo esc_attr($display_type_name); ?>_template>' class='ngg_thumbnail_template ngg_settings_template'> - <option value=''> </option> - <?php foreach ($templates as $file => $label) { ?> - <option value="<?php echo $file; ?>" <?php selected($chosen_file, $file, TRUE); ?>><?php echo_h($label); ?></option> - <?php } ?> + <option></option> + <?php foreach ($templates as $file => $label): ?> + <?php if ($file && $label): ?> + <option value="<?php echo $file; ?>" <?php selected($chosen_file, $file, TRUE); ?>><?php esc_html_e($label); ?></option> + <?php endif ?> + <?php endforeach ?> </select> </div> </td> diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/module.nextgen_data.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/module.nextgen_data.php index 75a1e396b16cf92f35c846b26da41f8346d834b0..b5510df598baae2a040101d1613b2147f979b12e 100755 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/module.nextgen_data.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/module.nextgen_data.php @@ -15,7 +15,7 @@ class M_NextGen_Data extends C_Base_Module 'photocrati-nextgen-data', 'NextGEN Data Tier', "Provides a data tier for NextGEN gallery based on the DataMapper module", - '0.8', + '0.10', 'http://www.photocrati.com', 'Photocrati Media', 'http://www.photocrati.com' @@ -28,7 +28,6 @@ class M_NextGen_Data extends C_Base_Module { $this->get_registry()->add_adapter('I_Component_Factory', 'A_NextGen_Data_Factory'); #$this->get_registry()->add_adapter('I_CustomPost_DataMapper', 'A_Attachment_DataMapper', 'attachment'); - $this->get_registry()->add_adapter('I_CustomTable_DataMapper', 'A_CustomTable_Sorting_DataMapper'); $this->get_registry()->add_adapter('I_Installer', 'A_NextGen_Data_Installer'); } @@ -64,17 +63,7 @@ class M_NextGen_Data extends C_Base_Module 'Mixin_NextGen_Table_Extras' => 'mixin.nextgen_table_extras.php', 'C_Ngglegacy_Gallerystorage_Driver' => 'class.ngglegacy_gallerystorage_driver.php', 'C_Ngglegacy_Thumbnail' => 'class.ngglegacy_thumbnail.php', - 'C_Wordpress_Gallerystorage_Driver' => 'class.wordpress_gallerystorage_driver.php', - 'I_Album' => 'interface.album.php', - 'I_Gallery' => 'interface.gallery.php', - 'I_Image' => 'interface.image.php', - 'I_Album_Mapper' => 'interface.album_mapper.php', - 'I_Component_Config' => 'interface.component_config.php', - 'I_Gallerystorage_Driver' => 'interface.gallerystorage_driver.php', - 'I_Gallery_Mapper' => 'interface.gallery_mapper.php', - 'I_Gallery_Storage' => 'interface.gallery_storage.php', - 'I_Gallery_Type' => 'interface.gallery_type.php', - 'I_Image_Mapper' => 'interface.image_mapper.php' + 'C_Wordpress_Gallerystorage_Driver' => 'class.wordpress_gallerystorage_driver.php' ); } diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/package.module.nextgen_data.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/package.module.nextgen_data.php new file mode 100644 index 0000000000000000000000000000000000000000..1c3c726576eb890ac44bdb6588ff090ec32d95e5 --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/package.module.nextgen_data.php @@ -0,0 +1,4803 @@ +<?php +/** + * Modifies a custom post datamapper to use the WordPress built-in 'attachment' + * custom post type, as used by the Media Library + */ +class A_Attachment_DataMapper extends Mixin +{ + public function initialize() + { + $this->object->_object_name = 'attachment'; + } + /** + * Saves the entity using the wp_insert_attachment function + * instead of the wp_insert_post + * @param stdObject $entity + */ + public function _save_entity($entity) + { + $post = $this->object->_convert_entity_to_post($entity); + $filename = property_exists($entity, 'filename') ? $entity->filename : FALSE; + $primary_key = $this->object->get_primary_key_column(); + if ($post_id = $attachment_id = wp_insert_attachment($post, $filename)) { + $new_entity = $this->object->find($post_id); + foreach ($new_entity as $key => $value) { + $entity->{$key} = $value; + } + // Merge meta data with WordPress Attachment Meta Data + if (property_exists($entity, 'meta_data')) { + $meta_data = wp_get_attachment_metadata($attachment_id); + if (isset($meta_data['image_meta'])) { + $entity->meta_data = array_merge_recursive($meta_data['image_meta'], $entity->meta_data); + wp_update_attachment_metadata($attachment_id, $entity->meta_data); + } + } + // Save properties are post meta as well + $this->object->_flush_and_update_postmeta($attachment_id, $entity instanceof stdClass ? $entity : $entity->get_entity(), array('_wp_attached_file', '_wp_attachment_metadata', '_mapper')); + $entity->id_field = $primary_key; + } + return $attachment_id; + } + public function select($fields = '*') + { + $ret = $this->call_parent('select', $fields); + $this->object->_query_args['datamapper_attachment'] = true; + return $ret; + } +} +class A_NextGen_Data_Factory extends Mixin +{ + public function gallery($properties = array(), $mapper = FALSE, $context = FALSE) + { + return new C_Gallery($properties, $mapper, $context); + } + public function gallery_image($properties = array(), $mapper = FALSE, $context = FALSE) + { + return new C_Image($properties, $mapper, $context); + } + public function image($properties = array(), $mapper = FALSE, $context = FALSE) + { + return new C_Image($properties, $mapper, $context); + } + public function album($properties = array(), $mapper = FALSE, $context = FALSE) + { + return new C_Album($properties, $mapper, $context); + } + public function ngglegacy_gallery_storage($context = FALSE) + { + return new C_NggLegacy_GalleryStorage_Driver($context); + } + public function wordpress_gallery_storage($context = FALSE) + { + return new C_WordPress_GalleryStorage_Driver($context); + } + public function gallery_storage($context = FALSE) + { + return new C_Gallery_Storage($context); + } + public function extra_fields($properties = array(), $mapper = FALSE, $context = FALSE) + { + return new C_Datamapper_Model($mapper, $properties, $context); + } + public function gallerystorage($context = FALSE) + { + return $this->object->gallery_storage($context); + } +} +class C_Album extends C_DataMapper_Model +{ + public $_mapper_interface = 'I_Album_Mapper'; + public function define($properties = array(), $mapper = FALSE, $context = FALSE) + { + parent::define($mapper, $properties, $context); + $this->add_mixin('Mixin_NextGen_Album_Instance_Methods'); + $this->implement('I_Album'); + } + /** + * Instantiates an Album object + * @param bool|\C_DataMapper|\FALSE $mapper + * @param array $properties + */ + public function initialize($properties = array(), $mapper = FALSE, $context = FALSE) + { + // Get the mapper is not specified + if (!$mapper) { + $mapper = $this->get_registry()->get_utility($this->_mapper_interface); + } + // Initialize + parent::initialize($mapper, $properties); + } +} +/** + * Provides instance methods for the album + */ +class Mixin_NextGen_Album_Instance_Methods extends Mixin +{ + public function validation() + { + $this->validates_presence_of('name'); + $this->validates_numericality_of('previewpic'); + return $this->object->is_valid(); + } + /** + * Gets all galleries associated with the album + */ + public function get_galleries($models = FALSE) + { + $retval = array(); + $mapper = C_Gallery_Mapper::get_instance(); + $gallery_key = $mapper->get_primary_key_column(); + $retval = $mapper->find_all(array("{$gallery_key} IN %s", $this->object->sortorder), $models); + return $retval; + } +} +class C_Album_Mapper extends C_CustomTable_DataMapper_Driver +{ + static $_instance = NULL; + public function initialize($object_name = FALSE) + { + parent::initialize('ngg_album'); + } + public function define($context = FALSE, $not_used = FALSE) + { + // Define the context + if (!is_array($context)) { + $context = array($context); + } + array_push($context, 'album'); + $this->_primary_key_column = 'id'; + // Define the mapper + parent::define('ngg_album', $context); + $this->add_mixin('Mixin_NextGen_Table_Extras'); + $this->add_mixin('Mixin_Album_Mapper'); + $this->implement('I_Album_Mapper'); + $this->set_model_factory_method('album'); + // Define the columns + $this->define_column('id', 'BIGINT', 0); + $this->define_column('name', 'VARCHAR(255)'); + $this->define_column('slug', 'VARCHAR(255'); + $this->define_column('previewpic', 'BIGINT', 0); + $this->define_column('albumdesc', 'TEXT'); + $this->define_column('sortorder', 'TEXT'); + $this->define_column('pageid', 'BIGINT', 0); + $this->define_column('extras_post_id', 'BIGINT', 0); + // Mark the columns which should be unserialized + $this->add_serialized_column('sortorder'); + } + /** + * Returns an instance of the album datamapper + * @param bool|mixed $context + * @return C_Album_Mapper + */ + static function get_instance($context = FALSE) + { + if (is_null(self::$_instance)) { + $klass = get_class(); + self::$_instance = new $klass($context); + } + return self::$_instance; + } +} +/** + * Provides album-specific methods for the datamapper + */ +class Mixin_Album_Mapper extends Mixin +{ + /** + * Gets the post title when the Custom Post driver is used + * @param C_DataMapper_Model|C_Album|stdClass $entity + * @return string + */ + public function get_post_title($entity) + { + return $entity->name; + } + public function _save_entity($entity) + { + $retval = $this->call_parent('_save_entity', $entity); + if ($retval) { + do_action('ngg_album_updated', $entity); + C_Photocrati_Transient_Manager::flush('displayed_gallery_rendering'); + } + return $retval; + } + /** + * Sets the defaults for an album + * @param C_DataMapper_Model|C_Album|stdClass $entity + */ + public function set_defaults($entity) + { + $this->object->_set_default_value($entity, 'name', ''); + $this->object->_set_default_value($entity, 'albumdesc', ''); + $this->object->_set_default_value($entity, 'sortorder', array()); + $this->object->_set_default_value($entity, 'previewpic', 0); + $this->object->_set_default_value($entity, 'exclude', 0); + if (isset($entity->name) && !isset($entity->slug)) { + $entity->slug = nggdb::get_unique_slug(sanitize_title($entity->name), 'album'); + } + } +} +class Mixin_NextGen_Gallery_Validation +{ + /** + * Validates whether the gallery can be saved + */ + public function validation() + { + // If a title is present, we can auto-populate some other properties + if ($this->object->title) { + // If no name is present, use the title to generate one + if (!$this->object->name) { + $this->object->name = sanitize_file_name(sanitize_title($this->object->title)); + $this->object->name = apply_filters('ngg_gallery_name', $this->object->name); + } + // If no slug is set, use the title to generate one + if (!$this->object->slug) { + $this->object->slug = nggdb::get_unique_slug(sanitize_title($this->object->title), 'gallery'); + } + } + // Set what will be the path to the gallery + if (!$this->object->path) { + $storage = C_Gallery_Storage::get_instance(); + $this->object->path = $storage->get_upload_relpath($this->object); + unset($storage); + } + $this->object->validates_presence_of('title'); + $this->object->validates_presence_of('name'); + $this->object->validates_uniqueness_of('slug'); + $this->object->validates_numericality_of('author'); + return $this->object->is_valid(); + } +} +/** + * Creates a model representing a NextGEN Gallery object + */ +class C_Gallery extends C_DataMapper_Model +{ + public $_mapper_interface = 'I_Gallery_Mapper'; + /** + * Defines the interfaces and methods (through extensions and hooks) + * that this class provides + */ + public function define($properties, $mapper = FALSE, $context = FALSE) + { + parent::define($mapper, $properties, $context); + $this->add_mixin('Mixin_NextGen_Gallery_Validation'); + $this->implement('I_Gallery'); + } + /** + * Instantiates a new model + * @param array|stdClass $properties + * @param C_DataMapper $mapper + * @param string $context + */ + public function initialize($properties = array(), $mapper = FALSE, $context = FALSE) + { + // Get the mapper is not specified + if (!$mapper) { + $mapper = $this->get_registry()->get_utility($this->_mapper_interface); + } + // Initialize + parent::initialize($mapper, $properties); + } + public function get_images() + { + $mapper = C_Image_Mapper::get_instance(); + return $mapper->select()->where(array('galleryid = %d', $this->gid))->order_by('sortorder')->run_query(); + } +} +/** + * Provides a datamapper for galleries + */ +class C_Gallery_Mapper extends C_CustomTable_DataMapper_Driver +{ + public static $_instance = NULL; + /** + * Define the object + * @param string $context + */ + public function define($context = FALSE, $not_used = FALSE) + { + // Add 'gallery' context + if (!is_array($context)) { + $context = array($context); + } + array_push($context, 'gallery'); + $this->_primary_key_column = 'gid'; + // Continue defining the object + parent::define('ngg_gallery', $context); + $this->set_model_factory_method('gallery'); + $this->add_mixin('Mixin_NextGen_Table_Extras'); + $this->add_mixin('Mixin_Gallery_Mapper'); + $this->implement('I_Gallery_Mapper'); + // Define the columns + $this->define_column('gid', 'BIGINT', 0); + $this->define_column('name', 'VARCHAR(255)'); + $this->define_column('slug', 'VARCHAR(255'); + $this->define_column('path', 'TEXT'); + $this->define_column('title', 'TEXT'); + $this->define_column('pageid', 'INT', 0); + $this->define_column('previewpic', 'INT', 0); + $this->define_column('author', 'INT', 0); + $this->define_column('extras_post_id', 'BIGINT', 0); + } + public function initialize($object_name = FALSE) + { + parent::initialize('ngg_gallery'); + } + /** + * Returns a singleton of the gallery mapper + * @param string $context + * @return C_Gallery_Mapper + */ + public static function get_instance($context = False) + { + if (is_null(self::$_instance)) { + $klass = get_class(); + self::$_instance = new $klass($context); + } + return self::$_instance; + } +} +class Mixin_Gallery_Mapper extends Mixin +{ + /** + * Uses the title property as the post title when the Custom Post driver + * is used + */ + public function get_post_title($entity) + { + return $entity->title; + } + public function _save_entity($entity) + { + $retval = $this->call_parent('_save_entity', $entity); + if ($retval) { + do_action('ngg_created_new_gallery', $entity->{$entity->id_field}); + C_Photocrati_Transient_Manager::flush('displayed_gallery_rendering'); + } + return $retval; + } + public function destroy($gallery, $with_dependencies = FALSE) + { + $retval = FALSE; + if ($gallery) { + $gallery_id = is_numeric($gallery) ? $gallery : $gallery->{$gallery->id_field}; + // TODO: Look into making this operation more efficient + if ($with_dependencies) { + $image_mapper = C_Image_Mapper::get_instance(); + // Delete the image files from the filesystem + $settings = C_NextGen_Settings::get_instance(); + if ($settings->deleteImg) { + $storage = C_Gallery_Storage::get_instance(); + $storage->delete_gallery($gallery); + } + // Delete the image records from the DB + $image_mapper->delete()->where(array('galleryid = %d', $gallery_id))->run_query(); + $image_key = $image_mapper->get_primary_key_column(); + $image_table = $image_mapper->get_table_name(); + // Delete tag associations no longer needed. The following SQL statement + // deletes all tag associates for images that no longer exist + global $wpdb; + $wpdb->query("\n\t\t\t\t\tDELETE wptr.* FROM {$wpdb->term_relationships} wptr\n\t\t\t\t\tINNER JOIN {$wpdb->term_taxonomy} wptt\n\t\t\t\t\tON wptt.term_taxonomy_id = wptr.term_taxonomy_id\n\t\t\t\t\tWHERE wptt.term_taxonomy_id = wptr.term_taxonomy_id\n\t\t\t\t\tAND wptt.taxonomy = 'ngg_tag'\n\t\t\t\t\tAND wptr.object_id NOT IN (SELECT {$image_key} FROM {$image_table})"); + } + $retval = $this->call_parent('destroy', $gallery); + if ($retval) { + do_action('ngg_delete_gallery', $gallery); + C_Photocrati_Transient_Manager::flush('displayed_gallery_rendering'); + } + } + return $retval; + } + public function set_preview_image($gallery, $image, $only_if_empty = FALSE) + { + $retval = FALSE; + // We need the gallery object + if (is_numeric($gallery)) { + $gallery = $this->object->find($gallery); + } + // We need the image id + if (!is_numeric($image)) { + if (method_exists($image, 'id')) { + $image = $image->id(); + } else { + $image = $image->{$image->id_field}; + } + } + if ($gallery && $image) { + if ($only_if_empty && !$gallery->previewpic or !$only_if_empty) { + $gallery->previewpic = $image; + $retval = $this->object->save($gallery); + } + } + return $retval; + } + /** + * Sets default values for the gallery + */ + public function set_defaults($entity) + { + // If author is missing, then set to the current user id + // TODO: Using wordpress function. Should use abstraction + $this->object->_set_default_value($entity, 'author', get_current_user_id()); + } +} +class GalleryStorageDriverNotSelectedException extends RuntimeException +{ + public function __construct($message = '', $code = NULL, $previous = NULL) + { + if (!$message) { + $message = 'No gallery storage driver selected.'; + } + parent::__construct($message, $code, $previous); + } +} +class Mixin_GalleryStorage extends Mixin +{ + /** + * Returns the name of the class which provides the gallerystorage + * implementation + * @return string + */ + public function _get_driver_factory_method($context = FALSE) + { + $factory_method = ''; + // No constant has been defined to establish a global gallerystorage driver + if (!defined('GALLERYSTORAGE_DRIVER')) { + // Get the datamapper configured in the database + $factory_method = C_NextGen_Settings::get_instance()->gallerystorage_driver; + // Define a constant and use this as the global gallerystorage driver, + // unless running in a SimpleTest Environment + if (!isset($GLOBALS['SIMPLE_TEST_RUNNING'])) { + define('GALLERYSTORAGE_DRIVER', $factory_method); + } + } else { + $factory_method = GALLERYSTORAGE_DRIVER; + } + return $factory_method; + } +} +class C_GalleryStorage_Base extends C_Component +{ + /** + * Gets the url or path of an image of a particular size + * @param string $method + * @param array $args + */ + public function __call($method, $args) + { + if (preg_match('/^get_(\\w+)_(abspath|url|dimensions|html|size_params)$/', $method, $match)) { + if (isset($match[1]) && isset($match[2]) && !$this->has_method($method)) { + $method = 'get_image_' . $match[2]; + $args[] = $match[1]; + // array($image, $size) + return parent::__call($method, $args); + } + } + return parent::__call($method, $args); + } +} +class C_Gallery_Storage extends C_GalleryStorage_Base +{ + public static $_instances = array(); + public function define($object_name, $context = FALSE) + { + parent::define($context); + $this->add_mixin('Mixin_GalleryStorage'); + $this->wrap('I_GalleryStorage_Driver', array(&$this, '_get_driver'), array($object_name, $context)); + $this->implement('I_Gallery_Storage'); + } + static function get_instance($context = False) + { + if (!isset(self::$_instances[$context])) { + self::$_instances[$context] = new C_Gallery_Storage($context); + } + return self::$_instances[$context]; + } + /** + * Returns the implementation for the gallerystorage + * @param array $args + * @return mixed + */ + public function _get_driver($args) + { + $object_name = $args[0]; + $context = $args[1]; + $factory_method = $this->_get_driver_factory_method($context); + $factory = C_Component_Factory::get_instance(); + return $factory->create($factory_method, $object_name, $context); + } +} +class E_UploadException extends E_NggErrorException +{ + public function __construct($message = '', $code = NULL, $previous = NULL) + { + if (!$message) { + $message = 'There was a problem uploading the file.'; + } + if (PHP_VERSION_ID >= 50300) { + parent::__construct($message, $code, $previous); + } else { + parent::__construct($message, $code); + } + } +} +class E_InsufficientWriteAccessException extends E_NggErrorException +{ + public function __construct($message = FALSE, $filename = NULL, $code = NULL, $previous = NULL) + { + if (!$message) { + $message = 'Could not write to file. Please check filesystem permissions.'; + } + if ($filename) { + $message .= " Filename: {$filename}"; + } + if (PHP_VERSION_ID >= 50300) { + parent::__construct($message, $code, $previous); + } else { + parent::__construct($message, $code); + } + } +} +class E_NoSpaceAvailableException extends E_NggErrorException +{ + public function __construct($message = '', $code = NULL, $previous = NULL) + { + if (!$message) { + $message = 'You have exceeded your storage capacity. Please remove some files and try again.'; + } + if (PHP_VERSION_ID >= 50300) { + parent::__construct($message, $code, $previous); + } else { + parent::__construct($message, $code); + } + } +} +class E_No_Image_Library_Exception extends E_NggErrorException +{ + public function __construct($message = '', $code = NULL, $previous = NULL) + { + if (!$message) { + $message = 'The site does not support the GD Image library. Please ask your hosting provider to enable it.'; + } + if (PHP_VERSION_ID >= 50300) { + parent::__construct($message, $code, $previous); + } else { + parent::__construct($message, $code); + } + } +} +class Mixin_GalleryStorage_Driver_Base extends Mixin +{ + /** + * Set correct file permissions (taken from wp core). Should be called + * after writing any file + * + * @class nggAdmin + * @param string $filename + * @return bool $result + */ + public function _chmod($filename = '') + { + $stat = @stat(dirname($filename)); + $perms = $stat['mode'] & 438; + // Remove execute bits for files + if (@chmod($filename, $perms)) { + return TRUE; + } + return FALSE; + } + /** + * Gets the id of a gallery, regardless of whether an integer + * or object was passed as an argument + * @param mixed $gallery_obj_or_id + */ + public function _get_gallery_id($gallery_obj_or_id) + { + $retval = NULL; + $gallery_key = $this->object->_gallery_mapper->get_primary_key_column(); + if (is_object($gallery_obj_or_id)) { + if (isset($gallery_obj_or_id->{$gallery_key})) { + $retval = $gallery_obj_or_id->{$gallery_key}; + } + } elseif (is_numeric($gallery_obj_or_id)) { + $retval = $gallery_obj_or_id; + } + return $retval; + } + /** + * Gets the id of an image, regardless of whether an integer + * or object was passed as an argument + * @param type $image_obj_or_id + */ + public function _get_image_id($image_obj_or_id) + { + $retval = NULL; + $image_key = $this->object->_image_mapper->get_primary_key_column(); + if (is_object($image_obj_or_id)) { + if (isset($image_obj_or_id->{$image_key})) { + $retval = $image_obj_or_id->{$image_key}; + } + } elseif (is_numeric($image_obj_or_id)) { + $retval = $image_obj_or_id; + } + return $retval; + } + public function convert_slashes($path) + { + $search = array('/', '\\'); + $replace = array(DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR); + return str_replace($search, $replace, $path); + } + public function delete_directory($abspath) + { + $retval = FALSE; + if (@file_exists($abspath)) { + $files = scandir($abspath); + array_shift($files); + array_shift($files); + foreach ($files as $file) { + $file_abspath = implode(DIRECTORY_SEPARATOR, array(rtrim($abspath, '/\\'), $file)); + if (is_dir($file_abspath)) { + $this->object->delete_directory($file_abspath); + } else { + unlink($file_abspath); + } + } + rmdir($abspath); + $retval = @file_exists($abspath); + } + return $retval; + } + /** + * Backs up an image file + * + * @param int|object $image + */ + public function backup_image($image) + { + $retval = FALSE; + $image_path = $this->object->get_image_abspath($image); + if ($image_path && @file_exists($image_path)) { + $retval = copy($image_path, $this->object->get_backup_abspath($image)); + // Store the dimensions of the image + if (function_exists('getimagesize')) { + $mapper = C_Image_Mapper::get_instance(); + if (!is_object($image)) { + $image = $mapper->find($image); + } + if ($image) { + if (!property_exists($image, 'meta_data')) { + $image->meta_data = array(); + } + $dimensions = getimagesize($image_path); + $image->meta_data['backup'] = array('filename' => basename($image_path), 'width' => $dimensions[0], 'height' => $dimensions[1], 'generated' => microtime()); + $mapper->save($image); + } + } + } + return $retval; + } + /** + * Copies images into another gallery + * @param array $images + * @param int|object $gallery + * @param boolean $db optionally only copy the image files + * @param boolean $move move the image instead of copying + */ + public function copy_images($images, $gallery, $db = TRUE, $move = FALSE) + { + $retval = FALSE; + // Ensure we have a valid gallery + if ($gallery = $this->object->_get_gallery_id($gallery)) { + $gallery_path = $this->object->get_gallery_abspath($gallery); + $image_key = $this->object->_image_mapper->get_primary_key_column(); + $retval = TRUE; + // Iterate through each image to copy... + foreach ($images as $image) { + // Copy each image size + foreach ($this->object->get_image_sizes() as $size) { + $image_path = $this->object->get_image_abspath($image, $size); + $dst = implode(DIRECTORY_SEPARATOR, array($gallery_path, M_I18n::mb_basename($image_path))); + $success = $move ? move($image_path, $dst) : copy($image_path, $dst); + if (!$success) { + $retval = FALSE; + } + } + // Copy the db entry + if ($db) { + if (is_numeric($image)) { + $this->object->_image_mapper($image); + } + unset($image->{$image_key}); + $image->galleryid = $gallery; + } + } + } + return $retval; + } + /** + * Empties the gallery cache directory of content + */ + public function flush_cache($gallery) + { + $cache = C_Cache::get_instance(); + $cache->flush_directory($this->object->get_cache_abspath($gallery)); + } + /** + * Gets the absolute path of the backup of an original image + * @param string $image + */ + public function get_backup_abspath($image) + { + $retval = null; + if ($image_path = $this->object->get_image_abspath($image)) { + $retval = $image_path . '_backup'; + } + return $retval; + } + public function get_backup_dimensions($image) + { + return $this->object->get_image_dimensions($image, 'backup'); + } + public function get_backup_url($image) + { + return $this->object->get_image_url($image, 'backup'); + } + /** + * Returns the absolute path to the cache directory of a gallery. + * + * Without the gallery parameter the legacy (pre 2.0) shared directory is returned. + * + * @param int|stdClass|C_Gallery $gallery (optional) + * @return string Absolute path to cache directory + */ + public function get_cache_abspath($gallery = FALSE) + { + $retval = NULL; + if (FALSE == $gallery) { + $gallerypath = C_NextGen_Settings::get_instance()->gallerypath; + $retval = implode(DIRECTORY_SEPARATOR, array(rtrim(C_Fs::get_instance()->get_document_root('gallery'), '/\\'), rtrim($gallerypath, '/\\'), 'cache')); + } else { + if (is_numeric($gallery)) { + $gallery = $this->object->_gallery_mapper->find($gallery); + } + $retval = rtrim(implode(DIRECTORY_SEPARATOR, array($this->object->get_gallery_abspath($gallery), 'dynamic')), '/\\'); + } + return $retval; + } + /** + * Gets the absolute path where the full-sized image is stored + * @param int|object $image + */ + public function get_full_abspath($image) + { + return $this->object->get_image_abspath($image, 'full'); + } + /** + * Alias to get_image_dimensions() + * @param int|object $image + * @return array + */ + public function get_full_dimensions($image) + { + return $this->object->get_image_dimensions($image, 'full'); + } + /** + * Alias to get_image_html() + * @param int|object $image + * @return string + */ + public function get_full_html($image) + { + return $this->object->get_image_html($image, 'full'); + } + /** + * Alias for get_original_url() + * + * @param int|stdClass|C_Image $image + * @return string + */ + public function get_full_url($image, $check_existance = FALSE) + { + return $this->object->get_image_url($image, 'full', $check_existance); + } + /** + * Gets the dimensions for a particular-sized image + * + * @param int|object $image + * @param string $size + * @return array + */ + public function get_image_dimensions($image, $size = 'full') + { + $retval = NULL; + // If an image id was provided, get the entity + if (is_numeric($image)) { + $image = $this->object->_image_mapper->find($image); + } + // Ensure we have a valid image + if ($image) { + // Adjust size parameter + switch ($size) { + case 'original': + $size = 'full'; + break; + case 'thumbnails': + case 'thumbnail': + case 'thumb': + case 'thumbs': + $size = 'thumbnail'; + break; + } + // Image dimensions are stored in the $image->meta_data + // property for all implementations + if (isset($image->meta_data) && isset($image->meta_data[$size])) { + $retval = $image->meta_data[$size]; + } else { + $abspath = $this->object->get_image_abspath($image, $size); + if (@file_exists($abspath)) { + $dims = getimagesize($abspath); + if ($dims) { + $retval['width'] = $dims[0]; + $retval['height'] = $dims[1]; + } + } elseif ($size == 'backup') { + $retval = $this->object->get_image_dimensions($image, 'full'); + } + } + } + return $retval; + } + /** + * Gets the HTML for an image + * @param int|object $image + * @param string $size + * @return string + */ + public function get_image_html($image, $size = 'full', $attributes = array()) + { + $retval = ''; + if (is_numeric($image)) { + $image = $this->object->_image_mapper->find($image); + } + if ($image) { + // Set alt text if not already specified + if (!isset($attributes['alttext'])) { + $attributes['alt'] = esc_attr($image->alttext); + } + // Set the title if not already set + if (!isset($attributes['title'])) { + $attributes['title'] = esc_attr($image->alttext); + } + // Set the dimensions if not set already + if (!isset($attributes['width']) or !isset($attributes['height'])) { + $dimensions = $this->object->get_image_dimensions($image, $size); + if (!isset($attributes['width'])) { + $attributes['width'] = $dimensions['width']; + } + if (!isset($attributes['height'])) { + $attributes['height'] = $dimensions['height']; + } + } + // Set the url if not already specified + if (!isset($attributes['src'])) { + $attributes['src'] = $this->object->get_image_url($image, $size); + } + // Format attributes + $attribs = array(); + foreach ($attributes as $attrib => $value) { + $attribs[] = "{$attrib}=\"{$value}\""; + } + $attribs = implode(' ', $attribs); + // Return HTML string + $retval = "<img {$attribs} />"; + } + return $retval; + } + /** + * An alias for get_full_abspath() + * @param int|object $image + */ + public function get_original_abspath($image, $check_existance = FALSE) + { + return $this->object->get_image_abspath($image, 'full', $check_existance); + } + /** + * Alias to get_image_dimensions() + * @param int|object $image + * @return array + */ + public function get_original_dimensions($image) + { + return $this->object->get_image_dimensions($image, 'full'); + } + /** + * Alias to get_image_html() + * @param int|object $image + * @return string + */ + public function get_original_html($image) + { + return $this->object->get_image_html($image, 'full'); + } + /** + * Gets the url to the original-sized image + * @param int|stdClass|C_Image $image + * @return string + */ + public function get_original_url($image, $check_existance = FALSE) + { + return $this->object->get_image_url($image, 'full', $check_existance); + } + /** + * Gets the upload path, optionally for a particular gallery + * @param int|C_Gallery|stdClass $gallery + */ + public function get_upload_relpath($gallery = FALSE) + { + $fs = C_Fs::get_instance(); + $retval = str_replace($fs->get_document_root('gallery'), '', $this->object->get_upload_abspath($gallery)); + return DIRECTORY_SEPARATOR . ltrim($retval, '/\\'); + } + /** + * Moves images from to another gallery + * @param array $images + * @param int|object $gallery + * @param boolean $db optionally only move the image files, not the db entries + * @return boolean + */ + public function move_images($images, $gallery, $db = TRUE) + { + return $this->object->copy_images($images, $gallery, $db, TRUE); + } + public function is_image_file($filename = NULL) + { + $retval = FALSE; + if (!$filename && isset($_FILES['file']) && $_FILES['file']['error'] == 0) { + $filename = $_FILES['file']['tmp_name']; + } + $valid_types = array('image/gif', 'image/jpg', 'image/jpeg', 'image/pjpeg', 'image/png'); + // If we can, we'll verify the mime type + if (function_exists('exif_imagetype')) { + if (($image_type = @exif_imagetype($filename)) !== FALSE) { + $retval = in_array(image_type_to_mime_type($image_type), $valid_types); + } + } else { + $file_info = @getimagesize($filename); + if (isset($file_info[2])) { + $retval = in_array(image_type_to_mime_type($file_info[2]), $valid_types); + } + } + return $retval; + } + public function is_zip() + { + $retval = FALSE; + if (isset($_FILES['file']) && $_FILES['file']['error'] == 0) { + $file_info = $_FILES['file']; + if (isset($file_info['type'])) { + $type = $file_info['type']; + $type_parts = explode('/', $type); + if (strtolower($type_parts[0]) == 'application') { + $spec = $type_parts[1]; + $spec_parts = explode('-', $spec); + $spec_parts = array_map('strtolower', $spec_parts); + if (in_array($spec, array('zip', 'octet-stream')) || in_array('zip', $spec_parts)) { + $retval = true; + } + } + } + } + return $retval; + } + public function upload_zip($gallery_id) + { + $memory_limit = intval(ini_get('memory_limit')); + if (!extension_loaded('suhosin') && $memory_limit < 256) { + @ini_set('memory_limit', '256M'); + } + $retval = FALSE; + if ($this->object->is_zip()) { + $fs = C_Fs::get_instance(); + // Uses the WordPress ZIP abstraction API + include_once $fs->join_paths(ABSPATH, 'wp-admin', 'includes', 'file.php'); + WP_Filesystem(); + // Ensure that we truly have the gallery id + $gallery_id = $this->_get_gallery_id($gallery_id); + $zipfile = $_FILES['file']['tmp_name']; + $dest_path = implode(DIRECTORY_SEPARATOR, array(rtrim(get_temp_dir(), '/\\'), 'unpacked-' . M_I18n::mb_basename($zipfile))); + wp_mkdir_p($dest_path); + if (unzip_file($zipfile, $dest_path) === TRUE) { + $dest_dir = $dest_path . DIRECTORY_SEPARATOR; + $files = glob($dest_dir . '*'); + $size = 0; + foreach ($files as $file) { + if (is_file($dest_dir . $file)) { + $size += filesize($dest_dir . $file); + } + } + if ($size == 0) { + $this->object->delete_directory($dest_path); + $destination = wp_upload_dir(); + $destination_path = $destination['basedir']; + $dest_path = implode(DIRECTORY_SEPARATOR, array(rtrim($destination_path, '/\\'), 'unpacked-' . M_I18n::mb_basename($zipfile))); + wp_mkdir_p($dest_path); + if (unzip_file($zipfile, $dest_path) === TRUE) { + $retval = $this->object->import_gallery_from_fs($dest_path, $gallery_id); + } + } else { + $retval = $this->object->import_gallery_from_fs($dest_path, $gallery_id); + } + } + $this->object->delete_directory($dest_path); + } + if (!extension_loaded('suhosin')) { + @ini_set('memory_limit', $memory_limit . 'M'); + } + return $retval; + } + public function is_current_user_over_quota() + { + $retval = FALSE; + $settings = C_NextGen_Settings::get_instance(); + if (is_multisite() && $settings->get('wpmuQuotaCheck')) { + require_once ABSPATH . 'wp-admin/includes/ms.php'; + $retval = upload_is_user_over_quota(FALSE); + } + return $retval; + } + /** + * Uploads base64 file to a gallery + * @param int|stdClass|C_Gallery $gallery + * @param $data base64-encoded string of data representing the image + * @param type $filename specifies the name of the file + * @return C_Image + */ + public function upload_base64_image($gallery, $data, $filename = FALSE, $image_id = FALSE, $override = FALSE) + { + $settings = C_NextGen_Settings::get_instance(); + $memory_limit = intval(ini_get('memory_limit')); + if (!extension_loaded('suhosin') && $memory_limit < 256) { + @ini_set('memory_limit', '256M'); + } + $retval = NULL; + if ($gallery_id = $this->object->_get_gallery_id($gallery)) { + if ($this->object->is_current_user_over_quota()) { + $message = sprintf(__('Sorry, you have used your space allocation. Please delete some files to upload more files.', 'nggallery')); + throw new E_NoSpaceAvailableException($message); + } + // Get path information. The use of get_upload_abspath() might + // not be the best for some drivers. For example, if using the + // WordPress Media Library for uploading, then the wp_upload_bits() + // function should perhaps be used + $upload_dir = $this->object->get_upload_abspath($gallery); + // Perhaps a filename was given instead of base64 data? + if (preg_match('#/\\\\#', $data[0]) && @file_exists($data)) { + if (!$filename) { + $filename = M_I18n::mb_basename($data); + } + $data = file_get_contents($data); + } + // Determine filenames + $original_filename = $filename; + $filename = $filename ? sanitize_file_name($original_filename) : uniqid('nextgen-gallery'); + if (preg_match('/\\-(png|jpg|gif|jpeg)$/i', $filename, $match)) { + $filename = str_replace($match[0], '.' . $match[1], $filename); + } + $abs_filename = implode(DIRECTORY_SEPARATOR, array($upload_dir, $filename)); + // Prevent duplicate filenames: check if the filename exists and + // begin appending '-i' until we find an open slot + if (!ini_get('safe_mode') && @file_exists($abs_filename) && !$override) { + $file_exists = TRUE; + $i = 0; + do { + $i++; + $parts = explode('.', $filename); + $extension = array_pop($parts); + $new_filename = implode('.', $parts) . '-' . $i . '.' . $extension; + $new_abs_filename = implode(DIRECTORY_SEPARATOR, array($upload_dir, $new_filename)); + if (!@file_exists($new_abs_filename)) { + $file_exists = FALSE; + $filename = $new_filename; + $abs_filename = $new_abs_filename; + } + } while ($file_exists == TRUE); + } + // Create or retrieve the image object + $image = NULL; + if ($image_id) { + $image = $this->object->_image_mapper->find($image_id, TRUE); + unset($image->meta_data['saved']); + } + if (!$image) { + $image = $this->object->_image_mapper->create(); + } + $retval = $image; + // Create or update the database record + $image->alttext = str_replace('.' . M_I18n::mb_pathinfo($original_filename, PATHINFO_EXTENSION), '', M_I18n::mb_basename($original_filename)); + $image->galleryid = $this->object->_get_gallery_id($gallery); + $image->filename = $filename; + $image->image_slug = nggdb::get_unique_slug(sanitize_title_with_dashes($image->alttext), 'image'); + $image_key = $this->object->_image_mapper->get_primary_key_column(); + // If we can't write to the directory, then there's no point in continuing + if (!@file_exists($upload_dir)) { + @wp_mkdir_p($upload_dir); + } + if (!is_writable($upload_dir)) { + throw new E_InsufficientWriteAccessException(FALSE, $upload_dir, FALSE); + } + // Save the image + if ($image_id = $this->object->_image_mapper->save($image)) { + try { + // Try writing the image + $fp = fopen($abs_filename, 'w'); + fwrite($fp, $data); + fclose($fp); + if ($settings->imgBackup) { + $this->object->backup_image($image); + } + if ($settings->imgAutoResize) { + $this->object->generate_image_clone($abs_filename, $abs_filename, $this->object->get_image_size_params($image_id, 'full')); + } + // Ensure that fullsize dimensions are added to metadata array + $dimensions = getimagesize($abs_filename); + $full_meta = array('width' => $dimensions[0], 'height' => $dimensions[1]); + if (!isset($image->meta_data) or is_string($image->meta_data) && strlen($image->meta_data) == 0) { + $image->meta_data = array(); + } + $image->meta_data = array_merge($image->meta_data, $full_meta); + $image->meta_data['full'] = $full_meta; + // Generate a thumbnail for the image + $this->object->generate_thumbnail($image); + // Set gallery preview image if missing + C_Gallery_Mapper::get_instance()->set_preview_image($gallery, $image_id, TRUE); + // Notify other plugins that an image has been added + do_action('ngg_added_new_image', $image); + // delete dirsize after adding new images + delete_transient('dirsize_cache'); + // Seems redundant to above hook. Maintaining for legacy purposes + do_action('ngg_after_new_images_added', $gallery_id, array($image->{$image_key})); + } catch (E_No_Image_Library_Exception $ex) { + throw $ex; + } catch (E_Clean_Exit $ex) { + } catch (Exception $ex) { + throw new E_InsufficientWriteAccessException(FALSE, $abs_filename, FALSE, $ex); + } + } else { + throw new E_InvalidEntityException(); + } + } else { + throw new E_EntityNotFoundException(); + } + if (!extension_loaded('suhosin')) { + @ini_set('memory_limit', $memory_limit . 'M'); + } + return $retval; + } + public function import_gallery_from_fs($abspath, $gallery_id = FALSE, $move_files = TRUE) + { + $retval = FALSE; + if (@file_exists($abspath)) { + $fs = C_Fs::get_instance(); + // Ensure that this folder has images + $files_all = scandir($abspath); + $files = array(); + // first perform some filtering on file list + foreach ($files_all as $file) { + if ($file == '.' || $file == '..') { + continue; + } + if ($this->object->is_image_file($fs->join_paths($abspath, $file))) { + $files[] = $file; + } + } + if (!empty($files)) { + // Get needed utilities + $gallery_mapper = C_Gallery_Mapper::get_instance(); + // Sometimes users try importing a directory, which actually has all images under another directory + $first_file_abspath = $fs->join_paths($abspath, $files[0]); + if (is_dir($first_file_abspath) && count($files) == 1) { + return $this->import_gallery_from_fs($first_file_abspath, $gallery_id, $move_files); + } + // If no gallery has been specified, then use the directory name as the gallery name + if (!$gallery_id) { + // Create the gallery + $gallery = $gallery_mapper->create(array('title' => M_I18n::mb_basename($abspath))); + if (!$move_files) { + $gallery->path = str_ireplace(ABSPATH, '', $abspath); + } + // Save the gallery + if ($gallery->save()) { + $gallery_id = $gallery->id(); + } + } + // Ensure that we have a gallery id + if ($gallery_id) { + $retval = array('gallery_id' => $gallery_id, 'image_ids' => array()); + foreach ($files as $file) { + if (!preg_match('/\\.(jpg|jpeg|gif|png)$/i', $file)) { + continue; + } + $file_abspath = $fs->join_paths($abspath, $file); + $image = null; + if ($move_files) { + $image = $this->object->upload_base64_image($gallery_id, file_get_contents($file_abspath), str_replace(' ', '_', $file)); + } else { + // Create the database record ... TODO cleanup, some duplication here from upload_base64_image + $factory = C_Component_Factory::get_instance(); + $image = $factory->create('image'); + $image->alttext = sanitize_title_with_dashes(str_replace('.' . M_I18n::mb_pathinfo($file_abspath, PATHINFO_EXTENSION), '', M_I18n::mb_basename($file_abspath))); + $image->galleryid = $this->object->_get_gallery_id($gallery_id); + $image->filename = M_I18n::mb_basename($file_abspath); + $image->image_slug = nggdb::get_unique_slug(sanitize_title_with_dashes($image->alttext), 'image'); + $image_key = $this->object->_image_mapper->get_primary_key_column(); + $abs_filename = $file_abspath; + if ($image_id = $this->object->_image_mapper->save($image)) { + try { + if (C_NextGen_settings::get_instance()->imgBackup) { + $this->object->backup_image($image); + } + # if ($settings->imgAutoResize) + # $this->object->generate_image_clone( + # $abs_filename, + # $abs_filename, + # $this->object->get_image_size_params($image_id, 'full') + # ); + // Ensure that fullsize dimensions are added to metadata array + $dimensions = getimagesize($abs_filename); + $full_meta = array('width' => $dimensions[0], 'height' => $dimensions[1]); + if (!isset($image->meta_data) or is_string($image->meta_data) && strlen($image->meta_data) == 0) { + $image->meta_data = array(); + } + $image->meta_data = array_merge($image->meta_data, $full_meta); + $image->meta_data['full'] = $full_meta; + // Generate a thumbnail for the image + $this->object->generate_thumbnail($image); + // Set gallery preview image if missing + C_Gallery_Mapper::get_instance()->set_preview_image($gallery, $image_id, TRUE); + // Notify other plugins that an image has been added + do_action('ngg_added_new_image', $image); + // delete dirsize after adding new images + delete_transient('dirsize_cache'); + // Seems redundant to above hook. Maintaining for legacy purposes + do_action('ngg_after_new_images_added', $gallery_id, array($image->{$image_key})); + } catch (Exception $ex) { + throw new E_InsufficientWriteAccessException(FALSE, $abs_filename, FALSE, $ex); + } + } else { + throw new E_InvalidEntityException(); + } + } + $retval['image_ids'][] = $image->{$image->id_field}; + } + // Add the gallery name to the result + $gallery = $gallery_mapper->find($gallery_id); + $retval['gallery_name'] = $gallery->title; + unset($gallery); + } + } + } + return $retval; + } + public function get_image_format_list() + { + $format_list = array(IMAGETYPE_GIF => 'gif', IMAGETYPE_JPEG => 'jpg', IMAGETYPE_PNG => 'png'); + return $format_list; + } + /** + * Returns an array of properties of a resulting clone image if and when generated + * @param string $image_path + * @param string $clone_path + * @param array $params + * @return array + */ + public function calculate_image_clone_result($image_path, $clone_path, $params) + { + $width = isset($params['width']) ? $params['width'] : NULL; + $height = isset($params['height']) ? $params['height'] : NULL; + $quality = isset($params['quality']) ? $params['quality'] : NULL; + $type = isset($params['type']) ? $params['type'] : NULL; + $crop = isset($params['crop']) ? $params['crop'] : NULL; + $watermark = isset($params['watermark']) ? $params['watermark'] : NULL; + $rotation = isset($params['rotation']) ? $params['rotation'] : NULL; + $reflection = isset($params['reflection']) ? $params['reflection'] : NULL; + $crop_frame = isset($params['crop_frame']) ? $params['crop_frame'] : NULL; + $result = NULL; + // Ensure we have a valid image + if ($image_path && @file_exists($image_path)) { + // Ensure target directory exists, but only create 1 subdirectory + $image_dir = dirname($image_path); + $clone_dir = dirname($clone_path); + $image_extension = M_I18n::mb_pathinfo($image_path, PATHINFO_EXTENSION); + $image_extension_str = null; + $clone_extension = M_I18n::mb_pathinfo($clone_path, PATHINFO_EXTENSION); + $clone_extension_str = null; + if ($image_extension != null) { + $image_extension_str = '.' . $image_extension; + } + if ($clone_extension != null) { + $clone_extension_str = '.' . $clone_extension; + } + $image_basename = M_I18n::mb_basename($image_path, $image_extension_str); + $clone_basename = M_I18n::mb_basename($clone_path, $clone_extension_str); + // We use a default suffix as passing in null as the suffix will make WordPress use a default + $clone_suffix = null; + $format_list = $this->object->get_image_format_list(); + $clone_format = null; + // format is determined below and based on $type otherwise left to null + // suffix is only used to reconstruct paths for image_resize function + if (strpos($clone_basename, $image_basename) === 0) { + $clone_suffix = substr($clone_basename, strlen($image_basename)); + } + if ($clone_suffix != null && $clone_suffix[0] == '-') { + // WordPress adds '-' on its own + $clone_suffix = substr($clone_suffix, 1); + } + // Get original image dimensions + $dimensions = getimagesize($image_path); + if ($width == null && $height == null) { + if ($dimensions != null) { + if ($width == null) { + $width = $dimensions[0]; + } + if ($height == null) { + $height = $dimensions[1]; + } + } else { + // XXX Don't think there's any other option here but to fail miserably...use some hard-coded defaults maybe? + return null; + } + } + if ($dimensions != null) { + $dimensions_ratio = $dimensions[0] / $dimensions[1]; + if ($width == null) { + $width = (int) round($height * $dimensions_ratio); + if ($width == $dimensions[0] - 1) { + $width = $dimensions[0]; + } + } else { + if ($height == null) { + $height = (int) round($width / $dimensions_ratio); + if ($height == $dimensions[1] - 1) { + $height = $dimensions[1]; + } + } + } + if ($width > $dimensions[0]) { + $width = $dimensions[0]; + } + if ($height > $dimensions[1]) { + $height = $dimensions[1]; + } + $image_format = $dimensions[2]; + if ($type != null) { + if (is_string($type)) { + $type = strtolower($type); + // Indexes in the $format_list array correspond to IMAGETYPE_XXX values appropriately + if (($index = array_search($type, $format_list)) !== false) { + $type = $index; + if ($type != $image_format) { + // Note: this only changes the FORMAT of the image but not the extension + $clone_format = $type; + } + } + } + } + } + if ($width == null || $height == null) { + // Something went wrong... + return null; + } + $result['clone_path'] = $clone_path; + $result['clone_directory'] = $clone_dir; + $result['clone_suffix'] = $clone_suffix; + $result['clone_format'] = $clone_format; + $result['base_width'] = $dimensions[0]; + $result['base_height'] = $dimensions[1]; + // image_resize() has limitations: + // - no easy crop frame support + // - fails if the dimensions are unchanged + // - doesn't support filename prefix, only suffix so names like thumbs_original_name.jpg for $clone_path are not supported + // also suffix cannot be null as that will make WordPress use a default suffix...we could use an object that returns empty string from __toString() but for now just fallback to ngg generator + if (FALSE) { + // disabling the WordPress method for Iteration #6 + // if (($crop_frame == null || !$crop) && ($dimensions[0] != $width && $dimensions[1] != $height) && $clone_suffix != null) + $result['method'] = 'wordpress'; + $new_dims = image_resize_dimensions($dimensions[0], $dimensions[1], $width, $height, $crop); + if ($new_dims) { + list($dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h) = $new_dims; + $width = $dst_w; + $height = $dst_h; + } else { + $result['error'] = new WP_Error('error_getting_dimensions', __('Could not calculate resized image dimensions')); + } + } else { + $result['method'] = 'nextgen'; + $original_width = $dimensions[0]; + $original_height = $dimensions[1]; + $aspect_ratio = $width / $height; + $orig_ratio_x = $original_width / $width; + $orig_ratio_y = $original_height / $height; + if ($crop) { + $algo = 'shrink'; + // either 'adapt' or 'shrink' + if ($crop_frame != null) { + $crop_x = (int) round($crop_frame['x']); + $crop_y = (int) round($crop_frame['y']); + $crop_width = (int) round($crop_frame['width']); + $crop_height = (int) round($crop_frame['height']); + $crop_final_width = (int) round($crop_frame['final_width']); + $crop_final_height = (int) round($crop_frame['final_height']); + $crop_width_orig = $crop_width; + $crop_height_orig = $crop_height; + $crop_factor_x = $crop_width / $crop_final_width; + $crop_factor_y = $crop_height / $crop_final_height; + $crop_ratio_x = $crop_width / $width; + $crop_ratio_y = $crop_height / $height; + if ($algo == 'adapt') { + } else { + if ($algo == 'shrink') { + if ($crop_ratio_x < $crop_ratio_y) { + $crop_width = max($crop_width, $width); + $crop_height = (int) round($crop_width / $aspect_ratio); + } else { + $crop_height = max($crop_height, $height); + $crop_width = (int) round($crop_height * $aspect_ratio); + } + if ($crop_width == $crop_width_orig - 1) { + $crop_width = $crop_width_orig; + } + if ($crop_height == $crop_height_orig - 1) { + $crop_height = $crop_height_orig; + } + } + } + $crop_diff_x = (int) round(($crop_width_orig - $crop_width) / 2); + $crop_diff_y = (int) round(($crop_height_orig - $crop_height) / 2); + $crop_x += $crop_diff_x; + $crop_y += $crop_diff_y; + $crop_max_x = $crop_x + $crop_width; + $crop_max_y = $crop_y + $crop_height; + // Check if we're overflowing borders + // + if ($crop_x < 0) { + $crop_x = 0; + } else { + if ($crop_max_x > $original_width) { + $crop_x -= $crop_max_x - $original_width; + } + } + if ($crop_y < 0) { + $crop_y = 0; + } else { + if ($crop_max_y > $original_height) { + $crop_y -= $crop_max_y - $original_height; + } + } + } else { + if ($orig_ratio_x < $orig_ratio_y) { + $crop_width = $original_width; + $crop_height = (int) round($height * $orig_ratio_x); + } else { + $crop_height = $original_height; + $crop_width = (int) round($width * $orig_ratio_y); + } + if ($crop_width == $width - 1) { + $crop_width = $width; + } + if ($crop_height == $height - 1) { + $crop_height = $height; + } + $crop_x = (int) round(($original_width - $crop_width) / 2); + $crop_y = (int) round(($original_height - $crop_height) / 2); + } + $result['crop_area'] = array('x' => $crop_x, 'y' => $crop_y, 'width' => $crop_width, 'height' => $crop_height); + } else { + // Just constraint dimensions to ensure there's no stretching or deformations + list($width, $height) = wp_constrain_dimensions($original_width, $original_height, $width, $height); + } + } + $result['width'] = $width; + $result['height'] = $height; + $result['quality'] = $quality; + $real_width = $width; + $real_height = $height; + if ($rotation && in_array(abs($rotation), array(90, 270))) { + $real_width = $height; + $real_height = $width; + } + if ($reflection) { + // default for nextgen was 40%, this is used in generate_image_clone as well + $reflection_amount = 40; + // Note, round() would probably be best here but using the same code that C_NggLegacy_Thumbnail uses for compatibility + $reflection_height = intval($real_height * ($reflection_amount / 100)); + $real_height = $real_height + $reflection_height; + } + $result['real_width'] = $real_width; + $result['real_height'] = $real_height; + } + return $result; + } + /** + * Returns an array of dimensional properties (width, height, real_width, real_height) of a resulting clone image if and when generated + * @param string $image_path + * @param string $clone_path + * @param array $params + * @return array + */ + public function calculate_image_clone_dimensions($image_path, $clone_path, $params) + { + $retval = null; + $result = $this->object->calculate_image_clone_result($image_path, $clone_path, $params); + if ($result != null) { + $retval = array('width' => $result['width'], 'height' => $result['height'], 'real_width' => $result['real_width'], 'real_height' => $result['real_height']); + } + return $retval; + } + /** + * Generates a "clone" for an existing image, the clone can be altered using the $params array + * @param string $image_path + * @param string $clone_path + * @param array $params + * @return object + */ + public function generate_image_clone($image_path, $clone_path, $params) + { + $crop = isset($params['crop']) ? $params['crop'] : NULL; + $watermark = isset($params['watermark']) ? $params['watermark'] : NULL; + $reflection = isset($params['reflection']) ? $params['reflection'] : NULL; + $rotation = isset($params['rotation']) ? $params['rotation'] : NULL; + $flip = isset($params['flip']) ? $params['flip'] : NULL; + $destpath = NULL; + $thumbnail = NULL; + $result = $this->object->calculate_image_clone_result($image_path, $clone_path, $params); + // XXX this should maybe be removed and extra settings go into $params? + $settings = C_NextGen_Settings::get_instance(); + // Ensure we have a valid image + if ($image_path && @file_exists($image_path) && $result != null && !isset($result['error'])) { + $image_dir = dirname($image_path); + $clone_path = $result['clone_path']; + $clone_dir = $result['clone_directory']; + $clone_format = $result['clone_format']; + $format_list = $this->object->get_image_format_list(); + // Ensure target directory exists, but only create 1 subdirectory + if (!@file_exists($clone_dir)) { + if (strtolower(realpath($image_dir)) != strtolower(realpath($clone_dir))) { + if (strtolower(realpath($image_dir)) == strtolower(realpath(dirname($clone_dir)))) { + wp_mkdir_p($clone_dir); + } + } + } + $method = $result['method']; + $width = $result['width']; + $height = $result['height']; + $quality = $result['quality']; + if ($quality == null) { + $quality = 100; + } + if ($method == 'wordpress') { + $original = wp_get_image_editor($image_path); + $destpath = $clone_path; + if (!is_wp_error($original)) { + $original->resize($width, $height, $crop); + $original->set_quality($quality); + $original->save($clone_path); + } + } else { + if ($method == 'nextgen') { + $destpath = $clone_path; + $thumbnail = new C_NggLegacy_Thumbnail($image_path, true); + if (!$thumbnail->error) { + if ($crop) { + $crop_area = $result['crop_area']; + $crop_x = $crop_area['x']; + $crop_y = $crop_area['y']; + $crop_width = $crop_area['width']; + $crop_height = $crop_area['height']; + $thumbnail->crop($crop_x, $crop_y, $crop_width, $crop_height); + } + $thumbnail->resize($width, $height); + } else { + $thumbnail = NULL; + } + } + } + // We successfully generated the thumbnail + if (is_string($destpath) && (@file_exists($destpath) || $thumbnail != null)) { + if ($clone_format != null) { + if (isset($format_list[$clone_format])) { + $clone_format_extension = $format_list[$clone_format]; + $clone_format_extension_str = null; + if ($clone_format_extension != null) { + $clone_format_extension_str = '.' . $clone_format_extension; + } + $destpath_info = M_I18n::mb_pathinfo($destpath); + $destpath_extension = $destpath_info['extension']; + if (strtolower($destpath_extension) != strtolower($clone_format_extension)) { + $destpath_dir = $destpath_info['dirname']; + $destpath_basename = $destpath_info['filename']; + $destpath_new = $destpath_dir . DIRECTORY_SEPARATOR . $destpath_basename . $clone_format_extension_str; + if (@file_exists($destpath) && rename($destpath, $destpath_new) || $thumbnail != null) { + $destpath = $destpath_new; + } + } + } + } + if (is_null($thumbnail)) { + $thumbnail = new C_NggLegacy_Thumbnail($destpath, true); + } else { + $thumbnail->fileName = $destpath; + } + // This is quite odd, when watermark equals int(0) it seems all statements below ($watermark == 'image') and ($watermark == 'text') both evaluate as true + // so we set it at null if it evaluates to any null-like value + if ($watermark == null) { + $watermark = null; + } + if ($watermark == 1 || $watermark === true) { + if (in_array(strval($settings->wmType), array('image', 'text'))) { + $watermark = $settings->wmType; + } else { + $watermark = 'text'; + } + } + $watermark = strval($watermark); + if ($watermark == 'image') { + $thumbnail->watermarkImgPath = $settings['wmPath']; + $thumbnail->watermarkImage($settings['wmPos'], $settings['wmXpos'], $settings['wmYpos']); + } else { + if ($watermark == 'text') { + $thumbnail->watermarkText = $settings['wmText']; + $thumbnail->watermarkCreateText($settings['wmColor'], $settings['wmFont'], $settings['wmSize'], $settings['wmOpaque']); + $thumbnail->watermarkImage($settings['wmPos'], $settings['wmXpos'], $settings['wmYpos']); + } + } + if ($rotation && in_array(abs($rotation), array(90, 180, 270))) { + $thumbnail->rotateImageAngle($rotation); + } + $flip = strtolower($flip); + if ($flip && in_array($flip, array('h', 'v', 'hv'))) { + $flip_h = in_array($flip, array('h', 'hv')); + $flip_v = in_array($flip, array('v', 'hv')); + $thumbnail->flipImage($flip_h, $flip_v); + } + if ($reflection) { + $thumbnail->createReflection(40, 40, 50, FALSE, '#a4a4a4'); + } + if ($clone_format != null && isset($format_list[$clone_format])) { + // Force format + $thumbnail->format = strtoupper($format_list[$clone_format]); + } + $thumbnail->save($destpath, $quality); + // IF the original contained IPTC metadata we should attempt to copy it + if (isset($detailed_size['APP13']) && function_exists('iptcembed')) { + $metadata = @iptcembed($detailed_size['APP13'], $destpath); + $fp = @fopen($destpath, 'wb'); + @fwrite($fp, $metadata); + @fclose($fp); + } + } + } + return $thumbnail; + } +} +class C_GalleryStorage_Driver_Base extends C_GalleryStorage_Base +{ + public static $_instances = array(); + public function define($context) + { + parent::define($context); + $this->add_mixin('Mixin_GalleryStorage_Driver_Base'); + $this->implement('I_GalleryStorage_Driver'); + } + public function initialize() + { + parent::initialize(); + $this->_gallery_mapper = C_Gallery_Mapper::get_instance(); + $this->_image_mapper = C_Image_Mapper::get_instance(); + } + public static function get_instance($context = False) + { + if (!isset(self::$_instances[$context])) { + self::$_instances[$context] = new C_GalleryStorage_Driver_Base($context); + } + return self::$_instances[$context]; + } + /** + * Gets the class name of the driver used + * @return string + */ + public function get_driver_class_name() + { + return get_called_class(); + } +} +class Mixin_NextGen_Gallery_Image_Validation extends Mixin +{ + public function validation() + { + $this->validates_presence_of('galleryid', 'filename', 'alttext', 'exclude', 'sortorder', 'imagedate'); + $this->validates_numericality_of('galleryid'); + $this->validates_numericality_of($this->id()); + $this->validates_numericality_of('sortorder'); + return $this->object->is_valid(); + } +} +/** + * Model for NextGen Gallery Images + */ +class C_Image extends C_DataMapper_Model +{ + public $_mapper_interface = 'I_Image_Mapper'; + public function define($properties = array(), $mapper = FALSE, $context = FALSE) + { + parent::define($mapper, $properties, $context); + $this->add_mixin('Mixin_NextGen_Gallery_Image_Validation'); + $this->implement('I_Image'); + } + /** + * Instantiates a new model + * @param array|stdClass $properties + * @param C_DataMapper $mapper + * @param string $context + */ + public function initialize($properties = array(), $mapper = FALSE, $context = FALSE) + { + // Get the mapper is not specified + if (!$mapper) { + $mapper = $this->get_registry()->get_utility($this->_mapper_interface); + } + // Initialize + parent::initialize($mapper, $properties); + } + /** + * Returns the model representing the gallery associated with this image + * @return C_Gallery|stdClass + */ + public function get_gallery($model = FALSE) + { + $gallery_mapper = C_Gallery_Mapper::get_instance(); + return $gallery_mapper->find($this->galleryid, $model); + } +} +class C_Image_Mapper extends C_CustomTable_DataMapper_Driver +{ + public static $_instance = NULL; + /** + * Defines the gallery image mapper + * @param type $context + */ + public function define($context = FALSE, $not_used = FALSE) + { + // Add 'attachment' context + if (!is_array($context)) { + $context = array($context); + } + array_push($context, 'attachment'); + // Define the mapper + $this->_primary_key_column = 'pid'; + parent::define('ngg_pictures', $context); + $this->add_mixin('Mixin_NextGen_Table_Extras'); + $this->add_mixin('Mixin_Gallery_Image_Mapper'); + $this->implement('I_Image_Mapper'); + $this->set_model_factory_method('image'); + // Define the columns + $this->define_column('pid', 'BIGINT', 0); + $this->define_column('image_slug', 'VARCHAR(255)'); + $this->define_column('post_id', 'BIGINT', 0); + $this->define_column('galleryid', 'BIGINT', 0); + $this->define_column('filename', 'VARCHAR(255)'); + $this->define_column('description', 'TEXT'); + $this->define_column('alttext', 'TEXT'); + $this->define_column('imagedate', 'DATETIME'); + $this->define_column('exclude', 'INT', 0); + $this->define_column('sortorder', 'BIGINT', 0); + $this->define_column('meta_data', 'TEXT'); + $this->define_column('extras_post_id', 'BIGINT', 0); + $this->define_column('updated_at', 'BIGINT'); + // Mark the columns which should be unserialized + $this->add_serialized_column('meta_data'); + } + public function initialize($object_name = FALSE) + { + parent::initialize('ngg_pictures'); + } + static function get_instance($context = False) + { + if (is_null(self::$_instance)) { + $klass = get_class(); + self::$_instance = new $klass($context); + } + return self::$_instance; + } +} +/** + * Sets the alttext property as the post title + */ +class Mixin_Gallery_Image_Mapper extends Mixin +{ + public function destroy($image) + { + $retval = $this->call_parent('destroy', $image); + // Delete tag associations with the image + if (!is_numeric($image)) { + $image = $image->{$image->id_field}; + } + wp_delete_object_term_relationships($image, 'ngg_tag'); + C_Photocrati_Transient_Manager::flush('displayed_gallery_rendering'); + return $retval; + } + public function _save_entity($entity) + { + $entity->updated_at = time(); + // If successfully saved, then import metadata and + $retval = $this->call_parent('_save_entity', $entity); + if ($retval) { + include_once NGGALLERY_ABSPATH . '/admin/functions.php'; + $image_id = $this->get_id($entity); + if (!isset($entity->meta_data['saved'])) { + nggAdmin::import_MetaData($image_id); + } + C_Photocrati_Transient_Manager::flush('displayed_gallery_rendering'); + } + return $retval; + } + public function reimport_metadata($image_or_id) + { + // Get the image + $image = NULL; + if (is_int($image_or_id)) { + $image = $this->object->find($image_or_id); + } else { + $image = $image_or_id; + } + // Reset all image details that would have normally been imported + $image->alttext = ''; + $image->description = ''; + if (is_array($image->meta_data)) { + unset($image->meta_data['saved']); + } + wp_delete_object_term_relationships($image->{$image->id_field}, 'ngg_tag'); + nggAdmin::import_MetaData($image); + return $this->object->save($image); + } + /** + * Retrieves the id from an image + * @param $image + * @return bool + */ + public function get_id($image) + { + $retval = FALSE; + // Have we been passed an entity and is the id_field set? + if ($image instanceof stdClass) { + if (isset($image->id_field)) { + $retval = $image->{$image->id_field}; + } + } else { + $retval = $image->id(); + } + // If we still don't have an id, then we'll lookup the primary key + // and try fetching it manually + if (!$retval) { + $key = $this->object->get_primary_key_column(); + $retval = $image->{$key}; + } + return $retval; + } + public function get_post_title($entity) + { + return $entity->alttext; + } + public function set_defaults($entity) + { + // If not set already, we'll add an exclude property. This is used + // by NextGEN Gallery itself, as well as the Attach to Post module + $this->object->_set_default_value($entity, 'exclude', 0); + // Ensure that the object has a description attribute + $this->object->_set_default_value($entity, 'description', ''); + // If not set already, set a default sortorder + $this->object->_set_default_value($entity, 'sortorder', 0); + // The imagedate must be set + if (!isset($entity->imagedate) or is_null($entity->imagedate) or $entity->imagedate == '0000-00-00 00:00:00') { + $entity->imagedate = date('Y-m-d H:i:s'); + } + // If a filename is set, and no alttext is set, then set the alttext + // to the basename of the filename (legacy behavior) + if (isset($entity->filename)) { + $path_parts = M_I18n::mb_pathinfo($entity->filename); + $alttext = !isset($path_parts['filename']) ? substr($path_parts['basename'], 0, strpos($path_parts['basename'], '.')) : $path_parts['filename']; + $this->object->_set_default_value($entity, 'alttext', $alttext); + } + // Set unique slug + if (isset($entity->alttext) && empty($entity->image_slug)) { + $entity->image_slug = nggdb::get_unique_slug(sanitize_title_with_dashes($entity->alttext), 'image'); + } + // Ensure that the exclude parameter is an integer or boolean-evaluated + // value + if (is_string($entity->exclude)) { + $entity->exclude = intval($entity->exclude); + } + // Trim alttext and description + $entity->description = trim($entity->description); + $entity->alttext = trim($entity->alttext); + } + /** + * Finds all images for a gallery + * @param $gallery + * @param bool $model + * + * @return array + */ + public function find_all_for_gallery($gallery, $model = FALSE) + { + $retval = array(); + $gallery_id = 0; + if (is_object($gallery)) { + if (isset($gallery->id_field)) { + $gallery_id = $gallery->{$gallery->id_field}; + } else { + $key = $this->object->get_primary_key_column(); + if (isset($gallery->{$key})) { + $gallery_id = $gallery->{$key}; + } + } + } + if ($gallery_id) { + $retval = $this->object->select()->where(array('galleryid = %s'), $gallery_id)->run_query(FALSE, $model); + } + return $retval; + } +} +/** + * This class provides a lazy-loading wrapper to the NextGen-Legacy "nggImage" class for use in legacy style templates + */ +class C_Image_Wrapper +{ + public $_cache; + // cache of retrieved values + public $_settings; + // I_Settings_Manager cache + public $_storage; + // I_Gallery_Storage cache + public $_galleries; + // cache of I_Gallery_Mapper (plural) + public $_orig_image; + // original provided image + public $_orig_image_id; + // original image ID + public $_cache_overrides; + // allow for forcing variable values + public $_legacy = FALSE; + public $_displayed_gallery; + // cached object + /** + * Constructor. Converts the image class into an array and fills from defaults any missing values + * + * @param object $gallery Individual result from displayed_gallery->get_entities() + * @param object $displayed_gallery Displayed gallery -- MAY BE NULL + * @param bool $legacy Whether the image source is from NextGen Legacy or NextGen + * @return void + */ + public function __construct($image, $displayed_gallery = NULL, $legacy = FALSE) + { + // for clarity + if ($displayed_gallery && isset($displayed_gallery->display_settings['number_of_columns'])) { + $columns = $displayed_gallery->display_settings['number_of_columns']; + } else { + $columns = 0; + } + // Public variables + $defaults = array('errmsg' => '', 'error' => FALSE, 'imageURL' => '', 'thumbURL' => '', 'imagePath' => '', 'thumbPath' => '', 'href' => '', 'thumbPrefix' => 'thumbs_', 'thumbFolder' => '/thumbs/', 'galleryid' => 0, 'pid' => 0, 'filename' => '', 'description' => '', 'alttext' => '', 'imagedate' => '', 'exclude' => '', 'thumbcode' => '', 'name' => '', 'path' => '', 'title' => '', 'pageid' => 0, 'previewpic' => 0, 'style' => $columns > 0 ? 'style="width:' . floor(100 / $columns) . '%;"' : '', 'hidden' => FALSE, 'permalink' => '', 'tags' => ''); + // convert the image to an array and apply the defaults + $this->_orig_image = $image; + $image = (array) $image; + foreach ($defaults as $key => $val) { + if (!isset($image[$key])) { + $image[$key] = $val; + } + } + // cache the results + ksort($image); + $id_field = !empty($image['id_field']) ? $image['id_field'] : 'pid'; + $this->_cache = (array) apply_filters('ngg_image_object', (object) $image, $image[$id_field]); + $this->_orig_image_id = $image[$id_field]; + $this->_legacy = $legacy; + $this->_displayed_gallery = $displayed_gallery; + } + public function __set($name, $value) + { + $this->_cache[$name] = $value; + } + public function __isset($name) + { + return isset($this->_cache[$name]); + } + public function __unset($name) + { + unset($this->_cache[$name]); + } + /** + * Lazy-loader for image variables. + * + * @param string $name Parameter name + * @return mixed + */ + public function __get($name) + { + if (isset($this->_cache_overrides[$name])) { + return $this->_cache_overrides[$name]; + } + // at the bottom we default to returning $this->_cache[$name]. + switch ($name) { + case 'alttext': + $this->_cache['alttext'] = empty($this->_cache['alttext']) ? ' ' : html_entity_decode(stripslashes($this->_cache['alttext'])); + return $this->_cache['alttext']; + case 'author': + $gallery = $this->get_legacy_gallery($this->__get('galleryid')); + $this->_cache['author'] = $gallery->name; + return $this->_cache['author']; + case 'caption': + $caption = html_entity_decode(stripslashes($this->__get('description'))); + if (empty($caption)) { + $caption = ' '; + } + $this->_cache['caption'] = $caption; + return $this->_cache['caption']; + case 'description': + $this->_cache['description'] = empty($this->_cache['description']) ? ' ' : html_entity_decode(stripslashes($this->_cache['description'])); + return $this->_cache['description']; + case 'galdesc': + $gallery = $this->get_legacy_gallery($this->__get('galleryid')); + $this->_cache['galdesc'] = $gallery->name; + return $this->_cache['galdesc']; + case 'gid': + $gallery = $this->get_legacy_gallery($this->__get('galleryid')); + $this->_cache['gid'] = $gallery->{$gallery->id_field}; + return $this->_cache['gid']; + case 'href': + return $this->__get('imageHTML'); + case 'id': + return $this->_orig_image_id; + case 'imageHTML': + $tmp = '<a href="' . $this->__get('imageURL') . '" title="' . htmlspecialchars(stripslashes($this->__get('description'))) . '" ' . $this->get_thumbcode($this->__get('name')) . '>' . '<img alt="' . $this->__get('alttext') . '" src="' . $this->__get('imageURL') . '"/>' . '</a>'; + $this->_cache['href'] = $tmp; + $this->_cache['imageHTML'] = $tmp; + return $this->_cache['imageHTML']; + case 'imagePath': + $storage = $this->get_storage(); + $this->_cache['imagePath'] = $storage->get_image_abspath($this->_orig_image, 'full'); + return $this->_cache['imagePath']; + case 'imageURL': + $storage = $this->get_storage(); + $this->_cache['imageURL'] = $storage->get_image_url($this->_orig_image, 'full'); + return $this->_cache['imageURL']; + case 'linktitle': + $this->_cache['linktitle'] = htmlspecialchars(stripslashes($this->__get('description'))); + return $this->_cache['linktitle']; + case 'name': + $gallery = $this->get_legacy_gallery($this->__get('galleryid')); + $this->_cache['name'] = $gallery->name; + return $this->_cache['name']; + case 'pageid': + $gallery = $this->get_legacy_gallery($this->__get('galleryid')); + $this->_cache['pageid'] = $gallery->name; + return $this->_cache['pageid']; + case 'path': + $gallery = $this->get_legacy_gallery($this->__get('galleryid')); + $this->_cache['path'] = $gallery->name; + return $this->_cache['path']; + case 'permalink': + $this->_cache['permalink'] = $this->__get('imageURL'); + return $this->_cache['permalink']; + case 'pid': + return $this->_orig_image_id; + case 'id_field': + $this->_cache['id_field'] = !empty($this->_orig_image->id_field) ? $this->_orig_image->id_field : 'pid'; + return $this->_cache['id_field']; + case 'pidlink': + $application = C_Router::get_instance()->get_routed_app(); + $controller = C_Display_Type_Controller::get_instance(); + $this->_cache['pidlink'] = $controller->set_param_for($application->get_routed_url(TRUE), 'pid', $this->__get('image_slug')); + return $this->_cache['pidlink']; + case 'previewpic': + $gallery = $this->get_legacy_gallery($this->__get('galleryid')); + $this->_cache['previewpic'] = $gallery->name; + return $this->_cache['previewpic']; + case 'size': + $w = 0; + $h = 0; + if ($this->_displayed_gallery && isset($this->_displayed_gallery->display_settings)) { + $ds = $this->_displayed_gallery->display_settings; + if (isset($ds['override_thumbnail_settings']) && $ds['override_thumbnail_settings']) { + $w = $ds['thumbnail_width']; + $h = $ds['thumbnail_height']; + } + } + if (!$w || !$h) { + if (is_string($this->_orig_image->meta_data)) { + $this->_orig_image = C_Image_Mapper::get_instance()->unserialize($this->_orig_image->meta_data); + } + if (!isset($this->_orig_image->meta_data['thumbnail'])) { + $storage = $this->get_storage(); + $storage->generate_thumbnail($this->_orig_image); + } + $w = $this->_orig_image->meta_data['thumbnail']['width']; + $h = $this->_orig_image->meta_data['thumbnail']['height']; + } + return "width='{$w}' height='{$h}'"; + case 'slug': + $gallery = $this->get_legacy_gallery($this->__get('galleryid')); + $this->_cache['slug'] = $gallery->name; + return $this->_cache['slug']; + case 'tags': + $this->_cache['tags'] = wp_get_object_terms($this->__get('id'), 'ngg_tag', 'fields=all'); + return $this->_cache['tags']; + case 'thumbHTML': + $tmp = '<a href="' . $this->__get('imageURL') . '" title="' . htmlspecialchars(stripslashes($this->__get('description'))) . '" ' . $this->get_thumbcode($this->__get('name')) . '>' . '<img alt="' . $this->__get('alttext') . '" src="' . $this->thumbURL . '"/>' . '</a>'; + $this->_cache['href'] = $tmp; + $this->_cache['thumbHTML'] = $tmp; + return $this->_cache['thumbHTML']; + case 'thumbPath': + $storage = $this->get_storage(); + $this->_cache['thumbPath'] = $storage->get_image_abspath($this->_orig_image, 'thumbnail'); + return $this->_cache['thumbPath']; + case 'thumbnailURL': + $storage = $this->get_storage(); + $thumbnail_size_name = 'thumbnail'; + if ($this->_displayed_gallery && isset($this->_displayed_gallery->display_settings)) { + $ds = $this->_displayed_gallery->display_settings; + if (isset($ds['override_thumbnail_settings']) && $ds['override_thumbnail_settings']) { + $dynthumbs = C_Component_Registry::get_instance()->get_utility('I_Dynamic_Thumbnails_Manager'); + $dyn_params = array('width' => $ds['thumbnail_width'], 'height' => $ds['thumbnail_height']); + if ($ds['thumbnail_quality']) { + $dyn_params['quality'] = $ds['thumbnail_quality']; + } + if ($ds['thumbnail_crop']) { + $dyn_params['crop'] = TRUE; + } + if ($ds['thumbnail_watermark']) { + $dyn_params['watermark'] = TRUE; + } + $thumbnail_size_name = $dynthumbs->get_size_name($dyn_params); + } + } + $this->_cache['thumbnailURL'] = $storage->get_image_url($this->_orig_image, $thumbnail_size_name); + return $this->_cache['thumbnailURL']; + case 'thumbcode': + if ($this->_displayed_gallery && isset($this->_displayed_gallery->display_settings) && isset($this->_displayed_gallery->display_settings['use_imagebrowser_effect']) && $this->_displayed_gallery->display_settings['use_imagebrowser_effect'] && !empty($this->_orig_image->thumbcode)) { + $this->_cache['thumbcode'] = $this->_orig_image->thumbcode; + } else { + $this->_cache['thumbcode'] = $this->get_thumbcode($this->__get('name')); + } + return $this->_cache['thumbcode']; + case 'thumbURL': + return $this->__get('thumbnailURL'); + case 'title': + $this->_cache['title'] = stripslashes($this->__get('name')); + return $this->_cache['title']; + case 'url': + $storage = $this->get_storage(); + $this->_cache['url'] = $storage->get_image_url($this->_orig_image, 'full'); + return $this->_cache['url']; + default: + return $this->_cache[$name]; + } + } + // called on initial nggLegacy image at construction. not sure what to do with it now. + public function construct_ngg_Image($gallery) + { + do_action_ref_array('ngg_get_image', array(&$this)); + unset($this->tags); + } + /** + * Retrieves and caches an I_Settings_Manager instance + * + * @return mixed + */ + public function get_settings() + { + if (is_null($this->_settings)) { + $this->_settings = C_NextGen_Settings::get_instance(); + } + return $this->_settings; + } + /** + * Retrieves and caches an I_Gallery_Storage instance + * + * @return mixed + */ + public function get_storage() + { + if (is_null($this->_storage)) { + $this->_storage = C_Gallery_Storage::get_instance(); + } + return $this->_storage; + } + /** + * Retrieves I_Gallery_Mapper instance. + * + * @param int $gallery_id Gallery ID + * @return mixed + */ + public function get_gallery($gallery_id) + { + if (isset($this->container) && method_exists($this->container, 'get_gallery')) { + return $this->container->get_gallery($gallery_id); + } + return C_Gallery_Mapper::get_instance()->find($gallery_id); + } + /** + * Retrieves I_Gallery_Mapper instance. + * + * @param int $gallery_id Gallery ID + * @return mixed + */ + public function get_legacy_gallery($gallery_id) + { + return C_Gallery_Mapper::get_instance()->find($gallery_id); + } + /** + * Get the thumbnail code (to add effects on thumbnail click) + * + * Applies the filter 'ngg_get_thumbcode' + */ + public function get_thumbcode($gallery_name = '') + { + if (empty($this->_displayed_gallery)) { + $effect_code = C_NextGen_Settings::get_instance()->thumbCode; + $effect_code = str_replace('%GALLERY_ID%', $gallery_name, $effect_code); + $effect_code = str_replace('%GALLERY_NAME%', $gallery_name, $effect_code); + $retval = $effect_code; + } else { + $controller = C_Display_Type_Controller::get_instance(); + $retval = $controller->get_effect_code($this->_displayed_gallery); + // This setting requires that we disable the effect code + $ds = $this->_displayed_gallery->display_settings; + if (isset($ds['use_imagebrowser_effect']) && $ds['use_imagebrowser_effect']) { + $retval = ''; + } + } + $retval = apply_filters('ngg_get_thumbcode', $retval, $this); + // ensure some additional data- fields are added; provides Pro-Lightbox compatibility + $retval .= ' data-image-id="' . $this->__get('id') . '"'; + $retval .= ' data-src="' . $this->__get('imageURL') . '"'; + $retval .= ' data-thumbnail="' . $this->__get('thumbnailURL') . '"'; + $retval .= ' data-title="' . esc_attr($this->__get('alttext')) . '"'; + $retval .= ' data-description="' . esc_attr($this->__get('description')) . '"'; + $this->_cache['thumbcode'] = $retval; + return $retval; + } + /** + * For compatibility support + * + * @return mixed + */ + public function get_href_link() + { + return $this->__get('imageHTML'); + } + /** + * For compatibility support + * + * @return mixed + */ + public function get_href_thumb_link() + { + return $this->__get('thumbHTML'); + } + /** + * Function exists for legacy support but has been gutted to not do anything + * + * @param int $width + * @param int $height + * @param string $mode could be watermark | web20 | crop + * @return the url for the image or false if failed + */ + public function cached_singlepic_file($width = '', $height = '', $mode = '') + { + $dynthumbs = C_Dynamic_Thumbnails_Manager::get_instance(); + $storage = $this->get_storage(); + // determine what to do with 'mode' + $display_reflection = FALSE; + $display_watermark = FALSE; + if (!is_array($mode)) { + $mode = explode(',', $mode); + } + if (in_array('web20', $mode)) { + $display_reflection = TRUE; + } + if (in_array('watermark', $mode)) { + $display_watermark = TRUE; + } + // and go for it + $params = array('width' => $width, 'height' => $height, 'watermark' => $display_watermark, 'reflection' => $display_reflection); + return $storage->get_image_url((object) $this->_cache, $dynthumbs->get_size_name($params)); + } + /** + * Get the tags associated to this image + */ + public function get_tags() + { + return $this->__get('tags'); + } + /** + * Get the permalink to the image + * + * TODO: Get a permalink to a page presenting the image + */ + public function get_permalink() + { + return $this->__get('permalink'); + } + /** + * Returns the _cache array; used by nggImage + * @return array + */ + public function _get_image() + { + return $this->_cache; + } +} +class C_Image_Wrapper_Collection implements ArrayAccess +{ + public $container = array(); + public $galleries = array(); + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + public function offsetSet($offset, $value) + { + if (is_object($value)) { + $value->container = $this; + } + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + /** + * Retrieves and caches an I_Gallery_Mapper instance for this gallery id + * + * @param int $gallery_id Gallery ID + * @return mixed + */ + public function get_gallery($gallery_id) + { + if (!isset($this->galleries[$gallery_id]) || is_null($this->galleries[$gallery_id])) { + $this->galleries[$gallery_id] = C_Gallery_Mapper::get_instance(); + } + return $this->galleries[$gallery_id]; + } +} +class C_NextGen_Data_Installer extends C_NggLegacy_Installer +{ + public function get_registry() + { + return C_Component_Registry::get_instance(); + } + public function install() + { + $this->remove_table_extra_options(); + } + public function remove_table_extra_options() + { + global $wpdb; + $likes = array('option_name LIKE \'%ngg_gallery%\'', 'option_name LIKE \'%ngg_pictures%\'', 'option_name LIKE \'%ngg_album%\''); + $sql = "DELETE FROM {$wpdb->options} WHERE " . implode(' OR ', $likes); + $wpdb->query($sql); + } + public function uninstall($hard = FALSE) + { + if ($hard) { + } + } +} +class C_NextGen_Metadata extends C_Component +{ + // Image data + public $image = ''; + // The image object + public $file_path = ''; + // Path to the image file + public $size = FALSE; + // The image size + public $exif_data = FALSE; + // EXIF data array + public $iptc_data = FALSE; + // IPTC data array + public $xmp_data = FALSE; + // XMP data array + // Filtered Data + public $exif_array = FALSE; + // EXIF data array + public $iptc_array = FALSE; + // IPTC data array + public $xmp_array = FALSE; + // XMP data array + public $sanitize = FALSE; + // sanitize meta data on request + /** + * Class constructor + * + * @param int $image Image ID + * @param bool $onlyEXIF TRUE = will parse only EXIF data + * @return bool FALSE if the file does not exist or metadat could not be read + */ + public function __construct($image, $onlyEXIF = FALSE) + { + if (is_numeric($image)) { + $image = C_Image_Mapper::get_instance()->find($image); + } + $this->image = apply_filters('ngg_find_image_meta', $image); + $this->file_path = C_Gallery_Storage::get_instance()->get_image_abspath($this->image); + if (!@file_exists($this->file_path)) { + return FALSE; + } + $this->size = @getimagesize($this->file_path, $metadata); + if ($this->size && is_array($metadata)) { + // get exif - data + if (is_callable('exif_read_data')) { + $this->exif_data = @exif_read_data($this->file_path, NULL, TRUE); + } + // stop here if we didn't need other meta data + if ($onlyEXIF) { + return TRUE; + } + // get the iptc data - should be in APP13 + if (is_callable('iptcparse') && isset($metadata['APP13'])) { + $this->iptc_data = @iptcparse($metadata['APP13']); + } + // get the xmp data in a XML format + if (is_callable('xml_parser_create')) { + $this->xmp_data = $this->extract_XMP($this->file_path); + } + return TRUE; + } + return FALSE; + } + /** + * return the saved meta data from the database + * + * @since 1.4.0 + * @param string $object (optional) + * @return array|mixed return either the complete array or the single object + */ + public function get_saved_meta($object = false) + { + $meta = $this->image->meta_data; + if (!isset($meta['saved'])) { + $meta['saved'] = FALSE; + } + //check if we already import the meta data to the database + if (!is_array($meta) || $meta['saved'] != true) { + return false; + } + // return one element if requested + if ($object) { + return $meta[$object]; + } + //removed saved parameter we don't need that to show + unset($meta['saved']); + // and remove empty tags or arrays + foreach ($meta as $key => $value) { + if (empty($value) or is_array($value)) { + unset($meta[$key]); + } + } + // on request sanitize the output + if ($this->sanitize == true) { + array_walk($meta, create_function('&$value', '$value = esc_html($value);')); + } + return $meta; + } + /** + * nggMeta::get_EXIF() + * See also http://trac.wordpress.org/changeset/6313 + * + * @return structured EXIF data + */ + public function get_EXIF($object = false) + { + if (!$this->exif_data) { + return false; + } + if (!is_array($this->exif_array)) { + $meta = array(); + $exif = isset($this->exif_array['EXIF']) ? $this->exif_array['EXIF'] : array(); + if (count($exif)) { + if (!empty($exif['FNumber'])) { + $meta['aperture'] = 'F ' . round($this->exif_frac2dec($exif['FNumber']), 2); + } + if (!empty($exif['Model'])) { + $meta['camera'] = trim($exif['Model']); + } + if (!empty($exif['DateTimeDigitized'])) { + $meta['created_timestamp'] = $this->exif_date2ts($exif['DateTimeDigitized']); + } else { + if (!empty($exif['DateTimeOriginal'])) { + $meta['created_timestamp'] = $this->exif_date2ts($exif['DateTimeOriginal']); + } else { + if (!empty($exif['FileDateTime'])) { + $meta['created_timestamp'] = $this->exif_date2ts($exif['FileDateTime']); + } + } + } + if (!empty($exif['FocalLength'])) { + $meta['focal_length'] = $this->exif_frac2dec($exif['FocalLength']) . __(' mm', 'nggallery'); + } + if (!empty($exif['ISOSpeedRatings'])) { + $meta['iso'] = $exif['ISOSpeedRatings']; + } + if (!empty($exif['ExposureTime'])) { + $meta['shutter_speed'] = $this->exif_frac2dec($exif['ExposureTime']); + $meta['shutter_speed'] = ($meta['shutter_speed'] > 0.0 and $meta['shutter_speed'] < 1.0) ? '1/' . round(1 / $meta['shutter_speed'], -1) : $meta['shutter_speed']; + $meta['shutter_speed'] .= __(' sec', 'nggallery'); + } + //Bit 0 indicates the flash firing status + if (!empty($exif['Flash'])) { + $meta['flash'] = $exif['Flash'] & 1 ? __('Fired', 'nggallery') : __('Not fired', ' nggallery'); + } + } + // additional information + if (isset($this->exif_data['IFD0'])) { + $exif = $this->exif_data['IFD0']; + if (!empty($exif['Model'])) { + $meta['camera'] = $exif['Model']; + } + if (!empty($exif['Make'])) { + $meta['make'] = $exif['Make']; + } + if (!empty($exif['ImageDescription'])) { + $meta['title'] = utf8_encode($exif['ImageDescription']); + } + if (!empty($exif['Orientation'])) { + $meta['Orientation'] = $exif['Orientation']; + } + } + // this is done by Windows + if (isset($this->exif_data['WINXP'])) { + $exif = $this->exif_data['WINXP']; + if (!empty($exif['Title']) && empty($meta['title'])) { + $meta['title'] = utf8_encode($exif['Title']); + } + if (!empty($exif['Author'])) { + $meta['author'] = utf8_encode($exif['Author']); + } + if (!empty($exif['Keywords'])) { + $meta['tags'] = utf8_encode($exif['Keywords']); + } + if (!empty($exif['Subject'])) { + $meta['subject'] = utf8_encode($exif['Subject']); + } + if (!empty($exif['Comments'])) { + $meta['caption'] = utf8_encode($exif['Comments']); + } + } + $this->exif_array = $meta; + } + // return one element if requested + if ($object == true) { + $value = isset($this->exif_array[$object]) ? $this->exif_array[$object] : false; + return $value; + } + // on request sanitize the output + if ($this->sanitize == true) { + array_walk($this->exif_array, create_function('&$value', '$value = esc_html($value);')); + } + return $this->exif_array; + } + // convert a fraction string to a decimal + public function exif_frac2dec($str) + { + @(list($n, $d) = explode('/', $str)); + if (!empty($d)) { + return $n / $d; + } + return $str; + } + // convert the exif date format to a unix timestamp + public function exif_date2ts($str) + { + $retval = is_numeric($str) ? $str : @strtotime($str); + if (!$retval && $str) { + @(list($date, $time) = explode(' ', trim($str))); + @(list($y, $m, $d) = explode(':', $date)); + $retval = strtotime("{$y}-{$m}-{$d} {$time}"); + } + return $retval; + } + /** + * nggMeta::readIPTC() - IPTC Data Information for EXIF Display + * + * @param mixed $output_tag + * @return IPTC-tags + */ + public function get_IPTC($object = false) + { + if (!$this->iptc_data) { + return false; + } + if (!is_array($this->iptc_array)) { + // --------- Set up Array Functions --------- // + $iptcTags = array('2#005' => 'title', '2#007' => 'status', '2#012' => 'subject', '2#015' => 'category', '2#025' => 'keywords', '2#055' => 'created_date', '2#060' => 'created_time', '2#080' => 'author', '2#085' => 'position', '2#090' => 'city', '2#092' => 'location', '2#095' => 'state', '2#100' => 'country_code', '2#101' => 'country', '2#105' => 'headline', '2#110' => 'credit', '2#115' => 'source', '2#116' => 'copyright', '2#118' => 'contact', '2#120' => 'caption'); + $meta = array(); + foreach ($iptcTags as $key => $value) { + if (isset($this->iptc_data[$key])) { + $meta[$value] = trim(utf8_encode(implode(', ', $this->iptc_data[$key]))); + } + } + $this->iptc_array = $meta; + } + // return one element if requested + if ($object) { + return isset($this->iptc_array[$object]) ? $this->iptc_array[$object] : NULL; + } + // on request sanitize the output + if ($this->sanitize == true) { + array_walk($this->iptc_array, create_function('&$value', '$value = esc_html($value);')); + } + return $this->iptc_array; + } + /** + * nggMeta::extract_XMP() + * get XMP DATA + * code by Pekka Saarinen http://photography-on-the.net + * + * @param mixed $filename + * @return XML data + */ + public function extract_XMP($filename) + { + //TODO:Require a lot of memory, could be better + ob_start(); + @readfile($filename); + $source = ob_get_contents(); + ob_end_clean(); + $start = strpos($source, '<x:xmpmeta'); + $end = strpos($source, '</x:xmpmeta>'); + if (!$start === false && !$end === false) { + $lenght = $end - $start; + $xmp_data = substr($source, $start, $lenght + 12); + unset($source); + return $xmp_data; + } + unset($source); + return false; + } + /** + * nggMeta::get_XMP() + * + * @package Taken from http://php.net/manual/en/function.xml-parse-into-struct.php + * @author Alf Marius Foss Olsen & Alex Rabe + * @return XML Array or object + * + */ + public function get_XMP($object = false) + { + if (!$this->xmp_data) { + return false; + } + if (!is_array($this->xmp_array)) { + $parser = xml_parser_create(); + xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0); + // Dont mess with my cAsE sEtTings + xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1); + // Dont bother with empty info + xml_parse_into_struct($parser, $this->xmp_data, $values); + xml_parser_free($parser); + $xmlarray = array(); + // The XML array + $this->xmp_array = array(); + // The returned array + $stack = array(); + // tmp array used for stacking + $list_array = array(); + // tmp array for list elements + $list_element = false; + // rdf:li indicator + foreach ($values as $val) { + if ($val['type'] == 'open') { + array_push($stack, $val['tag']); + } elseif ($val['type'] == 'close') { + // reset the compared stack + if ($list_element == false) { + array_pop($stack); + } + // reset the rdf:li indicator & array + $list_element = false; + $list_array = array(); + } elseif ($val['type'] == 'complete') { + if ($val['tag'] == 'rdf:li') { + // first go one element back + if ($list_element == false) { + array_pop($stack); + } + $list_element = true; + // do not parse empty tags + if (empty($val['value'])) { + continue; + } + // save it in our temp array + $list_array[] = $val['value']; + // in the case it's a list element we seralize it + $value = implode(',', $list_array); + $this->setArrayValue($xmlarray, $stack, $value); + } else { + array_push($stack, $val['tag']); + // do not parse empty tags + if (!empty($val['value'])) { + $this->setArrayValue($xmlarray, $stack, $val['value']); + } + array_pop($stack); + } + } + } + // foreach + // don't parse a empty array + if (empty($xmlarray) || empty($xmlarray['x:xmpmeta'])) { + return false; + } + // cut off the useless tags + $xmlarray = $xmlarray['x:xmpmeta']['rdf:RDF']['rdf:Description']; + // --------- Some values from the XMP format--------- // + $xmpTags = array('xap:CreateDate' => 'created_timestamp', 'xap:ModifyDate' => 'last_modfied', 'xap:CreatorTool' => 'tool', 'dc:format' => 'format', 'dc:title' => 'title', 'dc:creator' => 'author', 'dc:subject' => 'keywords', 'dc:description' => 'caption', 'photoshop:AuthorsPosition' => 'position', 'photoshop:City' => 'city', 'photoshop:Country' => 'country'); + foreach ($xmpTags as $key => $value) { + // if the kex exist + if (isset($xmlarray[$key])) { + switch ($key) { + case 'xap:CreateDate': + case 'xap:ModifyDate': + $this->xmp_array[$value] = strtotime($xmlarray[$key]); + break; + default: + $this->xmp_array[$value] = $xmlarray[$key]; + } + } + } + } + // return one element if requested + if ($object != false) { + return isset($this->xmp_array[$object]) ? $this->xmp_array[$object] : false; + } + // on request sanitize the output + if ($this->sanitize == true) { + array_walk($this->xmp_array, create_function('&$value', '$value = esc_html($value);')); + } + return $this->xmp_array; + } + public function setArrayValue(&$array, $stack, $value) + { + if ($stack) { + $key = array_shift($stack); + $this->setArrayValue($array[$key], $stack, $value); + return $array; + } else { + $array = $value; + } + } + /** + * nggMeta::get_META() - return a meta value form the available list + * + * @param string $object + * @return mixed $value + */ + public function get_META($object = false) + { + // defined order first look into database, then XMP, IPTC and EXIF. + if ($value = $this->get_saved_meta($object)) { + return $value; + } + if ($value = $this->get_XMP($object)) { + return $value; + } + if ($object == 'created_timestamp' && ($d = $this->get_IPTC('created_date')) && ($t = $this->get_IPTC('created_time'))) { + return $this->exif_date2ts($d . ' ' . $t); + } + if ($value = $this->get_IPTC($object)) { + return $value; + } + if ($value = $this->get_EXIF($object)) { + return $value; + } + // nothing found ? + return false; + } + /** + * nggMeta::i8n_name() - localize the tag name + * + * @param mixed $key + * @return translated $key + */ + public function i18n_name($key) + { + $tagnames = array('aperture' => __('Aperture', 'nggallery'), 'credit' => __('Credit', 'nggallery'), 'camera' => __('Camera', 'nggallery'), 'caption' => __('Caption', 'nggallery'), 'created_timestamp' => __('Date/Time', 'nggallery'), 'copyright' => __('Copyright', 'nggallery'), 'focal_length' => __('Focal length', 'nggallery'), 'iso' => __('ISO', 'nggallery'), 'shutter_speed' => __('Shutter speed', 'nggallery'), 'title' => __('Title', 'nggallery'), 'author' => __('Author', 'nggallery'), 'tags' => __('Tags', 'nggallery'), 'subject' => __('Subject', 'nggallery'), 'make' => __('Make', 'nggallery'), 'status' => __('Edit Status', 'nggallery'), 'category' => __('Category', 'nggallery'), 'keywords' => __('Keywords', 'nggallery'), 'created_date' => __('Date Created', 'nggallery'), 'created_time' => __('Time Created', 'nggallery'), 'position' => __('Author Position', 'nggallery'), 'city' => __('City', 'nggallery'), 'location' => __('Location', 'nggallery'), 'state' => __('Province/State', 'nggallery'), 'country_code' => __('Country code', 'nggallery'), 'country' => __('Country', 'nggallery'), 'headline' => __('Headline', 'nggallery'), 'credit' => __('Credit', 'nggallery'), 'source' => __('Source', 'nggallery'), 'copyright' => __('Copyright Notice', 'nggallery'), 'contact' => __('Contact', 'nggallery'), 'last_modfied' => __('Last modified', 'nggallery'), 'tool' => __('Program tool', 'nggallery'), 'format' => __('Format', 'nggallery'), 'width' => __('Image Width', 'nggallery'), 'height' => __('Image Height', 'nggallery'), 'flash' => __('Flash', 'nggallery')); + if (isset($tagnames[$key])) { + $key = $tagnames[$key]; + } + return $key; + } + /** + * Return the Timestamp from the image , if possible it's read from exif data + * @return int + */ + public function get_date_time() + { + $date = time(); + // Try getting the created_timestamp field + $date = $this->exif_date2ts($this->get_META('created_timestamp')); + if (!$date) { + $image_path = C_Gallery_Storage::get_instance()->get_backup_abspath($this->image); + $date = @filectime($image_path); + } + // Failback + if (!$date) { + $date = time(); + } + // Return the MySQL format + $date_time = date('Y-m-d H:i:s', $date); + return $date_time; + } + /** + * This function return the most common metadata, via a filter we can add more + * Reason : GD manipulation removes that options + * + * @since V1.4.0 + * @return void + */ + public function get_common_meta() + { + global $wpdb; + $meta = array('aperture' => 0, 'credit' => '', 'camera' => '', 'caption' => '', 'created_timestamp' => 0, 'copyright' => '', 'focal_length' => 0, 'iso' => 0, 'shutter_speed' => 0, 'flash' => 0, 'title' => '', 'keywords' => ''); + $meta = apply_filters('ngg_read_image_metadata', $meta); + // meta should be still an array + if (!is_array($meta)) { + return false; + } + foreach ($meta as $key => $value) { + $meta[$key] = $this->get_META($key); + } + //let's add now the size of the image + $meta['width'] = $this->size[0]; + $meta['height'] = $this->size[1]; + return $meta; + } + /** + * If needed sanitize each value before output + * + * @return void + */ + public function sanitize() + { + $this->sanitize = true; + } +} +class Mixin_NggLegacy_GalleryStorage_Driver extends Mixin +{ + /** + * Returns the named sizes available for images + * @return array + */ + public function get_image_sizes() + { + return array('full', 'thumbnail'); + } + public function get_upload_abspath($gallery = FALSE) + { + // Base upload path + $retval = C_NextGen_Settings::get_instance()->gallerypath; + $fs = C_Fs::get_instance(); + // If a gallery has been specified, then we'll + // append the slug + if ($gallery) { + $retval = $this->get_gallery_abspath($gallery); + } + // We need to make this an absolute path + if (strpos($retval, $fs->get_document_root('gallery')) !== 0) { + $retval = rtrim($fs->join_paths($fs->get_document_root('gallery'), $retval), '/\\'); + } + // Convert slashes + return $this->object->convert_slashes($retval); + } + /** + * Get the gallery path persisted in the database for the gallery + * @param int|stdClass|C_NextGen_Gallery $gallery + */ + public function get_gallery_abspath($gallery) + { + $retval = NULL; + $fs = C_Fs::get_instance(); + // Get the gallery entity from the database + if ($gallery) { + if (is_numeric($gallery)) { + $gallery = $this->object->_gallery_mapper->find($gallery); + } + } + // We we have a gallery, determine it's path + if ($gallery) { + if (isset($gallery->path)) { + $retval = $gallery->path; + } elseif (isset($gallery->slug)) { + $fs = C_Fs::get_instance(); + $basepath = C_NextGen_Settings::get_instance()->gallerypath; + $retval = $fs->join_paths($basepath, $gallery->slug); + } + } + $root_type = defined('NGG_GALLERY_ROOT_TYPE') ? NGG_GALLERY_ROOT_TYPE : 'site'; + if ($root_type == 'content') { + // This requires explanation: in case our content root ends with the same directory name + // that the gallery path begins with we remove the duplicate name from $retval. This is + // necessary because the default WP_CONTENT_DIR setting ends in /wp-content/ and + // NextGEN's default gallery path begins with /wp-content/. This also allows gallery + // paths to also be expressed as simply "/gallery-name/" + $exploded_root = explode(DIRECTORY_SEPARATOR, trim($fs->get_document_root('content'), '/\\')); + $exploded_gallery = explode(DIRECTORY_SEPARATOR, trim($retval, '/\\')); + $exploded_gallery = array_values($exploded_gallery); + $last_gallery_dirname = $exploded_gallery[0]; + $last_root_dirname = end($exploded_root); + if ($last_root_dirname === $last_gallery_dirname) { + unset($exploded_gallery[0]); + $retval = implode(DIRECTORY_SEPARATOR, $exploded_gallery); + } + } + // Ensure that the path is absolute + if (strpos($retval, $fs->get_document_root('gallery')) !== 0) { + $retval = rtrim($fs->join_paths($fs->get_document_root('gallery'), $retval), '/\\'); + } + return $this->object->convert_slashes(rtrim($retval, '/\\')); + } + /** + * Gets the absolute path where the image is stored + * Can optionally return the path for a particular sized image + */ + public function get_image_abspath($image, $size = 'full', $check_existance = FALSE) + { + $retval = NULL; + $fs = C_Fs::get_instance(); + // Ensure that we have a size + if (!$size) { + $size = 'full'; + } + // If we have the id, get the actual image entity + if (is_numeric($image)) { + $image = $this->object->_image_mapper->find($image); + } + // Ensure we have the image entity - user could have passed in an + // incorrect id + if (is_object($image)) { + if ($gallery_path = $this->object->get_gallery_abspath($image->galleryid)) { + $folder = $prefix = $size; + switch ($size) { + # Images are stored in the associated gallery folder + case 'full': + case 'original': + case 'image': + $retval = $fs->join_paths($gallery_path, $image->filename); + break; + case 'backup': + $retval = $fs->join_paths($gallery_path, $image->filename . '_backup'); + if ($check_existance && !@file_exists($retval)) { + $retval = $fs->join_paths($gallery_path, $image->filename); + } + break; + case 'thumbnails': + case 'thumbnail': + case 'thumb': + case 'thumbs': + $size = 'thumbnail'; + $folder = 'thumbs'; + $prefix = 'thumbs'; + // deliberately no break here + // We assume any other size of image is stored in the a + //subdirectory of the same name within the gallery folder + // gallery folder, but with the size appended to the filename + default: + $image_path = $fs->join_paths($gallery_path, $folder); + // NGG 2.0 stores relative filenames in the meta data of + // an image. It does this because it uses filenames + // that follow conventional WordPress naming scheme. + if (isset($image->meta_data) && isset($image->meta_data[$size]) && isset($image->meta_data[$size]['filename'])) { + $image_path = $fs->join_paths($image_path, $image->meta_data[$size]['filename']); + } else { + $image_path = $fs->join_paths($image_path, "{$prefix}_{$image->filename}"); + } + $retval = $image_path; + break; + } + } + } + // Check the existance of the file + if ($retval && $check_existance) { + if (!@file_exists($retval)) { + $retval = NULL; + } + } + return $retval ? rtrim($retval, '/\\') : $retval; + } + /** + * Gets the url of a particular-sized image + * @param int|object $image + * @param string $size + * @returns array + */ + public function get_image_url($image, $size = 'full', $check_existance = FALSE, $image_abspath = FALSE) + { + $retval = NULL; + $fs = C_Fs::get_instance(); + $router = C_Router::get_instance(); + if (!$image_abspath) { + $image_abspath = $this->object->get_image_abspath($image, $size, $check_existance); + } + if ($image_abspath) { + // encode the filename: because filesystems will let you name things like%@this.jpg + $parts = M_I18n::mb_pathinfo($image_abspath); + $parts['basename'] = rawurlencode($parts['basename']); + $image_abspath = $parts['dirname'] . DIRECTORY_SEPARATOR . $parts['basename']; + $doc_root = $fs->get_document_root('gallery'); + if ($doc_root != null) { + $doc_root = rtrim($doc_root, '/\\') . DIRECTORY_SEPARATOR; + } + // if docroot is "/" we would generate urls like /wp-contentpluginsnextgen-galleryetcetc + if ($doc_root !== '/') { + $request_uri = str_replace($doc_root, '', $image_abspath); + } else { + $request_uri = $image_abspath; + } + $request_uri = '/' . ltrim(str_replace('\\', '/', $request_uri), '/'); + $retval = $router->remove_url_segment('/index.php', $router->get_url($request_uri, FALSE, 'gallery')); + } + return apply_filters('ngg_get_image_url', $retval, $image, $size); + } + /** + * Uploads an image for a particular gallerys + * @param int|stdClass|C_NextGEN_Gallery $gallery + * @param type $filename, specifies the name of the file + * @param type $data if specified, expects base64 encoded string of data + * @return C_Image + */ + public function upload_image($gallery, $filename = FALSE, $data = FALSE) + { + $retval = NULL; + // Ensure that we have the data present that we require + if (isset($_FILES['file']) && $_FILES['file']['error'] == 0) { + // $_FILES = Array( + // [file] => Array ( + // [name] => Canada_landscape4.jpg + // [type] => image/jpeg + // [tmp_name] => /private/var/tmp/php6KO7Dc + // [error] => 0 + // [size] => 64975 + // ) + // + $file = $_FILES['file']; + if ($this->object->is_zip()) { + $retval = $this->object->upload_zip($gallery); + } else { + if ($this->is_image_file()) { + $retval = $this->object->upload_base64_image($gallery, file_get_contents($file['tmp_name']), $filename ? $filename : (isset($file['name']) ? $file['name'] : FALSE)); + } else { + // Remove the non-valid (and potentially insecure) file from the PHP upload directory + if (isset($_FILES['file']['tmp_name'])) { + $filename = $_FILES['file']['tmp_name']; + @unlink($filename); + } + throw new E_UploadException(__('Invalid image file. Acceptable formats: JPG, GIF, and PNG.', 'nggallery')); + } + } + } elseif ($data) { + $retval = $this->object->upload_base64_image($filename, $data); + } else { + throw new E_UploadException(); + } + return $retval; + } + public function get_image_size_params($image, $size, $params = null, $skip_defaults = false) + { + // Get the image entity + if (is_numeric($image)) { + $image = $this->object->_image_mapper->find($image); + } + $params = apply_filters('ngg_get_image_size_params', $params, $size, $image); + // Ensure we have a valid image + if ($image) { + $settings = C_NextGen_Settings::get_instance(); + if (!$skip_defaults) { + // Get default settings + if ($size == 'full') { + if (!isset($params['quality'])) { + $params['quality'] = $settings->imgQuality; + } + } else { + if (!isset($params['crop'])) { + $params['crop'] = $settings->thumbfix; + } + if (!isset($params['quality'])) { + $params['quality'] = $settings->thumbquality; + } + } + } + // width and height when omitted make generate_image_clone create a clone with original size, so try find defaults regardless of $skip_defaults + if (!isset($params['width']) || !isset($params['height'])) { + // First test if this is a "known" image size, i.e. if we store these sizes somewhere when users re-generate these sizes from the UI...this is required to be compatible with legacy + // try the 2 default built-in sizes, first thumbnail... + if ($size == 'thumbnail') { + if (!isset($params['width'])) { + $params['width'] = $settings->thumbwidth; + } + if (!isset($params['height'])) { + $params['height'] = $settings->thumbheight; + } + } else { + if ($size == 'full') { + if (!isset($params['width'])) { + if ($settings->imgAutoResize) { + $params['width'] = $settings->imgWidth; + } + } + if (!isset($params['height'])) { + if ($settings->imgAutoResize) { + $params['height'] = $settings->imgHeight; + } + } + } else { + if (isset($image->meta_data) && isset($image->meta_data[$size])) { + $dimensions = $image->meta_data[$size]; + if (!isset($params['width'])) { + $params['width'] = $dimensions['width']; + } + if (!isset($params['height'])) { + $params['height'] = $dimensions['height']; + } + } + } + } + } + if (!isset($params['crop_frame'])) { + $crop_frame_size_name = 'thumbnail'; + if (isset($image->meta_data[$size]['crop_frame'])) { + $crop_frame_size_name = $size; + } + if (isset($image->meta_data[$crop_frame_size_name]['crop_frame'])) { + $params['crop_frame'] = $image->meta_data[$crop_frame_size_name]['crop_frame']; + if (!isset($params['crop_frame']['final_width'])) { + $params['crop_frame']['final_width'] = $image->meta_data[$crop_frame_size_name]['width']; + } + if (!isset($params['crop_frame']['final_height'])) { + $params['crop_frame']['final_height'] = $image->meta_data[$crop_frame_size_name]['height']; + } + } + } else { + if (!isset($params['crop_frame']['final_width'])) { + $params['crop_frame']['final_width'] = $params['width']; + } + if (!isset($params['crop_frame']['final_height'])) { + $params['crop_frame']['final_height'] = $params['height']; + } + } + } + return $params; + } + /** + * Returns an array of dimensional properties (width, height, real_width, real_height) of a resulting clone image if and when generated + * @param string $image_path + * @param string $clone_path + * @param array $params + * @return array + */ + public function calculate_image_size_dimensions($image, $size, $params = null, $skip_defaults = false) + { + $retval = FALSE; + // Get the image entity + if (is_numeric($image)) { + $image = $this->object->_image_mapper->find($image); + } + // Ensure we have a valid image + if ($image) { + $params = $this->object->get_image_size_params($image, $size, $params, $skip_defaults); + // Get the image filename + $image_path = $this->object->get_original_abspath($image, 'original'); + $clone_path = $this->object->get_image_abspath($image, $size); + $retval = $this->object->calculate_image_clone_dimensions($image_path, $clone_path, $params); + } + return $retval; + } + /** + * Generates a specific size for an image + * @param int|stdClass|C_Image $image + * @return bool|object + */ + public function generate_image_size($image, $size, $params = null, $skip_defaults = false) + { + $retval = FALSE; + // Get the image entity + if (is_numeric($image)) { + $image = $this->object->_image_mapper->find($image); + } + // Ensure we have a valid image + if ($image) { + $params = $this->object->get_image_size_params($image, $size, $params, $skip_defaults); + $settings = C_NextGen_Settings::get_instance(); + // Get the image filename + $filename = $this->object->get_original_abspath($image, 'original'); + $thumbnail = null; + if ($size == 'full' && $settings->imgBackup == 1) { + // XXX change this? 'full' should be the resized path and 'original' the _backup path + $backup_path = $this->object->get_backup_abspath($image); + if (!@file_exists($backup_path)) { + @copy($filename, $backup_path); + } + } + // Generate the thumbnail using WordPress + $existing_image_abpath = $this->object->get_image_abspath($image, $size); + $existing_image_dir = dirname($existing_image_abpath); + // removing the old thumbnail is actually not needed as generate_image_clone() will replace it, leaving commented in as reminder in case there are issues in the future + if (@file_exists($existing_image_abpath)) { + } + wp_mkdir_p($existing_image_dir); + $clone_path = $existing_image_abpath; + $thumbnail = $this->object->generate_image_clone($filename, $clone_path, $params); + // We successfully generated the thumbnail + if ($thumbnail != null) { + $clone_path = $thumbnail->fileName; + if (function_exists('getimagesize')) { + $dimensions = getimagesize($clone_path); + } else { + $dimensions = array($params['width'], $params['height']); + } + if (!isset($image->meta_data)) { + $image->meta_data = array(); + } + $size_meta = array('width' => $dimensions[0], 'height' => $dimensions[1], 'filename' => M_I18n::mb_basename($clone_path), 'generated' => microtime()); + if (isset($params['crop_frame'])) { + $size_meta['crop_frame'] = $params['crop_frame']; + } + $image->meta_data[$size] = $size_meta; + if ($size == 'full') { + $image->meta_data['width'] = $size_meta['width']; + $image->meta_data['height'] = $size_meta['height']; + } + $retval = $this->object->_image_mapper->save($image); + if ($retval == 0) { + $retval = false; + } + if ($retval) { + $retval = $thumbnail; + } + } else { + } + } + return $retval; + } + /** + * Generates a thumbnail for an image + * @param int|stdClass|C_Image $image + * @return bool + */ + public function generate_thumbnail($image, $params = null, $skip_defaults = false) + { + $sized_image = $this->object->generate_image_size($image, 'thumbnail', $params, $skip_defaults); + $retval = false; + if ($sized_image != null) { + $retval = true; + $sized_image->destruct(); + } + return $retval; + } + /** + * Outputs/renders an image + * @param int|stdClass|C_NextGen_Gallery_Image $image + * @return bool + */ + public function render_image($image, $size = FALSE) + { + $format_list = $this->object->get_image_format_list(); + $abspath = $this->get_image_abspath($image, $size, true); + if ($abspath == null) { + $thumbnail = $this->object->generate_image_size($image, $size); + if ($thumbnail != null) { + $abspath = $thumbnail->fileName; + $thumbnail->destruct(); + } + } + if ($abspath != null) { + $data = @getimagesize($abspath); + $format = 'jpg'; + if ($data != null && is_array($data) && isset($format_list[$data[2]])) { + $format = $format_list[$data[2]]; + } + // Clear output + while (ob_get_level() > 0) { + ob_end_clean(); + } + $format = strtolower($format); + // output image and headers + header('Content-type: image/' . $format); + readfile($abspath); + return true; + } + return false; + } + public function delete_gallery($gallery) + { + $retval = FALSE; + if ($gallery_abspath = $this->object->get_gallery_abspath($gallery)) { + $fs = C_Fs::get_instance(); + $retval = $fs->delete($gallery_abspath); + if ($retval) { + @rmdir($fs->join_paths($gallery_abspath, 'thumbs')); + @rmdir($fs->join_paths($gallery_abspath, 'dynamic')); + @rmdir($gallery_abspath); + } + } + return $retval; + } + public function delete_image($image, $size = FALSE) + { + $retval = FALSE; + // Ensure that we have the image entity + if (is_numeric($image)) { + $image = $this->object->_image_mapper->find($image); + } + if ($image) { + // Delete only a particular image size + if ($size) { + $abspath = $this->object->get_image_abspath($image, $size); + if ($abspath && @file_exists($abspath)) { + unlink($abspath); + } + if (isset($image->meta_data) && isset($image->meta_data[$size])) { + unset($image->meta_data[$size]); + $this->object->_image_mapper->save($image); + } + } else { + // Get the paths to fullsize and thumbnail files + $abspaths = array($this->object->get_full_abspath($image), $this->object->get_thumb_abspath($image), $this->object->get_backup_abspath($image)); + if (isset($image->meta_data)) { + foreach (array_keys($image->meta_data) as $size) { + $abspaths[] = $this->object->get_image_abspath($image, $size); + } + } + // Delete each image + foreach ($abspaths as $abspath) { + if ($abspath && @file_exists($abspath)) { + unlink($abspath); + } + } + // Delete the entity + $this->object->_image_mapper->destroy($image); + } + $retval = TRUE; + } + return $retval; + } + public function set_post_thumbnail($post, $image) + { + $attachment_id = null; + // Get the post id + $post_id = $post; + if (is_object($post)) { + if (property_exists($post, 'ID')) { + $post_id = $post->ID; + } elseif (property_exists($post, 'post_id')) { + $post_id = $post->post_id; + } + } elseif (is_array($post)) { + if (isset($post['ID'])) { + $post_id = $post['ID']; + } elseif (isset($post['post_id'])) { + $post_id = $post['post_id']; + } + } + // Get the image object + if (is_int($image)) { + $image = C_Image_Mapper::get_instance()->find($image); + } + // Do we have what we need? + if ($image && is_int($post_id)) { + $args = array('post_type' => 'attachment', 'meta_key' => '_ngg_image_id', 'meta_compare' => '==', 'meta_value' => $image->{$image->id_field}); + $upload_dir = wp_upload_dir(); + $basedir = $upload_dir['basedir']; + $thumbs_dir = implode(DIRECTORY_SEPARATOR, array($basedir, 'ngg_featured')); + $gallery_abspath = $this->object->get_gallery_abspath($image->galleryid); + $image_abspath = $this->object->get_full_abspath($image); + $target_path = null; + $copy_image = TRUE; + // Have we previously set the post thumbnail? + if ($posts = get_posts($args)) { + $attachment_id = $posts[0]->ID; + $attachment_file = get_attached_file($attachment_id); + $target_path = $attachment_file; + if (filemtime($image_abspath) > filemtime($target_path)) { + $copy_image = TRUE; + } + } else { + $url = $this->object->get_full_url($image); + $target_relpath = null; + $target_basename = M_I18n::mb_basename($image_abspath); + if (strpos($image_abspath, $gallery_abspath) === 0) { + $target_relpath = substr($image_abspath, strlen($gallery_abspath)); + } else { + if ($image->galleryid) { + $target_relpath = path_join(strval($image->galleryid), $target_basename); + } else { + $target_relpath = $target_basename; + } + } + $target_relpath = trim($target_relpath, '\\/'); + $target_path = path_join($thumbs_dir, $target_relpath); + $max_count = 100; + $count = 0; + while (@file_exists($target_path) && $count <= $max_count) { + $count++; + $pathinfo = M_I18n::mb_pathinfo($target_path); + $dirname = $pathinfo['dirname']; + $filename = $pathinfo['filename']; + $extension = $pathinfo['extension']; + $rand = mt_rand(1, 9999); + $basename = $filename . '_' . sprintf('%04d', $rand) . '.' . $extension; + $target_path = path_join($dirname, $basename); + } + if (@file_exists($target_path)) { + } + $target_dir = dirname($target_path); + wp_mkdir_p($target_dir); + } + if ($copy_image) { + @copy($image_abspath, $target_path); + if (!$attachment_id) { + $size = @getimagesize($target_path); + $image_type = $size ? $size['mime'] : 'image/jpeg'; + $title = sanitize_file_name($image->alttext); + $caption = sanitize_file_name($image->description); + $attachment = array('post_title' => $title, 'post_content' => $caption, 'post_status' => 'attachment', 'post_parent' => 0, 'post_mime_type' => $image_type, 'guid' => $url); + $attachment_id = wp_insert_attachment($attachment, $target_path); + } + update_post_meta($attachment_id, '_ngg_image_id', $image->{$image->id_field}); + wp_update_attachment_metadata($attachment_id, wp_generate_attachment_metadata($attachment_id, $target_path)); + } + } + return $attachment_id; + } + /** + * Copies (or moves) images into another gallery + * + * @param array $images + * @param int|object $gallery + * @param boolean $db optionally only copy the image files + * @param boolean $move move the image instead of copying + * @return mixed NULL on failure, array|image-ids on success + */ + public function copy_images($images, $gallery, $db = TRUE, $move = FALSE) + { + $new_image_pids = array(); + // the return value + // legacy requires passing just a numeric ID + if (is_numeric($gallery)) { + $gallery = $this->object->_gallery_mapper->find($gallery); + } + // move_images() is a wrapper to this function so we implement both features here + $func = $move ? 'rename' : 'copy'; + // legacy allows for arrays of just the ID + if (!is_array($images)) { + $images = array($images); + } + // Ensure we have a valid gallery + $gallery_id = $this->object->_get_gallery_id($gallery); + if (!$gallery_id) { + return array(); + } + $image_key = $this->object->_image_mapper->get_primary_key_column(); + $gallery_abspath = $this->object->get_gallery_abspath($gallery); + // Check for folder permission + if (!is_dir($gallery_abspath) && !wp_mkdir_p($gallery_abspath)) { + echo sprintf(__('Unable to create directory %s.', 'nggallery'), esc_html($gallery_abspath)); + return $new_image_pids; + } + if (!is_writable($gallery_abspath)) { + echo sprintf(__('Unable to write to directory %s. Is this directory writable by the server?', 'nggallery'), esc_html($gallery_abspath)); + return $new_image_pids; + } + foreach ($images as $image) { + if ($this->object->is_current_user_over_quota()) { + throw new E_NoSpaceAvailableException(__('Sorry, you have used your space allocation. Please delete some files to upload more files.', 'nggallery')); + } + // again legacy requires that it be able to pass just a numeric ID + if (is_numeric($image)) { + $image = $this->object->_image_mapper->find($image); + } + $old_pid = $image->{$image_key}; + // update the DB if requested + $new_image = clone $image; + $new_pid = $old_pid; + if ($db) { + unset($new_image->extras_post_id); + $new_image->galleryid = $gallery_id; + if (!$move) { + $new_image->image_slug = nggdb::get_unique_slug(sanitize_title_with_dashes($image->alttext), 'image'); + unset($new_image->{$image_key}); + } + $new_pid = $this->object->_image_mapper->save($new_image); + } + if (!$new_pid) { + echo sprintf(__('Failed to copy database row for picture %s', 'nggallery'), $old_pid) . '<br />'; + continue; + } + // Copy each image size + foreach ($this->object->get_image_sizes() as $size) { + // if backups are off there's no backup file to copy + if (!C_NextGen_Settings::get_instance()->imgBackup && $size == 'backup') { + continue; + } + $orig_path = $this->object->get_image_abspath($image, $size, TRUE); + if (!$orig_path || !@file_exists($orig_path)) { + echo sprintf(__('Failed to get image path for %s', 'nggallery'), esc_html(M_I18n::mb_basename($orig_path))) . '<br/>'; + continue; + } + $new_path = $this->object->get_image_abspath($new_image, $size, FALSE); + // Prevent duplicate filenames: check if the filename exists and begin appending '-#' + if (!ini_get('safe_mode') && @file_exists($new_path)) { + // prevent get_image_abspath() from using the thumbnail filename in metadata + unset($new_image->meta_data['thumbnail']['filename']); + $file_exists = TRUE; + $i = 0; + do { + $i++; + $parts = explode('.', $image->filename); + $extension = array_pop($parts); + $tmp_filename = implode('.', $parts) . '-' . $i . '.' . $extension; + $new_image->filename = $tmp_filename; + $tmp_path = $this->object->get_image_abspath($new_image, $size, FALSE); + if (!@file_exists($tmp_path)) { + $file_exists = FALSE; + $new_path = $tmp_path; + if ($db) { + $this->object->_image_mapper->save($new_image); + } + } + } while ($file_exists == TRUE); + } + // Copy files + if (!@$func($orig_path, $new_path)) { + echo sprintf(__('Failed to copy image %1$s to %2$s', 'nggallery'), esc_html($orig_path), esc_html($new_path)) . '<br/>'; + continue; + } + // disabling: this is a bit too verbose + // if (!empty($tmp_path)) + // echo sprintf(__('Image %1$s (%2$s) copied as image %3$s (%4$s) » The file already existed in the destination gallery.', 'nggallery'), $old_pid, esc_html($orig_path), $new_pid, esc_html($new_path)) . '<br />'; + // else + // echo sprintf(__('Image %1$s (%2$s) copied as image %3$s (%4$s)', 'nggallery'), $old_pid, esc_html($orig_path), $new_pid, esc_html($new_path)) . '<br />'; + // Copy tags + if ($db) { + $tags = wp_get_object_terms($old_pid, 'ngg_tag', 'fields=ids'); + $tags = array_map('intval', $tags); + wp_set_object_terms($new_pid, $tags, 'ngg_tag', true); + } + } + $new_image_pids[] = $new_pid; + } + $title = '<a href="' . admin_url() . 'admin.php?page=nggallery-manage-gallery&mode=edit&gid=' . $gallery_id . '" >'; + $title .= $gallery->title; + $title .= '</a>'; + echo '<hr/>' . sprintf(__('Copied %1$s picture(s) to gallery %2$s .', 'nggallery'), count($new_image_pids), $title); + return $new_image_pids; + } + /** + * Recover image from backup copy and reprocess it + * + * @param int|stdClass|C_Image $image + * @return string result code + */ + public function recover_image($image) + { + $retval = FALSE; + if (is_numeric($image)) { + $image = $this->object->_image_mapper->find($image); + } + if ($image) { + $full_abspath = $this->object->get_image_abspath($image); + $backup_abspath = $this->object->get_image_abspath($image, 'backup'); + if ($backup_abspath != $full_abspath && @file_exists($backup_abspath)) { + if (is_writable($full_abspath) && is_writable(dirname($full_abspath))) { + // Copy the backup + if (@copy($backup_abspath, $full_abspath)) { + // Re-create all image sizes + foreach ($this->object->get_image_sizes($image) as $named_size) { + $this->object->generate_image_clone($backup_abspath, $this->object->get_image_abspath($image, $named_size), $this->object->get_image_size_params($image, $named_size)); + } + // Reimport all metadata + $retval = $this->object->_image_mapper->reimport_metadata($image); + } + } + } + } + return $retval; + } +} +class C_NggLegacy_GalleryStorage_Driver extends C_GalleryStorage_Driver_Base +{ + public function define($context = FALSE) + { + parent::define($context); + $this->add_mixin('Mixin_NggLegacy_GalleryStorage_Driver'); + } +} +/** + * gd.thumbnail.inc.php + * + * @author Ian Selby (ian@gen-x-design.com) + * @copyright Copyright 2006-2011 + * @version 1.3.0 (based on 1.1.3) + * @modded by Alex Rabe + * + */ +/** + * PHP class for dynamically resizing, cropping, and rotating images for thumbnail purposes and either displaying them on-the-fly or saving them. + * + */ +class C_NggLegacy_Thumbnail +{ + /** + * Error message to display, if any + * + * @var string + */ + public $errmsg; + /** + * Whether or not there is an error + * + * @var boolean + */ + public $error; + /** + * Format of the image file + * + * @var string + */ + public $format; + /** + * File name and path of the image file + * + * @var string + */ + public $fileName; + /** + * Current dimensions of working image + * + * @var array + */ + public $currentDimensions; + /** + * New dimensions of working image + * + * @var array + */ + public $newDimensions; + /** + * Image resource for newly manipulated image + * + * @var resource + * @access private + */ + public $newImage; + /** + * Image resource for image before previous manipulation + * + * @var resource + * @access private + */ + public $oldImage; + /** + * Image resource for image being currently manipulated + * + * @var resource + * @access private + */ + public $workingImage; + /** + * Percentage to resize image by + * + * @var int + * @access private + */ + public $percent; + /** + * Maximum width of image during resize + * + * @var int + * @access private + */ + public $maxWidth; + /** + * Maximum height of image during resize + * + * @var int + * @access private + */ + public $maxHeight; + /** + * Image for Watermark + * + * @var string + * + */ + public $watermarkImgPath; + /** + * Text for Watermark + * + * @var string + * + */ + public $watermarkText; + /** + * Image Resource ID for Watermark + * + * @var string + * + */ + public function __construct($fileName, $no_ErrorImage = false) + { + //make sure the GD library is installed + if (!function_exists('gd_info')) { + echo 'You do not have the GD Library installed. This class requires the GD library to function properly.' . ' +'; + echo 'visit http://us2.php.net/manual/en/ref.image.php for more information'; + throw new E_No_Image_Library_Exception(); + } + //initialize variables + $this->errmsg = ''; + $this->error = false; + $this->currentDimensions = array(); + $this->newDimensions = array(); + $this->fileName = $fileName; + $this->percent = 100; + $this->maxWidth = 0; + $this->maxHeight = 0; + $this->watermarkImgPath = ''; + $this->watermarkText = ''; + //check to see if file exists + if (!@file_exists($this->fileName)) { + $this->errmsg = 'File not found'; + $this->error = true; + } elseif (!is_readable($this->fileName)) { + $this->errmsg = 'File is not readable'; + $this->error = true; + } + //if there are no errors, determine the file format + if ($this->error == false) { + @ini_set('memory_limit', -1); + $data = @getimagesize($this->fileName); + if (isset($data) && is_array($data)) { + $extensions = array('1' => 'GIF', '2' => 'JPG', '3' => 'PNG'); + $extension = array_key_exists($data[2], $extensions) ? $extensions[$data[2]] : ''; + if ($extension) { + $this->format = $extension; + } else { + $this->errmsg = 'Unknown file format'; + $this->error = true; + } + } else { + $this->errmsg = 'File is not an image'; + $this->error = true; + } + } + // increase memory-limit if possible, GD needs this for large images + if (!extension_loaded('suhosin')) { + @ini_set('memory_limit', '512M'); + } + if ($this->error == false) { + // Check memory consumption if file exists + $this->checkMemoryForImage($this->fileName); + } + //initialize resources if no errors + if ($this->error == false) { + switch ($this->format) { + case 'GIF': + $this->oldImage = @ImageCreateFromGif($this->fileName); + break; + case 'JPG': + $this->oldImage = @ImageCreateFromJpeg($this->fileName); + break; + case 'PNG': + $this->oldImage = @ImageCreateFromPng($this->fileName); + break; + } + if (!$this->oldImage) { + $this->errmsg = 'Create Image failed. Check memory limit'; + $this->error = true; + } else { + $size = GetImageSize($this->fileName); + $this->currentDimensions = array('width' => $size[0], 'height' => $size[1]); + $this->newImage = $this->oldImage; + } + } + if ($this->error == true) { + if (!$no_ErrorImage) { + $this->showErrorImage(); + } + return; + } + } + /** + * Calculate the memory limit + * + */ + public function checkMemoryForImage($filename) + { + if (function_exists('memory_get_usage') && ini_get('memory_limit')) { + $imageInfo = getimagesize($filename); + switch ($this->format) { + case 'GIF': + // measured factor 1 is better + $CHANNEL = 1; + break; + case 'JPG': + $CHANNEL = $imageInfo['channels']; + break; + case 'PNG': + // didn't get the channel for png + $CHANNEL = 3; + break; + } + $MB = 1048576; + // number of bytes in 1M + $K64 = 65536; + // number of bytes in 64K + $TWEAKFACTOR = 1.68; + // Or whatever works for you + $bits = !empty($imageInfo['bits']) ? $imageInfo['bits'] : 32; + // imgInfo[bits] is not always available + $memoryNeeded = round(($imageInfo[0] * $imageInfo[1] * $bits * $CHANNEL / 8 + $K64) * $TWEAKFACTOR); + $memoryNeeded = memory_get_usage() + $memoryNeeded; + // get memory limit + $memory_limit = ini_get('memory_limit'); + // PHP docs : Note that to have no memory limit, set this directive to -1. + if ($memory_limit == -1) { + return; + } + // Just check megabyte limits, not higher + if (strtolower(substr($memory_limit, -1)) == 'm') { + if ($memory_limit != '') { + $memory_limit = substr($memory_limit, 0, -1) * 1024 * 1024; + } + if ($memoryNeeded > $memory_limit) { + $memoryNeeded = round($memoryNeeded / 1024 / 1024, 2); + $this->errmsg = 'Exceed Memory limit. Require : ' . $memoryNeeded . ' MByte'; + $this->error = true; + } + } + } + return; + } + public function __destruct() + { + $this->destruct(); + } + /** + * Must be called to free up allocated memory after all manipulations are done + * + */ + public function destruct() + { + if (is_resource($this->newImage)) { + @ImageDestroy($this->newImage); + } + if (is_resource($this->oldImage)) { + @ImageDestroy($this->oldImage); + } + if (is_resource($this->workingImage)) { + @ImageDestroy($this->workingImage); + } + } + /** + * Returns the current width of the image + * + * @return int + */ + public function getCurrentWidth() + { + return $this->currentDimensions['width']; + } + /** + * Returns the current height of the image + * + * @return int + */ + public function getCurrentHeight() + { + return $this->currentDimensions['height']; + } + /** + * Calculates new image width + * + * @param int $width + * @param int $height + * @return array + */ + public function calcWidth($width, $height) + { + $newWp = 100 * $this->maxWidth / $width; + $newHeight = $height * $newWp / 100; + if (intval($newHeight) == $this->maxHeight - 1) { + $newHeight = $this->maxHeight; + } + return array('newWidth' => intval($this->maxWidth), 'newHeight' => intval($newHeight)); + } + /** + * Calculates new image height + * + * @param int $width + * @param int $height + * @return array + */ + public function calcHeight($width, $height) + { + $newHp = 100 * $this->maxHeight / $height; + $newWidth = $width * $newHp / 100; + if (intval($newWidth) == $this->maxWidth - 1) { + $newWidth = $this->maxWidth; + } + return array('newWidth' => intval($newWidth), 'newHeight' => intval($this->maxHeight)); + } + /** + * Calculates new image size based on percentage + * + * @param int $width + * @param int $height + * @return array + */ + public function calcPercent($width, $height) + { + $newWidth = $width * $this->percent / 100; + $newHeight = $height * $this->percent / 100; + return array('newWidth' => intval($newWidth), 'newHeight' => intval($newHeight)); + } + /** + * Calculates new image size based on width and height, while constraining to maxWidth and maxHeight + * + * @param int $width + * @param int $height + */ + public function calcImageSize($width, $height) + { + // $width and $height are the CURRENT image resolutions + $ratio_w = $this->maxWidth / $width; + $ratio_h = $this->maxHeight / $height; + if ($ratio_w >= $ratio_h) { + $width = $this->maxWidth; + $height = (int) round($height * $ratio_h, 0); + } else { + $height = $this->maxHeight; + $width = (int) round($width * $ratio_w, 0); + } + $this->newDimensions = array('newWidth' => $width, 'newHeight' => $height); + } + /** + * Calculates new image size based percentage + * + * @param int $width + * @param int $height + */ + public function calcImageSizePercent($width, $height) + { + if ($this->percent > 0) { + $this->newDimensions = $this->calcPercent($width, $height); + } + } + /** + * Displays error image + * + */ + public function showErrorImage() + { + header('Content-type: image/png'); + $errImg = ImageCreate(220, 25); + $bgColor = imagecolorallocate($errImg, 0, 0, 0); + $fgColor1 = imagecolorallocate($errImg, 255, 255, 255); + $fgColor2 = imagecolorallocate($errImg, 255, 0, 0); + imagestring($errImg, 3, 6, 6, 'Error:', $fgColor2); + imagestring($errImg, 3, 55, 6, $this->errmsg, $fgColor1); + imagepng($errImg); + imagedestroy($errImg); + } + /** + * Resizes image to fixed Width x Height + * + * @param int $Width + * @param int $Height + */ + public function resizeFix($Width = 0, $Height = 0, $deprecated = 3) + { + $this->newWidth = $Width; + $this->newHeight = $Height; + if (function_exists('ImageCreateTrueColor')) { + $this->workingImage = ImageCreateTrueColor($this->newWidth, $this->newHeight); + } else { + $this->workingImage = ImageCreate($this->newWidth, $this->newHeight); + } + // ImageCopyResampled( + $this->imagecopyresampled($this->workingImage, $this->oldImage, 0, 0, 0, 0, $this->newWidth, $this->newHeight, $this->currentDimensions['width'], $this->currentDimensions['height']); + $this->oldImage = $this->workingImage; + $this->newImage = $this->workingImage; + $this->currentDimensions['width'] = $this->newWidth; + $this->currentDimensions['height'] = $this->newHeight; + } + /** + * Resizes image to maxWidth x maxHeight + * + * @param int $maxWidth + * @param int $maxHeight + */ + public function resize($maxWidth = 0, $maxHeight = 0, $deprecated = 3) + { + $this->maxWidth = $maxWidth; + $this->maxHeight = $maxHeight; + $this->calcImageSize($this->currentDimensions['width'], $this->currentDimensions['height']); + if (function_exists('ImageCreateTrueColor')) { + $this->workingImage = ImageCreateTrueColor($this->newDimensions['newWidth'], $this->newDimensions['newHeight']); + } else { + $this->workingImage = ImageCreate($this->newDimensions['newWidth'], $this->newDimensions['newHeight']); + } + // ImageCopyResampled( + $this->imagecopyresampled($this->workingImage, $this->oldImage, 0, 0, 0, 0, $this->newDimensions['newWidth'], $this->newDimensions['newHeight'], $this->currentDimensions['width'], $this->currentDimensions['height']); + $this->oldImage = $this->workingImage; + $this->newImage = $this->workingImage; + $this->currentDimensions['width'] = $this->newDimensions['newWidth']; + $this->currentDimensions['height'] = $this->newDimensions['newHeight']; + } + /** + * Resizes the image by $percent percent + * + * @param int $percent + */ + public function resizePercent($percent = 0) + { + $this->percent = $percent; + $this->calcImageSizePercent($this->currentDimensions['width'], $this->currentDimensions['height']); + if (function_exists('ImageCreateTrueColor')) { + $this->workingImage = ImageCreateTrueColor($this->newDimensions['newWidth'], $this->newDimensions['newHeight']); + } else { + $this->workingImage = ImageCreate($this->newDimensions['newWidth'], $this->newDimensions['newHeight']); + } + $this->ImageCopyResampled($this->workingImage, $this->oldImage, 0, 0, 0, 0, $this->newDimensions['newWidth'], $this->newDimensions['newHeight'], $this->currentDimensions['width'], $this->currentDimensions['height']); + $this->oldImage = $this->workingImage; + $this->newImage = $this->workingImage; + $this->currentDimensions['width'] = $this->newDimensions['newWidth']; + $this->currentDimensions['height'] = $this->newDimensions['newHeight']; + } + /** + * Crops the image from calculated center in a square of $cropSize pixels + * + * @param int $cropSize + */ + public function cropFromCenter($cropSize) + { + if ($cropSize > $this->currentDimensions['width']) { + $cropSize = $this->currentDimensions['width']; + } + if ($cropSize > $this->currentDimensions['height']) { + $cropSize = $this->currentDimensions['height']; + } + $cropX = intval(($this->currentDimensions['width'] - $cropSize) / 2); + $cropY = intval(($this->currentDimensions['height'] - $cropSize) / 2); + if (function_exists('ImageCreateTrueColor')) { + $this->workingImage = ImageCreateTrueColor($cropSize, $cropSize); + } else { + $this->workingImage = ImageCreate($cropSize, $cropSize); + } + $this->imagecopyresampled($this->workingImage, $this->oldImage, 0, 0, $cropX, $cropY, $cropSize, $cropSize, $cropSize, $cropSize); + $this->oldImage = $this->workingImage; + $this->newImage = $this->workingImage; + $this->currentDimensions['width'] = $cropSize; + $this->currentDimensions['height'] = $cropSize; + } + /** + * Advanced cropping function that crops an image using $startX and $startY as the upper-left hand corner. + * + * @param int $startX + * @param int $startY + * @param int $width + * @param int $height + */ + public function crop($startX, $startY, $width, $height) + { + //make sure the cropped area is not greater than the size of the image + if ($width > $this->currentDimensions['width']) { + $width = $this->currentDimensions['width']; + } + if ($height > $this->currentDimensions['height']) { + $height = $this->currentDimensions['height']; + } + //make sure not starting outside the image + if ($startX + $width > $this->currentDimensions['width']) { + $startX = $this->currentDimensions['width'] - $width; + } + if ($startY + $height > $this->currentDimensions['height']) { + $startY = $this->currentDimensions['height'] - $height; + } + if ($startX < 0) { + $startX = 0; + } + if ($startY < 0) { + $startY = 0; + } + if (function_exists('ImageCreateTrueColor')) { + $this->workingImage = ImageCreateTrueColor($width, $height); + } else { + $this->workingImage = ImageCreate($width, $height); + } + $this->imagecopyresampled($this->workingImage, $this->oldImage, 0, 0, $startX, $startY, $width, $height, $width, $height); + $this->oldImage = $this->workingImage; + $this->newImage = $this->workingImage; + $this->currentDimensions['width'] = $width; + $this->currentDimensions['height'] = $height; + } + /** + * Outputs the image to the screen, or saves to $name if supplied. Quality of JPEG images can be controlled with the $quality variable + * + * @param int $quality + * @param string $name + */ + public function show($quality = 100, $name = '') + { + switch ($this->format) { + case 'GIF': + if ($name != '') { + @ImageGif($this->newImage, $name) or $this->error = true; + } else { + header('Content-type: image/gif'); + ImageGif($this->newImage); + } + break; + case 'JPG': + if ($name != '') { + @ImageJpeg($this->newImage, $name, $quality) or $this->error = true; + } else { + header('Content-type: image/jpeg'); + ImageJpeg($this->newImage, NULL, $quality); + } + break; + case 'PNG': + if ($name != '') { + @ImagePng($this->newImage, $name) or $this->error = true; + } else { + header('Content-type: image/png'); + ImagePng($this->newImage); + } + break; + } + } + /** + * Saves image as $name (can include file path), with quality of # percent if file is a jpeg + * + * @param string $name + * @param int $quality + * @return bool errorstate + */ + public function save($name, $quality = 100) + { + $this->show($quality, $name); + if ($this->error == true) { + $this->errmsg = 'Create Image failed. Check safe mode settings'; + return false; + } + if (function_exists('do_action')) { + do_action('ngg_ajax_image_save', $name); + } + return true; + } + /** + * Creates Apple-style reflection under image, optionally adding a border to main image + * + * @param int $percent + * @param int $reflection + * @param int $white + * @param bool $border + * @param string $borderColor + */ + public function createReflection($percent, $reflection, $white, $border = true, $borderColor = '#a4a4a4') + { + $width = $this->currentDimensions['width']; + $height = $this->currentDimensions['height']; + $reflectionHeight = intval($height * ($reflection / 100)); + $newHeight = $height + $reflectionHeight; + $reflectedPart = $height * ($percent / 100); + $this->workingImage = ImageCreateTrueColor($width, $newHeight); + ImageAlphaBlending($this->workingImage, true); + $colorToPaint = ImageColorAllocateAlpha($this->workingImage, 255, 255, 255, 0); + ImageFilledRectangle($this->workingImage, 0, 0, $width, $newHeight, $colorToPaint); + imagecopyresampled($this->workingImage, $this->newImage, 0, 0, 0, $reflectedPart, $width, $reflectionHeight, $width, $height - $reflectedPart); + $this->imageFlipVertical(); + imagecopy($this->workingImage, $this->newImage, 0, 0, 0, 0, $width, $height); + imagealphablending($this->workingImage, true); + for ($i = 0; $i < $reflectionHeight; $i++) { + $colorToPaint = imagecolorallocatealpha($this->workingImage, 255, 255, 255, ($i / $reflectionHeight * -1 + 1) * $white); + imagefilledrectangle($this->workingImage, 0, $height + $i, $width, $height + $i, $colorToPaint); + } + if ($border == true) { + $rgb = $this->hex2rgb($borderColor, false); + $colorToPaint = imagecolorallocate($this->workingImage, $rgb[0], $rgb[1], $rgb[2]); + imageline($this->workingImage, 0, 0, $width, 0, $colorToPaint); + //top line + imageline($this->workingImage, 0, $height, $width, $height, $colorToPaint); + //bottom line + imageline($this->workingImage, 0, 0, 0, $height, $colorToPaint); + //left line + imageline($this->workingImage, $width - 1, 0, $width - 1, $height, $colorToPaint); + } + $this->oldImage = $this->workingImage; + $this->newImage = $this->workingImage; + $this->currentDimensions['width'] = $width; + $this->currentDimensions['height'] = $newHeight; + } + /** + * Flip an image. + * + * @param bool $horz flip the image in horizontal mode + * @param bool $vert flip the image in vertical mode + */ + public function flipImage($horz = false, $vert = false) + { + $sx = $vert ? $this->currentDimensions['width'] - 1 : 0; + $sy = $horz ? $this->currentDimensions['height'] - 1 : 0; + $sw = $vert ? -$this->currentDimensions['width'] : $this->currentDimensions['width']; + $sh = $horz ? -$this->currentDimensions['height'] : $this->currentDimensions['height']; + $this->workingImage = imagecreatetruecolor($this->currentDimensions['width'], $this->currentDimensions['height']); + $this->imagecopyresampled($this->workingImage, $this->oldImage, 0, 0, $sx, $sy, $this->currentDimensions['width'], $this->currentDimensions['height'], $sw, $sh); + $this->oldImage = $this->workingImage; + $this->newImage = $this->workingImage; + return true; + } + /** + * Rotate an image clockwise or counter clockwise + * + * @param string $direction could be CW or CCW + */ + public function rotateImage($dir = 'CW') + { + $angle = $dir == 'CW' ? 90 : -90; + return $this->rotateImageAngle($angle); + } + /** + * Rotate an image clockwise or counter clockwise + * + * @param string $direction could be CW or CCW + */ + public function rotateImageAngle($angle = 90) + { + if (function_exists('imagerotate')) { + $this->workingImage = imagerotate($this->oldImage, 360 - $angle, 0); + // imagerotate() rotates CCW + $this->currentDimensions['width'] = imagesx($this->workingImage); + $this->currentDimensions['height'] = imagesy($this->workingImage); + $this->oldImage = $this->workingImage; + $this->newImage = $this->workingImage; + return true; + } + $this->workingImage = imagecreatetruecolor($this->currentDimensions['height'], $this->currentDimensions['width']); + imagealphablending($this->workingImage, false); + imagesavealpha($this->workingImage, true); + switch ($angle) { + case 90: + for ($x = 0; $x < $this->currentDimensions['width']; $x++) { + for ($y = 0; $y < $this->currentDimensions['height']; $y++) { + if (!imagecopy($this->workingImage, $this->oldImage, $this->currentDimensions['height'] - $y - 1, $x, $x, $y, 1, 1)) { + return false; + } + } + } + break; + case -90: + for ($x = 0; $x < $this->currentDimensions['width']; $x++) { + for ($y = 0; $y < $this->currentDimensions['height']; $y++) { + if (!imagecopy($this->workingImage, $this->oldImage, $y, $this->currentDimensions['width'] - $x - 1, $x, $y, 1, 1)) { + return false; + } + } + } + break; + default: + return false; + } + $this->currentDimensions['width'] = imagesx($this->workingImage); + $this->currentDimensions['height'] = imagesy($this->workingImage); + $this->oldImage = $this->workingImage; + $this->newImage = $this->workingImage; + return true; + } + /** + * Inverts working image, used by reflection function + * + * @access private + */ + public function imageFlipVertical() + { + $x_i = imagesx($this->workingImage); + $y_i = imagesy($this->workingImage); + for ($x = 0; $x < $x_i; $x++) { + for ($y = 0; $y < $y_i; $y++) { + imagecopy($this->workingImage, $this->workingImage, $x, $y_i - $y - 1, $x, $y, 1, 1); + } + } + } + /** + * Converts hexidecimal color value to rgb values and returns as array/string + * + * @param string $hex + * @param bool $asString + * @return array|string + */ + public function hex2rgb($hex, $asString = false) + { + // strip off any leading # + if (0 === strpos($hex, '#')) { + $hex = substr($hex, 1); + } else { + if (0 === strpos($hex, '&H')) { + $hex = substr($hex, 2); + } + } + // break into hex 3-tuple + $cutpoint = ceil(strlen($hex) / 2) - 1; + $rgb = explode(':', wordwrap($hex, $cutpoint, ':', $cutpoint), 3); + // convert each tuple to decimal + $rgb[0] = isset($rgb[0]) ? hexdec($rgb[0]) : 0; + $rgb[1] = isset($rgb[1]) ? hexdec($rgb[1]) : 0; + $rgb[2] = isset($rgb[2]) ? hexdec($rgb[2]) : 0; + return $asString ? "{$rgb[0]} {$rgb[1]} {$rgb[2]}" : $rgb; + } + /** + * Based on the Watermark function by Marek Malcherek + * http://www.malcherek.de + * + * @param string $color + * @param string $wmFont + * @param int $wmSize + * @param int $wmOpaque + */ + public function watermarkCreateText($color = '000000', $wmFont, $wmSize = 10, $wmOpaque = 90) + { + // set font path + $wmFontPath = NGGALLERY_ABSPATH . 'fonts/' . $wmFont; + if (!is_readable($wmFontPath)) { + return; + } + // This function requires both the GD library and the FreeType library. + if (!function_exists('ImageTTFBBox')) { + return; + } + $words = preg_split('/ /', $this->watermarkText); + $lines = array(); + $line = ''; + $watermark_image_width = 0; + // attempt adding a new word until the width is too large; then start a new line and start again + foreach ($words as $word) { + // sanitize the text being input; imagettftext() can be sensitive + $TextSize = $this->ImageTTFBBoxDimensions($wmSize, 0, $wmFontPath, $line . preg_replace('~^(&([a-zA-Z0-9]);)~', htmlentities('${1}'), mb_convert_encoding($word, 'HTML-ENTITIES', 'UTF-8'))); + if ($watermark_image_width == 0) { + $watermark_image_width = $TextSize['width']; + } + if ($TextSize['width'] > $this->newDimensions['newWidth']) { + $lines[] = trim($line); + $line = ''; + } else { + if ($TextSize['width'] > $watermark_image_width) { + $watermark_image_width = $TextSize['width']; + } + } + $line .= $word . ' '; + } + $lines[] = trim($line); + // use this string to determine our largest possible line height + $line_dimensions = $this->ImageTTFBBoxDimensions($wmSize, 0, $wmFontPath, 'MXQJALYmxqjabdfghjklpqry019`@$^&*(,!132'); + $line_height = $line_dimensions['height'] * 1.05; + // Create an image to apply our text to + $this->workingImage = ImageCreateTrueColor($watermark_image_width, count($lines) * $line_height); + ImageSaveAlpha($this->workingImage, true); + ImageAlphaBlending($this->workingImage, false); + $bgText = imagecolorallocatealpha($this->workingImage, 255, 255, 255, 127); + imagefill($this->workingImage, 0, 0, $bgText); + $wmTransp = 127 - $wmOpaque * 1.27; + $rgb = $this->hex2rgb($color, false); + $TextColor = imagecolorallocatealpha($this->workingImage, $rgb[0], $rgb[1], $rgb[2], $wmTransp); + // Put text on the image, line-by-line + $y_pos = $wmSize; + foreach ($lines as $line) { + imagettftext($this->workingImage, $wmSize, 0, 0, $y_pos, $TextColor, $wmFontPath, $line); + $y_pos += $line_height; + } + $this->watermarkImgPath = $this->workingImage; + return; + } + /** + * Calculates the width & height dimensions of ImageTTFBBox(). + * + * Note: ImageTTFBBox() is unreliable with large font sizes + * @param $wmSize + * @param $fontAngle + * @param $wmFontPath + * @param $text + * @return array + */ + public function ImageTTFBBoxDimensions($wmSize, $fontAngle, $wmFontPath, $text) + { + $box = @ImageTTFBBox($wmSize, $fontAngle, $wmFontPath, $text) or die; + $max_x = max(array($box[0], $box[2], $box[4], $box[6])); + $max_y = max(array($box[1], $box[3], $box[5], $box[7])); + $min_x = min(array($box[0], $box[2], $box[4], $box[6])); + $min_y = min(array($box[1], $box[3], $box[5], $box[7])); + return array('width' => $max_x - $min_x, 'height' => $max_y - $min_y); + } + /** + * Modfied Watermark function by Steve Peart + * http://parasitehosting.com/ + * + * @param string $relPOS + * @param int $xPOS + * @param int $yPOS + */ + public function watermarkImage($relPOS = 'botRight', $xPOS = 0, $yPOS = 0) + { + // if it's a resource ID take it as watermark text image + if (is_resource($this->watermarkImgPath)) { + $this->workingImage = $this->watermarkImgPath; + } else { + // (possibly) search for the file from the document root + if (!is_file($this->watermarkImgPath)) { + $fs = C_Fs::get_instance(); + if (is_file($fs->join_paths($fs->get_document_root('content'), $this->watermarkImgPath))) { + $this->watermarkImgPath = $fs->get_document_root('content') . $this->watermarkImgPath; + } + } + // Would you really want to use anything other than a png? + $this->workingImage = @imagecreatefrompng($this->watermarkImgPath); + // if it's not a valid file die... + if (empty($this->workingImage) or !$this->workingImage) { + return; + } + } + imagealphablending($this->workingImage, false); + imagesavealpha($this->workingImage, true); + $sourcefile_width = imageSX($this->oldImage); + $sourcefile_height = imageSY($this->oldImage); + $watermarkfile_width = imageSX($this->workingImage); + $watermarkfile_height = imageSY($this->workingImage); + switch (substr($relPOS, 0, 3)) { + case 'top': + $dest_y = 0 + $yPOS; + break; + case 'mid': + $dest_y = $sourcefile_height / 2 - $watermarkfile_height / 2; + break; + case 'bot': + $dest_y = $sourcefile_height - $watermarkfile_height - $yPOS; + break; + default: + $dest_y = 0; + break; + } + switch (substr($relPOS, 3)) { + case 'Left': + $dest_x = 0 + $xPOS; + break; + case 'Center': + $dest_x = $sourcefile_width / 2 - $watermarkfile_width / 2; + break; + case 'Right': + $dest_x = $sourcefile_width - $watermarkfile_width - $xPOS; + break; + default: + $dest_x = 0; + break; + } + // debug + // $this->errmsg = 'X '.$dest_x.' Y '.$dest_y; + // $this->showErrorImage(); + // if a gif, we have to upsample it to a truecolor image + if ($this->format == 'GIF') { + $tempimage = imagecreatetruecolor($sourcefile_width, $sourcefile_height); + imagecopy($tempimage, $this->oldImage, 0, 0, 0, 0, $sourcefile_width, $sourcefile_height); + $this->newImage = $tempimage; + } + $this->imagecopymerge_alpha($this->newImage, $this->workingImage, $dest_x, $dest_y, 0, 0, $watermarkfile_width, $watermarkfile_height, 100); + } + /** + * Wrapper to imagecopymerge() that allows PNG transparency + */ + public function imagecopymerge_alpha($destination_image, $source_image, $destination_x, $destination_y, $source_x, $source_y, $source_w, $source_h, $pct) + { + $cut = imagecreatetruecolor($source_w, $source_h); + imagecopy($cut, $destination_image, 0, 0, $destination_x, $destination_y, $source_w, $source_h); + imagecopy($cut, $source_image, 0, 0, $source_x, $source_y, $source_w, $source_h); + imagecopymerge($destination_image, $cut, $destination_x, $destination_y, 0, 0, $source_w, $source_h, $pct); + } + /** + * Modfied imagecopyresampled function to save transparent images + * See : http://www.akemapa.com/2008/07/10/php-gd-resize-transparent-image-png-gif/ + * @since 1.9.0 + * + * @param resource $dst_image + * @param resource $src_image + * @param int $dst_x + * @param int $dst_y + * @param int $src_x + * @param int $src_y + * @param int $dst_w + * @param int $dst_h + * @param int $src_w + * @param int $src_h + * @return bool + */ + public function imagecopyresampled(&$dst_image, $src_image, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h) + { + // Check if this image is PNG or GIF, then set if Transparent + if ($this->format == 'GIF' || $this->format == 'PNG') { + imagealphablending($dst_image, false); + imagesavealpha($dst_image, true); + $transparent = imagecolorallocatealpha($dst_image, 255, 255, 255, 127); + imagefilledrectangle($dst_image, 0, 0, $dst_w, $dst_h, $transparent); + } + imagecopyresampled($dst_image, $src_image, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h); + return true; + } +} +class Mixin_WordPress_GalleryStorage_Driver extends Mixin +{ + /** + * Returns the named sizes available for images + * @global array $_wp_additional_image_sizese + * @return array + */ + public function get_image_sizes() + { + global $_wp_additional_image_sizes; + $_wp_additional_image_sizes[] = 'full'; + return $_wp_additional_image_sizes; + } + /** + * Gets the upload path for new images in this gallery + * This will always be the date-based directory + * @param type $gallery + * @return type + */ + public function get_upload_abspath($gallery = FALSE) + { + // Gallery is used for this driver, as the upload path is + // the same, regardless of what gallery is used + $retval = FALSE; + $dir = wp_upload_dir(time()); + if ($dir) { + $retval = $dir['path']; + } + return $retval; + } + /** + * Will always return the same as get_upload_abspath(), as + * WordPress storage is not organized by gallery but by date + * @param int|object $gallery + */ + public function get_gallery_abspath($gallery = FALSE) + { + return $this->object->get_upload_abspath(); + } + /** + * Gets the url of a particular sized image + * @param int|object $image + * @param type $size + * @return string + */ + public function get_image_url($image = FALSE, $size = 'full') + { + $retval = NULL; + $image_key = C_Displayed_Gallery_Mapper::get_instance()->get_primary_key_column(); + if ($image && ($image_id = $this->object->_get_image_id($image))) { + $parts = wp_get_attachment_image_src($image->{$image_key}); + if ($parts) { + $retval = $parts['url']; + } + } + return apply_filters('ngg_get_image_url', $retval, $image, $size); + } +} +class C_WordPress_GalleryStorage_Driver extends C_GalleryStorage_Driver_Base +{ + public function define($context = FALSE) + { + parent::define($context); + $this->add_mixin('Mixin_WordPress_GalleryStorage_Driver'); + } +} +class Mixin_NextGen_Table_Extras extends Mixin +{ + const CUSTOM_POST_NAME = __CLASS__; + public function initialize() + { + // Each record in a NextGEN Gallery table has an associated custom post in the wp_posts table + $this->object->_custom_post_mapper = new C_CustomPost_DataMapper_Driver($this->object->get_object_name()); + $this->object->_custom_post_mapper->set_model_factory_method('extra_fields'); + } + /** + * Defines a column for the mapper + * @param $name + * @param $data_type + * @param null $default_value + * @param bool $extra + */ + public function define_column($name, $data_type, $default_value = NULL, $extra = FALSE) + { + $this->call_parent('define_column', $name, $data_type, $default_value); + if ($extra) { + $this->object->_columns[$name]['extra'] = TRUE; + } else { + $this->object->_columns[$name]['extra'] = FALSE; + } + } + /** + * Gets a list of all the extra columns defined for this table + * @return array + */ + public function get_extra_columns() + { + $retval = array(); + foreach ($this->object->_columns as $key => $properties) { + if ($properties['extra']) { + $retval[] = $key; + } + } + return $retval; + } + /** + * Adds a column to the database + * @param $column_name + * @param $datatype + * @param null $default_value + */ + public function _add_column($column_name, $datatype, $default_value = NULL) + { + $skip = FALSE; + if (isset($this->object->_columns[$column_name]) and $this->object->_columns[$column_name]['extra']) { + $skip = TRUE; + } + if (!$skip) { + $this->call_parent('_add_column', $column_name, $datatype, $default_value); + } + return !$skip; + } + public function create_custom_post_entity($entity) + { + $custom_post_entity = new stdClass(); + // If the custom post entity already exists then it needs + // an ID + if (isset($entity->extras_post_id)) { + $custom_post_entity->ID = $entity->extras_post_id; + } + // If a property isn't a column for the table, then + // it belongs to the custom post record + foreach (get_object_vars($entity) as $key => $value) { + if (!$this->object->has_column($key)) { + unset($entity->{$key}); + if ($this->object->has_defined_column($key) && $key != $this->object->get_primary_key_column()) { + $custom_post_entity->{$key} = $value; + } + } + } + // Used to help find these type of records + $custom_post_entity->post_name = self::CUSTOM_POST_NAME; + return $custom_post_entity; + } + /** + * Creates a new record in the custom table, as well as a custom post record + * @param $entity + */ + public function _create($entity) + { + $retval = FALSE; + $custom_post_entity = $this->create_custom_post_entity($entity); + // Try persisting the custom post type record first + if ($custom_post_id = $this->object->_custom_post_mapper->save($custom_post_entity)) { + // Try saving the custom table record. If that fails, then destroy the previously + // created custom post type record + if (!($retval = $this->call_parent('_create', $entity))) { + $this->object->_custom_post_mapper->destroy($custom_post_id); + } else { + $entity->extras_post_id = $custom_post_id; + } + } + return $retval; + } + // Updates a custom table record and it's associated custom post type record in the database + public function _update($entity) + { + $retval = FALSE; + $custom_post_entity = $this->create_custom_post_entity($entity); + $custom_post_id = $this->object->_custom_post_mapper->save($custom_post_entity); + $entity->extras_post_id = $custom_post_id; + $retval = $this->call_parent('_update', $entity); + foreach ($this->get_extra_columns() as $key) { + if (isset($custom_post_entity->{$key})) { + $entity->{$key} = $custom_post_entity->{$key}; + } + } + return $retval; + } + public function destroy($entity) + { + if (isset($entity->extras_post_id)) { + wp_delete_post($entity->extras_post_id, TRUE); + } + return $this->call_parent('destroy', $entity); + } + public function _regex_replace($in) + { + global $wpdb; + $from = 'FROM `' . $this->object->get_table_name() . '`'; + $out = str_replace('FROM', ', GROUP_CONCAT(CONCAT_WS(\'@@\', meta_key, meta_value)) AS \'extras\' FROM', $in); + $out = str_replace($from, "{$from} LEFT OUTER JOIN `{$wpdb->postmeta}` ON `{$wpdb->postmeta}`.`post_id` = `extras_post_id` ", $out); + return $out; + } + /** + * Gets the generated query + */ + public function get_generated_query() + { + // Add extras column + if ($this->object->is_select_statement() && stripos($this->object->_select_clause, 'count(') === FALSE) { + $table_name = $this->object->get_table_name(); + $primary_key = "{$table_name}.{$this->object->get_primary_key_column()}"; + if (stripos($this->object->_select_clause, 'DISTINCT') === FALSE) { + $this->object->_select_clause = str_replace('SELECT', 'SELECT DISTINCT', $this->object->_select_clause); + } + $this->object->group_by($primary_key); + $sql = $this->call_parent('get_generated_query'); + // Sections may be omitted by wrapping them in mysql/C style comments + if (stripos($sql, '/*NGG_NO_EXTRAS_TABLE*/') !== FALSE) { + $parts = explode('/*NGG_NO_EXTRAS_TABLE*/', $sql); + foreach ($parts as $ndx => $row) { + if ($ndx % 2 != 0) { + continue; + } + $parts[$ndx] = $this->_regex_replace($row); + } + $sql = implode('', $parts); + } else { + $sql = $this->_regex_replace($sql); + } + } else { + $sql = $this->call_parent('get_generated_query'); + } + return $sql; + } + public function _convert_to_entity($entity) + { + // Add extra columns to entity + if (isset($entity->extras)) { + $extras = $entity->extras; + unset($entity->extras); + foreach (explode(',', $extras) as $extra) { + if ($extra) { + list($key, $value) = explode('@@', $extra); + if ($this->object->has_defined_column($key) && !isset($entity->key)) { + $entity->{$key} = $value; + } + } + } + } + // Cast custom_post_id as integer + if (isset($entity->extras_post_id)) { + $entity->extras_post_id = intval($entity->extras_post_id); + } else { + $entity->extras_post_id = 0; + } + $retval = $this->call_parent('_convert_to_entity', $entity); + return $entity; + } +} \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/module.nextgen_gallery_display.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/module.nextgen_gallery_display.php index 38335add4ab984363901806d728f2e954cb7c466..b28a205c3bdec3cbfb0275d68a9eb7be477c06e2 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/module.nextgen_gallery_display.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/module.nextgen_gallery_display.php @@ -11,6 +11,8 @@ define('NGG_DISPLAY_PRIORITY_BASE', 10000); define('NGG_DISPLAY_PRIORITY_STEP', 2000); if (!defined('NGG_RENDERING_CACHE_TTL')) define('NGG_RENDERING_CACHE_TTL', PHOTOCRATI_CACHE_TTL); if (!defined('NGG_DISPLAYED_GALLERY_CACHE_TTL')) define('NGG_DISPLAYED_GALLERY_CACHE_TTL', PHOTOCRATI_CACHE_TTL); +if (!defined('NGG_RENDERING_CACHE_ENABLED')) define('NGG_RENDERING_CACHE_ENABLED', PHOTOCRATI_CACHE); +if (!defined('NGG_SHOW_DISPLAYED_GALLERY_ERRORS')) define('NGG_SHOW_DISPLAYED_GALLERY_ERRORS', NGG_DEBUG); class M_Gallery_Display extends C_Base_Module { @@ -20,14 +22,13 @@ class M_Gallery_Display extends C_Base_Module 'photocrati-nextgen_gallery_display', 'Gallery Display', 'Provides the ability to display gallery of images', - '0.9', + '0.13', 'http://www.photocrati.com', 'Photocrati Media', 'http://www.photocrati.com' ); - include_once('class.gallery_display_installer.php'); - C_Photocrati_Installer::add_handler($this->module_id, 'C_Gallery_Display_Installer'); + C_Photocrati_Installer::add_handler($this->module_id, 'C_Display_Type_Installer'); } @@ -36,12 +37,22 @@ class M_Gallery_Display extends C_Base_Module */ function _register_utilities() { - // This utility provides a controller to render the settings form - // for a display type, or render the front-end of a display type - $this->get_registry()->add_utility( - 'I_Display_Type_Controller', - 'C_Display_Type_Controller' - ); + // Register frontend-only components + if (apply_filters('ngg_load_frontend_logic', TRUE, $this->module_id)) + { + // This utility provides a controller to render the settings form + // for a display type, or render the front-end of a display type + $this->get_registry()->add_utility( + 'I_Display_Type_Controller', + 'C_Display_Type_Controller' + ); + + // This utility provides the capabilities of rendering a display type + $this->get_registry()->add_utility( + 'I_Displayed_Gallery_Renderer', + 'C_Displayed_Gallery_Renderer' + ); + } // This utility provides a datamapper for Display Types $this->get_registry()->add_utility( @@ -56,20 +67,6 @@ class M_Gallery_Display extends C_Base_Module 'I_Displayed_Gallery_Mapper', 'C_Displayed_Gallery_Mapper' ); - - // This utility provides a datamapper for Displayed Gallery Sources. A - // source instructs a displayed gallery where the entities are to be - // fetched from - e.g. galleries, albums, etc. - $this->get_registry()->add_utility( - 'I_Displayed_Gallery_Source_Mapper', - 'C_Displayed_Gallery_Source_Mapper' - ); - - // This utility provides the capabilities of rendering a display type - $this->get_registry()->add_utility( - 'I_Displayed_Gallery_Renderer', - 'C_Displayed_Gallery_Renderer' - ); } /** @@ -88,16 +85,21 @@ class M_Gallery_Display extends C_Base_Module 'I_Page_Manager', 'A_Display_Settings_Page' ); - } - $this->_get_registry()->add_adapter( - 'I_Ajax_Controller', - 'A_Gallery_Display_Ajax' - ); + $this->get_registry()->add_adapter( + 'I_NextGen_Admin_Page', + 'A_Display_Settings_Controller', + NGG_DISPLAY_SETTINGS_SLUG + ); + } - $this->get_registry()->add_adapter('I_MVC_View', 'A_Gallery_Display_View'); - $this->get_registry()->add_adapter('I_MVC_View', 'A_Displayed_Gallery_Trigger_Element'); - $this->get_registry()->add_adapter('I_Display_Type_Controller', 'A_Displayed_Gallery_Trigger_Resources'); + // Frontend-only components + if (apply_filters('ngg_load_frontend_logic', TRUE, $this->module_id)) + { + $this->get_registry()->add_adapter('I_MVC_View', 'A_Gallery_Display_View'); + $this->get_registry()->add_adapter('I_MVC_View', 'A_Displayed_Gallery_Trigger_Element'); + $this->get_registry()->add_adapter('I_Display_Type_Controller', 'A_Displayed_Gallery_Trigger_Resources'); + } } /** @@ -105,16 +107,87 @@ class M_Gallery_Display extends C_Base_Module */ function _register_hooks() { - // Add a shortcode for displaying galleries - C_NextGen_Shortcode_Manager::add('ngg_images', array(&$this, 'display_images')); - add_action('init', array(&$this, '_register_resources')); + if (apply_filters('ngg_load_frontend_logic', TRUE, $this->module_id)) + { + C_NextGen_Shortcode_Manager::add('ngg_images', array(&$this, 'display_images')); + add_action('wp_enqueue_scripts', array(&$this, 'no_resources_mode'), PHP_INT_MAX-1); + add_filter('the_content', array($this, '_render_related_images')); + } + + add_action('init', array(&$this, 'register_resources'), 12); add_action('admin_bar_menu', array(&$this, 'add_admin_bar_menu'), 100); - add_filter('the_content', array($this, '_render_related_images')); - add_action('wp_enqueue_scripts', array(&$this, 'no_resources_mode'), PHP_INT_MAX-1); add_filter('run_ngg_resource_manager', array(&$this, 'no_resources_mode')); add_action('init', array(&$this, 'serve_fontawesome'), 15); + + // Add hook to delete displayed galleries when removed from a post + add_action('pre_post_update', array(&$this, 'locate_stale_displayed_galleries')); + add_action('before_delete_post', array(&$this, 'locate_stale_displayed_galleries')); + add_action('post_updated', array(&$this, 'cleanup_displayed_galleries')); + add_action('after_delete_post', array(&$this, 'cleanup_displayed_galleries')); + + add_action('wp_print_styles', array($this, 'fix_nextgen_custom_css_order'), PHP_INT_MAX-1); } + /** + * This moves the NextGen custom CSS to the last of the queue + */ + function fix_nextgen_custom_css_order() + { + global $wp_styles; + if (in_array('nggallery', $wp_styles->queue)) + { + foreach ($wp_styles->queue as $ndx => $style) { + if ($style == 'nggallery') + { + unset($wp_styles->queue[$ndx]); + $wp_styles->queue[] = 'nggallery'; + break; + } + } + } + } + + /** + * Locates the ids of displayed galleries that have been + * removed from the post, and flags then for cleanup (deletion) + * @global array $displayed_galleries_to_cleanup + * @param int $post_id + */ + function locate_stale_displayed_galleries($post_id) + { + global $displayed_galleries_to_cleanup; + $displayed_galleries_to_cleanup = array(); + $post = get_post($post_id); + $gallery_preview_url = C_NextGen_Settings::get_instance()->get('gallery_preview_url'); + $preview_url = preg_quote($gallery_preview_url, '#'); + if (preg_match_all("#{$preview_url}/id--(\d+)#", html_entity_decode($post->post_content), $matches, PREG_SET_ORDER)) { + foreach ($matches as $match) { + $preview_url = preg_quote($match[0], '/'); + // The post was edited, and the displayed gallery placeholder was removed + if (isset($_REQUEST['post_content']) && (!preg_match("/{$preview_url}/", $_POST['post_content']))) { + $displayed_galleries_to_cleanup[] = intval($match[1]); + } + // The post was deleted + elseif (!isset($_REQUEST['action'])) { + $displayed_galleries_to_cleanup[] = intval($match[1]); + } + } + } + } + + /** + * Deletes any displayed galleries that are no longer associated with + * a post/page + * @global array $displayed_galleries_to_cleanup + * @param int $post_id + */ + function cleanup_displayed_galleries($post_id) + { + global $displayed_galleries_to_cleanup; + $mapper = C_Displayed_Gallery_Mapper::get_instance(); + foreach ($displayed_galleries_to_cleanup as $id) $mapper->destroy($id); + } + /** * Serves the fontawesome woff file via PHP. We do this, as IIS won't serve .woff files. * @throws E_Clean_Exit @@ -122,7 +195,7 @@ class M_Gallery_Display extends C_Base_Module function serve_fontawesome() { if (isset($_REQUEST['ngg_serve_fontawesome_woff'])) { - $fs = $this->get_registry()->get_utility('I_Fs'); + $fs = C_Fs::get_instance(); $abspath = $fs->find_static_abspath('photocrati-nextgen_gallery_display#fonts/fontawesome-webfont.woff'); if ($abspath) { header("Content-Type: application/x-font-woff"); @@ -131,7 +204,7 @@ class M_Gallery_Display extends C_Base_Module } } elseif (isset($_REQUEST['ngg_serve_fontawesome_css'])) { - $fs = $this->get_registry()->get_utility('I_Fs'); + $fs = C_Fs::get_instance(); $abspath = $fs->find_static_abspath('photocrati-nextgen_gallery_display#fontawesome/font-awesome.css'); if ($abspath) { $file_content = file_get_contents($abspath); @@ -143,6 +216,20 @@ class M_Gallery_Display extends C_Base_Module } } + static function enqueue_fontawesome() + { + if (!wp_style_is('fontawesome', 'registered')) + { + if (strpos(strtolower($_SERVER['SERVER_SOFTWARE']), 'microsoft-iis') !== FALSE) { + wp_register_style('fontawesome', site_url('/?ngg_serve_fontawesome_css=1')); + } else { + $router = C_Router::get_instance(); + wp_register_style('fontawesome', $router->get_static_url('photocrati-nextgen_gallery_display#fontawesome/font-awesome.css')); + } + } + + wp_enqueue_style('fontawesome'); + } function no_resources_mode($valid_request=TRUE) { @@ -160,44 +247,44 @@ class M_Gallery_Display extends C_Base_Module return $valid_request; } - function _render_related_string() + static function _render_related_string($sluglist=array(), $maxImages=NULL, $type=NULL) { $settings = C_NextGen_Settings::get_instance(); - $type = $settings->appendType; - $maxImages = $settings->maxImages; - $sluglist = array(); - - switch ($type) { - case 'tags': - if (function_exists('get_the_tags')) - { - $taglist = get_the_tags(); - if (is_array($taglist)) { - foreach ($taglist as $tag) { - $sluglist[] = $tag->slug; - } - } - } - break; - case 'category': - $catlist = get_the_category(); - if (is_array($catlist)) - { - foreach ($catlist as $cat) { - $sluglist[] = $cat->category_nicename; - } - } - break; - } + if (is_null($type)) $type = $settings->appendType; + if (is_null($maxImages)) $maxImages = $settings->maxImages; + + if (!$sluglist) { + switch ($type) { + case 'tags': + if (function_exists('get_the_tags')) + { + $taglist = get_the_tags(); + if (is_array($taglist)) { + foreach ($taglist as $tag) { + $sluglist[] = $tag->slug; + } + } + } + break; + case 'category': + $catlist = get_the_category(); + if (is_array($catlist)) + { + foreach ($catlist as $cat) { + $sluglist[] = $cat->category_nicename; + } + } + break; + } + } $taglist = implode(',', $sluglist); if ($taglist === 'uncategorized' || empty($taglist)) return; - $renderer = C_Component_Registry::get_instance()->get_utility('I_Displayed_Gallery_Renderer'); - $view = C_Component_Registry::get_instance()->get_utility('I_Component_Factory') - ->create('mvc_view', ''); + $renderer = C_Displayed_Gallery_Renderer::get_instance(); + $view = C_Component_Factory::get_instance()->create('mvc_view', ''); $retval = $renderer->display_images(array( 'source' => 'tags', 'container_ids' => $taglist, @@ -211,6 +298,8 @@ class M_Gallery_Display extends C_Base_Module 'display_no_images_error' => FALSE )); + if ($retval) wp_enqueue_style('nextgen_gallery_related_images'); + return apply_filters('ngg_show_related_gallery_content', $retval, $taglist); } @@ -219,7 +308,7 @@ class M_Gallery_Display extends C_Base_Module $settings = C_NextGen_Settings::get_instance(); if ($settings->get('activateTags')) { - $related = $this->_render_related_string(); + $related = self::_render_related_string(); if ($related != null) { $heading = $settings->relatedHeading; @@ -250,7 +339,7 @@ class M_Gallery_Display extends C_Base_Module /** * Registers our static settings resources so the ATP module can find them later */ - function _register_resources() + function register_resources() { // Register custom post types for compatibility $types = array( @@ -265,8 +354,7 @@ class M_Gallery_Display extends C_Base_Module 'exclude_from_search' => TRUE, )); } - - $router = $this->get_registry()->get_utility('I_Router'); + $router = C_Router::get_instance(); wp_register_script( 'nextgen_gallery_display_settings', @@ -279,15 +367,15 @@ class M_Gallery_Display extends C_Base_Module $router->get_static_url('photocrati-nextgen_gallery_display#nextgen_gallery_display_settings.css') ); - wp_register_style( - 'nextgen_gallery_related_images', - $router->get_static_url('photocrati-nextgen_gallery_display#nextgen_gallery_related_images.css') - ); - if (!is_admin()) - wp_enqueue_style('nextgen_gallery_related_images'); - - wp_register_script('ngg_common', $router->get_static_url('photocrati-nextgen_gallery_display#common.js'), array('jquery')); - wp_register_style('ngg_trigger_buttons', $router->get_static_url('photocrati-nextgen_gallery_display#trigger_buttons.css')); + if (apply_filters('ngg_load_frontend_logic', TRUE, $this->module_id)) + { + wp_register_style( + 'nextgen_gallery_related_images', + $router->get_static_url('photocrati-nextgen_gallery_display#nextgen_gallery_related_images.css') + ); + wp_register_script('ngg_common', $router->get_static_url('photocrati-nextgen_gallery_display#common.js'), array('jquery', 'photocrati_ajax'), NGG_PLUGIN_VERSION, TRUE); + wp_register_style('ngg_trigger_buttons', $router->get_static_url('photocrati-nextgen_gallery_display#trigger_buttons.css')); + } } @@ -314,7 +402,7 @@ class M_Gallery_Display extends C_Base_Module */ function display_images($params, $inner_content=NULL) { - $renderer = $this->get_registry()->get_utility('I_Displayed_Gallery_Renderer'); + $renderer = C_Displayed_Gallery_Renderer::get_instance(); return $renderer->display_images($params, $inner_content); } @@ -338,33 +426,118 @@ class M_Gallery_Display extends C_Base_Module 'C_Displayed_Gallery_Trigger_Manager' => 'class.displayed_gallery_trigger_manager.php', 'A_Displayed_Gallery_Trigger_Element' => 'adapter.displayed_gallery_trigger_element.php', 'A_Displayed_Gallery_Trigger_Resources' => 'adapter.displayed_gallery_trigger_resources.php', - 'A_Gallery_Display_Ajax' => 'adapter.gallery_display_ajax.php', 'A_Display_Settings_Controller' => 'adapter.display_settings_controller.php', 'A_Display_Settings_Page' => 'adapter.display_settings_page.php', 'A_Gallery_Display_Factory' => 'adapter.gallery_display_factory.php', - 'C_Gallery_Display_Installer' => 'class.gallery_display_installer.php', + 'C_Display_Type_Installer' => 'class.gallery_display_installer.php', 'A_Gallery_Display_View' => 'adapter.gallery_display_view.php', 'C_Displayed_Gallery' => 'class.displayed_gallery.php', 'C_Displayed_Gallery_Mapper' => 'class.displayed_gallery_mapper.php', 'C_Displayed_Gallery_Renderer' => 'class.displayed_gallery_renderer.php', - 'C_Displayed_Gallery_Source' => 'class.displayed_gallery_source.php', - 'C_Displayed_Gallery_Source_Mapper' => 'class.displayed_gallery_source_mapper.php', + 'C_Displayed_Gallery_Source_Manager' => 'class.displayed_gallery_source_manager.php', 'C_Display_Type' => 'class.display_type.php', 'C_Display_Type_Controller' => 'class.display_type_controller.php', 'C_Display_Type_Mapper' => 'class.display_type_mapper.php', 'Hook_Propagate_Thumbnail_Dimensions_To_Settings' => 'hook.propagate_thumbnail_dimensions_to_settings.php', - 'I_Displayed_Gallery' => 'interface.displayed_gallery.php', - 'I_Displayed_Gallery_Mapper' => 'interface.displayed_gallery_mapper.php', - 'I_Displayed_Gallery_Renderer' => 'interface.displayed_gallery_renderer.php', - 'I_Displayed_Gallery_Source' => 'interface.displayed_gallery_source.php', - 'I_Displayed_Gallery_Source_Mapper' => 'interface.displayed_gallery_source_mapper.php', - 'I_Display_Settings_Controller' => 'interface.display_settings_controller.php', - 'I_Display_Type' => 'interface.display_type.php', - 'I_Display_Type_Controller' => 'interface.display_type_controller.php', - 'I_Display_Type_Mapper' => 'interface.display_type_mapper.php', 'Mixin_Display_Type_Form' => 'mixin.display_type_form.php' ); } } +class C_Display_Type_Installer +{ + function get_registry() + { + return C_Component_Registry::get_instance(); + } + + /** + * Installs a display type + * @param string $name + * @param array $properties + */ + function install_display_type($name, $properties=array()) + { + // Try to find the existing entity. If it doesn't exist, we'll create + $fs = C_Fs::get_instance(); + $mapper = C_Display_Type_Mapper::get_instance(); + $display_type = $mapper->find_by_name($name); + if (!$display_type) $display_type = new stdClass; + + // Update the properties of the display type + $properties['name'] = $name; + $properties['installed_at_version'] = NGG_PLUGIN_VERSION; + foreach ($properties as $key=>$val) { + if ($key == 'preview_image_relpath') { + $val = $fs->find_static_abspath($val, FALSE, TRUE); + } + $display_type->$key = $val; + } + + // Save the entity + $retval = $mapper->save($display_type); + return $retval; + } + + /** + * Deletes all displayed galleries + */ + function uninstall_displayed_galleries() + { + $mapper = C_Displayed_Gallery_Mapper::get_instance(); + $mapper->delete()->run_query(); + } + + /** + * Uninstalls all display types + */ + function uninstall_display_types() + { + $mapper = C_Display_Type_Mapper::get_instance(); + $mapper->delete()->run_query(); + } + + /** + * Installs displayed gallery sources + */ + function install($reset=FALSE) + { + // Display types are registered in other modules + } + + /** + * Uninstalls this module + */ + function uninstall($hard = FALSE) + { + C_Photocrati_Transient_Manager::flush(); + + $this->uninstall_display_types(); + + // TODO temporary Don't remove galleries on uninstall + //if ($hard) $this->uninstall_displayed_galleries(); + } +} + +/** + * Show related images for a post/page. Ngglegacy function + * @param $taglist + * @param int $maxImages + */ +function nggShowRelatedGallery($taglist, $maxImages = 0) +{ + return M_Gallery_Display::_render_related_string($taglist, $maxImages, $type=NULL); +} + +function nggShowRelatedImages($type=NULL, $maxImages=0) +{ + return M_Gallery_Display::_render_related_string(NULL, $maxImages, $type); +} + +function the_related_images($type = 'tags', $maxNumbers = 7) +{ + echo nggShowRelatedImages($type, $maxNumbers); +} + + new M_Gallery_Display(); diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/package.module.nextgen_gallery_display.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/package.module.nextgen_gallery_display.php new file mode 100644 index 0000000000000000000000000000000000000000..372827c9fe71dbc98de3a10dc13f0665649cb3b8 --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/package.module.nextgen_gallery_display.php @@ -0,0 +1,2172 @@ +<?php +class A_Display_Settings_Controller extends Mixin +{ + /** + * Static resources required for the Display Settings page + */ + public function enqueue_backend_resources() + { + $this->call_parent('enqueue_backend_resources'); + wp_enqueue_style('nextgen_gallery_display_settings'); + wp_enqueue_script('nextgen_gallery_display_settings'); + } + public function get_page_title() + { + return __('Gallery Settings', 'nggallery'); + } + public function get_required_permission() + { + return 'NextGEN Change options'; + } +} +class A_Display_Settings_Page extends Mixin +{ + public function setup() + { + $this->object->add(NGG_DISPLAY_SETTINGS_SLUG, array('adapter' => 'A_Display_Settings_Controller', 'parent' => NGGFOLDER, 'before' => 'ngg_other_options')); + return $this->call_parent('setup'); + } +} +class A_Displayed_Gallery_Trigger_Element extends Mixin +{ + public function render_object() + { + $root_element = $this->call_parent('render_object'); + if (($displayed_gallery = $this->object->get_param('displayed_gallery')) && $this->object->get_param('display_type_rendering')) { + $triggers = C_Displayed_Gallery_Trigger_Manager::get_instance(); + $triggers->render($root_element, $displayed_gallery); + } + return $root_element; + } +} +class A_Displayed_Gallery_Trigger_Resources extends Mixin +{ + protected $run_once = FALSE; + public function enqueue_frontend_resources($displayed_gallery) + { + $this->call_parent('enqueue_frontend_resources', $displayed_gallery); + return $this->enqueue_displayed_gallery_trigger_buttons_resources($displayed_gallery); + } + public function enqueue_displayed_gallery_trigger_buttons_resources($displayed_gallery = FALSE) + { + $retval = FALSE; + M_Gallery_Display::enqueue_fontawesome(); + if (!$this->run_once && !empty($displayed_gallery) && !empty($displayed_gallery->display_settings['ngg_triggers_display']) && $displayed_gallery->display_settings['ngg_triggers_display'] !== 'never') { + $pro_active = FALSE; + if (defined('NGG_PRO_PLUGIN_VERSION')) { + $pro_active = 'NGG_PRO_PLUGIN_VERSION'; + } + if (defined('NEXTGEN_GALLERY_PRO_VERSION')) { + $pro_active = 'NEXTGEN_GALLERY_PRO_VERSION'; + } + if (!empty($pro_active)) { + $pro_active = constant($pro_active); + } + if (!is_admin() && (empty($pro_active) || version_compare($pro_active, '1.0.11') >= 0)) { + wp_enqueue_style('fontawesome'); + $retval = TRUE; + $this->run_once = TRUE; + } + } + return $retval; + } +} +class A_Gallery_Display_Factory extends Mixin +{ + /** + * Instantiates a Display Type + * @param C_DataMapper $mapper + * @param array|stdClass|C_DataMapper_Model $properties + * @param string|array|FALSE $context + */ + public function display_type($properties = array(), $mapper = FALSE, $context = FALSE) + { + return new C_Display_Type($properties, $mapper, $context); + } + /** + * Instantiates a Displayed Gallery + * @param C_DataMapper $mapper + * @param array|stdClass|C_DataMapper_Model $properties + * @param string|array|FALSE $context + */ + public function displayed_gallery($properties = array(), $mapper = FALSE, $context = FALSE) + { + return new C_Displayed_Gallery($properties, $mapper, $context); + } +} +class A_Gallery_Display_View extends Mixin +{ + /** + * Check whether to render certain kinds of extra additions to the view for a displayed gallery + * @param object $displayed_gallery + * @param string $template_id + * @param C_MVC_View_Element $root_element + * @param string $addition_type what kind of addition is being made 'layout', 'decoration', 'style', 'logic' etc. + * @return string|NULL + */ + public function _check_addition_rendering($displayed_gallery, $template_id, $root_element, $addition_type) + { + $view = $root_element->get_object(); + $mode = $view->get_param('render_mode'); + $ret = true; + switch ($addition_type) { + case 'layout': + $ret = !in_array($mode, array('bare', 'basic')); + break; + case 'decoration': + break; + case 'style': + break; + case 'logic': + break; + } + return $ret; + } +} +/** + * A Display Type is a component which renders a collection of images + * in a "gallery". + * + * Properties: + * - entity_types (gallery, album) + * - name (nextgen_basic-thumbnails) + * - title (NextGEN Basic Thumbnails) + */ +class C_Display_Type extends C_DataMapper_Model +{ + public $_mapper_interface = 'I_Display_Type_Mapper'; + public function define($properties = array(), $mapper = FALSE, $context = FALSE) + { + parent::define($mapper, $properties, $context); + $this->add_mixin('Mixin_Display_Type_Validation'); + $this->add_mixin('Mixin_Display_Type_Instance_Methods'); + $this->implement('I_Display_Type'); + } + /** + * Initializes a display type with properties + * @param FALSE|C_Display_Type_Mapper $mapper + * @param array|stdClass|C_Display_Type $properties + * @param FALSE|string|array $context + */ + public function initialize($properties = array(), $mapper = FALSE, $context = FALSE) + { + // If no mapper was specified, then get the mapper + if (!$mapper) { + $mapper = $this->get_registry()->get_utility($this->_mapper_interface); + } + // Construct the model + parent::initialize($mapper, $properties); + } + /** + * Allows a setting to be retrieved directly, rather than through the + * settings property + * @param string $property + * @return mixed + */ + public function &__get($property) + { + if (isset($this->settings) && isset($this->settings[$property])) { + $retval =& $this->settings[$property]; + return $retval; + } else { + return parent::__get($property); + } + } +} +class Mixin_Display_Type_Validation extends Mixin +{ + public function validation() + { + $this->object->validates_presence_of('entity_types'); + $this->object->validates_presence_of('name'); + $this->object->validates_presence_of('title'); + return $this->object->is_valid(); + } +} +/** + * Provides methods available for class instances + */ +class Mixin_Display_Type_Instance_Methods extends Mixin +{ + /** + * Determines if this display type is compatible with a displayed gallery + * source + * @param stdClass + * @return bool + */ + public function is_compatible_with_source($source) + { + return C_Displayed_Gallery_Source_Manager::get_instance()->is_compatible($source, $this); + } + public function get_order() + { + return NGG_DISPLAY_PRIORITY_BASE; + } +} +/** + * A Controller which displays the settings form for the display type, as + * well as the front-end display + */ +class C_Display_Type_Controller extends C_MVC_Controller +{ + static $_instances = array(); + public function define($context = FALSE) + { + parent::define($context); + $this->add_mixin('Mixin_Display_Type_Controller'); + $this->implement('I_Display_Type_Controller'); + } + /** + * Gets a singleton of the mapper + * @param string|array $context + * @return C_Display_Type_Controller + */ + public static function get_instance($context = FALSE) + { + if (!isset(self::$_instances[$context])) { + self::$_instances[$context] = new C_Display_Type_Controller($context); + } + return self::$_instances[$context]; + } +} +/** + * Provides instance methods for the C_Display_Type_Controller class + */ +class Mixin_Display_Type_Controller extends Mixin +{ + public $_render_mode; + /** + * Enqueues static resources required for lightbox effects + * @param type $displayed_gallery + */ + public function enqueue_lightbox_resources($displayed_gallery) + { + C_Lightbox_Library_Manager::get_instance()->enqueue(); + } + public function is_cachable() + { + return TRUE; + } + /** + * This method should be overwritten by other adapters/mixins, and call + * wp_enqueue_script() / wp_enqueue_style() + */ + public function enqueue_frontend_resources($displayed_gallery) + { + // This script provides common JavaScript among all display types + wp_enqueue_script('ngg_common'); + // Enqueue the display type library + wp_enqueue_script($displayed_gallery->display_type, $this->object->_get_js_lib_url($displayed_gallery)); + // Add "galleries = {};" + $this->object->_add_script_data('ngg_common', 'galleries', new stdClass(), TRUE, FALSE); + // Add "galleries.gallery_1 = {};" + $this->object->_add_script_data('ngg_common', 'galleries.gallery_' . $displayed_gallery->id(), (array) $displayed_gallery->get_entity(), FALSE); + $this->object->_add_script_data('ngg_common', 'galleries.gallery_' . $displayed_gallery->id() . '.wordpress_page_root', get_permalink(), FALSE); + // Enqueue trigger button resources + C_Displayed_Gallery_Trigger_Manager::get_instance()->enqueue_resources($displayed_gallery); + // Enqueue lightbox library + $this->object->enqueue_lightbox_resources($displayed_gallery); + } + public function enqueue_ngg_styles() + { + $settings = C_NextGen_Settings::get_instance(); + if ((!is_multisite() || is_multisite() && $settings->wpmuStyle) && $settings->activateCSS) { + wp_enqueue_style('nggallery', C_NextGen_Style_Manager::get_instance()->get_selected_stylesheet_url()); + } + } + public function get_render_mode() + { + return $this->object->_render_mode; + } + public function set_render_mode($mode) + { + $this->object->_render_mode = $mode; + } + /** + * Ensures that the minimum configuration of parameters are sent to a view + * @param $displayed_gallery + * @param null $params + * @return array|null + */ + public function prepare_display_parameters($displayed_gallery, $params = null) + { + if ($params == null) { + $params = array(); + } + $params['display_type_rendering'] = true; + $params['displayed_gallery'] = $displayed_gallery; + $params['render_mode'] = $this->object->get_render_mode(); + return $params; + } + /** + * Renders the frontend display of the display type + */ + public function index_action($displayed_gallery, $return = FALSE) + { + return $this->object->render_partial('photocrati-nextgen_gallery_display#index', array(), $return); + } + /** + * Returns the url for the JavaScript library required + * @return null|string + */ + public function _get_js_lib_url() + { + return NULL; + } + /** + * Returns the effect HTML code for the displayed gallery + * @param type $displayed_gallery + */ + public function get_effect_code($displayed_gallery) + { + $retval = ''; + if ($lightbox = C_Lightbox_Library_Manager::get_instance()->get_selected()) { + $retval = $lightbox->code; + $retval = str_replace('%GALLERY_ID%', $displayed_gallery->id(), $retval); + $retval = str_replace('%GALLERY_NAME%', $displayed_gallery->id(), $retval); + global $post; + if ($post && isset($post->ID) && $post->ID) { + $retval = str_replace('%PAGE_ID%', $post->ID, $retval); + } + } + // allow for customization + $retval = apply_filters('ngg_effect_code', $retval, $displayed_gallery); + return $retval; + } + /** + * Adds data to the DOM which is then accessible by a script + * @param string $handle + * @param string $object_name + * @param mixed $object_value + * @param bool $define + */ + public function _add_script_data($handle, $object_name, $object_value, $define = TRUE, $override = FALSE) + { + $retval = FALSE; + // wp_localize_script allows you to add data to the DOM, associated + // with a particular script. You can even call wp_localize_script + // multiple times to add multiple objects to the DOM. However, there + // are a few problems with wp_localize_script: + // + // - If you call it with the same object_name more than once, you're + // overwritting the first call. + // - You cannot namespace your objects due to the "var" keyword always + // - being used. + // + // To circumvent the above issues, we're going to use the WP_Scripts + // object to workaround the above issues + global $wp_scripts; + // Has the script been registered or enqueued yet? + if (isset($wp_scripts->registered[$handle])) { + // Get the associated data with this script + $script =& $wp_scripts->registered[$handle]; + $data = isset($script->extra['data']) ? $script->extra['data'] : ''; + // Construct the addition + $addition = $define ? "\nvar {$object_name} = " . json_encode($object_value) . ';' : "\n{$object_name} = " . json_encode($object_value) . ';'; + // Add the addition + if ($override) { + $data .= $addition; + $retval = TRUE; + } else { + if (strpos($data, $object_name) === FALSE) { + $data .= $addition; + $retval = TRUE; + } + } + $script->extra['data'] = $data; + unset($script); + } + return $retval; + } + // Returns the longest and widest dimensions from a list of entities + public function get_entity_statistics($entities, $named_size, $style_images = FALSE) + { + $longest = $widest = 0; + $storage = C_Gallery_Storage::get_instance(); + $image_mapper = FALSE; + // we'll fetch this if needed + // Calculate longest and + foreach ($entities as $entity) { + // Get the image + $image = FALSE; + if (isset($entity->pid)) { + $image = $entity; + } elseif (isset($entity->previewpic)) { + if (!$image_mapper) { + $image_mapper = C_Image_Mapper::get_instance(); + } + $image = $image_mapper->find($entity->previewpic); + } + // Once we have the image, get it's dimensions + if ($image) { + $dimensions = $storage->get_image_dimensions($image, $named_size); + if ($dimensions['width'] > $widest) { + $widest = $dimensions['width']; + } + if ($dimensions['height'] > $longest) { + $longest = $dimensions['height']; + } + } + } + // Second loop to style images + if ($style_images) { + foreach ($entities as &$entity) { + // Get the image + $image = FALSE; + if (isset($entity->pid)) { + $image = $entity; + } elseif (isset($entity->previewpic)) { + if (!$image_mapper) { + $image_mapper = C_Image_Mapper::get_instance(); + } + $image = $image_mapper->find($entity->previewpic); + } + // Once we have the image, get it's dimension and calculate margins + if ($image) { + $dimensions = $storage->get_image_dimensions($image, $named_size); + } + } + } + return array('entities' => $entities, 'longest' => $longest, 'widest' => $widest); + } +} +/** + * Provides a datamapper to perform CRUD operations for Display Types + */ +class C_Display_Type_Mapper extends C_CustomPost_DataMapper_Driver +{ + public static $_instances = array(); + public function define($context = FALSE, $not_used = FALSE) + { + $object_name = 'display_type'; + // Add the object name to the context of the object as well + // This allows us to adapt the driver itself, if required + if (!is_array($context)) { + $context = array($context); + } + array_push($context, $object_name); + parent::define($object_name, $context); + $this->add_mixin('Mixin_Display_Type_Mapper'); + $this->implement('I_Display_Type_Mapper'); + $this->set_model_factory_method($object_name); + // Define columns + $this->define_column('ID', 'BIGINT', 0); + $this->define_column('name', 'VARCHAR(255)'); + $this->define_column('title', 'VARCHAR(255)'); + $this->define_column('preview_image_relpath', 'VARCHAR(255)'); + $this->define_column('default_source', 'VARCHAR(255)'); + $this->define_column('view_order', 'BIGINT', NGG_DISPLAY_PRIORITY_BASE); + $this->add_serialized_column('settings'); + $this->add_serialized_column('entity_types'); + } + public function initialize($context = FALSE) + { + parent::initialize('display_type'); + } + /** + * Gets a singleton of the mapper + * @param string|array $context + * @return C_Display_Type_Mapper + */ + public static function get_instance($context = False) + { + if (!isset(self::$_instances[$context])) { + self::$_instances[$context] = new C_Display_Type_Mapper($context); + } + return self::$_instances[$context]; + } +} +/** + * Provides instance methods for the display type mapper + */ +class Mixin_Display_Type_Mapper extends Mixin +{ + /** + * Locates a Display Type by names + * @param string $name + */ + public function find_by_name($name, $model = FALSE) + { + $retval = NULL; + $this->object->select(); + $this->object->where(array('name = %s', $name)); + $results = $this->object->run_query(FALSE, $model); + if ($results) { + $retval = $results[0]; + } + return $retval; + } + /** + * Finds display types used to display specific types of entities + * @param string|array $entity_type e.g. image, gallery, album + * @return array + */ + public function find_by_entity_type($entity_type, $model = FALSE) + { + $find_entity_types = is_array($entity_type) ? $entity_type : array($entity_type); + $retval = NULL; + foreach ($this->object->find_all($model) as $display_type) { + foreach ($find_entity_types as $entity_type) { + if (isset($display_type->entity_types) && in_array($entity_type, $display_type->entity_types)) { + $retval[] = $display_type; + break; + } + } + } + return $retval; + } + /** + * Uses the title attribute as the post title + * @param stdClass $entity + * @return string + */ + public function get_post_title($entity) + { + return $entity->title; + } + /** + * Sets default values needed for display types + */ + public function set_defaults($entity) + { + if (!isset($entity->settings)) { + $entity->settings = array(); + } + $this->_set_default_value($entity, 'preview_image_relpath', ''); + $this->_set_default_value($entity, 'default_source', ''); + $this->_set_default_value($entity, 'view_order', NGG_DISPLAY_PRIORITY_BASE); + $this->_set_default_value($entity, 'settings', 'use_lightbox_effect', TRUE); + $this->_set_default_value($entity, 'hidden_from_ui', FALSE); + return $this->call_parent('set_defaults', $entity); + } +} +/** + * Associates a Display Type with a collection of images + * + * * Properties: + * - source (gallery, album, recent_images, random_images, etc) + * - container_ids (gallery ids, album ids, tag ids, etc) + * - display_type (name of the display type being used) + * - display_settings (settings for the display type) + * - exclusions (excluded entity ids) + * - entity_ids (specific images/galleries to include, sorted) + * - order_by + * - order_direction + */ +class C_Displayed_Gallery extends C_DataMapper_Model +{ + public $_mapper_interface = 'I_Displayed_Gallery_Mapper'; + public function define($properties = array(), $mapper = FALSE, $context = FALSE) + { + parent::define($mapper, $properties, $context); + $this->add_mixin('Mixin_Displayed_Gallery_Validation'); + $this->add_mixin('Mixin_Displayed_Gallery_Instance_Methods'); + $this->add_mixin('Mixin_Displayed_Gallery_Queries'); + $this->implement('I_Displayed_Gallery'); + } + /** + * Initializes a display type with properties + * @param FALSE|C_Displayed_Gallery_Mapper $mapper + * @param array|stdClass|C_Displayed_Gallery $properties + * @param FALSE|string|array $context + */ + public function initialize($properties = array(), $mapper = FALSE, $context = FALSE) + { + if (!$mapper) { + $mapper = $this->get_registry()->get_utility($this->_mapper_interface); + } + parent::initialize($mapper, $properties); + $this->select_random_variation(); + } +} +/** + * Provides validation + */ +class Mixin_Displayed_Gallery_Validation extends Mixin +{ + public function validation() + { + // Valid sources + $this->object->validates_presence_of('source'); + // Valid display type? + $this->object->validates_presence_of('display_type'); + if ($display_type = $this->object->get_display_type()) { + foreach ($this->object->display_settings as $key => $val) { + $display_type->settings[$key] = $val; + } + $this->object->display_settings = $display_type->settings; + if (!$display_type->validate()) { + foreach ($display_type->get_errors() as $property => $errors) { + foreach ($errors as $error) { + $this->object->add_error($error, $property); + } + } + } + // Is the display type compatible with the source? E.g., if we're + // using a display type that expects images, we can't be feeding it + // galleries and albums + if ($source = $this->object->get_source()) { + if (!$display_type->is_compatible_with_source($source)) { + $this->object->add_error(__('Source not compatible with selected display type', 'nggallery'), 'display_type'); + } + } + // Allow ONLY recent & random galleries to have their own maximum_entity_count + if (!empty($this->object->display_settings['maximum_entity_count']) && in_array($this->object->source, array('random_images', 'recent_images', 'random', 'recent'))) { + $this->object->maximum_entity_count = $this->object->display_settings['maximum_entity_count']; + } + // If no maximum_entity_count has been given, then set a maximum + if (!isset($this->object->maximum_entity_count)) { + $settings = C_NextGen_Settings::get_instance(); + $this->object->maximum_entity_count = $settings->get('maximum_entity_count', 500); + } + } else { + $this->object->add_error('Invalid display type', 'display_type'); + } + return $this->object->is_valid(); + } +} +class Mixin_Displayed_Gallery_Queries extends Mixin +{ + public function select_random_variation() + { + $retval = FALSE; + $source_obj = $this->object->get_source(); + if ($source_obj && $source_obj->has_variations) { + $max = 0; + if (!defined('NGG_MAX_VARIATIONS')) { + $settings = C_Photocrati_Global_Settings_Manager::get_instance(); + $max = $settings->get('max_variations', 5); + define('NGG_MAX_VARIATIONS', $max); + } else { + $max = NGG_MAX_VARIATIONS; + } + $this->object->variation = floor(rand(1, $max)); + $retval = $this->object->variation; + } + return $retval; + } + public function get_entities($limit = FALSE, $offset = FALSE, $id_only = FALSE, $returns = 'included') + { + $retval = array(); + $source_obj = $this->object->get_source(); + $max = $this->object->get_maximum_entity_count(); + if (!$limit || is_numeric($limit) && $limit > $max) { + $limit = $max; + } + // Ensure that all parameters have values that are expected + if ($this->object->_parse_parameters()) { + // Is this an image query? + if (in_array('image', $source_obj->returns)) { + $retval = $this->object->_get_image_entities($source_obj, $limit, $offset, $id_only, $returns); + } elseif (in_array('gallery', $source_obj->returns)) { + $retval = $this->object->_get_album_and_gallery_entities($source_obj, $limit, $offset, $id_only, $returns); + } + } + return $retval; + } + /** + * Gets all images in the displayed gallery + * @param stdClass $source_obj + * @param int $limit + * @param int $offset + * @param boolean $id_only + * @param string $returns + */ + public function _get_image_entities($source_obj, $limit, $offset, $id_only, $returns) + { + // TODO: This method is very long, and therefore more difficult to read + // Find a way to minimalize or segment + $mapper = C_Image_Mapper::get_instance(); + $image_key = $mapper->get_primary_key_column(); + $select = $id_only ? $image_key : $mapper->get_table_name() . '.*'; + $sort_direction = $this->object->order_direction; + $sort_by = $this->object->order_by; + // Here's what this method is doing: + // 1) Determines what results need returned + // 2) Determines from what container ids the results should come from + // 3) Applies ORDER BY clause + // 4) Applies LIMIT/OFFSET clause + // 5) Executes the query and returns the result + // We start with the most difficult query. When returns is "both", we + // need to return a list of both included and excluded entity ids, and + // mark specifically which entities are excluded + if ($returns == 'both') { + // We need to add two dynamic columns, one called "sortorder" and + // the other called "exclude". + $if_true = 1; + $if_false = 0; + $excluded_set = $this->object->entity_ids; + if (!$excluded_set) { + $if_true = 0; + $if_false = 1; + $excluded_set = $this->object->exclusions; + } + $sortorder_set = $this->object->sortorder ? $this->object->sortorder : $excluded_set; + // Add sortorder column + if ($sortorder_set) { + $select = $this->object->_add_find_in_set_column($select, $image_key, $sortorder_set, 'new_sortorder', TRUE); + // A user might want to sort the results by the order of + // images that they specified to be included. For that, + // we need some trickery by reversing the order direction + $sort_direction = $this->object->order_direction == 'ASC' ? 'DESC' : 'ASC'; + $sort_by = 'new_sortorder'; + } + // Add exclude column + if ($excluded_set) { + $select = $this->object->_add_find_in_set_column($select, $image_key, $excluded_set, 'exclude'); + $select .= ", IF (exclude = 0 AND @exclude = 0, {$if_true}, {$if_false}) AS 'exclude'"; + } + // Select what we want + $mapper->select($select); + } + // When returns is "included", the query is relatively simple. We + // just provide a where clause to limit how many images we're returning + // based on the entity_ids, exclusions, and container_ids parameters + if ($returns == 'included') { + // If the sortorder propery is available, then we need to override + // the sortorder + if ($this->object->sortorder) { + $select = $this->object->_add_find_in_set_column($select, $image_key, $this->object->sortorder, 'new_sortorder', TRUE); + $sort_direction = $this->object->order_direction == 'ASC' ? 'DESC' : 'ASC'; + $sort_by = 'new_sortorder'; + } + $mapper->select($select); + // Filter based on entity_ids selection + if ($this->object->entity_ids) { + $mapper->where(array("{$image_key} IN %s", $this->object->entity_ids)); + } + // Filter based on exclusions selection + if ($this->object->exclusions) { + $mapper->where(array("{$image_key} NOT IN %s", $this->object->exclusions)); + } + // Ensure that no images marked as excluded at the gallery level are returned + if (empty($this->object->skip_excluding_globally_excluded_images)) { + $mapper->where(array('exclude = %d', 0)); + } + } elseif ($returns == 'excluded') { + // If the sortorder propery is available, then we need to override + // the sortorder + if ($this->object->sortorder) { + $select = $this->object->_add_find_in_set_column($select, $image_key, $this->object->sortorder, 'new_sortorder', TRUE); + $sort_direction = $this->object->order_direction == 'ASC' ? 'DESC' : 'ASC'; + $sort_by = 'new_sortorder'; + } + // Mark each result as excluded + $select .= ', 1 AS exclude'; + $mapper->select($select); + // Is this case, entity_ids become the exclusions + $exclusions = $this->object->entity_ids; + // Remove the exclusions always takes precedence over entity_ids, so + // we adjust the list of ids + if ($this->object->exclusions) { + foreach ($this->object->exclusions as $excluded_entity_id) { + if (($index = array_search($excluded_entity_id, $exclusions)) !== FALSE) { + unset($exclusions[$index]); + } + } + } + // Filter based on exclusions selection + if ($exclusions) { + $mapper->where(array("{$image_key} NOT IN %s", $exclusions)); + } else { + if ($this->object->exclusions) { + $mapper->where(array("{$image_key} IN %s", $this->object->exclusions)); + } + } + // Ensure that images marked as excluded are returned as well + $mapper->where(array('exclude = 1')); + } + // Filter based on containers_ids. Container ids is a little more + // complicated as it can contain gallery ids or tags + if ($this->object->container_ids) { + // Container ids are tags + if ($source_obj->name == 'tags') { + $term_ids = $this->object->get_term_ids_for_tags($this->object->container_ids); + $mapper->where(array("{$image_key} IN %s", get_objects_in_term($term_ids, 'ngg_tag'))); + } else { + $mapper->where(array('galleryid IN %s', $this->object->container_ids)); + } + } + // Filter based on excluded container ids + if ($this->object->excluded_container_ids) { + // Container ids are tags + if ($source_obj->name == 'tags') { + $term_ids = $this->object->get_term_ids_for_tags($this->object->excluded_container_ids); + $mapper->where(array("{$image_key} NOT IN %s", get_objects_in_term($term_ids, 'ngg_tag'))); + } else { + $mapper->where(array('galleryid NOT IN %s', $this->object->excluded_container_ids)); + } + } + // Adjust the query more based on what source was selected + if (in_array($this->object->source, array('recent', 'recent_images'))) { + $sort_direction = 'DESC'; + $sort_by = 'imagedate'; + } elseif ($this->object->source == 'random_images' && empty($this->object->entity_ids)) { + $table_name = $mapper->get_table_name(); + $where_clauses = array(); + $sub_where_sql = ''; + foreach ($mapper->_where_clauses as $where) { + $where_clauses[] = '(' . $where . ')'; + } + if ($where_clauses) { + $sub_where_sql = 'WHERE ' . implode(' AND ', $where_clauses); + } + $mapper->_where_clauses = array(" /*NGG_NO_EXTRAS_TABLE*/ `{$image_key}` IN (SELECT `{$image_key}` FROM (SELECT `{$image_key}` FROM `{$table_name}` i {$sub_where_sql} ORDER BY RAND() LIMIT {$this->object->maximum_entity_count}) o) /*NGG_NO_EXTRAS_TABLE*/"); + } + // Apply a sorting order + if ($sort_by) { + $mapper->order_by($sort_by, $sort_direction); + } + // Apply a limit + if ($limit) { + if ($offset) { + $mapper->limit($limit, $offset); + } else { + $mapper->limit($limit); + } + } + $results = $mapper->run_query(); + return $results; + } + /** + * Gets all gallery and album entities from albums specified, if any + * @param stdClass $source_obj + * @param int $limit + * @param int $offset + * @param boolean $id_only + * @param array $returns + */ + public function _get_album_and_gallery_entities($source_obj, $limit = FALSE, $offset = FALSE, $id_only = FALSE, $returns = 'included') + { + // Albums queries and difficult and inefficient to perform due to the + // database schema. To complicate things, we're returning two different + // types of entities - galleries, and sub-albums. + // The user prefixes entity_id's with an 'a' to distinguish album ids + // from gallery ids. E.g. entity_ids=[1, "a2", 3] + $album_mapper = C_Album_Mapper::get_instance(); + $album_key = $album_mapper->get_primary_key_column(); + $gallery_mapper = C_Gallery_Mapper::get_instance(); + $gallery_key = $gallery_mapper->get_primary_key_column(); + $select = $id_only ? $album_key . ', sortorder' : $album_mapper->get_table_name() . '.*'; + $retval = array(); + // If no exclusions are specified, are entity_ids are specified, + // and we're to return is "included", then we have a relatively easy + // query to perform - we just fetch each entity listed in + // the entity_ids field + if ($returns == 'included' && $this->object->entity_ids && empty($this->object->exclusions)) { + $retval = $this->object->_entities_to_galleries_and_albums($this->object->entity_ids, $id_only, array(), $limit, $offset); + } else { + // Start the query + $album_mapper->select($select); + // Fetch the albums, and find the entity ids of the sub-albums and galleries + $entity_ids = array(); + $excluded_ids = array(); + // Filter by container ids. If container_ids === '0' we retrieve all existing gallery_ids and use + // them as the available entity_ids for comparability with 1.9x + $container_ids = $this->object->container_ids; + if ($container_ids) { + if ($container_ids !== array('0') && $container_ids !== array('')) { + $album_mapper->where(array("{$album_key} IN %s", $container_ids)); + foreach ($album_mapper->run_query() as $album) { + $entity_ids = array_merge($entity_ids, (array) $album->sortorder); + } + } else { + if ($container_ids === array('0') || $container_ids === array('')) { + foreach ($gallery_mapper->select($gallery_key)->run_query() as $gallery) { + $entity_ids[] = $gallery->{$gallery_key}; + } + } + } + } + // Break the list of entities into two groups, included entities + // and excluded entity ids + // -- + // If a specific list of entity ids have been specified, then + // we know what entity ids are meant to be included. We can compute + // the intersect and also determine what entity ids are to be + // excluded + if ($this->object->entity_ids) { + // Determine the real list of included entity ids. Exclusions + // always take precedence + $included_ids = $this->object->entity_ids; + foreach ($this->object->exclusions as $excluded_id) { + if (($index = array_search($excluded_id, $included_ids)) !== FALSE) { + unset($included_ids[$index]); + } + } + $excluded_ids = array_diff($entity_ids, $included_ids); + } elseif ($this->object->exclusions) { + $included_ids = array_diff($entity_ids, $this->object->exclusions); + $excluded_ids = array_diff($entity_ids, $included_ids); + } else { + $included_ids = $entity_ids; + } + // We've built our two groups. Let's determine how we'll focus on them + // -- + // We're interested in only the included ids + if ($returns == 'included') { + $retval = $this->object->_entities_to_galleries_and_albums($included_ids, $id_only, array(), $limit, $offset); + } elseif ($returns == 'excluded') { + $retval = $this->object->_entities_to_galleries_and_albums($excluded_ids, $id_only, $excluded_ids, $limit, $offset); + } else { + $retval = $this->object->_entities_to_galleries_and_albums($entity_ids, $id_only, $excluded_ids, $limit, $offset); + } + } + return $retval; + } + /** + * Takes a list of entities, and returns the mapped galleries and sub-albums + * + * @param array $entity_ids + * @param bool $id_only + * @param array $exclusions + * @param int $limit + * @param int $offset + * @return array + */ + public function _entities_to_galleries_and_albums($entity_ids, $id_only = FALSE, $exclusions = array(), $limit = FALSE, $offset = FALSE) + { + $retval = array(); + $gallery_ids = array(); + $album_ids = array(); + $album_mapper = C_Album_Mapper::get_instance(); + $album_key = $album_mapper->get_primary_key_column(); + $gallery_mapper = C_Gallery_Mapper::get_instance(); + $image_mapper = C_Image_Mapper::get_instance(); + $gallery_key = $gallery_mapper->get_primary_key_column(); + $album_select = ($id_only ? $album_key : $album_mapper->get_table_name() . '.*') . ', 1 AS is_album, 0 AS is_gallery, name AS title, albumdesc AS galdesc'; + $gallery_select = ($id_only ? $gallery_key : $gallery_mapper->get_table_name() . '.*') . ', 1 AS is_gallery, 0 AS is_album'; + // Modify the sort order of the entities + if ($this->object->sortorder) { + $sortorder = array_intersect($this->object->sortorder, $entity_ids); + $entity_ids = array_merge($sortorder, array_diff($entity_ids, $sortorder)); + } + // Segment entity ids into two groups - galleries and albums + foreach ($entity_ids as $entity_id) { + if (substr($entity_id, 0, 1) == 'a') { + $album_ids[] = intval(substr($entity_id, 1)); + } else { + $gallery_ids[] = intval($entity_id); + } + } + // Adjust query to include an exclude property + if ($exclusions) { + $album_select = $this->object->_add_find_in_set_column($album_select, $album_key, $this->object->exclusions, 'exclude'); + $album_select = $this->object->_add_if_column($album_select, 'exclude', 0, 1); + $gallery_select = $this->object->_add_find_in_set_column($gallery_select, $gallery_key, $this->object->exclusions, 'exclude'); + $gallery_select = $this->object->_add_if_column($gallery_select, 'exclude', 0, 1); + } + // Add sorting parameter to the gallery and album queries + if ($gallery_ids) { + $gallery_select = $this->object->_add_find_in_set_column($gallery_select, $gallery_key, $gallery_ids, 'ordered_by', TRUE); + } else { + $gallery_select .= ', 0 AS ordered_by'; + } + if ($album_ids) { + $album_select = $this->object->_add_find_in_set_column($album_select, $album_key, $album_ids, 'ordered_by', TRUE); + } else { + $album_select .= ', 0 AS ordered_by'; + } + // Fetch entities + $galleries = $gallery_mapper->select($gallery_select)->where(array("{$gallery_key} IN %s", $gallery_ids))->order_by('ordered_by', 'DESC')->run_query(); + $counts = $image_mapper->select('galleryid, COUNT(*) as counter')->where(array(array('galleryid IN %s', $gallery_ids), array('exclude = %d', 0)))->group_by('galleryid')->run_query(FALSE, FALSE, TRUE); + $albums = $album_mapper->select($album_select)->where(array("{$album_key} IN %s", $album_ids))->order_by('ordered_by', 'DESC')->run_query(); + // Reorder entities according to order specified in entity_ids + foreach ($entity_ids as $entity_id) { + if (substr($entity_id, 0, 1) == 'a') { + $album = array_shift($albums); + if ($album) { + $retval[] = $album; + } + } else { + $gallery = array_shift($galleries); + if ($gallery) { + foreach ($counts as $id => $gal_count) { + if ($gal_count->galleryid == $gallery->gid) { + $gallery->counter = intval($gal_count->counter); + unset($counts[$id]); + } + } + $retval[] = $gallery; + } + } + } + // Sort the entities + if ($this->object->order_by && $this->object->order_by != 'sortorder') { + usort($retval, array(&$this, '_sort_album_result')); + } + if ($this->object->order_direction == 'DESC') { + $retval = array_reverse($retval); + } + // Limit the entities + if ($limit) { + $retval = array_slice($retval, $offset, $limit); + } + return $retval; + } + /** + * Returns the total number of entities in this displayed gallery + * @param string $returns + * @returns int + */ + public function get_entity_count($returns = 'included') + { + $retval = 0; + // Is this an image query? + $source_obj = $this->object->get_source(); + if (in_array('image', $source_obj->returns)) { + $retval = count($this->object->_get_image_entities($source_obj, FALSE, FALSE, TRUE, $returns)); + } elseif (in_array('gallery', $source_obj->returns)) { + $retval = count($this->object->_get_album_and_gallery_entities($source_obj, FALSE, FALSE, TRUE, $returns)); + } + $max = $this->get_maximum_entity_count(); + if ($retval > $max) { + $retval = $max; + } + return $retval; + } + // Honor the gallery 'maximum_entity_count' setting ONLY when dealing with random & recent galleries. All + // others will always obey the *global* 'maximum_entity_count' setting. + public function get_maximum_entity_count() + { + $max = intval(C_NextGen_Settings::get_instance()->get('maximum_entity_count', 500)); + $sources = C_Displayed_Gallery_Source_Manager::get_instance(); + $source_obj = $this->object->get_source(); + if (in_array($source_obj, array($sources->get('random'), $sources->get('random_images'), $sources->get('recent'), $sources->get('recent_images')))) { + $max = intval($this->object->maximum_entity_count); + } + return $max; + } + /** + * Returns all included entities for the displayed gallery + * @param int $limit + * @param int $offset + * @param boolean $id_only + * @return array + */ + public function get_included_entities($limit = FALSE, $offset = FALSE, $id_only = FALSE) + { + return $this->object->get_entities($limit, $offset, $id_only, 'included'); + } + /** + * Adds a FIND_IN_SET call to the select portion of the query, and + * optionally defines a dynamic column + * @param string $select + * @param string $key + * @param array $array + * @param string $alias + * @param boolean $add_column + * @return string + */ + public function _add_find_in_set_column($select, $key, $array, $alias, $add_column = FALSE) + { + $array = array_map('intval', $array); + $set = implode(',', array_reverse($array)); + if (!$select) { + $select = '1'; + } + $select .= ", @{$alias} := FIND_IN_SET({$key}, '{$set}')"; + if ($add_column) { + $select .= " AS {$alias}"; + } + return $select; + } + public function _add_if_column($select, $alias, $true = 1, $false = 0) + { + if (!$select) { + $select = '1'; + } + $select .= ", IF(@{$alias} = 0, {$true}, {$false}) AS {$alias}"; + return $select; + } + /** + * Parses the list of parameters provided in the displayed gallery, and + * ensures everything meets expectations + * @return boolean + */ + public function _parse_parameters() + { + $valid = FALSE; + // Ensure that the source is valid + if (C_Displayed_Gallery_Source_Manager::get_instance()->get($this->object->source)) { + $valid = TRUE; + } + // Ensure that exclusions, entity_ids, and sortorder have valid elements. + // IE likes to send empty array as an array with a single element that + // has no value + if ($this->object->exclusions && !$this->object->exclusions[0]) { + $this->object->exclusions = array(); + } + if ($this->object->entity_ids && !$this->object->entity_ids[0]) { + $this->object->entity_ids = array(); + } + if ($this->object->sortorder && !$this->object->sortorder[0]) { + $this->object->sortorder = array(); + } + return $valid; + } + /** + * Returns a list of term ids for the list of tags + * @global wpdb $wpdb + * @param array $tags + * @return array + */ + public function get_term_ids_for_tags($tags = FALSE) + { + global $wpdb; + // If no tags were provided, get them from the container_ids + if (!$tags || !is_array($tags)) { + $tags = $this->object->container_ids; + } + // Convert container ids to a string suitable for WHERE IN + $container_ids = array(); + if (is_array($tags) && !in_array('all', array_map('strtolower', $tags))) { + foreach ($tags as $ndx => $container) { + $container_ids[] = "'{$container}'"; + } + $container_ids = implode(',', $container_ids); + } + // Construct query + $query = "SELECT {$wpdb->term_taxonomy}.term_id FROM {$wpdb->term_taxonomy}\n INNER JOIN {$wpdb->terms} ON {$wpdb->term_taxonomy}.term_id = {$wpdb->terms}.term_id\n WHERE {$wpdb->term_taxonomy}.term_id = {$wpdb->terms}.term_id\n AND {$wpdb->term_taxonomy}.taxonomy = %s"; + if (!empty($container_ids)) { + $query .= " AND ({$wpdb->terms}.slug IN ({$container_ids}) OR {$wpdb->terms}.name IN ({$container_ids}))"; + } + $query .= " ORDER BY {$wpdb->terms}.term_id"; + $query = $wpdb->prepare($query, 'ngg_tag'); + // Get all term_ids for each image tag slug + $term_ids = array(); + $results = $wpdb->get_results($query); + if (is_array($results) && !empty($results)) { + foreach ($results as $row) { + $term_ids[] = $row->term_id; + } + } + return $term_ids; + } + /** + * Sorts the results of an album query + * @param stdClass $a + * @param stdClass $b + */ + public function _sort_album_result($a, $b) + { + $key = $this->object->order_by; + return strcmp($a->{$key}, $b->{$key}); + } +} +/** + * Provides instance methods useful for working with the C_Displayed_Gallery + * model + */ +class Mixin_Displayed_Gallery_Instance_Methods extends Mixin +{ + public function get_entity() + { + $entity = $this->call_parent('get_entity'); + unset($entity->post_author); + unset($entity->post_date); + unset($entity->post_date_gmt); + unset($entity->post_title); + unset($entity->post_excerpt); + unset($entity->post_status); + unset($entity->comment_status); + unset($entity->ping_status); + unset($entity->post_name); + unset($entity->to_ping); + unset($entity->pinged); + unset($entity->post_modified); + unset($entity->post_modified_gmt); + unset($entity->post_parent); + unset($entity->guid); + unset($entity->post_type); + unset($entity->post_mime_type); + unset($entity->comment_count); + unset($entity->filter); + unset($entity->post_content_filtered); + return $entity; + } + /** + * Gets the display type object used in this displayed gallery + * @return C_Display_Type + */ + public function get_display_type() + { + return C_Display_Type_Mapper::get_instance()->find_by_name($this->object->display_type, TRUE); + } + /** + * Gets the corresponding source instance + * @return stdClass + */ + public function get_source() + { + return C_Displayed_Gallery_Source_Manager::get_instance()->get($this->object->source); + } + /** + * Returns the galleries queries in this displayed gallery + * @return array + */ + public function get_galleries() + { + $retval = array(); + if ($source = $this->object->get_source()) { + if (in_array('image', $source->returns)) { + $mapper = C_Gallery_Mapper::get_instance(); + $gallery_key = $mapper->get_primary_key_column(); + $mapper->select(); + if ($this->object->container_ids) { + $mapper->where(array("{$gallery_key} IN %s", $this->object->container_ids)); + } + $retval = $mapper->run_query(); + } + } + return $retval; + } + /** + * Gets albums queried in this displayed gallery + * @return array + */ + public function get_albums() + { + $retval = array(); + if ($source = $this->object->get_source()) { + if (in_array('album', $source->returns)) { + $mapper = C_Album_Mapper::get_instance(); + $album_key = $mapper->get_primary_key_column(); + if ($this->object->container_ids) { + $mapper->select()->where(array("{$album_key} IN %s", $this->object->container_ids)); + } + $retval = $mapper->run_query(); + } + } + return $retval; + } + /** + * Returns a transient for the displayed gallery + * @return string + */ + public function to_transient() + { + $params = $this->object->get_entity(); + unset($params->transient_id); + $key = C_Photocrati_Transient_Manager::create_key('displayed_galleries', $params); + if (is_null(C_Photocrati_Transient_Manager::fetch($key, NULL))) { + C_Photocrati_Transient_Manager::update($key, $params, NGG_DISPLAYED_GALLERY_CACHE_TTL); + } + $this->object->transient_id = $key; + if (!$this->object->id()) { + $this->object->id($key); + } + return $key; + } + /** + * Applies the values of a transient to this object + * @param string $transient_id + */ + public function apply_transient($transient_id = NULL) + { + $retval = FALSE; + if (!$transient_id && isset($this->object->transient_id)) { + $transient_id = $this->object->transient_id; + } + if ($transient_id && ($transient = C_Photocrati_Transient_Manager::fetch($transient_id, FALSE))) { + // Ensure that the transient is an object, not array + if (is_array($transient)) { + $obj = new stdClass(); + foreach ($transient as $key => $value) { + $obj->{$key} = $value; + } + $transient = $obj; + } + $this->object->_stdObject = $transient; + // Ensure that the display settings are an array + $this->object->display_settings = $this->_object_to_array($this->object->display_settings); + // Ensure that we have the most accurate transient id + $this->object->transient_id = $transient_id; + if (!$this->object->id()) { + $this->object->id($transient_id); + } + $retval = TRUE; + } else { + unset($this->object->transient_id); + unset($this->object->_stdObject->transient_id); + $this->object->to_transient(); + } + return $retval; + } + public function _object_to_array($object) + { + $retval = $object; + if (is_object($retval)) { + $retval = get_object_vars($object); + } + if (is_array($retval)) { + foreach ($retval as $key => $val) { + if (is_object($val)) { + $retval[$key] = $this->_object_to_array($val); + } + } + } + return $retval; + } +} +class C_Displayed_Gallery_Mapper extends C_CustomPost_DataMapper_Driver +{ + static $_instances = array(); + public function define($context = FALSE, $not_used = FALSE) + { + parent::define('displayed_gallery', array($context, 'displayed_gallery', 'display_gallery')); + $this->add_mixin('Mixin_Displayed_Gallery_Defaults'); + $this->implement('I_Displayed_Gallery_Mapper'); + $this->set_model_factory_method('displayed_gallery'); + } + /** + * Initializes the mapper + * @param string|array|FALSE $context + */ + public function initialize() + { + parent::initialize('displayed_gallery'); + } + /** + * Gets a singleton of the mapper + * @param string|array $context + * @return C_Displayed_Gallery_Mapper + */ + public static function get_instance($context = False) + { + if (!isset(self::$_instances[$context])) { + self::$_instances[$context] = new C_Displayed_Gallery_Mapper($context); + } + return self::$_instances[$context]; + } +} +/** + * Adds default values for the displayed gallery + */ +class Mixin_Displayed_Gallery_Defaults extends Mixin +{ + /** + * Gets a display type object for a particular entity + * @param stdClass|C_DataMapper_Model $entity + * @return null|stdClass + */ + public function get_display_type($entity) + { + $mapper = C_Display_Type_Mapper::get_instance(); + return $mapper->find_by_name($entity->display_type); + } + /** + * Sets defaults needed for the entity + * @param type $entity + */ + public function set_defaults($entity) + { + // Ensure that we have a settings array + if (!isset($entity->display_settings)) { + $entity->display_settings = array(); + } + // If the display type is set, then get it's settings and apply them as + // defaults to the "display_settings" of the displayed gallery + if (isset($entity->display_type)) { + // Get display type mapper + if ($display_type = $this->object->get_display_type($entity)) { + $entity->display_settings = $this->array_merge_assoc($display_type->settings, $entity->display_settings, TRUE); + } + } + // Default ordering + $settings = C_NextGen_Settings::get_instance(); + $this->object->_set_default_value($entity, 'order_by', $settings->galSort); + $this->object->_set_default_value($entity, 'order_direction', $settings->galSortDir); + // Ensure we have an exclusions array + $this->object->_set_default_value($entity, 'exclusions', array()); + // Ensure other properties exist + $this->object->_set_default_value($entity, 'container_ids', array()); + $this->object->_set_default_value($entity, 'excluded_container_ids', array()); + $this->object->_set_default_value($entity, 'sortorder', array()); + $this->object->_set_default_value($entity, 'entity_ids', array()); + $this->object->_set_default_value($entity, 'returns', 'included'); + // Set maximum_entity_count + $this->object->_set_default_value($entity, 'maximum_entity_count', $settings->maximum_entity_count); + } +} +class C_Displayed_Gallery_Renderer extends C_Component +{ + static $_instances = array(); + /** + * Returns an instance of the class + * @param mixed $context + * @return C_Displayed_Gallery_Renderer + */ + static function get_instance($context = FALSE) + { + if (!isset(self::$_instances[$context])) { + $klass = __CLASS__; + self::$_instances[$context] = new $klass($context); + } + return self::$_instances[$context]; + } + /** + * Defines the object + * @param bool $context + */ + public function define($context = FALSE) + { + parent::define($context); + $this->add_mixin('Mixin_Displayed_Gallery_Renderer'); + $this->implement('I_Displayed_Gallery_Renderer'); + } +} +/** + * Provides the ability to render a display type + */ +class Mixin_Displayed_Gallery_Renderer extends Mixin +{ + /** + * Displays a "displayed gallery" instance + * + * Alias Properties: + * gallery_ids/album_ids/tag_ids == container_ids + * image_ids/gallery_ids == entity_ids + * + * Default Behavior: + * - if order_by and order_direction are missing, the default settings + * are used from the "Other Options" page. The exception to this is + * when entity_ids are selected, in which the order is custom unless + * specified. + * + * How to use: + * + * To retrieve images from gallery 1 & 3, but exclude images 4 & 6: + * [ngg_images gallery_ids="1,3" exclusions="4,6" display_type="photocrati-nextgen_basic_thumbnails"] + * + * To retrieve images 1 & 2 from gallery 1: + * [ngg_images gallery_ids="1" image_ids="1,2" display_type="photocrati-nextgen_basic_thumbnails"] + * + * To retrieve images matching tags "landscapes" and "wedding shoots": + * [ngg_images tag_ids="landscapes,wedding shoots" display_type="photocrati-nextgen_basic_thumbnails"] + * + * To retrieve galleries from albums 1 & #, but exclude sub-album 1: + * [ngg_images album_ids="1,2" exclusions="a1" display_type="photocrati-nextgen_basic_compact_album"] + * + * To retrieve galleries from albums 1 & 2, but exclude gallery 1: + * [ngg_images album_ids="1,2" exclusions="1" display_type="photocrati-nextgen_basic_compact_album"] + * + * To retrieve image 2, 3, and 5 - independent of what container is used + * [ngg_images image_ids="2,3,5" display_type="photocrati-nextgen_basic_thumbnails"] + * + * To retrieve galleries 3 & 5, custom sorted, in album view + * [ngg_images source="albums" gallery_ids="3,5" display_type="photocrati-nextgen_basic_compact_album"] + * + * To retrieve recent images, sorted by alt/title text + * [ngg_images source="recent" order_by="alttext" display_type="photocrati-nextgen_basic_thumbnails"] + * + * To retrieve random image + * [ngg_images source="random" display_type="photocrati-nextgen_basic_thumbnails"] + * + * To retrieve a single image + * [ngg_images image_ids='8' display_type='photocrati-nextgen_basic_singlepic'] + * + * To retrieve a tag cloud + * [ngg_images tagcloud=yes display_type='photocrati-nextgen_basic_tagcloud'] + */ + public function display_images($params, $inner_content = NULL, $mode = NULL) + { + $retval = ''; + $displayed_gallery = NULL; + // Get the NextGEN settings to provide some defaults + $settings = C_NextGen_Settings::get_instance(); + // Configure the arguments + $defaults = array('id' => NULL, 'source' => '', 'container_ids' => array(), 'gallery_ids' => array(), 'album_ids' => array(), 'tag_ids' => array(), 'display_type' => '', 'exclusions' => array(), 'order_by' => $settings->galSort, 'order_direction' => $settings->galSortOrder, 'image_ids' => array(), 'entity_ids' => array(), 'tagcloud' => FALSE, 'inner_content' => $inner_content, 'returns' => 'included', 'slug' => NULL); + $args = shortcode_atts($defaults, $params); + // Are we loading a specific displayed gallery that's persisted? + $mapper = C_Displayed_Gallery_Mapper::get_instance(); + if (!is_null($args['id'])) { + $displayed_gallery = $mapper->find($args['id']); + unset($mapper); + } else { + // Perform some conversions... + // Galleries? + if ($args['gallery_ids']) { + if ($args['source'] != 'albums' and $args['source'] != 'album') { + $args['source'] = 'galleries'; + $args['container_ids'] = $args['gallery_ids']; + if ($args['image_ids']) { + $args['entity_ids'] = $args['image_ids']; + } + } elseif ($args['source'] == 'albums') { + $args['entity_ids'] = $args['gallery_ids']; + } + unset($args['gallery_ids']); + } elseif ($args['album_ids'] || $args['album_ids'] === '0') { + $args['source'] = 'albums'; + $args['container_ids'] = $args['album_ids']; + unset($args['albums_ids']); + } elseif ($args['tag_ids']) { + $args['source'] = 'tags'; + $args['container_ids'] = $args['tag_ids']; + unset($args['tag_ids']); + } elseif ($args['image_ids']) { + $args['source'] = 'galleries'; + $args['entity_ids'] = $args['image_ids']; + unset($args['image_ids']); + } elseif ($args['tagcloud']) { + $args['source'] = 'tags'; + } + // Convert strings to arrays + if (!is_array($args['container_ids'])) { + $args['container_ids'] = preg_split('/,|\\|/', $args['container_ids']); + } + if (!is_array($args['exclusions'])) { + $args['exclusions'] = preg_split('/,|\\|/', $args['exclusions']); + } + if (!is_array($args['entity_ids'])) { + $args['entity_ids'] = preg_split('/,|\\|/', $args['entity_ids']); + } + // Get the display settings + foreach (array_keys($defaults) as $key) { + unset($params[$key]); + } + $args['display_settings'] = $params; + // Create the displayed gallery + $factory = C_Component_Factory::get_instance(); + $displayed_gallery = $factory->create('displayed_gallery', $args, $mapper); + unset($factory); + } + // Validate the displayed gallery + if ($displayed_gallery) { + if ($displayed_gallery->validate()) { + // Set a temporary id + $displayed_gallery->id($displayed_gallery->to_transient()); + // Display! + return $this->object->render($displayed_gallery, TRUE, $mode); + } else { + if (C_NextGEN_Bootstrap::$debug) { + $retval = __('We cannot display this gallery', 'nggallery') . $this->debug_msg($displayed_gallery->get_errors()) . $this->debug_msg($displayed_gallery->get_entity()); + } else { + $retval = __('We cannot display this gallery', 'nggallery'); + } + } + } else { + $retval = __('We cannot display this gallery', 'nggallery'); + } + return $retval; + } + public function debug_msg($msg, $print_r = FALSE) + { + $retval = ''; + if (C_NextGEN_Bootstrap::$debug) { + ob_start(); + if ($print_r) { + echo '<pre>'; + print_r($msg); + echo '</pre>'; + } else { + var_dump($msg); + } + $retval = ob_get_clean(); + } + return $retval; + } + /** + * Renders a displayed gallery on the frontend + * @param C_Displayed_Gallery|stdClass $displayed_gallery + */ + public function render($displayed_gallery, $return = FALSE, $mode = null) + { + $retval = ''; + $lookup = TRUE; + // Simply throwing our rendered gallery into a feed will most likely not work correctly. + // The MediaRSS option in NextGEN is available as an alternative. + if (!C_NextGen_Settings::get_instance()->galleries_in_feeds && is_feed()) { + return sprintf(__(' [<a href="%s">See image gallery at %s</a>] ', 'nggallery'), esc_url(apply_filters('the_permalink_rss', get_permalink())), $_SERVER['SERVER_NAME']); + } + if ($mode == null) { + $mode = 'normal'; + } + // Save the displayed gallery as a transient if it hasn't already. Allows for ajax operations + // to add or modify the gallery without losing a retrievable ID + if (!$displayed_gallery->apply_transient()) { + $displayed_gallery->to_transient(); + } + // Get the display type controller + $controller = $this->get_registry()->get_utility('I_Display_Type_Controller', $displayed_gallery->display_type); + // Get routing info + $router = C_Router::get_instance(); + $url = $router->get_url($router->get_request_uri(), TRUE); + // Should we lookup in cache? + if (is_array($displayed_gallery->container_ids) && in_array('All', $displayed_gallery->container_ids)) { + $lookup = FALSE; + } elseif ($displayed_gallery->source == 'albums' && $controller->param('gallery') or $controller->param('album')) { + $lookup = FALSE; + } elseif ($controller->param('show')) { + $lookup = FALSE; + } elseif ($controller->is_cachable() === FALSE) { + $lookup = FALSE; + } + // Enqueue any necessary static resources + if (!defined('NGG_SKIP_LOAD_SCRIPTS') || !NGG_SKIP_LOAD_SCRIPTS) { + $controller->enqueue_frontend_resources($displayed_gallery); + } + // Try cache lookup, if we're to do so + $key = NULL; + $html = FALSE; + if ($lookup) { + // The display type may need to output some things + // even when serving from the cache + if ($controller->has_method('cache_action')) { + $retval = $controller->cache_action($displayed_gallery); + } + // Output debug message + $retval .= $this->debug_msg('Lookup!'); + // Some settings affect display types + $settings = C_NextGen_Settings::get_instance(); + $key_params = apply_filters('ngg_displayed_gallery_cache_params', array($displayed_gallery->get_entity(), $url, $mode, $settings->activateTags, $settings->appendType, $settings->maxImages, $settings->thumbEffect, $settings->thumbCode, $settings->galSort, $settings->galSortDir)); + // Any displayed gallery links on the home page will need to be regenerated if the permalink structure + // changes + if (is_home() or is_front_page()) { + $key_params[] = get_option('permalink_structure'); + } + // Try getting the rendered HTML from the cache + $key = C_Photocrati_Transient_Manager::create_key('displayed_gallery_rendering', $key_params); + if (NGG_RENDERING_CACHE_ENABLED) { + $html = C_Photocrati_Transient_Manager::fetch($key, FALSE); + } + // Output debug messages + if ($html) { + $retval .= $this->debug_msg('HIT!'); + } else { + $retval .= $this->debug_msg('MISS!'); + } + // TODO: This is hack. We need to figure out a more uniform way of detecting dynamic image urls + if (strpos($html, C_Photocrati_Settings_Manager::get_instance()->dynamic_thumbnail_slug . '/') !== FALSE) { + $html = FALSE; + } + } else { + $retval .= $this->debug_msg('Not looking up in cache as per rules'); + } + // If we're displaying a variant, I want to know it + if (isset($displayed_gallery->variation) && is_numeric($displayed_gallery->variation) && $displayed_gallery->variation > 0) { + $retval .= $this->debug_msg("Using variation #{$displayed_gallery->variation}!"); + } + // If a cached version doesn't exist, then create the cache + if (!$html) { + $retval .= $this->debug_msg('Rendering displayed gallery'); + $current_mode = $controller->get_render_mode(); + $controller->set_render_mode($mode); + $html = apply_filters('ngg_displayed_gallery_rendering', $controller->index_action($displayed_gallery, TRUE), $displayed_gallery); + if ($key != null) { + C_Photocrati_Transient_Manager::update($key, $html, NGG_RENDERING_CACHE_TTL); + } + } + $retval .= $html; + if (!$return) { + echo $retval; + } + return $retval; + } +} +class C_Displayed_Gallery_Source_Manager +{ + private $_sources = array(); + private $_entity_types = array(); + private $_registered_defaults = array(); + /* @var C_Displayed_Gallery_Source_Manager */ + static $_instance = NULL; + static function get_instance() + { + if (!isset(self::$_instance)) { + $klass = get_class(); + self::$_instance = new $klass(); + } + return self::$_instance; + } + public function register_defaults() + { + // Entity types must be registered first!!! + // ---------------------------------------- + $this->register_entity_type('gallery', 'galleries'); + $this->register_entity_type('image', 'images'); + $this->register_entity_type('album', 'albums'); + // Galleries + $galleries = new stdClass(); + $galleries->name = 'galleries'; + $galleries->title = __('Galleries', 'nggallery'); + $galleries->aliases = array('gallery', 'images', 'image'); + $galleries->returns = array('image'); + $this->register($galleries->name, $galleries); + // Albums + $albums = new stdClass(); + $albums->name = 'albums'; + $albums->title = __('Albums', 'nggallery'); + $albums->aliases = array('album'); + $albums->returns = array('album', 'gallery'); + $this->register($albums->name, $albums); + // Tags + $tags = new stdClass(); + $tags->name = 'tags'; + $tags->title = __('Tags', 'nggallery'); + $tags->aliases = array('tag', 'image_tags', 'image_tag'); + $tags->returns = array('image'); + $this->register($tags->name, $tags); + // Random Images; + $random = new stdClass(); + $random->name = 'random_images'; + $random->title = __('Random Images', 'nggallery'); + $random->aliases = array('random', 'random_image'); + $random->returns = array('image'); + $random->has_variations = TRUE; + $this->register($random->name, $random); + // Recent Images + $recent = new stdClass(); + $recent->name = 'recent_images'; + $recent->title = __('Recent Images', 'nggallery'); + $recent->aliases = array('recent', 'recent_image'); + $recent->returns = array('image'); + $this->register($recent->name, $recent); + $this->_registered_defaults = TRUE; + } + public function register($name, $properties) + { + // We'll use an object to represent the source + $object = $properties; + if (!is_object($properties)) { + $object = new stdClass(); + foreach ($properties as $k => $v) { + $object->{$k} = $v; + } + } + // Set default properties + $object->name = $name; + if (!isset($object->title)) { + $object->title = $name; + } + if (!isset($object->returns)) { + $object->returns = array(); + } + if (!isset($object->aliases)) { + $object->aliases = array(); + } + if (!isset($object->has_variations)) { + $object->has_variations = FALSE; + } + // Add internal reference + $this->_sources[$name] = $object; + foreach ($object->aliases as $name) { + $this->_sources[$name] = $object; + } + } + public function register_entity_type() + { + $aliases = func_get_args(); + $name = array_shift($aliases); + $this->_entity_types[] = $name; + foreach ($aliases as $alias) { + $this->_entity_types[$alias] = $name; + } + } + public function deregister($name) + { + if ($source = $this->get($name)) { + unset($this->_sources[$name]); + foreach ($source->aliases as $alias) { + unset($this->_sources[$alias]); + } + } + } + public function deregister_entity_type($name) + { + unset($this->_entity_types[$name]); + } + public function get($name_or_alias) + { + if (!$this->_registered_defaults) { + $this->register_defaults(); + } + $retval = NULL; + if (isset($this->_sources[$name_or_alias])) { + $retval = $this->_sources[$name_or_alias]; + } + return $retval; + } + public function get_entity_type($name) + { + if (!$this->_registered_defaults) { + $this->register_defaults(); + } + $found = array_search($name, $this->_entity_types); + if ($found) { + return $this->_entity_types[$found]; + } else { + return NULL; + } + } + public function get_all() + { + if (!$this->_registered_defaults) { + $this->register_defaults(); + } + $retval = array(); + foreach (array_values($this->_sources) as $source_obj) { + if (!in_array($source_obj, $retval)) { + $retval[] = $source_obj; + } + } + usort($retval, array(&$this, '__sort_by_name')); + return $retval; + } + public function __sort_by_name($a, $b) + { + return strcmp($a->name, $b->name); + } + public function get_all_entity_types() + { + if (!$this->_registered_defaults) { + $this->register_defaults(); + } + return array_unique(array_values($this->_entity_types)); + } + public function is_registered($name) + { + return !is_null($this->get($name)); + } + public function is_valid_entity_type($name) + { + return !is_null($this->get_entity_type($name)); + } + public function deregister_all() + { + $this->_sources = array(); + $this->_entity_types = array(); + $this->_registered_defaults = FALSE; + } + public function is_compatible($source, $display_type) + { + $retval = FALSE; + if ($source = $this->get($source->name)) { + // Get the real entity type names for the display type + $display_type_entity_types = array(); + foreach ($display_type->entity_types as $type) { + $result = $this->get_entity_type($type); + if ($result) { + $display_type_entity_types[] = $result; + } + } + foreach ($source->returns as $entity_type) { + if (in_array($entity_type, $display_type_entity_types, TRUE)) { + $retval = TRUE; + break; + } + } + } + return $retval; + } +} +abstract class C_Displayed_Gallery_Trigger +{ + static function is_renderable($name, $displayed_gallery) + { + return TRUE; + } + public function get_css_class() + { + return 'fa fa-circle'; + } + public function get_attributes() + { + return array('class' => $this->get_css_class()); + } + public function render() + { + $attributes = array(); + foreach ($this->get_attributes() as $k => $v) { + $k = esc_attr($k); + $v = esc_attr($v); + $attributes[] = "{$k}='{$v}'"; + } + $attributes = implode(' ', $attributes); + return "<i {$attributes}></i>"; + } +} +/** + * The Trigger Manager displays "trigger buttons" for a displayed gallery. + * + * Each display type can register a "handler", which is a class with a render method, which is used + * to render the display of the trigger buttons. + * + * Each trigger button is registered with a handler, which is also a class with a render() method. + * Class C_Displayed_Gallery_Trigger_Manager + */ +class C_Displayed_Gallery_Trigger_Manager +{ + static $_instance = NULL; + private $_triggers = array(); + private $_trigger_order = array(); + private $_display_type_handlers = array(); + private $_default_display_type_handler = NULL; + private $css_class = 'ngg-trigger-buttons'; + private $_default_image_types = array('photocrati-nextgen_basic_thumbnails', 'photocrati-nextgen_basic_singlepic', 'photocrati-nextgen_pro_thumbnail_grid', 'photocrati-nextgen_pro_blog_gallery', 'photocrati-nextgen_pro_film'); + /** + * @return C_Displayed_Gallery_Trigger_Manager + */ + static function get_instance() + { + if (!self::$_instance) { + $klass = get_class(); + self::$_instance = new $klass(); + } + return self::$_instance; + } + public function __construct() + { + $this->_default_display_type_handler = 'C_Displayed_Gallery_Trigger_Handler'; + foreach ($this->_default_image_types as $display_type) { + $this->register_display_type_handler($display_type, 'C_Displayed_Gallery_Image_Trigger_Handler'); + } + } + public function register_display_type_handler($display_type, $klass) + { + $this->_display_type_handlers[$display_type] = $klass; + } + public function deregister_display_type_handler($display_type) + { + unset($this->_display_type_handlers[$display_type]); + } + public function add($name, $handler) + { + $this->_triggers[$name] = $handler; + $this->_trigger_order[] = $name; + return $this; + } + public function remove($name) + { + $order = array(); + unset($this->_triggers[$name]); + foreach ($this->_trigger_order as $trigger) { + if ($trigger != $name) { + $order[] = $trigger; + } + } + $this->_trigger_order = $order; + return $this; + } + public function _rebuild_index() + { + $order = array(); + foreach ($this->_trigger_order as $name) { + $order[] = $name; + } + $this->_trigger_order = $order; + return $this; + } + public function increment_position($name) + { + if (($current_index = array_search($name, $this->_trigger_order)) !== FALSE) { + $next_index = $current_index += 1; + // 1,2,3,4,5 => 1,2,4,3,5 + if (isset($this->_trigger_order[$next_index])) { + $next = $this->_trigger_order[$next_index]; + $this->_trigger_order[$next_index] = $name; + $this->_trigger_order[$current_index] = $next; + } + } + return $this->position_of($name); + } + public function decrement_position($name) + { + if (($current_index = array_search($name, $this->_trigger_order)) !== FALSE) { + $previous_index = $current_index -= 1; + if (isset($this->_trigger_order[$previous_index])) { + $previous = $this->_trigger_order[$previous_index]; + $this->_trigger_order[$previous_index] = $name; + $this->_trigger_order[$current_index] = $previous; + } + } + return $this->position_of($name); + } + public function position_of($name) + { + return array_search($name, $this->_trigger_order); + } + public function move_to_position($name, $position_index) + { + if (($current_index = $this->position_of($name)) !== FALSE) { + $func = 'increment_position'; + if ($current_index < $position_index) { + $func = 'decrement_position'; + } + while ($this->position_of($name) != $position_index) { + $this->{$func}($name); + } + } + return $this->position_of($name); + } + public function move_to_start($name) + { + if ($index = $this->position_of($name)) { + unset($this->_trigger_order[$index]); + array_unshift($this->_trigger_order, $name); + $this->_rebuild_index(); + } + return $this->position_of($name); + } + public function count() + { + return count($this->_trigger_order); + } + public function move_to_end($name) + { + $index = $this->position_of($name); + if ($index !== FALSE or $index != $this->count() - 1) { + unset($this->_trigger_order[$index]); + $this->_trigger_order[] = $name; + $this->_rebuild_index(); + } + return $this->position_of($name); + } + public function get_handler_for_displayed_gallery($displayed_gallery) + { + // Find the trigger handler for the current display type. + // First, check the display settings for the displayed gallery. Some third-party + // display types might specify their own handler + $klass = NULL; + if (isset($displayed_gallery->display_settings['trigger_handler'])) { + $klass = $displayed_gallery->display_settings['trigger_handler']; + } else { + $klass = $this->_default_display_type_handler; + if (isset($this->_display_type_handlers[$displayed_gallery->display_type])) { + $klass = $this->_display_type_handlers[$displayed_gallery->display_type]; + } + } + return $klass; + } + public function render($view, $displayed_gallery) + { + if ($klass = $this->get_handler_for_displayed_gallery($displayed_gallery)) { + $handler = new $klass(); + $handler->view = $view; + $handler->displayed_gallery = $displayed_gallery; + $handler->manager = $this; + if (method_exists($handler, 'render')) { + $handler->render(); + } + } + return $view; + } + public function render_trigger($name, $view, $displayed_gallery) + { + $retval = ''; + if (isset($this->_triggers[$name])) { + $klass = $this->_triggers[$name]; + if (call_user_func(array($klass, 'is_renderable'), $name, $displayed_gallery)) { + $handler = new $klass(); + $handler->name = $name; + $handler->view = $this->view = $view; + $handler->displayed_gallery = $displayed_gallery; + $retval = $handler->render(); + } + } + return $retval; + } + public function render_triggers($view, $displayed_gallery) + { + $output = FALSE; + $css_class = esc_attr($this->css_class); + $retval = array("<div class='{$css_class}'>"); + foreach ($this->_trigger_order as $name) { + if ($markup = $this->render_trigger($name, $view, $displayed_gallery)) { + $output = TRUE; + $retval[] = $markup; + } + } + if ($output) { + $retval[] = '</div>'; + $retval = implode(' +', $retval); + } else { + $retval = ''; + } + return $retval; + } + public function enqueue_resources($displayed_gallery) + { + if ($handler = $this->get_handler_for_displayed_gallery($displayed_gallery)) { + wp_enqueue_style('fontawesome'); + wp_enqueue_style('ngg_trigger_buttons'); + if (method_exists($handler, 'enqueue_resources')) { + call_user_func(array($handler, 'enqueue_resources'), $displayed_gallery); + foreach ($this->_trigger_order as $name) { + $handler = $this->_triggers[$name]; + $renderable = TRUE; + if (method_exists($handler, 'is_renderable')) { + $renderable = call_user_func($handler, 'is_renderable', $name, $displayed_gallery); + } + if ($renderable && method_exists($handler, 'enqueue_resources')) { + call_user_func(array($handler, 'enqueue_resources', $name, $displayed_gallery)); + } + } + } + } + } +} +class C_Displayed_Gallery_Image_Trigger_Handler +{ + public function render() + { + foreach ($this->view->find('nextgen_gallery.image', true) as $image_element) { + $image_element->append($this->manager->render_triggers($image_element, $this->displayed_gallery)); + } + } +} +class C_Displayed_Gallery_Trigger_Handler +{ + public function render() + { + $this->view->append($this->manager->render_triggers($this->view, $this->displayed_gallery)); + } +} +class Mixin_Display_Type_Form extends Mixin +{ + public $_model = null; + public function initialize() + { + $this->object->implement('I_Display_Type_Form'); + } + /** + * Returns the name of the display type. Sub-class should override + * @throws Exception + * @returns string + */ + public function get_display_type_name() + { + throw new Exception(__METHOD__ . ' not implemented'); + } + /** + * Returns the model (display type) used in the form + * @return stdClass + */ + public function get_model() + { + if ($this->_model == null) { + $mapper = C_Display_Type_Mapper::get_instance(); + $this->_model = $mapper->find_by_name($this->object->get_display_type_name(), TRUE); + } + return $this->_model; + } + /** + * Returns the title of the form, which is the title of the display type + * @returns string + */ + public function get_title() + { + return __($this->object->get_model()->title, 'nggallery'); + } + /** + * Saves the settings for the display type + * @param array $attributes + * @return boolean + */ + public function save_action($attributes = array()) + { + return $this->object->get_model()->save(array('settings' => $attributes)); + } +} \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/static/common.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/static/common.js index d4e10b3ee678113d808fbddd9ff58e3c5f75856b..a68fc90c1f266776e010770dc6fb896356f5c0de 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/static/common.js +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/static/common.js @@ -1,75 +1,75 @@ -(function($){ - window.NggPaginatedGallery = function(displayed_gallery_id, container, links) { +(function($) { + window.NggPaginatedGallery = function(displayed_gallery_id, container) { this.displayed_gallery_id = displayed_gallery_id; - this.links = links; - this.container = container; + this.container = $(container); + this.container_name = container; - this.get_displayed_gallery_obj = function(){ - var index = 'gallery_'+this.displayed_gallery_id; - if (typeof(window.galleries[index]) == 'undefined') + this.get_displayed_gallery_obj = function() { + var index = 'gallery_' + this.displayed_gallery_id; + if (typeof(window.galleries[index]) == 'undefined') { return false; - else + } else { return window.galleries[index]; + } }; + this.enable_ajax_pagination = function() { + var self = this; + // Attach a click event handler for each pagination link to adjust the request to be sent via XHR + $('body').on('click', 'a.ngg-browser-prev, a.ngg-browser-next', function (event) { - this.enable_ajax_pagination = function(){ - var transient_id = this.get_displayed_gallery_obj().transient_id; - var obj = this; - - // Attach a click event handler for each pagination link to - // adjust the request to be sent via XHR - this.links.each(function(){ - var $link = $(this); - $link.click(function(e){ - e.preventDefault(); - - // Describe AJAX request - var request = { - action: 'render_displayed_gallery', - displayed_gallery_id: transient_id, - ajax_referrer: $link.attr('href') - }; - - // Notify the user that we're busy - obj.do_ajax(request); + var skip = true; + $(this).parents(container).each(function() { + if ($(this).data('nextgen-gallery-id') != self.displayed_gallery_id) { + return true; + } + skip = false; }); - }); - }; - - this.do_ajax = function(request){ - - var container = this.container; - var self = this; - // Adjust the user notification - window['ngg_ajax_operaton_count']++; - $('body, a').css('cursor', 'wait'); - - // Send the AJAX request - $.post(photocrati_ajax.url, request, function(response){ - - // Adjust the user notification - window['ngg_ajax_operaton_count']--; - if (window['ngg_ajax_operaton_count'] <= 0) { - window['ngg_ajax_operaton_count'] = 0; - $('body, a').css('cursor', 'auto'); + if (!skip) { + event.preventDefault(); + } else { + return; } - // Ensure that the server returned JSON - if (typeof(response) != 'object') response = JSON.parse(response); - if (response) { - container.each(function() { - if ($(this).data('nextgen-gallery-id') != self.displayed_gallery_id) { - return true; + // Adjust the user notification + window['ngg_ajax_operaton_count']++; + $('body, a').css('cursor', 'wait'); + + // Send the AJAX request + $.get($(this).attr('href'), function (response) { + window['ngg_ajax_operaton_count']--; + if (window['ngg_ajax_operaton_count'] <= 0) { + window['ngg_ajax_operaton_count'] = 0; + $('body, a').css('cursor', 'auto'); + } + + if (response) { + var html = $(response); + var replacement = false; + html.find(self.container_name).each(function() { + if (replacement) { + return true; + } + if ($(this).data('nextgen-gallery-id') != self.displayed_gallery_id) { + return true; + } + replacement = $(this); + }); + if (replacement) { + self.container.each(function () { + if ($(this).data('nextgen-gallery-id') != self.displayed_gallery_id) { + return true; + } + $(this).html(replacement.html()); + return true; + }); + + // Let the user know that we've refreshed the content + $(document).trigger('refreshed'); } - $(this).replaceWith(response.html); - return true; - }); - - // Let the user know that we've refreshed the content - $(document).trigger('refreshed'); - } + } + }); }); }; diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/static/common.min.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/static/common.min.js new file mode 100644 index 0000000000000000000000000000000000000000..fc1a60a358dcc6631baeb64269f2437aa52b88de --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/static/common.min.js @@ -0,0 +1 @@ +eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('(4($){3.I=4(6,b){1.6=6;1.b=$(b);1.y=b;1.w=4(){9 l=\'J\'+1.6;2(r(3.z[l])==\'j\'){5 q}D{5 3.z[l]}};1.A=4(){9 8=1;$(\'m\').K(\'H\',\'a.v-C-L, a.v-C-E\',4(t){9 k=7;$(1).F(b).p(4(){2($(1).i(\'g-h-o\')!=8.6){5 7}k=q});2(!k){t.S()}D{5}3[\'c\']++;$(\'m, a\').u(\'s\',\'V\');$.U($(1).M(\'X\'),4(n){3[\'c\']--;2(3[\'c\']<=0){3[\'c\']=0;$(\'m, a\').u(\'s\',\'T\')}2(n){9 f=$(n);9 d=q;f.O(8.y).p(4(){2(d){5 7}2($(1).i(\'g-h-o\')!=8.6){5 7}d=$(1)});2(d){8.b.p(4(){2($(1).i(\'g-h-o\')!=8.6){5 7}$(1).f(d.f());5 7});$(R).P(\'N\')}}})})};9 e=1.w();2(e){2(r(e.B[\'x\'])!=\'j\'){2(G(e.B[\'x\'])){1.A()}}}2(r(3[\'W\'])==\'j\'){3[\'c\']=0}}})(Q);',60,60,'|this|if|window|function|return|displayed_gallery_id|true|self|var||container|ngg_ajax_operaton_count|replacement|displayed_gallery|html|nextgen|gallery|data|undefined|skip|index|body|response|id|each|false|typeof|cursor|event|css|ngg|get_displayed_gallery_obj|ajax_pagination|container_name|galleries|enable_ajax_pagination|display_settings|browser|else|next|parents|parseInt|click|NggPaginatedGallery|gallery_|on|prev|attr|refreshed|find|trigger|jQuery|document|preventDefault|auto|get|wait|ngg_ajax_operation_count|href'.split('|'),0,{})) diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/static/fontawesome/font-awesome.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/static/fontawesome/font-awesome.css index 449d6ac551a286a868c5f102b303dbf2ac527552..24fcc04c4ed56775bffd4597800eb544bac91178 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/static/fontawesome/font-awesome.css +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/static/fontawesome/font-awesome.css @@ -1,4 +1,4 @@ /*! - * Font Awesome 4.0.3 by @davegandy - http://fontawesome.io - @fontawesome + * Font Awesome 4.3.0 by @davegandy - http://fontawesome.io - @fontawesome * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) - */@font-face{font-family:'FontAwesome';src:url('../fonts/fontawesome-webfont.eot?v=4.0.3');src:url('../fonts/fontawesome-webfont.eot?#iefix&v=4.0.3') format('embedded-opentype'),url('../fonts/fontawesome-webfont.woff?v=4.0.3') format('woff'),url('../fonts/fontawesome-webfont.ttf?v=4.0.3') format('truetype'),url('../fonts/fontawesome-webfont.svg?v=4.0.3#fontawesomeregular') format('svg');font-weight:normal;font-style:normal}.fa{display:inline-block;font-family:FontAwesome;font-style:normal;font-weight:normal;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.fa-lg{font-size:1.3333333333333333em;line-height:.75em;vertical-align:-15%}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-fw{width:1.2857142857142858em;text-align:center}.fa-ul{padding-left:0;margin-left:2.142857142857143em;list-style-type:none}.fa-ul>li{position:relative}.fa-li{position:absolute;left:-2.142857142857143em;width:2.142857142857143em;top:.14285714285714285em;text-align:center}.fa-li.fa-lg{left:-1.8571428571428572em}.fa-border{padding:.2em .25em .15em;border:solid .08em #eee;border-radius:.1em}.pull-right{float:right}.pull-left{float:left}.fa.pull-left{margin-right:.3em}.fa.pull-right{margin-left:.3em}.fa-spin{-webkit-animation:spin 2s infinite linear;-moz-animation:spin 2s infinite linear;-o-animation:spin 2s infinite linear;animation:spin 2s infinite linear}@-moz-keyframes spin{0%{-moz-transform:rotate(0deg)}100%{-moz-transform:rotate(359deg)}}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg)}}@-o-keyframes spin{0%{-o-transform:rotate(0deg)}100%{-o-transform:rotate(359deg)}}@-ms-keyframes spin{0%{-ms-transform:rotate(0deg)}100%{-ms-transform:rotate(359deg)}}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(359deg)}}.fa-rotate-90{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=1);-webkit-transform:rotate(90deg);-moz-transform:rotate(90deg);-ms-transform:rotate(90deg);-o-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2);-webkit-transform:rotate(180deg);-moz-transform:rotate(180deg);-ms-transform:rotate(180deg);-o-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=3);-webkit-transform:rotate(270deg);-moz-transform:rotate(270deg);-ms-transform:rotate(270deg);-o-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=0,mirror=1);-webkit-transform:scale(-1,1);-moz-transform:scale(-1,1);-ms-transform:scale(-1,1);-o-transform:scale(-1,1);transform:scale(-1,1)}.fa-flip-vertical{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2,mirror=1);-webkit-transform:scale(1,-1);-moz-transform:scale(1,-1);-ms-transform:scale(1,-1);-o-transform:scale(1,-1);transform:scale(1,-1)}.fa-stack{position:relative;display:inline-block;width:2em;height:2em;line-height:2em;vertical-align:middle}.fa-stack-1x,.fa-stack-2x{position:absolute;left:0;width:100%;text-align:center}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-glass:before{content:"\f000"}.fa-music:before{content:"\f001"}.fa-search:before{content:"\f002"}.fa-envelope-o:before{content:"\f003"}.fa-heart:before{content:"\f004"}.fa-star:before{content:"\f005"}.fa-star-o:before{content:"\f006"}.fa-user:before{content:"\f007"}.fa-film:before{content:"\f008"}.fa-th-large:before{content:"\f009"}.fa-th:before{content:"\f00a"}.fa-th-list:before{content:"\f00b"}.fa-check:before{content:"\f00c"}.fa-times:before{content:"\f00d"}.fa-search-plus:before{content:"\f00e"}.fa-search-minus:before{content:"\f010"}.fa-power-off:before{content:"\f011"}.fa-signal:before{content:"\f012"}.fa-gear:before,.fa-cog:before{content:"\f013"}.fa-trash-o:before{content:"\f014"}.fa-home:before{content:"\f015"}.fa-file-o:before{content:"\f016"}.fa-clock-o:before{content:"\f017"}.fa-road:before{content:"\f018"}.fa-download:before{content:"\f019"}.fa-arrow-circle-o-down:before{content:"\f01a"}.fa-arrow-circle-o-up:before{content:"\f01b"}.fa-inbox:before{content:"\f01c"}.fa-play-circle-o:before{content:"\f01d"}.fa-rotate-right:before,.fa-repeat:before{content:"\f01e"}.fa-refresh:before{content:"\f021"}.fa-list-alt:before{content:"\f022"}.fa-lock:before{content:"\f023"}.fa-flag:before{content:"\f024"}.fa-headphones:before{content:"\f025"}.fa-volume-off:before{content:"\f026"}.fa-volume-down:before{content:"\f027"}.fa-volume-up:before{content:"\f028"}.fa-qrcode:before{content:"\f029"}.fa-barcode:before{content:"\f02a"}.fa-tag:before{content:"\f02b"}.fa-tags:before{content:"\f02c"}.fa-book:before{content:"\f02d"}.fa-bookmark:before{content:"\f02e"}.fa-print:before{content:"\f02f"}.fa-camera:before{content:"\f030"}.fa-font:before{content:"\f031"}.fa-bold:before{content:"\f032"}.fa-italic:before{content:"\f033"}.fa-text-height:before{content:"\f034"}.fa-text-width:before{content:"\f035"}.fa-align-left:before{content:"\f036"}.fa-align-center:before{content:"\f037"}.fa-align-right:before{content:"\f038"}.fa-align-justify:before{content:"\f039"}.fa-list:before{content:"\f03a"}.fa-dedent:before,.fa-outdent:before{content:"\f03b"}.fa-indent:before{content:"\f03c"}.fa-video-camera:before{content:"\f03d"}.fa-picture-o:before{content:"\f03e"}.fa-pencil:before{content:"\f040"}.fa-map-marker:before{content:"\f041"}.fa-adjust:before{content:"\f042"}.fa-tint:before{content:"\f043"}.fa-edit:before,.fa-pencil-square-o:before{content:"\f044"}.fa-share-square-o:before{content:"\f045"}.fa-check-square-o:before{content:"\f046"}.fa-arrows:before{content:"\f047"}.fa-step-backward:before{content:"\f048"}.fa-fast-backward:before{content:"\f049"}.fa-backward:before{content:"\f04a"}.fa-play:before{content:"\f04b"}.fa-pause:before{content:"\f04c"}.fa-stop:before{content:"\f04d"}.fa-forward:before{content:"\f04e"}.fa-fast-forward:before{content:"\f050"}.fa-step-forward:before{content:"\f051"}.fa-eject:before{content:"\f052"}.fa-chevron-left:before{content:"\f053"}.fa-chevron-right:before{content:"\f054"}.fa-plus-circle:before{content:"\f055"}.fa-minus-circle:before{content:"\f056"}.fa-times-circle:before{content:"\f057"}.fa-check-circle:before{content:"\f058"}.fa-question-circle:before{content:"\f059"}.fa-info-circle:before{content:"\f05a"}.fa-crosshairs:before{content:"\f05b"}.fa-times-circle-o:before{content:"\f05c"}.fa-check-circle-o:before{content:"\f05d"}.fa-ban:before{content:"\f05e"}.fa-arrow-left:before{content:"\f060"}.fa-arrow-right:before{content:"\f061"}.fa-arrow-up:before{content:"\f062"}.fa-arrow-down:before{content:"\f063"}.fa-mail-forward:before,.fa-share:before{content:"\f064"}.fa-expand:before{content:"\f065"}.fa-compress:before{content:"\f066"}.fa-plus:before{content:"\f067"}.fa-minus:before{content:"\f068"}.fa-asterisk:before{content:"\f069"}.fa-exclamation-circle:before{content:"\f06a"}.fa-gift:before{content:"\f06b"}.fa-leaf:before{content:"\f06c"}.fa-fire:before{content:"\f06d"}.fa-eye:before{content:"\f06e"}.fa-eye-slash:before{content:"\f070"}.fa-warning:before,.fa-exclamation-triangle:before{content:"\f071"}.fa-plane:before{content:"\f072"}.fa-calendar:before{content:"\f073"}.fa-random:before{content:"\f074"}.fa-comment:before{content:"\f075"}.fa-magnet:before{content:"\f076"}.fa-chevron-up:before{content:"\f077"}.fa-chevron-down:before{content:"\f078"}.fa-retweet:before{content:"\f079"}.fa-shopping-cart:before{content:"\f07a"}.fa-folder:before{content:"\f07b"}.fa-folder-open:before{content:"\f07c"}.fa-arrows-v:before{content:"\f07d"}.fa-arrows-h:before{content:"\f07e"}.fa-bar-chart-o:before{content:"\f080"}.fa-twitter-square:before{content:"\f081"}.fa-facebook-square:before{content:"\f082"}.fa-camera-retro:before{content:"\f083"}.fa-key:before{content:"\f084"}.fa-gears:before,.fa-cogs:before{content:"\f085"}.fa-comments:before{content:"\f086"}.fa-thumbs-o-up:before{content:"\f087"}.fa-thumbs-o-down:before{content:"\f088"}.fa-star-half:before{content:"\f089"}.fa-heart-o:before{content:"\f08a"}.fa-sign-out:before{content:"\f08b"}.fa-linkedin-square:before{content:"\f08c"}.fa-thumb-tack:before{content:"\f08d"}.fa-external-link:before{content:"\f08e"}.fa-sign-in:before{content:"\f090"}.fa-trophy:before{content:"\f091"}.fa-github-square:before{content:"\f092"}.fa-upload:before{content:"\f093"}.fa-lemon-o:before{content:"\f094"}.fa-phone:before{content:"\f095"}.fa-square-o:before{content:"\f096"}.fa-bookmark-o:before{content:"\f097"}.fa-phone-square:before{content:"\f098"}.fa-twitter:before{content:"\f099"}.fa-facebook:before{content:"\f09a"}.fa-github:before{content:"\f09b"}.fa-unlock:before{content:"\f09c"}.fa-credit-card:before{content:"\f09d"}.fa-rss:before{content:"\f09e"}.fa-hdd-o:before{content:"\f0a0"}.fa-bullhorn:before{content:"\f0a1"}.fa-bell:before{content:"\f0f3"}.fa-certificate:before{content:"\f0a3"}.fa-hand-o-right:before{content:"\f0a4"}.fa-hand-o-left:before{content:"\f0a5"}.fa-hand-o-up:before{content:"\f0a6"}.fa-hand-o-down:before{content:"\f0a7"}.fa-arrow-circle-left:before{content:"\f0a8"}.fa-arrow-circle-right:before{content:"\f0a9"}.fa-arrow-circle-up:before{content:"\f0aa"}.fa-arrow-circle-down:before{content:"\f0ab"}.fa-globe:before{content:"\f0ac"}.fa-wrench:before{content:"\f0ad"}.fa-tasks:before{content:"\f0ae"}.fa-filter:before{content:"\f0b0"}.fa-briefcase:before{content:"\f0b1"}.fa-arrows-alt:before{content:"\f0b2"}.fa-group:before,.fa-users:before{content:"\f0c0"}.fa-chain:before,.fa-link:before{content:"\f0c1"}.fa-cloud:before{content:"\f0c2"}.fa-flask:before{content:"\f0c3"}.fa-cut:before,.fa-scissors:before{content:"\f0c4"}.fa-copy:before,.fa-files-o:before{content:"\f0c5"}.fa-paperclip:before{content:"\f0c6"}.fa-save:before,.fa-floppy-o:before{content:"\f0c7"}.fa-square:before{content:"\f0c8"}.fa-bars:before{content:"\f0c9"}.fa-list-ul:before{content:"\f0ca"}.fa-list-ol:before{content:"\f0cb"}.fa-strikethrough:before{content:"\f0cc"}.fa-underline:before{content:"\f0cd"}.fa-table:before{content:"\f0ce"}.fa-magic:before{content:"\f0d0"}.fa-truck:before{content:"\f0d1"}.fa-pinterest:before{content:"\f0d2"}.fa-pinterest-square:before{content:"\f0d3"}.fa-google-plus-square:before{content:"\f0d4"}.fa-google-plus:before{content:"\f0d5"}.fa-money:before{content:"\f0d6"}.fa-caret-down:before{content:"\f0d7"}.fa-caret-up:before{content:"\f0d8"}.fa-caret-left:before{content:"\f0d9"}.fa-caret-right:before{content:"\f0da"}.fa-columns:before{content:"\f0db"}.fa-unsorted:before,.fa-sort:before{content:"\f0dc"}.fa-sort-down:before,.fa-sort-asc:before{content:"\f0dd"}.fa-sort-up:before,.fa-sort-desc:before{content:"\f0de"}.fa-envelope:before{content:"\f0e0"}.fa-linkedin:before{content:"\f0e1"}.fa-rotate-left:before,.fa-undo:before{content:"\f0e2"}.fa-legal:before,.fa-gavel:before{content:"\f0e3"}.fa-dashboard:before,.fa-tachometer:before{content:"\f0e4"}.fa-comment-o:before{content:"\f0e5"}.fa-comments-o:before{content:"\f0e6"}.fa-flash:before,.fa-bolt:before{content:"\f0e7"}.fa-sitemap:before{content:"\f0e8"}.fa-umbrella:before{content:"\f0e9"}.fa-paste:before,.fa-clipboard:before{content:"\f0ea"}.fa-lightbulb-o:before{content:"\f0eb"}.fa-exchange:before{content:"\f0ec"}.fa-cloud-download:before{content:"\f0ed"}.fa-cloud-upload:before{content:"\f0ee"}.fa-user-md:before{content:"\f0f0"}.fa-stethoscope:before{content:"\f0f1"}.fa-suitcase:before{content:"\f0f2"}.fa-bell-o:before{content:"\f0a2"}.fa-coffee:before{content:"\f0f4"}.fa-cutlery:before{content:"\f0f5"}.fa-file-text-o:before{content:"\f0f6"}.fa-building-o:before{content:"\f0f7"}.fa-hospital-o:before{content:"\f0f8"}.fa-ambulance:before{content:"\f0f9"}.fa-medkit:before{content:"\f0fa"}.fa-fighter-jet:before{content:"\f0fb"}.fa-beer:before{content:"\f0fc"}.fa-h-square:before{content:"\f0fd"}.fa-plus-square:before{content:"\f0fe"}.fa-angle-double-left:before{content:"\f100"}.fa-angle-double-right:before{content:"\f101"}.fa-angle-double-up:before{content:"\f102"}.fa-angle-double-down:before{content:"\f103"}.fa-angle-left:before{content:"\f104"}.fa-angle-right:before{content:"\f105"}.fa-angle-up:before{content:"\f106"}.fa-angle-down:before{content:"\f107"}.fa-desktop:before{content:"\f108"}.fa-laptop:before{content:"\f109"}.fa-tablet:before{content:"\f10a"}.fa-mobile-phone:before,.fa-mobile:before{content:"\f10b"}.fa-circle-o:before{content:"\f10c"}.fa-quote-left:before{content:"\f10d"}.fa-quote-right:before{content:"\f10e"}.fa-spinner:before{content:"\f110"}.fa-circle:before{content:"\f111"}.fa-mail-reply:before,.fa-reply:before{content:"\f112"}.fa-github-alt:before{content:"\f113"}.fa-folder-o:before{content:"\f114"}.fa-folder-open-o:before{content:"\f115"}.fa-smile-o:before{content:"\f118"}.fa-frown-o:before{content:"\f119"}.fa-meh-o:before{content:"\f11a"}.fa-gamepad:before{content:"\f11b"}.fa-keyboard-o:before{content:"\f11c"}.fa-flag-o:before{content:"\f11d"}.fa-flag-checkered:before{content:"\f11e"}.fa-terminal:before{content:"\f120"}.fa-code:before{content:"\f121"}.fa-reply-all:before{content:"\f122"}.fa-mail-reply-all:before{content:"\f122"}.fa-star-half-empty:before,.fa-star-half-full:before,.fa-star-half-o:before{content:"\f123"}.fa-location-arrow:before{content:"\f124"}.fa-crop:before{content:"\f125"}.fa-code-fork:before{content:"\f126"}.fa-unlink:before,.fa-chain-broken:before{content:"\f127"}.fa-question:before{content:"\f128"}.fa-info:before{content:"\f129"}.fa-exclamation:before{content:"\f12a"}.fa-superscript:before{content:"\f12b"}.fa-subscript:before{content:"\f12c"}.fa-eraser:before{content:"\f12d"}.fa-puzzle-piece:before{content:"\f12e"}.fa-microphone:before{content:"\f130"}.fa-microphone-slash:before{content:"\f131"}.fa-shield:before{content:"\f132"}.fa-calendar-o:before{content:"\f133"}.fa-fire-extinguisher:before{content:"\f134"}.fa-rocket:before{content:"\f135"}.fa-maxcdn:before{content:"\f136"}.fa-chevron-circle-left:before{content:"\f137"}.fa-chevron-circle-right:before{content:"\f138"}.fa-chevron-circle-up:before{content:"\f139"}.fa-chevron-circle-down:before{content:"\f13a"}.fa-html5:before{content:"\f13b"}.fa-css3:before{content:"\f13c"}.fa-anchor:before{content:"\f13d"}.fa-unlock-alt:before{content:"\f13e"}.fa-bullseye:before{content:"\f140"}.fa-ellipsis-h:before{content:"\f141"}.fa-ellipsis-v:before{content:"\f142"}.fa-rss-square:before{content:"\f143"}.fa-play-circle:before{content:"\f144"}.fa-ticket:before{content:"\f145"}.fa-minus-square:before{content:"\f146"}.fa-minus-square-o:before{content:"\f147"}.fa-level-up:before{content:"\f148"}.fa-level-down:before{content:"\f149"}.fa-check-square:before{content:"\f14a"}.fa-pencil-square:before{content:"\f14b"}.fa-external-link-square:before{content:"\f14c"}.fa-share-square:before{content:"\f14d"}.fa-compass:before{content:"\f14e"}.fa-toggle-down:before,.fa-caret-square-o-down:before{content:"\f150"}.fa-toggle-up:before,.fa-caret-square-o-up:before{content:"\f151"}.fa-toggle-right:before,.fa-caret-square-o-right:before{content:"\f152"}.fa-euro:before,.fa-eur:before{content:"\f153"}.fa-gbp:before{content:"\f154"}.fa-dollar:before,.fa-usd:before{content:"\f155"}.fa-rupee:before,.fa-inr:before{content:"\f156"}.fa-cny:before,.fa-rmb:before,.fa-yen:before,.fa-jpy:before{content:"\f157"}.fa-ruble:before,.fa-rouble:before,.fa-rub:before{content:"\f158"}.fa-won:before,.fa-krw:before{content:"\f159"}.fa-bitcoin:before,.fa-btc:before{content:"\f15a"}.fa-file:before{content:"\f15b"}.fa-file-text:before{content:"\f15c"}.fa-sort-alpha-asc:before{content:"\f15d"}.fa-sort-alpha-desc:before{content:"\f15e"}.fa-sort-amount-asc:before{content:"\f160"}.fa-sort-amount-desc:before{content:"\f161"}.fa-sort-numeric-asc:before{content:"\f162"}.fa-sort-numeric-desc:before{content:"\f163"}.fa-thumbs-up:before{content:"\f164"}.fa-thumbs-down:before{content:"\f165"}.fa-youtube-square:before{content:"\f166"}.fa-youtube:before{content:"\f167"}.fa-xing:before{content:"\f168"}.fa-xing-square:before{content:"\f169"}.fa-youtube-play:before{content:"\f16a"}.fa-dropbox:before{content:"\f16b"}.fa-stack-overflow:before{content:"\f16c"}.fa-instagram:before{content:"\f16d"}.fa-flickr:before{content:"\f16e"}.fa-adn:before{content:"\f170"}.fa-bitbucket:before{content:"\f171"}.fa-bitbucket-square:before{content:"\f172"}.fa-tumblr:before{content:"\f173"}.fa-tumblr-square:before{content:"\f174"}.fa-long-arrow-down:before{content:"\f175"}.fa-long-arrow-up:before{content:"\f176"}.fa-long-arrow-left:before{content:"\f177"}.fa-long-arrow-right:before{content:"\f178"}.fa-apple:before{content:"\f179"}.fa-windows:before{content:"\f17a"}.fa-android:before{content:"\f17b"}.fa-linux:before{content:"\f17c"}.fa-dribbble:before{content:"\f17d"}.fa-skype:before{content:"\f17e"}.fa-foursquare:before{content:"\f180"}.fa-trello:before{content:"\f181"}.fa-female:before{content:"\f182"}.fa-male:before{content:"\f183"}.fa-gittip:before{content:"\f184"}.fa-sun-o:before{content:"\f185"}.fa-moon-o:before{content:"\f186"}.fa-archive:before{content:"\f187"}.fa-bug:before{content:"\f188"}.fa-vk:before{content:"\f189"}.fa-weibo:before{content:"\f18a"}.fa-renren:before{content:"\f18b"}.fa-pagelines:before{content:"\f18c"}.fa-stack-exchange:before{content:"\f18d"}.fa-arrow-circle-o-right:before{content:"\f18e"}.fa-arrow-circle-o-left:before{content:"\f190"}.fa-toggle-left:before,.fa-caret-square-o-left:before{content:"\f191"}.fa-dot-circle-o:before{content:"\f192"}.fa-wheelchair:before{content:"\f193"}.fa-vimeo-square:before{content:"\f194"}.fa-turkish-lira:before,.fa-try:before{content:"\f195"}.fa-plus-square-o:before{content:"\f196"} \ No newline at end of file + */@font-face{font-family:'FontAwesome';src:url('../fonts/fontawesome-webfont.eot?v=4.3.0');src:url('../fonts/fontawesome-webfont.eot?#iefix&v=4.3.0') format('embedded-opentype'),url('../fonts/fontawesome-webfont.woff2?v=4.3.0') format('woff2'),url('../fonts/fontawesome-webfont.woff?v=4.3.0') format('woff'),url('../fonts/fontawesome-webfont.ttf?v=4.3.0') format('truetype'),url('../fonts/fontawesome-webfont.svg?v=4.3.0#fontawesomeregular') format('svg');font-weight:normal;font-style:normal}.fa{display:inline-block;font:normal normal normal 14px/1 FontAwesome;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;transform:translate(0, 0)}.fa-lg{font-size:1.33333333em;line-height:.75em;vertical-align:-15%}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-fw{width:1.28571429em;text-align:center}.fa-ul{padding-left:0;margin-left:2.14285714em;list-style-type:none}.fa-ul>li{position:relative}.fa-li{position:absolute;left:-2.14285714em;width:2.14285714em;top:.14285714em;text-align:center}.fa-li.fa-lg{left:-1.85714286em}.fa-border{padding:.2em .25em .15em;border:solid .08em #eee;border-radius:.1em}.pull-right{float:right}.pull-left{float:left}.fa.pull-left{margin-right:.3em}.fa.pull-right{margin-left:.3em}.fa-spin{-webkit-animation:fa-spin 2s infinite linear;animation:fa-spin 2s infinite linear}.fa-pulse{-webkit-animation:fa-spin 1s infinite steps(8);animation:fa-spin 1s infinite steps(8)}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.fa-rotate-90{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=1);-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2);-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=3);-webkit-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1);-webkit-transform:scale(-1, 1);-ms-transform:scale(-1, 1);transform:scale(-1, 1)}.fa-flip-vertical{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1);-webkit-transform:scale(1, -1);-ms-transform:scale(1, -1);transform:scale(1, -1)}:root .fa-rotate-90,:root .fa-rotate-180,:root .fa-rotate-270,:root .fa-flip-horizontal,:root .fa-flip-vertical{filter:none}.fa-stack{position:relative;display:inline-block;width:2em;height:2em;line-height:2em;vertical-align:middle}.fa-stack-1x,.fa-stack-2x{position:absolute;left:0;width:100%;text-align:center}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-glass:before{content:"\f000"}.fa-music:before{content:"\f001"}.fa-search:before{content:"\f002"}.fa-envelope-o:before{content:"\f003"}.fa-heart:before{content:"\f004"}.fa-star:before{content:"\f005"}.fa-star-o:before{content:"\f006"}.fa-user:before{content:"\f007"}.fa-film:before{content:"\f008"}.fa-th-large:before{content:"\f009"}.fa-th:before{content:"\f00a"}.fa-th-list:before{content:"\f00b"}.fa-check:before{content:"\f00c"}.fa-remove:before,.fa-close:before,.fa-times:before{content:"\f00d"}.fa-search-plus:before{content:"\f00e"}.fa-search-minus:before{content:"\f010"}.fa-power-off:before{content:"\f011"}.fa-signal:before{content:"\f012"}.fa-gear:before,.fa-cog:before{content:"\f013"}.fa-trash-o:before{content:"\f014"}.fa-home:before{content:"\f015"}.fa-file-o:before{content:"\f016"}.fa-clock-o:before{content:"\f017"}.fa-road:before{content:"\f018"}.fa-download:before{content:"\f019"}.fa-arrow-circle-o-down:before{content:"\f01a"}.fa-arrow-circle-o-up:before{content:"\f01b"}.fa-inbox:before{content:"\f01c"}.fa-play-circle-o:before{content:"\f01d"}.fa-rotate-right:before,.fa-repeat:before{content:"\f01e"}.fa-refresh:before{content:"\f021"}.fa-list-alt:before{content:"\f022"}.fa-lock:before{content:"\f023"}.fa-flag:before{content:"\f024"}.fa-headphones:before{content:"\f025"}.fa-volume-off:before{content:"\f026"}.fa-volume-down:before{content:"\f027"}.fa-volume-up:before{content:"\f028"}.fa-qrcode:before{content:"\f029"}.fa-barcode:before{content:"\f02a"}.fa-tag:before{content:"\f02b"}.fa-tags:before{content:"\f02c"}.fa-book:before{content:"\f02d"}.fa-bookmark:before{content:"\f02e"}.fa-print:before{content:"\f02f"}.fa-camera:before{content:"\f030"}.fa-font:before{content:"\f031"}.fa-bold:before{content:"\f032"}.fa-italic:before{content:"\f033"}.fa-text-height:before{content:"\f034"}.fa-text-width:before{content:"\f035"}.fa-align-left:before{content:"\f036"}.fa-align-center:before{content:"\f037"}.fa-align-right:before{content:"\f038"}.fa-align-justify:before{content:"\f039"}.fa-list:before{content:"\f03a"}.fa-dedent:before,.fa-outdent:before{content:"\f03b"}.fa-indent:before{content:"\f03c"}.fa-video-camera:before{content:"\f03d"}.fa-photo:before,.fa-image:before,.fa-picture-o:before{content:"\f03e"}.fa-pencil:before{content:"\f040"}.fa-map-marker:before{content:"\f041"}.fa-adjust:before{content:"\f042"}.fa-tint:before{content:"\f043"}.fa-edit:before,.fa-pencil-square-o:before{content:"\f044"}.fa-share-square-o:before{content:"\f045"}.fa-check-square-o:before{content:"\f046"}.fa-arrows:before{content:"\f047"}.fa-step-backward:before{content:"\f048"}.fa-fast-backward:before{content:"\f049"}.fa-backward:before{content:"\f04a"}.fa-play:before{content:"\f04b"}.fa-pause:before{content:"\f04c"}.fa-stop:before{content:"\f04d"}.fa-forward:before{content:"\f04e"}.fa-fast-forward:before{content:"\f050"}.fa-step-forward:before{content:"\f051"}.fa-eject:before{content:"\f052"}.fa-chevron-left:before{content:"\f053"}.fa-chevron-right:before{content:"\f054"}.fa-plus-circle:before{content:"\f055"}.fa-minus-circle:before{content:"\f056"}.fa-times-circle:before{content:"\f057"}.fa-check-circle:before{content:"\f058"}.fa-question-circle:before{content:"\f059"}.fa-info-circle:before{content:"\f05a"}.fa-crosshairs:before{content:"\f05b"}.fa-times-circle-o:before{content:"\f05c"}.fa-check-circle-o:before{content:"\f05d"}.fa-ban:before{content:"\f05e"}.fa-arrow-left:before{content:"\f060"}.fa-arrow-right:before{content:"\f061"}.fa-arrow-up:before{content:"\f062"}.fa-arrow-down:before{content:"\f063"}.fa-mail-forward:before,.fa-share:before{content:"\f064"}.fa-expand:before{content:"\f065"}.fa-compress:before{content:"\f066"}.fa-plus:before{content:"\f067"}.fa-minus:before{content:"\f068"}.fa-asterisk:before{content:"\f069"}.fa-exclamation-circle:before{content:"\f06a"}.fa-gift:before{content:"\f06b"}.fa-leaf:before{content:"\f06c"}.fa-fire:before{content:"\f06d"}.fa-eye:before{content:"\f06e"}.fa-eye-slash:before{content:"\f070"}.fa-warning:before,.fa-exclamation-triangle:before{content:"\f071"}.fa-plane:before{content:"\f072"}.fa-calendar:before{content:"\f073"}.fa-random:before{content:"\f074"}.fa-comment:before{content:"\f075"}.fa-magnet:before{content:"\f076"}.fa-chevron-up:before{content:"\f077"}.fa-chevron-down:before{content:"\f078"}.fa-retweet:before{content:"\f079"}.fa-shopping-cart:before{content:"\f07a"}.fa-folder:before{content:"\f07b"}.fa-folder-open:before{content:"\f07c"}.fa-arrows-v:before{content:"\f07d"}.fa-arrows-h:before{content:"\f07e"}.fa-bar-chart-o:before,.fa-bar-chart:before{content:"\f080"}.fa-twitter-square:before{content:"\f081"}.fa-facebook-square:before{content:"\f082"}.fa-camera-retro:before{content:"\f083"}.fa-key:before{content:"\f084"}.fa-gears:before,.fa-cogs:before{content:"\f085"}.fa-comments:before{content:"\f086"}.fa-thumbs-o-up:before{content:"\f087"}.fa-thumbs-o-down:before{content:"\f088"}.fa-star-half:before{content:"\f089"}.fa-heart-o:before{content:"\f08a"}.fa-sign-out:before{content:"\f08b"}.fa-linkedin-square:before{content:"\f08c"}.fa-thumb-tack:before{content:"\f08d"}.fa-external-link:before{content:"\f08e"}.fa-sign-in:before{content:"\f090"}.fa-trophy:before{content:"\f091"}.fa-github-square:before{content:"\f092"}.fa-upload:before{content:"\f093"}.fa-lemon-o:before{content:"\f094"}.fa-phone:before{content:"\f095"}.fa-square-o:before{content:"\f096"}.fa-bookmark-o:before{content:"\f097"}.fa-phone-square:before{content:"\f098"}.fa-twitter:before{content:"\f099"}.fa-facebook-f:before,.fa-facebook:before{content:"\f09a"}.fa-github:before{content:"\f09b"}.fa-unlock:before{content:"\f09c"}.fa-credit-card:before{content:"\f09d"}.fa-rss:before{content:"\f09e"}.fa-hdd-o:before{content:"\f0a0"}.fa-bullhorn:before{content:"\f0a1"}.fa-bell:before{content:"\f0f3"}.fa-certificate:before{content:"\f0a3"}.fa-hand-o-right:before{content:"\f0a4"}.fa-hand-o-left:before{content:"\f0a5"}.fa-hand-o-up:before{content:"\f0a6"}.fa-hand-o-down:before{content:"\f0a7"}.fa-arrow-circle-left:before{content:"\f0a8"}.fa-arrow-circle-right:before{content:"\f0a9"}.fa-arrow-circle-up:before{content:"\f0aa"}.fa-arrow-circle-down:before{content:"\f0ab"}.fa-globe:before{content:"\f0ac"}.fa-wrench:before{content:"\f0ad"}.fa-tasks:before{content:"\f0ae"}.fa-filter:before{content:"\f0b0"}.fa-briefcase:before{content:"\f0b1"}.fa-arrows-alt:before{content:"\f0b2"}.fa-group:before,.fa-users:before{content:"\f0c0"}.fa-chain:before,.fa-link:before{content:"\f0c1"}.fa-cloud:before{content:"\f0c2"}.fa-flask:before{content:"\f0c3"}.fa-cut:before,.fa-scissors:before{content:"\f0c4"}.fa-copy:before,.fa-files-o:before{content:"\f0c5"}.fa-paperclip:before{content:"\f0c6"}.fa-save:before,.fa-floppy-o:before{content:"\f0c7"}.fa-square:before{content:"\f0c8"}.fa-navicon:before,.fa-reorder:before,.fa-bars:before{content:"\f0c9"}.fa-list-ul:before{content:"\f0ca"}.fa-list-ol:before{content:"\f0cb"}.fa-strikethrough:before{content:"\f0cc"}.fa-underline:before{content:"\f0cd"}.fa-table:before{content:"\f0ce"}.fa-magic:before{content:"\f0d0"}.fa-truck:before{content:"\f0d1"}.fa-pinterest:before{content:"\f0d2"}.fa-pinterest-square:before{content:"\f0d3"}.fa-google-plus-square:before{content:"\f0d4"}.fa-google-plus:before{content:"\f0d5"}.fa-money:before{content:"\f0d6"}.fa-caret-down:before{content:"\f0d7"}.fa-caret-up:before{content:"\f0d8"}.fa-caret-left:before{content:"\f0d9"}.fa-caret-right:before{content:"\f0da"}.fa-columns:before{content:"\f0db"}.fa-unsorted:before,.fa-sort:before{content:"\f0dc"}.fa-sort-down:before,.fa-sort-desc:before{content:"\f0dd"}.fa-sort-up:before,.fa-sort-asc:before{content:"\f0de"}.fa-envelope:before{content:"\f0e0"}.fa-linkedin:before{content:"\f0e1"}.fa-rotate-left:before,.fa-undo:before{content:"\f0e2"}.fa-legal:before,.fa-gavel:before{content:"\f0e3"}.fa-dashboard:before,.fa-tachometer:before{content:"\f0e4"}.fa-comment-o:before{content:"\f0e5"}.fa-comments-o:before{content:"\f0e6"}.fa-flash:before,.fa-bolt:before{content:"\f0e7"}.fa-sitemap:before{content:"\f0e8"}.fa-umbrella:before{content:"\f0e9"}.fa-paste:before,.fa-clipboard:before{content:"\f0ea"}.fa-lightbulb-o:before{content:"\f0eb"}.fa-exchange:before{content:"\f0ec"}.fa-cloud-download:before{content:"\f0ed"}.fa-cloud-upload:before{content:"\f0ee"}.fa-user-md:before{content:"\f0f0"}.fa-stethoscope:before{content:"\f0f1"}.fa-suitcase:before{content:"\f0f2"}.fa-bell-o:before{content:"\f0a2"}.fa-coffee:before{content:"\f0f4"}.fa-cutlery:before{content:"\f0f5"}.fa-file-text-o:before{content:"\f0f6"}.fa-building-o:before{content:"\f0f7"}.fa-hospital-o:before{content:"\f0f8"}.fa-ambulance:before{content:"\f0f9"}.fa-medkit:before{content:"\f0fa"}.fa-fighter-jet:before{content:"\f0fb"}.fa-beer:before{content:"\f0fc"}.fa-h-square:before{content:"\f0fd"}.fa-plus-square:before{content:"\f0fe"}.fa-angle-double-left:before{content:"\f100"}.fa-angle-double-right:before{content:"\f101"}.fa-angle-double-up:before{content:"\f102"}.fa-angle-double-down:before{content:"\f103"}.fa-angle-left:before{content:"\f104"}.fa-angle-right:before{content:"\f105"}.fa-angle-up:before{content:"\f106"}.fa-angle-down:before{content:"\f107"}.fa-desktop:before{content:"\f108"}.fa-laptop:before{content:"\f109"}.fa-tablet:before{content:"\f10a"}.fa-mobile-phone:before,.fa-mobile:before{content:"\f10b"}.fa-circle-o:before{content:"\f10c"}.fa-quote-left:before{content:"\f10d"}.fa-quote-right:before{content:"\f10e"}.fa-spinner:before{content:"\f110"}.fa-circle:before{content:"\f111"}.fa-mail-reply:before,.fa-reply:before{content:"\f112"}.fa-github-alt:before{content:"\f113"}.fa-folder-o:before{content:"\f114"}.fa-folder-open-o:before{content:"\f115"}.fa-smile-o:before{content:"\f118"}.fa-frown-o:before{content:"\f119"}.fa-meh-o:before{content:"\f11a"}.fa-gamepad:before{content:"\f11b"}.fa-keyboard-o:before{content:"\f11c"}.fa-flag-o:before{content:"\f11d"}.fa-flag-checkered:before{content:"\f11e"}.fa-terminal:before{content:"\f120"}.fa-code:before{content:"\f121"}.fa-mail-reply-all:before,.fa-reply-all:before{content:"\f122"}.fa-star-half-empty:before,.fa-star-half-full:before,.fa-star-half-o:before{content:"\f123"}.fa-location-arrow:before{content:"\f124"}.fa-crop:before{content:"\f125"}.fa-code-fork:before{content:"\f126"}.fa-unlink:before,.fa-chain-broken:before{content:"\f127"}.fa-question:before{content:"\f128"}.fa-info:before{content:"\f129"}.fa-exclamation:before{content:"\f12a"}.fa-superscript:before{content:"\f12b"}.fa-subscript:before{content:"\f12c"}.fa-eraser:before{content:"\f12d"}.fa-puzzle-piece:before{content:"\f12e"}.fa-microphone:before{content:"\f130"}.fa-microphone-slash:before{content:"\f131"}.fa-shield:before{content:"\f132"}.fa-calendar-o:before{content:"\f133"}.fa-fire-extinguisher:before{content:"\f134"}.fa-rocket:before{content:"\f135"}.fa-maxcdn:before{content:"\f136"}.fa-chevron-circle-left:before{content:"\f137"}.fa-chevron-circle-right:before{content:"\f138"}.fa-chevron-circle-up:before{content:"\f139"}.fa-chevron-circle-down:before{content:"\f13a"}.fa-html5:before{content:"\f13b"}.fa-css3:before{content:"\f13c"}.fa-anchor:before{content:"\f13d"}.fa-unlock-alt:before{content:"\f13e"}.fa-bullseye:before{content:"\f140"}.fa-ellipsis-h:before{content:"\f141"}.fa-ellipsis-v:before{content:"\f142"}.fa-rss-square:before{content:"\f143"}.fa-play-circle:before{content:"\f144"}.fa-ticket:before{content:"\f145"}.fa-minus-square:before{content:"\f146"}.fa-minus-square-o:before{content:"\f147"}.fa-level-up:before{content:"\f148"}.fa-level-down:before{content:"\f149"}.fa-check-square:before{content:"\f14a"}.fa-pencil-square:before{content:"\f14b"}.fa-external-link-square:before{content:"\f14c"}.fa-share-square:before{content:"\f14d"}.fa-compass:before{content:"\f14e"}.fa-toggle-down:before,.fa-caret-square-o-down:before{content:"\f150"}.fa-toggle-up:before,.fa-caret-square-o-up:before{content:"\f151"}.fa-toggle-right:before,.fa-caret-square-o-right:before{content:"\f152"}.fa-euro:before,.fa-eur:before{content:"\f153"}.fa-gbp:before{content:"\f154"}.fa-dollar:before,.fa-usd:before{content:"\f155"}.fa-rupee:before,.fa-inr:before{content:"\f156"}.fa-cny:before,.fa-rmb:before,.fa-yen:before,.fa-jpy:before{content:"\f157"}.fa-ruble:before,.fa-rouble:before,.fa-rub:before{content:"\f158"}.fa-won:before,.fa-krw:before{content:"\f159"}.fa-bitcoin:before,.fa-btc:before{content:"\f15a"}.fa-file:before{content:"\f15b"}.fa-file-text:before{content:"\f15c"}.fa-sort-alpha-asc:before{content:"\f15d"}.fa-sort-alpha-desc:before{content:"\f15e"}.fa-sort-amount-asc:before{content:"\f160"}.fa-sort-amount-desc:before{content:"\f161"}.fa-sort-numeric-asc:before{content:"\f162"}.fa-sort-numeric-desc:before{content:"\f163"}.fa-thumbs-up:before{content:"\f164"}.fa-thumbs-down:before{content:"\f165"}.fa-youtube-square:before{content:"\f166"}.fa-youtube:before{content:"\f167"}.fa-xing:before{content:"\f168"}.fa-xing-square:before{content:"\f169"}.fa-youtube-play:before{content:"\f16a"}.fa-dropbox:before{content:"\f16b"}.fa-stack-overflow:before{content:"\f16c"}.fa-instagram:before{content:"\f16d"}.fa-flickr:before{content:"\f16e"}.fa-adn:before{content:"\f170"}.fa-bitbucket:before{content:"\f171"}.fa-bitbucket-square:before{content:"\f172"}.fa-tumblr:before{content:"\f173"}.fa-tumblr-square:before{content:"\f174"}.fa-long-arrow-down:before{content:"\f175"}.fa-long-arrow-up:before{content:"\f176"}.fa-long-arrow-left:before{content:"\f177"}.fa-long-arrow-right:before{content:"\f178"}.fa-apple:before{content:"\f179"}.fa-windows:before{content:"\f17a"}.fa-android:before{content:"\f17b"}.fa-linux:before{content:"\f17c"}.fa-dribbble:before{content:"\f17d"}.fa-skype:before{content:"\f17e"}.fa-foursquare:before{content:"\f180"}.fa-trello:before{content:"\f181"}.fa-female:before{content:"\f182"}.fa-male:before{content:"\f183"}.fa-gittip:before,.fa-gratipay:before{content:"\f184"}.fa-sun-o:before{content:"\f185"}.fa-moon-o:before{content:"\f186"}.fa-archive:before{content:"\f187"}.fa-bug:before{content:"\f188"}.fa-vk:before{content:"\f189"}.fa-weibo:before{content:"\f18a"}.fa-renren:before{content:"\f18b"}.fa-pagelines:before{content:"\f18c"}.fa-stack-exchange:before{content:"\f18d"}.fa-arrow-circle-o-right:before{content:"\f18e"}.fa-arrow-circle-o-left:before{content:"\f190"}.fa-toggle-left:before,.fa-caret-square-o-left:before{content:"\f191"}.fa-dot-circle-o:before{content:"\f192"}.fa-wheelchair:before{content:"\f193"}.fa-vimeo-square:before{content:"\f194"}.fa-turkish-lira:before,.fa-try:before{content:"\f195"}.fa-plus-square-o:before{content:"\f196"}.fa-space-shuttle:before{content:"\f197"}.fa-slack:before{content:"\f198"}.fa-envelope-square:before{content:"\f199"}.fa-wordpress:before{content:"\f19a"}.fa-openid:before{content:"\f19b"}.fa-institution:before,.fa-bank:before,.fa-university:before{content:"\f19c"}.fa-mortar-board:before,.fa-graduation-cap:before{content:"\f19d"}.fa-yahoo:before{content:"\f19e"}.fa-google:before{content:"\f1a0"}.fa-reddit:before{content:"\f1a1"}.fa-reddit-square:before{content:"\f1a2"}.fa-stumbleupon-circle:before{content:"\f1a3"}.fa-stumbleupon:before{content:"\f1a4"}.fa-delicious:before{content:"\f1a5"}.fa-digg:before{content:"\f1a6"}.fa-pied-piper:before{content:"\f1a7"}.fa-pied-piper-alt:before{content:"\f1a8"}.fa-drupal:before{content:"\f1a9"}.fa-joomla:before{content:"\f1aa"}.fa-language:before{content:"\f1ab"}.fa-fax:before{content:"\f1ac"}.fa-building:before{content:"\f1ad"}.fa-child:before{content:"\f1ae"}.fa-paw:before{content:"\f1b0"}.fa-spoon:before{content:"\f1b1"}.fa-cube:before{content:"\f1b2"}.fa-cubes:before{content:"\f1b3"}.fa-behance:before{content:"\f1b4"}.fa-behance-square:before{content:"\f1b5"}.fa-steam:before{content:"\f1b6"}.fa-steam-square:before{content:"\f1b7"}.fa-recycle:before{content:"\f1b8"}.fa-automobile:before,.fa-car:before{content:"\f1b9"}.fa-cab:before,.fa-taxi:before{content:"\f1ba"}.fa-tree:before{content:"\f1bb"}.fa-spotify:before{content:"\f1bc"}.fa-deviantart:before{content:"\f1bd"}.fa-soundcloud:before{content:"\f1be"}.fa-database:before{content:"\f1c0"}.fa-file-pdf-o:before{content:"\f1c1"}.fa-file-word-o:before{content:"\f1c2"}.fa-file-excel-o:before{content:"\f1c3"}.fa-file-powerpoint-o:before{content:"\f1c4"}.fa-file-photo-o:before,.fa-file-picture-o:before,.fa-file-image-o:before{content:"\f1c5"}.fa-file-zip-o:before,.fa-file-archive-o:before{content:"\f1c6"}.fa-file-sound-o:before,.fa-file-audio-o:before{content:"\f1c7"}.fa-file-movie-o:before,.fa-file-video-o:before{content:"\f1c8"}.fa-file-code-o:before{content:"\f1c9"}.fa-vine:before{content:"\f1ca"}.fa-codepen:before{content:"\f1cb"}.fa-jsfiddle:before{content:"\f1cc"}.fa-life-bouy:before,.fa-life-buoy:before,.fa-life-saver:before,.fa-support:before,.fa-life-ring:before{content:"\f1cd"}.fa-circle-o-notch:before{content:"\f1ce"}.fa-ra:before,.fa-rebel:before{content:"\f1d0"}.fa-ge:before,.fa-empire:before{content:"\f1d1"}.fa-git-square:before{content:"\f1d2"}.fa-git:before{content:"\f1d3"}.fa-hacker-news:before{content:"\f1d4"}.fa-tencent-weibo:before{content:"\f1d5"}.fa-qq:before{content:"\f1d6"}.fa-wechat:before,.fa-weixin:before{content:"\f1d7"}.fa-send:before,.fa-paper-plane:before{content:"\f1d8"}.fa-send-o:before,.fa-paper-plane-o:before{content:"\f1d9"}.fa-history:before{content:"\f1da"}.fa-genderless:before,.fa-circle-thin:before{content:"\f1db"}.fa-header:before{content:"\f1dc"}.fa-paragraph:before{content:"\f1dd"}.fa-sliders:before{content:"\f1de"}.fa-share-alt:before{content:"\f1e0"}.fa-share-alt-square:before{content:"\f1e1"}.fa-bomb:before{content:"\f1e2"}.fa-soccer-ball-o:before,.fa-futbol-o:before{content:"\f1e3"}.fa-tty:before{content:"\f1e4"}.fa-binoculars:before{content:"\f1e5"}.fa-plug:before{content:"\f1e6"}.fa-slideshare:before{content:"\f1e7"}.fa-twitch:before{content:"\f1e8"}.fa-yelp:before{content:"\f1e9"}.fa-newspaper-o:before{content:"\f1ea"}.fa-wifi:before{content:"\f1eb"}.fa-calculator:before{content:"\f1ec"}.fa-paypal:before{content:"\f1ed"}.fa-google-wallet:before{content:"\f1ee"}.fa-cc-visa:before{content:"\f1f0"}.fa-cc-mastercard:before{content:"\f1f1"}.fa-cc-discover:before{content:"\f1f2"}.fa-cc-amex:before{content:"\f1f3"}.fa-cc-paypal:before{content:"\f1f4"}.fa-cc-stripe:before{content:"\f1f5"}.fa-bell-slash:before{content:"\f1f6"}.fa-bell-slash-o:before{content:"\f1f7"}.fa-trash:before{content:"\f1f8"}.fa-copyright:before{content:"\f1f9"}.fa-at:before{content:"\f1fa"}.fa-eyedropper:before{content:"\f1fb"}.fa-paint-brush:before{content:"\f1fc"}.fa-birthday-cake:before{content:"\f1fd"}.fa-area-chart:before{content:"\f1fe"}.fa-pie-chart:before{content:"\f200"}.fa-line-chart:before{content:"\f201"}.fa-lastfm:before{content:"\f202"}.fa-lastfm-square:before{content:"\f203"}.fa-toggle-off:before{content:"\f204"}.fa-toggle-on:before{content:"\f205"}.fa-bicycle:before{content:"\f206"}.fa-bus:before{content:"\f207"}.fa-ioxhost:before{content:"\f208"}.fa-angellist:before{content:"\f209"}.fa-cc:before{content:"\f20a"}.fa-shekel:before,.fa-sheqel:before,.fa-ils:before{content:"\f20b"}.fa-meanpath:before{content:"\f20c"}.fa-buysellads:before{content:"\f20d"}.fa-connectdevelop:before{content:"\f20e"}.fa-dashcube:before{content:"\f210"}.fa-forumbee:before{content:"\f211"}.fa-leanpub:before{content:"\f212"}.fa-sellsy:before{content:"\f213"}.fa-shirtsinbulk:before{content:"\f214"}.fa-simplybuilt:before{content:"\f215"}.fa-skyatlas:before{content:"\f216"}.fa-cart-plus:before{content:"\f217"}.fa-cart-arrow-down:before{content:"\f218"}.fa-diamond:before{content:"\f219"}.fa-ship:before{content:"\f21a"}.fa-user-secret:before{content:"\f21b"}.fa-motorcycle:before{content:"\f21c"}.fa-street-view:before{content:"\f21d"}.fa-heartbeat:before{content:"\f21e"}.fa-venus:before{content:"\f221"}.fa-mars:before{content:"\f222"}.fa-mercury:before{content:"\f223"}.fa-transgender:before{content:"\f224"}.fa-transgender-alt:before{content:"\f225"}.fa-venus-double:before{content:"\f226"}.fa-mars-double:before{content:"\f227"}.fa-venus-mars:before{content:"\f228"}.fa-mars-stroke:before{content:"\f229"}.fa-mars-stroke-v:before{content:"\f22a"}.fa-mars-stroke-h:before{content:"\f22b"}.fa-neuter:before{content:"\f22c"}.fa-facebook-official:before{content:"\f230"}.fa-pinterest-p:before{content:"\f231"}.fa-whatsapp:before{content:"\f232"}.fa-server:before{content:"\f233"}.fa-user-plus:before{content:"\f234"}.fa-user-times:before{content:"\f235"}.fa-hotel:before,.fa-bed:before{content:"\f236"}.fa-viacoin:before{content:"\f237"}.fa-train:before{content:"\f238"}.fa-subway:before{content:"\f239"}.fa-medium:before{content:"\f23a"} \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/static/fontawesome/font-awesome.min.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/static/fontawesome/font-awesome.min.css new file mode 100644 index 0000000000000000000000000000000000000000..b34d29d5c254cdae50a26f241c12260d7b88415e --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/static/fontawesome/font-awesome.min.css @@ -0,0 +1,4 @@ +/*! + * Font Awesome 4.3.0 by @davegandy - http://fontawesome.io - @fontawesome + * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) + */@font-face{font-family:'FontAwesome';src:url('../fonts/fontawesome-webfont.eot?v=4.3.0');src:url('../fonts/fontawesome-webfont.eot?#iefix&v=4.3.0') format('embedded-opentype'),url('../fonts/fontawesome-webfont.woff2?v=4.3.0') format('woff2'),url('../fonts/fontawesome-webfont.woff?v=4.3.0') format('woff'),url('../fonts/fontawesome-webfont.ttf?v=4.3.0') format('truetype'),url('../fonts/fontawesome-webfont.svg?v=4.3.0#fontawesomeregular') format('svg');font-weight:normal;font-style:normal}.fa{display:inline-block;font:normal normal normal 14px/1 FontAwesome;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;transform:translate(0,0)}.fa-lg{font-size:1.33333333em;line-height:.75em;vertical-align:-15%}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-fw{width:1.28571429em;text-align:center}.fa-ul{padding-left:0;margin-left:2.14285714em;list-style-type:none}.fa-ul>li{position:relative}.fa-li{position:absolute;left:-2.14285714em;width:2.14285714em;top:.14285714em;text-align:center}.fa-li.fa-lg{left:-1.85714286em}.fa-border{padding:.2em .25em .15em;border:solid .08em #eee;border-radius:.1em}.pull-right{float:right}.pull-left{float:left}.fa.pull-left{margin-right:.3em}.fa.pull-right{margin-left:.3em}.fa-spin{-webkit-animation:fa-spin 2s infinite linear;animation:fa-spin 2s infinite linear}.fa-pulse{-webkit-animation:fa-spin 1s infinite steps(8);animation:fa-spin 1s infinite steps(8)}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.fa-rotate-90{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=1);-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2);-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=3);-webkit-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=0,mirror=1);-webkit-transform:scale(-1,1);-ms-transform:scale(-1,1);transform:scale(-1,1)}.fa-flip-vertical{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2,mirror=1);-webkit-transform:scale(1,-1);-ms-transform:scale(1,-1);transform:scale(1,-1)}:root .fa-rotate-90,:root .fa-rotate-180,:root .fa-rotate-270,:root .fa-flip-horizontal,:root .fa-flip-vertical{filter:none}.fa-stack{position:relative;display:inline-block;width:2em;height:2em;line-height:2em;vertical-align:middle}.fa-stack-1x,.fa-stack-2x{position:absolute;left:0;width:100%;text-align:center}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-glass:before{content:"\f000"}.fa-music:before{content:"\f001"}.fa-search:before{content:"\f002"}.fa-envelope-o:before{content:"\f003"}.fa-heart:before{content:"\f004"}.fa-star:before{content:"\f005"}.fa-star-o:before{content:"\f006"}.fa-user:before{content:"\f007"}.fa-film:before{content:"\f008"}.fa-th-large:before{content:"\f009"}.fa-th:before{content:"\f00a"}.fa-th-list:before{content:"\f00b"}.fa-check:before{content:"\f00c"}.fa-remove:before,.fa-close:before,.fa-times:before{content:"\f00d"}.fa-search-plus:before{content:"\f00e"}.fa-search-minus:before{content:"\f010"}.fa-power-off:before{content:"\f011"}.fa-signal:before{content:"\f012"}.fa-gear:before,.fa-cog:before{content:"\f013"}.fa-trash-o:before{content:"\f014"}.fa-home:before{content:"\f015"}.fa-file-o:before{content:"\f016"}.fa-clock-o:before{content:"\f017"}.fa-road:before{content:"\f018"}.fa-download:before{content:"\f019"}.fa-arrow-circle-o-down:before{content:"\f01a"}.fa-arrow-circle-o-up:before{content:"\f01b"}.fa-inbox:before{content:"\f01c"}.fa-play-circle-o:before{content:"\f01d"}.fa-rotate-right:before,.fa-repeat:before{content:"\f01e"}.fa-refresh:before{content:"\f021"}.fa-list-alt:before{content:"\f022"}.fa-lock:before{content:"\f023"}.fa-flag:before{content:"\f024"}.fa-headphones:before{content:"\f025"}.fa-volume-off:before{content:"\f026"}.fa-volume-down:before{content:"\f027"}.fa-volume-up:before{content:"\f028"}.fa-qrcode:before{content:"\f029"}.fa-barcode:before{content:"\f02a"}.fa-tag:before{content:"\f02b"}.fa-tags:before{content:"\f02c"}.fa-book:before{content:"\f02d"}.fa-bookmark:before{content:"\f02e"}.fa-print:before{content:"\f02f"}.fa-camera:before{content:"\f030"}.fa-font:before{content:"\f031"}.fa-bold:before{content:"\f032"}.fa-italic:before{content:"\f033"}.fa-text-height:before{content:"\f034"}.fa-text-width:before{content:"\f035"}.fa-align-left:before{content:"\f036"}.fa-align-center:before{content:"\f037"}.fa-align-right:before{content:"\f038"}.fa-align-justify:before{content:"\f039"}.fa-list:before{content:"\f03a"}.fa-dedent:before,.fa-outdent:before{content:"\f03b"}.fa-indent:before{content:"\f03c"}.fa-video-camera:before{content:"\f03d"}.fa-photo:before,.fa-image:before,.fa-picture-o:before{content:"\f03e"}.fa-pencil:before{content:"\f040"}.fa-map-marker:before{content:"\f041"}.fa-adjust:before{content:"\f042"}.fa-tint:before{content:"\f043"}.fa-edit:before,.fa-pencil-square-o:before{content:"\f044"}.fa-share-square-o:before{content:"\f045"}.fa-check-square-o:before{content:"\f046"}.fa-arrows:before{content:"\f047"}.fa-step-backward:before{content:"\f048"}.fa-fast-backward:before{content:"\f049"}.fa-backward:before{content:"\f04a"}.fa-play:before{content:"\f04b"}.fa-pause:before{content:"\f04c"}.fa-stop:before{content:"\f04d"}.fa-forward:before{content:"\f04e"}.fa-fast-forward:before{content:"\f050"}.fa-step-forward:before{content:"\f051"}.fa-eject:before{content:"\f052"}.fa-chevron-left:before{content:"\f053"}.fa-chevron-right:before{content:"\f054"}.fa-plus-circle:before{content:"\f055"}.fa-minus-circle:before{content:"\f056"}.fa-times-circle:before{content:"\f057"}.fa-check-circle:before{content:"\f058"}.fa-question-circle:before{content:"\f059"}.fa-info-circle:before{content:"\f05a"}.fa-crosshairs:before{content:"\f05b"}.fa-times-circle-o:before{content:"\f05c"}.fa-check-circle-o:before{content:"\f05d"}.fa-ban:before{content:"\f05e"}.fa-arrow-left:before{content:"\f060"}.fa-arrow-right:before{content:"\f061"}.fa-arrow-up:before{content:"\f062"}.fa-arrow-down:before{content:"\f063"}.fa-mail-forward:before,.fa-share:before{content:"\f064"}.fa-expand:before{content:"\f065"}.fa-compress:before{content:"\f066"}.fa-plus:before{content:"\f067"}.fa-minus:before{content:"\f068"}.fa-asterisk:before{content:"\f069"}.fa-exclamation-circle:before{content:"\f06a"}.fa-gift:before{content:"\f06b"}.fa-leaf:before{content:"\f06c"}.fa-fire:before{content:"\f06d"}.fa-eye:before{content:"\f06e"}.fa-eye-slash:before{content:"\f070"}.fa-warning:before,.fa-exclamation-triangle:before{content:"\f071"}.fa-plane:before{content:"\f072"}.fa-calendar:before{content:"\f073"}.fa-random:before{content:"\f074"}.fa-comment:before{content:"\f075"}.fa-magnet:before{content:"\f076"}.fa-chevron-up:before{content:"\f077"}.fa-chevron-down:before{content:"\f078"}.fa-retweet:before{content:"\f079"}.fa-shopping-cart:before{content:"\f07a"}.fa-folder:before{content:"\f07b"}.fa-folder-open:before{content:"\f07c"}.fa-arrows-v:before{content:"\f07d"}.fa-arrows-h:before{content:"\f07e"}.fa-bar-chart-o:before,.fa-bar-chart:before{content:"\f080"}.fa-twitter-square:before{content:"\f081"}.fa-facebook-square:before{content:"\f082"}.fa-camera-retro:before{content:"\f083"}.fa-key:before{content:"\f084"}.fa-gears:before,.fa-cogs:before{content:"\f085"}.fa-comments:before{content:"\f086"}.fa-thumbs-o-up:before{content:"\f087"}.fa-thumbs-o-down:before{content:"\f088"}.fa-star-half:before{content:"\f089"}.fa-heart-o:before{content:"\f08a"}.fa-sign-out:before{content:"\f08b"}.fa-linkedin-square:before{content:"\f08c"}.fa-thumb-tack:before{content:"\f08d"}.fa-external-link:before{content:"\f08e"}.fa-sign-in:before{content:"\f090"}.fa-trophy:before{content:"\f091"}.fa-github-square:before{content:"\f092"}.fa-upload:before{content:"\f093"}.fa-lemon-o:before{content:"\f094"}.fa-phone:before{content:"\f095"}.fa-square-o:before{content:"\f096"}.fa-bookmark-o:before{content:"\f097"}.fa-phone-square:before{content:"\f098"}.fa-twitter:before{content:"\f099"}.fa-facebook-f:before,.fa-facebook:before{content:"\f09a"}.fa-github:before{content:"\f09b"}.fa-unlock:before{content:"\f09c"}.fa-credit-card:before{content:"\f09d"}.fa-rss:before{content:"\f09e"}.fa-hdd-o:before{content:"\f0a0"}.fa-bullhorn:before{content:"\f0a1"}.fa-bell:before{content:"\f0f3"}.fa-certificate:before{content:"\f0a3"}.fa-hand-o-right:before{content:"\f0a4"}.fa-hand-o-left:before{content:"\f0a5"}.fa-hand-o-up:before{content:"\f0a6"}.fa-hand-o-down:before{content:"\f0a7"}.fa-arrow-circle-left:before{content:"\f0a8"}.fa-arrow-circle-right:before{content:"\f0a9"}.fa-arrow-circle-up:before{content:"\f0aa"}.fa-arrow-circle-down:before{content:"\f0ab"}.fa-globe:before{content:"\f0ac"}.fa-wrench:before{content:"\f0ad"}.fa-tasks:before{content:"\f0ae"}.fa-filter:before{content:"\f0b0"}.fa-briefcase:before{content:"\f0b1"}.fa-arrows-alt:before{content:"\f0b2"}.fa-group:before,.fa-users:before{content:"\f0c0"}.fa-chain:before,.fa-link:before{content:"\f0c1"}.fa-cloud:before{content:"\f0c2"}.fa-flask:before{content:"\f0c3"}.fa-cut:before,.fa-scissors:before{content:"\f0c4"}.fa-copy:before,.fa-files-o:before{content:"\f0c5"}.fa-paperclip:before{content:"\f0c6"}.fa-save:before,.fa-floppy-o:before{content:"\f0c7"}.fa-square:before{content:"\f0c8"}.fa-navicon:before,.fa-reorder:before,.fa-bars:before{content:"\f0c9"}.fa-list-ul:before{content:"\f0ca"}.fa-list-ol:before{content:"\f0cb"}.fa-strikethrough:before{content:"\f0cc"}.fa-underline:before{content:"\f0cd"}.fa-table:before{content:"\f0ce"}.fa-magic:before{content:"\f0d0"}.fa-truck:before{content:"\f0d1"}.fa-pinterest:before{content:"\f0d2"}.fa-pinterest-square:before{content:"\f0d3"}.fa-google-plus-square:before{content:"\f0d4"}.fa-google-plus:before{content:"\f0d5"}.fa-money:before{content:"\f0d6"}.fa-caret-down:before{content:"\f0d7"}.fa-caret-up:before{content:"\f0d8"}.fa-caret-left:before{content:"\f0d9"}.fa-caret-right:before{content:"\f0da"}.fa-columns:before{content:"\f0db"}.fa-unsorted:before,.fa-sort:before{content:"\f0dc"}.fa-sort-down:before,.fa-sort-desc:before{content:"\f0dd"}.fa-sort-up:before,.fa-sort-asc:before{content:"\f0de"}.fa-envelope:before{content:"\f0e0"}.fa-linkedin:before{content:"\f0e1"}.fa-rotate-left:before,.fa-undo:before{content:"\f0e2"}.fa-legal:before,.fa-gavel:before{content:"\f0e3"}.fa-dashboard:before,.fa-tachometer:before{content:"\f0e4"}.fa-comment-o:before{content:"\f0e5"}.fa-comments-o:before{content:"\f0e6"}.fa-flash:before,.fa-bolt:before{content:"\f0e7"}.fa-sitemap:before{content:"\f0e8"}.fa-umbrella:before{content:"\f0e9"}.fa-paste:before,.fa-clipboard:before{content:"\f0ea"}.fa-lightbulb-o:before{content:"\f0eb"}.fa-exchange:before{content:"\f0ec"}.fa-cloud-download:before{content:"\f0ed"}.fa-cloud-upload:before{content:"\f0ee"}.fa-user-md:before{content:"\f0f0"}.fa-stethoscope:before{content:"\f0f1"}.fa-suitcase:before{content:"\f0f2"}.fa-bell-o:before{content:"\f0a2"}.fa-coffee:before{content:"\f0f4"}.fa-cutlery:before{content:"\f0f5"}.fa-file-text-o:before{content:"\f0f6"}.fa-building-o:before{content:"\f0f7"}.fa-hospital-o:before{content:"\f0f8"}.fa-ambulance:before{content:"\f0f9"}.fa-medkit:before{content:"\f0fa"}.fa-fighter-jet:before{content:"\f0fb"}.fa-beer:before{content:"\f0fc"}.fa-h-square:before{content:"\f0fd"}.fa-plus-square:before{content:"\f0fe"}.fa-angle-double-left:before{content:"\f100"}.fa-angle-double-right:before{content:"\f101"}.fa-angle-double-up:before{content:"\f102"}.fa-angle-double-down:before{content:"\f103"}.fa-angle-left:before{content:"\f104"}.fa-angle-right:before{content:"\f105"}.fa-angle-up:before{content:"\f106"}.fa-angle-down:before{content:"\f107"}.fa-desktop:before{content:"\f108"}.fa-laptop:before{content:"\f109"}.fa-tablet:before{content:"\f10a"}.fa-mobile-phone:before,.fa-mobile:before{content:"\f10b"}.fa-circle-o:before{content:"\f10c"}.fa-quote-left:before{content:"\f10d"}.fa-quote-right:before{content:"\f10e"}.fa-spinner:before{content:"\f110"}.fa-circle:before{content:"\f111"}.fa-mail-reply:before,.fa-reply:before{content:"\f112"}.fa-github-alt:before{content:"\f113"}.fa-folder-o:before{content:"\f114"}.fa-folder-open-o:before{content:"\f115"}.fa-smile-o:before{content:"\f118"}.fa-frown-o:before{content:"\f119"}.fa-meh-o:before{content:"\f11a"}.fa-gamepad:before{content:"\f11b"}.fa-keyboard-o:before{content:"\f11c"}.fa-flag-o:before{content:"\f11d"}.fa-flag-checkered:before{content:"\f11e"}.fa-terminal:before{content:"\f120"}.fa-code:before{content:"\f121"}.fa-mail-reply-all:before,.fa-reply-all:before{content:"\f122"}.fa-star-half-empty:before,.fa-star-half-full:before,.fa-star-half-o:before{content:"\f123"}.fa-location-arrow:before{content:"\f124"}.fa-crop:before{content:"\f125"}.fa-code-fork:before{content:"\f126"}.fa-unlink:before,.fa-chain-broken:before{content:"\f127"}.fa-question:before{content:"\f128"}.fa-info:before{content:"\f129"}.fa-exclamation:before{content:"\f12a"}.fa-superscript:before{content:"\f12b"}.fa-subscript:before{content:"\f12c"}.fa-eraser:before{content:"\f12d"}.fa-puzzle-piece:before{content:"\f12e"}.fa-microphone:before{content:"\f130"}.fa-microphone-slash:before{content:"\f131"}.fa-shield:before{content:"\f132"}.fa-calendar-o:before{content:"\f133"}.fa-fire-extinguisher:before{content:"\f134"}.fa-rocket:before{content:"\f135"}.fa-maxcdn:before{content:"\f136"}.fa-chevron-circle-left:before{content:"\f137"}.fa-chevron-circle-right:before{content:"\f138"}.fa-chevron-circle-up:before{content:"\f139"}.fa-chevron-circle-down:before{content:"\f13a"}.fa-html5:before{content:"\f13b"}.fa-css3:before{content:"\f13c"}.fa-anchor:before{content:"\f13d"}.fa-unlock-alt:before{content:"\f13e"}.fa-bullseye:before{content:"\f140"}.fa-ellipsis-h:before{content:"\f141"}.fa-ellipsis-v:before{content:"\f142"}.fa-rss-square:before{content:"\f143"}.fa-play-circle:before{content:"\f144"}.fa-ticket:before{content:"\f145"}.fa-minus-square:before{content:"\f146"}.fa-minus-square-o:before{content:"\f147"}.fa-level-up:before{content:"\f148"}.fa-level-down:before{content:"\f149"}.fa-check-square:before{content:"\f14a"}.fa-pencil-square:before{content:"\f14b"}.fa-external-link-square:before{content:"\f14c"}.fa-share-square:before{content:"\f14d"}.fa-compass:before{content:"\f14e"}.fa-toggle-down:before,.fa-caret-square-o-down:before{content:"\f150"}.fa-toggle-up:before,.fa-caret-square-o-up:before{content:"\f151"}.fa-toggle-right:before,.fa-caret-square-o-right:before{content:"\f152"}.fa-euro:before,.fa-eur:before{content:"\f153"}.fa-gbp:before{content:"\f154"}.fa-dollar:before,.fa-usd:before{content:"\f155"}.fa-rupee:before,.fa-inr:before{content:"\f156"}.fa-cny:before,.fa-rmb:before,.fa-yen:before,.fa-jpy:before{content:"\f157"}.fa-ruble:before,.fa-rouble:before,.fa-rub:before{content:"\f158"}.fa-won:before,.fa-krw:before{content:"\f159"}.fa-bitcoin:before,.fa-btc:before{content:"\f15a"}.fa-file:before{content:"\f15b"}.fa-file-text:before{content:"\f15c"}.fa-sort-alpha-asc:before{content:"\f15d"}.fa-sort-alpha-desc:before{content:"\f15e"}.fa-sort-amount-asc:before{content:"\f160"}.fa-sort-amount-desc:before{content:"\f161"}.fa-sort-numeric-asc:before{content:"\f162"}.fa-sort-numeric-desc:before{content:"\f163"}.fa-thumbs-up:before{content:"\f164"}.fa-thumbs-down:before{content:"\f165"}.fa-youtube-square:before{content:"\f166"}.fa-youtube:before{content:"\f167"}.fa-xing:before{content:"\f168"}.fa-xing-square:before{content:"\f169"}.fa-youtube-play:before{content:"\f16a"}.fa-dropbox:before{content:"\f16b"}.fa-stack-overflow:before{content:"\f16c"}.fa-instagram:before{content:"\f16d"}.fa-flickr:before{content:"\f16e"}.fa-adn:before{content:"\f170"}.fa-bitbucket:before{content:"\f171"}.fa-bitbucket-square:before{content:"\f172"}.fa-tumblr:before{content:"\f173"}.fa-tumblr-square:before{content:"\f174"}.fa-long-arrow-down:before{content:"\f175"}.fa-long-arrow-up:before{content:"\f176"}.fa-long-arrow-left:before{content:"\f177"}.fa-long-arrow-right:before{content:"\f178"}.fa-apple:before{content:"\f179"}.fa-windows:before{content:"\f17a"}.fa-android:before{content:"\f17b"}.fa-linux:before{content:"\f17c"}.fa-dribbble:before{content:"\f17d"}.fa-skype:before{content:"\f17e"}.fa-foursquare:before{content:"\f180"}.fa-trello:before{content:"\f181"}.fa-female:before{content:"\f182"}.fa-male:before{content:"\f183"}.fa-gittip:before,.fa-gratipay:before{content:"\f184"}.fa-sun-o:before{content:"\f185"}.fa-moon-o:before{content:"\f186"}.fa-archive:before{content:"\f187"}.fa-bug:before{content:"\f188"}.fa-vk:before{content:"\f189"}.fa-weibo:before{content:"\f18a"}.fa-renren:before{content:"\f18b"}.fa-pagelines:before{content:"\f18c"}.fa-stack-exchange:before{content:"\f18d"}.fa-arrow-circle-o-right:before{content:"\f18e"}.fa-arrow-circle-o-left:before{content:"\f190"}.fa-toggle-left:before,.fa-caret-square-o-left:before{content:"\f191"}.fa-dot-circle-o:before{content:"\f192"}.fa-wheelchair:before{content:"\f193"}.fa-vimeo-square:before{content:"\f194"}.fa-turkish-lira:before,.fa-try:before{content:"\f195"}.fa-plus-square-o:before{content:"\f196"}.fa-space-shuttle:before{content:"\f197"}.fa-slack:before{content:"\f198"}.fa-envelope-square:before{content:"\f199"}.fa-wordpress:before{content:"\f19a"}.fa-openid:before{content:"\f19b"}.fa-institution:before,.fa-bank:before,.fa-university:before{content:"\f19c"}.fa-mortar-board:before,.fa-graduation-cap:before{content:"\f19d"}.fa-yahoo:before{content:"\f19e"}.fa-google:before{content:"\f1a0"}.fa-reddit:before{content:"\f1a1"}.fa-reddit-square:before{content:"\f1a2"}.fa-stumbleupon-circle:before{content:"\f1a3"}.fa-stumbleupon:before{content:"\f1a4"}.fa-delicious:before{content:"\f1a5"}.fa-digg:before{content:"\f1a6"}.fa-pied-piper:before{content:"\f1a7"}.fa-pied-piper-alt:before{content:"\f1a8"}.fa-drupal:before{content:"\f1a9"}.fa-joomla:before{content:"\f1aa"}.fa-language:before{content:"\f1ab"}.fa-fax:before{content:"\f1ac"}.fa-building:before{content:"\f1ad"}.fa-child:before{content:"\f1ae"}.fa-paw:before{content:"\f1b0"}.fa-spoon:before{content:"\f1b1"}.fa-cube:before{content:"\f1b2"}.fa-cubes:before{content:"\f1b3"}.fa-behance:before{content:"\f1b4"}.fa-behance-square:before{content:"\f1b5"}.fa-steam:before{content:"\f1b6"}.fa-steam-square:before{content:"\f1b7"}.fa-recycle:before{content:"\f1b8"}.fa-automobile:before,.fa-car:before{content:"\f1b9"}.fa-cab:before,.fa-taxi:before{content:"\f1ba"}.fa-tree:before{content:"\f1bb"}.fa-spotify:before{content:"\f1bc"}.fa-deviantart:before{content:"\f1bd"}.fa-soundcloud:before{content:"\f1be"}.fa-database:before{content:"\f1c0"}.fa-file-pdf-o:before{content:"\f1c1"}.fa-file-word-o:before{content:"\f1c2"}.fa-file-excel-o:before{content:"\f1c3"}.fa-file-powerpoint-o:before{content:"\f1c4"}.fa-file-photo-o:before,.fa-file-picture-o:before,.fa-file-image-o:before{content:"\f1c5"}.fa-file-zip-o:before,.fa-file-archive-o:before{content:"\f1c6"}.fa-file-sound-o:before,.fa-file-audio-o:before{content:"\f1c7"}.fa-file-movie-o:before,.fa-file-video-o:before{content:"\f1c8"}.fa-file-code-o:before{content:"\f1c9"}.fa-vine:before{content:"\f1ca"}.fa-codepen:before{content:"\f1cb"}.fa-jsfiddle:before{content:"\f1cc"}.fa-life-bouy:before,.fa-life-buoy:before,.fa-life-saver:before,.fa-support:before,.fa-life-ring:before{content:"\f1cd"}.fa-circle-o-notch:before{content:"\f1ce"}.fa-ra:before,.fa-rebel:before{content:"\f1d0"}.fa-ge:before,.fa-empire:before{content:"\f1d1"}.fa-git-square:before{content:"\f1d2"}.fa-git:before{content:"\f1d3"}.fa-hacker-news:before{content:"\f1d4"}.fa-tencent-weibo:before{content:"\f1d5"}.fa-qq:before{content:"\f1d6"}.fa-wechat:before,.fa-weixin:before{content:"\f1d7"}.fa-send:before,.fa-paper-plane:before{content:"\f1d8"}.fa-send-o:before,.fa-paper-plane-o:before{content:"\f1d9"}.fa-history:before{content:"\f1da"}.fa-genderless:before,.fa-circle-thin:before{content:"\f1db"}.fa-header:before{content:"\f1dc"}.fa-paragraph:before{content:"\f1dd"}.fa-sliders:before{content:"\f1de"}.fa-share-alt:before{content:"\f1e0"}.fa-share-alt-square:before{content:"\f1e1"}.fa-bomb:before{content:"\f1e2"}.fa-soccer-ball-o:before,.fa-futbol-o:before{content:"\f1e3"}.fa-tty:before{content:"\f1e4"}.fa-binoculars:before{content:"\f1e5"}.fa-plug:before{content:"\f1e6"}.fa-slideshare:before{content:"\f1e7"}.fa-twitch:before{content:"\f1e8"}.fa-yelp:before{content:"\f1e9"}.fa-newspaper-o:before{content:"\f1ea"}.fa-wifi:before{content:"\f1eb"}.fa-calculator:before{content:"\f1ec"}.fa-paypal:before{content:"\f1ed"}.fa-google-wallet:before{content:"\f1ee"}.fa-cc-visa:before{content:"\f1f0"}.fa-cc-mastercard:before{content:"\f1f1"}.fa-cc-discover:before{content:"\f1f2"}.fa-cc-amex:before{content:"\f1f3"}.fa-cc-paypal:before{content:"\f1f4"}.fa-cc-stripe:before{content:"\f1f5"}.fa-bell-slash:before{content:"\f1f6"}.fa-bell-slash-o:before{content:"\f1f7"}.fa-trash:before{content:"\f1f8"}.fa-copyright:before{content:"\f1f9"}.fa-at:before{content:"\f1fa"}.fa-eyedropper:before{content:"\f1fb"}.fa-paint-brush:before{content:"\f1fc"}.fa-birthday-cake:before{content:"\f1fd"}.fa-area-chart:before{content:"\f1fe"}.fa-pie-chart:before{content:"\f200"}.fa-line-chart:before{content:"\f201"}.fa-lastfm:before{content:"\f202"}.fa-lastfm-square:before{content:"\f203"}.fa-toggle-off:before{content:"\f204"}.fa-toggle-on:before{content:"\f205"}.fa-bicycle:before{content:"\f206"}.fa-bus:before{content:"\f207"}.fa-ioxhost:before{content:"\f208"}.fa-angellist:before{content:"\f209"}.fa-cc:before{content:"\f20a"}.fa-shekel:before,.fa-sheqel:before,.fa-ils:before{content:"\f20b"}.fa-meanpath:before{content:"\f20c"}.fa-buysellads:before{content:"\f20d"}.fa-connectdevelop:before{content:"\f20e"}.fa-dashcube:before{content:"\f210"}.fa-forumbee:before{content:"\f211"}.fa-leanpub:before{content:"\f212"}.fa-sellsy:before{content:"\f213"}.fa-shirtsinbulk:before{content:"\f214"}.fa-simplybuilt:before{content:"\f215"}.fa-skyatlas:before{content:"\f216"}.fa-cart-plus:before{content:"\f217"}.fa-cart-arrow-down:before{content:"\f218"}.fa-diamond:before{content:"\f219"}.fa-ship:before{content:"\f21a"}.fa-user-secret:before{content:"\f21b"}.fa-motorcycle:before{content:"\f21c"}.fa-street-view:before{content:"\f21d"}.fa-heartbeat:before{content:"\f21e"}.fa-venus:before{content:"\f221"}.fa-mars:before{content:"\f222"}.fa-mercury:before{content:"\f223"}.fa-transgender:before{content:"\f224"}.fa-transgender-alt:before{content:"\f225"}.fa-venus-double:before{content:"\f226"}.fa-mars-double:before{content:"\f227"}.fa-venus-mars:before{content:"\f228"}.fa-mars-stroke:before{content:"\f229"}.fa-mars-stroke-v:before{content:"\f22a"}.fa-mars-stroke-h:before{content:"\f22b"}.fa-neuter:before{content:"\f22c"}.fa-facebook-official:before{content:"\f230"}.fa-pinterest-p:before{content:"\f231"}.fa-whatsapp:before{content:"\f232"}.fa-server:before{content:"\f233"}.fa-user-plus:before{content:"\f234"}.fa-user-times:before{content:"\f235"}.fa-hotel:before,.fa-bed:before{content:"\f236"}.fa-viacoin:before{content:"\f237"}.fa-train:before{content:"\f238"}.fa-subway:before{content:"\f239"}.fa-medium:before{content:"\f23a"} \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/static/fonts/FontAwesome.otf b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/static/fonts/FontAwesome.otf index 8b0f54e47e1d356dcf1496942a50e228e0f1ee14..f7936cc1e789eea5438d576d6b12de20191da09d 100644 Binary files a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/static/fonts/FontAwesome.otf and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/static/fonts/FontAwesome.otf differ diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/static/fonts/fontawesome-webfont.eot b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/static/fonts/fontawesome-webfont.eot index 7c79c6a6bc9a128a2a8eaffbe49a4338625fdbc2..33b2bb80055cc480e797de704925acaba4ba7d7d 100755 Binary files a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/static/fonts/fontawesome-webfont.eot and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/static/fonts/fontawesome-webfont.eot differ diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/static/fonts/fontawesome-webfont.svg b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/static/fonts/fontawesome-webfont.svg index 45fdf33830123533459b17fbbf91735489fd6bd8..1ee89d4368d31a368817a842f14d53f7a64c3038 100755 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/static/fonts/fontawesome-webfont.svg +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/static/fonts/fontawesome-webfont.svg @@ -1,6 +1,6 @@ <?xml version="1.0" standalone="no"?> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" > -<svg xmlns="http://www.w3.org/2000/svg"> +<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1"> <metadata></metadata> <defs> <font id="fontawesomeregular" horiz-adv-x="1536" > @@ -14,10 +14,11 @@ <glyph unicode="®" horiz-adv-x="1792" /> <glyph unicode="´" horiz-adv-x="1792" /> <glyph unicode="Æ" horiz-adv-x="1792" /> +<glyph unicode="Ø" horiz-adv-x="1792" /> <glyph unicode=" " horiz-adv-x="768" /> -<glyph unicode=" " /> +<glyph unicode=" " horiz-adv-x="1537" /> <glyph unicode=" " horiz-adv-x="768" /> -<glyph unicode=" " /> +<glyph unicode=" " horiz-adv-x="1537" /> <glyph unicode=" " horiz-adv-x="512" /> <glyph unicode=" " horiz-adv-x="384" /> <glyph unicode=" " horiz-adv-x="256" /> @@ -30,7 +31,7 @@ <glyph unicode="™" horiz-adv-x="1792" /> <glyph unicode="∞" horiz-adv-x="1792" /> <glyph unicode="≠" horiz-adv-x="1792" /> -<glyph unicode="" horiz-adv-x="500" d="M0 0z" /> +<glyph unicode="◼" horiz-adv-x="500" d="M0 0z" /> <glyph unicode="" horiz-adv-x="1792" d="M1699 1350q0 -35 -43 -78l-632 -632v-768h320q26 0 45 -19t19 -45t-19 -45t-45 -19h-896q-26 0 -45 19t-19 45t19 45t45 19h320v768l-632 632q-43 43 -43 78q0 23 18 36.5t38 17.5t43 4h1408q23 0 43 -4t38 -17.5t18 -36.5z" /> <glyph unicode="" d="M1536 1312v-1120q0 -50 -34 -89t-86 -60.5t-103.5 -32t-96.5 -10.5t-96.5 10.5t-103.5 32t-86 60.5t-34 89t34 89t86 60.5t103.5 32t96.5 10.5q105 0 192 -39v537l-768 -237v-709q0 -50 -34 -89t-86 -60.5t-103.5 -32t-96.5 -10.5t-96.5 10.5t-103.5 32t-86 60.5t-34 89 t34 89t86 60.5t103.5 32t96.5 10.5q105 0 192 -39v967q0 31 19 56.5t49 35.5l832 256q12 4 28 4q40 0 68 -28t28 -68z" /> <glyph unicode="" horiz-adv-x="1664" d="M1152 704q0 185 -131.5 316.5t-316.5 131.5t-316.5 -131.5t-131.5 -316.5t131.5 -316.5t316.5 -131.5t316.5 131.5t131.5 316.5zM1664 -128q0 -52 -38 -90t-90 -38q-54 0 -90 38l-343 342q-179 -124 -399 -124q-143 0 -273.5 55.5t-225 150t-150 225t-55.5 273.5 t55.5 273.5t150 225t225 150t273.5 55.5t273.5 -55.5t225 -150t150 -225t55.5 -273.5q0 -220 -124 -399l343 -343q37 -37 37 -90z" /> @@ -52,7 +53,7 @@ <glyph unicode="" d="M1024 640q0 106 -75 181t-181 75t-181 -75t-75 -181t75 -181t181 -75t181 75t75 181zM1536 749v-222q0 -12 -8 -23t-20 -13l-185 -28q-19 -54 -39 -91q35 -50 107 -138q10 -12 10 -25t-9 -23q-27 -37 -99 -108t-94 -71q-12 0 -26 9l-138 108q-44 -23 -91 -38 q-16 -136 -29 -186q-7 -28 -36 -28h-222q-14 0 -24.5 8.5t-11.5 21.5l-28 184q-49 16 -90 37l-141 -107q-10 -9 -25 -9q-14 0 -25 11q-126 114 -165 168q-7 10 -7 23q0 12 8 23q15 21 51 66.5t54 70.5q-27 50 -41 99l-183 27q-13 2 -21 12.5t-8 23.5v222q0 12 8 23t19 13 l186 28q14 46 39 92q-40 57 -107 138q-10 12 -10 24q0 10 9 23q26 36 98.5 107.5t94.5 71.5q13 0 26 -10l138 -107q44 23 91 38q16 136 29 186q7 28 36 28h222q14 0 24.5 -8.5t11.5 -21.5l28 -184q49 -16 90 -37l142 107q9 9 24 9q13 0 25 -10q129 -119 165 -170q7 -8 7 -22 q0 -12 -8 -23q-15 -21 -51 -66.5t-54 -70.5q26 -50 41 -98l183 -28q13 -2 21 -12.5t8 -23.5z" /> <glyph unicode="" horiz-adv-x="1408" d="M512 800v-576q0 -14 -9 -23t-23 -9h-64q-14 0 -23 9t-9 23v576q0 14 9 23t23 9h64q14 0 23 -9t9 -23zM768 800v-576q0 -14 -9 -23t-23 -9h-64q-14 0 -23 9t-9 23v576q0 14 9 23t23 9h64q14 0 23 -9t9 -23zM1024 800v-576q0 -14 -9 -23t-23 -9h-64q-14 0 -23 9t-9 23v576 q0 14 9 23t23 9h64q14 0 23 -9t9 -23zM1152 76v948h-896v-948q0 -22 7 -40.5t14.5 -27t10.5 -8.5h832q3 0 10.5 8.5t14.5 27t7 40.5zM480 1152h448l-48 117q-7 9 -17 11h-317q-10 -2 -17 -11zM1408 1120v-64q0 -14 -9 -23t-23 -9h-96v-948q0 -83 -47 -143.5t-113 -60.5h-832 q-66 0 -113 58.5t-47 141.5v952h-96q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h309l70 167q15 37 54 63t79 26h320q40 0 79 -26t54 -63l70 -167h309q14 0 23 -9t9 -23z" /> <glyph unicode="" horiz-adv-x="1664" d="M1408 544v-480q0 -26 -19 -45t-45 -19h-384v384h-256v-384h-384q-26 0 -45 19t-19 45v480q0 1 0.5 3t0.5 3l575 474l575 -474q1 -2 1 -6zM1631 613l-62 -74q-8 -9 -21 -11h-3q-13 0 -21 7l-692 577l-692 -577q-12 -8 -24 -7q-13 2 -21 11l-62 74q-8 10 -7 23.5t11 21.5 l719 599q32 26 76 26t76 -26l244 -204v195q0 14 9 23t23 9h192q14 0 23 -9t9 -23v-408l219 -182q10 -8 11 -21.5t-7 -23.5z" /> -<glyph unicode="" horiz-adv-x="1280" d="M128 0h1024v768h-416q-40 0 -68 28t-28 68v416h-512v-1280zM768 896h376q-10 29 -22 41l-313 313q-12 12 -41 22v-376zM1280 864v-896q0 -40 -28 -68t-68 -28h-1088q-40 0 -68 28t-28 68v1344q0 40 28 68t68 28h640q40 0 88 -20t76 -48l312 -312q28 -28 48 -76t20 -88z " /> +<glyph unicode="" d="M1468 1156q28 -28 48 -76t20 -88v-1152q0 -40 -28 -68t-68 -28h-1344q-40 0 -68 28t-28 68v1600q0 40 28 68t68 28h896q40 0 88 -20t76 -48zM1024 1400v-376h376q-10 29 -22 41l-313 313q-12 12 -41 22zM1408 -128v1024h-416q-40 0 -68 28t-28 68v416h-768v-1536h1280z " /> <glyph unicode="" d="M896 992v-448q0 -14 -9 -23t-23 -9h-320q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h224v352q0 14 9 23t23 9h64q14 0 23 -9t9 -23zM1312 640q0 148 -73 273t-198 198t-273 73t-273 -73t-198 -198t-73 -273t73 -273t198 -198t273 -73t273 73t198 198t73 273zM1536 640 q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" /> <glyph unicode="" horiz-adv-x="1920" d="M1111 540v4l-24 320q-1 13 -11 22.5t-23 9.5h-186q-13 0 -23 -9.5t-11 -22.5l-24 -320v-4q-1 -12 8 -20t21 -8h244q12 0 21 8t8 20zM1870 73q0 -73 -46 -73h-704q13 0 22 9.5t8 22.5l-20 256q-1 13 -11 22.5t-23 9.5h-272q-13 0 -23 -9.5t-11 -22.5l-20 -256 q-1 -13 8 -22.5t22 -9.5h-704q-46 0 -46 73q0 54 26 116l417 1044q8 19 26 33t38 14h339q-13 0 -23 -9.5t-11 -22.5l-15 -192q-1 -14 8 -23t22 -9h166q13 0 22 9t8 23l-15 192q-1 13 -11 22.5t-23 9.5h339q20 0 38 -14t26 -33l417 -1044q26 -62 26 -116z" /> <glyph unicode="" horiz-adv-x="1664" d="M1280 192q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1536 192q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1664 416v-320q0 -40 -28 -68t-68 -28h-1472q-40 0 -68 28t-28 68v320q0 40 28 68t68 28h465l135 -136 q58 -56 136 -56t136 56l136 136h464q40 0 68 -28t28 -68zM1339 985q17 -41 -14 -70l-448 -448q-18 -19 -45 -19t-45 19l-448 448q-31 29 -14 70q17 39 59 39h256v448q0 26 19 45t45 19h256q26 0 45 -19t19 -45v-448h256q42 0 59 -39z" /> @@ -77,11 +78,11 @@ <glyph unicode="" horiz-adv-x="1280" d="M1164 1408q23 0 44 -9q33 -13 52.5 -41t19.5 -62v-1289q0 -34 -19.5 -62t-52.5 -41q-19 -8 -44 -8q-48 0 -83 32l-441 424l-441 -424q-36 -33 -83 -33q-23 0 -44 9q-33 13 -52.5 41t-19.5 62v1289q0 34 19.5 62t52.5 41q21 9 44 9h1048z" /> <glyph unicode="" horiz-adv-x="1664" d="M384 0h896v256h-896v-256zM384 640h896v384h-160q-40 0 -68 28t-28 68v160h-640v-640zM1536 576q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1664 576v-416q0 -13 -9.5 -22.5t-22.5 -9.5h-224v-160q0 -40 -28 -68t-68 -28h-960q-40 0 -68 28t-28 68 v160h-224q-13 0 -22.5 9.5t-9.5 22.5v416q0 79 56.5 135.5t135.5 56.5h64v544q0 40 28 68t68 28h672q40 0 88 -20t76 -48l152 -152q28 -28 48 -76t20 -88v-256h64q79 0 135.5 -56.5t56.5 -135.5z" /> <glyph unicode="" horiz-adv-x="1920" d="M960 864q119 0 203.5 -84.5t84.5 -203.5t-84.5 -203.5t-203.5 -84.5t-203.5 84.5t-84.5 203.5t84.5 203.5t203.5 84.5zM1664 1280q106 0 181 -75t75 -181v-896q0 -106 -75 -181t-181 -75h-1408q-106 0 -181 75t-75 181v896q0 106 75 181t181 75h224l51 136 q19 49 69.5 84.5t103.5 35.5h512q53 0 103.5 -35.5t69.5 -84.5l51 -136h224zM960 128q185 0 316.5 131.5t131.5 316.5t-131.5 316.5t-316.5 131.5t-316.5 -131.5t-131.5 -316.5t131.5 -316.5t316.5 -131.5z" /> -<glyph unicode="" horiz-adv-x="1664" d="M725 977l-170 -450q73 -1 153.5 -2t119 -1.5t52.5 -0.5l29 2q-32 95 -92 241q-53 132 -92 211zM21 -128h-21l2 79q22 7 80 18q89 16 110 31q20 16 48 68l237 616l280 724h75h53l11 -21l205 -480q103 -242 124 -297q39 -102 96 -235q26 -58 65 -164q24 -67 65 -149 q22 -49 35 -57q22 -19 69 -23q47 -6 103 -27q6 -39 6 -57q0 -14 -1 -26q-80 0 -192 8q-93 8 -189 8q-79 0 -135 -2l-200 -11l-58 -2q0 45 4 78l131 28q56 13 68 23q12 12 12 27t-6 32l-47 114l-92 228l-450 2q-29 -65 -104 -274q-23 -64 -23 -84q0 -31 17 -43 q26 -21 103 -32q3 0 13.5 -2t30 -5t40.5 -6q1 -28 1 -58q0 -17 -2 -27q-66 0 -349 20l-48 -8q-81 -14 -167 -14z" /> -<glyph unicode="" horiz-adv-x="1408" d="M555 15q76 -32 140 -32q131 0 216 41t122 113q38 70 38 181q0 114 -41 180q-58 94 -141 126q-80 32 -247 32q-74 0 -101 -10v-144l-1 -173l3 -270q0 -15 12 -44zM541 761q43 -7 109 -7q175 0 264 65t89 224q0 112 -85 187q-84 75 -255 75q-52 0 -130 -13q0 -44 2 -77 q7 -122 6 -279l-1 -98q0 -43 1 -77zM0 -128l2 94q45 9 68 12q77 12 123 31q17 27 21 51q9 66 9 194l-2 497q-5 256 -9 404q-1 87 -11 109q-1 4 -12 12q-18 12 -69 15q-30 2 -114 13l-4 83l260 6l380 13l45 1q5 0 14 0.5t14 0.5q1 0 21.5 -0.5t40.5 -0.5h74q88 0 191 -27 q43 -13 96 -39q57 -29 102 -76q44 -47 65 -104t21 -122q0 -70 -32 -128t-95 -105q-26 -20 -150 -77q177 -41 267 -146q92 -106 92 -236q0 -76 -29 -161q-21 -62 -71 -117q-66 -72 -140 -108q-73 -36 -203 -60q-82 -15 -198 -11l-197 4q-84 2 -298 -11q-33 -3 -272 -11z" /> -<glyph unicode="" horiz-adv-x="1024" d="M0 -126l17 85q4 1 77 20q76 19 116 39q29 37 41 101l27 139l56 268l12 64q8 44 17 84.5t16 67t12.5 46.5t9 30.5t3.5 11.5l29 157l16 63l22 135l8 50v38q-41 22 -144 28q-28 2 -38 4l19 103l317 -14q39 -2 73 -2q66 0 214 9q33 2 68 4.5t36 2.5q-2 -19 -6 -38 q-7 -29 -13 -51q-55 -19 -109 -31q-64 -16 -101 -31q-12 -31 -24 -88q-9 -44 -13 -82q-44 -199 -66 -306l-61 -311l-38 -158l-43 -235l-12 -45q-2 -7 1 -27q64 -15 119 -21q36 -5 66 -10q-1 -29 -7 -58q-7 -31 -9 -41q-18 0 -23 -1q-24 -2 -42 -2q-9 0 -28 3q-19 4 -145 17 l-198 2q-41 1 -174 -11q-74 -7 -98 -9z" /> -<glyph unicode="" horiz-adv-x="1792" d="M81 1407l54 -27q20 -5 211 -5h130l19 3l115 1l215 -1h293l34 -2q14 -1 28 7t21 16l7 8l42 1q15 0 28 -1v-104.5t1 -131.5l1 -100l-1 -58q0 -32 -4 -51q-39 -15 -68 -18q-25 43 -54 128q-8 24 -15.5 62.5t-11.5 65.5t-6 29q-13 15 -27 19q-7 2 -42.5 2t-103.5 -1t-111 -1 q-34 0 -67 -5q-10 -97 -8 -136l1 -152v-332l3 -359l-1 -147q-1 -46 11 -85q49 -25 89 -32q2 0 18 -5t44 -13t43 -12q30 -8 50 -18q5 -45 5 -50q0 -10 -3 -29q-14 -1 -34 -1q-110 0 -187 10q-72 8 -238 8q-88 0 -233 -14q-48 -4 -70 -4q-2 22 -2 26l-1 26v9q21 33 79 49 q139 38 159 50q9 21 12 56q8 192 6 433l-5 428q-1 62 -0.5 118.5t0.5 102.5t-2 57t-6 15q-6 5 -14 6q-38 6 -148 6q-43 0 -100 -13.5t-73 -24.5q-13 -9 -22 -33t-22 -75t-24 -84q-6 -19 -19.5 -32t-20.5 -13q-44 27 -56 44v297v86zM1744 128q33 0 42 -18.5t-11 -44.5 l-126 -162q-20 -26 -49 -26t-49 26l-126 162q-20 26 -11 44.5t42 18.5h80v1024h-80q-33 0 -42 18.5t11 44.5l126 162q20 26 49 26t49 -26l126 -162q20 -26 11 -44.5t-42 -18.5h-80v-1024h80z" /> -<glyph unicode="" d="M81 1407l54 -27q20 -5 211 -5h130l19 3l115 1l446 -1h318l34 -2q14 -1 28 7t21 16l7 8l42 1q15 0 28 -1v-104.5t1 -131.5l1 -100l-1 -58q0 -32 -4 -51q-39 -15 -68 -18q-25 43 -54 128q-8 24 -15.5 62.5t-11.5 65.5t-6 29q-13 15 -27 19q-7 2 -58.5 2t-138.5 -1t-128 -1 q-94 0 -127 -5q-10 -97 -8 -136l1 -152v52l3 -359l-1 -147q-1 -46 11 -85q49 -25 89 -32q2 0 18 -5t44 -13t43 -12q30 -8 50 -18q5 -45 5 -50q0 -10 -3 -29q-14 -1 -34 -1q-110 0 -187 10q-72 8 -238 8q-82 0 -233 -13q-45 -5 -70 -5q-2 22 -2 26l-1 26v9q21 33 79 49 q139 38 159 50q9 21 12 56q6 137 6 433l-5 44q0 265 -2 278q-2 11 -6 15q-6 5 -14 6q-38 6 -148 6q-50 0 -168.5 -14t-132.5 -24q-13 -9 -22 -33t-22 -75t-24 -84q-6 -19 -19.5 -32t-20.5 -13q-44 27 -56 44v297v86zM1505 113q26 -20 26 -49t-26 -49l-162 -126 q-26 -20 -44.5 -11t-18.5 42v80h-1024v-80q0 -33 -18.5 -42t-44.5 11l-162 126q-26 20 -26 49t26 49l162 126q26 20 44.5 11t18.5 -42v-80h1024v80q0 33 18.5 42t44.5 -11z" /> +<glyph unicode="" horiz-adv-x="1664" d="M725 977l-170 -450q33 0 136.5 -2t160.5 -2q19 0 57 2q-87 253 -184 452zM0 -128l2 79q23 7 56 12.5t57 10.5t49.5 14.5t44.5 29t31 50.5l237 616l280 724h75h53q8 -14 11 -21l205 -480q33 -78 106 -257.5t114 -274.5q15 -34 58 -144.5t72 -168.5q20 -45 35 -57 q19 -15 88 -29.5t84 -20.5q6 -38 6 -57q0 -4 -0.5 -13t-0.5 -13q-63 0 -190 8t-191 8q-76 0 -215 -7t-178 -8q0 43 4 78l131 28q1 0 12.5 2.5t15.5 3.5t14.5 4.5t15 6.5t11 8t9 11t2.5 14q0 16 -31 96.5t-72 177.5t-42 100l-450 2q-26 -58 -76.5 -195.5t-50.5 -162.5 q0 -22 14 -37.5t43.5 -24.5t48.5 -13.5t57 -8.5t41 -4q1 -19 1 -58q0 -9 -2 -27q-58 0 -174.5 10t-174.5 10q-8 0 -26.5 -4t-21.5 -4q-80 -14 -188 -14z" /> +<glyph unicode="" horiz-adv-x="1408" d="M555 15q74 -32 140 -32q376 0 376 335q0 114 -41 180q-27 44 -61.5 74t-67.5 46.5t-80.5 25t-84 10.5t-94.5 2q-73 0 -101 -10q0 -53 -0.5 -159t-0.5 -158q0 -8 -1 -67.5t-0.5 -96.5t4.5 -83.5t12 -66.5zM541 761q42 -7 109 -7q82 0 143 13t110 44.5t74.5 89.5t25.5 142 q0 70 -29 122.5t-79 82t-108 43.5t-124 14q-50 0 -130 -13q0 -50 4 -151t4 -152q0 -27 -0.5 -80t-0.5 -79q0 -46 1 -69zM0 -128l2 94q15 4 85 16t106 27q7 12 12.5 27t8.5 33.5t5.5 32.5t3 37.5t0.5 34v35.5v30q0 982 -22 1025q-4 8 -22 14.5t-44.5 11t-49.5 7t-48.5 4.5 t-30.5 3l-4 83q98 2 340 11.5t373 9.5q23 0 68.5 -0.5t67.5 -0.5q70 0 136.5 -13t128.5 -42t108 -71t74 -104.5t28 -137.5q0 -52 -16.5 -95.5t-39 -72t-64.5 -57.5t-73 -45t-84 -40q154 -35 256.5 -134t102.5 -248q0 -100 -35 -179.5t-93.5 -130.5t-138 -85.5t-163.5 -48.5 t-176 -14q-44 0 -132 3t-132 3q-106 0 -307 -11t-231 -12z" /> +<glyph unicode="" horiz-adv-x="1024" d="M0 -126l17 85q6 2 81.5 21.5t111.5 37.5q28 35 41 101q1 7 62 289t114 543.5t52 296.5v25q-24 13 -54.5 18.5t-69.5 8t-58 5.5l19 103q33 -2 120 -6.5t149.5 -7t120.5 -2.5q48 0 98.5 2.5t121 7t98.5 6.5q-5 -39 -19 -89q-30 -10 -101.5 -28.5t-108.5 -33.5 q-8 -19 -14 -42.5t-9 -40t-7.5 -45.5t-6.5 -42q-27 -148 -87.5 -419.5t-77.5 -355.5q-2 -9 -13 -58t-20 -90t-16 -83.5t-6 -57.5l1 -18q17 -4 185 -31q-3 -44 -16 -99q-11 0 -32.5 -1.5t-32.5 -1.5q-29 0 -87 10t-86 10q-138 2 -206 2q-51 0 -143 -9t-121 -11z" /> +<glyph unicode="" horiz-adv-x="1792" d="M1744 128q33 0 42 -18.5t-11 -44.5l-126 -162q-20 -26 -49 -26t-49 26l-126 162q-20 26 -11 44.5t42 18.5h80v1024h-80q-33 0 -42 18.5t11 44.5l126 162q20 26 49 26t49 -26l126 -162q20 -26 11 -44.5t-42 -18.5h-80v-1024h80zM81 1407l54 -27q12 -5 211 -5q44 0 132 2 t132 2q36 0 107.5 -0.5t107.5 -0.5h293q6 0 21 -0.5t20.5 0t16 3t17.5 9t15 17.5l42 1q4 0 14 -0.5t14 -0.5q2 -112 2 -336q0 -80 -5 -109q-39 -14 -68 -18q-25 44 -54 128q-3 9 -11 48t-14.5 73.5t-7.5 35.5q-6 8 -12 12.5t-15.5 6t-13 2.5t-18 0.5t-16.5 -0.5 q-17 0 -66.5 0.5t-74.5 0.5t-64 -2t-71 -6q-9 -81 -8 -136q0 -94 2 -388t2 -455q0 -16 -2.5 -71.5t0 -91.5t12.5 -69q40 -21 124 -42.5t120 -37.5q5 -40 5 -50q0 -14 -3 -29l-34 -1q-76 -2 -218 8t-207 10q-50 0 -151 -9t-152 -9q-3 51 -3 52v9q17 27 61.5 43t98.5 29t78 27 q19 42 19 383q0 101 -3 303t-3 303v117q0 2 0.5 15.5t0.5 25t-1 25.5t-3 24t-5 14q-11 12 -162 12q-33 0 -93 -12t-80 -26q-19 -13 -34 -72.5t-31.5 -111t-42.5 -53.5q-42 26 -56 44v383z" /> +<glyph unicode="" d="M81 1407l54 -27q12 -5 211 -5q44 0 132 2t132 2q70 0 246.5 1t304.5 0.5t247 -4.5q33 -1 56 31l42 1q4 0 14 -0.5t14 -0.5q2 -112 2 -336q0 -80 -5 -109q-39 -14 -68 -18q-25 44 -54 128q-3 9 -11 47.5t-15 73.5t-7 36q-10 13 -27 19q-5 2 -66 2q-30 0 -93 1t-103 1 t-94 -2t-96 -7q-9 -81 -8 -136l1 -152v52q0 -55 1 -154t1.5 -180t0.5 -153q0 -16 -2.5 -71.5t0 -91.5t12.5 -69q40 -21 124 -42.5t120 -37.5q5 -40 5 -50q0 -14 -3 -29l-34 -1q-76 -2 -218 8t-207 10q-50 0 -151 -9t-152 -9q-3 51 -3 52v9q17 27 61.5 43t98.5 29t78 27 q7 16 11.5 74t6 145.5t1.5 155t-0.5 153.5t-0.5 89q0 7 -2.5 21.5t-2.5 22.5q0 7 0.5 44t1 73t0 76.5t-3 67.5t-6.5 32q-11 12 -162 12q-41 0 -163 -13.5t-138 -24.5q-19 -12 -34 -71.5t-31.5 -111.5t-42.5 -54q-42 26 -56 44v383zM1310 125q12 0 42 -19.5t57.5 -41.5 t59.5 -49t36 -30q26 -21 26 -49t-26 -49q-4 -3 -36 -30t-59.5 -49t-57.5 -41.5t-42 -19.5q-13 0 -20.5 10.5t-10 28.5t-2.5 33.5t1.5 33t1.5 19.5h-1024q0 -2 1.5 -19.5t1.5 -33t-2.5 -33.5t-10 -28.5t-20.5 -10.5q-12 0 -42 19.5t-57.5 41.5t-59.5 49t-36 30q-26 21 -26 49 t26 49q4 3 36 30t59.5 49t57.5 41.5t42 19.5q13 0 20.5 -10.5t10 -28.5t2.5 -33.5t-1.5 -33t-1.5 -19.5h1024q0 2 -1.5 19.5t-1.5 33t2.5 33.5t10 28.5t20.5 10.5z" /> <glyph unicode="" horiz-adv-x="1792" d="M1792 192v-128q0 -26 -19 -45t-45 -19h-1664q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1664q26 0 45 -19t19 -45zM1408 576v-128q0 -26 -19 -45t-45 -19h-1280q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1280q26 0 45 -19t19 -45zM1664 960v-128q0 -26 -19 -45 t-45 -19h-1536q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1536q26 0 45 -19t19 -45zM1280 1344v-128q0 -26 -19 -45t-45 -19h-1152q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1152q26 0 45 -19t19 -45z" /> <glyph unicode="" horiz-adv-x="1792" d="M1792 192v-128q0 -26 -19 -45t-45 -19h-1664q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1664q26 0 45 -19t19 -45zM1408 576v-128q0 -26 -19 -45t-45 -19h-896q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h896q26 0 45 -19t19 -45zM1664 960v-128q0 -26 -19 -45t-45 -19 h-1408q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1408q26 0 45 -19t19 -45zM1280 1344v-128q0 -26 -19 -45t-45 -19h-640q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h640q26 0 45 -19t19 -45z" /> <glyph unicode="" horiz-adv-x="1792" d="M1792 192v-128q0 -26 -19 -45t-45 -19h-1664q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1664q26 0 45 -19t19 -45zM1792 576v-128q0 -26 -19 -45t-45 -19h-1280q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1280q26 0 45 -19t19 -45zM1792 960v-128q0 -26 -19 -45 t-45 -19h-1536q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1536q26 0 45 -19t19 -45zM1792 1344v-128q0 -26 -19 -45t-45 -19h-1152q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1152q26 0 45 -19t19 -45z" /> @@ -109,8 +110,8 @@ <glyph unicode="" horiz-adv-x="1792" d="M45 -115q-19 -19 -32 -13t-13 32v1472q0 26 13 32t32 -13l710 -710q8 -8 13 -19v710q0 26 13 32t32 -13l710 -710q8 -8 13 -19v678q0 26 19 45t45 19h128q26 0 45 -19t19 -45v-1408q0 -26 -19 -45t-45 -19h-128q-26 0 -45 19t-19 45v678q-5 -10 -13 -19l-710 -710 q-19 -19 -32 -13t-13 32v710q-5 -10 -13 -19z" /> <glyph unicode="" horiz-adv-x="1024" d="M45 -115q-19 -19 -32 -13t-13 32v1472q0 26 13 32t32 -13l710 -710q8 -8 13 -19v678q0 26 19 45t45 19h128q26 0 45 -19t19 -45v-1408q0 -26 -19 -45t-45 -19h-128q-26 0 -45 19t-19 45v678q-5 -10 -13 -19z" /> <glyph unicode="" horiz-adv-x="1538" d="M14 557l710 710q19 19 45 19t45 -19l710 -710q19 -19 13 -32t-32 -13h-1472q-26 0 -32 13t13 32zM1473 0h-1408q-26 0 -45 19t-19 45v256q0 26 19 45t45 19h1408q26 0 45 -19t19 -45v-256q0 -26 -19 -45t-45 -19z" /> -<glyph unicode="" horiz-adv-x="1152" d="M742 -37l-652 651q-37 37 -37 90.5t37 90.5l652 651q37 37 90.5 37t90.5 -37l75 -75q37 -37 37 -90.5t-37 -90.5l-486 -486l486 -485q37 -38 37 -91t-37 -90l-75 -75q-37 -37 -90.5 -37t-90.5 37z" /> -<glyph unicode="" horiz-adv-x="1152" d="M1099 704q0 -52 -37 -91l-652 -651q-37 -37 -90 -37t-90 37l-76 75q-37 39 -37 91q0 53 37 90l486 486l-486 485q-37 39 -37 91q0 53 37 90l76 75q36 38 90 38t90 -38l652 -651q37 -37 37 -90z" /> +<glyph unicode="" horiz-adv-x="1280" d="M1171 1235l-531 -531l531 -531q19 -19 19 -45t-19 -45l-166 -166q-19 -19 -45 -19t-45 19l-742 742q-19 19 -19 45t19 45l742 742q19 19 45 19t45 -19l166 -166q19 -19 19 -45t-19 -45z" /> +<glyph unicode="" horiz-adv-x="1280" d="M1107 659l-742 -742q-19 -19 -45 -19t-45 19l-166 166q-19 19 -19 45t19 45l531 531l-531 531q-19 19 -19 45t19 45l166 166q19 19 45 19t45 -19l742 -742q19 -19 19 -45t-19 -45z" /> <glyph unicode="" d="M1216 576v128q0 26 -19 45t-45 19h-256v256q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-256h-256q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h256v-256q0 -26 19 -45t45 -19h128q26 0 45 19t19 45v256h256q26 0 45 19t19 45zM1536 640q0 -209 -103 -385.5 t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" /> <glyph unicode="" d="M1216 576v128q0 26 -19 45t-45 19h-768q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h768q26 0 45 19t19 45zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5 t103 -385.5z" /> <glyph unicode="" d="M1149 414q0 26 -19 45l-181 181l181 181q19 19 19 45q0 27 -19 46l-90 90q-19 19 -46 19q-26 0 -45 -19l-181 -181l-181 181q-19 19 -45 19q-27 0 -46 -19l-90 -90q-19 -19 -19 -46q0 -26 19 -45l181 -181l-181 -181q-19 -19 -19 -45q0 -27 19 -46l90 -90q19 -19 46 -19 q26 0 45 19l181 181l181 -181q19 -19 45 -19q27 0 46 19l90 90q19 19 19 46zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" /> @@ -143,17 +144,17 @@ <glyph unicode="" horiz-adv-x="1792" d="M666 1055q-60 -92 -137 -273q-22 45 -37 72.5t-40.5 63.5t-51 56.5t-63 35t-81.5 14.5h-224q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h224q250 0 410 -225zM1792 256q0 -14 -9 -23l-320 -320q-9 -9 -23 -9q-13 0 -22.5 9.5t-9.5 22.5v192q-32 0 -85 -0.5t-81 -1t-73 1 t-71 5t-64 10.5t-63 18.5t-58 28.5t-59 40t-55 53.5t-56 69.5q59 93 136 273q22 -45 37 -72.5t40.5 -63.5t51 -56.5t63 -35t81.5 -14.5h256v192q0 14 9 23t23 9q12 0 24 -10l319 -319q9 -9 9 -23zM1792 1152q0 -14 -9 -23l-320 -320q-9 -9 -23 -9q-13 0 -22.5 9.5t-9.5 22.5 v192h-256q-48 0 -87 -15t-69 -45t-51 -61.5t-45 -77.5q-32 -62 -78 -171q-29 -66 -49.5 -111t-54 -105t-64 -100t-74 -83t-90 -68.5t-106.5 -42t-128 -16.5h-224q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h224q48 0 87 15t69 45t51 61.5t45 77.5q32 62 78 171q29 66 49.5 111 t54 105t64 100t74 83t90 68.5t106.5 42t128 16.5h256v192q0 14 9 23t23 9q12 0 24 -10l319 -319q9 -9 9 -23z" /> <glyph unicode="" horiz-adv-x="1792" d="M1792 640q0 -174 -120 -321.5t-326 -233t-450 -85.5q-70 0 -145 8q-198 -175 -460 -242q-49 -14 -114 -22q-17 -2 -30.5 9t-17.5 29v1q-3 4 -0.5 12t2 10t4.5 9.5l6 9t7 8.5t8 9q7 8 31 34.5t34.5 38t31 39.5t32.5 51t27 59t26 76q-157 89 -247.5 220t-90.5 281 q0 130 71 248.5t191 204.5t286 136.5t348 50.5q244 0 450 -85.5t326 -233t120 -321.5z" /> <glyph unicode="" d="M1536 704v-128q0 -201 -98.5 -362t-274 -251.5t-395.5 -90.5t-395.5 90.5t-274 251.5t-98.5 362v128q0 26 19 45t45 19h384q26 0 45 -19t19 -45v-128q0 -52 23.5 -90t53.5 -57t71 -30t64 -13t44 -2t44 2t64 13t71 30t53.5 57t23.5 90v128q0 26 19 45t45 19h384 q26 0 45 -19t19 -45zM512 1344v-384q0 -26 -19 -45t-45 -19h-384q-26 0 -45 19t-19 45v384q0 26 19 45t45 19h384q26 0 45 -19t19 -45zM1536 1344v-384q0 -26 -19 -45t-45 -19h-384q-26 0 -45 19t-19 45v384q0 26 19 45t45 19h384q26 0 45 -19t19 -45z" /> -<glyph unicode="" horiz-adv-x="1664" d="M1611 320q0 -53 -37 -90l-75 -75q-38 -38 -91 -38q-54 0 -90 38l-486 485l-486 -485q-36 -38 -90 -38t-90 38l-75 75q-38 36 -38 90q0 53 38 91l651 651q37 37 90 37q52 0 91 -37l650 -651q38 -38 38 -91z" /> -<glyph unicode="" horiz-adv-x="1664" d="M1611 832q0 -53 -37 -90l-651 -651q-38 -38 -91 -38q-54 0 -90 38l-651 651q-38 36 -38 90q0 53 38 91l74 75q39 37 91 37q53 0 90 -37l486 -486l486 486q37 37 90 37q52 0 91 -37l75 -75q37 -39 37 -91z" /> +<glyph unicode="" horiz-adv-x="1792" d="M1683 205l-166 -165q-19 -19 -45 -19t-45 19l-531 531l-531 -531q-19 -19 -45 -19t-45 19l-166 165q-19 19 -19 45.5t19 45.5l742 741q19 19 45 19t45 -19l742 -741q19 -19 19 -45.5t-19 -45.5z" /> +<glyph unicode="" horiz-adv-x="1792" d="M1683 728l-742 -741q-19 -19 -45 -19t-45 19l-742 741q-19 19 -19 45.5t19 45.5l166 165q19 19 45 19t45 -19l531 -531l531 531q19 19 45 19t45 -19l166 -165q19 -19 19 -45.5t-19 -45.5z" /> <glyph unicode="" horiz-adv-x="1920" d="M1280 32q0 -13 -9.5 -22.5t-22.5 -9.5h-960q-8 0 -13.5 2t-9 7t-5.5 8t-3 11.5t-1 11.5v13v11v160v416h-192q-26 0 -45 19t-19 45q0 24 15 41l320 384q19 22 49 22t49 -22l320 -384q15 -17 15 -41q0 -26 -19 -45t-45 -19h-192v-384h576q16 0 25 -11l160 -192q7 -11 7 -21 zM1920 448q0 -24 -15 -41l-320 -384q-20 -23 -49 -23t-49 23l-320 384q-15 17 -15 41q0 26 19 45t45 19h192v384h-576q-16 0 -25 12l-160 192q-7 9 -7 20q0 13 9.5 22.5t22.5 9.5h960q8 0 13.5 -2t9 -7t5.5 -8t3 -11.5t1 -11.5v-13v-11v-160v-416h192q26 0 45 -19t19 -45z " /> -<glyph unicode="" horiz-adv-x="1664" d="M640 0q0 -53 -37.5 -90.5t-90.5 -37.5t-90.5 37.5t-37.5 90.5t37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM1536 0q0 -53 -37.5 -90.5t-90.5 -37.5t-90.5 37.5t-37.5 90.5t37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM1664 1088v-512q0 -24 -16 -42.5t-41 -21.5 l-1044 -122q1 -7 4.5 -21.5t6 -26.5t2.5 -22q0 -16 -24 -64h920q26 0 45 -19t19 -45t-19 -45t-45 -19h-1024q-26 0 -45 19t-19 45q0 14 11 39.5t29.5 59.5t20.5 38l-177 823h-204q-26 0 -45 19t-19 45t19 45t45 19h256q16 0 28.5 -6.5t20 -15.5t13 -24.5t7.5 -26.5 t5.5 -29.5t4.5 -25.5h1201q26 0 45 -19t19 -45z" /> +<glyph unicode="" horiz-adv-x="1664" d="M640 0q0 -52 -38 -90t-90 -38t-90 38t-38 90t38 90t90 38t90 -38t38 -90zM1536 0q0 -52 -38 -90t-90 -38t-90 38t-38 90t38 90t90 38t90 -38t38 -90zM1664 1088v-512q0 -24 -16.5 -42.5t-40.5 -21.5l-1044 -122q13 -60 13 -70q0 -16 -24 -64h920q26 0 45 -19t19 -45 t-19 -45t-45 -19h-1024q-26 0 -45 19t-19 45q0 11 8 31.5t16 36t21.5 40t15.5 29.5l-177 823h-204q-26 0 -45 19t-19 45t19 45t45 19h256q16 0 28.5 -6.5t19.5 -15.5t13 -24.5t8 -26t5.5 -29.5t4.5 -26h1201q26 0 45 -19t19 -45z" /> <glyph unicode="" horiz-adv-x="1664" d="M1664 928v-704q0 -92 -66 -158t-158 -66h-1216q-92 0 -158 66t-66 158v960q0 92 66 158t158 66h320q92 0 158 -66t66 -158v-32h672q92 0 158 -66t66 -158z" /> <glyph unicode="" horiz-adv-x="1920" d="M1879 584q0 -31 -31 -66l-336 -396q-43 -51 -120.5 -86.5t-143.5 -35.5h-1088q-34 0 -60.5 13t-26.5 43q0 31 31 66l336 396q43 51 120.5 86.5t143.5 35.5h1088q34 0 60.5 -13t26.5 -43zM1536 928v-160h-832q-94 0 -197 -47.5t-164 -119.5l-337 -396l-5 -6q0 4 -0.5 12.5 t-0.5 12.5v960q0 92 66 158t158 66h320q92 0 158 -66t66 -158v-32h544q92 0 158 -66t66 -158z" /> <glyph unicode="" horiz-adv-x="768" d="M704 1216q0 -26 -19 -45t-45 -19h-128v-1024h128q26 0 45 -19t19 -45t-19 -45l-256 -256q-19 -19 -45 -19t-45 19l-256 256q-19 19 -19 45t19 45t45 19h128v1024h-128q-26 0 -45 19t-19 45t19 45l256 256q19 19 45 19t45 -19l256 -256q19 -19 19 -45z" /> <glyph unicode="" horiz-adv-x="1792" d="M1792 640q0 -26 -19 -45l-256 -256q-19 -19 -45 -19t-45 19t-19 45v128h-1024v-128q0 -26 -19 -45t-45 -19t-45 19l-256 256q-19 19 -19 45t19 45l256 256q19 19 45 19t45 -19t19 -45v-128h1024v128q0 26 19 45t45 19t45 -19l256 -256q19 -19 19 -45z" /> -<glyph unicode="" horiz-adv-x="1920" d="M512 512v-384h-256v384h256zM896 1024v-896h-256v896h256zM1280 768v-640h-256v640h256zM1664 1152v-1024h-256v1024h256zM1792 32v1216q0 13 -9.5 22.5t-22.5 9.5h-1600q-13 0 -22.5 -9.5t-9.5 -22.5v-1216q0 -13 9.5 -22.5t22.5 -9.5h1600q13 0 22.5 9.5t9.5 22.5z M1920 1248v-1216q0 -66 -47 -113t-113 -47h-1600q-66 0 -113 47t-47 113v1216q0 66 47 113t113 47h1600q66 0 113 -47t47 -113z" /> +<glyph unicode="" horiz-adv-x="2048" d="M640 640v-512h-256v512h256zM1024 1152v-1024h-256v1024h256zM2048 0v-128h-2048v1536h128v-1408h1920zM1408 896v-768h-256v768h256zM1792 1280v-1152h-256v1152h256z" /> <glyph unicode="" d="M1280 926q-56 -25 -121 -34q68 40 93 117q-65 -38 -134 -51q-61 66 -153 66q-87 0 -148.5 -61.5t-61.5 -148.5q0 -29 5 -48q-129 7 -242 65t-192 155q-29 -50 -29 -106q0 -114 91 -175q-47 1 -100 26v-2q0 -75 50 -133.5t123 -72.5q-29 -8 -51 -8q-13 0 -39 4 q21 -63 74.5 -104t121.5 -42q-116 -90 -261 -90q-26 0 -50 3q148 -94 322 -94q112 0 210 35.5t168 95t120.5 137t75 162t24.5 168.5q0 18 -1 27q63 45 105 109zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5 t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" /> -<glyph unicode="" d="M1307 618l23 219h-198v109q0 49 15.5 68.5t71.5 19.5h110v219h-175q-152 0 -218 -72t-66 -213v-131h-131v-219h131v-635h262v635h175zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960 q119 0 203.5 -84.5t84.5 -203.5z" /> +<glyph unicode="" d="M1248 1408q119 0 203.5 -84.5t84.5 -203.5v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-188v595h199l30 232h-229v148q0 56 23.5 84t91.5 28l122 1v207q-63 9 -178 9q-136 0 -217.5 -80t-81.5 -226v-171h-200v-232h200v-595h-532q-119 0 -203.5 84.5t-84.5 203.5v960 q0 119 84.5 203.5t203.5 84.5h960z" /> <glyph unicode="" horiz-adv-x="1792" d="M928 704q0 14 -9 23t-23 9q-66 0 -113 -47t-47 -113q0 -14 9 -23t23 -9t23 9t9 23q0 40 28 68t68 28q14 0 23 9t9 23zM1152 574q0 -106 -75 -181t-181 -75t-181 75t-75 181t75 181t181 75t181 -75t75 -181zM128 0h1536v128h-1536v-128zM1280 574q0 159 -112.5 271.5 t-271.5 112.5t-271.5 -112.5t-112.5 -271.5t112.5 -271.5t271.5 -112.5t271.5 112.5t112.5 271.5zM256 1216h384v128h-384v-128zM128 1024h1536v118v138h-828l-64 -128h-644v-128zM1792 1280v-1280q0 -53 -37.5 -90.5t-90.5 -37.5h-1536q-53 0 -90.5 37.5t-37.5 90.5v1280 q0 53 37.5 90.5t90.5 37.5h1536q53 0 90.5 -37.5t37.5 -90.5z" /> <glyph unicode="" horiz-adv-x="1792" d="M832 1024q0 80 -56 136t-136 56t-136 -56t-56 -136q0 -42 19 -83q-41 19 -83 19q-80 0 -136 -56t-56 -136t56 -136t136 -56t136 56t56 136q0 42 -19 83q41 -19 83 -19q80 0 136 56t56 136zM1683 320q0 -17 -49 -66t-66 -49q-9 0 -28.5 16t-36.5 33t-38.5 40t-24.5 26 l-96 -96l220 -220q28 -28 28 -68q0 -42 -39 -81t-81 -39q-40 0 -68 28l-671 671q-176 -131 -365 -131q-163 0 -265.5 102.5t-102.5 265.5q0 160 95 313t248 248t313 95q163 0 265.5 -102.5t102.5 -265.5q0 -189 -131 -365l355 -355l96 96q-3 3 -26 24.5t-40 38.5t-33 36.5 t-16 28.5q0 17 49 66t66 49q13 0 23 -10q6 -6 46 -44.5t82 -79.5t86.5 -86t73 -78t28.5 -41z" /> <glyph unicode="" horiz-adv-x="1920" d="M896 640q0 106 -75 181t-181 75t-181 -75t-75 -181t75 -181t181 -75t181 75t75 181zM1664 128q0 52 -38 90t-90 38t-90 -38t-38 -90q0 -53 37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM1664 1152q0 52 -38 90t-90 38t-90 -38t-38 -90q0 -53 37.5 -90.5t90.5 -37.5 t90.5 37.5t37.5 90.5zM1280 731v-185q0 -10 -7 -19.5t-16 -10.5l-155 -24q-11 -35 -32 -76q34 -48 90 -115q7 -10 7 -20q0 -12 -7 -19q-23 -30 -82.5 -89.5t-78.5 -59.5q-11 0 -21 7l-115 90q-37 -19 -77 -31q-11 -108 -23 -155q-7 -24 -30 -24h-186q-11 0 -20 7.5t-10 17.5 l-23 153q-34 10 -75 31l-118 -89q-7 -7 -20 -7q-11 0 -21 8q-144 133 -144 160q0 9 7 19q10 14 41 53t47 61q-23 44 -35 82l-152 24q-10 1 -17 9.5t-7 19.5v185q0 10 7 19.5t16 10.5l155 24q11 35 32 76q-34 48 -90 115q-7 11 -7 20q0 12 7 20q22 30 82 89t79 59q11 0 21 -7 l115 -90q34 18 77 32q11 108 23 154q7 24 30 24h186q11 0 20 -7.5t10 -17.5l23 -153q34 -10 75 -31l118 89q8 7 20 7q11 0 21 -8q144 -133 144 -160q0 -9 -7 -19q-12 -16 -42 -54t-45 -60q23 -48 34 -82l152 -23q10 -2 17 -10.5t7 -19.5zM1920 198v-140q0 -16 -149 -31 q-12 -27 -30 -52q51 -113 51 -138q0 -4 -4 -7q-122 -71 -124 -71q-8 0 -46 47t-52 68q-20 -2 -30 -2t-30 2q-14 -21 -52 -68t-46 -47q-2 0 -124 71q-4 3 -4 7q0 25 51 138q-18 25 -30 52q-149 15 -149 31v140q0 16 149 31q13 29 30 52q-51 113 -51 138q0 4 4 7q4 2 35 20 t59 34t30 16q8 0 46 -46.5t52 -67.5q20 2 30 2t30 -2q51 71 92 112l6 2q4 0 124 -70q4 -3 4 -7q0 -25 -51 -138q17 -23 30 -52q149 -15 149 -31zM1920 1222v-140q0 -16 -149 -31q-12 -27 -30 -52q51 -113 51 -138q0 -4 -4 -7q-122 -71 -124 -71q-8 0 -46 47t-52 68 q-20 -2 -30 -2t-30 2q-14 -21 -52 -68t-46 -47q-2 0 -124 71q-4 3 -4 7q0 25 51 138q-18 25 -30 52q-149 15 -149 31v140q0 16 149 31q13 29 30 52q-51 113 -51 138q0 4 4 7q4 2 35 20t59 34t30 16q8 0 46 -46.5t52 -67.5q20 2 30 2t30 -2q51 71 92 112l6 2q4 0 124 -70 q4 -3 4 -7q0 -25 -51 -138q17 -23 30 -52q149 -15 149 -31z" /> @@ -176,14 +177,14 @@ <glyph unicode="" horiz-adv-x="1280" d="M1152 1280h-1024v-1242l423 406l89 85l89 -85l423 -406v1242zM1164 1408q23 0 44 -9q33 -13 52.5 -41t19.5 -62v-1289q0 -34 -19.5 -62t-52.5 -41q-19 -8 -44 -8q-48 0 -83 32l-441 424l-441 -424q-36 -33 -83 -33q-23 0 -44 9q-33 13 -52.5 41t-19.5 62v1289 q0 34 19.5 62t52.5 41q21 9 44 9h1048z" /> <glyph unicode="" d="M1280 343q0 11 -2 16q-3 8 -38.5 29.5t-88.5 49.5l-53 29q-5 3 -19 13t-25 15t-21 5q-18 0 -47 -32.5t-57 -65.5t-44 -33q-7 0 -16.5 3.5t-15.5 6.5t-17 9.5t-14 8.5q-99 55 -170.5 126.5t-126.5 170.5q-2 3 -8.5 14t-9.5 17t-6.5 15.5t-3.5 16.5q0 13 20.5 33.5t45 38.5 t45 39.5t20.5 36.5q0 10 -5 21t-15 25t-13 19q-3 6 -15 28.5t-25 45.5t-26.5 47.5t-25 40.5t-16.5 18t-16 2q-48 0 -101 -22q-46 -21 -80 -94.5t-34 -130.5q0 -16 2.5 -34t5 -30.5t9 -33t10 -29.5t12.5 -33t11 -30q60 -164 216.5 -320.5t320.5 -216.5q6 -2 30 -11t33 -12.5 t29.5 -10t33 -9t30.5 -5t34 -2.5q57 0 130.5 34t94.5 80q22 53 22 101zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" /> <glyph unicode="" horiz-adv-x="1664" d="M1620 1128q-67 -98 -162 -167q1 -14 1 -42q0 -130 -38 -259.5t-115.5 -248.5t-184.5 -210.5t-258 -146t-323 -54.5q-271 0 -496 145q35 -4 78 -4q225 0 401 138q-105 2 -188 64.5t-114 159.5q33 -5 61 -5q43 0 85 11q-112 23 -185.5 111.5t-73.5 205.5v4q68 -38 146 -41 q-66 44 -105 115t-39 154q0 88 44 163q121 -149 294.5 -238.5t371.5 -99.5q-8 38 -8 74q0 134 94.5 228.5t228.5 94.5q140 0 236 -102q109 21 205 78q-37 -115 -142 -178q93 10 186 50z" /> -<glyph unicode="" horiz-adv-x="768" d="M511 980h257l-30 -284h-227v-824h-341v824h-170v284h170v171q0 182 86 275.5t283 93.5h227v-284h-142q-39 0 -62.5 -6.5t-34 -23.5t-13.5 -34.5t-3 -49.5v-142z" /> +<glyph unicode="" horiz-adv-x="1024" d="M959 1524v-264h-157q-86 0 -116 -36t-30 -108v-189h293l-39 -296h-254v-759h-306v759h-255v296h255v218q0 186 104 288.5t277 102.5q147 0 228 -12z" /> <glyph unicode="" d="M1536 640q0 -251 -146.5 -451.5t-378.5 -277.5q-27 -5 -39.5 7t-12.5 30v211q0 97 -52 142q57 6 102.5 18t94 39t81 66.5t53 105t20.5 150.5q0 121 -79 206q37 91 -8 204q-28 9 -81 -11t-92 -44l-38 -24q-93 26 -192 26t-192 -26q-16 11 -42.5 27t-83.5 38.5t-86 13.5 q-44 -113 -7 -204q-79 -85 -79 -206q0 -85 20.5 -150t52.5 -105t80.5 -67t94 -39t102.5 -18q-40 -36 -49 -103q-21 -10 -45 -15t-57 -5t-65.5 21.5t-55.5 62.5q-19 32 -48.5 52t-49.5 24l-20 3q-21 0 -29 -4.5t-5 -11.5t9 -14t13 -12l7 -5q22 -10 43.5 -38t31.5 -51l10 -23 q13 -38 44 -61.5t67 -30t69.5 -7t55.5 3.5l23 4q0 -38 0.5 -89t0.5 -54q0 -18 -13 -30t-40 -7q-232 77 -378.5 277.5t-146.5 451.5q0 209 103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" /> <glyph unicode="" horiz-adv-x="1664" d="M1664 960v-256q0 -26 -19 -45t-45 -19h-64q-26 0 -45 19t-19 45v256q0 106 -75 181t-181 75t-181 -75t-75 -181v-192h96q40 0 68 -28t28 -68v-576q0 -40 -28 -68t-68 -28h-960q-40 0 -68 28t-28 68v576q0 40 28 68t68 28h672v192q0 185 131.5 316.5t316.5 131.5 t316.5 -131.5t131.5 -316.5z" /> <glyph unicode="" horiz-adv-x="1920" d="M1760 1408q66 0 113 -47t47 -113v-1216q0 -66 -47 -113t-113 -47h-1600q-66 0 -113 47t-47 113v1216q0 66 47 113t113 47h1600zM160 1280q-13 0 -22.5 -9.5t-9.5 -22.5v-224h1664v224q0 13 -9.5 22.5t-22.5 9.5h-1600zM1760 0q13 0 22.5 9.5t9.5 22.5v608h-1664v-608 q0 -13 9.5 -22.5t22.5 -9.5h1600zM256 128v128h256v-128h-256zM640 128v128h384v-128h-384z" /> <glyph unicode="" horiz-adv-x="1408" d="M384 192q0 -80 -56 -136t-136 -56t-136 56t-56 136t56 136t136 56t136 -56t56 -136zM896 69q2 -28 -17 -48q-18 -21 -47 -21h-135q-25 0 -43 16.5t-20 41.5q-22 229 -184.5 391.5t-391.5 184.5q-25 2 -41.5 20t-16.5 43v135q0 29 21 47q17 17 43 17h5q160 -13 306 -80.5 t259 -181.5q114 -113 181.5 -259t80.5 -306zM1408 67q2 -27 -18 -47q-18 -20 -46 -20h-143q-26 0 -44.5 17.5t-19.5 42.5q-12 215 -101 408.5t-231.5 336t-336 231.5t-408.5 102q-25 1 -42.5 19.5t-17.5 43.5v143q0 28 20 46q18 18 44 18h3q262 -13 501.5 -120t425.5 -294 q187 -186 294 -425.5t120 -501.5z" /> <glyph unicode="" d="M1040 320q0 -33 -23.5 -56.5t-56.5 -23.5t-56.5 23.5t-23.5 56.5t23.5 56.5t56.5 23.5t56.5 -23.5t23.5 -56.5zM1296 320q0 -33 -23.5 -56.5t-56.5 -23.5t-56.5 23.5t-23.5 56.5t23.5 56.5t56.5 23.5t56.5 -23.5t23.5 -56.5zM1408 160v320q0 13 -9.5 22.5t-22.5 9.5 h-1216q-13 0 -22.5 -9.5t-9.5 -22.5v-320q0 -13 9.5 -22.5t22.5 -9.5h1216q13 0 22.5 9.5t9.5 22.5zM178 640h1180l-157 482q-4 13 -16 21.5t-26 8.5h-782q-14 0 -26 -8.5t-16 -21.5zM1536 480v-320q0 -66 -47 -113t-113 -47h-1216q-66 0 -113 47t-47 113v320q0 25 16 75 l197 606q17 53 63 86t101 33h782q55 0 101 -33t63 -86l197 -606q16 -50 16 -75z" /> <glyph unicode="" horiz-adv-x="1792" d="M1664 896q53 0 90.5 -37.5t37.5 -90.5t-37.5 -90.5t-90.5 -37.5v-384q0 -52 -38 -90t-90 -38q-417 347 -812 380q-58 -19 -91 -66t-31 -100.5t40 -92.5q-20 -33 -23 -65.5t6 -58t33.5 -55t48 -50t61.5 -50.5q-29 -58 -111.5 -83t-168.5 -11.5t-132 55.5q-7 23 -29.5 87.5 t-32 94.5t-23 89t-15 101t3.5 98.5t22 110.5h-122q-66 0 -113 47t-47 113v192q0 66 47 113t113 47h480q435 0 896 384q52 0 90 -38t38 -90v-384zM1536 292v954q-394 -302 -768 -343v-270q377 -42 768 -341z" /> -<glyph unicode="" horiz-adv-x="1664" d="M848 -160q0 16 -16 16q-59 0 -101.5 42.5t-42.5 101.5q0 16 -16 16t-16 -16q0 -73 51.5 -124.5t124.5 -51.5q16 0 16 16zM183 128h1298q-164 181 -246.5 411.5t-82.5 484.5q0 256 -320 256t-320 -256q0 -254 -82.5 -484.5t-246.5 -411.5zM1664 128q0 -52 -38 -90t-90 -38 h-448q0 -106 -75 -181t-181 -75t-181 75t-75 181h-448q-52 0 -90 38t-38 90q190 161 287 397.5t97 498.5q0 165 96 262t264 117q-8 18 -8 37q0 40 28 68t68 28t68 -28t28 -68q0 -19 -8 -37q168 -20 264 -117t96 -262q0 -262 97 -498.5t287 -397.5z" /> +<glyph unicode="" horiz-adv-x="1792" d="M912 -160q0 16 -16 16q-59 0 -101.5 42.5t-42.5 101.5q0 16 -16 16t-16 -16q0 -73 51.5 -124.5t124.5 -51.5q16 0 16 16zM246 128h1300q-266 300 -266 832q0 51 -24 105t-69 103t-121.5 80.5t-169.5 31.5t-169.5 -31.5t-121.5 -80.5t-69 -103t-24 -105q0 -532 -266 -832z M1728 128q0 -52 -38 -90t-90 -38h-448q0 -106 -75 -181t-181 -75t-181 75t-75 181h-448q-52 0 -90 38t-38 90q50 42 91 88t85 119.5t74.5 158.5t50 206t19.5 260q0 152 117 282.5t307 158.5q-8 19 -8 39q0 40 28 68t68 28t68 -28t28 -68q0 -20 -8 -39q190 -28 307 -158.5 t117 -282.5q0 -139 19.5 -260t50 -206t74.5 -158.5t85 -119.5t91 -88z" /> <glyph unicode="" d="M1376 640l138 -135q30 -28 20 -70q-12 -41 -52 -51l-188 -48l53 -186q12 -41 -19 -70q-29 -31 -70 -19l-186 53l-48 -188q-10 -40 -51 -52q-12 -2 -19 -2q-31 0 -51 22l-135 138l-135 -138q-28 -30 -70 -20q-41 11 -51 52l-48 188l-186 -53q-41 -12 -70 19q-31 29 -19 70 l53 186l-188 48q-40 10 -52 51q-10 42 20 70l138 135l-138 135q-30 28 -20 70q12 41 52 51l188 48l-53 186q-12 41 19 70q29 31 70 19l186 -53l48 188q10 41 51 51q41 12 70 -19l135 -139l135 139q29 30 70 19q41 -10 51 -51l48 -188l186 53q41 12 70 -19q31 -29 19 -70 l-53 -186l188 -48q40 -10 52 -51q10 -42 -20 -70z" /> <glyph unicode="" horiz-adv-x="1792" d="M256 192q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1664 768q0 51 -39 89.5t-89 38.5h-576q0 20 15 48.5t33 55t33 68t15 84.5q0 67 -44.5 97.5t-115.5 30.5q-24 0 -90 -139q-24 -44 -37 -65q-40 -64 -112 -145q-71 -81 -101 -106 q-69 -57 -140 -57h-32v-640h32q72 0 167 -32t193.5 -64t179.5 -32q189 0 189 167q0 26 -5 56q30 16 47.5 52.5t17.5 73.5t-18 69q53 50 53 119q0 25 -10 55.5t-25 47.5h331q52 0 90 38t38 90zM1792 769q0 -105 -75.5 -181t-180.5 -76h-169q-4 -62 -37 -119q3 -21 3 -43 q0 -101 -60 -178q1 -139 -85 -219.5t-227 -80.5q-133 0 -322 69q-164 59 -223 59h-288q-53 0 -90.5 37.5t-37.5 90.5v640q0 53 37.5 90.5t90.5 37.5h288q10 0 21.5 4.5t23.5 14t22.5 18t24 22.5t20.5 21.5t19 21.5t14 17q65 74 100 129q13 21 33 62t37 72t40.5 63t55 49.5 t69.5 17.5q125 0 206.5 -67t81.5 -189q0 -68 -22 -128h374q104 0 180 -76t76 -179z" /> <glyph unicode="" horiz-adv-x="1792" d="M1376 128h32v640h-32q-35 0 -67.5 12t-62.5 37t-50 46t-49 54q-2 3 -3.5 4.5t-4 4.5t-4.5 5q-72 81 -112 145q-14 22 -38 68q-1 3 -10.5 22.5t-18.5 36t-20 35.5t-21.5 30.5t-18.5 11.5q-71 0 -115.5 -30.5t-44.5 -97.5q0 -43 15 -84.5t33 -68t33 -55t15 -48.5h-576 q-50 0 -89 -38.5t-39 -89.5q0 -52 38 -90t90 -38h331q-15 -17 -25 -47.5t-10 -55.5q0 -69 53 -119q-18 -32 -18 -69t17.5 -73.5t47.5 -52.5q-4 -24 -4 -56q0 -85 48.5 -126t135.5 -41q84 0 183 32t194 64t167 32zM1664 192q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45 t45 -19t45 19t19 45zM1792 768v-640q0 -53 -37.5 -90.5t-90.5 -37.5h-288q-59 0 -223 -59q-190 -69 -317 -69q-142 0 -230 77.5t-87 217.5l1 5q-61 76 -61 178q0 22 3 43q-33 57 -37 119h-169q-105 0 -180.5 76t-75.5 181q0 103 76 179t180 76h374q-22 60 -22 128 q0 122 81.5 189t206.5 67q38 0 69.5 -17.5t55 -49.5t40.5 -63t37 -72t33 -62q35 -55 100 -129q2 -3 14 -17t19 -21.5t20.5 -21.5t24 -22.5t22.5 -18t23.5 -14t21.5 -4.5h288q53 0 90.5 -37.5t37.5 -90.5z" /> @@ -218,8 +219,8 @@ <glyph unicode="" horiz-adv-x="1792" d="M640 128q0 52 -38 90t-90 38t-90 -38t-38 -90t38 -90t90 -38t90 38t38 90zM256 640h384v256h-158q-13 0 -22 -9l-195 -195q-9 -9 -9 -22v-30zM1536 128q0 52 -38 90t-90 38t-90 -38t-38 -90t38 -90t90 -38t90 38t38 90zM1792 1216v-1024q0 -15 -4 -26.5t-13.5 -18.5 t-16.5 -11.5t-23.5 -6t-22.5 -2t-25.5 0t-22.5 0.5q0 -106 -75 -181t-181 -75t-181 75t-75 181h-384q0 -106 -75 -181t-181 -75t-181 75t-75 181h-64q-3 0 -22.5 -0.5t-25.5 0t-22.5 2t-23.5 6t-16.5 11.5t-13.5 18.5t-4 26.5q0 26 19 45t45 19v320q0 8 -0.5 35t0 38 t2.5 34.5t6.5 37t14 30.5t22.5 30l198 198q19 19 50.5 32t58.5 13h160v192q0 26 19 45t45 19h1024q26 0 45 -19t19 -45z" /> <glyph unicode="" d="M1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103q-111 0 -218 32q59 93 78 164q9 34 54 211q20 -39 73 -67.5t114 -28.5q121 0 216 68.5t147 188.5t52 270q0 114 -59.5 214t-172.5 163t-255 63q-105 0 -196 -29t-154.5 -77t-109 -110.5t-67 -129.5t-21.5 -134 q0 -104 40 -183t117 -111q30 -12 38 20q2 7 8 31t8 30q6 23 -11 43q-51 61 -51 151q0 151 104.5 259.5t273.5 108.5q151 0 235.5 -82t84.5 -213q0 -170 -68.5 -289t-175.5 -119q-61 0 -98 43.5t-23 104.5q8 35 26.5 93.5t30 103t11.5 75.5q0 50 -27 83t-77 33 q-62 0 -105 -57t-43 -142q0 -73 25 -122l-99 -418q-17 -70 -13 -177q-206 91 -333 281t-127 423q0 209 103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" /> <glyph unicode="" d="M1248 1408q119 0 203.5 -84.5t84.5 -203.5v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-725q85 122 108 210q9 34 53 209q21 -39 73.5 -67t112.5 -28q181 0 295.5 147.5t114.5 373.5q0 84 -35 162.5t-96.5 139t-152.5 97t-197 36.5q-104 0 -194.5 -28.5t-153 -76.5 t-107.5 -109.5t-66.5 -128t-21.5 -132.5q0 -102 39.5 -180t116.5 -110q13 -5 23.5 0t14.5 19q10 44 15 61q6 23 -11 42q-50 62 -50 150q0 150 103.5 256.5t270.5 106.5q149 0 232.5 -81t83.5 -210q0 -168 -67.5 -286t-173.5 -118q-60 0 -97 43.5t-23 103.5q8 34 26.5 92.5 t29.5 102t11 74.5q0 49 -26.5 81.5t-75.5 32.5q-61 0 -103.5 -56.5t-42.5 -139.5q0 -72 24 -121l-98 -414q-24 -100 -7 -254h-183q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960z" /> -<glyph unicode="" d="M678 -57q0 -38 -10 -71h-380q-95 0 -171.5 56.5t-103.5 147.5q24 45 69 77.5t100 49.5t107 24t107 7q32 0 49 -2q6 -4 30.5 -21t33 -23t31 -23t32 -25.5t27.5 -25.5t26.5 -29.5t21 -30.5t17.5 -34.5t9.5 -36t4.5 -40.5zM385 294q-234 -7 -385 -85v433q103 -118 273 -118 q32 0 70 5q-21 -61 -21 -86q0 -67 63 -149zM558 805q0 -100 -43.5 -160.5t-140.5 -60.5q-51 0 -97 26t-78 67.5t-56 93.5t-35.5 104t-11.5 99q0 96 51.5 165t144.5 69q66 0 119 -41t84 -104t47 -130t16 -128zM1536 896v-736q0 -119 -84.5 -203.5t-203.5 -84.5h-468 q39 73 39 157q0 66 -22 122.5t-55.5 93t-72 71t-72 59.5t-55.5 54.5t-22 59.5q0 36 23 68t56 61.5t65.5 64.5t55.5 93t23 131t-26.5 145.5t-75.5 118.5q-6 6 -14 11t-12.5 7.5t-10 9.5t-10.5 17h135l135 64h-437q-138 0 -244.5 -38.5t-182.5 -133.5q0 126 81 213t207 87h960 q119 0 203.5 -84.5t84.5 -203.5v-96h-256v256h-128v-256h-256v-128h256v-256h128v256h256z" /> -<glyph unicode="" horiz-adv-x="1664" d="M876 71q0 21 -4.5 40.5t-9.5 36t-17.5 34.5t-21 30.5t-26.5 29.5t-27.5 25.5t-32 25.5t-31 23t-33 23t-30.5 21q-17 2 -50 2q-54 0 -106 -7t-108 -25t-98 -46t-69 -75t-27 -107q0 -68 35.5 -121.5t93 -84t120.5 -45.5t127 -15q59 0 112.5 12.5t100.5 39t74.5 73.5 t27.5 110zM756 933q0 60 -16.5 127.5t-47 130.5t-84 104t-119.5 41q-93 0 -144 -69t-51 -165q0 -47 11.5 -99t35.5 -104t56 -93.5t78 -67.5t97 -26q97 0 140.5 60.5t43.5 160.5zM625 1408h437l-135 -79h-135q71 -45 110 -126t39 -169q0 -74 -23 -131.5t-56 -92.5t-66 -64.5 t-56 -61t-23 -67.5q0 -26 16.5 -51t43 -48t58.5 -48t64 -55.5t58.5 -66t43 -85t16.5 -106.5q0 -160 -140 -282q-152 -131 -420 -131q-59 0 -119.5 10t-122 33.5t-108.5 58t-77 89t-30 121.5q0 61 37 135q32 64 96 110.5t145 71t155 36t150 13.5q-64 83 -64 149q0 12 2 23.5 t5 19.5t8 21.5t7 21.5q-40 -5 -70 -5q-149 0 -255.5 98t-106.5 246q0 140 95 250.5t234 141.5q94 20 187 20zM1664 1152v-128h-256v-256h-128v256h-256v128h256v256h128v-256h256z" /> +<glyph unicode="" d="M829 318q0 -76 -58.5 -112.5t-139.5 -36.5q-41 0 -80.5 9.5t-75.5 28.5t-58 53t-22 78q0 46 25 80t65.5 51.5t82 25t84.5 7.5q20 0 31 -2q2 -1 23 -16.5t26 -19t23 -18t24.5 -22t19 -22.5t17 -26t9 -26.5t4.5 -31.5zM755 863q0 -60 -33 -99.5t-92 -39.5q-53 0 -93 42.5 t-57.5 96.5t-17.5 106q0 61 32 104t92 43q53 0 93.5 -45t58 -101t17.5 -107zM861 1120l88 64h-265q-85 0 -161 -32t-127.5 -98t-51.5 -153q0 -93 64.5 -154.5t158.5 -61.5q22 0 43 3q-13 -29 -13 -54q0 -44 40 -94q-175 -12 -257 -63q-47 -29 -75.5 -73t-28.5 -95 q0 -43 18.5 -77.5t48.5 -56.5t69 -37t77.5 -21t76.5 -6q60 0 120.5 15.5t113.5 46t86 82.5t33 117q0 49 -20 89.5t-49 66.5t-58 47.5t-49 44t-20 44.5t15.5 42.5t37.5 39.5t44 42t37.5 59.5t15.5 82.5q0 60 -22.5 99.5t-72.5 90.5h83zM1152 672h128v64h-128v128h-64v-128 h-128v-64h128v-160h64v160zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" /> +<glyph unicode="" horiz-adv-x="1664" d="M735 740q0 -36 32 -70.5t77.5 -68t90.5 -73.5t77 -104t32 -142q0 -90 -48 -173q-72 -122 -211 -179.5t-298 -57.5q-132 0 -246.5 41.5t-171.5 137.5q-37 60 -37 131q0 81 44.5 150t118.5 115q131 82 404 100q-32 42 -47.5 74t-15.5 73q0 36 21 85q-46 -4 -68 -4 q-148 0 -249.5 96.5t-101.5 244.5q0 82 36 159t99 131q77 66 182.5 98t217.5 32h418l-138 -88h-131q74 -63 112 -133t38 -160q0 -72 -24.5 -129.5t-59 -93t-69.5 -65t-59.5 -61.5t-24.5 -66zM589 836q38 0 78 16.5t66 43.5q53 57 53 159q0 58 -17 125t-48.5 129.5 t-84.5 103.5t-117 41q-42 0 -82.5 -19.5t-65.5 -52.5q-47 -59 -47 -160q0 -46 10 -97.5t31.5 -103t52 -92.5t75 -67t96.5 -26zM591 -37q58 0 111.5 13t99 39t73 73t27.5 109q0 25 -7 49t-14.5 42t-27 41.5t-29.5 35t-38.5 34.5t-36.5 29t-41.5 30t-36.5 26q-16 2 -48 2 q-53 0 -105 -7t-107.5 -25t-97 -46t-68.5 -74.5t-27 -105.5q0 -70 35 -123.5t91.5 -83t119 -44t127.5 -14.5zM1401 839h213v-108h-213v-219h-105v219h-212v108h212v217h105v-217z" /> <glyph unicode="" horiz-adv-x="1920" d="M768 384h384v96h-128v448h-114l-148 -137l77 -80q42 37 55 57h2v-288h-128v-96zM1280 640q0 -70 -21 -142t-59.5 -134t-101.5 -101t-138 -39t-138 39t-101.5 101t-59.5 134t-21 142t21 142t59.5 134t101.5 101t138 39t138 -39t101.5 -101t59.5 -134t21 -142zM1792 384 v512q-106 0 -181 75t-75 181h-1152q0 -106 -75 -181t-181 -75v-512q106 0 181 -75t75 -181h1152q0 106 75 181t181 75zM1920 1216v-1152q0 -26 -19 -45t-45 -19h-1792q-26 0 -45 19t-19 45v1152q0 26 19 45t45 19h1792q26 0 45 -19t19 -45z" /> <glyph unicode="" horiz-adv-x="1024" d="M1024 832q0 -26 -19 -45l-448 -448q-19 -19 -45 -19t-45 19l-448 448q-19 19 -19 45t19 45t45 19h896q26 0 45 -19t19 -45z" /> <glyph unicode="" horiz-adv-x="1024" d="M1024 320q0 -26 -19 -45t-45 -19h-896q-26 0 -45 19t-19 45t19 45l448 448q19 19 45 19t45 -19l448 -448q19 -19 19 -45z" /> @@ -247,10 +248,10 @@ <glyph unicode="" horiz-adv-x="1408" d="M384 192q0 -26 -19 -45t-45 -19t-45 19t-19 45t19 45t45 19t45 -19t19 -45zM1408 131q0 -121 -73 -190t-194 -69h-874q-121 0 -194 69t-73 190q0 68 5.5 131t24 138t47.5 132.5t81 103t120 60.5q-22 -52 -22 -120v-203q-58 -20 -93 -70t-35 -111q0 -80 56 -136t136 -56 t136 56t56 136q0 61 -35.5 111t-92.5 70v203q0 62 25 93q132 -104 295 -104t295 104q25 -31 25 -93v-64q-106 0 -181 -75t-75 -181v-89q-32 -29 -32 -71q0 -40 28 -68t68 -28t68 28t28 68q0 42 -32 71v89q0 52 38 90t90 38t90 -38t38 -90v-89q-32 -29 -32 -71q0 -40 28 -68 t68 -28t68 28t28 68q0 42 -32 71v89q0 68 -34.5 127.5t-93.5 93.5q0 10 0.5 42.5t0 48t-2.5 41.5t-7 47t-13 40q68 -15 120 -60.5t81 -103t47.5 -132.5t24 -138t5.5 -131zM1088 1024q0 -159 -112.5 -271.5t-271.5 -112.5t-271.5 112.5t-112.5 271.5t112.5 271.5t271.5 112.5 t271.5 -112.5t112.5 -271.5z" /> <glyph unicode="" horiz-adv-x="1408" d="M1280 832q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1408 832q0 -62 -35.5 -111t-92.5 -70v-395q0 -159 -131.5 -271.5t-316.5 -112.5t-316.5 112.5t-131.5 271.5v132q-164 20 -274 128t-110 252v512q0 26 19 45t45 19q6 0 16 -2q17 30 47 48 t65 18q53 0 90.5 -37.5t37.5 -90.5t-37.5 -90.5t-90.5 -37.5q-33 0 -64 18v-402q0 -106 94 -181t226 -75t226 75t94 181v402q-31 -18 -64 -18q-53 0 -90.5 37.5t-37.5 90.5t37.5 90.5t90.5 37.5q35 0 65 -18t47 -48q10 2 16 2q26 0 45 -19t19 -45v-512q0 -144 -110 -252 t-274 -128v-132q0 -106 94 -181t226 -75t226 75t94 181v395q-57 21 -92.5 70t-35.5 111q0 80 56 136t136 56t136 -56t56 -136z" /> <glyph unicode="" horiz-adv-x="1792" d="M640 1152h512v128h-512v-128zM288 1152v-1280h-64q-92 0 -158 66t-66 158v832q0 92 66 158t158 66h64zM1408 1152v-1280h-1024v1280h128v160q0 40 28 68t68 28h576q40 0 68 -28t28 -68v-160h128zM1792 928v-832q0 -92 -66 -158t-158 -66h-64v1280h64q92 0 158 -66 t66 -158z" /> -<glyph unicode="" horiz-adv-x="1664" d="M848 -160q0 16 -16 16q-59 0 -101.5 42.5t-42.5 101.5q0 16 -16 16t-16 -16q0 -73 51.5 -124.5t124.5 -51.5q16 0 16 16zM1664 128q0 -52 -38 -90t-90 -38h-448q0 -106 -75 -181t-181 -75t-181 75t-75 181h-448q-52 0 -90 38t-38 90q190 161 287 397.5t97 498.5 q0 165 96 262t264 117q-8 18 -8 37q0 40 28 68t68 28t68 -28t28 -68q0 -19 -8 -37q168 -20 264 -117t96 -262q0 -262 97 -498.5t287 -397.5z" /> +<glyph unicode="" horiz-adv-x="1792" d="M912 -160q0 16 -16 16q-59 0 -101.5 42.5t-42.5 101.5q0 16 -16 16t-16 -16q0 -73 51.5 -124.5t124.5 -51.5q16 0 16 16zM1728 128q0 -52 -38 -90t-90 -38h-448q0 -106 -75 -181t-181 -75t-181 75t-75 181h-448q-52 0 -90 38t-38 90q50 42 91 88t85 119.5t74.5 158.5 t50 206t19.5 260q0 152 117 282.5t307 158.5q-8 19 -8 39q0 40 28 68t68 28t68 -28t28 -68q0 -20 -8 -39q190 -28 307 -158.5t117 -282.5q0 -139 19.5 -260t50 -206t74.5 -158.5t85 -119.5t91 -88z" /> <glyph unicode="" horiz-adv-x="1920" d="M1664 896q0 80 -56 136t-136 56h-64v-384h64q80 0 136 56t56 136zM0 128h1792q0 -106 -75 -181t-181 -75h-1280q-106 0 -181 75t-75 181zM1856 896q0 -159 -112.5 -271.5t-271.5 -112.5h-64v-32q0 -92 -66 -158t-158 -66h-704q-92 0 -158 66t-66 158v736q0 26 19 45 t45 19h1152q159 0 271.5 -112.5t112.5 -271.5z" /> <glyph unicode="" horiz-adv-x="1408" d="M640 1472v-640q0 -61 -35.5 -111t-92.5 -70v-779q0 -52 -38 -90t-90 -38h-128q-52 0 -90 38t-38 90v779q-57 20 -92.5 70t-35.5 111v640q0 26 19 45t45 19t45 -19t19 -45v-416q0 -26 19 -45t45 -19t45 19t19 45v416q0 26 19 45t45 19t45 -19t19 -45v-416q0 -26 19 -45 t45 -19t45 19t19 45v416q0 26 19 45t45 19t45 -19t19 -45zM1408 1472v-1600q0 -52 -38 -90t-90 -38h-128q-52 0 -90 38t-38 90v512h-224q-13 0 -22.5 9.5t-9.5 22.5v800q0 132 94 226t226 94h256q26 0 45 -19t19 -45z" /> -<glyph unicode="" horiz-adv-x="1280" d="M1024 352v-64q0 -14 -9 -23t-23 -9h-704q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h704q14 0 23 -9t9 -23zM1024 608v-64q0 -14 -9 -23t-23 -9h-704q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h704q14 0 23 -9t9 -23zM128 0h1024v768h-416q-40 0 -68 28t-28 68v416h-512v-1280z M768 896h376q-10 29 -22 41l-313 313q-12 12 -41 22v-376zM1280 864v-896q0 -40 -28 -68t-68 -28h-1088q-40 0 -68 28t-28 68v1344q0 40 28 68t68 28h640q40 0 88 -20t76 -48l312 -312q28 -28 48 -76t20 -88z" /> +<glyph unicode="" d="M1468 1156q28 -28 48 -76t20 -88v-1152q0 -40 -28 -68t-68 -28h-1344q-40 0 -68 28t-28 68v1600q0 40 28 68t68 28h896q40 0 88 -20t76 -48zM1024 1400v-376h376q-10 29 -22 41l-313 313q-12 12 -41 22zM1408 -128v1024h-416q-40 0 -68 28t-28 68v416h-768v-1536h1280z M384 736q0 14 9 23t23 9h704q14 0 23 -9t9 -23v-64q0 -14 -9 -23t-23 -9h-704q-14 0 -23 9t-9 23v64zM1120 512q14 0 23 -9t9 -23v-64q0 -14 -9 -23t-23 -9h-704q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h704zM1120 256q14 0 23 -9t9 -23v-64q0 -14 -9 -23t-23 -9h-704 q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h704z" /> <glyph unicode="" horiz-adv-x="1408" d="M384 224v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM384 480v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M640 480v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM384 736v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M1152 224v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM896 480v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M640 736v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM384 992v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M1152 480v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM896 736v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M640 992v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM384 1248v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M1152 736v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM896 992v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M640 1248v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM1152 992v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M896 1248v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM1152 1248v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M896 -128h384v1536h-1152v-1536h384v224q0 13 9.5 22.5t22.5 9.5h320q13 0 22.5 -9.5t9.5 -22.5v-224zM1408 1472v-1664q0 -26 -19 -45t-45 -19h-1280q-26 0 -45 19t-19 45v1664q0 26 19 45t45 19h1280q26 0 45 -19t19 -45z" /> <glyph unicode="" horiz-adv-x="1408" d="M384 224v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM384 480v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M640 480v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM384 736v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M1152 224v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM896 480v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M640 736v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM1152 480v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M896 736v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM1152 736v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M896 -128h384v1152h-256v-32q0 -40 -28 -68t-68 -28h-448q-40 0 -68 28t-28 68v32h-256v-1152h384v224q0 13 9.5 22.5t22.5 9.5h320q13 0 22.5 -9.5t9.5 -22.5v-224zM896 1056v320q0 13 -9.5 22.5t-22.5 9.5h-64q-13 0 -22.5 -9.5t-9.5 -22.5v-96h-128v96q0 13 -9.5 22.5 t-22.5 9.5h-64q-13 0 -22.5 -9.5t-9.5 -22.5v-320q0 -13 9.5 -22.5t22.5 -9.5h64q13 0 22.5 9.5t9.5 22.5v96h128v-96q0 -13 9.5 -22.5t22.5 -9.5h64q13 0 22.5 9.5t9.5 22.5zM1408 1088v-1280q0 -26 -19 -45t-45 -19h-1280q-26 0 -45 19t-19 45v1280q0 26 19 45t45 19h320 v288q0 40 28 68t68 28h448q40 0 68 -28t28 -68v-288h320q26 0 45 -19t19 -45z" /> <glyph unicode="" horiz-adv-x="1920" d="M640 128q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM256 640h384v256h-158q-14 -2 -22 -9l-195 -195q-7 -12 -9 -22v-30zM1536 128q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5 t90.5 37.5t37.5 90.5zM1664 800v192q0 14 -9 23t-23 9h-224v224q0 14 -9 23t-23 9h-192q-14 0 -23 -9t-9 -23v-224h-224q-14 0 -23 -9t-9 -23v-192q0 -14 9 -23t23 -9h224v-224q0 -14 9 -23t23 -9h192q14 0 23 9t9 23v224h224q14 0 23 9t9 23zM1920 1344v-1152 q0 -26 -19 -45t-45 -19h-192q0 -106 -75 -181t-181 -75t-181 75t-75 181h-384q0 -106 -75 -181t-181 -75t-181 75t-75 181h-128q-26 0 -45 19t-19 45t19 45t45 19v416q0 26 13 58t32 51l198 198q19 19 51 32t58 13h160v320q0 26 19 45t45 19h1152q26 0 45 -19t19 -45z" /> @@ -274,7 +275,7 @@ <glyph unicode="" d="M768 1184q-148 0 -273 -73t-198 -198t-73 -273t73 -273t198 -198t273 -73t273 73t198 198t73 273t-73 273t-198 198t-273 73zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103 t279.5 -279.5t103 -385.5z" /> <glyph unicode="" horiz-adv-x="1664" d="M768 576v-384q0 -80 -56 -136t-136 -56h-384q-80 0 -136 56t-56 136v704q0 104 40.5 198.5t109.5 163.5t163.5 109.5t198.5 40.5h64q26 0 45 -19t19 -45v-128q0 -26 -19 -45t-45 -19h-64q-106 0 -181 -75t-75 -181v-32q0 -40 28 -68t68 -28h224q80 0 136 -56t56 -136z M1664 576v-384q0 -80 -56 -136t-136 -56h-384q-80 0 -136 56t-56 136v704q0 104 40.5 198.5t109.5 163.5t163.5 109.5t198.5 40.5h64q26 0 45 -19t19 -45v-128q0 -26 -19 -45t-45 -19h-64q-106 0 -181 -75t-75 -181v-32q0 -40 28 -68t68 -28h224q80 0 136 -56t56 -136z" /> <glyph unicode="" horiz-adv-x="1664" d="M768 1216v-704q0 -104 -40.5 -198.5t-109.5 -163.5t-163.5 -109.5t-198.5 -40.5h-64q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h64q106 0 181 75t75 181v32q0 40 -28 68t-68 28h-224q-80 0 -136 56t-56 136v384q0 80 56 136t136 56h384q80 0 136 -56t56 -136zM1664 1216 v-704q0 -104 -40.5 -198.5t-109.5 -163.5t-163.5 -109.5t-198.5 -40.5h-64q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h64q106 0 181 75t75 181v32q0 40 -28 68t-68 28h-224q-80 0 -136 56t-56 136v384q0 80 56 136t136 56h384q80 0 136 -56t56 -136z" /> -<glyph unicode="" horiz-adv-x="1568" d="M496 192q0 -60 -42.5 -102t-101.5 -42q-60 0 -102 42t-42 102t42 102t102 42q59 0 101.5 -42t42.5 -102zM928 0q0 -53 -37.5 -90.5t-90.5 -37.5t-90.5 37.5t-37.5 90.5t37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM320 640q0 -66 -47 -113t-113 -47t-113 47t-47 113 t47 113t113 47t113 -47t47 -113zM1360 192q0 -46 -33 -79t-79 -33t-79 33t-33 79t33 79t79 33t79 -33t33 -79zM528 1088q0 -73 -51.5 -124.5t-124.5 -51.5t-124.5 51.5t-51.5 124.5t51.5 124.5t124.5 51.5t124.5 -51.5t51.5 -124.5zM992 1280q0 -80 -56 -136t-136 -56 t-136 56t-56 136t56 136t136 56t136 -56t56 -136zM1536 640q0 -40 -28 -68t-68 -28t-68 28t-28 68t28 68t68 28t68 -28t28 -68zM1328 1088q0 -33 -23.5 -56.5t-56.5 -23.5t-56.5 23.5t-23.5 56.5t23.5 56.5t56.5 23.5t56.5 -23.5t23.5 -56.5z" /> +<glyph unicode="" horiz-adv-x="1792" d="M526 142q0 -53 -37.5 -90.5t-90.5 -37.5q-52 0 -90 38t-38 90q0 53 37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM1024 -64q0 -53 -37.5 -90.5t-90.5 -37.5t-90.5 37.5t-37.5 90.5t37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM320 640q0 -53 -37.5 -90.5t-90.5 -37.5 t-90.5 37.5t-37.5 90.5t37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM1522 142q0 -52 -38 -90t-90 -38q-53 0 -90.5 37.5t-37.5 90.5t37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM558 1138q0 -66 -47 -113t-113 -47t-113 47t-47 113t47 113t113 47t113 -47t47 -113z M1728 640q0 -53 -37.5 -90.5t-90.5 -37.5t-90.5 37.5t-37.5 90.5t37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM1088 1344q0 -80 -56 -136t-136 -56t-136 56t-56 136t56 136t136 56t136 -56t56 -136zM1618 1138q0 -93 -66 -158.5t-158 -65.5q-93 0 -158.5 65.5t-65.5 158.5 q0 92 65.5 158t158.5 66q92 0 158 -66t66 -158z" /> <glyph unicode="" d="M1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" /> <glyph unicode="" horiz-adv-x="1792" d="M1792 416q0 -166 -127 -451q-3 -7 -10.5 -24t-13.5 -30t-13 -22q-12 -17 -28 -17q-15 0 -23.5 10t-8.5 25q0 9 2.5 26.5t2.5 23.5q5 68 5 123q0 101 -17.5 181t-48.5 138.5t-80 101t-105.5 69.5t-133 42.5t-154 21.5t-175.5 6h-224v-256q0 -26 -19 -45t-45 -19t-45 19 l-512 512q-19 19 -19 45t19 45l512 512q19 19 45 19t45 -19t19 -45v-256h224q713 0 875 -403q53 -134 53 -333z" /> <glyph unicode="" horiz-adv-x="1664" d="M640 320q0 -40 -12.5 -82t-43 -76t-72.5 -34t-72.5 34t-43 76t-12.5 82t12.5 82t43 76t72.5 34t72.5 -34t43 -76t12.5 -82zM1280 320q0 -40 -12.5 -82t-43 -76t-72.5 -34t-72.5 34t-43 76t-12.5 82t12.5 82t43 76t72.5 34t72.5 -34t43 -76t12.5 -82zM1440 320 q0 120 -69 204t-187 84q-41 0 -195 -21q-71 -11 -157 -11t-157 11q-152 21 -195 21q-118 0 -187 -84t-69 -204q0 -88 32 -153.5t81 -103t122 -60t140 -29.5t149 -7h168q82 0 149 7t140 29.5t122 60t81 103t32 153.5zM1664 496q0 -207 -61 -331q-38 -77 -105.5 -133t-141 -86 t-170 -47.5t-171.5 -22t-167 -4.5q-78 0 -142 3t-147.5 12.5t-152.5 30t-137 51.5t-121 81t-86 115q-62 123 -62 331q0 237 136 396q-27 82 -27 170q0 116 51 218q108 0 190 -39.5t189 -123.5q147 35 309 35q148 0 280 -32q105 82 187 121t189 39q51 -102 51 -218 q0 -87 -27 -168q136 -160 136 -398z" /> @@ -345,8 +346,8 @@ <glyph unicode="" horiz-adv-x="1280" d="M1043 971q0 100 -65 162t-171 62h-320v-448h320q106 0 171 62t65 162zM1280 971q0 -193 -126.5 -315t-326.5 -122h-340v-118h505q14 0 23 -9t9 -23v-128q0 -14 -9 -23t-23 -9h-505v-192q0 -14 -9.5 -23t-22.5 -9h-167q-14 0 -23 9t-9 23v192h-224q-14 0 -23 9t-9 23v128 q0 14 9 23t23 9h224v118h-224q-14 0 -23 9t-9 23v149q0 13 9 22.5t23 9.5h224v629q0 14 9 23t23 9h539q200 0 326.5 -122t126.5 -315z" /> <glyph unicode="" horiz-adv-x="1792" d="M514 341l81 299h-159l75 -300q1 -1 1 -3t1 -3q0 1 0.5 3.5t0.5 3.5zM630 768l35 128h-292l32 -128h225zM822 768h139l-35 128h-70zM1271 340l78 300h-162l81 -299q0 -1 0.5 -3.5t1.5 -3.5q0 1 0.5 3t0.5 3zM1382 768l33 128h-297l34 -128h230zM1792 736v-64q0 -14 -9 -23 t-23 -9h-213l-164 -616q-7 -24 -31 -24h-159q-24 0 -31 24l-166 616h-209l-167 -616q-7 -24 -31 -24h-159q-11 0 -19.5 7t-10.5 17l-160 616h-208q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h175l-33 128h-142q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h109l-89 344q-5 15 5 28 q10 12 26 12h137q26 0 31 -24l90 -360h359l97 360q7 24 31 24h126q24 0 31 -24l98 -360h365l93 360q5 24 31 24h137q16 0 26 -12q10 -13 5 -28l-91 -344h111q14 0 23 -9t9 -23v-64q0 -14 -9 -23t-23 -9h-145l-34 -128h179q14 0 23 -9t9 -23z" /> <glyph unicode="" horiz-adv-x="1280" d="M1167 896q18 -182 -131 -258q117 -28 175 -103t45 -214q-7 -71 -32.5 -125t-64.5 -89t-97 -58.5t-121.5 -34.5t-145.5 -15v-255h-154v251q-80 0 -122 1v-252h-154v255q-18 0 -54 0.5t-55 0.5h-200l31 183h111q50 0 58 51v402h16q-6 1 -16 1v287q-13 68 -89 68h-111v164 l212 -1q64 0 97 1v252h154v-247q82 2 122 2v245h154v-252q79 -7 140 -22.5t113 -45t82.5 -78t36.5 -114.5zM952 351q0 36 -15 64t-37 46t-57.5 30.5t-65.5 18.5t-74 9t-69 3t-64.5 -1t-47.5 -1v-338q8 0 37 -0.5t48 -0.5t53 1.5t58.5 4t57 8.5t55.5 14t47.5 21t39.5 30 t24.5 40t9.5 51zM881 827q0 33 -12.5 58.5t-30.5 42t-48 28t-55 16.5t-61.5 8t-58 2.5t-54 -1t-39.5 -0.5v-307q5 0 34.5 -0.5t46.5 0t50 2t55 5.5t51.5 11t48.5 18.5t37 27t27 38.5t9 51z" /> -<glyph unicode="" horiz-adv-x="1280" d="M1280 768v-800q0 -40 -28 -68t-68 -28h-1088q-40 0 -68 28t-28 68v1344q0 40 28 68t68 28h544v-544q0 -40 28 -68t68 -28h544zM1277 896h-509v509q82 -15 132 -65l312 -312q50 -50 65 -132z" /> -<glyph unicode="" horiz-adv-x="1280" d="M1024 160v64q0 14 -9 23t-23 9h-704q-14 0 -23 -9t-9 -23v-64q0 -14 9 -23t23 -9h704q14 0 23 9t9 23zM1024 416v64q0 14 -9 23t-23 9h-704q-14 0 -23 -9t-9 -23v-64q0 -14 9 -23t23 -9h704q14 0 23 9t9 23zM1280 768v-800q0 -40 -28 -68t-68 -28h-1088q-40 0 -68 28 t-28 68v1344q0 40 28 68t68 28h544v-544q0 -40 28 -68t68 -28h544zM1277 896h-509v509q82 -15 132 -65l312 -312q50 -50 65 -132z" /> +<glyph unicode="" d="M1024 1024v472q22 -14 36 -28l408 -408q14 -14 28 -36h-472zM896 992q0 -40 28 -68t68 -28h544v-1056q0 -40 -28 -68t-68 -28h-1344q-40 0 -68 28t-28 68v1600q0 40 28 68t68 28h800v-544z" /> +<glyph unicode="" d="M1468 1060q14 -14 28 -36h-472v472q22 -14 36 -28zM992 896h544v-1056q0 -40 -28 -68t-68 -28h-1344q-40 0 -68 28t-28 68v1600q0 40 28 68t68 28h800v-544q0 -40 28 -68t68 -28zM1152 160v64q0 14 -9 23t-23 9h-704q-14 0 -23 -9t-9 -23v-64q0 -14 9 -23t23 -9h704 q14 0 23 9t9 23zM1152 416v64q0 14 -9 23t-23 9h-704q-14 0 -23 -9t-9 -23v-64q0 -14 9 -23t23 -9h704q14 0 23 9t9 23zM1152 672v64q0 14 -9 23t-23 9h-704q-14 0 -23 -9t-9 -23v-64q0 -14 9 -23t23 -9h704q14 0 23 9t9 23z" /> <glyph unicode="" horiz-adv-x="1664" d="M1191 1128h177l-72 218l-12 47q-2 16 -2 20h-4l-3 -20q0 -1 -3.5 -18t-7.5 -29zM736 96q0 -12 -10 -24l-319 -319q-10 -9 -23 -9q-12 0 -23 9l-320 320q-15 16 -7 35q8 20 30 20h192v1376q0 14 9 23t23 9h192q14 0 23 -9t9 -23v-1376h192q14 0 23 -9t9 -23zM1572 -23 v-233h-584v90l369 529q12 18 21 27l11 9v3q-2 0 -6.5 -0.5t-7.5 -0.5q-12 -3 -30 -3h-232v-115h-120v229h567v-89l-369 -530q-6 -8 -21 -26l-11 -11v-2l14 2q9 2 30 2h248v119h121zM1661 874v-106h-288v106h75l-47 144h-243l-47 -144h75v-106h-287v106h70l230 662h162 l230 -662h70z" /> <glyph unicode="" horiz-adv-x="1664" d="M1191 104h177l-72 218l-12 47q-2 16 -2 20h-4l-3 -20q0 -1 -3.5 -18t-7.5 -29zM736 96q0 -12 -10 -24l-319 -319q-10 -9 -23 -9q-12 0 -23 9l-320 320q-15 16 -7 35q8 20 30 20h192v1376q0 14 9 23t23 9h192q14 0 23 -9t9 -23v-1376h192q14 0 23 -9t9 -23zM1661 -150 v-106h-288v106h75l-47 144h-243l-47 -144h75v-106h-287v106h70l230 662h162l230 -662h70zM1572 1001v-233h-584v90l369 529q12 18 21 27l11 9v3q-2 0 -6.5 -0.5t-7.5 -0.5q-12 -3 -30 -3h-232v-115h-120v229h567v-89l-369 -530q-6 -8 -21 -26l-11 -10v-3l14 3q9 1 30 1h248 v119h121z" /> <glyph unicode="" horiz-adv-x="1792" d="M736 96q0 -12 -10 -24l-319 -319q-10 -9 -23 -9q-12 0 -23 9l-320 320q-15 16 -7 35q8 20 30 20h192v1376q0 14 9 23t23 9h192q14 0 23 -9t9 -23v-1376h192q14 0 23 -9t9 -23zM1792 -32v-192q0 -14 -9 -23t-23 -9h-832q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h832 q14 0 23 -9t9 -23zM1600 480v-192q0 -14 -9 -23t-23 -9h-640q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h640q14 0 23 -9t9 -23zM1408 992v-192q0 -14 -9 -23t-23 -9h-448q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h448q14 0 23 -9t9 -23zM1216 1504v-192q0 -14 -9 -23t-23 -9h-256 q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h256q14 0 23 -9t9 -23z" /> @@ -367,8 +368,8 @@ <glyph unicode="" d="M768 914l201 -306h-402zM1133 384h94l-459 691l-459 -691h94l104 160h522zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" /> <glyph unicode="" horiz-adv-x="1408" d="M815 677q8 -63 -50.5 -101t-111.5 -6q-39 17 -53.5 58t-0.5 82t52 58q36 18 72.5 12t64 -35.5t27.5 -67.5zM926 698q-14 107 -113 164t-197 13q-63 -28 -100.5 -88.5t-34.5 -129.5q4 -91 77.5 -155t165.5 -56q91 8 152 84t50 168zM1165 1240q-20 27 -56 44.5t-58 22 t-71 12.5q-291 47 -566 -2q-43 -7 -66 -12t-55 -22t-50 -43q30 -28 76 -45.5t73.5 -22t87.5 -11.5q228 -29 448 -1q63 8 89.5 12t72.5 21.5t75 46.5zM1222 205q-8 -26 -15.5 -76.5t-14 -84t-28.5 -70t-58 -56.5q-86 -48 -189.5 -71.5t-202 -22t-201.5 18.5q-46 8 -81.5 18 t-76.5 27t-73 43.5t-52 61.5q-25 96 -57 292l6 16l18 9q223 -148 506.5 -148t507.5 148q21 -6 24 -23t-5 -45t-8 -37zM1403 1166q-26 -167 -111 -655q-5 -30 -27 -56t-43.5 -40t-54.5 -31q-252 -126 -610 -88q-248 27 -394 139q-15 12 -25.5 26.5t-17 35t-9 34t-6 39.5 t-5.5 35q-9 50 -26.5 150t-28 161.5t-23.5 147.5t-22 158q3 26 17.5 48.5t31.5 37.5t45 30t46 22.5t48 18.5q125 46 313 64q379 37 676 -50q155 -46 215 -122q16 -20 16.5 -51t-5.5 -54z" /> <glyph unicode="" d="M848 666q0 43 -41 66t-77 1q-43 -20 -42.5 -72.5t43.5 -70.5q39 -23 81 4t36 72zM928 682q8 -66 -36 -121t-110 -61t-119 40t-56 113q-2 49 25.5 93t72.5 64q70 31 141.5 -10t81.5 -118zM1100 1073q-20 -21 -53.5 -34t-53 -16t-63.5 -8q-155 -20 -324 0q-44 6 -63 9.5 t-52.5 16t-54.5 32.5q13 19 36 31t40 15.5t47 8.5q198 35 408 1q33 -5 51 -8.5t43 -16t39 -31.5zM1142 327q0 7 5.5 26.5t3 32t-17.5 16.5q-161 -106 -365 -106t-366 106l-12 -6l-5 -12q26 -154 41 -210q47 -81 204 -108q249 -46 428 53q34 19 49 51.5t22.5 85.5t12.5 71z M1272 1020q9 53 -8 75q-43 55 -155 88q-216 63 -487 36q-132 -12 -226 -46q-38 -15 -59.5 -25t-47 -34t-29.5 -54q8 -68 19 -138t29 -171t24 -137q1 -5 5 -31t7 -36t12 -27t22 -28q105 -80 284 -100q259 -28 440 63q24 13 39.5 23t31 29t19.5 40q48 267 80 473zM1536 1120 v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" /> -<glyph unicode="" horiz-adv-x="1024" d="M390 1408h219v-388h364v-241h-364v-394q0 -136 14 -172q13 -37 52 -60q50 -31 117 -31q117 0 232 76v-242q-102 -48 -178 -65q-77 -19 -173 -19q-105 0 -186 27q-78 25 -138 75q-58 51 -79 105q-22 54 -22 161v539h-170v217q91 30 155 84q64 55 103 132q39 78 54 196z " /> -<glyph unicode="" d="M1123 127v181q-88 -56 -174 -56q-51 0 -88 23q-29 17 -39 45q-11 30 -11 129v295h274v181h-274v291h-164q-11 -90 -40 -147t-78 -99q-48 -40 -116 -63v-163h127v-404q0 -78 17 -121q17 -42 59 -78q43 -37 104 -57q62 -20 140 -20q67 0 129 14q57 13 134 49zM1536 1120 v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" /> +<glyph unicode="" horiz-adv-x="1024" d="M944 207l80 -237q-23 -35 -111 -66t-177 -32q-104 -2 -190.5 26t-142.5 74t-95 106t-55.5 120t-16.5 118v544h-168v215q72 26 129 69.5t91 90t58 102t34 99t15 88.5q1 5 4.5 8.5t7.5 3.5h244v-424h333v-252h-334v-518q0 -30 6.5 -56t22.5 -52.5t49.5 -41.5t81.5 -14 q78 2 134 29z" /> +<glyph unicode="" d="M1136 75l-62 183q-44 -22 -103 -22q-36 -1 -62 10.5t-38.5 31.5t-17.5 40.5t-5 43.5v398h257v194h-256v326h-188q-8 0 -9 -10q-5 -44 -17.5 -87t-39 -95t-77 -95t-118.5 -68v-165h130v-418q0 -57 21.5 -115t65 -111t121 -85.5t176.5 -30.5q69 1 136.5 25t85.5 50z M1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" /> <glyph unicode="" horiz-adv-x="768" d="M765 237q8 -19 -5 -35l-350 -384q-10 -10 -23 -10q-14 0 -24 10l-355 384q-13 16 -5 35q9 19 29 19h224v1248q0 14 9 23t23 9h192q14 0 23 -9t9 -23v-1248h224q21 0 29 -19z" /> <glyph unicode="" horiz-adv-x="768" d="M765 1043q-9 -19 -29 -19h-224v-1248q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23v1248h-224q-21 0 -29 19t5 35l350 384q10 10 23 10q14 0 24 -10l355 -384q13 -16 5 -35z" /> <glyph unicode="" horiz-adv-x="1792" d="M1792 736v-192q0 -14 -9 -23t-23 -9h-1248v-224q0 -21 -19 -29t-35 5l-384 350q-10 10 -10 23q0 14 10 24l384 354q16 14 35 6q19 -9 19 -29v-224h1248q14 0 23 -9t9 -23z" /> @@ -379,7 +380,7 @@ <glyph unicode="" d="M663 1125q-11 -1 -15.5 -10.5t-8.5 -9.5q-5 -1 -5 5q0 12 19 15h10zM750 1111q-4 -1 -11.5 6.5t-17.5 4.5q24 11 32 -2q3 -6 -3 -9zM399 684q-4 1 -6 -3t-4.5 -12.5t-5.5 -13.5t-10 -13q-7 -10 -1 -12q4 -1 12.5 7t12.5 18q1 3 2 7t2 6t1.5 4.5t0.5 4v3t-1 2.5t-3 2z M1254 325q0 18 -55 42q4 15 7.5 27.5t5 26t3 21.5t0.5 22.5t-1 19.5t-3.5 22t-4 20.5t-5 25t-5.5 26.5q-10 48 -47 103t-72 75q24 -20 57 -83q87 -162 54 -278q-11 -40 -50 -42q-31 -4 -38.5 18.5t-8 83.5t-11.5 107q-9 39 -19.5 69t-19.5 45.5t-15.5 24.5t-13 15t-7.5 7 q-14 62 -31 103t-29.5 56t-23.5 33t-15 40q-4 21 6 53.5t4.5 49.5t-44.5 25q-15 3 -44.5 18t-35.5 16q-8 1 -11 26t8 51t36 27q37 3 51 -30t4 -58q-11 -19 -2 -26.5t30 -0.5q13 4 13 36v37q-5 30 -13.5 50t-21 30.5t-23.5 15t-27 7.5q-107 -8 -89 -134q0 -15 -1 -15 q-9 9 -29.5 10.5t-33 -0.5t-15.5 5q1 57 -16 90t-45 34q-27 1 -41.5 -27.5t-16.5 -59.5q-1 -15 3.5 -37t13 -37.5t15.5 -13.5q10 3 16 14q4 9 -7 8q-7 0 -15.5 14.5t-9.5 33.5q-1 22 9 37t34 14q17 0 27 -21t9.5 -39t-1.5 -22q-22 -15 -31 -29q-8 -12 -27.5 -23.5 t-20.5 -12.5q-13 -14 -15.5 -27t7.5 -18q14 -8 25 -19.5t16 -19t18.5 -13t35.5 -6.5q47 -2 102 15q2 1 23 7t34.5 10.5t29.5 13t21 17.5q9 14 20 8q5 -3 6.5 -8.5t-3 -12t-16.5 -9.5q-20 -6 -56.5 -21.5t-45.5 -19.5q-44 -19 -70 -23q-25 -5 -79 2q-10 2 -9 -2t17 -19 q25 -23 67 -22q17 1 36 7t36 14t33.5 17.5t30 17t24.5 12t17.5 2.5t8.5 -11q0 -2 -1 -4.5t-4 -5t-6 -4.5t-8.5 -5t-9 -4.5t-10 -5t-9.5 -4.5q-28 -14 -67.5 -44t-66.5 -43t-49 -1q-21 11 -63 73q-22 31 -25 22q-1 -3 -1 -10q0 -25 -15 -56.5t-29.5 -55.5t-21 -58t11.5 -63 q-23 -6 -62.5 -90t-47.5 -141q-2 -18 -1.5 -69t-5.5 -59q-8 -24 -29 -3q-32 31 -36 94q-2 28 4 56q4 19 -1 18l-4 -5q-36 -65 10 -166q5 -12 25 -28t24 -20q20 -23 104 -90.5t93 -76.5q16 -15 17.5 -38t-14 -43t-45.5 -23q8 -15 29 -44.5t28 -54t7 -70.5q46 24 7 92 q-4 8 -10.5 16t-9.5 12t-2 6q3 5 13 9.5t20 -2.5q46 -52 166 -36q133 15 177 87q23 38 34 30q12 -6 10 -52q-1 -25 -23 -92q-9 -23 -6 -37.5t24 -15.5q3 19 14.5 77t13.5 90q2 21 -6.5 73.5t-7.5 97t23 70.5q15 18 51 18q1 37 34.5 53t72.5 10.5t60 -22.5zM626 1152 q3 17 -2.5 30t-11.5 15q-9 2 -9 -7q2 -5 5 -6q10 0 7 -15q-3 -20 8 -20q3 0 3 3zM1045 955q-2 8 -6.5 11.5t-13 5t-14.5 5.5q-5 3 -9.5 8t-7 8t-5.5 6.5t-4 4t-4 -1.5q-14 -16 7 -43.5t39 -31.5q9 -1 14.5 8t3.5 20zM867 1168q0 11 -5 19.5t-11 12.5t-9 3q-14 -1 -7 -7l4 -2 q14 -4 18 -31q0 -3 8 2zM921 1401q0 2 -2.5 5t-9 7t-9.5 6q-15 15 -24 15q-9 -1 -11.5 -7.5t-1 -13t-0.5 -12.5q-1 -4 -6 -10.5t-6 -9t3 -8.5q4 -3 8 0t11 9t15 9q1 1 9 1t15 2t9 7zM1486 60q20 -12 31 -24.5t12 -24t-2.5 -22.5t-15.5 -22t-23.5 -19.5t-30 -18.5 t-31.5 -16.5t-32 -15.5t-27 -13q-38 -19 -85.5 -56t-75.5 -64q-17 -16 -68 -19.5t-89 14.5q-18 9 -29.5 23.5t-16.5 25.5t-22 19.5t-47 9.5q-44 1 -130 1q-19 0 -57 -1.5t-58 -2.5q-44 -1 -79.5 -15t-53.5 -30t-43.5 -28.5t-53.5 -11.5q-29 1 -111 31t-146 43q-19 4 -51 9.5 t-50 9t-39.5 9.5t-33.5 14.5t-17 19.5q-10 23 7 66.5t18 54.5q1 16 -4 40t-10 42.5t-4.5 36.5t10.5 27q14 12 57 14t60 12q30 18 42 35t12 51q21 -73 -32 -106q-32 -20 -83 -15q-34 3 -43 -10q-13 -15 5 -57q2 -6 8 -18t8.5 -18t4.5 -17t1 -22q0 -15 -17 -49t-14 -48 q3 -17 37 -26q20 -6 84.5 -18.5t99.5 -20.5q24 -6 74 -22t82.5 -23t55.5 -4q43 6 64.5 28t23 48t-7.5 58.5t-19 52t-20 36.5q-121 190 -169 242q-68 74 -113 40q-11 -9 -15 15q-3 16 -2 38q1 29 10 52t24 47t22 42q8 21 26.5 72t29.5 78t30 61t39 54q110 143 124 195 q-12 112 -16 310q-2 90 24 151.5t106 104.5q39 21 104 21q53 1 106 -13.5t89 -41.5q57 -42 91.5 -121.5t29.5 -147.5q-5 -95 30 -214q34 -113 133 -218q55 -59 99.5 -163t59.5 -191q8 -49 5 -84.5t-12 -55.5t-20 -22q-10 -2 -23.5 -19t-27 -35.5t-40.5 -33.5t-61 -14 q-18 1 -31.5 5t-22.5 13.5t-13.5 15.5t-11.5 20.5t-9 19.5q-22 37 -41 30t-28 -49t7 -97q20 -70 1 -195q-10 -65 18 -100.5t73 -33t85 35.5q59 49 89.5 66.5t103.5 42.5q53 18 77 36.5t18.5 34.5t-25 28.5t-51.5 23.5q-33 11 -49.5 48t-15 72.5t15.5 47.5q1 -31 8 -56.5 t14.5 -40.5t20.5 -28.5t21 -19t21.5 -13t16.5 -9.5z" /> <glyph unicode="" d="M1024 36q-42 241 -140 498h-2l-2 -1q-16 -6 -43 -16.5t-101 -49t-137 -82t-131 -114.5t-103 -148l-15 11q184 -150 418 -150q132 0 256 52zM839 643q-21 49 -53 111q-311 -93 -673 -93q-1 -7 -1 -21q0 -124 44 -236.5t124 -201.5q50 89 123.5 166.5t142.5 124.5t130.5 81 t99.5 48l37 13q4 1 13 3.5t13 4.5zM732 855q-120 213 -244 378q-138 -65 -234 -186t-128 -272q302 0 606 80zM1416 536q-210 60 -409 29q87 -239 128 -469q111 75 185 189.5t96 250.5zM611 1277q-1 0 -2 -1q1 1 2 1zM1201 1132q-185 164 -433 164q-76 0 -155 -19 q131 -170 246 -382q69 26 130 60.5t96.5 61.5t65.5 57t37.5 40.5zM1424 647q-3 232 -149 410l-1 -1q-9 -12 -19 -24.5t-43.5 -44.5t-71 -60.5t-100 -65t-131.5 -64.5q25 -53 44 -95q2 -6 6.5 -17.5t7.5 -16.5q36 5 74.5 7t73.5 2t69 -1.5t64 -4t56.5 -5.5t48 -6.5t36.5 -6 t25 -4.5zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" /> <glyph unicode="" d="M1173 473q0 50 -19.5 91.5t-48.5 68.5t-73 49t-82.5 34t-87.5 23l-104 24q-30 7 -44 10.5t-35 11.5t-30 16t-16.5 21t-7.5 30q0 77 144 77q43 0 77 -12t54 -28.5t38 -33.5t40 -29t48 -12q47 0 75.5 32t28.5 77q0 55 -56 99.5t-142 67.5t-182 23q-68 0 -132 -15.5 t-119.5 -47t-89 -87t-33.5 -128.5q0 -61 19 -106.5t56 -75.5t80 -48.5t103 -32.5l146 -36q90 -22 112 -36q32 -20 32 -60q0 -39 -40 -64.5t-105 -25.5q-51 0 -91.5 16t-65 38.5t-45.5 45t-46 38.5t-54 16q-50 0 -75.5 -30t-25.5 -75q0 -92 122 -157.5t291 -65.5 q73 0 140 18.5t122.5 53.5t88.5 93.5t33 131.5zM1536 256q0 -159 -112.5 -271.5t-271.5 -112.5q-130 0 -234 80q-77 -16 -150 -16q-143 0 -273.5 55.5t-225 150t-150 225t-55.5 273.5q0 73 16 150q-80 104 -80 234q0 159 112.5 271.5t271.5 112.5q130 0 234 -80 q77 16 150 16q143 0 273.5 -55.5t225 -150t150 -225t55.5 -273.5q0 -73 -16 -150q80 -104 80 -234z" /> -<glyph unicode="" horiz-adv-x="1664" d="M1483 512l-587 -587q-52 -53 -127.5 -53t-128.5 53l-587 587q-53 53 -53 128t53 128l587 587q53 53 128 53t128 -53l265 -265l-398 -399l-188 188q-42 42 -99 42q-59 0 -100 -41l-120 -121q-42 -40 -42 -99q0 -58 42 -100l406 -408q30 -28 67 -37l6 -4h28q60 0 99 41 l619 619l2 -3q53 -53 53 -128t-53 -128zM1406 1138l120 -120q14 -15 14 -36t-14 -36l-730 -730q-17 -15 -37 -15v0q-4 0 -6 1q-18 2 -30 14l-407 408q-14 15 -14 36t14 35l121 120q13 15 35 15t36 -15l252 -252l574 575q15 15 36 15t36 -15z" /> +<glyph unicode="" horiz-adv-x="1280" d="M1000 1102l37 194q5 23 -9 40t-35 17h-712q-23 0 -38.5 -17t-15.5 -37v-1101q0 -7 6 -1l291 352q23 26 38 33.5t48 7.5h239q22 0 37 14.5t18 29.5q24 130 37 191q4 21 -11.5 40t-36.5 19h-294q-29 0 -48 19t-19 48v42q0 29 19 47.5t48 18.5h346q18 0 35 13.5t20 29.5z M1227 1324q-15 -73 -53.5 -266.5t-69.5 -350t-35 -173.5q-6 -22 -9 -32.5t-14 -32.5t-24.5 -33t-38.5 -21t-58 -10h-271q-13 0 -22 -10q-8 -9 -426 -494q-22 -25 -58.5 -28.5t-48.5 5.5q-55 22 -55 98v1410q0 55 38 102.5t120 47.5h888q95 0 127 -53t10 -159zM1227 1324 l-158 -790q4 17 35 173.5t69.5 350t53.5 266.5z" /> <glyph unicode="" d="M704 192v1024q0 14 -9 23t-23 9h-480q-14 0 -23 -9t-9 -23v-1024q0 -14 9 -23t23 -9h480q14 0 23 9t9 23zM1376 576v640q0 14 -9 23t-23 9h-480q-14 0 -23 -9t-9 -23v-640q0 -14 9 -23t23 -9h480q14 0 23 9t9 23zM1536 1344v-1408q0 -26 -19 -45t-45 -19h-1408 q-26 0 -45 19t-19 45v1408q0 26 19 45t45 19h1408q26 0 45 -19t19 -45z" /> <glyph unicode="" horiz-adv-x="1280" d="M1280 480q0 -40 -28 -68t-68 -28q-51 0 -80 43l-227 341h-45v-132l247 -411q9 -15 9 -33q0 -26 -19 -45t-45 -19h-192v-272q0 -46 -33 -79t-79 -33h-160q-46 0 -79 33t-33 79v272h-192q-26 0 -45 19t-19 45q0 18 9 33l247 411v132h-45l-227 -341q-29 -43 -80 -43 q-40 0 -68 28t-28 68q0 29 16 53l256 384q73 107 176 107h384q103 0 176 -107l256 -384q16 -24 16 -53zM864 1280q0 -93 -65.5 -158.5t-158.5 -65.5t-158.5 65.5t-65.5 158.5t65.5 158.5t158.5 65.5t158.5 -65.5t65.5 -158.5z" /> <glyph unicode="" horiz-adv-x="1024" d="M1024 832v-416q0 -40 -28 -68t-68 -28t-68 28t-28 68v352h-64v-912q0 -46 -33 -79t-79 -33t-79 33t-33 79v464h-64v-464q0 -46 -33 -79t-79 -33t-79 33t-33 79v912h-64v-352q0 -40 -28 -68t-68 -28t-68 28t-28 68v416q0 80 56 136t136 56h640q80 0 136 -56t56 -136z M736 1280q0 -93 -65.5 -158.5t-158.5 -65.5t-158.5 65.5t-65.5 158.5t65.5 158.5t158.5 65.5t158.5 -65.5t65.5 -158.5z" /> @@ -401,14 +402,164 @@ <glyph unicode="" d="M1254 899q16 85 -21 132q-52 65 -187 45q-17 -3 -41 -12.5t-57.5 -30.5t-64.5 -48.5t-59.5 -70t-44.5 -91.5q80 7 113.5 -16t26.5 -99q-5 -52 -52 -143q-43 -78 -71 -99q-44 -32 -87 14q-23 24 -37.5 64.5t-19 73t-10 84t-8.5 71.5q-23 129 -34 164q-12 37 -35.5 69 t-50.5 40q-57 16 -127 -25q-54 -32 -136.5 -106t-122.5 -102v-7q16 -8 25.5 -26t21.5 -20q21 -3 54.5 8.5t58 10.5t41.5 -30q11 -18 18.5 -38.5t15 -48t12.5 -40.5q17 -46 53 -187q36 -146 57 -197q42 -99 103 -125q43 -12 85 -1.5t76 31.5q131 77 250 237 q104 139 172.5 292.5t82.5 226.5zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" /> <glyph unicode="" horiz-adv-x="1152" d="M1152 704q0 -191 -94.5 -353t-256.5 -256.5t-353 -94.5h-160q-14 0 -23 9t-9 23v611l-215 -66q-3 -1 -9 -1q-10 0 -19 6q-13 10 -13 26v128q0 23 23 31l233 71v93l-215 -66q-3 -1 -9 -1q-10 0 -19 6q-13 10 -13 26v128q0 23 23 31l233 71v250q0 14 9 23t23 9h160 q14 0 23 -9t9 -23v-181l375 116q15 5 28 -5t13 -26v-128q0 -23 -23 -31l-393 -121v-93l375 116q15 5 28 -5t13 -26v-128q0 -23 -23 -31l-393 -121v-487q188 13 318 151t130 328q0 14 9 23t23 9h160q14 0 23 -9t9 -23z" /> <glyph unicode="" horiz-adv-x="1408" d="M1152 736v-64q0 -14 -9 -23t-23 -9h-352v-352q0 -14 -9 -23t-23 -9h-64q-14 0 -23 9t-9 23v352h-352q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h352v352q0 14 9 23t23 9h64q14 0 23 -9t9 -23v-352h352q14 0 23 -9t9 -23zM1280 288v832q0 66 -47 113t-113 47h-832 q-66 0 -113 -47t-47 -113v-832q0 -66 47 -113t113 -47h832q66 0 113 47t47 113zM1408 1120v-832q0 -119 -84.5 -203.5t-203.5 -84.5h-832q-119 0 -203.5 84.5t-84.5 203.5v832q0 119 84.5 203.5t203.5 84.5h832q119 0 203.5 -84.5t84.5 -203.5z" /> -<glyph unicode="" horiz-adv-x="1792" /> -<glyph unicode="" horiz-adv-x="1792" /> -<glyph unicode="" horiz-adv-x="1792" /> -<glyph unicode="" horiz-adv-x="1792" /> -<glyph unicode="" horiz-adv-x="1792" /> -<glyph unicode="" horiz-adv-x="1792" /> -<glyph unicode="" horiz-adv-x="1792" /> -<glyph unicode="" horiz-adv-x="1792" /> +<glyph unicode="" horiz-adv-x="2176" d="M620 416q-110 -64 -268 -64h-128v64h-64q-13 0 -22.5 23.5t-9.5 56.5q0 24 7 49q-58 2 -96.5 10.5t-38.5 20.5t38.5 20.5t96.5 10.5q-7 25 -7 49q0 33 9.5 56.5t22.5 23.5h64v64h128q158 0 268 -64h1113q42 -7 106.5 -18t80.5 -14q89 -15 150 -40.5t83.5 -47.5t22.5 -40 t-22.5 -40t-83.5 -47.5t-150 -40.5q-16 -3 -80.5 -14t-106.5 -18h-1113zM1739 668q53 -36 53 -92t-53 -92l81 -30q68 48 68 122t-68 122zM625 400h1015q-217 -38 -456 -80q-57 0 -113 -24t-83 -48l-28 -24l-288 -288q-26 -26 -70.5 -45t-89.5 -19h-96l-93 464h29 q157 0 273 64zM352 816h-29l93 464h96q46 0 90 -19t70 -45l288 -288q4 -4 11 -10.5t30.5 -23t48.5 -29t61.5 -23t72.5 -10.5l456 -80h-1015q-116 64 -273 64z" /> +<glyph unicode="" horiz-adv-x="1664" d="M1519 760q62 0 103.5 -40.5t41.5 -101.5q0 -97 -93 -130l-172 -59l56 -167q7 -21 7 -47q0 -59 -42 -102t-101 -43q-47 0 -85.5 27t-53.5 72l-55 165l-310 -106l55 -164q8 -24 8 -47q0 -59 -42 -102t-102 -43q-47 0 -85 27t-53 72l-55 163l-153 -53q-29 -9 -50 -9 q-61 0 -101.5 40t-40.5 101q0 47 27.5 85t71.5 53l156 53l-105 313l-156 -54q-26 -8 -48 -8q-60 0 -101 40.5t-41 100.5q0 47 27.5 85t71.5 53l157 53l-53 159q-8 24 -8 47q0 60 42 102.5t102 42.5q47 0 85 -27t53 -72l54 -160l310 105l-54 160q-8 24 -8 47q0 59 42.5 102 t101.5 43q47 0 85.5 -27.5t53.5 -71.5l53 -161l162 55q21 6 43 6q60 0 102.5 -39.5t42.5 -98.5q0 -45 -30 -81.5t-74 -51.5l-157 -54l105 -316l164 56q24 8 46 8zM725 498l310 105l-105 315l-310 -107z" /> +<glyph unicode="" d="M1248 1408q119 0 203.5 -84.5t84.5 -203.5v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960zM1280 352v436q-31 -35 -64 -55q-34 -22 -132.5 -85t-151.5 -99q-98 -69 -164 -69v0v0q-66 0 -164 69 q-46 32 -141.5 92.5t-142.5 92.5q-12 8 -33 27t-31 27v-436q0 -40 28 -68t68 -28h832q40 0 68 28t28 68zM1280 925q0 41 -27.5 70t-68.5 29h-832q-40 0 -68 -28t-28 -68q0 -37 30.5 -76.5t67.5 -64.5q47 -32 137.5 -89t129.5 -83q3 -2 17 -11.5t21 -14t21 -13t23.5 -13 t21.5 -9.5t22.5 -7.5t20.5 -2.5t20.5 2.5t22.5 7.5t21.5 9.5t23.5 13t21 13t21 14t17 11.5l267 174q35 23 66.5 62.5t31.5 73.5z" /> +<glyph unicode="" horiz-adv-x="1792" d="M127 640q0 163 67 313l367 -1005q-196 95 -315 281t-119 411zM1415 679q0 -19 -2.5 -38.5t-10 -49.5t-11.5 -44t-17.5 -59t-17.5 -58l-76 -256l-278 826q46 3 88 8q19 2 26 18.5t-2.5 31t-28.5 13.5l-205 -10q-75 1 -202 10q-12 1 -20.5 -5t-11.5 -15t-1.5 -18.5t9 -16.5 t19.5 -8l80 -8l120 -328l-168 -504l-280 832q46 3 88 8q19 2 26 18.5t-2.5 31t-28.5 13.5l-205 -10q-7 0 -23 0.5t-26 0.5q105 160 274.5 253.5t367.5 93.5q147 0 280.5 -53t238.5 -149h-10q-55 0 -92 -40.5t-37 -95.5q0 -12 2 -24t4 -21.5t8 -23t9 -21t12 -22.5t12.5 -21 t14.5 -24t14 -23q63 -107 63 -212zM909 573l237 -647q1 -6 5 -11q-126 -44 -255 -44q-112 0 -217 32zM1570 1009q95 -174 95 -369q0 -209 -104 -385.5t-279 -278.5l235 678q59 169 59 276q0 42 -6 79zM896 1536q182 0 348 -71t286 -191t191 -286t71 -348t-71 -348t-191 -286 t-286 -191t-348 -71t-348 71t-286 191t-191 286t-71 348t71 348t191 286t286 191t348 71zM896 -215q173 0 331.5 68t273 182.5t182.5 273t68 331.5t-68 331.5t-182.5 273t-273 182.5t-331.5 68t-331.5 -68t-273 -182.5t-182.5 -273t-68 -331.5t68 -331.5t182.5 -273 t273 -182.5t331.5 -68z" /> +<glyph unicode="" horiz-adv-x="1792" d="M1086 1536v-1536l-272 -128q-228 20 -414 102t-293 208.5t-107 272.5q0 140 100.5 263.5t275 205.5t391.5 108v-172q-217 -38 -356.5 -150t-139.5 -255q0 -152 154.5 -267t388.5 -145v1360zM1755 954l37 -390l-525 114l147 83q-119 70 -280 99v172q277 -33 481 -157z" /> +<glyph unicode="" horiz-adv-x="2048" d="M960 1536l960 -384v-128h-128q0 -26 -20.5 -45t-48.5 -19h-1526q-28 0 -48.5 19t-20.5 45h-128v128zM256 896h256v-768h128v768h256v-768h128v768h256v-768h128v768h256v-768h59q28 0 48.5 -19t20.5 -45v-64h-1664v64q0 26 20.5 45t48.5 19h59v768zM1851 -64 q28 0 48.5 -19t20.5 -45v-128h-1920v128q0 26 20.5 45t48.5 19h1782z" /> +<glyph unicode="" horiz-adv-x="2304" d="M1774 700l18 -316q4 -69 -82 -128t-235 -93.5t-323 -34.5t-323 34.5t-235 93.5t-82 128l18 316l574 -181q22 -7 48 -7t48 7zM2304 1024q0 -23 -22 -31l-1120 -352q-4 -1 -10 -1t-10 1l-652 206q-43 -34 -71 -111.5t-34 -178.5q63 -36 63 -109q0 -69 -58 -107l58 -433 q2 -14 -8 -25q-9 -11 -24 -11h-192q-15 0 -24 11q-10 11 -8 25l58 433q-58 38 -58 107q0 73 65 111q11 207 98 330l-333 104q-22 8 -22 31t22 31l1120 352q4 1 10 1t10 -1l1120 -352q22 -8 22 -31z" /> +<glyph unicode="" d="M859 579l13 -707q-62 11 -105 11q-41 0 -105 -11l13 707q-40 69 -168.5 295.5t-216.5 374.5t-181 287q58 -15 108 -15q43 0 111 15q63 -111 133.5 -229.5t167 -276.5t138.5 -227q37 61 109.5 177.5t117.5 190t105 176t107 189.5q54 -14 107 -14q56 0 114 14v0 q-28 -39 -60 -88.5t-49.5 -78.5t-56.5 -96t-49 -84q-146 -248 -353 -610z" /> +<glyph unicode="" horiz-adv-x="1280" d="M981 197q0 25 -7 49t-14.5 42t-27 41.5t-29.5 35t-38.5 34.5t-36.5 29t-41.5 30t-36.5 26q-16 2 -49 2q-53 0 -104.5 -7t-107 -25t-97 -46t-68.5 -74.5t-27 -105.5q0 -56 23.5 -102t61 -75.5t87 -50t100 -29t101.5 -8.5q58 0 111.5 13t99 39t73 73t27.5 109zM864 1055 q0 59 -17 125.5t-48 129t-84 103.5t-117 41q-42 0 -82.5 -19.5t-66.5 -52.5q-46 -59 -46 -160q0 -46 10 -97.5t31.5 -103t52 -92.5t75 -67t96.5 -26q37 0 77.5 16.5t65.5 43.5q53 56 53 159zM752 1536h417l-137 -88h-132q75 -63 113 -133t38 -160q0 -72 -24.5 -129.5 t-59.5 -93t-69.5 -65t-59 -61.5t-24.5 -66q0 -36 32 -70.5t77 -68t90.5 -73.5t77.5 -104t32 -142q0 -91 -49 -173q-71 -122 -209.5 -179.5t-298.5 -57.5q-132 0 -246.5 41.5t-172.5 137.5q-36 59 -36 131q0 81 44.5 150t118.5 115q131 82 404 100q-32 41 -47.5 73.5 t-15.5 73.5q0 40 21 85q-46 -4 -68 -4q-148 0 -249.5 96.5t-101.5 244.5q0 82 36 159t99 131q76 66 182 98t218 32z" /> +<glyph unicode="" horiz-adv-x="2304" d="M1509 107q0 -14 -12 -29q-52 -59 -147.5 -83t-196.5 -24q-252 0 -346 107q-12 15 -12 29q0 17 12 29.5t29 12.5q15 0 30 -12q58 -49 125.5 -66t159.5 -17t160 17t127 66q15 12 30 12q17 0 29 -12.5t12 -29.5zM978 498q0 -61 -43 -104t-104 -43q-60 0 -104.5 43.5 t-44.5 103.5q0 61 44 105t105 44t104 -44t43 -105zM1622 498q0 -61 -43 -104t-104 -43q-60 0 -104.5 43.5t-44.5 103.5q0 61 44 105t105 44t104 -44t43 -105zM415 793q-39 27 -88 27q-66 0 -113 -47t-47 -113q0 -72 54 -121q53 141 194 254zM2020 382q0 222 -249 387 q-128 85 -291.5 126.5t-331.5 41.5t-331.5 -41.5t-292.5 -126.5q-249 -165 -249 -387t249 -387q129 -85 292.5 -126.5t331.5 -41.5t331.5 41.5t291.5 126.5q249 165 249 387zM2137 660q0 66 -47 113t-113 47q-50 0 -93 -30q140 -114 192 -256q61 48 61 126zM1993 1335 q0 49 -34.5 83.5t-82.5 34.5q-49 0 -83.5 -34.5t-34.5 -83.5q0 -48 34.5 -82.5t83.5 -34.5q48 0 82.5 34.5t34.5 82.5zM2220 660q0 -65 -33 -122t-89 -90q5 -35 5 -66q0 -139 -79 -255.5t-208 -201.5q-140 -92 -313.5 -136.5t-354.5 -44.5t-355 44.5t-314 136.5 q-129 85 -208 201.5t-79 255.5q0 36 6 71q-53 33 -83.5 88.5t-30.5 118.5q0 100 71 171.5t172 71.5q91 0 159 -60q265 170 638 177l144 456q10 29 40 29q24 0 384 -90q24 55 74 88t110 33q82 0 141 -59t59 -142t-59 -141.5t-141 -58.5q-83 0 -141.5 58.5t-59.5 140.5 l-339 80l-125 -395q349 -15 603 -179q71 63 163 63q101 0 172 -71.5t71 -171.5z" /> +<glyph unicode="" d="M950 393q7 7 17.5 7t17.5 -7t7 -18t-7 -18q-65 -64 -208 -64h-1h-1q-143 0 -207 64q-8 7 -8 18t8 18q7 7 17.5 7t17.5 -7q49 -51 172 -51h1h1q122 0 173 51zM671 613q0 -37 -26 -64t-63 -27t-63 27t-26 64t26 63t63 26t63 -26t26 -63zM1214 1049q-29 0 -50 21t-21 50 q0 30 21 51t50 21q30 0 51 -21t21 -51q0 -29 -21 -50t-51 -21zM1216 1408q132 0 226 -94t94 -227v-894q0 -133 -94 -227t-226 -94h-896q-132 0 -226 94t-94 227v894q0 133 94 227t226 94h896zM1321 596q35 14 57 45.5t22 70.5q0 51 -36 87.5t-87 36.5q-60 0 -98 -48 q-151 107 -375 115l83 265l206 -49q1 -50 36.5 -85t84.5 -35q50 0 86 35.5t36 85.5t-36 86t-86 36q-36 0 -66 -20.5t-45 -53.5l-227 54q-9 2 -17.5 -2.5t-11.5 -14.5l-95 -302q-224 -4 -381 -113q-36 43 -93 43q-51 0 -87 -36.5t-36 -87.5q0 -37 19.5 -67.5t52.5 -45.5 q-7 -25 -7 -54q0 -98 74 -181.5t201.5 -132t278.5 -48.5q150 0 277.5 48.5t201.5 132t74 181.5q0 27 -6 54zM971 702q37 0 63 -26t26 -63t-26 -64t-63 -27t-63 27t-26 64t26 63t63 26z" /> +<glyph unicode="" d="M866 697l90 27v62q0 79 -58 135t-138 56t-138 -55.5t-58 -134.5v-283q0 -20 -14 -33.5t-33 -13.5t-32.5 13.5t-13.5 33.5v120h-151v-122q0 -82 57.5 -139t139.5 -57q81 0 138.5 56.5t57.5 136.5v280q0 19 13.5 33t33.5 14q19 0 32.5 -14t13.5 -33v-54zM1199 502v122h-150 v-126q0 -20 -13.5 -33.5t-33.5 -13.5q-19 0 -32.5 14t-13.5 33v123l-90 -26l-60 28v-123q0 -80 58 -137t139 -57t138.5 57t57.5 139zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103 t385.5 -103t279.5 -279.5t103 -385.5z" /> +<glyph unicode="" horiz-adv-x="1920" d="M1062 824v118q0 42 -30 72t-72 30t-72 -30t-30 -72v-612q0 -175 -126 -299t-303 -124q-178 0 -303.5 125.5t-125.5 303.5v266h328v-262q0 -43 30 -72.5t72 -29.5t72 29.5t30 72.5v620q0 171 126.5 292t301.5 121q176 0 302 -122t126 -294v-136l-195 -58zM1592 602h328 v-266q0 -178 -125.5 -303.5t-303.5 -125.5q-177 0 -303 124.5t-126 300.5v268l131 -61l195 58v-270q0 -42 30 -71.5t72 -29.5t72 29.5t30 71.5v275z" /> +<glyph unicode="" d="M1472 160v480h-704v704h-480q-93 0 -158.5 -65.5t-65.5 -158.5v-480h704v-704h480q93 0 158.5 65.5t65.5 158.5zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5 t84.5 -203.5z" /> +<glyph unicode="" horiz-adv-x="2048" d="M328 1254h204v-983h-532v697h328v286zM328 435v369h-123v-369h123zM614 968v-697h205v697h-205zM614 1254v-204h205v204h-205zM901 968h533v-942h-533v163h328v82h-328v697zM1229 435v369h-123v-369h123zM1516 968h532v-942h-532v163h327v82h-327v697zM1843 435v369h-123 v-369h123z" /> +<glyph unicode="" d="M1046 516q0 -64 -38 -109t-91 -45q-43 0 -70 15v277q28 17 70 17q53 0 91 -45.5t38 -109.5zM703 944q0 -64 -38 -109.5t-91 -45.5q-43 0 -70 15v277q28 17 70 17q53 0 91 -45t38 -109zM1265 513q0 134 -88 229t-213 95q-20 0 -39 -3q-23 -78 -78 -136q-87 -95 -211 -101 v-636l211 41v206q51 -19 117 -19q125 0 213 95t88 229zM922 940q0 134 -88.5 229t-213.5 95q-74 0 -141 -36h-186v-840l211 41v206q55 -19 116 -19q125 0 213.5 95t88.5 229zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960 q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" /> +<glyph unicode="" horiz-adv-x="2038" d="M1222 607q75 3 143.5 -20.5t118 -58.5t101 -94.5t84 -108t75.5 -120.5q33 -56 78.5 -109t75.5 -80.5t99 -88.5q-48 -30 -108.5 -57.5t-138.5 -59t-114 -47.5q-44 37 -74 115t-43.5 164.5t-33 180.5t-42.5 168.5t-72.5 123t-122.5 48.5l-10 -2l-6 -4q4 -5 13 -14 q6 -5 28 -23.5t25.5 -22t19 -18t18 -20.5t11.5 -21t10.5 -27.5t4.5 -31t4 -40.5l1 -33q1 -26 -2.5 -57.5t-7.5 -52t-12.5 -58.5t-11.5 -53q-35 1 -101 -9.5t-98 -10.5q-39 0 -72 10q-2 16 -2 47q0 74 3 96q2 13 31.5 41.5t57 59t26.5 51.5q-24 2 -43 -24 q-36 -53 -111.5 -99.5t-136.5 -46.5q-25 0 -75.5 63t-106.5 139.5t-84 96.5q-6 4 -27 30q-482 -112 -513 -112q-16 0 -28 11t-12 27q0 15 8.5 26.5t22.5 14.5l486 106q-8 14 -8 25t5.5 17.5t16 11.5t20 7t23 4.5t18.5 4.5q4 1 15.5 7.5t17.5 6.5q15 0 28 -16t20 -33 q163 37 172 37q17 0 29.5 -11t12.5 -28q0 -15 -8.5 -26t-23.5 -14l-182 -40l-1 -16q-1 -26 81.5 -117.5t104.5 -91.5q47 0 119 80t72 129q0 36 -23.5 53t-51 18.5t-51 11.5t-23.5 34q0 16 10 34l-68 19q43 44 43 117q0 26 -5 58q82 16 144 16q44 0 71.5 -1.5t48.5 -8.5 t31 -13.5t20.5 -24.5t15.5 -33.5t17 -47.5t24 -60l50 25q-3 -40 -23 -60t-42.5 -21t-40 -6.5t-16.5 -20.5zM1282 842q-5 5 -13.5 15.5t-12 14.5t-10.5 11.5t-10 10.5l-8 8t-8.5 7.5t-8 5t-8.5 4.5q-7 3 -14.5 5t-20.5 2.5t-22 0.5h-32.5h-37.5q-126 0 -217 -43 q16 30 36 46.5t54 29.5t65.5 36t46 36.5t50 55t43.5 50.5q12 -9 28 -31.5t32 -36.5t38 -13l12 1v-76l22 -1q247 95 371 190q28 21 50 39t42.5 37.5t33 31t29.5 34t24 31t24.5 37t23 38t27 47.5t29.5 53l7 9q-2 -53 -43 -139q-79 -165 -205 -264t-306 -142q-14 -3 -42 -7.5 t-50 -9.5t-39 -14q3 -19 24.5 -46t21.5 -34q0 -11 -26 -30zM1061 -79q39 26 131.5 47.5t146.5 21.5q9 0 22.5 -15.5t28 -42.5t26 -50t24 -51t14.5 -33q-121 -45 -244 -45q-61 0 -125 11zM822 568l48 12l109 -177l-73 -48zM1323 51q3 -15 3 -16q0 -7 -17.5 -14.5t-46 -13 t-54 -9.5t-53.5 -7.5t-32 -4.5l-7 43q21 2 60.5 8.5t72 10t60.5 3.5h14zM866 679l-96 -20l-6 17q10 1 32.5 7t34.5 6q19 0 35 -10zM1061 45h31l10 -83l-41 -12v95zM1950 1535v1v-1zM1950 1535l-1 -5l-2 -2l1 3zM1950 1535l1 1z" /> +<glyph unicode="" d="M1167 -50q-5 19 -24 5q-30 -22 -87 -39t-131 -17q-129 0 -193 49q-5 4 -13 4q-11 0 -26 -12q-7 -6 -7.5 -16t7.5 -20q34 -32 87.5 -46t102.5 -12.5t99 4.5q41 4 84.5 20.5t65 30t28.5 20.5q12 12 7 29zM1128 65q-19 47 -39 61q-23 15 -76 15q-47 0 -71 -10 q-29 -12 -78 -56q-26 -24 -12 -44q9 -8 17.5 -4.5t31.5 23.5q3 2 10.5 8.5t10.5 8.5t10 7t11.5 7t12.5 5t15 4.5t16.5 2.5t20.5 1q27 0 44.5 -7.5t23 -14.5t13.5 -22q10 -17 12.5 -20t12.5 1q23 12 14 34zM1483 346q0 22 -5 44.5t-16.5 45t-34 36.5t-52.5 14 q-33 0 -97 -41.5t-129 -83.5t-101 -42q-27 -1 -63.5 19t-76 49t-83.5 58t-100 49t-111 19q-115 -1 -197 -78.5t-84 -178.5q-2 -112 74 -164q29 -20 62.5 -28.5t103.5 -8.5q57 0 132 32.5t134 71t120 70.5t93 31q26 -1 65 -31.5t71.5 -67t68 -67.5t55.5 -32q35 -3 58.5 14 t55.5 63q28 41 42.5 101t14.5 106zM1536 506q0 -164 -62 -304.5t-166 -236t-242.5 -149.5t-290.5 -54t-293 57.5t-247.5 157t-170.5 241.5t-64 302q0 89 19.5 172.5t49 145.5t70.5 118.5t78.5 94t78.5 69.5t64.5 46.5t42.5 24.5q14 8 51 26.5t54.5 28.5t48 30t60.5 44 q36 28 58 72.5t30 125.5q129 -155 186 -193q44 -29 130 -68t129 -66q21 -13 39 -25t60.5 -46.5t76 -70.5t75 -95t69 -122t47 -148.5t19.5 -177.5z" /> +<glyph unicode="" d="M1070 463l-160 -160l-151 -152l-30 -30q-65 -64 -151.5 -87t-171.5 -2q-16 -70 -72 -115t-129 -45q-85 0 -145 60.5t-60 145.5q0 72 44.5 128t113.5 72q-22 86 1 173t88 152l12 12l151 -152l-11 -11q-37 -37 -37 -89t37 -90q37 -37 89 -37t89 37l30 30l151 152l161 160z M729 1145l12 -12l-152 -152l-12 12q-37 37 -89 37t-89 -37t-37 -89.5t37 -89.5l29 -29l152 -152l160 -160l-151 -152l-161 160l-151 152l-30 30q-68 67 -90 159.5t5 179.5q-70 15 -115 71t-45 129q0 85 60 145.5t145 60.5q76 0 133.5 -49t69.5 -123q84 20 169.5 -3.5 t149.5 -87.5zM1536 78q0 -85 -60 -145.5t-145 -60.5q-74 0 -131 47t-71 118q-86 -28 -179.5 -6t-161.5 90l-11 12l151 152l12 -12q37 -37 89 -37t89 37t37 89t-37 89l-30 30l-152 152l-160 160l152 152l160 -160l152 -152l29 -30q64 -64 87.5 -150.5t2.5 -171.5 q76 -11 126.5 -68.5t50.5 -134.5zM1534 1202q0 -77 -51 -135t-127 -69q26 -85 3 -176.5t-90 -158.5l-12 -12l-151 152l12 12q37 37 37 89t-37 89t-89 37t-89 -37l-30 -30l-152 -152l-160 -160l-152 152l161 160l152 152l29 30q67 67 159 89.5t178 -3.5q11 75 68.5 126 t135.5 51q85 0 145 -60.5t60 -145.5z" /> +<glyph unicode="" d="M654 458q-1 -3 -12.5 0.5t-31.5 11.5l-20 9q-44 20 -87 49q-7 5 -41 31.5t-38 28.5q-67 -103 -134 -181q-81 -95 -105 -110q-4 -2 -19.5 -4t-18.5 0q6 4 82 92q21 24 85.5 115t78.5 118q17 30 51 98.5t36 77.5q-8 1 -110 -33q-8 -2 -27.5 -7.5t-34.5 -9.5t-17 -5 q-2 -2 -2 -10.5t-1 -9.5q-5 -10 -31 -15q-23 -7 -47 0q-18 4 -28 21q-4 6 -5 23q6 2 24.5 5t29.5 6q58 16 105 32q100 35 102 35q10 2 43 19.5t44 21.5q9 3 21.5 8t14.5 5.5t6 -0.5q2 -12 -1 -33q0 -2 -12.5 -27t-26.5 -53.5t-17 -33.5q-25 -50 -77 -131l64 -28 q12 -6 74.5 -32t67.5 -28q4 -1 10.5 -25.5t4.5 -30.5zM449 944q3 -15 -4 -28q-12 -23 -50 -38q-30 -12 -60 -12q-26 3 -49 26q-14 15 -18 41l1 3q3 -3 19.5 -5t26.5 0t58 16q36 12 55 14q17 0 21 -17zM1147 815l63 -227l-139 42zM39 15l694 232v1032l-694 -233v-1031z M1280 332l102 -31l-181 657l-100 31l-216 -536l102 -31l45 110l211 -65zM777 1294l573 -184v380zM1088 -29l158 -13l-54 -160l-40 66q-130 -83 -276 -108q-58 -12 -91 -12h-84q-79 0 -199.5 39t-183.5 85q-8 7 -8 16q0 8 5 13.5t13 5.5q4 0 18 -7.5t30.5 -16.5t20.5 -11 q73 -37 159.5 -61.5t157.5 -24.5q95 0 167 14.5t157 50.5q15 7 30.5 15.5t34 19t28.5 16.5zM1536 1050v-1079l-774 246q-14 -6 -375 -127.5t-368 -121.5q-13 0 -18 13q0 1 -1 3v1078q3 9 4 10q5 6 20 11q106 35 149 50v384l558 -198q2 0 160.5 55t316 108.5t161.5 53.5 q20 0 20 -21v-418z" /> +<glyph unicode="" horiz-adv-x="1792" d="M288 1152q66 0 113 -47t47 -113v-1088q0 -66 -47 -113t-113 -47h-128q-66 0 -113 47t-47 113v1088q0 66 47 113t113 47h128zM1664 989q58 -34 93 -93t35 -128v-768q0 -106 -75 -181t-181 -75h-864q-66 0 -113 47t-47 113v1536q0 40 28 68t68 28h672q40 0 88 -20t76 -48 l152 -152q28 -28 48 -76t20 -88v-163zM928 0v128q0 14 -9 23t-23 9h-128q-14 0 -23 -9t-9 -23v-128q0 -14 9 -23t23 -9h128q14 0 23 9t9 23zM928 256v128q0 14 -9 23t-23 9h-128q-14 0 -23 -9t-9 -23v-128q0 -14 9 -23t23 -9h128q14 0 23 9t9 23zM928 512v128q0 14 -9 23 t-23 9h-128q-14 0 -23 -9t-9 -23v-128q0 -14 9 -23t23 -9h128q14 0 23 9t9 23zM1184 0v128q0 14 -9 23t-23 9h-128q-14 0 -23 -9t-9 -23v-128q0 -14 9 -23t23 -9h128q14 0 23 9t9 23zM1184 256v128q0 14 -9 23t-23 9h-128q-14 0 -23 -9t-9 -23v-128q0 -14 9 -23t23 -9h128 q14 0 23 9t9 23zM1184 512v128q0 14 -9 23t-23 9h-128q-14 0 -23 -9t-9 -23v-128q0 -14 9 -23t23 -9h128q14 0 23 9t9 23zM1440 0v128q0 14 -9 23t-23 9h-128q-14 0 -23 -9t-9 -23v-128q0 -14 9 -23t23 -9h128q14 0 23 9t9 23zM1440 256v128q0 14 -9 23t-23 9h-128 q-14 0 -23 -9t-9 -23v-128q0 -14 9 -23t23 -9h128q14 0 23 9t9 23zM1440 512v128q0 14 -9 23t-23 9h-128q-14 0 -23 -9t-9 -23v-128q0 -14 9 -23t23 -9h128q14 0 23 9t9 23zM1536 896v256h-160q-40 0 -68 28t-28 68v160h-640v-512h896z" /> +<glyph unicode="" d="M1344 1536q26 0 45 -19t19 -45v-1664q0 -26 -19 -45t-45 -19h-1280q-26 0 -45 19t-19 45v1664q0 26 19 45t45 19h1280zM512 1248v-64q0 -14 9 -23t23 -9h64q14 0 23 9t9 23v64q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23zM512 992v-64q0 -14 9 -23t23 -9h64q14 0 23 9 t9 23v64q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23zM512 736v-64q0 -14 9 -23t23 -9h64q14 0 23 9t9 23v64q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23zM512 480v-64q0 -14 9 -23t23 -9h64q14 0 23 9t9 23v64q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23zM384 160v64 q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23v-64q0 -14 9 -23t23 -9h64q14 0 23 9t9 23zM384 416v64q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23v-64q0 -14 9 -23t23 -9h64q14 0 23 9t9 23zM384 672v64q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23v-64q0 -14 9 -23t23 -9h64 q14 0 23 9t9 23zM384 928v64q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23v-64q0 -14 9 -23t23 -9h64q14 0 23 9t9 23zM384 1184v64q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23v-64q0 -14 9 -23t23 -9h64q14 0 23 9t9 23zM896 -96v192q0 14 -9 23t-23 9h-320q-14 0 -23 -9 t-9 -23v-192q0 -14 9 -23t23 -9h320q14 0 23 9t9 23zM896 416v64q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23v-64q0 -14 9 -23t23 -9h64q14 0 23 9t9 23zM896 672v64q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23v-64q0 -14 9 -23t23 -9h64q14 0 23 9t9 23zM896 928v64 q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23v-64q0 -14 9 -23t23 -9h64q14 0 23 9t9 23zM896 1184v64q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23v-64q0 -14 9 -23t23 -9h64q14 0 23 9t9 23zM1152 160v64q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23v-64q0 -14 9 -23t23 -9h64 q14 0 23 9t9 23zM1152 416v64q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23v-64q0 -14 9 -23t23 -9h64q14 0 23 9t9 23zM1152 672v64q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23v-64q0 -14 9 -23t23 -9h64q14 0 23 9t9 23zM1152 928v64q0 14 -9 23t-23 9h-64q-14 0 -23 -9 t-9 -23v-64q0 -14 9 -23t23 -9h64q14 0 23 9t9 23zM1152 1184v64q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23v-64q0 -14 9 -23t23 -9h64q14 0 23 9t9 23z" /> +<glyph unicode="" horiz-adv-x="1280" d="M1188 988l-292 -292v-824q0 -46 -33 -79t-79 -33t-79 33t-33 79v384h-64v-384q0 -46 -33 -79t-79 -33t-79 33t-33 79v824l-292 292q-28 28 -28 68t28 68t68 28t68 -28l228 -228h368l228 228q28 28 68 28t68 -28t28 -68t-28 -68zM864 1152q0 -93 -65.5 -158.5 t-158.5 -65.5t-158.5 65.5t-65.5 158.5t65.5 158.5t158.5 65.5t158.5 -65.5t65.5 -158.5z" /> +<glyph unicode="" horiz-adv-x="1664" d="M780 1064q0 -60 -19 -113.5t-63 -92.5t-105 -39q-76 0 -138 57.5t-92 135.5t-30 151q0 60 19 113.5t63 92.5t105 39q77 0 138.5 -57.5t91.5 -135t30 -151.5zM438 581q0 -80 -42 -139t-119 -59q-76 0 -141.5 55.5t-100.5 133.5t-35 152q0 80 42 139.5t119 59.5 q76 0 141.5 -55.5t100.5 -134t35 -152.5zM832 608q118 0 255 -97.5t229 -237t92 -254.5q0 -46 -17 -76.5t-48.5 -45t-64.5 -20t-76 -5.5q-68 0 -187.5 45t-182.5 45q-66 0 -192.5 -44.5t-200.5 -44.5q-183 0 -183 146q0 86 56 191.5t139.5 192.5t187.5 146t193 59zM1071 819 q-61 0 -105 39t-63 92.5t-19 113.5q0 74 30 151.5t91.5 135t138.5 57.5q61 0 105 -39t63 -92.5t19 -113.5q0 -73 -30 -151t-92 -135.5t-138 -57.5zM1503 923q77 0 119 -59.5t42 -139.5q0 -74 -35 -152t-100.5 -133.5t-141.5 -55.5q-77 0 -119 59t-42 139q0 74 35 152.5 t100.5 134t141.5 55.5z" /> +<glyph unicode="" horiz-adv-x="768" d="M704 1008q0 -145 -57 -243.5t-152 -135.5l45 -821q2 -26 -16 -45t-44 -19h-192q-26 0 -44 19t-16 45l45 821q-95 37 -152 135.5t-57 243.5q0 128 42.5 249.5t117.5 200t160 78.5t160 -78.5t117.5 -200t42.5 -249.5z" /> +<glyph unicode="" horiz-adv-x="1792" d="M896 -93l640 349v636l-640 -233v-752zM832 772l698 254l-698 254l-698 -254zM1664 1024v-768q0 -35 -18 -65t-49 -47l-704 -384q-28 -16 -61 -16t-61 16l-704 384q-31 17 -49 47t-18 65v768q0 40 23 73t61 47l704 256q22 8 44 8t44 -8l704 -256q38 -14 61 -47t23 -73z " /> +<glyph unicode="" horiz-adv-x="2304" d="M640 -96l384 192v314l-384 -164v-342zM576 358l404 173l-404 173l-404 -173zM1664 -96l384 192v314l-384 -164v-342zM1600 358l404 173l-404 173l-404 -173zM1152 651l384 165v266l-384 -164v-267zM1088 1030l441 189l-441 189l-441 -189zM2176 512v-416q0 -36 -19 -67 t-52 -47l-448 -224q-25 -14 -57 -14t-57 14l-448 224q-5 2 -7 4q-2 -2 -7 -4l-448 -224q-25 -14 -57 -14t-57 14l-448 224q-33 16 -52 47t-19 67v416q0 38 21.5 70t56.5 48l434 186v400q0 38 21.5 70t56.5 48l448 192q23 10 50 10t50 -10l448 -192q35 -16 56.5 -48t21.5 -70 v-400l434 -186q36 -16 57 -48t21 -70z" /> +<glyph unicode="" horiz-adv-x="2048" d="M1848 1197h-511v-124h511v124zM1596 771q-90 0 -146 -52.5t-62 -142.5h408q-18 195 -200 195zM1612 186q63 0 122 32t76 87h221q-100 -307 -427 -307q-214 0 -340.5 132t-126.5 347q0 208 130.5 345.5t336.5 137.5q138 0 240.5 -68t153 -179t50.5 -248q0 -17 -2 -47h-658 q0 -111 57.5 -171.5t166.5 -60.5zM277 236h296q205 0 205 167q0 180 -199 180h-302v-347zM277 773h281q78 0 123.5 36.5t45.5 113.5q0 144 -190 144h-260v-294zM0 1282h594q87 0 155 -14t126.5 -47.5t90 -96.5t31.5 -154q0 -181 -172 -263q114 -32 172 -115t58 -204 q0 -75 -24.5 -136.5t-66 -103.5t-98.5 -71t-121 -42t-134 -13h-611v1260z" /> +<glyph unicode="" d="M1248 1408q119 0 203.5 -84.5t84.5 -203.5v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960zM499 1041h-371v-787h382q117 0 197 57.5t80 170.5q0 158 -143 200q107 52 107 164q0 57 -19.5 96.5 t-56.5 60.5t-79 29.5t-97 8.5zM477 723h-176v184h163q119 0 119 -90q0 -94 -106 -94zM486 388h-185v217h189q124 0 124 -113q0 -104 -128 -104zM1136 356q-68 0 -104 38t-36 107h411q1 10 1 30q0 132 -74.5 220.5t-203.5 88.5q-128 0 -210 -86t-82 -216q0 -135 79 -217 t213 -82q205 0 267 191h-138q-11 -34 -47.5 -54t-75.5 -20zM1126 722q113 0 124 -122h-254q4 56 39 89t91 33zM964 988h319v-77h-319v77z" /> +<glyph unicode="" horiz-adv-x="1792" d="M1582 954q0 -101 -71.5 -172.5t-172.5 -71.5t-172.5 71.5t-71.5 172.5t71.5 172.5t172.5 71.5t172.5 -71.5t71.5 -172.5zM812 212q0 104 -73 177t-177 73q-27 0 -54 -6l104 -42q77 -31 109.5 -106.5t1.5 -151.5q-31 -77 -107 -109t-152 -1q-21 8 -62 24.5t-61 24.5 q32 -60 91 -96.5t130 -36.5q104 0 177 73t73 177zM1642 953q0 126 -89.5 215.5t-215.5 89.5q-127 0 -216.5 -89.5t-89.5 -215.5q0 -127 89.5 -216t216.5 -89q126 0 215.5 89t89.5 216zM1792 953q0 -189 -133.5 -322t-321.5 -133l-437 -319q-12 -129 -109 -218t-229 -89 q-121 0 -214 76t-118 192l-230 92v429l389 -157q79 48 173 48q13 0 35 -2l284 407q2 187 135.5 319t320.5 132q188 0 321.5 -133.5t133.5 -321.5z" /> +<glyph unicode="" d="M1242 889q0 80 -57 136.5t-137 56.5t-136.5 -57t-56.5 -136q0 -80 56.5 -136.5t136.5 -56.5t137 56.5t57 136.5zM632 301q0 -83 -58 -140.5t-140 -57.5q-56 0 -103 29t-72 77q52 -20 98 -40q60 -24 120 1.5t85 86.5q24 60 -1.5 120t-86.5 84l-82 33q22 5 42 5 q82 0 140 -57.5t58 -140.5zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v153l172 -69q20 -92 93.5 -152t168.5 -60q104 0 181 70t87 173l345 252q150 0 255.5 105.5t105.5 254.5q0 150 -105.5 255.5t-255.5 105.5 q-148 0 -253 -104.5t-107 -252.5l-225 -322q-9 1 -28 1q-75 0 -137 -37l-297 119v468q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5zM1289 887q0 -100 -71 -170.5t-171 -70.5t-170.5 70.5t-70.5 170.5t70.5 171t170.5 71q101 0 171.5 -70.5t70.5 -171.5z " /> +<glyph unicode="" horiz-adv-x="1792" d="M836 367l-15 -368l-2 -22l-420 29q-36 3 -67 31.5t-47 65.5q-11 27 -14.5 55t4 65t12 55t21.5 64t19 53q78 -12 509 -28zM449 953l180 -379l-147 92q-63 -72 -111.5 -144.5t-72.5 -125t-39.5 -94.5t-18.5 -63l-4 -21l-190 357q-17 26 -18 56t6 47l8 18q35 63 114 188 l-140 86zM1680 436l-188 -359q-12 -29 -36.5 -46.5t-43.5 -20.5l-18 -4q-71 -7 -219 -12l8 -164l-230 367l211 362l7 -173q170 -16 283 -5t170 33zM895 1360q-47 -63 -265 -435l-317 187l-19 12l225 356q20 31 60 45t80 10q24 -2 48.5 -12t42 -21t41.5 -33t36 -34.5 t36 -39.5t32 -35zM1550 1053l212 -363q18 -37 12.5 -76t-27.5 -74q-13 -20 -33 -37t-38 -28t-48.5 -22t-47 -16t-51.5 -14t-46 -12q-34 72 -265 436l313 195zM1407 1279l142 83l-220 -373l-419 20l151 86q-34 89 -75 166t-75.5 123.5t-64.5 80t-47 46.5l-17 13l405 -1 q31 3 58 -10.5t39 -28.5l11 -15q39 -61 112 -190z" /> +<glyph unicode="" horiz-adv-x="2048" d="M480 448q0 66 -47 113t-113 47t-113 -47t-47 -113t47 -113t113 -47t113 47t47 113zM516 768h1016l-89 357q-2 8 -14 17.5t-21 9.5h-768q-9 0 -21 -9.5t-14 -17.5zM1888 448q0 66 -47 113t-113 47t-113 -47t-47 -113t47 -113t113 -47t113 47t47 113zM2048 544v-384 q0 -14 -9 -23t-23 -9h-96v-128q0 -80 -56 -136t-136 -56t-136 56t-56 136v128h-1024v-128q0 -80 -56 -136t-136 -56t-136 56t-56 136v128h-96q-14 0 -23 9t-9 23v384q0 93 65.5 158.5t158.5 65.5h28l105 419q23 94 104 157.5t179 63.5h768q98 0 179 -63.5t104 -157.5 l105 -419h28q93 0 158.5 -65.5t65.5 -158.5z" /> +<glyph unicode="" horiz-adv-x="2048" d="M1824 640q93 0 158.5 -65.5t65.5 -158.5v-384q0 -14 -9 -23t-23 -9h-96v-64q0 -80 -56 -136t-136 -56t-136 56t-56 136v64h-1024v-64q0 -80 -56 -136t-136 -56t-136 56t-56 136v64h-96q-14 0 -23 9t-9 23v384q0 93 65.5 158.5t158.5 65.5h28l105 419q23 94 104 157.5 t179 63.5h128v224q0 14 9 23t23 9h448q14 0 23 -9t9 -23v-224h128q98 0 179 -63.5t104 -157.5l105 -419h28zM320 160q66 0 113 47t47 113t-47 113t-113 47t-113 -47t-47 -113t47 -113t113 -47zM516 640h1016l-89 357q-2 8 -14 17.5t-21 9.5h-768q-9 0 -21 -9.5t-14 -17.5z M1728 160q66 0 113 47t47 113t-47 113t-113 47t-113 -47t-47 -113t47 -113t113 -47z" /> +<glyph unicode="" d="M1504 64q0 -26 -19 -45t-45 -19h-462q1 -17 6 -87.5t5 -108.5q0 -25 -18 -42.5t-43 -17.5h-320q-25 0 -43 17.5t-18 42.5q0 38 5 108.5t6 87.5h-462q-26 0 -45 19t-19 45t19 45l402 403h-229q-26 0 -45 19t-19 45t19 45l402 403h-197q-26 0 -45 19t-19 45t19 45l384 384 q19 19 45 19t45 -19l384 -384q19 -19 19 -45t-19 -45t-45 -19h-197l402 -403q19 -19 19 -45t-19 -45t-45 -19h-229l402 -403q19 -19 19 -45z" /> +<glyph unicode="" d="M1127 326q0 32 -30 51q-193 115 -447 115q-133 0 -287 -34q-42 -9 -42 -52q0 -20 13.5 -34.5t35.5 -14.5q5 0 37 8q132 27 243 27q226 0 397 -103q19 -11 33 -11q19 0 33 13.5t14 34.5zM1223 541q0 40 -35 61q-237 141 -548 141q-153 0 -303 -42q-48 -13 -48 -64 q0 -25 17.5 -42.5t42.5 -17.5q7 0 37 8q122 33 251 33q279 0 488 -124q24 -13 38 -13q25 0 42.5 17.5t17.5 42.5zM1331 789q0 47 -40 70q-126 73 -293 110.5t-343 37.5q-204 0 -364 -47q-23 -7 -38.5 -25.5t-15.5 -48.5q0 -31 20.5 -52t51.5 -21q11 0 40 8q133 37 307 37 q159 0 309.5 -34t253.5 -95q21 -12 40 -12q29 0 50.5 20.5t21.5 51.5zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" /> +<glyph unicode="" horiz-adv-x="1024" d="M1024 1233l-303 -582l24 -31h279v-415h-507l-44 -30l-142 -273l-30 -30h-301v303l303 583l-24 30h-279v415h507l44 30l142 273l30 30h301v-303z" /> +<glyph unicode="" horiz-adv-x="2304" d="M784 164l16 241l-16 523q-1 10 -7.5 17t-16.5 7q-9 0 -16 -7t-7 -17l-14 -523l14 -241q1 -10 7.5 -16.5t15.5 -6.5q22 0 24 23zM1080 193l11 211l-12 586q0 16 -13 24q-8 5 -16 5t-16 -5q-13 -8 -13 -24l-1 -6l-10 -579q0 -1 11 -236v-1q0 -10 6 -17q9 -11 23 -11 q11 0 20 9q9 7 9 20zM35 533l20 -128l-20 -126q-2 -9 -9 -9t-9 9l-17 126l17 128q2 9 9 9t9 -9zM121 612l26 -207l-26 -203q-2 -9 -10 -9q-9 0 -9 10l-23 202l23 207q0 9 9 9q8 0 10 -9zM401 159zM213 650l25 -245l-25 -237q0 -11 -11 -11q-10 0 -12 11l-21 237l21 245 q2 12 12 12q11 0 11 -12zM307 657l23 -252l-23 -244q-2 -13 -14 -13q-13 0 -13 13l-21 244l21 252q0 13 13 13q12 0 14 -13zM401 639l21 -234l-21 -246q-2 -16 -16 -16q-6 0 -10.5 4.5t-4.5 11.5l-20 246l20 234q0 6 4.5 10.5t10.5 4.5q14 0 16 -15zM784 164zM495 785 l21 -380l-21 -246q0 -7 -5 -12.5t-12 -5.5q-16 0 -18 18l-18 246l18 380q2 18 18 18q7 0 12 -5.5t5 -12.5zM589 871l19 -468l-19 -244q0 -8 -5.5 -13.5t-13.5 -5.5q-18 0 -20 19l-16 244l16 468q2 19 20 19q8 0 13.5 -5.5t5.5 -13.5zM687 911l18 -506l-18 -242 q-2 -21 -22 -21q-19 0 -21 21l-16 242l16 506q0 9 6.5 15.5t14.5 6.5q9 0 15 -6.5t7 -15.5zM1079 169v0v0zM881 915l15 -510l-15 -239q0 -10 -7.5 -17.5t-17.5 -7.5t-17 7t-8 18l-14 239l14 510q0 11 7.5 18t17.5 7t17.5 -7t7.5 -18zM980 896l14 -492l-14 -236q0 -11 -8 -19 t-19 -8t-19 8t-9 19l-12 236l12 492q1 12 9 20t19 8t18.5 -8t8.5 -20zM1192 404l-14 -231v0q0 -13 -9 -22t-22 -9t-22 9t-10 22l-6 114l-6 117l12 636v3q2 15 12 24q9 7 20 7q8 0 15 -5q14 -8 16 -26zM2304 423q0 -117 -83 -199.5t-200 -82.5h-786q-13 2 -22 11t-9 22v899 q0 23 28 33q85 34 181 34q195 0 338 -131.5t160 -323.5q53 22 110 22q117 0 200 -83t83 -201z" /> +<glyph unicode="" d="M768 768q237 0 443 43t325 127v-170q0 -69 -103 -128t-280 -93.5t-385 -34.5t-385 34.5t-280 93.5t-103 128v170q119 -84 325 -127t443 -43zM768 0q237 0 443 43t325 127v-170q0 -69 -103 -128t-280 -93.5t-385 -34.5t-385 34.5t-280 93.5t-103 128v170q119 -84 325 -127 t443 -43zM768 384q237 0 443 43t325 127v-170q0 -69 -103 -128t-280 -93.5t-385 -34.5t-385 34.5t-280 93.5t-103 128v170q119 -84 325 -127t443 -43zM768 1536q208 0 385 -34.5t280 -93.5t103 -128v-128q0 -69 -103 -128t-280 -93.5t-385 -34.5t-385 34.5t-280 93.5 t-103 128v128q0 69 103 128t280 93.5t385 34.5z" /> +<glyph unicode="" d="M1468 1156q28 -28 48 -76t20 -88v-1152q0 -40 -28 -68t-68 -28h-1344q-40 0 -68 28t-28 68v1600q0 40 28 68t68 28h896q40 0 88 -20t76 -48zM1024 1400v-376h376q-10 29 -22 41l-313 313q-12 12 -41 22zM1408 -128v1024h-416q-40 0 -68 28t-28 68v416h-768v-1536h1280z M894 465q33 -26 84 -56q59 7 117 7q147 0 177 -49q16 -22 2 -52q0 -1 -1 -2l-2 -2v-1q-6 -38 -71 -38q-48 0 -115 20t-130 53q-221 -24 -392 -83q-153 -262 -242 -262q-15 0 -28 7l-24 12q-1 1 -6 5q-10 10 -6 36q9 40 56 91.5t132 96.5q14 9 23 -6q2 -2 2 -4q52 85 107 197 q68 136 104 262q-24 82 -30.5 159.5t6.5 127.5q11 40 42 40h21h1q23 0 35 -15q18 -21 9 -68q-2 -6 -4 -8q1 -3 1 -8v-30q-2 -123 -14 -192q55 -164 146 -238zM318 54q52 24 137 158q-51 -40 -87.5 -84t-49.5 -74zM716 974q-15 -42 -2 -132q1 7 7 44q0 3 7 43q1 4 4 8 q-1 1 -1 2t-0.5 1.5t-0.5 1.5q-1 22 -13 36q0 -1 -1 -2v-2zM592 313q135 54 284 81q-2 1 -13 9.5t-16 13.5q-76 67 -127 176q-27 -86 -83 -197q-30 -56 -45 -83zM1238 329q-24 24 -140 24q76 -28 124 -28q14 0 18 1q0 1 -2 3z" /> +<glyph unicode="" d="M1468 1156q28 -28 48 -76t20 -88v-1152q0 -40 -28 -68t-68 -28h-1344q-40 0 -68 28t-28 68v1600q0 40 28 68t68 28h896q40 0 88 -20t76 -48zM1024 1400v-376h376q-10 29 -22 41l-313 313q-12 12 -41 22zM1408 -128v1024h-416q-40 0 -68 28t-28 68v416h-768v-1536h1280z M233 768v-107h70l164 -661h159l128 485q7 20 10 46q2 16 2 24h4l3 -24q1 -3 3.5 -20t5.5 -26l128 -485h159l164 661h70v107h-300v-107h90l-99 -438q-5 -20 -7 -46l-2 -21h-4l-3 21q-1 5 -4 21t-5 25l-144 545h-114l-144 -545q-2 -9 -4.5 -24.5t-3.5 -21.5l-4 -21h-4l-2 21 q-2 26 -7 46l-99 438h90v107h-300z" /> +<glyph unicode="" d="M1468 1156q28 -28 48 -76t20 -88v-1152q0 -40 -28 -68t-68 -28h-1344q-40 0 -68 28t-28 68v1600q0 40 28 68t68 28h896q40 0 88 -20t76 -48zM1024 1400v-376h376q-10 29 -22 41l-313 313q-12 12 -41 22zM1408 -128v1024h-416q-40 0 -68 28t-28 68v416h-768v-1536h1280z M429 106v-106h281v106h-75l103 161q5 7 10 16.5t7.5 13.5t3.5 4h2q1 -4 5 -10q2 -4 4.5 -7.5t6 -8t6.5 -8.5l107 -161h-76v-106h291v106h-68l-192 273l195 282h67v107h-279v-107h74l-103 -159q-4 -7 -10 -16.5t-9 -13.5l-2 -3h-2q-1 4 -5 10q-6 11 -17 23l-106 159h76v107 h-290v-107h68l189 -272l-194 -283h-68z" /> +<glyph unicode="" d="M1468 1156q28 -28 48 -76t20 -88v-1152q0 -40 -28 -68t-68 -28h-1344q-40 0 -68 28t-28 68v1600q0 40 28 68t68 28h896q40 0 88 -20t76 -48zM1024 1400v-376h376q-10 29 -22 41l-313 313q-12 12 -41 22zM1408 -128v1024h-416q-40 0 -68 28t-28 68v416h-768v-1536h1280z M416 106v-106h327v106h-93v167h137q76 0 118 15q67 23 106.5 87t39.5 146q0 81 -37 141t-100 87q-48 19 -130 19h-368v-107h92v-555h-92zM769 386h-119v268h120q52 0 83 -18q56 -33 56 -115q0 -89 -62 -120q-31 -15 -78 -15z" /> +<glyph unicode="" d="M1468 1156q28 -28 48 -76t20 -88v-1152q0 -40 -28 -68t-68 -28h-1344q-40 0 -68 28t-28 68v1600q0 40 28 68t68 28h896q40 0 88 -20t76 -48zM1024 1400v-376h376q-10 29 -22 41l-313 313q-12 12 -41 22zM1408 -128v1024h-416q-40 0 -68 28t-28 68v416h-768v-1536h1280z M1280 320v-320h-1024v192l192 192l128 -128l384 384zM448 512q-80 0 -136 56t-56 136t56 136t136 56t136 -56t56 -136t-56 -136t-136 -56z" /> +<glyph unicode="" d="M640 1152v128h-128v-128h128zM768 1024v128h-128v-128h128zM640 896v128h-128v-128h128zM768 768v128h-128v-128h128zM1468 1156q28 -28 48 -76t20 -88v-1152q0 -40 -28 -68t-68 -28h-1344q-40 0 -68 28t-28 68v1600q0 40 28 68t68 28h896q40 0 88 -20t76 -48zM1024 1400 v-376h376q-10 29 -22 41l-313 313q-12 12 -41 22zM1408 -128v1024h-416q-40 0 -68 28t-28 68v416h-128v-128h-128v128h-512v-1536h1280zM781 593l107 -349q8 -27 8 -52q0 -83 -72.5 -137.5t-183.5 -54.5t-183.5 54.5t-72.5 137.5q0 25 8 52q21 63 120 396v128h128v-128h79 q22 0 39 -13t23 -34zM640 128q53 0 90.5 19t37.5 45t-37.5 45t-90.5 19t-90.5 -19t-37.5 -45t37.5 -45t90.5 -19z" /> +<glyph unicode="" d="M1468 1156q28 -28 48 -76t20 -88v-1152q0 -40 -28 -68t-68 -28h-1344q-40 0 -68 28t-28 68v1600q0 40 28 68t68 28h896q40 0 88 -20t76 -48zM1024 1400v-376h376q-10 29 -22 41l-313 313q-12 12 -41 22zM1408 -128v1024h-416q-40 0 -68 28t-28 68v416h-768v-1536h1280z M620 686q20 -8 20 -30v-544q0 -22 -20 -30q-8 -2 -12 -2q-12 0 -23 9l-166 167h-131q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h131l166 167q16 15 35 7zM1037 -3q31 0 50 24q129 159 129 363t-129 363q-16 21 -43 24t-47 -14q-21 -17 -23.5 -43.5t14.5 -47.5 q100 -123 100 -282t-100 -282q-17 -21 -14.5 -47.5t23.5 -42.5q18 -15 40 -15zM826 145q27 0 47 20q87 93 87 219t-87 219q-18 19 -45 20t-46 -17t-20 -44.5t18 -46.5q52 -57 52 -131t-52 -131q-19 -20 -18 -46.5t20 -44.5q20 -17 44 -17z" /> +<glyph unicode="" d="M1468 1156q28 -28 48 -76t20 -88v-1152q0 -40 -28 -68t-68 -28h-1344q-40 0 -68 28t-28 68v1600q0 40 28 68t68 28h896q40 0 88 -20t76 -48zM1024 1400v-376h376q-10 29 -22 41l-313 313q-12 12 -41 22zM1408 -128v1024h-416q-40 0 -68 28t-28 68v416h-768v-1536h1280z M768 768q52 0 90 -38t38 -90v-384q0 -52 -38 -90t-90 -38h-384q-52 0 -90 38t-38 90v384q0 52 38 90t90 38h384zM1260 766q20 -8 20 -30v-576q0 -22 -20 -30q-8 -2 -12 -2q-14 0 -23 9l-265 266v90l265 266q9 9 23 9q4 0 12 -2z" /> +<glyph unicode="" d="M1468 1156q28 -28 48 -76t20 -88v-1152q0 -40 -28 -68t-68 -28h-1344q-40 0 -68 28t-28 68v1600q0 40 28 68t68 28h896q40 0 88 -20t76 -48zM1024 1400v-376h376q-10 29 -22 41l-313 313q-12 12 -41 22zM1408 -128v1024h-416q-40 0 -68 28t-28 68v416h-768v-1536h1280z M480 768q8 11 21 12.5t24 -6.5l51 -38q11 -8 12.5 -21t-6.5 -24l-182 -243l182 -243q8 -11 6.5 -24t-12.5 -21l-51 -38q-11 -8 -24 -6.5t-21 12.5l-226 301q-14 19 0 38zM1282 467q14 -19 0 -38l-226 -301q-8 -11 -21 -12.5t-24 6.5l-51 38q-11 8 -12.5 21t6.5 24l182 243 l-182 243q-8 11 -6.5 24t12.5 21l51 38q11 8 24 6.5t21 -12.5zM662 6q-13 2 -20.5 13t-5.5 24l138 831q2 13 13 20.5t24 5.5l63 -10q13 -2 20.5 -13t5.5 -24l-138 -831q-2 -13 -13 -20.5t-24 -5.5z" /> +<glyph unicode="" d="M1497 709v-198q-101 -23 -198 -23q-65 -136 -165.5 -271t-181.5 -215.5t-128 -106.5q-80 -45 -162 3q-28 17 -60.5 43.5t-85 83.5t-102.5 128.5t-107.5 184t-105.5 244t-91.5 314.5t-70.5 390h283q26 -218 70 -398.5t104.5 -317t121.5 -235.5t140 -195q169 169 287 406 q-142 72 -223 220t-81 333q0 192 104 314.5t284 122.5q178 0 273 -105.5t95 -297.5q0 -159 -58 -286q-7 -1 -19.5 -3t-46 -2t-63 6t-62 25.5t-50.5 51.5q31 103 31 184q0 87 -29 132t-79 45q-53 0 -85 -49.5t-32 -140.5q0 -186 105 -293.5t267 -107.5q62 0 121 14z" /> +<glyph unicode="" horiz-adv-x="1792" d="M216 367l603 -402v359l-334 223zM154 511l193 129l-193 129v-258zM973 -35l603 402l-269 180l-334 -223v-359zM896 458l272 182l-272 182l-272 -182zM485 733l334 223v359l-603 -402zM1445 640l193 -129v258zM1307 733l269 180l-603 402v-359zM1792 913v-546 q0 -41 -34 -64l-819 -546q-21 -13 -43 -13t-43 13l-819 546q-34 23 -34 64v546q0 41 34 64l819 546q21 13 43 13t43 -13l819 -546q34 -23 34 -64z" /> +<glyph unicode="" horiz-adv-x="2048" d="M1800 764q111 -46 179.5 -145.5t68.5 -221.5q0 -164 -118 -280.5t-285 -116.5q-4 0 -11.5 0.5t-10.5 0.5h-1209h-1h-2h-5q-170 10 -288 125.5t-118 280.5q0 110 55 203t147 147q-12 39 -12 82q0 115 82 196t199 81q95 0 172 -58q75 154 222.5 248t326.5 94 q166 0 306 -80.5t221.5 -218.5t81.5 -301q0 -6 -0.5 -18t-0.5 -18zM468 498q0 -122 84 -193t208 -71q137 0 240 99q-16 20 -47.5 56.5t-43.5 50.5q-67 -65 -144 -65q-55 0 -93.5 33.5t-38.5 87.5q0 53 38.5 87t91.5 34q44 0 84.5 -21t73 -55t65 -75t69 -82t77 -75t97 -55 t121.5 -21q121 0 204.5 71.5t83.5 190.5q0 121 -84 192t-207 71q-143 0 -241 -97q14 -16 29.5 -34t34.5 -40t29 -34q66 64 142 64q52 0 92 -33t40 -84q0 -57 -37 -91.5t-94 -34.5q-43 0 -82.5 21t-72 55t-65.5 75t-69.5 82t-77.5 75t-96.5 55t-118.5 21q-122 0 -207 -70.5 t-85 -189.5z" /> +<glyph unicode="" horiz-adv-x="1792" d="M896 1536q182 0 348 -71t286 -191t191 -286t71 -348t-71 -348t-191 -286t-286 -191t-348 -71t-348 71t-286 191t-191 286t-71 348t71 348t191 286t286 191t348 71zM896 1408q-190 0 -361 -90l194 -194q82 28 167 28t167 -28l194 194q-171 90 -361 90zM218 279l194 194 q-28 82 -28 167t28 167l-194 194q-90 -171 -90 -361t90 -361zM896 -128q190 0 361 90l-194 194q-82 -28 -167 -28t-167 28l-194 -194q171 -90 361 -90zM896 256q159 0 271.5 112.5t112.5 271.5t-112.5 271.5t-271.5 112.5t-271.5 -112.5t-112.5 -271.5t112.5 -271.5 t271.5 -112.5zM1380 473l194 -194q90 171 90 361t-90 361l-194 -194q28 -82 28 -167t-28 -167z" /> +<glyph unicode="" horiz-adv-x="1792" d="M1792 640q0 -182 -71 -348t-191 -286t-286 -191t-348 -71t-348 71t-286 191t-191 286t-71 348q0 222 101 414.5t276.5 317t390.5 155.5v-260q-221 -45 -366.5 -221t-145.5 -406q0 -130 51 -248.5t136.5 -204t204 -136.5t248.5 -51t248.5 51t204 136.5t136.5 204t51 248.5 q0 230 -145.5 406t-366.5 221v260q215 -31 390.5 -155.5t276.5 -317t101 -414.5z" /> +<glyph unicode="" horiz-adv-x="1792" d="M19 662q8 217 116 406t305 318h5q0 -1 -1 -3q-8 -8 -28 -33.5t-52 -76.5t-60 -110.5t-44.5 -135.5t-14 -150.5t39 -157.5t108.5 -154q50 -50 102 -69.5t90.5 -11.5t69.5 23.5t47 32.5l16 16q39 51 53 116.5t6.5 122.5t-21 107t-26.5 80l-14 29q-10 25 -30.5 49.5t-43 41 t-43.5 29.5t-35 19l-13 6l104 115q39 -17 78 -52t59 -61l19 -27q1 48 -18.5 103.5t-40.5 87.5l-20 31l161 183l160 -181q-33 -46 -52.5 -102.5t-22.5 -90.5l-4 -33q22 37 61.5 72.5t67.5 52.5l28 17l103 -115q-44 -14 -85 -50t-60 -65l-19 -29q-31 -56 -48 -133.5t-7 -170 t57 -156.5q33 -45 77.5 -60.5t85 -5.5t76 26.5t57.5 33.5l21 16q60 53 96.5 115t48.5 121.5t10 121.5t-18 118t-37 107.5t-45.5 93t-45 72t-34.5 47.5l-13 17q-14 13 -7 13l10 -3q40 -29 62.5 -46t62 -50t64 -58t58.5 -65t55.5 -77t45.5 -88t38 -103t23.5 -117t10.5 -136 q3 -259 -108 -465t-312 -321t-456 -115q-185 0 -351 74t-283.5 198t-184 293t-60.5 353z" /> +<glyph unicode="" horiz-adv-x="1792" d="M874 -102v-66q-208 6 -385 109.5t-283 275.5l58 34q29 -49 73 -99l65 57q148 -168 368 -212l-17 -86q65 -12 121 -13zM276 428l-83 -28q22 -60 49 -112l-57 -33q-98 180 -98 385t98 385l57 -33q-30 -56 -49 -112l82 -28q-35 -100 -35 -212q0 -109 36 -212zM1528 251 l58 -34q-106 -172 -283 -275.5t-385 -109.5v66q56 1 121 13l-17 86q220 44 368 212l65 -57q44 50 73 99zM1377 805l-233 -80q14 -42 14 -85t-14 -85l232 -80q-31 -92 -98 -169l-185 162q-57 -67 -147 -85l48 -241q-52 -10 -98 -10t-98 10l48 241q-90 18 -147 85l-185 -162 q-67 77 -98 169l232 80q-14 42 -14 85t14 85l-233 80q33 93 99 169l185 -162q59 68 147 86l-48 240q44 10 98 10t98 -10l-48 -240q88 -18 147 -86l185 162q66 -76 99 -169zM874 1448v-66q-65 -2 -121 -13l17 -86q-220 -42 -368 -211l-65 56q-38 -42 -73 -98l-57 33 q106 172 282 275.5t385 109.5zM1705 640q0 -205 -98 -385l-57 33q27 52 49 112l-83 28q36 103 36 212q0 112 -35 212l82 28q-19 56 -49 112l57 33q98 -180 98 -385zM1585 1063l-57 -33q-35 56 -73 98l-65 -56q-148 169 -368 211l17 86q-56 11 -121 13v66q209 -6 385 -109.5 t282 -275.5zM1748 640q0 173 -67.5 331t-181.5 272t-272 181.5t-331 67.5t-331 -67.5t-272 -181.5t-181.5 -272t-67.5 -331t67.5 -331t181.5 -272t272 -181.5t331 -67.5t331 67.5t272 181.5t181.5 272t67.5 331zM1792 640q0 -182 -71 -348t-191 -286t-286 -191t-348 -71 t-348 71t-286 191t-191 286t-71 348t71 348t191 286t286 191t348 71t348 -71t286 -191t191 -286t71 -348z" /> +<glyph unicode="" d="M582 228q0 -66 -93 -66q-107 0 -107 63q0 64 98 64q102 0 102 -61zM546 694q0 -85 -74 -85q-77 0 -77 84q0 90 77 90q36 0 55 -25.5t19 -63.5zM712 769v125q-78 -29 -135 -29q-50 29 -110 29q-86 0 -145 -57t-59 -143q0 -50 29.5 -102t73.5 -67v-3q-38 -17 -38 -85 q0 -53 41 -77v-3q-113 -37 -113 -139q0 -45 20 -78.5t54 -51t72 -25.5t81 -8q224 0 224 188q0 67 -48 99t-126 46q-27 5 -51.5 20.5t-24.5 39.5q0 44 49 52q77 15 122 70t45 134q0 24 -10 52q37 9 49 13zM771 350h137q-2 27 -2 82v387q0 46 2 69h-137q3 -23 3 -71v-392 q0 -50 -3 -75zM1280 366v121q-30 -21 -68 -21q-53 0 -53 82v225h52q9 0 26.5 -1t26.5 -1v117h-105q0 82 3 102h-140q4 -24 4 -55v-47h-60v-117q36 3 37 3q3 0 11 -0.5t12 -0.5v-2h-2v-217q0 -37 2.5 -64t11.5 -56.5t24.5 -48.5t43.5 -31t66 -12q64 0 108 24zM924 1072 q0 36 -24 63.5t-60 27.5t-60.5 -27t-24.5 -64q0 -36 25 -62.5t60 -26.5t59.5 27t24.5 62zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" /> +<glyph unicode="" horiz-adv-x="1792" d="M595 22q0 100 -165 100q-158 0 -158 -104q0 -101 172 -101q151 0 151 105zM536 777q0 61 -30 102t-89 41q-124 0 -124 -145q0 -135 124 -135q119 0 119 137zM805 1101v-202q-36 -12 -79 -22q16 -43 16 -84q0 -127 -73 -216.5t-197 -112.5q-40 -8 -59.5 -27t-19.5 -58 q0 -31 22.5 -51.5t58 -32t78.5 -22t86 -25.5t78.5 -37.5t58 -64t22.5 -98.5q0 -304 -363 -304q-69 0 -130 12.5t-116 41t-87.5 82t-32.5 127.5q0 165 182 225v4q-67 41 -67 126q0 109 63 137v4q-72 24 -119.5 108.5t-47.5 165.5q0 139 95 231.5t235 92.5q96 0 178 -47 q98 0 218 47zM1123 220h-222q4 45 4 134v609q0 94 -4 128h222q-4 -33 -4 -124v-613q0 -89 4 -134zM1724 442v-196q-71 -39 -174 -39q-62 0 -107 20t-70 50t-39.5 78t-18.5 92t-4 103v351h2v4q-7 0 -19 1t-18 1q-21 0 -59 -6v190h96v76q0 54 -6 89h227q-6 -41 -6 -165h171 v-190q-15 0 -43.5 2t-42.5 2h-85v-365q0 -131 87 -131q61 0 109 33zM1148 1389q0 -58 -39 -101.5t-96 -43.5q-58 0 -98 43.5t-40 101.5q0 59 39.5 103t98.5 44q58 0 96.5 -44.5t38.5 -102.5z" /> +<glyph unicode="" d="M825 547l343 588h-150q-21 -39 -63.5 -118.5t-68 -128.5t-59.5 -118.5t-60 -128.5h-3q-21 48 -44.5 97t-52 105.5t-46.5 92t-54 104.5t-49 95h-150l323 -589v-435h134v436zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960 q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" /> +<glyph unicode="" horiz-adv-x="1280" d="M842 964q0 -80 -57 -136.5t-136 -56.5q-60 0 -111 35q-62 -67 -115 -146q-247 -371 -202 -859q1 -22 -12.5 -38.5t-34.5 -18.5h-5q-20 0 -35 13.5t-17 33.5q-14 126 -3.5 247.5t29.5 217t54 186t69 155.5t74 125q61 90 132 165q-16 35 -16 77q0 80 56.5 136.5t136.5 56.5 t136.5 -56.5t56.5 -136.5zM1223 953q0 -158 -78 -292t-212.5 -212t-292.5 -78q-64 0 -131 14q-21 5 -32.5 23.5t-6.5 39.5q5 20 23 31.5t39 7.5q51 -13 108 -13q97 0 186 38t153 102t102 153t38 186t-38 186t-102 153t-153 102t-186 38t-186 -38t-153 -102t-102 -153 t-38 -186q0 -114 52 -218q10 -20 3.5 -40t-25.5 -30t-39.5 -3t-30.5 26q-64 123 -64 265q0 119 46.5 227t124.5 186t186 124t226 46q158 0 292.5 -78t212.5 -212.5t78 -292.5z" /> +<glyph unicode="" horiz-adv-x="1792" d="M270 730q-8 19 -8 52q0 20 11 49t24 45q-1 22 7.5 53t22.5 43q0 139 92.5 288.5t217.5 209.5q139 66 324 66q133 0 266 -55q49 -21 90 -48t71 -56t55 -68t42 -74t32.5 -84.5t25.5 -89.5t22 -98l1 -5q55 -83 55 -150q0 -14 -9 -40t-9 -38q0 -1 1.5 -3.5t3.5 -5t2 -3.5 q77 -114 120.5 -214.5t43.5 -208.5q0 -43 -19.5 -100t-55.5 -57q-9 0 -19.5 7.5t-19 17.5t-19 26t-16 26.5t-13.5 26t-9 17.5q-1 1 -3 1l-5 -4q-59 -154 -132 -223q20 -20 61.5 -38.5t69 -41.5t35.5 -65q-2 -4 -4 -16t-7 -18q-64 -97 -302 -97q-53 0 -110.5 9t-98 20 t-104.5 30q-15 5 -23 7q-14 4 -46 4.5t-40 1.5q-41 -45 -127.5 -65t-168.5 -20q-35 0 -69 1.5t-93 9t-101 20.5t-74.5 40t-32.5 64q0 40 10 59.5t41 48.5q11 2 40.5 13t49.5 12q4 0 14 2q2 2 2 4l-2 3q-48 11 -108 105.5t-73 156.5l-5 3q-4 0 -12 -20q-18 -41 -54.5 -74.5 t-77.5 -37.5h-1q-4 0 -6 4.5t-5 5.5q-23 54 -23 100q0 275 252 466z" /> +<glyph unicode="" horiz-adv-x="2048" d="M580 1075q0 41 -25 66t-66 25q-43 0 -76 -25.5t-33 -65.5q0 -39 33 -64.5t76 -25.5q41 0 66 24.5t25 65.5zM1323 568q0 28 -25.5 50t-65.5 22q-27 0 -49.5 -22.5t-22.5 -49.5q0 -28 22.5 -50.5t49.5 -22.5q40 0 65.5 22t25.5 51zM1087 1075q0 41 -24.5 66t-65.5 25 q-43 0 -76 -25.5t-33 -65.5q0 -39 33 -64.5t76 -25.5q41 0 65.5 24.5t24.5 65.5zM1722 568q0 28 -26 50t-65 22q-27 0 -49.5 -22.5t-22.5 -49.5q0 -28 22.5 -50.5t49.5 -22.5q39 0 65 22t26 51zM1456 965q-31 4 -70 4q-169 0 -311 -77t-223.5 -208.5t-81.5 -287.5 q0 -78 23 -152q-35 -3 -68 -3q-26 0 -50 1.5t-55 6.5t-44.5 7t-54.5 10.5t-50 10.5l-253 -127l72 218q-290 203 -290 490q0 169 97.5 311t264 223.5t363.5 81.5q176 0 332.5 -66t262 -182.5t136.5 -260.5zM2048 404q0 -117 -68.5 -223.5t-185.5 -193.5l55 -181l-199 109 q-150 -37 -218 -37q-169 0 -311 70.5t-223.5 191.5t-81.5 264t81.5 264t223.5 191.5t311 70.5q161 0 303 -70.5t227.5 -192t85.5 -263.5z" /> +<glyph unicode="" horiz-adv-x="1792" d="M1764 1525q33 -24 27 -64l-256 -1536q-5 -29 -32 -45q-14 -8 -31 -8q-11 0 -24 5l-453 185l-242 -295q-18 -23 -49 -23q-13 0 -22 4q-19 7 -30.5 23.5t-11.5 36.5v349l864 1059l-1069 -925l-395 162q-37 14 -40 55q-2 40 32 59l1664 960q15 9 32 9q20 0 36 -11z" /> +<glyph unicode="" horiz-adv-x="1792" d="M1764 1525q33 -24 27 -64l-256 -1536q-5 -29 -32 -45q-14 -8 -31 -8q-11 0 -24 5l-527 215l-298 -327q-18 -21 -47 -21q-14 0 -23 4q-19 7 -30 23.5t-11 36.5v452l-472 193q-37 14 -40 55q-3 39 32 59l1664 960q35 21 68 -2zM1422 26l221 1323l-1434 -827l336 -137 l863 639l-478 -797z" /> +<glyph unicode="" d="M1536 640q0 -156 -61 -298t-164 -245t-245 -164t-298 -61q-172 0 -327 72.5t-264 204.5q-7 10 -6.5 22.5t8.5 20.5l137 138q10 9 25 9q16 -2 23 -12q73 -95 179 -147t225 -52q104 0 198.5 40.5t163.5 109.5t109.5 163.5t40.5 198.5t-40.5 198.5t-109.5 163.5 t-163.5 109.5t-198.5 40.5q-98 0 -188 -35.5t-160 -101.5l137 -138q31 -30 14 -69q-17 -40 -59 -40h-448q-26 0 -45 19t-19 45v448q0 42 40 59q39 17 69 -14l130 -129q107 101 244.5 156.5t284.5 55.5q156 0 298 -61t245 -164t164 -245t61 -298zM896 928v-448q0 -14 -9 -23 t-23 -9h-320q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h224v352q0 14 9 23t23 9h64q14 0 23 -9t9 -23z" /> +<glyph unicode="" d="M768 1280q-130 0 -248.5 -51t-204 -136.5t-136.5 -204t-51 -248.5t51 -248.5t136.5 -204t204 -136.5t248.5 -51t248.5 51t204 136.5t136.5 204t51 248.5t-51 248.5t-136.5 204t-204 136.5t-248.5 51zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103 t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" /> +<glyph unicode="" horiz-adv-x="1792" d="M1682 -128q-44 0 -132.5 3.5t-133.5 3.5q-44 0 -132 -3.5t-132 -3.5q-24 0 -37 20.5t-13 45.5q0 31 17 46t39 17t51 7t45 15q33 21 33 140l-1 391q0 21 -1 31q-13 4 -50 4h-675q-38 0 -51 -4q-1 -10 -1 -31l-1 -371q0 -142 37 -164q16 -10 48 -13t57 -3.5t45 -15 t20 -45.5q0 -26 -12.5 -48t-36.5 -22q-47 0 -139.5 3.5t-138.5 3.5q-43 0 -128 -3.5t-127 -3.5q-23 0 -35.5 21t-12.5 45q0 30 15.5 45t36 17.5t47.5 7.5t42 15q33 23 33 143l-1 57v813q0 3 0.5 26t0 36.5t-1.5 38.5t-3.5 42t-6.5 36.5t-11 31.5t-16 18q-15 10 -45 12t-53 2 t-41 14t-18 45q0 26 12 48t36 22q46 0 138.5 -3.5t138.5 -3.5q42 0 126.5 3.5t126.5 3.5q25 0 37.5 -22t12.5 -48q0 -30 -17 -43.5t-38.5 -14.5t-49.5 -4t-43 -13q-35 -21 -35 -160l1 -320q0 -21 1 -32q13 -3 39 -3h699q25 0 38 3q1 11 1 32l1 320q0 139 -35 160 q-18 11 -58.5 12.5t-66 13t-25.5 49.5q0 26 12.5 48t37.5 22q44 0 132 -3.5t132 -3.5q43 0 129 3.5t129 3.5q25 0 37.5 -22t12.5 -48q0 -30 -17.5 -44t-40 -14.5t-51.5 -3t-44 -12.5q-35 -23 -35 -161l1 -943q0 -119 34 -140q16 -10 46 -13.5t53.5 -4.5t41.5 -15.5t18 -44.5 q0 -26 -12 -48t-36 -22z" /> +<glyph unicode="" horiz-adv-x="1280" d="M1278 1347v-73q0 -29 -18.5 -61t-42.5 -32q-50 0 -54 -1q-26 -6 -32 -31q-3 -11 -3 -64v-1152q0 -25 -18 -43t-43 -18h-108q-25 0 -43 18t-18 43v1218h-143v-1218q0 -25 -17.5 -43t-43.5 -18h-108q-26 0 -43.5 18t-17.5 43v496q-147 12 -245 59q-126 58 -192 179 q-64 117 -64 259q0 166 88 286q88 118 209 159q111 37 417 37h479q25 0 43 -18t18 -43z" /> +<glyph unicode="" d="M352 128v-128h-352v128h352zM704 256q26 0 45 -19t19 -45v-256q0 -26 -19 -45t-45 -19h-256q-26 0 -45 19t-19 45v256q0 26 19 45t45 19h256zM864 640v-128h-864v128h864zM224 1152v-128h-224v128h224zM1536 128v-128h-736v128h736zM576 1280q26 0 45 -19t19 -45v-256 q0 -26 -19 -45t-45 -19h-256q-26 0 -45 19t-19 45v256q0 26 19 45t45 19h256zM1216 768q26 0 45 -19t19 -45v-256q0 -26 -19 -45t-45 -19h-256q-26 0 -45 19t-19 45v256q0 26 19 45t45 19h256zM1536 640v-128h-224v128h224zM1536 1152v-128h-864v128h864z" /> +<glyph unicode="" d="M1216 512q133 0 226.5 -93.5t93.5 -226.5t-93.5 -226.5t-226.5 -93.5t-226.5 93.5t-93.5 226.5q0 12 2 34l-360 180q-92 -86 -218 -86q-133 0 -226.5 93.5t-93.5 226.5t93.5 226.5t226.5 93.5q126 0 218 -86l360 180q-2 22 -2 34q0 133 93.5 226.5t226.5 93.5 t226.5 -93.5t93.5 -226.5t-93.5 -226.5t-226.5 -93.5q-126 0 -218 86l-360 -180q2 -22 2 -34t-2 -34l360 -180q92 86 218 86z" /> +<glyph unicode="" d="M1280 341q0 88 -62.5 151t-150.5 63q-84 0 -145 -58l-241 120q2 16 2 23t-2 23l241 120q61 -58 145 -58q88 0 150.5 63t62.5 151t-62.5 150.5t-150.5 62.5t-151 -62.5t-63 -150.5q0 -7 2 -23l-241 -120q-62 57 -145 57q-88 0 -150.5 -62.5t-62.5 -150.5t62.5 -150.5 t150.5 -62.5q83 0 145 57l241 -120q-2 -16 -2 -23q0 -88 63 -150.5t151 -62.5t150.5 62.5t62.5 150.5zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" /> +<glyph unicode="" horiz-adv-x="1792" d="M571 947q-10 25 -34 35t-49 0q-108 -44 -191 -127t-127 -191q-10 -25 0 -49t35 -34q13 -5 24 -5q42 0 60 40q34 84 98.5 148.5t148.5 98.5q25 11 35 35t0 49zM1513 1303l46 -46l-244 -243l68 -68q19 -19 19 -45.5t-19 -45.5l-64 -64q89 -161 89 -343q0 -143 -55.5 -273.5 t-150 -225t-225 -150t-273.5 -55.5t-273.5 55.5t-225 150t-150 225t-55.5 273.5t55.5 273.5t150 225t225 150t273.5 55.5q182 0 343 -89l64 64q19 19 45.5 19t45.5 -19l68 -68zM1521 1359q-10 -10 -22 -10q-13 0 -23 10l-91 90q-9 10 -9 23t9 23q10 9 23 9t23 -9l90 -91 q10 -9 10 -22.5t-10 -22.5zM1751 1129q-11 -9 -23 -9t-23 9l-90 91q-10 9 -10 22.5t10 22.5q9 10 22.5 10t22.5 -10l91 -90q9 -10 9 -23t-9 -23zM1792 1312q0 -14 -9 -23t-23 -9h-96q-14 0 -23 9t-9 23t9 23t23 9h96q14 0 23 -9t9 -23zM1600 1504v-96q0 -14 -9 -23t-23 -9 t-23 9t-9 23v96q0 14 9 23t23 9t23 -9t9 -23zM1751 1449l-91 -90q-10 -10 -22 -10q-13 0 -23 10q-10 9 -10 22.5t10 22.5l90 91q10 9 23 9t23 -9q9 -10 9 -23t-9 -23z" /> +<glyph unicode="" horiz-adv-x="1792" d="M609 720l287 208l287 -208l-109 -336h-355zM896 1536q182 0 348 -71t286 -191t191 -286t71 -348t-71 -348t-191 -286t-286 -191t-348 -71t-348 71t-286 191t-191 286t-71 348t71 348t191 286t286 191t348 71zM1515 186q149 203 149 454v3l-102 -89l-240 224l63 323 l134 -12q-150 206 -389 282l53 -124l-287 -159l-287 159l53 124q-239 -76 -389 -282l135 12l62 -323l-240 -224l-102 89v-3q0 -251 149 -454l30 132l326 -40l139 -298l-116 -69q117 -39 240 -39t240 39l-116 69l139 298l326 40z" /> +<glyph unicode="" horiz-adv-x="1792" d="M448 224v-192q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h192q14 0 23 -9t9 -23zM256 608v-192q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h192q14 0 23 -9t9 -23zM832 224v-192q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23 v192q0 14 9 23t23 9h192q14 0 23 -9t9 -23zM640 608v-192q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h192q14 0 23 -9t9 -23zM66 768q-28 0 -47 19t-19 46v129h514v-129q0 -27 -19 -46t-46 -19h-383zM1216 224v-192q0 -14 -9 -23t-23 -9h-192 q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h192q14 0 23 -9t9 -23zM1024 608v-192q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h192q14 0 23 -9t9 -23zM1600 224v-192q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h192q14 0 23 -9t9 -23 zM1408 608v-192q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h192q14 0 23 -9t9 -23zM1792 1016v-13h-514v10q0 104 -382 102q-382 -1 -382 -102v-10h-514v13q0 17 8.5 43t34 64t65.5 75.5t110.5 76t160 67.5t224 47.5t293.5 18.5t293 -18.5t224 -47.5 t160.5 -67.5t110.5 -76t65.5 -75.5t34 -64t8.5 -43zM1792 608v-192q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h192q14 0 23 -9t9 -23zM1792 962v-129q0 -27 -19 -46t-46 -19h-384q-27 0 -46 19t-19 46v129h514z" /> +<glyph unicode="" horiz-adv-x="1792" d="M704 1216v-768q0 -26 -19 -45t-45 -19v-576q0 -26 -19 -45t-45 -19h-512q-26 0 -45 19t-19 45v512l249 873q7 23 31 23h424zM1024 1216v-704h-256v704h256zM1792 320v-512q0 -26 -19 -45t-45 -19h-512q-26 0 -45 19t-19 45v576q-26 0 -45 19t-19 45v768h424q24 0 31 -23z M736 1504v-224h-352v224q0 14 9 23t23 9h288q14 0 23 -9t9 -23zM1408 1504v-224h-352v224q0 14 9 23t23 9h288q14 0 23 -9t9 -23z" /> +<glyph unicode="" horiz-adv-x="1792" d="M1755 1083q37 -37 37 -90t-37 -91l-401 -400l150 -150l-160 -160q-163 -163 -389.5 -186.5t-411.5 100.5l-362 -362h-181v181l362 362q-124 185 -100.5 411.5t186.5 389.5l160 160l150 -150l400 401q38 37 91 37t90 -37t37 -90.5t-37 -90.5l-400 -401l234 -234l401 400 q38 37 91 37t90 -37z" /> +<glyph unicode="" horiz-adv-x="1792" d="M873 796q0 -83 -63.5 -142.5t-152.5 -59.5t-152.5 59.5t-63.5 142.5q0 84 63.5 143t152.5 59t152.5 -59t63.5 -143zM1375 796q0 -83 -63 -142.5t-153 -59.5q-89 0 -152.5 59.5t-63.5 142.5q0 84 63.5 143t152.5 59q90 0 153 -59t63 -143zM1600 616v667q0 87 -32 123.5 t-111 36.5h-1112q-83 0 -112.5 -34t-29.5 -126v-673q43 -23 88.5 -40t81 -28t81 -18.5t71 -11t70 -4t58.5 -0.5t56.5 2t44.5 2q68 1 95 -27q6 -6 10 -9q26 -25 61 -51q7 91 118 87q5 0 36.5 -1.5t43 -2t45.5 -1t53 1t54.5 4.5t61 8.5t62 13.5t67 19.5t67.5 27t72 34.5z M1763 621q-121 -149 -372 -252q84 -285 -23 -465q-66 -113 -183 -148q-104 -32 -182 15q-86 51 -82 164l-1 326v1q-8 2 -24.5 6t-23.5 5l-1 -338q4 -114 -83 -164q-79 -47 -183 -15q-117 36 -182 150q-105 180 -22 463q-251 103 -372 252q-25 37 -4 63t60 -1q3 -2 11 -7 t11 -8v694q0 72 47 123t114 51h1257q67 0 114 -51t47 -123v-694l21 15q39 27 60 1t-4 -63z" /> +<glyph unicode="" horiz-adv-x="1792" d="M896 1102v-434h-145v434h145zM1294 1102v-434h-145v434h145zM1294 342l253 254v795h-1194v-1049h326v-217l217 217h398zM1692 1536v-1013l-434 -434h-326l-217 -217h-217v217h-398v1158l109 289h1483z" /> +<glyph unicode="" d="M773 217v-127q-1 -292 -6 -305q-12 -32 -51 -40q-54 -9 -181.5 38t-162.5 89q-13 15 -17 36q-1 12 4 26q4 10 34 47t181 216q1 0 60 70q15 19 39.5 24.5t49.5 -3.5q24 -10 37.5 -29t12.5 -42zM624 468q-3 -55 -52 -70l-120 -39q-275 -88 -292 -88q-35 2 -54 36 q-12 25 -17 75q-8 76 1 166.5t30 124.5t56 32q13 0 202 -77q70 -29 115 -47l84 -34q23 -9 35.5 -30.5t11.5 -48.5zM1450 171q-7 -54 -91.5 -161t-135.5 -127q-37 -14 -63 7q-14 10 -184 287l-47 77q-14 21 -11.5 46t19.5 46q35 43 83 26q1 -1 119 -40q203 -66 242 -79.5 t47 -20.5q28 -22 22 -61zM778 803q5 -102 -54 -122q-58 -17 -114 71l-378 598q-8 35 19 62q41 43 207.5 89.5t224.5 31.5q40 -10 49 -45q3 -18 22 -305.5t24 -379.5zM1440 695q3 -39 -26 -59q-15 -10 -329 -86q-67 -15 -91 -23l1 2q-23 -6 -46 4t-37 32q-30 47 0 87 q1 1 75 102q125 171 150 204t34 39q28 19 65 2q48 -23 123 -133.5t81 -167.5v-3z" /> +<glyph unicode="" horiz-adv-x="2048" d="M1024 1024h-384v-384h384v384zM1152 384v-128h-640v128h640zM1152 1152v-640h-640v640h640zM1792 384v-128h-512v128h512zM1792 640v-128h-512v128h512zM1792 896v-128h-512v128h512zM1792 1152v-128h-512v128h512zM256 192v960h-128v-960q0 -26 19 -45t45 -19t45 19 t19 45zM1920 192v1088h-1536v-1088q0 -33 -11 -64h1483q26 0 45 19t19 45zM2048 1408v-1216q0 -80 -56 -136t-136 -56h-1664q-80 0 -136 56t-56 136v1088h256v128h1792z" /> +<glyph unicode="" horiz-adv-x="2048" d="M1024 13q-20 0 -93 73.5t-73 93.5q0 32 62.5 54t103.5 22t103.5 -22t62.5 -54q0 -20 -73 -93.5t-93 -73.5zM1294 284q-2 0 -40 25t-101.5 50t-128.5 25t-128.5 -25t-101 -50t-40.5 -25q-18 0 -93.5 75t-75.5 93q0 13 10 23q78 77 196 121t233 44t233 -44t196 -121 q10 -10 10 -23q0 -18 -75.5 -93t-93.5 -75zM1567 556q-11 0 -23 8q-136 105 -252 154.5t-268 49.5q-85 0 -170.5 -22t-149 -53t-113.5 -62t-79 -53t-31 -22q-17 0 -92 75t-75 93q0 12 10 22q132 132 320 205t380 73t380 -73t320 -205q10 -10 10 -22q0 -18 -75 -93t-92 -75z M1838 827q-11 0 -22 9q-179 157 -371.5 236.5t-420.5 79.5t-420.5 -79.5t-371.5 -236.5q-11 -9 -22 -9q-17 0 -92.5 75t-75.5 93q0 13 10 23q187 186 445 288t527 102t527 -102t445 -288q10 -10 10 -23q0 -18 -75.5 -93t-92.5 -75z" /> +<glyph unicode="" horiz-adv-x="1792" d="M384 0q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM768 0q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM384 384q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5 t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM1152 0q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM768 384q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5 t37.5 90.5zM384 768q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM1152 384q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM768 768q0 53 -37.5 90.5t-90.5 37.5 t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM1536 0v384q0 52 -38 90t-90 38t-90 -38t-38 -90v-384q0 -52 38 -90t90 -38t90 38t38 90zM1152 768q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5z M1536 1088v256q0 26 -19 45t-45 19h-1280q-26 0 -45 -19t-19 -45v-256q0 -26 19 -45t45 -19h1280q26 0 45 19t19 45zM1536 768q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM1664 1408v-1536q0 -52 -38 -90t-90 -38 h-1408q-52 0 -90 38t-38 90v1536q0 52 38 90t90 38h1408q52 0 90 -38t38 -90z" /> +<glyph unicode="" horiz-adv-x="1792" d="M1112 1090q0 159 -237 159h-70q-32 0 -59.5 -21.5t-34.5 -52.5l-63 -276q-2 -5 -2 -16q0 -24 17 -39.5t41 -15.5h53q69 0 128.5 13t112.5 41t83.5 81.5t30.5 126.5zM1716 938q0 -265 -220 -428q-219 -161 -612 -161h-61q-32 0 -59 -21.5t-34 -52.5l-73 -316 q-8 -36 -40.5 -61.5t-69.5 -25.5h-213q-31 0 -53 20t-22 51q0 10 13 65h151q34 0 64 23.5t38 56.5l73 316q8 33 37.5 57t63.5 24h61q390 0 607 160t217 421q0 129 -51 207q183 -92 183 -335zM1533 1123q0 -264 -221 -428q-218 -161 -612 -161h-60q-32 0 -59.5 -22t-34.5 -53 l-73 -315q-8 -36 -40 -61.5t-69 -25.5h-214q-31 0 -52.5 19.5t-21.5 51.5q0 8 2 20l300 1301q8 36 40.5 61.5t69.5 25.5h444q68 0 125 -4t120.5 -15t113.5 -30t96.5 -50.5t77.5 -74t49.5 -103.5t18.5 -136z" /> +<glyph unicode="" horiz-adv-x="1792" d="M602 949q19 -61 31 -123.5t17 -141.5t-14 -159t-62 -145q-21 81 -67 157t-95.5 127t-99 90.5t-78.5 57.5t-33 19q-62 34 -81.5 100t14.5 128t101 81.5t129 -14.5q138 -83 238 -177zM927 1236q11 -25 20.5 -46t36.5 -100.5t42.5 -150.5t25.5 -179.5t0 -205.5t-47.5 -209.5 t-105.5 -208.5q-51 -72 -138 -72q-54 0 -98 31q-57 40 -69 109t28 127q60 85 81 195t13 199.5t-32 180.5t-39 128t-22 52q-31 63 -8.5 129.5t85.5 97.5q34 17 75 17q47 0 88.5 -25t63.5 -69zM1248 567q-17 -160 -72 -311q-17 131 -63 246q25 174 -5 361q-27 178 -94 342 q114 -90 212 -211q9 -37 15 -80q26 -179 7 -347zM1520 1440q9 -17 23.5 -49.5t43.5 -117.5t50.5 -178t34 -227.5t5 -269t-47 -300t-112.5 -323.5q-22 -48 -66 -75.5t-95 -27.5q-39 0 -74 16q-67 31 -92.5 100t4.5 136q58 126 90 257.5t37.5 239.5t-3.5 213.5t-26.5 180.5 t-38.5 138.5t-32.5 90t-15.5 32.5q-34 65 -11.5 135.5t87.5 104.5q37 20 81 20q49 0 91.5 -25.5t66.5 -70.5z" /> +<glyph unicode="" horiz-adv-x="2304" d="M1975 546h-138q14 37 66 179l3 9q4 10 10 26t9 26l12 -55zM531 611l-58 295q-11 54 -75 54h-268l-2 -13q311 -79 403 -336zM710 960l-162 -438l-17 89q-26 70 -85 129.5t-131 88.5l135 -510h175l261 641h-176zM849 318h166l104 642h-166zM1617 944q-69 27 -149 27 q-123 0 -201 -59t-79 -153q-1 -102 145 -174q48 -23 67 -41t19 -39q0 -30 -30 -46t-69 -16q-86 0 -156 33l-22 11l-23 -144q74 -34 185 -34q130 -1 208.5 59t80.5 160q0 106 -140 174q-49 25 -71 42t-22 38q0 22 24.5 38.5t70.5 16.5q70 1 124 -24l15 -8zM2042 960h-128 q-65 0 -87 -54l-246 -588h174l35 96h212q5 -22 20 -96h154zM2304 1280v-1280q0 -52 -38 -90t-90 -38h-2048q-52 0 -90 38t-38 90v1280q0 52 38 90t90 38h2048q52 0 90 -38t38 -90z" /> +<glyph unicode="" horiz-adv-x="2304" d="M671 603h-13q-47 0 -47 -32q0 -22 20 -22q17 0 28 15t12 39zM1066 639h62v3q1 4 0.5 6.5t-1 7t-2 8t-4.5 6.5t-7.5 5t-11.5 2q-28 0 -36 -38zM1606 603h-12q-48 0 -48 -32q0 -22 20 -22q17 0 28 15t12 39zM1925 629q0 41 -30 41q-19 0 -31 -20t-12 -51q0 -42 28 -42 q20 0 32.5 20t12.5 52zM480 770h87l-44 -262h-56l32 201l-71 -201h-39l-4 200l-34 -200h-53l44 262h81l2 -163zM733 663q0 -6 -4 -42q-16 -101 -17 -113h-47l1 22q-20 -26 -58 -26q-23 0 -37.5 16t-14.5 42q0 39 26 60.5t73 21.5q14 0 23 -1q0 3 0.5 5.5t1 4.5t0.5 3 q0 20 -36 20q-29 0 -59 -10q0 4 7 48q38 11 67 11q74 0 74 -62zM889 721l-8 -49q-22 3 -41 3q-27 0 -27 -17q0 -8 4.5 -12t21.5 -11q40 -19 40 -60q0 -72 -87 -71q-34 0 -58 6q0 2 7 49q29 -8 51 -8q32 0 32 19q0 7 -4.5 11.5t-21.5 12.5q-43 20 -43 59q0 72 84 72 q30 0 50 -4zM977 721h28l-7 -52h-29q-2 -17 -6.5 -40.5t-7 -38.5t-2.5 -18q0 -16 19 -16q8 0 16 2l-8 -47q-21 -7 -40 -7q-43 0 -45 47q0 12 8 56q3 20 25 146h55zM1180 648q0 -23 -7 -52h-111q-3 -22 10 -33t38 -11q30 0 58 14l-9 -54q-30 -8 -57 -8q-95 0 -95 95 q0 55 27.5 90.5t69.5 35.5q35 0 55.5 -21t20.5 -56zM1319 722q-13 -23 -22 -62q-22 2 -31 -24t-25 -128h-56l3 14q22 130 29 199h51l-3 -33q14 21 25.5 29.5t28.5 4.5zM1506 763l-9 -57q-28 14 -50 14q-31 0 -51 -27.5t-20 -70.5q0 -30 13.5 -47t38.5 -17q21 0 48 13 l-10 -59q-28 -8 -50 -8q-45 0 -71.5 30.5t-26.5 82.5q0 70 35.5 114.5t91.5 44.5q26 0 61 -13zM1668 663q0 -18 -4 -42q-13 -79 -17 -113h-46l1 22q-20 -26 -59 -26q-23 0 -37 16t-14 42q0 39 25.5 60.5t72.5 21.5q15 0 23 -1q2 7 2 13q0 20 -36 20q-29 0 -59 -10q0 4 8 48 q38 11 67 11q73 0 73 -62zM1809 722q-14 -24 -21 -62q-23 2 -31.5 -23t-25.5 -129h-56l3 14q19 104 29 199h52q0 -11 -4 -33q15 21 26.5 29.5t27.5 4.5zM1950 770h56l-43 -262h-53l3 19q-23 -23 -52 -23q-31 0 -49.5 24t-18.5 64q0 53 27.5 92t64.5 39q31 0 53 -29z M2061 640q0 148 -72.5 273t-198 198t-273.5 73q-181 0 -328 -110q127 -116 171 -284h-50q-44 150 -158 253q-114 -103 -158 -253h-50q44 168 171 284q-147 110 -328 110q-148 0 -273.5 -73t-198 -198t-72.5 -273t72.5 -273t198 -198t273.5 -73q181 0 328 110 q-120 111 -165 264h50q46 -138 152 -233q106 95 152 233h50q-45 -153 -165 -264q147 -110 328 -110q148 0 273.5 73t198 198t72.5 273zM2304 1280v-1280q0 -52 -38 -90t-90 -38h-2048q-52 0 -90 38t-38 90v1280q0 52 38 90t90 38h2048q52 0 90 -38t38 -90z" /> +<glyph unicode="" horiz-adv-x="2304" d="M313 759q0 -51 -36 -84q-29 -26 -89 -26h-17v220h17q61 0 89 -27q36 -31 36 -83zM2089 824q0 -52 -64 -52h-19v101h20q63 0 63 -49zM380 759q0 74 -50 120.5t-129 46.5h-95v-333h95q74 0 119 38q60 51 60 128zM410 593h65v333h-65v-333zM730 694q0 40 -20.5 62t-75.5 42 q-29 10 -39.5 19t-10.5 23q0 16 13.5 26.5t34.5 10.5q29 0 53 -27l34 44q-41 37 -98 37q-44 0 -74 -27.5t-30 -67.5q0 -35 18 -55.5t64 -36.5q37 -13 45 -19q19 -12 19 -34q0 -20 -14 -33.5t-36 -13.5q-48 0 -71 44l-42 -40q44 -64 115 -64q51 0 83 30.5t32 79.5zM1008 604 v77q-37 -37 -78 -37q-49 0 -80.5 32.5t-31.5 82.5q0 48 31.5 81.5t77.5 33.5q43 0 81 -38v77q-40 20 -80 20q-74 0 -125.5 -50.5t-51.5 -123.5t51 -123.5t125 -50.5q42 0 81 19zM2240 0v527q-65 -40 -144.5 -84t-237.5 -117t-329.5 -137.5t-417.5 -134.5t-504 -118h1569 q26 0 45 19t19 45zM1389 757q0 75 -53 128t-128 53t-128 -53t-53 -128t53 -128t128 -53t128 53t53 128zM1541 584l144 342h-71l-90 -224l-89 224h-71l142 -342h35zM1714 593h184v56h-119v90h115v56h-115v74h119v57h-184v-333zM2105 593h80l-105 140q76 16 76 94q0 47 -31 73 t-87 26h-97v-333h65v133h9zM2304 1274v-1268q0 -56 -38.5 -95t-93.5 -39h-2040q-55 0 -93.5 39t-38.5 95v1268q0 56 38.5 95t93.5 39h2040q55 0 93.5 -39t38.5 -95z" /> +<glyph unicode="" horiz-adv-x="2304" d="M119 854h89l-45 108zM740 328l74 79l-70 79h-163v-49h142v-55h-142v-54h159zM898 406l99 -110v217zM1186 453q0 33 -40 33h-84v-69h83q41 0 41 36zM1475 457q0 29 -42 29h-82v-61h81q43 0 43 32zM1197 923q0 29 -42 29h-82v-60h81q43 0 43 31zM1656 854h89l-44 108z M699 1009v-271h-66v212l-94 -212h-57l-94 212v-212h-132l-25 60h-135l-25 -60h-70l116 271h96l110 -257v257h106l85 -184l77 184h108zM1255 453q0 -20 -5.5 -35t-14 -25t-22.5 -16.5t-26 -10t-31.5 -4.5t-31.5 -1t-32.5 0.5t-29.5 0.5v-91h-126l-80 90l-83 -90h-256v271h260 l80 -89l82 89h207q109 0 109 -89zM964 794v-56h-217v271h217v-57h-152v-49h148v-55h-148v-54h152zM2304 235v-229q0 -55 -38.5 -94.5t-93.5 -39.5h-2040q-55 0 -93.5 39.5t-38.5 94.5v678h111l25 61h55l25 -61h218v46l19 -46h113l20 47v-47h541v99l10 1q10 0 10 -14v-86h279 v23q23 -12 55 -18t52.5 -6.5t63 0.5t51.5 1l25 61h56l25 -61h227v58l34 -58h182v378h-180v-44l-25 44h-185v-44l-23 44h-249q-69 0 -109 -22v22h-172v-22q-24 22 -73 22h-628l-43 -97l-43 97h-198v-44l-22 44h-169l-78 -179v391q0 55 38.5 94.5t93.5 39.5h2040 q55 0 93.5 -39.5t38.5 -94.5v-678h-120q-51 0 -81 -22v22h-177q-55 0 -78 -22v22h-316v-22q-31 22 -87 22h-209v-22q-23 22 -91 22h-234l-54 -58l-50 58h-349v-378h343l55 59l52 -59h211v89h21q59 0 90 13v-102h174v99h8q8 0 10 -2t2 -10v-87h529q57 0 88 24v-24h168 q60 0 95 17zM1546 469q0 -23 -12 -43t-34 -29q25 -9 34 -26t9 -46v-54h-65v45q0 33 -12 43.5t-46 10.5h-69v-99h-65v271h154q48 0 77 -15t29 -58zM1269 936q0 -24 -12.5 -44t-33.5 -29q26 -9 34.5 -25.5t8.5 -46.5v-53h-65q0 9 0.5 26.5t0 25t-3 18.5t-8.5 16t-17.5 8.5 t-29.5 3.5h-70v-98h-64v271l153 -1q49 0 78 -14.5t29 -57.5zM1798 327v-56h-216v271h216v-56h-151v-49h148v-55h-148v-54zM1372 1009v-271h-66v271h66zM2065 357q0 -86 -102 -86h-126v58h126q34 0 34 25q0 16 -17 21t-41.5 5t-49.5 3.5t-42 22.5t-17 55q0 39 26 60t66 21 h130v-57h-119q-36 0 -36 -25q0 -16 17.5 -20.5t42 -4t49 -2.5t42 -21.5t17.5 -54.5zM2304 407v-101q-24 -35 -88 -35h-125v58h125q33 0 33 25q0 13 -12.5 19t-31 5.5t-40 2t-40 8t-31 24t-12.5 48.5q0 39 26.5 60t66.5 21h129v-57h-118q-36 0 -36 -25q0 -20 29 -22t68.5 -5 t56.5 -26zM2139 1008v-270h-92l-122 203v-203h-132l-26 60h-134l-25 -60h-75q-129 0 -129 133q0 138 133 138h63v-59q-7 0 -28 1t-28.5 0.5t-23 -2t-21.5 -6.5t-14.5 -13.5t-11.5 -23t-3 -33.5q0 -38 13.5 -58t49.5 -20h29l92 213h97l109 -256v256h99l114 -188v188h66z" /> +<glyph unicode="" horiz-adv-x="2304" d="M322 689h-15q-19 0 -19 18q0 28 19 85q5 15 15 19.5t28 4.5q77 0 77 -49q0 -41 -30.5 -59.5t-74.5 -18.5zM664 528q-47 0 -47 29q0 62 123 62l3 -3q-5 -88 -79 -88zM1438 687h-15q-19 0 -19 19q0 28 19 85q5 15 14.5 19t28.5 4q77 0 77 -49q0 -41 -30.5 -59.5 t-74.5 -18.5zM1780 527q-47 0 -47 30q0 62 123 62l3 -3q-5 -89 -79 -89zM373 894h-128q-8 0 -14.5 -4t-8.5 -7.5t-7 -12.5q-3 -7 -45 -190t-42 -192q0 -7 5.5 -12.5t13.5 -5.5h62q25 0 32.5 34.5l15 69t32.5 34.5q47 0 87.5 7.5t80.5 24.5t63.5 52.5t23.5 84.5 q0 36 -14.5 61t-41 36.5t-53.5 15.5t-62 4zM719 798q-38 0 -74 -6q-2 0 -8.5 -1t-9 -1.5l-7.5 -1.5t-7.5 -2t-6.5 -3t-6.5 -4t-5 -5t-4.5 -7t-4 -9q-9 -29 -9 -39t9 -10q5 0 21.5 5t19.5 6q30 8 58 8q74 0 74 -36q0 -11 -10 -14q-8 -2 -18 -3t-21.5 -1.5t-17.5 -1.5 q-38 -4 -64.5 -10t-56.5 -19.5t-45.5 -39t-15.5 -62.5q0 -38 26 -59.5t64 -21.5q24 0 45.5 6.5t33 13t38.5 23.5q-3 -7 -3 -15t5.5 -13.5t12.5 -5.5h56q1 1 7 3.5t7.5 3.5t5 3.5t5 5.5t2.5 8l45 194q4 13 4 30q0 81 -145 81zM1247 793h-74q-22 0 -39 -23q-5 -7 -29.5 -51 t-46.5 -81.5t-26 -38.5l-5 4q0 77 -27 166q-1 5 -3.5 8.5t-6 6.5t-6.5 5t-8.5 3t-8.5 1.5t-9.5 1t-9 0.5h-10h-8.5q-38 0 -38 -21l1 -5q5 -53 25 -151t25 -143q2 -16 2 -24q0 -19 -30.5 -61.5t-30.5 -58.5q0 -13 40 -13q61 0 76 25l245 415q10 20 10 26q0 9 -8 9zM1489 892 h-129q-18 0 -29 -23q-6 -13 -46.5 -191.5t-40.5 -190.5q0 -20 43 -20h7.5h9h9t9.5 1t8.5 2t8.5 3t6.5 4.5t5.5 6t3 8.5l21 91q2 10 10.5 17t19.5 7q47 0 87.5 7t80.5 24.5t63.5 52.5t23.5 84q0 36 -14.5 61t-41 36.5t-53.5 15.5t-62 4zM1835 798q-26 0 -74 -6 q-38 -6 -48 -16q-7 -8 -11 -19q-8 -24 -8 -39q0 -10 8 -10q1 0 41 12q30 8 58 8q74 0 74 -36q0 -12 -10 -14q-4 -1 -57 -7q-38 -4 -64.5 -10t-56.5 -19.5t-45.5 -39t-15.5 -62.5t26 -58.5t64 -21.5q24 0 45 6t34 13t38 24q-3 -15 -3 -16q0 -5 2 -8.5t6.5 -5.5t8 -3.5 t10.5 -2t9.5 -0.5h9.5h8q42 0 48 25l45 194q3 15 3 31q0 81 -145 81zM2157 889h-55q-25 0 -33 -40q-10 -44 -36.5 -167t-42.5 -190v-5q0 -16 16 -18h1h57q10 0 18.5 6.5t10.5 16.5l83 374h-1l1 5q0 7 -5.5 12.5t-13.5 5.5zM2304 1280v-1280q0 -52 -38 -90t-90 -38h-2048 q-52 0 -90 38t-38 90v1280q0 52 38 90t90 38h2048q52 0 90 -38t38 -90z" /> +<glyph unicode="" horiz-adv-x="2304" d="M1597 633q0 -69 -21 -106q-19 -35 -52 -35q-23 0 -41 9v224q29 30 57 30q57 0 57 -122zM2035 669h-110q6 98 56 98q51 0 54 -98zM476 534q0 59 -33 91.5t-101 57.5q-36 13 -52 24t-16 25q0 26 38 26q58 0 124 -33l18 112q-67 32 -149 32q-77 0 -123 -38q-48 -39 -48 -109 q0 -58 32.5 -90.5t99.5 -56.5q39 -14 54.5 -25.5t15.5 -27.5q0 -31 -48 -31q-29 0 -70 12.5t-72 30.5l-18 -113q72 -41 168 -41q81 0 129 37q51 41 51 117zM771 749l19 111h-96v135l-129 -21l-18 -114l-46 -8l-17 -103h62v-219q0 -84 44 -120q38 -30 111 -30q32 0 79 11v118 q-32 -7 -44 -7q-42 0 -42 50v197h77zM1087 724v139q-15 3 -28 3q-32 0 -55.5 -16t-33.5 -46l-10 56h-131v-471h150v306q26 31 82 31q16 0 26 -2zM1124 389h150v471h-150v-471zM1746 638q0 122 -45 179q-40 52 -111 52q-64 0 -117 -56l-8 47h-132v-645l150 25v151 q36 -11 68 -11q83 0 134 56q61 65 61 202zM1278 986q0 33 -23 56t-56 23t-56 -23t-23 -56t23 -56.5t56 -23.5t56 23.5t23 56.5zM2176 629q0 113 -48 176q-50 64 -144 64q-96 0 -151.5 -66t-55.5 -180q0 -128 63 -188q55 -55 161 -55q101 0 160 40l-16 103q-57 -31 -128 -31 q-43 0 -63 19q-23 19 -28 66h248q2 14 2 52zM2304 1280v-1280q0 -52 -38 -90t-90 -38h-2048q-52 0 -90 38t-38 90v1280q0 52 38 90t90 38h2048q52 0 90 -38t38 -90z" /> +<glyph unicode="" horiz-adv-x="2048" d="M1558 684q61 -356 298 -556q0 -52 -38 -90t-90 -38h-448q0 -106 -75 -181t-181 -75t-180.5 74.5t-75.5 180.5zM1024 -176q16 0 16 16t-16 16q-59 0 -101.5 42.5t-42.5 101.5q0 16 -16 16t-16 -16q0 -73 51.5 -124.5t124.5 -51.5zM2026 1424q8 -10 7.5 -23.5t-10.5 -22.5 l-1872 -1622q-10 -8 -23.5 -7t-21.5 11l-84 96q-8 10 -7.5 23.5t10.5 21.5l186 161q-19 32 -19 66q50 42 91 88t85 119.5t74.5 158.5t50 206t19.5 260q0 152 117 282.5t307 158.5q-8 19 -8 39q0 40 28 68t68 28t68 -28t28 -68q0 -20 -8 -39q124 -18 219 -82.5t148 -157.5 l418 363q10 8 23.5 7t21.5 -11z" /> +<glyph unicode="" horiz-adv-x="2048" d="M1040 -160q0 16 -16 16q-59 0 -101.5 42.5t-42.5 101.5q0 16 -16 16t-16 -16q0 -73 51.5 -124.5t124.5 -51.5q16 0 16 16zM503 315l877 760q-42 88 -132.5 146.5t-223.5 58.5q-93 0 -169.5 -31.5t-121.5 -80.5t-69 -103t-24 -105q0 -384 -137 -645zM1856 128 q0 -52 -38 -90t-90 -38h-448q0 -106 -75 -181t-181 -75t-180.5 74.5t-75.5 180.5l149 129h757q-166 187 -227 459l111 97q61 -356 298 -556zM1942 1520l84 -96q8 -10 7.5 -23.5t-10.5 -22.5l-1872 -1622q-10 -8 -23.5 -7t-21.5 11l-84 96q-8 10 -7.5 23.5t10.5 21.5l186 161 q-19 32 -19 66q50 42 91 88t85 119.5t74.5 158.5t50 206t19.5 260q0 152 117 282.5t307 158.5q-8 19 -8 39q0 40 28 68t68 28t68 -28t28 -68q0 -20 -8 -39q124 -18 219 -82.5t148 -157.5l418 363q10 8 23.5 7t21.5 -11z" /> +<glyph unicode="" horiz-adv-x="1408" d="M512 160v704q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23v-704q0 -14 9 -23t23 -9h64q14 0 23 9t9 23zM768 160v704q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23v-704q0 -14 9 -23t23 -9h64q14 0 23 9t9 23zM1024 160v704q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23v-704 q0 -14 9 -23t23 -9h64q14 0 23 9t9 23zM480 1152h448l-48 117q-7 9 -17 11h-317q-10 -2 -17 -11zM1408 1120v-64q0 -14 -9 -23t-23 -9h-96v-948q0 -83 -47 -143.5t-113 -60.5h-832q-66 0 -113 58.5t-47 141.5v952h-96q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h309l70 167 q15 37 54 63t79 26h320q40 0 79 -26t54 -63l70 -167h309q14 0 23 -9t9 -23z" /> +<glyph unicode="" d="M1150 462v-109q0 -50 -36.5 -89t-94 -60.5t-118 -32.5t-117.5 -11q-205 0 -342.5 139t-137.5 346q0 203 136 339t339 136q34 0 75.5 -4.5t93 -18t92.5 -34t69 -56.5t28 -81v-109q0 -16 -16 -16h-118q-16 0 -16 16v70q0 43 -65.5 67.5t-137.5 24.5q-140 0 -228.5 -91.5 t-88.5 -237.5q0 -151 91.5 -249.5t233.5 -98.5q68 0 138 24t70 66v70q0 7 4.5 11.5t10.5 4.5h119q6 0 11 -4.5t5 -11.5zM768 1280q-130 0 -248.5 -51t-204 -136.5t-136.5 -204t-51 -248.5t51 -248.5t136.5 -204t204 -136.5t248.5 -51t248.5 51t204 136.5t136.5 204t51 248.5 t-51 248.5t-136.5 204t-204 136.5t-248.5 51zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" /> +<glyph unicode="" d="M972 761q0 108 -53.5 169t-147.5 61q-63 0 -124 -30.5t-110 -84.5t-79.5 -137t-30.5 -180q0 -112 53.5 -173t150.5 -61q96 0 176 66.5t122.5 166t42.5 203.5zM1536 640q0 -111 -37 -197t-98.5 -135t-131.5 -74.5t-145 -27.5q-6 0 -15.5 -0.5t-16.5 -0.5q-95 0 -142 53 q-28 33 -33 83q-52 -66 -131.5 -110t-173.5 -44q-161 0 -249.5 95.5t-88.5 269.5q0 157 66 290t179 210.5t246 77.5q87 0 155 -35.5t106 -99.5l2 19l11 56q1 6 5.5 12t9.5 6h118q5 0 13 -11q5 -5 3 -16l-120 -614q-5 -24 -5 -48q0 -39 12.5 -52t44.5 -13q28 1 57 5.5t73 24 t77 50t57 89.5t24 137q0 292 -174 466t-466 174q-130 0 -248.5 -51t-204 -136.5t-136.5 -204t-51 -248.5t51 -248.5t136.5 -204t204 -136.5t248.5 -51q228 0 405 144q11 9 24 8t21 -12l41 -49q8 -12 7 -24q-2 -13 -12 -22q-102 -83 -227.5 -128t-258.5 -45q-156 0 -298 61 t-245 164t-164 245t-61 298t61 298t164 245t245 164t298 61q344 0 556 -212t212 -556z" /> +<glyph unicode="" horiz-adv-x="1792" d="M1698 1442q94 -94 94 -226.5t-94 -225.5l-225 -223l104 -104q10 -10 10 -23t-10 -23l-210 -210q-10 -10 -23 -10t-23 10l-105 105l-603 -603q-37 -37 -90 -37h-203l-256 -128l-64 64l128 256v203q0 53 37 90l603 603l-105 105q-10 10 -10 23t10 23l210 210q10 10 23 10 t23 -10l104 -104l223 225q93 94 225.5 94t226.5 -94zM512 64l576 576l-192 192l-576 -576v-192h192z" /> +<glyph unicode="" horiz-adv-x="1792" d="M1615 1536q70 0 122.5 -46.5t52.5 -116.5q0 -63 -45 -151q-332 -629 -465 -752q-97 -91 -218 -91q-126 0 -216.5 92.5t-90.5 219.5q0 128 92 212l638 579q59 54 130 54zM706 502q39 -76 106.5 -130t150.5 -76l1 -71q4 -213 -129.5 -347t-348.5 -134q-123 0 -218 46.5 t-152.5 127.5t-86.5 183t-29 220q7 -5 41 -30t62 -44.5t59 -36.5t46 -17q41 0 55 37q25 66 57.5 112.5t69.5 76t88 47.5t103 25.5t125 10.5z" /> +<glyph unicode="" horiz-adv-x="1792" d="M1792 128v-384h-1792v384q45 0 85 14t59 27.5t47 37.5q30 27 51.5 38t56.5 11t55.5 -11t52.5 -38q29 -25 47 -38t58 -27t86 -14q45 0 85 14.5t58 27t48 37.5q21 19 32.5 27t31 15t43.5 7q35 0 56.5 -11t51.5 -38q28 -24 47 -37.5t59 -27.5t85 -14t85 14t59 27.5t47 37.5 q30 27 51.5 38t56.5 11q34 0 55.5 -11t51.5 -38q28 -24 47 -37.5t59 -27.5t85 -14zM1792 448v-192q-35 0 -55.5 11t-52.5 38q-29 25 -47 38t-58 27t-85 14q-46 0 -86 -14t-58 -27t-47 -38q-22 -19 -33 -27t-31 -15t-44 -7q-35 0 -56.5 11t-51.5 38q-29 25 -47 38t-58 27 t-86 14q-45 0 -85 -14.5t-58 -27t-48 -37.5q-21 -19 -32.5 -27t-31 -15t-43.5 -7q-35 0 -56.5 11t-51.5 38q-28 24 -47 37.5t-59 27.5t-85 14q-46 0 -86 -14t-58 -27t-47 -38q-30 -27 -51.5 -38t-56.5 -11v192q0 80 56 136t136 56h64v448h256v-448h256v448h256v-448h256v448 h256v-448h64q80 0 136 -56t56 -136zM512 1312q0 -77 -36 -118.5t-92 -41.5q-53 0 -90.5 37.5t-37.5 90.5q0 29 9.5 51t23.5 34t31 28t31 31.5t23.5 44.5t9.5 67q38 0 83 -74t45 -150zM1024 1312q0 -77 -36 -118.5t-92 -41.5q-53 0 -90.5 37.5t-37.5 90.5q0 29 9.5 51 t23.5 34t31 28t31 31.5t23.5 44.5t9.5 67q38 0 83 -74t45 -150zM1536 1312q0 -77 -36 -118.5t-92 -41.5q-53 0 -90.5 37.5t-37.5 90.5q0 29 9.5 51t23.5 34t31 28t31 31.5t23.5 44.5t9.5 67q38 0 83 -74t45 -150z" /> +<glyph unicode="" horiz-adv-x="2048" d="M2048 0v-128h-2048v1536h128v-1408h1920zM1664 1024l256 -896h-1664v576l448 576l576 -576z" /> +<glyph unicode="" horiz-adv-x="1792" d="M768 646l546 -546q-106 -108 -247.5 -168t-298.5 -60q-209 0 -385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103v-762zM955 640h773q0 -157 -60 -298.5t-168 -247.5zM1664 768h-768v768q209 0 385.5 -103t279.5 -279.5t103 -385.5z" /> +<glyph unicode="" horiz-adv-x="2048" d="M2048 0v-128h-2048v1536h128v-1408h1920zM1920 1248v-435q0 -21 -19.5 -29.5t-35.5 7.5l-121 121l-633 -633q-10 -10 -23 -10t-23 10l-233 233l-416 -416l-192 192l585 585q10 10 23 10t23 -10l233 -233l464 464l-121 121q-16 16 -7.5 35.5t29.5 19.5h435q14 0 23 -9 t9 -23z" /> +<glyph unicode="" horiz-adv-x="1792" d="M1292 832q0 -6 10 -41q10 -29 25 -49.5t41 -34t44 -20t55 -16.5q325 -91 325 -332q0 -146 -105.5 -242.5t-254.5 -96.5q-59 0 -111.5 18.5t-91.5 45.5t-77 74.5t-63 87.5t-53.5 103.5t-43.5 103t-39.5 106.5t-35.5 95q-32 81 -61.5 133.5t-73.5 96.5t-104 64t-142 20 q-96 0 -183 -55.5t-138 -144.5t-51 -185q0 -160 106.5 -279.5t263.5 -119.5q177 0 258 95q56 63 83 116l84 -152q-15 -34 -44 -70l1 -1q-131 -152 -388 -152q-147 0 -269.5 79t-190.5 207.5t-68 274.5q0 105 43.5 206t116 176.5t172 121.5t204.5 46q87 0 159 -19t123.5 -50 t95 -80t72.5 -99t58.5 -117t50.5 -124.5t50 -130.5t55 -127q96 -200 233 -200q81 0 138.5 48.5t57.5 128.5q0 42 -19 72t-50.5 46t-72.5 31.5t-84.5 27t-87.5 34t-81 52t-65 82t-39 122.5q-3 16 -3 33q0 110 87.5 192t198.5 78q78 -3 120.5 -14.5t90.5 -53.5h-1 q12 -11 23 -24.5t26 -36t19 -27.5l-129 -99q-26 49 -54 70v1q-23 21 -97 21q-49 0 -84 -33t-35 -83z" /> +<glyph unicode="" d="M1432 484q0 173 -234 239q-35 10 -53 16.5t-38 25t-29 46.5q0 2 -2 8.5t-3 12t-1 7.5q0 36 24.5 59.5t60.5 23.5q54 0 71 -15h-1q20 -15 39 -51l93 71q-39 54 -49 64q-33 29 -67.5 39t-85.5 10q-80 0 -142 -57.5t-62 -137.5q0 -7 2 -23q16 -96 64.5 -140t148.5 -73 q29 -8 49 -15.5t45 -21.5t38.5 -34.5t13.5 -46.5v-5q1 -58 -40.5 -93t-100.5 -35q-97 0 -167 144q-23 47 -51.5 121.5t-48 125.5t-54 110.5t-74 95.5t-103.5 60.5t-147 24.5q-101 0 -192 -56t-144 -148t-50 -192v-1q4 -108 50.5 -199t133.5 -147.5t196 -56.5q186 0 279 110 q20 27 31 51l-60 109q-42 -80 -99 -116t-146 -36q-115 0 -191 87t-76 204q0 105 82 189t186 84q112 0 170 -53.5t104 -172.5q8 -21 25.5 -68.5t28.5 -76.5t31.5 -74.5t38.5 -74t45.5 -62.5t55.5 -53.5t66 -33t80 -13.5q107 0 183 69.5t76 174.5zM1536 1120v-960 q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" /> +<glyph unicode="" horiz-adv-x="2048" d="M1152 640q0 104 -40.5 198.5t-109.5 163.5t-163.5 109.5t-198.5 40.5t-198.5 -40.5t-163.5 -109.5t-109.5 -163.5t-40.5 -198.5t40.5 -198.5t109.5 -163.5t163.5 -109.5t198.5 -40.5t198.5 40.5t163.5 109.5t109.5 163.5t40.5 198.5zM1920 640q0 104 -40.5 198.5 t-109.5 163.5t-163.5 109.5t-198.5 40.5h-386q119 -90 188.5 -224t69.5 -288t-69.5 -288t-188.5 -224h386q104 0 198.5 40.5t163.5 109.5t109.5 163.5t40.5 198.5zM2048 640q0 -130 -51 -248.5t-136.5 -204t-204 -136.5t-248.5 -51h-768q-130 0 -248.5 51t-204 136.5 t-136.5 204t-51 248.5t51 248.5t136.5 204t204 136.5t248.5 51h768q130 0 248.5 -51t204 -136.5t136.5 -204t51 -248.5z" /> +<glyph unicode="" horiz-adv-x="2048" d="M0 640q0 130 51 248.5t136.5 204t204 136.5t248.5 51h768q130 0 248.5 -51t204 -136.5t136.5 -204t51 -248.5t-51 -248.5t-136.5 -204t-204 -136.5t-248.5 -51h-768q-130 0 -248.5 51t-204 136.5t-136.5 204t-51 248.5zM1408 128q104 0 198.5 40.5t163.5 109.5 t109.5 163.5t40.5 198.5t-40.5 198.5t-109.5 163.5t-163.5 109.5t-198.5 40.5t-198.5 -40.5t-163.5 -109.5t-109.5 -163.5t-40.5 -198.5t40.5 -198.5t109.5 -163.5t163.5 -109.5t198.5 -40.5z" /> +<glyph unicode="" horiz-adv-x="2304" d="M762 384h-314q-40 0 -57.5 35t6.5 67l188 251q-65 31 -137 31q-132 0 -226 -94t-94 -226t94 -226t226 -94q115 0 203 72.5t111 183.5zM576 512h186q-18 85 -75 148zM1056 512l288 384h-480l-99 -132q105 -103 126 -252h165zM2176 448q0 132 -94 226t-226 94 q-60 0 -121 -24l174 -260q15 -23 10 -49t-27 -40q-15 -11 -36 -11q-35 0 -53 29l-174 260q-93 -95 -93 -225q0 -132 94 -226t226 -94t226 94t94 226zM2304 448q0 -185 -131.5 -316.5t-316.5 -131.5t-316.5 131.5t-131.5 316.5q0 97 39.5 183.5t109.5 149.5l-65 98l-353 -469 q-18 -26 -51 -26h-197q-23 -164 -149 -274t-294 -110q-185 0 -316.5 131.5t-131.5 316.5t131.5 316.5t316.5 131.5q114 0 215 -55l137 183h-224q-26 0 -45 19t-19 45t19 45t45 19h384v-128h435l-85 128h-222q-26 0 -45 19t-19 45t19 45t45 19h256q33 0 53 -28l267 -400 q91 44 192 44q185 0 316.5 -131.5t131.5 -316.5z" /> +<glyph unicode="" d="M384 320q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM1408 320q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM1362 716l-72 384q-5 23 -22.5 37.5t-40.5 14.5 h-918q-23 0 -40.5 -14.5t-22.5 -37.5l-72 -384q-5 -30 14 -53t49 -23h1062q30 0 49 23t14 53zM1136 1328q0 20 -14 34t-34 14h-640q-20 0 -34 -14t-14 -34t14 -34t34 -14h640q20 0 34 14t14 34zM1536 603v-603h-128v-128q0 -53 -37.5 -90.5t-90.5 -37.5t-90.5 37.5 t-37.5 90.5v128h-768v-128q0 -53 -37.5 -90.5t-90.5 -37.5t-90.5 37.5t-37.5 90.5v128h-128v603q0 112 25 223l103 454q9 78 97.5 137t230 89t312.5 30t312.5 -30t230 -89t97.5 -137l105 -454q23 -102 23 -223z" /> +<glyph unicode="" horiz-adv-x="2048" d="M1463 704q0 -35 -25 -60.5t-61 -25.5h-702q-36 0 -61 25.5t-25 60.5t25 60.5t61 25.5h702q36 0 61 -25.5t25 -60.5zM1677 704q0 86 -23 170h-982q-36 0 -61 25t-25 60q0 36 25 61t61 25h908q-88 143 -235 227t-320 84q-177 0 -327.5 -87.5t-238 -237.5t-87.5 -327 q0 -86 23 -170h982q36 0 61 -25t25 -60q0 -36 -25 -61t-61 -25h-908q88 -143 235.5 -227t320.5 -84q132 0 253 51.5t208 139t139 208t52 253.5zM2048 959q0 -35 -25 -60t-61 -25h-131q17 -85 17 -170q0 -167 -65.5 -319.5t-175.5 -263t-262.5 -176t-319.5 -65.5 q-246 0 -448.5 133t-301.5 350h-189q-36 0 -61 25t-25 61q0 35 25 60t61 25h132q-17 85 -17 170q0 167 65.5 319.5t175.5 263t262.5 176t320.5 65.5q245 0 447.5 -133t301.5 -350h188q36 0 61 -25t25 -61z" /> +<glyph unicode="" horiz-adv-x="1280" d="M953 1158l-114 -328l117 -21q165 451 165 518q0 56 -38 56q-57 0 -130 -225zM654 471l33 -88q37 42 71 67l-33 5.5t-38.5 7t-32.5 8.5zM362 1367q0 -98 159 -521q18 10 49 10q15 0 75 -5l-121 351q-75 220 -123 220q-19 0 -29 -17.5t-10 -37.5zM283 608q0 -36 51.5 -119 t117.5 -153t100 -70q14 0 25.5 13t11.5 27q0 24 -32 102q-13 32 -32 72t-47.5 89t-61.5 81t-62 32q-20 0 -45.5 -27t-25.5 -47zM125 273q0 -41 25 -104q59 -145 183.5 -227t281.5 -82q227 0 382 170q152 169 152 427q0 43 -1 67t-11.5 62t-30.5 56q-56 49 -211.5 75.5 t-270.5 26.5q-37 0 -49 -11q-12 -5 -12 -35q0 -34 21.5 -60t55.5 -40t77.5 -23.5t87.5 -11.5t85 -4t70 0h23q24 0 40 -19q15 -19 19 -55q-28 -28 -96 -54q-61 -22 -93 -46q-64 -46 -108.5 -114t-44.5 -137q0 -31 18.5 -88.5t18.5 -87.5l-3 -12q-4 -12 -4 -14 q-137 10 -146 216q-8 -2 -41 -2q2 -7 2 -21q0 -53 -40.5 -89.5t-94.5 -36.5q-82 0 -166.5 78t-84.5 159q0 34 33 67q52 -64 60 -76q77 -104 133 -104q12 0 26.5 8.5t14.5 20.5q0 34 -87.5 145t-116.5 111q-43 0 -70 -44.5t-27 -90.5zM11 264q0 101 42.5 163t136.5 88 q-28 74 -28 104q0 62 61 123t122 61q29 0 70 -15q-163 462 -163 567q0 80 41 130.5t119 50.5q131 0 325 -581q6 -17 8 -23q6 16 29 79.5t43.5 118.5t54 127.5t64.5 123t70.5 86.5t76.5 36q71 0 112 -49t41 -122q0 -108 -159 -550q61 -15 100.5 -46t58.5 -78t26 -93.5 t7 -110.5q0 -150 -47 -280t-132 -225t-211 -150t-278 -55q-111 0 -223 42q-149 57 -258 191.5t-109 286.5z" /> +<glyph unicode="" horiz-adv-x="2048" d="M785 528h207q-14 -158 -98.5 -248.5t-214.5 -90.5q-162 0 -254.5 116t-92.5 316q0 194 93 311.5t233 117.5q148 0 232 -87t97 -247h-203q-5 64 -35.5 99t-81.5 35q-57 0 -88.5 -60.5t-31.5 -177.5q0 -48 5 -84t18 -69.5t40 -51.5t66 -18q95 0 109 139zM1497 528h206 q-14 -158 -98 -248.5t-214 -90.5q-162 0 -254.5 116t-92.5 316q0 194 93 311.5t233 117.5q148 0 232 -87t97 -247h-204q-4 64 -35 99t-81 35q-57 0 -88.5 -60.5t-31.5 -177.5q0 -48 5 -84t18 -69.5t39.5 -51.5t65.5 -18q49 0 76.5 38t33.5 101zM1856 647q0 207 -15.5 307 t-60.5 161q-6 8 -13.5 14t-21.5 15t-16 11q-86 63 -697 63q-625 0 -710 -63q-5 -4 -17.5 -11.5t-21 -14t-14.5 -14.5q-45 -60 -60 -159.5t-15 -308.5q0 -208 15 -307.5t60 -160.5q6 -8 15 -15t20.5 -14t17.5 -12q44 -33 239.5 -49t470.5 -16q610 0 697 65q5 4 17 11t20.5 14 t13.5 16q46 60 61 159t15 309zM2048 1408v-1536h-2048v1536h2048z" /> +<glyph unicode="" d="M992 912v-496q0 -14 -9 -23t-23 -9h-160q-14 0 -23 9t-9 23v496q0 112 -80 192t-192 80h-272v-1152q0 -14 -9 -23t-23 -9h-160q-14 0 -23 9t-9 23v1344q0 14 9 23t23 9h464q135 0 249 -66.5t180.5 -180.5t66.5 -249zM1376 1376v-880q0 -135 -66.5 -249t-180.5 -180.5 t-249 -66.5h-464q-14 0 -23 9t-9 23v960q0 14 9 23t23 9h160q14 0 23 -9t9 -23v-768h272q112 0 192 80t80 192v880q0 14 9 23t23 9h160q14 0 23 -9t9 -23z" /> +<glyph unicode="" d="M1311 694v-114q0 -24 -13.5 -38t-37.5 -14h-202q-24 0 -38 14t-14 38v114q0 24 14 38t38 14h202q24 0 37.5 -14t13.5 -38zM821 464v250q0 53 -32.5 85.5t-85.5 32.5h-133q-68 0 -96 -52q-28 52 -96 52h-130q-53 0 -85.5 -32.5t-32.5 -85.5v-250q0 -22 21 -22h55 q22 0 22 22v230q0 24 13.5 38t38.5 14h94q24 0 38 -14t14 -38v-230q0 -22 21 -22h54q22 0 22 22v230q0 24 14 38t38 14h97q24 0 37.5 -14t13.5 -38v-230q0 -22 22 -22h55q21 0 21 22zM1410 560v154q0 53 -33 85.5t-86 32.5h-264q-53 0 -86 -32.5t-33 -85.5v-410 q0 -21 22 -21h55q21 0 21 21v180q31 -42 94 -42h191q53 0 86 32.5t33 85.5zM1536 1176v-1072q0 -96 -68 -164t-164 -68h-1072q-96 0 -164 68t-68 164v1072q0 96 68 164t164 68h1072q96 0 164 -68t68 -164z" /> +<glyph unicode="" d="M915 450h-294l147 551zM1001 128h311l-324 1024h-440l-324 -1024h311l383 314zM1536 1120v-960q0 -118 -85 -203t-203 -85h-960q-118 0 -203 85t-85 203v960q0 118 85 203t203 85h960q118 0 203 -85t85 -203z" /> +<glyph unicode="" horiz-adv-x="2048" d="M2048 641q0 -21 -13 -36.5t-33 -19.5l-205 -356q3 -9 3 -18q0 -20 -12.5 -35.5t-32.5 -19.5l-193 -337q3 -8 3 -16q0 -23 -16.5 -40t-40.5 -17q-25 0 -41 18h-400q-17 -20 -43 -20t-43 20h-399q-17 -20 -43 -20q-23 0 -40 16.5t-17 40.5q0 8 4 20l-193 335 q-20 4 -32.5 19.5t-12.5 35.5q0 9 3 18l-206 356q-20 5 -32.5 20.5t-12.5 35.5q0 21 13.5 36.5t33.5 19.5l199 344q0 1 -0.5 3t-0.5 3q0 36 34 51l209 363q-4 10 -4 18q0 24 17 40.5t40 16.5q26 0 44 -21h396q16 21 43 21t43 -21h398q18 21 44 21q23 0 40 -16.5t17 -40.5 q0 -6 -4 -18l207 -358q23 -1 39 -17.5t16 -38.5q0 -13 -7 -27l187 -324q19 -4 31.5 -19.5t12.5 -35.5zM1063 -158h389l-342 354h-143l-342 -354h360q18 16 39 16t39 -16zM112 654q1 -4 1 -13q0 -10 -2 -15l208 -360q2 0 4.5 -1t5.5 -2.5l5 -2.5l188 199v347l-187 194 q-13 -8 -29 -10zM986 1438h-388l190 -200l554 200h-280q-16 -16 -38 -16t-38 16zM1689 226q1 6 5 11l-64 68l-17 -79h76zM1583 226l22 105l-252 266l-296 -307l63 -64h463zM1495 -142l16 28l65 310h-427l333 -343q8 4 13 5zM578 -158h5l342 354h-373v-335l4 -6q14 -5 22 -13 zM552 226h402l64 66l-309 321l-157 -166v-221zM359 226h163v189l-168 -177q4 -8 5 -12zM358 1051q0 -1 0.5 -2t0.5 -2q0 -16 -8 -29l171 -177v269zM552 1121v-311l153 -157l297 314l-223 236zM556 1425l-4 -8v-264l205 74l-191 201q-6 -2 -10 -3zM1447 1438h-16l-621 -224 l213 -225zM1023 946l-297 -315l311 -319l296 307zM688 634l-136 141v-284zM1038 270l-42 -44h85zM1374 618l238 -251l132 624l-3 5l-1 1zM1718 1018q-8 13 -8 29v2l-216 376q-5 1 -13 5l-437 -463l310 -327zM522 1142v223l-163 -282zM522 196h-163l163 -283v283zM1607 196 l-48 -227l130 227h-82zM1729 266l207 361q-2 10 -2 14q0 1 3 16l-171 296l-129 -612l77 -82q5 3 15 7z" /> +<glyph unicode="" d="M0 856q0 131 91.5 226.5t222.5 95.5h742l352 358v-1470q0 -132 -91.5 -227t-222.5 -95h-780q-131 0 -222.5 95t-91.5 227v790zM1232 102l-176 180v425q0 46 -32 79t-78 33h-484q-46 0 -78 -33t-32 -79v-492q0 -46 32.5 -79.5t77.5 -33.5h770z" /> +<glyph unicode="" d="M934 1386q-317 -121 -556 -362.5t-358 -560.5q-20 89 -20 176q0 208 102.5 384.5t278.5 279t384 102.5q82 0 169 -19zM1203 1267q93 -65 164 -155q-389 -113 -674.5 -400.5t-396.5 -676.5q-93 72 -155 162q112 386 395 671t667 399zM470 -67q115 356 379.5 622t619.5 384 q40 -92 54 -195q-292 -120 -516 -345t-343 -518q-103 14 -194 52zM1536 -125q-193 50 -367 115q-135 -84 -290 -107q109 205 274 370.5t369 275.5q-21 -152 -101 -284q65 -175 115 -370z" /> +<glyph unicode="" horiz-adv-x="2048" d="M1893 1144l155 -1272q-131 0 -257 57q-200 91 -393 91q-226 0 -374 -148q-148 148 -374 148q-193 0 -393 -91q-128 -57 -252 -57h-5l155 1272q224 127 482 127q233 0 387 -106q154 106 387 106q258 0 482 -127zM1398 157q129 0 232 -28.5t260 -93.5l-124 1021 q-171 78 -368 78q-224 0 -374 -141q-150 141 -374 141q-197 0 -368 -78l-124 -1021q105 43 165.5 65t148.5 39.5t178 17.5q202 0 374 -108q172 108 374 108zM1438 191l-55 907q-211 -4 -359 -155q-152 155 -374 155q-176 0 -336 -66l-114 -941q124 51 228.5 76t221.5 25 q209 0 374 -102q172 107 374 102z" /> +<glyph unicode="" horiz-adv-x="2048" d="M1500 165v733q0 21 -15 36t-35 15h-93q-20 0 -35 -15t-15 -36v-733q0 -20 15 -35t35 -15h93q20 0 35 15t15 35zM1216 165v531q0 20 -15 35t-35 15h-101q-20 0 -35 -15t-15 -35v-531q0 -20 15 -35t35 -15h101q20 0 35 15t15 35zM924 165v429q0 20 -15 35t-35 15h-101 q-20 0 -35 -15t-15 -35v-429q0 -20 15 -35t35 -15h101q20 0 35 15t15 35zM632 165v362q0 20 -15 35t-35 15h-101q-20 0 -35 -15t-15 -35v-362q0 -20 15 -35t35 -15h101q20 0 35 15t15 35zM2048 311q0 -166 -118 -284t-284 -118h-1244q-166 0 -284 118t-118 284 q0 116 63 214.5t168 148.5q-10 34 -10 73q0 113 80.5 193.5t193.5 80.5q102 0 180 -67q45 183 194 300t338 117q149 0 275 -73.5t199.5 -199.5t73.5 -275q0 -66 -14 -122q135 -33 221 -142.5t86 -247.5z" /> +<glyph unicode="" d="M0 1536h1536v-1392l-776 -338l-760 338v1392zM1436 209v926h-1336v-926l661 -294zM1436 1235v201h-1336v-201h1336zM181 937v-115h-37v115h37zM181 789v-115h-37v115h37zM181 641v-115h-37v115h37zM181 493v-115h-37v115h37zM181 345v-115h-37v115h37zM207 202l15 34 l105 -47l-15 -33zM343 142l15 34l105 -46l-15 -34zM478 82l15 34l105 -46l-15 -34zM614 23l15 33l104 -46l-15 -34zM797 10l105 46l15 -33l-105 -47zM932 70l105 46l15 -34l-105 -46zM1068 130l105 46l15 -34l-105 -46zM1203 189l105 47l15 -34l-105 -46zM259 1389v-36h-114 v36h114zM421 1389v-36h-115v36h115zM583 1389v-36h-115v36h115zM744 1389v-36h-114v36h114zM906 1389v-36h-114v36h114zM1068 1389v-36h-115v36h115zM1230 1389v-36h-115v36h115zM1391 1389v-36h-114v36h114zM181 1049v-79h-37v115h115v-36h-78zM421 1085v-36h-115v36h115z M583 1085v-36h-115v36h115zM744 1085v-36h-114v36h114zM906 1085v-36h-114v36h114zM1068 1085v-36h-115v36h115zM1230 1085v-36h-115v36h115zM1355 970v79h-78v36h115v-115h-37zM1355 822v115h37v-115h-37zM1355 674v115h37v-115h-37zM1355 526v115h37v-115h-37zM1355 378 v115h37v-115h-37zM1355 230v115h37v-115h-37zM760 265q-129 0 -221 91.5t-92 221.5q0 129 92 221t221 92q130 0 221.5 -92t91.5 -221q0 -130 -91.5 -221.5t-221.5 -91.5zM595 646q0 -36 19.5 -56.5t49.5 -25t64 -7t64 -2t49.5 -9t19.5 -30.5q0 -49 -112 -49q-97 0 -123 51 h-3l-31 -63q67 -42 162 -42q29 0 56.5 5t55.5 16t45.5 33t17.5 53q0 46 -27.5 69.5t-67.5 27t-79.5 3t-67 5t-27.5 25.5q0 21 20.5 33t40.5 15t41 3q34 0 70.5 -11t51.5 -34h3l30 58q-3 1 -21 8.5t-22.5 9t-19.5 7t-22 7t-20 4.5t-24 4t-23 1q-29 0 -56.5 -5t-54 -16.5 t-43 -34t-16.5 -53.5z" /> +<glyph unicode="" horiz-adv-x="2048" d="M863 504q0 112 -79.5 191.5t-191.5 79.5t-191 -79.5t-79 -191.5t79 -191t191 -79t191.5 79t79.5 191zM1726 505q0 112 -79 191t-191 79t-191.5 -79t-79.5 -191q0 -113 79.5 -192t191.5 -79t191 79.5t79 191.5zM2048 1314v-1348q0 -44 -31.5 -75.5t-76.5 -31.5h-1832 q-45 0 -76.5 31.5t-31.5 75.5v1348q0 44 31.5 75.5t76.5 31.5h431q44 0 76 -31.5t32 -75.5v-161h754v161q0 44 32 75.5t76 31.5h431q45 0 76.5 -31.5t31.5 -75.5z" /> +<glyph unicode="" horiz-adv-x="2048" d="M1430 953zM1690 749q148 0 253 -98.5t105 -244.5q0 -157 -109 -261.5t-267 -104.5q-85 0 -162 27.5t-138 73.5t-118 106t-109 126.5t-103.5 132.5t-108.5 126t-117 106t-136 73.5t-159 27.5q-154 0 -251.5 -91.5t-97.5 -244.5q0 -157 104 -250t263 -93q100 0 208 37.5 t193 98.5q5 4 21 18.5t30 24t22 9.5q14 0 24.5 -10.5t10.5 -24.5q0 -24 -60 -77q-101 -88 -234.5 -142t-260.5 -54q-133 0 -245.5 58t-180 165t-67.5 241q0 205 141.5 341t347.5 136q120 0 226.5 -43.5t185.5 -113t151.5 -153t139 -167.5t133.5 -153.5t149.5 -113 t172.5 -43.5q102 0 168.5 61.5t66.5 162.5q0 95 -64.5 159t-159.5 64q-30 0 -81.5 -18.5t-68.5 -18.5q-20 0 -35.5 15t-15.5 35q0 18 8.5 57t8.5 59q0 159 -107.5 263t-266.5 104q-58 0 -111.5 -18.5t-84 -40.5t-55.5 -40.5t-33 -18.5q-15 0 -25.5 10.5t-10.5 25.5 q0 19 25 46q59 67 147 103.5t182 36.5q191 0 318 -125.5t127 -315.5q0 -37 -4 -66q57 15 115 15z" /> +<glyph unicode="" horiz-adv-x="1664" d="M1216 832q0 26 -19 45t-45 19h-128v128q0 26 -19 45t-45 19t-45 -19t-19 -45v-128h-128q-26 0 -45 -19t-19 -45t19 -45t45 -19h128v-128q0 -26 19 -45t45 -19t45 19t19 45v128h128q26 0 45 19t19 45zM640 0q0 -53 -37.5 -90.5t-90.5 -37.5t-90.5 37.5t-37.5 90.5 t37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM1536 0q0 -53 -37.5 -90.5t-90.5 -37.5t-90.5 37.5t-37.5 90.5t37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM1664 1088v-512q0 -24 -16 -42.5t-41 -21.5l-1044 -122q1 -7 4.5 -21.5t6 -26.5t2.5 -22q0 -16 -24 -64h920 q26 0 45 -19t19 -45t-19 -45t-45 -19h-1024q-26 0 -45 19t-19 45q0 14 11 39.5t29.5 59.5t20.5 38l-177 823h-204q-26 0 -45 19t-19 45t19 45t45 19h256q16 0 28.5 -6.5t20 -15.5t13 -24.5t7.5 -26.5t5.5 -29.5t4.5 -25.5h1201q26 0 45 -19t19 -45z" /> +<glyph unicode="" horiz-adv-x="1792" d="M1280 832q0 26 -19 45t-45 19t-45 -19l-147 -146v293q0 26 -19 45t-45 19t-45 -19t-19 -45v-293l-147 146q-19 19 -45 19t-45 -19t-19 -45t19 -45l256 -256q19 -19 45 -19t45 19l256 256q19 19 19 45zM640 0q0 -53 -37.5 -90.5t-90.5 -37.5t-90.5 37.5t-37.5 90.5 t37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM1536 0q0 -53 -37.5 -90.5t-90.5 -37.5t-90.5 37.5t-37.5 90.5t37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM1664 1088v-512q0 -24 -16 -42.5t-41 -21.5l-1044 -122q1 -7 4.5 -21.5t6 -26.5t2.5 -22q0 -16 -24 -64h920 q26 0 45 -19t19 -45t-19 -45t-45 -19h-1024q-26 0 -45 19t-19 45q0 14 11 39.5t29.5 59.5t20.5 38l-177 823h-204q-26 0 -45 19t-19 45t19 45t45 19h256q16 0 28.5 -6.5t20 -15.5t13 -24.5t7.5 -26.5t5.5 -29.5t4.5 -25.5h1201q26 0 45 -19t19 -45z" /> +<glyph unicode="" horiz-adv-x="2048" d="M212 768l623 -665l-300 665h-323zM1024 -4l349 772h-698zM538 896l204 384h-262l-288 -384h346zM1213 103l623 665h-323zM683 896h682l-204 384h-274zM1510 896h346l-288 384h-262zM1651 1382l384 -512q14 -18 13 -41.5t-17 -40.5l-960 -1024q-18 -20 -47 -20t-47 20 l-960 1024q-16 17 -17 40.5t13 41.5l384 512q18 26 51 26h1152q33 0 51 -26z" /> +<glyph unicode="" horiz-adv-x="2048" d="M1811 -19q19 19 45 19t45 -19l128 -128l-90 -90l-83 83l-83 -83q-18 -19 -45 -19t-45 19l-83 83l-83 -83q-19 -19 -45 -19t-45 19l-83 83l-83 -83q-19 -19 -45 -19t-45 19l-83 83l-83 -83q-19 -19 -45 -19t-45 19l-83 83l-83 -83q-19 -19 -45 -19t-45 19l-83 83l-83 -83 q-19 -19 -45 -19t-45 19l-83 83l-83 -83q-19 -19 -45 -19t-45 19l-128 128l90 90l83 -83l83 83q19 19 45 19t45 -19l83 -83l83 83q19 19 45 19t45 -19l83 -83l83 83q19 19 45 19t45 -19l83 -83l83 83q19 19 45 19t45 -19l83 -83l83 83q19 19 45 19t45 -19l83 -83l83 83 q19 19 45 19t45 -19l83 -83zM237 19q-19 -19 -45 -19t-45 19l-128 128l90 90l83 -82l83 82q19 19 45 19t45 -19l83 -82l64 64v293l-210 314q-17 26 -7 56.5t40 40.5l177 58v299h128v128h256v128h256v-128h256v-128h128v-299l177 -58q30 -10 40 -40.5t-7 -56.5l-210 -314 v-293l19 18q19 19 45 19t45 -19l83 -82l83 82q19 19 45 19t45 -19l128 -128l-90 -90l-83 83l-83 -83q-18 -19 -45 -19t-45 19l-83 83l-83 -83q-19 -19 -45 -19t-45 19l-83 83l-83 -83q-19 -19 -45 -19t-45 19l-83 83l-83 -83q-19 -19 -45 -19t-45 19l-83 83l-83 -83 q-19 -19 -45 -19t-45 19l-83 83l-83 -83q-19 -19 -45 -19t-45 19l-83 83zM640 1152v-128l384 128l384 -128v128h-128v128h-512v-128h-128z" /> +<glyph unicode="" d="M576 0l96 448l-96 128l-128 64zM832 0l128 640l-128 -64l-96 -128zM992 1010q-2 4 -4 6q-10 8 -96 8q-70 0 -167 -19q-7 -2 -21 -2t-21 2q-97 19 -167 19q-86 0 -96 -8q-2 -2 -4 -6q2 -18 4 -27q2 -3 7.5 -6.5t7.5 -10.5q2 -4 7.5 -20.5t7 -20.5t7.5 -17t8.5 -17t9 -14 t12 -13.5t14 -9.5t17.5 -8t20.5 -4t24.5 -2q36 0 59 12.5t32.5 30t14.5 34.5t11.5 29.5t17.5 12.5h12q11 0 17.5 -12.5t11.5 -29.5t14.5 -34.5t32.5 -30t59 -12.5q13 0 24.5 2t20.5 4t17.5 8t14 9.5t12 13.5t9 14t8.5 17t7.5 17t7 20.5t7.5 20.5q2 7 7.5 10.5t7.5 6.5 q2 9 4 27zM1408 131q0 -121 -73 -190t-194 -69h-874q-121 0 -194 69t-73 190q0 61 4.5 118t19 125.5t37.5 123.5t63.5 103.5t93.5 74.5l-90 220h214q-22 64 -22 128q0 12 2 32q-194 40 -194 96q0 57 210 99q17 62 51.5 134t70.5 114q32 37 76 37q30 0 84 -31t84 -31t84 31 t84 31q44 0 76 -37q36 -42 70.5 -114t51.5 -134q210 -42 210 -99q0 -56 -194 -96q7 -81 -20 -160h214l-82 -225q63 -33 107.5 -96.5t65.5 -143.5t29 -151.5t8 -148.5z" /> +<glyph unicode="" horiz-adv-x="2304" d="M2301 500q12 -103 -22 -198.5t-99 -163.5t-158.5 -106t-196.5 -31q-161 11 -279.5 125t-134.5 274q-12 111 27.5 210.5t118.5 170.5l-71 107q-96 -80 -151 -194t-55 -244q0 -27 -18.5 -46.5t-45.5 -19.5h-256h-69q-23 -164 -149 -274t-294 -110q-185 0 -316.5 131.5 t-131.5 316.5t131.5 316.5t316.5 131.5q76 0 152 -27l24 45q-123 110 -304 110h-64q-26 0 -45 19t-19 45t19 45t45 19h128q78 0 145 -13.5t116.5 -38.5t71.5 -39.5t51 -36.5h512h115l-85 128h-222q-30 0 -49 22.5t-14 52.5q4 23 23 38t43 15h253q33 0 53 -28l70 -105 l114 114q19 19 46 19h101q26 0 45 -19t19 -45v-128q0 -26 -19 -45t-45 -19h-179l115 -172q131 63 275 36q143 -26 244 -134.5t118 -253.5zM448 128q115 0 203 72.5t111 183.5h-314q-35 0 -55 31q-18 32 -1 63l147 277q-47 13 -91 13q-132 0 -226 -94t-94 -226t94 -226 t226 -94zM1856 128q132 0 226 94t94 226t-94 226t-226 94q-60 0 -121 -24l174 -260q15 -23 10 -49t-27 -40q-15 -11 -36 -11q-35 0 -53 29l-174 260q-93 -95 -93 -225q0 -132 94 -226t226 -94z" /> +<glyph unicode="" d="M1408 0q0 -63 -61.5 -113.5t-164 -81t-225 -46t-253.5 -15.5t-253.5 15.5t-225 46t-164 81t-61.5 113.5q0 49 33 88.5t91 66.5t118 44.5t131 29.5q26 5 48 -10.5t26 -41.5q5 -26 -10.5 -48t-41.5 -26q-58 -10 -106 -23.5t-76.5 -25.5t-48.5 -23.5t-27.5 -19.5t-8.5 -12 q3 -11 27 -26.5t73 -33t114 -32.5t160.5 -25t201.5 -10t201.5 10t160.5 25t114 33t73 33.5t27 27.5q-1 4 -8.5 11t-27.5 19t-48.5 23.5t-76.5 25t-106 23.5q-26 4 -41.5 26t-10.5 48q4 26 26 41.5t48 10.5q71 -12 131 -29.5t118 -44.5t91 -66.5t33 -88.5zM1024 896v-384 q0 -26 -19 -45t-45 -19h-64v-384q0 -26 -19 -45t-45 -19h-256q-26 0 -45 19t-19 45v384h-64q-26 0 -45 19t-19 45v384q0 53 37.5 90.5t90.5 37.5h384q53 0 90.5 -37.5t37.5 -90.5zM928 1280q0 -93 -65.5 -158.5t-158.5 -65.5t-158.5 65.5t-65.5 158.5t65.5 158.5t158.5 65.5 t158.5 -65.5t65.5 -158.5z" /> +<glyph unicode="" horiz-adv-x="1792" d="M1280 512h305q-5 -6 -10 -10.5t-9 -7.5l-3 -4l-623 -600q-18 -18 -44 -18t-44 18l-624 602q-5 2 -21 20h369q22 0 39.5 13.5t22.5 34.5l70 281l190 -667q6 -20 23 -33t39 -13q21 0 38 13t23 33l146 485l56 -112q18 -35 57 -35zM1792 940q0 -145 -103 -300h-369l-111 221 q-8 17 -25.5 27t-36.5 8q-45 -5 -56 -46l-129 -430l-196 686q-6 20 -23.5 33t-39.5 13t-39 -13.5t-22 -34.5l-116 -464h-423q-103 155 -103 300q0 220 127 344t351 124q62 0 126.5 -21.5t120 -58t95.5 -68.5t76 -68q36 36 76 68t95.5 68.5t120 58t126.5 21.5q224 0 351 -124 t127 -344z" /> +<glyph unicode="" horiz-adv-x="1280" d="M1152 960q0 -221 -147.5 -384.5t-364.5 -187.5v-260h224q14 0 23 -9t9 -23v-64q0 -14 -9 -23t-23 -9h-224v-224q0 -14 -9 -23t-23 -9h-64q-14 0 -23 9t-9 23v224h-224q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h224v260q-150 16 -271.5 103t-186 224t-52.5 292 q11 134 80.5 249t182 188t245.5 88q170 19 319 -54t236 -212t87 -306zM128 960q0 -185 131.5 -316.5t316.5 -131.5t316.5 131.5t131.5 316.5t-131.5 316.5t-316.5 131.5t-316.5 -131.5t-131.5 -316.5z" /> +<glyph unicode="" horiz-adv-x="1792" d="M1280 1504q0 14 9 23t23 9h416q26 0 45 -19t19 -45v-416q0 -14 -9 -23t-23 -9h-64q-14 0 -23 9t-9 23v262l-419 -420q87 -104 129.5 -236.5t30.5 -276.5q-22 -250 -200.5 -431t-428.5 -206q-163 -17 -314 39.5t-256.5 162t-162 256.5t-39.5 314q25 250 206 428.5 t431 200.5q144 12 276.5 -30.5t236.5 -129.5l419 419h-261q-14 0 -23 9t-9 23v64zM704 -128q117 0 223.5 45.5t184 123t123 184t45.5 223.5t-45.5 223.5t-123 184t-184 123t-223.5 45.5t-223.5 -45.5t-184 -123t-123 -184t-45.5 -223.5t45.5 -223.5t123 -184t184 -123 t223.5 -45.5z" /> +<glyph unicode="" horiz-adv-x="1280" d="M830 1220q145 -72 233.5 -210.5t88.5 -305.5q0 -221 -147.5 -384.5t-364.5 -187.5v-132h96q14 0 23 -9t9 -23v-64q0 -14 -9 -23t-23 -9h-96v-96q0 -14 -9 -23t-23 -9h-64q-14 0 -23 9t-9 23v96h-96q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h96v132q-217 24 -364.5 187.5 t-147.5 384.5q0 167 88.5 305.5t233.5 210.5q-165 96 -228 273q-6 16 3.5 29.5t26.5 13.5h69q21 0 29 -20q44 -106 140 -171t214 -65t214 65t140 171q8 20 37 20h61q17 0 26.5 -13.5t3.5 -29.5q-63 -177 -228 -273zM576 256q185 0 316.5 131.5t131.5 316.5t-131.5 316.5 t-316.5 131.5t-316.5 -131.5t-131.5 -316.5t131.5 -316.5t316.5 -131.5z" /> +<glyph unicode="" d="M1024 1504q0 14 9 23t23 9h288q26 0 45 -19t19 -45v-288q0 -14 -9 -23t-23 -9h-64q-14 0 -23 9t-9 23v134l-254 -255q126 -158 126 -359q0 -221 -147.5 -384.5t-364.5 -187.5v-132h96q14 0 23 -9t9 -23v-64q0 -14 -9 -23t-23 -9h-96v-96q0 -14 -9 -23t-23 -9h-64 q-14 0 -23 9t-9 23v96h-96q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h96v132q-149 16 -270.5 103t-186.5 223.5t-53 291.5q16 204 160 353.5t347 172.5q118 14 228 -19t198 -103l255 254h-134q-14 0 -23 9t-9 23v64zM576 256q185 0 316.5 131.5t131.5 316.5t-131.5 316.5 t-316.5 131.5t-316.5 -131.5t-131.5 -316.5t131.5 -316.5t316.5 -131.5z" /> +<glyph unicode="" horiz-adv-x="1792" d="M1280 1504q0 14 9 23t23 9h288q26 0 45 -19t19 -45v-288q0 -14 -9 -23t-23 -9h-64q-14 0 -23 9t-9 23v134l-254 -255q126 -158 126 -359q0 -221 -147.5 -384.5t-364.5 -187.5v-132h96q14 0 23 -9t9 -23v-64q0 -14 -9 -23t-23 -9h-96v-96q0 -14 -9 -23t-23 -9h-64 q-14 0 -23 9t-9 23v96h-96q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h96v132q-217 24 -364.5 187.5t-147.5 384.5q0 201 126 359l-52 53l-101 -111q-9 -10 -22 -10.5t-23 7.5l-48 44q-10 8 -10.5 21.5t8.5 23.5l105 115l-111 112v-134q0 -14 -9 -23t-23 -9h-64q-14 0 -23 9 t-9 23v288q0 26 19 45t45 19h288q14 0 23 -9t9 -23v-64q0 -14 -9 -23t-23 -9h-133l106 -107l86 94q9 10 22 10.5t23 -7.5l48 -44q10 -8 10.5 -21.5t-8.5 -23.5l-90 -99l57 -56q158 126 359 126t359 -126l255 254h-134q-14 0 -23 9t-9 23v64zM832 256q185 0 316.5 131.5 t131.5 316.5t-131.5 316.5t-316.5 131.5t-316.5 -131.5t-131.5 -316.5t131.5 -316.5t316.5 -131.5z" /> +<glyph unicode="" horiz-adv-x="1792" d="M1790 1007q12 -155 -52.5 -292t-186 -224t-271.5 -103v-260h224q14 0 23 -9t9 -23v-64q0 -14 -9 -23t-23 -9h-224v-224q0 -14 -9 -23t-23 -9h-64q-14 0 -23 9t-9 23v224h-512v-224q0 -14 -9 -23t-23 -9h-64q-14 0 -23 9t-9 23v224h-224q-14 0 -23 9t-9 23v64q0 14 9 23 t23 9h224v260q-150 16 -271.5 103t-186 224t-52.5 292q17 206 164.5 356.5t352.5 169.5q206 21 377 -94q171 115 377 94q205 -19 352.5 -169.5t164.5 -356.5zM896 647q128 131 128 313t-128 313q-128 -131 -128 -313t128 -313zM576 512q115 0 218 57q-154 165 -154 391 q0 224 154 391q-103 57 -218 57q-185 0 -316.5 -131.5t-131.5 -316.5t131.5 -316.5t316.5 -131.5zM1152 128v260q-137 15 -256 94q-119 -79 -256 -94v-260h512zM1216 512q185 0 316.5 131.5t131.5 316.5t-131.5 316.5t-316.5 131.5q-115 0 -218 -57q154 -167 154 -391 q0 -226 -154 -391q103 -57 218 -57z" /> +<glyph unicode="" horiz-adv-x="1920" d="M1536 1120q0 14 9 23t23 9h288q26 0 45 -19t19 -45v-288q0 -14 -9 -23t-23 -9h-64q-14 0 -23 9t-9 23v134l-254 -255q76 -95 107.5 -214t9.5 -247q-31 -182 -166 -312t-318 -156q-210 -29 -384.5 80t-241.5 300q-117 6 -221 57.5t-177.5 133t-113.5 192.5t-32 230 q9 135 78 252t182 191.5t248 89.5q118 14 227.5 -19t198.5 -103l255 254h-134q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h288q26 0 45 -19t19 -45v-288q0 -14 -9 -23t-23 -9h-64q-14 0 -23 9t-9 23v134l-254 -255q59 -74 93 -169q182 -9 328 -124l255 254h-134q-14 0 -23 9 t-9 23v64zM1024 704q0 20 -4 58q-162 -25 -271 -150t-109 -292q0 -20 4 -58q162 25 271 150t109 292zM128 704q0 -168 111 -294t276 -149q-3 29 -3 59q0 210 135 369.5t338 196.5q-53 120 -163.5 193t-245.5 73q-185 0 -316.5 -131.5t-131.5 -316.5zM1088 -128 q185 0 316.5 131.5t131.5 316.5q0 168 -111 294t-276 149q3 -29 3 -59q0 -210 -135 -369.5t-338 -196.5q53 -120 163.5 -193t245.5 -73z" /> +<glyph unicode="" horiz-adv-x="2048" d="M1664 1504q0 14 9 23t23 9h288q26 0 45 -19t19 -45v-288q0 -14 -9 -23t-23 -9h-64q-14 0 -23 9t-9 23v134l-254 -255q76 -95 107.5 -214t9.5 -247q-32 -180 -164.5 -310t-313.5 -157q-223 -34 -409 90q-117 -78 -256 -93v-132h96q14 0 23 -9t9 -23v-64q0 -14 -9 -23 t-23 -9h-96v-96q0 -14 -9 -23t-23 -9h-64q-14 0 -23 9t-9 23v96h-96q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h96v132q-155 17 -279.5 109.5t-187 237.5t-39.5 307q25 187 159.5 322.5t320.5 164.5q224 34 410 -90q146 97 320 97q201 0 359 -126l255 254h-134q-14 0 -23 9 t-9 23v64zM896 391q128 131 128 313t-128 313q-128 -131 -128 -313t128 -313zM128 704q0 -185 131.5 -316.5t316.5 -131.5q117 0 218 57q-154 167 -154 391t154 391q-101 57 -218 57q-185 0 -316.5 -131.5t-131.5 -316.5zM1216 256q185 0 316.5 131.5t131.5 316.5 t-131.5 316.5t-316.5 131.5q-117 0 -218 -57q154 -167 154 -391t-154 -391q101 -57 218 -57z" /> +<glyph unicode="" horiz-adv-x="1792" d="M1728 1536q26 0 45 -19t19 -45v-416q0 -14 -9 -23t-23 -9h-64q-14 0 -23 9t-9 23v262l-229 -230l156 -156q9 -10 9 -23t-9 -22l-46 -46q-9 -9 -22 -9t-23 9l-156 157l-99 -100q87 -104 129.5 -236.5t30.5 -276.5q-22 -250 -200.5 -431t-428.5 -206q-163 -17 -314 39.5 t-256.5 162t-162 256.5t-39.5 314q25 250 206 428.5t431 200.5q144 12 276.5 -30.5t236.5 -129.5l99 99l-156 156q-9 10 -9 23t9 22l46 46q9 9 22 9t23 -9l156 -156l229 229h-261q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h416zM1280 448q0 117 -45.5 223.5t-123 184t-184 123 t-223.5 45.5t-223.5 -45.5t-184 -123t-123 -184t-45.5 -223.5t45.5 -223.5t123 -184t184 -123t223.5 -45.5t223.5 45.5t184 123t123 184t45.5 223.5z" /> +<glyph unicode="" horiz-adv-x="1280" d="M640 892q217 -24 364.5 -187.5t147.5 -384.5q0 -167 -87 -306t-236 -212t-319 -54q-133 15 -245.5 88t-182 188t-80.5 249q-12 155 52.5 292t186 224t271.5 103v132h-160q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h160v165l-92 -92q-10 -9 -23 -9t-22 9l-46 46q-9 9 -9 22 t9 23l202 201q19 19 45 19t45 -19l202 -201q9 -10 9 -23t-9 -22l-46 -46q-9 -9 -22 -9t-23 9l-92 92v-165h160q14 0 23 -9t9 -23v-64q0 -14 -9 -23t-23 -9h-160v-132zM576 -128q185 0 316.5 131.5t131.5 316.5t-131.5 316.5t-316.5 131.5t-316.5 -131.5t-131.5 -316.5 t131.5 -316.5t316.5 -131.5z" /> +<glyph unicode="" horiz-adv-x="2048" d="M2029 685q19 -19 19 -45t-19 -45l-294 -294q-9 -10 -22.5 -10t-22.5 10l-45 45q-10 9 -10 22.5t10 22.5l185 185h-294v-224q0 -14 -9 -23t-23 -9h-64q-14 0 -23 9t-9 23v224h-131q-12 -119 -67 -226t-139 -183.5t-196.5 -121.5t-234.5 -45q-180 0 -330.5 91t-234.5 247 t-74 337q8 162 94 300t226.5 219.5t302.5 85.5q166 4 310.5 -71.5t235.5 -208.5t107 -296h131v224q0 14 9 23t23 9h64q14 0 23 -9t9 -23v-224h294l-185 185q-10 9 -10 22.5t10 22.5l45 45q9 10 22.5 10t22.5 -10zM640 128q104 0 198.5 40.5t163.5 109.5t109.5 163.5 t40.5 198.5t-40.5 198.5t-109.5 163.5t-163.5 109.5t-198.5 40.5t-198.5 -40.5t-163.5 -109.5t-109.5 -163.5t-40.5 -198.5t40.5 -198.5t109.5 -163.5t163.5 -109.5t198.5 -40.5z" /> +<glyph unicode="" horiz-adv-x="1280" d="M1152 960q0 -221 -147.5 -384.5t-364.5 -187.5v-612q0 -14 -9 -23t-23 -9h-64q-14 0 -23 9t-9 23v612q-217 24 -364.5 187.5t-147.5 384.5q0 117 45.5 223.5t123 184t184 123t223.5 45.5t223.5 -45.5t184 -123t123 -184t45.5 -223.5zM576 512q185 0 316.5 131.5 t131.5 316.5t-131.5 316.5t-316.5 131.5t-316.5 -131.5t-131.5 -316.5t131.5 -316.5t316.5 -131.5z" /> +<glyph unicode="" horiz-adv-x="1792" /> +<glyph unicode="" horiz-adv-x="1792" /> +<glyph unicode="" horiz-adv-x="1792" /> +<glyph unicode="" d="M1451 1408q35 0 60 -25t25 -60v-1366q0 -35 -25 -60t-60 -25h-391v595h199l30 232h-229v148q0 56 23.5 84t91.5 28l122 1v207q-63 9 -178 9q-136 0 -217.5 -80t-81.5 -226v-171h-200v-232h200v-595h-735q-35 0 -60 25t-25 60v1366q0 35 25 60t60 25h1366z" /> +<glyph unicode="" horiz-adv-x="1280" d="M0 939q0 108 37.5 203.5t103.5 166.5t152 123t185 78t202 26q158 0 294 -66.5t221 -193.5t85 -287q0 -96 -19 -188t-60 -177t-100 -149.5t-145 -103t-189 -38.5q-68 0 -135 32t-96 88q-10 -39 -28 -112.5t-23.5 -95t-20.5 -71t-26 -71t-32 -62.5t-46 -77.5t-62 -86.5 l-14 -5l-9 10q-15 157 -15 188q0 92 21.5 206.5t66.5 287.5t52 203q-32 65 -32 169q0 83 52 156t132 73q61 0 95 -40.5t34 -102.5q0 -66 -44 -191t-44 -187q0 -63 45 -104.5t109 -41.5q55 0 102 25t78.5 68t56 95t38 110.5t20 111t6.5 99.5q0 173 -109.5 269.5t-285.5 96.5 q-200 0 -334 -129.5t-134 -328.5q0 -44 12.5 -85t27 -65t27 -45.5t12.5 -30.5q0 -28 -15 -73t-37 -45q-2 0 -17 3q-51 15 -90.5 56t-61 94.5t-32.5 108t-11 106.5z" /> +<glyph unicode="" d="M985 562q13 0 97.5 -44t89.5 -53q2 -5 2 -15q0 -33 -17 -76q-16 -39 -71 -65.5t-102 -26.5q-57 0 -190 62q-98 45 -170 118t-148 185q-72 107 -71 194v8q3 91 74 158q24 22 52 22q6 0 18 -1.5t19 -1.5q19 0 26.5 -6.5t15.5 -27.5q8 -20 33 -88t25 -75q0 -21 -34.5 -57.5 t-34.5 -46.5q0 -7 5 -15q34 -73 102 -137q56 -53 151 -101q12 -7 22 -7q15 0 54 48.5t52 48.5zM782 32q127 0 243.5 50t200.5 134t134 200.5t50 243.5t-50 243.5t-134 200.5t-200.5 134t-243.5 50t-243.5 -50t-200.5 -134t-134 -200.5t-50 -243.5q0 -203 120 -368l-79 -233 l242 77q158 -104 345 -104zM782 1414q153 0 292.5 -60t240.5 -161t161 -240.5t60 -292.5t-60 -292.5t-161 -240.5t-240.5 -161t-292.5 -60q-195 0 -365 94l-417 -134l136 405q-108 178 -108 389q0 153 60 292.5t161 240.5t240.5 161t292.5 60z" /> +<glyph unicode="" horiz-adv-x="1792" d="M128 128h1024v128h-1024v-128zM128 640h1024v128h-1024v-128zM1696 192q0 40 -28 68t-68 28t-68 -28t-28 -68t28 -68t68 -28t68 28t28 68zM128 1152h1024v128h-1024v-128zM1696 704q0 40 -28 68t-68 28t-68 -28t-28 -68t28 -68t68 -28t68 28t28 68zM1696 1216 q0 40 -28 68t-68 28t-68 -28t-28 -68t28 -68t68 -28t68 28t28 68zM1792 384v-384h-1792v384h1792zM1792 896v-384h-1792v384h1792zM1792 1408v-384h-1792v384h1792z" /> +<glyph unicode="" horiz-adv-x="2048" d="M704 640q-159 0 -271.5 112.5t-112.5 271.5t112.5 271.5t271.5 112.5t271.5 -112.5t112.5 -271.5t-112.5 -271.5t-271.5 -112.5zM1664 512h352q13 0 22.5 -9.5t9.5 -22.5v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-352v-352q0 -13 -9.5 -22.5t-22.5 -9.5h-192q-13 0 -22.5 9.5 t-9.5 22.5v352h-352q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h352v352q0 13 9.5 22.5t22.5 9.5h192q13 0 22.5 -9.5t9.5 -22.5v-352zM928 288q0 -52 38 -90t90 -38h256v-238q-68 -50 -171 -50h-874q-121 0 -194 69t-73 190q0 53 3.5 103.5t14 109t26.5 108.5 t43 97.5t62 81t85.5 53.5t111.5 20q19 0 39 -17q79 -61 154.5 -91.5t164.5 -30.5t164.5 30.5t154.5 91.5q20 17 39 17q132 0 217 -96h-223q-52 0 -90 -38t-38 -90v-192z" /> +<glyph unicode="" horiz-adv-x="2048" d="M704 640q-159 0 -271.5 112.5t-112.5 271.5t112.5 271.5t271.5 112.5t271.5 -112.5t112.5 -271.5t-112.5 -271.5t-271.5 -112.5zM1781 320l249 -249q9 -9 9 -23q0 -13 -9 -22l-136 -136q-9 -9 -22 -9q-14 0 -23 9l-249 249l-249 -249q-9 -9 -23 -9q-13 0 -22 9l-136 136 q-9 9 -9 22q0 14 9 23l249 249l-249 249q-9 9 -9 23q0 13 9 22l136 136q9 9 22 9q14 0 23 -9l249 -249l249 249q9 9 23 9q13 0 22 -9l136 -136q9 -9 9 -22q0 -14 -9 -23zM1283 320l-181 -181q-37 -37 -37 -91q0 -53 37 -90l83 -83q-21 -3 -44 -3h-874q-121 0 -194 69 t-73 190q0 53 3.5 103.5t14 109t26.5 108.5t43 97.5t62 81t85.5 53.5t111.5 20q19 0 39 -17q154 -122 319 -122t319 122q20 17 39 17q28 0 57 -6q-28 -27 -41 -50t-13 -56q0 -54 37 -91z" /> +<glyph unicode="" horiz-adv-x="2048" d="M256 512h1728q26 0 45 -19t19 -45v-448h-256v256h-1536v-256h-256v1216q0 26 19 45t45 19h128q26 0 45 -19t19 -45v-704zM832 832q0 106 -75 181t-181 75t-181 -75t-75 -181t75 -181t181 -75t181 75t75 181zM2048 576v64q0 159 -112.5 271.5t-271.5 112.5h-704 q-26 0 -45 -19t-19 -45v-384h1152z" /> +<glyph unicode="" d="M1536 1536l-192 -448h192v-192h-274l-55 -128h329v-192h-411l-357 -832l-357 832h-411v192h329l-55 128h-274v192h192l-192 448h256l323 -768h378l323 768h256zM768 320l108 256h-216z" /> +<glyph unicode="" d="M1088 1536q185 0 316.5 -93.5t131.5 -226.5v-896q0 -130 -125.5 -222t-305.5 -97l213 -202q16 -15 8 -35t-30 -20h-1056q-22 0 -30 20t8 35l213 202q-180 5 -305.5 97t-125.5 222v896q0 133 131.5 226.5t316.5 93.5h640zM768 192q80 0 136 56t56 136t-56 136t-136 56 t-136 -56t-56 -136t56 -136t136 -56zM1344 768v512h-1152v-512h1152z" /> +<glyph unicode="" d="M1088 1536q185 0 316.5 -93.5t131.5 -226.5v-896q0 -130 -125.5 -222t-305.5 -97l213 -202q16 -15 8 -35t-30 -20h-1056q-22 0 -30 20t8 35l213 202q-180 5 -305.5 97t-125.5 222v896q0 133 131.5 226.5t316.5 93.5h640zM288 224q66 0 113 47t47 113t-47 113t-113 47 t-113 -47t-47 -113t47 -113t113 -47zM704 768v512h-544v-512h544zM1248 224q66 0 113 47t47 113t-47 113t-113 47t-113 -47t-47 -113t47 -113t113 -47zM1408 768v512h-576v-512h576z" /> +<glyph unicode="" horiz-adv-x="1792" d="M1792 204v-209h-642v209h134v926h-6l-314 -1135h-243l-310 1135h-8v-926h135v-209h-538v209h69q21 0 43 19.5t22 37.5v881q0 18 -22 40t-43 22h-69v209h672l221 -821h6l223 821h670v-209h-71q-19 0 -41 -22t-22 -40v-881q0 -18 21.5 -37.5t41.5 -19.5h71z" /> +<glyph unicode="" horiz-adv-x="1792" /> +<glyph unicode="" horiz-adv-x="1792" /> +<glyph unicode="" horiz-adv-x="1792" /> +<glyph unicode="" horiz-adv-x="1792" /> <glyph unicode="" horiz-adv-x="1792" /> </font> </defs></svg> \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/static/fonts/fontawesome-webfont.ttf b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/static/fonts/fontawesome-webfont.ttf index e89738de5eaf8fca33a2f2cdc5cb4929caa62b71..ed9372f8ea0fbaa04f42630a48887e4b38945345 100755 Binary files a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/static/fonts/fontawesome-webfont.ttf and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/static/fonts/fontawesome-webfont.ttf differ diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/static/fonts/fontawesome-webfont.woff b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/static/fonts/fontawesome-webfont.woff index 8c1748aab7a790d510fb3f42a8a8971d96efa79d..8b280b98fa2fa261aa4b0f8fd061f772073ef83e 100755 Binary files a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/static/fonts/fontawesome-webfont.woff and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/static/fonts/fontawesome-webfont.woff differ diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/static/fonts/fontawesome-webfont.woff2 b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/static/fonts/fontawesome-webfont.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..3311d585145b1cc1b9581e914acbb32d8542b4f5 Binary files /dev/null and b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/static/fonts/fontawesome-webfont.woff2 differ diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/static/nextgen_gallery_display_settings.min.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/static/nextgen_gallery_display_settings.min.css new file mode 100644 index 0000000000000000000000000000000000000000..1cb86a6371d1e690eb4b37ee110f142d709cfc48 --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/static/nextgen_gallery_display_settings.min.css @@ -0,0 +1 @@ +.gallery_page_ngg_display_settings table{height:100%}.gallery_page_ngg_display_settings table tr{height:28px}.gallery_page_ngg_display_settings table tr td:first-child{vertical-align:top;text-align:right;padding-right:7px;padding-top:5px}.gallery_page_ngg_display_settings textarea{height:60px}.gallery_page_ngg_display_settings textarea,.gallery_page_ngg_display_settings input[type=text]{width:155px}.gallery_page_ngg_display_settings input[type=number]{width:75px;text-align:center}.gallery_page_ngg_display_settings select{width:155px;text-align:center}.gallery_page_ngg_display_settings select.nextgen_settings_field_width_and_unit,.gallery_page_ngg_display_settings input.nextgen_settings_field_width_and_unit{text-align:center;width:75px}.gallery_page_ngg_display_settings input.nextgen_settings_field_width_and_height{width:65px}.entity_errors{color:red}.entity_errors ul{margin-left:30px}.entity_errors ul li{list-style-type:disc} \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/static/nextgen_gallery_display_settings.min.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/static/nextgen_gallery_display_settings.min.js new file mode 100644 index 0000000000000000000000000000000000000000..fcf9098f993745ef5afd3d4c918cca6773b882ab --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/static/nextgen_gallery_display_settings.min.js @@ -0,0 +1 @@ +eval(function(p,a,c,k,e,d){e=function(c){return c.toString(36)};if(!''.replace(/^/,String)){while(c--){d[c.toString(a)]=k[c]||c.toString(a)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('3(7($){$(\'.1\').1({5:4,2:6,8:\'e\'});$(\'d, c\').b();$(\'9.0, a.0\').0()});',15,15,'tooltip|accordion|autoHeight|jQuery|true|clearStyle|false|function|heightStyle|label|span|placeholder|textarea|input|content'.split('|'),0,{})) diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/static/nextgen_gallery_related_images.min.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/static/nextgen_gallery_related_images.min.css new file mode 100644 index 0000000000000000000000000000000000000000..b5700d3788b66ab5e8276b1a3ead70da506c99e1 --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/static/nextgen_gallery_related_images.min.css @@ -0,0 +1 @@ +.ngg-related-gallery{background:#f9f9f9;border:1px solid #e0e0e0;overflow:hidden;margin-bottom:1em;margin-top:1em;padding:5px}.ngg-related-gallery img{border:1px solid #ddd;float:left;margin:0 3px;padding:2px;height:50px;width:50px}.ngg-related-gallery img:hover{border:1px solid #000} \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/static/trigger_buttons.min.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/static/trigger_buttons.min.css new file mode 100644 index 0000000000000000000000000000000000000000..7a6a76173d67fb7fa1a0fdcfaa4edc0043f30354 --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/static/trigger_buttons.min.css @@ -0,0 +1 @@ +.ngg-trigger-buttons{clear:both;text-align:right;font-size:12px;line-height:1em;margin:0}.ngg-trigger-buttons.hidden{display:none}.ngg-trigger-large{font-size:16px;margin:0 10px}.ngg-trigger-buttons .ngg-trigger{margin-left:.3em;cursor:pointer}.ngg-trigger-buttons .ngg-trigger:active,.ngg-trigger-buttons .ngg-trigger:focus,.ngg-trigger-buttons .ngg-trigger:visited,.ngg-trigger-buttons .ngg-trigger{color:#999}.ngg-trigger-buttons .ngg-trigger:hover{color:#333}.galleria.photocrati-nextgen_pro_horizontal_filmstrip{margin-bottom:5px}@media screen and (min-width:0) and (max-width:1024px){.ngg-trigger-buttons.mobile-hide{display:none}} \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/templates/alt_view_link_text.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/templates/alt_view_link_text.php index 30b255dccb8e6c9171515e88cc1533b1b508e9aa..28986c1fa05cc2fdf9c21dc47f18a9c0b28dc56f 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/templates/alt_view_link_text.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/templates/alt_view_link_text.php @@ -1,9 +1,9 @@ <tr id='tr_<?php print esc_attr("{$display_type_name}_alt_view_link_text"); ?>' class='<?php print !empty($hidden) ? 'hidden' : ''; ?>'> <td> <label for='<?php echo esc_attr($display_type_name); ?>_alt_view_link_text' class='tooltip'> - <?php echo_h($alt_view_link_text_label); ?> + <?php esc_html_e($alt_view_link_text_label); ?> <span> - <?php echo_h($tooltip)?> + <?php esc_html_e($tooltip)?> </span> </label> </td> diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/templates/alternative_view.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/templates/alternative_view.php index cba056cdc88b92900badfc9c9f3383ab176571f3..fc6c04b3ddf791bd88ba4bb4195c4be85eaa1fef 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/templates/alternative_view.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/templates/alternative_view.php @@ -1,9 +1,9 @@ <tr id='tr_<?php print esc_attr("{$display_type_name}_alternative_view"); ?>' class='<?php print !empty($hidden) ? 'hidden' : ''; ?>'> <td> <label for='<?php echo esc_attr($display_type_name); ?>_alternative_view' class="tooltip"> - <?php echo_h($show_alt_view_link_label); ?> + <?php esc_html_e($show_alt_view_link_label); ?> <span> - <?php echo_h($tooltip) ?> + <?php esc_html_e($tooltip) ?> </span> </label> </td> @@ -12,7 +12,7 @@ <option value="0" <?php echo selected(0, $alternative_view) ?>>None</option> <?php foreach ($altviews as $altview_name => $altview_properties): ?> <option value="<?php echo esc_attr($altview_name)?>" <?php echo selected($altview_name, $alternative_view)?>> - <?php echo_h($altview_properties['title'])?> + <?php esc_html_e($altview_properties['title'])?> </option> <?php endforeach ?> </select> diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/templates/image/before.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/templates/image/before.php index f0b1d800521db5fe46927b402548d646f417e277..83d5ae7ebd4185d07f650792ff081e75ce676eea 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/templates/image/before.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/templates/image/before.php @@ -4,4 +4,4 @@ $id = 'ngg-image-' . $index; } ?> -<div id="<?php echo_h($id) ?>" class="<?php echo_h($class) ?>" <?php if (isset($image->style)) echo $image->style; ?>> +<div id="<?php esc_attr_e($id) ?>" class="<?php esc_attr_e($class) ?>" <?php if (isset($image->style)) echo $image->style; ?>> diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/templates/index.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/templates/index.php index 8b5109d79ace1b029ea7232aac0161301d9642b2..a989d3adb91c50b1ddf20d50b777ac4e719e60d8 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/templates/index.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/templates/index.php @@ -1,7 +1,7 @@ <h1>Default Gallery Type Template</h1> <p> This is the default gallery type template, located in:<br/> - <b><?php echo_h(__FILE__)?></b>. + <b><?php esc_html_e(__FILE__)?></b>. </p> <p> If you're seeing this, it's because the gallery type you selected has not diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/templates/related.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/templates/related.php index 46c185ecbaf094d84545ef4a24344d9d260c5a6a..843a32aca313d4a9ca2e0e7865ad4ae423ad131f 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/templates/related.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/templates/related.php @@ -2,15 +2,15 @@ <?php foreach ($images as $image) { ?> <?php - $controller = C_Component_Registry::get_instance()->get_utility('I_Display_Type_Controller'); + $controller = C_Display_Type_Controller::get_instance(); $effect_code = $controller->get_effect_code($gallery->displayed_gallery); ?> <a href="<?php echo $image->imageURL; ?>" - title="<?php echo stripslashes(nggGallery::i18n($image->description, 'pic_' . $image->pid . '_description')); ?>" + title="<?php echo stripslashes(M_I18N::translate($image->description, 'pic_' . $image->pid . '_description')); ?>" <?php echo $effect_code; ?>> - <img title="<?php echo stripslashes(nggGallery::i18n($image->alttext, 'pic_' . $image->pid . '_alttext')); ?>" - alt="<?php echo stripslashes(nggGallery::i18n($image->alttext, 'pic_' . $image->pid . '_alttext')); ?>" + <img title="<?php echo stripslashes(M_I18N::translate($image->alttext, 'pic_' . $image->pid . '_alttext')); ?>" + alt="<?php echo stripslashes(M_I18N::translate($image->alttext, 'pic_' . $image->pid . '_alttext')); ?>" data-image-id="<?php echo esc_attr($image->{$image->id_field})?>" src="<?php echo $image->thumbURL; ?>"/> </a> diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/templates/return_link_text.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/templates/return_link_text.php index bf93e50483720a409b6692e9c4ee2175f180bff5..5968b13e7203746cf6602f685ff9ef65786de659 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/templates/return_link_text.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/templates/return_link_text.php @@ -1,9 +1,9 @@ <tr id='tr_<?php print esc_attr("{$display_type_name}_return_link_text"); ?>' class='<?php print !empty($hidden) ? 'hidden' : ''; ?>'> <td> <label for='<?php echo esc_attr($display_type_name); ?>_return_link_text' class='tooltip'> - <?php echo_h($return_link_text_label); ?> + <?php esc_html_e($return_link_text_label); ?> <span> - <?php echo_h($tooltip)?> + <?php esc_html_e($tooltip)?> </span> </label> </td> diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/templates/show_altview_link.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/templates/show_altview_link.php index 82d608df5c6e4b7719dd108d81dd7e5f317abd47..59dfeea797d336b6615fd07038b5ed3e725e0717 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/templates/show_altview_link.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/templates/show_altview_link.php @@ -1,9 +1,9 @@ <tr id='tr_<?php print esc_attr("{$display_type_name}_show_altview_link"); ?>' class='<?php print !empty($hidden) ? 'hidden' : ''; ?>'> <td> <label for='<?php echo esc_attr($display_type_name); ?>_show_altview_link' class='tooltip'> - <?php echo_h($show_alt_view_link_label); ?> + <?php esc_html_e($show_alt_view_link_label); ?> <span> - <?php echo_h($tooltip); ?> + <?php esc_html_e($tooltip); ?> </span> </label> </td> diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/templates/show_return_link.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/templates/show_return_link.php index 7cbb716d62da345b3b21d2ee01b3b0125a082e7f..a19c8e69d5fc46c065a22a084445ffa015b7dd24 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/templates/show_return_link.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/templates/show_return_link.php @@ -1,9 +1,9 @@ <tr id='tr_<?php print esc_attr("{$display_type_name}_show_return_link"); ?>' class='<?php print !empty($hidden) ? 'hidden' : ''; ?>'> <td> <label for='<?php echo esc_attr($display_type_name); ?>_show_return_link' class="tooltip"> - <?php echo_h($show_return_link_label); ?> + <?php esc_html_e($show_return_link_label); ?> <span> - <?php echo_h($tooltip) ?> + <?php esc_html_e($tooltip) ?> </span> </label> </td> diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/module.nextgen_other_options.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/module.nextgen_other_options.php index 114d7103884ee277b487fb9a1a7c2908a33997ff..e6c8bc8950a41b54528ba7f5a590f91c8128c888 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/module.nextgen_other_options.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/module.nextgen_other_options.php @@ -16,7 +16,7 @@ class M_NextGen_Other_Options extends C_Base_Module 'photocrati-nextgen_other_options', 'Other Options', 'NextGEN Gallery Others Options Page', - '0.7', + '0.8', 'http://www.nextgen-gallery.com', 'Photocrati Media', 'http://www.photocrati.com' @@ -26,6 +26,36 @@ class M_NextGen_Other_Options extends C_Base_Module function _register_hooks() { add_action('admin_bar_menu', array(&$this, 'add_admin_bar_menu'), 101); + add_action('init', array(&$this, 'register_forms')); + } + + function register_forms() + { + $forms = array( + 'image_options' => 'A_Image_Options_Form', + 'thumbnail_options' => 'A_Thumbnail_Options_Form', + 'lightbox_effects' => 'A_Lightbox_Manager_Form', + 'watermarks' => 'A_Watermarks_Form' + ); + + if (!is_multisite() || (is_multisite() && C_NextGen_Settings::get_instance()->get('wpmuStyle'))) + $forms['styles'] = 'A_Styles_Form'; + + if (is_super_admin() && (!is_multisite() || (is_multisite() && C_NextGen_Settings::get_instance()->get('wpmuRoles')))) + $forms['roles_and_capabilities'] = 'A_Roles_Form'; + + $forms += array( + 'miscellaneous' => 'A_Miscellaneous_Form', + 'reset' => 'A_Reset_Form' + ); + + $form_manager = C_Form_Manager::get_instance(); + foreach ($forms as $form => $adapter) { + $form_manager->add_form( + NGG_OTHER_OPTIONS_SLUG, + $form + ); + } } function add_admin_bar_menu() @@ -44,25 +74,75 @@ class M_NextGen_Other_Options extends C_Base_Module function _register_adapters() { - $this->get_registry()->add_adapter( - 'I_Page_Manager', - 'A_Other_Options_Page' - ); + $this->get_registry()->add_adapter('I_Ajax_Controller', 'A_Watermarking_Ajax_Actions'); + $this->get_registry()->add_adapter('I_Ajax_Controller', 'A_Stylesheet_Ajax_Actions'); - $this->get_registry()->add_adapter( - 'I_Form_Manager', - 'A_Other_Options_Forms' - ); + if (is_admin()) { + $this->get_registry()->add_adapter( + 'I_Page_Manager', + 'A_Other_Options_Page' + ); - $this->get_registry()->add_adapter( - 'I_Ajax_Controller', - 'A_Watermarking_Ajax_Actions' - ); + $this->get_registry()->add_adapter( + 'I_Form', + 'A_Custom_Lightbox_Form', + 'custom_lightbox' + ); - $this->get_registry()->add_adapter( - 'I_Ajax_Controller', - 'A_Stylesheet_Ajax_Actions' - ); + $this->get_registry()->add_adapter( + 'I_Form', + 'A_Image_Options_Form', + 'image_options' + ); + + $this->get_registry()->add_adapter( + 'I_Form', + 'A_Thumbnail_Options_Form', + 'thumbnail_options' + ); + + $this->get_registry()->add_adapter( + 'I_Form', + 'A_Lightbox_Manager_Form', + 'lightbox_effects' + ); + + $this->get_registry()->add_adapter( + 'I_Form', + 'A_Watermarks_Form', + 'watermarks' + ); + + $this->get_registry()->add_adapter( + 'I_Form', + 'A_Styles_Form', + 'styles' + ); + + $this->get_registry()->add_adapter( + 'I_Form', + 'A_Roles_Form', + 'roles_and_capabilities' + ); + + $this->get_registry()->add_adapter( + 'I_Form', + 'A_Miscellaneous_Form', + 'miscellaneous' + ); + + $this->get_registry()->add_adapter( + 'I_Form', + 'A_Reset_Form', + 'reset' + ); + + $this->get_registry()->add_adapter( + 'I_NextGen_Admin_Page', + 'A_Other_Options_Controller', + NGG_OTHER_OPTIONS_SLUG + ); + } } function get_type_list() @@ -72,7 +152,6 @@ class M_NextGen_Other_Options extends C_Base_Module 'A_Lightbox_Manager_Form' => 'adapter.lightbox_manager_form.php', 'A_Miscellaneous_Form' => 'adapter.miscellaneous_form.php', 'A_Other_Options_Controller' => 'adapter.other_options_controller.php', - 'A_Other_Options_Forms' => 'adapter.other_options_forms.php', 'A_Other_Options_Page' => 'adapter.other_options_page.php', 'A_Reset_Form' => 'adapter.reset_form.php', 'A_Roles_Form' => 'adapter.roles_form.php', @@ -81,6 +160,8 @@ class M_NextGen_Other_Options extends C_Base_Module 'A_Watermarking_Ajax_Actions' => 'adapter.watermarking_ajax_actions.php', 'A_Watermarks_Form' => 'adapter.watermarks_form.php', 'A_Stylesheet_Ajax_Actions' => 'adapter.stylesheet_ajax_actions.php', + 'C_Settings_Model' => 'class.settings_model.php', + 'A_Custom_Lightbox_Form' => 'adapter.custom_lightbox_form.php', 'C_Settings_Model' => 'class.settings_model.php' ); } diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/package.module.nextgen_other_options.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/package.module.nextgen_other_options.php new file mode 100644 index 0000000000000000000000000000000000000000..6202082ab18ca017a3c96f34beaa701c93d87b72 --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/package.module.nextgen_other_options.php @@ -0,0 +1,675 @@ +<?php +class A_Custom_Lightbox_Form extends Mixin +{ + public function get_model() + { + return C_Lightbox_Library_Manager::get_instance()->get('custom_lightbox'); + } + /** + * Returns a list of fields to render on the settings page + */ + public function _get_field_names() + { + return array('lightbox_library_code', 'lightbox_library_styles', 'lightbox_library_scripts'); + } + /** + * @param $lightbox + * @return mixed + */ + public function _render_lightbox_library_code_field($lightbox) + { + return $this->_render_text_field($lightbox, 'code', __('Code', 'nggallery'), $lightbox->code); + } + /** + * @param $lightbox + * @return mixed + */ + public function _render_lightbox_library_styles_field($lightbox) + { + return $this->_render_textarea_field($lightbox, 'styles', __('Stylesheet URL', 'nggallery'), implode(' +', $lightbox->styles)); + } + /** + * @param $lightbox + * @return mixed + */ + public function _render_lightbox_library_scripts_field($lightbox) + { + return $this->_render_textarea_field($lightbox, 'scripts', __('Javascript URL', 'nggallery'), implode(' +', $lightbox->scripts)); + } + public function _convert_to_urls($input) + { + $retval = array(); + $urls = explode(' +', $input); + foreach ($urls as $url) { + if (strpos($url, home_url()) === 0) { + $url = str_replace(home_url(), '', $url); + } elseif (strpos($url, 'http') === 0) { + $url = str_replace('https://', '//', $url); + $url = str_replace('http://', '//', $url); + } + $retval[] = $url; + } + return $retval; + } + public function save_action() + { + $settings = C_NextGen_Settings::get_instance(); + $modified = FALSE; + if ($params = $this->param('custom_lightbox')) { + if (array_key_exists('scripts', $params)) { + $settings->thumbEffectScripts = $this->_convert_to_urls($params['scripts']); + $modified = TRUE; + } + if (array_key_exists('styles', $params)) { + $settings->thumbEffectStyles = $this->_convert_to_urls($params['styles']); + $modified = TRUE; + } + if (array_key_exists('code', $params)) { + $settings->thumbEffectCode = $params['code']; + $modified = TRUE; + } + } + if ($modified) { + $settings->save(); + } + } +} +class A_Image_Options_Form extends Mixin +{ + public function get_model() + { + return C_Settings_Model::get_instance(); + } + public function get_title() + { + return __('Image Options', 'nggallery'); + } + /** + * Returns the options available for sorting images + * @return array + */ + public function _get_image_sorting_options() + { + return array(__('Custom', 'nggallery') => 'sortorder', __('Image ID', 'nggallery') => 'pid', __('Filename', 'nggallery') => 'filename', __('Alt/Title Text', 'nggallery') => 'alttext', __('Date/Time', 'nggallery') => 'imagedate'); + } + /** + * Returns the options available for sorting directions + * @return array + */ + public function _get_sorting_direction_options() + { + return array(__('Ascending', 'nggallery') => 'ASC', __('Descending', 'nggallery') => 'DESC'); + } + /** + * Returns the options available for matching related images + */ + public function _get_related_image_match_options() + { + return array(__('Categories', 'nggallery') => 'category', __('Tags', 'nggallery') => 'tags'); + } + /** + * Tries to create the gallery storage directory if it doesn't exist + * already + * @return string + */ + public function _create_gallery_storage_dir($gallerypath = NULL) + { + $retval = TRUE; + if (!$gallerypath) { + $gallerypath = $this->object->get_model()->get('gallerypath'); + } + $fs = C_Fs::get_instance(); + $gallerypath = $fs->join_paths($fs->get_document_root('galleries'), $gallerypath); + if (!@file_exists($gallerypath)) { + @mkdir($gallerypath); + $retval = @file_exists($gallerypath); + } + return $retval; + } + /* + * Renders the form + */ + public function render() + { + if (!$this->object->_create_gallery_storage_dir()) { + $this->object->get_model()->add_error(__('Gallery path does not exist and could not be created', 'nggallery'), 'gallerypath'); + } + $settings = $this->object->get_model(); + return $this->render_partial('photocrati-nextgen_other_options#image_options_tab', array('gallery_path_label' => __('Where would you like galleries stored?', 'nggallery'), 'gallery_path_help' => __('Where galleries and their images are stored', 'nggallery'), 'gallery_path' => $settings->gallerypath, 'delete_image_files_label' => __('Delete Image Files?', 'nggallery'), 'delete_image_files_help' => __('When enabled, image files will be removed after a Gallery has been deleted', 'nggallery'), 'delete_image_files' => $settings->deleteImg, 'show_related_images_label' => __('Show Related Images on Posts?', 'nggallery'), 'show_related_images_help' => __('When enabled, related images will be appended to each post by matching the posts tags/categories to image tags', 'nggallery'), 'show_related_images' => $settings->activateTags, 'related_images_hidden_label' => __('(Show Customization Settings)', 'nggallery'), 'related_images_active_label' => __('(Hide Customization Settings)', 'nggallery'), 'match_related_images_label' => __('How should related images be match?', 'nggallery'), 'match_related_images' => $settings->appendType, 'match_related_image_options' => $this->object->_get_related_image_match_options(), 'max_related_images_label' => __('Maximum # of related images to display', 'nggallery'), 'max_related_images' => $settings->maxImages, 'related_images_heading_label' => __('Heading for related images', 'nggallery'), 'related_images_heading' => $settings->relatedHeading, 'sorting_order_label' => __('What\'s the default sorting method?', 'nggallery'), 'sorting_order_options' => $this->object->_get_image_sorting_options(), 'sorting_order' => $settings->galSort, 'sorting_direction_label' => __('Sort in what direction?', 'nggallery'), 'sorting_direction_options' => $this->object->_get_sorting_direction_options(), 'sorting_direction' => $settings->galSortDir, 'automatic_resize_label' => __('Automatically resize images after upload', 'nggallery'), 'automatic_resize_help' => __('It is recommended that your images be resized to be web friendly', 'nggallery'), 'automatic_resize' => $settings->imgAutoResize, 'resize_images_label' => __('What should images be resized to?', 'nggallery'), 'resize_images_help' => __('After images are uploaded, they will be resized to the above dimensions and quality', 'nggallery'), 'resized_image_width_label' => __('Width:', 'nggallery'), 'resized_image_height_label' => __('Height:', 'nggallery'), 'resized_image_quality_label' => __('Quality:', 'nggallery'), 'resized_image_width' => $settings->imgWidth, 'resized_image_height' => $settings->imgHeight, 'resized_image_quality' => $settings->imgQuality, 'backup_images_label' => __('Backup the original images?', 'nggallery'), 'backup_images_yes_label' => __('Yes'), 'backup_images_no_label' => __('No'), 'backup_images' => $settings->imgBackup), TRUE); + } + public function save_action($image_options) + { + $save = TRUE; + if ($image_options) { + // Update the gallery path. Moves all images to the new location + if (isset($image_options['gallerypath']) && (!is_multisite() || get_current_blog_id() == 1)) { + $fs = C_Fs::get_instance(); + $original_dir = $fs->get_abspath($this->object->get_model()->get('gallerypath')); + $new_dir = $fs->get_abspath($image_options['gallerypath']); + $image_options['gallerypath'] = $fs->add_trailing_slash($image_options['gallerypath']); + } elseif (isset($image_options['gallerypath'])) { + unset($image_options['gallerypath']); + } + // Update image options + if ($save) { + $this->object->get_model()->set($image_options)->save(); + } + } + } + /** + * Copies one directory to another + * @param string $src + * @param string $dst + * @return boolean + */ + public function recursive_copy($src, $dst) + { + $retval = TRUE; + $dir = opendir($src); + @mkdir($dst); + while (false !== ($file = readdir($dir))) { + if ($file != '.' && $file != '..') { + if (is_dir($src . '/' . $file)) { + if (!$this->object->recursive_copy($src . '/' . $file, $dst . '/' . $file)) { + $retval = FALSE; + break; + } + } else { + if (!copy($src . '/' . $file, $dst . '/' . $file)) { + $retval = FALSE; + break; + } + } + } + } + closedir($dir); + return $retval; + } + /** + * Deletes all files within a particular directory + * @param string $dir + * @return boolean + */ + public function recursive_delete($dir) + { + $retval = FALSE; + $fp = opendir($dir); + while (false !== ($file = readdir($fp))) { + if ($file != '.' && $file != '..') { + $file = $dir . '/' . $file; + if (is_dir($file)) { + $retval = $this->object->recursive_delete($file); + } else { + $retval = unlink($file); + } + } + } + closedir($fp); + @rmdir($dir); + return $retval; + } +} +class A_Lightbox_Manager_Form extends Mixin +{ + public function get_model() + { + return C_Settings_Model::get_instance(); + } + public function get_title() + { + return __('Lightbox Effects', 'nggallery'); + } + public function render() + { + $form_manager = C_Form_Manager::get_instance(); + // retrieve and render the settings forms for each library + $sub_fields = array(); + $form_manager->add_form(NGG_LIGHTBOX_OPTIONS_SLUG, 'custom_lightbox'); + foreach ($form_manager->get_forms(NGG_LIGHTBOX_OPTIONS_SLUG, TRUE) as $form) { + $form->enqueue_static_resources(); + $sub_fields[$form->context] = $form->render(FALSE); + } + // Highslide and jQuery.Lightbox were removed in 2.0.73 due to licensing. If a user has selected + // either of those options we silently make their selection fallback to Fancybox + $selected = $this->object->get_model()->thumbEffect; + if (in_array($selected, array('highslide', 'lightbox'))) { + $selected = 'fancybox'; + } + // Render container tab + return $this->render_partial('photocrati-nextgen_other_options#lightbox_library_tab', array('lightbox_library_label' => __('What effect would you like to use?', 'nggallery'), 'libs' => C_Lightbox_Library_Manager::get_instance()->get_all(), 'selected' => $selected, 'sub_fields' => $sub_fields, 'lightbox_global' => $this->object->get_model()->thumbEffectContext), TRUE); + } + public function save_action() + { + $settings = $this->object->get_model(); + // Ensure that a lightbox library was selected + if ($id = $this->object->param('lightbox_library_id')) { + $lightboxes = C_Lightbox_Library_Manager::get_instance(); + if (!$lightboxes->get($id)) { + $settings->add_error('Invalid lightbox effect selected'); + } else { + $settings->thumbEffect = $id; + } + } + // Get thumb effect context + if ($thumbEffectContext = $this->object->param('thumbEffectContext')) { + $settings->thumbEffectContext = $thumbEffectContext; + } + $settings->save(); + // Save other forms + $form_manager = C_Form_Manager::get_instance(); + $form_manager->add_form(NGG_LIGHTBOX_OPTIONS_SLUG, 'custom_lightbox'); + foreach ($form_manager->get_forms(NGG_LIGHTBOX_OPTIONS_SLUG, TRUE) as $form) { + if ($form->has_method('save_action')) { + $form->save_action(); + } + } + } +} +class A_Miscellaneous_Form extends Mixin +{ + public function get_model() + { + return C_Settings_Model::get_instance('global'); + } + public function get_title() + { + return __('Miscellaneous', 'nggallery'); + } + public function render() + { + return $this->object->render_partial('photocrati-nextgen_other_options#misc_tab', array('mediarss_activated' => C_NextGen_Settings::get_instance()->useMediaRSS, 'mediarss_activated_label' => __('Add MediaRSS link?', 'nggallery'), 'mediarss_activated_help' => __('When enabled, adds a MediaRSS link to your header. Third-party web services can use this to publish your galleries', 'nggallery'), 'mediarss_activated_no' => __('No'), 'mediarss_activated_yes' => __('Yes'), 'galleries_in_feeds' => C_NextGen_Settings::get_instance()->galleries_in_feeds, 'galleries_in_feeds_label' => __('Display galleries in feeds', 'nggallery'), 'galleries_in_feeds_help' => __('NextGEN hides its gallery displays in feeds other than MediaRSS. This enables image galleries in feeds.', 'nggallery'), 'galleries_in_feeds_no' => __('No'), 'galleries_in_feeds_yes' => __('Yes'), 'cache_label' => __('Clear image cache', 'nggallery'), 'cache_confirmation' => __('Completely clear the NextGEN cache of all image modifications? + +Choose [Cancel] to Stop, [OK] to proceed.', 'nggallery'), 'slug_field' => $this->_render_text_field((object) array('name' => 'misc_settings'), 'router_param_slug', __('Permalink slug', 'nggallery'), $this->object->get_model()->router_param_slug), 'maximum_entity_count_field' => $this->_render_number_field((object) array('name' => 'misc_settings'), 'maximum_entity_count', __('Maximum image count', 'nggallery'), $this->object->get_model()->maximum_entity_count, __('This is the maximum limit of images that NextGEN will restrict itself to querying', 'nggallery') . ' + ' . __('Note: This limit will not apply to slideshow widgets or random galleries if/when those galleries specify their own image limits', 'nggallery'), FALSE, '', 1)), TRUE); + } + public function cache_action() + { + $cache = C_Cache::get_instance(); + $cache->flush_galleries(); + C_Photocrati_Transient_Manager::flush(); + } + public function save_action() + { + if ($settings = $this->object->param('misc_settings')) { + // The Media RSS setting is actually a local setting, not a global one + $local_settings = C_NextGen_Settings::get_instance(); + $local_settings->set('useMediaRSS', $settings['useMediaRSS']); + unset($settings['useMediaRSS']); + // It's important the router_param_slug never be empty + if (empty($settings['router_param_slug'])) { + $settings['router_param_slug'] = 'nggallery'; + } + // If the router slug has changed, then flush the cache + if ($settings['router_param_slug'] != $this->object->get_model()->router_param_slug) { + C_Photocrati_Transient_Manager::flush('displayed_gallery_rendering'); + } + // Save both setting groups + $this->object->get_model()->set($settings)->save(); + $local_settings->save(); + } + } +} +class A_Other_Options_Controller extends Mixin +{ + public function enqueue_backend_resources() + { + $this->call_parent('enqueue_backend_resources'); + wp_enqueue_script('nextgen_settings_page', $this->get_static_url('photocrati-nextgen_other_options#nextgen_settings_page.js'), array('jquery-ui-accordion', 'jquery-ui-tooltip', 'wp-color-picker', 'jquery.nextgen_radio_toggle')); + wp_enqueue_style('nextgen_settings_page', $this->get_static_url('photocrati-nextgen_other_options#nextgen_settings_page.css')); + } + public function get_page_title() + { + return __('Other Options', 'nggallery'); + } + public function get_required_permission() + { + return 'NextGEN Change options'; + } +} +class A_Other_Options_Page extends Mixin +{ + public function setup() + { + $this->object->add(NGG_OTHER_OPTIONS_SLUG, array('adapter' => 'A_Other_Options_Controller', 'parent' => NGGFOLDER, 'before' => 'ngg_pro_upgrade')); + return $this->call_parent('setup'); + } +} +class A_Reset_Form extends Mixin +{ + public function get_title() + { + return __('Reset Options', 'nggallery'); + } + public function render() + { + return $this->object->render_partial('photocrati-nextgen_other_options#reset_tab', array('reset_value' => __('Reset all options to default settings', 'nggallery'), 'reset_warning' => __('Replace all existing options and gallery options with their default settings', 'nggallery'), 'reset_label' => __('Reset settings', 'nggallery'), 'reset_confirmation' => __('Reset all options to default settings? + +Choose [Cancel] to Stop, [OK] to proceed.', 'nggallery')), TRUE); + } + public function reset_action() + { + global $wpdb; + // Flush the cache + C_Photocrati_Transient_Manager::flush(); + // Uninstall the plugin + $settings = C_NextGen_Settings::get_instance(); + if (defined('NGG_PRO_PLUGIN_VERSION') || defined('NEXTGEN_GALLERY_PRO_VERSION')) { + C_Photocrati_Installer::uninstall('photocrati-nextgen-pro'); + } + C_Photocrati_Installer::uninstall('photocrati-nextgen'); + // removes all ngg_options entry in wp_options + $settings->reset(); + $settings->destroy(); + // clear NextGEN's capabilities from the roles system + $capabilities = array('NextGEN Gallery overview', 'NextGEN Use TinyMCE', 'NextGEN Upload images', 'NextGEN Manage gallery', 'NextGEN Manage others gallery', 'NextGEN Manage tags', 'NextGEN Edit album', 'NextGEN Change style', 'NextGEN Change options', 'NextGEN Attach Interface'); + $roles = array('subscriber', 'contributor', 'author', 'editor', 'administrator'); + foreach ($roles as $role) { + $role = get_role($role); + foreach ($capabilities as $capability) { + $role->remove_cap($capability); + } + } + // Some installations of NextGen that upgraded from 1.9x to 2.0x have duplicates installed, + // so for now (as of 2.0.21) we explicitly remove all display types and lightboxes from the + // db as a way of fixing this. + $wpdb->query($wpdb->prepare("DELETE FROM {$wpdb->posts} WHERE post_type = %s", 'display_type')); + $wpdb->query($wpdb->prepare("DELETE FROM {$wpdb->posts} WHERE post_type = %s", 'lightbox_library')); + // the installation will run on the next page load; so make our own request before reloading the browser + wp_remote_get(admin_url('plugins.php'), array('timeout' => 180, 'blocking' => true, 'sslverify' => false)); + header('Location: ' . $_SERVER['REQUEST_URI']); + throw new E_Clean_Exit(); + } +} +class A_Roles_Form extends Mixin +{ + public function get_title() + { + return __('Roles & Capabilities', 'nggallery'); + } + public function render() + { + $view = implode(DIRECTORY_SEPARATOR, array(rtrim(NGGALLERY_ABSPATH, '/\\'), 'admin', 'roles.php')); + include_once $view; + ob_start(); + nggallery_admin_roles(); + $retval = ob_get_contents(); + ob_end_clean(); + return $retval; + } +} +class A_Styles_Form extends Mixin +{ + public function get_model() + { + return C_Settings_Model::get_instance(); + } + public function get_title() + { + return __('Styles', 'nggallery'); + } + public function render() + { + return $this->object->render_partial('photocrati-nextgen_other_options#styling_tab', array('activateCSS_label' => __('Enable custom CSS', 'nggallery'), 'activateCSS' => $this->object->get_model()->activateCSS, 'select_stylesheet_label' => __('What stylesheet would you like to use?', 'nggallery'), 'stylesheets' => C_NextGen_Style_Manager::get_instance()->find_all_stylesheets(), 'activated_stylesheet' => $this->object->get_model()->CSSfile, 'hidden_label' => __('(Show Customization Options)', 'nggallery'), 'active_label' => __('(Hide Customization Options)', 'nggallery'), 'cssfile_contents_label' => __('File Content:', 'nggallery'), 'writable_label' => __('Changes you make to the contents will be saved to', 'nggallery'), 'readonly_label' => __('You could edit this file if it were writable', 'nggallery')), TRUE); + } + public function save_action() + { + // Ensure that we have + if ($settings = $this->object->param('style_settings')) { + $this->object->get_model()->set($settings)->save(); + // Are we to modify the CSS file? + if ($contents = $this->object->param('cssfile_contents')) { + // Find filename + $css_file = $settings['CSSfile']; + $styles = C_NextGen_Style_Manager::get_instance(); + $styles->save($contents, $css_file); + } + } + } +} +/** + * Registers new AJAX functions for retrieving/updating + * the contents of CSS stylesheets + */ +class A_Stylesheet_Ajax_Actions extends Mixin +{ + /** + * Retrieves the contents of the CSS stylesheet specified + */ + public function get_stylesheet_contents_action() + { + $retval = array(); + if ($this->object->_authorized_for_stylesheet_action()) { + $styles = C_NextGen_Style_Manager::get_instance(); + $abspath = $styles->find_selected_stylesheet_abspath($this->object->param('cssfile')); + $writepath = $styles->get_selected_stylesheet_saved_abspath($this->object->param('cssfile')); + if (is_readable($abspath)) { + $retval['contents'] = file_get_contents($abspath); + $retval['writable'] = is_writable($abspath); + $retval['abspath'] = $abspath; + $retval['writepath'] = $writepath; + } else { + $retval['error'] = 'Could not find stylesheet'; + } + } else { + $retval['error'] = 'Unauthorized'; + } + return $retval; + } + /** + * Determines if the request is authorized + * @return boolean + */ + public function _authorized_for_stylesheet_action() + { + $security = $this->get_registry()->get_utility('I_Security_Manager'); + $sec_actor = $security->get_current_actor(); + return $sec_actor->is_allowed('nextgen_edit_style'); + } +} +class A_Thumbnail_Options_Form extends Mixin +{ + public function get_model() + { + return C_Settings_Model::get_instance(); + } + public function get_title() + { + return __('Thumbnail Options', 'nggallery'); + } + public function render() + { + $settings = $this->object->get_model(); + return $this->render_partial('photocrati-nextgen_other_options#thumbnail_options_tab', array('thumbnail_dimensions_label' => __('Default thumbnail dimensions:', 'nggallery'), 'thumbnail_dimensions_help' => __('When generating thumbnails, what image dimensions do you desire?', 'nggallery'), 'thumbnail_dimensions_width' => $settings->thumbwidth, 'thumbnail_dimensions_height' => $settings->thumbheight, 'thumbnail_crop_label' => __('Set fix dimension?', 'nggallery'), 'thumbnail_crop_help' => __('Ignore the aspect ratio, no portrait thumbnails?', 'nggallery'), 'thumbnail_crop' => $settings->thumbfix, 'thumbnail_quality_label' => __('Adjust Thumbnail Quality?', 'nggallery'), 'thumbnail_quality_help' => __('When generating thumbnails, what image quality do you desire?', 'nggallery'), 'thumbnail_quality' => $settings->thumbquality, 'size_list_label' => __('Size List', 'nggallery'), 'size_list_help' => __('List of default sizes used for thumbnails and images', 'nggallery'), 'size_list' => $settings->thumbnail_dimensions), TRUE); + } + public function save_action() + { + if ($settings = $this->object->param('thumbnail_settings')) { + $this->object->get_model()->set($settings)->save(); + } + } +} +class A_Watermarking_Ajax_Actions extends Mixin +{ + /** + * Gets the new watermark preview url based on the new settings + * @return array + */ + public function get_watermark_preview_url_action() + { + $security = $this->get_registry()->get_utility('I_Security_Manager'); + $sec_actor = $security->get_current_actor(); + if ($sec_actor->is_allowed('nextgen_edit_settings')) { + $settings = C_NextGen_Settings::get_instance(); + $imagegen = C_Dynamic_Thumbnails_Manager::get_instance(); + $mapper = C_Image_Mapper::get_instance(); + $image = $mapper->find_first(); + $storage = C_Gallery_Storage::get_instance(); + $sizeinfo = array('quality' => 100, 'height' => 250, 'crop' => FALSE, 'watermark' => TRUE); + $size = $imagegen->get_size_name($sizeinfo); + $thumbnail_url = $storage->get_image_url($image, $size); + // Temporarily update the watermark options. Generate a new image based + // on these settings + if ($watermark_options = $this->param('watermark_options')) { + $watermark_options['wmFont'] = trim($watermark_options['wmFont']); + $settings->set($watermark_options); + $storage->generate_image_size($image, $size); + $thumbnail_url = $storage->get_image_url($image, $size); + $settings->load(); + } + return array('thumbnail_url' => $thumbnail_url); + } + return null; + } +} +class A_Watermarks_Form extends Mixin +{ + public function get_model() + { + return C_Settings_Model::get_instance(); + } + public function get_title() + { + return __('Watermarks', 'nggallery'); + } + /** + * Gets all fonts installed for watermarking + * @return array + */ + public function _get_watermark_fonts() + { + $retval = array(); + $path = implode(DIRECTORY_SEPARATOR, array(rtrim(NGGALLERY_ABSPATH, '/\\'), 'fonts')); + foreach (scandir($path) as $filename) { + if (strpos($filename, '.') === 0) { + continue; + } else { + $retval[] = $filename; + } + } + return $retval; + } + /** + * Gets watermark sources, along with their respective fields + * @return array + */ + public function _get_watermark_sources() + { + // We do this so that an adapter can add new sources + return array(__('Using an Image', 'nggallery') => 'image', __('Using Text', 'nggallery') => 'text'); + } + /** + * Renders the fields for a watermark source (image, text) + * @return string + */ + public function _get_watermark_source_fields() + { + $retval = array(); + foreach ($this->object->_get_watermark_sources() as $label => $value) { + $method = "_render_watermark_{$value}_fields"; + if ($this->object->has_method($method)) { + $retval[$value] = $this->object->call_method($method); + } + } + return $retval; + } + /** + * Render fields that are needed when 'image' is selected as a watermark + * source + * @return string + */ + public function _render_watermark_image_fields() + { + $message = __('An absolute or relative (to the site document root) file system path', 'nggallery'); + if (ini_get('allow_url_fopen')) { + $message = __('An absolute or relative (to the site document root) file system path or an HTTP url', 'nggallery'); + } + return $this->object->render_partial('photocrati-nextgen_other_options#watermark_image_fields', array('image_url_label' => __('Image URL:', 'nggallery'), 'watermark_image_url' => $this->object->get_model()->wmPath, 'watermark_image_text' => $message), TRUE); + } + /** + * Render fields that are needed when 'text is selected as a watermark + * source + * @return string + */ + public function _render_watermark_text_fields() + { + $settings = $this->object->get_model(); + return $this->object->render_partial('photocrati-nextgen_other_options#watermark_text_fields', array('fonts' => $this->object->_get_watermark_fonts($settings), 'font_family_label' => __('Font Family:', 'nggallery'), 'font_family' => $settings->wmFont, 'font_size_label' => __('Font Size:', 'nggallery'), 'font_size' => $settings->wmSize, 'font_color_label' => __('Font Color:', 'nggallery'), 'font_color' => strpos($settings->wmColor, '#') === 0 ? $settings->wmColor : "#{$settings->wmColor}", 'watermark_text_label' => __('Text:', 'nggallery'), 'watermark_text' => $settings->wmText, 'opacity_label' => __('Opacity:', 'nggallery'), 'opacity' => $settings->wmOpaque), TRUE); + } + public function _get_preview_image() + { + $registry = $this->object->get_registry(); + $storage = C_Gallery_Storage::get_instance(); + $image = C_Image_Mapper::get_instance()->find_first(); + $imagegen = C_Dynamic_Thumbnails_Manager::get_instance(); + $size = $imagegen->get_size_name(array('height' => 250, 'crop' => FALSE, 'watermark' => TRUE)); + $url = $image ? $storage->get_image_url($image, $size) : NULL; + $abspath = $image ? $storage->get_image_abspath($image, $size) : NULL; + return array('url' => $url, 'abspath' => $abspath); + } + public function render() + { + $settings = $this->get_model(); + $image = $this->object->_get_preview_image(); + return $this->render_partial('photocrati-nextgen_other_options#watermarks_tab', array('notice' => __('Please note: You can only activate the watermark under Manage Gallery. This action cannot be undone.', 'nggallery'), 'watermark_source_label' => __('How will you generate a watermark?', 'nggallery'), 'watermark_sources' => $this->object->_get_watermark_sources(), 'watermark_fields' => $this->object->_get_watermark_source_fields($settings), 'watermark_source' => $settings->wmType, 'position_label' => __('Position:', 'nggallery'), 'position' => $settings->wmPos, 'offset_label' => __('Offset:', 'nggallery'), 'offset_x' => $settings->wmXpos, 'offset_y' => $settings->wmYpos, 'hidden_label' => __('(Show Customization Options)', 'nggallery'), 'active_label' => __('(Hide Customization Options)', 'nggallery'), 'thumbnail_url' => $image['url'], 'preview_label' => __('Preview of saved settings:', 'nggallery'), 'refresh_label' => __('Refresh preview image', 'nggallery'), 'refresh_url' => $settings->ajax_url), TRUE); + } + public function save_action() + { + if ($settings = $this->object->param('watermark_options')) { + $this->object->get_model()->set($settings)->save(); + $image = $this->object->_get_preview_image(); + if (is_file($image['abspath'])) { + @unlink($image['abspath']); + } + } + } +} +class C_Settings_Model extends C_Component +{ + /** + * @var C_NextGen_Settings_Base + */ + public $wrapper = NULL; + static $_instances = array(); + static function get_instance($context = FALSE) + { + if (!isset(self::$_instances[$context])) { + $klass = get_class(); + self::$_instances[$context] = new $klass(); + } + return self::$_instances[$context]; + } + public function define($context = FALSE) + { + parent::define($context); + $this->add_mixin('Mixin_Validation'); + if ($this->has_context('global') or $this->has_context('site')) { + $this->wrapper = C_NextGen_Settings::get_instance(); + } else { + $this->wrapper = C_NextGen_Settings::get_instance(); + } + } + public function __get($key) + { + return $this->wrapper->get($key); + } + public function __set($key, $value) + { + $this->wrapper->set($key, $value); + return $this; + } + public function __isset($key) + { + return $this->wrapper->is_set($key); + } + public function __call($method, $args) + { + if (!$this->get_mixin_providing($method)) { + return call_user_func_array(array(&$this->wrapper, $method), $args); + } else { + return parent::__call($method, $args); + } + } +} \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/static/nextgen_settings_page.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/static/nextgen_settings_page.js index b16aa5f32d6d9d6d7cafdf2664fa7eec11f0b612..3d59559a01fbf5f819d6e5c184c1cdcb7e86d934 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/static/nextgen_settings_page.js +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/static/nextgen_settings_page.js @@ -4,35 +4,14 @@ jQuery(function($){ $('label.tooltip, span.tooltip').tooltip(); /**** LIGHTBOX EFFECT TAB ****/ - - $('tbody#lightbox_library_' + $('#lightbox_library').find(':selected').data('library-name') + '_basic').removeClass('hidden'); - - // Only show the currently selected library; hide the rest - $('#lightbox_library').change(function() { - var name = $(this).find(':selected').data('library-name'); - if ($('#lightbox_library_advanced_toggle').data('currently-hidden') == false) { - $('tbody.lightbox_library_advanced_settings').addClass('hidden'); - $('tbody#lightbox_library_' + name + '_advanced').removeClass('hidden'); - } - - $('tbody.lightbox_library_settings').addClass('hidden'); - $('tbody#lightbox_library_' + name + '_basic').removeClass('hidden'); - - }).change(); - - // "Show Advanced Settings" toggle; only display the currently selected library - $('#lightbox_library_advanced_toggle').bind('click', function(event) { - event.preventDefault(); - if ($(this).data('currently-hidden') == true) { - var name = $('#lightbox_library').find(':selected').data('library-name'); - $('tbody#lightbox_library_' + name + '_advanced').removeClass('hidden'); - $(this).data('currently-hidden', false); - - } else if($(this).data('currently-hidden') == false) { - $('tbody.lightbox_library_advanced_settings').addClass('hidden'); - $(this).data('currently-hidden', true); - } - }); + $('#lightbox_library').change(function(){ + var value = $(this).find(':selected').val(); + var id = 'lightbox_library_'+value; + $('.lightbox_library_settings').each(function(){ + if ($(this).attr('id') != id) $(this).fadeOut('fast'); + }); + $('#'+id).fadeIn(); + }).change(); /**** WATERMARK TAB ****/ diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/static/nextgen_settings_page.min.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/static/nextgen_settings_page.min.css new file mode 100644 index 0000000000000000000000000000000000000000..f1295d3248a29f58997024d96b906740a157af29 --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/static/nextgen_settings_page.min.css @@ -0,0 +1 @@ +.gallery_page_ngg_other_options table{width:80%;height:100%}.gallery_page_ngg_other_options table tr td:first-child{vertical-align:top}.gallery_page_ngg_other_options table.image_options{width:100%}.gallery_page_ngg_other_options table td.column1{width:240px}.gallery_page_ngg_other_options table td.column2{width:200px}.gallery_page_ngg_other_options textarea{height:100px}.gallery_page_ngg_other_options textarea,.gallery_page_ngg_other_options input[type=text]{width:100%}.gallery_page_ngg_other_options .image_options td{padding-bottom:8px}.column_wrapper{width:100%;padding-right:7px}#max_related_images{width:auto}#image_width,#image_height{width:40px}#thumbnail_dimensions_width,#thumbnail_dimensions_height{width:100px}.nextgen-thumb-size-custom br{display:none}.gallery_page_ngg_other_options select.thumbnail_dimensions{width:300px}.description_row{position:relative}.description_row .description{width:auto;position:absolute;margin-top:-10px;margin-bottom:5px;z-index:10}.full-width{width:100%}.right-aligned{text-align:right}label.align-to-top,td.align-to-top{vertical-align:top}#lightbox_library_advanced_settings td{text-align:right}#cssfile_contents{background:#f9f9f9;font-family:Consolas,Monaco,monospace;font-size:12px;width:100%;height:300px;outline:0}#writable_identicator{display:inline}.entity_errors{color:red}.entity_errors ul{margin-left:30px}.entity_errors ul li{list-style-type:disc}#nextgen_settings_preview_refresh{display:block} \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/static/nextgen_settings_page.min.js b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/static/nextgen_settings_page.min.js new file mode 100644 index 0000000000000000000000000000000000000000..07e72bfd8943531a1d7a0868377e447ef010dd8e --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/static/nextgen_settings_page.min.js @@ -0,0 +1 @@ +eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('1b(4($){$(\'1c.z\').z();$(\'19.s, 16.s\').s();$(\'#17\').8(4(){3 k=$(2).P(\':i\').6();3 j=\'18\'+k;$(\'.1d\').E(4(){9($(2).5(\'j\')!=j)$(2).D(\'1e\')});$(\'#\'+j).G()}).8();$(\'#u\').5(\'v\',\'I\'+$(\'#l\').6()+\'y\');$(\'#l\').8(4(){$(\'#\'+$(\'#u\').5(\'v\')).g(\'1l\',\'\').F(\'f\');9(!$(\'#\'+$(2).6()).1j(\'f\')){$(\'#\'+$(2).6()).J(\'f\')}$(\'#u\').5(\'v\',\'I\'+$(\'#l\').6()+\'y\').B()});$(\'#l\').8(4(){3 k=$(2).6();$(\'.13\').E(4(){9(k==0){$(2).D().F(\'f\')}o{$(2).G().J(\'f\')}})}).8();$(\'#X\').B(4(H){H.11();3 m=$(2).10(\'m:Y\');3 b=$(2);3 q=$(b).h();$(b).5(\'a\',\'a\').h(\'Z...\');$(\'r\').g(\'t\',\'1h\');$.1C({1n:m.5(\'1S\'),w:$(2).d(\'1I-w\'),d:m.1H()+"&N=1E",1F:\'1L\',1Q:4(d){3 K=b.1R();3 c=d.1P;n=c.1O(\'?\');9(n!=-1){c=c.1M(0,n)}K.5(\'c\',c+\'?\'+1K 1D().1s());$(b).L(\'a\').h(q);$(\'r\').g(\'t\',\'A\')},p:4(1t,1r,1q){$(b).L(\'a\').h(q);$(\'r\').g(\'t\',\'A\')}});1B R});$(\'1z[1y="1w[1x]"]\').C(\'1\',$(\'#M-1G\')).C(\'1\',$(\'#M-1A\')).1v(\'8\',4(){3 $2=$(2);9($2.6()==\'0\'){$(\'#x\').Q(\'a\',1u);$(\'#1p\').1o(\'1N\')}o{$(\'#x\').Q(\'a\',R)}});$(\'#1J\').8(4(){3 i=$(2).P(\':i\');3 d={N:\'12\',14:i.6()};$.U(S.w,d,4(7){9(T 7!==\'V\')7=W.1m(7);$(\'#x\').6(7.p?7.p:7.15);3 e=$(\'#1g\');9(7.1f)e.O(e.5(\'1i\')+\' \'+7.1k);o e.O(e.5(\'1a\'))})}).8()});',62,117,'||this|var|function|attr|val|res|change|if|disabled|self|src|data|status|hidden|css|html|selected|id|value|watermark_source|form|queryPos|else|error|orig_html|body|tooltip|cursor|watermark_customization|rel|url|cssfile_contents|_source|select2|default|click|nextgen_radio_toggle_tr|fadeOut|each|addClass|fadeIn|event|watermark_|removeClass|img|removeAttr|tr_photocrati|action|text|find|prop|false|photocrati_ajax|typeof|post|object|JSON|nextgen_settings_preview_refresh|first|Processing|parents|preventDefault|get_stylesheet_contents|watermark_field|cssfile|contents|span|lightbox_library|lightbox_library_|label|readonly_label|jQuery|select|lightbox_library_settings|fast|writable|writable_identicator|wait|writable_label|hasClass|writepath|display|parse|type|hide|advanced_stylesheet_form|code|err|getTime|xob|true|bind|style_settings|activateCSS|name|input|nextgen_styles_show_more|return|ajax|Date|get_watermark_preview_url|dataType|nextgen_styles_activated_stylesheet|serialize|refresh|activated_stylesheet|new|json|substring|slow|indexOf|thumbnail_url|success|prev|method'.split('|'),0,{})) diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/templates/image_options_tab.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/templates/image_options_tab.php index a47ba5522892db5eea7c20f20a97264483724b26..4fb89eca17372ec4c6987c19cc47e624161d2251 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/templates/image_options_tab.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/templates/image_options_tab.php @@ -5,7 +5,7 @@ <tr> <td class="column1"> <label for="gallery_path"> - <?php echo_h($gallery_path_label)?> + <?php esc_html_e($gallery_path_label)?> </label> </td> <td colspan="2"> @@ -17,7 +17,7 @@ value="<?php echo esc_attr($gallery_path) ?>" /> <p class="description"> - <?php echo_h($gallery_path_help)?> + <?php esc_html_e($gallery_path_help)?> </p> </td> </tr> @@ -27,7 +27,7 @@ <tr> <td> <label for="delete_images"> - <?php echo_h($delete_image_files_label) ?> + <?php esc_html_e($delete_image_files_label) ?> </label> </td> <td colspan="2"> @@ -45,14 +45,14 @@ value="0" <?php checked(0, $delete_image_files); ?>/> <label for="delete_images_no"><?php _e('No'); ?></label> - <?php echo_h($delete_image_files_help); ?> + <?php esc_html_e($delete_image_files_help); ?> </p> </td> </tr> <tr> <td> <label for="automatic_resize"> - <?php echo_h($automatic_resize_label)?> + <?php esc_html_e($automatic_resize_label)?> </label> </td> <td colspan="2"> @@ -70,18 +70,18 @@ value="0" <?php checked(0, $automatic_resize ? 1 : 0); ?>/> <label for="automatic_resize_no"><?php _e('No'); ?></label> - <?php echo_h($automatic_resize_help); ?> + <?php esc_html_e($automatic_resize_help); ?> </p> </td> </tr> <tr> <td> <label for="resize_images"> - <?php echo_h($resize_images_label) ?> + <?php esc_html_e($resize_images_label) ?> </label> </td> <td class="column2"> - <label for="image_width"><?php echo_h($resized_image_width_label)?></label> + <label for="image_width"><?php esc_html_e($resized_image_width_label)?></label> <input type="text" id="image_width" @@ -89,7 +89,7 @@ name="image_options[imgWidth]" value="<?php echo esc_attr($resized_image_width) ?>" /> - <label for="image_height"><?php echo_h($resized_image_height_label)?></label> + <label for="image_height"><?php esc_html_e($resized_image_height_label)?></label> <input type="text" id="image_height" @@ -100,12 +100,12 @@ </td> <td> <div class="column_wrapper"> - <label for="image_quality"><?php echo_h($resized_image_quality_label)?></label> + <label for="image_quality"><?php esc_html_e($resized_image_quality_label)?></label> <select id="image_quality" name="image_options[imgQuality]"> <?php for($i=100; $i>50; $i--): ?> <option <?php selected($i, $resized_image_quality) ?> - value="<?php echo_h($i)?>"><?php echo_h($i) ?>%</option> + value="<?php esc_attr_e($i)?>"><?php esc_html_e($i) ?>%</option> <?php endfor ?> </select> </div> @@ -114,18 +114,18 @@ <tr class="description_row"> <td class="column1"></td> <td colspan="2"> - <p class="description"><?php echo_h($resize_images_help) ?></p> + <p class="description"><?php esc_html_e($resize_images_help) ?></p> </td> </tr> <tr> <td> <label for="backup_images"> - <?php echo_h($backup_images_label)?> + <?php esc_html_e($backup_images_label)?> </label> </td> <td colspan="2"> <label for="backup_images_yes"> - <?php echo_h($backup_images_yes_label)?> + <?php esc_html_e($backup_images_yes_label)?> </label> <input id="backup_images_yes" @@ -136,7 +136,7 @@ /> <label for="backup_images_no"> - <?php echo_h($backup_images_no_label)?> + <?php esc_html_e($backup_images_no_label)?> </label> <input id="backup_images_no" @@ -150,26 +150,26 @@ <tr id="sorting_options_row"> <td class="column1"> <label for="image_sorting_order"> - <?php echo_h($sorting_order_label) ?> + <?php esc_html_e($sorting_order_label) ?> </label> </td> <td> <select name="image_options[galSort]" id="image_sorting_order"> <?php foreach ($sorting_order_options as $label => $value): ?> <option value="<?php echo esc_attr($value) ?>" <?php selected($value, $sorting_order)?>> - <?php echo_h($label) ?> + <?php esc_html_e($label) ?> </option> <?php endforeach ?> </select> </td> <td class="column3"> <label for="image_sorting_direction"> - <?php echo_h($sorting_direction_label) ?> + <?php esc_html_e($sorting_direction_label) ?> </label> <select name="image_options[galSortDir]" id="image_sorting_direction"> <?php foreach ($sorting_direction_options as $label => $value): ?> <option value="<?php echo esc_attr($value) ?>" <?php selected($value, $sorting_direction)?>> - <?php echo_h($label) ?> + <?php esc_html_e($label) ?> </option> <?php endforeach ?> </select> @@ -178,7 +178,7 @@ <tr> <td> <label for="show_related_images"> - <?php echo_h($show_related_images_label)?> + <?php esc_html_e($show_related_images_label)?> </label> </td> <td colspan="2"> @@ -196,7 +196,7 @@ value="0" <?php checked(0, $show_related_images); ?>/> <label for="show_related_images_no"><?php _e('No'); ?></label> - <?php echo_h($show_related_images_help); ?> + <?php esc_html_e($show_related_images_help); ?> </p> </td> </tr> @@ -209,14 +209,14 @@ rel="related_images_advanced_form" hidden_label="<?php echo esc_attr($related_images_hidden_label)?>" active_label="<?php echo esc_attr($related_images_active_label)?>" - ><?php echo_h($related_images_hidden_label) ?></a> + ><?php esc_html_e($related_images_hidden_label) ?></a> </td> </tr> <tbody id="related_images_advanced_form" class="hidden"> <tr> <td> <label for="match_related_images"> - <?php echo_h($match_related_images_label) ?> + <?php esc_html_e($match_related_images_label) ?> </label> </td> <td> @@ -226,14 +226,14 @@ value="<?php echo esc_attr($value)?>" <?php selected($value, $match_related_images)?> > - <?php echo_h($label) ?> + <?php esc_html_e($label) ?> </option> <?php endforeach ?> </select> </td> <td class="column3"> <label for="max_related_images"> - <?php echo_h($max_related_images_label)?> + <?php esc_html_e($max_related_images_label)?> </label> <input id="max_related_images" @@ -246,7 +246,7 @@ <tr> <td> <label for="related_images_heading"> - <?php echo_h($related_images_heading_label) ?> + <?php esc_html_e($related_images_heading_label) ?> </label> </td> <td> diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/templates/lightbox_library_tab.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/templates/lightbox_library_tab.php index a41b3e89f635fd962a98038e71a89087cb08223e..a49a13e8ebac8e67b32f8ac257ad764650ae9ba6 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/templates/lightbox_library_tab.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/templates/lightbox_library_tab.php @@ -2,55 +2,30 @@ <!-- Lightbox Library Name --> <tr> <td class="column1"> - <label for="lightbox_library"><?php echo_h($lightbox_library_label)?></label> + <label for="lightbox_library"><?php esc_html_e($lightbox_library_label)?></label> </td> <td> <select name="lightbox_library_id" id="lightbox_library"> <?php foreach ($libs as $lib) { ?> - <option value="<?php echo esc_attr($lib->$id_field)?>" + <option value="<?php echo esc_attr($lib->name)?>" <?php selected($lib->name, $selected, TRUE)?> data-library-name='<?php echo $lib->name; ?>'> <?php if (isset($lib->title) && $lib->title) { ?> - <?php echo_h($lib->title) ?> + <?php esc_html_e($lib->title) ?> <?php } else { ?> - <?php echo_h($lib->name) ?> + <?php esc_html_e($lib->name) ?> <?php } ?> </option> - <?php } ?> - </select> - </td> - </tr> + <?php } ?> + </select> + </td> + </tr> <?php foreach ($sub_fields as $name => $form) { ?> - <tbody class="lightbox_library_settings hidden" id="lightbox_library_<?php print $name; ?>"> - <?php echo $form; ?> - </tbody> - <?php } ?> - - <tr> - <td> - <a href="#" - id="lightbox_library_advanced_toggle" - data-hidden_label="<?php echo esc_attr(__('(Show Advanced Settings)', 'nggallery')); ?>" - data-active_label="<?php echo esc_attr(__('(Hide Advanced Settings)', 'nggallery')); ?>" - data-currently-hidden='true'> - <?php echo_h(__("(Show Advanced Settings)", 'nggallery')); ?> - </a> - </td> - <td> </td> - </tr> - - <?php foreach ($adv_fields as $name => $form) { ?> - <tbody class="lightbox_library_advanced_settings hidden" id="lightbox_library_<?php print $name; ?>_advanced"> + <tbody class="lightbox_library_settings hidden" id="lightbox_library_<?php esc_attr_e($name); ?>"> <?php echo $form; ?> </tbody> <?php } ?> - <tr> - <td> - </td> - <td> - </td> - </tr> <tr> <td class="column1"> <label for="lightbox_global"><?php esc_html_e('What must the lightbox be applied to?', 'nggallery')?></label> @@ -61,8 +36,8 @@ <option value="nextgen_and_wp_images" <?php selected('nextgen_and_wp_images', $lightbox_global, TRUE)?>><?php esc_html_e('Only apply to NextGEN and WordPress images', 'nggallery'); ?></option> <option value="all_images" <?php selected('all_images', $lightbox_global, TRUE)?>><?php esc_html_e('Try to apply to all images', 'nggallery'); ?></option> <option value="all_images_direct" <?php selected('all_images_direct', $lightbox_global, TRUE)?>><?php esc_html_e('Try to apply to all images that link to image files', 'nggallery'); ?></option> - </select> - </td> - </tr> - </tbody> + </select> + </td> + </tr> + </tbody> </table> diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/templates/misc_tab.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/templates/misc_tab.php index f36bfc0170944b8f07a9035b7d374f68a1b7167e..aaf38c894120ff5a564440a45312ce302d85bc23 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/templates/misc_tab.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/templates/misc_tab.php @@ -1,46 +1,46 @@ <table> - <tr> - <td class="column1"> - <label for="mediarss_activated"> - <?php echo_h($mediarss_activated_label)?> - </label> - </td> - <td> - <label for="mediarss_activated"> - <?php echo_h($mediarss_activated_yes) ?> - </label> - <input + <tr> + <td class="column1"> + <label for="mediarss_activated"> + <?php esc_html_e($mediarss_activated_label)?> + </label> + </td> + <td> + <label for="mediarss_activated"> + <?php esc_html_e($mediarss_activated_yes) ?> + </label> + <input id='mediarss_activated' - type="radio" - name="misc_settings[useMediaRSS]" - value="1" - <?php checked(TRUE, $mediarss_activated ? TRUE : FALSE)?> - /> - - <label for="mediarss_activated_no"> - <?php echo_h($mediarss_activated_no) ?> - </label> - <input + type="radio" + name="misc_settings[useMediaRSS]" + value="1" + <?php checked(TRUE, $mediarss_activated ? TRUE : FALSE)?> + /> + + <label for="mediarss_activated_no"> + <?php esc_html_e($mediarss_activated_no) ?> + </label> + <input id='mediarss_activated_no' - type="radio" - name="misc_settings[useMediaRSS]" - value="0" - <?php checked(FALSE, $mediarss_activated ? TRUE : FALSE)?> - /> - <p class="description"> - <?php echo_h($mediarss_activated_help)?> - </p> - </td> - </tr> + type="radio" + name="misc_settings[useMediaRSS]" + value="0" + <?php checked(FALSE, $mediarss_activated ? TRUE : FALSE)?> + /> + <p class="description"> + <?php esc_html_e($mediarss_activated_help)?> + </p> + </td> + </tr> <tr> <td class="column1"> <label for="galleries_in_feeds"> - <?php echo_h($galleries_in_feeds_label)?> + <?php esc_html_e($galleries_in_feeds_label)?> </label> </td> <td> <label for="galleries_in_feeds"> - <?php echo_h($galleries_in_feeds_yes) ?> + <?php esc_html_e($galleries_in_feeds_yes) ?> </label> <input id='galleries_in_feeds' @@ -51,7 +51,7 @@ /> <label for="galleries_in_feeds_no"> - <?php echo_h($galleries_in_feeds_no) ?> + <?php esc_html_e($galleries_in_feeds_no) ?> </label> <input id='galleries_in_feeds_no' @@ -61,7 +61,7 @@ <?php checked(FALSE, $galleries_in_feeds ? TRUE : FALSE)?> /> <p class="description"> - <?php echo_h($galleries_in_feeds_help)?> + <?php esc_html_e($galleries_in_feeds_help)?> </p> </td> </tr> diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/templates/styling_tab.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/templates/styling_tab.php index 3d30d2ee9b4a2f1c4ae61865a92cf0d582f29313..9f9ab52c7d1698e2811951e78af6e5b77897ddbf 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/templates/styling_tab.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/templates/styling_tab.php @@ -2,7 +2,7 @@ <tr> <td class="column1"> <label for="activateCSS"> - <?php echo_h($activateCSS_label); ?> + <?php esc_html_e($activateCSS_label); ?> </label> </td> <td colspan="2"> @@ -16,7 +16,7 @@ <tr id="tr_photocrati-nextgen_styles_activated_stylesheet" class="<?php echo ($activateCSS == 0 ? 'hidden' : ''); ?>"> <td class="column1"> <label for="activated_stylesheet"> - <?php echo_h($select_stylesheet_label) ?> + <?php esc_html_e($select_stylesheet_label) ?> </label> </td> <td> @@ -28,7 +28,7 @@ author="<?php echo esc_attr($p['author'])?>" version="<?php echo esc_attr($p['version'])?>" <?php selected($value, $activated_stylesheet)?> - ><?php echo_h($p['name'])?></option> + ><?php esc_html_e($p['name'])?></option> <?php endforeach ?> </select> <p class="description"> @@ -52,14 +52,14 @@ rel="advanced_stylesheet_form" hidden_label="<?php echo esc_attr($hidden_label)?>" active_label="<?php echo esc_attr($active_label)?>"> - <?php echo_h($hidden_label) ?> + <?php esc_html_e($hidden_label) ?> </a> </td> </tr> <tr class="hidden" id="advanced_stylesheet_form"> <td colspan="2"> <label for="cssfile_contents" class="align-to-top"> - <?php echo_h($cssfile_contents_label)?> + <?php esc_html_e($cssfile_contents_label)?> </label> <p class="description" diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/templates/thumbnail_options_tab.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/templates/thumbnail_options_tab.php index d0530104c8ed1b6edf9bb3599f1b22b00bbd2479..22736392fd692d43a8915e01b25173dce2ad44ed 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/templates/thumbnail_options_tab.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/templates/thumbnail_options_tab.php @@ -2,7 +2,7 @@ <tr> <td> <label for="thumbnail_dimensions_width"> - <?php echo_h($thumbnail_dimensions_label) ?> + <?php esc_html_e($thumbnail_dimensions_label) ?> </label> </td> <td colspan="2"> @@ -19,13 +19,13 @@ 'thumbnails-template.php' ))); ?> - <p class="description"><?php echo_h($thumbnail_dimensions_help)?></p> + <p class="description"><?php esc_html_e($thumbnail_dimensions_help)?></p> </td> </tr> <tr> <td> <label for="thumbnail_crop"> - <?php echo_h($thumbnail_crop_label) ?> + <?php esc_html_e($thumbnail_crop_label) ?> </label> </td> <td colspan="2"> @@ -42,7 +42,7 @@ value="0" <?php checked(0, $thumbnail_crop); ?>/> <label for="thumbnail_crop_no"><?php _e('No'); ?></label> - <p class="description"><?php echo_h($thumbnail_crop_help); ?></p> + <p class="description"><?php esc_html_e($thumbnail_crop_help); ?></p> </td> </tr> <?php /* @@ -67,7 +67,7 @@ <tr> <td> <label for="size_list"> - <?php echo_h($size_list_label) ?> + <?php esc_html_e($size_list_label) ?> </label> </td> <td colspan="2"> @@ -82,7 +82,7 @@ ?> <option <?php selected($size, $size) ?> - value="<?php echo_h($size)?>"><?php echo_h($size) ?></option> + value="<?php esc_attr_e($size)?>"><?php esc_html_e($size) ?></option> <?php } ?> @@ -94,7 +94,7 @@ echo "<i>No default sizes present.</i>"; } ?> - <p class="description"><?php echo_h($size_list_help)?></p> + <p class="description"><?php esc_html_e($size_list_help)?></p> </td> </tr> </table> diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/templates/watermark_image_fields.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/templates/watermark_image_fields.php index 1474be72f93ea3c3e27309292a69d01221479e11..3396e298976d893401ae3648fcaa4979eb1a2439 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/templates/watermark_image_fields.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/templates/watermark_image_fields.php @@ -3,7 +3,7 @@ <label for="watermark_image_url" title="<?php echo esc_attr($watermark_image_text); ?>" class="tooltip"> - <?php echo_h($image_url_label)?> + <?php esc_html_e($image_url_label)?> </label> </td> <td> diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/templates/watermark_text_fields.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/templates/watermark_text_fields.php index cd7a8d8559906aae85dcc222ef96a595bfec278d..20601a57366ca184bed3f4f5b97bffa79534c5c6 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/templates/watermark_text_fields.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/templates/watermark_text_fields.php @@ -1,25 +1,25 @@ <tr> <td class="column1 align-to-top"> <label for="watermark_text"> - <?php echo_h($watermark_text_label)?> + <?php esc_html_e($watermark_text_label)?> </label> </td> <td> - <textarea name="watermark_options[wmText]" id="watermark_text"><?php echo_h($watermark_text)?></textarea> + <textarea name="watermark_options[wmText]" id="watermark_text"><?php esc_html_e($watermark_text)?></textarea> </td> </tr> <tr> <td> <label for="watermark_opacity"> - <?php echo_h($opacity_label)?> + <?php esc_html_e($opacity_label)?> </label> </td> <td> <select name="watermark_options[wmOpaque]" id="watermark_opacity"> <?php for ($i=200; $i>1; $i--): ?> <option <?php selected($i, $opacity)?>> - <?php echo_h($i)?> + <?php esc_html_e($i)?> </option> <?php endfor ?> </select>% @@ -29,14 +29,14 @@ <tr> <td class="column1"> <label for="font_family"> - <?php echo_h($font_family_label); ?> + <?php esc_html_e($font_family_label); ?> </label> </td> <td> <select id="font_family" name="watermark_options[wmFont]"> <?php foreach ($fonts as $font): ?> <option <?php selected($font, $font_family); ?>> - <?php echo_h($font); ?> + <?php esc_html_e($font); ?> </option> <?php endforeach ?> </select> @@ -46,13 +46,13 @@ <tr> <td> <label for="watermark_font_size"> - <?php echo_h($font_size_label)?> + <?php esc_html_e($font_size_label)?> </label> </td> <td> <select name="watermark_options[wmSize]" id="watermark_font_size"> <?php for($i=0; $i<200; $i++) { ?> - <option <?php selected($i, (int)$font_size) ?>><?php echo_h($i)?></option> + <option <?php selected($i, (int)$font_size) ?>><?php esc_html_e($i)?></option> <?php } ?> </select>px </td> @@ -61,7 +61,7 @@ <tr> <td class="align-to-top"> <label for="font_color"> - <?php echo_h($font_color_label)?> + <?php esc_html_e($font_color_label)?> </label> </td> <td> diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/templates/watermarks_tab.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/templates/watermarks_tab.php index 78c9817688dd27e39b04f07e00d3df39dd80acc8..26b05ebc39ecf154f824871fa2d88b82a8f49879 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/templates/watermarks_tab.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_other_options/templates/watermarks_tab.php @@ -2,7 +2,7 @@ <tr> <td class="column1"> <label for="watermark_source"> - <?php echo_h($watermark_source_label)?> + <?php esc_html_e($watermark_source_label)?> </label> </td> <td> @@ -12,7 +12,7 @@ <option value="<?php echo esc_attr($value)?>" <?php selected($value, $watermark_source) ?> - ><?php echo_h($label)?></option> + ><?php esc_html_e($label)?></option> <?php endforeach ?> </select> </div> @@ -87,7 +87,7 @@ hidden_label="<?php echo esc_attr($hidden_label)?>" active_label="<?php echo esc_attr($active_label)?>" > - <?php echo_h($hidden_label)?> + <?php esc_html_e($hidden_label)?> </a> </td> </tr> diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_pagination/package.module.nextgen_pagination.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_pagination/package.module.nextgen_pagination.php new file mode 100644 index 0000000000000000000000000000000000000000..fec3e048f592132b4cc198c76851d4ad8b9e8cd8 --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_pagination/package.module.nextgen_pagination.php @@ -0,0 +1,71 @@ +<?php +/** + * Contains function(s) to generate a basic pagination widget + */ +class Mixin_NextGen_Basic_Pagination extends Mixin +{ + /** + * Returns a formatted HTML string of a pagination widget + * + * @param mixed $page + * @param int $totalElement + * @param int $maxElement + * @return array Of data holding prev & next url locations and a formatted HTML string + */ + public function create_pagination($page, $totalElement, $maxElement = 0, $current_url = NULL) + { + $prev_symbol = apply_filters('ngg_prev_symbol', '◄'); + $next_symbol = apply_filters('ngg_next_symbol', '►'); + if (empty($current_url)) { + $current_url = $this->object->get_routed_url(TRUE); + if (is_archive()) { + $id = get_the_ID(); + if ($id == null) { + global $post; + $id = $post ? $post->ID : null; + } + if ($id != null && in_the_loop()) { + $current_url = get_permalink($id); + } + } + } + $return = array('prev' => '', 'next' => '', 'output' => ''); + if ($maxElement <= 0) { + $return['output'] = '<div class=\'ngg-clear\'></div>'; + return $return; + } + $total = $totalElement; + // create navigation + if ($total > $maxElement) { + $r = ''; + if (1 < $page) { + $newpage = 1 == $page - 1 ? 1 : $page - 1; + $return['prev'] = $this->object->set_param_for($current_url, 'nggpage', $newpage); + $r .= '<a class="prev" data-pageid="' . $newpage . '" id="ngg-prev-' . $newpage . '" href="' . $return['prev'] . '">' . $prev_symbol . '</a>'; + } + $total_pages = ceil($total / $maxElement); + if ($total_pages > 1) { + for ($page_num = 1; $page_num <= $total_pages; $page_num++) { + if ($page == $page_num) { + $r .= '<span class="current">' . $page_num . '</span>'; + } else { + if ($page_num < 3 || $page_num >= $page - 3 && $page_num <= $page + 3 || $page_num > $total_pages - 3) { + $newpage = 1 == $page_num ? 1 : $page_num; + $link = $this->object->set_param_for($current_url, 'nggpage', $newpage); + $r .= '<a class="page-numbers" data-pageid="' . $newpage . '" href="' . $link . '">' . $page_num . '</a>'; + } + } + } + } + if ($page * $maxElement < $total || -1 == $total) { + $newpage = $page + 1; + $return['next'] = $this->object->set_param_for($current_url, 'nggpage', $newpage); + $r .= '<a class="next" data-pageid="' . $newpage . '" id="ngg-next-' . $newpage . '" href="' . $return['next'] . '">' . $next_symbol . '</a>'; + } + $return['output'] = "<div class='ngg-navigation'>{$r}</div>"; + } else { + $return['output'] = '<div class=\'ngg-clear\'></div>'; + } + return $return; + } +} \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_pagination/static/style.min.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_pagination/static/style.min.css new file mode 100644 index 0000000000000000000000000000000000000000..1f90793f311d2ac9ca917bc551a20fc32b14af57 --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_pagination/static/style.min.css @@ -0,0 +1 @@ +.ngg-navigation{font-size:.9em !important;clear:both !important;display:block !important;padding-top:15px;padding-bottom:3px;text-align:center}.ngg-navigation span{font-weight:bold;margin:0 6px}.ngg-navigation a.page-numbers,.ngg-navigation a.next,.ngg-navigation a.prev,.ngg-navigation span.page-numbers,.ngg-navigation span.next,.ngg-navigation span.prev{border:1px solid #ddd;margin-right:3px;padding:3px 8px;text-decoration:none}.ngg-navigation a.page-numbers:hover,.ngg-navigation a.next:hover,.ngg-navigation a.prev:hover,.ngg-navigation span.page-numbers:hover,.ngg-navigation span.next:hover,.ngg-navigation span.prev:hover{background-color:#06c;color:#fff !important;text-decoration:none !important}.ngg-clear{clear:both} \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_pro_upgrade/module.nextgen_pro_upgrade.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_pro_upgrade/module.nextgen_pro_upgrade.php index edc3e8242ed489afe53ed2470d0128a2dba76ad8..4b9d14a3b85d5bd170848dcfc0da909fcbe66d4c 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_pro_upgrade/module.nextgen_pro_upgrade.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_pro_upgrade/module.nextgen_pro_upgrade.php @@ -14,7 +14,7 @@ class M_NextGen_Pro_Upgrade extends C_Base_Module 'photocrati-nextgen_pro_upgrade', 'NextGEN Pro Page', 'NextGEN Gallery Pro Upgrade Page', - '0.3', + '0.4', 'http://www.nextgen-gallery.com', 'Photocrati Media', 'http://www.photocrati.com' @@ -23,14 +23,20 @@ class M_NextGen_Pro_Upgrade extends C_Base_Module function _register_adapters() { - $this->get_registry()->add_adapter('I_Page_Manager', 'A_NextGen_Pro_Plus_Upgrade_Page'); + if (is_admin()) + { + $this->get_registry()->add_adapter('I_Page_Manager', 'A_NextGen_Pro_Upgrade_Page'); + $this->get_registry()->add_adapter('I_Page_Manager', 'A_NextGen_Pro_Plus_Upgrade_Page'); + $this->get_registry()->add_adapter('I_NextGen_Admin_Page', 'A_NextGen_Pro_Upgrade_Controller', 'ngg_pro_upgrade'); + } } function get_type_list() { return array( 'A_NextGen_Pro_Upgrade_Controller' => 'adapter.nextgen_pro_upgrade_controller.php', - 'A_NextGen_Pro_Plus_Upgrade_Page' => 'adapter.nextgen_pro_plus_upgrade_page.php' + 'A_NextGen_Pro_Plus_Upgrade_Page' => 'adapter.nextgen_pro_plus_upgrade_page.php', + 'A_NextGen_Pro_Upgrade_Page' => 'adapter.nextgen_pro_upgrade_page.php' ); } } diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_pro_upgrade/package.module.nextgen_pro_upgrade.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_pro_upgrade/package.module.nextgen_pro_upgrade.php new file mode 100644 index 0000000000000000000000000000000000000000..47ad40de6869b71387377e35653b5a7421df2e50 --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_pro_upgrade/package.module.nextgen_pro_upgrade.php @@ -0,0 +1,83 @@ +<?php +class A_NextGen_Pro_Plus_Upgrade_Page extends Mixin +{ + public function setup() + { + // Using include() to retrieve the is_plugin_active() is apparently The WordPress Way(tm).. + include_once ABSPATH . 'wp-admin/includes/plugin.php'; + // We shouldn't show the upgrade page if they already have the plugin and it's active + $found = false; + if (defined('NEXTGEN_GALLERY_PRO_PLUGIN_BASENAME')) { + $found = 'NEXTGEN_GALLERY_PRO_PLUGIN_BASENAME'; + } + if (defined('NGG_PRO_PLUGIN_BASENAME')) { + $found = 'NGG_PRO_PLUGIN_BASENAME'; + } + if (!($found && is_plugin_active(constant($found)))) { + $this->object->add('ngg_pro_upgrade', array('adapter' => 'A_NextGen_Pro_Upgrade_Controller', 'parent' => NGGFOLDER)); + } + return $this->call_parent('setup'); + } +} +class A_NextGen_Pro_Upgrade_Controller extends Mixin +{ + public function enqueue_backend_resources() + { + $this->call_parent('enqueue_backend_resources'); + wp_enqueue_style('nextgen_pro_upgrade_page', $this->get_static_url('photocrati-nextgen_pro_upgrade#style.css')); + } + public function get_page_title() + { + return 'Upgrade to Pro'; + } + public function get_required_permission() + { + return 'NextGEN Change options'; + } + public function index_action() + { + $this->object->enqueue_backend_resources(); + $key = C_Photocrati_Transient_Manager::create_key('nextgen_pro_upgrade_page', 'html'); + if ($html = C_Photocrati_Transient_Manager::fetch($key, FALSE)) { + echo $html; + } else { + // Get page content + $template = 'photocrati-nextgen_pro_upgrade#plus'; + if (defined('NGG_PLUS_PLUGIN_BASENAME')) { + $template = 'photocrati-nextgen_pro_upgrade#pro'; + } + $description = 'Extend NextGEN Gallery with 8 new pro gallery displays, a full screen responsive pro lightbox, commenting / social sharing / deep linking for individual images, ecommerce, digital downloads, and pro email support.'; + $headline = 'Upgrade to NextGEN Plus or NextGEN Pro'; + if (defined('NGG_PLUS_PLUGIN_BASENAME')) { + $description = 'NextGEN Pro now offers ecommerce! Extend NextGEN Gallery and NextGEN Plus with a complete solution for selling prints and digital downloads, including unlimited pricelists, PayPal and Stripe integration, and more.'; + $headline = 'Upgrade to NextGEN Pro with Ecommerce'; + } + $params = array('description' => $description, 'headline' => $headline); + $html = $this->render_view($template, $params, TRUE); + // Cache it + C_Photocrati_Transient_Manager::update($key, $html); + // Render it + echo $html; + } + } +} +class A_NextGen_Pro_Upgrade_Page extends Mixin +{ + public function setup() + { + // Using include() to retrieve the is_plugin_active() is apparently The WordPress Way(tm).. + include_once ABSPATH . 'wp-admin/includes/plugin.php'; + // We shouldn't show the upgrade page if they already have the plugin and it's active + $found = false; + if (defined('NEXTGEN_GALLERY_PRO_PLUGIN_BASENAME')) { + $found = 'NEXTGEN_GALLERY_PRO_PLUGIN_BASENAME'; + } + if (defined('NGG_PRO_PLUGIN_BASENAME')) { + $found = 'NGG_PRO_PLUGIN_BASENAME'; + } + if (!($found && is_plugin_active(constant($found)))) { + $this->object->add('ngg_pro_upgrade', array('adapter' => 'A_NextGen_Pro_Upgrade_Controller', 'parent' => NGGFOLDER)); + } + return $this->call_parent('setup'); + } +} \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_pro_upgrade/static/style.min.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_pro_upgrade/static/style.min.css new file mode 100644 index 0000000000000000000000000000000000000000..90ddedeee53dbad94981c61b28ec714eece4f326 --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_pro_upgrade/static/style.min.css @@ -0,0 +1 @@ +#nextgen_pro_upgrade_page{width:100%;text-align:center}#nextgen_pro_upgrade_page h1{font-size:2.5em;line-height:1.01em;margin-bottom:40px;text-align:center;padding:20px 0 0 0}#nextgen_pro_upgrade_page hr{width:25%}#nextgen_pro_upgrade_page h2{color:#afafaf;line-height:1.2em;width:65%;margin:0 auto;margin-top:2em;margin-bottom:2em}#nextgen_pro_upgrade_page a{font-size:1.2em;height:2.8em;line-height:1.6em;padding:.5em 1em .5em 1em;min-width:300px}#nextgen_pro_upgrade_first_link{margin-right:.5em}@media only screen and (max-width:655px){#nextgen_pro_upgrade_first_link{margin-right:0;margin-bottom:1em}} \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_settings/module.nextgen_settings.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_settings/module.nextgen_settings.php index a6256b1a8e2d4530fe611b163a4026dca20f92c9..066ff88705483a848e5068e020d7de3c9ab3d03d 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_settings/module.nextgen_settings.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_settings/module.nextgen_settings.php @@ -23,7 +23,6 @@ class M_NextGen_Settings extends C_Base_Module 'http://www.photocrati.com' ); - include_once('class.nextgen_settings_installer.php'); C_Photocrati_Installer::add_handler($this->module_id, 'C_NextGen_Settings_Installer'); } @@ -35,4 +34,159 @@ class M_NextGen_Settings extends C_Base_Module } } +class C_NextGen_Settings_Installer +{ + private $_global_settings = array(); + private $_local_settings = array(); + + function __construct() + { + $this->blog_settings = C_NextGen_Settings::get_instance(); + $this->site_settings = C_NextGen_Global_Settings::get_instance(); + + $this->_global_settings = array( + 'gallerypath' => implode(DIRECTORY_SEPARATOR, array('wp-content', 'uploads', 'sites', '%BLOG_ID%', 'nggallery')).DIRECTORY_SEPARATOR, + 'wpmuCSSfile' => 'nggallery.css', + 'wpmuStyle' => FALSE, + 'wpmuRoles' => FALSE, + 'wpmuImportFolder' => FALSE, + 'wpmuZipUpload' => FALSE, + 'wpmuQuotaCheck' => FALSE, + 'datamapper_driver' => 'custom_table_datamapper', + 'gallerystorage_driver' => 'ngglegacy_gallery_storage', + 'maximum_entity_count' => 500, + 'router_param_slug' => 'nggallery' + ); + + $this->_local_settings = array( + 'gallerypath' => 'wp-content'.DIRECTORY_SEPARATOR.'gallery'.DIRECTORY_SEPARATOR, + 'deleteImg' => TRUE, // delete Images + 'swfUpload' => TRUE, // activate the batch upload + 'usePermalinks' => FALSE, // use permalinks for parameters + 'permalinkSlug' => 'nggallery', // the default slug for permalinks + 'graphicLibrary' => 'gd', // default graphic library + 'imageMagickDir' => '/usr/local/bin/', // default path to ImageMagick + 'useMediaRSS' => FALSE, // activate the global Media RSS file + 'galleries_in_feeds' => FALSE, // enables rendered gallery output in rss/atom feeds + + // Tags / categories + 'activateTags' => 0, // append related images + 'appendType' => 'tags', // look for category or tags + 'maxImages' => 7, // number of images toshow + 'relatedHeading' => '<h3>' . __('Related Images', 'nggallery') . ':</h3>', // subheading for related images + + // Thumbnail Settings + 'thumbwidth' => 240, // Thumb Width + 'thumbheight' => 160, // Thumb height + 'thumbfix' => True, // Fix the dimension + 'thumbquality' => 100, // Thumb Quality + + // Image Settings + 'imgWidth' => 800, // Image Width + 'imgHeight' => 600, // Image height + 'imgQuality' => 100, // Image Quality + 'imgBackup' => True, // Create a backup + 'imgAutoResize' => False, // Resize after upload + + // Gallery Settings + 'galImages' => '20', // Number of images per page + 'galPagedGalleries' => 0, // Number of galleries per page (in a album) + 'galColumns' => 0, // Number of columns for the gallery + 'galShowSlide' => True, // Show slideshow + 'galTextSlide' => __('[Show slideshow]', 'nggallery'), // Text for slideshow + 'galTextGallery' => __('[Show thumbnails]', 'nggallery'), // Text for gallery + 'galShowOrder' => 'gallery', // Show order + 'galSort' => 'sortorder', // Sort order + 'galSortDir' => 'ASC', // Sort direction + 'galNoPages' => True, // use no subpages for gallery + 'galImgBrowser' => 0, // Show ImageBrowser => instead effect + 'galHiddenImg' => 0, // For paged galleries we can hide image + 'galAjaxNav' => 0, // AJAX Navigation for Shutter effect + + // Thumbnail Effect + 'thumbEffect' => 'fancybox', // select effect + 'thumbCode' => 'class="ngg-fancybox" rel="%GALLERY_NAME%"', + 'thumbEffectContext' => 'nextgen_images', // select effect + + // Watermark settings + 'wmPos' => 'botRight', // Postion + 'wmXpos' => 5, // X Pos + 'wmYpos' => 5, // Y Pos + 'wmType' => 0, // Type : 'image' / 'text' + 'wmPath' => '', // Path to image + 'wmFont' => 'arial.ttf', // Font type + 'wmSize' => 10, // Font Size + 'wmText' => get_option('blogname'), // Text + 'wmColor' => '000000', // Font Color + 'wmOpaque' => '100', // Font Opaque + + // Image Rotator settings + 'slideFX' => 'fade', + 'irWidth' => 600, + 'irHeight' => 400, + 'irRotatetime' => 10, + + // CSS Style + 'activateCSS' => 1, // activate the CSS file + 'CSSfile' => 'nggallery.css', // set default css filename + ); + } + + function install_global_settings($reset=FALSE) + { + foreach ($this->_global_settings as $key => $value) { + if ($reset) $this->site_settings->set($key, NULL); + $this->site_settings->set_default_value($key, $value); + } + } + + function install_local_settings($reset=FALSE) + { + foreach ($this->_local_settings as $key => $value) { + if ($reset) $this->blog_settings->set($key, NULL); + $this->blog_settings->set_default_value($key, $value); + } + + if (is_multisite()) + { + // If this is already network activated we just need to use the existing setting + // Note: attempting to use C_NextGen_Global_Settings here may result in an infinite loop, + // so get_site_option() is used to check + if ($options = get_site_option('ngg_options')) + $gallerypath = $options['gallerypath']; + else + $gallerypath = $this->_global_settings['gallerypath']; + + $gallerypath = $this->gallerypath_replace($gallerypath); + + // a gallerypath setting has already been set, so we explicitly set a default AND set a new value + $this->blog_settings->set_default_value('gallerypath', $gallerypath); + $this->blog_settings->set('gallerypath', $gallerypath); + } + } + + function install($reset=FALSE) + { + $this->install_global_settings($reset); + $this->install_local_settings($reset); + } + + function get_global_defaults() + { + return $this->_global_settings; + } + + function get_local_defaults() + { + return $this->_local_settings; + } + + function gallerypath_replace($gallerypath) + { + $gallerypath = str_replace('%BLOG_NAME%', get_bloginfo('name'), $gallerypath); + $gallerypath = str_replace('%BLOG_ID%', get_current_blog_id(), $gallerypath); + return $gallerypath; + } +} + new M_NextGen_Settings(); diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_xmlrpc/module.nextgen_xmlrpc.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_xmlrpc/module.nextgen_xmlrpc.php index 5b6cee7afc630ab27efa26c1efd15566fd0076bf..817a39b164c7f9c986e84b9700b67314165109bb 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_xmlrpc/module.nextgen_xmlrpc.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_xmlrpc/module.nextgen_xmlrpc.php @@ -28,12 +28,15 @@ class M_NextGen_XmlRpc extends C_Base_Module function add_methods($methods) { $methods['ngg.installed'] = array(&$this, 'get_version'); + $methods['ngg.setPostThumbnail'] = array(&$this, 'set_post_thumbnail'); + // Image methods $methods['ngg.getImage'] = array(&$this, 'get_image'); $methods['ngg.getImages'] = array(&$this, 'get_images'); $methods['ngg.uploadImage'] = array(&$this, 'upload_image'); $methods['ngg.editImage'] = array(&$this, 'edit_image'); $methods['ngg.deleteImage'] = array(&$this, 'delete_image'); + // Gallery methods $methods['ngg.getGallery'] = array(&$this, 'get_gallery'); $methods['ngg.getGalleries'] = array(&$this, 'get_galleries'); @@ -120,7 +123,7 @@ class M_NextGen_XmlRpc extends C_Base_Module $gallery->gid = (string) $gallery->gid; // Set other gallery properties - $image_counter = array_pop($image_mapper->select('DISTINCT COUNT(*) as counter')->where(array("galleryid = %d", $gallery->gid))->run_query(FALSE, TRUE)); + $image_counter = array_pop($image_mapper->select('DISTINCT COUNT(*) as counter')->where(array("galleryid = %d", $gallery->gid))->run_query(FALSE, FALSE, TRUE)); $gallery->counter = $image_counter->counter; $gallery->abspath = $storage->get_gallery_abspath($gallery); } @@ -254,7 +257,7 @@ class M_NextGen_XmlRpc extends C_Base_Module // Upload the image $storage = C_Gallery_Storage::get_instance(); - $image = $storage->upload_base64_image($gallery, $data['bits'], $data['name'], $data['image_id'], $data['override']); + $image = $storage->upload_base64_image($gallery, $data['bits'], $data['name'], $data['image_id'], $data['override']); if ($image) { $storage = C_Gallery_Storage::get_instance(); $image->imageURL = $storage->get_image_url($image); @@ -630,6 +633,32 @@ class M_NextGen_XmlRpc extends C_Base_Module return $retval; } + + /** + * Sets the post thumbnail for a post to a NextGEN Gallery image + * @param $args (blog_id, username, password, post_id, image_id) + * + * @return IXR_Error|int attachment id + */ + function set_post_thumbnail($args) + { + $retval = new IXR_Error(403, 'Invalid username or password'); + $blog_id = intval($args[0]); + $username = strval($args[1]); + $password = strval($args[2]); + $post_ID = intval($args[3]); + $image_id = intval($args[4]); + + // Authenticate the user + if ($this->_login($username, $password, $blog_id)) { + if ( current_user_can( 'edit_post', $post_ID )) { + $retval = C_Gallery_Storage::get_instance()->set_post_thumbnail($post_ID, $image_id); + } + else $retval = new IXR_Error(403, "Sorry but you need permission to do this"); + } + + return $retval; + } } new M_NextGen_XmlRpc; \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/admin.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/admin.php index bde3b8912ce50ed67005fdcc390a034e1c19ce81..f7bd8cbf1dfc0abb469833f2f56a56865d48e752 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/admin.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/admin.php @@ -196,7 +196,6 @@ class nggAdminPanel{ // show the network page function show_network_settings() { - include_once ( dirname (__FILE__) . '/style.php' ); include_once ( dirname (__FILE__) . '/wpmu.php' ); nggallery_wpmu_setup(); } @@ -232,18 +231,9 @@ class nggAdminPanel{ $ngg->manage_album = new nggManageAlbum (); $ngg->manage_album->controller(); break; - case "nggallery-options" : - include_once ( dirname (__FILE__) . '/settings.php' ); // nggallery_admin_options - $ngg->option_page = new nggOptions (); - $ngg->option_page->controller(); - break; case "nggallery-tags" : include_once ( dirname (__FILE__) . '/tags.php' ); // nggallery_admin_tags break; - case "nggallery-style" : - include_once ( dirname (__FILE__) . '/style.php' ); // nggallery_admin_style - nggallery_admin_style(); - break; case "nggallery-roles" : include_once ( dirname (__FILE__) . '/roles.php' ); // nggallery_admin_roles nggallery_admin_roles(); @@ -272,24 +262,8 @@ class nggAdminPanel{ if( !isset($_GET['page']) ) return; - // If we're on a NextGen Page -// if (preg_match("/ngg|nextgen-gallery/", $_GET['page'])) { -// wp_register_script('ngg_social_media', path_join( -// NGGALLERY_URLPATH, -// 'admin/js/ngg_social_media.js' -// ), array('jquery')); -// -// wp_register_style('ngg_social_media', path_join( -// NGGALLERY_URLPATH, -// 'admin/css/ngg_social_media.css' -// )); -// -// wp_enqueue_style('ngg_social_media'); -// wp_enqueue_script('ngg_social_media'); -// } - // used to retrieve the uri of some module resources - $router = C_Component_Registry::get_instance()->get_utility('I_Router'); + $router = C_Router::get_instance(); wp_register_script('ngg-ajax', NGGALLERY_URLPATH . 'admin/js/ngg.ajax.js', array('jquery'), '1.4.1'); wp_localize_script('ngg-ajax', 'nggAjaxSetup', array( @@ -302,31 +276,7 @@ class nggAdminPanel{ 'error' => __('Unexpected Error', 'nggallery'), 'failure' => __('A failure occurred', 'nggallery') ) ); - wp_register_script( 'ngg-plupload-handler', NGGALLERY_URLPATH .'admin/js/plupload.handler.js', array('plupload-all'), '0.0.1' ); - wp_localize_script( 'ngg-plupload-handler', 'pluploadL10n', array( - 'queue_limit_exceeded' => __('You have attempted to queue too many files.'), - 'file_exceeds_size_limit' => __('This file exceeds the maximum upload size for this site.'), - 'zero_byte_file' => __('This file is empty. Please try another.'), - 'invalid_filetype' => __('This file type is not allowed. Please try another.'), - 'not_an_image' => __('This file is not an image. Please try another.'), - 'image_memory_exceeded' => __('Memory exceeded. Please try another smaller file.'), - 'image_dimensions_exceeded' => __('This is larger than the maximum size. Please try another.'), - 'default_error' => __('An error occurred in the upload. Please try again later.'), - 'missing_upload_url' => __('There was a configuration error. Please contact the server administrator.'), - 'upload_limit_exceeded' => __('You may only upload 1 file.'), - 'http_error' => __('HTTP error.'), - 'upload_failed' => __('Upload failed.'), - 'io_error' => __('IO error.'), - 'security_error' => __('Security error.'), - 'file_cancelled' => __('File canceled.'), - 'upload_stopped' => __('Upload stopped.'), - 'dismiss' => __('Dismiss'), - 'crunching' => __('Crunching…'), - 'deleted' => __('moved to the trash.'), - 'error_uploading' => __('“%s” has failed to upload due to an error') - ) ); wp_register_script('ngg-progressbar', NGGALLERY_URLPATH .'admin/js/ngg.progressbar.js', array('jquery'), '2.0.1'); - wp_register_script('jquery-ui-autocomplete', NGGALLERY_URLPATH .'admin/js/jquery.ui.autocomplete.min.js', array('jquery-ui-core', 'jquery-ui-widget'), '1.8.15'); // Enqueue the new Gritter-based progress bars wp_enqueue_style('ngg_progressbar'); @@ -355,29 +305,11 @@ class nggAdminPanel{ wp_enqueue_style('nextgen_admin_page', $router->get_static_url('photocrati-nextgen_admin#nextgen_admin_page.css')); break; case "nggallery-manage-album" : - wp_enqueue_script( 'jquery-ui-autocomplete' ); wp_enqueue_script( 'jquery-ui-dialog' ); wp_enqueue_script( 'jquery-ui-sortable' ); - wp_enqueue_script( 'ngg-autocomplete', NGGALLERY_URLPATH .'admin/js/ngg.autocomplete.js', array('jquery-ui-autocomplete'), '1.0.1'); - break; - case "nggallery-options" : - wp_enqueue_script( 'jquery-ui-tabs' ); - //wp_enqueue_script( 'ngg-colorpicker', NGGALLERY_URLPATH .'admin/js/colorpicker/js/colorpicker.js', array('jquery'), '1.0'); + wp_enqueue_script( 'select2' ); + wp_enqueue_style('select2'); break; - case "nggallery-add-gallery" : - wp_enqueue_script( 'jquery-ui-accordion' ); - wp_enqueue_script( 'multifile', NGGALLERY_URLPATH .'admin/js/jquery.MultiFile.js', array('jquery'), '1.4.4' ); - wp_enqueue_script( 'ngg-plupload-handler' ); - wp_enqueue_script( 'ngg-ajax' ); - wp_enqueue_script( 'ngg-progressbar' ); - wp_enqueue_script( 'jquery-ui-dialog' ); - wp_enqueue_script( 'jqueryFileTree', NGGALLERY_URLPATH .'admin/js/jqueryFileTree/jqueryFileTree.js', array('jquery'), '1.0.1' ); - break; - case "nggallery-style" : - wp_enqueue_script( 'codepress' ); - wp_enqueue_script( 'ngg-colorpicker', NGGALLERY_URLPATH .'admin/js/colorpicker/js/colorpicker.js', array('jquery'), '1.0'); - break; - } } @@ -406,7 +338,7 @@ class nggAdminPanel{ return; // used to retrieve the uri of some module resources - $router = C_Component_Registry::get_instance()->get_utility('I_Router'); + $router = C_Router::get_instance(); switch ($_GET['page']) { case NGGFOLDER : @@ -417,13 +349,6 @@ class nggAdminPanel{ if ( !defined('IS_WP_3_3') ) wp_admin_css( 'css/dashboard' ); break; - case "nggallery-add-gallery": - $this->enqueue_jquery_ui_theme(); - wp_enqueue_style( 'jqueryFileTree', NGGALLERY_URLPATH .'admin/js/jqueryFileTree/jqueryFileTree.css', false, '1.0.1', 'screen' ); - case "nggallery-options" : - wp_enqueue_style( 'nggtabs', NGGALLERY_URLPATH .'admin/css/jquery.ui.tabs.css', false, '2.5.0', 'screen' ); - wp_enqueue_style( 'nggadmin' ); - break; case "nggallery-manage-gallery" : wp_enqueue_script('jquery-ui-tooltip'); wp_enqueue_style('shutter', $router->get_static_url('photocrati-lightbox#shutter/shutter.css'), false, '1.3.2', 'screen'); @@ -435,11 +360,6 @@ class nggAdminPanel{ case "nggallery-tags" : wp_enqueue_style( 'nggtags', NGGALLERY_URLPATH .'admin/css/tags-admin.css', false, '2.6.1', 'screen' ); break; - case "nggallery-style" : - wp_admin_css( 'css/theme-editor' ); - wp_enqueue_style('nggcolorpicker', NGGALLERY_URLPATH.'admin/js/colorpicker/css/colorpicker.css', false, '1.0', 'screen'); - wp_enqueue_style('nggadmincp', NGGALLERY_URLPATH.'admin/css/nggColorPicker.css', false, '1.0', 'screen'); - break; } } diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/ajax.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/ajax.php index f8461d15c264d0515e8642dae114d637dccbdb7d..f311f8243d9313ba6dfe60ba2354621af5154a4f 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/ajax.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/ajax.php @@ -52,10 +52,10 @@ function ngg_ajax_operation() { $result = nggAdmin::set_watermark($picture); break; case 'recover_image' : - $result = nggAdmin::recover_image($picture); + $result = nggAdmin::recover_image($id) ? '1': '0'; break; case 'import_metadata' : - $result = nggAdmin::import_MetaData( $id ); + $result = C_Image_Mapper::get_instance()->reimport_metadata($id) ? '1' : '0'; break; case 'get_image_ids' : $result = nggAdmin::get_image_ids( $id ); @@ -97,7 +97,7 @@ function createNewThumb() { $crop_frame = array('x' => $x, 'y' => $y, 'width' => $w, 'height' => $h); $registry = C_Component_Registry::get_instance(); - $storage = $registry->get_utility('I_Gallery_Storage'); + $storage = C_Gallery_Storage::get_instance(); // XXX NextGEN Legacy wasn't handling watermarks or reflections at this stage, so we're forcefully disabling them to maintain compatibility $params = array('watermark' => false, 'reflection' => false, 'crop' => true, 'crop_frame' => $crop_frame); @@ -194,78 +194,6 @@ function ngg_ajax_dashboard() { die(); } -add_action('wp_ajax_ngg_file_browser', 'ngg_ajax_file_browser'); - -/** - * jQuery File Tree PHP Connector - * @author Cory S.N. LaViska - A Beautiful Site (http://abeautifulsite.net/) - * @version 1.0.1 - * - * @return string folder content - */ -function ngg_ajax_file_browser() { - - global $ngg; - - // check for correct NextGEN capability - if ( !current_user_can('NextGEN Upload images') && !current_user_can('NextGEN Manage gallery') ) - die('No access'); - - if ( !defined('ABSPATH') ) - die('No access'); - - // if nonce is not correct it returns -1 - check_ajax_referer( 'ngg-ajax', 'nonce' ); - - //PHP4 compat script - if (!function_exists('scandir')) { - function scandir($dir, $listDirectories = false, $skipDots = true ) { - $dirArray = array(); - if ($handle = opendir($dir) ) { - while (false !== ($file = readdir($handle))) { - if (($file != '.' && $file != '..' ) || $skipDots == true) { - if($listDirectories == false) { if(is_dir($file)) { continue; } } - array_push($dirArray, basename($file) ); - } - } - closedir($handle); - } - return $dirArray; - } - } - - // start from the default path - $root = rtrim(ABSPATH, "\\/").DIRECTORY_SEPARATOR; - - // get the current directory - $dir = rtrim( urldecode($_POST['dir']),"/\\").DIRECTORY_SEPARATOR; - - if( file_exists($root . $dir) ) { - $files = scandir($root . $dir); - natcasesort($files); - - // The 2 counts for . and .. - if( count($files) > 2 ) { - echo "<ul class=\"jqueryDirTree\" style=\"display: none;\">"; - - // return only directories - foreach( $files as $file ) { - - //reserved name for the thumnbnails, don't use it as folder name - if ( $file == 'thumbs') - continue; - - if ( file_exists($root . $dir . $file) && $file != '.' && $file != '..' && is_dir($root . $dir . $file) ) { - echo "<li class=\"directory collapsed\"><a href=\"#\" rel=\"" . esc_html($dir . $file) . "/\">" . esc_html($file) . "</a></li>"; - } - } - - echo "</ul>"; - } - } - die(); -} - add_action( 'wp_ajax_ngg_rebuild_unique_slugs', 'ngg_ajax_rebuild_unique_slugs' ); /** * This rebuild the slugs for albums, galleries and images as ajax routine, max 50 elements per request diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/album.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/album.php index d3cfbd94939ba897e4ad8fd80e096f2c1ff06bda..2aec6ccf3f1b3cbd79ee2889ffa1d58809562016 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/album.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/album.php @@ -49,14 +49,6 @@ class nggManageAlbum { */ var $num_albums = false; - /** - * PHP4 compatibility layer for calling the PHP5 constructor. - * - */ - function nggManageAlbum() { - return $this->__construct(); - } - /** * Gets the Pope component registry * @return C_Component_Registry @@ -96,6 +88,13 @@ class nggManageAlbum { foreach (C_Gallery_Mapper::get_instance()->find_all() as $gallery) { $this->galleries[$gallery->{$gallery->id_field}] = $gallery; } + + if (apply_filters('ngg_manage_albums_items_order', 'ASC') == 'DESC') + { + $this->albums = array_reverse($this->albums, TRUE); + $this->galleries = array_reverse($this->galleries, TRUE); + } + $this->num_albums = count( $this->albums ); $this->num_galleries = count( $this->galleries ); @@ -253,17 +252,56 @@ class nggManageAlbum { nggGallery::show_message(__('Update Successfully','nggallery')); } + function get_available_preview_images($album) + { + $retval = array(); + + if ($album && isset($album->sortorder) && $album->sortorder) { + $galleries = array(); + $albums = array(); + foreach ($album->sortorder as $item) { + if (is_numeric($item)) $galleries[] = $item; + else $albums[] = $item; + } + + $image_mapper = C_Image_Mapper::get_instance(); + $retval += $image_mapper->select('DISTINCT *')->where(array("galleryid IN %s", $galleries))->where('exclude != 1')->run_query(); + foreach ($albums as $subalbum) $retval += $this->get_available_preview_images($subalbum); + } + else { + // enforce a reasonable limit on how many images to offer + $retval = C_Image_Mapper::get_instance() + ->select() + ->where_and(array()) + ->limit(intval(C_NextGen_Settings::get_instance()->get('maximum_entity_count', 500))) + ->run_query(); + } + + return $retval; + } + function output() { global $wpdb, $nggdb; if (isset($_REQUEST['act_album'])) $this->currentID = intval($_REQUEST['act_album']); + $album = $this->_get_album($this->currentID); + + // Generate JSON for autocomplete of preview images + $preview_images = $this->get_available_preview_images($album); + + //TODO:Code MUST be optimized, how to flag a used gallery better ? $used_list = $this->get_used_galleries(); - $album = $this->_get_album($this->currentID); + ?> +<style type="text/css"> + .select2-container {max-width: 580px; } + .select2-drop { max-width: 580px; } + .select2-choice { max-width: 580;} +</style> <script type="text/javascript"> @@ -289,8 +327,8 @@ jQuery(document).ready( }); } - jQuery("#previewpic").nggAutocomplete( { - type: 'image',domain: "<?php echo home_url('index.php', is_ssl() ? 'https' : 'http'); ?>",width: "95%" + $("#previewpic").select2({ + width: '100%' }); jQuery('#selectContainer').sortable( { @@ -399,7 +437,6 @@ function showDialog() { </script> <div class="wrap album" id="wrap" > - <?php //include('templates/social_media_buttons.php'); ?> <?php screen_icon( 'nextgen-gallery' ); ?> <h2><?php esc_html_e('Manage Albums', 'nggallery') ?></h2> <form id="selectalbum" method="POST" onsubmit="ngg_serialize()" accept-charset="utf-8"> @@ -544,17 +581,13 @@ function showDialog() { <tr> <th> <?php esc_html_e('Select a preview image:', 'nggallery'); ?><br /> - <select id="previewpic" name="previewpic" style="width:95%" > - <?php if ($album->previewpic == 0) ?> - <option value="0"><?php esc_html_e('No picture', 'nggallery'); ?></option> - <?php - if ($album->previewpic == 0) - echo '<option value="0" selected="selected">' . __('No picture', 'nggallery') . '</option>'; - else { - $picture = nggdb::find_image($album->previewpic); - echo '<option value="' . $picture->pid . '" selected="selected" >'. $picture->pid . ' - ' . ( empty($picture->alltext) ? esc_attr( $picture->filename ) : esc_attr( $picture->alltext ) ) .' </option>'."\n"; - } - ?> + <select id="previewpic" name="previewpic" data-placeholder="<?php esc_attr_e(__('No picture', 'nggallery'))?>"> + <?php foreach ($preview_images as $image): ?> + <option value="<?php esc_attr_e($image->pid)?>" <?php selected($album->previewpic, $image->pid) ?>> + <?php $label = $image->alttext ? $image->alttext : $image->filename; ?> + <?php esc_html_e($image->pid)?> - <?php esc_html_e($label)?> + </option> + <?php endforeach ?> </select> </th> </tr> @@ -565,13 +598,23 @@ function showDialog() { if (!isset($album->pageid)) $album->pageid = 0; + ob_start(); wp_dropdown_pages(array( 'echo' => TRUE, 'name' => 'pageid', 'selected' => $album->pageid, 'show_option_none' => esc_html('Not linked', 'nggallery'), 'option_none_value' => 0 - )); ?> + )); + $dropdown = ob_get_contents(); + ob_end_clean(); + if (!empty($dropdown)) + echo $dropdown; + else { + echo '<input type="hidden" id="pageid" name="pageid" value="0"/>'; + esc_html_e('There are no pages to link to', 'nggallery'); + } + ?> </th> </tr> @@ -670,13 +713,13 @@ function showDialog() { <div class="innerhandle"> <div class="item_top ' . $class . '"> <a href="#" class="min" title="close">[-]</a> - ID: ' . $obj['id'] . ' | ' . wp_html_excerpt( esc_html ( nggGallery::i18n( $obj['title'] ) ) , 25) . ' + ID: ' . $obj['id'] . ' | ' . wp_html_excerpt( esc_html ( M_I18N::translate( $obj['title'] ) ) , 25) . ' </div> <div class="itemContent"> ' . $preview_image . ' - <p><strong>' . __('Name', 'nggallery') . ' : </strong>' . esc_html ( nggGallery::i18n( $obj['name'] ) ). '</p> - <p><strong>' . __('Title', 'nggallery') . ' : </strong>' . esc_html ( nggGallery::i18n( $obj['title'] ) ) . '</p> - <p><strong>' . __('Page', 'nggallery'). ' : </strong>' . esc_html ( nggGallery::i18n( $obj['pagenname'] ) ) . '</p> + <p><strong>' . __('Name', 'nggallery') . ' : </strong>' . esc_html ( M_I18N::translate( $obj['name'] ) ). '</p> + <p><strong>' . __('Title', 'nggallery') . ' : </strong>' . esc_html ( M_I18N::translate( $obj['title'] ) ) . '</p> + <p><strong>' . __('Page', 'nggallery'). ' : </strong>' . esc_html ( M_I18N::translate( $obj['pagenname'] ) ) . '</p> ' . apply_filters('ngg_display_album_item_content', '', $obj) . ' </div> </div> diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/css/menu.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/css/menu.css index 3fe128b9236f8563a7cc415904fc24036f550aa0..f59d26c3e90d4e8f0c5649d6b51040c166200506 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/css/menu.css +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/css/menu.css @@ -1,3 +1,3 @@ -#icon-nextgen-gallery { - background:url("../images/nextgen_32_grey.png") no-repeat scroll 1px 1px transparent; +#icon-nextgen-gallery { + background:url("../images/nextgen_32_grey.png") no-repeat scroll 1px 1px transparent; } \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/css/nggColorPicker.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/css/nggColorPicker.css index 6b7775fb962c18c35924800f292780bb63b8d11c..f772424108442d5df64fcde0809f1c985ed4910f 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/css/nggColorPicker.css +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/css/nggColorPicker.css @@ -1,14 +1,14 @@ -#colorSelector{ - background:transparent url(../images/select.png) repeat scroll 0 0; - height:36px; - position:relative; - width:36px; -} -#colorSelector div{ - background:transparent url(../images/select.png) repeat scroll center center; - height:30px; - left:3px; - position:absolute; - top:3px; - width:30px; +#colorSelector{ + background:transparent url(../images/select.png) repeat scroll 0 0; + height:36px; + position:relative; + width:36px; +} +#colorSelector div{ + background:transparent url(../images/select.png) repeat scroll center center; + height:30px; + left:3px; + position:absolute; + top:3px; + width:30px; } \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/css/nggSorter.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/css/nggSorter.css index e0d61b9b451fe5135e010e88001de81e3ccff698..73a0ed8300c40e17b51fde88bd671be9f3ae3a4c 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/css/nggSorter.css +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/css/nggSorter.css @@ -1,76 +1,76 @@ -.imageBox,.imageBoxHighlighted{ - width:130px; /* Total width of each image box */ - height:160px; /* Total height of each image box */ - float:left; -} -.imageBox_theImage{ - width:110px; /* Width of image */ - height:125px; /* Height of image */ - - /* - Don't change these values * - */ - background-position: center; - background-repeat: no-repeat; - margin: 0 auto; - margin-bottom:2px; -} - -.imageBox .imageBox_theImage{ - border:1px solid #DDD; /* Border color for not selected images */ - padding:2px; -} -.imageBoxHighlighted .imageBox_theImage{ - border:3px solid #316AC5; /* Border color for selected image */ - padding:0px; - -} -.imageBoxHighlighted span{ /* Title of selected image */ - background-color: #316AC5; - color:#FFFFFF; - padding:2px; -} - -.imageBox_label{ /* Title of images - both selected and not selected */ - text-align:center; - font-family: arial; - font-size:11px; - padding-top:2px; - margin: 0 auto; -} - -/* -DIV that indicates where the dragged image will be placed -*/ -#insertionMarker{ - height:150px; - width:6px; - position:absolute; -} - -#insertionMarkerLine{ - width:6px; /* No need to change this value */ - height:145px; /* To adjust the height of the div that indicates where the dragged image will be dropped */ - -} - -#insertionMarker img{ - float:left; -} - -/* -DIV that shows the image as you drag it -*/ -#dragDropContent{ - - opacity:0.4; /* 40 % opacity */ - filter:alpha(opacity=40); /* 40 % opacity */ - - /* - No need to change these three values - */ - position:absolute; - z-index:10; - display:none; - +.imageBox,.imageBoxHighlighted{ + width:130px; /* Total width of each image box */ + height:160px; /* Total height of each image box */ + float:left; +} +.imageBox_theImage{ + width:110px; /* Width of image */ + height:125px; /* Height of image */ + + /* + Don't change these values * + */ + background-position: center; + background-repeat: no-repeat; + margin: 0 auto; + margin-bottom:2px; +} + +.imageBox .imageBox_theImage{ + border:1px solid #DDD; /* Border color for not selected images */ + padding:2px; +} +.imageBoxHighlighted .imageBox_theImage{ + border:3px solid #316AC5; /* Border color for selected image */ + padding:0px; + +} +.imageBoxHighlighted span{ /* Title of selected image */ + background-color: #316AC5; + color:#FFFFFF; + padding:2px; +} + +.imageBox_label{ /* Title of images - both selected and not selected */ + text-align:center; + font-family: arial; + font-size:11px; + padding-top:2px; + margin: 0 auto; +} + +/* +DIV that indicates where the dragged image will be placed +*/ +#insertionMarker{ + height:150px; + width:6px; + position:absolute; +} + +#insertionMarkerLine{ + width:6px; /* No need to change this value */ + height:145px; /* To adjust the height of the div that indicates where the dragged image will be dropped */ + +} + +#insertionMarker img{ + float:left; +} + +/* +DIV that shows the image as you drag it +*/ +#dragDropContent{ + + opacity:0.4; /* 40 % opacity */ + filter:alpha(opacity=40); /* 40 % opacity */ + + /* + No need to change these three values + */ + position:absolute; + z-index:10; + display:none; + } \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/css/nggadmin.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/css/nggadmin.css index 5bc71c37f99ab12c980bb9154f9f5a93ee03ed8f..415f6e4f1e5dc38790e2204e485690d871085e98 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/css/nggadmin.css +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/css/nggadmin.css @@ -1,528 +1,539 @@ -/* -** NextGEN Gallery Style for Wordpress 3.3 -*/ - -#iframely h2.title { - display: none; -} - -/* SETTINGS FOR Overview Gallery */ - -#newversion { - border-color:#CCCCCC; - border-style:solid; - border-width:1px; - margin-right:7px; - margin-top:10px; - padding:2px; -} - -.ngg-dashboard-widget ul.settings span { - padding-left : 10px; - color:#2583AD; - font-weight:bold; -} - -.ngg-overview .postbox .handlediv { - float:right; - height:24px; - width:24px; -} - -.warning { - color: #9F6000; - background-color: #FEEFB3; - border: 1px solid; - margin: 5px 0px; - padding:5px; -} - -#donator_message { - margin:5px 0 15px; - background-color:#BDE5F8; - border-color:#00529B; - -moz-border-radius-bottomleft:3px; - -moz-border-radius-bottomright:3px; - -moz-border-radius-topleft:3px; - -moz-border-radius-topright:3px; - border-style:solid; - border-width:1px; - margin:5px 15px 2px; - padding:0 0.6em; -} - -#donator_message p{ - line-height:1; - margin:0.5em 0; - padding:2px; - padding-bottom:10px; -} - -#donator_message span{ - padding-top:10px; - float:right; -} - -#plugin_check img { - float: right; -} - -#plugin_check p.message { - font-size: 90%; - color: #666; -} -/* SETTING FOR FLASH UPLOAD BUTTON */ -.swfupload { - position:absolute; - z-index:1; - vertical-align:top; -} - -/* SETTINGS FOR THE OPTIONS TABLE */ -.ngg-options th { - width:22%; -} - -a.switch-expert { - text-decoration:none; -} - -/* WATERMARK */ -#wm-preview { - float:right; - font-size:90%; - width:35%; - border-color:#EBEBEB rgb(204, 204, 204) rgb(204, 204, 204) rgb(235, 235, 235); - border-style:solid; - border-width:1px; - margin-bottom:10px; - margin-left:10px; - margin-right:8px; - padding:2px; -} -#wm-preview h3{ - background:#F9F9F9 none repeat scroll 0%; - font-size:14px; - font-weight:bold; - margin:0pt 0pt 10px; - padding:8px 5px; -} - -#wm-position { - width:100%; - margin-left:40px; -} - -.wm-table { - border-collapse:collapse; - margin-top:1em; - width: 60%; - clear:none; -} -.wm-table td { - border-bottom:8px solid #FFFFFF; - line-height:20px; - margin-bottom:9px; - padding:10px; -} -.wm-table th { - border-bottom:8px solid #FFFFFF; - padding:10px; - text-align:left; -} -.wm-table tr { - background:#F9F9F9 none repeat scroll 0%; -} - -/* SETTINGS FOR MANAGE TABLE */ - -div#poststuff #gallerydiv { - cursor:pointer; -} - -p#ngg-inlinebutton { - float:right; - margin:0pt; - position:relative; - top:-25pt; -} - -#gallery_fields { - width: 100%; -} - -#gallery_fields td{ - padding: 5px; - min-width: 105px; -} - -#gallery_fields input[type=text], -#gallery_fields textarea, -#gallery_fields select { - min-width: 220px; - width: 99%; -} - -#ngg-listimages .row_actions, -#ngg-listimages .row_actions td { - border-top: none; - /* background-color: #F9F9F9; */ - padding-top: 0px; - padding-bottom: 0px; -} - -#ngg-listimages .row_actions.alternate, -#ngg-listimages .row_actions.alternate td { - /* background-color: #FCFCFC; */ -} - -#ngg-listimages .row-actions { - padding-left: 0px; - margin-bottom: -2px; - position: relative; - bottom: 4px; -} - -#ngg-listimages .iedit, -#ngg-listimages .iedit td, -#ngg-listimages .iedit th { - border: none; -} - -#ngg-listimages .iedit td { - padding-top: 8px; -} - -#ngg-listimages .column select { - width: 100%; -} - -#ngg-listimages .column-1 input { - margin: 0 0 0 8px; -} - -#ngg-listimages .column-1, -#ngg-listimages .column-2 { - width: 4%; - min-width: 33px; -} - -#ngg-listimages .column-3 { - min-width: 80px; - width: 10%; -} - -#ngg-listimages .column-3 .thumb { - max-height: 80px; - max-width: 80px; -} - -#ngg-listimages .column-4 { - width: 22%; - max-width: 220px; - -} - -#ngg-listimages .column-4 .meta { - font-size: 11px; -} - -#ngg-listimages .column-4 label input[type=checkbox] { - position: relative; - top: -2px; -} - -#ngg-listimages .column-5 input[type=text], -#ngg-listimages .column-5 textarea, -#ngg-listimages .column-6 textarea { - width: 100%; -} - -#ngg-listimages .column-5 textarea { - height: 57px; -} - -#ngg-listimages .column-6 textarea { - height: 80px; -} - -/* SETTINGS FOR PROGRESS BAR */ - -div .progressborder { - border:1px solid #DDDDDD; - display: block; - height: 30px; - background-color: #464646; - width: 100%; - margin-top: 15px; - margin-bottom: 15px; - -moz-border-radius: 5px; - -webkit-border-radius: 5px; - border-radius: 5px; -} - -div .progressbar { - border: medium none ; - display: block; - height: 30px; - background-color: #D54E21; - width: 0%; - -moz-border-radius: 5px; - -webkit-border-radius: 5px; - border-radius: 5px; -} - -div .progressbar span { - display: inline; - position: absolute; - color: white; - font-weight: bold; - padding: 5px 0 0 5px; -} - -.show_details -{ - height: 16px; - line-height: 20px; - overflow: hidden; - min-width: 8em; - padding: 3px; - cursor:pointer; -} - -.show_details span -{ - border-bottom:1px solid #999; - white-space:pre; -} -.show_details:hover -{ - height: auto; - overflow: visible; - border: 1px solid #999; -} - - /* SETTINGS FOR ALBUM PAGE */ - -.albumnav select[name="act_album"] { - width:150px; -} - -.albumnav span { - padding-left: 50px; -} - -#editalbum select[name='pageid'] { - width: 95%; -} - -div .groupItem -{ - cursor: move; - width: 295px; - padding: 5px; - line-height: 1.5; -} - -div .innerhandle { - background-color:#FBFBFB; -} - -.groupItem .item_top -{ - background-color:#2683AE; - color: #FFFFFF; - font-weight:bold; - line-height: 28px; - height: 28px; - padding: 0 5px; - -moz-border-radius: 3px; - -khtml-border-radius: 3px; - -webkit-border-radius: 3px; - border-radius: 3px; -} - -.groupItem .album_obj -{ - background-color:#D54E21; -} - -.groupItem .item_top a -{ - color:#FFFFFF; - float:right; - text-decoration: none; -} - -.groupItem .item_top a:hover -{ - color:#FFFFFF; -} - -.itemContent { - border-color:#DFDFDF; - border-style:none solid solid; - border-width:0 1px 1px; - padding:2px 0 20px 2px; -} - -.itemContent p { - border: 0; - margin: 0; - padding: 0; -} - -.inlinepicture -{ - float:left; - display:inline; - margin:0pt; - padding:0pt 3px 1px; -} - -.inlinepicture img -{ - margin:3px; - max-height:60px; -} - -.sort_placeholder -{ - border:1px dashed #bba !important; - margin: 5px; - background: #F9F9F9; -} - -.container { - margin-top: 10px; -} - -.target-album { - margin:10px 685px 10px 10px; -} - -.widget-right { - float:right; - margin:0pt 10px; - width:315px; -} - -.widget-holder { - min-height: 400px; - padding-top:1px; -} - -.target { - background-color:#F1F1F1; -} - -div.widget-top h3 { - text-align:center; - line-height:25px; - margin: 0; - padding: 5px 12px; - font-size: 13px; -} - -div.widget-top { - text-shadow:0 1px 0 #FFFFFF; - background-repeat: repeat-x; - background-position: 0 0; - font-size: 13px; -} - -.ui-autocomplete-start { background-position: 99% center; } - -/* SETTINGS FOR SORT GALLERY */ - -#sortGallery { - position:relative; -} - -p#sortButton{ - margin:0; - position:absolute; - right:0; - top:0; -} - -.imageBox,.imageBoxHighlighted{ - width:130px; /* Total width of each image box */ - height:160px; /* Total height of each image box */ - float:left; - overflow: hidden; - text-overflow: ellipsis; - padding: 5px; -} -.imageBox_theImage{ - width:110px; /* Width of image */ - height:125px; /* Height of image */ - - background-position: center; - background-repeat: no-repeat; - margin: 0 auto; - margin-bottom:2px; -} - -.imageBox_label{ /* Title of images - both selected and not selected */ - text-align:center; - font-family: arial; - font-size:11px; - padding-top:2px; - margin: 0 auto; -} - -/* -DIV that indicates where the dragged image will be placed -*/ - -#insertionMarker{ - height:150px; - width:6px; - position:absolute; -} - -#insertionMarkerLine{ - width:6px; /* No need to change this value */ - height:145px; /* To adjust the height of the div that indicates where the dragged image will be dropped */ - -} - -#insertionMarker img{ - float:left; -} - -/* -DIV that shows the image as you drag it -*/ - -#dragDropContent{ - - opacity:0.4; /* 40 % opacity */ - filter:alpha(opacity=40); /* 40 % opacity */ - - /* - No need to change these three values - */ - position:absolute; - z-index:10; - display:none; - -} - -/* UPGRADE PAGE */ - -.error_inline { - background:#FFEBE8 none repeat scroll 0%; - border:1px solid #CC0000; - margin:5px auto; - padding:10px; -} - -/* ABOUT PAGE */ -.ngg-list { - font-size:11px; - margin-left:15px; - list-style-position:inside; - list-style-type:disc; -} +/* +** NextGEN Gallery Style for Wordpress 3.3 +*/ + +#iframely h2.title { + display: none; +} + +/* SETTINGS FOR Overview Gallery */ + +#newversion { + border-color:#CCCCCC; + border-style:solid; + border-width:1px; + margin-right:7px; + margin-top:10px; + padding:2px; +} + +.ngg-dashboard-widget ul.settings span { + padding-left : 10px; + color:#2583AD; + font-weight:bold; +} + +.ngg-overview .postbox .handlediv { + float:right; + height:24px; + width:24px; +} + +.warning { + color: #9F6000; + background-color: #FEEFB3; + border: 1px solid; + margin: 5px 0px; + padding:5px; +} + +#donator_message { + margin:5px 0 15px; + background-color:#BDE5F8; + border-color:#00529B; + -moz-border-radius-bottomleft:3px; + -moz-border-radius-bottomright:3px; + -moz-border-radius-topleft:3px; + -moz-border-radius-topright:3px; + border-style:solid; + border-width:1px; + margin:5px 15px 2px; + padding:0 0.6em; +} + +#donator_message p{ + line-height:1; + margin:0.5em 0; + padding:2px; + padding-bottom:10px; +} + +#donator_message span{ + padding-top:10px; + float:right; +} + +#plugin_check img { + float: right; +} + +#plugin_check p.message { + font-size: 90%; + color: #666; +} +/* SETTING FOR FLASH UPLOAD BUTTON */ +.swfupload { + position:absolute; + z-index:1; + vertical-align:top; +} + +/* SETTINGS FOR THE OPTIONS TABLE */ +.ngg-options th { + width:22%; +} + +a.switch-expert { + text-decoration:none; +} + +/* WATERMARK */ +#wm-preview { + float:right; + font-size:90%; + width:35%; + border-color:#EBEBEB rgb(204, 204, 204) rgb(204, 204, 204) rgb(235, 235, 235); + border-style:solid; + border-width:1px; + margin-bottom:10px; + margin-left:10px; + margin-right:8px; + padding:2px; +} +#wm-preview h3{ + background:#F9F9F9 none repeat scroll 0%; + font-size:14px; + font-weight:bold; + margin:0pt 0pt 10px; + padding:8px 5px; +} + +#wm-position { + width:100%; + margin-left:40px; +} + +.wm-table { + border-collapse:collapse; + margin-top:1em; + width: 60%; + clear:none; +} +.wm-table td { + border-bottom:8px solid #FFFFFF; + line-height:20px; + margin-bottom:9px; + padding:10px; +} +.wm-table th { + border-bottom:8px solid #FFFFFF; + padding:10px; + text-align:left; +} +.wm-table tr { + background:#F9F9F9 none repeat scroll 0%; +} + +/* SETTINGS FOR MANAGE TABLE */ + +div#poststuff #gallerydiv { + cursor:pointer; +} + +p#ngg-inlinebutton { + float:right; + margin:0pt; + position:relative; + top:-25pt; +} + +#gallery_fields { + width: 100%; +} + +#gallery_fields td{ + padding: 5px; + min-width: 105px; +} + +#gallery_fields input[type=text], +#gallery_fields textarea, +#gallery_fields select { + min-width: 220px; + width: 99%; +} + +#ngg-listimages .row_actions, +#ngg-listimages .row_actions td { + border-top: none; + /* background-color: #F9F9F9; */ + padding-top: 0px; + padding-bottom: 0px; +} + +#ngg-listimages .row_actions.alternate, +#ngg-listimages .row_actions.alternate td { + /* background-color: #FCFCFC; */ +} + +#ngg-listimages .row-actions { + padding-left: 0px; + margin-bottom: -2px; + position: relative; + bottom: 4px; +} + +#ngg-listimages .iedit, +#ngg-listimages .iedit td, +#ngg-listimages .iedit th { + border: none; +} + +#ngg-listimages .iedit td { + padding-top: 8px; +} + +#ngg-listimages .column select { + width: 100%; +} + +#ngg-listimages .column-1 input { + margin: 0 0 0 8px; +} + +#ngg-listimages .column-1, +#ngg-listimages .column-2 { + width: 4%; + min-width: 33px; +} + +#ngg-listimages .column-3 { + min-width: 80px; + width: 10%; +} + +#ngg-listimages .column-3 .thumb { + max-height: 80px; + max-width: 80px; +} + +#ngg-listimages .column-4 { + width: 22%; + max-width: 220px; + +} + +#ngg-listimages .column-4 .meta { + font-size: 11px; +} + +#ngg-listimages .column-4 label input[type=checkbox] { + position: relative; + top: -2px; +} + +#ngg-listimages .column-5 input[type=text], +#ngg-listimages .column-5 textarea, +#ngg-listimages .column-6 textarea { + width: 100%; +} + +#ngg-listimages .column-5 textarea { + height: 57px; +} + +#ngg-listimages .column-6 textarea { + height: 80px; +} + +/* SETTINGS FOR PROGRESS BAR */ + +div .progressborder { + border:1px solid #DDDDDD; + display: block; + height: 30px; + background-color: #464646; + width: 100%; + margin-top: 15px; + margin-bottom: 15px; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + border-radius: 5px; +} + +div .progressbar { + border: medium none ; + display: block; + height: 30px; + background-color: #D54E21; + width: 0%; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + border-radius: 5px; +} + +div .progressbar span { + display: inline; + position: absolute; + color: white; + font-weight: bold; + padding: 5px 0 0 5px; +} + +.show_details +{ + height: 16px; + line-height: 20px; + overflow: hidden; + min-width: 8em; + padding: 3px; + cursor:pointer; +} + +.show_details span +{ + border-bottom:1px solid #999; + white-space:pre; +} +.show_details:hover +{ + height: auto; + overflow: visible; + border: 1px solid #999; +} + + /* SETTINGS FOR ALBUM PAGE */ + +.albumnav select[name="act_album"] { + width:150px; +} + +.albumnav span { + padding-left: 50px; +} + +#editalbum select[name='pageid'] { + width: 95%; +} + +div .groupItem +{ + cursor: move; + width: 295px; + padding: 5px; + line-height: 1.5; +} + +div .innerhandle { + background-color:#FBFBFB; +} + +.groupItem .item_top +{ + background-color:#2683AE; + color: #FFFFFF; + font-weight:bold; + line-height: 28px; + height: 28px; + padding: 0 5px; + -moz-border-radius: 3px; + -khtml-border-radius: 3px; + -webkit-border-radius: 3px; + border-radius: 3px; +} + +.groupItem .album_obj +{ + background-color:#D54E21; +} + +.groupItem .item_top a +{ + color:#FFFFFF; + float:right; + text-decoration: none; +} + +.groupItem .item_top a:hover +{ + color:#FFFFFF; +} + +.itemContent { + border-color:#DFDFDF; + border-style:none solid solid; + border-width:0 1px 1px; + padding:2px 0 20px 2px; +} + +.itemContent p { + border: 0; + margin: 0; + padding: 0; +} + +.inlinepicture +{ + float:left; + display:inline; + margin:0pt; + padding:0pt 3px 1px; +} + +.inlinepicture img +{ + margin:3px; + max-height:60px; +} + +.sort_placeholder +{ + border:1px dashed #bba !important; + margin: 5px; + background: #F9F9F9; +} + +.container { + margin-top: 10px; +} + +.target-album { + margin:10px 685px 10px 10px; +} + +.widget-right { + float:right; + margin:0pt 10px; + width:315px; +} + +.widget-holder { + min-height: 400px; + padding-top:1px; +} + +.target { + background-color:#F1F1F1; +} + +div.widget-top h3 { + text-align:center; + line-height:25px; + margin: 0; + padding: 5px 12px; + font-size: 13px; +} + +div.widget-top { + text-shadow:0 1px 0 #FFFFFF; + background-repeat: repeat-x; + background-position: 0 0; + font-size: 13px; +} + +.ui-autocomplete-start { background-position: 99% center; } + +/* SETTINGS FOR SORT GALLERY */ + +#sortGallery { + position:relative; +} + +p#sortButton{ + margin:0; + position:absolute; + right:0; + top:0; +} + +.imageBox,.imageBoxHighlighted{ + width:130px; /* Total width of each image box */ + height:160px; /* Total height of each image box */ + float:left; + overflow: hidden; + text-overflow: ellipsis; + padding: 5px; +} +.imageBox_theImage{ + width:110px; /* Width of image */ + height:125px; /* Height of image */ + + background-position: center; + background-repeat: no-repeat; + margin: 0 auto; + margin-bottom:2px; +} + +.imageBox_label{ /* Title of images - both selected and not selected */ + text-align:center; + font-family: arial; + font-size:11px; + padding-top:2px; + margin: 0 auto; +} + +/* +DIV that indicates where the dragged image will be placed +*/ + +#insertionMarker{ + height:150px; + width:6px; + position:absolute; +} + +#insertionMarkerLine{ + width:6px; /* No need to change this value */ + height:145px; /* To adjust the height of the div that indicates where the dragged image will be dropped */ + +} + +#insertionMarker img{ + float:left; +} + +/* +DIV that shows the image as you drag it +*/ + +#dragDropContent{ + + opacity:0.4; /* 40 % opacity */ + filter:alpha(opacity=40); /* 40 % opacity */ + + /* + No need to change these three values + */ + position:absolute; + z-index:10; + display:none; + +} + +/* UPGRADE PAGE */ + +.error_inline { + background:#FFEBE8 none repeat scroll 0%; + border:1px solid #CC0000; + margin:5px auto; + padding:10px; +} + +/* ABOUT PAGE */ +.ngg-list { + font-size:11px; + margin-left:15px; + list-style-position:inside; + list-style-type:disc; +} + +#ngg-manage-images-items-per-page-label { + float: right; + line-height: 30px; + margin-right: 5px; +} + +#ngg-manage-images-items-per-page { + float: right; + margin-right: 5px; +} \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/css/tags-admin.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/css/tags-admin.css index a7f5e273e4c0de92a0c31cbfc026de0ded178103..eec3fbe4109e5633babdc6aaef407dfd2ff6a5d9 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/css/tags-admin.css +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/css/tags-admin.css @@ -1,10 +1,10 @@ -.ngg_wrap .auto_list{width:98%;margin:3px 0;padding:3px 5px;} -.ngg_wrap .list_tags {width:240px;vertical-align:top;} -.ngg_wrap .forms_manage {vertical-align:top;} -.ngg_wrap .forms_manage h3 {margin-bottom:5px;} -.ngg_wrap .forms_manage .form-table {margin-top:0;} -.ngg_wrap .sort_order h3 {margin:0;} -.ngg_wrap #ajax_area_tagslist {} -.ngg_wrap #ajax_area_tagslist ul{list-style:square;margin:10px 0 10px 20px;padding:0;} -.ngg_wrap #ajax_area_tagslist ul li{margin:0;padding:0;line-height:1.4;} +.ngg_wrap .auto_list{width:98%;margin:3px 0;padding:3px 5px;} +.ngg_wrap .list_tags {width:240px;vertical-align:top;} +.ngg_wrap .forms_manage {vertical-align:top;} +.ngg_wrap .forms_manage h3 {margin-bottom:5px;} +.ngg_wrap .forms_manage .form-table {margin-top:0;} +.ngg_wrap .sort_order h3 {margin:0;} +.ngg_wrap #ajax_area_tagslist {} +.ngg_wrap #ajax_area_tagslist ul{list-style:square;margin:10px 0 10px 20px;padding:0;} +.ngg_wrap #ajax_area_tagslist ul li{margin:0;padding:0;line-height:1.4;} .ngg_wrap #ajax_area_tagslist ul li span{cursor:pointer;} \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/edit-thumbnail.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/edit-thumbnail.php index 33deff75b97dd559afc45d72a76e75351493dad4..6acf529b70927b35b666c12981c1510205d8131c 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/edit-thumbnail.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/edit-thumbnail.php @@ -37,7 +37,18 @@ $thumb->resize(350,350); $resizedPreviewInfo = $thumb->newDimensions; $thumb->destruct(); -$preview_image = NGGALLERY_URLPATH . 'nggshow.php?pid=' . $picture->pid . '&width=350&height=350'; +// Generate a url to a preview image +$storage = C_Gallery_Storage::get_instance(); +$thumbnail_manager = C_Dynamic_Thumbnails_Manager::get_instance(); +$dynamic_size = $thumbnail_manager->get_size_name(array( + 'width' => 350, + 'height' => 350, + +)); +//$preview_image = NGGALLERY_URLPATH . 'nggshow.php?pid=' . $picture->pid . '&width=350&height=350'; +$preview_image = $storage->get_image_url($id, $dynamic_size); + + $imageInfo = @getimagesize($picture->imagePath); $rr = round($imageInfo[0] / $resizedPreviewInfo['newWidth'], 2); diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/functions.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/functions.php index 8c978199c9d9f627e0f257e0d4c8c1e266196ac2..ff20a82d1824ca88f45be2e425e12119a67ef5b4 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/functions.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/functions.php @@ -12,758 +12,561 @@ if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You */ class nggAdmin{ - /** - * create a new gallery & folder - * - * @class nggAdmin - * @param string $name of the gallery - * @param string $defaultpath - * @param bool $output if the function should show an error messsage or not - * @return - */ - function create_gallery($title, $defaultpath, $output = true) { - - global $user_ID; + /** + * create a new gallery & folder + * + * @class nggAdmin + * @param string $name of the gallery + * @param string $defaultpath + * @param bool $output if the function should show an error messsage or not + * @return + */ + static function create_gallery($title, $defaultpath, $output = true) { + + global $user_ID; $fs = C_Fs::get_instance(); - $registry = C_Component_Registry::get_instance(); - $storage = $registry->get_utility('I_Gallery_Storage'); + $storage = C_Gallery_Storage::get_instance(); // get the current user ID - get_currentuserinfo(); + get_currentuserinfo(); - //cleanup pathname - $name = sanitize_file_name( sanitize_title($title) ); - $name = apply_filters('ngg_gallery_name', $name); - $txt = ''; + //cleanup pathname + $name = sanitize_file_name( sanitize_title($title) ); + $name = apply_filters('ngg_gallery_name', $name); + $txt = ''; $galleryObj = new stdClass; $galleryObj->path = ''; $nggRoot = $storage->get_gallery_abspath($galleryObj); - // No gallery name ? - if ( empty($name) ) { - if ($output) nggGallery::show_error( __('No valid gallery name!', 'nggallery') ); - return false; - } + // No gallery name ? + if ( empty($name) ) { + if ($output) nggGallery::show_error( __('No valid gallery name!', 'nggallery') ); + return false; + } $galleryObj = new stdClass; $galleryObj->path = $fs->join_paths($defaultpath, $name); $gallery_path = $storage->get_gallery_abspath($galleryObj); - // check for main folder - if ( !is_dir($nggRoot) ) { - if ( !wp_mkdir_p( $nggRoot ) ) { - $txt = __('Directory', 'nggallery').' <strong>' . esc_html( $nggRoot ) . '</strong> '.__('didn\'t exist. Please create first the main gallery folder ', 'nggallery').'!<br />'; - $txt .= __('Check this link, if you didn\'t know how to set the permission :', 'nggallery').' <a href="http://codex.wordpress.org/Changing_File_Permissions">http://codex.wordpress.org/Changing_File_Permissions</a> '; - if ($output) nggGallery::show_error($txt); - return false; - } - } - - // check for permission settings, Safe mode limitations are not taken into account. - if ( !is_writeable( $nggRoot ) ) { - $txt = __('Directory', 'nggallery').' <strong>' . esc_html( $nggRoot ) . '</strong> '.__('is not writeable !', 'nggallery').'<br />'; - $txt .= __('Check this link, if you didn\'t know how to set the permission :', 'nggallery').' <a href="http://codex.wordpress.org/Changing_File_Permissions">http://codex.wordpress.org/Changing_File_Permissions</a> '; - if ($output) nggGallery::show_error($txt); - return false; - } - - // 1. Check for existing folder - if ( is_dir($gallery_path) && !(SAFE_MODE) ) { - $suffix = 1; - do { - $alt_name = substr ($name, 0, 200 - ( strlen( $suffix ) + 1 ) ) . "_$suffix"; + // check for main folder + if ( !is_dir($nggRoot) ) { + if ( !wp_mkdir_p( $nggRoot ) ) { + $txt = __('Directory', 'nggallery').' <strong>' . esc_html( $nggRoot ) . '</strong> '.__('didn\'t exist. Please create first the main gallery folder ', 'nggallery').'!<br />'; + $txt .= __('Check this link, if you didn\'t know how to set the permission :', 'nggallery').' <a href="http://codex.wordpress.org/Changing_File_Permissions">http://codex.wordpress.org/Changing_File_Permissions</a> '; + if ($output) nggGallery::show_error($txt); + return false; + } + } + + // 1. Check for existing folder + if ( is_dir($gallery_path) && !(SAFE_MODE) ) { + $suffix = 1; + do { + $alt_name = substr ($name, 0, 200 - ( strlen( $suffix ) + 1 ) ) . "_$suffix"; $galleryObj->path = $fs->join_paths($defaultpath, $alt_name); $gallery_path = $storage->get_gallery_abspath($galleryObj); - $dir_check = is_dir($gallery_path); - $suffix++; - } while ( $dir_check ); - $name = $alt_name; - } + $dir_check = is_dir($gallery_path); + $suffix++; + } while ( $dir_check ); + $name = $alt_name; + } $thumb_path = $fs->join_paths($gallery_path, 'thumbs'); - // 2. Create new gallery folder - if ( !wp_mkdir_p ($gallery_path) ) - $txt = __('Unable to create directory ', 'nggallery') . esc_html($gallery_path) . '!<br />'; - - // 3. Check folder permission - if ( !is_writeable($gallery_path) ) - $txt .= __('Directory', 'nggallery').' <strong>' . esc_html($gallery_path) . '</strong> '.__('is not writeable !', 'nggallery').'<br />'; - - // 4. Now create thumbnail folder inside - if ( !is_dir($thumb_path) ) { - if ( !wp_mkdir_p ($thumb_path) ) - $txt .= __('Unable to create directory ', 'nggallery').' <strong>' . esc_html($thumb_path) . '/thumbs !</strong>'; - } - - if (SAFE_MODE) { - $help = __('The server setting Safe-Mode is on !', 'nggallery'); - $help .= '<br />'.__('If you have problems, please create directory', 'nggallery').' <strong>' . esc_html($gallery_path) . '</strong> '; - $help .= __('and the thumbnails directory', 'nggallery').' <strong>' . esc_html($thumb_path) . '</strong> '.__('with permission 777 manually !', 'nggallery'); - if ($output) nggGallery::show_message($help); - } - - // show a error message - if ( !empty($txt) ) { - if (SAFE_MODE) { - // for safe_mode , better delete folder, both folder must be created manually - @rmdir($thumb_path); - @rmdir($gallery_path); - } - if ($output) nggGallery::show_error($txt); - return false; - } + // 2. Create new gallery folder + if ( !wp_mkdir_p ($gallery_path) ) + $txt = __('Unable to create directory ', 'nggallery') . esc_html($gallery_path) . '!<br />'; + + // 3. Check folder permission + if ( !is_writeable($gallery_path) ) + $txt .= __('Directory', 'nggallery').' <strong>' . esc_html($gallery_path) . '</strong> '.__('is not writeable !', 'nggallery').'<br />'; + + // 4. Now create thumbnail folder inside + if ( !is_dir($thumb_path) ) { + if ( !wp_mkdir_p ($thumb_path) ) + $txt .= __('Unable to create directory ', 'nggallery').' <strong>' . esc_html($thumb_path) . '/thumbs !</strong>'; + } + + if (SAFE_MODE) { + $help = __('The server setting Safe-Mode is on !', 'nggallery'); + $help .= '<br />'.__('If you have problems, please create directory', 'nggallery').' <strong>' . esc_html($gallery_path) . '</strong> '; + $help .= __('and the thumbnails directory', 'nggallery').' <strong>' . esc_html($thumb_path) . '</strong> '.__('with permission 777 manually !', 'nggallery'); + if ($output) nggGallery::show_message($help); + } + + // show a error message + if ( !empty($txt) ) { + if (SAFE_MODE) { + // for safe_mode , better delete folder, both folder must be created manually + @rmdir($thumb_path); + @rmdir($gallery_path); + } + if ($output) nggGallery::show_error($txt); + return false; + } // now add the gallery to the database $galleryID = nggdb::add_gallery($title, $defaultpath . $name, '', 0, 0, $user_ID ); - // here you can inject a custom function - do_action('ngg_created_new_gallery', $galleryID); - - // return only the id if defined - if ($output == false) - return $galleryID; - - if ($galleryID != false) { - $message = __('Gallery ID %1$s successfully created. You can show this gallery in your post or page with the shortcode %2$s.<br/>','nggallery'); - $message = sprintf($message, $galleryID, '<strong>[nggallery id=' . $galleryID . ']</strong>'); - $message .= '<a href="' . admin_url() . 'admin.php?page=nggallery-manage-gallery&mode=edit&gid=' . $galleryID . '" >'; - $message .= __('Edit gallery','nggallery'); - $message .= '</a>'; - - if ($output) nggGallery::show_message($message); - } - return true; - } - - /** - * Scan folder for new images - * - * @class nggAdmin - * @param string $dirname - * @return array $files list of image filenames - */ - function scandir( $dirname = '.' ) { - $ext = apply_filters('ngg_allowed_file_types', array('jpeg', 'jpg', 'png', 'gif') ); - - $files = array(); - if( $handle = opendir( $dirname ) ) { - while( false !== ( $file = readdir( $handle ) ) ) { - $info = pathinfo( $file ); - // just look for images with the correct extension - if ( isset($info['extension']) ) { - if ( in_array( strtolower($info['extension']), $ext) ) { - if (!seems_utf8($file)) { - $file = utf8_encode( $file ); - } - - $files[] = $file; - } - } - } - - closedir( $handle ); - } - sort( $files ); - return ( $files ); - } - - /** - * nggAdmin::createThumbnail() - function to create or recreate a thumbnail - * - * @class nggAdmin - * @param object | int $image contain all information about the image or the id - * @return string result code - * @since v1.0.0 - */ - function create_thumbnail($image) { - - if (is_object($image)) { - if (isset($image->id)) { - $image = $image->id; - } - elseif (isset($image->pid)) { - $image = $image->pid; - } - } - - $registry = C_Component_Registry::get_instance(); - $storage = $registry->get_utility('I_Gallery_Storage'); - - // XXX NextGEN Legacy wasn't handling watermarks or reflections at this stage, so we're forcefully disabling them to maintain compatibility - $params = array('watermark' => false, 'reflection' => false); - $result = $storage->generate_thumbnail($image, $params); - - if (!$result) - { - // XXX there isn't any error handling unfortunately at the moment in the generate_thumbnail functions, need a way to return proper error status - return __('Error while creating thumbnail.', 'nggallery'); - } - - // success - return '1'; - } - - /** - * nggAdmin::resize_image() - create a new image, based on the height /width - * - * @class nggAdmin - * @param object | int $image contain all information about the image or the id - * @param integer $width optional - * @param integer $height optional - * @return string result code - */ - function resize_image($image, $width = 0, $height = 0) - { - if (is_object($image)) { - if (isset($image->id)) { - $image = $image->id; - } - elseif (isset($image->pid)) { - $image = $image->pid; - } - } - - $registry = C_Component_Registry::get_instance(); - $storage = $registry->get_utility('I_Gallery_Storage'); - // XXX maybe get rid of this...it's needed to get width/height defaults, placing these directly in generate_image_size could have unwanted consequences - $settings = C_NextGen_Settings::get_instance(); - - // XXX NextGEN Legacy wasn't handling watermarks or reflections at this stage, so we're forcefully disabling them to maintain compatibility - $params = array('watermark' => false, 'reflection' => false); - - if ($width > 0) { - $params['width'] = $width; - } - else { - $params['width'] = $settings->imgWidth; - } - - if ($height > 0) { - $params['height'] = $height; - } - else { - $params['height'] = $settings->imgHeight; - } - - $result = $storage->generate_image_size($image, 'full', $params); - - if (!$result) - { - // XXX there isn't any error handling unfortunately at the moment in the generate_thumbnail functions, need a way to return proper error status - return __('Error while resizing image.', 'nggallery'); - } - - // success - return '1'; - } - - /** - * Rotated/Flip an image based on the orientation flag or a definded angle - * - * @param int|object $image - * @param string (optional) $dir, CW (clockwise)or CCW (counter clockwise), if set to false, the exif flag will be used - * @param string (optional) $flip, could be either false | V (flip vertical) | H (flip horizontal) - * @return string result code - */ - function rotate_image($image, $dir = false, $flip = false) - { + // here you can inject a custom function + do_action('ngg_created_new_gallery', $galleryID); + + // return only the id if defined + if ($output == false) + return $galleryID; + + if ($galleryID != false) { + $message = __('Gallery ID %1$s successfully created. You can show this gallery in your post or page with the shortcode %2$s.<br/>','nggallery'); + $message = sprintf($message, $galleryID, '<strong>[nggallery id=' . $galleryID . ']</strong>'); + $message .= '<a href="' . admin_url() . 'admin.php?page=nggallery-manage-gallery&mode=edit&gid=' . $galleryID . '" >'; + $message .= __('Edit gallery','nggallery'); + $message .= '</a>'; + + if ($output) nggGallery::show_message($message); + } + return true; + } + + /** + * Scan folder for new images + * + * @class nggAdmin + * @param string $dirname + * @return array $files list of image filenames + */ + static function scandir( $dirname = '.' ) { + $ext = apply_filters('ngg_allowed_file_types', array('jpeg', 'jpg', 'png', 'gif') ); + + $files = array(); + if( $handle = opendir( $dirname ) ) { + while( false !== ( $file = readdir( $handle ) ) ) { + $info = M_I18n::mb_pathinfo( $file ); + // just look for images with the correct extension + if ( isset($info['extension']) ) { + if ( in_array( strtolower($info['extension']), $ext) ) { + if (!seems_utf8($file)) { + $file = utf8_encode( $file ); + } + + $files[] = $file; + } + } + } + + closedir( $handle ); + } + sort( $files ); + return ( $files ); + } + + /** + * nggAdmin::createThumbnail() - function to create or recreate a thumbnail + * + * @class nggAdmin + * @param object | int $image contain all information about the image or the id + * @return string result code + * @since v1.0.0 + */ + static function create_thumbnail($image) { + + if (is_object($image)) { + if (isset($image->id)) { + $image = $image->id; + } + elseif (isset($image->pid)) { + $image = $image->pid; + } + } + $storage = C_Gallery_Storage::get_instance(); + + // XXX NextGEN Legacy wasn't handling watermarks or reflections at this stage, so we're forcefully disabling them to maintain compatibility + $params = array('watermark' => false, 'reflection' => false); + $result = $storage->generate_thumbnail($image, $params); + + if (!$result) + { + // XXX there isn't any error handling unfortunately at the moment in the generate_thumbnail functions, need a way to return proper error status + return __('Error while creating thumbnail.', 'nggallery'); + } + + // success + return '1'; + } + + /** + * nggAdmin::resize_image() - create a new image, based on the height /width + * + * @class nggAdmin + * @param object | int $image contain all information about the image or the id + * @param integer $width optional + * @param integer $height optional + * @return string result code + */ + static function resize_image($image, $width = 0, $height = 0) + { + if (is_object($image)) { + if (isset($image->id)) { + $image = $image->id; + } + elseif (isset($image->pid)) { + $image = $image->pid; + } + } + + $storage = C_Gallery_Storage::get_instance(); + // XXX maybe get rid of this...it's needed to get width/height defaults, placing these directly in generate_image_size could have unwanted consequences + $settings = C_NextGen_Settings::get_instance(); + + // XXX NextGEN Legacy wasn't handling watermarks or reflections at this stage, so we're forcefully disabling them to maintain compatibility + $params = array('watermark' => false, 'reflection' => false); + + if ($width > 0) { + $params['width'] = $width; + } + else { + $params['width'] = $settings->imgWidth; + } + + if ($height > 0) { + $params['height'] = $height; + } + else { + $params['height'] = $settings->imgHeight; + } + + $result = $storage->generate_image_size($image, 'full', $params); + + if (!$result) + { + // XXX there isn't any error handling unfortunately at the moment in the generate_thumbnail functions, need a way to return proper error status + return __('Error while resizing image.', 'nggallery'); + } + + // success + return '1'; + } + + /** + * Rotated/Flip an image based on the orientation flag or a definded angle + * + * @param int|object $image + * @param string (optional) $dir, CW (clockwise)or CCW (counter clockwise), if set to false, the exif flag will be used + * @param string (optional) $flip, could be either false | V (flip vertical) | H (flip horizontal) + * @return string result code + */ + static function rotate_image($image, $dir = false, $flip = false) + { if (is_object($image)) { if (isset($image->id)) $image = $image->id; elseif (isset($image->pid)) $image = $image->pid; } + $storage = C_Gallery_Storage::get_instance(); - $registry = C_Component_Registry::get_instance(); - $storage = $registry->get_utility('I_Gallery_Storage'); - - // XXX NextGEN Legacy wasn't handling watermarks or reflections at this stage, so we're forcefully disabling them to maintain compatibility - $params = array('watermark' => false, 'reflection' => false); - $rotation = null; - - if ($dir === 'CW') { - $rotation = 90; - } - else if ($dir === 'CCW') { - $rotation = -90; - } - // if you didn't define a rotation, we look for the orientation flag in EXIF - else if ($dir === false) { - $meta = new nggMeta( $image); - $exif = $meta->get_EXIF(); - - if (isset($exif['Orientation'])) { - - switch ($exif['Orientation']) { - case 5 : // vertical flip + 90 rotate right - $flip = 'V'; - case 6 : // 90 rotate right - $rotation = 90; - break; - case 7 : // horizontal flip + 90 rotate right - $flip = 'H'; - case 8 : // 90 rotate left - $rotation = -90; - break; - case 4 : // vertical flip - $flip = 'V'; - break; - case 3 : // 180 rotate left - $rotation = -180; - break; - case 2 : // horizontal flip - $flip = 'H'; - break; - case 1 : // no action in the case it doesn't need a rotation - default: - return '0'; - break; - } - } else + // XXX NextGEN Legacy wasn't handling watermarks or reflections at this stage, so we're forcefully disabling them to maintain compatibility + $params = array('watermark' => false, 'reflection' => false); + $rotation = null; + + if ($dir === 'CW') { + $rotation = 90; + } + else if ($dir === 'CCW') { + $rotation = -90; + } + // if you didn't define a rotation, we look for the orientation flag in EXIF + else if ($dir === false) { + $meta = new nggMeta( $image); + $exif = $meta->get_EXIF(); + + if (isset($exif['Orientation'])) { + + switch ($exif['Orientation']) { + case 5 : // vertical flip + 90 rotate right + $flip = 'V'; + case 6 : // 90 rotate right + $rotation = 90; + break; + case 7 : // horizontal flip + 90 rotate right + $flip = 'H'; + case 8 : // 90 rotate left + $rotation = -90; + break; + case 4 : // vertical flip + $flip = 'V'; + break; + case 3 : // 180 rotate left + $rotation = -180; + break; + case 2 : // horizontal flip + $flip = 'H'; + break; + case 1 : // no action in the case it doesn't need a rotation + default: + return '0'; + break; + } + } else return '0'; - } - - if ($rotation != null) { - $params['rotation'] = $rotation; - } - - if ($flip != null) { - $params['flip'] = $flip; - } - - $result = $storage->generate_image_size($image, 'full', $params); - - if (!$result) - { - // XXX there isn't any error handling unfortunately at the moment in the generate_thumbnail functions, need a way to return proper error status - return __('Error while rotating image.', 'nggallery'); - } - - // success - return '1'; - } - - /** - * nggAdmin::set_watermark() - set the watermark for the image - * - * @class nggAdmin - * @param object | int $image contain all information about the image or the id - * @return string result code - */ - function set_watermark($image) { - - if (is_object($image)) { - if (isset($image->id)) { - $image = $image->id; - } - elseif (isset($image->pid)) { - $image = $image->pid; - } - } - - $registry = C_Component_Registry::get_instance(); - $storage = $registry->get_utility('I_Gallery_Storage'); - - // XXX NextGEN Legacy was only handling watermarks at this stage, so we're forcefully disabling all else - $params = array('watermark' => true, 'reflection' => false, 'crop' => false); - $result = $storage->generate_image_size($image, 'full', $params); - - if (!$result) - { - // XXX there isn't any error handling unfortunately at the moment in the generate_thumbnail functions, need a way to return proper error status - return __('Error while applying watermark to image.', 'nggallery'); - } - - // success - return '1'; - } - - /** - * Recover image from backup copy and reprocess it - * - * @class nggAdmin - * @since 1.5.0 - * @param object | int $image contain all information about the image or the id - * @return string result code - */ - - function recover_image($image) { - - global $ngg; - - if ( is_numeric($image) ) - $image = nggdb::find_image( $image ); - - if ( !is_object( $image ) ) - return __('Object didn\'t contain correct data','nggallery'); - - if (!is_writable( $image->imagePath )) - return ' <strong>' . esc_html( $image->filename ) . __(' is not writeable','nggallery') . '</strong>'; - - if (!file_exists( $image->imagePath . '_backup' )) { - return ' <strong>'.__('File do not exists','nggallery').'</strong>'; - } - - if (!@copy( $image->imagePath . '_backup' , $image->imagePath) ) - return ' <strong>'.__('Couldn\'t restore original image','nggallery').'</strong>'; - - require_once(NGGALLERY_ABSPATH . '/lib/meta.php'); - - $meta_obj = new nggMeta( $image->pid ); - - $common = $meta_obj->get_common_meta(); - $common['saved'] = true; - $result = nggdb::update_image_meta($image->pid, $common); - - return '1'; - - } - - /** - * Add images to database - * - * @class nggAdmin - * @param int $galleryID - * @param array $imageslist - * @return array $image_ids Id's which are sucessful added - */ - function add_Images($galleryID, $imageslist) { - - global $wpdb, $ngg; + } + + if ($rotation != null) { + $params['rotation'] = $rotation; + } + + if ($flip != null) { + $params['flip'] = $flip; + } - $image_ids = array(); + $result = $storage->generate_image_size($image, 'full', $params); - if ( is_array($imageslist) ) { - foreach($imageslist as $picture) { + if (!$result) + { + // XXX there isn't any error handling unfortunately at the moment in the generate_thumbnail functions, need a way to return proper error status + return __('Error while rotating image.', 'nggallery'); + } + + // success + return '1'; + } + + /** + * nggAdmin::set_watermark() - set the watermark for the image + * + * @class nggAdmin + * @param object | int $image contain all information about the image or the id + * @return string result code + */ + static function set_watermark($image) { + + if (is_object($image)) { + if (isset($image->id)) { + $image = $image->id; + } + elseif (isset($image->pid)) { + $image = $image->pid; + } + } + + $storage = C_Gallery_Storage::get_instance(); + + // XXX NextGEN Legacy was only handling watermarks at this stage, so we're forcefully disabling all else + $params = array('watermark' => true, 'reflection' => false, 'crop' => false); + $result = $storage->generate_image_size($image, 'full', $params); + + if (!$result) + { + // XXX there isn't any error handling unfortunately at the moment in the generate_thumbnail functions, need a way to return proper error status + return __('Error while applying watermark to image.', 'nggallery'); + } + + // success + return '1'; + } + + /** + * Recover image from backup copy and reprocess it + * + * @class nggAdmin + * @since 1.5.0 + * @param object | int $image contain all information about the image or the id + * @return string result code + */ + + static function recover_image($image) { + + return C_Gallery_Storage::get_instance()->recover_image($image); + } + + /** + * Add images to database + * + * @class nggAdmin + * @param int $galleryID + * @param array $imageslist + * @return array $image_ids Id's which are sucessful added + */ + static function add_Images($galleryID, $imageslist) { + + global $wpdb, $ngg; + + $image_ids = array(); + + if ( is_array($imageslist) ) { + foreach($imageslist as $picture) { // filter function to rename/change/modify image before $picture = apply_filters('ngg_pre_add_new_image', $picture, $galleryID); - // strip off the extension of the filename - $path_parts = pathinfo( $picture ); - $alttext = ( !isset($path_parts['filename']) ) ? substr($path_parts['basename'], 0,strpos($path_parts['basename'], '.')) : $path_parts['filename']; - // save it to the database + // strip off the extension of the filename + $path_parts = M_I18n::mb_pathinfo( $picture ); + $alttext = ( !isset($path_parts['filename']) ) ? substr($path_parts['basename'], 0,strpos($path_parts['basename'], '.')) : $path_parts['filename']; + // save it to the database $pic_id = nggdb::add_image( $galleryID, $picture, '', $alttext ); - if ( !empty($pic_id) ) - $image_ids[] = $pic_id; + if (C_NextGen_Settings::get_instance()->imgBackup && !empty($pic_id)) + { + $storage = C_Gallery_Storage::get_instance(); + $storage->backup_image($pic_id); + } + + if ( !empty($pic_id) ) + $image_ids[] = $pic_id; - // add the metadata - nggAdmin::import_MetaData( $pic_id ); + // add the metadata + nggAdmin::import_MetaData( $pic_id ); - // auto rotate - nggAdmin::rotate_image( $pic_id ); + // auto rotate + nggAdmin::rotate_image( $pic_id ); - // Autoresize image if required + // Autoresize image if required if ($ngg->options['imgAutoResize']) { - $imagetmp = nggdb::find_image( $pic_id ); - $sizetmp = @getimagesize ( $imagetmp->imagePath ); - $widthtmp = $ngg->options['imgWidth']; - $heighttmp = $ngg->options['imgHeight']; - if (($sizetmp[0] > $widthtmp && $widthtmp) || ($sizetmp[1] > $heighttmp && $heighttmp)) { - nggAdmin::resize_image( $pic_id ); - } + $imagetmp = nggdb::find_image( $pic_id ); + $sizetmp = @getimagesize ( $imagetmp->imagePath ); + $widthtmp = $ngg->options['imgWidth']; + $heighttmp = $ngg->options['imgHeight']; + if (($sizetmp[0] > $widthtmp && $widthtmp) || ($sizetmp[1] > $heighttmp && $heighttmp)) { + nggAdmin::resize_image( $pic_id ); + } } - // action hook for post process after the image is added to the database - $image = array( 'id' => $pic_id, 'filename' => $picture, 'galleryID' => $galleryID); - do_action('ngg_added_new_image', $image); + // action hook for post process after the image is added to the database + $image = array( 'id' => $pic_id, 'filename' => $picture, 'galleryID' => $galleryID); + do_action('ngg_added_new_image', $image); - } - } // is_array + } + } // is_array // delete dirsize after adding new images delete_transient( 'dirsize_cache' ); - do_action('ngg_after_new_images_added', $galleryID, $image_ids ); + do_action('ngg_after_new_images_added', $galleryID, $image_ids ); + + return $image_ids; - return $image_ids; + } + + /** + * Import some meta data into the database (if avialable) + * + * @class nggAdmin + * @param array|int $imagesIds + * @return string result code + */ + static function import_MetaData($imagesIds) { - } + global $wpdb; - /** - * Import some meta data into the database (if avialable) - * - * @class nggAdmin - * @param array|int $imagesIds - * @return string result code - */ - static function import_MetaData($imagesIds) { + require_once(NGGALLERY_ABSPATH . '/lib/image.php'); - global $wpdb; + if (!is_array($imagesIds)) + $imagesIds = array($imagesIds); - require_once(NGGALLERY_ABSPATH . '/lib/image.php'); + foreach($imagesIds as $imageID) { - if (!is_array($imagesIds)) - $imagesIds = array($imagesIds); + // Get the image + $image = NULL; + if (is_int($imageID)) { + $image = C_Image_Mapper::get_instance()->find($imageID); + } + else $image = $imageID; - foreach($imagesIds as $imageID) { + if ($image) { - $image = nggdb::find_image( $imageID ); - if (!$image->error) { + $meta = nggAdmin::get_MetaData( $image); - $meta = nggAdmin::get_MetaData( $image->pid ); + // get the title + $alttext = empty( $meta['title'] ) ? $image->alttext : $meta['title']; - // get the title - $alttext = empty( $meta['title'] ) ? $image->alttext : $meta['title']; + // get the caption / description field + $description = empty( $meta['caption'] ) ? $image->description : $meta['caption']; - // get the caption / description field - $description = empty( $meta['caption'] ) ? $image->description : $meta['caption']; + // get the file date/time from exif + $timestamp = $meta['timestamp']; - // get the file date/time from exif - $timestamp = $meta['timestamp']; - // first update database - $result = $wpdb->query( - $wpdb->prepare("UPDATE $wpdb->nggpictures SET - alttext = %s, - description = %s, - imagedate = %s - WHERE pid = %d", $alttext, $description, $timestamp, $image->pid) ); + // first update database + $result = $wpdb->query( + $wpdb->prepare("UPDATE $wpdb->nggpictures SET + alttext = %s, + description = %s, + imagedate = %s + WHERE pid = %d", $alttext, $description, $timestamp, $image->pid) ); - if ($result === false) - return ' <strong>' . esc_html( $image->filename ) . ' ' . __('(Error : Couldn\'t not update data base)', 'nggallery') . '</strong>'; + if ($result === false) + return ' <strong>' . esc_html( $image->filename ) . ' ' . __('(Error : Couldn\'t not update data base)', 'nggallery') . '</strong>'; - //this flag will inform us that the import is already one time performed - $meta['common']['saved'] = true; - $result = nggdb::update_image_meta($image->pid, $meta['common']); + //this flag will inform us that the import is already one time performed + $meta['common']['saved'] = true; + $result = nggdb::update_image_meta($image->pid, $meta['common']); - if ($result === false) - return ' <strong>' . esc_html( $image->filename ) . ' ' . __('(Error : Couldn\'t not update meta data)', 'nggallery') . '</strong>'; + if ($result === false) + return ' <strong>' . esc_html( $image->filename ) . ' ' . __('(Error : Couldn\'t not update meta data)', 'nggallery') . '</strong>'; - // add the tags if we found some - if ($meta['keywords']) { - $taglist = explode(',', $meta['keywords']); - wp_set_object_terms($image->pid, $taglist, 'ngg_tag'); - } + // add the tags if we found some + if ($meta['keywords']) { + $taglist = explode(',', $meta['keywords']); + wp_set_object_terms($image->pid, $taglist, 'ngg_tag'); + } - } else - return ' <strong>' . esc_html( $image->filename ) . ' ' . __('(Error : Couldn\'t not find image)', 'nggallery') . '</strong>';// error check - } + } else + return ' <strong>' . esc_html( $image->filename ) . ' ' . __('(Error : Couldn\'t not find image)', 'nggallery') . '</strong>';// error check + } - return '1'; - } + return '1'; + } - /** - * nggAdmin::get_MetaData() - * - * @class nggAdmin - * @require NextGEN Meta class - * @param int $id image ID - * @return array metadata - */ - function get_MetaData($id) { + /** + * nggAdmin::get_MetaData() + * + * @class nggAdmin + * @require NextGEN Meta class + * @param int $id image ID + * @return array metadata + */ + static function get_MetaData($image_or_id) { - require_once(NGGALLERY_ABSPATH . '/lib/meta.php'); + require_once(NGGALLERY_ABSPATH . '/lib/meta.php'); - $meta = array(); + $meta = array(); - $pdata = new nggMeta( $id ); + $pdata = new nggMeta($image_or_id); - $meta['title'] = trim ( $pdata->get_META('title') ); - $meta['caption'] = trim ( $pdata->get_META('caption') ); - $meta['keywords'] = trim ( $pdata->get_META('keywords') ); - $meta['timestamp'] = $pdata->get_date_time(); - // this contain other useful meta information - $meta['common'] = $pdata->get_common_meta(); + $meta['title'] = trim ( $pdata->get_META('title') ); + $meta['caption'] = trim ( $pdata->get_META('caption') ); + $meta['keywords'] = trim ( $pdata->get_META('keywords') ); + $meta['timestamp'] = $pdata->get_date_time(); + // this contain other useful meta information + $meta['common'] = $pdata->get_common_meta(); // hook for addon plugin to add more meta fields $meta = apply_filters('ngg_get_image_metadata', $meta, $pdata); - return $meta; - - } + return $meta; - /** - * Maybe import some meta data to the database. The functions checks the flag 'saved' - * and if based on compat reason (pre V1.4.0) we save then some meta datas to the database - * - * @since V1.4.0 - * @param int $id - * @return result - */ - function maybe_import_meta( $id ) { + } - require_once(NGGALLERY_ABSPATH . '/lib/meta.php'); + /** + * Maybe import some meta data to the database. The functions checks the flag 'saved' + * and if based on compat reason (pre V1.4.0) we save then some meta datas to the database + * + * @since V1.4.0 + * @param int $id + * @return result + */ + function maybe_import_meta( $image_or_id ) { - $meta_obj = new nggMeta( $id ); + require_once(NGGALLERY_ABSPATH . '/lib/meta.php'); + $id = is_int($image_or_id) ? $image_or_id : $image_or_id->{$image_or_id->id_field}; + $meta_obj = new nggMeta( $image_or_id ); - if ( $meta_obj->image->meta_data['saved'] != true ) { + if ( $meta_obj->image->meta_data['saved'] != true ) { $common = $meta_obj->get_common_meta(); //this flag will inform us that the import is already one time performed $common['saved'] = true; - $result = nggdb::update_image_meta($id, $common); - } else - return false; - - return $result; - - } - - /** - * Unzip a file via the PclZip class - * - * @class nggAdmin - * @require PclZip class - * @param string $dir - * @param string $file - * @return bool - */ - function unzip($dir, $file) { - - if(! class_exists('PclZip')) - require_once(ABSPATH . 'wp-admin/includes/class-pclzip.php'); - - $archive = new PclZip($file); - - // extract all files in one folder - if ($archive->extract(PCLZIP_OPT_PATH, $dir, PCLZIP_OPT_REMOVE_ALL_PATH, - PCLZIP_CB_PRE_EXTRACT, 'ngg_getOnlyImages', - PCLZIP_CB_POST_EXTRACT, 'ngg_checkExtract') == 0) { - nggGallery::show_error( 'Error : ' . $archive->errorInfo(true) ); - return false; - } - - return true; - } - - /** - * nggAdmin::getOnlyImages() - * - * @class nggAdmin - * @param mixed $p_event - * @param mixed $p_header - * @return bool - */ - function getOnlyImages($p_event, &$p_header) { - // avoid null byte hack (THX to Dominic Szablewski) - if ( strpos($p_header['filename'], chr(0) ) !== false ) - $p_header['filename'] = substr ( $p_header['filename'], 0, strpos($p_header['filename'], chr(0) )); - // check for extension - $info = pathinfo($p_header['filename']); - // check for extension - $ext = apply_filters('ngg_allowed_file_types', array('jpeg', 'jpg', 'png', 'gif') ); - if ( in_array( strtolower($info['extension']), $ext) ) { - // For MAC skip the ".image" files - if ($info['basename']{0} == '.' ) - return 0; - else { - // sanitize the file name before we do further processing - $info['basename'] = sanitize_file_name( $info['basename'] ); - $p_header['filename'] = $info['dirname'] . '/' . $info['basename']; - return 1; - } - - } - // ----- all other files are skipped - else { - return 0; - } - } - - /** - * Import a ZIP file via a upload form or a URL - * - * @class nggAdmin - * @param int (optional) $galleryID - * @return bool $result - */ - function import_zipfile($galleryID) { - - global $ngg, $wpdb; - - if (nggWPMU::check_quota()) - return false; - - $defaultpath = $ngg->options['gallerypath']; - $zipurl = isset($_POST['zipurl']) ? $_POST['zipurl'] : ''; - - // if someone entered a URL try to upload it - if (!empty($zipurl) && (function_exists('curl_init')) ) { - - if (!(preg_match('/^http(s)?:\/\//i', $zipurl) )) { - nggGallery::show_error( __('No valid URL path ','nggallery') ); - return false; - } - - $temp_zipfile = tempnam('/tmp', 'zipimport_'); - $filename = basename($zipurl); - - //Grab the zip via cURL - $save = fopen ( $temp_zipfile, "w" ); - $ch = curl_init (); - curl_setopt ( $ch, CURLOPT_FILE, $save ); - curl_setopt ( $ch, CURLOPT_HEADER, 0 ); - curl_setopt ( $ch, CURLOPT_BINARYTRANSFER, 1 ); - curl_setopt ( $ch, CURLOPT_URL, $zipurl ); - $success = curl_exec ( $ch ); - if (!$success) - nggGallery::show_error( __('Import via cURL failed.','nggallery') . ' Error code ' . curl_errno( $ch ) . ' : ' . curl_error( $ch ) ); - curl_close ( $ch ); - fclose($save); - - if (!$success) - return false; - - } else { - - $temp_zipfile = $_FILES['zipfile']['tmp_name']; - $filename = $_FILES['zipfile']['name']; - - // Chrome return a empty content-type : http://code.google.com/p/chromium/issues/detail?id=6800 - if ( !preg_match('/chrome/i', $_SERVER['HTTP_USER_AGENT']) ) { - // check if file is a zip file - if ( !preg_match('/(zip|download|octet-stream)/i', $_FILES['zipfile']['type']) ) { - @unlink($temp_zipfile); // del temp file - nggGallery::show_error(__('Uploaded file was no or a faulty zip file ! The server recognized : ','nggallery') . $_FILES['zipfile']['type']); - return false; - } - } - } - - // should this unpacked into a new folder ? - if ( $galleryID == '0' ) { - //cleanup and take the zipfile name as folder name - $foldername = sanitize_title(strtok ($filename, '.')); - $foldername = rtrim($defaultpath, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . ltrim($foldername, DIRECTORY_SEPARATOR); - } else { - // get foldername if selected - $foldername = $wpdb->get_var("SELECT path FROM $wpdb->nggallery WHERE gid = '$galleryID' "); - } - - if ( empty($foldername) ) { - nggGallery::show_error( __('Could not get a valid foldername', 'nggallery') ); - return false; - } - - // set complete folder path - $newfolder = ABSPATH . $foldername; - - // check first if the traget folder exist - if (!is_dir($newfolder)) { - // create new directories - if (!wp_mkdir_p ($newfolder)) { - $message = sprintf(__('Unable to create directory %s. Is its parent directory writable by the server?', 'nggallery'), esc_html( $newfolder ) ); - nggGallery::show_error($message); - return false; - } - if (!wp_mkdir_p ($newfolder . '/thumbs')) { - nggGallery::show_error(__('Unable to create directory ', 'nggallery') . esc_html( $newfolder ). '/thumbs !'); - return false; - } - } - - // unzip and del temp file - $result = nggAdmin::unzip($newfolder, $temp_zipfile); - @unlink($temp_zipfile); - - if ($result) { - $message = __('Zip-File successfully unpacked','nggallery') . '<br />'; - - // parse now the folder and add to database - $message .= nggAdmin::import_gallery( $foldername ); - nggGallery::show_message($message); - } - - return true; - } + $result = nggdb::update_image_meta($id, $common); + } else + return false; + + return $result; + + } /** * nggAdmin::import_gallery() @@ -773,7 +576,7 @@ class nggAdmin{ * @param string $galleryfolder contains relative path to the gallery itself * @return void */ - function import_gallery($galleryfolder, $gallery_id=NULL) { + static function import_gallery($galleryfolder, $gallery_id=NULL) { global $wpdb, $user_ID; @@ -786,16 +589,15 @@ class nggAdmin{ $galleryfolder = untrailingslashit($galleryfolder); $fs = C_Fs::get_instance(); - if (is_null($gallery_id)) { $gallerypath = $fs->join_paths($fs->get_document_root('content'), $galleryfolder); } else { - $storage = C_Component_Registry::get_instance()->get_utility('I_Gallery_Storage'); + $storage = C_Gallery_Storage::get_instance(); $gallerypath = $storage->get_gallery_abspath($gallery_id); } if (!is_dir($gallerypath)) { - nggGallery::show_error(__('Directory', 'nggallery').' <strong>' . esc_html( $gallerypath ) .'</strong> '.__('doesn`t exist!', 'nggallery')); + nggGallery::show_error(sprintf(__("Directory <strong>%s</strong> doesn`t exist!", 'nggallery'), esc_html($gallerypath))); return ; } @@ -803,7 +605,7 @@ class nggAdmin{ $new_imageslist = nggAdmin::scandir($gallerypath); if (empty($new_imageslist)) { - nggGallery::show_message(__('Directory', 'nggallery').' <strong>' . esc_html( $gallerypath ) . '</strong> '.__('contains no pictures', 'nggallery')); + nggGallery::show_message(sprintf(__("Directory <strong>%s</strong> contains no pictures", 'nggallery'), esc_html($gallerypath))); return; } @@ -825,7 +627,10 @@ class nggAdmin{ else { do_action('ngg_created_new_gallery', $gallery_id); } - $created_msg = _n( 'Gallery', 'Galleries', 1, 'nggallery' ) . ' <strong>' . esc_html( $galleryname ) . '</strong> ' . __('successfully created!','nggallery') . '<br />'; + $created_msg = sprintf( + _n("Gallery <strong>%s</strong> successfully created!", 'Galleries <strong>%s</strong> successfully created!', 1, 'nggallery'), + esc_html($galleryname) + ); } // Look for existing image list @@ -862,7 +667,7 @@ class nggAdmin{ nggAdmin::do_ajax_operation( 'create_thumbnail' , $image_ids, __('Create new thumbnails','nggallery') ); //TODO:Message will not shown, because AJAX routine require more time, message should be passed to AJAX - $message = $created_msg . count($image_ids) .__(' picture(s) successfully added','nggallery'); + $message = $created_msg . sprintf(_n('%s picture successfully added', '%s pictures successfully added', count($image_ids), 'nggallery'), count($image_ids)); $message .= ' [<a href="' . admin_url() . 'admin.php?page=nggallery-manage-gallery&mode=edit&gid=' . $gallery_id . '" >'; $message .= __('Edit gallery','nggallery'); $message .= '</a>]'; @@ -872,425 +677,150 @@ class nggAdmin{ return; } - /** - * Function for uploading of images via the upload form - * - * @class nggAdmin - * @return void - */ - function upload_images() { - - global $nggdb; - - // WPMU action - if (nggWPMU::check_quota()) - return; - - // Images must be an array - $imageslist = array(); + /** + * Capability check. Check is the ID fit's to the user_ID + * + * @class nggAdmin + * @param int $check_ID is the user_id + * @return bool $result + */ + static function can_manage_this_gallery($check_ID) { - // get selected gallery - $galleryID = (int) $_POST['galleryselect']; + global $user_ID, $wp_roles; - if ($galleryID == 0) { - nggGallery::show_error(__('No gallery selected !','nggallery')); - return; - } + if ( !current_user_can('NextGEN Manage others gallery') ) { + // get the current user ID + get_currentuserinfo(); - // get the path to the gallery - $gallery = $nggdb->find_gallery($galleryID); + if ( $user_ID != $check_ID) + return false; + } - if ( empty($gallery->path) ){ - nggGallery::show_error(__('Failure in database, no gallery path set !','nggallery')); - return; - } + return true; - // read list of images - $dirlist = nggAdmin::scandir($gallery->abspath); + } - $imagefiles = $_FILES['imagefiles']; + /** + * Initate the Ajax operation + * + * @class nggAdmin + * @param string $operation name of the function which should be executed + * @param array $image_array + * @param string $title name of the operation + * @return string the javascript output + */ + static function do_ajax_operation( $operation, $image_array, $title = '' ) { - if (is_array($imagefiles)) { - foreach ($imagefiles['name'] as $key => $value) { + if ( !is_array($image_array) || empty($image_array) ) + return; - // look only for uploded files - if ($imagefiles['error'][$key] == 0) { + $js_array = implode('","', $image_array); - $temp_file = $imagefiles['tmp_name'][$key]; + // send out some JavaScript, which initate the ajax operation + ?> + <script type="text/javascript"> - //clean filename and extract extension - $filepart = nggGallery::fileinfo( $imagefiles['name'][$key] ); - $filename = $filepart['basename']; + Images = new Array("<?php echo $js_array; ?>"); - // check for allowed extension and if it's an image file - $ext = array('jpg', 'png', 'gif'); - if ( !in_array($filepart['extension'], $ext) || !@getimagesize($temp_file) ){ - nggGallery::show_error('<strong>' . esc_html( $imagefiles['name'][$key] ) . ' </strong>' . __('is no valid image file!','nggallery')); - continue; - } + nggAjaxOptions = { + operation: "<?php echo $operation; ?>", + ids: Images, + header: "<?php echo $title; ?>", + maxStep: Images.length + }; - // check if this filename already exist in the folder - $i = 0; - while ( in_array( $filename, $dirlist ) ) { - $filename = $filepart['filename'] . '_' . $i++ . '.' .$filepart['extension']; - } + jQuery(document).ready( function(){ + nggProgressBar.init( nggAjaxOptions ); + nggAjax.init( nggAjaxOptions ); + } ); + </script> - $dest_file = $gallery->abspath . '/' . $filename; + <?php + } - //check for folder permission - if ( !is_writeable($gallery->abspath) ) { - $message = sprintf(__('Unable to write to directory %s. Is this directory writable by the server?', 'nggallery'), esc_html($gallery->abspath) ); - nggGallery::show_error($message); - return; - } + /** + * nggAdmin::set_gallery_preview() - define a preview pic after the first upload, can be changed in the gallery settings + * + * @class nggAdmin + * @param int $galleryID + * @return void + */ + static function set_gallery_preview( $galleryID ) + { + $gallery_mapper = C_Gallery_Mapper::get_instance(); + if (($gallery = $gallery_mapper->find($galleryID))) { + if (!$gallery->previewpic) { + $image_mapper = C_Image_Mapper::get_instance(); + if (($image = $image_mapper->select()->where(array('galleryid = %d', $galleryID))->where(array('exclude != 1'))-> + order_by($image_mapper->get_primary_key_column())->limit(1)->run_query())) { + $gallery->previewpic = $image->{$image->id_field}; + $gallery_mapper->save($gallery); + } + } + } + } - // save temp file to gallery - if ( !@move_uploaded_file($temp_file, $dest_file) ){ - nggGallery::show_error(__('Error, the file could not be moved to : ','nggallery') . esc_html( $dest_file ) ); - nggAdmin::check_safemode( $gallery->abspath ); - continue; - } - if ( !nggAdmin::chmod($dest_file) ) { - nggGallery::show_error(__('Error, the file permissions could not be set','nggallery')); - continue; - } - - // add to imagelist & dirlist - $imageslist[] = $filename; - $dirlist[] = $filename; - - } - } - } - - if (count($imageslist) > 0) { - - // add images to database - $image_ids = nggAdmin::add_Images($galleryID, $imageslist); - - //create thumbnails - nggAdmin::do_ajax_operation( 'create_thumbnail' , $image_ids, __('Create new thumbnails','nggallery') ); - - //add the preview image if needed - nggAdmin::set_gallery_preview ( $galleryID ); - - nggGallery::show_message( count($image_ids) . __(' Image(s) successfully added','nggallery')); - } - - return; - - } - - /** - * Upload function will be called via the Flash uploader - * - * @class nggAdmin - * @param integer $galleryID - * @return string $result - */ - static function swfupload_image($galleryID = 0) { - - global $nggdb; - - if ($galleryID == 0) - return __('No gallery selected !', 'nggallery'); - - // WPMU action - if (nggWPMU::check_quota()) - return '0'; - - // Check the upload - if (!isset($_FILES['Filedata']) || !is_uploaded_file($_FILES['Filedata']['tmp_name']) || $_FILES['Filedata']['error'] != 0) - return __('Invalid upload. Error Code : ', 'nggallery') . $_FILES['Filedata']['error']; - - // get the filename and extension - $temp_file = $_FILES['Filedata']['tmp_name']; - - $filepart = nggGallery::fileinfo( $_FILES['Filedata']['name'] ); - $filename = $filepart['basename']; - - // check for allowed extension - $ext = apply_filters('ngg_allowed_file_types', array('jpeg', 'jpg', 'png', 'gif') ); - if (!in_array( strtolower( $filepart['extension'] ), $ext)) - return esc_html( $_FILES[$key]['name'] ) . __('is no valid image file!', 'nggallery'); - - // get the path to the gallery - $gallery = $nggdb->find_gallery( (int) $galleryID ); - if ( empty($gallery->path) ){ - @unlink($temp_file); - return __('Failure in database, no gallery path set !', 'nggallery'); - } - - // read list of images - $imageslist = nggAdmin::scandir( ABSPATH . $gallery->path ); - - // check if this filename already exist - $i = 0; - while (in_array($filename, $imageslist)) { - $filename = $filepart['filename'] . '_' . $i++ . '.' . $filepart['extension']; - } - - $dest_file = ABSPATH . $gallery->path . '/' . $filename; - - // save temp file to gallery - if ( !@move_uploaded_file($_FILES["Filedata"]['tmp_name'], $dest_file) ){ - nggAdmin::check_safemode(ABSPATH . $gallery->path); - return __('Error, the file could not be moved to : ','nggallery'). esc_html( $dest_file ); - } - - if ( !nggAdmin::chmod($dest_file) ) - return __('Error, the file permissions could not be set','nggallery'); - - return '0'; - } - - /** - * Set correct file permissions (taken from wp core) - * - * @class nggAdmin - * @param string $filename - * @return bool $result - */ - function chmod($filename = '') { - - $stat = @ stat( dirname($filename) ); - $perms = $stat['mode'] & 0000666; // Remove execute bits for files - if ( @chmod($filename, $perms) ) - return true; - - return false; - } - - /** - * Check UID in folder and Script - * Read http://www.php.net/manual/en/features.safe-mode.php to understand safe_mode - * - * @class nggAdmin - * @param string $foldername - * @return bool $result - */ - function check_safemode($foldername) { - - if ( SAFE_MODE ) { - - $script_uid = ( ini_get('safe_mode_gid') ) ? getmygid() : getmyuid(); - $folder_uid = fileowner($foldername); - - if ($script_uid != $folder_uid) { - $message = sprintf(__('SAFE MODE Restriction in effect! You need to create the folder <strong>%s</strong> manually','nggallery'), esc_html( $foldername ) ); - $message .= '<br />' . sprintf(__('When safe_mode is on, PHP checks to see if the owner (%s) of the current script matches the owner (%s) of the file to be operated on by a file function or its directory','nggallery'), $script_uid, $folder_uid ); - nggGallery::show_error($message); - return false; - } - } - - return true; - } - - /** - * Capability check. Check is the ID fit's to the user_ID - * - * @class nggAdmin - * @param int $check_ID is the user_id - * @return bool $result - */ - function can_manage_this_gallery($check_ID) { - - global $user_ID, $wp_roles; - - if ( !current_user_can('NextGEN Manage others gallery') ) { - // get the current user ID - get_currentuserinfo(); - - if ( $user_ID != $check_ID) - return false; - } - - return true; - - } - - /** - * Initate the Ajax operation - * - * @class nggAdmin - * @param string $operation name of the function which should be executed - * @param array $image_array - * @param string $title name of the operation - * @return string the javascript output - */ - function do_ajax_operation( $operation, $image_array, $title = '' ) { - - if ( !is_array($image_array) || empty($image_array) ) - return; - - $js_array = implode('","', $image_array); - - // send out some JavaScript, which initate the ajax operation - ?> - <script type="text/javascript"> - - Images = new Array("<?php echo $js_array; ?>"); - - nggAjaxOptions = { - operation: "<?php echo $operation; ?>", - ids: Images, - header: "<?php echo $title; ?>", - maxStep: Images.length - }; - - jQuery(document).ready( function(){ - nggProgressBar.init( nggAjaxOptions ); - nggAjax.init( nggAjaxOptions ); - } ); - </script> - - <?php - } - - /** - * nggAdmin::set_gallery_preview() - define a preview pic after the first upload, can be changed in the gallery settings - * - * @class nggAdmin - * @param int $galleryID - * @return void - */ - function set_gallery_preview( $galleryID ) { - - global $wpdb; - - $gallery = nggdb::find_gallery( $galleryID ); - - // in the case no preview image is setup, we do this now - if ($gallery->previewpic == 0) { - $firstImage = $wpdb->get_var("SELECT pid FROM $wpdb->nggpictures WHERE exclude != 1 AND galleryid = '$galleryID' ORDER by pid DESC limit 0,1"); - if ($firstImage) { - $wpdb->query("UPDATE $wpdb->nggallery SET previewpic = '$firstImage' WHERE gid = '$galleryID'"); - wp_cache_delete($galleryID, 'ngg_gallery'); - } - } - - return; - } - - /** - * Return a JSON coded array of Image ids for a requested gallery - * - * @class nggAdmin - * @param int $galleryID - * @return arry (JSON) - */ - function get_image_ids( $galleryID ) { - - if ( !function_exists('json_encode') ) - return(-2); - - $gallery = nggdb::get_ids_from_gallery($galleryID, 'pid', 'ASC', false); - - header('Content-Type: text/plain; charset=' . get_option('blog_charset'), true); - $output = json_encode($gallery); - - return $output; - } - - /** - * Decode upload error to normal message - * - * @class nggAdmin - * @access internal - * @param int $code php upload error code - * @return string message - */ - - function decode_upload_error( $code ) { - - switch ($code) { - case UPLOAD_ERR_INI_SIZE: - $message = __ ( 'The uploaded file exceeds the upload_max_filesize directive in php.ini', 'nggallery' ); - break; - case UPLOAD_ERR_FORM_SIZE: - $message = __ ( 'The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form', 'nggallery' ); - break; - case UPLOAD_ERR_PARTIAL: - $message = __ ( 'The uploaded file was only partially uploaded', 'nggallery' ); - break; - case UPLOAD_ERR_NO_FILE: - $message = __ ( 'No file was uploaded', 'nggallery' ); - break; - case UPLOAD_ERR_NO_TMP_DIR: - $message = __ ( 'Missing a temporary folder', 'nggallery' ); - break; - case UPLOAD_ERR_CANT_WRITE: - $message = __ ( 'Failed to write file to disk', 'nggallery' ); - break; - case UPLOAD_ERR_EXTENSION: - $message = __ ( 'File upload stopped by extension', 'nggallery' ); - break; - default: - $message = __ ( 'Unknown upload error', 'nggallery' ); - break; - } + /** + * Return a JSON coded array of Image ids for a requested gallery + * + * @class nggAdmin + * @param int $galleryID + * @return arry (JSON) + */ + static function get_image_ids( $galleryID ) { - return $message; - } + if ( !function_exists('json_encode') ) + return(-2); -} // END class nggAdmin + $gallery = nggdb::get_ids_from_gallery($galleryID, 'pid', 'ASC', false); -/** - * TODO: Cannot be member of a class ? Check PCLZIP later... - * - * @param mixed $p_event - * @param mixed $p_header - * @return - */ -function ngg_getOnlyImages($p_event, &$p_header) { - return nggAdmin::getOnlyImages($p_event, $p_header); -} + header('Content-Type: text/plain; charset=' . get_option('blog_charset'), true); + $output = json_encode($gallery); -/** - * Ensure after zip extraction that it could be only a image file - * - * @param mixed $p_event - * @param mixed $p_header - * @return 1 - */ -function ngg_checkExtract($p_event, &$p_header) { + return $output; + } - // look for valid extraction - if ($p_header['status'] == 'ok') { - // check if it's any image file, delete all other files - if ( !@getimagesize ( $p_header['filename'] )) - unlink($p_header['filename']); + /** + * Deprecated function, restored to fix compatibility with "NextGen Public Uploader" + * + * @deprecated + * @class nggAdmin + * @param string $filename + * @return bool $result + */ + function chmod($filename = '') + { + $stat = @stat(dirname($filename)); + $perms = $stat['mode'] & 0000666; + if (@chmod($filename, $perms)) + return true; + return false; } - return 1; -} +} // END class nggAdmin // XXX temporary...used as a quick fix to refresh I_Settings_Manager when the nextgen option is updated manually in order to run Hooks etc. function ngg_refreshSavedSettings() { - if (class_exists('C_Component_Registry')) - { - $registry = C_Component_Registry::get_instance(); - $settings = C_NextGen_Settings::get_instance(); - - if ($settings != null) - { - $width = $settings->thumbwidth; - $height = $settings->thumbheight; - $new_dimension = "{$width}x{$height}"; - $dimensions = (array) $settings->thumbnail_dimensions; - - if (!in_array($new_dimension, $dimensions)) { - $dimensions[] = $new_dimension; - $settings->thumbnail_dimensions = $dimensions; - $settings->save(); - - return true; - } - } - } - - return false; + if (class_exists('C_NextGen_Settings')) { + $settings = C_NextGen_Settings::get_instance(); + + if ($settings != null) + { + $width = $settings->thumbwidth; + $height = $settings->thumbheight; + $new_dimension = "{$width}x{$height}"; + $dimensions = (array) $settings->thumbnail_dimensions; + + if (!in_array($new_dimension, $dimensions)) { + $dimensions[] = $new_dimension; + $settings->thumbnail_dimensions = $dimensions; + $settings->save(); + + return true; + } + } + } + + return false; } -?> diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/manage-galleries.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/manage-galleries.php index c7d873d7bfb267203062bad6d12a896d5b654de7..414bf6205216d1a346b98036564fd576b065295d 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/manage-galleries.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/manage-galleries.php @@ -163,7 +163,6 @@ function nggallery_manage_gallery_main() { //--> </script> <div class="wrap"> - <?php //include('templates/social_media_buttons.php'); ?> <?php screen_icon( 'nextgen-gallery' ); ?> <h2><?php echo _n( 'Manage Galleries', 'Manage Galleries', 2, 'nggallery'); ?></h2> <form class="search-form" action="" method="get"> @@ -202,7 +201,7 @@ function nggallery_manage_gallery_main() { <?php $ngg->manage_page->pagination( 'top', $_GET['paged'], $total_number_of_galleries, $items_per_page ); ?> </div> - <table class="wp-list-table widefat fixed" cellspacing="0"> + <table class="wp-list-table widefat" cellspacing="0"> <thead> <tr> <?php $wp_list_table->print_column_headers(true); ?> @@ -260,10 +259,10 @@ if($gallerylist) { <td class="title column-title"> <?php if (nggAdmin::can_manage_this_gallery($gallery->author)) { ?> <a href="<?php echo wp_nonce_url( $ngg->manage_page->base_page . '&mode=edit&gid=' . $gid, 'ngg_editgallery')?>" class='edit' title="<?php _e('Edit'); ?>" > - <?php echo esc_html( nggGallery::i18n($name) ); ?> + <?php echo esc_html( M_I18N::translate($name) ); ?> </a> <?php } else { ?> - <?php echo esc_html( nggGallery::i18n($gallery->title) ); ?> + <?php echo esc_html( M_I18N::translate($gallery->title) ); ?> <?php } ?> <div class="row-actions"></div> </td> @@ -271,7 +270,7 @@ if($gallerylist) { break; case 'description' : ?> - <td <?php echo $attributes ?>><?php echo esc_html( nggGallery::i18n($gallery->galdesc) ); ?> </td> + <td <?php echo $attributes ?>><?php echo esc_html( M_I18N::translate($gallery->galdesc) ); ?> </td> <?php break; case 'author' : @@ -288,7 +287,7 @@ if($gallerylist) { $gallery->counter = count( $image_mapper->select($image_mapper->get_primary_key_column())-> where(array("galleryid = %d", $gallery->{$gallery->id_field}))-> - run_query(FALSE, TRUE) + run_query(FALSE, FALSE, TRUE) ); ?> @@ -419,7 +418,8 @@ class _NGG_Galleries_List_Table extends WP_List_Table { var $_screen; var $_columns; - function _NGG_Galleries_List_Table( $screen ) { + function __construct($screen) + { if ( is_string( $screen ) ) $screen = convert_to_screen( $screen ); diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/manage-images.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/manage-images.php index e671c90bba64a35dbf25a21ea779f68a234061b3..ade592ac5b77a7bc4c0bf1196837523596d9aa80 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/manage-images.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/manage-images.php @@ -44,15 +44,18 @@ function nggallery_picturelist($controller) { // look for pagination $_GET['paged'] = isset($_GET['paged']) && ($_GET['paged'] > 0) ? absint($_GET['paged']) : 1; - $items_per_page = 50; - - $start = ( $_GET['paged'] - 1 ) * $items_per_page; + $items_per_page = (!empty($_GET['items']) ? $_GET['items'] : apply_filters('ngg_manage_images_items_per_page', 50)); + if ($items_per_page == 'all') + $items_per_page = PHP_INT_MAX; + else + $items_per_page = (int)$items_per_page; + $start = ( $_GET['paged'] - 1 ) * $items_per_page; // get picture values $image_mapper = C_Image_Mapper::get_instance(); $total_number_of_images = count($image_mapper->select($image_mapper->get_primary_key_column())-> - where(array("galleryid = %d", $act_gid))->run_query(FALSE, TRUE)); + where(array("galleryid = %d", $act_gid))->run_query(FALSE, FALSE, TRUE)); $picturelist = $image_mapper->select()-> where(array("galleryid = %d", $act_gid))-> @@ -60,7 +63,7 @@ function nggallery_picturelist($controller) { limit($items_per_page, $start)->run_query(); // get the current author - $act_author_user = get_userdata( (int) $gallery->author ); + $act_author_user = get_userdata((int)$gallery->author); } @@ -107,10 +110,35 @@ function showDialog( windowId, title ) { jQuery("#" + windowId + ' .dialog-cancel').click(function() { jQuery( "#" + windowId ).dialog("close"); }); } +function setURLParam(param, paramVal) { + var url = window.location.href; + var params = ""; + var tmp = ""; + var tmpArray = url.split("?"); + var base = tmpArray[0]; + var additional = tmpArray[1]; + + if (additional) { + tmpArray = additional.split("&"); + for (i = 0; i < tmpArray.length; i++) { + if (tmpArray[i].split('=')[0] != param) { + params += tmp + tmpArray[i]; + tmp = "&"; + } + } + } + + return base + "?" + params + tmp + "" + param + "=" + paramVal; +} + jQuery(function (){ jQuery('span.tooltip, label.tooltip').tooltip(); + jQuery('#ngg-manage-images-items-per-page').on('change', function() { + window.location.href = setURLParam('items', jQuery(this).val()); + }); + // load a content via ajax jQuery('a.ngg-dialog').click(function() { var dialogs = jQuery('.ngg-overlay-dialog:visible'); @@ -263,7 +291,6 @@ jQuery(document).ready( function($) { //--> </script> <div class="wrap"> -<?php //include('templates/social_media_buttons.php'); ?> <?php screen_icon( 'nextgen-gallery' ); ?> <?php if ($is_search) :?> <h2><?php printf( __('Search results for “%s”', 'nggallery'), esc_html( get_search_query() ) ); ?></h2> @@ -283,7 +310,7 @@ jQuery(document).ready( function($) { <input type="hidden" name="page" value="manage-images" /> <?php else :?> -<h2><?php echo _n( 'Gallery', 'Galleries', 1, 'nggallery' ); ?> : <?php echo esc_html ( nggGallery::i18n($gallery->title) ); ?></h2> +<h2><?php echo _n( 'Gallery', 'Galleries', 1, 'nggallery' ); ?> : <?php echo esc_html ( M_I18N::translate($gallery->title) ); ?></h2> <br style="clear: both;" /> @@ -292,10 +319,11 @@ jQuery(document).ready( function($) { <input type="hidden" name="page" value="manage-images" /> <?php if ( nggGallery::current_user_can( 'NextGEN Edit gallery options' )) : ?> -<div id="poststuff"> +<div id="poststuff" class="meta-box-sortables"> <?php wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false ); ?> <div id="gallerydiv" class="postbox <?php echo postbox_classes('gallerydiv', 'ngg-manage-gallery'); ?>" > - <h3><?php _e('Gallery settings', 'nggallery') ?><small> (<?php _e('Click here for more settings', 'nggallery') ?>)</small></h3> + <div class="handlediv" title="<?php esc_attr_e('Click to toggle'); ?>"><br/></div> + <h3 class="hndl"><span><?php _e('Gallery settings', 'nggallery') ?><small> (<?php _e('Click here for more settings', 'nggallery') ?>)</small></span></h3> <div class="inside"> <?php $controller->render_gallery_fields(); ?> @@ -314,7 +342,37 @@ jQuery(document).ready( function($) { <?php endif; ?> <div class="tablenav top ngg-tablenav"> - <?php $ngg->manage_page->pagination( 'top', $_GET['paged'], $total_number_of_images, $items_per_page ); ?> + + <?php + $ngg->manage_page->pagination( 'top', $_GET['paged'], $total_number_of_images, $items_per_page ); + + $items_per_page_array = apply_filters('ngg_manage_images_items_per_page_array', array( + '25' => __(' 25', 'nggallery'), + '50' => __(' 50', 'nggallery'), + '75' => __(' 75', 'nggallery'), + '100' => __('100', 'nggallery'), + '200' => __('200', 'nggallery'), + 'all' => __('All', 'nggallery') + )); + ?> + + <select id="ngg-manage-images-items-per-page"> + <?php foreach ($items_per_page_array as $val => $label) { ?> + <?php + $selected = ''; + if(!empty($_GET['items']) && $val == $_GET['items']) + $selected = 'selected'; + elseif (empty($_GET['items']) && $val == $items_per_page) + $selected = 'selected'; + ?> + <option value="<?php echo esc_attr($val); ?>" <?php echo $selected; ?>> + <?php echo esc_html($label); ?> + </option> + <?php } ?> + </select> + <label id="ngg-manage-images-items-per-page-label" + for="ngg-manage-images-items-per-page"><?php echo __('Images per page:', 'nggallery'); ?></label> + <div class="alignleft actions"> <select id="bulkaction" name="bulkaction"> <option value="no_action" ><?php _e("Bulk actions",'nggallery'); ?></option> @@ -355,12 +413,16 @@ if($picturelist) { $thumbsize = ''; $storage = C_Gallery_Storage::get_instance(); + $gallery_mapper = C_Gallery_Mapper::get_instance(); if ($ngg->options['thumbfix']) $thumbsize = 'width="' . $ngg->options['thumbwidth'] . '" height="' . $ngg->options['thumbheight'] . '"'; foreach($picturelist as $picture) { + if (empty($gallery) && $is_search) + $gallery = $gallery_mapper->find($picture->galleryid, FALSE); + //for search result we need to check the capatibiliy if ( !nggAdmin::can_manage_this_gallery($gallery->author) && $is_search ) continue; @@ -529,7 +591,8 @@ class _NGG_Images_List_Table extends WP_List_Table { var $_screen; var $_columns; - function _NGG_Images_List_Table( $screen ) { + function __construct($screen) + { if ( is_string( $screen ) ) $screen = convert_to_screen( $screen ); @@ -584,5 +647,3 @@ class _NGG_Images_List_Table extends WP_List_Table { } } - -?> diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/manage-sort.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/manage-sort.php index 65e0fc80562ca5f57f1ade0e08947beab346773a..5bf51a2449b80f819585e6ff92702ecbd91dfa77 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/manage-sort.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/manage-sort.php @@ -19,7 +19,6 @@ function nggallery_sortorder($galleryID = 0){ if (is_array($sortArray)){ $neworder = array(); foreach($sortArray as $pid) { - $pid = substr($pid, 4); // get id from "pid-x" $neworder[] = (int) $pid; } $sortindex = 1; @@ -27,8 +26,7 @@ function nggallery_sortorder($galleryID = 0){ $wpdb->query("UPDATE $wpdb->nggpictures SET sortorder = '$sortindex' WHERE pid = $pic_id"); $sortindex++; } - - C_Photocrati_Cache::flush('displayed_gallery_rendering'); + C_Photocrati_Transient_Manager::flush('displayed_gallery_rendering'); do_action('ngg_gallery_sort', $galleryID); @@ -59,27 +57,23 @@ function nggallery_sortorder($galleryID = 0){ ?> <script type="text/javascript"> - // seralize the ImageOrder - function saveImageOrder() - { - var serial = ""; - var objects = document.getElementsByTagName('div'); - for(var no=0;no<objects.length;no++){ - if(objects[no].className=='imageBox' || objects[no].className=='imageBoxHighlighted'){ - if (serial.length > 0) serial = serial + '&' - serial = serial + "sortArray[]=" + objects[no].id; - } - } - jQuery('input[name=sortorder]').val(serial); - // debug( 'This is the new order of the images(IDs) : <br>' + orderString ); - - } jQuery(document).ready(function($) { if ($(this).data('ready')) return; // Enable sorting $(".jqui-sortable").sortable({items: 'div.imageBox'}); + $('#sortGallery').submit(function(e){ + var serial = ""; + var $images = $('div.imageBox'); + for (var i=0; i<$images.length; i++) { + var image_id = $images[i].id.split('-').pop(); + if (serial.length > 0) serial = serial + '&'; + serial = serial + "sortArray[]=" + image_id; + } + $('input[name=sortorder]').val(serial); + }); + // Listen for events in other frames if (window.Frame_Event_Publisher) { Frame_Event_Publisher.listen_for('attach_to_post:manage_galleries attach_to_post:manage_images', function(){ @@ -93,12 +87,12 @@ function nggallery_sortorder($galleryID = 0){ </script> <div class="wrap"> - <form id="sortGallery" method="POST" action="<?php echo $clean_url ?>" onsubmit="saveImageOrder()" accept-charset="utf-8"> + <form id="sortGallery" method="POST" action="<?php echo $clean_url ?>" accept-charset="utf-8"> <h2><?php _e('Sort Gallery', 'nggallery') ?></h2> <div class="tablenav"> <div class="alignleft actions"> <?php wp_nonce_field('ngg_updatesortorder') ?> - <input class="button-primary action" type="submit" name="updateSortorder" onclick="saveImageOrder()" value="<?php _e('Update Sort Order', 'nggallery') ?>" /> + <input class="button-primary action" type="submit" name="updateSortorder" value="<?php _e('Update Sort Order', 'nggallery') ?>" /> </div> <div class="alignright actions"> <a href="<?php echo nextgen_esc_url( $back_url ); ?>" class="button"><?php _e('Back to gallery', 'nggallery'); ?></a> diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/manage.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/manage.php index 9d7611ed6596bb345f3315c3b9a491c749c1f76e..e9889967dc11b4c75207da2a48c659e7f97a89e6 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/manage.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/manage.php @@ -12,8 +12,8 @@ class nggManageGallery { var $search_result = false; // initiate the manage page - function nggManageGallery() { - + function __construct() + { // GET variables if( isset($_GET['gid']) ) { $this->gid = (int) $_GET['gid']; @@ -78,7 +78,7 @@ class nggManageGallery { $image = $nggdb->find_image( $this->pid ); if ($image) { if ($ngg->options['deleteImg']) { - $storage = C_Component_Registry::get_instance()->get_utility('I_Gallery_Storage'); + $storage = $storage = C_Gallery_Storage::get_instance(); $storage->delete_image($this->pid); } $mapper = C_Image_Mapper::get_instance(); @@ -97,10 +97,9 @@ class nggManageGallery { if ($this->mode == 'recoverpic') { check_admin_referer('ngg_recoverpicture'); - $image = $nggdb->find_image( $this->pid ); + // bring back the old image - nggAdmin::recover_image($image); - nggAdmin::create_thumbnail($image); + nggAdmin::recover_image($this->pid); nggGallery::show_message(__('Operation successful. Please clear your browser cache.',"nggallery")); @@ -187,9 +186,9 @@ class nggManageGallery { function render_image_column_3($output='', $picture=array()) { - $image_url = nextgen_esc_url(add_query_arg('i', mt_rand(), $picture->imageURL)); - $thumb_url = nextgen_esc_url(add_query_arg('i', mt_rand(), $picture->thumbURL)); - $filename = esc_attr($picture->filename); + $image_url = add_query_arg('i', mt_rand(), $picture->imageURL); + $thumb_url = add_query_arg('i', mt_rand(), $picture->thumbURL); + $filename = esc_attr($picture->filename); $output = array(); @@ -214,7 +213,7 @@ class nggManageGallery { $output = array(); - $output[] = "<div><strong><a href='{$image_url}' class='thickbox' title='{$filename}'>{$caption}</a></strong></div>"; + $output[] = "<div><strong><a href='{$image_url}' class='thickbox' title='{$caption}'>{$filename}</a></strong></div>"; $output[] = '<div class="meta">'. esc_html($date) . '</div>'; $output[] = "<div class='meta'>{$pixels}</div>"; $output[] = "<label for='exclude_{$picture->pid}'>"; @@ -576,36 +575,18 @@ class nggManageGallery { nggAdmin::do_ajax_operation( 'gallery_import_metadata' , $_POST['doaction'], __('Import metadata','nggallery') ); break; case 'delete_gallery': - // Delete gallery - if ( is_array($_POST['doaction']) ) { - $deleted = false; - foreach ( $_POST['doaction'] as $id ) { - // get the path to the gallery - $gallery = nggdb::find_gallery($id); - if ($gallery){ - //TODO:Remove also Tag reference, look here for ids instead filename - $imagelist = $wpdb->get_col("SELECT pid FROM $wpdb->nggpictures WHERE galleryid = '$gallery->gid' "); - if ($ngg->options['deleteImg']) { - $storage = C_Component_Registry::get_instance()->get_utility('I_Gallery_Storage'); - if (is_array($imagelist)) { - foreach ($imagelist as $pid) { - $storage->delete_image($pid); - } - } - // delete folder. abspath provided by nggdb::find_gallery() - $fs = C_Fs::get_instance(); - @rmdir($fs->join_paths($gallery->abspath, 'thumbs')); - @rmdir($fs->join_paths($gallery->abspath, 'dynamic')); - @rmdir($gallery->abspath); - } - } - do_action('ngg_delete_gallery', $id); - $deleted = nggdb::delete_gallery( $id ); - } - - if($deleted) - nggGallery::show_message(__('Gallery deleted successfully ', 'nggallery')); + // Delete gallery + if (is_array($_POST['doaction'])) + { + $deleted = FALSE; + $mapper = C_Gallery_Mapper::get_instance(); + foreach ($_POST['doaction'] as $id) { + if ($mapper->destroy($id, TRUE)) + $deleted = TRUE; + } + if ($deleted) + nggGallery::show_message(__('Gallery deleted successfully ', 'nggallery')); } break; } @@ -692,11 +673,11 @@ class nggManageGallery { $image = $nggdb->find_image( $imageID ); if ($image) { if ($ngg->options['deleteImg']) { - $storage = C_Component_Registry::get_instance()->get_utility('I_Gallery_Storage'); + $storage = C_Gallery_Storage::get_instance(); $storage->delete_image($image->pid); } do_action('ngg_delete_picture', $image->pid); - $delete_pic = nggdb::delete_image( $image->pid ); + $delete_pic = C_Image_Mapper::get_instance()->destroy($image->pid); } } if($delete_pic) @@ -847,36 +828,39 @@ class nggManageGallery { nggAdmin::import_gallery($gallerypath, $this->gid); } - if (isset ($_POST['addnewpage'])) { - // Add a new page - - check_admin_referer('ngg_updategallery'); - - $parent_id = esc_attr($_POST['parent_id']); - $gallery_title = esc_attr($_POST['title']); - $gallery_name = $wpdb->get_var("SELECT name FROM $wpdb->nggallery WHERE gid = '$this->gid' "); - - // Create a WP page - global $user_ID; - - $page['post_type'] = 'page'; - $page['post_content'] = '[nggallery id=' . $this->gid . ']'; - $page['post_parent'] = $parent_id; - $page['post_author'] = $user_ID; - $page['post_status'] = 'publish'; - $page['post_title'] = $gallery_title == '' ? $gallery_name : $gallery_title; - $page = apply_filters('ngg_add_new_page', $page, $this->gid); - - $gallery_pageid = wp_insert_post ($page); - if ($gallery_pageid != 0) { - $result = $wpdb->query("UPDATE $wpdb->nggallery SET title= '$gallery_title', pageid = '$gallery_pageid' WHERE gid = '$this->gid'"); - wp_cache_delete($this->gid, 'ngg_gallery'); - nggGallery::show_message( __('New gallery page ID','nggallery'). ' ' . $gallery_pageid . ' -> <strong>' . $gallery_title . '</strong> ' .__('created','nggallery') ); - } + // Add a new page + if (isset ($_POST['addnewpage'])) + { + check_admin_referer('ngg_updategallery'); + + $parent_id = esc_attr($_POST['parent_id']); + $gallery_title = esc_attr($_POST['title']); + $mapper = C_Gallery_Mapper::get_instance(); + $gallery = $mapper->find($this->gid); + $gallery_name = $gallery->name; + + // Create a WP page + global $user_ID; + + $page['post_type'] = 'page'; + $page['post_content'] = apply_filters('ngg_add_page_shortcode', '[nggallery id="' . $this->gid . '"]' ); + $page['post_parent'] = $parent_id; + $page['post_author'] = $user_ID; + $page['post_status'] = 'publish'; + $page['post_title'] = $gallery_title == '' ? $gallery_name : $gallery_title; + $page = apply_filters('ngg_add_new_page', $page, $this->gid); + + $gallery_pageid = wp_insert_post ($page); + if ($gallery_pageid != 0) + { + $gallery->pageid = $gallery_pageid; + $mapper->save($gallery); + nggGallery::show_message(__('New gallery page ID', 'nggallery') . ' ' . $gallery_pageid . ' -> <strong>' . $gallery_title . '</strong> ' . __('created','nggallery')); + } do_action('ngg_gallery_addnewpage', $this->gid); - } - } + } + } /** * Publish a new post with the shortcode from the selected image diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/media-upload.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/media-upload.php index 43c009971232f3e2249f68a2cce02b3a56255f62..40a010602ebb8462c37e6f57e0a3c8d59456617d 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/media-upload.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/media-upload.php @@ -1,15 +1,15 @@ <?php /** - * @title Add action/filter for the upload tab + * @title Add action/filter for the upload tab * @author Alex Rabe - * + * */ function ngg_wp_upload_tabs ($tabs) { $newtab = array('nextgen' => __('NextGEN Gallery','nggallery')); - + return array_merge($tabs,$newtab); } @@ -19,7 +19,7 @@ function media_upload_nextgen() { // Not in use $errors = false; - + // Generate TinyMCE HTML output if ( isset($_POST['send']) ) { $keys = array_keys($_POST['send']); @@ -46,7 +46,7 @@ function media_upload_nextgen() { $height = $displayed_gallery->display_settings['height']; // Build output - if ($image['size'] == "thumbnail") + if ($image['size'] == "thumbnail") $html = "<img src='{$image['thumb']}' alt='{$alttext}' class='{$class}' />"; else $html = ''; @@ -54,10 +54,10 @@ function media_upload_nextgen() { // Wrap the link to the fullsize image around $html = "<a {$thumbcode} href='{$image['url']}' title='{$clean_description}'>{$html}</a>"; - if ($image['size'] == "full") + if ($image['size'] == "full") $html = "<img src='{$image['url']}' alt='{$alttext}' class='{$class}' />"; - if ($image['size'] == "singlepic") + if ($image['size'] == "singlepic") $html = "[singlepic id={$send_id} w={$width} h={$height} float={$image['align']}]"; media_upload_nextgen_save_image(); @@ -85,7 +85,7 @@ function media_upload_nextgen_save_image() { if ( !empty($_POST['image']) ) foreach ( $_POST['image'] as $image_id => $image ) { // create a unique slug - $image_slug = nggdb::get_unique_slug( sanitize_title( $image['alttext'] ), 'image' ); + $image_slug = nggdb::get_unique_slug( sanitize_title( $image['alttext'] ), 'image' ); $wpdb->query( $wpdb->prepare ("UPDATE $wpdb->nggpictures SET image_slug= '%s', alttext= '%s', description = '%s' WHERE pid = %d", $image_slug, $image['alttext'], $image['description'], $image_id)); wp_cache_delete($image_id, 'ngg_image'); } @@ -131,7 +131,7 @@ function media_upload_nextgen_form($errors) { ?> -<script type="text/javascript"> +<script type="text/javascript"> <!-- function NGGSetAsThumbnail(id, nonce){ var $link = jQuery('a#ngg-post-thumbnail-' + id); @@ -147,6 +147,14 @@ function media_upload_nextgen_form($errors) { } else if (str == '-1') { // image removed } else { + jQuery('a.ngg-post-thumbnail').each(function() { jQuery(this).show(); }); + jQuery('a.ngg-post-thumbnail-standin').each(function() { jQuery(this).hide(); }); + $link.hide(); + + var $dummy = $link.next(); + $dummy.attr('id', 'wp-post-thumbnail-' + str); + $dummy.show(); + WPSetAsThumbnail(str, nonce); } } @@ -158,9 +166,9 @@ function media_upload_nextgen_form($errors) { <form id="filter" action="" method="get"> <input type="hidden" name="type" value="<?php echo esc_attr( $GLOBALS['type'] ); ?>" /> <input type="hidden" name="tab" value="<?php echo esc_attr( $GLOBALS['tab'] ); ?>" /> -<?php +<?php if ($chromeless) -{ +{ ?> <input type="hidden" name="chromeless" value="<?php echo esc_attr( $chromeless ); ?>" /> <?php @@ -280,13 +288,14 @@ if ($chromeless) if ( $calling_post_id && current_theme_supports( 'post-thumbnails', get_post_type( $calling_post_id ) ) ) $ajax_nonce = wp_create_nonce( "set_post_thumbnail-$calling_post_id" ); echo "<a class='ngg-post-thumbnail' id='ngg-post-thumbnail-" . $picid . "' href='#' onclick='NGGSetAsThumbnail(\"$picid\", \"$ajax_nonce\");return false;'>" . esc_html__( 'Use as featured image' ) . "</a>"; + echo "<a class='ngg-post-thumbnail-standin' href='#' style='display:none;'></a>"; ?> - <button type="submit" class="button" value="1" name="send[<?php echo $picid ?>]"><?php esc_html_e( 'Insert into Post' ); ?></button> + <button type="submit" id="ngg-mlitp-<?php echo esc_attr($picid); ?>" class="button ngg-mlitp" value="1" name="send[<?php echo $picid ?>]"><?php esc_html_e( 'Insert into Post' ); ?></button> </td> </tr> </tbody></table> </div> - <?php + <?php } } ?> @@ -298,6 +307,16 @@ if ($chromeless) <input type="hidden" name="select_gal" id="select_gal" value="<?php echo (int) $galleryID; ?>" /> </form> +<script type="text/javascript"> +jQuery(function($) { + // reset the media library modal tab + var mlmodal = top.wp.media.editor.get(); + mlmodal.on('close', function() { + mlmodal.setState('insert'); + }); +}); +</script> + <?php } ?> diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/overview.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/overview.php index 14852ebe5e0cd1ddf992f9c9547eee73c5c8f204..e43394d29e2f05fdd67a4bb3aa2bf91674175604 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/overview.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/overview.php @@ -8,73 +8,73 @@ if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You * @return mixed content */ function nggallery_admin_overview() { - ?> - <div class="wrap ngg-wrap"> + ?> + <div class="wrap ngg-wrap"> <?php screen_icon( 'nextgen-gallery' ); ?> - <h2><?php _e('NextGEN Gallery Overview', 'nggallery') ?></h2> + <h2><?php _e('NextGEN Gallery Overview', 'nggallery') ?></h2> <?php if (version_compare(PHP_VERSION, '5.0.0', '<')) ngg_check_for_PHP5(); ?> - <div id="dashboard-widgets-container" class="ngg-overview"> - <div id="dashboard-widgets" class="metabox-holder"> - <div id="post-body"> - <div id="dashboard-widgets-main-content"> - <div class="postbox-container" id="main-container" style="width:75%;"> - <?php do_meta_boxes('ngg_overview', 'left', ''); ?> - </div> - <div class="postbox-container" id="side-container" style="width:24%;"> - <?php do_meta_boxes('ngg_overview', 'right', ''); ?> - </div> - </div> - </div> - </div> - </div> - </div> - <script type="text/javascript"> - //<![CDATA[ + <div id="dashboard-widgets-container" class="ngg-overview"> + <div id="dashboard-widgets" class="metabox-holder"> + <div id="post-body"> + <div id="dashboard-widgets-main-content"> + <div class="postbox-container" id="main-container" style="width:75%;"> + <?php do_meta_boxes('ngg_overview', 'left', ''); ?> + </div> + <div class="postbox-container" id="side-container" style="width:24%;"> + <?php do_meta_boxes('ngg_overview', 'right', ''); ?> + </div> + </div> + </div> + </div> + </div> + </div> + <script type="text/javascript"> + //<![CDATA[ var ajaxWidgets, ajaxPopulateWidgets; jQuery(document).ready( function($) { - // These widgets are sometimes populated via ajax - ajaxWidgets = [ - 'dashboard_primary', - 'dashboard_plugins' - ]; - - ajaxPopulateWidgets = function(el) { - show = function(id, i) { - var p, e = $('#' + id + ' div.inside:visible').find('.widget-loading'); - if ( e.length ) { - p = e.parent(); - setTimeout( function(){ - p.load('admin-ajax.php?action=ngg_dashboard&jax=' + id, '', function() { - p.hide().slideDown('normal', function(){ - $(this).css('display', ''); - if ( 'dashboard_plugins' == id && $.isFunction(tb_init) ) - tb_init('#dashboard_plugins a.thickbox'); - }); - }); - }, i * 500 ); - } - }; - if ( el ) { - el = el.toString(); - if ( $.inArray(el, ajaxWidgets) != -1 ) - show(el, 0); - } else { - $.each( ajaxWidgets, function(i) { - show(this, i); - }); - } - }; - ajaxPopulateWidgets(); + // These widgets are sometimes populated via ajax + ajaxWidgets = [ + 'dashboard_primary', + 'dashboard_plugins' + ]; + + ajaxPopulateWidgets = function(el) { + show = function(id, i) { + var p, e = $('#' + id + ' div.inside:visible').find('.widget-loading'); + if ( e.length ) { + p = e.parent(); + setTimeout( function(){ + p.load('admin-ajax.php?action=ngg_dashboard&jax=' + id, '', function() { + p.hide().slideDown('normal', function(){ + $(this).css('display', ''); + if ( 'dashboard_plugins' == id && $.isFunction(tb_init) ) + tb_init('#dashboard_plugins a.thickbox'); + }); + }); + }, i * 500 ); + } + }; + if ( el ) { + el = el.toString(); + if ( $.inArray(el, ajaxWidgets) != -1 ) + show(el, 0); + } else { + $.each( ajaxWidgets, function(i) { + show(this, i); + }); + } + }; + ajaxPopulateWidgets(); } ); - jQuery(document).ready( function($) { - // postboxes setup - postboxes.add_postbox_toggles('ngg-overview'); - }); - //]]> - </script> - <?php + jQuery(document).ready( function($) { + // postboxes setup + postboxes.add_postbox_toggles('ngg-overview'); + }); + //]]> + </script> +<?php } /** @@ -92,45 +92,45 @@ if ( !is_multisite() || is_super_admin() ) { function ngg_AboutMetaBox() { - ?> + ?> <div id="poststuff"> - <p><?php _e("NextGEN Gallery is one of the most popular Wordpress plugins of all time with over 9 million downloads. It is developed and supported by Photocrati Media. We'd like to offer a special thanks to Alex Rabe, who first developed the plugin and maintained it through 2011.", 'nggallery'); ?></p> + <p><?php _e("NextGEN Gallery is one of the most popular WordPress plugins of all time with over 12 million downloads.", 'nggallery'); _e(" It is developed and supported by Photocrati Media. We'd like to offer a special thanks to Alex Rabe, who first developed the plugin and maintained it through 2011.", 'nggallery'); ?></p> <p><?php _e("<strong>NEED HELP?</strong> If you need help or assistance please visit the <a href='http://wordpress.org/support/plugin/nextgen-gallery'>NextGEN Gallery forums on WordPress.org</a>. Please note that we actively monitor and participate in the forums, but given that NextGEN Gallery is a free product, we don't guarantee replies to support queries.", 'nggallery'); ?></p> <p><?php _e("<strong>EXTENDING NEXTGEN?</strong> There are many third party plugins that add displays and functionality for NextGEN Gallery. See our <a href='http://www.nextgen-gallery.com/nextgen-gallery-extension-plugins/'>Complete List of NextGEN Extension Plugins</a>.", 'nggallery'); ?></p> - </div> - <?php + </div> +<?php } function ngg_likeThisMetaBox() { - echo '<p>'; + echo '<p>'; echo sprintf(__('This plugin is primarily developed, maintained, supported and documented by <a href="%s" target="_blank">Photocrati Media</a> with a lot of love & effort. Any kind of contribution would be highly appreciated. Thanks!', 'nggallery'), 'http://www.photocrati.com/'); - echo '</p><ul>'; + echo '</p><ul>'; $url = 'http://wordpress.org/plugins/nextgen-gallery/' ; echo "<li style='padding-left: 38px; background:transparent url(" . NGGALLERY_URLPATH . "admin/images/icon-rating.png ) no-repeat scroll center left; background-position: 16px 50%; text-decoration: none;'><a href='{$url}' target='_blank'>"; _e('Please click "Works" on WordPress.org', 'nggallery'); echo "</a></li>"; - $url = 'http://wordpress.org/plugins/nextgen-gallery/' ; - echo "<li style='padding-left: 38px; background:transparent url(" . NGGALLERY_URLPATH . "admin/images/icon-rating.png ) no-repeat scroll center left; background-position: 16px 50%; text-decoration: none;'><a href='{$url}' target='_blank'>"; - _e('Give it a good rating on WordPress.org', 'nggallery'); - echo "</a></li>"; + $url = 'http://wordpress.org/plugins/nextgen-gallery/' ; + echo "<li style='padding-left: 38px; background:transparent url(" . NGGALLERY_URLPATH . "admin/images/icon-rating.png ) no-repeat scroll center left; background-position: 16px 50%; text-decoration: none;'><a href='{$url}' target='_blank'>"; + _e('Give it a good rating on WordPress.org', 'nggallery'); + echo "</a></li>"; - $url = 'http://www.nextgen-gallery.com'; - echo "<li style='padding-left: 38px; background:transparent url(" . NGGALLERY_URLPATH . "admin/images/nextgen.png ) no-repeat scroll center left; background-position: 16px 50%; text-decoration: none;'><a href='{$url}' target='_blank'>"; - _e("Visit the plugin homepage", 'nggallery'); - echo "</a></li>"; + $url = 'http://www.nextgen-gallery.com'; + echo "<li style='padding-left: 38px; background:transparent url(" . NGGALLERY_URLPATH . "admin/images/nextgen.png ) no-repeat scroll center left; background-position: 16px 50%; text-decoration: none;'><a href='{$url}' target='_blank'>"; + _e("Visit the plugin homepage", 'nggallery'); + echo "</a></li>"; - $url = 'http://www.nextgen-gallery.com/languages/'; - echo "<li style='padding-left: 38px; background:transparent url(" . NGGALLERY_URLPATH . "admin/images/icon-translate.png ) no-repeat scroll center left; background-position: 16px 50%; text-decoration: none;'><a href='{$url}' target='_blank'>"; - _e("Help translating it", 'nggallery'); - echo "</a></li>"; + $url = 'http://www.nextgen-gallery.com/languages/'; + echo "<li style='padding-left: 38px; background:transparent url(" . NGGALLERY_URLPATH . "admin/images/icon-translate.png ) no-repeat scroll center left; background-position: 16px 50%; text-decoration: none;'><a href='{$url}' target='_blank'>"; + _e("Help translating it", 'nggallery'); + echo "</a></li>"; - echo '</ul>'; + echo '</ul>'; - echo ' - <div class="social" style="text-align:center;margin:15px 0 10px 0;"><span class="social" style="margin-right:5px;"><a target="_blank" href="http://twitter.com/NextGENGallery"><img title="Follow NextGEN on Twitter" alt="Twitter" src="' . NGGALLERY_URLPATH . 'admin/images/twitter.png"></a></span><span class="social" style="margin-right:5px;"><a target="_blank" href="http://www.facebook.com/NextGENGallery"><img title="Like NextGEN on Facebook" alt="Facebook" src="' . NGGALLERY_URLPATH . 'admin/images/facebook.png"></a></span><span class="social"><a target="_blank" href="http://plus.google.com/101643895780935290171"><img title="Add NextGEN to your circles" alt="GooglePlus" src="' . NGGALLERY_URLPATH . 'admin/images/googleplus.png"></a></span></div>'; + echo ' + <div class="social" style="text-align:center;margin:15px 0 10px 0;"><span class="social" style="margin-right:5px;"><a target="_blank" href="http://twitter.com/NextGENGallery"><img title="Follow NextGEN on Twitter" alt="Twitter" src="' . NGGALLERY_URLPATH . 'admin/images/twitter.png"></a></span><span class="social" style="margin-right:5px;"><a target="_blank" href="http://www.facebook.com/NextGENGallery"><img title="Like NextGEN on Facebook" alt="Facebook" src="' . NGGALLERY_URLPATH . 'admin/images/facebook.png"></a></span><span class="social"><a target="_blank" href="http://plus.google.com/101643895780935290171"><img title="Add NextGEN to your circles" alt="GooglePlus" src="' . NGGALLERY_URLPATH . 'admin/images/googleplus.png"></a></span></div>'; } /** @@ -139,20 +139,20 @@ function ngg_likeThisMetaBox() { * @return void */ function ngg_overview_server() { -?> -<div id="dashboard_server_settings" class="dashboard-widget-holder wp_dashboard_empty"> - <div class="ngg-dashboard-widget"> - <div class="dashboard-widget-content"> - <ul class="settings"> - <?php ngg_get_serverinfo(); ?> - </ul> - <p><strong><?php _e('Graphic Library', 'nggallery'); ?></strong></p> - <ul class="settings"> - <?php ngg_gd_info(); ?> - </ul> - </div> + ?> + <div id="dashboard_server_settings" class="dashboard-widget-holder wp_dashboard_empty"> + <div class="ngg-dashboard-widget"> + <div class="dashboard-widget-content"> + <ul class="settings"> + <?php ngg_get_serverinfo(); ?> + </ul> + <p><strong><?php _e('Graphic Library', 'nggallery'); ?></strong></p> + <ul class="settings"> + <?php ngg_gd_info(); ?> + </ul> + </div> + </div> </div> -</div> <?php } @@ -166,42 +166,42 @@ function ngg_widget_overview_donators() { } function ngg_overview_donators() { - global $ngg; - - $i = 0; - $list = ''; - - $supporter = nggAdminPanel::get_remote_array($ngg->donators); - - // Ensure that this is a array - if ( !is_array($supporter) ) - return _e('Thanks to all donators...', 'nggallery'); - - $supporter = array_reverse($supporter); - - foreach ($supporter as $name => $url) { - $i++; - if ($url) - $list .= "<li><a href=\"$url\">$name</a></li>\n"; - else - $list .= "<li>$name</li>"; - if ($i > 4) - break; - } - -?> -<div id="dashboard_server_settings" class="dashboard-widget-holder"> - <div class="ngg-dashboard-widget"> - <div class="dashboard-widget-content"> - <ul class="settings"> - <?php echo $list; ?> - </ul> - <p class="textright"> - <a class="button" href="admin.php?page=nggallery-about#donators"><?php _e('View all', 'nggallery'); ?></a> - </p> - </div> + global $ngg; + + $i = 0; + $list = ''; + + $supporter = nggAdminPanel::get_remote_array($ngg->donators); + + // Ensure that this is a array + if ( !is_array($supporter) ) + return _e('Thanks to all donators...', 'nggallery'); + + $supporter = array_reverse($supporter); + + foreach ($supporter as $name => $url) { + $i++; + if ($url) + $list .= "<li><a href=\"$url\">$name</a></li>\n"; + else + $list .= "<li>$name</li>"; + if ($i > 4) + break; + } + + ?> + <div id="dashboard_server_settings" class="dashboard-widget-holder"> + <div class="ngg-dashboard-widget"> + <div class="dashboard-widget-content"> + <ul class="settings"> + <?php echo $list; ?> + </ul> + <p class="textright"> + <a class="button" href="admin.php?page=nggallery-about#donators"><?php _e('View all', 'nggallery'); ?></a> + </p> + </div> + </div> </div> -</div> <?php } @@ -215,61 +215,61 @@ function ngg_widget_overview_news() { } function ngg_overview_news(){ -?> -<div class="rss-widget"> - <?php - $rss = @fetch_feed( 'http://feeds.feedburner.com/nextgen-gallery' ); - - if ( is_object($rss) ) { - - if ( is_wp_error($rss) ) { - echo '<p>' . sprintf(__('Newsfeed could not be loaded. Check the <a href="%s">front page</a> to check for updates.', 'nggallery'), 'http://www.nextgen-gallery.com/') . '</p>'; - return; - } - - echo '<ul>'; - foreach ( $rss->get_items(0, 3) as $item ) { - $link = $item->get_link(); - while ( stristr($link, 'http') != $link ) - $link = substr($link, 1); - $link = nextgen_esc_url(strip_tags($link)); - $title = esc_attr(strip_tags($item->get_title())); - if ( empty($title) ) - $title = __('Untitled'); - - $desc = str_replace( array("\n", "\r"), ' ', esc_attr( strip_tags( @html_entity_decode( $item->get_description(), ENT_QUOTES, get_option('blog_charset') ) ) ) ); - $desc = wp_html_excerpt( $desc, 360 ); - - // Append ellipsis. Change existing [...] to […]. - if ( '[...]' == substr( $desc, -5 ) ) - $desc = substr( $desc, 0, -5 ) . '[…]'; - elseif ( '[…]' != substr( $desc, -10 ) ) - $desc .= ' […]'; - - $desc = esc_html( $desc ); - - $date = $item->get_date(); - $diff = ''; - - if ( $date ) { - - $diff = human_time_diff( strtotime($date, time()) ); - - if ( $date_stamp = strtotime( $date ) ) - $date = ' <span class="rss-date">' . date_i18n( get_option( 'date_format' ), $date_stamp ) . '</span>'; - else - $date = ''; - } - ?> - <li><a class="rsswidget" title="" target="_blank" href='<?php echo $link; ?>'><?php echo $title; ?></a> - <span class="rss-date"><?php echo $date; ?></span> - <div class="rssSummary"><strong><?php echo $diff; ?></strong> - <?php echo $desc; ?></div></li> + ?> + <div class="rss-widget"> <?php + $rss = @fetch_feed( 'http://feeds.feedburner.com/nextgen-gallery' ); + + if ( is_object($rss) ) { + + if ( is_wp_error($rss) ) { + echo '<p>' . sprintf(__('Newsfeed could not be loaded. Check the <a href="%s">front page</a> to check for updates.', 'nggallery'), 'http://www.nextgen-gallery.com/') . '</p>'; + return; + } + + echo '<ul>'; + foreach ( $rss->get_items(0, 3) as $item ) { + $link = $item->get_link(); + while ( stristr($link, 'http') != $link ) + $link = substr($link, 1); + $link = nextgen_esc_url(strip_tags($link)); + $title = esc_attr(strip_tags($item->get_title())); + if ( empty($title) ) + $title = __('Untitled'); + + $desc = str_replace( array("\n", "\r"), ' ', esc_attr( strip_tags( @html_entity_decode( $item->get_description(), ENT_QUOTES, get_option('blog_charset') ) ) ) ); + $desc = wp_html_excerpt( $desc, 360 ); + + // Append ellipsis. Change existing [...] to […]. + if ( '[...]' == substr( $desc, -5 ) ) + $desc = substr( $desc, 0, -5 ) . '[…]'; + elseif ( '[…]' != substr( $desc, -10 ) ) + $desc .= ' […]'; + + $desc = esc_html( $desc ); + + $date = $item->get_date(); + $diff = ''; + + if ( $date ) { + + $diff = human_time_diff( strtotime($date, time()) ); + + if ( $date_stamp = strtotime( $date ) ) + $date = ' <span class="rss-date">' . date_i18n( get_option( 'date_format' ), $date_stamp ) . '</span>'; + else + $date = ''; + } + ?> + <li><a class="rsswidget" title="" target="_blank" href='<?php echo $link; ?>'><?php echo $title; ?></a> + <span class="rss-date"><?php echo $date; ?></span> + <div class="rssSummary"><strong><?php echo $diff; ?></strong> - <?php echo $desc; ?></div></li> + <?php + } + echo '</ul>'; } - echo '</ul>'; - } - ?> -</div> + ?> + </div> <?php } @@ -279,64 +279,64 @@ function ngg_overview_news(){ * @return void */ function ngg_overview_right_now() { - global $wpdb; - $images = intval( $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->nggpictures") ); - $galleries = intval( $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->nggallery") ); - $albums = intval( $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->nggalbum") ); -?> -<style type='text/css'> - #ngg_overview_right_now p { - padding: 0 0 6px 10px; - margin: 0; - } - #ngg_overview_right_now table { - margin-left: 10px; - } - #ngg_overview_right_now td { - padding: 4px; - } - #ngg_overview_right_now td:first-child { - font-size: 16px; - } -</style> -<div class="table table_content" id='ngg_overview_right_now'> - <p><?php _e('At a Glance', 'nggallery'); ?></p> - <table> - <tbody> - <tr class="first"> - <td class="first b"><a href="admin.php?page=ngg_addgallery"><?php echo $images; ?></a></td> - <td class="t"><a href="admin.php?page=ngg_addgallery"><?php echo _n( 'Image', 'Images', $images, 'nggallery' ); ?></a></td> - <td class="b"></td> - <td class="last"></td> - </tr> - <tr> - <td class="first b"><a href="admin.php?page=nggallery-manage-gallery"><?php echo $galleries; ?></a></td> - <td class="t"><a href="admin.php?page=nggallery-manage-gallery"><?php echo _n( 'Gallery', 'Galleries', $galleries, 'nggallery' ); ?></a></td> - <td class="b"></td> - <td class="last"></td> - </tr> - <tr> - <td class="first b"><a href="admin.php?page=nggallery-manage-album"><?php echo $albums; ?></a></td> - <td class="t"><a href="admin.php?page=nggallery-manage-album"><?php echo _n( 'Album', 'Albums', $albums, 'nggallery' ); ?></a></td> - <td class="b"></td> - <td class="last"></td> - </tr> - </tbody> - </table> -</div> -<div class="versions" style="padding-top:14px"> - <br class="clear" /> -</div> -<?php -if ( is_multisite() ) - ngg_dashboard_quota(); + global $wpdb; + $images = intval( $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->nggpictures") ); + $galleries = intval( $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->nggallery") ); + $albums = intval( $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->nggalbum") ); + ?> + <style type='text/css'> + #ngg_overview_right_now p { + padding: 0 0 6px 10px; + margin: 0; + } + #ngg_overview_right_now table { + margin-left: 10px; + } + #ngg_overview_right_now td { + padding: 4px; + } + #ngg_overview_right_now td:first-child { + font-size: 16px; + } + </style> + <div class="table table_content" id='ngg_overview_right_now'> + <p><?php _e('At a Glance', 'nggallery'); ?></p> + <table> + <tbody> + <tr class="first"> + <td class="first b"><a href="admin.php?page=ngg_addgallery"><?php echo $images; ?></a></td> + <td class="t"><a href="admin.php?page=ngg_addgallery"><?php echo _n( 'Image', 'Images', $images, 'nggallery' ); ?></a></td> + <td class="b"></td> + <td class="last"></td> + </tr> + <tr> + <td class="first b"><a href="admin.php?page=nggallery-manage-gallery"><?php echo $galleries; ?></a></td> + <td class="t"><a href="admin.php?page=nggallery-manage-gallery"><?php echo _n( 'Gallery', 'Galleries', $galleries, 'nggallery' ); ?></a></td> + <td class="b"></td> + <td class="last"></td> + </tr> + <tr> + <td class="first b"><a href="admin.php?page=nggallery-manage-album"><?php echo $albums; ?></a></td> + <td class="t"><a href="admin.php?page=nggallery-manage-album"><?php echo _n( 'Album', 'Albums', $albums, 'nggallery' ); ?></a></td> + <td class="b"></td> + <td class="last"></td> + </tr> + </tbody> + </table> + </div> + <div class="versions" style="padding-top:14px"> + <br class="clear" /> + </div> + <?php + if ( is_multisite() ) + ngg_dashboard_quota(); } // Display File upload quota on dashboard function ngg_dashboard_quota() { - if ( get_site_option( 'upload_space_check_disabled' ) ) - return; + if ( get_site_option( 'upload_space_check_disabled' ) ) + return; if ( !wpmu_enable_function('wpmuQuotaCheck') ) return; @@ -345,37 +345,37 @@ function ngg_dashboard_quota() { $fs = C_Fs::get_instance(); $dir = $fs->join_paths($fs->get_document_root('content'), $settings->gallerypath); - $quota = get_space_allowed(); - $used = get_dirsize( $dir ) / 1024 / 1024; - - if ( $used > $quota ) - $percentused = '100'; - else - $percentused = ( $used / $quota ) * 100; - $used_color = ( $percentused < 70 ) ? ( ( $percentused >= 40 ) ? 'waiting' : 'approved' ) : 'spam'; - $used = round( $used, 2 ); - $percentused = number_format( $percentused ); - - ?> - <p class="sub musub" style="position:static" ><?php _e( 'Storage Space' ); ?></p> - <div class="table table_content musubtable"> - <table> - <tr class="first"> - <td class="first b b-posts"><?php printf( __( '<a href="%1$s" title="Manage Uploads" class="musublink">%2$sMB</a>' ), nextgen_esc_url( admin_url( 'admin.php?page=nggallery-manage-gallery' ) ), $quota ); ?></td> - <td class="t posts"><?php _e( 'Space Allowed' ); ?></td> - </tr> - </table> - </div> - <div class="table table_discussion musubtable"> - <table> - <tr class="first"> - <td class="b b-comments"><?php printf( __( '<a href="%1$s" title="Manage Uploads" class="musublink">%2$sMB (%3$s%%)</a>' ), nextgen_esc_url( admin_url( 'admin.php?page=nggallery-manage-gallery' ) ), $used, $percentused ); ?></td> - <td class="last t comments <?php echo $used_color;?>"><?php _e( 'Space Used' );?></td> - </tr> - </table> - </div> - <br class="clear" /> - <?php + $quota = get_space_allowed(); + $used = get_dirsize( $dir ) / 1024 / 1024; + + if ( $used > $quota ) + $percentused = '100'; + else + $percentused = ( $used / $quota ) * 100; + $used_color = ( $percentused < 70 ) ? ( ( $percentused >= 40 ) ? 'waiting' : 'approved' ) : 'spam'; + $used = round( $used, 2 ); + $percentused = number_format( $percentused ); + + ?> + <p class="sub musub" style="position:static" ><?php _e( 'Storage Space' ); ?></p> + <div class="table table_content musubtable"> + <table> + <tr class="first"> + <td class="first b b-posts"><?php printf( __( '<a href="%1$s" title="Manage Uploads" class="musublink">%2$sMB</a>' ), nextgen_esc_url( admin_url( 'admin.php?page=nggallery-manage-gallery' ) ), $quota ); ?></td> + <td class="t posts"><?php _e( 'Space Allowed' ); ?></td> + </tr> + </table> + </div> + <div class="table table_discussion musubtable"> + <table> + <tr class="first"> + <td class="b b-comments"><?php printf( __( '<a href="%1$s" title="Manage Uploads" class="musublink">%2$sMB (%3$s%%)</a>' ), nextgen_esc_url( admin_url( 'admin.php?page=nggallery-manage-gallery' ) ), $used, $percentused ); ?></td> + <td class="last t comments <?php echo $used_color;?>"><?php _e( 'Space Used' );?></td> + </tr> + </table> + </div> + <br class="clear" /> +<?php } /** @@ -385,19 +385,19 @@ function ngg_dashboard_quota() { */ function ngg_gd_info() { - if(function_exists("gd_info")){ - $info = gd_info(); - $keys = array_keys($info); - for($i=0; $i<count($keys); $i++) { - if(is_bool($info[$keys[$i]])) - echo "<li> " . $keys[$i] ." : <span>" . ngg_gd_yesNo($info[$keys[$i]]) . "</span></li>\n"; - else - echo "<li> " . $keys[$i] ." : <span>" . $info[$keys[$i]] . "</span></li>\n"; - } - } - else { - echo '<h4>'.__('No GD support', 'nggallery').'!</h4>'; - } + if(function_exists("gd_info")){ + $info = gd_info(); + $keys = array_keys($info); + for($i=0; $i<count($keys); $i++) { + if(is_bool($info[$keys[$i]])) + echo "<li> " . $keys[$i] ." : <span>" . ngg_gd_yesNo($info[$keys[$i]]) . "</span></li>\n"; + else + echo "<li> " . $keys[$i] ." : <span>" . $info[$keys[$i]] . "</span></li>\n"; + } + } + else { + echo '<h4>'.__('No GD support', 'nggallery').'!</h4>'; + } } /** @@ -407,10 +407,10 @@ function ngg_gd_info() { * @return return 'Yes' | 'No' */ function ngg_gd_yesNo( $bool ){ - if($bool) - return __('Yes', 'nggallery'); - else - return __('No', 'nggallery'); + if($bool) + return __('Yes', 'nggallery'); + else + return __('No', 'nggallery'); } @@ -422,65 +422,65 @@ function ngg_gd_yesNo( $bool ){ */ function ngg_get_serverinfo() { - global $wpdb, $ngg; - // Get MYSQL Version - $sqlversion = $wpdb->get_var("SELECT VERSION() AS version"); - // GET SQL Mode - $mysqlinfo = $wpdb->get_results("SHOW VARIABLES LIKE 'sql_mode'"); - if (is_array($mysqlinfo)) $sql_mode = $mysqlinfo[0]->Value; - if (empty($sql_mode)) $sql_mode = __('Not set', 'nggallery'); - // Get PHP Safe Mode - if(ini_get('safe_mode')) $safe_mode = __('On', 'nggallery'); - else $safe_mode = __('Off', 'nggallery'); - // Get PHP allow_url_fopen - if(ini_get('allow_url_fopen')) $allow_url_fopen = __('On', 'nggallery'); - else $allow_url_fopen = __('Off', 'nggallery'); - // Get PHP Max Upload Size - if (function_exists('wp_max_upload_size')) $upload_max = strval(round( (int) wp_max_upload_size() / (1024 * 1024) )) . 'M'; - else if(ini_get('upload_max_filesize')) $upload_max = ini_get('upload_max_filesize'); - else $upload_max = __('N/A', 'nggallery'); - // Get PHP Output buffer Size - if(ini_get('pcre.backtrack_limit')) $backtrack_limit = ini_get('pcre.backtrack_limit'); - else $backtrack_limit = __('N/A', 'nggallery'); - // Get PHP Max Post Size - if(ini_get('post_max_size')) $post_max = ini_get('post_max_size'); - else $post_max = __('N/A', 'nggallery'); - // Get PHP Max execution time - if(ini_get('max_execution_time')) $max_execute = ini_get('max_execution_time'); - else $max_execute = __('N/A', 'nggallery'); - // Get PHP Memory Limit - if(ini_get('memory_limit')) $memory_limit = $ngg->memory_limit; - else $memory_limit = __('N/A', 'nggallery'); - // Get actual memory_get_usage - if (function_exists('memory_get_usage')) $memory_usage = round(memory_get_usage() / 1024 / 1024, 2) . __(' MByte', 'nggallery'); - else $memory_usage = __('N/A', 'nggallery'); - // required for EXIF read - if (is_callable('exif_read_data')) $exif = __('Yes', 'nggallery'). " ( V" . substr(phpversion('exif'),0,4) . ")" ; - else $exif = __('No', 'nggallery'); - // required for meta data - if (is_callable('iptcparse')) $iptc = __('Yes', 'nggallery'); - else $iptc = __('No', 'nggallery'); - // required for meta data - if (is_callable('xml_parser_create')) $xml = __('Yes', 'nggallery'); - else $xml = __('No', 'nggallery'); - -?> - <li><?php _e('Operating System', 'nggallery'); ?> : <span><?php echo PHP_OS; ?> (<?php echo (PHP_INT_SIZE * 8) ?> Bit)</span></li> - <li><?php _e('Server', 'nggallery'); ?> : <span><?php echo $_SERVER["SERVER_SOFTWARE"]; ?></span></li> - <li><?php _e('Memory usage', 'nggallery'); ?> : <span><?php echo $memory_usage; ?></span></li> - <li><?php _e('MYSQL Version', 'nggallery'); ?> : <span><?php echo $sqlversion; ?></span></li> - <li><?php _e('SQL Mode', 'nggallery'); ?> : <span><?php echo $sql_mode; ?></span></li> - <li><?php _e('PHP Version', 'nggallery'); ?> : <span><?php echo PHP_VERSION; ?></span></li> - <li><?php _e('PHP Safe Mode', 'nggallery'); ?> : <span><?php echo $safe_mode; ?></span></li> - <li><?php _e('PHP Allow URL fopen', 'nggallery'); ?> : <span><?php echo $allow_url_fopen; ?></span></li> - <li><?php _e('PHP Memory Limit', 'nggallery'); ?> : <span><?php echo $memory_limit; ?></span></li> - <li><?php _e('PHP Max Upload Size', 'nggallery'); ?> : <span><?php echo $upload_max; ?></span></li> - <li><?php _e('PHP Max Post Size', 'nggallery'); ?> : <span><?php echo $post_max; ?></span></li> - <li><?php _e('PCRE Backtracking Limit', 'nggallery'); ?> : <span><?php echo $backtrack_limit; ?></span></li> - <li><?php _e('PHP Max Script Execute Time', 'nggallery'); ?> : <span><?php echo $max_execute; ?>s</span></li> - <li><?php _e('PHP Exif support', 'nggallery'); ?> : <span><?php echo $exif; ?></span></li> - <li><?php _e('PHP IPTC support', 'nggallery'); ?> : <span><?php echo $iptc; ?></span></li> - <li><?php _e('PHP XML support', 'nggallery'); ?> : <span><?php echo $xml; ?></span></li> + global $wpdb, $ngg; + // Get MYSQL Version + $sqlversion = $wpdb->get_var("SELECT VERSION() AS version"); + // GET SQL Mode + $mysqlinfo = $wpdb->get_results("SHOW VARIABLES LIKE 'sql_mode'"); + if (is_array($mysqlinfo)) $sql_mode = $mysqlinfo[0]->Value; + if (empty($sql_mode)) $sql_mode = __('Not set', 'nggallery'); + // Get PHP Safe Mode + if(ini_get('safe_mode')) $safe_mode = __('On', 'nggallery'); + else $safe_mode = __('Off', 'nggallery'); + // Get PHP allow_url_fopen + if(ini_get('allow_url_fopen')) $allow_url_fopen = __('On', 'nggallery'); + else $allow_url_fopen = __('Off', 'nggallery'); + // Get PHP Max Upload Size + if (function_exists('wp_max_upload_size')) $upload_max = strval(round( (int) wp_max_upload_size() / (1024 * 1024) )) . 'M'; + else if(ini_get('upload_max_filesize')) $upload_max = ini_get('upload_max_filesize'); + else $upload_max = __('N/A', 'nggallery'); + // Get PHP Output buffer Size + if(ini_get('pcre.backtrack_limit')) $backtrack_limit = ini_get('pcre.backtrack_limit'); + else $backtrack_limit = __('N/A', 'nggallery'); + // Get PHP Max Post Size + if(ini_get('post_max_size')) $post_max = ini_get('post_max_size'); + else $post_max = __('N/A', 'nggallery'); + // Get PHP Max execution time + if(ini_get('max_execution_time')) $max_execute = ini_get('max_execution_time'); + else $max_execute = __('N/A', 'nggallery'); + // Get PHP Memory Limit + if(ini_get('memory_limit')) $memory_limit = $ngg->memory_limit; + else $memory_limit = __('N/A', 'nggallery'); + // Get actual memory_get_usage + if (function_exists('memory_get_usage')) $memory_usage = round(memory_get_usage() / 1024 / 1024, 2) . __(' MByte', 'nggallery'); + else $memory_usage = __('N/A', 'nggallery'); + // required for EXIF read + if (is_callable('exif_read_data')) $exif = __('Yes', 'nggallery'). " ( V" . substr(phpversion('exif'),0,4) . ")" ; + else $exif = __('No', 'nggallery'); + // required for meta data + if (is_callable('iptcparse')) $iptc = __('Yes', 'nggallery'); + else $iptc = __('No', 'nggallery'); + // required for meta data + if (is_callable('xml_parser_create')) $xml = __('Yes', 'nggallery'); + else $xml = __('No', 'nggallery'); + + ?> + <li><?php _e('Operating System', 'nggallery'); ?> : <span><?php echo PHP_OS; ?> (<?php echo (PHP_INT_SIZE * 8) ?> Bit)</span></li> + <li><?php _e('Server', 'nggallery'); ?> : <span><?php echo $_SERVER["SERVER_SOFTWARE"]; ?></span></li> + <li><?php _e('Memory usage', 'nggallery'); ?> : <span><?php echo $memory_usage; ?></span></li> + <li><?php _e('MYSQL Version', 'nggallery'); ?> : <span><?php echo $sqlversion; ?></span></li> + <li><?php _e('SQL Mode', 'nggallery'); ?> : <span><?php echo $sql_mode; ?></span></li> + <li><?php _e('PHP Version', 'nggallery'); ?> : <span><?php echo PHP_VERSION; ?></span></li> + <li><?php _e('PHP Safe Mode', 'nggallery'); ?> : <span><?php echo $safe_mode; ?></span></li> + <li><?php _e('PHP Allow URL fopen', 'nggallery'); ?> : <span><?php echo $allow_url_fopen; ?></span></li> + <li><?php _e('PHP Memory Limit', 'nggallery'); ?> : <span><?php echo $memory_limit; ?></span></li> + <li><?php _e('PHP Max Upload Size', 'nggallery'); ?> : <span><?php echo $upload_max; ?></span></li> + <li><?php _e('PHP Max Post Size', 'nggallery'); ?> : <span><?php echo $post_max; ?></span></li> + <li><?php _e('PCRE Backtracking Limit', 'nggallery'); ?> : <span><?php echo $backtrack_limit; ?></span></li> + <li><?php _e('PHP Max Script Execute Time', 'nggallery'); ?> : <span><?php echo $max_execute; ?>s</span></li> + <li><?php _e('PHP Exif support', 'nggallery'); ?> : <span><?php echo $exif; ?></span></li> + <li><?php _e('PHP IPTC support', 'nggallery'); ?> : <span><?php echo $iptc; ?></span></li> + <li><?php _e('PHP XML support', 'nggallery'); ?> : <span><?php echo $xml; ?></span></li> <?php } @@ -491,9 +491,9 @@ function ngg_get_serverinfo() { */ function ngg_check_for_PHP5() { ?> - <div class="updated"> - <p><?php _e('NextGEN Gallery contains some functions which are only available under PHP 5.2. You are using the old PHP 4 version, upgrade now! It\'s no longer supported by the PHP group. Many shared hosting providers offer both PHP 4 and PHP 5, running simultaneously. Ask your provider if they can do this.', 'nggallery'); ?></p> - </div> - <?php + <div class="updated"> + <p><?php _e('NextGEN Gallery contains some functions which are only available under PHP 5.2. You are using the old PHP 4 version, upgrade now! It\'s no longer supported by the PHP group. Many shared hosting providers offer both PHP 4 and PHP 5, running simultaneously. Ask your provider if they can do this.', 'nggallery'); ?></p> + </div> +<?php } diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/publish.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/publish.php index bd6b7ff79cfb29c36752de0fffbd0b86a6173d58..cd8c9047640c0a874778e8e1503f727957066988 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/publish.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/publish.php @@ -1,64 +1,64 @@ -<?php - -require_once( dirname( dirname(__FILE__) ) . '/ngg-config.php'); -require_once( NGGALLERY_ABSPATH . '/lib/image.php' ); - -if ( !is_user_logged_in() ) - die(__('Cheatin’ uh?')); - -if ( !current_user_can('NextGEN Manage gallery') ) - die(__('Cheatin’ uh?')); - -if ( !current_user_can( 'publish_posts' ) ) - die(__('Cheatin’ uh?')); - -global $wpdb; - -$id = (int) $_GET['id']; - -// let's get the image data -$picture = nggdb::find_image($id); - -// use defaults the first time -$width = empty ($ngg->options['publish_width']) ? $ngg->options['thumbwidth'] : $ngg->options['publish_width']; -$height = empty ($ngg->options['publish_height']) ? $ngg->options['thumbheight'] : $ngg->options['publish_height']; -$align = empty ($ngg->options['publish_align']) ? 'none' : $ngg->options['publish_align']; - -?> - -<form id="form-publish-post" method="POST" accept-charset="utf-8"> -<?php wp_nonce_field('publish-post') ?> -<input type="hidden" name="page" value="publish-post" /> -<input type="hidden" name="pid" value="<?php echo $picture->pid; ?>" /> -<table width="100%" border="0" cellspacing="3" cellpadding="3" > - <tr valign="top"> - <th align="left"><?php _e('Post title','nggallery') ?></th> - <td><input type="text" size="70" name="post_title" value="<?php echo esc_attr( $picture->alttext); ?>" /> - <br /><small><?php _e('Enter the post title ','nggallery') ?></small></td> - </tr> - <tr valign="top"> - <th align="left"><?php _e('Width x height (in pixel)','nggallery') ?></th> - <td><input type="text" size="5" maxlength="5" name="width" value="<?php echo $width; ?>" /> x <input type="text" size="5" maxlength="5" name="height" value="<?php echo $height; ?>" /> - <br /><small><?php _e('Size of the image','nggallery') ?></small></td> - </tr> - <tr valign="top"> - <th align="left"><?php _e('Alignment','nggallery') ?></th> - <td><input type="radio" value="none" <?php checked('none', $align); ?> id="image-align-none" name="align"/> - <label class="align" for="image-align-none"><?php _e('None','nggallery'); ?></label> - <input type="radio" value="left" <?php checked('left', $align); ?> id="image-align-left" name="align"/> - <label class="align" for="image-align-left"><?php _e('Left','nggallery'); ?></label> - <input type="radio" value="center" <?php checked('center', $align); ?> id="image-align-center" name="align"/> - <label class="align" for="image-align-center"><?php _e('Center','nggallery'); ?></label> - <input type="radio" value="right" <?php checked('right', $align); ?> id="image-align-right" name="align"/> - <label class="align" for="image-align-right"><?php _e('Right','nggallery'); ?></label> - </td> - </tr> - <tr align="right"> - <td colspan="2" class="submit"> - <input class="button-primary" type="submit" name="publish" value="<?php _e('Publish', 'nggallery');?>" /> - - <input class="button-secondary" type="submit" name="draft" value=" <?php _e('Draft', 'nggallery'); ?> " /> - </td> - </tr> -</table> +<?php + +require_once( dirname( dirname(__FILE__) ) . '/ngg-config.php'); +require_once( NGGALLERY_ABSPATH . '/lib/image.php' ); + +if ( !is_user_logged_in() ) + die(__('Cheatin’ uh?')); + +if ( !current_user_can('NextGEN Manage gallery') ) + die(__('Cheatin’ uh?')); + +if ( !current_user_can( 'publish_posts' ) ) + die(__('Cheatin’ uh?')); + +global $wpdb; + +$id = (int) $_GET['id']; + +// let's get the image data +$picture = nggdb::find_image($id); + +// use defaults the first time +$width = empty ($ngg->options['publish_width']) ? $ngg->options['thumbwidth'] : $ngg->options['publish_width']; +$height = empty ($ngg->options['publish_height']) ? $ngg->options['thumbheight'] : $ngg->options['publish_height']; +$align = empty ($ngg->options['publish_align']) ? 'none' : $ngg->options['publish_align']; + +?> + +<form id="form-publish-post" method="POST" accept-charset="utf-8"> +<?php wp_nonce_field('publish-post') ?> +<input type="hidden" name="page" value="publish-post" /> +<input type="hidden" name="pid" value="<?php echo $picture->pid; ?>" /> +<table width="100%" border="0" cellspacing="3" cellpadding="3" > + <tr valign="top"> + <th align="left"><?php _e('Post title','nggallery') ?></th> + <td><input type="text" size="70" name="post_title" value="<?php echo esc_attr( $picture->alttext); ?>" /> + <br /><small><?php _e('Enter the post title ','nggallery') ?></small></td> + </tr> + <tr valign="top"> + <th align="left"><?php _e('Width x height (in pixel)','nggallery') ?></th> + <td><input type="text" size="5" maxlength="5" name="width" value="<?php echo $width; ?>" /> x <input type="text" size="5" maxlength="5" name="height" value="<?php echo $height; ?>" /> + <br /><small><?php _e('Size of the image','nggallery') ?></small></td> + </tr> + <tr valign="top"> + <th align="left"><?php _e('Alignment','nggallery') ?></th> + <td><input type="radio" value="none" <?php checked('none', $align); ?> id="image-align-none" name="align"/> + <label class="align" for="image-align-none"><?php _e('None','nggallery'); ?></label> + <input type="radio" value="left" <?php checked('left', $align); ?> id="image-align-left" name="align"/> + <label class="align" for="image-align-left"><?php _e('Left','nggallery'); ?></label> + <input type="radio" value="center" <?php checked('center', $align); ?> id="image-align-center" name="align"/> + <label class="align" for="image-align-center"><?php _e('Center','nggallery'); ?></label> + <input type="radio" value="right" <?php checked('right', $align); ?> id="image-align-right" name="align"/> + <label class="align" for="image-align-right"><?php _e('Right','nggallery'); ?></label> + </td> + </tr> + <tr align="right"> + <td colspan="2" class="submit"> + <input class="button-primary" type="submit" name="publish" value="<?php _e('Publish', 'nggallery');?>" /> + + <input class="button-secondary" type="submit" name="draft" value=" <?php _e('Draft', 'nggallery'); ?> " /> + </td> + </tr> +</table> </form> \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/roles.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/roles.php index fdd488c7788dc06c88ee49be510edd190a1db058..364135f232b9d48e17f0c1185f1582f9f4754d0f 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/roles.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/roles.php @@ -23,8 +23,9 @@ if ( !empty($_POST) ) { ?> <div class="wrap"> - <p><?php _e('Select the lowest role which should be able to access the following capabilities. NextGEN Gallery supports the standard roles from WordPress.', 'nggallery') ?> <br /> - <?php _e('For a more flexible user management you can use the', 'nggallery') ?> <a href="http://wordpress.org/extend/plugins/capsman/" target="_blank">Capability Manager</a>.</p> + <p> + <?php _e('Select the lowest role which should be able to access the following capabilities. NextGEN Gallery supports the standard roles from WordPress.', 'nggallery') ?> <br /> + </p> <?php wp_nonce_field('ngg_addroles') ?> <table class="form-table"> <tr valign="top"> diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/rotate.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/rotate.php index 094aec3c7dbd0ee7a8d93b10b29dde71f3e437f7..5542cd64ac98b0e294553c56274e38bee54ea8bc 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/rotate.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/rotate.php @@ -36,8 +36,16 @@ $thumb->resize(350,350); $resizedPreviewInfo = $thumb->newDimensions; $thumb->destruct(); -$preview_image = trailingslashit( home_url() ) . 'index.php?callback=image&pid=' . $picture->pid . '&width=350&height=350'; - +// Generate a url to a preview image +$storage = C_Gallery_Storage::get_instance(); +$thumbnail_manager = C_Dynamic_Thumbnails_Manager::get_instance(); +$dynamic_size = $thumbnail_manager->get_size_name(array( + 'width' => 350, + 'height' => 350, + +)); +//$preview_image = trailingslashit( home_url() ) . 'index.php?callback=image&pid=' . $picture->pid . '&width=350&height=350'; +$preview_image = $storage->get_image_url($id, $dynamic_size); ?> <script type='text/javascript'> diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/showmeta.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/showmeta.php index 96c694b8b5c1040c33ebf3aa11b0f57a2075b445..b5e50fd15a0f2f21698f5578d78d5631ff16547b 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/showmeta.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/showmeta.php @@ -37,6 +37,9 @@ $class = ''; </thead> <?php foreach ($dbdata as $key => $value){ + if (in_array($key, array('created_timestamp', 'timestamp')) && is_numeric($value)) { + $value = date_i18n(get_option('date_format') . ' ' . get_option('time_format'), $value); + } if ( is_array($value) ) continue; $class = ( $class == 'class="alternate"' ) ? '' : 'class="alternate"'; echo '<tr '.$class.'> @@ -63,6 +66,9 @@ $class = ''; </thead> <?php foreach ($exifdata as $key => $value){ + if (in_array($key, array('created_timestamp', 'timestamp')) && is_numeric($value)) { + $value = date_i18n(get_option('date_format') . ' ' . get_option('time_format'), $value); + } $class = ( $class == 'class="alternate"' ) ? '' : 'class="alternate"'; echo '<tr '.$class.'> <td style="width:230px">' . esc_html ( $meta->i18n_name($key) ) . '</td> @@ -88,6 +94,9 @@ $class = ''; </thead> <?php foreach ($iptcdata as $key => $value){ + if (in_array($key, array('created_timestamp', 'timestamp')) && is_numeric($value)) { + $value = date_i18n(get_option('date_format') . ' ' . get_option('time_format'), $value); + } $class = ( $class == 'class="alternate"' ) ? '' : 'class="alternate"'; echo '<tr '.$class.'> <td style="width:230px">' . esc_html( $meta->i18n_name($key) ) . '</td> @@ -112,6 +121,9 @@ $class = ''; </thead> <?php foreach ($xmpdata as $key => $value){ + if (in_array($key, array('created_timestamp', 'timestamp')) && is_numeric($value)) { + $value = date_i18n(get_option('date_format') . ' ' . get_option('time_format'), $value); + } $class = ( $class == 'class="alternate"' ) ? '' : 'class="alternate"'; echo '<tr '.$class.'> <td style="width:230px">' . esc_html( $meta->i18n_name($key) ) . '</td> diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/tags.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/tags.php index 30d74e396920c1fa92fb7879407b8e905fe72390..e42c94100406fc94ee184e68e3de7bba6f022d6a 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/tags.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/tags.php @@ -95,7 +95,6 @@ if ($nb_tags < $tag_count && $offset>0) { </style> <div class="wrap ngg_wrap"> - <?php //include('templates/social_media_buttons.php'); ?> <?php screen_icon( 'nextgen-gallery' ); ?> <h2><?php _e('Manage image tags', 'nggallery'); ?></h2> diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/css/nggallery.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/css/nggallery.css index 4ec8118fa10634c912e492894d40524896939cc6..13046decd8c3fad509e5376c13b386e49c8768be 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/css/nggallery.css +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/css/nggallery.css @@ -1,8 +1,8 @@ -/* -CSS Name: Default Styles -Description: NextGEN Default Gallery Stylesheet -Author: Photocrati Media -Version: 2.12 - -This stylesheet is provided to allow users the ability of overriding the default styles for all display types +/* +CSS Name: Default Styles +Description: NextGEN Default Gallery Stylesheet +Author: Photocrati Media +Version: 2.12 + +This stylesheet is provided to allow users the ability of overriding the default styles for all display types */ \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/core.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/core.php index a991dec4c239f84441d25f473d5b13742f7b51a8..2420daa25a43679f1fc644b35c3b0c9406122650 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/core.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/core.php @@ -22,118 +22,6 @@ class nggGallery { echo '<div class="wrap"><h2></h2><div class="updated fade" id="message"><p>' . $message . '</p></div></div>' . "\n"; } - /** - * get the thumbnail url to the image - */ - static function get_thumbnail_url($imageID, $picturepath = '', $fileName = ''){ - // get the complete url to the thumbnail - global $wpdb; - - // safety first - $imageID = (int) $imageID; - - // get gallery values - if ( empty($fileName) ) { - list($fileName, $picturepath ) = $wpdb->get_row("SELECT p.filename, g.path FROM $wpdb->nggpictures AS p INNER JOIN $wpdb->nggallery AS g ON (p.galleryid = g.gid) WHERE p.pid = '$imageID' ", ARRAY_N); - } - - if ( empty($picturepath) ) { - $picturepath = $wpdb->get_var("SELECT g.path FROM $wpdb->nggpictures AS p INNER JOIN $wpdb->nggallery AS g ON (p.galleryid = g.gid) WHERE p.pid = '$imageID' "); - } - - // set gallery url - $folder_url = site_url() . '/' . $picturepath.nggGallery::get_thumbnail_folder($picturepath, FALSE); - $thumbnailURL = $folder_url . 'thumbs_' . $fileName; - - return $thumbnailURL; - } - - /** - * get the complete url to the image - */ - static function get_image_url($imageID, $picturepath = '', $fileName = '') { - global $wpdb; - - // safety first - $imageID = (int) $imageID; - - // get gallery values - if (empty($fileName)) { - list($fileName, $picturepath ) = $wpdb->get_row("SELECT p.filename, g.path FROM $wpdb->nggpictures AS p INNER JOIN $wpdb->nggallery AS g ON (p.galleryid = g.gid) WHERE p.pid = '$imageID' ", ARRAY_N); - } - - if (empty($picturepath)) { - $picturepath = $wpdb->get_var("SELECT g.path FROM $wpdb->nggpictures AS p INNER JOIN $wpdb->nggallery AS g ON (p.galleryid = g.gid) WHERE p.pid = '$imageID' "); - } - - // set gallery url - $imageURL = site_url() . '/' . $picturepath . '/' . $fileName; - - return $imageURL; - } - - /** - * nggGallery::get_thumbnail_folder() - * - * @param mixed $gallerypath - * @param bool $include_Abspath - * @return string $foldername - */ - static function create_thumbnail_folder($gallerypath, $include_Abspath = TRUE) { - if (!$include_Abspath) { - $gallerypath = ABSPATH . $gallerypath; - } - - if (!file_exists($gallerypath)) { - return FALSE; - } - - if (is_dir($gallerypath . '/thumbs/')) { - return '/thumbs/'; - } - - if (is_admin()) { - if (!is_dir($gallerypath . '/thumbs/')) { - if ( !wp_mkdir_p($gallerypath . '/thumbs/') ) { - if (SAFE_MODE) { - nggAdmin::check_safemode($gallerypath . '/thumbs/'); - } else { - nggGallery::show_error(__('Unable to create directory ', 'nggallery') . $gallerypath . '/thumbs !'); - } - return FALSE; - } - return '/thumbs/'; - } - } - - return FALSE; - - } - - /** - * nggGallery::get_thumbnail_folder() - * - * @param mixed $gallerypath - * @param bool $include_Abspath - * @deprecated use create_thumbnail_folder() if needed; - * @return string $foldername - */ - static function get_thumbnail_folder($gallerypath, $include_Abspath = TRUE) { - return nggGallery::create_thumbnail_folder($gallerypath, $include_Abspath); - } - - /** - * nggGallery::get_thumbnail_prefix() - obsolete - * - * @param string $gallerypath - * @param bool $include_Abspath - * @deprecated prefix is now fixed to "thumbs_"; - * @return string "thumbs_"; - */ - static function get_thumbnail_prefix($gallerypath, $include_Abspath = TRUE) { - return 'thumbs_'; - } - /** * nggGallery::get_option() - get the options and overwrite them with custom meta settings * @@ -183,7 +71,6 @@ class nggGallery { 'bool' => array( 'ngg_gal_ShowSlide' => 'galShowSlide', - 'ngg_gal_ShowPiclense' => 'usePicLens', 'ngg_gal_ImageBrowser' => 'galImgBrowser', 'ngg_gal_HideImages' => 'galHiddenImg', 'ngg_ir_Shuffle' => 'irShuffle', @@ -216,36 +103,6 @@ class nggGallery { return $options; } - /** - * nggGallery::scale_image() - Scale down a image - * - * @param mixed $location (filename) - * @param int $maxw - max width - * @param int $maxh - max height - * @return array (width, heigth) - */ - static function scale_image($location, $maxw = 0, $maxh = 0){ - $img = @getimagesize($location); - if ($img){ - $w = $img[0]; - $h = $img[1]; - - $dim = array('w','h'); - foreach($dim AS $val) { - $max = "max{$val}"; - if(${$val} > ${$max} && ${$max}){ - $alt = ($val == 'w') ? 'h' : 'w'; - $ratio = ${$alt} / ${$val}; - ${$val} = ${$max}; - ${$alt} = ${$val} * $ratio; - } - } - - return array( $w, $h ); - } - return false; - } - /** * Renders a section of user display code. The code is first checked for in the current theme display directory * before defaulting to the plugin @@ -257,31 +114,12 @@ class nggGallery { * @param bool $callback In case we check we didn't find template we tested it one time more (optional) * @return void **/ - static function render($template_name, $vars = array (), $callback = false) { - foreach ($vars AS $key => $val) { - $$key = $val; - } + static function render($template_name, $vars = array (), $callback = false) + { + $vars['template'] = $template_name; + echo C_Displayed_Gallery_Renderer::get_instance()->display_images($vars); + - // hook into the render feature to allow other plugins to include templates - $custom_template = apply_filters( 'ngg_render_template', false, $template_name ); - - if ( ( $custom_template != false ) && file_exists ($custom_template) ) { - include ( $custom_template ); - } else if (file_exists(WP_CONTENT_DIR . "/{$template_name}.php")) { - include (WP_CONTENT_DIR . "/{$template_name}.php"); - } else if (file_exists(WP_CONTENT_DIR . "/{$template_name}.php")) { - include (WP_CONTENT_DIR . "/nggallery/{$template_name}.php"); - } else if (file_exists (STYLESHEETPATH . "/nggallery/$template_name.php")) { - include (STYLESHEETPATH . "/nggallery/$template_name.php"); - } else if (file_exists (NGGALLERY_ABSPATH . "/view/$template_name.php")) { - include (NGGALLERY_ABSPATH . "/view/$template_name.php"); - } else if ( $callback === true ) { - echo "<p>Rendering of template $template_name.php failed</p>"; - } else { - //test without the "-template" name one time more - $template_name = array_shift( explode('-', $template_name , 2) ); - nggGallery::render ($template_name, $vars , true); - } } /** @@ -290,15 +128,13 @@ class nggGallery { * @autor John Godley * @param string $template_name Name of the template file (without extension) * @param string $vars Array of variable name=>value that is available to the display code (optional) + * @deprecated Use C_Displayed_Gallery_Renderer class * @return void **/ - static function capture ($template_name, $vars = array ()) { - ob_start (); - nggGallery::render ($template_name, $vars); - $output = ob_get_contents (); - ob_end_clean (); - - return $output; + static function capture ($template_name, $vars = array ()) + { + $vars['template'] = $template_name; + return C_Displayed_Gallery_Renderer::get_instance()->display_images($vars); } /** @@ -317,24 +153,6 @@ class nggGallery { } - /** - * Look for the stylesheet in the theme folder - * - * @return string path to stylesheet - */ - static function get_theme_css_file() { - - // allow other plugins to include a custom stylesheet - $stylesheet = apply_filters( 'ngg_load_stylesheet', false ); - - if ( $stylesheet !== false ) - return ( $stylesheet ); - elseif ( file_exists (STYLESHEETPATH . '/nggallery.css') ) - return get_stylesheet_directory_uri() . '/nggallery.css'; - else - return false; - } - /** * Support for i18n with wpml, polyglot or qtrans * @@ -401,45 +219,6 @@ class nggGallery { return; } - /** - * Slightly modfifed version of pathinfo(), clean up filename & rename jpeg to jpg - * - * @param string $name The name being checked. - * @return array containing information about file - */ - static function fileinfo( $name ) { - - $name_old = $name; - //Sanitizes a filename replacing whitespace with dashes - $name = sanitize_file_name($name); - - //get the parts of the name - $filepart = pathinfo ( strtolower($name) ); - $filepart_old = pathinfo ( strtolower($name_old) ); - - if ( empty($filepart) ) - return false; - - if ( empty($filepart['extension']) && !empty($filepart_old['extension'])) { - $filepart = pathinfo ( strtolower($name . '.' . $filepart_old['extension']) ); - } - - // required until PHP 5.2.0 - if ( empty($filepart['filename']) ) - $filepart['filename'] = substr($filepart['basename'],0 ,strlen($filepart['basename']) - (strlen($filepart['extension']) + 1) ); - - // XXX this sanitation seems unneeded, not sure why it's here...it forces all non-ASCII chars to be URL-encoded - //$filepart['filename'] = sanitize_title_with_dashes( $filepart['filename'] ); - - //extension jpeg will not be recognized by the slideshow, so we rename it - $filepart['extension'] = ($filepart['extension'] == 'jpeg') ? 'jpg' : $filepart['extension']; - - //combine the new file name - $filepart['basename'] = $filepart['filename'] . '.' . $filepart['extension']; - - return $filepart; - } - /** * Check for extended capabilites. Must previously registers with add_ngg_capabilites() * @@ -458,121 +237,6 @@ class nggGallery { return true; } - /** - * Check for extended capabilites and echo disabled="disabled" for input form - * - * @since 1.5.0 - * @param string $capability - * @return void - */ - static function current_user_can_form( $capability ) { - - if ( !nggGallery::current_user_can( $capability )) - echo 'disabled="disabled"'; - } - - /** - * Register more capabilities for custom use and add it to the administrator - * - * @since 1.5.0 - * @param string $capability - * @param bool $register the new capability automatic to the admin role - * @return void - */ - static function add_capabilites( $capability , $register = true ) { - global $_ngg_capabilites; - - if ( !is_array($_ngg_capabilites) ) - $_ngg_capabilites = array(); - - $_ngg_capabilites[] = $capability; - - if ( $register ) { - $role = get_role('administrator'); - if ( !empty($role) ) - $role->add_cap( $capability ); - } - - } - - /** - * Check for mobile user agent - * - * @since 1.6.0 - * @author Part taken from WPtouch plugin (http://www.bravenewcode.com) - * @return bool $result of check - */ - static function detect_mobile_phone() { - - $useragents = array(); - - // Check if WPtouch is running - if ( function_exists('bnc_wptouch_get_user_agents') ) - $useragents = bnc_wptouch_get_user_agents(); - else { - $useragents = array( - "iPhone", // Apple iPhone - "iPod", // Apple iPod touch - "Android", // 1.5+ Android - "dream", // Pre 1.5 Android - "CUPCAKE", // 1.5+ Android - "blackberry9500", // Storm - "blackberry9530", // Storm - "blackberry9520", // Storm v2 - "blackberry9550", // Storm v2 - "blackberry9800", // Torch - "webOS", // Palm Pre Experimental - "incognito", // Other iPhone browser - "webmate" // Other iPhone browser - ); - - asort( $useragents ); - } - - // Godfather Steve says no to flash - if ( is_array($useragents) ) - $useragents[] = "iPad"; // Apple iPad; - - // WPtouch User Agent Filter - $useragents = apply_filters( 'wptouch_user_agents', $useragents ); - - foreach ( $useragents as $useragent ) { - if ( preg_match( "#$useragent#i", $_SERVER['HTTP_USER_AGENT'] ) ) - return true; - } - - return false; - } - - /** - * get_memory_usage - * - * @access only for debug purpose - * @since 1.8.3 - * @param string $text - * @return void - */ - static function get_memory( $text = '' ) { - global $memory; - - $memory_peak = memory_get_usage(); - $diff = 0; - - if ( isset($memory) ) - $diff = $memory_peak - $memory; - - $exp = ($diff < 0) ? '-' : ''; - $diff = ($exp == '-') ? 0 - $diff : $diff; - - $memory = $memory_peak; - - $unit = array('b','kb','mb','gb','tb','pb'); - $rounded = @round($diff/pow(1024,($i=floor(log($diff,1024)))),2).' '.$unit[$i]; - - echo $text . ': ' . $exp . $rounded .'<br />'; - - } - /** * Show NextGEN Version in header * @since 1.9.0 diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/gd.thumbnail.inc.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/gd.thumbnail.inc.php index e8b7ac53894a64027a1d4fb4f73d46c4ae8d3f9c..c5ae2048e4dcc2b5f642006bac0ef5c98c3caa13 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/gd.thumbnail.inc.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/gd.thumbnail.inc.php @@ -112,7 +112,8 @@ class ngg_Thumbnail { * @var string * */ - function ngg_Thumbnail($fileName,$no_ErrorImage = false) { + function __construct($fileName,$no_ErrorImage = false) + { //make sure the GD library is installed if(!function_exists("gd_info")) { echo 'You do not have the GD Library installed. This class requires the GD library to function properly.' . "\n"; @@ -144,6 +145,8 @@ class ngg_Thumbnail { //if there are no errors, determine the file format if($this->error == false) { + @ini_set('memory_limit', -1); + $data = @getimagesize($this->fileName); if (isset($data) && is_array($data)) { $extensions = array('1' => 'GIF', '2' => 'JPG', '3' => 'PNG'); diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/image.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/image.php index c874d2a21bcc080f71830b7be4ae9fd3b77eacb3..4e9fd6d57010ec119bbfa999ef4b351d4fd3de99 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/image.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/image.php @@ -1,83 +1,79 @@ <?php -if (!class_exists('nggImage')) +/** + * This is a wrapper class to the C_Image_Wrapper which provides all of the necessary logic for + * retrieving attributes as needed. + * + * NOTE: it isn't possible yet (as of PHP 5.4) to use overloaded properties in any language constructs other than + * isset(). To work around this with the wrapper class (which uses overloaded properties) we make a copy of any + * attributes set to this object. + */ +class nggImage extends Ngg_Serializable { - /** - * This is a wrapper class to the C_Image_Wrapper which provides all of the necessary logic for - * retrieving attributes as needed. - * - * NOTE: it isn't possible yet (as of PHP 5.4) to use overloaded properties in any language constructs other than - * isset(). To work around this with the wrapper class (which uses overloaded properties) we make a copy of any - * attributes set to this object. - */ - class nggImage extends Ngg_Serializable - { - public $_ngiw; - public $_propogate = TRUE; - + public $_ngiw; + public $_propogate = TRUE; - // TODO: Make nggImage a subclass of C_Component and use the wrapper functionality - function __construct($image) - { - $image->meta_data = $this->unserialize($image->meta_data); - C_Component_Registry::get_instance(); - $this->_ngiw = new C_Image_Wrapper($image, NULL, TRUE); - } - public function __set($name, $value) - { - $this->$name = $value; - if ($this->_propogate) - $this->_ngiw->__set($name, $value); - } + // TODO: Make nggImage a subclass of C_Component and use the wrapper functionality + function __construct($image) + { + $image->meta_data = $this->unserialize($image->meta_data); + C_Component_Registry::get_instance(); + $this->_ngiw = new C_Image_Wrapper($image, NULL, TRUE); + } - public function __isset($name) - { - return $this->_ngiw->__isset($name); - } + public function __set($name, $value) + { + $this->$name = $value; + if ($this->_propogate) + $this->_ngiw->__set($name, $value); + } - public function __unset($name) - { - return $this->_ngiw->__unset($name); - } + public function __isset($name) + { + return $this->_ngiw->__isset($name); + } - public function __get($name) - { - $this->_propogate = FALSE; - $this->$name = $this->_ngiw->__get($name); - $this->_propogate = TRUE; - return $this->$name; - } + public function __unset($name) + { + return $this->_ngiw->__unset($name); + } - function get_thumbcode($galleryname = '') - { - return $this->_ngiw->get_thumbcode($galleryname); - } + public function __get($name) + { + $this->_propogate = FALSE; + $this->$name = $this->_ngiw->__get($name); + $this->_propogate = TRUE; + return $this->$name; + } - function get_href_link() - { - return $this->_ngiw->get_href_link(); - } + function get_thumbcode($galleryname = '') + { + return $this->_ngiw->get_thumbcode($galleryname); + } - function get_href_thumb_link() - { - return $this->_ngiw->get_href_thumb_link(); - } + function get_href_link() + { + return $this->_ngiw->get_href_link(); + } - function cached_singlepic_file($width = '', $height = '', $mode = '' ) - { - return $this->_ngiw->cached_singlepic_file($width, $height, $mode); - } + function get_href_thumb_link() + { + return $this->_ngiw->get_href_thumb_link(); + } - function get_tags() - { - return $this->_ngiw->get_tags(); - } + function cached_singlepic_file($width = '', $height = '', $mode = '' ) + { + return $this->_ngiw->cached_singlepic_file($width, $height, $mode); + } - function get_permalink() - { - return $this->_ngiw->get_permalink(); - } + function get_tags() + { + return $this->_ngiw->get_tags(); + } + function get_permalink() + { + return $this->_ngiw->get_permalink(); } } diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/imagemagick.inc.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/imagemagick.inc.php index fb9b5eb88b445d141e5b60dbcb452372fbf155f3..802fdb441f25fbcc03e929e9d9c532434af94c13 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/imagemagick.inc.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/imagemagick.inc.php @@ -99,9 +99,8 @@ var $imageMagickBefore; * out: nothing * init of class: init of variables, detect needed memory (gd), image format (gd), detect image size (GetImageSize is general PHP, not GD), Image Meta? */ - - function ngg_Thumbnail($fileName, $no_ErrorImage = false) { - + function __construct($fileName, $no_ErrorImage = false) + { //initialize variables $this->errmsg = ''; $this->error = false; diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/media-rss.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/media-rss.php index f5bf83aabb43a241085f4f82a943d6bde186162c..3f7c2eb84e420ffc5048afa6c462e76bcac494b5 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/media-rss.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/media-rss.php @@ -6,28 +6,16 @@ * @copyright Copyright 2008-2011 */ class nggMediaRss { - - /** - * Function called by the wp_head action to output the RSS link for medias - */ + function add_mrss_alternate_link() { - echo "<link id='MediaRSS' rel='alternate' type='application/rss+xml' title='NextGEN Gallery RSS Feed' href='" . nggMediaRss::get_mrss_url() . "' />\n"; - } - - /** - * Add the javascript required to enable PicLens/CoolIris support - */ - function add_piclens_javascript() { - if (is_ssl()) - wp_enqueue_script( 'piclens', 'https://lite.piclens.com/current/piclens_optimized.js', array(), false, true); - else - wp_enqueue_script( 'piclens', 'http://lite.piclens.com/current/piclens_optimized.js', array(), false, true); + echo "<link id='MediaRSS' rel='alternate' type='application/rss+xml' title='NextGEN Gallery RSS Feed' href='" . nggMediaRss::get_mrss_url() . "' />\n"; } + /** * Get the URL of the general media RSS */ - function get_mrss_url() { + static function get_mrss_url() { return NGGALLERY_URLPATH . 'xml/media-rss.php'; } @@ -84,8 +72,8 @@ class nggMediaRss { $ngg_options['galSort'] = ($ngg_options['galSort']) ? $ngg_options['galSort'] : 'pid'; $ngg_options['galSortDir'] = ($ngg_options['galSortDir'] == 'DESC') ? 'DESC' : 'ASC'; - $title = stripslashes(nggGallery::i18n($gallery->title)); - $description = stripslashes(nggGallery::i18n($gallery->galdesc)); + $title = stripslashes(M_I18N::translate($gallery->title)); + $description = stripslashes(M_I18N::translate($gallery->galdesc)); $link = nggMediaRss::get_permalink($gallery->pageid); $prev_link = ( $prev_gallery != null) ? nggMediaRss::get_gallery_mrss_url($prev_gallery->gid, true) : ''; $next_link = ( $next_gallery != null) ? nggMediaRss::get_gallery_mrss_url($next_gallery->gid, true) : ''; @@ -101,7 +89,7 @@ class nggMediaRss { */ function get_album_mrss($album) { - $title = stripslashes(nggGallery::i18n($album->name)); + $title = stripslashes(M_I18N::translate($album->name)); $description = ''; $link = nggMediaRss::get_permalink(0); $prev_link = ''; @@ -178,7 +166,7 @@ class nggMediaRss { /** * Get the XML <atom:link self> node */ - function get_self_node($link, $indent = "\t\t") { + static function get_self_node($link, $indent = "\t\t") { return $indent . "<atom:link rel='self' href='" . htmlspecialchars($link) . "' type='application/rss+xml' />\n"; } @@ -201,31 +189,36 @@ class nggMediaRss { * * @param $image The image object */ - function get_image_mrss_node($image, $indent = "\t\t" ) { - $ngg_options = nggGallery::get_option('ngg_options'); + function get_image_mrss_node($image, $indent = "\t\t" ) + { + $settings = C_NextGen_Settings::get_instance(); + $storage = C_Gallery_Storage::get_instance(); + + $tags = wp_get_object_terms($image->pid, 'ngg_tag', 'fields=names'); + if (is_array($tags)) $tags = implode(', ', $tags); - $tags = $image->get_tags(); - $tag_names = ''; - foreach ($tags as $tag) { - $tag_names .= ($tag_names=='' ? $tag->name : ', ' . $tag->name); + $title = html_entity_decode(stripslashes($image->alttext)); + $desc = html_entity_decode(stripslashes($image->description)); + $image_url = $storage->get_image_url($image); + $thumb_url = $storage->get_thumb_url($image); + + $thumbwidth = 80; + $thumbheight = 80; + if (($dimensions = $storage->get_thumb_dimensions($image))) { + $thumbwidth = $dimensions['width']; + $thumbheight = $dimensions['height']; } - $title = html_entity_decode(stripslashes($image->alttext)); - $desc = html_entity_decode(stripslashes($image->description)); - - $thumbwidth = $ngg_options['thumbwidth']; - $thumbheight = ($ngg_options['thumbfix'] ? $ngg_options['thumbheight'] : $thumbwidth); - $out = $indent . "<item>\n"; - $out .= $indent . "\t<title><![CDATA[" . nggGallery::i18n($title, 'pic_' . $image->pid . '_alttext') . "]]></title>\n"; - $out .= $indent . "\t<description><![CDATA[" . nggGallery::i18n($desc, 'pic_' . $image->pid . '_description') . "]]></description>\n"; - $out .= $indent . "\t<link><![CDATA[" . $image->get_permalink() . "]]></link>\n"; + $out .= $indent . "\t<title><![CDATA[" . M_I18N::translate($title, 'pic_' . $image->pid . '_alttext') . "]]></title>\n"; + $out .= $indent . "\t<description><![CDATA[" . M_I18N::translate($desc, 'pic_' . $image->pid . '_description') . "]]></description>\n"; + $out .= $indent . "\t<link><![CDATA[" . nextgen_esc_url($image_url) . "]]></link>\n"; $out .= $indent . "\t<guid>image-id:" . $image->pid . "</guid>\n"; - $out .= $indent . "\t<media:content url='" . nextgen_esc_url($image->imageURL) . "' medium='image' />\n"; - $out .= $indent . "\t<media:title><![CDATA[" . nggGallery::i18n($title, 'pic_' . $image->pid . '_alttext') . "]]></media:title>\n"; - $out .= $indent . "\t<media:description><![CDATA[" . nggGallery::i18n($desc, 'pic_' . $image->pid . '_description') . "]]></media:description>\n"; - $out .= $indent . "\t<media:thumbnail url='" . nextgen_esc_url($image->thumbURL) . "' width='" . $thumbwidth . "' height='" . $thumbheight . "' />\n"; - $out .= $indent . "\t<media:keywords><![CDATA[" . nggGallery::i18n($tag_names) . "]]></media:keywords>\n"; + $out .= $indent . "\t<media:content url='" . nextgen_esc_url($image_url) . "' medium='image' />\n"; + $out .= $indent . "\t<media:title><![CDATA[" . M_I18N::translate($title, 'pic_' . $image->pid . '_alttext') . "]]></media:title>\n"; + $out .= $indent . "\t<media:description><![CDATA[" . M_I18N::translate($desc, 'pic_' . $image->pid . '_description') . "]]></media:description>\n"; + $out .= $indent . "\t<media:thumbnail url='" . nextgen_esc_url($thumb_url) . "' width='" . $thumbwidth . "' height='" . $thumbheight . "' />\n"; + $out .= $indent . "\t<media:keywords><![CDATA[" . esc_html(M_I18N::translate($tags)) . "]]></media:keywords>\n"; $out .= $indent . "\t<media:copyright><![CDATA[Copyright (c) " . get_option("blogname") . " (" . site_url() . ")]]></media:copyright>\n"; $out .= $indent . "</item>\n"; diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/meta.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/meta.php index be95384a4dc0878c90de83cf388877f0a5a21ca8..bac934098ecf50bff630617378e5bcfd1160c90f 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/meta.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/meta.php @@ -30,23 +30,26 @@ class nggMeta{ * @param bool $onlyEXIF parse only exif if needed * @return */ - function nggMeta($pic_id, $onlyEXIF = false) { + function __construct($image_or_id, $onlyEXIF = false) + { + if (is_int($image_or_id)) { + //get the path and other data about the image + $this->image = C_Image_Mapper::get_instance()->find( $image_or_id); + } + else $this->image = $image_or_id; - //get the path and other data about the image - $this->image = nggdb::find_image( $pic_id ); + $imagePath = C_Gallery_Storage::get_instance()->get_image_abspath($this->image); - $this->image = apply_filters( 'ngg_find_image_meta', $this->image ); - - if ( !file_exists( $this->image->imagePath ) ) + if ( !file_exists($imagePath ) ) return false; - $this->size = @getimagesize ( $this->image->imagePath , $metadata ); + $this->size = @getimagesize ( $imagePath , $metadata ); if ($this->size && is_array($metadata)) { // get exif - data if ( is_callable('exif_read_data')) - $this->exif_data = @exif_read_data($this->image->imagePath , 0, true ); + $this->exif_data = @exif_read_data($imagePath , NULL, TRUE); // stop here if we didn't need other meta data if ($onlyEXIF) @@ -58,7 +61,7 @@ class nggMeta{ // get the xmp data in a XML format if ( is_callable('xml_parser_create')) - $this->xmp_data = $this->extract_XMP($this->image->imagePath ); + $this->xmp_data = $this->extract_XMP($imagePath ); return true; } @@ -118,19 +121,19 @@ class nggMeta{ $meta= array(); - if ( isset($this->exif_data['EXIF']) ) { - $exif = $this->exif_data['EXIF']; + $exif = isset($this->exif_array['EXIF']) ? $this->exif_array['EXIF'] : array(); + if (count($exif)) { if (!empty($exif['FNumber'])) $meta['aperture'] = 'F ' . round( $this->exif_frac2dec( $exif['FNumber'] ), 2 ); if (!empty($exif['Model'])) $meta['camera'] = trim( $exif['Model'] ); if (!empty($exif['DateTimeDigitized'])) - $meta['created_timestamp'] = date_i18n(get_option('date_format') . ' ' . get_option('time_format'), $this->exif_date2ts($exif['DateTimeDigitized'])); + $meta['created_timestamp'] = $this->exif_date2ts($exif['DateTimeDigitized']); else if (!empty($exif['DateTimeOriginal'])) - $meta['created_timestamp'] = date_i18n(get_option('date_format') . ' ' . get_option('time_format'), $this->exif_date2ts($exif['DateTimeOriginal'])); + $meta['created_timestamp'] = $this->exif_date2ts($exif['DateTimeOriginal']); else if (!empty($exif['FileDateTime'])) - $meta['created_timestamp'] = date_i18n(get_option('date_format') . ' ' . get_option('time_format'), $this->exif_date2ts($exif['FileDateTime'])); + $meta['created_timestamp'] = $this->exif_date2ts($exif['FileDateTime']); if (!empty($exif['FocalLength'])) $meta['focal_length'] = $this->exif_frac2dec( $exif['FocalLength'] ) . __(' mm','nggallery'); if (!empty($exif['ISOSpeedRatings'])) @@ -201,13 +204,17 @@ class nggMeta{ } // convert the exif date format to a unix timestamp - function exif_date2ts($str) { - // seriously, who formats a date like 'YYYY:MM:DD hh:mm:ss'? - @list( $date, $time ) = explode( ' ', trim($str) ); - @list( $y, $m, $d ) = explode( ':', $date ); + function exif_date2ts($str) + { + $retval = is_numeric($str) ? $str : @strtotime($str); + if (!$retval && $str) { + @list( $date, $time ) = explode( ' ', trim($str) ); + @list( $y, $m, $d ) = explode( ':', $date ); + $retval = strtotime( "{$y}-{$m}-{$d} {$time}" ); - return strtotime( "{$y}-{$m}-{$d} {$time}" ); - } + } + return $retval; + } /** * nggMeta::readIPTC() - IPTC Data Information for EXIF Display @@ -387,7 +394,7 @@ class nggMeta{ switch ($key) { case 'xap:CreateDate': case 'xap:ModifyDate': - $this->xmp_array[$value] = date_i18n(get_option('date_format').' '.get_option('time_format'), strtotime($xmlarray[$key])); + $this->xmp_array[$value] = $this->exif_date2ts($xmlarray[$key]); break; default : $this->xmp_array[$value] = $xmlarray[$key]; @@ -424,21 +431,24 @@ class nggMeta{ * @param string $object * @return mixed $value */ - function get_META($object = false) { - - // defined order first look into database, then XMP, IPTC and EXIF. - if ($value = $this->get_saved_meta($object)) - return $value; - if ($value = $this->get_XMP($object)) - return $value; - if ($value = $this->get_IPTC($object)) - return $value; - if ($value = $this->get_EXIF($object)) - return $value; + function get_META($object = false) { + + // defined order first look into database, then XMP, IPTC and EXIF. + if ($value = $this->get_saved_meta($object)) + return $value; + if ($value = $this->get_XMP($object)) + return $value; + if ($object == 'created_timestamp' && ($d = $this->get_IPTC('created_date')) && ($t = $this->get_IPTC('created_time'))) { + return $this->exif_date2ts($d . ' '.$t); + } + if ($value = $this->get_IPTC($object)) + return $value; + if ($value = $this->get_EXIF($object)) + return $value; - // nothing found ? - return false; - } + // nothing found ? + return false; + } /** * nggMeta::i8n_name() - localize the tag name @@ -498,42 +508,24 @@ class nggMeta{ * Return the Timestamp from the image , if possible it's read from exif data * @return int */ - function get_date_time() { + function get_date_time() { $date = time(); - // Try XMP first - if (isset($this->xmp_array['created_timestamp'])) { - $date = @strtotime($this->xmp_array['created_timestamp']); - } - - // Then EXIF - else if (isset($this->exif_array['created_timestamp'])) { - $date = @strtotime($this->exif_array['created_timestamp']); - } - - // Then IPTC - else if (isset($this->iptc_array['created_date'])) { - $date = $this->iptc_array['created_date']; - if (isset($this->iptc_array['created_time'])) { - $date .= " {$this->iptc_array['created_time']}"; - } - $date = @strtotime($date); - } - - // If all else fails, use the file creation time - else if ($this->image->imagePath) { - $date = @filectime($this->image->imagePath); + $date = $this->exif_date2ts($this->get_META('created_timestamp')); + if (!$date) { + $image_path = C_Gallery_Storage::get_instance()->get_backup_abspath($this->image); + $date = @filectime($image_path); } // Failback if (!$date) $date = time(); - // Return the MySQL format - $date_time = date( 'Y-m-d H:i:s', $date); + // Return the MySQL format + $date_time = date( 'Y-m-d H:i:s', $date); - return $date_time; - } + return $date_time; + } /** * This function return the most common metadata, via a filter we can add more diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/multisite.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/multisite.php index 96dd2bc17b8f2b7bf591727cebb43ee4e6acb9cb..e8f36a9893db4eaf6a4b4763470e9d49a31fcba5 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/multisite.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/multisite.php @@ -1,57 +1,57 @@ -<?php -/** -* Main PHP Class for Multisite setup -* -* @author Alex Rabe -* -* -*/ -class nggWPMU{ - - /** - * Check the Quota under WPMU. Only needed for this case - * - * @class nggWPMU - * @return bool $result - */ - function check_quota() { - if ( get_site_option( 'upload_space_check_disabled' ) ) - return false; - - if ( (is_multisite()) && nggWPMU::wpmu_enable_function('wpmuQuotaCheck')) - if( $error = upload_is_user_over_quota( false ) ) { - nggGallery::show_error( __( 'Sorry, you have used your space allocation. Please delete some files to upload more files.','nggallery' ) ); - return true; - } - return false; - } - - /** - * Check for site admin - * - * @return - */ - function wpmu_site_admin() { - - if ( function_exists('is_super_admin') ) - if ( is_super_admin() ) - return true; - - return false; - } - - /** - * Check for site wide options - * - * @param string $value - * @return value - */ - function wpmu_enable_function($value) { - if (is_multisite()) { - $ngg_options = get_site_option('ngg_options'); - return $ngg_options[$value]; - } - // if this is not WPMU, enable it ! - return true; - } -} +<?php +/** +* Main PHP Class for Multisite setup +* +* @author Alex Rabe +* +* +*/ +class nggWPMU{ + + /** + * Check the Quota under WPMU. Only needed for this case + * + * @class nggWPMU + * @return bool $result + */ + function check_quota() { + if ( get_site_option( 'upload_space_check_disabled' ) ) + return false; + + if ( (is_multisite()) && nggWPMU::wpmu_enable_function('wpmuQuotaCheck')) + if( $error = upload_is_user_over_quota( false ) ) { + nggGallery::show_error( __( 'Sorry, you have used your space allocation. Please delete some files to upload more files.','nggallery' ) ); + return true; + } + return false; + } + + /** + * Check for site admin + * + * @return + */ + function wpmu_site_admin() { + + if ( function_exists('is_super_admin') ) + if ( is_super_admin() ) + return true; + + return false; + } + + /** + * Check for site wide options + * + * @param string $value + * @return value + */ + function wpmu_enable_function($value) { + if (is_multisite()) { + $ngg_options = get_site_option('ngg_options'); + return $ngg_options[$value]; + } + // if this is not WPMU, enable it ! + return true; + } +} diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/ngg-db.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/ngg-db.php index 10ad9781c7771788b4e570748de7e78bd180d9a9..9e39c72d16fedfd0dc9851b9f5b7c23df5f0fc80 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/ngg-db.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/ngg-db.php @@ -1,5 +1,4 @@ <?php -if ( !class_exists('nggdb') ) : /** * NextGEN Gallery Database Class * @@ -7,8 +6,8 @@ if ( !class_exists('nggdb') ) : * * @since 1.0.0 */ -class nggdb { - +class nggdb +{ /** * Holds the list of all galleries * @@ -45,14 +44,6 @@ class nggdb { */ var $paged = false; - /** - * PHP4 compatibility layer for calling the PHP5 constructor. - * - */ - function nggdb() { - return $this->__construct(); - } - /** * Init the Database Abstraction layer for NextGEN Gallery * @@ -66,7 +57,6 @@ class nggdb { $this->paged = array(); register_shutdown_function(array(&$this, '__destruct')); - } /** @@ -79,140 +69,104 @@ class nggdb { } /** - * Get all the album and unserialize the content + * Get a gallery given its ID * - * @since 1.3.0 + * + * @param int|string $id or $slug + * @return A nggGallery object (null if not found) + * @deprecated Use the C_Gallery_Mapper class instead + */ + static function find_gallery( $id ) + { + // TODO: This method is only used by nggAdmin::set_gallery_preview(), which won't be + // exist after ngglegacy uses the gallery storage component to import galleries from the FS. + $mapper = C_Gallery_Mapper::get_instance(); + return $mapper->find($id); + } + + /** + * Finds all galleries + * @deprecated + * @return array + */ + static function find_all_galleries() + { + $mapper = C_Gallery_Mapper::get_instance(); + return $mapper->find_all(); + } + + /** + * Finds all albums + * + * @deprecated * @param string $order_by * @param string $order_dir * @param int $limit number of albums, 0 shows all albums * @param int $start the start index for paged albums * @return array $album */ - function find_all_album( $order_by = 'id', $order_dir = 'ASC', $limit = 0, $start = 0) { - global $wpdb; - - $order_dir = ( $order_dir == 'DESC') ? 'DESC' : 'ASC'; - $limit_by = ( $limit > 0 ) ? 'LIMIT ' . intval($start) . ',' . intval($limit) : ''; - $this->albums = $wpdb->get_results("SELECT * FROM $wpdb->nggalbum ORDER BY {$order_by} {$order_dir} {$limit_by}" , OBJECT_K ); - - if ( !$this->albums ) - return array(); - - // XXX nggdb is used statically, cannot inherit from Ngg_Serializable - $serializer = new Ngg_Serializable(); - - foreach ($this->albums as $key => $value) { - $this->albums[$key]->galleries = empty ($this->albums[$key]->sortorder) ? array() : (array) $serializer->unserialize($this->albums[$key]->sortorder) ; - $this->albums[$key]->name = stripslashes( $this->albums[$key]->name ); - $this->albums[$key]->albumdesc = stripslashes( $this->albums[$key]->albumdesc ); - wp_cache_add($key, $this->albums[$key], 'ngg_album'); - } - - return $this->albums; + function find_all_album($order_by = 'id', $order_dir = 'ASC', $limit = '0', $start = '0') + { + $mapper = C_Album_Mapper::get_instance(); + $mapper->select(); + $mapper->where_and(array()); + $mapper->order_by($order_by, $order_dir); + if ($limit > 0) + $mapper->limit($limit, $start); + return $mapper->run_query(); } /** - * Get all the galleries + * Search for a filename * - * @param string $order_by - * @param string $order_dir - * @param bool $counter (optional) Select true when you need to count the images - * @param int $limit number of paged galleries, 0 shows all galleries - * @param int $start the start index for paged galleries - * @param bool $exclude - * @return array $galleries + * @deprecated + * @param string $filename + * @param int (optional) $galleryID + * @return Array Result of the request */ - function find_all_galleries($order_by = 'gid', $order_dir = 'ASC', $counter = false, $limit = 0, $start = 0, $exclude = true) { - global $wpdb; - $registry = C_Component_Registry::get_instance(); - $storage = $registry->get_utility('I_Gallery_Storage'); - - // Check for the exclude setting - $exclude_clause = ($exclude) ? ' AND exclude<>1 ' : ''; - $order_dir = ( $order_dir == 'DESC') ? 'DESC' : 'ASC'; - $limit_by = ( $limit > 0 ) ? 'LIMIT ' . intval($start) . ',' . intval($limit) : ''; - $this->galleries = $wpdb->get_results( "SELECT SQL_CALC_FOUND_ROWS * FROM $wpdb->nggallery ORDER BY {$order_by} {$order_dir} {$limit_by}", OBJECT_K ); - - // Count the number of galleries and calculate the pagination - if ($limit > 0) { - $this->paged['total_objects'] = intval ( $wpdb->get_var( "SELECT FOUND_ROWS()" ) ); - $this->paged['objects_per_page'] = max ( count( $this->galleries ), $limit ); - $this->paged['max_objects_per_page'] = ( $limit > 0 ) ? ceil( $this->paged['total_objects'] / intval($limit)) : 1; - } - - if ( !$this->galleries ) - return array(); - - // get the galleries information - foreach ($this->galleries as $key => $value) { - $galleriesID[] = $key; - // init the counter values - $this->galleries[$key]->counter = 0; - $this->galleries[$key]->title = stripslashes($this->galleries[$key]->title); - $this->galleries[$key]->galdesc = stripslashes($this->galleries[$key]->galdesc); - $this->galleries[$key]->abspath = $storage->get_gallery_abspath($this->galleries[$key]); - wp_cache_add($key, $this->galleries[$key], 'ngg_gallery'); - } - - // if we didn't need to count the images then stop here - if ( !$counter ) - return $this->galleries; - - // get the counter values - $picturesCounter = $wpdb->get_results('SELECT galleryid, COUNT(*) as counter FROM '.$wpdb->nggpictures.' WHERE galleryid IN (\''.implode('\',\'', $galleriesID).'\') ' . $exclude_clause . ' GROUP BY galleryid', OBJECT_K); - - if ( !$picturesCounter ) - return $this->galleries; - - // add the counter to the gallery objekt - foreach ($picturesCounter as $key => $value) { - $this->galleries[$value->galleryid]->counter = $value->counter; - wp_cache_set($value->galleryid, $this->galleries[$value->galleryid], 'ngg_gallery'); + function search_for_file($filename, $galleryID = false) + { + $retval = array(); + $mapper = C_Image_Mapper::get_instance(); + $mapper->select(); + $mapper->where_and(array('filename = %s', $filename)); + if ($galleryID) + $mapper->where_and(array('galleryid = %d', $galleryID)); + foreach ($mapper->run_query() as $dbimage) { + $image = new C_Image_Wrapper($dbimage); + $retval[] = $image; } - - return $this->galleries; + return $retval; } /** - * Get a gallery given its ID + * Get random images from one or more gallery * - * @param int|string $id or $slug - * @return A nggGallery object (null if not found) + * @deprecated + * @param integer $number of images + * @param integer $galleryID optional a Gallery + * @return A nggImage object representing the image (null if not found) */ - function find_gallery( $id ) { - global $wpdb; - - if( is_numeric($id) ) { - - if ( $gallery = wp_cache_get($id, 'ngg_gallery') ) - return $gallery; - - $gallery = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->nggallery WHERE gid = %d", $id ) ); - - } else - $gallery = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->nggallery WHERE slug = %s", $id ) ); - - // Build the object from the query result - if ($gallery) { - $registry = C_Component_Registry::get_instance(); - $storage = $registry->get_utility('I_Gallery_Storage'); - - // it was a bad idea to use a object, stripslashes_deep() could not used here, learn from it - $gallery->title = stripslashes($gallery->title); - $gallery->galdesc = stripslashes($gallery->galdesc); - $gallery->abspath = $storage->get_gallery_abspath($gallery); - - //TODO:Possible failure , $id could be a number or name - wp_cache_add($id, $gallery, 'ngg_gallery'); - - return $gallery; - } else - return false; + function get_random_images($number = 1, $gallery_id = 0) + { + $mapper = C_Image_Mapper::get_instance(); + $mapper->select(); + $mapper->where_and(array('exclude != 1')); + if ($gallery_id !== 0) + $mapper->where_and(array('galleryid = %d', $gallery_id)); + $mapper->order_by('rand()'); + $mapper->limit($number, 0); + foreach ($mapper->run_query() as $dbimage) { + $image = new C_Image_Wrapper($dbimage); + $retval[] = $image; + } + return $retval; } /** * This function return all information about the gallery and the images inside * + * @deprecated * @param int|string $id or $name * @param string $order_by * @param string $order_dir (ASC |DESC) @@ -222,56 +176,28 @@ class nggdb { * @param bool $json remove the key for associative array in json request * @return An array containing the nggImage objects representing the images in the gallery. */ - function get_gallery($id, $order_by = 'sortorder', $order_dir = 'ASC', $exclude = true, $limit = 0, $start = 0, $json = false) { - - global $wpdb; - - // init the gallery as empty array - $gallery = array(); - $i = 0; - - // Check for the exclude setting - $exclude_clause = ($exclude) ? ' AND tt.exclude<>1 ' : ''; - - // Say no to any other value - $order_dir = ( $order_dir == 'DESC') ? 'DESC' : 'ASC'; - $order_by = ( empty($order_by) ) ? 'sortorder' : $order_by; - $order_clause = "ABS(tt.{$order_by}) {$order_dir}, tt.{$order_by} {$order_dir}"; -// $order_clause = "LENGTH(tt.{$order_by}) {$order_dir}, tt.{$order_by} {$order_dir}"; - - // Should we limit this query ? - $limit_by = ( $limit > 0 ) ? 'LIMIT ' . intval($start) . ',' . intval($limit) : ''; + static function get_gallery($id, $order_by = 'sortorder', $order_dir = 'ASC', $exclude = true, $limit = 0, $start = 0, $json = false) + { + $retval = array(); - // Query database - if( is_numeric($id) ) - $result = $wpdb->get_results( $wpdb->prepare( "SELECT SQL_CALC_FOUND_ROWS tt.*, t.* FROM $wpdb->nggallery AS t INNER JOIN $wpdb->nggpictures AS tt ON t.gid = tt.galleryid WHERE t.gid = %d {$exclude_clause} ORDER BY {$order_clause} {$limit_by}", $id ), OBJECT_K ); + $image_mapper = C_Image_Mapper::get_instance(); + if (is_numeric($id)) + $image_mapper->select()->where(array("galleryid = %d", $id)); else - $result = $wpdb->get_results( $wpdb->prepare( "SELECT SQL_CALC_FOUND_ROWS tt.*, t.* FROM $wpdb->nggallery AS t INNER JOIN $wpdb->nggpictures AS tt ON t.gid = tt.galleryid WHERE t.slug = %s {$exclude_clause} ORDER BY {$order_clause} {$limit_by}", $id ), OBJECT_K ); + $image_mapper->select()->where(array("slug = %s", $id)); + $image_mapper->order_by($order_by, $order_dir); - // Count the number of images and calculate the pagination - if ($limit > 0) { - $this->paged['total_objects'] = intval ( $wpdb->get_var( "SELECT FOUND_ROWS()" ) ); - $this->paged['objects_per_page'] = max ( count( $result ), $limit ); - $this->paged['max_objects_per_page'] = ( $limit > 0 ) ? ceil( $this->paged['total_objects'] / intval($limit)) : 1; - } - - // Build the object - if ($result) { + if ($exclude) $image_mapper->where(array('exclude != %d', 1)); - // Now added all image data - foreach ($result as $key => $value) { - // due to a browser bug we need to remove the key for associative array for json request - // (see http://code.google.com/p/chromium/issues/detail?id=883) - if ($json) $key = $i++; - $gallery[$key] = new nggImage( $value ); // keep in mind each request require 8-16 kb memory usage + if ($limit && $start) $image_mapper->limit($limit, $start); + elseif ($limit) $image_mapper->limit($limit); - } + foreach ($image_mapper->run_query() as $dbimage) { + $image = new C_Image_Wrapper($dbimage); + $retval[] = $image; } - // Could not add to cache, the structure is different to find_gallery() cache_add, need rework - //wp_cache_add($id, $gallery, 'ngg_gallery'); - - return $gallery; + return $retval; } /** @@ -700,20 +626,11 @@ class nggdb { /** * Delete an image entry from the database * @param integer $id is the Image ID + * @deprecated */ - function delete_image( $id ) { - global $wpdb; - - // Delete the image - $result = $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->nggpictures WHERE pid = %d", $id) ); - - // Delete tag references - wp_delete_object_term_relationships( $id, 'ngg_tag'); + static function delete_image( $id ) { - // Remove from cache - wp_cache_delete( $id, 'ngg_image'); - - return $result; + return C_Image_Mapper::get_instance()->destroy($id); } /** @@ -724,88 +641,45 @@ class nggdb { * @param bool $exclude do not show exluded images * @param int $galleryId Only look for images with this gallery id, or in all galleries if id is 0 * @param string $orderby is one of "id" (default, order by pid), "date" (order by exif date), sort (order by user sort order) + * @deprecated * @return */ - function find_last_images($page = 0, $limit = 30, $exclude = true, $galleryId = 0, $orderby = "id") { - global $wpdb; - - // Check for the exclude setting - $exclude_clause = ($exclude) ? ' AND exclude<>1 ' : ''; - - // a limit of 0 makes no sense - $limit = ($limit == 0) ? 30 : $limit; - // calculate the offset based on the pagr number - $offset = (int) $page * $limit; - - $galleryId = (int) $galleryId; - $gallery_clause = ($galleryId === 0) ? '' : ' AND galleryid = ' . $galleryId . ' '; - - // default order by pid - $order = 'pid DESC'; - switch ($orderby) { - case 'date': - $order = 'imagedate DESC'; - break; - case 'sort': - $order = 'sortorder ASC'; - break; - } - - $result = array(); - $gallery_cache = array(); - - // Query database - $images = $wpdb->get_results("SELECT * FROM $wpdb->nggpictures WHERE 1=1 $exclude_clause $gallery_clause ORDER BY $order LIMIT $offset, $limit"); - - // Build the object from the query result - if ($images) { - foreach ($images as $key => $image) { - - // cache a gallery , so we didn't need to lookup twice - if (!array_key_exists($image->galleryid, $gallery_cache)) - $gallery_cache[$image->galleryid] = nggdb::find_gallery($image->galleryid); - - // Join gallery information with picture information - foreach ($gallery_cache[$image->galleryid] as $index => $value) - $image->$index = $value; - - // Now get the complete image data - $result[$key] = new nggImage( $image ); - } - } - - return $result; - } - - /** - * nggdb::get_random_images() - Get an random image from one ore more gally - * - * @param integer $number of images - * @param integer $galleryID optional a Gallery - * @return A nggImage object representing the image (null if not found) - */ - function get_random_images($number = 1, $galleryID = 0) { - global $wpdb; - - $number = (int) $number; - $galleryID = (int) $galleryID; - $images = array(); - - // Query database - if ($galleryID == 0) - $result = $wpdb->get_results("SELECT t.*, tt.* FROM $wpdb->nggallery AS t INNER JOIN $wpdb->nggpictures AS tt ON t.gid = tt.galleryid WHERE tt.exclude != 1 ORDER by rand() limit $number"); - else - $result = $wpdb->get_results("SELECT t.*, tt.* FROM $wpdb->nggallery AS t INNER JOIN $wpdb->nggpictures AS tt ON t.gid = tt.galleryid WHERE t.gid = $galleryID AND tt.exclude != 1 ORDER by rand() limit {$number}"); - - // Return the object from the query result - if ($result) { - foreach ($result as $image) { - $images[] = new nggImage( $image ); - } - return $images; - } - - return null; + static function find_last_images($page = 0, $limit = 30, $exclude = true, $galleryId = 0, $orderby = "id") { + // Determine ordering + $order_field = $orderby; + $order_direction = 'DESC'; + switch ($orderby) { + case 'date': + case 'imagedate': + case 'time': + case 'datetime': + $order_field = 'imagedate'; + $order_direction = 'DESC'; + break; + case 'sort': + case 'sortorder': + $order_field = 'sortorder'; + $order_direction = 'ASC'; + break; + + } + + // Start query + $mapper = C_Image_Mapper::get_instance(); + $mapper->select()->order_by($order_field, $order_direction); + + // Calculate limit and offset + if (!$limit) $limit = 30; + $offset = $page*$limit; + if ($offset && $limit) $mapper->limit($limit, $offset); + + // Add exclusion clause + if ($exclude) $mapper->where(array("exclude = %d"), 1); + + // Add gallery clause + if ($galleryId) $mapper->where(array("galleryid = %d"), $galleryId); + + return $mapper->run_query(); } /** @@ -818,7 +692,9 @@ class nggdb { * @return An array containing the nggImage objects representing the images in the album. */ function find_images_in_album($album, $order_by = 'galleryid', $order_dir = 'ASC', $exclude = true) { - global $wpdb; + // TODO: This method is only used by the JSON API. Once it's removed, this method can be removed + + global $wpdb; if ( !is_object($album) ) $album = nggdb::find_album( $album ); @@ -1000,42 +876,6 @@ class nggdb { return $result; } - /** - * search for a filename - * - * @since 1.4.0 - * @param string $filename - * @param int (optional) $galleryID - * @return Array Result of the request - */ - function search_for_file( $filename, $galleryID = false ) { - global $wpdb; - - // If a search pattern is specified, load the posts that match - if ( !empty($filename) ) { - // added slashes screw with quote grouping when done early, so done later - $term = $wpdb->escape($filename); - - $where_clause = ''; - if ( is_numeric($galleryID) ) { - $id = (int) $galleryID; - $where_clause = " AND tt.galleryid = {$id}"; - } - } - - // build the final query - $query = "SELECT t.*, tt.* FROM $wpdb->nggallery AS t INNER JOIN $wpdb->nggpictures AS tt ON t.gid = tt.galleryid WHERE tt.filename = '{$term}' {$where_clause} ORDER BY tt.pid ASC "; - $result = $wpdb->get_row($query); - - // Return the object from the query result - if ($result) { - $image = new nggImage( $result ); - return $image; - } - - return null; - } - /** * Update or add meta data for an image @@ -1125,7 +965,6 @@ class nggdb { } } -endif; if ( ! isset($GLOBALS['nggdb']) ) { /** diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/post-thumbnail.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/post-thumbnail.php index 0f91f7fe839a91046987fb9d26fdf4c6e66b0357..720d66de59b3d681e96b20c96d5f70f26068ce9b 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/post-thumbnail.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/post-thumbnail.php @@ -11,14 +11,6 @@ */ class nggPostThumbnail { - /** - * PHP4 compatibility layer for calling the PHP5 constructor. - * - */ - function nggPostThumbnail() { - return $this->__construct(); - } - /** * Main constructor - Add filter and action hooks * @@ -64,10 +56,9 @@ class nggPostThumbnail { $iframe_src = add_query_arg('tab', 'nextgen', $iframe_src); $iframe_src = add_query_arg('chromeless', '1', $iframe_src); $iframe_src = add_query_arg('TB_iframe', '1', $iframe_src); - - $set_thumbnail_link = '<p class="hide-if-no-js"><a title="' . esc_attr__( 'Set NextGEN featured image', 'nggallery' ) . '" href="' . nextgen_esc_url( $iframe_src ) . '" id="set-ngg-post-thumbnail" class="thickbox">%s</a></p>'; - - $content .= sprintf($set_thumbnail_link, esc_html__( 'Set NextGEN featured image', 'nggallery' )); + + $set_thumbnail_link = '<p class="hide-if-no-js"><a title="' . esc_attr__( 'Set NextGEN featured image', 'nggallery' ) . '" href="' . nextgen_esc_url( $iframe_src ) . '" id="set-ngg-post-thumbnail" class="thickbox">%s</a></p>'; + $content .= sprintf($set_thumbnail_link, esc_html__( 'Set NextGEN featured image', 'nggallery' )); } return $content; @@ -159,6 +150,11 @@ class nggPostThumbnail { */ function ajax_set_post_thumbnail() { + // This function does the following: + // 1) Check if the user is logged in and has permission to edit the post + // 2) Get the thumbnail id from the POST request. The thumbnail id is actually the NGG image id + // 3)] + global $post_ID; // check for correct capability @@ -179,139 +175,7 @@ class nggPostThumbnail { die('0'); } - if ($thumbnail_id != null) - { - $registry = C_Component_Registry::get_instance(); - $imap = $registry->get_utility('I_Image_Mapper'); - $storage = $registry->get_utility('I_Gallery_Storage'); - - $image = $imap->find($thumbnail_id); - - // for NGG we look for the image id - if ($image) - { - $image_id = $thumbnail_id; - - $args = array( - 'post_type' => 'attachment', - 'meta_key' => '_ngg_image_id', - 'meta_compare' => '==', - 'meta_value' => $image_id - ); - - $upload_dir = wp_upload_dir(); - $basedir = $upload_dir['basedir']; - $thumbs_dir = implode(DIRECTORY_SEPARATOR, array($basedir, 'ngg_featured')); - $gallery_abspath = $storage->get_gallery_abspath($image->galleryid); - $image_abspath = $storage->get_full_abspath($image); - $target_path = null; - - $posts = get_posts($args); - $attachment_id = null; - - if ($posts != null) - { - $attachment_id = $posts[0]->ID; - } - else - { - $url = $storage->get_full_url($image); - - $target_relpath = null; - $target_basename = basename($image_abspath); - - if (strpos($image_abspath, $gallery_abspath) === 0) - { - $target_relpath = substr($image_abspath, strlen($gallery_abspath)); - } - else if ($image->galleryid) - { - $target_relpath = path_join(strval($image->galleryid), $target_basename); - } - else - { - $target_relpath = $target_basename; - } - - $target_relpath = trim($target_relpath, '\\/'); - $target_path = path_join($thumbs_dir, $target_relpath); - $max_count = 100; - $count = 0; - - while (file_exists($target_path) && $count <= $max_count) - { - $count++; - - $pathinfo = pathinfo($target_path); - $dirname = $pathinfo['dirname']; - $filename = $pathinfo['filename']; - $extension = $pathinfo['extension']; - - $rand = mt_rand(1, 9999); - $basename = $filename . '_' . sprintf('%04d', $rand) . '.' . $extension; - - $target_path = path_join($dirname, $basename); - } - - if (file_exists($target_path)) - { - // XXX handle very rare case in which $max_count wasn't enough? - } - - $target_dir = dirname($target_path); - - wp_mkdir_p($target_dir); - - if (@copy($image_abspath, $target_path)) - { - $size = @getimagesize($target_path); - $image_type = ($size) ? $size['mime'] : 'image/jpeg'; - - $title = sanitize_file_name($image->alttext); - $caption = sanitize_file_name($image->description); - - $attachment = array( - 'post_title' => $title, - 'post_content' => $caption, - 'post_status' => 'attachment', - 'post_parent' => 0, - 'post_mime_type' => $image_type, - 'guid' => $url - ); - - // Save the data - $attachment_id = wp_insert_attachment($attachment, $target_path); - - if ($attachment_id) - { - wp_update_attachment_metadata($attachment_id, wp_generate_attachment_metadata($attachment_id, $target_path)); - - update_post_meta($attachment_id, '_ngg_image_id', $image_id); - } - } - } - - if ($attachment_id) - { - //$attachment = get_post($attachment_id); - //$attachment_meta = wp_get_attachment_metadata($attachment_id); - $attachment_file = get_attached_file($attachment_id); - $target_path = $attachment_file; - - if (filemtime($image_abspath) > filemtime($target_path)) - { - if (@copy($image_abspath, $target_path)) - { - wp_update_attachment_metadata($attachment_id, wp_generate_attachment_metadata($attachment_id, $target_path)); - } - } - - die(strval($attachment_id)); - } - } - } - - die('0'); + die(strval(C_Gallery_Storage::get_instance()->set_post_thumbnail($post_ID, $thumbnail_id))); } /** diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/rewrite.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/rewrite.php index 6f2e9bd1deb0e05ce63f876a2847e9f8879cf344..93402d131150b5918458e4cff297430d5b774475 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/rewrite.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/rewrite.php @@ -31,8 +31,8 @@ class nggRewrite { /** * Constructor */ - function nggRewrite() { - + function __construct() + { // read the option setting $this->options = get_option('ngg_options'); diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/shortcodes.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/shortcodes.php index dbb47065dde48033b1d123e1b2dfdfb8f7cda9ae..6ef2a7ad4064aa0bb26cfff8826162988aaf11d0 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/shortcodes.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/shortcodes.php @@ -11,8 +11,8 @@ class NextGEN_shortcodes { // register the new shortcodes - function NextGEN_shortcodes() { - + function __construct() + { // Long posts should require a higher limit, see http://core.trac.wordpress.org/ticket/8553 $pcre_limit = 500000; if ((int)ini_get('pcre.backtrack_limit') < $pcre_limit) { diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/sitemap.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/sitemap.php index 1bb9f0804bde2d33a50e74ca54286ec3425bd044..30c895c75bd557463d56702aa6370313b42a997c 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/sitemap.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/sitemap.php @@ -70,21 +70,25 @@ class nggSitemaps { 'id' => 0 ), $atts )); - // backward compat for user which uses the name instead, still deprecated - if( !is_numeric($id) ) - $id = $wpdb->get_var( $wpdb->prepare ("SELECT gid FROM $wpdb->nggallery WHERE name = '%s' ", $id) ); - - $images = nggdb::get_gallery($id, 'pid', 'ASC', true, 1000); - - foreach ($images as $image) { - $newimage = array(); - $newimage['src'] = $newimage['sc'] = $image->imageURL; - if ( !empty($image->title) ) - $newimage['title'] = $image->title; - if ( !empty($image->alttext) ) - $newimage['alt'] = $image->alttext; - $this->images[] = $newimage; - } + $gallery_mapper = C_Gallery_Mapper::get_instance(); + if (!is_numeric($id)) { + if (($gallery = array_shift($gallery_mapper->select()->where(array('name = %s', $id))->limit(1)->run_query()))) { + $id = $gallery->{$gallery->id_field}; + } + else $id = NULL; + } + + if ($id) { + $gallery_storage = C_Gallery_Storage::get_instance(); + $image_mapper = C_Image_Mapper::get_instance(); + foreach ($image_mapper->find_all_for_gallery($id) as $image) { + $this->images[] = array( + 'src' => $gallery_storage->get_image_url($image), + 'title' => $image->title, + 'alt' => $image->alttext + ); + } + } return ''; } diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/tags.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/tags.php index ce9a5f15e982d223fc4655fc2717a41b2731bb3a..666f6601bf3cae0efb2786cd4638cf61f57d75ba 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/tags.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/lib/tags.php @@ -13,7 +13,7 @@ class nggTags { /** * Copy tags */ - function copy_tags($src_pid, $dest_pid) { + static function copy_tags($src_pid, $dest_pid) { $tags = wp_get_object_terms( $src_pid, 'ngg_tag', 'fields=ids' ); $tags = array_map('intval', $tags); wp_set_object_terms( $dest_pid, $tags, 'ngg_tag', true ); @@ -24,7 +24,7 @@ class nggTags { /** * Rename tags */ - function rename_tags($old = '', $new = '') { + static function rename_tags($old = '', $new = '') { $return_value = array( 'status' => 'ok', @@ -155,7 +155,7 @@ class nggTags { /** * Delete tags */ - function delete_tags($delete) { + static function delete_tags($delete) { $return_value = array( 'status' => 'ok', 'message' => '' @@ -191,12 +191,14 @@ class nggTags { } do_action('ngg_manage_tags', $delete_tags); + + return $return_value; } /** * Edit tag slug given the name of the tag */ - function edit_tag_slug( $names = '', $slugs = '' ) { + static function edit_tag_slug( $names = '', $slugs = '' ) { $return_value = array( 'status' => 'ok', 'message' => '' @@ -253,14 +255,14 @@ class nggTags { /** * Get a list of the tags used by the images */ - function find_all_tags() { + static function find_all_tags() { return get_terms('ngg_tag', ''); } /** * */ - function find_tags( $args = '', $skip_cache = false ) { + static function find_tags( $args = '', $skip_cache = false ) { $taxonomy = 'ngg_tag'; if ( $skip_cache == true ) { @@ -301,7 +303,7 @@ class nggTags { * @param string $mode could be 'ASC' or 'RAND' * @return array of images */ - function find_images_for_tags($taglist, $mode = "ASC") { + static function find_images_for_tags($taglist, $mode = "ASC") { // return the images based on the tag global $wpdb; @@ -334,7 +336,7 @@ class nggTags { /** * Return one image based on the tag. Required for a tag based album overview */ - function get_album_images($taglist) { + static function get_album_images($taglist) { global $wpdb; $taxonomy = 'ngg_tag'; diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/module.ngglegacy.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/module.ngglegacy.php index 4b6718623d078d28c1d39b9ea36548fec131ccef..ef82f8ca9d509918973cbef34bd427846ab7ae0e 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/module.ngglegacy.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/module.ngglegacy.php @@ -22,13 +22,12 @@ class M_NggLegacy extends C_Base_Module 'photocrati-nextgen-legacy', 'NextGEN Legacy', 'Embeds the original version of NextGEN 1.9.3 by Alex Rabe', - '0.13', + '0.14', 'http://www.nextgen-gallery.com', 'Photocrati Media', 'http://www.photocrati.com' ); - include_once('class.ngglegacy_installer.php'); C_Photocrati_Installer::add_handler($this->module_id, 'C_NggLegacy_Installer'); } @@ -49,4 +48,111 @@ class M_NggLegacy extends C_Base_Module } } +class C_NggLegacy_Installer +{ + function install() + { + global $wpdb; + include_once('admin/install.php'); + + $this->remove_transients(); + + if (is_multisite()) { + $network=isset($_SERVER['SCRIPT_NAME'])?$_SERVER['SCRIPT_NAME']:""; + $activate=isset($_GET['action'])?$_GET['action']:""; + $isNetwork=($network=='/wp-admin/network/plugins.php')?true:false; + $isActivation=($activate=='deactivate')?false:true; + + if ($isNetwork and $isActivation){ + $old_blog = $wpdb->blogid; + $blogids = $wpdb->get_col($wpdb->prepare("SELECT blog_id FROM $wpdb->blogs", NULL)); + foreach ($blogids as $blog_id) { + switch_to_blog($blog_id); + nggallery_install($this); + } + switch_to_blog($old_blog); + return; + } + } + // remove the update message + delete_option( 'ngg_update_exists' ); + nggallery_install($this); + } + + function uninstall($hard=FALSE) + { + include_once('admin/install.php'); + + delete_option('ngg_init_check'); + delete_option('ngg_update_exists'); + delete_option( 'ngg_options' ); + delete_option( 'ngg_db_version' ); + delete_option( 'ngg_update_exists' ); + delete_option( 'ngg_next_update' ); + + // now remove the capability + ngg_remove_capability("NextGEN Gallery overview"); + ngg_remove_capability("NextGEN Use TinyMCE"); + ngg_remove_capability("NextGEN Upload images"); + ngg_remove_capability("NextGEN Manage gallery"); + ngg_remove_capability("NextGEN Edit album"); + ngg_remove_capability("NextGEN Change style"); + ngg_remove_capability("NextGEN Change options"); + ngg_remove_capability("NextGEN Attach Interface"); + + $this->remove_transients(); + } + + function remove_transients() + { + global $wpdb, $_wp_using_ext_object_cache; + + // Fetch all transients + $query = " + SELECT option_name FROM {$wpdb->options} + WHERE option_name LIKE '%ngg_request%' + "; + $transient_names = $wpdb->get_col($query);; + + // Delete all transients in the database + $query = " + DELETE FROM {$wpdb->options} + WHERE option_name LIKE '%ngg_request%' + "; + $wpdb->query($query); + + // If using an external caching mechanism, delete the cached items + if ($_wp_using_ext_object_cache) { + foreach ($transient_names as $transient) { + wp_cache_delete($transient, 'transient'); + wp_cache_delete(substr($transient, 11), 'transient'); + } + } + } + + function upgrade_schema($sql) + { + global $wpdb; + + // upgrade function changed in WordPress 2.3 + require_once(ABSPATH . 'wp-admin/includes/upgrade.php'); + + // add charset & collate like wp core + $charset_collate = ''; + + if ( version_compare($wpdb->get_var("SELECT VERSION() AS `mysql_version`"), '4.1.0', '>=') ) { + if ( ! empty($wpdb->charset) ) + $charset_collate = "DEFAULT CHARACTER SET $wpdb->charset"; + if ( ! empty($wpdb->collate) ) + $charset_collate .= " COLLATE $wpdb->collate"; + } + + // Add charset to table creation query + $sql = str_replace($charset_collate, '', str_replace(';', '', $sql)); + + // Execute the query + return dbDelta($sql. ' '. $charset_collate. ';'); + } +} + new M_NggLegacy(); diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/nggallery.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/nggallery.php index cb804db71fd00806d53d7339cbd34e93c881343f..3f625126fbe84599c5aa1f82d183ac95f6af3bf8 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/nggallery.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/nggallery.php @@ -3,337 +3,298 @@ // Stop direct call if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You are not allowed to call this page directly.'); } -/** - * Loads the NextGEN plugin - */ -if (!class_exists('nggLoader')) { - class nggLoader { - - var $version = NGG_PLUGIN_VERSION; - var $dbversion = '1.8.1'; - var $minimum_WP = '3.6.1'; - var $donators = 'http://www.nextgen-gallery.com/donators.php'; - var $options = ''; - var $manage_page; - var $add_PHP5_notice = false; - var $plugin_name = ''; - - function nggLoader() { - - // Stop the plugin if we missed the requirements - if ( ( !$this->required_version() ) || ( !$this->check_memory_limit() ) ) - return; - - // Determine plugin basename based on whether NGG is being used in - // it's legacy form, or as a Photocrati Gallery - if (defined('NGG_PLUGIN_BASENAME')) $this->plugin_name = NGG_PLUGIN_BASENAME; - else $this->plugin_name = basename(dirname(__FILE__)).'/'.basename(__FILE__); - - // Get some constants first - $this->load_options(); - $this->define_constant(); - $this->define_tables(); - $this->load_dependencies(); - - // Start this plugin once all other plugins are fully loaded - add_action( 'plugins_loaded', array(&$this, 'start_plugin') ); - - // Register_taxonomy must be used during the init - add_action( 'init', array(&$this, 'register_taxonomy') ); - add_action( 'wpmu_new_blog', array(&$this, 'multisite_new_blog'), 10, 6); - - // Add a message for PHP4 Users, can disable the update message later on - if (version_compare(PHP_VERSION, '5.0.0', '<')) - add_filter('transient_update_plugins', array(&$this, 'disable_upgrade')); - - //Add some links on the plugin page - add_filter('plugin_row_meta', array(&$this, 'add_plugin_links'), 10, 2); - - // Check for the header / footer - add_action( 'init', array(&$this, 'test_head_footer_init' ) ); - - // Show NextGEN version in header - add_action('wp_head', array('nggGallery', 'nextgen_version') ); - } - - function start_plugin() { +class nggLoader +{ + var $version = NGG_PLUGIN_VERSION; + var $dbversion = '1.8.1'; + var $minimum_WP = '3.6.1'; + var $donators = 'http://www.nextgen-gallery.com/donators.php'; + var $options = ''; + var $manage_page; + var $add_PHP5_notice = false; + var $plugin_name = ''; + + function __construct() + { + // Stop the plugin if we missed the requirements + if ( ( !$this->required_version() ) || ( !$this->check_memory_limit() ) ) + return; + + // Determine plugin basename based on whether NGG is being used in + // it's legacy form, or as a Photocrati Gallery + if (defined('NGG_PLUGIN_BASENAME')) $this->plugin_name = NGG_PLUGIN_BASENAME; + else $this->plugin_name = basename(dirname(__FILE__)).'/'.basename(__FILE__); + + // Get some constants first + $this->load_options(); + $this->define_constant(); + $this->define_tables(); + $this->load_dependencies(); + + // Start this plugin once all other plugins are fully loaded + add_action( 'plugins_loaded', array(&$this, 'start_plugin') ); + + // Register_taxonomy must be used during the init + add_action( 'init', array(&$this, 'register_taxonomy'), 9); + add_action( 'wpmu_new_blog', array(&$this, 'multisite_new_blog'), 10, 6); + + // Add a message for PHP4 Users, can disable the update message later on + if (version_compare(PHP_VERSION, '5.0.0', '<')) + add_filter('transient_update_plugins', array(&$this, 'disable_upgrade')); + + //Add some links on the plugin page + add_filter('plugin_row_meta', array(&$this, 'add_plugin_links'), 10, 2); + + // Check for the header / footer + add_action( 'init', array(&$this, 'test_head_footer_init' ) ); + + // Show NextGEN version in header + add_action('wp_head', array('nggGallery', 'nextgen_version') ); + } - global $nggRewrite; + function start_plugin() { - // All credits to the tranlator - $this->translator = '<p class="hint">'. __('<strong>Translation by : </strong><a target="_blank" href="http://www.nextgen-gallery.com/languages/">See here</a>', 'nggallery') . '</p>'; - $this->translator .= '<p class="hint">'. __('<strong>This translation is not yet updated for Version 1.9.0</strong>. If you would like to help with translation, download the current po from the plugin folder and read <a href="http://www.nextgen-gallery.com/languages/">here</a> how you can translate the plugin.', 'nggallery') . '</p>'; + global $nggRewrite; - // Content Filters - add_filter('ngg_gallery_name', 'sanitize_title'); + // All credits to the tranlator + $this->translator = '<p class="hint">'. __('<strong>Translation by : </strong><a target="_blank" href="http://www.nextgen-gallery.com/languages/">See here</a>', 'nggallery') . '</p>'; - // Check if we are in the admin area - if ( is_admin() ) { + // Content Filters + add_filter('ngg_gallery_name', 'sanitize_title'); - // Pass the init check or show a message - if (get_option( 'ngg_init_check' ) != false ) - add_action( 'admin_notices', create_function('', 'echo \'<div id="message" class="error"><p><strong>' . get_option( "ngg_init_check" ) . '</strong></p></div>\';') ); + // Check if we are in the admin area + if ( is_admin() ) { - } else { + // Pass the init check or show a message + if (get_option( 'ngg_init_check' ) != false ) + add_action( 'admin_notices', create_function('', 'echo \'<div id="message" class="error"><p><strong>' . get_option( "ngg_init_check" ) . '</strong></p></div>\';') ); - // Add MRSS to wp_head - if ( $this->options['useMediaRSS'] ) - add_action('wp_head', array('nggMediaRss', 'add_mrss_alternate_link')); + } else { - // Look for XML request, before page is render - add_action('parse_request', array(&$this, 'check_request') ); + // Add MRSS to wp_head + if ( $this->options['useMediaRSS'] ) + add_action('wp_head', array('nggMediaRss', 'add_mrss_alternate_link')); - } } + } + + function required_version() { - /** - * Checks the 'callback' parameter for possible ajax-like actions to take - * - * @param $wp - */ - function check_request($wp) - { - $app = C_Component_Registry::get_instance()->get_utility('I_Router')->get_routed_app(); - - if (!$app->get_parameter('callback')) - return; - - switch ($app->get_parameter('callback')) { - case 'imagerotator': - require_once (dirname (__FILE__) . '/xml/imagerotator.php'); - break; - case 'json': - require_once (dirname (__FILE__) . '/xml/json.php'); - break; - case 'image': - require_once (dirname (__FILE__) . '/nggshow.php'); - break; - default: - return; - } - C_NextGEN_Bootstrap::shutdown(); + global $wp_version; + + // Check for WP version installation + $wp_ok = version_compare($wp_version, $this->minimum_WP, '>='); + + if ( ($wp_ok == FALSE) ) { + add_action( + 'admin_notices', + create_function( + '', + 'global $ngg; printf (\'<div id="message" class="error"><p><strong>\' . __(\'Sorry, NextGEN Gallery works only under WordPress %s or higher\', "nggallery" ) . \'</strong></p></div>\', $ngg->minimum_WP );' + ) + ); + return false; } - function required_version() { + return true; + + } + + function check_memory_limit() { - global $wp_version; + // get the real memory limit before some increase it + $this->memory_limit = ini_get('memory_limit'); - // Check for WP version installation - $wp_ok = version_compare($wp_version, $this->minimum_WP, '>='); + // PHP docs : Note that to have no memory limit, set this directive to -1. + if ($this->memory_limit == -1 ) return true; - if ( ($wp_ok == FALSE) ) { + // Yes, we reached Gigabyte limits, so check if it's a megabyte limit + if (strtolower( substr($this->memory_limit, -1) ) == 'm') { + + $this->memory_limit = (int) substr( $this->memory_limit, 0, -1); + + //This works only with enough memory, 16MB is silly, wordpress requires already 16MB :-) + if ( ($this->memory_limit != 0) && ($this->memory_limit < 16 ) ) { add_action( 'admin_notices', create_function( '', - 'global $ngg; printf (\'<div id="message" class="error"><p><strong>\' . __(\'Sorry, NextGEN Gallery works only under WordPress %s or higher\', "nggallery" ) . \'</strong></p></div>\', $ngg->minimum_WP );' + 'echo \'<div id="message" class="error"><p><strong>' . __('Sorry, NextGEN Gallery works only with a Memory Limit of 16 MB or higher', 'nggallery') . '</strong></p></div>\';' ) ); return false; } - - return true; - } - function check_memory_limit() { - - // get the real memory limit before some increase it - $this->memory_limit = ini_get('memory_limit'); - - // PHP docs : Note that to have no memory limit, set this directive to -1. - if ($this->memory_limit == -1 ) return true; + return true; - // Yes, we reached Gigabyte limits, so check if it's a megabyte limit - if (strtolower( substr($this->memory_limit, -1) ) == 'm') { - - $this->memory_limit = (int) substr( $this->memory_limit, 0, -1); - - //This works only with enough memory, 16MB is silly, wordpress requires already 16MB :-) - if ( ($this->memory_limit != 0) && ($this->memory_limit < 16 ) ) { - add_action( - 'admin_notices', - create_function( - '', - 'echo \'<div id="message" class="error"><p><strong>' . __('Sorry, NextGEN Gallery works only with a Memory Limit of 16 MB or higher', 'nggallery') . '</strong></p></div>\';' - ) - ); - return false; - } - } - - return true; - - } + } - function define_tables() { - global $wpdb; + function define_tables() { + global $wpdb; - // add database pointer - $wpdb->nggpictures = $wpdb->prefix . 'ngg_pictures'; - $wpdb->nggallery = $wpdb->prefix . 'ngg_gallery'; - $wpdb->nggalbum = $wpdb->prefix . 'ngg_album'; + // add database pointer + $wpdb->nggpictures = $wpdb->prefix . 'ngg_pictures'; + $wpdb->nggallery = $wpdb->prefix . 'ngg_gallery'; + $wpdb->nggalbum = $wpdb->prefix . 'ngg_album'; - } + } - function register_taxonomy() { - global $wp_rewrite; + function register_taxonomy() { + global $wp_rewrite; - // Register the NextGEN taxonomy - $args = array( - 'label' => __('Picture tag', 'nggallery'), - 'template' => __('Picture tag: %2$l.', 'nggallery'), - 'helps' => __('Separate picture tags with commas.', 'nggallery'), - 'sort' => true, - 'args' => array('orderby' => 'term_order') - ); + // Register the NextGEN taxonomy + $args = array( + 'label' => __('Picture tag', 'nggallery'), + 'template' => __('Picture tag: %2$l.', 'nggallery'), + 'helps' => __('Separate picture tags with commas.', 'nggallery'), + 'sort' => true, + 'args' => array('orderby' => 'term_order') + ); - register_taxonomy( 'ngg_tag', 'nggallery', $args ); - } + register_taxonomy( 'ngg_tag', 'nggallery', $args ); + } - function define_constant() { + function define_constant() { - global $wp_version; + global $wp_version; - //TODO:SHOULD BE REMOVED LATER - define('NGGVERSION', $this->version); - // Minimum required database version + //TODO:SHOULD BE REMOVED LATER + define('NGGVERSION', $this->version); + // Minimum required database version - define('NGG_DBVERSION', $this->dbversion); + define('NGG_DBVERSION', $this->dbversion); - // define URL - define('NGGFOLDER', dirname( $this->plugin_name ) ); + // define URL + define('NGGFOLDER', dirname( $this->plugin_name ) ); - // Legacy expects this to have a trailing slash - define( - 'NGGALLERY_ABSPATH', - defined('NGG_LEGACY_MOD_DIR') ? - rtrim(NGG_LEGACY_MOD_DIR, "/\\").DIRECTORY_SEPARATOR : - rtrim(dirname(__FILE__), "/\\").DIRECTORY_SEPARATOR - ); + // Legacy expects this to have a trailing slash + define( + 'NGGALLERY_ABSPATH', + defined('NGG_LEGACY_MOD_DIR') ? + rtrim(NGG_LEGACY_MOD_DIR, "/\\").DIRECTORY_SEPARATOR : + rtrim(dirname(__FILE__), "/\\").DIRECTORY_SEPARATOR + ); - // Legacy expects this to have a trailing slash - define('NGGALLERY_URLPATH', plugin_dir_url(__FILE__)); + // Legacy expects this to have a trailing slash + define('NGGALLERY_URLPATH', plugin_dir_url(__FILE__)); - // look for imagerotator - define('NGGALLERY_IREXIST', !empty( $this->options['irURL'] )); + // look for imagerotator + define('NGGALLERY_IREXIST', !empty( $this->options['irURL'] )); - // get value for safe mode - if ( (gettype( ini_get('safe_mode') ) == 'string') ) { - // if sever did in in a other way - if ( ini_get('safe_mode') == 'off' ) define('SAFE_MODE', FALSE); - else define( 'SAFE_MODE', ini_get('safe_mode') ); - } else - define( 'SAFE_MODE', ini_get('safe_mode') ); + // get value for safe mode + if ( (gettype( ini_get('safe_mode') ) == 'string') ) { + // if sever did in in a other way + if ( ini_get('safe_mode') == 'off' ) define('SAFE_MODE', FALSE); + else define( 'SAFE_MODE', ini_get('safe_mode') ); + } else + define( 'SAFE_MODE', ini_get('safe_mode') ); - if ( version_compare($wp_version, '3.2.999', '>') ) - define('IS_WP_3_3', TRUE); + if ( version_compare($wp_version, '3.2.999', '>') ) + define('IS_WP_3_3', TRUE); - } + } - function load_dependencies() { - - // Load global libraries // average memory usage (in bytes) - require_once (dirname (__FILE__) . '/lib/core.php'); // 94.840 - require_once (dirname (__FILE__) . '/lib/class.ngg_serializable.php'); // 94.840 - require_once (dirname (__FILE__) . '/lib/ngg-db.php'); // 132.400 - require_once (dirname (__FILE__) . '/lib/image.php'); // 59.424 - require_once (dirname (__FILE__) . '/lib/tags.php'); // 117.136 - require_once (dirname (__FILE__) . '/lib/post-thumbnail.php'); // n.a. - require_once (dirname (__FILE__) . '/lib/multisite.php'); - require_once (dirname (__FILE__) . '/lib/sitemap.php'); - - // Load frontend libraries - require_once (dirname (__FILE__) . '/lib/navigation.php'); // 242.016 - require_once (dirname (__FILE__) . '/nggfunctions.php'); // n.a. - require_once (dirname (__FILE__) . '/lib/shortcodes.php'); // 92.664 - - // We didn't need all stuff during a AJAX operation - if ( defined('DOING_AJAX') ) - require_once (dirname (__FILE__) . '/admin/ajax.php'); - else { - require_once (dirname (__FILE__) . '/lib/meta.php'); // 131.856 - require_once (dirname (__FILE__) . '/lib/media-rss.php'); // 82.768 - require_once (dirname (__FILE__) . '/lib/rewrite.php'); // 71.936 - - // Load backend libraries - if ( is_admin() ) { - require_once (dirname (__FILE__) . '/admin/admin.php'); - require_once (dirname (__FILE__) . '/admin/media-upload.php'); - $this->nggAdminPanel = new nggAdminPanel(); - } + function load_dependencies() { + + // Load global libraries // average memory usage (in bytes) + require_once (dirname (__FILE__) . '/lib/core.php'); // 94.840 + require_once (dirname (__FILE__) . '/lib/class.ngg_serializable.php'); // 94.840 + require_once (dirname (__FILE__) . '/lib/ngg-db.php'); // 132.400 + require_once (dirname (__FILE__) . '/lib/image.php'); // 59.424 + require_once (dirname (__FILE__) . '/lib/tags.php'); // 117.136 + require_once (dirname (__FILE__) . '/lib/post-thumbnail.php'); // n.a. + require_once (dirname (__FILE__) . '/lib/multisite.php'); + require_once (dirname (__FILE__) . '/lib/sitemap.php'); + + // Load frontend libraries + require_once (dirname (__FILE__) . '/lib/shortcodes.php'); // 92.664 + + // We didn't need all stuff during a AJAX operation + if ( defined('DOING_AJAX') ) + require_once (dirname (__FILE__) . '/admin/ajax.php'); + else { + require_once (dirname (__FILE__) . '/lib/meta.php'); // 131.856 + require_once (dirname (__FILE__) . '/lib/media-rss.php'); // 82.768 + require_once (dirname (__FILE__) . '/lib/rewrite.php'); // 71.936 + + // Load backend libraries + if ( is_admin() ) { + require_once (dirname (__FILE__) . '/admin/admin.php'); + require_once (dirname (__FILE__) . '/admin/media-upload.php'); + $this->nggAdminPanel = new nggAdminPanel(); } } + } - function load_thickbox_images() { - // WP core reference relative to the images. Bad idea - echo "\n" . '<script type="text/javascript">tb_pathToImage = "' . site_url() . '/wp-includes/js/thickbox/loadingAnimation.gif";tb_closeImage = "' . site_url() . '/wp-includes/js/thickbox/tb-close.png";</script>'. "\n"; - } + function load_thickbox_images() { + // WP core reference relative to the images. Bad idea + echo "\n" . '<script type="text/javascript">tb_pathToImage = "' . site_url() . '/wp-includes/js/thickbox/loadingAnimation.gif";tb_closeImage = "' . site_url() . '/wp-includes/js/thickbox/tb-close.png";</script>'. "\n"; + } - function load_options() { - // Load the options - $this->options = get_option('ngg_options'); - } + function load_options() { + // Load the options + $this->options = get_option('ngg_options'); + } - // THX to Shiba for the code - // See: http://shibashake.com/wordpress-theme/write-a-plugin-for-wordpress-multi-site - function multisite_new_blog($blog_id, $user_id, $domain, $path, $site_id, $meta ) { - global $wpdb; + // THX to Shiba for the code + // See: http://shibashake.com/wordpress-theme/write-a-plugin-for-wordpress-multi-site + function multisite_new_blog($blog_id, $user_id, $domain, $path, $site_id, $meta ) { + global $wpdb; - include_once (dirname (__FILE__) . '/admin/install.php'); + include_once (dirname (__FILE__) . '/admin/install.php'); - if (is_plugin_active_for_network( $this->plugin_name )) { - $current_blog = $wpdb->blogid; - switch_to_blog($blog_id); - $installer = new C_NggLegacy_Installer; - nggallery_install($installer); - switch_to_blog($current_blog); - } + if (is_plugin_active_for_network( $this->plugin_name )) { + $current_blog = $wpdb->blogid; + switch_to_blog($blog_id); + $installer = new C_NggLegacy_Installer; + nggallery_install($installer); + switch_to_blog($current_blog); } + } - function disable_upgrade($option){ + function disable_upgrade($option){ - // PHP5.2 is required for NGG V1.4.0 - if ( version_compare($option->response[ $this->plugin_name ]->new_version, '1.4.0', '>=') ) - return $option; + // PHP5.2 is required for NGG V1.4.0 + if ( version_compare($option->response[ $this->plugin_name ]->new_version, '1.4.0', '>=') ) + return $option; - if( isset($option->response[ $this->plugin_name ]) ){ - //Clear it''s download link - $option->response[ $this->plugin_name ]->package = ''; + if( isset($option->response[ $this->plugin_name ]) ){ + //Clear it''s download link + $option->response[ $this->plugin_name ]->package = ''; - //Add a notice message - if ($this->add_PHP5_notice == false){ - add_action( "in_plugin_update_message-$this->plugin_name", create_function('', 'echo \'<br /><span style="color:red">Please update to PHP5.2 as soon as possible, the plugin is not tested under PHP4 anymore</span>\';') ); - $this->add_PHP5_notice = true; - } + //Add a notice message + if ($this->add_PHP5_notice == false){ + add_action( "in_plugin_update_message-$this->plugin_name", create_function('', 'echo \'<br /><span style="color:red">Please update to PHP5.2 as soon as possible, the plugin is not tested under PHP4 anymore</span>\';') ); + $this->add_PHP5_notice = true; } - return $option; } + return $option; + } - // Add links to Plugins page - function add_plugin_links($links, $file) { + // Add links to Plugins page + function add_plugin_links($links, $file) { - if ( $file == $this->plugin_name ) { - $links[] = '<a href="http://wordpress.org/support/plugin/nextgen-gallery">' . __('Get help', 'nggallery') . '</a>'; - $links[] = '<a href="https://bitbucket.org/photocrati/nextgen-gallery">' . __('Contribute', 'nggallery') . '</a>'; - } - return $links; + if ( $file == $this->plugin_name ) { + $links[] = '<a href="http://wordpress.org/support/plugin/nextgen-gallery">' . __('Get help', 'nggallery') . '</a>'; + $links[] = '<a href="https://bitbucket.org/photocrati/nextgen-gallery">' . __('Contribute', 'nggallery') . '</a>'; } + return $links; + } - // Check for the header / footer, parts taken from Matt Martz (http://sivel.net/) - function test_head_footer_init() { + // Check for the header / footer, parts taken from Matt Martz (http://sivel.net/) + function test_head_footer_init() { - // If test-head query var exists hook into wp_head - if ( isset( $_GET['test-head'] ) ) - add_action( 'wp_head', create_function('', 'echo \'<!--wp_head-->\';'), 99999 ); + // If test-head query var exists hook into wp_head + if ( isset( $_GET['test-head'] ) ) + add_action( 'wp_head', create_function('', 'echo \'<!--wp_head-->\';'), 99999 ); - // If test-footer query var exists hook into wp_footer - if ( isset( $_GET['test-footer'] ) ) - add_action( 'wp_footer', create_function('', 'echo \'<!--wp_footer-->\';'), 99999 ); - } + // If test-footer query var exists hook into wp_footer + if ( isset( $_GET['test-footer'] ) ) + add_action( 'wp_footer', create_function('', 'echo \'<!--wp_footer-->\';'), 99999 ); } - - // Let's start the holy plugin - global $ngg; - $ngg = new nggLoader(); } + +// Let's start the holy plugin +global $ngg; +$ngg = new nggLoader(); diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/static/default.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/static/default.css index 3ea94c7812709ab354fec43e9cba1945e2754e0d..ef2ec17826423d937a9b50d18aa73e8c0aa48842 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/static/default.css +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/static/default.css @@ -1,32 +1,32 @@ -/* -CSS Name: Default Styles -Description: NextGEN Default Gallery Stylesheet -Author: Photocrati Media -Version: 2.12 - -These are the default NextGEN rules and are loaded on each page. -*/ - -/* ----------- Related images -------------*/ - -.ngg-related-gallery { - background: #F9F9F9; - border: 1px solid #E0E0E0; - overflow: hidden; - margin-bottom: 1em; - margin-top: 1em; - padding: 5px; -} - -.ngg-related-gallery img { - border: 1px solid #DDDDDD; - float: left; - margin: 0pt 3px; - padding: 2px; - height: 50px; - width: 50px; -} - -.ngg-related-gallery img:hover { - border: 1px solid #000000; -} +/* +CSS Name: Default Styles +Description: NextGEN Default Gallery Stylesheet +Author: Photocrati Media +Version: 2.12 + +These are the default NextGEN rules and are loaded on each page. +*/ + +/* ----------- Related images -------------*/ + +.ngg-related-gallery { + background: #F9F9F9; + border: 1px solid #E0E0E0; + overflow: hidden; + margin-bottom: 1em; + margin-top: 1em; + padding: 5px; +} + +.ngg-related-gallery img { + border: 1px solid #DDDDDD; + float: left; + margin: 0pt 3px; + padding: 2px; + height: 50px; + width: 50px; +} + +.ngg-related-gallery img:hover { + border: 1px solid #000000; +} diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/static/hovereffect.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/static/hovereffect.css index 2fc54bba040a2db59a5e3e9bdebb70674db948dc..5eb14bfc1d05da7f716ea8de463adffc14afd917 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/static/hovereffect.css +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/static/hovereffect.css @@ -1,142 +1,142 @@ -/* -CSS Name: Hovereffect Styles -Description: Hover Stylesheet based on the idea of Hoverbox from http://host.sonspring.com/hoverbox/ -Author: Alex Rabe - Orginal by Nathan Smith -Version: 1.60 - -This applies a styling effect similiar to the Hoverbox style -*/ - -/* ----------- Album Styles Extend -------------*/ - -.ngg-albumtitle { - border-bottom: 1px dashed #AAAAAA; - padding-bottom: 3px; -} - -.ngg-thumbnail { - background: #EEEEEE none repeat scroll 0% 50%; - border-color: #DDDDDD rgb(187, 187, 187) rgb(170, 170, 170) rgb(204, 204, 204); - border-style: solid; - border-width: 1px; - color: inherit; - margin-right: 5px; - padding: 5px; -} - -.ngg-thumbnail img { - filter: alpha(opacity = 100); - -moz-opacity: .99; - opacity: .99; - background: #FFFFFF none repeat scroll 0%; - border-color: #AAAAAA rgb(204, 204, 204) rgb(221, 221, 221) rgb(187, 187, 187); - border-style: solid; - border-width: 1px; - color: inherit; - padding: 2px; - vertical-align: top; -} - -.ngg-thumbnail img:hover { - filter: alpha(opacity = 90); - -moz-opacity: .9; - opacity: .9; - border-color: #000000; -} - -/* ----------- Gallery style -------------*/ - -.ngg-galleryoverview { - overflow: hidden; - margin-top: 10px; - width: 100%; - clear: both; - display: block !important; -} - -.ngg-gallery-thumbnail-box { - background: #EEEEEE none repeat scroll 0% 50%; - border-color: #DDDDDD rgb(187, 187, 187) rgb(170, 170, 170) rgb(204, 204, 204); - border-style: solid; - border-width: 1px; - color: inherit; - display: inline; - margin: 3px; - padding: 5px; - position: relative; -} - -.ngg-gallery-thumbnail img { - filter: alpha(opacity = 100); - -moz-opacity: .99; - opacity: .99; - background: #FFFFFF none repeat scroll 0%; - border-color: #AAAAAA rgb(204, 204, 204) rgb(221, 221, 221) rgb(187, 187, 187); - border-style: solid; - border-width: 1px; - color: inherit; - padding: 2px; - vertical-align: top; -} - -.ngg-gallery-thumbnail img:hover { - filter: alpha(opacity = 90); - -moz-opacity: .9; - opacity: .9; - border-color: #000000; -} - -/* ----------- Gallery navigation -------------*/ - -.ngg-navigation a.page-numbers, -.ngg-navigation a.next, -.ngg-navigation a.prev, -.ngg-navigation span.page-numbers, -.ngg-navigation span.next, -.ngg-navigation span.prev { - padding: 3px 7px; -} - -/* ----------- Image browser style -------------*/ - -.ngg-imagebrowser h3 { - text-align: center; - padding-bottom: 10px; -} - -.ngg-imagebrowser .pic { - background: #EEEEEE none repeat scroll 0% 50%; - border-color: #DDDDDD rgb(187, 187, 187) rgb(170, 170, 170) rgb(204, 204, 204); - border-style: solid; - border-width: 1px; - color: inherit; - display: block; - padding: 10px; -} - -.ngg-imagebrowser img { - margin: -3px; - background: #FFFFFF none repeat scroll 0%; - border-color: #AAAAAA rgb(204, 204, 204) rgb(221, 221, 221) rgb(187, 187, 187); - border-style: solid; - border-width: 1px; - color: inherit; - padding: 2px; - vertical-align: top; -} - -.ngg-imagebrowser-nav { - padding: 10px; - -} - -.ngg-imagebrowser-nav .back:hover, -.ngg-imagebrowser-nav .next:hover { - border: 1px solid #000000; -} - -.ngg-imagebrowser-nav .back a:hover, -.ngg-imagebrowser-nav .next a:hover { - text-decoration: none !important; -} - +/* +CSS Name: Hovereffect Styles +Description: Hover Stylesheet based on the idea of Hoverbox from http://host.sonspring.com/hoverbox/ +Author: Alex Rabe - Orginal by Nathan Smith +Version: 1.60 + +This applies a styling effect similiar to the Hoverbox style +*/ + +/* ----------- Album Styles Extend -------------*/ + +.ngg-albumtitle { + border-bottom: 1px dashed #AAAAAA; + padding-bottom: 3px; +} + +.ngg-thumbnail { + background: #EEEEEE none repeat scroll 0% 50%; + border-color: #DDDDDD rgb(187, 187, 187) rgb(170, 170, 170) rgb(204, 204, 204); + border-style: solid; + border-width: 1px; + color: inherit; + margin-right: 5px; + padding: 5px; +} + +.ngg-thumbnail img { + filter: alpha(opacity = 100); + -moz-opacity: .99; + opacity: .99; + background: #FFFFFF none repeat scroll 0%; + border-color: #AAAAAA rgb(204, 204, 204) rgb(221, 221, 221) rgb(187, 187, 187); + border-style: solid; + border-width: 1px; + color: inherit; + padding: 2px; + vertical-align: top; +} + +.ngg-thumbnail img:hover { + filter: alpha(opacity = 90); + -moz-opacity: .9; + opacity: .9; + border-color: #000000; +} + +/* ----------- Gallery style -------------*/ + +.ngg-galleryoverview { + overflow: hidden; + margin-top: 10px; + width: 100%; + clear: both; + display: block !important; +} + +.ngg-gallery-thumbnail-box { + background: #EEEEEE none repeat scroll 0% 50%; + border-color: #DDDDDD rgb(187, 187, 187) rgb(170, 170, 170) rgb(204, 204, 204); + border-style: solid; + border-width: 1px; + color: inherit; + display: inline; + margin: 3px; + padding: 5px; + position: relative; +} + +.ngg-gallery-thumbnail img { + filter: alpha(opacity = 100); + -moz-opacity: .99; + opacity: .99; + background: #FFFFFF none repeat scroll 0%; + border-color: #AAAAAA rgb(204, 204, 204) rgb(221, 221, 221) rgb(187, 187, 187); + border-style: solid; + border-width: 1px; + color: inherit; + padding: 2px; + vertical-align: top; +} + +.ngg-gallery-thumbnail img:hover { + filter: alpha(opacity = 90); + -moz-opacity: .9; + opacity: .9; + border-color: #000000; +} + +/* ----------- Gallery navigation -------------*/ + +.ngg-navigation a.page-numbers, +.ngg-navigation a.next, +.ngg-navigation a.prev, +.ngg-navigation span.page-numbers, +.ngg-navigation span.next, +.ngg-navigation span.prev { + padding: 3px 7px; +} + +/* ----------- Image browser style -------------*/ + +.ngg-imagebrowser h3 { + text-align: center; + padding-bottom: 10px; +} + +.ngg-imagebrowser .pic { + background: #EEEEEE none repeat scroll 0% 50%; + border-color: #DDDDDD rgb(187, 187, 187) rgb(170, 170, 170) rgb(204, 204, 204); + border-style: solid; + border-width: 1px; + color: inherit; + display: block; + padding: 10px; +} + +.ngg-imagebrowser img { + margin: -3px; + background: #FFFFFF none repeat scroll 0%; + border-color: #AAAAAA rgb(204, 204, 204) rgb(221, 221, 221) rgb(187, 187, 187); + border-style: solid; + border-width: 1px; + color: inherit; + padding: 2px; + vertical-align: top; +} + +.ngg-imagebrowser-nav { + padding: 10px; + +} + +.ngg-imagebrowser-nav .back:hover, +.ngg-imagebrowser-nav .next:hover { + border: 1px solid #000000; +} + +.ngg-imagebrowser-nav .back a:hover, +.ngg-imagebrowser-nav .next a:hover { + text-decoration: none !important; +} + diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/static/ngg_k2.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/static/ngg_k2.css index 36d6ddcc4bca75b5146306dea84f54cb6250eeb8..b6dac58b0f620056cf30a48d9cb85e0b9c510f85 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/static/ngg_k2.css +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/static/ngg_k2.css @@ -1,84 +1,84 @@ -/* -CSS Name: K2 Theme -Description: NextGEN Style for K2 Theme -Author: Alex Rabe -Version: 1.60 - -This stylesheet modifies the NextGEN defaults to be more compatible with the K2 theme -*/ - -/* ----------- Album Styles Extend -------------*/ - -.ngg-albumoverview { - margin: 10px 0px 0px 0px !important; -} - -.ngg-album { - margin: 0px 0px 5px !important; -} - -.ngg-albumtitle { - margin: 0px 0px 10px 0px !important; -} - -.ngg-albumcontent { - margin: 0px !important; -} - -.ngg-thumbnail { - float: left; - margin: 0px 12px 0px 0px !important; -} - -.ngg-thumbnail img { - margin: 4px 0px 4px 5px !important; -} - -/* ----------- Album Styles Compact -------------*/ - -.ngg-album-link { - margin: 0px !important; -} - -.ngg-album-compact h4 { - margin-bottom: 0px !important; - margin-top: 0px !important; - padding: 0px !important; -} - -/* ----------- Gallery style -------------*/ - -.ngg-gallery-thumbnail-box { - margin: 0px !important; -} - -.ngg-gallery-thumbnail { - background: url('shadowAlpha.png') no-repeat bottom right !important; - background: url('shadow.gif') no-repeat bottom right; - margin: 10px 0 0 10px !important; -} - -.ngg-gallery-thumbnail img { - margin: -6px 6px 6px -6px !important; -} - -/* ----------- Gallery navigation -------------*/ - -.ngg-navigation a.page-numbers, -.ngg-navigation a.next, -.ngg-navigation a.prev, -.ngg-navigation span.page-numbers, -.ngg-navigation span.next, -.ngg-navigation span.prev { - padding: 3px 7px; -} - -/* ----------- Related images -------------*/ - -.ngg-related-gallery img { - margin: 0pt 2px; -} - -.ngg-related-gallery img:hover { - border: 1px solid #000000; -} +/* +CSS Name: K2 Theme +Description: NextGEN Style for K2 Theme +Author: Alex Rabe +Version: 1.60 + +This stylesheet modifies the NextGEN defaults to be more compatible with the K2 theme +*/ + +/* ----------- Album Styles Extend -------------*/ + +.ngg-albumoverview { + margin: 10px 0px 0px 0px !important; +} + +.ngg-album { + margin: 0px 0px 5px !important; +} + +.ngg-albumtitle { + margin: 0px 0px 10px 0px !important; +} + +.ngg-albumcontent { + margin: 0px !important; +} + +.ngg-thumbnail { + float: left; + margin: 0px 12px 0px 0px !important; +} + +.ngg-thumbnail img { + margin: 4px 0px 4px 5px !important; +} + +/* ----------- Album Styles Compact -------------*/ + +.ngg-album-link { + margin: 0px !important; +} + +.ngg-album-compact h4 { + margin-bottom: 0px !important; + margin-top: 0px !important; + padding: 0px !important; +} + +/* ----------- Gallery style -------------*/ + +.ngg-gallery-thumbnail-box { + margin: 0px !important; +} + +.ngg-gallery-thumbnail { + background: url('shadowAlpha.png') no-repeat bottom right !important; + background: url('shadow.gif') no-repeat bottom right; + margin: 10px 0 0 10px !important; +} + +.ngg-gallery-thumbnail img { + margin: -6px 6px 6px -6px !important; +} + +/* ----------- Gallery navigation -------------*/ + +.ngg-navigation a.page-numbers, +.ngg-navigation a.next, +.ngg-navigation a.prev, +.ngg-navigation span.page-numbers, +.ngg-navigation span.next, +.ngg-navigation span.prev { + padding: 3px 7px; +} + +/* ----------- Related images -------------*/ + +.ngg-related-gallery img { + margin: 0pt 2px; +} + +.ngg-related-gallery img:hover { + border: 1px solid #000000; +} diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/static/ngg_shadow.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/static/ngg_shadow.css index a345fe18c9c87ced09d86fa9e856facd2b5660d8..ebab00b867d3bf7c5a514483eddde9a47570789c 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/static/ngg_shadow.css +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/static/ngg_shadow.css @@ -1,24 +1,24 @@ -/* -CSS Name: Shadow Effect -Description: NextGEN Default Style with a Shadow effect -Author: Alex Rabe -Version: 1.60 - -Applies a shadow effect to gallery thumbnails and enables display of their description text -*/ - -/* ----------- Gallery style -------------*/ - -.ngg-gallery-thumbnail { - background: url('shadowAlpha.png') no-repeat bottom right !important; - background: url('shadow.gif') no-repeat bottom right; - margin: 10px 0 0 10px !important; -} - -.ngg-gallery-thumbnail img { - margin: -6px 6px 6px -6px; -} - -.ngg-gallery-thumbnail span { - display: none; -} +/* +CSS Name: Shadow Effect +Description: NextGEN Default Style with a Shadow effect +Author: Alex Rabe +Version: 1.60 + +Applies a shadow effect to gallery thumbnails and enables display of their description text +*/ + +/* ----------- Gallery style -------------*/ + +.ngg-gallery-thumbnail { + background: url('shadowAlpha.png') no-repeat bottom right !important; + background: url('shadow.gif') no-repeat bottom right; + margin: 10px 0 0 10px !important; +} + +.ngg-gallery-thumbnail img { + margin: -6px 6px 6px -6px; +} + +.ngg-gallery-thumbnail span { + display: none; +} diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/static/ngg_shadow2.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/static/ngg_shadow2.css index 3a5a3e555e7b9a321105f495580d2da8da3ba179..290fa1c1133bced1cf1e22060a116bd163865ea9 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/static/ngg_shadow2.css +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/static/ngg_shadow2.css @@ -1,30 +1,30 @@ -/* -CSS Name: Shadow Effect with Description text -Description: NextGEN Default Style with a Shadow effect and description text below the thumbnail -Author: Alex Rabe -Version: 1.60 - -Applies a shadow effect to gallery thumbnails and enables display of their description text -*/ - -/* ----------- Gallery style -------------*/ - -.ngg-gallery-thumbnail { - background: url('shadowAlpha.png') no-repeat bottom right !important; - background: url('shadow.gif') no-repeat bottom right; - margin: 10px 0 0 10px !important; - padding: 10px 15px 10px 15px; - border-color: #EEEEEE; - border-style: solid none none solid; - border-width: 1px medium medium 1px; -} - -.ngg-gallery-thumbnail img { - margin: -6px 6px 6px -6px; -} - -.ngg-gallery-thumbnail span { - margin: -6px 6px 6px -6px; - text-align: center; - color: #808080; -} +/* +CSS Name: Shadow Effect with Description text +Description: NextGEN Default Style with a Shadow effect and description text below the thumbnail +Author: Alex Rabe +Version: 1.60 + +Applies a shadow effect to gallery thumbnails and enables display of their description text +*/ + +/* ----------- Gallery style -------------*/ + +.ngg-gallery-thumbnail { + background: url('shadowAlpha.png') no-repeat bottom right !important; + background: url('shadow.gif') no-repeat bottom right; + margin: 10px 0 0 10px !important; + padding: 10px 15px 10px 15px; + border-color: #EEEEEE; + border-style: solid none none solid; + border-width: 1px medium medium 1px; +} + +.ngg-gallery-thumbnail img { + margin: -6px 6px 6px -6px; +} + +.ngg-gallery-thumbnail span { + margin: -6px 6px 6px -6px; + text-align: center; + color: #808080; +} diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/view/album-compact.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/view/album-compact.php index 969150b0a1769fb17c24a05c9282bcf0cc8e9841..921c49d16d28cc362105d3cd824a4845d4391eb4 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/view/album-compact.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/view/album-compact.php @@ -41,9 +41,13 @@ Follow variables are useable : <?php echo $gallery->title ?> </a> </h4> - <?php if (@$gallery->counter > 0) : ?> - <p class="ngg-album-gallery-image-counter"><strong><?php echo $gallery->counter ?></strong> <?php _e('Photos', 'nggallery') ?></p> - <?php endif; ?> + <p class="ngg-album-gallery-image-counter"> + <?php if (isset($gallery->counter) && $gallery->counter > 0) { ?> + <strong><?php echo $gallery->counter; ?></strong> <?php _e('Photos', 'nggallery'); ?> + <?php } else { ?> + + <?php } ?> + </p> </div> <?php endforeach; ?> diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/view/gallery-caption.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/view/gallery-caption.php index ef952c4eb9e44bdcaba251de05570ebba67aa284..8f61ad5c4f0e98496690692a74dde327f725ed32 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/view/gallery-caption.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/view/gallery-caption.php @@ -25,15 +25,6 @@ Follow variables are useable : </div> <?php } ?> -<?php if ($gallery->show_piclens) { ?> - <!-- Piclense link --> - <div class="piclenselink"> - <a class="piclenselink" href="<?php echo nextgen_esc_url($gallery->piclens_link) ?>"> - <?php _e('[View with PicLens]','nggallery'); ?> - </a> - </div> -<?php } ?> - <!-- Thumbnails --> <?php $i = 0; ?> <?php foreach ( $images as $image ) : ?> @@ -42,11 +33,6 @@ Follow variables are useable : <div class="ngg-gallery-thumbnail" > <a href="<?php echo nextgen_esc_url($image->imageURL) ?>" title="<?php echo esc_attr($image->description) ?>" - data-src="<?php echo nextgen_esc_url($image->imageURL) ?>" - data-thumbnail="<?php echo nextgen_esc_url($image->thumbnailURL); ?>" - data-image-id="<?php echo esc_attr($image->pid); ?>" - data-title="<?php echo esc_attr($image->alttext); ?>" - data-description="<?php echo esc_attr($image->description); ?>" <?php echo $image->thumbcode ?> > <?php if ( !$image->hidden ) { ?> <img title="<?php echo esc_attr($image->alttext) ?>" alt="<?php echo esc_attr($image->alttext) ?>" src="<?php echo nextgen_esc_url($image->thumbnailURL) ?>" <?php echo $image->size ?> /> diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/view/gallery.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/view/gallery.php index 5d30662d183f9d5dc9fbd828c92d56f2e0807af8..a80f744c3bec48da321e668a33ae32a97cabb2d2 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/view/gallery.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/view/gallery.php @@ -25,15 +25,6 @@ Follow variables are useable : </div> <?php } ?> -<?php if ($gallery->show_piclens) { ?> - <!-- Piclense link --> - <div class="piclenselink"> - <a class="piclenselink" href="<?php echo nextgen_esc_url($gallery->piclens_link) ?>"> - <?php _e('[View with PicLens]','nggallery'); ?> - </a> - </div> -<?php } ?> - <!-- Thumbnails --> <?php $i = 0; ?> <?php foreach ( $images as $image ) : ?> @@ -42,11 +33,6 @@ Follow variables are useable : <div class="ngg-gallery-thumbnail" > <a href="<?php echo nextgen_esc_url($image->imageURL) ?>" title="<?php echo esc_attr($image->description) ?>" - data-src="<?php echo nextgen_esc_url($image->imageURL); ?>" - data-thumbnail="<?php echo nextgen_esc_url($image->thumbnailURL); ?>" - data-image-id="<?php echo esc_attr($image->pid); ?>" - data-title="<?php echo esc_attr($image->alttext); ?>" - data-description="<?php echo esc_attr($image->description); ?>" <?php echo $image->thumbcode ?> > <?php if ( !$image->hidden ) { ?> <img title="<?php echo esc_attr($image->alttext) ?>" alt="<?php echo esc_attr($image->alttext) ?>" src="<?php echo nextgen_esc_url($image->thumbnailURL) ?>" <?php echo $image->size ?> /> diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/view/imagebrowser-caption.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/view/imagebrowser-caption.php index b13ba45249dc8d3343992a825c5a40e20c0dc9d0..803e27c401d03dccf2b69b849407010b3e1553be 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/view/imagebrowser-caption.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/view/imagebrowser-caption.php @@ -16,7 +16,7 @@ Follow variables are useable : ?> <?php if (!defined ('ABSPATH')) die ('No direct access allowed'); ?><?php if (!empty ($image)) : ?> -<div class="ngg-imagebrowser" id="<?php echo $image->anchor ?>"> +<div class="ngg-imagebrowser" id="<?php echo $image->anchor ?>" data-nextgen-gallery-id="<?php echo $displayed_gallery->id(); ?>"> <h3><?php echo $image->alttext ?></h3> diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/view/singlepic.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/view/singlepic.php index 81267a7cdced9a763219d0187c810571ac47d2de..f00f2b8cd58a2b9051c61b98a4d4145226506cc4 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/view/singlepic.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/view/singlepic.php @@ -20,11 +20,6 @@ Please note : A Image resize or watermarking operation will remove all meta info <?php if (!defined ('ABSPATH')) die ('No direct access allowed'); ?><?php if (!empty ($image)) : ?> <a href="<?php echo nextgen_esc_url($image->imageURL); ?>" title="<?php echo esc_attr($image->linktitle); ?>" - data-src="<?php echo nextgen_esc_url($image->imageURL); ?>" - data-thumbnail="<?php echo nextgen_esc_url($image->thumbnailURL); ?>" - data-image-id="<?php echo esc_attr($image->pid); ?>" - data-title="<?php echo esc_attr($image->alttext); ?>" - data-description="<?php echo esc_attr($image->description); ?>" <?php if(!empty($target)) { ?>target="<?php echo esc_attr($target); ?>"<?php } ?> <?php echo $image->thumbcode; ?>> <img class="<?php echo $image->classname; ?>" diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/xml/media-rss.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/xml/media-rss.php index fa80a4b9a7c3bdf3fb34a007c1be7fb5ccbdfa47..fee51388694644b4c558cd8e422d565c1830a1a5 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/xml/media-rss.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/xml/media-rss.php @@ -59,8 +59,13 @@ if ( $mode == 'last_pictures' ) { $first = current($galleries); $gid = $first->gid; } - - + + // account for the the odd logic used in selecting galleries here + if ($gid == 1) + $gid = 0; + elseif ($gid > 1) + $gid--; + // Set the main gallery object $gallery = $galleries[$gid]; diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/router/module.router.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/router/module.router.php index dd324441ed86872dddea0e9575fc9a7a19455cb1..f86e776ea8867f4a990181f27a66be69bd784aaf 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/router/module.router.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/router/module.router.php @@ -13,13 +13,12 @@ class M_Router extends C_Base_Module 'photocrati-router', 'Router for Pope', 'Provides routing capabilities for Pope modules', - '0.6', + '0.7', 'http://www.photocrati.com', 'Photocrati Media', 'http://www.photocrati.com' ); - include_once('class.router_installer.php'); C_Photocrati_Installer::add_handler($this->module_id, 'C_Router_Installer'); } @@ -41,12 +40,20 @@ class M_Router extends C_Base_Module 'C_Router' => 'class.router.php', 'C_Http_Response_Controller' => 'class.http_response_controller.php', 'C_Routing_App' => 'class.routing_app.php', - 'I_Router' => 'interface.router.php', - 'I_Http_Response' => 'interface.http_response.php', - 'I_Routing_App' => 'interface.routing_app.php', 'Mixin_Url_Manipulation' => 'mixin.url_manipulation.php' ); } } +class C_Router_Installer +{ + function install() + { + $settings = C_NextGen_Settings::get_instance(); + $settings->set_default_value('router_param_separator', '--'); + $settings->set_default_value('router_param_prefix', ''); + $settings->set_default_value('router_param_slug', 'nggallery'); + } +} + new M_Router; diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/router/package.module.router.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/router/package.module.router.php new file mode 100644 index 0000000000000000000000000000000000000000..4f7bb0df287000214e874bcb511fb7b343482a84 --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/router/package.module.router.php @@ -0,0 +1,1217 @@ +<?php +class A_Routing_App_Factory extends Mixin +{ + public function routing_app($context = FALSE, $router = FALSE) + { + return new C_Routing_App($context, $router); + } +} +class C_Http_Response_Controller extends C_Component +{ + static $_instance = NULL; + static function get_instance($context = FALSE) + { + if (!isset(self::$_instance)) { + $klass = get_class(); + self::$_instance = new $klass(); + } + return self::$_instance; + } + public function define() + { + $this->add_mixin('Mixin_Http_Response_Actions'); + $this->implement('I_Http_Response'); + } +} +class Mixin_Http_Response_Actions extends Mixin +{ + public function http_301_action() + { + header('HTTP/1.1 301 Permanent Redirect'); + header("Location: {$this->object->get_routed_url()}"); + } + public function http_302_action() + { + header('HTTP/1.1 302 Temporary Redirect'); + header("Location: {$this->object->get_routed_url()}"); + } + public function http_501_action() + { + header('HTTP/1.1 501 Not Implemented'); + } + public function http_404_action() + { + header('HTTP/1.1 404 Not found'); + } + public function http_202_action() + { + header('HTTP/1.1 202 Accepted'); + } +} +class Mixin_Router extends Mixin +{ + public function set_routed_app($app) + { + $this->object->_routed_app = $app; + } + public function &get_routed_app() + { + $retval = $this->object->_routed_app ? $this->object->_routed_app : $this->object->get_default_app(); + return $retval; + } + public function &get_default_app() + { + if (is_null($this->object->_default_app)) { + $this->object->_default_app = $this->object->create_app(); + } + $retval = $this->object->_default_app; + return $retval; + } + public function route($patterns, $handler = FALSE) + { + $this->object->get_default_app()->route($patterns, $handler); + } + public function rewrite($src, $dst, $redirect = FALSE) + { + $this->object->get_default_app()->rewrite($src, $dst, $redirect); + } + public function get_parameter($key, $prefix = NULL, $default = NULL) + { + return $this->object->get_routed_app()->get_parameter($key, $prefix, $default); + } + public function param($key, $prefix = NULL, $default = NULL) + { + return $this->object->get_parameter($key, $prefix, $default); + } + public function has_parameter_segments() + { + return $this->object->get_routed_app()->has_parameter_segments(); + } + public function passthru() + { + return $this->object->get_default_app()->passthru(); + } + /** + * Gets url for the router + * @param string $uri + * @return string + */ + public function get_url($uri = '/', $with_qs = TRUE, $site_url = FALSE) + { + $retval = $this->object->join_paths($this->object->get_base_url($site_url), $uri); + if ($with_qs) { + $parts = parse_url($retval); + if (!isset($parts['query'])) { + $parts['query'] = $this->object->get_querystring(); + } else { + $parts['query'] = $this->object->join_querystrings($parts['query'], $this->object->get_querystring()); + } + $retval = $this->object->construct_url_from_parts($parts); + } + return str_replace('\\', '/', $retval); + } + /** + * Currents the relative url + * @param string $uri + * @param boolean $with_qs + * @return string + */ + public function get_relative_url($uri = '/', $with_qs = TRUE) + { + $url = $this->object->get_url($uri, $with_qs = TRUE); + if ($url !== '/') { + $retval = str_replace($this->object->get_base_url(), '', $url); + } + return '/' . lrtim($retval, '/'); + } + /** + * Returns a static url + * @param string $path + * @param string $module + * @return string + */ + public function get_static_url($path, $module = FALSE) + { + $fs = C_Fs::get_instance(); + $path = $fs->find_abspath($path, $module); + $base_url = $this->object->get_base_url(TRUE); + $base_url = $this->object->remove_url_segment('/index.php', $base_url); + $path = str_replace($fs->get_document_root('plugins'), $base_url, $path); + // adjust for possible windows hosts + return str_replace('\\', '/', $path); + } + /** + * Gets the routed url + * @returns string + */ + public function get_routed_url() + { + $retval = $this->object->get_url($this->object->get_request_uri()); + if ($app = $this->object->get_routed_app()) { + $retval = $this->object->get_url($app->get_app_uri()); + } + return $retval; + } + /** + * Gets the base url for the router + * + * @param bool $site_url Unused + * @return string + */ + public function get_base_url($site_url = FALSE) + { + $protocol = $this->object->is_https() ? 'https://' : 'http://'; + $retval = "{$protocol}{$_SERVER['SERVER_NAME']}{$this->object->context}"; + return str_replace('\\', '/', rtrim($retval, '/\\')); + } + /** + * Determines if the current request is over HTTPs or not + */ + public function is_https() + { + return !empty($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) !== 'off' || !empty($_SERVER['HTTP_USESSL']) && strtolower($_SERVER['HTTP_USESSL']) !== 'off' || !empty($_SERVER['REDIRECT_HTTPS']) && strtolower($_SERVER['REDIRECT_HTTPS']) !== 'off' || !empty($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == 443; + } + /** + * Serve request using defined Routing Apps + * + * @param string|FALSE $request_uri + */ + public function serve_request() + { + $served = FALSE; + // iterate over all apps, and serve the route + foreach ($this->object->get_apps() as $app) { + if ($served = $app->serve_request($this->object->context)) { + break; + } + } + return $served; + } + /** + * Gets the querystring of the current request + * @return string + */ + public function get_querystring() + { + return isset($_SERVER['QUERY_STRING']) ? $_SERVER['QUERY_STRING'] : null; + } + public function set_querystring($value) + { + $_SERVER['QUERY_STRING'] = $value; + } + /** + * Gets the request for the router + * @return string + */ + public function get_request_uri($with_params = TRUE) + { + if (!empty($_SERVER['ORIG_REQUEST_URI'])) { + $retval = $_SERVER['ORIG_REQUEST_URI']; + } elseif (!empty($_SERVER['PATH_INFO'])) { + $retval = $_SERVER['PATH_INFO']; + } else { + $retval = $_SERVER['REQUEST_URI']; + } + // Remove the querystring + if (($index = strpos($retval, '?')) !== FALSE) { + $retval = substr($retval, 0, $index); + } + // Remove the router's context + $retval = preg_replace('#^' . preg_quote($this->object->context, '#') . '#', '', $retval); + // Remove the params + if (!$with_params) { + $retval = $this->object->strip_param_segments($retval); + } + // Ensure that request uri starts with a slash + if (strpos($retval, '/') !== 0) { + $retval = "/{$retval}"; + } + return $retval; + } + /** + * Gets the method of the HTTP request + * @return string + */ + public function get_request_method() + { + return $this->object->_request_method; + } + public function &create_app($name = '/') + { + $factory = C_Component_Factory::get_instance(); + $app = $factory->create('routing_app', $name); + $this->object->_apps[] = $app; + return $app; + } + /** + * Gets a list of apps registered for the router + * + * @return array + */ + public function get_apps() + { + usort($this->object->_apps, array(&$this, '_sort_apps')); + return array_reverse($this->object->_apps); + } + /** + * Sorts apps.This is needed because we want the most specific app to be + * executed first + * @param C_Routed_App $a + * @param C_Routed_App $b + * @return int + */ + public function _sort_apps($a, $b) + { + return strnatcmp($a->context, $b->context); + } +} +/** + * A router is configured to match patterns against a url and route the request to a particular controller and action + */ +class C_Router extends C_Component +{ + static $_instances = array(); + public $_apps = array(); + public $_default_app = NULL; + public function define($context = FALSE) + { + if (!$context or $context == 'all') { + $context = '/'; + } + parent::define($context); + $this->add_mixin('Mixin_Url_Manipulation'); + $this->add_mixin('Mixin_Router'); + $this->implement('I_Router'); + } + public function initialize() + { + parent::initialize(); + $this->_request_method = $_SERVER['REQUEST_METHOD']; + } + static function &get_instance($context = False) + { + if (!isset(self::$_instances[$context])) { + $klass = get_class(); + self::$_instances[$context] = new $klass($context); + } + return self::$_instances[$context]; + } +} +class Mixin_Routing_App extends Mixin +{ + /** + * Creates a new route endpoint with the assigned handler + * + * @param array $routes URL to route, eg /page/{page}/ + * @param array $handler Formatted array + */ + public function route($routes, $handler) + { + // ensure that the routing patterns array exists + if (!is_array($this->object->_routing_patterns)) { + $this->object->_routing_patterns = array(); + } + if (!is_array($routes)) { + $routes = array($routes); + } + // fetch all routing patterns + $patterns = $this->object->_routing_patterns; + foreach ($routes as $route) { + // add the routing pattern + $patterns[$this->object->_route_to_regex($route)] = $handler; + } + // update routing patterns + $this->object->_routing_patterns = $patterns; + } + /** + * Handles internal url rewriting with optional HTTP redirection, + * + * @param string $src Original URL + * @param string $dst Destination URL + * @param bool $redirect FALSE for internal handling, otherwise the HTTP code to send + */ + public function rewrite($src, $dst, $redirect = FALSE, $stop = FALSE) + { + // ensure that rewrite patterns array exists + if (!is_array($this->object->_rewrite_patterns)) { + $this->object->_rewrite_patterns = array(); + } + // fetch all rewrite patterns + $patterns = $this->object->_rewrite_patterns; + // Assign rewrite definition + $definition = array('dst' => $dst, 'redirect' => $redirect, 'stop' => $stop); + // We treat wildcards much differently then normal rewrites + if (preg_match('/\\{[\\.\\\\*]/', $src)) { + $pattern = str_replace('{*}', '(.*?)', $src); + $pattern = str_replace('{.*}', '(.*?)', $pattern); + $pattern = str_replace('{\\w}', '([\\w-_]*)', $pattern); + $pattern = str_replace('{\\d}', '(\\d*)', $pattern); + $src = '#' . (strpos($src, '/') === 0 ? '^' : '') . $pattern . '/?$#'; + $definition['wildcards'] = TRUE; + } else { + $src = $this->object->_route_to_regex($src); + } + // add the rewrite pattern + $patterns[$src] = $definition; + // update rewrite patterns; + $this->object->_rewrite_patterns = $patterns; + } + /** + * Gets an instance of the router + * @return type + */ + public function get_router() + { + return C_Router::get_instance(); + } + public function get_app_url($request_uri = FALSE, $with_qs = FALSE) + { + return $this->object->get_router()->get_url($this->object->get_app_uri($request_uri), $with_qs); + } + public function get_routed_url($with_qs = TRUE) + { + return $this->object->get_app_url(FALSE, $with_qs); + } + public function get_app_uri($request_uri = FALSE) + { + if (!$request_uri) { + $request_uri = $this->object->get_app_request_uri(); + } + return $this->object->join_paths($this->object->context, $request_uri); + } + public function get_app_request_uri() + { + $retval = FALSE; + if ($this->object->_request_uri) { + $retval = $this->object->_request_uri; + } else { + if ($retval = $this->object->does_app_serve_request()) { + if (strpos($retval, '/') !== 0) { + $retval = '/' . $retval; + } + $this->object->set_app_request_uri($retval); + } + } + return $retval; + } + /** + * Sets the application request uri + * @param type $uri + */ + public function set_app_request_uri($uri) + { + $this->object->_request_uri = $uri; + } + /** + * Gets the application's routing regex pattern + * @return string + */ + public function get_app_routing_pattern() + { + return $this->object->_route_to_regex($this->object->context); + } + /** + * Determines whether this app serves the request + * @return boolean|string + */ + public function does_app_serve_request() + { + $retval = FALSE; + $request_uri = $this->object->get_router()->get_request_uri(TRUE); + // Is the context present in the uri? + if (($index = strpos($request_uri, $this->object->context)) !== FALSE) { + $starts_with_slash = strpos($this->object->context, '/') === 0; + if ($starts_with_slash && $index === 0 or !$starts_with_slash) { + $regex = implode('', array('#', $starts_with_slash ? '^' : '', preg_quote($this->object->context, '#'), '#')); + $retval = preg_replace($regex, '', $request_uri); + if (!$retval) { + $retval = '/'; + } + if (strpos($retval, '/') !== 0) { + $retval = '/' . $retval; + } + if (substr($retval, -1) != '/') { + $retval = $retval . '/'; + } + } + } + return $retval; + } + /** + * Performs the url rewriting routines. Returns the HTTP status code used to + * redirect, if we're to do so. Otherwise FALSE + * @return int|bool + */ + public function do_rewrites($request_uri = FALSE) + { + $redirect = FALSE; + static $stop_processing = FALSE; + // Get the request uri if not provided + if (!$request_uri) { + $request_uri = $this->object->get_app_request_uri(); + } + // ensure that rewrite patterns array exists + if (!is_array($this->object->_rewrite_patterns)) { + $this->object->_rewrite_patterns = array(); + } + // Process each rewrite rule + // start rewriting urls + if (!$stop_processing) { + foreach ($this->object->_rewrite_patterns as $pattern => $details) { + // Remove this pattern from future processing for this request + unset($this->object->_rewrite_patterns[$pattern]); + // Wildcards are processed much differently + if (isset($details['wildcards']) && $details['wildcards']) { + if (preg_match($pattern, $request_uri, $matches)) { + foreach ($matches as $index => $match) { + if ($index == 0) { + $request_uri = str_replace($match, $details['dst'], $request_uri); + } + if ($index > 0) { + $request_uri = str_replace("{{$index}}", $match, $request_uri); + } + } + // Set the redirect flag if we're to do so + if (isset($details['redirect']) && $details['redirect']) { + $redirect = $details['redirect'] === TRUE ? 302 : intval($details['redirect']); + break; + } + // Stop processing rewrite patterns? + if ($details['stop']) { + $stop_processing = TRUE; + } + } + } elseif (preg_match_all($pattern, $request_uri, $matches, PREG_SET_ORDER)) { + // Assign new request URI + $request_uri = $details['dst']; + // Substitute placeholders + foreach ($matches as $match) { + if ($redirect) { + break; + } + foreach ($match as $key => $val) { + // If we have a placeholder that needs swapped, swap + // it now + if (is_numeric($key)) { + continue; + } + $request_uri = str_replace("{{$key}}", $val, $request_uri); + } + // Set the redirect flag if we're to do so + if (isset($details['redirect']) && $details['redirect']) { + $redirect = $details['redirect'] === TRUE ? 302 : intval($details['redirect']); + break; + } + } + } + if ($stop_processing) { + break; + } + } + } + // Cache all known data about the application request + $this->object->set_app_request_uri($request_uri); + $this->object->get_router()->set_routed_app($this->object); + return $redirect; + } + /** + * Determines if the current routing app meets our requirements and serves them + * + * @return bool + */ + public function serve_request() + { + $served = FALSE; + // ensure that the routing patterns array exists + if (!is_array($this->object->_routing_patterns)) { + $this->object->_routing_patterns = array(); + } + // if the application root matches, then we'll try to route the request + if ($request_uri = $this->object->get_app_request_uri()) { + // Perform URL rewrites + $redirect = $this->object->do_rewrites($request_uri); + // Are we to perform a redirect? + if ($redirect) { + $this->object->execute_route_handler($this->object->parse_route_handler($redirect)); + } else { + foreach ($this->object->_routing_patterns as $pattern => $handler) { + if (preg_match($pattern, $this->object->get_app_request_uri(), $matches)) { + $served = TRUE; + // Add placeholder parameters + foreach ($matches as $key => $value) { + if (is_numeric($key)) { + continue; + } + $this->object->set_parameter_value($key, $value, NULL); + } + // If a handler is attached to the route, execute it. A + // handler can be + // - FALSE, meaning don't do any post-processing to the route + // - A string, such as controller#action + // - An array: array( + // 'controller' => 'I_Test_Controller', + // 'action' => 'index', + // 'context' => 'all', (optional) + // 'method' => array('GET') (optional) + // ) + if ($handler && ($handler = $this->object->parse_route_handler($handler))) { + // Is this handler for the current HTTP request method? + if (isset($handler['method'])) { + if (!is_array($handler['method'])) { + $handler['$method'] = array($handler['method']); + } + if (in_array($this->object->get_router()->get_request_method(), $handler['method'])) { + $this->object->execute_route_handler($handler); + } + } else { + $this->object->execute_route_handler($handler); + } + } else { + if (!$handler) { + $this->object->passthru(); + } + } + } + } + } + } + return $served; + } + /** + * Executes an action of a particular controller + * @param array $handler + */ + public function execute_route_handler($handler) + { + // Get action + $action = $handler['action']; + // Get controller + $controller = $this->object->get_registry()->get_utility($handler['controller'], $handler['context']); + // Call action + $controller->{$action}(); + // Clean Exit (fastcgi safe) + C_NextGEN_Bootstrap::shutdown(); + } + /** + * Parses the route handler + * @param mixed $handler + * @return array + */ + public function parse_route_handler($handler) + { + if (is_string($handler)) { + $handler = array_combine(array('controller', 'action'), explode('#', $handler)); + } elseif (is_numeric($handler)) { + $handler = array('controller' => 'I_Http_Response', 'action' => 'http_' . $handler); + } + if (!isset($handler['context'])) { + $handler['context'] = FALSE; + } + if (strpos($handler['action'], '_action') === FALSE) { + $handler['action'] .= '_action'; + } + return $handler; + } + public function add_placeholder_params_from_matches($matches) + { + // Add the placeholder parameter values to the _params array + foreach ($matches as $key => $value) { + if (is_numeric($key)) { + continue; + } + $this->object->add_placeholder_param($key, $value, $matches[0]); + } + } + /** + * Used to pass execution to PHP and perhaps an above framework + */ + public function passthru() + { + } + /** + * Adds a placeholder parameter + * @param string $name + * @param stirng $value + * @param string $source + */ + public function add_placeholder_param($name, $value, $source = NULL) + { + if (!is_array($this->object->_parameters)) { + $this->object->_parameters = array('global'); + } + if (!isset($this->object->_parameters['global'])) { + $this->object->_parameters['global'] = array(); + } + $this->object->_parameters['global'][] = array('id' => '', 'name' => $name, 'value' => $value, 'source' => $source); + } + /** + * Converts the route to the regex + * + * @param string $route + * @return string + */ + public function _route_to_regex($route) + { + // Get the settings manager + $settings = $this->object->_settings; + $param_slug = $settings->router_param_slug; + // convert route to RegEx pattern + $route_regex = preg_quote(str_replace(array('{', '}'), array('~', '~'), $route), '#'); + // Wrap the route + $route_regex = '(' . $route_regex . ')'; + // If the route starts with a slash, then it must appear at the beginning + // of a request uri + if (strpos($route, '/') === 0) { + $route_regex = '^' . $route_regex; + } + // If the route is not /, and perhaps /foo, then we need to optionally + // look for a trailing slash as well + if ($route != '/') { + $route_regex .= '/?'; + } + // If parameters come after a slug, it might appear as well + if ($param_slug) { + $route_regex .= '(' . preg_quote($param_slug, '#') . '/)?'; + } + // Parameter might follow the request uri + $route_regex .= '(/?([^/]+\\-\\-)?[^/]+\\-\\-[^/]+/?){0,}'; + // Create the regex + $route_regex = '#' . $route_regex . '/?$#i'; + // convert placeholders to regex as well + return preg_replace('/~([^~]+)~/i', ($param_slug ? '(' . preg_quote($param_slug, '#') . '\\K)?' : '') . '(?P<\\1>[^/]+)/?', $route_regex); + } + /** + * Gets a request parameter from either the request uri or querystring + * This method takes into consideration the values of the router_param_prefix + * and router_param_separator settings when searching for the parameter + * + * Parameter can take on the following forms: + * /key--value + * /[MVC_PARAM_PREFIX]key--value + * /[MVC_PARAM_PREFIX]-key--value + * /[MVC_PARAM_PREFIX]_key--value + * /id--key--value + * /id--[MVC_PARAM_PREFIX]key--value + * /id--[MVC_PARAM_PREFIX]-key--value + * /id--[MVC_PARAM_PREFIX]_key--value + * + * @param string $key + * @param mixed $id + * @param mixed $default + * @return mixed + */ + public function get_parameter($key, $id = NULL, $default = NULL, $segment = FALSE, $url = FALSE) + { + $retval = $default; + $settings = $this->object->_settings; + $quoted_key = preg_quote($key, '#'); + $id = $id ? preg_quote($id, '#') : '[^/]+'; + $param_prefix = preg_quote($settings->router_param_prefix, '#'); + $param_sep = preg_quote($settings->router_param_separator, '#'); + $param_regex = "#/((?P<id>{$id}){$param_sep})?({$param_prefix}[-_]?)?{$quoted_key}{$param_sep}(?P<value>[^/\\?]+)/?#i"; + $found = FALSE; + $sources = $url ? array('custom' => $url) : $this->object->get_parameter_sources(); + foreach ($sources as $source_name => $source) { + if (preg_match($param_regex, $source, $matches)) { + if ($segment) { + $retval = array('segment' => $matches[0], 'source' => $source_name); + } else { + $retval = $matches['value']; + } + $found = TRUE; + break; + } + } + // Lastly, check the $_REQUEST + if (!$found && !$url && isset($_REQUEST[$key])) { + $found = TRUE; + $retval = $this->object->recursive_stripslashes($_REQUEST[$key]); + } + if (!$found && isset($_SERVER['REQUEST_URI'])) { + $params = array(); + parse_str(@parse_url($_SERVER['REQUEST_URI'], PHP_URL_QUERY), $params); + if (isset($params[$key])) { + $found = TRUE; + $retval = $this->object->recursive_stripslashes($params[$key]); + } + } + return $retval; + } + /** + * Checks and cleans a URL. This function is from WordPress. + * + * A number of characters are removed from the URL. If the URL is for displaying + * (the default behaviour) ampersands are also replaced. The 'clean_url' filter + * is applied to the returned cleaned URL. + * + * @since 2.8.0 + * @uses wp_kses_bad_protocol() To only permit protocols in the URL set + * via $protocols or the common ones set in the function. + * + * @param string $url The URL to be cleaned. + * @param array $protocols Optional. An array of acceptable protocols. + * Defaults to 'http', 'https', 'ftp', 'ftps', 'mailto', 'news', 'irc', 'gopher', 'nntp', 'feed', 'telnet', 'mms', 'rtsp', 'svn' if not set. + * @param string $_context Private. Use esc_url_raw() for database usage. + * @return string The cleaned $url after the 'clean_url' filter is applied. + */ + public function esc_url($url, $protocols = null, $_context = 'display') + { + $original_url = $url; + $url = preg_replace('|[^a-z0-9-~+_.?#=!&;,/:%@$\\|*\'()\\x80-\\xff]|i', '', $url); + $strip = array('%0d', '%0a', '%0D', '%0A'); + $url = _deep_replace($strip, $url); + $url = str_replace(';//', '://', $url); + // Replace ampersands and single quotes only when displaying. + if ('display' == $_context) { + $url = wp_kses_normalize_entities($url); + $url = str_replace('&', '&', $url); + $url = str_replace('\'', ''', $url); + } + if (!empty($url[0]) && '/' === $url[0]) { + $good_protocol_url = $url; + } else { + if (!is_array($protocols)) { + $protocols = wp_allowed_protocols(); + } + $good_protocol_url = wp_kses_bad_protocol($url, $protocols); + if (strtolower($good_protocol_url) != strtolower($url)) { + return ''; + } + } + /** + * Filter a string cleaned and escaped for output as a URL. + * + * @since 2.3.0 + * + * @param string $good_protocol_url The cleaned URL to be returned. + * @param string $original_url The URL prior to cleaning. + * @param string $_context If 'display', replace ampersands and single quotes only. + */ + return apply_filters('clean_url', $good_protocol_url, $original_url, $_context); + } + /** + * Sets the value of a particular parameter + * @param string $key + * @param mixed $value + * @param mixed $id + */ + public function set_parameter_value($key, $value, $id = NULL, $use_prefix = FALSE, $url = FALSE) + { + // Remove the parameter from both the querystring and request uri + $retval = $this->object->remove_parameter($key, $id, $url); + // Get the settings manager + $settings = $this->object->_settings; + $param_slug = $settings->router_param_slug; + // We're modifying a url passed in + if ($url) { + $parts = parse_url($retval); + if (!isset($parts['path'])) { + $parts['path'] = ''; + } + $parts['path'] = $this->object->join_paths($parts['path'], $param_slug && strpos($parts['path'], $param_slug) === FALSE ? $param_slug : '', $this->object->create_parameter_segment($key, $value, $id, $use_prefix)); + $parts['path'] = str_replace('//', '/', $parts['path']); + $retval = $this->object->construct_url_from_parts($parts); + } else { + // This parameter is being appended to the current request uri + $this->object->add_parameter_to_app_request_uri($key, $value, $id, $use_prefix); + // Return the new full url + $retval = $this->object->get_routed_url(); + } + return (is_null($retval) or is_numeric($retval) or is_array($retval)) ? $retval : $this->esc_url($retval); + } + /** + * Alias for remove_parameter() + * @param string $key + * @param mixed $id + * @return string + */ + public function remove_param($key, $id = NULL, $url = FALSE) + { + return $this->object->remove_parameter($key, $id, $url); + } + /** + * Removes a parameter from the querystring and application request URI + * and returns the full application URL + * @param string $key + * @param mixed $id + * @return string + */ + public function remove_parameter($key, $id = NULL, $url = FALSE) + { + $retval = $url; + $settings = $this->object->_settings; + $param_sep = $settings->router_param_separator; + $param_prefix = $settings->router_param_prefix ? preg_quote($settings->router_param_prefix, '#') : ''; + $param_slug = $settings->router_param_slug ? preg_quote($settings->router_param_slug, '#') : FALSE; + // Is the parameter already part of the request? If so, modify that + // parameter + if (($segment = $this->object->get_parameter_segment($key, $id, $url)) && is_array($segment)) { + extract($segment); + if ($source == 'querystring') { + $preg_id = $id ? '\\d+' : preg_quote($id, '#'); + $preg_key = preg_quote($key, '#'); + $regex = implode('', array('#', $id ? "{$preg_id}{$param_sep}" : '', "(({$param_prefix}{$param_sep})?)?{$preg_key}({$param_sep}|=)[^\\/&]+&?#i")); + $qs = preg_replace($regex, '', $this->get_router()->get_querystring()); + $this->object->get_router()->set_querystring($qs); + $retval = $this->object->get_routed_url(); + } elseif ($source == 'request_uri') { + $uri = $this->object->get_app_request_uri(); + $uri = $this->object->join_paths(explode($segment, $uri)); + if ($settings->router_param_slug && preg_match("#{$param_slug}/?\$#i", $uri, $match)) { + $retval = $this->object->remove_url_segment($match[0], $retval); + } + $this->object->set_app_request_uri($uri); + $retval = $this->object->get_routed_url(); + } else { + $retval = $this->object->join_paths(explode($segment, $url)); + if ($settings->router_param_slug && preg_match("#/{$param_slug}\$#i", $retval, $match)) { + $retval = $this->object->remove_url_segment($match[0], $retval); + } + } + } + if (is_string($retval)) { + $retval = rtrim($retval, ' ?&'); + } + return (is_null($retval) or is_numeric($retval) or is_array($retval)) ? $retval : $this->esc_url($retval); + } + /** + * Adds a parameter to the application's request URI + * @param string $key + * @param mixed $value + * @param mixed $id + */ + public function add_parameter_to_app_request_uri($key, $value, $id = NULL, $use_prefix = FALSE) + { + $settings = $this->object->_settings; + $param_slug = $settings->router_param_slug; + $uri = $this->object->get_app_request_uri(); + $parts = array($uri); + if ($param_slug && strpos($uri, $param_slug) === FALSE) { + $parts[] = $param_slug; + } + $parts[] = $this->object->create_parameter_segment($key, $value, $id, $use_prefix); + $this->object->set_app_request_uri($this->object->join_paths($parts)); + return $this->object->get_app_request_uri(); + } + /** + * Creates a parameter segment + * @param string $key + * @param mixed $value + * @param mixed $id + * @return string + */ + public function create_parameter_segment($key, $value, $id = NULL, $use_prefix = FALSE) + { + $settings = $this->object->_settings; + if ($use_prefix) { + $key = $settings->router_param_prefix . $key; + } + if ($value === TRUE) { + $value = 1; + } elseif ($value == FALSE) { + $value = 0; + } + // null and false values + $retval = $key . $settings->router_param_separator . $value; + if ($id) { + $retval = $id . $settings->router_param_separator . $retval; + } + return $retval; + } + /** + * Alias for set_parameter_value + * @param string $key + * @param mixed $value + * @param mixed $id + */ + public function set_parameter($key, $value, $id = NULL, $use_prefix = FALSE, $url = FALSE) + { + return $this->object->set_parameter_value($key, $value, $id, $use_prefix, $url); + } + /** + * Alias for set_parameter_value + * @param string $key + * @param mixed $value + * @param mixed $id + */ + public function set_param($key, $value, $id = NULL, $use_prefix = FALSE, $url = FALSE) + { + return $this->object->set_parameter_value($key, $value, $id, $use_prefix = FALSE, $url); + } + /** + * Gets a parameter's value + * @param string $key + * @param mixed $id + * @param mixed $default + * @return mixed + */ + public function get_parameter_value($key, $id = NULL, $default = NULL, $url = FALSE) + { + return $this->object->get_parameter($key, $id, $default, FALSE, $url); + } + /** + * Gets a parameter's matching URI segment + * @param string $key + * @param mixed $id + * @param mixed $default + * @return mixed + */ + public function get_parameter_segment($key, $id = NULL, $url = FALSE) + { + return $this->object->get_parameter($key, $id, NULL, TRUE, $url); + } + /** + * Gets sources used for parsing and extracting parameters + * @return array + */ + public function get_parameter_sources() + { + return array('querystring' => $this->object->get_formatted_querystring(), 'request_uri' => $this->object->get_app_request_uri()); + } + public function get_postdata() + { + $retval = '/' . urldecode(file_get_contents('php://input')); + $settings = $this->object->_settings; + $retval = str_replace(array('&', '='), array('/', $settings->router_param_separator), $retval); + return $retval; + } + public function get_formatted_querystring() + { + $retval = '/' . $this->object->get_router()->get_querystring(); + $settings = $this->object->_settings; + $retval = str_replace(array('&', '='), array('/', $settings->router_param_separator), $retval); + return $retval; + } + public function has_parameter_segments() + { + $retval = FALSE; + $settings = $this->object->_settings; + $request_uri = $this->object->get_app_request_uri(); + $sep = preg_quote($settings->router_param_separator, '#'); + // If we detect the MVC_PARAM_SLUG, then we assume that we have parameters + if ($settings->router_param_slug && strpos($request_uri, '/' . $settings->router_param_slug . '/') !== FALSE) { + $retval = TRUE; + } + // If the above didn't pass, then we try finding parameters in our + // desired format + if (!$retval) { + $regex = implode('', array('#', $settings->router_param_slug ? '/' . preg_quote($settings->router_param_slug, '#') . '/?' : '', "(/?([^/]+{$sep})?[^/]+{$sep}[^/]+/?){0,}", '$#')); + $retval = preg_match($regex, $request_uri); + } + return $retval; + } + /** + * Recursively calls stripslashes() on strings, arrays, and objects + * + * @param mixed $value Value to be processed + * @return mixed Resulting value + */ + public function recursive_stripslashes($value) + { + if (is_string($value)) { + $value = stripslashes($value); + } elseif (is_array($value)) { + foreach ($value as &$tmp) { + $tmp = $this->object->recursive_stripslashes($tmp); + } + } elseif (is_object($value)) { + foreach (get_object_vars($value) as $key => $data) { + $value->{$key} = recursive_stripslashes($data); + } + } + return $value; + } +} +class C_Routing_App extends C_Component +{ + static $_instances = array(); + public $_request_uri = FALSE; + public $_settings = null; + public function define($context = FALSE) + { + parent::define($context); + $this->add_mixin('Mixin_Url_Manipulation'); + $this->add_mixin('Mixin_Routing_App'); + $this->implement('I_Routing_App'); + } + public function initialize() + { + parent::initialize(); + $this->_settings = $this->object->get_routing_settings(); + } + public function get_routing_settings() + { + $settings = C_NextGen_Settings::get_instance(); + $object = new stdClass(); + $object->router_param_separator = $settings->router_param_separator; + $object->router_param_slug = $settings->router_param_slug; + $object->router_param_prefix = $settings->router_param_prefix; + return $object; + } + static function &get_instance($context = False) + { + if (!isset(self::$_instances[$context])) { + self::$_instances[$context] = new C_Routing_App($context); + } + return self::$_instances[$context]; + } +} +class Mixin_Url_Manipulation extends Mixin +{ + public function join_paths() + { + $args = func_get_args(); + $parts = $this->_flatten_array($args); + foreach ($parts as &$part) { + $part = trim(str_replace('\\', '/', $part), '/'); + } + return implode('/', $parts); + } + /** + * Removes a segment from a url + * @param string $segment + * @param string $url + * @return string + */ + public function remove_url_segment($segment, $url) + { + $retval = $url; + $parts = parse_url($url); + // If the url has a path, then we can remove a segment + if (isset($parts['path']) && $segment != '/') { + if (substr($segment, -1) == '/') { + $segment = substr($segment, -1); + } + $segment = preg_quote($segment, '#'); + if (preg_match("#{$segment}#", $parts['path'], $matches)) { + $parts['path'] = str_replace('//', '/', str_replace($matches[0], '', $parts['path'])); + $retval = $this->object->construct_url_from_parts($parts); + } + } + return $retval; + } + /** + * Flattens an array of arrays to a single array + * @param array $array + * @param array $parent (optional) + * @param bool $exclude_duplicates (optional - defaults to TRUE) + * @return array + */ + public function _flatten_array($array, $parent = NULL, $exclude_duplicates = TRUE) + { + if (is_array($array)) { + // We're to add each element to the parent array + if ($parent) { + foreach ($array as $index => $element) { + foreach ($this->_flatten_array($array) as $sub_element) { + if ($exclude_duplicates) { + if (!in_array($sub_element, $parent)) { + $parent[] = $sub_element; + } + } else { + $parent[] = $sub_element; + } + } + } + $array = $parent; + } else { + $index = 0; + while (isset($array[$index])) { + $element = $array[$index]; + if (is_array($element)) { + $array = $this->_flatten_array($element, $array); + unset($array[$index]); + } + $index += 1; + } + $array = array_values($array); + } + } else { + $array = array($array); + } + return $array; + } + public function join_querystrings() + { + $parts = array(); + $retval = array(); + $params = func_get_args(); + $parts = $this->_flatten_array($params); + foreach ($parts as $part) { + $part = explode('&', $part); + foreach ($part as $segment) { + $segment = explode('=', $segment); + $key = $segment[0]; + $value = isset($segment[1]) ? $segment[1] : ''; + $retval[$key] = $value; + } + } + return $this->object->assoc_array_to_querystring($retval); + } + public function assoc_array_to_querystring($arr) + { + $retval = array(); + foreach ($arr as $key => $val) { + if (strlen($key)) { + $retval[] = strlen($val) ? "{$key}={$val}" : $key; + } + } + return implode('&', $retval); + } + /** + * Constructs a url from individual parts, created by parse_url + * @param array $parts + * @return string + */ + public function construct_url_from_parts($parts) + { + // let relative paths be relative, and full paths full + $prefix = ''; + if (!empty($parts['scheme']) && !empty($parts['host'])) { + $prefix = $parts['scheme'] . '://' . $parts['host']; + if (!empty($parts['port'])) { + $prefix .= ':' . $parts['port']; + } + } + $retval = $this->object->join_paths($prefix, isset($parts['path']) ? str_replace('//', '/', trailingslashit($parts['path'])) : ''); + if (isset($parts['query']) && $parts['query']) { + $retval .= untrailingslashit("?{$parts['query']}"); + } + return $retval; + } + public function get_parameter_segments($request_uri) + { + return str_replace($this->strip_param_segments($request_uri), '', $request_uri); + } + /** + * Returns the request uri with the parameter segments stripped + * @param string $request_uri + * @return string + */ + public function strip_param_segments($request_uri, $remove_slug = TRUE) + { + $retval = $request_uri ? $request_uri : '/'; + $settings = C_NextGen_Settings::get_instance(); + $sep = preg_quote($settings->router_param_separator, '#'); + $param_regex = "#((?P<id>\\w+){$sep})?(?<key>\\w+){$sep}(?P<value>.+)/?\$#"; + $slug = $settings->router_param_slug && $remove_slug ? '/' . preg_quote($settings->router_param_slug, '#') : ''; + $slug_regex = '#' . $slug . '/?$#'; + // Remove all parameters + while (@preg_match($param_regex, $retval, $matches)) { + $match_regex = '#' . preg_quote(array_shift($matches), '#') . '$#'; + $retval = preg_replace($match_regex, '', $retval); + } + // Remove the slug or trailing slash + if (@preg_match($slug_regex, $retval, $matches)) { + $match_regex = '#' . preg_quote(array_shift($matches), '#') . '$#'; + $retval = preg_replace($match_regex, '', $retval); + } + // If there's a slug, we can assume everything after is a parameter, + // even if it's not in our desired format. + $retval = preg_replace('#' . $slug . '.*$#', '', $retval); + if (!$retval) { + $retval = '/'; + } + return $retval; + } +} \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/security/README.txt b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/security/README.txt new file mode 100644 index 0000000000000000000000000000000000000000..aaf6a06841afe9ba4be050224b42d1cc74de87b7 --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/security/README.txt @@ -0,0 +1,24 @@ +Example pseudo-code: + +$security = $this->get_registry()->get_utility('I_Security_Manager'); + + +// generating some kind of security-enabled request +$sec_token = $security->get_request_token('nextgen_edit_thumbnail', array('id' => 1)); + +$markup = '<form id="form-1" [...]>' . $sec_token->get_form_html(array('prefix' => 'form-1')) . '</form>'; + + +// somewhere else, in POST/GET handler +$sec_token = $security->get_request_token('nextgen_edit_thumbnail', array('id' => 1)); +$sec_actor = $security->get_current_actor(); + +if ($sec_token->check_current_request() && $sec_actor->is_allowed('nextgen_edit_thumbnail', array('id' => 1))) +{ + // proceed with action nextgen_edit_thumbnail +} +else +{ + // security error! +} + diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/security/module.security.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/security/module.security.php index c6652a881994d7ac96c40763366645fe82e4fe3f..5e98e8bb08358e2b58fb6581082da6a02392b83f 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/security/module.security.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/security/module.security.php @@ -44,10 +44,7 @@ class M_Security extends C_Base_Module 'C_Security_Token' => 'class.security_token.php', 'C_Wordpress_Security_Actor' => 'class.wordpress_security_actor.php', 'C_Wordpress_Security_Manager' => 'class.wordpress_security_manager.php', - 'C_Wordpress_Security_Token' => 'class.wordpress_security_token.php', - 'I_Security_Actor' => 'interface.security_actor.php', - 'I_Security_Manager' => 'interface.security_manager.php', - 'I_Security_Token' => 'interface.security_token.php' + 'C_Wordpress_Security_Token' => 'class.wordpress_security_token.php' ); } diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/security/package.module.security.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/security/package.module.security.php new file mode 100644 index 0000000000000000000000000000000000000000..9fd779efacdde2f4b6bfff9e39b89dbb26b7fd42 --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/security/package.module.security.php @@ -0,0 +1,471 @@ +<?php +class A_Security_Factory extends Mixin +{ + public function wordpress_security_manager($context = FALSE) + { + return new C_WordPress_Security_Manager($context); + } + public function security_manager($context = FALSE) + { + return $this->object->wordpress_security_manager($context); + } + public function wordpress_security_actor($context = FALSE) + { + return new C_WordPress_Security_Actor($context); + } + public function wordpress_security_token($context = FALSE) + { + return new C_Wordpress_Security_Token($context); + } + public function security_token($context) + { + return $this->object->wordpress_security_token($context); + } +} +class Mixin_Security_Actor extends Mixin +{ + public function add_capability($capability_name) + { + return false; + } + public function remove_capability($capability_name) + { + return false; + } + public function is_allowed($capability_name, $args = null) + { + return false; + } + public function is_user() + { + return false; + } +} +class Mixin_Security_Actor_Entity extends Mixin +{ + public $entity_object = null; + public $entity_props = null; + // Note, an Actor with null $entity is considered a "Guest", i.e. no privileges + public function set_entity($entity, $entity_props = null) + { + $this->object->entity_object = $entity; + $this->object->entity_props = $entity_props; + } + public function get_entity($entity = null) + { + if ($entity == null) { + $entity = $this->object->entity_object; + } + if ($entity != null && $entity == $this->object->entity_object) { + return $entity; + } + return null; + } + public function get_entity_id($entity = null) + { + $entity = $this->object->get_entity($entity); + if ($entity != null) { + $entity_props = $this->object->entity_props; + if (isset($entity_props['id'])) { + return $entity_props['id']; + } + } + return null; + } + public function get_entity_type($entity = null) + { + $entity = $this->object->get_entity($entity); + if ($entity != null) { + $entity_props = $this->object->entity_props; + if (isset($entity_props['type'])) { + return $entity_props['type']; + } + } + return null; + } +} +// XXX not used yet +class Mixin_Security_Entity_List extends Mixin +{ + public $_entity_list; + public function add_entity($entity, $entity_props = null) + { + if (!$this->object->is_entity($entity)) { + $entity_props = array_merge((array) $entity_props, array('object' => $entity)); + $this->object->_entity_list[] = $entity_props; + } + } + public function remove_entity($entity) + { + if ($this->object->is_entity($entity)) { + } + } + public function is_entity($entity) + { + return $this->object->get_entity_set($entity); + } + public function get_entity_set($entity) + { + foreach ($this->_entity_list as $entity_set) { + } + } + public function get_entity_id($entity) + { + } + public function get_entity_type($entity) + { + } +} +class C_Security_Actor extends C_Component +{ + public function define($context = FALSE) + { + parent::define($context); + $this->implement('I_Security_Actor'); + $this->add_mixin('Mixin_Security_Actor'); + $this->add_mixin('Mixin_Security_Actor_Entity'); + } +} +class Mixin_Security_Manager extends Mixin +{ + public function is_allowed($capability_name, $args = null) + { + $actor = $this->object->get_current_actor(); + if ($actor != null) { + return $actor->is_allowed($capability_name, $args); + } + return false; + } + public function get_actor($actor_id, $actor_type = null, $args = null) + { + return null; + } + public function get_current_actor() + { + return null; + } +} +class Mixin_Security_Manager_Request extends Mixin +{ + public function get_request_token($action_name, $args = null) + { + return null; + } +} +class C_Security_Manager extends C_Component +{ + static $_instances = array(); + public function define($context = FALSE) + { + parent::define($context); + $this->implement('I_Security_Manager'); + $this->add_mixin('Mixin_Security_Manager'); + $this->add_mixin('Mixin_Security_Manager_Request'); + } + static function get_instance($context = False) + { + if (!isset(self::$_instances[$context])) { + self::$_instances[$context] = new C_Security_Manager($context); + } + return self::$_instances[$context]; + } +} +class Mixin_Security_Token extends Mixin +{ + public function get_request_list($args = null) + { + return array(); + } + public function get_form_html($args = null) + { + return null; + } + public function check_request($request_values) + { + return false; + } + public function check_current_request() + { + return $this->object->check_request($_REQUEST); + } +} +class Mixin_Security_Token_Property extends Mixin +{ + public $_action_name; + public $_args; + public function init_token($action_name, $args = null) + { + $this->object->_action_name = $action_name; + $this->object->_args = $args; + } + public function get_action_name() + { + return $this->object->_action_name; + } + public function get_property($name) + { + if (isset($this->object->_args[$name])) { + return $this->object->_args[$name]; + } + return null; + } + public function get_property_list() + { + return array_keys((array) $this->object->_args); + } +} +class C_Security_Token extends C_Component +{ + public function define($context = FALSE) + { + parent::define($context); + $this->implement('I_Security_Token'); + $this->add_mixin('Mixin_Security_Token'); + $this->add_mixin('Mixin_Security_Token_Property'); + } +} +class Mixin_WordPress_Security_Actor extends Mixin +{ + public function add_capability($capability_name) + { + $entity = $this->object->get_entity(); + if ($entity != null) { + $capability_name = $this->object->get_native_action($capability_name); + $entity->add_cap($capability_name); + return true; + } + return false; + } + public function remove_capability($capability_name) + { + $entity = $this->object->get_entity(); + if ($entity != null && $this->object->is_allowed($capability_name)) { + $capability_name = $this->object->get_native_action($capability_name); + $entity->remove_cap($capability_name); + return true; + } + return false; + } + public function is_allowed($capability_name, $args = null) + { + $entity = $this->object->get_entity(); + if ($entity != null) { + $capability_name = $this->object->get_native_action($capability_name, $args); + return $entity->has_cap($capability_name); + } + return false; + } + public function is_user() + { + return $this->object->get_entity_type() == 'user'; + } + public function get_native_action($capability_name, $args = null) + { + return $capability_name; + } +} +class Mixin_WordPress_Security_Action_Converter extends Mixin +{ + public function get_native_action($capability_name, $args = null) + { + switch ($capability_name) { + case 'nextgen_edit_settings': + $capability_name = 'NextGEN Change options'; + break; + case 'nextgen_edit_style': + $capability_name = 'NextGEN Change style'; + break; + case 'nextgen_edit_display_settings': + $capability_name = 'NextGEN Change options'; + break; + case 'nextgen_edit_displayed_gallery': + $capability_name = 'NextGEN Attach Interface'; + break; + case 'nextgen_edit_gallery': + $capability_name = 'NextGEN Manage gallery'; + break; + case 'nextgen_edit_gallery_unowned': + $capability_name = 'NextGEN Manage others gallery'; + break; + case 'nextgen_upload_image': + $capability_name = 'NextGEN Upload images'; + break; + case 'nextgen_edit_album_settings': + $capability_name = 'NextGEN Edit album settings'; + break; + case 'nextgen_edit_album': + $capability_name = 'NextGEN Edit album'; + break; + } + return $capability_name; + } +} +class C_WordPress_Security_Actor extends C_Security_Actor +{ + public function define($context = FALSE) + { + parent::define($context); + $this->add_mixin('Mixin_WordPress_Security_Actor'); + $this->add_mixin('Mixin_WordPress_Security_Action_Converter'); + } +} +class Mixin_WordPress_Security_Manager extends Mixin +{ + public function get_actor($actor_id, $actor_type = null, $args = null) + { + if ($actor_type == null) { + $actor_type = 'user'; + } + $object = null; + if ($actor_id != null) { + switch ($actor_type) { + case 'user': + $object = get_userdata($actor_id); + if ($object == false) { + $object = null; + } + break; + case 'role': + $object = get_role($actor_id); + if ($object == false) { + $object = null; + } + break; + } + } + if ($object != null) { + $factory = C_Component_Factory::get_instance(); + $actor = $factory->create('wordpress_security_actor', $actor_type); + $entity_props = array('type' => $actor_type, 'id' => $actor_id); + $actor->set_entity($object, $entity_props); + return $actor; + } + return $this->object->get_guest_actor(); + } + public function get_current_actor() + { + // If the current_user has an id of 0, then perhaps something went wrong + // with trying to parse the cookie. In that case, we'll force WordPress to try + // again + global $current_user; + if ($current_user->ID == 0) { + if (isset($GLOBALS['HTTP_COOKIE_VARS']) && isset($GLOBALS['_COOKIE'])) { + $current_user = NULL; + foreach ($GLOBALS['HTTP_COOKIE_VARS'] as $key => $value) { + if (!isset($_COOKIE[$key])) { + $_COOKIE[$key] = $value; + } + } + } + } + return $this->object->get_actor(get_current_user_id(), 'user'); + } + public function get_guest_actor() + { + $factory = C_Component_Factory::get_instance(); + $actor = $factory->create('wordpress_security_actor', 'user'); + $entity_props = array('type' => 'user'); + $actor->set_entity(null, $entity_props); + return $actor; + } +} +class Mixin_WordPress_Security_Manager_Request extends Mixin +{ + public function get_request_token($action_name, $args = null) + { + $factory = C_Component_Factory::get_instance(); + $token = $factory->create('wordpress_security_token'); + $token->init_token($action_name, $args); + return $token; + } +} +class C_WordPress_Security_Manager extends C_Security_Manager +{ + static $_instances = array(); + public function define($context = FALSE) + { + parent::define($context); + $this->add_mixin('Mixin_WordPress_Security_Manager'); + $this->add_mixin('Mixin_WordPress_Security_Manager_Request'); + } + static function get_instance($context = False) + { + if (!isset(self::$_instances[$context])) { + $klass = get_class(); + self::$_instances[$context] = new $klass($context); + } + return self::$_instances[$context]; + } +} +class Mixin_Wordpress_Security_Token extends Mixin +{ + public function get_request_list($args = null) + { + $prefix = isset($args['prefix']) ? $args['prefix'] : null; + $action_name = $this->object->get_action_name(); + $list = array(); + if ($prefix != null) { + $list[$action_name . '_prefix'] = $prefix; + } + $action = $this->object->get_nonce_name(); + $list[$prefix . $action_name . '_sec'] = wp_create_nonce($action); + return $list; + } + public function get_form_html($args = null) + { + $list = $this->object->get_request_list($args); + $out = null; + foreach ($list as $name => $value) { + $out .= '<input type="hidden" name="' . esc_attr($name) . '" value="' . esc_attr($value) . '" />'; + } + return $out; + } + public function get_json($args = null) + { + $list = $this->object->get_request_list($args); + return json_encode($list); + } + public function check_request($request_values) + { + $action_name = $this->object->get_action_name(); + $action = $this->object->get_nonce_name(); + $prefix = isset($request_values[$action_name . '_prefix']) ? $request_values[$action_name . '_prefix'] : null; + if (isset($request_values[$prefix . $action_name . '_sec'])) { + $nonce = $request_values[$prefix . $action_name . '_sec']; + $result = wp_verify_nonce($nonce, $action); + if ($result) { + return true; + } + } + return false; + } + public function get_nonce_name() + { + $action_name = $this->object->get_action_name(); + $prop_list = $this->object->get_property_list(); + $action = $action_name; + foreach ($prop_list as $prop_name) { + $property = $this->object->get_property($prop_name); + $action .= '_' . strval($property); + } + return $action; + } +} +class Mixin_Wordpress_Security_Token_MVC extends Mixin +{ + public function check_request($request_values) + { + // XXX check URL parameters passed with the MVC module + // + return $this->call_parent('check_request', $request_values); + } +} +class C_Wordpress_Security_Token extends C_Security_Token +{ + public function define($context = FALSE) + { + parent::define($context); + $this->add_mixin('Mixin_Wordpress_Security_Token'); + $this->add_mixin('Mixin_Wordpress_Security_Token_MVC'); + } +} \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/simplehtmldom/simplehtmldom/simple_html_dom.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/simplehtmldom/simplehtmldom/simple_html_dom.php index ad492da891ab7bc93e26f2c71b4682170102b88d..a92a94a46783953fb1801a736d17d30260b22f58 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/simplehtmldom/simplehtmldom/simple_html_dom.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/simplehtmldom/simplehtmldom/simple_html_dom.php @@ -1,1742 +1,1742 @@ -<?php -/** - * Website: http://sourceforge.net/projects/simplehtmldom/ - * Additional projects that may be used: http://sourceforge.net/projects/debugobject/ - * Acknowledge: Jose Solorzano (https://sourceforge.net/projects/php-html/) - * Contributions by: - * Yousuke Kumakura (Attribute filters) - * Vadim Voituk (Negative indexes supports of "find" method) - * Antcs (Constructor with automatically load contents either text or file/url) - * - * all affected sections have comments starting with "PaperG" - * - * Paperg - Added case insensitive testing of the value of the selector. - * Paperg - Added tag_start for the starting index of tags - NOTE: This works but not accurately. - * This tag_start gets counted AFTER \r\n have been crushed out, and after the remove_noice calls so it will not reflect the REAL position of the tag in the source, - * it will almost always be smaller by some amount. - * We use this to determine how far into the file the tag in question is. This "percentage will never be accurate as the $dom->size is the "real" number of bytes the dom was created from. - * but for most purposes, it's a really good estimation. - * Paperg - Added the forceTagsClosed to the dom constructor. Forcing tags closed is great for malformed html, but it CAN lead to parsing errors. - * Allow the user to tell us how much they trust the html. - * Paperg add the text and plaintext to the selectors for the find syntax. plaintext implies text in the innertext of a node. text implies that the tag is a text node. - * This allows for us to find tags based on the text they contain. - * Create find_ancestor_tag to see if a tag is - at any level - inside of another specific tag. - * Paperg: added parse_charset so that we know about the character set of the source document. - * NOTE: If the user's system has a routine called get_last_retrieve_url_contents_content_type availalbe, we will assume it's returning the content-type header from the - * last transfer or curl_exec, and we will parse that and use it in preference to any other method of charset detection. - * - * Found infinite loop in the case of broken html in restore_noise. Rewrote to protect from that. - * PaperG (John Schlick) Added get_display_size for "IMG" tags. - * - * Licensed under The MIT License - * Redistributions of files must retain the above copyright notice. - * - * @author S.C. Chen <me578022@gmail.com> - * @author John Schlick - * @author Rus Carroll - * @version 1.5 ($Rev: 208 $) - * @package PlaceLocalInclude - * @subpackage simple_html_dom - */ - -/** - * All of the Defines for the classes below. - * @author S.C. Chen <me578022@gmail.com> - */ -define('HDOM_TYPE_ELEMENT', 1); -define('HDOM_TYPE_COMMENT', 2); -define('HDOM_TYPE_TEXT', 3); -define('HDOM_TYPE_ENDTAG', 4); -define('HDOM_TYPE_ROOT', 5); -define('HDOM_TYPE_UNKNOWN', 6); -define('HDOM_QUOTE_DOUBLE', 0); -define('HDOM_QUOTE_SINGLE', 1); -define('HDOM_QUOTE_NO', 3); -define('HDOM_INFO_BEGIN', 0); -define('HDOM_INFO_END', 1); -define('HDOM_INFO_QUOTE', 2); -define('HDOM_INFO_SPACE', 3); -define('HDOM_INFO_TEXT', 4); -define('HDOM_INFO_INNER', 5); -define('HDOM_INFO_OUTER', 6); -define('HDOM_INFO_ENDSPACE',7); -define('DEFAULT_TARGET_CHARSET', 'UTF-8'); -define('DEFAULT_BR_TEXT', "\r\n"); -define('DEFAULT_SPAN_TEXT', " "); -define('MAX_FILE_SIZE', 600000); -// helper functions -// ----------------------------------------------------------------------------- -// get html dom from file -// $maxlen is defined in the code as PHP_STREAM_COPY_ALL which is defined as -1. -function file_get_html($url, $use_include_path = false, $context=null, $offset = -1, $maxLen=-1, $lowercase = true, $forceTagsClosed=true, $target_charset = DEFAULT_TARGET_CHARSET, $stripRN=true, $defaultBRText=DEFAULT_BR_TEXT, $defaultSpanText=DEFAULT_SPAN_TEXT) -{ - // We DO force the tags to be terminated. - $dom = new simple_html_dom(null, $lowercase, $forceTagsClosed, $target_charset, $stripRN, $defaultBRText, $defaultSpanText); - // For sourceforge users: uncomment the next line and comment the retreive_url_contents line 2 lines down if it is not already done. - $contents = file_get_contents($url, $use_include_path, $context, $offset); - // Paperg - use our own mechanism for getting the contents as we want to control the timeout. - //$contents = retrieve_url_contents($url); - if (empty($contents) || strlen($contents) > MAX_FILE_SIZE) - { - return false; - } - // The second parameter can force the selectors to all be lowercase. - $dom->load($contents, $lowercase, $stripRN); - return $dom; -} - -// get html dom from string -function str_get_html($str, $lowercase=true, $forceTagsClosed=true, $target_charset = DEFAULT_TARGET_CHARSET, $stripRN=true, $defaultBRText=DEFAULT_BR_TEXT, $defaultSpanText=DEFAULT_SPAN_TEXT) -{ - $dom = new simple_html_dom(null, $lowercase, $forceTagsClosed, $target_charset, $stripRN, $defaultBRText, $defaultSpanText); - if (empty($str) || strlen($str) > MAX_FILE_SIZE) - { - $dom->clear(); - return false; - } - $dom->load($str, $lowercase, $stripRN); - return $dom; -} - -// dump html dom tree -function dump_html_tree($node, $show_attr=true, $deep=0) -{ - $node->dump($node); -} - - -/** - * simple html dom node - * PaperG - added ability for "find" routine to lowercase the value of the selector. - * PaperG - added $tag_start to track the start position of the tag in the total byte index - * - * @package PlaceLocalInclude - */ -class simple_html_dom_node -{ - public $nodetype = HDOM_TYPE_TEXT; - public $tag = 'text'; - public $attr = array(); - public $children = array(); - public $nodes = array(); - public $parent = null; - // The "info" array - see HDOM_INFO_... for what each element contains. - public $_ = array(); - public $tag_start = 0; - private $dom = null; - - function __construct($dom) - { - $this->dom = $dom; - $dom->nodes[] = $this; - } - - function __destruct() - { - $this->clear(); - } - - function __toString() - { - return $this->outertext(); - } - - // clean up memory due to php5 circular references memory leak... - function clear() - { - $this->dom = null; - $this->nodes = null; - $this->parent = null; - $this->children = null; - } - - // dump node's tree - function dump($show_attr=true, $deep=0) - { - $lead = str_repeat(' ', $deep); - - echo $lead.$this->tag; - if ($show_attr && count($this->attr)>0) - { - echo '('; - foreach ($this->attr as $k=>$v) - echo "[$k]=>\"".$this->$k.'", '; - echo ')'; - } - echo "\n"; - - if ($this->nodes) - { - foreach ($this->nodes as $c) - { - $c->dump($show_attr, $deep+1); - } - } - } - - - // Debugging function to dump a single dom node with a bunch of information about it. - function dump_node($echo=true) - { - - $string = $this->tag; - if (count($this->attr)>0) - { - $string .= '('; - foreach ($this->attr as $k=>$v) - { - $string .= "[$k]=>\"".$this->$k.'", '; - } - $string .= ')'; - } - if (count($this->_)>0) - { - $string .= ' $_ ('; - foreach ($this->_ as $k=>$v) - { - if (is_array($v)) - { - $string .= "[$k]=>("; - foreach ($v as $k2=>$v2) - { - $string .= "[$k2]=>\"".$v2.'", '; - } - $string .= ")"; - } else { - $string .= "[$k]=>\"".$v.'", '; - } - } - $string .= ")"; - } - - if (isset($this->text)) - { - $string .= " text: (" . $this->text . ")"; - } - - $string .= " HDOM_INNER_INFO: '"; - if (isset($node->_[HDOM_INFO_INNER])) - { - $string .= $node->_[HDOM_INFO_INNER] . "'"; - } - else - { - $string .= ' NULL '; - } - - $string .= " children: " . count($this->children); - $string .= " nodes: " . count($this->nodes); - $string .= " tag_start: " . $this->tag_start; - $string .= "\n"; - - if ($echo) - { - echo $string; - return; - } - else - { - return $string; - } - } - - // returns the parent of node - // If a node is passed in, it will reset the parent of the current node to that one. - function parent($parent=null) - { - // I am SURE that this doesn't work properly. - // It fails to unset the current node from it's current parents nodes or children list first. - if ($parent !== null) - { - $this->parent = $parent; - $this->parent->nodes[] = $this; - $this->parent->children[] = $this; - } - - return $this->parent; - } - - // verify that node has children - function has_child() - { - return !empty($this->children); - } - - // returns children of node - function children($idx=-1) - { - if ($idx===-1) - { - return $this->children; - } - if (isset($this->children[$idx])) - { - return $this->children[$idx]; - } - return null; - } - - // returns the first child of node - function first_child() - { - if (count($this->children)>0) - { - return $this->children[0]; - } - return null; - } - - // returns the last child of node - function last_child() - { - if (($count=count($this->children))>0) - { - return $this->children[$count-1]; - } - return null; - } - - // returns the next sibling of node - function next_sibling() - { - if ($this->parent===null) - { - return null; - } - - $idx = 0; - $count = count($this->parent->children); - while ($idx<$count && $this!==$this->parent->children[$idx]) - { - ++$idx; - } - if (++$idx>=$count) - { - return null; - } - return $this->parent->children[$idx]; - } - - // returns the previous sibling of node - function prev_sibling() - { - if ($this->parent===null) return null; - $idx = 0; - $count = count($this->parent->children); - while ($idx<$count && $this!==$this->parent->children[$idx]) - ++$idx; - if (--$idx<0) return null; - return $this->parent->children[$idx]; - } - - // function to locate a specific ancestor tag in the path to the root. - function find_ancestor_tag($tag) - { - global $debug_object; - if (is_object($debug_object)) { $debug_object->debug_log_entry(1); } - - // Start by including ourselves in the comparison. - $returnDom = $this; - - while (!is_null($returnDom)) - { - if (is_object($debug_object)) { $debug_object->debug_log(2, "Current tag is: " . $returnDom->tag); } - - if ($returnDom->tag == $tag) - { - break; - } - $returnDom = $returnDom->parent; - } - return $returnDom; - } - - // get dom node's inner html - function innertext() - { - if (isset($this->_[HDOM_INFO_INNER])) return $this->_[HDOM_INFO_INNER]; - if (isset($this->_[HDOM_INFO_TEXT])) return $this->dom->restore_noise($this->_[HDOM_INFO_TEXT]); - - $ret = ''; - foreach ($this->nodes as $n) - $ret .= $n->outertext(); - return $ret; - } - - // get dom node's outer text (with tag) - function outertext() - { - global $debug_object; - if (is_object($debug_object)) - { - $text = ''; - if ($this->tag == 'text') - { - if (!empty($this->text)) - { - $text = " with text: " . $this->text; - } - } - $debug_object->debug_log(1, 'Innertext of tag: ' . $this->tag . $text); - } - - if ($this->tag==='root') return $this->innertext(); - - // trigger callback - if ($this->dom && $this->dom->callback!==null) - { - call_user_func_array($this->dom->callback, array($this)); - } - - if (isset($this->_[HDOM_INFO_OUTER])) return $this->_[HDOM_INFO_OUTER]; - if (isset($this->_[HDOM_INFO_TEXT])) return $this->dom->restore_noise($this->_[HDOM_INFO_TEXT]); - - // render begin tag - if ($this->dom && $this->dom->nodes[$this->_[HDOM_INFO_BEGIN]]) - { - $ret = $this->dom->nodes[$this->_[HDOM_INFO_BEGIN]]->makeup(); - } else { - $ret = ""; - } - - // render inner text - if (isset($this->_[HDOM_INFO_INNER])) - { - // If it's a br tag... don't return the HDOM_INNER_INFO that we may or may not have added. - if ($this->tag != "br") - { - $ret .= $this->_[HDOM_INFO_INNER]; - } - } else { - if ($this->nodes) - { - foreach ($this->nodes as $n) - { - $ret .= $this->convert_text($n->outertext()); - } - } - } - - // render end tag - if (isset($this->_[HDOM_INFO_END]) && $this->_[HDOM_INFO_END]!=0) - $ret .= '</'.$this->tag.'>'; - return $ret; - } - - // get dom node's plain text - function text() - { - if (isset($this->_[HDOM_INFO_INNER])) return $this->_[HDOM_INFO_INNER]; - switch ($this->nodetype) - { - case HDOM_TYPE_TEXT: return $this->dom->restore_noise($this->_[HDOM_INFO_TEXT]); - case HDOM_TYPE_COMMENT: return ''; - case HDOM_TYPE_UNKNOWN: return ''; - } - if (strcasecmp($this->tag, 'script')===0) return ''; - if (strcasecmp($this->tag, 'style')===0) return ''; - - $ret = ''; - // In rare cases, (always node type 1 or HDOM_TYPE_ELEMENT - observed for some span tags, and some p tags) $this->nodes is set to NULL. - // NOTE: This indicates that there is a problem where it's set to NULL without a clear happening. - // WHY is this happening? - if (!is_null($this->nodes)) - { - foreach ($this->nodes as $n) - { - $ret .= $this->convert_text($n->text()); - } - - // If this node is a span... add a space at the end of it so multiple spans don't run into each other. This is plaintext after all. - if ($this->tag == "span") - { - $ret .= $this->dom->default_span_text; - } - - - } - return $ret; - } - - function xmltext() - { - $ret = $this->innertext(); - $ret = str_ireplace('<![CDATA[', '', $ret); - $ret = str_replace(']]>', '', $ret); - return $ret; - } - - // build node's text with tag - function makeup() - { - // text, comment, unknown - if (isset($this->_[HDOM_INFO_TEXT])) return $this->dom->restore_noise($this->_[HDOM_INFO_TEXT]); - - $ret = '<'.$this->tag; - $i = -1; - - foreach ($this->attr as $key=>$val) - { - ++$i; - - // skip removed attribute - if ($val===null || $val===false) - continue; - - $ret .= $this->_[HDOM_INFO_SPACE][$i][0]; - //no value attr: nowrap, checked selected... - if ($val===true) - $ret .= $key; - else { - switch ($this->_[HDOM_INFO_QUOTE][$i]) - { - case HDOM_QUOTE_DOUBLE: $quote = '"'; break; - case HDOM_QUOTE_SINGLE: $quote = '\''; break; - default: $quote = ''; - } - $ret .= $key.$this->_[HDOM_INFO_SPACE][$i][1].'='.$this->_[HDOM_INFO_SPACE][$i][2].$quote.$val.$quote; - } - } - $ret = $this->dom->restore_noise($ret); - return $ret . $this->_[HDOM_INFO_ENDSPACE] . '>'; - } - - // find elements by css selector - //PaperG - added ability for find to lowercase the value of the selector. - function find($selector, $idx=null, $lowercase=false) - { - $selectors = $this->parse_selector($selector); - if (($count=count($selectors))===0) return array(); - $found_keys = array(); - - // find each selector - for ($c=0; $c<$count; ++$c) - { - // The change on the below line was documented on the sourceforge code tracker id 2788009 - // used to be: if (($levle=count($selectors[0]))===0) return array(); - if (($levle=count($selectors[$c]))===0) return array(); - if (!isset($this->_[HDOM_INFO_BEGIN])) return array(); - - $head = array($this->_[HDOM_INFO_BEGIN]=>1); - - // handle descendant selectors, no recursive! - for ($l=0; $l<$levle; ++$l) - { - $ret = array(); - foreach ($head as $k=>$v) - { - $n = ($k===-1) ? $this->dom->root : $this->dom->nodes[$k]; - //PaperG - Pass this optional parameter on to the seek function. - $n->seek($selectors[$c][$l], $ret, $lowercase); - } - $head = $ret; - } - - foreach ($head as $k=>$v) - { - if (!isset($found_keys[$k])) - { - $found_keys[$k] = 1; - } - } - } - - // sort keys - ksort($found_keys); - - $found = array(); - foreach ($found_keys as $k=>$v) - $found[] = $this->dom->nodes[$k]; - - // return nth-element or array - if (is_null($idx)) return $found; - else if ($idx<0) $idx = count($found) + $idx; - return (isset($found[$idx])) ? $found[$idx] : null; - } - - // seek for given conditions - // PaperG - added parameter to allow for case insensitive testing of the value of a selector. - protected function seek($selector, &$ret, $lowercase=false) - { - global $debug_object; - if (is_object($debug_object)) { $debug_object->debug_log_entry(1); } - - list($tag, $key, $val, $exp, $no_key) = $selector; - - // xpath index - if ($tag && $key && is_numeric($key)) - { - $count = 0; - foreach ($this->children as $c) - { - if ($tag==='*' || $tag===$c->tag) { - if (++$count==$key) { - $ret[$c->_[HDOM_INFO_BEGIN]] = 1; - return; - } - } - } - return; - } - - $end = (!empty($this->_[HDOM_INFO_END])) ? $this->_[HDOM_INFO_END] : 0; - if ($end==0) { - $parent = $this->parent; - while (!isset($parent->_[HDOM_INFO_END]) && $parent!==null) { - $end -= 1; - $parent = $parent->parent; - } - $end += $parent->_[HDOM_INFO_END]; - } - - for ($i=$this->_[HDOM_INFO_BEGIN]+1; $i<$end; ++$i) { - $node = $this->dom->nodes[$i]; - - $pass = true; - - if ($tag==='*' && !$key) { - if (in_array($node, $this->children, true)) - $ret[$i] = 1; - continue; - } - - // compare tag - if ($tag && $tag!=$node->tag && $tag!=='*') {$pass=false;} - // compare key - if ($pass && $key) { - if ($no_key) { - if (isset($node->attr[$key])) $pass=false; - } else { - if (($key != "plaintext") && !isset($node->attr[$key])) $pass=false; - } - } - // compare value - if ($pass && $key && $val && $val!=='*') { - // If they have told us that this is a "plaintext" search then we want the plaintext of the node - right? - if ($key == "plaintext") { - // $node->plaintext actually returns $node->text(); - $nodeKeyValue = $node->text(); - } else { - // this is a normal search, we want the value of that attribute of the tag. - $nodeKeyValue = $node->attr[$key]; - } - if (is_object($debug_object)) {$debug_object->debug_log(2, "testing node: " . $node->tag . " for attribute: " . $key . $exp . $val . " where nodes value is: " . $nodeKeyValue);} - - //PaperG - If lowercase is set, do a case insensitive test of the value of the selector. - if ($lowercase) { - $check = $this->match($exp, strtolower($val), strtolower($nodeKeyValue)); - } else { - $check = $this->match($exp, $val, $nodeKeyValue); - } - if (is_object($debug_object)) {$debug_object->debug_log(2, "after match: " . ($check ? "true" : "false"));} - - // handle multiple class - if (!$check && strcasecmp($key, 'class')===0) { - foreach (explode(' ',$node->attr[$key]) as $k) { - // Without this, there were cases where leading, trailing, or double spaces lead to our comparing blanks - bad form. - if (!empty($k)) { - if ($lowercase) { - $check = $this->match($exp, strtolower($val), strtolower($k)); - } else { - $check = $this->match($exp, $val, $k); - } - if ($check) break; - } - } - } - if (!$check) $pass = false; - } - if ($pass) $ret[$i] = 1; - unset($node); - } - // It's passed by reference so this is actually what this function returns. - if (is_object($debug_object)) {$debug_object->debug_log(1, "EXIT - ret: ", $ret);} - } - - protected function match($exp, $pattern, $value) { - global $debug_object; - if (is_object($debug_object)) {$debug_object->debug_log_entry(1);} - - switch ($exp) { - case '=': - return ($value===$pattern); - case '!=': - return ($value!==$pattern); - case '^=': - return preg_match("/^".preg_quote($pattern,'/')."/", $value); - case '$=': - return preg_match("/".preg_quote($pattern,'/')."$/", $value); - case '*=': - if ($pattern[0]=='/') { - return preg_match($pattern, $value); - } - return preg_match("/".$pattern."/i", $value); - } - return false; - } - - protected function parse_selector($selector_string) { - global $debug_object; - if (is_object($debug_object)) {$debug_object->debug_log_entry(1);} - - // pattern of CSS selectors, modified from mootools - // Paperg: Add the colon to the attrbute, so that it properly finds <tag attr:ibute="something" > like google does. - // Note: if you try to look at this attribute, yo MUST use getAttribute since $dom->x:y will fail the php syntax check. -// Notice the \[ starting the attbute? and the @? following? This implies that an attribute can begin with an @ sign that is not captured. -// This implies that an html attribute specifier may start with an @ sign that is NOT captured by the expression. -// farther study is required to determine of this should be documented or removed. -// $pattern = "/([\w-:\*]*)(?:\#([\w-]+)|\.([\w-]+))?(?:\[@?(!?[\w-]+)(?:([!*^$]?=)[\"']?(.*?)[\"']?)?\])?([\/, ]+)/is"; - $pattern = "/([\w-:\*]*)(?:\#([\w-]+)|\.([\w-]+))?(?:\[@?(!?[\w-:]+)(?:([!*^$]?=)[\"']?(.*?)[\"']?)?\])?([\/, ]+)/is"; - preg_match_all($pattern, trim($selector_string).' ', $matches, PREG_SET_ORDER); - if (is_object($debug_object)) {$debug_object->debug_log(2, "Matches Array: ", $matches);} - - $selectors = array(); - $result = array(); - //print_r($matches); - - foreach ($matches as $m) { - $m[0] = trim($m[0]); - if ($m[0]==='' || $m[0]==='/' || $m[0]==='//') continue; - // for browser generated xpath - if ($m[1]==='tbody') continue; - - list($tag, $key, $val, $exp, $no_key) = array($m[1], null, null, '=', false); - if (!empty($m[2])) {$key='id'; $val=$m[2];} - if (!empty($m[3])) {$key='class'; $val=$m[3];} - if (!empty($m[4])) {$key=$m[4];} - if (!empty($m[5])) {$exp=$m[5];} - if (!empty($m[6])) {$val=$m[6];} - - // convert to lowercase - if ($this->dom->lowercase) {$tag=strtolower($tag); $key=strtolower($key);} - //elements that do NOT have the specified attribute - if (isset($key[0]) && $key[0]==='!') {$key=substr($key, 1); $no_key=true;} - - $result[] = array($tag, $key, $val, $exp, $no_key); - if (trim($m[7])===',') { - $selectors[] = $result; - $result = array(); - } - } - if (count($result)>0) - $selectors[] = $result; - return $selectors; - } - - function __get($name) - { - if (isset($this->attr[$name])) - { - return $this->convert_text($this->attr[$name]); - } - switch ($name) - { - case 'outertext': return $this->outertext(); - case 'innertext': return $this->innertext(); - case 'plaintext': return $this->text(); - case 'xmltext': return $this->xmltext(); - default: return array_key_exists($name, $this->attr); - } - } - - function __set($name, $value) - { - global $debug_object; - if (is_object($debug_object)) {$debug_object->debug_log_entry(1);} - - switch ($name) - { - case 'outertext': return $this->_[HDOM_INFO_OUTER] = $value; - case 'innertext': - if (isset($this->_[HDOM_INFO_TEXT])) return $this->_[HDOM_INFO_TEXT] = $value; - return $this->_[HDOM_INFO_INNER] = $value; - } - if (!isset($this->attr[$name])) - { - $this->_[HDOM_INFO_SPACE][] = array(' ', '', ''); - $this->_[HDOM_INFO_QUOTE][] = HDOM_QUOTE_DOUBLE; - } - $this->attr[$name] = $value; - } - - function __isset($name) - { - switch ($name) - { - case 'outertext': return true; - case 'innertext': return true; - case 'plaintext': return true; - } - //no value attr: nowrap, checked selected... - return (array_key_exists($name, $this->attr)) ? true : isset($this->attr[$name]); - } - - function __unset($name) { - if (isset($this->attr[$name])) - unset($this->attr[$name]); - } - - // PaperG - Function to convert the text from one character set to another if the two sets are not the same. - function convert_text($text) - { - global $debug_object; - if (is_object($debug_object)) {$debug_object->debug_log_entry(1);} - - $converted_text = $text; - - $sourceCharset = ""; - $targetCharset = ""; - - if ($this->dom) - { - $sourceCharset = strtoupper($this->dom->_charset); - $targetCharset = strtoupper($this->dom->_target_charset); - } - if (is_object($debug_object)) {$debug_object->debug_log(3, "source charset: " . $sourceCharset . " target charaset: " . $targetCharset);} - - if (!empty($sourceCharset) && !empty($targetCharset) && (strcasecmp($sourceCharset, $targetCharset) != 0)) - { - // Check if the reported encoding could have been incorrect and the text is actually already UTF-8 - if ((strcasecmp($targetCharset, 'UTF-8') == 0) && ($this->is_utf8($text))) - { - $converted_text = $text; - } - else - { - $converted_text = iconv($sourceCharset, $targetCharset, $text); - } - } - - // Lets make sure that we don't have that silly BOM issue with any of the utf-8 text we output. - if ($targetCharset == 'UTF-8') - { - if (substr($converted_text, 0, 3) == "\xef\xbb\xbf") - { - $converted_text = substr($converted_text, 3); - } - if (substr($converted_text, -3) == "\xef\xbb\xbf") - { - $converted_text = substr($converted_text, 0, -3); - } - } - - return $converted_text; - } - - /** - * Returns true if $string is valid UTF-8 and false otherwise. - * - * @param mixed $str String to be tested - * @return boolean - */ - static function is_utf8($str) - { - $c=0; $b=0; - $bits=0; - $len=strlen($str); - for($i=0; $i<$len; $i++) - { - $c=ord($str[$i]); - if($c > 128) - { - if(($c >= 254)) return false; - elseif($c >= 252) $bits=6; - elseif($c >= 248) $bits=5; - elseif($c >= 240) $bits=4; - elseif($c >= 224) $bits=3; - elseif($c >= 192) $bits=2; - else return false; - if(($i+$bits) > $len) return false; - while($bits > 1) - { - $i++; - $b=ord($str[$i]); - if($b < 128 || $b > 191) return false; - $bits--; - } - } - } - return true; - } - /* - function is_utf8($string) - { - //this is buggy - return (utf8_encode(utf8_decode($string)) == $string); - } - */ - - /** - * Function to try a few tricks to determine the displayed size of an img on the page. - * NOTE: This will ONLY work on an IMG tag. Returns FALSE on all other tag types. - * - * @author John Schlick - * @version April 19 2012 - * @return array an array containing the 'height' and 'width' of the image on the page or -1 if we can't figure it out. - */ - function get_display_size() - { - global $debug_object; - - $width = -1; - $height = -1; - - if ($this->tag !== 'img') - { - return false; - } - - // See if there is aheight or width attribute in the tag itself. - if (isset($this->attr['width'])) - { - $width = $this->attr['width']; - } - - if (isset($this->attr['height'])) - { - $height = $this->attr['height']; - } - - // Now look for an inline style. - if (isset($this->attr['style'])) - { - // Thanks to user gnarf from stackoverflow for this regular expression. - $attributes = array(); - preg_match_all("/([\w-]+)\s*:\s*([^;]+)\s*;?/", $this->attr['style'], $matches, PREG_SET_ORDER); - foreach ($matches as $match) { - $attributes[$match[1]] = $match[2]; - } - - // If there is a width in the style attributes: - if (isset($attributes['width']) && $width == -1) - { - // check that the last two characters are px (pixels) - if (strtolower(substr($attributes['width'], -2)) == 'px') - { - $proposed_width = substr($attributes['width'], 0, -2); - // Now make sure that it's an integer and not something stupid. - if (filter_var($proposed_width, FILTER_VALIDATE_INT)) - { - $width = $proposed_width; - } - } - } - - // If there is a width in the style attributes: - if (isset($attributes['height']) && $height == -1) - { - // check that the last two characters are px (pixels) - if (strtolower(substr($attributes['height'], -2)) == 'px') - { - $proposed_height = substr($attributes['height'], 0, -2); - // Now make sure that it's an integer and not something stupid. - if (filter_var($proposed_height, FILTER_VALIDATE_INT)) - { - $height = $proposed_height; - } - } - } - - } - - // Future enhancement: - // Look in the tag to see if there is a class or id specified that has a height or width attribute to it. - - // Far future enhancement - // Look at all the parent tags of this image to see if they specify a class or id that has an img selector that specifies a height or width - // Note that in this case, the class or id will have the img subselector for it to apply to the image. - - // ridiculously far future development - // If the class or id is specified in a SEPARATE css file thats not on the page, go get it and do what we were just doing for the ones on the page. - - $result = array('height' => $height, - 'width' => $width); - return $result; - } - - // camel naming conventions - function getAllAttributes() {return $this->attr;} - function getAttribute($name) {return $this->__get($name);} - function setAttribute($name, $value) {$this->__set($name, $value);} - function hasAttribute($name) {return $this->__isset($name);} - function removeAttribute($name) {$this->__set($name, null);} - function getElementById($id) {return $this->find("#$id", 0);} - function getElementsById($id, $idx=null) {return $this->find("#$id", $idx);} - function getElementByTagName($name) {return $this->find($name, 0);} - function getElementsByTagName($name, $idx=null) {return $this->find($name, $idx);} - function parentNode() {return $this->parent();} - function childNodes($idx=-1) {return $this->children($idx);} - function firstChild() {return $this->first_child();} - function lastChild() {return $this->last_child();} - function nextSibling() {return $this->next_sibling();} - function previousSibling() {return $this->prev_sibling();} - function hasChildNodes() {return $this->has_child();} - function nodeName() {return $this->tag;} - function appendChild($node) {$node->parent($this); return $node;} - -} - -/** - * simple html dom parser - * Paperg - in the find routine: allow us to specify that we want case insensitive testing of the value of the selector. - * Paperg - change $size from protected to public so we can easily access it - * Paperg - added ForceTagsClosed in the constructor which tells us whether we trust the html or not. Default is to NOT trust it. - * - * @package PlaceLocalInclude - */ -class simple_html_dom -{ - public $root = null; - public $nodes = array(); - public $callback = null; - public $lowercase = false; - // Used to keep track of how large the text was when we started. - public $original_size; - public $size; - protected $pos; - protected $doc; - protected $char; - protected $cursor; - protected $parent; - protected $noise = array(); - protected $token_blank = " \t\r\n"; - protected $token_equal = ' =/>'; - protected $token_slash = " />\r\n\t"; - protected $token_attr = ' >'; - // Note that this is referenced by a child node, and so it needs to be public for that node to see this information. - public $_charset = ''; - public $_target_charset = ''; - protected $default_br_text = ""; - public $default_span_text = ""; - - // use isset instead of in_array, performance boost about 30%... - protected $self_closing_tags = array('img'=>1, 'br'=>1, 'input'=>1, 'meta'=>1, 'link'=>1, 'hr'=>1, 'base'=>1, 'embed'=>1, 'spacer'=>1); - protected $block_tags = array('root'=>1, 'body'=>1, 'form'=>1, 'div'=>1, 'span'=>1, 'table'=>1); - // Known sourceforge issue #2977341 - // B tags that are not closed cause us to return everything to the end of the document. - protected $optional_closing_tags = array( - 'tr'=>array('tr'=>1, 'td'=>1, 'th'=>1), - 'th'=>array('th'=>1), - 'td'=>array('td'=>1), - 'li'=>array('li'=>1), - 'dt'=>array('dt'=>1, 'dd'=>1), - 'dd'=>array('dd'=>1, 'dt'=>1), - 'dl'=>array('dd'=>1, 'dt'=>1), - 'p'=>array('p'=>1), - 'nobr'=>array('nobr'=>1), - 'b'=>array('b'=>1), - 'option'=>array('option'=>1), - ); - - function __construct($str=null, $lowercase=true, $forceTagsClosed=true, $target_charset=DEFAULT_TARGET_CHARSET, $stripRN=true, $defaultBRText=DEFAULT_BR_TEXT, $defaultSpanText=DEFAULT_SPAN_TEXT) - { - if ($str) - { - if (preg_match("/^http:\/\//i",$str) || is_file($str)) - { - $this->load_file($str); - } - else - { - $this->load($str, $lowercase, $stripRN, $defaultBRText, $defaultSpanText); - } - } - // Forcing tags to be closed implies that we don't trust the html, but it can lead to parsing errors if we SHOULD trust the html. - if (!$forceTagsClosed) { - $this->optional_closing_array=array(); - } - $this->_target_charset = $target_charset; - } - - function __destruct() - { - $this->clear(); - } - - // load html from string - function load($str, $lowercase=true, $stripRN=true, $defaultBRText=DEFAULT_BR_TEXT, $defaultSpanText=DEFAULT_SPAN_TEXT) - { - global $debug_object; - - // prepare - $this->prepare($str, $lowercase, $stripRN, $defaultBRText, $defaultSpanText); - // strip out cdata - $this->remove_noise("'<!\[CDATA\[(.*?)\]\]>'is", true); - // strip out comments - $this->remove_noise("'<!--(.*?)-->'is"); - // Per sourceforge http://sourceforge.net/tracker/?func=detail&aid=2949097&group_id=218559&atid=1044037 - // Script tags removal now preceeds style tag removal. - // strip out <script> tags - $this->remove_noise("'<\s*script[^>]*[^/]>(.*?)<\s*/\s*script\s*>'is"); - $this->remove_noise("'<\s*script\s*>(.*?)<\s*/\s*script\s*>'is"); - // strip out <style> tags - $this->remove_noise("'<\s*style[^>]*[^/]>(.*?)<\s*/\s*style\s*>'is"); - $this->remove_noise("'<\s*style\s*>(.*?)<\s*/\s*style\s*>'is"); - // strip out preformatted tags - $this->remove_noise("'<\s*(?:code)[^>]*>(.*?)<\s*/\s*(?:code)\s*>'is"); - // strip out server side scripts - $this->remove_noise("'(<\?)(.*?)(\?>)'s", true); - // strip smarty scripts - $this->remove_noise("'(\{\w)(.*?)(\})'s", true); - - // parsing - while ($this->parse()); - // end - $this->root->_[HDOM_INFO_END] = $this->cursor; - $this->parse_charset(); - - // make load function chainable - return $this; - - } - - // load html from file - function load_file() - { - $args = func_get_args(); - $this->load(call_user_func_array('file_get_contents', $args), true); - // Throw an error if we can't properly load the dom. - if (($error=error_get_last())!==null) { - $this->clear(); - return false; - } - } - - // set callback function - function set_callback($function_name) - { - $this->callback = $function_name; - } - - // remove callback function - function remove_callback() - { - $this->callback = null; - } - - // save dom as string - function save($filepath='') - { - $ret = $this->root->innertext(); - if ($filepath!=='') file_put_contents($filepath, $ret, LOCK_EX); - return $ret; - } - - // find dom node by css selector - // Paperg - allow us to specify that we want case insensitive testing of the value of the selector. - function find($selector, $idx=null, $lowercase=false) - { - return $this->root->find($selector, $idx, $lowercase); - } - - // clean up memory due to php5 circular references memory leak... - function clear() - { - foreach ($this->nodes as $n) {$n->clear(); $n = null;} - // This add next line is documented in the sourceforge repository. 2977248 as a fix for ongoing memory leaks that occur even with the use of clear. - if (isset($this->children)) foreach ($this->children as $n) {$n->clear(); $n = null;} - if (isset($this->parent)) {$this->parent->clear(); unset($this->parent);} - if (isset($this->root)) {$this->root->clear(); unset($this->root);} - unset($this->doc); - unset($this->noise); - } - - function dump($show_attr=true) - { - $this->root->dump($show_attr); - } - - // prepare HTML data and init everything - protected function prepare($str, $lowercase=true, $stripRN=true, $defaultBRText=DEFAULT_BR_TEXT, $defaultSpanText=DEFAULT_SPAN_TEXT) - { - $this->clear(); - - // set the length of content before we do anything to it. - $this->size = strlen($str); - // Save the original size of the html that we got in. It might be useful to someone. - $this->original_size = $this->size; - - //before we save the string as the doc... strip out the \r \n's if we are told to. - if ($stripRN) { - $str = str_replace("\r", " ", $str); - $str = str_replace("\n", " ", $str); - - // set the length of content since we have changed it. - $this->size = strlen($str); - } - - $this->doc = $str; - $this->pos = 0; - $this->cursor = 1; - $this->noise = array(); - $this->nodes = array(); - $this->lowercase = $lowercase; - $this->default_br_text = $defaultBRText; - $this->default_span_text = $defaultSpanText; - $this->root = new simple_html_dom_node($this); - $this->root->tag = 'root'; - $this->root->_[HDOM_INFO_BEGIN] = -1; - $this->root->nodetype = HDOM_TYPE_ROOT; - $this->parent = $this->root; - if ($this->size>0) $this->char = $this->doc[0]; - } - - // parse html content - protected function parse() - { - if (($s = $this->copy_until_char('<'))==='') - { - return $this->read_tag(); - } - - // text - $node = new simple_html_dom_node($this); - ++$this->cursor; - $node->_[HDOM_INFO_TEXT] = $s; - $this->link_nodes($node, false); - return true; - } - - // PAPERG - dkchou - added this to try to identify the character set of the page we have just parsed so we know better how to spit it out later. - // NOTE: IF you provide a routine called get_last_retrieve_url_contents_content_type which returns the CURLINFO_CONTENT_TYPE from the last curl_exec - // (or the content_type header from the last transfer), we will parse THAT, and if a charset is specified, we will use it over any other mechanism. - protected function parse_charset() - { - global $debug_object; - - $charset = null; - - if (function_exists('get_last_retrieve_url_contents_content_type')) - { - $contentTypeHeader = get_last_retrieve_url_contents_content_type(); - $success = preg_match('/charset=(.+)/', $contentTypeHeader, $matches); - if ($success) - { - $charset = $matches[1]; - if (is_object($debug_object)) {$debug_object->debug_log(2, 'header content-type found charset of: ' . $charset);} - } - - } - - if (empty($charset)) - { - $el = $this->root->find('meta[http-equiv=Content-Type]',0); - if (!empty($el)) - { - $fullvalue = $el->content; - if (is_object($debug_object)) {$debug_object->debug_log(2, 'meta content-type tag found' . $fullvalue);} - - if (!empty($fullvalue)) - { - $success = preg_match('/charset=(.+)/', $fullvalue, $matches); - if ($success) - { - $charset = $matches[1]; - } - else - { - // If there is a meta tag, and they don't specify the character set, research says that it's typically ISO-8859-1 - if (is_object($debug_object)) {$debug_object->debug_log(2, 'meta content-type tag couldn\'t be parsed. using iso-8859 default.');} - $charset = 'ISO-8859-1'; - } - } - } - } - - // If we couldn't find a charset above, then lets try to detect one based on the text we got... - if (empty($charset)) - { - // Use this in case mb_detect_charset isn't installed/loaded on this machine. - $charset = false; - if (function_exists('mb_detect_encoding')) - { - // Have php try to detect the encoding from the text given to us. - $charset = mb_detect_encoding($this->root->plaintext . "ascii", $encoding_list = array( "UTF-8", "CP1252" ) ); - if (is_object($debug_object)) {$debug_object->debug_log(2, 'mb_detect found: ' . $charset);} - } - - // and if this doesn't work... then we need to just wrongheadedly assume it's UTF-8 so that we can move on - cause this will usually give us most of what we need... - if ($charset === false) - { - if (is_object($debug_object)) {$debug_object->debug_log(2, 'since mb_detect failed - using default of utf-8');} - $charset = 'UTF-8'; - } - } - - // Since CP1252 is a superset, if we get one of it's subsets, we want it instead. - if ((strtolower($charset) == strtolower('ISO-8859-1')) || (strtolower($charset) == strtolower('Latin1')) || (strtolower($charset) == strtolower('Latin-1'))) - { - if (is_object($debug_object)) {$debug_object->debug_log(2, 'replacing ' . $charset . ' with CP1252 as its a superset');} - $charset = 'CP1252'; - } - - if (is_object($debug_object)) {$debug_object->debug_log(1, 'EXIT - ' . $charset);} - - return $this->_charset = $charset; - } - - // read tag info - protected function read_tag() - { - if ($this->char!=='<') - { - $this->root->_[HDOM_INFO_END] = $this->cursor; - return false; - } - $begin_tag_pos = $this->pos; - $this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next - - // end tag - if ($this->char==='/') - { - $this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next - // This represents the change in the simple_html_dom trunk from revision 180 to 181. - // $this->skip($this->token_blank_t); - $this->skip($this->token_blank); - $tag = $this->copy_until_char('>'); - - // skip attributes in end tag - if (($pos = strpos($tag, ' '))!==false) - $tag = substr($tag, 0, $pos); - - $parent_lower = strtolower($this->parent->tag); - $tag_lower = strtolower($tag); - - if ($parent_lower!==$tag_lower) - { - if (isset($this->optional_closing_tags[$parent_lower]) && isset($this->block_tags[$tag_lower])) - { - $this->parent->_[HDOM_INFO_END] = 0; - $org_parent = $this->parent; - - while (($this->parent->parent) && strtolower($this->parent->tag)!==$tag_lower) - $this->parent = $this->parent->parent; - - if (strtolower($this->parent->tag)!==$tag_lower) { - $this->parent = $org_parent; // restore origonal parent - if ($this->parent->parent) $this->parent = $this->parent->parent; - $this->parent->_[HDOM_INFO_END] = $this->cursor; - return $this->as_text_node($tag); - } - } - else if (($this->parent->parent) && isset($this->block_tags[$tag_lower])) - { - $this->parent->_[HDOM_INFO_END] = 0; - $org_parent = $this->parent; - - while (($this->parent->parent) && strtolower($this->parent->tag)!==$tag_lower) - $this->parent = $this->parent->parent; - - if (strtolower($this->parent->tag)!==$tag_lower) - { - $this->parent = $org_parent; // restore origonal parent - $this->parent->_[HDOM_INFO_END] = $this->cursor; - return $this->as_text_node($tag); - } - } - else if (($this->parent->parent) && strtolower($this->parent->parent->tag)===$tag_lower) - { - $this->parent->_[HDOM_INFO_END] = 0; - $this->parent = $this->parent->parent; - } - else - return $this->as_text_node($tag); - } - - $this->parent->_[HDOM_INFO_END] = $this->cursor; - if ($this->parent->parent) $this->parent = $this->parent->parent; - - $this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next - return true; - } - - $node = new simple_html_dom_node($this); - $node->_[HDOM_INFO_BEGIN] = $this->cursor; - ++$this->cursor; - $tag = $this->copy_until($this->token_slash); - $node->tag_start = $begin_tag_pos; - - // doctype, cdata & comments... - if (isset($tag[0]) && $tag[0]==='!') { - $node->_[HDOM_INFO_TEXT] = '<' . $tag . $this->copy_until_char('>'); - - if (isset($tag[2]) && $tag[1]==='-' && $tag[2]==='-') { - $node->nodetype = HDOM_TYPE_COMMENT; - $node->tag = 'comment'; - } else { - $node->nodetype = HDOM_TYPE_UNKNOWN; - $node->tag = 'unknown'; - } - if ($this->char==='>') $node->_[HDOM_INFO_TEXT].='>'; - $this->link_nodes($node, true); - $this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next - return true; - } - - // text - if ($pos=strpos($tag, '<')!==false) { - $tag = '<' . substr($tag, 0, -1); - $node->_[HDOM_INFO_TEXT] = $tag; - $this->link_nodes($node, false); - $this->char = $this->doc[--$this->pos]; // prev - return true; - } - - if (!preg_match("/^[\w-:]+$/", $tag)) { - $node->_[HDOM_INFO_TEXT] = '<' . $tag . $this->copy_until('<>'); - if ($this->char==='<') { - $this->link_nodes($node, false); - return true; - } - - if ($this->char==='>') $node->_[HDOM_INFO_TEXT].='>'; - $this->link_nodes($node, false); - $this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next - return true; - } - - // begin tag - $node->nodetype = HDOM_TYPE_ELEMENT; - $tag_lower = strtolower($tag); - $node->tag = ($this->lowercase) ? $tag_lower : $tag; - - // handle optional closing tags - if (isset($this->optional_closing_tags[$tag_lower]) ) - { - while (isset($this->optional_closing_tags[$tag_lower][strtolower($this->parent->tag)])) - { - $this->parent->_[HDOM_INFO_END] = 0; - $this->parent = $this->parent->parent; - } - $node->parent = $this->parent; - } - - $guard = 0; // prevent infinity loop - $space = array($this->copy_skip($this->token_blank), '', ''); - - // attributes - do - { - if ($this->char!==null && $space[0]==='') - { - break; - } - $name = $this->copy_until($this->token_equal); - if ($guard===$this->pos) - { - $this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next - continue; - } - $guard = $this->pos; - - // handle endless '<' - if ($this->pos>=$this->size-1 && $this->char!=='>') { - $node->nodetype = HDOM_TYPE_TEXT; - $node->_[HDOM_INFO_END] = 0; - $node->_[HDOM_INFO_TEXT] = '<'.$tag . $space[0] . $name; - $node->tag = 'text'; - $this->link_nodes($node, false); - return true; - } - - // handle mismatch '<' - if ($this->doc[$this->pos-1]=='<') { - $node->nodetype = HDOM_TYPE_TEXT; - $node->tag = 'text'; - $node->attr = array(); - $node->_[HDOM_INFO_END] = 0; - $node->_[HDOM_INFO_TEXT] = substr($this->doc, $begin_tag_pos, $this->pos-$begin_tag_pos-1); - $this->pos -= 2; - $this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next - $this->link_nodes($node, false); - return true; - } - - if ($name!=='/' && $name!=='') { - $space[1] = $this->copy_skip($this->token_blank); - $name = $this->restore_noise($name); - if ($this->lowercase) $name = strtolower($name); - if ($this->char==='=') { - $this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next - $this->parse_attr($node, $name, $space); - } - else { - //no value attr: nowrap, checked selected... - $node->_[HDOM_INFO_QUOTE][] = HDOM_QUOTE_NO; - $node->attr[$name] = true; - if ($this->char!='>') $this->char = $this->doc[--$this->pos]; // prev - } - $node->_[HDOM_INFO_SPACE][] = $space; - $space = array($this->copy_skip($this->token_blank), '', ''); - } - else - break; - } while ($this->char!=='>' && $this->char!=='/'); - - $this->link_nodes($node, true); - $node->_[HDOM_INFO_ENDSPACE] = $space[0]; - - // check self closing - if ($this->copy_until_char_escape('>')==='/') - { - $node->_[HDOM_INFO_ENDSPACE] .= '/'; - $node->_[HDOM_INFO_END] = 0; - } - else - { - // reset parent - if (!isset($this->self_closing_tags[strtolower($node->tag)])) $this->parent = $node; - } - $this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next - - // If it's a BR tag, we need to set it's text to the default text. - // This way when we see it in plaintext, we can generate formatting that the user wants. - // since a br tag never has sub nodes, this works well. - if ($node->tag == "br") - { - $node->_[HDOM_INFO_INNER] = $this->default_br_text; - } - - return true; - } - - // parse attributes - protected function parse_attr($node, $name, &$space) - { - // Per sourceforge: http://sourceforge.net/tracker/?func=detail&aid=3061408&group_id=218559&atid=1044037 - // If the attribute is already defined inside a tag, only pay atetntion to the first one as opposed to the last one. - if (isset($node->attr[$name])) - { - return; - } - - $space[2] = $this->copy_skip($this->token_blank); - switch ($this->char) { - case '"': - $node->_[HDOM_INFO_QUOTE][] = HDOM_QUOTE_DOUBLE; - $this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next - $node->attr[$name] = $this->restore_noise($this->copy_until_char_escape('"')); - $this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next - break; - case '\'': - $node->_[HDOM_INFO_QUOTE][] = HDOM_QUOTE_SINGLE; - $this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next - $node->attr[$name] = $this->restore_noise($this->copy_until_char_escape('\'')); - $this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next - break; - default: - $node->_[HDOM_INFO_QUOTE][] = HDOM_QUOTE_NO; - $node->attr[$name] = $this->restore_noise($this->copy_until($this->token_attr)); - } - // PaperG: Attributes should not have \r or \n in them, that counts as html whitespace. - $node->attr[$name] = str_replace("\r", "", $node->attr[$name]); - $node->attr[$name] = str_replace("\n", "", $node->attr[$name]); - // PaperG: If this is a "class" selector, lets get rid of the preceeding and trailing space since some people leave it in the multi class case. - if ($name == "class") { - $node->attr[$name] = trim($node->attr[$name]); - } - } - - // link node's parent - protected function link_nodes(&$node, $is_child) - { - $node->parent = $this->parent; - $this->parent->nodes[] = $node; - if ($is_child) - { - $this->parent->children[] = $node; - } - } - - // as a text node - protected function as_text_node($tag) - { - $node = new simple_html_dom_node($this); - ++$this->cursor; - $node->_[HDOM_INFO_TEXT] = '</' . $tag . '>'; - $this->link_nodes($node, false); - $this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next - return true; - } - - protected function skip($chars) - { - $this->pos += strspn($this->doc, $chars, $this->pos); - $this->char = ($this->pos<$this->size) ? $this->doc[$this->pos] : null; // next - } - - protected function copy_skip($chars) - { - $pos = $this->pos; - $len = strspn($this->doc, $chars, $pos); - $this->pos += $len; - $this->char = ($this->pos<$this->size) ? $this->doc[$this->pos] : null; // next - if ($len===0) return ''; - return substr($this->doc, $pos, $len); - } - - protected function copy_until($chars) - { - $pos = $this->pos; - $len = strcspn($this->doc, $chars, $pos); - $this->pos += $len; - $this->char = ($this->pos<$this->size) ? $this->doc[$this->pos] : null; // next - return substr($this->doc, $pos, $len); - } - - protected function copy_until_char($char) - { - if ($this->char===null) return ''; - - if (($pos = strpos($this->doc, $char, $this->pos))===false) { - $ret = substr($this->doc, $this->pos, $this->size-$this->pos); - $this->char = null; - $this->pos = $this->size; - return $ret; - } - - if ($pos===$this->pos) return ''; - $pos_old = $this->pos; - $this->char = $this->doc[$pos]; - $this->pos = $pos; - return substr($this->doc, $pos_old, $pos-$pos_old); - } - - protected function copy_until_char_escape($char) - { - if ($this->char===null) return ''; - - $start = $this->pos; - while (1) - { - if (($pos = strpos($this->doc, $char, $start))===false) - { - $ret = substr($this->doc, $this->pos, $this->size-$this->pos); - $this->char = null; - $this->pos = $this->size; - return $ret; - } - - if ($pos===$this->pos) return ''; - - if ($this->doc[$pos-1]==='\\') { - $start = $pos+1; - continue; - } - - $pos_old = $this->pos; - $this->char = $this->doc[$pos]; - $this->pos = $pos; - return substr($this->doc, $pos_old, $pos-$pos_old); - } - } - - // remove noise from html content - // save the noise in the $this->noise array. - protected function remove_noise($pattern, $remove_tag=false) - { - global $debug_object; - if (is_object($debug_object)) { $debug_object->debug_log_entry(1); } - - $count = preg_match_all($pattern, $this->doc, $matches, PREG_SET_ORDER|PREG_OFFSET_CAPTURE); - - for ($i=$count-1; $i>-1; --$i) - { - $key = '___noise___'.sprintf('% 5d', count($this->noise)+1000); - if (is_object($debug_object)) { $debug_object->debug_log(2, 'key is: ' . $key); } - $idx = ($remove_tag) ? 0 : 1; - $this->noise[$key] = $matches[$i][$idx][0]; - $this->doc = substr_replace($this->doc, $key, $matches[$i][$idx][1], strlen($matches[$i][$idx][0])); - } - - // reset the length of content - $this->size = strlen($this->doc); - if ($this->size>0) - { - $this->char = $this->doc[0]; - } - } - - // restore noise to html content - function restore_noise($text) - { - global $debug_object; - if (is_object($debug_object)) { $debug_object->debug_log_entry(1); } - - while (($pos=strpos($text, '___noise___'))!==false) - { - // Sometimes there is a broken piece of markup, and we don't GET the pos+11 etc... token which indicates a problem outside of us... - if (strlen($text) > $pos+15) - { - $key = '___noise___'.$text[$pos+11].$text[$pos+12].$text[$pos+13].$text[$pos+14].$text[$pos+15]; - if (is_object($debug_object)) { $debug_object->debug_log(2, 'located key of: ' . $key); } - - if (isset($this->noise[$key])) - { - $text = substr($text, 0, $pos).$this->noise[$key].substr($text, $pos+16); - } - else - { - // do this to prevent an infinite loop. - $text = substr($text, 0, $pos).'UNDEFINED NOISE FOR KEY: '.$key . substr($text, $pos+16); - } - } - else - { - // There is no valid key being given back to us... We must get rid of the ___noise___ or we will have a problem. - $text = substr($text, 0, $pos).'NO NUMERIC NOISE KEY' . substr($text, $pos+11); - } - } - return $text; - } - - // Sometimes we NEED one of the noise elements. - function search_noise($text) - { - global $debug_object; - if (is_object($debug_object)) { $debug_object->debug_log_entry(1); } - - foreach($this->noise as $noiseElement) - { - if (strpos($noiseElement, $text)!==false) - { - return $noiseElement; - } - } - } - function __toString() - { - return $this->root->innertext(); - } - - function __get($name) - { - switch ($name) - { - case 'outertext': - return $this->root->innertext(); - case 'innertext': - return $this->root->innertext(); - case 'plaintext': - return $this->root->text(); - case 'charset': - return $this->_charset; - case 'target_charset': - return $this->_target_charset; - } - } - - // camel naming conventions - function childNodes($idx=-1) {return $this->root->childNodes($idx);} - function firstChild() {return $this->root->first_child();} - function lastChild() {return $this->root->last_child();} - function createElement($name, $value=null) {return @str_get_html("<$name>$value</$name>")->first_child();} - function createTextNode($value) {return @end(str_get_html($value)->nodes);} - function getElementById($id) {return $this->find("#$id", 0);} - function getElementsById($id, $idx=null) {return $this->find("#$id", $idx);} - function getElementByTagName($name) {return $this->find($name, 0);} - function getElementsByTagName($name, $idx=-1) {return $this->find($name, $idx);} - function loadFile() {$args = func_get_args();$this->load_file($args);} -} - +<?php +/** + * Website: http://sourceforge.net/projects/simplehtmldom/ + * Additional projects that may be used: http://sourceforge.net/projects/debugobject/ + * Acknowledge: Jose Solorzano (https://sourceforge.net/projects/php-html/) + * Contributions by: + * Yousuke Kumakura (Attribute filters) + * Vadim Voituk (Negative indexes supports of "find" method) + * Antcs (Constructor with automatically load contents either text or file/url) + * + * all affected sections have comments starting with "PaperG" + * + * Paperg - Added case insensitive testing of the value of the selector. + * Paperg - Added tag_start for the starting index of tags - NOTE: This works but not accurately. + * This tag_start gets counted AFTER \r\n have been crushed out, and after the remove_noice calls so it will not reflect the REAL position of the tag in the source, + * it will almost always be smaller by some amount. + * We use this to determine how far into the file the tag in question is. This "percentage will never be accurate as the $dom->size is the "real" number of bytes the dom was created from. + * but for most purposes, it's a really good estimation. + * Paperg - Added the forceTagsClosed to the dom constructor. Forcing tags closed is great for malformed html, but it CAN lead to parsing errors. + * Allow the user to tell us how much they trust the html. + * Paperg add the text and plaintext to the selectors for the find syntax. plaintext implies text in the innertext of a node. text implies that the tag is a text node. + * This allows for us to find tags based on the text they contain. + * Create find_ancestor_tag to see if a tag is - at any level - inside of another specific tag. + * Paperg: added parse_charset so that we know about the character set of the source document. + * NOTE: If the user's system has a routine called get_last_retrieve_url_contents_content_type availalbe, we will assume it's returning the content-type header from the + * last transfer or curl_exec, and we will parse that and use it in preference to any other method of charset detection. + * + * Found infinite loop in the case of broken html in restore_noise. Rewrote to protect from that. + * PaperG (John Schlick) Added get_display_size for "IMG" tags. + * + * Licensed under The MIT License + * Redistributions of files must retain the above copyright notice. + * + * @author S.C. Chen <me578022@gmail.com> + * @author John Schlick + * @author Rus Carroll + * @version 1.5 ($Rev: 208 $) + * @package PlaceLocalInclude + * @subpackage simple_html_dom + */ + +/** + * All of the Defines for the classes below. + * @author S.C. Chen <me578022@gmail.com> + */ +define('HDOM_TYPE_ELEMENT', 1); +define('HDOM_TYPE_COMMENT', 2); +define('HDOM_TYPE_TEXT', 3); +define('HDOM_TYPE_ENDTAG', 4); +define('HDOM_TYPE_ROOT', 5); +define('HDOM_TYPE_UNKNOWN', 6); +define('HDOM_QUOTE_DOUBLE', 0); +define('HDOM_QUOTE_SINGLE', 1); +define('HDOM_QUOTE_NO', 3); +define('HDOM_INFO_BEGIN', 0); +define('HDOM_INFO_END', 1); +define('HDOM_INFO_QUOTE', 2); +define('HDOM_INFO_SPACE', 3); +define('HDOM_INFO_TEXT', 4); +define('HDOM_INFO_INNER', 5); +define('HDOM_INFO_OUTER', 6); +define('HDOM_INFO_ENDSPACE',7); +define('DEFAULT_TARGET_CHARSET', 'UTF-8'); +define('DEFAULT_BR_TEXT', "\r\n"); +define('DEFAULT_SPAN_TEXT', " "); +define('MAX_FILE_SIZE', 600000); +// helper functions +// ----------------------------------------------------------------------------- +// get html dom from file +// $maxlen is defined in the code as PHP_STREAM_COPY_ALL which is defined as -1. +function file_get_html($url, $use_include_path = false, $context=null, $offset = -1, $maxLen=-1, $lowercase = true, $forceTagsClosed=true, $target_charset = DEFAULT_TARGET_CHARSET, $stripRN=true, $defaultBRText=DEFAULT_BR_TEXT, $defaultSpanText=DEFAULT_SPAN_TEXT) +{ + // We DO force the tags to be terminated. + $dom = new simple_html_dom(null, $lowercase, $forceTagsClosed, $target_charset, $stripRN, $defaultBRText, $defaultSpanText); + // For sourceforge users: uncomment the next line and comment the retreive_url_contents line 2 lines down if it is not already done. + $contents = file_get_contents($url, $use_include_path, $context, $offset); + // Paperg - use our own mechanism for getting the contents as we want to control the timeout. + //$contents = retrieve_url_contents($url); + if (empty($contents) || strlen($contents) > MAX_FILE_SIZE) + { + return false; + } + // The second parameter can force the selectors to all be lowercase. + $dom->load($contents, $lowercase, $stripRN); + return $dom; +} + +// get html dom from string +function str_get_html($str, $lowercase=true, $forceTagsClosed=true, $target_charset = DEFAULT_TARGET_CHARSET, $stripRN=true, $defaultBRText=DEFAULT_BR_TEXT, $defaultSpanText=DEFAULT_SPAN_TEXT) +{ + $dom = new simple_html_dom(null, $lowercase, $forceTagsClosed, $target_charset, $stripRN, $defaultBRText, $defaultSpanText); + if (empty($str) || strlen($str) > MAX_FILE_SIZE) + { + $dom->clear(); + return false; + } + $dom->load($str, $lowercase, $stripRN); + return $dom; +} + +// dump html dom tree +function dump_html_tree($node, $show_attr=true, $deep=0) +{ + $node->dump($node); +} + + +/** + * simple html dom node + * PaperG - added ability for "find" routine to lowercase the value of the selector. + * PaperG - added $tag_start to track the start position of the tag in the total byte index + * + * @package PlaceLocalInclude + */ +class simple_html_dom_node +{ + public $nodetype = HDOM_TYPE_TEXT; + public $tag = 'text'; + public $attr = array(); + public $children = array(); + public $nodes = array(); + public $parent = null; + // The "info" array - see HDOM_INFO_... for what each element contains. + public $_ = array(); + public $tag_start = 0; + private $dom = null; + + function __construct($dom) + { + $this->dom = $dom; + $dom->nodes[] = $this; + } + + function __destruct() + { + $this->clear(); + } + + function __toString() + { + return $this->outertext(); + } + + // clean up memory due to php5 circular references memory leak... + function clear() + { + $this->dom = null; + $this->nodes = null; + $this->parent = null; + $this->children = null; + } + + // dump node's tree + function dump($show_attr=true, $deep=0) + { + $lead = str_repeat(' ', $deep); + + echo $lead.$this->tag; + if ($show_attr && count($this->attr)>0) + { + echo '('; + foreach ($this->attr as $k=>$v) + echo "[$k]=>\"".$this->$k.'", '; + echo ')'; + } + echo "\n"; + + if ($this->nodes) + { + foreach ($this->nodes as $c) + { + $c->dump($show_attr, $deep+1); + } + } + } + + + // Debugging function to dump a single dom node with a bunch of information about it. + function dump_node($echo=true) + { + + $string = $this->tag; + if (count($this->attr)>0) + { + $string .= '('; + foreach ($this->attr as $k=>$v) + { + $string .= "[$k]=>\"".$this->$k.'", '; + } + $string .= ')'; + } + if (count($this->_)>0) + { + $string .= ' $_ ('; + foreach ($this->_ as $k=>$v) + { + if (is_array($v)) + { + $string .= "[$k]=>("; + foreach ($v as $k2=>$v2) + { + $string .= "[$k2]=>\"".$v2.'", '; + } + $string .= ")"; + } else { + $string .= "[$k]=>\"".$v.'", '; + } + } + $string .= ")"; + } + + if (isset($this->text)) + { + $string .= " text: (" . $this->text . ")"; + } + + $string .= " HDOM_INNER_INFO: '"; + if (isset($node->_[HDOM_INFO_INNER])) + { + $string .= $node->_[HDOM_INFO_INNER] . "'"; + } + else + { + $string .= ' NULL '; + } + + $string .= " children: " . count($this->children); + $string .= " nodes: " . count($this->nodes); + $string .= " tag_start: " . $this->tag_start; + $string .= "\n"; + + if ($echo) + { + echo $string; + return; + } + else + { + return $string; + } + } + + // returns the parent of node + // If a node is passed in, it will reset the parent of the current node to that one. + function parent($parent=null) + { + // I am SURE that this doesn't work properly. + // It fails to unset the current node from it's current parents nodes or children list first. + if ($parent !== null) + { + $this->parent = $parent; + $this->parent->nodes[] = $this; + $this->parent->children[] = $this; + } + + return $this->parent; + } + + // verify that node has children + function has_child() + { + return !empty($this->children); + } + + // returns children of node + function children($idx=-1) + { + if ($idx===-1) + { + return $this->children; + } + if (isset($this->children[$idx])) + { + return $this->children[$idx]; + } + return null; + } + + // returns the first child of node + function first_child() + { + if (count($this->children)>0) + { + return $this->children[0]; + } + return null; + } + + // returns the last child of node + function last_child() + { + if (($count=count($this->children))>0) + { + return $this->children[$count-1]; + } + return null; + } + + // returns the next sibling of node + function next_sibling() + { + if ($this->parent===null) + { + return null; + } + + $idx = 0; + $count = count($this->parent->children); + while ($idx<$count && $this!==$this->parent->children[$idx]) + { + ++$idx; + } + if (++$idx>=$count) + { + return null; + } + return $this->parent->children[$idx]; + } + + // returns the previous sibling of node + function prev_sibling() + { + if ($this->parent===null) return null; + $idx = 0; + $count = count($this->parent->children); + while ($idx<$count && $this!==$this->parent->children[$idx]) + ++$idx; + if (--$idx<0) return null; + return $this->parent->children[$idx]; + } + + // function to locate a specific ancestor tag in the path to the root. + function find_ancestor_tag($tag) + { + global $debug_object; + if (is_object($debug_object)) { $debug_object->debug_log_entry(1); } + + // Start by including ourselves in the comparison. + $returnDom = $this; + + while (!is_null($returnDom)) + { + if (is_object($debug_object)) { $debug_object->debug_log(2, "Current tag is: " . $returnDom->tag); } + + if ($returnDom->tag == $tag) + { + break; + } + $returnDom = $returnDom->parent; + } + return $returnDom; + } + + // get dom node's inner html + function innertext() + { + if (isset($this->_[HDOM_INFO_INNER])) return $this->_[HDOM_INFO_INNER]; + if (isset($this->_[HDOM_INFO_TEXT])) return $this->dom->restore_noise($this->_[HDOM_INFO_TEXT]); + + $ret = ''; + foreach ($this->nodes as $n) + $ret .= $n->outertext(); + return $ret; + } + + // get dom node's outer text (with tag) + function outertext() + { + global $debug_object; + if (is_object($debug_object)) + { + $text = ''; + if ($this->tag == 'text') + { + if (!empty($this->text)) + { + $text = " with text: " . $this->text; + } + } + $debug_object->debug_log(1, 'Innertext of tag: ' . $this->tag . $text); + } + + if ($this->tag==='root') return $this->innertext(); + + // trigger callback + if ($this->dom && $this->dom->callback!==null) + { + call_user_func_array($this->dom->callback, array($this)); + } + + if (isset($this->_[HDOM_INFO_OUTER])) return $this->_[HDOM_INFO_OUTER]; + if (isset($this->_[HDOM_INFO_TEXT])) return $this->dom->restore_noise($this->_[HDOM_INFO_TEXT]); + + // render begin tag + if ($this->dom && $this->dom->nodes[$this->_[HDOM_INFO_BEGIN]]) + { + $ret = $this->dom->nodes[$this->_[HDOM_INFO_BEGIN]]->makeup(); + } else { + $ret = ""; + } + + // render inner text + if (isset($this->_[HDOM_INFO_INNER])) + { + // If it's a br tag... don't return the HDOM_INNER_INFO that we may or may not have added. + if ($this->tag != "br") + { + $ret .= $this->_[HDOM_INFO_INNER]; + } + } else { + if ($this->nodes) + { + foreach ($this->nodes as $n) + { + $ret .= $this->convert_text($n->outertext()); + } + } + } + + // render end tag + if (isset($this->_[HDOM_INFO_END]) && $this->_[HDOM_INFO_END]!=0) + $ret .= '</'.$this->tag.'>'; + return $ret; + } + + // get dom node's plain text + function text() + { + if (isset($this->_[HDOM_INFO_INNER])) return $this->_[HDOM_INFO_INNER]; + switch ($this->nodetype) + { + case HDOM_TYPE_TEXT: return $this->dom->restore_noise($this->_[HDOM_INFO_TEXT]); + case HDOM_TYPE_COMMENT: return ''; + case HDOM_TYPE_UNKNOWN: return ''; + } + if (strcasecmp($this->tag, 'script')===0) return ''; + if (strcasecmp($this->tag, 'style')===0) return ''; + + $ret = ''; + // In rare cases, (always node type 1 or HDOM_TYPE_ELEMENT - observed for some span tags, and some p tags) $this->nodes is set to NULL. + // NOTE: This indicates that there is a problem where it's set to NULL without a clear happening. + // WHY is this happening? + if (!is_null($this->nodes)) + { + foreach ($this->nodes as $n) + { + $ret .= $this->convert_text($n->text()); + } + + // If this node is a span... add a space at the end of it so multiple spans don't run into each other. This is plaintext after all. + if ($this->tag == "span") + { + $ret .= $this->dom->default_span_text; + } + + + } + return $ret; + } + + function xmltext() + { + $ret = $this->innertext(); + $ret = str_ireplace('<![CDATA[', '', $ret); + $ret = str_replace(']]>', '', $ret); + return $ret; + } + + // build node's text with tag + function makeup() + { + // text, comment, unknown + if (isset($this->_[HDOM_INFO_TEXT])) return $this->dom->restore_noise($this->_[HDOM_INFO_TEXT]); + + $ret = '<'.$this->tag; + $i = -1; + + foreach ($this->attr as $key=>$val) + { + ++$i; + + // skip removed attribute + if ($val===null || $val===false) + continue; + + $ret .= $this->_[HDOM_INFO_SPACE][$i][0]; + //no value attr: nowrap, checked selected... + if ($val===true) + $ret .= $key; + else { + switch ($this->_[HDOM_INFO_QUOTE][$i]) + { + case HDOM_QUOTE_DOUBLE: $quote = '"'; break; + case HDOM_QUOTE_SINGLE: $quote = '\''; break; + default: $quote = ''; + } + $ret .= $key.$this->_[HDOM_INFO_SPACE][$i][1].'='.$this->_[HDOM_INFO_SPACE][$i][2].$quote.$val.$quote; + } + } + $ret = $this->dom->restore_noise($ret); + return $ret . $this->_[HDOM_INFO_ENDSPACE] . '>'; + } + + // find elements by css selector + //PaperG - added ability for find to lowercase the value of the selector. + function find($selector, $idx=null, $lowercase=false) + { + $selectors = $this->parse_selector($selector); + if (($count=count($selectors))===0) return array(); + $found_keys = array(); + + // find each selector + for ($c=0; $c<$count; ++$c) + { + // The change on the below line was documented on the sourceforge code tracker id 2788009 + // used to be: if (($levle=count($selectors[0]))===0) return array(); + if (($levle=count($selectors[$c]))===0) return array(); + if (!isset($this->_[HDOM_INFO_BEGIN])) return array(); + + $head = array($this->_[HDOM_INFO_BEGIN]=>1); + + // handle descendant selectors, no recursive! + for ($l=0; $l<$levle; ++$l) + { + $ret = array(); + foreach ($head as $k=>$v) + { + $n = ($k===-1) ? $this->dom->root : $this->dom->nodes[$k]; + //PaperG - Pass this optional parameter on to the seek function. + $n->seek($selectors[$c][$l], $ret, $lowercase); + } + $head = $ret; + } + + foreach ($head as $k=>$v) + { + if (!isset($found_keys[$k])) + { + $found_keys[$k] = 1; + } + } + } + + // sort keys + ksort($found_keys); + + $found = array(); + foreach ($found_keys as $k=>$v) + $found[] = $this->dom->nodes[$k]; + + // return nth-element or array + if (is_null($idx)) return $found; + else if ($idx<0) $idx = count($found) + $idx; + return (isset($found[$idx])) ? $found[$idx] : null; + } + + // seek for given conditions + // PaperG - added parameter to allow for case insensitive testing of the value of a selector. + protected function seek($selector, &$ret, $lowercase=false) + { + global $debug_object; + if (is_object($debug_object)) { $debug_object->debug_log_entry(1); } + + list($tag, $key, $val, $exp, $no_key) = $selector; + + // xpath index + if ($tag && $key && is_numeric($key)) + { + $count = 0; + foreach ($this->children as $c) + { + if ($tag==='*' || $tag===$c->tag) { + if (++$count==$key) { + $ret[$c->_[HDOM_INFO_BEGIN]] = 1; + return; + } + } + } + return; + } + + $end = (!empty($this->_[HDOM_INFO_END])) ? $this->_[HDOM_INFO_END] : 0; + if ($end==0) { + $parent = $this->parent; + while (!isset($parent->_[HDOM_INFO_END]) && $parent!==null) { + $end -= 1; + $parent = $parent->parent; + } + $end += $parent->_[HDOM_INFO_END]; + } + + for ($i=$this->_[HDOM_INFO_BEGIN]+1; $i<$end; ++$i) { + $node = $this->dom->nodes[$i]; + + $pass = true; + + if ($tag==='*' && !$key) { + if (in_array($node, $this->children, true)) + $ret[$i] = 1; + continue; + } + + // compare tag + if ($tag && $tag!=$node->tag && $tag!=='*') {$pass=false;} + // compare key + if ($pass && $key) { + if ($no_key) { + if (isset($node->attr[$key])) $pass=false; + } else { + if (($key != "plaintext") && !isset($node->attr[$key])) $pass=false; + } + } + // compare value + if ($pass && $key && $val && $val!=='*') { + // If they have told us that this is a "plaintext" search then we want the plaintext of the node - right? + if ($key == "plaintext") { + // $node->plaintext actually returns $node->text(); + $nodeKeyValue = $node->text(); + } else { + // this is a normal search, we want the value of that attribute of the tag. + $nodeKeyValue = $node->attr[$key]; + } + if (is_object($debug_object)) {$debug_object->debug_log(2, "testing node: " . $node->tag . " for attribute: " . $key . $exp . $val . " where nodes value is: " . $nodeKeyValue);} + + //PaperG - If lowercase is set, do a case insensitive test of the value of the selector. + if ($lowercase) { + $check = $this->match($exp, strtolower($val), strtolower($nodeKeyValue)); + } else { + $check = $this->match($exp, $val, $nodeKeyValue); + } + if (is_object($debug_object)) {$debug_object->debug_log(2, "after match: " . ($check ? "true" : "false"));} + + // handle multiple class + if (!$check && strcasecmp($key, 'class')===0) { + foreach (explode(' ',$node->attr[$key]) as $k) { + // Without this, there were cases where leading, trailing, or double spaces lead to our comparing blanks - bad form. + if (!empty($k)) { + if ($lowercase) { + $check = $this->match($exp, strtolower($val), strtolower($k)); + } else { + $check = $this->match($exp, $val, $k); + } + if ($check) break; + } + } + } + if (!$check) $pass = false; + } + if ($pass) $ret[$i] = 1; + unset($node); + } + // It's passed by reference so this is actually what this function returns. + if (is_object($debug_object)) {$debug_object->debug_log(1, "EXIT - ret: ", $ret);} + } + + protected function match($exp, $pattern, $value) { + global $debug_object; + if (is_object($debug_object)) {$debug_object->debug_log_entry(1);} + + switch ($exp) { + case '=': + return ($value===$pattern); + case '!=': + return ($value!==$pattern); + case '^=': + return preg_match("/^".preg_quote($pattern,'/')."/", $value); + case '$=': + return preg_match("/".preg_quote($pattern,'/')."$/", $value); + case '*=': + if ($pattern[0]=='/') { + return preg_match($pattern, $value); + } + return preg_match("/".$pattern."/i", $value); + } + return false; + } + + protected function parse_selector($selector_string) { + global $debug_object; + if (is_object($debug_object)) {$debug_object->debug_log_entry(1);} + + // pattern of CSS selectors, modified from mootools + // Paperg: Add the colon to the attrbute, so that it properly finds <tag attr:ibute="something" > like google does. + // Note: if you try to look at this attribute, yo MUST use getAttribute since $dom->x:y will fail the php syntax check. +// Notice the \[ starting the attbute? and the @? following? This implies that an attribute can begin with an @ sign that is not captured. +// This implies that an html attribute specifier may start with an @ sign that is NOT captured by the expression. +// farther study is required to determine of this should be documented or removed. +// $pattern = "/([\w-:\*]*)(?:\#([\w-]+)|\.([\w-]+))?(?:\[@?(!?[\w-]+)(?:([!*^$]?=)[\"']?(.*?)[\"']?)?\])?([\/, ]+)/is"; + $pattern = "/([\w-:\*]*)(?:\#([\w-]+)|\.([\w-]+))?(?:\[@?(!?[\w-:]+)(?:([!*^$]?=)[\"']?(.*?)[\"']?)?\])?([\/, ]+)/is"; + preg_match_all($pattern, trim($selector_string).' ', $matches, PREG_SET_ORDER); + if (is_object($debug_object)) {$debug_object->debug_log(2, "Matches Array: ", $matches);} + + $selectors = array(); + $result = array(); + //print_r($matches); + + foreach ($matches as $m) { + $m[0] = trim($m[0]); + if ($m[0]==='' || $m[0]==='/' || $m[0]==='//') continue; + // for browser generated xpath + if ($m[1]==='tbody') continue; + + list($tag, $key, $val, $exp, $no_key) = array($m[1], null, null, '=', false); + if (!empty($m[2])) {$key='id'; $val=$m[2];} + if (!empty($m[3])) {$key='class'; $val=$m[3];} + if (!empty($m[4])) {$key=$m[4];} + if (!empty($m[5])) {$exp=$m[5];} + if (!empty($m[6])) {$val=$m[6];} + + // convert to lowercase + if ($this->dom->lowercase) {$tag=strtolower($tag); $key=strtolower($key);} + //elements that do NOT have the specified attribute + if (isset($key[0]) && $key[0]==='!') {$key=substr($key, 1); $no_key=true;} + + $result[] = array($tag, $key, $val, $exp, $no_key); + if (trim($m[7])===',') { + $selectors[] = $result; + $result = array(); + } + } + if (count($result)>0) + $selectors[] = $result; + return $selectors; + } + + function __get($name) + { + if (isset($this->attr[$name])) + { + return $this->convert_text($this->attr[$name]); + } + switch ($name) + { + case 'outertext': return $this->outertext(); + case 'innertext': return $this->innertext(); + case 'plaintext': return $this->text(); + case 'xmltext': return $this->xmltext(); + default: return array_key_exists($name, $this->attr); + } + } + + function __set($name, $value) + { + global $debug_object; + if (is_object($debug_object)) {$debug_object->debug_log_entry(1);} + + switch ($name) + { + case 'outertext': return $this->_[HDOM_INFO_OUTER] = $value; + case 'innertext': + if (isset($this->_[HDOM_INFO_TEXT])) return $this->_[HDOM_INFO_TEXT] = $value; + return $this->_[HDOM_INFO_INNER] = $value; + } + if (!isset($this->attr[$name])) + { + $this->_[HDOM_INFO_SPACE][] = array(' ', '', ''); + $this->_[HDOM_INFO_QUOTE][] = HDOM_QUOTE_DOUBLE; + } + $this->attr[$name] = $value; + } + + function __isset($name) + { + switch ($name) + { + case 'outertext': return true; + case 'innertext': return true; + case 'plaintext': return true; + } + //no value attr: nowrap, checked selected... + return (array_key_exists($name, $this->attr)) ? true : isset($this->attr[$name]); + } + + function __unset($name) { + if (isset($this->attr[$name])) + unset($this->attr[$name]); + } + + // PaperG - Function to convert the text from one character set to another if the two sets are not the same. + function convert_text($text) + { + global $debug_object; + if (is_object($debug_object)) {$debug_object->debug_log_entry(1);} + + $converted_text = $text; + + $sourceCharset = ""; + $targetCharset = ""; + + if ($this->dom) + { + $sourceCharset = strtoupper($this->dom->_charset); + $targetCharset = strtoupper($this->dom->_target_charset); + } + if (is_object($debug_object)) {$debug_object->debug_log(3, "source charset: " . $sourceCharset . " target charaset: " . $targetCharset);} + + if (!empty($sourceCharset) && !empty($targetCharset) && (strcasecmp($sourceCharset, $targetCharset) != 0)) + { + // Check if the reported encoding could have been incorrect and the text is actually already UTF-8 + if ((strcasecmp($targetCharset, 'UTF-8') == 0) && ($this->is_utf8($text))) + { + $converted_text = $text; + } + else + { + $converted_text = iconv($sourceCharset, $targetCharset, $text); + } + } + + // Lets make sure that we don't have that silly BOM issue with any of the utf-8 text we output. + if ($targetCharset == 'UTF-8') + { + if (substr($converted_text, 0, 3) == "\xef\xbb\xbf") + { + $converted_text = substr($converted_text, 3); + } + if (substr($converted_text, -3) == "\xef\xbb\xbf") + { + $converted_text = substr($converted_text, 0, -3); + } + } + + return $converted_text; + } + + /** + * Returns true if $string is valid UTF-8 and false otherwise. + * + * @param mixed $str String to be tested + * @return boolean + */ + static function is_utf8($str) + { + $c=0; $b=0; + $bits=0; + $len=strlen($str); + for($i=0; $i<$len; $i++) + { + $c=ord($str[$i]); + if($c > 128) + { + if(($c >= 254)) return false; + elseif($c >= 252) $bits=6; + elseif($c >= 248) $bits=5; + elseif($c >= 240) $bits=4; + elseif($c >= 224) $bits=3; + elseif($c >= 192) $bits=2; + else return false; + if(($i+$bits) > $len) return false; + while($bits > 1) + { + $i++; + $b=ord($str[$i]); + if($b < 128 || $b > 191) return false; + $bits--; + } + } + } + return true; + } + /* + function is_utf8($string) + { + //this is buggy + return (utf8_encode(utf8_decode($string)) == $string); + } + */ + + /** + * Function to try a few tricks to determine the displayed size of an img on the page. + * NOTE: This will ONLY work on an IMG tag. Returns FALSE on all other tag types. + * + * @author John Schlick + * @version April 19 2012 + * @return array an array containing the 'height' and 'width' of the image on the page or -1 if we can't figure it out. + */ + function get_display_size() + { + global $debug_object; + + $width = -1; + $height = -1; + + if ($this->tag !== 'img') + { + return false; + } + + // See if there is aheight or width attribute in the tag itself. + if (isset($this->attr['width'])) + { + $width = $this->attr['width']; + } + + if (isset($this->attr['height'])) + { + $height = $this->attr['height']; + } + + // Now look for an inline style. + if (isset($this->attr['style'])) + { + // Thanks to user gnarf from stackoverflow for this regular expression. + $attributes = array(); + preg_match_all("/([\w-]+)\s*:\s*([^;]+)\s*;?/", $this->attr['style'], $matches, PREG_SET_ORDER); + foreach ($matches as $match) { + $attributes[$match[1]] = $match[2]; + } + + // If there is a width in the style attributes: + if (isset($attributes['width']) && $width == -1) + { + // check that the last two characters are px (pixels) + if (strtolower(substr($attributes['width'], -2)) == 'px') + { + $proposed_width = substr($attributes['width'], 0, -2); + // Now make sure that it's an integer and not something stupid. + if (filter_var($proposed_width, FILTER_VALIDATE_INT)) + { + $width = $proposed_width; + } + } + } + + // If there is a width in the style attributes: + if (isset($attributes['height']) && $height == -1) + { + // check that the last two characters are px (pixels) + if (strtolower(substr($attributes['height'], -2)) == 'px') + { + $proposed_height = substr($attributes['height'], 0, -2); + // Now make sure that it's an integer and not something stupid. + if (filter_var($proposed_height, FILTER_VALIDATE_INT)) + { + $height = $proposed_height; + } + } + } + + } + + // Future enhancement: + // Look in the tag to see if there is a class or id specified that has a height or width attribute to it. + + // Far future enhancement + // Look at all the parent tags of this image to see if they specify a class or id that has an img selector that specifies a height or width + // Note that in this case, the class or id will have the img subselector for it to apply to the image. + + // ridiculously far future development + // If the class or id is specified in a SEPARATE css file thats not on the page, go get it and do what we were just doing for the ones on the page. + + $result = array('height' => $height, + 'width' => $width); + return $result; + } + + // camel naming conventions + function getAllAttributes() {return $this->attr;} + function getAttribute($name) {return $this->__get($name);} + function setAttribute($name, $value) {$this->__set($name, $value);} + function hasAttribute($name) {return $this->__isset($name);} + function removeAttribute($name) {$this->__set($name, null);} + function getElementById($id) {return $this->find("#$id", 0);} + function getElementsById($id, $idx=null) {return $this->find("#$id", $idx);} + function getElementByTagName($name) {return $this->find($name, 0);} + function getElementsByTagName($name, $idx=null) {return $this->find($name, $idx);} + function parentNode() {return $this->parent();} + function childNodes($idx=-1) {return $this->children($idx);} + function firstChild() {return $this->first_child();} + function lastChild() {return $this->last_child();} + function nextSibling() {return $this->next_sibling();} + function previousSibling() {return $this->prev_sibling();} + function hasChildNodes() {return $this->has_child();} + function nodeName() {return $this->tag;} + function appendChild($node) {$node->parent($this); return $node;} + +} + +/** + * simple html dom parser + * Paperg - in the find routine: allow us to specify that we want case insensitive testing of the value of the selector. + * Paperg - change $size from protected to public so we can easily access it + * Paperg - added ForceTagsClosed in the constructor which tells us whether we trust the html or not. Default is to NOT trust it. + * + * @package PlaceLocalInclude + */ +class simple_html_dom +{ + public $root = null; + public $nodes = array(); + public $callback = null; + public $lowercase = false; + // Used to keep track of how large the text was when we started. + public $original_size; + public $size; + protected $pos; + protected $doc; + protected $char; + protected $cursor; + protected $parent; + protected $noise = array(); + protected $token_blank = " \t\r\n"; + protected $token_equal = ' =/>'; + protected $token_slash = " />\r\n\t"; + protected $token_attr = ' >'; + // Note that this is referenced by a child node, and so it needs to be public for that node to see this information. + public $_charset = ''; + public $_target_charset = ''; + protected $default_br_text = ""; + public $default_span_text = ""; + + // use isset instead of in_array, performance boost about 30%... + protected $self_closing_tags = array('img'=>1, 'br'=>1, 'input'=>1, 'meta'=>1, 'link'=>1, 'hr'=>1, 'base'=>1, 'embed'=>1, 'spacer'=>1); + protected $block_tags = array('root'=>1, 'body'=>1, 'form'=>1, 'div'=>1, 'span'=>1, 'table'=>1); + // Known sourceforge issue #2977341 + // B tags that are not closed cause us to return everything to the end of the document. + protected $optional_closing_tags = array( + 'tr'=>array('tr'=>1, 'td'=>1, 'th'=>1), + 'th'=>array('th'=>1), + 'td'=>array('td'=>1), + 'li'=>array('li'=>1), + 'dt'=>array('dt'=>1, 'dd'=>1), + 'dd'=>array('dd'=>1, 'dt'=>1), + 'dl'=>array('dd'=>1, 'dt'=>1), + 'p'=>array('p'=>1), + 'nobr'=>array('nobr'=>1), + 'b'=>array('b'=>1), + 'option'=>array('option'=>1), + ); + + function __construct($str=null, $lowercase=true, $forceTagsClosed=true, $target_charset=DEFAULT_TARGET_CHARSET, $stripRN=true, $defaultBRText=DEFAULT_BR_TEXT, $defaultSpanText=DEFAULT_SPAN_TEXT) + { + if ($str) + { + if (preg_match("/^http:\/\//i",$str) || is_file($str)) + { + $this->load_file($str); + } + else + { + $this->load($str, $lowercase, $stripRN, $defaultBRText, $defaultSpanText); + } + } + // Forcing tags to be closed implies that we don't trust the html, but it can lead to parsing errors if we SHOULD trust the html. + if (!$forceTagsClosed) { + $this->optional_closing_array=array(); + } + $this->_target_charset = $target_charset; + } + + function __destruct() + { + $this->clear(); + } + + // load html from string + function load($str, $lowercase=true, $stripRN=true, $defaultBRText=DEFAULT_BR_TEXT, $defaultSpanText=DEFAULT_SPAN_TEXT) + { + global $debug_object; + + // prepare + $this->prepare($str, $lowercase, $stripRN, $defaultBRText, $defaultSpanText); + // strip out cdata + $this->remove_noise("'<!\[CDATA\[(.*?)\]\]>'is", true); + // strip out comments + $this->remove_noise("'<!--(.*?)-->'is"); + // Per sourceforge http://sourceforge.net/tracker/?func=detail&aid=2949097&group_id=218559&atid=1044037 + // Script tags removal now preceeds style tag removal. + // strip out <script> tags + $this->remove_noise("'<\s*script[^>]*[^/]>(.*?)<\s*/\s*script\s*>'is"); + $this->remove_noise("'<\s*script\s*>(.*?)<\s*/\s*script\s*>'is"); + // strip out <style> tags + $this->remove_noise("'<\s*style[^>]*[^/]>(.*?)<\s*/\s*style\s*>'is"); + $this->remove_noise("'<\s*style\s*>(.*?)<\s*/\s*style\s*>'is"); + // strip out preformatted tags + $this->remove_noise("'<\s*(?:code)[^>]*>(.*?)<\s*/\s*(?:code)\s*>'is"); + // strip out server side scripts + $this->remove_noise("'(<\?)(.*?)(\?>)'s", true); + // strip smarty scripts + $this->remove_noise("'(\{\w)(.*?)(\})'s", true); + + // parsing + while ($this->parse()); + // end + $this->root->_[HDOM_INFO_END] = $this->cursor; + $this->parse_charset(); + + // make load function chainable + return $this; + + } + + // load html from file + function load_file() + { + $args = func_get_args(); + $this->load(call_user_func_array('file_get_contents', $args), true); + // Throw an error if we can't properly load the dom. + if (($error=error_get_last())!==null) { + $this->clear(); + return false; + } + } + + // set callback function + function set_callback($function_name) + { + $this->callback = $function_name; + } + + // remove callback function + function remove_callback() + { + $this->callback = null; + } + + // save dom as string + function save($filepath='') + { + $ret = $this->root->innertext(); + if ($filepath!=='') file_put_contents($filepath, $ret, LOCK_EX); + return $ret; + } + + // find dom node by css selector + // Paperg - allow us to specify that we want case insensitive testing of the value of the selector. + function find($selector, $idx=null, $lowercase=false) + { + return $this->root->find($selector, $idx, $lowercase); + } + + // clean up memory due to php5 circular references memory leak... + function clear() + { + foreach ($this->nodes as $n) {$n->clear(); $n = null;} + // This add next line is documented in the sourceforge repository. 2977248 as a fix for ongoing memory leaks that occur even with the use of clear. + if (isset($this->children)) foreach ($this->children as $n) {$n->clear(); $n = null;} + if (isset($this->parent)) {$this->parent->clear(); unset($this->parent);} + if (isset($this->root)) {$this->root->clear(); unset($this->root);} + unset($this->doc); + unset($this->noise); + } + + function dump($show_attr=true) + { + $this->root->dump($show_attr); + } + + // prepare HTML data and init everything + protected function prepare($str, $lowercase=true, $stripRN=true, $defaultBRText=DEFAULT_BR_TEXT, $defaultSpanText=DEFAULT_SPAN_TEXT) + { + $this->clear(); + + // set the length of content before we do anything to it. + $this->size = strlen($str); + // Save the original size of the html that we got in. It might be useful to someone. + $this->original_size = $this->size; + + //before we save the string as the doc... strip out the \r \n's if we are told to. + if ($stripRN) { + $str = str_replace("\r", " ", $str); + $str = str_replace("\n", " ", $str); + + // set the length of content since we have changed it. + $this->size = strlen($str); + } + + $this->doc = $str; + $this->pos = 0; + $this->cursor = 1; + $this->noise = array(); + $this->nodes = array(); + $this->lowercase = $lowercase; + $this->default_br_text = $defaultBRText; + $this->default_span_text = $defaultSpanText; + $this->root = new simple_html_dom_node($this); + $this->root->tag = 'root'; + $this->root->_[HDOM_INFO_BEGIN] = -1; + $this->root->nodetype = HDOM_TYPE_ROOT; + $this->parent = $this->root; + if ($this->size>0) $this->char = $this->doc[0]; + } + + // parse html content + protected function parse() + { + if (($s = $this->copy_until_char('<'))==='') + { + return $this->read_tag(); + } + + // text + $node = new simple_html_dom_node($this); + ++$this->cursor; + $node->_[HDOM_INFO_TEXT] = $s; + $this->link_nodes($node, false); + return true; + } + + // PAPERG - dkchou - added this to try to identify the character set of the page we have just parsed so we know better how to spit it out later. + // NOTE: IF you provide a routine called get_last_retrieve_url_contents_content_type which returns the CURLINFO_CONTENT_TYPE from the last curl_exec + // (or the content_type header from the last transfer), we will parse THAT, and if a charset is specified, we will use it over any other mechanism. + protected function parse_charset() + { + global $debug_object; + + $charset = null; + + if (function_exists('get_last_retrieve_url_contents_content_type')) + { + $contentTypeHeader = get_last_retrieve_url_contents_content_type(); + $success = preg_match('/charset=(.+)/', $contentTypeHeader, $matches); + if ($success) + { + $charset = $matches[1]; + if (is_object($debug_object)) {$debug_object->debug_log(2, 'header content-type found charset of: ' . $charset);} + } + + } + + if (empty($charset)) + { + $el = $this->root->find('meta[http-equiv=Content-Type]',0); + if (!empty($el)) + { + $fullvalue = $el->content; + if (is_object($debug_object)) {$debug_object->debug_log(2, 'meta content-type tag found' . $fullvalue);} + + if (!empty($fullvalue)) + { + $success = preg_match('/charset=(.+)/', $fullvalue, $matches); + if ($success) + { + $charset = $matches[1]; + } + else + { + // If there is a meta tag, and they don't specify the character set, research says that it's typically ISO-8859-1 + if (is_object($debug_object)) {$debug_object->debug_log(2, 'meta content-type tag couldn\'t be parsed. using iso-8859 default.');} + $charset = 'ISO-8859-1'; + } + } + } + } + + // If we couldn't find a charset above, then lets try to detect one based on the text we got... + if (empty($charset)) + { + // Use this in case mb_detect_charset isn't installed/loaded on this machine. + $charset = false; + if (function_exists('mb_detect_encoding')) + { + // Have php try to detect the encoding from the text given to us. + $charset = mb_detect_encoding($this->root->plaintext . "ascii", $encoding_list = array( "UTF-8", "CP1252" ) ); + if (is_object($debug_object)) {$debug_object->debug_log(2, 'mb_detect found: ' . $charset);} + } + + // and if this doesn't work... then we need to just wrongheadedly assume it's UTF-8 so that we can move on - cause this will usually give us most of what we need... + if ($charset === false) + { + if (is_object($debug_object)) {$debug_object->debug_log(2, 'since mb_detect failed - using default of utf-8');} + $charset = 'UTF-8'; + } + } + + // Since CP1252 is a superset, if we get one of it's subsets, we want it instead. + if ((strtolower($charset) == strtolower('ISO-8859-1')) || (strtolower($charset) == strtolower('Latin1')) || (strtolower($charset) == strtolower('Latin-1'))) + { + if (is_object($debug_object)) {$debug_object->debug_log(2, 'replacing ' . $charset . ' with CP1252 as its a superset');} + $charset = 'CP1252'; + } + + if (is_object($debug_object)) {$debug_object->debug_log(1, 'EXIT - ' . $charset);} + + return $this->_charset = $charset; + } + + // read tag info + protected function read_tag() + { + if ($this->char!=='<') + { + $this->root->_[HDOM_INFO_END] = $this->cursor; + return false; + } + $begin_tag_pos = $this->pos; + $this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next + + // end tag + if ($this->char==='/') + { + $this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next + // This represents the change in the simple_html_dom trunk from revision 180 to 181. + // $this->skip($this->token_blank_t); + $this->skip($this->token_blank); + $tag = $this->copy_until_char('>'); + + // skip attributes in end tag + if (($pos = strpos($tag, ' '))!==false) + $tag = substr($tag, 0, $pos); + + $parent_lower = strtolower($this->parent->tag); + $tag_lower = strtolower($tag); + + if ($parent_lower!==$tag_lower) + { + if (isset($this->optional_closing_tags[$parent_lower]) && isset($this->block_tags[$tag_lower])) + { + $this->parent->_[HDOM_INFO_END] = 0; + $org_parent = $this->parent; + + while (($this->parent->parent) && strtolower($this->parent->tag)!==$tag_lower) + $this->parent = $this->parent->parent; + + if (strtolower($this->parent->tag)!==$tag_lower) { + $this->parent = $org_parent; // restore origonal parent + if ($this->parent->parent) $this->parent = $this->parent->parent; + $this->parent->_[HDOM_INFO_END] = $this->cursor; + return $this->as_text_node($tag); + } + } + else if (($this->parent->parent) && isset($this->block_tags[$tag_lower])) + { + $this->parent->_[HDOM_INFO_END] = 0; + $org_parent = $this->parent; + + while (($this->parent->parent) && strtolower($this->parent->tag)!==$tag_lower) + $this->parent = $this->parent->parent; + + if (strtolower($this->parent->tag)!==$tag_lower) + { + $this->parent = $org_parent; // restore origonal parent + $this->parent->_[HDOM_INFO_END] = $this->cursor; + return $this->as_text_node($tag); + } + } + else if (($this->parent->parent) && strtolower($this->parent->parent->tag)===$tag_lower) + { + $this->parent->_[HDOM_INFO_END] = 0; + $this->parent = $this->parent->parent; + } + else + return $this->as_text_node($tag); + } + + $this->parent->_[HDOM_INFO_END] = $this->cursor; + if ($this->parent->parent) $this->parent = $this->parent->parent; + + $this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next + return true; + } + + $node = new simple_html_dom_node($this); + $node->_[HDOM_INFO_BEGIN] = $this->cursor; + ++$this->cursor; + $tag = $this->copy_until($this->token_slash); + $node->tag_start = $begin_tag_pos; + + // doctype, cdata & comments... + if (isset($tag[0]) && $tag[0]==='!') { + $node->_[HDOM_INFO_TEXT] = '<' . $tag . $this->copy_until_char('>'); + + if (isset($tag[2]) && $tag[1]==='-' && $tag[2]==='-') { + $node->nodetype = HDOM_TYPE_COMMENT; + $node->tag = 'comment'; + } else { + $node->nodetype = HDOM_TYPE_UNKNOWN; + $node->tag = 'unknown'; + } + if ($this->char==='>') $node->_[HDOM_INFO_TEXT].='>'; + $this->link_nodes($node, true); + $this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next + return true; + } + + // text + if ($pos=strpos($tag, '<')!==false) { + $tag = '<' . substr($tag, 0, -1); + $node->_[HDOM_INFO_TEXT] = $tag; + $this->link_nodes($node, false); + $this->char = $this->doc[--$this->pos]; // prev + return true; + } + + if (!preg_match("/^[\w-:]+$/", $tag)) { + $node->_[HDOM_INFO_TEXT] = '<' . $tag . $this->copy_until('<>'); + if ($this->char==='<') { + $this->link_nodes($node, false); + return true; + } + + if ($this->char==='>') $node->_[HDOM_INFO_TEXT].='>'; + $this->link_nodes($node, false); + $this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next + return true; + } + + // begin tag + $node->nodetype = HDOM_TYPE_ELEMENT; + $tag_lower = strtolower($tag); + $node->tag = ($this->lowercase) ? $tag_lower : $tag; + + // handle optional closing tags + if (isset($this->optional_closing_tags[$tag_lower]) ) + { + while (isset($this->optional_closing_tags[$tag_lower][strtolower($this->parent->tag)])) + { + $this->parent->_[HDOM_INFO_END] = 0; + $this->parent = $this->parent->parent; + } + $node->parent = $this->parent; + } + + $guard = 0; // prevent infinity loop + $space = array($this->copy_skip($this->token_blank), '', ''); + + // attributes + do + { + if ($this->char!==null && $space[0]==='') + { + break; + } + $name = $this->copy_until($this->token_equal); + if ($guard===$this->pos) + { + $this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next + continue; + } + $guard = $this->pos; + + // handle endless '<' + if ($this->pos>=$this->size-1 && $this->char!=='>') { + $node->nodetype = HDOM_TYPE_TEXT; + $node->_[HDOM_INFO_END] = 0; + $node->_[HDOM_INFO_TEXT] = '<'.$tag . $space[0] . $name; + $node->tag = 'text'; + $this->link_nodes($node, false); + return true; + } + + // handle mismatch '<' + if ($this->doc[$this->pos-1]=='<') { + $node->nodetype = HDOM_TYPE_TEXT; + $node->tag = 'text'; + $node->attr = array(); + $node->_[HDOM_INFO_END] = 0; + $node->_[HDOM_INFO_TEXT] = substr($this->doc, $begin_tag_pos, $this->pos-$begin_tag_pos-1); + $this->pos -= 2; + $this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next + $this->link_nodes($node, false); + return true; + } + + if ($name!=='/' && $name!=='') { + $space[1] = $this->copy_skip($this->token_blank); + $name = $this->restore_noise($name); + if ($this->lowercase) $name = strtolower($name); + if ($this->char==='=') { + $this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next + $this->parse_attr($node, $name, $space); + } + else { + //no value attr: nowrap, checked selected... + $node->_[HDOM_INFO_QUOTE][] = HDOM_QUOTE_NO; + $node->attr[$name] = true; + if ($this->char!='>') $this->char = $this->doc[--$this->pos]; // prev + } + $node->_[HDOM_INFO_SPACE][] = $space; + $space = array($this->copy_skip($this->token_blank), '', ''); + } + else + break; + } while ($this->char!=='>' && $this->char!=='/'); + + $this->link_nodes($node, true); + $node->_[HDOM_INFO_ENDSPACE] = $space[0]; + + // check self closing + if ($this->copy_until_char_escape('>')==='/') + { + $node->_[HDOM_INFO_ENDSPACE] .= '/'; + $node->_[HDOM_INFO_END] = 0; + } + else + { + // reset parent + if (!isset($this->self_closing_tags[strtolower($node->tag)])) $this->parent = $node; + } + $this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next + + // If it's a BR tag, we need to set it's text to the default text. + // This way when we see it in plaintext, we can generate formatting that the user wants. + // since a br tag never has sub nodes, this works well. + if ($node->tag == "br") + { + $node->_[HDOM_INFO_INNER] = $this->default_br_text; + } + + return true; + } + + // parse attributes + protected function parse_attr($node, $name, &$space) + { + // Per sourceforge: http://sourceforge.net/tracker/?func=detail&aid=3061408&group_id=218559&atid=1044037 + // If the attribute is already defined inside a tag, only pay atetntion to the first one as opposed to the last one. + if (isset($node->attr[$name])) + { + return; + } + + $space[2] = $this->copy_skip($this->token_blank); + switch ($this->char) { + case '"': + $node->_[HDOM_INFO_QUOTE][] = HDOM_QUOTE_DOUBLE; + $this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next + $node->attr[$name] = $this->restore_noise($this->copy_until_char_escape('"')); + $this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next + break; + case '\'': + $node->_[HDOM_INFO_QUOTE][] = HDOM_QUOTE_SINGLE; + $this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next + $node->attr[$name] = $this->restore_noise($this->copy_until_char_escape('\'')); + $this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next + break; + default: + $node->_[HDOM_INFO_QUOTE][] = HDOM_QUOTE_NO; + $node->attr[$name] = $this->restore_noise($this->copy_until($this->token_attr)); + } + // PaperG: Attributes should not have \r or \n in them, that counts as html whitespace. + $node->attr[$name] = str_replace("\r", "", $node->attr[$name]); + $node->attr[$name] = str_replace("\n", "", $node->attr[$name]); + // PaperG: If this is a "class" selector, lets get rid of the preceeding and trailing space since some people leave it in the multi class case. + if ($name == "class") { + $node->attr[$name] = trim($node->attr[$name]); + } + } + + // link node's parent + protected function link_nodes(&$node, $is_child) + { + $node->parent = $this->parent; + $this->parent->nodes[] = $node; + if ($is_child) + { + $this->parent->children[] = $node; + } + } + + // as a text node + protected function as_text_node($tag) + { + $node = new simple_html_dom_node($this); + ++$this->cursor; + $node->_[HDOM_INFO_TEXT] = '</' . $tag . '>'; + $this->link_nodes($node, false); + $this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next + return true; + } + + protected function skip($chars) + { + $this->pos += strspn($this->doc, $chars, $this->pos); + $this->char = ($this->pos<$this->size) ? $this->doc[$this->pos] : null; // next + } + + protected function copy_skip($chars) + { + $pos = $this->pos; + $len = strspn($this->doc, $chars, $pos); + $this->pos += $len; + $this->char = ($this->pos<$this->size) ? $this->doc[$this->pos] : null; // next + if ($len===0) return ''; + return substr($this->doc, $pos, $len); + } + + protected function copy_until($chars) + { + $pos = $this->pos; + $len = strcspn($this->doc, $chars, $pos); + $this->pos += $len; + $this->char = ($this->pos<$this->size) ? $this->doc[$this->pos] : null; // next + return substr($this->doc, $pos, $len); + } + + protected function copy_until_char($char) + { + if ($this->char===null) return ''; + + if (($pos = strpos($this->doc, $char, $this->pos))===false) { + $ret = substr($this->doc, $this->pos, $this->size-$this->pos); + $this->char = null; + $this->pos = $this->size; + return $ret; + } + + if ($pos===$this->pos) return ''; + $pos_old = $this->pos; + $this->char = $this->doc[$pos]; + $this->pos = $pos; + return substr($this->doc, $pos_old, $pos-$pos_old); + } + + protected function copy_until_char_escape($char) + { + if ($this->char===null) return ''; + + $start = $this->pos; + while (1) + { + if (($pos = strpos($this->doc, $char, $start))===false) + { + $ret = substr($this->doc, $this->pos, $this->size-$this->pos); + $this->char = null; + $this->pos = $this->size; + return $ret; + } + + if ($pos===$this->pos) return ''; + + if ($this->doc[$pos-1]==='\\') { + $start = $pos+1; + continue; + } + + $pos_old = $this->pos; + $this->char = $this->doc[$pos]; + $this->pos = $pos; + return substr($this->doc, $pos_old, $pos-$pos_old); + } + } + + // remove noise from html content + // save the noise in the $this->noise array. + protected function remove_noise($pattern, $remove_tag=false) + { + global $debug_object; + if (is_object($debug_object)) { $debug_object->debug_log_entry(1); } + + $count = preg_match_all($pattern, $this->doc, $matches, PREG_SET_ORDER|PREG_OFFSET_CAPTURE); + + for ($i=$count-1; $i>-1; --$i) + { + $key = '___noise___'.sprintf('% 5d', count($this->noise)+1000); + if (is_object($debug_object)) { $debug_object->debug_log(2, 'key is: ' . $key); } + $idx = ($remove_tag) ? 0 : 1; + $this->noise[$key] = $matches[$i][$idx][0]; + $this->doc = substr_replace($this->doc, $key, $matches[$i][$idx][1], strlen($matches[$i][$idx][0])); + } + + // reset the length of content + $this->size = strlen($this->doc); + if ($this->size>0) + { + $this->char = $this->doc[0]; + } + } + + // restore noise to html content + function restore_noise($text) + { + global $debug_object; + if (is_object($debug_object)) { $debug_object->debug_log_entry(1); } + + while (($pos=strpos($text, '___noise___'))!==false) + { + // Sometimes there is a broken piece of markup, and we don't GET the pos+11 etc... token which indicates a problem outside of us... + if (strlen($text) > $pos+15) + { + $key = '___noise___'.$text[$pos+11].$text[$pos+12].$text[$pos+13].$text[$pos+14].$text[$pos+15]; + if (is_object($debug_object)) { $debug_object->debug_log(2, 'located key of: ' . $key); } + + if (isset($this->noise[$key])) + { + $text = substr($text, 0, $pos).$this->noise[$key].substr($text, $pos+16); + } + else + { + // do this to prevent an infinite loop. + $text = substr($text, 0, $pos).'UNDEFINED NOISE FOR KEY: '.$key . substr($text, $pos+16); + } + } + else + { + // There is no valid key being given back to us... We must get rid of the ___noise___ or we will have a problem. + $text = substr($text, 0, $pos).'NO NUMERIC NOISE KEY' . substr($text, $pos+11); + } + } + return $text; + } + + // Sometimes we NEED one of the noise elements. + function search_noise($text) + { + global $debug_object; + if (is_object($debug_object)) { $debug_object->debug_log_entry(1); } + + foreach($this->noise as $noiseElement) + { + if (strpos($noiseElement, $text)!==false) + { + return $noiseElement; + } + } + } + function __toString() + { + return $this->root->innertext(); + } + + function __get($name) + { + switch ($name) + { + case 'outertext': + return $this->root->innertext(); + case 'innertext': + return $this->root->innertext(); + case 'plaintext': + return $this->root->text(); + case 'charset': + return $this->_charset; + case 'target_charset': + return $this->_target_charset; + } + } + + // camel naming conventions + function childNodes($idx=-1) {return $this->root->childNodes($idx);} + function firstChild() {return $this->root->first_child();} + function lastChild() {return $this->root->last_child();} + function createElement($name, $value=null) {return @str_get_html("<$name>$value</$name>")->first_child();} + function createTextNode($value) {return @end(str_get_html($value)->nodes);} + function getElementById($id) {return $this->find("#$id", 0);} + function getElementsById($id, $idx=null) {return $this->find("#$id", $idx);} + function getElementByTagName($name) {return $this->find($name, 0);} + function getElementsByTagName($name, $idx=-1) {return $this->find($name, $idx);} + function loadFile() {$args = func_get_args();$this->load_file($args);} +} + ?> \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/third_party_compat/module.third_party_compat.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/third_party_compat/module.third_party_compat.php index bf3ca546d63b806d306e2fcaf5b8abb9f69b4bf5..7b06caa2f9528923f78d601dcc15a6ed7e7167d5 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/third_party_compat/module.third_party_compat.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/third_party_compat/module.third_party_compat.php @@ -2,8 +2,8 @@ /*** { - Module: photocrati-third_party_compat, - Depends: {} +Module: photocrati-third_party_compat, +Depends: {} } ***/ class M_Third_Party_Compat extends C_Base_Module @@ -14,7 +14,7 @@ class M_Third_Party_Compat extends C_Base_Module 'photocrati-third_party_compat', 'Third Party Compatibility', "Adds Third party compatibility hacks, adjustments, and modifications", - '0.3', + '0.4', 'http://www.nextgen-gallery.com', 'Photocrati Media', 'http://www.photocrati.com' @@ -68,10 +68,27 @@ class M_Third_Party_Compat extends C_Base_Module if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION == 4) { @ini_set('zlib.output_compression', 'Off'); } + + // Detect 'Adminer' and whether the user is viewing its loader.php + if (class_exists('AdminerForWP') && function_exists('adminer_object')) + { + if (!defined('NGG_DISABLE_RESOURCE_MANAGER')) + define('NGG_DISABLE_RESOURCE_MANAGER', TRUE); + } + + // Genesis Tabs creates a new query / do_shortcode loop which requires these be set + if (class_exists('Genesis_Tabs')) + { + if (!defined('NGG_DISABLE_FILTER_THE_CONTENT')) define('NGG_DISABLE_FILTER_THE_CONTENT', TRUE); + if (!defined('NGG_DISABLE_RESOURCE_MANAGER')) define('NGG_DISABLE_RESOURCE_MANAGER', TRUE); + } } function _register_adapters() { + $this->get_registry()->add_adapter( + 'I_Display_Type_Controller', 'A_Non_Cachable_Pro_Film_Controller', 'photocrati-nextgen_pro_film' + ); } function _register_hooks() @@ -86,8 +103,16 @@ class M_Third_Party_Compat extends C_Base_Module add_filter('headway_gzip', array(&$this, 'headway_gzip'), (PHP_INT_MAX - 1)); add_filter('ckeditor_external_plugins', array(&$this, 'ckeditor_plugins'), 11); add_filter('bp_do_redirect_canonical', array(&$this, 'fix_buddypress_routing')); - add_filter('the_content', array(&$this, 'check_weaverii'), -(PHP_INT_MAX-2)); - add_action('wp', array(&$this, 'check_for_jquery_lightbox')); + add_filter('the_content', array($this, 'check_weaverii'), -(PHP_INT_MAX-2)); + add_action('wp', array($this, 'check_for_jquery_lightbox')); + add_filter('get_the_excerpt', array($this, 'disable_galleries_in_excerpts'), 1); + add_filter('get_the_excerpt', array($this, 'enable_galleries_in_excerpts'), PHP_INT_MAX-1); + add_action('debug_bar_enqueue_scripts', array($this, 'no_debug_bar')); + add_filter('ngg_non_minified_modules', array($this, 'dont_minify_nextgen_pro_cssjs')); + add_filter('run_ngg_resource_manager', array($this, 'check_woocommerce_download')); + add_filter('run_ngg_resource_manager', array($this, 'check_wpecommerce_download')); + add_filter('run_ngg_resource_manager', array($this, 'check_mafs_download')); + add_filter('run_ngg_resource_manager', array($this, 'check_wps_download')); // WPML fix if (class_exists('SitePress')) { @@ -100,6 +125,87 @@ class M_Third_Party_Compat extends C_Base_Module add_action('the_post', array(&$this, 'add_ngg_pro_page_parameter')); } + /** + * Determine if the requested URL is a WP-Photo-Seller download and adjust the resource manager + * + * @param bool $valid_request + * @return bool + */ + function check_wps_download($valid_request = TRUE) + { + if (class_exists('WPS') && isset($_REQUEST['wps_file_dl']) && $_REQUEST['wps_file_dl'] == '1') + $valid_request = FALSE; + return $valid_request; + } + + /** + * Determine if the requested URL is a Multiverso Advanced File Sharing download and adjust the resource manager + * + * @param bool $valid_request + * @return bool + */ + function check_mafs_download($valid_request = TRUE) + { + if (function_exists('mv_install') && isset($_GET['upf']) && isset($_GET['id'])) + $valid_request = FALSE; + return $valid_request; + } + + /** + * Determine if the requested URL is a WooCommerce download and adjust the resource manager + * + * Our resource manager's output buffers conflict with Woo's use of output buffers to handle chunked reading of + * large files in WC_Download_Handler::readfile_chunked() + * @param bool $valid_request + * @return bool + */ + function check_woocommerce_download($valid_request = TRUE) + { + if (class_exists('WC_Download_Handler') && isset($_GET['download_file']) && isset($_GET['order']) && isset($_GET['email'])) + $valid_request = FALSE; + return $valid_request; + } + + /** + * Determine if the requested URL is a WPE-Commerce download and adjust the resource manager + * + * @param bool $valid_request + * @return bool + */ + function check_wpecommerce_download($valid_request = TRUE) + { + if (function_exists('wpsc_download_file') && isset($_GET['downloadid'])) + $valid_request = FALSE; + return $valid_request; + } + + function no_debug_bar() + { + if (M_Attach_To_Post::is_atp_url()) { + wp_dequeue_script('debug-bar-console'); + } + } + + // A lot of routing issues start occuring with WordPress SEO when the routing system is + // initialized by the excerpt, and then again from the post content. + function disable_galleries_in_excerpts($excerpt) + { + if (class_exists('WPSEO_OpenGraph')) { + M_Attach_To_Post::$substitute_placeholders = FALSE; + } + + return $excerpt; + } + + function enable_galleries_in_excerpts($excerpt) + { + if (class_exists('WPSEO_OpenGraph')) { + M_Attach_To_Post::$substitute_placeholders = TRUE; + } + + return $excerpt; + } + function fix_buddypress_routing() { M_WordPress_Routing::$_use_canonical_redirect = FALSE; @@ -176,12 +282,12 @@ class M_Third_Party_Compat extends C_Base_Module if (!class_exists('SitePress')) return; - if (FALSE === strpos(strtolower($_SERVER['REQUEST_URI']), '/nextgen-attach_to_post')) + if (!M_Attach_To_Post::is_atp_url()) return; global $wp_filter; - if (empty($wp_filter['init'][2])) + if (empty($wp_filter['init'][2]) && empty($wp_filter['after_setup_theme'][1])) return; foreach ($wp_filter['init'][2] as $id => $filter) { @@ -195,6 +301,13 @@ class M_Third_Party_Compat extends C_Base_Module remove_action('init', array($object, 'js_load'), 2); } + + foreach ($wp_filter['after_setup_theme'][1] as $id => $filter) { + if ($id !== 'wpml_installer_instance_delegator') + continue; + + remove_action('after_setup_theme', 'wpml_installer_instance_delegator', 1); + } } /** @@ -205,7 +318,7 @@ class M_Third_Party_Compat extends C_Base_Module if (!class_exists('WPML_Translation_Management')) return; - if (FALSE === strpos(strtolower($_SERVER['REQUEST_URI']), '/nextgen-attach_to_post')) + if (!M_Attach_To_Post::is_atp_url()) return; global $wp_filter; @@ -236,7 +349,7 @@ class M_Third_Party_Compat extends C_Base_Module { global $post; - if ($post AND (strpos($post->content, "<!--nextpage-->") === FALSE) AND (strpos($_SERVER['REQUEST_URI'], '/page/') !== FALSE)) { + if ($post AND !is_array($post->content) AND (strpos($post->content, "<!--nextpage-->") === FALSE) AND (strpos($_SERVER['REQUEST_URI'], '/page/') !== FALSE)) { if (preg_match("#/page/(\\d+)#", $_SERVER['REQUEST_URI'], $match)) { $_REQUEST['page'] = $match[1]; } @@ -363,12 +476,35 @@ class M_Third_Party_Compat extends C_Base_Module */ function bjlazyload_filter($content) { - return trim(preg_replace("/\s\s+/", " ", $content)); + return trim(preg_replace("/\\s\\s+/", " ", $content)); + } + + /** + * NextGen 2.0.67.20 introduced CSS/JS minification; do not apply this to NextGen Pro yet + * + * @param $modules_to_not_minify + * @return array + */ + function dont_minify_nextgen_pro_cssjs($modules_to_not_minify) + { + + // TODO: once Pro 2.1.30 is widely circulated, we don't need to use + // the installer. We can use the component registry to fetch the product + // and call the product's get_modules_to_load() function + $installer = new C_NextGen_Product_Installer; + + if (defined('NGG_PRO_PLUGIN_VERSION') && class_exists('P_Photocrati_NextGen_Pro')) + $modules_to_not_minify += $installer->get_modules_to_load_for('photocrati-nextgen-pro'); + else if (defined('NGG_PLUS_PLUGIN_VERSION') && class_exists('P_Photocrati_NextGen_Plus')) + $modules_to_not_minify += $installer->get_modules_to_load_for('photocrati-nextgen-plus'); + + return $modules_to_not_minify; } function get_type_list() { return array( + 'A_Non_Cachable_Pro_Film_Controller' => 'adapter.non_cachable_pro_film_controller.php' ); } } diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/third_party_compat/package.module.third_party_compat.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/third_party_compat/package.module.third_party_compat.php new file mode 100644 index 0000000000000000000000000000000000000000..30d786aa1d5b74eb5545f0562378c4f16e25ee90 --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/third_party_compat/package.module.third_party_compat.php @@ -0,0 +1,8 @@ +<?php +class A_Non_Cachable_Pro_Film_Controller extends Mixin +{ + public function is_cachable() + { + return FALSE; + } +} \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/validation/package.module.validation.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/validation/package.module.validation.php new file mode 100644 index 0000000000000000000000000000000000000000..7b2cf3558aa0b386191a45a17029017feed9da3e --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/validation/package.module.validation.php @@ -0,0 +1,437 @@ +<?php +class Mixin_Validation extends Mixin +{ + public $_default_msgs = array('validates_presence_of' => '%s should be present', 'validates_presence_with' => '%s should be present with %s', 'validates_uniqueness_of' => '%s should be unique', 'validates_confirmation_of' => '%s should match confirmation', 'validates_exclusion_of' => '%s is reserved', 'validates_format_of' => '%s is invalid', 'validates_inclusion_of' => '%s is not included in the list', 'validates_numericality_of' => '%s is not numeric', 'validates_less_than' => '%s is too small', 'validates_greater_than' => '%s is too large', 'validates_equals' => '%s is invalid'); + public $_default_patterns = array('email_address' => '//'); + /** + * Clears all errors for the object + */ + public function clear_errors() + { + $this->object->_errors = array(); + } + /** + * Returns the errors for a particular property + * @param string $property + * @return array|null + */ + public function errors_for($property) + { + $errors = $this->object->_errors; + if (isset($errors[$property])) { + return $errors[$property]; + } else { + return NULL; + } + } + /** + * Adds an error for a particular property of the object + * @param string $property + * @param string $msg + */ + public function add_error($msg, $property = '*') + { + if (!isset($this->object->_errors)) { + $this->object->_errors = array(); + } + $errors =& $this->object->_errors; + if (!isset($errors[$property])) { + $errors[$property] = array(); + } + $errors[$property][] = $msg; + } + /** + * Returns the default error message for a particular validator. + * A hook could override this, or this class could be subclassed + * @param string $validator + * @return string + */ + public function _get_default_error_message_for($validator) + { + $retval = FALSE; + // The $validator variable is often set to __METHOD__, and many + // forget that __METHOD__ looks like this: + // Mixin_Active_Record_Validation::validates_presence_of + // So, we fix that + if (strpos($validator, '::') !== FALSE) { + $parts = explode('::', $validator); + $validator = $parts[1]; + } + // Ensure that the validator has a default error message + if (isset($this->_default_msgs[$validator])) { + $retval = $this->_default_msgs[$validator]; + } + return $retval; + } + /** + * Returns the default pattern for a formatter, such as an "e-mail address". + * @param string $formatter + * @return string + */ + public function get_default_pattern_for($formatter) + { + $retval = FALSE; + if (isset($this->_default_patterns[$formatter])) { + $retval = $this->_default_patterns[$formatter]; + } + return $retval; + } + /** + * Gets all of the errors for the object + * @return type + */ + public function get_errors($property = FALSE) + { + $retval = $property ? $this->object->errors_for($property) : $this->object->_errors; + if (!$retval) { + $retval = array(); + } + return $retval; + } + /** + * Determines if an object, or a particular field for that object, has + * errors + * @param string $property + * @return boolean + */ + public function is_valid($property = FALSE) + { + $valid = TRUE; + $errors = $this->object->get_errors(); + if ($property) { + if (isset($errors[$property]) && !empty($errors[$property])) { + $valid = FALSE; + } + } elseif (!empty($errors)) { + $valid = FALSE; + } + return $valid; + } + /** + * Determines if the object, or a particular field on the object, has errors + * @param type $property + * @return type + */ + public function is_invalid($property = FALSE) + { + return !$this->object->is_valid($property); + } + /** + * Calls the validation method for a record, clearing the previous errors + */ + public function validate() + { + $this->clear_errors(); + if ($this->object->has_method('validation')) { + $this->object->validation(); + } + return $this->object->is_valid(); + } + /** + * Converts the name of a property to a human readable property name + * E.g. how_did_you_hear_about_us to "How did you hear about us" + * @param string $str + * @return string + */ + public function humanize_string($str) + { + $retval = array(); + if (is_array($str)) { + foreach ($str as $s) { + $retval[] = $this->humanize_string($s); + } + } else { + $retval = ucfirst(str_replace('_', ' ', $str)); + } + return $retval; + } + /** + * Validates the length of a property's value + * @param type $property + * @param type $length + * @param type $msg + */ + public function validates_length_of($property, $length, $comparison_operator = '=', $msg = FALSE) + { + $valid = TRUE; + $value = $this->object->{$property}; + $default_msg = $this->_get_default_error_message_for(__METHOD__); + if (!$this->is_empty($value)) { + switch ($comparison_operator) { + case '=': + case '==': + $valid = strlen($value) == $comparison; + $default_msg = $this->_get_default_error_message_for('validates_equals'); + break; + case '!=': + case '!': + $valid = strlen($value) != $comparison; + $default_msg = $this->_get_default_error_message_for('validates_equals'); + break; + case '<': + $valid = strlen($value) < $comparion; + $default_msg = $this->_get_default_error_message_for('validates_less_than'); + break; + case '>': + $valid = strlen($value) > $comparison; + $default_msg = $this->_get_default_error_message_for('validates_greater_than'); + break; + case '<=': + $valid = strlen($value) <= $comparison; + $default_msg = $this->_get_default_error_message_for('validates_less_than'); + break; + case '>=': + $valid = strlen($value) >= $comparion; + $default_msg = $this->_get_default_error_message_for('validates_greater_than'); + break; + } + } else { + $valid = FALSE; + } + if (!$valid) { + if (!$msg) { + $error_msg = sprintf($default_msg, $this->humanize_string($property)); + } else { + $error_msg = $msg; + } + $this->add_error($error_msg, $property); + } + } + /** + * Validates that a property contains a numeric value. May optionally be tested against + * other numbers. + * @param string $property + * @param decimal $comparison + * @param string $comparison_operator + * @param type $msg + */ + public function validates_numericality_of($property, $comparison = FALSE, $comparison_operator = FALSE, $int_only = FALSE, $msg = FALSE) + { + $properties = is_array($property) ? $property : array($property); + foreach ($properties as $property) { + $value = $this->object->{$property}; + $default_msg = $this->_get_default_error_message_for(__METHOD__); + if (!$this->is_empty($value)) { + $invalid = FALSE; + if (is_numeric($value)) { + $value = $value += 0; + if ($int_only) { + $invalid = !is_int($value); + } + if (!$invalid) { + switch ($comparison_operator) { + case '=': + case '==': + $invalid = $value == $comparison ? FALSE : TRUE; + $default_msg = $this->_get_default_error_message_for('validates_equals'); + break; + case '!=': + case '!': + $invalid = $value != $comparison ? FALSE : TRUE; + $default_msg = $this->_get_default_error_message_for('validates_equals'); + break; + case '<': + $invalid = $value < $comparison ? FALSE : TRUE; + $default_msg = $this->_get_default_error_message_for('validates_less_than'); + break; + case '>': + $invalid = $value > $comparison ? FALSE : TRUE; + $default_msg = $this->_get_default_error_message_for('validates_greater_than'); + break; + case '<=': + $invalid = $value <= $comparison ? FALSE : TRUE; + $default_msg = $this->_get_default_error_message_for('validates_less_than'); + break; + case '>=': + $invalid = $value >= $comparison ? FALSE : TRUE; + $default_msg = $this->_get_default_error_message_for('validates_greater_than'); + break; + } + } + } else { + $invalid = TRUE; + } + if ($invalid) { + if (!$msg) { + $error_msg = sprintf($default_msg, $this->humanize_string($property)); + } else { + $error_msg = $msg; + } + $this->add_error($error_msg, $property); + } + } + } + } + /** + * Validates that a property includes a particular value + * @param string $property + * @param array $values + * @param string $msg + */ + public function validates_inclusion_of($property, $values = array(), $msg = FALSE) + { + if (!is_array($values)) { + $values = array($values); + } + if (!in_array($this->object->{$property}, $values)) { + if (!$msg) { + $msg = $this->_get_default_error_message_for(__METHOD__); + $msg = sprintf($msg, $this->humanize_string($property)); + } + $this->add_error($msg, $property); + } + } + /** + * Validates that a property's value matches a particular pattern + * @param string|array $property + * @param string $pattern + * @param string $msg + */ + public function validates_format_of($property, $pattern, $msg = FALSE) + { + if (!is_array($property)) { + $property = array($property); + } + // A pattern could be the name of a default pattern, or a regex pattern + $default_pattern = $this->get_default_pattern_for($pattern); + if ($default_pattern) { + $default_pattern = $pattern; + } + foreach ($property as $prop) { + // We do not validate blank values - we rely on "validates_presense_of" + // for that + if (!$this->is_empty($this->object->{$prop})) { + // If it doesn't match, then it's an error + if (!preg_match($pattern, $property)) { + // Get default message + if (!$msg) { + $msg = $this->_get_default_error_message_for(__METHOD__); + $msg = sprintf($msg, $this->humanize_string($property)); + } + $this->add_error($msg, $property); + } + } + } + } + /** + * Ensures that a property does NOT have a particular value + * @param string $property + * @param array $exclusions + * @param string $msg + */ + public function validates_exclusion_of($property, $exclusions = array(), $msg = FALSE) + { + $invalid = FALSE; + if (!is_array($exclusions)) { + $exclusions = array($exclusions); + } + foreach ($exclusions as $exclusion) { + if ($exclusion == $this->object->{$property}) { + $invalid = TRUE; + break; + } + } + if ($invalid) { + if (!$msg) { + $msg = $this->_get_default_error_message_for(__METHOD__); + $msg = sprintf($msg, $this->humanize_string($property)); + } + $this->add_error($msg, $property); + } + } + /** + * Validates the confirmation of a property + * @param string $property + * @param string $confirmation + * @param string $msg + */ + public function validates_confirmation_of($property, $confirmation, $msg = FALSE) + { + if ($this->object->{$property} != $this->object->{$confirmation}) { + if (!$msg) { + $msg = $this->_get_default_error_message_for(__METHOD__); + $msg = sprintf($msg, $this->humanize_string($property)); + } + $this->add_error($msg, $property); + } + } + /** + * Validates the uniqueness of a property + * @param string $property + * @param array $scope + * @param string $msg + */ + public function validates_uniqueness_of($property, $scope = array(), $msg = FALSE) + { + // Get any entities that have the same property + $mapper = $this->object->get_mapper(); + $key = $mapper->get_primary_key_column(); + $mapper->select($key); + $mapper->limit(1); + $mapper->where_and(array("{$property} = %s", $this->object->{$property})); + if (!$this->object->is_new()) { + $mapper->where_and(array("{$key} != %s", $this->object->id())); + } + foreach ($scope as $another_property) { + $mapper->where_and(array("{$another_property} = %s", $another_property)); + } + $result = $mapper->run_query(); + // If there's a result, it means that the entity is NOT unique + if ($result) { + // Get default msg + if (!$msg) { + $msg = $this->_get_default_error_message_for(__METHOD__); + $msg = sprintf($msg, $this->humanize_string($property)); + } + // Add error + $this->add_error($msg, $property); + } + } + /** + * Validates the presence of a value for a particular field + * @param string $property + * @param string $msg + */ + public function validates_presence_of($properties, $with = array(), $msg = FALSE) + { + $missing = array(); + if (!is_array($properties)) { + $properties = array($properties); + } + // Iterate through each property that we're to check, and ensure + // a value is present + foreach ($properties as $property) { + $invalid = TRUE; + // Is a value present? + if (!$this->is_empty($this->object->{$property})) { + $invalid = FALSE; + // This property must be present with at least another property + if ($with) { + if (!is_array($with)) { + $with = array($with); + } + foreach ($with as $other) { + if ($this->is_empty($this->object->{$other})) { + $invalid = TRUE; + $missing[] = $other; + } + } + } + } + // Add error + if ($invalid) { + if (!$msg) { + // If missing isn't empty, it means that we're to use the + // "with" error message + if ($missing) { + $missing = implode(', ', $this->humanize_string($missing)); + $msg = sprintf($this->_get_default_error_message_for('validates_presence_with'), $property, $missing); + } else { + $msg = sprintf($this->_get_default_error_message_for(__METHOD__), $property); + } + } + $this->add_error($msg, $property); + } + } + } +} \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/widget/module.widget.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/widget/module.widget.php index c3c20a1b5ea742ab42c040f65b0f477fbf73201c..77b4cc50ecacab74bd74ce0988cfb825a59e8ddf 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/widget/module.widget.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/widget/module.widget.php @@ -46,8 +46,7 @@ class M_Widget extends C_Base_Module 'C_Widget' => 'class.widget.php', 'C_Widget_Gallery' => 'class.widget_gallery.php', 'C_Widget_Mediarss' => 'class.widget_mediarss.php', - 'C_Widget_Slideshow' => 'class.widget_slideshow.php', - 'I_Widget' => 'interface.widget.php' + 'C_Widget_Slideshow' => 'class.widget_slideshow.php' ); } diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/widget/package.module.widget.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/widget/package.module.widget.php new file mode 100644 index 0000000000000000000000000000000000000000..b19bfb727a54c0cce6d6f5d1401b7a5f4e9e14f3 --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/widget/package.module.widget.php @@ -0,0 +1,284 @@ +<?php +class C_Widget extends C_MVC_Controller +{ + public static $_instances = array(); + public function define($context = FALSE) + { + parent::define($context); + $this->add_mixin('Mixin_Widget'); + $this->implement('I_Widget'); + } + public static function get_instance($context = FALSE) + { + if (!isset(self::$_instances[$context])) { + self::$_instances[$context] = new C_Widget($context); + } + return self::$_instances[$context]; + } +} +class Mixin_Widget extends Mixin +{ + /** + * Function for templates without widget support + * + * @return echo the widget content + */ + public function echo_widget_random($number, $width = '75', $height = '50', $exclude = 'all', $list = '', $show = 'thumbnail') + { + $options = array('title' => FALSE, 'items' => $number, 'show' => $show, 'type' => 'random', 'width' => $width, 'height' => $height, 'exclude' => $exclude, 'list' => $list, 'webslice' => FALSE); + $widget = new C_Widget_Gallery(); + $widget->widget($args = array('widget_id' => 'sidebar_1'), $options); + } + /** + * Function for templates without widget support + * + * @return echo the widget content + */ + public function echo_widget_recent($number, $width = '75', $height = '50', $exclude = 'all', $list = '', $show = 'thumbnail') + { + $options = array('title' => FALSE, 'items' => $number, 'show' => $show, 'type' => 'recent', 'width' => $width, 'height' => $height, 'exclude' => $exclude, 'list' => $list, 'webslice' => FALSE); + $widget = new C_Widget_Gallery(); + $widget->widget($args = array('widget_id' => 'sidebar_1'), $options); + } + /** + * Function for templates without widget support + * + * @param integer $galleryID + * @param string $width + * @param string $height + * @return echo the widget content + */ + public function echo_widget_slideshow($galleryID, $width = '', $height = '') + { + $widget = new C_Widget_Slideshow(); + $widget->render_slideshow($galleryID, $width, $height); + } +} +class C_Widget_Gallery extends WP_Widget +{ + public function __construct() + { + $widget_ops = array('classname' => 'ngg_images', 'description' => __('Add recent or random images from the galleries', 'nggallery')); + $this->WP_Widget('ngg-images', __('NextGEN Widget', 'nggallery'), $widget_ops); + } + public function form($instance) + { + // used for rendering utilities + $parent = C_Widget::get_instance(); + // defaults + $instance = wp_parse_args((array) $instance, array('exclude' => 'all', 'height' => '75', 'items' => '4', 'list' => '', 'show' => 'thumbnail', 'title' => 'Gallery', 'type' => 'recent', 'webslice' => TRUE, 'width' => '100')); + $parent->render_partial('photocrati-widget#form_gallery', array('self' => $this, 'instance' => $instance, 'title' => esc_attr($instance['title']), 'items' => intval($instance['items']), 'height' => esc_attr($instance['height']), 'width' => esc_attr($instance['width']))); + } + public function update($new_instance, $old_instance) + { + $instance = $old_instance; + // do not allow 0 or less + if ((int) $new_instance['items'] <= 0) { + $new_instance['items'] = 4; + } + // for clarity: empty the list if we're showing every gallery anyway + if ($new_instance['exclude'] == 'all') { + $new_instance['list'] = ''; + } + // remove gallery ids that do not exist + if (in_array($new_instance['exclude'], array('denied', 'allow'))) { + // do search + $mapper = C_Gallery_Mapper::get_instance(); + $ids = explode(',', $new_instance['list']); + foreach ($ids as $ndx => $id) { + if (!$mapper->find($id)) { + unset($ids[$ndx]); + } + } + $new_instance['list'] = implode(',', $ids); + } + // reset to show all galleries IF there are no valid galleries in the list + if ($new_instance['exclude'] !== 'all' && empty($new_instance['list'])) { + $new_instance['exclude'] = 'all'; + } + $instance['title'] = strip_tags($new_instance['title']); + $instance['items'] = (int) $new_instance['items']; + $instance['type'] = $new_instance['type']; + $instance['show'] = $new_instance['show']; + $instance['width'] = (int) $new_instance['width']; + $instance['height'] = (int) $new_instance['height']; + $instance['exclude'] = $new_instance['exclude']; + $instance['list'] = $new_instance['list']; + $instance['webslice'] = (bool) $new_instance['webslice']; + return $instance; + } + public function widget($args, $instance) + { + $router = C_Router::get_instance(); + wp_enqueue_style('nextgen_widgets_style', $router->get_static_url('photocrati-widget#widgets.css')); + wp_enqueue_style('nextgen_basic_thumbnails_style', $router->get_static_url('photocrati-nextgen_basic_gallery#thumbnails/nextgen_basic_thumbnails.css')); + // these are handled by extract() but I want to silence my IDE warnings that these vars don't exist + $before_widget = NULL; + $before_title = NULL; + $after_widget = NULL; + $after_title = NULL; + $widget_id = NULL; + extract($args); + $title = apply_filters('widget_title', empty($instance['title']) ? ' ' : $instance['title'], $instance, $this->id_base); + $renderer = C_Displayed_Gallery_Renderer::get_instance(); + $factory = C_Component_Factory::get_instance(); + $view = $factory->create('mvc_view', ''); + // IE8 webslice support if needed + if (!empty($instance['webslice'])) { + $before_widget .= '<div class="hslice" id="ngg-webslice">'; + $before_title = str_replace('class="', 'class="entry-title ', $before_title); + $after_widget = '</div>' . $after_widget; + } + $source = $instance['type'] == 'random' ? 'random_images' : 'recent'; + $template = !empty($instance['template']) ? $instance['template'] : $view->get_template_abspath('photocrati-widget#display_gallery'); + $params = array('slug' => 'widget-' . $args['widget_id'], 'source' => $source, 'display_type' => NGG_BASIC_THUMBNAILS, 'images_per_page' => $instance['items'], 'maximum_entity_count' => $instance['items'], 'template' => $template, 'image_type' => $instance['show'] == 'original' ? 'full' : 'thumb', 'show_all_in_lightbox' => FALSE, 'show_slideshow_link' => FALSE, 'show_thumbnail_link' => FALSE, 'use_imagebrowser_effect' => FALSE, 'disable_pagination' => TRUE, 'image_width' => $instance['width'], 'image_height' => $instance['height'], 'ngg_triggers_display' => 'never', 'widget_setting_title' => $title, 'widget_setting_before_widget' => $before_widget, 'widget_setting_before_title' => $before_title, 'widget_setting_after_widget' => $after_widget, 'widget_setting_after_title' => $after_title, 'widget_setting_width' => $instance['width'], 'widget_setting_height' => $instance['height'], 'widget_setting_show_setting' => $instance['show'], 'widget_setting_widget_id' => $widget_id); + switch ($instance['exclude']) { + case 'all': + break; + case 'denied': + $mapper = C_Gallery_Mapper::get_instance(); + $gallery_ids = array(); + $list = explode(',', $instance['list']); + foreach ($mapper->find_all() as $gallery) { + if (!in_array($gallery->{$gallery->id_field}, $list)) { + $gallery_ids[] = $gallery->{$gallery->id_field}; + } + } + $params['container_ids'] = implode(',', $gallery_ids); + break; + case 'allow': + $params['container_ids'] = $instance['list']; + break; + } + echo $renderer->display_images($params); + } +} +class C_Widget_MediaRSS extends WP_Widget +{ + public $options; + public function __construct() + { + $widget_ops = array('classname' => 'ngg_mrssw', 'description' => __('Widget that displays Media RSS links for NextGEN Gallery.', 'nggallery')); + $this->WP_Widget('ngg-mrssw', __('NextGEN Media RSS', 'nggallery'), $widget_ops); + } + public function form($instance) + { + // used for rendering utilities + $parent = C_Widget::get_instance(); + // defaults + $instance = wp_parse_args((array) $instance, array('mrss_text' => __('Media RSS', 'nggallery'), 'mrss_title' => __('Link to the main image feed', 'nggallery'), 'show_global_mrss' => TRUE, 'show_icon' => TRUE, 'title' => 'Media RSS')); + $parent->render_partial('photocrati-widget#form_mediarss', array('self' => $this, 'instance' => $instance, 'title' => esc_attr($instance['title']), 'mrss_text' => esc_attr($instance['mrss_text']), 'mrss_title' => esc_attr($instance['mrss_title']))); + } + public function update($new_instance, $old_instance) + { + $instance = $old_instance; + $instance['title'] = strip_tags($new_instance['title']); + $instance['show_global_mrss'] = $new_instance['show_global_mrss']; + $instance['show_icon'] = $new_instance['show_icon']; + $instance['mrss_text'] = $new_instance['mrss_text']; + $instance['mrss_title'] = $new_instance['mrss_title']; + return $instance; + } + public function widget($args, $instance) + { + // these are handled by extract() but I want to silence my IDE warnings that these vars don't exist + $before_widget = NULL; + $before_title = NULL; + $after_widget = NULL; + $after_title = NULL; + $widget_id = NULL; + extract($args); + $settings = C_NextGen_Settings::get_instance(); + $parent = C_Component_Registry::get_instance()->get_utility('I_Widget'); + $title = apply_filters('widget_title', empty($instance['title']) ? ' ' : $instance['title'], $instance, $this->id_base); + $parent->render_partial('photocrati-widget#display_mediarss', array('self' => $this, 'instance' => $instance, 'title' => $title, 'settings' => $settings, 'before_widget' => $before_widget, 'before_title' => $before_title, 'after_widget' => $after_widget, 'after_title' => $after_title, 'widget_id' => $widget_id)); + } + public function get_mrss_link($mrss_url, $show_icon = TRUE, $title, $text) + { + $out = ''; + if ($show_icon) { + $icon_url = NGGALLERY_URLPATH . 'images/mrss-icon.gif'; + $out .= "<a href='{$mrss_url}' title='{$title}' class='ngg-media-rss-link'>"; + $out .= "<img src='{$icon_url}' alt='MediaRSS Icon' title='" . $title . '\' class=\'ngg-media-rss-icon\' />'; + $out .= '</a> '; + } + if ($text != '') { + $out .= "<a href='{$mrss_url}' title='{$title}' class='ngg-media-rss-link'>"; + $out .= $text; + $out .= '</a>'; + } + return $out; + } +} +class C_Widget_Slideshow extends WP_Widget +{ + public function __construct() + { + $widget_ops = array('classname' => 'widget_slideshow', 'description' => __('Show a NextGEN Gallery Slideshow', 'nggallery')); + $this->WP_Widget('slideshow', __('NextGEN Slideshow', 'nggallery'), $widget_ops); + } + public function form($instance) + { + global $wpdb; + // used for rendering utilities + $parent = C_Widget::get_instance(); + // defaults + $instance = wp_parse_args((array) $instance, array('galleryid' => '0', 'height' => '120', 'title' => 'Slideshow', 'width' => '160', 'limit' => '10')); + $parent->render_partial('photocrati-widget#form_slideshow', array('self' => $this, 'instance' => $instance, 'title' => esc_attr($instance['title']), 'height' => esc_attr($instance['height']), 'width' => esc_attr($instance['width']), 'limit' => esc_attr($instance['limit']), 'tables' => $wpdb->get_results("SELECT * FROM {$wpdb->nggallery} ORDER BY 'name' ASC"))); + } + public function update($new_instance, $old_instance) + { + $nh = $new_instance['height']; + $nw = $new_instance['width']; + if (empty($nh) || (int) $nh === 0) { + $new_instance['height'] = 120; + } + if (empty($nw) || (int) $nw === 0) { + $new_instance['width'] = 160; + } + if (empty($new_instance['limit'])) { + $new_instance['limit'] = 10; + } + $instance = $old_instance; + $instance['title'] = strip_tags($new_instance['title']); + $instance['galleryid'] = (int) $new_instance['galleryid']; + $instance['height'] = (int) $new_instance['height']; + $instance['width'] = (int) $new_instance['width']; + $instance['limit'] = (int) $new_instance['limit']; + return $instance; + } + public function widget($args, $instance) + { + $router = C_Router::get_instance(); + wp_enqueue_style('nextgen_widgets_style', $router->get_static_url('photocrati-widget#widgets.css')); + wp_enqueue_style('nextgen_basic_slideshow_style', $router->get_static_url('photocrati-nextgen_basic_gallery#slideshow/nextgen_basic_slideshow.css')); + // these are handled by extract() but I want to silence my IDE warnings that these vars don't exist + $before_widget = NULL; + $before_title = NULL; + $after_widget = NULL; + $after_title = NULL; + $widget_id = NULL; + extract($args); + $parent = C_Component_Registry::get_instance()->get_utility('I_Widget'); + $title = apply_filters('widget_title', empty($instance['title']) ? __('Slideshow', 'nggallery') : $instance['title'], $instance, $this->id_base); + if (empty($instance['limit'])) { + $instance['limit'] = 10; + } + $out = $this->render_slideshow($instance['galleryid'], $instance['width'], $instance['height'], $instance['limit'], $args); + $parent->render_partial('photocrati-widget#display_slideshow', array('self' => $this, 'instance' => $instance, 'title' => $title, 'out' => $out, 'before_widget' => $before_widget, 'before_title' => $before_title, 'after_widget' => $after_widget, 'after_title' => $after_title, 'widget_id' => $widget_id)); + } + public function render_slideshow($galleryID, $irWidth = '', $irHeight = '', $limit = 10, $args) + { + $registry = C_Component_Registry::get_instance(); + $renderer = C_Displayed_Gallery_Renderer::get_instance(); + $params = array('container_ids' => $galleryID, 'display_type' => 'photocrati-nextgen_basic_slideshow', 'gallery_width' => $irWidth, 'gallery_height' => $irHeight, 'source' => 'galleries', 'slug' => 'widget-' . $args['widget_id'], 'entity_types' => array('image'), 'show_thumbnail_link' => FALSE, 'show_slideshow_link' => FALSE, 'use_imagebrowser_effect' => FALSE, 'ngg_triggers_display' => 'never'); + if (0 === $galleryID) { + $params['source'] = 'random_images'; + $params['maximum_entity_count'] = $limit; + unset($params['container_ids']); + } + $retval = $renderer->display_images($params, NULL); + $retval = apply_filters('ngg_show_slideshow_widget_content', $retval, $galleryID, $irWidth, $irHeight); + return $retval; + } +} \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/widget/static/widgets.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/widget/static/widgets.css index 2013b04027ce27fbb04f421e2ee52af4558cd7f7..36e55f88c74692e44403c2626a3ba9076c735c11 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/widget/static/widgets.css +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/widget/static/widgets.css @@ -13,4 +13,5 @@ margin: 0pt 2px 2px 0px; padding: 1px; height: auto; /* silly, but without this the images will appear distorted with some WP themes */ + float: left; } diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/widget/static/widgets.min.css b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/widget/static/widgets.min.css new file mode 100644 index 0000000000000000000000000000000000000000..a25d3062a0ac76af3ee1e4e816ecf3385f9bb039 --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/widget/static/widgets.min.css @@ -0,0 +1 @@ +.ngg-widget,.ngg-widget-slideshow{overflow:hidden;margin:0;padding:5px 0 0 0;text-align:left}.ngg-widget img{border:2px solid #a9a9a9;margin:0 2px 2px 0;padding:1px;height:auto;float:left} \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/widget/templates/display_gallery.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/widget/templates/display_gallery.php index 0045e8ec55b43cc9c9c612042a367b299d94ab2d..b719f33d4ab9ff190ee35362e97c77f3006e20d4 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/widget/templates/display_gallery.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/widget/templates/display_gallery.php @@ -1,6 +1,6 @@ <?php -$controller = C_Component_Registry::get_instance()->get_utility('I_Display_Type_Controller'); -$storage = C_Component_Registry::get_instance()->get_utility('I_Gallery_Storage'); +$controller = C_Display_Type_Controller::get_instance(); +$storage = C_Gallery_Storage::get_instance(); $effect_code = $controller->get_effect_code($gallery->displayed_gallery); $settings = $gallery->displayed_gallery->get_entity()->display_settings; diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/widget/templates/display_mediarss.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/widget/templates/display_mediarss.php index 31dbdac0baa5636d4e2b0eb84f94df8efcee3d37..80095932a2525227ac4d29bb86e7ad5f6a83c6d8 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/widget/templates/display_mediarss.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/widget/templates/display_mediarss.php @@ -5,8 +5,7 @@ <?php echo $self->get_mrss_link(nggMediaRss::get_mrss_url(), $instance['show_icon'], strip_tags(stripslashes($instance['mrss_title'])), - stripslashes($instance['mrss_text']), - $settings->usePicLens); ?> + stripslashes($instance['mrss_text'])); ?> </li> <?php } ?> </ul> diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/widget/templates/form_slideshow.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/widget/templates/form_slideshow.php index e9f9111a624e582a4a90dab3931f292096ab5d53..32931ce21ce988758548b40f9b7db47fc354f600 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/widget/templates/form_slideshow.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/widget/templates/form_slideshow.php @@ -29,7 +29,7 @@ echo '<option value="' . $table->gid . '" '; if ($table->gid == $instance['galleryid']) echo 'selected="selected" '; - echo '>' . $table->name . '</option>'; + echo '>' . $table->title . '</option>'; } } ?> </select> diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/wordpress_routing/module.wordpress_routing.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/wordpress_routing/module.wordpress_routing.php index 7f906ae9ba47574316bcb2e1784a474ea23ea19a..a28d13b72fc1f78a845fab5d37903d1567a7de83 100644 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/wordpress_routing/module.wordpress_routing.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/wordpress_routing/module.wordpress_routing.php @@ -8,7 +8,7 @@ ***/ class M_WordPress_Routing extends C_Base_Module { - static $_use_canonical_redirect = TRUE; + static $_use_canonical_redirect = TRUE; static $_use_old_slugs = TRUE; function define() @@ -17,7 +17,7 @@ class M_WordPress_Routing extends C_Base_Module 'photocrati-wordpress_routing', 'WordPress Routing', "Integrates the MVC module's routing implementation with WordPress", - '0.5', + '0.6', 'http://www.nextgen-gallery.com', 'Photocrati Media', 'http://www.photocrati.com' @@ -26,12 +26,13 @@ class M_WordPress_Routing extends C_Base_Module function _register_adapters() { + $this->get_registry()->add_adapter('I_Router', 'A_WordPress_Base_Url'); $this->get_registry()->add_adapter('I_Router', 'A_WordPress_Router'); $this->get_registry()->add_adapter('I_Routing_App', 'A_WordPress_Routing_App'); } - function _register_hooks() - { + function _register_hooks() + { add_action('template_redirect', array(&$this, 'restore_request_uri'), 1); // These two things cause conflicts in NGG. So we temporarily @@ -43,8 +44,7 @@ class M_WordPress_Routing extends C_Base_Module if (has_action('template_redirect', 'redirect_canonical')) { remove_action( 'template_redirect', 'redirect_canonical'); } - } - + } /** * When WordPress sees a url like http://foobar.com/nggallery/page/2/, it thinks that it is an @@ -53,9 +53,14 @@ class M_WordPress_Routing extends C_Base_Module */ function restore_request_uri() { - if (isset($_SERVER['ORIG_REQUEST_URI'])) { - $request_uri = $_SERVER['ORIG_REQUEST_URI']; + if (isset($_SERVER['ORIG_REQUEST_URI'])) + { + $request_uri = $_SERVER['ORIG_REQUEST_URI']; $_SERVER['UNENCODED_URL'] = $_SERVER['HTTP_X_ORIGINAL_URL'] = $_SERVER['REQUEST_URI'] = $request_uri; + + if (isset($_SERVER['ORIG_PATH_INFO'])) { + $_SERVER['PATH_INFO'] = $_SERVER['ORIG_PATH_INFO']; + } } // this is the proper behavior but it causes problems with WPML else { @@ -67,7 +72,8 @@ class M_WordPress_Routing extends C_Base_Module function get_type_list() { return array( - 'A_Wordpress_Router' => 'adapter.wordpress_router.php', + 'A_WordPress_Base_Url' => 'adapter.wordpress_base_url.php', + 'A_Wordpress_Router' => 'adapter.wordpress_router.php', 'A_Wordpress_Routing_App' => 'adapter.wordpress_routing_app.php' ); } diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/wordpress_routing/package.module.wordpress_routing.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/wordpress_routing/package.module.wordpress_routing.php new file mode 100644 index 0000000000000000000000000000000000000000..0be40e7ff38124994796cd6b40527d74cbc233e7 --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/wordpress_routing/package.module.wordpress_routing.php @@ -0,0 +1,196 @@ +<?php +class A_WordPress_Base_Url extends Mixin +{ + public function _add_index_dot_php_to_url($url) + { + if (strpos($url, '/index.php') === FALSE) { + $pattern = get_option('permalink_structure'); + if (!$pattern or strpos($pattern, '/index.php') !== FALSE) { + $url = $this->object->join_paths($url, '/index.php'); + } + } + return $url; + } + public function get_base_url($site_url = FALSE) + { + $retval = NULL; + $add_index_dot_php = TRUE; + if (in_array($site_url, array(TRUE, 'site'), TRUE)) { + $retval = site_url(); + } elseif (in_array($site_url, array(FALSE, 'home'), TRUE)) { + $retval = home_url(); + } elseif (in_array($site_url, array('plugins', 'plugin'), TRUE)) { + $retval = plugins_url(); + $add_index_dot_php = FALSE; + } elseif (in_array($site_url, array('plugins_mu', 'plugin_mu'), TRUE)) { + $retval = WPMU_PLUGIN_URL; + $retval = set_url_scheme($retval); + $retval = apply_filters('plugins_url', $retval, '', ''); + $add_index_dot_php = FALSE; + } elseif (in_array($site_url, array('templates', 'template', 'themes', 'theme'), TRUE)) { + $retval = get_template_directory_uri(); + $add_index_dot_php = FALSE; + } elseif (in_array($site_url, array('styles', 'style', 'stylesheets', 'stylesheet'), TRUE)) { + $retval = get_stylesheet_directory_uri(); + $add_index_dot_php = FALSE; + } elseif (in_array($site_url, array('content'), TRUE)) { + $retval = content_url(); + $add_index_dot_php = FALSE; + } elseif (in_array($site_url, array('root'), TRUE)) { + $retval = get_option('home'); + if (is_ssl()) { + $scheme = 'https'; + } else { + $scheme = parse_url($retval, PHP_URL_SCHEME); + } + $retval = set_url_scheme($retval, $scheme); + } elseif (in_array($site_url, array('gallery', 'galleries'), TRUE)) { + $root_type = defined('NGG_GALLERY_ROOT_TYPE') ? NGG_GALLERY_ROOT_TYPE : 'site'; + $add_index_dot_php = FALSE; + if ($root_type === 'content') { + $retval = content_url(); + } else { + $retval = site_url(); + } + } else { + $retval = site_url(); + } + if ($add_index_dot_php) { + $retval = $this->_add_index_dot_php_to_url($retval); + } + if ($this->object->is_https()) { + $retval = preg_replace('/^http:\\/\\//i', 'https://', $retval, 1); + } + return $retval; + } +} +class A_WordPress_Router extends Mixin +{ + public function get_url($uri = '/', $with_qs = TRUE, $site_url = FALSE) + { + static $cache = array(); + $key = implode('|', array($uri, $with_qs, $site_url)); + if (isset($cache[$key])) { + return $cache[$key]; + } else { + $retval = $this->call_parent('get_url', $uri, $with_qs, $site_url); + // Determine whether the url is a directory or file on the filesystem + // If so, then we do NOT need /index.php as part of the url + $base_url = $this->object->get_base_url(); + $filename = str_replace($base_url, C_Fs::get_instance()->get_document_root(), $retval); + if ($retval && @file_exists($filename) && $retval != $base_url) { + // Remove index.php from the url + $retval = $this->object->remove_url_segment('/index.php', $retval); + // Static urls don't end with a slash + $retval = untrailingslashit($retval); + } + $cache[$key] = $retval; + return $retval; + } + } +} +class A_WordPress_Routing_App extends Mixin +{ + public function remove_parameter($key, $id = NULL, $url = FALSE) + { + $generated_url = $this->call_parent('remove_parameter', $key, $id, $url); + $generated_url = $this->object->add_post_permalink_to_url($generated_url); + return $generated_url; + } + public function parse_url($url) + { + $parts = parse_url($url); + if (!isset($parts['path'])) { + $parts['path'] = '/'; + } + if (!isset($parts['query'])) { + $parts['query'] = ''; + } + return $parts; + } + /** + * Adds the post permalink to the url, if it isn't already present. + * + * The generated_url could look like: + * http://localhost/dir/nggallery/show/slideshow + * @param $generated_url + * @return mixed + */ + public function add_post_permalink_to_url($generated_url) + { + if (!apply_filters('ngg_wprouting_add_post_permalink', TRUE)) { + return $generated_url; + } + $base_url = $this->object->get_router()->get_base_url('home'); + $settings = C_NextGen_Settings::get_instance(); + if (strlen($generated_url) < 2) { + $generated_url = $base_url; + } + $original_url = $generated_url; + $generated_parts = explode($settings->router_param_slug, $generated_url); + $generated_url = $generated_parts[0]; + $ngg_parameters = isset($generated_parts[1]) ? @array_shift(explode('?', $generated_parts[1])) : '/'; + $post_permalink = get_permalink(isset($_REQUEST['p']) ? $_REQUEST['p'] : 0); + if ($post_permalink == '/') { + $post_permalink = $base_url; + } + // Trailing slash all of the urls + $original_url = trailingslashit($original_url); + $post_permalink = trailingslashit($post_permalink); + $generated_url = trailingslashit($generated_url); + // We need to determine if the generated url and the post permalink TRULY differ. If they + // differ, then we'll return post_permalink + nggallery parameters appended. Otherwise, we'll + // just return the generated url + $generated_url = str_replace($base_url, home_url(), $generated_url); + $generated_parts = $this->parse_url($generated_url); + $post_parts = $this->parse_url($post_permalink); + $generated_parts['path'] = trailingslashit($generated_parts['path']); + if (isset($generated_parts['query'])) { + $generated_parts['query'] = untrailingslashit($generated_parts['query']); + } + $post_parts['path'] = trailingslashit($post_parts['path']); + if (isset($post_parts['query'])) { + $post_parts['query'] = untrailingslashit($post_parts['query']); + } + $generated_url = $this->object->construct_url_from_parts($generated_parts); + $post_permalink = $this->object->construct_url_from_parts($post_parts); + // No change required... + if ($generated_url == $post_permalink) { + $generated_url = $original_url; + // Ensure that the generated url has the real base url for default permalinks + if (strpos($generated_url, home_url()) !== FALSE && strpos($generated_url, $base_url) === FALSE) { + $generated_url = str_replace(home_url(), $base_url, $generated_url); + } + } else { + // The post permalink differs from the generated url + $post_permalink = str_replace(home_url(), $base_url, $post_permalink); + $post_parts = $this->parse_url($post_permalink); + $post_parts['path'] = $this->object->join_paths($post_parts['path'], $settings->router_param_slug, $ngg_parameters); + $post_parts['path'] = str_replace('index.php/index.php', 'index.php', $post_parts['path']); + // incase permalink_structure contains index.php + if (!empty($generated_parts['query']) && empty($post_parts['query'])) { + $post_parts['query'] = $generated_parts['query']; + } + $generated_url = $this->object->construct_url_from_parts($post_parts); + } + return $generated_url; + } + public function join_paths() + { + $args = func_get_args(); + return $this->get_router()->join_paths($args); + } + public function passthru() + { + $router = C_Router::get_instance(); + $_SERVER['ORIG_REQUEST_URI'] = $_SERVER['REQUEST_URI']; + $base_parts = parse_url($router->get_base_url('root')); + $new_request_uri = $router->join_paths(!empty($base_parts['path']) ? $base_parts['path'] : '', $this->object->strip_param_segments($router->get_request_uri())); + $new_request_uri = str_replace('index.php/index.php', 'index.php', $new_request_uri); + $_SERVER['UNENCODED_URL'] = $_SERVER['HTTP_X_ORIGINAL_URL'] = $_SERVER['REQUEST_URI'] = '/' . trailingslashit($new_request_uri); + if (isset($_SERVER['PATH_INFO'])) { + $_SERVER['ORIG_PATH_INFO'] = $_SERVER['PATH_INFO']; + unset($_SERVER['PATH_INFO']); + } + } +} \ No newline at end of file diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/wpcli/module.wpcli.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/wpcli/module.wpcli.php new file mode 100644 index 0000000000000000000000000000000000000000..65c1ba2c2407dbb9cc5636d935bbdb1a4ba260e7 --- /dev/null +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/wpcli/module.wpcli.php @@ -0,0 +1,106 @@ +<?php + +/*** +{ +Module: photocrati-wpcli +} + ***/ +class M_WPCLI extends C_Base_Module +{ + function define() + { + parent::define( + 'photocrati-wpcli', + 'WP-CLI Integration', + "Provides additional commands for WP-CLI (https://github.com/wp-cli/wp-cli", + '0.1', + 'http://www.nextgen-gallery.com', + 'Photocrati Media', + 'http://www.photocrati.com' + ); + } + + function initialize() + { + parent::initialize(); + } + + function get_type_list() + { + return array(); + } +} + +new M_WPCLI(); + +if (defined('WP_CLI') && WP_CLI && class_exists('WP_CLI_Command', FALSE)) { + /** + * Manage NextGen Gallery + */ + class C_NGG_WPCLI extends WP_CLI_Command + { + /** + * Flushes NextGen Gallery caches + */ + function flush_cache($args, $assoc_args) + { + C_Photocrati_Transient_Manager::flush(); + WP_CLI::success('Flushed all caches'); + } + + /** + * Create a new gallery + * + * @synopsis <gallery-name> --author=<user_login> + */ + function create_gallery($args, $assoc_args) + { + $mapper = C_Gallery_Mapper::get_instance(); + + $user = get_user_by('login', $assoc_args['author']); + if (!$user) + WP_CLI::error("Unable to find user {$assoc_args['author']}"); + + if (($gallery = $mapper->create(array('title' => $args[0], 'author' => $user->ID))) && $gallery->save()) + { + $gallery_id = $retval = $gallery->id(); + WP_CLI::success("Created gallery with id #{$gallery_id}"); + } + else { + WP_CLI::error("Unable to create gallery"); + } + } + + /** + * Import an image from the filesystem into NextGen + * + * @synopsis --filename=<absolute-path> --gallery=<gallery-id> + */ + function import_image($args, $assoc_args) + { + $mapper = C_Gallery_Mapper::get_instance(); + $storage = C_Gallery_Storage::get_instance(); + + if (($gallery = $mapper->find($assoc_args['gallery'], TRUE))) + { + $file_data = @file_get_contents($assoc_args['filename']); + $file_name = M_I18n::mb_basename($assoc_args['filename']); + + if (empty($file_data)) + WP_CLI::error('Could not load file'); + + $image = $storage->upload_base64_image($gallery, $file_data, $file_name); + $image_id = $image->{$image->id_field}; + if (!$image) + WP_CLI::error('Could not import image'); + else + WP_CLI::success("Imported image with id #{$image_id}"); + } + else { + WP_CLI::error("Gallery not found (with id #{$assoc_args['gallery']}"); + } + } + } + + WP_CLI::add_command('ngg', 'C_NGG_WPCLI' ); +} diff --git a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/product.photocrati_nextgen.php b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/product.photocrati_nextgen.php index a3219743b923484f4a37259d4ea95bb6f23cbbe4..cb7a37290dc5fde230f8bf0dc8d4dbaa9ac8416b 100755 --- a/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/product.photocrati_nextgen.php +++ b/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/product.photocrati_nextgen.php @@ -10,44 +10,82 @@ define('NGG_CHANGE_OPTIONS_CAP', 'NextGEN Manage gallery'); class P_Photocrati_NextGen extends C_Base_Product { - static $modules = array( - 'photocrati-fs', - 'photocrati-i18n', - 'photocrati-validation', - 'photocrati-router', - 'photocrati-wordpress_routing', - 'photocrati-security', - 'photocrati-lzw', - 'photocrati-nextgen_settings', - 'photocrati-mvc', - 'photocrati-ajax', - 'photocrati-dynamic_stylesheet', - 'photocrati-frame_communication', - 'photocrati-datamapper', - 'photocrati-nextgen-legacy', - 'photocrati-nextgen-data', - 'photocrati-dynamic_thumbnails', - 'photocrati-nextgen_admin', - 'photocrati-nextgen_addgallery_page', - 'photocrati-nextgen_pagination', - 'photocrati-nextgen_gallery_display', - 'photocrati-attach_to_post', - 'photocrati-nextgen_other_options', - 'photocrati-nextgen_pro_upgrade', - 'photocrati-mediarss', - 'photocrati-cache', - 'photocrati-lightbox', - 'photocrati-nextgen_basic_templates', - 'photocrati-nextgen_basic_gallery', - 'photocrati-nextgen_basic_imagebrowser', - 'photocrati-nextgen_basic_singlepic', - 'photocrati-nextgen_basic_tagcloud', - 'photocrati-nextgen_basic_album', - 'photocrati-widget', - 'photocrati-third_party_compat', - 'photocrati-nextgen_xmlrpc' + static $modules_provided = array( + 'photocrati-fs' => 'always', + 'photocrati-i18n' => 'always', + 'photocrati-validation' => 'always', + 'photocrati-router' => 'always', + 'photocrati-wordpress_routing' => 'always', + 'photocrati-security' => 'always', + 'photocrati-nextgen_settings' => 'always', + 'photocrati-mvc' => 'always', + 'photocrati-ajax' => 'always', + 'photocrati-datamapper' => 'always', + 'photocrati-nextgen-legacy' => 'always', + 'photocrati-nextgen-data' => 'always', + + // We should look at how to make the modules below only + // require loading in wp-admin + 'photocrati-dynamic_thumbnails' => 'always', + 'photocrati-nextgen_admin' => 'always', + 'photocrati-nextgen_gallery_display' => 'always', + 'photocrati-frame_communication' => 'always', + 'photocrati-attach_to_post' => 'always', + 'photocrati-nextgen_addgallery_page' => 'always', + 'photocrati-nextgen_other_options' => 'always', + 'photocrati-nextgen_pagination' => 'always', + + // Front-end only + 'photocrati-dynamic_stylesheet' => 'frontend', + 'photocrati-mediarss' => 'frontend', + + // Backend-only + 'photocrati-nextgen_pro_upgrade' => 'backend', + + 'photocrati-cache' => 'always', + 'photocrati-lightbox' => 'always', + 'photocrati-nextgen_basic_templates' => 'always', + 'photocrati-nextgen_basic_gallery' => 'always', + 'photocrati-nextgen_basic_imagebrowser' => 'always', + 'photocrati-nextgen_basic_singlepic' => 'always', + 'photocrati-nextgen_basic_tagcloud' => 'always', + 'photocrati-nextgen_basic_album' => 'always', + 'photocrati-widget' => 'always', + 'photocrati-third_party_compat' => 'always', + 'photocrati-nextgen_xmlrpc' => 'always', + 'photocrati-wpcli' => 'always' ); + function get_modules_provided() + { + return array_keys(self::$modules_provided); + } + + function get_modules_to_load() + { + $retval = array(); + + foreach (self::$modules_provided as $module_name => $condition) { + switch ($condition) { + case 'always': + $retval[] = $module_name; + break; + case 'backend': + if (is_admin()) + $retval[] = $module_name; + break; + case 'frontend': + if (!is_admin()) + $retval[] = $module_name; + break; + } + } + + $retval = apply_filters('ngg_get_modules_to_load', $retval, self::$modules_provided); + + return $retval; + } + function define() { parent::define( @@ -62,9 +100,7 @@ class P_Photocrati_NextGen extends C_Base_Product $module_path = implode(DIRECTORY_SEPARATOR, array(dirname(__FILE__), 'modules')); $this->get_registry()->set_product_module_path($this->module_id, $module_path); - $this->get_registry()->add_module_path($module_path, TRUE, FALSE); - - foreach (self::$modules as $module_name) $this->_get_registry()->load_module($module_name); + foreach ($this->get_modules_to_load() as $module_name) $this->_get_registry()->load_module($module_name); include_once('class.nextgen_product_installer.php'); C_Photocrati_Installer::add_handler($this->module_id, 'C_NextGen_Product_Installer'); diff --git a/wp-content/plugins/nextgen-gallery/readme.txt b/wp-content/plugins/nextgen-gallery/readme.txt index 7c591bc1954211605da12badf597ba17ef836657..d22477a779305999a0402c95e57bb86da17be11f 100644 --- a/wp-content/plugins/nextgen-gallery/readme.txt +++ b/wp-content/plugins/nextgen-gallery/readme.txt @@ -1,18 +1,18 @@ === NextGEN Gallery === Contributors: photocrati -Tags:gallery,image,images,photo,photos,picture,pictures,slideshow,flash,media,thumbnails,photo-albums,nextgen-gallery,nextgen +Tags: nextgen, nextgen gallery, gallery, galleries, image, images, image gallery, photo, photos, photo gallery, picture, pictures, picture gallery, album, albums, photo albums, image album, media, media gallery, thumbnails, thumbnail gallery, thumbnail galleries, slideshow, slideshows, slideshow gallery, slideshow galleries, fancybox, lightbox, responsive, responsive gallery, responsive galleries, wordpress responsive gallery, nextcellent, wordpress gallery plugin, wordpress photo gallery plugin, wp gallery, wp gallery plugins, best gallery plugin, free photo gallery, singlepic, image captions imagebrowser, watermarks, watermarking, photography, photographer Requires at least: 3.6.1 -Tested up to: 4.0 -Stable tag: trunk +Tested up to: 4.2.2 +Stable tag: 2.1.2 License: GPLv2 -The most popular WordPress gallery plugin and one of the most popular plugins of all time with over 10 million downloads. +The most popular WordPress gallery plugin and one of the most popular plugins of all time with over 12 million downloads. == Description == = WordPress Gallery Plugin = -NextGEN Gallery is the most popular **WordPress gallery plugin**, and one of the most popular WordPress plugins of all time, with over 10 million downloads. +NextGEN Gallery is the most popular **WordPress gallery plugin**, and one of the most popular WordPress plugins of all time, with over 12 million downloads. It provides a powerful engine for uploading and managing galleries of images, with the ability to batch upload, import meta data, add/delete/rearrange/sort images, edit thumbnails, group galleries into albums, and more. It also provides two front-end display styles (slideshows and thumbnail galleries), both of which come with a wide array of options for controlling size, style, timing, transitions, controls, lightbox effects, and more. @@ -199,6 +199,172 @@ For more information, feel free to visit the official website for the NextGEN Ga == Changelog == += V2.1.2 - 07.20.2015 = +* NEW: Ability to import from Media Library +* NEW: Added filter 'ngg_datamapper_table_name' +* NEW: Added filter `ngg_legacy_template_directories` for legacy template locator (thanks Ross McKay) +* NEW: Pagination available onManage Images page +* NEW: Added filter ngg_manage_images_items_per_page_array to control pagination options +* NEW: Added filters 'ngg_load_frontend_logic' and 'ngg_get_modules_to_load' +* NEW: Added filter 'ngg_add_page_shortcode' to control Manage Galleries > 'Create new page' content +* NEW: Added filter 'ngg_manage_albums_items_order' +* Changed: Removed PHP4 support +* Fixed: Ability to set NextGEN Image as Featured Image +* Fixed: Don't use resource manager in download requests for WP Photo Shelter +* Fixed: Updated custom jQuery-UI styling to resemble WordPress postbox styling +* Fixed: Styled plupload buttons to resemble WordPress buttons +* Fixed: Removed 'fixed' class from manage galleries table. Allows columns to adjust to content +* Fixed: Removed note about flash support and fixed typoe (thanks Rene Wolf) +* Fixed: Fixed typo in nggallery.po +* Fixed: Cache results of lookup_columns() to avoid multiple identical queries; thanks go to Alex Bradaric +* Fixed: Better WP-CPI detection +* Fixed: Removed unnecessary calls to parent::initialize() +* Fixed: Adjusted album-compact template to always include p.ngg-album-gallery-image-counter +* Fixed: Replaced empty gallery rendering in is_feed() with a link +* Fixed: Removed default settings for imagerotator, which is no longer supported +* Fixed: Optimizated scanning of images when importing a gallery +* Fixed: When a gallery is deleted, ensure that DB and filesystem are purged +* Fixed: Removed Insert Gallery Window box shadow +* Fixed: Ensure that file_exists() calls are prefixed with @ + += V2.1.0 - 05.18.2015 = +* NEW: Album breadcrumbs and pagination +* NEW: Ability to override builtin MVC templates +* NEW: Robust transient management +* NEW: Added the ability to set post thumbnails via XML-RPC module +* NEW: Added 'ngg_get_image_size_params' filter to control image generation +* NEW: Added 'ngg_basic_tagcloud_title' and 'ngg_basic_tagcloud_excluded_display_types' filters +* NEW: Added ngg_manage_images_items_per_page filter +* NEW: Added "ngg_get_image_url" filter +* NEW: Including Ukranian and Polish translations +* NEW: The ability to set template in widgets +* Changed: Default thumbnail dimensions set to 240x160 +* Changed: Product now adheres to Pope 0.12 and provides get_modules_to_load() +* Changed: Updated translations +* Changed: Removed link to capsman plugin in Roles accordion +* Changed: Taxnomies now use internationalized strings +* Changed: Image date/time meta data fields are stored as UNIX timestamps +* Secured: Uploading zips +* Fixed: Various PHP warnings and notices +* Fixed: Compatibility fixes for WPML +* Fixed: Ensure that backup image functionality fails gracefully +* Fixed: WP option 'ngg_do_upgrade' updated in every HTTP request +* Fixed; Empty $_SERVER['PATHINFO'] causing multiple routing issues +* Fixed: "Manage Galleries" display image alttext in the filename column +* Fixed: Various issues with the tag cloud display type +* Fixed: Integrity check when updating from 1.9.x +* Fixed: Image filenames substituting spaces for + which is only proper in the query string +* Fixed: Insert Gallery Window not working with nested levels of gzip compression +* Fixed: Imagebrowser as lightbox effect not working with pagination +* Fixed: Compatibility with MultiVerso Advanced File Sharing +* Fixed: "Add page" button not displaying on the next immediate page load +* Fixed: Double-escaping of non-latin characters +* Fixed: Imagebrowser pagination with custom templates +* Fixed: Custom CSS is enqueued late to ensure it's one of the last stylesheets loaded +* Fixed: Fixed watermarking PNG images +* Fixed: Using the "Import Metadata" bulk action overwrites existing data +* Fixed: Seconds were not retained from CaptureTime EXIF field +* Fixed: Conflicts created by our TinyMCE plugin +* Fixed: Image mapper setting gid to gallery name, not the unique ID +* Fixed: Restored nggdb->get_random_images(), nggdb->search_for_file, and nggdb->find_all_albums() +* Fixed: Allow gallery slug as parameter to nggdb::get_gallery() +* Fixed: Don't minify Plupload's i18n JavaScript +* Fixed: Custom template images not being given their full effect code attributes +* Fixed: When importing galleries from folders, allow symlinks +* Fixed: Use of C_Gallery_Mapper in C_Image_Wrapper +* Fixed: Properly handle themes that don't call wp_footer() or wp_print_footer_scripts() +* Fixed: Warning about missing style.php file on Network Admin -> Gallery page +* Fixed: Warning about getimagesize() failure when backing up an image + += v2.0.79 - 03.20.2015 = +* Secured: Sanitized C_Displayed_Gallery->_add_find_in_set_column() third parameter + += V2.0.78.1 - 03.12.2015 = +* Changed: Image date/time meta data fields are stored as UNIX timestamps +* Fixed: When importing galleries from folders, allow symlinks +* Fixed: Use of C_Gallery_Mapper in C_Image_Wrapper +* Fixed: Properly handle themes that don't call wp_footer() or wp_print_footer_scripts() +* Fixed: Warning about missing style.php file on Network Admin -> Gallery page +* Fixed: Warning about getimagesize() failure when backing up an image + += V2.0.78 - 03.12.2015 = +* Secured: AJAX actions for uploading images and importing folders now uses nonce checks + += V2.0.77 - 03.05.2015 = +* NEW: Added "ngg_get_image_url" filter +* Changed: Use a more reliable means of excluding Pro/Plus modules from using minified static resources +* Fixed: Imagebrowser pagination with custom templates +* Fixed: Custom CSS is enqueued late to ensure it's one of the last stylesheets loaded +* Fixed: Fixed watermarking PNG images +* Fixed: Using the "Import Metadata" bulk action overwrites existing data +* Fixed: Seconds were not retained from CaptureTime EXIF field +* Fixed: Conflicts created by our TinyMCE plugin +* Fixed: Image mapper setting gid to gallery name, not the unique ID +* Fixed: Restored nggdb->get_random_images(), nggdb->search_for_file, and nggdb->find_all_albums() +* Fixed: Allow gallery slug as parameter to nggdb::get_gallery() +* Fixed: Don't minify Plupload's i18n JavaScript +* Fixed: Custom template images not being given their full effect code attributes + += V2.0.76 - 02.24.2015 = +* Fixed: Compatibility checks for very old versions of NextGEN Pro +* Fixed: Zero-byte downloads in WooCommerce and WPE-Commerce +* Fixed: Invalid URL being enqueued if a custom lightbox is selected with no URL provided +* Fixed: Restored a method to nggAdmin to fix compatibility with NextGen Public Uploader +* Fixed: Bug preventing source='recent' from displaying images in the correct order +* Fixed: Include more quotation symbols in our shortcode manager (foreign language shortcodes) +* Fixed: WPML/ATP compatibility issue +* Fixed: $nggdb->get_gallery() returning a different result than before + += V2.0.74 - 02.20.2015 = +* Changed: Removed jQuery Lightbox and Highslide due to incompatible licensing with GPL + += V2.0.71 - 02.19.2015 = +* NEW: Module files are compiled into a single package file to reduce disk I/O +* NEW: All CSS stylesheets and Javascript source files are minified to reduce latency +* NEW: All lightboxes are configured using an in-memory management class. +* NEW: Uses Pope 2.0, benefiting from the new caching capabilities +* NEW: NextGEN Gallery's functionality is disabled if NextGEN Pro is incompatible +* NEW: Added ngg_effect_code filter +* Changed: Updated FontAwesome to 4.3.0 +* Changed: Updated select2 to 3.5.2 +* Changed: Removed PicLens / CoolIris integration +* Changed: Removed JSON API. Please use XML-RPC API instead +* Changed: For performance reasons, we cache FS & url lookups/calculations +* Changed: Greatly reduced the # of sql queries, and eliminated anything redundant +* Changed: For performance reasons, we cache datamapper and SQL queries +* Changed: Don't enqueue scripts or styles unless we require them +* Changed: Reduce the number of resources we enqueue for every HTTP request +* Changed: Ngg_Store now uses cookies instead of localStorage +* Changed: Insert Gallery Window is routed using wp-admin/admin_init +* Changed: Removed unused code from ngglegacy module. Created wrappers for commonly-used functions +* Changed: LZW module removed +* Changed: Legacy template drop-down selection now using select2 +* Secured: Restrict folder browsing to NGG_IMPORT_ROOT constant +* Fixed: Compatibility issue with PHP's transparent ZLIB compression +* Fixed: Imagebrowser as lightbox effect not working when non-default permalink slug used +* Fixed: Angled quotations marks used in shortcode parameters +* Fixed: Compatibility between ImageBrowser display type and TwentyFifteen theme +* Fixed: Allow pagination to retain query string url parameters when linking to other pages +* Fixed: Fixed pagination issues with slideshow galleries displayed as thumbnails +* Fixed: Fix C_GalleryStorage_Driver_Base->import_gallery_from_fs() not checking imgBackup +* Fixed: Fixed problem with default settings being applied multiple times +* Fixed: Fallback to "full" image sizes if "backup" images aren't available +* Fixed: Use M_DataMapper's serialization methods throughout the codebase +* Fixed: Conflict with WordPress SEO and get_the_excerpt() call +* Fixed: Don't run Resource Manager on wp-login.php or wp-sign.php +* Fixed: TinyMCE Image Editor conflict with Insert Gallery Window placeholder images +* Fixed: Fix Shutter positioning when admin bar is displayed +* Fixed: Allow deselection of a legacy template +* Fixed: Prevent conflicts when using imagebrowser as a lightbox effect +* Fixed: Pagination not working for slideshows using thumbnail integration + += V2.0.66.33 - 11.24.2014 = +* Fixed: Broken NextGEN Pro ecommerce-related shortcodes +* Fixed: Spanish PO file + += V2.0.66.31 - 11.21.2014 = +* Fixed: Broken shortcodes with WordPress 4.0.1 + = V2.0.66.29 - 09.17.2014 = * NEW: Added skip_excluding_globally_excluded_images property to displayed gallery objects * Fixed: SQL generation for random image selection @@ -208,7 +374,7 @@ For more information, feel free to visit the official website for the NextGEN Ga * Fixed: Ability to override image files using XML-RPC = V2.0.66.27 - 08.18.2014 = -* Fixed: Missing class.frame_communication_option_handerl.php error +* Fixed: Missing class.frame_communication_option_handler.php error = V2.0.66.26 - 08.18.2014 = * NEW: Added fault tolerance to bulk action AJAX requests