Gravity PDF - Version 4.0.2

Version Description

  • Fixes issue displaying address fields in v4 PDFs (GH#429)
  • Fixes internal logging issues and added Gravity Forms 1.1 support (GF#428)
  • Fixes notice when form pagination information is not available (GH#437)
  • Fixes notice when using GPDFAPI::product_table() on form that had no products (GH#438)
  • Fixes caching issue with GravityView Enable Notifications plugin that caused PDF attachment not to be updated (GH#436)
Download this release

Release Info

Developer Blue Liquid Designs
Plugin Icon 128x128 Gravity PDF
Version 4.0.2
Comparing to
See all releases

Code changes from version 4.0.1 to 4.0.2

README.txt CHANGED
@@ -5,7 +5,7 @@ Donate link: https://gravitypdf.com/donate-to-plugin/
5
  Tags: gravity, forms, pdf, automation, attachment, email
6
  Requires at least: 4.2
7
  Tested up to: 4.5
8
- Stable tag: 4.0.1
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl.txt
11
 
@@ -34,9 +34,9 @@ The plugin ships with four highly-customisable PDF templates perfectly suited fo
34
 
35
  = Requirements =
36
 
37
- Gravity PDF can be run on most shared web hosting without any issues. It requires **PHP 5.4+** (PHP 7.0+ recommended) and at least 64MB of WP Memory (128MB+ recommended). You'll also need to be running WordPress 4.2+ and have Gravity Forms 1.9+.
38
 
39
- [Don't have Gravity Forms? Purchase a license](https://goo.gl/lsBOef) (any license type will do, although a Developer license will give you the best bang for the buck). If you aren't sure Gravity PDF will meet your needs (and haven't got a Gravity Forms license yet) you can [try out the software via our demo site](https://demo.gravitypdf.com).
40
 
41
  = Documentation & Support =
42
 
@@ -56,6 +56,8 @@ You can also keep up to date with Gravity PDF by [subscribing to our newsletter]
56
 
57
  Also, if you enjoy using the software [we'd love it if you could give us a review!](https://wordpress.org/support/view/plugin-reviews/gravity-forms-pdf-extended)
58
 
 
 
59
  == Installation ==
60
 
61
  [You'll find detailed installation instructions on GravityPDF.com](https://gravitypdf.com/documentation/v4/user-installation/).
@@ -83,6 +85,13 @@ Also, if you enjoy using the software [we'd love it if you could give us a revie
83
 
84
  == Changelog ==
85
 
 
 
 
 
 
 
 
86
  = 4.0.1 =
87
  * Fixes PHP notice when viewing PDF and Category field is empty (GH#419)
88
  * Fixes PHP notice when viewing PDF and custom font directory is empty (GH#416)
5
  Tags: gravity, forms, pdf, automation, attachment, email
6
  Requires at least: 4.2
7
  Tested up to: 4.5
8
+ Stable tag: 4.0.2
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl.txt
11
 
34
 
35
  = Requirements =
36
 
37
+ Gravity PDF can be run on most shared web hosting without any issues. It requires **PHP 5.4+** (PHP 7.0+ recommended) and at least 64MB of WP Memory (128MB+ recommended). You'll also need to be running WordPress 4.2+ and have [Gravity Forms 1.9+](http://www.gravityforms.com/).
38
 
39
+ If you aren't sure Gravity PDF will meet your needs (and haven't got a Gravity Forms license yet) you can [try out the software via our demo site](https://demo.gravitypdf.com).
40
 
41
  = Documentation & Support =
42
 
56
 
57
  Also, if you enjoy using the software [we'd love it if you could give us a review!](https://wordpress.org/support/view/plugin-reviews/gravity-forms-pdf-extended)
58
 
59
+ *Note: When Gravity Forms isn't installed and you activate Gravity PDF we display a notice that includes an affiliate link to their website.*
60
+
61
  == Installation ==
62
 
63
  [You'll find detailed installation instructions on GravityPDF.com](https://gravitypdf.com/documentation/v4/user-installation/).
85
 
86
  == Changelog ==
87
 
88
+ = 4.0.2 =
89
+ * Fixes issue displaying address fields in v4 PDFs (GH#429)
90
+ * Fixes internal logging issues and added Gravity Forms 1.1 support (GF#428)
91
+ * Fixes notice when form pagination information is not available (GH#437)
92
+ * Fixes notice when using GPDFAPI::product_table() on form that had no products (GH#438)
93
+ * Fixes caching issue with GravityView Enable Notifications plugin that caused PDF attachment not to be updated (GH#436)
94
+
95
  = 4.0.1 =
96
  * Fixes PHP notice when viewing PDF and Category field is empty (GH#419)
97
  * Fixes PHP notice when viewing PDF and custom font directory is empty (GH#416)
api.php CHANGED
@@ -471,11 +471,14 @@ final class GPDFAPI {
471
 
472
  $products = new GFPDF\Helper\Fields\Field_Products( new GF_Field(), $entry, $gfpdf->gform, $gfpdf->misc );
473
 
474
- if ( $return ) {
475
- return $products->html();
476
- }
 
 
477
 
478
- echo $products->html();
 
479
 
480
  return null;
481
  }
471
 
472
  $products = new GFPDF\Helper\Fields\Field_Products( new GF_Field(), $entry, $gfpdf->gform, $gfpdf->misc );
473
 
474
+ if( ! $products->is_empty() ) {
475
+
476
+ if ( $return ) {
477
+ return $products->html();
478
+ }
479
 
480
+ echo $products->html();
481
+ }
482
 
483
  return null;
484
  }
pdf.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /*
3
  Plugin Name: Gravity PDF
4
- Version: 4.0.1
5
  Description: Automatically generate highly-customisable PDF documents using Gravity Forms.
6
  Author: Gravity PDF
7
  Author URI: https://gravitypdf.com
@@ -38,7 +38,7 @@ if ( ! defined( 'ABSPATH' ) ) {
38
  * Set base constants we'll use throughout the plugin
39
  */
40
 
41
- define( 'PDF_EXTENDED_VERSION', '4.0.1' ); /* the current plugin version */
42
  define( 'PDF_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); /* plugin directory path */
43
  define( 'PDF_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); /* plugin directory url */
44
  define( 'PDF_PLUGIN_BASENAME', plugin_basename( __FILE__ ) ); /* the plugin basename */
1
  <?php
2
  /*
3
  Plugin Name: Gravity PDF
4
+ Version: 4.0.2
5
  Description: Automatically generate highly-customisable PDF documents using Gravity Forms.
6
  Author: Gravity PDF
7
  Author URI: https://gravitypdf.com
38
  * Set base constants we'll use throughout the plugin
39
  */
40
 
41
+ define( 'PDF_EXTENDED_VERSION', '4.0.2' ); /* the current plugin version */
42
  define( 'PDF_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); /* plugin directory path */
43
  define( 'PDF_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); /* plugin directory url */
44
  define( 'PDF_PLUGIN_BASENAME', plugin_basename( __FILE__ ) ); /* the plugin basename */
resources/images/mpdfstyletables.css CHANGED
@@ -1,124 +1,124 @@
1
-
2
- body { font-family: DejaVuSansCondensed; font-size: 11pt; }
3
- p { text-align: justify; margin-bottom: 4pt; margin-top:0pt; }
4
-
5
- table {font-family: DejaVuSansCondensed; font-size: 9pt; line-height: 1.2;
6
- margin-top: 2pt; margin-bottom: 5pt;
7
- border-collapse: collapse; }
8
-
9
- thead { font-weight: bold; vertical-align: bottom; }
10
- tfoot { font-weight: bold; vertical-align: top; }
11
- thead td { font-weight: bold; }
12
- tfoot td { font-weight: bold; }
13
-
14
- thead td, thead th, tfoot td, tfoot th { font-variant: small-caps; }
15
-
16
- .headerrow td, .headerrow th { background-gradient: linear #b7cebd #f5f8f5 0 1 0 0.2; }
17
- .footerrow td, .footerrow th { background-gradient: linear #b7cebd #f5f8f5 0 1 0 0.2; }
18
-
19
- th { font-weight: bold;
20
- vertical-align: top;
21
- text-align:left;
22
- padding-left: 2mm;
23
- padding-right: 2mm;
24
- padding-top: 0.5mm;
25
- padding-bottom: 0.5mm;
26
- }
27
-
28
- td { padding-left: 2mm;
29
- vertical-align: top;
30
- text-align:left;
31
- padding-right: 2mm;
32
- padding-top: 0.5mm;
33
- padding-bottom: 0.5mm;
34
- }
35
-
36
- th p { text-align: left; margin:0pt; }
37
- td p { text-align: left; margin:0pt; }
38
-
39
- table.widecells td {
40
- padding-left: 5mm;
41
- padding-right: 5mm;
42
- }
43
- table.tallcells td {
44
- padding-top: 3mm;
45
- padding-bottom: 3mm;
46
- }
47
-
48
- hr { width: 70%; height: 1px;
49
- text-align: center; color: #999999;
50
- margin-top: 8pt; margin-bottom: 8pt; }
51
-
52
- a { color: #000066; font-style: normal; text-decoration: underline;
53
- font-weight: normal; }
54
-
55
- ul { text-indent: 5mm; margin-bottom: 9pt; }
56
- ol { text-indent: 5mm; margin-bottom: 9pt; }
57
-
58
- pre { font-family: DejaVuSansMono; font-size: 9pt; margin-top: 5pt; margin-bottom: 5pt; }
59
-
60
- h1 { font-weight: normal; font-size: 26pt; color: #000066;
61
- font-family: DejaVuSansCondensed; margin-top: 18pt; margin-bottom: 6pt;
62
- border-top: 0.075cm solid #000000; border-bottom: 0.075cm solid #000000;
63
- text-align: ; page-break-after:avoid; }
64
- h2 { font-weight: bold; font-size: 12pt; color: #000066;
65
- font-family: DejaVuSansCondensed; margin-top: 6pt; margin-bottom: 6pt;
66
- border-top: 0.07cm solid #000000; border-bottom: 0.07cm solid #000000;
67
- text-align: ; text-transform:uppercase; page-break-after:avoid; }
68
- h3 { font-weight: normal; font-size: 26pt; color: #000000;
69
- font-family: DejaVuSansCondensed; margin-top: 0pt; margin-bottom: 6pt;
70
- border-top: 0; border-bottom: 0;
71
- text-align: ; page-break-after:avoid; }
72
- h4 { font-weight: ; font-size: 13pt; color: #9f2b1e;
73
- font-family: DejaVuSansCondensed; margin-top: 10pt; margin-bottom: 7pt;
74
- font-variant: small-caps;
75
- text-align: ; margin-collapse:collapse; page-break-after:avoid; }
76
- h5 { font-weight: bold; font-style:italic; ; font-size: 11pt; color: #000044;
77
- font-family: DejaVuSansCondensed; margin-top: 8pt; margin-bottom: 4pt;
78
- text-align: ; page-break-after:avoid; }
79
- h6 { font-weight: bold; font-size: 9.5pt; color: #333333;
80
- font-family: DejaVuSansCondensed; margin-top: 6pt; margin-bottom: ;
81
- text-align: ; page-break-after:avoid; }
82
-
83
- .breadcrumb {
84
- text-align: right; font-size: 8pt; font-family: DejaVuSerifCondensed; color: #666666;
85
- font-weight: bold; font-style: normal; margin-bottom: 6pt; }
86
-
87
- .evenrow td, .evenrow th { background-color: #f5f8f5; }
88
- .oddrow td, .oddrow th { background-color: #e3ece4; }
89
-
90
- .bpmTopic { background-color: #e3ece4; }
91
- .bpmTopicC { background-color: #e3ece4; }
92
- .bpmNoLines { background-color: #e3ece4; }
93
- .bpmNoLinesC { background-color: #e3ece4; }
94
- .bpmClear { }
95
- .bpmClearC { text-align: center; }
96
- .bpmTopnTail { background-color: #e3ece4; topntail: 0.02cm solid #495b4a;}
97
- .bpmTopnTailC { background-color: #e3ece4; topntail: 0.02cm solid #495b4a;}
98
- .bpmTopnTailClear { topntail: 0.02cm solid #495b4a; }
99
- .bpmTopnTailClearC { topntail: 0.02cm solid #495b4a; }
100
-
101
- .bpmTopicC td, .bpmTopicC td p { text-align: center; }
102
- .bpmNoLinesC td, .bpmNoLinesC td p { text-align: center; }
103
- .bpmClearC td, .bpmClearC td p { text-align: center; }
104
- .bpmTopnTailC td, .bpmTopnTailC td p { text-align: center; }
105
- .bpmTopnTailClearC td, .bpmTopnTailClearC td p { text-align: center; }
106
-
107
- .pmhMiddleCenter { text-align:center; vertical-align:middle; }
108
- .pmhMiddleRight { text-align:right; vertical-align:middle; }
109
- .pmhBottomCenter { text-align:center; vertical-align:bottom; }
110
- .pmhBottomRight { text-align:right; vertical-align:bottom; }
111
- .pmhTopCenter { text-align:center; vertical-align:top; }
112
- .pmhTopRight { text-align:right; vertical-align:top; }
113
- .pmhTopLeft { text-align:left; vertical-align:top; }
114
- .pmhBottomLeft { text-align:left; vertical-align:bottom; }
115
- .pmhMiddleLeft { text-align:left; vertical-align:middle; }
116
-
117
- .infobox { margin-top:10pt; background-color:#DDDDBB; text-align:center; border:1px solid #880000; }
118
-
119
- .bpmTopic td, .bpmTopic th { border-top: 1px solid #FFFFFF; }
120
- .bpmTopicC td, .bpmTopicC th { border-top: 1px solid #FFFFFF; }
121
- .bpmTopnTail td, .bpmTopnTail th { border-top: 1px solid #FFFFFF; }
122
- .bpmTopnTailC td, .bpmTopnTailC th { border-top: 1px solid #FFFFFF; }
123
-
124
-
1
+
2
+ body { font-family: DejaVuSansCondensed; font-size: 11pt; }
3
+ p { text-align: justify; margin-bottom: 4pt; margin-top:0pt; }
4
+
5
+ table {font-family: DejaVuSansCondensed; font-size: 9pt; line-height: 1.2;
6
+ margin-top: 2pt; margin-bottom: 5pt;
7
+ border-collapse: collapse; }
8
+
9
+ thead { font-weight: bold; vertical-align: bottom; }
10
+ tfoot { font-weight: bold; vertical-align: top; }
11
+ thead td { font-weight: bold; }
12
+ tfoot td { font-weight: bold; }
13
+
14
+ thead td, thead th, tfoot td, tfoot th { font-variant: small-caps; }
15
+
16
+ .headerrow td, .headerrow th { background-gradient: linear #b7cebd #f5f8f5 0 1 0 0.2; }
17
+ .footerrow td, .footerrow th { background-gradient: linear #b7cebd #f5f8f5 0 1 0 0.2; }
18
+
19
+ th { font-weight: bold;
20
+ vertical-align: top;
21
+ text-align:left;
22
+ padding-left: 2mm;
23
+ padding-right: 2mm;
24
+ padding-top: 0.5mm;
25
+ padding-bottom: 0.5mm;
26
+ }
27
+
28
+ td { padding-left: 2mm;
29
+ vertical-align: top;
30
+ text-align:left;
31
+ padding-right: 2mm;
32
+ padding-top: 0.5mm;
33
+ padding-bottom: 0.5mm;
34
+ }
35
+
36
+ th p { text-align: left; margin:0pt; }
37
+ td p { text-align: left; margin:0pt; }
38
+
39
+ table.widecells td {
40
+ padding-left: 5mm;
41
+ padding-right: 5mm;
42
+ }
43
+ table.tallcells td {
44
+ padding-top: 3mm;
45
+ padding-bottom: 3mm;
46
+ }
47
+
48
+ hr { width: 70%; height: 1px;
49
+ text-align: center; color: #999999;
50
+ margin-top: 8pt; margin-bottom: 8pt; }
51
+
52
+ a { color: #000066; font-style: normal; text-decoration: underline;
53
+ font-weight: normal; }
54
+
55
+ ul { text-indent: 5mm; margin-bottom: 9pt; }
56
+ ol { text-indent: 5mm; margin-bottom: 9pt; }
57
+
58
+ pre { font-family: DejaVuSansMono; font-size: 9pt; margin-top: 5pt; margin-bottom: 5pt; }
59
+
60
+ h1 { font-weight: normal; font-size: 26pt; color: #000066;
61
+ font-family: DejaVuSansCondensed; margin-top: 18pt; margin-bottom: 6pt;
62
+ border-top: 0.075cm solid #000000; border-bottom: 0.075cm solid #000000;
63
+ text-align: ; page-break-after:avoid; }
64
+ h2 { font-weight: bold; font-size: 12pt; color: #000066;
65
+ font-family: DejaVuSansCondensed; margin-top: 6pt; margin-bottom: 6pt;
66
+ border-top: 0.07cm solid #000000; border-bottom: 0.07cm solid #000000;
67
+ text-align: ; text-transform:uppercase; page-break-after:avoid; }
68
+ h3 { font-weight: normal; font-size: 26pt; color: #000000;
69
+ font-family: DejaVuSansCondensed; margin-top: 0pt; margin-bottom: 6pt;
70
+ border-top: 0; border-bottom: 0;
71
+ text-align: ; page-break-after:avoid; }
72
+ h4 { font-weight: ; font-size: 13pt; color: #9f2b1e;
73
+ font-family: DejaVuSansCondensed; margin-top: 10pt; margin-bottom: 7pt;
74
+ font-variant: small-caps;
75
+ text-align: ; margin-collapse:collapse; page-break-after:avoid; }
76
+ h5 { font-weight: bold; font-style:italic; ; font-size: 11pt; color: #000044;
77
+ font-family: DejaVuSansCondensed; margin-top: 8pt; margin-bottom: 4pt;
78
+ text-align: ; page-break-after:avoid; }
79
+ h6 { font-weight: bold; font-size: 9.5pt; color: #333333;
80
+ font-family: DejaVuSansCondensed; margin-top: 6pt; margin-bottom: ;
81
+ text-align: ; page-break-after:avoid; }
82
+
83
+ .breadcrumb {
84
+ text-align: right; font-size: 8pt; font-family: DejaVuSerifCondensed; color: #666666;
85
+ font-weight: bold; font-style: normal; margin-bottom: 6pt; }
86
+
87
+ .evenrow td, .evenrow th { background-color: #f5f8f5; }
88
+ .oddrow td, .oddrow th { background-color: #e3ece4; }
89
+
90
+ .bpmTopic { background-color: #e3ece4; }
91
+ .bpmTopicC { background-color: #e3ece4; }
92
+ .bpmNoLines { background-color: #e3ece4; }
93
+ .bpmNoLinesC { background-color: #e3ece4; }
94
+ .bpmClear { }
95
+ .bpmClearC { text-align: center; }
96
+ .bpmTopnTail { background-color: #e3ece4; topntail: 0.02cm solid #495b4a;}
97
+ .bpmTopnTailC { background-color: #e3ece4; topntail: 0.02cm solid #495b4a;}
98
+ .bpmTopnTailClear { topntail: 0.02cm solid #495b4a; }
99
+ .bpmTopnTailClearC { topntail: 0.02cm solid #495b4a; }
100
+
101
+ .bpmTopicC td, .bpmTopicC td p { text-align: center; }
102
+ .bpmNoLinesC td, .bpmNoLinesC td p { text-align: center; }
103
+ .bpmClearC td, .bpmClearC td p { text-align: center; }
104
+ .bpmTopnTailC td, .bpmTopnTailC td p { text-align: center; }
105
+ .bpmTopnTailClearC td, .bpmTopnTailClearC td p { text-align: center; }
106
+
107
+ .pmhMiddleCenter { text-align:center; vertical-align:middle; }
108
+ .pmhMiddleRight { text-align:right; vertical-align:middle; }
109
+ .pmhBottomCenter { text-align:center; vertical-align:bottom; }
110
+ .pmhBottomRight { text-align:right; vertical-align:bottom; }
111
+ .pmhTopCenter { text-align:center; vertical-align:top; }
112
+ .pmhTopRight { text-align:right; vertical-align:top; }
113
+ .pmhTopLeft { text-align:left; vertical-align:top; }
114
+ .pmhBottomLeft { text-align:left; vertical-align:bottom; }
115
+ .pmhMiddleLeft { text-align:left; vertical-align:middle; }
116
+
117
+ .infobox { margin-top:10pt; background-color:#DDDDBB; text-align:center; border:1px solid #880000; }
118
+
119
+ .bpmTopic td, .bpmTopic th { border-top: 1px solid #FFFFFF; }
120
+ .bpmTopicC td, .bpmTopicC th { border-top: 1px solid #FFFFFF; }
121
+ .bpmTopnTail td, .bpmTopnTail th { border-top: 1px solid #FFFFFF; }
122
+ .bpmTopnTailC td, .bpmTopnTailC th { border-top: 1px solid #FFFFFF; }
123
+
124
+
src/assets/languages/gravity-forms-pdf-extended.pot CHANGED
@@ -66,43 +66,43 @@ msgstr ""
66
  msgid "The minimum requirements for Gravity PDF have not been met. Please fix the issue(s) below to continue:"
67
  msgstr ""
68
 
69
- #: src/bootstrap.php:293, src/bootstrap.php:317, src/depreciated.php:113, src/depreciated.php:137
70
  msgid "\"%s\" has been depreciated as of Gravity PDF 4.0"
71
  msgstr ""
72
 
73
- #: src/bootstrap.php:741
74
  msgid "View Gravity PDF Settings"
75
  msgstr ""
76
 
77
- #: src/bootstrap.php:741
78
  msgid "Settings"
79
  msgstr ""
80
 
81
- #: src/bootstrap.php:781
82
  msgid "View Gravity PDF Documentation"
83
  msgstr ""
84
 
85
- #: src/bootstrap.php:781
86
  msgid "Docs"
87
  msgstr ""
88
 
89
- #: src/bootstrap.php:783
90
  msgid "Get Help and Support"
91
  msgstr ""
92
 
93
- #: src/bootstrap.php:783
94
  msgid "Support"
95
  msgstr ""
96
 
97
- #: src/bootstrap.php:785
98
  msgid "View Gravity PDF Theme Shop"
99
  msgstr ""
100
 
101
- #: src/bootstrap.php:785
102
  msgid "Theme Shop"
103
  msgstr ""
104
 
105
- #: src/bootstrap.php:1271, src/controller/Controller_Shortcodes.php:301, src/helper/Helper_Data.php:349
106
  msgid "Gravity PDF"
107
  msgstr ""
108
 
@@ -126,7 +126,7 @@ msgstr ""
126
  msgid "There was a problem uninstalling Gravity PDF. Please try again."
127
  msgstr ""
128
 
129
- #: src/controller/Controller_PDF.php:609, src/view/View_PDF.php:475
130
  msgid "There was a problem generating your PDF"
131
  msgstr ""
132
 
@@ -487,11 +487,11 @@ msgstr ""
487
  msgid "Cannot find file %s"
488
  msgstr ""
489
 
490
- #: src/helper/fields/Field_Products.php:333
491
  msgid "Subtotal"
492
  msgstr ""
493
 
494
- #: src/helper/fields/Field_Products.php:341
495
  msgid "Shipping (%s)"
496
  msgstr ""
497
 
66
  msgid "The minimum requirements for Gravity PDF have not been met. Please fix the issue(s) below to continue:"
67
  msgstr ""
68
 
69
+ #: src/bootstrap.php:295, src/bootstrap.php:319, src/depreciated.php:113, src/depreciated.php:137
70
  msgid "\"%s\" has been depreciated as of Gravity PDF 4.0"
71
  msgstr ""
72
 
73
+ #: src/bootstrap.php:755
74
  msgid "View Gravity PDF Settings"
75
  msgstr ""
76
 
77
+ #: src/bootstrap.php:755
78
  msgid "Settings"
79
  msgstr ""
80
 
81
+ #: src/bootstrap.php:795
82
  msgid "View Gravity PDF Documentation"
83
  msgstr ""
84
 
85
+ #: src/bootstrap.php:795
86
  msgid "Docs"
87
  msgstr ""
88
 
89
+ #: src/bootstrap.php:797
90
  msgid "Get Help and Support"
91
  msgstr ""
92
 
93
+ #: src/bootstrap.php:797
94
  msgid "Support"
95
  msgstr ""
96
 
97
+ #: src/bootstrap.php:799
98
  msgid "View Gravity PDF Theme Shop"
99
  msgstr ""
100
 
101
+ #: src/bootstrap.php:799
102
  msgid "Theme Shop"
103
  msgstr ""
104
 
105
+ #: src/bootstrap.php:1285, src/controller/Controller_Shortcodes.php:301, src/helper/Helper_Data.php:349
106
  msgid "Gravity PDF"
107
  msgstr ""
108
 
126
  msgid "There was a problem uninstalling Gravity PDF. Please try again."
127
  msgstr ""
128
 
129
+ #: src/controller/Controller_PDF.php:611, src/view/View_PDF.php:475
130
  msgid "There was a problem generating your PDF"
131
  msgstr ""
132
 
487
  msgid "Cannot find file %s"
488
  msgstr ""
489
 
490
+ #: src/helper/fields/Field_Products.php:367
491
  msgid "Subtotal"
492
  msgstr ""
493
 
494
+ #: src/helper/fields/Field_Products.php:375
495
  msgid "Shipping (%s)"
496
  msgstr ""
497
 
src/bootstrap.php CHANGED
@@ -21,6 +21,7 @@ use Monolog\Processor\MemoryPeakUsageProcessor;
21
  use Monolog\Processor\WebProcessor;
22
 
23
  use GFFormsModel;
 
24
 
25
  /**
26
  * Bootstrap / Router Class
@@ -304,20 +305,16 @@ class Router implements Helper\Helper_Interface_Actions, Helper\Helper_Interface
304
  /* Initialise our logger */
305
  $this->log = new Logger( 'gravitypdf' );
306
 
307
- /* Prevent logging in CLI mode */
308
- if ( substr( php_sapi_name(), 0, 3 ) === 'cli' ) {
309
- $this->log->pushHandler( new NullHandler( Logger::INFO ) ); /* throw logs away */
310
-
311
- return;
312
- }
313
-
314
  /* Setup our Gravity Forms local file logger, if enabled */
315
  $this->setup_gravityforms_logging();
316
 
317
  /* Check if we have a handler pushed and add our Introspection and Memory Peak usage processors */
318
- if ( sizeof( $this->log->getHandlers() ) > 0 ) {
319
  $this->log->pushProcessor( new IntrospectionProcessor );
320
  $this->log->pushProcessor( new MemoryPeakUsageProcessor );
 
 
 
321
  }
322
  }
323
 
@@ -333,21 +330,31 @@ class Router implements Helper\Helper_Interface_Actions, Helper\Helper_Interface
333
  /* Check if Gravity Forms logging is enabled and push stream logging */
334
  if ( class_exists( 'GFLogging' ) ) {
335
 
336
- /* Get the current plugin logger settings and check if it's enabled */
337
- $settings = get_option( 'gf_logging_settings', array() );
338
- $log_level = rgar( $settings, 'gravity-pdf' );
 
 
 
 
 
 
 
 
 
 
 
 
339
 
 
340
  if ( ! empty( $log_level ) && $log_level !== 6 ) {
341
 
342
- /* Set our log file */
343
- $log_file_name = GFFormsModel::get_upload_root() . 'logs/gravity-pdf.txt';
344
-
345
  /* Convert Gravity Forms log levels to the appropriate Monolog level */
346
- $monolog_level = ( $log_level == 4 ) ? Logger::ERROR : Logger::INFO;
347
 
348
  /* Setup our stream and change the format to more-suit Gravity Forms */
349
- $formatter = new LineFormatter( "%datetime% - %level_name% --> %message% %context% %extra%\n" );
350
- $stream = new StreamHandler( $log_file_name, $monolog_level );
351
  $stream->setFormatter( $formatter );
352
 
353
  /* Add our log file stream */
21
  use Monolog\Processor\WebProcessor;
22
 
23
  use GFFormsModel;
24
+ use GFLogging;
25
 
26
  /**
27
  * Bootstrap / Router Class
305
  /* Initialise our logger */
306
  $this->log = new Logger( 'gravitypdf' );
307
 
 
 
 
 
 
 
 
308
  /* Setup our Gravity Forms local file logger, if enabled */
309
  $this->setup_gravityforms_logging();
310
 
311
  /* Check if we have a handler pushed and add our Introspection and Memory Peak usage processors */
312
+ if ( sizeof( $this->log->getHandlers() ) > 0 && substr( php_sapi_name(), 0, 3 ) !== 'cli' ) {
313
  $this->log->pushProcessor( new IntrospectionProcessor );
314
  $this->log->pushProcessor( new MemoryPeakUsageProcessor );
315
+ } else {
316
+ /* Disable logging if using CLI, or if Gravity Forms logging isn't enabled */
317
+ $this->log->pushHandler( new NullHandler( Logger::INFO ) ); /* throw logs away */
318
  }
319
  }
320
 
330
  /* Check if Gravity Forms logging is enabled and push stream logging */
331
  if ( class_exists( 'GFLogging' ) ) {
332
 
333
+ /*
334
+ * Get the current plugin logger settings and check if it's enabled
335
+ * The new version of the logger uses the add-on storage method, while the old one stores it in gf_logging_settings
336
+ * so we'll test which settings we should use and get the appropriate log level
337
+ */
338
+ if ( ! defined( 'GF_LOGGING_VERSION' ) || version_compare( GF_LOGGING_VERSION, '1.1', '<' ) ) {
339
+ $settings = get_option( 'gf_logging_settings' );
340
+ $log_level = (int) rgar( $settings, 'gravity-pdf' );
341
+ $log_filename = GFFormsModel::get_upload_root() . 'logs/gravity-pdf.txt';
342
+ } else {
343
+ $gf_logger = GFLogging::get_instance();
344
+ $gf_logger_settings = $gf_logger->get_plugin_settings();
345
+ $log_level = ( isset( $gf_logger_settings['gravity-pdf']['log_level'] ) ) ? (int) $gf_logger_settings['gravity-pdf']['log_level'] : 0;
346
+ $log_filename = $gf_logger::get_log_file_name( 'gravity-pdf' );
347
+ }
348
 
349
+ /* Enable logging if not equivalent to empty (0) and not level 6 (which is apprently off in GF world) */
350
  if ( ! empty( $log_level ) && $log_level !== 6 ) {
351
 
 
 
 
352
  /* Convert Gravity Forms log levels to the appropriate Monolog level */
353
+ $monolog_level = ( $log_level === 4 ) ? Logger::ERROR : Logger::INFO;
354
 
355
  /* Setup our stream and change the format to more-suit Gravity Forms */
356
+ $formatter = new LineFormatter( "%datetime% - %level_name% --> %message% %context% %extra%<br>\n" );
357
+ $stream = new StreamHandler( $log_filename, $monolog_level );
358
  $stream->setFormatter( $formatter );
359
 
360
  /* Add our log file stream */
src/controller/Controller_PDF.php CHANGED
@@ -150,6 +150,7 @@ class Controller_PDF extends Helper_Abstract_Controller implements Helper_Interf
150
 
151
  /* Clean-up actions */
152
  add_action( 'gform_after_submission', array( $this->model, 'cleanup_pdf' ), 9999, 2 );
 
153
  add_action( 'gfpdf_cleanup_tmp_dir', array( $this->model, 'cleanup_tmp_dir' ) );
154
  }
155
 
150
 
151
  /* Clean-up actions */
152
  add_action( 'gform_after_submission', array( $this->model, 'cleanup_pdf' ), 9999, 2 );
153
+ add_action( 'gform_after_update_entry', array( $this->model, 'cleanup_pdf_after_submission' ), 9999, 2 );
154
  add_action( 'gfpdf_cleanup_tmp_dir', array( $this->model, 'cleanup_tmp_dir' ) );
155
  }
156
 
src/helper/abstract/Helper_Abstract_Model.php CHANGED
@@ -1,76 +1,76 @@
1
- <?php
2
-
3
- namespace GFPDF\Helper;
4
-
5
- /**
6
- * Abstract Helper Model
7
- *
8
- * @package Gravity PDF
9
- * @copyright Copyright (c) 2016, Blue Liquid Designs
10
- * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
11
- * @since 4.0
12
- */
13
-
14
- /* Exit if accessed directly */
15
- if ( ! defined( 'ABSPATH' ) ) {
16
- exit;
17
- }
18
-
19
- /*
20
- This file is part of Gravity PDF.
21
-
22
- Gravity PDF – Copyright (C) 2016, Blue Liquid Designs
23
-
24
- This program is free software; you can redistribute it and/or modify
25
- it under the terms of the GNU General Public License as published by
26
- the Free Software Foundation; either version 2 of the License, or
27
- (at your option) any later version.
28
-
29
- This program is distributed in the hope that it will be useful,
30
- but WITHOUT ANY WARRANTY; without even the implied warranty of
31
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
32
- GNU General Public License for more details.
33
-
34
- You should have received a copy of the GNU General Public License
35
- along with this program; if not, write to the Free Software
36
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
37
- */
38
-
39
- /**
40
- * A simple abstract class controlers can extent to share similar variables
41
- *
42
- * @since 4.0
43
- */
44
- abstract class Helper_Abstract_Model {
45
-
46
- /**
47
- * Classes will store a controler object to allow user access
48
- *
49
- * @var object
50
- *
51
- * @since 4.0
52
- */
53
- private $controller = null;
54
-
55
- /**
56
- * Add a controller setter function with type hinting to ensure compatiiblity
57
- *
58
- * @param \GFPDF\Helper\Helper_Abstract_Controller $class The controller class
59
- *
60
- * @since 4.0
61
- */
62
- final public function setController( Helper_Abstract_Controller $class ) {
63
- $this->controller = $class;
64
- }
65
-
66
- /**
67
- * Get the controller
68
- *
69
- * @since 4.0
70
- *
71
- * @return \GFPDF\Helper\Helper_Abstract_Controller
72
- */
73
- final public function getController() {
74
- return $this->controller;
75
- }
76
- }
1
+ <?php
2
+
3
+ namespace GFPDF\Helper;
4
+
5
+ /**
6
+ * Abstract Helper Model
7
+ *
8
+ * @package Gravity PDF
9
+ * @copyright Copyright (c) 2016, Blue Liquid Designs
10
+ * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
11
+ * @since 4.0
12
+ */
13
+
14
+ /* Exit if accessed directly */
15
+ if ( ! defined( 'ABSPATH' ) ) {
16
+ exit;
17
+ }
18
+
19
+ /*
20
+ This file is part of Gravity PDF.
21
+
22
+ Gravity PDF – Copyright (C) 2016, Blue Liquid Designs
23
+
24
+ This program is free software; you can redistribute it and/or modify
25
+ it under the terms of the GNU General Public License as published by
26
+ the Free Software Foundation; either version 2 of the License, or
27
+ (at your option) any later version.
28
+
29
+ This program is distributed in the hope that it will be useful,
30
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
31
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
32
+ GNU General Public License for more details.
33
+
34
+ You should have received a copy of the GNU General Public License
35
+ along with this program; if not, write to the Free Software
36
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
37
+ */
38
+
39
+ /**
40
+ * A simple abstract class controlers can extent to share similar variables
41
+ *
42
+ * @since 4.0
43
+ */
44
+ abstract class Helper_Abstract_Model {
45
+
46
+ /**
47
+ * Classes will store a controler object to allow user access
48
+ *
49
+ * @var object
50
+ *
51
+ * @since 4.0
52
+ */
53
+ private $controller = null;
54
+
55
+ /**
56
+ * Add a controller setter function with type hinting to ensure compatiiblity
57
+ *
58
+ * @param \GFPDF\Helper\Helper_Abstract_Controller $class The controller class
59
+ *
60
+ * @since 4.0
61
+ */
62
+ final public function setController( Helper_Abstract_Controller $class ) {
63
+ $this->controller = $class;
64
+ }
65
+
66
+ /**
67
+ * Get the controller
68
+ *
69
+ * @since 4.0
70
+ *
71
+ * @return \GFPDF\Helper\Helper_Abstract_Controller
72
+ */
73
+ final public function getController() {
74
+ return $this->controller;
75
+ }
76
+ }
src/helper/fields/Field_Address.php CHANGED
@@ -149,7 +149,7 @@ class Field_Address extends Helper_Abstract_Fields {
149
  foreach( $field->inputs as $item ) {
150
  if ( ! isset( $item['isHidden'] ) || false === $item['isHidden'] ) {
151
  /* Now we know item isn't hidden, go through the values and check if there's data */
152
- $item_value = trim( rgget( $item['id'], $value ) );
153
  if ( ! empty( $item_value ) ) {
154
  return false;
155
  }
149
  foreach( $field->inputs as $item ) {
150
  if ( ! isset( $item['isHidden'] ) || false === $item['isHidden'] ) {
151
  /* Now we know item isn't hidden, go through the values and check if there's data */
152
+ $item_value = trim( rgget( (string) $item['id'], $value ) );
153
  if ( ! empty( $item_value ) ) {
154
  return false;
155
  }
src/helper/fields/Field_Post_Excerpt.php CHANGED
@@ -1,109 +1,109 @@
1
- <?php
2
-
3
- namespace GFPDF\Helper\Fields;
4
-
5
- use GFPDF\Helper\Helper_Abstract_Form;
6
- use GFPDF\Helper\Helper_Misc;
7
- use GFPDF\Helper\Helper_Abstract_Fields;
8
-
9
- use GF_Field_Post_Excerpt;
10
-
11
- use Exception;
12
-
13
- /**
14
- * Gravity Forms Field
15
- *
16
- * @package Gravity PDF
17
- * @copyright Copyright (c) 2016, Blue Liquid Designs
18
- * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
19
- * @since 4.0
20
- */
21
-
22
- /* Exit if accessed directly */
23
- if ( ! defined( 'ABSPATH' ) ) {
24
- exit;
25
- }
26
-
27
- /*
28
- This file is part of Gravity PDF.
29
-
30
- Gravity PDF – Copyright (C) 2016, Blue Liquid Designs
31
-
32
- This program is free software; you can redistribute it and/or modify
33
- it under the terms of the GNU General Public License as published by
34
- the Free Software Foundation; either version 2 of the License, or
35
- (at your option) any later version.
36
-
37
- This program is distributed in the hope that it will be useful,
38
- but WITHOUT ANY WARRANTY; without even the implied warranty of
39
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
40
- GNU General Public License for more details.
41
-
42
- You should have received a copy of the GNU General Public License
43
- along with this program; if not, write to the Free Software
44
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
45
- */
46
-
47
- /**
48
- * Controls the display and output of a Gravity Form field
49
- *
50
- * @since 4.0
51
- */
52
- class Field_Post_Excerpt extends Helper_Abstract_Fields {
53
-
54
- /**
55
- * Check the appropriate variables are parsed in send to the parent construct
56
- *
57
- * @param object $field The GF_Field_* Object
58
- * @param array $entry The Gravity Forms Entry
59
- *
60
- * @param \GFPDF\Helper\Helper_Abstract_Form $gform
61
- * @param \GFPDF\Helper\Helper_Misc $misc
62
- *
63
- * @throws Exception
64
- *
65
- * @since 4.0
66
- */
67
- public function __construct( $field, $entry, Helper_Abstract_Form $gform, Helper_Misc $misc ) {
68
-
69
- if ( ! is_object( $field ) || ! $field instanceof GF_Field_Post_Excerpt ) {
70
- throw new Exception( '$field needs to be in instance of GF_Field_Post_Excerpt' );
71
- }
72
-
73
- /* call our parent method */
74
- parent::__construct( $field, $entry, $gform, $misc );
75
- }
76
-
77
- /**
78
- * Display the HTML version of this field
79
- *
80
- * @param string $value
81
- * @param bool $label
82
- *
83
- * @return string
84
- *
85
- * @since 4.0
86
- */
87
- public function html( $value = '', $label = true ) {
88
- $value = $this->value();
89
-
90
- return parent::html( $value );
91
- }
92
-
93
- /**
94
- * Get the standard GF value of this field
95
- *
96
- * @return string|array
97
- *
98
- * @since 4.0
99
- */
100
- public function value() {
101
- if ( $this->has_cache() ) {
102
- return $this->cache();
103
- }
104
-
105
- $this->cache( esc_html( $this->get_value() ) );
106
-
107
- return $this->cache();
108
- }
109
- }
1
+ <?php
2
+
3
+ namespace GFPDF\Helper\Fields;
4
+
5
+ use GFPDF\Helper\Helper_Abstract_Form;
6
+ use GFPDF\Helper\Helper_Misc;
7
+ use GFPDF\Helper\Helper_Abstract_Fields;
8
+
9
+ use GF_Field_Post_Excerpt;
10
+
11
+ use Exception;
12
+
13
+ /**
14
+ * Gravity Forms Field
15
+ *
16
+ * @package Gravity PDF
17
+ * @copyright Copyright (c) 2016, Blue Liquid Designs
18
+ * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
19
+ * @since 4.0
20
+ */
21
+
22
+ /* Exit if accessed directly */
23
+ if ( ! defined( 'ABSPATH' ) ) {
24
+ exit;
25
+ }
26
+
27
+ /*
28
+ This file is part of Gravity PDF.
29
+
30
+ Gravity PDF – Copyright (C) 2016, Blue Liquid Designs
31
+
32
+ This program is free software; you can redistribute it and/or modify
33
+ it under the terms of the GNU General Public License as published by
34
+ the Free Software Foundation; either version 2 of the License, or
35
+ (at your option) any later version.
36
+
37
+ This program is distributed in the hope that it will be useful,
38
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
39
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
40
+ GNU General Public License for more details.
41
+
42
+ You should have received a copy of the GNU General Public License
43
+ along with this program; if not, write to the Free Software
44
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
45
+ */
46
+
47
+ /**
48
+ * Controls the display and output of a Gravity Form field
49
+ *
50
+ * @since 4.0
51
+ */
52
+ class Field_Post_Excerpt extends Helper_Abstract_Fields {
53
+
54
+ /**
55
+ * Check the appropriate variables are parsed in send to the parent construct
56
+ *
57
+ * @param object $field The GF_Field_* Object
58
+ * @param array $entry The Gravity Forms Entry
59
+ *
60
+ * @param \GFPDF\Helper\Helper_Abstract_Form $gform
61
+ * @param \GFPDF\Helper\Helper_Misc $misc
62
+ *
63
+ * @throws Exception
64
+ *
65
+ * @since 4.0
66
+ */
67
+ public function __construct( $field, $entry, Helper_Abstract_Form $gform, Helper_Misc $misc ) {
68
+
69
+ if ( ! is_object( $field ) || ! $field instanceof GF_Field_Post_Excerpt ) {
70
+ throw new Exception( '$field needs to be in instance of GF_Field_Post_Excerpt' );
71
+ }
72
+
73
+ /* call our parent method */
74
+ parent::__construct( $field, $entry, $gform, $misc );
75
+ }
76
+
77
+ /**
78
+ * Display the HTML version of this field
79
+ *
80
+ * @param string $value
81
+ * @param bool $label
82
+ *
83
+ * @return string
84
+ *
85
+ * @since 4.0
86
+ */
87
+ public function html( $value = '', $label = true ) {
88
+ $value = $this->value();
89
+
90
+ return parent::html( $value );
91
+ }
92
+
93
+ /**
94
+ * Get the standard GF value of this field
95
+ *
96
+ * @return string|array
97
+ *
98
+ * @since 4.0
99
+ */
100
+ public function value() {
101
+ if ( $this->has_cache() ) {
102
+ return $this->cache();
103
+ }
104
+
105
+ $this->cache( esc_html( $this->get_value() ) );
106
+
107
+ return $this->cache();
108
+ }
109
+ }
src/helper/fields/Field_Products.php CHANGED
@@ -50,6 +50,23 @@ require_once( GFCommon::get_base_path() . '/currency.php' );
50
  */
51
  class Field_Products extends Helper_Abstract_Fields {
52
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
53
  /**
54
  * Return the HTML form data
55
  *
50
  */
51
  class Field_Products extends Helper_Abstract_Fields {
52
 
53
+ /**
54
+ * Checks if the form has any products
55
+ *
56
+ * @return boolean
57
+ *
58
+ * @since 4.0.2
59
+ */
60
+ public function is_empty() {
61
+ $form = $this->form;
62
+ foreach ( $form['fields'] as $field ) {
63
+ if ( GFCommon::is_product_field( $field->type ) ) {
64
+ return false;
65
+ }
66
+ }
67
+ return true;
68
+ }
69
+
70
  /**
71
  * Return the HTML form data
72
  *
src/model/Model_PDF.php CHANGED
@@ -1108,6 +1108,17 @@ class Model_PDF extends Helper_Abstract_Model {
1108
  }
1109
  }
1110
 
 
 
 
 
 
 
 
 
 
 
 
1111
  /**
1112
  * Clean-up any PDFs stored on disk before we resend any notifications
1113
  *
@@ -1268,20 +1279,13 @@ class Model_PDF extends Helper_Abstract_Model {
1268
  /* Merge in the meta data and survey, quiz and poll data */
1269
  $data = array_replace_recursive( $data, $form_meta, $quiz, $survey, $poll );
1270
 
1271
- /**
1272
  * Loop through the form data, call the correct field object and
1273
  * save the data to our $data array
1274
  */
1275
- $has_product_fields = false;
1276
-
1277
  if ( isset( $form['fields'] ) ) {
1278
  foreach ( $form['fields'] as $field ) {
1279
 
1280
- /* Skip over product fields as they will be grouped at the end */
1281
- if ( GFCommon::is_product_field( $field->type ) ) {
1282
- $has_product_fields = true;
1283
- }
1284
-
1285
  /* Skip over captcha, password and page fields */
1286
  $fields_to_skip = apply_filters( 'gfpdf_form_data_skip_fields', array(
1287
  'captcha',
@@ -1305,7 +1309,7 @@ class Model_PDF extends Helper_Abstract_Model {
1305
  }
1306
 
1307
  /* Load our product array if products exist */
1308
- if ( $has_product_fields ) {
1309
  $data = array_replace_recursive( $data, $products->form_data() );
1310
  }
1311
 
@@ -1371,7 +1375,7 @@ class Model_PDF extends Helper_Abstract_Model {
1371
  $data['date_created_usa'] = GFCommon::format_date( $entry['date_created'], false, 'n/j/Y', false );
1372
 
1373
  /* Include page names */
1374
- $data['pages'] = $form['pagination']['pages'];
1375
 
1376
  /* Add misc fields */
1377
  $data['misc']['date_time'] = GFCommon::format_date( $entry['date_created'], false, 'Y-m-d H:i:s', false );
1108
  }
1109
  }
1110
 
1111
+ /**
1112
+ * Triggered after the Gravity Form entry is updated
1113
+ *
1114
+ * @param array $form
1115
+ * @param int $entry_id
1116
+ */
1117
+ public function cleanup_pdf_after_submission( $form, $entry_id ) {
1118
+ $entry = $this->gform->get_entry( $entry_id );
1119
+ $this->cleanup_pdf( $entry, $form );
1120
+ }
1121
+
1122
  /**
1123
  * Clean-up any PDFs stored on disk before we resend any notifications
1124
  *
1279
  /* Merge in the meta data and survey, quiz and poll data */
1280
  $data = array_replace_recursive( $data, $form_meta, $quiz, $survey, $poll );
1281
 
1282
+ /*
1283
  * Loop through the form data, call the correct field object and
1284
  * save the data to our $data array
1285
  */
 
 
1286
  if ( isset( $form['fields'] ) ) {
1287
  foreach ( $form['fields'] as $field ) {
1288
 
 
 
 
 
 
1289
  /* Skip over captcha, password and page fields */
1290
  $fields_to_skip = apply_filters( 'gfpdf_form_data_skip_fields', array(
1291
  'captcha',
1309
  }
1310
 
1311
  /* Load our product array if products exist */
1312
+ if ( ! $products->is_empty() ) {
1313
  $data = array_replace_recursive( $data, $products->form_data() );
1314
  }
1315
 
1375
  $data['date_created_usa'] = GFCommon::format_date( $entry['date_created'], false, 'n/j/Y', false );
1376
 
1377
  /* Include page names */
1378
+ $data['pages'] = ( isset( $form['pagination']['pages'] ) ? $form['pagination']['pages'] : array());
1379
 
1380
  /* Add misc fields */
1381
  $data['misc']['date_time'] = GFCommon::format_date( $entry['date_created'], false, 'Y-m-d H:i:s', false );
src/model/Model_Shortcodes.php CHANGED
@@ -1,427 +1,427 @@
1
- <?php
2
-
3
- namespace GFPDF\Model;
4
-
5
- use GFPDF\Helper\Helper_Abstract_Model;
6
- use GFPDF\Helper\Helper_Abstract_Form;
7
- use GFPDF\Helper\Helper_Abstract_Options;
8
- use GFPDF\Helper\Helper_Misc;
9
-
10
- use Psr\Log\LoggerInterface;
11
-
12
- use GPDFAPI;
13
- use GFCommon;
14
- use GravityView_View;
15
-
16
- /**
17
- * PDF Shortcode Model
18
- *
19
- * @package Gravity PDF
20
- * @copyright Copyright (c) 2016, Blue Liquid Designs
21
- * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
22
- * @since 4.0
23
- */
24
-
25
- /* Exit if accessed directly */
26
- if ( ! defined( 'ABSPATH' ) ) {
27
- exit;
28
- }
29
-
30
- /*
31
- This file is part of Gravity PDF.
32
-
33
- Gravity PDF – Copyright (C) 2016, Blue Liquid Designs
34
-
35
- This program is free software; you can redistribute it and/or modify
36
- it under the terms of the GNU General Public License as published by
37
- the Free Software Foundation; either version 2 of the License, or
38
- (at your option) any later version.
39
-
40
- This program is distributed in the hope that it will be useful,
41
- but WITHOUT ANY WARRANTY; without even the implied warranty of
42
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
43
- GNU General Public License for more details.
44
-
45
- You should have received a copy of the GNU General Public License
46
- along with this program; if not, write to the Free Software
47
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
48
- */
49
-
50
- /**
51
- *
52
- * Handles all the PDF Shortcode logic
53
- *
54
- * @since 4.0
55
- */
56
- class Model_Shortcodes extends Helper_Abstract_Model {
57
-
58
- /**
59
- * Holds the abstracted Gravity Forms API specific to Gravity PDF
60
- *
61
- * @var \GFPDF\Helper\Helper_Form
62
- *
63
- * @since 4.0
64
- */
65
- protected $gform;
66
-
67
- /**
68
- * Holds our log class
69
- *
70
- * @var \Monolog\Logger|LoggerInterface
71
- *
72
- * @since 4.0
73
- */
74
- protected $log;
75
-
76
- /**
77
- * Holds our Helper_Abstract_Options / Helper_Options_Fields object
78
- * Makes it easy to access global PDF settings and individual form PDF settings
79
- *
80
- * @var \GFPDF\Helper\Helper_Options_Fields
81
- *
82
- * @since 4.0
83
- */
84
- protected $options;
85
-
86
- /**
87
- * Holds our Helper_Misc object
88
- * Makes it easy to access common methods throughout the plugin
89
- *
90
- * @var \GFPDF\Helper\Helper_Misc
91
- *
92
- * @since 4.0
93
- */
94
- protected $misc;
95
-
96
- /**
97
- * Setup our class by injecting all our dependancies
98
- *
99
- * @param \GFPDF\Helper\Helper_Abstract_Form|\GFPDF\Helper\Helper_Form $gform Our abstracted Gravity Forms helper functions
100
- * @param \Monolog\Logger|LoggerInterface $log Our logger class
101
- * @param \GFPDF\Helper\Helper_Abstract_Options|\GFPDF\Helper\Helper_Options_Fields $options Our options class which allows us to access any settings
102
- *
103
- * @since 4.0
104
- */
105
- public function __construct( Helper_Abstract_Form $gform, LoggerInterface $log, Helper_Abstract_Options $options, Helper_Misc $misc ) {
106
-
107
- /* Assign our internal variables */
108
- $this->gform = $gform;
109
- $this->log = $log;
110
- $this->options = $options;
111
- $this->misc = $misc;
112
- }
113
-
114
- /**
115
- * Generates a direct link to the PDF that should be generated
116
- * If placed in a confirmation the appropriate entry will be displayed.
117
- * A user also has the option to pass in an "entry" parameter to define the entry ID
118
- *
119
- * @param array $attributes The shortcode attributes specified
120
- *
121
- * @return string
122
- *
123
- * @since 4.0
124
- */
125
- public function gravitypdf( $attributes ) {
126
-
127
- $this->log->addNotice( 'Generating Shortcode' );
128
-
129
- $controller = $this->getController();
130
- $has_view_permissions = $this->gform->has_capability( 'gravityforms_view_entries' );
131
-
132
- /* merge in any missing defaults */
133
- $attributes = shortcode_atts( array(
134
- 'id' => '',
135
- 'text' => 'Download PDF',
136
- 'type' => 'download',
137
- 'class' => 'gravitypdf-download-link',
138
- 'classes' => '',
139
- 'entry' => '',
140
- 'print' => '',
141
- ), $attributes, 'gravitypdf' );
142
-
143
- /* See https://gravitypdf.com/documentation/v4/gfpdf_gravityforms_shortcode_attributes/ for more information about this filter */
144
- $attributes = apply_filters( 'gfpdf_gravityforms_shortcode_attributes', $attributes );
145
-
146
- /* Add Shortcake preview support */
147
- if ( defined( 'SHORTCODE_UI_DOING_PREVIEW' ) && SHORTCODE_UI_DOING_PREVIEW === true ) {
148
- $attributes['url'] = '#';
149
-
150
- return $controller->view->display_gravitypdf_shortcode( $attributes );
151
- }
152
-
153
- /* Check if we have an entry ID, otherwise check the GET and POST data */
154
- if ( empty( $attributes['entry'] ) ) {
155
- if ( isset( $_GET['lid'] ) || isset( $_GET['entry'] ) ) {
156
- $attributes['entry'] = ( isset( $_GET['lid'] ) ) ? (int) $_GET['lid'] : (int) $_GET['entry'];
157
- } else {
158
-
159
- /* Only display error to users with appropriate permissions */
160
- if ( $has_view_permissions ) {
161
- return $controller->view->no_entry_id();
162
- }
163
-
164
- return '';
165
- }
166
- }
167
-
168
- /* Check if we have a valid PDF configuration */
169
- $entry = $this->gform->get_entry( $attributes['entry'] );
170
- $config = ( ! is_wp_error( $entry ) ) ? $this->options->get_pdf( $entry['form_id'], $attributes['id'] ) : $entry; /* if invalid entry a WP_Error will be thrown */
171
-
172
- if ( is_wp_error( $config ) ) {
173
-
174
- /* Only display error to users with appropriate permissions */
175
- if ( $has_view_permissions ) {
176
- return $controller->view->invalid_pdf_config();
177
- }
178
-
179
- return '';
180
- }
181
-
182
- /* Check if the PDF is enabled AND the conditional logic (if any) has been met */
183
- if ( $config['active'] !== true ) {
184
- /* Only display error to users with appropriate permissions */
185
- if ( $has_view_permissions ) {
186
- return $controller->view->pdf_not_active();
187
- }
188
-
189
- return '';
190
- }
191
-
192
- if ( isset( $config['conditionalLogic'] ) && ! $this->misc->evaluate_conditional_logic( $config['conditionalLogic'], $entry ) ) {
193
- /* Only display error to users with appropriate permissions */
194
- if ( $has_view_permissions ) {
195
- return $controller->view->conditional_logic_not_met();
196
- }
197
-
198
- return '';
199
- }
200
-
201
- /* Everything looks valid so let's get the URL */
202
- $pdf = new Model_PDF( $this->gform, $this->log, $this->options, GPDFAPI::get_data_class(), GPDFAPI::get_misc_class(), GPDFAPI::get_notice_class() );
203
- $download = ( $attributes['type'] == 'download' ) ? true : false;
204
- $print = ( ! empty( $attributes['print'] ) ) ? true : false;
205
- $attributes['url'] = $pdf->get_pdf_url( $attributes['id'], $attributes['entry'], $download, $print );
206
-
207
- /* generate the markup and return */
208
- $this->log->addNotice( 'Generating Shortcode Markup', array(
209
- 'attr' => $attributes,
210
- ) );
211
-
212
- return $controller->view->display_gravitypdf_shortcode( $attributes );
213
- }
214
-
215
- /**
216
- * Update our Gravity Forms "Text" Confirmation Shortcode to include the current entry ID
217
- *
218
- * @param string $confirmation The confirmation text
219
- * @param array $form The Gravity Form array
220
- * @param array $entry The Gravity Form entry information
221
- *
222
- * @return array The confirmation text
223
- *
224
- * @since 4.0
225
- */
226
- public function gravitypdf_confirmation( $confirmation, $form, $entry ) {
227
-
228
- /* check if confirmation is text-based */
229
- if ( ! is_array( $confirmation ) ) {
230
- $confirmation = $this->add_entry_id_to_shortcode( $confirmation, $entry['id'] );
231
- }
232
-
233
- return $confirmation;
234
- }
235
-
236
- /**
237
- * Update our Gravity Forms Notification Shortcode to include the current entry ID
238
- *
239
- * @param string $notification The confirmation text
240
- * @param array $form The Gravity Form array
241
- * @param array $entry The Gravity Form entry information
242
- *
243
- * @return array The confirmation text
244
- *
245
- * @since 4.0
246
- */
247
- public function gravitypdf_notification( $notification, $form, $entry ) {
248
-
249
- /* check if notification has a 'message' */
250
- if ( isset( $notification['message'] ) ) {
251
- $notification['message'] = $this->add_entry_id_to_shortcode( $notification['message'], $entry['id'] );
252
- }
253
-
254
- return $notification;
255
- }
256
-
257
- /**
258
- * Add basic GravityView support and parse the Custom Content field for the [gravitypdf] shortcode
259
- * This means users can copy and paste our sample shortcode without having to worry about an entry ID being passed.
260
- *
261
- * @param string $html
262
- *
263
- * @return string
264
- *
265
- * @since 4.0
266
- */
267
- public function gravitypdf_gravityview_custom( $html ) {
268
- $gravityview_view = GravityView_View::getInstance();
269
- $entry = $gravityview_view->getCurrentEntry();
270
- return $this->add_entry_id_to_shortcode( $html, $entry['id'] );
271
- }
272
-
273
- /**
274
- * Check for the [gravitypdf] shortcode and add the entry ID to it
275
- *
276
- * @param $string The text to search
277
- * @param $entry_id The entry ID to add to our shortcode
278
- *
279
- * @return string
280
- *
281
- * @since 4.0
282
- */
283
- private function add_entry_id_to_shortcode( $string, $entry_id ) {
284
- /* Check if our shortcode exists and add the entry ID if needed */
285
- $gravitypdf = $this->get_shortcode_information( 'gravitypdf', $string );
286
-
287
- if ( sizeof( $gravitypdf ) > 0 ) {
288
- foreach ( $gravitypdf as $shortcode ) {
289
- /* if the user hasn't explicitely defined an entry to display... */
290
- if ( ! isset( $shortcode['attr']['entry'] ) ) {
291
- /* get the new shortcode information */
292
- $new_shortcode = $this->add_shortcode_attr( $shortcode, 'entry', $entry_id );
293
-
294
- /* update our confirmation message */
295
- $string = str_replace( $shortcode['shortcode'], $new_shortcode['shortcode'], $string );
296
- }
297
- }
298
- }
299
-
300
- return $string;
301
- }
302
-
303
- /**
304
- * Update a shortcode attributes
305
- *
306
- * @param array $code In individual shortcode array pulled in from the $this->get_shortcode_information() function
307
- * @param string $attr The attribute to add / replace
308
- * @param string $value The new attribute value
309
- *
310
- * @return array
311
- *
312
- * @since 4.0
313
- */
314
- public function add_shortcode_attr( $code, $attr, $value ) {
315
- /* if the attribute doesn't already exist... */
316
- if ( ! isset( $code['attr'][ $attr ] ) ) {
317
-
318
- $raw_attr = "{$code['attr_raw']} {$attr}=\"{$value}\"";
319
-
320
- /* if there are no attributes at all we'll need to fix our str replace */
321
- if ( 0 === strlen( $code['attr_raw'] ) ) {
322
- $pattern = '^\[([a-zA-Z]+)';
323
- $code['shortcode'] = preg_replace( "/$pattern/s", "[$1 {$attr}=\"{$value}\"", $code['shortcode'] );
324
- } else {
325
- $code['shortcode'] = str_ireplace( $code['attr_raw'], $raw_attr, $code['shortcode'] );
326
- }
327
-
328
- $code['attr_raw'] = $raw_attr;
329
-
330
- } else { /* replace the current attribute */
331
- $pattern = $attr . '="(.+?)"';
332
- $code['shortcode'] = preg_replace( "/$pattern/si", $attr . '="' . $value . '"', $code['shortcode'] );
333
- $code['attr_raw'] = preg_replace( "/$pattern/si", $attr . '="' . $value . '"', $code['attr_raw'] );
334
- }
335
-
336
- /* Update the actual attribute */
337
- $code['attr'][ $attr ] = $value;
338
-
339
- return $code;
340
- }
341
-
342
- /**
343
- * Check if user is currently submitting a new confirmation redirect URL in the admin area,
344
- * if so replace any shortcodes with a direct link to the PDF (as Gravity Forms correctly validates the URL)
345
- *
346
- * @param array $form Gravity Form Array
347
- *
348
- * @return array
349
- *
350
- * @since 4.0
351
- */
352
- public function gravitypdf_redirect_confirmation( $form ) {
353
-
354
- /* check if the confirmation is currently being saved */
355
- if ( isset( $_POST['form_confirmation_url'] ) ) {
356
-
357
- $this->log->addNotice( 'Process Redirect Confirmation Save', array(
358
- 'form_id' => $form['id'],
359
- 'post' => $_POST,
360
- ) );
361
-
362
- $url = stripslashes_deep( $_POST['form_confirmation_url'] );
363
-
364
- /* check if our shortcode exists and convert it to a URL */
365
- $gravitypdf = $this->get_shortcode_information( 'gravitypdf', $url );
366
-
367
- if ( sizeof( $gravitypdf ) > 0 ) {
368
-
369
- foreach ( $gravitypdf as $code ) {
370
-
371
- /* get the PDF Settings ID */
372
- $pid = ( isset( $code['attr']['id'] ) ) ? $code['attr']['id'] : '';
373
-
374
- if ( ! empty( $pid ) ) {
375
-
376
- /* generate the PDF URL */
377
- $pdf = new Model_PDF( $this->gform, $this->log, $this->options, GPDFAPI::get_data_class(), GPDFAPI::get_misc_class(), GPDFAPI::get_notice_class() );
378
- $download = ( ! isset( $code['attr']['type'] ) || $code['attr']['type'] == 'download' ) ? true : false;
379
- $pdf_url = $pdf->get_pdf_url( $pid, '{entry_id}', $download, false, false );
380
-
381
- /* override the confirmation URL submitted */
382
- $_POST['form_confirmation_url'] = str_replace( $code['shortcode'], $pdf_url, $url );
383
- }
384
- }
385
- }
386
- }
387
-
388
- /* it's a filter so return the $form array */
389
-
390
- return $form;
391
- }
392
-
393
- /**
394
- * Search for any shortcodes in the text and return any matches
395
- *
396
- * @param string $shortcode The shortcode to search for
397
- * @param string $text The text to search in
398
- *
399
- * @return array The shortcode information
400
- *
401
- * @since 4.0
402
- */
403
- public function get_shortcode_information( $shortcode, $text ) {
404
- $shortcodes = array();
405
-
406
- if ( has_shortcode( $text, $shortcode ) ) {
407
-
408
- /* our shortcode exists so parse the shortcode data and return an easy-to-use array */
409
- $pattern = get_shortcode_regex();
410
- preg_match_all( "/$pattern/s", $text, $matches );
411
-
412
- if ( ! empty( $matches ) && isset( $matches[2] ) ) {
413
- foreach ( $matches[2] as $key => $code ) {
414
- if ( $code == $shortcode ) {
415
- $shortcodes[] = array(
416
- 'shortcode' => $matches[0][ $key ],
417
- 'attr_raw' => $matches[3][ $key ],
418
- 'attr' => shortcode_parse_atts( $matches[3][ $key ] ),
419
- );
420
- }
421
- }
422
- }
423
- }
424
-
425
- return $shortcodes;
426
- }
427
- }
1
+ <?php
2
+
3
+ namespace GFPDF\Model;
4
+
5
+ use GFPDF\Helper\Helper_Abstract_Model;
6
+ use GFPDF\Helper\Helper_Abstract_Form;
7
+ use GFPDF\Helper\Helper_Abstract_Options;
8
+ use GFPDF\Helper\Helper_Misc;
9
+
10
+ use Psr\Log\LoggerInterface;
11
+
12
+ use GPDFAPI;
13
+ use GFCommon;
14
+ use GravityView_View;
15
+
16
+ /**
17
+ * PDF Shortcode Model
18
+ *
19
+ * @package Gravity PDF
20
+ * @copyright Copyright (c) 2016, Blue Liquid Designs
21
+ * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
22
+ * @since 4.0
23
+ */
24
+
25
+ /* Exit if accessed directly */
26
+ if ( ! defined( 'ABSPATH' ) ) {
27
+ exit;
28
+ }
29
+
30
+ /*
31
+ This file is part of Gravity PDF.
32
+
33
+ Gravity PDF – Copyright (C) 2016, Blue Liquid Designs
34
+
35
+ This program is free software; you can redistribute it and/or modify
36
+ it under the terms of the GNU General Public License as published by
37
+ the Free Software Foundation; either version 2 of the License, or
38
+ (at your option) any later version.
39
+
40
+ This program is distributed in the hope that it will be useful,
41
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
42
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
43
+ GNU General Public License for more details.
44
+
45
+ You should have received a copy of the GNU General Public License
46
+ along with this program; if not, write to the Free Software
47
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
48
+ */
49
+
50
+ /**
51
+ *
52
+ * Handles all the PDF Shortcode logic
53
+ *
54
+ * @since 4.0
55
+ */
56
+ class Model_Shortcodes extends Helper_Abstract_Model {
57
+
58
+ /**
59
+ * Holds the abstracted Gravity Forms API specific to Gravity PDF
60
+ *
61
+ * @var \GFPDF\Helper\Helper_Form
62
+ *
63
+ * @since 4.0
64
+ */
65
+ protected $gform;
66
+
67
+ /**
68
+ * Holds our log class
69
+ *
70
+ * @var \Monolog\Logger|LoggerInterface
71
+ *
72
+ * @since 4.0
73
+ */
74
+ protected $log;
75
+
76
+ /**
77
+ * Holds our Helper_Abstract_Options / Helper_Options_Fields object
78
+ * Makes it easy to access global PDF settings and individual form PDF settings
79
+ *
80
+ * @var \GFPDF\Helper\Helper_Options_Fields
81
+ *
82
+ * @since 4.0
83
+ */
84
+ protected $options;
85
+
86
+ /**
87
+ * Holds our Helper_Misc object
88
+ * Makes it easy to access common methods throughout the plugin
89
+ *
90
+ * @var \GFPDF\Helper\Helper_Misc
91
+ *
92
+ * @since 4.0
93
+ */
94
+ protected $misc;
95
+
96
+ /**
97
+ * Setup our class by injecting all our dependancies
98
+ *
99
+ * @param \GFPDF\Helper\Helper_Abstract_Form|\GFPDF\Helper\Helper_Form $gform Our abstracted Gravity Forms helper functions
100
+ * @param \Monolog\Logger|LoggerInterface $log Our logger class
101
+ * @param \GFPDF\Helper\Helper_Abstract_Options|\GFPDF\Helper\Helper_Options_Fields $options Our options class which allows us to access any settings
102
+ *
103
+ * @since 4.0
104
+ */
105
+ public function __construct( Helper_Abstract_Form $gform, LoggerInterface $log, Helper_Abstract_Options $options, Helper_Misc $misc ) {
106
+
107
+ /* Assign our internal variables */
108
+ $this->gform = $gform;
109
+ $this->log = $log;
110
+ $this->options = $options;
111
+ $this->misc = $misc;
112
+ }
113
+
114
+ /**
115
+ * Generates a direct link to the PDF that should be generated
116
+ * If placed in a confirmation the appropriate entry will be displayed.
117
+ * A user also has the option to pass in an "entry" parameter to define the entry ID
118
+ *
119
+ * @param array $attributes The shortcode attributes specified
120
+ *
121
+ * @return string
122
+ *
123
+ * @since 4.0
124
+ */
125
+ public function gravitypdf( $attributes ) {
126
+
127
+ $this->log->addNotice( 'Generating Shortcode' );
128
+
129
+ $controller = $this->getController();
130
+ $has_view_permissions = $this->gform->has_capability( 'gravityforms_view_entries' );
131
+
132
+ /* merge in any missing defaults */
133
+ $attributes = shortcode_atts( array(
134
+ 'id' => '',
135
+ 'text' => 'Download PDF',
136
+ 'type' => 'download',
137
+ 'class' => 'gravitypdf-download-link',
138
+ 'classes' => '',
139
+ 'entry' => '',
140
+ 'print' => '',
141
+ ), $attributes, 'gravitypdf' );
142
+
143
+ /* See https://gravitypdf.com/documentation/v4/gfpdf_gravityforms_shortcode_attributes/ for more information about this filter */
144
+ $attributes = apply_filters( 'gfpdf_gravityforms_shortcode_attributes', $attributes );
145
+
146
+ /* Add Shortcake preview support */
147
+ if ( defined( 'SHORTCODE_UI_DOING_PREVIEW' ) && SHORTCODE_UI_DOING_PREVIEW === true ) {
148
+ $attributes['url'] = '#';
149
+
150
+ return $controller->view->display_gravitypdf_shortcode( $attributes );
151
+ }
152
+
153
+ /* Check if we have an entry ID, otherwise check the GET and POST data */
154
+ if ( empty( $attributes['entry'] ) ) {
155
+ if ( isset( $_GET['lid'] ) || isset( $_GET['entry'] ) ) {
156
+ $attributes['entry'] = ( isset( $_GET['lid'] ) ) ? (int) $_GET['lid'] : (int) $_GET['entry'];
157
+ } else {
158
+
159
+ /* Only display error to users with appropriate permissions */
160
+ if ( $has_view_permissions ) {
161
+ return $controller->view->no_entry_id();
162
+ }
163
+
164
+ return '';
165
+ }
166
+ }
167
+
168
+ /* Check if we have a valid PDF configuration */
169
+ $entry = $this->gform->get_entry( $attributes['entry'] );
170
+ $config = ( ! is_wp_error( $entry ) ) ? $this->options->get_pdf( $entry['form_id'], $attributes['id'] ) : $entry; /* if invalid entry a WP_Error will be thrown */
171
+
172
+ if ( is_wp_error( $config ) ) {
173
+
174
+ /* Only display error to users with appropriate permissions */
175
+ if ( $has_view_permissions ) {
176
+ return $controller->view->invalid_pdf_config();
177
+ }
178
+
179
+ return '';
180
+ }
181
+
182
+ /* Check if the PDF is enabled AND the conditional logic (if any) has been met */
183
+ if ( $config['active'] !== true ) {
184
+ /* Only display error to users with appropriate permissions */
185
+ if ( $has_view_permissions ) {
186
+ return $controller->view->pdf_not_active();
187
+ }
188
+
189
+ return '';
190
+ }
191
+
192
+ if ( isset( $config['conditionalLogic'] ) && ! $this->misc->evaluate_conditional_logic( $config['conditionalLogic'], $entry ) ) {
193
+ /* Only display error to users with appropriate permissions */
194
+ if ( $has_view_permissions ) {
195
+ return $controller->view->conditional_logic_not_met();
196
+ }
197
+
198
+ return '';
199
+ }
200
+
201
+ /* Everything looks valid so let's get the URL */
202
+ $pdf = new Model_PDF( $this->gform, $this->log, $this->options, GPDFAPI::get_data_class(), GPDFAPI::get_misc_class(), GPDFAPI::get_notice_class() );
203
+ $download = ( $attributes['type'] == 'download' ) ? true : false;
204
+ $print = ( ! empty( $attributes['print'] ) ) ? true : false;
205
+ $attributes['url'] = $pdf->get_pdf_url( $attributes['id'], $attributes['entry'], $download, $print );
206
+
207
+ /* generate the markup and return */
208
+ $this->log->addNotice( 'Generating Shortcode Markup', array(
209
+ 'attr' => $attributes,
210
+ ) );
211
+
212
+ return $controller->view->display_gravitypdf_shortcode( $attributes );
213
+ }
214
+
215
+ /**
216
+ * Update our Gravity Forms "Text" Confirmation Shortcode to include the current entry ID
217
+ *
218
+ * @param string $confirmation The confirmation text
219
+ * @param array $form The Gravity Form array
220
+ * @param array $entry The Gravity Form entry information
221
+ *
222
+ * @return array The confirmation text
223
+ *
224
+ * @since 4.0
225
+ */
226
+ public function gravitypdf_confirmation( $confirmation, $form, $entry ) {
227
+
228
+ /* check if confirmation is text-based */
229
+ if ( ! is_array( $confirmation ) ) {
230
+ $confirmation = $this->add_entry_id_to_shortcode( $confirmation, $entry['id'] );
231
+ }
232
+
233
+ return $confirmation;
234
+ }
235
+
236
+ /**
237
+ * Update our Gravity Forms Notification Shortcode to include the current entry ID
238
+ *
239
+ * @param string $notification The confirmation text
240
+ * @param array $form The Gravity Form array
241
+ * @param array $entry The Gravity Form entry information
242
+ *
243
+ * @return array The confirmation text
244
+ *
245
+ * @since 4.0
246
+ */
247
+ public function gravitypdf_notification( $notification, $form, $entry ) {
248
+
249
+ /* check if notification has a 'message' */
250
+ if ( isset( $notification['message'] ) ) {
251
+ $notification['message'] = $this->add_entry_id_to_shortcode( $notification['message'], $entry['id'] );
252
+ }
253
+
254
+ return $notification;
255
+ }
256
+
257
+ /**
258
+ * Add basic GravityView support and parse the Custom Content field for the [gravitypdf] shortcode
259
+ * This means users can copy and paste our sample shortcode without having to worry about an entry ID being passed.
260
+ *
261
+ * @param string $html
262
+ *
263
+ * @return string
264
+ *
265
+ * @since 4.0
266
+ */
267
+ public function gravitypdf_gravityview_custom( $html ) {
268
+ $gravityview_view = GravityView_View::getInstance();
269
+ $entry = $gravityview_view->getCurrentEntry();
270
+ return $this->add_entry_id_to_shortcode( $html, $entry['id'] );
271
+ }
272
+
273
+ /**
274
+ * Check for the [gravitypdf] shortcode and add the entry ID to it
275
+ *
276
+ * @param $string The text to search
277
+ * @param $entry_id The entry ID to add to our shortcode
278
+ *
279
+ * @return string
280
+ *
281
+ * @since 4.0
282
+ */
283
+ private function add_entry_id_to_shortcode( $string, $entry_id ) {
284
+ /* Check if our shortcode exists and add the entry ID if needed */
285
+ $gravitypdf = $this->get_shortcode_information( 'gravitypdf', $string );
286
+
287
+ if ( sizeof( $gravitypdf ) > 0 ) {
288
+ foreach ( $gravitypdf as $shortcode ) {
289
+ /* if the user hasn't explicitely defined an entry to display... */
290
+ if ( ! isset( $shortcode['attr']['entry'] ) ) {
291
+ /* get the new shortcode information */
292
+ $new_shortcode = $this->add_shortcode_attr( $shortcode, 'entry', $entry_id );
293
+
294
+ /* update our confirmation message */
295
+ $string = str_replace( $shortcode['shortcode'], $new_shortcode['shortcode'], $string );
296
+ }
297
+ }
298
+ }
299
+
300
+ return $string;
301
+ }
302
+
303
+ /**
304
+ * Update a shortcode attributes
305
+ *
306
+ * @param array $code In individual shortcode array pulled in from the $this->get_shortcode_information() function
307
+ * @param string $attr The attribute to add / replace
308
+ * @param string $value The new attribute value
309
+ *
310
+ * @return array
311
+ *
312
+ * @since 4.0
313
+ */
314
+ public function add_shortcode_attr( $code, $attr, $value ) {
315
+ /* if the attribute doesn't already exist... */
316
+ if ( ! isset( $code['attr'][ $attr ] ) ) {
317
+
318
+ $raw_attr = "{$code['attr_raw']} {$attr}=\"{$value}\"";
319
+
320
+ /* if there are no attributes at all we'll need to fix our str replace */
321
+ if ( 0 === strlen( $code['attr_raw'] ) ) {
322
+ $pattern = '^\[([a-zA-Z]+)';
323
+ $code['shortcode'] = preg_replace( "/$pattern/s", "[$1 {$attr}=\"{$value}\"", $code['shortcode'] );
324
+ } else {
325
+ $code['shortcode'] = str_ireplace( $code['attr_raw'], $raw_attr, $code['shortcode'] );
326
+ }
327
+
328
+ $code['attr_raw'] = $raw_attr;
329
+
330
+ } else { /* replace the current attribute */
331
+ $pattern = $attr . '="(.+?)"';
332
+ $code['shortcode'] = preg_replace( "/$pattern/si", $attr . '="' . $value . '"', $code['shortcode'] );
333
+ $code['attr_raw'] = preg_replace( "/$pattern/si", $attr . '="' . $value . '"', $code['attr_raw'] );
334
+ }
335
+
336
+ /* Update the actual attribute */
337
+ $code['attr'][ $attr ] = $value;
338
+
339
+ return $code;
340
+ }
341
+
342
+ /**
343
+ * Check if user is currently submitting a new confirmation redirect URL in the admin area,
344
+ * if so replace any shortcodes with a direct link to the PDF (as Gravity Forms correctly validates the URL)
345
+ *
346
+ * @param array $form Gravity Form Array
347
+ *
348
+ * @return array
349
+ *
350
+ * @since 4.0
351
+ */
352
+ public function gravitypdf_redirect_confirmation( $form ) {
353
+
354
+ /* check if the confirmation is currently being saved */
355
+ if ( isset( $_POST['form_confirmation_url'] ) ) {
356
+
357
+ $this->log->addNotice( 'Process Redirect Confirmation Save', array(
358
+ 'form_id' => $form['id'],
359
+ 'post' => $_POST,
360
+ ) );
361
+
362
+ $url = stripslashes_deep( $_POST['form_confirmation_url'] );
363
+
364
+ /* check if our shortcode exists and convert it to a URL */
365
+ $gravitypdf = $this->get_shortcode_information( 'gravitypdf', $url );
366
+
367
+ if ( sizeof( $gravitypdf ) > 0 ) {
368
+
369
+ foreach ( $gravitypdf as $code ) {
370
+
371
+ /* get the PDF Settings ID */
372
+ $pid = ( isset( $code['attr']['id'] ) ) ? $code['attr']['id'] : '';
373
+
374
+ if ( ! empty( $pid ) ) {
375
+
376
+ /* generate the PDF URL */
377
+ $pdf = new Model_PDF( $this->gform, $this->log, $this->options, GPDFAPI::get_data_class(), GPDFAPI::get_misc_class(), GPDFAPI::get_notice_class() );
378
+ $download = ( ! isset( $code['attr']['type'] ) || $code['attr']['type'] == 'download' ) ? true : false;
379
+ $pdf_url = $pdf->get_pdf_url( $pid, '{entry_id}', $download, false, false );
380
+
381
+ /* override the confirmation URL submitted */
382
+ $_POST['form_confirmation_url'] = str_replace( $code['shortcode'], $pdf_url, $url );
383
+ }
384
+ }
385
+ }
386
+ }
387
+
388
+ /* it's a filter so return the $form array */
389
+
390
+ return $form;
391
+ }
392
+
393
+ /**
394
+ * Search for any shortcodes in the text and return any matches
395
+ *
396
+ * @param string $shortcode The shortcode to search for
397
+ * @param string $text The text to search in
398
+ *
399
+ * @return array The shortcode information
400
+ *
401
+ * @since 4.0
402
+ */
403
+ public function get_shortcode_information( $shortcode, $text ) {
404
+ $shortcodes = array();
405
+
406
+ if ( has_shortcode( $text, $shortcode ) ) {
407
+
408
+ /* our shortcode exists so parse the shortcode data and return an easy-to-use array */
409
+ $pattern = get_shortcode_regex();
410
+ preg_match_all( "/$pattern/s", $text, $matches );
411
+
412
+ if ( ! empty( $matches ) && isset( $matches[2] ) ) {
413
+ foreach ( $matches[2] as $key => $code ) {
414
+ if ( $code == $shortcode ) {
415
+ $shortcodes[] = array(
416
+ 'shortcode' => $matches[0][ $key ],
417
+ 'attr_raw' => $matches[3][ $key ],
418
+ 'attr' => shortcode_parse_atts( $matches[3][ $key ] ),
419
+ );
420
+ }
421
+ }
422
+ }
423
+ }
424
+
425
+ return $shortcodes;
426
+ }
427
+ }
src/view/View_PDF.php CHANGED
@@ -308,7 +308,6 @@ class View_PDF extends Helper_Abstract_View {
308
  /* Set up required variables */
309
  $form = $this->gform->get_form( $entry['form_id'] );
310
  $products = new Field_Products( new GF_Field(), $entry, $this->gform, $this->misc );
311
- $has_products = false;
312
  $page_number = 0;
313
  $container = ( isset( $config['meta']['enable_css_ready_classes'] ) && false === $config['meta']['enable_css_ready_classes'] ) ? new Helper_Field_Container_Void() : new Helper_Field_Container();
314
 
@@ -362,8 +361,6 @@ class View_PDF extends Helper_Abstract_View {
362
 
363
  /* Skip over any product fields, if needed */
364
  if ( $show_individual_product_fields === false && GFCommon::is_product_field( $field->type ) ) {
365
- $has_products = true;
366
-
367
  /* To prevent display issues we will output the column markup needed */
368
  $container->maybe_display_faux_column( $field );
369
  continue;
@@ -393,7 +390,7 @@ class View_PDF extends Helper_Abstract_View {
393
  $container->close();
394
 
395
  /* Output product table, if needed */
396
- if ( $has_products && ! $products->is_empty() ) {
397
  echo $products->html();
398
  }
399
 
308
  /* Set up required variables */
309
  $form = $this->gform->get_form( $entry['form_id'] );
310
  $products = new Field_Products( new GF_Field(), $entry, $this->gform, $this->misc );
 
311
  $page_number = 0;
312
  $container = ( isset( $config['meta']['enable_css_ready_classes'] ) && false === $config['meta']['enable_css_ready_classes'] ) ? new Helper_Field_Container_Void() : new Helper_Field_Container();
313
 
361
 
362
  /* Skip over any product fields, if needed */
363
  if ( $show_individual_product_fields === false && GFCommon::is_product_field( $field->type ) ) {
 
 
364
  /* To prevent display issues we will output the column markup needed */
365
  $container->maybe_display_faux_column( $field );
366
  continue;
390
  $container->close();
391
 
392
  /* Output product table, if needed */
393
+ if ( ! $products->is_empty() ) {
394
  echo $products->html();
395
  }
396
 
src/view/html/Welcome/welcome.php CHANGED
@@ -1,130 +1,130 @@
1
- <?php
2
-
3
- /**
4
- * Getting Started - Welcome Screen View
5
- *
6
- * @package Gravity PDF
7
- * @copyright Copyright (c) 2016, Blue Liquid Designs
8
- * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
9
- * @since 4.0
10
- */
11
-
12
- /* Exit if accessed directly */
13
- if ( ! defined( 'ABSPATH' ) ) {
14
- exit;
15
- }
16
-
17
- /*
18
- This file is part of Gravity PDF.
19
-
20
- Gravity PDF – Copyright (C) 2016, Blue Liquid Designs
21
-
22
- This program is free software; you can redistribute it and/or modify
23
- it under the terms of the GNU General Public License as published by
24
- the Free Software Foundation; either version 2 of the License, or
25
- (at your option) any later version.
26
-
27
- This program is distributed in the hope that it will be useful,
28
- but WITHOUT ANY WARRANTY; without even the implied warranty of
29
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30
- GNU General Public License for more details.
31
-
32
- You should have received a copy of the GNU General Public License
33
- along with this program; if not, write to the Free Software
34
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
35
- */
36
-
37
- ?>
38
-
39
- <div class="wrap about-wrap gfpdf-welcome-screen">
40
- <h1><?php _e( 'Welcome to Gravity PDF', 'gravity-forms-pdf-extended' ); ?></h1>
41
-
42
- <div class="about-text">
43
- <?php _e( "You're just minutes away from producing your first highly-customisable PDF document using Gravity Forms data.", 'gravity-forms-pdf-extended' ); ?>
44
- </div>
45
-
46
- <div class="gfpdf-badge"><?php printf( __( 'Version %s', 'gravity-forms-pdf-extended' ), $args['display_version'] ); ?></div>
47
-
48
- <?php $this->tabs(); ?>
49
-
50
- <div class="feature-section two-col">
51
-
52
- <div class="col">
53
- <h3><?php _e( 'Where to Start?', 'gravity-forms-pdf-extended' ); ?></h3>
54
-
55
- <p>
56
- <?php printf( __( "Your first step is to review %sGravity PDF's General Settings%s which can be found by navigating to %sForms -> Settings -> PDF%s in your WordPress admin area. From here you'll be able to set defaults for paper size, font face, font colour, and select a PDF template – %swe ship with four completely-free layouts%s – which will be used for all new PDFs. There's even an easy-to-use interface for installing custom fonts.", 'gravity-forms-pdf-extended' ), '<a href="' . esc_url( $gfpdf->data->settings_url ) . '">', '</a>', '<code>', '</code>', '<strong>', '</strong>' ); ?>
57
- </p>
58
-
59
- <a href="<?php echo esc_url( $gfpdf->data->settings_url ); ?>" class="button"><?php _e( 'Configure Settings', 'gravity-forms-pdf-extended' ); ?></a>
60
- </div>
61
-
62
- <div class="col">
63
- <img class="gfpdf-image" src="<?php echo esc_url( PDF_PLUGIN_URL . 'src/assets/images/welcome-pdf-settings-page.png' ); ?>">
64
- </div>
65
-
66
- </div>
67
-
68
- <div class="feature-section two-col">
69
-
70
- <div class="col">
71
- <img class="gfpdf-image" src="<?php echo esc_url( PDF_PLUGIN_URL . 'src/assets/images/welcome-individual-pdf-settings.png' ); ?>">
72
- </div>
73
-
74
- <div class="col">
75
- <h3><?php _e( 'Setting up a PDF', 'gravity-forms-pdf-extended' ); ?></h3>
76
-
77
- <p>
78
- <?php printf( __( 'You can setup individual PDF documents from the %sGravity Form "Forms" page%s in your admin area – located at %sForms -> Forms%s in your navigation. A new %sPDF%s option will be avaliable in each forms\' settings section. The only required fields are %sName%s – an internal identifier – and %sFilename%s – the name used when saving and emailing the PDF.', 'gravity-forms-pdf-extended' ), '<a href="' . esc_url( admin_url( 'admin.php?page=gf_edit_forms' ) ) . '">', '</a>', '<code>', '</code>', '<code>', '</code>', '<em>', '</em>', '<em>', '</em>' ); ?>
79
- </p>
80
-
81
- <!-- Output a quick Gravity Forms selector so we can let users get redirected to a PDF form of their choice -->
82
- <?php if ( sizeof( $args['forms'] ) > 0 ): ?>
83
- <form action="<?php echo admin_url( 'admin.php' ); ?>">
84
- <input type="hidden" name="page" value="gf_edit_forms"/>
85
- <input type="hidden" name="view" value="settings"/>
86
- <input type="hidden" name="subview" value="pdf"/>
87
- <input type="hidden" name="pid" value="0"/>
88
-
89
- <p>
90
- <strong><?php _e( 'Select which Form you want to setup first:', 'gravity-forms-pdf-extended' ); ?></strong><br>
91
- <select name="id" class="">
92
- <?php foreach ( $args['forms'] as $form ): ?>
93
- <option value="<?php echo $form['id']; ?>"><?php echo $form['title']; ?></option>
94
- <?php endforeach; ?>
95
- </select>
96
-
97
- <button class="button" style="vertical-align: middle"><?php _e( 'Create a PDF', 'gravity-forms-pdf-extended' ); ?></button>
98
- </p>
99
- </form>
100
- <?php endif; ?>
101
- </div>
102
- </div>
103
-
104
- <div id="gfpdf-mascot-container" class="changelog feature-section three-col">
105
- <div class="col">
106
- <img class="gfpdf-image" src="<?php echo esc_url( PDF_PLUGIN_URL . 'src/assets/images/welcome-download-shortcode.png' ); ?>">
107
-
108
- <h3><?php _e( 'Simple PDF Download Links', 'gravity-forms-pdf-extended' ); ?></h3>
109
-
110
- <p><?php printf( __( 'The %s[gravitypdf]%s shortcode allows you to %seasily place a PDF download link%s on any of the Gravity Forms Confirmation types.', 'gravity-forms-pdf-extended' ), '<code>', '</code>', '<a href="https://gravitypdf.com/documentation/v4/user-shortcodes/">', '</a>' ); ?></p>
111
- </div>
112
- <div class="col">
113
- <img class="gfpdf-image" src="<?php echo esc_url( PDF_PLUGIN_URL . 'src/assets/images/welcome-notification-conditional.png' ); ?>">
114
-
115
- <h3><?php _e( 'Automated PDF Emails', 'gravity-forms-pdf-extended' ); ?></h3>
116
-
117
- <p><?php _e( 'Select a Gravity Form Notification and your PDF will automatically be sent as an attachment. Powerful conditional logic can also be used to determine if a PDF will be included.', 'gravity-forms-pdf-extended' ); ?></p>
118
- </div>
119
- <div class="col last-feature">
120
- <img class="gfpdf-image" src="<?php echo esc_url( PDF_PLUGIN_URL . 'src/assets/images/welcome-manage-fonts.png' ); ?>">
121
-
122
- <h3><?php _e( 'Custom Fonts', 'gravity-forms-pdf-extended' ); ?></h3>
123
-
124
- <p><?php printf( __( 'Make your documents stand out by including your favourite fonts with our %ssimple font manager%s.', 'gravity-forms-pdf-extended' ), '<a href="https://gravitypdf.com/documentation/v4/user-custom-fonts/">', '</a>' ); ?></p>
125
- </div>
126
- </div>
127
-
128
- <?php $this->more(); ?>
129
-
130
- </div>
1
+ <?php
2
+
3
+ /**
4
+ * Getting Started - Welcome Screen View
5
+ *
6
+ * @package Gravity PDF
7
+ * @copyright Copyright (c) 2016, Blue Liquid Designs
8
+ * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
9
+ * @since 4.0
10
+ */
11
+
12
+ /* Exit if accessed directly */
13
+ if ( ! defined( 'ABSPATH' ) ) {
14
+ exit;
15
+ }
16
+
17
+ /*
18
+ This file is part of Gravity PDF.
19
+
20
+ Gravity PDF – Copyright (C) 2016, Blue Liquid Designs
21
+
22
+ This program is free software; you can redistribute it and/or modify
23
+ it under the terms of the GNU General Public License as published by
24
+ the Free Software Foundation; either version 2 of the License, or
25
+ (at your option) any later version.
26
+
27
+ This program is distributed in the hope that it will be useful,
28
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
29
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30
+ GNU General Public License for more details.
31
+
32
+ You should have received a copy of the GNU General Public License
33
+ along with this program; if not, write to the Free Software
34
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
35
+ */
36
+
37
+ ?>
38
+
39
+ <div class="wrap about-wrap gfpdf-welcome-screen">
40
+ <h1><?php _e( 'Welcome to Gravity PDF', 'gravity-forms-pdf-extended' ); ?></h1>
41
+
42
+ <div class="about-text">
43
+ <?php _e( "You're just minutes away from producing your first highly-customisable PDF document using Gravity Forms data.", 'gravity-forms-pdf-extended' ); ?>
44
+ </div>
45
+
46
+ <div class="gfpdf-badge"><?php printf( __( 'Version %s', 'gravity-forms-pdf-extended' ), $args['display_version'] ); ?></div>
47
+
48
+ <?php $this->tabs(); ?>
49
+
50
+ <div class="feature-section two-col">
51
+
52
+ <div class="col">
53
+ <h3><?php _e( 'Where to Start?', 'gravity-forms-pdf-extended' ); ?></h3>
54
+
55
+ <p>
56
+ <?php printf( __( "Your first step is to review %sGravity PDF's General Settings%s which can be found by navigating to %sForms -> Settings -> PDF%s in your WordPress admin area. From here you'll be able to set defaults for paper size, font face, font colour, and select a PDF template – %swe ship with four completely-free layouts%s – which will be used for all new PDFs. There's even an easy-to-use interface for installing custom fonts.", 'gravity-forms-pdf-extended' ), '<a href="' . esc_url( $gfpdf->data->settings_url ) . '">', '</a>', '<code>', '</code>', '<strong>', '</strong>' ); ?>
57
+ </p>
58
+
59
+ <a href="<?php echo esc_url( $gfpdf->data->settings_url ); ?>" class="button"><?php _e( 'Configure Settings', 'gravity-forms-pdf-extended' ); ?></a>
60
+ </div>
61
+
62
+ <div class="col">
63
+ <img class="gfpdf-image" src="<?php echo esc_url( PDF_PLUGIN_URL . 'src/assets/images/welcome-pdf-settings-page.png' ); ?>">
64
+ </div>
65
+
66
+ </div>
67
+
68
+ <div class="feature-section two-col">
69
+
70
+ <div class="col">
71
+ <img class="gfpdf-image" src="<?php echo esc_url( PDF_PLUGIN_URL . 'src/assets/images/welcome-individual-pdf-settings.png' ); ?>">
72
+ </div>
73
+
74
+ <div class="col">
75
+ <h3><?php _e( 'Setting up a PDF', 'gravity-forms-pdf-extended' ); ?></h3>
76
+
77
+ <p>
78
+ <?php printf( __( 'You can setup individual PDF documents from the %sGravity Form "Forms" page%s in your admin area – located at %sForms -> Forms%s in your navigation. A new %sPDF%s option will be avaliable in each forms\' settings section. The only required fields are %sName%s – an internal identifier – and %sFilename%s – the name used when saving and emailing the PDF.', 'gravity-forms-pdf-extended' ), '<a href="' . esc_url( admin_url( 'admin.php?page=gf_edit_forms' ) ) . '">', '</a>', '<code>', '</code>', '<code>', '</code>', '<em>', '</em>', '<em>', '</em>' ); ?>
79
+ </p>
80
+
81
+ <!-- Output a quick Gravity Forms selector so we can let users get redirected to a PDF form of their choice -->
82
+ <?php if ( sizeof( $args['forms'] ) > 0 ): ?>
83
+ <form action="<?php echo admin_url( 'admin.php' ); ?>">
84
+ <input type="hidden" name="page" value="gf_edit_forms"/>
85
+ <input type="hidden" name="view" value="settings"/>
86
+ <input type="hidden" name="subview" value="pdf"/>
87
+ <input type="hidden" name="pid" value="0"/>
88
+
89
+ <p>
90
+ <strong><?php _e( 'Select which Form you want to setup first:', 'gravity-forms-pdf-extended' ); ?></strong><br>
91
+ <select name="id" class="">
92
+ <?php foreach ( $args['forms'] as $form ): ?>
93
+ <option value="<?php echo $form['id']; ?>"><?php echo $form['title']; ?></option>
94
+ <?php endforeach; ?>
95
+ </select>
96
+
97
+ <button class="button" style="vertical-align: middle"><?php _e( 'Create a PDF', 'gravity-forms-pdf-extended' ); ?></button>
98
+ </p>
99
+ </form>
100
+ <?php endif; ?>
101
+ </div>
102
+ </div>
103
+
104
+ <div id="gfpdf-mascot-container" class="changelog feature-section three-col">
105
+ <div class="col">
106
+ <img class="gfpdf-image" src="<?php echo esc_url( PDF_PLUGIN_URL . 'src/assets/images/welcome-download-shortcode.png' ); ?>">
107
+
108
+ <h3><?php _e( 'Simple PDF Download Links', 'gravity-forms-pdf-extended' ); ?></h3>
109
+
110
+ <p><?php printf( __( 'The %s[gravitypdf]%s shortcode allows you to %seasily place a PDF download link%s on any of the Gravity Forms Confirmation types.', 'gravity-forms-pdf-extended' ), '<code>', '</code>', '<a href="https://gravitypdf.com/documentation/v4/user-shortcodes/">', '</a>' ); ?></p>
111
+ </div>
112
+ <div class="col">
113
+ <img class="gfpdf-image" src="<?php echo esc_url( PDF_PLUGIN_URL . 'src/assets/images/welcome-notification-conditional.png' ); ?>">
114
+
115
+ <h3><?php _e( 'Automated PDF Emails', 'gravity-forms-pdf-extended' ); ?></h3>
116
+
117
+ <p><?php _e( 'Select a Gravity Form Notification and your PDF will automatically be sent as an attachment. Powerful conditional logic can also be used to determine if a PDF will be included.', 'gravity-forms-pdf-extended' ); ?></p>
118
+ </div>
119
+ <div class="col last-feature">
120
+ <img class="gfpdf-image" src="<?php echo esc_url( PDF_PLUGIN_URL . 'src/assets/images/welcome-manage-fonts.png' ); ?>">
121
+
122
+ <h3><?php _e( 'Custom Fonts', 'gravity-forms-pdf-extended' ); ?></h3>
123
+
124
+ <p><?php printf( __( 'Make your documents stand out by including your favourite fonts with our %ssimple font manager%s.', 'gravity-forms-pdf-extended' ), '<a href="https://gravitypdf.com/documentation/v4/user-custom-fonts/">', '</a>' ); ?></p>
125
+ </div>
126
+ </div>
127
+
128
+ <?php $this->more(); ?>
129
+
130
+ </div>
vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer' . '/autoload_real.php';
6
 
7
- return ComposerAutoloaderInite4785973367908d7b3a3cd3f19f387ae::getLoader();
4
 
5
  require_once __DIR__ . '/composer' . '/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInita9c05113f26b52daf72983ec63a02df9::getLoader();
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInite4785973367908d7b3a3cd3f19f387ae
6
  {
7
  private static $loader;
8
 
@@ -19,9 +19,9 @@ class ComposerAutoloaderInite4785973367908d7b3a3cd3f19f387ae
19
  return self::$loader;
20
  }
21
 
22
- spl_autoload_register(array('ComposerAutoloaderInite4785973367908d7b3a3cd3f19f387ae', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderInite4785973367908d7b3a3cd3f19f387ae', 'loadClassLoader'));
25
 
26
  $map = require __DIR__ . '/autoload_namespaces.php';
27
  foreach ($map as $namespace => $path) {
@@ -42,14 +42,14 @@ class ComposerAutoloaderInite4785973367908d7b3a3cd3f19f387ae
42
 
43
  $includeFiles = require __DIR__ . '/autoload_files.php';
44
  foreach ($includeFiles as $fileIdentifier => $file) {
45
- composerRequiree4785973367908d7b3a3cd3f19f387ae($fileIdentifier, $file);
46
  }
47
 
48
  return $loader;
49
  }
50
  }
51
 
52
- function composerRequiree4785973367908d7b3a3cd3f19f387ae($fileIdentifier, $file)
53
  {
54
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
55
  require $file;
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInita9c05113f26b52daf72983ec63a02df9
6
  {
7
  private static $loader;
8
 
19
  return self::$loader;
20
  }
21
 
22
+ spl_autoload_register(array('ComposerAutoloaderInita9c05113f26b52daf72983ec63a02df9', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderInita9c05113f26b52daf72983ec63a02df9', 'loadClassLoader'));
25
 
26
  $map = require __DIR__ . '/autoload_namespaces.php';
27
  foreach ($map as $namespace => $path) {
42
 
43
  $includeFiles = require __DIR__ . '/autoload_files.php';
44
  foreach ($includeFiles as $fileIdentifier => $file) {
45
+ composerRequirea9c05113f26b52daf72983ec63a02df9($fileIdentifier, $file);
46
  }
47
 
48
  return $loader;
49
  }
50
  }
51
 
52
+ function composerRequirea9c05113f26b52daf72983ec63a02df9($fileIdentifier, $file)
53
  {
54
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
55
  require $file;