PluginProbe
Print, PDF & Email by PrintFriendly / 5.5.13
Print, PDF & Email by PrintFriendly v5.5.13
5.5.13 5.5.12 5.5.11 trunk 0.2 0.9 1.0 2.0 2.1.8 3.0 3.0.9 3.1.6 3.10.0 3.11.0 3.11.1 3.11.2 3.12.0 3.12.1 3.12.2 3.12.3 3.12.4 3.12.5 3.13.0 3.14.0 3.14.1 All 95 releases
printfriendly / views / tabs.php

tabs.php in Print, PDF & Email by PrintFriendly 5.5.13, at views/tabs.php

692 lines 52.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 if (! defined('ABSPATH')) {
3 exit;
4 }
5 // phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- This template is included from PrintFriendly_WordPress::config_page(); its top-level variables are function-scoped, not global.
6 ?>
7 <div id="pf-tabs">
8 <div class="pf-bu-tabs pf-bu-is-centered">
9 <ul>
10 <li class="<?php echo $this->is_tab(0) ? 'pf-bu-is-active' : ''; ?>" data-id="0"><a href="#tab-standard"><?php esc_html_e('Standard', 'printfriendly'); ?></a></li>
11 <li class="<?php echo $this->is_tab(1) ? 'pf-bu-is-active' : ''; ?>" data-id="1"><a href="#tab-advanced"><?php esc_html_e('Advanced', 'printfriendly'); ?></a></li>
12 <?php if (WP_DEBUG) { ?>
13 <li><a href="#tab-debug"><?php esc_html_e('Debug', 'printfriendly'); ?></a></li>
14 <?php } ?>
15 </ul>
16 </div>
17
18 <section id="tab-standard">
19 <div class="pf-bu-container">
20
21 <?php if ($this->pro_card) { ?>
22 <?php $this->pro_card->render(); ?>
23 <?php } else { ?>
24 <?php include_once PRINTFRIENDLY_BASEPATH . '/views/pro.php'; ?>
25 <?php } ?>
26
27 <div class="pf-bu-block pf-bu-card">
28 <header class="pf-bu-card-header">
29 <p class="pf-bu-card-header-title">
30 <?php esc_html_e('Select content using', 'printfriendly'); ?>
31 </p>
32 </header>
33
34 <div class="pf-bu-card-content">
35 <?php
36 $pf_disabled = $pf_message = '';
37 if (class_exists('WooCommerce')) {
38 $pf_disabled = 'disabled';
39 $pf_message = '(' . __('Not available for WooCommerce', 'printfriendly') . ')';
40 }
41 ?>
42
43 <div>
44 <div>
45 <label for="pf-algo-wp">
46 <input id="pf-algo-wp" type="radio" name="<?php echo esc_attr($this->option_name); ?>[pf_algo]" value="wp" <?php echo $this->options['pf_algo'] === 'wp' ? 'checked' : ''; ?> <?php echo esc_attr($pf_disabled); ?>>
47 <?php esc_html_e('WP Template', 'printfriendly'); ?> <?php echo esc_html($pf_message); ?>
48 </label>
49 </div>
50
51 <div>
52 <label for="pf-algo-pf">
53 <input id="pf-algo-pf" type="radio" name="<?php echo esc_attr($this->option_name); ?>[pf_algo]" value="pf" <?php echo $this->options['pf_algo'] === 'pf' ? 'checked' : ''; ?>>
54 <?php esc_html_e('Content Algorithm', 'printfriendly'); ?>
55 </label>
56 </div>
57
58 <div>
59 <label for="pf-algo-css">
60 <input id="pf-algo-css" type="radio" name="<?php echo esc_attr($this->option_name); ?>[pf_algo]" value="css" <?php echo $this->options['pf_algo'] === 'css' ? 'checked' : ''; ?>>
61 <?php esc_html_e('Custom CSS Selectors', 'printfriendly'); ?>
62 </label>
63 <div class="pf-algo-usage pf-algo-usage-css" style="display: none" data-tag-template="<?php echo esc_attr('<printfriendly-options data-selectors="#1" data-fallback-strategy="#2"></printfriendly-options>'); ?>">
64 <div class="pf-bu-columns">
65 <div class="pf-bu-column pf-bu-one-sixth pf-algo-usage-css-fields">
66 <div>
67 <label for="pf-algo-usage-css-author"><?php esc_html_e('Author Selector', 'printfriendly'); ?></label>
68 <input type="text" id="pf-algo-usage-css-author" name="<?php echo esc_attr($this->option_name); ?>[css-author]" value="<?php $this->echoVal('css-author'); ?>" data-selector-name="authorSelector">
69 </div>
70 <div>
71 <label for="pf-algo-usage-css-content"><?php esc_html_e('Content Selector', 'printfriendly'); ?></label>
72 <input type="text" id="pf-algo-usage-css-content" name="<?php echo esc_attr($this->option_name); ?>[css-content]" value="<?php $this->echoVal('css-content'); ?>" data-selector-name="contentSelectors">
73 </div>
74 <div>
75 <label for="pf-algo-usage-css-date"><?php esc_html_e('Date Selector', 'printfriendly'); ?></label>
76 <input type="text" id="pf-algo-usage-css-date" name="<?php echo esc_attr($this->option_name); ?>[css-date]" value="<?php $this->echoVal('css-date'); ?>" data-selector-name="dateSelector">
77 </div>
78 <div>
79 <label for="pf-algo-usage-css-title"><?php esc_html_e('Title Selector', 'printfriendly'); ?></label>
80 <input type="text" id="pf-algo-usage-css-title" name="<?php echo esc_attr($this->option_name); ?>[css-title]" value="<?php $this->echoVal('css-title'); ?>" data-selector-name="titleSelector">
81 </div>
82 <div>
83 <label for="pf-algo-usage-css-image"><?php esc_html_e('Image Selector', 'printfriendly'); ?></label>
84 <input type="text" id="pf-algo-usage-css-image" name="<?php echo esc_attr($this->option_name); ?>[css-primaryImage]" value="<?php $this->echoVal('css-primaryImage'); ?>" data-selector-name="primaryImageSelector">
85 </div>
86 </div>
87 <div class="pf-bu-column pf-bu-one-sixth pf-algo-usage-css-strategy">
88 <?php $pf_css_fallback = $this->getVal('pf_algo_css_content', 'original'); ?>
89 <label><?php esc_html_e('Content Fallback Strategy', 'printfriendly'); ?></label>
90 <label>
91 <input type="radio" id="pf_algo_css_fallback_original" name="<?php echo esc_attr($this->option_name); ?>[pf_algo_css_content]" value="original" <?php echo ( empty($pf_css_fallback) || $pf_css_fallback === 'original' ) ? 'checked' : ''; ?>>
92 <?php esc_html_e('Use existing rules to find content', 'printfriendly'); ?>
93 </label>
94 <label>
95 <input type="radio" id="pf_algo_css_fallback_error" name="<?php echo esc_attr($this->option_name); ?>[pf_algo_css_content]" value="error-message" <?php echo $pf_css_fallback === 'error-message' ? 'checked' : ''; ?>>
96 <?php esc_html_e('Show an error message', 'printfriendly'); ?>
97 </label>
98 <p class="description">
99 <?php esc_html_e('This setting can be used to configure the behaviour of the plugin, when content CSS selector does not match any content.', 'printfriendly'); ?>
100 <br/>
101 <?php esc_html_e('We recommend setting this to "Use existing rules to find content" in production and to "Show an error message" in development.', 'printfriendly'); ?></p>
102 <div class="pf-bu-mt-5"></div>
103 <div class="pf-accordion">
104 <label><?php esc_html_e('Show Options Code', 'printfriendly'); ?></label>
105 <div>
106 <code class="pf-custom-css-code"><?php echo esc_html($customCssOptionCode); ?></code>
107 <a class="pf-clipboard pf-custom-css-code-snippet" href="javascript:;" data-clipboard-text="<?php echo esc_attr($customCssOptionCode); ?>"><span class="pf-bu-tag pf-bu-is-info pf-bu-is-light"><?php esc_html_e('Copy Code', 'printfriendly'); ?></span></a>
108 </div>
109 </div>
110 </div>
111 </div>
112 </div>
113 </div>
114 </div>
115 </div>
116
117 <div class="pf-bu-card-footer">
118 <p class="pf-bu-card-footer-item"><?php esc_html_e('Change this setting if your content is not showing in the preview.', 'printfriendly'); ?></p>
119 <p class="pf-bu-card-footer-item"><a href="https://support.printfriendly.com/wordpress/customize-content-selection/" target="_new"><?php esc_html_e('Documentation', 'printfriendly'); ?></a></p>
120 </div>
121 </div>
122
123 <div class="pf-bu-block pf-bu-card">
124 <header class="pf-bu-card-header">
125 <p class="pf-bu-card-header-title">
126 <?php esc_html_e('Button Style', 'printfriendly'); ?>
127 </p>
128 </header>
129
130 <div class="pf-bu-card-content">
131
132 <div class="pf-bu-columns pf-bu-is-multiline" id="button-style">
133 <?php
134 // if any images are added here, add to $__buttons tooo
135 $pf_buttons = array(
136 'buttongroup1' => array(
137 'printfriendly-pdf-email-button.png',
138 'printfriendly-pdf-email-button-md.png',
139 'printfriendly-pdf-email-button-notext.png',
140 ),
141 'buttongroup2' => array(
142 'printfriendly-pdf-button.png',
143 'printfriendly-pdf-button-nobg.png',
144 'printfriendly-pdf-button-nobg-md.png',
145 ),
146 'buttongroup3' => array(
147 'printfriendly-button.png',
148 'printfriendly-button-nobg.png',
149 'printfriendly-button-md.png',
150 'printfriendly-button-lg.png',
151 ),
152 'buttongroup4' => array(
153 'print-button.png',
154 'print-button-nobg.png',
155 'print-button-gray.png',
156 ),
157 );
158
159 foreach ($pf_buttons as $pf_class => $pf_array) {
160 foreach ($pf_array as $pf_button) {
161 ?>
162 <div class="pf-bu-column pf-bu-is-one-quarter">
163 <?php $this->radio('buttons/' . $pf_button); ?>
164 </div>
165 <?php
166 }
167 }
168 ?>
169
170 </div>
171
172 <div class="pf-bu-columns">
173 <div class="pf-bu-column">
174 <label>
175 <input id="custom-btn" class="radio" name="<?php echo esc_attr($this->option_name); ?>[button_type]" type="radio" value="custom-button" <?php $this->checked('button_type', 'custom-button'); ?> >
176 <?php esc_html_e('Custom Button', 'printfriendly'); ?>
177 </label>
178
179 <div class="pf-bu-tile pf-bu-is-ancestor">
180 <div class="custom-btn pf-bu-tile pf-bu-is-4 pf-bu-is-flex-direction-column" id="custom-img">
181 <h2><?php esc_html_e('Image', 'printfriendly'); ?></h2>
182 <?php
183 // if any images are added here, add to $__buttons tooo
184 $pf_icons = array(
185 'icons/printfriendly-icon-sm.png',
186 'icons/printfriendly-icon-md.png',
187 'icons/printfriendly-icon-lg.png',
188 );
189 foreach ($pf_icons as $pf_icon) {
190 $this->radio_custom_image($pf_icon);
191 }
192 ?>
193 <label for="custom-image-rb" class="radio-custom-btn">
194 <input id="custom-image-rb" type="radio" name="<?php echo esc_attr($this->option_name); ?>[custom_button_icon]" value="custom-image" <?php $this->checked('custom_button_icon', 'custom-image'); ?>>
195 <?php esc_html_e('Use Your Image', 'printfriendly'); ?>
196
197 <div id="enter-image-url">
198 <input type="button" class="pf_upload_image_button button button-secondary" data-pf-element="#custom_image" value="<?php esc_attr_e('Select Image', 'printfriendly'); ?>">
199 <input id="custom_image" type="hidden" name="<?php echo esc_attr($this->option_name); ?>[custom_image]" value="<?php $this->echoVal('custom_image'); ?>" />
200 <span id="custom_image_label">
201 <?php if (! empty($this->getVal('custom_image'))) { ?>
202 <img src="<?php echo esc_url($this->getVal('custom_image')); ?>">
203 <?php } ?>
204 </span>
205 <div id="custom-img-sizes">
206 <?php esc_html_e('Width', 'printfriendly'); ?>
207 <input type="number" id="custom-img-width" min="0" class="small-text" name="<?php echo esc_attr($this->option_name); ?>[custom_image_width]" value="<?php $this->echoVal('custom_image_width'); ?>" />px
208 <?php esc_html_e('Height', 'printfriendly'); ?>
209 <input type="number" id="custom-img-height" min="0" class="small-text" name="<?php echo esc_attr($this->option_name); ?>[custom_image_height]" value="<?php $this->echoVal('custom_image_height'); ?>" />px
210 </div>
211 <div id="pf-custom-button-error"></div>
212 </div>
213 </label>
214
215 <label class="radio-custom-btn">
216 <input type="radio" name="<?php echo esc_attr($this->option_name); ?>[custom_button_icon]" value="no-image" <?php $this->checked('custom_button_icon', 'no-image'); ?>>
217 <?php esc_html_e('No Image', 'printfriendly'); ?>
218 </label>
219 </div>
220
221 <div class="custom-btn pf-bu-tile pf-bu-is-4 pf-bu-is-flex-direction-column" id="custom-txt">
222 <h2><?php esc_html_e('Text', 'printfriendly'); ?></h2>
223 <div id="txt-enter">
224 <div class="pf-form-element">
225 <input id="custom-text-rb" type="radio" name="<?php echo esc_attr($this->option_name); ?>[custom_button_text]" value="custom-text" <?php $this->checked('custom_button_text', 'custom-text'); ?>>
226 <input id="custom_text" type="text" size="10" class="clear regular-text" name="<?php echo esc_attr($this->option_name); ?>[custom_text]" value="<?php $this->echoVal('custom_text'); ?>">
227
228 <div id="pf-txt-attributes">
229 <div id="txt-size">
230 <?php esc_html_e('Text Size', 'printfriendly'); ?>
231 <input type="number" id="text_size" min="9" max="25" class="small-text" name="<?php echo esc_attr($this->option_name); ?>[text_size]" value="<?php $this->echoVal('text_size'); ?>" />
232 <input type="text" class="pf-color-picker" name="<?php echo esc_attr($this->option_name); ?>[text_color]" id="text_color" value="<?php $this->echoVal('text_color'); ?>" />
233 </div>
234 </div>
235
236 </div>
237
238 <label>
239 <input type="radio" id="custom-text-no" name="<?php echo esc_attr($this->option_name); ?>[custom_button_text]" value="no-text" <?php $this->checked('custom_button_text', 'no-text'); ?>>
240 <?php esc_html_e('No Text', 'printfriendly'); ?>
241 </label>
242 </div>
243 </div>
244
245 <div class="custom-btn pf-bu-tile pf-bu-is-4 pf-bu-is-flex-direction-column" id="custom-button-preview">
246 <h2><?php esc_html_e('Preview', 'printfriendly'); ?></h2>
247 <?php $this->custom_button_preview(); ?>
248 </div>
249 </div>
250 </div>
251 </div>
252 </div>
253 </div>
254
255 <div class="pf-bu-block pf-bu-card">
256 <header class="pf-bu-card-header">
257 <p class="pf-bu-card-header-title">
258 <?php esc_html_e('Button Position', 'printfriendly'); ?>
259 </p>
260 </header>
261
262 <div class="pf-bu-card-content pf-features">
263 <div class="pf-label-inline">
264 <label for="pf_content_placement" class="pf-bu-label"><?php esc_html_e('Placement', 'printfriendly'); ?></label>
265 <div>
266 <select class="pf-bu-select" id="pf_content_placement" name="<?php echo esc_attr($this->option_name); ?>[content_placement]">
267 <option value="before" <?php selected($this->options['content_placement'], 'before'); ?>><?php esc_html_e('Above Content', 'printfriendly'); ?></option>
268 <option value="after" <?php selected($this->options['content_placement'], 'after'); ?>><?php esc_html_e('Below Content', 'printfriendly'); ?></option>
269 </select>
270 </div>
271 </div>
272
273 <div class="pf-label-inline">
274 <label for="pf_button_alignment_method" class="pf-bu-label"><?php esc_html_e('Alignment Method', 'printfriendly'); ?></label>
275 <div>
276 <select class="pf-bu-select" id="pf_button_alignment_method" name="<?php echo esc_attr($this->option_name); ?>[button_alignment_method]">
277 <option value="default" <?php selected($this->options['button_alignment_method'], 'default'); ?>><?php esc_html_e('Default', 'printfriendly'); ?></option>
278 <option value="css" <?php selected($this->options['button_alignment_method'], 'css'); ?>><?php esc_html_e('CSS', 'printfriendly'); ?></option>
279 </select>
280 </div>
281 </div>
282
283 <div class="pf-label-inline" id="pf-content-position">
284 <label for="pf_content_position" class="pf-bu-label"><?php esc_html_e('Alignment', 'printfriendly'); ?></label>
285 <div>
286 <select class="pf-bu-select" id="pf_content_position" name="<?php echo esc_attr($this->option_name); ?>[content_position]">
287 <option value="left" <?php selected($this->options['content_position'], 'left'); ?>><?php esc_html_e('Left Align', 'printfriendly'); ?></option>
288 <option value="right" <?php selected($this->options['content_position'], 'right'); ?>><?php esc_html_e('Right Align', 'printfriendly'); ?></option>
289 <option value="center" <?php selected($this->options['content_position'], 'center'); ?>><?php esc_html_e('Center', 'printfriendly'); ?></option>
290 </select>
291 </div>
292 </div>
293
294 <div class="pf-label-inline" id="pf-content-position-css">
295 <label for="pf_content_position_css" class="pf-bu-label"><?php esc_html_e('CSS', 'printfriendly'); ?></label>
296 <div>
297 <textarea id="pf_content_position_css" rows="5" cols="80" name="<?php echo esc_attr($this->option_name); ?>[content_position_css]"><?php echo esc_textarea($this->getVal('content_position_css', '')); ?></textarea>
298 <p>Add your custom CSS (without the <code style="display:inline;padding:3px 2px">&lt;style&gt;</code> tags) in the box above.</p>
299 </div>
300 </div>
301
302 </div>
303 </div>
304
305 <div class="pf-bu-block pf-bu-card" id="button-display-setting">
306 <header class="pf-bu-card-header">
307 <p class="pf-bu-card-header-title">
308 <?php esc_html_e('Button Display', 'printfriendly'); ?>
309 </p>
310 </header>
311
312 <div class="pf-bu-card-content">
313 <label for="pages" class="pf-bu-label"><?php esc_html_e('Pages to show on', 'printfriendly'); ?></label>
314 <div id="pages">
315 <?php $this->create_checkbox('posts', __('Posts', 'printfriendly')); ?>
316 <?php $this->create_checkbox('pages', __('Pages', 'printfriendly')); ?>
317 <?php $this->create_checkbox('homepage', __('Homepage', 'printfriendly')); ?>
318 <?php $this->create_checkbox('categories', __('Category Index Pages', 'printfriendly')); ?>
319 <?php $this->create_checkbox('taxonomies', __('Taxonomy Index Pages', 'printfriendly')); ?>
320 </div>
321
322 <hr/>
323 <label for="categories" class="pf-bu-label"><?php esc_html_e('Restrict to specific categories', 'printfriendly'); ?></label>
324 <?php
325 wp_dropdown_categories(
326 apply_filters(
327 'printfriendly_category_args',
328 array(
329 'show_count' => 0,
330 'orderby' => 'name',
331 'hide_empty' => false, // show a category even if it has no posts assigned
332 'class' => 'pf-select2',
333 'name' => 'printfriendly_option[show_on_cat]',
334 'id' => 'show_on_cat',
335 'selected' => isset($this->options['show_on_cat']) ? $this->options['show_on_cat'] : '',
336 'multiple' => true,
337 )
338 )
339 );
340 ?>
341
342 <hr/>
343
344 <div class="pf-accordion">
345 <label class="pf-bu-label"><?php esc_html_e('Add direct to template', 'printfriendly'); ?></label>
346 <div>
347 <div>
348 <span class="small-text">Use the following if you want the buttons in archive/category page to link to individual posts</span>
349 <code>
350 &lt;?php if( function_exists( 'pf_default_button' ) ){ echo pf_default_button(); } ?&gt;
351
352 <a class="pf-clipboard" href="javascript:;" data-clipboard-text="<?php echo '&lt;?php if( function_exists( \'pf_default_button\' ) ) { echo pf_default_button(); } ?&gt;'; ?>"><span class="pf-bu-tag pf-bu-is-info pf-bu-is-dark"><?php esc_html_e('Copy Code', 'printfriendly'); ?></span></a>
353 </code>
354 </div>
355 <div>
356 <span class="small-text">Use the following if you want the button to always print the current page</span>
357 <code>
358 &lt;?php if( function_exists( 'pf_current_page_button' ) ){ echo pf_current_page_button(); } ?&gt;
359
360 <a class="pf-clipboard" href="javascript:;" data-clipboard-text="<?php echo '&lt;?php if( function_exists( \'pf_current_page_button\' ) ) { echo pf_current_page_button(); } ?&gt;'; ?>"><span class="pf-bu-tag pf-bu-is-info pf-bu-is-dark"><?php esc_html_e('Copy Code', 'printfriendly'); ?></span></a>
361 </code>
362 </div>
363 </div>
364 </div>
365
366 <div class="pf-accordion">
367 <label class="pf-bu-label"><?php esc_html_e('Use the shortcode', 'printfriendly'); ?></label>
368 <div>
369 <div>
370 <span class="small-text">Use the following if you want the buttons in archive/category page to link to individual posts</span>
371 <code>
372 [printfriendly]
373
374 <a class="pf-clipboard" href="javascript:;" data-clipboard-text="<?php echo '[printfriendly]'; ?>"><span class="pf-bu-tag pf-bu-is-info pf-bu-is-dark"><?php esc_html_e('Copy Code', 'printfriendly'); ?></span></a>
375 </code>
376 </div>
377 <div>
378 <span class="small-text">Use the following if you want the button to always print the current page</span>
379 <code>
380 [printfriendly current="yes"]
381
382 <a class="pf-clipboard" href="javascript:;" data-clipboard-text="<?php echo '[printfriendly current=\'yes\']'; ?>"><span class="pf-bu-tag pf-bu-is-info pf-bu-is-dark"><?php esc_html_e('Copy Code', 'printfriendly'); ?></span></a>
383 </code>
384 </div>
385 </div>
386 </div>
387 </div>
388
389 </div>
390
391 <div class="pf-bu-block pf-bu-card">
392 <header class="pf-bu-card-header">
393 <p class="pf-bu-card-header-title">
394 <?php esc_html_e('Pro Exclusive Features', 'printfriendly'); ?>
395 </p>
396 </header>
397
398 <div class="pf-bu-card-content pf-features">
399 <div class="pf-label-inline">
400 <label for="password_protected" class="pf-bu-label"><?php esc_html_e('Encode images', 'printfriendly'); ?></label>
401 <div>
402 <select class="pf-bu-select" id="password_protected" name="<?php echo esc_attr($this->option_name); ?>[password_protected]">
403 <option value="no" <?php selected($this->getVal('password_protected'), 'no'); ?>><?php esc_html_e('No', 'printfriendly'); ?></option>
404 <option value="yes" <?php selected($this->getVal('password_protected'), 'yes'); ?>><?php esc_html_e('Yes', 'printfriendly'); ?></option>
405 </select>
406 <p class="description"><?php esc_html_e('Select "Yes" if your site is not publicly accessible or if your provider blocks image requests from third parties or if images are not present in PDF', 'printfriendly'); ?></p>
407 </div>
408 </div>
409
410 <div class="pf-label-inline">
411 <label for="show_hidden_content" class="pf-bu-label"><?php esc_html_e('Show Hidden Content', 'printfriendly'); ?></label>
412 <div>
413 <select class="pf-bu-select" id="show_hidden_content" name="<?php echo esc_attr($this->option_name); ?>[show_hidden_content]">
414 <option value="no" <?php selected($this->getVal('show_hidden_content'), 'no'); ?>><?php esc_html_e('No', 'printfriendly'); ?></option>
415 <option value="yes" <?php selected($this->getVal('show_hidden_content'), 'yes'); ?>><?php esc_html_e('Yes', 'printfriendly'); ?></option>
416 </select>
417 <p class="description"><?php esc_html_e('By default PrintFriendly Pro will only show the visible content on the page. Select "Yes", if you want PrintFriendly to show hidden content. (Ex. Content in hidden tabs)', 'printfriendly'); ?></p>
418 </div>
419 </div>
420 </div>
421
422 <div class="pf-bu-card-footer">
423 <p class="pf-bu-card-footer-item"><?php esc_html_e('These features require a Pro subscription.', 'printfriendly'); ?>&nbsp;<a href="https://www.printfriendly.com/pro" target="_blank"><?php esc_html_e('Learn More', 'printfriendly'); ?></a></p>
424 </div>
425 </div>
426
427 <div class="pf-bu-container">
428 <div class="pf-bu-is-flex pf-bu-is-justify-content-center">
429 <input type="submit" class="button-primary pf-bu-is-medium pf-bu-button" value="<?php esc_attr_e('Save Options', 'printfriendly'); ?>" />
430 <input type="reset" style="margin-left: 10px" class="button-secondary pf-bu-is-medium pf-bu-button" value="<?php esc_attr_e('Cancel', 'printfriendly'); ?>" />
431 </div>
432 </div>
433 </div>
434 </section>
435
436 <section id="tab-advanced">
437 <div class="pf-bu-container">
438
439 <div class="pf-bu-block pf-bu-card">
440 <header class="pf-bu-card-header">
441 <p class="pf-bu-card-header-title">
442 <?php esc_html_e('Page header', 'printfriendly'); ?>
443 </p>
444 </header>
445
446 <div class="pf-bu-card-content">
447 <div class="pf-bu-columns">
448 <div class="pf-bu-column pf-bu-is-6">
449 <label for="icon_favicon">
450 <input id="icon_favicon" type="radio" name="<?php echo esc_attr($this->option_name); ?>[logo]" value="favicon" <?php echo $this->options['logo'] === 'favicon' ? 'checked' : ''; ?>>
451 <?php esc_html_e('My Website Icon', 'printfriendly'); ?>
452 </label>
453 </div>
454
455 <div class="pf-bu-column pf-bu-is-6">
456 <label for="icon-upload-an-image">
457 <input id="icon-upload-an-image" type="radio" name="<?php echo esc_attr($this->option_name); ?>[logo]" value="upload-an-image" <?php echo $this->options['logo'] === 'upload-an-image' ? 'checked' : ''; ?>>
458 <?php esc_html_e('Custom Image', 'printfriendly'); ?>
459
460 <div id="custom-logo"><div class="pf-bu-tile pf-bu-is-ancestor">
461 <div class="pf-bu-tile pf-bu-is-vertical">
462 <div class="pf-bu-tile pf-bu-is-4 pf-bu-is-flex-direction-column">
463 <div>
464 <input type="button" class="pf_upload_image_button button button-secondary" data-pf-element="#custom_logo" value="<?php esc_attr_e('Select Image', 'printfriendly'); ?>">
465 <input id="custom_logo" type="hidden" name="<?php echo esc_attr($this->option_name); ?>[image_url]" value="<?php $this->echoVal('image_url'); ?>" />
466 <span id="custom_logo_label">
467 <?php if (! empty($this->getVal('image_url'))) { ?>
468 <img src="<?php echo esc_url($this->getVal('image_url')); ?>">
469 <?php } ?>
470 </span>
471 </div>
472 </div>
473
474 <div class="pf-bu-tile pf-bu-is-4 pf-bu-is-flex-direction-column">
475 <div>
476 <div class="pf-bu-field pf-bu-has-addons">
477 <p class="pf-bu-control">
478 <a class="pf-bu-button pf-bu-is-static">
479 <?php esc_html_e('Tagline (optional)', 'printfriendly'); ?>
480 </a>
481 </p>
482 <p class="pf-bu-control">
483 <input id="image-tagline" type="text" class="pf-bu-input regular-text pf-regular-text" name="<?php echo esc_attr($this->option_name); ?>[tagline]" value="<?php $this->echoVal('tagline'); ?>" />
484 </p>
485 </div>
486 </div>
487 </div>
488 </div>
489 </div></div>
490
491 </label>
492 </div>
493 </div>
494 <div id="pf-image-error"></div>
495 <div id="pf-image-preview"></div>
496 </div>
497
498 <div class="pf-bu-card-footer">
499 <p class="pf-bu-card-footer-item"><a href="https://support.printfriendly.com/wordpress/custom-header-footer/" target="_new"><?php esc_html_e('Documentation', 'printfriendly'); ?></a></p>
500 </div>
501 </div>
502
503 <div class="pf-bu-block pf-bu-card">
504 <header class="pf-bu-card-header">
505 <p class="pf-bu-card-header-title">
506 <?php esc_html_e('Features', 'printfriendly'); ?>
507 </p>
508 </header>
509
510 <div class="pf-bu-card-content pf-features">
511 <div class="pf-label-inline">
512 <label for="pf-analytics-tracking" class="pf-bu-label"><?php esc_html_e('Track in Google Analytics', 'printfriendly'); ?></label>
513 <div>
514 <select class="pf-bu-select" id="pf-analytics-tracking" name="<?php echo esc_attr($this->option_name); ?>[enable_google_analytics]">
515 <option value="yes" <?php $this->selected('enable_google_analytics', 'yes'); ?>> <?php esc_html_e('Yes', 'printfriendly'); ?></option>
516 <option value="no" <?php $this->selected('enable_google_analytics', 'no'); ?>> <?php esc_html_e('No', 'printfriendly'); ?></option>
517 </select>
518 </div>
519 </div>
520
521 <div class="pf-label-inline">
522 <label for="click-to-delete" class="pf-bu-label"><?php esc_html_e('Click to delete', 'printfriendly'); ?></label>
523 <div>
524 <select class="pf-bu-select" name="<?php echo esc_attr($this->option_name); ?>[click_to_delete]" id="click-to-delete">
525 <option value="0" <?php selected($this->options['click_to_delete'], '0'); ?>><?php esc_html_e('Allow', 'printfriendly'); ?></option>
526 <option value="1" <?php selected($this->options['click_to_delete'], '1'); ?>><?php esc_html_e('Not Allow', 'printfriendly'); ?></option>
527 </select>
528 </div>
529 </div>
530
531 <div class="pf-label-inline">
532 <label for="images-size" class="pf-bu-label"><?php esc_html_e('Image size', 'printfriendly'); ?></label>
533 <div>
534 <select class="pf-bu-select" name="<?php echo esc_attr($this->option_name); ?>[images-size]" id="images-size">
535 <option value="full-size" <?php selected($this->options['images-size'], 'full-size'); ?>><?php esc_html_e('Full Size', 'printfriendly'); ?></option>
536 <option value="large" <?php selected($this->options['images-size'], 'large'); ?>><?php esc_html_e('Large', 'printfriendly'); ?></option>
537 <option value="medium" <?php selected($this->options['images-size'], 'medium'); ?>><?php esc_html_e('Medium', 'printfriendly'); ?></option>
538 <option value="small" <?php selected($this->options['images-size'], 'small'); ?>><?php esc_html_e('Small', 'printfriendly'); ?></option>
539 <option value="remove-images" <?php selected($this->options['images-size'], 'remove-images'); ?>><?php esc_html_e('Remove Images', 'printfriendly'); ?></option>
540 </select>
541 </div>
542 </div>
543
544 <div class="pf-label-inline">
545 <label for="image-style" class="pf-bu-label"><?php esc_html_e('Image style', 'printfriendly'); ?></label>
546 <div>
547 <select class="pf-bu-select" name="<?php echo esc_attr($this->option_name); ?>[image-style]" id="image-style">
548 <option value="block" <?php selected($this->options['image-style'], 'block'); ?>><?php esc_html_e('Center/Block', 'printfriendly'); ?></option>
549 <option value="right" <?php selected($this->options['image-style'], 'right'); ?>><?php esc_html_e('Align Right', 'printfriendly'); ?></option>
550 <option value="left" <?php selected($this->options['image-style'], 'left'); ?>><?php esc_html_e('Align Left', 'printfriendly'); ?></option>
551 <option value="none" <?php selected($this->options['image-style'], 'none'); ?>><?php esc_html_e('Align None', 'printfriendly'); ?></option>
552 </select>
553 </div>
554 </div>
555
556 <div class="pf-label-inline">
557 <label for="email" class="pf-bu-label"><?php esc_html_e('Email', 'printfriendly'); ?></label>
558 <div>
559 <select class="pf-bu-select" name="<?php echo esc_attr($this->option_name); ?>[email]" id="email">
560 <option value="0" <?php selected($this->options['email'], '0'); ?>><?php esc_html_e('Allow', 'printfriendly'); ?></option>
561 <option value="1" <?php selected($this->options['email'], '1'); ?>><?php esc_html_e('Not Allow', 'printfriendly'); ?></option>
562 </select>
563 </div>
564 </div>
565
566 <div class="pf-label-inline">
567 <label for="pdf" class="pf-bu-label"><?php esc_html_e('PDF', 'printfriendly'); ?></label>
568 <div>
569 <select class="pf-bu-select" name="<?php echo esc_attr($this->option_name); ?>[pdf]" id="pdf">
570 <option value="0" <?php selected($this->options['pdf'], '0'); ?>><?php esc_html_e('Allow', 'printfriendly'); ?></option>
571 <option value="1" <?php selected($this->options['pdf'], '1'); ?>><?php esc_html_e('Not Allow', 'printfriendly'); ?></option>
572 </select>
573 <p class="description"><strong><?php esc_html_e('Developer Note', 'printfriendly'); ?></strong>: <?php esc_html_e('On localhost the images can not be included in the PDF. Once the website is live/public images will be included in the PDF.', 'printfriendly'); ?></p>
574 </div>
575 </div>
576
577 <div class="pf-label-inline">
578 <label for="print" class="pf-bu-label"><?php esc_html_e('Print', 'printfriendly'); ?></label>
579 <div>
580 <select class="pf-bu-select" name="<?php echo esc_attr($this->option_name); ?>[print]" id="print">
581 <option value="0" <?php selected($this->options['print'], '0'); ?>><?php esc_html_e('Allow', 'printfriendly'); ?></option>
582 <option value="1" <?php selected($this->options['print'], '1'); ?>><?php esc_html_e('Not Allow', 'printfriendly'); ?></option>
583 </select>
584 </div>
585 </div>
586
587 </div>
588 </div>
589
590 <div class="pf-bu-block pf-bu-card">
591 <header class="pf-bu-card-header">
592 <p class="pf-bu-card-header-title">
593 <?php esc_html_e('Custom CSS', 'printfriendly'); ?>
594 </p>
595 </header>
596
597 <div class="pf-bu-card-content pf-features">
598 <?php if ($this->is_pro('custom-css')) { ?>
599 <div class="pf-label-inline">
600 <label for="custom_css" class="pf-bu-label"><?php esc_html_e('CSS', 'printfriendly'); ?></label>
601 <div>
602 <textarea id="custom_css" class="regular-text pf-bu-textarea" rows="5" cols="80" name="<?php echo esc_attr($this->option_name); ?>[custom_css]"><?php echo esc_textarea($this->getVal('custom_css', '')); ?></textarea>
603 <p class="desc"><?php echo wp_kses_post($this->get_custom_css_upgrade_message()); ?></p>
604 </div>
605 </div>
606 <div class="pf-label-inline" style="margin-top: 30px">
607 <label for="css_include_via" class="pf-bu-label"><?php esc_html_e('Include Via', 'printfriendly'); ?></label>
608 <div>
609 <select class="pf-bu-select" name="<?php echo esc_attr($this->option_name); ?>[css_include_via]" id="css_include_via">
610 <option value="inline_tag" <?php selected($this->options['css_include_via'], 'inline_tag'); ?>><?php esc_html_e('Inline Tag', 'printfriendly'); ?></option>
611 <option value="file" <?php selected($this->options['css_include_via'], 'file'); ?>><?php esc_html_e('File', 'printfriendly'); ?></option>
612 </select>
613 <?php if ($this->getVal('css_include_via') == 'file') { ?>
614 <p class="desc pf-bu-has-background-warning-light pf-bu-py-1 pf-bu-px-2">We recommend setting this to Inline Tag</p>
615 <?php } ?>
616 </div>
617 </div>
618 <?php } else { ?>
619 <label for="custom_css_url">
620 <?php esc_html_e('Custom CSS URL', 'printfriendly'); ?>
621 <input id="custom_css_url" type="url" class="regular-text" name="<?php echo esc_attr($this->option_name); ?>[custom_css_url]" value="<?php $this->echoVal('custom_css_url'); ?>" />
622 </label>
623 <?php } ?>
624 </div>
625
626 <div class="pf-bu-card-footer">
627 <div class="pf-bu-card-footer-item">
628 <div>
629 <p>Customize the styles of the printed/pdf page using your own CSS</p>
630 <p>Add your custom CSS (without the <code style="display:inline;padding:3px 2px">&lt;style&gt;</code> tags) in the box above.
631 <a href="https://support.printfriendly.com/wordpress/custom-css/" target="_new">Learn More</a>
632 </p>
633 </div>
634 </div>
635 </div>
636
637 </div>
638
639 <div class="pf-bu-container">
640 <div class="pf-bu-is-flex pf-bu-is-justify-content-center">
641 <input type="submit" class="button-primary pf-bu-is-medium pf-bu-button" value="<?php esc_attr_e('Save Options', 'printfriendly'); ?>" />
642 <input type="reset" style="margin-left: 10px" class="button-secondary pf-bu-is-medium pf-bu-button" value="<?php esc_attr_e('Cancel', 'printfriendly'); ?>" />
643 </div>
644 </div>
645
646 </div>
647 </section>
648
649
650 <?php if (WP_DEBUG) { ?>
651 <section id="tab-debug">
652 <div class="pf-bu-container">
653 <div class="pf-bu-block pf-bu-card">
654 <header class="pf-bu-card-header">
655 <p class="pf-bu-card-header-title">
656 <?php esc_html_e('Debug options', 'printfriendly'); ?>
657 </p>
658 </header>
659
660 <div class="pf-bu-card-content">
661 <?php
662 // Which origin the plugin talks to. Worth stating outright:
663 // a plugin pointed at the wrong origin still renders the Pro
664 // card correctly, because the status check uses a route that
665 // exists in both places, and only the trial button fails.
666 if (class_exists('PrintFriendly_Pro_Card')) {
667 ?>
668 <p>
669 <strong><?php esc_html_e('API base', 'printfriendly'); ?></strong>
670 <code><?php echo esc_html(PrintFriendly_Pro_Card::api_base()); ?></code>
671 <?php if (defined('PRINTFRIENDLY_API_BASE')) { ?>
672 <em><?php esc_html_e('(set by PRINTFRIENDLY_API_BASE)', 'printfriendly'); ?></em>
673 <?php } else { ?>
674 <em><?php esc_html_e('(default; PRINTFRIENDLY_API_BASE is not defined)', 'printfriendly'); ?></em>
675 <?php } ?>
676 </p>
677 <?php
678 }
679 ?>
680 <pre><?php echo esc_html(print_r($this->options, true)); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_print_r -- Debug-only dump, gated by WP_DEBUG. ?></pre>
681 </div>
682
683 <div class="pf-bu-card-footer">
684 <p class="pf-bu-card-footer-item"><?php esc_html_e('Currently in Debug Mode. This tab is visible in debug mode only', 'printfriendly'); ?></p>
685 </div>
686 </div>
687 </div>
688 </section>
689 <?php } ?>
690
691 </div>
692