7268c45b by Jeff Balicki

emails

1 parent ad31dfdd
Showing 82 changed files with 1822 additions and 336 deletions
...@@ -35,9 +35,24 @@ ...@@ -35,9 +35,24 @@
35 /* 35 /*
36 * Welcome Panel 36 * Welcome Panel
37 */ 37 */
38 .welcome-panel .welcome-panel-column, 38 .wpcf7-welcome-panel .welcome-panel-close {
39 .welcome-panel .welcome-panel-column:first-child { 39 left: 10px;
40 padding: 0 0 0 2%; 40 right: auto;
41 padding: 10px 21px 10px 15px;
42 }
43
44 .wpcf7-welcome-panel .welcome-panel-close::before {
45 right: 0;
46 left: auto;
47 }
48
49 .wpcf7-welcome-panel .welcome-panel-content {
50 margin-right: 13px;
51 }
52
53 .wpcf7-welcome-panel .welcome-panel-column {
54 float: right;
55 padding: 0 0 0 2%;
41 } 56 }
42 57
43 /* 58 /*
......
...@@ -359,30 +359,26 @@ ul.config-error li { ...@@ -359,30 +359,26 @@ ul.config-error li {
359 /* 359 /*
360 * Welcome Panel 360 * Welcome Panel
361 */ 361 */
362 .welcome-panel .welcome-panel-column, 362 .wpcf7-welcome-panel {
363 .welcome-panel .welcome-panel-column:first-child { 363 position: relative;
364 width: 48%; 364 overflow: auto;
365 padding: 0 2% 0 0; 365 margin: 16px 0;
366 margin: 0 0 1em 0; 366 padding: 23px 10px 0;
367 } 367 border: 1px solid #c3c4c7;
368 368 box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
369 @media screen and (max-width: 870px) { 369 background: #fff;
370 .welcome-panel .welcome-panel-column, 370 font-size: 13px;
371 .welcome-panel .welcome-panel-column:first-child { 371 line-height: 1.7;
372 display: block;
373 float: none;
374 width: 100%;
375 }
376 } 372 }
377 373
378 .welcome-panel h3 { 374 .wpcf7-welcome-panel h3 {
379 font-size: 16px; 375 font-size: 16px;
380 font-weight: 600; 376 font-weight: 600;
381 line-height: 2.1em; 377 line-height: 2.1em;
382 margin: 1em 0 1.2em; 378 margin: 1em 0 1.2em;
383 } 379 }
384 380
385 .welcome-panel h3 .dashicons { 381 .wpcf7-welcome-panel h3 .dashicons {
386 position: relative; 382 position: relative;
387 top: -2px; 383 top: -2px;
388 display: inline-block; 384 display: inline-block;
...@@ -391,12 +387,75 @@ ul.config-error li { ...@@ -391,12 +387,75 @@ ul.config-error li {
391 font-size: 40px; 387 font-size: 40px;
392 } 388 }
393 389
394 .welcome-panel p a { 390 .wpcf7-welcome-panel p {
391 color: #646970;
392 }
393
394 .wpcf7-welcome-panel p a {
395 font-weight: bold; 395 font-weight: bold;
396 } 396 }
397 397
398 .welcome-panel-close { 398 .wpcf7-welcome-panel .welcome-panel-close {
399 position: absolute;
399 z-index: 2; 400 z-index: 2;
401 top: 10px;
402 right: 10px;
403 padding: 10px 15px 10px 21px;
404 font-size: 13px;
405 line-height: 1.23076923; /* Chrome rounding, needs to be 16px equivalent */
406 text-decoration: none;
407 }
408
409 .wpcf7-welcome-panel .welcome-panel-close::before {
410 background: 0 0;
411 color: #787c82;
412 content: "\f153";
413 display: block;
414 font: normal 16px/20px dashicons;
415 speak: never;
416 height: 20px;
417 text-align: center;
418 width: 20px;
419 -webkit-font-smoothing: antialiased;
420 -moz-osx-font-smoothing: grayscale;
421 position: absolute;
422 top: 8px;
423 left: 0;
424 transition: all .1s ease-in-out;
425 }
426
427 .wpcf7-welcome-panel .welcome-panel-content {
428 display: block;
429 margin-left: 13px;
430 max-width: 1500px;
431 min-height: auto;
432 }
433
434 .wpcf7-welcome-panel .welcome-panel-column-container {
435 clear: both;
436 position: relative;
437 }
438
439 .wpcf7-welcome-panel .welcome-panel-column {
440 display: block;
441 width: 48%;
442 min-width: 200px;
443 float: left;
444 padding: 0 2% 0 0;
445 margin: 0 0 1em 0;
446 }
447
448 @media screen and (max-width: 870px) {
449 .wpcf7-welcome-panel .welcome-panel-column {
450 display: block;
451 float: none;
452 width: 100%;
453 }
454 }
455
456 .wpcf7-welcome-panel .welcome-panel-column p {
457 margin-top: 7px;
458 color: #3c434a;
400 } 459 }
401 460
402 /* 461 /*
......
...@@ -200,7 +200,7 @@ function wpcf7_welcome_panel() { ...@@ -200,7 +200,7 @@ function wpcf7_welcome_panel() {
200 $columns[] = new WPCF7_WelcomePanelColumn_Integration(); 200 $columns[] = new WPCF7_WelcomePanelColumn_Integration();
201 } 201 }
202 202
203 $classes = 'welcome-panel'; 203 $classes = 'wpcf7-welcome-panel';
204 204
205 $vers = (array) get_user_meta( get_current_user_id(), 205 $vers = (array) get_user_meta( get_current_user_id(),
206 'wpcf7_hide_welcome_panel_on', true 206 'wpcf7_hide_welcome_panel_on', true
...@@ -211,7 +211,7 @@ function wpcf7_welcome_panel() { ...@@ -211,7 +211,7 @@ function wpcf7_welcome_panel() {
211 } 211 }
212 212
213 ?> 213 ?>
214 <div id="welcome-panel" class="<?php echo esc_attr( $classes ); ?>"> 214 <div id="wpcf7-welcome-panel" class="<?php echo esc_attr( $classes ); ?>">
215 <?php wp_nonce_field( 'wpcf7-welcome-panel-nonce', 'welcomepanelnonce', false ); ?> 215 <?php wp_nonce_field( 'wpcf7-welcome-panel-nonce', 'welcomepanelnonce', false ); ?>
216 <a class="welcome-panel-close" href="<?php echo esc_url( menu_page_url( 'wpcf7', false ) ); ?>"><?php echo esc_html( __( 'Dismiss', 'contact-form-7' ) ); ?></a> 216 <a class="welcome-panel-close" href="<?php echo esc_url( menu_page_url( 'wpcf7', false ) ); ?>"><?php echo esc_html( __( 'Dismiss', 'contact-form-7' ) ); ?></a>
217 217
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
7 } 7 }
8 8
9 $( function() { 9 $( function() {
10 var welcomePanel = $( '#welcome-panel' ); 10 var welcomePanel = $( '#wpcf7-welcome-panel' );
11 var updateWelcomePanel; 11 var updateWelcomePanel;
12 12
13 updateWelcomePanel = function( visible ) { 13 updateWelcomePanel = function( visible ) {
......
1 !function(){"use strict";var e={n:function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,{a:r}),r},d:function(t,r){for(var c in r)e.o(r,c)&&!e.o(t,c)&&Object.defineProperty(t,c,{enumerable:!0,get:r[c]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}},t=window.wp.element,r=window.wp.i18n,c=window.wp.blocks,n=(0,t.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 242.5 239.46"},(0,t.createElement)("defs",null,(0,t.createElement)("clipPath",{id:"clip-path",transform:"translate(1.72)"},(0,t.createElement)("circle",{className:"cls-1",cx:"119.73",cy:"119.73",r:"116.15",fill:"none"}))),(0,t.createElement)("g",{id:"Layer_2","data-name":"Layer 2"},(0,t.createElement)("g",{id:"Layer_1","data-name":"Layer 1"},(0,t.createElement)("g",{className:"cls-2",clipPath:"url(#clip-path)"},(0,t.createElement)("circle",{className:"cls-3",cx:"121.45",cy:"119.73",r:"116.15",fill:"#33c6f4"}),(0,t.createElement)("path",{className:"cls-4",d:"M239.32,167.79c-53.41-24-108.37-91.46-113-94.55s-10.84.77-10.84.77c-3.87-6.19-10.06.77-10.06.77C76.77,123.55.14,170.11.14,170.11S36.94,237.79,122,237.79C208.48,237.79,239.32,167.79,239.32,167.79Z",transform:"translate(1.72)",fill:"#1b447e"}),(0,t.createElement)("path",{className:"cls-5",d:"M67.48,116.58s15.48-7,12.38,4.65-15.48,28.64-11.61,29.41S83,140.58,86.06,142.12s5.42.78,3.87,6.2-3.1,9.29,0,9.29,5.42-7,9.29-13.94,10.06-3.87,12.38-1.55,9.29,15.49,14.71,13.94,8.51-8.52,6.19-24,1.55-20.12,1.55-20.12,4.64-2.32,13.16,8.51,24,27.09,26.31,26.32-10.83-17.8-7.74-19.35,15.48,2.32,21.68,7.74c0,0,2.12,8.87,2.12.36L126.31,73.24,115.47,74l-10.06.77S80.64,111.94,67.48,116.58Z",transform:"translate(1.72)",fill:"#fff"}),(0,t.createElement)("path",{className:"cls-6",d:"M239.32,170.11c-53.41-24-108.37-93.78-113-96.87s-10.84.77-10.84.77c-3.87-6.19-10.06.77-10.06.77C76.77,123.55.14,170.11.14,170.11",transform:"translate(1.72)",fill:"none",stroke:"#221e1f",strokeMiterlimit:"10",strokeWidth:"8px"})),(0,t.createElement)("circle",{className:"cls-6",cx:"121.45",cy:"119.73",r:"116.15",fill:"none",stroke:"#1b447e",strokeMiterlimit:"10",strokeWidth:"8px"})))),a=window.wp.apiFetch,o=e.n(a),l=window.wp.compose,s=window.wp.components;const i=new Map;o()({path:"contact-form-7/v1/contact-forms?per_page=20"}).then((e=>{Object.entries(e).forEach((([e,t])=>{i.set(t.id,t)}))}));var m={from:[{type:"shortcode",tag:"contact-form-7",attributes:{id:{type:"integer",shortcode:function(e){var t=e.named.id;return parseInt(t)}},title:{type:"string",shortcode:function(e){return e.named.title}}}}],to:[{type:"block",blocks:["core/shortcode"],transform:function(e){return(0,c.createBlock)("core/shortcode",{text:'[contact-form-7 id="'.concat(e.id,'" title="').concat(e.title,'"]')})}}]};(0,c.registerBlockType)("contact-form-7/contact-form-selector",{title:(0,r.__)("Contact Form 7","contact-form-7"),description:(0,r.__)("Insert a contact form you have created with Contact Form 7.","contact-form-7"),category:"widgets",attributes:{id:{type:"integer"},title:{type:"string"}},icon:n,transforms:m,edit:function e({attributes:c,setAttributes:n}){if(!i.size&&!c.id)return(0,t.createElement)("div",{className:"components-placeholder"},(0,t.createElement)("p",null,(0,r.__)("No contact forms were found. Create a contact form first.","contact-form-7")));const a=Array.from(i.values(),(e=>({value:e.id,label:e.title})));if(c.id)a.length||a.push({value:c.id,label:c.title});else{const e=a[0];c={id:parseInt(e.value),title:e.label}}const o=`contact-form-7-contact-form-selector-${(0,l.useInstanceId)(e)}`;return(0,t.createElement)("div",{className:"components-placeholder"},(0,t.createElement)("label",{htmlFor:o,className:"components-placeholder__label"},(0,r.__)("Select a contact form:","contact-form-7")),(0,t.createElement)(s.SelectControl,{id:o,options:a,value:c.id,onChange:e=>n({id:parseInt(e),title:i.get(parseInt(e)).title})}))},save:function(e){var r=e.attributes;return(0,t.createElement)("div",null,'[contact-form-7 id="',r.id,'" title="',r.title,'"]')}})}();
...\ No newline at end of file ...\ No newline at end of file
1 !function(){"use strict";var t,e={n:function(t){var c=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(c,{a:c}),c},d:function(t,c){for(var r in c)e.o(c,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:c[r]})},o:function(t,e){return Object.prototype.hasOwnProperty.call(t,e)}},c=window.wp.element,r=window.wp.apiFetch,o=e.n(r),n=window.wp.i18n,a=window.wp.blocks,l=(0,c.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 242.5 239.46"},(0,c.createElement)("defs",null,(0,c.createElement)("clipPath",{id:"clip-path",transform:"translate(1.72)"},(0,c.createElement)("circle",{className:"cls-1",cx:"119.73",cy:"119.73",r:"116.15",fill:"none"}))),(0,c.createElement)("g",{id:"Layer_2","data-name":"Layer 2"},(0,c.createElement)("g",{id:"Layer_1","data-name":"Layer 1"},(0,c.createElement)("g",{className:"cls-2",clipPath:"url(#clip-path)"},(0,c.createElement)("circle",{className:"cls-3",cx:"121.45",cy:"119.73",r:"116.15",fill:"#33c6f4"}),(0,c.createElement)("path",{className:"cls-4",d:"M239.32,167.79c-53.41-24-108.37-91.46-113-94.55s-10.84.77-10.84.77c-3.87-6.19-10.06.77-10.06.77C76.77,123.55.14,170.11.14,170.11S36.94,237.79,122,237.79C208.48,237.79,239.32,167.79,239.32,167.79Z",transform:"translate(1.72)",fill:"#1b447e"}),(0,c.createElement)("path",{className:"cls-5",d:"M67.48,116.58s15.48-7,12.38,4.65-15.48,28.64-11.61,29.41S83,140.58,86.06,142.12s5.42.78,3.87,6.2-3.1,9.29,0,9.29,5.42-7,9.29-13.94,10.06-3.87,12.38-1.55,9.29,15.49,14.71,13.94,8.51-8.52,6.19-24,1.55-20.12,1.55-20.12,4.64-2.32,13.16,8.51,24,27.09,26.31,26.32-10.83-17.8-7.74-19.35,15.48,2.32,21.68,7.74c0,0,2.12,8.87,2.12.36L126.31,73.24,115.47,74l-10.06.77S80.64,111.94,67.48,116.58Z",transform:"translate(1.72)",fill:"#fff"}),(0,c.createElement)("path",{className:"cls-6",d:"M239.32,170.11c-53.41-24-108.37-93.78-113-96.87s-10.84.77-10.84.77c-3.87-6.19-10.06.77-10.06.77C76.77,123.55.14,170.11.14,170.11",transform:"translate(1.72)",fill:"none",stroke:"#221e1f",strokeMiterlimit:"10",strokeWidth:"8px"})),(0,c.createElement)("circle",{className:"cls-6",cx:"121.45",cy:"119.73",r:"116.15",fill:"none",stroke:"#1b447e",strokeMiterlimit:"10",strokeWidth:"8px"})))),i=window.wp.compose,s=window.wp.components,m={from:[{type:"shortcode",tag:"contact-form-7",attributes:{id:{type:"integer",shortcode:t=>{let{named:{id:e}}=t;return parseInt(e)}},title:{type:"string",shortcode:t=>{let{named:{title:e}}=t;return e}}}}],to:[{type:"block",blocks:["core/shortcode"],transform:t=>(0,a.createBlock)("core/shortcode",{text:`[contact-form-7 id="${t.id}" title="${t.title}"]`})}]};window.wpcf7=null!==(t=window.wpcf7)&&void 0!==t?t:{},o()({path:"contact-form-7/v1/contact-forms?per_page=20"}).then((t=>{window.wpcf7.contactForms=t})),(0,a.registerBlockType)("contact-form-7/contact-form-selector",{title:(0,n.__)("Contact Form 7","contact-form-7"),description:(0,n.__)("Insert a contact form you have created with Contact Form 7.","contact-form-7"),category:"widgets",attributes:{id:{type:"integer"},title:{type:"string"}},icon:l,transforms:m,edit:function t(e){let{attributes:r,setAttributes:o}=e;const a=new Map;if(Object.entries(window.wpcf7.contactForms).forEach((t=>{let[e,c]=t;a.set(c.id,c)})),!a.size&&!r.id)return(0,c.createElement)("div",{className:"components-placeholder"},(0,c.createElement)("p",null,(0,n.__)("No contact forms were found. Create a contact form first.","contact-form-7")));const l=Array.from(a.values(),(t=>({value:t.id,label:t.title})));if(r.id)l.length||l.push({value:r.id,label:r.title});else{const t=l[0];r={id:parseInt(t.value),title:t.label}}const m=`contact-form-7-contact-form-selector-${(0,i.useInstanceId)(t)}`;return(0,c.createElement)("div",{className:"components-placeholder"},(0,c.createElement)("label",{htmlFor:m,className:"components-placeholder__label"},(0,n.__)("Select a contact form:","contact-form-7")),(0,c.createElement)(s.SelectControl,{id:m,options:l,value:r.id,onChange:t=>o({id:parseInt(t),title:a.get(parseInt(t)).title})}))},save:t=>{var e,r,o,n;let{attributes:a}=t;return a={id:null!==(e=a.id)&&void 0!==e?e:null===(r=window.wpcf7.contactForms[0])||void 0===r?void 0:r.id,title:null!==(o=a.title)&&void 0!==o?o:null===(n=window.wpcf7.contactForms[0])||void 0===n?void 0:n.title},(0,c.createElement)("div",null,'[contact-form-7 id="',a.id,'" title="',a.title,'"]')}})}();
...\ No newline at end of file ...\ No newline at end of file
......
1 <?php 1 <?php
2 /**
3 * Pipe-related classes.
4 *
5 * @link https://contactform7.com/selectable-recipient-with-pipes/
6 */
2 7
8
9 /**
10 * Class representing a pair of pipe.
11 */
3 class WPCF7_Pipe { 12 class WPCF7_Pipe {
4 13
5 public $before = ''; 14 public $before = '';
...@@ -19,6 +28,10 @@ class WPCF7_Pipe { ...@@ -19,6 +28,10 @@ class WPCF7_Pipe {
19 } 28 }
20 } 29 }
21 30
31
32 /**
33 * Class representing a list of pipes.
34 */
22 class WPCF7_Pipes { 35 class WPCF7_Pipes {
23 36
24 private $pipes = array(); 37 private $pipes = array();
...@@ -40,18 +53,12 @@ class WPCF7_Pipes { ...@@ -40,18 +53,12 @@ class WPCF7_Pipes {
40 ) ); 53 ) );
41 54
42 foreach ( $this->pipes as $pipe ) { 55 foreach ( $this->pipes as $pipe ) {
56 $before_canonical = wpcf7_canonicalize( $pipe->before, array(
57 'strto' => 'as-is',
58 ) );
43 59
44 list( $before, $after ) = array_map( 60 if ( $input_canonical === $before_canonical ) {
45 function ( $item ) { 61 return $pipe->after;
46 return wpcf7_canonicalize( $item, array(
47 'strto' => 'as-is',
48 ) );
49 },
50 array( $pipe->before, $pipe->after )
51 );
52
53 if ( $input_canonical === $before ) {
54 return $after;
55 } 62 }
56 } 63 }
57 64
......
...@@ -43,6 +43,7 @@ class WPCF7 { ...@@ -43,6 +43,7 @@ class WPCF7 {
43 self::load_module( 'count' ); 43 self::load_module( 'count' );
44 self::load_module( 'date' ); 44 self::load_module( 'date' );
45 self::load_module( 'disallowed-list' ); 45 self::load_module( 'disallowed-list' );
46 self::load_module( 'doi-helper' );
46 self::load_module( 'file' ); 47 self::load_module( 'file' );
47 self::load_module( 'flamingo' ); 48 self::load_module( 'flamingo' );
48 self::load_module( 'hidden' ); 49 self::load_module( 'hidden' );
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
3 wpcf7_include_module_file( 'constant-contact/service.php' ); 3 wpcf7_include_module_file( 'constant-contact/service.php' );
4 wpcf7_include_module_file( 'constant-contact/contact-post-request.php' ); 4 wpcf7_include_module_file( 'constant-contact/contact-post-request.php' );
5 wpcf7_include_module_file( 'constant-contact/contact-form-properties.php' ); 5 wpcf7_include_module_file( 'constant-contact/contact-form-properties.php' );
6 wpcf7_include_module_file( 'constant-contact/doi.php' );
6 7
7 8
8 add_action( 9 add_action(
...@@ -96,9 +97,27 @@ function wpcf7_constant_contact_submit( $contact_form, $result ) { ...@@ -96,9 +97,27 @@ function wpcf7_constant_contact_submit( $contact_form, $result ) {
96 return; 97 return;
97 } 98 }
98 99
99 if ( $email = $request_builder->get_email_address() 100 $email = $request_builder->get_email_address();
100 and $service->email_exists( $email ) ) { 101
101 return; 102 if ( $email ) {
103 if ( $service->email_exists( $email ) ) {
104 return;
105 }
106
107 $token = null;
108
109 do_action_ref_array( 'wpcf7_doi', array(
110 'wpcf7_constant_contact',
111 array(
112 'email_to' => $email,
113 'properties' => $request_builder->to_array(),
114 ),
115 &$token,
116 ) );
117
118 if ( isset( $token ) ) {
119 return;
120 }
102 } 121 }
103 122
104 $service->create_contact( $request_builder->to_array() ); 123 $service->create_contact( $request_builder->to_array() );
......
1 <?php
2 /**
3 * Double Opt-In Helper-related functions
4 *
5 * @link https://contactform7.com/doi-helper/
6 */
7
8
9 add_action(
10 'doihelper_init',
11 'wpcf7_constant_contact_doi_register_agent',
12 10, 0
13 );
14
15 /**
16 * Registers wpcf7_constant_contact as an agent.
17 */
18 function wpcf7_constant_contact_doi_register_agent() {
19 if ( ! function_exists( 'doihelper_register_agent' ) ) {
20 return;
21 }
22
23 doihelper_register_agent( 'wpcf7_constant_contact', array(
24 'optin_callback' => apply_filters(
25 'wpcf7_constant_contact_doi_optin_callback',
26 'wpcf7_constant_contact_doi_default_optin_callback'
27 ),
28 'email_callback' => apply_filters(
29 'wpcf7_constant_contact_doi_email_callback',
30 'wpcf7_constant_contact_doi_default_email_callback'
31 ),
32 ) );
33 }
34
35
36 /**
37 * Default optin_callback function.
38 */
39 function wpcf7_constant_contact_doi_default_optin_callback( $properties ) {
40 $service = WPCF7_ConstantContact::get_instance();
41
42 if ( $service->is_active() ) {
43 $service->create_contact( $properties );
44 }
45 }
46
47
48 /**
49 * Default email_callback function.
50 */
51 function wpcf7_constant_contact_doi_default_email_callback( $args ) {
52 if ( ! isset( $args['token'] ) or ! isset( $args['email_to'] ) ) {
53 return;
54 }
55
56 $site_title = wp_specialchars_decode(
57 get_bloginfo( 'name' ),
58 ENT_QUOTES
59 );
60
61 $link = add_query_arg(
62 array( 'doitoken' => $args['token'] ),
63 home_url()
64 );
65
66 $to = $args['email_to'];
67
68 $subject = sprintf(
69 /* translators: %s: blog name */
70 __( 'Opt-in confirmation from %s', 'contact-form-7' ),
71 $site_title
72 );
73
74 $message = sprintf(
75 /* translators: 1: blog name, 2: confirmation link */
76 __( 'Hello,
77
78 This is a confirmation email sent from %1$s.
79
80 We have received your submission to our web form, according to which you have allowed us to add you to our contact list. But, the process has not yet been completed. To complete it, please click the following link.
81
82 %2$s
83
84 If it was not your intention, or if you have no idea why you received this message, please do not click on the link, and ignore this message. We will never collect or use your personal data without your clear consent.
85
86 Sincerely,
87 %1$s', 'contact-form-7' ),
88 $site_title,
89 $link
90 );
91
92 wp_mail( $to, $subject, $message );
93 }
1 <?php
2 /**
3 * Double Opt-In Helper module
4 *
5 * @link https://contactform7.com/doi-helper/
6 */
7
8
9 add_action( 'wpcf7_doi', 'wpcf7_doihelper_start_session', 10, 3 );
10
11 /**
12 * Starts a double opt-in session.
13 */
14 function wpcf7_doihelper_start_session( $agent_name, $args, &$token ) {
15 if ( isset( $token ) ) {
16 return;
17 }
18
19 if ( ! function_exists( 'doihelper_start_session' ) ) {
20 return;
21 }
22
23 $submission = WPCF7_Submission::get_instance();
24
25 if ( ! $submission ) {
26 return;
27 }
28
29 $contact_form = $submission->get_contact_form();
30
31 $do_doi = ! array_filter(
32 $contact_form->additional_setting( 'doi', false ),
33 function ( $setting ) {
34 return in_array( $setting, array( 'off', 'false', '0' ), true );
35 }
36 );
37
38 $do_doi = apply_filters( 'wpcf7_do_doi', $do_doi, $agent_name, $args );
39
40 if ( ! $do_doi ) {
41 return;
42 }
43
44 $token = doihelper_start_session( $agent_name, $args );
45 }
1 document.addEventListener("DOMContentLoaded",(e=>{var t;wpcf7_recaptcha={...null!==(t=wpcf7_recaptcha)&&void 0!==t?t:{}};const c=wpcf7_recaptcha.sitekey,{homepage:n,contactform:a}=wpcf7_recaptcha.actions,o=e=>{const{action:t,func:n,params:a}=e;grecaptcha.execute(c,{action:t}).then((e=>{const c=new CustomEvent("wpcf7grecaptchaexecuted",{detail:{action:t,token:e}});document.dispatchEvent(c)})).then((()=>{"function"==typeof n&&n(...a)})).catch((e=>console.error(e)))};if(grecaptcha.ready((()=>{o({action:n})})),document.addEventListener("change",(e=>{o({action:a})})),"undefined"!=typeof wpcf7&&"function"==typeof wpcf7.submit){const e=wpcf7.submit;wpcf7.submit=(t,c={})=>{o({action:a,func:e,params:[t,c]})}}document.addEventListener("wpcf7grecaptchaexecuted",(e=>{const t=document.querySelectorAll('form.wpcf7-form input[name="_wpcf7_recaptcha_response"]');for(let c=0;c<t.length;c++)t[c].setAttribute("value",e.detail.token)}))}));
...\ No newline at end of file ...\ No newline at end of file
1 document.addEventListener("DOMContentLoaded",(t=>{var e;wpcf7_recaptcha={...null!==(e=wpcf7_recaptcha)&&void 0!==e?e:{}};const c=wpcf7_recaptcha.sitekey,{homepage:n,contactform:a}=wpcf7_recaptcha.actions,o=t=>{const{action:e,func:n,params:a}=t;grecaptcha.execute(c,{action:e}).then((t=>{const c=new CustomEvent("wpcf7grecaptchaexecuted",{detail:{action:e,token:t}});document.dispatchEvent(c)})).then((()=>{"function"==typeof n&&n(...a)})).catch((t=>console.error(t)))};if(grecaptcha.ready((()=>{o({action:n})})),document.addEventListener("change",(t=>{o({action:a})})),"undefined"!=typeof wpcf7&&"function"==typeof wpcf7.submit){const t=wpcf7.submit;wpcf7.submit=function(e){let c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};o({action:a,func:t,params:[e,c]})}}document.addEventListener("wpcf7grecaptchaexecuted",(t=>{const e=document.querySelectorAll('form.wpcf7-form input[name="_wpcf7_recaptcha_response"]');for(let c=0;c<e.length;c++)e[c].setAttribute("value",t.detail.token)}))}));
...\ No newline at end of file ...\ No newline at end of file
......
1 <?php
2 /**
3 * Double Opt-In Helper-related functions
4 *
5 * @link https://contactform7.com/doi-helper/
6 */
7
8
9 add_action(
10 'doihelper_init',
11 'wpcf7_sendinblue_doi_register_agent',
12 10, 0
13 );
14
15 /**
16 * Registers wpcf7_sendinblue as an agent.
17 */
18 function wpcf7_sendinblue_doi_register_agent() {
19 if ( ! function_exists( 'doihelper_register_agent' ) ) {
20 return;
21 }
22
23 doihelper_register_agent( 'wpcf7_sendinblue', array(
24 'optin_callback' => apply_filters(
25 'wpcf7_sendinblue_doi_optin_callback',
26 'wpcf7_sendinblue_doi_default_optin_callback'
27 ),
28 'email_callback' => apply_filters(
29 'wpcf7_sendinblue_doi_email_callback',
30 'wpcf7_sendinblue_doi_default_email_callback'
31 ),
32 ) );
33 }
34
35
36 /**
37 * Default optin_callback function.
38 */
39 function wpcf7_sendinblue_doi_default_optin_callback( $properties ) {
40 $service = WPCF7_Sendinblue::get_instance();
41
42 if ( ! $service->is_active() ) {
43 return;
44 }
45
46 if ( ! empty( $properties['contact'] ) ) {
47 $contact_id = $service->create_contact( $properties['contact'] );
48
49 if ( $contact_id and ! empty( $properties['email'] ) ) {
50 $service->send_email( $properties['email'] );
51 }
52 }
53 }
54
55
56 /**
57 * Default email_callback function.
58 */
59 function wpcf7_sendinblue_doi_default_email_callback( $args ) {
60 if ( ! isset( $args['token'] ) or ! isset( $args['email_to'] ) ) {
61 return;
62 }
63
64 $site_title = wp_specialchars_decode(
65 get_bloginfo( 'name' ),
66 ENT_QUOTES
67 );
68
69 $link = add_query_arg(
70 array( 'doitoken' => $args['token'] ),
71 home_url()
72 );
73
74 $to = $args['email_to'];
75
76 $subject = sprintf(
77 /* translators: %s: blog name */
78 __( 'Opt-in confirmation from %s', 'contact-form-7' ),
79 $site_title
80 );
81
82 $message = sprintf(
83 /* translators: 1: blog name, 2: confirmation link */
84 __( 'Hello,
85
86 This is a confirmation email sent from %1$s.
87
88 We have received your submission to our web form, according to which you have allowed us to add you to our contact list. But, the process has not yet been completed. To complete it, please click the following link.
89
90 %2$s
91
92 If it was not your intention, or if you have no idea why you received this message, please do not click on the link, and ignore this message. We will never collect or use your personal data without your clear consent.
93
94 Sincerely,
95 %1$s', 'contact-form-7' ),
96 $site_title,
97 $link
98 );
99
100 wp_mail( $to, $subject, $message );
101 }
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
2 2
3 wpcf7_include_module_file( 'sendinblue/service.php' ); 3 wpcf7_include_module_file( 'sendinblue/service.php' );
4 wpcf7_include_module_file( 'sendinblue/contact-form-properties.php' ); 4 wpcf7_include_module_file( 'sendinblue/contact-form-properties.php' );
5 wpcf7_include_module_file( 'sendinblue/doi.php' );
5 6
6 7
7 add_action( 'wpcf7_init', 'wpcf7_sendinblue_register_service', 1, 0 ); 8 add_action( 'wpcf7_init', 'wpcf7_sendinblue_register_service', 1, 0 );
...@@ -69,65 +70,83 @@ function wpcf7_sendinblue_submit( $contact_form, $result ) { ...@@ -69,65 +70,83 @@ function wpcf7_sendinblue_submit( $contact_form, $result ) {
69 70
70 $attributes = wpcf7_sendinblue_collect_parameters(); 71 $attributes = wpcf7_sendinblue_collect_parameters();
71 72
72 if ( empty( $attributes['EMAIL'] ) and empty( $attributes['SMS'] ) ) { 73 $params = array(
73 return; 74 'contact' => array(),
74 } 75 'email' => array(),
75
76 $contact_params = apply_filters(
77 'wpcf7_sendinblue_contact_parameters',
78 array(
79 'email' => $attributes['EMAIL'],
80 'attributes' => (object) $attributes,
81 'listIds' => (array) $prop['contact_lists'],
82 'updateEnabled' => false,
83 )
84 ); 76 );
85 77
86 $contact_id = $service->create_contact( $contact_params ); 78 if ( ! empty( $attributes['EMAIL'] ) or ! empty( $attributes['SMS'] ) ) {
87 79 $params['contact'] = apply_filters(
88 if ( ! $contact_id ) { 80 'wpcf7_sendinblue_contact_parameters',
89 return; 81 array(
82 'email' => $attributes['EMAIL'],
83 'attributes' => (object) $attributes,
84 'listIds' => (array) $prop['contact_lists'],
85 'updateEnabled' => false,
86 )
87 );
90 } 88 }
91 89
92 if ( ! $prop['enable_transactional_email'] or ! $prop['email_template'] ) { 90 if ( $prop['enable_transactional_email'] and $prop['email_template'] ) {
93 return; 91 $first_name = isset( $attributes['FIRSTNAME'] )
92 ? trim( $attributes['FIRSTNAME'] )
93 : '';
94
95 $last_name = isset( $attributes['LASTNAME'] )
96 ? trim( $attributes['LASTNAME'] )
97 : '';
98
99 if ( $first_name or $last_name ) {
100 $email_to_name = sprintf(
101 /* translators: 1: first name, 2: last name */
102 _x( '%1$s %2$s', 'personal name', 'contact-form-7' ),
103 $first_name,
104 $last_name
105 );
106 } else {
107 $email_to_name = '';
108 }
109
110 $params['email'] = apply_filters(
111 'wpcf7_sendinblue_email_parameters',
112 array(
113 'templateId' => absint( $prop['email_template'] ),
114 'to' => array(
115 array(
116 'name' => $email_to_name,
117 'email' => $attributes['EMAIL'],
118 ),
119 ),
120 'params' => (object) $attributes,
121 'tags' => array( 'Contact Form 7' ),
122 )
123 );
94 } 124 }
95 125
96 $first_name = isset( $attributes['FIRSTNAME'] ) 126 if ( is_email( $attributes['EMAIL'] ) ) {
97 ? trim( $attributes['FIRSTNAME'] ) 127 $token = null;
98 : '';
99 128
100 $last_name = isset( $attributes['LASTNAME'] ) 129 do_action_ref_array( 'wpcf7_doi', array(
101 ? trim( $attributes['LASTNAME'] ) 130 'wpcf7_sendinblue',
102 : ''; 131 array(
132 'email_to' => $attributes['EMAIL'],
133 'properties' => $params,
134 ),
135 &$token,
136 ) );
103 137
104 if ( $first_name or $last_name ) { 138 if ( isset( $token ) ) {
105 $email_to_name = sprintf( 139 return;
106 /* translators: 1: first name, 2: last name */ 140 }
107 _x( '%1$s %2$s', 'personal name', 'contact-form-7' ),
108 $first_name,
109 $last_name
110 );
111 } else {
112 $email_to_name = '';
113 } 141 }
114 142
115 $email_params = apply_filters( 143 if ( ! empty( $params['contact'] ) ) {
116 'wpcf7_sendinblue_email_parameters', 144 $contact_id = $service->create_contact( $params['contact'] );
117 array(
118 'templateId' => absint( $prop['email_template'] ),
119 'to' => array(
120 array(
121 'name' => $email_to_name,
122 'email' => $attributes['EMAIL'],
123 ),
124 ),
125 'params' => (object) $attributes,
126 'tags' => array( 'Contact Form 7' ),
127 )
128 );
129 145
130 $service->send_email( $email_params ); 146 if ( $contact_id and ! empty( $params['email'] ) ) {
147 $service->send_email( $params['email'] );
148 }
149 }
131 } 150 }
132 151
133 152
......
...@@ -3,8 +3,8 @@ Contributors: takayukister ...@@ -3,8 +3,8 @@ Contributors: takayukister
3 Donate link: https://contactform7.com/donate/ 3 Donate link: https://contactform7.com/donate/
4 Tags: contact, form, contact form, feedback, email, ajax, captcha, akismet, multilingual 4 Tags: contact, form, contact form, feedback, email, ajax, captcha, akismet, multilingual
5 Requires at least: 5.7 5 Requires at least: 5.7
6 Tested up to: 5.8 6 Tested up to: 5.9
7 Stable tag: 5.5.3 7 Stable tag: 5.5.4
8 License: GPLv2 or later 8 License: GPLv2 or later
9 License URI: https://www.gnu.org/licenses/gpl-2.0.html 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html
10 10
...@@ -77,6 +77,10 @@ Do you have questions or issues with Contact Form 7? Use these support channels ...@@ -77,6 +77,10 @@ Do you have questions or issues with Contact Form 7? Use these support channels
77 77
78 For more information, see [Releases](https://contactform7.com/category/releases/). 78 For more information, see [Releases](https://contactform7.com/category/releases/).
79 79
80 = 5.5.4 =
81
82 [https://contactform7.com/contact-form-7-554/](https://contactform7.com/contact-form-7-554/)
83
80 = 5.5.3 = 84 = 5.5.3 =
81 85
82 [https://contactform7.com/contact-form-7-553/](https://contactform7.com/contact-form-7-553/) 86 [https://contactform7.com/contact-form-7-553/](https://contactform7.com/contact-form-7-553/)
......
...@@ -7,10 +7,10 @@ Author: Takayuki Miyoshi ...@@ -7,10 +7,10 @@ Author: Takayuki Miyoshi
7 Author URI: https://ideasilo.wordpress.com/ 7 Author URI: https://ideasilo.wordpress.com/
8 Text Domain: contact-form-7 8 Text Domain: contact-form-7
9 Domain Path: /languages/ 9 Domain Path: /languages/
10 Version: 5.5.3 10 Version: 5.5.4
11 */ 11 */
12 12
13 define( 'WPCF7_VERSION', '5.5.3' ); 13 define( 'WPCF7_VERSION', '5.5.4' );
14 14
15 define( 'WPCF7_REQUIRED_WP_VERSION', '5.7' ); 15 define( 'WPCF7_REQUIRED_WP_VERSION', '5.7' );
16 16
......
...@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i ...@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
4 Tags: contact form 7, contact form 7 module, post, custom post, form to post, contact form 7 to post, contact form 7 extension 4 Tags: contact form 7, contact form 7 module, post, custom post, form to post, contact form 7 to post, contact form 7 extension
5 Requires at least: 4.7 5 Requires at least: 4.7
6 Requires PHP: 5.6 6 Requires PHP: 5.6
7 Tested up to: 5.8.2 7 Tested up to: 5.8.3
8 Stable tag: trunk 8 Stable tag: trunk
9 License: GPLv2 or later 9 License: GPLv2 or later
10 License URI: http://www.gnu.org/licenses/gpl-2.0.html 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html
...@@ -543,6 +543,10 @@ The following have contributed to bug fixes, documentation, and/or translations ...@@ -543,6 +543,10 @@ The following have contributed to bug fixes, documentation, and/or translations
543 As of now there is no special upgrade notes, simply follow the normal plugin update process. 543 As of now there is no special upgrade notes, simply follow the normal plugin update process.
544 544
545 == Change Log == 545 == Change Log ==
546 = 5.4.6 =
547 * fix json-error on existing post meta-fields.
548 * fix submitted post checkbox in post editor.
549 * fix loading of default posts for loggedout users.
546 = 5.4.5 = 550 = 5.4.5 =
547 * fix quick edit form table css/warning msg/filter. 551 * fix quick edit form table css/warning msg/filter.
548 * fix factory source setup on initial admin page. 552 * fix factory source setup on initial admin page.
......
...@@ -535,18 +535,18 @@ class Cf7_2_Post_Admin { ...@@ -535,18 +535,18 @@ class Cf7_2_Post_Admin {
535 } 535 }
536 ?> 536 ?>
537 <span>Form:&nbsp;</span> 537 <span>Form:&nbsp;</span>
538 <input id="cf72post_submitted" type="checkbox" value="submitted" <?=$checked?>/> 538 <input class="cf72post-submitted" type="checkbox" value="submitted" <?=$checked?>/>
539 <label for="cf7_2_post_submitted">submitted.</label> 539 <label for="cf7_2_post_submitted">submitted.</label>
540 <p><em>Uncheck to flag this submission as un-submitted.</em> This will reload this post into the form when the its author logs in again.</p> 540 <p><em>Uncheck to flag this submission as un-submitted.</em> This will reload this post into the form when the its author logs in again.</p>
541 <input type="hidden" id="cf72post_submitted_hidden" name="cf7_2_post_submitted" value="<?= $submitted?>" <?= $hidden?>/> 541 <input type="hidden" id="cf72post-submitted-hidden" name="cf7_2_post_submitted" value="<?= $submitted?>" <?= $hidden?>/>
542 <script type="text/javascript"> 542 <script type="text/javascript">
543 (function( $ ) { 543 (function( $ ) {
544 $(document).ready(function(){ 544 $(document).ready(function(){
545 $('#cf72post_submitted').on('change', function(){ 545 $('input.cf72post-submitted').on('change', function(){
546 if( $(this).is(':checked') ){ 546 if( $(this).is(':checked') ){
547 $('#cf72post_submitted_hidden').val('yes'); 547 $('#cf72post-submitted-hidden').val('yes');
548 }else{ 548 }else{
549 $('#cf72post_submitted_hidden').val('no'); 549 $('#cf72post-submitted-hidden').val('no');
550 } 550 }
551 }); 551 });
552 }); 552 });
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
16 * Plugin Name: Post My CF7 Form 16 * Plugin Name: Post My CF7 Form
17 * Plugin URI: http://wordpress.syllogic.in 17 * Plugin URI: http://wordpress.syllogic.in
18 * Description: This plugin enables the mapping of your CF7 forms to custom posts. 18 * Description: This plugin enables the mapping of your CF7 forms to custom posts.
19 * Version: 5.4.5 19 * Version: 5.4.6
20 * Author: Aurovrata V. 20 * Author: Aurovrata V.
21 * Author URI: http://syllogic.in 21 * Author URI: http://syllogic.in
22 * License: GPL-2.0+ 22 * License: GPL-2.0+
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
29 if ( ! defined( 'WPINC' ) ) { 29 if ( ! defined( 'WPINC' ) ) {
30 die; 30 die;
31 } 31 }
32 define( 'CF7_2_POST_VERSION', '5.4.5' ); 32 define( 'CF7_2_POST_VERSION', '5.4.6' );
33 33
34 /** 34 /**
35 * The code that runs during plugin activation. 35 * The code that runs during plugin activation.
......
...@@ -547,16 +547,19 @@ class CF72Post_Mapping_Factory { ...@@ -547,16 +547,19 @@ class CF72Post_Mapping_Factory {
547 if(is_user_logged_in()){ //let's see if this form is already mapped for this user 547 if(is_user_logged_in()){ //let's see if this form is already mapped for this user
548 $user = wp_get_current_user(); 548 $user = wp_get_current_user();
549 $args['author'] = $user->ID; 549 $args['author'] = $user->ID;
550 } 550 }else $args = array();
551 551
552 $args = apply_filters('cf7_2_post_filter_user_draft_form_query', $args, $mapper->post_properties['type'], $mapper->cf7_key); 552 $args = apply_filters('cf7_2_post_filter_user_draft_form_query', $args, $mapper->post_properties['type'], $mapper->cf7_key);
553 $posts_array = get_posts( $args ); 553
554 // debug_msg($args, "looking for posts.... found, ".sizeof($posts_array)); 554 if(!empty($args)){
555 if(!empty($posts_array)){ 555 $posts_array = get_posts( $args );
556 $post = $posts_array[0]; 556 // debug_msg($args, "looking for posts.... found, ".sizeof($posts_array));
557 $load_saved_values = true; 557 if(!empty($posts_array)){
558 $field_and_values['map_post_id']= $post->ID; 558 $post = $posts_array[0];
559 wp_reset_postdata(); 559 $load_saved_values = true;
560 $field_and_values['map_post_id']= $post->ID;
561 wp_reset_postdata();
562 }
560 } 563 }
561 564
562 //we now need to load the save meta field values 565 //we now need to load the save meta field values
...@@ -1036,6 +1039,7 @@ class CF72Post_Mapping_Factory { ...@@ -1036,6 +1039,7 @@ class CF72Post_Mapping_Factory {
1036 $html = ''; 1039 $html = '';
1037 $select = '<option value="">'.__('Select a field','post-my-contact-form-7').'</option>'.PHP_EOL; 1040 $select = '<option value="">'.__('Select a field','post-my-contact-form-7').'</option>'.PHP_EOL;
1038 foreach($metas as $row){ 1041 foreach($metas as $row){
1042 if(empty(trim($row->meta_key))) continue; /** @since 5.4.6 */
1039 if( 0=== strpos( $row->meta_key, '_') && 1043 if( 0=== strpos( $row->meta_key, '_') &&
1040 /** 1044 /**
1041 * filter plugin specific (internal) meta fields starting with '_'. By defaults these are skiupped by this plugin. 1045 * filter plugin specific (internal) meta fields starting with '_'. By defaults these are skiupped by this plugin.
......
...@@ -798,10 +798,16 @@ abstract class Form_2_Post_Mapper { ...@@ -798,10 +798,16 @@ abstract class Form_2_Post_Mapper {
798 'post_status'=> $post_status, 798 'post_status'=> $post_status,
799 'post_title' => $post_title 799 'post_title' => $post_title
800 ); 800 );
801 $post_id = ''; 801 /** @since 5.5 integrate Stripe payment */
802 $post_id = false;
803 if ( empty( $_POST['_wpcf7_stripe_payment_intent'] )) {
804 $post_id = get_transient( $_POST['_cf72post_nonce'] );
805 }
802 $is_update = false; 806 $is_update = false;
803 if(isset($_POST['_map_post_id']) && !empty($_POST['_map_post_id'])){ 807 if(isset($_POST['_map_post_id']) && !empty($_POST['_map_post_id'])){
804 $post_id = $_POST['_map_post_id']; //this is an existing post being updated 808 $post_id = $_POST['_map_post_id']; //this is an existing post being updated
809 }
810 if(!empty($post_id)){
805 $wp_post = get_post($post_id); 811 $wp_post = get_post($post_id);
806 $post['post_status'] = $post_status; 812 $post['post_status'] = $post_status;
807 $post['post_author'] = $wp_post->post_author; 813 $post['post_author'] = $wp_post->post_author;
......
...@@ -403,7 +403,7 @@ class Cf7_2_Post_Public { ...@@ -403,7 +403,7 @@ class Cf7_2_Post_Public {
403 } 403 }
404 /** 404 /**
405 * Map author to hidden field on form load. 405 * Map author to hidden field on form load.
406 * 406 * Hooked to 'wpcf7_form_hidden_fields'
407 *@since 3.9.0 407 *@since 3.9.0
408 *@param array $param array of hidden fields 408 *@param array $param array of hidden fields
409 *@return array array of hidden fields 409 *@return array array of hidden fields
......
...@@ -18,11 +18,17 @@ use Nextend\Framework\Plugin; ...@@ -18,11 +18,17 @@ use Nextend\Framework\Plugin;
18 18
19 /* 19 /*
20 jQuery.getJSON('https://www.googleapis.com/webfonts/v1/webfonts?sort=alpha&key=AIzaSyBIzBtder0-ef5a6kX-Ri9IfzVwFu21PGw').done(function(data){ 20 jQuery.getJSON('https://www.googleapis.com/webfonts/v1/webfonts?sort=alpha&key=AIzaSyBIzBtder0-ef5a6kX-Ri9IfzVwFu21PGw').done(function(data){
21 var f = []; 21 var f = [];
22 for(var i = 0; i < data.items.length; i++){ 22 for(var i = 0; i < data.items.length; i++){
23 f.push(data.items[i].family); 23 f.push(data.items[i].family);
24 } 24 }
25 console.log(JSON.stringify(f)); 25
26 var fontString='';
27 f.forEach(function(font){
28 fontString+= font+'\n';
29 });
30
31 console.log(fontString);
26 }); 32 });
27 */ 33 */
28 34
......
...@@ -97,6 +97,9 @@ class ImageEdit { ...@@ -97,6 +97,9 @@ class ImageEdit {
97 } 97 }
98 $extension = 'png'; 98 $extension = 'png';
99 break; 99 break;
100 case IMAGETYPE_WEBP:
101 $extension = 'webp';
102 break;
100 } 103 }
101 if (!$extension) { 104 if (!$extension) {
102 return $originalImageUrl; 105 return $originalImageUrl;
...@@ -142,6 +145,9 @@ class ImageEdit { ...@@ -142,6 +145,9 @@ class ImageEdit {
142 $image = $rotated; 145 $image = $rotated;
143 } 146 }
144 } 147 }
148 } else if ($extension == 'webp') {
149 //@TODO: should we need to care about rotation?
150 $image = @imagecreatefromwebp($imagePath);
145 } 151 }
146 152
147 if (isset($image) && $image) { 153 if (isset($image) && $image) {
...@@ -159,6 +165,10 @@ class ImageEdit { ...@@ -159,6 +165,10 @@ class ImageEdit {
159 imagepng($image, $targetFile); 165 imagepng($image, $targetFile);
160 } else if ($extension == 'jpg') { 166 } else if ($extension == 'jpg') {
161 imagejpeg($image, $targetFile, $quality); 167 imagejpeg($image, $targetFile, $quality);
168 } else if ($extension == 'webp') {
169 imagesavealpha($image, true);
170 imagealphablending($image, false);
171 imagewebp($image, $targetFile, $quality);
162 } 172 }
163 imagedestroy($image); 173 imagedestroy($image);
164 174
...@@ -173,7 +183,7 @@ class ImageEdit { ...@@ -173,7 +183,7 @@ class ImageEdit {
173 } 183 }
174 if ($rotated || $originalWidth != $targetWidth || $originalHeight != $targetHeight) { 184 if ($rotated || $originalWidth != $targetWidth || $originalHeight != $targetHeight) {
175 $newImage = imagecreatetruecolor($targetWidth, $targetHeight); 185 $newImage = imagecreatetruecolor($targetWidth, $targetHeight);
176 if ($extension == 'png') { 186 if ($extension == 'png' || $extension == 'webp') {
177 imagesavealpha($newImage, true); 187 imagesavealpha($newImage, true);
178 imagealphablending($newImage, false); 188 imagealphablending($newImage, false);
179 $transparent = imagecolorallocatealpha($newImage, 255, 255, 255, 127); 189 $transparent = imagecolorallocatealpha($newImage, 255, 255, 255, 127);
...@@ -199,6 +209,8 @@ class ImageEdit { ...@@ -199,6 +209,8 @@ class ImageEdit {
199 imagepng($newImage, $targetFile); 209 imagepng($newImage, $targetFile);
200 } else if ($extension == 'jpg') { 210 } else if ($extension == 'jpg') {
201 imagejpeg($newImage, $targetFile, $quality); 211 imagejpeg($newImage, $targetFile, $quality);
212 } else if ($extension == 'webp') {
213 imagewebp($newImage, $targetFile, $quality);
202 } 214 }
203 imagedestroy($newImage); 215 imagedestroy($newImage);
204 216
...@@ -272,6 +284,9 @@ class ImageEdit { ...@@ -272,6 +284,9 @@ class ImageEdit {
272 } 284 }
273 $extension = 'png'; 285 $extension = 'png';
274 break; 286 break;
287 case IMAGETYPE_WEBP:
288 $extension = 'webp';
289 break;
275 } 290 }
276 if (!$extension) { 291 if (!$extension) {
277 return $originalImageUrl; 292 return $originalImageUrl;
...@@ -311,6 +326,9 @@ class ImageEdit { ...@@ -311,6 +326,9 @@ class ImageEdit {
311 $image = $rotated; 326 $image = $rotated;
312 } 327 }
313 } 328 }
329 } else if ($extension == 'webp') {
330 //@TODO: should we need to care about rotation?
331 $image = @imagecreatefromwebp($imagePath);
314 } 332 }
315 333
316 if ($image) { 334 if ($image) {
...@@ -320,7 +338,7 @@ class ImageEdit { ...@@ -320,7 +338,7 @@ class ImageEdit {
320 $targetHeight = $originalHeight * $scale; 338 $targetHeight = $originalHeight * $scale;
321 if ((isset($rotated) && $rotated) || $originalWidth != $targetWidth || $originalHeight != $targetHeight) { 339 if ((isset($rotated) && $rotated) || $originalWidth != $targetWidth || $originalHeight != $targetHeight) {
322 $newImage = imagecreatetruecolor($targetWidth, $targetHeight); 340 $newImage = imagecreatetruecolor($targetWidth, $targetHeight);
323 if ($extension == 'png') { 341 if ($extension == 'png' || $extension == 'webp') {
324 imagesavealpha($newImage, true); 342 imagesavealpha($newImage, true);
325 imagealphablending($newImage, false); 343 imagealphablending($newImage, false);
326 $transparent = imagecolorallocatealpha($newImage, 255, 255, 255, 127); 344 $transparent = imagecolorallocatealpha($newImage, 255, 255, 255, 127);
...@@ -342,6 +360,8 @@ class ImageEdit { ...@@ -342,6 +360,8 @@ class ImageEdit {
342 imagepng($newImage, $targetFile); 360 imagepng($newImage, $targetFile);
343 } else if ($extension == 'jpg') { 361 } else if ($extension == 'jpg') {
344 imagejpeg($newImage, $targetFile, $quality); 362 imagejpeg($newImage, $targetFile, $quality);
363 } else if ($extension == 'webp') {
364 imagewebp($newImage, $targetFile, $quality);
345 } 365 }
346 imagedestroy($newImage); 366 imagedestroy($newImage);
347 367
...@@ -414,6 +434,7 @@ class ImageEdit { ...@@ -414,6 +434,7 @@ class ImageEdit {
414 'jpg' => 'jpg', 434 'jpg' => 'jpg',
415 'jpeg' => 'jpg', 435 'jpeg' => 'jpg',
416 'gif' => 'gif', 436 'gif' => 'gif',
437 'webp' => 'webp',
417 'svg' => 'svg' 438 'svg' => 'svg'
418 ); 439 );
419 $extension = strtolower($extension); 440 $extension = strtolower($extension);
...@@ -546,6 +567,9 @@ class ImageEdit { ...@@ -546,6 +567,9 @@ class ImageEdit {
546 case IMAGETYPE_PNG: 567 case IMAGETYPE_PNG:
547 $extension = 'png'; 568 $extension = 'png';
548 break; 569 break;
570 case IMAGETYPE_WEBP:
571 $extension = 'webp';
572 break;
549 } 573 }
550 if (!$extension) { 574 if (!$extension) {
551 return $originalImageUrl; 575 return $originalImageUrl;
...@@ -595,6 +619,14 @@ class ImageEdit { ...@@ -595,6 +619,14 @@ class ImageEdit {
595 $image = $rotated; 619 $image = $rotated;
596 } 620 }
597 } 621 }
622 } else if ($extension == 'webp') {
623 //@TODO: should we need to care about rotation?
624 $image = @imagecreatefromwebp($imagePath);
625 if (!imageistruecolor($image)) {
626 imagepalettetotruecolor($image);
627 imagealphablending($image, true);
628 imagesavealpha($image, true);
629 }
598 } 630 }
599 631
600 if ($image) { 632 if ($image) {
......
1 msgid "" 1 msgid ""
2 msgstr "" 2 msgstr ""
3 "Project-Id-Version: \n" 3 "Project-Id-Version: \n"
4 "POT-Creation-Date: 2021-10-16 08:50+0200\n" 4 "POT-Creation-Date: 2021-11-16 15:36+0100\n"
5 "PO-Revision-Date: 2021-11-02 14:26+0100\n" 5 "PO-Revision-Date: 2021-11-16 18:37+0100\n"
6 "Last-Translator: \n" 6 "Last-Translator: \n"
7 "Language-Team: \n" 7 "Language-Team: \n"
8 "Language: es\n" 8 "Language: es\n"
...@@ -1456,6 +1456,9 @@ msgstr "" ...@@ -1456,6 +1456,9 @@ msgstr ""
1456 msgid "JavaScript callbacks" 1456 msgid "JavaScript callbacks"
1457 msgstr "Callbacks JavaScript" 1457 msgstr "Callbacks JavaScript"
1458 1458
1459 msgid "Loading animation waiting time"
1460 msgstr "Tiempo de espera de animación de pre-carga"
1461
1459 msgid "Post IDs" 1462 msgid "Post IDs"
1460 msgstr "ID del artículo" 1463 msgstr "ID del artículo"
1461 1464
...@@ -1804,7 +1807,7 @@ msgid "Cache variations" ...@@ -1804,7 +1807,7 @@ msgid "Cache variations"
1804 msgstr "Variaciones del cache" 1807 msgstr "Variaciones del cache"
1805 1808
1806 msgid "Reverse" 1809 msgid "Reverse"
1807 msgstr "Reverso" 1810 msgstr "Orden inverso"
1808 1811
1809 msgid "You can make your slides appear in the slider in a reversed order." 1812 msgid "You can make your slides appear in the slider in a reversed order."
1810 msgstr "Puedes hacer que tu slides aparezcan en un orden inverso." 1813 msgstr "Puedes hacer que tu slides aparezcan en un orden inverso."
...@@ -3861,13 +3864,6 @@ msgstr "Cuando no esté visible" ...@@ -3861,13 +3864,6 @@ msgstr "Cuando no esté visible"
3861 msgid "You can pause the video when the visitor scrolls away from the slider" 3864 msgid "You can pause the video when the visitor scrolls away from the slider"
3862 msgstr "Puedes pausar el video cuando el usuario se desplaza fuera del slider" 3865 msgstr "Puedes pausar el video cuando el usuario se desplaza fuera del slider"
3863 3866
3864 msgid "Private video"
3865 msgstr "Video privado"
3866
3867 msgid ""
3868 "Turn it on to remove the admin warning that your video is not accessible."
3869 msgstr "Actívalo para ocultar la advertencia si el video no se puede acceder."
3870
3871 msgid "Display" 3867 msgid "Display"
3872 msgstr "Pantalla" 3868 msgstr "Pantalla"
3873 3869
...@@ -5695,6 +5691,12 @@ msgstr "Limite de submenu" ...@@ -5695,6 +5691,12 @@ msgstr "Limite de submenu"
5695 msgid "No limit" 5691 msgid "No limit"
5696 msgstr "Sin límite" 5692 msgstr "Sin límite"
5697 5693
5694 msgid "Hide empty categories"
5695 msgstr "Ocultar categorías vacías"
5696
5697 msgid "Yes"
5698 msgstr "Si"
5699
5698 msgid "Downloadable" 5700 msgid "Downloadable"
5699 msgstr "Descargable" 5701 msgstr "Descargable"
5700 5702
...@@ -6102,6 +6104,77 @@ msgstr "Antes de" ...@@ -6102,6 +6104,77 @@ msgstr "Antes de"
6102 msgid "Animation duration" 6104 msgid "Animation duration"
6103 msgstr "Duración de la animación" 6105 msgstr "Duración de la animación"
6104 6106
6107 msgid "Countdown"
6108 msgstr "Contador"
6109
6110 msgid "Days"
6111 msgstr "Días"
6112
6113 msgid "Hours"
6114 msgstr "Horas"
6115
6116 msgid "Minutes"
6117 msgstr "Minutos"
6118
6119 msgid "Seconds"
6120 msgstr "Segundos"
6121
6122 msgid "Use slide schedule"
6123 msgstr "Usar fecha del slide"
6124
6125 msgid "You can use the \"Unpublished on\" date of the slide itself."
6126 msgstr "Puedes usar la opción \"Despublicar en\" del propio slide."
6127
6128 msgid "Use Slide Schedule"
6129 msgstr "Usar fecha del slide"
6130
6131 msgid "Go to Slide → Content tab and set the Unpublish on date for the slide."
6132 msgstr ""
6133 "Para establecer una fecha para despublicar el slide deber ir a Slide > "
6134 "Contenido."
6135
6136 msgid ""
6137 "Displays the days, hours, minutes and seconds texts under the counter "
6138 "numbers. To display the labels in your own language, translate the texts in "
6139 "the language files."
6140 msgstr ""
6141 "Muestra el texto \"Días\", \"Horas\", \"Minutos\" y \"Segundos\" debajo de "
6142 "los números del contador."
6143
6144 msgid "Gap"
6145 msgstr "Espaciado"
6146
6147 msgid "Creates vertical and horizontal distance between the counter elements."
6148 msgstr ""
6149 "Crea un espacio vertical u horizontal entre los elementos del contador."
6150
6151 msgid "Tablet style"
6152 msgstr "Estilo para tableta"
6153
6154 msgid "Set custom Gap and Column for tablet."
6155 msgstr "Fija el espaciado y la columna para tabletas."
6156
6157 msgid "Mobile style"
6158 msgstr "Estilo para móvil"
6159
6160 msgid "Set custom Gap and Column for mobile."
6161 msgstr "Fija el espaciado y la columna para dispositivos móviles."
6162
6163 msgid "Action when ends"
6164 msgstr "Acción cuando finaliza"
6165
6166 msgid "No action"
6167 msgstr "No hacer nada"
6168
6169 msgid "Hide layer"
6170 msgstr "Ocultar capa"
6171
6172 msgid "Redirect to URL"
6173 msgstr "Redirigir a la URL"
6174
6175 msgid "Choose what happens after the counter reached zero."
6176 msgstr "Selecciona lo que ocurre cuando el contador alcanza el cero."
6177
6105 msgid "Circle 1" 6178 msgid "Circle 1"
6106 msgstr "Círculo 1" 6179 msgstr "Círculo 1"
6107 6180
...@@ -6321,9 +6394,6 @@ msgstr "" ...@@ -6321,9 +6394,6 @@ msgstr ""
6321 msgid "iframe url" 6394 msgid "iframe url"
6322 msgstr "url iframe" 6395 msgstr "url iframe"
6323 6396
6324 msgid "Yes"
6325 msgstr "Si"
6326
6327 msgid "You can disable the scroll on the iframe content." 6397 msgid "You can disable the scroll on the iframe content."
6328 msgstr "Puedes desactivar el desplazamiento para el contenido del iframe." 6398 msgstr "Puedes desactivar el desplazamiento para el contenido del iframe."
6329 6399
...@@ -6691,6 +6761,14 @@ msgstr "Color de la pista" ...@@ -6691,6 +6761,14 @@ msgstr "Color de la pista"
6691 msgid "Bar color" 6761 msgid "Bar color"
6692 msgstr "Color de la barra" 6762 msgstr "Color de la barra"
6693 6763
6764 #~ msgid "Private video"
6765 #~ msgstr "Video privado"
6766
6767 #~ msgid ""
6768 #~ "Turn it on to remove the admin warning that your video is not accessible."
6769 #~ msgstr ""
6770 #~ "Actívalo para ocultar la advertencia si el video no se puede acceder."
6771
6694 #~ msgctxt "Default Google font charset for admin" 6772 #~ msgctxt "Default Google font charset for admin"
6695 #~ msgid "latin" 6773 #~ msgid "latin"
6696 #~ msgstr "latín" 6774 #~ msgstr "latín"
...@@ -6891,9 +6969,6 @@ msgstr "Color de la barra" ...@@ -6891,9 +6969,6 @@ msgstr "Color de la barra"
6891 #~ "visible cuando el navegador cargar el slider. En la mayoría de los casos " 6969 #~ "visible cuando el navegador cargar el slider. En la mayoría de los casos "
6892 #~ "esto no sugerimos desactivar <b>Desvanecer al cargar</b>." 6970 #~ "esto no sugerimos desactivar <b>Desvanecer al cargar</b>."
6893 6971
6894 #~ msgid "Loading animation"
6895 #~ msgstr "Animación de pre-carga"
6896
6897 #~ msgid "Spinner" 6972 #~ msgid "Spinner"
6898 #~ msgstr "Spinner" 6973 #~ msgstr "Spinner"
6899 6974
...@@ -6935,12 +7010,6 @@ msgstr "Color de la barra" ...@@ -6935,12 +7010,6 @@ msgstr "Color de la barra"
6935 #~ msgid "Optimize layer images" 7010 #~ msgid "Optimize layer images"
6936 #~ msgstr "Optimizar imágenes de capa" 7011 #~ msgstr "Optimizar imágenes de capa"
6937 7012
6938 #~ msgid "Tablet scale"
6939 #~ msgstr "Escala en tableta"
6940
6941 #~ msgid "Mobile scale"
6942 #~ msgstr "Escala móvil"
6943
6944 #~ msgid "Adaptive" 7013 #~ msgid "Adaptive"
6945 #~ msgstr "Adaptativo" 7014 #~ msgstr "Adaptativo"
6946 7015
......
...@@ -2,19 +2,19 @@ ...@@ -2,19 +2,19 @@
2 msgid "" 2 msgid ""
3 msgstr "" 3 msgstr ""
4 "Project-Id-Version: \n" 4 "Project-Id-Version: \n"
5 "POT-Creation-Date: 2021-11-11 15:39+0100\n" 5 "POT-Creation-Date: 2022-01-13 13:55+0100\n"
6 "PO-Revision-Date: 2020-03-10 19:30+0100\n" 6 "PO-Revision-Date: 2020-03-10 19:30+0100\n"
7 "Last-Translator: \n" 7 "Last-Translator: \n"
8 "Language-Team: \n" 8 "Language-Team: \n"
9 "Language: en\n"
9 "MIME-Version: 1.0\n" 10 "MIME-Version: 1.0\n"
10 "Content-Type: text/plain; charset=UTF-8\n" 11 "Content-Type: text/plain; charset=UTF-8\n"
11 "Content-Transfer-Encoding: 8bit\n" 12 "Content-Transfer-Encoding: 8bit\n"
12 "X-Generator: Poedit 3.0\n" 13 "Plural-Forms: nplurals=2; plural=(n != 1);\n"
14 "X-Generator: Poedit 3.0.1\n"
13 "X-Poedit-SourceCharset: UTF-8\n" 15 "X-Poedit-SourceCharset: UTF-8\n"
14 "X-Poedit-Basepath: ..\n" 16 "X-Poedit-Basepath: ..\n"
15 "X-Poedit-KeywordsList: ;n2_;n2_e;n2_n:1,2;n2_en:1,2;n2_x:1,2c;n2_ex:1,2c\n" 17 "X-Poedit-KeywordsList: ;n2_;n2_e;n2_n:1,2;n2_en:1,2;n2_x:1,2c;n2_ex:1,2c\n"
16 "Plural-Forms: nplurals=2; plural=(n != 1);\n"
17 "Language: en\n"
18 "X-Poedit-Flags-xgettext: --no-location\n" 18 "X-Poedit-Flags-xgettext: --no-location\n"
19 "X-Poedit-SearchPath-0: .\n" 19 "X-Poedit-SearchPath-0: .\n"
20 "X-Poedit-SearchPathExcluded-0: Framework/Asset/Builder/cache\n" 20 "X-Poedit-SearchPathExcluded-0: Framework/Asset/Builder/cache\n"
...@@ -1076,13 +1076,19 @@ msgstr "" ...@@ -1076,13 +1076,19 @@ msgstr ""
1076 msgid "Set" 1076 msgid "Set"
1077 msgstr "" 1077 msgstr ""
1078 1078
1079 msgid "Up" 1079 msgid "Edit"
1080 msgstr "" 1080 msgstr ""
1081 1081
1082 msgid "Insert group" 1082 msgid "Group"
1083 msgstr "" 1083 msgstr ""
1084 1084
1085 msgid "Group" 1085 msgid "Edit slider"
1086 msgstr ""
1087
1088 msgid "Up"
1089 msgstr ""
1090
1091 msgid "Insert group"
1086 msgstr "" 1092 msgstr ""
1087 1093
1088 msgid "Move to trash" 1094 msgid "Move to trash"
...@@ -1127,6 +1133,24 @@ msgstr "" ...@@ -1127,6 +1133,24 @@ msgstr ""
1127 msgid "delete this slide" 1133 msgid "delete this slide"
1128 msgstr "" 1134 msgstr ""
1129 1135
1136 msgid "Max width"
1137 msgstr ""
1138
1139 msgid "Margin"
1140 msgstr ""
1141
1142 msgid "top"
1143 msgstr ""
1144
1145 msgid "right"
1146 msgstr ""
1147
1148 msgid "bottom"
1149 msgstr ""
1150
1151 msgid "left"
1152 msgstr ""
1153
1130 msgid "Animations" 1154 msgid "Animations"
1131 msgstr "" 1155 msgstr ""
1132 1156
...@@ -1446,9 +1470,6 @@ msgstr "" ...@@ -1446,9 +1470,6 @@ msgstr ""
1446 msgid "Align" 1470 msgid "Align"
1447 msgstr "" 1471 msgstr ""
1448 1472
1449 msgid "Margin"
1450 msgstr ""
1451
1452 msgid "Puts a fix margin around your slider." 1473 msgid "Puts a fix margin around your slider."
1453 msgstr "" 1474 msgstr ""
1454 1475
...@@ -1956,9 +1977,6 @@ msgstr "" ...@@ -1956,9 +1977,6 @@ msgstr ""
1956 msgid "Color end" 1977 msgid "Color end"
1957 msgstr "" 1978 msgstr ""
1958 1979
1959 msgid "Max width"
1960 msgstr ""
1961
1962 msgid "Position" 1980 msgid "Position"
1963 msgstr "" 1981 msgstr ""
1964 1982
...@@ -2262,9 +2280,6 @@ msgstr "" ...@@ -2262,9 +2280,6 @@ msgstr ""
2262 msgid "Scale down" 2280 msgid "Scale down"
2263 msgstr "" 2281 msgstr ""
2264 2282
2265 msgid "Edit"
2266 msgstr ""
2267
2268 msgid "Static overlay" 2283 msgid "Static overlay"
2269 msgstr "" 2284 msgstr ""
2270 2285
...@@ -2316,7 +2331,7 @@ msgstr "" ...@@ -2316,7 +2331,7 @@ msgstr ""
2316 msgid "Drop images here" 2331 msgid "Drop images here"
2317 msgstr "" 2332 msgstr ""
2318 2333
2319 msgid "Edit slider" 2334 msgid "Search Project"
2320 msgstr "" 2335 msgstr ""
2321 2336
2322 msgid "View trash" 2337 msgid "View trash"
...@@ -2343,9 +2358,29 @@ msgstr "" ...@@ -2343,9 +2358,29 @@ msgstr ""
2343 msgid "Export" 2358 msgid "Export"
2344 msgstr "" 2359 msgstr ""
2345 2360
2361 msgid "Show"
2362 msgstr ""
2363
2364 #, php-format
2365 msgid "Showing %s to %s of %s projects"
2366 msgstr ""
2367
2368 msgid "No projects to show"
2369 msgstr ""
2370
2346 msgid "New project" 2371 msgid "New project"
2347 msgstr "" 2372 msgstr ""
2348 2373
2374 msgid "Sorry we couldn’t find any matches"
2375 msgstr ""
2376
2377 msgid "Please try searching with another term."
2378 msgstr ""
2379
2380 #, php-format
2381 msgid "Showing %s results for %s."
2382 msgstr ""
2383
2349 msgid "Module" 2384 msgid "Module"
2350 msgstr "" 2385 msgstr ""
2351 2386
...@@ -4338,6 +4373,9 @@ msgstr "" ...@@ -4338,6 +4373,9 @@ msgstr ""
4338 msgid "Fan 3" 4373 msgid "Fan 3"
4339 msgstr "" 4374 msgstr ""
4340 4375
4376 msgid "Fan 4"
4377 msgstr ""
4378
4341 msgid "Hills" 4379 msgid "Hills"
4342 msgstr "" 4380 msgstr ""
4343 4381
...@@ -4380,6 +4418,24 @@ msgstr "" ...@@ -4380,6 +4418,24 @@ msgstr ""
4380 msgid "Waves" 4418 msgid "Waves"
4381 msgstr "" 4419 msgstr ""
4382 4420
4421 msgid "Columns 1"
4422 msgstr ""
4423
4424 msgid "Columns 2"
4425 msgstr ""
4426
4427 msgid "Paper 1"
4428 msgstr ""
4429
4430 msgid "Paper 2"
4431 msgstr ""
4432
4433 msgid "Paper 3"
4434 msgstr ""
4435
4436 msgid "Paper 4"
4437 msgstr ""
4438
4383 msgid "2 Colors" 4439 msgid "2 Colors"
4384 msgstr "" 4440 msgstr ""
4385 4441
...@@ -5067,6 +5123,12 @@ msgstr "" ...@@ -5067,6 +5123,12 @@ msgstr ""
5067 msgid "No limit" 5123 msgid "No limit"
5068 msgstr "" 5124 msgstr ""
5069 5125
5126 msgid "Hide empty categories"
5127 msgstr ""
5128
5129 msgid "Yes"
5130 msgstr ""
5131
5070 msgid "Downloadable" 5132 msgid "Downloadable"
5071 msgstr "" 5133 msgstr ""
5072 5134
...@@ -5463,6 +5525,69 @@ msgstr "" ...@@ -5463,6 +5525,69 @@ msgstr ""
5463 msgid "Animation duration" 5525 msgid "Animation duration"
5464 msgstr "" 5526 msgstr ""
5465 5527
5528 msgid "Countdown"
5529 msgstr ""
5530
5531 msgid "Days"
5532 msgstr ""
5533
5534 msgid "Hours"
5535 msgstr ""
5536
5537 msgid "Minutes"
5538 msgstr ""
5539
5540 msgid "Seconds"
5541 msgstr ""
5542
5543 msgid "Use slide schedule"
5544 msgstr ""
5545
5546 msgid "You can use the \"Unpublished on\" date of the slide itself."
5547 msgstr ""
5548
5549 msgid "Use Slide Schedule"
5550 msgstr ""
5551
5552 msgid "Go to Slide → Content tab and set the Unpublish on date for the slide."
5553 msgstr ""
5554
5555 msgid "Displays the days, hours, minutes and seconds texts under the counter numbers. To display the labels in your own language, translate the texts in the language files."
5556 msgstr ""
5557
5558 msgid "Gap"
5559 msgstr ""
5560
5561 msgid "Creates vertical and horizontal distance between the counter elements."
5562 msgstr ""
5563
5564 msgid "Tablet style"
5565 msgstr ""
5566
5567 msgid "Set custom Gap and Column for tablet."
5568 msgstr ""
5569
5570 msgid "Mobile style"
5571 msgstr ""
5572
5573 msgid "Set custom Gap and Column for mobile."
5574 msgstr ""
5575
5576 msgid "Action when ends"
5577 msgstr ""
5578
5579 msgid "No action"
5580 msgstr ""
5581
5582 msgid "Hide layer"
5583 msgstr ""
5584
5585 msgid "Redirect to URL"
5586 msgstr ""
5587
5588 msgid "Choose what happens after the counter reached zero."
5589 msgstr ""
5590
5466 msgid "Circle 1" 5591 msgid "Circle 1"
5467 msgstr "" 5592 msgstr ""
5468 5593
...@@ -5662,9 +5787,6 @@ msgstr "" ...@@ -5662,9 +5787,6 @@ msgstr ""
5662 msgid "iframe url" 5787 msgid "iframe url"
5663 msgstr "" 5788 msgstr ""
5664 5789
5665 msgid "Yes"
5666 msgstr ""
5667
5668 msgid "You can disable the scroll on the iframe content." 5790 msgid "You can disable the scroll on the iframe content."
5669 msgstr "" 5791 msgstr ""
5670 5792
......
...@@ -36,7 +36,8 @@ abstract class AbstractControllerAdmin extends AbstractAdminController { ...@@ -36,7 +36,8 @@ abstract class AbstractControllerAdmin extends AbstractAdminController {
36 'exportAllUrl' => $this->getUrlDashboardExportAll($groupID), 36 'exportAllUrl' => $this->getUrlDashboardExportAll($groupID),
37 'ajaxUrl' => $this->getAjaxUrlSlidesCreate(), 37 'ajaxUrl' => $this->getAjaxUrlSlidesCreate(),
38 'previewUrl' => $this->getUrlPreviewIndex(0), 38 'previewUrl' => $this->getUrlPreviewIndex(0),
39 'importUrl' => $this->getUrlImport($groupID) 39 'importUrl' => $this->getUrlImport($groupID),
40 'paginationUrl' => $this->getUrlPaginator()
40 ); 41 );
41 42
42 Js::addInline("new _N2.ManageSliders('" . $groupID . "', " . json_encode($options) . ", " . json_encode(SmartSlider3Info::shouldSkipLicenseModal()) . ");"); 43 Js::addInline("new _N2.ManageSliders('" . $groupID . "', " . json_encode($options) . ", " . json_encode(SmartSlider3Info::shouldSkipLicenseModal()) . ");");
......
...@@ -53,6 +53,10 @@ class SliderAnimations extends AbstractSliderTab { ...@@ -53,6 +53,10 @@ class SliderAnimations extends AbstractSliderTab {
53 } 53 }
54 54
55 protected function layerAnimations() { 55 protected function layerAnimations() {
56
57 /**
58 * Used for field removal: /animations/layer-animations
59 */
56 } 60 }
57 61
58 protected function layerParallax() { 62 protected function layerParallax() {
......
...@@ -10,9 +10,18 @@ class AbstractButtonLabel extends AbstractButton { ...@@ -10,9 +10,18 @@ class AbstractButtonLabel extends AbstractButton {
10 10
11 protected $icon = ''; 11 protected $icon = '';
12 12
13 protected $iconBefore = "";
14
15 protected $iconBeforeClass = "";
16
13 protected function getContent() { 17 protected function getContent() {
18 $content = '';
14 19
15 $content = '<span class="' . $this->baseClass . '__label">' . $this->getLabel() . '</span>'; 20 if (!empty($this->iconBefore)) {
21 $content .= '<i class="' . $this->iconBefore . ' ' . $this->itemBeforeClass . '"></i>';
22 }
23
24 $content .= '<span class="' . $this->baseClass . '__label">' . $this->getLabel() . '</span>';
16 25
17 if (!empty($this->icon)) { 26 if (!empty($this->icon)) {
18 $content .= '<i class="' . $this->icon . '"></i>'; 27 $content .= '<i class="' . $this->icon . '"></i>';
...@@ -41,4 +50,14 @@ class AbstractButtonLabel extends AbstractButton { ...@@ -41,4 +50,14 @@ class AbstractButtonLabel extends AbstractButton {
41 public function setIcon($icon) { 50 public function setIcon($icon) {
42 $this->icon = $icon; 51 $this->icon = $icon;
43 } 52 }
53
54 /**
55 * @param string $icon
56 * @param string $extraClass
57 */
58 public function setIconBefore($icon, $extraClass = "") {
59 $this->iconBefore = $icon;
60 $this->itemBeforeClass = $extraClass;
61 }
62
44 } 63 }
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -222,7 +222,6 @@ class LayerWindowSettingsSlide extends AbstractLayerWindowSettings { ...@@ -222,7 +222,6 @@ class LayerWindowSettingsSlide extends AbstractLayerWindowSettings {
222 'layerslide-backgroundImageBlur', 222 'layerslide-backgroundImageBlur',
223 'layerslide-backgroundMode', 223 'layerslide-backgroundMode',
224 'layerslide-background-notice-image', 224 'layerslide-background-notice-image',
225 'layerslide-backgroundBlurFit'
226 ) 225 )
227 ); 226 );
228 $fieldImage = new FieldImageResponsive($rowImage, 'slide-backgroundImage', n2_('Slide background'), '', $slideBackgroundAttr); 227 $fieldImage = new FieldImageResponsive($rowImage, 'slide-backgroundImage', n2_('Slide background'), '', $slideBackgroundAttr);
...@@ -259,10 +258,10 @@ class LayerWindowSettingsSlide extends AbstractLayerWindowSettings { ...@@ -259,10 +258,10 @@ class LayerWindowSettingsSlide extends AbstractLayerWindowSettings {
259 ) 258 )
260 )); 259 ));
261 new NumberSlider($rowImage, 'slide-backgroundBlurFit', n2_('Background blur'), 7, array( 260 new NumberSlider($rowImage, 'slide-backgroundBlurFit', n2_('Background blur'), 7, array(
262 'unit' => 'px', 261 'unit' => 'px',
263 'min'=> 7, 262 'min' => 7,
264 'max' => 50, 263 'max' => 50,
265 'wide'=>3 264 'wide' => 3
266 )); 265 ));
267 266
268 new NumberSlider($rowImage, 'slide-backgroundImageOpacity', n2_('Opacity'), 100, array( 267 new NumberSlider($rowImage, 'slide-backgroundImageOpacity', n2_('Opacity'), 100, array(
......
...@@ -92,6 +92,14 @@ class BlockSliderBox extends AbstractBlock { ...@@ -92,6 +92,14 @@ class BlockSliderBox extends AbstractBlock {
92 /** 92 /**
93 * @return int 93 * @return int
94 */ 94 */
95
96 public function getOrdering() {
97 return $this->slider['ordering'];
98 }
99
100 /**
101 * @return int
102 */
95 public function getGroupID() { 103 public function getGroupID() {
96 return $this->groupID; 104 return $this->groupID;
97 } 105 }
......
...@@ -12,7 +12,8 @@ use Nextend\Framework\Sanitize; ...@@ -12,7 +12,8 @@ use Nextend\Framework\Sanitize;
12 <div class="n2_slider_manager__box n2_slider_box<?php echo $this->isGroup() ? ' n2_slider_box--group' : ' n2_slider_box--slider'; ?>" 12 <div class="n2_slider_manager__box n2_slider_box<?php echo $this->isGroup() ? ' n2_slider_box--group' : ' n2_slider_box--slider'; ?>"
13 data-group="<?php echo $this->isGroup() ? '1' : '0'; ?>" 13 data-group="<?php echo $this->isGroup() ? '1' : '0'; ?>"
14 data-title="<?php echo Sanitize::esc_attr($this->getSliderTitle()); ?>" 14 data-title="<?php echo Sanitize::esc_attr($this->getSliderTitle()); ?>"
15 data-sliderid="<?php echo $this->getSliderID(); ?>"> 15 data-sliderid="<?php echo $this->getSliderID(); ?>"
16 data-ordering="<?php echo $this->getOrdering(); ?>">
16 17
17 <?php 18 <?php
18 $thumbnailUrl = Sanitize::esc_attr($this->getThumbnail()); 19 $thumbnailUrl = Sanitize::esc_attr($this->getThumbnail());
......
...@@ -12,15 +12,28 @@ namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Slider\SliderManag ...@@ -12,15 +12,28 @@ namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Slider\SliderManag
12 12
13 $this->displayOrderBy(); 13 $this->displayOrderBy();
14 14
15 $this->displayBulkActions();
16
17 $this->displayCreateGroup(); 15 $this->displayCreateGroup();
18 16
17 $this->displayTrash();
18
19 $this->displayBulkActions();
20
19 ?> 21 ?>
20 </div> 22 </div>
21 <div class="n2_slider_manager__action_bar_right"> 23 <div class="n2_slider_manager__action_bar_right">
22 <?php 24 <?php if ($this->sliderManager->getGroupID() == 0) { ?>
23 $this->displayTrash(); 25 <div class="n2_slider_manager__search">
24 ?> 26 <div class="n2_slider_manager__search_icon n2_slider_manager__search_icon--magnifier">
27 <i class="ssi_16 ssi_16--magnifier"></i>
28 </div>
29 <div class="n2_slider_manager__search_icon n2_slider_manager__search_icon--abort">
30 <i class="ssi_16 ssi_16--circularremove"></i>
31 </div>
32 <form class="n2_slider_manager__search_form" autocomplete="off">
33 <input type="text" name="kw" class="n2_slider_manager__search_input" value="" placeholder="<?php echo n2_('Search Project'); ?>" tabindex="-1">
34 </form>
35 </div>
36 <?php } ?>
25 </div> 37 </div>
38
26 </div> 39 </div>
......
...@@ -41,7 +41,9 @@ class BlockActionBar extends AbstractBlock { ...@@ -41,7 +41,9 @@ class BlockActionBar extends AbstractBlock {
41 $blockButton = new BlockButtonPlain($this); 41 $blockButton = new BlockButtonPlain($this);
42 $blockButton->setUrl($this->getUrlTrash()); 42 $blockButton->setUrl($this->getUrlTrash());
43 $blockButton->setLabel(n2_('View trash')); 43 $blockButton->setLabel(n2_('View trash'));
44 $blockButton->addClass('n2_slider_trash');
44 $blockButton->setSmall(); 45 $blockButton->setSmall();
46 $blockButton->setIconBefore('ssi_16 ssi_16--delete', 'n2_slider_icon--blue');
45 $blockButton->setTabIndex(-1); 47 $blockButton->setTabIndex(-1);
46 $blockButton->display(); 48 $blockButton->display();
47 } 49 }
...@@ -58,37 +60,54 @@ class BlockActionBar extends AbstractBlock { ...@@ -58,37 +60,54 @@ class BlockActionBar extends AbstractBlock {
58 $blockButton = new BlockButtonPlain($this); 60 $blockButton = new BlockButtonPlain($this);
59 $blockButton->setLabel(n2_('Order by')); 61 $blockButton->setLabel(n2_('Order by'));
60 $blockButton->setIcon('ssi_16 ssi_16--selectarrow'); 62 $blockButton->setIcon('ssi_16 ssi_16--selectarrow');
63 $blockButton->setIconBefore('ssi_16 ssi_16--order', 'n2_slider_icon--blue');
64 $blockButton->addClass('n2_slider_order');
61 $blockButton->setSmall(); 65 $blockButton->setSmall();
62 $blockOrderBy->setButton($blockButton); 66 $blockOrderBy->setButton($blockButton);
63 67
64 $manualOrder = new BlockFloatingMenuItem($this); 68 $manualOrder = new BlockFloatingMenuItem($this);
65 $manualOrder->setLabel(n2_('Manual order')); 69 $manualOrder->setLabel(n2_('Manual order'));
66 $manualOrder->setIsActive($orderBy == 'ordering' && $orderByDirection == 'ASC'); 70 $manualOrder->setIsActive($orderBy == 'ordering' && $orderByDirection == 'ASC');
67 $manualOrder->setUrl($this->getUrlDashboardOrderBy('ordering', 'ASC')); 71 $manualOrder->addAttribute('data-ordering', 'ordering');
72 $manualOrder->addAttribute('data-orderdirection', 'ASC');
73 $manualOrder->addClass('n2_floating_menu__item-order');
74 $manualOrder->setUrl('#');
68 $blockOrderBy->addMenuItem($manualOrder); 75 $blockOrderBy->addMenuItem($manualOrder);
69 76
70 $orderAZ = new BlockFloatingMenuItem($this); 77 $orderAZ = new BlockFloatingMenuItem($this);
71 $orderAZ->setLabel(n2_('A-Z')); 78 $orderAZ->setLabel(n2_('A-Z'));
72 $orderAZ->setIsActive($orderBy == 'title' && $orderByDirection == 'ASC'); 79 $orderAZ->setIsActive($orderBy == 'title' && $orderByDirection == 'ASC');
73 $orderAZ->setUrl($this->getUrlDashboardOrderBy('title', 'ASC')); 80 $orderAZ->addAttribute('data-ordering', 'title');
81 $orderAZ->addAttribute('data-orderdirection', 'ASC');
82 $orderAZ->addClass('n2_floating_menu__item-order');
83 $orderAZ->setUrl('#');
74 $blockOrderBy->addMenuItem($orderAZ); 84 $blockOrderBy->addMenuItem($orderAZ);
75 85
76 $orderZA = new BlockFloatingMenuItem($this); 86 $orderZA = new BlockFloatingMenuItem($this);
77 $orderZA->setLabel(n2_('Z-A')); 87 $orderZA->setLabel(n2_('Z-A'));
78 $orderZA->setIsActive($orderBy == 'title' && $orderByDirection == 'DESC'); 88 $orderZA->setIsActive($orderBy == 'title' && $orderByDirection == 'DESC');
79 $orderZA->setUrl($this->getUrlDashboardOrderBy('title', 'DESC')); 89 $orderZA->addAttribute('data-ordering', 'title');
90 $orderZA->addAttribute('data-orderdirection', 'DESC');
91 $orderZA->addClass('n2_floating_menu__item-order');
92 $orderZA->setUrl('#');
80 $blockOrderBy->addMenuItem($orderZA); 93 $blockOrderBy->addMenuItem($orderZA);
81 94
82 $orderNewest = new BlockFloatingMenuItem($this); 95 $orderNewest = new BlockFloatingMenuItem($this);
83 $orderNewest->setLabel(n2_('Newest first')); 96 $orderNewest->setLabel(n2_('Newest first'));
84 $orderNewest->setIsActive($orderBy == 'time' && $orderByDirection == 'DESC'); 97 $orderNewest->setIsActive($orderBy == 'time' && $orderByDirection == 'DESC');
85 $orderNewest->setUrl($this->getUrlDashboardOrderBy('time', 'DESC')); 98 $orderNewest->addAttribute('data-ordering', 'time');
99 $orderNewest->addAttribute('data-orderdirection', 'DESC');
100 $orderNewest->addClass('n2_floating_menu__item-order');
101 $orderNewest->setUrl('#');
86 $blockOrderBy->addMenuItem($orderNewest); 102 $blockOrderBy->addMenuItem($orderNewest);
87 103
88 $orderOldest = new BlockFloatingMenuItem($this); 104 $orderOldest = new BlockFloatingMenuItem($this);
89 $orderOldest->setLabel(n2_('Oldest first')); 105 $orderOldest->setLabel(n2_('Oldest first'));
90 $orderOldest->setIsActive($orderBy == 'time' && $orderByDirection == 'ASC'); 106 $orderOldest->setIsActive($orderBy == 'time' && $orderByDirection == 'ASC');
91 $orderOldest->setUrl($this->getUrlDashboardOrderBy('time', 'ASC')); 107 $orderOldest->addAttribute('data-ordering', 'time');
108 $orderOldest->addAttribute('data-orderdirection', 'ASC');
109 $orderOldest->addClass('n2_floating_menu__item-order');
110 $orderOldest->setUrl('#');
92 $blockOrderBy->addMenuItem($orderOldest); 111 $blockOrderBy->addMenuItem($orderOldest);
93 112
94 $blockOrderBy->display(); 113 $blockOrderBy->display();
...@@ -104,8 +123,10 @@ class BlockActionBar extends AbstractBlock { ...@@ -104,8 +123,10 @@ class BlockActionBar extends AbstractBlock {
104 123
105 $blockButton = new BlockButtonPlain($this); 124 $blockButton = new BlockButtonPlain($this);
106 $blockButton->setLabel(n2_('Bulk actions')); 125 $blockButton->setLabel(n2_('Bulk actions'));
107 $blockButton->setIcon('ssi_16 ssi_16--selectarrow');
108 $blockButton->setSmall(); 126 $blockButton->setSmall();
127 $blockButton->setIcon('ssi_16 ssi_16--selectarrow');
128 $blockButton->setIconBefore('ssi_16 ssi_16--slides', 'n2_slider_icon--blue');
129
109 $blockBulkActions->setButton($blockButton); 130 $blockBulkActions->setButton($blockButton);
110 131
111 $duplicate = new BlockFloatingMenuItem($this); 132 $duplicate = new BlockFloatingMenuItem($this);
......
...@@ -16,15 +16,18 @@ class BlockSliderManager extends AbstractBlock { ...@@ -16,15 +16,18 @@ class BlockSliderManager extends AbstractBlock {
16 16
17 protected $orderByDirection = 'ASC'; 17 protected $orderByDirection = 'ASC';
18 18
19 protected $paginationIndex = 0;
20
21 protected $paginationLimit = 'all';
22
19 public function display() { 23 public function display() {
20 if ($this->groupID > 0) { 24 if ($this->groupID <= 0) {
21 $this->orderBy = 'ordering';
22 $this->orderByDirection = 'ASC';
23 } else {
24 $this->orderBy = Settings::get('slidersOrder2', 'ordering'); 25 $this->orderBy = Settings::get('slidersOrder2', 'ordering');
25 $this->orderByDirection = Settings::get('slidersOrder2Direction', 'ASC'); 26 $this->orderByDirection = Settings::get('slidersOrder2Direction', 'ASC');
27 $this->paginationLimit = Settings::get('limit', 'all');
26 } 28 }
27 29
30
28 $this->renderTemplatePart('SliderManager'); 31 $this->renderTemplatePart('SliderManager');
29 } 32 }
30 33
...@@ -42,11 +45,57 @@ class BlockSliderManager extends AbstractBlock { ...@@ -42,11 +45,57 @@ class BlockSliderManager extends AbstractBlock {
42 $this->groupID = $groupID; 45 $this->groupID = $groupID;
43 } 46 }
44 47
48 /**
49 * @return int
50 */
51 public function getPaginationIndex() {
52 return $this->paginationIndex;
53 }
54
55 /**
56 * @param int $index
57 */
58 public function setPaginationIndex($index) {
59 $this->paginationIndex = $index;
60 }
61
62
63 /**
64 * @return int
65 */
66
67 public function getPaginationLimit() {
68 return $this->paginationLimit;
69 }
70
71 /**
72 * @param string $status
73 *
74 */
45 public function getSliders($status = '*') { 75 public function getSliders($status = '*') {
76 $slidersModel = new ModelSliders($this);
77
78 $sliders = $slidersModel->getAll($this->groupID, $status, $this->orderBy, $this->orderByDirection, $this->paginationIndex, $this->paginationLimit);
79 if ($this->groupID <= 0 && empty($sliders) && $sliderCount = $this->getSliderCount('published', true)) {
80 $lastPageIndex = intval(ceil(($sliderCount - $this->paginationLimit) / $this->paginationLimit));
81 $sliders = $slidersModel->getAll($this->groupID, $status, $this->orderBy, $this->orderByDirection, $lastPageIndex, $this->paginationLimit);
82 $this->paginationIndex = $lastPageIndex;
83 }
84
85 return $sliders;
86 }
87
88 /**
89 * @param string $status
90 * @param false $withGroup
91 *
92 * @return int
93 */
46 94
95 public function getSliderCount($status = '*', $withGroup = false) {
47 $slidersModel = new ModelSliders($this); 96 $slidersModel = new ModelSliders($this);
48 97
49 return $slidersModel->getAll($this->groupID, $status, $this->orderBy, $this->orderByDirection); 98 return $slidersModel->getSlidersCount($status, $withGroup);
50 } 99 }
51 100
52 /** 101 /**
......
1 <?php
2
3 namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Slider\SliderManager\Paginator;
4
5 use Nextend\Framework\View\AbstractBlock;
6 use Nextend\SmartSlider3\Application\Admin\Layout\Block\Forms\Button\BlockButtonIconCode;
7 use Nextend\SmartSlider3\Application\Admin\Layout\Block\Forms\Button\BlockButtonPlain;
8 use Nextend\SmartSlider3\Application\Admin\Layout\Block\Forms\Button\BlockButtonPlainIcon;
9 use Nextend\SmartSlider3\Application\Admin\Layout\Block\Forms\FloatingMenu\BlockFloatingMenu;
10 use Nextend\SmartSlider3\Application\Admin\Layout\Block\Forms\FloatingMenu\BlockFloatingMenuItem;
11
12 class BlockPaginator extends AbstractBlock {
13
14 protected $sliderCount;
15 protected $paginationLimit;
16
17 /**
18 * @var BlockSliderManager
19 */
20 protected $sliderManager;
21
22 public function display() {
23
24 $this->renderTemplatePart('Paginator');
25 }
26
27 /**
28 * @param BlockSliderManager $sliderManager
29 */
30 public function setSliderManager($sliderManager) {
31 $this->sliderManager = $sliderManager;
32 }
33
34
35 public function setSliderCount($sliderCount) {
36 $this->sliderCount = $sliderCount;
37 }
38
39 public function setPaginationLimit($limit) {
40 $this->paginationLimit = $limit;
41 }
42
43 private function transformedPaginationLimit() {
44 if ($this->paginationLimit === 'all') {
45 /*used in calculations*/
46 return $this->sliderCount;
47 } else {
48 return $this->paginationLimit;
49 }
50 }
51
52
53 public function displayPaginationButtons() {
54
55 $totalPages = $this->sliderCount ? ceil(($this->sliderCount / $this->transformedPaginationLimit())) : 0;
56 $delta = 2;
57 $left = intval($this->sliderManager->getPaginationIndex()) - $delta;
58 $right = intval($this->sliderManager->getPaginationIndex()) + $delta;
59
60 /*PageList*/
61 if ($totalPages > 1) {
62 for ($i = 0; $i < $totalPages; $i++) {
63 if ($i == 0 || $i == $totalPages - 1 || $i >= $left && $i <= $right) {
64 $blockButton = new BlockButtonPlain($this);
65 $blockButton->setUrl('#');
66 $blockButton->setLabel($i + 1);
67 $blockButton->addAttribute('data-page', $i);
68 $blockButton->setSmall();
69 $blockButton->setTabIndex(-1);
70 $class = 'n2_slider_manager__paginator_item ' . (($i === intval($this->sliderManager->getPaginationIndex())) ? 'n2_slider_manager__paginator_item--active' : '');
71 $blockButton->addAttribute('class', $class);
72 $blockButton->display();
73 } else if ($i === $left - 1 || $i === $right + 1) {
74 echo "<div class='n2_slider_manager__paginator_item n2_slider_manager__paginator_item_spacer'>...</div>";
75 }
76 }
77 }
78
79 }
80
81 public function displayPaginationPrevious() {
82
83 $blockButtonPrev = new BlockButtonPlainIcon($this);
84 $blockButtonPrev->setUrl('#');
85 $blockButtonPrev->setIcon('ssi_16 ssi_16--paginatiorarrow');
86 $blockButtonPrev->setSmall();
87 $blockButtonPrev->setTabIndex(-1);
88 $blockButtonPrev->addAttribute('data-page', 'prev');
89 $blockButtonPrev->addAttribute('class', 'n2_slider_manager__paginator_item n2_slider_manager__paginator_item_arrow n2_slider_manager__paginator_item_arrow--prev n2_slider_manager__paginator_item_arrow--disabled');
90 $blockButtonPrev->display();
91 }
92
93 public function displayPaginationNext() {
94 $blockButtonNext = new BlockButtonPlainIcon($this);
95 $blockButtonNext->setUrl('#');
96 $blockButtonNext->setIcon('ssi_16 ssi_16--paginatiorarrow');
97 $blockButtonNext->setSmall();
98 $blockButtonNext->setTabIndex(-1);
99 $blockButtonNext->addAttribute('data-page', 'next');
100 $blockButtonNext->addAttribute('class', 'n2_slider_manager__paginator_item n2_slider_manager__paginator_item_arrow n2_slider_manager__paginator_item_arrow--next n2_slider_manager__paginator_item_arrow--disabled');
101 $blockButtonNext->display();
102 }
103
104 public function displayPaginationLimiters() {
105 $blockLimiter = new BlockFloatingMenu($this);
106
107 $blockButton = new BlockButtonPlain($this);
108 $blockButton->setLabel(n2_('Show') . " <span class='limitNumber'>" . $this->paginationLimit . "</span>");
109 $blockButton->setIcon('ssi_16 ssi_16--selectarrow');
110 $blockButton->setSmall();
111 $blockLimiter->setButton($blockButton);
112
113
114 $limits = array(
115 10,
116 25,
117 50,
118 100
119 );
120
121 foreach ($limits as $limit) {
122 $limitItem = new BlockFloatingMenuItem($this);
123 $limitItem->setLabel($limit);
124 $limitItem->setUrl('#');
125 $limitItem->addAttribute('data-limit', $limit);
126 $limitItem->addClass('n2_floating_menu__item-limiter');
127 $limitItem->setIsActive($this->paginationLimit == $limit);
128 $blockLimiter->addMenuItem($limitItem);
129 }
130
131 $limitAll = new BlockFloatingMenuItem($this);
132 $limitAll->setLabel(n2_('All'));
133 $limitAll->setUrl('#');
134 $limitAll->addAttribute('data-limit', 'all');
135 $limitAll->addClass('n2_floating_menu__item-limiter');
136 $limitAll->setIsActive($this->paginationLimit == 'all');
137 $blockLimiter->addMenuItem($limitAll);
138
139
140 $blockLimiter->display();
141 }
142
143 public function displayPaginationLabel() {
144
145
146 $actualSliderStart = $this->transformedPaginationLimit() * $this->sliderManager->getPaginationIndex();
147 $actualSlidersEnd = $actualSliderStart + $this->transformedPaginationLimit();
148 $allSliders = $this->sliderCount;
149
150 echo sprintf(n2_("Showing %s to %s of %s projects"), "<span class='n2_slider_manager__paginator_label_item__from'>" . (($actualSliderStart === 0) ? 1 : $actualSliderStart) . "</span>", "<span class='n2_slider_manager__paginator_label_item__to' > " . (($actualSlidersEnd < $this->sliderCount) ? $actualSlidersEnd : $this->sliderCount) . "</span > ", "<span class='n2_slider_manager__paginator_label_item__max' > " . $allSliders . "</span > ");
151 }
152
153 public function displayNoSlidersLabel() {
154 echo n2_('No projects to show');
155 }
156
157 }
...\ No newline at end of file ...\ No newline at end of file
1 <?php
2
3 namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Slider\SliderManager\Paginator;
4
5 /**
6 * @var BlockPaginator $this
7 */
8
9 ?>
10 <div class="n2_slider_manager__paginator_label <?php echo $this->sliderCount === 0 ? "n2_slider_manager__paginator_label--nosliders" : "" ?>">
11 <p class="n2_slider_manager__paginator_label_item n2_slider_manager__paginator_label_item--active"><?php $this->displayPaginationLabel(); ?></p>
12 <p class="n2_slider_manager__paginator_label_item n2_slider_manager__paginator_label_item--empty"><?php $this->displayNoSlidersLabel(); ?></p>
13 </div>
14 <div class=" n2_slider_manager__paginator_buttons">
15
16 <?php
17 $this->displayPaginationPrevious();
18 ?>
19 <div class="n2_slider_manager__paginator_buttons--numbers">
20 <?php
21 $this->displayPaginationButtons();
22 ?>
23 </div>
24 <?php
25 $this->displayPaginationNext();
26 ?>
27 </div>
28 <div class="n2_slider_manager__paginator_limiter">
29 <?php $this->displayPaginationLimiters() ?>
30 </div>
31
32
33
34
...@@ -3,17 +3,20 @@ namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Slider\SliderManag ...@@ -3,17 +3,20 @@ namespace Nextend\SmartSlider3\Application\Admin\Layout\Block\Slider\SliderManag
3 3
4 use Nextend\SmartSlider3\Application\Admin\Layout\Block\Slider\SliderBox\BlockSliderBox; 4 use Nextend\SmartSlider3\Application\Admin\Layout\Block\Slider\SliderBox\BlockSliderBox;
5 use Nextend\SmartSlider3\Application\Admin\Layout\Block\Slider\SliderManager\ActionBar\BlockActionBar; 5 use Nextend\SmartSlider3\Application\Admin\Layout\Block\Slider\SliderManager\ActionBar\BlockActionBar;
6 use Nextend\SmartSlider3\Application\Admin\Layout\Block\Slider\SliderManager\Paginator\BlockPaginator;
6 7
7 /** 8 /**
8 * @var BlockSliderManager $this 9 * @var BlockSliderManager $this
9 */ 10 */
10 11 $groupID = $this->getGroupID();
11 $groupID = $this->getGroupID();
12
13 $orderBy = $this->getOrderBy(); 12 $orderBy = $this->getOrderBy();
14 $orderByDirection = $this->getOrderByDirection(); 13 $orderByDirection = $this->getOrderByDirection();
15 14
16 $sliders = $this->getSliders('published'); 15 $sliders = $this->getSliders('published');
16 $sliderCount = $this->getSliderCount('published', true);
17
18 $limit = $this->getPaginationLimit();
19 $paginationIndex = $this->getPaginationIndex();
17 20
18 ?> 21 ?>
19 <div class="n2_slider_manager" data-groupid="<?php echo $groupID; ?>" data-orderby="<?php echo $orderBy; ?>" data-orderbydirection="<?php echo $orderByDirection; ?>"> 22 <div class="n2_slider_manager" data-groupid="<?php echo $groupID; ?>" data-orderby="<?php echo $orderBy; ?>" data-orderbydirection="<?php echo $orderByDirection; ?>">
...@@ -42,5 +45,33 @@ $sliders = $this->getSliders('published'); ...@@ -42,5 +45,33 @@ $sliders = $this->getSliders('published');
42 $blockSliderBox->display(); 45 $blockSliderBox->display();
43 } 46 }
44 ?> 47 ?>
48 <?php if ($groupID <= 0) { ?>
49 <div class="n2_slider_manager__content--empty">
50 <div class="n2_slider_manager__content--empty__logo">
51 <i class="ssi_48 ssi_48--bug"></i>
52 </div>
53 <div class="n2_slider_manager__content--empty__heading">
54 <?php n2_e('Sorry we couldn’t find any matches'); ?>
55 </div>
56 <div class="n2_slider_manager__content--empty__paragraph">
57 <?php n2_e('Please try searching with another term.'); ?>
58 </div>
59 </div>
60 <?php } ?>
61
45 </div> 62 </div>
46 </div>
...\ No newline at end of file ...\ No newline at end of file
63 <?php if ($groupID <= 0) { ?>
64 <div class="n2_slider_manager__paginator" data-countstart="<?php echo $sliderCount ?>" data-currentstart="<?php echo $paginationIndex ?>" data-limitstart="<?php echo $limit ?>">
65 <?php
66 $blockPaginator = new BlockPaginator($this);
67 $blockPaginator->setSliderManager($this);
68 $blockPaginator->setSliderCount($sliderCount);
69 $blockPaginator->setPaginationLimit($limit);
70 $blockPaginator->display();
71 ?>
72 </div>
73 <div class="n2_slider_manager__search_label">
74 <p class="n2_slider_manager__search_label_item n2_slider_manager__search_label_item"><?php echo sprintf(n2_("Showing %s results for %s."), "<span class='n2_slider_manager__search_label_item__counter'>0</span>", "<span class='n2_slider_manager__search_label_item__keyword'></span>") ?></p>
75 </div>
76 <?php } ?>
77 </div>
......
...@@ -241,7 +241,10 @@ class ControllerAjaxSlider extends AdminAjaxController { ...@@ -241,7 +241,10 @@ class ControllerAjaxSlider extends AdminAjaxController {
241 $view = new ViewAjaxSliderBox($this); 241 $view = new ViewAjaxSliderBox($this);
242 $view->setSlider($slider); 242 $view->setSlider($slider);
243 243
244 $this->response->respond($view->display()); 244 $this->response->respond(array(
245 'html' => $view->display(),
246 'sliderCount' => $slidersModel->getSlidersCount('published', true)
247 ));
245 } 248 }
246 249
247 public function actionChangeSliderType() { 250 public function actionChangeSliderType() {
......
...@@ -7,6 +7,7 @@ namespace Nextend\SmartSlider3\Application\Admin\Sliders; ...@@ -7,6 +7,7 @@ namespace Nextend\SmartSlider3\Application\Admin\Sliders;
7 use Nextend\Framework\Controller\Admin\AdminAjaxController; 7 use Nextend\Framework\Controller\Admin\AdminAjaxController;
8 use Nextend\Framework\Data\Data; 8 use Nextend\Framework\Data\Data;
9 use Nextend\Framework\Filesystem\Filesystem; 9 use Nextend\Framework\Filesystem\Filesystem;
10 use Nextend\Framework\Misc\HttpClient;
10 use Nextend\Framework\Model\StorageSectionManager; 11 use Nextend\Framework\Model\StorageSectionManager;
11 use Nextend\Framework\Notification\Notification; 12 use Nextend\Framework\Notification\Notification;
12 use Nextend\Framework\Platform\Platform; 13 use Nextend\Framework\Platform\Platform;
...@@ -70,7 +71,7 @@ class ControllerAjaxSliders extends AdminAjaxController { ...@@ -70,7 +71,7 @@ class ControllerAjaxSliders extends AdminAjaxController {
70 $this->validatePermission('smartslider_edit'); 71 $this->validatePermission('smartslider_edit');
71 72
72 $slidersModel = new ModelSliders($this); 73 $slidersModel = new ModelSliders($this);
73 $result = $slidersModel->order(Request::$REQUEST->getVar('groupID', 0), Request::$REQUEST->getVar('sliderorder'), Request::$REQUEST->getInt('isReversed', 1)); 74 $result = $slidersModel->order(Request::$REQUEST->getVar('groupID', 0), Request::$REQUEST->getVar('sliderorder'), Request::$REQUEST->getInt('isReversed', 1), Request::$REQUEST->getVar('orders', array()));
74 $this->validateDatabase($result); 75 $this->validateDatabase($result);
75 76
76 Notification::success(n2_('Slider order saved.')); 77 Notification::success(n2_('Slider order saved.'));
...@@ -145,6 +146,100 @@ class ControllerAjaxSliders extends AdminAjaxController { ...@@ -145,6 +146,100 @@ class ControllerAjaxSliders extends AdminAjaxController {
145 $this->response->respond(); 146 $this->response->respond();
146 } 147 }
147 148
149 public function actionSearch() {
150 $this->validateToken();
151 $slidersModel = new ModelSliders($this);
152
153 $keyword = Request::$REQUEST->getVar('keyword', '');
154 $sliders = array();
155
156 $url = parse_url($keyword);
157 $baseUrl =parse_url(Platform::getSiteUrl()) ;
158
159 if (isset($url['host']) && $url['host'] === $baseUrl['host']) {
160 $options = array(
161 'error' => true,
162 );
163
164 $content = HttpClient::get($keyword, $options);
165 preg_match_all('/data-ssid="(?<id>[0-9]+)/', $content, $matches);
166
167 foreach ($matches['id'] as $sliderID) {
168 if ($_slider = $slidersModel->getWithThumbnail($sliderID)) {
169 array_push($sliders, $_slider);
170 }
171 }
172 }
173
174 $sliders = array_merge($sliders, $slidersModel->getSearchResults($keyword));
175 $result = array();
176 if (!empty($sliders)) {
177 foreach ($sliders as $slider) {
178 $result[] = array(
179 'id' => $slider['id'],
180 'alias' => $slider['alias'],
181 'title' => $slider['title'],
182 'thumbnail' => $this->getSliderThumbnail($slider),
183 'isGroup' => $slider['type'] == 'group',
184 'childrenCount' => $slider['slides'] > 0 ? $slider['slides'] : 0,
185 'editUrl' => $this->getUrlSliderEdit($slider['id'], $slider['group_id']),
186 'order' => $slider['ordering']
187 );
188 }
189 }
190
191 $this->response->respond($result);
192
193 }
194
195 public function actionPagination() {
196 $this->validateToken();
197 $slidersModel = new ModelSliders($this);
198 $pageIndex = Request::$REQUEST->getInt('pageIndex', 0);
199 $limit = Request::$REQUEST->getVar('limit', 20);
200 $orderBy = Request::$REQUEST->getCmd('orderBy', 'ordering');
201 $orderDirection = Request::$REQUEST->getCmd('orderDirection', 'ASC');
202
203 Settings::set('limit', $limit);
204 Settings::set('slidersOrder2', $orderBy);
205 Settings::set('slidersOrder2Direction', $orderDirection);
206
207 if ($pageIndex < 0) {
208 $pageIndex = 0;
209 }
210
211 $sliderCount = $slidersModel->getSlidersCount('published', true);
212 $result = array();
213
214 $sliders = $slidersModel->getAll(0, 'published', $orderBy, $orderDirection, $pageIndex, $limit);
215
216 //if last page is empty
217 if (empty($sliders) && $sliderCount) {
218 $lastPageIndex = intval(ceil(($sliderCount - $limit) / $limit));
219 $sliders = $slidersModel->getAll(0, 'published', $orderBy, $orderDirection, $lastPageIndex, $limit);
220 $result['pageIndex'] = $lastPageIndex;
221 }
222
223 if (!empty($sliders)) {
224 foreach ($sliders as $slider) {
225 $result['sliders'][] = array(
226 'id' => $slider['id'],
227 'alias' => $slider['alias'],
228 'title' => $slider['title'],
229 'thumbnail' => $this->getSliderThumbnail($slider),
230 'isGroup' => $slider['type'] == 'group',
231 'childrenCount' => $slider['slides'] > 0 ? $slider['slides'] : 0,
232 'editUrl' => $this->getUrlSliderEdit($slider['id'], 0),
233 'order' => $slider['ordering']
234 );
235 }
236 $result['slidersPerPage'] = count($sliders);
237 }
238 $result['sliderCount'] = $sliderCount;
239
240 $this->response->respond($result);
241 }
242
148 protected function actionImport() { 243 protected function actionImport() {
149 244
150 $this->validateToken(); 245 $this->validateToken();
......
...@@ -39,10 +39,10 @@ class ControllerSliders extends AbstractControllerAdmin { ...@@ -39,10 +39,10 @@ class ControllerSliders extends AbstractControllerAdmin {
39 } 39 }
40 40
41 protected function actionIndex() { 41 protected function actionIndex() {
42
43 $this->loadSliderManager(); 42 $this->loadSliderManager();
44 43
45 $view = new ViewSlidersIndex($this); 44 $view = new ViewSlidersIndex($this);
45 $view->setPaginationIndex(max(0, intval(Request::$REQUEST->getInt('pageIndex', 0)) - 1)); /*-1 needs because beautified query string*/
46 46
47 $view->display(); 47 $view->display();
48 } 48 }
...@@ -54,31 +54,10 @@ class ControllerSliders extends AbstractControllerAdmin { ...@@ -54,31 +54,10 @@ class ControllerSliders extends AbstractControllerAdmin {
54 $view->display(); 54 $view->display();
55 } 55 }
56 56
57 protected function actionOrderBy() {
58 $ordering = Request::$REQUEST->getCmd('ordering', null);
59 if ($ordering == 'DESC' || $ordering == 'ASC') {
60 Settings::set('slidersOrder2', 'ordering');
61 Settings::set('slidersOrder2Direction', 'ASC');
62 }
63
64 $time = Request::$REQUEST->getCmd('time', null);
65 if ($time == 'DESC' || $time == 'ASC') {
66 Settings::set('slidersOrder2', 'time');
67 Settings::set('slidersOrder2Direction', $time);
68 }
69 $title = Request::$REQUEST->getCmd('title', null);
70 if ($title == 'DESC' || $title == 'ASC') {
71 Settings::set('slidersOrder2', 'title');
72 Settings::set('slidersOrder2Direction', $title);
73 }
74
75 $this->redirectToSliders();
76 }
77
78 protected function actionExportAll() { 57 protected function actionExportAll() {
79 $slidersModel = new ModelSliders($this); 58 $slidersModel = new ModelSliders($this);
80 $sliders = $slidersModel->getAll(Request::$REQUEST->getInt('currentGroupID', 0), 'published'); 59 $groupID = (Request::$REQUEST->getVar('inSearch', false))?'*':Request::$REQUEST->getInt('currentGroupID', 0);
81 60 $sliders = $slidersModel->getAll($groupID, 'published');
82 $ids = Request::$REQUEST->getVar('sliders'); 61 $ids = Request::$REQUEST->getVar('sliders');
83 62
84 $files = array(); 63 $files = array();
......
...@@ -16,6 +16,7 @@ class ViewSlidersIndex extends AbstractView { ...@@ -16,6 +16,7 @@ class ViewSlidersIndex extends AbstractView {
16 * @var LayoutDefault 16 * @var LayoutDefault
17 */ 17 */
18 protected $layout; 18 protected $layout;
19 protected $paginationIndex = 0;
19 20
20 public function display() { 21 public function display() {
21 22
...@@ -35,12 +36,17 @@ class ViewSlidersIndex extends AbstractView { ...@@ -35,12 +36,17 @@ class ViewSlidersIndex extends AbstractView {
35 $this->layout->render(); 36 $this->layout->render();
36 } 37 }
37 38
39 public function setPaginationIndex($index) {
40 $this->paginationIndex = $index;
41 }
42
38 protected function displayHeader() { 43 protected function displayHeader() {
39 } 44 }
40 45
41 protected function displaySliderManager() { 46 protected function displaySliderManager() {
42 47
43 $sliderManager = new BlockSliderManager($this); 48 $sliderManager = new BlockSliderManager($this);
49 $sliderManager->setPaginationIndex($this->paginationIndex);
44 $this->layout->addContentBlock($sliderManager); 50 $this->layout->addContentBlock($sliderManager);
45 } 51 }
46 } 52 }
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -30,12 +30,20 @@ trait TraitAdminUrl { ...@@ -30,12 +30,20 @@ trait TraitAdminUrl {
30 )); 30 ));
31 } 31 }
32 32
33 public function getUrlDashboardOrderBy($orderBy, $direction) { 33 public function getUrlPaginator() {
34 $args = array();
35 34
36 $args[$orderBy] = $direction; 35 return $this->createAjaxUrl(array(
36 'sliders/pagination',
37 ));
38 }
37 39
38 return $this->createUrl(array( 40 public function getUrlDashboardOrderBy($orderBy, $direction, $page = null, $limit = null) {
41 $args = array();
42 $args[$orderBy] = $direction;
43 $args['pageIndex'] = $page;
44 $args['limit'] = $limit;
45
46 return $this->createAjaxUrl(array(
39 'sliders/orderby', 47 'sliders/orderby',
40 $args 48 $args
41 ), true); 49 ), true);
......
...@@ -48,12 +48,13 @@ class ModelSliders extends AbstractModelTable { ...@@ -48,12 +48,13 @@ class ModelSliders extends AbstractModelTable {
48 public function getWithThumbnail($id) { 48 public function getWithThumbnail($id) {
49 $slidesModel = new ModelSlides($this); 49 $slidesModel = new ModelSlides($this);
50 50
51 return Database::queryRow("SELECT sliders.*, IF(sliders.thumbnail != '',sliders.thumbnail,(SELECT slides.thumbnail from " . $slidesModel->getTableName() . " AS slides WHERE slides.slider = sliders.id AND slides.published = 1 AND slides.generator_id = 0 AND slides.thumbnail NOT LIKE '' ORDER BY slides.first DESC, slides.ordering ASC LIMIT 1)) AS thumbnail, 51 return Database::queryRow("SELECT sliders.*,xref.group_id, IF(sliders.thumbnail != '',sliders.thumbnail,(SELECT slides.thumbnail from " . $slidesModel->getTableName() . " AS slides WHERE slides.slider = sliders.id AND slides.published = 1 AND slides.generator_id = 0 AND slides.thumbnail NOT LIKE '' ORDER BY slides.first DESC, slides.ordering ASC LIMIT 1)) AS thumbnail,
52 IF(sliders.type != 'group', 52 IF(sliders.type != 'group',
53 (SELECT count(*) FROM " . $slidesModel->getTableName() . " AS slides2 WHERE slides2.slider = sliders.id GROUP BY slides2.slider), 53 (SELECT count(*) FROM " . $slidesModel->getTableName() . " AS slides2 WHERE slides2.slider = sliders.id GROUP BY slides2.slider),
54 (SELECT count(*) FROM " . $this->xref->getTableName() . " AS xref2 WHERE xref2.group_id = sliders.id GROUP BY xref2.group_id) 54 (SELECT count(*) FROM " . $this->xref->getTableName() . " AS xref2 WHERE xref2.group_id = sliders.id GROUP BY xref2.group_id)
55 ) AS slides 55 ) AS slides
56 FROM " . $this->getTableName() . " AS sliders 56 FROM " . $this->getTableName() . " AS sliders
57 LEFT JOIN " . $this->xref->getTableName() . " AS xref ON xref.slider_id = sliders.id
57 WHERE sliders.id = :id", array( 58 WHERE sliders.id = :id", array(
58 ":id" => $id 59 ":id" => $id
59 )); 60 ));
...@@ -71,8 +72,22 @@ class ModelSliders extends AbstractModelTable { ...@@ -71,8 +72,22 @@ class ModelSliders extends AbstractModelTable {
71 $this->markChanged($sliderid); 72 $this->markChanged($sliderid);
72 } 73 }
73 74
74 public function getSlidersCount() { 75 public function getSlidersCount($status = '*', $witGroup = false) {
75 $data = Database::queryRow("SELECT COUNT(*) AS sliders FROM " . $this->getTableName()); 76 $wheres = array();
77 $join = "";
78
79 if ($status !== '*') {
80 $wheres[] = " WHERE _sliders.status LIKE " . Database::quote($status);
81 }
82
83 if ($witGroup) {
84 $join = "LEFT JOIN " . $this->xref->getTableName() . " AS xref ON xref.slider_id = _sliders.id ";
85 $wheres[] = "(xref.group_id IS NULL OR xref.group_id = 0)";
86 }
87
88 $data = Database::queryRow("SELECT COUNT(*) AS sliders FROM " . $this->getTableName() . " as _sliders " . $join . " " . implode(' AND ', $wheres));
89
90
76 if (!empty($data)) { 91 if (!empty($data)) {
77 return intval($data['sliders']); 92 return intval($data['sliders']);
78 } 93 }
...@@ -83,7 +98,7 @@ class ModelSliders extends AbstractModelTable { ...@@ -83,7 +98,7 @@ class ModelSliders extends AbstractModelTable {
83 /** 98 /**
84 * @return mixed 99 * @return mixed
85 */ 100 */
86 public function getAll($groupID = '*', $status = '*', $orderBy = 'ordering', $orderByDirection = 'ASC') { 101 public function getAll($groupID = '*', $status = '*', $orderBy = 'ordering', $orderByDirection = 'ASC', $page = null, $limit = 'all') {
87 $slidesModel = new ModelSlides($this); 102 $slidesModel = new ModelSlides($this);
88 103
89 if (empty($orderBy)) { 104 if (empty($orderBy)) {
...@@ -93,12 +108,17 @@ class ModelSliders extends AbstractModelTable { ...@@ -93,12 +108,17 @@ class ModelSliders extends AbstractModelTable {
93 $orderByDirection = 'ASC'; 108 $orderByDirection = 'ASC';
94 } 109 }
95 110
96 $_orderby = $orderBy . ' ' . $orderByDirection; 111 $_orderby = $orderBy . ' ' . $orderByDirection;
112 $limitQuery = "";
97 113
98 $wheres = array(); 114 $wheres = array();
99 if ($groupID !== '*') { 115 if ($groupID !== '*') {
100 if ($groupID == 0) { 116 if ($groupID == 0) {
101 $wheres[] = "(xref.group_id IS NULL OR xref.group_id = 0)"; 117 $wheres[] = "(xref.group_id IS NULL OR xref.group_id = 0)";
118 if ($page !== null && $limit != 'all') {
119 $first = intval($page) * intval($limit);
120 $limitQuery = "LIMIT " . $first . "," . intval($limit);
121 }
102 } else { 122 } else {
103 if ($orderBy == 'ordering') { 123 if ($orderBy == 'ordering') {
104 $_orderby = 'xref.' . $orderBy . ' ' . $orderByDirection; 124 $_orderby = 'xref.' . $orderBy . ' ' . $orderByDirection;
...@@ -112,6 +132,7 @@ class ModelSliders extends AbstractModelTable { ...@@ -112,6 +132,7 @@ class ModelSliders extends AbstractModelTable {
112 $wheres[] = "sliders.status LIKE " . Database::quote($status); 132 $wheres[] = "sliders.status LIKE " . Database::quote($status);
113 } 133 }
114 134
135
115 $sliders = Database::queryAll(" 136 $sliders = Database::queryAll("
116 SELECT sliders.*, 137 SELECT sliders.*,
117 IF(sliders.thumbnail != '', 138 IF(sliders.thumbnail != '',
...@@ -129,7 +150,8 @@ class ModelSliders extends AbstractModelTable { ...@@ -129,7 +150,8 @@ class ModelSliders extends AbstractModelTable {
129 FROM " . $this->getTableName() . " AS sliders 150 FROM " . $this->getTableName() . " AS sliders
130 LEFT JOIN " . $this->xref->getTableName() . " AS xref ON xref.slider_id = sliders.id 151 LEFT JOIN " . $this->xref->getTableName() . " AS xref ON xref.slider_id = sliders.id
131 WHERE " . implode(' AND ', $wheres) . " 152 WHERE " . implode(' AND ', $wheres) . "
132 ORDER BY " . $_orderby); 153 ORDER BY " . $_orderby . " " . $limitQuery);
154
133 155
134 return $sliders; 156 return $sliders;
135 } 157 }
...@@ -138,6 +160,46 @@ class ModelSliders extends AbstractModelTable { ...@@ -138,6 +160,46 @@ class ModelSliders extends AbstractModelTable {
138 return Database::queryAll("SELECT sliders.* FROM " . $this->getTableName() . " AS sliders"); 160 return Database::queryAll("SELECT sliders.* FROM " . $this->getTableName() . " AS sliders");
139 } 161 }
140 162
163 public function getSearchResults($keyword = "") {
164 $slidesModel = new ModelSlides($this);
165 $wheres = array();
166 $orderByExtra = "";
167 $id = intval($keyword);
168 if ($id > 0) {
169 $wheres[] = "sliders.id LIKE '%" . $id . "%'";
170 $orderByExtra = "(sliders.id = '" . $id . "') DESC, ";
171 }
172
173 $wheres[] = "sliders.alias LIKE " . Database::quote('%' . $keyword . '%') . " OR sliders.title LIKE " . Database::quote('%' . $keyword . '%');
174
175 return Database::queryAll("SELECT sliders.*,
176 xref.group_id,
177 IF(sliders.thumbnail != '',
178 sliders.thumbnail,
179 IF(sliders.type != 'group',
180 (SELECT slides.thumbnail FROM " . $slidesModel->getTableName() . " AS slides WHERE slides.slider = sliders.id AND slides.published = 1 AND slides.generator_id = 0 AND slides.thumbnail NOT LIKE '' ORDER BY slides.first DESC, slides.ordering ASC LIMIT 1),
181 ''
182 )
183 ) AS thumbnail,
184 IF(sliders.type != 'group',
185 (SELECT count(*) FROM " . $slidesModel->getTableName() . " AS slides2 WHERE slides2.slider = sliders.id GROUP BY slides2.slider),
186 (SELECT count(*) FROM " . $this->xref->getTableName() . " AS xref2 LEFT JOIN " . $this->getTableName() . " AS sliders2 ON sliders2.id = xref2.slider_id WHERE xref2.group_id = sliders.id AND sliders2.status LIKE 'published' GROUP BY xref2.group_id)
187 ) AS slides
188 FROM " . $this->getTableName() . " AS sliders
189 LEFT JOIN " . $this->xref->getTableName() . " AS xref ON xref.slider_id = sliders.id
190 WHERE
191 (
192 xref.group_id IS NULL
193 OR xref.group_id = 0
194 OR (SELECT _sliders.status FROM " . $this->getTableName() . " AS _sliders WHERE _sliders.id = xref.group_id ) LIKE 'published'
195 )
196 AND sliders.status LIKE 'published'
197 AND (" . implode(' OR ', $wheres) . ")
198 GROUP BY sliders.id
199 ORDER BY " . $orderByExtra . "sliders.title ASC");
200
201 }
202
141 public function getGroups($status = '*') { 203 public function getGroups($status = '*') {
142 204
143 $wheres = array( 205 $wheres = array(
...@@ -167,7 +229,8 @@ class ModelSliders extends AbstractModelTable { ...@@ -167,7 +229,8 @@ class ModelSliders extends AbstractModelTable {
167 'type' => $slider['type'], 229 'type' => $slider['type'],
168 'thumbnail' => empty($slider['thumbnail']) ? '' : $slider['thumbnail'], 230 'thumbnail' => empty($slider['thumbnail']) ? '' : $slider['thumbnail'],
169 'params' => $slider['params']->toJSON(), 231 'params' => $slider['params']->toJSON(),
170 'time' => date('Y-m-d H:i:s', Platform::getTimestamp()) 232 'time' => date('Y-m-d H:i:s', Platform::getTimestamp()),
233 'ordering' => -1
171 )); 234 ));
172 235
173 $sliderID = $this->table->insertId(); 236 $sliderID = $this->table->insertId();
...@@ -177,6 +240,7 @@ class ModelSliders extends AbstractModelTable { ...@@ -177,6 +240,7 @@ class ModelSliders extends AbstractModelTable {
177 } 240 }
178 241
179 $this->xref->add($groupID, $sliderID); 242 $this->xref->add($groupID, $sliderID);
243 $this->reindexOrdering();
180 244
181 SmartSlider3Info::sliderChanged(); 245 SmartSlider3Info::sliderChanged();
182 246
...@@ -276,12 +340,13 @@ class ModelSliders extends AbstractModelTable { ...@@ -276,12 +340,13 @@ class ModelSliders extends AbstractModelTable {
276 'params' => json_encode($slider), 340 'params' => json_encode($slider),
277 'thumbnail' => $thumbnail, 341 'thumbnail' => $thumbnail,
278 'time' => date('Y-m-d H:i:s', Platform::getTimestamp()), 342 'time' => date('Y-m-d H:i:s', Platform::getTimestamp()),
279 'ordering' => $this->getMaximalOrderValue() 343 'ordering' => -1
280 )); 344 ));
281 345
282 $sliderID = $this->table->insertId(); 346 $sliderID = $this->table->insertId();
283 347
284 $this->xref->add($groupID, $sliderID); 348 $this->xref->add($groupID, $sliderID);
349 $this->reindexOrdering();
285 350
286 SmartSlider3Info::sliderChanged(); 351 SmartSlider3Info::sliderChanged();
287 352
...@@ -575,6 +640,7 @@ class ModelSliders extends AbstractModelTable { ...@@ -575,6 +640,7 @@ class ModelSliders extends AbstractModelTable {
575 AbstractCache::clearGroup(AdminSlider::getCacheId($id)); 640 AbstractCache::clearGroup(AdminSlider::getCacheId($id));
576 641
577 $this->markChanged($id); 642 $this->markChanged($id);
643 $this->reindexOrdering();
578 644
579 SmartSlider3Info::sliderChanged(); 645 SmartSlider3Info::sliderChanged();
580 646
...@@ -660,6 +726,8 @@ class ModelSliders extends AbstractModelTable { ...@@ -660,6 +726,8 @@ class ModelSliders extends AbstractModelTable {
660 } 726 }
661 } 727 }
662 728
729 $this->reindexOrdering();
730
663 SmartSlider3Info::sliderChanged(); 731 SmartSlider3Info::sliderChanged();
664 732
665 return $newSliderId; 733 return $newSliderId;
...@@ -671,7 +739,8 @@ class ModelSliders extends AbstractModelTable { ...@@ -671,7 +739,8 @@ class ModelSliders extends AbstractModelTable {
671 $helper->setSliderChanged($sliderid, 1); 739 $helper->setSliderChanged($sliderid, 1);
672 } 740 }
673 741
674 public function order($groupID, $ids, $isReverse = false) { 742 public function order($groupID, $ids, $isReverse = false, $orders = array()) {
743
675 if (is_array($ids) && count($ids) > 0) { 744 if (is_array($ids) && count($ids) > 0) {
676 if ($isReverse) { 745 if ($isReverse) {
677 $ids = array_reverse($ids); 746 $ids = array_reverse($ids);
...@@ -680,13 +749,23 @@ class ModelSliders extends AbstractModelTable { ...@@ -680,13 +749,23 @@ class ModelSliders extends AbstractModelTable {
680 if ($groupID <= 0) { 749 if ($groupID <= 0) {
681 $groupID = false; 750 $groupID = false;
682 } 751 }
752 if (!empty($orders)) {
753 asort($orders);
754 $orders = array_values($orders);
755 }
756
683 $i = 0; 757 $i = 0;
684 foreach ($ids as $id) { 758 foreach ($ids as $id) {
685 $id = intval($id); 759 $id = intval($id);
686 if ($id > 0) { 760 if ($id > 0) {
687 if (!$groupID) { 761 if (!$groupID) {
762 if (!empty($orders)) {
763 $order = intval($orders[$i]);
764 } else {
765 $order = $i;
766 }
688 $this->table->update(array( 767 $this->table->update(array(
689 'ordering' => $i, 768 'ordering' => $order,
690 ), array( 769 ), array(
691 "id" => $id 770 "id" => $id
692 )); 771 ));
...@@ -709,6 +788,18 @@ class ModelSliders extends AbstractModelTable { ...@@ -709,6 +788,18 @@ class ModelSliders extends AbstractModelTable {
709 return false; 788 return false;
710 } 789 }
711 790
791 public function reindexOrdering() {
792 $sliders = $this->getAll(0);
793 foreach ($sliders as $idx => $slider) {
794 $this->table->update(array(
795 'ordering' => $idx
796 ), array(
797 "id" => $slider['id']
798 ));
799 }
800
801 }
802
712 protected function getMaximalOrderValue() { 803 protected function getMaximalOrderValue() {
713 804
714 $query = "SELECT MAX(ordering) AS ordering FROM " . $this->getTableName() . ""; 805 $query = "SELECT MAX(ordering) AS ordering FROM " . $this->getTableName() . "";
......
...@@ -128,6 +128,69 @@ class PostsPostsByIDs extends AbstractGenerator { ...@@ -128,6 +128,69 @@ class PostsPostsByIDs extends AbstractGenerator {
128 } 128 }
129 } 129 }
130 } 130 }
131
132 $post_meta = get_post_meta($post->ID);
133
134 $excluded_metas = array(
135 'hc-editor-mode',
136 'techline-sidebar'
137 );
138
139 foreach ($excluded_metas as $excluded_meta) {
140 if (isset($post_meta[$excluded_meta])) {
141 unset($post_meta[$excluded_meta]);
142 }
143 }
144
145 if (count($post_meta) && is_array($post_meta) && !empty($post_meta)) {
146 foreach ($post_meta as $key => $value) {
147 if (count($value) && is_array($value) && !empty($value)) {
148 foreach ($value as $v) {
149 if (!empty($v) && !is_array($v) && !is_object($v)) {
150 $key = str_replace(array(
151 '_',
152 '-'
153 ), array(
154 '',
155 ''
156 ), $key);
157 if (array_key_exists($key, $record)) {
158 $key = 'meta' . $key;
159 }
160 if (is_serialized($v)) {
161 $unserialize_values = unserialize($v);
162 $unserialize_count = 1;
163 if (!empty($unserialize_values) && is_array($unserialize_values)) {
164 foreach ($unserialize_values as $unserialize_value) {
165 if (!empty($unserialize_value) && is_string($unserialize_value)) {
166 $record['us_' . $key . $unserialize_count] = $unserialize_value;
167 $unserialize_count++;
168 } else if (is_array($unserialize_value)) {
169 foreach ($unserialize_value as $u_v) {
170 if (is_string($u_v)) {
171 $record['us_' . $key . $unserialize_count] = $u_v;
172 $unserialize_count++;
173 }
174 }
175 }
176 }
177 }
178 } else {
179 $record[$key] = $v;
180 }
181 }
182 }
183 }
184 }
185 if (!empty($record['elementordata'])) {
186 $elementordatas = json_decode($record['elementordata']);
187 foreach ($elementordatas as $elementordata) {
188 foreach ($this->getElementorTextEditors($elementordata) as $elementorKey => $elementorVal) {
189 $record[$elementorKey] = $elementorVal;
190 }
191 }
192 }
193 }
131 if (isset($record['primarytermcategory'])) { 194 if (isset($record['primarytermcategory'])) {
132 $primary = get_category($record['primarytermcategory']); 195 $primary = get_category($record['primarytermcategory']);
133 $record['primary_category_name'] = $primary->name; 196 $record['primary_category_name'] = $primary->name;
......
...@@ -18,6 +18,11 @@ class Install { ...@@ -18,6 +18,11 @@ class Install {
18 $tables->install(); 18 $tables->install();
19 InstallWordPress::install(); 19 InstallWordPress::install();
20 20
21 preg_match('/[\d\.]+[\d]/', Settings::get('n2_ss3_version'), $oldversion);
22 if ($oldversion && version_compare($oldversion[0], "3.5.1.2", '<=')) {
23 $tables->reindexOrders();
24 }
25
21 Settings::set('n2_ss3_version', SmartSlider3Info::$completeVersion); 26 Settings::set('n2_ss3_version', SmartSlider3Info::$completeVersion);
22 27
23 /** 28 /**
......
...@@ -204,6 +204,28 @@ class Tables { ...@@ -204,6 +204,28 @@ class Tables {
204 )); 204 ));
205 } 205 }
206 206
207
208 public function reindexOrders() {
209 $query = "SELECT
210 sliders.*
211 FROM
212 `#__nextend2_smartslider3_sliders` AS sliders
213 LEFT JOIN `#__nextend2_smartslider3_sliders_xref` AS xref
214 ON
215 xref.slider_id = sliders.id
216 WHERE
217 (
218 xref.group_id IS NULL OR xref.group_id = 0
219 )
220 ORDER BY ordering";
221 $sliders = Database::queryAll(Database::parsePrefix($query));
222 foreach ($sliders as $idx => $slider) {
223 $this->query("UPDATE `#__nextend2_smartslider3_sliders` SET `ordering` = '" . $idx . "' WHERE `id` = " . $slider['id'] . " ");
224 }
225
226 }
227
228
207 /** 229 /**
208 * @param string $tableName 230 * @param string $tableName
209 * @param array|string $colNames 231 * @param array|string $colNames
......
...@@ -14,12 +14,19 @@ class WidgetHelper { ...@@ -14,12 +14,19 @@ class WidgetHelper {
14 $this, 14 $this,
15 'widgets_init' 15 'widgets_init'
16 ), 11); 16 ), 11);
17 add_action('widgets_admin_page', array( 17
18 $this, 18 /**
19 'widgets_admin_page' 19 * As fallback for the Classic Widgets
20 )); 20 */
21 if ($this->isOldEditor()) {
22 add_action('widgets_admin_page', array(
23 $this,
24 'widgets_admin_page'
25 ));
26 }
21 } 27 }
22 28
29
23 public function widgets_init() { 30 public function widgets_init() {
24 31
25 /** 32 /**
...@@ -32,10 +39,10 @@ class WidgetHelper { ...@@ -32,10 +39,10 @@ class WidgetHelper {
32 $widgetAreas = intval(Settings::get('wordpress-widget-areas', 1)); 39 $widgetAreas = intval(Settings::get('wordpress-widget-areas', 1));
33 if ($widgetAreas > 0) { 40 if ($widgetAreas > 0) {
34 for ($i = 1; $i <= $widgetAreas; $i++) { 41 for ($i = 1; $i <= $widgetAreas; $i++) {
35 42 $description = (!$this->isOldEditor()) ? 'Display this widget area in your theme: <strong>&lt;?php dynamic_sidebar( \'smartslider_area_' . $i . '\' ); ?&gt; </strong>' : '';
36 register_sidebar(array( 43 register_sidebar(array(
37 'name' => 'Custom Widget Area - #' . $i, 44 'name' => 'Custom Widget Area - #' . $i,
38 'description' => '', 45 'description' => $description,
39 'id' => 'smartslider_area_' . $i, 46 'id' => 'smartslider_area_' . $i,
40 'before_widget' => '', 47 'before_widget' => '',
41 'after_widget' => '', 48 'after_widget' => '',
...@@ -59,4 +66,10 @@ class WidgetHelper { ...@@ -59,4 +66,10 @@ class WidgetHelper {
59 } 66 }
60 67
61 } 68 }
69
70 private function isOldEditor() {
71 $blockEditor = function_exists('wp_use_widgets_block_editor');
72
73 return !$blockEditor || ($blockEditor && !wp_use_widgets_block_editor());
74 }
62 } 75 }
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -602,9 +602,9 @@ abstract class AbstractComponent { ...@@ -602,9 +602,9 @@ abstract class AbstractComponent {
602 $this->addLocalStyle('normal', 'background', $this->getBackgroundCSS($color, $gradient, $colorEnd, $backgroundStyle) . $backgroundStyle); 602 $this->addLocalStyle('normal', 'background', $this->getBackgroundCSS($color, $gradient, $colorEnd, $backgroundStyle) . $backgroundStyle);
603 603
604 604
605 $colorHover = $this->data->get('bgcolor-hover'); 605 $colorHover = $this->owner->fill($this->data->get('bgcolor-hover'));
606 $gradientHover = $this->data->get('bgcolorgradient-hover'); 606 $gradientHover = $this->data->get('bgcolorgradient-hover');
607 $colorEndHover = $this->data->get('bgcolorgradientend-hover'); 607 $colorEndHover = $this->owner->fill($this->data->get('bgcolorgradientend-hover'));
608 $isHoverDifferent = false; 608 $isHoverDifferent = false;
609 if (!empty($colorHover) && $colorHover != $color) { 609 if (!empty($colorHover) && $colorHover != $color) {
610 $isHoverDifferent = true; 610 $isHoverDifferent = true;
......
...@@ -175,10 +175,10 @@ class ItemYouTubeFrontend extends AbstractItemFrontend { ...@@ -175,10 +175,10 @@ class ItemYouTubeFrontend extends AbstractItemFrontend {
175 } 175 }
176 176
177 private function parseYoutubeUrl($youTubeUrl) { 177 private function parseYoutubeUrl($youTubeUrl) {
178 preg_match('/^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#\&\?]*).*/', $youTubeUrl, $matches); 178 preg_match('%(?:youtube(?:-nocookie)?\.com/(?:[^/]+/.+/|(?:v|e(?:mbed)?)/|.*[?&]v=)|youtu\.be/)([^"&?/\s]{11})%i', $youTubeUrl, $matches);
179 179
180 if ($matches && isset($matches[7]) && strlen($matches[7]) == 11) { 180 if ($matches && isset($matches[1]) && strlen($matches[1]) == 11) {
181 return $matches[7]; 181 return $matches[1];
182 } 182 }
183 183
184 return $youTubeUrl; 184 return $youTubeUrl;
......
...@@ -56,26 +56,36 @@ class SVGFlip { ...@@ -56,26 +56,36 @@ class SVGFlip {
56 $pathCommand = substr($values[$i], 0, 1); 56 $pathCommand = substr($values[$i], 0, 1);
57 $pathPart = substr($values[$i], 1); 57 $pathPart = substr($values[$i], 1);
58 $points = explode(',', $pathPart); 58 $points = explode(',', $pathPart);
59 for ($j = 0; $j < count($points); $j = $j + 2) { 59 if ($pathCommand === 'A') {
60 switch ($pathCommand) { 60 $points[2] = -$points[2];
61 case 'l': 61 $points[4] = ($points[4]) ? 1 : 0;
62 case 'm': 62 $points[5] = self::$viewBoxX - $points[5];
63 case 'h': 63 } else if ($pathCommand == 'a') {
64 case 'c': 64 $points[2] = -$points[2];
65 case 's': 65 $points[4] = ($points[4]) ? 1 : 0;
66 case 'q': 66 $points[5] = -$points[5];
67 case 't': 67 } else {
68 $points[$j] = -$points[$j]; 68 for ($j = 0; $j < count($points); $j = $j + 2) {
69 break; 69 switch ($pathCommand) {
70 case 'L': 70 case 'l':
71 case 'M': 71 case 'm':
72 case 'H': 72 case 'h':
73 case 'C': 73 case 'c':
74 case 'S': 74 case 's':
75 case 'Q': 75 case 'q':
76 case 'T': 76 case 't':
77 $points[$j] = self::$viewBoxX - $points[$j]; 77 $points[$j] = -$points[$j];
78 break; 78 break;
79 case 'L':
80 case 'M':
81 case 'H':
82 case 'C':
83 case 'S':
84 case 'Q':
85 case 'T':
86 $points[$j] = self::$viewBoxX - $points[$j];
87 break;
88 }
79 } 89 }
80 } 90 }
81 $newPath .= $pathCommand . implode(',', $points); 91 $newPath .= $pathCommand . implode(',', $points);
...@@ -94,30 +104,40 @@ class SVGFlip { ...@@ -94,30 +104,40 @@ class SVGFlip {
94 $pathCommand = substr($values[$i], 0, 1); 104 $pathCommand = substr($values[$i], 0, 1);
95 $pathPart = substr($values[$i], 1); 105 $pathPart = substr($values[$i], 1);
96 $points = explode(',', $pathPart); 106 $points = explode(',', $pathPart);
97 for ($j = 0; $j < count($points); $j = $j + 2) { 107 if ($pathCommand === 'A') {
98 switch ($pathCommand) { 108 $points[2] = -$points[2];
99 case 'v': 109 $points[4] = ($points[4]) ? 1 : 0;
100 $points[$j] = -$points[$j]; 110 $points[6] = self::$viewBoxY - $points[6];
101 break; 111 } else if ($pathCommand === 'a') {
102 case 'V': 112 $points[2] = -$points[2];
103 $points[$j] = self::$viewBoxY - $points[$j]; 113 $points[4] = ($points[4]) ? 1 : 0;
104 break; 114 $points[6] = -$points[6];
105 case 'l': 115 } else {
106 case 'm': 116 for ($j = 0; $j < count($points); $j = $j + 2) {
107 case 'c': 117 switch ($pathCommand) {
108 case 's': 118 case 'v':
109 case 'q': 119 $points[$j] = -$points[$j];
110 case 't': 120 break;
111 $points[$j + 1] = -$points[$j + 1]; 121 case 'V':
112 break; 122 $points[$j] = self::$viewBoxY - $points[$j];
113 case 'L': 123 break;
114 case 'M': 124 case 'l':
115 case 'C': 125 case 'm':
116 case 'S': 126 case 'c':
117 case 'Q': 127 case 's':
118 case 'T': 128 case 'q':
119 $points[$j + 1] = self::$viewBoxY - $points[$j + 1]; 129 case 't':
120 break; 130 $points[$j + 1] = -$points[$j + 1];
131 break;
132 case 'L':
133 case 'M':
134 case 'C':
135 case 'S':
136 case 'Q':
137 case 'T':
138 $points[$j + 1] = self::$viewBoxY - $points[$j + 1];
139 break;
140 }
121 } 141 }
122 } 142 }
123 $newPath .= $pathCommand . implode(',', $points); 143 $newPath .= $pathCommand . implode(',', $points);
...@@ -136,36 +156,44 @@ class SVGFlip { ...@@ -136,36 +156,44 @@ class SVGFlip {
136 $pathCommand = substr($values[$i], 0, 1); 156 $pathCommand = substr($values[$i], 0, 1);
137 $pathPart = substr($values[$i], 1); 157 $pathPart = substr($values[$i], 1);
138 $points = explode(',', $pathPart); 158 $points = explode(',', $pathPart);
139 for ($j = 0; $j < count($points); $j = $j + 2) { 159 if ($pathCommand === 'A') {
140 switch ($pathCommand) { 160 $points[5] = self::$viewBoxX - $points[5];
141 case 'h': 161 $points[6] = self::$viewBoxY - $points[6];
142 case 'v': 162 } else if ($pathCommand == 'a') {
143 $points[$j] = -$points[$j]; 163 $points[5] = -$points[5];
144 break; 164 $points[6] = -$points[6];
145 case 'H': 165 } else {
146 $points[$j] = self::$viewBoxX - $points[$j]; 166 for ($j = 0; $j < count($points); $j = $j + 2) {
147 break; 167 switch ($pathCommand) {
148 case 'V': 168 case 'h':
149 $points[$j] = self::$viewBoxY - $points[$j]; 169 case 'v':
150 break; 170 $points[$j] = -$points[$j];
151 case 'l': 171 break;
152 case 'm': 172 case 'H':
153 case 'c': 173 $points[$j] = self::$viewBoxX - $points[$j];
154 case 's': 174 break;
155 case 'q': 175 case 'V':
156 case 't': 176 $points[$j] = self::$viewBoxY - $points[$j];
157 $points[$j] = -$points[$j]; 177 break;
158 $points[$j + 1] = -$points[$j + 1]; 178 case 'l':
159 break; 179 case 'm':
160 case 'L': 180 case 'c':
161 case 'M': 181 case 's':
162 case 'C': 182 case 'q':
163 case 'S': 183 case 't':
164 case 'Q': 184 $points[$j] = -$points[$j];
165 case 'T': 185 $points[$j + 1] = -$points[$j + 1];
166 $points[$j] = self::$viewBoxX - $points[$j]; 186 break;
167 $points[$j + 1] = self::$viewBoxY - $points[$j + 1]; 187 case 'L':
168 break; 188 case 'M':
189 case 'C':
190 case 'S':
191 case 'Q':
192 case 'T':
193 $points[$j] = self::$viewBoxX - $points[$j];
194 $points[$j + 1] = self::$viewBoxY - $points[$j + 1];
195 break;
196 }
169 } 197 }
170 } 198 }
171 $newPath .= $pathCommand . implode(',', $points); 199 $newPath .= $pathCommand . implode(',', $points);
......
...@@ -14,15 +14,15 @@ use Nextend\SmartSlider3\Application\Model\ModelLicense; ...@@ -14,15 +14,15 @@ use Nextend\SmartSlider3\Application\Model\ModelLicense;
14 14
15 class SmartSlider3Info { 15 class SmartSlider3Info {
16 16
17 public static $version = '3.5.1.2'; 17 public static $version = '3.5.1.3';
18 18
19 public static $channel = 'stable'; 19 public static $channel = 'stable';
20 20
21 public static $revision = 'f4759c2e729fca8cf3071d0c6356eadecf6f7308'; 21 public static $revision = '5023544a4fcfe8dfb1226d4b8c667713df879709';
22 22
23 public static $revisionShort = 'f4759c2e'; 23 public static $revisionShort = '5023544a';
24 24
25 public static $branch = 'release-3.5.1.2'; 25 public static $branch = 'release-3.5.1.3';
26 26
27 public static $completeVersion; 27 public static $completeVersion;
28 28
......
...@@ -94,7 +94,7 @@ class OutputBuffer { ...@@ -94,7 +94,7 @@ class OutputBuffer {
94 $this, 94 $this,
95 "outputCallback" 95 "outputCallback"
96 )); 96 ));
97 }); 97 }, 11);
98 } 98 }
99 } 99 }
100 100
......
1 !function(t){var i=t;i._N2=i._N2||{_r:[],_d:[],r:function(){this._r.push(arguments)},d:function(){this._d.push(arguments)}};var s,n=t.document,h=(n.documentElement,t.setTimeout),o=t.clearTimeout,r=i._N2;t.requestAnimationFrame,n.createElement.bind(n),Object.assign,navigator.userAgent.indexOf("+http://www.google.com/bot.html")>-1||i.requestIdleCallback,i.cancelIdleCallback;s=function(){n.body},"complete"===n.readyState||"interactive"===n.readyState?s():Document&&Document.prototype&&Document.prototype.addEventListener&&Document.prototype.addEventListener!==n.addEventListener?Document.prototype.addEventListener.call(n,"DOMContentLoaded",s):n.addEventListener("DOMContentLoaded",s),r.d("SmartSliderBlock",["SmartSliderAbstract"],(function(){function t(t,i){this.type="block",this.responsiveClass=r.SmartSliderResponsiveBlock,r.SmartSliderAbstract.prototype.constructor.call(this,t,i)}return t.prototype=Object.create(r.SmartSliderAbstract.prototype),t.prototype.constructor=t,t.prototype.initResponsiveMode=function(){this.responsive=new r.SmartSliderResponsiveBlock(this,this.parameters.responsive),this.responsive.start(),r.SmartSliderAbstract.prototype.initResponsiveMode.call(this)},t.prototype.initMainAnimation=function(){this.mainAnimation=!1,this.isAdmin||this.disabled.postBackgroundAnimations||0==this.parameters.postBackgroundAnimations||(this.postBackgroundAnimation=new r.SmartSliderPostBackgroundAnimation(this,!1))},t.prototype.afterRawSlidesReady=function(){if(this.parameters.postBackgroundAnimations&&this.parameters.postBackgroundAnimations.slides){for(var t=0;t<this.slides.length;t++)this.slides[t].postBackgroundAnimation=this.parameters.postBackgroundAnimations.slides[t];delete this.parameters.postBackgroundAnimations.slides}},t.prototype.getSlideBackgroundContainer=function(){return this.sliderElement.querySelector(".n2-ss-slide").parentNode},t})),r.d("SmartSliderResponsiveBlock",["SmartSliderResponsive"],(function(){function t(){r.SmartSliderResponsive.prototype.constructor.apply(this,arguments),this.xt=this.sliderElement.classList.contains("n2-ss-full-page--constrain-ratio")}return t.prototype=Object.create(r.SmartSliderResponsive.prototype),t.prototype.constructor=t,t.prototype.init=function(){r.SmartSliderResponsive.prototype.init.call(this),this._cacheEl={slider:this.sliderElement.querySelector(".n2-ss-slider-wrapper-inside")||this.sliderElement}},t.prototype.calculateResponsiveValues=function(){var t=this.slider.visibleRealSlides[0].element,i=t.getBoundingClientRect();this.resizeContext.slideSelfWidth=i.width,this.resizeContext.slideSelfHeight=i.height;var s=t.querySelector(".n2-ss-layers-container").getBoundingClientRect();this.resizeContext.slideWidth=s.width,this.resizeContext.slideHeight=s.height;var n=this._cacheEl.slider.getBoundingClientRect();if(this.resizeContext.sliderWidth=n.width,this.resizeContext.sliderHeight=n.height,r.SmartSliderResponsive.prototype.calculateResponsiveValues.call(this),this.xt){var h=(this.resizeContext.sliderWidth-this.resizeContext.slideWidth)/-2+"px",o=(this.resizeContext.sliderHeight-this.resizeContext.slideHeight)/-2+"px";r.MW.k(this._cacheEl.slider)["--ss-clip-path"]="inset("+o+" "+h+" "+o+" "+h+")"}},t})),r.d("ss-block",["SmartSliderBlock","SmartSliderResponsiveBlock"])}(window);
...\ No newline at end of file ...\ No newline at end of file
1 !function(t){var i=t;i._N2=i._N2||{_r:[],_d:[],r:function(){this._r.push(arguments)},d:function(){this._d.push(arguments)}};var s,n=t.document,h=(n.documentElement,t.setTimeout),o=t.clearTimeout,r=i._N2;t.requestAnimationFrame,Object.assign,navigator.userAgent.indexOf("+http://www.google.com/bot.html")>-1||i.requestIdleCallback,i.cancelIdleCallback;s=function(){n.body},"complete"===n.readyState||"interactive"===n.readyState?s():Document&&Document.prototype&&Document.prototype.addEventListener&&Document.prototype.addEventListener!==n.addEventListener?Document.prototype.addEventListener.call(n,"DOMContentLoaded",s):n.addEventListener("DOMContentLoaded",s),r.d("SmartSliderBlock",["SmartSliderAbstract"],(function(){function t(t,i){this.type="block",this.responsiveClass=r.SmartSliderResponsiveBlock,r.SmartSliderAbstract.prototype.constructor.call(this,t,i)}return t.prototype=Object.create(r.SmartSliderAbstract.prototype),t.prototype.constructor=t,t.prototype.initResponsiveMode=function(){this.responsive=new r.SmartSliderResponsiveBlock(this,this.parameters.responsive),this.responsive.start(),r.SmartSliderAbstract.prototype.initResponsiveMode.call(this)},t.prototype.initMainAnimation=function(){this.mainAnimation=!1,this.isAdmin||this.disabled.postBackgroundAnimations||0==this.parameters.postBackgroundAnimations||(this.postBackgroundAnimation=new r.SmartSliderPostBackgroundAnimation(this,!1))},t.prototype.afterRawSlidesReady=function(){if(this.parameters.postBackgroundAnimations&&this.parameters.postBackgroundAnimations.slides){for(var t=0;t<this.slides.length;t++)this.slides[t].postBackgroundAnimation=this.parameters.postBackgroundAnimations.slides[t];delete this.parameters.postBackgroundAnimations.slides}},t.prototype.getSlideBackgroundContainer=function(){return this.sliderElement.querySelector(".n2-ss-slide").parentNode},t})),r.d("SmartSliderResponsiveBlock",["SmartSliderResponsive"],(function(){function t(){r.SmartSliderResponsive.prototype.constructor.apply(this,arguments),this.Dt=this.sliderElement.classList.contains("n2-ss-full-page--constrain-ratio")}return t.prototype=Object.create(r.SmartSliderResponsive.prototype),t.prototype.constructor=t,t.prototype.init=function(){r.SmartSliderResponsive.prototype.init.call(this),this._cacheEl={slider:this.sliderElement.querySelector(".n2-ss-slider-wrapper-inside")||this.sliderElement}},t.prototype.calculateResponsiveValues=function(){var t=this.slider.visibleRealSlides[0].element,i=t.getBoundingClientRect();this.resizeContext.slideSelfWidth=i.width,this.resizeContext.slideSelfHeight=i.height;var s=t.querySelector(".n2-ss-layers-container").getBoundingClientRect();this.resizeContext.slideWidth=s.width,this.resizeContext.slideHeight=s.height;var n=this._cacheEl.slider.getBoundingClientRect();if(this.resizeContext.sliderWidth=n.width,this.resizeContext.sliderHeight=n.height,r.SmartSliderResponsive.prototype.calculateResponsiveValues.call(this),this.Dt){var h=(this.resizeContext.sliderWidth-this.resizeContext.slideWidth)/-2+"px",o=(this.resizeContext.sliderHeight-this.resizeContext.slideHeight)/-2+"px";r.MW.k(this._cacheEl.slider)["--ss-clip-path"]="inset("+o+" "+h+" "+o+" "+h+")"}},t})),r.d("ss-block",["SmartSliderBlock","SmartSliderResponsiveBlock"])}(window);
...\ No newline at end of file ...\ No newline at end of file
......
1 !function(t){var i=t;i._N2=i._N2||{_r:[],_d:[],r:function(){this._r.push(arguments)},d:function(){this._d.push(arguments)}};var n,o=t.document,c=(o.documentElement,t.setTimeout),r=t.clearTimeout,u=i._N2;t.requestAnimationFrame,o.createElement.bind(o),Object.assign,navigator.userAgent.indexOf("+http://www.google.com/bot.html")>-1||i.requestIdleCallback,i.cancelIdleCallback;n=function(){o.body},"complete"===o.readyState||"interactive"===o.readyState?n():Document&&Document.prototype&&Document.prototype.addEventListener&&Document.prototype.addEventListener!==o.addEventListener?Document.prototype.addEventListener.call(o,"DOMContentLoaded",n):o.addEventListener("DOMContentLoaded",n),u.d("SmartSliderWidgetArrowImage","SmartSliderWidget",(function(){function t(t,i,n){this.Dt=n,u.SmartSliderWidget.prototype.constructor.call(this,i,t,"#"+i.elementID+"-arrow-"+t)}return t.prototype=Object.create(u.SmartSliderWidget.prototype),t.prototype.constructor=t,t.prototype.onStart=function(){var t,i,n,o;t=this.widget,i="click",n=function(e){e.stopPropagation(),this.slider[this.Dt]()}.bind(this),o=o||{},t.addEventListener(i,n,o)},function(i){this.key="arrow",this.previous=new t("previous",i,"previousWithDirection"),this.next=new t("next",i,"nextWithDirection")}}))}(window);
...\ No newline at end of file ...\ No newline at end of file
1 !function(t){var i=t;i._N2=i._N2||{_r:[],_d:[],r:function(){this._r.push(arguments)},d:function(){this._d.push(arguments)}};var n,o=t.document,c=(o.documentElement,t.setTimeout),r=t.clearTimeout,u=i._N2;t.requestAnimationFrame,Object.assign,navigator.userAgent.indexOf("+http://www.google.com/bot.html")>-1||i.requestIdleCallback,i.cancelIdleCallback;n=function(){o.body},"complete"===o.readyState||"interactive"===o.readyState?n():Document&&Document.prototype&&Document.prototype.addEventListener&&Document.prototype.addEventListener!==o.addEventListener?Document.prototype.addEventListener.call(o,"DOMContentLoaded",n):o.addEventListener("DOMContentLoaded",n),u.d("SmartSliderWidgetArrowImage","SmartSliderWidget",(function(){function t(t,i,n){this.Ot=n,u.SmartSliderWidget.prototype.constructor.call(this,i,t,"#"+i.elementID+"-arrow-"+t)}return t.prototype=Object.create(u.SmartSliderWidget.prototype),t.prototype.constructor=t,t.prototype.onStart=function(){var t,i,n,o;t=this.widget,i="click",n=function(e){e.stopPropagation(),this.slider[this.Ot]()}.bind(this),o=o||{},t.addEventListener(i,n,o)},function(i){this.key="arrow",this.previous=new t("previous",i,"previousWithDirection"),this.next=new t("next",i,"nextWithDirection")}}))}(window);
...\ No newline at end of file ...\ No newline at end of file
......
1 !function(t){var i=t;i._N2=i._N2||{_r:[],_d:[],r:function(){this._r.push(arguments)},d:function(){this._d.push(arguments)}};var n,o=t.document,a=(o.documentElement,t.setTimeout),s=t.clearTimeout,u=i._N2,h=(t.requestAnimationFrame,o.createElement.bind(o),Object.assign,function(t,i,n){t.setAttribute(i,n)}),c=function(t,i){return t.dataset[i]},r=function(t){t&&t.parentNode&&t.parentNode.removeChild(t)},l=function(t,i){t.classList.add(i)},d=function(t,i){t.classList.remove(i)},f=function(t,i,n,o){return o=o||{},t.addEventListener(i,n,o),t.removeEventListener.bind(t,i,n,o)};navigator.userAgent.indexOf("+http://www.google.com/bot.html")>-1||i.requestIdleCallback,i.cancelIdleCallback;n=function(){o.body},"complete"===o.readyState||"interactive"===o.readyState?n():Document&&Document.prototype&&Document.prototype.addEventListener&&Document.prototype.addEventListener!==o.addEventListener?Document.prototype.addEventListener.call(o,"DOMContentLoaded",n):o.addEventListener("DOMContentLoaded",n),u.d("SmartSliderWidgetAutoplayImage","SmartSliderWidget",(function(){"use strict";function t(t){u.SmartSliderWidget.prototype.constructor.call(this,t,"autoplay",".nextend-autoplay")}return t.prototype=Object.create(u.SmartSliderWidget.prototype),t.prototype.constructor=t,t.prototype.onStart=function(){this.paused=!1,this._listeners=[f(this.slider.sliderElement,"autoplayStarted",this.setPlaying.bind(this)),f(this.slider.sliderElement,"autoplayPaused",this.setPaused.bind(this))];var t,i,n,o,a=NextendDeBounce(this.switchState.bind(this),300,!0);t=this.widget,i="n2Activate",n=a,o=o||{},t.addEventListener(i,n,o),new u.UniversalClick(this.widget,a),this.slider.stages.done("AutoplayDestroyed",this.destroy.bind(this))},t.prototype.switchState=function(e){this.slider.controls.autoplay.preventClickHandle(),this.paused?(this.setPlaying(),this.slider.K("autoplayResume",{progress:1})):(this.setPaused(),this.slider.K("autoplayPause"))},t.prototype.setPaused=function(){this.paused=!0,l(this.widget,"n2-autoplay-paused"),h(this.widget,"aria-label",c(this.widget,"playLabel"))},t.prototype.setPlaying=function(){this.paused=!1,d(this.widget,"n2-autoplay-paused"),h(this.widget,"aria-label",c(this.widget,"pauseLabel"))},t.prototype.destroy=function(){var t;r(this.widget),(t=this._listeners).forEach((function(t){t()})),t.splice(0,t.length)},t}))}(window);
...\ No newline at end of file ...\ No newline at end of file
1 !function(t){var i=t;i._N2=i._N2||{_r:[],_d:[],r:function(){this._r.push(arguments)},d:function(){this._d.push(arguments)}};var n,o=t.document,a=(o.documentElement,t.setTimeout),s=t.clearTimeout,u=i._N2,h=(t.requestAnimationFrame,Object.assign,function(t,i,n){t.setAttribute(i,n)}),c=function(t,i){return t.dataset[i]},r=function(t){t&&t.parentNode&&t.parentNode.removeChild(t)},l=function(t,i){t.classList.add(i)},d=function(t,i){t.classList.remove(i)},f=function(t,i,n,o){return o=o||{},t.addEventListener(i,n,o),t.removeEventListener.bind(t,i,n,o)};navigator.userAgent.indexOf("+http://www.google.com/bot.html")>-1||i.requestIdleCallback,i.cancelIdleCallback;n=function(){o.body},"complete"===o.readyState||"interactive"===o.readyState?n():Document&&Document.prototype&&Document.prototype.addEventListener&&Document.prototype.addEventListener!==o.addEventListener?Document.prototype.addEventListener.call(o,"DOMContentLoaded",n):o.addEventListener("DOMContentLoaded",n),u.d("SmartSliderWidgetAutoplayImage","SmartSliderWidget",(function(){"use strict";function t(t){u.SmartSliderWidget.prototype.constructor.call(this,t,"autoplay",".nextend-autoplay")}return t.prototype=Object.create(u.SmartSliderWidget.prototype),t.prototype.constructor=t,t.prototype.onStart=function(){this.paused=!1,this._listeners=[f(this.slider.sliderElement,"autoplayStarted",this.setPlaying.bind(this)),f(this.slider.sliderElement,"autoplayPaused",this.setPaused.bind(this))];var t,i,n,o,a=NextendDeBounce(this.switchState.bind(this),300,!0);t=this.widget,i="n2Activate",n=a,o=o||{},t.addEventListener(i,n,o),new u.UniversalClick(this.widget,a),this.slider.stages.done("AutoplayDestroyed",this.destroy.bind(this))},t.prototype.switchState=function(e){this.slider.controls.autoplay.preventClickHandle(),this.paused?(this.setPlaying(),this.slider.K("autoplayResume",{progress:1})):(this.setPaused(),this.slider.K("autoplayPause"))},t.prototype.setPaused=function(){this.paused=!0,l(this.widget,"n2-autoplay-paused"),h(this.widget,"aria-label",c(this.widget,"playLabel"))},t.prototype.setPlaying=function(){this.paused=!1,d(this.widget,"n2-autoplay-paused"),h(this.widget,"aria-label",c(this.widget,"pauseLabel"))},t.prototype.destroy=function(){var t;r(this.widget),(t=this._listeners).forEach((function(t){t()})),t.splice(0,t.length)},t}))}(window);
...\ No newline at end of file ...\ No newline at end of file
......
1 !function(t){var i=t;i._N2=i._N2||{_r:[],_d:[],r:function(){this._r.push(arguments)},d:function(){this._d.push(arguments)}};var s,n,h=t.document,o=(h.documentElement,t.setTimeout),a=t.clearTimeout,c=i._N2,r=(t.requestAnimationFrame,h.createElement.bind(h),Object.assign),u=function(t){t&&t.parentNode&&t.parentNode.removeChild(t)},l=function(t,i){return t.dispatchEvent(i)},f=function(t,i,s,n){n=n||{},t.addEventListener(i,s,n)};navigator.userAgent.indexOf("+http://www.google.com/bot.html")>-1||i.requestIdleCallback,i.cancelIdleCallback;n=function(){h.body},"complete"===h.readyState||"interactive"===h.readyState?n():Document&&Document.prototype&&Document.prototype.addEventListener&&Document.prototype.addEventListener!==h.addEventListener?Document.prototype.addEventListener.call(h,"DOMContentLoaded",n):h.addEventListener("DOMContentLoaded",n),c.d("SmartSliderWidgetBarHorizontal","SmartSliderWidget",(function(){"use strict";function t(t,i){this.parameters=i,c.SmartSliderWidget.prototype.constructor.call(this,t,"bar",".nextend-bar")}return t.prototype=Object.create(c.SmartSliderWidget.prototype),t.prototype.constructor=t,t.prototype.onStart=function(t){this.tween=null,this.innerBar=this.widget.querySelector("div"),this.Ct=c.MW.k(this.innerBar);var i="click";this.slider.hasTouch()&&(i="n2click"),f(this.widget,"click",function(){var t,s,n,h=this.slider.sliderElement.querySelector(".n2-ss-slide-active .n2-ss-layers-container");h&&(t=h,s=i,n=r({bubbles:!0,cancelable:!0},n),l(t,new Event(s,n)))}.bind(this)),this.slider.stages.done("BeforeShow",this.onBeforeShow.bind(this))},t.prototype.hasContent=function(t){return!(!this.parameters.showTitle||""===t.getTitle()&&!this.parameters.slideCount)||!(!this.parameters.showDescription||""===t.getDescription()&&!this.parameters.slideCount)},t.prototype.onBeforeShow=function(){this.onSliderSwitchTo({detail:{targetSlide:this.slider.currentSlide}}),this.parameters.animate?f(this.slider.sliderElement,"mainAnimationStart",this.onSliderSwitchToAnimateStart.bind(this)):f(this.slider.sliderElement,"SlideWillChange",this.onSliderSwitchTo.bind(this))},t.prototype.renderBarContent=function(t){var i,s,n="";this.parameters.showTitle&&(""!==t.getTitle()||this.parameters.slideCount)&&(i=this.parameters.slideCount?t.index+1:t.getTitle(),n+='<span class="'+this.parameters.fontTitle+'">'+i+"</span>");this.parameters.showDescription&&(""!==t.getDescription()||this.parameters.slideCount)&&(s=this.parameters.slideCount?t.slider.slides.length:t.getDescription(),n+='<span class="'+this.parameters.fontDescription+'">'+(""===n?"":this.parameters.separator)+s+"</span>");return""===n?'<span class="'+this.parameters.fontDescription+'">&nbsp;</span>':n},t.prototype.onSliderSwitchTo=function(e){var t=e.detail.targetSlide.slides[0],i=this.hasContent(t);i&&(this.innerBar.innerHTML=this.renderBarContent(t),this.setCursor(t.hasLink())),this.slider.widgets.setState("hide.bar",!i)},t.prototype.onSliderSwitchToAnimateStart=function(){var t,n;this.Ot===s&&(this.Ot=(t=this.innerBar,n="opacity",i.getComputedStyle(t).getPropertyValue(n)),this.Ct.opacity=this.Ot);var h,o,a,r=new Promise(function(t){this.tween&&this.tween.pause(),c.W.to(this.Ct,.3,{opacity:0,onComplete:function(){t()}})}.bind(this));h=this.slider.sliderElement,o="mainAnimationComplete",a=this.onSliderSwitchToAnimateEnd.bind(this,r),h.addEventListener(o,a,{once:!0})},t.prototype.onSliderSwitchToAnimateEnd=function(t,e){var i=this.slider.slides[e.detail.currentSlideIndex];t.then(function(){var t=this.hasContent(i);if(t){var s=this.innerBar.cloneNode(!0);u(this.innerBar),this.setCursor(i.hasLink()),s.innerHTML=this.renderBarContent(i),this.widget.appendChild(s),this.innerBar=s,this.Ct=c.MW.k(this.innerBar),this.Ct.opacity=0,this.tween=c.W.to(this.Ct,.3,{opacity:this.Ot})}this.slider.widgets.setState("hide.bar",!t)}.bind(this))},t.prototype.setCursor=function(t){this.Ct.cursor=t?"pointer":"inherit"},t}))}(window);
...\ No newline at end of file ...\ No newline at end of file
1 !function(t){var i=t;i._N2=i._N2||{_r:[],_d:[],r:function(){this._r.push(arguments)},d:function(){this._d.push(arguments)}};var s,n,h=t.document,o=(h.documentElement,t.setTimeout),a=t.clearTimeout,c=i._N2,r=(t.requestAnimationFrame,Object.assign),u=function(t){t&&t.parentNode&&t.parentNode.removeChild(t)},l=function(t,i){return t.dispatchEvent(i)},f=function(t,i,s,n){n=n||{},t.addEventListener(i,s,n)};navigator.userAgent.indexOf("+http://www.google.com/bot.html")>-1||i.requestIdleCallback,i.cancelIdleCallback;n=function(){h.body},"complete"===h.readyState||"interactive"===h.readyState?n():Document&&Document.prototype&&Document.prototype.addEventListener&&Document.prototype.addEventListener!==h.addEventListener?Document.prototype.addEventListener.call(h,"DOMContentLoaded",n):h.addEventListener("DOMContentLoaded",n),c.d("SmartSliderWidgetBarHorizontal","SmartSliderWidget",(function(){"use strict";function t(t,i){this.parameters=i,c.SmartSliderWidget.prototype.constructor.call(this,t,"bar",".nextend-bar")}return t.prototype=Object.create(c.SmartSliderWidget.prototype),t.prototype.constructor=t,t.prototype.onStart=function(t){this.tween=null,this.innerBar=this.widget.querySelector("div"),this.Ct=c.MW.k(this.innerBar);var i="click";this.slider.hasTouch()&&(i="n2click"),f(this.widget,"click",function(){var t,s,n,h=this.slider.sliderElement.querySelector(".n2-ss-slide-active .n2-ss-layers-container");h&&(t=h,s=i,n=r({bubbles:!0,cancelable:!0},n),l(t,new Event(s,n)))}.bind(this)),this.slider.stages.done("BeforeShow",this.onBeforeShow.bind(this))},t.prototype.hasContent=function(t){return!(!this.parameters.showTitle||""===t.getTitle()&&!this.parameters.slideCount)||!(!this.parameters.showDescription||""===t.getDescription()&&!this.parameters.slideCount)},t.prototype.onBeforeShow=function(){this.onSliderSwitchTo({detail:{targetSlide:this.slider.currentSlide}}),this.parameters.animate?f(this.slider.sliderElement,"mainAnimationStart",this.onSliderSwitchToAnimateStart.bind(this)):f(this.slider.sliderElement,"SlideWillChange",this.onSliderSwitchTo.bind(this))},t.prototype.renderBarContent=function(t){var i,s,n="";this.parameters.showTitle&&(""!==t.getTitle()||this.parameters.slideCount)&&(i=this.parameters.slideCount?t.index+1:t.getTitle(),n+='<span class="'+this.parameters.fontTitle+'">'+i+"</span>");this.parameters.showDescription&&(""!==t.getDescription()||this.parameters.slideCount)&&(s=this.parameters.slideCount?t.slider.slides.length:t.getDescription(),n+='<span class="'+this.parameters.fontDescription+'">'+(""===n?"":this.parameters.separator)+s+"</span>");return""===n?'<span class="'+this.parameters.fontDescription+'">&nbsp;</span>':n},t.prototype.onSliderSwitchTo=function(e){var t=e.detail.targetSlide.slides[0],i=this.hasContent(t);i&&(this.innerBar.innerHTML=this.renderBarContent(t),this.setCursor(t.hasLink())),this.slider.widgets.setState("hide.bar",!i)},t.prototype.onSliderSwitchToAnimateStart=function(){var t,n;this.Wt===s&&(this.Wt=(t=this.innerBar,n="opacity",i.getComputedStyle(t).getPropertyValue(n)),this.Ct.opacity=this.Wt);var h,o,a,r=new Promise(function(t){this.tween&&this.tween.pause(),c.W.to(this.Ct,.3,{opacity:0,onComplete:function(){t()}})}.bind(this));h=this.slider.sliderElement,o="mainAnimationComplete",a=this.onSliderSwitchToAnimateEnd.bind(this,r),h.addEventListener(o,a,{once:!0})},t.prototype.onSliderSwitchToAnimateEnd=function(t,e){var i=this.slider.slides[e.detail.currentSlideIndex];t.then(function(){var t=this.hasContent(i);if(t){var s=this.innerBar.cloneNode(!0);u(this.innerBar),this.setCursor(i.hasLink()),s.innerHTML=this.renderBarContent(i),this.widget.appendChild(s),this.innerBar=s,this.Ct=c.MW.k(this.innerBar),this.Ct.opacity=0,this.tween=c.W.to(this.Ct,.3,{opacity:this.Wt})}this.slider.widgets.setState("hide.bar",!t)}.bind(this))},t.prototype.setCursor=function(t){this.Ct.cursor=t?"pointer":"inherit"},t}))}(window);
...\ No newline at end of file ...\ No newline at end of file
......
1 !function(t){var i=t;i._N2=i._N2||{_r:[],_d:[],r:function(){this._r.push(arguments)},d:function(){this._d.push(arguments)}};var n,s=t.document,h=(s.documentElement,t.setTimeout),o=t.clearTimeout,a=i._N2,u=(t.requestAnimationFrame,s.createElement.bind(s),Object.assign),r=function(t,i,n){t.dataset[i]=n},c=function(t,i){t.classList.add(i)},l=function(t,i){t.classList.remove(i)},d=function(t,i,n,s){s=s||{},t.addEventListener(i,n,s)};navigator.userAgent.indexOf("+http://www.google.com/bot.html")>-1||i.requestIdleCallback,i.cancelIdleCallback;n=function(){s.body},"complete"===s.readyState||"interactive"===s.readyState?n():Document&&Document.prototype&&Document.prototype.addEventListener&&Document.prototype.addEventListener!==s.addEventListener?Document.prototype.addEventListener.call(s,"DOMContentLoaded",n):s.addEventListener("DOMContentLoaded",n),a.d("SmartSliderWidgetThumbnailDefaultHorizontal","SmartSliderWidget",(function(){"use strict";function t(t,i){this.parameters=u({minimumThumbnailCount:1.5},i),a.SmartSliderWidget.prototype.constructor.call(this,t,"thumbnail",".nextend-thumbnail-default")}t.prototype=Object.create(a.SmartSliderWidget.prototype),t.prototype.constructor=t,t.prototype.onStart=function(){this.bar=this.widget.querySelector(".nextend-thumbnail-inner"),d(this.bar,"scroll",this.onScroll.bind(this));var t=this.widget.querySelector(".nextend-thumbnail-previous"),i=this.widget.querySelector(".nextend-thumbnail-next");t&&d(t,"click",this.previousPane.bind(this)),i&&d(i,"click",this.nextPane.bind(this)),this.slider.stages.done("BeforeShow",this.onBeforeShow.bind(this)),this.slider.stages.done("WidgetsReady",this.onWidgetsReady.bind(this))},t.prototype.onBeforeShow=function(){var t=this.bar.querySelector(".nextend-thumbnail-scroller");this.dots=t.querySelectorAll(".n2-thumbnail-dot");for(var i,n,s=this.slider.realSlides,h=0;h<s.length;h++){var o=t.querySelector('.n2-thumbnail-dot[data-slide-public-id="'+(i=s[h].element,n="slidePublicId",i.dataset[n]+'"]'));"mouseenter"===this.parameters.action?new a.UniversalEnter(o,this.onDotHover.bind(this,s[h])):new a.UniversalClick(o,this.onDotClick.bind(this,s[h])),s[h].thumbnailDot=o}requestAnimationFrame(this.onScroll.bind(this)),d(this.slider.sliderElement,"SliderResize",this.onScroll.bind(this)),d(this.slider.sliderElement,"SlideWillChange",this.onSlideSwitch.bind(this))},t.prototype.onWidgetsReady=function(){this.onSlideSwitch({detail:{targetSlide:this.slider.currentRealSlide}})},t.prototype.onScroll=function(){var t=this.bar.scrollLeft,i=this.bar.clientWidth,n=this.bar.scrollWidth;n2const.isRTL()?(r(this.widget,"hasNext",0===t?0:1),r(this.widget,"hasPrevious",-1*t+i<n?1:0)):(r(this.widget,"hasPrevious",0===t?0:1),r(this.widget,"hasNext",t+i<n?1:0))};var n=!1;return t.prototype.onDotClick=function(t){a._shouldPreventClick||(n||(this.slider.directionalChangeToReal(t.index),n=!0),h(function(){n=!1}.bind(this),400))},t.prototype.onDotHover=function(t){this.slider.directionalChangeToReal(t.index)},t.prototype.onSlideSwitch=function(e){var t=e.detail.targetSlide.slides[0];this.activateDots(t);var n=i.getComputedStyle(t.thumbnailDot),s=t.thumbnailDot.offsetLeft-parseInt(n.getPropertyValue("margin-left")),h=t.thumbnailDot.getBoundingClientRect().width+parseInt(n.getPropertyValue("margin-left"))+parseInt(n.getPropertyValue("margin-right")),o=this.bar.scrollLeft,a=i.getComputedStyle(this.bar),u=parseInt(a.paddingLeft),r=this.bar.clientWidth,c=this.bar.scrollWidth;(s<o||s+h>o+r)&&(this.bar.scrollLeft=Math.min(c-r,-u+s))},t.prototype.activateDots=function(t){var i,n;i=this.dots,n="n2-active",i.forEach((function(t){l(t,n)}));for(var s=t.slides,h=0;s.length>h;h++)c(s[h].thumbnailDot,"n2-active")},t.prototype.previousPane=function(){this.bar.scrollLeft-=.75*this.bar.clientWidth},t.prototype.nextPane=function(){this.bar.scrollLeft+=.75*this.bar.clientWidth},t}))}(window);
...\ No newline at end of file ...\ No newline at end of file
1 !function(t){var i=t;i._N2=i._N2||{_r:[],_d:[],r:function(){this._r.push(arguments)},d:function(){this._d.push(arguments)}};var n,s=t.document,h=(s.documentElement,t.setTimeout),o=t.clearTimeout,a=i._N2,u=(t.requestAnimationFrame,Object.assign),r=function(t,i,n){t.dataset[i]=n},c=function(t,i){t.classList.add(i)},l=function(t,i){t.classList.remove(i)},d=function(t,i,n,s){s=s||{},t.addEventListener(i,n,s)};navigator.userAgent.indexOf("+http://www.google.com/bot.html")>-1||i.requestIdleCallback,i.cancelIdleCallback;n=function(){s.body},"complete"===s.readyState||"interactive"===s.readyState?n():Document&&Document.prototype&&Document.prototype.addEventListener&&Document.prototype.addEventListener!==s.addEventListener?Document.prototype.addEventListener.call(s,"DOMContentLoaded",n):s.addEventListener("DOMContentLoaded",n),a.d("SmartSliderWidgetThumbnailDefaultHorizontal","SmartSliderWidget",(function(){"use strict";function t(t,i){this.parameters=u({minimumThumbnailCount:1.5},i),a.SmartSliderWidget.prototype.constructor.call(this,t,"thumbnail",".nextend-thumbnail-default")}t.prototype=Object.create(a.SmartSliderWidget.prototype),t.prototype.constructor=t,t.prototype.onStart=function(){this.bar=this.widget.querySelector(".nextend-thumbnail-inner"),d(this.bar,"scroll",this.onScroll.bind(this));var t=this.widget.querySelector(".nextend-thumbnail-previous"),i=this.widget.querySelector(".nextend-thumbnail-next");t&&d(t,"click",this.previousPane.bind(this)),i&&d(i,"click",this.nextPane.bind(this)),this.slider.stages.done("BeforeShow",this.onBeforeShow.bind(this)),this.slider.stages.done("WidgetsReady",this.onWidgetsReady.bind(this))},t.prototype.onBeforeShow=function(){var t=this.bar.querySelector(".nextend-thumbnail-scroller");this.dots=t.querySelectorAll(".n2-thumbnail-dot");for(var i,n,s=this.slider.realSlides,h=0;h<s.length;h++){var o=t.querySelector('.n2-thumbnail-dot[data-slide-public-id="'+(i=s[h].element,n="slidePublicId",i.dataset[n]+'"]'));"mouseenter"===this.parameters.action?new a.UniversalEnter(o,this.onDotHover.bind(this,s[h])):new a.UniversalClick(o,this.onDotClick.bind(this,s[h])),s[h].thumbnailDot=o}requestAnimationFrame(this.onScroll.bind(this)),d(this.slider.sliderElement,"SliderResize",this.onScroll.bind(this)),d(this.slider.sliderElement,"SlideWillChange",this.onSlideSwitch.bind(this))},t.prototype.onWidgetsReady=function(){this.onSlideSwitch({detail:{targetSlide:this.slider.currentRealSlide}})},t.prototype.onScroll=function(){var t=this.bar.scrollLeft,i=this.bar.clientWidth,n=this.bar.scrollWidth;n2const.isRTL()?(r(this.widget,"hasNext",0===t?0:1),r(this.widget,"hasPrevious",-1*t+i<n?1:0)):(r(this.widget,"hasPrevious",0===t?0:1),r(this.widget,"hasNext",t+i<n?1:0))};var n=!1;return t.prototype.onDotClick=function(t){a._shouldPreventClick||(n||(this.slider.directionalChangeToReal(t.index),n=!0),h(function(){n=!1}.bind(this),400))},t.prototype.onDotHover=function(t){this.slider.directionalChangeToReal(t.index)},t.prototype.onSlideSwitch=function(e){var t=e.detail.targetSlide.slides[0];this.activateDots(t);var n=i.getComputedStyle(t.thumbnailDot),s=t.thumbnailDot.offsetLeft-parseInt(n.getPropertyValue("margin-left")),h=t.thumbnailDot.getBoundingClientRect().width+parseInt(n.getPropertyValue("margin-left"))+parseInt(n.getPropertyValue("margin-right")),o=this.bar.scrollLeft,a=i.getComputedStyle(this.bar),u=parseInt(a.paddingLeft),r=this.bar.clientWidth,c=this.bar.scrollWidth;(s<o||s+h>o+r)&&(this.bar.scrollLeft=Math.min(c-r,-u+s))},t.prototype.activateDots=function(t){var i,n;i=this.dots,n="n2-active",i.forEach((function(t){l(t,n)}));for(var s=t.slides,h=0;s.length>h;h++)c(s[h].thumbnailDot,"n2-active")},t.prototype.previousPane=function(){this.bar.scrollLeft-=.75*this.bar.clientWidth},t.prototype.nextPane=function(){this.bar.scrollLeft+=.75*this.bar.clientWidth},t}))}(window);
...\ No newline at end of file ...\ No newline at end of file
......
1 !function(t){var i=t;i._N2=i._N2||{_r:[],_d:[],r:function(){this._r.push(arguments)},d:function(){this._d.push(arguments)}};var n,s=t.document,h=(s.documentElement,t.setTimeout),o=t.clearTimeout,a=i._N2,u=(t.requestAnimationFrame,s.createElement.bind(s),Object.assign),r=function(t,i,n){t.dataset[i]=n},c=function(t,i){t.classList.add(i)},l=function(t,i){t.classList.remove(i)},d=function(t,i,n,s){s=s||{},t.addEventListener(i,n,s)};navigator.userAgent.indexOf("+http://www.google.com/bot.html")>-1||i.requestIdleCallback,i.cancelIdleCallback;n=function(){s.body},"complete"===s.readyState||"interactive"===s.readyState?n():Document&&Document.prototype&&Document.prototype.addEventListener&&Document.prototype.addEventListener!==s.addEventListener?Document.prototype.addEventListener.call(s,"DOMContentLoaded",n):s.addEventListener("DOMContentLoaded",n),a.d("SmartSliderWidgetThumbnailDefaultVertical","SmartSliderWidget",(function(){"use strict";function t(t,i){this.parameters=u({minimumThumbnailCount:1.5},i),a.SmartSliderWidget.prototype.constructor.call(this,t,"thumbnail",".nextend-thumbnail-default")}t.prototype=Object.create(a.SmartSliderWidget.prototype),t.prototype.constructor=t,t.prototype.onStart=function(){this.bar=this.widget.querySelector(".nextend-thumbnail-inner"),d(this.bar,"scroll",this.onScroll.bind(this));var t=this.widget.querySelector(".nextend-thumbnail-previous"),i=this.widget.querySelector(".nextend-thumbnail-next");t&&d(t,"click",this.previousPane.bind(this)),i&&d(i,"click",this.nextPane.bind(this)),this.slider.stages.done("BeforeShow",this.onBeforeShow.bind(this)),this.slider.stages.done("WidgetsReady",this.onWidgetsReady.bind(this))},t.prototype.onBeforeShow=function(){var t=this.bar.querySelector(".nextend-thumbnail-scroller");this.dots=t.querySelectorAll(".n2-thumbnail-dot");for(var i,n,s=this.slider.realSlides,h=0;h<s.length;h++){var o=t.querySelector('[data-slide-public-id="'+(i=s[h].element,n="slidePublicId",i.dataset[n]+'"]'));"mouseenter"===this.parameters.action?new a.UniversalEnter(o,this.onDotHover.bind(this,s[h])):new a.UniversalClick(o,this.onDotClick.bind(this,s[h])),s[h].thumbnailDot=o}requestAnimationFrame(this.onScroll.bind(this)),d(this.slider.sliderElement,"SliderResize",this.onScroll.bind(this)),d(this.slider.sliderElement,"SlideWillChange",this.onSlideSwitch.bind(this))},t.prototype.onWidgetsReady=function(){this.onSlideSwitch({detail:{targetSlide:this.slider.currentRealSlide}})},t.prototype.onScroll=function(){var t=this.bar.scrollTop,i=this.bar.clientHeight,n=this.bar.scrollHeight;r(this.widget,"hasPrevious",0===t?0:1),r(this.widget,"hasNext",t+i<n?1:0)};var n=!1;return t.prototype.onDotClick=function(t){a._shouldPreventClick||(n||(this.slider.directionalChangeToReal(t.index),n=!0),h(function(){n=!1}.bind(this),400))},t.prototype.onDotHover=function(t){this.slider.directionalChangeToReal(t.index)},t.prototype.onSlideSwitch=function(e){var t=e.detail.targetSlide.slides[0];this.activateDots(t);var n=i.getComputedStyle(t.thumbnailDot),s=t.thumbnailDot.offsetTop-parseInt(n.getPropertyValue("margin-top")),h=t.thumbnailDot.getBoundingClientRect().height+parseInt(n.getPropertyValue("margin-top"))+parseInt(n.getPropertyValue("margin-bottom")),o=this.bar.scrollTop,a=i.getComputedStyle(this.bar),u=parseInt(a.paddingTop),r=this.bar.clientHeight,c=this.bar.scrollHeight;(s<o||s+h>o+r)&&(this.bar.scrollTop=Math.min(c-r,-u+s))},t.prototype.activateDots=function(t){var i,n;i=this.dots,n="n2-active",i.forEach((function(t){l(t,n)}));for(var s=t.slides,h=0;s.length>h;h++)c(s[h].thumbnailDot,"n2-active")},t.prototype.previousPane=function(){this.bar.scrollTop-=.75*this.bar.clientHeight},t.prototype.nextPane=function(){this.bar.scrollTop+=.75*this.bar.clientHeight},t.prototype.getSize=function(){return this.getWidth()},t}))}(window);
...\ No newline at end of file ...\ No newline at end of file
1 !function(t){var i=t;i._N2=i._N2||{_r:[],_d:[],r:function(){this._r.push(arguments)},d:function(){this._d.push(arguments)}};var n,s=t.document,h=(s.documentElement,t.setTimeout),o=t.clearTimeout,a=i._N2,u=(t.requestAnimationFrame,Object.assign),r=function(t,i,n){t.dataset[i]=n},c=function(t,i){t.classList.add(i)},l=function(t,i){t.classList.remove(i)},d=function(t,i,n,s){s=s||{},t.addEventListener(i,n,s)};navigator.userAgent.indexOf("+http://www.google.com/bot.html")>-1||i.requestIdleCallback,i.cancelIdleCallback;n=function(){s.body},"complete"===s.readyState||"interactive"===s.readyState?n():Document&&Document.prototype&&Document.prototype.addEventListener&&Document.prototype.addEventListener!==s.addEventListener?Document.prototype.addEventListener.call(s,"DOMContentLoaded",n):s.addEventListener("DOMContentLoaded",n),a.d("SmartSliderWidgetThumbnailDefaultVertical","SmartSliderWidget",(function(){"use strict";function t(t,i){this.parameters=u({minimumThumbnailCount:1.5},i),a.SmartSliderWidget.prototype.constructor.call(this,t,"thumbnail",".nextend-thumbnail-default")}t.prototype=Object.create(a.SmartSliderWidget.prototype),t.prototype.constructor=t,t.prototype.onStart=function(){this.bar=this.widget.querySelector(".nextend-thumbnail-inner"),d(this.bar,"scroll",this.onScroll.bind(this));var t=this.widget.querySelector(".nextend-thumbnail-previous"),i=this.widget.querySelector(".nextend-thumbnail-next");t&&d(t,"click",this.previousPane.bind(this)),i&&d(i,"click",this.nextPane.bind(this)),this.slider.stages.done("BeforeShow",this.onBeforeShow.bind(this)),this.slider.stages.done("WidgetsReady",this.onWidgetsReady.bind(this))},t.prototype.onBeforeShow=function(){var t=this.bar.querySelector(".nextend-thumbnail-scroller");this.dots=t.querySelectorAll(".n2-thumbnail-dot");for(var i,n,s=this.slider.realSlides,h=0;h<s.length;h++){var o=t.querySelector('[data-slide-public-id="'+(i=s[h].element,n="slidePublicId",i.dataset[n]+'"]'));"mouseenter"===this.parameters.action?new a.UniversalEnter(o,this.onDotHover.bind(this,s[h])):new a.UniversalClick(o,this.onDotClick.bind(this,s[h])),s[h].thumbnailDot=o}requestAnimationFrame(this.onScroll.bind(this)),d(this.slider.sliderElement,"SliderResize",this.onScroll.bind(this)),d(this.slider.sliderElement,"SlideWillChange",this.onSlideSwitch.bind(this))},t.prototype.onWidgetsReady=function(){this.onSlideSwitch({detail:{targetSlide:this.slider.currentRealSlide}})},t.prototype.onScroll=function(){var t=this.bar.scrollTop,i=this.bar.clientHeight,n=this.bar.scrollHeight;r(this.widget,"hasPrevious",0===t?0:1),r(this.widget,"hasNext",t+i<n?1:0)};var n=!1;return t.prototype.onDotClick=function(t){a._shouldPreventClick||(n||(this.slider.directionalChangeToReal(t.index),n=!0),h(function(){n=!1}.bind(this),400))},t.prototype.onDotHover=function(t){this.slider.directionalChangeToReal(t.index)},t.prototype.onSlideSwitch=function(e){var t=e.detail.targetSlide.slides[0];this.activateDots(t);var n=i.getComputedStyle(t.thumbnailDot),s=t.thumbnailDot.offsetTop-parseInt(n.getPropertyValue("margin-top")),h=t.thumbnailDot.getBoundingClientRect().height+parseInt(n.getPropertyValue("margin-top"))+parseInt(n.getPropertyValue("margin-bottom")),o=this.bar.scrollTop,a=i.getComputedStyle(this.bar),u=parseInt(a.paddingTop),r=this.bar.clientHeight,c=this.bar.scrollHeight;(s<o||s+h>o+r)&&(this.bar.scrollTop=Math.min(c-r,-u+s))},t.prototype.activateDots=function(t){var i,n;i=this.dots,n="n2-active",i.forEach((function(t){l(t,n)}));for(var s=t.slides,h=0;s.length>h;h++)c(s[h].thumbnailDot,"n2-active")},t.prototype.previousPane=function(){this.bar.scrollTop-=.75*this.bar.clientHeight},t.prototype.nextPane=function(){this.bar.scrollTop+=.75*this.bar.clientHeight},t.prototype.getSize=function(){return this.getWidth()},t}))}(window);
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -49,6 +49,7 @@ ...@@ -49,6 +49,7 @@
49 49
50 .n2-thumbnail-dot { 50 .n2-thumbnail-dot {
51 position: relative; 51 position: relative;
52 cursor: pointer;
52 53
53 img { 54 img {
54 object-fit: cover; 55 object-fit: cover;
...@@ -111,6 +112,7 @@ ...@@ -111,6 +112,7 @@
111 .n2-thumbnail-dot { 112 .n2-thumbnail-dot {
112 display: grid; 113 display: grid;
113 grid-template-columns: auto 1fr; 114 grid-template-columns: auto 1fr;
115 overflow:hidden;
114 } 116 }
115 117
116 .nextend-thumbnail-button { 118 .nextend-thumbnail-button {
......
...@@ -4,7 +4,7 @@ Tags: slider, wordpress slider, image slider, layer slider, responsive slider, s ...@@ -4,7 +4,7 @@ Tags: slider, wordpress slider, image slider, layer slider, responsive slider, s
4 Donate link: https://sites.fastspring.com/nextend/product/smartslider3donate 4 Donate link: https://sites.fastspring.com/nextend/product/smartslider3donate
5 Requires at least: 4.9 5 Requires at least: 4.9
6 Tested up to: 5.8.1 6 Tested up to: 5.8.1
7 Stable tag: 3.5.1.2 7 Stable tag: 3.5.1.3
8 Requires PHP: 7.0 8 Requires PHP: 7.0
9 License: GPLv3 or later 9 License: GPLv3 or later
10 License URI: http://www.gnu.org/licenses/gpl-3.0.html 10 License URI: http://www.gnu.org/licenses/gpl-3.0.html
...@@ -209,6 +209,24 @@ Of course! Smart Slider use protocol relative urls which works fine on http:// a ...@@ -209,6 +209,24 @@ Of course! Smart Slider use protocol relative urls which works fine on http:// a
209 209
210 == Changelog == 210 == Changelog ==
211 211
212 = 3.5.1.3 - 18. January 2022 =
213 * Feature: Pagination and Search options in the Dashboard.
214 * Feature: The variable selector is now available at the column and row background colors.
215 * Feature: We'll use pointer cursor at the thumbnails to indicate that they're clickable.
216 * Feature: Perfmatter compatibility improvements.
217 * Fix: Overflow hidden is added to vertical thumbnails to allow rounded borders.
218 * Fix: Firefox changed the default background color of the select tag, which creates less contrast between the text and background. We changed it back to white.
219 * Fix: The color picker allowed saving a 7 digit color code, which resulted a bad color.
220 * Fix: Margin and padding values are now translatable in the Slide editor UI.
221 * Fix: Optimize images option now works on full URLs.
222 * Fix: The YouTube layer didn't always recognize the youtu.be URLs properly.
223 * Fix: Static Overlay background options caused error when the only slide in the slider is a Static Overlay.
224 * Fix: Smart Slider's custom widget area will now properly display the publishing instructions.
225 * Fix: Background Blur could show up even if the fill mode was not set to Blur fit.
226 * Other: Spanish translation updated. Thanks, Rodrigo!
227 * Other: The es_ES.po and es_ES.mo renamed to es.po and es.mo respectively to support all Spanish languages.
228
229
212 = 3.5.1.2 - 18. November 2021 = 230 = 3.5.1.2 - 18. November 2021 =
213 * Feature: The old background animations are allowed again when the fill mode is not fill, but anything else. 231 * Feature: The old background animations are allowed again when the fill mode is not fill, but anything else.
214 * Feature: You can now customize the Loading animation delay time. 232 * Feature: You can now customize the Loading animation delay time.
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
3 Plugin Name: Smart Slider 3 3 Plugin Name: Smart Slider 3
4 Plugin URI: https://smartslider3.com/ 4 Plugin URI: https://smartslider3.com/
5 Description: The perfect all-in-one responsive slider solution for WordPress. 5 Description: The perfect all-in-one responsive slider solution for WordPress.
6 Version: 3.5.1.2 6 Version: 3.5.1.3
7 Requires PHP: 7.0 7 Requires PHP: 7.0
8 Requires at least: 4.9 8 Requires at least: 4.9
9 Author: Nextend 9 Author: Nextend
......
...@@ -55,12 +55,12 @@ if ( !class_exists( 'WPSL_Frontend' ) ) { ...@@ -55,12 +55,12 @@ if ( !class_exists( 'WPSL_Frontend' ) ) {
55 add_action( 'init', array( $this, 'borlabs_cookie' ) ); 55 add_action( 'init', array( $this, 'borlabs_cookie' ) );
56 } 56 }
57 57
58 add_action( 'wp_ajax_store_search', array( $this, 'store_search' ) ); 58 add_action( 'wp_ajax_store_search', array( $this, 'store_search' ) );
59 add_action( 'wp_ajax_nopriv_store_search', array( $this, 'store_search' ) ); 59 add_action( 'wp_ajax_nopriv_store_search', array( $this, 'store_search' ) );
60 add_action( 'wp_enqueue_scripts', array( $this, 'add_frontend_styles' ) ); 60 add_action( 'wp_enqueue_scripts', array( $this, 'add_frontend_styles' ) );
61 add_action( 'wp_footer', array( $this, 'add_frontend_scripts' ) ); 61 add_action( 'wp_footer', array( $this, 'add_frontend_scripts' ) );
62 62
63 add_filter( 'the_content', array( $this, 'cpt_template' ) ); 63 add_filter( 'the_content', array( $this, 'cpt_template' ) );
64 64
65 add_shortcode( 'wpsl', array( $this, 'show_store_locator' ) ); 65 add_shortcode( 'wpsl', array( $this, 'show_store_locator' ) );
66 add_shortcode( 'wpsl_address', array( $this, 'show_store_address' ) ); 66 add_shortcode( 'wpsl_address', array( $this, 'show_store_address' ) );
......
...@@ -134,7 +134,11 @@ if ( !class_exists( 'WPSL_Borlabs_Cookie' ) ) { ...@@ -134,7 +134,11 @@ if ( !class_exists( 'WPSL_Borlabs_Cookie' ) ) {
134 ); 134 );
135 135
136 // Default thumbnail 136 // Default thumbnail
137 $thumbnail = BORLABS_COOKIE_PLUGIN_URL.'images/bct-google-maps.png'; 137 if ( defined( 'BORLABS_COOKIE_VERSION' ) && version_compare( BORLABS_COOKIE_VERSION, '2.2.36', '>=' )) {
138 $thumbnail = BORLABS_COOKIE_PLUGIN_URL . 'assets/images/cb-maps.png';
139 } else {
140 $thumbnail = BORLABS_COOKIE_PLUGIN_URL . 'images/bct-google-maps.png';
141 }
138 142
139 // Get the title which was maybe set via title-attribute in a shortcode 143 // Get the title which was maybe set via title-attribute in a shortcode
140 $title = BorlabsCookieHelper()->getCurrentTitleOfBlockedContentType(); 144 $title = BorlabsCookieHelper()->getCurrentTitleOfBlockedContentType();
......
...@@ -4,8 +4,8 @@ Contributors: tijmensmit ...@@ -4,8 +4,8 @@ Contributors: tijmensmit
4 Donate link: https://www.paypal.me/tijmensmit 4 Donate link: https://www.paypal.me/tijmensmit
5 Tags: google maps, store locator, business locations, geocoding, stores, geo, zipcode locator, dealer locater, geocode, gmaps, google map, google map plugin, location finder, map tools, shop locator, wp google map 5 Tags: google maps, store locator, business locations, geocoding, stores, geo, zipcode locator, dealer locater, geocode, gmaps, google map, google map plugin, location finder, map tools, shop locator, wp google map
6 Requires at least: 3.7 6 Requires at least: 3.7
7 Tested up to: 5.7 7 Tested up to: 5.8.2
8 Stable tag: 2.2.234 8 Stable tag: 2.2.235
9 License: GPLv3 9 License: GPLv3
10 License URI: http://www.gnu.org/licenses/gpl.html 10 License URI: http://www.gnu.org/licenses/gpl.html
11 11
...@@ -127,6 +127,9 @@ If you find a plugin or theme that causes a conflict, please report it on the [s ...@@ -127,6 +127,9 @@ If you find a plugin or theme that causes a conflict, please report it on the [s
127 127
128 == Changelog == 128 == Changelog ==
129 129
130 = 2.2.235, 10 January, 2022 =
131 * Fixed: Borlabs Cookie](https://borlabs.io/borlabs-cookie/) compatiblity problem with the Google Maps placeholder.
132
130 = 2.2.234, 23 January, 2021 = 133 = 2.2.234, 23 January, 2021 =
131 * Fixed: PHP 8 Compatiblity 134 * Fixed: PHP 8 Compatiblity
132 * Fixed: Polylang Compatiblity 135 * Fixed: Polylang Compatiblity
......
...@@ -4,7 +4,7 @@ Plugin Name: WP Store Locator ...@@ -4,7 +4,7 @@ Plugin Name: WP Store Locator
4 Description: An easy to use location management system that enables users to search for nearby physical stores 4 Description: An easy to use location management system that enables users to search for nearby physical stores
5 Author: Tijmen Smit 5 Author: Tijmen Smit
6 Author URI: https://wpstorelocator.co/ 6 Author URI: https://wpstorelocator.co/
7 Version: 2.2.234 7 Version: 2.2.235
8 Text Domain: wpsl 8 Text Domain: wpsl
9 Domain Path: /languages/ 9 Domain Path: /languages/
10 License: GPL v3 10 License: GPL v3
...@@ -61,7 +61,7 @@ if ( !class_exists( 'WP_Store_locator' ) ) { ...@@ -61,7 +61,7 @@ if ( !class_exists( 'WP_Store_locator' ) ) {
61 public function define_constants() { 61 public function define_constants() {
62 62
63 if ( !defined( 'WPSL_VERSION_NUM' ) ) 63 if ( !defined( 'WPSL_VERSION_NUM' ) )
64 define( 'WPSL_VERSION_NUM', '2.2.234' ); 64 define( 'WPSL_VERSION_NUM', '2.2.235' );
65 65
66 if ( !defined( 'WPSL_URL' ) ) 66 if ( !defined( 'WPSL_URL' ) )
67 define( 'WPSL_URL', plugin_dir_url( __FILE__ ) ); 67 define( 'WPSL_URL', plugin_dir_url( __FILE__ ) );
......
...@@ -126,3 +126,18 @@ add_filter("wpcf7_ajax_json_echo", function ($response, $result) { ...@@ -126,3 +126,18 @@ add_filter("wpcf7_ajax_json_echo", function ($response, $result) {
126 return $response; 126 return $response;
127 127
128 },10,2); 128 },10,2);
129
130
131 // UnderStrap's includes directory.
132 $understrap_inc_dir = 'inc';
133
134 // Array of files to include.
135 $understrap_includes = array(
136 '/emails.php'
137 );
138
139
140 // Include files.
141 foreach ( $understrap_includes as $file ) {
142 require_once get_theme_file_path( $understrap_inc_dir . $file );
143 }
......
1 <!DOCTYPE html>
2 <html lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:o="urn:schemas-microsoft-com:office:office">
3 <head>
4 <meta charset="UTF-8">
5 <meta name="viewport" content="width=device-width,initial-scale=1">
6 <meta name="x-apple-disable-message-reformatting">
7 <title></title>
8 <!--[if mso]>
9 <noscript>
10 <xml>
11 <o:OfficeDocumentSettings>
12 <o:PixelsPerInch>96</o:PixelsPerInch>
13 </o:OfficeDocumentSettings>
14 </xml>
15 </noscript>
16 <![endif]-->
17 <style>
18 @font-face { font-family: Calibri;
19 src: url('https://fp-canada.gotenzing.com/wp-content/themes/understrap-child/Calibri.woff') format('woff'); }
20
21 @font-face { font-family: Calibri-bold;
22 src: url('https://fp-canada.gotenzing.com/wp-content/themes/understrap-child/Calibri-Bold.woff') format('woff'); }
23
24 table, td, div, h1, p {font-family: Calibri;}
25 strong{font-family: Calibri;}
26 </style>
27 </head>
28 <body style="margin:0;padding:0;">
29 <table role="presentation" style="width:100%;border-collapse:collapse;border:0;border-spacing:0;background:#ffffff;">
30 <tr>
31 <td align="center" style="padding:0;">
32 <table role="presentation" style="width:602px;border-collapse:collapse;border-spacing:0;text-align:left;">
33 <tr style="background:#582C83;">
34 <td align="center">
35 &nbsp;
36 </td>
37 <td align="center">
38 &nbsp;
39 </td>
40 <td align="center" width="135">
41 <img width="135" src="https://fp-canada.gotenzing.com/wp-content/uploads/2022/01/fp_logo.png" class="img-fluid" alt="FP Canada">
42 </td>
43 <td align="center" width="40">
44 &nbsp;&nbsp;
45 </td>
46 </tr>
47 <tr style="background:#582C83;">
48 <td colspan="4" style="padding:36px 30px 42px 30px;">
49 <table role="presentation" style="width:100%;border-collapse:collapse;border:0;border-spacing:0;">
50 <tr>
51 <td style="padding:0 0 36px 0;color:#153643;">
52 <h1 style="font-size:50px;line-height:55px;color:#fff;margin:0 0 20px 0; font-family: Calibri-bold;">
53 Important<br>Registration<br>Information</h1>
54
55 </td>
56 </tr>
57 <tr>
58
59 </td>
60 </tr>
61 </table>
62 </td>
63 </tr>
64 <tr style="background:#ffffff;">
65 <td colspan="4" style="padding:36px 30px 42px 30px;">
66 <table role="presentation" style="width:100%;border-collapse:collapse;border:0;border-spacing:0;">
67 <tr>
68 <td colspan="3" style="padding:0 0 36px 0;color:#153643;">
69 <p style="margin:0 0 12px 0;font-size:24px;line-height:28px;font-family: Calibri;color:#012169;">We’ve received your registration information and we’ll confirm program acceptance within two business days from now. If we have questions, we’ll let you know or we will simply confirm acceptance.</p>
70 <p style="margin:0;font-weight:bold;font-size:20px;line-height:22px;font-family: Calibri-bold;color:#5B6770;">If you have questions, contact us at <a style="color:#012169;text-decoration: none;" href="mailto:wyncampaign@fpcanada.ca">wyncampaign@fpcanada.ca</a></p>
71
72 </td>
73 </tr>
74 <tr style="background:#ffffff;">
75 <td colspan="4" style="padding-bottom:10px">
76 </td>
77 </tr>
78 <tr>
79 <td align="center">
80 &nbsp;
81 </td>
82 <td align="center">
83 <img width="147" src="https://fp-canada.gotenzing.com/wp-content/uploads/2022/01/logo.png" class="img-fluid" alt="FP Canada">
84 </td>
85 <td align="center">
86 &nbsp;
87 </td>
88 </tr>
89 </table>
90 </td>
91 </tr>
92 <tr>
93 <td colspan="4" style="padding:30px;background:#fff;">
94 <table role="presentation" style="width:100%;border-collapse:collapse;border:0;border-spacing:0;font-size:9px;font-family:Arial,sans-serif;">
95 <tr>
96 <td style="padding-bottom:50px;width:5%;" align="left">
97 &nbsp;&nbsp;
98 </td>
99 <td style="padding:0;width:90%;border-top: 1px solid #000;" align="left">
100 <table role="presentation" style="width:100%;border-collapse:collapse;border:0;border-spacing:0;">
101 <tr>
102 <td colspan="7" style="padding:0;width:5%;" align="left">
103 &nbsp;&nbsp;
104 </td>
105 </tr>
106 <tr>
107 <td style="padding:0;width:5%;" align="left">
108
109 </td>
110 <td style="padding:0;width:5%;" align="left">
111 <img width="16" src="https://fp-canada.gotenzing.com/wp-content/uploads/2022/01/t.png" class="img-fluid" alt="FP Canada">
112 </td>
113 <td style="padding:0;width:5%;" align="left">
114 <img width="8" src="https://fp-canada.gotenzing.com/wp-content/uploads/2022/01/fb.png" class="img-fluid" alt="FP Canada">
115 </td>
116 <td style="padding:0;width:5%;" align="left">
117 <img width="17" src="https://fp-canada.gotenzing.com/wp-content/uploads/2022/01/insta.png" class="img-fluid" alt="FP Canada">
118 </td>
119 <td style="padding:0;width:5%;" align="left">
120 <img width="16" src="https://fp-canada.gotenzing.com/wp-content/uploads/2022/01/you.png" class="img-fluid" alt="FP Canada">
121 </td>
122 <td style="padding:0;width:5%;" align="left">
123 <img width="16" src="https://fp-canada.gotenzing.com/wp-content/uploads/2022/01/link.png" class="img-fluid" alt="FP Canada">
124 </td>
125 <td style="padding:0;width:5%;" align="left">
126 &nbsp;&nbsp;
127 </td>
128 </tr>
129 </table>
130 </td>
131 <td style="padding:0;width:5%;" align="left">
132
133 </td>
134 </tr>
135 <tr>
136 <td style="padding-bottom:0px;width:5%;" align="left">
137 &nbsp;&nbsp;
138 </td>
139 </tr>
140 <tr>
141 <td colspan="4" style="padding-bottom:10px;width:5%; font-size:14px;" align="center">
142 <p><strong>FP Canada</strong><br>
143 902-375 University Ave.<br>
144 Toronto, ON M5G 2J5 <br>
145 <a style="color:#5B6770;text-decoration: none;" href="tel:1 800 305 9886">1 800 305 9886</a> | <a style="color:#5B6770;text-decoration: none;" href="mailto:wyncampaign@fpcanada.ca">wyncampaign@fpcanada.ca</a>
146 </p>
147 </td>
148 </tr>
149 </table>
150 </td>
151 </tr>
152 </table>
153 </td>
154 </tr>
155 </table>
156 </body>
157 </html>
158
1 <?php
2 /**
3 * Understrap emails
4 *
5 * @package Understrap
6 */
7
8 // Exit if accessed directly.
9
10
11 add_filter( 'cf7_2_post_status_wpsl_stores', 'publish_new_wpsl_stores',10,3);
12 /**
13 * Function to change the post status of saved/submitted posts.
14 * @param string $status the post status, default is 'draft'.
15 * @param string $ckf7_key unique key to identify your form.
16 * @param array $submitted_data complete set of data submitted in the form as an array of field-name=>value pairs.
17 * @return string a valid post status ('publish'|'draft'|'pending'|'trash')
18 */
19 function publish_new_wpsl_stores($status, $ckf7_key, $submitted_data){
20
21 $email = $submitted_data['your-email'];
22
23 $subject = 'Important Registration Information';
24 $message = file_get_contents('registration-confirmation.html');
25 $headers_customer = array('Content-Type: text/html; charset=UTF-8');
26 wp_mail( $email , $subject, $message, $headers_customer);
27
28
29 return 'draft';
30 }
...\ No newline at end of file ...\ No newline at end of file