Print, PDF, Email by PrintFriendly - Version 3.2.5

Version Description

  • New! Image alignment option for Print and PDF pages.
  • New! Select to not show images by default in the Print and PDF.
  • Improved input validation.
  • Improved output escaping.
  • Removed printfriendly post_class.
  • Small i8n fix.
  • Few small HTML fixes.
Download this release

Release Info

Developer printfriendly
Plugin Icon 128x128 Print, PDF, Email by PrintFriendly
Version 3.2.5
Comparing to
See all releases

Code changes from version 3.2.1 to 3.2.5

Files changed (7) hide show
  1. admin.css +348 -312
  2. admin.js +93 -0
  3. languages/printfriendly.pot +117 -66
  4. pf.php +362 -89
  5. readme.txt +26 -3
  6. screenshot-2.png +0 -0
  7. uninstall.php +17 -2
admin.css CHANGED
@@ -1,319 +1,355 @@
1
- label{
2
- display: block;
3
- margin: 1.5em 0;
4
- }
5
-
6
- h3{
7
- margin: 3em 0 2em;
8
- border-bottom: 1px solid #ccc;
9
- padding-bottom:.75em;
10
- clear: both;
11
- }
12
-
13
- #buttongroup1, #buttongroup2, #buttongroup3, #custom-txt div, #button-placement div{
14
- display: block;
15
- margin-right: 3em;
16
- float: left;
17
- }
18
- #custom-txt div#txt-size, div#button-placement-options{
19
- margin-right: 0;
20
- }
21
- #custom-button-preview {
22
- clear:both;
23
- padding-top: 20px;
24
- margin-left: 2em;
25
- }
26
- #custom-button-preview img{
27
- margin-right: 6px;
28
- }
29
- #custom, #placement-adv-options{
30
- float: left;
31
- }
32
-
33
- #custom-txt, #custom-img {
34
- margin: 2em 0 2em 2em;
35
- clear: both;
36
- }
37
-
38
- .description{
39
- color: #cacaca;
40
- }
41
- .printfriendly-text2{
42
- font-family: verdana;
43
- font-size: 14px;
44
- color: #6D9F00;
45
- }
46
- select{
47
- display: block;
48
- margin: .5em .5em 2em 0;
49
- }
50
- select#javascript, select#website_protocol{
51
- display: inline-block;
52
- margin-bottom: 0;
53
- }
54
- input[type="radio"], input[type="checkbox"] {
55
- cursor: pointer;
56
- margin-right: 10px;
57
- vertical-align: middle;
58
- }
59
-
60
-
61
- /* WP lacks styling for type="number", so in here for now */
62
- input[type="number"] {
63
- border-color: #DFDFDF;
64
- background-color: white;
65
- border-width: 1px;
66
- border-style: solid;
67
- -moz-border-radius: 3px;
68
- -khtml-border-radius: 3px;
69
- -webkit-border-radius: 3px;
70
- border-radius: 3px;
71
- -moz-box-sizing: border-box;
72
- -webkit-box-sizing: border-box;
73
- -ms-box-sizing: border-box;
74
- box-sizing: border-box;
75
- width: 36px;
76
- margin-right: .5em;
77
- }
78
- #css{
79
- font-size: 11px;
80
- color:#bbb;
81
- }
82
- #css input{
83
- margin: 0 6px 0 12px;
84
- vertical-align: baseline;
85
- }
86
- #pf-shortcode{
87
-
88
- margin-left: 2em;
89
- }
90
- .custom-logo label, .custom-logo input, #pf-favicon {
91
- display: inline-block;
92
- }
93
-
94
- .custom-logo input {
95
- width: 20em;
96
- }
97
-
98
- .custom-logo label {
99
- margin-left: 5px;
100
- margin-right: 2px;
101
- }
102
-
103
- label#pf-favicon {
104
- vertical-align: baseline;
105
- margin: 0;
106
- }
107
-
108
- .printfriendly-details input {
109
- width: 20em;
110
- }
111
-
112
- .printfriendly-details label {
113
- margin-left: 5px;
114
- margin-right: 2px;
115
- }
116
-
117
- .icon32 {
118
- background: url(images/pf-icon.png) center center no-repeat;
119
- }
120
-
121
- #after-submit{
122
- border-top: 2px dashed #dfdfdf;
123
- margin:4em 0;
124
- padding-top:1em;
125
- }
126
- #addmanual-help {
127
- display: none;
128
- }
129
-
130
- #colorSelector {
131
- position: relative;
 
 
 
 
 
 
132
  width: 36px;
133
  height: 36px;
134
- background: url(images/select2.png);
135
- display: inline-block;
136
- cursor: pointer;
137
- }
138
-
139
- #colorSelector div {
140
  position: absolute;
141
  top: 4px;
142
  left: 4px;
143
  width: 28px;
144
  height: 28px;
145
- background: url(images/select2.png) center;
146
- }
147
-
148
- .colorpicker {
149
- width: 356px;
150
- height: 176px;
151
- overflow: hidden;
152
- position: absolute;
153
- background: url(images/custom_background.png);
154
- font-family: Arial, Helvetica, sans-serif;
155
- display: none;
156
- }
157
-
158
- .colorpicker_color {
159
- width: 150px;
160
- height: 150px;
161
- left: 14px;
162
- top: 13px;
163
- position: absolute;
164
- background: #f00;
165
- overflow: hidden;
166
- cursor: crosshair;
167
- }
168
-
169
- .colorpicker_color div {
170
- position: absolute;
171
- top: 0;
172
- left: 0;
173
- width: 150px;
174
- height: 150px;
175
- background: url(images/colorpicker_overlay.png);
176
- }
177
-
178
- .colorpicker_color div div {
179
- position: absolute;
180
- top: 0;
181
- left: 0;
182
- width: 11px;
183
- height: 11px;
184
- overflow: hidden;
185
- background: url(images/colorpicker_select.gif);
186
- margin: -5px 0 0 -5px;
187
- }
188
-
189
- .colorpicker_hue {
190
- position: absolute;
191
- top: 13px;
192
- left: 171px;
193
- width: 35px;
194
- height: 150px;
195
- cursor: n-resize;
196
- }
197
-
198
- .colorpicker_hue div {
199
- position: absolute;
200
- width: 35px;
201
- height: 9px;
202
- overflow: hidden;
203
- background: url(images/custom_indic.gif) left top;
204
- margin: -4px 0 0 0;
205
- left: 0px;
206
- }
207
-
208
- .colorpicker_new_color {
209
- position: absolute;
210
- width: 60px;
211
- height: 30px;
212
- left: 213px;
213
- top: 13px;
214
- background: #f00;
215
- }
216
-
217
- .colorpicker_current_color {
218
- position: absolute;
219
- width: 60px;
220
- height: 30px;
221
- left: 283px;
222
- top: 13px;
223
- background: #f00;
224
- }
225
-
226
- .colorpicker input {
227
- background-color: transparent;
228
- border: 1px solid transparent !important;
229
- position: absolute;
230
- font-size: 10px;
231
- font-family: Arial, Helvetica, sans-serif;
232
- color: #778398;
233
- top: 4px;
234
- right: 11px;
235
- text-align: right;
236
- margin: 0;
237
- padding: 0 !important;
238
- height: 11px;
239
- line-height: 11px;
240
- outline: none;
241
- }
242
-
243
- .colorpicker_hex {
244
- position: absolute;
245
- width: 72px;
246
- height: 22px;
247
- background: url(images/custom_hex.png) top;
248
- left: 212px;
249
- top: 142px;
250
- }
251
-
252
- .colorpicker_hex input {
253
- right: 6px;
254
- }
255
-
256
- .colorpicker_field {
257
- height: 22px;
258
- width: 62px;
259
- background-position: top;
260
- position: absolute;
261
- }
262
-
263
- .colorpicker_field span {
264
- position: absolute;
265
- width: 12px;
266
- height: 22px;
267
- overflow: hidden;
268
- top: 0;
269
- right: 0;
270
- cursor: n-resize;
271
- }
272
-
273
- .colorpicker_rgb_r {
274
- background-image: url(images/custom_rgb_r.png);
275
- top: 52px;
276
- left: 212px;
277
- }
278
-
279
- .colorpicker_rgb_g {
280
- background-image: url(images/custom_rgb_g.png);
281
- top: 82px;
282
- left: 212px;
283
- }
284
-
285
- .colorpicker_rgb_b {
286
- background-image: url(images/custom_rgb_b.png);
287
- top: 112px;
288
- left: 212px;
289
- }
290
-
291
- .colorpicker_hsb_h, .colorpicker_hsb_s, .colorpicker_hsb_b {
292
- display: none;
293
- }
294
-
295
- .colorpicker_submit {
296
- position: absolute;
297
- width: 22px;
298
- height: 22px;
299
- background: url(images/custom_submit.png) top;
300
- left: 322px;
301
- top: 142px;
302
- overflow: hidden;
303
- }
304
-
305
- .colorpicker_focus {
306
- background-position: center;
307
- }
308
-
309
- .colorpicker_hex.colorpicker_focus {
310
- background-position: bottom;
311
- }
312
-
313
- .colorpicker_submit.colorpicker_focus {
314
- background-position: bottom;
315
- }
316
-
317
- .colorpicker_slider {
318
- background-position: bottom;
319
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ label {
2
+ display: block;
3
+ margin: 1.5em 0;
4
+ }
5
+
6
+ h3 {
7
+ margin: 3em 0 2em;
8
+ border-bottom: 1px solid #ccc;
9
+ padding-bottom:.75em;
10
+ clear: both;
11
+ }
12
+
13
+ h3.hndle {
14
+ clear:none;
15
+ padding: 7px 5px;
16
+ }
17
+
18
+ #buttongroup1, #buttongroup2, #buttongroup3, #custom-txt div, #button-positioning div, #button-placement div {
19
+ display: block;
20
+ margin-right: 3em;
21
+ float: left;
22
+ }
23
+ #custom-txt div#txt-size, div#button-positioning-options {
24
+ margin-right: 0;
25
+ }
26
+
27
+ #custom-button-preview {
28
+ clear:both;
29
+ padding-top: 20px;
30
+ margin-left: 2em;
31
+ }
32
+ #custom-button-preview img {
33
+ margin-right: 6px;
34
+ }
35
+ #custom, #placement-adv-options {
36
+ float: left;
37
+ }
38
+
39
+ #custom-txt, #custom-img {
40
+ margin: 2em 0 2em 2em;
41
+ clear: both;
42
+ }
43
+
44
+ .description {
45
+ color: #cacaca;
46
+ }
47
+ .printfriendly-text2 {
48
+ font-family: verdana;
49
+ font-size: 14px;
50
+ color: #6D9F00;
51
+ }
52
+ select{
53
+ display: block;
54
+ margin: .5em .5em 2em 0;
55
+ }
56
+ select#javascript, select#website_protocol {
57
+ display: inline-block;
58
+ margin-bottom: 0;
59
+ }
60
+ input[type="radio"], input[type="checkbox"] {
61
+ cursor: pointer;
62
+ margin-right: 10px;
63
+ vertical-align: middle;
64
+ }
65
+
66
+
67
+ /* WP lacks styling for type="number", so in here for now */
68
+ input[type="number"] {
69
+ border-color: #DFDFDF;
70
+ background-color: white;
71
+ border-width: 1px;
72
+ border-style: solid;
73
+ -moz-border-radius: 3px;
74
+ -khtml-border-radius: 3px;
75
+ -webkit-border-radius: 3px;
76
+ border-radius: 3px;
77
+ -moz-box-sizing: border-box;
78
+ -webkit-box-sizing: border-box;
79
+ -ms-box-sizing: border-box;
80
+ box-sizing: border-box;
81
+ width: 36px;
82
+ margin-right: .5em;
83
+ }
84
+ #css {
85
+ font-size: 11px;
86
+ color:#bbb;
87
+ }
88
+ #css input {
89
+ margin: 0 6px 0 12px;
90
+ vertical-align: baseline;
91
+ }
92
+ #pf-shortcode {
93
+
94
+ margin-left: 2em;
95
+ }
96
+ .custom-logo label, .custom-logo input, #pf-favicon {
97
+ display: inline-block;
98
+ }
99
+
100
+ .custom-logo input {
101
+ width: 20em;
102
+ }
103
+
104
+ .custom-logo label {
105
+ margin-left: 5px;
106
+ margin-right: 2px;
107
+ }
108
+
109
+ label#pf-favicon {
110
+ vertical-align: baseline;
111
+ margin: 0;
112
+ }
113
+
114
+ .printfriendly-details input {
115
+ width: 20em;
116
+ }
117
+
118
+ .printfriendly-details label {
119
+ margin-left: 5px;
120
+ margin-right: 2px;
121
+ }
122
+
123
+ .icon32 {
124
+ background: url(images/pf-icon.png) center center no-repeat;
125
+ }
126
+
127
+ #after-submit {
128
+ border-top: 2px dashed #dfdfdf;
129
+ margin:4em 0;
130
+ padding-top:1em;
131
+ }
132
+ #addmanual-help {
133
+ display: none;
134
+ }
135
+
136
+ #colorSelector {
137
+ position: relative;
138
  width: 36px;
