PluginProbe
E2Pdf – Export Pdf Tool for WordPress / 1.08.00
E2Pdf – Export Pdf Tool for WordPress v1.08.00
1.32.49 1.32.48 1.32.43 1.32.40 1.32.34 1.32.32 1.32.31 1.32.26 1.32.22 1.32.23 1.32.18 1.32.17 1.32.15 trunk 1.00.00 1.00.13 1.01.01 1.02.02 1.03.07 1.04.07 1.05.03 1.06.02 1.07.11 1.08.00 1.08.06 All 72 releases
e2pdf / classes / extension / e2pdf-wordpress.php

e2pdf-wordpress.php in E2Pdf – Export Pdf Tool for WordPress 1.08.00, at classes/extension/e2pdf-wordpress.php

752 lines 27.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * E2pdf Wordpress Extension
5 *
6 * @copyright Copyright 2017 https://e2pdf.com
7 * @license GPL v2
8 * @version 1
9 * @link https://e2pdf.com
10 * @since 0.00.01
11 */
12 if (!defined('ABSPATH')) {
13 die('Access denied.');
14 }
15
16 class Extension_E2pdf_Wordpress extends Model_E2pdf_Model {
17
18 private $options;
19 private $info = array(
20 'key' => 'wordpress',
21 'title' => 'WordPress'
22 );
23
24 function __construct() {
25 parent::__construct();
26 }
27
28 /**
29 * Get info about extension
30 *
31 * @param string $key - Key to get assigned extension info value
32 *
33 * @return array|string - Extension Key and Title or Assigned extension info value
34 */
35 public function info($key = false) {
36 if ($key && isset($this->info[$key])) {
37 return $this->info[$key];
38 } else {
39 return array(
40 $this->info['key'] => $this->info['title']
41 );
42 }
43 }
44
45 /**
46 * Check if needed plugin active
47 *
48 * @return bool - Activated/Not Activated plugin
49 */
50 public function active() {
51 return true;
52 }
53
54 /**
55 * Set option
56 *
57 * @param string $attr - Key of option
58 * @param string $value - Value of option
59 *
60 * @return bool - Status of setting option
61 */
62 public function set($key, $value) {
63 if (!isset($this->options)) {
64 $this->options = new stdClass();
65 }
66
67 $this->options->$key = $value;
68 }
69
70 /**
71 * Get option by key
72 *
73 * @param string $key - Key to get assigned option value
74 *
75 * @return mixed
76 */
77 public function get($key) {
78 if (isset($this->options->$key)) {
79 $value = $this->options->$key;
80 return $value;
81 } elseif ($key == 'args') {
82 return array();
83 } else {
84 return false;
85 }
86 }
87
88 /**
89 * Get items to work with
90 *
91 * @return array() - List of available items
92 */
93 public function items() {
94 $content = array();
95
96 $items = get_post_types(array('public' => true), 'names');
97
98 foreach ($items as $item) {
99 if ($item != 'attachment') {
100 $content[] = $this->item($item);
101 }
102 }
103
104 return $content;
105 }
106
107 /**
108 * Get entries for export
109 *
110 * @param string $item - Item
111 * @param string $name - Entries names
112 *
113 * @return array() - Entries list
114 */
115 public function datasets($item = false, $name = false) {
116
117 $datasets = array();
118
119 if ($item) {
120 $datasets_tmp = get_posts(
121 array(
122 'post_type' => $item,
123 'numberposts' => -1,
124 'post_status' => array(
125 'publish',
126 'private'
127 )
128 ));
129
130 if ($datasets_tmp) {
131 foreach ($datasets_tmp as $key => $dataset) {
132 $this->set('item', $item);
133 $this->set('dataset', $dataset->ID);
134
135 $dataset_title = $this->render($name);
136 if (!$dataset_title) {
137 $dataset_title = isset($dataset->post_title) && $dataset->post_title ? $dataset->post_title : $dataset->ID;
138 }
139 $datasets[] = array(
140 'key' => $dataset->ID,
141 'value' => $dataset_title
142 );
143 }
144 }
145 }
146
147 return $datasets;
148 }
149
150 /**
151 * Get dataset
152 *
153 * @param int $dataset - Dataset ID
154 *
155 * @return object - Dataset
156 */
157 public function dataset($dataset = false) {
158
159 $dataset = (int) $dataset;
160
161 if (!$dataset) {
162 return;
163 }
164
165 $data = new stdClass();
166 $data->url = $this->helper->get_url(array('post' => $dataset, 'action' => 'edit'), 'post.php?');
167
168 return $data;
169 }
170
171 /**
172 * Get item
173 *
174 * @param string $item - Item
175 *
176 * @return object - Item
177 */
178 public function item($item = false) {
179
180 if (!$item && $this->get('item')) {
181 $item = $this->get('item');
182 }
183
184 $form = new stdClass();
185 $post = get_post_type_object($item);
186 if ($post) {
187 $form->id = $item;
188 $form->name = $post->label ? $post->label : $item;
189 $form->url = $this->helper->get_url(array('post_type' => $item), 'edit.php?');
190 } else {
191 $form->id = '';
192 $form->name = '';
193 $form->url = 'javascript:void(0);';
194 }
195
196 return $form;
197 }
198
199 public function load_filters() {
200 add_filter('the_content', array($this, 'filter_content'), 10, 2);
201 add_filter('pum_popup_content', array($this, 'filter_content'), 10, 2);
202 }
203
204 /**
205 * Render value according to content
206 *
207 * @param string $value - Content
208 * @param string $type - Type of rendering value
209 * @param array $field - Field details
210 *
211 * @return string - Fully rendered value
212 */
213 public function render($value, $type = false, $field = array()) {
214
215 $value = $this->render_shortcodes($value, $type, $field);
216 $value = $this->strip_shortcodes($value);
217
218 if ($type === 'value' && isset($field['type']) && $field['type'] === 'e2pdf-checkbox' && isset($field['properties']['option'])) {
219 $option = $this->render($field['properties']['option']);
220 $options = explode(', ', $value);
221 $option_options = explode(', ', $option);
222 if (is_array($options) && is_array($option_options) && !array_diff($option_options, $options)) {
223 return $option;
224 } else {
225 return "";
226 }
227 }
228
229 if ($type === 'value') {
230 $value = $this->convert_shortcodes($value, true);
231 }
232
233 return $value;
234 }
235
236 /**
237 * Render shortcodes which available in this extension
238 *
239 * @param string $value - Content
240 * @param string $type - Type of rendering value
241 * @param array $field - Field details
242 *
243 * @return string - Value with rendered shortcodes
244 */
245 public function render_shortcodes($value, $type = false, $field = array()) {
246
247 $dataset = $this->get('dataset');
248 $item = $this->get('item');
249 $args = $this->get('args');
250 $user_id = $this->get('user_id');
251 $template_id = $this->get('template_id') ? $this->get('template_id') : '0';
252 $element_id = isset($field['element_id']) ? $field['element_id'] : '0';
253
254 if ($this->verify()) {
255
256 $args = apply_filters('e2pdf_extension_render_shortcodes_args', $args, $element_id, $template_id, $item, $dataset);
257
258 $post = get_post($dataset);
259
260 $wordpress_shortcodes = array(
261 'id',
262 'post_author',
263 'post_date',
264 'post_date_gmt',
265 'post_content',
266 'post_title',
267 'post_excerpt',
268 'post_status',
269 'comment_status',
270 'ping_status',
271 'post_password',
272 'post_name',
273 'to_ping',
274 'pinged',
275 'post_modified',
276 'post_modified_gmt',
277 'post_content_filtered',
278 'post_parent',
279 'guid',
280 'menu_order',
281 'post_type',
282 'post_mime_type',
283 'comment_count',
284 'filter',
285 'post_thumbnail'
286 );
287
288 if (false !== strpos($value, '[')) {
289
290 $shortcode_tags = array(
291 'meta',
292 'terms',
293 'e2pdf-wp',
294 'e2pdf-content',
295 'e2pdf-user',
296 'e2pdf-arg'
297 );
298
299 $shortcode_tags = array_merge($shortcode_tags, $wordpress_shortcodes);
300
301 preg_match_all('@\[([^<>&/\[\]\x00-\x20=]++)@', $value, $matches);
302 $tagnames = array_intersect($shortcode_tags, $matches[1]);
303
304 if (!empty($tagnames)) {
305
306 $pattern = $this->helper->load('shortcode')->get_shortcode_regex($tagnames);
307
308 preg_match_all("/$pattern/", $value, $shortcodes);
309
310 foreach ($shortcodes[0] as $key => $shortcode_value) {
311 $shortcode = array();
312 $shortcode[1] = $shortcodes[1][$key];
313 $shortcode[2] = $shortcodes[2][$key];
314 $shortcode[3] = $shortcodes[3][$key];
315 $shortcode[4] = $shortcodes[4][$key];
316 $shortcode[5] = $shortcodes[5][$key];
317 $shortcode[6] = $shortcodes[6][$key];
318
319 $atts = shortcode_parse_atts($shortcode[3]);
320
321 if ($shortcode[2] === 'e2pdf-content') {
322 if (!isset($atts['id']) && isset($post->ID) && $post->ID) {
323 $shortcode[3] .= " id=\"" . $post->ID . "\"";
324 $value = str_replace($shortcode_value, "[" . $shortcode['2'] . $shortcode['3'] . "]", $value);
325 }
326 } else if ($shortcode[2] === 'e2pdf-user') {
327 if (!isset($atts['id']) && $user_id) {
328 $shortcode[3] .= " id=\"" . $user_id . "\"";
329 $value = str_replace($shortcode_value, "[" . $shortcode['2'] . $shortcode['3'] . "]", $value);
330 }
331 } else if ($shortcode['2'] === 'meta' || $shortcode['2'] === 'terms' || $shortcode['2'] == 'e2pdf-wp') {
332 if (!isset($atts['id']) && isset($post->ID) && $post->ID) {
333 $shortcode[3] .= " id=\"" . $post->ID . "\"";
334 }
335 if ($shortcode['2'] === 'meta') {
336 $shortcode[3] .= " meta=\"true\"";
337 }
338 if ($shortcode['2'] === 'terms') {
339 $shortcode[3] .= " terms=\"true\"";
340 }
341
342 $value = str_replace($shortcode_value, "[e2pdf-wp" . $shortcode['3'] . "]", $value);
343 } elseif (in_array($shortcode[2], $wordpress_shortcodes)) {
344 if (!isset($atts['id']) && isset($post->ID) && $post->ID) {
345 $shortcode[3] .= " id=\"" . $post->ID . "\"";
346 }
347 $shortcode[3] .= " key=\"" . $shortcode[2] . "\"";
348 $value = str_replace($shortcode_value, "[e2pdf-wp" . $shortcode['3'] . "]", $value);
349 } elseif ($shortcode['2'] == 'e2pdf-arg') {
350 if (isset($atts['key']) && isset($args[$atts['key']])) {
351 $sub_value = $this->strip_shortcodes($args[$atts['key']]);
352 $value = str_replace($shortcode_value, $sub_value, $value);
353 } else {
354 $value = str_replace($shortcode_value, '', $value);
355 }
356 }
357 }
358 }
359
360 $shortcode_tags = array(
361 'e2pdf-format-number',
362 'e2pdf-format-date',
363 'e2pdf-format-output',
364 );
365 $shortcode_tags = apply_filters('e2pdf_extension_render_shortcodes_tags', $shortcode_tags);
366 preg_match_all('@\[([^<>&/\[\]\x00-\x20=]++)@', $value, $matches);
367 $tagnames = array_intersect($shortcode_tags, $matches[1]);
368
369 if (!empty($tagnames)) {
370
371 $pattern = $this->helper->load('shortcode')->get_shortcode_regex($tagnames);
372
373 preg_match_all("/$pattern/", $value, $shortcodes);
374 foreach ($shortcodes[0] as $key => $shortcode_value) {
375 $shortcode = array();
376 $shortcode[1] = $shortcodes[1][$key];
377 $shortcode[2] = $shortcodes[2][$key];
378 $shortcode[3] = $shortcodes[3][$key];
379 $shortcode[4] = $shortcodes[4][$key];
380 $shortcode[5] = $shortcodes[5][$key];
381 $shortcode[6] = $shortcodes[6][$key];
382
383 if (!$shortcode['5']) {
384 $sub_value = '';
385 } elseif (isset($field['type']) && ($field['type'] === 'e2pdf-image' || $field['type'] === 'e2pdf-signature')) {
386 $sub_value = $this->render($shortcode['5'], $type);
387 } else {
388 $sub_value = $this->render($shortcode['5'], $type, $field);
389 }
390 $value = str_replace($shortcode_value, "[" . $shortcode['2'] . $shortcode['3'] . "]" . $sub_value . "[/" . $shortcode['2'] . "]", $value);
391 }
392 }
393 }
394
395 $value = do_shortcode($value);
396
397 if (isset($field['type']) && ($field['type'] === 'e2pdf-image' || $field['type'] === 'e2pdf-signature')) {
398 $esig = isset($field['properties']['esig']) && $field['properties']['esig'] ? true : false;
399 if ($esig) {
400 //process e-signature
401 $value = "";
402 } else {
403
404 if (isset($field['properties']['preg_pattern']) && $field['properties']['preg_pattern'] && isset($field['properties']['preg_replacement']) && $value) {
405 $value = $this->helper->load('convert')->preg_replace($field['properties']['preg_pattern'], $field['properties']['preg_replacement'], $value);
406 }
407
408 if (!$this->helper->load('image')->get_image($value)) {
409 $value = $this->strip_shortcodes($value);
410 if (
411 $value &&
412 trim($value) != "" &&
413 extension_loaded('gd') &&
414 function_exists('imagettftext')
415 ) {
416 if (isset($field['properties']['text_color']) && $field['properties']['text_color']) {
417 $penColour = $this->helper->load('convert')->to_hex_color($field['properties']['text_color']);
418 } else {
419 $penColour = array(0x14, 0x53, 0x94);
420 }
421
422 $default_options = array(
423 'imageSize' => array(isset($field['width']) ? $field['width'] : '400', isset($field['height']) ? $field['height'] : '150'),
424 'bgColour' => 'transparent',
425 'penColour' => $penColour
426 );
427
428 $options = array();
429 $options = apply_filters('e2pdf_image_sig_output_options', $options, $element_id, $template_id);
430 $options = array_merge($default_options, $options);
431
432 $model_e2pdf_font = new Model_E2pdf_Font();
433
434 $font = false;
435 if (isset($field['properties']['text_font']) && $field['properties']['text_font']) {
436 $font = $model_e2pdf_font->get_font_path($field['properties']['text_font']);
437 }
438 if (!$font) {
439 $font = $model_e2pdf_font->get_font_path('Noto Sans');
440 }
441
442 $size = 150;
443 if (isset($field['properties']['text_font_size']) && $field['properties']['text_font_size']) {
444 $size = $field['properties']['text_font_size'];
445 }
446
447 $model_e2pdf_signature = new Model_E2pdf_Signature();
448 $value = $model_e2pdf_signature->ttf_signature($value, $size, $font, $options);
449 } else {
450 $value = "";
451 }
452 }
453 }
454 } else {
455
456 $value = $this->convert_shortcodes($value);
457
458 if (isset($field['properties']['preg_pattern']) && $field['properties']['preg_pattern'] && isset($field['properties']['preg_replacement']) && $value) {
459 $value = $this->helper->load('convert')->preg_replace($field['properties']['preg_pattern'], $field['properties']['preg_replacement'], $value);
460 }
461 }
462 }
463
464 $value = apply_filters('e2pdf_extension_render_shortcodes_value', $value, $element_id, $template_id, $item, $dataset);
465
466 return $value;
467 }
468
469 public function filter_custom_shortcodes() {
470
471 }
472
473 /**
474 * Strip unused shortcodes
475 *
476 * @param string $value - Content
477 *
478 * @return string - Value with removed unused shortcodes
479 */
480 public function strip_shortcodes($value) {
481 $value = preg_replace('~(?:\[/?)[^/\]]+/?\]~s', "", $value);
482 return $value;
483 }
484
485 /**
486 * Convert "shortcodes" inside value string
487 *
488 * @param string $value - Value string
489 * @param bool $to - Convert From/To
490 *
491 * @return string - Converted value
492 */
493 public function convert_shortcodes($value, $to = false) {
494 if ($value) {
495 if ($to) {
496 $value = str_replace("&#91;", "[", $value);
497 } else {
498 $value = str_replace("[", "&#91;", $value);
499 }
500 }
501 return $value;
502 }
503
504 public function auto() {
505 $response = array();
506 $elements = array();
507
508 $post = $this->get('item');
509
510 $elements[] = array(
511 'type' => 'e2pdf-html',
512 'block' => true,
513 'properties' => array(
514 'top' => '20',
515 'left' => '20',
516 'right' => '20',
517 'width' => '100%',
518 'height' => 'auto',
519 'value' => "<h1>[post_title]</h1>",
520 )
521 );
522
523 $elements[] = array(
524 'type' => 'e2pdf-html',
525 'block' => true,
526 'properties' => array(
527 'top' => '20',
528 'left' => '20',
529 'right' => '20',
530 'width' => '100%',
531 'height' => 'auto',
532 'value' => __("Post name", 'e2pdf') . ": [post_name]",
533 )
534 );
535
536 $elements[] = array(
537 'type' => 'e2pdf-html',
538 'block' => true,
539 'properties' => array(
540 'top' => '20',
541 'left' => '20',
542 'right' => '20',
543 'width' => '100%',
544 'height' => 'auto',
545 'value' => __("Post type", 'e2pdf') . ": [post_type]",
546 )
547 );
548
549
550 $elements[] = array(
551 'type' => 'e2pdf-html',
552 'block' => true,
553 'properties' => array(
554 'top' => '20',
555 'left' => '20',
556 'right' => '20',
557 'width' => '100%',
558 'height' => 'auto',
559 'value' => __("ID", 'e2pdf') . ": [id]",
560 )
561 );
562
563 $elements[] = array(
564 'type' => 'e2pdf-html',
565 'block' => true,
566 'properties' => array(
567 'top' => '20',
568 'left' => '20',
569 'right' => '20',
570 'width' => '100%',
571 'height' => 'auto',
572 'value' => __("Author", 'e2pdf') . ": [post_author]",
573 )
574 );
575
576 $elements[] = array(
577 'type' => 'e2pdf-html',
578 'block' => true,
579 'properties' => array(
580 'top' => '20',
581 'left' => '20',
582 'right' => '20',
583 'width' => '100%',
584 'height' => '300',
585 'value' => "[post_content]",
586 'dynamic_height' => '1',
587 )
588 );
589
590 $elements[] = array(
591 'type' => 'e2pdf-html',
592 'block' => true,
593 'properties' => array(
594 'top' => '20',
595 'left' => '20',
596 'right' => '20',
597 'width' => '100%',
598 'height' => 'auto',
599 'value' => __("Created", 'e2pdf') . ": [post_date]",
600 )
601 );
602
603 $elements[] = array(
604 'type' => 'e2pdf-html',
605 'block' => true,
606 'properties' => array(
607 'top' => '20',
608 'left' => '20',
609 'right' => '20',
610 'width' => '100%',
611 'height' => 'auto',
612 'value' => __("Modified", 'e2pdf') . ": [post_modified]",
613 )
614 );
615
616 $response['page'] = array(
617 'bottom' => '20',
618 'top' => '20',
619 'left' => '20',
620 'right' => '20'
621 );
622
623 $response['elements'] = $elements;
624 return $response;
625 }
626
627 /**
628 * Search and update shortcodes for this extension inside content
629 * Auto set of dataset id
630 *
631 * @param string $content - Content
632 * @param string $post_id - Custom Post ID
633 *
634 * @return string - Content with updated shortcodes
635 */
636 public function filter_content($content, $post_id = false) {
637 global $post;
638
639 if (false === strpos($content, '[')) {
640 return $content;
641 }
642
643 $shortcode_tags = array(
644 'e2pdf-download',
645 'e2pdf-view'
646 );
647
648 preg_match_all('@\[([^<>&/\[\]\x00-\x20=]++)@', $content, $matches);
649 $tagnames = array_intersect($shortcode_tags, $matches[1]);
650
651 if (!empty($tagnames)) {
652
653 $pattern = $this->helper->load('shortcode')->get_shortcode_regex($tagnames);
654
655 preg_match_all("/$pattern/", $content, $shortcodes);
656
657 foreach ($shortcodes[0] as $key => $shortcode_value) {
658
659 wp_reset_postdata();
660
661 $shortcode = array();
662 $shortcode[1] = $shortcodes[1][$key];
663 $shortcode[2] = $shortcodes[2][$key];
664 $shortcode[3] = $shortcodes[3][$key];
665 $shortcode[4] = $shortcodes[4][$key];
666 $shortcode[5] = $shortcodes[5][$key];
667 $shortcode[6] = $shortcodes[6][$key];
668
669 $atts = shortcode_parse_atts($shortcode[3]);
670
671 if (!isset($atts['dataset']) && isset($atts['id'])) {
672 $template = new Model_E2pdf_Template();
673 $template->load($atts['id']);
674 if ($template->get('extension') === 'wordpress') {
675 if ($post_id || isset($post->ID)) {
676 $dataset = $post_id ? $post_id : $post->ID;
677 $atts['dataset'] = $dataset;
678 $shortcode[3] .= " dataset=\"{$dataset}\"";
679 }
680 }
681 }
682 $content = str_replace($shortcode_value, do_shortcode_tag($shortcode), $content);
683 }
684 }
685
686 return $content;
687 }
688
689 /**
690 * Verify if item and dataset exists
691 *
692 * @return bool - item and dataset exists
693 */
694 public function verify() {
695 $item = $this->get('item');
696 $dataset = $this->get('dataset');
697
698 if ($item && $dataset && get_post($dataset) && $item == get_post_type($dataset)) {
699 return true;
700 }
701
702 return false;
703 }
704
705 /**
706 * Init Visual Mapper data
707 *
708 * @return bool|string - HTML data source for Visual Mapper
709 */
710 public function visual_mapper() {
711
712 $vc = "<h3>Wordpress</h3>";
713 $vc .= "<div class='e2pdf-grid'>";
714 $vc .= "<div class='e2pdf-ib e2pdf-w50 e2pdf-pr10'>{$this->get_vm_element(__("ID", "e2pdf"), 'id')}</div>";
715 $vc .= "<div class='e2pdf-ib e2pdf-w50 e2pdf-pl10'>{$this->get_vm_element(__("Author", "e2pdf"), 'post_author')}</div>";
716 $vc .= "<div class='e2pdf-ib e2pdf-w50 e2pdf-pr10'>{$this->get_vm_element(__("Date", "e2pdf"), 'post_date')}</div>";
717 $vc .= "<div class='e2pdf-ib e2pdf-w50 e2pdf-pl10'>{$this->get_vm_element(__("Date (GMT)", "e2pdf"), 'post_date_gmt')}</div>";
718 $vc .= "<div class='e2pdf-ib e2pdf-w50 e2pdf-pr10'>{$this->get_vm_element(__("Content", "e2pdf"), 'post_content')}</div>";
719 $vc .= "<div class='e2pdf-ib e2pdf-w50 e2pdf-pl10'>{$this->get_vm_element(__("Title", "e2pdf"), 'post_title')}</div>";
720 $vc .= "<div class='e2pdf-ib e2pdf-w50 e2pdf-pr10'>{$this->get_vm_element(__("Excerpt", "e2pdf"), 'post_excerpt')}</div>";
721 $vc .= "<div class='e2pdf-ib e2pdf-w50 e2pdf-pl10'>{$this->get_vm_element(__("Status", "e2pdf"), 'post_status')}</div>";
722 $vc .= "<div class='e2pdf-ib e2pdf-w50 e2pdf-pr10'>{$this->get_vm_element(__("Comment Status", "e2pdf"), 'comment_status')}</div>";
723 $vc .= "<div class='e2pdf-ib e2pdf-w50 e2pdf-pl10'>{$this->get_vm_element(__("Ping Status", "e2pdf"), 'ping_status')}</div>";
724 $vc .= "<div class='e2pdf-ib e2pdf-w50 e2pdf-pr10'>{$this->get_vm_element(__("Post Password", "e2pdf"), 'post_password')}</div>";
725 $vc .= "<div class='e2pdf-ib e2pdf-w50 e2pdf-pl10'>{$this->get_vm_element(__("Post Name", "e2pdf"), 'post_name')}</div>";
726 $vc .= "<div class='e2pdf-ib e2pdf-w50 e2pdf-pr10'>{$this->get_vm_element(__("To Ping", "e2pdf"), 'to_ping')}</div>";
727 $vc .= "<div class='e2pdf-ib e2pdf-w50 e2pdf-pl10'>{$this->get_vm_element(__("Ping", "e2pdf"), 'pinged')}</div>";
728 $vc .= "<div class='e2pdf-ib e2pdf-w50 e2pdf-pr10'>{$this->get_vm_element(__("Modified Date", "e2pdf"), 'post_modified')}</div>";
729 $vc .= "<div class='e2pdf-ib e2pdf-w50 e2pdf-pl10'>{$this->get_vm_element(__("Modified Date (GMT)", "e2pdf"), 'post_modified_gmt')}</div>";
730 $vc .= "<div class='e2pdf-ib e2pdf-w50 e2pdf-pr10'>{$this->get_vm_element(__("Filtered Content", "e2pdf"), 'post_content_filtered')}</div>";
731 $vc .= "<div class='e2pdf-ib e2pdf-w50 e2pdf-pl10'>{$this->get_vm_element(__("Parent ID", "e2pdf"), 'post_parent')}</div>";
732 $vc .= "<div class='e2pdf-ib e2pdf-w50 e2pdf-pr10'>{$this->get_vm_element(__("GUID", "e2pdf"), 'guid')}</div>";
733 $vc .= "<div class='e2pdf-ib e2pdf-w50 e2pdf-pl10'>{$this->get_vm_element(__("Menu Order", "e2pdf"), 'menu_order')}</div>";
734 $vc .= "<div class='e2pdf-ib e2pdf-w50 e2pdf-pr10'>{$this->get_vm_element(__("Type", "e2pdf"), 'post_type')}</div>";
735 $vc .= "<div class='e2pdf-ib e2pdf-w50 e2pdf-pl10'>{$this->get_vm_element(__("Mime Type", "e2pdf"), 'post_mime_type')}</div>";
736 $vc .= "<div class='e2pdf-ib e2pdf-w50 e2pdf-pr10'>{$this->get_vm_element(__("Comments Count", "e2pdf"), 'comment_count')}</div>";
737 $vc .= "<div class='e2pdf-ib e2pdf-w50 e2pdf-pl10'>{$this->get_vm_element(__("Filter", "e2pdf"), 'filter')}</div>";
738 $vc .= "<div class='e2pdf-ib e2pdf-w50 e2pdf-pr10'>{$this->get_vm_element(__("Post Thumbnail", "e2pdf"), 'post_thumbnail')}</div>";
739 $vc .= "</div>";
740 return $vc;
741 }
742
743 private function get_vm_element($name, $id) {
744 $element = "<div>";
745 $element .= "<label>{$name}:</label>";
746 $element .= "<input type='text' name='[{$id}]' value='[{$id}]' class='e2pdf-w100'>";
747 $element .= "</div>";
748 return $element;
749 }
750
751 }
752