139
  height: 36px;
140
+ background: url(images/select2.png);
141
+ display: inline-block;
142
+ cursor: pointer;
143
+ }
144
+
145
+ #colorSelector div {
146
  position: absolute;
147
  top: 4px;
148
  left: 4px;
149
  width: 28px;
150
  height: 28px;
151
+ background: url(images/select2.png) center;
152
+ }
153
+
154
+ .colorpicker {
155
+ width: 356px;
156
+ height: 176px;
157
+ overflow: hidden;
158
+ position: absolute;
159
+ background: url(images/custom_background.png);
160
+ font-family: Arial, Helvetica, sans-serif;
161
+ display: none;
162
+ }
163
+
164
+ .colorpicker_color {
165
+ width: 150px;
166
+ height: 150px;
167
+ left: 14px;
168
+ top: 13px;
169
+ position: absolute;
170
+ background: #f00;
171
+ overflow: hidden;
172
+ cursor: crosshair;
173
+ }
174
+
175
+ .colorpicker_color div {
176
+ position: absolute;
177
+ top: 0;
178
+ left: 0;
179
+ width: 150px;
180
+ height: 150px;
181
+ background: url(images/colorpicker_overlay.png);
182
+ }
183
+
184
+ .colorpicker_color div div {
185
+ position: absolute;
186
+ top: 0;
187
+ left: 0;
188
+ width: 11px;
189
+ height: 11px;
190
+ overflow: hidden;
191
+ background: url(images/colorpicker_select.gif);
192
+ margin: -5px 0 0 -5px;
193
+ }
194
+
195
+ .colorpicker_hue {
196
+ position: absolute;
197
+ top: 13px;
198
+ left: 171px;
199
+ width: 35px;
200
+ height: 150px;
201
+ cursor: n-resize;
202
+ }
203
+
204
+ .colorpicker_hue div {
205
+ position: absolute;
206
+ width: 35px;
207
+ height: 9px;
208
+ overflow: hidden;
209
+ background: url(images/custom_indic.gif) left top;
210
+ margin: -4px 0 0 0;
211
+ left: 0px;
212
+ }
213
+
214
+ .colorpicker_new_color {
215
+ position: absolute;
216
+ width: 60px;
217
+ height: 30px;
218
+ left: 213px;
219
+ top: 13px;
220
+ background: #f00;
221
+ }
222
+
223
+ .colorpicker_current_color {
224
+ position: absolute;
225
+ width: 60px;
226
+ height: 30px;
227
+ left: 283px;
228
+ top: 13px;
229
+ background: #f00;
230
+ }
231
+
232
+ .colorpicker input {
233
+ background-color: transparent;
234
+ border: 1px solid transparent !important;
235
+ position: absolute;
236
+ font-size: 10px;
237
+ font-family: Arial, Helvetica, sans-serif;
238
+ color: #778398;
239
+ top: 4px;
240
+ right: 11px;
241
+ text-align: right;
242
+ margin: 0;
243
+ padding: 0 !important;
244
+ height: 11px;
245
+ line-height: 11px;
246
+ outline: none;
247
+ }
248
+
249
+ .colorpicker_hex {
250
+ position: absolute;
251
+ width: 72px;
252
+ height: 22px;
253
+ background: url(images/custom_hex.png) top;
254
+ left: 212px;
255
+ top: 142px;
256
+ }
257
+
258
+ .colorpicker_hex input {
259
+ right: 6px;
260
+ }
261
+
262
+ .colorpicker_field {
263
+ height: 22px;
264
+ width: 62px;
265
+ background-position: top;
266
+ position: absolute;
267
+ }
268
+
269
+ .colorpicker_field span {
270
+ position: absolute;
271
+ width: 12px;
272
+ height: 22px;
273
+ overflow: hidden;
274
+ top: 0;
275
+ right: 0;
276
+ cursor: n-resize;
277
+ }
278
+
279
+ .colorpicker_rgb_r {
280
+ background-image: url(images/custom_rgb_r.png);
281
+ top: 52px;
282
+ left: 212px;
283
+ }
284
+
285
+ .colorpicker_rgb_g {
286
+ background-image: url(images/custom_rgb_g.png);
287
+ top: 82px;
288
+ left: 212px;
289
+ }
290
+
291
+ .colorpicker_rgb_b {
292
+ background-image: url(images/custom_rgb_b.png);
293
+ top: 112px;
294
+ left: 212px;
295
+ }
296
+
297
+ .colorpicker_hsb_h, .colorpicker_hsb_s, .colorpicker_hsb_b {
298
+ display: none;
299
+ }
300
+
301
+ .colorpicker_submit {
302
+ position: absolute;
303
+ width: 22px;
304
+ height: 22px;
305
+ background: url(images/custom_submit.png) top;
306
+ left: 322px;
307
+ top: 142px;
308
+ overflow: hidden;
309
+ }
310
+
311
+ .colorpicker_focus {
312
+ background-position: center;
313
+ }
314
+
315
+ .colorpicker_hex.colorpicker_focus {
316
+ background-position: bottom;
317
+ }
318
+
319
+ .colorpicker_submit.colorpicker_focus {
320
+ background-position: bottom;
321
+ }
322
+
323
+ .colorpicker_slider {
324
+ background-position: bottom;
325
+ }
326
+
327
+ #button-placement div#pages label {
328
+ clear: left;
329
+ }
330
+
331
+ div#category-adder {
332
+ float: none;
333
+ }
334
+
335
+ #pf-categories {
336
+ display: none;
337
+ float: left;
338
+ position: relative;
339
+ top: 1.5em;
340
+ left: 20px;
341
+ width: 270px;
342
+ }
343
+ #pf-categories h4 {
344
+ margin: 0 0 0.4em 0;
345
+ }
346
+
347
+ #pf-categories-metabox, #category-adder {
348
+ display: none;
349
+ }
350
+
351
+ span.description.pf-help-link {
352
+ font-size: 130%;
353
+ padding-left: 10px;
354
+ font-style: normal;
355
+ }
admin.js CHANGED
@@ -4,12 +4,57 @@ jQuery(document).ready(function() {
4
  if (jQuery('.show_list:checked').length == 0) {
5
  jQuery('.content_placement').hide('slow');
6
  jQuery('.content_placement input').attr('disabled','disabled');
 
7
  } else {
 
8
  jQuery('.content_placement').show('slow');
9
  jQuery('.content_placement input').removeAttr('disabled');
10
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
11
  }).change();
12
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
  jQuery('#colorSelector').ColorPicker({
14
  color: jQuery('#text_color').val(),
15
  onShow: function (colpkr) {
@@ -158,4 +203,52 @@ jQuery(document).ready(function() {
158
  jQuery('.printfriendly-text2').css('font-size',parseInt(size));
159
  }
160
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
161
  });
4
  if (jQuery('.show_list:checked').length == 0) {
5
  jQuery('.content_placement').hide('slow');
6
  jQuery('.content_placement input').attr('disabled','disabled');
7
+ jQuery('.show_template').attr('checked', 'checked');
8
  } else {
9
+ jQuery('.show_template').attr('checked', false);
10
  jQuery('.content_placement').show('slow');
11
  jQuery('.content_placement input').removeAttr('disabled');
12
  }
13
+
14
+ var postName = 'printfriendly_option[show_on_posts]';
15
+ var homeName = 'printfriendly_option[show_on_homepage]';
16
+
17
+ var optionName = jQuery(this).attr('name');
18
+ if (optionName == homeName || optionName == postName){
19
+ if(jQuery(this).is(':checked')) {
20
+ jQuery('#pf-categories').show('slow');
21
+ } else if(!jQuery('input[name="' + homeName + '"]').is(':checked')
22
+ && !jQuery('input[name="' + postName + '"]').is(':checked')) {
23
+ jQuery('#pf-categories').hide('slow');
24
+ }
25
+ }
26
  }).change();
27
 
28
+ jQuery('.show_template').change(function() {
29
+ if(jQuery(this).is(':checked')) {
30
+ jQuery('.show_list').attr('checked', false);
31
+ jQuery('.show_list').attr('disabled', 'disabled');
32
+ jQuery('.content_placement').hide('slow');
33
+ jQuery('.content_placement input').attr('disabled','disabled');
34
+ jQuery('#pf-categories-metabox').hide('slow');
35
+ } else {
36
+ jQuery('.show_list').removeAttr('disabled');
37
+ jQuery('.content_placement').show('slow');
38
+ jQuery('.content_placement input').removeAttr('disabled');
39
+ }
40
+ }).change();
41
+
42
+ jQuery('#toggle-categories').click(function() {
43
+ if(jQuery('#pf-categories-metabox').is(':visible')) {
44
+ jQuery('#pf-categories-metabox').hide('slow');
45
+ } else {
46
+ jQuery('#pf-categories-metabox').show('slow');
47
+ }
48
+ });
49
+
50
+ jQuery(document).mouseup(function (e) {
51
+ var container = jQuery("#pf-categories");
52
+
53
+ if (container.has(e.target).length === 0) {
54
+ jQuery('#pf-categories-metabox').hide('slow');
55
+ }
56
+ });
57
+
58
  jQuery('#colorSelector').ColorPicker({
59
  color: jQuery('#text_color').val(),
60
  onShow: function (colpkr) {
203
  jQuery('.printfriendly-text2').css('font-size',parseInt(size));
204
  }
205
 
206
+ // postboxes setup
207
+ jQuery('.if-js-closed').removeClass('if-js-closed').addClass('closed');
208
+
209
+ // categories checkboxes
210
+ var category_ids = jQuery('#category_ids').val().split(',');
211
+ if(category_ids[0] == 'all') {
212
+ var ids = [];
213
+ jQuery('#categorydiv :checkbox').each(function() {
214
+ jQuery(this).attr('checked', 'checked');
215
+ });
216
+ jQuery('#category-all :checkbox').each(function() {
217
+ ids.push(jQuery(this).val());
218
+ });
219
+ // for older wp versions we do not have per category settings so
220
+ // ids array will be empty and in that case we shouldn't replace 'all'
221
+ if(ids.length != 0) {
222
+ jQuery('#category_ids').val(ids.join(','));
223
+ }
224
+ } else {
225
+
226
+ jQuery('#categorydiv :checkbox').each(function() {
227
+ if(jQuery.inArray(jQuery(this).val(), category_ids) != -1) {
228
+ jQuery(this).attr('checked', 'checked');
229
+ }
230
+ });
231
+ }
232
+
233
+ jQuery('#categorydiv :checkbox').click(function() {
234
+ var values = jQuery('#category_ids').val();
235
+ var ids = [];
236
+ if(values != '')
237
+ ids = values.split(',');
238
+
239
+ var id = jQuery(this).val();
240
+
241
+ if(jQuery(this).is(':checked'))
242
+ ids.push(id);
243
+ else {
244
+ ids = jQuery.grep(ids, function(value) {
245
+ return value != id;
246
+ });
247
+ }
248
+
249
+ jQuery('#category_ids').val(ids.join(','));
250
+ });
251
+
252
+ // page checkboxes TODO...
253
+
254
  });
languages/printfriendly.pot CHANGED
@@ -4,8 +4,8 @@ msgid ""
4
  msgstr ""
5
  "Project-Id-Version: PrintFriendly\n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/printfriendly\n"
7
- "POT-Creation-Date: 2013-03-19 22:30+0100\n"
8
- "PO-Revision-Date: 2013-03-19 23:17+0100\n"
9
  "Last-Translator: EJ Reinders Folmer <poedit_nospam@adviesenzo.nl>\n"
10
  "Language-Team: \n"
11
  "MIME-Version: 1.0\n"
@@ -18,248 +18,299 @@ msgstr ""
18
  "X-Poedit-SearchPath-0: .\n"
19
  "X-Poedit-SearchPath-1: ..\n"
20
 
21
- #: ../pf.php:411
 
 
 
 
 
 
22
  msgid "The text size you entered is invalid, please stay between 9px and 25px"
23
  msgstr ""
24
 
25
- #: ../pf.php:419
26
  msgid ""
27
  "The color you entered is not valid, it must be a valid hexadecimal RGB font "
28
  "color."
29
  msgstr ""
30
 
31
- #: ../pf.php:433
 
 
 
 
 
 
32
  msgid "PrintFriendly Options"
33
  msgstr ""
34
 
35
- #: ../pf.php:433
36
  msgid "Print Friendly & PDF"
37
  msgstr ""
38
 
39
- #: ../pf.php:446
40
  msgid "Need Help?"
41
  msgstr ""
42
 
43
- #: ../pf.php:447
44
  #, php-format
45
  msgid "Be sure to check out the %s!"
46
  msgstr ""
47
 
48
- #: ../pf.php:447
49
  msgid "Frequently Asked Questions"
50
  msgstr ""
51
 
52
- #: ../pf.php:486
53
  msgid "Settings"
54
  msgstr ""
55
 
56
- #: ../pf.php:869
57
  msgid "Only display when post is in:"
58
  msgstr ""
59
 
60
- #: ../pf.php:892
61
  msgid "Print Friendly & PDF Settings"
62
  msgstr ""
63
 
64
- #: ../pf.php:897
65
  msgid "Pick Your Button Style"
66
  msgstr ""
67
 
68
- #: ../pf.php:920
69
  msgid "Custom Button"
70
  msgstr ""
71
 
72
- #: ../pf.php:923
73
  msgid "Enter Image URL"
74
  msgstr ""
75
 
76
- #: ../pf.php:925
77
  msgid "Ex: http://www.example.com/<br>Ex: /wp/wp-content/uploads/example.png)"
78
  msgstr ""
79
 
80
- #: ../pf.php:931
81
  msgid "Text"
82
  msgstr ""
83
 
84
- #: ../pf.php:935
85
  msgid "Text Color"
86
  msgstr ""
87
 
88
- #: ../pf.php:942
89
  msgid "Text Size"
90
  msgstr ""
91
 
92
- #: ../pf.php:954
93
  msgid "Button Positioning"
94
  msgstr ""
95
 
96
- #: ../pf.php:961
97
  msgid "Left Align"
98
  msgstr ""
99
 
100
- #: ../pf.php:962
101
  msgid "Right Align"
102
  msgstr ""
103
 
104
- #: ../pf.php:963
105
  msgid "Center"
106
  msgstr ""
107
 
108
- #: ../pf.php:964
109
  msgid "None"
110
  msgstr ""
111
 
112
- #: ../pf.php:971
113
  msgid "Above Content"
114
  msgstr ""
115
 
116
- #: ../pf.php:972
117
  msgid "Below Content"
118
  msgstr ""
119
 
120
- #: ../pf.php:979
121
  msgid "Margin Left"
122
  msgstr ""
123
 
124
- #: ../pf.php:982
125
  msgid "Margin Right"
126
  msgstr ""
127
 
128
- #: ../pf.php:985
129
  msgid "Margin Top"
130
  msgstr ""
131
 
132
- #: ../pf.php:988
133
  msgid "Margin Bottom"
134
  msgstr ""
135
 
136
- #: ../pf.php:997
137
  msgid "Display button on:"
138
  msgstr ""
139
 
140
- #: ../pf.php:999
141
  msgid "Posts"
142
  msgstr ""
143
 
144
- #: ../pf.php:1000
145
  msgid "Pages"
146
  msgstr ""
147
 
148
- #: ../pf.php:1001
149
  msgid "Homepage"
150
  msgstr ""
151
 
152
- #: ../pf.php:1002
153
  msgid "Category Pages"
154
  msgstr ""
155
 
156
- #: ../pf.php:1003
157
  msgid "Taxonomy Pages"
158
  msgstr ""
159
 
160
- #: ../pf.php:1004
161
  msgid "Add direct to template"
162
  msgstr ""
163
 
164
- #: ../pf.php:1006
165
  msgid "or use shortcode inside your page/article"
166
  msgstr ""
167
 
168
- #: ../pf.php:1013
169
- #, php-format
170
- msgid "<a %s>Additional filter</a>"
171
- msgstr ""
172
-
173
- #: ../pf.php:1024
174
  msgid "Print PDF Options"
175
  msgstr ""
176
 
177
- #: ../pf.php:1026
178
  msgid "Page header"
179
  msgstr ""
180
 
181
- #: ../pf.php:1028
182
  msgid "My Website Icon"
183
  msgstr ""
184
 
185
- #: ../pf.php:1029
186
  msgid "Upload an Image"
187
  msgstr ""
188
 
189
- #: ../pf.php:1036
 
 
 
 
 
 
 
 
190
  msgid "Click-to-delete"
191
  msgstr ""
192
 
193
- #: ../pf.php:1038 ../pf.php:1045 ../pf.php:1052 ../pf.php:1059
194
  msgid "Allow"
195
  msgstr ""
196
 
197
- #: ../pf.php:1039 ../pf.php:1046 ../pf.php:1053 ../pf.php:1060
198
  msgid "Not Allow"
199
  msgstr ""
200
 
201
- #: ../pf.php:1043
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
202
  msgid "Email"
203
  msgstr ""
204
 
205
- #: ../pf.php:1050
206
  msgid "PDF"
207
  msgstr ""
208
 
209
- #: ../pf.php:1057
210
  msgid "Print"
211
  msgstr ""
212
 
213
- #: ../pf.php:1064
214
  msgid "Custom css url"
215
  msgstr ""
216
 
217
- #: ../pf.php:1070
 
 
 
 
218
  msgid "Webmaster Settings"
219
  msgstr ""
220
 
221
- #: ../pf.php:1074
222
  msgid "http (common)"
223
  msgstr ""
224
 
225
- #: ../pf.php:1075
226
  msgid "https (secure)"
227
  msgstr ""
228
 
229
- #: ../pf.php:1082 ../pf.php:1089
230
  msgid "No"
231
  msgstr ""
232
 
233
- #: ../pf.php:1083 ../pf.php:1088
234
  msgid "Yes"
235
  msgstr ""
236
 
237
- #: ../pf.php:1092
238
  msgid ""
239
  "Display print preview on-page using a JavaScript Lightbox (user never leaves "
240
  "the site/page)."
241
  msgstr ""
242
 
243
- #: ../pf.php:1095
244
  msgid "Display print preview on PrintFriendly.com (No JavaScript)"
245
  msgstr ""
246
 
247
- #: ../pf.php:1100
248
  msgid "Save Options"
249
  msgstr ""
250
 
251
- #: ../pf.php:1101
252
  msgid "Cancel"
253
  msgstr ""
254
 
255
- #: ../pf.php:1106
256
  msgid "Like PrintFriendly?"
257
  msgstr ""
258
 
259
- #: ../pf.php:1106
260
  msgid "Give us a rating"
261
  msgstr ""
262
 
263
- #: ../pf.php:1106
264
  msgid "Need help or have suggestions?"
265
  msgstr ""
4
  msgstr ""
5
  "Project-Id-Version: PrintFriendly\n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/printfriendly\n"
7
+ "POT-Creation-Date: 2013-03-29 21:36+0100\n"
8
+ "PO-Revision-Date: 2013-03-29 21:36+0100\n"
9
  "Last-Translator: EJ Reinders Folmer <poedit_nospam@adviesenzo.nl>\n"
10
  "Language-Team: \n"
11
  "MIME-Version: 1.0\n"
18
  "X-Poedit-SearchPath-0: .\n"
19
  "X-Poedit-SearchPath-1: ..\n"
20
 
21
+ #: ../pf.php:381
22
+ msgid ""
23
+ "No valid custom image url received, please enter a valid url to use a custom "
24
+ "image."
25
+ msgstr ""
26
+
27
+ #: ../pf.php:390
28
  msgid "The text size you entered is invalid, please stay between 9px and 25px"
29
  msgstr ""
30
 
31
+ #: ../pf.php:398
32
  msgid ""
33
  "The color you entered is not valid, it must be a valid hexadecimal RGB font "
34
  "color."
35
  msgstr ""
36
 
37
+ #: ../pf.php:478
38
+ msgid ""
39
+ "No valid custom logo url received, please enter a valid url to use a custom "
40
+ "logo."
41
+ msgstr ""
42
+
43
+ #: ../pf.php:524
44
  msgid "PrintFriendly Options"
45
  msgstr ""
46
 
47
+ #: ../pf.php:524
48
  msgid "Print Friendly & PDF"
49
  msgstr ""
50
 
51
+ #: ../pf.php:537
52
  msgid "Need Help?"
53
  msgstr ""
54
 
55
+ #: ../pf.php:538
56
  #, php-format
57
  msgid "Be sure to check out the %s!"
58
  msgstr ""
59
 
60
+ #: ../pf.php:538
61
  msgid "Frequently Asked Questions"
62
  msgstr ""
63
 
64
+ #: ../pf.php:577
65
  msgid "Settings"
66
  msgstr ""
67
 
68
+ #: ../pf.php:973
69
  msgid "Only display when post is in:"
70
  msgstr ""
71
 
72
+ #: ../pf.php:996
73
  msgid "Print Friendly & PDF Settings"
74
  msgstr ""
75
 
76
+ #: ../pf.php:1001
77
  msgid "Pick Your Button Style"
78
  msgstr ""
79
 
80
+ #: ../pf.php:1024
81
  msgid "Custom Button"
82
  msgstr ""
83
 
84
+ #: ../pf.php:1027
85
  msgid "Enter Image URL"
86
  msgstr ""
87
 
88
+ #: ../pf.php:1029
89
  msgid "Ex: http://www.example.com/<br>Ex: /wp/wp-content/uploads/example.png)"
90
  msgstr ""
91
 
92
+ #: ../pf.php:1035
93
  msgid "Text"
94
  msgstr ""
95
 
96
+ #: ../pf.php:1039
97
  msgid "Text Color"
98
  msgstr ""
99
 
100
+ #: ../pf.php:1046
101
  msgid "Text Size"
102
  msgstr ""
103
 
104
+ #: ../pf.php:1058
105
  msgid "Button Positioning"
106
  msgstr ""
107
 
108
+ #: ../pf.php:1065
109
  msgid "Left Align"
110
  msgstr ""
111
 
112
+ #: ../pf.php:1066
113
  msgid "Right Align"
114
  msgstr ""
115
 
116
+ #: ../pf.php:1067
117
  msgid "Center"
118
  msgstr ""
119
 
120
+ #: ../pf.php:1068
121
  msgid "None"
122
  msgstr ""
123
 
124
+ #: ../pf.php:1075
125
  msgid "Above Content"
126
  msgstr ""
127
 
128
+ #: ../pf.php:1076
129
  msgid "Below Content"
130
  msgstr ""
131
 
132
+ #: ../pf.php:1083
133
  msgid "Margin Left"
134
  msgstr ""
135
 
136
+ #: ../pf.php:1086
137
  msgid "Margin Right"
138
  msgstr ""
139
 
140
+ #: ../pf.php:1089
141
  msgid "Margin Top"
142
  msgstr ""
143
 
144
+ #: ../pf.php:1092
145
  msgid "Margin Bottom"
146
  msgstr ""
147
 
148
+ #: ../pf.php:1101
149
  msgid "Display button on:"
150
  msgstr ""
151
 
152
+ #: ../pf.php:1103
153
  msgid "Posts"
154
  msgstr ""
155
 
156
+ #: ../pf.php:1104
157
  msgid "Pages"
158
  msgstr ""
159
 
160
+ #: ../pf.php:1105
161
  msgid "Homepage"
162
  msgstr ""
163
 
164
+ #: ../pf.php:1106
165
  msgid "Category Pages"
166
  msgstr ""
167
 
168
+ #: ../pf.php:1107
169
  msgid "Taxonomy Pages"
170
  msgstr ""
171
 
172
+ #: ../pf.php:1108
173
  msgid "Add direct to template"
174
  msgstr ""
175
 
176
+ #: ../pf.php:1110
177
  msgid "or use shortcode inside your page/article"
178
  msgstr ""
179
 
180
+ #: ../pf.php:1128
 
 
 
 
 
181
  msgid "Print PDF Options"
182
  msgstr ""
183
 
184
+ #: ../pf.php:1130
185
  msgid "Page header"
186
  msgstr ""
187
 
188
+ #: ../pf.php:1132
189
  msgid "My Website Icon"
190
  msgstr ""
191
 
192
+ #: ../pf.php:1133
193
  msgid "Upload an Image"
194
  msgstr ""
195
 
196
+ #: ../pf.php:1137
197
+ msgid "Enter url"
198
+ msgstr ""
199
+
200
+ #: ../pf.php:1138
201
+ msgid "Text (optional)"
202
+ msgstr ""
203
+
204
+ #: ../pf.php:1143
205
  msgid "Click-to-delete"
206
  msgstr ""
207
 
208
+ #: ../pf.php:1145 ../pf.php:1168 ../pf.php:1175 ../pf.php:1182
209
  msgid "Allow"
210
  msgstr ""
211
 
212
+ #: ../pf.php:1146 ../pf.php:1169 ../pf.php:1176 ../pf.php:1183
213
  msgid "Not Allow"
214
  msgstr ""
215
 
216
+ #: ../pf.php:1150
217
+ msgid "Images"
218
+ msgstr ""
219
+
220
+ #: ../pf.php:1152
221
+ msgid "Include"
222
+ msgstr ""
223
+
224
+ #: ../pf.php:1153
225
+ msgid "Exclude"
226
+ msgstr ""
227
+
228
+ #: ../pf.php:1157
229
+ msgid "Image style"
230
+ msgstr ""
231
+
232
+ #: ../pf.php:1159
233
+ msgid "Align Right"
234
+ msgstr ""
235
+
236
+ #: ../pf.php:1160
237
+ msgid "Align Left"
238
+ msgstr ""
239
+
240
+ #: ../pf.php:1161
241
+ msgid "Align None"
242
+ msgstr ""
243
+
244
+ #: ../pf.php:1162
245
+ msgid "Center/Block"
246
+ msgstr ""
247
+
248
+ #: ../pf.php:1166
249
  msgid "Email"
250
  msgstr ""
251
 
252
+ #: ../pf.php:1173
253
  msgid "PDF"
254
  msgstr ""
255
 
256
+ #: ../pf.php:1180
257
  msgid "Print"
258
  msgstr ""
259
 
260
+ #: ../pf.php:1187
261
  msgid "Custom css url"
262
  msgstr ""
263
 
264
+ #: ../pf.php:1189
265
+ msgid "?"
266
+ msgstr ""
267
+
268
+ #: ../pf.php:1194
269
  msgid "Webmaster Settings"
270
  msgstr ""
271
 
272
+ #: ../pf.php:1198
273
  msgid "http (common)"
274
  msgstr ""
275
 
276
+ #: ../pf.php:1199
277
  msgid "https (secure)"
278
  msgstr ""
279
 
280
+ #: ../pf.php:1206 ../pf.php:1213
281
  msgid "No"
282
  msgstr ""
283
 
284
+ #: ../pf.php:1207 ../pf.php:1212
285
  msgid "Yes"
286
  msgstr ""
287
 
288
+ #: ../pf.php:1216
289
  msgid ""
290
  "Display print preview on-page using a JavaScript Lightbox (user never leaves "
291
  "the site/page)."
292
  msgstr ""
293
 
294
+ #: ../pf.php:1219
295
  msgid "Display print preview on PrintFriendly.com (No JavaScript)"
296
  msgstr ""
297
 
298
+ #: ../pf.php:1224
299
  msgid "Save Options"
300
  msgstr ""
301
 
302
+ #: ../pf.php:1225
303
  msgid "Cancel"
304
  msgstr ""
305
 
306
+ #: ../pf.php:1230
307
  msgid "Like PrintFriendly?"
308
  msgstr ""
309
 
310
+ #: ../pf.php:1230
311
  msgid "Give us a rating"
312
  msgstr ""
313
 
314
+ #: ../pf.php:1230
315
  msgid "Need help or have suggestions?"
316
  msgstr ""
pf.php CHANGED
@@ -1,14 +1,19 @@
1
  <?php
 
2
  /*
3
  Plugin Name: Print Friendly and PDF
4
  Plugin URI: http://www.printfriendly.com
5
  Description: PrintFriendly & PDF button for your website. Optimizes your pages and brand for print, pdf, and email.
6
  Name and URL are included to ensure repeat visitors and new visitors when printed versions are shared.
7
- Version: 3.2.1
8
  Author: Print Friendly
9
  Author URI: http://www.PrintFriendly.com
10
 
11
  Changelog :
 
 
 
 
12
  3.2.1 - Improve script loading.
13
  3.2.0 - Important chrome issue fix. Ie syntax error fix.
14
  3.1.9 - Minor css detail.
@@ -82,7 +87,7 @@ if ( ! class_exists( 'PrintFriendly_WordPress' ) ) {
82
  * Database version, used to allow for easy upgrades to / additions in plugin options between plugin versions.
83
  * @var int
84
  */
85
- var $db_version = 4;
86
 
87
  /**
88
  * Settings page, used within the plugin to reliably load the plugins admin JS and CSS files only on the admin page.
@@ -116,24 +121,23 @@ if ( ! class_exists( 'PrintFriendly_WordPress' ) ) {
116
  add_filter( 'the_excerpt', array( &$this, 'show_link' ) );
117
  }
118
 
119
- if ( !is_admin() )
120
- return;
121
-
122
- // Hook into init for registration of the option and the language files
123
- add_action( 'admin_init', array( &$this, 'init' ) );
124
 
125
- // Register the settings page
126
- add_action( 'admin_menu', array( &$this, 'add_config_page' ) );
 
127
 
128
- // Register the contextual help
129
- add_filter( 'contextual_help', array( &$this, 'contextual_help' ), 10, 2 );
130
 
131
- // Enqueue the needed scripts and styles
132
- add_action( 'admin_enqueue_scripts',array( &$this, 'admin_enqueue_scripts' ) );
133
 
134
- // Register a link to the settings page on the plugins overview page
135
- add_filter( 'plugin_action_links', array( &$this, 'filter_plugin_actions' ), 10, 2 );
136
 
 
 
 
137
  }
138
 
139
  /**
@@ -155,10 +159,11 @@ if ( ! class_exists( 'PrintFriendly_WordPress' ) ) {
155
  if ( isset( $this->options['enable_css'] ) && $this->options['enable_css'] != 'on' )
156
  return;
157
 
 
158
  ?>
159
  <style type="text/css" media="screen">
160
  div.printfriendly {
161
- margin: <?php echo $this->options['margin_top'].'px '.$this->options['margin_right'].'px '.$this->options['margin_bottom'].'px '.$this->options['margin_left'].'px'; ?>;
162
  }
163
  div.printfriendly a, div.printfriendly a:link, div.printfriendly a:visited {
164
  text-decoration: none;
@@ -205,6 +210,8 @@ if ( ! class_exists( 'PrintFriendly_WordPress' ) ) {
205
  <?php
206
  }
207
 
 
 
208
  /**
209
  * Prints the PrintFriendly JavaScript, in the footer, and loads it asynchronously.
210
  *
@@ -230,17 +237,19 @@ if ( ! class_exists( 'PrintFriendly_WordPress' ) ) {
230
 
231
  ?>
232
  <script type="text/javascript">
233
- var pfHeaderImgUrl = "<?php echo $image_url ?>";
234
- var pfHeaderTagline = "<?php echo $tagline ?>";
235
- var pfdisableClickToDel = "<?php echo $this->options['click_to_delete'] ?>";
236
- var pfDisableEmail = "<?php echo $this->options['email'] ?>";
237
- var pfDisablePDF = "<?php echo $this->options['pdf'] ?>";
238
- var pfDisablePrint = "<?php echo $this->options['print'] ?>";
239
- var pfCustomCSS = "<?php echo $this->options['custom_css_url'] ?>";
 
 
240
 
241
  // PrintFriendly
242
  var e = document.createElement('script'); e.type="text/javascript";
243
- e.src = '<?php echo $pf_src ?>';
244
  document.getElementsByTagName('head')[0].appendChild(e);
245
  </script>
246
  <?php
@@ -285,11 +294,11 @@ if ( ! class_exists( 'PrintFriendly_WordPress' ) ) {
285
  }
286
  else
287
  {
288
- if ( (is_page() && isset($this->options['show_on_pages']))
289
- || (is_home() && isset($this->options['show_on_homepage']))
290
- || (is_tax() && isset($this->options['show_on_taxonomies']))
291
- || (is_category() && isset($this->options['show_on_categories']))
292
- || (is_single() && isset($this->options['show_on_posts'])) )
293
  {
294
  // Hook the script call now, so it only get's loaded when needed, and need is determined by the user calling pf_button
295
  add_action( 'wp_footer', array( &$this, 'print_script_footer' ) );
@@ -308,6 +317,18 @@ if ( ! class_exists( 'PrintFriendly_WordPress' ) ) {
308
 
309
  }
310
 
 
 
 
 
 
 
 
 
 
 
 
 
311
  /**
312
  * Register the textdomain and the options array along with the validation function
313
  *
@@ -331,31 +352,42 @@ if ( ! class_exists( 'PrintFriendly_WordPress' ) ) {
331
  function options_validate( $input ) {
332
  $valid_input = $input;
333
 
334
- // echo '<pre>'.print_r($input,1).'</pre>';
335
- // die;
336
-
337
- if ( !in_array( $input['button_type'], array( 'pf-button.gif', 'button-print-grnw20.png', 'button-print-blu20.png', 'button-print-gry20.png', 'button-print-whgn20.png', 'pf_button_sq_gry_m.png', 'pf_button_sq_gry_l.png', 'pf_button_sq_grn_m.png', 'pf_button_sq_grn_l.png', 'pf-button-big.gif', 'pf-icon-small.gif', 'pf-icon.gif', 'pf-button-both.gif', 'pf-icon-both.gif', 'text-only', 'custom-image') ) )
 
 
 
 
 
338
  $valid_input['button_type'] = 'pf-button.gif';
339
 
340
- if ( !isset( $input['custom_image'] ) )
 
341
  $valid_input['custom_image'] = '';
342
 
343
- if ( !in_array( $input['content_position'], array( 'none', 'left', 'center', 'right' ) ) )
344
- $valid_input['content_position'] = 'left';
 
 
 
345
 
346
- if ( !in_array( $input['content_placement'], array( 'before', 'after' ) ) )
347
- $valid_input['content_placement'] = 'after';
 
 
 
 
 
348
 
349
- foreach ( array( 'margin_top', 'margin_right', 'margin_bottom', 'margin_left' ) as $opt )
350
- $valid_input[$opt] = (int) $input[$opt];
351
 
352
  $valid_input['text_size'] = (int) $input['text_size'];
353
-
354
  if ( !isset($valid_input['text_size']) || 0 == $valid_input['text_size'] ) {
355
  $valid_input['text_size'] = 14;
356
  } else if ( 25 < $valid_input['text_size'] || 9 > $valid_input['text_size'] ) {
357
  $valid_input['text_size'] = 14;
358
- add_settings_error( $this->option_name, 'invalid_color', __( 'The text size you entered is invalid, please stay between 9px and 25px', $this->hook ) );
359
  }
360
 
361
  if ( !isset( $input['text_color'] )) {
@@ -365,7 +397,119 @@ if ( ! class_exists( 'PrintFriendly_WordPress' ) ) {
365
  $valid_input['text_color'] = $this->options['text_color'];
366
  add_settings_error( $this->option_name, 'invalid_color', __( 'The color you entered is not valid, it must be a valid hexadecimal RGB font color.', $this->hook ) );
367
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
368
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
369
  $valid_input['db_version'] = $this->db_version;
370
 
371
  return $valid_input;
@@ -378,6 +522,9 @@ if ( ! class_exists( 'PrintFriendly_WordPress' ) ) {
378
  */
379
  function add_config_page() {
380
  $this->settings_page = add_options_page( __( 'PrintFriendly Options', $this->hook ), __( 'Print Friendly & PDF', $this->hook ), 'manage_options', $this->hook, array( &$this, 'config_page' ) );
 
 
 
381
  }
382
 
383
  /**
@@ -388,7 +535,7 @@ if ( ! class_exists( 'PrintFriendly_WordPress' ) ) {
388
  function contextual_help( $contextual_help, $screen_id ) {
389
  if ( $this->settings_page == $screen_id ) {
390
  $contextual_help = '<strong>'.__( "Need Help?", $this->hook ).'</strong><br/>'
391
- .sprintf( __( "Be sure to check out the %s!"), '<a href="http://wordpress.org/extend/plugins/printfriendly/faq/">'.__( "Frequently Asked Questions", $this->hook ).'</a>' );
392
  }
393
  return $contextual_help;
394
  }
@@ -401,13 +548,14 @@ if ( ! class_exists( 'PrintFriendly_WordPress' ) ) {
401
  */
402
  function admin_enqueue_scripts( $screen_id ) {
403
  if ( $this->settings_page == $screen_id ) {
404
- $ver = '3.2.0';
405
  wp_register_script( 'pf-color-picker', plugins_url( 'colorpicker.js', __FILE__ ), array( 'jquery', 'media-upload' ), $ver );
406
  wp_register_script( 'pf-admin-js', plugins_url( 'admin.js', __FILE__ ), array( 'jquery', 'media-upload' ), $ver );
407
 
408
  wp_enqueue_script( 'pf-color-picker' );
409
  wp_enqueue_script( 'pf-admin-js' );
410
 
 
411
  wp_enqueue_style( 'printfriendly-admin-css', plugins_url( 'admin.css', __FILE__ ), array(), $ver);
412
  }
413
  }
@@ -458,6 +606,8 @@ if ( ! class_exists( 'PrintFriendly_WordPress' ) ) {
458
  'image_url' => '',
459
  'tagline' => '',
460
  'click_to_delete' => '0', // 0 - allow, 1 - do not allow
 
 
461
  'email' => '0', // 0 - allow, 1 - do not allow
462
  'pdf' => '0', // 0 - allow, 1 - do not allow
463
  'print' => '0', // 0 - allow, 1 - do not allow
@@ -465,6 +615,7 @@ if ( ! class_exists( 'PrintFriendly_WordPress' ) ) {
465
  'password_protected' => 'no',
466
  'javascript' => 'yes',
467
  'custom_css_url' => '',
 
468
  );
469
 
470
  // Check whether the old badly named singular options are there, if so, use the data and delete them.
@@ -518,7 +669,7 @@ if ( ! class_exists( 'PrintFriendly_WordPress' ) ) {
518
  // check whether image we do not list any more was used
519
  if(in_array($this->options['button_type'], array('button-print-whgn20.png', 'pf_button_sq_qry_m.png', 'pf_button_sq_qry_l.png', 'pf_button_sq_grn_m.png', 'pf_button_sq_grn_l.png'))) {
520
  // previous version had a bug with button name
521
- if(in_array($this->options['button_type'], array('pf_button_sq_qry_m.png', 'pf_button_sq_qry_l.png')))
522
  $this->options['button_type'] = str_replace('qry', 'gry', $this->options['button_type']);
523
 
524
  $image_address = '//cdn.printfriendly.com/'.$this->options['button_type'];
@@ -577,6 +728,33 @@ if ( ! class_exists( 'PrintFriendly_WordPress' ) ) {
577
  $this->options = array_merge($this->options, $additional_options);
578
  }
579
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
580
  $this->options['db_version'] = $this->db_version;
581
  update_option( $this->option_name, $this->options );
582
  }
@@ -617,7 +795,7 @@ if ( ! class_exists( 'PrintFriendly_WordPress' ) ) {
617
 
618
  switch($name){
619
  case "custom-image":
620
- if( '' == $this->options['custom_image'] )
621
  $return = '';
622
  else
623
  $return = '<img src="'.$this->options['custom_image'].'" alt="Print Friendly" />';
@@ -703,11 +881,11 @@ if ( ! class_exists( 'PrintFriendly_WordPress' ) ) {
703
  * @param string $name string used for various parts of checkbox
704
  *
705
  */
706
- function create_checkbox($name) {
707
- echo '<input type="checkbox" class="show_list" name="' . $this->option_name . '[show_on_' . $name . ']" value="on" ';
 
708
  $this->checked( 'show_on_' . $name, 'on');
709
- echo ' />';
710
- _e( ucfirst($name), $this->hook );
711
  }
712
 
713
 
@@ -723,6 +901,7 @@ if ( ! class_exists( 'PrintFriendly_WordPress' ) ) {
723
  isset($this->options['show_on_pages']) ||
724
  isset($this->options['show_on_homepage']) ||
725
  isset($this->options['show_on_categories']) ||
 
726
  isset($this->options['show_on_taxonomies']));
727
  }
728
 
@@ -742,6 +921,61 @@ if ( ! class_exists( 'PrintFriendly_WordPress' ) ) {
742
  return selected ($this->options[$val], $check_against);
743
  }
744
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
745
  /**
746
  * Output the config page
747
  *
@@ -751,7 +985,7 @@ if ( ! class_exists( 'PrintFriendly_WordPress' ) ) {
751
 
752
  // Since WP 3.2 outputs these errors by default, only display them when we're on versions older than 3.2 that do support the settings errors.
753
  global $wp_version;
754
- if ( version_compare( $wp_version, '3.2', '<' ) )
755
  settings_errors();
756
 
757
  // Show the content of the options array when debug is enabled
@@ -759,15 +993,15 @@ if ( ! class_exists( 'PrintFriendly_WordPress' ) ) {
759
  echo '<pre>Options:<br><br>' . print_r( $this->options, 1 ) . '</pre>';
760
  ?>
761
  <div id="pf_settings" class="wrap">
762
-
763
  <div class="icon32" id="printfriendly"></div>
764
  <h2><?php _e( 'Print Friendly & PDF Settings', $this->hook ); ?></h2>
765
-
766
  <form action="options.php" method="post">
767
  <?php settings_fields( $this->option_name ); ?>
768
-
769
  <h3><?php _e( "Pick Your Button Style", $this->hook ); ?></h3>
770
-
771
  <fieldset id="button-style">
772
  <div id="buttongroup1">
773
  <?php $this->radio('pf-button.gif'); ?>
@@ -820,15 +1054,15 @@ if ( ! class_exists( 'PrintFriendly_WordPress' ) ) {
820
  </div>
821
  </fieldset>
822
  <br class="clear">
823
-
824
- <!--Section 2 Button Placement-->
825
- <div id="button-placement">
826
- <h3><?php _e( "Button Placement", $this->hook ); ?>
827
  <span id="css"><input type="checkbox" name="<?php echo $this->option_name; ?>[enable_css]" value="<?php $this->val('enable_css');?>" <?php $this->checked('enable_css', 'off'); ?> />Do not use CSS for button styles</span>
828
  </h3>
829
- <div id="button-placement-options">
830
  <div id="alignment">
831
- <label>
832
  <select id="pf_content_position" name="<?php echo $this->option_name; ?>[content_position]" >
833
  <option value="left" <?php selected( $this->options['content_position'], 'left' ); ?>><?php _e( "Left Align", $this->hook ); ?></option>
834
  <option value="right" <?php selected( $this->options['content_position'], 'right' ); ?>><?php _e( "Right Align", $this->hook ); ?></option>
@@ -838,7 +1072,7 @@ if ( ! class_exists( 'PrintFriendly_WordPress' ) ) {
838
  </label>
839
  </div>
840
  <div class="content_placement">
841
- <label>
842
  <select id="pf_content_placement" name="<?php echo $this->option_name; ?>[content_placement]" >
843
  <option value="before" <?php selected( $this->options['content_placement'], 'before' ); ?>><?php _e( "Above Content", $this->hook ); ?></option>
844
  <option value="after" <?php selected( $this->options['content_placement'], 'after' ); ?>><?php _e( "Below Content", $this->hook ); ?></option>
@@ -846,43 +1080,65 @@ if ( ! class_exists( 'PrintFriendly_WordPress' ) ) {
846
  </label>
847
  </div>
848
  <div id="margin">
849
- <label>
850
- <input type="number" name="<?php echo $this->option_name; ?>[margin_left]" value="<?php $this->val( 'margin_left' ); ?>" maxlength="3"/>
851
  <?php _e( "Margin Left", $this->hook ); ?>
852
  </label>
853
- <label>
854
- <input type="number" name="<?php echo $this->option_name; ?>[margin_right]" value="<?php $this->val( 'margin_right' ); ?>"/> <?php _e( "Margin Right", $this->hook ); ?>
855
  </label>
856
- <label>
857
- <input type="number" name="<?php echo $this->option_name; ?>[margin_top]" value="<?php $this->val( 'margin_top' ); ?>" maxlength="3"/> <?php _e( "Margin Top", $this->hook ); ?>
858
  </label>
859
- <label>
860
- <input type="number" name="<?php echo $this->option_name; ?>[margin_bottom]" value="<?php $this->val( 'margin_bottom' ); ?>" maxlength="3"/> <?php _e( "Margin Bottom", $this->hook ); ?>
861
  </label>
862
  </div>
863
  </div>
 
 
 
 
 
 
864
  <div id="pages">
865
- <label><?php $this->create_checkbox('pages'); ?></label>
866
- <label><?php $this->create_checkbox('posts'); ?></label>
867
- <label><?php $this->create_checkbox('homepage'); ?></label>
868
- <label><?php $this->create_checkbox('categories'); ?></label>
869
- <label><?php $this->create_checkbox('taxonomies'); ?></label>
870
- <label><strong>Note: </strong><em><?php _e( "Uncheck all of the above to use the shortcodes below:", $this->hook ); ?></em></label>
871
- <label><?php _e( "Use [printfriendly] inside your page/article or put the following code in your template:", $this->hook ); ?></label>
872
- <textarea id="pf-shortcode" class="code" rows="2" cols="40">&lt;?php if(function_exists('pf_show_link')){echo pf_show_link();} ?&gt;</textarea>
 
 
873
  </div>
874
  </div>
875
-
876
- <!--Section 3 Button Print Options-->
 
 
 
 
 
 
 
 
 
 
877
  <div id="print-options">
878
  <h3><?php _e( "Print PDF Options", $this->hook ); ?></h3>
879
- <label id="pf-favicon" for="favicon">
880
  <?php _e( "Page header", $this->hook ); ?>
881
  <select id="pf-logo" name="<?php echo $this->option_name; ?>[logo]" >
882
  <option value="favicon" <?php selected( $this->options['logo'], 'favicon' ); ?>><?php _e( "My Website Icon", $this->hook ); ?></option>
883
  <option value="upload-an-image" <?php selected( $this->options['logo'], 'upload-an-image' ); ?>><?php _e( "Upload an Image", $this->hook ); ?></option>
884
  </select>
885
  </label>
 
 
 
 
886
  <div class="custom-logo"><label for="Enter_URL">Enter url</label><input id="upload-an-image" type="text" class="regular-text" name="<?php echo $this->option_name; ?>[image_url]" value="<?php $this->val( 'image_url' ); ?>" /><label for="Text__optional_">Text (optional)</label><input id="image-tagline" type="text" class="regular-text" name="<?php echo $this->option_name; ?>[tagline]" value="<?php $this->val( 'tagline' ); ?>" /></div>
887
  <div id="pf-image-error"></div>
888
  <div id="pf-image-preview"></div>
@@ -893,6 +1149,22 @@ if ( ! class_exists( 'PrintFriendly_WordPress' ) ) {
893
  <option value="1" <?php selected( $this->options['click_to_delete'], '1' ); ?>><?php _e( "Not Allow", $this->hook ); ?></option>
894
  </select>
895
  </label>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
896
  <label for="email">
897
  <?php _e( "Email", $this->hook ); ?>
898
  <select name="<?php echo $this->option_name; ?>[email]" id="email">
@@ -917,13 +1189,14 @@ if ( ! class_exists( 'PrintFriendly_WordPress' ) ) {
917
  <label for="custom_css_url">
918
  <?php _e( "Custom css url", $this->hook ); ?>
919
  <input id="custom_css_url" type="text" class="regular-text" name="<?php echo $this->option_name; ?>[custom_css_url]" value="<?php $this->val( 'custom_css_url' ); ?>" />
 
920
  </label>
921
  </div>
922
-
923
- <!--Section 4 WebMaster-->
924
  <h3><?php _e( "Webmaster Settings", $this->hook ); ?></h3>
925
-
926
- <label for="protocol">Website Protocol<br>
927
  <select id="website_protocol" name="<?php echo $this->option_name; ?>[website_protocol]" >
928
  <option value="http" <?php selected( $this->options['website_protocol'], 'http' ); ?>><?php _e( "http (common)", $this->hook ); ?></option>
929
  <option value="https" <?php selected( $this->options['website_protocol'], 'https' ); ?>><?php _e( "https (secure)", $this->hook ); ?></option>
@@ -931,13 +1204,13 @@ if ( ! class_exists( 'PrintFriendly_WordPress' ) ) {
931
  <span id="https-beta-registration" class="description">HTTPS is in Beta. Please <a href="#" onclick="window.open('http://www.printfriendly.com/https-registration.html', 'newwindow', 'width=600, height=550'); return false;">Register for updates</a>.
932
  </span>
933
  </label>
934
- <label for="password-site">Password Protected Content
935
  <select id="password_protected" name="<?php echo $this->option_name; ?>[password_protected]">
936
  <option value="no" <?php selected( $this->options['password_protected'], 'no' ); ?>><?php _e( "No", $this->hook ); ?></option>
937
  <option value="yes" <?php selected( $this->options['password_protected'], 'yes' ); ?>><?php _e( "Yes", $this->hook ); ?></option>
938
  </select>
939
  </label>
940
- <label id="pf-javascript-container">Use JavaScript<br>
941
  <select id="javascript" name="<?php echo $this->option_name; ?>[javascript]>">
942
  <option value="yes" <?php $this->selected( 'javascript', 'yes' ); ?>> <?php _e( "Yes", $this->hook ); ?></option>
943
  <option value="no" <?php $this->selected( 'javascript', 'no' ); ?>> <?php _e( "No", $this->hook ); ?></option>
@@ -949,7 +1222,7 @@ if ( ! class_exists( 'PrintFriendly_WordPress' ) ) {
949
  <?php _e( "Display print preview on PrintFriendly.com (No JavaScript)", $this->hook ); ?>
950
  </span>
951
  </label>
952
-
953
  <p class="submit">
954
  <input type="submit" class="button-primary" value="<?php esc_attr_e( "Save Options", $this->hook ); ?>"/>
955
  <input type="reset" class="button-secondary" value="<?php esc_attr_e( "Cancel", $this->hook ); ?>"/>
@@ -959,7 +1232,7 @@ if ( ! class_exists( 'PrintFriendly_WordPress' ) ) {
959
  <p>
960
  <?php _e( "Like PrintFriendly?", $this->hook ); ?> <a href="http://wordpress.org/extend/plugins/printfriendly/"><?php _e( "Give us a rating", $this->hook ); ?></a>. <?php _e( "Need help or have suggestions?", $this->hook ); ?> <a href="mailto:support@printfriendly.com?subject=Support%20for%20PrintFriendly%20WordPress%20plugin">support@PrintFriendly.com</a>.</p>
961
  </div>
962
-
963
  </form>
964
  </div>
965
  <?php
1
  <?php
2
+
3
  /*
4
  Plugin Name: Print Friendly and PDF
5
  Plugin URI: http://www.printfriendly.com
6
  Description: PrintFriendly & PDF button for your website. Optimizes your pages and brand for print, pdf, and email.
7
  Name and URL are included to ensure repeat visitors and new visitors when printed versions are shared.
8
+ Version: 3.2.5
9
  Author: Print Friendly
10
  Author URI: http://www.PrintFriendly.com
11
 
12
  Changelog :
13
+ 3.2.5 - Added hide images and image style options. Improved input validation. Improved output escaping. Removed printfriendly post_class. Small i8n fix. Few small HTML fixes.
14
+ 3.2.4 - Add printfriendly post_class. Fixed minor JS bug. Added redundancy to uninstall script.
15
+ 3.2.3 - Rolling back to version 3.2.1
16
+ 3.2.2 - Add printfriendly post_class. Add printfriendly button display settings per individual category. Fixed minor JS bug. Added redundancy to uninstall script.
17
  3.2.1 - Improve script loading.
18
  3.2.0 - Important chrome issue fix. Ie syntax error fix.
19
  3.1.9 - Minor css detail.
87
  * Database version, used to allow for easy upgrades to / additions in plugin options between plugin versions.
88
  * @var int
89
  */
90
+ var $db_version = 7;
91
 
92
  /**
93
  * Settings page, used within the plugin to reliably load the plugins admin JS and CSS files only on the admin page.
121
  add_filter( 'the_excerpt', array( &$this, 'show_link' ) );
122
  }
123
 
 
 
 
 
 
124
 
125
+ if ( is_admin() ) {
126
+ // Hook into init for registration of the option and the language files
127
+ add_action( 'admin_init', array( &$this, 'init' ) );
128
 
129
+ // Register the settings page
130
+ add_action( 'admin_menu', array( &$this, 'add_config_page' ) );
131
 
132
+ // Register the contextual help
133
+ add_filter( 'contextual_help', array( &$this, 'contextual_help' ), 10, 2 );
134
 
135
+ // Enqueue the needed scripts and styles
136
+ add_action( 'admin_enqueue_scripts',array( &$this, 'admin_enqueue_scripts' ) );
137
 
138
+ // Register a link to the settings page on the plugins overview page
139
+ add_filter( 'plugin_action_links', array( &$this, 'filter_plugin_actions' ), 10, 2 );
140
+ }
141
  }
142
 
143
  /**
159
  if ( isset( $this->options['enable_css'] ) && $this->options['enable_css'] != 'on' )
160
  return;
161
 
162
+
163
  ?>
164
  <style type="text/css" media="screen">
165
  div.printfriendly {
166
+ margin: <?php echo $this->options['margin_top'].'px '.$this->options['margin_right'].'px '.$this->options['margin_bottom'].'px '.$this->options['margin_left'].'px;'; ?>;
167
  }
168
  div.printfriendly a, div.printfriendly a:link, div.printfriendly a:visited {
169
  text-decoration: none;
210
  <?php
211
  }
212
 
213
+
214
+
215
  /**
216
  * Prints the PrintFriendly JavaScript, in the footer, and loads it asynchronously.
217
  *
237
 
238
  ?>
239
  <script type="text/javascript">
240
+ var pfHeaderImgUrl = '<?php echo esc_js(esc_url_raw($image_url)); ?>';
241
+ var pfHeaderTagline = '<?php echo esc_js($tagline); ?>';
242
+ var pfdisableClickToDel = '<?php echo esc_js($this->options['click_to_delete']); ?>';
243
+ var pfHideImages = '<?php echo esc_js($this->options['hide-images']); ?>';
244
+ var pfImageDisplayStyle = '<?php echo esc_js($this->options['image-style']); ?>';
245
+ var pfDisableEmail = '<?php echo esc_js($this->options['email']); ?>';
246
+ var pfDisablePDF = '<?php echo esc_js($this->options['pdf']); ?>';
247
+ var pfDisablePrint = '<?php echo esc_js($this->options['print']); ?>';
248
+ var pfCustomCSS = '<?php echo esc_js($this->options['custom_css_url']); ?>';
249
 
250
  // PrintFriendly
251
  var e = document.createElement('script'); e.type="text/javascript";
252
+ e.src = '<?php echo esc_js(esc_url_raw($pf_src)); ?>';
253
  document.getElementsByTagName('head')[0].appendChild(e);
254
  </script>
255
  <?php
294
  }
295
  else
296
  {
297
+ if ( (is_page() && ( isset($this->options['show_on_pages']) && 'on' === $this->options['show_on_pages'] ) )
298
+ || (is_home() && ( ( isset($this->options['show_on_homepage']) && 'on' === $this->options['show_on_homepage'] ) && $this->category_included() ) )
299
+ || (is_tax() && ( ( isset($this->options['show_on_taxonomies']) && 'on' === $this->options['show_on_taxonomies'] ) && $this->category_included() ) )
300
+ || (is_category() && ( ( isset($this->options['show_on_categories']) && 'on' === $this->options['show_on_categories'] ) && $this->category_included() ) )
301
+ || (is_single() && ( ( isset($this->options['show_on_posts']) && 'on' === $this->options['show_on_posts'] ) && $this->category_included() ) ) )
302
  {
303
  // Hook the script call now, so it only get's loaded when needed, and need is determined by the user calling pf_button
304
  add_action( 'wp_footer', array( &$this, 'print_script_footer' ) );
317
 
318
  }
319
 
320
+
321
+ /**
322
+ * Filter posts by category.
323
+ *
324
+ * @since 3.2.2
325
+ * @return boolean true if post belongs to category selected for button display
326
+ */
327
+ function category_included() {
328
+ // return ( 'all' === $this->options['category_ids'][0] || in_category($this->options['category_ids']) );
329
+ return true;
330
+ }
331
+
332
  /**
333
  * Register the textdomain and the options array along with the validation function
334
  *
352
  function options_validate( $input ) {
353
  $valid_input = $input;
354
 
355
+ /* Section 1 options */
356
+ if ( !isset( $input['button_type'] ) || !in_array( $input['button_type'], array(
357
+ 'pf-button.gif', 'pf-button-both.gif', 'pf-button-big.gif', // buttongroup1
358
+ 'button-print-grnw20.png', 'button-print-blu20.png', 'button-print-gry20.png', // buttongroup2
359
+ 'pf-icon-small.gif', 'pf-icon-both.gif','pf-icon.gif', 'text-only', // buttongroup3
360
+ 'custom-image', // custom
361
+ 'button-print-whgn20.png', 'pf_button_sq_gry_m.png', 'pf_button_sq_gry_l.png', 'pf_button_sq_grn_m.png',
362
+ 'pf_button_sq_grn_l.png', // backward compatibility
363
+ ) ) )
364
  $valid_input['button_type'] = 'pf-button.gif';
365
 
366
+ // @todo custom image url validation
367
+ if ( !isset( $input['custom_image'] ) || empty( $input['custom_image'] ) )
368
  $valid_input['custom_image'] = '';
369
 
370
+ // @todo validate optional custom text
371
+ if ( !isset( $input['custom_text'] ) ) {
372
+ $valid_input['custom_text'] = 'Print Friendly';
373
+ }
374
+ /* else {
375
 
376
+ }*/
377
+
378
+ // Custom button selected, but no url nor text given, reset button type to default
379
+ if( 'custom-image' === $valid_input['button_type'] && ( '' === $valid_input['custom_image'] && '' === $input['custom_text'] ) ) {
380
+ $valid_input['button_type'] = 'pf-button.gif';
381
+ add_settings_error( $this->option_name, 'invalid_custom_image', __( 'No valid custom image url received, please enter a valid url to use a custom image.', $this->hook ) );
382
+ }
383
 
 
 
384
 
385
  $valid_input['text_size'] = (int) $input['text_size'];
 
386
  if ( !isset($valid_input['text_size']) || 0 == $valid_input['text_size'] ) {
387
  $valid_input['text_size'] = 14;
388
  } else if ( 25 < $valid_input['text_size'] || 9 > $valid_input['text_size'] ) {
389
  $valid_input['text_size'] = 14;
390
+ add_settings_error( $this->option_name, 'invalid_text_size', __( 'The text size you entered is invalid, please stay between 9px and 25px', $this->hook ) );
391
  }
392
 
393
  if ( !isset( $input['text_color'] )) {
397
  $valid_input['text_color'] = $this->options['text_color'];
398
  add_settings_error( $this->option_name, 'invalid_color', __( 'The color you entered is not valid, it must be a valid hexadecimal RGB font color.', $this->hook ) );
399
  }
400
+
401
+
402
+
403
+ /* Section 2 options */
404
+ if ( !isset( $input['enable_css'] ) || 'off' !== $input['enable_css'] )
405
+ $valid_input['enable_css'] = 'on';
406
+
407
+ if ( !isset( $input['content_position'] ) || !in_array( $input['content_position'], array( 'none', 'left', 'center', 'right' ) ) )
408
+ $valid_input['content_position'] = 'left';
409
+
410
+ if ( !isset( $input['content_placement'] ) || !in_array( $input['content_placement'], array( 'before', 'after' ) ) )
411
+ $valid_input['content_placement'] = 'after';
412
+
413
+ foreach ( array( 'margin_top', 'margin_right', 'margin_bottom', 'margin_left' ) as $opt )
414
+ $valid_input[$opt] = (int) $input[$opt];
415
+
416
+ unset( $opt );
417
+
418
+
419
+ /* Section 3 options */
420
+ foreach ( array( 'show_on_posts', 'show_on_pages', 'show_on_homepage', 'show_on_categories', 'show_on_taxonomies' ) as $opt ) {
421
+ if ( !isset( $input[$opt] ) || 'on' !== $input[$opt] ) {
422
+ unset( $valid_input[$opt] );
423
+ }
424
+ }
425
+ unset( $opt );
426
+
427
+ // Just in case
428
+ if( isset( $input['show_on_template'] ) )
429
+ unset( $valid_input['show_on_template'] );
430
+
431
+
432
+ if( isset( $input['category_ids'] ) ) {
433
+ /**
434
+ * Validate received category ids:
435
+ * - Is there only one array item and does it contain the string text 'all' ? => pass
436
+ * - Otherwise, make sure the ids are integer values
437
+ */
438
+ /* $valid_input['category_ids'] = explode(',', $input['category_ids']);
439
+ $valid_input['category_ids'] = array_map( 'trim', $valid_input['category_ids'] );
440
+ if( ( count( $valid_input['category_ids'] ) === 1 && 'all' === $valid_input['category_ids'][0] ) === false ) {
441
+ foreach( $valid_input['category_ids'] as $k => $v ) {
442
+ if( $v !== '' && ( ctype_digit( (string) $v ) === true && ( intval( $v ) == $v ) ) ) {
443
+ $valid_input['category_ids'][$k] = intval( $v );
444
+ }
445
+ else {
446
+ // Invalid input - Show error message ?
447
+ unset( $valid_input['category_ids'][$k] );
448
+ }
449
+ }
450
+ }*/
451
+ unset( $valid_input['category_ids'] );
452
+ }
453
+
454
+ //echo '<pre>'.print_r($input,1).'</pre>';
455
+ //die;
456
+
457
+
458
+
459
+ /* Section 4 options */
460
+ if ( !isset( $input['logo'] ) || !in_array( $input['logo'], array( 'favicon', 'upload-an-image' ) ) )
461
+ $valid_input['logo'] = 'favicon';
462
+
463
+ // @todo custom logo url validation
464
+ if ( !isset( $input['image_url'] ) || empty( $input['image_url'] ) )
465
+ $valid_input['image_url'] = '';
466
+
467
+ // @todo validate optional tagline text
468
+ if ( !isset( $input['tagline'] ) ) {
469
+ $valid_input['tagline'] = '';
470
+ }
471
+ /* else {
472
+
473
+ }*/
474
+
475
+ // Custom logo selected, but no valid url given, reset logo to default
476
+ if( 'upload-an-image' === $valid_input['logo'] && '' === $valid_input['image_url'] ) {
477
+ $valid_input['logo'] = 'favicon';
478
+ add_settings_error( $this->option_name, 'invalid_custom_logo', __( 'No valid custom logo url received, please enter a valid url to use a custom logo.', $this->hook ) );
479
+ }
480
+
481
+
482
+ if ( !isset( $input['image-style'] ) || !in_array( $input['image-style'], array( 'right', 'left', 'none', 'block' ) ) )
483
+ $valid_input['image-style'] = 'right';
484
 
485
+
486
+ foreach( array( 'click_to_delete', 'hide-images', 'email', 'pdf', 'print', ) as $opt ) {
487
+ if( !isset( $input[$opt] ) || !in_array( $input[$opt], array( '0', '1' ) ) ) {
488
+ $valid_input[$opt] = '0';
489
+ }
490
+ }
491
+ unset( $opt );
492
+
493
+
494
+ // @todo custom css url validation
495
+ if ( !isset( $input['custom_css_url'] ) || empty( $input['custom_css_url'] ) )
496
+ $valid_input['custom_css_url'] = '';
497
+
498
+
499
+
500
+ /* Section 5 options */
501
+ if ( !isset( $input['website_protocol'] ) || !in_array( $input['website_protocol'], array( 'http', 'https' ) ) )
502
+ $valid_input['website_protocol'] = 'http';
503
+
504
+ if ( !isset( $input['password_protected'] ) || !in_array( $input['password_protected'], array( 'no', 'yes' ) ) )
505
+ $valid_input['password_protected'] = 'no';
506
+
507
+ if ( !isset( $input['javascript'] ) || !in_array( $input['javascript'], array( 'no', 'yes' ) ) )
508
+ $valid_input['javascript'] = 'yes';
509
+
510
+
511
+
512
+ /* Database version */
513
  $valid_input['db_version'] = $this->db_version;
514
 
515
  return $valid_input;
522
  */
523
  function add_config_page() {
524
  $this->settings_page = add_options_page( __( 'PrintFriendly Options', $this->hook ), __( 'Print Friendly & PDF', $this->hook ), 'manage_options', $this->hook, array( &$this, 'config_page' ) );
525
+
526
+ //register callback gets call prior your own page gets rendered
527
+ add_action('load-'.$this->settings_page, array(&$this, 'on_load_printfriendly'));
528
  }
529
 
530
  /**
535
  function contextual_help( $contextual_help, $screen_id ) {
536
  if ( $this->settings_page == $screen_id ) {
537
  $contextual_help = '<strong>'.__( "Need Help?", $this->hook ).'</strong><br/>'
538
+ .sprintf( __( "Be sure to check out the %s!", $this->hook), '<a href="http://wordpress.org/extend/plugins/printfriendly/faq/">'.__( "Frequently Asked Questions", $this->hook ).'</a>' );
539
  }
540
  return $contextual_help;
541
  }
548
  */
549
  function admin_enqueue_scripts( $screen_id ) {
550
  if ( $this->settings_page == $screen_id ) {
551
+ $ver = '3.2.5';
552
  wp_register_script( 'pf-color-picker', plugins_url( 'colorpicker.js', __FILE__ ), array( 'jquery', 'media-upload' ), $ver );
553
  wp_register_script( 'pf-admin-js', plugins_url( 'admin.js', __FILE__ ), array( 'jquery', 'media-upload' ), $ver );
554
 
555
  wp_enqueue_script( 'pf-color-picker' );
556
  wp_enqueue_script( 'pf-admin-js' );
557
 
558
+
559
  wp_enqueue_style( 'printfriendly-admin-css', plugins_url( 'admin.css', __FILE__ ), array(), $ver);
560
  }
561
  }
606
  'image_url' => '',
607
  'tagline' => '',
608
  'click_to_delete' => '0', // 0 - allow, 1 - do not allow
609
+ 'hide-images' => '0', // 0 - show images, 1 - hide images
610
+ 'image-style' => 'right', // 'right', 'left', 'none', 'block'
611
  'email' => '0', // 0 - allow, 1 - do not allow
612
  'pdf' => '0', // 0 - allow, 1 - do not allow
613
  'print' => '0', // 0 - allow, 1 - do not allow
615
  'password_protected' => 'no',
616
  'javascript' => 'yes',
617
  'custom_css_url' => '',
618
+ // 'category_ids' => array('all'),
619
  );
620
 
621
  // Check whether the old badly named singular options are there, if so, use the data and delete them.
669
  // check whether image we do not list any more was used
670
  if(in_array($this->options['button_type'], array('button-print-whgn20.png', 'pf_button_sq_qry_m.png', 'pf_button_sq_qry_l.png', 'pf_button_sq_grn_m.png', 'pf_button_sq_grn_l.png'))) {
671
  // previous version had a bug with button name
672
+ if(in_array($this->options['button_type'], array('pf_button_sq_qry_m.png', 'pf_button_sq_qry_l.png')))
673
  $this->options['button_type'] = str_replace('qry', 'gry', $this->options['button_type']);
674
 
675
  $image_address = '//cdn.printfriendly.com/'.$this->options['button_type'];
728
  $this->options = array_merge($this->options, $additional_options);
729
  }
730
 
731
+ // update options to version 6
732
+ // Replacement for db version 5 - should also be run for those already upgraded
733
+ if($this->options['db_version'] < 6) {
734
+
735
+ /* $additional_options = array(
736
+ 'category_ids' => array(),
737
+ );
738
+
739
+ if( !isset( $this->options['category_ids'] ) || ( isset( $this->options['category_ids'] ) && 0 === count( $this->options['category_ids'] ) ) ) {
740
+ $additional_options['category_ids'][] = 'all';
741
+ }
742
+
743
+ $this->options = array_merge($this->options, $additional_options);
744
+ */
745
+ unset($this->options['category_ids']);
746
+ }
747
+
748
+
749
+ if($this->options['db_version'] < 7) {
750
+
751
+ $additional_options = array(
752
+ 'hide-images' => '0',
753
+ 'image-style' => 'right',
754
+ );
755
+
756
+ $this->options = array_merge($this->options, $additional_options);
757
+ }
758
  $this->options['db_version'] = $this->db_version;
759
  update_option( $this->option_name, $this->options );
760
  }
795
 
796
  switch($name){
797
  case "custom-image":
798
+ if( '' == trim($this->options['custom_image']) )
799
  $return = '';
800
  else
801
  $return = '<img src="'.$this->options['custom_image'].'" alt="Print Friendly" />';
881
  * @param string $name string used for various parts of checkbox
882
  *
883
  */
884
+ function create_checkbox($name, $label='', $labelid='' ) {
885
+ $label = ( !empty( $label) ? $label : __( ucfirst($name), $this->hook ) );
886
+ echo '<label' . ( !empty( $labelid ) ? ' id=' . $labelid : '' ) . '><input type="checkbox" class="show_list" name="' . $this->option_name . '[show_on_' . $name . ']" value="on" ';
887
  $this->checked( 'show_on_' . $name, 'on');
888
+ echo ' />' . $label . "</label>\r\n";
 
889
  }
890
 
891
 
901
  isset($this->options['show_on_pages']) ||
902
  isset($this->options['show_on_homepage']) ||
903
  isset($this->options['show_on_categories']) ||
904
+ // (isset($this->options['category_ids']) && count($this->options['category_ids']) > 0) ||
905
  isset($this->options['show_on_taxonomies']));
906
  }
907
 
921
  return selected ($this->options[$val], $check_against);
922
  }
923
 
924
+ /**
925
+ * For use with page metabox.
926
+ *
927
+ * @since 3.2.2
928
+ */
929
+ function get_page_post_type() {
930
+ $post_types = get_post_types( array( 'name' => 'page' ), 'object' );
931
+ //echo '<pre>'.print_r($post_types,1).'</pre>';
932
+ //die;
933
+
934
+ return $post_types['page'];
935
+ }
936
+
937
+
938
+ /**
939
+ * Helper that checks if wp versions is above 3.0.
940
+ *
941
+ * @since 3.2.2
942
+ * @return boolean true wp version is above 3.0
943
+ *
944
+ */
945
+ function wp_version_gt30() {
946
+ global $wp_version;
947
+ return version_compare($wp_version, '3.0', '>=');
948
+ }
949
+
950
+
951
+ /**
952
+ * Create box for picking individual categories.
953
+ *
954
+ * @since 3.2.2
955
+ */
956
+ function create_category_metabox() {
957
+ $obj = new stdClass();
958
+ $obj->ID = 0;
959
+ do_meta_boxes('settings_page_' . $this->hook, 'normal', $obj);
960
+ }
961
+
962
+
963
+ /**
964
+ * Load metaboxes advanced button display settings.
965
+ *
966
+ * @since 3.2.2
967
+ */
968
+ function on_load_printfriendly() {
969
+ global $wp_version;
970
+ if($this->wp_version_gt30()) {
971
+ require_once('includes/meta-boxes.php');
972
+ //require_once('includes/nav-menu.php');
973
+ wp_enqueue_script('post');
974
+
975
+ add_meta_box('categorydiv', __('Only display when post is in:'), 'post_categories_meta_box', 'settings_page_'. $this->hook, 'normal', 'core');
976
+ }
977
+ }
978
+
979
  /**
980
  * Output the config page
981
  *
985
 
986
  // Since WP 3.2 outputs these errors by default, only display them when we're on versions older than 3.2 that do support the settings errors.
987
  global $wp_version;
988
+ if(version_compare($wp_version, '3.2', '<' ) && $this->wp_version_gt30() )
989
  settings_errors();
990
 
991
  // Show the content of the options array when debug is enabled
993
  echo '<pre>Options:<br><br>' . print_r( $this->options, 1 ) . '</pre>';
994
  ?>
995
  <div id="pf_settings" class="wrap">
996
+
997
  <div class="icon32" id="printfriendly"></div>
998
  <h2><?php _e( 'Print Friendly & PDF Settings', $this->hook ); ?></h2>
999
+
1000
  <form action="options.php" method="post">
1001
  <?php settings_fields( $this->option_name ); ?>
1002
+
1003
  <h3><?php _e( "Pick Your Button Style", $this->hook ); ?></h3>
1004
+
1005
  <fieldset id="button-style">
1006
  <div id="buttongroup1">
1007
  <?php $this->radio('pf-button.gif'); ?>
1054
  </div>
1055
  </fieldset>
1056
  <br class="clear">
1057
+
1058
+ <!--Section 2 Button Positioning-->
1059
+ <div id="button-positioning">
1060
+ <h3><?php _e( "Button Positioning", $this->hook ); ?>
1061
  <span id="css"><input type="checkbox" name="<?php echo $this->option_name; ?>[enable_css]" value="<?php $this->val('enable_css');?>" <?php $this->checked('enable_css', 'off'); ?> />Do not use CSS for button styles</span>
1062
  </h3>
1063
+ <div id="button-positioning-options">
1064
  <div id="alignment">
1065
+ <label<?php /*for="pf_content_position"*/ ?>>
1066
  <select id="pf_content_position" name="<?php echo $this->option_name; ?>[content_position]" >
1067
  <option value="left" <?php selected( $this->options['content_position'], 'left' ); ?>><?php _e( "Left Align", $this->hook ); ?></option>
1068
  <option value="right" <?php selected( $this->options['content_position'], 'right' ); ?>><?php _e( "Right Align", $this->hook ); ?></option>
1072
  </label>
1073
  </div>
1074
  <div class="content_placement">
1075
+ <label<?php /* for="pf_content_placement"*/ ?>>
1076
  <select id="pf_content_placement" name="<?php echo $this->option_name; ?>[content_placement]" >
1077
  <option value="before" <?php selected( $this->options['content_placement'], 'before' ); ?>><?php _e( "Above Content", $this->hook ); ?></option>
1078
  <option value="after" <?php selected( $this->options['content_placement'], 'after' ); ?>><?php _e( "Below Content", $this->hook ); ?></option>
1080
  </label>
1081
  </div>
1082
  <div id="margin">
1083
+ <label for="pf-margin_left">
1084
+ <input type="number" name="<?php echo $this->option_name; ?>[margin_left]" id="pf-margin_left" value="<?php $this->val( 'margin_left' ); ?>" maxlength="3"/>
1085
  <?php _e( "Margin Left", $this->hook ); ?>
1086
  </label>
1087
+ <label for="pf-margin_right">
1088
+ <input type="number" name="<?php echo $this->option_name; ?>[margin_right]" id="pf-margin_right" value="<?php $this->val( 'margin_right' ); ?>"/> <?php _e( "Margin Right", $this->hook ); ?>
1089
  </label>
1090
+ <label for="pf-margin_top">
1091
+ <input type="number" name="<?php echo $this->option_name; ?>[margin_top]" id="pf-margin_top" value="<?php $this->val( 'margin_top' ); ?>" maxlength="3"/> <?php _e( "Margin Top", $this->hook ); ?>
1092
  </label>
1093
+ <label for="pf-margin_bottom">
1094
+ <input type="number" name="<?php echo $this->option_name; ?>[margin_bottom]" id="pf-margin_bottom" value="<?php $this->val( 'margin_bottom' ); ?>" maxlength="3"/> <?php _e( "Margin Bottom", $this->hook ); ?>
1095
  </label>
1096
  </div>
1097
  </div>
1098
+ </div>
1099
+ <br class="clear">
1100
+
1101
+ <!--Section 3 Button Placement-->
1102
+ <div id="button-placement">
1103
+ <h3><?php _e( "Display button on:", $this->hook ); ?></h3>
1104
  <div id="pages">
1105
+ <?php $this->create_checkbox('posts', __( 'Posts', $this->hook )); ?>
1106
+ <?php $this->create_checkbox('pages', __( 'Pages', $this->hook )); ?>
1107
+ <?php $this->create_checkbox('homepage', __( 'Homepage', $this->hook )); ?>
1108
+ <?php $this->create_checkbox('categories', __( 'Category Pages', $this->hook )); ?>
1109
+ <?php $this->create_checkbox('taxonomies', __( 'Taxonomy Pages', $this->hook )); ?>
1110
+ <label for="show_on_template"><input type="checkbox" class="show_template" name="show_on_template" id="show_on_template" /><?php echo _e( 'Add direct to template', $this->hook ); ?></label>
1111
+ <textarea id="pf-shortcode" class="code" rows="2" cols="40">&lt;?php if(function_exists('pf_show_link')){echo pf_show_link();} ?&gt;</textarea>
1112
+ <label<?php /* for="pf-shortcode2"*/ ?>><?php _e( "or use shortcode inside your page/article", $this->hook ); ?></label>
1113
+ <textarea<?php /* id="pf-shortcode2"*/ ?> class="code" rows="2" cols="40">[printfriendly]</textarea>
1114
+ <?php /* <input type="hidden" name="<? php echo $this->option_name; ?>[category_ids]" id="category_ids" value="<?php echo implode(',', $this->options['category_ids']); ? >" /> */ ?>
1115
  </div>
1116
  </div>
1117
+ <?php /*if($this->wp_version_gt30()) { ? >
1118
+ <div id="pf-categories">
1119
+ <h4><?php printf( __( '<a %s>Additional filter</a>', $this->hook), ' href="javascript:void(0)" id="toggle-categories"' ); ?></h4>
1120
+ <div id="pf-categories-metabox">
1121
+ <?php $this->create_category_metabox(); ?>
1122
+ </div>
1123
+ </div>
1124
+ <? php } */ ?>
1125
+
1126
+ <br class="clear">
1127
+
1128
+ <!--Section 4 Button Print Options-->
1129
  <div id="print-options">
1130
  <h3><?php _e( "Print PDF Options", $this->hook ); ?></h3>
1131
+ <label id="pf-favicon" for="favicon"<?php /*for="pf-logo"*/ ?>>
1132
  <?php _e( "Page header", $this->hook ); ?>
1133
  <select id="pf-logo" name="<?php echo $this->option_name; ?>[logo]" >
1134
  <option value="favicon" <?php selected( $this->options['logo'], 'favicon' ); ?>><?php _e( "My Website Icon", $this->hook ); ?></option>
1135
  <option value="upload-an-image" <?php selected( $this->options['logo'], 'upload-an-image' ); ?>><?php _e( "Upload an Image", $this->hook ); ?></option>
1136
  </select>
1137
  </label>
1138
+ <?php /* <div class="custom-logo">
1139
+ <label for="upload-an-image"><?php _e( "Enter url", $this->hook ); ?></label><input id="upload-an-image" type="text" class="regular-text" name="<?php echo $this->option_name; ?>[image_url]" value="<?php $this->val( 'image_url' ); ?>" />
1140
+ <label for="image-tagline"><?php _e( "Text (optional)", $this->hook ); ?></label><input id="image-tagline" type="text" class="regular-text" name="<?php echo $this->option_name; ?>[tagline]" value="<?php $this->val( 'tagline' ); ?>" />
1141
+ </div> */ ?>
1142
  <div class="custom-logo"><label for="Enter_URL">Enter url</label><input id="upload-an-image" type="text" class="regular-text" name="<?php echo $this->option_name; ?>[image_url]" value="<?php $this->val( 'image_url' ); ?>" /><label for="Text__optional_">Text (optional)</label><input id="image-tagline" type="text" class="regular-text" name="<?php echo $this->option_name; ?>[tagline]" value="<?php $this->val( 'tagline' ); ?>" /></div>
1143
  <div id="pf-image-error"></div>
1144
  <div id="pf-image-preview"></div>
1149
  <option value="1" <?php selected( $this->options['click_to_delete'], '1' ); ?>><?php _e( "Not Allow", $this->hook ); ?></option>
1150
  </select>
1151
  </label>
1152
+ <label for="hide-images">
1153
+ <?php _e( "Images", $this->hook ); ?>
1154
+ <select name="<?php echo $this->option_name; ?>[hide-images]" id="hide-images">
1155
+ <option value="0" <?php selected( $this->options['hide-images'], '0' ); ?>><?php _e( "Include", $this->hook ); ?></option>
1156
+ <option value="1" <?php selected( $this->options['hide-images'], '1' ); ?>><?php _e( "Exclude", $this->hook ); ?></option>
1157
+ </select>
1158
+ </label>
1159
+ <label for="image-style">
1160
+ <?php _e( "Image style", $this->hook ); ?>
1161
+ <select name="<?php echo $this->option_name; ?>[image-style]" id="image-style">
1162
+ <option value="right" <?php selected( $this->options['image-style'], 'right' ); ?>><?php _e( "Align Right", $this->hook ); ?></option>
1163
+ <option value="left" <?php selected( $this->options['image-style'], 'left' ); ?>><?php _e( "Align Left", $this->hook ); ?></option>
1164
+ <option value="none" <?php selected( $this->options['image-style'], 'none' ); ?>><?php _e( "Align None", $this->hook ); ?></option>
1165
+ <option value="block" <?php selected( $this->options['image-style'], 'block' ); ?>><?php _e( "Center/Block", $this->hook ); ?></option>
1166
+ </select>
1167
+ </label>
1168
  <label for="email">
1169
  <?php _e( "Email", $this->hook ); ?>
1170
  <select name="<?php echo $this->option_name; ?>[email]" id="email">
1189
  <label for="custom_css_url">
1190
  <?php _e( "Custom css url", $this->hook ); ?>
1191
  <input id="custom_css_url" type="text" class="regular-text" name="<?php echo $this->option_name; ?>[custom_css_url]" value="<?php $this->val( 'custom_css_url' ); ?>" />
1192
+ <span class="description pf-help-link"><a target="_howto" href="http://support.printfriendly.com/customer/portal/articles/895256-custom-css-styles"><?php _e( '?', $this->hook ); ?></a></span>
1193
  </label>
1194
  </div>
1195
+
1196
+ <!--Section 5 WebMaster-->
1197
  <h3><?php _e( "Webmaster Settings", $this->hook ); ?></h3>
1198
+
1199
+ <label for="protocol"<?php /* for="website_protocol"*/ ?>>Website Protocol<br>
1200
  <select id="website_protocol" name="<?php echo $this->option_name; ?>[website_protocol]" >
1201
  <option value="http" <?php selected( $this->options['website_protocol'], 'http' ); ?>><?php _e( "http (common)", $this->hook ); ?></option>
1202
  <option value="https" <?php selected( $this->options['website_protocol'], 'https' ); ?>><?php _e( "https (secure)", $this->hook ); ?></option>
1204
  <span id="https-beta-registration" class="description">HTTPS is in Beta. Please <a href="#" onclick="window.open('http://www.printfriendly.com/https-registration.html', 'newwindow', 'width=600, height=550'); return false;">Register for updates</a>.
1205
  </span>
1206
  </label>
1207
+ <label for="password-site"<?php /*for="password_protected"*/ ?>>Password Protected Content
1208
  <select id="password_protected" name="<?php echo $this->option_name; ?>[password_protected]">
1209
  <option value="no" <?php selected( $this->options['password_protected'], 'no' ); ?>><?php _e( "No", $this->hook ); ?></option>
1210
  <option value="yes" <?php selected( $this->options['password_protected'], 'yes' ); ?>><?php _e( "Yes", $this->hook ); ?></option>
1211
  </select>
1212
  </label>
1213
+ <label id="pf-javascript-container" <?php /*for="javascript"*/ ?>>Use JavaScript<br>
1214
  <select id="javascript" name="<?php echo $this->option_name; ?>[javascript]>">
1215
  <option value="yes" <?php $this->selected( 'javascript', 'yes' ); ?>> <?php _e( "Yes", $this->hook ); ?></option>
1216
  <option value="no" <?php $this->selected( 'javascript', 'no' ); ?>> <?php _e( "No", $this->hook ); ?></option>
1222
  <?php _e( "Display print preview on PrintFriendly.com (No JavaScript)", $this->hook ); ?>
1223
  </span>
1224
  </label>
1225
+
1226
  <p class="submit">
1227
  <input type="submit" class="button-primary" value="<?php esc_attr_e( "Save Options", $this->hook ); ?>"/>
1228
  <input type="reset" class="button-secondary" value="<?php esc_attr_e( "Cancel", $this->hook ); ?>"/>
1232
  <p>
1233
  <?php _e( "Like PrintFriendly?", $this->hook ); ?> <a href="http://wordpress.org/extend/plugins/printfriendly/"><?php _e( "Give us a rating", $this->hook ); ?></a>. <?php _e( "Need help or have suggestions?", $this->hook ); ?> <a href="mailto:support@printfriendly.com?subject=Support%20for%20PrintFriendly%20WordPress%20plugin">support@PrintFriendly.com</a>.</p>
1234
  </div>
1235
+
1236
  </form>
1237
  </div>
1238
  <?php
readme.txt CHANGED
@@ -1,9 +1,9 @@
1
  === Print Friendly and PDF Button===
2
- Contributors: printfriendly,joostdevalk
3
  Tags: print, pdf, printer, printing, printable, widget, plugin
4
  Requires at least: 2.8
5
- Tested up to: 3.5
6
- Stable tag: 3.2.1
7
 
8
  The #1 Print and PDF button for your WordPress site. Printer Friendly pages without coding, css, or print.css. Fast, easy, and professional.
9
 
@@ -98,6 +98,29 @@ If you have any other issues with the plugin or the PrintFriendly widget, please
98
 
99
  == Changelog ==
100
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
101
 
102
  = 3.2.1 =
103
 
1
  === Print Friendly and PDF Button===
2
+ Contributors: printfriendly,joostdevalk, jrf
3
  Tags: print, pdf, printer, printing, printable, widget, plugin
4
  Requires at least: 2.8
5
+ Tested up to: 3.5.1
6
+ Stable tag: 3.2.5
7
 
8
  The #1 Print and PDF button for your WordPress site. Printer Friendly pages without coding, css, or print.css. Fast, easy, and professional.
9
 
98
 
99
  == Changelog ==
100
 
101
+ = 3.2.5 =
102
+ * New! Image alignment option for Print and PDF pages.
103
+ * New! Select to not show images by default in the Print and PDF.
104
+ * Improved input validation.
105
+ * Improved output escaping.
106
+ * Removed printfriendly post_class.
107
+ * Small i8n fix.
108
+ * Few small HTML fixes.
109
+
110
+ = 3.2.4 =
111
+ * Add printfriendly post_class.
112
+ * Fixed minor JS bug.
113
+ * Added redundancy to uninstall script.
114
+
115
+ = 3.2.3 =
116
+ * Rolling back to version 3.2.1
117
+
118
+ = 3.2.2 =
119
+
120
+ * Add printfriendly post_class.
121
+ * Add printfriendly button display settings per individual category.
122
+ * Fixed minor JS bug.
123
+ * Added redundancy to uninstall script.
124
 
125
  = 3.2.1 =
126
 
screenshot-2.png CHANGED
Binary file
uninstall.php CHANGED
@@ -1,6 +1,21 @@
1
- <?php
2
 
3
  if( !defined( 'ABSPATH' ) && !defined( 'WP_UNINSTALL_PLUGIN' ) )
4
  exit();
5
 
6
- delete_option( 'printfriendly_option' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
 
3
  if( !defined( 'ABSPATH' ) && !defined( 'WP_UNINSTALL_PLUGIN' ) )
4
  exit();
5
 
6
+ delete_option( 'printfriendly_option' );
7
+
8
+ // Make sure any old options which may still lurking about get deleted as well
9
+ delete_option( 'pf_button_type' );
10
+ delete_option( 'pf_custom_image' );
11
+ delete_option( 'pf_custom_text' );
12
+ delete_option( 'pf_custom_both' );
13
+ delete_option( 'pf_show_list' );
14
+ delete_option( 'pf_content_placement' );
15
+ delete_option( 'pf_content_position' );
16
+ delete_option( 'pf_margin_top' );
17
+ delete_option( 'pf_margin_right' );
18
+ delete_option( 'pf_margin_bottom' );
19
+ delete_option( 'pf_margin_left' );
20
+ delete_option( 'pf_text_color' );
21
+ delete_option( 'pf_text_size' );